/**
 * @license RequireJS i18n 2.0.2 Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved.
 * Available via the MIT or new BSD license.
 * see: http://github.com/requirejs/i18n for details
 */

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

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

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

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

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

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

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

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

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

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

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

/**
 * @license RequireJS text 2.0.5 Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved.
 * Available via the MIT or new BSD license.
 * see: http://github.com/requirejs/text for details
 */

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

/*
 * Copyright 2012, Mozilla Foundation and contributors
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/*******************************************************************************
 * @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:
 *     Kris De Volder (VMWare) - initial API and implementation
 *******************************************************************************/

/**
 * marked - a markdown parser
 * Copyright (c) 2011-2013, Christopher Jeffrey. (MIT Licensed)
 * https://github.com/chjj/marked
 */

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

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

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

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

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

/*

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

 Contributors: IBM Corporation - initial API and implementation

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


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


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


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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation
 RequireJS text 2.0.5 Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved.
 Available via the MIT or new BSD license.
 see: http://github.com/requirejs/text for details

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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


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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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


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


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


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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

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

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

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors:  IBM Corporation - initial API and implementation

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


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


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

 Contributors:
 IBM Corporation - initial API and implementation

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

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

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

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

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

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

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


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


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

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

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

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

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

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

 Contributors: IBM Corporation - initial API and implementation

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

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

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors:
 Kris De Volder (VMWare) - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

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

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

 Contributors: IBM Corporation - _initial API and implementation

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


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


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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

 Copyright (c) 2012, 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:
 Kris De Volder (VMWare) - initial API and implementation
 RequireJS i18n 2.0.2 Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved.
 Available via the MIT or new BSD license.
 see: http://github.com/requirejs/i18n for details

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors:
 Kris De Volder (VMWare) - initial API and implementation
*/
(function(){function j(b,d,f,h,a,e){d[b]&&(f.push(b),(d[b]===!0||d[b]===1)&&h.push(a+b+"/"+e))}function i(b,d,f,h,a){d=h+d+"/"+a;require._fileExists(b.toUrl(d+".js"))&&f.push(d)}function g(b,d,f){for(var h in d)d.hasOwnProperty(h)&&(!b.hasOwnProperty(h)||f)?b[h]=d[h]:typeof d[h]==="object"&&g(b[h],d[h],f)}var d=/(^.*(^|\/)nls(\/|$))([^\/]*)\/?([^\/]*)/;define("i18n",["module"],function(b){var k=b.config?b.config():{};return{version:"2.0.1+",load:function(b,h,a,e){e=e||{};if(e.locale)k.locale=e.locale;
var c=d.exec(b),l=c[1],m=c[4],n=c[5],o=m.split("-"),p=[],u={},r,t="";if(c[5])l=c[1],b=l+n;else{n=c[4];m=k.locale;if(!m)m=k.locale=typeof navigator==="undefined"?"root":(navigator.language||navigator.userLanguage||"root").toLowerCase();o=m.split("-")}if(e.isBuild){p.push(b);i(h,"root",p,l,n);for(r=0;r<o.length;r++)e=o[r],t+=(t?"-":"")+e,i(h,t,p,l,n);h(p,function(){a()})}else h([b],function(c){var e=[],b;j("root",c,e,p,l,n);for(r=0;r<o.length;r++)b=o[r],t+=(t?"-":"")+b,j(t,c,e,p,l,n);h(p,function(){var b,
f,m;for(b=e.length-1;b>-1&&e[b];b--){m=e[b];f=c[m];if(f===!0||f===1)f=h(l+m+"/"+n);g(u,f)}a(u)})})}}})})();
define("orion/i18n",[],function(){return{load:function(j,i,g,d){var d=d||{},b=/(^.*(?:^|\/)nls(?:\/|$))([^\/]*)\/?([^\/]*)/,k=b.exec(j);if(k){if(!i.defined||i.defined(j))try{g(i(j));return}catch(f){}if(d.isBuild||d.isTest)g({});else if(i.specified&&!i.specified("orion/bootstrap"))g({});else{var h=k[1],a=k[3]?k[2]:"",e=k[3]||k[2];i(["orion/bootstrap"],function(c){c.startup().then(function(c){var f=c.serviceRegistry,c=f.getServiceReferences("orion.i18n.message");if(a)c.some(function(c){return j===c.getProperty("name")?
(f.getService(c).getMessageBundle().then(function(c){g(c)},function(){g({})}),!0):!1})||g({});else{var n={},o;c.forEach(function(c){var l=c.getProperty("name");if((k=b.exec(l))&&h===k[1]&&e===(k[3]||k[2]))if(a=k[3]?k[2]:""){if((c=d.locale||(typeof navigator!=="undefined"?navigator.language||navigator.userLanguage:null))&&c.toLowerCase().indexOf(a.toLowerCase())===0)n[a]=!0,(!i.specified||!i.specified(l))&&define(l,["orion/i18n!"+l],function(c){return c})}else o=c});!i.specified||!i.specified(j)?o?
f.getService(o).getMessageBundle().then(function(c){Object.keys(n).forEach(function(a){typeof c[a]==="undefined"&&(c[a]=n[a])});define(j,[],c);g(c)},function(){define(j,[],n);g(n)}):(define(j,[],n),g(n)):g(n)}})})}}else g(null)}}});
define("orion/shell/nls/root/messages",{Shell:"Shell","Changed to: ":"Changed to: ","Initial directory: ":"Initial directory: ","${0} is not a directory":"${0} is not a directory","${0} was not found":"${0} was not found","Changes the current directory":"Changes the current directory","The name of the directory":"The name of the directory","Edits a file":"Edits a file","The name of the file":"The name of the file","Lists the files in the current directory":"Lists the files in the current directory",
"Prints the current directory location":"Prints the current directory location","Clears the shell screen":"Clears the shell screen","'${0}' is not valid":"'${0}' is not valid","Error: ${0}":"Error: ${0}",NoResponseFromServer:"No response from server for ${0}. Check your internet connection and try again.",ServerError:"Server error: ${0} returned ${1} ${2}",Succeeded:"Succeeded",Aborted:"Aborted","The name of the plug-in":"The name of the plug-in","The name of the contributed plug-in":"The name of the contributed plug-in",
"Lists all registered plug-ins":"Lists all registered plug-ins","Reloads a plug-in":"Reloads a plug-in","Disables a contributed plug-in":"Disables a contributed plug-in","Enables a contributed plug-in":"Enables a contributed plug-in","Uninstalls a contributed plug-in from the configuration":"Uninstalls a contributed plug-in from the configuration","Plug-in is already installed":"Plug-in is already installed","Invalid plug-in URL":"Invalid plug-in URL","Installs a plug-in from a URL":"Installs a plug-in from a URL",
"The plug-in URL":"The plug-in URL","Commands for working with plug-ins":"Commands for working with plug-ins","Are you sure you want to uninstall all contributed plug-ins?":"Are you sure you want to uninstall all contributed plug-ins?","Displays a plug-in's services":"Displays a plug-in's services","Commands for working with a service":"Commands for working with a service","Displays all plug-in contributions for a service":"Displays all plug-in contributions for a service","The service identifier":"The service identifier",
disabled:"disabled","Open Shell":"Open Shell","Open Shell page":"Open the Shell page with this folder as the current directory.","'${0}' already exists":"'${0}' already exists","Source file service does not support binary read":"Source file service does not support binary read","Target file service does not support binary write":"Target file service does not support binary write","Cannot create file, it already exists as a directory":"Cannot create file, it already exists as a directory","Cannot create directory, it already exists as a file":"Cannot create directory, it already exists as a file",
"Wrote ${0}":"Wrote ${0}","Failed to write ${0}":"Failed to write ${0}","Cannot write ${0}, it is not a descendent of the output directory":"Cannot write ${0}, it is not a descendent of the output directory","The file or directory to re-direct output to":"The file or directory to re-direct output to"});
define("orion/shell/nls/messages",["orion/i18n!orion/shell/nls/messages","orion/shell/nls/root/messages"],function(j,i){var g={root:i};Object.keys(j).forEach(function(d){typeof g[d]==="undefined"&&(g[d]=j[d])});return g});
(function(){function j(){for(var b=navigator.userAgent,d={browser:!1,version:!1},f=[{name:"Chrome/Chromium",regExp:/(?:chrome|crios|chromium)\/(\d+)/i,minVersion:24},{name:"Firefox",regExp:/firefox\/(\d+)/i,minVersion:17},{name:"Microsoft Internet Explorer",regExp:/msie\s(\d+)/i,minVersion:10},{name:"Microsoft Internet Explorer",regExp:/Trident\/(\d+)/i,minVersion:6},{name:"Safari",regExp:/version\/(\d+).*?safari/i,minVersion:6}],h=0;h<f.length;h++){var a=f[h],e=b.match(a.regExp);if(e){d.browser=
!0;d.version=e[1]>=a.minVersion;d.name=a.name;break}}return d}function i(){try{return"localStorage"in window&&window.localStorage!==null}catch(b){return!1}}function g(b){alert(b);throw Error("unsupported browser");}var d=j();if(d.browser)d.version||g("Sorry, your browser version is not supported.\n\nTo use Orion, please upgrade to the latest version of "+d.name+".\n");else if(i()&&!localStorage.skipBrowserCheck)if(confirm("Sorry, your browser is not supported. The latest version of Chrome, Firefox or Safari web browser is recommended.\nContinue anyway?"))localStorage.skipBrowserCheck=
1;else throw"unsupported browser";else i()||g("Sorry, your browser is not supported.\n\nTo use Orion, the latest version of the Chrome, Firefox, or Safari web browser is recommended.\n");return{isSupportedBrowser:j,supportsLocalStorage:i,throwBrowserAlert:g}})();define("orion/browserCompatibility",function(){});
(function(j,i){typeof define==="function"&&define.amd?define("orion/Deferred",i):typeof exports==="object"?module.exports=i():(j.orion=j.orion||{},j.orion.Deferred=i())})(this,function(){function j(){for(var f;f=b.shift();)f();k=!1}function i(f){b.push(f);k||(k=!0,setTimeout(j,0))}function g(b){return function(){b.apply(void 0,arguments)}}function d(){function f(){for(var a;a=m.shift();){var e=a.deferred,h=l==="fulfilled"?"resolve":"reject";if(typeof a[h]==="function")try{var f=(0,a[h])(c),d=f&&(typeof f===
"object"||typeof f==="function")&&f.then;if(typeof d==="function")if(f===e.promise)e.reject(new TypeError);else{var n=f.cancel;typeof n==="function"?e._protected(b).parentCancel=n.bind(f):delete e._protected(b).parentCancel;d.call(f,g(e.resolve),g(e.reject),g(e.progress))}else e.resolve(f)}catch(o){e.reject(o)}else e[h](c)}}function h(a){delete o.parentCancel;l="rejected";c=a;m.length&&i(f)}function a(e){function b(c){return function(a){k||(k=!0,c(a))}}var k=!1;delete o.parentCancel;try{var g=e&&
(typeof e==="object"||typeof e==="function")&&e.then;if(typeof g==="function")if(e===n)h(new TypeError);else{l="assumed";var j=e&&e.cancel;if(typeof j!=="function"){var v=new d,e=v.promise;try{g(v.resolve,v.reject,v.progress)}catch(w){v.reject(w)}j=e.cancel;g=e.then}c=e;g.call(e,b(a),b(h));o.parentCancel=j.bind(e)}else l="fulfilled",c=e,m.length&&i(f)}catch(C){b(h)(C)}}function e(){var c=o.parentCancel;if(c)delete o.parentCancel,c();else if(!l)c=Error("Cancel"),c.name="Cancel",h(c)}var c,l,m=[],n=
this,o={};Object.defineProperty(this,"_protected",{value:function(c){if(c!==b)throw Error("protected");return o}});this.resolve=function(c){l||a(c);return n};this.reject=function(c){l||h(c);return n};this.progress=function(c){l||m.forEach(function(a){if(a.progress)try{a.progress(c)}catch(e){}});return n.promise};this.cancel=function(){o.parentCancel?setTimeout(e,0):e();return n};this.then=function(c,a,e){c={resolve:c,reject:a,progress:e,deferred:new d};m.push(c);c.deferred._protected(b).parentCancel=
n.promise.cancel.bind(n);(l==="fulfilled"||l==="rejected")&&i(f);return c.deferred.promise};this.promise={then:n.then,cancel:n.cancel}}var b=[],k=!1;d.all=function(b,h){function a(a,e){m||(l[a]=e,--c===0&&n.resolve(l))}function e(c,e){if(!m){if(h)try{a(c,h(e));return}catch(l){e=l}n.reject(e)}}var c=b.length,l=[],m=!1,n=new d;n.then(void 0,function(){m=!0;b.forEach(function(c){c.cancel&&c.cancel()})});c===0?n.resolve(l):b.forEach(function(c,l){c.then(a.bind(void 0,l),e.bind(void 0,l))});return n.promise};
d.when=function(b,h,a,e){var c;if(!(b&&typeof b.then==="function"))c=new d,c.resolve(b),b=c.promise;return b.then(h,a,e)};return d});
define("orion/EventTarget",[],function(){function j(){this._namedListeners={}}j.prototype={dispatchEvent:function(i){if(!i.type)throw Error("unspecified type");var g=this._namedListeners[i.type];g&&g.forEach(function(d){try{typeof d==="function"?d(i):d.handleEvent(i)}catch(b){typeof console!=="undefined"&&console.log(b)}});return!i.defaultPrevented},addEventListener:function(i,g){if(typeof g==="function"||g.handleEvent)this._namedListeners[i]=this._namedListeners[i]||[],this._namedListeners[i].push(g)},
removeEventListener:function(i,g){var d=this._namedListeners[i];if(d)for(var b=0;b<d.length;b++)if(d[b]===g){d.length===1?delete this._namedListeners[i]:d.splice(b,1);break}}};j.prototype.constructor=j;j.attach=function(i){var g=new j;i.dispatchEvent=g.dispatchEvent.bind(g);i.addEventListener=g.addEventListener.bind(g);i.removeEventListener=g.removeEventListener.bind(g)};return j});
define("orion/serviceregistry",["orion/Deferred","orion/EventTarget"],function(j,i){function g(b,a,e){this._properties=e||{};this._properties["service.id"]=b;this._properties.objectClass=a;this._properties["service.names"]=a}function d(b,a,e){this._serviceId=b;this._serviceReference=a;this._internalRegistry=e}function b(b,a){function e(c){return function(){var e;try{if(!a())throw Error("Service was unregistered");var f=b[c].apply(b,Array.prototype.slice.call(arguments));if(f&&typeof f.then==="function")return f;
else e=new j,e.resolve(f)}catch(d){e=new j,e.reject(d)}return e.promise}}for(var c in b)typeof b[c]==="function"&&(this[c]=e(c))}function k(b,a){this.type=b;this.serviceReference=a}function f(){this._entries=[];this._namedReferences={};this._serviceEventTarget=new i;var b=this;this._internalRegistry={isRegistered:function(a){return b._entries[a]?!0:!1},unregisterService:function(a){var e=b._entries[a];if(!e)throw Error("Service has already been unregistered: "+a);var c=e.reference;b._serviceEventTarget.dispatchEvent(new k("unregistering",
c));b._entries[a]=null;c.getProperty("objectClass").forEach(function(a){for(var e=b._namedReferences[a],f=0;f<e.length;f++)if(e[f]===c){e.length===1?delete b._namedReferences[a]:e.splice(f,1);break}})},modifyService:function(a){var e=b._entries[a];if(!e)throw Error("Service not found while trying to send modified event: "+a);b._serviceEventTarget.dispatchEvent(new k("modified",e.reference))}}}g.prototype={getPropertyKeys:function(){var b=[],a;for(a in this._properties)this._properties.hasOwnProperty(a)&&
b.push(a);return b},getProperty:function(b){return this._properties[b]}};g.prototype.constructor=g;d.prototype={unregister:function(){this._internalRegistry.unregisterService(this._serviceId)},getReference:function(){if(!this._internalRegistry.isRegistered(this._serviceId))throw Error("Service has already been unregistered: "+this._serviceId);return this._serviceReference},setProperties:function(b){var a=this._serviceReference._properties;this._serviceReference._properties=b||{};b["service.id"]=this._serviceId;
b.objectClass=a.objectClass;b["service.names"]=a["service.names"];this._internalRegistry.modifyService(this._serviceId)}};d.prototype.constructor=d;f.prototype={getService:function(b){var a;if(typeof b==="string")(b=this._namedReferences[b])&&b.some(function(e){a=this._entries[e.getProperty("service.id")].service;return!!a},this);else if(b=this._entries[b.getProperty("service.id")])a=b.service;return a||null},getServiceReferences:function(b){if(b)return this._namedReferences[b]?this._namedReferences[b]:
[];var a=[];this._entries.forEach(function(e){e&&a.push(e.reference)});return a},registerService:function(f,a,e){if(typeof a==="undefined"||a===null)throw Error("invalid service");typeof f==="string"?f=[f]:Array.isArray(f)||(f=[]);var c=this._entries.length,l=new g(c,f,e),m=this._namedReferences;f.forEach(function(c){m[c]=m[c]||[];m[c].push(l)});f=new b(a,this._internalRegistry.isRegistered.bind(null,c));this._entries.push({reference:l,service:f});f=this._internalRegistry;this._serviceEventTarget.dispatchEvent(new k("registered",
l));return new d(c,l,f)},addEventListener:function(b,a){this._serviceEventTarget.addEventListener(b,a)},removeEventListener:function(b,a){this._serviceEventTarget.removeEventListener(b,a)}};f.prototype.constructor=f;return{ServiceRegistry:f}});
define("orion/xhr",["orion/Deferred"],function(j){function i(g,d,b,k){var f=typeof b.response!=="undefined"?b.response:b.responseText,h;try{h=b.status}catch(a){h=0}g={args:d,response:f,responseText:typeof f==="string"?f:null,status:h,url:g,xhr:b};if(typeof k!=="undefined")g.error=k;return g}return function(g,d,b){var b=b||{},k=arguments.length>3&&arguments[3]?arguments[3]:new XMLHttpRequest,f=new j,h=b.headers||{},a=b.log||!1,e;typeof h["X-Requested-With"]==="undefined"&&(h["X-Requested-With"]="XMLHttpRequest");
if(typeof b.data!=="undefined"&&(g==="POST"||g==="PUT"))e=b.data;var c=!1,l=!1;f.promise.then(void 0,function(a){c=!0;!l&&a instanceof Error&&a.name==="Cancel"&&k.abort()});k.onabort=function(){l=!0;if(!c){var a=Error("Cancel");a.name="Cancel";f.reject(a)}};k.onload=function(){var c=i(d,b,k);200<=k.status&&k.status<400?f.resolve(c):(f.reject(c),a&&typeof console!=="undefined"&&console.log(Error(k.statusText)))};k.onerror=function(){var c=i(d,b,k);f.reject(c);a&&typeof console!=="undefined"&&console.log(Error(k.statusText))};
k.onprogress=function(c){c.xhr=k;f.progress(c)};try{k.open(g,d,!0);if(typeof b.responseType==="string")k.responseType=b.responseType;if(typeof b.timeout==="number")if(typeof k.timeout==="number")k.timeout=b.timeout,k.addEventListener("timeout",function(){f.reject(i(d,b,k,"Timeout exceeded"))});else{var m=setTimeout(function(){f.reject(i(d,b,k,"Timeout exceeded"))},b.timeout);f.promise.then(clearTimeout.bind(null,m),clearTimeout.bind(null,m))}Object.keys(h).forEach(function(c){k.setRequestHeader(c,
h[c])});k.send(e||null)}catch(n){f.reject(i(d,b,k,n))}return f.promise}});
define("orion/preferences",["require","orion/Deferred","orion/xhr"],function(j,i,g){function d(a,c){this._name=a;this._providers=c;this._flushPending=!1;this._cached=null;this._stores=[];this._pendingDeletes=[];this._dirty=[]}function b(a,c){return{get:function(l,b){if(c===0)return null;var f=localStorage.getItem(a+l);if(f===null)return null;f=JSON.parse(f);return b||c===-1||f._expires&&f._expires>(new Date).getTime()?(delete f._expires,f):null},set:function(l,b){if(c!==0){if(c!==-1)b._expires=(new Date).getTime()+
1E3*c;if(Object.keys(b).length===0)localStorage.removeItem(a+l);else{var f=JSON.stringify(b);localStorage.setItem(a+l,f);delete b._expires}}},remove:function(c){localStorage.removeItem(a+c)}}}function k(a){this._currentPromises={};this._cache=new b("/orion/preferences/user",3600);this._service=null;this.available=function(){if(!this._service){var c=a.getServiceReferences("orion.core.preference.provider");if(c.length>0)this._service=a.getService(c[0])}return!!this._service}}function f(a){this._location=
a;this._currentPromise=null;this._cache=new b("/orion/preferences/default",3600)}function h(){this._cache=new b("/orion/preferences/local",-1)}function a(a,c){this._userProvider=new k(a);this._localProvider=new h;c=c||"defaults.pref";c.indexOf("://")===-1&&(c=j.toUrl(c));this._defaultsProvider=new f(c);this._serviceRegistration=a.registerService("orion.core.preference",this)}d.prototype={_flush:function(){for(var a=[],c=0;c<this._stores.length;++c){var l=this._stores[c];this._dirty.indexOf(l)!==-1&&
a.push(this._providers[c].put(this._name,l));if(this._pendingDeletes[c]&&this._pendingDeletes[c].length>0){for(l=0;l<this._pendingDeletes[c].length;l++)a.push(this._providers[c].remove(this._name,this._pendingDeletes[c][l]));delete this._pendingDeletes[c]}}this._dirty=[];return i.all(a)},_scheduleFlush:function(a){a&&this._dirty.indexOf(a)===-1&&this._dirty.push(a);if(!this._flushPending)this._flushPending=!0,window.setTimeout(function(){if(this._flushPending)this._flushPending=!1,this._flush()}.bind(this),
0)},_getCached:function(){if(!this._cached){this._cached={};for(var a=0;a<this._stores.length;++a){var c=this._stores[a],l;for(l in c)c.hasOwnProperty(l)&&typeof this._cached[l]==="undefined"&&(this._cached[l]=c[l])}}return this._cached},keys:function(){return Object.keys(this._getCached())},get:function(a){return this._getCached()[a]},put:function(a,c){if(this._stores.length!==0){var l=this._stores[0];if(l[a]!==c)l[a]=c,this._cached=null,this._scheduleFlush(l)}},remove:function(a){for(var c=0;c<
this._stores.length;++c){var l=this._stores[c];if(l.hasOwnProperty(a))return delete l[a],this._pendingDeletes[c]||(this._pendingDeletes[c]=[]),this._pendingDeletes[c].push(a),this._cached=null,this._scheduleFlush(),!0}return!1},clear:function(){for(var a=0;a<this._stores.length;++a)this._stores[a]={},this._scheduleFlush(this._stores[a]);this._cached=null},sync:function(a){if(this._flushPending)return this._flushPending=!1,this._flush();for(var c=this,l=[],b=0;b<this._providers.length;++b)l.push(this._providers[b].get(this._name,
a).then(function(a){return function(e){c._stores[a]=e}}(b)));return i.all(l).then(function(){c._cached=null;c._getCached()})},flush:function(){this._flush()}};k.prototype={get:function(a,c){if(this._currentPromises[a])return this._currentPromises[a];var l=new i,b=null;c?this._cache.remove(a):b=this._cache.get(a);if(b!==null)l.resolve(b);else{this._currentPromises[a]=l;var f=this;this._service.get(a).then(function(c){f._cache.set(a,c);delete f._currentPromises[a];l.resolve(c)},function(c){c.status===
404?(c={},f._cache.set(a,c),delete f._currentPromises[a],l.resolve(c)):(delete f._currentPromises[a],l.resolve(f._cache.get(a,!0)||{}))})}return l},put:function(a,c){this._cache.set(a,c);return this._service.put(a,c)},remove:function(a,c){var l=this._cache.get(a);delete l[c];this._cache.set(a,l);return this._service.remove(a,c)}};f.prototype={get:function(a,c){if(this._currentPromise)return this._currentPromise;var l=new i,b=null;c?this._cache.remove(a):b=this._cache.get(a);if(b!==null)l.resolve(b);
else{this._currentPromise=l;var f=this;g("GET",this._location,{headers:{"Orion-Version":"1"},timeout:15E3}).then(function(c){c=JSON.parse(c.response);f._cache.set(a,c[a]||{});f._currentPromise=null;l.resolve(c[a]||{})},function(c){c.xhr.status===401||c.xhr.status===404?(f._cache.set(a,{}),f._currentPromise=null,l.resolve({})):(f._currentPromise=null,c=f._cache.get(a,!0),c!==null?l.resolve(c[a]||{}):l.resolve({}))})}return l},put:function(){var a=new i;a.resolve();return a},remove:function(a,c){var l=
this._cache.get(a);delete l[c];this.put(a,l)}};h.prototype={get:function(a){var c=new i,a=this._cache.get(a);a!==null?c.resolve(a):c.resolve({});return c},put:function(a,c){var l=new i;this._cache.set(a,c);l.resolve();return l},remove:function(a,c){var l=this._cache.get(a);delete l[c];this.put(a,l)}};a.DEFAULT_SCOPE=1;a.LOCAL_SCOPE=2;a.USER_SCOPE=4;a.prototype={listenForChangedSettings:function(e,c,l){if(!c||typeof c!=="number"||c>7||c<1)l=c,c=a.DEFAULT_SCOPE|a.LOCAL_SCOPE|a.USER_SCOPE;window.addEventListener("storage",
l,!1);if((a.USER_SCOPE&c)!==0)return"/orion/preferences/user"+e;else if((a.LOCAL_SCOPE&c)!==0)return"/orion/preferences/local"+e;return"/orion/preferences/default"+e},getPreferences:function(e,c){if(!c||typeof c!=="number"||c>7||c<1)c=a.DEFAULT_SCOPE|a.LOCAL_SCOPE|a.USER_SCOPE;var l=[];a.USER_SCOPE&c&&this._userProvider.available()&&l.push(this._userProvider);a.LOCAL_SCOPE&c&&l.push(this._localProvider);a.DEFAULT_SCOPE&c&&l.push(this._defaultsProvider);var b=new d(e,l);return b.sync().then(function(){return b})},
getSetting:function(a,c,l){for(var b,f=0;f<a.length;f++)if(a[f].label===c)for(var h=0;h<a[f].data.length;h++)if(a[f].data[h].label===l){b=a[f].data[h].value;break}return b}};return{PreferencesService:a}});
(function(){function j(a){if(typeof a!=="string")throw new TypeError;}function i(a){return a?a.split("&"):[]}function g(a){return a.length===0?"":a.join("&")}function d(a){var c=/([^=]*)(?:=?)(.*)/.exec(a),a=c[1]?decodeURIComponent(c[1]):"",c=c[2]?decodeURIComponent(c[2]):"";return[a,c]}function b(a){var c=encodeURIComponent(a[0]);a[1]&&(c+="="+encodeURIComponent(a[1]));return c}function k(a,c){var e="",l=[],b=0;return{next:function(){if(e!==a.query)e=a.query,l=i(e);if(b<l.length){var f=d(l[b++]);
switch(c){case "keys":return f[0];case "values":return f[1];case "keys+values":return[f[0],f[1]];default:throw new TypeError;}}throw E;}}}function f(a){Object.defineProperty(this,"_url",{get:function(){return a._url}})}function h(a){return a?/[1-9]\d*$/.exec(a)[0]:""}function a(a){var c=[];a.split("/").forEach(function(a){a===".."?c.pop():a!=="."&&c.push(a)});return c.join("/")}function e(a){return a.replace(/\s/g,function(a){return"%"+a.charCodeAt(0).toString(16)})}function c(c,l){if(typeof c!==
"string")throw new TypeError;var c=e(c),b=o.exec(c);if(!b)return null;var f={};f.scheme=b[1]||"";if(f.scheme&&!u.test(f.scheme))return null;var m=b[2];if(m&&(m=p.exec(m),f.userinfo=m[1],f.host=m[2],f.port=m[3],f.port&&!r.test(f.port)))return null;f.path=b[3];f.query=b[4];f.fragment=b[5];if(!f.scheme&&l&&(f.scheme=l.scheme,!f.host&&l.host))f.userinfo=l.userinfo,f.host=l.host,f.port=l.port,f.pathRelative=!0;if(f.pathRelative)if(f.path){if(f.path[0]!=="/")b=/^(.*\/)[^\/]*$/.exec(l.path)[1]||"/",f.path=
b+f.path}else f.path=l.path;if(f.scheme)f.scheme=f.scheme.toLowerCase();if(f.port)f.port=h(f.port);if(f.host&&f.path)f.path=a(f.path);return f}function l(a,e){var l;if(e){e=e.href||e;l=c(e);if(!l||!l.scheme)throw new SyntaxError;Object.defineProperty(this,"_baseURL",{value:l})}l=c(a,l);if(!l)throw new SyntaxError;Object.defineProperty(this,"_input",{value:a,writable:!0});Object.defineProperty(this,"_url",{value:l,writable:!0});var b=new f(this);Object.defineProperty(this,"query",{get:function(){return this._url?
b:null},enumerable:!0})}try{var m;if(typeof window.URL==="function"&&window.URL.length!==0&&(m=new window.URL("http://www.w3.org?q")).protocol==="http:"&&m.query)return}catch(n){}var o=/^(?:([^:\/?#]+):)?(?:\/\/([^\/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?$/,p=/^(?:(.*)@)?(\[[^\]]*\]|[^:]*)(?::(.*))?$/,u=/^([a-zA-Z](?:[a-zA-Z0-9+-.])*)$/,r=/^\d*$/,t=/^(\[[^\]\/?#\s]*\]|[^:\/?#\s]*)$/,q=/^(\[[^\]\/?#\s]*\]|[^:\/?#\s]*)(?::(\d*))?$/,v=/^([^?#\s]*)$/,w=/^([^\s]*)$/,C=/^\S*$/,B=/([^:]*):?(.*)/,E=typeof StopIteration!==
"undefined"?StopIteration:Error("Stop Iteration"),D={"ftp:":"21","gopher:":"70","http:":"80","https:":"443","ws:":"80","wss:":"443"};Object.defineProperties(f.prototype,{get:{value:function(a){j(a);var c;i(this._url.query).some(function(e){e=d(e);if(e[0]===a)return c=e[1],!0});return c},enumerable:!0},set:{value:function(a,c){j(a);j(c);var e=i(this._url.query);e.some(function(l,f){var h=d(l);if(h[0]===a)return h[1]=c,e[f]=b(h),!0})||e.push(b([a,c]));this._url.query=g(e)},enumerable:!0},has:{value:function(a){j(a);
return i(this._url.query).some(function(c){if(d(c)[0]===a)return!0})},enumerable:!0},"delete":{value:function(a){j(a);var c=i(this._url.query),e=c.filter(function(c){return d(c)[0]!==a});return e.length!==c.length?(this._url.query=g(e),!0):!1},enumerable:!0},clear:{value:function(){this._url.query=""},enumerable:!0},forEach:{value:function(a,c){if(typeof a!=="function")throw new TypeError;var e=k(this._url,"keys+values");try{for(;;){var l=e.next();a.call(c,l[1],l[0],this)}}catch(b){if(b!==E)throw b;
}},enumerable:!0},keys:{value:function(){return k(this._url,"keys")},enumerable:!0},values:{value:function(){return k(this._url,"values")},enumerable:!0},items:{value:function(){return k(this._url,"keys+values")}},size:{get:function(){return i(this._url.query).length},enumerable:!0},getAll:{value:function(a){j(a);var c=[];i(this._url.query).forEach(function(e){e=d(e);e[0]===a&&c.push(e[1])});return c},enumerable:!0},append:{value:function(a,c){j(a);j(c);var e=i(this._url.query);e.push(b([a,c]));this._url.query=
g(e)},enumerable:!0}});Object.defineProperties(l.prototype,{href:{get:function(){var a;if(this._url){a=this._url;var c=a.scheme?a.scheme+":":"";a.host&&(c+="//",a.userinfo&&(c+=a.userinfo+"@"),c+=a.host,a.port&&(c+=":"+a.port));c+=a.path;a.query&&(c+="?"+a.query);a.fragment&&(c+="#"+a.fragment);a=c}else a=this._input;return a},set:function(a){j(a);this._input=a;this._url=c(this._input,this._baseURL)},enumerable:!0},origin:{get:function(){return this._url&&this._url.host?this.protocol+"//"+this.host:
""},enumerable:!0},protocol:{get:function(){return this._url?this._url.scheme+":":":"},set:function(a){j(a);if(this._url&&(a=a.slice(-1)===":"?a.substring(0,a.length-1):a,a===""||u.test(a)))this._url.scheme=a.toLowerCase()},enumerable:!0},_userinfo:{get:function(){return this._url?this._url.userinfo:""},set:function(a){j(a);if(this._url)this._url.userinfo=a}},username:{get:function(){if(!this._url)return"";var a=B.exec(this._userinfo);return decodeURIComponent(a[1]||"")},set:function(a){j(a);if(this._url){var c=
B.exec(this._userinfo),a=[encodeURIComponent(a||"")];c[2]&&a.push(c[2]);this._userinfo=a.join(":")}},enumerable:!0},password:{get:function(){if(!this._url)return"";var a=B.exec(this._userinfo);return decodeURIComponent(a[2]||"")},set:function(a){j(a);if(this._url){var c=[B.exec(this._userinfo)[1]||""];a&&c.push(encodeURIComponent(a));this._userinfo=c.join(":")}},enumerable:!0},host:{get:function(){var a="";this._url&&this._url.host&&(a+=this._url.host,this._url.port&&(a+=":"+this._url.port));return a},
set:function(a){j(a);if(this._url&&(a=q.exec(a)))this._url.host=a[1],this._url.port=h(a[2])},enumerable:!0},hostname:{get:function(){return this._url?this._url.host:""},set:function(a){j(a);if(this._url&&t.exec(a))this._url.host=a},enumerable:!0},port:{get:function(){var a=this._url?this._url.port||"":"";a&&a===D[this.protocol]&&(a="");return a},set:function(a){j(a);if(this._url&&r.exec(a))this._url.port=h(a)},enumerable:!0},pathname:{get:function(){return this._url?this._url.path:""},set:function(c){j(c);
if(this._url&&v.exec(c))this._url.host&&c&&c[0]!=="/"&&(c="/"+c),this._url.path=c?a(c):""},enumerable:!0},search:{get:function(){return this._url&&this._url.query?"?"+this._url.query:""},set:function(a){j(a);if(this._url&&(a&&a[0]==="?"&&(a=a.substring(1)),w.exec(a)))this._url.query=a},enumerable:!0},hash:{get:function(){return this._url&&this._url.fragment?"#"+this._url.fragment:""},set:function(a){j(a);if(this._url&&(a&&a[0]==="#"&&(a=a.substring(1)),C.exec(a)))this._url.fragment=a},enumerable:!0}});
if((m=window.URL||window.webkitURL)&&m.createObjectURL)Object.defineProperty(l,"createObjectURL",{value:m.createObjectURL.bind(m),enumerable:!1}),Object.defineProperty(l,"revokeObjectURL",{value:m.revokeObjectURL.bind(m),enumerable:!1});window.URL=l})();define("orion/URL-shim",function(){});
define("orion/pluginregistry",["orion/Deferred","orion/EventTarget","orion/URL-shim"],function(j,i){function g(a,c){var e=Object.keys(a),b=Object.keys(c);if(e.length!==b.length)return!1;e.sort();b.sort();for(var f=0,h=e.length;f<h;f++){var d=e[f];if(d!==b[f])return!1;var k=a[d],d=c[d];if(k!==d&&JSON.stringify(k)!==JSON.stringify(d))return!1}return!0}function d(a){if(a.indexOf("://")===-1)try{return(new URL(a,location.href)).href}catch(c){}return a}function b(a){var c=null,e={key:function(e){return(c=
c||Object.keys(a))[e]},getItem:function(c){return a[c]},setItem:function(e,b){a[e]=b;c=null},removeItem:function(e){delete a[e];c=null},clear:function(){(c=c||Object.keys(a)).forEach(function(c){delete a[c]}.bind(this));c=null}};Object.defineProperty(e,"length",{get:function(){return(c=c||Object.keys(a)).length}});return e}function k(a,c){if(c&&c instanceof XMLHttpRequest){var e,b;try{e=c.status,b=c.statusText}catch(f){e=0,b=""}return{status:e||0,statusText:b}}return c}function f(a){var c=a?JSON.parse(JSON.stringify(a,
k)):a;if(a instanceof Error)c.__isError=!0,c.message=c.message||a.message,c.name=c.name||a.name;return c}function h(a,c){this.type=a;this.plugin=c}function a(a,c){this.__objectId=a;this.__methods=c}function e(c,e,b){function d(a){H&&b.postMessage(a,H)}function k(c){if(!H)return(new j).reject(Error("plugin not connected"));c.id=String(Z++);var e=new j;S[c.id]=e;e.then(null,function(a){x==="active"&&a instanceof Error&&a.name==="Cancel"&&d({requestId:c.id,method:"cancel",params:a.message?[a.message]:
[]})});var l=Object.prototype.toString;c.params.forEach(function(b,f){if(l.call(b)==="[object Object]"&&!(b instanceof a)){var h,m;for(h in b)l.call(b[h])==="[object Function]"&&(m=m||[],m.push(h));if(m){var d=W++;T[d]=b;h=function(){delete T[d]};e.then(h,h);c.params[f]=new a(d,m)}}});b.postMessage(c,H);return e.promise}function u(a,c){a||a===0?d({id:a,result:null,error:c}):console.log(c)}function r(a,c,e,b){b.forEach(function(a,c){if(a&&typeof a.__objectId!=="undefined"){var e={};a.__methods.forEach(function(c){e[c]=
function(){return k({objectId:a.__objectId,method:c,params:Array.prototype.slice.call(arguments)})}});b[c]=e}});var l=typeof a===void 0?null:{id:a,result:null,error:null};try{var h=e.apply(c,b);if(l)h&&typeof h.then==="function"?(P[a]=h,h.then(function(c){delete P[a];l.result=c;d(l)},function(c){if(P[a])delete P[a],l.error=f(c),d(l)},function(){d({responseId:a,method:"progress",params:Array.prototype.slice.call(arguments)})})):(l.result=h,d(l))}catch(m){if(l)l.error=f(m),d(l)}}function t(a){try{if(a.method){var c=
a.method,e=a.params||[];if("serviceId"in a){var l=aa[a.serviceId];l||u(a.id,"service not found");c in l?r(a.id,l,l[c],e):u(a.id,"method not found")}else if("objectId"in a){var f=T[a.objectId];f||u(a.id,"object not found");c in f?r(a.id,f,f[c],e):u(a.id,"method not found")}else if("requestId"in a){var h=P[a.requestId];h&&c==="cancel"&&h.cancel&&h.cancel.apply(h,e)}else if("responseId"in a){var m=S[a.responseId];m&&c==="progress"&&m.progress&&m.progress.apply(m,e)}else if("plugin"===a.method){var d=
a.params[0];U({headers:d.headers,services:d.services}).then(function(){A&&A.resolve(B)})}else if("timeout"===a.method)A&&A.reject(a.error);else throw Error("Bad method: "+a.method);}else{var k=S[String(a.id)];delete S[String(a.id)];if(a.error){var g=b.handleServiceError(B,a.error);k.reject(g)}else k.resolve(a.result)}}catch(o){console.log("Plugin._messageHandler "+o)}}function q(c){var e={};if(c.methods&&(c.methods.forEach(function(a){e[a]=function(){var e={serviceId:c.serviceId,method:a,params:Array.prototype.slice.call(arguments)};
return x==="active"?k(e):B.start({"transient":!0}).then(function(){return k(e)})}}),e.addEventListener&&e.removeEventListener)){var b=new i,l=W++;T[l]={handleEvent:b.dispatchEvent.bind(b)};var f=new a(l,["handleEvent"]),h=e.addEventListener;e.addEventListener=function(a,c){b._namedListeners[a]||h(a,f);b.addEventListener(a,c)};var m=e.removeEventListener;e.removeEventListener=function(a,c){b.removeEventListener(a,c);b._namedListeners[a]||m(a,f)}}return e}function v(a){var e=JSON.parse(JSON.stringify(a.properties));
e.__plugin__=c;a=a.names||a.type||[];Array.isArray(a)||(a=[a]);e.objectClass=a;return e}function w(a){var c=q(a),e=v(a),e=b.registerService(a.names||a.type,c,e);I[a.serviceId]={registration:e,proxy:c}}function C(){b.persist(c,{created:E,headers:D,services:z,autostart:s,lastModified:y})}var B=this,e=e||{},E=e.created||(new Date).getTime(),D=e.headers||{},z=e.services||[],s=e.autostart,y=e.lastModified||0,x="installed",G,A,H,V,I={},Z=0,W=0,P={},S={},T={},aa={},U;this._persist=C;this._resolve=function(){x=
"resolved";b.dispatchEvent(new h("resolved",B))};this._getAutostart=function(){return s};this._getCreated=function(){return E};this.getLocation=function(){return c};this.getHeaders=function(){return JSON.parse(JSON.stringify(D))};this.getName=function(){var a=this.getHeaders();return a?a.name||"":null};this.getVersion=function(){var a=this.getHeaders();return a?a.version||"0.0.0":null};this.getLastModified=function(){return y};this.getServiceReferences=function(){var a=[];Object.keys(I).forEach(function(c){a.push(I[c].registration.getReference())});
return a};this.setParent=function(a){return V!==a?(V=a,B.stop({"transient":!0}).then(function(){if("started"===s)return B.start({"transient":!0});else if("lazy"===s)return B.start({lazy:!0,"transient":!0})})):(new j).resolve()};this.getState=function(){return x};this.start=function(a){if(x==="uninstalled")return(new j).reject(Error("Plugin is uninstalled"));if(G)return G.promise.then(this.start.bind(this,a));if(x==="active")return(new j).resolve();if(!a||!a.transient){var e=a&&a.lazy?"lazy":"started";
e!==s&&(s=e,C())}e=b.getState();if(e!=="starting"&&e!=="active")return a.transient?(new j).reject(Error("start transient error")):(new j).resolve();if(x==="installed")try{this._resolve()}catch(f){return(new j).reject(f)}x==="resolved"&&z.forEach(function(a){w(a)});if(a&&a.lazy)return x!=="starting"&&(x="starting",b.dispatchEvent(new h("lazy activation",B))),(new j).resolve();var m=new j;G=m;x="starting";b.dispatchEvent(new h("starting",B));A=new j;H=b.connect(c,t,V);A.then(function(){A=null;x="active";
b.dispatchEvent(new h("started",B));G=null;m.resolve()},function(){A=null;x="stopping";b.dispatchEvent(new h("stopping",B));Object.keys(I).forEach(function(a){I[a].registration.unregister();delete I[a]});b.disconnect(H);H=null;x="resolved";G=null;b.dispatchEvent(new h("stopped",B));m.reject(Error("plugin activation error"))});return m.promise};this.stop=function(a){if(x==="uninstalled")return(new j).reject(Error("Plugin is uninstalled"));if(G)return G.promise.then(this.stop.bind(this,a));if((!a||
!a.transient)&&"stopped"!==s)s="stopped",C();if(x!=="active"&&x!=="starting")return(new j).resolve();G=a=new j;x="stopping";b.dispatchEvent(new h("stopping",B));Object.keys(I).forEach(function(a){I[a].registration.unregister();delete I[a]});H&&(b.disconnect(H),H=null);x="resolved";G=null;b.dispatchEvent(new h("stopped",B));a.resolve();return a.promise};U=function(a){if(x==="uninstalled")return(new j).reject(Error("Plugin is uninstalled"));if(!a)return y===0&&(y=(new Date).getTime(),C()),b.loadManifest(c).then(U);
var e=D,f=z,m=s;D=a.headers||{};z=a.services||{};s=a.autostart||s;a.lastModified?y=a.lastModified:(y=(new Date).getTime(),C());if(g(D,e)&&g(z,f)&&s===m)return(new j).resolve();if(x==="active"||x==="starting"){var d=[];Object.keys(z).forEach(function(a){var c=z[a];d.push(a);var e=I[a];if(e){if(g(c.methods,Object.keys(e.proxy))){var a=v(c),b=e.registration.getReference(),l={};b.getPropertyKeys().forEach(function(a){l[a]=b.getProperty(a)});g(a,l)||e.registration.setProperties(a);return}e.registration.unregister();
delete I[a]}w(c)});Object.keys(I).forEach(function(a){d.indexOf(a)===-1&&(I[a].registration.unregister(),delete I[a])})}x==="active"&&(b.disconnect(H),A=new j,H=b.connect(c,t,V),A.then(function(){A=null},function(){A=null;x="stopping";b.dispatchEvent(new h("stopping"),B);Object.keys(I).forEach(function(a){I[a].registration.unregister();delete I[a]});b.disconnect(H);H=null;x="resolved";b.dispatchEvent(new h("stopped",B))}));return(new j).resolve()};this.update=function(a){return U(a).then(function(){b.dispatchEvent(new h("updated",
B))})};this.uninstall=function(){if(x==="uninstalled")return(new j).reject(Error("Plugin is uninstalled"));if(x==="active"||x==="starting"||x==="stopping")return this.stop().then(this.uninstall.bind(this),this.uninstall.bind(this));b.removePlugin(this);x="uninstalled";b.dispatchEvent(new h("uninstalled",B));return(new j).resolve()}}var c=/^http[s]?/i;return{Plugin:e,PluginRegistry:function(a,f){function n(a){var c=a.source;t.some(function(e){if(c===e.target){try{var b;if(typeof e.useStructuredClone===
"undefined"){var l=typeof a.data!=="string";b=l?a.data:JSON.parse(a.data);e.useStructuredClone=l}else b=e.useStructuredClone?a.data:JSON.parse(a.data);e.handler(b)}catch(f){}return!0}})}var f=f||{},k=f.storage||localStorage;k.getItem||(k=b(k));var g="installed",u,r=[],t=[],q=new i,v={},w={registerService:a.registerService.bind(a),connect:function(a,c,e,b){function l(a){a=Error(a);a.name="timeout";c({method:"timeout",error:a})}var f={handler:c,url:a},h=setTimeout(l.bind(null,"Load timeout for: "+a),
b||15E3),m=document.createElement("iframe");m.name=a+"_"+(new Date).getTime();m.src=a;m.onload=function(){clearTimeout(h);h=setTimeout(l.bind(null,"Plugin handshake timeout for: "+a),5E3)};m.sandbox="allow-scripts allow-same-origin";m.style.width=m.style.height="100%";m.frameBorder=0;(e||u).appendChild(m);f.target=m.contentWindow;f.close=function(){clearTimeout(h);if(m){var a=m.parentNode;a&&a.removeChild(m);m=null}};t.push(f);return f},disconnect:function(a){for(var c=0;c<t.length;c++)if(a===t[c]){t.splice(c,
1);try{a.close()}catch(e){}break}},removePlugin:function(a){for(var c=0;c<r.length;c++)if(a===r[c]){r.splice(c,1);break}k.removeItem("plugin."+a.getLocation())},persist:function(a,c){k.setItem("plugin."+a,JSON.stringify(c))},postMessage:function(a,c){c.target.postMessage(c.useStructuredClone?a:JSON.stringify(a),c.url)},dispatchEvent:function(a){try{q.dispatchEvent(a)}catch(c){console&&console.log("PluginRegistry.dispatchEvent "+c)}},loadManifest:function(a){var c=new j,e=w.connect(a,function(a){e&&
a.method&&("manifest"===a.method||"plugin"===a.method?(a=a.params[0],w.disconnect(e),e=null,c.resolve(a)):"timeout"===a.method&&(w.disconnect(e),e=null,c.reject(a.error)))});return c.promise},getState:function(){return g},handleServiceError:function(a,e){if(e&&e.status===401){var b=a.getHeaders(),l=a.getName()||a.getLocation(),f=document.createElement("span");f.appendChild(document.createTextNode("Authentication required for: "+l+"."));if(b.login)f.appendChild(document.createTextNode(" ")),l=document.createElement("a"),
l.target="_blank",l.textContent="Login",l.href=b.login,c.test(l.href)?(f.appendChild(l),f.appendChild(document.createTextNode(" and re-try the request."))):console.log("Illegal Login URL: "+b.login);return{Severity:"Error",HTML:!0,Message:(new XMLSerializer).serializeToString(f)}}if(e.__isError){var h=e,e=Error(h.message);Object.keys(h).forEach(function(a){e[a]=h[a]});delete e.__isError}return e}};this.getLocation=function(){return"System"};this.getHeaders=function(){return{}};this.getName=function(){return"System"};
this.getVersion=function(){return"0.0.0"};this.getLastModified=function(){return 0};this.getState=w.getState;this.init=function(){if(!(g==="starting"||g==="active"||g==="stopping")){addEventListener("message",n,!1);for(var a=[],c=0,b=k.length;c<b;c++)a.push(k.key(c));a.forEach(function(a){if(a.indexOf("plugin.")===0){var c=a.substring(7),a=JSON.parse(k.getItem(a));a.created&&r.push(new e(c,a,w))}});r.sort(function(a,c){return a._getCreated()<c._getCreated()?-1:1});if(f.parent)u=f.parent;else{u=document.createElement("div");
if(!f.visible)u.style.display="none",u.style.visibility="hidden";document.body.appendChild(u)}f.plugins&&Object.keys(f.plugins).forEach(function(a){a=d(a);if(!this.getPlugin(a)){var c=f.plugins[a];typeof c!=="object"&&(c={});c.autostart=c.autostart||f.defaultAutostart||"lazy";r.push(new e(a,c,w))}}.bind(this));g="starting"}};this.start=function(){g!=="starting"&&this.init();if(g!=="starting")return(new j).reject("Cannot start framework. Framework is already "+g+".");var a=[],c=(new Date).getTime();
r.forEach(function(e){var b=e._getAutostart();e.getLastModified()===0?a.push(e.update().then(function(){if("started"===b)return e.start({"transient":!0});if("lazy"===b)return e.start({lazy:!0,"transient":!0});e._resolve()})):"started"===b?a.push(e.start({"transient":!0})):"lazy"===b?(a.push(e.start({lazy:!0,"transient":!0})),c>e.getLastModified()+864E5&&e.update()):e._resolve()});return j.all(a,function(a){console.log("PluginRegistry.stop "+a)}).then(function(){g="active"})};this.stop=function(){if(g!==
"starting"&&g!=="active")return(new j).reject("Cannot stop registry. Registry is already "+g+".");g="stopping";var a=[];r.forEach(function(c){a.push(c.stop({"transient":!0}))});return j.all(a,function(a){console.log("PluginRegistry.stop "+a)}).then(function(){if(!f.parent){var a=u.parentNode;a&&a.removeChild(u)}u=null;removeEventListener("message",n);g="resolved"})};this.update=function(){this.stop().then(this.start.bind(this))};this.uninstall=function(){return(new j).reject("Cannot uninstall registry")};
this.installPlugin=function(a,c){var a=d(a),b=this.getPlugin(a);if(b)return(new j).resolve(b);if(v[a])return v[a];if(c)return b=new e(a,c,w),r.push(b),b._persist(),w.dispatchEvent(new h("installed",b)),(new j).resolve(b);var l=w.loadManifest(a).then(function(c){b=new e(a,c,w);r.push(b);b._persist();delete v[a];w.dispatchEvent(new h("installed",b));return b},function(c){delete v[a];throw c;});return v[a]=l};this.getPlugins=function(){return r.slice()};this.getPlugin=function(a){var c=null,a=d(a);r.some(function(e){if(a===
e.getLocation())return c=e,!0});return c};this.addEventListener=q.addEventListener.bind(q);this.removeEventListener=q.removeEventListener.bind(q);this.resolvePlugins=function(){var a=!0;r.forEach(function(c){a=a&&c._resolve()});return a}}}});
define("orion/serviceTracker",[],function(){function j(d,b){function k(c){var e=c.getProperty("service.id"),b=this.addingService(c);b&&(h[e]=c,a[e]=b)}function f(c){var e=c.getProperty("service.id"),b=a[e];delete h[e];delete a[e];this.removedService(c,b)}this.serviceRegistry=d;var h={},a={},e=i,c,l;this.close=function(){if(e!==g)throw"Already closed";e=i;d.removeEventListener("registered",c);d.removeEventListener("unregistering",l);l=c=null;var a=this;this.getServiceReferences().forEach(function(c){f.call(a,
c)});if(typeof this.onClose==="function")this.onClose()};this.getServiceReferences=function(){var a=Object.keys(h);return!a.length?null:a.map(function(a){return h[a]})};this.open=function(){if(e!==i)throw"Already open";e=g;var a=this;c=function(c){if(c.serviceReference.getProperty("objectClass").indexOf(b)!==-1&&(k.call(a,c.serviceReference),typeof a.onServiceAdded==="function"))return a.onServiceAdded(c.serviceReference,a.serviceRegistry.getService(c.serviceReference))};l=function(c){c.serviceReference.getProperty("objectClass").indexOf(b)!==
-1&&f.call(a,c.serviceReference)};d.addEventListener("registered",c);d.addEventListener("unregistering",l);d.getServiceReferences(b).forEach(function(c){k.call(a,c);if(typeof a.onServiceAdded==="function")return a.onServiceAdded(c,d.getService(c))});if(typeof this.onOpen==="function")this.onOpen()}}var i=0,g=1;j.prototype={addingService:function(d){return this.serviceRegistry.getService(d)},onOpen:null,onClose:null,onServiceAdded:null,removedService:function(){}};return j});
define("orion/objects",[],function(){function j(i){for(var g=1;g<arguments.length;g++){var d=arguments[g],b;for(b in d)Object.prototype.hasOwnProperty.call(d,b)&&(i[b]=d[b])}return i}return{clone:function(i){if(Array.isArray(i))return Array.prototype.slice.call(i);var g=Object.create(Object.getPrototypeOf(i));j(g,i);return g},mixin:j,toArray:function(i){return Array.isArray(i)?i:[i]}}});
define("orion/config",["orion/Deferred","orion/serviceTracker","orion/objects"],function(j,i,g){var d,b,k,f,h,a="pid";d=function(c,e,b){function f(a,c,b){c.forEach(function(f,h){try{var d=a[h].getProperty("__plugin__"),m=d&&e.getPlugin(d);(!d||m&&m.getState()==="active")&&c[h].updated(b)}catch(n){typeof console!=="undefined"&&console.log(n)}})}i.call(this,c,"orion.cm.managedservice");var h={},d={},k=function(e){var l=[];e.plugin.getServiceReferences().forEach(function(e){if(e.getProperty("objectClass").indexOf("orion.cm.managedservice")!==
-1){var f=e.getProperty(a),e=c.getService(e);f&&e&&(f=(f=b._find(f))&&f.getProperties(),l.push(e.updated(f)))}});return j.all(l)};this.addingService=function(e){var b=e.getProperty(a),l=c.getService(e);if(!b||!l)return null;h[b]||(h[b]=[]);d[b]||(d[b]=[]);h[b].push(e);d[b].push(l);return l};this.onServiceAdded=function(c,e){var l=c.getProperty(a),l=b._find(l);f([c],[e],l&&l.getProperties())};this.onOpen=function(){e.addEventListener("started",k)};this.onClose=function(){e.removeEventListener("started",
k)};this.notifyUpdated=function(a){var c=a.getPid();f(h[c]||[],d[c]||[],a.getProperties())};this.notifyDeleted=function(a){a=a.getPid();f(h[a]||[],d[a]||[],null)};this.removedService=function(c,e){var b=c.getProperty(a),l=h[b],f=d[b];l.length>1?l.splice(l.indexOf(c),1):delete h[b];f.length>1?f.splice(f.indexOf(e),1):delete d[b]}};b=function(){function a(c,e,b){this.store=new k(this,b);this.configAdmin=new f(this,this.store);this.tracker=new d(c,e,this.store)}a.prototype={getConfigurationAdmin:function(){var a=
this;return this.configAdmin._init().then(function(c){a.tracker.open();return c})},notifyDeleted:function(a){this.tracker.notifyDeleted(a)},notifyUpdated:function(a){this.tracker.notifyUpdated(a)}};return a}();f=function(){function a(c,e){this.factory=c;this.store=e}a.prototype={_init:function(){var a=this;return this.store._init().then(function(){return a})},getConfiguration:function(a){return this.store.get(a)},listConfigurations:function(){return this.store.list()}};return a}();var e="/cm/configurations";
k=function(){function c(c,b){this.factory=c;this.prefsService=b;this.configs=Object.create(null);this.pref=null;var f=this;this.initPromise=this.prefsService.getPreferences(e).then(function(c){f.pref=c;c.keys().forEach(function(e){if(!f.configs[e]){var b=c.get(e);typeof b==="object"&&b!==null&&Object.keys(b).length>0&&(b[a]=e,f.configs[e]=new h(f.factory,f,b))}})})}c.prototype={_init:function(){return this.initPromise},_find:function(a){return this.configs[a]||null},get:function(a){var c=this._find(a);
c||(c=new h(this.factory,this,a),this.configs[a]=c);return c},list:function(){var a=this,c=[];this.pref.keys().forEach(function(e){(e=a._find(e))&&e.getProperties()!==null&&c.push(e)});return c},remove:function(a){this.pref.remove(a);delete this.configs[a]},save:function(a,c){this.pref.put(a,c.getProperties(!0)||{})}};return c}();h=function(){function c(c,e){e=g.clone(e);delete e[a];c.properties=e}function e(b,f,l){this.factory=b;this.store=f;if(l!==null&&typeof l==="object")this.pid=l[a],c(this,
l);else if(typeof l==="string")this.pid=l,this.properties=null;else throw Error("Invalid pid/properties "+l);}e.prototype={_checkRemoved:function(){if(this._removed)throw Error("Configuration was removed");},getPid:function(){this._checkRemoved();return this.pid},getProperties:function(c){this._checkRemoved();var e=null;if(this.properties&&(e=g.clone(this.properties),!c))e[a]=this.pid;return e},remove:function(){this._checkRemoved();this.factory.notifyDeleted(this);this.store.remove(this.pid);this._removed=
!0},update:function(a){this._checkRemoved();c(this,a);this.store.save(this.pid,this);this.factory.notifyUpdated(this)},toString:function(){return"[ConfigImpl pid: "+this.pid+", properties: "+JSON.stringify(this.properties)+"]"}};return e}();return{ConfigurationAdminFactory:b}});
define("orion/bootstrap","require,orion/Deferred,orion/serviceregistry,orion/preferences,orion/pluginregistry,orion/config".split(","),function(j,i,g,d,b,k){var f;return{startup:function(){if(f)return f;f=new i;var h=new g.ServiceRegistry,a=new d.PreferencesService(h);return a.getPreferences("/plugins").then(function(e){var c={plugins:{}};e.keys().forEach(function(a){var b=j.toUrl(a);c.plugins[b]=e[a]});var l=new b.PluginRegistry(h,c);return l.start().then(function(){if(h.getServiceReferences("orion.core.preference.provider").length>
0)return a.getPreferences("/plugins",a.USER_SCOPE).then(function(a){var c=[];a.keys().forEach(function(a){a=j.toUrl(a);l.getPlugin(a)||c.push(l.installPlugin(a,{autostart:"lazy"}).then(function(a){return a.update().then(function(){return a.start({lazy:!0})})}))});return i.all(c,function(a){console.log(a)})})}).then(function(){return(new k.ConfigurationAdminFactory(h,l,a)).getConfigurationAdmin().then(h.registerService.bind(h,"orion.cm.configadmin"))}).then(function(){var a=h.getService("orion.core.auth");
if(a){var c=a.getUser().then(function(c){if(c)localStorage.setItem("lastLogin",(new Date).getTime());else return a.getAuthForm(window.location.href).then(function(a){setTimeout(function(){window.location=a},0)})}),e=localStorage.getItem("lastLogin");if(!e||e<(new Date).getTime()-9E5)return c}}).then(function(){var c={serviceRegistry:h,preferences:a,pluginRegistry:l};f.resolve(c);return c})})}}});
define("orion/util",[],function(){var j=navigator.userAgent,i=j.indexOf("MSIE")!==-1||j.indexOf("Trident")!==-1?document.documentMode:void 0,g=parseFloat(j.split("Firefox/")[1]||j.split("Minefield/")[1])||void 0,d=j.indexOf("Opera")!==-1?parseFloat(j.split("Version/")[1]):void 0,b=parseFloat(j.split("Chrome/")[1])||void 0,k=j.indexOf("Safari")!==-1&&!b,f=parseFloat(j.split("WebKit/")[1])||void 0,h=j.indexOf("Android")!==-1,a=j.indexOf("iPad")!==-1,j=j.indexOf("iPhone")!==-1,e=a||j,c=navigator.platform.indexOf("Mac")!==
-1,l=navigator.platform.indexOf("Win")!==-1,m=navigator.platform.indexOf("Linux")!==-1,n="ontouchstart"in document.createElement("input");return{formatMessage:function(a){var c=arguments;return a.replace(/\$\{([^\}]+)\}/g,function(a,e){return c[(e<<0)+1]})},createElement:function(a,c){return a.createElementNS?a.createElementNS("http://www.w3.org/1999/xhtml",c):a.createElement(c)},isIE:i,isFirefox:g,isOpera:d,isChrome:b,isSafari:k,isWebkit:f,isAndroid:h,isIPad:a,isIPhone:j,isIOS:e,isMac:c,isWindows:l,
isLinux:m,isTouch:n,platformDelimiter:l?"\r\n":"\n"}});
define("orion/webui/littlelib",["orion/util"],function(j){function i(a,e){e||(e=document);return e.querySelectorAll(a)}function g(a){var e=a.tabIndex;e===0&&j.isIE&&!{a:!0,body:!0,button:!0,frame:!0,iframe:!0,img:!0,input:!0,isindex:!0,object:!0,select:!0,textarea:!0}[a.nodeName.toLowerCase()]&&!a.attributes.tabIndex&&(e=-1);return e}function d(a){if(g(a)>=0)return a;if(a.hasChildNodes())for(var e=0;e<a.childNodes.length;e++){var c=d(a.childNodes[e]);if(c)return c}return null}function b(a){if(g(a)>=
0)return a;if(a.hasChildNodes())for(var e=a.childNodes.length-1;e>=0;e--){var c=b(a.childNodes[e]);if(c)return c}return null}function k(a,e){if(a.nodeType===3){var c=f.exec(a.nodeValue);c&&c.length>1&&e(a,c)}if(a.hasChildNodes())for(c=0;c<a.childNodes.length;c++)k(a.childNodes[c],e)}var f=/\$\{([^\}]+)\}/,h=null;return{$:function(a,e){e||(e=document);return e.querySelector(a)},$$:i,$$array:function(a,e){return Array.prototype.slice.call(i(a,e))},node:function(a){var e=a;typeof a==="string"&&(e=document.getElementById(a));
return e},contains:function(a,e){if(!a||!e)return!1;if(a===e)return!0;var c=a.compareDocumentPosition(e);return Boolean(c&16)},bounds:function(a){a=a.getBoundingClientRect();return{left:a.left+document.documentElement.scrollLeft,top:a.top+document.documentElement.scrollTop,width:a.width,height:a.height}},empty:function(a){for(;a.hasChildNodes();)a.removeChild(a.firstChild)},firstTabbable:d,lastTabbable:b,stop:function(a){if(window.document.all)a.keyCode=0;a.preventDefault&&(a.preventDefault(),a.stopPropagation())},
processTextNodes:function(a,e){k(a,function(a,b){a.parentNode.replaceChild(document.createTextNode(e[b[1]]||b[1]),a)})},processDOMNodes:function(a,e){k(a,function(a,b){var f=e[b[1]];if(f){var h=document.createRange(),d=b.index;h.setStart(a,d);h.setEnd(a,d+b[0].length);h.deleteContents();h.insertNode(f)}})},addAutoDismiss:function(a,e){function c(a){h.forEach(function(c){var e=!1,b=c.excludeNodes.some(function(c){return document.body.contains(c)?(e=!0,c.contains(a.target)):!1});if(e&&!b)try{c.dismiss(a)}catch(f){typeof console!==
"undefined"&&console&&console.error(f&&f.message)}});h=h.filter(function(a){return a.excludeNodes.some(function(a){return document.body.contains(a)})})}h===null&&(h=[],document.addEventListener("click",c,!0),j.isIOS&&document.addEventListener("touchend",function(a){function c(){a.target.removeEventListener("click",c)}a.touches.length===0&&a.target.addEventListener("click",c)},!1));h.push({excludeNodes:a,dismiss:e})},setFramesEnabled:function(a){for(var e=document.getElementsByTagName("iframe"),c=
0;c<e.length;c++)e[c].parentNode.style.pointerEvents=a?"":"none"},removeAutoDismiss:function(a){h=h.filter(function(e){return a!==e.dismiss})},KEY:{BKSPC:8,TAB:9,ENTER:13,ESCAPE:27,SPACE:32,PAGEUP:33,PAGEDOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,INSERT:45,DEL:46}}});
define("orion/webui/dropdown",["require","orion/webui/littlelib","orion/EventTarget"],function(j,i,g){function d(b){g.attach(this);this._init(b)}d.prototype={_init:function(b){this._dropdownNode=i.node(b.dropdown);if(!this._dropdownNode)throw"no dom node for dropdown found";this._populate=b.populate;this._selectionClass=b.selectionClass;this._parentDropdown=b.parentDropdown;this._positioningNode=b.positioningNode;if(!this._parentDropdown)for(var d=this._dropdownNode.parentNode;d&&document!==d;){if(d.classList&&
d.classList.contains("dropdownMenu")){this._parentDropdown=d.dropdown;break}d=d.parentNode}this._triggerNode=b.triggerNode?b.triggerNode:i.$(".dropdownTrigger",this._dropdownNode.parentNode);if(!this._triggerNode)throw"no dom node for dropdown trigger found";if(!b.skipTriggerEventListeners){var f=this;this._triggerNode.addEventListener("click",function(b){f.toggle(b)&&i.stop(b)},!1);this._triggerNode.tagName.toLowerCase()==="span"&&this._triggerNode.addEventListener("keydown",function(b){if(b.keyCode===
i.KEY.ENTER||b.keyCode===i.KEY.SPACE)f.toggle(),i.stop(b)},!1)}this._dropdownNode.addEventListener("keydown",this._dropdownKeyDown.bind(this),!1)},addTriggerNode:function(b){var d=this;b.addEventListener("click",function(b){d.toggle(b)&&i.stop(b)},!1)},toggle:function(b){return this.isVisible()?this.close():this.open(b)},isVisible:function(){return this._isVisible},open:function(b){var d=!1;if(!this.isVisible()){this.dispatchEvent({type:"triggered",dropdown:this,event:b});i.setFramesEnabled(!1);this._populate&&
(this.empty(),this._populate(this._dropdownNode));var f=this.getItems();if(f.length>0){if(!this._hookedAutoDismiss)this._boundAutoDismiss?i.removeAutoDismiss(this._boundAutoDismiss):this._boundAutoDismiss=this._autoDismiss.bind(this),d=i.$$array(".dropdownSubMenu",this._dropdownNode),i.addAutoDismiss([this._triggerNode].concat(d),this._boundAutoDismiss),this._hookedAutoDismiss=!0;this._triggerNode.classList.add("dropdownTriggerOpen");this._selectionClass&&this._triggerNode.classList.add(this._selectionClass);
this._dropdownNode.classList.add("dropdownMenuOpen");this._isVisible=!0;this._positionDropdown(b);f[0].focus();d=!0;this._parentDropdown&&this._parentDropdown.submenuOpen(this)}}return d},_autoDismiss:function(b){if(this.close(!1)&&this._dropdownNode.contains(b.target))for(b=this._parentDropdown;b;)b.close(!1),b=b._parentDropdown},_positionDropdown:function(){this._dropdownNode.style.left="";this._dropdownNode.style.top="";if(this._positioningNode)this._dropdownNode.style.left=this._positioningNode.offsetLeft+
"px";else{var b=i.bounds(this._dropdownNode),d=i.bounds(document.body);if(b.left+b.width>d.left+d.width)if(this._triggerNode.classList.contains("dropdownMenuItem"))this._dropdownNode.style.left=-b.width+"px";else{var f=i.bounds(this._boundingNode(this._triggerNode)),h=i.bounds(this._triggerNode);this._dropdownNode.style.left=h.left-f.left-b.width+h.width+"px"}b=b.top+b.height-(d.top+d.height);if(0<b)this._dropdownNode.style.top=Math.floor(this._dropdownNode.style.top-b)+"px"}},_boundingNode:function(b){var d=
window.getComputedStyle(b,null);return d===null?b:d.getPropertyValue("position")==="absolute"||!b.parentNode||b===document.body?b:this._boundingNode(b.parentNode)},close:function(b){var d=!1;if(this.isVisible())this._triggerNode.classList.remove("dropdownTriggerOpen"),this._selectionClass&&this._triggerNode.classList.remove(this._selectionClass),this._dropdownNode.classList.remove("dropdownMenuOpen"),i.setFramesEnabled(!0),b&&this._triggerNode.focus(),this._isVisible=!1,d=!0;return d},getItems:function(){var b=
[],d=this;i.$$array("li:not(.dropdownSeparator) > .dropdownMenuItem",this._dropdownNode,!0).forEach(function(f){f.parentNode.parentNode===d._dropdownNode&&b.push(f)});b.forEach(function(b){if(!b._hasDropdownMouseover)b.addEventListener("mouseover",function(h){b.dropdown?b.dropdown.open(h):(d._closeSelectedSubmenu(),i.stop(h))}),b._hasDropdownMouseover=!0});return b},empty:function(){var b=this;i.$$array("li",this._dropdownNode).forEach(function(d){d.parentNode===b._dropdownNode&&d.parentNode.removeChild(d)});
this._hookedAutoDismiss=!1},_dropdownKeyDown:function(b){if(b.keyCode===i.KEY.UP||b.keyCode===i.KEY.DOWN||b.keyCode===i.KEY.RIGHT||b.keyCode===i.KEY.ENTER||b.keyCode===i.KEY.LEFT){var d=this.getItems(),f=document.activeElement;if(d.length&&d.length>0&&f){var h=d.indexOf(f);h<0&&(h=d.indexOf(f.parentNode));h>=0&&(b.keyCode===i.KEY.UP&&h>0?(h--,d[h].focus()):b.keyCode===i.KEY.DOWN&&h<d.length-1?(h++,d[h].focus()):b.keyCode===i.KEY.ENTER||b.keyCode===i.KEY.RIGHT?f.classList.contains("dropdownTrigger")&&
f.dropdown&&f.dropdown.open():b.keyCode===i.KEY.LEFT&&f.parentNode.parentNode.classList.contains("dropdownMenuOpen")&&this.close(!0),i.stop(b))}}else b.keyCode===i.KEY.ESCAPE&&(this.close(!0),i.stop(b))},submenuOpen:function(b){if(b!==this._selectedSubmenu)this._closeSelectedSubmenu(),this._selectedSubmenu=b},_closeSelectedSubmenu:function(){for(var b=this._selectedSubmenu;b;)b.close(),b=b._selectedSubmenu},destroy:function(){this.empty();this._boundAutoDismiss&&i.removeAutoDismiss(this._boundAutoDismiss)}};
d.prototype.constructor=d;return{Dropdown:d}});
define("text",["module"],function(j){var i,g,d=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"],b=/^\s*<\?xml(\s)+version=[\'\"](\d)*.(\d)*[\'\"](\s)*\?>/im,k=/<body[^>]*>\s*([\s\S]+)\s*<\/body>/im,f=typeof location!=="undefined"&&location.href,h=f&&location.protocol&&location.protocol.replace(/\:/,""),a=f&&location.hostname,e=f&&(location.port||void 0),c=[],l=j.config&&j.config()||{};i={version:"2.0.5",strip:function(a){if(a){var a=a.replace(b,""),c=a.match(k);c&&(a=c[1])}else a="";return a},
jsEscape:function(a){return a.replace(/(['\\])/g,"\\$1").replace(/[\f]/g,"\\f").replace(/[\b]/g,"\\b").replace(/[\n]/g,"\\n").replace(/[\t]/g,"\\t").replace(/[\r]/g,"\\r").replace(/[\u2028]/g,"\\u2028").replace(/[\u2029]/g,"\\u2029")},createXhr:l.createXhr||function(){var a,c,e;if(typeof XMLHttpRequest!=="undefined")return new XMLHttpRequest;else if(typeof ActiveXObject!=="undefined")for(c=0;c<3;c+=1){e=d[c];try{a=new ActiveXObject(e)}catch(b){}if(a){d=[e];break}}return a},parseName:function(a){var c,
e,b=!1,f=a.indexOf(".");c=a.indexOf("./")===0||a.indexOf("../")===0;f!==-1&&(!c||f>1)?(c=a.substring(0,f),e=a.substring(f+1,a.length)):c=a;a=e||c;f=a.indexOf("!");f!==-1&&(b=a.substring(f+1)==="strip",a=a.substring(0,f),e?e=a:c=a);return{moduleName:c,ext:e,strip:b}},xdRegExp:/^((\w+)\:)?\/\/([^\/\\]+)/,useXhr:function(a,c,e,b){var f,l;f=i.xdRegExp.exec(a);if(!f)return!0;a=f[2];f=f[3];f=f.split(":");l=f[1];f=f[0];return(!a||a===c)&&(!f||f.toLowerCase()===e.toLowerCase())&&(!l&&!f||l===b)},finishLoad:function(a,
e,b,f){b=e?i.strip(b):b;l.isBuild&&(c[a]=b);f(b)},load:function(c,b,d,g){if(g.isBuild&&!g.inlineText)d();else{l.isBuild=g.isBuild;var k=i.parseName(c),g=k.moduleName+(k.ext?"."+k.ext:""),j=b.toUrl(g),t=l.useXhr||i.useXhr;!f||t(j,h,a,e)?i.get(j,function(a){i.finishLoad(c,k.strip,a,d)},function(a){d.error&&d.error(a)}):b([g],function(a){i.finishLoad(k.moduleName+"."+k.ext,k.strip,a,d)})}},write:function(a,e,b){if(c.hasOwnProperty(e)){var f=i.jsEscape(c[e]);b.asModule(a+"!"+e,"define(function () { return '"+
f+"';});\n")}},writeFile:function(a,c,e,b,f){var c=i.parseName(c),l=c.ext?"."+c.ext:"",h=c.moduleName+l,d=e.toUrl(c.moduleName+l)+".js";i.load(h,e,function(){var c=function(a){return b(d,a)};c.asModule=function(a,c){return b.asModule(a,d,c)};i.write(a,h,c,f)},f)}};if(l.env==="node"||!l.env&&typeof process!=="undefined"&&process.versions&&process.versions.node)g=require.nodeRequire("fs"),i.get=function(a,c){var e=g.readFileSync(a,"utf8");e.indexOf("\ufeff")===0&&(e=e.substring(1));c(e)};else if(l.env===
"xhr"||!l.env&&i.createXhr())i.get=function(a,c,e,b){var f=i.createXhr(),h;f.open("GET",a,!0);if(b)for(h in b)b.hasOwnProperty(h)&&f.setRequestHeader(h.toLowerCase(),b[h]);if(l.onXhr)l.onXhr(f,a);f.onreadystatechange=function(){var b;if(f.readyState===4)b=f.status,b>399&&b<600?(b=Error(a+" HTTP status: "+b),b.xhr=f,e(b)):c(f.responseText)};f.send(null)};else if(l.env==="rhino"||!l.env&&typeof Packages!=="undefined"&&typeof java!=="undefined")i.get=function(a,c){var e,b,f=new java.io.File(a),l=java.lang.System.getProperty("line.separator"),
f=new java.io.BufferedReader(new java.io.InputStreamReader(new java.io.FileInputStream(f),"utf-8")),h="";try{e=new java.lang.StringBuffer;(b=f.readLine())&&b.length()&&b.charAt(0)===65279&&(b=b.substring(1));for(b!==null&&e.append(b);(b=f.readLine())!==null;)e.append(l),e.append(b);h=String(e.toString())}finally{f.close()}c(h)};return i});define("text!orion/webui/dropdowntriggerbutton.html",[],function(){return'<button class="dropdownTrigger">${ButtonText}<\!--span class="dropdownArrowDown core-sprite-openarrow"></span--\></button><ul class="dropdownMenu"></ul>'});
define("text!orion/webui/dropdowntriggerbuttonwitharrow.html",[],function(){return'<button class="dropdownTrigger dropdownDefaultButton">${ButtonText}<span class="dropdownArrowDown core-sprite-openarrow"></span></button><ul class="dropdownMenu"></ul>'});define("text!orion/webui/submenutriggerbutton.html",[],function(){return'<li class="dropdownSubMenu"><span class="dropdownTrigger dropdownMenuItem" role="menuitem" tabindex="0"><span class="dropdownCommandName">${ButtonText}</span><span class="dropdownArrowRight core-sprite-closedarrow"></span></span><ul class="dropdownMenu"></ul></li>'});
define("text!orion/webui/checkedmenuitem.html",[],function(){return'<li><label class="dropdownMenuItem"><input class="checkedMenuItem" role="menuitem" type="checkbox" />${ItemText}</label></li>'});
define("orion/webui/tooltip",["require","orion/webui/littlelib"],function(j,i){function g(d){this._init(d)}g.prototype={_init:function(d){this._node=i.node(d.node);if(!this._node)throw"no dom node for tooltip found";this._position=d.position||["right","above","below","left"];this._text=d.text;this._hideDelay=d.hideDelay===void 0?200:d.hideDelay;this._tailSize=d.tailSize||10;this._trigger=d.trigger||"mouseover";this._afterShowing=d.afterShowing;this._afterHiding=d.afterHiding;var b=this;if(this._trigger===
"click")this._showDelay=0,this._node.addEventListener("click",this._clickHandler=function(f){f.target===b._node&&(b.show(),i.stop(f))},!1);else if(this._trigger==="mouseover"){this._showDelay=d.showDelay===void 0?500:d.showDelay;d=["mouseout","click"];this._node.addEventListener("mouseover",this._mouseoverHandler=function(f){i.contains(b._node,f.target)&&(b.show(),i.stop(f))},!1);this._leaveHandler=function(f){i.contains(b._node,f.target)&&b.hide()};for(var g=0;g<d.length;g++)this._node.addEventListener(d[g],
this._leaveHandler,!1)}},_makeTipNode:function(){if(!this._tip){this._tip=document.createElement("span");this._tip.classList.add("tooltipContainer");this._tipInner=document.createElement("div");this._tipInner.classList.add("tooltip");if(this._text)this._tipTextContent=document.createElement("div"),this._tipTextContent.classList.add("textContent"),this._tipInner.appendChild(this._tipTextContent),this._tipTextContent.appendChild(document.createTextNode(this._text));this._tip.appendChild(this._tipInner);
document.body.appendChild(this._tip);var d=this;i.addAutoDismiss([this._tip,this._node],function(){d.hide()});if(this._trigger==="mouseover")this._tipInner.role="tooltip",this._tipInner.id="tooltip"+(new Date).getTime().toString(),this._node.setAttribute("aria-describedby",this._tipInner.id),this._tip.addEventListener("mouseover",function(){if(d._timeout)window.clearTimeout(d._timeout),d._timeout=null;d._tip.addEventListener("mouseout",function(b){i.contains(d._tip,b.target)&&(d.hide(),i.stop(b))},
!1)},!1)}return this._tip},_positionTip:function(d,b){this._makeTipNode();d==="left"?this._tipInner.classList.add("left"):this._tipInner.classList.remove("left");var g=this._node,f;for(f=i.bounds(g);g&&!f.width&&!f.height;g=g.parentNode)f=i.bounds(g);var g=i.bounds(this._tipInner),h;switch(d){case "above":h=f.top-g.height-this._tailSize-1;f=f.left-this._tailSize;break;case "below":h=f.top+f.height+this._tailSize+1;f=f.left-this._tailSize;break;case "left":h=f.top-this._tailSize/2;f=f.left-g.width-
this._tailSize-1;break;default:h=f.top-this._tailSize/2,f=f.left+f.width+this._tailSize+1}var a=i.bounds(document.documentElement);if(h+g.height>a.height)if(b)h=a.height-g.height-1;else return!1;if(f+g.width>a.width)if(b)f=a.width-g.width-1;else return!1;if(f<0)if(b)f=4;else return!1;if(h<0)if(b)h=4;else return!1;if(this._tail&&this._tail.previousPosition!==d)this._tip.removeChild(this._tail),this._tail=null;if(!this._tail){this._tail=document.createElement("span");this._tail.classList.add("tooltipTailFrom"+
d);d==="above"||d==="left"?this._tip.appendChild(this._tail):this._tip.insertBefore(this._tail,this._tipInner);if(d==="left")this._tail.style.left=g.width+"px";this._tail.previousPosition=d}this._tip.style.top=h+"px";this._tip.style.left=f+"px";return!0},contentContainer:function(){this._makeTipNode();return this._tipInner},show:function(){if(!this._tip||!this._tip.classList.contains("tooltipShowing")){if(this._timeout)window.clearTimeout(this._timeout),this._timeout=null;this._showDelay?this._timeout=
window.setTimeout(this._showImmediately.bind(this),this._showDelay):this._showImmediately()}},_showImmediately:function(){for(var d=!1,b=0;!d&&b<this._position.length;)d=this._positionTip(this._position[b]),b++;d||this._positionTip(this._position[0],!0);this._tip.classList.add("tooltipShowing");this._afterShowing&&this._afterShowing()},hide:function(d){if(this._timeout)window.clearTimeout(this._timeout),this._timeout=null;if(this._tip&&this._tip.classList.contains("tooltipShowing")){if(d===void 0)d=
this._hideDelay;var b=this;this._timeout=window.setTimeout(function(){b._tip.classList.remove("tooltipShowing");b._tip.removeAttribute("style");b._afterHiding&&b._afterHiding()},d)}},destroy:function(){if(this._timeout)window.clearTimeout(this._timeout),this._timeout=null;if(this._tip)document.body.removeChild(this._tip),this._tail=this._tipTextContent=this._tipInner=this._tip=null;if(this._node){this._node.removeEventListener("click",this._clickHandler,!1);this._node.removeEventListener("mouseover",
this._mouseoverHandler,!1);for(var d=["mouseout","click"],b=0;b<d.length;b++)this._node.removeEventListener(d[b],this._leaveHandler,!1)}}};g.prototype.constructor=g;return{Tooltip:g}});
define("orion/commands","orion/util,orion/webui/littlelib,orion/webui/dropdown,text!orion/webui/dropdowntriggerbutton.html,text!orion/webui/dropdowntriggerbuttonwitharrow.html,text!orion/webui/submenutriggerbutton.html,text!orion/webui/checkedmenuitem.html,orion/webui/tooltip".split(","),function(j,i,g,d,b,k,f,h){function a(a){var c=a.invocation;if(c){var e=a.command;if(e.hrefCallback)return a=e.hrefCallback.call(c.handler||window,c),a.then?a.then(function(a){window.open(a)}):window.open(a),!0;else if(c.commandRegistry)return c.commandRegistry._invoke(c),
!0;else if(e.onClick||e.callback)return window.setTimeout(function(){(e.onClick||e.callback).call(c.handler||window,c)},0),!0}return!1}function e(c,e){for(var b in e)if(e[b]&&e[b].keyBinding&&e[b].command&&e[b].keyBinding.match(c)){var f=e[b],l=f.keyBinding;if((!l.domScope||i.contains(i.node(l.domScope),c.target))&&a(f)){i.stop(c);break}}}function c(){var a={};if(t){var c,e,b;e=Object.keys(q);for(c=0;c<e.length;c++)b=e[c],a[b]=q[b];var f=t();e=Object.keys(f);for(c=0;c<e.length;c++)b=e[c],a[b]=f[b]}else a=
q;return a}function l(a){e(a,c())}function m(a,c){a=a||window.event;if(function(a){if(j.isMac){if(a.metaKey&&!a.altKey)return!a.shiftKey&&!a.ctrlKey&&(a.keyCode===65||a.keyCode===67||a.keyCode===86||a.keyCode===88||a.keyCode===90)?!0:!1;if(a.ctrlKey)return!1}else{if(a.ctrlKey&&!a.altKey)return!a.shiftKey&&(a.keyCode===65||a.keyCode===67||a.keyCode===86||a.keyCode===88||a.keyCode===90)?!0:!1;if(a.altKey&&!a.ctrlKey)return!1}if(a["char"])return a["char"].length>0;else if(a.charCode||a.keyCode)switch(a=
a.charCode||a.keyCode,a){case 8:case 9:case 13:case 46:return!0;default:return a>=32&&a<112||a>123}return!1}(a)){if(a.target.contentEditable==="true")return;var e=a.target.nodeName.toLowerCase();if(e==="input")switch(a.target.type.toLowerCase()){case "text":case "password":case "search":case "color":case "date":case "datetime":case "datetime-local":case "email":case "month":case "number":case "range":case "tel":case "time":case "url":case "week":return}else if(e==="textarea")return}c?c(a):l(a)}function n(){this._init()}
function o(a,c,e){c.classList.add("commandImage");var b;a.imageClass?a.addImageClassToElement?c.classList.add(a.imageClass):(b=document.createElement("span"),c.appendChild(b),b.classList.add(a.spriteClass),b.classList.add(a.imageClass)):(b=new Image,b.alt=a.name,b.name=e,b.id=e,b.src=a.image,c.appendChild(b));return b}function p(a,c){var e=document.createElement("span");e.classList.add("dropdownKeyBinding");e.appendChild(document.createTextNode(c));a.appendChild(e)}function u(a,c,e,b,f){this.commandRegistry=
f;this.handler=a;this.items=c;this.userData=e;this.command=b;if(b.parameters)this.parameters=b.parameters.makeCopy();this.id=b.id}function r(a){this._init(a)}var t=null,q={};n.prototype={setProxy:function(a){this.proxy=a},setKeyBindings:function(a){this.bindings=a},_init:function(){var a=this;document.addEventListener("keydown",function(c){return m(c,function(c){var e=a.proxy,b=a.bindings;if(b&&e)for(var f=0;f<b.length;f++)b[f].match(c)&&(e.processKey({type:c.type,keyCode:c.keyCode,altKey:c.altKey,
ctrlKey:c.ctrlKey,metaKey:c.metaKey,shiftKey:c.shiftKey}),i.stop(c))})})}};window.document.addEventListener("keydown",m,!1);u.prototype={collectsParameters:function(){return this.commandRegistry&&this.commandRegistry.collectsParameters()},makeCopy:function(a){var c=new u(this.handler,this.items,this.userData,this.command,this.commandRegistry);c.domNode=this.domNode;c.domParent=this.domParent;if(a)c.parameters=a.makeCopy();else if(this.parameters)c.parameters=this.parameters.makeCopy();return c}};
u.prototype.constructor=u;r.prototype={_init:function(a){this.id=a.id;this.name=a.name;this.tooltip=a.tooltip;this.callback=a.callback;this.hrefCallback=a.hrefCallback;this.choiceCallback=a.choiceCallback;this.positioningNode=a.positioningNode;this.image=a.image||"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAAA1BMVEUAAACnej3aAAAAAXRSTlMAQObYZgAAAAtJREFUCNdjIBEAAAAwAAFletZ8AAAAAElFTkSuQmCC";this.imageClass=a.imageClass;this.addImageClassToElement=a.addImageClassToElement;this.selectionClass=
a.selectionClass;this.spriteClass=a.spriteClass||"commandSprite";this.visibleWhen=a.visibleWhen;this.parameters=a.parameters;this.isEditor=a.isEditor},populateChoicesMenu:function(a,c,e,b,f){var e=this.getChoices(c,e,b),l=e.some(function(a){return a.checked});e.forEach(function(e){if(e.name){var b=document.createElement("li");a.appendChild(b);var h=document.createElement("span");h.tabIndex=0;h.role="menuitem";h.classList.add("dropdownMenuItem");if(l){var d=document.createElement("span");d.classList.add("check");
d.appendChild(document.createTextNode(e.checked?"\u25cf":""));h.appendChild(d)}d=document.createTextNode(e.name);h.appendChild(d);b.appendChild(h);h.choice=e;h.addEventListener("click",function(a){a.target.choice&&a.target.choice.callback.call(a.target.choice,c)},!1);h.addEventListener("keydown",function(a){(a.keyCode===i.KEY.ENTER||a.keyCode===i.KEY.SPACE)&&a.target.choice&&a.target.choice.callback.call(a.target.choice,c)},!1)}else f._generateMenuSeparator(a)})},getChoices:function(a,c,e){return this.choiceCallback?
this.choiceCallback.call(c,a,e):null},makeChoiceCallback:function(a,c){return function(e){a.callback&&a.callback.call(a,c,e)}},hasImage:function(){return this.imageClass||this.image!=="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAAA1BMVEUAAACnej3aAAAAAXRSTlMAQObYZgAAAAtJREFUCNdjIBEAAAAwAAFletZ8AAAAAElFTkSuQmCC"}};r.prototype.constructor=r;return{Command:r,CommandInvocation:u,createDropdownMenu:function(a,c,e,f,l,h,m,n,k){a=i.node(a);if(!a)throw"no parent node was specified";
var j=document.createRange();j.selectNode(a);j=k?j.createContextualFragment(b):j.createContextualFragment(d);i.processTextNodes(j,{ButtonText:c});a.appendChild(j);var a=a.lastChild,p;k?(k=a.previousSibling,p=k.lastChild):k=a.previousSibling;f?k.classList.add(f):(k.classList.add("orionButton"),k.classList.add("commandButton"));if(l){if(!h)k.textContent="",k.setAttribute("aria-label",c);o({spriteClass:"commandSprite",imageClass:l},k,c);k.classList.add("orionButton")}k.dropdown=new g.Dropdown({dropdown:a,
populate:e,selectionClass:m,skipTriggerEventListeners:!!p,positioningNode:n});a.dropdown=k.dropdown;return{menuButton:k,menu:a,dropdown:k.dropdown,dropdownArrow:p}},createCheckedMenuItem:function(a,c,e,b){a=i.node(a);if(!a)throw"no parent node was specified";var l=document.createRange();l.selectNode(a);l=l.createContextualFragment(f);i.processTextNodes(l,{ItemText:c});a.appendChild(l);a=i.$(".checkedMenuItem",a.lastChild);a.checked=e;a.addEventListener("change",b,!1);return a},createCommandItem:function(a,
c,e,b,f,l,d){var m,l=l||!c.name&&c.hasImage();if(c.hrefCallback)m=document.createElement("a"),m.id=b,l&&c.hasImage()?o(c,m,b):(m.className="commandLink",m.appendChild(document.createTextNode(c.name))),d=c.hrefCallback.call(e.handler,e),d.then?d.then(function(a){m.href=a}):m.href=d?d:"#";else{m=document.createElement("button");m.className="orionButton";l?c.hasImage()?(o(c,m,b),c.name&&m.setAttribute("aria-label",c.name)):(m.classList.add("commandButton"),m.classList.add("commandMissingImageButton"),
m.appendChild(document.createTextNode(c.name))):(m.classList.add("commandButton"),b=document.createTextNode(c.name),m.appendChild(b));var g=d||c.callback;if(g)c.onClick=g,m.addEventListener("click",function(){g.call(e.handler,e)},!1)}a.nodeName.toLowerCase()==="ul"?(d=document.createElement("li"),a.appendChild(d),a=d):m.classList.add("commandMargins");a.appendChild(m);if(c.tooltip)m.commandTooltip=new h.Tooltip({node:m,text:c.tooltip,position:["above","below","right","left"]});f&&(q[c.id]={keyBinding:f,
command:c,invocation:e});return m},createCommandMenuItem:function(a,c,e,b,f,l){var d,m=a.dropdown;if(c.hrefCallback){d=document.createElement("a");var g=document.createElement("span");g.appendChild(document.createTextNode(c.name));g.classList.add("dropdownCommandName");d.appendChild(g);f=c.hrefCallback.call(e.handler,e);f.then?f.then(function(a){d.href=a}):d.href=f?f:"#";d.addEventListener("keydown",function(a){(a.keyCode===i.KEY.ENTER||a.keyCode===i.KEY.SPACE)&&d.click()},!1)}else{d=document.createElement("span");
d.tabIndex=0;g=document.createElement("span");g.appendChild(document.createTextNode(c.name));g.classList.add("dropdownCommandName");d.appendChild(g);var k=f||c.callback;if(k)c.onClick=k,d.addEventListener("click",function(){m.close(!0);k.call(e.handler,e)},!1),d.addEventListener("keydown",function(a){if(a.keyCode===i.KEY.ENTER||a.keyCode===i.KEY.SPACE)a.preventDefault(),d.click()},!1)}d.className="dropdownMenuItem";d.role="menuitem";if(c.tooltip)d.commandTooltip=new h.Tooltip({node:d,text:c.tooltip,
position:["above","below","right","left"]});l&&p(d,l);l=document.createElement("li");a.appendChild(l);l.appendChild(d);b&&(q[c.id]={keyBinding:b,command:c,invocation:e});return d},executeBinding:a,setKeyBindingProvider:function(a){t=a},localKeyBindings:q,CommandsProxy:n,getKeyBindings:c,processKey:l,NO_IMAGE:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAAA1BMVEUAAACnej3aAAAAAXRSTlMAQObYZgAAAAtJREFUCNdjIBEAAAAwAAFletZ8AAAAAElFTkSuQmCC",_testMethodProcessKey:e}});
define("orion/explorers/navigationUtils",[],function(){function j(g,d){if(!i&&g)g.push({domNode:d}),d.tabIndex=-1,d.style.outline="none"}var i=navigator.userAgent.indexOf("iPad")!==-1;return{addNavGrid:function(g,d,b){g&&(g=g.getGridNavHolder(d,!0))&&j(g,b)},generateNavGrid:j,removeNavGrid:function(g,d){if(g)for(var b=0;b<g.length;b++)if(g[b].domNode===d){g.splice(b,1);break}}}});
define("orion/PageUtil",[],function(){var j=/^http[s]?/i;return{hash:function(){var i=window.location.href.split("#")[1];return i?"#"+i:""},matchResourceParameters:function(i){var i=i||window.location.toString(),g={resource:""},d=i.indexOf("#");if(d!==-1&&(i=i.substring(d+1),i.length!==0)){i=i.split(",");g.resource=decodeURIComponent(i[0]);for(d=1;d<i.length;d++){var b=/([^=]*)(=?)(.*)/.exec(i[d]),k=decodeURIComponent(b[1]||""),b=decodeURIComponent(b[3]||"");k!==""&&k!=="resource"&&(g[k]=b)}}return g},
validateURLScheme:function(i,g){var d=i;if(i.indexOf("://")===-1){var b=document.createElement("a");b.href=i;d=b.href}b=!1;return(b=g?g.some(function(b){return RegExp("^"+b+":","i").test(d)}):j.test(d))?i:(console.log("Illegal URL Scheme: '"+i+"'"),"")}}});
define("orion/uiUtils",["orion/webui/littlelib"],function(j){function i(d){var b="",g=navigator.platform.indexOf("Mac")!==-1;g?(d.mod4&&(b+="\u2303"),d.mod3&&(b+="\u2325"),d.mod2&&(b+="\u21e7"),d.mod1&&(b+="\u2318")):(d.mod1&&(b+="Ctrl+"),d.mod2&&(b+="Shift+"),d.mod3&&(b+="Alt+"));if(d.alphaKey)return b+d.alphaKey;if(d.type==="keypress")return b+d.keyCode;for(var f in j.KEY)if(typeof(j.KEY[f]==="number")&&j.KEY[f]===d.keyCode){if(g)switch(j.KEY[f]){case j.KEY.BKSPC:f="\u232b";break;case j.KEY.TAB:f=
"\u21e5";break;case j.KEY.ENTER:f="\u23ce";break;case j.KEY.ESCAPE:f="\u238b";break;case j.KEY.SPACE:f="\u2423";break;case j.KEY.PAGEUP:f="\u21de";break;case j.KEY.PAGEDOWN:f="\u21df";break;case j.KEY.END:f="\u21f2";break;case j.KEY.HOME:f="\u21f1";break;case j.KEY.DEL:f="\u2326"}switch(j.KEY[f]){case j.KEY.DOWN:f="\u2193";break;case j.KEY.UP:f="\u2191";break;case j.KEY.RIGHT:f="\u2192";break;case j.KEY.LEFT:f="\u2190"}return b+f}var h;switch(d.keyCode){case 59:h=d.mod2?":":";";break;case 61:h=d.mod2?
"+":"=";break;case 188:h=d.mod2?"<":",";break;case 190:h=d.mod2?">":".";break;case 191:h=d.mod2?"?":"/";break;case 192:h=d.mod2?"~":"`";break;case 219:h=d.mod2?"{":"[";break;case 220:h=d.mod2?"|":"\\";break;case 221:h=d.mod2?"}":"]";break;case 222:h=d.mod2?'"':"'"}return h?b+h:d.keyCode>=112&&d.keyCode<=123?b+"F"+(d.keyCode-111):b+String.fromCharCode(d.keyCode)}function g(d){var b=window.navigator.platform.indexOf("Mac")!==-1;return b&&d.metaKey||!b&&d.ctrlKey}return{getUserKeyString:function(d){for(var b=
"",d=d.getKeys(),g=0;g<d.length;g++)g!==0&&(b+=" "),b+=i(d[g]);return b},getUserText:function(d){var b=d.id,g=d.refNode,f=d.hideRefNode,h=d.initialText,a=d.onComplete,e=d.onEditDestroy,c=d.selectTo,l=d.isInitialValid,d=d.insertAsChild,m=!1,n=function(c){return function(d){if(!m){var n=j.node(b),i=n.value;if(n)if(c&&d.keyCode===j.KEY.ESCAPE){if(f)g.style.display="inline";m=!0;n.parentNode.removeChild(n);e&&e()}else if(!(c&&d.keyCode!==j.KEY.ENTER)){if(i.length===0||!l&&i===h){if(f)g.style.display=
"inline"}else if(a(i),f&&g.parentNode)g.style.display="inline";m=!0;n.parentNode&&n.parentNode.removeChild(n);e&&e()}}}},i=document.createElement("input");i.id=b;i.value=h||"";d?g.appendChild(i):g.parentNode.insertBefore(i,g.nextSibling);i.classList.add("userEditBoxPrompt");if(f)g.style.display="none";i.addEventListener("keydown",n(!0),!1);i.addEventListener("blur",n(!1),!1);window.setTimeout(function(){i.focus();if(h){var a=j.node(b),e=c?h.indexOf(c):-1;if(e>0)if(a.createTextRange)a=a.createTextRange(),
a.collapse(!0),a.moveStart("character",0),a.moveEnd("character",e),a.select();else if(a.setSelectionRange)a.setSelectionRange(0,e);else{if(a.selectionStart!==void 0)a.selectionStart=0,a.selectionEnd=e}else a.select()}},0)},openInNewWindow:g,followLink:function(d,b){b&&g(b)?window.open(d):window.location=d},createButton:function(d,b){var g=document.createElement("button");g.className="orionButton commandButton commandMargins";g.addEventListener("click",function(f){b();j.stop(f)},!1);d&&g.appendChild(document.createTextNode(d));
return g},createDropdownButton:function(){},isFormElement:function(d){switch(d.tagName.toLowerCase()){case "button":case "fieldset":case "form":case "input":case "keygen":case "label":case "legend":case "meter":case "optgroup":case "output":case "progress":case "select":case "textarea":return!0}return!1}}});
define("orion/commandRegistry","orion/commands,orion/explorers/navigationUtils,orion/PageUtil,orion/uiUtils,orion/webui/littlelib,orion/webui/dropdown,orion/webui/tooltip,text!orion/webui/checkedmenuitem.html,text!orion/webui/dropdowntriggerbutton.html,text!orion/webui/submenutriggerbutton.html".split(","),function(j,i,g,d,b,k,f,h,a,e){function c(a){this._commandList={};this._contributionsByScopeId={};this._activeBindings={};this._urlBindings={};this._pendingBindings={};this._init(a);this._parameterCollector=
null}function l(a,c){this.token=a;this.parameterName=c}function m(a,c,e){this.event=a;this.handler=c;this.capture=e||!1}function n(a,c,e,b,f,l){this.name=a;this.type=c;this.label=e;this.value=b;this.lines=f||1;this.eventListeners=Array.isArray(l)?l:l?[l]:[]}function o(a,c,e){this._storeParameters(a);this._hasOptionalParameters=c&&c.hasOptionalParameters;this._options=c;this.optionsRequested=!1;this.getParameters=e;this.clientCollect=c&&c.clientCollect}c.prototype={_init:function(a){this._selectionService=
a.selection;var c=this;j.setKeyBindingProvider(function(){return c._activeBindings})},processURL:function(a){for(var c in this._urlBindings)if(this._urlBindings[c]&&this._urlBindings[c].urlBinding&&this._urlBindings[c].command){var e=this._urlBindings[c].urlBinding.match(a);if(e){var b=this._urlBindings[c],f=b.command,l=b.invocation;if(l&&l.parameters&&f.callback){l.parameters.setValue(e.parameterName,e.parameterValue);var h=this;window.setTimeout(function(){h._invoke(l)},0);break}}}},findCommand:function(a){return this._commandList[a]},
runCommand:function(a,c,e,b){c?(a=this._commandList[a])&&(a.visibleWhen?a.visibleWhen(c):1)&&a.callback&&this._invoke(new j.CommandInvocation(e,c,null,a,this),b):(c=this._urlBindings[a])&&c.command&&c.command.callback&&this._invoke(c.invocation,b)},getSelectionService:function(){return this._selectionService},setParameterCollector:function(a){this._parameterCollector=a},openParameterCollector:function(a,c,e){this._parameterCollector&&(this._parameterCollector.close(),this._parameterCollector.open(a,
c,e))},confirm:function(a,c,e,b,f,l){var h=!1;if(this._parameterCollector&&!f){var d=this;this._parameterCollector.close();if(this._parameterCollector.open(a,function(a,f){var l=document.createElement("span");l.classList.add("parameterPrompt");l.textContent=c;a.appendChild(l);l=document.createElement("button");l.addEventListener("click",function(){h=!0;d._parameterCollector.close()},!1);f.appendChild(l);l.appendChild(document.createTextNode(e));l.className="dismissButton";var m=document.createElement("button");
m.addEventListener("click",function(){h=!1;d._parameterCollector.close()},!1);f.appendChild(m);m.appendChild(document.createTextNode(b));m.className="dismissButton";return l},function(){l(h)}))return}h=window.confirm(c);l(h)},closeParameterCollector:function(){this._parameterCollector&&this._parameterCollector.close()},collectsParameters:function(){return this._parameterCollector},_invoke:function(a,c){return this._collectAndInvoke(a.makeCopy(c),!1)},_collectAndInvoke:function(a,c){if(a)if(this._parameterCollector&&
a.parameters&&a.parameters.hasParameters()&&(c||a.parameters.shouldCollectParameters())){var e=!1;a.parameters.updateParameters(a);if(a.parameters.shouldCollectParameters()&&(e=this._parameterCollector.collectParameters(a),!e)){var b=new f.Tooltip({node:a.domNode,afterHiding:function(){this.destroy()},trigger:"click",position:["below","right","above","left"]}),e=b.contentContainer();e.classList.add("parameterPopup");var l=window.document.activeElement,h=this._parameterCollector.getFillFunction(a,
function(){l&&l.focus();b.destroy()})(e);b.show();window.setTimeout(function(){h.focus();h.select()},0);e=!0}e||a.command.callback.call(a.handler||window,a)}else a.command.callback.call(a.handler||window,a);else window.console.log("Client attempted to invoke command without an available (rendered) command invocation")},collectParameters:function(a){this._collectAndInvoke(a,!0)},showKeyBindings:function(a){function c(a){return function(){j.executeBinding(a)}}var e={},b,f,l=[],h;for(h in this._activeBindings)(f=
this._activeBindings[h])&&f.keyBinding&&f.command&&(f.command.name||f.command.tooltip)&&l.push(f);l.sort(function(a,c){return(a.command.name||a.command.tooltip).localeCompare(c.command.name||c.command.tooltip)});for(h=0;h<l.length;h++)f=l[h],f.keyBinding.scopeName?(e[f.keyBinding.scopeName]||(e[f.keyBinding.scopeName]=[]),e[f.keyBinding.scopeName].push(f)):(b=d.getUserKeyString(f.keyBinding),a.createItem(b,f.command.name||f.command.tooltip,c(f)));for(var m in e)e[m].length&&e[m].length>0&&(a.createHeader(m),
e[m].forEach(function(e){b=d.getUserKeyString(e.keyBinding);a.createItem(b,e.command.name||e.command.tooltip,c(e))}))},addCommand:function(a){this._commandList[a.id]=a;var c=this._pendingBindings[a.id];if(c){var e=this;c.forEach(function(c){e._addBinding(a,c.type,c.binding,c.bindingOnly)});delete this._pendingBindings[a.id]}},addCommandGroup:function(a,c,e,b,f,l,h,d,m,g){this._contributionsByScopeId[a]||(this._contributionsByScopeId[a]={});a=this._contributionsByScopeId[a];f&&(a=this._createEntryForPath(a,
f));if(a[c]){if(b)a[c].title=b;if(e)a[c].position=e;if(h)a[c].imageClass=h;if(d)a[c].tooltip=d;if(m)a[c].selectionClass=m;g===!0?a[c].pretendDefaultActionId=!0:a[c].defaultActionId=g;a[c].emptyGroupMessage=l}else a[c]={title:b,position:e,emptyGroupMessage:l,imageClass:h,tooltip:d,selectionClass:m,defaultActionId:g===!0?null:g,pretendDefaultActionId:g===!0,children:{}},a.sortedContributions=null},_createEntryForPath:function(a,c){c&&c.split("/").forEach(function(c){if(c.length>1){if(!a[c])a[c]={position:0,
children:{}},a.sortedContributions=null;a=a[c].children}});return a},registerSelectionService:function(a,c){this._contributionsByScopeId[a]||(this._contributionsByScopeId[a]={});this._contributionsByScopeId[a].localSelectionService=c},registerCommandContribution:function(a,c,e,b,f,l,h){this._contributionsByScopeId[a]||(this._contributionsByScopeId[a]={});a=this._contributionsByScopeId[a];b&&(a=this._createEntryForPath(a,b));a[c]={position:e};l&&((e=this._commandList[c])?this._addBinding(e,"key",l,
f):this._addPendingBinding(c,"key",l,f));h&&((e=this._commandList[c])?this._addBinding(e,"url",h,f):this._addPendingBinding(c,"url",h,f));a.sortedContributions=null},unregisterCommandContribution:function(a,c,e){if(this._contributionsByScopeId[a]){delete this._commandList[c];delete this._activeBindings[c];delete this._urlBindings[c];delete this._pendingBindings[c];var b=this._contributionsByScopeId[a];e&&e.split("/").forEach(function(a){if(a.length>1&&b[a])b=b[a].children});delete b[c];b.sortedContributions=
null}},_addBinding:function(a,c,e,b){if(!a.id)throw Error("No command id: "+a);c==="key"?this._activeBindings[a.id]={command:a,keyBinding:e,bindingOnly:b}:c==="url"&&(this._urlBindings[a.id]={command:a,urlBinding:e,bindingOnly:b})},_addPendingBinding:function(a,c,e,b){this._pendingBindings[a]=this._pendingBindings[a]||[];this._pendingBindings[a].push({type:c,binding:e,bindingOnly:b})},_checkForTrailingSeparator:function(a,c,e){var f;if(c==="tool"||c==="button")if((f=a.childNodes.length>0?a.childNodes[a.childNodes.length-
1]:null)&&f.classList.contains("commandSeparator"))return e?(a.removeChild(f),!1):!0;if(c==="menu"&&(a=b.$$array("li > *",a),a.length>0&&a[a.length-1].classList.contains("dropdownSeparator")))if(f=a[a.length-1],e)f.parentNode.parentNode.removeChild(f.parentNode);else return!0;return!1},renderCommands:function(a,c,e,f,l,h,d){if(typeof a!=="string")throw"a scope id for rendering must be specified";c=b.node(c);if(!c)throw"no parent";var m=this._contributionsByScopeId[a];if(!e&&m){var e=m.localSelectionService||
this._selectionService,g=this;e&&e.getSelections(function(e){g.renderCommands(a,c,e,f,l,h)})}else m&&(this._render(m,c,e,f,l||"button",h,d),this._checkForTrailingSeparator(c,l,!0))},destroy:function(a){a=b.node(a);if(!a)throw"no parent";for(;a.hasChildNodes();){var c=a.firstChild;c.commandTooltip&&c.commandTooltip.destroy();c.emptyGroupTooltip&&c.emptyGroupTooltip.destroy();this.destroy(c);a.removeChild(c)}},_render:function(a,c,e,b,l,h,m){var g=a.sortedContributions;if(!g){var g=[],n=!1,k;for(k in a)if(Object.prototype.hasOwnProperty.call(a,
k)){var o=a[k];if(o&&typeof o.position==="number")o.id=k,g.push(o),n=!0}if(n)g.sort(function(a,c){return a.position-c.position}),a.sortedContributions=g}var z=0,s=this;g.forEach(function(a){var g;if(!a.imageClass)a.imageClass=null;if(a.children&&Object.getOwnPropertyNames(a.children).length>0){var n=a.children;if(l==="tool"||l==="button")if(a.title){var k;if(a.defaultActionId)(n=s._commandList[a.defaultActionId])&&(n.visibleWhen?n.visibleWhen(e):1)?(k=new j.CommandInvocation(b,e,h,n,s),k.domParent=
c):a.pretendDefaultActionId=!0;n=s._createDropdownMenu(c,a.title,null,null,a.imageClass,a.tooltip,a.selectionClass,null,k,a.pretendDefaultActionId);m&&i.generateNavGrid(m,n.menuButton);if(n)if(s._render(a.children,n.menu,e,b,"menu",h,m),s._checkForTrailingSeparator(n.menu,"menu",!0),n.menu.childNodes.length===0)if(a.emptyGroupMessage){if(!n.menuButton.emptyGroupTooltip)n.menuButton.emptyGroupTooltip=new f.Tooltip({node:n.menuButton,text:a.emptyGroupMessage,trigger:"click",position:["below","right",
"above","left"]})}else m&&i.removeNavGrid(m,n.menuButton),a=function(a){a&&a.parentNode&&a.parentNode.removeChild(a)},a(n.menu),a(n.menuButton),a(n.destroyButton);else n.menuButton.style.visibility="visible"}else{var o;c.childNodes.length>0&&!s._checkForTrailingSeparator(c,l)&&(o=s.generateSeparatorImage(c));s._render(n,c,e,b,l,h,m);c.childNodes.length>0&&c.childNodes[c.childNodes.length-1]!==o&&(o=s.generateSeparatorImage(c))}else if(a.title){if(a=s._createDropdownMenu(c,a.title,!0,null,null,a.imageClass))s._render(n,
a.menu,e,b,"menu",h,m),s._checkForTrailingSeparator(a.menu,"menu",!0),a.menu.childNodes.length===0&&a.destroyButton&&c.removeChild(a.destroyButton)}else c.childNodes.length>0&&s._generateMenuSeparator(c),s._render(n,c,e,b,l,h,m),s._generateMenuSeparator(c)}else{var p=s._commandList[a.id],n=p?!0:!1;k=a=null;if(p){g=new j.CommandInvocation(b,e,h,p,s);g.domParent=c;o=n&&(p.visibleWhen?p.visibleWhen(e):!0);if(s._activeBindings[p.id]&&s._activeBindings[p.id].keyBinding)a=s._activeBindings[p.id],a.invocation=
o?g:null,a.bindingOnly&&(n=!1);if(s._urlBindings[p.id]&&s._urlBindings[p.id].urlBinding)k=s._urlBindings[p.id],k.invocation=o?g:null,k.bindingOnly&&(n=!1);n=n&&o}if(n)p.choiceCallback?(l==="tool"||l==="button"?(a=c,n=!1,c.nodeName.toLowerCase()==="ul"&&(a=document.createElement("li"),c.appendChild(a))):(a=c,n=!0),s._createDropdownMenu(a,p.name,n,function(a){p.populateChoicesMenu(a,e,b,h,s)}.bind(p),p.imageClass,p.tooltip||p.title,p.selectionClass,p.positioningNode)):(g.handler=g.handler||this,g.domParent=
c,n=function(){s._invoke(g)},l==="menu"?(k=null,a&&a.keyBinding&&(k=d.getUserKeyString(a.keyBinding)),a=j.createCommandMenuItem(c,p,g,null,n,k)):(a=l+p.id+z,a=j.createCommandItem(c,p,g,a,null,l==="tool",n)),i.generateNavGrid(m,a),g.domNode=a,z++)}})},_createDropdownMenu:function(a,c,l,h,d,m,g,n,i,o){a=b.node(a);if(!a||!b.contains(document.body,a))return null;var D,z,s=a;if(l)m=document.createRange(),m.selectNode(a),m=m.createContextualFragment(e),b.processTextNodes(m,{ButtonText:c}),a.appendChild(m),
z=a.lastChild,d=z.lastChild,c=d.previousSibling,c.dropdown=new k.Dropdown({dropdown:d,populate:h,parentDropdown:a.dropdown}),d.dropdown=c.dropdown;else{a.nodeName.toLowerCase()==="ul"&&(s=document.createElement("li"),a.appendChild(s),z=s);a=null;d&&(a="dropdownButtonWithIcon",m=m||c);var m=d?m||c:m,y=j.createDropdownMenu(s,c,h,a,d,!1,g,n,i||o);D=y.dropdownArrow;c=y.menuButton;if(D){if(i)i.domNode=y.menuButton;var x=this;c.onclick=function(a){var c=b.bounds(D);a.clientX>=c.left&&y.dropdown?y.dropdown.toggle(a):
x._invoke(i)};if(y.dropdown)c.onkeydown=function(a){b.KEY.DOWN===a.keyCode&&(y.dropdown.toggle(a),b.stop(a))}}var d=y.menu,G;(h=i&&i.command&&(i.command.tooltip||i.command.name))?G=i.command.tooltip||i.command.name:h&&(G=m);if(G)c.commandTooltip=new f.Tooltip({node:c,text:G,position:["above","below","right","left"]})}return{menuButton:c,menu:d,dropdown:c.dropdown,destroyButton:z,dropdownArrow:D}},_generateMenuSeparator:function(a){if(!this._checkForTrailingSeparator(a,"menu")){var c=document.createElement("li");
c.classList.add("dropdownSeparator");var e=document.createElement("span");e.classList.add("dropdownSeparator");c.appendChild(e);a.appendChild(c)}},generateSeparatorImage:function(a){var c;c=a.nodeName.toLowerCase()==="ul"?document.createElement("li"):document.createElement("span");a.appendChild(c);c.classList.add("core-sprite-sep");c.classList.add("imageSprite");c.classList.add("commandSeparator");return c}};c.prototype.constructor=c;l.prototype={match:function(a){a=g.matchResourceParameters(a);return typeof a[this.token]!==
"undefined"?(this.parameterValue=a[this.token],this):null}};l.prototype.constructor=l;m.prototype.constructor=m;n.prototype={optionsRequested:function(){return this.optionsRequested}};n.prototype.constructor=n;o.prototype={_storeParameters:function(a){this.parameterTable=null;if(a){var c=this.parameterTable={};a.forEach(function(a){c[a.name]=a})}},updateParameters:function(a){typeof this.getParameters==="function"&&this._storeParameters(this.getParameters(a))},hasParameters:function(){return this.parameterTable!==
null},shouldCollectParameters:function(){return!this.clientCollect&&this.hasParameters()},parameterNamed:function(a){return this.parameterTable[a]},valueFor:function(a){return(a=this.parameterTable[a])?a.value:null},setValue:function(a,c){var e=this.parameterTable[a];if(e)e.value=c},forEach:function(a){for(var c in this.parameterTable)this.parameterTable[c].type&&this.parameterTable[c].name&&a(this.parameterTable[c])},makeCopy:function(){var a=[];this.forEach(function(c){c=new n(c.name,c.type,c.label,
c.value,c.lines,c.eventListeners);a.push(c)});var c=new o(a,this._options,this.getParameters);c.clientCollect=this.clientCollect;return c},hasOptionalParameters:function(){return this._hasOptionalParameters}};o.prototype.constructor=o;return{CommandRegistry:c,URLBinding:l,ParametersDescription:o,CommandParameter:n,CommandEventListener:m}});
define("orion/navigate/nls/root/messages",{"Click one of the tasks below to create an Orion folder.  You can upload, import, or generate files.":"Click one of the tasks below to create an Orion folder.  You can upload, import, or generate files.","Toggle Left Pane":"Toggle Left Pane","Open or close the left pane":"Open or close the left pane",Navigator:"Navigator","Strings Xtrnalizr":"Strings Xtrnalizr","Externalize Strings from JavaScript files in this folder":"Externalize strings from JavaScript files in this folder.",
"Choose a Folder":"Choose a Folder","Copy of ${0}":"Copy of ${0}","Enter a new name for '${0}'":"Enter a new name for '${0}'","Choose folder...":"Choose folder...",Rename:"Rename","Rename the selected files or folders":"Rename the selected files or folders","Compare with each other":"Compare with each other","Compare the selected 2 files with each other":"Compare the selected 2 files with each other","Compare with...":"Compare with...","Compare the selected folder with a specified folder":"Compare the selected folder with a specified folder",
Delete:"Delete","Unknown item":"Unknown item","Are you sure you want to delete these ${0} items?":"Are you sure you want to delete these ${0} items?","Are you sure you want to delete '${0}'?":"Are you sure you want to delete '${0}'?","Export as zip":"Zip","Create a zip file of the folder contents and download it":"Create a zip file of the folder contents and download it","New File":"File","Create a new file":"Create a new file","Name:":"Name:","New Folder":"Folder","Folder name:":"Folder name:","Create a new folder":"Create a new folder",
"Creating folder":"Creating folder",Folder:"Folder","Create an empty folder":"Create an empty folder","Create an empty folder on the Orion server.  You can import, upload, or create content in the editor.":"Create an empty folder on the Orion server.  You can import, upload, or create content in the editor.","Sample HTML5 Site":"Sample HTML5 Site","Generate a sample":"Generate a sample",'Generate an HTML5 "Hello World" website, including JavaScript, HTML, and CSS files.':'Generate an HTML5 "Hello World" website, including JavaScript, HTML, and CSS files.',
"Creating a folder for ${0}":"Creating a folder for ${0}","SFTP Import":"SFTP Import","Import content from SFTP":"Import content from SFTP","Import content from an SFTP location into an Orion folder.  You will be prompted for the SFTP location and credentials.":"Import content from an SFTP location into an Orion folder.  You will be prompted for the SFTP location and credentials.","Imported Content":"Imported Content","Upload a Zip":"Upload a Zip","Upload content from a local zip file":"Upload content from a local zip file",
"Upload content from a local zip file into an Orion folder.  You will be prompted for the local zip file.":"Upload content from a local zip file into an Orion folder.  You will be prompted for the local zip file.","Uploaded Content":"Uploaded Content","Creating an upload folder for ":"Creating an upload folder for ","Clone Git Repository":"Clone Git Repository","Clone a git repository":"Clone a git repository","Go to the Orion repositories page to provide a git repository URL.  Once the repository is created, it will appear in the Navigator.":"Go to the Orion repositories page to provide a git repository URL.  Once the repository is created, it will appear in the Navigator.",
"Link to Server":"Link to Server","Link to existing content on the server":"Link to existing content on the server","Create a folder that links to an existing folder on the server.":"Create a folder that links to an existing folder on the server.","Server path:":"Server path:","The name and server location were not specified.":"The name and server location were not specified.","Go Up":"Go Up","Move up to the parent folder":"Move up to the parent folder","Go Into":"Go Into","Move into the selected folder":"Move into the selected folder",
"Import local file...":"File System","Copy files and folders from your local file system":"Copy files and folders from your local file system","SFTP from...":"SFTP","Copy files and folders from a specified SFTP connection":"Copy files and folders from a specified SFTP connection","Importing from ${0}":"Importing from ${0}","SFTP to...":"SFTP","Copy files and folders to a specified SFTP location":"Copy files and folders to a specified SFTP location",Exporting:"Exporting to ${0}","Pasting ${0}":"Pasting ${0}",
"Copy to":"Copy to","Move to":"Move to","Copying ${0}":"Copying ${0}","Moving ${0}":"Moving ${0}","Renaming ${0}":"Renaming ${0}","Deleting ${0}":"Deleting ${0}","Creating ${0}":"Creating ${0}","Linking to ${0}":"Linking to ${0}","Move files and folders to a new location":"Move files and folders to a new location",Cut:"Cut",Copy:"Copy","Fetching children of ":"Fetching children of ",Paste:"Paste","Cannot paste into the Workspace root":"Cannot paste into the Workspace root","Open With":"Open With",
"Loading ":"Loading ",New:"New",File:"File",Actions:"Actions","Orion Content":"Orion Content"," is not supported in this file system":" is not supported in this file system","Create new content":"Create new content","Import from HTTP...":"HTTP","File URL:":"File URL:","Copy a file from a URL and optionally unzip it":"Copy a file from a URL and optionally unzip it","Unzip *.zip files:":"Unzip *.zip files:","Extracted from:":"Extracted from:","Did not drop ${0}.  Folder drop is not supported in this browser.":"Did not drop ${0}.  Folder drop is not supported in this browser.",
"You cannot copy files directly into the workspace.  Create a folder first.":"You cannot copy files directly into the workspace.  Create a folder first.","Unzip ${0}?":"Unzip ${0}?",NoFile:"Use the ${0} menu to create new files and folders. Click a file to start coding."});define("orion/navigate/nls/messages",["orion/i18n!orion/navigate/nls/messages","orion/navigate/nls/root/messages"],function(j,i){var g={root:i};Object.keys(j).forEach(function(d){typeof g[d]==="undefined"&&(g[d]=j[d])});return g});
define("orion/i18nUtil",["require","orion/Deferred"],function(j,i){function g(b){if(b=localStorage.getItem("orion/messageBundle/"+b))if(b=JSON.parse(b),b._expires&&b._expires>(new Date).getTime())return delete b._expires,b;return null}var d={};return{getMessageBundle:function(b){function k(a){a?j(["i18n!"+b],function(a){if(a){var c=b;a._expires=(new Date).getTime()+9E5;localStorage.setItem("orion/messageBundle/"+c,JSON.stringify(a));delete a._expires}h.resolve(a)}):f(Error(b))}function f(a){h.reject(a)}
if(d[b])return d[b];var h=new i;d[b]=h;var a=g(b);if(a)return h.resolve(a),h;try{j([b],k,f)}catch(e){j(["orion/i18n!"+b],k,f)}return h},formatMessage:function(b){var d=arguments;return b.replace(/\$\{([^\}]+)\}/g,function(b,h){return d[(h<<0)+1]})}}});
define("orion/fileClient",["i18n!orion/navigate/nls/messages","orion/Deferred","orion/i18nUtil"],function(j,i,g){function d(b,h,a){if(!b[h])throw h+j[" is not supported in this file system"];return b[h].apply(b,a)}function b(f,h,a,e){if(!f.readBlob)throw j["source file service does not support binary read"];if(!a.writeBlob)throw j["target file service does not support binary write"];if(h[h.length-1]!=="/")return d(f,"readBlob",[h]).then(function(c){return d(a,"writeBlob",[e,c])});var c=e.substring(0,
e.length-1),l=decodeURIComponent(c.substring(c.lastIndexOf("/")+1)),c=c.substring(0,c.lastIndexOf("/")+1);return d(a,"createFolder",[c,l]).then(function(){},function(){}).then(function(){return d(f,"fetchChildren",[h]).then(function(c){for(var l=[],h=0;h<c.length;++h){var d=c[h].Location,g=d;c[h].Directory&&(g=d.substring(0,d.length-1));g=decodeURIComponent(g.substring(g.lastIndexOf("/")+1));g=e+encodeURIComponent(g);c[h].Directory&&(g+="/");l[h]=b(f,d,a,g)}return i.all(l)})})}function k(b,h){function a(a){var c=
new i;c.reject(j["No Matching FileService for location:"]+a);return c}var e=b.getServiceReferences("orion.core.file"),c=e;if(h)for(var c=[],l=0;l<e.length;++l)h(e[l])&&c.push(e[l]);for(var d=[],n=[],k=[],p=[],u={fetchChildren:function(){var a=new i;a.resolve(p);return a},createWorkspace:function(){var a=new i;a.reject(j["no file service"]);return a},loadWorkspaces:function(){var a=new i;a.reject(j["no file service"]);return a},loadWorkspace:function(){var a=new i;window.setTimeout(function(){a.resolve({Directory:!0,
Length:0,LocalTimeStamp:0,Name:j["File Servers"],Location:"/",Children:p,ChildrenLocation:"/"})},100);return a},search:a,createProject:a,createFolder:a,createFile:a,deleteFile:a,moveFile:a,copyFile:a,read:a,write:a},e=0;e<c.length;++e)p[e]={Directory:!0,Length:0,LocalTimeStamp:0,Location:c[e].getProperty("top"),ChildrenLocation:c[e].getProperty("top"),Name:c[e].getProperty("Name")},l=c[e].getProperty("pattern")||c[e].getProperty("top").replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1"),l[0]!=="^"&&(l=
"^"+l),d[e]=RegExp(l),n[e]=b.getService(c[e]),k[e]=c[e].getProperty("Name"),c[e].getProperty("NameKey")&&c[e].getProperty("nls")&&g.getMessageBundle(c[e].getProperty("nls")).then(function(a,e){p[a].Name=e[c[a].getProperty("NameKey")];k[a]=e[c[a].getProperty("NameKey")]}.bind(this,e));this._getServiceIndex=function(a){if(a==="/")return-1;else if(!a||a.length&&a.length===0)return n[0]?0:-1;for(var c=0;c<d.length;++c)if(d[c].test(a))return c;throw j["No Matching FileService for location:"]+a;};this._getService=
function(a){a=this._getServiceIndex(a);return a===-1?u:n[a]};this._getServiceName=function(a){a=this._getServiceIndex(a);return a===-1?u.Name:k[a]};this._getServiceRootURL=function(a){a=this._getServiceIndex(a);return a===-1?u.Location:p[a].Location}}k.prototype={getService:function(b){return this._getService(b)},fileServiceName:function(b){return this._getServiceName(b)},fileServiceRootURL:function(b){return this._getServiceRootURL(b)},fetchChildren:function(b){return d(this._getService(b),"fetchChildren",
arguments)},createWorkspace:function(b){return d(this._getService(),"createWorkspace",arguments)},loadWorkspaces:function(){return d(this._getService(),"loadWorkspaces",arguments)},loadWorkspace:function(b){return d(this._getService(b),"loadWorkspace",arguments)},createProject:function(b,h,a,e){return d(this._getService(b),"createProject",arguments)},createFolder:function(b,h){return d(this._getService(b),"createFolder",arguments)},createFile:function(b,h){return d(this._getService(b),"createFile",
arguments)},deleteFile:function(b){return d(this._getService(b),"deleteFile",arguments)},moveFile:function(f,h,a){var e=this._getService(f),c=this._getService(h);if(e===c)return d(e,"moveFile",arguments);var l=f[f.length-1]==="/",m=h;m[m.length-1]!=="/"&&(m+="/");if(a)m+=encodeURIComponent(a);else{var g=f;l&&(g=g.substring(0,g.length-1));m+=g.substring(g.lastIndexOf("/")+1)}l&&m[m.length-1]!=="/"&&(m+="/");return b(e,f,c,m).then(function(){return d(e,"deleteFile",[f])})},copyFile:function(f,h,a){var e=
this._getService(f),c=this._getService(h);if(e===c)return d(e,"copyFile",arguments);var l=f[f.length-1]==="/",m=h;m[m.length-1]!=="/"&&(m+="/");if(a)m+=encodeURIComponent(a);else{var g=f;l&&(g=g.substring(0,g.length-1));m+=g.substring(g.lastIndexOf("/")+1)}l&&m[m.length-1]!=="/"&&(m+="/");return b(e,f,c,m)},read:function(b,h){return d(this._getService(b),"read",arguments)},readBlob:function(b){return d(this._getService(b),"readBlob",arguments)},write:function(b,h,a){return d(this._getService(b),"write",
arguments)},remoteImport:function(b,h){return d(this._getService(b),"remoteImport",arguments)},remoteExport:function(b,h){return d(this._getService(b),"remoteExport",arguments)},search:function(b){return d(this._getService(b.resource),"search",arguments)}};k.prototype.constructor=k;return{FileClient:k}});
define("orion/search/nls/root/messages",{"Find:":"Find:","Find With":"Find With","ReplaceWith:":"ReplaceWith:","Replace With":"Replace With","Show all":"Show all","Wrap search":"Wrap search","Incremental search":"Incremental search","Whole Word":"Whole Word","Regular expression":"Regular expression","Find after replace":"Find after replace",Options:"Options","Find next match":"Find next match","Find previous match":"Find previous match",Next:"Next",Previous:"Previous",Replace:"Replace","Replace All":"Replace All",
"Search ${0}":"Search ${0}","Type a keyword or wild card to search in ":"Type a keyword or wild card to search in ","Search failed.":"Search failed.","No matches found for ${0}":"No matches found for ${0}","Searching...":"Searching...","Resource has been changed by others.":"Resource has been changed by others.","Failed to write file.":"Failed to write file.",Results:"Results","Files ${0} of ${1} matching ${2}":"Files ${0} of ${1} matching ${2}","Replace ${0} with ${1} for files ${2} of ${3}":"Replace ${0} with ${1} for files ${2} of ${3}",
Location:"Location","Click to compare":"Click to compare",'Search again in this folder with "${0}"':'Search again in this folder with "${0}"',"Files replaced":"Files replaced",Status:"Status","${0} out of ${1}  matches replaced.":"${0} out of ${1}  matches replaced.","Replace all matches with...":"Replace all matches with...","Apply Changes":"Apply Changes","Replace all selected matches":"Replace all selected matches","Hide Compare":"Hide Compare","Hide compare view of changes":"Hide compare view of changes",
"Show Compare":"Show Compare","Show compare view of changes":"Show compare view of changes","Show All":"Show All","Show all the results in one page":"Show all the results in one page","< Previous Page":"< Previous Page","Show previous page of search result":"Show previous page of search result","Next Page >":"Next Page >","Show next page of search result":"Show next page of search result","Next result":"Next result","Previous result":"Previous result","Expand all results":"Expand all results","Collapse all results":"Collapse all results",
"Writing files...":"Writing files...","Preparing preview...":"Preparing preview...","Replaced File (${0})":"Replaced File (${0})","Original File (${0})":"Original File (${0})","Sort by Name":"Sort by Name","Compare changes":"Compare changes","Search Results":"Search Results","Replace All Matches":"Replace All Matches","No matches":"No matches",Rename:"Rename","My Saved Searches":"My Saved Searches","Save frequently used searches by choosing ${0} shown above.":"Save frequently used searches by choosing ${0} shown above.",
"Save frequently used searches by clicking on the ${0} button above.":"Save frequently used searches by clicking on the ${0} button above.","Files that contain:":"Files that contain:",Search:"Search","All types":"All types","File type":"File type","All ${0} files":"All ${0} files","${0} is already saved":"${0} is already saved","Type a search term":"Type a search term","Type a replace term":"Type a replace term","Case sensitive":"Case sensitive","Sort by":"Sort by","File name":"File name","Path name":"Path name",
Save:"Save","Type a name for the search":"Type a name for the search","Save the current search":"Save the current search","Type filter text":"Type filter text","Scope Search":"Scope Search","Open in Search page for this directory":"Open the Search page for this folder.","${0}. Try your search again.":"${0}. Try your search again.","Click or use delete key to delete the search term":"Click or use delete key to delete the search term","${0} matches":"${0} matches","Regular expression is off. You can click here or use options to turn it on for replacement - e.g. when the option is on you can replace <td([\\s\\S]*?)</td> with <span$1</span>.":"Regular expression is off. You can click here or use options to turn it on for replacement - e.g. when the option is on you can replace <td([\\s\\S]*?)</td> with <span$1</span>.",
"Regular expression is on. You can click here or use options to turn it off - e.g. when the option is on you can replace <td([\\s\\S]*?)</td> with <span$1</span>.":"Regular expression is on. You can click here or use options to turn it off - e.g. when the option is on you can replace <td([\\s\\S]*?)</td> with <span$1</span>."});
define("orion/search/nls/messages",["orion/i18n!orion/search/nls/messages","orion/search/nls/root/messages"],function(j,i){var g={root:i};Object.keys(j).forEach(function(d){typeof g[d]==="undefined"&&(g[d]=j[d])});return g});
define("orion/nls/root/messages",{Navigator:"Navigator",Sites:"Sites",Shell:"Shell",ShellLinkWorkspace:"Workspace Shell","Get Plugins":"Get Plugins",Global:"Global",Editor:"Editor",EditorRelatedLink:"Show Current Folder",EditorRelatedLinkParent:"Show Enclosing Folder",EditorLinkWorkspace:"Show Workspace",EditorRelatedLinkProj:"Show Project","Filter bindings":"Filter bindings","Orion Editor":"Orion Editor","Orion Image Viewer":"Orion Image Viewer","Orion Markdown Viewer":"Orion Markdown Viewer","Orion JSON Editor":"Orion JSON Editor",
"View on Site":"View on Site","View this file or folder on a web site hosted by Orion":"View this file or folder on a web site hosted by Orion.","Show a list of all the keybindings on this page":"Show a list of all the keybindings on this page","Show Keys":"Show Keys","Hide or show the page banner and footer":"Hide or show the page banner and footer","Toggle banner and footer":"Toggle banner and footer","Choose a file by name and open an editor on it":"Choose a file by name and open an editor on it",
"Find File Named...":"Find File Named...","System Configuration Details":"System Configuration Details","System Config Tooltip":"Go to the System Configuration Details page","Background Operations":"Background Operations","Background Operations Tooltip":"Go to the Background Operations page","Operation status is unknown":"Operation status is unknown","Unknown item":"Unknown item","Can't search: no search service is available":"Can't search: no search service is available","could not find banner parent, id was ":"could not find banner parent, id was ",
Related:"Related",Options:"Options",FAQ:"FAQ","Report a Bug":"Bugs","Privacy Policy":"Privacy","Terms of Use":"Terms","Copyright Agent":"Copyright","Orion Logo":"Orion Logo","Orion is in Beta. Please try it out but BEWARE your data may be lost.":"I20140226-2325","LOG: ":"LOG: ",View:"View","no parent":"no parent","no tree model":"no tree model","no renderer":"no renderer","could not find table row ":"could not find table row ","Resource is out of sync with the server. Do you want to save it anyway?":"Resource is out of sync with the server. Do you want to save it anyway?",
Operations:"Operations","Operations running":"Operations running","Some operations finished with warning":"Some operations finished with warning","Some operations finished with error":"Some operations finished with error","no service registry":"no service registry",Tasks:"Tasks",Close:"Close","Expand all":"Expand all","Collapse all":"Collapse all",Search:"Search","Advanced search":"Advanced search",Submit:"Submit",More:"More","Saved searches":"Saved searches","Recent searches":"Recent searches","Regular expression":"Regular expression",
"Search options":"Search options","Global search":"Global search","Orion Home":"Orion Home","Close notification":"Close notification","Operations - Press spacebar to show current operations":"Operations - Press spacebar to show current operations","Type a keyword or wild card to search in root":"Type a keyword or wild card to search in root","Toggle side panel":"Toggle side panel","Open or close the side panel":"Open or close the side panel",Projects:"Projects","Toggle Sidebar":"Toggle Sidebar","Sample HTML5 Site":"Sample HTML5 Site",
"Generate an HTML5 'Hello World' website, including JavaScript, HTML, and CSS files.":"Generate an HTML5 'Hello World' website, including JavaScript, HTML, and CSS files.","Sample Orion Plugin":"Sample Orion Plugin","Generate a sample plugin for integrating with Orion.":"Generate a sample plugin for integrating with Orion.",Browser:"Web Browser",OutlineProgress:"Getting outline for ${0} from ${1}",UnknownError:"An unknown error occurred.",UnknownWarning:"An unknown warning occurred.",Filter:"Filter (* = any string, ? = any character)",
"To view the browser's context menu, trigger the context menu again.":"To view the browser's context menu, trigger the context menu again.",Edit:"Edit",CentralNavTooltip:"Toggle Navigation Menu"});define("orion/nls/messages",["orion/i18n!orion/nls/messages","orion/nls/root/messages"],function(j,i){var g={root:i};Object.keys(j).forEach(function(d){typeof g[d]==="undefined"&&(g[d]=j[d])});return g});
define("orion/regex",[],function(){return{escape:function(j){return j.replace(/([\\$\^*\/+?\.\(\)|{}\[\]])/g,"\\$&")},parse:function(j){return(j=/^\s*\/(.+)\/([gim]{0,3})\s*$/.exec(j))?{pattern:j[1],flags:j[2]}:null}}});
define("orion/URITemplate",[],function(){function j(a){this._text=a}function i(a){return a.replace("%25","%")}function g(a,b){if(b==="U")return encodeURIComponent(a).replace(/[!'()*]/g,function(a){return"%"+a.charCodeAt(0).toString(16).toUpperCase()});if(b==="U+R")return encodeURI(a).replace(/%5B/g,"[").replace(/%5D/g,"]").replace(e,i);if(b==="U+R-,")return encodeURI(a).replace(/%5B/g,"[").replace(/%5D/g,"]").replace(/,/g,"%2C");throw Error("Unknown allowed character set: "+b);}function d(a,e,b){for(var f=
[],h=0;h<a.length;h++)typeof a[h]!=="undefined"&&f.push(g(a[h],e));return f.join(b)}function b(a,e,b,f){for(var h=Object.keys(a),d=[],k=0;k<h.length;k++)typeof a[h[k]]!=="undefined"&&d.push(g(h[k],e)+b+g(a[h[k]],e));return d.join(f)}function k(c){if(c.length===0)throw Error("Invalid Expression: 0 length expression");(this._operator=h[c[0]])?c=c.substring(1):this._operator=h.NUL;for(var e=[],b=c.split(","),f=0;f<b.length;f++){var d=b[f].match(a);if(d===null)throw Error("Bad VarSpec: "+c);e.push({name:d[1],
explode:!!d[2],prefix:d[3]?parseInt(d[3],10):-1})}this._varSpecList=e}function f(a){for(var e=[],b=0,f=a.indexOf("{",b);f!==-1;){e.push(new j(a.substring(b,f)));b=a.indexOf("}",f+1);if(b===-1)throw Error("Invalid template: "+a);e.push(new k(a.substring(f+1,b)));b+=1;f=a.indexOf("{",b)}e.push(new j(a.substring(b)));this._templateComponents=e}var h={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-,"}},a=/^((?:(?:[a-zA-Z0-9_])|(?:%[0-9A-F][0-9A-F]))(?:(?:[a-zA-Z0-9_.])|(?:%[0-9A-F][0-9A-F]))*)(?:(\*)|:([0-9]+))?$/,e=/%25[0-9A-F][0-9A-F]/g;j.prototype={expand:function(){return encodeURI(this._text)}};
k.prototype={expand:function(a){for(var e=[],f=0;f<this._varSpecList.length;f++){var h=this._varSpecList[f],k=h.name,i=a[k],j=typeof i;if(j!=="undefined"&&i!==null){var r=e.length===0?this._operator.first:this._operator.sep;if(j==="string")this._operator.named&&(r+=g(k,"U+R"),r+=i.length===0?this._operator.ifemp:"="),h.prefix!==-1&&h.prefix<i.length&&(i=i.substring(0,h.prefix)),r+=g(i,this._operator.allow);else if(Array.isArray(i)){if(i.length===0)continue;h.explode?r+=d(i,this._operator.allow,this._operator.sep):
(h=d(i,this._operator.allow,","),this._operator.named&&(r+=g(k,"U+R"),r+=h.length===0?this._operator.ifemp:"="),r+=h)}else if(j==="object"){if(Object.keys(i).length===0)continue;h.explode?r+=b(i,this._operator.allow,"=",this._operator.sep):(h=b(i,this._operator.allow,",",","),this._operator.named&&(r+=g(k,"U+R"),r+=h.length===0?this._operator.ifemp:"="),r+=h)}else throw Error("bad param type: "+k+" : "+j);e.push(r)}}return e.join("")}};f.prototype={expand:function(a){for(var e=[],b=0;b<this._templateComponents.length;b++)e.push(this._templateComponents[b].expand(a));
return e.join("")}};return f});
define("orion/searchUtils","i18n!orion/nls/messages,require,orion/regex,orion/commandRegistry,orion/PageUtil,orion/URITemplate".split(","),function(j,i,g,d,b,k){function f(a,e,c){var b="";c&&(b="^");if(b=g.parse("/"+b+a.searchStr+"/"))c=b.pattern,b=b.flags,b.indexOf("i")===-1&&!e.caseSensitive&&(b+="i"),a.regExp={pattern:c,flags:b},a.wildCard=!0}var h={ALL_FILE_TYPE:"*.*"};h.doSearch=function(a,e,c,b){if(a){var f=!0;c==="*"&&(c="");c===""&&(f=b&&b.type!==h.ALL_FILE_TYPE);if(f)c!==""&&h.addRecentSearch(e,
c,b?b.regEx:!1),a=a.createSearchParams(c,!1,!1,b),a=h.generateSearchHref(a),window.location=a}else window.alert(j["Can't search: no search service is available"])};h.generateSearchHelper=function(a,e){var c=a.keyword,b=c,d={};a.fileType&&a.fileType!==h.ALL_FILE_TYPE&&c===""&&(b="*."+a.fileType);if(a.regEx)d.searchStr=c,f(d,a,e);else{var g=c.indexOf("*")>-1,k=c.indexOf("?")>-1;g&&(c=c.split("*").join(".*"));k&&(c=c.split("?").join("."));!g&&!k&&!a.nameSearch?(d.searchStr=a.caseSensitive?c.split("\\").join(""):
c.split("\\").join("").toLowerCase(),d.wildCard=!1):(d.searchStr=a.caseSensitive?c:c.toLowerCase(),f(d,a,e),d.wildCard=!0)}d.searchStrLength=d.searchStr.length;return{params:a,inFileQuery:d,displayedSearchTerm:b}};h.convertSearchParams=function(a){if(a.rows!==void 0)a.rows=parseInt(a.rows,10);if(a.start!==void 0)a.start=parseInt(a.start,10);if(typeof a.regEx==="string")a.regEx=a.regEx.toLowerCase()==="true";if(typeof a.caseSensitive==="string")a.caseSensitive=a.caseSensitive.toLowerCase()==="true";
if(typeof a.nameSearch==="string")a.nameSearch=a.nameSearch.toLowerCase()==="true"};h.copySearchParams=function(a,e){var c={},b;for(b in a)if(a[b]!==void 0&&a[b]!==null&&(e||b!=="replace"))c[b]=a[b];return c};h.generateSearchHref=function(a){var e=i.toUrl("search/search.html"),a=h.copySearchParams(a,!0),c=a.resource;a.resource=void 0;return typeof a.keyword!=="undefined"?(new k(e+"#{,resource,params*}")).expand({resource:c,params:a}):(new k(e+"#{,resource}")).expand({resource:c})};h.generateFindURLBinding=
function(a,e,c,b,f){a={find:e.searchStr,regEx:e.wildCard?!0:void 0,caseSensitive:a.caseSensitive?!0:void 0,replaceWith:typeof b==="string"?b:void 0,atLine:typeof c==="number"?c:void 0};return f?a:","+(new k("{,params*}")).expand({params:a})};h.convertFindURLBinding=function(a){if(typeof a.regEx==="string")a.regEx=a.regEx.toLowerCase()==="true";if(typeof a.caseSensitive==="string")a.caseSensitive=a.caseSensitive.toLowerCase()==="true";if(typeof a.atLine==="string")a.atLine=parseInt(a.atLine,10)};h.replaceRegEx=
function(a,e,c){return a.replace(RegExp(e.pattern,e.flags),c)};h.replaceStringLiteral=function(a,e,c){e=g.parse("/"+e+"/gim");return h.replaceRegEx(a,e,c)};h.searchOnelineLiteral=function(a,e,c){var b;b=0;for(var f=!1,h=[];;)if(b=e.indexOf(a.searchStr,b),b<0)break;else{h.push({startIndex:b,length:a.searchStrLength});f=!0;if(c)break;b+=a.searchStrLength}return f?h:null};h.findRegExp=function(a,e,c,b){if(!e)return null;c=c||"";c+=(c.indexOf("g")===-1?"g":"")+(c.indexOf("m")===-1?"m":"");var f=null;
return(f=RegExp(e,c).exec(a.substring(b)))&&{startIndex:f.index+b,length:f[0].length}};h.searchOnelineRegEx=function(a,e,c){for(var b=0,f=!1,d=[];;)if(b=h.findRegExp(e,a.regExp.pattern,a.regExp.flags,b)){d.push(b);f=!0;if(c)break;b=b.startIndex+b.length}else break;return f?d:null};h.generateNewContents=function(a,e,c,b,f,d){if(b&&e){if(!a)c.contents=[];for(var g=0;g<e.length;g++){for(var k=e[g],i=!1,j=!1,t=[],q,v=0,w=0;w<b.children.length;w++)if(b.children[w].lineNumber-1===g){v=w;for(i=0;i<b.children[w].matches.length;i++)b.children[w+
i].checked!==!1&&t.push(i);j=t.length>0;q=b.children[w].matches;i=!0;break}if(i){if(j){t=h.replaceCheckedMatches(k,f,q,t,d);k=t.replacedStr;for(i=0;i<b.children[v].matches.length;i++)b.children[v+i].newMatches=t.newMatches}else for(i=0;i<b.children[v].matches.length;i++)b.children[v+i].newMatches=b.children[v+i].matches;a?c.contents[g]=k:c.contents.push(k)}else a||c.contents.push(k)}}};h.generateMatchContext=function(a,e,c){var b=[],f=a*2+1,h;e.length<=f?(h=0,a=e.length-1):(h=c-a,h<0?(h=0,a=h+f-1):
(a=c+a,a>e.length-1&&(a=e.length-1,h=a-f+1)));for(f=h;f<=a;f++)b.push({context:e[f],current:f===c});return b};h.splitFile=function(a){for(var e=0,c=0,b=0,f=0,h=[];;){e!==-1&&e<=b&&(e=a.indexOf("\r",b));c!==-1&&c<=b&&(c=a.indexOf("\n",b));if(c===-1&&e===-1){h.push(a.substring(f));break}var d=1;e!==-1&&c!==-1?e+1===c?(d=2,b=c+1):b=(e<c?e:c)+1:b=e!==-1?e+1:c+1;h.push(a.substring(f,b-d));f=b}return h};h.searchWithinFile=function(a,e,c,b,f,d){c=h.splitFile(c);if(f)e.contents=c;if(e){e.children=[];for(var g=
b=0;g<c.length;g++){var k=c[g];if(k&&k.length>0){var i=d?k:k.toLowerCase();if(i=a.wildCard?h.searchOnelineRegEx(a,i):h.searchOnelineLiteral(a,i)){var j,t=g+1;if(f)for(var q=0;q<i.length;q++)j=q+1,j={parent:e,checked:e.checked,type:"detail",matches:i,lineNumber:t,matchNumber:j,name:k,location:e.location+"-"+t+"-"+j},e.children.push(j);else j={parent:e,context:h.generateMatchContext(2,c,g),checked:e.checked,type:"detail",matches:i,lineNumber:t,name:k,location:e.location+"-"+t},e.children.push(j);b+=
i.length}}}e.totalMatches=b}};h.replaceCheckedMatches=function(a,e,c,b,f){for(var h=0,d="",g=[],k=0;k<c.length;k++){h!==c[k].startIndex&&(d+=a.substring(h,c[k].startIndex));if(c[k].length)f=c[k].length;for(var h=!1,i=0;i<b.length;i++)if(b[i]===k){h=!0;break}h?(g.push({startIndex:d.length,length:e.length}),d+=e):(g.push({startIndex:d.length,length:f}),d+=a.substring(c[k].startIndex,c[k].startIndex+f));h=c[k].startIndex+f}h<a.length&&(d+=a.substring(h));return{replacedStr:d,newMatches:g}};h.fullPathNameByMeta=
function(a){var e=a.length,c="";if(e>0)for(e-=1;e>-1;e--)c=c+(c===""?"":"/")+a[e].Name;return c};h.path2FolderName=function(a,e,c){return a.substring(0,a.length-e.length-(c?0:1))};h._storeRecentSearch=function(a,e,c,b){a.getService("orion.core.preference").getPreferences("/window/favorites").then(function(a){a.put("recentSearch",e);c&&window.setTimeout(function(){c.dispatchEvent({type:"inputDataListChanged",deleting:b})}.bind(this),20)})};h.addRecentSearch=function(a,e,c){typeof e==="string"&&e&&
a.getService("orion.core.preference").getPreferences("/window/favorites").then(function(b){var f,b=b.get("recentSearch");typeof b==="string"&&(b=JSON.parse(b));if(b){for(f in b)if(b[f].name===e)return;b.length>=20&&b.splice(19,b.length-20+1)}else b=[];b.splice(0,0,{name:e,regEx:c});h._storeRecentSearch(a,b)})};h.removeRecentSearch=function(a,e,c){typeof e==="string"&&e&&a.getService("orion.core.preference").getPreferences("/window/favorites").then(function(b){var f,b=b.get("recentSearch");typeof b===
"string"&&(b=JSON.parse(b));if(b)for(f in b)if(b[f].name===e){b.splice(f,1);h._storeRecentSearch(a,b,c,!0);break}})};h.getSearches=function(a,e,c){a.getService("orion.core.preference").getPreferences("/window/favorites").then(function(a){a=a.get(e);typeof a==="string"&&(a=JSON.parse(a));a&&c&&c(a)})};h.getMixedSearches=function(a,e,c,b){a.getService("orion.core.preference").getPreferences("/window/favorites").then(function(a){var f=a.get("recentSearch");typeof f==="string"&&(f=JSON.parse(f));e&&(a=
a.get("search"),typeof a==="string"&&(a=JSON.parse(a)),a&&a.forEach(function(a){if(c){var e=h.parseQueryStr(a.query);f.some(function(a){return e.searchStrTitle===a.name})||f.push({name:e.searchStrTitle,label:a.name})}else f.push({name:null,label:a.name,value:a.query})}));f&&b&&b(f)})};h.getOpenSearchPref=function(a,e){a.getService("orion.core.preference").getPreferences("/cm/configurations").then(function(a){a=a.get("nav.config");e(a&&a["links.newtab"]!=="undefined"?a["links.newtab"]?!0:!1:!1)})};
h.setOpenSearchPref=function(a,e){a.getService("orion.core.preference").getPreferences("/window/favorites").then(function(a){a.put("openSearchPref",{openInNewTab:e})})};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?","Search cancelled by user":"Search cancelled by user",
Cancel:"Cancel"});define("orion/crawler/nls/messages",["orion/i18n!orion/crawler/nls/messages","orion/crawler/nls/root/messages"],function(j,i){var g={root:i};Object.keys(j).forEach(function(d){typeof g[d]==="undefined"&&(g[d]=j[d])});return g});
define("orion/contentTypes",[],function(){function j(a,c){function b(a,c,e,f){var e=c.filename.indexOf(e)>=0,h;h=f.toLowerCase();h=c.extension.indexOf(h)!==-1;if(e||h){if(!(h=!a))e&&(f=f.toLowerCase(),e=a.extension.indexOf(f)!==-1),h=e;if(h)return c}return a}if(typeof a!=="string")return null;for(var f=a&&a.split(".").pop(),h=null,d=0;d<c.length;d++){var g=c[d];b(h,g,a,f)===g&&(h=g)}return h}function i(a){return a===null||typeof a==="undefined"?[]:Array.isArray(a)?a:[a]}function g(a){return i(a).map(function(a){return String.prototype.toLowerCase.call(a)})}
function d(a){return{id:a.id,name:a.name,image:a.image,imageClass:a.imageClass,"extends":a["extends"],extension:g(a.extension),filename:i(a.filename)}}function b(a){var c=Object.create(null);a.map(d).forEach(function(a){Object.prototype.hasOwnProperty.call(c,a.id)||(c[a.id]=a)});return c}function k(e){if(e&&e.registerService){this.serviceRegistry=e;for(var c=e.getServiceReferences(h).concat(e.getServiceReferences(a)),l=[],d=0;d<c.length;d++)for(var g=i(c[d].getProperty("contentTypes")),k=0;k<g.length;k++)l.push(g[k]);
this.map=b(l);e.registerService(f,this)}else if(Array.isArray(e))this.serviceRegistry=null,this.map=b(e);else throw Error("Invalid parameter");}var f="orion.core.contentTypeRegistry",h="orion.core.contenttype",a="orion.file.contenttype";k.prototype={getContentTypes:function(){var a=this.getContentTypesMap(),c=[],b;for(b in a)Object.prototype.hasOwnProperty.call(a,b)&&c.push(a[b]);return c},getContentTypesMap:function(){return this.map},getFileContentType:function(a){return j(a.Name,this.getContentTypes())},
getFilenameContentType:function(a){return j(a,this.getContentTypes())},getContentType:function(a){return this.map[a]||null},isExtensionOf:function(a,c){a=typeof a==="string"?this.getContentType(a):a;c=typeof c==="string"?this.getContentType(c):c;if(!a||!c)return!1;if(a.id===c.id)return!0;else for(var b=a,f={};b&&(b=this.getContentType(b["extends"]));){if(b.id===c.id)return!0;if(f[b.id])throw Error("Cycle: "+b.id);f[b.id]=!0}return!1},isSomeExtensionOf:function(a,c){for(var b=0;b<c.length;b++)if(this.isExtensionOf(a,
c[b]))return!0;return!1}};return{ContentTypeRegistry:k,getFilenameContentType:j}});
define("orion/crawler/searchCrawler","i18n!orion/crawler/nls/messages,require,orion/i18nUtil,orion/searchUtils,orion/contentTypes,orion/Deferred".split(","),function(j,i,g,d,b,k){function f(b,a,e,c){this.registry=b;this.fileClient=a;this.fileLocations=[];this.fileSkeleton=[];this._totalCounter=this._hitCounter=0;this._searchOnName=c&&c.searchOnName;this._buildSkeletonOnly=c&&c.buildSkeletonOnly;this._fetchChildrenCallBack=c&&c.fetchChildrenCallBack;this._searchParams=e;this.searchHelper=this._searchOnName||
this._buildSkeletonOnly?null:d.generateSearchHelper(e);this._location=c&&c.location;this._childrenLocation=c&&c.childrenLocation?c.childrenLocation:this._location;this._cancelled=!1;this._statusService=this.registry.getService("orion.page.message");this._progressService=this.registry.getService("orion.page.progress");this._statusService&&this._statusService.setCancelFunction(function(){this._cancelFileContentsSearch()}.bind(this))}f.prototype.search=function(b){var a=this.registry.getService("orion.core.contentTypeRegistry");
this._onSearchComplete=b;this._cancelled=!1;this._deferredArray=[];a.getContentTypes().then(function(a){this.contentTypesCache=a;var c=this;this._visitRecursively(this._childrenLocation).then(function(){c._cancelled||c._reportResult()}.bind(c),function(a){c._reportResult();c._statusService&&a.name==="Cancel"&&(console.log("Crawling search cancelled. Deferred array length : "+c._deferredArray.length),c._statusService.setProgressResult({Message:j["Search cancelled by user"],Severity:"Warning"}))}.bind(c))}.bind(this))};
f.prototype.searchName=function(b,a){if(b)this._searchParams=b,this.searchHelper=d.generateSearchHelper(b,!0);if(a)this.onSearchNameComplete=a;var e=[];this._cancelled=!1;this._deferredArray=[];this._sort(this.fileSkeleton);if(this.fileSkeleton.length>0){for(var c=0;c<this.fileSkeleton.length;c++){var f=this.fileSkeleton[c].Name.toLowerCase();if(this.searchHelper.inFileQuery.wildCard?d.searchOnelineRegEx(this.searchHelper.inFileQuery,f,!0):d.searchOnelineLiteral(this.searchHelper.inFileQuery,f,!0))if(e.push(this.fileSkeleton[c]),
e.length>=this.searchHelper.params.rows)break}this.onSearchNameComplete({response:{numFound:e.length,docs:e}})}else this.onSearchNameComplete({response:{numFound:0,docs:[]}})};f.prototype.buildSkeleton=function(b,a){this._buildingSkeleton=!0;var e=this.registry.getService("orion.core.contentTypeRegistry");this._cancelled=!1;this._deferredArray=[];var c=this;b();e.getContentTypes().then(function(b){c.contentTypesCache=b;c._visitRecursively(c._childrenLocation).then(function(){c._buildingSkeleton=!1;
a();c.searchHelper&&!c._buildSkeletonOnly&&c.searchName()})})};f.prototype._sort=function(b){b.sort(function(a,b){var c,f;if(this._searchParams.sort==="Path asc"){c=a.Location&&a.Location.toLowerCase();c=d.path2FolderName(c,a.Name&&a.Name.toLowerCase(),!0);f=b.Location&&b.Location.toLowerCase();f=d.path2FolderName(f,b.Name&&b.Name.toLowerCase(),!0);if(c<f)return-1;if(c>f)return 1}return this._sortOnNameSingle(a,b)}.bind(this))};f.prototype._reportResult=function(){this._sort(this.fileLocations);this._onSearchComplete({response:{numFound:this.fileLocations.length,
docs:this.fileLocations}})};f.prototype._sortOnNameSingle=function(b,a){var e=b.Name&&b.Name.toLowerCase(),c=a.Name&&a.Name.toLowerCase();return e<c?-1:e>c?1:0};f.prototype._onFileType=function(b){return this.searchHelper.params.fileType?this.searchHelper.params.fileType===d.ALL_FILE_TYPE?!0:b.extension.indexOf(this.searchHelper.params.fileType)>=0:!0};f.prototype._visitRecursively=function(f){var a=[],e=this;this._fetchChildrenCallBack&&this._fetchChildrenCallBack(f);return(e._progressService?this._progressService.progress(e.fileClient.fetchChildren(f),
"Crawling search for children of "+f):e.fileClient.fetchChildren(f)).then(function(c){for(var f=0;f<c.length;f++)if(c[f].Directory!==void 0&&c[f].Directory===!1)if(e._searchOnName)a.push(e._buildSingleSkeleton(c[f]));else if(e._buildSkeletonOnly)a.push(e._buildSingleSkeleton(c[f]));else{if(!e._cancelled){var h=b.getFilenameContentType(c[f].Name,e.contentTypesCache);if(h&&(h["extends"]==="text/plain"||h.id==="text/plain")&&e._onFileType(h))h=e._sniffSearch(c[f]),a.push(h),e._deferredArray.push(h)}}else if(c[f].Location)if(e._cancelled)break;
else h=e._visitRecursively(c[f].ChildrenLocation),a.push(h),e._deferredArray.push(h);return k.all(a)})};f.prototype._hitOnceWithinFile=function(b){b=this._searchParams.caseSensitive?b:b.toLowerCase();return this.searchHelper.inFileQuery.wildCard?d.searchOnelineRegEx(this.searchHelper.inFileQuery,b,!0):d.searchOnelineLiteral(this.searchHelper.inFileQuery,b,!0)};f.prototype._reportSingleHit=function(b){if(!this._cancelled)b.LastModified=b.LocalTimeStamp,this.fileLocations.push(b),this._hitCounter++,
this._sort(this.fileLocations),this._onSearchComplete({response:{numFound:this.fileLocations.length,docs:this.fileLocations}},!0)};f.prototype._cancelFileContentsSearch=function(){(this._cancelled=!0)&&this._deferredArray.forEach(function(b){b.cancel()})};f.prototype._sniffSearch=function(b){this._totalCounter++;var a=this;if(!this._cancelled)if(this.searchHelper.params.keyword==="")this._reportSingleHit(b),this._statusService&&this._statusService.setProgressResult({Message:g.formatMessage(j["${0} files found out of ${1}"],
this._hitCounter,this._totalCounter)});else return(a._progressService?a._progressService.progress(a.fileClient.read(b.Location),"Reading file "+b.Location):a.fileClient.read(b.Location)).then(function(e){a._hitOnceWithinFile(e)&&a._reportSingleHit(b);a._statusService&&a._statusService.setProgressResult({Message:g.formatMessage(j["${0} files found out of ${1}"],a._hitCounter,a._totalCounter)},j.Cancel)},function(a){a&&a.message&&a.message.toLowerCase()!=="cancel"&&console.error("Error loading file content: "+
a.message)})};f.prototype._buildSingleSkeleton=function(b){this._totalCounter++;this.fileSkeleton.push(b);this.searchHelper&&!this._buildSkeletonOnly&&this._totalCounter%100===0&&this.searchName();b=new k;b.resolve(this._totalCounter);return b};f.prototype.constructor=f;return{SearchCrawler:f}});
define("orion/webui/treetable",["i18n!orion/nls/messages","orion/webui/littlelib"],function(j,i){function g(d){this._init(d)}g.prototype={_init:function(d){var b=d.parent,g=this,b=i.node(b);if(!b)throw j["no parent"];if(!d.model)throw j["no tree model"];if(!d.renderer)throw j["no renderer"];this._parent=b;this._treeModel=d.model;this._onComplete=d.onComplete;this._renderer=d.renderer;this._showRoot=d.showRoot===void 0?!1:d.showRoot;this._indent=d.indent===void 0?16:d.indent;this._onCollapse=d.onCollapse;
this._labelColumnIndex=d.labelColumnIndex===void 0?0:d.labelColumnIndex;this._id=d.id===void 0?"treetable":d.id;this._tableStyle=d.tableStyle;this._tableElement=d.tableElement||"table";this._tableBodyElement=d.tableBodyElement||"tbody";this._tableRowElement=d.tableRowElement||"tr";this._root=this._treeModel.getRoot(function(b){g._showRoot?(b._depth=0,g._generate([b],0)):g._treeModel.getChildren(b,function(b){g.destroyed||g._generate(b,0)})})},destroy:function(){this.destroyed=!0},_generate:function(d,
b){i.empty(this._parent);var g=document.createElement("div");this._renderer.wrapperCallback&&this._renderer.wrapperCallback(g);var f=document.createElement(this._tableElement);this._renderer.tableCallback&&this._renderer.tableCallback(f);f.id=this._id;this._tableStyle&&f.classList.add(this._tableStyle);this._renderer.initTable(f,this);this._bodyElement=document.createElement(this._tableBodyElement);this._renderer.bodyCallback&&this._renderer.bodyCallback(this._bodyElement);this._bodyElement.id=this._id+
"tbody";d.length===0?this._renderer.emptyCallback&&this._renderer.emptyCallback(this._bodyElement):this._generateChildren(d,b);f.appendChild(this._bodyElement);g.appendChild(f);this._parent.appendChild(g);this._rowsChanged();this._onComplete&&this._onComplete(this)},_generateChildren:function(d,b,g){for(var f=0;f<d.length;f++){var h=document.createElement(this._tableRowElement);h.id=this._treeModel.getId(d[f]);h._depth=b;h._item=d[f];this._renderer.render(d[f],h);h.childNodes[this._labelColumnIndex].style.paddingLeft=
this._indent*b+"px";this._renderer.rowCallback&&this._renderer.rowCallback(h,d[f]);g?(this._bodyElement.insertBefore(h,g.nextSibling),g&&(g=h)):this._bodyElement.appendChild(h)}},_rowsChanged:function(){this._renderer.rowsChanged&&this._renderer.rowsChanged()},getSelected:function(){return this._renderer.getSelected()},refresh:function(d,b,g){var f=this._treeModel.getId(d),h;if(f===this._id)this._removeChildRows(f),this._generateChildren(b,0),this._rowsChanged();else{var a=i.node(f);a?(a._item=d,
a&&(g||a._expanded)?(this._removeChildRows(f),b?(a._expanded=!0,this._renderer.updateExpandVisuals(a,!0),this._generateChildren(b,a._depth+1,a),this._rowsChanged()):(h=this,this._renderer.updateExpandVisuals(a,"progress"),b=this._treeModel.getChildren(a._item,function(b){if(!h.destroyed&&(h._renderer.updateExpandVisuals(a,!0),!a._expanded))a._expanded=!0,h._generateChildren(b,a._depth+1,a),h._rowsChanged()}))):this._renderer.updateExpandVisuals(a,!1)):console.log(j["could not find table row "]+f)}},
getItem:function(d){var b=i.node(d);return b&&b._item?b._item:d},toggle:function(d){var b=i.node(d);b&&(b._expanded?this.collapse(d):this.expand(d))},isExpanded:function(d){d=typeof d==="string"?d:this._treeModel.getId(d);return(d=i.node(d))?d._expanded:!1},expand:function(d,b,g){var d=typeof d==="string"?d:this._treeModel.getId(d),f=i.node(d);if(f)if(f._expanded)b&&b.apply(h,g);else{var h=this;this._renderer.updateExpandVisuals(f,"progress");this._treeModel.getChildren(f._item,function(a){if(!h.destroyed){h._renderer.updateExpandVisuals(f,
!0);if(!f._expanded)f._expanded=!0,h._generateChildren(a,f._depth+1,f),h._rowsChanged();b&&b.apply(h,g)}})}},_removeChildRows:function(d){for(var b=d===this._id,g=!1,f=-1,h=[],a=i.$$array(".treeTableRow",this._parent),e=0;e<a.length;e++){var c=a[e];if(g)break;if(b)c._depth>f?h.push(c):g=!0;else if(c.id===d)b=!0,f=c._depth}for(d=0;d<h.length;d++)b=h[d],b.parentNode.removeChild(b)},collapse:function(d){var d=typeof d==="string"?d:this._treeModel.getId(d),b=i.node(d);if(b){if(!b._expanded)return;b._expanded=
!1;this._renderer.updateExpandVisuals(b,!1);this._removeChildRows(d);this._rowsChanged()}this._onCollapse&&this._onCollapse(b._item)},getIndent:function(){return this._indent}};g.prototype.constructor=g;return{TableTree:g}});
define("orion/treeModelIterator",[],function(){var j={};j.TreeModelIterator=function(){function i(g,d){this.firstLevelChildren=g;this.reset();this._init(d)}i.prototype={_init:function(g){if(g)this.isExpanded=g.isExpanded,this.isExpandable=g.isExpandable,this.forceExpandFunc=g.forceExpandFunc,this.getChildrenFunc=g.getChildrenFunc},topLevel:function(g){return g.parent?g.parent===this.root:!0},_getChildren:function(g){return typeof this.getChildrenFunc==="function"?this.getChildrenFunc(g):g?g.children:
null},_expanded:function(g){if(!g)return!0;var d=this._getChildren(g),d=d&&d.length>0;this.isExpanded&&d&&(d=this.isExpanded(g));return d},_expandable:function(g){return!g?!0:this.isExpandable?this.isExpandable(g):!1},_diveIn:function(g){return this._expanded(g)?(this.setCursor(this._getChildren(g)[0]),this.cursor()):null},_drillToLast:function(g){return this._expanded(g)?(g=this._getChildren(g),this._drillToLast(g[g.length-1])):g},_forward:function(g){if(!this._cursor)return null;var d=this._diveIn(this._cursor);
if(!d){if(g&&this._expandable(this._cursor)&&this.forceExpandFunc){var b=this;return this.forceExpandFunc(this._cursor,"first",function(d){d&&b.setCursor(d)})}(d=this._findSibling(this._cursor,!0))&&this.setCursor(d)}return d},_backward:function(g){if(!this._cursor)return null;var d=this._findSibling(this._cursor,!1);d&&d!==this._cursor.parent&&(d=this._drillToLast(d));if(g&&d&&this._expandable(d)&&this.forceExpandFunc&&d!==this._cursor.parent){var b=this;return this.forceExpandFunc(d,"last",function(d){d&&
b.setCursor(d)})}d&&this.setCursor(d);return d},_findSibling:function(g,d){for(var b=this.topLevel(g),k=this._getChildren(g.parent),k=b?this.firstLevelChildren:k,f=0;f<k.length;f++)if(k[f]===g)return f===0&&!d?b?null:g.parent:f===k.length-1&&d?b?null:this._findSibling(g.parent,d):d?k[f+1]:k[f-1];return null},_inParentChain:function(g,d){for(var b=g.parent;b;){if(b===d)return!0;b=b.parent}return!1},_getTopLevelParent:function(g){if(this.topLevel(g))return g;for(g=g.parent;g;){if(this.topLevel(g))return g;
g=g.parent}return null},_onCollapse:function(g){return this._expanded(g.parent)?g:this._onCollapse(g.parent)},_scan:function(g,d,b){this.setCursor(d);var k=[];for(k.push(d);;){if(this.iterate(g))k.push(this.cursor());else break;if(b===this.cursor())return k}return null},setCursor:function(g){this._prevCursor=this._cursor;this._cursor=g},setTree:function(g){this.firstLevelChildren=g;if(this.firstLevelChildren.length>0)this.root=this.firstLevelChildren[0].parent},scan:function(g,d){var b=this.cursor(),
k=this._scan(!0,g,d);k||(k=this._scan(!1,g,d));this.setCursor(b);return k},iterate:function(g,d){return g?this._forward(d):this._backward(d)},iterateOnTop:function(g,d){var b=this._findSibling(this._getTopLevelParent(this.cursor()),g);b?this.setCursor(b):d&&this.firstLevelChildren.length>0&&this.setCursor(g?this.firstLevelChildren[0]:this.firstLevelChildren[this.firstLevelChildren.length-1])},collapse:function(g){if(!this._cursor)return null;return this._inParentChain(this._cursor,g)?(this.setCursor(g),
this._cursor):null},reset:function(){this.root=this._prevCursor=this._cursor=null;if(this.firstLevelChildren.length>0)this._cursor=this.firstLevelChildren[0],this.root=this.firstLevelChildren[0].parent},cursorMoved:function(){return this._cursor!==this._prevCursor},cursor:function(){return this._cursor},prevCursor:function(){return this._prevCursor}};return i}();return j});
define("orion/explorers/explorerNavHandler",["orion/webui/littlelib","orion/treeModelIterator","orion/uiUtils"],function(j,i,g){var d={},b=navigator.userAgent.indexOf("iPad")!==-1,k=window.navigator.platform.indexOf("Mac")!==-1;d.ExplorerNavHandler=function(){function f(b,a,e){this.explorer=b;this.model=this.explorer.model;this._navDict=a;this._listeners=[];this._selections=[];this._currentColumn=0;b=this._getEventListeningDiv();b.tabIndex=0;b.classList.add("selectionModelContainer");var c=this;this._modelIterator=
new i.TreeModelIterator([],{isExpanded:this.isExpanded.bind(this),getChildrenFunc:e.getChildrenFunc,isExpandable:this.explorer.renderer.isExpandable?function(a){return c.explorer.renderer.isExpandable(a)}:function(a){return c.isExpandable(a)},forceExpandFunc:this.explorer.forceExpandFunc?function(a,b,e){return c.explorer.forceExpandFunc(a,b,e)}:void 0});this._init(e);(!e||e.setFocus!==!1)&&b.focus();e=function(a){if(g.isFormElement(a.target))return!0;if(c.explorer.preventDefaultFunc&&c.explorer.preventDefaultFunc(a,
c._modelIterator.cursor()))return!0;if(a.keyCode===j.KEY.DOWN)return c.onDownArrow(a);else if(a.keyCode===j.KEY.UP)return c.onUpArrow(a);else if(a.keyCode===j.KEY.RIGHT)return c.onRightArrow(a);else if(a.keyCode===j.KEY.LEFT)return c.onLeftArrow(a);else if(a.keyCode===j.KEY.SPACE)return c.onSpace(a);else if(a.keyCode===j.KEY.ENTER)return c.onEnter(a)};b.addEventListener("keydown",e,!1);this._listeners.push({type:"keydown",listener:e});e=function(){if(c.explorer.onFocus)c.explorer.onFocus(!1);else c.toggleCursor(null,
!1)};b.addEventListener("blur",e,!1);this._listeners.push({type:"blur",listener:e});e=function(){if(c.explorer.onFocus)c.explorer.onFocus(!0);else c.toggleCursor(null,!0)};b.addEventListener("focus",e,!1);this._listeners.push({type:"focus",listener:e});this._parentDiv=b}f.prototype={destroy:function(){this._parentDiv.classList.remove("selectionModelContainer");this.removeListeners()},_init:function(b){this._linearGridMove=!1;if(b)this._selectionPolicy=b.selectionPolicy,this.gridClickSelectionPolicy=
b.gridClickSelectionPolicy||"none",this.preventDefaultFunc=b.preventDefaultFunc,this.postDefaultFunc=b.postDefaultFunc},_ctrlKeyOn:function(b){return k?b.metaKey:b.ctrlKey},removeListeners:function(){if(this._listeners)for(var b=0;b<this._listeners.length;b++)this._parentDiv.removeEventListener(this._listeners[b].type,this._listeners[b].listener,!1)},focus:function(){var b=this._getEventListeningDiv();b&&b.focus()},_getEventListeningDiv:function(b){return this.explorer.keyEventListeningDiv&&typeof this.explorer.keyEventListeningDiv===
"function"?this.explorer.keyEventListeningDiv(b):j.node(this.explorer._parentId)},isExpandable:function(b){return!b?!1:j.node(this.explorer.renderer.expandCollapseImageId(this.model.getId(b)))?!0:!1},isExpanded:function(b){return!b?!1:this.explorer.myTree.isExpanded(this.model.getId(b))},refreshSelection:function(b,a){var e=this;this.explorer.selection&&this.explorer.selection.getSelections(function(c){e._clearSelection(a);for(var f=0;f<c.length;f++)e._selections.push(c[f]);e._selections.length>0?
e.cursorOn(e._selections[0],!0,!1,b):e.cursorOn(null,!1,!1,b);if(!(e._shiftSelectionAnchor&&e._inSelection(e._shiftSelectionAnchor)>=0))e._shiftSelectionAnchor=null})},refreshModel:function(b,a,e,c){this._currentColumn=0;this.topIterationNodes=[];this.model=a;this._navDict=b;if(this.model.getTopIterationNodes)this.topIterationNodes=this.model.getTopIterationNodes();else if(e)this.topIterationNodes=e;this._modelIterator.setTree(this.topIterationNodes);!c&&this.explorer.selection&&(this.toggleCursor(this._modelIterator.cursor(),
!1),this._modelIterator.reset());this.refreshSelection(!0)},getTopLevelNodes:function(){return this._modelIterator.firstLevelChildren},_inSelection:function(b){for(var b=this.model.getId(b),a=0;a<this._selections.length;a++)if(b===this.model.getId(this._selections[a]))return a;return-1},_clearSelection:function(b){if(b)for(b=0;b<this._selections.length;b++)this._checkRow(this._selections[b],!0);this._selections=[]},getSelectionPolicy:function(){return this._selectionPolicy},setSelectionPolicy:function(b){if(this._selectionPolicy!==
b)this._selectionPolicy=b,this._selectionPolicy==="cursorOnly"&&this._clearSelection(!0)},setSelection:function(b,a,e){if(this._selectionPolicy==="cursorOnly")a&&this.explorer.renderer._useCheckboxSelection&&this._checkRow(b,!0);else if(this._isRowSelectable(b)){!a||this._selectionPolicy==="singleSelection"?(this._clearSelection(!0),this._checkRow(b,!1),this._selections.push(b),this._lastSelection=b):(a=this._inSelection(b),a>=0?(this._checkRow(b,!0),this._selections.splice(a,1)):(this._checkRow(b,
!1),this._selections.push(b),this._lastSelection=b));if(e)this._shiftSelectionAnchor=this._lastSelection;this.explorer.selection&&(this.explorer.renderer.storeSelections(),this.explorer.selection.setSelections(this._selections))}},moveColumn:function(b,a){b||(b=this.currentModel());var e=this._getGridChildren(b);if(e&&e.length>1||a===0&&e){a!==0&&this.toggleCursor(b,!1);var c=this._currentColumn,f=!0;c+=a;c<0?(this._linearGridMove&&a!==0&&(this._modelIterator.iterate(!1)?b=this.currentModel():f=!1),
c=f?e.length-1:this._currentColumn):c>=e.length&&(this._linearGridMove&&a!==0&&(this._modelIterator.iterate(!0)?b=this.currentModel():f=!1),c=f?0:this._currentColumn);this._currentColumn=c;a!==0&&this.toggleCursor(b,!0);return!0}return!1},_getGridChildren:function(b){return this._navDict?this._navDict.getGridNavHolder(b):null},getCurrentGrid:function(b){b||(b=this.currentModel());return(b=this._getGridChildren(b))&&b.length>0?b[this._currentColumn]:null},getAriaContainerElement:function(b){for(var a=
this._parentDiv,e;b&&b!==a&&(e=b.getAttribute("role"))!=="grid"&&e!=="tree"&&e!=="treegrid";)b=b.parentNode;return b===a?null:b},toggleCursor:function(b,a){var e=this.getRowDiv(b),c=this.getCurrentGrid(b);c?(e&&(a?e.classList.add("treeIterationCursorRow"):e.classList.remove("treeIterationCursorRow")),c.domNode&&(e=this.getAriaContainerElement(c.domNode),a?(c.domNode.classList.add("treeIterationCursor"),e&&e.setAttribute("aria-activedescendant",c.domNode.id)):c.domNode.classList.remove("treeIterationCursor"))):
e&&(a?e.classList.add("treeIterationCursorRow_Dotted"):e.classList.remove("treeIterationCursorRow_Dotted"))},currentModel:function(){return this._modelIterator.cursor()},cursorOn:function(b,a,e,c){var f,d;if(b||a){if(d===this._modelIterator.cursor())return;f=this._modelIterator.cursor();d=b;this._modelIterator.setCursor(d)}else f=this._modelIterator.prevCursor(),d=this._modelIterator.cursor();if(f!==d||a)if(this.toggleCursor(f,!1),!a||d){this.moveColumn(null,0);this.toggleCursor(d,!0);if((b=this.getRowDiv())&&
!c){c=b.parentNode;for(a=document.documentElement;c&&c!==a;){var g=window.getComputedStyle(c,null);if(!g)break;g=g.getPropertyValue("overflow-y");if(g==="auto"||g==="scroll")break;c=c.parentNode}c&&(a=!0,b.offsetTop<=c.scrollTop?(a=!1,e===void 0&&(e=!1)):b.offsetTop+b.offsetHeight>=c.scrollTop+c.clientHeight&&(a=!1,e===void 0&&(e=!0)),a||b.scrollIntoView(!e))}if(this.explorer.onCursorChanged)this.explorer.onCursorChanged(f,d)}},getSelection:function(){return this._selections},getSelectionIds:function(){for(var b=
[],a=0;a<this._selections.length;a++)b.push(this.model.getId(this._selections[a]));return b},getRowDiv:function(b){b=b?b:this._modelIterator.cursor();if(!b)return null;var b=this.model.getId(b),a=this._navDict.getValue(b);return a&&a.rowDomNode?a.rowDomNode:j.node(b)},iterate:function(b,a,e,c){var f=null;if(this.topIterationNodes&&this.topIterationNodes.length!==0)if(c){c=this.currentModel();for((f=this._modelIterator.iterate(b,a))&&this._setCursorOnItem(b,e);f&&f.isNotSelectable;)(f=this._modelIterator.iterate(b,
a))&&this._setCursorOnItem(b,e);f||(this.cursorOn(c,!0,!1,!0),this._setCursorOnItem(b,e))}else(f=this._modelIterator.iterate(b,a))&&this._setCursorOnItem(b,e)},_setCursorOnItem:function(b,a){this.cursorOn(null,!1,b);if(a){var e=this._inSelection(this._modelIterator.prevCursor()),c=this._inSelection(this._modelIterator.cursor());e>=0&&c>=0?this.setSelection(this._modelIterator.prevCursor(),!0):this.setSelection(this.currentModel(),!0)}},_checkRow:function(b,a){if(this.explorer.renderer._useCheckboxSelection&&
this._selectionPolicy!=="singleSelection"){var e=this.getRowDiv(b);if(e){var c=j.node(this.explorer.renderer.getCheckBoxId(e.id)),f=a?!c.checked:!0;if(f!==c.checked)this.explorer.renderer.onCheck(e,c,f,!0)}}else this._select(b,a)},_select:function(b){b||(b=this._modelIterator.cursor());var a=this.getRowDiv(b);a&&(this._inSelection(b)<0?a.classList.add("checkedRow"):a.classList.remove("checkedRow"))},_onModelGrid:function(b,a){var e=this._getGridChildren(b);if(e)for(var c=0;c<e.length;c++)if(a.target===
e[c].domNode)return!0;return!1},onClick:function(f,a){if(this.isDisabled(this.getRowDiv(f)))j.stop(a);else{var e=j.node(this.explorer.renderer.expandCollapseImageId(this.model.getId(f)));if(a.target!==e&&!(this.gridClickSelectionPolicy==="none"&&this._onModelGrid(f,a)))if(this.cursorOn(f,!0,!1,!0),b)this.setSelection(f,!0);else if(this._ctrlKeyOn(a))this.setSelection(f,!0,!0);else if(a.shiftKey&&this._shiftSelectionAnchor){if(e=this._modelIterator.scan(this._shiftSelectionAnchor,f)){this._clearSelection(!0);
for(var c=0;c<e.length;c++)this.setSelection(e[c],!0)}}else this.setSelection(f,!1,!0)}},onCollapse:function(b){this._modelIterator.collapse(b)&&this.cursorOn()},onUpArrow:function(b){this.iterate(!1,!1,b.shiftKey,!0);!this._ctrlKeyOn(b)&&!b.shiftKey&&this.setSelection(this.currentModel(),!1,!0);b.preventDefault();return!1},onDownArrow:function(b){this.iterate(!0,!1,b.shiftKey,!0);!this._ctrlKeyOn(b)&&!b.shiftKey&&this.setSelection(this.currentModel(),!1,!0);b.preventDefault();return!1},_shouldMoveColumn:function(b){var a=
this.currentModel(),e=this._getGridChildren(a);return e&&e.length>1?this.isExpandable(a)?this._ctrlKeyOn(b):!0:!1},onLeftArrow:function(b){if(this._shouldMoveColumn(b))return this.moveColumn(null,-1),b.preventDefault(),!0;var a=this._modelIterator.cursor();if(!a)return!1;if(this.isExpandable(a)&&this.isExpanded(a))return this.explorer.myTree.collapse(a),b.preventDefault(),!0;this._modelIterator.topLevel(a)?this.explorer.scopeUp&&typeof this.explorer.scopeUp==="function"&&this.explorer.scopeUp():(this.cursorOn(a.parent),
this.setSelection(a.parent,!1,!0))},onRightArrow:function(b){if(this._shouldMoveColumn(b))return this.moveColumn(null,1),b.preventDefault(),!0;var a=this._modelIterator.cursor();if(!a)return!1;if(this.isExpandable(a)&&!this.isExpanded(a))return this.explorer.myTree.expand(a),this.explorer.postUserExpand&&this.explorer.postUserExpand(this.model.getId(a)),b.preventDefault(),!1},_isRowSelectable:function(b){return this.explorer.isRowSelectable?this.explorer.isRowSelectable(b):!0},onSpace:function(b){this.setSelection(this.currentModel(),
!0,!0);b.preventDefault()},onEnter:function(b){var a=this.getCurrentGrid(this._modelIterator.cursor());if(a)if(a.widget)if(typeof a.onClick==="function")a.onClick();else typeof a.widget.focus==="function"&&a.widget.focus();else{var e=document.createEvent("MouseEvents");e.initMouseEvent("click",!0,!0,window,0,0,0,0,0,this._ctrlKeyOn(b),!1,!1,!1,0,null);a.domNode.dispatchEvent(e)}else if(a=this._modelIterator.cursor()){if(this.explorer.renderer.getRowActionElement&&(e=this.explorer.renderer.getRowActionElement(this.model.getId(a)),
e.href))this._ctrlKeyOn(b)?window.open(e.href):window.location.href=e.href;if(this.explorer.renderer.performRowAction)return this.explorer.renderer.performRowAction(b,a),b.preventDefault(),!1}},setIsNotSelectable:function(b,a){b.isNotSelectable=a},disableItem:function(b){var a=this.getRowDiv(b);this.isExpandable(b)&&this.isExpanded(b)&&(this._modelIterator.collapse(b),this.explorer.myTree.toggle(a.id));a.classList.remove("checkedRow");a.classList.add("disabledNavRow");this.setIsNotSelectable(b,!0)},
isDisabled:function(b){return b.classList.contains("disabledNavRow")},enableItem:function(b){var a=this.getRowDiv(b);a&&(a.classList.remove("disabledNavRow"),this.setIsNotSelectable(b,!1))}};return f}();d.ExplorerNavDict=function(){function b(f){this._dict={};this._model=f}b.prototype={addRow:function(b,a){this._dict[this._model.getId(b)]={model:b,rowDomNode:a}},getValue:function(b){return this._dict[b]},getGridNavHolder:function(b,a){if(!b)return null;var e=this._model.getId(b);if(this._dict[e]){if(!this._dict[e].gridChildren&&
a)this._dict[e].gridChildren=[];return this._dict[e].gridChildren}return null},initGridNavHolder:function(b){if(!b)return null;b=this._model.getId(b);if(this._dict[b])this._dict[b].gridChildren=null}};return b}();return d});
define("orion/explorers/explorer","i18n!orion/nls/messages,require,orion/webui/littlelib,orion/webui/treetable,orion/explorers/explorerNavHandler,orion/commands".split(","),function(j,i,g,d,b,k){var f={};f.Explorer=function(){function f(a,b,c,d){this.registry=a;this.renderer=c;this.selection=b;this.commandService=d;if(this.renderer)this.renderer.explorer=this;this.myTree=null}f.prototype={destroy:function(){this._navHandler&&this._navHandler.destroy();this.model&&this.model.destroy();this.myTree&&
this.myTree.destroy();this.destroyed=!0},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,c,f){a=this.getRow(a);if(c)return a=a.childNodes[c],a.appendChild(document.createElement("br")),f=document.createElement("span"),f.id=b+"placeHolderRow",a.appendChild(f),{tempNode:f,refNode:f};if(a){var d=document.createElement("tr");
d.id=b+"placeHolderRow";c=document.createElement("td");c.id=b+"placeHolderCol";d.appendChild(c);f?(a.parentNode.insertBefore(d,a.nextSibling),a=parseInt(a.firstChild.style.paddingLeft),c.style.paddingLeft=this.myTree.getIndent()+a+"px"):a.appendChild(d);f=g.node(b+"placeHolderRow");a=g.node(b+"placeHolderCol");if(f&&a)return{tempNode:f,refNode:a}}return null},getRow:function(a){if(a=this.model.getId(a))return g.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 f=a.length,d=0;d<f;d++)b._expandRecursively(a[d])})})}},createTree:function(a,e,c){a=typeof a==="string"?a:a.id||a;this.selection&&
this.selection.setSelections([]);this.getNavHandler()&&this.getNavHandler()._clearSelection();var f=a+"innerTree",h=g.node(f);h&&g.empty(h);if(e)e.rootId=f;this.model=e;this._parentId=a;this._treeOptions=c;if(!c||c&&!c.noSelection)this.selectionPolicy=c?c.selectionPolicy:"",this._navDict=new b.ExplorerNavDict(this.model);this.myTree=new d.TableTree({id:f,model:e,parent:a,onComplete:c?c.onComplete:void 0,labelColumnIndex:this.renderer.getLabelColumnIndex(),renderer:this.renderer,showRoot:c?!!c.showRoot:
!1,indent:c?c.indent:void 0,onCollapse:c?c.onCollapse:void 0,navHandlerFactory:c?c.navHandlerFactory:void 0,tableElement:c?c.tableElement:void 0,tableBodyElement:c?c.tableBodyElement:void 0,tableRowElement:c?c.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 c=a.getSelection(),f=0;f<c.length;f++){var d=a.getRowDiv(c[f]);d&&d.parentNode&&(d=this.getNavDict().getValue(this.model.getId(c[f])),d.model&&b.push(d.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=a&&a.navHandlerFactory&&typeof a.navHandlerFactory.createNavHandler===
"function"?a.navHandlerFactory.createNavHandler(this,this._navDict,a):new b.ExplorerNavHandler(this,this._navDict,{getChildrenFunc:a?a.getChildrenFunc:null,setFocus:a&&a.setFocus,selectionPolicy:a?a.selectionPolicy:null});var e=this;this.model.getRoot(function(c){c instanceof Array?e.getNavHandler().refreshModel(e.getNavDict(),e.model,c):c.children&&c.children instanceof Array&&e.getNavHandler().refreshModel(e.getNavDict(),e.model,c.children);a&&a.setFocus&&e.getNavHandler().cursorOn(null,!1,!1,!0)})}},
_lastHash:null,checkbox:!1};return f}();f.createExplorerCommands=function(b,a){function e(c){return typeof c.getItemCount==="function"?c.getItemCount()>0?a?a(c):!0:!1:!1}var c=new k.Command({tooltip:j["Expand all"],imageClass:"core-sprite-expandAll",id:"orion.explorer.expandAll",groupId:"orion.explorerGroup",visibleWhen:function(a){return e(a)},callback:function(a){a.items.expandAll()}}),f=new k.Command({tooltip:j["Collapse all"],imageClass:"core-sprite-collapseAll",id:"orion.explorer.collapseAll",
groupId:"orion.explorerGroup",visibleWhen:function(a){return e(a)},callback:function(a){a.items.collapseAll()}});b.addCommand(c);b.addCommand(f)};f.ExplorerModel=function(){function b(a,e,c){this.rootPath=a;this.fetchItems=e;this.idPrefix=c||""}b.prototype={destroy:function(){this.destroyed=!0},getRoot:function(a){var b=this;this.fetchItems(this.rootPath).then(function(c){b.root=c;a(c)})},getChildren:function(a,b){a.Children?b(a.Children):a.ChildrenLocation?this.fetchItems(a.ChildrenLocation).then(function(c){a.Children=
c;b(c)}):b([])},getId:function(a){if(a.Location===this.root.Location)return this.rootId;for(var a=a.Location.replace(/[\\\/]/g,""),b=this.idPrefix,c=0;c<a.length;c++)b+=a[c].match(/[^\.\:\-\_0-9A-Za-z]/g)?a.charCodeAt(c):a[c];return b}};return b}();f.ExplorerFlatModel=function(){function b(a,e,c){this.rootPath=a;this.fetchItems=e;this.root=c}b.prototype=new f.ExplorerModel;b.prototype.getRoot=function(a){if(this.root)a(this.root);else{var b=this;this.fetchItems(this.rootPath).then(function(c){b.root=
c;a(c)})}};b.prototype.getChildren=function(a,b){a===this.root?b(this.root):b([])};return b}();f.ExplorerRenderer=function(){function b(a,e){this.explorer=e;this._init(a);this._expandImageClass="core-sprite-openarrow";this._collapseImageClass="core-sprite-closedarrow";this._progressImageClass="core-sprite-progress";this._twistieSpriteClass="modelDecorationSprite"}b.prototype={_init:function(a){if(a){this._useCheckboxSelection=a.checkbox===void 0?!1:a.checkbox;this.selectionPolicy=a.singleSelection?
"singleSelection":"";this._cachePrefix=a.cachePrefix;this.getCheckedFunc=a.getCheckedFunc;this.onCheckedFunc=a.onCheckedFunc;this._highlightSelection=!0;this._treeTableClass=a.treeTableClass||"treetable";if(a.highlightSelection===!1)this._highlightSelection=!1;if(!this.actionScopeId)this.actionScopeId=a.actionScopeId;if(!this.commandService)this.commandService=a.commandService}},getLabelColumnIndex:function(){return this.explorer.checkbox?1:0},initTable:function(a,b){this.tableTree=b;this.tableNode=
a;g.empty(a);this._treeTableClass&&a.classList.add(this._treeTableClass);this.renderTableHeader(a)},getActionsColumn:function(a,b,c,f,d){var c=c||"tool",h=document.createElement("td");h.id=b.id+"actionswrapper";f&&h.classList.add(f);this.actionScopeId&&this.commandService?this.commandService.renderCommands(this.actionScopeId,h,a,this.explorer,c,null,d&&this.explorer.getNavDict()?this.explorer.getNavDict().getGridNavHolder(a,!0):null):window.console.log("Warning, no command service or action scope was specified.  No commands rendered.");
return h},initCheckboxColumn:function(){if(this._useCheckboxSelection)return document.createElement("th")},getCheckboxColumn:function(a,b){if(this._useCheckboxSelection){var c=document.createElement("td"),f=document.createElement("span");f.id=this.getCheckBoxId(b.id);f.classList.add("core-sprite-check");f.classList.add("selectionCheckmarkSprite");f.rowId=b.id;if(this.getCheckedFunc)f.checked=this.getCheckedFunc(a),f.checked?(this._highlightSelection&&b.classList.add("checkedRow"),f.classList.add("core-sprite-check_on")):
(this._highlightSelection&&b.classList.remove("checkedRow"),f.classList.remove("core-sprite-check_on"));c.appendChild(f);var d=this;f.addEventListener("click",function(a){d.onCheck(b,a.target,a.target.checked?!1:!0,!0)},!1);return c}},getCheckBoxId:function(a){return a+"selectedState"},onCheck:function(a,b,c,f,d){(b.checked=c)?b.classList.add("core-sprite-check_on"):b.classList.remove("core-sprite-check_on");if(this.onCheckedFunc)this.onCheckedFunc(b.rowId,c,f);this.explorer.getNavHandler()&&d&&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){var b=this.explorer.getNavDict(),c=this.explorer.getNavHandler();if(c&&b&&c.getSelectionPolicy()!=="cursorOnly"&&(a=window.sessionStorage[a+"selection"],typeof a==="string"&&(a=a.length>0?JSON.parse(a):null),a)){for(var f=[],c=0;c<
a.length;c++){var d=b.getValue(a[c]);if(d&&d.rowDomNode&&d.model&&(f.push(d.model),this._highlightSelection&&d.rowDomNode.classList.add("checkedRow"),d=g.node(this.getCheckBoxId(d.rowDomNode.id))))d.checked=!0,d.classList.add("core-sprite-check_on")}this.explorer.selection&&(this.explorer.selection.setSelections(f),this.explorer.getNavHandler()&&this.explorer.getNavHandler().refreshSelection())}},_storeExpansions:function(a){window.sessionStorage[a+"expanded"]=JSON.stringify(this._expanded)},_restoreExpansions:function(a){var b=
!1,c=window.sessionStorage[a+"expanded"];typeof c==="string"&&(c=c.length>0?JSON.parse(c):null);var f;if(c)for(f=0;f<c.length;f++)if(g.node(c[f])){this._expanded.push(c[f]);var d=this;this.tableTree.expand(c[f],function(){d._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 c=g.node(this.expandCollapseImageId(a.id));c&&(c.classList.remove(this._expandImageClass),c.classList.remove(this._collapseImageClass),c.classList.remove(this._progressImageClass),c.classList.add(b==="progress"?this._progressImageClass:b?this._expandImageClass:this._collapseImageClass))},getExpandImage:function(a,b,c,f){var d=document.createElement("span");d.id=this.expandCollapseImageId(a.id);b.appendChild(d);d.classList.add(this._twistieSpriteClass);
d.classList.add(this._collapseImageClass);if(c){var h=document.createElement("span");b.appendChild(h);h.classList.add(f||"imageSprite");h.classList.add(c)}var g=this;d.onclick=function(){if(!g.explorer.getNavHandler().isDisabled(a)){g.tableTree.toggle(a.id);if(g.tableTree.isExpanded(a.id))g._expanded.push(a.id),g.explorer.postUserExpand&&g.explorer.postUserExpand(a.id);else for(var c in g._expanded)if(g._expanded[c]===a.id){g._expanded.splice(c,1);break}(c=g._getUIStatePreferencePath())&&window.sessionStorage&&
g._storeExpansions(c)}};return d},render:function(a,b){b.classList.add("navRow");this.renderRow(a,b)},rowsChanged:function(){this.explorer.selectionPolicy!=="cursorOnly"&&(this.explorer.refreshSelection(),this.explorer.initNavHandler());(g.$(".sectionTreeTable",this.tableNode.parentNode)||g.$(".treetable",this.tableNode.parentNode))&&g.$$array(".treeTableRow",this.tableNode).forEach(function(a,b){var c=!(b%2)?"darkSectionTreeTableRow":"lightSectionTreeTableRow",f=c==="darkSectionTreeTableRow"?"lightSectionTreeTableRow":
"darkSectionTreeTableRow";a.classList.add(c);a.classList.remove(f)})},updateCommands:function(){if(this.commandService)for(var a=g.$$array(".treeTableRow"),b=0;b<a.length;b++){var c=a[b],f=g.node(c.id+"actionswrapper");this.commandService.destroy(f);this.actionScopeId&&this.commandService.renderCommands(this.actionScopeId,f,c._item,this.explorer,"tool")}},_initializeUIState:function(){this._expanded=[];var a=this._getUIStatePreferencePath();a&&window.sessionStorage&&this._restoreExpansions(a)&&this._restoreSelections(a)}};
return b}();f.SelectionRenderer=function(){function b(a,e){this._init(a);this.explorer=e}b.prototype=new f.ExplorerRenderer;b.prototype.renderTableHeader=function(a){var b=document.createElement("thead"),c=document.createElement("tr");b.classList.add("navTableHeading");this._useCheckboxSelection&&c.appendChild(this.initCheckboxColumn(a));for(var f=0,d=this.getCellHeaderElement(f);d;)d.innerHTML.length>0&&d.classList.add("navColumn"),c.appendChild(d),d=this.getCellHeaderElement(++f);b.appendChild(c);
f>0&&a.appendChild(b)};b.prototype.renderRow=function(a,b){b.verticalAlign="baseline";b.classList.add("treeTableRow");var c=this.explorer.getNavDict();if(c){c.addRow(a,b);var f=this;b.addEventListener("click",function(c){if(f.explorer.getNavHandler())f.explorer.getNavHandler().onClick(a,c)},!1)}if(c=this.getCheckboxColumn(a,b))c.classList.add("checkColumn"),b.appendChild(c);for(var c=0,d=this.getCellElement(c,a,b);d;)b.appendChild(d),c===0?this.getPrimColumnStyle?d.classList.add(this.getPrimColumnStyle(a)):
d.classList.add("navColumn"):this.getSecondaryColumnStyle?d.classList.add(this.getSecondaryColumnStyle()):d.classList.add("secondaryColumn"),d=this.getCellElement(++c,a,b)};b.prototype.getCellHeaderElement=function(){};b.prototype.getCellElement=function(){};return b}();f.SimpleFlatModel=function(){function b(a,e,c){this.items=a;this.getKey=c;this.idPrefix=e;this.root={children:a}}b.prototype=new f.ExplorerModel;b.prototype.getRoot=function(a){a(this.root)};b.prototype.getId=function(a){for(var a=
this.getKey(a).replace(/[\\\/]/g,""),b="",c=0;c<a.length;c++)b+=a[c].match(/[^\.\:\-\_0-9A-Za-z]/g)?a.charCodeAt(c):a[c];return this.idPrefix+b};b.prototype.getChildren=function(a,b){a===this.root?b(this.items):b([])};return b}();return f});
define("orion/PageLinks","require,orion/Deferred,orion/PageUtil,orion/URITemplate,orion/i18nUtil,orion/objects,orion/URL-shim".split(","),function(j,i,g,d,b,k){function f(){return j.toUrl?(new URL(j.toUrl("orion/../"),window.location.href)).href.slice(0,-1):(new URL("/",window.location.href)).href.slice(0,-1)}function h(a){var c={};a.getPropertyKeys().forEach(function(b){b!=="objectClass"&&b!=="service.names"&&b!=="service.id"&&b!=="__plugin__"&&(c[b]=a.getProperty(b))});return c}function a(a){return b.getMessageBundle(a.nls).then(function(c){a.textContent=
a.nameKey?c[a.nameKey]:a.name;return a},function(){a.textContent=a.nameKey||a.name;return a})}function e(c,b){var e=c.getServiceReferences(b||"orion.page.link"),l=g.matchResourceParameters(window.location.href),m={OrionHome:f(),Location:l.resource},k=[];e.forEach(function(c){c=h(c);if(c.uriTemplate&&(c.nls||c.name)){var b=(new d(c.uriTemplate)).expand(m),b=g.validateURLScheme(b);c.href=b;c.nls?k.push(a(c)):(c.textContent=c.name,k.push((new i).resolve(c)))}});return i.all(k)}function c(a){var c=this.categories=
Object.create(null);a.forEach(function(a){c[a.id]=a})}function l(a){this.allPageLinks=a;this.allPageLinks.sort(m)}function m(a,c){var b=a.textContent&&a.textContent.toLowerCase(),e=c.textContent&&c.textContent.toLowerCase();return b<e?-1:b>e?1:0}var n;k.mixin(c.prototype,{getCategoryIDs:function(){return Object.keys(this.categories)},getCategory:function(a){return this.categories[a]||null}});k.mixin(l.prototype,{createLinkElements:function(){return this.allPageLinks.map(function(a){var c=a.href,a=
a.textContent,b=document.createElement("a");b.href=c;b.target="_self";b.classList.add("targetSelector");b.textContent=a;return b})},getAllLinks:function(){return this.allPageLinks}});return{getCategoriesInfo:function(b){var e;return!n?(e=[],b.getServiceReferences("orion.page.link.category").forEach(function(c){c=h(c);if(c.id&&(c.name||c.nameKey))c.nls?e.push(a(c)):(c.textContent=c.name,e.push((new i).resolve(c)))}),i.all(e).then(function(a){return n=new c(a)})):(new i).resolve(n)},getPageLinksInfo:function(a,
c){return e(a,c).then(function(a){return new l(a)})},getOrionHome:f}});
define("orion/edit/nls/root/messages",{Editor:"Editor",switchEditor:"Switch Editor",Fetching:"Fetching: ${0}",confirmUnsavedChanges:"There are unsaved changes.  Do you still want to navigate away?",searchFiles:"Search Files...",searchTerm:"Enter search term:",unsavedChanges:"There are unsaved changes.",unsavedAutoSaveChanges:"Please stay on the page until Auto Save is complete.",Save:"Save",Saved:"Saved",Blame:"Blame",BlameTooltip:"Show blame annotations",saveOutOfSync:"Resource is out of sync with the server. Do you want to save it anyway?",
loadOutOfSync:"Resource is out of sync with the server. Do you want to load it anyway? This will overwrite your local changes.",ReadingMetadata:"Reading metadata of ${0}",ReadingMetadataError:"Can not get metadata of ${0}",Reading:"Reading ${0}",readonly:"Read Only.",saveFile:"Save this file",gotoLine:"Go to Line...",gotoLineTooltip:"Go to specified line number",gotoLinePrompt:"Go to line:",Undo:"Undo",Redo:"Redo",Find:"Find...",noResponse:"No response from server.  Check your internet connection and try again.",
savingFile:"Saving file ${0}",running:"Running ${0}","Saving...":"Saving...",View:"View",SidePanel:"Side Panel",SidePanelTooltip:"Choose what to show in the side panel.",Actions:"Actions",Navigator:"Navigator",FolderNavigator:"Folder Navigator",Project:"Project",New:"New",File:"File",Edit:"Edit",Tools:"Tools",Add:"Add",noActions:"There are no actions for the current selection.",NoFile:"Use the ${0} to create new files and folders. Click a file to start coding.",LocalEditorSettings:"Local Editor Settings",
NoProject:"${0} is not a project. To convert it to a project use ${1}.",NoProjects:"There are no projects in your workspace. Use the ${0} menu to create projects.",disconnected:"(disconnected)",ChooseFS:"Choose Filesystem",ChooseFSTooltip:"Choose the filesystem you want to view.",FSTitle:"${0} (${1})",Deploy:"Deploy","Deploy As":"Deploy As",Import:"Import",Export:"Export",OpenWith:"Open With",OpenRelated:"Open Related",Dependency:"Dependency",UnnamedCommand:"Unnamed"});
define("orion/edit/nls/messages",["orion/i18n!orion/edit/nls/messages","orion/edit/nls/root/messages"],function(j,i){var g={root:i};Object.keys(j).forEach(function(d){typeof g[d]==="undefined"&&(g[d]=j[d])});return g});
define("orion/extensionCommands","require,orion/Deferred,orion/commands,orion/regex,orion/contentTypes,orion/URITemplate,orion/i18nUtil,orion/URL-shim,orion/PageLinks,i18n!orion/edit/nls/messages".split(","),function(j,i,g,d,b,k,f,h,a,e){function c(a){var c={};a.getPropertyKeys().forEach(function(b){c[b]=a.getProperty(b)});return c}var l={},m=a.getOrionHome();l._cloneItemWithoutChildren=function u(a){if(a===null||typeof a!=="object")return a;var c=a.constructor(),b;for(b in a)b!=="children"&&b!==
"Children"&&(c[b]=u(a[b]));return c};l._getOpenWithNavCommandExtensions=function(a){function c(a,b){for(var e=a.getServiceReferences("orion.navigate.openWith"),f=[],d=[],l=0;l<e.length;l++){var h=e[l];if(h.getProperty("editor")===b.id){var g=h.getProperty("contentType");g instanceof Array?f=f.concat(g):f.push(g||"*/*");h=h.getProperty("excludedContentTypes");h instanceof Array?d=d.concat(h):h!==null&&typeof h!=="undefined"&&d.push(h)}}0===f.length&&(f=null);0===d.length&&(d=null);return{contentTypes:f,
excludedContentTypes:d}}for(var b=function(){for(var c=a.getServiceReferences("orion.edit.editor"),b=[],e=0;e<c.length;e++){var f=c[e],d=f.getProperty("id");b.push({id:d,"default":f.getProperty("default")||!1,name:f.getProperty("name"),nameKey:f.getProperty("nameKey"),nls:f.getProperty("nls"),uriTemplate:f.getProperty("orionTemplate")||f.getProperty("uriTemplate"),validationProperties:f.getProperty("validationProperties")||[]})}return b}(),e=[],f=0;f<b.length;f++){var d=b[f],l=c(a,d);e.push({properties:{name:d.name||
d.id,nameKey:d.nameKey,id:"eclipse.openWithCommand."+d.id,contentType:l.contentTypes,excludedContentTypes:l.excludedContentTypes,uriTemplate:d.uriTemplate,nls:d.nls,forceSingleItem:!0,isEditor:d["default"]?"default":"editor",validationProperties:d.validationProperties},service:{}})}return e};l._makeValidator=function(a,c,e,f){function d(a,c,b,e){var f=b.match,l,h;if((l=c.indexOf("["))>=0){if((h=c.indexOf("]"))<0)return!1;var g=c.substring(0,l),m;if(!(m=a[g])||!Array.isArray(m))return!1;l=c.substring(l+
1,h);l=parseInt(l,10);if(isNaN(l))return!1;l<0&&(l+=m.length);c=c.substring(h+1);c=g+":"+String(l)+c}if(c.indexOf("|")>=0)return l=c.substring(0,c.indexOf("|")),c=c.substring(c.indexOf("|")+1),d(a,l,b,e)?!0:d(a,c,b,e);else if(c.indexOf(":")>=0)return l=c.substring(0,c.indexOf(":")),c=c.substring(c.indexOf(":")+1),a[l]?d(a[l],c,b,e):!1;else{a:{var g=!1,k;if(c.charAt(0)==="!")b=typeof a[c.substring(1)]==="undefined";else if(typeof a[c]!=="undefined"){if(typeof f==="undefined")k=a[c],g=!0;else if(typeof f===
"string"){if(!typeof(a[c]==="string")){b=!1;break a}if(b.variableName){if(f=RegExp(f).exec(a[c]))k=f[0],k=b.variableMatchPosition==="before"?a[c].substring(0,f.index):b.variableMatchPosition==="after"?a[c].substring(f.index+k.length):b.variableMatchPosition==="only"?k:a[c],g=!0}else{b=RegExp(f).test(a[c]);break a}}else a[c]===f&&(k=a[c],g=!0);if(g&&b.variableName&&(e[b.variableName]=k,e.itemCached=a,b.replacements))for(a=0;a<b.replacements.length;a++)k=!1,b.replacements[a].pattern?e[b.variableName]=
e[b.variableName].replace(RegExp(b.replacements[a].pattern),b.replacements[a].replacement||""):k=!0,k&&window.console.log("Invalid replacements specified in validation property.  "+b.replacements[a]);b=g}else b=!1}return b}}function l(c,e,f){if(f.info.validationProperties)for(var h=0;h<f.info.validationProperties.length;h++){var g=f.info.validationProperties[h];if(typeof g.source!=="undefined"){if(!d(c,g.source,g,f))return!1}else return window.console.log("Invalid validationProperties in "+a.id+".  No source property specified."),
!1}var h=!0,k=e?b.getFilenameContentType(c.Name,e):null,k=k||{id:"application/octet-stream"};f.info.excludedContentTypes&&e&&(h=f.info.excludedContentTypes.every(function(a){a=a.replace(/([*?])/g,".$1");return-1!==k.id.search(a)?!1:!0}));h&&f.info.contentType&&e&&(h=f.info.contentType.some(function(a){a=a.replace(/([*?])/g,".$1");return-1!==k.id.search(a)?!0:!1}));return h}return{info:a,validationFunction:function(a){typeof f==="function"&&(a=f.call(this,a));if(a){if(Array.isArray(a)){if((this.info.forceSingleItem||
this.info.uriTemplate)&&a.length!==1)return!1;if(a.length<1)return!1}else a=[a];for(var c=0;c<a.length;c++)if(!l(a[c],e,this))return!1;return!0}return!1},generatesURI:function(){return!!this.info.uriTemplate},getURI:function(a){if(this.info.uriTemplate){var c={},b;for(b in a)Object.prototype.hasOwnProperty.call(a,b)&&(c[b]=a[b]);if(this.info.validationProperties)for(b=0;b<this.info.validationProperties.length;b++){var e=this.info.validationProperties[b];e.source&&e.variableName&&(this.itemCached===
a&&this[e.variableName]||d(a,e.source,e,this),a[e.variableName]?window.console.log("Variable name "+e.variableName+" in the extension "+this.info.id+" conflicts with an existing property in the item metadata."):c[e.variableName]=this[e.variableName])}c.OrionHome=m;return(new k(this.info.uriTemplate)).expand(c)}return null}}};var n=e.UnnamedCommand;l._createCommandOptions=function(a,c,b,e,d,h){function g(f,k){var m=l._makeValidator(a,b,e,h);f.visibleWhen=m.validationFunction.bind(m);if(d)if(m.generatesURI.bind(m)())f.hrefCallback=
function(a){a=Array.isArray(a.items)?a.items[0]:a.items;return m.getURI.bind(m)(a)};else{var i=a;f.callback=function(a){var e;if(i.forceSingleItem)a=Array.isArray(a.items)?a.items[0]:a.items,e=l._cloneItemWithoutChildren(a);else if(Array.isArray(a.items)){e=[];for(var d=0;d<a.items.length;d++)e.push(l._cloneItemWithoutChildren(a.items[d]))}else e=l._cloneItemWithoutChildren(a.items);if(b)var h=b.getService("orion.page.progress");c.run?h?h.progress(c.run(e),"Running command: "+f.name):c.run(e):b&&
(h?h.progress(b.getService(c).run(e),"Running command: "+f.name):b.getService(c).run(e))}}k.resolve(f)}var k=new i;if(a.nls){var m=function(c){var b;c?(b=a.tooltipKey&&c[a.tooltipKey],c=a.nameKey&&c[a.nameKey]||a.name||n,b=b||a.tooltip||""):(c=a.name||a.nameKey||n,b=a.tooltip||a.tooltipKey||"");g({name:c,image:a.image,id:a.id||a.name,tooltip:b,isEditor:a.isEditor,showGlobally:a.showGlobally},k)};f.getMessageBundle(a.nls).then(m,m.bind(this,null))}else g({name:a.name,image:a.image,id:a.id||a.name,
tooltip:a.tooltip,isEditor:a.isEditor,showGlobally:a.showGlobally},k);return k};l.getOpenWithCommand=function(a,c,b){for(var e,a=b||l.getOpenWithCommands(a),b=0;b<a.length;b++)if(a[b].visibleWhen(c)){var f=a[b].isEditor==="default";if(!e||f)if(e=a[b],f)break}return e};l.getOpenWithCommands=function(a){var c=[],b;for(b in a._commandList){var e=a._commandList[b];e.isEditor&&c.push(e)}return c};var o;l.createAndPlaceFileCommandsExtension=function(a,c,b,f,d,h){return l.createFileCommands(a,null,h?"all":
void 0,!!h,c).then(function(a){d&&0<a.length&&(c.addCommandGroup(b,"eclipse.openWith",1E3,e.OpenWith,d,null,null,null,"dropdownSelection"),c.addCommandGroup(b,"eclipse.fileCommandExtensions",1E3,e.OpenRelated,d));a.forEach(function(a){var e=null;d&&(e=a.isEditor?d+"/eclipse.openWith":d+"/eclipse.fileCommandExtensions");c.registerCommandContribution(b,a.id,f,e)});return{}})};l.createFileCommands=function(a,c,b,e,f){var b=b===void 0?"global":b,e=e===void 0?!0:e,d=[];l._cachedFileCommands||l._createCachedFileCommands(a);
(b==="all"||b==="global")&&l._cachedFileCommands.forEach(function(a){var c=a.properties;(b==="all"||c.forceSingleItem&&c.showGlobally)&&d.push(a)});return i.when(function(){var b=a.getService("orion.core.contentTypeRegistry")||c;return o||i.when(b.getContentTypes(),function(a){return o=a})}(),function(){if(e){if(!l._cachedOpenWithExtensions)l._cachedOpenWithExtensions=l._getOpenWithNavCommandExtensions(a,o);d=d.concat(l._cachedOpenWithExtensions);f._addedOpenWithCommands=e}var c=d.map(function(c){var b=
c.properties,c=c.service,e=f.findCommand(b.id||b.name);return e?(new i).resolve(e):l._createCommandOptions(b,c,a,o,!0).then(function(a){a=new g.Command(a);f.addCommand(a);return a})});return i.all(c,function(a){return{_error:a}}).then(function(a){return a})})};l._createCachedFileCommands=function(a){var b=a.getServiceReferences("orion.navigate.command");l._cachedFileCommands=[];for(var e=0;e<b.length;e++)if(b[e].getProperty("id")!=="orion.navigateFromMetadata"){var f=a.getService(b[e]),d=c(b[e]);
l._cachedFileCommands.push({properties:d,service:f})}};l.getFileCommandIds=function(){var a=[];if(l._cachedFileCommands)l._cachedFileCommands.length&&(a=l._cachedFileCommands.map(function(a){return a.properties.id}));else throw"extensionCommandUtils._cachedFileCommands is not initialized";return a};l.createOpenWithCommands=function(a,c,b){return b&&b._addedOpenWithCommands?(new i).resolve(l.getOpenWithCommands(b)):l.createFileCommands(a,c,"none",!0,b)};return l});
define("orion/explorers/navigatorRenderer","i18n!orion/navigate/nls/messages,orion/Deferred,orion/explorers/explorer,orion/explorers/navigationUtils,orion/extensionCommands,orion/objects,orion/URITemplate,orion/webui/littlelib".split(","),function(j,i,g,d,b,k,f,h){function a(a){switch(a&&a.id){case "image/jpeg":case "image/png":case "image/gif":case "image/ico":case "image/tiff":case "image/svg":return!0}return!1}function e(c,e,d,h,g,j,t,q,v){var e=k.clone(e),w;if(e.Directory)w=document.createElement("a"),
w.className="navlinkonpage",w.href=!c?l:(new f(c+"#{,resource,params*}")).expand({resource:e.ChildrenLocation}),e.Name&&w.appendChild(document.createTextNode(e.Name));else{g||(g=b.getOpenWithCommands(d));w=document.createElement("a");w.className="navlink targetSelector";j&&typeof j==="object"&&Object.keys(j).forEach(function(a){w[a]=j[a]});var C=null,B=null;if(C=q?q.holderDom:w)B=document.createElement("span"),B.className="core-sprite-file modelDecorationSprite thumbnail",C.appendChild(B);e.Name&&
w.appendChild(document.createTextNode(e.Name));var E=e.Location;if(t&&typeof t==="object")e.params={},k.mixin(e.params,t);(c=b.getOpenWithCommand(d,e,g))&&(E=c.hrefCallback({items:e}));i.when(h.getFileContentType(e),function(c){if(C){var b=C,f=B;if(c){var d,l=c.imageClass,h=c.image;if(l)d=document.createElement("span"),d.className+=l,d.classList.add("thumbnail");else if(h)d=document.createElement("img"),d.src=h,d.classList.add("thumbnail");d&&b.replaceChild(d,f)}}w.href=E;v&&typeof v.updateFileNode===
"function"&&v.updateFileNode(e,w,a(c))})}return w}function c(a,c,b,e){this.explorer=c;this.commandService=b;this.contentTypeService=e;this.openWithCommands=null;this.actionScopeId=a.actionScopeId;this._init(a);this.target="_self"}var l=new f("#{,resource,params*}");c.prototype=new g.SelectionRenderer;c.prototype.wrapperCallback=function(a){a.setAttribute("role","tree")};c.prototype.tableCallback=function(a){a.setAttribute("aria-label",j.Navigator);a.setAttribute("role","presentation")};c.prototype.rowCallback=
function(a){a.setAttribute("role","treeitem")};c.prototype.emptyCallback=function(a){var c=document.createElement("tr"),b=document.createElement("td");b.colSpan=this.oneColumn?1:3;var e=document.createElement("div");e.classList.add("noFile");e.textContent=j.NoFile;var f=document.createElement("span");f.appendChild(document.createTextNode(j.File));h.processDOMNodes(e,[f]);b.appendChild(e);c.appendChild(b);a.appendChild(c)};c.prototype.getCellHeaderElement=function(a){if(this.oneColumn&&a!==0)return null;
switch(a){case 0:case 1:case 2:document.createElement("th").style.height="8px"}};c.prototype.setTarget=function(a){this.target=a};c.prototype.getFolderImage=function(){if(!this.showFolderImage)return null;var a=document.createElement("span");a.className="core-sprite-folder modelDecorationSprite";return a};c.prototype.createFolderNode=function(a){var c;this.showFolderLinks?(c=e(this.folderLink||"",a,this.commandService,this.contentTypeService),(a=this.getFolderImage(a))&&c.insertBefore(a,c.firstChild)):
(c=document.createElement("span"),c.textContent=a.Name);return c};c.prototype.updateFileNode=function(){};c.prototype.showFolderLinks=!0;c.prototype.getCellElement=function(a,c,f){switch(a){case 0:var a=document.createElement("td"),l=document.createElement("span");l.id=f.id+"MainCol";l.setAttribute("role","presentation");a.appendChild(l);a.setAttribute("role","presentation");l.className="mainNavColumn";var h;if(c.Directory)this.getExpandImage(f,l),h=this.createFolderNode(c),l.appendChild(h),this.explorer._makeDropTarget(c,
h),this.explorer._makeDropTarget(c,f);else{if(!this.openWithCommands)this.openWithCommands=b.getOpenWithCommands(this.commandService);h=e("",c,this.commandService,this.contentTypeService,this.openWithCommands,{target:this.target},null,null,this);l.appendChild(h)}if(h)h.id=f.id+"NameLink",h.nodeType===1&&(d.addNavGrid(this.explorer.getNavDict(),c,h),h.setAttribute("role","link"),h.setAttribute("tabindex","-1"));this.actionScopeId&&this.commandService.renderCommands(this.actionScopeId,l,c,this.explorer,
"tool",null,!0);return a;case 1:if(this.oneColumn)return null;f=document.createElement("td");if(c.LocalTimeStamp)f.textContent=(new Date(c.LocalTimeStamp)).toLocaleString();return f;case 2:if(this.oneColumn)return null;f=document.createElement("td");if(!c.Directory&&typeof c.Length==="number")c=parseInt(c.Length,10)/1024,f.textContent=Math.ceil(c).toLocaleString()+" KB";f.style.textAlign="right";return f}};c.prototype.constructor=c;return{NavigatorRenderer:c,isImage:a,createLink:e}});
define("orion/searchClient","i18n!orion/search/nls/messages,require,orion/webui/littlelib,orion/i18nUtil,orion/searchUtils,orion/crawler/searchCrawler,orion/explorers/navigatorRenderer,orion/extensionCommands,orion/Deferred".split(","),function(j,i,g,d,b,k,f,h,a){function e(a,c){this.serviceRegistry=a;this.commandRegistry=c;this.openWithCommands=null}function c(a){this.registry=a.serviceRegistry;this._commandService=a.commandService;this._fileService=a.fileService;this.defaultRenderer=new e(this.registry,
this._commandService);this._fileService||console.error("No file service on search client")}e.prototype.makeRenderFunction=function(c,e,k,o,p){var u=this.serviceRegistry,r=this.commandRegistry;this.openWithCommands=this.openWithCommands||h.createOpenWithCommands(u,c,r);var t=this;return function(h,u,w,C){a.when(t.openWithCommands,function(a){if(w)g.empty(e),a=document.createElement("div"),a.appendChild(document.createTextNode(j["Search failed."])),e.appendChild(a),typeof o==="function"&&o(e);else{var t=
function(){function a(c,b){var e=b.folderName?b.folderName:b.path,f=document.createElement("span");f.id=e.replace(/[^a-zA-Z0-9_\.:\-]/g,"");f.appendChild(document.createTextNode(" - "+e+" "));c.appendChild(f)}var c={};return function(b,e){var f=e.name;if(c.hasOwnProperty(f)){a(b,e);var d=c[f];typeof d==="function"&&(c[f]=null,d())}else c[f]=function(){a(b,e)}}}(),D=!1;g.empty(e);if(h&&h.length>0){var z=document.createElement("table");z.setAttribute("role","presentation");for(var s=0;s<h.length;s++){var y=
h[s],x;if(!D&&(D=!0,k))x=z.insertRow(0).insertCell(0),x.textContent=k;x=z.insertRow(-1).insertCell(0);x.colspan=2;p&&p(x);var G={Name:y.name,Directory:y.directory,Location:y.path||y.location},A=null;if(typeof y.LineNumber==="number")A={},A.line=y.LineNumber;if(C&&C.keyword&&!C.nameSearch){var H=b.generateSearchHelper(C),A=A||{};A.find=H.inFileQuery.searchStr;A.regEx=H.inFileQuery.wildCard?!0:void 0}G=f.createLink(i.toUrl("edit/edit.html"),G,r,c,a,{"aria-describedby":(y.folderName?y.folderName:y.path).replace(/[^a-zA-Z0-9_\.:\-]/g,
""),style:{verticalAlign:"middle"}},A);y.LineNumber&&G.appendChild(document.createTextNode(" (Line "+y.LineNumber+")"));x.appendChild(G);t(x,y)}e.appendChild(z);typeof o==="function"&&o(e)}!D&&u&&(a=d.formatMessage(j["No matches found for ${0}"],u),g.empty(e),e.appendChild(document.createTextNode(a)),typeof o==="function"&&o(e))}})}};c.prototype={search:function(a,c,e){var f=function(a){for(var e=[],f=0;f<a.response.docs.length;f++){var d=a.response.docs[f],h=d.Location,l=b.path2FolderName(d.Path?
d.Path:d.Location,d.Name),g=l?l:h;(c?g.indexOf(c)>=0:1)&&e.push({name:d.Name,path:h,folderName:l,directory:d.Directory,lineNumber:d.LineNumber})}return e};if(this._crawler&&a.nameSearch)this._crawler.searchName(a,function(c){e(f(c),a.keyword,null,a)});else try{this.registry.getService("orion.page.progress").progress(this._fileService.search(a),"Searching "+a.keyword).then(function(c){var b=a.keyword,b=b.substring(b.indexOf("}")+1),b=b.substring(b.indexOf(":")+1);e(f(c),b,null,a)},function(a){e(null,
null,a,null)})}catch(d){typeof d==="string"&&d.indexOf("search")>-1&&this._crawler?this._crawler.searchName(a,function(c){e(f(c),null,null,a)}):typeof d==="string"&&d.indexOf("search")>-1&&!a.nameSearch?(new k.SearchCrawler(this.registry,this._fileService,a,{childrenLocation:this.getChildrenLocation()})).search(function(c){e(f(c),null,null,a)}):this.registry.getService("orion.page.message").setErrorMessage(d)}},getFileService:function(){return this._fileService},setCrawler:function(a){this._crawler=
a},handleError:function(a,c){console.error(a);g.empty(c);c.appendChild(document.createTextNode(a));return a},setLocationByMetaData:function(a,c){var b="",e=null;this._searchRootLocation=this._fileService.fileServiceRootURL(a.Location);c&&a&&a.Parents&&a.Parents.length>0?e=c.index==="last"?a.Parents[a.Parents.length-1]:a.Parents[0]:a&&a.Directory&&a.Location&&a.Parents&&(e=a);if(e)this.setLocationbyURL(e.Location),b=e.Name,this._childrenLocation=e.ChildrenLocation;else if(a)this.setLocationbyURL(this._searchRootLocation),
b=this._fileService.fileServiceName(a.Location),this._childrenLocation=a.ChildrenLocation;e=g.node("search");b||(b="");if(e&&e.placeholder){e.value="";var f=d.formatMessage(j["Search ${0}"],b);e.placeholder=f.length>30?f.substring(0,27)+"...":d.formatMessage(j["Search ${0}"],b)}if(e&&e.title)e.title=j["Type a keyword or wild card to search in "]+b},setLocationbyURL:function(a){this._searchLocation=a},setRootLocationbyURL:function(a){this._searchRootLocation=a},setChildrenLocationbyURL:function(a){this._childrenLocation=
a},getSearchLocation:function(){return this._searchLocation?this._searchLocation:this._fileService.fileServiceRootURL()},getSearchRootLocation:function(){return this._searchRootLocation?this._searchRootLocation:this._fileService.fileServiceRootURL()},getChildrenLocation:function(){return this._childrenLocation?this._childrenLocation:this._fileService.fileServiceRootURL()},createSearchParams:function(a,c,b,e){b=b?this.getSearchRootLocation():this.getSearchLocation();return c?{resource:b,sort:"NameLower asc",
rows:100,start:0,nameSearch:!0,keyword:a}:{resource:b,sort:e&&e.sort?e.sort:"Path asc",rows:e&&e.rows?e.rows:40,start:0,caseSensitive:e?e.caseSensitive:void 0,regEx:e?e.regEx:void 0,fileType:e?e.fileType:void 0,keyword:a,replace:e?e.replace:void 0}}};c.prototype.constructor=c;return{Searcher:c}});define("text!orion/banner/slideout.html",[],function(){return'<div id="slideContainer" class="slideParameters slideContainer">\n\t<span id="pageCommandParameters" class="layoutLeft parameters"></span>\n\t<span id="pageCommandDismiss" class="layoutRight parametersDismiss"></span>\n</div>'});
define("orion/commonHTMLFragments",["require","orion/webui/littlelib","text!orion/banner/slideout.html"],function(j,i,g){return{slideoutHTMLFragment:function(d){var b=document.createElement("div");b.innerHTML=g;var k=i.$("#slideContainer",b);k.id=d+k.id;k=i.$("#pageCommandParameters",b);k.id=d+k.id;k=i.$("#pageCommandDismiss",b);k.id=d+k.id;return b.innerHTML}}});
define("orion/keyBinding",["orion/util"],function(j){function i(d,b,g,f,h,a){this.type=a||"keydown";this.keyCode=typeof d==="string"&&this.type==="keydown"?d.toUpperCase().charCodeAt(0):d;this.mod1=b!==void 0&&b!==null?b:!1;this.mod2=g!==void 0&&g!==null?g:!1;this.mod3=f!==void 0&&f!==null?f:!1;this.mod4=h!==void 0&&h!==null?h:!1}function g(d){this.keys=d}i.prototype={getKeys:function(){return[this]},match:function(d,b){if(b!==void 0){if(b!==0)return!1}else if(d instanceof Array){if(d.length>1)return!1;
d=d[0]}return d.type!==this.type?!1:this.keyCode===d.keyCode||this.keyCode===String.fromCharCode(j.isOpera?d.which:d.charCode!==void 0?d.charCode:d.keyCode)?this.mod1!==(j.isMac?d.metaKey:d.ctrlKey)?!1:this.type==="keydown"&&this.mod2!==d.shiftKey?!1:this.mod3!==d.altKey?!1:j.isMac&&this.mod4!==d.ctrlKey?!1:!0:!1},equals:function(d){return!d?!1:this.keyCode!==d.keyCode?!1:this.mod1!==d.mod1?!1:this.mod2!==d.mod2?!1:this.mod3!==d.mod3?!1:this.mod4!==d.mod4?!1:this.type!==d.type?!1:!0}};g.prototype=
{getKeys:function(){return this.keys.slice(0)},match:function(d,b){var g=this.keys;if(b!==void 0)return b>g.length?!1:g[b].match(d)?b===g.length-1?!0:b+1:!1;else{d instanceof Array||(d=[d]);if(d.length>g.length)return!1;var f;for(f=0;f<d.length;f++)if(!g[f].match(d[f]))return!1;return f===g.length?!0:f}},equals:function(d){if(!d.keys)return!1;if(d.keys.length!==this.keys.length)return!1;for(var b=0;b<d.keys.length;b++)if(!d.keys[b].equals(this.keys[b]))return!1;return!0}};return{KeyBinding:i,KeyStroke:i,
KeySequence:g}});
define("orion/parameterCollectors",["i18n!orion/nls/messages","require","orion/webui/littlelib"],function(j,i,g){function d(b,d){this._activeContainer=null;this._getElementsFunction=b;this._toolbarLayoutFunction=d}d.prototype={close:function(){if(this._activeElements){this._activeElements.parameterArea&&g.empty(this._activeElements.parameterArea);this._activeElements.slideContainer&&this._activeElements.slideContainer.classList.remove("slideContainerActive");this._activeElements.dismissArea&&g.empty(this._activeElements.dismissArea);
this._activeElements.commandNode&&this._activeElements.commandNode.classList.remove("activeCommand");this._toolbarLayoutFunction(this._activeElements);if(this._activeElements.onClose)this._activeElements.onClose();if(this._oldFocusNode)this._oldFocusNode.focus(),this._oldFocusNode=null}this._activeElements=null},open:function(b,d,f){typeof b==="string"&&(b=g.node(b));if(this._activeElements&&this._activeElements.slideContainer&&this._activeElements.commandNode===b)return this._activeElements.focusNode&&
this._activeElements.focusNode.focus(),!0;this.close();this._activeElements=null;if((this._activeElements=this._getElementsFunction(b))&&this._activeElements.parameterArea&&this._activeElements.slideContainer){this._activeElements.onClose=f;var h=d(this._activeElements.parameterArea,this._activeElements.dismissArea);if(!h)return!1;this._activeElements.focusNode=h;b=g.$$array("#closebox",this._activeElements.dismissArea||this._activeElements.parameterArea);if(b.length===0){d=this._activeElements.dismissArea||
this._activeElements.parameterArea;b=document.createElement("button");b.id="closebox";b.className="imageSprite core-sprite-close dismissButton";b.title=j.Close;d.appendChild(b);var a=this;b.addEventListener("click",function(){a.close()},!1)}this._activeElements.slideContainer.classList.add("slideContainerActive");this._toolbarLayoutFunction(this._activeElements);if(h)this._oldFocusNode=window.document.activeElement,window.setTimeout(function(){h.focus();h.select&&h.select()},0);this._activeElements.commandNode&&
this._activeElements.commandNode.classList.add("activeCommand");return!0}return!1},_collectAndCall:function(b,d){g.$$array("input",d).forEach(function(f){f.type==="checkbox"?b.parameters.setValue(f.parameterName,f.checked):f.type!=="button"&&b.parameters.setValue(f.parameterName,f.value.trim())});g.$$array("textArea",d).forEach(function(f){b.parameters.setValue(f.parameterName,f.value.trim())});b.command.callback&&b.command.callback.call(b.handler,b)},collectParameters:function(b){return b.parameters?
(b.domNode&&b.domNode.classList.add("commandMarker"),this.open(b.domNode||b.domParent,this.getFillFunction(b))):!1},getFillFunction:function(b,d){var f=this;return function(h,a){var e=null,c=function(){d&&d();f.close()},l=function(a){a.keyCode===g.KEY.ENTER&&f._collectAndCall(b,h);if(a.keyCode===g.KEY.ESCAPE||a.keyCode===g.KEY.ENTER)c(),g.stop(a)};b.parameters.forEach(function(a){var f=null;if(a.label)f=document.createElement("label"),f.classList.add("parameterInput"),f.setAttribute("for",a.name+
"parameterCollector"),f.textContent=a.label,h.appendChild(f);var d=a.name+"parameterCollector",k,f=f||h;if(a.type==="text"&&typeof a.lines==="number"&&a.lines>1)k=document.createElement("textarea"),k.rows=a.lines,k.type="textarea",k.id=d,f.appendChild(k),l=function(a){a.keyCode===g.KEY.ESCAPE&&(c(),g.stop(a))};else if(a.type==="boolean"){if(k=document.createElement("input"),k.type="checkbox",k.id=d,f.appendChild(k),a.value)k.checked=!0}else if(k=document.createElement("input"),k.type=a.type,k.id=
d,f.appendChild(k),a.value)k.value=a.value;k.classList.add("parameterInput");k.setAttribute("speech","speech");k.setAttribute("x-webkit-speech","x-webkit-speech");k.parameterName=a.name;e||(e=k);a.eventListeners.length>0&&a.eventListeners.forEach(function(a){k.addEventListener(a.event,function(c){return a.handler(c,b)},a.capture)});k.addEventListener("keydown",l,!1)});var m=a;m||(m=document.createElement("span"),m.classList.add("layoutRight"),m.classList.add("parametersDismiss"),h.appendChild(m));
var i=function(a,c){var b=document.createElement("button");c.appendChild(b);a&&b.appendChild(document.createTextNode(a));b.classList.add("dismissButton");return b};if(b.parameters.hasOptionalParameters())b.parameters.optionsRequested=!1,i(j.More,m).addEventListener("click",function(){b.parameters.optionsRequested=!0;f._collectAndCall(b,h);c()},!1);i(j.Submit,m).addEventListener("click",function(){f._collectAndCall(b,h);c()},!1);m=i(null,m);m.id="closebox";m.classList.add("imageSprite");m.classList.add("core-sprite-close");
m.title=j.Close;m.addEventListener("click",function(){c()},!1);return e}}};d.prototype.constructor=d;return{CommandParameterCollector:d}});
define("orion/breadcrumbs",["require","orion/webui/littlelib"],function(j,i){function g(d){this._init(d)}g.prototype={_init:function(d){var b=i.node(d.container);if(!b)throw"no parent container";this._container=b;b.classList.remove("currentLocation");this._id=d.id||"eclipse.breadcrumbs";this._resource=d.resource||null;this._rootSegmentName=d.rootSegmentName;this._workspaceRootSegmentName=d.workspaceRootSegmentName;this._workspaceRootURL=d.workspaceRootURL;this._makeHref=d.makeHref;this._makeFinalHref=
d.makeFinalHref;this._maxLength=d.maxLength;this.path="";this.measure();this.render()},getNavigatorWorkspaceRootSegment:function(){if(this._workspaceRootSegmentName){var d;if(this._resource&&this._resource.Parents&&!this._resource.skip){d=document.createElement("a");var b=this._workspaceRootURL?this._workspaceRootURL:"";this._makeHref?this._makeHref(d,b):d.href=j.toUrl("edit/edit.html")+"#"+b}else d=document.createElement("span");i.empty(d);d.appendChild(document.createTextNode(this._workspaceRootSegmentName));
return d}return null},MAX_LENGTH:500,INCLUDE_FIRST_SECTION:!0,segments:[],buildSegment:function(d){var b=document.createElement("a");b.classList.add("breadcrumb");b.appendChild(document.createTextNode(d));return b},addSegmentHref:function(d,b){this._makeHref?this._makeHref(d,b.Location,b):d.href=j.toUrl("edit/edit.html")+"#"+b.ChildrenLocation},buildSegments:function(d,b){if(this._resource.Parents){var g=this._resource.Parents.slice(0),f,h;g&&(g=g.slice(0),b==="reverse"&&(g=g.reverse().slice(0)),
g.forEach(function(a){if(!a.skip)d?(h=d,d=null):h=a.Name,f=this.buildSegment(h),this.path+=a.Name,this.addSegmentHref(f,a),f.include=!1,this.segments.push(f)}.bind(this)))}},addDivider:function(){var d=document.createElement("span");d.appendChild(document.createTextNode(" / "));this.path+="/";d.classList.add("breadcrumbSeparator");this.append(d)},refresh:function(){(this.crumbs=i.node(this._id))?i.empty(this.crumbs):(this.crumbs=document.createElement("span"),this.crumbs.id=this._id,this._container.appendChild(this.crumbs),
this.dirty=document.createElement("span"),this.dirty.id="dirty",this.dirty.className="modifiedFileMarker",this._container.appendChild(this.dirty));this.crumbs.style.width="auto";this.crumbs.style.visibility="visible";this.crumbs.parentNode.className="currentLocation";this.crumbs.parentNode.style.width="auto"},append:function(d){this.crumbs.appendChild(d)},addTitle:function(d,b){var g=b||document.title;this.crumbs.childNodes.length===0&&(d=document.createElement("span"),d.appendChild(document.createTextNode(g)),
d.classList.add("breadcrumb"),d.classList.add("currentLocation"),this.append(d))},finalSegment:function(d,b){if(!this._resource.skip){var g;g=b?b:this._resource.Name;this._makeFinalHref?(d=this.buildSegment(g),this.addSegmentHref(d,this._resource)):(d=document.createElement("span"),d.appendChild(document.createTextNode(g)));d.classList.add("currentLocation");this.path+=this._resource.Name;this.append(d)}},firstSegment:function(d){if(d)if(this.append(d),this._resource&&this._resource.Parents&&!this._resource.skip)d.classList.add("breadcrumb"),
this.addDivider();else{if(!this._resource.skip)d.href="";d.classList.add("currentLocation")}},drawSegments:function(){this._resource.Parents&&this.segments.slice(0).forEach(function(d){d.include===!0&&(this.append(d),this.addDivider())}.bind(this))},measureSegments:function(){this.INCLUDE_FIRST_SECTION=!0;if(this._resource.Parents){var d=this.segments.slice(0).reverse();d.forEach(function(b){this.append(b);this.addDivider();this.crumbs.offsetWidth<this.MAX_LENGTH?b.include=!0:this.INCLUDE_FIRST_SECTION=
!1}.bind(this));this.segments=d.reverse()}},measure:function(){var d=this._container;d.style.width="auto";this.MAX_LENGTH=this._maxLength?this._maxLength:d.offsetWidth;this.refresh();this.segments=[];this.crumbs.style.visibility="hidden";var d=this.getNavigatorWorkspaceRootSegment(),b=this._rootSegmentName;if(b)this.addTitle(d,b);else if(this.finalSegment(d,b),this._resource&&this._resource.Parents&&(this.buildSegments(b,"reverse"),this.measureSegments(),this.firstSegment(d)),this.crumbs.offsetWidth>=
this.MAX_LENGTH)this.INCLUDE_FIRST_SECTION=!1},render:function(){this.refresh();var d=this.getNavigatorWorkspaceRootSegment(),b=this._rootSegmentName;b?this.addTitle(d,b):(this.INCLUDE_FIRST_SECTION===!0&&this.firstSegment(d),this._resource&&this._resource.Parents&&(this.drawSegments(),this.finalSegment(d,b)));this.crumbs.parentNode.style.width=this.crumbs.offsetWidth+20+"px"}};g.prototype.constructor=g;return{BreadCrumbs:g}});
define("orion/webui/splitter",["require","orion/EventTarget","orion/webui/littlelib"],function(j,i,g){function d(b){i.attach(this);this._init(b)}d.prototype={_init:function(b){this._tracking=null;this._animationDelay=501;this._closeReversely=b.closeReversely;this.$node=g.node(b.node);if(!this.$node)throw"no dom node for splitter found";this.$sideNode=g.node(b.sidePanel);if(!this.$sideNode)throw"no dom node for side panel found";this.$mainNode=g.node(b.mainPanel);if(!this.$mainNode)throw"no dom node for main panel found";
this._vertical=b.vertical;this._prefix="/orion/splitter/"+(this.$node.id||document.body.id||"");if(b.toggle)this._thumb=document.createElement("div"),this.$node.appendChild(this._thumb),this._thumb.classList.add("splitThumb"),this._thumb.classList.add(this._vertical?"splitVerticalThumbLayout":"splitThumbLayout");this._closeByDefault=this.$node.getAttribute("data-initial-state")==="closed";if(typeof b.closeByDefault!=="undefined")this._closeByDefault=b.closeByDefault;this._initializeFromStoredSettings();
this._closed?(this._closed=!1,this._thumbDown(!0,!0)):this._adjustToSplitPosition();this.$node.style.visibility="visible";this.$mainNode.style.display="block";this.$sideNode.style.display="block";this.$node.addEventListener("mousedown",this._mouseDown.bind(this),!1);window.addEventListener("mouseup",this._mouseUp.bind(this),!1);window.addEventListener("resize",this._resize.bind(this),!1)},isClosed:function(){return this._closed},toggleSidePanel:function(){this._thumbDown()},openSidePanel:function(){this._closed||
this._thumbDown()},addResizeListener:function(b){this.addEventListener("resize",function(d){b(d.node)})},_initializeFromStoredSettings:function(){var b=localStorage.getItem(this._prefix+"/toggleState");this._closed=typeof b==="string"?b==="closed":this._closeByDefault;var b=g.bounds(this.$node.parentNode),d=g.bounds(this.$node),f;if(this._vertical)if(f=localStorage.getItem(this._prefix+"/yPosition")){if(this._splitTop=parseInt(f,10),this._splitTop>b.top+b.height-d.height)this._splitTop=b.top+b.height/
2}else{if(this._closeByDefault)this._initialSplit=this._getSplitPosition(),this._splitTop=0}else if(f=localStorage.getItem(this._prefix+"/xPosition")){if(this._splitLeft=parseInt(f,10),this._splitLeft>b.left+b.width-d.width)this._splitLeft=b.left+b.width/2}else if(this._closeByDefault)this._initialSplit=this._getSplitPosition(),this._splitLeft=0},_getSplitPosition:function(){var b=g.bounds(this.$node),d=g.bounds(this.$node.parentNode);return this.vertical?b.top-d.top:b.left-d.left},_adjustToSplitPosition:function(b){var d=
g.bounds(this.$node),f=g.bounds(this.$node.parentNode);if(this._vertical){this._splitHeight=d.height;if(b||!this._splitTop)this._splitTop=d.top,localStorage.setItem(this._prefix+"/yPosition",this._splitTop);b=this._splitTop;this.$node.parentNode.style.position==="relative"&&(b=this._splitTop-f.top);this.$sideNode.style.height=b+"px";this.$sideNode.style.display="block";this.$node.style.top=b+"px"}else{this._splitWidth=d.width;if(b||!this._splitLeft)this._splitLeft=d.left,localStorage.setItem(this._prefix+
"/xPosition",this._splitLeft);b=this._splitLeft;this.$node.parentNode.style.position==="relative"&&(b=this._splitLeft-f.left);this.$sideNode.style.width=b+"px";this.$sideNode.style.display="block";this.$node.style.left=b+"px"}this._resize()},_resize:function(b,d,f){var b=b||0,h=g.bounds(this.$node.parentNode),a=g.bounds(this.$node);this._vertical?(f===void 0&&(f=a.top-h.top),f+=a.height,this.$mainNode.style.top=f+"px"):(d===void 0&&(d=a.left-h.left),d+=a.width,this.$mainNode.style.left=d+"px");var e=
this;window.setTimeout(function(){e._notifyResizeListeners(e.$mainNode);e._notifyResizeListeners(e.$sideNode)},b)},_notifyResizeListeners:function(b){this.dispatchEvent({type:"resize",node:b})},_notifyToggleListeners:function(){this.dispatchEvent({type:"toggle",closed:this._closed})},_thumbDown:function(b,d){b||this._addAnimation();var f=this._splitTop,h=this._splitLeft;if(this._closed){if(this._closed=!1,!this._splitLeft&&!this._splitTop&&typeof this._initialSplit==="number")f=h=this._initialSplit}else if(this._closed=
!0,this._closeReversely){var a=g.bounds(this.$node.parentNode),e=g.bounds(this.$node);this._vertical?f=a.height-e.height:h=a.width-e.width}else f=h=0;this._vertical?(this.$sideNode.style.height=f+"px",this.$node.style.top=f+"px"):(this.$sideNode.style.width=h+"px",this.$node.style.left=h+"px");this._resize(this._animationDelay,h,f);b||this._removeAnimation();d||localStorage.setItem(this._prefix+"/toggleState",this._closed?"closed":null);var c=this;window.setTimeout(function(){c._notifyToggleListeners()},
this._animationDelay)},_removeAnimation:function(){var b=this;window.setTimeout(function(){b.$sideNode.classList.remove(b._vertical?"sidePanelVerticalLayoutAnimation":"sidePanelLayoutAnimation");b.$mainNode.classList.remove(b._vertical?"mainPanelVerticalLayoutAnimation":"mainPanelLayoutAnimation");b.$node.classList.remove(b._vertical?"splitVerticalLayoutAnimation":"splitLayoutAnimation")},this._animationDelay)},_addAnimation:function(){this.$sideNode.classList.add(this._vertical?"sidePanelVerticalLayoutAnimation":
"sidePanelLayoutAnimation");this.$mainNode.classList.add(this._vertical?"mainPanelVerticalLayoutAnimation":"mainPanelLayoutAnimation");this.$node.classList.add(this._vertical?"splitVerticalLayoutAnimation":"splitLayoutAnimation")},_mouseDown:function(b){if(b.target===this._thumb)return g.stop(b),this._thumbDown();if(!this._tracking)this.$node.classList.add("splitTracking"),this.$mainNode.classList.add("panelTracking"),this.$sideNode.classList.add("panelTracking"),this._tracking=this._mouseMove.bind(this),
window.addEventListener("mousemove",this._tracking),g.setFramesEnabled(!1),g.stop(b)},_mouseMove:function(b){if(this._tracking){var d=g.bounds(this.$node.parentNode);if(this._vertical){this._splitTop=b.clientY;if(this._splitTop<d.top+5)this._splitTop=d.top+5;else if(this._splitTop>d.top+d.height-5)this._splitTop=d.top+d.height-5;var f=this._splitTop,f=this._splitTop-d.top;this.$node.style.top=f+"px"}else{this._splitLeft=b.clientX;if(this._splitLeft<d.left+5)this._splitLeft=d.left+5;else if(this._splitLeft>
d.left+d.width-5)this._splitLeft=d.left+d.width-5;f=this._splitLeft;f=this._splitLeft-2*d.left;this.$node.style.left=f+"px"}this._adjustToSplitPosition(!0);g.stop(b)}},_mouseUp:function(b){if(this._tracking)g.setFramesEnabled(!0),window.removeEventListener("mousemove",this._tracking),this._tracking=null,this.$node.classList.remove("splitTracking"),this.$mainNode.classList.remove("panelTracking"),this.$sideNode.classList.remove("panelTracking"),g.stop(b)}};d.prototype.constructor=d;return{Splitter:d}});
define("orion/keyAssist",["i18n!orion/nls/messages","orion/webui/littlelib","orion/util"],function(j,i,g){function d(b){this.commandRegistry=b.commandRegistry;this.create();this._filterString="";this._providers=[]}d.prototype={addProvider:function(b){this._providers.push(b)},create:function(){var b=this._keyAssistDiv=document.createElement("div");b.id="keyAssist";b.style.display="none";b.classList.add("keyAssistFloat");b.setAttribute("role","menu");var d=this._keyAssistInput=document.createElement("input");
d.classList.add("keyAssistInput");d.type="text";d.placeholder=j["Filter bindings"];b.appendChild(d);var f=this._keyAssistContents=document.createElement("div");f.classList.add("keyAssistContents");if(g.isIOS||g.isAndroid)f.style.overflowY="auto";b.appendChild(f);var h=this._keyAssistTable=document.createElement("table");h.tabIndex=0;h.classList.add("keyAssistList");f.appendChild(h);document.body.appendChild(b);d.addEventListener("keydown",function(a){this._keyDown(a)}.bind(this));h.addEventListener("keydown",
function(a){this._keyDown(a)}.bind(this));d.addEventListener("input",function(){this.filterChanged()}.bind(this));f.addEventListener(g.isFirefox?"DOMMouseScroll":"mousewheel",function(a){this._scrollWheel(a)}.bind(this));document.addEventListener("keydown",function(a){a.keyCode===i.KEY.ESCAPE&&this.hide()}.bind(this));i.addAutoDismiss([b],function(){this.hide()}.bind(this))},createContents:function(){i.empty(this._keyAssistTable);this._selectedIndex=-1;this._selectedRow=null;for(var b=this._idCount=
this._keyAssistContents.scrollTop=0;b<this._providers.length;b++)this._providers[b].showKeyBindings(this);this.createHeader(j.Global);this.commandRegistry.showKeyBindings(this)},createItem:function(b,d,f){if(this._filterString){var h=this._filterString.toLowerCase(),a;h!==this._filterString?(h=this._filterString,a=function(a){return a}):a=function(a){return a.toLowerCase()};if(a(d).indexOf(h)===-1&&a(b).indexOf(h)===-1&&a(this._lastHeader).indexOf(h)===-1)return}var e=this._keyAssistTable.insertRow(-1);
e.id="keyAssist-keyBinding-"+this._idCount++;e.setAttribute("role","menuitem");e._execute=f;e.classList.add("keyAssistItem");e.addEventListener("click",function(a){this._selectedRow=e;this.execute();a.preventDefault()}.bind(this));f=e.insertCell(-1);f.classList.add("keyAssistName");f.appendChild(document.createTextNode(d));f=e.insertCell(-1);f.classList.add("keyAssistAccel");f.appendChild(document.createTextNode(b))},createHeader:function(b){this._lastHeader=b;var d=this._keyAssistTable.insertRow(-1);
d.classList.add("keyAssistSection");var d=d.insertCell(-1),f=document.createElement("h2");f.appendChild(document.createTextNode(b));d.appendChild(f)},execute:function(){window.setTimeout(function(){this.hide();var b=this._selectedRow;this._selectedRow=null;b&&b._execute&&b._execute()}.bind(this),0)},filterChanged:function(){this._timeout&&window.clearTimeout(this._timeout);this._timeout=window.setTimeout(function(){this._timeout=null;var b=this._keyAssistInput.value;if(this._filterString!==b)this._filterString=
b,this.createContents()}.bind(this),100)},hide:function(){if(this.isVisible()){var b=document.activeElement,d=this._keyAssistDiv,b=d===b||(d.compareDocumentPosition(b)&16)!==0;d.style.display="none";b&&document.compareDocumentPosition(this._previousActiveElement)!==1&&this._previousActiveElement.focus();this._previousActiveElement=null}},isVisible:function(){return this._keyAssistDiv.style.display==="block"},removeProvider:function(b){b=this._providers.indexOf(b);b!==-1&&this._providers.splice(b,
1)},select:function(b){var d=this._keyAssistTable.querySelectorAll(".keyAssistItem");if(d.length===0)this._selectedIndex=-1;else{var f=this._selectedIndex;f+=b?1:-1;f%=d.length;f<0&&(f=d.length-1);if(this._selectedIndex!==-1)b=d[this._selectedIndex],b.classList.remove("selected"),this._selectedRow=null;this._selectedIndex=f;if(this._selectedIndex!==-1){this._selectedRow=b=d[this._selectedIndex];b.classList.add("selected");this._keyAssistTable.setAttribute("aria-activedescendant",b.id);this._keyAssistTable.focus();
var d=b.getBoundingClientRect(),h=this._keyAssistContents,a=h.getBoundingClientRect();b.offsetTop<h.scrollTop?f===0?h.scrollTop=0:b.scrollIntoView(!0):d.bottom>a.bottom&&b.scrollIntoView(!1)}}},show:function(){if(!this.isVisible())this._previousActiveElement=document.activeElement,this.createContents(),this._keyAssistContents.style.height=Math.floor(this._keyAssistDiv.parentNode.clientHeight*0.75)+"px",this._keyAssistDiv.style.display="block",this._keyAssistInput.value=this._filterString,this._keyAssistInput.focus(),
this._keyAssistInput.select()},_keyDown:function(b){if(b.keyCode===40)this.select(!0);else if(b.keyCode===38)this.select(!1);else if(b.keyCode===13)this.execute();else return;b.preventDefault()},_scrollWheel:function(b){var d=0,d=g.isIE||g.isOpera?-b.wheelDelta:g.isFirefox?b.detail*40:-b.wheelDeltaY,f=this._keyAssistContents,h=f.scrollTop;f.scrollTop+=d;if(h!==f.scrollTop)return b.preventDefault&&b.preventDefault(),!1}};return{KeyAssistPanel:d}});
define("orion/widgets/themes/ThemePreferences",[],function(){function j(i,g){this._preferences=i;this._themeData=g;var d=g.getThemeStorageInfo();this._themeVersion=d.version;var b=i.listenForChangedSettings(d.storage,2,function(d){d.key===b&&this.apply()}.bind(this))}j.prototype={_initialize:function(i,g,d){var b,k;this._themeVersion===void 0||d.get("version")===this._themeVersion?(b=d.get(i.styleset),(k=d.get("selected"))&&(k=JSON.parse(k))):k=b=null;b||(b=g.getStyles(),d.put(i.styleset,JSON.stringify(b)));
if(!k||k[i.selectedKey]===void 0)k=k||{},k[i.selectedKey]=i.defaultTheme,d.put("selected",JSON.stringify(k));d.put("version",this._themeVersion)},apply:function(){this.setTheme()},getTheme:function(i){var g=this._themeData,d=g.getThemeStorageInfo();this._preferences.getPreferences(d.storage,2).then(function(b){this._initialize(d,g,b);var k=JSON.parse(b.get("selected")),b=JSON.parse(b.get(d.styleset)),f;if(b)for(var h=0;h<b.length;h++)if(b[h].name===k[d.selectedKey]){f=b[h];break}i({style:f,styles:b})}.bind(this))},
setTheme:function(i,g){var d=this._themeData,b=d.getThemeStorageInfo();this._preferences.getPreferences(b.storage,2).then(function(k){this._initialize(b,d,k);var f=JSON.parse(k.get("selected"));i||(i=f[b.selectedKey]);f[b.selectedKey]=i;k.put("selected",JSON.stringify(f));g?k.put(b.styleset,JSON.stringify(g)):g=JSON.parse(k.get(b.styleset));for(var h=0;h<g.length;h++)if(g[h].name===f[b.selectedKey]){d.processSettings(g[h]);break}k.put("version",this._themeVersion)}.bind(this))},setFontSize:function(i){var g=
this._themeData,d=g.getThemeStorageInfo();this._preferences.getPreferences(d.storage,2).then(function(b){this._initialize(d,g,b);var k=JSON.parse(b.get("selected")),f=JSON.parse(b.get(d.styleset)),h;if(f)for(var a=0;a<f.length;a++)f[a].fontSize=i,f[a].name===k[d.selectedKey]&&(h=f[a]);b.put(d.styleset,JSON.stringify(f));g.processSettings(h)}.bind(this))}};return{ThemePreferences:j}});
define("orion/settings/nls/root/messages",{"Plugin Description":"Plugin Description",Create:"Create","Loading...":"Loading...","Label:":"Label:",Title:"Title",Plugins:"Plugins","User Profile":"User Profile",Git:"Git","Git Settings":"Git Settings",General:"General",Navigation:"Navigation",Links:"Links","Open in same tab":"Open in same tab","Open in new tab":"Open in new tab",Font:"Font",Family:"Family","Sans Serif":"Sans Serif",Serif:"Serif",Size:"Size","8pt":"8pt","9pt":"9pt","10pt":"10pt","12pt":"12pt",
Color:"Color",Background:"Background",Strings:"Strings","String Types":"String Types",blue:"blue",Weight:"Weight",Normal:"Normal",Bold:"Bold",Comments:"Comments","Comment Types":"Comment Types",green:"green",Keywords:"Keywords","Keyword Types":"Keyword Types",darkred:"darkred",Categories:"Categories",Username:"Username","Full Name":"Full Name","Email Address":"Email Address","Email Confirmed":"Email Confirmed",Account:"Account","Current Password":"Current Password","New Password":"New Password","Verify Password":"Verify Password",
Password:"Password",OpenId:"OpenId",AOL:"AOL",Yahoo:"Yahoo",Google:"Google",Unlink:"Unlink",Link:"Link",Unlinked:"Unlinked",Linked:"Linked","Linked Accounts":"Linked Accounts","Git Email Address":"Git Email Address","Git Username":"Git Username","Git Credentials Storage":"Git Credentials Storage",Update:"Update","Update Profile Settings":"Update Profile Settings","Update Git User Settings":"Update Git User Settings","Update Git Credentials":"Update Git Credentials","User profile data successfully updated.":"User profile data successfully updated.",
"Git user data successfully updated.":"Git user data successfully updated.","Git Credentials successfully updated.":"Git Credentials successfully updated.","Edit Plugin JavaScript":"Edit Plugin JavaScript","Install Plugin":"Install Plugin","Plugin Name:":"Plugin Name:","Author Name:":"Author Name:","Licence:":"Licence:","Description:":"Description:","A plugin for Eclipse Orion":"A plugin for Eclipse Orion","Plugin Link":"Plugin Link",Install:"Install","Install a plugin by specifying its URL":"Install a plugin by specifying its URL",
"Plugin URL:":"Plugin URL:",Disable:"Disable",DisableTooltip:"Disable the plugin",Enable:"Enable",EnableTooltip:"Enable the plugin","Reload all":"Reload all","Reload all installed plugins":"Reload all installed plugins","Create a new Orion Plugin":"Create a new Orion Plugin","Find More Orion Plugins":"Find More Orion Plugins","Get Plugins":"Get Plugins",Reload:"Reload","Reload the plugin":"Reload the plugin",Delete:"Delete","Delete this plugin from the configuration":"Delete this plugin from the configuration",
"Type a plugin url here ...":"Type a plugin url here ...","Installed ":"Installed ","Installing ":"Installing ","Already installed":"Already installed"," plugin":" plugin","Reloaded ":"Reloaded ","Uninstalled ":"Uninstalled ","Are you sure you want to uninstall '":"Are you sure you want to uninstall '",Services:"Services",Value:"Value","JavaScript Object":"JavaScript Object","click here, then check javascript console to drill down":"click here, then check javascript console to drill down",Item:"Item",
"Git Config":"Git Config","Clear Git Credentials":"Clear Git Credentials","Enable Storage":"Enable Storage","Please be aware that your credentials will be stored persistently in the browser.":"Please be aware that your credentials will be stored persistently in the browser.","Do you wish to enable the Key Storage?":"Do you wish to enable the Key Storage?",general:"General",validation:"Validation","Deleted git credentials for ${0}":"Deleted git credentials for ${0}",Editor:"Editor",editorSettings:"Settings",
EditorThemes:"Themes",Import:"Import","Import a theme":"Import a theme",Export:"Export","Export a theme":"Export a theme","Theme name:":"Theme name:",yourTheme:"yourTheme",fileManagement:"File Management",typing:"Typing",autoSave:"Auto Save",autoSaveTimeout:"Save interval (ms)",autoLoad:"Auto Load",saveDiffs:"Save file as diffs",trimTrailingWhiteSpace:"Trim Trailing Whitespace on Save",Restore:"Restore Defaults",Default:"Default",keys:"Keys",tabs:"Tabs",tabSize:"Tab Size",expandTab:"Insert spaces for tabs",
smoothScrolling:"Smooth Scrolling",scrollAnimation:"Scrolling Animation",scrollAnimationTimeout:"Scrolling Duration (ms)",keyBindings:"Key Bindings",rulers:"Rulers",annotationRuler:"Show Annotation Ruler",lineNumberRuler:"Show Line Number Ruler",foldingRuler:"Show Folding Ruler",overviewRuler:"Show Overview Ruler",whitespaces:"White Spaces",wrapping:"Wrapping",wordWrap:"Word Wrap",showMargin:"Show Margin",marginOffset:"Margin Column",showTabs:"Show Tabs",showSpaces:"Show Spaces",autoSaveTimeoutInvalid:"Invalid save interval.",
scrollAnimationTimeoutInvalid:"Invalid scrolling duration.",tabSizeInvalid:"Invalid tab size.",localSettingsTooltip:"Toggle whether this setting is shown in the local editor settings drop down.",editorSettingsInfo:"Use the ${0} and ${1} to toggle whether a given setting is shown in the local editor settings drop down ${2}.",autoPairParentheses:"Autopair (Parentheses)",autoPairBraces:"Autopair {Braces}",autoPairSquareBrackets:"Autopair [Square] Brackets",autoPairAngleBrackets:"Autopair <Angle> Brackets",
autoPairQuotations:'Autopair "Strings"',autoCompleteComments:"Autocomplete /** Block Comments */",smartIndentation:"Smart Indentation",sourceControl:"Source Control",showBlame:"Show Blame",languageTools:"Language Tools",showOccurrences:"Show Occurrences",contentAssistAutoTrigger:"Show Content Assist automatically","Editor preferences updated":"Editor preferences updated","Editor defaults restored":"Editor defaults restored",Theme:"Theme","Font Size":"Font Size","New Theme Name:":"New Theme Name:",
"Font Size:":"Font Size:","UI Theme":"UI Theme","Navigation Bar":"Navigation Bar","Navigation Text":"Navigation Text","Search Box":"Search Box","Tool Panel":"Tool Panel","Selection Bar":"Selection Bar",Location:"Location",Content:"Content","Main Panel":"Main Panel",Button:"Button","Button Text":"Button Text","Section Text":"Section Text","Side Panel":"Side Panel","Line Color":"Line Color","Line Numbers":"Line Numbers",Foreground:"Foreground","Current Line":"Current Line","HTML Attribute":"HTML Attribute",
"Overview Ruler":"Overview Ruler","HTML Tag":"HTML Tag","Annotation Ruler":"Annotation Ruler","Show Guide":"Show Guide","Check Guide":"Check Guide",Cancel:"Cancel","Revert Theme":"Revert Theme","Update Theme":"Update Theme","Theme:":"Theme:",clickDiagram:"Click diagram to style.",clickUpdate:"Click Update button to save preview.","CSS Class Name":"CSS Class Name","CSS Attribute":"CSS Attribute","CSS Value":"CSS Value","CSS Text":"CSS Text","COLOR:":"Color:","NEW COLOR:":"New Color:",Ok:"Ok","OR HEX:":"Or Hex: "});
define("orion/settings/nls/messages",["orion/i18n!orion/settings/nls/messages","orion/settings/nls/root/messages"],function(j,i){var g={root:i};Object.keys(j).forEach(function(d){typeof g[d]==="undefined"&&(g[d]=j[d])});return g});
define("orion/editor/eventTarget",[],function(){function j(){}j.addMixin=function(i){var g=j.prototype,d;for(d in g)g.hasOwnProperty(d)&&(i[d]=g[d])};j.prototype={addEventListener:function(i,g,d){if(!this._eventTypes)this._eventTypes={};var b=this._eventTypes[i];b||(b=this._eventTypes[i]={level:0,listeners:[]});b.listeners.push({listener:g,useCapture:d})},dispatchEvent:function(i){var g=i.type;this._dispatchEvent("pre"+g,i);this._dispatchEvent(g,i);this._dispatchEvent("post"+g,i)},_dispatchEvent:function(i,
g){var d=this._eventTypes?this._eventTypes[i]:null;if(d){var b=d.listeners;try{if(d.level++,b)for(var k=0,f=b.length;k<f;k++)if(b[k]){var h=b[k].listener;typeof h==="function"?h.call(this,g):h.handleEvent&&typeof h.handleEvent==="function"&&h.handleEvent(g)}}finally{if(d.level--,d.compact&&d.level===0){for(k=b.length-1;k>=0;k--)b[k]||b.splice(k,1);b.length===0&&delete this._eventTypes[i];d.compact=!1}}}},isListening:function(i){return!this._eventTypes?!1:this._eventTypes[i]!==void 0},removeEventListener:function(i,
g,d){if(this._eventTypes){var b=this._eventTypes[i];if(b){for(var k=b.listeners,f=0,h=k.length;f<h;f++){var a=k[f];if(a&&a.listener===g&&a.useCapture===d){b.level!==0?(k[f]=null,b.compact=!0):k.splice(f,1);break}}k.length===0&&delete this._eventTypes[i]}}}};return{EventTarget:j}});
define("orion/editor/textTheme",["require","orion/editor/eventTarget","orion/util"],function(j,i,g){function d(b){b=b||{};this._document=b.document||document}var b={};d.getTheme=function(g){var g=g||"default",f=b[g];f||(f=b[g]=new d);return f};d.prototype={getThemeClass:function(){return this._themeClass},setThemeClass:function(b,f){var d=this,a=d._themeClass;d._themeClass=b;this._load(b,f,function(){d.onThemeChanged({type:"ThemeChanged",oldValue:a,newValue:d.getThemeClass()})})},onThemeChanged:function(b){return this.dispatchEvent(b)},
buildStyleSheet:function(b,f){function d(e,c,f){c&&(a.push("."+b+" ."+e+" {"),a.push("\t"+(f?"background-color":"color")+": "+c+";"),a.push("}"))}var a=[];a.push("");a.push("."+b+" {");f.fontFamily&&a.push("\tfont-family: "+f.fontFamily+";");f.fontSize&&a.push("\tfont-size: "+f.fontSize+";");f.fontSize&&a.push("\tcolor: "+f.text+";");a.push("}");a.push("."+b+".textview {");f.background&&a.push("\tbackground-color: "+f.background+";");a.push("}");d("ruler.annotations",f.annotationRuler,!0);d("ruler.lines",
f.annotationRuler,!0);d("ruler.folding",f.annotationRuler,!0);d("ruler.overview",f.overviewRuler,!0);d("rulerLines",f.lineNumber,!1);d("rulerLines.even",f.lineNumberEven,!1);d("rulerLines.odd",f.lineNumberOdd,!1);d("annotationLine.currentLine",f.currentLine,!0);d("entity-name-tag",f.keyword,!1);d("entity-other-attribute-name",f.attribute,!1);d("string-quoted",f.string,!1);d("meta.annotation.currentLine",f.currentLine,!0);d("keyword",f.keyword,!1);d("string",f.string,!1);d("comment",f.comment,!1);
d("comment.block.documentation",f.comment,!1);d("keyword.other.documentation.markup",f.comment,!1);return a.join("\n")},_createStyle:function(b,f,d,a){var e=this._document,b="orion-theme-"+b,c=e.getElementById(b);if(c){if(a||c.firstChild.data===f)return;c.removeChild(c.firstChild);c.appendChild(e.createTextNode(f))}else a?(c=g.createElement(e,"link"),c.rel="stylesheet",c.type="text/css",c.href=f,c.addEventListener("load",function(){d()})):(c=g.createElement(e,"style"),c.appendChild(e.createTextNode(f))),
c.id=b,(e.getElementsByTagName("head")[0]||e.documentElement).appendChild(c);a||d()},_load:function(b,f,d){if(b)if(typeof f==="string")this._createStyle(b,f,d);else if(f=f.href,f.substring(f.length-4)!==".css"&&(f+=".css"),/^\//.test(f)||/[a-zA-Z0-9]+:\/\//i.test(f)||!j.toUrl)this._createStyle(b,f,d,!0);else{var a=this;j(["text!"+f],function(e){a._createStyle(b,e,d,!1)})}else d()}};i.EventTarget.addMixin(d.prototype);return{TextTheme:d}});
define("orion/widgets/themes/ThemeClass",[],function(){function j(i){this.attributes=[];this.element=document.createElement("div");this.style=this.element.style;this.className=i;this.classString="."+i+"{ "}j.prototype.className=null;j.prototype.classString=void 0;j.prototype.style=void 0;j.prototype.closeString=" }\n";j.prototype.toString=function(){return this.classString=this.classString+this.style.cssText+this.closeString};return{ThemeClass:j}});
define("orion/widgets/themes/container/ThemeSheetWriter",["orion/widgets/themes/ThemeClass"],function(j){function i(){}i.prototype.navbar="white";i.prototype.button="#777777";i.prototype.location="#EFEFEF";i.prototype.selection="#cedce7";i.prototype.sidepanel="#F7F7F7";i.prototype.mainpanel="white";i.prototype.navtext="#bfbfbf";i.prototype.content="#3087B3";i.prototype.search="#444";i.prototype.toolpanel="white";i.prototype.writeNavigationStyle=function(){var g="",d=[],b=new j.ThemeClass("orionPage");
b.style.backgroundColor="#fdfdfd";b.style.width="100%";b.style.height="100%";d.push(b);b=new j.ThemeClass("topRowBanner");b.style.margin="0";b.style.border="0";b.style.backgroundColor=this.navbar;b.style.height="16px";b.style.padding="10px";b.style.paddingLeft="6px";b.style.paddingRight="2px";b.style.borderBottom="none";b.style.boxShadow="0 2px 2px 0 rgba(0, 0, 0, 0.1),0 1px 0 0 rgba(0, 0, 0, 0.1)";b.style.zIndex="100";d.push(b);b=new j.ThemeClass("a");b.style.textDecoration="none";b.style.color=
this.content;d.push(b);b=new j.ThemeClass("navlink");b.style.display="inline-block";b.style.padding="2px";b.style.color=this.content;b.style.verticalAlign="bottom";d.push(b);b=new j.ThemeClass("primaryNav");b.style.color=this.navtext;b.style.fontSize="8pt";b.style.fontWeight="normal";b.style.paddingTop="0";b.style.verticalAlign="baseline";d.push(b);b=new j.ThemeClass("primaryNav a");b.style.fontSize="8pt";b.style.color=this.navtext;b.style.marginRight="6px";b.style.marginLeft="6px";b.style.verticalAlign=
"baseline";b.style.textDecoration="none";d.push(b);b=new j.ThemeClass("primaryNav a:hover");b.style.color="#bfbfbf";b.style.cursor="hand";b.style.color="white";b.style.fontWeight="normal";d.push(b);for(var i in d)g+=d[i].toString();return g};i.prototype.writeLocationStyle=function(){var g="",d=[],b=new j.ThemeClass("titleArea");b.style.margin="0";b.style.paddingTop="5px";b.style.border="0";b.style.background=this.location;b.style.background="-webkit-gradient(linear, left top, left bottom, color-stop(0%,"+
this.location+"), color-stop(100%,"+this.location+"))";b.style.borderBottom="1px solid "+this.location;b.style.minHeight="20px";d.push(b);b=new j.ThemeClass("breadcrumb");b.style.fontSize="8pt";b.style.textDecoration="none";b.style.color="#f1f1f2;";b.style.paddingTop="2px";d.push(b);b=new j.ThemeClass("a.breadcrumb:hover");b.style.textDecoration="none";b.style.borderBottom="1px dotted";b.style.color="#F58B0F";b.style.cursor="pointer";d.push(b);b=new j.ThemeClass("breadcrumbSeparator");b.style.fontSize=
"8pt";b.style.textDecoration="none";b.style.color=this.separator;b.style.fontWeight="bold";d.push(b);b=new j.ThemeClass("currentLocation");b.style.fontWeight="bold";b.style.fontSize="8pt";b.style.color=this.breadcrumb;b.style.textDecoration="none";b.style.textWrap="normal";b.style.lineHeight="10pt";d.push(b);b=new j.ThemeClass("a.currentLocation:hover");b.style.fontWeight="bold";b.style.fontSize="10pt";b.style.color="#666666";b.style.textDecoration="none";b.style.borderBottom="0";d.push(b);b=new j.ThemeClass("navlinkonpage");
b.style.color=this.content;b.style.verticalAlign="middle";d.push(b);if(this.bannerProgress)b=new j.ThemeClass("topRowBanner .progressPane_running"),b.style.borderColor=this.bannerProgress,d.push(b);for(var i in d)g+=d[i].toString();return g};i.prototype.writeButtonStyle=function(){var g="",d=[],b=new j.ThemeClass("commandButton");b.style.color="#666";b.style.border="1px solid #dedede";b.style.backgroundColor="#ddd";b.style.textAlign="center";b.style.verticalAlign="middle";b.style.cursor="pointer";
b.style.display="inline-block";b.style.padding="4px 6px";b.style.borderRadius="3px";b.style.lineHeight="12px";b.style.fontSize="9pt";b.style.userSelect="none";d.push(b);b=new j.ThemeClass("commandButton:over");b.style.backgroundColor="#e6e6e6";b.style.border="1px solid #808080";d.push(b);b=new j.ThemeClass("commandMenu");b.style.color="#222";b.style.display="inline-block";b.style.verticalAlign="baseline";b.style.margin="0";b.style.fontSize="8pt";b.style.fontWeight="normal";b.style.border="1px solid #dedede";
b.style.backgroundColor="#efefef";b.style.cursor="pointer";b.style.borderRadius="1px";d.push(b);b=new j.ThemeClass("commandMenuItem");b.style.border="0";b.style.padding="0";b.style.margin="0";d.push(b);for(var i in d)g+=d[i].toString();return g};i.prototype.writeMainStyle=function(){var g="",d=[],b=new j.ThemeClass("searchbox");b.style.backgroundImage="url(../images/core_sprites.png)";b.style.backgroundRepeat="no-repeat";b.style.backgroundPosition="4px -297px";b.style.width="12px";b.style.height=
"12px";b.style.backgroundColor=this.search;b.style.border="1px solid "+this.search;b.style.fontSize="11px";b.style.width="15em";b.style.height="16px";b.style.borderRadius="10px";b.style.color="#999";b.style.padding="0";b.style.paddingLeft="20px";b.style.marginLeft="5px";b.style.marginTop="6px !important";b.style.font="7pt Lucida Sans Unicode,Lucida Grande,Verdana,Arial,Helvetica,Myriad,Tahoma,clean,sans-serif !important";d.push(b);b=new j.ThemeClass("searchbox:focus");b.style.color="white";b.style.outline=
"none";d.push(b);b=new j.ThemeClass("checkedRow");b.style.cssText="background-color:"+this.selection+" !important;";d.push(b);b=new j.ThemeClass("navbar-item-selected");b.style.background=this.selection;b.style.color=this.content;d.push(b);b=new j.ThemeClass("auxpane");b.style.border="0";b.style.background=this.sidepanel;d.push(b);b=new j.ThemeClass("mainpane");b.style.background=this.mainpanel;b.style.border=0;d.push(b);b=new j.ThemeClass("mainToolbar");b.style.background=this.toolpanel;d.push(b);
for(var i in d)g+=d[i].toString();return g};i.prototype.render=function(){console.log(this.writeNavigationStyle());console.log(this.writeLocationStyle());console.log(this.writeMainStyle());console.log(this.writeButtonStyle())};i.prototype.getSheet=function(g){g.navbar.value?(this.navbar=g.navbar.value,this.button=g.button.value,this.location=g.location.value,this.selection=g.selection.value,this.sidepanel=g.sidepanel.value,this.mainpanel=g.mainpanel.value,this.navtext=g.navtext.value,this.search=
g.search.value,this.content=g.content.value,this.toolpanel=g.toolpanel.value,this.bannerProgress=g.bannerProgress.value):(this.navbar=g.navbar,this.button=g.button,this.location=g.location,this.selection=g.selection,this.sidepanel=g.sidepanel,this.mainpanel=g.mainpanel,this.navtext=g.navtext,this.search=g.search,this.content=g.content,this.toolpanel=g.toolpanel,this.bannerProgress=g.bannerProgress);return this.writeNavigationStyle()+this.writeLocationStyle()+this.writeMainStyle()+this.writeButtonStyle()};
return{ThemeSheetWriter:i}});
define("orion/widgets/themes/container/ThemeData",["i18n!orion/settings/nls/messages","orion/editor/textTheme","orion/widgets/themes/container/ThemeSheetWriter"],function(j,i,g){function d(){}function b(){this.styles=[];var b=new d;b.name="Orion";b.navbar="white";b.button="#EFEFEF";b.location="#efefef";b.selection="FEC";b.sidepanel="#FBFBFB";b.mainpanel="white";b.toolpanel="white";b.navtext="#bfbfbf";b.content="#3087B3";b.search="#444";b.breadcrumb="#3087B3";b.separator="#333";b.bannerProgress="whitesmoke";
this.styles.push(b);b=new d;b.name="Orion2014";b.navbar="white";b.button="#EFEFEF";b.location="#EFEFEF";b.selection="FEC";b.sidepanel="#EEEEEE";b.mainpanel="#EEEEEE";b.toolpanel="#EEEEEE";b.navtext="#BFBFBF";b.content="#333333";b.search="#444444";b.breadcrumb="#333333";b.separator="#333333";b.bannerProgress="orange";this.styles.push(b);b=new d;b.name="Green Zone";b.navbar="seagreen";b.button="lavender";b.location="darkseagreen";b.selection="moccasin";b.sidepanel="aliceblue";b.mainpanel="white";b.toolpanel=
"white";b.navtext="#FBFBFB";b.content="darkgreen";b.search="darkgreen";b.breadcrumb="#3087B3";b.separator="seagreen";b.bannerProgress="#F2F2F2";this.styles.push(b);b=new d;b.name="Pretty In Pink";b.navbar="plum";b.button="lavender";b.location="pink";b.selection="lavender";b.sidepanel="seashell";b.mainpanel="white";b.toolpanel="white";b.navtext="#FBFBFB";b.content="mediumorchid";b.search="violet";b.breadcrumb="#3087B3";b.separator="plum";b.bannerProgress="#F2F2F2";this.styles.push(b);b=new d;b.name=
"Blue Monday";b.navbar="cornflowerblue";b.button="lavender";b.location="skyblue";b.selection="lavender";b.sidepanel="aliceblue";b.mainpanel="white";b.toolpanel="white";b.navtext="#FBFBFB";b.content="royalblue";b.search="royalblue";b.breadcrumb="#3087B3";b.separator="cornflowerblue";b.bannerProgress="#F2F2F2";this.styles.push(b);b=new d;b.name="Vanilla Skies";b.navbar="sandybrown";b.button="lemmonchiffon";b.location="cornsilk";b.selection="lemonchiffon";b.sidepanel="white";b.mainpanel="white";b.toolpanel=
"white";b.navtext="lemonchiffon";b.content="chocolate";b.search="moccasin";b.breadcrumb="#3087B3";b.separator="sandybrown";b.bannerProgress="#F2F2F2";this.styles.push(b);b=new d;b.name="Beetlejuice";b.navbar="indigo";b.button="slateblue";b.location="darkslateblue";b.selection="silver";b.sidepanel="lavender";b.mainpanel="white";b.toolpanel="white";b.navtext="#FBFBFB";b.content="mediumslateblue";b.search="#444";b.breadcrumb="#3087B3";b.separator="indigo";b.bannerProgress="#F2F2F2";this.styles.push(b);
b=new d;b.name="Red";b.navbar="#CD2127";b.button="#777777";b.location="#D85F56";b.selection="lightcoral";b.sidepanel="#EFDAB2";b.mainpanel="#FDFADD";b.toolpanel="#FDFADD";b.navtext="#FBFBFB";b.content="darkred";b.search="#D85F56";b.breadcrumb="darkred";b.separator="#CD2127";b.bannerProgress="#F2F2F2";this.styles.push(b)}function k(){return this.styles}d.prototype.name="Orion";d.prototype.navbar="#404648";d.prototype.button="#EFEFEF";d.prototype.location="#333";d.prototype.breadcrumb="#3087B3";d.prototype.separator=
"#333";d.prototype.selection="FEC";d.prototype.sidepanel="#FBFBFB";d.prototype.mainpanel="white";d.prototype.toolpanel="white";d.prototype.navtext="#bfbfbf";d.prototype.content="#3087B3";d.prototype.search="#444";d.prototype.bannerProgress="white";b.prototype.styles=[];b.prototype.getStyles=k;b.prototype.getThemeStorageInfo=function(){return{storage:"/themes",styleset:"styles",defaultTheme:"Orion2014",selectedKey:"selected",version:"5.0"}};b.prototype.getViewData=function(){var b={top:10,left:10,
width:350,height:350};b.shapes=[{type:"RECTANGLE",name:j["Navigation Bar"],x:10,y:10,width:350,height:32,family:"navbar",fill:"#333",order:1},{type:"TEXT",name:j["Navigation Text"],label:"UserName",x:290,y:30,family:"navtext",fill:"#bfbfbf",font:"8pt sans-serif"},{type:"ROUNDRECTANGLE",name:j["Search Box"],x:215,y:20,width:70,height:12,family:"search",fill:"#444",order:3},{type:"RECTANGLE",name:j["Tool Panel"],x:150,y:71,width:209,height:30,family:"toolpanel",fill:"white",order:4},{type:"RECTANGLE",
name:j["Selection Bar"],x:155,y:133,width:200,height:20,family:"selection",fill:"#FEC",order:7},{type:"RECTANGLE",name:j.Location,x:10,y:42,width:350,height:29,family:"location",fill:"#efefef",order:8},{type:"TEXT",name:j["Navigation Text"],label:"Navigator",x:60,y:30,family:"navtext",fill:"#bfbfbf",font:"8pt sans-serif",order:2},{type:"TEXT",name:j.Content,label:"Breadcrumb",x:15,y:60,family:"content",fill:"#3087B3",font:"8pt sans-serif"},{type:"TEXT",name:j.Content,label:"/",x:78,y:60,family:"content",
fill:"#3087B3",font:"8pt sans-serif",order:9},{type:"TEXT",name:j.Content,label:"Location",x:84,y:60,family:"content",fill:"#3087B3",font:"8pt sans-serif"},{type:"RECTANGLE",name:j["Main Panel"],x:150,y:101,width:209,height:258,family:"mainpanel",fill:"white",order:6},{type:"ROUNDRECTANGLE",name:j.Button,x:155,y:76,width:37,height:20,family:"button",fill:"#EFEFEF",order:11},{type:"TEXT",name:j["Button Text"],label:"Button",x:158,y:90,family:"navbar",fill:"#333",font:"8pt sans-serif"},{type:"TRIANGLE",
name:"userMenu",x1:353,y1:24,x2:347,y2:24,x3:350,y3:29,family:"userMenu",fill:"#BFBFBF"},{type:"TRIANGLE",name:"userMenu",x1:20,y1:88,x2:26,y2:88,x3:23,y3:93,family:"userMenu",fill:"#BFBFBF"},{type:"TEXT",name:j["Section Text"],label:"Section",x:30,y:94,family:"navbar",fill:"#333",font:"8pt sans-serif"},{type:"LINE",name:j["Line Color"],x1:150,y1:101,x2:360,y2:101,linewidth:2,fill:"#DEDEDE"},{type:"LINE",name:j["Line Color"],x1:150,y1:71,x2:150,y2:360,linewidth:2,fill:"#DEDEDE"},{type:"LINE",name:j["Line Color"],
x1:20,y1:100,x2:140,y2:100,linewidth:2,fill:"#DEDEDE"},{type:"RECTANGLE",name:j["Side Panel"],x:10,y:71,width:140,height:289,family:"sidepanel",fill:"#FBFBFB",order:12},{type:"TRIANGLE",name:"userMenu",x1:353,y1:24,x2:347,y2:24,x3:350,y3:29,family:"userMenu",fill:"#BFBFBF"},{type:"TRIANGLE",name:"userMenu",x1:20,y1:88,x2:26,y2:88,x3:23,y3:93,family:"userMenu",fill:"#BFBFBF"},{type:"TEXT",name:j["Navigation Text"],label:"Navigator",x:60,y:30,family:"navtext",fill:"#bfbfbf",font:"8pt sans-serif",order:2},
{type:"TRIANGLE",name:"userMenu",x1:353,y1:24,x2:347,y2:24,x3:350,y3:29,family:"userMenu",fill:"#BFBFBF"},{type:"TRIANGLE",name:"userMenu",x1:20,y1:88,x2:26,y2:88,x3:23,y3:93,family:"userMenu",fill:"#BFBFBF"}];for(var d=0;d<3;d++)b.shapes.push({type:"TEXT",name:j.Content,label:"org.eclipse.orion.content",x:170,y:127+20*d,fill:"#3087B3",family:"content"});for(d=0;d<3;d++)b.shapes.push({type:"TEXT",name:j.Content,label:"Item",x:25,y:115+20*d,fill:"#3087B3",family:"content"});for(d=0;d<3;d++)b.shapes.push({type:"TRIANGLE",
name:"twisty",x1:160,y1:121+d*20,x2:165,y2:124+d*20,x3:160,y3:127+d*20,family:"navbar",fill:"#333"});b.shapes.push({type:"IMAGE",name:"logo",x:15,y:18,source:"../../images/orion-transparent.png",family:"logo"});return b};b.prototype.processSettings=function(b){var d=new g.ThemeSheetWriter;(new i.TextTheme.getTheme("orionTheme")).setThemeClass("orionTheme",d.getSheet(b))};return{ThemeData:b,getStyles:k}});
define("orion/widgets/nls/root/messages",{"no input":"no input","no output":"no output","Choose a Folder":"Choose a Folder",OK:"OK",Profile:"Profile","Sign out":"Sign out","N/A":"N/A","logged in since ":"logged in since ","Sign in":"Sign in","Authentication required!":"Authentication required!","Name:":"Name:","Plug-ins":"Plug-ins"," <No available services or timed out, check URL and try reloading>":" <No available services or timed out, check URL and try reloading>",Properties:"Properties"," (Service Id: ":" (Service Id: ",
Services:"Services","SFTP Transfer":"SFTP Transfer","Remote host:":"Remote host:","Port:":"SFTP Port:","Remote path:":"Remote path:","User name:":"User name:","Password:":"Password:","Start Transfer":"Start Transfer","Location:":"Location:","orion.sftpConnections":"orion.sftpConnections","Drag a file here":"Drag a file here","unzip zips":"Unzip *.zip files","or if you prefer":"(or upload a file using the buttons below)",Upload:"Upload","Browse...":"Browse...","Import a file or zip":"Import a file or zip",
"Missing required argument: searchRenderer":"Missing required argument: searchRenderer","Missing required argument: favService":"Missing required argument: favService","Find File Named":"Find File Named","Type the name of a file to open (? = any character, * = any string):":"Type the name of a file to open (? = any character, * = any string):",Search:"Search","FileName FolderName":"FileName FolderName(Optional)","Searching...":"Searching...","Searching for occurrences of":'Searching for occurrences of: "${0}"',
name:"name","orion.widgets.UserMenu":"orion.widgets.UserMenu",test:"test","Sign Out":"Sign Out","Sign Out ":"Sign Out ","</a>":"</a>",">":">","Sign In To ":"Sign In To ","Sign In":"Sign In",Help:"Help","Report a Bug":"Report a Bug","Keyboard Shortcuts":"Keyboard Shortcuts",Settings:"Settings","View profile of ":"View profile of ",Profiles:"Profiles","Information Needed":"Information Needed",Cancel:"Cancel","If the same file exists in both the source and destination:":"If the same file exists in both the source and destination:",
"Cancel the transfer":"Cancel the transfer","Always overwrite destination":"Always overwrite destination","Overwrite if source is newer":"Overwrite if source is newer",New:"New","Building file skeleton...":"Building file skeleton...",Add:"Add","Upload...":"Upload...","For a list of available commands type '${0}'.":"For a list of available commands type '${0}'.","Main Pages":"Main Pages","Related Links":"Related Links"});
define("orion/widgets/nls/messages",["orion/i18n!orion/widgets/nls/messages","orion/widgets/nls/root/messages"],function(j,i){var g={root:i};Object.keys(j).forEach(function(d){typeof g[d]==="undefined"&&(g[d]=j[d])});return g});
define("orion/widgets/userAssistance/UATaskPanel",["orion/webui/littlelib"],function(j){function i(g,d,b){this.elements=b;this.taskPanel=document.createElement("div");this.taskPanel.className="UAContainer";this.taskPanel.innerHTML='<header class="UAHeader">Develop software from within the cloud</header>';this.elementNode=document.createElement("div");this.switchesContainer=document.createElement("div");this.switches=document.createElement("span");this.radioButtons=[];this.elementNode.className="UAContainer-body";
this.taskPanel.appendChild(this.elementNode);this.switchesContainer.className="UAContainer-switch-body";this.switches.className="UAContainer-switches";this.switchesContainer.innerHTML="";this.switchesContainer.appendChild(this.switches);this.taskPanel.appendChild(this.switchesContainer);d===!0?(this.container=document.createElement("div"),this.container.className="UAModal",this.container.appendChild(this.taskPanel),this.backdrop=document.createElement("div"),this.backdrop.className="UAModalBackground",
document.body.appendChild(this.backdrop),document.body.appendChild(this.container),j.addAutoDismiss([this.container],this.destroy.bind(this))):g.appendChild(this.taskPanel);this.chosenSwitch=this.createSwitch(null,!0);this.chosenSwitch.firstChild.className="chosenCircle";this.initialize();this.elements.forEach(this.createSwitch.bind(this))}i.prototype.elementNode=null;i.prototype.switchesContainer=null;i.prototype.switches=null;i.prototype.radioButtons=null;i.prototype.chosenSwitch=null;i.prototype.addElement=
function(g){var d=document.createElement("span");d.className="UAContainer-icon";d.innerHTML='<span class="workingSpan"><img src="'+g.image+'" id="'+g.label+'ImageNode" alt="'+g.alt+'" height="64" width="64"></span><span class="UAIcon-label"><span class="UALabel" id="'+g.label+'LabelNode" >'+g.label+"</span></span>";d.onmouseover=function(){document.getElementById(g.label+"ImageNode").src=g.secondaryImage;document.getElementById(g.label+"LabelNode").className="UALabel-live";d.className="UAContainer-icon-live"};
d.onmouseout=function(){document.getElementById(g.label+"ImageNode").src=g.image;document.getElementById(g.label+"LabelNode").className="UALabel";d.className="UAContainer-icon"};var b=this;d.onclick=function(){b.showMedia(g)};this.elementNode.appendChild(d)};i.prototype.clearElements=function(){this.elementNode.innerHTML=""};i.prototype.showMedia=function(g){this.clearElements();this.addElement(g);var d=document.createElement("span");d.className="UAContainer-media";d.innerHTML='<div></div><div></div><span class="mediaSpan"><img src="'+
g.media+'" alt="'+g.alt+'" height="300" width="400"></span>';this.elementNode.appendChild(d);setTimeout(function(){d.style.opacity=1},100);g=document.getElementById(g.label+"switch");this.chosenSwitch.firstChild.className="circle";this.chosenSwitch=g.parentNode;g.className="chosenCircle"};i.prototype.createSwitch=function(g){var d;d=g?g.label+"switch":"indexSwitch";var b=document.createElement("span");b.className="workingSpan";b.innerHTML='<div class="circle" id ="'+d+'"></div>';var i=this;b.onclick=
g?function(){i.showMedia(g)}:function(){i.initialize();i.chosenSwitch.firstChild.className="circle";i.chosenSwitch=b;i.chosenSwitch.firstChild.className="chosenCircle"};this.switches.appendChild(b);return this.radioButtons[this.radioButtons.length]=b};i.prototype.initialize=function(){this.clearElements();this.elements.forEach(this.addElement.bind(this))};i.prototype.destroy=function(){document.body.removeChild(this.backdrop);document.body.removeChild(this.container)};return i});
define("orion/webui/dialog",["i18n!orion/widgets/nls/messages","require","orion/webui/littlelib","orion/uiUtils"],function(j,i,g,d){function b(){}var k=null;b.prototype={DISABLED:"disabled",CONTAINERTEMPLATE:'<div class="dialog" role="dialog"><div class="dialogTitle"><span id="title" class="dialogTitleText layoutLeft"></span><button aria-label="Close" class="dismissButton layoutRight core-sprite-close imageSprite" id="closeDialog"></button></div><div id="dialogContent" class="dialogContent layoutBlock"></div><div id="buttons" class="dialogButtons"></div></div>',
_initialize:function(){var b=document.body;this.$frameParent=b;this.$$modalExclusions=this.$$modalExclusions||[];var d=document.createRange();d.selectNode(b);d=d.createContextualFragment(this.CONTAINERTEMPLATE);b.appendChild(d);this.$frame=b.lastChild;this.title&&g.$("#title",this.$frame).appendChild(document.createTextNode(this.title));this.$close=g.$("#closeDialog",this.$frame);var a=this;this.$close.addEventListener("click",function(){a.hide()},!1);this.$parent=g.$(".dialogContent",this.$frame);
d=document.createRange();d.selectNode(this.$parent);b=d.createContextualFragment(this.TEMPLATE);this.messages&&g.processTextNodes(b,this.messages);this.$parent.appendChild(b);this.$buttonContainer=g.$(".dialogButtons",this.$frame);this._makeButtons();this.$frame.addEventListener("keydown",function(b){b.keyCode===g.KEY.ESCAPE?a.hide():b.keyCode===g.KEY.ENTER&&typeof a._defaultCallback==="function"&&a._defaultCallback()},!1);this._bindElements(this.$parent);typeof this._bindToDom==="function"&&this._bindToDom(this.$parent);
this.modal&&this._makeModal()},_makeButtons:function(){if(this.$buttonContainer&&Array.isArray(this.buttons)){var b=this;this.buttons.forEach(function(h){var a=d.createButton(h.text,h.callback);if(h.id)a.id=h.id,b["$"+a.id]=a;if(h.isDefault)b._defaultCallback=h.callback,b._defaultButton=a;b.$buttonContainer.appendChild(a)})}},_makeModal:function(){var b=this;this.$frame.addEventListener("blur",function(a){b.$lastFocusedElement=a.target},!0);this._modalListener=function(a){var c=!g.contains(b.$frame,
a.target);if(c)for(var e=0;e<b.$$modalExclusions.length;e++)if(g.contains(b.$$modalExclusions[e],a.target)){c=!1;break}c&&(window.setTimeout(function(){(b.$lastFocusedElement||b.$parent).focus()},0),g.stop(a))};this.$frameParent.addEventListener("focus",this._modalListener,!0);this.$frameParent.addEventListener("click",this._modalListener,!0);var d=this.$frameParent.childNodes,a=!1;this._addedBackdrop=[];for(var e=0;e<d.length;e++){for(var c=0;c<this.$$modalExclusions.length;c++)if(g.contains(this.$$modalExclusions[c],
d[e])){a=!0;break}!a&&d[e]!==b.$frame&&d[e].classList&&!d[e].classList.contains("tooltipContainer")&&(c=d[e],c.classList.contains("modalBackdrop")||(c.classList.add("modalBackdrop"),this._addedBackdrop.push(c)))}(d=g.lastTabbable(this.$buttonContainer)||g.lastTabbable(this.$parent))&&d.addEventListener("keydown",function(a){if(a.keyCode===g.KEY.TAB){var c=b._getFirstFocusField();c&&c!==a.target&&c.focus();g.stop(a)}},!1)},_addChildDialog:function(b){this.$$modalExclusions.push(b.$frame||b.$parent)},
_inModalExclusion:function(b){return this.$$modalExclusions.some(function(d){return b.$frame===d||b.$parent===d})},_bindElements:function(b){for(var d=0;d<b.childNodes.length;d++){var a=b.childNodes[d];a.id&&(this["$"+a.id]=a);this._bindElements(a)}},hide:function(b){!b&&k===this&&(k=null);typeof this._beforeHiding==="function"&&this._beforeHiding();this._modalListener&&(this.$frameParent.removeEventListener("focus",this._modalListener,!0),this.$frameParent.removeEventListener("click",this._modalListener,
!0));this.$frame.classList.remove("dialogShowing");g.setFramesEnabled(!0);typeof this._afterHiding==="function"&&this._afterHiding();var d=this;this.keepAlive||window.setTimeout(function(){d.destroy()},0)},show:function(b){if(this.modal)if(k){if(!k._inModalExclusion(this)){this.hide(!0);return}}else k=this;typeof this._beforeShowing==="function"&&this._beforeShowing();g.setFramesEnabled(!1);var d=g.bounds(this.$frame),a=g.bounds(document.documentElement),e;b?(e=g.bounds(b),b=e.top+e.height+4,e=e.left+
4,b+d.height>a.height&&(b=Math.max(0,a.height-d.height-4)),e+d.width>a.width&&(e=Math.max(0,a.width-d.width-4))):(e=Math.max(0,(a.width-d.width)/2),b=Math.max(0,(a.height-d.height)/2));this.$lastFocusedElement=document.activeElement;this.$frame.style.top=b+"px";this.$frame.style.left=e+"px";this.$frame.classList.add("dialogShowing");typeof this._afterShowing==="function"&&this._afterShowing();this.customFocus||this._getFirstFocusField().focus()},_getFirstFocusField:function(){return g.firstTabbable(this.$parent)||
this._defaultButton||g.firstTabbable(this.$buttonContainer)||this.$close},destroy:function(){if(this.$frame)k===this&&(k=null),g.setFramesEnabled(!0),this._addedBackdrop&&this._addedBackdrop.length>0&&this._addedBackdrop.forEach(function(b){b.classList.remove("modalBackdrop")}),this.$frameParent.removeEventListener("focus",this._modalListener,!0),this.$frameParent.removeEventListener("click",this._modalListener,!0),this.$frameParent.removeChild(this.$frame),this.$parent=this.$frame=void 0}};b.prototype.constructor=
b;return{Dialog:b}});
define("orion/widgets/UserMenu","i18n!orion/widgets/nls/messages,require,orion/webui/littlelib,orion/PageLinks,orion/widgets/userAssistance/UATaskPanel,orion/webui/dialog".split(","),function(j,i,g,d,b){function k(b){this._displaySignOut=!0;this._init(b)}k.prototype={_init:function(b){this._dropdownNode=g.node(b.dropdownNode);if(!this._dropdownNode)throw"no dom node for dropdown found";this._dropdown=b.dropdown;this._serviceRegistry=b.serviceRegistry;this.authenticatedServices={};this.unauthenticatedServices=
{};this._noSeparator=b.noSeparator;this._dropDownItemClass=b.dropDownItemClass;this._keyAssistClass=b.keyAssistClass;if(b.signOut!==void 0)this._displaySignOut=b.signOut},isSingleService:function(){return this.length(this.unauthenticatedServices)+this.length(this.authenticatedServices)===1},hasServices:function(){return this.length(this.unauthenticatedServices)+this.length(this.authenticatedServices)>0},length:function(b){var d=0,a;for(a in b)b.hasOwnProperty(a)&&d++;return d},_makeMenuItem:function(b,
d){var a=document.createElement("span");a.role="menuitem";a.tabIndex=0;var e=document.createTextNode(b);a.appendChild(e);typeof this._dropDownItemClass==="string"?this._dropDownItemClass!==""&&a.classList.add(this._dropDownItemClass):a.classList.add("dropdownMenuItem");a.addEventListener("click",d,!1);a.addEventListener("keydown",function(a){(a.keyCode===g.KEY.ENTER||a.keyCode===g.KEY.SPACE)&&d()},!1);return a},_renderAuthenticatedService:function(b){var d=this,a=this.authenticatedServices[b].authService;
if(a&&a.logout&&this._displaySignOut){var e=document.createElement("li"),c=this._makeMenuItem(j["Sign Out"],function(){a.logout().then(function(){d.addUserItem(b,a,d.authenticatedServices[b].label);localStorage.removeItem(b);localStorage.removeItem("lastLogin");for(var c=localStorage.length-1;c>=0;c--){var e=localStorage.key(c);e&&e.indexOf("/orion/preferences/user")===0&&localStorage.removeItem(e)}a.getAuthForm(window.location.href).then(function(a){window.location=a})})});e.appendChild(c);this._dropdownNode.appendChild(e)}},
renderServices:function(){function b(c){a[c]||(a[c]=h.createDocumentFragment());return a[c]}var h=document,a=[],e=this._serviceRegistry;d.getPageLinksInfo(e,"orion.page.link.user").then(function(c){this._dropdown?this._dropdown.empty():this._dropdownNode&&g.empty(this._dropdownNode);c.getAllLinks().forEach(function(a){var c,e;if(a.category&&(e=/user\.(\d+)/.exec(a.category)))c=parseInt(e[1],10);if(typeof c!=="number"||isNaN(c))c=1;c=b(c);e=h.createElement("li");var d=h.createElement("a");d.role="menuitem";
typeof this._dropDownItemClass==="string"?this._dropDownItemClass!==""&&d.classList.add(this._dropDownItemClass):d.classList.add("dropdownMenuItem");d.href=a.href;d.textContent=a.textContent;e.appendChild(d);c.appendChild(e);d.addEventListener("keydown",function(a){(a.keyCode===g.KEY.ENTER||a.keyCode===g.KEY.SPACE)&&d.click()},!1)}.bind(this));if(this.keyAssistFunction){var c=document.createElement("li"),d=this._makeMenuItem(j["Keyboard Shortcuts"],this.keyAssistFunction);typeof this._keyAssistClass===
"string"?this._keyAssistClass!==""&&d.classList.add(this._keyAssistClass):d.classList.add("key-assist-menuitem");c.appendChild(d);b(0).appendChild(c)}if(c=e.getServiceReferences("orion.page.getstarted")[0])d=c.getProperty("data"),c=document.createElement("li"),d=this._makeMenuItem("Getting Started",this.getStartedDialog.bind(this,d)),c.appendChild(d),b(0).appendChild(c);var i=this;a.sort(function(a,b){return a-b}).forEach(function(b,c){if(c<a.length-1&&!this._noSeparator){var e=document.createElement("li");
e.classList.add("dropdownSeparator");var d=document.createElement("span");d.classList.add("dropdownSeparator");e.appendChild(d);b.appendChild(e)}i._dropdownNode.appendChild(b)}.bind(this));if(this.isSingleService())for(var k in this.authenticatedServices)this.authenticatedServices.hasOwnProperty(k)&&this._renderAuthenticatedService(k,0)}.bind(this))},getStartedDialog:function(d){new b(null,!0,d)},setKeyAssist:function(b){this.keyAssistFunction=b;this.renderServices()},addUserItem:function(b,d,a,e){e?
(this.unauthenticatedServices[b]&&delete this.unauthenticatedServices[b],this.authenticatedServices[b]={authService:d,label:a,data:e}):(this.authenticatedServices[b]&&delete this.authenticatedServices[b],this.unauthenticatedServices[b]=this.unauthenticatedServices[b]?{authService:d,label:a,pending:this.unauthenticatedServices[b].pending}:{authService:d,label:a});this.renderServices()}};k.prototype.constructor=k;return{UserMenu:k}});
define("orion/webui/dialogs/OpenResourceDialog","i18n!orion/widgets/nls/messages,orion/crawler/searchCrawler,orion/contentTypes,require,orion/webui/littlelib,orion/util,orion/webui/dialog".split(","),function(j,i,g,d,b,k,f){function h(a){this._init(a)}h.prototype=new f.Dialog;h.prototype.TEMPLATE='<div role="search"><div><label id="fileNameMessage" for="fileName">${Type the name of a file to open (? = any character, * = any string):}</label></div><div><input id="fileName" type="text" class="setting-control" style="width:90%;"/></div><div id="progress" style="padding: 2px 0 0; width: 100%;"><img src="'+
d.toUrl("../../../images/progress_running.gif")+'" class="progressPane_running_dialog" id="crawlingProgress"></img></div><div id="results" style="max-height:250px; height:auto; overflow-y:auto;" aria-live="off"></div><div id="statusbar"></div></div>';h.prototype._init=function(a){this.title=a.title||j["Find File Named"];this.modal=!0;this.messages=j;this._searcher=a.searcher;this._progress=a.progress;this._onHide=a.onHide;this._contentTypeService=new g.ContentTypeRegistry(this._searcher.registry);
if(!this._searcher)throw Error("Missing required argument: searcher");this._searchDelay=a.searchDelay||500;this._time=0;this._searcher.setCrawler(null);this._forceUseCrawler=!1;this._initialText=a.initialText;this._message=a.message;this._nameSearch=!0;if(a.nameSearch!==void 0)this._nameSearch=a.nameSearch;this._searchOnRoot=!0;this._fileService=this._searcher.getFileService();if(!this._fileService)throw Error(j["Missing required argument: fileService"]);this._searchRenderer=a.searchRenderer;if(!this._searchRenderer||
typeof this._searchRenderer.makeRenderFunction!=="function")throw Error(j["Missing required argument: searchRenderer"]);this._initialize()};h.prototype._bindToDom=function(a){var e=this;e.$crawlingProgress.style.display="none";this._nameSearch?this.$fileName.setAttribute("placeholder",j["FileName FolderName"]):this.$fileName.setAttribute("placeholder",j.Search);this.$fileName.addEventListener("input",function(){e._time=+new Date;e._timeoutId&&clearTimeout(e._timeoutId);e._timeoutId=setTimeout(e.checkSearch.bind(e),
0)},!1);this.$fileName.addEventListener("keydown",function(a){if(a.keyCode===b.KEY.ENTER){var d=b.$("a",e.$results);if(d)b.stop(a),(k.isMac?a.metaKey:a.ctrlKey)?window.open(d.href):(window.location.href=d.href,e.hide())}},!1);a.addEventListener("keydown",function(a){var d,f,h;if(a.keyCode===b.KEY.DOWN||a.keyCode===b.KEY.UP)d=b.$$array("a",e.$results),f=document.activeElement,h=d.indexOf(f),a.keyCode===b.KEY.DOWN?h>=0?(f.classList.remove("treeIterationCursor"),d=h<d.length-1?d[h+1]:d[0],d.focus(),
d.classList.add("treeIterationCursor")):d.length>0&&(d=-1<d.length-1?d[0]:d[0],d.focus(),d.classList.add("treeIterationCursor")):h>=0?(f.classList.remove("treeIterationCursor"),f=e.$fileName,d=h>0?d[h-1]:f,d.focus(),h>0&&d.classList.add("treeIterationCursor")):d.length>0&&(d[d.length-1].focus(),d[d.length-1].classList.add("treeIterationCursor")),b.stop(a)});a.addEventListener("mouseup",function(a){a.target.focus()},!1);setTimeout(function(){if(e._forceUseCrawler||!e._fileService.getService(e._searcher.getSearchLocation()).search){var a=
e._searchOnRoot?e._searcher.getSearchRootLocation():e._searcher.getChildrenLocation(),a=new i.SearchCrawler(e._searcher.registry,e._fileService,"",{searchOnName:!0,location:a});e._searcher.setCrawler(a);a.buildSkeleton(function(){e.$crawlingProgress.style.display="inline";e.$progress.appendChild(document.createTextNode(j["Building file skeleton..."]))},function(){e.$crawlingProgress.style.display="none";e.$progress.removeChild(e.$progress.lastChild)})}},0);this._message&&(this.$fileNameMessage.removeChild(this.$fileNameMessage.firstChild),
this.$fileNameMessage.appendChild(document.createTextNode(this._message)));if(this._initialText)this.$fileName.value=this._initialText,this.doSearch()};h.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)};h.prototype._detectFolderKeyword=function(a){var b,c=a,d=null;if(this._nameSearch&&(b=/(\S+)\s*(.*)/,(a=b.exec(a))&&a.length===3))a[1]&&
(c=a[1]),a[2]&&(d=a[2]);return{keyword:c,folderKeyword:d}};h.prototype.doSearch=function(){var a=this.$fileName.value;if(a){var e=this._detectFolderKeyword(a),c=this._searcher.createSearchParams(e.keyword,this._nameSearch,this._searchOnRoot),d=this._searchRenderer.makeRenderFunction(this._contentTypeService,this.$results,!1,this.decorateResult.bind(this));this.currentSearch=d;var f=document.createElement("div");f.appendChild(document.createTextNode(this._nameSearch?j["Searching..."]:k.formatMessage(j["Searching for occurrences of"],
a)));b.empty(this.$results);this.$results.appendChild(f);this._searcher.search(c,e.folderKeyword,function(){d===this.currentSearch&&d.apply(null,arguments)}.bind(this))}};h.prototype.decorateResult=function(a){function e(a){a.button===0&&!a.ctrlKey&&!a.metaKey&&c.hide()}for(var c=this,a=b.$$array("a",a),d=0;d<a.length;d++)a[d].addEventListener("click",e,!1)};h.prototype._beforeHiding=function(){clearTimeout(this._timeoutId)};h.prototype._afterHiding=function(){this._onHide&&this._onHide()};h.prototype.constructor=
h;return{OpenResourceDialog:h}});define("text!orion/banner/banner.html",[],function(){return'<header id="banner" role="banner">\n\t<\!-- Requires some js code to bind the home link, link to progress image, and binding NLS variables  --\>\n\n\t<div id="staticBanner" class="layoutBlock topRowBanner"> <\!-- primaryNav --\>\n\t\t<div id="centralNavigationArea" style="position:absolute;left:0;top:0;width:39px;height:36px; z-index:1;border-right:1px solid #ddd;"></div>\n\n\t\t<\!-- Static "Home" link. TODO delete this --\>\n\t\t<a id="home" class="layoutLeft "></a>\n\n\t\t<\!-- Left banner component: hamburger --\>\n\t\t<nav id="primaryNav" class="bannerLeftArea" style="z-index:2;" role="navigation">\n\t\t\t\t<button class="centralNavigation commandSprite core-sprite-hamburger" type="button"id="centralNavigation"></button>\n\t\t</nav>\n\n\t\t<\!-- Middle banner component: Breadcrumb bar --\>\n\t\t<div class="clear navigationBreadcrumb bannerMiddleArea" >\n\t\t\t<div id="location" class="currentLocation"></div>\n\t\t</div>\n\n\t\t<\!-- Right banner component: user identity --\>\n\t\t<div class="bannerRightArea" style="z-index:2;">\n\t\t\t<\!-- Global commands support. --\>\n\t\t\t<div id="globalActions" class="spacingLeft layoutLeft"></div>\n\n\t\t\t<\!-- Search. TODO delete this --\>\n\t\t\t<input type="text" id="search" autocomplete="off" class="layoutLeft spacingLeft searchbox" role="search" style="display:none;">\n\t\t\t<div id="searchOptions" class="layoutLeft" style="padding-top:1px;display:none;"></div>\n\n\t\t\t<\!-- User identity menu and Progress --\>\n\t\t\t<div id="userMenu" class="spacingRight layoutRight" style="color:#ccc;line-height:16px;">\n\t\t\t\t<div style="position: absolute;right: 0px;top:0;width: 39px;height:36px; z-index:-50;border-left: 1px solid #ddd;"></div>\n\n\t\t\t\t<\!-- Progress indicator --\>\n\t\t\t\t<img class="progressPane" id="progressPane" tabindex="0" role="progressbar"></img>\n\n\t\t\t\t<\!-- User identity menu --\>\n\t\t\t\t<span id="userTrigger" tabindex="0" role="button" class="dropdownTrigger" style="z-index:2;">\n\t\t\t\t</span>\n\t\t\t\t<ul id="userDropdown" class="dropdownMenu" role="menu"></ul>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n\n\t<\!-- IDE notification messages go in here --\>\n\t<div id="notificationArea" class="notificationHide">\n\t\t<div class="layoutLeft" id="notifications" aria-live="assertive" aria-atomic="true"></div>\n\t\t<div class="layoutRight"><button aria-label="Close" class="dismissButton layoutRight core-sprite-close imageSprite" type="button" id="closeNotifications"></span></div>\n\t</div>\n</header>'});
define("text!orion/banner/footer.html",[],function(){return'<\!--\n<footer id="footerContent" class="layoutBlock footerLayout" role="contentinfo">\n\t<div class="logoFooter commandSprite core-sprite-orion-logo"></div>\n\t<div class="footerBlock">${Orion is in Beta. Please try it out but BEWARE your data may be lost.}</div>\n\t<div class="footerRightBlock">\n\t\t<ul>\n\t\t\t<li><a href="https://bugs.eclipse.org/bugs/enter_bug.cgi?product=Orion&version=5.0" target="_blank">${Report a Bug}</a>\n\t\t\t<li><a href="http://www.eclipse.org/legal/privacy.php" target="_blank">${Privacy Policy}</a></li>\n\t\t\t<li><a href="http://www.eclipse.org/legal/termsofuse.php" target="_blank">${Terms of Use}</a></li>\n\t\t\t<li><a href="http://www.eclipse.org/legal/copyright.php" target="_blank">${Copyright Agent}</a></li>\n\t\t</ul>\n\t</div>\n</footer>\n--\>'});
define("text!orion/banner/toolbar.html",[],function(){return'<ul class="layoutLeft commandList pageActions" id="pageActions"></ul>\n<ul class="layoutLeft commandList pageActions" id="selectionTools"></ul>\n<ul class="layoutLeft commandList pageActions" id="navActions"></ul>\n<div class="layoutLeft" style="padding-left:7px;padding-right:7px;margin-top:2px;" id="filterBox" style="visibility: hidden;"></div>\n<ul class="layoutRight commandList pageActions" id="settingsActions"></ul>\n<div class="layoutRight status" id="statusPane" role="status" aria-live="off"></div>\n<ul class="layoutRight commandList pageActions" id="pageNavigationActions"></ul>'});
define("orion/widgets/input/DropDownMenu",["orion/objects","orion/webui/littlelib"],function(j,i){function g(d,b,g){if(d=i.node(d))this._parent=d;else throw Error("Parent node of dropdown menu not found");this.options=g=g||{};this.navDropDownId=this._parent.id+"_navdropdown";this.selectionClass=g.selectionClass;d=document.createElement("div");d.classList.add("dropDownContainer");d.id=this.navDropDownId;d.style.display="none";this._parent.appendChild(d);this._dropdownMenu=d;if(b=i.node(b))this._triggerNode=
b;else throw"Trigger node of dropdown menu not found";if(this._triggerNode.style.visibility==="hidden")this._triggerNode.style.visibility="visible";if(!g.noClick)this._triggerNode.onclick=this.click.bind(this);this._dropdownMenu.addEventListener("keydown",function(b){b.keyCode===i.KEY.ESCAPE&&this.clearPanel()}.bind(this))}j.mixin(g.prototype,{click:function(){this._dropdownMenu.style.display==="none"?this.updateContent(this.getContentNode(),function(){i.setFramesEnabled(!1);this._dropdownMenu.style.display=
"";this._positionDropdown();this.selectionClass&&this._triggerNode.classList.add(this.selectionClass);this.handle=i.addAutoDismiss([this._triggerNode,this._dropdownMenu],this.clearPanel.bind(this));if(this.options.onShow)this.options.onShow()}.bind(this)):this.clearPanel()},clearPanel:function(){if(this.isVisible()&&(this._dropdownMenu.style.display="none",i.setFramesEnabled(!0),this.selectionClass&&this._triggerNode.classList.remove(this.selectionClass),this.options.onHide))this.options.onHide()},
addContent:function(d){this._dropdownMenu.innerHTML=d},getContentNode:function(){return this._dropdownMenu},updateContent:function(d,b){b()},_positionDropdown:function(){this._dropdownMenu.style.right="";var d=i.bounds(this._dropdownMenu),b=i.bounds(document.body);if(d.left+d.width>b.left+b.width)d=i.bounds(this._boundingNode(this._triggerNode)),b=i.bounds(this._triggerNode),this._dropdownMenu.style.right=d.width-(b.left-d.left+b.width)+"px"},_boundingNode:function(d){var b=window.getComputedStyle(d,
null);return b===null?d:b.getPropertyValue("position")==="absolute"||!d.parentNode||d===document.body?d:this._boundingNode(d.parentNode)},isDestroyed:function(){return!this._dropdownMenu.parentNode},isVisible:function(){return this._dropdownMenu.style.display!=="none"&&!this.isDestroyed()},focus:function(){this._dropdownMenu.focus()},destroy:function(){if(this._parent)i.setFramesEnabled(!0),i.empty(this._parent),this._parent=this.select=null}});return g});define("orion/customGlobalCommands",[],function(){return{}});
define("orion/webui/SideMenu","orion/commands,orion/objects,orion/webui/littlelib,orion/PageLinks,orion/PageUtil,orion/URITemplate,orion/URL-shim,orion/util".split(","),function(j,i,g,d,b,k,f,h){function a(a,b){this.parentNode=g.node(a);this.contentNode=g.node(b);if(!this.parentNode)throw Error("Missing parentNode");this.menuitems=Object.create(null);this.categories=this.links=null;this.anchor=document.createElement("ul");this.anchor.classList.add("sideMenuList");this.parentNode.appendChild(this.anchor);
this.anchor.addEventListener("click",this._handleEvent.bind(this));this.anchor.addEventListener("touchstart",this._handleEvent.bind(this));this.anchor.addEventListener("focus",this._handleEvent.bind(this),!0);g.addAutoDismiss([this.anchor],this._expandMenu.bind(this,null))}function e(a){return!a.isRelatedLink}function c(a,b){var c=a.order,e=b.order;if(c<e)return-1;else if(e<c)return 1;return 0}function l(a,b){var c=a.source.order,e=b.source.order,c=typeof c==="number"?c:100,e=typeof e==="number"?
e:100;return c===e?a.textContent.localeCompare(b.textContent):c<e?-1:1}var m=h.isTouch;i.mixin(a.prototype,{LOCAL_STORAGE_NAME:"sideMenuNavigation",OPEN_STATE:"open",CLOSED_STATE:"closed",DEFAULT_STATE:"open",SIDE_MENU_OPEN_WIDTH:"40px",TRANSITION_DURATION_MS:301,addMenuItem:function(a,b,c){var e=this.anchor,a=this.createListItem(a,b);c&&a.classList.add("sideMenuItemActive");e.appendChild(a);this.menuitems[b]=a},setSideMenu:function(){var a=this.getDisplayState(),b=this.parentNode;if(b){if(a===this.CLOSED_STATE){this.setPageContentLeft("0");
if(this._timeout)window.clearTimeout(this._timeout),this._timeout=null;this._timeout=window.setTimeout(function(){b.style.display="none"},this.TRANSITION_DURATION_MS);b.classList.add("animating")}if(a===this.OPEN_STATE){if(this._timeout)window.clearTimeout(this._timeout),this._timeout=null;b.classList.remove("animating");b.style.display="block";b.style.width=this.SIDE_MENU_OPEN_WIDTH;this.setPageContentLeft(this.SIDE_MENU_OPEN_WIDTH)}}},setPageContentLeft:function(a){var b=this.contentNode;if(b)b.style.left=
a},toggleSideMenu:function(){var a=this.getDisplayState(),b=this.contentNode;b&&b.classList.add("content-fixedHeight-animation");a=a===this.OPEN_STATE?this.CLOSED_STATE:this.OPEN_STATE;a===this.DEFAULT_STATE?localStorage.removeItem(this.LOCAL_STORAGE_NAME):localStorage.setItem(this.LOCAL_STORAGE_NAME,a);this.setSideMenu()},clearMenuItems:function(){this.menuitems=[];g.empty(this.anchor)},getMenuItems:function(){var a=this.menuitems;return Object.keys(a).map(function(b){return a[b]})},getMenuItem:function(a){return this.menuitems[a]},
getDisplayState:function(){var a=localStorage.getItem(this.LOCAL_STORAGE_NAME);if(!a)a=this.DEFAULT_STATE;return a},createListItem:function(a,b){var c=document.createElement("li");c.className=a;c.classList.add("sideMenuItem");c.categoryId=b;return c},setCategories:function(a){this.categories=a;this.links=Object.create(null)},setPageLinks:function(a){this.pageLinks=a;var b=this,c=a.createLinkElements();a.getAllLinks().forEach(function(a,e){var d=c[e];d.source=a;b._getLinksBin(a.category).push(d)});
this._renderLinks()},setRelatedLinks:function(a,b){this.relatedLinks=a;var c=this;Object.keys(this.links).forEach(function(a){var b=c._getLinksBin(a);c.links[a]=b.filter(e)});var d=document.createDocumentFragment();a.forEach(function(a){var b=a.relatedLink,e=c._getLinksBin(b.category),a=j.createCommandMenuItem(d,a.command,a.invocation);a.classList.remove("dropdownMenuItem");a.isRelatedLink=!0;a.source=b;e.push(a)});this._renderLinks(b)},_getLinksBin:function(a){if(a){var b=this.links;b[a]=b[a]||[];
return b[a]}else return[]},_sort:function(){var a=this.links;Object.keys(a).forEach(function(b){a[b].sort(l)})},_renderCategories:function(){var a=this.categories,e=this,f=new URL(window.location.href),h=b.matchResourceParameters();h.OrionHome=d.getOrionHome();var l=!1;this.clearMenuItems();a.getCategoryIDs().map(function(b){return a.getCategory(b)}).sort(c).forEach(function(a){var b=e._getLinksBin(a.id);b.length&&(l?e.addMenuItem(a.imageClass,a.id,!1):(b=b.some(function(a){if(!a.source.uriTemplate)return!1;
a=new k(a.source.uriTemplate);a=new URL(a.expand(h),window.location);return a.protocol===f.protocol&&a.host===f.host&&a.hostname===f.hostname&&a.port===f.port&&a.pathname===f.pathname&&a.search===f.search?l=!0:!1}),e.addMenuItem(a.imageClass,a.id,b)))})},_renderLinks:function(a){a=a||[];this._sort();this._renderCategories();var b=this,c=window.location.href;Object.keys(this.menuitems).forEach(function(e){var d=b.getMenuItem(e);if(d){for(var f=b._getLinksBin(e).slice(),f=f.filter(function(b){var e=
b.source;return a.indexOf(e.id)>=0||!e.default&&!e.force&&b.href===c?!1:!0}),f=f.filter(function(a){a=a.source;return!(f.length>1&&a.default&&!a.force)}),h=f.length-1;h>0;h--)f[h].href===f[h-1].href&&f.splice(h,1);if(f.length){d.appendChild(b._createCategoryElement(e,d,f[0]));var l=document.createElement("ul");l.className="sideMenuSubMenu";f.forEach(function(a){var b=document.createElement("li");b.className="sideMenuSubMenuItem";var c=document.createElement("a");c.href=a;c.className="sideMenuSubMenuItemLink";
var e=document.createElement("span");e.innerHTML=a.innerHTML;e.className="sideMenuSubMenuItemSpan";c.appendChild(e);b.appendChild(c);l.appendChild(b)});d.appendChild(l)}}})},_createCategoryElement:function(a,b,c){var a=this.categories.getCategory(a),e;m?(e=document.createElement("button"),e.type="button"):(e=document.createElement("a"),e.href=c.href);e.className+=a.imageClass;e.classList.add("submenu-trigger");e.tabIndex="0";b.classList.remove(a.imageClass);return e},_handleEvent:function(a){var b=
a.target,a=a.type==="focus";if(b.tagName!=="A"||a)b.classList.contains("submenu-trigger")&&(m||a)&&this._expandMenu(g.$(".sideMenuSubMenu",b.parentNode))},_expandMenu:function(a){this.getMenuItems().forEach(function(b){b=g.$(".sideMenuSubMenu",b);a!==b&&b.classList.remove("expanded")});a&&a.classList.toggle("expanded")}});return a});
define("orion/globalCommands","i18n!orion/nls/messages,require,orion/commonHTMLFragments,orion/keyBinding,orion/EventTarget,orion/commandRegistry,orion/commands,orion/parameterCollectors,orion/extensionCommands,orion/uiUtils,orion/keyBinding,orion/breadcrumbs,orion/webui/littlelib,orion/webui/splitter,orion/webui/dropdown,orion/webui/tooltip,orion/contentTypes,orion/URITemplate,orion/keyAssist,orion/PageUtil,orion/widgets/themes/ThemePreferences,orion/widgets/themes/container/ThemeData,orion/Deferred,orion/widgets/UserMenu,orion/PageLinks,orion/webui/dialogs/OpenResourceDialog,text!orion/banner/banner.html,text!orion/banner/footer.html,text!orion/banner/toolbar.html,orion/widgets/input/DropDownMenu,orion/util,orion/customGlobalCommands,orion/fileClient,orion/webui/SideMenu,orion/objects".split(","),function(j,
i,g,d,b,k,f,h,a,e,c,l,m,n,o,p,u,r,t,q,v,w,C,B,E,D,z,s,y,x,G,A,H,V,I){var Z,W,P,S,T,aa,U,Y;function ha(a,b){if(a.getLabel)return a.getLabel();else{var c=new C;c.resolve(b.properties.name);return c}}function ia(a){m.node("progressPane").setAttribute("aria-label",j["Operations - Press spacebar to show current operations"]);(a=a.getService("orion.page.progress"))&&a.init.bind(a)("progressPane")}function fa(a,b){var c=a.getServiceReferences("orion.core.auth");ea=[];var e=Z.apply(this,arguments);if(e)for(var d=
0;d<c.length;d++){var f=c[d],h=a.getService(f);ha(h,f).then(function(a){h.getKey().then(function(b){ea.push(b);h.getUser().then(function(c){e.addUserItem(b,h,a,c)},function(c,d){e.addUserItem(b,h,a,d)});window.addEventListener("storage",function(){$[b]!==localStorage.getItem(b)&&($[b]=localStorage.getItem(b),h.getUser().then(function(c){e.addUserItem(b,h,a,c)},function(){e.addUserItem(b,h,a)}))},!1)})})}}function ba(a){return a}function ca(b,c,e,d,h){function l(a){for(var b={},c=a.getPropertyKeys(),
e,d=0;d<c.length;d++)e=c[d],b[e]=a.getProperty(e);return b}function g(a,b){var c=null;a.some(function(a){return b===a.getProperty("id")?!!(c=a):!1});return c}function i(a){var b=a.command;if(!b.visibleWhen||b.visibleWhen(c))return a.invocation=new f.CommandInvocation(c,c,null,b,d),(new C).resolve(a);else if(typeof h==="function")return n||(n=h()),C.when(n,function(e){if(e&&c===J&&(!b.visibleWhen||b.visibleWhen(e)))return a.invocation=new f.CommandInvocation(e,e,null,b,d),a});return(new C).resolve()}
function m(a,b,c){return c?(new C).resolve({relatedLink:a,command:c}):b.then(function(b){return{relatedLink:a,command:new f.Command(b)}})}var k=arguments,j,n,o=b&&b.getServiceReferences("orion.page.link.related");if(o&&o.length!==0){var p=this;C.when(function(){if(j)return j;var a=b.getService("orion.core.contentTypeRegistry");a||(a=new u.ContentTypeRegistry(b),a=b.getService("orion.core.contentTypeRegistry"));return a.getContentTypes().then(function(a){return j=a})}(),function(){if(W.apply(p,k)){var c=
b.getServiceReferences("orion.navigate.command"),f=[];o.forEach(function(e){var h=l(e);if(h.id){var i;if((h.nls&&h.nameKey||h.name)&&h.uriTemplate)i=a._createCommandOptions(h,e,b,j,!0),f.push(m(h,i,null));else if(i=g(c,h.id)){var k=l(i),e={};I.mixin(e,k,h);(h=d.findCommand(h.id))?f.push(m(e,null,h)):(i=a._createCommandOptions(k,i,b,j,!0),f.push(m(e,i,null)))}}});C.all(f,ba).then(function(a){a.sort(function(a,b){return a.command.name.localeCompare(b.command.name)});return C.all(a.map(i),ba).then(function(b){var c=
[],b=b.filter(function(b,e){if(b)return!0;c.push(a[e]);return!1});P.call(p,d,b,c,e);S.apply(p,k)})})}})}}function F(a){var b=m.node("globalActions");b&&(a.destroy(b),a.renderCommands(b.id,b,{},{},"tool"))}function da(a){var b=window.getComputedStyle(a,null);return b===null?a:b.getPropertyValue("position")==="absolute"||!a.parentNode||a===document.body?a:da(a.parentNode)}function N(a){var b={},c=null;typeof a==="string"&&(a=m.node(a));a||(a=m.node("pageActions"));for(var e=a;e&&e.classList;){if(e.classList.contains("toolComposite")){c=
e;break}e=e.parentNode}if(a.classList.contains("commandMarker"))b.commandNode=a;if(c&&(b.slideContainer=m.$(".slideParameters",c),b.parameterArea=m.$(".parameters",c),b.dismissArea=m.$(".parametersDismiss",c),b.notifications=m.$("#notificationArea",c),c.parentNode&&(b.toolbarTarget=m.$(".toolbarTarget",c.parentNode),b.toolbarTarget)))a=m.bounds(b.toolbarTarget),e=m.bounds(da(b.toolbarTarget.parentNode)),b.toolbarTargetY=a.top-e.top,b.toolbar=c;return b}function O(a){if(a=a.slideContainer)if(a.style.left=
"",a.style.top="",a.classList.contains("slideContainerActive")){var b=m.bounds(a),c=m.bounds(a.parentNode);a.style.left=(c.width-b.width)/2+"px";a.style.top="0"}}var k=function(a){var b=document.createElement("a");b.href=a;return b.href}(i.toUrl("auth/NotifyAuthentication.html")),$={},L=null;Z=A.createMenuGenerator||function(a,b){if(m.node("userMenu")){var c=m.node("userDropdown"),e=new o.Dropdown({dropdown:c}),c=new B.UserMenu({dropdownNode:c,dropdown:e,serviceRegistry:a}),e=m.node("userTrigger");
new p.Tooltip({node:e,text:j.Options,position:["below","left"]});var e=document.getElementById("userTrigger"),d=e.className;d+=" imageSprite core-sprite-silhouette";e.className=d;c.setKeyAssist(b);return c}};W=A.beforeGenerateRelatedLinks||function(){return!0};P=A.addRelatedLinkCommands||function(a,b,c,e){this.sideMenu&&this.sideMenu.setRelatedLinks(b,e)};S=A.afterGenerateRelatedLinks||function(){};T=A.afterSetPageTarget||function(){};aa=A.generateNavigationMenu||function(){var a=m.node("sideMenu");
if(a){var b=m.node("centralNavigation");new p.Tooltip({node:b,text:j.CentralNavTooltip,position:["right"]});L=this.sideMenu=new V(a,m.node("pageContent"));b.addEventListener("click",L.toggleSideMenu.bind(L));(a=m.node("sideMenuToggle"))&&a.addEventListener("click",L.toggleSideMenu.bind(L))}};U=A.afterGenerateNavigationMenu||function(){};Y=A.afterGenerateBanner||function(){};var ea=[],J,Q=[],K,R=null,M=null,X=new b;return{generateBanner:function(a,b,c,e,l,k,o,p){function x(a){a.registerService("orion.cm.managedservice",
{updated:function(a){for(var a=a&&a["links.newtab"]!=="undefined"?a["links.newtab"]?"_blank":"_self":"_self",b=m.$$array(".targetSelector"),c=0;c<b.length;c++)b[c].target=a}},{pid:"nav.config"})}(new v.ThemePreferences(e,new w.ThemeData)).apply();var q=m.node(a);if(!q)throw j["could not find banner parent, id was "]+a;var r=document.createRange();r.selectNode(q);r=r.createContextualFragment(z);m.processTextNodes(r,j);q.firstChild?q.insertBefore(r,q.firstChild):q.appendChild(r);q=m.node("home");q.href=
i.toUrl("edit/edit.html");q.setAttribute("aria-label",j["Orion Home"]);m.node("progressPane").src=f.NO_IMAGE;if(q=m.node("pageToolbar"))q.classList.add("toolbarLayout"),q.innerHTML=y+g.slideoutHTMLFragment("mainToolbar");(q=m.node("closeNotifications"))&&q.setAttribute("aria-label",j["Close notification"]);if(G.isFirefox<=17&&(q=m.node("staticBanner")))q.style.width="100%",q.style.MozBoxSizing="border-box";if(q=m.node("footer"))q.innerHTML=s,m.processTextNodes(q,j);c.setParameterCollector(new h.CommandParameterCollector(N,
O));document.addEventListener("keydown",function(a){a.keyCode===m.KEY.ESCAPE&&(a=b.getService("orion.page.message"))&&a.setProgressMessage("")},!1);aa.apply(this,arguments);U.apply(this,arguments);q=E.getCategoriesInfo(b);r=E.getPageLinksInfo(b,"orion.page.link");C.all([q,r]).then(function(a){if(L){var b=a[1];L.setCategories(a[0]);L.setPageLinks(b);L.setSideMenu()}});if(q=m.$(".split")){var r=m.$(".sidePanelLayout"),u=m.$(".mainPanelLayout");if(r&&u)R={side:r,main:u},R.splitter=new n.Splitter({node:q,
sidePanel:r,mainPanel:u,toggle:!0,closeByDefault:p}),q=new f.Command({name:j["Toggle side panel"],tooltip:j["Open or close the side panel"],id:"orion.toggleSidePane",callback:function(){R.splitter.toggleSidePanel()}}),c.addCommand(q),c.registerCommandContribution("pageActions","orion.toggleSidePane",1,null,!0,new d.KeyBinding("l",G.isMac?!1:!0,!0,!1,G.isMac?!0:!1))}var A=!1,H=function(a,b){if(!A){var c=b.getService("orion.page.progress"),e=new D.OpenResourceDialog({searcher:a,progress:c,searchRenderer:a.defaultRenderer,
onHide:function(){A=!1}});window.setTimeout(function(){A=!0;e.show()},0)}},q=new f.Command({name:j["Find File Named..."],tooltip:j["Choose a file by name and open an editor on it"],id:"orion.openResource",callback:function(){H(l,b)}});c.addCommand(q);c.registerCommandContribution("globalActions","orion.openResource",100,null,!0,new d.KeyBinding("f",!0,!0));q=new f.Command({name:j["Toggle banner and footer"],tooltip:j["Hide or show the page banner and footer"],id:"orion.toggleTrim",callback:function(){var a=
m.node("banner"),b=m.node("footer"),c=m.node("sideMenu"),e=m.$(".content-fixedHeight"),d=a.style.visibility==="hidden";d?(a.style.visibility="visible",b.style.visibility="visible",e.classList.remove("content-fixedHeight-maximized"),c&&c.classList.remove("sideMenu-maximized")):(a.style.visibility="hidden",b.style.visibility="hidden",e.classList.add("content-fixedHeight-maximized"),c&&c.classList.add("sideMenu-maximized"));X.dispatchEvent({type:"toggleTrim",maximized:!d});return!0}});c.addCommand(q);
c.registerCommandContribution("globalActions","orion.toggleTrim",100,null,!0,new d.KeyBinding("m",!0,!0));q=new f.Command({name:j["System Configuration Details"],tooltip:j["System Config Tooltip"],id:"orion.configDetailsPage",hrefCallback:function(){return i.toUrl("help/about.html")}});c.addCommand(q);c.registerCommandContribution("globalActions","orion.configDetailsPage",100,null,!0,new d.KeyBinding(112,!0,!0));q=new f.Command({name:j["Background Operations"],tooltip:j["Background Operations Tooltip"],
id:"orion.backgroundOperations",hrefCallback:function(){return i.toUrl("operations/list.html")}});c.addCommand(q);c.registerCommandContribution("globalActions","orion.backgroundOperations",100,null,!0,new d.KeyBinding("o",!0,!0));M=new t.KeyAssistPanel({commandRegistry:c});q=new f.Command({name:j["Show Keys"],tooltip:j["Show a list of all the keybindings on this page"],id:"orion.keyAssist",callback:function(){M.isVisible()?M.hide():M.show();return!0}});c.addCommand(q);c.registerCommandContribution("globalActions",
"orion.keyAssist",100,null,!0,new d.KeyBinding(191,!1,!0));F(c);fa(b,q.callback);ia(b);window.addEventListener("hashchange",function(){c.processURL(window.location.href)},!1);window.setTimeout(function(){x(b)},0);Y.apply(this,arguments)},getToolbarElements:N,getMainSplitter:function(){return R},getKeyAssist:function(){return M},getGlobalEventTarget:function(){return X},layoutToolbarElements:O,setPageTarget:function(a){var b,c,e=a.breadcrumbRootName,d=a.serviceRegistry;a.target?(a.searchService&&a.searchService.setLocationByMetaData(a.target),
a.fileService&&!a.breadcrumbTarget&&(c=e?e+" ":"",c+=a.fileService.fileServiceName(a.target.Location),e=null),b=a.name||a.target.Name,J=a.target,ca.call(this,d,a.target,Q,a.commandService,a.makeAlternate)):(a.breadcrumbTarget||(e=e||a.task||a.name),b=a.name,ca.call(this,d,{NoTarget:""},Q,a.commandService,a.makeAlternate));(K=a.title)||(K=b?b+" - "+a.task:a.task);window.document.title=K;T.apply(this,arguments);if(b=a.breadCrumbContainer?m.node(a.breadCrumbContainer):m.node("location")){m.empty(b);
var f=d&&new H.FileClient(d),d=a.breadcrumbTarget||a.target,f=f&&d&&d.Location?f.fileServiceRootURL(d.Location):null;new l.BreadCrumbs({container:b,resource:d,rootSegmentName:e,workspaceRootSegmentName:c,workspaceRootURL:f,makeFinalHref:a.makeBreadcrumFinalLink,makeHref:a.makeBreadcrumbLink})}},setDirtyIndicator:function(a){if(K)K.charAt(0)==="*"&&!a&&(K=K.substring(1)),a&&K.charAt(0)!=="*"&&(K="*"+K),window.document.title=K;var b=m.node("dirty");if(b)b.textContent=a?"*":""},setPageCommandExclusions:function(a){Q=
a},notifyAuthenticationSite:k}});
define("util/legacy",["require","exports","module"],function(){if(!(typeof window==="undefined"||typeof document==="undefined")){if(window.console==null)window.console={};"debug,log,warn,error,trace,group,groupEnd".split(",").forEach(function(j){window.console[j]||(window.console[j]=function(){})});!("classList"in document.documentElement)&&Object.defineProperty&&typeof HTMLElement!=="undefined"&&Object.defineProperty(HTMLElement.prototype,"classList",{get:function(){function j(d){return function(b){var g=i.className.split(/\s+/),
f=g.indexOf(b);d(g,f,b);i.className=g.join(" ")}}var i=this,g={add:j(function(d,b,g){~b||d.push(g)}),remove:j(function(d,b){~b&&d.splice(b,1)}),toggle:j(function(d,b,g){~b?d.splice(b,1):d.push(g)}),contains:function(d){return!!~i.className.split(/\s+/).indexOf(d)},item:function(d){return i.className.split(/\s+/)[d]||null}};Object.defineProperty(g,"length",{get:function(){return i.className.split(/\s+/).length}});return g}});if(!String.prototype.trimLeft)String.prototype.trimLeft=function(){return String(this).replace(/\s*$/,
"")};if(!Function.prototype.bind)Function.prototype.bind=function(j){if(typeof this!=="function")throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");var i=Array.prototype.slice.call(arguments,1),g=this,d=function(){},b=function(){return g.apply(this instanceof d&&j?this:j,i.concat(Array.prototype.slice.call(arguments)))};d.prototype=this.prototype;b.prototype=new d;return b}}});
define("util/promise",["require","exports","module"],function(j,i,g){function d(a){return{then:function(b){b(a)}}}function b(a){return{then:function(b,c){c(a)}}}function k(a){return function(e){try{return a(e)}catch(c){return b(c)}}}function f(a){var e=[],c,a=a||a===null?a:Object.prototype,h={promise:Object.create(a,{then:{value:function(h,l){function g(a){j.resolve(h(a))}function i(a){j.resolve(l(a))}var j=f(a),h=h?k(h):d,l=l?k(l):b;e?e.push([g,i]):c.then(g,i);return j.promise}}}),resolve:function(a){if(e){for(c=
a&&typeof a.then==="function"?a:d(a);e.length;)c.then.apply(c,e.shift());e=null}},reject:function(a){h.resolve(b(a))}};return h}function h(a,b){var c=f(b);c.resolve(a);return c.promise}g.metadata={stability:"unstable"};i.defer=f;i.resolve=h;i.reject=function(a,b){var c=f(b);c.reject(a);return c.promise};j=function(){function a(a){return c.apply(c,a)}function b(a,c){return a.then(function(a){return h(c).then(function(b){return a.concat([b])})})}var c=Function.call,d=Array.prototype.concat;return function(c,
f){return function(){return d.apply([c,this],arguments).reduce(b,h([],f)).then(a)}}}();i.promised=j});
define("util/util",["require","exports","module","util/promise"],function(j,i){function g(b,d){for(var a=0;a<d.length;a++)if(b===d[a])return a;return-1}function d(b,d){var a=b.getAttribute("data-command");a||(a=b.querySelector("*[data-command]").getAttribute("data-command"));a?d(a):console.warn("Missing data-command for "+util.findCssSelector(b))}i.createEvent=function(b){var d=[],a=!1,e=[],c=void 0,l=function(b){if(a)e.push(b);else for(var c=0;c<d.length;c++){var f=d[c];f.func.call(f.scope,b)}};
l.add=function(a,b){d.push({func:a,scope:b})};l.remove=function(a,c){var e=!1;d=d.filter(function(b){(b=b.func===a&&b.scope===c)&&(e=!0);return!b});e||console.warn("Handler not found. Attached to "+b)};l.removeAll=function(){d=[]};l.holdFire=function(){a=!0};l.resumeFire=function(){if(a!==!0)throw Error("Event not held: "+b);a=!1;if(e.length!==0){if(e.length===1)l(e[0]);else{var d=e[0],h=e[e.length-1];c?l(c(d,h,e)):l(h)}e=[]}};Object.defineProperty(l,"eventCombiner",{set:function(a){if(typeof a!==
"function")throw Error("eventCombiner is not a function");c=a},enumerable:!0});return l};var b=j("util/promise");i.promised=function(){function d(b){return a.apply(a,b)}function h(a,e){return a.then(function(a){return b.resolve(e).then(function(b){return a.concat([b])})})}var a=Function.call,e=Array.prototype.concat;return function(a,l){return function(){return e.apply([a,this],arguments).reduce(h,b.resolve([],l)).then(d)}}}();i.all=i.promised(Array);i.synchronize=function(b){if(b==null||typeof b.then!==
"function")return b;var d=void 0,a=void 0;b.then(function(b){d=!1;a=b},function(b){d=!0;a=b});if(d===void 0)throw Error("non synchronizable promise");if(d)throw a;return a};i.promiseEach=function(d,h,a){if(d.length===0)return b.resolve([]);var e=b.defer(),c=function(l){var g=[],i=h.call(a,d[l]);b.resolve(i).then(function(a){g[l]=a;a=l+1;a>=d.length?e.resolve(g):c(a)}).then(null,function(a){e.reject(a)})};c(0);return e.promise};i.NS_XHTML="http://www.w3.org/1999/xhtml";i.NS_XUL="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
i.createElement=function(b,d){return i.isXmlDocument(b)?b.createElementNS(i.NS_XHTML,d):b.createElement(d)};i.clearElement=function(b){for(;b.hasChildNodes();)b.removeChild(b.firstChild)};var k=/^\s*$/;i.removeWhitespace=function(b,d){for(var a=0;a<b.childNodes.length;){var e=b.childNodes.item(a);e.nodeType===3&&k.test(e.textContent)?b.removeChild(e):(d&&e.nodeType===1&&i.removeWhitespace(e,d),a++)}};i.importCss=function(b,d,a){if(b){d=d||document;if(!a){a=0;if(b.length!=0)for(var e=0;e<b.length;e++){var c=
b.charCodeAt(e),a=(a<<5)-a+c;a&=a}a="hash-"+a}if(e=d.getElementById(a))return e.tagName.toLowerCase()!=="style"&&console.error("Warning: importCss passed id="+a+", but that pre-exists (and isn't a style tag)"),e;e=i.createElement(d,"style");e.id=a;e.appendChild(d.createTextNode(b));(d.getElementsByTagName("head")[0]||d.documentElement).appendChild(e);return e}};i.setTextContent=function(b,d){i.clearElement(b);var a=b.ownerDocument.createTextNode(d);b.appendChild(a)};i.setContents=function(b,d){if(typeof HTMLElement!==
"undefined"&&d instanceof HTMLElement)i.clearElement(b),b.appendChild(d);else if("innerHTML"in b)b.innerHTML=d;else try{var a=b.ownerDocument.documentElement.namespaceURI;if(!a)a=i.NS_XHTML;i.clearElement(b);for(var e=b.ownerDocument.createRange().createContextualFragment('<div xmlns="'+a+'">'+d+"</div>").firstChild;e.hasChildNodes();)b.appendChild(e.firstChild)}catch(c){throw console.error("Bad XHTML",c),console.trace(),c;}};i.toDom=function(b,d){var a=i.createElement(b,"div");i.setContents(a,d);
return a.children[0]};i.isXmlDocument=function(b){b=b||document;return b.contentType&&b.contentType!="text/html"?!0:b.xmlVersion!=null?!0:!1};i.findCssSelector=function(b){var d=b.ownerDocument;if(b.id&&d.getElementById(b.id)===b)return"#"+b.id;var a=b.tagName.toLowerCase();if(a==="html")return"html";if(a==="head")return"head";if(a==="body")return"body";b.parentNode==null&&console.log("danger: "+a);var e,c;if(b.classList.length>0)for(var l=0;l<b.classList.length;l++){e="."+b.classList.item(l);c=d.querySelectorAll(e);
if(c.length===1)return e;e=a+e;c=d.querySelectorAll(e);if(c.length===1)return e;c=g(b,b.parentNode.children)+1;e=e+":nth-child("+c+")";c=d.querySelectorAll(e);if(c.length===1)return e}c=g(b,b.parentNode.children)+1;return e=i.findCssSelector(b.parentNode)+" > "+a+":nth-child("+c+")"};i.createUrlLookup=function(b){return function(d){try{return j("text!gcli/ui/"+d)}catch(a){if(b.filename)return b.filename+d;var e=b.id.split("/").pop()+".js";return b.uri.substr(-e.length)!==e?(console.error("Can't work out path from module.uri/module.id"),
d):b.uri?b.uri.substr(0,b.uri.length-e.length-1)+"/"+d:e+"/"+d}}};i.updateCommand=function(b,h){d(b,function(a){h.update(a)})};i.executeCommand=function(b,h){d(b,function(a){h.exec({visible:!0,typed:a})})};i.KeyEvent={DOM_VK_CANCEL:3,DOM_VK_HELP:6,DOM_VK_BACK_SPACE:8,DOM_VK_TAB:9,DOM_VK_CLEAR:12,DOM_VK_RETURN:13,DOM_VK_ENTER:14,DOM_VK_SHIFT:16,DOM_VK_CONTROL:17,DOM_VK_ALT:18,DOM_VK_PAUSE:19,DOM_VK_CAPS_LOCK:20,DOM_VK_ESCAPE:27,DOM_VK_SPACE:32,DOM_VK_PAGE_UP:33,DOM_VK_PAGE_DOWN:34,DOM_VK_END:35,DOM_VK_HOME:36,
DOM_VK_LEFT:37,DOM_VK_UP:38,DOM_VK_RIGHT:39,DOM_VK_DOWN:40,DOM_VK_PRINTSCREEN:44,DOM_VK_INSERT:45,DOM_VK_DELETE:46,DOM_VK_0:48,DOM_VK_1:49,DOM_VK_2:50,DOM_VK_3:51,DOM_VK_4:52,DOM_VK_5:53,DOM_VK_6:54,DOM_VK_7:55,DOM_VK_8:56,DOM_VK_9:57,DOM_VK_SEMICOLON:59,DOM_VK_EQUALS:61,DOM_VK_A:65,DOM_VK_B:66,DOM_VK_C:67,DOM_VK_D:68,DOM_VK_E:69,DOM_VK_F:70,DOM_VK_G:71,DOM_VK_H:72,DOM_VK_I:73,DOM_VK_J:74,DOM_VK_K:75,DOM_VK_L:76,DOM_VK_M:77,DOM_VK_N:78,DOM_VK_O:79,DOM_VK_P:80,DOM_VK_Q:81,DOM_VK_R:82,DOM_VK_S:83,DOM_VK_T:84,
DOM_VK_U:85,DOM_VK_V:86,DOM_VK_W:87,DOM_VK_X:88,DOM_VK_Y:89,DOM_VK_Z:90,DOM_VK_CONTEXT_MENU:93,DOM_VK_NUMPAD0:96,DOM_VK_NUMPAD1:97,DOM_VK_NUMPAD2:98,DOM_VK_NUMPAD3:99,DOM_VK_NUMPAD4:100,DOM_VK_NUMPAD5:101,DOM_VK_NUMPAD6:102,DOM_VK_NUMPAD7:103,DOM_VK_NUMPAD8:104,DOM_VK_NUMPAD9:105,DOM_VK_MULTIPLY:106,DOM_VK_ADD:107,DOM_VK_SEPARATOR:108,DOM_VK_SUBTRACT:109,DOM_VK_DECIMAL:110,DOM_VK_DIVIDE:111,DOM_VK_F1:112,DOM_VK_F2:113,DOM_VK_F3:114,DOM_VK_F4:115,DOM_VK_F5:116,DOM_VK_F6:117,DOM_VK_F7:118,DOM_VK_F8:119,
DOM_VK_F9:120,DOM_VK_F10:121,DOM_VK_F11:122,DOM_VK_F12:123,DOM_VK_F13:124,DOM_VK_F14:125,DOM_VK_F15:126,DOM_VK_F16:127,DOM_VK_F17:128,DOM_VK_F18:129,DOM_VK_F19:130,DOM_VK_F20:131,DOM_VK_F21:132,DOM_VK_F22:133,DOM_VK_F23:134,DOM_VK_F24:135,DOM_VK_NUM_LOCK:144,DOM_VK_SCROLL_LOCK:145,DOM_VK_COMMA:188,DOM_VK_PERIOD:190,DOM_VK_SLASH:191,DOM_VK_BACK_QUOTE:192,DOM_VK_OPEN_BRACKET:219,DOM_VK_BACK_SLASH:220,DOM_VK_CLOSE_BRACKET:221,DOM_VK_QUOTE:222,DOM_VK_META:224}});
define("gcli/nls/strings",["require","exports","module"],function(j,i){i.root={canonDescNone:"(No description)",cliEvalJavascript:"Enter JavaScript directly",cliUnusedArg:"Too many arguments",cliOptions:"Available Options",fieldSelectionSelect:"Select a %S\u2026",fieldArrayAdd:"Add",fieldArrayDel:"Delete",fieldMenuMore:"More matches, keep typing",jstypeParseScope:"Scope lost",jstypeParseMissing:"Can't find property '%S'",jstypeBeginSyntax:"Syntax error",jstypeBeginUnterm:"Unterminated string literal",
jstypeParseError:"Error",typesNumberNan:'Can\'t convert "%S" to a number.',typesNumberMax:"%1$S is greater than maximum allowed: %2$S.",typesNumberMin:"%1$S is smaller than minimum allowed: %2$S.",typesNumberNotInt2:'Can\'t convert "%S" to an integer.',typesSelectionNomatch:"Can't use '%S'.",nodeParseSyntax:"Syntax error in CSS query",nodeParseMultiple:"Too many matches (%S)",nodeParseNone:"No matches",helpDesc:"Get help on the available commands",helpManual:"Provide help either on a specific command (if a search string is provided and an exact match is found) or on the available commands (if a search string is not provided, or if no exact match is found).",
helpSearchDesc:"Search string",helpSearchManual3:"search string to use in narrowing down the displayed commands. Regular expressions not supported.",helpManSynopsis:"Synopsis",helpManDescription:"Description",helpManParameters:"Parameters",helpManNone:"None",helpListAll:"Available Commands:",helpListPrefix:"Commands starting with '%1$S':",helpListNone:"No commands starting with '%1$S'",helpManRequired:"required",helpManOptional:"optional",subCommands:"Sub-Commands",subCommandsNone:"None",prefDesc:"Commands to control settings",
prefManual:"Commands to display and alter preferences both for GCLI and the surrounding environment",prefListDesc:"Display available settings",prefListManual:"Display a list of preferences, optionally filtered when using the 'search' parameter",prefListSearchDesc:"Filter the list of settings displayed",prefListSearchManual:"Search for the given string in the list of available preferences",prefShowDesc:"Display setting value",prefShowManual:"Display the value of a given preference",prefShowSettingDesc:"Setting to display",
prefShowSettingManual:"The name of the setting to display",prefSetDesc:"Alter a setting",prefSetManual:"Alter preferences defined by the environment",prefSetSettingDesc:"Setting to alter",prefSetSettingManual:"The name of the setting to alter.",prefSetValueDesc:"New value for setting",prefSetValueManual:"The new value for the specified setting",prefSetCheckHeading:"This might void your warranty!",prefSetCheckBody:"Changing these advanced settings can be harmful to the stability, security, and performance of this application. You should only continue if you are sure of what you are doing.",
prefSetCheckGo:"I'll be careful, I promise!",prefResetDesc:"Reset a setting",prefResetManual:"Reset the value of a setting to the system defaults",prefResetSettingDesc:"Setting to reset",prefResetSettingManual:"The name of the setting to reset to the system default value",prefOutputFilter:"Filter",prefOutputName:"Name",prefOutputValue:"Value",introDesc:"Show the opening message",introManual:"Redisplay the message that is shown to new users until they click the 'Got it!' button",introTextOpening2:"This command line is designed for developers. It focuses on speed of input over JavaScript syntax and a rich display over monospace output.",
introTextCommands:"For a list of commands type",introTextKeys2:", or to show/hide command hints press",introTextF1Escape:"F1/Escape",introTextGo:"Got it!",hideIntroDesc:"Show the initial welcome message",eagerHelperDesc:"How eager are the tooltips",allowSetDesc:"Has the user enabled the 'pref set' command?"}});
define("util/l10n",["require","exports","module","gcli/nls/strings"],function(j,i){function g(a,b){return a.replace(/\{[^}]*\}/g,function(a){a=a.slice(1,-1);if(b==null)return console.log("Missing swaps while looking up '"+a+"'"),"";var d=b[a];d==null&&(console.log("Can't find '"+a+"' in "+JSON.stringify(b)),d="");return d})}function d(a,b){var c=0,a=a.replace(/%S/g,function(){return b[c++]});return a=a.replace(/%([0-9])\$S/g,function(a,c){return b[c-1]})}function b(){if(!h){var a=navigator.language||
navigator.userLanguage;f.some(function(b){return b.locales.indexOf(a)!==-1?(h=b,!0):!1});h||(console.error("Failed to find plural rule for "+a),h=f[0])}return h}var k={};i.registerStringsSource=function(a){var b=j(a).root;Object.keys(b).forEach(function(c){k[c]?console.error("Key '"+c+"' (loaded from "+a+") already exists. Ignoring."):k[c]=b[c]},this)};j("gcli/nls/strings");i.registerStringsSource("gcli/nls/strings");i.unregisterStringsSource=function(a){a=j(a).root;Object.keys(a).forEach(function(a){delete k[a]},
this)};i.getPreferredLocales=function(){var a=(typeof navigator!=="undefined"?(navigator.language||navigator.userLanguage).toLowerCase():"en-us").split("-"),b=a.map(function(b,e){return a.slice(0,a.length-e).join("-")});b.push("root");return b};i.lookup=function(a){var b=k[a];if(b==null)throw Error("No i18n key: "+a);return b};i.propertyLookup=typeof Proxy!=="undefined"?Proxy.create({get:function(a,b){return i.lookup(b)}}):k;i.lookupSwap=function(a,b){var c=i.lookup(a);return g(c,b)};i.lookupFormat=
function(a,b){var c=i.lookup(a);return d(c,b)};i.lookupPlural=function(a,e,c){var d=b().get(e),a=i.lookup(a)[d],c=c||{};c.ord=e;return g(a,c)};var f=[{locales:"fa,fa-ir,id,ja,ja-jp-mac,ka,ko,ko-kr,th,th-th,tr,tr-tr,zh,zh-tw,zh-cn".split(","),numForms:1,get:function(){return 0}},{locales:"af,af-za,as,ast,bg,br,bs,bs-ba,ca,cy,cy-gb,da,de,de-de,de-ch,en,en-gb,en-us,en-za,el,el-gr,eo,es,es-es,es-ar,es-cl,es-mx,et,et-ee,eu,fi,fi-fi,fy,fy-nl,gl,gl-gl,he,hu,hu-hu,hy,hy-am,it,it-it,kk,ku,lg,mai,ml,ml-in,mn,nb,nb-no,no,no-no,nl,nn,nn-no,no,no-no,nb,nb-no,nso,nso-za,pa,pa-in,pt,pt-pt,rm,rm-ch,si,si-lk,son,son-ml,sq,sq-al,sv,sv-se,vi,vi-vn,zu,zu-za".split(","),
numForms:2,get:function(a){return a!=1?1:0}},{locales:"ak,ak-gh,bn,bn-in,bn-bd,fr,fr-fr,gu,gu-in,kn,kn-in,mr,mr-in,oc,oc-oc,or,or-in,pt-br,ta,ta-in,ta-lk,te,te-in".split(","),numForms:2,get:function(a){return a>1?1:0}},{locales:["lv"],numForms:3,get:function(a){return a%10==1&&a%100!=11?1:a!=0?2:0}},{locales:["gd","gd-gb"],numForms:4,get:function(a){return a==1||a==11?0:a==2||a==12?1:a>0&&a<20?2:3}},{locales:["ro","ro-ro"],numForms:3,get:function(a){return a==1?0:a==0||a%100>0&&a%100<20?1:2}},{locales:["lt"],
numForms:3,get:function(a){return a%10==1&&a%100!=11?0:a%10>=2&&(a%100<10||a%100>=20)?2:1}},{locales:"be,be-by,hr,hr-hr,ru,ru-ru,sr,sr-rs,sr-cs,uk".split(","),numForms:3,get:function(a){return a%10==1&&a%100!=11?0:a%10>=2&&a%10<=4&&(a%100<10||a%100>=20)?1:2}},{locales:["cs","sk"],numForms:3,get:function(a){return a==1?0:a>=2&&a<=4?1:2}},{locales:["pl"],numForms:3,get:function(a){return a==1?0:a%10>=2&&a%10<=4&&(a%100<10||a%100>=20)?1:2}},{locales:["sl"],numForms:4,get:function(a){return a%100==1?
0:a%100==2?1:a%100==3||a%100==4?2:3}},{locales:["ga-ie","ga-ie","ga","en-ie"],numForms:5,get:function(a){return a==1?0:a==2?1:a>=3&&a<=6?2:a>=7&&a<=10?3:4}},{locales:["ar"],numForms:6,get:function(a){return a==0?5:a==1?0:a==2?1:a%100>=3&&a%100<=10?2:a%100>=11&&a%100<=99?3:4}},{locales:["mt"],numForms:4,get:function(a){return a==1?0:a==0||a%100>0&&a%100<=10?1:a%100>10&&a%100<20?2:3}},{locales:["mk","mk-mk"],numForms:3,get:function(a){return a%10==1?0:a%10==2?1:2}},{locales:["is"],numForms:2,get:function(a){return a%
10==1&&a%100!=11?0:1}}],h});
define("gcli/argument",["require","exports","module"],function(j,i){function g(a,b,e){a===void 0?this.suffix=this.prefix=this.text="":(this.text=a,this.prefix=b!==void 0?b:"",this.suffix=e!==void 0?e:"")}function d(){this.suffix=this.prefix=this.text=""}function b(a,e,d){this.text=a!==void 0?a:"";this.prefix=e!==void 0?e:"";this.suffix=d!==void 0?d:"";b._moveSpaces(this)}function k(a,b,e){if(!Array.isArray(a))throw Error("args is not an array of Arguments");this.args=b===void 0?a:a.slice(b,e);a=g.merge(this.args);
this.text=a.text;this.prefix=a.prefix;this.suffix=a.suffix}function f(a){this.arg=a;this.text=a.text;this.prefix=a.prefix;this.suffix=a.suffix}function h(){this.suffix=this.prefix=this.text=""}function a(a,b,e){typeof a==="string"?(this.valueArg=this.nameArg=null,this.text=a,this.prefix=b,this.suffix=e):b==null?(this.nameArg=a,this.valueArg=null,this.text="",this.prefix=this.nameArg.toString(),this.suffix=""):(this.nameArg=a,this.valueArg=b,this.text=this.valueArg.text,this.prefix=this.nameArg.toString()+
this.valueArg.prefix,this.suffix=this.valueArg.suffix)}function e(){this.args=[]}g.prototype.type="Argument";g.prototype.merge=function(a){return new g(this.text+this.suffix+a.prefix+a.text,this.prefix,a.suffix)};g.prototype.beget=function(a){var b=this.text,e=this.prefix,d=this.suffix;if(a.text!=null&&(b=a.text,!a.dontQuote)){var f=b.indexOf(" ")>=0||b.length==0,h=/['"]$/.test(e);f&&!h&&(e+="'",d="'"+d)}a.prefixSpace&&e.charAt(0)!==" "&&(e=" "+e);a.prefixPostSpace&&e.charAt(e.length-1)!==" "&&(e+=
" ");a.suffixSpace&&d.charAt(d.length-1)!==" "&&(d+=" ");return b===this.text&&d===this.suffix&&e===this.prefix?this:new (a.type||g)(b,e,d)};g.prototype.assign=function(a){this.assignment=a};g.prototype.getArgs=function(){return[this]};g.prototype.equals=function(a){return this===a?!0:a==null||!(a instanceof g)?!1:this.text===a.text&&this.prefix===a.prefix&&this.suffix===a.suffix};g.prototype.toString=function(){return this.prefix+this.text+this.suffix};g.merge=function(a,b,e){for(var e=e===void 0?
a.length:e,d,b=b===void 0?0:b;b<e;b++){var f=a[b];d=d?d.merge(f):f}return d};Object.defineProperty(g.prototype,"_summaryJson",{get:function(){return"<"+this.prefix+":"+this.text+":"+this.suffix+"> (a="+(this.assignment==null?"null":this.assignment.param.name)+", t="+this.type+")"},enumerable:!0});i.Argument=g;d.prototype=Object.create(g.prototype);d.prototype.type="BlankArgument";i.BlankArgument=d;b.prototype=Object.create(g.prototype);b.prototype.type="ScriptArgument";b._moveSpaces=function(a){for(;a.text.charAt(0)===
" ";)a.prefix+=" ",a.text=a.text.substring(1);for(;a.text.charAt(a.text.length-1)===" ";)a.suffix=" "+a.suffix,a.text=a.text.slice(0,-1)};b.prototype.beget=function(a){a.type=b;a=g.prototype.beget.call(this,a);b._moveSpaces(a);return a};i.ScriptArgument=b;k.prototype=Object.create(g.prototype);k.prototype.type="MergedArgument";k.prototype.assign=function(a){this.args.forEach(function(b){b.assign(a)},this);this.assignment=a};k.prototype.getArgs=function(){return this.args};k.prototype.equals=function(a){return this===
a?!0:a==null||!(a instanceof k)?!1:this.text===a.text&&this.prefix===a.prefix&&this.suffix===a.suffix};i.MergedArgument=k;f.prototype=Object.create(g.prototype);f.prototype.type="TrueNamedArgument";f.prototype.assign=function(a){this.arg&&this.arg.assign(a);this.assignment=a};f.prototype.getArgs=function(){return[this.arg]};f.prototype.equals=function(a){return this===a?!0:a==null||!(a instanceof f)?!1:this.text===a.text&&this.prefix===a.prefix&&this.suffix===a.suffix};f.prototype.beget=function(a){a.text&&
console.error("Can't change text of a TrueNamedArgument",this,a);a.type=f;a=g.prototype.beget.call(this,a);a.arg=new g(a.text,a.prefix,a.suffix);return a};i.TrueNamedArgument=f;h.prototype=Object.create(g.prototype);h.prototype.type="FalseNamedArgument";h.prototype.getArgs=function(){return[]};h.prototype.equals=function(a){return this===a?!0:a==null||!(a instanceof h)?!1:this.text===a.text&&this.prefix===a.prefix&&this.suffix===a.suffix};i.FalseNamedArgument=h;a.prototype=Object.create(g.prototype);
a.prototype.type="NamedArgument";a.prototype.assign=function(a){this.nameArg.assign(a);this.valueArg!=null&&this.valueArg.assign(a);this.assignment=a};a.prototype.getArgs=function(){return this.valueArg?[this.nameArg,this.valueArg]:[this.nameArg]};a.prototype.equals=function(b){return this===b?!0:b==null?!1:!(b instanceof a)?!1:this.text===b.text&&this.prefix===b.prefix&&this.suffix===b.suffix};a.prototype.beget=function(b){b.type=a;var b=g.prototype.beget.call(this,b),e=/^([\s]*)([^\s]*)([\s]*['"]?)$/.exec(b.prefix);
this.valueArg==null&&b.text===""?(b.nameArg=new g(e[2],e[1],e[3]),b.valueArg=null):(b.nameArg=new g(e[2],e[1],""),b.valueArg=new g(b.text,e[3],b.suffix));return b};i.NamedArgument=a;e.prototype=Object.create(g.prototype);e.prototype.type="ArrayArgument";e.prototype.addArgument=function(a){this.args.push(a)};e.prototype.addArguments=function(a){Array.prototype.push.apply(this.args,a)};e.prototype.getArguments=function(){return this.args};e.prototype.assign=function(a){this.args.forEach(function(b){b.assign(a)},
this);this.assignment=a};e.prototype.getArgs=function(){return this.args};e.prototype.equals=function(a){if(this===a)return!0;if(a==null)return!1;if(a.type!=="ArrayArgument")return!1;if(this.args.length!==a.args.length)return!1;for(var b=0;b<this.args.length;b++)if(!this.args[b].equals(a.args[b]))return!1;return!0};e.prototype.toString=function(){return"{"+this.args.map(function(a){return a.toString()},this).join(",")+"}"};i.ArrayArgument=e});
define("gcli/types","require,exports,module,util/promise,gcli/argument,gcli/argument".split(","),function(j,i){function g(b,e,d,f,h){this.value=b;this.arg=e;if(e==null)throw Error("Missing arg");if(h!=null){b=typeof h==="function"?h():h;if(typeof b.then!=="function")throw Error("predictions is not a promise");b.then(function(a){if(!Array.isArray(a))throw Error("prediction resolves to non array");},console.error)}this._status=d||a.VALID;this.message=f;this.predictions=h}function d(b,e){this.arg=e;
this.conversions=b;this.value=b.map(function(a){return a.value},this);this._status=a.combine(b.map(function(a){return a.getStatus()}));this.message="";this.predictions=[]}function b(){}var k=j("util/promise"),f=j("gcli/argument").Argument,h=j("gcli/argument").BlankArgument,a={VALID:{toString:function(){return"VALID"},valueOf:function(){return 0}},INCOMPLETE:{toString:function(){return"INCOMPLETE"},valueOf:function(){return 1}},ERROR:{toString:function(){return"ERROR"},valueOf:function(){return 2}},
combine:function(){for(var b=a.VALID,e=0;e<arguments.length;e++){var d=arguments[e];Array.isArray(d)&&(d=a.combine.apply(null,d));d>b&&(b=d)}return b}};i.Status=a;g.prototype.assign=function(a){this.arg.assign(a)};g.prototype.isDataProvided=function(){return this.arg.type!=="BlankArgument"};g.prototype.equals=function(a){return this===a?!0:a==null?!1:this.valueEquals(a)&&this.argEquals(a)};g.prototype.valueEquals=function(a){return this.value===a.value};g.prototype.argEquals=function(a){return a==
null?!1:this.arg.equals(a.arg)};g.prototype.getStatus=function(){return this._status};g.prototype.toString=function(){return this.arg.toString()};g.prototype.getPredictions=function(){return typeof this.predictions==="function"?this.predictions():k.resolve(this.predictions||[])};g.prototype.constrainPredictionIndex=function(a){return a==null?k.resolve():this.getPredictions().then(function(b){if(b.length!==0)return a%=b.length,a<0&&(a=b.length+a),a}.bind(this))};g.maxPredictions=11;i.Conversion=g;
d.prototype=Object.create(g.prototype);d.prototype.assign=function(a){this.conversions.forEach(function(b){b.assign(a)},this);this.assignment=a};d.prototype.getStatus=function(a){return a&&a.conversion?a.conversion.getStatus():this._status};d.prototype.isDataProvided=function(){return this.conversions.length>0};d.prototype.valueEquals=function(a){if(!(a instanceof d))throw Error("Can't compare values with non ArrayConversion");if(this.value===a.value)return!0;if(this.value.length!==a.value.length)return!1;
for(var b=0;b<this.conversions.length;b++)if(!this.conversions[b].valueEquals(a.conversions[b]))return!1;return!0};d.prototype.toString=function(){return"[ "+this.conversions.map(function(a){return a.toString()},this).join(", ")+" ]"};i.ArrayConversion=d;b.prototype.stringify=function(){throw Error("Not implemented");};b.prototype.parse=function(){throw Error("Not implemented");};b.prototype.parseString=function(a){return this.parse(new f(a))};b.prototype.name=void 0;b.prototype.increment=function(){};
b.prototype.decrement=function(){};b.prototype.getBlank=function(){return new g(void 0,new h,a.INCOMPLETE,"")};b.prototype.getType=function(){return this};i.Type=b;var e={};i.getTypeNames=function(){return Object.keys(e)};i.registerType=function(a){if(typeof a==="object")if(a instanceof b){if(!a.name)throw Error("All registered types must have a name");e[a.name]=a}else throw Error("Can't registerType using: "+a);else if(typeof a==="function"){if(!a.prototype.name)throw Error("All registered types must have a name");
e[a.prototype.name]=a}else throw Error("Unknown type: "+a);};i.registerTypes=function(a){Object.keys(a).forEach(function(b){var e=a[b];e.name=b;a.registerType(e)})};i.deregisterType=function(a){delete e[a.name]};i.getType=function(a){var b;if(typeof a==="string")return b=e[a],typeof b==="function"&&(b=new b({})),b;if(typeof a==="object"){if(!a.name)throw Error("Missing 'name' member to typeSpec");b=e[a.name];typeof b==="function"&&(b=new b(a));return b}throw Error("Can't extract type from "+a);}});
define("gcli/types/spell",["require","exports","module"],function(j,i){i.correct=function(g,d){if(d.length!==0){var b={},i;d.forEach(function(d){var h=g.length,a=d.length,e=Array(h+1),c=Array(h+1),l=Array(h+1),i,k;for(i=0;i<=h;i++)c[i]=i*1;for(k=1;k<=a;k++){e[0]=k*1;for(i=1;i<=h;i++)e[i]=Math.min(e[i-1]+1,c[i]+1,c[i-1]+(g[i-1]===d[k-1]?0:2)),i>1&&k>1&&g[i-1]===d[k-2]&&d[k-1]===g[i-2]&&(e[i]=Math.min(e[i],l[i-2]+1));i=l;l=c;c=e;e=i}b[d]=c[h]});i=d.sort(function(d,h){return b[d]!==b[h]?b[d]-b[h]:d<
h});if(b[i[0]]<=4)return i[0]}}});
define("gcli/types/selection","require,exports,module,util/promise,util/util,util/l10n,gcli/types,gcli/types,gcli/types,gcli/types,gcli/types/spell,gcli/argument".split(","),function(j,i){function g(a){a&&Object.keys(a).forEach(function(b){this[b]=a[b]},this)}function d(a,b){if(o&&!b){var c=k.defer();setTimeout(function(){k.resolve(a).then(function(a){typeof a==="function"&&(a=d(a(),b));c.resolve(a)})},500);return c.promise}return k.resolve(a).then(function(a){return typeof a==="function"?d(a(),b):
a})}function b(a){if(!Array.isArray(a))throw Error("SelectionType has no lookup or data");return a.map(function(a){return{name:a,value:a}},this)}var k=j("util/promise"),f=j("util/util"),h=j("util/l10n"),a=j("gcli/types"),e=j("gcli/types").Type,c=j("gcli/types").Status,l=j("gcli/types").Conversion,m=j("gcli/types/spell"),n=j("gcli/argument").BlankArgument;i.startup=function(){a.registerType(g)};i.shutdown=function(){a.unregisterType(g)};g.prototype=Object.create(e.prototype);g.prototype.stringify=
function(a){if(a==null)return"";if(this.stringifyProperty!=null)return a[this.stringifyProperty];try{var b=null;f.synchronize(this.getLookup()).some(function(c){return c.value===a?(b=c.name,!0):!1},this);return b}catch(c){return a.toString()}};g.prototype.clearCache=function(){delete this._cachedLookup};g.prototype.getLookup=function(){if(this._cachedLookup!=null)return this._cachedLookup;var a;this.lookup==null?a=d(this.data,this.neverForceAsync).then(b):(a=typeof this.lookup==="function"?this.lookup.bind(this):
this.lookup,a=d(a,this.neverForceAsync));if(this.cacheable&&!o)this._cachedLookup=a;return a};var o=!1;g.prototype._findPredictions=function(a,b){return k.resolve(this.getLookup()).then(function(c){var e=[],d,f,h=l.maxPredictions,g=a.text.toLowerCase();if(b||a.suffix.length>0){var i;for(d=0;d<c.length&&e.length<h;d++)if(f=c[d],f.name===a.text){if(!f.value.exec){i=!0;e=[];break}this._addToPredictions(e,f,a)}if(!i)return e}for(d=0;d<c.length;d++)if(f=c[d],f._gcliLowerName==null)f._gcliLowerName=f.name.toLowerCase();
for(d=0;d<c.length&&e.length<h;d++)f=c[d],f.name===a.text&&this._addToPredictions(e,f,a);for(d=0;d<c.length&&e.length<h;d++)f=c[d],f._gcliLowerName.indexOf(g)===0&&!f.value.hidden&&e.indexOf(f)===-1&&this._addToPredictions(e,f,a);if(e.length<h/2)for(d=0;d<c.length&&e.length<h;d++)f=c[d],f._gcliLowerName.indexOf(g)!==-1&&!f.value.hidden&&e.indexOf(f)===-1&&this._addToPredictions(e,f,a);if(e.length===0){var k=[];c.forEach(function(a){a.value.hidden||k.push(a.name)});var j=m.correct(g,k);j&&c.forEach(function(a){a.name===
j&&e.push(a)},this)}return e}.bind(this))};g.prototype._addToPredictions=function(a,b){a.push(b)};g.prototype.parse=function(a){return this._findPredictions(a).then(function(b){if(b.length===0){var e=h.lookupFormat("typesSelectionNomatch",[a.text]);return new l(void 0,a,c.ERROR,e,k.resolve(b))}this.noMatch&&this.noMatch();return b[0].name===a.text?new l(b[0].value,a,c.VALID,"",k.resolve(b)):new l(void 0,a,c.INCOMPLETE,"",k.resolve(b))}.bind(this))};g.prototype.getBlank=function(){var a=function(){return k.resolve(this.getLookup()).then(function(a){return a.filter(function(a){return!a.value.hidden}).slice(0,
l.maxPredictions-1)},console.error)}.bind(this);return new l(void 0,new n,c.INCOMPLETE,"",a)};g.prototype.decrement=function(a){var b=f.synchronize(this.getLookup()),a=this._findValue(b,a);a===-1&&(a=0);a++;a>=b.length&&(a=0);return b[a].value};g.prototype.increment=function(a){var b=f.synchronize(this.getLookup()),a=this._findValue(b,a);a===-1&&(a=1);a--;a<0&&(a=b.length-1);return b[a].value};g.prototype._findValue=function(a,b){for(var c=-1,e=0;e<a.length;e++)if(a[e].value===b){c=e;break}return c};
g.prototype.name="selection";i.SelectionType=g});
define("gcli/types/basic","require,exports,module,util/promise,util/util,util/l10n,gcli/types,gcli/types,gcli/types,gcli/types,gcli/types,gcli/types/selection,gcli/argument,gcli/argument".split(","),function(j,i){function g(){}function d(a){this._allowFloat=!!a.allowFloat;if(a){if(this._min=a.min,this._max=a.max,this._step=a.step||1,!this._allowFloat&&(this._isFloat(this._min)||this._isFloat(this._max)||this._isFloat(this._step)))throw Error("allowFloat is false, but non-integer values given in type spec");}else this._step=
1}function b(){}function k(a){if(typeof a.delegateType!=="function")throw Error("Instances of DelegateType need typeSpec.delegateType to be a function that returns a type");Object.keys(a).forEach(function(b){this[b]=a[b]},this)}function f(){}function h(a){if(!a.subtype)console.error("Array.typeSpec is missing subtype. Assuming string."+JSON.stringify(a)),a.subtype="string";Object.keys(a).forEach(function(b){this[b]=a[b]},this);this.subtype=l.getType(this.subtype)}var a=j("util/promise"),e=j("util/util"),
c=j("util/l10n"),l=j("gcli/types"),m=j("gcli/types").Type,n=j("gcli/types").Status,o=j("gcli/types").Conversion,p=j("gcli/types").ArrayConversion,u=j("gcli/types/selection").SelectionType,r=j("gcli/argument").BlankArgument,t=j("gcli/argument").ArrayArgument;i.startup=function(){l.registerType(g);l.registerType(d);l.registerType(b);l.registerType(f);l.registerType(k);l.registerType(h)};i.shutdown=function(){l.unregisterType(g);l.unregisterType(d);l.unregisterType(b);l.unregisterType(f);l.unregisterType(k);
l.unregisterType(h)};g.prototype=Object.create(m.prototype);g.prototype.stringify=function(a){return a==null?"":a.toString()};g.prototype.parse=function(b){return b.text==null||b.text===""?a.resolve(new o(void 0,b,n.INCOMPLETE,"")):a.resolve(new o(b.text,b))};g.prototype.name="string";i.StringType=g;d.prototype=Object.create(m.prototype);d.prototype.stringify=function(a){return a==null?"":""+a};d.prototype.getMin=function(){if(this._min){if(typeof this._min==="function")return this._min();if(typeof this._min===
"number")return this._min}};d.prototype.getMax=function(){if(this._max){if(typeof this._max==="function")return this._max();if(typeof this._max==="number")return this._max}};d.prototype.parse=function(b){if(b.text.replace(/^\s*-?/,"").length===0)return a.resolve(new o(void 0,b,n.INCOMPLETE,""));if(!this._allowFloat&&b.text.indexOf(".")!==-1){var e=c.lookupFormat("typesNumberNotInt2",[b.text]);return a.resolve(new o(void 0,b,n.ERROR,e))}e=this._allowFloat?parseFloat(b.text):parseInt(b.text,10);if(isNaN(e))return e=
c.lookupFormat("typesNumberNan",[b.text]),a.resolve(new o(void 0,b,n.ERROR,e));var d=this.getMax();if(d!=null&&e>d)return e=c.lookupFormat("typesNumberMax",[e,d]),a.resolve(new o(void 0,b,n.ERROR,e));d=this.getMin();return d!=null&&e<d?(e=c.lookupFormat("typesNumberMin",[e,d]),a.resolve(new o(void 0,b,n.ERROR,e))):a.resolve(new o(e,b))};d.prototype.decrement=function(a){if(typeof a!=="number"||isNaN(a))return this.getMax()||1;a-=this._step;a=Math.ceil(a/this._step)*this._step;return this._boundsCheck(a)};
d.prototype.increment=function(a){if(typeof a!=="number"||isNaN(a))return a=this.getMin(),a!=null?a:0;a+=this._step;a=Math.floor(a/this._step)*this._step;return this.getMax()==null?a:this._boundsCheck(a)};d.prototype._boundsCheck=function(a){var b=this.getMin();if(b!=null&&a<b)return b;b=this.getMax();return b!=null&&a>b?b:a};d.prototype._isFloat=function(a){return typeof a==="number"&&isFinite(a)&&a%1!==0};d.prototype.name="number";i.NumberType=d;b.prototype=Object.create(u.prototype);b.prototype.lookup=
[{name:"false",value:!1},{name:"true",value:!0}];b.prototype.parse=function(b){return b.type==="TrueNamedArgument"?a.resolve(new o(!0,b)):b.type==="FalseNamedArgument"?a.resolve(new o(!1,b)):u.prototype.parse.call(this,b)};b.prototype.stringify=function(a){return a==null?"":""+a};b.prototype.getBlank=function(){return new o(!1,new r,n.VALID,"",a.resolve(this.lookup))};b.prototype.name="boolean";i.BooleanType=b;k.prototype.delegateType=function(){throw Error("Not implemented");};k.prototype=Object.create(m.prototype);
k.prototype.stringify=function(a){return this.delegateType().stringify(a)};k.prototype.parse=function(a){return this.delegateType().parse(a)};k.prototype.decrement=function(a){var b=this.delegateType();return b.decrement?b.decrement(a):void 0};k.prototype.increment=function(a){var b=this.delegateType();return b.increment?b.increment(a):void 0};k.prototype.getType=function(){return this.delegateType()};Object.defineProperty(k.prototype,"isImportant",{get:function(){return this.delegateType().isImportant},
enumerable:!0});k.prototype.name="delegate";i.DelegateType=k;f.prototype=Object.create(m.prototype);f.prototype.stringify=function(){return""};f.prototype.parse=function(b){return a.resolve(new o(void 0,b))};f.prototype.name="blank";i.BlankType=f;h.prototype=Object.create(m.prototype);h.prototype.stringify=function(a){return a==null?"":a.join(" ")};h.prototype.parse=function(a){if(a.type!=="ArrayArgument")throw console.error("non ArrayArgument to ArrayType.parse",a),Error("non ArrayArgument to ArrayType.parse");
var b=function(a){return this.subtype.parse(a).then(function(b){return a.conversion=b}.bind(this),console.error)}.bind(this),b=a.getArguments().map(b);return e.all(b).then(function(b){return new p(b,a)})};h.prototype.getBlank=function(){return new p([],new t)};h.prototype.name="array";i.ArrayType=h});
define("gcli/canon","require,exports,module,util/promise,util/util,util/l10n,gcli/types,gcli/types,gcli/types/basic,gcli/types/selection".split(","),function(j,i){function g(a,b){if(a==null)return b?f.lookup(b):a;if(typeof a==="string")return a;if(typeof a==="object"){if(a.key)return f.lookup(a.key);var c=f.getPreferredLocales(),e;c.some(function(b){e=a[b];return e!=null});if(e!=null)return e;console.error("Can't find locale in descriptions: locales="+JSON.stringify(c)+", description="+JSON.stringify(a));
return"(No description)"}return f.lookup(b)}function d(a){Object.keys(a).forEach(function(b){this[b]=a[b]},this);if(!this.name)throw Error("All registered commands must have a name");if(this.params==null)this.params=[];if(!Array.isArray(this.params))throw Error("command.params must be an array in "+this.name);this.hasNamedParameters=!1;this.description="description"in this?this.description:void 0;this.description=g(this.description,"canonDescNone");this.manual="manual"in this?this.manual:void 0;this.manual=
g(this.manual);var c=this.params;this.params=[];var e=!1;if(this.returnType==null)this.returnType="string";c.forEach(function(a){if(a.group)a.params.forEach(function(c){c=new b(c,this,a.group);this.params.push(c);if(!c.isPositionalAllowed)this.hasNamedParameters=!0},this),e=!0;else if(e)throw Error("Parameters can't come after param groups. Ignoring "+this.name+"/"+a.name);else{var c=new b(a,this,null);this.params.push(c);if(!c.isPositionalAllowed)this.hasNamedParameters=!0}},this)}function b(b,c,
d){this.command=c||{name:"unnamed"};this.paramSpec=b;this.name=this.paramSpec.name;this.type=this.paramSpec.type;this.groupName=d;if(!this.name)throw Error("In "+this.command.name+": all params must have a name");b=this.type;this.type=h.getType(b);if(this.type==null)throw console.error("Known types: "+h.getTypeNames().join(", ")),Error("In "+this.command.name+"/"+this.name+": can't find type for: "+JSON.stringify(b));if(this.type instanceof e&&this.paramSpec.defaultValue!==void 0)throw Error("In "+
this.command.name+"/"+this.name+": boolean parameters can not have a defaultValue. Ignoring");if(this._defaultValue!=null)try{this.type.parseString(this.type.stringify(this.paramSpec.defaultValue)).then(function(b){b.getStatus()!==a.VALID&&console.error("In "+this.command.name+"/"+this.name+": Error round tripping defaultValue. status = "+b.getStatus())}.bind(this),console.error)}catch(f){throw Error("In "+this.command.name+"/"+this.name+": "+f);}if(!this.isPositionalAllowed&&this.paramSpec.defaultValue===
void 0&&this.type.getBlank==null&&!(this.type instanceof e))throw Error("In "+this.command.name+"/"+this.name+": Missing defaultValue for optional parameter.");}j("util/promise");var k=j("util/util"),f=j("util/l10n"),h=j("gcli/types"),a=j("gcli/types").Status,e=j("gcli/types/basic").BooleanType;j("gcli/types/selection");i.Command=d;Object.defineProperty(b.prototype,"defaultValue",{get:function(){if(!("_defaultValue"in this))this._defaultValue=this.paramSpec.defaultValue!==void 0?this.paramSpec.defaultValue:
this.type.getBlank().value;return this._defaultValue},enumerable:!0});b.prototype.isKnownAs=function(a){return a==="--"+this.name?!0:!1};b.prototype.getBlank=function(){return this.type.getBlank()};Object.defineProperty(b.prototype,"manual",{get:function(){return g(this.paramSpec.manual||void 0)},enumerable:!0});Object.defineProperty(b.prototype,"description",{get:function(){return g(this.paramSpec.description||void 0,"canonDescNone")},enumerable:!0});Object.defineProperty(b.prototype,"isDataRequired",
{get:function(){return this.defaultValue===void 0},enumerable:!0});Object.defineProperty(b.prototype,"hidden",{get:function(){return this.paramSpec.hidden},enumerable:!0});Object.defineProperty(b.prototype,"isPositionalAllowed",{get:function(){return this.groupName==null},enumerable:!0});i.Parameter=b;var c={},l=[],m={};i.addCommand=function(a){c[a.name]!=null&&(delete c[a.name],l=l.filter(function(b){return b!==a.name}));var b=new d(a);c[a.name]=b;l.push(a.name);l.sort();m[a.name]=a;i.onCanonChange();
return b};i.removeCommand=function(a){var b=typeof a==="string"?a:a.name;if(!c[b])return!1;delete c[b];delete m[b];l=l.filter(function(a){return a!==b});i.onCanonChange();return!0};i.getCommand=function(a){return c[a]||void 0};i.getCommands=function(){return Object.keys(c).map(function(a){return c[a]},this)};i.getCommandNames=function(){return l.slice(0)};i.getCommandSpecs=function(){return m};i.onCanonChange=k.createEvent("canon.onCanonChange");i.CommandOutputManager=function(){this.onOutput=k.createEvent("CommandOutputManager.onOutput")}});
define("gcli/types/command","require,exports,module,util/promise,util/l10n,gcli/canon,gcli/types,gcli/types/selection,gcli/types,gcli/types".split(","),function(j,i){function g(a){this.requisition=a.requisition;this.isIncompleteName=a.isIncompleteName;this.stringifyProperty="name";this.neverForceAsync=!0}function d(){this.stringifyProperty="name";this.neverForceAsync=!0}var b=j("util/promise"),k=j("util/l10n"),f=j("gcli/canon"),h=j("gcli/types"),a=j("gcli/types/selection").SelectionType,e=j("gcli/types").Status,
c=j("gcli/types").Conversion;i.startup=function(){h.registerType(d);h.registerType(g)};i.shutdown=function(){h.unregisterType(d);h.unregisterType(g)};g.prototype=Object.create(a.prototype);g.prototype.name="param";g.prototype.lookup=function(){var a=[],b=this.requisition.commandAssignment.value;b!=null&&b.params.forEach(function(b){var c=this.requisition.getAssignment(b.name).arg;!b.isPositionalAllowed&&c.type==="BlankArgument"&&a.push({name:"--"+b.name,value:b})},this);return a};g.prototype.parse=
function(d,f){if(this.isIncompleteName)return a.prototype.parse.call(this,d);else{var h=k.lookup("cliUnusedArg");if(f){var g=f.commandAssignment.conversion;if(g.getStatus()===e.ERROR&&g.message)h=g.message}return b.resolve(new c(void 0,d,e.ERROR,h))}};d.prototype=Object.create(a.prototype);d.prototype.name="command";d.prototype.lookup=function(){var a=f.getCommands();a.sort(function(a,b){return a.name.localeCompare(b.name)});return a.map(function(a){return{name:a.name,value:a}},this)};d.prototype._addToPredictions=
function(a,b,c){(c.text.length!==0||b.name.indexOf(" ")===-1)&&a.push(b)};d.prototype.parse=function(a,b){var d=function(){return this._findPredictions(a,b)}.bind(this);return this._findPredictions(a,b).then(function(b){if(b.length===0)return b=k.lookupFormat("typesSelectionNomatch",[a.text]),new c(void 0,a,e.ERROR,b,d);var f=b[0].value;return b.length===1?f.name===a.text&&typeof f.exec==="function"?new c(f,a,e.VALID,""):new c(void 0,a,e.INCOMPLETE,"",d):b[0].name===a.text?new c(f,a,e.VALID,"",d):
new c(void 0,a,e.INCOMPLETE,"",d)}.bind(this))}});
define("gcli/types/javascript","require,exports,module,util/promise,util/l10n,gcli/types".split(","),function(j,i){var g,d;function b(){}function k(a){return a.indexOf("moz")===0||a.indexOf("webkit")===0||a.indexOf("ms")===0}var f=j("util/promise"),h=j("util/l10n"),a=j("gcli/types"),e=a.Conversion,c=a.Type,l=a.Status;i.startup=function(){a.registerType(b)};i.shutdown=function(){a.unregisterType(b)};var m=void 0;typeof window!=="undefined"&&(m=window);i.setGlobalObject=function(a){m=a};i.getGlobalObject=
function(){return m};i.unsetGlobalObject=function(){m=void 0};b.prototype=Object.create(c.prototype);b.prototype.stringify=function(a){return a==null?"":a};b.MAX_COMPLETION_MATCHES=10;b.prototype.parse=function(a){var c=a.text,i=m;if(c==="")return f.resolve(new e(void 0,a,l.INCOMPLETE));if(!isNaN(parseFloat(c))&&isFinite(c))return f.resolve(new e(c,a));if(c.trim().match(/(null|undefined|NaN|Infinity|true|false)/))return f.resolve(new e(c,a));var j=this._findCompletionBeginning(c);if(j.err)return f.resolve(new e(c,
a,l.ERROR,j.err));if(j.state===g)return f.resolve(new e(c,a));if(j.state!==d)return f.resolve(new e(c,a,l.INCOMPLETE,""));var j=c.substring(j.startPos).split("."),n,o=void 0;if(j.length>1){n=j.pop().trimLeft();for(var p=0;p<j.length;p++){o=j[p].trim();if(i==null)return f.resolve(new e(c,a,l.ERROR,h.lookup("jstypeParseScope")));if(o==="")return f.resolve(new e(c,a,l.INCOMPLETE,""));if(this._isSafeProperty(i,o))return f.resolve(new e(c,a));try{i=i[o]}catch(u){return f.resolve(new e(c,a,l.VALID,""))}}}else n=
j[0].trimLeft();if(o&&!o.match(/^[0-9A-Za-z]*$/))return f.resolve(new e(c,a));if(i==null)return j=h.lookupFormat("jstypeParseMissing",[o]),f.resolve(new e(c,a,l.ERROR,j));if(!n.match(/^[0-9A-Za-z]*$/))return f.resolve(new e(c,a));if(this._isIteratorOrGenerator(i))return f.resolve(new e(c,a));var j=n.length,D=j===0?c:c.slice(0,-j),z=l.INCOMPLETE,j="",s={},y=0,o=i;try{for(;o!=null&&Object.keys(s).length<b.MAX_COMPLETION_MATCHES;)Object.keys(o).forEach(function(a){a.indexOf(n)===0&&!(a in s)&&(s[a]=
{prop:a,distUpPrototypeChain:y})}),y++,o=Object.getPrototypeOf(o)}catch(x){return f.resolve(new e(c,a,l.INCOMPLETE,""))}s=Object.keys(s).map(function(a){if(a===n)z=l.VALID;return s[a]});s.sort(function(a,b){return a.distUpPrototypeChain!==b.distUpPrototypeChain?a.distUpPrototypeChain-b.distUpPrototypeChain:k(a.prop)?k(b.prop)?a.prop.localeCompare(b.prop):1:k(b.prop)?-1:a.prop.localeCompare(b.prop)});s.length>b.MAX_COMPLETION_MATCHES&&(s=s.slice(0,b.MAX_COMPLETION_MATCHES-1));o=s.map(function(a){var b,
c=!0;if(this._isSafeProperty(i,a.prop))b="(property getter)";else try{var e=i[a.prop];typeof e==="function"?b="(function)":typeof e==="boolean"||typeof e==="number"?(b="= "+e,c=!1):typeof e==="string"?(e.length>40&&(e=e.substring(0,37)+"\u2026"),b="= '"+e+"'",c=!1):b="("+typeof e+")"}catch(d){b="("+h.lookup("jstypeParseError")+")"}return{name:D+a.prop,value:{name:D+a.prop,description:b},description:b,incomplete:c}},this);if(o.length===0)z=l.ERROR,j=h.lookupFormat("jstypeParseMissing",[n]);o.length===
1&&z===l.VALID&&(o=[]);return f.resolve(new e(c,a,z,j,f.resolve(o)))};d=0;g=1;var n="{[(".split(""),o="}])".split(""),p={"{":"}","[":"]","(":")"},u=/[a-zA-Z0-9.]/;b.prototype._findCompletionBeginning=function(a){for(var b=[],c=d,e=0,f,l=!1,i=0;i<a.length;i++)switch(f=a[i],u.test(f)||(l=!0),c){case d:if(f==='"')c=3;else if(f==="'")c=2;else if(f===";")e=i+1;else if(f===" ")e=i+1;else if(n.indexOf(f)!=-1)b.push({token:f,start:e}),e=i+1;else if(o.indexOf(f)!=-1){e=b.pop();if(!e||p[e.token]!=f)return{err:h.lookup("jstypeBeginSyntax")};
e=f==="}"?i+1:e.start}break;case 3:if(f==="\\")i++;else if(f==="\n")return{err:h.lookup("jstypeBeginUnterm")};else f==='"'&&(c=d);break;case 2:if(f==="\\")i++;else if(f==="\n")return{err:h.lookup("jstypeBeginUnterm")};else f==="'"&&(c=d)}c===d&&l&&(c=g);return{state:c,startPos:e}};b.prototype._isIteratorOrGenerator=function(a){if(a===null)return!1;if(typeof aObject==="object"){if(typeof a.__iterator__==="function"||a.constructor&&a.constructor.name==="Iterator")return!0;try{var b=a.toString();if(typeof a.next===
"function"&&b.indexOf("[object Generator")===0)return!0}catch(c){}}return!1};b.prototype._isSafeProperty=function(a,b){if(typeof a!=="object")return!1;for(var c=void 0;a;){try{if(c=Object.getOwnPropertyDescriptor(a,b))break}catch(e){return e.name==="NS_ERROR_XPC_BAD_CONVERT_JS"||e.name==="NS_ERROR_XPC_BAD_OP_ON_WN_PROTO"?!1:!0}a=Object.getPrototypeOf(a)}return!c?!1:!c.get?!1:typeof c.get!=="function"||"prototype"in c.get};b.prototype.name="javascript";i.JavascriptType=b});
define("util/host",["require","exports","module"],function(j,i){function g(d,b){if(!d.__gcliHighlighting){d.__gcliHighlighting=!0;var g=d.style.background;d.style.background=b?"green":"red";setTimeout(function(){d.style.background=g;delete d.__gcliHighlighting},500)}}i.flashNodes=function(d,b){d.style?g(d,b):Array.prototype.forEach.call(d,function(d){g(d,b)})};i.exec=function(d,b){var g=JSON.stringify(b),f=new XMLHttpRequest;f.open("POST","/exec/",!0);f.setRequestHeader("Content-Type","application/json; charset=utf-8");
f.setRequestHeader("Content-Length",g.length);f.onreadystatechange=function(){f.readyState==4&&(f.status>=300||f.status<200?d.reject(f.responseText):d.resolve(f.responseText))};f.send(g)};i.func=function(d,b){var g=JSON.stringify(b),f=new XMLHttpRequest;f.open("POST","/func/",!0);f.setRequestHeader("Content-Type","application/json; charset=utf-8");f.setRequestHeader("Content-Length",g.length);f.onreadystatechange=function(){f.readyState==4&&(f.status>=300||f.status<200?d.reject(JSON.parse(f.responseText)):
d.resolve(JSON.parse(f.responseText)))};f.send(g)}});
define("gcli/types/node","require,exports,module,util/promise,util/host,util/l10n,gcli/types,gcli/types,gcli/types,gcli/types,gcli/argument".split(","),function(j,i){function g(){}function d(a){if("allowEmpty"in a&&typeof a.allowEmpty!=="boolean")throw Error("Legal values for allowEmpty are [true|false]");this.allowEmpty=a.allowEmpty}var b=j("util/promise"),k=j("util/host"),f=j("util/l10n"),h=j("gcli/types"),a=j("gcli/types").Type,e=j("gcli/types").Status,c=j("gcli/types").Conversion,l=j("gcli/argument").BlankArgument;
i.startup=function(){h.registerType(g);h.registerType(d)};i.shutdown=function(){h.unregisterType(g);h.unregisterType(d)};var m=void 0;typeof document!=="undefined"&&(m=document);i._empty=[];i.setDocument=function(a){m=a;if(m!=null)i._empty=m.querySelectorAll("x>:root")};i.unsetDocument=function(){m=void 0;i._empty=void 0};i.getDocument=function(){return m};g.prototype=Object.create(a.prototype);g.prototype.stringify=function(a){return a==null?"":a.__gcliQuery||"Error"};g.prototype.parse=function(a){if(a.text===
"")return b.resolve(new c(void 0,a,e.INCOMPLETE));var d;try{d=m.querySelectorAll(a.text)}catch(h){return b.resolve(new c(void 0,a,e.ERROR,f.lookup("nodeParseSyntax")))}if(d.length===0)return b.resolve(new c(void 0,a,e.INCOMPLETE,f.lookup("nodeParseNone")));if(d.length===1)return d=d.item(0),d.__gcliQuery=a.text,k.flashNodes(d,!0),b.resolve(new c(d,a,e.VALID,""));k.flashNodes(d,!1);d=f.lookupFormat("nodeParseMultiple",[d.length]);return b.resolve(new c(void 0,a,e.ERROR,d))};g.prototype.name="node";
d.prototype=Object.create(a.prototype);d.prototype.getBlank=function(){return new c(i._empty,new l,e.VALID)};d.prototype.stringify=function(a){return a==null?"":a.__gcliQuery||"Error"};d.prototype.parse=function(a){if(a.text==="")return b.resolve(new c(void 0,a,e.INCOMPLETE));var d;try{d=m.querySelectorAll(a.text)}catch(h){return b.resolve(new c(void 0,a,e.ERROR,f.lookup("nodeParseSyntax")))}if(d.length===0&&!this.allowEmpty)return b.resolve(new c(void 0,a,e.INCOMPLETE,f.lookup("nodeParseNone")));
k.flashNodes(d,!1);return b.resolve(new c(d,a,e.VALID,""))};d.prototype.name="nodelist"});
define("gcli/types/resource","require,exports,module,util/promise,gcli/types,gcli/types/selection".split(","),function(j,i){function g(a,b,c,e){this.name=a;this.type=b;this.inline=c;this.element=e}function d(a){this.name=a.href;if(!this.name)this.name=a.ownerNode.id?"css#"+a.ownerNode.id:"inline-css";this.inline=a.href==null;this.type=g.TYPE_CSS;this.element=a}function b(a){this.name=a.src;if(!this.name)this.name=a.id?"script#"+a.id:"inline-script";this.inline=a.src===""||a.src==null;this.type=g.TYPE_SCRIPT;
this.element=a}function k(a,b){var c={};a.forEach(function(a){c[a.name]==null&&(c[a.name]=[]);c[a.name].push(a)});Object.keys(c).forEach(function(a){a=c[a];a.length>1&&b(a)})}function f(a){this.include=a.include;if(this.include!==g.TYPE_SCRIPT&&this.include!==g.TYPE_CSS&&this.include!=null)throw Error("invalid include property: "+this.include);}var h=j("util/promise"),a=j("gcli/types"),e=j("gcli/types/selection").SelectionType;i.startup=function(){a.registerType(f)};i.shutdown=function(){a.unregisterType(f);
i.clearResourceCache()};i.clearResourceCache=function(){l.clear()};var c=void 0;typeof document!=="undefined"&&(c=document);i.setDocument=function(a){c=a};i.unsetDocument=function(){l.clear();c=void 0};i.getDocument=function(){return c};g.prototype.getContents=function(){throw Error("not implemented");};g.TYPE_SCRIPT="text/javascript";g.TYPE_CSS="text/css";d.prototype=Object.create(g.prototype);d.prototype.loadContents=function(a){a(this.element.ownerNode.innerHTML)};d._getAllStyles=function(){var a=
[];if(c==null)return a;Array.prototype.forEach.call(c.styleSheets,function(b){d._getStyle(b,a)});k(a,function(a){for(var b=0;b<a.length;b++)a[b].name=a[b].name+"-"+b});return a};d._getStyle=function(a,b){var c=l.get(a);c||(c=new d(a),l.add(a,c));b.push(c);try{Array.prototype.forEach.call(a.cssRules,function(a){a.type==CSSRule.IMPORT_RULE&&a.styleSheet&&d._getStyle(a.styleSheet,b)},this)}catch(e){}};b.prototype=Object.create(g.prototype);b.prototype.loadContents=function(a){if(this.inline)a(this.element.innerHTML);
else{var b=new XMLHttpRequest;b.onreadystatechange=function(){b.readyState===b.DONE&&a(b.responseText)};b.open("GET",this.element.src,!0);b.send()}};b._getAllScripts=function(){if(c==null)return[];var a=c.querySelectorAll("script"),a=Array.prototype.map.call(a,function(a){var c=l.get(a);c||(c=new b(a),l.add(a,c));return c});k(a,function(a){for(var b=0;b<a.length;b++)a[b].name=a[b].name+"-"+b});return a};f.prototype=Object.create(e.prototype);f.prototype.getLookup=function(){var a=[];this.include!==
g.TYPE_SCRIPT&&Array.prototype.push.apply(a,d._getAllStyles());this.include!==g.TYPE_CSS&&Array.prototype.push.apply(a,b._getAllScripts());return h.resolve(a.map(function(a){return{name:a.name,value:a}}))};f.prototype.name="resource";var l={_cached:[],get:function(a){for(var b=0;b<l._cached.length;b++)if(l._cached[b].node===a)return l._cached[b].resource;return null},add:function(a,b){l._cached.push({node:a,resource:b})},clear:function(){l._cached=[]}}});
define("gcli/settings",["require","exports","module","util/util","gcli/types"],function(j,i){function g(){}function d(a,c,d,f){this.name=a;this.type=c;this.description=d;this._defaultValue=f;this.onChange=b.createEvent("Setting.onChange");this.setDefault()}var b=j("util/util"),k=j("gcli/types"),f={},h={},a;i.setDefaults=function(a){Object.keys(a).forEach(function(b){h[b]===void 0&&(h[b]=a[b])})};i.startup=function(){a=new g;a.load(h)};i.shutdown=function(){};i.getAll=function(a){var b=[];Object.keys(f).forEach(function(d){(a==
null||d.indexOf(a)!==-1)&&b.push(f[d])}.bind(this));b.sort(function(a,b){return a.name.localeCompare(b.name)}.bind(this));return b};i.addSetting=function(a){var b=k.getType(a.type),a=new d(a.name,b,a.description,a.defaultValue);f[a.name]=a;i.onChange({added:a.name});return a};i.getSetting=function(a){return f[a]};i.removeSetting=function(a){a=typeof nameOrPrefSpec==="string"?a:a.name;delete f[a];i.onChange({removed:a})};i.onChange=b.createEvent("Settings.onChange");g.prototype.load=function(a){if(typeof localStorage!==
"undefined"){var b=localStorage.getItem("gcli-settings");if(b!=null){var d=JSON.parse(b);Object.keys(d).forEach(function(b){a[b]=d[b]})}}};g.prototype.save=function(a){typeof localStorage!=="undefined"&&(a=JSON.stringify(a),localStorage.setItem("gcli-settings",a))};i.LocalSettingStorage=g;d.prototype.setDefault=function(){this.value=this._defaultValue};Object.defineProperty(d.prototype,"value",{get:function(){return h[this.name]},set:function(b){h[this.name]=b;a.save(h);this.onChange({setting:this,
value:b})},enumerable:!0})});
define("gcli/types/setting","require,exports,module,gcli/settings,gcli/types,gcli/types/selection,gcli/types/basic".split(","),function(j,i){function g(){b.onChange.add(function(){this.clearCache()},this)}function d(){}var b=j("gcli/settings"),k=j("gcli/types"),f=j("gcli/types/selection").SelectionType,h=j("gcli/types/basic").DelegateType;i.startup=function(){k.registerType(g);k.registerType(d)};i.shutdown=function(){k.unregisterType(g);k.unregisterType(d)};var a=null;g.prototype=new f({cacheable:!0});
g.prototype.lookup=function(){return b.getAll().map(function(a){return{name:a.name,value:a}})};g.prototype.noMatch=function(){a=null};g.prototype.stringify=function(b){a=b;return f.prototype.stringify.call(this,b)};g.prototype.parse=function(b){b=f.prototype.parse.call(this,b);b.then(function(b){a=b.value});return b};g.prototype.name="setting";d.prototype=Object.create(h.prototype);d.prototype.delegateType=function(){return a!=null?a.type:k.getType("blank")};d.prototype.name="settingValue"});
define("util/domtemplate",["require","exports","module"],function(j,i){function g(b,g,f){f=new d(f||{});f.processNode(b,g);return f}function d(b){b==null&&(b={allowEval:!0});this.options=b;this.stack=b.stack&&Array.isArray(b.stack)?b.stack:typeof b.stack==="string"?[b.stack]:[];this.nodes=[]}d.prototype._templateRegion=/\$\{([^}]*)\}/g;d.prototype._splitSpecial=/\uF001|\uF002/;d.prototype._isPropertyScript=/^[_a-zA-Z0-9.]*$/;d.prototype.processNode=function(b,d){typeof b==="string"&&(b=document.getElementById(b));
d==null&&(d={});this.stack.push(b.nodeName+(b.id?"#"+b.id:""));var f=!1;try{if(b.attributes&&b.attributes.length){if(b.hasAttribute("foreach")){this._processForEach(b,d);return}if(b.hasAttribute("if")&&!this._processIf(b,d))return;this.nodes.push(d.__element);d.__element=b;for(var f=!0,h=Array.prototype.slice.call(b.attributes),a=0;a<h.length;a++){var e=h[a].value,c=h[a].name;this.stack.push(c);try{if(c==="save")e=this._stripBraces(e),this._property(e,d,b),b.removeAttribute("save");else if(c.substring(0,
2)==="on")if(e.substring(0,2)==="${"&&e.slice(-1)==="}"&&e.indexOf("${",2)===-1){var e=this._stripBraces(e),g=this._property(e,d);if(typeof g==="function"){b.removeAttribute(c);var i=b.hasAttribute("capture"+c.substring(2));b.addEventListener(c.substring(2),g,i);i&&b.removeAttribute("capture"+c.substring(2))}else b.setAttribute(c,g)}else b.setAttribute(c,this._processString(e,d));else{b.removeAttribute(c);c.charAt(0)==="_"&&(c=c.substring(1));var j;e.indexOf("${")===0&&e.charAt(e.length-1)==="}"?
(j=this._envEval(e.slice(2,-1),d,e))&&typeof j.then==="function"?(b.setAttribute(c,""),j.then(function(a){b.setAttribute(c,a)}.bind(this)).then(null,console.error)):(this.options.blankNullUndefined&&j==null&&(j=""),b.setAttribute(c,j)):b.setAttribute(c,this._processString(e,d))}}finally{this.stack.pop()}}}for(var o=Array.prototype.slice.call(b.childNodes),h=0;h<o.length;h++)this.processNode(o[h],d);b.nodeType===3&&this._processTextNode(b,d)}finally{if(f)d.__element=this.nodes.pop();this.stack.pop()}};
d.prototype._processString=function(b,d){return b.replace(this._templateRegion,function(f){f=this._envEval(f.slice(2,-1),d,b);return this.options.blankNullUndefined&&f==null?"":f}.bind(this))};d.prototype._processIf=function(b,d){this.stack.push("if");try{var f=b.getAttribute("if"),h=this._stripBraces(f),a=!0;try{a=!!this._envEval(h,d,f)}catch(e){this._handleError("Error with '"+h+"'",e),a=!1}a||b.parentNode.removeChild(b);b.removeAttribute("if");return a}finally{this.stack.pop()}};d.prototype._processForEach=
function(b,d){this.stack.push("foreach");try{var f=b.getAttribute("foreach"),h=f,a="param";if(h.charAt(0)==="$")h=this._stripBraces(h);else var e=h.split(" in "),a=e[0].trim(),h=this._stripBraces(e[1].trim());b.removeAttribute("foreach");try{this._handleAsync(this._envEval(h,d,f),b,function(c,e){this._processForEachLoop(c,b,e,d,a)}.bind(this)),b.parentNode.removeChild(b)}catch(c){this._handleError("Error with '"+h+"'",c)}}finally{this.stack.pop()}};d.prototype._processForEachLoop=function(b,d,f,h,
a){if(Array.isArray(b))b.forEach(function(b,e){this._processForEachMember(b,d,f,h,a,""+e)},this);else for(var e in b)b.hasOwnProperty(e)&&this._processForEachMember(e,d,f,h,a,e)};d.prototype._processForEachMember=function(b,d,f,h,a,e){this.stack.push(e);try{this._handleAsync(b,f,function(b,e){h[a]=b;if(e.parentNode!=null)if(d.nodeName.toLowerCase()==="loop")for(var f=0;f<d.childNodes.length;f++){var g=d.childNodes[f].cloneNode(!0);e.parentNode.insertBefore(g,e);this.processNode(g,h)}else g=d.cloneNode(!0),
g.removeAttribute("foreach"),e.parentNode.insertBefore(g,e),this.processNode(g,h);delete h[a]}.bind(this))}finally{this.stack.pop()}};d.prototype._processTextNode=function(b,d){var f=b.data,f=f.replace(this._templateRegion,"\uf001$$$1\uf002"),f=f.split(this._splitSpecial);f.length>1&&(f.forEach(function(f){f===null||f===void 0||f===""||(f.charAt(0)==="$"&&(f=this._envEval(f.slice(1),d,b.data)),this._handleAsync(f,b,function(a,b){var c=b.ownerDocument;a==null&&(a=this.options.blankNullUndefined?"":
""+a);typeof a.cloneNode==="function"?(a=this._maybeImportNode(a,c),b.parentNode.insertBefore(a,b)):typeof a.item==="function"&&a.length?Array.prototype.slice.call(a,0).forEach(function(a){a=this._maybeImportNode(a,c);b.parentNode.insertBefore(a,b)}.bind(this)):(a=c.createTextNode(a.toString()),b.parentNode.insertBefore(a,b))}.bind(this)))},this),b.parentNode.removeChild(b))};d.prototype._maybeImportNode=function(b,d){return b.ownerDocument===d?b:d.importNode(b,!0)};d.prototype._handleAsync=function(b,
d,f){if(b!=null&&typeof b.then==="function"){var g=d.ownerDocument.createElement("span");d.parentNode.insertBefore(g,d);b.then(function(a){f(a,g);g.parentNode!=null&&g.parentNode.removeChild(g)}.bind(this)).then(null,function(a){console.error(a.stack)})}else f(b,d)};d.prototype._stripBraces=function(b){return!b.match(this._templateRegion)?(this._handleError("Expected "+b+" to match ${...}"),b):b.slice(2,-1)};d.prototype._property=function(b,d,f){try{typeof b==="string"&&(b=b.split("."));var g=d[b[0]];
if(b.length===1)return f!==void 0&&(d[b[0]]=f),typeof g==="function"?g.bind(d):g;return!g?(this._handleError('"'+b[0]+'" is undefined'),null):this._property(b.slice(1),g,f)}catch(a){return this._handleError("Path error with '"+b+"'",a),"${"+b+"}"}};d.prototype._envEval=function(b,d,f){try{if(this.stack.push(f.replace(/\s+/g," ")),this._isPropertyScript.test(b))return this._property(b,d);else{if(!this.options.allowEval)return this._handleError("allowEval is not set, however '"+b+"' can not be resolved using a simple property path."),
"${"+b+"}";with(d)return eval(b)}}catch(g){return this._handleError("Template error evaluating '"+b+"'",g),"${"+b+"}"}finally{this.stack.pop()}};d.prototype._handleError=function(b,d){this._logError(b+" (In: "+this.stack.join(" > ")+")");d&&this._logError(d)};d.prototype._logError=function(b){console.log(b)};if(typeof i!=="undefined")i.template=g});
define("gcli/ui/view",["require","exports","module","util/util","util/domtemplate"],function(j,i){var g=j("util/util"),d=j("util/domtemplate");i.createView=function(b){if(b.html==null)throw Error("options.html is missing");return{isView:!0,appendTo:function(b,d){d===!0&&g.clearElement(b);b.appendChild(this.toDom(b.ownerDocument))},toDom:function(i){b.css&&g.importCss(b.css,i,b.cssId);i=g.toDom(i,b.html);d.template(i,b.data||{},b.options||{});return i}}}});
define("gcli/cli","require,exports,module,util/promise,util/util,util/l10n,gcli/ui/view,gcli/canon,gcli/canon,gcli/types,gcli/types,gcli/types/basic,gcli/types/basic,gcli/types/basic,gcli/types/basic,gcli/argument,gcli/argument,gcli/argument,gcli/argument,gcli/argument,gcli/argument".split(","),function(j,i){function g(a,b){this.param=a;this.conversion=void 0;this.paramIndex=b;this.onAssignmentChange=e.createEvent("Assignment.onAssignmentChange")}function d(){var a={name:"__command",type:"command"},
b=this;Object.defineProperty(a,"description",{get:function(){var a=b.value;return a&&a.description?a.description:"The command to execute"},enumerable:!0});this.param=new m.Parameter(a);this.paramIndex=-1;this.onAssignmentChange=e.createEvent("CommandAssignment.onAssignmentChange")}function b(a,b){this.param=new m.Parameter({name:"__unassigned",description:c.lookup("cliOptions"),type:{name:"param",requisition:a,isIncompleteName:b.text.charAt(0)==="-"}});this.paramIndex=-1;this.onAssignmentChange=e.createEvent("UnassignedAssignment.onAssignmentChange");
this.conversion=e.synchronize(this.param.type.parse(b,a));this.conversion.assign(this)}function k(a,b,c){this.environment=a;this.document=b;if(this.document==null)try{this.document=document}catch(f){}this.commandOutputManager=c||new n;this.commandAssignment=new d;a=this.setAssignment(this.commandAssignment,null,{skipArgUpdate:!0});e.synchronize(a);this._assignments={};this.assignmentCount=0;this._args=[];this._unassigned=[];this._structuralChangeInProgress=!1;this.commandAssignment.onAssignmentChange.add(this._commandAssignmentChanged,
this);this.commandAssignment.onAssignmentChange.add(this._assignmentChanged,this);this.onAssignmentChange=e.createEvent("Requisition.onAssignmentChange");this.onTextChange=e.createEvent("Requisition.onTextChange")}function f(a){for(var b=0;b<a.length;b++){var c=a.charAt(b);if(c===" "||c==='"'||c==="'"||c==="{"||c==="}"||c==="\\")return!1}return!0}function h(b){b=b||{};this.command=b.command||"";this.args=b.args||{};this.typed=b.typed||"";this.canonical=b.canonical||"";this.hidden=b.hidden===!0?!0:
!1;this.data=void 0;this.error=this.completed=!1;this.start=new Date;this.deferred=a.defer();this.then=this.deferred.promise.then;this.onClose=e.createEvent("Output.onClose");this.onChange=e.createEvent("Output.onChange")}var a=j("util/promise"),e=j("util/util"),c=j("util/l10n"),l=j("gcli/ui/view"),m=j("gcli/canon"),n=j("gcli/canon").CommandOutputManager,o=j("gcli/types").Status,p=j("gcli/types").Conversion,u=j("gcli/types/basic").ArrayType,r=j("gcli/types/basic").StringType,t=j("gcli/types/basic").BooleanType,
q=j("gcli/types/basic").NumberType,v=j("gcli/argument").Argument,w=j("gcli/argument").ArrayArgument,C=j("gcli/argument").NamedArgument,B=j("gcli/argument").TrueNamedArgument,E=j("gcli/argument").MergedArgument,D=j("gcli/argument").ScriptArgument,z;i.startup=function(){z=m.addCommand(y)};i.shutdown=function(){m.removeCommand(y.name);z=void 0};Object.defineProperty(g.prototype,"arg",{get:function(){return this.conversion.arg},enumerable:!0});Object.defineProperty(g.prototype,"value",{get:function(){return this.conversion.value},
enumerable:!0});g.prototype.getMessage=function(){return this.conversion.message?this.conversion.message:""};g.prototype.getPredictions=function(){return this.conversion.getPredictions()};g.prototype.getPredictionAt=function(b){b==null&&(b=0);return this.isInName()?a.resolve(void 0):this.getPredictions().then(function(a){if(a.length!==0)return b%=a.length,b<0&&(b=a.length+b),a[b]}.bind(this),console.error)};g.prototype.isInName=function(){return this.conversion.arg.type==="NamedArgument"&&this.conversion.arg.prefix.slice(-1)!==
" "};g.prototype.ensureVisibleArgument=function(){if(this.conversion.arg.type!=="BlankArgument")return!1;var a=this.conversion.arg.beget({text:"",prefixSpace:this.param instanceof d});this.conversion=e.synchronize(this.param.type.parse(a));this.conversion.assign(this);return!0};g.prototype.getStatus=function(a){return this.param.isDataRequired&&!this.conversion.isDataProvided()?o.INCOMPLETE:!this.param.isDataRequired&&this.arg.type==="BlankArgument"?o.VALID:this.conversion.getStatus(a)};g.prototype.toString=
function(){return this.conversion.toString()};Object.defineProperty(g.prototype,"_summaryJson",{get:function(){var a="<async>";this.getPredictions().then(function(b){a=b.length},console.log);return{param:this.param.name+"/"+this.param.type.name,defaultValue:this.param.defaultValue,arg:this.conversion.arg._summaryJson,value:this.value,message:this.getMessage(),status:this.getStatus().toString(),predictionCount:a}},enumerable:!0});i.Assignment=g;var s=eval;i.setEvalFunction=function(a){s=a};i.unsetEvalFunction=
function(){s=void 0};var y={name:"{",params:[{name:"javascript",type:"javascript",description:""}],hidden:!0,returnType:"object",description:{key:"cliEvalJavascript"},exec:function(a){return s(a.javascript)},evalRegexp:/^\s*{\s*/};d.prototype=Object.create(g.prototype);d.prototype.getStatus=function(a){return o.combine(g.prototype.getStatus.call(this,a),this.conversion.value&&this.conversion.value.exec?o.VALID:o.INCOMPLETE)};i.CommandAssignment=d;b.prototype=Object.create(g.prototype);b.prototype.getStatus=
function(){return this.conversion.getStatus()};k.prototype.destroy=function(){this.commandAssignment.onAssignmentChange.remove(this._commandAssignmentChanged,this);this.commandAssignment.onAssignmentChange.remove(this._assignmentChanged,this);delete this.document;delete this.environment};k.prototype._assignmentChanged=function(a){if(!(a.oldConversion!=null&&a.conversion.valueEquals(a.oldConversion))&&!this._structuralChangeInProgress&&(this.onAssignmentChange(a),!a.conversion.argEquals(a.oldConversion)))this.onTextChange()};
k.prototype._commandAssignmentChanged=function(a){if(!a.conversion.valueEquals(a.oldConversion)){this._assignments={};if(a=this.commandAssignment.value)for(var b=0;b<a.params.length;b++){var c=a.params[b],d=new g(c,b),f=this.setAssignment(d,null,{skipArgUpdate:!0});e.synchronize(f);d.onAssignmentChange.add(this._assignmentChanged,this);this._assignments[c.name]=d}this.assignmentCount=Object.keys(this._assignments).length}};k.prototype.getAssignment=function(a){return this._assignments[typeof a===
"string"?a:Object.keys(this._assignments)[a]]||void 0};k.prototype._getFirstBlankPositionalAssignment=function(){var a=null;Object.keys(this._assignments).some(function(b){b=this.getAssignment(b);return b.arg.type==="BlankArgument"&&b.param.isPositionalAllowed?(a=b,!0):!1},this);return a};k.prototype.getParameterNames=function(){return Object.keys(this._assignments)};k.prototype.cloneAssignments=function(){return Object.keys(this._assignments).map(function(a){return this._assignments[a]},this)};k.prototype.getStatus=
function(){var a=o.VALID;if(this._unassigned.length!==0){var b=!0;this._unassigned.forEach(function(a){a.param.type.isIncompleteName||(b=!1)});a=b?o.INCOMPLETE:o.ERROR}this.getAssignments(!0).forEach(function(b){b=b.getStatus();b>a&&(a=b)},this);if(a===o.INCOMPLETE)a=o.ERROR;return a};k.prototype.getArgsObject=function(){var a={};this.getAssignments().forEach(function(b){a[b.param.name]=b.conversion.isDataProvided()?b.value:b.param.defaultValue},this);return a};k.prototype.getAssignments=function(a){var b=
[];a===!0&&b.push(this.commandAssignment);Object.keys(this._assignments).forEach(function(a){b.push(this.getAssignment(a))},this);return b};k.prototype.setAssignment=function(b,c,e){function d(a){var c=b.conversion;b.conversion=a;b.conversion.assign(b);if(!b.conversion.equals(c))b.onAssignmentChange({assignment:b,conversion:b.conversion,oldConversion:c})}e=e||{};if(e.skipArgUpdate!==!0)for(var f=b.arg.getArgs(),g=c.getArgs(),h=Math.max(f.length,g.length),l=0;l<h;l++)if(l>=f.length||f[l].type==="BlankArgument")this._args.push(g[l]);
else{var i=this._args.indexOf(f[l]);if(i===-1)throw console.error("Couldn't find ",f[l]," in ",this._args),Error("Couldn't find "+f[l]);if(l>=g.length)this._args.splice(i,1);else{if(e.matchPadding){if(g[l].prefix.length===0&&this._args[i].prefix.length!==0)g[l].prefix=this._args[i].prefix;if(g[l].suffix.length===0&&this._args[i].suffix.length!==0)g[l].suffix=this._args[i].suffix}this._args[i]=g[l]}}if(c==null)d(b.param.type.getBlank());else if(typeof c.getStatus==="function")d(c);else return b.param.type.parse(c).then(function(a){d(a)}.bind(this),
console.error);return a.resolve(void 0)};k.prototype.setBlankArguments=function(){this.getAssignments().forEach(function(a){a=this.setAssignment(a,null,{skipArgUpdate:!0});e.synchronize(a)},this)};k.prototype.complete=function(a,c){var d=this.getAssignmentAt(a.start);return d.getPredictionAt(c).then(function(a){var c=[];this.onTextChange.holdFire();if(a==null)d.arg.suffix.slice(-1)!==" "&&d.getStatus()===o.VALID&&c.push(this._addSpace(d)),d.isInName()&&(a=d.conversion.arg.beget({prefixPostSpace:!0}),
a=this.setAssignment(d,a),c.push(a));else{var f=d.arg.beget({text:a.name,dontQuote:d===this.commandAssignment}),f=this.setAssignment(d,f);a.incomplete||(f=f.then(function(){return this._addSpace(d).then(function(){if(d instanceof b)return this.update(this.toString())}.bind(this))}.bind(this)));c.push(f)}return e.all(c).then(function(){this.onTextChange();this.onTextChange.resumeFire()}.bind(this))}.bind(this))};k.prototype._assertArgsAssigned=function(){this._args.forEach(function(a){a.assignment==
null&&console.log("No assignment for "+a)},this)};k.prototype._addSpace=function(b){var c=b.conversion.arg.beget({suffixSpace:!0});return c!==b.conversion.arg?this.setAssignment(b,c):a.resolve(void 0)};k.prototype.decrement=function(a){var b=a.param.type.decrement(a.conversion.value);b!=null&&(b=a.param.type.stringify(b),b=a.conversion.arg.beget({text:b}),a=this.setAssignment(a,b),e.synchronize(a))};k.prototype.increment=function(a){var b=a.param.type.increment(a.conversion.value);b!=null&&(b=a.param.type.stringify(b),
b=a.conversion.arg.beget({text:b}),a=this.setAssignment(a,b),e.synchronize(a))};k.prototype.toCanonicalString=function(){var a=[],b=this.commandAssignment.value?this.commandAssignment.value.name:this.commandAssignment.arg.text;a.push(b);Object.keys(this._assignments).forEach(function(b){var b=this._assignments[b],c=b.param.type;b.value!==b.param.defaultValue&&(a.push(" "),a.push(c.stringify(b.value)))},this);b==="{"&&this.getAssignment(0).arg.suffix.indexOf("}")===-1&&a.push(" }");return a.join("")};
k.prototype.createInputArgTrace=function(){if(!this._args)throw Error("createInputMap requires a command line. See source.");var a=[],b;this._args.forEach(function(c){for(b=0;b<c.prefix.length;b++)a.push({arg:c,character:c.prefix[b],part:"prefix"});for(b=0;b<c.text.length;b++)a.push({arg:c,character:c.text[b],part:"text"});for(b=0;b<c.suffix.length;b++)a.push({arg:c,character:c.suffix[b],part:"suffix"})});return a};k.prototype.toString=function(){return this._args?this._args.map(function(a){return a.toString()}).join(""):
this.toCanonicalString()};k.prototype.typedEndsWithSeparator=function(){if(this._args){var a=this._args.slice(-1)[0];return a.suffix.slice(-1)===" "?!0:a.text===""&&a.suffix===""&&a.prefix.slice(-1)===" "}return this.toCanonicalString().slice(-1)===" "};k.prototype.getInputStatusMarkup=function(a){for(var b=this.createInputArgTrace(),a=b[a===0?0:a-1],c=[],e=0;e<b.length;e++){var f=b[e],g=f.arg,h=o.VALID;if(f.part==="text"&&(h=g.assignment.getStatus(g),h===o.INCOMPLETE)){var l=a.arg.assignment.arg.type===
"NamedArgument",l=a.part==="text"||l&&a.part==="suffix";if((g.assignment!==a.arg.assignment||!l)&&!(g.assignment instanceof d))h=o.ERROR}c.push({status:h,string:f.character})}for(e=0;e<c.length-1;)c[e].status===c[e+1].status?(c[e].string+=c[e+1].string,c.splice(e+1,1)):e++;return c};k.prototype.getAssignmentAt=function(a){if(!this._args)throw console.trace(),Error("Missing args");if(a===0)return this.commandAssignment;var b=[],c,e;for(c=0;c<this._args.length;c++){var d=this._args[c],f=d.assignment;
for(e=0;e<d.prefix.length;e++)b.push(f);for(e=0;e<d.text.length;e++)b.push(f);if(d.assignment.arg.type!=="NamedArgument")this._args.length>c+1?f=this._args[c+1].assignment:(e=this._getFirstBlankPositionalAssignment(),e!=null&&(f=e));for(e=0;e<d.suffix.length;e++)b.push(f)}b=b[a-1];if(!b)throw Error("Missing assignment. cursor="+a+" text="+this.toString());return b};k.prototype.exec=function(a){var b=null,c=null,e=!1;a&&a.hidden&&(e=!0);if(a)if(typeof input==="string")this.update(a);else if(typeof a.typed===
"string")this.update(a.typed);else if(a.command!=null)(b=m.getCommand(a.command))||console.error("Command not found: "+a.command),c=a.args;if(!b)b=this.commandAssignment.value,c=this.getArgsObject();if(!b)throw Error("Unknown command");a=this.toString();y.evalRegexp.test(a)&&(a=a.replace(y.evalRegexp,""),a=a.replace(/\s*}\s*$/,""));var d=new h({command:b,args:c,typed:a,canonical:this.toCanonicalString(),hidden:e});this.commandOutputManager.onOutput({output:d});var e=function(a){d.complete(a,!1)},
a=function(a){d.complete(a,!0)},f=function(a){d.changed(a)};try{var g=i.createExecutionContext(this);this._then(b.exec(c,g),e,a,f)}catch(l){console.error(l),a(l)}this.clear();return d};k.prototype.updateExec=function(a,b){return this.update(a).then(function(){return this.exec(b)}.bind(this))};k.prototype.clear=function(){this._structuralChangeInProgress=!0;var a=new v("","","");this._args=[a];this.setAssignment(this.commandAssignment,e.synchronize(this.commandAssignment.param.type.parse(a)),{skipArgUpdate:!0});
this._structuralChangeInProgress=!1;this.onTextChange()};k.prototype._then=function(a,b,c,e){var d=null;if(a!=null&&typeof a.then==="function")d=a.then;else if(a!=null&&a.promise!=null&&typeof a.promise.then==="function")d=a.promise.then;d!=null?d(b,c,e):b(a)};k.prototype.update=function(a){this._structuralChangeInProgress=!0;this._args=this._tokenize(a);var b=this._args.slice(0);return this._split(b).then(function(){return this._assign(b).then(function(){this._structuralChangeInProgress=!1;this.onTextChange()}.bind(this))}.bind(this))};
Object.defineProperty(k.prototype,"_summaryJson",{get:function(){var a={$args:this._args.map(function(a){return a._summaryJson}),_command:this.commandAssignment._summaryJson,_unassigned:this._unassigned.forEach(function(a){return a._summaryJson})};Object.keys(this._assignments).forEach(function(b){a[b]=this.getAssignment(b)._summaryJson}.bind(this));return a},enumerable:!0});k.prototype._tokenize=function(a){function b(a){return a.replace(/\uF000/g," ").replace(/\uF001/g,"'").replace(/\uF002/g,'"').replace(/\uF003/g,
"{").replace(/\uF004/g,"}")}if(a==null||a.length===0)return[new v("","","")];if(f(a))return[new v(a,"","")];for(var c=1,a=a.replace(/\\\\/g,"\\").replace(/\\b/g,"\u0008").replace(/\\f/g,"\u000c").replace(/\\n/g,"\n").replace(/\\r/g,"\r").replace(/\\t/g,"\t").replace(/\\v/g,"\u000b").replace(/\\n/g,"\n").replace(/\\r/g,"\r").replace(/\\ /g,"\uf000").replace(/\\'/g,"\uf001").replace(/\\"/g,"\uf002").replace(/\\{/g,"\uf003").replace(/\\}/g,"\uf004"),e=0,d=0,g="",h=[],l=0;;){var i=a[e];switch(c){case 1:i===
"'"?(g=a.substring(d,e+1),c=3,d=e+1):i==='"'?(g=a.substring(d,e+1),c=4,d=e+1):i==="{"?(g=a.substring(d,e+1),c=5,l++,d=e+1):/ /.test(i)||(g=a.substring(d,e),c=2,d=e);break;case 2:i===" "&&(c=b(a.substring(d,e)),h.push(new v(c,g,"")),c=1,d=e,g="");break;case 3:i==="'"&&(c=b(a.substring(d,e)),h.push(new v(c,g,i)),c=1,d=e+1,g="");break;case 4:i==='"'&&(c=b(a.substring(d,e)),h.push(new v(c,g,i)),c=1,d=e+1,g="");break;case 5:i==="{"?l++:i==="}"&&(l--,l===0&&(c=b(a.substring(d,e)),h.push(new D(c,g,i)),c=
1,d=e+1,g=""))}e++;if(e>=a.length){c===1?e!==d&&(a=a.substring(d,e),(e=h[h.length-1])?e.suffix+=a:h.push(new v("",a,""))):c===5?(c=b(a.substring(d,e+1)),h.push(new D(c,g,""))):(c=b(a.substring(d,e+1)),h.push(new v(c,g,"")));break}}return h};k.prototype._split=function(a){var b={skipArgUpdate:!0},c=void 0;if(a[0].type==="ScriptArgument")return c=new p(z,new D),this.setAssignment(this.commandAssignment,c,b);for(var d=1,f=this.commandAssignment.param.type;d<=a.length;){c=d===1?a[0]:new E(a,0,d);c=e.synchronize(f.parse(c,
d===1&&a.length>1));if(!c.value||c.value.exec)break;d++}for(f=0;f<d;f++)a.shift();return this.setAssignment(this.commandAssignment,c,b)};k.prototype._addUnassignedArgs=function(a){a.forEach(function(a){this._unassigned.push(new b(this,a))}.bind(this))};k.prototype._assign=function(a){var c={skipArgUpdate:!0};this._unassigned=[];var d=[];if(!this.commandAssignment.value)return this._addUnassignedArgs(a),e.all(d);if(a.length===0)return this.setBlankArguments(),e.all(d);if(this.assignmentCount===0)return this._addUnassignedArgs(a),
e.all(d);if(this.assignmentCount===1){var f=this.getAssignment(0);if(f.param.type instanceof r){var g=a.length===1?a[0]:new E(a);d.push(this.setAssignment(f,g,c));return e.all(d)}}var h=this.getParameterNames(),l={};this.getAssignments(!1).forEach(function(b){for(var e=0;e<a.length;)if(b.param.isKnownAs(a[e].text)){var f=a.splice(e,1)[0];h=h.filter(function(a){return a!==b.param.name});if(b.param.type instanceof t)f=new B(f);else{var g=null;e+1<=a.length&&(g=a.splice(e,1)[0]);f=new C(f,g)}b.param.type instanceof
u?(g=l[b.param.name],g||(g=new w,l[b.param.name]=g),g.addArgument(f)):d.push(this.setAssignment(b,f,c))}else e++},this);h.forEach(function(e){e=this.getAssignment(e);if(e.param.isPositionalAllowed)if(e.param.type instanceof u){var f=l[e.param.name];f||(f=new w,l[e.param.name]=f);f.addArguments(a);a=[]}else a.length===0?d.push(this.setAssignment(e,null,c)):(f=a.splice(0,1)[0],(e.param.type instanceof q?/-[-a-zA-Z_]/.test(f.text):f.text.charAt(0)==="-")?this._unassigned.push(new b(this,f)):d.push(this.setAssignment(e,
f,c)));else d.push(this.setAssignment(e,null,c))},this);Object.keys(l).forEach(function(a){var b=this.getAssignment(a);d.push(this.setAssignment(b,l[a],c))},this);this._addUnassignedArgs(a);return e.all(d)};i.Requisition=k;h.prototype.changed=function(a,b){this.data=a;b=b||{};b.output=this;this.onChange(b)};h.prototype.complete=function(a,b,c){this.end=new Date;this.duration=this.end.getTime()-this.start.getTime();this.completed=!0;this.error=b;this.changed(a,c);b?this.deferred.reject():this.deferred.resolve()};
h.prototype.toDom=function(a){e.clearElement(a);var b=a.ownerDocument,c=this.data;if(c!=null){var d;typeof HTMLElement!=="undefined"&&c instanceof HTMLElement?d=c:c.isView?d=c.toDom(b):(this.command.returnType==="terminal"?Array.isArray(c)?(d=e.createElement(b,"div"),c.forEach(function(){var a=e.createElement(b,"textarea");a.classList.add("gcli-row-subterminal");a.readOnly=!0;d.appendChild(a)})):(d=e.createElement(b,"textarea"),d.classList.add("gcli-row-terminal"),d.readOnly=!0):d=e.createElement(b,
"p"),this.command.returnType==="string"?d.textContent=c:e.setContents(d,c.toString()));for(var c=d.querySelectorAll("*[href]"),f=0;f<c.length;f++)c[f].setAttribute("target","_blank");a.appendChild(d)}};h.prototype.toString=function(a){return this.data.isView?this.data.toDom(a).textContent:typeof HTMLElement!=="undefined"&&this.data instanceof HTMLElement?this.data.textContent:this.data==null?"":this.data.toString()};i.Output=h;i.createExecutionContext=function(b){return{exec:b.exec.bind(b),update:b.update.bind(b),
updateExec:b.updateExec.bind(b),document:b.document,environment:b.environment,createView:l.createView,defer:function(){return a.defer()},createPromise:function(){return a.defer()}}}});define("text!gcli/ui/intro.html",[],function(){return'\n<div>\n  <p>${l10n.introTextOpening2}</p>\n\n  <p>\n    ${l10n.introTextCommands}\n    <span class="gcli-out-shortcut" onclick="${onclick}"\n        ondblclick="${ondblclick}" data-command="help">help</span>${l10n.introTextKeys2}\n    <code>${l10n.introTextF1Escape}</code>.\n  </p>\n\n  <button onclick="${onGotIt}" if="${showHideButton}">${l10n.introTextGo}</button>\n</div>'});
define("gcli/ui/intro","require,exports,module,util/util,util/l10n,gcli/settings,gcli/ui/view,gcli/cli,text!gcli/ui/intro.html".split(","),function(j,i){var g=j("util/util"),d=j("util/l10n"),b=j("gcli/settings"),k=j("gcli/ui/view"),f=j("gcli/cli").Output,h={name:"hideIntro",type:"boolean",description:d.lookup("hideIntroDesc"),defaultValue:!1},a;i.startup=function(){a=b.addSetting(h)};i.shutdown=function(){b.removeSetting(h);a=void 0};i.maybeShowIntro=function(b,c){if(!a.value){var d=new f;b.onOutput({output:d});
var g=this.createView(c);d.complete(g)}};i.createView=function(b,c){return k.createView({html:j("text!gcli/ui/intro.html"),options:{stack:"intro.html"},data:{l10n:d.propertyLookup,onclick:function(a){g.updateCommand(a.currentTarget,b)},ondblclick:function(a){g.executeCommand(a.currentTarget,b)},showHideButton:c!=null,onGotIt:function(){a.value=!0;c.onClose()}}})}});
define("gcli/ui/focus","require,exports,module,util/util,util/l10n,gcli/settings,gcli/canon".split(","),function(j,i){function g(a,b){a=a||{};this._document=b.document||document;this._requisition=b.requisition;this._debug=a.debug||!1;this._blurDelay=a.blurDelay||150;this._window=this._document.defaultView;this._requisition.commandOutputManager.onOutput.add(this._outputted,this);this._blurDelayTimeout=null;this._monitoredElements=[];this._recentOutput=this._helpRequested=this._hasFocus=this._isError=
!1;this.onVisibilityChange=d.createEvent("FocusManager.onVisibilityChange");this._focused=this._focused.bind(this);this._document.addEventListener("focus",this._focused,!0);h.onChange.add(this._eagerHelperChanged,this);this.isOutputVisible=this.isTooltipVisible=void 0;this._checkShow()}var d=j("util/util"),b=j("util/l10n"),k=j("gcli/settings");j("gcli/canon");var f={name:"eagerHelper",type:{name:"selection",lookup:[{name:"never",value:1},{name:"sometimes",value:2},{name:"always",value:3}]},defaultValue:2,
description:b.lookup("eagerHelperDesc"),ignoreTypeDifference:!0},h;i.startup=function(){h=k.addSetting(f)};i.shutdown=function(){k.removeSetting(f);h=void 0};g.prototype.destroy=function(){h.onChange.remove(this._eagerHelperChanged,this);this._document.removeEventListener("focus",this._focused,!0);this._requisition.commandOutputManager.onOutput.remove(this._outputted,this);for(var a=0;a<this._monitoredElements.length;a++){var b=this._monitoredElements[a];console.error("Hanging monitored element: ",
b.element);b.element.removeEventListener("focus",b.onFocus,!0);b.element.removeEventListener("blur",b.onBlur,!0)}if(this._blurDelayTimeout)this._window.clearTimeout(this._blurDelayTimeout),this._blurDelayTimeout=null;delete this._focused;delete this._document;delete this._window;delete this._requisition};g.prototype.addMonitoredElement=function(a,b){this._debug&&console.log("FocusManager.addMonitoredElement("+(b||"unknown")+")");var c={element:a,where:b,onFocus:function(){this._reportFocus(b)}.bind(this),
onBlur:function(){this._reportBlur(b)}.bind(this)};a.addEventListener("focus",c.onFocus,!0);a.addEventListener("blur",c.onBlur,!0);this._document.activeElement===a&&this._reportFocus(b);this._monitoredElements.push(c)};g.prototype.removeMonitoredElement=function(a,b){this._debug&&console.log("FocusManager.removeMonitoredElement("+(b||"unknown")+")");this._monitoredElements=this._monitoredElements.filter(function(b){return b.element===a?(a.removeEventListener("focus",b.onFocus,!0),a.removeEventListener("blur",
b.onBlur,!0),!1):!0})};g.prototype.updatePosition=function(a){this.onVisibilityChange({tooltipVisible:this.isTooltipVisible,outputVisible:this.isOutputVisible,dimensions:a})};g.prototype._outputted=function(){this._recentOutput=!0;this._helpRequested=!1;this._checkShow()};g.prototype._focused=function(){this._reportBlur("document")};g.prototype._reportFocus=function(a){this._debug&&console.log("FocusManager._reportFocus("+(a||"unknown")+")");if(this._blurDelayTimeout)this._debug&&console.log("FocusManager.cancelBlur"),
this._window.clearTimeout(this._blurDelayTimeout),this._blurDelayTimeout=null;if(!this._hasFocus)this._hasFocus=!0;this._checkShow()};g.prototype._reportBlur=function(a){this._debug&&console.log("FocusManager._reportBlur("+a+")");if(this._hasFocus)this._blurDelayTimeout?this._debug&&console.log("FocusManager.blurPending"):this._blurDelayTimeout=this._window.setTimeout(function(){this._debug&&console.log("FocusManager.blur");this._hasFocus=!1;this._checkShow();this._blurDelayTimeout=null}.bind(this),
this._blurDelay)};g.prototype._eagerHelperChanged=function(){this._checkShow()};g.prototype.onInputChange=function(){this._recentOutput=!1;this._checkShow()};g.prototype.helpRequest=function(){this._debug&&console.log("FocusManager.helpRequest");this._helpRequested=!0;this._recentOutput=!1;this._checkShow()};g.prototype.removeHelp=function(){this._debug&&console.log("FocusManager.removeHelp");this._recentOutput=this._helpRequested=this._isError=this._importantFieldFlag=!1;this._checkShow()};g.prototype.setImportantFieldFlag=
function(a){this._debug&&console.log("FocusManager.setImportantFieldFlag",a);this._importantFieldFlag=a;this._checkShow()};g.prototype.setError=function(a){this._debug&&console.log("FocusManager._isError",a);this._isError=a;this._checkShow()};g.prototype._checkShow=function(){var a=!1,b={tooltipVisible:this.isTooltipVisible,outputVisible:this.isOutputVisible},c=this._shouldShowTooltip();if(this.isTooltipVisible!==c.visible)b.tooltipVisible=this.isTooltipVisible=c.visible,a=!0;c=this._shouldShowOutput();
if(this.isOutputVisible!==c.visible)b.outputVisible=this.isOutputVisible=c.visible,a=!0;a&&(this._debug&&console.log("FocusManager.onVisibilityChange",b),this.onVisibilityChange(b))};g.prototype._shouldShowTooltip=function(){return!this._hasFocus?{visible:!1,reason:"notHasFocus"}:h.value===1?{visible:!1,reason:"eagerHelperNever"}:h.value===3?{visible:!0,reason:"eagerHelperAlways"}:this._isError?{visible:!0,reason:"isError"}:this._helpRequested?{visible:!0,reason:"helpRequested"}:this._importantFieldFlag?
{visible:!0,reason:"importantFieldFlag"}:{visible:!1,reason:"default"}};g.prototype._shouldShowOutput=function(){return!this._hasFocus?{visible:!1,reason:"notHasFocus"}:this._recentOutput?{visible:!0,reason:"recentOutput"}:{visible:!1,reason:"default"}};i.FocusManager=g});
define("gcli/ui/fields","require,exports,module,util/promise,util/util,util/util,gcli/types/basic".split(","),function(j,i){function g(a,b){this.type=a;this.document=b.document;this.requisition=b.requisition}function d(a,b){g.call(this,a,b);this.element=k.createElement(this.document,"div");this.onFieldChange=k.createEvent("BlankField.onFieldChange")}var b=j("util/promise"),k=j("util/util"),f=j("util/util").KeyEvent,h=j("gcli/types/basic").BlankType;g.prototype.element=void 0;g.prototype.destroy=function(){delete this.messageElement};
g.prototype.setConversion=function(){throw Error("Field should not be used directly");};g.prototype.getConversion=function(){throw Error("Field should not be used directly");};g.prototype.setMessageElement=function(a){this.messageElement=a};g.prototype.setMessage=function(a){this.messageElement&&k.setTextContent(this.messageElement,a||"")};g.prototype.onInputChange=function(a){b.resolve(this.getConversion()).then(function(b){this.onFieldChange({conversion:b});this.setMessage(b.message);a.keyCode===
f.DOM_VK_RETURN&&this.requisition.exec()}.bind(this),console.error)};g.prototype.isImportant=!1;g.claim=function(){throw Error("Field should not be used directly");};g.TOOLTIP_MATCH=5;g.TOOLTIP_DEFAULT=4;g.MATCH=3;g.DEFAULT=2;g.BASIC=1;g.NO_MATCH=0;i.Field=g;var a=[];i.addField=function(b){if(typeof b!=="function")throw console.error("addField erroring on ",b),Error("addField requires a Field constructor");a.push(b)};i.removeField=function(a){if(typeof a!=="string")fields=fields.filter(function(b){return b!==
a}),delete fields[a];else if(a instanceof g)removeField(a.name);else throw console.error("removeField erroring on ",a),Error("removeField requires an instance of Field");};i.getField=function(b,c){var f,h=-1;a.forEach(function(a){var c=a.claim(b);c>h&&(h=c,f=a)});if(!f)throw console.error("Unknown field type ",b," in ",a),Error("Can't find field for "+b);return c.tooltip&&h<g.TOOLTIP_DEFAULT?new d(b,c):new f(b,c)};d.prototype=Object.create(g.prototype);d.claim=function(a){return a instanceof h?g.MATCH:
g.NO_MATCH};d.prototype.setConversion=function(a){this.setMessage(a.message)};d.prototype.getConversion=function(){return this.type.parse(new Argument)};i.addField(d)});
define("gcli/ui/fields/basic","require,exports,module,util/util,util/l10n,gcli/argument,gcli/argument,gcli/argument,gcli/argument,gcli/types,gcli/types/basic,gcli/types/basic,gcli/types/basic,gcli/types/basic,gcli/types/basic,gcli/ui/fields,gcli/ui/fields".split(","),function(j,i){function g(a,b){q.call(this,a,b);this.arg=new e;this.element=h.createElement(this.document,"input");this.element.type="text";this.element.classList.add("gcli-field");this.onInputChange=this.onInputChange.bind(this);this.element.addEventListener("keyup",
this.onInputChange,!1);this.onFieldChange=h.createEvent("StringField.onFieldChange")}function d(a,b){q.call(this,a,b);this.arg=new e;this.element=h.createElement(this.document,"input");this.element.type="number";if(this.type.max)this.element.max=this.type.max;if(this.type.min)this.element.min=this.type.min;if(this.type.step)this.element.step=this.type.step;this.onInputChange=this.onInputChange.bind(this);this.element.addEventListener("keyup",this.onInputChange,!1);this.onFieldChange=h.createEvent("NumberField.onFieldChange")}
function b(a,b){q.call(this,a,b);this.name=b.name;this.named=b.named;this.element=h.createElement(this.document,"input");this.element.type="checkbox";this.element.id="gcliForm"+this.name;this.onInputChange=this.onInputChange.bind(this);this.element.addEventListener("change",this.onInputChange,!1);this.onFieldChange=h.createEvent("BooleanField.onFieldChange")}function k(a,b){q.call(this,a,b);this.options=b;this.requisition.onAssignmentChange.add(this.update,this);this.element=h.createElement(this.document,
"div");this.update();this.onFieldChange=h.createEvent("DelegateField.onFieldChange")}function f(b,c){q.call(this,b,c);this.options=c;this._onAdd=this._onAdd.bind(this);this.members=[];this.element=h.createElement(this.document,"div");this.element.classList.add("gcli-array-parent");this.addButton=h.createElement(this.document,"button");this.addButton.classList.add("gcli-array-member-add");this.addButton.addEventListener("click",this._onAdd,!1);this.addButton.textContent=a.lookup("fieldArrayAdd");this.element.appendChild(this.addButton);
this.container=h.createElement(this.document,"div");this.container.classList.add("gcli-array-members");this.element.appendChild(this.container);this.onInputChange=this.onInputChange.bind(this);this.onFieldChange=h.createEvent("ArrayField.onFieldChange")}var h=j("util/util"),a=j("util/l10n"),e=j("gcli/argument").Argument,c=j("gcli/argument").TrueNamedArgument,l=j("gcli/argument").FalseNamedArgument,m=j("gcli/argument").ArrayArgument,n=j("gcli/types").ArrayConversion,o=j("gcli/types/basic").StringType,
p=j("gcli/types/basic").NumberType,u=j("gcli/types/basic").BooleanType,r=j("gcli/types/basic").DelegateType,t=j("gcli/types/basic").ArrayType,q=j("gcli/ui/fields").Field,v=j("gcli/ui/fields");i.startup=function(){v.addField(g);v.addField(d);v.addField(b);v.addField(k);v.addField(f)};i.shutdown=function(){v.removeField(g);v.removeField(d);v.removeField(b);v.removeField(k);v.removeField(f)};g.prototype=Object.create(q.prototype);g.prototype.destroy=function(){q.prototype.destroy.call(this);this.element.removeEventListener("keyup",
this.onInputChange,!1);delete this.element;delete this.document;delete this.onInputChange};g.prototype.setConversion=function(a){this.arg=a.arg;this.element.value=a.arg.text;this.setMessage(a.message)};g.prototype.getConversion=function(){this.arg=this.arg.beget({text:this.element.value,prefixSpace:!0});return this.type.parse(this.arg)};g.claim=function(a){return a instanceof o?q.MATCH:q.BASIC};d.prototype=Object.create(q.prototype);d.claim=function(a){return a instanceof p?q.MATCH:q.NO_MATCH};d.prototype.destroy=
function(){q.prototype.destroy.call(this);this.element.removeEventListener("keyup",this.onInputChange,!1);delete this.element;delete this.document;delete this.onInputChange};d.prototype.setConversion=function(a){this.arg=a.arg;this.element.value=a.arg.text;this.setMessage(a.message)};d.prototype.getConversion=function(){this.arg=this.arg.beget({text:this.element.value,prefixSpace:!0});return this.type.parse(this.arg)};b.prototype=Object.create(q.prototype);b.claim=function(a){return a instanceof u?
q.MATCH:q.NO_MATCH};b.prototype.destroy=function(){q.prototype.destroy.call(this);this.element.removeEventListener("change",this.onInputChange,!1);delete this.element;delete this.document;delete this.onInputChange};b.prototype.setConversion=function(a){this.element.checked=a.value;this.setMessage(a.message)};b.prototype.getConversion=function(){return this.type.parse(this.named?this.element.checked?new c(new e(" --"+this.name)):new l:new e(" "+this.element.checked))};k.prototype=Object.create(q.prototype);
k.prototype.update=function(){var a=this.type.delegateType();if(a!==this.subtype)this.field&&(this.field.onFieldChange.remove(this.fieldChanged,this),this.field.destroy()),this.subtype=a,this.field=v.getField(a,this.options),this.field.onFieldChange.add(this.fieldChanged,this),h.clearElement(this.element),this.element.appendChild(this.field.element)};k.claim=function(a){return a instanceof r?q.MATCH:q.NO_MATCH};k.prototype.destroy=function(){q.prototype.destroy.call(this);this.requisition.onAssignmentChange.remove(this.update,
this);delete this.element;delete this.document;delete this.onInputChange};k.prototype.setConversion=function(a){this.field.setConversion(a)};k.prototype.getConversion=function(){return this.field.getConversion()};Object.defineProperty(k.prototype,"isImportant",{get:function(){return this.field.isImportant},enumerable:!0});f.prototype=Object.create(q.prototype);f.claim=function(a){return a instanceof t?q.MATCH:q.NO_MATCH};f.prototype.destroy=function(){q.prototype.destroy.call(this);this.addButton.removeEventListener("click",
this._onAdd,!1)};f.prototype.setConversion=function(a){h.clearElement(this.container);this.members=[];a.conversions.forEach(function(a){this._onAdd(null,a)},this)};f.prototype.getConversion=function(){for(var a=[],b=new m,c=0;c<this.members.length;c++)Promise.resolve(this.members[c].field.getConversion()).then(function(c){a.push(c);b.addArgument(c.arg)}.bind(this),console.error);return new n(a,b)};f.prototype._onAdd=function(b,c){var e=h.createElement(this.document,"div");e.classList.add("gcli-array-member");
this.container.appendChild(e);var d=v.getField(this.type.subtype,this.options);d.onFieldChange.add(function(){Promise.resolve(this.getConversion()).then(function(a){this.onFieldChange({conversion:a});this.setMessage(a.message)}.bind(this),console.error)},this);c&&d.setConversion(c);e.appendChild(d.element);var f=h.createElement(this.document,"button");f.classList.add("gcli-array-member-del");f.addEventListener("click",this._onDel,!1);f.textContent=a.lookup("fieldArrayDel");e.appendChild(f);e={element:e,
field:d,parent:this};e.onDelete=function(){this.parent.container.removeChild(this.element);this.parent.members=this.parent.members.filter(function(a){return a!==this});this.parent.onInputChange()}.bind(e);f.addEventListener("click",e.onDelete,!1);this.members.push(e)}});define("text!gcli/ui/fields/menu.css",[],function(){return"\n.gcli-menu {\n  width: 100%;\n  overflow: hidden;\n  font-size: 90%;\n}\n\n.gcli-menu-field {\n  border: 1px solid #aaa;\n  border-top: 0;\n  border-bottom-right-radius: 5px;\n  border-bottom-left-radius: 5px;\n  max-height: 300px;\n  margin: 0 3px;\n  padding: 0;\n}\n\n.gcli-menu-template {\n  border-collapse: collapse;\n  width: 100%;\n}\n\n.gcli-menu-option {\n  overflow: hidden;\n  white-space: nowrap;\n  cursor: pointer;\n}\n\n.gcli-menu-option:hover {\n  background-image: -moz-linear-gradient(top, #f8f8f8, #ccc);\n  background-color: #ddd;\n}\n\n.gcli-menu-name {\n  padding: 2px 3px;\n  -moz-padding-start: 8px;\n  -webkit-padding-start: 8px;\n}\n\n.gcli-menu-desc {\n  color: #777;\n  padding: 0 3px;\n  -moz-padding-end: 8px;\n  -webkit-padding-end: 8px;\n}\n\n.gcli-menu-highlight,\n.gcli-menu-highlight.gcli-menu-option:hover {\n  background-image: -moz-linear-gradient(top, #eee, #b8b8b8);\n  background-color: #c8c8c8;\n}\n\n.gcli-menu-typed {\n  color: #FF6600;\n}\n\n.gcli-menu-more {\n  font-size: 80%;\n  text-align: right;\n  -moz-padding-end: 8px;\n  -webkit-padding-end: 8px;\n}"});
define("text!gcli/ui/fields/menu.html",[],function(){return'\n<div>\n  <table class="gcli-menu-template" aria-live="polite">\n    <tr class="gcli-menu-option" foreach="item in ${items}"\n        onclick="${onItemClickInternal}" title="${item.manual}">\n      <td class="gcli-menu-name">${item.name}</td>\n      <td class="gcli-menu-desc">${item.description}</td>\n    </tr>\n  </table>\n  <div class="gcli-menu-more" if="${items.hasMore}">${l10n.fieldMenuMore}</div>\n</div>'});
define("gcli/ui/fields/menu","require,exports,module,util/util,util/l10n,util/domtemplate,gcli/argument,gcli/types,gcli/canon,text!gcli/ui/fields/menu.css,text!gcli/ui/fields/menu.html".split(","),function(j,i){function g(a){a=a||{};this.document=a.document||document;this.type=a.type;if(!this.document)throw Error("No document");this.element=b.createElement(this.document,"div");this.element.classList.add(a.menuClass||"gcli-menu");a&&a.field&&this.element.classList.add(a.menuFieldClass||"gcli-menu-field");
e!=null&&b.importCss(e,this.document,"gcli-menu");this.template=b.toDom(this.document,c);this.templateOptions={blankNullUndefined:!0,stack:"menu.html"};this.items=null;this.onItemClick=b.createEvent("Menu.onItemClick")}function d(a,b,c){return typeof Proxy==="undefined"?a:Proxy.create({get:function(e,d){var f=a[d];if(d!=="name")return f;var g=f.indexOf(b);if(g===-1)return f;var h=f.substr(0,g),f=f.substr(g+b.length),g=c.createElement("span");g.appendChild(c.createTextNode(h));h=c.createElement("span");
h.classList.add("gcli-menu-typed");h.appendChild(c.createTextNode(b));g.appendChild(h);g.appendChild(c.createTextNode(f));return g}})}var b=j("util/util"),k=j("util/l10n"),f=j("util/domtemplate"),h=j("gcli/argument").Argument,a=j("gcli/types").Conversion;j("gcli/canon");var e=j("text!gcli/ui/fields/menu.css"),c=j("text!gcli/ui/fields/menu.html");g.prototype.l10n=k.propertyLookup;g.prototype.destroy=function(){delete this.element;delete this.template;delete this.document};g.prototype.onItemClickInternal=
function(a){a=a.currentTarget.querySelector(".gcli-menu-name").textContent;a=new h(a);a.suffix=" ";this.onItemClick({arg:a})};g.prototype.show=function(c,e){this.items=c.filter(function(a){return a.hidden===void 0||a.hidden!==!0}.bind(this));if(e)this.items=this.items.map(function(a){return d(a,e,this.template.ownerDocument)}.bind(this));if(this.items.length===0)this.element.style.display="none";else{if(this.items.length>=a.maxPredictions)this.items.splice(-1),this.items.hasMore=!0;var g=this.template.cloneNode(!0);
f.template(g,this,this.templateOptions);b.clearElement(this.element);this.element.appendChild(g);this.element.style.display="block"}};g.prototype.setChoiceIndex=function(a){for(var b=this.element.querySelectorAll(".gcli-menu-option"),c=0;c<b.length;c++)b[c].classList.remove("gcli-menu-highlight");a!=null&&(b.length<=a?console.error("Cant highlight "+a+". Only "+b.length+" options"):b.item(a).classList.add("gcli-menu-highlight"))};g.prototype.selectChoice=function(){var a=this.element.querySelector(".gcli-menu-highlight .gcli-menu-name");
if(!a)return!1;a=new h(a.textContent);a.suffix=" ";a.prefix=" ";this.onItemClick({arg:a});return!0};g.prototype.hide=function(){this.element.style.display="none"};g.prototype.setMaxHeight=function(a){this.element.style.maxHeight=a+"px"};i.Menu=g});
define("gcli/ui/fields/javascript","require,exports,module,util/util,util/promise,gcli/types,gcli/types,gcli/argument,gcli/types/javascript,gcli/ui/fields/menu,gcli/ui/fields,gcli/ui/fields".split(","),function(j,i){function g(a,b){c.call(this,a,b);this.onInputChange=this.onInputChange.bind(this);this.arg=new h("","{ "," }");this.element=d.createElement(this.document,"div");this.input=d.createElement(this.document,"input");this.input.type="text";this.input.addEventListener("keyup",this.onInputChange,
!1);this.input.classList.add("gcli-field");this.input.classList.add("gcli-field-javascript");this.element.appendChild(this.input);this.menu=new e({document:this.document,field:!0,type:a});this.element.appendChild(this.menu.element);this.setConversion(new f(void 0,new h(""),k.INCOMPLETE,""));this.onFieldChange=d.createEvent("JavascriptField.onFieldChange");this.menu.onItemClick.add(this.itemClicked,this)}var d=j("util/util"),b=j("util/promise"),k=j("gcli/types").Status,f=j("gcli/types").Conversion,
h=j("gcli/argument").ScriptArgument,a=j("gcli/types/javascript").JavascriptType,e=j("gcli/ui/fields/menu").Menu,c=j("gcli/ui/fields").Field,l=j("gcli/ui/fields");i.startup=function(){l.addField(g)};i.shutdown=function(){l.removeField(g)};g.prototype=Object.create(c.prototype);g.claim=function(b){return b instanceof a?c.TOOLTIP_MATCH:c.NO_MATCH};g.prototype.destroy=function(){c.prototype.destroy.call(this);this.input.removeEventListener("keyup",this.onInputChange,!1);this.menu.onItemClick.remove(this.itemClicked,
this);this.menu.destroy();delete this.element;delete this.input;delete this.menu;delete this.document;delete this.onInputChange};g.prototype.setConversion=function(b){this.arg=b.arg;this.input.value=b.arg.text;var c=0;if(this.type instanceof a){var e=b.arg.text.lastIndexOf(".");e!==-1&&(c=e)}this.setMessage(b.message);b.getPredictions().then(function(a){var b=[];a.forEach(function(a){a.hidden||b.push({name:a.name.substring(c),complete:a.name,description:a.description||""})},this);this.menu.show(b)}.bind(this),
console.error)};g.prototype.itemClicked=function(a){b.resolve(this.type.parse(a.arg)).then(function(a){this.onFieldChange({conversion:a});this.setMessage(a.message)}.bind(this),console.error)};g.prototype.onInputChange=function(a){this.item=a.currentTarget.item;b.resolve(this.getConversion()).then(function(a){this.onFieldChange({conversion:a});this.setMessage(a.message)}.bind(this),console.error)};g.prototype.getConversion=function(){this.arg=new h(this.input.value,"{ "," }");return this.type.parse(this.arg)};
g.DEFAULT_VALUE="__JavascriptField.DEFAULT_VALUE"});
define("gcli/ui/fields/selection","require,exports,module,util/promise,util/util,util/l10n,gcli/argument,gcli/types,gcli/types,gcli/types/basic,gcli/types/selection,gcli/ui/fields/menu,gcli/ui/fields,gcli/ui/fields".split(","),function(j,i){function g(a,c){l.call(this,a,c);this.items=[];this.element=k.createElement(this.document,"select");this.element.classList.add("gcli-field");this._addOption({name:f.lookupFormat("fieldSelectionSelect",[c.name])});b.resolve(this.type.getLookup()).then(function(a){a.forEach(this._addOption,
this)}.bind(this),console.error);this.onInputChange=this.onInputChange.bind(this);this.element.addEventListener("change",this.onInputChange,!1);this.onFieldChange=k.createEvent("SelectionField.onFieldChange")}function d(a,b){l.call(this,a,b);this.onInputChange=this.onInputChange.bind(this);this.arg=new h;this.menu=new c({document:this.document,type:a});this.element=this.menu.element;this.onFieldChange=k.createEvent("SelectionTooltipField.onFieldChange");this.menu.onItemClick.add(this.itemClicked,
this)}var b=j("util/promise"),k=j("util/util"),f=j("util/l10n"),h=j("gcli/argument").Argument;j("gcli/types");j("gcli/types");var a=j("gcli/types/basic").BooleanType,e=j("gcli/types/selection").SelectionType,c=j("gcli/ui/fields/menu").Menu,l=j("gcli/ui/fields").Field,m=j("gcli/ui/fields");i.startup=function(){m.addField(g);m.addField(d)};i.shutdown=function(){m.removeField(g);m.removeField(d)};g.prototype=Object.create(l.prototype);g.claim=function(b){return b instanceof a?l.BASIC:b instanceof e?
l.DEFAULT:l.NO_MATCH};g.prototype.destroy=function(){l.prototype.destroy.call(this);this.element.removeEventListener("change",this.onInputChange,!1);delete this.element;delete this.document;delete this.onInputChange};g.prototype.setConversion=function(a){var b;this.items.forEach(function(c){if(c.value&&c.value===a.value)b=c.index},this);this.element.value=b;this.setMessage(a.message)};g.prototype.getConversion=function(){return this.type.parse(new h(this.items[this.element.value].name," "))};g.prototype._addOption=
function(a){a.index=this.items.length;this.items.push(a);var b=k.createElement(this.document,"option");b.textContent=a.name;b.value=a.index;this.element.appendChild(b)};d.prototype=Object.create(l.prototype);d.claim=function(a){return a.getType()instanceof e?l.TOOLTIP_MATCH:l.NO_MATCH};d.prototype.destroy=function(){l.prototype.destroy.call(this);this.menu.onItemClick.remove(this.itemClicked,this);this.menu.destroy();delete this.element;delete this.document;delete this.onInputChange};d.prototype.setConversion=
function(a){this.arg=a.arg;this.setMessage(a.message);a.getPredictions().then(function(b){this.menu.show(b.map(function(a){return a.value.description?a.value:a},this),a.arg.text)}.bind(this),console.error)};d.prototype.itemClicked=function(a){b.resolve(this.type.parse(a.arg)).then(function(a){this.onFieldChange({conversion:a});this.setMessage(a.message)}.bind(this),console.error)};d.prototype.onInputChange=function(a){this.item=a.currentTarget.item;b.resolve(this.getConversion()).then(function(a){this.onFieldChange({conversion:a});
this.setMessage(a.message)}.bind(this),console.error)};d.prototype.getConversion=function(){this.arg=this.arg.beget({text:this.input.value});return this.type.parse(this.arg)};d.prototype.setChoiceIndex=function(a){this.menu.setChoiceIndex(a)};d.prototype.selectChoice=function(){return this.menu.selectChoice()};Object.defineProperty(d.prototype,"isImportant",{get:function(){return this.type.name!=="command"},enumerable:!0});d.DEFAULT_VALUE="__SelectionTooltipField.DEFAULT_VALUE"});
define("text!gcli/ui/tooltip.css",[],function(){return"\n.gcli-panel {\n  -moz-transition-property: opacity, height;\n  -moz-transition-duration: 0.5s, 2s;\n  overflow-y: auto;\n  overflow-x: hidden;\n  z-index: 2;\n  position: absolute;\n  max-height: 100%;\n  max-width: 350px;\n  left: 0;\n  bottom: 0;\n  font-family: Segoe UI, Helvetica Neue, Verdana, Arial, sans-serif;\n  margin-bottom: -3px;\n}\n\n.gcli-panel.gcli-panel-hide {\n  opacity: 0;\n  height: 0;\n}\n\n.gcli-panel-connector {\n  height: 10px;\n  margin-top: -1px;\n  margin-left: 20px;\n  width: 20px;\n  background: white;\n  border-left: 1px solid #999;\n  border-right: 1px solid #999;\n}\n\n.gcli-tt-description {\n  padding: 5px 10px 0;\n  font-size: 90%;\n}\n\n.gcli-tt-error {\n  font-size: 80%;\n  color: #900;\n  padding: 0 10px;\n}\n\n.gcli-field {\n  width: 100%;\n}\n\n.gcli-field-javascript {\n  margin-bottom: 0;\n}\n\n.gcli-tt {\n  box-shadow: 0 0 10px 1px #ddd;\n  border: 1px solid #999;\n  border-radius: 3px;\n  margin: 10px 0 0 0;\n  background: hsla(0, 100%, 100%, 0.95);\n  padding-bottom: 5px;\n}"});
define("text!gcli/ui/tooltip.html",[],function(){return'\n<div class="gcli-tt" aria-live="polite">\n  <div class="gcli-tt-description" save="${descriptionEle}">${description}</div>\n  ${field.element}\n  <div class="gcli-tt-error" save="${errorEle}">${assignment.conversion.message}</div>\n  <div class="gcli-tt-highlight" save="${highlightEle}"></div>\n</div>'});
define("gcli/ui/tooltip","require,exports,module,util/util,util/domtemplate,gcli/cli,gcli/ui/fields,text!gcli/ui/tooltip.css,text!gcli/ui/tooltip.html".split(","),function(j,i){function g(b,c){this.inputter=c.inputter;this.requisition=c.requisition;this.focusManager=c.focusManager;this.element=c.element;this.element.classList.add(b.tooltipClass||"gcli-tooltip");this.document=this.element.ownerDocument;if(this.panelElement=c.panelElement)this.panelElement.classList.add("gcli-panel-hide"),this.focusManager.onVisibilityChange.add(this.visibilityChanged,
this);this.focusManager.addMonitoredElement(this.element,"tooltip");this.fields=[];if(h!=null)this.style=d.importCss(h,this.document,"gcli-tooltip");this.template=d.toDom(this.document,a);this.templateOptions={blankNullUndefined:!0,stack:"tooltip.html"};this.inputter.onChoiceChange.add(this.choiceChanged,this);this.inputter.onAssignmentChange.add(this.assignmentChanged,this);this.assignment=void 0;this.assignmentChanged({assignment:this.inputter.assignment})}var d=j("util/util"),b=j("util/domtemplate"),
k=j("gcli/cli").CommandAssignment,f=j("gcli/ui/fields"),h=j("text!gcli/ui/tooltip.css"),a=j("text!gcli/ui/tooltip.html");g.prototype.destroy=function(){this.inputter.onAssignmentChange.remove(this.assignmentChanged,this);this.inputter.onChoiceChange.remove(this.choiceChanged,this);this.panelElement&&this.focusManager.onVisibilityChange.remove(this.visibilityChanged,this);this.focusManager.removeMonitoredElement(this.element,"tooltip");this.style&&(this.style.parentNode.removeChild(this.style),delete this.style);
this.field.onFieldChange.remove(this.fieldChanged,this);this.field.destroy();delete this.errorEle;delete this.descriptionEle;delete this.highlightEle;delete this.document;delete this.element;delete this.panelElement;delete this.template};Object.defineProperty(g.prototype,"isMenuShowing",{get:function(){return this.focusManager.isTooltipVisible&&this.field!=null&&this.field.menu!=null},enumerable:!0});g.prototype.assignmentChanged=function(a){if(this.assignment!==a.assignment)this.assignment&&this.assignment.onAssignmentChange.remove(this.assignmentContentsChanged,
this),this.assignment=a.assignment,this.field&&(this.field.onFieldChange.remove(this.fieldChanged,this),this.field.destroy()),this.field=f.getField(this.assignment.param.type,{document:this.document,name:this.assignment.param.name,requisition:this.requisition,required:this.assignment.param.isDataRequired,named:!this.assignment.param.isPositionalAllowed,tooltip:!0}),this.focusManager.setImportantFieldFlag(this.field.isImportant),this.field.onFieldChange.add(this.fieldChanged,this),this.assignment.onAssignmentChange.add(this.assignmentContentsChanged,
this),this.field.setConversion(this.assignment.conversion),this.highlightEle=this.descriptionEle=this.errorEle=void 0,a=this.template.cloneNode(!0),b.template(a,this,this.templateOptions),d.clearElement(this.element),this.element.appendChild(a),this.element.style.display="block",this.field.setMessageElement(this.errorEle),this._updatePosition()};g.prototype.choiceChanged=function(a){this.field&&this.field.setChoiceIndex&&this.assignment.conversion.constrainPredictionIndex(a.choice).then(function(a){this.field.setChoiceIndex(a)}.bind(this)).then(null,
console.error)};g.prototype.selectChoice=function(){return this.field&&this.field.selectChoice?this.field.selectChoice():!1};g.prototype.fieldChanged=function(a){this.requisition.setAssignment(this.assignment,a.conversion.arg,{matchPadding:!0});this.focusManager.setError(a.conversion.message!=null&&a.conversion.message!=="");this.document.defaultView.setTimeout(function(){this.inputter.focus()}.bind(this),10)};g.prototype.assignmentContentsChanged=function(a){a.conversion.arg.text===a.oldConversion.arg.text&&
a.conversion.message===a.oldConversion.message||(this.field.setConversion(a.conversion),d.setTextContent(this.descriptionEle,this.description),this._updatePosition())};g.prototype._updatePosition=function(){var a=this.getDimensionsOfAssignment();if(this.panelElement)this.panelElement.style.left=a.start*10+"px";this.focusManager.updatePosition(a)};g.prototype.getDimensionsOfAssignment=function(){for(var a="",b=this.requisition.getAssignments(!0),d=0;d<b.length;d++){if(b[d]===this.assignment)break;
a+=b[d].toString()}a+=this.assignment.arg.prefix;b=a.length;a+=this.assignment.arg.text;return{start:b,end:a.length}};Object.defineProperty(g.prototype,"description",{get:function(){return this.assignment instanceof k&&this.assignment.value==null?"":this.assignment.param.manual||this.assignment.param.description},enumerable:!0});g.prototype.visibilityChanged=function(a){this.panelElement&&(a.tooltipVisible?this.panelElement.classList.remove("gcli-panel-hide"):this.panelElement.classList.add("gcli-panel-hide"))};
i.Tooltip=g});define("text!gcli/ui/output_view.css",[],function(){return"\n.gcli-row-in {\n  padding: 0 4px;\n  box-shadow: 0 -6px 10px -6px #ddd;\n  border-top: 1px solid #bbb;\n}\n\n.gcli-row-in > img {\n  cursor: pointer;\n}\n\n.gcli-row-hover {\n  display: none;\n  float: right;\n  padding: 2px 2px 0;\n}\n\n.gcli-row-in:hover > .gcli-row-hover {\n  display: inline;\n}\n\n.gcli-row-in:hover > .gcli-row-hover.gcli-row-hidden {\n  display: none;\n}\n\n.gcli-row-duration {\n  color: #666;\n}\n\n.gcli-row-prompt {\n  color: #00F;\n  font-weight: bold;\n  font-size: 120%;\n}\n\n.gcli-row-prompt.gcli-row-complete {\n  color: #060;\n}\n\n.gcli-row-prompt.gcli-row-error {\n  color: #F00;\n}\n\n.gcli-row-duration {\n  font-size: 80%;\n}\n\n.gcli-row-out {\n  margin: 0 10px 15px;\n  padding: 0 10px;\n  line-height: 1.2em;\n  font-size: 95%;\n}\n\n.gcli-row-out strong,\n.gcli-row-out b,\n.gcli-row-out th,\n.gcli-row-out h1,\n.gcli-row-out h2,\n.gcli-row-out h3 {\n  color: #000;\n}\n\n.gcli-row-out p {\n  margin: 5px 0;\n}\n\n.gcli-row-out a {\n  color: hsl(200,40%,40%);\n  text-decoration: none;\n}\n\n.gcli-row-out a:hover {\n  cursor: pointer;\n  border-bottom: 1px dotted hsl(200,40%,60%);\n}\n\n.gcli-row-out input[type=password],\n.gcli-row-out input[type=text],\n.gcli-row-out textarea {\n  font-size: 120%;\n  background: transparent;\n  padding: 3px;\n  border-radius: 3px;\n  border: 1px solid #bbb;\n}\n\n.gcli-row-out table,\n.gcli-row-out td,\n.gcli-row-out th {\n  border: 0;\n  padding: 0 2px;\n}\n\n.gcli-row-terminal,\n.gcli-row-subterminal {\n  border-radius: 3px;\n  border: 1px solid #ddd;\n}\n\n.gcli-row-terminal {\n  height: 200px;\n  width: 620px;\n  font-size: 80%;\n}\n\n.gcli-row-subterminal {\n  height: 150px;\n  width: 300px;\n  font-size: 75%;\n}\n\n.gcli-out-shortcut {\n  font-weight: normal;\n  border: 1px solid #999;\n  border-radius: 3px;\n  color: #666;\n  cursor: pointer;\n  padding: 0 3px 1px;\n  margin: 1px 4px;\n  display: inline-block;\n}\n\n.gcli-out-shortcut:before {\n  content: '\\bb';\n  padding-right: 2px;\n  color: hsl(25,78%,50%);\n  font-weight: bold;\n  font-size: 110%;\n}"});
define("text!gcli/ui/output_terminal.html",[],function(){return'\n<div class="gcli-row">\n  <\!-- The div for the input (i.e. what was typed) --\>\n  <div class="gcli-row-in" save="${elems.rowin}" aria-live="assertive"\n      onclick="${copyToInput}" ondblclick="${execute}">\n\n    <\!-- What the user actually typed --\>\n    <span save="${elems.prompt}" class="gcli-row-prompt ${elems.error ? \'gcli-row-error\' : \'\'} ${elems.completed ? \'gcli-row-complete\' : \'\'}">${prompt}</span>\n    <span class="gcli-row-in-typed">${outputData.canonical}</span>\n\n    <\!-- The extra details that appear on hover --\>\n    <span class="gcli-row-duration gcli-row-hover" save="${elems.duration}"></span>\n    <\!--\n    <img class="gcli-row-hover" onclick="${hideOutput}" save="${elems.hide}"\n        alt="Hide command output" _src="${url(\'images/minus.png\')}"/>\n    <img class="gcli-row-hover gcli-row-hidden" onclick="${showOutput}" save="${elems.show}"\n        alt="Show command output" _src="${url(\'images/plus.png\')}"/>\n    <img class="gcli-row-hover" onclick="${remove}"\n        alt="Remove this command from the history"\n        _src="${url(\'images/closer.png\')}"/>\n    --\>\n    <img style="float:right;" _src="${url(\'images/throbber.gif\')}" save="${elems.throb}"/>\n  </div>\n\n  <\!-- The div for the command output --\>\n  <div class="gcli-row-out" aria-live="assertive" save="${elems.rowout}">\n  </div>\n</div>'});
define("gcli/ui/output_terminal","require,exports,module,util/util,util/domtemplate,gcli/canon,text!gcli/ui/output_view.css,text!gcli/ui/output_terminal.html".split(","),function(j,i,g){function d(b,c){this.element=c.element;this.requisition=c.requisition;this.requisition.commandOutputManager.onOutput.add(this.outputted,this);var d=c.element.ownerDocument;if(h!=null)this.style=k.importCss(h,d,"gcli-output-view");this.template=k.toDom(d,a);this.templateOptions={allowEval:!0,stack:"output_terminal.html"}}
function b(a,b){this.outputData=a;this.outputTerminal=b;this.url=k.createUrlLookup(g);this.elems={rowin:null,rowout:null,hide:null,show:null,duration:null,throb:null,prompt:null};var d=this.outputTerminal.template.cloneNode(!0);f.template(d,this,this.outputTerminal.templateOptions);this.outputTerminal.element.appendChild(this.elems.rowin);this.outputTerminal.element.appendChild(this.elems.rowout);this.outputData.onClose.add(this.closed,this);this.outputData.onChange.add(this.changed,this)}var k=j("util/util"),
f=j("util/domtemplate");j("gcli/canon");var h=j("text!gcli/ui/output_view.css"),a=j("text!gcli/ui/output_terminal.html");d.prototype.destroy=function(){this.style&&(this.style.parentNode.removeChild(this.style),delete this.style);this.requisition.commandOutputManager.onOutput.remove(this.outputted,this);delete this.requisition;delete this.element;delete this.template};d.prototype.outputted=function(a){if(!a.output.hidden)a.output.view=new b(a.output,this)};d.prototype.setHeight=function(a){this.element.style.height=
a+"px"};i.OutputTerminal=d;b.prototype.destroy=function(){this.outputData.onChange.remove(this.changed,this);this.outputData.onClose.remove(this.closed,this);this.outputTerminal.element.removeChild(this.elems.rowin);this.outputTerminal.element.removeChild(this.elems.rowout);delete this.outputData;delete this.outputTerminal;delete this.url;delete this.elems};Object.defineProperty(b.prototype,"prompt",{get:function(){return this.outputData.canonical?"\u00bb":""},enumerable:!0});b.prototype.copyToInput=
function(){this.outputTerminal.requisition&&this.outputTerminal.requisition.update(this.outputData.typed)};b.prototype.execute=function(){this.outputTerminal.requisition&&this.outputTerminal.requisition.updateExec(this.outputData.typed)};b.prototype.hideOutput=function(a){this.elems.rowout.style.display="none";this.elems.hide.classList.add("cmd_hidden");this.elems.show.classList.remove("cmd_hidden");a.stopPropagation()};b.prototype.showOutput=function(a){this.elems.rowout.style.display="block";this.elems.hide.classList.remove("cmd_hidden");
this.elems.show.classList.add("cmd_hidden");a.stopPropagation()};b.prototype.closed=function(){this.destroy()};b.prototype.changed=function(){var a=this.outputData.duration!=null?"completed in "+this.outputData.duration/1E3+" sec ":"",a=this.elems.rowout.ownerDocument.createTextNode(a);this.elems.duration.appendChild(a);this.outputData.completed&&this.elems.prompt.classList.add("gcli-row-complete");this.outputData.error&&this.elems.prompt.classList.add("gcli-row-error");this.outputData.toDom(this.elems.rowout);
this.outputTerminal.element.scrollTop=Math.max(this.outputTerminal.element.scrollHeight,this.outputTerminal.element.clientHeight)-this.outputTerminal.element.clientHeight;this.elems.throb.style.display=this.outputData.completed?"none":"block"};i.OutputView=b});
define("gcli/history",["require","exports","module"],function(j,i){function g(){this._buffer=[""];this._current=0}g.prototype.destroy=function(){delete this._buffer};g.prototype.add=function(d){this._buffer.splice(1,0,d);this._current=0};g.prototype.forward=function(){this._current>0&&this._current--;return this._buffer[this._current]};g.prototype.backward=function(){this._current<this._buffer.length-1&&this._current++;return this._buffer[this._current]};i.History=g});
define("text!gcli/ui/inputter.css",[],function(){return"\n.gcli-in-input,\n.gcli-in-complete,\n.gcli-prompt {\n  font-family: Segoe UI, Helvetica Neue, Verdana, Arial, sans-serif;\n}\n\n.gcli-in-input,\n.gcli-in-complete {\n  font-size: 110%;\n  font-weight: normal;\n  font-style: normal;\n  padding: 0 0 0 22px;\n  background-color: transparent;\n}\n\n.gcli-in-input {\n  color: #000;\n  border: 0;\n  box-shadow: 0 0 10px 1px #ddd;\n  border-top: 1px solid #999;\n}\n\n.gcli-in-complete {\n  position: absolute;\n  z-index: -1000;\n  color: transparent;\n  margin-top: -1px;\n  border-top: 1px solid transparent;\n}\n\n.gcli-prompt {\n  position: absolute;\n  z-index: -1001;\n  padding: 0 1px;\n  color: hsl(25,78%,50%);\n  font-size: 150%;\n  font-weight: bold;\n  line-height: 95%;\n}\n\n.gcli-in-incomplete {\n  border-bottom: 2px dotted #999;\n}\n\n.gcli-in-error {\n  border-bottom: 2px dotted #F00;\n}\n\n.gcli-in-ontab {\n  color: hsl(200,40%,70%);\n}\n\n.gcli-in-todo {\n  color: hsl(48,28%,76%);\n}\n\n.gcli-in-closebrace {\n  color: hsl(0,0%,80%);\n}\n\n.gcli-in-scratchlink {\n  float: right;\n  font-size: 85%;\n  color: #888;\n  padding-right: 10px;\n}"});
define("gcli/ui/inputter","require,exports,module,util/promise,util/util,util/util,gcli/types,gcli/history,text!gcli/ui/inputter.css".split(","),function(j,i){var g;function d(b,d){this.requisition=d.requisition;this.focusManager=d.focusManager;this.element=d.element;this.element.classList.add("gcli-in-input");this.element.spellcheck=!1;this.document=this.element.ownerDocument;this.scratchpad=b.scratchpad;if(e!=null)this.style=k.importCss(e,this.document,"gcli-inputter");this.lastTabDownAt=0;this._caretChange=
null;this.onKeyDown=this.onKeyDown.bind(this);this.onKeyUp=this.onKeyUp.bind(this);this.element.addEventListener("keydown",this.onKeyDown,!1);this.element.addEventListener("keyup",this.onKeyUp,!1);this.history=new a;this._scrollingThroughHistory=!1;this._choice=null;this.onChoiceChange=k.createEvent("Inputter.onChoiceChange");this.onMouseUp=this.onMouseUp.bind(this);this.element.addEventListener("mouseup",this.onMouseUp,!1);this.focusManager&&this.focusManager.addMonitoredElement(this.element,"input");
this._completed=c;this.requisition.onTextChange.add(this.textChanged,this);this.assignment=this.requisition.getAssignmentAt(0);this.onAssignmentChange=k.createEvent("Inputter.onAssignmentChange");this.onInputChange=k.createEvent("Inputter.onInputChange");this.onResize=k.createEvent("Inputter.onResize");this.onWindowResize=this.onWindowResize.bind(this);this.document.defaultView.addEventListener("resize",this.onWindowResize,!1);this.requisition.update(this.element.value||"")}var b=j("util/promise"),
k=j("util/util"),f=j("util/util").KeyEvent,h=j("gcli/types").Status,a=j("gcli/history").History,e=j("text!gcli/ui/inputter.css"),c=b.resolve(void 0);d.prototype.destroy=function(){this.document.defaultView.removeEventListener("resize",this.onWindowResize,!1);this.requisition.onTextChange.remove(this.textChanged,this);this.focusManager&&this.focusManager.removeMonitoredElement(this.element,"input");this.element.removeEventListener("mouseup",this.onMouseUp,!1);this.element.removeEventListener("keydown",
this.onKeyDown,!1);this.element.removeEventListener("keyup",this.onKeyUp,!1);this.history.destroy();this.style&&(this.style.parentNode.removeChild(this.style),delete this.style);delete this.onMouseUp;delete this.onKeyDown;delete this.onKeyUp;delete this.onWindowResize;delete this.tooltip;delete this.document;delete this.element};d.prototype.onWindowResize=function(){if(this.element){var a=this.getDimensions();if(a)this.onResize(a)}};d.prototype.getDimensions=function(){if(this.element.getBoundingClientRect){for(var a,
b,c=this.element.parentNode;c&&c.nodeName!=="#document";){var e=this.document.defaultView.getComputedStyle(c,"");if(e&&(e=e.getPropertyValue("position"),e==="absolute"||e==="fixed")){b=c.getBoundingClientRect();a=b.top;b=b.left;break}c=c.parentNode}c=this.element.getBoundingClientRect();return{top:c.top-(a||0)+1,height:c.bottom-c.top-1,left:c.left-(b||0)+2,width:c.right-c.left}}};d.prototype.onMouseUp=function(){this._checkAssignment()};d.prototype.textChanged=function(){if(this.document){if(this._caretChange==
null)this._caretChange=g;var a=this.requisition.toString(),b=this.getInputState();b.typed=a;this._processCaretChange(b);if(this.element.value!==a)this.element.value=a;this.onInputChange({inputState:b})}};g=3;d.prototype._processCaretChange=function(a){var b,c;switch(this._caretChange){case 1:b=0;c=a.typed.length;break;case 2:c=b=a.typed.length;break;case g:b=a.cursor.start;do b++;while(b<a.typed.length&&a.typed[b-1]!==" ");c=b;break;default:b=a.cursor.start,c=a.cursor.end}b=b>a.typed.length?a.typed.length:
b;c=c>a.typed.length?a.typed.length:c;a={typed:a.typed,cursor:{start:b,end:c}};if(this.element.selectionStart!==b)this.element.selectionStart=b;if(this.element.selectionEnd!==c)this.element.selectionEnd=c;this._checkAssignment(b);this._caretChange=null;return a};d.prototype._checkAssignment=function(a){if(a==null)a=this.element.selectionStart;a=this.requisition.getAssignmentAt(a);if(this.assignment!==a)this.assignment=a,this.onAssignmentChange({assignment:this.assignment});if(this.focusManager)a=
this.assignment.conversion.message,this.focusManager.setError(a!=null&&a!=="")};d.prototype.setInput=function(a){return this.requisition.update(a)};d.prototype.setCursor=function(a){this._caretChange=0;this._processCaretChange({typed:this.element.value,cursor:a})};d.prototype.focus=function(){this.element.focus();this._checkAssignment()};d.prototype.onKeyDown=function(a){if(a.keyCode===f.DOM_VK_UP||a.keyCode===f.DOM_VK_DOWN)a.preventDefault();else if(!(a.keyCode===f.DOM_VK_F1||a.keyCode===f.DOM_VK_ESCAPE||
a.keyCode===f.DOM_VK_UP||a.keyCode===f.DOM_VK_DOWN)){if(this.focusManager)this.focusManager.onInputChange();if(a.keyCode===f.DOM_VK_TAB){this.lastTabDownAt=0;if(!a.shiftKey)a.preventDefault(),this.lastTabDownAt=a.timeStamp;if(a.metaKey||a.altKey||a.crtlKey)this.document.commandDispatcher?this.document.commandDispatcher.advanceFocus():this.element.blur()}}};d.prototype.onKeyUp=function(a){this.handleKeyUp(a).then(null,console.error)};d.prototype.handleKeyUp=function(a){if(this.focusManager&&a.keyCode===
f.DOM_VK_F1)return this.focusManager.helpRequest(),c;if(this.focusManager&&a.keyCode===f.DOM_VK_ESCAPE)return this.focusManager.removeHelp(),c;if(a.keyCode===f.DOM_VK_UP){if(this.tooltip&&this.tooltip.isMenuShowing)this.changeChoice(-1);else if(this.element.value===""||this._scrollingThroughHistory)return this._scrollingThroughHistory=!0,this.requisition.update(this.history.backward());else if(this.assignment.getStatus()===h.VALID){if(this.requisition.increment(this.assignment),this.focusManager)this.focusManager.onInputChange()}else this.changeChoice(-1);
return c}if(a.keyCode===f.DOM_VK_DOWN){if(this.tooltip&&this.tooltip.isMenuShowing)this.changeChoice(1);else if(this.element.value===""||this._scrollingThroughHistory)return this._scrollingThroughHistory=!0,this.requisition.update(this.history.forward());else if(this.assignment.getStatus()===h.VALID){if(this.requisition.decrement(this.assignment),this.focusManager)this.focusManager.onInputChange()}else this.changeChoice(1);return c}if(a.keyCode===f.DOM_VK_RETURN)return this.requisition.getStatus()===
h.VALID?(this._scrollingThroughHistory=!1,this.history.add(this.element.value),this.requisition.exec()):this.tooltip.selectChoice()||this.focusManager.setError(!0),this._choice=null,c;if(a.keyCode===f.DOM_VK_TAB&&!a.shiftKey){if(this.element.value.length>0&&this.lastTabDownAt+1E3>a.timeStamp){this._caretChange=g;a=this.getInputState();this._processCaretChange(a);if(this._choice==null)this._choice=0;this._completed=this.requisition.complete(a.cursor,this._choice)}this.lastTabDownAt=0;this._scrollingThroughHistory=
!1;return this._completed.then(function(){this._choice=null;this.onChoiceChange({choice:this._choice})}.bind(this))}if(this.scratchpad&&this.scratchpad.shouldActivate(a))return this.scratchpad.activate(this.element.value)?this.requisition.update(""):c;this._scrollingThroughHistory=!1;this._caretChange=0;this._completed=this.requisition.update(this.element.value);return this._completed.then(function(){this._choice=null;this.onChoiceChange({choice:this._choice})}.bind(this))};d.prototype.changeChoice=
function(a){if(this._choice==null)this._choice=0;this._choice+=a;this.onChoiceChange({choice:this._choice})};d.prototype.getCurrentAssignment=function(){return this.requisition.getAssignmentAt(this.element.selectionStart)};d.prototype.getInputState=function(){var a={typed:this.element.value,cursor:{start:this.element.selectionStart,end:this.element.selectionEnd}};a.typed==null&&(a={typed:"",cursor:{start:0,end:0}});if(a.cursor.start==null)a.cursor.start=0;return a};i.Inputter=d});
define("text!gcli/ui/completer.html",[],function(){return'\n<div>\n  <loop foreach="member in ${statusMarkup}">\n    <span class="${member.className}">${member.string}</span>\n  </loop>\n  <span class="gcli-in-ontab">${directTabText}</span>\n  <span class="gcli-in-todo" foreach="param in ${emptyParameters}">${param}</span>\n  <span class="gcli-in-ontab">${arrowTabText}</span>\n  <span class="gcli-in-closebrace" if="${unclosedJs}">}</span>\n  <div class="gcli-in-scratchlink" if="${scratchLink}">${scratchLink}</div>\n</div>'});
define("gcli/ui/completer","require,exports,module,util/promise,util/util,util/domtemplate,text!gcli/ui/completer.html".split(","),function(j,i){function g(d,a){this.requisition=a.requisition;this.scratchpad=d.scratchpad;this.input={typed:"",cursor:{start:0,end:0}};this.choice=0;this.element=a.element;this.element.classList.add("gcli-in-complete");this.element.setAttribute("tabindex","-1");this.element.setAttribute("aria-live","polite");this.document=this.element.ownerDocument;this.inputter=a.inputter;
this.inputter.onInputChange.add(this.update,this);this.inputter.onAssignmentChange.add(this.update,this);this.inputter.onChoiceChange.add(this.update,this);if(this.autoResize=a.autoResize){this.inputter.onResize.add(this.resized,this);var e=this.inputter.getDimensions();e&&this.resized(e)}this.template=b.toDom(this.document,f);b.removeWhitespace(this.template,!0);this.update()}var d=j("util/promise"),b=j("util/util"),k=j("util/domtemplate"),f=j("text!gcli/ui/completer.html");g.prototype.destroy=function(){this.inputter.onInputChange.remove(this.update,
this);this.inputter.onAssignmentChange.remove(this.update,this);this.inputter.onChoiceChange.remove(this.update,this);this.autoResize&&this.inputter.onResize.remove(this.resized,this);delete this.document;delete this.element;delete this.template;delete this.inputter};g.prototype.resized=function(b){this.element.style.top=b.top+"px";this.element.style.height=b.height+"px";this.element.style.lineHeight=b.height+"px";this.element.style.left=b.left+"px";this.element.style.width=b.width+"px"};g.prototype.update=
function(d){this.choice=d&&d.choice!=null?d.choice:0;var d=this._getCompleterTemplateData(),a=this.template.cloneNode(!0);k.template(a,d,{stack:"completer.html"});for(b.clearElement(this.element);a.hasChildNodes();)this.element.appendChild(a.firstChild)};g.prototype._getCompleterTemplateData=function(){var b=d.defer(),a=d.defer(),e=d.defer(),c=this.inputter.getInputState(),f=this.requisition.getAssignmentAt(c.cursor.start),g=void 0;c.typed.trim().length!==0&&(g=f.getPredictionAt(this.choice));d.resolve(g).then(function(d){var g=
"",i="",j=[];if(c.typed.trim().length!==0){var k=f.arg;if(d){if(d=d.name,k=k.text,f.isInName()&&(d=" "+d),k!==d){var m=k.replace(/^\s*/,"");d.indexOf(m)===0&&c.cursor.start===c.typed.length?(m=k.match(/^(\s*)/)[0].length,g=d.slice(k.length-m)):i="\u21e5 "+d}}else k.type==="NamedArgument"&&k.text===""&&j.push("<"+f.param.type.name+">\u00a0")}g!==""?g+="\u00a0":this.requisition.typedEndsWithSeparator()||j.unshift("\u00a0");this.requisition.getAssignments().forEach(function(a){a.param.isPositionalAllowed&&
a.arg.toString().trim()===""&&(g!==""&&f===a||j.push(a.param.isDataRequired?"<"+a.param.name+">\u00a0":"["+a.param.name+"]\u00a0"))}.bind(this));var d=this.requisition.commandAssignment.value,q=!1;d&&d.hasNamedParameters&&d.params.forEach(function(a){var b=this.requisition.getAssignment(a.name).arg;!a.isPositionalAllowed&&!a.hidden&&b.type==="BlankArgument"&&(q=!0)},this);q&&j.push("[options]\u00a0");b.resolve(g);a.resolve(i);e.resolve(j)}.bind(this),console.error);return{statusMarkup:this._getStatusMarkup(c),
unclosedJs:this._getUnclosedJs(),scratchLink:this._getScratchLink(),directTabText:b.promise,arrowTabText:a.promise,emptyParameters:e.promise}};g.prototype._getStatusMarkup=function(b){b=this.requisition.getInputStatusMarkup(b.cursor.start);b.forEach(function(a){a.string=a.string.replace(/ /g,"\u00a0");a.className="gcli-in-"+a.status.toString().toLowerCase()},this);return b};g.prototype._getUnclosedJs=function(){var b=this.requisition.commandAssignment.value;return b&&b.name==="{"&&this.requisition.getAssignment(0).arg.suffix.indexOf("}")===
-1};g.prototype._getScratchLink=function(){var b=this.requisition.commandAssignment.value;return this.scratchpad&&b&&b.name==="{"?this.scratchpad.linkText:""};i.Completer=g});
define("gcli/ui/prompt",["require","exports","module"],function(j,i){function g(d,b){this.element=b.element;this.element.classList.add("gcli-prompt");this.element.appendChild(this.element.ownerDocument.createTextNode(d.promptChar||"\u00bb"));if(this.inputter=b.inputter){this.inputter.onResize.add(this.resized,this);var g=this.inputter.getDimensions();g&&this.resized(g)}}g.prototype.destroy=function(){this.inputter&&this.inputter.onResize.remove(this.resized,this);delete this.element};g.prototype.resized=
function(d){this.element.style.top=d.top+"px";this.element.style.height=d.height+"px";this.element.style.left=d.left+"px";this.element.style.width=d.width+"px"};i.Prompt=g});define("text!gcli/ui/display.css",[],function(){return"\n.gcli-output {\n  height: 100%;\n  overflow-x: hidden;\n  overflow-y: auto;\n  font-family: Segoe UI, Helvetica Neue, Verdana, Arial, sans-serif;\n}"});define("text!gcli/ui/display.html",[],function(){return'\n<div class="gcli-panel" save="${panel}">\n  <div save="${tooltip}"></div>\n  <div class="gcli-panel-connector"></div>\n</div>'});
define("gcli/ui/display","require,exports,module,util/util,util/domtemplate,gcli/settings,gcli/canon,gcli/cli,gcli/ui/intro,gcli/ui/tooltip,gcli/ui/output_terminal,gcli/ui/inputter,gcli/ui/completer,gcli/ui/focus,gcli/ui/prompt,text!gcli/ui/display.css,text!gcli/ui/display.html".split(","),function(j,i){function g(g){var h=g.document||document;this.displayStyle=void 0;if(r!=null)this.displayStyle=k.importCss(r,h,"gcli-css-display");this.commandOutputManager=g.commandOutputManager;if(this.commandOutputManager==
null)this.commandOutputManager=new a;this.requisition=new e(g.environment||{},h,this.commandOutputManager);this.focusManager=new p(g,{document:h,requisition:this.requisition});this.inputElement=d(h,g.inputElement||null,"gcli-input");this.inputter=new n(g,{requisition:this.requisition,focusManager:this.focusManager,element:this.inputElement});this.completeElement=b(this.inputElement,g.completeElement||null,"gcli-row-complete");this.completer=new o(g,{requisition:this.requisition,inputter:this.inputter,
autoResize:this.completeElement.gcliCreated,element:this.completeElement});this.prompt=new u(g,{inputter:this.inputter,element:b(this.inputElement,g.promptElement||null,"gcli-prompt")});this.element=d(h,g.displayElement||null,"gcli-display");this.element.classList.add("gcli-display");this.template=k.toDom(h,t);this.elements={};f.template(this.template,this.elements,{stack:"display.html"});this.element.appendChild(this.template);this.tooltip=new l(g,{requisition:this.requisition,inputter:this.inputter,
focusManager:this.focusManager,element:this.elements.tooltip,panelElement:this.elements.panel});this.inputter.tooltip=this.tooltip;this.outputElement=k.createElement(h,"div");this.outputElement.classList.add("gcli-output");this.outputList=new m(g,{requisition:this.requisition,element:this.outputElement});this.element.appendChild(this.outputElement);c.maybeShowIntro(this.commandOutputManager,this.requisition)}function d(a,b,c){if(!b&&(b=a.getElementById(c),!b))throw Error("Missing element, id="+c);
return b}function b(a,b){var c=a.ownerDocument;if(!b&&(b=c.getElementById("gcli-row-complete"),!b))b=k.createElement(c,"div"),a.parentNode.insertBefore(b,a.nextSibling),b.gcliCreated=!0;return b}var k=j("util/util"),f=j("util/domtemplate"),h=j("gcli/settings"),a=j("gcli/canon").CommandOutputManager,e=j("gcli/cli").Requisition,c=j("gcli/ui/intro"),l=j("gcli/ui/tooltip").Tooltip,m=j("gcli/ui/output_terminal").OutputTerminal,n=j("gcli/ui/inputter").Inputter,o=j("gcli/ui/completer").Completer,p=j("gcli/ui/focus").FocusManager,
u=j("gcli/ui/prompt").Prompt,r=j("text!gcli/ui/display.css"),t=j("text!gcli/ui/display.html");i.createDisplay=function(a){a.settings!=null&&h.setDefaults(a.settings);var a=new g(a),b=a.requisition;return{exec:b.exec.bind(b),update:b.update.bind(b),updateExec:b.updateExec.bind(b),destroy:a.destroy.bind(a)}};g.prototype.destroy=function(){delete this.element;delete this.template;this.outputList.destroy();delete this.outputList;delete this.outputElement;this.tooltip.destroy();delete this.tooltip;this.prompt.destroy();
delete this.prompt;this.completer.destroy();delete this.completer;delete this.completeElement;this.inputter.destroy();delete this.inputter;delete this.inputElement;this.focusManager.destroy();delete this.focusManager;this.requisition.destroy();delete this.requisition;this.displayStyle&&this.displayStyle.parentNode.removeChild(this.displayStyle);delete this.displayStyle};i.Display=g});
define("gcli/index","require,exports,module,util/legacy,gcli/canon,gcli/canon,gcli/types/basic,gcli/types/command,gcli/types/javascript,gcli/types/node,gcli/types/resource,gcli/types/selection,gcli/types/setting,gcli/settings,gcli/cli,gcli/ui/intro,gcli/ui/focus,gcli/ui/fields/basic,gcli/ui/fields/javascript,gcli/ui/fields/selection,gcli/ui/display".split(","),function(j,i){j("util/legacy");i.addCommand=j("gcli/canon").addCommand;i.removeCommand=j("gcli/canon").removeCommand;j("gcli/types/basic").startup();
j("gcli/types/command").startup();j("gcli/types/javascript").startup();j("gcli/types/node").startup();j("gcli/types/resource").startup();j("gcli/types/selection").startup();j("gcli/types/setting").startup();j("gcli/settings").startup();j("gcli/cli").startup();j("gcli/ui/intro").startup();j("gcli/ui/focus").startup();j("gcli/ui/fields/basic").startup();j("gcli/ui/fields/javascript").startup();j("gcli/ui/fields/selection").startup();var g=j("gcli/ui/display");i.createDisplay=function(d){return g.createDisplay(d||
{})};i.createView=i.createDisplay});define("text!gcli/commands/help_man.html",[],function(){return'\n<div>\n  <h3>${command.name}</h3>\n\n  <h4 class="gcli-help-header">\n    ${l10n.helpManSynopsis}:\n    <span class="gcli-out-shortcut" onclick="${onclick}" data-command="${command.name}">\n      ${command.name}\n      <span foreach="param in ${command.params}">\n        ${param.defaultValue !== undefined ? \'[\' + param.name + \']\' : param.name}\n      </span>\n    </span>\n  </h4>\n\n  <h4 class="gcli-help-header">${l10n.helpManDescription}:</h4>\n\n  <p class="gcli-help-description">${describe(command)}</p>\n\n  <div if="${command.exec}">\n    <h4 class="gcli-help-header">${l10n.helpManParameters}:</h4>\n\n    <ul class="gcli-help-parameter">\n      <li if="${command.params.length === 0}">${l10n.helpManNone}</li>\n      <li foreach="param in ${command.params}">\n        ${param.name} <em>${getTypeDescription(param)}</em>\n        <br/>\n        ${describe(param)}\n      </li>\n    </ul>\n  </div>\n\n  <div if="${!command.exec}">\n    <h4 class="gcli-help-header">${l10n.subCommands}:</h4>\n\n    <ul class="gcli-help-${subcommands}">\n      <li if="${subcommands.length === 0}">${l10n.subcommandsNone}</li>\n      <li foreach="subcommand in ${subcommands}">\n        <strong>${subcommand.name}</strong>:\n        ${subcommand.description}\n        <span class="gcli-out-shortcut" data-command="help ${subcommand.name}"\n            onclick="${onclick}" ondblclick="${ondblclick}">\n          help ${subcommand.name}\n        </span>\n      </li>\n    </ul>\n  </div>\n\n</div>'});
define("text!gcli/commands/help_list.html",[],function(){return'\n<div>\n  <div if="${includeIntro}">\n    <h2>Welcome to GCLI</h2>\n    <p>GCLI is an experiment to create a highly usable JavaScript command line for developers.</p>\n    <p>\n      Useful links:\n      <a href=\'https://github.com/joewalker/gcli\'>Source</a> (Apache-2.0),\n      <a href=\'https://github.com/joewalker/gcli/blob/master/docs/index.md\'>Documentation</a> (for users/embedders),\n      <a href=\'https://wiki.mozilla.org/DevTools/Features/GCLI\'>Mozilla feature page</a> (for GCLI in the web console).\n    </p>\n  </div>\n\n  <h3>${heading}</h3>\n\n  <table>\n    <tr foreach="command in ${matchingCommands}">\n      <th class="gcli-help-name">${command.name}</th>\n      <td class="gcli-help-arrow">-</td>\n      <td>\n        ${command.description}\n        <span class="gcli-out-shortcut"\n            onclick="${onclick}" ondblclick="${ondblclick}"\n            data-command="help ${command.name}">help ${command.name}</span>\n      </td>\n    </tr>\n  </table>\n</div>'});
define("text!gcli/commands/help.css",[],function(){return"\n.gcli-help-name {\n  text-align: end;\n}\n\n.gcli-help-arrow {\n  color: #AAA;\n}\n\n.gcli-help-description {\n  margin: 0 20px;\n  padding: 0;\n}\n\n.gcli-help-parameter {\n  margin: 0 30px;\n  padding: 0;\n}\n\n.gcli-help-header {\n  margin: 10px 0 6px;\n}"});
define("gcli/commands/help","require,exports,module,util/util,util/l10n,gcli/canon,gcli/ui/view,text!gcli/commands/help_man.html,text!gcli/commands/help_list.html,text!gcli/commands/help.css".split(","),function(j,i){function g(a,c){var d=f.getCommands().filter(function(b){return b.hidden?!1:a.search&&b.name.indexOf(a.search)!==0?!1:!a.search&&b.name.indexOf(" ")!=-1?!1:!0});d.sort(function(a,b){return a.name.localeCompare(b.name)});var g;g=d.length===0?k.lookupFormat("helpListNone",[a.search]):a.search==
null?k.lookup("helpListAll"):k.lookupFormat("helpListPrefix",[a.search]);return{l10n:k.propertyLookup,includeIntro:a.search==null,matchingCommands:d,heading:g,onclick:function(a){b.updateCommand(a.currentTarget,c)},ondblclick:function(a){b.executeCommand(a.currentTarget,c)}}}function d(a,c){var d={l10n:k.propertyLookup,command:a,onclick:function(a){b.updateCommand(a.currentTarget,c)},ondblclick:function(a){b.executeCommand(a.currentTarget,c)},describe:function(a){return a.manual||a.description},getTypeDescription:function(a){var b=
"",b=a.defaultValue===void 0?k.lookup("helpManRequired"):a.defaultValue===null?k.lookup("helpManOptional"):a.defaultValue;return"("+a.type.name+", "+b+")"}};Object.defineProperty(d,"subcommands",{get:function(){var b=f.getCommands().filter(function(b){return b.name.indexOf(a.name)===0&&b.name!==a.name});b.sort(function(a,b){return a.name.localeCompare(b.name)});return b},enumerable:!0});return d}var b=j("util/util"),k=j("util/l10n"),f=j("gcli/canon"),h=j("gcli/ui/view");i.helpManHtml=j("text!gcli/commands/help_man.html");
i.helpListHtml=j("text!gcli/commands/help_list.html");i.helpCss=j("text!gcli/commands/help.css");var a={name:"help",description:k.lookup("helpDesc"),manual:k.lookup("helpManual"),params:[{name:"search",type:"string",description:k.lookup("helpSearchDesc"),manual:k.lookup("helpSearchManual3"),defaultValue:null}],returnType:"html",exec:function(a,b){var l=f.getCommand(a.search||void 0);return l?h.createView({html:i.helpManHtml,options:{allowEval:!0,stack:"help_man.html"},data:d(l,b),css:i.helpCss,cssId:"gcli-help"}):
h.createView({html:i.helpListHtml,options:{allowEval:!0,stack:"help_list.html"},data:g(a,b),css:i.helpCss,cssId:"gcli-help"})}};i.startup=function(){f.addCommand(a)};i.shutdown=function(){f.removeCommand(a)}});
define("orion/shell/Shell","i18n!orion/widgets/nls/messages,orion/i18nUtil,gcli/index,gcli/types,gcli/types/selection,gcli/argument,gcli/ui/fields,gcli/ui/fields/menu,util/util,gcli/settings,gcli/canon,gcli/cli,gcli/commands/help,util/promise".split(","),function(j,i,g,d,b,k,f,h,a,e,c,l,m,n){function o(){}o.prototype=Object.create(b.SelectionType.prototype);var p;p={CompletionStatus:{MATCH:0,PARTIAL:1,ERROR:2}};p.Shell=function(){function b(a){this._init(a.input,a.output)}b.prototype={clear:function(){for(var a=
document.getElementsByClassName("gcli-output")[0];a.hasChildNodes();)a.removeChild(a.lastChild);this.output(i.formatMessage(j["For a list of available commands type '${0}'."],"<b>help</b>"))},output:function(a){var b=new l.Output;this.commandOutputManager.onOutput({output:b});b.complete(a)},registerCommand:function(a){if(!a.exec)a.exec=a.callback;if(!a.params)a.params=a.parameters;var b=function(a){return function(b,c){var d=a(b,c);this.registeredTypes.forEach(function(a){a.prototype.lastParseTimestamp=
0});return d}.bind(this)}.bind(this);if(a.exec)a.exec=b(a.exec);g.addCommand(a)},registerType:function(a){a=function(a){function b(a){this.typeSpec=a}b.prototype=Object.create(o.prototype);b.prototype.name=a.getName();b.prototype.lastParseTimestamp=0;b.prototype.parse=function(b){var c=Object.getPrototypeOf(this),e=c.lastParseTimestamp;c.lastParseTimestamp=Math.round((new Date).getTime()/1E3);c=JSON.parse(JSON.stringify(b));return a.parse(c,this.typeSpec,{lastParseTimestamp:e}).then(function(a){var c=
d.Status.VALID;if(a.status)switch(a.status){case p.CompletionStatus.ERROR:c=d.Status.ERROR;break;case p.CompletionStatus.PARTIAL:c=d.Status.INCOMPLETE}var e=n.defer();e.resolve(a.predictions);return new d.Conversion(a.value,b,c,a.message,e.promise)})};b.prototype.lookup=function(){var b=Object.getPrototypeOf(this),c=b.lastParseTimestamp;b.lastParseTimestamp=Math.round((new Date).getTime()/1E3);return a.parse({prefix:"",suffix:"",text:""},this.typeSpec,{lastParseTimestamp:c}).then(function(a){return a.predictions})};
if(a.stringify)b.prototype.stringify=function(b){return a.stringify(b,this.typeSpec)};return b}(a);d.registerType(a);this.registeredTypes.push(a)},setFocusToInput:function(){this.inputText.focus()},setInputText:function(a){if(a)this.inputText.value=a.toString()},addField:function(){},_init:function(b,d){function l(b,c){f.Field.call(this,b,c);this.isImportant=!0;this.element=a.createElement(this.document,"div");this.element.className="orion";this.menu=new h.Menu({document:this.document,field:!0,type:b});
this.menu.onItemClick=this.onItemClick.bind(this);this.element.appendChild(this.menu.element);this.onFieldChange=a.createEvent("CustomField.fieldChanged");this.onInputChange=this.onInputChange.bind(this)}this.registeredTypes=[];var k=document.createElement("div");k.id="gcli-display";k.style.height="100%";k.style.width="100%";d.appendChild(k);this.inputText=document.createElement("input");this.inputText.type="text";this.inputText.id="gcli-input";this.inputText.style.width="100%";this.inputText.style.height=
"100%";b.appendChild(this.inputText);e.getSetting("hideIntro").value=!0;e.getSetting("eagerHelper").value=2;setTimeout(function(){this.commandOutputManager=new c.CommandOutputManager;g.createDisplay({commandOutputManager:this.commandOutputManager});this.output(i.formatMessage(j["For a list of available commands type '${0}'."],"<b>help</b>"))}.bind(this),1);m.startup();m.helpListHtml=m.helpListHtml.replace('"${includeIntro}"',"${false}");l.prototype=Object.create(f.Field.prototype);l.prototype.destroy=
function(){f.Field.prototype.destroy.call(this);this.menu.destroy();delete this.element;delete this.menu;delete this.document;delete this.onInputChange};l.prototype.setConversion=function(a){this.setMessage(a.message);var b=[];a.getPredictions().forEach(function(a){a.hidden||b.push({name:a.name,complete:a.name,description:a.description||""})},this);this.menu.show(b);a.then&&a.then(function(){this.element&&this.setConversion(this.getConversion())}.bind(this))};l.prototype.onItemClick=function(a){a=
a.conversion;this.onFieldChange({conversion:a});this.setMessage(a.message)};l.claim=function(a){return a instanceof o?f.Field.MATCH+1:f.Field.NO_MATCH};f.addField(l)}};return b}();return p});
define("shell/shellPageFileService",["i18n!orion/shell/nls/messages","orion/bootstrap","orion/fileClient","orion/Deferred"],function(j,i,g,d){var b;b={};var k,f;i.startup().then(function(b){f=b.serviceRegistry;k=new g.FileClient(f)});b.ShellPageFileService=function(){function b(){this.currentDirectory=null;this.withNode(this.SEPARATOR,function(a){this.rootNode=a}.bind(this));this.currentRetrievals={}}b.prototype={SEPARATOR:"/",computePathString:function(a){if(a.Location===this.SEPARATOR)return this.SEPARATOR;
var b=this.SEPARATOR+k.fileServiceName(a.Location),c=a.Parents;if(c){b+=this.SEPARATOR;for(var d=c.length;--d>=0;)b+=c[d].Name,b+=this.SEPARATOR;b+=a.Name}a.Directory&&(b+=this.SEPARATOR);return b},createDirectory:function(a,b){return this._createResource(a,b,!0)},createFile:function(a,b){return this._createResource(a,b,!1)},ensureDirectory:function(a,b){var c=new d;typeof b!=="string"?b.Directory?c.resolve(b):c.reject(j["Cannot create directory, it already exists as a file"]):(a=a||this.getCurrentDirectory(),
this.withChildren(a,function(d){if(d)for(var f=0;f<d.length;f++)if(d[f].Name===b){d[f].Directory?c.resolve(d[f]):c.reject(j["Cannot create directory, it already exists as a file"]);return}this.createDirectory(a,b).then(function(a){c.resolve(a)},function(a){c.reject(a)})}.bind(this),function(a){c.reject(a)}));return c},ensureFile:function(a,b){var c=new d;typeof b!=="string"?b.Directory?c.reject(j["Cannot create file, it already exists as a directory"]):c.resolve(b):(a=a||this.getCurrentDirectory(),
this.withChildren(a,function(d){if(d)for(var f=0;f<d.length;f++)if(d[f].Name===b){d[f].Directory?c.reject(j["Cannot create file, it already exists as a directory"]):c.resolve(d[f]);return}this.createFile(a,b).then(function(a){c.resolve(a)},function(a){c.reject(a)})}.bind(this),function(a){c.reject(a)}));return c},getChild:function(a,b){if(b.length===0)return null;if(b===".")return a;if(b==="..")return this.getParent(a);if(!a.Children)return null;for(var c=0;c<a.Children.length;c++)if(a.Children[c].Name===
b)return a.Children[c];return null},getCurrentDirectory:function(){return this.currentDirectory},getDirectory:function(a,b){if(b.indexOf(this.SEPARATOR)===0)a=this.rootNode,b=b.substring(1);else if(!a){if(!this.currentDirectory)return null;a=this.currentDirectory}for(var c=b.substring(0,b.lastIndexOf(this.SEPARATOR)).split(this.SEPARATOR),d=a,f=0;f<c.length;f++)if(c[f].length>0&&(d=this.getChild(d,c[f]),!d||!d.Directory))return null;c=b.substring(b.lastIndexOf(this.SEPARATOR)+1);(c=this.getChild(d,
c))&&this._retrieveNode(c);d.Children||this._retrieveNode(d);return d},getParent:function(a){a.parent&&this._retrieveNode(a.parent);return a.parent},loadWorkspace:function(a){var b=f.getService("orion.page.progress");return b?b.progress(k.loadWorkspace(a),"Loading workspace "+a):k.loadWorkspace(a)},read:function(a){return k.read(a.Location,!1)},readBlob:function(a){var b=k._getService(a.Location);return!b.readBlob?(a=new d,a.reject(j["Source file service does not support binary read"]),a):b.readBlob(a.Location)},
setCurrentDirectory:function(a){this.currentDirectory=a;this._retrieveNode(a)},withChildren:function(a,b,c){if(a.Children)b&&b(a.Children);else if(a.ChildrenLocation){var d=f.getService("orion.page.progress");(d?d.progress(k.fetchChildren(a.ChildrenLocation),"Getting children of "+a.Name):k.fetchChildren(a.ChildrenLocation)).then(function(c){this._sort(c);var d=a.Parents?a.Parents.slice(0):[];(!a.parent||a.parent!==this.rootNode)&&d.unshift(a);for(var f=0;f<c.length;f++)c[f].parent=a,c[f].Parents=
d;a.Children=c;b&&b(c)}.bind(this),function(a){c&&c(a)})}else b&&b(null)},withNode:function(a,b,c){var d=f.getService("orion.page.progress");(d?d.progress(k.loadWorkspace(a),"Loading workspace "+a):k.loadWorkspace(a)).then(function(a){this._retrieveNode(a,b,c)}.bind(this),c)},write:function(a,b){return k.write(a.Location,b)},writeBlob:function(a,b){var c=k._getService(a.Location);return!c.writeBlob?(c=new d,c.reject(j["Target file service does not support binary write"]),c):c.writeBlob(a.Location,
b)},_createResource:function(a,b,c){var f=a.Location+this.SEPARATOR+b,g=new d,h=this.currentRetrievals[f]||[];h.push(g);if(h.length===1){this.currentRetrievals[f]=h;var i=function(a){if(c)a.Name=b;this.currentRetrievals[f].forEach(function(b){b.resolve(a)});delete this.currentRetrievals[f]}.bind(this),j=function(a){this.currentRetrievals[f].forEach(function(b){b.reject(a.responseText)});delete this.currentRetrievals[f]}.bind(this);c?a.Projects?k.createProject(a.Location,b).then(function(a){k.read(a.ContentLocation,
!0).then(i,j)},j):k.createFolder(a.Location,b).then(i,j):k.createFile(a.Location,b).then(i,j)}return g},_retrieveNode:function(a,b,c){if(a.parent&&a.Children)b&&b(a);else{var d=function(a,b,c){a.Directory&&!a.Children?this.withChildren(a,function(){b&&b(a)},c):b&&b(a)}.bind(this),g=function(a,b,c){if(a.Location===this.SEPARATOR)b(a);else if(a.Parents)if(a.Parents.length===0){var d=k.fileServiceRootURL(a.Location),e=f.getService("orion.page.progress");(e?e.progress(k.loadWorkspace(d),"Loading workspace "+
d):k.loadWorkspace(d)).then(function(c){c.parent=this.rootNode;a.parent=c;b(a)}.bind(this),c)}else{a.parent=a.Parents[0];for(c=0;c<a.Parents.length-1;c++)a.Parents[c].parent=a.Parents[c+1],a.Parents[c].Directory=!0;b(a)}else a.parent=this.rootNode,b(a)}.bind(this);if(!a.Parents&&!a.Projects&&a.Location!==this.SEPARATOR&&a.Name!==k.fileServiceName(a.Location)){var h=f.getService("orion.page.progress");(h?h.progress(k.loadWorkspace(a.Location),"Loading workspace "+a.Location):k.loadWorkspace(a.Location)).then(function(f){a.Parents=
f.Parents;g(a,function(a){d(a,b,c)},function(){d(a,b,c)})})}else{if(a.ChildrenLocation)a.Directory=!0;g(a,function(a){d(a,b,c)},function(){d(a,b,c)})}}},_sort:function(a){a.sort(function(a,b){if(a.Directory!==b.Directory)return a.Directory?-1:1;var d=a.Name&&a.Name.toLowerCase(),f=b.Name&&b.Name.toLowerCase();return d<f?-1:d>f?1:0})}};return b}();return b});
define("orion/urlUtils",["orion/PageUtil","orion/URL-shim"],function(j){return{detectValidURL:function(i){for(var g=/\[([^\]]*)\]\(([^\)]+)\)/g,d=g.exec(i),b=[],k=0;d;){if(d.length===3&&d[2].length>0){var f=new URL(d[2]);f.protocol!==":"&&j.validateURLScheme(f.href)&&(d.index>k&&b.push({segmentStr:i.substring(k,d.index)}),b.push({segmentStr:d[1].length>0?d[1]:d[2],urlStr:d[2]}),k=d.index+d[0].length)}d=g.exec(i)}if(k===0)return null;k<i.length-1&&b.push({segmentStr:i.substring(k)});return b},processURLSegments:function(i,
g){g.forEach(function(d){if(d.urlStr){var b=document.createElement("a");b.href=d.urlStr;b.appendChild(document.createTextNode(d.segmentStr))}else b=document.createElement("span"),b.textContent=d.segmentStr;i.appendChild(b)})}}});
(function(){function j(b){this.tokens=[];this.tokens.links={};this.options=b||h.defaults;this.rules=a.normal;if(this.options.gfm)this.rules=this.options.tables?a.tables:a.gfm}function i(a,b){this.options=b||h.defaults;this.links=a;this.rules=e.normal;if(!this.links)throw Error("Tokens array requires a `links` property.");if(this.options.gfm)this.rules=this.options.breaks?e.breaks:e.gfm;else if(this.options.pedantic)this.rules=e.pedantic}function g(a){this.tokens=[];this.token=null;this.options=a||
h.defaults}function d(a,b){return a.replace(!b?/&(?!#?\w+;)/g:/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function b(a,b){a=a.source;b=b||"";return function n(d,e){if(!d)return RegExp(a,b);e=e.source||e;e=e.replace(/(^|[^\[])\^/g,"$1");a=a.replace(d,e);return n}}function k(){}function f(a){for(var b=1,d,e;b<arguments.length;b++)for(e in d=arguments[b],d)Object.prototype.hasOwnProperty.call(d,e)&&(a[e]=d[e]);return a}function h(a,b,e){if(e||
typeof b==="function"){e||(e=b,b=null);b&&(b=f({},h.defaults,b));var i=b.highlight,k,p,u=0;try{k=j.lex(a,b)}catch(r){return e(r)}p=k.length;var t=function(a){var c,d;a!==!0&&delete b.highlight;try{c=g.parse(k,b)}catch(f){d=f}b.highlight=i;return d?e(d):e(null,c)};if(!i||i.length<3)return t(!0);if(!p)return t();for(;u<k.length;u++)(function(a){return a.type!=="code"?--p||t():i(a.text,a.lang,function(b,c){if(c==null||c===a.text)return--p||t();a.text=c;a.escaped=!0;--p||t()})})(k[u])}else try{return b&&
(b=f({},h.defaults,b)),g.parse(j.lex(a,b),b)}catch(q){q.message+="\nPlease report this to https://github.com/chjj/marked.";if((b||h.defaults).silent)return"<p>An error occured:</p><pre>"+d(q.message+"",!0)+"</pre>";throw q;}}var a={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:k,hr:/^( *[-*_]){3,} *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/,nptable:k,lheading:/^([^\n]+)\n *(=|-){3,} *\n*/,blockquote:/^( *>[^\n]+(\n[^\n]+)*\n*)+/,list:/^( *)(bull) [\s\S]+?(?:hr|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,
html:/^ *(?:comment|closed|closing) *(?:\n{2,}|\s*$)/,def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +["(]([^\n]+)[")])? *(?:\n+|$)/,table:k,paragraph:/^((?:[^\n]+\n?(?!hr|heading|lheading|blockquote|tag|def))+)\n*/,text:/^[^\n]+/,bullet:/(?:[*+-]|\d+\.)/,item:/^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/};a.item=b(a.item,"gm")(/bull/g,a.bullet)();a.list=b(a.list)(/bull/g,a.bullet)("hr",/\n+(?=(?: *[-*_]){3,} *(?:\n+|$))/)();a._tag="(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:/|@)\\b";
a.html=b(a.html)("comment",/<\!--[\s\S]*?--\>/)("closed",/<(tag)[\s\S]+?<\/\1>/)("closing",/<tag(?:"[^"]*"|'[^']*'|[^'">])*?>/)(/tag/g,a._tag)();a.paragraph=b(a.paragraph)("hr",a.hr)("heading",a.heading)("lheading",a.lheading)("blockquote",a.blockquote)("tag","<"+a._tag)("def",a.def)();a.normal=f({},a);a.gfm=f({},a.normal,{fences:/^ *(`{3,}|~{3,}) *(\S+)? *\n([\s\S]+?)\s*\1 *(?:\n+|$)/,paragraph:/^/});a.gfm.paragraph=b(a.paragraph)("(?!","(?!"+a.gfm.fences.source.replace("\\1","\\2")+"|")();a.tables=
f({},a.gfm,{nptable:/^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/,table:/^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/});j.rules=a;j.lex=function(a,b){return(new j(b)).lex(a)};j.prototype.lex=function(a){a=a.replace(/\r\n|\r/g,"\n").replace(/\t/g,"    ").replace(/\u00a0/g," ").replace(/\u2424/g,"\n");return this.token(a,!0)};j.prototype.token=function(b,d){for(var b=b.replace(/^ +$/gm,""),e,f,g,h,i,j,k;b;){if(g=this.rules.newline.exec(b))b=b.substring(g[0].length),g[0].length>
1&&this.tokens.push({type:"space"});if(g=this.rules.code.exec(b))b=b.substring(g[0].length),g=g[0].replace(/^ {4}/gm,""),this.tokens.push({type:"code",text:!this.options.pedantic?g.replace(/\n+$/,""):g});else if(g=this.rules.fences.exec(b))b=b.substring(g[0].length),this.tokens.push({type:"code",lang:g[2],text:g[3]});else if(g=this.rules.heading.exec(b))b=b.substring(g[0].length),this.tokens.push({type:"heading",depth:g[1].length,text:g[2]});else if(d&&(g=this.rules.nptable.exec(b))){b=b.substring(g[0].length);
i={type:"table",header:g[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:g[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:g[3].replace(/\n$/,"").split("\n")};for(j=0;j<i.align.length;j++)i.align[j]=/^ *-+: *$/.test(i.align[j])?"right":/^ *:-+: *$/.test(i.align[j])?"center":/^ *:-+ *$/.test(i.align[j])?"left":null;for(j=0;j<i.cells.length;j++)i.cells[j]=i.cells[j].split(/ *\| */);this.tokens.push(i)}else if(g=this.rules.lheading.exec(b))b=b.substring(g[0].length),this.tokens.push({type:"heading",
depth:g[2]==="="?1:2,text:g[1]});else if(g=this.rules.hr.exec(b))b=b.substring(g[0].length),this.tokens.push({type:"hr"});else if(g=this.rules.blockquote.exec(b))b=b.substring(g[0].length),this.tokens.push({type:"blockquote_start"}),g=g[0].replace(/^ *> ?/gm,""),this.token(g,d),this.tokens.push({type:"blockquote_end"});else if(g=this.rules.list.exec(b)){b=b.substring(g[0].length);h=g[2];this.tokens.push({type:"list_start",ordered:h.length>1});g=g[0].match(this.rules.item);e=!1;k=g.length;for(j=0;j<
k;j++)i=g[j],f=i.length,i=i.replace(/^ *([*+-]|\d+\.) +/,""),~i.indexOf("\n ")&&(f-=i.length,i=!this.options.pedantic?i.replace(RegExp("^ {1,"+f+"}","gm"),""):i.replace(/^ {1,4}/gm,"")),this.options.smartLists&&j!==k-1&&(f=a.bullet.exec(g[j+1])[0],h!==f&&!(h.length>1&&f.length>1)&&(b=g.slice(j+1).join("\n")+b,j=k-1)),f=e||/\n\n(?!\s*$)/.test(i),j!==k-1&&(e=i[i.length-1]==="\n",f||(f=e)),this.tokens.push({type:f?"loose_item_start":"list_item_start"}),this.token(i,!1),this.tokens.push({type:"list_item_end"});
this.tokens.push({type:"list_end"})}else if(g=this.rules.html.exec(b))b=b.substring(g[0].length),this.tokens.push({type:this.options.sanitize?"paragraph":"html",pre:g[1]==="pre"||g[1]==="script",text:g[0]});else if(d&&(g=this.rules.def.exec(b)))b=b.substring(g[0].length),this.tokens.links[g[1].toLowerCase()]={href:g[2],title:g[3]};else if(d&&(g=this.rules.table.exec(b))){b=b.substring(g[0].length);i={type:"table",header:g[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:g[2].replace(/^ *|\| *$/g,
"").split(/ *\| */),cells:g[3].replace(/(?: *\| *)?\n$/,"").split("\n")};for(j=0;j<i.align.length;j++)i.align[j]=/^ *-+: *$/.test(i.align[j])?"right":/^ *:-+: *$/.test(i.align[j])?"center":/^ *:-+ *$/.test(i.align[j])?"left":null;for(j=0;j<i.cells.length;j++)i.cells[j]=i.cells[j].replace(/^ *\| *| *\| *$/g,"").split(/ *\| */);this.tokens.push(i)}else if(d&&(g=this.rules.paragraph.exec(b)))b=b.substring(g[0].length),this.tokens.push({type:"paragraph",text:g[1][g[1].length-1]==="\n"?g[1].slice(0,-1):
g[1]});else if(g=this.rules.text.exec(b))b=b.substring(g[0].length),this.tokens.push({type:"text",text:g[0]});else if(b)throw Error("Infinite loop on byte: "+b.charCodeAt(0));}return this.tokens};var e={escape:/^\\([\\`*{}\[\]()#+\-.!_>])/,autolink:/^<([^ >]+(@|:\/)[^ >]+)>/,url:k,tag:/^<\!--[\s\S]*?--\>|^<\/?\w+(?:"[^"]*"|'[^']*'|[^'">])*?>/,link:/^!?\[(inside)\]\(href\)/,reflink:/^!?\[(inside)\]\s*\[([^\]]*)\]/,nolink:/^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]/,strong:/^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/,
em:/^\b_((?:__|[\s\S])+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/,code:/^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/,br:/^ {2,}\n(?!\s*$)/,del:k,text:/^[\s\S]+?(?=[\\<!\[_*`]| {2,}\n|$)/,_inside:/(?:\[[^\]]*\]|[^\]]|\](?=[^\[]*\]))*/,_href:/\s*<?([^\s]*?)>?(?:\s+['"]([\s\S]*?)['"])?\s*/};e.link=b(e.link)("inside",e._inside)("href",e._href)();e.reflink=b(e.reflink)("inside",e._inside)();e.normal=f({},e);e.pedantic=f({},e.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/});
e.gfm=f({},e.normal,{escape:b(e.escape)("])","~|])")(),url:/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,del:/^~~(?=\S)([\s\S]*?\S)~~/,text:b(e.text)("]|","~]|")("|","|https?://|")()});e.breaks=f({},e.gfm,{br:b(e.br)("{2,}","*")(),text:b(e.gfm.text)("{2,}","*")()});i.rules=e;i.output=function(a,b,d){return(new i(b,d)).output(a)};i.prototype.output=function(a){var l;var c;for(var b="",e,f;a;)if(f=this.rules.escape.exec(a))a=a.substring(f[0].length),b+=f[1];else if(f=this.rules.autolink.exec(a))a=a.substring(f[0].length),
f[2]==="@"?(e=f[1][6]===":"?this.mangle(f[1].substring(7)):this.mangle(f[1]),f=this.mangle("mailto:")+e):(c=e=d(f[1]),f=c),b+='<a href="'+f+'">'+e+"</a>";else if(f=this.rules.url.exec(a))a=a.substring(f[0].length),l=e=d(f[1]),f=l,b+='<a href="'+f+'">'+e+"</a>";else if(f=this.rules.tag.exec(a))a=a.substring(f[0].length),b+=this.options.sanitize?d(f[0]):f[0];else if(f=this.rules.link.exec(a))a=a.substring(f[0].length),b+=this.outputLink(f,{href:f[2],title:f[3]});else if((f=this.rules.reflink.exec(a))||
(f=this.rules.nolink.exec(a)))a=a.substring(f[0].length),e=(f[2]||f[1]).replace(/\s+/g," "),e=this.links[e.toLowerCase()],!e||!e.href?(b+=f[0][0],a=f[0].substring(1)+a):b+=this.outputLink(f,e);else if(f=this.rules.strong.exec(a))a=a.substring(f[0].length),b+="<strong>"+this.output(f[2]||f[1])+"</strong>";else if(f=this.rules.em.exec(a))a=a.substring(f[0].length),b+="<em>"+this.output(f[2]||f[1])+"</em>";else if(f=this.rules.code.exec(a))a=a.substring(f[0].length),b+="<code>"+d(f[2],!0)+"</code>";
else if(f=this.rules.br.exec(a))a=a.substring(f[0].length),b+="<br>";else if(f=this.rules.del.exec(a))a=a.substring(f[0].length),b+="<del>"+this.output(f[1])+"</del>";else if(f=this.rules.text.exec(a))a=a.substring(f[0].length),b+=d(this.smartypants(f[0]));else if(a)throw Error("Infinite loop on byte: "+a.charCodeAt(0));return b};i.prototype.outputLink=function(a,b){return a[0][0]!=="!"?'<a href="'+d(b.href)+'"'+(b.title?' title="'+d(b.title)+'"':"")+">"+this.output(a[1])+"</a>":'<img src="'+d(b.href)+
'" alt="'+d(a[1])+'"'+(b.title?' title="'+d(b.title)+'"':"")+">"};i.prototype.smartypants=function(a){return!this.options.smartypants?a:a.replace(/--/g,"\u2014").replace(/'([^']*)'/g,"\u2018$1\u2019").replace(/"([^"]*)"/g,"\u201c$1\u201d").replace(/\.{3}/g,"\u2026")};i.prototype.mangle=function(a){for(var b="",d=a.length,e=0,f;e<d;e++)f=a.charCodeAt(e),Math.random()>0.5&&(f="x"+f.toString(16)),b+="&#"+f+";";return b};g.parse=function(a,b){return(new g(b)).parse(a)};g.prototype.parse=function(a){this.inline=
new i(a.links,this.options);this.tokens=a.reverse();for(a="";this.next();)a+=this.tok();return a};g.prototype.next=function(){return this.token=this.tokens.pop()};g.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0};g.prototype.parseText=function(){for(var a=this.token.text;this.peek().type==="text";)a+="\n"+this.next().text;return this.inline.output(a)};g.prototype.tok=function(){switch(this.token.type){case "space":return"";case "hr":return"<hr>\n";case "heading":return"<h"+
this.token.depth+">"+this.inline.output(this.token.text)+"</h"+this.token.depth+">\n";case "code":if(this.options.highlight){var a=this.options.highlight(this.token.text,this.token.lang);if(a!=null&&a!==this.token.text)this.token.escaped=!0,this.token.text=a}if(!this.token.escaped)this.token.text=d(this.token.text,!0);return"<pre><code"+(this.token.lang?' class="'+this.options.langPrefix+this.token.lang+'"':"")+">"+this.token.text+"</code></pre>\n";case "table":var a="",b,e,f,g;a+="<thead>\n<tr>\n";
for(e=0;e<this.token.header.length;e++)b=this.inline.output(this.token.header[e]),a+=this.token.align[e]?'<th align="'+this.token.align[e]+'">'+b+"</th>\n":"<th>"+b+"</th>\n";a+="</tr>\n</thead>\n";a+="<tbody>\n";for(e=0;e<this.token.cells.length;e++){b=this.token.cells[e];a+="<tr>\n";for(g=0;g<b.length;g++)f=this.inline.output(b[g]),a+=this.token.align[g]?'<td align="'+this.token.align[g]+'">'+f+"</td>\n":"<td>"+f+"</td>\n";a+="</tr>\n"}a+="</tbody>\n";return"<table>\n"+a+"</table>\n";case "blockquote_start":for(a=
"";this.next().type!=="blockquote_end";)a+=this.tok();return"<blockquote>\n"+a+"</blockquote>\n";case "list_start":e=this.token.ordered?"ol":"ul";for(a="";this.next().type!=="list_end";)a+=this.tok();return"<"+e+">\n"+a+"</"+e+">\n";case "list_item_start":for(a="";this.next().type!=="list_item_end";)a+=this.token.type==="text"?this.parseText():this.tok();return"<li>"+a+"</li>\n";case "loose_item_start":for(a="";this.next().type!=="list_item_end";)a+=this.tok();return"<li>"+a+"</li>\n";case "html":return!this.token.pre&&
!this.options.pedantic?this.inline.output(this.token.text):this.token.text;case "paragraph":return"<p>"+this.inline.output(this.token.text)+"</p>\n";case "text":return"<p>"+this.parseText()+"</p>\n"}};k.exec=k;h.options=h.setOptions=function(a){f(h.defaults,a);return h};h.defaults={gfm:!0,tables:!0,breaks:!1,pedantic:!1,sanitize:!1,smartLists:!1,silent:!1,highlight:null,langPrefix:"lang-",smartypants:!1};h.Parser=g;h.parser=g.parse;h.Lexer=j;h.lexer=j.lex;h.InlineLexer=i;h.inlineLexer=i.output;h.parse=
h;typeof exports==="object"?module.exports=h:typeof define==="function"&&define.amd?define("marked/marked",[],function(){return h}):this.marked=h}).call(function(){return this||(typeof window!=="undefined"?window:global)}());
define("shell/resultWriters",["orion/Deferred","orion/urlUtils","marked/marked"],function(j,i,g){var d;d={};d.FileBlobWriter=function(){function b(b,d){this.destination=b;this.shellPageFileService=d;this.blobs=[]}b.prototype={addBlob:function(b){this.blobs.push(b)},write:function(){var b=new j;this.shellPageFileService.ensureFile(null,this.destination).then(function(d){this.shellPageFileService.writeBlob(d,this.blobs[0]).then(function(){b.resolve()},function(d){b.reject(d)})}.bind(this),function(d){b.reject(d)});
return b}};return b}();d.FileStringWriter=function(){function b(b,d){this.destination=b;this.shellPageFileService=d}b.prototype={write:function(b){var d=new j;this.shellPageFileService.ensureFile(null,this.destination).then(function(g){this.shellPageFileService.write(g,b).then(function(){d.resolve()},function(a){d.reject(a)})}.bind(this),function(b){d.reject(b)});return d}};return b}();d.ShellBlobWriter=function(){function b(b){this.rootElement=b;this.blobCount=0}b.prototype={addBlob:function(){this.blobCount++},
write:function(){var b=new j,d=document.createElement("span");d.textContent="("+this.blobCount+" blobs)";this.rootElement.appendChild(d);b.resolve();return b}};return b}();d.ShellStringWriter=function(){function b(b,d){this.rootElement=b;this.processMarkdown=d}b.prototype={write:function(b){var d=document.createElement("div");if(this.processMarkdown)d.innerHTML=g(b,{sanitize:!0,breaks:!0});else{this.rootElement.className+=" string-result-output";var h=i.detectValidURL(b);h?i.processURLSegments(d,
h):d.textContent=b}for(b=d.childNodes;b.length>0;)this.rootElement.appendChild(b[0]);b=new j;b.resolve();return b}};return b}();return d});
define("shell/paramType-file",["i18n!orion/shell/nls/messages","orion/shell/Shell","orion/i18nUtil","orion/Deferred","shell/resultWriters"],function(j,i,g,d,b){function k(b,a,d,c){this.value=b;this.typeSpec=a;this.typedPath=d;this.shellPageFileService=c}var f;f={};k.prototype={getPluginRepresentation:function(){var b=new d;if(typeof this.value==="string")b.resolve({file:{path:this.value}});else{var a=0,e=this.value.slice(0),c=[],f=function(d){d&&c.push(d);a===0&&e.length===0&&(this.typeSpec.multiple?
b.resolve(c):b.resolve(c[0]))}.bind(this),g=function(){for(;e.length>0;){var b=e[0],c=this.shellPageFileService.getCurrentDirectory(),d=c.Parents;if((!d||d.length===0)&&c.parent)d=[c.parent];d=d?d.slice(0):[];if(d.length>0)for(var h=d[d.length-1].parent;h;)d.push(h),h=h.parent;d.splice(0,0,c);c=d.length-1;h=b.Parents;if((!h||h.length===0)&&b.parent)h=[b.parent];h=h?h.slice(0):[];if(h.length>0)for(var i=h[h.length-1].parent;i;)h.push(i),i=i.parent;h.splice(0,0,b);for(i=h.length-1;i>=0&&c>=0;)if(h[i].Location===
d[c].Location)i--,c--;else break;d="";if(b.Location.indexOf(h[i+1].Location)===0){for(var j=0;j<=c;j++)d+=".."+this.shellPageFileService.SEPARATOR;d+=b.Location.substring(h[i+1].Location.length)}else d=b.Location;d={isDirectory:b.Directory,path:d.length?d:"."};b.Directory&&this.typeSpec.multiple&&this.typeSpec.recurse&&function(b){a++;this.shellPageFileService.withChildren(b,function(c){a--;if(c.length===0)f();else{var d=b.recursePath?b.recursePath.slice(0):[];d.push(b.Name);var h=function(b){a--;
e.push(b);e.length===1&&g()};c.forEach(function(b){b.recursePath=d;a++;b.parent?h(b):this.shellPageFileService.withNode(b.Location,h,function(){a--;f()})}.bind(this))}}.bind(this),function(){a--;f()})}.call(this,b);e.splice(0,1);this.typeSpec.content&&!d.isDirectory?function(c){a++;this.shellPageFileService.readBlob(b).then(function(b){a--;c.blob=b;f(c)},function(){a--;f(c)})}.call(this,d):f(d)}}.bind(this);g()}return b},getValue:function(){return this.value},resourceExists:function(){return typeof this.value!==
"string"},stringify:function(){return this.typedPath}};f.ParamTypeFile=function(){function f(a){this.shellPageFileService=a}f.prototype={getName:function(){return"file"},parse:function(a,b){var c=new d;this._getPredictions(a.text).then(function(d){c.resolve(this._createCompletion(a.text,d,b))}.bind(this),function(a){c.error(a)});return c},processResult:function(a,d,c,f){var h=document.createElement("div"),i=0,k=function(c){this.callback=function(){var d=g.formatMessage(j["Wrote ${0}"],typeof c===
"string"?c:this.shellPageFileService.computePathString(c));(new b.ShellStringWriter(h)).write(d+"\n");--i!==0||f?a.progress(h):a.resolve(h)}.bind(this);return this}.bind(this),p=function(c){this.callback=function(d){var e=g.formatMessage(j["Failed to write ${0}"],typeof c==="string"?c:this.shellPageFileService.computePathString(c));e+=" ["+d+"]";(new b.ShellStringWriter(h)).write(e+"\n");--i!==0||f?a.progress(h):a.resolve(h)}.bind(this);return this}.bind(this),c=c||this.shellPageFileService.getCurrentDirectory();
i++;this.shellPageFileService.ensureDirectory(null,c).then(function(a){i--;var c=d.getValue();d.isArray()||(c=[c]);c.forEach(function(c){i++;for(var d=c.path.split(this.shellPageFileService.SEPARATOR),e=0;e<d.length;){var f=d[e];if(f===".")d.splice(e,1);else if(f===".."){if(e===0){p(g.formatMessage(j["Cannot write ${0}, it is not a descendent of the output directory"],c.path));return}d.splice(e-- -1,2)}else e++}var h=function(a,c,d){var e=d[0];d.splice(0,1);var f=this.shellPageFileService.computePathString(a)+
this.shellPageFileService.SEPARATOR+e;d.length===0?c.isDirectory?this.shellPageFileService.ensureDirectory(a,e).then(k(f).callback,p(f).callback):this.shellPageFileService.ensureFile(a,e).then(function(a){var d=new b.FileBlobWriter(a,this.shellPageFileService);d.addBlob(c.blob);d.write().then(k(a).callback,p(a).callback)}.bind(this),p(f).callback):this.shellPageFileService.ensureDirectory(a,e).then(function(a){h(a,c,d)},p(this.shellPageFileService.computePathString(a)+this.shellPageFileService.SEPARATOR+
e).callback)}.bind(this);h(a,c,d)}.bind(this))}.bind(this),p(c).callback)},stringify:function(a){return!a?"":typeof a==="string"?a:a.stringify()},_createCompletion:function(a,b,c){if(!b)return{value:void 0,status:i.CompletionStatus.ERROR,message:g.formatMessage(j["'${0}' is not valid"],a),predictions:null};var d,f,h;if(c.exist===!1){var o;for(f=0;f<b.length;f++){var p=b[f];if(p.name===a){o=p;break}}o?(f=i.CompletionStatus.ERROR,d=g.formatMessage(j["'${0}' already exists"],a)):(f=i.CompletionStatus.MATCH,
h=new k(a,c,a,this.shellPageFileService));b=[]}else{var u=[];b.forEach(function(a){(a.value.Directory||c.file)&&u.push(a)});b=u;if(c.exist){var r=[];o=a.replace(/[\-(){}\[\]+,.\\\^$|#]/g,"\\$&");o=o.replace(/\?/g,".");o=o.replace(/\*/g,".*");var t=RegExp("^"+o+"$");b.forEach(function(a){a.name.match(t)&&(a.value.Directory&&c.directory||!a.value.Directory&&c.file)&&r.push(a.value)});c.multiple&&r.length||r.length===1?(f=i.CompletionStatus.MATCH,h=new k(r,c,a,this.shellPageFileService)):b.length?f=
i.CompletionStatus.PARTIAL:(f=i.CompletionStatus.ERROR,d=g.formatMessage(j["'${0}' is not valid"],a))}else{for(f=0;f<b.length;f++)if(p=b[f],p.name===a){o=p;break}f=i.CompletionStatus.MATCH;h=o?new k([o.value],c,a,this.shellPageFileService):new k(a,c,a,this.shellPageFileService)}}return{value:h,status:f,message:d,predictions:b}},_find:function(a,b){for(var c=0;c<a.length;c++)if(b(a[c]))return a[c];return null},_getPredictions:function(a){var b=new d,c=this.shellPageFileService.getDirectory(null,a);
c?this.shellPageFileService.withChildren(c,function(d){var f=a.lastIndexOf(this.shellPageFileService.SEPARATOR)+1,g=a.substring(0,f),h=a.substring(f),i=h.length===0||h===".",f=[],j=[];i&&f.push({name:g+".",value:c,incomplete:!0});if(i||h==="..")(i=this.shellPageFileService.getParent(c))&&f.push({name:g+"..",value:i,incomplete:!0});h.trim().length===0&&g.length>0&&f.push({name:g,value:c,incomplete:!1});for(var h=h.replace(/[\-(){}\[\]+,.\\\^$|#]/g,"\\$&"),h=h.replace(/\?/g,"."),h=h.replace(/\*/g,".*"),
i=RegExp("^"+h),k=0;k<d.length;k++){var t=d[k];if(t.Name.match(i)){var q=!t.Directory||t.Children&&t.Children.length===0,h=g+t.Name;t.Directory?f.push({name:h,value:t,incomplete:!q}):j.push({name:h,value:t,incomplete:!q})}}b.resolve(f.concat(j))}.bind(this),function(a){b.error(a)}):b.resolve(null);return b}};return f}();return f});
define("shell/paramType-plugin",["i18n!orion/shell/nls/messages","require","orion/shell/Shell","orion/i18nUtil","orion/Deferred"],function(j,i,g,d,b){var k;k={};var f=function(){function d(a,b){this.plugins=a;this.urlsToExclude=b}d.prototype={name:"all",getPluginLocations:function(){var a=[];this.plugins.forEach(function(b){b=b.getLocation();(!this.urlsToExclude||!this.urlsToExclude[b])&&a.push(b)}.bind(this));return a},isAllPlugin:function(){return!0},start:function(a){return this._invokeOnAllPlugins("start",
a)},stop:function(){return this._invokeOnAllPlugins("stop")},uninstall:function(){return this._invokeOnAllPlugins("uninstall")},update:function(){return this._invokeOnAllPlugins("update")},_invokeOnAllPlugins:function(a,d){var c=this.urlsToExclude?[]:this.plugins;this.urlsToExclude&&this.plugins.forEach(function(a){this.urlsToExclude[a.getLocation()]||c.push(a)}.bind(this));var f=new b,g=c.length,h=0;c.forEach(function(b){b[a](d).then(function(){++h===g&&f.resolve()},function(a){f.reject(a)})});return f}};
return d}();k.ParamTypePlugin=function(){function h(a){this.pluginRegistry=a;a.addEventListener("installed",function(){this._initPluginsList()}.bind(this));a.addEventListener("uninstalled",function(){this._initPluginsList()}.bind(this));a.addEventListener("stopping",function(){this._sort(this.plugins)}.bind(this));a.addEventListener("lazy activation",function(){this._sort(this.plugins)}.bind(this));window.setTimeout(function(){this._computeDefaultPlugins();this._initPluginsList()}.bind(this),1)}h.prototype=
{getName:function(){return"plugin"},getPlugins:function(){return this.plugins.slice(0)},parse:function(a,d){var c=new b,f=this._getPredictions(a.text,d);c.resolve(this._createCompletion(a.text,f));return c},stringify:function(a){return a.name},_defaultPluginUrls:{},_computeDefaultPlugins:function(){var a=localStorage.getItem("/orion/preferences/default/plugins");a&&(a=JSON.parse(a),Object.keys(a).forEach(function(a){var b=this._defaultPluginUrls;a=i.toUrl(a);if(a.indexOf("://")===-1){var d=document.createElement("a");
d.href=a;a=d.href}b[a]=!0}.bind(this)))},_createCompletion:function(a,b){for(var c,f=0;f<b.length;f++){var h=b[f];if(h.name===a){c=h;break}}var i;c?f=g.CompletionStatus.MATCH:b&&b.length>0?f=g.CompletionStatus.PARTIAL:(f=g.CompletionStatus.ERROR,i=d.formatMessage(j["'${0}' is not valid"],a));return{value:c?c.value:void 0,status:f,message:i,predictions:b}},_formatLocationAsPluginName:function(a){var b=a.split("/"),b=b[b.length-1],b=b.split(".html")[0],b=b.replace(/([a-z])([A-Z])/,"$1 $2"),b=function(a){return a.toLowerCase().replace(/\b[a-z]/g,
function(a){return a.toUpperCase()})}(b),b=b.replace("plugin",""),b=b.replace("Plugin","");b===""&&(b=a);return b.trim()},_getPredictions:function(a,b){var c=[];this.plugins&&(this.plugins.forEach(function(d){(!b.excludeDefaultPlugins||!this._defaultPluginUrls[d.getLocation()])&&d.name.indexOf(a)===0&&c.push({name:d.name,value:d})}.bind(this)),b.multiple&&"all".indexOf(a)===0&&c.push({name:"all",value:new f(this.plugins,b.excludeDefaultPlugins?this._defaultPluginUrls:null)}));return c},_initPluginsList:function(){this.plugins=
[];this.pluginRegistry.getPlugins().forEach(function(a){var b=a.getLocation(),c=a.getHeaders();a.name=c.name||this._formatLocationAsPluginName(b);this.plugins.push(a)}.bind(this));this._sort(this.plugins)},_sort:function(a){a.sort(function(a,b){var d=a.getState(),d=d==="active"||d==="starting",f=b.getState();if(d!==(f==="active"||f==="starting"))return d?-1:1;d=a.name&&a.name.toLowerCase();f=b.name&&b.name.toLowerCase();return d<f?-1:d>f?1:0})}};return h}();return k});
define("shell/paramType-service",["i18n!orion/shell/nls/messages","orion/shell/Shell","orion/i18nUtil","orion/Deferred"],function(j,i,g,d){var b;b={};b.ParamTypeService=function(){function b(d){this.pluginRegistry=d;d.addEventListener("installed",function(){this._initServicesList()}.bind(this));d.addEventListener("uninstalled",function(){this._initServicesList()}.bind(this));window.setTimeout(function(){this._initServicesList()}.bind(this),1)}b.prototype={getName:function(){return"service"},parse:function(b){var g=
new d,a=this._getPredictions(b.text);g.resolve(this._createCompletion(b.text,a));return g},stringify:function(b){return b},_createCompletion:function(b,d){for(var a,e=0;e<d.length;e++){var c=d[e];if(c.name===b){a=c;break}}var k;a?e=i.CompletionStatus.MATCH:d&&d.length>0?e=i.CompletionStatus.PARTIAL:(e=i.CompletionStatus.ERROR,k=g.formatMessage(j["'${0}' is not valid"],b));return{value:a?a.value:void 0,status:e,message:k,predictions:d}},_getPredictions:function(b){var d=[];this.services&&this.services.forEach(function(a){a.indexOf(b)===
0&&d.push({name:a,value:a})});return d},_initServicesList:function(){var b={};this.pluginRegistry.getPlugins().forEach(function(a){a.getServiceReferences().forEach(function(a){a.getProperty("service.names").forEach(function(a){b[a]=!0})})});this.services=[];for(var d in b)this.services.push(d);this._sort(this.services)},_sort:function(b){b.sort(function(b,a){var d=b.toLowerCase(),c=a.toLowerCase();return d<c?-1:d>c?1:0})}};return b}();return b});
define("orion/status",["i18n!orion/nls/messages","orion/webui/littlelib","orion/globalCommands","orion/urlUtils"],function(j,i,g,d){function b(b,d,a,e,c){this._serviceRegistry=b;this._serviceRegistration=b.registerService("orion.page.message",this);this._operationsClient=d;this.notificationContainerDomId=c;this.domId=a;this.progressDomId=e||a;this._hookedClose=!1;this._timer=null;this._clickToDisMiss=!0;this._cancelMsg=null}var k;b.prototype={_init:function(){var b=i.node("closeNotifications");if(b&&
!this._hookedClose){b.style.cursor="pointer";this._hookedClose=!0;var d=i.node(this.notificationContainerDomId);i.addAutoDismiss([d],function(){this._clickToDisMiss&&this.close()}.bind(this));b.addEventListener("click",function(){this.close()}.bind(this));d.addEventListener("click",function(a){a&&a.target&&a.target.nodeName.toLowerCase()==="a"&&(a=i.$$("a",d))&&a.length&&a.length===1&&this.close()}.bind(this))}},close:function(){window.clearTimeout(this._timer);var b=i.node("closeNotifications");
this._cancelMsg&&this._cancelFunc&&b?(b.innerHTML="",b.classList.remove("cancelButton"),b.classList.add("dismissButton"),b.classList.add("core-sprite-close"),b.classList.add("imageSprite"),this._cancelFunc(),this._cancelMsg=null):this.setProgressMessage("")},_getNotifierElements:function(){if(!this._notifierElements)this._notifierElements=g.getToolbarElements(this.notificationContainerDomId);return this._notifierElements},setMessage:function(b,d,a){this._init();this.currentMessage=b;var e=i.node(this.domId);
if(typeof a==="boolean"){var c=e.getAttribute("aria-live");e.setAttribute("aria-live",a?"polite":"off");window.setTimeout(function(){b===this.currentMessage&&(i.empty(e),e.appendChild(document.createTextNode(b)),window.setTimeout(function(){e.setAttribute("aria-live",c)},100))}.bind(this),100)}else i.empty(e),e.appendChild(document.createTextNode(b));typeof d==="number"&&window.setTimeout(function(){b===this.currentMessage&&(i.empty(e),e.appendChild(document.createTextNode("")))}.bind(this),d)},setErrorMessage:function(b){this._clickToDisMiss=
!0;this.currentMessage=b;this._init();var d=b.responseText||b.message||b;if(typeof d==="string")try{d=JSON.parse(d)}catch(a){}var b=d.Message||d,e="red";if(d.Severity)switch(d.Severity){case "Warning":e="#FFCC00";break;case "Error":e="red";break;case "Info":case "Ok":e="green"}d=document.createElement("span");d.style.color=e;d.appendChild(document.createTextNode(b));b=i.node(this.domId);i.empty(b);b.appendChild(d)},setProgressMessage:function(b){this._clickToDisMiss=!1;this._init();this.currentMessage=
b;var d=document.createElement("span");d.classList.add("progressIcon");var a=i.node(this.progressDomId);i.empty(a);a.appendChild(d);a.appendChild(document.createTextNode(b));d=i.node(this.notificationContainerDomId);d.classList.remove("notificationHide");if(b&&b.length>0)d.classList.add("progressNormal"),d.classList.add("notificationShow");else if(this._progressMonitors&&this._progressMonitors.length>0)return this._renderOngoingMonitors();else d.classList.remove("notificationShow"),d.classList.add("notificationHide")},
setCancelFunction:function(b){this._cancelFunc=b},setProgressResult:function(b,g){this._clickToDisMiss=!1;this._cancelMsg=g;this.currentMessage=b;var a=b.responseText||b;if(typeof a==="string")try{a=JSON.parse(a)}catch(e){}this._init();var c=a.Message||a.toString(),k=j.UnknownError,m="core-sprite-information",n="progressNormal",o=document.createElement("span");o.classList.add("imageSprite");o.classList.add("progressIcon");var p=[];if(a.Severity)switch(a.Severity){case "Warning":k=j.UnknownWarning;
m="core-sprite-warning";n="progressWarning";p.push("progressInfo");p.push("progressError");p.push("progressNormal");this._clickToDisMiss=!0;break;case "Error":m="core-sprite-error";n="progressError";p.push("progressWarning");p.push("progressInfo");p.push("progressNormal");this._clickToDisMiss=!0;break;default:n="progressNormal",p.push("progressWarning"),p.push("progressError"),p.push("progressNormal")}p.push("notificationHide");o.classList.add(m);var u=i.node(this.progressDomId),m=i.node(this.notificationContainerDomId);
i.empty(u);u.appendChild(o);c===Object.prototype.toString()&&(c=k);if(a.HTML)a=document.createElement("span"),a.innerHTML=c,u.appendChild(a);else{if(k=d.detectValidURL(c))c=document.createDocumentFragment(),d.processURLSegments(c,k),Array.prototype.forEach.call(i.$$("a",c),function(a){a.target="_blank"});else{if(a.Severity!=="Warning"&&a.Severity!=="Error"&&!g)this._timer&&window.clearTimeout(this._timer),this._timer=window.setTimeout(function(){this.setProgressMessage("");this._timer=null}.bind(this),
5E3);c=document.createTextNode(c)}u.appendChild(c)}if(n&&this.progressDomId!==this.domId){m.classList.add(n);for(n=0;n<p.length;n++)m.classList.remove(p[n])}m.classList.add("notificationShow");if(p=i.node("closeNotifications"))this._cancelMsg?(p.classList.add("cancelButton"),p.classList.remove("dismissButton"),p.classList.remove("core-sprite-close"),p.classList.remove("imageSprite"),p.innerHTML=this._cancelMsg):(p.innerHTML="",p.classList.remove("cancelButton"),p.classList.add("dismissButton"),p.classList.add("core-sprite-close"),
p.classList.add("imageSprite"))},showWhile:function(b,d){var a=this;if(d){a.setProgressMessage(d);var e=function(){d===a.currentMessage&&a.setProgressMessage("")};b.then(e,e)}return b},_lastProgressId:0,_progressMonitors:{length:0},createProgressMonitor:function(b,d){return new k(this,++this._lastProgressId,b,d)},_renderOngoingMonitors:function(){if(this._progressMonitors.length>0){var b="",d=!0,a;for(a in this._progressMonitors)this._progressMonitors[a].status&&(d||(b+=", "),b+=this._progressMonitors[a].status,
d=!1);this.setProgressMessage(b)}else this.setProgressMessage("")},_beginProgressMonitor:function(b){this._progressMonitors[b.progressId]=b;this._progressMonitors.length++;this._renderOngoingMonitors()},_workedProgressMonitor:function(b){this._progressMonitors[b.progressId]=b;this._renderOngoingMonitors()},_doneProgressMonitor:function(b){delete this._progressMonitors[b.progressId];this._progressMonitors.length--;b.status?this.setProgressResult(b.status):this._renderOngoingMonitors()}};b.prototype.constructor=
b;k=function(b,d,a,e){this.statusService=b;this.progressId=d;if(a){this.deferred=a;this.begin(e);var c=this;a.then(function(){c.done.bind(c)()},function(){c.done.bind(c)()})}};k.prototype.begin=function(b){this.status=b;this.statusService._beginProgressMonitor(this)};k.prototype.done=function(b){this.status=b;this.statusService._doneProgressMonitor(this)};k.prototype.worked=function(b){this.status=b;this.statusService._workedProgressMonitor(this)};k.prototype.constructor=k;return{StatusReportingService:b,
ProgressMonitor:k}});
define("orion/operations/nls/root/messages",{More:"More","No Matching OperationService for location:":"No Matching OperationService for location:","No operations services registered.":"No operations services registered.","could not find toolbar ":"could not find toolbar ","Remove Completed":"Remove Completed","Remove all completed operations":"Remove all completed operations",Remove:"Remove","Remove operations from the operations list.":"Remove operations from the operations list.",Cancel:"Cancel",
"Cancel operations from the operations list.":"Cancel operations from the operations list.","Operation resulted in a warning.":"Operation resulted in a warning.","Operation resulted in an error.":"Operation resulted in an error.","Operation is running.":"Operation is running.","Operation is canceled.":"Operation is canceled.","Operation failed.":"Operation failed.",Name:"Name",Actions:"Actions",Status:"Status",Scheduled:"Scheduled"});
define("orion/operations/nls/messages",["orion/i18n!orion/operations/nls/messages","orion/operations/nls/root/messages"],function(j,i){var g={root:i};Object.keys(j).forEach(function(d){typeof g[d]==="undefined"&&(g[d]=j[d])});return g});
define("orion/webui/popupdialog",["i18n!orion/widgets/nls/messages","require","orion/webui/littlelib","orion/webui/tooltip"],function(j,i,g,d){function b(){}b.prototype={_initialize:function(b,f,h,a,e){this._tooltip=new d.Tooltip({node:b,hideDelay:e||0,afterShowing:this._afterShowingFunction(f).bind(this),afterHiding:h,trigger:a?a:"click"});this.$parent=this._tooltip.contentContainer();this.$parent.role="dialog";b=document.createRange();b.selectNode(this.$parent);b=b.createContextualFragment(this.TEMPLATE);
this.messages&&g.processTextNodes(b,j);this.$parent.appendChild(b);var c=this._tooltip;this.$parent.addEventListener("keydown",function(a){a.keyCode===g.KEY.ESCAPE&&c.hide()},!1);this._bindElements(this.$parent);typeof this._bindToDom==="function"&&this._bindToDom(this.$parent)},_bindElements:function(b){for(var d=0;d<b.childNodes.length;d++){var g=b.childNodes[d];g.id&&(this["$"+g.id]=g);this._bindElements(g)}},_afterShowingFunction:function(b){return function(){b&&b.bind(this)();if(!this.customFocus){var d=
g.firstTabbable(this.$parent);d&&d.focus()}}},hide:function(){this._tooltip.hide()},show:function(){this._tooltip.show()}};b.prototype.constructor=b;return{PopupDialog:b}});
define("orion/operationsCommands",["i18n!orion/operations/nls/messages","require","orion/webui/littlelib","orion/commands"],function(j,i,g,d){var b={};(function(){var i=!1;b.updateNavTools=function(b,d,a,e,c,l){var m=g.node(e);if(m)d.destroy(m);else throw j["could not find toolbar "]+e;d.renderCommands(e,m,l,a,"button");if(c&&(e=g.node(c)))d.destroy(e),d.renderCommands(c,e,null,a,"button");i||(i=!0,b.getService("orion.page.selection").addEventListener("selectionChanged",function(b){var e=g.node(c);
e&&(d.destroy(e),d.renderCommands(c,e,b.selections,a,"button"))}))};b.createOperationsCommands=function(b,g,a){function e(a){return!a.operation||!a.operation.type?!1:a.operation.type==="loadstart"||a.operation.type==="progress"}var c=new d.Command({name:j["Remove Completed"],tooltip:j["Remove all completed operations"],id:"eclipse.removeCompletedOperations",callback:function(){a.removeCompletedOperations().then(function(){g.loadOperations.bind(g)()})},visibleWhen:function(){return!0}});b.addCommand(c);
c=new d.Command({name:j.Remove,tooltip:j["Remove operations from the operations list."],imageClass:"core-sprite-delete",id:"eclipse.removeOperation",callback:function(b){for(var b=Array.isArray(b.items)?b.items:[b.items],c=0;c<b.length;c++){var d=b[c];a.removeOperation.bind(a)(d.Location).then(function(){g.loadOperations.bind(g)()},function(){g.loadOperations.bind(g)()})}},visibleWhen:function(a){if(!Array.isArray(a)||a.length===0)return!e(a);for(var b in a)if(e(a[b]))return!1;return!0}});b.addCommand(c);
c=new d.Command({name:j.Cancel,tooltip:j["Cancel operations from the operations list."],imageClass:"core-sprite-stop",id:"eclipse.cancelOperation",callback:function(a){for(var a=Array.isArray(a.items)?a.items:[a.items],b=0;b<a.length;b++){var c=a[b];c.deferred&&c.deferred.cancel()}},visibleWhen:function(a){if(!Array.isArray(a)||a.length===0)return e(a)&&(a.operation&&a.operation.cancelable?!0:!1);for(var b in a)if(!e(a[b])||!a[b].operation||!a[b].operation.cancelable)return!1;return!0}});b.addCommand(c)}})();
return b});
define("orion/webui/dialogs/OperationsDialog",["i18n!orion/operations/nls/messages","require","orion/webui/littlelib","orion/webui/popupdialog","orion/operationsCommands"],function(j,i,g,d,b){function k(b){this._options=b}k.prototype=new d.PopupDialog;k.prototype.TEMPLATE='<table style="width: 360px;"><tr><td><h2>Recent operations</h2></td><td style="text-align: right;"><a id="allOperationsLink" class="navlinkonpage">All Operations</a></td></tr></table><div id="operationsExist"><div style="padding-left: 7px" id="myOperationsListEmpty">No operations running on this page.</div><table id="myOperationsList" style="display: none;"></table></div><div style="padding-left: 7px" id="operationsDontExist">No operations running.</div>';k.prototype._init=
function(d){this._myOperations=[];this._operationsDeferreds=[];this._commandService=d.commandRegistry;b.createOperationsCommands(this._commandService);this._commandService.registerCommandContribution("operationsDialogItems","eclipse.cancelOperation",1);this._initialize(d.triggerNode)};k.prototype._bindToDom=function(){this.$allOperationsLink.href=i.toUrl("operations/list.html");this._setOperationsVisibility()};k.prototype.setOperations=function(b,d){this._myOperations||this._init(this._options);this._myOperations=
[];this._operationsDeferreds=[];if(b)for(var a in b)this._myOperations.push(b[a]),this._operationsDeferreds.push(d[a]);this._renderOperations()};k.prototype.parseProgressResult=function(b){if(!b)return{};b=b.responseText||b;try{b=JSON.parse(b)}catch(d){}var a={Message:b.Message||b,Severity:b.Severity};if(b.DetailedMessage&&b.DetailedMessage!==a.Message)a.DetailedMessage=b.DetailedMessage;return a};k.prototype._renderOperations=function(){this._renderOperationsTable(this.$myOperationsList,this._myOperations,
this._operationsDeferreds)};k.prototype._renderOperationsTable=function(b,d,a){g.empty(b);for(var e=0;e<d.length;e++){var c=d[e],i=document.createElement("tr"),k=document.createElement("td");k.style.paddingLeft="5px";k.style.paddingRight="5px";k.textContent=c.Name;i.appendChild(k);var n=document.createElement("div");k.appendChild(n);k=document.createElement("span");k.style.paddingRight="5px";k.classList.add("imageSprite");switch(c.type){case "Warning":k.classList.add("core-sprite-warning");k.setAttribute("aria-label",
j["Operation resulted in a warning."]);break;case "error":k.classList.add("core-sprite-error");k.setAttribute("aria-label",j["Operation resulted in an error."]);break;case "loadstart":case "progress":k.classList.add("core-sprite-start");k.setAttribute("aria-label",j["Operation is running."]);break;case "abort":k.classList.add("core-sprite-stop");k.setAttribute("aria-label",j["Operation is canceled."]);break;case "load":case "loadend":k.classList.add("core-sprite-ok"),k.setAttribute("aria-label","Operation ok.")}n.appendChild(k);
k=document.createElement("span");k.classList.add("operationStatus");k.textContent=c.Name;n.appendChild(k);if(c.error){var o=c.error.Message||c.error;c.error.DetailedMessage&&c.error.DetailedMessage!==""&&(o+=": "+c.error.DetailedMessage);k.textContent=o;k.classList.remove("operationStatus");k.classList.add("operationError")}this._commandService.renderCommands("operationsDialogItems",n,{operation:c,deferred:a[e]},this,"tool");b.appendChild(i)}this._setOperationsVisibility()};k.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"};k.prototype.constructor=k;return{OperationsDialog:k}});
define("orion/progress",["i18n!orion/nls/messages","require","orion/Deferred","orion/webui/littlelib","orion/webui/dialogs/OperationsDialog"],function(j,i,g,d,b){function k(f,a){if(!this._progressPane){this._progressPane=d.node(f);this._operationsDialog=new b.OperationsDialog({triggerNode:this._progressPane,commandRegistry:a});var e=this;this._progressPane.addEventListener("keydown",function(a){(a.charOrCode===" "||a.keyCode===d.KEY.ENTER)&&e._operationsDialog.show()})}}function f(b,a,d,c){this._serviceRegistry=
b;this._serviceRegistration=b.registerService("orion.page.progress",this);this._commandRegistry=d;this._operationsClient=a;this._operations={};this._operationDeferrds={};this._operationsIndex=0;this._lastIconClass=this._lastOperation=null;this._progressMonitorClass=c}k.prototype={_switchIconTo:function(b){this._lastIconClass&&this._progressPane.classList.remove(this._lastIconClass);this._lastIconClass=b;this._progressPane.classList.add(this._lastIconClass)},generateOperationsInfo:function(b,a){var d=
{},c;for(c in b)b[c].progressMonitor||(d[c]=b[c]);if(this._isEmpty(d))this._switchIconTo("progressPane_empty"),this._progressPane.title=j.Operations,this._progressPane.alt=j.Operations,this._progressPane.hasAttribute("aria-valuetext")&&this._progressPane.removeAttribute("aria-valuetext");else{var f="";for(c in d){var g=d[c];if(g.type&&(g.type==="loadstart"||g.type==="progress")){f="running";break}}switch(f){case "running":this._progressPane.title=j["Operations running"];this._progressPane.alt=j["Operations running"];
this._progressPane.setAttribute("aria-valuetext",j["Operations running"]);this._switchIconTo("progressPane_running");break;case "warning":this._progressPane.title=j["Some operations finished with warning"];this._progressPane.alt=j["Some operations finished with warning"];this._progressPane.setAttribute("aria-valuetext",j["Some operations finished with warning"]);this._switchIconTo("progressPane_warning");break;case "error":this._progressPane.title=j["Some operations finished with error"];this._progressPane.alt=
j["Some operations finished with error"];this._progressPane.setAttribute("aria-valuetext",j["Some operations finished with error"]);this._switchIconTo("progressPane_error");break;default:this._progressPane.title=j.Operations,this._progressPane.alt=j.Operations,this._progressPane.hasAttribute("aria-valuetext")&&this._progressPane.removeAttribute("aria-valuetext"),this._switchIconTo("progressPane_operations")}}this._operationsDialog.setOperations(d,a)},_isEmpty:function(b){for(var a in b)return!1;return!0}};
k.prototype.constructon=k;f.prototype={init:function(b){if(!this._progressMonitorClass)this._progressMonitorTool=new k(b,this._commandRegistry)},progress:function(b,a,d){var c=this,f=this._operationsIndex++;!d&&this._progressMonitorClass&&(d=new this._progressMonitorClass,d.begin(a));b.then(function(){if(c._operations[f]){var g=c._operations[f];if(a)g.Name=a;c._lastOperation=g;g.type="loadend";if(d)g.progressMonitor=d;c.writeOperation.bind(c)(f,g,b);g.Location||c._removeOperationFromTheList.bind(c)(f)}},
function(g){if(c._operations[f]){var i=c._operations[f];if(a)i.Name=a;if(d)i.progressMonitor=d;c._lastOperation=i;i.type=g.canceled?"abort":"error";i.error=g;c.writeOperation.bind(c)(f,i,b);i.Location||c._removeOperationFromTheList.bind(c)(f)}},function(g){if(a)g.Name=a;if(d)g.progressMonitor=d;c.writeOperation.bind(c)(f,g,b)});return b},removeOperation:function(b){for(var a in this._operations)if(this._operations[a].Location&&this._operations[a].Location===b){this._removeOperationFromTheList(a);
break}this._operationsClient.removeOperation.bind(this._operationsClient)(b)},_removeOperationFromTheList:function(b){var a=this._operations[b].progressMonitor;delete this._operations[b];delete this._operationDeferrds[b];a?a.done():this._progressMonitorTool.generateOperationsInfo(this._operations,this._operationDeferrds)},removeCompletedOperations:function(){for(var b in this._operations){var a=this._operations[b];if(a.type&&a.type!=="loadstart"&&a.type!=="progress")(a=this._operations[b].progressMonitor)&&
a.done(),delete this._operations[b],delete this._operationDeferrds[b]}this._progressMonitorTool.generateOperationsInfo(this._operations,this._operationDeferrds)},setProgressResult:function(b){this._serviceRegistry.getService("orion.page.message").setProgressResult(b)},showWhile:function(b,a,d){a&&this._serviceRegistry.getService("orion.page.message").setProgressMessage(a);var c=this;b.then(function(){c._serviceRegistry.getService("orion.page.message").setProgressMessage("")},function(a){d?c._serviceRegistry.getService("orion.page.message").setProgressMessage(""):
c.setProgressResult.bind(c)(a);return a});return this.progress(b,a)},writeOperation:function(b,a,d){this._operations[b]=a;this._operationDeferrds[b]=d;a.Location&&this._serviceRegistry.getService("orion.core.preference").getPreferences("/operations").then(function(b){b.put(a.Location,{Name:a.Name,expires:a.expires})});a.progressMonitor?a.progressMonitor.progress(a.Name):this._progressMonitorTool.generateOperationsInfo(this._operations,this._operationDeferrds)}};f.prototype.constructor=f;return{ProgressService:f}});
define("orion/operationsClient",["i18n!orion/operations/nls/messages","orion/Deferred"],function(j,i){function g(b,d,a){return b[d].apply(b,a)}function d(b){this._location=b}function b(){var b=new i;b.reject(j["No Matching OperationService for location:"]+this._location);return b}function k(b){this._services=[];this._patterns=[];this._operationListeners=[];this._currentLongpollingIds=[];this._preferenceService=b.getService("orion.core.preference");for(var g=b.getServiceReferences("orion.core.operation"),
a=0;a<g.length;a++){var e=b.getService(g[a]);this._services[a]=e;e=g[a].getProperty("pattern")||".*";e[0]!=="^"&&(e="^"+e);this._patterns[a]=RegExp(e)}this._getService=function(a){if(!a)return this._services[0];for(var b=0;b<this._patterns.length;++b)if(this._patterns[b].test(a))return this._services[b];this._operations.remove(a);return new d(a)}}d.prototype={getOperation:b,getOperations:b,removeCompletedOperations:b,removeOperation:b,cancelOperation:b};d.prototype.constructor=d;k.prototype={getOperations:function(){var b=
new i;if(this._operations)return b.resolve(this._operations),b;var d=this;this._preferenceService.getPreferences("/operations").then(function(a){d._operations=a;b.resolve(d._operations)});return b},getOperation:function(b){return g(this._getService(b),"getOperation",arguments)},removeCompletedOperations:function(){for(var b=[],d=this,a=0;a<this._services.length;a++){var e=this._patterns[a],c=new i;b[a]=c.promise;g(this._services[a],"removeCompletedOperations").then(function(a){return function(b){Array.isArray(b)&&
d.getOperations.bind(d)().then(function(c){for(var d=c.keys(),f=0;f<d.length;f++){var g=d[f];e.test(g)&&b.indexOf(g)<0&&c.remove(g)}a.resolve()})}}(c),function(a){return function(b){a.reject(b)}}(c))}return i.all(b)},removeOperation:function(b){var d=this;return g(this._getService(b),"removeOperation",arguments).then(function(){d.getOperations.bind(d)().then(function(a){a.remove(b)})},function(a){return a},function(a){return a})}};k.prototype.constructor=k;return{OperationsClient:k}});
define('built-shellPage.js',"require,i18n!orion/shell/nls/messages,orion/browserCompatibility,orion/bootstrap,orion/commandRegistry,orion/fileClient,orion/searchClient,orion/globalCommands,orion/shell/Shell,orion/webui/treetable,shell/shellPageFileService,shell/paramType-file,shell/paramType-plugin,shell/paramType-service,orion/i18nUtil,orion/extensionCommands,orion/contentTypes,orion/pluginregistry,orion/PageUtil,orion/URITemplate,orion/Deferred,orion/status,orion/progress,orion/operationsClient,shell/resultWriters,orion/URL-shim".split(","),
function(j,i,g,d,b,k,f,h,a,e,c,l,m,n,o,p,u,r,t,q,v,w,C,B,E){function D(){var a=t.matchResourceParameters(window.location.href).resource;return a.length>0?a:null}function z(a,b){var c=(new q(ja)).expand({resource:a.Location});b?window.location.replace(c):window.location.href=c;h.setPageTarget({task:i.Shell,serviceRegistry:J,commandService:N,target:a})}function s(a){var b=p.getOpenWithCommand(N,a);return b?b.hrefCallback({items:a}):null}function y(a){var b=document.createElement("a");if(a.Directory)return b.href=
"#"+a.Location,b.className="shellPageDirectory",b.textContent=a.Name,b;b.href=s(a);b.target="_blank";b.textContent=a.Name;return b}function x(a,b){var c=document.createElement("span");c.appendChild(document.createTextNode(b?i["Initial directory: "]:i["Changed to: "]));var d=document.createElement("b");d.appendChild(document.createTextNode(a));c.appendChild(d);return c}function G(a){a=a.directory.value[0];F.setCurrentDirectory(a);L=!0;z(a,!1);a=F.computePathString(a);return x(a,!1)}function A(a){a=
s(a.file.getValue()[0]);window.open(a)}function H(a,b){var c=b.createPromise(),d=F.getCurrentDirectory(),d=d?d.Location:D()||X;F.loadWorkspace(d).then(function(a){F.setCurrentDirectory(a);F.withChildren(a,function(a){for(var b=document.createElement("div"),d=0;d<a.length;d++)b.appendChild(y(a[d])),b.appendChild(document.createElement("br"));c.resolve(b);setTimeout(function(){for(var a=O.querySelectorAll(".shellPageDirectory"),b=0;b<a.length;b++)a[b].setAttribute("target","_self"),a[b].className=""},
1)},function(a){ga(c,a)})},function(a){ga(c,a)});return c}function V(a,b){var c=b.createPromise(),d=F.getCurrentDirectory();F.loadWorkspace(d.Location).then(function(a){var a=F.computePathString(a),b=document.createElement("b");b.appendChild(document.createTextNode(a));c.resolve(b)},function(a){ga(c,a)});return c}function I(a){var b=document.createElement("div");a.plugin.getServiceReferences().forEach(function(a){var c={values:[]};a.getPropertyKeys().forEach(function(b){if(b==="service.names")c.name=
a.getProperty(b).join();if(b==="id")c.id=a.getProperty(b);c.values.push({name:b,value:a.getProperty(b)})});if(c.name){c.elementId="serviceElement"+M++;c.values.forEach(function(a){a.elementId="serviceElement"+M++});var d=document.createElement("div");b.appendChild(d);var f=new ma,d=new e.TableTree({model:new la(c),showRoot:!0,parent:d,renderer:f});f.tableTree=d}});return b}function Z(){for(var a=K.getPlugins(),b=document.createElement("table"),c=0;c<a.length;c++){var d=document.createElement("tr");
b.appendChild(d);var e=document.createElement("td");d.appendChild(e);d=document.createElement("b");e.appendChild(d);d.textContent=a[c].name;d=a[c].getState();if(d!=="active"&&d!=="starting")d=document.createElement("span"),e.appendChild(d),d.textContent=" ("+i.disabled+")"}return b}function W(a,b){var c=b.createPromise();a.plugin.stop().then(function(){c.resolve(i.Succeeded)},function(a){c.resolve(a)});return c}function P(a,b){var c=b.createPromise();a.plugin.start({lazy:!0}).then(function(){c.resolve(i.Succeeded)},
function(a){c.resolve(a)});return c}function S(a,b){var c=a.url.trim();if(/^\S+$/.test(c)){if(Q.getPlugin(c))return i["Plug-in is already installed"];var d=b.createPromise();Q.installPlugin(c).then(function(a){a.start({lazy:!0}).then(function(){R.getPreferences("/plugins").then(function(a){a.put(c,!0)});d.resolve(i.Succeeded)},function(a){d.resolve(a)})},function(a){d.resolve(a)});return d}return i["Invalid plug-in URL"]}function T(a,b){var c=b.createPromise();a.plugin.update().then(function(){c.resolve(i.Succeeded)},
function(a){c.resolve(a)});return c}function aa(a,b){var c=b.createPromise();if(a.plugin.isAllPlugin){if(!window.confirm(i["Are you sure you want to uninstall all contributed plug-ins?"]))return i.Aborted;a.plugin.uninstall().then(function(){R.getPreferences("/plugins").then(function(b){for(var c=a.plugin.getPluginLocations(),d=0;d<c.length;d++)b.remove(c[d])}.bind(this));c.resolve(i.Succeeded)},function(a){c.resolve(a)})}else{var d=a.plugin.getLocation();Q.getPlugin(d).uninstall().then(function(){R.getPreferences("/plugins").then(function(a){a.remove(d)}.bind(this));
c.resolve(i.Succeeded)},function(a){c.resolve(a)})}return c}function U(a){var b=a.id.trim(),c=document.createElement("div");K.getPlugins().forEach(function(a){a.getServiceReferences().forEach(function(d){if(d.getProperty("service.names").indexOf(b)!==-1){var f={name:a.name,values:[]};d.getPropertyKeys().forEach(function(a){if(a==="id")f.id=d.getProperty(a);f.values.push({name:a,value:d.getProperty(a)})});f.elementId="serviceElement"+M++;f.values.forEach(function(a){a.elementId="serviceElement"+M++});
var g=document.createElement("div");c.appendChild(g);var h=new ma,g=new e.TableTree({model:new la(f),showRoot:!0,parent:g,renderer:h});h.tableTree=g}})});return c}function Y(a,b){typeof a!=="string"&&(a=a.xhr&&a.xhr.statusText?a.xhr.statusText:a.toString());return b.write(a)}function ha(a,b,c,d){var e,f;c?f=new E.FileBlobWriter(c,F):(e=document.createElement("div"),f=new E.ShellBlobWriter(e));c=b.getValue();b.isArray()||(c=[c]);c.forEach(function(a){f.addBlob(a)});f.write().then(function(){d?a.progress(e):
a.resolve(e)},function(b){e=e||document.createElement("div");f=new E.ShellStringWriter(e);Y(b,f).then(function(){a.reject(e)},function(){a.reject()})})}function ia(a,b,c,d){var e,f;c?f=new E.FileStringWriter(c,F):(e=document.createElement("div"),f=new E.ShellStringWriter(e));Y(b.stringify(),f).then(function(){d?a.progress(e):a.resolve(e)},function(b){e=e||document.createElement("div");f=new E.ShellStringWriter(e);Y(b,f).then(function(){a.reject(e)},function(){a.reject()})})}function fa(a,b,c,d){var e=
b.getType();e==="file"?$.processResult(a,b,c,d):e==="blob"?ha(a,b,c,d):ia(a,b,c,d)}function ba(a,b,c,d,e){return typeof a.callback!=="function"?void 0:function(f){var g=new v,h=null;if(e)(h=f.output)&&(h=h.resourceExists()?h.getValue()[0]:h.getValue()),delete f.output;(function(a,b){var c=Object.keys(a);if(c.length===0)b(a);else{var d=0;c.forEach(function(e){(function(e){(function(a,b){a&&a.getPluginRepresentation?a.getPluginRepresentation().then(function(a){b(a)}):b(a)})(a[e],function(f){a[e]=f;
++d===c.length&&b(a)})})(e)})}})(f,function(e){var i=function(a){a=new ka(a,d);fa(g,a,h)},j=function(a){ga(g,a)},k=function(a){if(a&&a.uriTemplate){var c=new q(a.uriTemplate);F.getCurrentDirectory();var c=c.expand({}),e=document.createElement("iframe");e.id=b;e.name=b;e.type="text/html";e.sandbox="allow-scripts allow-same-origin";e.frameborder=1;e.src=c;e.className="delegatedUI";if(a.width)e.style.width=a.width;if(a.height)e.style.height=a.height;var a=document.getElementsByClassName("gcli-row-out"),
f=a[a.length-1];f.appendChild(e);window.addEventListener("message",function oa(a){a.source===e.contentWindow&&typeof a.data==="string"&&(a=JSON.parse(a.data),a.pageService==="orion.page.delegatedUI"&&a.source===b&&(window.removeEventListener("message",oa,!1),a.error?j(a.error):(f.removeChild(e),a.result?i(a.result):a.progress&&k(a.progress))))},!1)}else typeof g.progress==="function"&&(a=new ka(a,d),fa(g,a,h,!0))};c.progress(a.callback(e,{cwd:D()}),"Executing command "+function(a,b){var c=a,d;for(d in b)c+=
" ",c+=b[d];return c}(b,f)).then(i,j,k)});return g}}function ca(a){return typeof a!=="function"?void 0:function(b,c,d){var e=new v;if(d)d.cwd=D();a(b,c,d).then(function(a){e.resolve(a)},function(a){e.reject(a)});return e}}var F,da,N,O,$,L=!1,ea,J,Q,K,R,M=0,X=(new URL(j.toUrl("file"),window.location.href)).pathname,ja=j.toUrl("shell/shellPage.html")+"#{,resource}",ka=function(){function a(b,c){this.value=b;this.array=!1;if(c.indexOf("[")===0&&c.lastIndexOf("]")===c.length-1)this.array=!0,c=c.substring(1,
c.length-1);this.type=c}a.prototype={getType:function(){return this.type},getValue:function(){return this.value},isArray:function(){return this.array},stringify:function(){if(this.type!=="string"&&this.type!=="markdown")return"("+(this.array?"[":"")+this.value+(this.array?"]":"")+")";if(!this.array)return this.value;for(var a="",b=0;b<this.value.length;b++)a+=this.value[b],b!==this.value.length-1&&(a+="\n");return a}};return a}(),na=function(){function a(b,c,d){this.name=b;this.parseFn=c;this.stringifyFn=
d}a.prototype={getName:function(){return this.name},parse:function(a,b,c){var d=new v;this.parseFn(a,b,c).then(function(a){d.resolve(a)},function(a){d.reject(a)});return d},stringify:function(a,b){var c=new v;if(!this.stringifyFn)return a?a.name:"";this.stringifyFn(a,b).then(function(a){c.resolve(a)},function(a){c.reject(a)});return c}};return a}(),la=function(){function a(b){this.root=b}a.prototype={getRoot:function(a){a(this.root)},getChildren:function(a,b){b(a.values)},getId:function(a){return a.elementId}};
return a}(),ma=function(){function a(){}a.prototype={getTwistieElementId:function(a){return a+"__expand"},initTable:function(){},labelColumnIndex:function(){return 0},render:function(a,b){b.className+=" treeTableRow";var c=document.createElement("td");b.appendChild(c);if(a.value)c=document.createElement("td"),b.appendChild(c),c.textContent=a.name,c=document.createElement("td"),b.appendChild(c),c.textContent=a.value;else{var d=document.createElement("span");c.appendChild(d);c=document.createElement("span");
c.id=this.getTwistieElementId(b.id);d.appendChild(c);c.className="modelDecorationSprite core-sprite-closedarrow";c.onclick=function(){this.tableTree.toggle(b.id)}.bind(this);c=document.createElement("td");b.appendChild(c);d=document.createElement("b");c.appendChild(d);d.textContent=a.name;if(a.id)d=document.createElement("span"),c.appendChild(d),d.textContent=" ("+a.id+")";c.colSpan="2"}},updateExpandVisuals:function(a,b){var c=document.getElementById(this.getTwistieElementId(a.id));if(c){var d=c.className;
b?(d+=" core-sprite-openarrow",d=d.replace(/\s?core-sprite-closedarrow/g,"")):(d+=" core-sprite-closedarrow",d=d.replace(/\s?core-sprite-openarrow/g,""));c.className=d}}};return a}(),ga=function(a,b){var c=b;try{c=JSON.parse(b.responseText)}catch(d){}c&&c.DetailedMessage?c=o.formatMessage(i["Error: ${0}"],c.DetailedMessage):c&&c.Message?c=o.formatMessage(i["Error: ${0}"],c.Message):typeof b.url==="string"&&(c=b.status===0?o.formatMessage(i.NoResponseFromServer,b.url):o.formatMessage(i.ServerError,
b.url,b.status,b.statusText));var e=document.createElement("span");e.textContent=c;a.reject(e)};d.startup().then(function(d){Q=d.pluginRegistry;J=d.serviceRegistry;R=d.preferences;N=new b.CommandRegistry({});da=new k.FileClient(J);var d=new f.Searcher({serviceRegistry:J,commandService:N,fileService:da}),e=new B.OperationsClient(J);new w.StatusReportingService(J,e,"statusPane","notifications","notificationArea");new C.ProgressService(J,e,N);h.generateBanner("orion-shellPage",J,N,R,d);h.setPageTarget({task:i.Shell,
serviceRegistry:J,commandService:N});O=document.getElementById("shell-output");var d=document.getElementById("shell-input"),g=new a.Shell({input:d,output:O});O.onmousedown=function(a){O.onmouseup=null;if(a.button===0&&a.target.tagName.toUpperCase()==="DIV")O.onmouseup=function(b){O.onmouseup=null;b.target===a.target&&Math.abs(b.clientX-a.clientX)<=2&&Math.abs(b.clientY-a.clientY)<=2&&g.setFocusToInput()}};var j=t.matchResourceParameters(window.location.href);if(j.command)g.setInputText(j.command),
delete j.command,d=(new q(ja)).expand(j),window.location.href=d;g.setFocusToInput();F=new c.ShellPageFileService;(function(a,b){var c=function(a){z(a,b);F.setCurrentDirectory(a);a=F.computePathString(a);g.output(x(a,!0))};a?F.loadWorkspace(a).then(c,function(){F.loadWorkspace(X).then(c)}):F.loadWorkspace(X).then(c)})(D(),!0);$=new l.ParamTypeFile(F);g.registerType($);K=new m.ParamTypePlugin(Q);g.registerType(K);d=new n.ParamTypeService(Q);g.registerType(d);g.registerCommand({name:"cd",description:i["Changes the current directory"],
callback:G,parameters:[{name:"directory",type:{name:"file",directory:!0,exist:!0},description:i["The name of the directory"]}],returnType:"html"});g.registerCommand({name:"edit",description:i["Edits a file"],callback:A,parameters:[{name:"file",type:{name:"file",file:!0,exist:!0},description:i["The name of the file"]}]});g.registerCommand({name:"ls",description:i["Lists the files in the current directory"],callback:H,returnType:"html"});g.registerCommand({name:"pwd",description:i["Prints the current directory location"],
callback:V,returnType:"html"});g.registerCommand({name:"clear",description:i["Clears the shell screen"],callback:function(){g.clear()}});g.registerCommand({name:"plugins",description:i["Commands for working with plug-ins"]});g.registerCommand({name:"plugins list",description:i["Lists all registered plug-ins"],callback:Z,returnType:"html"});g.registerCommand({name:"plugins install",description:i["Installs a plug-in from a URL"],callback:S,parameters:[{name:"url",type:"string",description:i["The plug-in URL"]}],
returnType:"string"});g.registerCommand({name:"plugins uninstall",description:i["Uninstalls a contributed plug-in from the configuration"],callback:aa,parameters:[{name:"plugin",type:{name:"plugin",multiple:!0,excludeDefaultPlugins:!0},description:i["The name of the contributed plug-in"]}],returnType:"string"});g.registerCommand({name:"plugins reload",description:i["Reloads a plug-in"],callback:T,parameters:[{name:"plugin",type:{name:"plugin",multiple:!0,excludeDefaultPlugins:!1},description:i["The name of the plug-in"]}],
returnType:"string"});g.registerCommand({name:"plugins enable",description:i["Enables a contributed plug-in"],callback:P,parameters:[{name:"plugin",type:{name:"plugin",multiple:!0,excludeDefaultPlugins:!0},description:i["The name of the contributed plug-in"]}],returnType:"string"});g.registerCommand({name:"plugins disable",description:i["Disables a contributed plug-in"],callback:W,parameters:[{name:"plugin",type:{name:"plugin",multiple:!0,excludeDefaultPlugins:!0},description:i["The name of the contributed plug-in"]}],
returnType:"string"});g.registerCommand({name:"plugins services",description:i["Displays a plug-in's services"],callback:I,parameters:[{name:"plugin",type:{name:"plugin",multiple:!1,excludeDefaultPlugins:!1},description:i["The name of the plug-in"]}],returnType:"html"});g.registerCommand({name:"service",description:i["Commands for working with a service"]});g.registerCommand({name:"service contributors",description:i["Displays all plug-in contributions for a service"],callback:U,parameters:[{name:"id",
type:"service",description:i["The service identifier"]}],returnType:"html"});ea=new u.ContentTypeRegistry(J);p.createOpenWithCommands(J,ea,N);d=J.getServiceReferences("orion.shell.type");for(e=0;e<d.length;++e){var r=d[e],s=J.getService(r);s&&(r=new na(r.getProperty("name"),ca(s.parse),ca(s.stringify)),g.registerType(r))}for(var d=J.getServiceReferences("orion.shell.command"),v=J.getService("orion.page.progress"),e=0;e<d.length;++e)if(r=d[e],s=J.getService(r)){for(var j=r.getProperty("parameters")||
[],y,E=0;E<j.length;E++)if(j[E].name==="output"){y=!0;break}y||j.push({name:"output",type:{name:"file",file:!0,directory:!0},description:i["The file or directory to re-direct output to"],defaultValue:null});var M=r.getProperty("returnType")||"string";r.getProperty("nls")&&r.getProperty("descriptionKey")?o.getMessageBundle(r.getProperty("nls")).then(function(a,b){var c=a.getProperty("name");g.registerCommand({name:c,description:b[a.getProperty("descriptionKey")],callback:ba(s,c,v,M,!y),returnType:"html",
parameters:j,manual:b[a.getProperty("manual")]})},r):(E=r.getProperty("name"),g.registerCommand({name:E,description:r.getProperty("description"),callback:ba(s,E,v,M,!y),returnType:"html",parameters:j,manual:r.getProperty("manual")}))}window.addEventListener("hashchange",function(){if(L)L=!1;else{var a=t.hash().substring(1);a.length===0&&(a=X);F.loadWorkspace(a).then(function(a){if(F.getCurrentDirectory().Location!==a.Location){F.setCurrentDirectory(a);var b=F.computePathString(a);g.output(x(b,!1));
z(a,!1)}},function(){z(F.getCurrentDirectory(),!0)})}})})});