/*

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


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


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

 Contributors: IBM Corporation - initial API and implementation

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

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

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

 Contributors:
     IBM Corporation - initial API and implementation

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

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

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors:
     IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors:
     IBM Corporation - initial API and implementation

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

 Contributors:
     IBM Corporation - initial API and implementation

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

 Contributors:
     IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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


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


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


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

 Contributors:
     IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors:
     IBM Corporation - initial API and implementation

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

 Contributors:  IBM Corporation - initial API and implementation

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


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


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

 Contributors:
     IBM Corporation - initial API and implementation

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

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

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

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

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

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

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


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


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

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

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

 Contributors:
     IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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


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


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

 Contributors:
     IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

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

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

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

 Contributors: IBM Corporation - initial API and implementation

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


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


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

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

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

 Contributors:
     IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - _initial API and implementation

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


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


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

 Contributors:
     IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors:
     IBM Corporation - initial API and implementation

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


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


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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

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


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


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

 Contributors:
     IBM Corporation - initial API and implementation

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

 Contributors:
     IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors:
     IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

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

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

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

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

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

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

 Contributors:
     IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

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

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

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

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

 Contributors: IBM Corporation - initial API and implementation

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

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

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors:
     IBM Corporation - initial API and implementation

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

 Contributors: 
 IBM Corporation - initial API and implementation

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

 Contributors:
     IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

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

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors:
     IBM Corporation - initial API and implementation

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

 Contributors:
     IBM Corporation - initial API and implementation

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

 Contributors:
     IBM Corporation - initial API and implementation

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

 Contributors:
     IBM Corporation - initial API and implementation

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

 Contributors:
     IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors:
     IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

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

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

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

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

 Contributors: IBM Corporation - initial API and implementation 

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

 Contributors: IBM Corporation - initial API and implementation 

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

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

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

 Contributors: IBM Corporation - initial API and implementation 

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

 Contributors:
     IBM Corporation - initial API and implementation

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

 Contributors:
     IBM Corporation - initial API and implementation

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

 Contributors:
     IBM Corporation - initial API and implementation

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

 Contributors:
     IBM Corporation - initial API and implementation

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

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

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

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

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

 Contributors: IBM Corporation - initial API and implementation

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

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

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

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

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

 Contributors: IBM Corporation - initial API and implementation

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

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

 Contributors: IBM Corporation - initial API and implementation

 Copyright (c) 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) 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) 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: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

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

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors:
     IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

 Copyright (c) 2011, 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
*/
(function(){function l(g,h,f,d,a,e){h[g]&&(f.push(g),(!0===h[g]||1===h[g])&&d.push(a+g+"/"+e))}function n(g,h,f,d,a){h=d+h+"/"+a;require._fileExists(g.toUrl(h+".js"))&&f.push(h)}function m(g,h,f){for(var d in h)h.hasOwnProperty(d)&&(!g.hasOwnProperty(d)||f)?g[d]=h[d]:"object"===typeof h[d]&&m(g[d],h[d],f)}var k=/(^.*(^|\/)nls(\/|$))([^\/]*)\/?([^\/]*)/;define("i18n",["module"],function(g){var h=g.config?g.config():{},h=h||{};return{version:"2.0.1+",load:function(f,d,a,e){e=e||{};e.locale&&(h.locale=
e.locale);var b=k.exec(f),p=b[1],g=b[4],s=b[5],u=g.split("-"),w=[],x={},y,r="";b[5]?(p=b[1],f=p+s):(s=b[4],g=h.locale,g||(g=h.locale="undefined"===typeof navigator?"root":(navigator.language||navigator.userLanguage||"root").toLowerCase()),u=g.split("-"));if(e.isBuild){w.push(f);n(d,"root",w,p,s);for(y=0;y<u.length;y++)e=u[y],r+=(r?"-":"")+e,n(d,r,w,p,s);d(w,function(){a()})}else d([f],function(e){var b=[],f;l("root",e,b,w,p,s);for(y=0;y<u.length;y++)f=u[y],r+=(r?"-":"")+f,l(r,e,b,w,p,s);d(w,function(){var v,
f,g;for(v=b.length-1;-1<v&&b[v];v--){g=b[v];f=e[g];if(!0===f||1===f)f=d(p+g+"/"+s);m(x,f)}a(x)})})}}})})();
define("orion/i18n",[],function(){return{load:function(l,n,m,k){k=k||{};var g=/(^.*(?:^|\/)nls(?:\/|$))([^\/]*)\/?([^\/]*)/,h=g.exec(l);if(h){if(!n.defined||n.defined(l))try{m(n(l));return}catch(f){}if(k.isBuild||k.isTest)m({});else if(n.specified&&!n.specified("orion/bootstrap"))m({});else{var d=h[1],a=h[3]?h[2]:"",e=h[3]||h[2];n(["orion/bootstrap"],function(b){b.startup().then(function(b){var f=b.serviceRegistry;b=f.getServiceReferences("orion.i18n.message");if(a)b.some(function(a){return l===a.getProperty("name")?
(f.getService(a).getMessageBundle().then(function(a){m(a)},function(){m({})}),!0):!1})||m({});else{var s={},u;b.forEach(function(b){var p=b.getProperty("name");if((h=g.exec(p))&&d===h[1]&&e===(h[3]||h[2]))if(a=h[3]?h[2]:""){if((b=k.locale||("undefined"!==typeof navigator?navigator.language||navigator.userLanguage:null))&&0===b.toLowerCase().indexOf(a.toLowerCase()))s[a]=!0,(!n.specified||!n.specified(p))&&define(p,["orion/i18n!"+p],function(a){return a})}else u=b});!n.specified||!n.specified(l)?u?
f.getService(u).getMessageBundle().then(function(a){Object.keys(s).forEach(function(e){"undefined"===typeof a[e]&&(a[e]=s[e])});define(l,[],a);m(a)},function(){define(l,[],s);m(s)}):(define(l,[],s),m(s)):m(s)}})})}}else m(null)}}});
define("git/nls/root/gitmessages",{Compare:"Compare","View the side-by-side compare":"View the side-by-side compare","Working Directory Version":"Working Directory Version","Working Directory":"Working Directory","View the working directory version of the file":"View the working directory version of the file","Loading...":"Loading...",Repositories:"All Git Repositories",Repo:"Repositories","0 on 1 - Git":"${0} on ${1} - Git",Git:"Git","Show in eclipse.org":"Show in eclipse.org","Show this repository at eclipse.org":"Show this repository at eclipse.org",
"Show in GitHub":"Show in GitHub","Show this repository in GitHub":"Show this repository in GitHub","Commit Details":"Commit Details","No Commits":"No Commits","commit: 0":"commit: ${0}","parent: 0":"parent: ${0}","authored by 0 (1) on 2":"authored by ${0} (${1}) on ${2}","committed by 0 (1)":"committed by ${0} (${1})","Tags:":"Tags:","No Tags":"No Tags",Diffs:"Changes",More:"More","Loading git log...":"Loading git log...",local:"local",remote:"remote","Git Log for ${0} branch ${1} on ":"Git Log for ${0} branch ${1} on ",
"Git Log for ${0} branch ${1}":"Git Log for ${0} branch ${1}","Log for branch ${0} - Git":"Log for branch ${0} - Git","Log for ${0} on ${1} - Git":"Log for ${0} on ${1} - Git","View All":"View All","Error ${0}: ":"Error ${0}: ","Loading ":"Loading ",Message:"Message",Author:"Author",Date:"Date",Actions:"Actions",Branches:"Branches",Tags:"Tags",Stage:"Stage","Unstaged removal":"Unstaged removal",Unstage:"Unstage","Staged removal":"Staged removal","Unstaged change":"Unstaged change","Staged change":"Staged change",
"Unstaged add":"Unstaged add","Staged add":"Staged add",Addition:"Addition",Deletion:"Deletion","Resolve Conflict":"Resolve Conflict",Conflicting:"Conflicting","Commit message":"Commit message","Record changes in the active branch":"Record changes in the active branch",Commit:"Commit",SmartCommit:"Type a message here to commit...",SmartCountCommit:"Commit ${0} file(s)","Amend last commit":"Amend last commit"," Amend":" Amend","Rebase in progress. Choose action:":"Rebase in progress. Choose action:",
RebaseProgress:"Commits (Rebase in progress)",RebaseProgressDetails:"Rebasing branch.\n\n\tUse Continue after resolving any conflicts;\n\tSkip to bypass the current patch;\n\tAbort to end the rebase at any time.","Committer name:":"Committer name:","email:":"email:","Author name: ":"Author name: ","Select a file on the left to compare...":"Select a file on the left to compare...",Unstaged:"Unstaged",Staged:"Staged",ChangedFiles:"Changed Files","Recent commits on":"Recent commits on","Git Status":"Git Status",
"Go to Git Status":"Open the Git Status page for the repository containing this file or folder.","Recent commits on ${0}":"Recent commits on ${0}","Status for ${0} - Git":"Status for ${0} - Git","Status (${0})":"Status (${0})","Getting git incoming changes...":"Getting git incoming changes...","Loading recent commits...":"Loading recent commits...","Show the side-by-side compare":"Show the side-by-side compare","Change Committer or Author":"Change Committer or Author","Use Default Committer and Author":"Use Default Committer and Author",
Checkout:"Checkout","Checkout the file, discarding the unstaged change":"Checkout the file, discarding the unstaged change","Your changes to the file will be lost. Are you sure you want to checkout?":"Your changes to the file will be lost. Are you sure you want to checkout?","Checking out...":"Checking out...","Stage the change":"Stage the change","Stage the selected changes":"Stage the selected changes","Staging...":"Staging...","Checkout all the selected files, discarding all changes":"Checkout all the selected files, discarding all changes",
"Your changes to all the selected files will be lost. Are you sure you want to checkout?":"Your changes to all the selected files will be lost. Are you sure you want to checkout?","Save Patch":"Save Patch","Save workspace changes as a patch":"Save workspace changes as a patch","Unstage the change":"Unstage the change","Unstaging...":"Unstaging...",Undo:"Undo",UndoTooltip:"Revert this commit, keeping all changed files and not making any changes to the working directory.",UndoConfirm:"The content of your active branch will be replaced with ${0}. All changes in the commit and working directory will be kept. Are you sure?",
Reset:"Reset","Reset the branch, discarding all staged and unstaged changes":"Reset the branch, discarding all staged and unstaged changes","All unstaged and staged changes in the working directory and index will be discarded and cannot be recovered.":"All unstaged and staged changes in the working directory and index will be discarded and cannot be recovered.","Are you sure you want to continue?":"Are you sure you want to continue?","Resetting local changes...":"Resetting local changes...","Continue rebase...":"Continue rebase...",
"Skipping patch...":"Skipping patch...","Aborting rebase...":"Aborting rebase...","Complete log":"Complete log","local VS index":"local VS index","index VS HEAD":"index VS HEAD","Compare(${0} : ${1})":"Compare(${0} : ${1})","Loading status...":"Loading status...","Committing...":"Committing...","The committer name is required.":"The committer name is required.","The committer mail is required.":"The committer mail is required.","The author name is required.":"The author name is required.","The author mail is required.":"The author mail is required.",
". Repository still contains conflicts.":". Repository still contains conflicts.",". Repository contains unmerged paths. Resolve conflicts first.":". Repository contains unmerged paths. Resolve conflicts first.","Rendering ${0}":"Rendering ${0}",Configuration:"Configuration","Getting configuration of":"Getting configuration of ${0}"," - Git":" - Git","Repositories - Git":"Repositories - Git",Repository:"Repository","Repository Not Found":"Repository Not Found","No Repositories":"No Repositories",
"Loading repository":"Loading repository","Loading repositories":"Loading repositories","(no remote)":"(no remote)","location: ":"location: ","${0} file(s) to stage and ${1} file(s) to commit.":"${0} file(s) to stage and ${1} file(s) to commit.","Nothing to commit.":"Nothing to commit.","Nothing to push.":"Nothing to push."," commit(s) to push.":" commit(s) to push.","You have no changes to commit.":"You have no changes to commit.","You have changes to commit in your workspace!":"You have changes to commit in your workspace!",
"Rebase in progress!":"Rebase in progress!","View all local and remote tracking branches":"View all local and remote tracking branches","tracks no branch, ":"tracks no branch, ","tracks ${0}, ":"tracks ${0}, ","last modified ${0} by ${1}":"last modified ${0} by ${1}","No Remote Branches":"No Remote Branches","Rendering branches":"Rendering branches",Commits:"Commits",GettingCurrentBranch:"Getting current branch for ${0}","See Full Log":"See Full Log","See the full log":"See the full log",'Getting commits for "${0}" branch':'Getting commits for "${0}" branch',
"Rendering commits":"Rendering commits","Getting outgoing commits":"Getting outgoing commits","The branch is up to date.":"The branch is up to date.","You have no outgoing or incoming commits.":"You have no outgoing or incoming commits.",") by ":") by "," (SHA ":" (SHA ","Getting tags":"Getting tags","View all tags":"View all tags"," on ":" on "," by ":" by ",Remotes:"Remotes","Rendering remotes":"Rendering remotes","No Remotes":"No Remotes","View all configuration entries":"View all configuration entries",
"Unstaged addition":"Unstaged addition","Staged addition":"Staged addition"," (Rebase in Progress)":" (Rebase in Progress)",Status:"Status","Log (0)":"Log (${0})","Log (0) - 1":"Log (${0}) - ${1}","Status for ${0} - Git ":"Status for ${0} - Git ","No Unstaged Changes":"No Unstaged Changes","No Staged Changes":"No Staged Changes",'Commits for "${0}" branch':'Commits for "${0}" branch','Commits for "${0}" branch against':'Commits for "${0}" branch against',"Add Remote":"Add Remote","Remote Name:":"Remote Name:",
"Remote URI:":"Remote URI:","Apply Patch":"Apply Patch","Git Repository":"Git Repository","Go to the git repository":"Open the Git Repository page for this file or folder.","Clone Git Repository":"Clone Git Repository","Repository URL:":"Repository URL:","Existing directory:":"Existing directory:","New folder:":"New folder:","Choose a Folder":"Choose a Folder","Commit Changes":"Commit Changes","Message:":"Message:","Amend:":"Amend:",SmartAmend:"Amend Previous Commit","ChangeId:":"ChangeId:",SmartChangeId:"Prepare for Gerrit",
"Committer Name:":"Committer Name:","Committer Email:":"Committer Email:","Author Name:":"Author Name:","Author Email:":"Author Email:","The commit message is required.":"The commit message is required.","Git Credentials":"Git Credentials","Username:":"Username:","Private key:":"Private key:","Passphrase (optional):":"Passphrase (optional):","commit:":"commit: ","parent:":"parent: ","branches: ":"branches: ","tags: ":"tags: "," authored by ${0} {${1}) on ${2}":" authored by ${0} (${1}) on ${2}",Content:"Content",
"Go to ${0} section":"Go to ${0} section","Find Commit":"Find Commit","Type the commit name (sha1):":"Type the commit name (sha1):",Search:"Search","Searching...":"Searching...",SelectAll:"Select All","Looking for the commit":"Looking for the commit","New Branch:":"New Branch:","No remote selected":"No remote selected","Enter a name...":"Enter a name...",OK:"OK"," [New branch]":" [New branch]","Would you like to add ${0} key for host ${1} to continue operation? Key fingerpt is ${2}.":"Would you like to add ${0} key for host ${1} to continue operation? Key fingerpt is ${2}.",
"Link Repository":"Link Repository","Folder name:":"Folder name:","Repository was linked to ":"Repository was linked to ","Checkout the current tag, creating a local branch based on its contents.":"Checkout this commit, creating a local branch based on its contents.","Checking out tag ${0}":"Checking out tag ${0}","Checkout the branch or corresponding local branch and make it active. If the remote tracking branch does not have a corresponding local branch, the local branch will be created first.":"Checkout the branch or corresponding local branch and make it active. If the remote tracking branch does not have a corresponding local branch, the local branch will be created first.",
"Checking out branch...":"Checking out branch...","Checking out branch ${0}...":"Checking out branch ${0}...","Branch checked out.":"Branch checked out.","New Branch":"New Branch","Add a new local branch to the repository":"Add a new local branch to the repository","Branch name":"Branch name",Delete:"Delete","Delete the local branch from the repository":"Delete the local branch from the repository","Are you sure you want to delete branch ${0}?":"Are you sure you want to delete branch ${0}?","Delete the remote tracking branch from the repository":"Delete the remote tracking branch from the repository",
"Are you sure?":"Are you sure?","You're going to delete remote branch ${0} and push the change.":"You're going to delete remote branch ${0} and push the change.","Removing remote branch: ":"Removing remote branch: ","Delete Remote Branch":"Delete Remote Branch","New Remote":"New Remote","Git Remote":"Git Remote","Go to Git Remote":"Open the remote Git Log page for this file or folder.","Add a new remote to the repository":"Add a new remote to the repository","Delete the remote from the repository":"Delete the remote from the repository",
"Are you sure you want to delete remote ${0}?":"Are you sure you want to delete remote ${0}?",Pull:"Pull","Pull from the repository":"Pull from the repository","Pulling: ":"Pulling: ","Pull Git Repository":"Pull Git Repository","Git Log":"Git Log","Go to Git Log":"Open the local Git Log page for this file or folder.","Open the log for the branch":"Open the log for the branch","Open the log for the repository":"Open the log for the repository","Open the status for the repository":"Open the status for the repository",
ShowInEditor:"Show in Editor",ShowInEditorTooltip:"Show the repository folder in the editor","Compare With Each Other":"Compare With Each Other","Compare With Working Tree":"Compare With Working Tree",Open:"Open",Fetch:"Fetch","Fetch from the remote":"Fetch from the remote","Password:":"Password:","User Name:":"User Name:","Fetching remote: ":"Fetching remote: ","Force Fetch":"Force Fetch","Fetch from the remote branch into your remote tracking branch overriding its current content":"Fetch from the remote branch into your remote tracking branch overriding its current content",
"You're going to override content of the remote tracking branch. This can cause the branch to lose commits.":"You're going to override content of the remote tracking branch. This can cause the branch to lose commits.",Merge:"Merge","Merge the content from the branch to your active branch":"Merge the content from the branch to your active branch",". Go to ${0}.":". Go to ${0}.","Git Status page":"Git Status page",Rebase:"Rebase","Rebase your commits by removing them from the active branch, starting the active branch again based on the latest state of the selected branch ":"Rebase your commits by removing them from the active branch, starting the active branch again based on the latest state of the selected branch ",
"Rebase on top of ":"Rebase on top of ",RebaseSTOPPED:". Some conflicts occurred. Please resolve them and continue, skip patch or abort rebasing.",RebaseFAILED_WRONG_REPOSITORY_STATE:". Repository state is invalid (i.e. already during rebasing).",RebaseFAILED_UNMERGED_PATHS:". Repository contains unmerged paths.",RebaseFAILED_PENDING_CHANGES:". Repository contains pending changes. Please commit or stash them.",RebaseUNCOMMITTED_CHANGES:". There are uncommitted changes.","Rebase your commits by removing them from the active branch, ":"Rebase your commits by removing them from the active branch, ",
"starting the active branch again based on the latest state of '":"starting the active branch again based on the latest state of '","and applying each commit again to the updated active branch.":"and applying each commit again to the updated active branch.","Push All":"Push All","Push commits and tags from your local branch into the remote branch":"Push commits and tags from your local branch into the remote branch","Push Branch":"Push Branch","Push commits without tags from your local branch into the remote branch":"Push commits without tags from your local branch into the remote branch",
"Push for Review":"Push for Review","Push commits to Gerrit Code Review":"Push commits to Gerrit Code Review","Force Push Branch":"Force Push Branch","Push commits without tags from your local branch into the remote branch overriding its current content":"Push commits without tags from your local branch into the remote branch overriding its current content","Pushing remote: ":"Pushing remote: ","Choose Branch":"Choose Branch","Choose the remote branch.":"Choose the remote branch.","Force Push All":"Force Push All",
"Push commits and tags from your local branch into the remote branch overriding its current content":"Push commits and tags from your local branch into the remote branch overriding its current content","You're going to override content of the remote branch. This can cause the remote repository to lose commits.":"You're going to override content of the remote branch. This can cause the remote repository to lose commits.","\x3c Previous Page":"\x3c Previous Page","Show previous page of git log":"Show previous page of git log",
"Show previous page of git tags":"Show previous page of git tags","Next Page \x3e":"Next Page \x3e","Show next page of git log":"Show next page of git log","Show next page of git tags":"Show next page of git tags","Push from your local branch into the selected remote branch":"Push from your local branch into the selected remote branch","Reset your active branch to the state of the selected branch. Discard all staged and unstaged changes.":"Reset your active branch to the state of the selected branch. Discard all staged and unstaged changes.",
GitResetIndexConfirm:"The content of your active branch will be replaced with ${0}. All unstaged and staged changes will be discarded and cannot be recovered. Are you sure?","Resetting index...":"Resetting index...","Name:":"Name:",Tag:"Tag","Create a tag for the commit":"Create a tag for the commit","Tag name":"Tag name","Delete the tag from the repository":"Delete the tag from the repository","Are you sure you want to delete tag ${0}?":"Are you sure you want to delete tag ${0}?","Cherry-Pick":"Cherry-Pick",
"Apply the change introduced by the commit to your active branch":"Apply the change introduced by the commit to your active branch","Nothing changed.":"Nothing changed.",". Some conflicts occurred":". Some conflicts occurred.","Fetch from the remote branch into your remote tracking branch":"Fetch from the remote branch into your remote tracking branch","Fetch Git Repository":"Fetch Git Repository",Push:"Push","Push from your local branch into the remote branch":"Push from your local branch into the remote branch",
"Push Git Repository":"Push Git Repository","Key:":"Key:","Value:":"Value:","New Configuration Entry":"New Configuration Entry",Edit:"Edit","Edit the configuration entry":"Edit the configuration entry","Delete the configuration entry":"Delete the configuration entry","Are you sure you want to delete ${0}?":"Are you sure you want to delete ${0}?","Clone Repository":"Clone Repository","Clone an existing Git repository to a folder":"Clone an existing Git repository to a folder","Cloning repository: ":"Cloning repository: ",
"Init Repository":"Init Repository","Create a new Git repository in a new folder":"Create a new Git repository in a new folder","Initializing repository: ":"Initializing repository: ","Init Git Repository":"Init Git Repository","Delete the repository":"Delete the repository","Are you sure you want do delete ${0} repositories?":"Are you sure you want do delete ${0} repositories?","Apply a patch on the selected repository":"Apply a patch on the selected repository","Show content":"Show content","Commit name:":"Commit name:",
"Open Commit":"Open Commit","Open the commit with the given name":"Open the commit with the given name","No commits found":"No commits found","Staging changes":"Staging changes","Commit message:":"Commit message:","Committing changes":"Committing changes","Fetching previous commit message":"Fetching previous commit message","Resetting local changes":"Resetting local changes","Checkout files, discarding all changes":"Checkout files, discarding all changes","Show Patch":"Show Patch","Show workspace changes as a patch":"Show workspace changes as a patch",
"Show checked changes as a patch":"Show checked changes as a patch",Continue:"Continue","Contibue Rebase":"Contibue Rebase","Skip Patch":"Skip Patch",Abort:"Abort","Abort Rebase":"Abort Rebase",Discard:"Discard ${0} file(s)","Your changes to the selected files will be discarded and cannot be recovered.":"Your changes to the selected files will be discarded and cannot be recovered.","Getting git log":"Getting git log","Active Branch Log":"Git Log (Active Branch)","Show the log for the active local branch":"Show the log for the active local branch",
"Remote Branch Log":"Git Log (Remote Branch)","Show the log for the corresponding remote tracking branch":"Show the log for the corresponding remote tracking branch","See Full Status":"See Full Status","See the status":"See the status","Choose target location":"Choose target location","Default target location":"Default target location","Change...":"Change...","Merge Squash":"Merge Squash","Squash the content of the branch to the index":"Squash the content of the branch to the index","Local Branch Name:":"Local Branch Name:",
Local:"local","Filter items":"Filter items","Filter remote branches":"Filter remote branches","Getting remote branches":"Getting remote branches ${0}","Getting branches":"Getting branches ${0}","Paste link in email or IM":"Paste link in email or IM","Show Commit in GitHub":"Show Commit in GitHub","Show Repository in GitHub":"Show Repository in GitHub","Show this commit in GitHub":"Show this commit in GitHub","Show Commit in eclipse.org":"Show Commit in eclipse.org","Show this commit in eclipse.org":"Show this commit in eclipse.org",
"Show Repository in eclipse.org":"Show Repository in eclipse.org","Show this repository in eclipse.org":"Show this repository in eclipse.org","Ask for review":"Ask for review","Ask for review tooltip":"Send email with request for commit review","Reviewer name":"Reviewer name","Contribution Review Request":"Contribution Review Request","Send the link to the reviewer":"Send the link to the reviewer","Private key file (optional):":"Private key file (optional):","Don't prompt me again:":"Don't prompt me again:",
"Your private key will be saved in the browser for further use":"Your private key will be saved in the browser for further use","Loading Contribution Review Request...":"Loading Contribution Review Request...","The commit can be found in the following repositories":"The commit can be found in the following repositories","Try to update your repositories":"Try to update your repositories","Create new repository":"Create new repository","Attach the remote to one of your existing repositories":"Attach the remote to one of your existing repositories",
"You are reviewing contribution ${0} from ${1}":"You are reviewing contribution ${0} from ${1}","Unfortunately the commit can not be found in your workspace. To see it try one of the following: ":"Unfortunately the commit can not be found in your workspace. To see it try one of the following: ","To review the commit you can also:":"To review the commit you can also:","Contribution Review Request for ${0} on ${1}":"Contribution Review Request for ${0} on ${1}","Failing paths: ${0}":"Failing paths: ${0}",
"Problem while performing the action":"Problem while performing the action","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.","URL:":"URL:","File:":"File:",Submit:"Submit","git url:":"git url: ",Revert:"Revert","Revert changes introduced by the commit into your active branch":"Revert changes introduced by the commit into your active branch",
". Could not revert into active branch":". Could not revert into active branch.",Login:"Login","Authentication required for: ${0}. ${1} and re-try the request.":"Authentication required for: ${0}. ${1} and re-try the request.","Remember my committer name and email:":"Remember my committer name and email:","Successfully edited ${0} to have value ${1}":"Successfully edited ${0} to have value ${1}","Successfully added ${0} with value ${1}":"Successfully added ${0} with value ${1}","Signed-off-by: ":"Signed-off-by: ",
"Change-Id: ":"Change-Id: ",REJECTED_NONFASTFORWARD:"Push is non-fastforward and was rejected. Use Fetch to see new commits that must be merged.","Commit and Push":"Commit and Push",Sync:"Sync",SyncTooltip:"Fetch from the remote branch. Rebase your commits by removing them from the local branch, starting the local branch again based on the latest state of the remote branch and applying each commit to the updated local branch. Push commits and tags from your local branch into the remote branch.",NoCommits:"No Commits",
Incoming:"Incoming",Outgoing:"Outgoing",Synchronized:"History",NoBranch:"No Branch",None:"None"});define("git/nls/gitmessages",["orion/i18n!git/nls/gitmessages","git/nls/root/gitmessages"],function(l,n){var m={root:n};Object.keys(l).forEach(function(k){"undefined"===typeof m[k]&&(m[k]=l[k])});return m});
(function(){function l(){for(var g=navigator.userAgent,h={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}],d=0;d<f.length;d++){var a=f[d],e=g.match(a.regExp);if(e){h.browser=
!0;h.version=e[1]>=a.minVersion;h.name=a.name;break}}return h}function n(){try{return"localStorage"in window&&null!==window.localStorage}catch(g){return!1}}function m(g){alert(g);throw Error("unsupported browser");}var k=l();if(k.browser)k.version||m("Sorry, your browser version is not supported.\n\nTo use Orion, please upgrade to the latest version of "+k.name+".\n");else if(n()&&!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 n()||m("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:l,supportsLocalStorage:n,throwBrowserAlert:m}})();define("orion/browserCompatibility",function(){});
(function(l,n){"function"===typeof define&&define.amd?define("orion/Deferred",n):"object"===typeof exports?module.exports=n():(l.orion=l.orion||{},l.orion.Deferred=n())})(this,function(){function l(){for(var d;d=g.shift();)d();h=!1}function n(d){g.push(d);h||(h=!0,f())}function m(d){return function(a){d(a)}}function k(){function d(){for(var a;a=g.shift();){var e=a.deferred,b="fulfilled"===f?"resolve":"reject";a=a[b];if("function"===typeof a)try{var d=a(p),h=d&&("object"===typeof d||"function"===typeof d)&&
d.then;if("function"===typeof h)if(d===e.promise)e.reject(new TypeError);else{var k=d.cancel;"function"===typeof k?e._parentCancel=k.bind(d):delete e._parentCancel;h.call(d,m(e.resolve),m(e.reject),m(e.progress))}else e.resolve(d)}catch(u){e.reject(u)}else e[b](p)}}function a(a){delete h._parentCancel;f="rejected";p=a;g.length&&n(d)}function e(b){function x(a){return function(b){(!f||"assumed"===f)&&a(b)}}delete h._parentCancel;try{var l=b&&("object"===typeof b||"function"===typeof b)&&b.then;if("function"===
typeof l)if(b===h)a(new TypeError);else{f="assumed";var m=b&&b.cancel;if("function"!==typeof m){var t=new k;b=t.promise;try{l(t.resolve,t.reject,t.progress)}catch(z){t.reject(z)}m=b.cancel;l=b.then}p=b;l.call(b,x(e),x(a));h._parentCancel=m.bind(b)}else f="fulfilled",p=b,g.length&&n(d)}catch(B){x(a)(B)}}function b(){var b=h._parentCancel;b?(delete h._parentCancel,b()):f||(b=Error("Cancel"),b.name="Cancel",a(b))}var p,f,g=[],h=this;this.resolve=function(a){f||e(a);return h};this.reject=function(b){f||
a(b);return h};this.progress=function(a){f||g.forEach(function(b){if(b.progress)try{b.progress(a)}catch(e){}});return h.promise};this.cancel=function(){h._parentCancel?setTimeout(b,0):b();return h};this.then=function(a,b,e){var p=new k;p._parentCancel=h.promise.cancel;g.push({resolve:a,reject:b,progress:e,deferred:p});("fulfilled"===f||"rejected"===f)&&n(d);return p.promise};this.promise={then:h.then,cancel:h.cancel}}var g=[],h=!1,f=function(){if("undefined"!==typeof process&&"function"===typeof process.nextTick){var d=
process.nextTick;return function(){d(l)}}if("function"===typeof MutationObserver){var a=document.createElement("div");(new MutationObserver(l)).observe(a,{attributes:!0});return function(){a.setAttribute("class","_tick")}}return function(){setTimeout(l,0)}}();k.all=function(d,a){function e(a,b){g||(f[a]=b,0===--p&&h.resolve(f))}function b(b,p){if(!g){if(a)try{e(b,a(p));return}catch(d){p=d}h.reject(p)}}var p=d.length,f=[],g=!1,h=new k;h.then(void 0,function(){g=!0;d.forEach(function(a){a.cancel&&a.cancel()})});
0===p?h.resolve(f):d.forEach(function(a,p){a.then(e.bind(void 0,p),b.bind(void 0,p))});return h.promise};k.when=function(d,a,e,b){var p;d&&"function"===typeof d.then||(p=new k,p.resolve(d),d=p.promise);return d.then(a,e,b)};return k});
define("orion/EventTarget",[],function(){function l(){this._namedListeners={}}l.prototype={dispatchEvent:function(l){if(!l.type)throw Error("unspecified type");var m=this._namedListeners[l.type];m&&m.forEach(function(k){try{"function"===typeof k?k(l):k.handleEvent(l)}catch(g){"undefined"!==typeof console&&console.log(g)}});return!l.defaultPrevented},addEventListener:function(l,m){if("function"===typeof m||m.handleEvent)this._namedListeners[l]=this._namedListeners[l]||[],this._namedListeners[l].push(m)},
removeEventListener:function(l,m){var k=this._namedListeners[l];if(k)for(var g=0;g<k.length;g++)if(k[g]===m){1===k.length?delete this._namedListeners[l]:k.splice(g,1);break}}};l.prototype.constructor=l;l.attach=function(n){var m=new l;n.dispatchEvent=m.dispatchEvent.bind(m);n.addEventListener=m.addEventListener.bind(m);n.removeEventListener=m.removeEventListener.bind(m)};return l});
define("orion/serviceregistry",["orion/Deferred","orion/EventTarget"],function(l,n){function m(d,a,e){this._properties=e||{};this._properties["service.id"]=d;this._properties.objectClass=a;this._properties["service.names"]=a}function k(d,a,e){this._serviceId=d;this._serviceReference=a;this._internalRegistry=e}function g(d,a){function e(b){return function(){var e;try{if(!a())throw Error("Service was unregistered");var f=d[b].apply(d,Array.prototype.slice.call(arguments));if(f&&"function"===typeof f.then)return f;
e=new l;e.resolve(f)}catch(g){e=new l,e.reject(g)}return e.promise}}for(var b in d)"function"===typeof d[b]&&(this[b]=e(b))}function h(d,a){this.type=d;this.serviceReference=a}function f(){this._entries=[];this._namedReferences={};this._serviceEventTarget=new n;var d=this;this._internalRegistry={isRegistered:function(a){return d._entries[a]?!0:!1},unregisterService:function(a){var e=d._entries[a];if(!e)throw Error("Service has already been unregistered: "+a);var b=e.reference;d._serviceEventTarget.dispatchEvent(new h("unregistering",
b));d._entries[a]=null;b.getProperty("objectClass").forEach(function(a){for(var e=d._namedReferences[a],f=0;f<e.length;f++)if(e[f]===b){1===e.length?delete d._namedReferences[a]:e.splice(f,1);break}})},modifyService:function(a){var e=d._entries[a];if(!e)throw Error("Service not found while trying to send modified event: "+a);d._serviceEventTarget.dispatchEvent(new h("modified",e.reference))}}}m.prototype={getPropertyKeys:function(){var d=[],a;for(a in this._properties)this._properties.hasOwnProperty(a)&&
d.push(a);return d},getProperty:function(d){return this._properties[d]}};m.prototype.constructor=m;k.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(d){var a=this._serviceReference._properties;this._serviceReference._properties=d||{};d["service.id"]=this._serviceId;
d.objectClass=a.objectClass;d["service.names"]=a["service.names"];this._internalRegistry.modifyService(this._serviceId)}};k.prototype.constructor=k;f.prototype={getService:function(d){var a;if("string"===typeof d)(d=this._namedReferences[d])&&d.some(function(e){a=this._entries[e.getProperty("service.id")].service;return!!a},this);else if(d=this._entries[d.getProperty("service.id")])a=d.service;return a||null},getServiceReferences:function(d){if(d)return this._namedReferences[d]?this._namedReferences[d]:
[];var a=[];this._entries.forEach(function(e){e&&a.push(e.reference)});return a},registerService:function(d,a,e){if("undefined"===typeof a||null===a)throw Error("invalid service");"string"===typeof d?d=[d]:Array.isArray(d)||(d=[]);var b=this._entries.length,p=new m(b,d,e),f=this._namedReferences;d.forEach(function(a){f[a]=f[a]||[];f[a].push(p)});d=new g(a,this._internalRegistry.isRegistered.bind(null,b));this._entries.push({reference:p,service:d});d=this._internalRegistry;this._serviceEventTarget.dispatchEvent(new h("registered",
p));return new k(b,p,d)},addEventListener:function(d,a){this._serviceEventTarget.addEventListener(d,a)},removeEventListener:function(d,a){this._serviceEventTarget.removeEventListener(d,a)}};f.prototype.constructor=f;return{ServiceRegistry:f}});
define("orion/xhr",["orion/Deferred"],function(l){function n(l,k,g,h){var f="undefined"!==typeof g.response?g.response:g.responseText,d;try{d=g.status}catch(a){d=0}l={args:k,response:f,responseText:"string"===typeof f?f:null,status:d,url:l,xhr:g};"undefined"!==typeof h&&(l.error=h);return l}return function(m,k,g){g=g||{};var h=3<arguments.length&&arguments[3]?arguments[3]:new XMLHttpRequest,f=new l,d=g.headers||{},a=g.log||!1,e;"undefined"===typeof d["X-Requested-With"]&&(d["X-Requested-With"]="XMLHttpRequest");
if("undefined"!==typeof g.data&&("POST"===m||"PUT"===m))e=g.data;var b=!1,p=!1;f.promise.then(void 0,function(a){b=!0;!p&&(a instanceof Error&&"Cancel"===a.name)&&h.abort()});h.onabort=function(){p=!0;if(!b){var a=Error("Cancel");a.name="Cancel";f.reject(a)}};h.onload=function(){var b=n(k,g,h);200<=h.status&&400>h.status?f.resolve(b):(f.reject(b),a&&"undefined"!==typeof console&&console.log(Error(h.statusText)))};h.onerror=function(){var b=n(k,g,h);f.reject(b);a&&"undefined"!==typeof console&&console.log(Error(h.statusText))};
h.onprogress=function(a){a.xhr=h;f.progress(a)};try{h.open(m,k,!0);"string"===typeof g.responseType&&(h.responseType=g.responseType);if("number"===typeof g.timeout)if("number"===typeof h.timeout)h.timeout=g.timeout,h.addEventListener("timeout",function(a){f.reject(n(k,g,h,"Timeout exceeded"))});else{var q=setTimeout(function(){f.reject(n(k,g,h,"Timeout exceeded"))},g.timeout);f.promise.then(clearTimeout.bind(null,q),clearTimeout.bind(null,q))}Object.keys(d).forEach(function(a){h.setRequestHeader(a,
d[a])});h.send(e||null)}catch(s){f.reject(n(k,g,h,s))}return f.promise}});
define("orion/preferences",["require","orion/Deferred","orion/xhr"],function(l,n,m){function k(a,b){this._name=a;this._providers=b;this._flushPending=!1;this._cached=null;this._stores=[];this._pendingDeletes=[];this._dirty=[]}function g(a,b){return{get:function(p,d){if(0===b)return null;var f=localStorage.getItem(a+p);if(null===f)return null;f=JSON.parse(f);return d||-1===b||f._expires&&f._expires>(new Date).getTime()?(delete f._expires,f):null},set:function(p,d){if(0!==b)if(-1!==b&&(d._expires=(new Date).getTime()+
1E3*b),0===Object.keys(d).length)localStorage.removeItem(a+p);else{var f=JSON.stringify(d);localStorage.setItem(a+p,f);delete d._expires}},remove:function(b){localStorage.removeItem(a+b)}}}function h(a){this._currentPromises={};this._cache=new g("/orion/preferences/user",3600);this._service=null;this.available=function(){if(!this._service){var b=a.getServiceReferences("orion.core.preference.provider");0<b.length&&(this._service=a.getService(b[0]))}return!!this._service}}function f(a){this._location=
a;this._currentPromise=null;this._cache=new g("/orion/preferences/default",3600)}function d(){this._cache=new g("/orion/preferences/local",-1)}function a(a,b){this._userProvider=new h(a);this._localProvider=new d;b=b||"defaults.pref";-1===b.indexOf("://")&&(b=l.toUrl(b));this._defaultsProvider=new f(b);this._serviceRegistration=a.registerService("orion.core.preference",this)}k.prototype={_flush:function(){for(var a=[],b=0;b<this._stores.length;++b){var p=this._stores[b];-1!==this._dirty.indexOf(p)&&
a.push(this._providers[b].put(this._name,p));if(this._pendingDeletes[b]&&0<this._pendingDeletes[b].length){for(p=0;p<this._pendingDeletes[b].length;p++)a.push(this._providers[b].remove(this._name,this._pendingDeletes[b][p]));delete this._pendingDeletes[b]}}this._dirty=[];return n.all(a)},_scheduleFlush:function(a){a&&-1===this._dirty.indexOf(a)&&this._dirty.push(a);this._flushPending||(this._flushPending=!0,window.setTimeout(function(){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 b=this._stores[a],p;for(p in b)b.hasOwnProperty(p)&&"undefined"===typeof this._cached[p]&&(this._cached[p]=b[p])}}return this._cached},keys:function(){return Object.keys(this._getCached())},get:function(a){return this._getCached()[a]},put:function(a,b){if(0!==this._stores.length){var p=this._stores[0];p[a]!==b&&(p[a]=b,this._cached=null,this._scheduleFlush(p))}},remove:function(a){for(var b=0;b<
this._stores.length;++b){var p=this._stores[b];if(p.hasOwnProperty(a))return delete p[a],this._pendingDeletes[b]||(this._pendingDeletes[b]=[]),this._pendingDeletes[b].push(a),this._cached=null,this._scheduleFlush(),!0}return!1},clear:function(){for(var a=0;a<this._stores.length;++a)this._stores[a]={},this._scheduleFlush(this._stores[a]);this._cached=null},sync:function(a){if(this._flushPending)return this._flushPending=!1,this._flush();for(var b=this,p=[],d=0;d<this._providers.length;++d)p.push(this._providers[d].get(this._name,
a).then(function(a){return function(e){b._stores[a]=e}}(d)));return n.all(p).then(function(){b._cached=null;b._getCached()})},flush:function(){this._flush()}};h.prototype={get:function(a,b){if(this._currentPromises[a])return this._currentPromises[a];var p=new n,d=null;b?this._cache.remove(a):d=this._cache.get(a);if(null!==d)p.resolve(d);else{this._currentPromises[a]=p;var f=this;this._service.get(a).then(function(b){f._cache.set(a,b);delete f._currentPromises[a];p.resolve(b)},function(b){404===b.status?
(b={},f._cache.set(a,b),delete f._currentPromises[a],p.resolve(b)):(delete f._currentPromises[a],p.resolve(f._cache.get(a,!0)||{}))})}return p},put:function(a,b){this._cache.set(a,b);return this._service.put(a,b)},remove:function(a,b){var p=this._cache.get(a);delete p[b];this._cache.set(a,p);return this._service.remove(a,b)}};f.prototype={get:function(a,b){if(this._currentPromise)return this._currentPromise;var p=new n,d=null;b?this._cache.remove(a):d=this._cache.get(a);if(null!==d)p.resolve(d);else{this._currentPromise=
p;var f=this;m("GET",this._location,{headers:{"Orion-Version":"1"},timeout:15E3}).then(function(b){b=JSON.parse(b.response);f._cache.set(a,b[a]||{});f._currentPromise=null;p.resolve(b[a]||{})},function(b){401===b.xhr.status||404===b.xhr.status?(f._cache.set(a,{}),f._currentPromise=null,p.resolve({})):(f._currentPromise=null,b=f._cache.get(a,!0),null!==b?p.resolve(b[a]||{}):p.resolve({}))})}return p},put:function(a,b){var p=new n;p.resolve();return p},remove:function(a,b){var p=this._cache.get(a);
delete p[b];this.put(a,p)}};d.prototype={get:function(a){var b=new n;a=this._cache.get(a);null!==a?b.resolve(a):b.resolve({});return b},put:function(a,b){var p=new n;this._cache.set(a,b);p.resolve();return p},remove:function(a,b){var p=this._cache.get(a);delete p[b];this.put(a,p)}};a.DEFAULT_SCOPE=1;a.LOCAL_SCOPE=2;a.USER_SCOPE=4;a.prototype={listenForChangedSettings:function(e,b,p){if(!b||"number"!==typeof b||7<b||1>b)p=b,b=a.DEFAULT_SCOPE|a.LOCAL_SCOPE|a.USER_SCOPE;window.addEventListener("storage",
p,!1);return 0!==(a.USER_SCOPE&b)?"/orion/preferences/user"+e:0!==(a.LOCAL_SCOPE&b)?"/orion/preferences/local"+e:"/orion/preferences/default"+e},getPreferences:function(e,b){if(!b||"number"!==typeof b||7<b||1>b)b=a.DEFAULT_SCOPE|a.LOCAL_SCOPE|a.USER_SCOPE;var p=[];a.USER_SCOPE&b&&this._userProvider.available()&&p.push(this._userProvider);a.LOCAL_SCOPE&b&&p.push(this._localProvider);a.DEFAULT_SCOPE&b&&p.push(this._defaultsProvider);var d=new k(e,p);return d.sync().then(function(){return d})},getSetting:function(a,
b,p){for(var d,f=0;f<a.length;f++)if(a[f].label===b)for(var g=0;g<a[f].data.length;g++)if(a[f].data[g].label===p){d=a[f].data[g].value;break}return d}};return{PreferencesService:a}});
(function(){function l(a){if("string"!==typeof a)throw new TypeError;}function n(a){return a?a.split("\x26"):[]}function m(a){return 0===a.length?"":a.join("\x26")}function k(a){var b=/([^=]*)(?:=?)(.*)/.exec(a);a=b[1]?decodeURIComponent(b[1]):"";b=b[2]?decodeURIComponent(b[2]):"";return[a,b]}function g(a){var b=encodeURIComponent(a[0]);a[1]&&(b+="\x3d"+encodeURIComponent(a[1]));return b}function h(a,b){var e="",p=[],v=0;return{next:function(){e!==a.query&&(e=a.query,p=n(e));if(v<p.length){var d=
k(p[v++]);switch(b){case "keys":return d[0];case "values":return d[1];case "keys+values":return[d[0],d[1]];default:throw new TypeError;}}throw C;}}}function f(a){Object.defineProperty(this,"_url",{get:function(){return a._url}})}function d(a){return a?/[1-9]\d*$/.exec(a)[0]:""}function a(a){var b=[];a.split("/").forEach(function(a){".."===a?b.pop():"."!==a&&b.push(a)});return b.join("/")}function e(a){return a.replace(/\s/g,function(a){return"%"+a.charCodeAt(0).toString(16)})}function b(b,p){if("string"!==
typeof b)throw new TypeError;b=e(b);var v=u.exec(b);if(!v)return null;var f={};f.scheme=v[1]||"";if(f.scheme&&!x.test(f.scheme))return null;var g=v[2];if(g&&(g=w.exec(g),f.userinfo=g[1],f.host=g[2],f.port=g[3],f.port&&!y.test(f.port)))return null;f.path=v[3];f.query=v[4];f.fragment=v[5];!f.scheme&&p&&(f.scheme=p.scheme,!f.host&&p.host&&(f.userinfo=p.userinfo,f.host=p.host,f.port=p.port,f.pathRelative=!0));f.pathRelative&&(f.path?"/"!==f.path[0]&&(v=/^(.*\/)[^\/]*$/.exec(p.path)[1]||"/",f.path=v+f.path):
f.path=p.path);f.scheme&&(f.scheme=f.scheme.toLowerCase());f.port&&(f.port=d(f.port));f.host&&f.path&&(f.path=a(f.path));return f}function p(a,e){var p;if(e){e=e.href||e;p=b(e);if(!p||!p.scheme)throw new SyntaxError;Object.defineProperty(this,"_baseURL",{value:p})}p=b(a,p);if(!p)throw new SyntaxError;Object.defineProperty(this,"_input",{value:a,writable:!0});Object.defineProperty(this,"_url",{value:p,writable:!0});var v=new f(this);Object.defineProperty(this,"query",{get:function(){return this._url?
v:null},enumerable:!0})}try{var q;if("function"===typeof window.URL&&0!==window.URL.length&&"http:"===(q=new window.URL("http://www.w3.org?q")).protocol&&q.query)return}catch(s){}var u=/^(?:([^:\/?#]+):)?(?:\/\/([^\/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?$/,w=/^(?:(.*)@)?(\[[^\]]*\]|[^:]*)(?::(.*))?$/,x=/^([a-zA-Z](?:[a-zA-Z0-9+-.])*)$/,y=/^\d*$/,r=/^(\[[^\]\/?#\s]*\]|[^:\/?#\s]*)$/,t=/^(\[[^\]\/?#\s]*\]|[^:\/?#\s]*)(?::(\d*))?$/,z=/^([^?#\s]*)$/,B=/^([^\s]*)$/,v=/^\S*$/,A=/([^:]*):?(.*)/,C="undefined"!==
typeof StopIteration?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){l(a);var b;n(this._url.query).some(function(e){e=k(e);if(e[0]===a)return b=e[1],!0});return b},enumerable:!0},set:{value:function(a,b){l(a);l(b);var e=n(this._url.query);e.some(function(p,v){var d=k(p);if(d[0]===a)return d[1]=b,e[v]=g(d),!0})||e.push(g([a,b]));this._url.query=m(e)},enumerable:!0},has:{value:function(a){l(a);
return n(this._url.query).some(function(b){if(k(b)[0]===a)return!0})},enumerable:!0},"delete":{value:function(a){l(a);var b=n(this._url.query),e=b.filter(function(b){return k(b)[0]!==a});return e.length!==b.length?(this._url.query=m(e),!0):!1},enumerable:!0},clear:{value:function(){this._url.query=""},enumerable:!0},forEach:{value:function(a,b){if("function"!==typeof a)throw new TypeError;var e=h(this._url,"keys+values");try{for(;;){var p=e.next();a.call(b,p[1],p[0],this)}}catch(v){if(v!==C)throw v;
}},enumerable:!0},keys:{value:function(){return h(this._url,"keys")},enumerable:!0},values:{value:function(){return h(this._url,"values")},enumerable:!0},items:{value:function(){return h(this._url,"keys+values")}},size:{get:function(){return n(this._url.query).length},enumerable:!0},getAll:{value:function(a){l(a);var b=[];n(this._url.query).forEach(function(e){e=k(e);e[0]===a&&b.push(e[1])});return b},enumerable:!0},append:{value:function(a,b){l(a);l(b);var e=n(this._url.query);e.push(g([a,b]));this._url.query=
m(e)},enumerable:!0}});Object.defineProperties(p.prototype,{href:{get:function(){var a;if(this._url){a=this._url;var b=a.scheme?a.scheme+":":"";a.host&&(b+="//",a.userinfo&&(b+=a.userinfo+"@"),b+=a.host,a.port&&(b+=":"+a.port));b+=a.path;a.query&&(b+="?"+a.query);a.fragment&&(b+="#"+a.fragment);a=b}else a=this._input;return a},set:function(a){l(a);this._input=a;this._url=b(this._input,this._baseURL)},enumerable:!0},origin:{get:function(){return this._url&&this._url.host?this.protocol+"//"+this.host:
""},enumerable:!0},protocol:{get:function(){return this._url?this._url.scheme+":":":"},set:function(a){l(a);if(this._url&&(a=":"===a.slice(-1)?a.substring(0,a.length-1):a,""===a||x.test(a)))this._url.scheme=a.toLowerCase()},enumerable:!0},_userinfo:{get:function(){return this._url?this._url.userinfo:""},set:function(a){l(a);this._url&&(this._url.userinfo=a)}},username:{get:function(){if(!this._url)return"";var a=A.exec(this._userinfo);return decodeURIComponent(a[1]||"")},set:function(a){l(a);if(this._url){var b=
A.exec(this._userinfo);a=[encodeURIComponent(a||"")];b[2]&&a.push(b[2]);this._userinfo=a.join(":")}},enumerable:!0},password:{get:function(){if(!this._url)return"";var a=A.exec(this._userinfo);return decodeURIComponent(a[2]||"")},set:function(a){l(a);if(this._url){var b=[A.exec(this._userinfo)[1]||""];a&&b.push(encodeURIComponent(a));this._userinfo=b.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){l(a);if(this._url&&(a=t.exec(a)))this._url.host=a[1],this._url.port=d(a[2])},enumerable:!0},hostname:{get:function(){return this._url?this._url.host:""},set:function(a){l(a);this._url&&r.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){l(a);this._url&&y.exec(a)&&(this._url.port=d(a))},enumerable:!0},pathname:{get:function(){return this._url?this._url.path:""},set:function(b){l(b);
this._url&&z.exec(b)&&(this._url.host&&(b&&"/"!==b[0])&&(b="/"+b),this._url.path=b?a(b):"")},enumerable:!0},search:{get:function(){return this._url&&this._url.query?"?"+this._url.query:""},set:function(a){l(a);this._url&&(a&&"?"===a[0]&&(a=a.substring(1)),B.exec(a)&&(this._url.query=a))},enumerable:!0},hash:{get:function(){return this._url&&this._url.fragment?"#"+this._url.fragment:""},set:function(a){l(a);this._url&&(a&&"#"===a[0]&&(a=a.substring(1)),v.exec(a)&&(this._url.fragment=a))},enumerable:!0}});
if((q=window.URL||window.webkitURL)&&q.createObjectURL)Object.defineProperty(p,"createObjectURL",{value:q.createObjectURL.bind(q),enumerable:!1}),Object.defineProperty(p,"revokeObjectURL",{value:q.revokeObjectURL.bind(q),enumerable:!1});window.URL=p})();define("orion/URL-shim",function(){});
define("orion/pluginregistry",["orion/Deferred","orion/EventTarget","orion/URL-shim"],function(l,n){function m(a,b){var e=Object.keys(a),d=Object.keys(b);if(e.length!==d.length)return!1;e.sort();d.sort();for(var f=0,g=e.length;f<g;f++){var h=e[f];if(h!==d[f])return!1;var k=a[h],h=b[h];if(k!==h&&JSON.stringify(k)!==JSON.stringify(h))return!1}return!0}function k(a){if(-1===a.indexOf("://"))try{return(new URL(a,location.href)).href}catch(b){}return a}function g(a){var b=null,e={key:function(e){return(b=
b||Object.keys(a))[e]},getItem:function(b){return a[b]},setItem:function(e,d){a[e]=d;b=null},removeItem:function(e){delete a[e];b=null},clear:function(){(b=b||Object.keys(a)).forEach(function(b){delete a[b]}.bind(this));b=null}};Object.defineProperty(e,"length",{get:function(){return(b=b||Object.keys(a)).length}});return e}function h(a,b){if(b&&b instanceof XMLHttpRequest){var e,d;try{e=b.status,d=b.statusText}catch(f){e=0,d=""}return{status:e||0,statusText:d}}return b}function f(a){var b=a?JSON.parse(JSON.stringify(a,
h)):a;a instanceof Error&&(b.__isError=!0,b.message=b.message||a.message,b.name=b.name||a.name);return b}function d(a,b){this.type=a;this.plugin=b}function a(a,b){this.__objectId=a;this.__methods=b}function e(b,e,g){function h(a){L&&g.postMessage(a,L)}function k(b){if(!L)return(new l).reject(Error("plugin not connected"));b.id=String(V++);var e=new l;W[b.id]=e;e.then(null,function(a){"active"===F&&(a instanceof Error&&"Cancel"===a.name)&&h({requestId:b.id,method:"cancel",params:a.message?[a.message]:
[]})});var p=Object.prototype.toString;b.params.forEach(function(v,d){if("[object Object]"===p.call(v)&&!(v instanceof a)){var f,g;for(f in v)"[object Function]"===p.call(v[f])&&(g=g||[],g.push(f));if(g){var A=U++;T[A]=v;f=function(){delete T[A]};e.then(f,f);b.params[d]=new a(A,g)}}});g.postMessage(b,L);return e.promise}function x(a,b){a||0===a?h({id:a,result:null,error:b}):console.log(b)}function y(a,b,e,p){p.forEach(function(a,b){if(a&&"undefined"!==typeof a.__objectId){var e={};a.__methods.forEach(function(b){e[b]=
function(){return k({objectId:a.__objectId,method:b,params:Array.prototype.slice.call(arguments)})}});p[b]=e}});var v=void 0===typeof a?null:{id:a,result:null,error:null};try{var d=e.apply(b,p);v&&(d&&"function"===typeof d.then?(S[a]=d,d.then(function(b){delete S[a];v.result=b;h(v)},function(b){S[a]&&(delete S[a],v.error=f(b),h(v))},function(){h({responseId:a,method:"progress",params:Array.prototype.slice.call(arguments)})})):(v.result=d,h(v)))}catch(g){v&&(v.error=f(g),h(v))}}function r(a){try{if(a.method){var b=
a.method,e=a.params||[];if("serviceId"in a){var v=ba[a.serviceId];v||x(a.id,"service not found");b in v?y(a.id,v,v[b],e):x(a.id,"method not found")}else if("objectId"in a){var p=T[a.objectId];p||x(a.id,"object not found");b in p?y(a.id,p,p[b],e):x(a.id,"method not found")}else if("requestId"in a){var d=S[a.requestId];d&&("cancel"===b&&d.cancel)&&d.cancel.apply(d,e)}else if("responseId"in a){var f=W[a.responseId];f&&("progress"===b&&f.progress)&&f.progress.apply(f,e)}else if("plugin"===a.method){L.connected();
var q=a.params[0];X({headers:q.headers,services:q.services}).then(function(){H&&H.resolve(A)})}else if("timeout"===a.method)H&&H.reject(a.error);else throw Error("Bad method: "+a.method);}else{var C=W[String(a.id)];delete W[String(a.id)];if(a.error){var h=g.handleServiceError(A,a.error);C.reject(h)}else C.resolve(a.result)}}catch(k){console.log("Plugin._messageHandler "+k)}}function t(b){var e={};if(b.methods&&(b.methods.forEach(function(a){e[a]=function(){var e={serviceId:b.serviceId,method:a,params:Array.prototype.slice.call(arguments)};
return"active"===F?k(e):A.start({"transient":!0}).then(function(){return k(e)})}}),e.addEventListener&&e.removeEventListener)){var v=new n,p=U++;T[p]={handleEvent:v.dispatchEvent.bind(v)};var d=new a(p,["handleEvent"]),f=e.addEventListener;e.addEventListener=function(a,b){v._namedListeners[a]||f(a,d);v.addEventListener(a,b)};var g=e.removeEventListener;e.removeEventListener=function(a,b){v.removeEventListener(a,b);v._namedListeners[a]||g(a,d)}}return e}function z(a){var e=JSON.parse(JSON.stringify(a.properties));
e.__plugin__=b;a=a.names||a.type||[];Array.isArray(a)||(a=[a]);e.objectClass=a;return e}function B(a){var b=t(a),e=z(a),e=g.registerService(a.names||a.type,b,e);J[a.serviceId]={registration:e,proxy:b}}function v(){g.persist(b,{created:C,headers:D,services:E,autostart:K,lastModified:I})}var A=this;e=e||{};var C=e.created||(new Date).getTime(),D=e.headers||{},E=e.services||[],K=e.autostart,I=e.lastModified||0,F="installed",G,H,L,P,J={},V=0,U=0,S={},W={},T={},ba={},X;this._default=!1;this._persist=v;
this._resolve=function(){F="resolved";g.dispatchEvent(new d("resolved",A))};this._getAutostart=function(){return K};this._getCreated=function(){return C};this.getLocation=function(){return b};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 I};this.getServiceReferences=function(){var a=
[];Object.keys(J).forEach(function(b){a.push(J[b].registration.getReference())});return a};this.setParent=function(a){return P!==a?(P=a,A.stop({"transient":!0}).then(function(){if("started"===K)return A.start({"transient":!0});if("lazy"===K)return A.start({lazy:!0,"transient":!0})})):(new l).resolve()};this.getState=function(){return F};this.start=function(a){if("uninstalled"===F)return(new l).reject(Error("Plugin is uninstalled"));if(G)return G.promise.then(this.start.bind(this,a));if("active"===
F)return(new l).resolve();if(!a||!a.transient){var e=a&&a.lazy?"lazy":"started";e!==K&&(K=e,v())}e=g.getState();if("starting"!==e&&"active"!==e)return a.transient?(new l).reject(Error("start transient error")):(new l).resolve();if("installed"===F)try{this._resolve()}catch(f){return(new l).reject(f)}"resolved"===F&&E.forEach(function(a){B(a)});if(a&&a.lazy)return"starting"!==F&&(F="starting",g.dispatchEvent(new d("lazy activation",A))),(new l).resolve();var q=new l;G=q;F="starting";g.dispatchEvent(new d("starting",
A));H=new l;L=g.connect(b,r,P);H.then(function(){H=null;F="active";g.dispatchEvent(new d("started",A));G=null;q.resolve()},function(){H=null;F="stopping";g.dispatchEvent(new d("stopping",A));Object.keys(J).forEach(function(a){J[a].registration.unregister();delete J[a]});g.disconnect(L);L=null;F="resolved";G=null;g.dispatchEvent(new d("stopped",A));q.reject(Error("Failed to load plugin: "+b));A._default&&(I=0,v())});return q.promise};this.stop=function(a){if("uninstalled"===F)return(new l).reject(Error("Plugin is uninstalled"));
if(G)return G.promise.then(this.stop.bind(this,a));if((!a||!a.transient)&&"stopped"!==K)K="stopped",v();if("active"!==F&&"starting"!==F)return(new l).resolve();G=a=new l;F="stopping";g.dispatchEvent(new d("stopping",A));Object.keys(J).forEach(function(a){J[a].registration.unregister();delete J[a]});L&&(g.disconnect(L),L=null);F="resolved";G=null;g.dispatchEvent(new d("stopped",A));a.resolve();return a.promise};X=function(a){if("uninstalled"===F)return(new l).reject(Error("Plugin is uninstalled"));
if(!a)return 0===I&&(I=(new Date).getTime(),v()),g.loadManifest(b).then(X,function(){A._default&&(I=0,v());console.log("Failed to load plugin: "+b)});var e=D,f=E,q=K;D=a.headers||{};E=a.services||[];K=a.autostart||K;a.lastModified?I=a.lastModified:(I=(new Date).getTime(),v());if(m(D,e)&&m(E,f)&&K===q)return(new l).resolve();if("active"===F||"starting"===F){var C=[];Object.keys(E).forEach(function(a){var b=E[a];C.push(a);var e=J[a];if(e){if(m(b.methods,Object.keys(e.proxy))){a=z(b);var v=e.registration.getReference(),
p={};v.getPropertyKeys().forEach(function(a){p[a]=v.getProperty(a)});m(a,p)||e.registration.setProperties(a);return}e.registration.unregister();delete J[a]}B(b)});Object.keys(J).forEach(function(a){-1===C.indexOf(a)&&(J[a].registration.unregister(),delete J[a])})}"active"===F&&(g.disconnect(L),H=new l,L=g.connect(b,r,P),H.then(function(){H=null},function(){H=null;F="stopping";g.dispatchEvent(new d("stopping"),A);Object.keys(J).forEach(function(a){J[a].registration.unregister();delete J[a]});g.disconnect(L);
L=null;F="resolved";g.dispatchEvent(new d("stopped",A))}));return(new l).resolve()};this.update=function(a){return X(a).then(function(){g.dispatchEvent(new d("updated",A))})};this.uninstall=function(){if("uninstalled"===F)return(new l).reject(Error("Plugin is uninstalled"));if("active"===F||"starting"===F||"stopping"===F)return this.stop().then(this.uninstall.bind(this),this.uninstall.bind(this));g.removePlugin(this);F="uninstalled";g.dispatchEvent(new d("uninstalled",A));return(new l).resolve()}}
var b=/^http[s]?/i;return{Plugin:e,PluginRegistry:function(a,f){function h(a){var b=a.source;r.some(function(e){if(b===e.target){try{var p;if("undefined"===typeof e.useStructuredClone){var d="string"!==typeof a.data;p=d?a.data:JSON.parse(a.data);e.useStructuredClone=d}else p=e.useStructuredClone?a.data:JSON.parse(a.data);e.handler(p)}catch(f){}return!0}})}f=f||{};var u=f.storage||localStorage;u.getItem||(u=g(u));var w="installed",x,m=[],r=[],t=new n,z={},B={registerService:a.registerService.bind(a),
connect:function(a,b,e,p){function d(a){a=Error(a);a.name="timeout";b({method:"timeout",error:a})}var f={handler:b,url:a},g=setTimeout(d.bind(null,"Load timeout for: "+a),p||15E3),q=document.createElement("iframe");q.name=a+"_"+(new Date).getTime();q.src=a;q.onload=function(){clearTimeout(g);g=setTimeout(d.bind(null,"Plugin handshake timeout for: "+a),5E3)};q.sandbox="allow-scripts allow-same-origin";q.style.width=q.style.height="100%";q.frameBorder=0;(e||x).appendChild(q);f.target=q.contentWindow;
f.connected=function(){clearTimeout(g)};f.close=function(){clearTimeout(g);if(q){var a=q.parentNode;a&&a.removeChild(q);q=null}};r.push(f);return f},disconnect:function(a){for(var b=0;b<r.length;b++)if(a===r[b]){r.splice(b,1);try{a.close()}catch(e){}break}},removePlugin:function(a){for(var b=0;b<m.length;b++)if(a===m[b]){m.splice(b,1);break}u.removeItem("plugin."+a.getLocation())},persist:function(a,b){u.setItem("plugin."+a,JSON.stringify(b))},postMessage:function(a,b){b.target.postMessage(b.useStructuredClone?
a:JSON.stringify(a),b.url)},dispatchEvent:function(a){try{t.dispatchEvent(a)}catch(b){console&&console.log("PluginRegistry.dispatchEvent "+b)}},loadManifest:function(a){var b=new l,e=B.connect(a,function(a){e&&a.method&&("manifest"===a.method||"plugin"===a.method?(a=a.params[0],B.disconnect(e),e=null,b.resolve(a)):"timeout"===a.method&&(B.disconnect(e),e=null,b.reject(a.error)))});return b.promise},getState:function(){return w},handleServiceError:function(a,e){if(e&&401===e.status){var p=a.getHeaders(),
d=a.getName()||a.getLocation(),f=document.createElement("span");f.appendChild(document.createTextNode("Authentication required for: "+d+"."));p.login&&(f.appendChild(document.createTextNode(" ")),d=document.createElement("a"),d.target="_blank",d.textContent="Login",d.href=p.login,b.test(d.href)?(f.appendChild(d),f.appendChild(document.createTextNode(" and re-try the request."))):console.log("Illegal Login URL: "+p.login));return{Severity:"Error",HTML:!0,Message:(new XMLSerializer).serializeToString(f)}}if(e.__isError){var g=
e;e=Error(g.message);Object.keys(g).forEach(function(a){e[a]=g[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=B.getState;this.init=function(){if(!("starting"===w||"active"===w||"stopping"===w)){addEventListener("message",h,!1);for(var a=[],b=0,p=u.length;b<p;b++)a.push(u.key(b));a.forEach(function(a){if(0===
a.indexOf("plugin.")){var b=a.substring(7);a=JSON.parse(u.getItem(a));a.created&&m.push(new e(b,a,B))}});m.sort(function(a,b){return a._getCreated()<b._getCreated()?-1:1});f.parent?x=f.parent:(x=document.createElement("div"),f.visible||(x.style.display="none",x.style.visibility="hidden"),document.body.appendChild(x));f.plugins&&Object.keys(f.plugins).forEach(function(a){a=k(a);var b=this.getPlugin(a);b?b._default=!0:(b=f.plugins[a],"object"!==typeof b&&(b={}),b.autostart=b.autostart||f.defaultAutostart||
"lazy",b=new e(a,b,B),b._default=!0,m.push(b))}.bind(this));w="starting"}};this.start=function(){"starting"!==w&&this.init();if("starting"!==w)return(new l).reject("Cannot start framework. Framework is already "+w+".");var a=[],b=(new Date).getTime();m.forEach(function(e){var p=e._getAutostart();0===e.getLastModified()?a.push(e.update().then(function(){if("started"===p)return e.start({"transient":!0});if("lazy"===p)return e.start({lazy:!0,"transient":!0});e._resolve()})):"started"===p?a.push(e.start({"transient":!0})):
"lazy"===p?(a.push(e.start({lazy:!0,"transient":!0})),b>e.getLastModified()+864E5&&e.update()):e._resolve()});return l.all(a,function(a){console.log("PluginRegistry.stop "+a)}).then(function(){w="active"})};this.stop=function(){if("starting"!==w&&"active"!==w)return(new l).reject("Cannot stop registry. Registry is already "+w+".");w="stopping";var a=[];m.forEach(function(b){a.push(b.stop({"transient":!0}))});return l.all(a,function(a){console.log("PluginRegistry.stop "+a)}).then(function(){if(!f.parent){var a=
x.parentNode;a&&a.removeChild(x)}x=null;removeEventListener("message",h);w="resolved"})};this.update=function(){this.stop().then(this.start.bind(this))};this.uninstall=function(){return(new l).reject("Cannot uninstall registry")};this.installPlugin=function(a,b){a=k(a);var p=this.getPlugin(a);if(p)return(new l).resolve(p);if(z[a])return z[a];if(b)return p=new e(a,b,B),m.push(p),p._persist(),B.dispatchEvent(new d("installed",p)),(new l).resolve(p);var f=B.loadManifest(a).then(function(b){p=new e(a,
b,B);m.push(p);p._persist();delete z[a];B.dispatchEvent(new d("installed",p));return p},function(b){delete z[a];throw b;});return z[a]=f};this.getPlugins=function(){return m.slice()};this.getPlugin=function(a){var b=null;a=k(a);m.some(function(e){if(a===e.getLocation())return b=e,!0});return b};this.addEventListener=t.addEventListener.bind(t);this.removeEventListener=t.removeEventListener.bind(t);this.resolvePlugins=function(){var a=!0;m.forEach(function(b){a=a&&b._resolve()});return a}}}});
define("orion/objects",[],function(){function l(l){for(var m=Object.prototype.hasOwnProperty,k=1,g=arguments.length;k<g;k++){var h=arguments[k],f;for(f in h)m.call(h,f)&&(l[f]=h[f])}return l}return{clone:function(n){if(Array.isArray(n))return Array.prototype.slice.call(n);var m=Object.create(Object.getPrototypeOf(n));l(m,n);return m},mixin:l,toArray:function(l){return Array.isArray(l)?l:[l]}}});
define("orion/serviceTracker",[],function(){function l(k,g){function h(b){var e=b.getProperty("service.id"),p=this.addingService(b);p&&(d[e]=b,a[e]=p)}function f(b){var e=b.getProperty("service.id"),p=a[e];delete d[e];delete a[e];this.removedService(b,p)}this.serviceRegistry=k;var d={},a={},e=n,b,p;this.close=function(){if(e!==m)throw"Already closed";e=n;k.removeEventListener("registered",b);k.removeEventListener("unregistering",p);p=b=null;var a=this;this.getServiceReferences().forEach(function(b){f.call(a,
b)});if("function"===typeof this.onClose)this.onClose()};this.getServiceReferences=function(){var a=Object.keys(d);return!a.length?null:a.map(function(a){return d[a]})};this.open=function(){if(e!==n)throw"Already open";e=m;var a=this;b=function(b){if(-1!==b.serviceReference.getProperty("objectClass").indexOf(g)&&(h.call(a,b.serviceReference),"function"===typeof a.onServiceAdded))return a.onServiceAdded(b.serviceReference,a.serviceRegistry.getService(b.serviceReference))};p=function(b){-1!==b.serviceReference.getProperty("objectClass").indexOf(g)&&
f.call(a,b.serviceReference)};k.addEventListener("registered",b);k.addEventListener("unregistering",p);k.getServiceReferences(g).forEach(function(b){h.call(a,b);if("function"===typeof a.onServiceAdded)return a.onServiceAdded(b,k.getService(b))});if("function"===typeof this.onOpen)this.onOpen()}}var n=0,m=1;l.prototype={addingService:function(k){return this.serviceRegistry.getService(k)},onOpen:null,onClose:null,onServiceAdded:null,removedService:function(k,g){}};return l});
define("orion/config",["orion/Deferred","orion/objects","orion/preferences","orion/serviceTracker"],function(l,n,m,k){var g=m.PreferencesService,h,f,d,a,e=g.DEFAULT_SCOPE,b="pid",p="/cm/configurations";h=function(a,e,p){function d(a,b,p){b.forEach(function(d,f){try{var g=a[f].getProperty("__plugin__"),q=g&&e.getPlugin(g);(!g||q&&"active"===q.getState())&&b[f].updated(p)}catch(h){"undefined"!==typeof console&&console.log(h)}})}k.call(this,a,"orion.cm.managedservice");var f={},g={},h=function(e){var d=
[];e.plugin.getServiceReferences().forEach(function(e){if(-1!==e.getProperty("objectClass").indexOf("orion.cm.managedservice")){var f=e.getProperty(b);e=a.getService(e);f&&e&&(f=(f=p._find(f))&&f.getProperties(),d.push(e.updated(f)))}});return l.all(d)};this.addingService=function(e){var p=e.getProperty(b),d=a.getService(e);if(!p||!d)return null;f[p]||(f[p]=[]);g[p]||(g[p]=[]);f[p].push(e);g[p].push(d);return d};this.onServiceAdded=function(a,e){var f=a.getProperty(b),f=p._find(f);d([a],[e],f&&f.getProperties())};
this.onOpen=function(){e.addEventListener("started",h)};this.onClose=function(){e.removeEventListener("started",h)};this.notifyUpdated=function(a){var b=a.getPid();d(f[b]||[],g[b]||[],a.getProperties())};this.notifyDeleted=function(a){a=a.getPid();d(f[a]||[],g[a]||[],null)};this.removedService=function(a,e){var p=a.getProperty(b),d=f[p],q=g[p];1<d.length?d.splice(d.indexOf(a),1):delete f[p];1<q.length?q.splice(q.indexOf(e),1):delete g[p]}};m=function(){function a(b,e,p){this.store=new f(this,p);this.configAdmin=
new d(this,this.store);this.tracker=new h(b,e,this.store)}a.prototype={getConfigurationAdmin:function(){var a=this;return this.configAdmin._init().then(function(b){a.tracker.open();return b})},notifyDeleted:function(a){this.tracker.notifyDeleted(a)},notifyUpdated:function(a){this.tracker.notifyUpdated(a)}};return a}();d=function(){function a(b,e){this.factory=b;this.store=e}a.prototype={_prefName:p,_init:function(){var a=this;return this.store._init().then(function(){return a})},getConfiguration:function(a){return this.store.get(a)},
getDefaultConfiguration:function(a){return this.store._find(a,e)},listConfigurations:function(){return this.store.list()}};return a}();f=function(){function d(a,b){this.factory=a;this.prefsService=b;this.pref=this.configs=this.defaultConfigs=null;var f=this;this.initPromise=l.all([this.prefsService.getPreferences(p,e),this.prefsService.getPreferences(p)]).then(function(a){var b=a[0];f.pref=a[1];f.defaultConfigs=f._toConfigs(b,!0);f.configs=f._toConfigs(f.pref,!1,b)})}d.prototype={_toConfigs:function(e,
p,d){var f=Object.create(null),g=this;e.keys().forEach(function(q){if(!f[q]){var h=e.get(q),k=d&&d.get(q);"object"===typeof h&&(null!==h&&0<Object.keys(h).length)&&(h[b]=q,f[q]=new a(g.factory,g,h,p,k))}});return f},_init:function(){return this.initPromise},_find:function(a,b){return b===g.DEFAULT_SCOPE?this.defaultConfigs[a]||null:this.configs[a]||null},get:function(b){var p=this._find(b),d=this._find(b,e);p||(p=d&&d.getProperties(!0),p=new a(this.factory,this,b,!1,p),this.configs[b]=p);return p},
list:function(){var a=this,b=[];this.pref.keys().forEach(function(e){(e=a._find(e))&&null!==e.getProperties()&&b.push(e)});return b},remove:function(a){this.pref.remove(a);delete this.configs[a]},save:function(a,b){var p=b.getProperties(!0)||{},d=this._find(a,e);if(d){var f=d.getProperties(!0);Object.keys(f).forEach(function(a){Object.prototype.hasOwnProperty.call(p,a)&&p[a]===f[a]&&delete p[a]})}this.pref.put(a,p)}};return d}();a=function(){function a(e,p){p=n.clone(p);delete p[b];e.properties=p}
function e(p,d,f,g,h){this.factory=p;this.store=d;this.readOnly=g;if(null!==f&&"object"===typeof f)this.pid=f[b],a(this,f);else if("string"===typeof f)this.pid=f,this.properties=null;else throw Error("Invalid pid/properties "+f);if(h){var k=this;Object.keys(h).forEach(function(a){a===b||Object.prototype.hasOwnProperty.call(k.properties,a)||(k.properties[a]=h[a])})}}e.prototype={_checkReadOnly:function(){if(this.readOnly)throw Error("Configuration is read only");},_checkRemoved:function(){if(this.removed)throw Error("Configuration was removed");
},getPid:function(){this._checkRemoved();return this.pid},getProperties:function(a){this._checkRemoved();var e=null;this.properties&&(e=n.clone(this.properties),a||(e[b]=this.pid));return e},remove:function(){this._checkReadOnly();this._checkRemoved();this.factory.notifyDeleted(this);this.store.remove(this.pid);this.removed=!0},update:function(b){this._checkReadOnly();this._checkRemoved();a(this,b);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:m}});
define("orion/bootstrap","require orion/Deferred orion/serviceregistry orion/preferences orion/pluginregistry orion/config".split(" "),function(l,n,m,k,g,h){var f;return{startup:function(){if(f)return f;f=new n;var d=new m.ServiceRegistry,a=new k.PreferencesService(d);return a.getPreferences("/plugins").then(function(e){var b={plugins:{}};e.keys().forEach(function(a){var p=l.toUrl(a);b.plugins[p]=e[a]});var p=new g.PluginRegistry(d,b);return p.start().then(function(){if(0<d.getServiceReferences("orion.core.preference.provider").length)return a.getPreferences("/plugins",
a.USER_SCOPE).then(function(a){var b=[];a.keys().forEach(function(a){a=l.toUrl(a);p.getPlugin(a)||b.push(p.installPlugin(a,{autostart:"lazy"}).then(function(a){return a.update().then(function(){return a.start({lazy:!0})})}))});return n.all(b,function(a){console.log(a)})})}).then(function(){return(new h.ConfigurationAdminFactory(d,p,a)).getConfigurationAdmin().then(d.registerService.bind(d,"orion.cm.configadmin"))}).then(function(){var a=d.getService("orion.core.auth");if(a){var b=a.getUser().then(function(b){if(b)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 b}}).then(function(){var b={serviceRegistry:d,preferences:a,pluginRegistry:p};f.resolve(b);return b})})}}});
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 Editor":"Orion Markdown Editor","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.":"2014-06-28_22-01-29","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","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 (* \x3d any string, ? \x3d 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(l,n){var m={root:n};Object.keys(l).forEach(function(k){"undefined"===typeof m[k]&&(m[k]=l[k])});return m});
define("orion/util",[],function(){var l=navigator.userAgent,n=-1!==l.indexOf("MSIE")||-1!==l.indexOf("Trident")?document.documentMode:void 0,m=parseFloat(l.split("Firefox/")[1]||l.split("Minefield/")[1])||void 0,k=-1!==l.indexOf("Opera")?parseFloat(l.split("Version/")[1]):void 0,g=parseFloat(l.split("Chrome/")[1])||void 0,h=-1!==l.indexOf("Safari")&&!g,f=parseFloat(l.split("WebKit/")[1])||void 0,d=-1!==l.indexOf("Android"),a=-1!==l.indexOf("iPad"),l=-1!==l.indexOf("iPhone"),e=a||l,b=-1!==navigator.platform.indexOf("Mac"),
p=-1!==navigator.platform.indexOf("Win"),q=-1!==navigator.platform.indexOf("Linux"),s="undefined"!==typeof document&&"ontouchstart"in document.createElement("input");return{formatMessage:function(a){var b=arguments;return a.replace(/\$\{([^\}]+)\}/g,function(a,e){return b[(e<<0)+1]})},createElement:function(a,b){return a.createElementNS?a.createElementNS("http://www.w3.org/1999/xhtml",b):a.createElement(b)},isIE:n,isFirefox:m,isOpera:k,isChrome:g,isSafari:h,isWebkit:f,isAndroid:d,isIPad:a,isIPhone:l,
isIOS:e,isMac:b,isWindows:p,isLinux:q,isTouch:s,platformDelimiter:p?"\r\n":"\n"}});
define("orion/webui/littlelib",["orion/util"],function(l){function n(a,e){e||(e=document);return e.querySelectorAll(a)}function m(a){var e=a.tabIndex;0===e&&l.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 k(a){if(0<=m(a))return a;if(a.hasChildNodes())for(var e=0;e<a.childNodes.length;e++){var b=k(a.childNodes[e]);if(b)return b}return null}function g(a){if(0<=
m(a))return a;if(a.hasChildNodes())for(var e=a.childNodes.length-1;0<=e;e--){var b=g(a.childNodes[e]);if(b)return b}return null}function h(a,e){if(3===a.nodeType){var b=f.exec(a.nodeValue);b&&1<b.length&&e(a,b)}if(a.hasChildNodes())for(b=0;b<a.childNodes.length;b++)h(a.childNodes[b],e)}var f=/\$\{([^\}]+)\}/,d=null;return{$:function(a,e){e||(e=document);return e.querySelector(a)},$$:n,$$array:function(a,e){return Array.prototype.slice.call(n(a,e))},node:function(a){var e=a;"string"===typeof a&&(e=
document.getElementById(a));return e},contains:function(a,e){if(!a||!e)return!1;if(a===e)return!0;var b=a.compareDocumentPosition(e);return Boolean(b&16)},bounds:function(a){a=a.getBoundingClientRect();return{left:a.left+document.documentElement.scrollLeft,top:a.top+document.documentElement.scrollTop,width:a.width,height:a.height}},empty:function(a){for(;a.hasChildNodes();)a.removeChild(a.firstChild)},firstTabbable:k,lastTabbable:g,stop:function(a){window.document.all&&(a.keyCode=0);a.preventDefault&&
(a.preventDefault(),a.stopPropagation())},processTextNodes:function(a,e){h(a,function(a,p){a.parentNode.replaceChild(document.createTextNode(e[p[1]]||p[1]),a)})},processDOMNodes:function(a,e){h(a,function(a,p){var d=e[p[1]];if(d){var f=document.createRange(),g=p.index;f.setStart(a,g);f.setEnd(a,g+p[0].length);f.deleteContents();f.insertNode(d)}})},addAutoDismiss:function(a,e){function b(a){d.forEach(function(b){var e=!1,d=b.excludeNodes.some(function(b){return document.body.contains(b)?(e=!0,b.contains(a.target)):
!1});if(e&&!d)try{b.dismiss(a)}catch(f){"undefined"!==typeof console&&console&&console.error(f&&f.message)}});d=d.filter(function(a){return a.excludeNodes.some(function(a){return document.body.contains(a)})})}null===d&&(d=[],document.addEventListener("click",b,!0),l.isIOS&&document.addEventListener("touchend",function(a){function b(){a.target.removeEventListener("click",b)}0===a.touches.length&&a.target.addEventListener("click",b)},!1));d.push({excludeNodes:a,dismiss:e})},setFramesEnabled:function(a){for(var e=
document.getElementsByTagName("iframe"),b=0;b<e.length;b++)e[b].parentNode.style.pointerEvents=a?"":"none"},removeAutoDismiss:function(a){d=d.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("text",["module"],function(l){var n,m,k=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"],g=/^\s*<\?xml(\s)+version=[\'\"](\d)*.(\d)*[\'\"](\s)*\?>/im,h=/<body[^>]*>\s*([\s\S]+)\s*<\/body>/im,f="undefined"!==typeof location&&location.href,d=f&&location.protocol&&location.protocol.replace(/\:/,""),a=f&&location.hostname,e=f&&(location.port||void 0),b=[],p=l.config&&l.config()||{};n={version:"2.0.5",strip:function(a){if(a){a=a.replace(g,"");var b=a.match(h);b&&(a=b[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:p.createXhr||function(){var a,b,e;if("undefined"!==typeof XMLHttpRequest)return new XMLHttpRequest;if("undefined"!==typeof ActiveXObject)for(b=0;3>b;b+=1){e=k[b];try{a=new ActiveXObject(e)}catch(p){}if(a){k=[e];break}}return a},parseName:function(a){var b,
e,p=!1,d=a.indexOf(".");b=0===a.indexOf("./")||0===a.indexOf("../");-1!==d&&(!b||1<d)?(b=a.substring(0,d),e=a.substring(d+1,a.length)):b=a;a=e||b;d=a.indexOf("!");-1!==d&&(p="strip"===a.substring(d+1),a=a.substring(0,d),e?e=a:b=a);return{moduleName:b,ext:e,strip:p}},xdRegExp:/^((\w+)\:)?\/\/([^\/\\]+)/,useXhr:function(a,b,e,p){var d,f;d=n.xdRegExp.exec(a);if(!d)return!0;a=d[2];d=d[3];d=d.split(":");f=d[1];d=d[0];return(!a||a===b)&&(!d||d.toLowerCase()===e.toLowerCase())&&(!f&&!d||f===p)},finishLoad:function(a,
e,d,f){d=e?n.strip(d):d;p.isBuild&&(b[a]=d);f(d)},load:function(b,g,h,k){if(k.isBuild&&!k.inlineText)h();else{p.isBuild=k.isBuild;var l=n.parseName(b);k=l.moduleName+(l.ext?"."+l.ext:"");var m=g.toUrl(k),r=p.useXhr||n.useXhr;!f||r(m,d,a,e)?n.get(m,function(a){n.finishLoad(b,l.strip,a,h)},function(a){h.error&&h.error(a)}):g([k],function(a){n.finishLoad(l.moduleName+"."+l.ext,l.strip,a,h)})}},write:function(a,e,p,d){b.hasOwnProperty(e)&&(d=n.jsEscape(b[e]),p.asModule(a+"!"+e,"define(function () { return '"+
d+"';});\n"))},writeFile:function(a,b,e,p,d){b=n.parseName(b);var f=b.ext?"."+b.ext:"",g=b.moduleName+f,h=e.toUrl(b.moduleName+f)+".js";n.load(g,e,function(b){b=function(a){return p(h,a)};b.asModule=function(a,b){return p.asModule(a,h,b)};n.write(a,g,b,d)},d)}};if("node"===p.env||!p.env&&"undefined"!==typeof process&&process.versions&&process.versions.node)m=require.nodeRequire("fs"),n.get=function(a,b){var e=m.readFileSync(a,"utf8");0===e.indexOf("\ufeff")&&(e=e.substring(1));b(e)};else if("xhr"===
p.env||!p.env&&n.createXhr())n.get=function(a,b,e,d){var f=n.createXhr(),g;f.open("GET",a,!0);if(d)for(g in d)d.hasOwnProperty(g)&&f.setRequestHeader(g.toLowerCase(),d[g]);if(p.onXhr)p.onXhr(f,a);f.onreadystatechange=function(d){4===f.readyState&&(d=f.status,399<d&&600>d?(d=Error(a+" HTTP status: "+d),d.xhr=f,e(d)):b(f.responseText))};f.send(null)};else if("rhino"===p.env||!p.env&&"undefined"!==typeof Packages&&"undefined"!==typeof java)n.get=function(a,b){var e,d,p=new java.io.File(a),f=java.lang.System.getProperty("line.separator"),
p=new java.io.BufferedReader(new java.io.InputStreamReader(new java.io.FileInputStream(p),"utf-8")),g="";try{e=new java.lang.StringBuffer;(d=p.readLine())&&(d.length()&&65279===d.charAt(0))&&(d=d.substring(1));for(null!==d&&e.append(d);null!==(d=p.readLine());)e.append(f),e.append(d);g=String(e.toString())}finally{p.close()}b(g)};return n});define("text!orion/banner/slideout.html",[],function(){return'\x3cdiv id\x3d"slideContainer" class\x3d"slideParameters slideContainer"\x3e\n\t\x3cspan id\x3d"pageCommandParameters" class\x3d"layoutLeft parameters"\x3e\x3c/span\x3e\n\t\x3cspan id\x3d"pageCommandDismiss" class\x3d"layoutRight parametersDismiss"\x3e\x3c/span\x3e\n\x3c/div\x3e'});
define("orion/commonHTMLFragments",["require","orion/webui/littlelib","text!orion/banner/slideout.html"],function(l,n,m){return{slideoutHTMLFragment:function(k){var g=document.createElement("div");g.innerHTML=m;var h=n.$("#slideContainer",g);h.id=k+h.id;h=n.$("#pageCommandParameters",g);h.id=k+h.id;h=n.$("#pageCommandDismiss",g);h.id=k+h.id;return g.innerHTML}}});
define("orion/keyBinding",["orion/util"],function(l){function n(k,g,h,f,d,a){this.type=a||"keydown";this.keyCode="string"===typeof k&&"keydown"===this.type?k.toUpperCase().charCodeAt(0):k;this.mod1=void 0!==g&&null!==g?g:!1;this.mod2=void 0!==h&&null!==h?h:!1;this.mod3=void 0!==f&&null!==f?f:!1;this.mod4=void 0!==d&&null!==d?d:!1}function m(k){this.keys=k}n.prototype={getKeys:function(){return[this]},match:function(k,g){if(void 0!==g){if(0!==g)return!1}else if(k instanceof Array){if(1<k.length)return!1;
k=k[0]}return k.type!==this.type?!1:this.keyCode===k.keyCode||this.keyCode===String.fromCharCode(l.isOpera?k.which:void 0!==k.charCode?k.charCode:k.keyCode)?this.mod1!==(l.isMac?k.metaKey:k.ctrlKey)||"keydown"===this.type&&this.mod2!==k.shiftKey||this.mod3!==k.altKey||l.isMac&&this.mod4!==k.ctrlKey?!1:!0:!1},equals:function(k){return!k||this.keyCode!==k.keyCode||this.mod1!==k.mod1||this.mod2!==k.mod2||this.mod3!==k.mod3||this.mod4!==k.mod4||this.type!==k.type?!1:!0}};m.prototype={getKeys:function(){return this.keys.slice(0)},
match:function(k,g){var h=this.keys;if(void 0!==g)return g>h.length?!1:h[g].match(k)?g===h.length-1?!0:g+1:!1;k instanceof Array||(k=[k]);if(k.length>h.length)return!1;var f;for(f=0;f<k.length;f++)if(!h[f].match(k[f]))return!1;return f===h.length?!0:f},equals:function(k){if(!k.keys||k.keys.length!==this.keys.length)return!1;for(var g=0;g<k.keys.length;g++)if(!k.keys[g].equals(this.keys[g]))return!1;return!0}};return{KeyBinding:n,KeyStroke:n,KeySequence:m}});
define("orion/webui/dropdown",["require","orion/webui/littlelib","orion/EventTarget"],function(l,n,m){function k(f){m.attach(this);this._init(f)}function g(f,d){var a=document.createElement(void 0===d?"span":d);a.tabIndex=0;a.className="dropdownMenuItem";a.role="menuitem";var e=document.createElement("span");e.appendChild(document.createTextNode(f));e.classList.add("dropdownCommandName");a.appendChild(e);e=document.createElement("li");e.appendChild(a);return e}function h(){var f=document.createElement("li");
f.classList.add("dropdownSeparator");return f}k.prototype={_init:function(f){this._dropdownNode=n.node(f.dropdown);if(!this._dropdownNode)throw"no dom node for dropdown found";this._populate=f.populate;this._selectionClass=f.selectionClass;this._parentDropdown=f.parentDropdown;this._positioningNode=f.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._dropdownNode.tabIndex=
0;this._triggerNode=f.triggerNode?f.triggerNode:n.$(".dropdownTrigger",this._dropdownNode.parentNode);if(!this._triggerNode)throw"no dom node for dropdown trigger found";if(!f.skipTriggerEventListeners){var a=this;this._triggerNode.addEventListener("click",function(e){a.toggle(e)&&n.stop(e)},!1);"span"===this._triggerNode.tagName.toLowerCase()&&this._triggerNode.addEventListener("keydown",function(e){if(e.keyCode===n.KEY.ENTER||e.keyCode===n.KEY.SPACE)a.toggle(),n.stop(e)},!1)}this._dropdownNode.addEventListener("keydown",
this._dropdownKeyDown.bind(this),!1)},addTriggerNode:function(f){var d=this;f.addEventListener("click",function(a){d.toggle(a)&&n.stop(a)},!1)},toggle:function(f){return this.isVisible()?this.close():this.open(f)},isVisible:function(){return this._isVisible},open:function(f){var d=!1;this.isVisible()||(this.dispatchEvent({type:"triggered",dropdown:this,event:f}),n.setFramesEnabled(!1),this._populate&&(this.empty(),this._populate(this._dropdownNode)),0<this.getItems().length&&(this._hookedAutoDismiss||
(this._boundAutoDismiss?n.removeAutoDismiss(this._boundAutoDismiss):this._boundAutoDismiss=this._autoDismiss.bind(this),d=n.$$array(".dropdownSubMenu",this._dropdownNode),n.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(f),this._focusDropdownNode(),
d=!0,this._parentDropdown&&this._parentDropdown.submenuOpen(this)));return d},_focusDropdownNode:function(){this._dropdownNode.focus()},_autoDismiss:function(f){if(this.close(!1)&&this._dropdownNode.contains(f.target))for(f=this._parentDropdown;f;)f.close(!1),f=f._parentDropdown},_positionDropdown:function(f){this._dropdownNode.style.left="";this._dropdownNode.style.top="";if(this._positioningNode)this._dropdownNode.style.left=this._positioningNode.offsetLeft+"px";else{f=n.bounds(this._dropdownNode);
var d=n.bounds(document.body);if(f.left+f.width>d.left+d.width)if(this._triggerNode.classList.contains("dropdownMenuItem"))this._dropdownNode.style.left=-f.width+"px";else{var a=n.bounds(this._boundingNode(this._triggerNode)),e=n.bounds(this._triggerNode);this._dropdownNode.style.left=e.left-a.left-f.width+e.width+"px"}f=f.top+f.height-(d.top+d.height);0<f&&(this._dropdownNode.style.top=Math.floor(this._dropdownNode.style.top-f)+"px")}},_boundingNode:function(f){var d=window.getComputedStyle(f,null);
return null===d||"absolute"===d.getPropertyValue("position")||!f.parentNode||f===document.body?f:this._boundingNode(f.parentNode)},close:function(f){var d=!1;this.isVisible()&&(this._triggerNode.classList.remove("dropdownTriggerOpen"),this._selectionClass&&this._triggerNode.classList.remove(this._selectionClass),this._dropdownNode.classList.remove("dropdownMenuOpen"),n.setFramesEnabled(!0),f&&this._triggerNode.focus(),this._isVisible=!1,this._selectedItem&&(this._selectedItem.classList.remove("dropdownMenuItemSelected"),
this._selectedItem=null),d=!0);return d},getItems:function(){var f=[],d=this;n.$$array("li:not(.dropdownSeparator) \x3e .dropdownMenuItem",this._dropdownNode,!0).forEach(function(a){a.parentNode.parentNode===d._dropdownNode&&f.push(a)});f.forEach(function(a){a._hasDropdownMouseover||(a.addEventListener("mouseover",function(e){a.dropdown?a.dropdown.open(e):(d._closeSelectedSubmenu(),n.stop(e));d._selectItem(a)}),a._hasDropdownMouseover=!0)});return f},empty:function(){var f=this;n.$$array("li",this._dropdownNode).forEach(function(d){d.parentNode===
f._dropdownNode&&d.parentNode.removeChild(d)});this._hookedAutoDismiss=!1},_dropdownKeyDown:function(f){if(f.keyCode===n.KEY.UP||f.keyCode===n.KEY.DOWN||f.keyCode===n.KEY.RIGHT||f.keyCode===n.KEY.ENTER||f.keyCode===n.KEY.LEFT){var d=this.getItems();if(d.length&&0<d.length){if(this._selectedItem){var a=d.indexOf(this._selectedItem);0>a&&(a=d.indexOf(this._selectedItem.parentNode));0<=a&&(f.keyCode===n.KEY.UP&&0<a?(a--,this._selectItem(d[a])):f.keyCode===n.KEY.DOWN&&a<d.length-1?(a++,this._selectItem(d[a])):
f.keyCode===n.KEY.ENTER||f.keyCode===n.KEY.RIGHT?this._selectedItem.classList.contains("dropdownTrigger")&&this._selectedItem.dropdown?(this._selectedItem.dropdown.open(),this._selectedItem.dropdown._selectItem()):f.keyCode===n.KEY.ENTER&&this._selectedItem.click():f.keyCode===n.KEY.LEFT&&this._selectedItem.parentNode.parentNode.classList.contains("dropdownMenuOpen")&&(this.close(!0),this._parentDropdown&&this._parentDropdown._dropdownNode.focus()))}else this._selectItem(d[0]);n.stop(f)}}else f.keyCode===
n.KEY.ESCAPE&&(this.close(!0),n.stop(f))},_selectItem:function(f){if(f=f||this.getItems()[0])this._selectedItem&&this._selectedItem.classList.remove("dropdownMenuItemSelected"),this._selectedItem=f,this._selectedItem.classList.add("dropdownMenuItemSelected");document.activeElement!==this._dropdownNode&&this._dropdownNode.focus()},submenuOpen:function(f){f!==this._selectedSubmenu&&(this._closeSelectedSubmenu(),this._selectedSubmenu=f)},_closeSelectedSubmenu:function(){for(var f=this._selectedSubmenu;f;)f.close(),
f=f._selectedSubmenu},destroy:function(){this.empty();this._boundAutoDismiss&&n.removeAutoDismiss(this._boundAutoDismiss)},appendMenuItem:function(f,d){var a=g(f,d);this._dropdownNode.appendChild(a);return a},appendSeparator:function(){var f=h();this._dropdownNode.appendChild(f);return f}};k.prototype.constructor=k;return{Dropdown:k,appendKeyBindingString:function(f,d){var a=document.createElement("span");a.classList.add("dropdownKeyBinding");a.appendChild(document.createTextNode(d));f.appendChild(a)},
createMenuItem:g,createSeparator:h}});define("text!orion/webui/dropdowntriggerbutton.html",[],function(){return'\x3cbutton class\x3d"dropdownTrigger"\x3e${ButtonText}\x3c!--span class\x3d"dropdownArrowDown core-sprite-openarrow"\x3e\x3c/span--\x3e\x3c/button\x3e\x3cul class\x3d"dropdownMenu"\x3e\x3c/ul\x3e'});define("text!orion/webui/dropdowntriggerbuttonwitharrow.html",[],function(){return'\x3cbutton class\x3d"dropdownTrigger dropdownDefaultButton"\x3e${ButtonText}\x3cspan class\x3d"dropdownArrowDown core-sprite-openarrow"\x3e\x3c/span\x3e\x3c/button\x3e\x3cul class\x3d"dropdownMenu"\x3e\x3c/ul\x3e'});
define("text!orion/webui/submenutriggerbutton.html",[],function(){return'\x3cli class\x3d"dropdownSubMenu"\x3e\x3cspan class\x3d"dropdownTrigger dropdownMenuItem" role\x3d"menuitem" tabindex\x3d"0"\x3e\x3cspan class\x3d"dropdownCommandName"\x3e${ButtonText}\x3c/span\x3e\x3cspan class\x3d"dropdownArrowRight core-sprite-closedarrow"\x3e\x3c/span\x3e\x3c/span\x3e\x3cul class\x3d"dropdownMenu"\x3e\x3c/ul\x3e\x3c/li\x3e'});define("text!orion/webui/checkedmenuitem.html",[],function(){return'\x3cli\x3e\x3clabel class\x3d"dropdownMenuItem"\x3e\x3cinput class\x3d"checkedMenuItem" role\x3d"menuitem" type\x3d"checkbox" /\x3e${ItemText}\x3c/label\x3e\x3c/li\x3e'});
define("orion/webui/tooltip",["require","orion/webui/littlelib"],function(l,n){function m(k){this._init(k)}m.prototype={_init:function(k){this._node=n.node(k.node);if(!this._node)throw"no dom node for tooltip found";this._position=k.position||["right","above","below","left"];this._text=k.text;this._hideDelay=void 0===k.hideDelay?200:k.hideDelay;this._tailSize=k.tailSize||10;this._trigger=k.trigger||"mouseover";this._afterShowing=k.afterShowing;this._afterHiding=k.afterHiding;var g=this;if("click"===
this._trigger)this._showDelay=0,this._node.addEventListener("click",this._clickHandler=function(f){f.target===g._node&&(g.show(),n.stop(f))},!1);else if("mouseover"===this._trigger){this._showDelay=void 0===k.showDelay?500:k.showDelay;k=["mouseout","click"];this._node.addEventListener("mouseover",this._mouseoverHandler=function(f){n.contains(g._node,f.target)&&(g.show(),n.stop(f))},!1);this._leaveHandler=function(f){n.contains(g._node,f.target)&&g.hide()};for(var h=0;h<k.length;h++)this._node.addEventListener(k[h],
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);var k=document.createTextNode(this._text);this._tipTextContent.appendChild(k)}this._tip.appendChild(this._tipInner);
document.body.appendChild(this._tip);var g=this;n.addAutoDismiss([this._tip,this._node],function(){g.hide()});"mouseover"===this._trigger&&(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(h){g._timeout&&(window.clearTimeout(g._timeout),g._timeout=null);g._tip.addEventListener("mouseout",function(f){n.contains(g._tip,f.target)&&(g.hide(),n.stop(f))},
!1)},!1))}return this._tip},_positionTip:function(k,g){this._makeTipNode();"left"===k?this._tipInner.classList.add("left"):this._tipInner.classList.remove("left");var h=this._node,f;for(f=n.bounds(h);h&&!f.width&&!f.height;h=h.parentNode)f=n.bounds(h);var h=n.bounds(this._tipInner),d;switch(k){case "above":d=f.top-h.height-this._tailSize-1;f=f.left-this._tailSize;break;case "below":d=f.top+f.height+this._tailSize+1;f=f.left-this._tailSize;break;case "left":d=f.top-this._tailSize/2;f=f.left-h.width-
this._tailSize-1;break;default:d=f.top-this._tailSize/2,f=f.left+f.width+this._tailSize+1}var a=n.bounds(document.documentElement);if(d+h.height>a.height)if(g)d=a.height-h.height-1;else return!1;if(f+h.width>a.width)if(g)f=a.width-h.width-1;else return!1;if(0>f)if(g)f=4;else return!1;if(0>d)if(g)d=4;else return!1;this._tail&&this._tail.previousPosition!==k&&(this._tip.removeChild(this._tail),this._tail=null);this._tail||(this._tail=document.createElement("span"),this._tail.classList.add("tooltipTailFrom"+
k),"above"===k||"left"===k?this._tip.appendChild(this._tail):this._tip.insertBefore(this._tail,this._tipInner),this._tail.previousPosition=k);this._tip.style.top=d+"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"))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 k=!1,g=0;!k&&g<this._position.length;)k=this._positionTip(this._position[g]),g++;k||this._positionTip(this._position[0],!0);this._tip.classList.add("tooltipShowing");this._afterShowing&&this._afterShowing()},hide:function(k){this._timeout&&(window.clearTimeout(this._timeout),this._timeout=null);if(this._tip&&this._tip.classList.contains("tooltipShowing")){void 0===k&&(k=this._hideDelay);var g=this;this._timeout=window.setTimeout(function(){g._tip.classList.remove("tooltipShowing");
g._tip.removeAttribute("style");g._afterHiding&&g._afterHiding()},k)}},destroy:function(){this._timeout&&(window.clearTimeout(this._timeout),this._timeout=null);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 k=["mouseout","click"],g=0;g<k.length;g++)this._node.removeEventListener(k[g],
this._leaveHandler,!1)}}};m.prototype.constructor=m;return{Tooltip:m}});
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(l,n,m,k,g,h,f,d){function a(a){var b=a.invocation;if(b){var e=a.command;if(e.hrefCallback)return a=e.hrefCallback.call(b.handler||window,b),a.then?a.then(function(a){window.open(a)}):window.open(a),!0;if(b.commandRegistry)return b.commandRegistry._invoke(b),
!0;if(e.onClick||e.callback)return window.setTimeout(function(){(e.onClick||e.callback).call(b.handler||window,b)},0),!0}return!1}function e(b,e){for(var d in e)if(e[d]&&(e[d].keyBinding&&e[d].command)&&e[d].keyBinding.match(b)){var p=e[d],f=p.keyBinding;if((!f.domScope||n.contains(n.node(f.domScope),b.target))&&a(p)){n.stop(b);break}}}function b(){var a={};if(y){var b,e,d;e=Object.keys(r);for(b=0;b<e.length;b++)d=e[b],a[d]=r[d];var p=y();e=Object.keys(p);for(b=0;b<e.length;b++)d=e[b],a[d]=p[d]}else a=
r;return a}function p(a){e(a,b())}function q(a,b){a=a||window.event;if(function(a){if(l.isMac){if(a.metaKey&&!a.altKey)return!a.shiftKey&&!a.ctrlKey&&(65===a.keyCode||67===a.keyCode||86===a.keyCode||88===a.keyCode||90===a.keyCode)?!0:!1;if(a.ctrlKey)return!1}else{if(a.ctrlKey&&!a.altKey)return!a.shiftKey&&(65===a.keyCode||67===a.keyCode||86===a.keyCode||88===a.keyCode||90===a.keyCode)?!0:!1;if(a.altKey&&!a.ctrlKey)return!1}if(a["char"])return 0<a["char"].length;if(a.charCode||a.keyCode)switch(a=a.charCode||
a.keyCode,a){case 8:case 9:case 13:case 46:return!0;default:return 32<=a&&112>a||123<a}return!1}(a)){if("true"===a.target.contentEditable)return;var e=a.target.nodeName.toLowerCase();if("input"===e)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("textarea"===e)return}b?b(a):p(a)}function s(){this._init()}
function u(a,b,e){b.classList.add("commandImage");var d;a.imageClass?a.addImageClassToElement?b.classList.add(a.imageClass):(d=document.createElement("span"),b.appendChild(d),d.classList.add(a.spriteClass),d.classList.add(a.imageClass)):(d=new Image,d.alt=a.name,d.name=e,d.id=e,d.src=a.image,b.appendChild(d));return d}function w(a,b,e,d,p){this.commandRegistry=p;this.handler=a;this.items=b;this.userData=e;this.command=d;d.parameters&&(this.parameters=d.parameters.makeCopy());this.id=d.id}function x(a){this._init(a)}
var y=null,r={};s.prototype={setProxy:function(a){this.proxy=a},setKeyBindings:function(a){this.bindings=a},_init:function(){var a=this;document.addEventListener("keydown",function(b){return q(b,function(b){var e=a.proxy,d=a.bindings;if(d&&e)for(var p=0;p<d.length;p++)d[p].match(b)&&(e.processKey({type:b.type,keyCode:b.keyCode,altKey:b.altKey,ctrlKey:b.ctrlKey,metaKey:b.metaKey,shiftKey:b.shiftKey}),n.stop(b))})})}};window.document.addEventListener("keydown",q,!1);w.prototype={collectsParameters:function(){return this.commandRegistry&&
this.commandRegistry.collectsParameters()},makeCopy:function(a){var b=new w(this.handler,this.items,this.userData,this.command,this.commandRegistry);b.domNode=this.domNode;b.domParent=this.domParent;a?b.parameters=a.makeCopy():this.parameters&&(b.parameters=this.parameters.makeCopy());return b}};w.prototype.constructor=w;x.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.extraClass=a.extraClass;this.selectionClass=a.selectionClass;this.spriteClass=a.spriteClass||"commandSprite";this.visibleWhen=a.visibleWhen;this.parameters=a.parameters;this.isEditor=a.isEditor},populateChoicesMenu:function(a,
b,e,d,p){e=this.getChoices(b,e,d);var f=e.some(function(a){return a.checked});e.forEach(function(e){if(e.name){var d=document.createElement("li");a.appendChild(d);var v=document.createElement("span");v.tabIndex=0;v.role="menuitem";v.classList.add("dropdownMenuItem");if(f){var g=document.createElement("span");g.classList.add("check");g.appendChild(document.createTextNode(e.checked?"\u25cf":""));v.appendChild(g)}g=document.createTextNode(e.name);v.appendChild(g);d.appendChild(v);v.choice=e;v.addEventListener("click",
function(a){a.target.choice&&a.target.choice.callback.call(a.target.choice,b)},!1);v.addEventListener("keydown",function(a){(a.keyCode===n.KEY.ENTER||a.keyCode===n.KEY.SPACE)&&a.target.choice&&a.target.choice.callback.call(a.target.choice,b)},!1)}else p._generateMenuSeparator(a)})},getChoices:function(a,b,e){return this.choiceCallback?this.choiceCallback.call(b,a,e):null},makeChoiceCallback:function(a,b){return function(e){a.callback&&a.callback.call(a,b,e)}},hasImage:function(){return this.imageClass||
"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAAA1BMVEUAAACnej3aAAAAAXRSTlMAQObYZgAAAAtJREFUCNdjIBEAAAAwAAFletZ8AAAAAElFTkSuQmCC"!==this.image}};x.prototype.constructor=x;return{Command:x,CommandInvocation:w,createDropdownMenu:function(a,b,e,d,p,f,q,h,s){a=n.node(a);if(!a)throw"no parent node was specified";var w=document.createRange();w.selectNode(a);w=s?w.createContextualFragment(g):w.createContextualFragment(k);n.processTextNodes(w,{ButtonText:b});a.appendChild(w);a=a.lastChild;
var l;s?(s=a.previousSibling,l=s.lastChild):s=a.previousSibling;d?s.classList.add(d):(s.classList.add("orionButton"),s.classList.add("commandButton"));p&&(f||(s.textContent="",s.setAttribute("aria-label",b)),u({spriteClass:"commandSprite",imageClass:p},s,b),s.classList.add("orionButton"));s.dropdown=new m.Dropdown({dropdown:a,populate:e,selectionClass:q,skipTriggerEventListeners:!!l,positioningNode:h});a.dropdown=s.dropdown;return{menuButton:s,menu:a,dropdown:s.dropdown,dropdownArrow:l}},createCheckedMenuItem:function(a,
b,e,d){a=n.node(a);if(!a)throw"no parent node was specified";var p=document.createRange();p.selectNode(a);p=p.createContextualFragment(f);n.processTextNodes(p,{ItemText:b});a.appendChild(p);a=n.$(".checkedMenuItem",a.lastChild);a.checked=e;a.addEventListener("change",d,!1);return a},createCommandItem:function(a,b,e,p,f,g,q){var h;g=g||!b.name&&b.hasImage();if(b.hrefCallback)h=document.createElement("a"),h.id=p,g&&b.hasImage()?u(b,h,p):(h.className="commandLink",h.appendChild(document.createTextNode(b.name))),
q=b.hrefCallback.call(e.handler,e),q.then?q.then(function(a){h.href=a}):h.href=q?q:"#";else{h=document.createElement("button");h.className="orionButton";b.extraClass&&h.classList.add(b.extraClass);g?b.hasImage()?(u(b,h,p),b.name&&h.setAttribute("aria-label",b.name)):(h.classList.add("commandButton"),h.classList.add("commandMissingImageButton"),h.appendChild(document.createTextNode(b.name))):(h.classList.add("commandButton"),p=document.createTextNode(b.name),h.appendChild(p));var k=q||b.callback;k&&
(b.onClick=k,h.addEventListener("click",function(a){k.call(e.handler,e)},!1))}"ul"===a.nodeName.toLowerCase()?(q=document.createElement("li"),a.appendChild(q),a=q):h.classList.add("commandMargins");a.appendChild(h);b.tooltip&&(h.commandTooltip=new d.Tooltip({node:h,text:b.tooltip,position:["above","below","right","left"]}));f&&(r[b.id]={keyBinding:f,command:b,invocation:e});return h},createCommandMenuItem:function(a,b,e,p,f,g){var q,h,k=a.dropdown;if(b.hrefCallback)h=m.createMenuItem(b.name,"a"),
q=h.firstElementChild,f=b.hrefCallback.call(e.handler,e),f.then?f.then(function(a){q.href=a}):q.href=f?f:"#",q.addEventListener("keydown",function(a){(a.keyCode===n.KEY.ENTER||a.keyCode===n.KEY.SPACE)&&q.click()},!1);else{h=m.createMenuItem(b.name);q=h.firstElementChild;var s=f||b.callback;s&&(b.onClick=s,q.addEventListener("click",function(a){k.close(!0);s.call(e.handler,e)},!1),q.addEventListener("keydown",function(a){if(a.keyCode===n.KEY.ENTER||a.keyCode===n.KEY.SPACE)a.preventDefault(),q.click()},
!1))}b.tooltip&&(q.commandTooltip=new d.Tooltip({node:q,text:b.tooltip,position:["above","below","right","left"]}));g&&m.appendKeyBindingString(q,g);a.appendChild(h);p&&(r[b.id]={keyBinding:p,command:b,invocation:e});return q},executeBinding:a,setKeyBindingProvider:function(a){y=a},localKeyBindings:r,CommandsProxy:s,getKeyBindings:b,processKey:p,NO_IMAGE:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAAA1BMVEUAAACnej3aAAAAAXRSTlMAQObYZgAAAAtJREFUCNdjIBEAAAAwAAFletZ8AAAAAElFTkSuQmCC",
_testMethodProcessKey:e}});define("orion/explorers/navigationUtils",[],function(){function l(l,k,g,h){!n&&l&&(l.push({domNode:k}),k.tabIndex=-1,k.style.outline="none")}var n=-1!==navigator.userAgent.indexOf("iPad");return{addNavGrid:function(m,k,g){m&&(m=m.getGridNavHolder(k,!0))&&l(m,g)},generateNavGrid:l,removeNavGrid:function(l,k){if(l)for(var g=0;g<l.length;g++)if(l[g].domNode===k){l.splice(g,1);break}}}});
define("orion/PageUtil",[],function(){var l=/^http[s]?/i;return{hash:function(){var l=window.location.href.split("#")[1];return l?"#"+l:""},matchResourceParameters:function(l){l=l||window.location.toString();var m={resource:""},k=l.indexOf("#");if(-1!==k&&(l=l.substring(k+1),0!==l.length)){l=l.split(",");m.resource=decodeURIComponent(l[0]);for(k=1;k<l.length;k++){var g=/([^=]*)(=?)(.*)/.exec(l[k]),h=decodeURIComponent(g[1]||""),g=decodeURIComponent(g[3]||"");""!==h&&"resource"!==h&&(m[h]=g)}}return m},
validateURLScheme:function(n,m){var k=n;if(-1===n.indexOf("://")){var g=document.createElement("a");g.href=n;k=g.href}g=!1;if(g=m?m.some(function(g){return RegExp("^"+g+":","i").test(k)}):l.test(k))return n;console.log("Illegal URL Scheme: '"+n+"'");return""}}});
define("orion/uiUtils",["orion/webui/littlelib"],function(l){function n(k){var g="",h=-1!==navigator.platform.indexOf("Mac");h?(k.mod4&&(g+="\u2303"),k.mod3&&(g+="\u2325"),k.mod2&&(g+="\u21e7"),k.mod1&&(g+="\u2318")):(k.mod1&&(g+="Ctrl+"),k.mod2&&(g+="Shift+"),k.mod3&&(g+="Alt+"));if(k.alphaKey)return g+k.alphaKey;if("keypress"===k.type)return g+k.keyCode;for(var f in l.KEY)if(typeof("number"===l.KEY[f])&&l.KEY[f]===k.keyCode){if(h)switch(l.KEY[f]){case l.KEY.BKSPC:f="\u232b";break;case l.KEY.TAB:f=
"\u21e5";break;case l.KEY.ENTER:f="\u23ce";break;case l.KEY.ESCAPE:f="\u238b";break;case l.KEY.SPACE:f="\u2423";break;case l.KEY.PAGEUP:f="\u21de";break;case l.KEY.PAGEDOWN:f="\u21df";break;case l.KEY.END:f="\u21f2";break;case l.KEY.HOME:f="\u21f1";break;case l.KEY.DEL:f="\u2326"}switch(l.KEY[f]){case l.KEY.DOWN:f="\u2193";break;case l.KEY.UP:f="\u2191";break;case l.KEY.RIGHT:f="\u2192";break;case l.KEY.LEFT:f="\u2190"}return g+f}var d;switch(k.keyCode){case 59:d=k.mod2?":":";";break;case 61:d=k.mod2?
"+":"\x3d";break;case 188:d=k.mod2?"\x3c":",";break;case 190:d=k.mod2?"\x3e":".";break;case 191:d=k.mod2?"?":"/";break;case 192:d=k.mod2?"~":"`";break;case 219:d=k.mod2?"{":"[";break;case 220:d=k.mod2?"|":"\\";break;case 221:d=k.mod2?"}":"]";break;case 222:d=k.mod2?'"':"'"}return d?g+d:112<=k.keyCode&&123>=k.keyCode?g+"F"+(k.keyCode-111):g+String.fromCharCode(k.keyCode)}function m(k){var g=-1!==window.navigator.platform.indexOf("Mac");return g&&k.metaKey||!g&&k.ctrlKey}return{getUserKeyString:function(k){var g=
"";k=k.getKeys();for(var h=0;h<k.length;h++)0!==h&&(g+=" "),g+=n(k[h]);return g},getUserText:function(k){var g=k.id,h=k.refNode,f=k.hideRefNode,d=k.initialText,a=k.onComplete,e=k.onEditDestroy,b=k.selectTo,p=k.isInitialValid;k=k.insertAsChild;var q=!1,s=function(b){return function(k){if(!q){var s=l.node(g),u=s.value;s&&(b&&k.keyCode===l.KEY.ESCAPE?(f&&(h.style.display="inline"),q=!0,s.parentNode.removeChild(s),e&&e()):b&&k.keyCode!==l.KEY.ENTER||(0===u.length||!p&&u===d?f&&(h.style.display="inline"):
(a(u),f&&h.parentNode&&(h.style.display="inline")),q=!0,s.parentNode&&s.parentNode.removeChild(s),e&&e()))}}},u=document.createElement("input");u.id=g;u.value=d||"";k?h.appendChild(u):h.parentNode.insertBefore(u,h.nextSibling);u.classList.add("userEditBoxPrompt");f&&(h.style.display="none");u.addEventListener("keydown",s(!0),!1);u.addEventListener("blur",s(!1),!1);window.setTimeout(function(){u.focus();if(d){var a=l.node(g),e=b?d.indexOf(b):-1;0<e?a.createTextRange?(a=a.createTextRange(),a.collapse(!0),
a.moveStart("character",0),a.moveEnd("character",e),a.select()):a.setSelectionRange?a.setSelectionRange(0,e):void 0!==a.selectionStart&&(a.selectionStart=0,a.selectionEnd=e):a.select()}},0)},openInNewWindow:m,followLink:function(k,g){g&&m(g)?window.open(k):window.location=k},createButton:function(k,g){var h=document.createElement("button");h.className="orionButton commandButton commandMargins";h.addEventListener("click",function(f){g();l.stop(f)},!1);k&&h.appendChild(document.createTextNode(k));return h},
createDropdownButton:function(k,g,h){},isFormElement:function(k){switch(k.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(l,n,m,k,g,h,f,d,a,e){function b(a){this._commandList={};this._contributionsByScopeId={};this._activeBindings={};this._urlBindings={};this._pendingBindings={};this._init(a);this._parameterCollector=
null}function p(a,b){this.token=a;this.parameterName=b}function q(a,b,e){this.event=a;this.handler=b;this.capture=e||!1}function s(a,b,e,d,p,f){this.name=a;this.type=b;this.label=e;this.value=d;this.lines=p||1;this.eventListeners=Array.isArray(f)?f:f?[f]:[]}function u(a,b,e){this._storeParameters(a);this._hasOptionalParameters=b&&b.hasOptionalParameters;this._options=b;this.optionsRequested=!1;this.getParameters=e;this.clientCollect=b&&b.clientCollect;this.getParameterElement=b&&b.getParameterElement;
this.getSubmitName=b&&b.getSubmitName}b.prototype={_init:function(a){this._selectionService=a.selection;var b=this;l.setKeyBindingProvider(function(){return b._activeBindings})},processURL:function(a){for(var b in this._urlBindings)if(this._urlBindings[b]&&this._urlBindings[b].urlBinding&&this._urlBindings[b].command){var e=this._urlBindings[b].urlBinding.match(a);if(e){var d=this._urlBindings[b],p=d.command,f=d.invocation;if(f&&f.parameters&&p.callback){f.parameters.setValue(e.parameterName,e.parameterValue);
var g=this;window.setTimeout(function(){g._invoke(f)},0);break}}}},findCommand:function(a){return this._commandList[a]},runCommand:function(a,b,e,d,p,f){if(b){if((a=this._commandList[a])&&(a.visibleWhen?a.visibleWhen(b):1)&&a.callback)return b=new l.CommandInvocation(e,b,p,a,this),b.domParent=f,this._invoke(b,d)}else if((f=this._urlBindings[a])&&f.command&&f.command.callback)return this._invoke(f.invocation,d)},getSelectionService:function(){return this._selectionService},setParameterCollector:function(a){this._parameterCollector=
a},openParameterCollector:function(a,b,e){this._parameterCollector&&(this._parameterCollector.close(),this._parameterCollector.open(a,b,e))},confirm:function(a,b,e,d,p,f){var g=!1;if(this._parameterCollector&&!p){var v=this;this._parameterCollector.close();if(this._parameterCollector.open(a,function(a,p){var f=document.createElement("span");f.classList.add("parameterPrompt");f.textContent=b;a.appendChild(f);f=document.createElement("button");f.addEventListener("click",function(a){g=!0;v._parameterCollector.close()},
!1);p.appendChild(f);f.appendChild(document.createTextNode(e));f.className="dismissButton";var q=document.createElement("button");q.addEventListener("click",function(a){g=!1;v._parameterCollector.close()},!1);p.appendChild(q);q.appendChild(document.createTextNode(d));q.className="dismissButton";return f},function(){f(g)}))return}g=window.confirm(b);f(g)},closeParameterCollector:function(){this._parameterCollector&&this._parameterCollector.close()},collectsParameters:function(){return this._parameterCollector},
_invoke:function(a,b){return this._collectAndInvoke(a.makeCopy(b),!1)},_collectAndInvoke:function(a,b,e){if(a)if(this._parameterCollector&&a.parameters&&a.parameters.hasParameters()&&(b||a.parameters.shouldCollectParameters())){b=!1;a.parameters.updateParameters(a);if(a.parameters.shouldCollectParameters()&&(b=this._parameterCollector.collectParameters(a,e),!b)){var d=new f.Tooltip({node:a.domNode,afterHiding:function(){this.destroy()},trigger:"click",position:["below","right","above","left"]});b=
d.contentContainer();b.classList.add("parameterPopup");var p=window.document.activeElement,g=this._parameterCollector.getFillFunction(a,function(){p&&p.focus();d.destroy()},e)(b);d.show();window.setTimeout(function(){g.focus();g.select()},0);b=!0}if(!b)return a.command.callback.call(a.handler||window,a)}else return 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,
b){this._collectAndInvoke(a,!0,b)},showKeyBindings:function(a){function b(a){return function(){l.executeBinding(a)}}var e={},d,p,f=[],g;for(g in this._activeBindings)(p=this._activeBindings[g])&&(p.keyBinding&&p.command&&(p.command.name||p.command.tooltip))&&f.push(p);f.sort(function(a,b){return(a.command.name||a.command.tooltip).localeCompare(b.command.name||b.command.tooltip)});for(g=0;g<f.length;g++)p=f[g],p.keyBinding.scopeName?(e[p.keyBinding.scopeName]||(e[p.keyBinding.scopeName]=[]),e[p.keyBinding.scopeName].push(p)):
(d=k.getUserKeyString(p.keyBinding),a.createItem(d,p.command.name||p.command.tooltip,b(p)));for(var v in e)e[v].length&&0<e[v].length&&(a.createHeader(v),e[v].forEach(function(e){d=k.getUserKeyString(e.keyBinding);a.createItem(d,e.command.name||e.command.tooltip,b(e))}))},addCommand:function(a){this._commandList[a.id]=a;var b=this._pendingBindings[a.id];if(b){var e=this;b.forEach(function(b){e._addBinding(a,b.type,b.binding,b.bindingOnly)});delete this._pendingBindings[a.id]}},addCommandGroup:function(a,
b,e,d,p,f,g,v,q,h){this._contributionsByScopeId[a]||(this._contributionsByScopeId[a]={});a=this._contributionsByScopeId[a];p&&(a=this._createEntryForPath(a,p));a[b]?(d&&(a[b].title=d),e&&(a[b].position=e),g&&(a[b].imageClass=g),v&&(a[b].tooltip=v),q&&(a[b].selectionClass=q),!0===h?a[b].pretendDefaultActionId=!0:a[b].defaultActionId=h,a[b].emptyGroupMessage=f):(a[b]={title:d,position:e,emptyGroupMessage:f,imageClass:g,tooltip:v,selectionClass:q,defaultActionId:!0===h?null:h,pretendDefaultActionId:!0===
h,children:{}},a.sortedContributions=null)},_createEntryForPath:function(a,b){b&&b.split("/").forEach(function(b){1<b.length&&(a[b]||(a[b]={position:0,children:{}},a.sortedContributions=null),a=a[b].children)});return a},registerSelectionService:function(a,b){this._contributionsByScopeId[a]||(this._contributionsByScopeId[a]={});this._contributionsByScopeId[a].localSelectionService=b},registerCommandContribution:function(a,b,e,d,p,f,g){this._contributionsByScopeId[a]||(this._contributionsByScopeId[a]=
{});a=this._contributionsByScopeId[a];d&&(a=this._createEntryForPath(a,d));a[b]={position:e};f&&((e=this._commandList[b])?this._addBinding(e,"key",f,p):this._addPendingBinding(b,"key",f,p));g&&((e=this._commandList[b])?this._addBinding(e,"url",g,p):this._addPendingBinding(b,"url",g,p));a.sortedContributions=null},unregisterCommandContribution:function(a,b,e){if(this._contributionsByScopeId[a]){delete this._commandList[b];delete this._activeBindings[b];delete this._urlBindings[b];delete this._pendingBindings[b];
var d=this._contributionsByScopeId[a];e&&e.split("/").forEach(function(a){1<a.length&&d[a]&&(d=d[a].children)});delete d[b];d.sortedContributions=null}},_addBinding:function(a,b,e,d){if(!a.id)throw Error("No command id: "+a);"key"===b?this._activeBindings[a.id]={command:a,keyBinding:e,bindingOnly:d}:"url"===b&&(this._urlBindings[a.id]={command:a,urlBinding:e,bindingOnly:d})},_addPendingBinding:function(a,b,e,d){this._pendingBindings[a]=this._pendingBindings[a]||[];this._pendingBindings[a].push({type:b,
binding:e,bindingOnly:d})},_checkForTrailingSeparator:function(a,b,e){var d;if("tool"===b||"button"===b)if((d=0<a.childNodes.length?a.childNodes[a.childNodes.length-1]:null)&&d.classList.contains("commandSeparator"))return e?(a.removeChild(d),!1):!0;if("menu"===b&&(a=g.$$array("li \x3e *",a),0<a.length&&a[a.length-1].classList.contains("dropdownSeparator")))if(d=a[a.length-1],e)d.parentNode.parentNode.removeChild(d.parentNode);else return!0;return!1},renderCommands:function(a,b,e,d,p,f,q){if("string"!==
typeof a)throw"a scope id for rendering must be specified";b=g.node(b);if(!b)throw"no parent";var v=this._contributionsByScopeId[a];if(!e&&v){e=v.localSelectionService||this._selectionService;var A=this;e&&e.getSelections(function(e){A.renderCommands(a,b,e,d,p,f)})}else v&&(this._render(v,b,e,d,p||"button",f,q),this._checkForTrailingSeparator(b,p,!0))},destroy:function(a){a=g.node(a);if(!a)throw"no parent";for(;a.hasChildNodes();){var b=a.firstChild;b.commandTooltip&&b.commandTooltip.destroy();b.emptyGroupTooltip&&
b.emptyGroupTooltip.destroy();this.destroy(b);a.removeChild(b)}},_render:function(a,b,e,d,p,g,q){var v=a.sortedContributions;if(!v){var v=[],A=!1,h;for(h in a)if(Object.prototype.hasOwnProperty.call(a,h)){var s=a[h];s&&"number"===typeof s.position&&(s.id=h,v.push(s),A=!0)}A&&(v.sort(function(a,b){return a.position-b.position}),a.sortedContributions=v)}var u=0,m=this;v.forEach(function(a){var v;a.imageClass||(a.imageClass=null);if(a.children&&0<Object.getOwnPropertyNames(a.children).length){var A=
a.children;if("tool"===p||"button"===p)if(a.title){var h;a.defaultActionId&&((A=m._commandList[a.defaultActionId])&&(A.visibleWhen?A.visibleWhen(e):1)?(h=new l.CommandInvocation(d,e,g,A,m),h.domParent=b):a.pretendDefaultActionId=!0);A=m._createDropdownMenu(b,a.title,null,null,a.imageClass,a.tooltip,a.selectionClass,null,h,a.pretendDefaultActionId);q&&n.generateNavGrid(q,A.menuButton);A&&(m._render(a.children,A.menu,e,d,"menu",g,q),m._checkForTrailingSeparator(A.menu,"menu",!0),0===A.menu.childNodes.length?
a.emptyGroupMessage?A.menuButton.emptyGroupTooltip||(A.menuButton.emptyGroupTooltip=new f.Tooltip({node:A.menuButton,text:a.emptyGroupMessage,trigger:"click",position:["below","right","above","left"]})):(q&&n.removeNavGrid(q,A.menuButton),a=function(a){a&&a.parentNode&&a.parentNode.removeChild(a)},a(A.menu),a(A.menuButton),a(A.destroyButton)):A.menuButton.style.visibility="visible")}else{var C;0<b.childNodes.length&&!m._checkForTrailingSeparator(b,p)&&(C=m.generateSeparatorImage(b));m._render(A,b,
e,d,p,g,q);0<b.childNodes.length&&b.childNodes[b.childNodes.length-1]!==C&&(C=m.generateSeparatorImage(b))}else if(a.title){if(a=m._createDropdownMenu(b,a.title,!0,null,null,a.imageClass))m._render(A,a.menu,e,d,"menu",g,q),m._checkForTrailingSeparator(a.menu,"menu",!0),0===a.menu.childNodes.length&&a.destroyButton&&b.removeChild(a.destroyButton)}else 0<b.childNodes.length&&m._generateMenuSeparator(b),m._render(A,b,e,d,p,g,q),m._generateMenuSeparator(b)}else{var s=m._commandList[a.id],A=s?!0:!1;h=
a=null;if(s){v=new l.CommandInvocation(d,e,g,s,m);v.domParent=b;C=!1;try{C=A&&(s.visibleWhen?s.visibleWhen(e):!0)}catch(D){throw console.log(D),D;}m._activeBindings[s.id]&&m._activeBindings[s.id].keyBinding&&(a=m._activeBindings[s.id],a.invocation=C?v:null,a.bindingOnly&&(A=!1));m._urlBindings[s.id]&&m._urlBindings[s.id].urlBinding&&(h=m._urlBindings[s.id],h.invocation=C?v:null,h.bindingOnly&&(A=!1));A=A&&C}A&&(s.choiceCallback?("tool"===p||"button"===p?(a=b,A=!1,"ul"===b.nodeName.toLowerCase()&&
(a=document.createElement("li"),b.appendChild(a))):(a=b,A=!0),m._createDropdownMenu(a,s.name,A,function(a){s.populateChoicesMenu(a,e,d,g,m)}.bind(s),s.imageClass,s.tooltip||s.title,s.selectionClass,s.positioningNode)):(v.handler=v.handler||this,v.domParent=b,A=function(a){m._invoke(v)},"menu"===p?(h=null,a&&a.keyBinding&&(h=k.getUserKeyString(a.keyBinding)),a=l.createCommandMenuItem(b,s,v,null,A,h)):(a=p+s.id+u,a=l.createCommandItem(b,s,v,a,null,"tool"===p,A)),n.generateNavGrid(q,a),v.domNode=a,u++))}})},
_createDropdownMenu:function(a,b,d,p,q,k,s,v,A,C){a=g.node(a);if(!a||!g.contains(document.body,a))return null;var u,m,n=a;if(d)k=document.createRange(),k.selectNode(a),k=k.createContextualFragment(e),g.processTextNodes(k,{ButtonText:b}),a.appendChild(k),m=a.lastChild,q=m.lastChild,b=q.previousSibling,b.dropdown=new h.Dropdown({dropdown:q,populate:p,parentDropdown:a.dropdown}),q.dropdown=b.dropdown;else{"ul"===a.nodeName.toLowerCase()&&(n=document.createElement("li"),a.appendChild(n),m=n);a=null;q&&
(a="dropdownButtonWithIcon",k=k||b);k=q?k||b:k;var I=l.createDropdownMenu(n,b,p,a,q,!1,s,v,A||C);u=I.dropdownArrow;b=I.menuButton;if(u){A&&(A.domNode=I.menuButton);var F=this;b.onclick=function(a){var b=g.bounds(u);a.clientX>=b.left&&I.dropdown?I.dropdown.toggle(a):F._invoke(A)};I.dropdown&&(b.onkeydown=function(a){g.KEY.DOWN===a.keyCode&&(I.dropdown.toggle(a),g.stop(a))})}q=I.menu;var G;(p=A&&A.command&&(A.command.tooltip||A.command.name))?G=A.command.tooltip||A.command.name:p&&(G=k);G&&(b.commandTooltip=
new f.Tooltip({node:b,text:G,position:["above","below","right","left"]}))}return{menuButton:b,menu:q,dropdown:b.dropdown,destroyButton:m,dropdownArrow:u}},_generateMenuSeparator:function(a){if(!this._checkForTrailingSeparator(a,"menu")){var b=document.createElement("li");b.classList.add("dropdownSeparator");var e=document.createElement("span");e.classList.add("dropdownSeparator");b.appendChild(e);a.appendChild(b)}},generateSeparatorImage:function(a){var b;b="ul"===a.nodeName.toLowerCase()?document.createElement("li"):
document.createElement("span");a.appendChild(b);b.classList.add("core-sprite-sep");b.classList.add("imageSprite");b.classList.add("commandSeparator");return b}};b.prototype.constructor=b;p.prototype={match:function(a){a=m.matchResourceParameters(a);return"undefined"!==typeof a[this.token]?(this.parameterValue=a[this.token],this):null}};p.prototype.constructor=p;q.prototype.constructor=q;s.prototype={optionsRequested:function(){return this.optionsRequested}};s.prototype.constructor=s;u.prototype={_storeParameters:function(a){this.parameterTable=
null;if(a){var b=this.parameterTable={};a.forEach(function(a){b[a.name]=a})}},updateParameters:function(a){"function"===typeof this.getParameters&&this._storeParameters(this.getParameters(a))},hasParameters:function(){return null!==this.parameterTable},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,b){var e=this.parameterTable[a];
e&&(e.value=b)},forEach:function(a){for(var b in this.parameterTable)this.parameterTable[b].type&&this.parameterTable[b].name&&a(this.parameterTable[b])},makeCopy:function(){var a=[];this.forEach(function(b){b=new s(b.name,b.type,b.label,b.value,b.lines,b.eventListeners);a.push(b)});var b=new u(a,this._options,this.getParameters);b.clientCollect=this.clientCollect;return b},hasOptionalParameters:function(){return this._hasOptionalParameters}};u.prototype.constructor=u;return{CommandRegistry:b,URLBinding:p,
ParametersDescription:u,CommandParameter:s,CommandEventListener:q}});
define("orion/parameterCollectors",["i18n!orion/nls/messages","require","orion/webui/littlelib"],function(l,n,m){function k(g,h){this._activeContainer=null;this._getElementsFunction=g;this._toolbarLayoutFunction=h}k.prototype={close:function(){if(this._activeElements){this._activeElements.parameterArea&&m.empty(this._activeElements.parameterArea);this._activeElements.slideContainer&&this._activeElements.slideContainer.classList.remove("slideContainerActive");this._activeElements.dismissArea&&m.empty(this._activeElements.dismissArea);
this._activeElements.commandNode&&this._activeElements.commandNode.classList.remove("activeCommand");this._toolbarLayoutFunction(this._activeElements);if(this._activeElements.onClose)this._activeElements.onClose();this._oldFocusNode&&(this._oldFocusNode.focus(),this._oldFocusNode=null)}this._activeElements=null},open:function(g,h,f){"string"===typeof g&&(g=m.node(g));if(this._activeElements&&this._activeElements.slideContainer&&this._activeElements.commandNode===g)return this._activeElements.focusNode&&
this._activeElements.focusNode.focus(),!0;this.close();this._activeElements=null;if((this._activeElements=this._getElementsFunction(g))&&this._activeElements.parameterArea&&this._activeElements.slideContainer){this._activeElements.onClose=f;var d=h(this._activeElements.parameterArea,this._activeElements.dismissArea);if(!d)return!1;this._activeElements.focusNode=d;g=m.$$array("#closebox",this._activeElements.dismissArea||this._activeElements.parameterArea);if(0===g.length){h=this._activeElements.dismissArea||
this._activeElements.parameterArea;g=document.createElement("button");g.id="closebox";g.className="imageSprite core-sprite-close dismissButton";g.title=l.Close;h.appendChild(g);var a=this;g.addEventListener("click",function(e){a.close()},!1)}this._activeElements.slideContainer.classList.add("slideContainerActive");this._toolbarLayoutFunction(this._activeElements);d&&(this._oldFocusNode=window.document.activeElement,window.setTimeout(function(){d.focus();d.select&&d.select()},0));this._activeElements.commandNode&&
this._activeElements.commandNode.classList.add("activeCommand");return!0}return!1},_collectAndCall:function(g,h){m.$$array("input",h).forEach(function(d){"checkbox"===d.type?g.parameters.setValue(d.parameterName,d.checked):"button"!==d.type&&g.parameters.setValue(d.parameterName,d.value.trim())});m.$$array("textArea",h).forEach(function(d){g.parameters.setValue(d.parameterName,d.value.trim())});var f=g.parameters.getParameterElement;f&&g.parameters.forEach(function(d){(d=f(d,h))&&("checkbox"===d.type?
g.parameters.setValue(d.parameterName,d.checked):"button"!==d.type?g.parameters.setValue(d.parameterName,d.value.trim()):"textarea"!==d.type&&g.parameters.setValue(d.parameterName,d.value.trim()))});g.command.callback&&g.command.callback.call(g.handler,g)},collectParameters:function(g,h){return g.parameters?(g.domNode&&g.domNode.classList.add("commandMarker"),this.open(g.domNode||g.domParent,this.getFillFunction(g,null,h))):!1},getFillFunction:function(g,h,f){var d=this;return function(a,e){var b=
null,p=function(){h&&h();d.close()},q=function(b){b.keyCode===m.KEY.ENTER&&(d._collectAndCall(g,a),p(),m.stop(b));b.keyCode===m.KEY.ESCAPE&&("function"===typeof f&&f(),p(),m.stop(b))},k=g.parameters;k.forEach(function(e){var d=k.getParameterElement?k.getParameterElement(e,a):null,f=null;!d&&e.label&&(f=document.createElement("label"),f.classList.add("parameterInput"),f.setAttribute("for",e.name+"parameterCollector"),f.textContent=e.label,a.appendChild(f));var h=e.name+"parameterCollector",f=f||a;
"text"===e.type&&"number"===typeof e.lines&&1<e.lines?(d||(d=document.createElement("textarea"),d.rows=e.lines,d.type="textarea",d.id=h,f.appendChild(d)),q=function(a){a.keyCode===m.KEY.ESCAPE&&(p(),m.stop(a))}):"boolean"===e.type?(d||(d=document.createElement("input"),d.type="checkbox",d.id=h,f.appendChild(d)),e.value&&(d.checked=!0)):(d||(d=document.createElement("input"),d.type=e.type,d.id=h,f.appendChild(d)),e.value&&(d.value=e.value));d.classList.add("parameterInput");d.setAttribute("speech",
"speech");d.setAttribute("x-webkit-speech","x-webkit-speech");d.parameterName=e.name;b||(b=d);0<e.eventListeners.length&&e.eventListeners.forEach(function(a){d.addEventListener(a.event,function(b){return a.handler(b,g)},a.capture)});d.addEventListener("keydown",q,!1)});var u=e;u||(u=document.createElement("span"),u.classList.add("layoutRight"),u.classList.add("parametersDismiss"),a.appendChild(u));var w=function(a,b){var e=document.createElement("button");b.appendChild(e);a&&e.appendChild(document.createTextNode(a));
e.classList.add("dismissButton");return e};g.parameters.hasOptionalParameters()&&(g.parameters.optionsRequested=!1,w(l.More,u).addEventListener("click",function(){g.parameters.optionsRequested=!0;d._collectAndCall(g,a);p()},!1));w(k.getSubmitName?k.getSubmitName(g):l.Submit,u).addEventListener("click",function(){d._collectAndCall(g,a);p()},!1);u=w(null,u);u.id="closebox";u.classList.add("imageSprite");u.classList.add("core-sprite-close");u.title=l.Close;u.addEventListener("click",function(a){p();
"function"===typeof f&&f()},!1);return b}}};k.prototype.constructor=k;return{CommandParameterCollector:k}});define("orion/regex",[],function(){return{escape:function(l){return l.replace(/([\\$\^*\/+?\.\(\)|{}\[\]])/g,"\\$\x26")},parse:function(l){return(l=/^\s*\/(.+)\/([gim]{0,3})\s*$/.exec(l))?{pattern:l[1],flags:l[2]}:null}}});
define("orion/contentTypes",[],function(){function l(a,b){if("string"!==typeof a)return null;for(var d=a&&a.split(".").pop(),f=null,g=0;g<b.length;g++){var h=b[g],k;a:{k=f;var l=h,m=d,n=0<=l.filename.indexOf(a),t;t=m.toLowerCase();t=-1!==l.extension.indexOf(t);if(n||t){if(!(t=!k))n&&(m=m.toLowerCase(),n=-1!==k.extension.indexOf(m)),t=n;if(t){k=l;break a}}}k===h&&(f=h)}return f}function n(a){return null===a||"undefined"===typeof a?[]:Array.isArray(a)?a:[a]}function m(a){return n(a).map(function(a){return String.prototype.toLowerCase.call(a)})}
function k(a){return{id:a.id,name:a.name,image:a.image,imageClass:a.imageClass,"extends":a["extends"],extension:m(a.extension),filename:n(a.filename)}}function g(a){var b=Object.create(null);a.map(k).forEach(function(a){Object.prototype.hasOwnProperty.call(b,a.id)||(b[a.id]=a)});return b}function h(e){if(e&&e.registerService){this.serviceRegistry=e;for(var b=e.getServiceReferences(d).concat(e.getServiceReferences(a)),p=[],q=0;q<b.length;q++)for(var h=n(b[q].getProperty("contentTypes")),k=0;k<h.length;k++)p.push(h[k]);
this.map=g(p);e.registerService(f,this)}else if(Array.isArray(e))this.serviceRegistry=null,this.map=g(e);else throw Error("Invalid parameter");}var f="orion.core.contentTypeRegistry",d="orion.core.contenttype",a="orion.file.contenttype";h.prototype={getContentTypes:function(){var a=this.getContentTypesMap(),b=[],d;for(d in a)Object.prototype.hasOwnProperty.call(a,d)&&b.push(a[d]);return b},getContentTypesMap:function(){return this.map},getFileContentType:function(a){return l(a.Name,this.getContentTypes())},
getFilenameContentType:function(a){return l(a,this.getContentTypes())},getContentType:function(a){return this.map[a]||null},isExtensionOf:function(a,b){a="string"===typeof a?this.getContentType(a):a;b="string"===typeof b?this.getContentType(b):b;if(!a||!b)return!1;if(a.id===b.id)return!0;for(var d=a,f={};d&&(d=this.getContentType(d["extends"]));){if(d.id===b.id)return!0;if(f[d.id])throw Error("Cycle: "+d.id);f[d.id]=!0}return!1},isSomeExtensionOf:function(a,b){for(var d=0;d<b.length;d++)if(this.isExtensionOf(a,
b[d]))return!0;return!1}};return{ContentTypeRegistry:h,getFilenameContentType:l}});
define("orion/URITemplate",[],function(){function l(a){this._text=a}function n(a){return a.replace("%25","%")}function m(a,d){if("U"===d)return encodeURIComponent(a).replace(/[!'()*]/g,function(a){return"%"+a.charCodeAt(0).toString(16).toUpperCase()});if("U+R"===d)return encodeURI(a).replace(/%5B/g,"[").replace(/%5D/g,"]").replace(e,n);if("U+R-,"===d)return encodeURI(a).replace(/%5B/g,"[").replace(/%5D/g,"]").replace(/,/g,"%2C");throw Error("Unknown allowed character set: "+d);}function k(a,e,d){for(var f=
[],g=0;g<a.length;g++)"undefined"!==typeof a[g]&&f.push(m(a[g],e));return f.join(d)}function g(a,e,d,f){for(var g=Object.keys(a),h=[],k=0;k<g.length;k++)"undefined"!==typeof a[g[k]]&&h.push(m(g[k],e)+d+m(a[g[k]],e));return h.join(f)}function h(b){if(0===b.length)throw Error("Invalid Expression: 0 length expression");(this._operator=d[b[0]])?b=b.substring(1):this._operator=d.NUL;for(var e=[],f=b.split(","),g=0;g<f.length;g++){var h=f[g].match(a);if(null===h)throw Error("Bad VarSpec: "+b);e.push({name:h[1],
explode:!!h[2],prefix:h[3]?parseInt(h[3],10):-1})}this._varSpecList=e}function f(a){for(var e=[],d=0,f=a.indexOf("{",d);-1!==f;){e.push(new l(a.substring(d,f)));d=a.indexOf("}",f+1);if(-1===d)throw Error("Invalid template: "+a);e.push(new h(a.substring(f+1,d)));d+=1;f=a.indexOf("{",d)}e.push(new l(a.substring(d)));this._templateComponents=e}var d={NUL:{first:"",sep:",",named:!1,ifemp:"",allow:"U"},"+":{first:"",sep:",",named:!1,ifemp:"",allow:"U+R"},".":{first:".",sep:",",named:!1,ifemp:"",allow:"U"},
"/":{first:"/",sep:"/",named:!1,ifemp:"",allow:"U"},";":{first:";",sep:";",named:!0,ifemp:"",allow:"U"},"?":{first:"?",sep:"\x26",named:!0,ifemp:"\x3d",allow:"U"},"\x26":{first:"\x26",sep:"\x26",named:!0,ifemp:"\x3d",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;l.prototype={expand:function(a){return encodeURI(this._text)}};
h.prototype={expand:function(a){for(var e=[],d=0;d<this._varSpecList.length;d++){var f=this._varSpecList[d],h=f.name,l=a[h],x=typeof l;if("undefined"!==x&&null!==l){var n=0===e.length?this._operator.first:this._operator.sep;if("string"===x)this._operator.named&&(n+=m(h,"U+R"),n+=0===l.length?this._operator.ifemp:"\x3d"),-1!==f.prefix&&f.prefix<l.length&&(l=l.substring(0,f.prefix)),n+=m(l,this._operator.allow);else if(Array.isArray(l)){if(0===l.length)continue;f.explode?n+=k(l,this._operator.allow,
this._operator.sep):(f=k(l,this._operator.allow,","),this._operator.named&&(n+=m(h,"U+R"),n+=0===f.length?this._operator.ifemp:"\x3d"),n+=f)}else if("object"===x){if(0===Object.keys(l).length)continue;f.explode?n+=g(l,this._operator.allow,"\x3d",this._operator.sep):(f=g(l,this._operator.allow,",",","),this._operator.named&&(n+=m(h,"U+R"),n+=0===f.length?this._operator.ifemp:"\x3d"),n+=f)}else throw Error("bad param type: "+h+" : "+x);e.push(n)}}return e.join("")}};f.prototype={expand:function(a){for(var e=
[],d=0;d<this._templateComponents.length;d++)e.push(this._templateComponents[d].expand(a));return e.join("")}};return f});
define("orion/i18nUtil",["require","orion/Deferred"],function(l,n){function m(g){if(g=localStorage.getItem("orion/messageBundle/"+g))if(g=JSON.parse(g),g._expires&&g._expires>(new Date).getTime())return delete g._expires,g;return null}var k={};return{getMessageBundle:function(g){function h(a){a?l(["i18n!"+g],function(a){if(a){var b=g;a._expires=(new Date).getTime()+9E5;localStorage.setItem("orion/messageBundle/"+b,JSON.stringify(a));delete a._expires}d.resolve(a)}):f(Error(g))}function f(a){d.reject(a)}
if(k[g])return k[g];var d=new n;k[g]=d;var a=m(g);if(a)return d.resolve(a),d;try{l([g],h,f)}catch(e){l(["orion/i18n!"+g],h,f)}return d},formatMessage:function(g){var h=arguments;return g.replace(/\$\{([^\}]+)\}/g,function(f,d){return h[(d<<0)+1]})}}});
define("orion/PageLinks","require orion/Deferred orion/PageUtil orion/URITemplate orion/i18nUtil orion/objects orion/URL-shim".split(" "),function(l,n,m,k,g,h,f){function d(){return l.toUrl?(new URL(l.toUrl("orion/../"),window.location.href)).href.slice(0,-1):(new URL("/",window.location.href)).href.slice(0,-1)}function a(a){var b={};a.getPropertyKeys().forEach(function(e){"objectClass"!==e&&("service.names"!==e&&"service.id"!==e&&"__plugin__"!==e)&&(b[e]=a.getProperty(e))});return b}function e(a){return g.getMessageBundle(a.nls).then(function(b){a.textContent=
a.nameKey?b[a.nameKey]:a.name;return a},function(b){a.textContent=a.nameKey||a.name;return a})}function b(b,f){var p=b.getServiceReferences(f||"orion.page.link"),g=m.matchResourceParameters(window.location.href),h={OrionHome:d(),Location:g.resource},q=[];p.forEach(function(b){b=a(b);if(b.uriTemplate&&(b.nls||b.name)){var d=(new k(b.uriTemplate)).expand(h),d=m.validateURLScheme(d);b.href=d;b.nls?q.push(e(b)):(b.textContent=b.name,q.push((new n).resolve(b)))}});return n.all(q)}function p(a){var b=this.categories=
Object.create(null);a.forEach(function(a){b[a.id]=a})}function q(a){this.allPageLinks=a;this.allPageLinks.sort(s)}function s(a,b){var e=a.textContent&&a.textContent.toLowerCase(),d=b.textContent&&b.textContent.toLowerCase();return e<d?-1:e>d?1:0}var u;h.mixin(p.prototype,{getCategoryIDs:function(){return Object.keys(this.categories)},getCategory:function(a){return this.categories[a]||null}});h.mixin(q.prototype,{createLinkElements:function(){return this.allPageLinks.map(function(a){var b=a.href;a=
a.textContent;var e=document.createElement("a");e.href=b;e.target="_self";e.classList.add("targetSelector");e.textContent=a;return e})},getAllLinks:function(){return this.allPageLinks}});return{getCategoriesInfo:function(b){var d;return!u?(d=[],b.getServiceReferences("orion.page.link.category").forEach(function(f){var p=a(f);if(p.id&&(p.name||p.nameKey))p.service=b.getService(f),p.nls?d.push(e(p)):(p.textContent=p.name,d.push((new n).resolve(p)))}),n.all(d).then(function(a){return u=new p(a)})):(new n).resolve(u)},
getPageLinksInfo:function(a,e){return b(a,e).then(function(a){return new q(a)})},getOrionHome:d}});
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(l,n){var m={root:n};Object.keys(l).forEach(function(k){"undefined"===typeof m[k]&&(m[k]=l[k])});return m});
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(l,n,m,k,g,h,f,d,a,e){function b(a){var b={};a.getPropertyKeys().forEach(function(e){b[e]=a.getProperty(e)});return b}var p={},q=a.getOrionHome();p._cloneItemWithoutChildren=function x(a){if(null===a||"object"!==typeof a)return a;var b=a.constructor(),e;for(e in a)"children"!==e&&"Children"!==
e&&(b[e]=x(a[e]));return b};p._getOpenWithNavCommandExtensions=function(a,b){function e(a,b){for(var d=a.getServiceReferences("orion.navigate.openWith"),f=[],p=[],g=0;g<d.length;g++){var v=d[g];if(v.getProperty("editor")===b.id){var A=v.getProperty("contentType");A instanceof Array?f=f.concat(A):f.push(A||"*/*");v=v.getProperty("excludedContentTypes");v instanceof Array?p=p.concat(v):null!==v&&"undefined"!==typeof v&&p.push(v)}}0===f.length&&(f=null);0===p.length&&(p=null);return{contentTypes:f,excludedContentTypes:p}}
for(var d=function(){for(var b=a.getServiceReferences("orion.edit.editor"),e=[],d=0;d<b.length;d++){var f=b[d],p=f.getProperty("id");e.push({id:p,"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 e}(),f=[],p,g=0;g<d.length;g++){var A=d[g],h=e(a,A),h={properties:{name:A.name||A.id,nameKey:A.nameKey,
id:"eclipse.openWithCommand."+A.id,contentType:h.contentTypes,excludedContentTypes:h.excludedContentTypes,uriTemplate:A.uriTemplate,nls:A.nls,forceSingleItem:!0,isEditor:A["default"]?"default":"editor",validationProperties:A.validationProperties},service:{}};"orion.editor"===A.id?p=h:f.push(h)}p&&f.push(p);return f};p._makeValidator=function(a,b,e,d){function f(a,b,e,d,p){var g=!1,v;if("!"===b.charAt(0))return"undefined"===typeof a[b.substring(1)];if("undefined"!==typeof a[b]){if("undefined"===typeof e)v=
a[b],g=!0;else if("string"===typeof e){if(!typeof("string"===a[b]))return!1;if(d.variableName){if(e=RegExp(e).exec(a[b]))g=e[0],v="before"===d.variableMatchPosition?a[b].substring(0,e.index):"after"===d.variableMatchPosition?a[b].substring(e.index+g.length):"only"===d.variableMatchPosition?g:a[b],g=!0}else return RegExp(e).test(a[b])}else a[b]===e&&(v=a[b],g=!0);b=d.variableName;d=d.replacements;if(g&&b&&(p[b]=v,p.itemCached=a,d)){if("string"!==typeof v)return window.console.log("Cannot replace "+
b+", value is not a string: "+v),g;for(a=0;a<d.length;a++){v=!1;if(d[a].pattern){e=d[a].pattern;var h=d[a].replacement||"";p[b]=p[b].replace(RegExp(e),h).replace(RegExp(e),h)}else v=!0;v&&window.console.log("Invalid replacements specified in validation property.  "+d[a])}}return g}return!1}function p(a,b,e,d){var g=e.match,v,h;if(0<=(v=b.indexOf("["))){if(0>(h=b.indexOf("]")))return!1;var q=b.substring(0,v),k;if(!(k=a[q])||!Array.isArray(k))return!1;v=b.substring(v+1,h);v=parseInt(v,10);if(isNaN(v))return!1;
0>v&&(v+=k.length);b=b.substring(h+1);b=q+":"+String(v)+b}return 0<=b.indexOf("|")?(v=b.substring(0,b.indexOf("|")),b=b.substring(b.indexOf("|")+1),p(a,v,e,d)?!0:p(a,b,e,d)):0<=b.indexOf(":")?(v=b.substring(0,b.indexOf(":")),b=b.substring(b.indexOf(":")+1),a[v]?p(a[v],b,e,d):!1):f(a,b,g,e,d)}function v(b,e,d){if(d.info.validationProperties)for(var f=0;f<d.info.validationProperties.length;f++){var v=d.info.validationProperties[f];if("undefined"!==typeof v.source){if(!p(b,v.source,v,d))return!1}else return window.console.log("Invalid validationProperties in "+
a.id+".  No source property specified."),!1}var f=!0,h=e?g.getFilenameContentType(b.Name,e):null,h=h||{id:"application/octet-stream"};d.info.excludedContentTypes&&e&&(f=d.info.excludedContentTypes.every(function(a){a=a.replace(/([*?])/g,".$1");return-1!==h.id.search(a)?!1:!0}));f&&(d.info.contentType&&e)&&(f=d.info.contentType.some(function(a){a=a.replace(/([*?])/g,".$1");return-1!==h.id.search(a)?!0:!1}));return f}return{info:a,validationFunction:function(a){"function"===typeof d&&(a=d.call(this,
a));if(a){if(Array.isArray(a)){if((this.info.forceSingleItem||this.info.uriTemplate)&&1!==a.length||1>a.length)return!1}else a=[a];for(var b=0;b<a.length;b++)if(!v(a[b],e,this))return!1;return!0}return!1},generatesURI:function(){return!!this.info.uriTemplate},getURI:function(a){if(this.info.uriTemplate){var b={},e;for(e in a)Object.prototype.hasOwnProperty.call(a,e)&&(b[e]=a[e]);if(this.info.validationProperties)for(e=0;e<this.info.validationProperties.length;e++){var d=this.info.validationProperties[e];
d.source&&d.variableName&&(this.itemCached===a&&this[d.variableName]||p(a,d.source,d,this),a[d.variableName]?window.console.log("Variable name "+d.variableName+" in the extension "+this.info.id+" conflicts with an existing property in the item metadata."):b[d.variableName]=this[d.variableName])}b.OrionHome=q;return(new h(this.info.uriTemplate)).expand(b)}return null}}};var s=e.UnnamedCommand;p._createCommandOptions=function(a,b,e,d,g,h){function v(f,v){var q=p._makeValidator(a,e,d,h);f.visibleWhen=
q.validationFunction.bind(q);if(g)if(q.generatesURI.bind(q)())f.hrefCallback=function(a){a=Array.isArray(a.items)?a.items[0]:a.items;return q.getURI.bind(q)(a)};else{var A=a;f.callback=function(a){var d;if(A.forceSingleItem)a=Array.isArray(a.items)?a.items[0]:a.items,d=p._cloneItemWithoutChildren(a);else if(Array.isArray(a.items)){d=[];for(var g=0;g<a.items.length;g++)d.push(p._cloneItemWithoutChildren(a.items[g]))}else d=p._cloneItemWithoutChildren(a.items);if(e)var v=e.getService("orion.page.progress");
b.run?v?v.progress(b.run(d),"Running command: "+f.name):b.run(d):e&&(v?v.progress(e.getService(b).run(d),"Running command: "+f.name):e.getService(b).run(d))}}v.resolve(f)}var q=new n;if(a.nls){var k=function(b){var e;b?(e=a.tooltipKey&&b[a.tooltipKey],b=a.nameKey&&b[a.nameKey]||a.name||s,e=e||a.tooltip||""):(b=a.name||a.nameKey||s,e=a.tooltip||a.tooltipKey||"");v({name:b,image:a.image,id:a.id||a.name,tooltip:e,isEditor:a.isEditor,showGlobally:a.showGlobally},q)};f.getMessageBundle(a.nls).then(k,k.bind(this,
null))}else v({name:a.name,image:a.image,id:a.id||a.name,tooltip:a.tooltip,isEditor:a.isEditor,showGlobally:a.showGlobally},q);return q};p.getOpenWithCommand=function(a,b,e){var d;a=e||p.getOpenWithCommands(a);for(e=0;e<a.length;e++)if(a[e].visibleWhen(b)){var f="default"===a[e].isEditor;if(!d||f)if(d=a[e],f)break}return d};p.getOpenWithCommands=function(a){var b=[],e;for(e in a._commandList){var d=a._commandList[e];d.isEditor&&b.push(d)}return b};var u;p.createAndPlaceFileCommandsExtension=function(a,
b,d,f,g,h){return p.createFileCommands(a,null,h?"all":void 0,!!h,b).then(function(a){g&&0<a.length&&(b.addCommandGroup(d,"eclipse.openWith",1E3,e.OpenWith,g,null,null,null,"dropdownSelection"),b.addCommandGroup(d,"eclipse.fileCommandExtensions",1E3,e.OpenRelated,g));a.forEach(function(a){var e=null;g&&(e=a.isEditor?g+"/eclipse.openWith":g+"/eclipse.fileCommandExtensions");b.registerCommandContribution(d,a.id,f,e)});return{}})};p.createFileCommands=function(a,b,e,d,f){e=void 0===e?"global":e;d=void 0===
d?!0:d;var g=[];p._cachedFileCommands||p._createCachedFileCommands(a);("all"===e||"global"===e)&&p._cachedFileCommands.forEach(function(a){var b=a.properties;("all"===e||b.forceSingleItem&&b.showGlobally)&&g.push(a)});return n.when(function(){var e=a.getService("orion.core.contentTypeRegistry")||b;return u||n.when(e.getContentTypes(),function(a){return u=a})}(),function(){d&&(p._cachedOpenWithExtensions||(p._cachedOpenWithExtensions=p._getOpenWithNavCommandExtensions(a,u)),g=g.concat(p._cachedOpenWithExtensions),
f._addedOpenWithCommands=d);var b=g.map(function(b){var e=b.properties;b=b.service;var d=f.findCommand(e.id||e.name);return d?(new n).resolve(d):p._createCommandOptions(e,b,a,u,!0).then(function(a){a=new m.Command(a);f.addCommand(a);return a})});return n.all(b,function(a){return{_error:a}}).then(function(a){return a})})};p._createCachedFileCommands=function(a){var e=a.getServiceReferences("orion.navigate.command");p._cachedFileCommands=[];for(var d=0;d<e.length;d++)if("orion.navigateFromMetadata"!==
e[d].getProperty("id")){var f=a.getService(e[d]),g=b(e[d]);p._cachedFileCommands.push({properties:g,service:f})}};p.getFileCommandIds=function(){var a=[];if(p._cachedFileCommands)p._cachedFileCommands.length&&(a=p._cachedFileCommands.map(function(a){return a.properties.id}));else throw"extensionCommandUtils._cachedFileCommands is not initialized";return a};p.createOpenWithCommands=function(a,b,e){return e&&e._addedOpenWithCommands?(new n).resolve(p.getOpenWithCommands(e)):p.createFileCommands(a,b,
"none",!0,e)};return p});
define("orion/breadcrumbs",["require","orion/webui/littlelib"],function(l,n){function m(k){this._init(k)}m.prototype={_init:function(k){var g=n.node(k.container);if(!g)throw"no parent container";this._container=g;g.classList.remove("currentLocation");this._id=k.id||"eclipse.breadcrumbs";this._resource=k.resource||null;this._rootSegmentName=k.rootSegmentName;this._workspaceRootSegmentName=k.workspaceRootSegmentName;this._workspaceRootURL=k.workspaceRootURL;this._makeHref=k.makeHref;this._makeFinalHref=
k.makeFinalHref;this._maxLength=k.maxLength;this.path="";this.measure();this.render()},getNavigatorWorkspaceRootSegment:function(){if(this._workspaceRootSegmentName){var k;if(this._resource&&this._resource.Parents&&!this._resource.skip){k=document.createElement("a");var g=this._workspaceRootURL?this._workspaceRootURL:"";this._makeHref?this._makeHref(k,g):k.href=l.toUrl("edit/edit.html")+"#"+g}else k=document.createElement("span");n.empty(k);k.appendChild(document.createTextNode(this._workspaceRootSegmentName));
return k}return null},MAX_LENGTH:500,INCLUDE_FIRST_SECTION:!0,segments:[],buildSegment:function(k){var g=document.createElement("a");g.classList.add("breadcrumb");g.appendChild(document.createTextNode(k));return g},addSegmentHref:function(k,g){this._makeHref?this._makeHref(k,g.Location,g):k.href=l.toUrl("edit/edit.html")+"#"+g.ChildrenLocation},buildSegments:function(k,g){if(this._resource.Parents){var h=this._resource.Parents.slice(0),f,d;h&&(h=h.slice(0),"reverse"===g&&(h=h.reverse().slice(0)),
h.forEach(function(a){a.skip||(k?(d=k,k=null):d=a.Name,f=this.buildSegment(d),this.path+=a.Name,this.addSegmentHref(f,a),f.include=!1,this.segments.push(f))}.bind(this)))}},addDivider:function(){var k=document.createElement("span");k.appendChild(document.createTextNode(" / "));this.path+="/";k.classList.add("breadcrumbSeparator");this.append(k)},refresh:function(){(this.crumbs=n.node(this._id))?n.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(k){this.crumbs.appendChild(k)},addTitle:function(k,g){var h=g||document.title;0===this.crumbs.childNodes.length&&(k=document.createElement("span"),k.appendChild(document.createTextNode(h)),
k.classList.add("breadcrumb"),k.classList.add("currentLocation"),this.append(k))},finalSegment:function(k,g){if(!this._resource.skip){var h;h=g?g:this._resource.Name;this._makeFinalHref?(k=this.buildSegment(h),this.addSegmentHref(k,this._resource)):(k=document.createElement("span"),k.appendChild(document.createTextNode(h)));k.classList.add("currentLocation");this.path+=this._resource.Name;this.append(k)}},firstSegment:function(k){k&&(this.append(k),this._resource&&this._resource.Parents&&!this._resource.skip?
(k.classList.add("breadcrumb"),this.addDivider()):(this._resource.skip||(k.href=""),k.classList.add("currentLocation")))},drawSegments:function(){this._resource.Parents&&this.segments.slice(0).forEach(function(k){!0===k.include&&(this.append(k),this.addDivider())}.bind(this))},measureSegments:function(){this.INCLUDE_FIRST_SECTION=!0;if(this._resource.Parents){var k=this.segments.slice(0).reverse();k.forEach(function(g){this.append(g);this.addDivider();this.crumbs.offsetWidth<this.MAX_LENGTH?g.include=
!0:this.INCLUDE_FIRST_SECTION=!1}.bind(this));this.segments=k.reverse()}},measure:function(){var k=this._container;k.style.width="auto";this.MAX_LENGTH=this._maxLength?this._maxLength:k.offsetWidth;this.refresh();this.segments=[];this.crumbs.style.visibility="hidden";var k=this.getNavigatorWorkspaceRootSegment(),g=this._rootSegmentName;g?this.addTitle(k,g):(this.finalSegment(k,g),this._resource&&this._resource.Parents&&(this.buildSegments(g,"reverse"),this.measureSegments(),this.firstSegment(k)),
this.crumbs.offsetWidth>=this.MAX_LENGTH&&(this.INCLUDE_FIRST_SECTION=!1))},render:function(){this.refresh();var k=this.getNavigatorWorkspaceRootSegment(),g=this._rootSegmentName;g?this.addTitle(k,g):(!0===this.INCLUDE_FIRST_SECTION&&this.firstSegment(k),this._resource&&this._resource.Parents&&(this.drawSegments(),this.finalSegment(k,g)));this.crumbs.parentNode.style.width=this.crumbs.offsetWidth+20+"px"}};m.prototype.constructor=m;return{BreadCrumbs:m}});
define("orion/webui/splitter",["orion/EventTarget","orion/util","orion/webui/littlelib"],function(l,n,m){function k(g){l.attach(this);this._init(g)}k.prototype={_init:function(g){this._tracking=null;this._animationDelay=501;this._closeReversely=g.closeReversely;this.$node=m.node(g.node);if(!this.$node)throw"no dom node for splitter found";this.$sideNode=m.node(g.sidePanel);if(!this.$sideNode)throw"no dom node for side panel found";this.$mainNode=m.node(g.mainPanel);if(!this.$mainNode)throw"no dom node for main panel found";
this._vertical=g.vertical||!1;var h=this.$node.classList;h.add("split");h.add(this._vertical?"splitVerticalLayout":"splitLayout");h=this.$sideNode.classList;h.add("hasSplit");h.add(this._vertical?"sidePanelVerticalLayout":"sidePanelLayout");h=this.$mainNode.classList;h.add("hasSplit");h.add(this._vertical?"mainPanelVerticalLayout":"mainPanelLayout");this._prefix="/orion/splitter/"+(this.$node.id||document.body.id||"");g.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="closed"===this.$node.getAttribute("data-initial-state");"undefined"!==typeof g.closeByDefault&&(this._closeByDefault=g.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";n.isIOS||n.isAndroid?(this.$node.addEventListener("touchstart",this._touchStart.bind(this),!1),this._thumb&&this._thumb.addEventListener("touchstart",this._touchStart.bind(this),!1),this.$node.addEventListener("touchmove",this._touchMove.bind(this),!1),this.$node.addEventListener("touchend",this._touchEnd.bind(this),!1)):(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},getOrientation:function(){return this._vertical?"vertical":"horizontal"},setOrientation:function(g){g="vertical"===g;g!==this._vertical&&(this._vertical=g,g=this.$node.classList,g.toggle("splitLayout"),g.toggle("splitVerticalLayout"),this.$node.style.left="",this.$node.style.top="",g=this.$sideNode.classList,g.toggle("sidePanelLayout"),g.toggle("sidePanelVerticalLayout"),this.$sideNode.style.left="",this.$sideNode.style.top="",this.$sideNode.style.width=
"",this.$sideNode.style.height="",g=this.$mainNode.classList,g.toggle("mainPanelLayout"),g.toggle("mainPanelVerticalLayout"),this.$mainNode.style.left="",this.$mainNode.style.top="",this.$mainNode.style.width="",this.$mainNode.style.height="",this._thumb&&(g=this._thumb.classList,g.toggle("splitThumbLayout"),g.toggle("splitVerticalThumbLayout")),this._initializeFromStoredSettings(),this._closed?(this._closed=!1,this._thumbDown(!0,!0)):this._adjustToSplitPosition())},toggleSidePanel:function(){this._thumbDown()},
openSidePanel:function(){this._closed||this._thumbDown()},addResizeListener:function(g){this.addEventListener("resize",function(h){g(h.node)})},_initializeFromStoredSettings:function(){var g=localStorage.getItem(this._prefix+"/toggleState");this._closed="string"===typeof g?"closed"===g:this._closeByDefault;var g=m.bounds(this.$node.parentNode),h=m.bounds(this.$node),f;this._vertical?(f=localStorage.getItem(this._prefix+"/yPosition"))?(this._splitTop=parseInt(f,10),this._splitTop>g.top+g.height-h.height&&
(this._splitTop=g.top+g.height/2)):this._closeByDefault&&(this._initialSplit=this._getSplitPosition(),this._splitTop=0):(f=localStorage.getItem(this._prefix+"/xPosition"))?(this._splitLeft=parseInt(f,10),this._splitLeft>g.left+g.width-h.width&&(this._splitLeft=g.left+g.width/2)):this._closeByDefault&&(this._initialSplit=this._getSplitPosition(),this._splitLeft=0)},_getSplitPosition:function(){var g=m.bounds(this.$node),h=m.bounds(this.$node.parentNode);return this.vertical?g.top-h.top:g.left-h.left},
_adjustToSplitPosition:function(g){var h=m.bounds(this.$node),f=m.bounds(this.$node.parentNode);if(this._vertical){this._splitHeight=h.height;if(g||!this._splitTop)this._splitTop=h.top,localStorage.setItem(this._prefix+"/yPosition",this._splitTop);g=this._splitTop;g=this._splitTop-f.top;this.$sideNode.style.height=g+"px";this.$sideNode.style.display="block";this.$node.style.top=g+"px"}else{this._splitWidth=h.width;if(g||!this._splitLeft)this._splitLeft=h.left,localStorage.setItem(this._prefix+"/xPosition",
this._splitLeft);g=this._splitLeft;g=this._splitLeft-f.left;this.$sideNode.style.width=g+"px";this.$sideNode.style.display="block";this.$node.style.left=g+"px"}this._resize()},_resize:function(g,h,f){g=g||0;var d=m.bounds(this.$node.parentNode),a=m.bounds(this.$node);this._vertical?(void 0===f&&(f=a.top-d.top),f+=a.height,this.$mainNode.style.top=f+"px"):(void 0===h&&(h=a.left-d.left),h+=a.width,this.$mainNode.style.left=h+"px");var e=this;window.setTimeout(function(){e._notifyResizeListeners(e.$mainNode);
e._notifyResizeListeners(e.$sideNode)},g)},_notifyResizeListeners:function(g){this.dispatchEvent({type:"resize",node:g})},_notifyToggleListeners:function(){this.dispatchEvent({type:"toggle",closed:this._closed})},_thumbDown:function(g,h){g||this._addAnimation();var f=this._splitTop,d=this._splitLeft;if(this._closed)this._closed=!1,!this._splitLeft&&(!this._splitTop&&"number"===typeof this._initialSplit)&&(f=d=this._initialSplit);else if(this._closed=!0,this._closeReversely){var a=m.bounds(this.$node.parentNode),
e=m.bounds(this.$node);this._vertical?f=a.height-e.height:d=a.width-e.width}else f=d=0;this._vertical?(this.$sideNode.style.height=f+"px",this.$node.style.top=f+"px"):(this.$sideNode.style.width=d+"px",this.$node.style.left=d+"px");this._resize(this._animationDelay,d,f);g||this._removeAnimation();h||localStorage.setItem(this._prefix+"/toggleState",this._closed?"closed":null);var b=this;window.setTimeout(function(){b._notifyToggleListeners()},this._animationDelay)},_removeAnimation:function(){var g=
this;window.setTimeout(function(){g.$sideNode.classList.remove(g._vertical?"sidePanelVerticalLayoutAnimation":"sidePanelLayoutAnimation");g.$mainNode.classList.remove(g._vertical?"mainPanelVerticalLayoutAnimation":"mainPanelLayoutAnimation");g.$node.classList.remove(g._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")},_down:function(){this.$node.classList.add("splitTracking");this.$mainNode.classList.add("panelTracking");this.$sideNode.classList.add("panelTracking")},_move:function(g,h){var f=m.bounds(this.$node.parentNode);if(this._vertical){this._splitTop=h;this._splitTop<f.top+5?this._splitTop=f.top+5:this._splitTop>f.top+f.height-5&&(this._splitTop=f.top+
f.height-5);var d=this._splitTop,d=this._splitTop-f.top;this.$node.style.top=d+"px"}else this._splitLeft=g,this._splitLeft<f.left+5?this._splitLeft=f.left+5:this._splitLeft>f.left+f.width-5&&(this._splitLeft=f.left+f.width-5),d=this._splitLeft,d=this._splitLeft-f.left,this.$node.style.left=d+"px";this._adjustToSplitPosition(!0)},_up:function(){this.$node.classList.remove("splitTracking");this.$mainNode.classList.remove("panelTracking");this.$sideNode.classList.remove("panelTracking")},_mouseDown:function(g){if(g.target===
this._thumb)return m.stop(g),this._thumbDown();this._tracking||(this._down(g),this._tracking=this._mouseMove.bind(this),window.addEventListener("mousemove",this._tracking),m.setFramesEnabled(!1),m.stop(g))},_mouseMove:function(g){this._tracking&&this._move(g.clientX,g.clientY)},_mouseUp:function(g){this._tracking&&(m.setFramesEnabled(!0),window.removeEventListener("mousemove",this._tracking),this._tracking=null,this._up(),m.stop(g))},_touchStart:function(g){if(1===g.touches.length){m.stop(g);if(g.target===
this._thumb)return this._thumbDown();this._down(g);this._touching=!0}},_touchMove:function(g){this._touching&&(g=g.touches,1===g.length&&(g=g[0],this._move(g.clientX,g.clientY)))},_touchEnd:function(g){0===g.touches.length&&(this._touching=!1,this._up())}};k.prototype.constructor=k;return{Splitter:k,ORIENTATION_HORIZONTAL:"horizontal",ORIENTATION_VERTICAL:"vertical"}});
define("orion/keyAssist",["i18n!orion/nls/messages","orion/webui/littlelib","orion/util"],function(l,n,m){function k(g){this.commandRegistry=g.commandRegistry;this.create();this._filterString="";this._providers=[]}k.prototype={addProvider:function(g){this._providers.push(g)},create:function(){var g=this._keyAssistDiv=document.createElement("div");g.id="keyAssist";g.style.display="none";g.classList.add("keyAssistFloat");g.setAttribute("role","menu");var h=this._keyAssistInput=document.createElement("input");
h.classList.add("keyAssistInput");h.type="text";h.placeholder=l["Filter bindings"];g.appendChild(h);var f=this._keyAssistContents=document.createElement("div");f.classList.add("keyAssistContents");if(m.isIOS||m.isAndroid)f.style.overflowY="auto";g.appendChild(f);var d=this._keyAssistTable=document.createElement("table");d.tabIndex=0;d.classList.add("keyAssistList");f.appendChild(d);document.body.appendChild(g);h.addEventListener("keydown",function(a){this._keyDown(a)}.bind(this));d.addEventListener("keydown",
function(a){this._keyDown(a)}.bind(this));h.addEventListener("input",function(a){this.filterChanged()}.bind(this));f.addEventListener(m.isFirefox?"DOMMouseScroll":"mousewheel",function(a){this._scrollWheel(a)}.bind(this));document.addEventListener("keydown",function(a){a.keyCode===n.KEY.ESCAPE&&this.hide()}.bind(this));n.addAutoDismiss([g],function(){this.hide()}.bind(this))},createContents:function(){n.empty(this._keyAssistTable);this._selectedIndex=-1;this._selectedRow=null;for(var g=this._idCount=
this._keyAssistContents.scrollTop=0;g<this._providers.length;g++)this._providers[g].showKeyBindings(this);this.createHeader(l.Global);this.commandRegistry.showKeyBindings(this)},createItem:function(g,h,f){if(this._filterString){var d=this._filterString.toLowerCase(),a;d!==this._filterString?(d=this._filterString,a=function(a){return a}):a=function(a){return a.toLowerCase()};if(-1===a(h).indexOf(d)&&-1===a(g).indexOf(d)&&-1===a(this._lastHeader).indexOf(d))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(h));f=e.insertCell(-1);f.classList.add("keyAssistAccel");f.appendChild(document.createTextNode(g))},createHeader:function(g){this._lastHeader=g;var h=this._keyAssistTable.insertRow(-1);
h.classList.add("keyAssistSection");var h=h.insertCell(-1),f=document.createElement("h2");f.appendChild(document.createTextNode(g));h.appendChild(f)},execute:function(){window.setTimeout(function(){this.hide();var g=this._selectedRow;this._selectedRow=null;g&&g._execute&&g._execute()}.bind(this),0)},filterChanged:function(){this._timeout&&window.clearTimeout(this._timeout);this._timeout=window.setTimeout(function(){this._timeout=null;var g=this._keyAssistInput.value;this._filterString!==g&&(this._filterString=
g,this.createContents())}.bind(this),100)},hide:function(){if(this.isVisible()){var g=document.activeElement,h=this._keyAssistDiv,g=h===g||0!==(h.compareDocumentPosition(g)&16);h.style.display="none";g&&1!==document.compareDocumentPosition(this._previousActiveElement)&&this._previousActiveElement.focus();this._previousActiveElement=null}},isVisible:function(){return"block"===this._keyAssistDiv.style.display},removeProvider:function(g){g=this._providers.indexOf(g);-1!==g&&this._providers.splice(g,
1)},select:function(g){var h=this._keyAssistTable.querySelectorAll(".keyAssistItem");if(0===h.length)this._selectedIndex=-1;else{var f=this._selectedIndex,f=(f+(g?1:-1))%h.length;0>f&&(f=h.length-1);-1!==this._selectedIndex&&(g=h[this._selectedIndex],g.classList.remove("selected"),this._selectedRow=null);this._selectedIndex=f;if(-1!==this._selectedIndex){this._selectedRow=g=h[this._selectedIndex];g.classList.add("selected");this._keyAssistTable.setAttribute("aria-activedescendant",g.id);this._keyAssistTable.focus();
var h=g.getBoundingClientRect(),d=this._keyAssistContents,a=d.getBoundingClientRect();g.offsetTop<d.scrollTop?0===f?d.scrollTop=0:g.scrollIntoView(!0):h.bottom>a.bottom&&g.scrollIntoView(!1)}}},show:function(){this.isVisible()||(this._previousActiveElement=document.activeElement,this.createContents(),this._keyAssistContents.style.height=Math.floor(0.75*this._keyAssistDiv.parentNode.clientHeight)+"px",this._keyAssistDiv.style.display="block",this._keyAssistInput.value=this._filterString,this._keyAssistInput.focus(),
this._keyAssistInput.select())},_keyDown:function(g){if(40===g.keyCode)this.select(!0);else if(38===g.keyCode)this.select(!1);else if(13===g.keyCode)this.execute();else return;g.preventDefault()},_scrollWheel:function(g){var h=0,h=m.isIE||m.isOpera?-g.wheelDelta:m.isFirefox?40*g.detail:-g.wheelDeltaY,f=this._keyAssistContents,d=f.scrollTop;f.scrollTop+=h;if(d!==f.scrollTop)return g.preventDefault&&g.preventDefault(),!1}};return{KeyAssistPanel:k}});
define("orion/widgets/themes/ThemePreferences",[],function(){function l(l,m){this._preferences=l;this._themeData=m;var k=m.getThemeStorageInfo();this._themeVersion=k.version;var g=l.listenForChangedSettings(k.storage,2,function(h){h.key===g&&this.apply()}.bind(this))}l.prototype={_initialize:function(l,m,k){var g,h;void 0===this._themeVersion||k.get("version")===this._themeVersion?(g=k.get(l.styleset),(h=k.get("selected"))&&(h=JSON.parse(h))):h=g=null;g||(g=m.getStyles(),k.put(l.styleset,JSON.stringify(g)));
if(!h||void 0===h[l.selectedKey])h=h||{},h[l.selectedKey]=l.defaultTheme,k.put("selected",JSON.stringify(h));k.put("version",this._themeVersion)},apply:function(){this.setTheme()},getTheme:function(l){var m=this._themeData,k=m.getThemeStorageInfo();this._preferences.getPreferences(k.storage,2).then(function(g){this._initialize(k,m,g);var h=JSON.parse(g.get("selected"));g=JSON.parse(g.get(k.styleset));var f;if(g)for(var d=0;d<g.length;d++)if(g[d].name===h[k.selectedKey]){f=g[d];break}l({style:f,styles:g})}.bind(this))},
setTheme:function(l,m){var k=this._themeData,g=k.getThemeStorageInfo();this._preferences.getPreferences(g.storage,2).then(function(h){this._initialize(g,k,h);var f=JSON.parse(h.get("selected"));l||(l=f[g.selectedKey]);f[g.selectedKey]=l;h.put("selected",JSON.stringify(f));m?h.put(g.styleset,JSON.stringify(m)):m=JSON.parse(h.get(g.styleset));for(var d=0;d<m.length;d++)if(m[d].name===f[g.selectedKey]){k.processSettings(m[d]);break}h.put("version",this._themeVersion)}.bind(this))},setFontSize:function(l){var m=
this._themeData,k=m.getThemeStorageInfo();this._preferences.getPreferences(k.storage,2).then(function(g){this._initialize(k,m,g);var h=JSON.parse(g.get("selected")),f=JSON.parse(g.get(k.styleset)),d;if(f)for(var a=0;a<f.length;a++)f[a].fontSize=l,f[a].name===h[k.selectedKey]&&(d=f[a]);g.put(k.styleset,JSON.stringify(f));m.processSettings(d)}.bind(this))}};return{ThemePreferences:l}});
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",
DeleteUser:"Delete User Profile as well as workspaces and projects",DeleteUserComfirmation:"WARNING: This will permanently delete your user profile as well all your work!","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 \x3cAngle\x3e 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: ",splitEditors:"Split Editors",splitOrientation:"Split Orientation",horizontal:"Horizontal",vertical:"Vertical"});define("orion/settings/nls/messages",["orion/i18n!orion/settings/nls/messages","orion/settings/nls/root/messages"],function(l,n){var m={root:n};Object.keys(l).forEach(function(k){"undefined"===typeof m[k]&&(m[k]=l[k])});return m});
define("orion/editor/eventTarget",[],function(){function l(){}l.addMixin=function(n){var m=l.prototype,k;for(k in m)m.hasOwnProperty(k)&&(n[k]=m[k])};l.prototype={addEventListener:function(l,m,k){this._eventTypes||(this._eventTypes={});var g=this._eventTypes[l];g||(g=this._eventTypes[l]={level:0,listeners:[]});g.listeners.push({listener:m,useCapture:k})},dispatchEvent:function(l){var m=l.type;this._dispatchEvent("pre"+m,l);this._dispatchEvent(m,l);this._dispatchEvent("post"+m,l)},_dispatchEvent:function(l,
m){var k=this._eventTypes?this._eventTypes[l]:null;if(k){var g=k.listeners;try{if(k.level++,g)for(var h=0,f=g.length;h<f;h++)if(g[h]){var d=g[h].listener;"function"===typeof d?d.call(this,m):d.handleEvent&&"function"===typeof d.handleEvent&&d.handleEvent(m)}}finally{if(k.level--,k.compact&&0===k.level){for(h=g.length-1;0<=h;h--)g[h]||g.splice(h,1);0===g.length&&delete this._eventTypes[l];k.compact=!1}}}},isListening:function(l){return!this._eventTypes?!1:void 0!==this._eventTypes[l]},removeEventListener:function(l,
m,k){if(this._eventTypes){var g=this._eventTypes[l];if(g){for(var h=g.listeners,f=0,d=h.length;f<d;f++){var a=h[f];if(a&&a.listener===m&&a.useCapture===k){0!==g.level?(h[f]=null,g.compact=!0):h.splice(f,1);break}}0===h.length&&delete this._eventTypes[l]}}}};return{EventTarget:l}});
define("orion/editor/textTheme",["require","orion/editor/eventTarget","orion/util"],function(l,n,m){function k(g){g=g||{};this._document=g.document||document}var g={};k.getTheme=function(h){h=h||"default";var f=g[h];f||(f=g[h]=new k);return f};k.prototype={getThemeClass:function(){return this._themeClass},setThemeClass:function(g,f){var d=this,a=d._themeClass;d._themeClass=g;this._load(g,f,function(){d.onThemeChanged({type:"ThemeChanged",oldValue:a,newValue:d.getThemeClass()})})},onThemeChanged:function(g){return this.dispatchEvent(g)},
buildStyleSheet:function(g,f){function d(e,b,d){b&&(a.push("."+g+" ."+e+" {"),a.push("\t"+(d?"background-color":"color")+": "+b+";"),a.push("}"))}var a=[];a.push("");a.push("."+g+" {");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("."+g+".textview {");f.background&&a.push("\tbackground-color: "+f.background+";");a.push("}");a.push("."+g+" .textviewLeftRuler {");f.leftRuler&&
a.push("\tborder-right: 1px solid "+f.leftRuler+";");a.push("}");a.push("."+g+" .textviewRightRuler {");f.rightRuler&&a.push("\tborder-left: 1px solid "+f.rightRuler+";");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("constant",f.constant,!1);d("comment",f.comment,!1);d("comment.block.documentation",f.comment,!1);d("keyword.other.documentation.markup",f.comment,!1);d("keyword.other.documentation.markup",f.comment,!1);return a.join("\n")},_createStyle:function(g,f,d,a){var e=this._document;g="orion-theme-"+
g;var b=e.getElementById(g);if(b){if(a||b.firstChild.data===f)return;b.removeChild(b.firstChild);b.appendChild(e.createTextNode(f))}else a?(b=m.createElement(e,"link"),b.rel="stylesheet",b.type="text/css",b.href=f,b.addEventListener("load",function(){d()})):(b=m.createElement(e,"style"),b.appendChild(e.createTextNode(f))),b.id=g,(e.getElementsByTagName("head")[0]||e.documentElement).appendChild(b);a||d()},_load:function(g,f,d){if(g)if("string"===typeof f)this._createStyle(g,f,d);else if(f=f.href,
".css"!==f.substring(f.length-4)&&(f+=".css"),/^\//.test(f)||/[a-zA-Z0-9]+:\/\//i.test(f)||!l.toUrl)this._createStyle(g,f,d,!0);else{var a=this;l(["text!"+f],function(e){a._createStyle(g,e,d,!1)})}else d()}};n.EventTarget.addMixin(k.prototype);return{TextTheme:k}});
define("orion/widgets/themes/ThemeClass",[],function(){function l(l){this.attributes=[];this.element=document.createElement("div");this.style=this.element.style;this.className=l;this.classString="."+l+"{ "}l.prototype.className=null;l.prototype.classString=void 0;l.prototype.style=void 0;l.prototype.closeString=" }\n";l.prototype.toString=function(){return this.classString=this.classString+this.style.cssText+this.closeString};return{ThemeClass:l}});
define("orion/widgets/themes/container/ThemeSheetWriter",["orion/widgets/themes/ThemeClass"],function(l){function n(){}n.prototype.navbar="white";n.prototype.button="#777777";n.prototype.location="#EFEFEF";n.prototype.selection="#cedce7";n.prototype.sidepanel="#F7F7F7";n.prototype.mainpanel="white";n.prototype.navtext="#bfbfbf";n.prototype.content="#3087B3";n.prototype.search="#444";n.prototype.toolpanel="white";n.prototype.writeNavigationStyle=function(){var m="",k=[],g=new l.ThemeClass("orionPage");
g.style.backgroundColor="#fdfdfd";g.style.width="100%";g.style.height="100%";k.push(g);g=new l.ThemeClass("topRowBanner");g.style.margin="0";g.style.border="0";g.style.backgroundColor=this.navbar;g.style.height="16px";g.style.padding="10px";g.style.paddingLeft="6px";g.style.paddingRight="2px";g.style.borderBottom="none";g.style.boxShadow="0 2px 2px 0 rgba(0, 0, 0, 0.1),0 1px 0 0 rgba(0, 0, 0, 0.1)";g.style.zIndex="100";k.push(g);g=new l.ThemeClass("a");g.style.textDecoration="none";g.style.color=
this.content;k.push(g);g=new l.ThemeClass("navlink");g.style.display="inline-block";g.style.padding="2px";g.style.color=this.content;g.style.verticalAlign="bottom";k.push(g);g=new l.ThemeClass("primaryNav");g.style.color=this.navtext;g.style.fontSize="8pt";g.style.fontWeight="normal";g.style.paddingTop="0";g.style.verticalAlign="baseline";k.push(g);g=new l.ThemeClass("primaryNav a");g.style.fontSize="8pt";g.style.color=this.navtext;g.style.marginRight="6px";g.style.marginLeft="6px";g.style.verticalAlign=
"baseline";g.style.textDecoration="none";k.push(g);g=new l.ThemeClass("primaryNav a:hover");g.style.color="#bfbfbf";g.style.cursor="hand";g.style.color="white";g.style.fontWeight="normal";k.push(g);for(var h in k)m+=k[h].toString();return m};n.prototype.writeLocationStyle=function(){var m="",k=[],g=new l.ThemeClass("titleArea");g.style.margin="0";g.style.paddingTop="5px";g.style.border="0";g.style.background=this.location;g.style.background="-webkit-gradient(linear, left top, left bottom, color-stop(0%,"+
this.location+"), color-stop(100%,"+this.location+"))";g.style.borderBottom="1px solid "+this.location;g.style.minHeight="20px";k.push(g);g=new l.ThemeClass("breadcrumb");g.style.fontSize="8pt";g.style.textDecoration="none";g.style.color="#f1f1f2;";g.style.paddingTop="2px";k.push(g);g=new l.ThemeClass("a.breadcrumb:hover");g.style.textDecoration="none";g.style.borderBottom="1px dotted";g.style.color="#F58B0F";g.style.cursor="pointer";k.push(g);g=new l.ThemeClass("breadcrumbSeparator");g.style.fontSize=
"8pt";g.style.textDecoration="none";g.style.color=this.separator;g.style.fontWeight="bold";k.push(g);g=new l.ThemeClass("currentLocation");g.style.fontWeight="bold";g.style.fontSize="8pt";g.style.color=this.breadcrumb;g.style.textDecoration="none";g.style.textWrap="normal";g.style.lineHeight="10pt";k.push(g);g=new l.ThemeClass("a.currentLocation:hover");g.style.fontWeight="bold";g.style.fontSize="10pt";g.style.color="#666666";g.style.textDecoration="none";g.style.borderBottom="0";k.push(g);g=new l.ThemeClass("navlinkonpage");
g.style.color=this.content;g.style.verticalAlign="middle";k.push(g);this.bannerProgress&&(g=new l.ThemeClass("topRowBanner .progressPane_running"),g.style.borderColor=this.bannerProgress,k.push(g));for(var h in k)m+=k[h].toString();return m};n.prototype.writeButtonStyle=function(){var m="",k=[],g=new l.ThemeClass("commandButton");g.style.color="#666";g.style.border="1px solid #dedede";g.style.backgroundColor="#ddd";g.style.textAlign="center";g.style.verticalAlign="middle";g.style.cursor="pointer";
g.style.display="inline-block";g.style.padding="4px 6px";g.style.borderRadius="3px";g.style.lineHeight="12px";g.style.fontSize="9pt";g.style.userSelect="none";k.push(g);g=new l.ThemeClass("commandButton:over");g.style.backgroundColor="#e6e6e6";g.style.border="1px solid #808080";k.push(g);g=new l.ThemeClass("commandMenu");g.style.color="#222";g.style.display="inline-block";g.style.verticalAlign="baseline";g.style.margin="0";g.style.fontSize="8pt";g.style.fontWeight="normal";g.style.border="1px solid #dedede";
g.style.backgroundColor="#efefef";g.style.cursor="pointer";g.style.borderRadius="1px";k.push(g);g=new l.ThemeClass("commandMenuItem");g.style.border="0";g.style.padding="0";g.style.margin="0";k.push(g);for(var h in k)m+=k[h].toString();return m};n.prototype.writeMainStyle=function(){var m="",k=[],g=new l.ThemeClass("searchbox");g.style.backgroundImage="url(../images/core_sprites.png)";g.style.backgroundRepeat="no-repeat";g.style.backgroundPosition="4px -297px";g.style.width="12px";g.style.height=
"12px";g.style.backgroundColor=this.search;g.style.border="1px solid "+this.search;g.style.fontSize="11px";g.style.width="15em";g.style.height="16px";g.style.borderRadius="10px";g.style.color="#999";g.style.padding="0";g.style.paddingLeft="20px";g.style.marginLeft="5px";g.style.marginTop="6px !important";g.style.font="7pt Lucida Sans Unicode,Lucida Grande,Verdana,Arial,Helvetica,Myriad,Tahoma,clean,sans-serif !important";k.push(g);g=new l.ThemeClass("searchbox:focus");g.style.color="white";g.style.outline=
"none";k.push(g);g=new l.ThemeClass("checkedRow");g.style.cssText="background-color:"+this.selection+" !important;";k.push(g);g=new l.ThemeClass("navbar-item-selected");g.style.background=this.selection;g.style.color=this.content;k.push(g);g=new l.ThemeClass("auxpane");g.style.border="0";g.style.background=this.sidepanel;k.push(g);g=new l.ThemeClass("mainpane");g.style.background=this.mainpanel;g.style.border=0;k.push(g);g=new l.ThemeClass("mainToolbar");g.style.background=this.toolpanel;k.push(g);
for(var h in k)m+=k[h].toString();return m};n.prototype.render=function(l){console.log(this.writeNavigationStyle());console.log(this.writeLocationStyle());console.log(this.writeMainStyle());console.log(this.writeButtonStyle())};n.prototype.getSheet=function(l){l.navbar.value?(this.navbar=l.navbar.value,this.button=l.button.value,this.location=l.location.value,this.selection=l.selection.value,this.sidepanel=l.sidepanel.value,this.mainpanel=l.mainpanel.value,this.navtext=l.navtext.value,this.search=
l.search.value,this.content=l.content.value,this.toolpanel=l.toolpanel.value,this.bannerProgress=l.bannerProgress.value):(this.navbar=l.navbar,this.button=l.button,this.location=l.location,this.selection=l.selection,this.sidepanel=l.sidepanel,this.mainpanel=l.mainpanel,this.navtext=l.navtext,this.search=l.search,this.content=l.content,this.toolpanel=l.toolpanel,this.bannerProgress=l.bannerProgress);return this.writeNavigationStyle()+this.writeLocationStyle()+this.writeMainStyle()+this.writeButtonStyle()};
return{ThemeSheetWriter:n}});define("orion/widgets/themes/ThemeVersion",[],function(){return"6.1"});
define("orion/widgets/themes/container/ThemeData",["i18n!orion/settings/nls/messages","orion/editor/textTheme","orion/widgets/themes/container/ThemeSheetWriter","orion/widgets/themes/ThemeVersion"],function(l,n,m,k){function g(){}function h(){this.styles=[];var d=new g;d.name="Orion";d.navbar="white";d.button="#EFEFEF";d.location="#efefef";d.selection="FEC";d.sidepanel="#FBFBFB";d.mainpanel="white";d.toolpanel="white";d.navtext="#bfbfbf";d.content="#3087B3";d.search="#444";d.breadcrumb="#3087B3";
d.separator="#333";d.bannerProgress="whitesmoke";this.styles.push(d);d=new g;d.name="Orion2014";d.navbar="white";d.button="#EFEFEF";d.location="#EFEFEF";d.selection="FEC";d.sidepanel="#EEEEEE";d.mainpanel="#EEEEEE";d.toolpanel="#EEEEEE";d.navtext="#BFBFBF";d.content="#333333";d.search="#444444";d.breadcrumb="#333333";d.separator="#333333";d.bannerProgress="orange";this.styles.push(d);d=new g;d.name="Green Zone";d.navbar="seagreen";d.button="lavender";d.location="darkseagreen";d.selection="moccasin";
d.sidepanel="aliceblue";d.mainpanel="white";d.toolpanel="white";d.navtext="#FBFBFB";d.content="darkgreen";d.search="darkgreen";d.breadcrumb="#3087B3";d.separator="seagreen";d.bannerProgress="#F2F2F2";this.styles.push(d);d=new g;d.name="Pretty In Pink";d.navbar="plum";d.button="lavender";d.location="pink";d.selection="lavender";d.sidepanel="seashell";d.mainpanel="white";d.toolpanel="white";d.navtext="#FBFBFB";d.content="mediumorchid";d.search="violet";d.breadcrumb="#3087B3";d.separator="plum";d.bannerProgress=
"#F2F2F2";this.styles.push(d);d=new g;d.name="Blue Monday";d.navbar="cornflowerblue";d.button="lavender";d.location="skyblue";d.selection="lavender";d.sidepanel="aliceblue";d.mainpanel="white";d.toolpanel="white";d.navtext="#FBFBFB";d.content="royalblue";d.search="royalblue";d.breadcrumb="#3087B3";d.separator="cornflowerblue";d.bannerProgress="#F2F2F2";this.styles.push(d);d=new g;d.name="Vanilla Skies";d.navbar="sandybrown";d.button="lemmonchiffon";d.location="cornsilk";d.selection="lemonchiffon";
d.sidepanel="white";d.mainpanel="white";d.toolpanel="white";d.navtext="lemonchiffon";d.content="chocolate";d.search="moccasin";d.breadcrumb="#3087B3";d.separator="sandybrown";d.bannerProgress="#F2F2F2";this.styles.push(d);d=new g;d.name="Beetlejuice";d.navbar="indigo";d.button="slateblue";d.location="darkslateblue";d.selection="silver";d.sidepanel="lavender";d.mainpanel="white";d.toolpanel="white";d.navtext="#FBFBFB";d.content="mediumslateblue";d.search="#444";d.breadcrumb="#3087B3";d.separator="indigo";
d.bannerProgress="#F2F2F2";this.styles.push(d);d=new g;d.name="Red";d.navbar="#CD2127";d.button="#777777";d.location="#D85F56";d.selection="lightcoral";d.sidepanel="#EFDAB2";d.mainpanel="#FDFADD";d.toolpanel="#FDFADD";d.navtext="#FBFBFB";d.content="darkred";d.search="#D85F56";d.breadcrumb="darkred";d.separator="#CD2127";d.bannerProgress="#F2F2F2";this.styles.push(d)}function f(){return this.styles}g.prototype.name="Orion";g.prototype.navbar="#404648";g.prototype.button="#EFEFEF";g.prototype.location=
"#333";g.prototype.breadcrumb="#3087B3";g.prototype.separator="#333";g.prototype.selection="FEC";g.prototype.sidepanel="#FBFBFB";g.prototype.mainpanel="white";g.prototype.toolpanel="white";g.prototype.navtext="#bfbfbf";g.prototype.content="#3087B3";g.prototype.search="#444";g.prototype.bannerProgress="white";h.prototype.styles=[];h.prototype.getStyles=f;h.prototype.getThemeStorageInfo=function(){return{storage:"/themes",styleset:"styles",defaultTheme:"Orion2014",selectedKey:"selected",version:k}};
h.prototype.getViewData=function(){var d={top:10,left:10,width:350,height:350};d.shapes=[{type:"RECTANGLE",name:l["Navigation Bar"],x:10,y:10,width:350,height:32,family:"navbar",fill:"#333",order:1},{type:"TEXT",name:l["Navigation Text"],label:"UserName",x:290,y:30,family:"navtext",fill:"#bfbfbf",font:"8pt sans-serif"},{type:"ROUNDRECTANGLE",name:l["Search Box"],x:215,y:20,width:70,height:12,family:"search",fill:"#444",order:3},{type:"RECTANGLE",name:l["Tool Panel"],x:150,y:71,width:209,height:30,
family:"toolpanel",fill:"white",order:4},{type:"RECTANGLE",name:l["Selection Bar"],x:155,y:133,width:200,height:20,family:"selection",fill:"#FEC",order:7},{type:"RECTANGLE",name:l.Location,x:10,y:42,width:350,height:29,family:"location",fill:"#efefef",order:8},{type:"TEXT",name:l["Navigation Text"],label:"Navigator",x:60,y:30,family:"navtext",fill:"#bfbfbf",font:"8pt sans-serif",order:2},{type:"TEXT",name:l.Content,label:"Breadcrumb",x:15,y:60,family:"content",fill:"#3087B3",font:"8pt sans-serif"},
{type:"TEXT",name:l.Content,label:"/",x:78,y:60,family:"content",fill:"#3087B3",font:"8pt sans-serif",order:9},{type:"TEXT",name:l.Content,label:"Location",x:84,y:60,family:"content",fill:"#3087B3",font:"8pt sans-serif"},{type:"RECTANGLE",name:l["Main Panel"],x:150,y:101,width:209,height:258,family:"mainpanel",fill:"white",order:6},{type:"ROUNDRECTANGLE",name:l.Button,x:155,y:76,width:37,height:20,family:"button",fill:"#EFEFEF",order:11},{type:"TEXT",name:l["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:l["Section Text"],label:"Section",x:30,y:94,family:"navbar",fill:"#333",font:"8pt sans-serif"},{type:"LINE",name:l["Line Color"],x1:150,y1:101,x2:360,y2:101,linewidth:2,fill:"#DEDEDE"},{type:"LINE",name:l["Line Color"],x1:150,
y1:71,x2:150,y2:360,linewidth:2,fill:"#DEDEDE"},{type:"LINE",name:l["Line Color"],x1:20,y1:100,x2:140,y2:100,linewidth:2,fill:"#DEDEDE"},{type:"RECTANGLE",name:l["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:l["Navigation Text"],label:"Navigator",
x:60,y:30,family:"navtext",fill:"#bfbfbf",font:"8pt sans-serif",order:2},{type:"TRIANGLE",name:"userMenu",x1:353,y1:24,x2:347,y2:24,x3:350,y3:29,family:"userMenu",fill:"#BFBFBF"},{type:"TRIANGLE",name:"userMenu",x1:20,y1:88,x2:26,y2:88,x3:23,y3:93,family:"userMenu",fill:"#BFBFBF"}];for(var a=0;3>a;a++)d.shapes.push({type:"TEXT",name:l.Content,label:"org.eclipse.orion.content",x:170,y:127+20*a,fill:"#3087B3",family:"content"});for(a=0;3>a;a++)d.shapes.push({type:"TEXT",name:l.Content,label:"Item",
x:25,y:115+20*a,fill:"#3087B3",family:"content"});for(a=0;3>a;a++)d.shapes.push({type:"TRIANGLE",name:"twisty",x1:160,y1:121+20*a,x2:165,y2:124+20*a,x3:160,y3:127+20*a,family:"navbar",fill:"#333"});d.shapes.push({type:"IMAGE",name:"logo",x:15,y:18,source:"../../images/orion-transparent.png",family:"logo"});return d};h.prototype.processSettings=function(d){var a=new m.ThemeSheetWriter;(new n.TextTheme.getTheme("orionTheme")).setThemeClass("orionTheme",a.getSheet(d))};return{ThemeData:h,getStyles:f}});
define("orion/widgets/nls/root/messages",{"no input":"no input","no output":"no output","Choose a Folder":"Choose a Folder",OK:"OK",Profile:"Profile","Sign out":"Sign out","N/A":"N/A","logged in since ":"logged in since ","Sign in":"Sign in","Authentication required!":"Authentication required!","Name:":"Name:","Plug-ins":"Plug-ins"," \x3cNo available services or timed out, check URL and try reloading\x3e":" \x3cNo available services or timed out, check URL and try reloading\x3e",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 (? \x3d any character, * \x3d any string):":"Type the name of a file to open (? \x3d any character, * \x3d 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 ","\x3c/a\x3e":"\x3c/a\x3e","\x3e":"\x3e","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",Yes:"Yes",No:"No","Click or use delete key to delete the search term":"Click or use delete key to delete the search term"});
define("orion/widgets/nls/messages",["orion/i18n!orion/widgets/nls/messages","orion/widgets/nls/root/messages"],function(l,n){var m={root:n};Object.keys(l).forEach(function(k){"undefined"===typeof m[k]&&(m[k]=l[k])});return m});
define("orion/widgets/userAssistance/UATaskPanel",["orion/webui/littlelib"],function(l){function n(m,k,g){this.elements=g;this.taskPanel=document.createElement("div");this.taskPanel.className="UAContainer";this.taskPanel.innerHTML='\x3cheader class\x3d"UAHeader"\x3eDevelop software from within the cloud\x3c/header\x3e';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);!0===k?(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),l.addAutoDismiss([this.container],this.destroy.bind(this))):m.appendChild(this.taskPanel);this.chosenSwitch=this.createSwitch(null,!0);this.chosenSwitch.firstChild.className="chosenCircle";this.initialize();this.elements.forEach(this.createSwitch.bind(this))}n.prototype.elementNode=null;n.prototype.switchesContainer=null;n.prototype.switches=null;n.prototype.radioButtons=null;n.prototype.chosenSwitch=
null;n.prototype.addElement=function(l){var k=document.createElement("span");k.className="UAContainer-icon";k.innerHTML='\x3cspan class\x3d"workingSpan"\x3e\x3cimg src\x3d"'+l.image+'" id\x3d"'+l.label+'ImageNode" alt\x3d"'+l.alt+'" height\x3d"64" width\x3d"64"\x3e\x3c/span\x3e\x3cspan class\x3d"UAIcon-label"\x3e\x3cspan class\x3d"UALabel" id\x3d"'+l.label+'LabelNode" \x3e'+l.label+"\x3c/span\x3e\x3c/span\x3e";k.onmouseover=function(){document.getElementById(l.label+"ImageNode").src=l.secondaryImage;
document.getElementById(l.label+"LabelNode").className="UALabel-live";k.className="UAContainer-icon-live"};k.onmouseout=function(){document.getElementById(l.label+"ImageNode").src=l.image;document.getElementById(l.label+"LabelNode").className="UALabel";k.className="UAContainer-icon"};var g=this;k.onclick=function(){g.showMedia(l)};this.elementNode.appendChild(k)};n.prototype.clearElements=function(){this.elementNode.innerHTML=""};n.prototype.showMedia=function(l){this.clearElements();this.addElement(l);
var k=document.createElement("span");k.className="UAContainer-media";k.innerHTML='\x3cdiv\x3e\x3c/div\x3e\x3cdiv\x3e\x3c/div\x3e\x3cspan class\x3d"mediaSpan"\x3e\x3cimg src\x3d"'+l.media+'" alt\x3d"'+l.alt+'" height\x3d"300" width\x3d"400"\x3e\x3c/span\x3e';this.elementNode.appendChild(k);setTimeout(function(){k.style.opacity=1},100);l=document.getElementById(l.label+"switch");this.chosenSwitch.firstChild.className="circle";this.chosenSwitch=l.parentNode;l.className="chosenCircle"};n.prototype.createSwitch=
function(l){var k;k=l?l.label+"switch":"indexSwitch";var g=document.createElement("span");g.className="workingSpan";g.innerHTML='\x3cdiv class\x3d"circle" id \x3d"'+k+'"\x3e\x3c/div\x3e';var h=this;g.onclick=l?function(){h.showMedia(l)}:function(){h.initialize();h.chosenSwitch.firstChild.className="circle";h.chosenSwitch=g;h.chosenSwitch.firstChild.className="chosenCircle"};this.switches.appendChild(g);return this.radioButtons[this.radioButtons.length]=g};n.prototype.initialize=function(){this.clearElements();
this.elements.forEach(this.addElement.bind(this))};n.prototype.destroy=function(){document.body.removeChild(this.backdrop);document.body.removeChild(this.container)};return n});
define("orion/webui/dialog",["i18n!orion/widgets/nls/messages","require","orion/webui/littlelib","orion/uiUtils"],function(l,n,m,k){function g(){}var h=null;g.prototype={DISABLED:"disabled",CONTAINERTEMPLATE:'\x3cdiv class\x3d"dialog" role\x3d"dialog"\x3e\x3cdiv class\x3d"dialogTitle"\x3e\x3cspan id\x3d"title" class\x3d"dialogTitleText layoutLeft"\x3e\x3c/span\x3e\x3cbutton aria-label\x3d"Close" class\x3d"dismissButton layoutRight core-sprite-close imageSprite" id\x3d"closeDialog"\x3e\x3c/button\x3e\x3c/div\x3e\x3cdiv id\x3d"dialogContent" class\x3d"dialogContent layoutBlock"\x3e\x3c/div\x3e\x3cdiv id\x3d"buttons" class\x3d"dialogButtons"\x3e\x3c/div\x3e\x3c/div\x3e',_initialize:function(){var f=
document.body;this.$frameParent=f;this.$$modalExclusions=this.$$modalExclusions||[];var d=document.createRange();d.selectNode(f);d=d.createContextualFragment(this.CONTAINERTEMPLATE);f.appendChild(d);this.$frame=f.lastChild;this.title&&m.$("#title",this.$frame).appendChild(document.createTextNode(this.title));this.$close=m.$("#closeDialog",this.$frame);var a=this;this.$close.addEventListener("click",function(e){a.hide()},!1);this.$parent=m.$(".dialogContent",this.$frame);d=document.createRange();d.selectNode(this.$parent);
f=d.createContextualFragment(this.TEMPLATE);this.messages&&m.processTextNodes(f,this.messages);this.$parent.appendChild(f);this.$buttonContainer=m.$(".dialogButtons",this.$frame);this._makeButtons();this.$frame.addEventListener("keydown",function(e){e.keyCode===m.KEY.ESCAPE?a.hide():e.keyCode===m.KEY.ENTER&&"function"===typeof a._defaultCallback&&a._defaultCallback()},!1);this._bindElements(this.$parent);"function"===typeof this._bindToDom&&this._bindToDom(this.$parent)},_makeButtons:function(){if(this.$buttonContainer&&
Array.isArray(this.buttons)){var f=this;this.buttons.forEach(function(d){var a=k.createButton(d.text,d.callback);d.id&&(a.id=d.id,f["$"+a.id]=a);d.isDefault&&(f._defaultCallback=d.callback,f._defaultButton=a);f.$buttonContainer.appendChild(a)})}},_makeModal:function(f){var d=this;this.$frame.addEventListener("blur",function(a){d.$lastFocusedElement=a.target},!0);this._modalListener=function(a){var b=!m.contains(d.$frame,a.target);if(b)for(var e=0;e<d.$$modalExclusions.length;e++)if(m.contains(d.$$modalExclusions[e],
a.target)){b=!1;break}b&&(window.setTimeout(function(){(d.$lastFocusedElement||d.$parent).focus()},0),m.stop(a))};this.$frameParent.addEventListener("focus",this._modalListener,!0);this.$frameParent.addEventListener("click",this._modalListener,!0);f=this.$frameParent.childNodes;var a=!1;this._addedBackdrop=[];for(var e=0;e<f.length;e++){for(var b=0;b<this.$$modalExclusions.length;b++)if(m.contains(this.$$modalExclusions[b],f[e])){a=!0;break}!a&&(f[e]!==d.$frame&&f[e].classList&&!f[e].classList.contains("tooltipContainer"))&&
(b=f[e],b.classList.contains("modalBackdrop")||(b.classList.add("modalBackdrop"),this._addedBackdrop.push(b)))}(f=m.lastTabbable(this.$buttonContainer)||m.lastTabbable(this.$parent))&&f.addEventListener("keydown",function(a){if(a.keyCode===m.KEY.TAB){var b=d._getFirstFocusField();b&&b!==a.target&&b.focus();m.stop(a)}},!1)},_addChildDialog:function(f){this.$$modalExclusions.push(f.$frame||f.$parent)},_inModalExclusion:function(f){return this.$$modalExclusions.some(function(d){return f.$frame===d||
f.$parent===d})},_bindElements:function(f){for(var d=0;d<f.childNodes.length;d++){var a=f.childNodes[d];a.id&&(this["$"+a.id]=a);this._bindElements(a)}},hide:function(f){!f&&h===this&&(h=null);"function"===typeof this._beforeHiding&&this._beforeHiding();this._modalListener&&(this.$frameParent.removeEventListener("focus",this._modalListener,!0),this.$frameParent.removeEventListener("click",this._modalListener,!0));this.$frame.classList.remove("dialogShowing");m.setFramesEnabled(!0);"function"===typeof this._afterHiding&&
this._afterHiding();var d=this;this.keepAlive||window.setTimeout(function(){d.destroy()},0)},show:function(f){if(this.modal)if(this._makeModal(),h){if(!h._inModalExclusion(this)){this.hide(!0);return}}else h=this;"function"===typeof this._beforeShowing&&this._beforeShowing();m.setFramesEnabled(!1);var d=m.bounds(this.$frame),a=m.bounds(document.documentElement),e;f?(e=m.bounds(f),f=e.top+e.height+4,e=e.left+4,f+d.height>a.height&&(f=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),f=Math.max(0,(a.height-d.height)/2));this.$lastFocusedElement=document.activeElement;this.$frame.style.top=f+"px";this.$frame.style.left=e+"px";this.$frame.classList.add("dialogShowing");"function"===typeof this._afterShowing&&this._afterShowing();this.customFocus||this._getFirstFocusField().focus()},_getFirstFocusField:function(){return m.firstTabbable(this.$parent)||this._defaultButton||m.firstTabbable(this.$buttonContainer)||this.$close},
destroy:function(){this.$frame&&(h===this&&(h=null),m.setFramesEnabled(!0),this._addedBackdrop&&0<this._addedBackdrop.length&&this._addedBackdrop.forEach(function(f){f.classList.remove("modalBackdrop")}),this.$frameParent.removeEventListener("focus",this._modalListener,!0),this.$frameParent.removeEventListener("click",this._modalListener,!0),this.$frameParent.removeChild(this.$frame),this.$parent=this.$frame=void 0)}};g.prototype.constructor=g;return{Dialog:g}});
define("orion/widgets/UserMenu","i18n!orion/widgets/nls/messages require orion/webui/littlelib orion/PageLinks orion/widgets/userAssistance/UATaskPanel orion/webui/dialog orion/webui/dropdown".split(" "),function(l,n,m,k,g,h,f){function d(a){this._displaySignOut=!0;this._init(a)}d.prototype={_init:function(a){this._dropdownNode=m.node(a.dropdownNode);if(!this._dropdownNode)throw"no dom node for dropdown found";this._dropdown=a.dropdown;this._serviceRegistry=a.serviceRegistry;this.authenticatedServices=
{};this.unauthenticatedServices={};this._noSeparator=a.noSeparator;this._dropDownItemClass=a.dropDownItemClass;this._keyAssistClass=a.keyAssistClass;void 0!==a.signOut&&(this._displaySignOut=a.signOut)},isSingleService:function(){return 1===this.length(this.unauthenticatedServices)+this.length(this.authenticatedServices)},hasServices:function(){return 0<this.length(this.unauthenticatedServices)+this.length(this.authenticatedServices)},length:function(a){var e=0,b;for(b in a)a.hasOwnProperty(b)&&e++;
return e},_makeMenuItem:function(a,e){var b=f.createMenuItem(a).firstElementChild;"string"===typeof this._dropDownItemClass&&""!==this._dropDownItemClass&&b.classList.add(this._dropDownItemClass);b.addEventListener("click",e,!1);b.addEventListener("keydown",function(a){(a.keyCode===m.KEY.ENTER||a.keyCode===m.KEY.SPACE)&&e()},!1);return b},_renderAuthenticatedService:function(a,e){var b=this,d=this.authenticatedServices[a].authService;if(d&&d.logout&&this._displaySignOut){var f=this._makeMenuItem(l["Sign Out"],
function(){d.logout().then(function(){b.addUserItem(a,d,b.authenticatedServices[a].label);localStorage.removeItem(a);localStorage.removeItem("lastLogin");for(var e=localStorage.length-1;0<=e;e--){var f=localStorage.key(e);f&&0===f.indexOf("/orion/preferences/user")&&localStorage.removeItem(f)}d.getAuthForm(window.location.href).then(function(a){window.location=a})})});this._dropdownNode.appendChild(f.parentNode)}},renderServices:function(){function a(a){b[a]||(b[a]=e.createDocumentFragment());return b[a]}
var e=document,b=[],d=this._serviceRegistry;k.getPageLinksInfo(d,"orion.page.link.user").then(function(g){this._dropdown?this._dropdown.empty():this._dropdownNode&&m.empty(this._dropdownNode);g.getAllLinks().forEach(function(b){var d,f;if(b.category&&(f=/user\.(\d+)/.exec(b.category)))d=parseInt(f[1],10);if("number"!==typeof d||isNaN(d))d=1;d=a(d);f=e.createElement("li");var p=e.createElement("a");p.role="menuitem";"string"===typeof this._dropDownItemClass?""!==this._dropDownItemClass&&p.classList.add(this._dropDownItemClass):
p.classList.add("dropdownMenuItem");p.href=b.href;p.textContent=b.textContent;f.appendChild(p);d.appendChild(f);p.addEventListener("keydown",function(a){(a.keyCode===m.KEY.ENTER||a.keyCode===m.KEY.SPACE)&&p.click()},!1)}.bind(this));this.keyAssistFunction&&(g=this._makeMenuItem(l["Keyboard Shortcuts"],this.keyAssistFunction),"string"===typeof this._keyAssistClass?""!==this._keyAssistClass&&g.classList.add(this._keyAssistClass):g.classList.add("key-assist-menuitem"),g=g.parentNode,a(0).appendChild(g));
if(g=d.getServiceReferences("orion.page.getstarted")[0])g=g.getProperty("data"),g=this._makeMenuItem("Getting Started",this.getStartedDialog.bind(this,g)).parentNode,a(0).appendChild(g);var h=this;b.sort(function(a,b){return a-b}).forEach(function(a,e){if(e<b.length-1&&!this._noSeparator){var d=f.createSeparator();a.appendChild(d)}h._dropdownNode.appendChild(a)}.bind(this));if(this.isSingleService())for(var k in this.authenticatedServices)this.authenticatedServices.hasOwnProperty(k)&&this._renderAuthenticatedService(k,
0)}.bind(this))},getStartedDialog:function(a){new g(null,!0,a)},setKeyAssist:function(a){this.keyAssistFunction=a;this.renderServices()},addUserItem:function(a,e,b,d){d?(this.unauthenticatedServices[a]&&delete this.unauthenticatedServices[a],this.authenticatedServices[a]={authService:e,label:b,data:d}):(this.authenticatedServices[a]&&delete this.authenticatedServices[a],this.unauthenticatedServices[a]=this.unauthenticatedServices[a]?{authService:e,label:b,pending:this.unauthenticatedServices[a].pending}:
{authService:e,label:b});this.renderServices()}};d.prototype.constructor=d;return{UserMenu:d}});
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(l,n){var m={root:n};Object.keys(l).forEach(function(k){"undefined"===typeof m[k]&&(m[k]=l[k])});return m});
define("orion/searchUtils","i18n!orion/nls/messages require orion/regex orion/commandRegistry orion/PageUtil orion/URITemplate".split(" "),function(l,n,m,k,g,h){function f(a,e,b){var d="";b&&(d="^");if(d=m.parse("/"+d+a.searchStr+"/"))b=d.pattern,d=d.flags,-1===d.indexOf("i")&&!e.caseSensitive&&(d+="i"),a.regExp={pattern:b,flags:d},a.wildCard=!0}var d={ALL_FILE_TYPE:"*.*",doSearch:function(a,e,b,f){a?(e=b,b=!0,"*"===e&&(e=""),""===e&&(b=f&&f.type!==d.ALL_FILE_TYPE),b&&(a=a.createSearchParams(e,!1,
!1,f),a=d.generateSearchHref(a),window.location=a)):window.alert(l["Can't search: no search service is available"])},generateSearchHelper:function(a,e){var b=a.keyword,p=b,g={};a.fileType&&(a.fileType!==d.ALL_FILE_TYPE&&""===b)&&(p="*."+a.fileType);if(a.regEx)g.searchStr=b,f(g,a,e);else{var h=-1<b.indexOf("*"),k=-1<b.indexOf("?");h&&(b=b.split("*").join(".*"));k&&(b=b.split("?").join("."));!h&&!k&&!a.nameSearch?(g.searchStr=a.caseSensitive?b.split("\\").join(""):b.split("\\").join("").toLowerCase(),
g.wildCard=!1):(g.searchStr=a.caseSensitive?b:b.toLowerCase(),f(g,a,e),g.wildCard=!0)}g.searchStrLength=g.searchStr.length;return{params:a,inFileQuery:g,displayedSearchTerm:p}},convertSearchParams:function(a){void 0!==a.rows&&(a.rows=parseInt(a.rows,10));void 0!==a.start&&(a.start=parseInt(a.start,10));"string"===typeof a.regEx&&(a.regEx="true"===a.regEx.toLowerCase());"string"===typeof a.caseSensitive&&(a.caseSensitive="true"===a.caseSensitive.toLowerCase());"string"===typeof a.nameSearch&&(a.nameSearch=
"true"===a.nameSearch.toLowerCase());void 0!==a.fileNamePatterns&&(a.fileNamePatterns=d.getFileNamePatternsArray(a.fileNamePatterns))},getFileNamePatternsArray:function(a){var e=void 0;a&&(a=a.trim(),a=a.replace(/^(\s*,\s*)+/g,""),a=a.replace(/([^\\]),(\s*,\s*)*/g,"$1/"),a=a.replace(/(\s*\/\s*)/g,"/"),a=a.replace(/\/\/+/g,"/"),a=a.replace(/\/+$/g,""),e=a.split("/"));return e},copySearchParams:function(a,e){var b={},d;for(d in a)if(void 0!==a[d]&&null!==a[d]&&(e||"replace"!==d))b[d]=a[d];return b},
generateSearchHref:function(a){var e=n.toUrl("search/search.html");a=d.copySearchParams(a,!0);var b=a.resource;a.resource=void 0;return"undefined"!==typeof a.keyword?(new h(e+"#{,resource,params*}")).expand({resource:b,params:a}):(new h(e+"#{,resource}")).expand({resource:b})},generateFindURLBinding:function(a,e,b,d,f){a={find:e.searchStr,regEx:e.wildCard?!0:void 0,caseSensitive:a.caseSensitive?!0:void 0,replaceWith:"string"===typeof d?d:void 0,atLine:"number"===typeof b?b:void 0};return f?a:","+
(new h("{,params*}")).expand({params:a})},convertFindURLBinding:function(a){"string"===typeof a.regEx&&(a.regEx="true"===a.regEx.toLowerCase());"string"===typeof a.caseSensitive&&(a.caseSensitive="true"===a.caseSensitive.toLowerCase());"string"===typeof a.atLine&&(a.atLine=parseInt(a.atLine,10))},replaceRegEx:function(a,e,b){return a.replace(RegExp(e.pattern,e.flags),b)},replaceStringLiteral:function(a,e,b){e=m.parse("/"+e+"/gim");return d.replaceRegEx(a,e,b)},searchOnelineLiteral:function(a,e,b){var d;
d=0;for(var f=!1,g=[];!(d=e.indexOf(a.searchStr,d),0>d);){g.push({startIndex:d,length:a.searchStrLength});f=!0;if(b)break;d+=a.searchStrLength}return f?g:null},findRegExp:function(a,e,b,d){if(!e)return null;b=b||"";b+=(-1===b.indexOf("g")?"g":"")+(-1===b.indexOf("m")?"m":"");var f=null;return(f=RegExp(e,b).exec(a.substring(d)))&&{startIndex:f.index+d,length:f[0].length}},searchOnelineRegEx:function(a,e,b){for(var f=0,g=!1,h=[];;)if(f=d.findRegExp(e,a.regExp.pattern,a.regExp.flags,f)){h.push(f);g=
!0;if(b)break;f=f.startIndex+f.length}else break;return g?h:null},generateNewContents:function(a,e,b,f,g,h){if(f&&e){a||(b.contents=[]);for(var k=0;k<e.length;k++){for(var l=e[k],m=!1,n=!1,r=[],t,z=0,B=0;B<f.children.length;B++)if(f.children[B].lineNumber-1===k){z=B;for(m=0;m<f.children[B].matches.length;m++)!1!==f.children[B+m].checked&&r.push(m);n=0<r.length;t=f.children[B].matches;m=!0;break}if(m){if(n){r=d.replaceCheckedMatches(l,g,t,r,h);l=r.replacedStr;for(m=0;m<f.children[z].matches.length;m++)f.children[z+
m].newMatches=r.newMatches}else for(m=0;m<f.children[z].matches.length;m++)f.children[z+m].newMatches=f.children[z+m].matches;a?b.contents[k]=l:b.contents.push(l)}else a||b.contents.push(l)}}},generateMatchContext:function(a,e,b){var d=[],f=2*a+1,g;e.length<=f?(g=0,a=e.length-1):(g=b-a,0>g?(g=0,a=g+f-1):(a=b+a,a>e.length-1&&(a=e.length-1,g=a-f+1)));for(f=g;f<=a;f++)d.push({context:e[f],current:f===b});return d},splitFile:function(a){for(var e=0,b=0,d=0,f=0,g=[];;){-1!==e&&e<=d&&(e=a.indexOf("\r",
d));-1!==b&&b<=d&&(b=a.indexOf("\n",d));if(-1===b&&-1===e){g.push(a.substring(f));break}var h=1;-1!==e&&-1!==b?e+1===b?(h=2,d=b+1):d=(e<b?e:b)+1:d=-1!==e?e+1:b+1;g.push(a.substring(f,d-h));f=d}return g},searchWithinFile:function(a,e,b,f,g,h){b=d.splitFile(b);g&&(e.contents=b);if(e){e.children=[];for(var k=f=0;k<b.length;k++){var l=b[k];if(l&&0<l.length){var m=h?l:l.toLowerCase();if(m=a.wildCard?d.searchOnelineRegEx(a,m):d.searchOnelineLiteral(a,m)){var n,r=k+1;if(g)for(var t=0;t<m.length;t++)n=t+
1,n={parent:e,checked:e.checked,type:"detail",matches:m,lineNumber:r,matchNumber:n,name:l,location:e.location+"-"+r+"-"+n},e.children.push(n);else n={parent:e,context:d.generateMatchContext(2,b,k),checked:e.checked,type:"detail",matches:m,lineNumber:r,name:l,location:e.location+"-"+r},e.children.push(n);f+=m.length}}}e.totalMatches=f}},replaceCheckedMatches:function(a,e,b,d,f){for(var g=0,h="",k=[],l=0;l<b.length;l++){g!==b[l].startIndex&&(h+=a.substring(g,b[l].startIndex));b[l].length&&(f=b[l].length);
for(var g=!1,m=0;m<d.length;m++)if(d[m]===l){g=!0;break}g?(k.push({startIndex:h.length,length:e.length}),h+=e):(k.push({startIndex:h.length,length:f}),h+=a.substring(b[l].startIndex,b[l].startIndex+f));g=b[l].startIndex+f}g<a.length&&(h+=a.substring(g));return{replacedStr:h,newMatches:k}},fullPathNameByMeta:function(a){var e=a.length,b="";if(0<e)for(e-=1;-1<e;e--)b=b+(""===b?"":"/")+a[e].Name;return b},path2FolderName:function(a,e,b){return a.substring(0,a.length-e.length-(b?0:1))},getOpenSearchPref:function(a,
e){a.getService("orion.core.preference").getPreferences("/cm/configurations").then(function(a){a=a.get("nav.config");e(a&&"undefined"!==a["links.newtab"]?a["links.newtab"]?!0:!1:!1)})},setOpenSearchPref:function(a,e){a.getService("orion.core.preference").getPreferences("/window/favorites").then(function(a){a.put("openSearchPref",{openInNewTab:e})})}};return d});
define("orion/crawler/searchCrawler","i18n!orion/crawler/nls/messages require orion/i18nUtil orion/searchUtils orion/contentTypes orion/Deferred".split(" "),function(l,n,m,k,g,h){function f(d,a,e,b){this.registry=d;this.fileClient=a;this.fileLocations=[];this.fileSkeleton=[];this._totalCounter=this._hitCounter=0;this._searchOnName=b&&b.searchOnName;this._buildSkeletonOnly=b&&b.buildSkeletonOnly;this._fetchChildrenCallBack=b&&b.fetchChildrenCallBack;this._searchParams=e;this.searchHelper=this._searchOnName||
this._buildSkeletonOnly?null:k.generateSearchHelper(e);this._location=b&&b.location;this._childrenLocation=b&&b.childrenLocation?b.childrenLocation:this._location;this._reportOnCancel=b&&b.reportOnCancel;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(d){var a=
this.registry.getService("orion.core.contentTypeRegistry");this._onSearchComplete=d;this._cancelled=!1;this._deferredArray=[];a.getContentTypes().then(function(a){this.contentTypesCache=a;var b=this;this._visitRecursively(this._childrenLocation).then(function(){(!b._cancelled||b._reportOnCancel)&&b._reportResult();b._cancelled&&b._HandleStatus({name:"Cancel"})}.bind(b),function(a){b._reportResult();b._HandleStatus(a)}.bind(b))}.bind(this))};f.prototype.searchName=function(d,a){d&&(this._searchParams=
d,this.searchHelper=k.generateSearchHelper(d,!0));a&&(this.onSearchNameComplete=a);var e=[];this._cancelled=!1;this._deferredArray=[];this._sort(this.fileSkeleton);if(0<this.fileSkeleton.length){for(var b=0;b<this.fileSkeleton.length;b++){var f=this.fileSkeleton[b].Name.toLowerCase();if(this.searchHelper.inFileQuery.wildCard?k.searchOnelineRegEx(this.searchHelper.inFileQuery,f,!0):k.searchOnelineLiteral(this.searchHelper.inFileQuery,f,!0))if(e.push(this.fileSkeleton[b]),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(d,a){this._buildingSkeleton=!0;var e=this.registry.getService("orion.core.contentTypeRegistry");this._cancelled=!1;this._deferredArray=[];var b=this;d();e.getContentTypes().then(function(e){b.contentTypesCache=e;b._visitRecursively(b._childrenLocation).then(function(){b._buildingSkeleton=!1;a();b.searchHelper&&!b._buildSkeletonOnly&&b.searchName()})})};f.prototype._sort=function(d){d.sort(function(a,
e){var b,d;if("Path asc"===this._searchParams.sort){b=a.Location&&a.Location.toLowerCase();b=k.path2FolderName(b,a.Name&&a.Name.toLowerCase(),!0);d=e.Location&&e.Location.toLowerCase();d=k.path2FolderName(d,e.Name&&e.Name.toLowerCase(),!0);if(b<d)return-1;if(b>d)return 1}return this._sortOnNameSingle(a,e)}.bind(this))};f.prototype._HandleStatus=function(d){this._statusService&&"Cancel"===d.name&&(console.log("Crawling search cancelled. Deferred array length : "+this._deferredArray.length),this._statusService.setProgressResult({Message:l["Search cancelled by user"],
Severity:"Warning"}))};f.prototype._reportResult=function(){this._sort(this.fileLocations);this._onSearchComplete({response:{numFound:this.fileLocations.length,docs:this.fileLocations}})};f.prototype._sortOnNameSingle=function(d,a){var e=d.Name&&d.Name.toLowerCase(),b=a.Name&&a.Name.toLowerCase();return e<b?-1:e>b?1:0};f.prototype._fileNameMatches=function(d){var a=!0;this.searchHelper.params.fileNamePatterns&&(a=this.searchHelper.params.fileNamePatterns.some(function(a){a="^"+a.replace(/([*?])/g,
".$1")+"$";return d.match(a)}));return a};f.prototype._visitRecursively=function(d){var a=[],e=this;this._fetchChildrenCallBack&&this._fetchChildrenCallBack(d);return(e._progressService?this._progressService.progress(e.fileClient.fetchChildren(d),"Crawling search for children of "+d):e.fileClient.fetchChildren(d)).then(function(b){for(var d=0;d<b.length;d++)if(void 0!==b[d].Directory&&!1===b[d].Directory)if(e._searchOnName)a.push(e._buildSingleSkeleton(b[d]));else if(e._buildSkeletonOnly)a.push(e._buildSingleSkeleton(b[d]));
else{if(!e._cancelled){var f=g.getFilenameContentType(b[d].Name,e.contentTypesCache);if(f&&("text/plain"===f["extends"]||"text/plain"===f.id)&&e._fileNameMatches(b[d].Name))f=e._sniffSearch(b[d]),a.push(f),e._deferredArray.push(f)}}else if(b[d].Location)if(e._cancelled)break;else f=e._visitRecursively(b[d].ChildrenLocation),a.push(f),e._deferredArray.push(f);return h.all(a)})};f.prototype._hitOnceWithinFile=function(d){d=this._searchParams.caseSensitive?d:d.toLowerCase();return this.searchHelper.inFileQuery.wildCard?
k.searchOnelineRegEx(this.searchHelper.inFileQuery,d,!0):k.searchOnelineLiteral(this.searchHelper.inFileQuery,d,!0)};f.prototype._reportSingleHit=function(d){this._cancelled||(d.LastModified=d.LocalTimeStamp,this.fileLocations.push(d),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(d){d.cancel()})};
f.prototype._sniffSearch=function(d){this._totalCounter++;var a=this;if(!this._cancelled)if(""===this.searchHelper.params.keyword)this._reportSingleHit(d),this._statusService&&this._statusService.setProgressResult({Message:m.formatMessage(l["${0} files found out of ${1}"],this._hitCounter,this._totalCounter)});else return(a._progressService?a._progressService.progress(a.fileClient.read(d.Location),"Reading file "+d.Location):a.fileClient.read(d.Location)).then(function(e){a._hitOnceWithinFile(e)&&
a._reportSingleHit(d);a._statusService&&a._statusService.setProgressResult({Message:m.formatMessage(l["${0} files found out of ${1}"],a._hitCounter,a._totalCounter)},l.Cancel)},function(a){a&&(a.message&&"cancel"!==a.message.toLowerCase())&&console.error("Error loading file content: "+a.message)})};f.prototype._buildSingleSkeleton=function(d){this._totalCounter++;this.fileSkeleton.push(d);this.searchHelper&&(!this._buildSkeletonOnly&&0===this._totalCounter%100)&&this.searchName();d=new h;d.resolve(this._totalCounter);
return d};f.prototype.constructor=f;return{SearchCrawler:f}});
define("orion/webui/dialogs/OpenResourceDialog","i18n!orion/widgets/nls/messages orion/crawler/searchCrawler orion/contentTypes require orion/webui/littlelib orion/util orion/webui/dialog".split(" "),function(l,n,m,k,g,h,f){function d(a){this._init(a)}d.prototype=new f.Dialog;d.prototype.TEMPLATE='\x3cdiv role\x3d"search"\x3e\x3cdiv\x3e\x3clabel id\x3d"fileNameMessage" for\x3d"fileName"\x3e${Type the name of a file to open (? \x3d any character, * \x3d any string):}\x3c/label\x3e\x3c/div\x3e\x3cdiv\x3e\x3cinput id\x3d"fileName" type\x3d"text" class\x3d"setting-control" style\x3d"width:90%;"/\x3e\x3c/div\x3e\x3cdiv id\x3d"progress" style\x3d"padding: 2px 0 0; width: 100%;"\x3e\x3cimg src\x3d"'+k.toUrl("../../../images/progress_running.gif")+
'" class\x3d"progressPane_running_dialog" id\x3d"crawlingProgress"\x3e\x3c/img\x3e\x3c/div\x3e\x3cdiv id\x3d"results" style\x3d"max-height:250px; height:auto; overflow-y:auto;" aria-live\x3d"off"\x3e\x3c/div\x3e\x3cdiv id\x3d"statusbar"\x3e\x3c/div\x3e\x3c/div\x3e';d.prototype._init=function(a){this.title=a.title||l["Find File Named"];this.modal=!0;this.messages=l;this._searcher=a.searcher;this._progress=a.progress;this._onHide=a.onHide;this._contentTypeService=new m.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;void 0!==a.nameSearch&&(this._nameSearch=a.nameSearch);this._searchOnRoot=!0;this._fileService=this._searcher.getFileService();if(!this._fileService)throw Error(l["Missing required argument: fileService"]);this._searchRenderer=a.searchRenderer;if(!this._searchRenderer||
"function"!==typeof this._searchRenderer.makeRenderFunction)throw Error(l["Missing required argument: searchRenderer"]);this._initialize()};d.prototype._bindToDom=function(a){var e=this;e.$crawlingProgress.style.display="none";this._nameSearch?this.$fileName.setAttribute("placeholder",l["FileName FolderName"]):this.$fileName.setAttribute("placeholder",l.Search);this.$fileName.addEventListener("input",function(a){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===g.KEY.ENTER){var d=g.$("a",e.$results);d&&(g.stop(a),(h.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===g.KEY.DOWN||a.keyCode===g.KEY.UP)d=g.$$array("a",e.$results),f=document.activeElement,h=d.indexOf(f),a.keyCode===g.KEY.DOWN?0<=h?(f.classList.remove("treeIterationCursor"),d=h<d.length-1?d[h+1]:d[0],d.focus(),
d.classList.add("treeIterationCursor")):0<d.length&&(d=d[0],d.focus(),d.classList.add("treeIterationCursor")):0<=h?(f.classList.remove("treeIterationCursor"),f=e.$fileName,d=0<h?d[h-1]:f,d.focus(),0<h&&d.classList.add("treeIterationCursor")):0<d.length&&(d[d.length-1].focus(),d[d.length-1].classList.add("treeIterationCursor")),g.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 n.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(l["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)));this._initialText&&(this.$fileName.value=this._initialText,this.doSearch())};d.prototype.checkSearch=function(){clearTimeout(this._timeoutId);var a=(new Date).getTime();a-this._time>this._searchDelay?(this._time=a,this.doSearch()):this._timeoutId=setTimeout(this.checkSearch.bind(this),50)};d.prototype._detectFolderKeyword=function(a){var e,b=a,d=null;if(this._nameSearch&&(e=/(\S+)\s*(.*)/,(a=e.exec(a))&&3===a.length))a[1]&&
(b=a[1]),a[2]&&(d=a[2]);return{keyword:b,folderKeyword:d}};d.prototype.doSearch=function(){var a=this.$fileName.value;if(a){var e=this._detectFolderKeyword(a),b=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?l["Searching..."]:h.formatMessage(l["Searching for occurrences of"],
a)));g.empty(this.$results);this.$results.appendChild(f);this._searcher.search(b,e.folderKeyword,function(){d===this.currentSearch&&d.apply(null,arguments)}.bind(this))}};d.prototype.decorateResult=function(a){function e(a){0===a.button&&(!a.ctrlKey&&!a.metaKey)&&b.hide()}var b=this;a=g.$$array("a",a);for(var d=0;d<a.length;d++)a[d].addEventListener("click",e,!1)};d.prototype._beforeHiding=function(){clearTimeout(this._timeoutId)};d.prototype._afterHiding=function(){this._onHide&&this._onHide()};
d.prototype.constructor=d;return{OpenResourceDialog:d}});define("text!orion/banner/banner.html",[],function(){return'\x3cheader id\x3d"banner" role\x3d"banner"\x3e\n\t\x3c!-- Requires some js code to bind the home link, link to progress image, and binding NLS variables  --\x3e\n\n\t\x3cdiv id\x3d"staticBanner" class\x3d"layoutBlock topRowBanner"\x3e \x3c!-- primaryNav --\x3e\n\t\t\x3cdiv id\x3d"centralNavigationArea" style\x3d"position:absolute;left:0;top:0;width:39px;height:36px; z-index:1;border-right:1px solid #ddd;"\x3e\x3c/div\x3e\n\n\t\t\x3c!-- Static "Home" link. TODO delete this --\x3e\n\t\t\x3ca id\x3d"home" class\x3d"layoutLeft "\x3e\x3c/a\x3e\n\n\t\t\x3c!-- Left banner component: hamburger --\x3e\n\t\t\x3cnav id\x3d"primaryNav" class\x3d"bannerLeftArea" style\x3d"z-index:2;" role\x3d"navigation"\x3e\n\t\t\t\t\x3cbutton class\x3d"centralNavigation commandSprite core-sprite-hamburger" type\x3d"button"id\x3d"centralNavigation"\x3e\x3c/button\x3e\n\t\t\x3c/nav\x3e\n\n\t\t\x3c!-- Middle banner component: Breadcrumb bar --\x3e\n\t\t\x3cdiv class\x3d"clear navigationBreadcrumb bannerMiddleArea" \x3e\n\t\t\t\x3cdiv id\x3d"location" class\x3d"currentLocation"\x3e\x3c/div\x3e\n\t\t\x3c/div\x3e\n\n\t\t\x3c!-- Right banner component: user identity --\x3e\n\t\t\x3cdiv class\x3d"bannerRightArea" style\x3d"z-index:2;"\x3e\n\t\t\t\x3c!-- Global commands support. --\x3e\n\t\t\t\x3cdiv id\x3d"globalActions" class\x3d"spacingLeft layoutLeft"\x3e\x3c/div\x3e\n\n\t\t\t\x3c!-- Search. TODO delete this --\x3e\n\t\t\t\x3cinput type\x3d"text" id\x3d"search" autocomplete\x3d"off" class\x3d"layoutLeft spacingLeft searchbox" role\x3d"search" style\x3d"display:none;"\x3e\n\t\t\t\x3cdiv id\x3d"searchOptions" class\x3d"layoutLeft" style\x3d"padding-top:1px;display:none;"\x3e\x3c/div\x3e\n\n\t\t\t\x3c!-- User identity menu and Progress --\x3e\n\t\t\t\x3cdiv id\x3d"userMenu" class\x3d"spacingRight layoutRight" style\x3d"color:#ccc;line-height:16px;"\x3e\n\t\t\t\t\x3cdiv id\x3d"progressPane" class\x3d"progressWatch" tabindex\x3d"0" role\x3d"progressbar"\x3e\n\t\t\t\t\t\x3cdiv id\x3d"watchButton" class\x3d"watchButton"\x3e\x3c/div\x3e\n\t\t\t\t\t\x3cdiv id\x3d"watchBody" class\x3d"watchBody"\x3e\n\t\t\t\t\t\t\x3cspan class\x3d"hand longMinute"\x3e\n\t\t\t\t\t\t\t\x3cspan class\x3d"darkSide"\x3e\x3c/span\x3e\n\t\t\t\t\t\t\x3c/span\x3e\n\t\t\t\t\t\t\x3cspan class\x3d"hand longHour"\x3e\n\t\t\t\t\t\t\t\x3cspan class\x3d"darkSide"\x3e\x3c/span\x3e\n\t\t\t\t\t\t\x3c/span\x3e\n\t\t\t\t\t\x3c/div\x3e\n\t\t\t\t\x3c/div\x3e\n\t\t\t\t\n\t\t\t\t\x3cdiv style\x3d"position: absolute;right: 0px;top:0;width: 39px;height:36px; z-index:-50;border-left: 1px solid #ddd;"\x3e\x3c/div\x3e\n\t\t\t\t\x3cspan id\x3d"userTrigger" tabindex\x3d"0" role\x3d"button" class\x3d"dropdownTrigger" style\x3d"z-index:2;"\x3e\n\t\t\t\t\x3c/span\x3e\n\t\t\t\t\x3cul id\x3d"userDropdown" class\x3d"dropdownMenu" role\x3d"menu"\x3e\x3c/ul\x3e\n\t\t\t\x3c/div\x3e\n\t\t\x3c/div\x3e\n\t\x3c/div\x3e\n\n\t\x3c!-- IDE notification messages go in here --\x3e\n\t\x3cdiv id\x3d"notificationArea" class\x3d"notificationHide"\x3e\n\t\t\x3cdiv class\x3d"layoutLeft" id\x3d"notifications" aria-live\x3d"assertive" aria-atomic\x3d"true"\x3e\x3c/div\x3e\n\t\t\x3cdiv class\x3d"layoutRight"\x3e\x3cbutton aria-label\x3d"Close" class\x3d"dismissButton layoutRight core-sprite-close imageSprite" type\x3d"button" id\x3d"closeNotifications"\x3e\x3c/span\x3e\x3c/div\x3e\n\t\x3c/div\x3e\n\x3c/header\x3e'});
define("text!orion/banner/footer.html",[],function(){return'\x3c!--\n\x3cfooter id\x3d"footerContent" class\x3d"layoutBlock footerLayout" role\x3d"contentinfo"\x3e\n\t\x3cdiv class\x3d"logoFooter commandSprite core-sprite-orion-logo"\x3e\x3c/div\x3e\n\t\x3cdiv class\x3d"footerBlock"\x3e${Orion is in Beta. Please try it out but BEWARE your data may be lost.}\x3c/div\x3e\n\t\x3cdiv class\x3d"footerRightBlock"\x3e\n\t\t\x3cul\x3e\n\t\t\t\x3cli\x3e\x3ca href\x3d"https://bugs.eclipse.org/bugs/enter_bug.cgi?product\x3dOrion\x26version\x3d5.0" target\x3d"_blank"\x3e${Report a Bug}\x3c/a\x3e\n\t\t\t\x3cli\x3e\x3ca href\x3d"http://www.eclipse.org/legal/privacy.php" target\x3d"_blank"\x3e${Privacy Policy}\x3c/a\x3e\x3c/li\x3e\n\t\t\t\x3cli\x3e\x3ca href\x3d"http://www.eclipse.org/legal/termsofuse.php" target\x3d"_blank"\x3e${Terms of Use}\x3c/a\x3e\x3c/li\x3e\n\t\t\t\x3cli\x3e\x3ca href\x3d"http://www.eclipse.org/legal/copyright.php" target\x3d"_blank"\x3e${Copyright Agent}\x3c/a\x3e\x3c/li\x3e\n\t\t\x3c/ul\x3e\n\t\x3c/div\x3e\n\x3c/footer\x3e\n--\x3e'});
define("text!orion/banner/toolbar.html",[],function(){return'\x3cul class\x3d"layoutLeft commandList pageActions" id\x3d"pageActions"\x3e\x3c/ul\x3e\n\x3cul class\x3d"layoutLeft commandList pageActions" id\x3d"selectionTools"\x3e\x3c/ul\x3e\n\x3cul class\x3d"layoutLeft commandList pageActions" id\x3d"navActions"\x3e\x3c/ul\x3e\n\x3cdiv class\x3d"layoutLeft" style\x3d"padding-left:7px;padding-right:7px;margin-top:2px;" id\x3d"filterBox" style\x3d"visibility: hidden;"\x3e\x3c/div\x3e\n\x3cul class\x3d"layoutRight commandList pageActions" id\x3d"settingsActions"\x3e\x3c/ul\x3e\n\x3cdiv class\x3d"layoutRight status" id\x3d"statusPane" role\x3d"status" aria-live\x3d"off"\x3e\x3c/div\x3e\n\x3cul class\x3d"layoutRight commandList pageActions" id\x3d"pageNavigationActions"\x3e\x3c/ul\x3e'});
define("orion/widgets/input/DropDownMenu",["orion/objects","orion/webui/littlelib"],function(l,n){function m(k,g,h){if(k=n.node(k))this._parent=k;else throw Error("Parent node of dropdown menu not found");this.options=h=h||{};this.navDropDownId=this._parent.id+"_navdropdown";this.selectionClass=h.selectionClass;k=document.createElement("div");k.classList.add("dropdownMenu");k.classList.add("dropdownMenuOpen");k.id=this.navDropDownId;k.style.display="none";this._parent.appendChild(k);this._dropdownMenu=
k;if(g=n.node(g))this._triggerNode=g;else throw"Trigger node of dropdown menu not found";"hidden"===this._triggerNode.style.visibility&&(this._triggerNode.style.visibility="visible");h.noClick||(this._triggerNode.onclick=this.click.bind(this));this._dropdownMenu.addEventListener("keydown",function(f){f.keyCode===n.KEY.ESCAPE&&this.clearPanel()}.bind(this))}l.mixin(m.prototype,{click:function(){"none"===this._dropdownMenu.style.display?this.updateContent(this.getContentNode(),function(){n.setFramesEnabled(!1);
this._dropdownMenu.style.display="";this._positionDropdown();this.selectionClass&&this._triggerNode.classList.add(this.selectionClass);this.handle=n.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",n.setFramesEnabled(!0),this.selectionClass&&this._triggerNode.classList.remove(this.selectionClass),this.options.onHide))this.options.onHide()},
addContent:function(k){this._dropdownMenu.innerHTML=k},getContentNode:function(){return this._dropdownMenu},updateContent:function(k,g){g()},_positionDropdown:function(){this._dropdownMenu.style.right="";var k=n.bounds(this._dropdownMenu),g=n.bounds(document.body);k.left+k.width>g.left+g.width&&(k=n.bounds(this._boundingNode(this._triggerNode)),g=n.bounds(this._triggerNode),this._dropdownMenu.style.right=k.width-(g.left-k.left+g.width)+"px")},_boundingNode:function(k){var g=window.getComputedStyle(k,
null);return null===g||"absolute"===g.getPropertyValue("position")||!k.parentNode||k===document.body?k:this._boundingNode(k.parentNode)},isDestroyed:function(){return!this._dropdownMenu.parentNode},isVisible:function(){return"none"!==this._dropdownMenu.style.display&&!this.isDestroyed()},focus:function(){this._dropdownMenu.focus()},destroy:function(){this._parent&&(n.setFramesEnabled(!0),n.empty(this._parent),this._parent=this.select=null)}});return m});define("orion/customGlobalCommands",[],function(){return{}});
define("orion/navigate/nls/root/messages",{"Click one of the tasks below to create an Orion folder.  You can upload, import, or generate files.":"Click one of the tasks below to create an Orion folder.  You can upload, import, or generate files.","Toggle Left Pane":"Toggle Left Pane","Open or close the left pane":"Open or close the left pane",Navigator:"Navigator","Strings Xtrnalizr":"Strings Xtrnalizr","Externalize Strings from JavaScript files in this folder":"Externalize strings from JavaScript files in this folder.",
"Choose a Folder":"Choose a Folder","Copy of ${0}":"Copy of ${0}","Enter a new name for '${0}'":"Enter a new name for '${0}'","Choose folder...":"Choose folder...",Rename:"Rename","Rename the selected files or folders":"Rename the selected files or folders","Compare with each other":"Compare with each other","Compare the selected 2 files with each other":"Compare the selected 2 files with each other","Compare with...":"Compare with...","Compare the selected folder with a specified folder":"Compare the selected folder with a specified folder",
Delete:"Delete","Unknown item":"Unknown item","Are you sure you want to delete these ${0} items?":"Are you sure you want to delete these ${0} items?","Are you sure you want to delete '${0}'?":"Are you sure you want to delete '${0}'?","Export as zip":"Zip","Create a zip file of the folder contents and download it":"Create a zip file of the folder contents and download it","New File":"File","Create a new file":"Create a new file","Name:":"Name:","New Folder":"Folder","Folder name:":"Folder name:","Create a new folder":"Create a new folder",
"Creating folder":"Creating folder",Folder:"Folder","Create an empty folder":"Create an empty folder","Create an empty folder on the Orion server.  You can import, upload, or create content in the editor.":"Create an empty folder on the Orion server.  You can import, upload, or create content in the editor.","Sample HTML5 Site":"Sample HTML5 Site","Generate a sample":"Generate a sample",'Generate an HTML5 "Hello World" website, including JavaScript, HTML, and CSS files.':'Generate an HTML5 "Hello World" website, including JavaScript, HTML, and CSS files.',
"Creating a folder for ${0}":"Creating a folder for ${0}","SFTP Import":"SFTP Import","Import content from SFTP":"Import content from SFTP","Import content from an SFTP location into an Orion folder.  You will be prompted for the SFTP location and credentials.":"Import content from an SFTP location into an Orion folder.  You will be prompted for the SFTP location and credentials.","Imported Content":"Imported Content","Upload a Zip":"Upload a Zip","Upload content from a local zip file":"Upload content from a local zip file",
"Upload content from a local zip file into an Orion folder.  You will be prompted for the local zip file.":"Upload content from a local zip file into an Orion folder.  You will be prompted for the local zip file.","Uploaded Content":"Uploaded Content","Creating an upload folder for ":"Creating an upload folder for ","Clone Git Repository":"Clone Git Repository","Clone a git repository":"Clone a git repository","Go to the Orion repositories page to provide a git repository URL.  Once the repository is created, it will appear in the Navigator.":"Go to the Orion repositories page to provide a git repository URL.  Once the repository is created, it will appear in the Navigator.",
"Link to Server":"Link to Server","Link to existing content on the server":"Link to existing content on the server","Create a folder that links to an existing folder on the server.":"Create a folder that links to an existing folder on the server.","Server path:":"Server path:","The name and server location were not specified.":"The name and server location were not specified.","Go Up":"Go Up","Move up to the parent folder":"Move up to the parent folder","Go Into":"Go Into","Move into the selected folder":"Move into the selected folder",
"File or zip archive":"File or zip archive","Import a file or zip archive from your local file system":"Import a file or zip archive 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:","Import a file from a URL and optionally unzip it":"Import 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}?","Upload progress: ":"Upload progress: ","Uploading ":"Uploading ","Cancel upload":"Cancel upload","Uploading the following file failed: ":"Uploading the following file failed: ","Enter project name:":"Enter project name:","Creating project ":"Creating project ",NoFile:"Use the ${0} menu to create new files and folders. Click a file to start coding.",
Download:"Download",Download_tooltips:"Download the file contents as the displayed name","Downloading...":"Reading file contents...","Download not supported":"Contents download is not supported in this browser."});define("orion/navigate/nls/messages",["orion/i18n!orion/navigate/nls/messages","orion/navigate/nls/root/messages"],function(l,n){var m={root:n};Object.keys(l).forEach(function(k){"undefined"===typeof m[k]&&(m[k]=l[k])});return m});
define("orion/fileClient",["i18n!orion/navigate/nls/messages","orion/Deferred","orion/i18nUtil"],function(l,n,m){function k(f,d,a){if(!f[d])throw d+l[" is not supported in this file system"];return f[d].apply(f,a)}function g(f,d,a,e){if(!f.readBlob)throw l["source file service does not support binary read"];if(!a.writeBlob)throw l["target file service does not support binary write"];if("/"!==d[d.length-1])return k(f,"readBlob",[d]).then(function(b){return k(a,"writeBlob",[e,b])});var b=e.substring(0,
e.length-1),p=decodeURIComponent(b.substring(b.lastIndexOf("/")+1)),b=b.substring(0,b.lastIndexOf("/")+1);return k(a,"createFolder",[b,p]).then(function(){},function(){}).then(function(){return k(f,"fetchChildren",[d]).then(function(b){for(var d=[],p=0;p<b.length;++p){var h=b[p].Location,k=h;b[p].Directory&&(k=h.substring(0,h.length-1));k=decodeURIComponent(k.substring(k.lastIndexOf("/")+1));k=e+encodeURIComponent(k);b[p].Directory&&(k+="/");d[p]=g(f,h,a,k)}return n.all(d)})})}function h(f,d){function a(a){var b=
new n;b.reject(l["No Matching FileService for location:"]+a);return b}var e=f.getServiceReferences("orion.core.file"),b=e;if(d)for(var b=[],g=0;g<e.length;++g)d(e[g])&&b.push(e[g]);for(var h=[],k=[],u=[],w=[],x={fetchChildren:function(){var a=new n;a.resolve(w);return a},createWorkspace:function(){var a=new n;a.reject(l["no file service"]);return a},loadWorkspaces:function(){var a=new n;a.reject(l["no file service"]);return a},loadWorkspace:function(a){var b=new n;window.setTimeout(function(){b.resolve({Directory:!0,
Length:0,LocalTimeStamp:0,Name:l["File Servers"],Location:"/",Children:w,ChildrenLocation:"/"})},100);return b},search:a,createProject:a,createFolder:a,createFile:a,deleteFile:a,moveFile:a,copyFile:a,read:a,write:a},e=0;e<b.length;++e)w[e]={Directory:!0,Length:0,LocalTimeStamp:0,Location:b[e].getProperty("top"),ChildrenLocation:b[e].getProperty("top"),Name:b[e].getProperty("Name")},g=b[e].getProperty("pattern")||b[e].getProperty("top").replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1"),"^"!==g[0]&&(g=
"^"+g),h[e]=RegExp(g),k[e]=f.getService(b[e]),u[e]=b[e].getProperty("Name"),b[e].getProperty("NameKey")&&b[e].getProperty("nls")&&m.getMessageBundle(b[e].getProperty("nls")).then(function(a,e){w[a].Name=e[b[a].getProperty("NameKey")];u[a]=e[b[a].getProperty("NameKey")]}.bind(this,e));this._getServiceIndex=function(a){if("/"===a)return-1;if(!a||a.length&&0===a.length)return k[0]?0:-1;for(var b=0;b<h.length;++b)if(h[b].test(a))return b;throw l["No Matching FileService for location:"]+a;};this._getService=
function(a){a=this._getServiceIndex(a);return-1===a?x:k[a]};this._getServiceName=function(a){a=this._getServiceIndex(a);return-1===a?x.Name:u[a]};this._getServiceRootURL=function(a){a=this._getServiceIndex(a);return-1===a?x.Location:w[a].Location}}h.prototype={getService:function(f){return this._getService(f)},fileServiceName:function(f){return this._getServiceName(f)},fileServiceRootURL:function(f){return this._getServiceRootURL(f)},fetchChildren:function(f){return k(this._getService(f),"fetchChildren",
arguments)},createWorkspace:function(f){return k(this._getService(),"createWorkspace",arguments)},loadWorkspaces:function(){return k(this._getService(),"loadWorkspaces",arguments)},loadWorkspace:function(f){return k(this._getService(f),"loadWorkspace",arguments)},createProject:function(f,d,a,e){return k(this._getService(f),"createProject",arguments)},createFolder:function(f,d){return k(this._getService(f),"createFolder",arguments)},createFile:function(f,d){return k(this._getService(f),"createFile",
arguments)},deleteFile:function(f){return k(this._getService(f),"deleteFile",arguments)},moveFile:function(f,d,a){var e=this._getService(f),b=this._getService(d);if(e===b)return k(e,"moveFile",arguments);var p="/"===f[f.length-1],h=d;"/"!==h[h.length-1]&&(h+="/");if(a)h+=encodeURIComponent(a);else{var s=f;p&&(s=s.substring(0,s.length-1));h+=s.substring(s.lastIndexOf("/")+1)}p&&"/"!==h[h.length-1]&&(h+="/");return g(e,f,b,h).then(function(){return k(e,"deleteFile",[f])})},copyFile:function(f,d,a){var e=
this._getService(f),b=this._getService(d);if(e===b)return k(e,"copyFile",arguments);var p="/"===f[f.length-1],h=d;"/"!==h[h.length-1]&&(h+="/");if(a)h+=encodeURIComponent(a);else{var s=f;p&&(s=s.substring(0,s.length-1));h+=s.substring(s.lastIndexOf("/")+1)}p&&"/"!==h[h.length-1]&&(h+="/");return g(e,f,b,h)},read:function(f,d){return k(this._getService(f),"read",arguments)},readBlob:function(f){return k(this._getService(f),"readBlob",arguments)},write:function(f,d,a){return k(this._getService(f),"write",
arguments)},remoteImport:function(f,d){return k(this._getService(f),"remoteImport",arguments)},remoteExport:function(f,d){return k(this._getService(f),"remoteExport",arguments)},search:function(f){return k(this._getService(f.resource),"search",arguments)}};h.prototype.constructor=h;return{FileClient:h}});
define("orion/webui/SideMenu",["orion/webui/littlelib","orion/PageUtil","orion/URL-shim"],function(l,n){function m(h,f){this._parentNode=l.node(h);if(!this._parentNode)throw Error("Missing parentNode");this._contentNode=l.node(f);this._categoryInfos=[];this._categorizedPageLinks={};this._categorizedRelatedLinks={};this._categorizedAnchors=null;this._state=localStorage.getItem(k)||g;this._currentCategory="";this._renderTimeout=this._notificationTimeout=null}var k="sideMenuNavigation",g="open";m.prototype=
{constructor:m.prototype.constructor,setCategories:function(g){this._categoryInfos=g.getCategoryIDs().map(function(f){return g.getCategory(f)}).sort(function(f,d){var a=f.order||100,e=d.order||100;return a<e?-1:e<a?1:f.textContent.localeCompare(d.textContent)})},setPageLinks:function(g){this._categorizedPageLinks={};g.getAllLinks().forEach(function(f){var d=f.category;this._categorizedPageLinks[d]=this._categorizedPageLinks[d]||[];this._categorizedPageLinks[d].push({title:f.textContent,order:f.order||
100,href:f.href})},this)},setRelatedLinks:function(g,f){this._categorizedRelatedLinks={};g.forEach(function(d){var a=d.relatedLink,e=d.command;d=d.invocation;if(!f||-1===f.indexOf(a.id)){var b=a.category;this._categorizedRelatedLinks[b]=this._categorizedRelatedLinks[b]||[];this._categorizedRelatedLinks[b].push({title:e.name,order:a.order||100,href:e.hrefCallback.call(d.handler,d)})}},this);this._updateCategoryAnchors();this._updateCategoryNotifications()},render:function(){if(null===this._categorizedAnchors){this._categorizedAnchors=
{};var g=new URL(window.location.href);this._currentCategory=g.hash="";Object.keys(this._categorizedPageLinks).some(function(d){if(this._categorizedPageLinks[d].some(function(a){var e=new URL(a.href);a.hash="";return g.href===e.href}))return this._currentCategory=d,!0},this);var f=document.createElement("ul");f.classList.add("sideMenuList");this._categoryInfos.forEach(function(d){var a=document.createElement("li");a.classList.add("sideMenuItem");a.classList.add("sideMenu-notification");this._currentCategory===
d.id&&a.classList.add("sideMenuItemActive");a.categoryId=d.id;a.categoryName=d.textContent||d.id;var e=document.createElement("a");e.classList.add("submenu-trigger");if("string"===typeof d.imageDataURI&&0===d.imageDataURI.indexOf("data:image")){var b=document.createElement("img");b.width="16";b.height="16";b.src=d.imageDataURI;e.appendChild(b)}else e.classList.add(d.imageClass||"core-sprite-blank-menu-item");a.appendChild(e);f.appendChild(a);this._categorizedAnchors[d.id]=e},this);this._updateCategoryAnchors();
this._show=function(){this._parentNode.appendChild(f);this._show=m.prototype._show};window.setTimeout(function(){this._show()}.bind(this),1E3)}"closed"===this._state?(this._contentNode.style.left="0",this._renderTimeout&&(window.clearTimeout(this._renderTimeout),this._renderTimeout=null),this._renderTimeout=window.setTimeout(function(){this._parentNode.style.display="none";this._renderTimeout=null}.bind(this),301),this._parentNode.classList.add("animating")):(this._renderTimeout&&(window.clearTimeout(this._renderTimeout),
this._renderTimeout=null),this._parentNode.classList.remove("animating"),this._parentNode.style.display="block",this._parentNode.style.width="40px",this._contentNode.style.left="40px")},hide:function(){localStorage.setItem(k,"closed");this._contentNode.style.left="0"},toggle:function(){var h=this._contentNode;h&&h.classList.add("content-fixedHeight-animation");this._state="open"===this._state?"closed":"open";this._state===g?localStorage.removeItem(k):localStorage.setItem(k,this._state);this.render()},
_updateCategoryAnchors:function(){var g=[];Object.keys(this._categorizedRelatedLinks).forEach(function(f){("git"===f||f.match(/-scm$/))&&g.push(f)});Object.keys(this._categorizedAnchors).forEach(function(f){var d=this._categorizedAnchors[f],a=[];f===this._currentCategory?(d.parentElement.style.display="",d.href="",d.onclick=function(){return!1},d.title=d.parentElement.categoryName):(this._categorizedPageLinks[f]&&a.push.apply(a,this._categorizedPageLinks[f]),this._categorizedRelatedLinks[f]&&a.push.apply(a,
this._categorizedRelatedLinks[f]),0===a.length||0!==g.length&&("git"===f||f.match(/-scm$/))&&-1===g.indexOf(f)?(d.href="",d.title=d.parentElement.categoryName,d.parentElement.style.display="none"):(d.parentElement.style.display="",a.sort(function(a,b){return a.order<b.order?-1:b.order<a.order?1:a.title.localeCompare(b.title)}),f=a.shift(),d.href=f.href,d.title=f.title))},this);this._show()},_updateCategoryNotifications:function(){clearTimeout(this._notificationTimeout);this._notificationTimeout=setTimeout(this._updateCategoryNotifications.bind(this),
3E5);var g=n.matchResourceParameters().resource,f=(new URL(g,window.location.href)).href;this._categoryInfos.forEach(function(d){if(d.service&&d.service.getNotifications){var a=this._categorizedAnchors[d.id].parentElement;d.service.getNotifications(f).then(function(e){if(g===n.matchResourceParameters().resource){var b="";e.forEach(function(a){"info"===a.level&&!b?b="info":"warn"===a.level&&(!b||"info"===b)?b="warn":"error"===a.level&&"error"!==b&&(b="error")});b?a.setAttribute("level",b):a.removeAttribute("level")}},
function(a){window.console.log(a)})}},this)},_show:function(){}};return m});
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(l,
n,m,k,g,h,f,d,a,e,b,p,q,s,u,w,x,y,r,t,z,B,v,A,C,D,E,K,I,F,G,H,L,P,J){function V(a,b){if(a.getLabel)return a.getLabel();var e=new v;e.resolve(b.properties.name);return e}function U(a){q.node("progressPane").setAttribute("aria-label",l["Operations - Press spacebar to show current operations"]);(a=a.getService("orion.page.progress"))&&a.init.bind(a)("progressPane")}function S(a,b){var e=a.getServiceReferences("orion.core.auth");ca=[];var d=O.createMenuGenerator.apply(this,arguments);if(d)for(var f=0;f<
e.length;f++){var g=e[f],p=a.getService(g);V(p,g).then(function(a){p.getKey().then(function(b){ca.push(b);p.getUser().then(function(e){d.addUserItem(b,p,a,e)},function(e,f){d.addUserItem(b,p,a,f)});window.addEventListener("storage",function(e){M[b]!==localStorage.getItem(b)&&(M[b]=localStorage.getItem(b),p.getUser().then(function(e){d.addUserItem(b,p,a,e)},function(e){d.addUserItem(b,p,a)}))},!1)})})}}function W(a){return a}function T(b,e,d,g,p){function h(){if(l)return l;var a=b.getService("orion.core.contentTypeRegistry");
a||(a=new x.ContentTypeRegistry(b),a=b.getService("orion.core.contentTypeRegistry"));return a.getContentTypes().then(function(a){return l=a})}function A(a){for(var b={},e=a.getPropertyKeys(),d,f=0;f<e.length;f++)d=e[f],b[d]=a.getProperty(d);return b}function k(a,b){var e=null;a.some(function(a){return b===a.getProperty("id")?!!(e=a):!1});return e}function q(a){var b=a.command;return!b.visibleWhen||b.visibleWhen(e)?(a.invocation=new f.CommandInvocation(e,e,null,b,g),(new v).resolve(a)):"function"===
typeof p?(u||(u=p()),v.when(u,function(d){if(d&&e===$&&(!b.visibleWhen||b.visibleWhen(d)))return a.invocation=new f.CommandInvocation(d,d,null,b,g),a})):(new v).resolve()}function C(a,b,e){return e?(new v).resolve({relatedLink:a,command:e}):b.then(function(b){return{relatedLink:a,command:new f.Command(b)}})}var s=arguments,l,u,m=b&&b.getServiceReferences("orion.page.link.related");if(m&&0!==m.length){var D=this;v.when(h(),function(){if(O.beforeGenerateRelatedLinks.apply(D,s)){var e=b.getServiceReferences("orion.navigate.command"),
f=[];m.forEach(function(d){var p=A(d);if(p.id){var v;if((p.nls&&p.nameKey||p.name)&&p.uriTemplate)v=a._createCommandOptions(p,d,b,l,!0),f.push(C(p,v,null));else if(v=k(e,p.id)){var h=A(v);d={};J.mixin(d,h,p);(p=g.findCommand(p.id))?f.push(C(d,null,p)):(v=a._createCommandOptions(h,v,b,l,!0),f.push(C(d,v,null)))}}});v.all(f,W).then(function(a){a.sort(function(a,b){return a.command.name.localeCompare(b.command.name)});return v.all(a.map(q),W).then(function(b){var e=[];b=b.filter(function(b,d){if(b)return!0;
e.push(a[d]);return!1});O.addRelatedLinkCommands.call(D,g,b,e,d);O.afterGenerateRelatedLinks.apply(D,s)})})}})}}function ba(a){var b=q.node("globalActions");b&&(a.destroy(b),a.renderCommands(b.id,b,{},{},"tool"))}function X(a){var b=window.getComputedStyle(a,null);return null===b||"absolute"===b.getPropertyValue("position")||!a.parentNode||a===document.body?a:X(a.parentNode)}function Q(a){var b={},e=null;"string"===typeof a&&(a=q.node(a));a||(a=q.node("pageActions"));for(var d=a;d&&d.classList;){if(d.classList.contains("toolComposite")){e=
d;break}d=d.parentNode}a.classList.contains("commandMarker")&&(b.commandNode=a);e||(e=q.node("pageToolbar"));e&&(b.slideContainer=q.$(".slideParameters",e),b.parameterArea=q.$(".parameters",e),b.dismissArea=q.$(".parametersDismiss",e),b.notifications=q.$("#notificationArea",e),e.parentNode&&(b.toolbarTarget=q.$(".toolbarTarget",e.parentNode),b.toolbarTarget&&(a=q.bounds(b.toolbarTarget),d=q.bounds(X(b.toolbarTarget.parentNode)),b.toolbarTargetY=a.top-d.top,b.toolbar=e)));return b}function N(a){if(a=
a.slideContainer)if(a.style.left="",a.style.top="",a.classList.contains("slideContainerActive")){var b=q.bounds(a),e=q.bounds(a.parentNode);a.style.left=(e.width-b.width)/2+"px";a.style.top="0"}}h=function(a){var b=document.createElement("a");b.href=a;return b.href}(n.toUrl("auth/NotifyAuthentication.html"));var M={},O={createMenuGenerator:H.createMenuGenerator||function(a,b){if(q.node("userMenu")){var e=q.node("userDropdown"),d=new u.Dropdown({dropdown:e}),e=new A.UserMenu({dropdownNode:e,dropdown:d,
serviceRegistry:a}),d=q.node("userTrigger");new w.Tooltip({node:d,text:l.Options,position:["below","left"]});var d=document.getElementById("userTrigger"),f=d.className;d.className=f+" imageSprite core-sprite-silhouette";e.setKeyAssist(b);return e}},beforeGenerateRelatedLinks:H.beforeGenerateRelatedLinks||function(a,b,e,d,f){return!0},addRelatedLinkCommands:H.addRelatedLinkCommands||function(a,b,e,d){this.sideMenu&&this.sideMenu.setRelatedLinks(b,d)},afterGenerateRelatedLinks:H.afterGenerateRelatedLinks||
function(a,b,e,d,f){},afterSetPageTarget:H.afterSetPageTarget||function(a){},generateNavigationMenu:H.generateNavigationMenu||function(a,b,e,d,f,g,p){if(a=q.node("sideMenu"))b=q.node("centralNavigation"),new w.Tooltip({node:b,text:l.CentralNavTooltip,position:["right"]}),this.sideMenu=new P(a,q.node("pageContent")),b.addEventListener("click",this.sideMenu.toggle.bind(this.sideMenu)),(a=q.node("sideMenuToggle"))&&a.addEventListener("click",this.sideMenu.toggle.bind(this.sideMenu))},afterGenerateNavigationMenu:H.afterGenerateNavigationMenu||
function(a,b,e,d,f,g,p){},afterGenerateBanner:H.afterGenerateBanner||function(a,b,e,d,f,g,p){}},ca=[],$,Y=[],R,aa=null,Z=null,da=new g;return{generateBanner:function(a,b,e,g,p,h,A,u){function w(a){a.registerService("orion.cm.managedservice",{updated:function(a){a=a&&"undefined"!==a["links.newtab"]?a["links.newtab"]?"_blank":"_self":"_self";for(var b=q.$$array(".targetSelector"),e=0;e<b.length;e++)b[e].target=a}},{pid:"nav.config"})}(new z.ThemePreferences(g,new B.ThemeData)).apply();var t=q.node(a);
if(!t)throw l["could not find banner parent, id was "]+a;var x=document.createRange();x.selectNode(t);x=x.createContextualFragment(E);q.processTextNodes(x,l);t.firstChild?t.insertBefore(x,t.firstChild):t.appendChild(x);t=q.node("home");t.href=n.toUrl("edit/edit.html");t.setAttribute("aria-label",l["Orion Home"]);q.node("progressPane").src=f.NO_IMAGE;if(t=q.node("pageToolbar"))t.classList.add("toolbarLayout"),t.innerHTML=I+m.slideoutHTMLFragment("mainToolbar");(t=q.node("closeNotifications"))&&t.setAttribute("aria-label",
l["Close notification"]);if(17>=G.isFirefox&&(t=q.node("staticBanner")))t.style.width="100%",t.style.MozBoxSizing="border-box";if(t=q.node("footer"))t.innerHTML=K,q.processTextNodes(t,l);e.setParameterCollector(new d.CommandParameterCollector(Q,N));document.addEventListener("keydown",function(a){a.keyCode===q.KEY.ESCAPE&&(a=b.getService("orion.page.message"))&&a.setProgressMessage("")},!1);O.generateNavigationMenu.apply(this,arguments);O.afterGenerateNavigationMenu.apply(this,arguments);t=C.getCategoriesInfo(b);
x=C.getPageLinksInfo(b,"orion.page.link");v.all([t,x]).then(function(a){if(this.sideMenu){var b=a[1];this.sideMenu.setCategories(a[0]);this.sideMenu.setPageLinks(b);this.sideMenu.render()}}.bind(this));if(t=q.$(".split")){var x=q.$(".sidePanelLayout"),y=q.$(".mainPanelLayout");x&&y&&(aa={side:x,main:y},aa.splitter=new s.Splitter({node:t,sidePanel:x,mainPanel:y,toggle:!0,closeByDefault:u}),t=new f.Command({name:l["Toggle side panel"],tooltip:l["Open or close the side panel"],id:"orion.toggleSidePane",
callback:function(){aa.splitter.toggleSidePanel()}}),e.addCommand(t),e.registerCommandContribution("pageActions","orion.toggleSidePane",1,null,!0,new k.KeyBinding("l",G.isMac?!1:!0,!0,!1,G.isMac?!0:!1)))}var F=!1,H=function(a,b){if(!F){var e=b.getService("orion.page.progress"),d=new D.OpenResourceDialog({searcher:a,progress:e,searchRenderer:a.defaultRenderer,onHide:function(){F=!1}});window.setTimeout(function(){F=!0;d.show()},0)}},t=new f.Command({name:l["Find File Named..."],tooltip:l["Choose a file by name and open an editor on it"],
id:"orion.openResource",callback:function(a){H(p,b)}});e.addCommand(t);e.registerCommandContribution("globalActions","orion.openResource",100,null,!0,new k.KeyBinding("f",!0,!0));var P=!1,t=function(){if(P)return!1;var a=q.node("banner"),b=q.node("footer"),e=q.node("sideMenu"),d=q.$(".content-fixedHeight"),f="hidden"===a.style.visibility;f?(a.style.visibility="visible",b.style.visibility="visible",d.classList.remove("content-fixedHeight-maximized"),e&&e.classList.remove("sideMenu-maximized")):(a.style.visibility=
"hidden",b.style.visibility="hidden",d.classList.add("content-fixedHeight-maximized"),e&&e.classList.add("sideMenu-maximized"));da.dispatchEvent({type:"toggleTrim",maximized:!f});return!0};window.orionNoTrim?(t(),P=!0,this.sideMenu.hide()):(t=new f.Command({name:l["Toggle banner and footer"],tooltip:l["Hide or show the page banner and footer"],id:"orion.toggleTrim",callback:t}),e.addCommand(t),e.registerCommandContribution("globalActions","orion.toggleTrim",100,null,!0,new k.KeyBinding("m",!0,!0)));
t=new f.Command({name:l["System Configuration Details"],tooltip:l["System Config Tooltip"],id:"orion.configDetailsPage",hrefCallback:function(){return n.toUrl("help/about.html")}});e.addCommand(t);e.registerCommandContribution("globalActions","orion.configDetailsPage",100,null,!0,new k.KeyBinding(112,!0,!0));t=new f.Command({name:l["Background Operations"],tooltip:l["Background Operations Tooltip"],id:"orion.backgroundOperations",hrefCallback:function(){return n.toUrl("operations/list.html")}});e.addCommand(t);
e.registerCommandContribution("globalActions","orion.backgroundOperations",100,null,!0,new k.KeyBinding("o",!0,!0));Z=new r.KeyAssistPanel({commandRegistry:e});t=new f.Command({name:l["Show Keys"],tooltip:l["Show a list of all the keybindings on this page"],id:"orion.keyAssist",callback:function(){Z.isVisible()?Z.hide():Z.show();return!0}});e.addCommand(t);e.registerCommandContribution("globalActions","orion.keyAssist",100,null,!0,new k.KeyBinding(191,!1,!0));ba(e);S(b,t.callback);U(b);window.addEventListener("hashchange",
function(){e.processURL(window.location.href)},!1);window.setTimeout(function(){w(b)},0);O.afterGenerateBanner.apply(this,arguments)},getToolbarElements:Q,getMainSplitter:function(){return aa},getKeyAssist:function(){return Z},getGlobalEventTarget:function(){return da},layoutToolbarElements:N,setPageTarget:function(a){var b,e,d=a.breadcrumbRootName,f=a.serviceRegistry;a.target?(a.searchService&&a.searchService.setLocationByMetaData(a.target),a.fileService&&(!a.breadcrumbTarget&&!a.staticBreadcrumb)&&
(e=(d?d+" ":"")+a.fileService.fileServiceName(a.target.Location),d=null),b=a.name||a.target.Name,$=a.target,T.call(this,f,a.target,Y,a.commandService,a.makeAlternate)):(a.breadcrumbTarget||(d=d||a.task||a.name),b=a.name,T.call(this,f,{NoTarget:""},Y,a.commandService,a.makeAlternate));(R=a.title)||(R=b?b+" - "+a.task:a.task);window.document.title=R;O.afterSetPageTarget.apply(this,arguments);if(b=a.breadCrumbContainer?q.node(a.breadCrumbContainer):q.node("location"))if(q.empty(b),a.staticBreadcrumb)new p.BreadCrumbs({container:b,
rootSegmentName:d});else{var g=f&&new L.FileClient(f),f=a.breadcrumbTarget||a.target,g=g&&f&&f.Location?g.fileServiceRootURL(f.Location):null;new p.BreadCrumbs({container:b,resource:f,rootSegmentName:d,workspaceRootSegmentName:e,workspaceRootURL:g,makeFinalHref:a.makeBreadcrumFinalLink,makeHref:a.makeBreadcrumbLink})}},setDirtyIndicator:function(a){R&&("*"===R.charAt(0)&&!a&&(R=R.substring(1)),a&&"*"!==R.charAt(0)&&(R="*"+R),window.document.title=R);var b=q.node("dirty");b&&(b.textContent=a?"*":"")},
setPageCommandExclusions:function(a){Y=a},notifyAuthenticationSite:h}});
define("orion/urlUtils",["orion/PageUtil","orion/URL-shim"],function(l){return{detectValidURL:function(n){for(var m=/\[([^\]]*)\]\(([^\)]+)\)/g,k=m.exec(n),g=[],h=0;k;){if(3===k.length&&0<k[2].length){var f=new URL(k[2]);":"!==f.protocol&&l.validateURLScheme(f.href)&&(k.index>h&&g.push({segmentStr:n.substring(h,k.index)}),g.push({segmentStr:0<k[1].length?k[1]:k[2],urlStr:k[2]}),h=k.index+k[0].length)}k=m.exec(n)}if(0===h)return null;h<n.length&&g.push({segmentStr:n.substring(h)});return g},processURLSegments:function(l,
m){m.forEach(function(k){if(k.urlStr){var g=document.createElement("a");g.href=k.urlStr;g.appendChild(document.createTextNode(k.segmentStr))}else g=document.createElement("span"),g.textContent=k.segmentStr;l.appendChild(g)})}}});
define("orion/status",["i18n!orion/nls/messages","orion/webui/littlelib","orion/globalCommands","orion/urlUtils"],function(l,n,m,k){function g(f,d,a,e,b){this._serviceRegistry=f;this._serviceRegistration=f.registerService("orion.page.message",this);this._operationsClient=d;this.notificationContainerDomId=b;this.domId=a;this.progressDomId=e||a;this._hookedClose=!1;this._timer=null;this._clickToDisMiss=!0;this._cancelMsg=null}var h;g.prototype={_init:function(){var f=n.node("closeNotifications");if(f&&
!this._hookedClose){f.style.cursor="pointer";this._hookedClose=!0;var d=n.node(this.notificationContainerDomId);n.addAutoDismiss([d],function(){this._clickToDisMiss&&this.close()}.bind(this));f.addEventListener("click",function(){this.close()}.bind(this));d.addEventListener("click",function(a){a&&a.target&&"a"===a.target.nodeName.toLowerCase()&&(a=n.$$("a",d))&&(a.length&&1===a.length)&&this.close()}.bind(this))}},close:function(){window.clearTimeout(this._timer);var f=n.node("closeNotifications");
this._cancelMsg&&this._cancelFunc&&f?(f.innerHTML="",f.classList.remove("cancelButton"),f.classList.add("dismissButton"),f.classList.add("core-sprite-close"),f.classList.add("imageSprite"),this._cancelFunc(),this._cancelMsg=null):this.setProgressMessage("")},_getNotifierElements:function(){this._notifierElements||(this._notifierElements=m.getToolbarElements(this.notificationContainerDomId));return this._notifierElements},setMessage:function(f,d,a){this._init();this.currentMessage=f;var e=n.node(this.domId);
if("boolean"===typeof a){var b=e.getAttribute("aria-live");e.setAttribute("aria-live",a?"polite":"off");window.setTimeout(function(){f===this.currentMessage&&(n.empty(e),e.appendChild(document.createTextNode(f)),window.setTimeout(function(){e.setAttribute("aria-live",b)},100))}.bind(this),100)}else n.empty(e),e.appendChild(document.createTextNode(f));"number"===typeof d&&window.setTimeout(function(){f===this.currentMessage&&(n.empty(e),e.appendChild(document.createTextNode("")))}.bind(this),d)},setErrorMessage:function(f){this._clickToDisMiss=
!0;this.currentMessage=f;this._init();var d=f.responseText||f.message||f;if("string"===typeof d)try{d=JSON.parse(d)}catch(a){}f=d.Message||d;var 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(f));f=n.node(this.domId);n.empty(f);f.appendChild(d)},setProgressMessage:function(f){this._clickToDisMiss=!1;this._init();this.currentMessage=
f;var d=document.createElement("span");d.classList.add("progressIcon");var a=n.node(this.progressDomId);n.empty(a);a.appendChild(d);a.appendChild(document.createTextNode(f));d=n.node(this.notificationContainerDomId);d.classList.remove("notificationHide");if(f&&0<f.length)d.classList.add("progressNormal"),d.classList.add("notificationShow");else{if(this._progressMonitors&&0<this._progressMonitors.length)return this._renderOngoingMonitors();d.classList.remove("notificationShow");d.classList.add("notificationHide")}},
setCancelFunction:function(f){this._cancelFunc=f},setProgressResult:function(f,d){this._clickToDisMiss=!1;this._cancelMsg=d;this.currentMessage=f;var a=f.responseText||f;if("string"===typeof a)try{a=JSON.parse(a)}catch(e){}this._init();var b=a.Message||a.toString(),g=l.UnknownError,h="core-sprite-information",s="progressNormal",u=document.createElement("span");u.classList.add("imageSprite");u.classList.add("progressIcon");var m=[];if(a.Severity)switch(a.Severity){case "Warning":g=l.UnknownWarning;
h="core-sprite-warning";s="progressWarning";m.push("progressInfo");m.push("progressError");m.push("progressNormal");this._clickToDisMiss=!0;break;case "Error":h="core-sprite-error";s="progressError";m.push("progressWarning");m.push("progressInfo");m.push("progressNormal");this._clickToDisMiss=!0;break;default:s="progressNormal",m.push("progressWarning"),m.push("progressError"),m.push("progressNormal")}m.push("notificationHide");u.classList.add(h);var x=n.node(this.progressDomId),h=n.node(this.notificationContainerDomId);
n.empty(x);x.appendChild(u);b===Object.prototype.toString()&&(b=g);a.HTML?(a=document.createElement("span"),a.innerHTML=b,x.appendChild(a)):((g=k.detectValidURL(b))?(b=document.createDocumentFragment(),k.processURLSegments(b,g),Array.prototype.forEach.call(n.$$("a",b),function(a){a.target="_blank"})):("Warning"!==a.Severity&&("Error"!==a.Severity&&!d)&&(this._timer&&window.clearTimeout(this._timer),this._timer=window.setTimeout(function(){this.setProgressMessage("");this._timer=null}.bind(this),5E3)),
b=document.createTextNode(b)),x.appendChild(b));if(s&&this.progressDomId!==this.domId){h.classList.add(s);for(s=0;s<m.length;s++)h.classList.remove(m[s])}h.classList.add("notificationShow");if(m=n.node("closeNotifications"))this._cancelMsg?(m.classList.add("cancelButton"),m.classList.remove("dismissButton"),m.classList.remove("core-sprite-close"),m.classList.remove("imageSprite"),m.innerHTML=this._cancelMsg):(m.innerHTML="",m.classList.remove("cancelButton"),m.classList.add("dismissButton"),m.classList.add("core-sprite-close"),
m.classList.add("imageSprite"))},showWhile:function(f,d){var a=this;if(d){a.setProgressMessage(d);var e=function(){d===a.currentMessage&&a.setProgressMessage("")};f.then(e,e)}return f},_lastProgressId:0,_progressMonitors:{length:0},createProgressMonitor:function(f,d){return new h(this,++this._lastProgressId,f,d)},_renderOngoingMonitors:function(){if(0<this._progressMonitors.length){var f="",d=!0,a;for(a in this._progressMonitors)this._progressMonitors[a].status&&(d||(f+=", "),f+=this._progressMonitors[a].status,
d=!1);this.setProgressMessage(f)}else this.setProgressMessage("")},_beginProgressMonitor:function(f){this._progressMonitors[f.progressId]=f;this._progressMonitors.length++;this._renderOngoingMonitors()},_workedProgressMonitor:function(f){this._progressMonitors[f.progressId]=f;this._renderOngoingMonitors()},_doneProgressMonitor:function(f){delete this._progressMonitors[f.progressId];this._progressMonitors.length--;f.status?this.setProgressResult(f.status):this._renderOngoingMonitors()}};g.prototype.constructor=
g;h=function(f,d,a,e){this.statusService=f;this.progressId=d;if(a){this.deferred=a;this.begin(e);var b=this;a.then(function(a,e){b.done.bind(b)()},function(a,e){b.done.bind(b)()})}};h.prototype.begin=function(f){this.status=f;this.statusService._beginProgressMonitor(this)};h.prototype.done=function(f){this.status=f;this.statusService._doneProgressMonitor(this)};h.prototype.worked=function(f){this.status=f;this.statusService._workedProgressMonitor(this)};h.prototype.constructor=h;return{StatusReportingService:g,
ProgressMonitor:h}});
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(l,n){var m={root:n};Object.keys(l).forEach(function(k){"undefined"===typeof m[k]&&(m[k]=l[k])});return m});
define("orion/webui/popupdialog",["i18n!orion/widgets/nls/messages","require","orion/webui/littlelib","orion/webui/tooltip"],function(l,n,m,k){function g(){}g.prototype={_initialize:function(g,f,d,a,e){this._tooltip=new k.Tooltip({node:g,hideDelay:e||0,afterShowing:this._afterShowingFunction(f).bind(this),afterHiding:d,trigger:a?a:"click"});this.$parent=this._tooltip.contentContainer();this.$parent.role="dialog";g=document.createRange();g.selectNode(this.$parent);g=g.createContextualFragment(this.TEMPLATE);
this.messages&&m.processTextNodes(g,l);this.$parent.appendChild(g);var b=this._tooltip;this.$parent.addEventListener("keydown",function(a){a.keyCode===m.KEY.ESCAPE&&b.hide()},!1);this._bindElements(this.$parent);"function"===typeof this._bindToDom&&this._bindToDom(this.$parent)},_bindElements:function(g){for(var f=0;f<g.childNodes.length;f++){var d=g.childNodes[f];d.id&&(this["$"+d.id]=d);this._bindElements(d)}},_afterShowingFunction:function(g){return function(){g&&g.bind(this)();if(!this.customFocus){var f=
m.firstTabbable(this.$parent);f&&f.focus()}}},hide:function(){this._tooltip.hide()},show:function(){this._tooltip.show()}};g.prototype.constructor=g;return{PopupDialog:g}});
define("orion/operationsCommands",["i18n!orion/operations/nls/messages","require","orion/webui/littlelib","orion/commands"],function(l,n,m,k){var g={};(function(){var h=!1;g.updateNavTools=function(f,d,a,e,b,g){var k=m.node(e);if(k)d.destroy(k);else throw l["could not find toolbar "]+e;d.renderCommands(e,k,g,a,"button");if(b&&(e=m.node(b)))d.destroy(e),d.renderCommands(b,e,null,a,"button");h||(h=!0,f.getService("orion.page.selection").addEventListener("selectionChanged",function(e){var f=m.node(b);
f&&(d.destroy(f),d.renderCommands(b,f,e.selections,a,"button"))}))};g.createOperationsCommands=function(f,d,a){function e(a){return!a.operation||!a.operation.type?!1:"loadstart"===a.operation.type||"progress"===a.operation.type}var b=new k.Command({name:l["Remove Completed"],tooltip:l["Remove all completed operations"],id:"eclipse.removeCompletedOperations",callback:function(b){a.removeCompletedOperations().then(function(a){d.loadOperations.bind(d)()})},visibleWhen:function(a){return!0}});f.addCommand(b);
b=new k.Command({name:l.Remove,tooltip:l["Remove operations from the operations list."],imageClass:"core-sprite-delete",id:"eclipse.removeOperation",callback:function(b){b=Array.isArray(b.items)?b.items:[b.items];for(var e=0;e<b.length;e++){var f=b[e];a.removeOperation.bind(a)(f.Location).then(function(){d.loadOperations.bind(d)()},function(){d.loadOperations.bind(d)()})}},visibleWhen:function(a){if(!Array.isArray(a)||0===a.length)return!e(a);for(var b in a)if(e(a[b]))return!1;return!0}});f.addCommand(b);
b=new k.Command({name:l.Cancel,tooltip:l["Cancel operations from the operations list."],imageClass:"core-sprite-stop",id:"eclipse.cancelOperation",callback:function(a){a=Array.isArray(a.items)?a.items:[a.items];for(var b=0;b<a.length;b++){var e=a[b];e.deferred&&e.deferred.cancel()}},visibleWhen:function(a){if(!Array.isArray(a)||0===a.length)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}});f.addCommand(b)}})();
return g});
define("orion/webui/dialogs/OperationsDialog",["i18n!orion/operations/nls/messages","require","orion/webui/littlelib","orion/webui/popupdialog","orion/operationsCommands"],function(l,n,m,k,g){function h(f){this._options=f}h.prototype=new k.PopupDialog;h.prototype.TEMPLATE='\x3ctable style\x3d"width: 360px;"\x3e\x3ctr\x3e\x3ctd\x3e\x3ch2\x3eRecent operations\x3c/h2\x3e\x3c/td\x3e\x3ctd style\x3d"text-align: right;"\x3e\x3ca id\x3d"allOperationsLink" class\x3d"navlinkonpage"\x3eAll Operations\x3c/a\x3e\x3c/td\x3e\x3c/tr\x3e\x3c/table\x3e\x3cdiv id\x3d"operationsExist"\x3e\x3cdiv style\x3d"padding-left: 7px" id\x3d"myOperationsListEmpty"\x3eNo operations running on this page.\x3c/div\x3e\x3ctable id\x3d"myOperationsList" style\x3d"display: none;"\x3e\x3c/table\x3e\x3c/div\x3e\x3cdiv style\x3d"padding-left: 7px" id\x3d"operationsDontExist"\x3eNo operations running.\x3c/div\x3e';h.prototype._init=
function(f){this._myOperations=[];this._operationsDeferreds=[];this._commandService=f.commandRegistry;g.createOperationsCommands(this._commandService);this._commandService.registerCommandContribution("operationsDialogItems","eclipse.cancelOperation",1);this._initialize(f.triggerNode)};h.prototype._bindToDom=function(f){this.$allOperationsLink.href=n.toUrl("operations/list.html");this._setOperationsVisibility()};h.prototype.setOperations=function(f,d){this._myOperations||this._init(this._options);
this._myOperations=[];this._operationsDeferreds=[];if(f)for(var a in f)this._myOperations.push(f[a]),this._operationsDeferreds.push(d[a]);this._renderOperations()};h.prototype.parseProgressResult=function(f){if(!f)return{};f=f.responseText||f;try{f=JSON.parse(f)}catch(d){}var a={Message:f.Message||f,Severity:f.Severity};f.DetailedMessage&&f.DetailedMessage!==a.Message&&(a.DetailedMessage=f.DetailedMessage);return a};h.prototype._renderOperations=function(){this._renderOperationsTable(this.$myOperationsList,
this._myOperations,this._operationsDeferreds)};h.prototype._renderOperationsTable=function(f,d,a){m.empty(f);for(var e=0;e<d.length;e++){var b=d[e],g=document.createElement("tr"),h=document.createElement("td");h.style.paddingLeft="5px";h.style.paddingRight="5px";h.textContent=b.Name;g.appendChild(h);var k=document.createElement("div");h.appendChild(k);h=document.createElement("span");h.style.paddingRight="5px";h.classList.add("imageSprite");switch(b.type){case "Warning":h.classList.add("core-sprite-warning");
h.setAttribute("aria-label",l["Operation resulted in a warning."]);break;case "error":h.classList.add("core-sprite-error");h.setAttribute("aria-label",l["Operation resulted in an error."]);break;case "loadstart":case "progress":h.classList.add("core-sprite-start");h.setAttribute("aria-label",l["Operation is running."]);break;case "abort":h.classList.add("core-sprite-stop");h.setAttribute("aria-label",l["Operation is canceled."]);break;case "load":case "loadend":h.classList.add("core-sprite-ok"),h.setAttribute("aria-label",
"Operation ok.")}k.appendChild(h);h=document.createElement("span");h.classList.add("operationStatus");h.textContent=b.Name;k.appendChild(h);if(b.error){var u=b.error.Message||b.error;b.error.DetailedMessage&&""!==b.error.DetailedMessage&&(u+=": "+b.error.DetailedMessage);h.textContent=u;h.classList.remove("operationStatus");h.classList.add("operationError")}this._commandService.renderCommands("operationsDialogItems",k,{operation:b,deferred:a[e]},this,"tool");f.appendChild(g)}this._setOperationsVisibility()};
h.prototype._setOperationsVisibility=function(){this.$myOperationsList.style.display=0<this._myOperations.length?"":"none";this.$myOperationsListEmpty.style.display=0<this._myOperations.length?"none":"";this.$operationsDontExist.style.display=0<this._myOperations.length?"none":"";this.$operationsExist.style.display=0<this._myOperations.length?"":"none"};h.prototype.constructor=h;return{OperationsDialog:h}});
define("orion/progress",["i18n!orion/nls/messages","require","orion/Deferred","orion/webui/littlelib","orion/webui/dialogs/OperationsDialog"],function(l,n,m,k,g){function h(d,a){if(!this._progressPane){this._progressPane=k.node(d);this._operationsDialog=new g.OperationsDialog({triggerNode:this._progressPane,commandRegistry:a});var e=this;this._progressPane.addEventListener("keydown",function(a){(" "===a.charOrCode||a.keyCode===k.KEY.ENTER)&&e._operationsDialog.show()});this._progressPane.addEventListener("click",
function(a){e._operationsDialog.show()});this._operationsDialog.setOperations(null,null)}}function f(d,a,e,b){this._serviceRegistry=d;this._serviceRegistration=d.registerService("orion.page.progress",this);this._commandRegistry=e;this._operationsClient=a;this._operations={};this._operationDeferrds={};this._operationsIndex=0;this._lastIconClass=this._lastOperation=null;this._progressMonitorClass=b}h.prototype={_switchIconTo:function(d){this._lastIconClass&&this._progressPane.classList.remove(this._lastIconClass);
this._lastIconClass=d;this._progressPane.classList.add(this._lastIconClass)},generateOperationsInfo:function(d,a){var e={},b;for(b in d)d[b].progressMonitor||(e[b]=d[b]);if(this._isEmpty(e))this._switchIconTo("progressPane_empty"),this._progressPane.title=l.Operations,this._progressPane.alt=l.Operations,this._progressPane.hasAttribute("aria-valuetext")&&this._progressPane.removeAttribute("aria-valuetext");else{var f="";for(b in e){var g=e[b];if(g.type&&("loadstart"===g.type||"progress"===g.type)){f=
"running";break}}""===f&&null!=this._lastOperation&&this._lastOperation.type&&"error"===this._lastOperation.type&&"error"==f;switch(f){case "running":this._progressPane.title=l["Operations running"];this._progressPane.alt=l["Operations running"];this._progressPane.setAttribute("aria-valuetext",l["Operations running"]);this._switchIconTo("running");break;case "warning":this._progressPane.title=l["Some operations finished with warning"];this._progressPane.alt=l["Some operations finished with warning"];
this._progressPane.setAttribute("aria-valuetext",l["Some operations finished with warning"]);this._switchIconTo("warning");break;case "error":this._progressPane.title=l["Some operations finished with error"];this._progressPane.alt=l["Some operations finished with error"];this._progressPane.setAttribute("aria-valuetext",l["Some operations finished with error"]);this._switchIconTo("error");break;default:this._progressPane.title=l.Operations,this._progressPane.alt=l.Operations,this._progressPane.hasAttribute("aria-valuetext")&&
this._progressPane.removeAttribute("aria-valuetext"),this._switchIconTo("progressPane_empty")}}this._operationsDialog.setOperations(e,a)},_isEmpty:function(d){for(var a in d)return!1;return!0}};h.prototype.constructor=h;f.prototype={init:function(d){this._progressMonitorClass||(this._progressMonitorTool=new h(d,this._commandRegistry))},progress:function(d,a,e){var b=this,f=this._operationsIndex++;!e&&this._progressMonitorClass&&(e=new this._progressMonitorClass,e.begin(a));d.then(function(g){b._operations[f]&&
(g=b._operations[f],a&&(g.Name=a),b._lastOperation=g,g.type="loadend",e&&(g.progressMonitor=e),b.writeOperation.bind(b)(f,g,d),g.Location||b._removeOperationFromTheList.bind(b)(f))},function(g){if(b._operations[f]){var h=b._operations[f];a&&(h.Name=a);e&&(h.progressMonitor=e);b._lastOperation=h;h.type=g.canceled?"abort":"error";h.error=g;b.writeOperation.bind(b)(f,h,d);h.Location||b._removeOperationFromTheList.bind(b)(f)}},function(g){a&&(g.Name=a);e&&(g.progressMonitor=e);b.writeOperation.bind(b)(f,
g,d)});return d},removeOperation:function(d){for(var a in this._operations)if(this._operations[a].Location&&this._operations[a].Location===d){this._removeOperationFromTheList(a);break}this._operationsClient.removeOperation.bind(this._operationsClient)(d)},_removeOperationFromTheList:function(d){var a=this._operations[d].progressMonitor;delete this._operations[d];delete this._operationDeferrds[d];a?a.done():this._progressMonitorTool.generateOperationsInfo(this._operations,this._operationDeferrds)},
removeCompletedOperations:function(){for(var d in this._operations){var a=this._operations[d];a.type&&("loadstart"!==a.type&&"progress"!==a.type)&&((a=this._operations[d].progressMonitor)&&a.done(),delete this._operations[d],delete this._operationDeferrds[d])}this._progressMonitorTool.generateOperationsInfo(this._operations,this._operationDeferrds)},setProgressResult:function(d){this._serviceRegistry.getService("orion.page.message").setProgressResult(d)},showWhile:function(d,a,e){a&&this._serviceRegistry.getService("orion.page.message").setProgressMessage(a);
var b=this;d.then(function(a){b._serviceRegistry.getService("orion.page.message").setProgressMessage("")},function(a){e?b._serviceRegistry.getService("orion.page.message").setProgressMessage(""):b.setProgressResult.bind(b)(a);return a});return this.progress(d,a)},writeOperation:function(d,a,e){this._operations[d]=a;this._operationDeferrds[d]=e;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/dialogs",[],function(){function l(l){this._serviceRegistry=l;this._serviceRegistration=l.registerService("orion.page.dialog",this)}l.prototype={confirm:function(l,m){m(window.confirm(l))},openFiles:function(l){}};l.prototype.constructor=l;return{DialogService:l}});
define("orion/selection",["orion/EventTarget","orion/Deferred"],function(l,n){function m(k,g){g||(g="orion.page.selection");this._serviceRegistry=k;l.attach(this);this._serviceRegistration=k.registerService(g,this);this._selections=null}m.prototype={getSelection:function(k){var g=this._getSingleSelection();"function"===typeof k&&k(g);return g},getSelections:function(k){var g=Array.isArray(this._selections)?this._selections.slice():[];"function"===typeof k&&k(g);return g},_getSingleSelection:function(){return this._selections&&
0<this._selections.length?this._selections[0]:null},setSelections:function(k){var g=this._selections;Array.isArray(k)?this._selections=0<k.length?k.slice():null:this._selections=k?[k]:null;g!==this._selections&&this.dispatchEvent({type:"selectionChanged",selection:this._getSingleSelection(),selections:this._selections})}};m.prototype.constructor=m;return{Selection:m}});
define("orion/operationsClient",["i18n!orion/operations/nls/messages","orion/Deferred"],function(l,n){function m(f,d,a){return f[d].apply(f,a)}function k(f){this._location=f}function g(){var f=new n;f.reject(l["No Matching OperationService for location:"]+this._location);return f}function h(f){this._services=[];this._patterns=[];this._operationListeners=[];this._currentLongpollingIds=[];this._preferenceService=f.getService("orion.core.preference");for(var d=f.getServiceReferences("orion.core.operation"),
a=0;a<d.length;a++){var e=f.getService(d[a]);this._services[a]=e;e=d[a].getProperty("pattern")||".*";"^"!==e[0]&&(e="^"+e);this._patterns[a]=RegExp(e)}this._getService=function(a){if(!a)return this._services[0];for(var e=0;e<this._patterns.length;++e)if(this._patterns[e].test(a))return this._services[e];this._operations.remove(a);return new k(a)}}k.prototype={getOperation:g,getOperations:g,removeCompletedOperations:g,removeOperation:g,cancelOperation:g};k.prototype.constructor=k;h.prototype={getOperations:function(){var f=
new n;if(this._operations)return f.resolve(this._operations),f;var d=this;this._preferenceService.getPreferences("/operations").then(function(a){d._operations=a;f.resolve(d._operations)});return f},getOperation:function(f){return m(this._getService(f),"getOperation",arguments)},removeCompletedOperations:function(){for(var f=[],d=this,a=0;a<this._services.length;a++){var e=this._patterns[a],b=new n;f[a]=b.promise;m(this._services[a],"removeCompletedOperations").then(function(a){return function(b){Array.isArray(b)&&
d.getOperations.bind(d)().then(function(d){for(var f=d.keys(),g=0;g<f.length;g++){var h=f[g];e.test(h)&&0>b.indexOf(h)&&d.remove(h)}a.resolve()})}}(b),function(a){return function(b){a.reject(b)}}(b))}return n.all(f)},removeOperation:function(f){var d=this;return m(this._getService(f),"removeOperation",arguments).then(function(a){d.getOperations.bind(d)().then(function(a){a.remove(f)})},function(a){return a},function(a){return a})}};h.prototype.constructor=h;return{OperationsClient:h}});
define("orion/search/nls/root/messages",{"Find:":"Find:","Find With":"Find With","ReplaceWith:":"ReplaceWith:","Replace With":"Replace With","Show all":"Show all","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...":"Replace...",
"Replace All":"Replace All","Show Replace":"Show Replace","Hide Replace":"Hide Replace","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","\x3c Previous Page":"\x3c Previous Page","Show previous page of search result":"Show previous page of search result","Next Page \x3e":"Next Page \x3e","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","Save frequently used searches by clicking on the ${0} button above.":"Save frequently used searches by clicking on the ${0} button above.",
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","File name":"File name","Path name":"Path name",Save:"Save","Type filter text":"Type filter text","Scope Search":"Scoped 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 \x3ctd([\\s\\S]*?)\x3c/td\x3e with \x3cspan$1\x3c/span\x3e.":"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 \x3ctd([\\s\\S]*?)\x3c/td\x3e with \x3cspan$1\x3c/span\x3e.",
"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 \x3ctd([\\s\\S]*?)\x3c/td\x3e with \x3cspan$1\x3c/span\x3e.":"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 \x3ctd([\\s\\S]*?)\x3c/td\x3e with \x3cspan$1\x3c/span\x3e.",Scope:"Scope","Show previous search terms":"Show previous search terms","Show previous replace terms":"Show previous replace terms","Show replacement preview":"Show replacement preview",
"File name patterns (comma-separated)":"File name patterns (comma-separated)","(* \x3d any string, ? \x3d any character)":"(* \x3d any string, ? \x3d any character)","Choose a Folder":"Choose a Folder"});define("orion/search/nls/messages",["orion/i18n!orion/search/nls/messages","orion/search/nls/root/messages"],function(l,n){var m={root:n};Object.keys(l).forEach(function(k){"undefined"===typeof m[k]&&(m[k]=l[k])});return m});
define("orion/webui/treetable",["i18n!orion/nls/messages","orion/webui/littlelib"],function(l,n){function m(k){this._init(k)}m.prototype={_init:function(k){var g=k.parent,h=this,g=n.node(g);if(!g)throw l["no parent"];if(!k.model)throw l["no tree model"];if(!k.renderer)throw l["no renderer"];this._parent=g;this._treeModel=k.model;this._onComplete=k.onComplete;this._renderer=k.renderer;this._showRoot=void 0===k.showRoot?!1:k.showRoot;this._indent=void 0===k.indent?16:k.indent;this._onCollapse=k.onCollapse;
this._labelColumnIndex=void 0===k.labelColumnIndex?0:k.labelColumnIndex;this._id=void 0===k.id?"treetable":k.id;this._tableStyle=k.tableStyle;this._tableElement=k.tableElement||"table";this._tableBodyElement=k.tableBodyElement||"tbody";this._tableRowElement=k.tableRowElement||"tr";this._treeModel.getRoot(function(f){h._root=f;h._showRoot?(f._depth=0,h._generate([f],0)):h._treeModel.getChildren(f,function(d){h.destroyed||h._generate(d,0)})})},destroy:function(){this.destroyed=!0},_generate:function(k,
g){n.empty(this._parent);var h=document.createElement("div");this._renderer.wrapperCallback&&this._renderer.wrapperCallback(h);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";0===k.length?this._renderer.emptyCallback&&this._renderer.emptyCallback(this._bodyElement):this._generateChildren(k,g);f.appendChild(this._bodyElement);h.appendChild(f);this._parent.appendChild(h);this._rowsChanged();this._onComplete&&this._onComplete(this)},_generateChildren:function(k,g,h){for(var f=0;f<k.length;f++){var d=document.createElement(this._tableRowElement);d.id=this._treeModel.getId(k[f]);d._depth=g;d._item=k[f];this._renderer.render(k[f],d);var a=this._indent*g;d.childNodes[Math.min(d.childNodes.length-
1,this._labelColumnIndex)].style.paddingLeft=a+"px";this._renderer.rowCallback&&this._renderer.rowCallback(d,k[f]);h?(this._bodyElement.insertBefore(d,h.nextSibling),h&&(h=d)):this._bodyElement.appendChild(d)}},_rowsChanged:function(){this._renderer.rowsChanged&&this._renderer.rowsChanged()},getSelected:function(){return this._renderer.getSelected()},refresh:function(k,g,h){var f=this._treeModel.getId(k),d;if(f===this._id)this._removeChildRows(f),this._generateChildren(g,0),this._rowsChanged();else if(f===
this._treeModel.getId(this._root)&&k.removeAll)this._removeAllRows(),this._generateChildren(g,0),this._rowsChanged();else{var a=n.node(f);a?(a._item=k,a&&(h||a._expanded)?(this._removeChildRows(f),g?(a._expanded=!0,this._renderer.updateExpandVisuals(a,!0),this._generateChildren(g,a._depth+1,a),this._rowsChanged()):(d=this,this._renderer.updateExpandVisuals(a,"progress"),g=this._treeModel.getChildren(a._item,function(e){d.destroyed||(d._renderer.updateExpandVisuals(a,!0),a._expanded||(a._expanded=
!0,d._generateChildren(e,a._depth+1,a),d._rowsChanged()))}))):this._renderer.updateExpandVisuals(a,!1)):console.log(l["could not find table row "]+f)}},getItem:function(k){var g=n.node(k);return g&&g._item?g._item:k},toggle:function(k){var g=n.node(k);g&&(g._expanded?this.collapse(k):this.expand(k))},isExpanded:function(k){k="string"===typeof k?k:this._treeModel.getId(k);return(k=n.node(k))?k._expanded:!1},expand:function(k,g,h){k="string"===typeof k?k:this._treeModel.getId(k);var f=n.node(k);if(f){var d=
this;f._expanded?g&&g.apply(d,h):(this._renderer.updateExpandVisuals(f,"progress"),this._treeModel.getChildren(f._item,function(a){d.destroyed||(d._renderer.updateExpandVisuals(f,!0),f._expanded||(f._expanded=!0,d._generateChildren(a,f._depth+1,f),d._rowsChanged()),g&&g.apply(d,h))}))}},_removeChildRows:function(k){for(var g=k===this._id,h=!1,f=-1,d=[],a=n.$$array(".treeTableRow",this._parent),e=0;e<a.length;e++){var b=a[e];if(h)break;g?b._depth>f?d.push(b):h=!0:b.id===k&&(g=!0,f=b._depth)}for(k=
0;k<d.length;k++)g=d[k],g.parentNode.removeChild(g)},_removeAllRows:function(){for(var k=n.$$array(".treeTableRow",this._parent),g=0;g<k.length;g++)k[g].parentNode.removeChild(k[g])},collapse:function(k){k="string"===typeof k?k:this._treeModel.getId(k);var g=n.node(k);if(g){if(!g._expanded)return;g._expanded=!1;this._renderer.updateExpandVisuals(g,!1);this._removeChildRows(k);this._rowsChanged()}this._onCollapse&&this._onCollapse(g._item)},getIndent:function(){return this._indent}};m.prototype.constructor=
m;return{TableTree:m}});
define("orion/treeModelIterator",[],function(){var l={};l.TreeModelIterator=function(){function l(m,k){this.firstLevelChildren=m;this.reset();this._init(k)}l.prototype={_init:function(l){l&&(this.isExpanded=l.isExpanded,this.isExpandable=l.isExpandable,this.forceExpandFunc=l.forceExpandFunc,this.getChildrenFunc=l.getChildrenFunc)},topLevel:function(l){return l.parent?l.parent===this.root:!0},_getChildren:function(l){return"function"===typeof this.getChildrenFunc?this.getChildrenFunc(l):l?l.children:
null},_expanded:function(l){if(!l)return!0;var k=this._getChildren(l),k=k&&0<k.length;this.isExpanded&&k&&(k=this.isExpanded(l));return k},_expandable:function(l){return!l?!0:this.isExpandable?this.isExpandable(l):!1},_diveIn:function(l){return this._expanded(l)?(l=this._getChildren(l),this.setCursor(l[0]),this.cursor()):null},_drillToLast:function(l){return this._expanded(l)?(l=this._getChildren(l),this._drillToLast(l[l.length-1])):l},_forward:function(l){if(!this._cursor)return null;var k=this._diveIn(this._cursor);
if(!k){if(l&&this._expandable(this._cursor)&&this.forceExpandFunc){var g=this;return this.forceExpandFunc(this._cursor,"first",function(h){h&&g.setCursor(h)})}(k=this._findSibling(this._cursor,!0))&&this.setCursor(k)}return k},_backward:function(l){if(!this._cursor)return null;var k=this._findSibling(this._cursor,!1);k&&k!==this._cursor.parent&&(k=this._drillToLast(k));if(l&&k&&this._expandable(k)&&this.forceExpandFunc&&k!==this._cursor.parent){var g=this;return this.forceExpandFunc(k,"last",function(h){h&&
g.setCursor(h)})}k&&this.setCursor(k);return k},_findSibling:function(l,k){for(var g=this.topLevel(l),h=this._getChildren(l.parent),h=g?this.firstLevelChildren:h,f=0;f<h.length;f++)if(h[f]===l)return 0===f&&!k?g?null:l.parent:f===h.length-1&&k?g?null:this._findSibling(l.parent,k):k?h[f+1]:h[f-1];return null},_inParentChain:function(l,k){for(var g=l.parent;g;){if(g===k)return!0;g=g.parent}return!1},_getTopLevelParent:function(l){if(this.topLevel(l))return l;for(l=l.parent;l;){if(this.topLevel(l))return l;
l=l.parent}return null},_onCollapse:function(l){return this._expanded(l.parent)?l:this._onCollapse(l.parent)},_scan:function(l,k,g){this.setCursor(k);var h=[];for(h.push(k);;){if(this.iterate(l))h.push(this.cursor());else break;if(g===this.cursor())return h}return null},setCursor:function(l){this._prevCursor=this._cursor;this._cursor=l},setTree:function(l){this.firstLevelChildren=l;0<this.firstLevelChildren.length&&(this.root=this.firstLevelChildren[0].parent)},scan:function(l,k){var g=this.cursor(),
h=this._scan(!0,l,k);h||(h=this._scan(!1,l,k));this.setCursor(g);return h},iterate:function(l,k){return l?this._forward(k):this._backward(k)},iterateOnTop:function(l,k){var g=this._findSibling(this._getTopLevelParent(this.cursor()),l);g?this.setCursor(g):k&&0<this.firstLevelChildren.length&&this.setCursor(l?this.firstLevelChildren[0]:this.firstLevelChildren[this.firstLevelChildren.length-1])},collapse:function(l){return!this._cursor?null:this._inParentChain(this._cursor,l)?(this.setCursor(l),this._cursor):
null},reset:function(){this.root=this._prevCursor=this._cursor=null;0<this.firstLevelChildren.length&&(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 l}();return l});
define("orion/explorers/explorerNavHandler",["orion/webui/littlelib","orion/treeModelIterator","orion/uiUtils"],function(l,n,m){var k={},g=-1!==navigator.userAgent.indexOf("iPad"),h=-1!==window.navigator.platform.indexOf("Mac");k.ExplorerNavHandler=function(){function f(d,a,e){this.explorer=d;this.model=this.explorer.model;this._navDict=a;this._listeners=[];this._selections=[];this._currentColumn=0;d=this._getEventListeningDiv();d.tabIndex=0;d.classList.add("selectionModelContainer");var b=this;this._modelIterator=
new n.TreeModelIterator([],{isExpanded:this.isExpanded.bind(this),getChildrenFunc:e.getChildrenFunc,isExpandable:this.explorer.renderer.isExpandable?function(a){return b.explorer.renderer.isExpandable(a)}:function(a){return b.isExpandable(a)},forceExpandFunc:this.explorer.forceExpandFunc?function(a,e,d){return b.explorer.forceExpandFunc(a,e,d)}:void 0});this._init(e);(!e||!1!==e.setFocus)&&d.focus();e=function(a){if(m.isFormElement(a.target)||b.explorer.preventDefaultFunc&&b.explorer.preventDefaultFunc(a,
b._modelIterator.cursor()))return!0;if(a.keyCode===l.KEY.DOWN)return b.onDownArrow(a);if(a.keyCode===l.KEY.UP)return b.onUpArrow(a);if(a.keyCode===l.KEY.RIGHT)return b.onRightArrow(a);if(a.keyCode===l.KEY.LEFT)return b.onLeftArrow(a);if(a.keyCode===l.KEY.SPACE)return b.onSpace(a);if(a.keyCode===l.KEY.ENTER)return b.onEnter(a)};d.addEventListener("keydown",e,!1);this._listeners.push({type:"keydown",listener:e});e=function(a){if(b.explorer.onFocus)b.explorer.onFocus(!1);else b.toggleCursor(null,!1)};
d.addEventListener("blur",e,!1);this._listeners.push({type:"blur",listener:e});e=function(a){if(b.explorer.onFocus)b.explorer.onFocus(!0);else b.toggleCursor(null,!0)};d.addEventListener("focus",e,!1);this._listeners.push({type:"focus",listener:e});this._parentDiv=d}f.prototype={destroy:function(){this._parentDiv.classList.remove("selectionModelContainer");this.removeListeners()},_init:function(d){this._linearGridMove=!1;d&&(this._selectionPolicy=d.selectionPolicy,this.gridClickSelectionPolicy=d.gridClickSelectionPolicy||
"none",this.preventDefaultFunc=d.preventDefaultFunc,this.postDefaultFunc=d.postDefaultFunc)},_ctrlKeyOn:function(d){return h?d.metaKey:d.ctrlKey},removeListeners:function(){if(this._listeners)for(var d=0;d<this._listeners.length;d++)this._parentDiv.removeEventListener(this._listeners[d].type,this._listeners[d].listener,!1)},focus:function(){var d=this._getEventListeningDiv();d&&d.focus()},_getEventListeningDiv:function(d){return this.explorer.keyEventListeningDiv&&"function"===typeof this.explorer.keyEventListeningDiv?
this.explorer.keyEventListeningDiv(d):l.node(this.explorer._parentId)},isExpandable:function(d){return!d?!1:l.node(this.explorer.renderer.expandCollapseImageId(this.model.getId(d)))?!0:!1},isExpanded:function(d){return!d?!1:this.explorer.myTree.isExpanded(this.model.getId(d))},refreshSelection:function(d,a){var e=this;this.explorer.selection&&this.explorer.selection.getSelections(function(b){e._clearSelection(a);for(var f=0;f<b.length;f++)e._selections.push(b[f]);0<e._selections.length?e.cursorOn(e._selections[0],
!0,!1,d):e.cursorOn(null,!1,!1,d);e._shiftSelectionAnchor&&0<=e._inSelection(e._shiftSelectionAnchor)||(e._shiftSelectionAnchor=null)})},refreshModel:function(d,a,e,b){this._currentColumn=0;this.topIterationNodes=[];this.model=a;this._navDict=d;this.model.getTopIterationNodes?this.topIterationNodes=this.model.getTopIterationNodes():e&&(this.topIterationNodes=e);this._modelIterator.setTree(this.topIterationNodes);!b&&this.explorer.selection&&(this.toggleCursor(this._modelIterator.cursor(),!1),this._modelIterator.reset());
this.refreshSelection(!0)},getTopLevelNodes:function(){return this._modelIterator.firstLevelChildren},_inSelection:function(d){d=this.model.getId(d);for(var a=0;a<this._selections.length;a++)if(d===this.model.getId(this._selections[a]))return a;return-1},_clearSelection:function(d){if(d)for(d=0;d<this._selections.length;d++)this._checkRow(this._selections[d],!0);this._selections=[]},getSelectionPolicy:function(){return this._selectionPolicy},setSelectionPolicy:function(d){this._selectionPolicy!==
d&&(("readonlySelection"===this._selectionPolicy||"readonlySelection"===d)&&this._toggleSelectionClass("disabledRow","readonlySelection"===d),this._selectionPolicy=d,"cursorOnly"===this._selectionPolicy&&this._clearSelection(!0))},setSelection:function(d,a,e){"readonlySelection"!==this._selectionPolicy&&("cursorOnly"===this._selectionPolicy?a&&this.explorer.renderer._useCheckboxSelection&&this._checkRow(d,!0):this._isRowSelectable(d)&&(!a||"singleSelection"===this._selectionPolicy?(this._clearSelection(!0),
this._checkRow(d,!1),this._selections.push(d),this._lastSelection=d):(a=this._inSelection(d),0<=a?(this._checkRow(d,!0),this._selections.splice(a,1)):(this._checkRow(d,!1),this._selections.push(d),this._lastSelection=d)),e&&(this._shiftSelectionAnchor=this._lastSelection),this.explorer.selection&&(this.explorer.renderer.storeSelections(),this.explorer.selection.setSelections(this._selections))))},moveColumn:function(d,a){d||(d=this.currentModel());var e=this._getGridChildren(d);if(e&&1<e.length||
0===a&&e){0!==a&&this.toggleCursor(d,!1);var b=this._currentColumn,f=!0,b=b+a;0>b?(this._linearGridMove&&0!==a&&(this._modelIterator.iterate(!1)?d=this.currentModel():f=!1),b=f?e.length-1:this._currentColumn):b>=e.length&&(this._linearGridMove&&0!==a&&(this._modelIterator.iterate(!0)?d=this.currentModel():f=!1),b=f?0:this._currentColumn);this._currentColumn=b;0!==a&&this.toggleCursor(d,!0);return!0}return!1},_getGridChildren:function(d){return this._navDict?this._navDict.getGridNavHolder(d):null},
getCurrentGrid:function(d){d||(d=this.currentModel());return(d=this._getGridChildren(d))&&0<d.length?d[this._currentColumn]:null},getAriaContainerElement:function(d){for(var a=this._parentDiv,e;d&&d!==a&&"grid"!==(e=d.getAttribute("role"))&&"tree"!==e&&"treegrid"!==e;)d=d.parentNode;return d===a?null:d},toggleCursor:function(d,a){var e=this.getRowDiv(d),b=this.getCurrentGrid(d);b?(e&&(a?e.classList.add("treeIterationCursorRow"):e.classList.remove("treeIterationCursorRow")),b.domNode&&(e=this.getAriaContainerElement(b.domNode),
a?(b.domNode.classList.add("treeIterationCursor"),e&&e.setAttribute("aria-activedescendant",b.domNode.id)):b.domNode.classList.remove("treeIterationCursor"))):e&&(a?e.classList.add("treeIterationCursorRow_Dotted"):e.classList.remove("treeIterationCursorRow_Dotted"))},currentModel:function(){return this._modelIterator.cursor()},cursorOn:function(d,a,e,b){var f,g;if(d||a){if(g===this._modelIterator.cursor())return;f=this._modelIterator.cursor();g=d;this._modelIterator.setCursor(g)}else f=this._modelIterator.prevCursor(),
g=this._modelIterator.cursor();if(f!==g||a)if(this.toggleCursor(f,!1),!a||g){this.moveColumn(null,0);this.toggleCursor(g,!0);if((d=this.getRowDiv())&&!b){b=d.parentNode;for(a=document.documentElement;b&&b!==a;){var h=window.getComputedStyle(b,null);if(!h)break;h=h.getPropertyValue("overflow-y");if("auto"===h||"scroll"===h)break;b=b.parentNode}b&&(a=!0,d.offsetTop<=b.scrollTop?(a=!1,void 0===e&&(e=!1)):d.offsetTop+d.offsetHeight>=b.scrollTop+b.clientHeight&&(a=!1,void 0===e&&(e=!0)),a||d.scrollIntoView(!e))}if(this.explorer.onCursorChanged)this.explorer.onCursorChanged(f,
g)}},getSelection:function(){return this._selections},getSelectionIds:function(){for(var d=[],a=0;a<this._selections.length;a++)d.push(this.model.getId(this._selections[a]));return d},getRowDiv:function(d){d=d?d:this._modelIterator.cursor();if(!d)return null;d=this.model.getId(d);var a=this._navDict.getValue(d);return a&&a.rowDomNode?a.rowDomNode:l.node(d)},iterate:function(d,a,e,b){var f=null;if(this.topIterationNodes&&0!==this.topIterationNodes.length)if(b){b=this.currentModel();for((f=this._modelIterator.iterate(d,
a))&&this._setCursorOnItem(d,e);f&&f.isNotSelectable;)(f=this._modelIterator.iterate(d,a))&&this._setCursorOnItem(d,e);f||(this.cursorOn(b,!0,!1,!0),this._setCursorOnItem(d,e))}else(f=this._modelIterator.iterate(d,a))&&this._setCursorOnItem(d,e)},_toggleSelectionClass:function(d,a){this._selections.forEach(function(e){(e=this.getRowDiv(e))&&(a?e.classList.add(d):e.classList.remove(d))}.bind(this))},_setCursorOnItem:function(d,a){this.cursorOn(null,!1,d);if(a){var e=this._inSelection(this._modelIterator.prevCursor()),
b=this._inSelection(this._modelIterator.cursor());0<=e&&0<=b?this.setSelection(this._modelIterator.prevCursor(),!0):this.setSelection(this.currentModel(),!0)}},_checkRow:function(d,a){if(this.explorer.renderer._useCheckboxSelection&&"singleSelection"!==this._selectionPolicy){var e=this.getRowDiv(d);if(e){var b=l.node(this.explorer.renderer.getCheckBoxId(e.id)),f=a?!b.checked:!0;if(f!==b.checked)this.explorer.renderer.onCheck(e,b,f,!0)}}else this._select(d,a)},_select:function(d,a){d||(d=this._modelIterator.cursor());
var e=this.getRowDiv(d);e&&(0>this._inSelection(d)?e.classList.add("checkedRow"):e.classList.remove("checkedRow"))},_onModelGrid:function(d,a){var e=this._getGridChildren(d);if(e)for(var b=0;b<e.length;b++)if(a.target===e[b].domNode)return!0;return!1},onClick:function(d,a){if("readonlySelection"===this._selectionPolicy||this.isDisabled(this.getRowDiv(d)))l.stop(a);else{var e=l.node(this.explorer.renderer.expandCollapseImageId(this.model.getId(d)));if(a.target!==e&&!("none"===this.gridClickSelectionPolicy&&
this._onModelGrid(d,a)))if(this.cursorOn(d,!0,!1,!0),g)this.setSelection(d,!0);else if(this._ctrlKeyOn(a))this.setSelection(d,!0,!0);else if(a.shiftKey&&this._shiftSelectionAnchor){if(e=this._modelIterator.scan(this._shiftSelectionAnchor,d)){this._clearSelection(!0);for(var b=0;b<e.length;b++)this.setSelection(e[b],!0)}}else this.setSelection(d,!1,!0)}},onCollapse:function(d){this._modelIterator.collapse(d)&&this.cursorOn()},onUpArrow:function(d){this.iterate(!1,!1,d.shiftKey,!0);!this._ctrlKeyOn(d)&&
!d.shiftKey&&this.setSelection(this.currentModel(),!1,!0);d.preventDefault();return!1},onDownArrow:function(d){this.iterate(!0,!1,d.shiftKey,!0);!this._ctrlKeyOn(d)&&!d.shiftKey&&this.setSelection(this.currentModel(),!1,!0);d.preventDefault();return!1},_shouldMoveColumn:function(d){var a=this.currentModel(),e=this._getGridChildren(a);return e&&1<e.length?this.isExpandable(a)?this._ctrlKeyOn(d):!0:!1},onLeftArrow:function(d){if(this._shouldMoveColumn(d))return this.moveColumn(null,-1),d.preventDefault(),
!0;var a=this._modelIterator.cursor();if(!a)return!1;if(this.isExpandable(a)&&this.isExpanded(a))return this.explorer.myTree.collapse(a),d.preventDefault(),!0;this._modelIterator.topLevel(a)?this.explorer.scopeUp&&"function"===typeof this.explorer.scopeUp&&this.explorer.scopeUp():(this.cursorOn(a.parent),this.setSelection(a.parent,!1,!0))},onRightArrow:function(d){if(this._shouldMoveColumn(d))return this.moveColumn(null,1),d.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)),d.preventDefault(),!1},_isRowSelectable:function(d){return this.explorer.isRowSelectable?this.explorer.isRowSelectable(d):!0},onSpace:function(d){this.setSelection(this.currentModel(),!0,!0);d.preventDefault()},onEnter:function(d){var a=this.getCurrentGrid(this._modelIterator.cursor());if(a)if(a.widget)if("function"===typeof a.onClick)a.onClick();else"function"===
typeof a.widget.focus&&a.widget.focus();else{var e=document.createEvent("MouseEvents");e.initMouseEvent("click",!0,!0,window,0,0,0,0,0,this._ctrlKeyOn(d),!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(d)?window.open(e.href):window.location.href=e.href)),this.explorer.renderer.performRowAction)return this.explorer.renderer.performRowAction(d,
a),d.preventDefault(),!1},setIsNotSelectable:function(d,a){d.isNotSelectable=a},disableItem:function(d){var a=this.getRowDiv(d);this.isExpandable(d)&&this.isExpanded(d)&&(this._modelIterator.collapse(d),this.explorer.myTree.toggle(a.id));a.classList.remove("checkedRow");a.classList.add("disabledNavRow");this.setIsNotSelectable(d,!0)},isDisabled:function(d){return d.classList.contains("disabledNavRow")},enableItem:function(d){var a=this.getRowDiv(d);a&&(a.classList.remove("disabledNavRow"),this.setIsNotSelectable(d,
!1))}};return f}();k.ExplorerNavDict=function(){function f(d){this._dict={};this._model=d}f.prototype={addRow:function(d,a){var e=this._model.getId(d);this._dict[e]={model:d,rowDomNode:a}},getValue:function(d){return this._dict[d]},getGridNavHolder:function(d,a){if(!d)return null;var e=this._model.getId(d);return this._dict[e]?(!this._dict[e].gridChildren&&a&&(this._dict[e].gridChildren=[]),this._dict[e].gridChildren):null},initGridNavHolder:function(d){if(!d)return null;d=this._model.getId(d);this._dict[d]&&
(this._dict[d].gridChildren=null)}};return f}();return k});
define("orion/explorers/explorer","i18n!orion/nls/messages require orion/webui/littlelib orion/webui/treetable orion/explorers/explorerNavHandler orion/commands".split(" "),function(l,n,m,k,g,h){var f={};f.Explorer=function(){function d(a,e,b,d){this.registry=a;this.renderer=b;this.selection=e;this.commandService=d;this.renderer&&(this.renderer.explorer=this);this.myTree=null}d.prototype={destroy:function(){this._navHandler&&this._navHandler.destroy();this.model&&this.model.destroy();this.myTree&&
this.myTree.destroy();this.destroyed=!0},changedItem:function(a,e){this.myTree&&this.myTree.refresh.bind(this.myTree)(a,e,!0)},updateCommands:function(a){this.myTree&&this.myTree._renderer.updateCommands.bind(this.myTree._renderer)(a)},makeNewItemPlaceholder:function(a,e,b){var d=null;if(a=this.getRow(a)){var d=a.parentNode,f=document.createElement("tr");f.id=e+"placeHolderRow";f.classList.add("navRow");var g=document.createElement("td");g.id=e+"placeHolderCol";g.classList.add("navColumn");f.appendChild(g);
b?d.insertBefore(f,a.nextSibling):d.insertBefore(f,a);g.style.paddingLeft=a.firstChild.style.paddingLeft;d={wrapperNode:f,refNode:g,destroyFunction:function(){try{f&&f.parentNode&&f.parentNode.removeChild(f)}catch(a){}}}}return d},getRow:function(a){if(a=this.model.getId(a))return m.node(a)},collapseAll:function(){for(var a=this._navHandler.getTopLevelNodes(),e=0;e<a.length;e++)this.myTree.collapse(a[e])},expandAll:function(a){if(a)this._expandRecursively(a);else if(this._navHandler){a=this._navHandler.getTopLevelNodes();
for(var e=0;e<a.length;e++)this._expandRecursively(a[e])}},_expandRecursively:function(a){if(this._navHandler&&this._navHandler.isExpandable(a)){var e=this;this.myTree.expand(a,function(){e.model.getChildren(a,function(a){if(!(void 0===a||null===a))for(var d=a.length,f=0;f<d;f++)e._expandRecursively(a[f])})})}},createTree:function(a,e,b){a="string"===typeof a?a:a.id||a;this.selection&&this.selection.setSelections([]);this.getNavHandler()&&this.getNavHandler()._clearSelection();var d=a+"innerTree",
f=m.node(d);f&&m.empty(f);e&&(e.rootId=d);this.model=e;this._parentId=a;this._treeOptions=b;if(!b||b&&!b.noSelection)this.selectionPolicy=b?b.selectionPolicy:"",this._navDict=new g.ExplorerNavDict(this.model);this.myTree=new k.TableTree({id:d,model:e,parent:a,onComplete:b?b.onComplete:void 0,labelColumnIndex:this.renderer.getLabelColumnIndex(),renderer:this.renderer,showRoot:b?!!b.showRoot:!1,indent:b?b.indent:void 0,onCollapse:b?b.onCollapse:void 0,navHandlerFactory:b?b.navHandlerFactory:void 0,
tableElement:b?b.tableElement:void 0,tableBodyElement:b?b.tableBodyElement:void 0,tableRowElement:b?b.tableRowElement:void 0});this.renderer._initializeUIState();"cursorOnly"===this.selectionPolicy&&this.initNavHandler()},getNavHandler:function(){return this._navHandler},getNavDict:function(){return this._navDict},refreshSelection:function(){if(this.selection){var a=this.getNavHandler(),e=[];if(a&&this.getNavDict())for(var b=a.getSelection(),d=0;d<b.length;d++){var f=a.getRowDiv(b[d]);f&&f.parentNode&&
(f=this.getNavDict().getValue(this.model.getId(b[d])),f.model&&e.push(f.model))}this.selection.setSelections(e)}},getRootPath:function(){return this.model&&this.model.root?this.model.root.Location:null},initNavHandler:function(){var a=this._treeOptions;if(!a||a&&!a.noSelection){this.getNavHandler()||(this._navHandler=a&&a.navHandlerFactory&&"function"===typeof a.navHandlerFactory.createNavHandler?a.navHandlerFactory.createNavHandler(this,this._navDict,a):new g.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(b){b instanceof Array?e.getNavHandler().refreshModel(e.getNavDict(),e.model,b):b.children&&b.children instanceof Array&&e.getNavHandler().refreshModel(e.getNavDict(),e.model,b.children);a&&a.setFocus&&e.getNavHandler().cursorOn(null,!1,!1,!0)})}},_lastHash:null,checkbox:!1};return d}();f.createExplorerCommands=function(d,a){function e(b){return"function"===
typeof b.getItemCount&&0<b.getItemCount()?a?a(b):!0:!1}var b=new h.Command({tooltip:l["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 h.Command({tooltip:l["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()}});
d.addCommand(b);d.addCommand(f)};f.ExplorerModel=function(){function d(a,e,b){this.rootPath=a;this.fetchItems=e;this.idPrefix=b||""}d.prototype={destroy:function(){this.destroyed=!0},getRoot:function(a){var e=this;this.fetchItems(this.rootPath).then(function(b){e.root=b;a(b)})},getChildren:function(a,e){a.Children?e(a.Children):a.ChildrenLocation?this.fetchItems(a.ChildrenLocation).then(function(b){a.Children=b;e(b)}):e([])},getId:function(a){if(a.Location===this.root.Location)return this.rootId;
a=a.Location.replace(/[\\\/]/g,"");for(var e=this.idPrefix,b=0;b<a.length;b++)e=a[b].match(/[^\.\:\-\_0-9A-Za-z]/g)?e+a.charCodeAt(b):e+a[b];return e}};return d}();f.ExplorerFlatModel=function(){function d(a,e,b){this.rootPath=a;this.fetchItems=e;this.root=b}d.prototype=new f.ExplorerModel;d.prototype.getRoot=function(a){if(this.root)a(this.root);else{var e=this;this.fetchItems(this.rootPath).then(function(b){e.root=b;a(b)})}};d.prototype.getChildren=function(a,e){a===this.root?e(this.root):e([])};
return d}();f.ExplorerRenderer=function(){function d(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"}d.prototype={_init:function(a){a&&(this._useCheckboxSelection=void 0===a.checkbox?!1:a.checkbox,this.selectionPolicy=a.singleSelection?"singleSelection":"",this._cachePrefix=a.cachePrefix,a.getCheckedFunc&&(this.getCheckedFunc=
a.getCheckedFunc),a.onCheckedFunc&&(this.onCheckedFunc=a.onCheckedFunc),this._noRowHighlighting=a.noRowHighlighting,this._highlightSelection=!0,this._treeTableClass=a.treeTableClass||"treetable",!1===a.highlightSelection&&(this._highlightSelection=!1),this.actionScopeId||(this.actionScopeId=a.actionScopeId),this.commandService||(this.commandService=a.commandService))},getLabelColumnIndex:function(){return this.explorer.checkbox?1:0},initTable:function(a,e){this.tableTree=e;this.tableNode=a;m.empty(a);
this._treeTableClass&&a.classList.add(this._treeTableClass);this.renderTableHeader(a)},getActionsColumn:function(a,e,b,d,f){b=b||"tool";var g=document.createElement("td");g.id=e.id+"actionswrapper";d&&g.classList.add(d);this.actionScopeId&&this.commandService?this.commandService.renderCommands(this.actionScopeId,g,a,this.explorer,b,null,f&&this.explorer.getNavDict()?this.explorer.getNavDict().getGridNavHolder(a,!0):null):window.console.log("Warning, no command service or action scope was specified.  No commands rendered.");
return g},initCheckboxColumn:function(a){if(this._useCheckboxSelection)return document.createElement("th")},getCheckboxColumn:function(a,e){if(this._useCheckboxSelection){var b=document.createElement("td"),d=document.createElement("span");d.id=this.getCheckBoxId(e.id);d.classList.add("core-sprite-check");d.classList.add("selectionCheckmarkSprite");d.rowId=e.id;this.getCheckedFunc&&(d.checked=this.getCheckedFunc(a),d.checked?(this._highlightSelection&&e.classList.add("checkedRow"),d.classList.add("core-sprite-check_on")):
(this._highlightSelection&&e.classList.remove("checkedRow"),d.classList.remove("core-sprite-check_on")));b.appendChild(d);var f=this;d.addEventListener("click",function(b){f.onCheck(e,b.target,b.target.checked?!1:!0,!0,!1,a)},!1);return b}},getCheckBoxId:function(a){return a+"selectedState"},onCheck:function(a,e,b,d,f,g){(e.checked=b)?e.classList.add("core-sprite-check_on"):e.classList.remove("core-sprite-check_on");if(this.onCheckedFunc)this.onCheckedFunc(e.rowId,b,d,g);this.explorer.getNavHandler()&&
f&&this.explorer.getNavHandler().setSelection(this.explorer.getNavDict().getValue(a.id).model,!0)},storeSelections:function(){if(this.explorer.getNavHandler()){var a=this.explorer.getNavHandler().getSelectionIds(),e=this._getUIStatePreferencePath();e&&window.sessionStorage&&(window.sessionStorage[e+"selection"]=JSON.stringify(a))}},_restoreSelections:function(a){var e=this.explorer.getNavDict(),b=this.explorer.getNavHandler();if(b&&(e&&"cursorOnly"!==b.getSelectionPolicy())&&(a=window.sessionStorage[a+
"selection"],"string"===typeof a&&(a=0<a.length?JSON.parse(a):null),a)){for(var d=[],b=0;b<a.length;b++){var f=e.getValue(a[b]);if(f&&(f.rowDomNode&&f.model)&&(d.push(f.model),this._highlightSelection&&f.rowDomNode.classList.add("checkedRow"),f=m.node(this.getCheckBoxId(f.rowDomNode.id))))f.checked=!0,f.classList.add("core-sprite-check_on")}this.explorer.selection&&(this.explorer.selection.setSelections(d),this.explorer.getNavHandler()&&this.explorer.getNavHandler().refreshSelection())}},_storeExpansions:function(a){window.sessionStorage[a+
"expanded"]=JSON.stringify(this._expanded)},_restoreExpansions:function(a){var e=!1,b=window.sessionStorage[a+"expanded"];"string"===typeof b&&(b=0<b.length?JSON.parse(b):null);var d;if(b)for(d=0;d<b.length;d++)if(m.node(b[d])){this._expanded.push(b[d]);var f=this;this.tableTree.expand(b[d],function(){f._restoreSelections(a)});e=!0}return!e},_getUIStatePreferencePath:function(){if(this.explorer){var a=this.explorer.getRootPath();if(this._cachePrefix&&a)return a=a.replace(/[^\.\:\-\_0-9A-Za-z]/g,""),
"/"+this._cachePrefix+"/"+a+"/uiState"}return null},expandCollapseImageId:function(a){return a+"__expand"},updateExpandVisuals:function(a,e){var b=m.node(this.expandCollapseImageId(a.id));b&&(b.classList.remove(this._expandImageClass),b.classList.remove(this._collapseImageClass),b.classList.remove(this._progressImageClass),b.classList.add("progress"===e?this._progressImageClass:e?this._expandImageClass:this._collapseImageClass))},getExpandImage:function(a,e,b,d){var f=document.createElement("span");
f.id=this.expandCollapseImageId(a.id);e.appendChild(f);f.classList.add(this._twistieSpriteClass);f.classList.add(this._collapseImageClass);if(b){var g=document.createElement("span");e.appendChild(g);g.classList.add(d||"imageSprite");g.classList.add(b)}var h=this;f.onclick=function(b){if(!h.explorer.getNavHandler().isDisabled(a)){h.tableTree.toggle(a.id);if(h.tableTree.isExpanded(a.id))h._expanded.push(a.id),h.explorer.postUserExpand&&h.explorer.postUserExpand(a.id);else for(var e in h._expanded)if(h._expanded[e]===
a.id){h._expanded.splice(e,1);break}(b=h._getUIStatePreferencePath())&&window.sessionStorage&&h._storeExpansions(b)}};return f},render:function(a,e){e.classList.add("navRow");this.renderRow(a,e)},rowsChanged:function(){"cursorOnly"!==this.explorer.selectionPolicy&&(this.explorer.refreshSelection(),this.explorer.initNavHandler());this._noRowHighlighting||(m.$(".sectionTreeTable",this.tableNode.parentNode)||m.$(".treetable",this.tableNode.parentNode))&&m.$$array(".treeTableRow",this.tableNode).forEach(function(a,
e){var b=!(e%2)?"lightSectionTreeTableRow":"darkSectionTreeTableRow",d="lightSectionTreeTableRow"===b?"darkSectionTreeTableRow":"lightSectionTreeTableRow";a.classList.add(b);a.classList.remove(d)})},updateCommands:function(){if(this.commandService)for(var a=m.$$array(".treeTableRow"),e=0;e<a.length;e++){var b=a[e],d=m.node(b.id+"actionswrapper");this.commandService.destroy(d);this.actionScopeId&&this.commandService.renderCommands(this.actionScopeId,d,b._item,this.explorer,"tool")}},_initializeUIState:function(){this._expanded=
[];var a=this._getUIStatePreferencePath();a&&window.sessionStorage&&this._restoreExpansions(a)&&this._restoreSelections(a)}};return d}();f.SelectionRenderer=function(){function d(a,e){this._init(a);this.explorer=e}d.prototype=new f.ExplorerRenderer;d.prototype.renderTableHeader=function(a){var e=document.createElement("thead"),b=document.createElement("tr");e.classList.add("navTableHeading");this._useCheckboxSelection&&b.appendChild(this.initCheckboxColumn(a));for(var d=0,f=this.getCellHeaderElement(d);f;)0<
f.innerHTML.length&&f.classList.add("navColumn"),b.appendChild(f),f=this.getCellHeaderElement(++d);e.appendChild(b);0<d&&a.appendChild(e)};d.prototype.renderRow=function(a,e){e.verticalAlign="baseline";e.classList.add("treeTableRow");if(void 0===a.selectable||a.selectable){var b=this.explorer.getNavDict();if(b){"cursorOnly"!==this.explorer.selectionPolicy&&e.classList.add("selectableNavRow");b.addRow(a,e);var d=this;e.addEventListener("click",function(b){if(d.explorer.getNavHandler())d.explorer.getNavHandler().onClick(a,
b)},!1)}if(b=this.getCheckboxColumn(a,e))b.classList.add("checkColumn"),e.appendChild(b)}for(var b=0,f=this.getCellElement(b,a,e);f;)e.appendChild(f),0===b?this.getPrimColumnStyle?f.classList.add(this.getPrimColumnStyle(a)):f.classList.add("navColumn"):this.getSecondaryColumnStyle?f.classList.add(this.getSecondaryColumnStyle()):f.classList.add("secondaryColumn"),f=this.getCellElement(++b,a,e)};d.prototype.getCellHeaderElement=function(a){};d.prototype.getCellElement=function(a,e,b){};return d}();
f.SimpleFlatModel=function(){function d(a,e,b){this.items=a;this.getKey=b;this.idPrefix=e;this.root={children:a}}d.prototype=new f.ExplorerModel;d.prototype.getRoot=function(a){a(this.root)};d.prototype.getId=function(a){a=this.getKey(a).replace(/[\\\/]/g,"");for(var e="",b=0;b<a.length;b++)e=a[b].match(/[^\.\:\-\_0-9A-Za-z]/g)?e+a.charCodeAt(b):e+a[b];return this.idPrefix+e};d.prototype.getChildren=function(a,e){a===this.root?e(this.items):e([])};return d}();return f});
define("orion/widgets/browse/commitInfoRenderer",["orion/objects","orion/URITemplate","orion/webui/littlelib","orion/xhr","orion/URL-shim"],function(l,n,m,k){function g(d,a,e){return 0<d?1===d?a+" ":d+" "+e+" ":""}function h(d){d=new Date(d);var a=(new Date).getTime()-d.getTime();d=Math.floor(a/1E3/60/60/24/365);var a=a-31536E6*d,e=Math.floor(a/1E3/60/60/24/30),a=a-2592E6*e,b=Math.floor(a/1E3/60/60/24),a=a-864E5*b,f=Math.floor(a/1E3/60/60),h=Math.floor((a-36E5*f)/1E3/60),a=g(d,"a year","years"),k=
g(e,"a month","months"),l=g(b,"a day","days"),m=g(f,"an hour","hours"),h=g(h,"a minute","minutes"),n="";a?n=0<d?a:a+k:k?n=0<e?k:k+l:l?n=0<b?l:l+m:m?n=0<f?m:m+h:h&&(n=h);return n?n+"ago":"Just now"}function f(d){this._parentDomNode=m.node(d.parent);this._commitInfo=d.commitInfo}l.mixin(f.prototype,{destroy:function(){},_simpleMessage:function(d){var a=this._commitInfo.Message?this._commitInfo.Message:"";if(a){var e=a.replace(/\r\n|\n\r|\n|\r/g,"\n").split("\n");e&&0<e.length&&(a=e[0]);10<d&&a.length>
d&&(a=a.substring(0,d-3)+"...")}return a},_generateMessageNode:function(d){var a;if(this._commitInfo.URL||this._commitInfo.SHA1){a=document.createElement("a");if(this._commitInfo.SHA1){var e=(new URL("commit",window.location.href)).href,e=decodeURIComponent(e);a.href=(new n(e+"{/SHA1}")).expand(this._commitInfo)}else a.href=this._commitInfo.URL;a.classList.add("commitInfolink")}else a=document.createElement("span");a.appendChild(document.createTextNode(d));return a},_requestPhotoURL:function(d,a){var e=
this,b=new URL("/manage/service/com.ibm.team.jazzhub.common.service.IPhotoService/getContributorPhotoURI",window.location.href);b.query.set("contributorUserId",d);k("GET",b.href,{timeout:15E3}).then(function(b){b=JSON.parse(b.response);a.src=b.photoURI},function(){e._useOtherPhotoURL(a)})},_useOtherPhotoURL:function(d){d.src=this._commitInfo.AvatarURL?this._commitInfo.AvatarURL:"https://www.gravatar.com/avatar/?d\x3dmm"},renderSimple:function(d){this._parentDomNode.appendChild(this._generateMessageNode(this._simpleMessage(d)))},
render:function(d,a){var e=this._commitInfo.Author&&this._commitInfo.Author.Date?h(this._commitInfo.Author.Date):"",b=this._simpleMessage(-1),f=this._commitInfo.Author&&this._commitInfo.Author.Name?this._commitInfo.Author.Name:"",g=d;g||(g="Commit");g="Last "+g;if(a){var k=document.createElement("div"),l=new Image;this._commitInfo.Author&&this._commitInfo.Author.UserId?this._requestPhotoURL(this._commitInfo.Author.UserId,l):this._useOtherPhotoURL(l);l.classList.add("commitInfoAvatar");k.appendChild(l)}else k=
document.createElement("div"),k.classList.add("commitInfoLabelContainer"),k.appendChild(document.createTextNode(g.toUpperCase()));this._parentDomNode.appendChild(k);k=document.createElement("div");k.classList.add("commitInfoMessageContainer");l=document.createElement("div");l.classList.add("commitInfoAutorContainer");var w=document.createDocumentFragment(),n=document.createElement("span");n.appendChild(document.createTextNode(f));n.classList.add("navColumnBold");a?(f=document.createElement("span"),
f.appendChild(document.createTextNode(g)),f.classList.add("navColumnBold"),w.textContent=e?"${0} by ${1} "+e+".":"${0} by ${1}.",e=[f,n]):(w.textContent=e?"by ${0} "+e+".":"by ${0}.",e=[n]);m.processDOMNodes(w,e);l.appendChild(w);k.appendChild(l);e=document.createElement("div");e.classList.add("commitInfoMessageTextContainer");e.appendChild(this._generateMessageNode(b));k.appendChild(e);this._parentDomNode.appendChild(k)}});return{CommitInfoRenderer:f,calculateTime:h}});
define("orion/explorers/navigatorRenderer","i18n!orion/navigate/nls/messages orion/Deferred orion/explorers/explorer orion/explorers/navigationUtils orion/extensionCommands orion/objects orion/URITemplate orion/widgets/browse/commitInfoRenderer orion/webui/littlelib".split(" "),function(l,n,m,k,g,h,f,d,a){function e(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 b(a,b,d,p,k,l,m,B,v){b=h.clone(b);
var A;if(b.Directory)A=document.createElement("a"),A.className="navlinkonpage",p=!a?q:new f(a+"#{,resource,params*}"),A.href=p.expand({resource:b.ChildrenLocation}),b.Name&&A.appendChild(document.createTextNode(b.Name));else{k||(k=g.getOpenWithCommands(d));A=document.createElement("a");A.className="navlink targetSelector";l&&"object"===typeof l&&Object.keys(l).forEach(function(a){A[a]=l[a]});var C=null,D=null;if(C=B?B.holderDom:A)D=document.createElement("span"),D.className="core-sprite-file modelDecorationSprite thumbnail",
C.appendChild(D);b.Name&&A.appendChild(document.createTextNode(b.Name));var E=b.Location;m&&"object"===typeof m&&(b.params={},h.mixin(b.params,m));(a=g.getOpenWithCommand(d,b,k))&&(E=a.hrefCallback({items:b}));n.when(p.getFileContentType(b),function(a){if(C){var d=C,f=D;if(a){var g,p=a.imageClass,h=a.image;p?(g=document.createElement("span"),g.className+=p,g.classList.add("thumbnail")):h&&(g=document.createElement("img"),g.src=h,g.classList.add("thumbnail"));g&&d.replaceChild(g,f)}}A.href=E;v&&"function"===
typeof v.updateFileNode&&v.updateFileNode(b,A,e(a))})}A.addEventListener("click",function(){s=b}.bind(this),!1);return A}function p(a,b,e,d){this.explorer=b;this.commandService=e;this.contentTypeService=d;this.openWithCommands=null;this.actionScopeId=a.actionScopeId;this._init(a);this.target="_self"}var q=new f("#{,resource,params*}"),s;p.prototype=new m.SelectionRenderer;p.prototype.wrapperCallback=function(a){a.setAttribute("role","tree")};p.prototype.tableCallback=function(a){a.setAttribute("aria-label",
l.Navigator);a.setAttribute("role","presentation")};p.prototype.rowCallback=function(a,b){a.setAttribute("role","treeitem")};p.prototype.emptyCallback=function(b){var e=document.createElement("tr"),d=document.createElement("td");d.colSpan=this.oneColumn?1:3;var f=document.createElement("div");f.classList.add("noFile");f.textContent=l.NoFile;var g=document.createElement("span");g.appendChild(document.createTextNode(l.File));a.processDOMNodes(f,[g]);d.appendChild(f);e.appendChild(d);b.appendChild(e)};
p.prototype.getDisplayTime=function(a){return(new Date(a)).toLocaleString()};p.prototype.getCommitRenderer=function(a,b){return new d.CommitInfoRenderer({parent:a,commitInfo:b})};p.prototype.getCellHeaderElement=function(a){if(this.oneColumn&&0!==a)return null;switch(a){case 0:case 1:case 2:document.createElement("th").style.height="8px"}};p.prototype.setTarget=function(a){this.target=a};p.prototype.getFolderImage=function(a){if(!this.showFolderImage)return null;a=document.createElement("span");a.className=
"core-sprite-folder modelDecorationSprite";return a};p.prototype.createFolderNode=function(a){var e;this.showFolderLinks?(e=b(this.folderLink||"",a,this.commandService,this.contentTypeService),(a=this.getFolderImage(a))&&e.insertBefore(a,e.firstChild)):(e=document.createElement("span"),e.textContent=a.Name);return e};p.prototype.updateFileNode=function(a,b,e){};p.prototype.showFolderLinks=!0;p.prototype.getCellElement=function(a,e,d){var f=e.LastCommit?2:1,p=e.LastCommit?3:2,h=e.LastCommit?1:-1;switch(a){case 0:return a=
document.createElement("td"),f=document.createElement("span"),f.id=d.id+"MainCol",f.setAttribute("role","presentation"),a.appendChild(f),a.setAttribute("role","presentation"),f.className="mainNavColumn",e.Directory?(this.getExpandImage(d,f),p=this.createFolderNode(e),f.appendChild(p),this.explorer._makeDropTarget(e,p),this.explorer._makeDropTarget(e,d)):(this.openWithCommands||(this.openWithCommands=g.getOpenWithCommands(this.commandService)),p=b("",e,this.commandService,this.contentTypeService,this.openWithCommands,
{target:this.target},null,null,this),f.appendChild(p)),p&&(p.id=d.id+"NameLink",1===p.nodeType&&(k.addNavGrid(this.explorer.getNavDict(),e,p),p.setAttribute("role","link"),p.setAttribute("tabindex","-1"))),this.actionScopeId&&this.commandService.renderCommands(this.actionScopeId,f,e,this.explorer,"tool",null,!0),a;case f:if(this.oneColumn)return null;d=document.createElement("td");e.LocalTimeStamp&&(d.textContent=this.getDisplayTime(e.LocalTimeStamp));return d;case p:if(this.oneColumn)return null;
d=document.createElement("td");!e.Directory&&"number"===typeof e.Length&&(e=parseInt(e.Length,10)/1024,d.textContent=Math.ceil(e).toLocaleString()+" KB");d.style.textAlign="right";return d;case h:if(this.oneColumn||!e.LastCommit)return null;d=document.createElement("td");this.getCommitRenderer(d,e.LastCommit).renderSimple(60);return d}};p.prototype.constructor=p;return{NavigatorRenderer:p,isImage:e,getClickedItem:function(){return s},createLink:b}});
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(l,n,m,k,g,h,f,d,a){function e(a,b){this.serviceRegistry=a;this.commandRegistry=b;this.openWithCommands=null}function b(a){this.registry=a.serviceRegistry;this._commandService=a.commandService;this._fileService=a.fileService;this.defaultRenderer=new e(this.registry,
this._commandService);this._fileService||console.error("No file service on search client")}e.prototype.makeRenderFunction=function(b,e,h,u,w){var x=this.serviceRegistry,y=this.commandRegistry;this.openWithCommands=this.openWithCommands||d.createOpenWithCommands(x,b,y);var r=this;return function(d,x,B,v){a.when(r.openWithCommands,function(a){if(B)m.empty(e),a=document.createElement("div"),a.appendChild(document.createTextNode(l["Search failed."])),e.appendChild(a),"function"===typeof u&&u(e);else{var C=
function(){function a(b,e){var d=e.folderName?e.folderName:e.path,f=document.createElement("span");f.id=d.replace(/[^a-zA-Z0-9_\.:\-]/g,"");f.appendChild(document.createTextNode(" - "+d+" "));b.appendChild(f)}var b={};return function(e,d){var f=d.name;if(b.hasOwnProperty(f)){a(e,d);var g=b[f];"function"===typeof g&&(b[f]=null,g())}else b[f]=function(){a(e,d)}}}(),D=!1;m.empty(e);if(d&&0<d.length){var E=document.createElement("table");E.setAttribute("role","presentation");for(var K=0;K<d.length;K++){var r=
d[K],F;D||(D=!0,h&&(F=E.insertRow(0).insertCell(0),F.textContent=h));F=E.insertRow(-1).insertCell(0);F.colspan=2;w&&w(F);var G={Name:r.name,Directory:r.directory,Location:r.path||r.location},H=null;"number"===typeof r.LineNumber&&(H={},H.line=r.LineNumber);if(v&&v.keyword&&!v.nameSearch){var L=g.generateSearchHelper(v),H=H||{};H.find=L.inFileQuery.searchStr;H.regEx=L.inFileQuery.wildCard?!0:void 0}G=f.createLink(n.toUrl("edit/edit.html"),G,y,b,a,{"aria-describedby":(r.folderName?r.folderName:r.path).replace(/[^a-zA-Z0-9_\.:\-]/g,
""),style:{verticalAlign:"middle"}},H);r.LineNumber&&G.appendChild(document.createTextNode(" (Line "+r.LineNumber+")"));F.appendChild(G);C(F,r)}e.appendChild(E);"function"===typeof u&&u(e)}!D&&x&&(a=k.formatMessage(l["No matches found for ${0}"],x),m.empty(e),e.appendChild(document.createTextNode(a)),"function"===typeof u&&u(e))}})}};b.prototype={search:function(a,b,e){var d=function(a){for(var e=[],d=0;d<a.response.docs.length;d++){var f=a.response.docs[d],p=f.Location,h=g.path2FolderName(f.Path?
f.Path:f.Location,f.Name),v=h?h:p;(b?0<=v.indexOf(b):1)&&e.push({name:f.Name,path:p,folderName:h,directory:f.Directory,lineNumber:f.LineNumber})}return e};if(this._crawler&&a.nameSearch)this._crawler.searchName(a,function(b){e(d(b),a.keyword,null,a)});else try{this.registry.getService("orion.page.progress").progress(this._fileService.search(a),"Searching "+a.keyword).then(function(b){var f=a.keyword,f=f.substring(f.indexOf("}")+1),f=f.substring(f.indexOf(":")+1);e(d(b),f,null,a)},function(a){e(null,
null,a,null)})}catch(f){"string"===typeof f&&-1<f.indexOf("search")&&this._crawler?this._crawler.searchName(a,function(b){e(d(b),null,null,a)}):"string"===typeof f&&-1<f.indexOf("search")&&!a.nameSearch?(new h.SearchCrawler(this.registry,this._fileService,a,{childrenLocation:this.getChildrenLocation()})).search(function(b){e(d(b),null,null,a)}):this.registry.getService("orion.page.message").setErrorMessage(f)}},getFileService:function(){return this._fileService},setCrawler:function(a){this._crawler=
a},handleError:function(a,b){console.error(a);m.empty(b);b.appendChild(document.createTextNode(a));return a},setLocationByMetaData:function(a,b){var e="",d=null;this._searchRootLocation=this._fileService.fileServiceRootURL(a.Location);b&&a&&a.Parents&&0<a.Parents.length?d="last"===b.index?a.Parents[a.Parents.length-1]:a.Parents[0]:a&&(a.Directory&&a.Location&&a.Parents)&&(d=a);d?(this.setLocationbyURL(d.Location),e=d.Name,this._childrenLocation=d.ChildrenLocation):a&&(this.setLocationbyURL(this._searchRootLocation),
e=this._fileService.fileServiceName(a.Location),this._childrenLocation=a.ChildrenLocation);d=m.node("search");e||(e="");if(d&&d.placeholder){d.value="";var f=k.formatMessage(l["Search ${0}"],e);d.placeholder=30<f.length?f.substring(0,27)+"...":k.formatMessage(l["Search ${0}"],e)}d&&d.title&&(d.title=l["Type a keyword or wild card to search in "]+e)},setLocationbyURL:function(a){this._searchLocation=a},setRootLocationbyURL:function(a){this._searchRootLocation=a},setChildrenLocationbyURL:function(a){this._childrenLocation=
a},getSearchLocation:function(){return this._searchLocation?this._searchLocation:this._fileService.fileServiceRootURL()},getSearchRootLocation:function(){return this._searchRootLocation?this._searchRootLocation:this._fileService.fileServiceRootURL()},getChildrenLocation:function(){return this._childrenLocation?this._childrenLocation:this._fileService.fileServiceRootURL()},createSearchParams:function(a,b,e,d){e=e?this.getSearchRootLocation():this.getSearchLocation();return b?{resource:e,sort:"NameLower asc",
rows:100,start:0,nameSearch:!0,keyword:a}:{resource:e,sort:d&&d.sort?d.sort:"Path asc",rows:d&&d.rows?d.rows:40,start:0,caseSensitive:d?d.caseSensitive:void 0,regEx:d?d.regEx:void 0,fileType:d?d.fileType:void 0,fileNamePatterns:d&&d.fileNamePatterns?d.fileNamePatterns:void 0,keyword:a,replace:d?d.replace:void 0}}};b.prototype.constructor=b;return{Searcher:b}});
define("orion/compare/nls/root/messages",{"Copy current change from right to left":"Copy current change from right to left","Copy current change from left to right":"Copy current change from left to right","Switch to unified diff":"Switch to unified diff",Unified:"Unified","Switch to side by side diff":"Switch to side by side diff","Side by side":"Side by side","Generate link of the current diff":"Generate link of the current diff","Generate Link":"Generate Link","Next diff block":"Next diff block",
"Previous diff block":"Previous diff block","Next diff change":"Next diff change","Previous diff change":"Previous diff change","Copy the link URL:":"Copy the link URL:",Compare:"Compare","Open the compare page":"Open the compare page","fetching...":"fetching...","There are unsaved changes.":"There are unsaved changes.","ERROR: ":"ERROR: ","Compare...":"Compare...","files changed":" files changed",Location:"Location",Options:"Options","Sort by folders":"Sort by folders","Line 0 : Col 0":"Line 0 : Col 0",
"No Matching DiffService for location:":"No Matching DiffService for location:","${0} files compared. The two folders are identical.":"${0} files compared. The two folders are identical."});define("orion/compare/nls/messages",["orion/i18n!orion/compare/nls/messages","orion/compare/nls/root/messages"],function(l,n){var m={root:n};Object.keys(l).forEach(function(k){"undefined"===typeof m[k]&&(m[k]=l[k])});return m});
define("orion/compare/compareCommands",["i18n!orion/compare/nls/messages","orion/commands","orion/keyBinding","orion/webui/littlelib"],function(l,n,m,k){var g={};g.CompareCommandFactory=function(){function g(f){this.setOptions(f,!0)}g.prototype={setOptions:function(f,d){d&&(this.options={});this.options||(this.options={});f&&Object.keys(f).forEach(function(a){this.options[a]=f[a]}.bind(this))},getOptions:function(){return this.options},initCommands:function(f){var d=this.options.commandSpanId,a=this.options.commandService;
if(a&&d){var e=new n.Command({name:l["Copy current change from right to left"],tooltip:l["Copy current change from right to left"],imageClass:"core-sprite-leftarrow",id:"orion.compare.copyToLeft",groupId:"orion.compareGroup",visibleWhen:function(a){return"twoWay"===f.type&&!f.getImageMode()&&f.options.newFile&&!f.options.newFile.readonly}.bind(this),callback:function(a){a.items.copyToLeft()}}),b=new n.Command({name:l["Copy current change from left to right"],tooltip:l["Copy current change from left to right"],
imageClass:"core-sprite-rightarrow",id:"orion.compare.copyToRight",groupId:"orion.compareGroup",visibleWhen:function(a){return"twoWay"===f.type&&!f.getImageMode()&&f.options.oldFile&&!f.options.oldFile.readonly}.bind(this),callback:function(a){a.items.copyToRight()}}),g=new n.Command({tooltip:l["Switch to unified diff"],name:l.Unified,id:"orion.compare.toggle2Inline",groupId:"orion.compareGroup",visibleWhen:function(a){return a.options.toggler&&"twoWay"===a.options.toggler.getWidget().type},callback:function(a){a.items.options.toggler.toggle()}}),
h=new n.Command({tooltip:l["Switch to side by side diff"],name:l["Side by side"],id:"orion.compare.toggle2TwoWay",groupId:"orion.compareGroup",visibleWhen:function(a){return a.options.toggler&&"inline"===a.options.toggler.getWidget().type},callback:function(a){a.items.options.toggler.toggle()}}),k=new n.Command({name:l["Next diff block"],tooltip:l["Next diff block"],imageClass:"core-sprite-move-down",id:"orion.compare.nextDiff",groupId:"orion.compareGroup",visibleWhen:function(a){return!f.getImageMode()},
callback:function(a){a.items.nextDiff()}}),u=new n.Command({name:l["Previous diff block"],tooltip:l["Previous diff block"],imageClass:"core-sprite-move-up",id:"orion.compare.prevDiff",groupId:"orion.compareGroup",visibleWhen:function(a){return!f.getImageMode()},callback:function(a){a.items.prevDiff()}}),w=new n.Command({name:l["Next diff change"],tooltip:l["Next diff change"],imageClass:"core-sprite-move-down",id:"orion.compare.nextChange",groupId:"orion.compareGroup",visibleWhen:function(a){return!f.getImageMode()},
callback:function(a){a.items.nextChange()}}),x=new n.Command({name:l["Previous diff change"],tooltip:l["Previous diff change"],imageClass:"core-sprite-move-up",id:"orion.compare.prevChange",groupId:"orion.compareGroup",visibleWhen:function(a){return!f.getImageMode()},callback:function(a){a.items.prevChange(a)}});a.addCommand(e);a.addCommand(b);a.addCommand(h);a.addCommand(g);a.addCommand(k);a.addCommand(u);a.addCommand(w);a.addCommand(x);a.registerCommandContribution(d,"orion.compare.toggle2Inline",
108);a.registerCommandContribution(d,"orion.compare.toggle2TwoWay",109);a.registerCommandContribution(d,"orion.compare.copyToLeft",110,null,!1,new m.KeyBinding(37,!0,!1,!0));a.registerCommandContribution(d,"orion.compare.copyToRight",111,null,!1,new m.KeyBinding(39,!0,!1,!0));a.registerCommandContribution(d,"orion.compare.nextDiff",112,null,!1,new m.KeyBinding(40,!0));a.registerCommandContribution(d,"orion.compare.prevDiff",113,null,!1,new m.KeyBinding(38,!0));f.options.wordLevelNav?(a.registerCommandContribution(d,
"orion.compare.nextChange",114,null,!1,new m.KeyBinding(40,!0,!0)),a.registerCommandContribution(d,"orion.compare.prevChange",115,null,!1,new m.KeyBinding(38,!0,!0))):(a.registerCommandContribution(d,"orion.compare.nextChange",114,null,!0,new m.KeyBinding(40,!0,!0)),a.registerCommandContribution(d,"orion.compare.prevChange",115,null,!0,new m.KeyBinding(38,!0,!0)))}},renderCommands:function(f){var d=this.options.commandSpanId,a=this.options.commandService;a&&d&&(k.empty(k.node(d)),this.options.gridRenderer&&
this.options.gridRenderer.navGridHolder?(this.options.gridRenderer.navGridHolder.splice(0,this.options.gridRenderer.navGridHolder.length),this.options.gridRenderer.additionalCmdRender?this.options.gridRenderer.before?(this.options.gridRenderer.additionalCmdRender(this.options.gridRenderer.navGridHolder),a.renderCommands(d,d,f,f,"tool",null,this.options.gridRenderer.navGridHolder)):(a.renderCommands(d,d,f,f,"tool",null,this.options.gridRenderer.navGridHolder),this.options.gridRenderer.additionalCmdRender(this.options.gridRenderer.navGridHolder)):
a.renderCommands(d,d,f,f,"tool",null,this.options.gridRenderer.navGridHolder)):a.renderCommands(d,d,f,f,"tool",null))}};return g}();return g});
define("orion/compare/compareUtils",["orion/URITemplate"],function(l){var n=n||{};n.compareUtils=n.compareUtils||{};n.compareUtils.lookUpMapper=function(l,k,g){for(var h=0,f=0;f<l.length;f++){var d=l[f][k];0===d&&(d=1);if(g>=h&&g<h+d)return{mapperIndex:f,startFrom:h};if(f===l.length-1)break;h+=l[f][k]}return{mapperIndex:l.length-1,startFrom:h}};n.compareUtils.lookUpLineIndex=function(l,k,g){if(0===g)return 0;for(var h=0,f=0;f<g;f++)h+=l[f][k];return h};n.compareUtils.updateMapper=function(l,k,g,h,
f){if(h!==f&&(0<h||0<f)){var d=n.compareUtils.lookUpMapper(l,k,g);if(!(0>d.mapperIndex)){if(0<h){var a=g-d.startFrom;for(g=d.mapperIndex;g<l.length;g++){a=l[g][k]-a;if(h<=a){l[g][k]-=h;break}l[g][k]-=a;h-=a;a=0}}0<f&&(l[d.mapperIndex][k]+=f)}}};n.compareUtils.overlapMapper=function(l,k,g,h,f){l=g+l[k]-1;l<g&&(l=g);f<h&&(f=h);return l<h||f<g?!1:!0};n.compareUtils.findFirstDiff=function(l,k,g,h){for(var f=0,d=null,a=0;a<l.length&&!(f>h)&&(!n.compareUtils.overlapMapper(l[a],k,f,g,h)||!(d={mapperIndex:a,
startFrom:f},0!==l[a][2]));a++)f+=l[a][k];return d};n.compareUtils.matchMapper=function(l,k,g,h){if(0===l.length)return g;var f=g+Math.round((h-g)/3),d=n.compareUtils.findFirstDiff(l,k,g,h),a=0===l[d.mapperIndex][k]?d.startFrom:d.startFrom+l[d.mapperIndex][k]-1,e=n.compareUtils.lookUpLineIndex(l,1-k,d.mapperIndex),b=d.startFrom-g;return 0===l[d.mapperIndex][2]?e-b:f>=d.startFrom&&f<=a?e-Math.round((h-g)/3):f<d.startFrom?e-b:(0===l[d.mapperIndex][1-k]?e:e+l[d.mapperIndex][1-k]-1)-(a-g)};n.compareUtils.getMapperLineCount=
function(l){for(var k=0,g=0;g<l.length;g++)k+=Math.max(l[g][0],l[g][1]);return k};n.compareUtils.getAnnotationIndex=function(l,k){for(var g=0;g<l.length;g++)if(l[g][0]===k)return g;return-1};n.compareUtils.getAnnotationMapperIndex=function(l,k){return l[k][1]};n.compareUtils.getAnnotationIndexByMapper=function(l,k){for(var g=0;g<l.length;g++)if(l[g][1]===k)return{current:g,prev:g-1,next:g+1};return{current:-1,prev:-1,next:-1}};n.compareUtils.isMapperConflict=function(l,k){return 0>k||!l[k][3]?!1:
1===l[k][3]};n.compareUtils.mergeDiffBlocks=function(l,k,g,h,f,d){for(var a=0;a<k.length;a++){var e=k[a][0],b=g[k[a][1]];if(0<b[0]){for(var p="",q=0;q<b[0];q++)p=p+h[b[2]-1+q].substring(f)+d;b=l.getLineCount();e>=b&&(e=l.getLineEnd(b-1),q=l.getLineEnd(b-1,!0),e===q?(l.setText(d,e,e),e=b):e=b-1);e=l.getLineStart(e);l.setText(p,e,e)}}};n.compareUtils.generateCompareHref=function(m,k){var g=require.toUrl("compare/compare.html");k.conflict||(k.conflict=void 0);k.readonly||(k.readonly=void 0);return(new l(g+
"#{,resource,params*}")).expand({resource:m,params:k})};n.compareUtils.generateCompareTreeHref=function(m,k){var g=require.toUrl("compare-tree/compare-tree.html");return(new l(g+"#{,resource,params*}")).expand({resource:m,params:k})};return n.compareUtils});
define("orion/compare/diffProvider",["i18n!orion/compare/nls/messages","orion/Deferred"],function(l,n){function m(g,h,f){var d=new n;g[h].apply(g,f).then(function(a){d.resolve(a)},function(a){d.reject(a)});return d}function k(g,h){var f=g.getServiceReferences("orion.core.diff"),d,a=f;if(h){a=[];for(d=0;d<f.length;++d)h(f[d])&&a.push(f[d])}var e=[],b=[];for(d=0;d<a.length;++d)e[d]=RegExp(a[d].getProperty("pattern")||".*"),b[d]=g.getService(a[d]);this._getService=function(a){if(-1===a.indexOf("://")){var d=
document.createElement("a");d.href=a;a=d.href}for(d=0;d<e.length;++d)if(e[d].test(a))return b[d];throw l["No Matching DiffService for location:"]+a;}}k.prototype={getDiffContent:function(g){return m(this._getService(g),"getDiffContent",arguments)},getDiffFileURI:function(g){return m(this._getService(g),"getDiffFileURI",arguments)}};return{DiffProvider:k}});
define("orion/compare/diffParser",[],function(){var l=l||{};l.DiffParser=function(){function l(k,g){this._lineDelimiter=k?k:m?"\r\n":"\n";this._diffLineDelimiter=g?g:this._lineDelimiter;this._DEBUG=!1}var m=-1!==window.navigator.platform.indexOf("Win");l.prototype={_init:function(){this._oFileContents=[];this._diffContents=[];this._oBlocks=[];this._nBlocks=[];this._hunkRanges=[];this._lastToken=" ";this._deltaMap=[];this._nFileContents=[];this._nNewLineAtEnd=this._oNewLineAtEnd=!0;this._diffContentIndex=
1},setLineDelim:function(k){this._diffLineDelimiter=this._lineDelimiter=k},getDiffArray:function(){return{array:this._diffContents,index:this._diffContentIndex}},parse:function(k,g,h,f){this._init();if(""===g)return{outPutFile:k,mapper:[]};this._oFileContents=""===k?[]:k.split(this._lineDelimiter);this._diffContents=g.split(this._diffLineDelimiter);g=this._diffContents.length;this._hunkRanges=[];for(var d=0;d<g;d++){var a=this._parseHunkRange(d);a&&this._hunkRanges.push(a)}if(0===this._hunkRanges.length)return{outPutFile:k,
mapper:[]};this._DEBUG&&(console.log("***Diff contents: \n"),this._diffContents.forEach(function(a){console.log(a)}),console.log("***Hunk ranges: \n"),console.log(JSON.stringify(this._hunkRanges)));for(k=0;k<this._hunkRanges.length;k++)this._parseHunkBlock(k);this._DEBUG&&(console.log("***Original Hunk range blocks: \n"),console.log(JSON.stringify(this._oBlocks)),console.log("***New Hunk range blocks: \n"),console.log(JSON.stringify(this._nBlocks)));this._buildMap(h);this._DEBUG&&(console.log("***New Line at end of file(original): \n"),
console.log(JSON.stringify(this._oNewLineAtEnd)),console.log("***New Line at end of file(new): \n"),console.log(JSON.stringify(this._nNewLineAtEnd)),console.log("***Mapper: \n"),this._logMap(),console.log("***Total line number in original file: "+this._oFileContents.length));f||this._buildNewFile();return{outPutFile:this._nFileContents.join(this._diffLineDelimiter),mapper:this._deltaMap}},_logMap:function(){for(var k=0;k<this._deltaMap.length;k++)if(console.log(JSON.stringify(this._deltaMap[k])),
0<this._deltaMap[k][2]){console.log("    **Diff content on change/add: \n");for(var g=0;g<this._deltaMap[k][0];g++)console.log("    "+this._diffContents[this._deltaMap[k][2]+g-1])}},_logNewFile:function(){for(var k=0;k<this._nFileContents.length;k++)console.log(this._nFileContents[k])},_createBlock:function(k,g,h,f){f===h&&" "===k||(h=[h,f-h,"s"],"-"===k?h[2]="r":"+"===k?h[2]="a":"c"===k&&(h[2]="c"),g.push(h))},_createMinusBlock:function(k,g,h){var f=this._oBlocks.length;0===f||k!==this._oBlocks[f-
1][0]?(this._oBlocks.push([0===k?1:k,h]),this._nBlocks.push([g,0,-2])):this._oBlocks[f-1][1]+=h},_createPlusBlock:function(k,g,h,f){var d=this._nBlocks.length;0===d||g!==this._nBlocks[d-1][0]?(this._oBlocks.push([0===k?1:k,0]),this._nBlocks.push([g,h,f])):(this._nBlocks[d-1][1]+=h,this._nBlocks[d-1][2]=f)},_parseHunkBlock:function(k){for(var g=" ",h=this._hunkRanges[k][0]+1,f=k===this._hunkRanges.length-1?this._diffContents.length:this._hunkRanges[k+1][0],d=0,a=0,e=this._hunkRanges[k][1],b=this._hunkRanges[k][3],
p=h,l=h;l<f;l++)if(0!==this._diffContents[l].length){var s=this._diffContents[l][0];if("\\"===s&&("\\ No newline at end of file"===this._diffContents[l].substring(0,this._diffContents[l].length-1)||"\\ No newline at end of file"===this._diffContents[l]))"-"===g?this._oNewLineAtEnd=!1:" "===g?this._oNewLineAtEnd=this._nNewLineAtEnd=!1:this._nNewLineAtEnd=!1,l>h&&"\r"===this._diffContents[l-1][this._diffContents[l-1].length-1]&&(this._diffContents[l-1]=this._diffContents[l-1].substring(0,this._diffContents[l-
1].length-1));else{switch(s){case "-":case "+":case " ":break;default:continue}if(g!==s){"+"===s&&(p=l);switch(g){case " ":e=this._hunkRanges[k][1]+d;b=this._hunkRanges[k][3]+a;break;case "-":this._createMinusBlock(e,b,this._hunkRanges[k][1]+d-e);break;case "+":this._createPlusBlock(e,b,this._hunkRanges[k][3]+a-b,p)}g=s}switch(s){case "-":d++;break;case "+":a++;break;case " ":d++,a++}}}switch(g){case "-":this._createMinusBlock(e,b,this._hunkRanges[k][1]+d-e);break;case "+":this._createPlusBlock(e,
b,this._hunkRanges[k][3]+a-b,p)}},_detectConflictes:function(k,g){if(0>k)return!1;for(var h=k+g,f=k;f<h;f++){var d=this._diffContents[f];if(-1<d.indexOf("\x3c\x3c\x3c\x3c\x3c")||-1<d.indexOf("\x3e\x3e\x3e\x3e\x3e"))return!0}return!1},_buildMap:function(k){var g=this._oBlocks.length,h=this._oFileContents.length,f=0,d;d=1;for(var a=0;a<g;a++)d=this._oBlocks[a][0]-d,0<d&&(this._deltaMap.push([d,d,0]),f+=d),k&&this._detectConflictes(this._nBlocks[a][2],this._nBlocks[a][1])?this._deltaMap.push([this._nBlocks[a][1],
this._oBlocks[a][1],this._nBlocks[a][2]+1,1]):this._deltaMap.push([this._nBlocks[a][1],this._oBlocks[a][1],this._nBlocks[a][2]+1]),f+=this._oBlocks[a][1],d=this._oBlocks[a][0]+this._oBlocks[a][1];0<h-d&&(this._deltaMap.push([h-d+1,h-d+1,0]),f+=h-d+1);f<h&&(d=h-f,k=this._deltaMap[this._deltaMap.length-1],0===k[2]?(k[0]+=d,k[1]+=d):-1===k[2]?this._deltaMap.push([d,d,0]):this._nNewLineAtEnd===this._oNewLineAtEnd?this._deltaMap.push([d,d,0]):(this._nNewLineAtEnd&&(k[0]+=d),this._oNewLineAtEnd&&(k[1]+=
d)))},_buildNewFile:function(){var k=1,g=!1,h=this._deltaMap.length,f,d;for(f=0;f<h;f++){g=!1;if(0===this._deltaMap[f][2]){for(d=0;d<this._deltaMap[f][0];d++)this._nFileContents.push(this._oFileContents[k+d-1]);g=!0}else if(0<this._deltaMap[f][2])for(d=0;d<this._deltaMap[f][0];d++)this._nFileContents.push(this._diffContents[this._deltaMap[f][2]+d-1].substring(1));k+=this._deltaMap[f][1]}this._nNewLineAtEnd&&!g&&this._nFileContents.push("")},_converHRangeBody:function(k,g){if(k){var h=parseInt(k,10);
g.push(0<=h?h:1)}else g.push(1)},_parseHunkRange:function(k){var g=this._diffContents[k],h=/^@@\s*\+([\+|\-]*[\d]+)\s*,*\s*([\d]*)\s*-([\+|\-]*[\d]+)\s*,*\s*([\d]*)\s*@@+/,f=/^@@\s*-([\+|\-]*[\d]+)\s*,*\s*([\d]*)\s*\+([\+|\-]*[\d]+)\s*,*\s*([\d]*)\s*@@+/.exec(g),d=null;if(f&&5===f.length)d=[k],this._converHRangeBody(f[1],d),this._converHRangeBody(f[2],d),this._converHRangeBody(f[3],d),this._converHRangeBody(f[4],d);else if((f=h.exec(g))&&5===f.length)d=[k],this._converHRangeBody(f[3],d),this._converHRangeBody(f[4],
d),this._converHRangeBody(f[1],d),this._converHRangeBody(f[2],d);return d}};return l}();return l});
define("orion/compare/compareRulers",["orion/compare/compareUtils"],function(l){var n=n||{};n.CompareRuler=function(){function l(k,g,h){this._location=k||"left";this._overview=g||"page";this._rulerStyle=h;this._editor=null;var f=this;this._listener={onModelChanged:function(d){f._onModelChanged(d)}}}l.prototype={setView:function(k){this._onModelChanged&&this._editor&&this._editor.removeEventListener("ModelChanged",this._listener.onModelChanged);this._editor=k;this._onModelChanged&&this._editor&&this._editor.addEventListener("ModelChanged",
this._listener.onModelChanged)},getLocation:function(){return this._location},getOverview:function(k){return this._overview},getAnnotationModel:function(){return null},addAnnotationType:function(k){},isAnnotationTypeVisible:function(k){return!1},removeAnnotationType:function(k){},setAnnotationModel:function(k){},getAnnotations:function(k,g){for(var h=[],f=k;f<g;f++){var d=this.getStyle(f);d&&(h[f]={html:this.getHTML(f),style:d})}return h},getWidestAnnotation:function(){return{html:this.getHTML(-1),
style:this.getStyle(-1)}},getRulerStyle:function(){return this.getStyle(void 0)}};return l}();n.LineNumberCompareRuler=function(){function l(k,g,h,f,d,a){n.CompareRuler.call(this,h,"page",f);this._diffNavigator=k;this._oddStyle=d||{style:{backgroundColor:"white"}};this._evenStyle=a||{style:{backgroundColor:"white"}};this._numOfDigits=0;this._mapperColumnIndex=g}l.prototype=new n.CompareRuler;l.prototype.getStyle=function(k){return void 0===k?this._rulerStyle:this._evenStyle};l.prototype.getHTML=function(k){var g=
this._editor.getModel(),h=this._diffNavigator.getFeeder(0===this._mapperColumnIndex);return!h?"":-1===k?g.getLineCount():h.getLineNumber?(k=h.getLineNumber(k),-1===k?"":k+1):k+1};l.prototype._onModelChanged=function(k){var g=k.start,h=this._editor.getModel();k=h.getLineCount();var f=(k+"").length;this._numOfDigits!==f&&(this._numOfDigits=f,g=h.getLineAtOffset(g),this._editor.redrawLines(g,k,this))};return l}();n.CompareOverviewRuler=function(){function m(k,g,h,f){this._diffNavigator=h;this._onClick=
f;n.CompareRuler.call(this,k,"document",g)}m.prototype=new n.CompareRuler;m.prototype.getStyle=function(k){var g,h;if(void 0===k)g=this._rulerStyle||{},h=g.style||(g.style={}),h.lineHeight="1px",h.fontSize="1px",h.width="14px";else if(g=-1!==k?{styleClass:"annotationOverview breakpoint"}:{},h=g.style||(g.style={}),h.cursor="pointer",h.width="8px",h.left="2px",0<=k){var f;if(this._diffNavigator&&this._diffNavigator.getFeeder())f=this._diffNavigator.getFeeder().getDiffBlocks();else return null;k=l.getAnnotationIndex(f,
k);if(-1===k)return null;f=l.getAnnotationMapperIndex(f,k);var d;d=this._diffNavigator.getMapper();if(f=l.isMapperConflict(d,f))h.border="1px #FF0000 solid";k===this._diffNavigator.getCurrentBlockIndex()&&(h.backgroundColor=f?"red":"blue");k=this._diffNavigator.getFeeder().getDiffBlockH(k);f=this._diffNavigator.getFeeder().getOverviewLineCount();if(0>k)return null;d=this._editor.getClientArea();k=Math.floor(d.height*k/f);2>k&&(k=2);h.height=k+"px"}else return null;return g};m.prototype.setDiffNavigator=
function(k){this._diffNavigator=k};m.prototype.getHTML=function(k){return"\x26nbsp;"};m.prototype.onClick=function(k,g){void 0!==k&&this._onClick(k,this)};m.prototype._onModelChanged=function(k){0<this._editor.getModel().getLineCount()&&this._editor.redrawLines(0,1,this)};return m}();n.CompareCurveRuler=function(){function m(k){this._canvasDiv=k;this._mapper=void 0}m.prototype={init:function(k,g,h,f){this._rightIniting=this._rightIniting=this._leftIniting=!0;this._mapper=k;this._leftEditor=g;this._rightEditor=
h;this._leftTextView=g.getTextView();this._rightTextView=h.getTextView();this._diffNavigator=f;this.render()},matchPositionFrom:function(k){var g=k?this._leftTextView:this._rightTextView,h=k?this._rightTextView:this._leftTextView,f=g.getTopIndex(),g=g.getBottomIndex();k=l.matchMapper(this._mapper,k?0:1,f,g);h.setTopIndex(k)},copyTo:function(k){if(this._diffNavigator.iterator){var g=this._diffNavigator.iterator.cursor();if(g&&("word"===g.type?!g.copied&&!g.parent.copied:!g.copied)){var h=k?this._rightTextView.getText(g.oldA.start,
g.oldA.end):this._leftTextView.getText(g.newA.start,g.newA.end),f=k?g.newA:g.oldA;(k?this._leftTextView:this._rightTextView).setText(h,f.start,f.end);g.copied=!0}}},render:function(){if(this._mapper){var k=this._canvasDiv.getContext("2d");k.clearRect(0,0,this._canvasDiv.width,this._canvasDiv.height);k.strokeStyle="#AAAAAA";k.lineWidth=1;k.beginPath();var g=this._leftTextView.getTopIndex(),h=this._leftTextView.getBottomIndex(),f=this._rightTextView.getTopIndex(),d=this._rightTextView.getBottomIndex();
this._leftLineH=this._leftTextView.getLineHeight();this._rightLineH=this._rightTextView.getLineHeight();for(var a=0,e=0,b=!1,p=0;p<this._mapper.length;p++){if(0!==this._mapper[p][2])if(l.overlapMapper(this._mapper[p],0,a,g,h)||l.overlapMapper(this._mapper[p],1,e,f,d))this._renderCurve(p,a,e,this._canvasDiv,k,g,h,f,d),b=!0;else if(b)break;a+=this._mapper[p][0];e+=this._mapper[p][1]}k.stroke()}},_renderCurve:function(k,g,h,f,d,a,e,b,p){a=this._mapper[k];g=this._leftTextView.getLinePixel(g+a[0]/2)+a[0]%
2*this._leftLineH/3-this._leftTextView.getTopPixel();h=this._rightTextView.getLinePixel(h+a[1]/2)+a[1]%2*this._rightLineH/3-this._rightTextView.getTopPixel();f=f.parentNode.clientWidth;k===this._diffNavigator.getCurrentMapperIndex()?(d.stroke(),d.strokeStyle="#000",d.lineWidth=1,d.beginPath(),d.moveTo(0,g),d.bezierCurveTo(f/3,g,0.666*f,h,f,h),d.stroke(),d.strokeStyle="#AAAAAA",d.lineWidth=1,d.beginPath()):(d.moveTo(0,g),d.bezierCurveTo(f/3,g,0.666*f,h,f,h),d.stroke())},onChanged:function(k,g){var h=
g?this._rightIniting:this._leftIniting;if(k.removedLineCount!==k.addedLineCount){var f=g?this._rightTextView:this._leftTextView;h||l.updateMapper(this._mapper,g?1:0,f.getModel().getLineAtOffset(k.start),k.removedLineCount,k.addedLineCount);(0<k.removedLineCount||0<k.addedLineCount)&&this.render()}g?this._rightIniting=!1:this._leftIniting=!1;return h}};return m}();return n});
define("orion/editor/i18n",{load:function(l,n,m,k){n.specified&&n.specified("orion/bootstrap")?n(["orion/i18n!"+l],function(g){m(g)}):n(["orion/editor/config"],function(g){m(g&&g.languages||{})})}});
define("orion/editor/nls/root/messages",{multipleAnnotations:"Multiple annotations:",line:"Line: ${0}",breakpoint:"Breakpoint",bookmark:"Bookmark",task:"Task",error:"Error",warning:"Warning",matchingSearch:"Matching Search",currentSearch:"Current Search",currentLine:"Current Line",matchingBracket:"Matching Bracket",currentBracket:"Current Bracket",lineUp:"Line Up",lineDown:"Line Down",lineStart:"Line Start",lineEnd:"Line End",charPrevious:"Previous Character",charNext:"Next Character",pageUp:"Page Up",
pageDown:"Page Down",scrollPageUp:"Scroll Page Up",scrollPageDown:"Scroll Page Down",scrollLineUp:"Scroll Line Up",scrollLineDown:"Scroll Line Down",wordPrevious:"Previous Word",wordNext:"Next Word",textStart:"Document Start",textEnd:"Document End",scrollTextStart:"Scroll Document Start",scrollTextEnd:"Scroll Document End",centerLine:"Center Line",selectLineUp:"Select Line Up",selectLineDown:"Select Line Down",selectWholeLineUp:" Select Whole Line Up",selectWholeLineDown:"Select Whole Line Down",
selectLineStart:"Select Line Start",selectLineEnd:"Select Line End",selectCharPrevious:"Select Previous Character",selectCharNext:"Select Next Character",selectPageUp:"Select Page Up",selectPageDown:"Select Page Down",selectWordPrevious:"Select Previous Word",selectWordNext:"Select Next Word",selectTextStart:"Select Document Start",selectTextEnd:"Select Document End",deletePrevious:"Delete Previous Character",deleteNext:"Delete Next Character",deleteWordPrevious:"Delete Previous Word",deleteWordNext:"Delete Next Word",
deleteLineStart:"Delete Line Start",deleteLineEnd:"Delete Line End",tab:"Insert Tab",enter:"Insert Line Delimiter",enterNoCursor:"Insert Line Delimiter",selectAll:"Select All",copy:"Copy",cut:"Cut",paste:"Paste",uppercase:"To Upper Case",lowercase:"To Lower Case",capitalize:"Capitalize",reversecase:"Reverse Case",toggleWrapMode:"Toggle Wrap Mode",toggleTabMode:"Toggle Tab Mode",toggleOverwriteMode:"Toggle Overwrite Mode",committerOnTime:"${0} on ${1}",emacs:"Emacs",exchangeMarkPoint:"Exchange Mark and Point",
setMarkCommand:"Set Mark",clearMark:"Clear Mark",digitArgument:"Digit Argument ${0}",negativeArgument:"Negative Argument",Comment:"Comment","Flat outline":"Flat outline",incrementalFindStr:"Incremental find: ${0}",incrementalFindStrNotFound:"Incremental find: ${0} (not found)",incrementalFindReverseStr:"Reverse Incremental find: ${0}",incrementalFindReverseStrNotFound:"Reverse Incremental find: ${0} (not found)",find:"Find...",undo:"Undo",redo:"Redo",cancelMode:"Cancel Current Mode",findNext:"Find Next Occurrence",
findPrevious:"Find Previous Occurrence",incrementalFind:"Incremental Find",incrementalFindReverse:"Incremental Find Reverse",indentLines:"Indent Lines",unindentLines:"Unindent Lines",moveLinesUp:"Move Lines Up",moveLinesDown:"Move Lines Down",copyLinesUp:"Copy Lines Up",copyLinesDown:"Copy Lines Down",deleteLines:"Delete Lines",gotoLine:"Goto Line...",gotoLinePrompty:"Goto Line:",nextAnnotation:"Next Annotation",prevAnnotation:"Previous Annotation",expand:"Expand",collapse:"Collapse",expandAll:"Expand All",
collapseAll:"Collapse All",lastEdit:"Last Edit Location",trimTrailingWhitespaces:"Trim Trailing Whitespaces",toggleLineComment:"Toggle Line Comment",addBlockComment:"Add Block Comment",removeBlockComment:"Remove Block Comment",linkedModeEntered:"Linked Mode entered",linkedModeExited:"Linked Mode exited",syntaxError:"Syntax Error",contentAssist:"Content Assist",lineColumn:"Line ${0} : Col ${1}",vi:"vi",vimove:"(Move)",viyank:"(Yank)",videlete:"(Delete)",vichange:"(Change)",viLeft:"${0} Left",viRight:"${0} Right",
viUp:"${0} Up",viDown:"${0} Down",viw:"${0} Next Word",vib:"${0} Beginning of Word",viW:"${0} Next Word (ws stop)",viB:"${0} Beginning of Word (ws stop)",vie:"${0} End of Word",viE:"${0} End of Word (ws stop)",vi$:"${0} End of the line","vi^_":"${0} First non-blank Char Current Line","vi+":"${0} First Char Next Line","vi-":"${0} First Char Previous Line","vi|":"${0} nth Column in Line",viH:"${0} Top of Page",viM:"${0} Middle of Page",viL:"${0} Bottom of Page","vi/":"${0} Search Forward","vi?":"${0} Search Backward",
vin:"${0} Next Search",viN:"${0} Previous Search",vif:"${0} Search Char Fwd",viF:"${0} Search Char Bckwd",vit:"${0} Search Before Char Fwd",viT:"${0} Search Before Char Bckwd","vi,":"${0} Repeat Reverse Char Search","vi;":"${0} Repeat Char Search",viG:"${0} Go to Line",viycd:"${0} Current Line",via:"Append After Cursor",viA:"Append to End of Line",vii:"Insert Before Cursor",viI:"Insert at Beginning of Line",viO:"Insert Line Above",vio:"Insert Line Below",viR:"Begin Overwriting Text",vis:"Substitute a Character",
viS:"Substitute Entire Line",viC:"Change Text Until Line End",vip:"Paste After Char or Line",viP:"Paste Before Char or Line",viStar:"Search Word Under Cursor",next:"Next",previous:"Previous",replace:"Replace",replaceAll:"Replace All",findWith:"Find With",replaceWith:"Replace With",caseInsensitive:"Aa",regex:"/.*/",wholeWord:"\\b",caseInsensitiveTooltip:"Toggle Case Insensitive",regexTooltip:"Toogle Regex",wholeWordTooltip:"Toggle Whole Word",closeTooltip:"Close",replacingAll:"Replacing all...",replacedMatches:"Replaced ${0} matches",
nothingReplaced:"Nothing replaced",notFound:"Not found"});define("orion/editor/nls/messages",["orion/editor/i18n!orion/editor/nls/messages","orion/editor/nls/root/messages"],function(l,n){var m={root:n},k;for(k in l)l.hasOwnProperty(k)&&"undefined"===typeof m[k]&&(m[k]=l[k]);return m});
define("orion/editor/textModel",["orion/editor/eventTarget","orion/regex","orion/util"],function(l,n,m){function k(g,h){this._lastLineIndex=-1;this._text=[""];this._lineOffsets=[0];this.setText(g);this.setLineDelimiter(h)}k.prototype={destroy:function(){},find:function(g){1<this._text.length&&(this._text=[this._text.join("")]);var h=g.string,f=g.regex,d=h,a="",e=g.caseInsensitive;if(d)if(f){if(h=n.parse(d))d=h.pattern,a=h.flags}else d=h.replace(/([\\$\^*\/+?\.\(\)|{}\[\]])/g,"\\$\x26"),e&&(d=d.replace(/[iI\u0130\u0131]/g,
"[Ii\u0130\u0131]"));var b=null,p;if(d){var h=g.reverse,k=g.wrap,f=g.wholeWord,l=g.start||0;g=g.end;var u=null!==g&&void 0!==g;-1===a.indexOf("g")&&(a+="g");-1===a.indexOf("m")&&(a+="m");e&&-1===a.indexOf("i")&&(a+="i");f&&(d="\\b"+d+"\\b");var m=this._text[0],x,y,r=0;u&&(e=l<g?l:g,m=m.substring(e,l<g?g:l),r=e);var t=RegExp(d,a);h?p=function(){var a=null;for(t.lastIndex=0;;){y=t.lastIndex;x=t.exec(m);if(y===t.lastIndex)return null;if(x){if(!(x.index+r<l)){if(!k||a)break;l=m.length+r}a={start:x.index+
r,end:t.lastIndex+r}}else break}a&&(l=a.start);return a}:(u||(t.lastIndex=l),p=function(){for(;;){y=t.lastIndex;x=t.exec(m);if(y===t.lastIndex)break;if(x)return{start:x.index+r,end:t.lastIndex+r};if(!(0!==y&&k))break}return null});b=p()}return{next:function(){var a=b;a&&(b=p());return a},hasNext:function(){return null!==b}}},getCharCount:function(){for(var g=0,h=0;h<this._text.length;h++)g+=this._text[h].length;return g},getLine:function(g,h){var f=this.getLineCount();if(!(0<=g&&g<f))return null;
var d=this._lineOffsets[g];if(g+1<f){f=this.getText(d,this._lineOffsets[g+1]);if(h)return f;for(var d=f.length,a;10===(a=f.charCodeAt(d-1))||13===a;)d--;return f.substring(0,d)}return this.getText(d)},getLineAtOffset:function(g){var h=this.getCharCount();if(!(0<=g&&g<=h))return-1;var f=this.getLineCount();if(g===h)return f-1;var d,a,e=this._lastLineIndex;if(0<=e&&e<f&&(d=this._lineOffsets[e],a=e+1<f?this._lineOffsets[e+1]:h,d<=g&&g<a))return e;for(var b=f,p=-1;1<b-p;)if(e=Math.floor((b+p)/2),d=this._lineOffsets[e],
a=e+1<f?this._lineOffsets[e+1]:h,g<=d)b=e;else if(g<a){b=e;break}else p=e;return this._lastLineIndex=b},getLineCount:function(){return this._lineOffsets.length},getLineDelimiter:function(){return this._lineDelimiter},getLineEnd:function(g,h){var f=this.getLineCount();if(!(0<=g&&g<f))return-1;if(g+1<f){f=this._lineOffsets[g+1];if(h)return f;for(var d=this.getText(Math.max(this._lineOffsets[g],f-2),f),a=d.length,e;10===(e=d.charCodeAt(a-1))||13===e;)a--;return f-(d.length-a)}return this.getCharCount()},
getLineStart:function(g){return!(0<=g&&g<this.getLineCount())?-1:this._lineOffsets[g]},getText:function(g,h){void 0===g&&(g=0);void 0===h&&(h=this.getCharCount());if(g===h)return"";for(var f=0,d=0,a;d<this._text.length;){a=this._text[d].length;if(g<=f+a)break;f+=a;d++}for(var e=f,b=d;d<this._text.length;){a=this._text[d].length;if(h<=f+a)break;f+=a;d++}if(b===d)return this._text[b].substring(g-e,h-f);e=this._text[b].substring(g-e);f=this._text[d].substring(0,h-f);return e+this._text.slice(b+1,d).join("")+
f},onChanging:function(g){return this.dispatchEvent(g)},onChanged:function(g){return this.dispatchEvent(g)},setLineDelimiter:function(g,h){"auto"===g&&(g=void 0,1<this.getLineCount()&&(g=this.getText(this.getLineEnd(0),this.getLineEnd(0,!0))));this._lineDelimiter=g?g:m.platformDelimiter;if(h){var f=this.getLineCount();if(1<f){for(var d=Array(f),a=0;a<f;a++)d[a]=this.getLine(a);this.setText(d.join(this._lineDelimiter))}}},setText:function(g,h,f){void 0===g&&(g="");void 0===h&&(h=0);void 0===f&&(f=
this.getCharCount());if(!(h===f&&""===g)){for(var d=this.getLineAtOffset(h),a=this.getLineAtOffset(f),e=h,b=f-h,p=a-d,k=g.length,l=0,u=this.getLineCount(),m=0,n=0,y=0,r=[];;){-1!==m&&m<=y&&(m=g.indexOf("\r",y));-1!==n&&n<=y&&(n=g.indexOf("\n",y));if(-1===n&&-1===m)break;y=-1!==m&&-1!==n?m+1===n?n+1:(m<n?m:n)+1:-1!==m?m+1:n+1;r.push(h+y);l++}this.onChanging({type:"Changing",text:g,start:e,removedCharCount:b,addedCharCount:k,removedLineCount:p,addedLineCount:l});0===r.length&&(y=this.getLineStart(d),
a=a+1<u?this.getLineStart(a+1):this.getCharCount(),h!==y&&(g=this.getText(y,h)+g,h=y),f!==a&&(g+=this.getText(f,a),f=a));y=k-b;for(a=d+p+1;a<u;a++)this._lineOffsets[a]+=y;if(5E4>r.length)d=[d+1,p].concat(r),Array.prototype.splice.apply(this._lineOffsets,d);else{y=d+1;this._lineOffsets.splice(y,p);for(u=0;u<r.length;u+=5E4)d=[y,0].concat(r.slice(u,Math.min(r.length,u+5E4))),Array.prototype.splice.apply(this._lineOffsets,d),y+=5E4}for(y=u=0;y<this._text.length;){a=this._text[y].length;if(h<=u+a)break;
u+=a;y++}d=u;for(r=y;y<this._text.length;){a=this._text[y].length;if(f<=u+a)break;u+=a;y++}a=this._text[y];h=this._text[r].substring(0,h-d);f=a.substring(f-u);r=[r,y-r+1];h&&r.push(h);g&&r.push(g);f&&r.push(f);Array.prototype.splice.apply(this._text,r);0===this._text.length&&(this._text=[""]);this.onChanged({type:"Changed",start:e,removedCharCount:b,addedCharCount:k,removedLineCount:p,addedLineCount:l})}}};l.EventTarget.addMixin(k.prototype);return{TextModel:k}});
define("orion/editor/keyModes",["orion/keyBinding","orion/util"],function(l,n){function m(g){g&&(this._view=g,this._keyBindings=this.createKeyBindings(),this._keyBindingIndex=0)}function k(g){m.call(this,g)}m.prototype={createKeyBindings:function(){return[]},getKeyBindings:function(g){for(var h=[],f=this._keyBindings,d=0;d<f.length;d++)f[d].actionID===g&&h.push(f[d].keyBinding);return h},getView:function(){return this._view},isActive:function(){return-1!==this._view.getKeyModes().indexOf(this)},match:function(g){if("keydown"===
g.type)switch(g.keyCode){case 16:case 17:case 18:case 91:return}for(var h=this._keyBindingIndex,f=this._matchingKeyBindings||this._keyBindings,d=[],a=0;a<f.length;a++){var e=f[a],b=e.keyBinding.match(g,h);if(!0===b)return this._keyBindingIndex=0,this._matchingKeyBindings=null,e.actionID;"number"===typeof b&&d.push(e)}if(0===d.length)this._keyBindingIndex=0,this._matchingKeyBindings=null;else return this._keyBindingIndex++,this._matchingKeyBindings=d,"noop"},setKeyBinding:function(g,h){for(var f=this._keyBindings,
d=0;d<f.length;d++){var a=f[d];if(a.keyBinding.equals(g)){h?a.actionID=h:a.predefined?a.actionID="noop":f.splice(d,1);return}}h&&f.push({keyBinding:g,actionID:h})},setView:function(g){this._view=g}};k.prototype=new m;k.prototype.createKeyBindings=function(){var g=l.KeyBinding,h=[];h.push({actionID:"lineUp",keyBinding:new g(38),predefined:!0});h.push({actionID:"lineDown",keyBinding:new g(40),predefined:!0});h.push({actionID:"charPrevious",keyBinding:new g(37),predefined:!0});h.push({actionID:"charNext",
keyBinding:new g(39),predefined:!0});n.isMac?(h.push({actionID:"scrollPageUp",keyBinding:new g(33),predefined:!0}),h.push({actionID:"scrollPageDown",keyBinding:new g(34),predefined:!0}),h.push({actionID:"pageUp",keyBinding:new g(33,null,null,!0),predefined:!0}),h.push({actionID:"pageDown",keyBinding:new g(34,null,null,!0),predefined:!0}),h.push({actionID:"lineStart",keyBinding:new g(37,!0),predefined:!0}),h.push({actionID:"lineEnd",keyBinding:new g(39,!0),predefined:!0}),h.push({actionID:"wordPrevious",
keyBinding:new g(37,null,null,!0),predefined:!0}),h.push({actionID:"wordNext",keyBinding:new g(39,null,null,!0),predefined:!0}),h.push({actionID:"scrollTextStart",keyBinding:new g(36),predefined:!0}),h.push({actionID:"scrollTextEnd",keyBinding:new g(35),predefined:!0}),h.push({actionID:"textStart",keyBinding:new g(38,!0),predefined:!0}),h.push({actionID:"textEnd",keyBinding:new g(40,!0),predefined:!0}),h.push({actionID:"scrollPageUp",keyBinding:new g(38,null,null,null,!0),predefined:!0}),h.push({actionID:"scrollPageDown",
keyBinding:new g(40,null,null,null,!0),predefined:!0}),h.push({actionID:"lineStart",keyBinding:new g(37,null,null,null,!0),predefined:!0}),h.push({actionID:"lineEnd",keyBinding:new g(39,null,null,null,!0),predefined:!0}),h.push({actionID:"lineStart",keyBinding:new g(38,null,null,!0),predefined:!0}),h.push({actionID:"lineEnd",keyBinding:new g(40,null,null,!0),predefined:!0})):(h.push({actionID:"pageUp",keyBinding:new g(33),predefined:!0}),h.push({actionID:"pageDown",keyBinding:new g(34),predefined:!0}),
h.push({actionID:"lineStart",keyBinding:new g(36),predefined:!0}),h.push({actionID:"lineEnd",keyBinding:new g(35),predefined:!0}),h.push({actionID:"wordPrevious",keyBinding:new g(37,!0),predefined:!0}),h.push({actionID:"wordNext",keyBinding:new g(39,!0),predefined:!0}),h.push({actionID:"textStart",keyBinding:new g(36,!0),predefined:!0}),h.push({actionID:"textEnd",keyBinding:new g(35,!0),predefined:!0}));n.isFirefox&&n.isLinux&&(h.push({actionID:"lineUp",keyBinding:new g(38,!0),predefined:!0}),h.push({actionID:"lineDown",
keyBinding:new g(40,!0),predefined:!0}));n.isWindows&&(h.push({actionID:"scrollLineUp",keyBinding:new g(38,!0),predefined:!0}),h.push({actionID:"scrollLineDown",keyBinding:new g(40,!0),predefined:!0}));h.push({actionID:"selectLineUp",keyBinding:new g(38,null,!0),predefined:!0});h.push({actionID:"selectLineDown",keyBinding:new g(40,null,!0),predefined:!0});h.push({actionID:"selectCharPrevious",keyBinding:new g(37,null,!0),predefined:!0});h.push({actionID:"selectCharNext",keyBinding:new g(39,null,!0),
predefined:!0});h.push({actionID:"selectPageUp",keyBinding:new g(33,null,!0),predefined:!0});h.push({actionID:"selectPageDown",keyBinding:new g(34,null,!0),predefined:!0});n.isMac?(h.push({actionID:"selectLineStart",keyBinding:new g(37,!0,!0),predefined:!0}),h.push({actionID:"selectLineEnd",keyBinding:new g(39,!0,!0),predefined:!0}),h.push({actionID:"selectWordPrevious",keyBinding:new g(37,null,!0,!0),predefined:!0}),h.push({actionID:"selectWordNext",keyBinding:new g(39,null,!0,!0),predefined:!0}),
h.push({actionID:"selectTextStart",keyBinding:new g(36,null,!0),predefined:!0}),h.push({actionID:"selectTextEnd",keyBinding:new g(35,null,!0),predefined:!0}),h.push({actionID:"selectTextStart",keyBinding:new g(38,!0,!0),predefined:!0}),h.push({actionID:"selectTextEnd",keyBinding:new g(40,!0,!0),predefined:!0}),h.push({actionID:"selectLineStart",keyBinding:new g(37,null,!0,null,!0),predefined:!0}),h.push({actionID:"selectLineEnd",keyBinding:new g(39,null,!0,null,!0),predefined:!0}),h.push({actionID:"selectLineStart",
keyBinding:new g(38,null,!0,!0),predefined:!0}),h.push({actionID:"selectLineEnd",keyBinding:new g(40,null,!0,!0),predefined:!0})):(n.isLinux&&(h.push({actionID:"selectWholeLineUp",keyBinding:new g(38,!0,!0),predefined:!0}),h.push({actionID:"selectWholeLineDown",keyBinding:new g(40,!0,!0),predefined:!0})),h.push({actionID:"selectLineStart",keyBinding:new g(36,null,!0),predefined:!0}),h.push({actionID:"selectLineEnd",keyBinding:new g(35,null,!0),predefined:!0}),h.push({actionID:"selectWordPrevious",
keyBinding:new g(37,!0,!0),predefined:!0}),h.push({actionID:"selectWordNext",keyBinding:new g(39,!0,!0),predefined:!0}),h.push({actionID:"selectTextStart",keyBinding:new g(36,!0,!0),predefined:!0}),h.push({actionID:"selectTextEnd",keyBinding:new g(35,!0,!0),predefined:!0}));h.push({actionID:"undo",keyBinding:new l.KeyBinding("z",!0),predefined:!0});n.isMac?h.push({actionID:"redo",keyBinding:new l.KeyBinding("z",!0,!0),predefined:!0}):h.push({actionID:"redo",keyBinding:new l.KeyBinding("y",!0),predefined:!0});
h.push({actionID:"deletePrevious",keyBinding:new g(8),predefined:!0});h.push({actionID:"deletePrevious",keyBinding:new g(8,null,!0),predefined:!0});h.push({actionID:"deleteNext",keyBinding:new g(46),predefined:!0});h.push({actionID:"deleteWordPrevious",keyBinding:new g(8,!0),predefined:!0});h.push({actionID:"deleteWordPrevious",keyBinding:new g(8,!0,!0),predefined:!0});h.push({actionID:"deleteWordNext",keyBinding:new g(46,!0),predefined:!0});h.push({actionID:"tab",keyBinding:new g(9),predefined:!0});
h.push({actionID:"shiftTab",keyBinding:new g(9,null,!0),predefined:!0});h.push({actionID:"enter",keyBinding:new g(13),predefined:!0});h.push({actionID:"enter",keyBinding:new g(13,null,!0),predefined:!0});h.push({actionID:"selectAll",keyBinding:new g("a",!0),predefined:!0});h.push({actionID:"toggleTabMode",keyBinding:new g("m",!0),predefined:!0});n.isMac&&(h.push({actionID:"deleteNext",keyBinding:new g(46,null,!0),predefined:!0}),h.push({actionID:"deleteWordPrevious",keyBinding:new g(8,null,null,!0),
predefined:!0}),h.push({actionID:"deleteWordNext",keyBinding:new g(46,null,null,!0),predefined:!0}));h.push({actionID:"toggleWrapMode",keyBinding:new l.KeyBinding("w",!0,!1,!0)});h.push({actionID:"toggleOverwriteMode",keyBinding:new l.KeyBinding(45)});if(!n.isFirefox){var f=n.isMac&&n.isChrome;h.push({actionID:"noop",keyBinding:new g("u",!f,!1,!1,f),predefined:!0});h.push({actionID:"noop",keyBinding:new g("i",!f,!1,!1,f),predefined:!0});h.push({actionID:"noop",keyBinding:new g("b",!f,!1,!1,f),predefined:!0})}n.isFirefox&&
(h.push({actionID:"copy",keyBinding:new g(45,!0),predefined:!0}),h.push({actionID:"paste",keyBinding:new g(45,null,!0),predefined:!0}),h.push({actionID:"cut",keyBinding:new g(46,null,!0),predefined:!0}));n.isMac&&(h.push({actionID:"lineStart",keyBinding:new g("a",!1,!1,!1,!0),predefined:!0}),h.push({actionID:"lineEnd",keyBinding:new g("e",!1,!1,!1,!0),predefined:!0}),h.push({actionID:"lineUp",keyBinding:new g("p",!1,!1,!1,!0),predefined:!0}),h.push({actionID:"lineDown",keyBinding:new g("n",!1,!1,
!1,!0),predefined:!0}),h.push({actionID:"charPrevious",keyBinding:new g("b",!1,!1,!1,!0),predefined:!0}),h.push({actionID:"charNext",keyBinding:new g("f",!1,!1,!1,!0),predefined:!0}),h.push({actionID:"deletePrevious",keyBinding:new g("h",!1,!1,!1,!0),predefined:!0}),h.push({actionID:"deleteNext",keyBinding:new g("d",!1,!1,!1,!0),predefined:!0}),h.push({actionID:"deleteLineEnd",keyBinding:new g("k",!1,!1,!1,!0),predefined:!0}),n.isFirefox?(h.push({actionID:"scrollPageDown",keyBinding:new g("v",!1,
!1,!1,!0),predefined:!0}),h.push({actionID:"deleteLineStart",keyBinding:new g("u",!1,!1,!1,!0),predefined:!0}),h.push({actionID:"deleteWordPrevious",keyBinding:new g("w",!1,!1,!1,!0),predefined:!0})):(h.push({actionID:"pageDown",keyBinding:new g("v",!1,!1,!1,!0),predefined:!0}),h.push({actionID:"centerLine",keyBinding:new g("l",!1,!1,!1,!0),predefined:!0}),h.push({actionID:"enterNoCursor",keyBinding:new g("o",!1,!1,!1,!0),predefined:!0})));return h};return{KeyMode:m,DefaultKeyMode:k}});
define("orion/editor/util",[],function(){return{contains:function(l,n){if(!n)return!1;if(!l.compareDocumentPosition){for(var m=n;m;){if(l===m)return!0;m=m.parentNode}return!1}return l===n||0!==(l.compareDocumentPosition(n)&16)},addEventListener:function(l,n,m,k){"function"===typeof l.addEventListener?l.addEventListener(n,m,!0===k):l.attachEvent("on"+n,m)},removeEventListener:function(l,n,m,k){"function"===typeof l.removeEventListener?l.removeEventListener(n,m,!0===k):l.detachEvent("on"+n,m)},Animation:function(){function l(l){this.options=
l}l.prototype.play=function(){var l="number"===typeof this.options.duration?this.options.duration:350,m=this.options.easing||this.defaultEasing,k=this.options.onAnimate||function(){},g=this.options.curve[0],h=this.options.curve[1],f=h-g,d=-1,a,e=this;this.interval=this.options.window.setInterval(function(){d=-1===d?(new Date).getTime():d;var b=((new Date).getTime()-d)/l;1>b?(b=m(b),a=g+b*f,k(a)):(k(h),e.stop())},"number"===typeof this.options.rate?this.options.rate:20)};l.prototype.stop=function(){this.options.window.clearInterval(this.interval);
(this.options.onEnd||function(){})()};l.prototype.defaultEasing=function(l){return Math.sin(l*(Math.PI/2))};return l}()}});
define("orion/editor/textView","i18n!orion/editor/nls/messages orion/editor/textModel orion/editor/keyModes orion/editor/eventTarget orion/editor/textTheme orion/editor/util orion/util".split(" "),function(l,n,m,k,g,h,f){function d(a,b,e){if(e){b.className="";e=b.attributes;for(var d=e.length;0<d--;)(!f.isIE||9<=f.isIE||9>f.isIE&&e[d].specified)&&b.removeAttribute(e[d].name)}if(a){a.styleClass&&(b.className=a.styleClass);if(e=a.style)for(var g in e)e.hasOwnProperty(g)&&(b.style[g]=e[g]);if(a=a.attributes)for(var p in a)a.hasOwnProperty(p)&&
b.setAttribute(p,a[p])}}function a(a){return a instanceof Array?a.slice(0):a}function e(a,b){if(!a)return b;if(!b)return a;for(var e in b)b.hasOwnProperty(e)&&(a.hasOwnProperty(e)||(a[e]=b[e]));return a}function b(a,e){if(a===e)return!0;if(a&&!e||!a&&e||a&&a.constructor===String||e&&e.constructor===String)return!1;if(a instanceof Array||e instanceof Array){if(!(a instanceof Array&&e instanceof Array)||a.length!==e.length)return!1;for(var d=0;d<a.length;d++)if(!b(a[d],e[d]))return!1;return!0}if(!(a instanceof
Object)||!(e instanceof Object))return!1;for(d in a)if(a.hasOwnProperty(d)&&(!e.hasOwnProperty(d)||!b(a[d],e[d])))return!1;for(d in e)if(!a.hasOwnProperty(d))return!1;return!0}function p(a,b,e){for(var d=0,f=0,g=0,p=a.length;g<p;){-1!==d&&d<=g&&(d=a.indexOf("\r",g));-1!==f&&f<=g&&(f=a.indexOf("\n",g));var h=g,k;if(-1===f&&-1===d){b(a.substring(g));break}-1!==d&&-1!==f?d+1===f?(k=d,g=f+1):(k=d<f?d:f,g=(d<f?d:f)+1):-1!==d?(k=d,g=d+1):(k=f,g=f+1);b(a.substring(h,k));e()}}function q(a){var b,e,d,f,g=
a.ownerDocument.defaultView||a.ownerDocument.parentWindow;g.getComputedStyle?(a=g.getComputedStyle(a,null),b=a.getPropertyValue("padding-left"),e=a.getPropertyValue("padding-top"),d=a.getPropertyValue("padding-right"),f=a.getPropertyValue("padding-bottom")):a.currentStyle&&(b=a.currentStyle.paddingLeft,e=a.currentStyle.paddingTop,d=a.currentStyle.paddingRight,f=a.currentStyle.paddingBottom);return{left:parseInt(b,10)||0,top:parseInt(e,10)||0,right:parseInt(d,10)||0,bottom:parseInt(f,10)||0}}function s(a){var b,
e,d,f,g=a._trim;if(!g){var g=q(a),p=a.ownerDocument.defaultView||a.ownerDocument.parentWindow;p.getComputedStyle?(f=p.getComputedStyle(a,null),b=f.getPropertyValue("border-left-width"),e=f.getPropertyValue("border-top-width"),d=f.getPropertyValue("border-right-width"),f=f.getPropertyValue("border-bottom-width")):a.currentStyle&&(b=a.currentStyle.borderLeftWidth,e=a.currentStyle.borderTopWidth,d=a.currentStyle.borderRightWidth,f=a.currentStyle.borderBottomWidth);b=parseInt(b,10)||0;e=parseInt(e,10)||
0;d=parseInt(d,10)||0;f=parseInt(f,10)||0;g.left+=b;g.top+=e;g.right+=d;g.bottom+=f;a._trim=g}return g}function u(a,b,e,d){function f(b){if(b.animationName===p){var e=b.target;"function"===typeof e.__DOMReady&&(a.defaultView||a.parentWindow).setTimeout(function(){e.__DOMReady()},0)}}function g(a,b){for(var e=["","-webkit-","-moz-","-ms-","-o-"],d="",f="body ."+a+" {\n",v=0;v<e.length;v++)d+="@"+e[v]+"keyframes "+b+" {\nfrom { opacity: 0.99; }\nto { opacity: 1; }\n}\n",f+=e[v]+"animation-duration: 0.001s;\n"+
e[v]+"animation-name: "+b+";\n";return d+(f+"}")}e="_"+e+"DOMReady";b.className=b.className?b.className+" "+e:e;b.__DOMReady=d;d=e+"Style";if(!a.getElementById(d)){var p=e+"Animation";t(a,"animationstart",f,!1);t(a,"MSAnimationStart",f,!1);t(a,"webkitAnimationStart",f,!1);b=a.createElement("style");b.id=d;d=a.getElementsByTagName("head")[0]||a.documentElement;b.appendChild(a.createTextNode(g(e,p)));d.insertBefore(b,d.firstChild)}}function w(a,b,e){this.start=a;this.end=b;this.caret=e}function x(a){this.left=
a.left;this.top=a.top;this.right=a.right;this.bottom=a.bottom}function y(a,b,e){this.view=a;this.lineIndex=b;this._lineDiv=e}function r(a){this._init(a||{})}var t=h.addEventListener,z=h.removeEventListener,B=h.Animation;w.prototype={clone:function(){return new w(this.start,this.end,this.caret)},collapse:function(){this.caret?this.end=this.start:this.start=this.end},extend:function(a){this.caret?this.start=a:this.end=a;this.start>this.end&&(a=this.start,this.start=this.end,this.end=a,this.caret=!this.caret)},
setCaret:function(a){this.end=this.start=a;this.caret=!1},getCaret:function(){return this.caret?this.start:this.end},toString:function(){return"start\x3d"+this.start+" end\x3d"+this.end+(this.caret?" caret is at start":" caret is at end")},isEmpty:function(){return this.start===this.end},equals:function(a){return this.caret===a.caret&&this.start===a.start&&this.end===a.end}};x.prototype={toString:function(){return"{l\x3d"+this.left+", t\x3d"+this.top+", r\x3d"+this.right+", b\x3d"+this.bottom+"}"}};
y.prototype={create:function(a,b){if(!this._lineDiv){var e=this._lineDiv=this._createLine(a,b,this.lineIndex);e._line=this;return e}},_createLine:function(a,e,g){var p=this.view,h=p._model,k=h.getLine(g),l=h.getLineStart(g),q={type:"LineStyle",textView:p,lineIndex:g,lineText:k,lineStart:l};p.onLineStyle(q);var s=a.ownerDocument,h=e||f.createElement(s,"div");if(!e||!b(e.viewStyle,q.style))d(q.style,h,e),e&&(e._trim=null),h.viewStyle=q.style,h.setAttribute("role","presentation");h.lineIndex=g;if(e&&
h.viewLineText===k&&b(q.ranges,h.viewRanges))return h;h.viewRanges=q.ranges;h.viewLineText=k;g=[];this._createRanges(q.ranges,k,0,k.length,l,{tabOffset:0,ranges:g});q=" ";!p._fullSelection&&9>f.isIE&&(q="\ufeff");p={text:q,style:p._metrics.largestFontStyle,ignoreChars:1};0===g.length||!g[g.length-1].style||"div"!==g[g.length-1].style.tagName?g.push(p):g.splice(g.length-1,0,p);var u,m,n,t=q=0;if(f.isFirefox&&2E3<k.length){e&&(h.innerHTML="",e.lineWidth=void 0);e=s.createDocumentFragment();for(k=0;k<
g.length;k++)p=g[k],l=p.text,u=p.style,u=this._createSpan(h,l,u,p.ignoreChars),e.appendChild(u);h.appendChild(e)}else{var w,x;if(e){if(m=e.modelChangedEvent)0===m.removedLineCount&&0===m.addedLineCount?(x=m.start-l,w=m.addedCharCount-m.removedCharCount):x=-1,e.modelChangedEvent=void 0;m=e.firstChild}for(k=0;k<g.length;k++){p=g[k];l=p.text;q+=l.length;u=p.style;if(m)if(n=m.firstChild.data,s=m.viewStyle,n===l&&b(u,s)){t+=n.length;m._rectsCache=void 0;u=m=m.nextSibling;continue}else for(;m;){if(-1!==
x){s=q;s>=x&&(s-=w);n=(n=m.firstChild.data)?n.length:0;if(t+n>s)break;t+=n}s=m.nextSibling;h.removeChild(m);m=s}u=this._createSpan(h,l,u,p.ignoreChars);m?h.insertBefore(u,m):h.appendChild(u);e&&(e.lineWidth=void 0)}if(e)for(w=u?u.nextSibling:null;w;)s=w.nextSibling,e.removeChild(w),w=s}h.parentNode||a.appendChild(h);return h},_createRanges:function(a,e,d,f,g,p){if(!(d>f)){if(a)for(var h=0;h<a.length;h++){var k=a[h];if(!(k.end<g+d)){var l=Math.max(g+d,k.start)-g;if(l>f)break;var q=Math.min(g+f,k.end)-
g;if(l<=q){l=Math.max(d,l);q=Math.min(f,q);d<l&&this._createRange(e,d,l,null,p);if(!k.style||!k.style.unmergeable)for(;h+1<a.length&&a[h+1].start-g===q&&b(k.style,a[h+1].style);)k=a[h+1],q=Math.min(g+f,k.end)-g,h++;this._createRange(e,l,q,k.style,p);d=q}}}d<f&&this._createRange(e,d,f,null,p)}},_createRange:function(a,b,e,d,f){if(!(b>e)){var g=this.view._customTabSize;if(g&&8!==g)for(var p=a.indexOf("\t",b);-1!==p&&p<e;){b<p&&(b={text:a.substring(b,p),style:d},f.ranges.push(b),f.tabOffset+=b.text.length);
b=g-f.tabOffset%g;if(0<b){for(var h="\u00a0",k=1;k<b;k++)h+=" ";b={text:h,style:d,ignoreChars:b-1};f.ranges.push(b);f.tabOffset+=b.text.length}b=p+1;if(b===e)return;p=a.indexOf("\t",b)}b<=e&&(b={text:a.substring(b,e),style:d},f.ranges.push(b),f.tabOffset+=b.text.length)}},_createSpan:function(a,b,e,g){var p=this.view,h="span";e&&e.tagName&&(h=e.tagName.toLowerCase());var k="a"===h;k&&(this.hasLink=!0);k&&!p._linksVisible&&(h="span");k=a.ownerDocument;a=f.createElement(a.ownerDocument,h);a.appendChild(k.createTextNode(e&&
e.text?e.text:b));e&&e.html?(a.innerHTML=e.html,a.ignore=!0):e&&e.node&&(a.appendChild(e.node),a.ignore=!0);d(e,a);if("a"===h){var l=p._getWindow();t(a,"click",function(a){return p._handleLinkClick(a?a:l.event)},!1)}a.viewStyle=e;g&&(a.ignoreChars=g);return a},_ensureCreated:function(){return this._lineDiv?this._lineDiv:this._createdDiv=this.create(this.view._clientDiv,null)},getBoundingClientRect:function(a,b){var e=this._ensureCreated(),d=this.view;if(void 0===a)return this._getLineBoundingClientRect(e,
!0);var g=d._model,p=e.ownerDocument,h=this.lineIndex,k=null;if(a<g.getLineEnd(h)){var l=g.getLineStart(h);this.forEach(function(b){var g=b.firstChild,h=this._nodeLength(b);if(l+h>a){var A=a-l;if(1===g.length)k=new x(b.getBoundingClientRect());else if(d._isRangeRects)h=p.createRange(),h.setStart(g,A),h.setEnd(g,A+1),k=new x(h.getBoundingClientRect());else if(f.isIE)h=p.body.createTextRange(),h.moveToElementText(b),h.collapse(),(g=0===A&&8===f.isIE)&&(A=1),h.moveEnd("character",A+1),h.moveStart("character",
A),k=new x(h.getBoundingClientRect()),g&&(k.left=b.getClientRects()[0].left);else{var q=g.data;b.removeChild(g);b.appendChild(p.createTextNode(q.substring(0,A)));var s=f.createElement(p,"span");s.appendChild(p.createTextNode(q.substring(A,A+1)));b.appendChild(s);b.appendChild(p.createTextNode(q.substring(A+1)));k=new x(s.getBoundingClientRect());b.innerHTML="";b.appendChild(g);this._createdDiv||(b=d._getSelection(),(l<=b.start&&b.start<l+h||l<=b.end&&b.end<l+h)&&d._updateDOMSelection())}f.isIE&&(A=
e.ownerDocument.defaultView||e.ownerDocument.parentWindow,b=A.screen.logicalXDPI/A.screen.deviceXDPI,A=A.screen.logicalYDPI/A.screen.deviceYDPI,k.left*=b,k.right*=b,k.top*=A,k.bottom*=A);return!1}l+=h;return!0})}g=this.getBoundingClientRect();k||(d._wrapMode?(h=this.getClientRects(),k=h[h.length-1],k.left=k.right,k.left+=g.left,k.top+=g.top,k.right+=g.left,k.bottom+=g.top):(k=new x(g),k.left=k.right));if(b||void 0===b)k.left-=g.left,k.top-=g.top,k.right-=g.left,k.bottom-=g.top;return k},forEach:function(a){for(var b=
this._ensureCreated().firstChild;b;){var e=b.nextSibling;if(!b.ignore&&!a.call(this,b))break;b=e}},_getClientRects:function(a,b){var e,d,f,g;if(!a._rectsCache){e=a.getClientRects();d=Array(e.length);for(g=0;g<e.length;g++)f=d[g]=new x(e[g]),f.left-=b.left,f.top-=b.top,f.right-=b.left,f.bottom-=b.top;a._rectsCache=d}e=a._rectsCache;d=[e.length];for(g=0;g<e.length;g++)d[g]=new x(e[g]);return d},getClientRects:function(a){if(!this.view._wrapMode)return[this.getBoundingClientRect()];var b=[],e=this._ensureCreated().getBoundingClientRect();
this.forEach(function(a){a=this._getClientRects(a,e);for(var d=0;d<a.length;d++){var f=a[d],g,p;if(f.top!==f.bottom){var v=f.top+(f.bottom-f.top)/2;for(g=0;g<b.length&&!(p=b[g],p.top<=v&&v<p.bottom);g++);g===b.length?b.push(f):(f.left<p.left&&(p.left=f.left),f.top<p.top&&(p.top=f.top),f.right>p.right&&(p.right=f.right),f.bottom>p.bottom&&(p.bottom=f.bottom))}}return!0});return void 0!==a?b[a]:b},_getLineBoundingClientRect:function(a,b){var e=new x(a.getBoundingClientRect());if(!this.view._wrapMode){e.right=
e.left;for(var d=a.lastChild;d&&d.ignoreChars===d.firstChild.length;)d=d.previousSibling;d&&(d=d.getBoundingClientRect(),e.right=d.right+s(a).right)}b&&(d=s(a),e.left+=d.left,e.right-=d.right);return e},getLineCount:function(){return!this.view._wrapMode?1:this.getClientRects().length},getLineIndex:function(a){if(!this.view._wrapMode)return 0;var b=this.getClientRects();a=this.getBoundingClientRect(a);a=a.top+(a.bottom-a.top)/2;for(var e=0;e<b.length;e++)if(b[e].top<=a&&a<b[e].bottom)return e;return b.length-
1},getLineStart:function(a){if(!this.view._wrapMode||0===a)return this.view._model.getLineStart(this.lineIndex);var b=this.getClientRects();return this.getOffset(b[a].left+1,b[a].top+1)},_nodeLength:function(a){if(!a||a.ignore)return 0;var b=a.firstChild.length;a.ignoreChars&&(b-=a.ignoreChars);return b},getModelOffset:function(a,b){if(!a)return 0;var e=0;this.forEach(function(d){var f=d.firstChild;if(f===a)return d.ignoreChars&&(e-=d.ignoreChars),e+=b,!1;d.ignoreChars&&(e-=d.ignoreChars);e+=f.data.length;
return!0});return Math.max(0,e)+this.view._model.getLineStart(this.lineIndex)},getNodeOffset:function(a){var b=0,e,d,f=this.view._model,g=f.getLineStart(this.lineIndex),p=a-g,h=f.getLineEnd(this.lineIndex)-g;this.forEach(function(a){var f=a.firstChild,g=this._nodeLength(a);if(g+b>p||b+g>=h)return e=f,d=p-b,a.ignoreChars&&(0<g&&d===g)&&(d+=a.ignoreChars),!1;b+=g;return!0});return{node:e,offset:d}},getText:function(a){var b="",e=0;this.forEach(function(d){var f;if(d.ignoreChars){f=d.lastChild;for(var g=
0,p=[],h=-1;f;){var k=f.data;if(k)for(var l=k.length-1;0<=l;l--){var q=k.substring(l,l+1);g<d.ignoreChars&&(" "===q||"\ufeff"===q)?g++:p.push("\u00a0"===q?"\t":q)}a===f&&(h=p.length);f=f.previousSibling}p=p.reverse().join("");-1!==h&&(e=b.length+p.length-h);b+=p}else for(f=d.firstChild;f;)a===f&&(e=b.length),b+=f.data,f=f.nextSibling;return!0});return{text:b,offset:e}},getOffset:function(a,b){function e(d,l,C){var m=d.firstChild,D=u._nodeLength(d),n=q.ownerDocument,t=n.defaultView||n.parentWindow,
w=f.isIE?t.screen.logicalXDPI/t.screen.deviceXDPI:1,x=f.isIE?t.screen.logicalYDPI/t.screen.deviceYDPI:1,r,z,y,t=C.left+s.left,B,J;if(f.isIE||g._isRangeRects){for(var n=g._isRangeRects?n.createRange():n.body.createTextRange(),G=D,U=-1;1<G-U;){var V=Math.floor((G+U)/2);C=U+1;r=V===D-1&&d.ignoreChars?m.length:V+1;B=0===C&&8===f.isIE;g._isRangeRects?(n.setStart(m,C),n.setEnd(m,r)):(B&&(C=1),n.moveToElementText(d),n.move("character",C),n.moveEnd("character",r-C));J=n.getClientRects();for(var T=!1,S=0;S<
J.length;S++)if(C=J[S],r=(B?t:C.left)*w-s.left,y=C.right*w-s.left,z=C.top*x-s.top,C=C.bottom*x-s.top,r<=a&&a<y&&(!g._wrapMode||z<=b&&b<C)){T=!0;break}T?G=V:U=V}l+=G;C=G;r=G===D-1&&d.ignoreChars?m.length:Math.min(G+1,m.length);g._isRangeRects?(n.setStart(m,C),n.setEnd(m,r)):(n.moveToElementText(d),n.move("character",C),n.moveEnd("character",r-C));J=n.getClientRects();D=!1;0<J.length&&(C=J[0],r=(B?t:C.left)*w-s.left,y=C.right*w-s.left,D=a>r+(y-r)/2);d=l-k;m=p.getLine(h);w=m.charCodeAt(d);55296<=w&&
56319>=w&&D?d<m.length&&(w=m.charCodeAt(d+1),56320<=w&&57343>=w&&(l+=1)):56320<=w&&(57343>=w&&!D)&&0<d&&(w=m.charCodeAt(d-1),55296<=w&&56319>=w&&(l-=1));D&&l++}else{w=[];for(B=0;B<D;B++)w.push("\x3cspan\x3e"),B===D-1?w.push(m.data.substring(B)):w.push(m.data.substring(B,B+1)),w.push("\x3c/span\x3e");d.innerHTML=w.join("");for(w=d.firstChild;w;){C=w.getBoundingClientRect();r=C.left-s.left;y=C.right-s.left;if(r<=a&&a<y){a>r+(y-r)/2&&l++;break}l++;w=w.nextSibling}u._createdDiv||(d.innerHTML="",d.appendChild(m),
d=g._getSelection(),(l<=d.start&&d.start<l+D||l<=d.end&&d.end<l+D)&&g._updateDOMSelection())}return l}function d(e){if(e.ignore)return null;e=u._getClientRects(e,s);for(var f=0;f<e.length;f++){var p=e[f];if(p.left<=a&&a<p.right&&(!g._wrapMode||p.top<=b&&b<p.bottom))return p}return null}var g=this.view,p=g._model,h=this.lineIndex,k=p.getLineStart(h),l=p.getLineEnd(h);if(k===l)return k;var q=this._ensureCreated(),s=this.getBoundingClientRect(),u=this,m,n;if(g._wrapMode){m=this.getClientRects();b<m[0].top&&
(b=m[0].top);for(var t=0;t<m.length&&!(n=m[t],n.top<=b&&b<n.bottom);t++);a<n.left&&(a=n.left);a>n.right&&(a=n.right-1)}else 0>a&&(a=0),a>s.right-s.left&&(a=s.right-s.left);var w,x;if(this._lastHitChild&&this._lastHitChild.parentNode){if(w=this._lastHitOffset,x=this._lastHitChild,n=d(x),!n){m=w;for(var t=w+this._nodeLength(x),r=x.previousSibling,z=x.nextSibling;r||z;){if(r){m-=this._nodeLength(r);if(n=d(r)){x=r;w=m;break}r=r.previousSibling}if(z){if(n=d(z)){x=z;w=t;break}t+=this._nodeLength(z);z=z.nextSibling}}}}else w=
k,this.forEach(function(a){x=a;if(n=d(x))return!1;w+=this._nodeLength(x);return!0});x&&n&&(this._lastHitChild=x,this._lastHitOffset=w,w=e(x,w,n));return Math.min(l,Math.max(k,w))},getNextOffset:function(a,b){if("line"===b.unit){var e=this.view._model,d=e.getLineAtOffset(a);if(0<b.count)return b.count--,e.getLineEnd(d);b.count++;return e.getLineStart(d)}return"wordend"===b.unit||"wordWS"===b.unit||"wordendWS"===b.unit?this._getNextOffset_W3C(a,b):f.isIE?this._getNextOffset_IE(a,b):this._getNextOffset_W3C(a,
b)},_getNextOffset_W3C:function(a,b){function e(a){return 33<=a&&47>=a||58<=a&&64>=a||91<=a&&94>=a||96===a||123<=a&&126>=a}function d(a){return 32===a||9===a}var f=this.view._model,g=f.getLineAtOffset(a),p=f.getLine(g),h=f.getLineStart(g),f=f.getLineEnd(g),g=p.length,k=a-h,l,q=0>b.count?-1:1;if("word"===b.unit||"wordend"===b.unit||"wordWS"===b.unit||"wordendWS"===b.unit)for(var s,m,u;0!==b.count;){if(0<b.count){if(k===g)return f;l=p.charCodeAt(k);s=e(l);m=!s&&!d(l);for(k++;k<g;){l=p.charCodeAt(k);
if("wordWS"!==b.unit&&"wordendWS"!==b.unit){u=e(l);if("wordend"===b.unit){if(!u&&s)break}else if(u&&!s)break;l=!u&&!d(l)}else l=!d(l);if("wordend"===b.unit||"wordendWS"===b.unit){if(!l&&m)break}else if(l&&!m)break;m=l;s=u;k++}}else{if(0===k)return h;k--;l=p.charCodeAt(k);s=e(l);for(m=!s&&!d(l);0<k;){l=p.charCodeAt(k-1);if("wordWS"!==b.unit&&"wordendWS"!==b.unit){u=e(l);if("wordend"===b.unit){if(u&&!s)break}else if(!u&&s)break;l=!u&&!d(l)}else l=!d(l);if("wordend"===b.unit||"wordendWS"===b.unit){if(l&&
!m)break}else if(!l&&m)break;m=l;s=u;k--}}b.count-=q}else for(;0!==b.count&&0<=k+q&&k+q<=g;)k+=q,l=p.charCodeAt(k),56320<=l&&57343>=l&&0<k&&(l=p.charCodeAt(k-1),55296<=l&&56319>=l&&(k+=q)),b.count-=q;return h+k},_getNextOffset_IE:function(a,b){var e=this._ensureCreated(),d=this.view._model,f=this.lineIndex,g=0,p;p=d.getLineStart(f);var h=d.getLine(f),k=d.getLineStart(f),l=e.ownerDocument,q=0>b.count?-1:1;if(a===d.getLineEnd(f)){for(e=e.lastChild;e&&e.ignoreChars===e.firstChild.length;)e=e.previousSibling;
if(!e)return p;g=l.body.createTextRange();g.moveToElementText(e);p=g.text.length;g.moveEnd(b.unit,q);g=a+g.text.length-p}else if(a===p&&0>b.count)g=p;else for(e=e.firstChild;e;){d=this._nodeLength(e);if(p+d>a){g=l.body.createTextRange();if(a===p&&0>b.count){for(p=e.previousSibling;p&&(!p.firstChild||!p.firstChild.length);)p=p.previousSibling;g.moveToElementText(p?p:e.previousSibling)}else g.moveToElementText(e),g.collapse(),g.moveEnd("character",a-p);p=g.text.length;g.moveEnd(b.unit,q);g=a+g.text.length-
p;break}p=d+p;e=e.nextSibling}p=g-k;c=h.charCodeAt(p);56320<=c&&57343>=c&&0<p&&(c=h.charCodeAt(p-1),55296<=c&&56319>=c&&(p+=q));b.count-=q;return p+k},updateLinks:function(){var a=this._ensureCreated();if(this.hasLink){var b=this;this.forEach(function(e){var d=e.viewStyle;d&&(d.tagName&&"a"===d.tagName.toLowerCase())&&a.replaceChild(b._createSpan(a,e.firstChild.data,d),e);return!0})}},destroy:function(){var a=this._createdDiv;a&&(a.parentNode.removeChild(a),this._createdDiv=null)}};r.prototype={addKeyMode:function(a,
b){var e=this._keyModes;void 0!==b?e.splice(b,0,a):e.push(a);a._modeAdded&&a._modeAdded()},addRuler:function(a,b){a.setView(this);var e=this._rulers;if(void 0!==b){var d,f;for(f=d=0;d<e.length&&f<b;d++)a.getLocation()===e[d].getLocation()&&f++;e.splice(f,0,a);b=f}else e.push(a);this._createRuler(a,b);this._update()},computeSize:function(){var a=0,b=0,e=this._model,d=this._clientDiv;if(!d)return{width:a,height:b};var g=d.style.width;f.isWebkit&&(d.style.width="0x7fffffffpx");for(var e=e.getLineCount(),
p=0;p<e;p++){var h=this._getLine(p),k=h.getBoundingClientRect(),a=Math.max(a,k.right-k.left),b=b+(k.bottom-k.top);h.destroy()}f.isWebkit&&(d.style.width=g);d=this._getViewPadding();a+=d.right+d.left+this._metrics.scrollWidth;b+=d.bottom+d.top+this._metrics.scrollWidth;return{width:a,height:b}},convert:function(a,b,e){if(this._clientDiv){var d=this._getScroll(),f=this._getViewPadding(),g=this._viewDiv.getBoundingClientRect();"document"===b&&(void 0!==a.x&&(a.x+=-d.x+g.left+f.left),void 0!==a.y&&(a.y+=
-d.y+g.top+f.top));"document"===e&&(void 0!==a.x&&(a.x+=d.x-g.left-f.left),void 0!==a.y&&(a.y+=d.y-g.top-f.top));return a}},destroy:function(){for(var a=0;a<this._rulers.length;a++)this._rulers[a].setView(null);this.rulers=null;this._destroyView();this.onDestroy({type:"Destroy"});this._parent=null;this._model&&this._model.destroy&&this._model.destroy();this._actions=this._keyModes=this._doubleClickSelection=this._selection=this._theme=this._model=null},focus:function(){this._clientDiv&&(this._updateDOMSelection(),
this._clientDiv.focus(),this._updateDOMSelection())},hasFocus:function(){return this._hasFocus},getActionDescription:function(a){if(a=this._actions[a])return a.actionDescription},getActions:function(a){var b=[],e=this._actions,d;for(d in e)e.hasOwnProperty(d)&&(a||!e[d].defaultHandler)&&b.push(d);return b},getBottomIndex:function(a){return!this._clientDiv?0:this._getBottomIndex(a)},getBottomPixel:function(){return!this._clientDiv?0:this._getScroll().y+this._getClientHeight()},getCaretOffset:function(){return this._getSelection().getCaret()},
getClientArea:function(){if(!this._clientDiv)return{x:0,y:0,width:0,height:0};var a=this._getScroll();return{x:a.x,y:a.y,width:this._getClientWidth(),height:this._getClientHeight()}},getHorizontalPixel:function(){return!this._clientDiv?0:this._getScroll().x},getKeyBindings:function(a){for(var b=[],e=this._keyModes,d=0;d<e.length;d++)b=b.concat(e[d].getKeyBindings(a));return b},getKeyModes:function(){return this._keyModes.slice(0)},getLineHeight:function(a){return!this._clientDiv?0:this._getLineHeight(a)},
getLineIndex:function(a){return!this._clientDiv?0:this._getLineIndex(a)},getLinePixel:function(a){return!this._clientDiv?0:this._getLinePixel(a)},getLocationAtOffset:function(a){if(!this._clientDiv)return{x:0,y:0};var b=this._model;a=Math.min(Math.max(0,a),b.getCharCount());var b=b.getLineAtOffset(a),e=this._getLine(b);a=e.getBoundingClientRect(a);e.destroy();e=a.left;b=this._getLinePixel(b)+a.top;return{x:e,y:b}},getNextOffset:function(a,b){var e=new w(a,a,!1);this._doMove(b,e);return e.getCaret()},
getOptions:function(){var b;if(0===arguments.length)b=this._defaultOptions();else if(1===arguments.length){if(b=arguments[0],"string"===typeof b)return a(this["_"+b])}else{b={};for(var e in arguments)arguments.hasOwnProperty(e)&&(b[arguments[e]]=void 0)}for(var d in b)b.hasOwnProperty(d)&&(b[d]=a(this["_"+d]));return b},getModel:function(){return this._model},getOffsetAtLocation:function(a,b){if(!this._clientDiv)return 0;var e=this._getLineIndex(b),d=this._getLine(e),e=d.getOffset(a,b-this._getLinePixel(e));
d.destroy();return e},getLineAtOffset:function(a){return this.getModel().getLineAtOffset(a)},getLineStart:function(a){this.getModel().getLineStart(a)},getRulers:function(){return this._rulers.slice(0)},getSelection:function(){var a=this._getSelection();return{start:a.start,end:a.end}},getText:function(a,b){return this._model.getText(a,b)},getTopIndex:function(a){return!this._clientDiv?0:this._getTopIndex(a)},getTopPixel:function(){return!this._clientDiv?0:this._getScroll().y},invokeAction:function(a,
b,e){if(this._clientDiv){if(a=this._actions[a]){if(!b&&a.handler&&a.handler(e))return!0;if(a.defaultHandler)return"boolean"===typeof a.defaultHandler(e)}return!1}},isDestroyed:function(){return!this._clientDiv},onContextMenu:function(a){return this.dispatchEvent(a)},onDragStart:function(a){return this.dispatchEvent(a)},onDrag:function(a){return this.dispatchEvent(a)},onDragEnd:function(a){return this.dispatchEvent(a)},onDragEnter:function(a){return this.dispatchEvent(a)},onDragOver:function(a){return this.dispatchEvent(a)},
onDragLeave:function(a){return this.dispatchEvent(a)},onDrop:function(a){return this.dispatchEvent(a)},onDestroy:function(a){return this.dispatchEvent(a)},onLineStyle:function(a){return this.dispatchEvent(a)},onKeyDown:function(a){return this.dispatchEvent(a)},onKeyPress:function(a){return this.dispatchEvent(a)},onKeyUp:function(a){return this.dispatchEvent(a)},onModelChanged:function(a){return this.dispatchEvent(a)},onModelChanging:function(a){return this.dispatchEvent(a)},onModify:function(a){return this.dispatchEvent(a)},
onMouseDown:function(a){return this.dispatchEvent(a)},onMouseUp:function(a){return this.dispatchEvent(a)},onMouseMove:function(a){return this.dispatchEvent(a)},onMouseOver:function(a){return this.dispatchEvent(a)},onMouseOut:function(a){return this.dispatchEvent(a)},onSelection:function(a){return this.dispatchEvent(a)},onScroll:function(a){return this.dispatchEvent(a)},onVerify:function(a){return this.dispatchEvent(a)},onFocus:function(a){return this.dispatchEvent(a)},onBlur:function(a){return this.dispatchEvent(a)},
redraw:function(){if(!(0<this._redrawCount)){var a=this._model.getLineCount();this.redrawRulers(0,a);this.redrawLines(0,a)}},redrawRulers:function(a,b){if(!(0<this._redrawCount))for(var e=this.getRulers(),d=0;d<e.length;d++)this.redrawLines(a,b,e[d])},redrawLines:function(a,b,e){if(!(0<this._redrawCount)&&(void 0===a&&(a=0),void 0===b&&(b=this._model.getLineCount()),a!==b)){var d=this._clientDiv;if(d){if(e)for(d=this._getRulerParent(e).firstChild;d&&d._ruler!==e;)d=d.nextSibling;e?d.rulerChanged=
!0:this._lineHeight&&this._resetLineHeight(a,b);if(!e||"page"===e.getOverview())for(d=d.firstChild;d;){var f=d.lineIndex;a<=f&&f<b&&(d.lineChanged=!0);d=d.nextSibling}!e&&(!this._wrapMode&&a<=this._maxLineIndex&&this._maxLineIndex<b)&&(this._checkMaxLineIndex=this._maxLineIndex,this._maxLineIndex=-1,this._maxLineWidth=0);this._queueUpdate()}}},redrawRange:function(a,b){if(!(0<this._redrawCount)){var e=this._model;void 0===a&&(a=0);void 0===b&&(b=e.getCharCount());var d=e.getLineAtOffset(a),e=e.getLineAtOffset(Math.max(a,
b-1))+1;this.redrawLines(d,e)}},removeKeyMode:function(a){for(var b=this._keyModes,e=0;e<b.length;e++)if(b[e]===a){b.splice(e,1);break}a._modeRemoved&&a._modeRemoved()},removeRuler:function(a){for(var b=this._rulers,e=0;e<b.length;e++)if(b[e]===a){b.splice(e,1);a.setView(null);this._destroyRuler(a);this._update();break}},resize:function(){this._clientDiv&&this._handleResize(null)},setAction:function(a,b,e){if(a){var d=this._actions,f=d[a];f||(f=d[a]={});f.handler=b;void 0!==e&&(f.actionDescription=
e)}},setKeyBinding:function(a,b){this._keyModes[0].setKeyBinding(a,b)},setCaretOffset:function(a,b,e){var d=this._model.getCharCount();a=Math.max(0,Math.min(a,d));a=new w(a,a,!1);this._setSelection(a,void 0===b||b,!0,e)},setHorizontalPixel:function(a){this._clientDiv&&(a=Math.max(0,a),this._scrollView(a-this._getScroll().x,0))},setRedraw:function(a){a?0===--this._redrawCount&&this.redraw():this._redrawCount++},setModel:function(a){if(a&&a!==this._model){this._model.removeEventListener("preChanging",
this._modelListener.onChanging);this._model.removeEventListener("postChanged",this._modelListener.onChanged);var b=this._model.getLineCount(),e=this._model.getCharCount(),d=a.getLineCount(),f=a.getCharCount(),g={type:"ModelChanging",text:a.getText(),start:0,removedCharCount:e,addedCharCount:f,removedLineCount:b,addedLineCount:d};this.onModelChanging(g);this._model=a;g={type:"ModelChanged",start:0,removedCharCount:e,addedCharCount:f,removedLineCount:b,addedLineCount:d};this.onModelChanged(g);this._model.addEventListener("preChanging",
this._modelListener.onChanging);this._model.addEventListener("postChanged",this._modelListener.onChanged);this._reset();this._update()}},setOptions:function(e){var d=this._defaultOptions(),f;for(f in e)if(e.hasOwnProperty(f)){var g=e[f];if(!b(this["_"+f],g)){var p=d[f]?d[f].update:null;p?p.call(this,g):this["_"+f]=a(g)}}},setSelection:function(a,b,e,d){var f=a>b;if(f){var g=a;a=b;b=g}g=this._model.getCharCount();a=Math.max(0,Math.min(a,g));b=Math.max(0,Math.min(b,g));a=new w(a,b,f);this._setSelection(a,
void 0===e||e,!0,d)},setText:function(a,b,e){var d=void 0===b&&void 0===e;void 0===b&&(b=0);void 0===e&&(e=this._model.getCharCount());d&&(this._variableLineHeight=!1);this._modifyContent({text:a,start:b,end:e,_code:!0},!d);d&&(this._columnX=-1,this._setSelection(new w(0,0,!1),!0),13>f.isFirefox&&this._fixCaret())},setTopIndex:function(a){this._clientDiv&&this._scrollView(0,this._getLinePixel(Math.max(0,a))-this._getScroll().y)},setTopPixel:function(a){this._clientDiv&&this._scrollView(0,Math.max(0,
a)-this._getScroll().y)},showSelection:function(a,b){return this._showCaret(a?!1:!0,b,a)},update:function(a,b){this._clientDiv&&((a||this._metrics.invalid)&&this._updateStyle(),void 0===b||b?this._update():this._queueUpdate())},_handleRootMouseDown:function(a){this._cancelCheckSelection();if(!this._ignoreEvent(a)){13>f.isFirefox&&1===a.which&&(this._clientDiv.contentEditable=!1,this._ignoreBlur=(this._overlayDiv||this._clientDiv).draggable=!0);var b=this._overlayDiv||this._clientDiv;9>f.isIE&&(b=
this._viewDiv);for(var e=a.target?a.target:a.srcElement;e;){if(b===e||e.className&&-1!==e.className.indexOf("textViewFind"))return;e=e.parentNode}a.preventDefault&&a.preventDefault();a.stopPropagation&&a.stopPropagation();if(!this._isW3CEvents){var d=this;this._getWindow().setTimeout(function(){d._clientDiv.focus()},0)}}},_handleRootMouseUp:function(a){!this._ignoreEvent(a)&&(13>f.isFirefox&&1===a.which)&&(this._clientDiv.contentEditable=!0,(this._overlayDiv||this._clientDiv).draggable=!1,this._fixCaret(),
this._ignoreBlur=!1)},_handleBlur:function(a){this._cancelCheckSelection();if(!this._ignoreBlur){this._commitIME();this._hasFocus=!1;if(9>f.isIE&&!this._getSelection().isEmpty()){a=this._rootDiv;var b=f.createElement(a.ownerDocument,"div");a.appendChild(b);a.removeChild(b)}this._cursorDiv&&(this._cursorDiv.style.display="none");if(this._selDiv1)if(this._selDiv1.style.background="lightgray",this._selDiv2.style.background="lightgray",this._selDiv3.style.background="lightgray",a=this._getWindow(),b=
this._selDiv1.ownerDocument,a.getSelection){b=a.getSelection();for(a=b.anchorNode;a;){if(a===this._clientDiv){0<b.rangeCount&&b.removeAllRanges();break}a=a.parentNode}}else if(b.selection){this._ignoreSelect=!1;for(a=b.selection.createRange().parentElement();a;){if(a===this._clientDiv){b.selection.empty();break}a=a.parentNode}this._ignoreSelect=!0}if(!this._ignoreFocus)this.onBlur({type:"Blur"})}},_handleCompositionStart:function(a){this._ignoreEvent(a)||(this._startIME(),this._mutationObserver&&
(this._mutationObserver.disconnect(),this._mutationObserver=null))},_handleCompositionEnd:function(a){this._ignoreEvent(a)||this._commitIME(a.data)},_handleContextMenu:function(a){if(!this._ignoreEvent(a)){f.isIE&&3===this._lastMouseButton&&this._updateDOMSelection();var b=!1;this.isListening("ContextMenu")?(b=this._createMouseEvent("ContextMenu",a),b.screenX=a.screenX,b.screenY=a.screenY,this.onContextMenu(b),b=b.defaultPrevented):f.isMac&&(f.isFirefox&&0===a.button)&&(b=!0);if(b)return a.preventDefault&&
a.preventDefault(),!1;this._contextMenuOpen=!0;f.isFirefox&&(this._checkSelectionChange=!0,this._pollSelectionChange(!0))}},_handleCopy:function(a){this._cancelCheckSelection();if(!this._ignoreEvent(a)&&!this._ignoreCopy&&this._doCopy(a))return a.preventDefault&&a.preventDefault(),!1},_handleCut:function(a){this._cancelCheckSelection();if(!this._ignoreEvent(a)&&this._doCut(a))return a.preventDefault&&a.preventDefault(),!1},_handleDataModified:function(a){this._ignoreEvent(a)||this._startIME()},_handleDblclick:function(a){this._ignoreEvent(a)||
(this._lastMouseTime=a.timeStamp?a.timeStamp:(new Date).getTime(),2!==this._clickCount&&(this._clickCount=2,this._handleMouse(a)))},_handleDragStart:function(a){if(!this._ignoreEvent(a)){if(13>f.isFirefox){var b=this;this._getWindow().setTimeout(function(){b._clientDiv.contentEditable=!0;b._clientDiv.draggable=!1;b._ignoreBlur=!1},0)}if(this.isListening("DragStart")&&-1!==this._dragOffset)this._isMouseDown=!1,this.onDragStart(this._createMouseEvent("DragStart",a)),this._dragOffset=-1;else return a.preventDefault&&
a.preventDefault(),!1}},_handleDrag:function(a){if(!this._ignoreEvent(a)&&this.isListening("Drag"))this.onDrag(this._createMouseEvent("Drag",a))},_handleDragEnd:function(a){if(!this._ignoreEvent(a)){this._dropTarget=!1;this._dragOffset=-1;if(this.isListening("DragEnd"))this.onDragEnd(this._createMouseEvent("DragEnd",a));13>f.isFirefox&&(this._fixCaret(),"none"===a.dataTransfer.dropEffect&&!a.dataTransfer.mozUserCancelled&&this._fixCaret())}},_handleDragEnter:function(a){if(!this._ignoreEvent(a)){var b=
!0;this._dropTarget=!0;this.isListening("DragEnter")&&(b=!1,this.onDragEnter(this._createMouseEvent("DragEnter",a)));if(f.isWebkit||b)return a.preventDefault&&a.preventDefault(),!1}},_handleDragOver:function(a){if(!this._ignoreEvent(a)){var b=!0;this.isListening("DragOver")&&(b=!1,this.onDragOver(this._createMouseEvent("DragOver",a)));if(f.isWebkit||b)return b&&(a.dataTransfer.dropEffect="none"),a.preventDefault&&a.preventDefault(),!1}},_handleDragLeave:function(a){if(!this._ignoreEvent(a)&&(this._dropTarget=
!1,this.isListening("DragLeave")))this.onDragLeave(this._createMouseEvent("DragLeave",a))},_handleDrop:function(a){if(!this._ignoreEvent(a)){this._dropTarget=!1;if(this.isListening("Drop"))this.onDrop(this._createMouseEvent("Drop",a));a.preventDefault&&a.preventDefault();return!1}},_handleFocus:function(a){this._hasFocus=!0;f.isIOS&&void 0!==this._lastTouchOffset?(this.setCaretOffset(this._lastTouchOffset,!0),this._lastTouchOffset=void 0):this._updateDOMSelection();this._cursorDiv&&(this._cursorDiv.style.display=
"block");this._selDiv1&&(a=this._highlightRGB,this._selDiv1.style.background=a,this._selDiv2.style.background=a,this._selDiv3.style.background=a);if(!this._ignoreFocus)this.onFocus({type:"Focus"})},_handleKeyDown:function(a){this._cancelCheckSelection();if(!this._ignoreEvent(a)){if(this.isListening("KeyDown")){var b=this._createKeyEvent("KeyDown",a);this.onKeyDown(b);if(b.defaultPrevented){f.isFirefox&&(this._keyDownPrevented=!0);a.preventDefault();return}}b=!1;switch(a.keyCode){case 16:case 17:case 18:case 91:b=
!0;break;default:this._setLinksVisible(!1)}if(229===a.keyCode){if(this._readonly)return a.preventDefault&&a.preventDefault(),!1;b=!0;f.isSafari&&f.isMac&&a.ctrlKey&&(b=!1,a.keyCode=129);b&&this._startIME()}else b||this._commitIME();if((f.isMac||f.isLinux)&&4>f.isFirefox||12.16>f.isOpera)return this._keyDownEvent=a,!0;if(this._doAction(a))return a.preventDefault?(a.preventDefault(),a.stopPropagation()):(a.cancelBubble=!0,a.returnValue=!1,a.keyCode=0),!1}},_handleKeyPress:function(a){if(!this._ignoreEvent(a))if(this._keyDownPrevented)a.preventDefault&&
(a.preventDefault(),a.stopPropagation()),this._keyDownPrevented=void 0;else{if(f.isMac&&f.isWebkit&&(63232<=a.keyCode&&63487>=a.keyCode||13===a.keyCode||8===a.keyCode)||((f.isMac||f.isLinux)&&4>f.isFirefox||12.16>f.isOpera)&&this._doAction(this._keyDownEvent))return a.preventDefault&&a.preventDefault(),!1;var b=f.isMac?a.metaKey:a.ctrlKey;if(void 0!==a.charCode&&b)switch(a.charCode){case 99:case 118:case 120:return!0}if(this.isListening("KeyPress")&&(b=this._createKeyEvent("KeyPress",a),this.onKeyPress(b),
b.defaultPrevented)){a.preventDefault();return}if(this._doAction(a))return a.preventDefault?(a.preventDefault(),a.stopPropagation()):(a.cancelBubble=!0,a.returnValue=!1,a.keyCode=0),!1;b=!1;if(f.isMac){if(a.ctrlKey||a.metaKey)b=!0}else if(f.isFirefox){if(a.ctrlKey||a.altKey)b=!0}else a.ctrlKey^a.altKey&&(b=!0);if(!b&&(b=f.isOpera?a.which:void 0!==a.charCode?a.charCode:a.keyCode,31<b))return this._doContent(String.fromCharCode(b)),a.preventDefault&&a.preventDefault(),!1}},_handleDocKeyUp:function(a){(f.isMac?
a.metaKey:a.ctrlKey)||this._setLinksVisible(!1)},_handleKeyUp:function(a){if(!this._ignoreEvent(a)){if(this.isListening("KeyUp")){var b=this._createKeyEvent("KeyUp",a);this.onKeyUp(b);if(b.defaultPrevented){a.preventDefault();return}}this._handleDocKeyUp(a);13===a.keyCode&&this._commitIME()}},_handleLinkClick:function(a){if(!(f.isMac?a.metaKey:a.ctrlKey))return a.preventDefault&&a.preventDefault(),!1},_handleMouse:function(a){var b=this._getWindow(),e=!0,d=b;if(f.isIE||f.isFirefox&&!this._overlayDiv)d=
this._clientDiv;if(this._overlayDiv){this._hasFocus&&(this._ignoreFocus=!0);var g=this;b.setTimeout(function(){g.focus();g._ignoreFocus=!1},0)}1===this._clickCount?(e=this._setSelectionTo(a.clientX,a.clientY,a.shiftKey,(!f.isOpera||12.16<=f.isOpera)&&this._hasFocus&&this.isListening("DragStart")))&&this._setGrab(d):(this._isW3CEvents&&this._setGrab(d),this._doubleClickSelection=null,this._setSelectionTo(a.clientX,a.clientY,a.shiftKey),this._doubleClickSelection=this._getSelection());return e},_handleMouseDown:function(a){if(!this._ignoreEvent(a)){if(this._linksVisible)if("A"!==
(a.target||a.srcElement).tagName)this._setLinksVisible(!1);else return;this._commitIME();var b=a.which;b||(4===a.button&&(b=2),2===a.button&&(b=3),1===a.button&&(b=1));var e=2!==b&&a.timeStamp?a.timeStamp:(new Date).getTime(),d=e-this._lastMouseTime,g=Math.abs(this._lastMouseX-a.clientX),p=Math.abs(this._lastMouseY-a.clientY),h=this._lastMouseButton===b;this._lastMouseX=a.clientX;this._lastMouseY=a.clientY;this._lastMouseTime=e;this._lastMouseButton=b;1===b&&(this._isMouseDown=!0,h&&d<=this._clickTime&&
g<=this._clickDist&&p<=this._clickDist?this._clickCount++:this._clickCount=1);if(this.isListening("MouseDown")&&(e=this._createMouseEvent("MouseDown",a),this.onMouseDown(e),e.defaultPrevented)){a.preventDefault();return}if(1===b&&this._handleMouse(a)&&(9<=f.isIE||f.isOpera||f.isChrome||f.isSafari||f.isFirefox&&!this._overlayDiv))this._hasFocus||this.focus(),a.preventDefault();f.isFirefox&&3===this._lastMouseButton&&this._updateDOMSelection()}},_handleMouseOver:function(a){if(!this._ignoreEvent(a)&&
!this._animation&&this.isListening("MouseOver"))this.onMouseOver(this._createMouseEvent("MouseOver",a))},_handleMouseOut:function(a){if(!this._ignoreEvent(a)&&!this._animation&&this.isListening("MouseOut"))this.onMouseOut(this._createMouseEvent("MouseOut",a))},_handleMouseMove:function(a){if(!this._animation){var b=this._isClientDiv(a);if(this.isListening("MouseMove")&&b)this.onMouseMove(this._createMouseEvent("MouseMove",a));if(!this._dropTarget){var e=this._linksVisible||this._lastMouseMoveX!==
a.clientX||this._lastMouseMoveY!==a.clientY;this._lastMouseMoveX=a.clientX;this._lastMouseMoveY=a.clientY;this._setLinksVisible(e&&!this._isMouseDown&&(f.isMac?a.metaKey:a.ctrlKey));this._checkOverlayScroll();if(!this._isW3CEvents){if(0===a.button)return this._setGrab(null),!0;if(!this._isMouseDown&&1===a.button&&0!==(this._clickCount&1)&&b)return this._clickCount=2,this._handleMouse(a,this._clickCount)}if(this._isMouseDown&&-1===this._dragOffset){b=a.clientX;a=a.clientY;var d=this._getViewPadding(),
g=this._viewDiv.getBoundingClientRect(),p=this._getClientWidth(),h=this._getClientHeight(),e=g.left+d.left,k=g.top+d.top,p=g.left+d.left+p,d=g.top+d.top+h;a<k?this._doAutoScroll("up",b,a-k):a>d?this._doAutoScroll("down",b,a-d):b<e&&!this._wrapMode?this._doAutoScroll("left",b-e,a):b>p&&!this._wrapMode?this._doAutoScroll("right",b-p,a):(this._endAutoScroll(),this._setSelectionTo(b,a,!0))}}}},_isClientDiv:function(a){var b=this._overlayDiv||this._clientDiv;for(a=a.target?a.target:a.srcElement;a;){if(b===
a)return!0;a=a.parentNode}return!1},_createKeyEvent:function(a,b){return{type:a,event:b,preventDefault:function(){this.defaultPrevented=!0}}},_createMouseEvent:function(a,b){var e=this.convert({x:b.clientX,y:b.clientY},"page","document");return{type:a,event:b,clickCount:this._clickCount,x:e.x,y:e.y,preventDefault:function(){this.defaultPrevented=!0}}},_handleMouseUp:function(a){var b=a.which?0===a.button:1===a.button;if(this.isListening("MouseUp")&&(this._isClientDiv(a)||b&&this._isMouseDown))this.onMouseUp(this._createMouseEvent("MouseUp",
a));if(!this._linksVisible){if(b&&this._isMouseDown){if(-1!==this._dragOffset){var e=this._getSelection();e.extend(this._dragOffset);e.collapse();this._setSelection(e,!0,!0);this._dragOffset=-1}this._isMouseDown=!1;this._endAutoScroll();this._isW3CEvents&&this._setGrab(null)}b&&f.isFirefox&&(this._updateDOMSelection(),a.preventDefault())}},_handleMouseWheel:function(a){var b=this._getLineHeight(),e=0,d=0;f.isIE||f.isOpera?d=-a.wheelDelta/40*b:f.isFirefox?"wheel"===a.type?a.deltaMode?(e=Math.max(-256,
Math.min(256,a.deltaX))*b,d=Math.max(-256,Math.min(256,a.deltaY))*b):(e=a.deltaX,d=a.deltaY):(b=f.isMac?3*a.detail:Math.max(-256,Math.min(256,a.detail))*b,a.axis===a.HORIZONTAL_AXIS?e=b:d=b):f.isMac?(d=a.timeStamp-this._wheelTimeStamp,this._wheelTimeStamp=a.timeStamp,e=0!==a.wheelDeltaX%120?1:40>d?40/(40-d):40,d=0!==a.wheelDeltaY%120?1:40>d?40/(40-d):40,e=Math.ceil(-a.wheelDeltaX/e),-1<e&&0>e&&(e=-1),0<e&&1>e&&(e=1),d=Math.ceil(-a.wheelDeltaY/d),-1<d&&0>d&&(d=-1),0<d&&1>d&&(d=1)):(e=-a.wheelDeltaX,
d=8*(-a.wheelDeltaY/120)*b);if(f.isSafari||f.isChrome&&f.isMac){for(b=a.target;b&&void 0===b.lineIndex;)b=b.parentNode;this._mouseWheelLine=b}b=this._getScroll();this._scrollView(e,d);e=this._getScroll();if(b.x!==e.x||b.y!==e.y)return a.preventDefault&&a.preventDefault(),!1},_handlePaste:function(a){this._cancelCheckSelection();if(!this._ignoreEvent(a)&&!this._ignorePaste&&this._doPaste(a)){if(f.isIE){var b=this;this._ignoreFocus=!0;this._getWindow().setTimeout(function(){b._updateDOMSelection();
b._ignoreFocus=!1},0)}a.preventDefault&&a.preventDefault();return!1}},_handleResize:function(a){a=this._rootDiv.clientWidth;var e=this._rootDiv.clientHeight;if(this._rootWidth!==a||this._rootHeight!==e)this._rootWidth!==a&&this._wrapMode&&this._resetLineHeight(),this._rootWidth=a,this._rootHeight=e,a=9>f.isIE,e=this._calculateMetrics(),b(e,this._metrics)||(this._variableLineHeight&&(this._variableLineHeight=!1,this._resetLineHeight()),this._metrics=e,a=!0),a?this._queueUpdate():this._update()},_handleRulerEvent:function(a){for(var b=
a.target?a.target:a.srcElement,e=b.lineIndex;b&&!b._ruler;)void 0===e&&void 0!==b.lineIndex&&(e=b.lineIndex),b=b.parentNode;var d=b?b._ruler:null;if(void 0===e&&d&&"document"===d.getOverview()){var e=this._getClientHeight(),f=this._model.getLineCount(),g=this._getViewPadding(),p=this._viewDiv.getBoundingClientRect(),e=Math.floor((a.clientY-p.top-this._metrics.scrollWidth)*f/(e+g.top+g.bottom-2*this._metrics.scrollWidth));0<=e&&e<f||(e=void 0)}if(d)switch(a.type){case "click":if(d.onClick)d.onClick(e,
a);break;case "dblclick":if(d.onDblClick)d.onDblClick(e,a);break;case "mousemove":if(d.onMouseMove)d.onMouseMove(e,a);break;case "mouseover":if(d.onMouseOver)d.onMouseOver(e,a);break;case "mouseout":if(d.onMouseOut){for(f=a.relatedTarget;f&&f!==this._rootDiv;){if(f===b)return;f=f.parentNode}d.onMouseOut(e,a)}}},_handleScroll:function(){this._lastScrollTime=(new Date).getTime();var a=this._getScroll(!1),b=this._hScroll,e=this._vScroll;if(b!==a.x||e!==a.y)this._hScroll=a.x,this._vScroll=a.y,this._commitIME(),
this._update(e===a.y),this.onScroll({type:"Scroll",oldValue:{x:b,y:e},newValue:a})},_handleSelectStart:function(a){var b=this._contextMenuOpen;this._contextMenuOpen=!1;if(b)this._checkSelectionChange=!0;else if(this._ignoreSelect)return a&&a.preventDefault&&a.preventDefault(),!1},_getModelOffset:function(a,b){if(a){var e;e="DIV"===a.tagName?a:a.parentNode.parentNode;return!e._line?0:e._line.getModelOffset(a,b)}},_updateSelectionFromDOM:function(){if(!f.isIOS&&!f.isAndroid&&!this._checkSelectionChange)return!1;
var a=this._getWindow().getSelection(),b=this._getModelOffset(a.anchorNode,a.anchorOffset),e=this._getModelOffset(a.focusNode,a.focusOffset),d=this._getSelection();if(void 0===b||void 0===e||d.start===b&&d.end===e)return!1;if(this._checkSelectionChange){var d=this._getLineNext(),g=this._getLinePrevious();if(a.anchorNode===d.firstChild.firstChild&&0===a.anchorOffset&&a.focusNode===g.firstChild.firstChild&&0===a.focusOffset)return!1;if(a.anchorNode===d.firstChild.firstChild&&0===a.anchorOffset&&a.focusNode===
g.lastChild.firstChild||a.anchorNode===this._clientDiv&&a.focusNode===this._clientDiv)b=0,e=this.getModel().getCharCount()}this._setSelection(new w(b,e),!1,!1);this._checkSelectionChange=!1;return!0},_cancelCheckSelection:function(){this._checkSelectionChange&&(this._checkSelectionChange=!1,this._cancelPollSelectionChange())},_cancelPollSelectionChange:function(){this._selPollTimer&&(this._getWindow().clearTimeout(this._selPollTimer),this._selPollTimer=null)},_pollSelectionChange:function(a){var b=
this,e=this._getWindow();this._cancelPollSelectionChange();this._selPollTimer=e.setTimeout(function(){b._selPollTimer=null;b._clientDiv&&!b._updateSelectionFromDOM()&&a&&b._pollSelectionChange(a)},100)},_handleSelectionChange:function(a){-1===this._imeOffset&&(f.isAndroid?this._pollSelectionChange():this._updateSelectionFromDOM())},_handleTextInput:function(a){if(!this._ignoreEvent(a)){this._imeOffset=-1;var b=this._getWindow().getSelection();if(b.anchorNode!==this._anchorNode||b.focusNode!==this._focusNode||
b.anchorOffset!==this._anchorOffset||b.focusOffset!==this._focusOffset){for(var e=b.anchorNode;e&&void 0===e.lineIndex;)e=e.parentNode;if(e){var d=this._model,g=e.lineIndex,p=d.getLine(g),h=p,k=0,d=d.getLineStart(g);0<b.rangeCount&&(b.getRangeAt(0).deleteContents(),g=e.ownerDocument.createTextNode(a.data),b.getRangeAt(0).insertNode(g),k=this._getDOMText(e,g),h=k.text,k=k.offset,g.parentNode.removeChild(g));e.lineRemoved=!0;for(e=0;p.charCodeAt(e)===h.charCodeAt(e)&&e<k;)e++;b=p.length-1;for(g=h.length-
p.length;p.charCodeAt(b)===h.charCodeAt(b+g)&&b+g>=k+a.data.length;)b--;b++;p=h.substring(e,b+g);this._ignoreQueueUpdate=f.isSafari;this._modifyContent({text:p,start:e+d,end:b+d,_ignoreDOMSelection:!0,_ignoreDOMSelection1:f.isChrome},!0);this._ignoreQueueUpdate=!1}}else this._doContent(a.data);a.preventDefault()}},_handleTouchStart:function(a){this._commitIME();var b=this._getWindow();this._touchScrollTimer&&(this._vScrollDiv.style.display="none",this._hScrollDiv.style.display="none",b.clearInterval(this._touchScrollTimer),
this._touchScrollTimer=null);var e=a.touches;if(1===e.length){var e=e[0],d=e.clientX,g=e.clientY;this._touchStartX=d;this._touchStartY=g;if(f.isAndroid&&(g<e.pageY-b.pageYOffset||d<e.pageX-b.pageXOffset))d=e.pageX-b.pageXOffset,g=e.pageY-b.pageYOffset;b=this.convert({x:d,y:g},"page","document");this._lastTouchOffset=this.getOffsetAtLocation(b.x,b.y);this._touchStartTime=a.timeStamp;this._touching=!0}},_handleTouchMove:function(a){var b=a.touches;if(1===b.length){b=b[0];this._touchCurrentX=b.clientX;
this._touchCurrentY=b.clientY;if(!this._touchScrollTimer&&200>a.timeStamp-this._touchStartTime){this._vScrollDiv.style.display="block";this._wrapMode||(this._hScrollDiv.style.display="block");var e=this,d=this._getWindow();this._touchScrollTimer=d.setInterval(function(){var a=0,b=0;if(e._touching)a=e._touchStartX-e._touchCurrentX,b=e._touchStartY-e._touchCurrentY,e._touchSpeedX=a/10,e._touchSpeedY=b/10,e._touchStartX=e._touchCurrentX,e._touchStartY=e._touchCurrentY;else{if(0.1>Math.abs(e._touchSpeedX)&&
0.1>Math.abs(e._touchSpeedY)){e._vScrollDiv.style.display="none";e._hScrollDiv.style.display="none";d.clearInterval(e._touchScrollTimer);e._touchScrollTimer=null;return}a=10*e._touchSpeedX;b=10*e._touchSpeedY;e._touchSpeedX*=0.95;e._touchSpeedY*=0.95}e._scrollView(a,b)},10)}this._touchScrollTimer&&a.preventDefault()}},_handleTouchEnd:function(a){0===a.touches.length&&(this._touching=!1)},_doAction:function(a){var b,e,d=this._keyModes;for(e=d.length-1;0<=e;e--)if(b=d[e],"function"===typeof b.match&&
(b=b.match(a),void 0!==b))return this.invokeAction(b);return!1},_doMove:function(a,b){var e=this._model,d=b.getCaret(),f=e.getLineAtOffset(d);a.count||(a.count=1);for(;0!==a.count;){var g=e.getLineStart(f);if(0>a.count&&d===g)if(0<f)"character"===a.unit&&a.count++,f--,b.extend(e.getLineEnd(f));else break;else if(0<a.count&&d===e.getLineEnd(f))if(f+1<e.getLineCount())"character"===a.unit&&a.count--,f++,b.extend(e.getLineStart(f));else break;else{var p=!1;a.expandTab&&("character"===a.unit&&0===(d-
g)%this._tabSize)&&(g=e.getText(g,d),p=!/[^ ]/.test(g));p?(b.extend(d-this._tabSize),a.count+=0>a.count?1:-1):(g=this._getLine(f),b.extend(g.getNextOffset(d,a)),g.destroy())}d=b.getCaret()}return b},_doBackspace:function(a){var b=this._getSelection();b.isEmpty()&&(a.count||(a.count=1),a.count*=-1,a.expandTab=this._expandTab,this._doMove(a,b));this._modifyContent({text:"",start:b.start,end:b.end},!0);return!0},_doCase:function(a){var b=this._getSelection();this._doMove(a,b);var e=this.getText(b.start,
b.end);this._setSelection(b,!0);switch(a.type){case "lower":e=e.toLowerCase();break;case "capitalize":e=e.replace(/(?:^|\s)\S/g,function(a){return a.toUpperCase()});break;case "reverse":a="";for(b=0;b<e.length;b++){var d=e[b],f=d.toLowerCase(),d=f!==d?f:d.toUpperCase();a+=d}e=a;break;default:e=e.toUpperCase()}this._doContent(e);return!0},_doContent:function(a){var b=this._getSelection();if(this._overwriteMode&&b.isEmpty()){var e=this._model,d=e.getLineAtOffset(b.end);b.end<e.getLineEnd(d)&&(e=this._getLine(d),
b.extend(e.getNextOffset(b.getCaret(),{unit:"character",count:1})),e.destroy())}return this._modifyContent({text:a,start:b.start,end:b.end,_ignoreDOMSelection:!0},!0)},_doCopy:function(a){var b=this._getSelection();return!b.isEmpty()?(b=this._getBaseText(b.start,b.end),this._setClipboardText(b,a)):!0},_doCursorNext:function(a){var b=this._getSelection();!b.isEmpty()&&!a.select?b.start=b.end:this._doMove(a,b);a.select||b.collapse();this._setSelection(b,!0);return!0},_doCursorPrevious:function(a){var b=
this._getSelection();!b.isEmpty()&&!a.select?b.end=b.start:(a.count||(a.count=1),a.count*=-1,this._doMove(a,b));a.select||b.collapse();this._setSelection(b,!0);return!0},_doCut:function(a){var b=this._getSelection();return!b.isEmpty()?(b=this._getBaseText(b.start,b.end),this._doContent(""),this._setClipboardText(b,a)):!0},_doDelete:function(a){var b=this._getSelection();b.isEmpty()&&this._doMove(a,b);this._modifyContent({text:"",start:b.start,end:b.end},!0);return!0},_doEnd:function(a){var b=this._getSelection(),
e=this._model,d;if(a.ctrl)b.extend(e.getCharCount()),d=function(){};else{var f=b.getCaret(),g=e.getLineAtOffset(f);if(this._wrapMode){var p=this._getLine(g),f=p.getLineIndex(f),f=f===p.getLineCount()-1?e.getLineEnd(g):p.getLineStart(f+1)-1;p.destroy()}else a.count&&0<a.count&&(g=Math.min(g+a.count-1,e.getLineCount()-1)),f=e.getLineEnd(g);b.extend(f)}a.select||b.collapse();this._setSelection(b,!0,!0,d);return!0},_doEnter:function(a){var b=this._model,e=this._getSelection();this._doContent(b.getLineDelimiter());
a&&a.noCursor&&(e.end=e.start,this._setSelection(e,!0));return!0},_doHome:function(a){var b=this._getSelection(),e=this._model,d;if(a.ctrl)b.extend(0),d=function(){};else{var f=b.getCaret(),g=e.getLineAtOffset(f);this._wrapMode?(e=this._getLine(g),f=e.getLineIndex(f),f=e.getLineStart(f),e.destroy()):f=e.getLineStart(g);b.extend(f)}a.select||b.collapse();this._setSelection(b,!0,!0,d);return!0},_doLineDown:function(a){var b=this._model,e=this._getSelection(),d=e.getCaret(),g=b.getLineAtOffset(d),p=
this._getLine(g),h=this._columnX,k=1,l=!1;if(-1===h||a.wholeLine||a.select&&f.isIE)h=a.wholeLine?b.getLineEnd(g+1):d,h=p.getBoundingClientRect(h).left;(d=p.getLineIndex(d))<p.getLineCount()-1?k=p.getClientRects(d+1).top+1:(d=b.getLineCount()-1,l=g===d,a.count&&0<a.count?g=Math.min(g+a.count,d):g++);d=!1;if(l){if(a.select||f.isMac||f.isLinux)e.extend(b.getCharCount()),d=!0}else p.lineIndex!==g&&(p.destroy(),p=this._getLine(g)),e.extend(p.getOffset(h,k)),d=!0;d&&(a.select||e.collapse(),this._setSelection(e,
!0,!0));this._columnX=h;p.destroy();return!0},_doLineUp:function(a){var b=this._model,e=this._getSelection(),d=e.getCaret(),g=b.getLineAtOffset(d),p=this._getLine(g),h=this._columnX,k=!1,l;if(-1===h||a.wholeLine||a.select&&f.isIE)h=a.wholeLine?b.getLineStart(g-1):d,h=p.getBoundingClientRect(h).left;0<(d=p.getLineIndex(d))?l=p.getClientRects(d-1).top+1:(k=0===g,k||(a.count&&0<a.count?g=Math.max(g-a.count,0):g--,l=this._getLineHeight(g)-1));d=!1;if(k){if(a.select||f.isMac||f.isLinux)e.extend(0),d=!0}else p.lineIndex!==
g&&(p.destroy(),p=this._getLine(g)),e.extend(p.getOffset(h,l)),d=!0;d&&(a.select||e.collapse(),this._setSelection(e,!0,!0));this._columnX=h;p.destroy();return!0},_doNoop:function(){return!0},_doPageDown:function(a){var b=this,e=this._model,d=this._getSelection(),g=d.getCaret(),p=e.getLineAtOffset(g),h=e.getLineCount(),k=this._getScroll(),e=this._getClientHeight(),l,q;if(this._lineHeight){l=this._columnX;k=this._getBoundsAtOffset(g);if(-1===l||a.select&&f.isIE)l=k.left;g=this._getLineIndex(k.top+e);
q=this._getLine(g);p=this._getLinePixel(g);g=q.getOffset(l,k.top+e-p);e=q.getBoundingClientRect(g);q.destroy();d.extend(g);a.select||d.collapse();this._setSelection(d,!0,!0,function(){b._columnX=l},e.top+p-k.top);return!0}if(p<h-1){var s=this._getLineHeight(),m=Math.min(h-p-1,Math.floor(e/s)),m=Math.max(1,m);l=this._columnX;if(-1===l||a.select&&f.isIE)q=this._getLine(p),l=q.getBoundingClientRect(g).left,q.destroy();q=this._getLine(p+m);d.extend(q.getOffset(l,0));q.destroy();a.select||d.collapse();
a=h*s;g=k.y+m*s;g+e>a&&(g=a-e);this._setSelection(d,!0,!0,function(){b._columnX=l},g-k.y)}return!0},_doPageUp:function(a){var b=this,e=this._model,d=this._getSelection(),g=d.getCaret(),p=e.getLineAtOffset(g),h=this._getScroll(),k=this._getClientHeight(),l;if(this._lineHeight){l=this._columnX;h=this._getBoundsAtOffset(g);if(-1===l||a.select&&f.isIE)l=h.left;g=this._getLineIndex(h.bottom-k);e=this._getLine(g);p=this._getLinePixel(g);g=e.getOffset(l,h.bottom-k-p);k=e.getBoundingClientRect(g);e.destroy();
d.extend(g);a.select||d.collapse();this._setSelection(d,!0,!0,function(){b._columnX=l},k.top+p-h.top);return!0}if(0<p){var q=this._getLineHeight(),k=Math.max(1,Math.min(p,Math.floor(k/q)));l=this._columnX;if(-1===l||a.select&&f.isIE)e=this._getLine(p),l=e.getBoundingClientRect(g).left,e.destroy();e=this._getLine(p-k);d.extend(e.getOffset(l,this._getLineHeight(p-k)-1));e.destroy();a.select||d.collapse();a=Math.max(0,h.y-k*q);this._setSelection(d,!0,!0,function(){b._columnX=l},a-h.y)}return!0},_doPaste:function(a){var b=
this;return null!==this._getClipboardText(a,function(a){a&&(f.isLinux&&2===b._lastMouseButton&&(new Date).getTime()-b._lastMouseTime<=b._clickTime&&b._setSelectionTo(b._lastMouseX,b._lastMouseY),b._doContent(a))})},_doScroll:function(a){var b=a.type,e=this._model,d=e.getLineCount();a=this._getClientHeight();var f=this._getLineHeight(),d=d*f,g=this._getScroll().y,p;switch(b){case "textStart":p=0;break;case "textEnd":p=d-a;break;case "pageDown":p=g+a;break;case "pageUp":p=g-a;break;case "lineDown":p=
g+f;break;case "lineUp":p=g-f;break;case "centerLine":b=this._getSelection(),p=e.getLineAtOffset(b.start),e=(e.getLineAtOffset(b.end)-p+1)*f,p=p*f-a/2+e/2}void 0!==p&&(p=Math.min(Math.max(0,p),d-a),this._scrollViewAnimated(0,p-g,function(){}));return!0},_doSelectAll:function(a){a=this._model;var b=this._getSelection();b.setCaret(0);b.extend(a.getCharCount());this._setSelection(b,!1);return!0},_doTab:function(a){if(this._tabMode&&!this._readonly){a="\t";if(this._expandTab){var b=this._model;a=this._getSelection().getCaret();
var e=b.getLineAtOffset(a),b=b.getLineStart(e);a=Array(this._tabSize-(a-b)%this._tabSize+1).join(" ")}this._doContent(a);return!0}},_doShiftTab:function(a){if(this._tabMode&&!this._readonly)return!0},_doOverwriteMode:function(a){if(!this._readonly)return this.setOptions({overwriteMode:!this.getOptions("overwriteMode")}),!0},_doTabMode:function(a){this._tabMode=!this._tabMode;return!0},_doWrapMode:function(a){this.setOptions({wrapMode:!this.getOptions("wrapMode")});return!0},_autoScroll:function(){var a=
this._model,b=this._getSelection(),e=this.convert({x:this._autoScrollX,y:this._autoScrollY},"page","document"),d=b.getCaret(),g=a.getLineCount(),p=a.getLineAtOffset(d),h;if("up"===this._autoScrollDir||"down"===this._autoScrollDir)d=this._autoScrollY/this._getLineHeight(),d=0>d?Math.floor(d):Math.ceil(d),h=Math.max(0,Math.min(g-1,p+d));else if("left"===this._autoScrollDir||"right"===this._autoScrollDir)h=this._getLineIndex(e.y),p=this._getLine(p),e.x+=p.getBoundingClientRect(d,!1).left,p.destroy();
0===h&&(f.isMac||f.isLinux)?b.extend(0):h===g-1&&(f.isMac||f.isLinux)?b.extend(a.getCharCount()):(p=this._getLine(h),b.extend(p.getOffset(e.x,e.y-this._getLinePixel(h))),p.destroy());this._setSelection(b,!0)},_autoScrollTimer:function(){this._autoScroll();var a=this;this._autoScrollTimerID=this._getWindow().setTimeout(function(){a._autoScrollTimer()},this._AUTO_SCROLL_RATE)},_calculateLineHeightTimer:function(a){if(this._lineHeight&&!this._calculateLHTimer){var b=this._model.getLineCount(),e=0;if(a){a=
0;for(var d=(new Date).getTime(),f=0;e<b&&!(this._lineHeight[e]||(a++,f||(f=e),this._lineHeight[e]=this._calculateLineHeight(e)),e++,100<(new Date).getTime()-d););this.redrawRulers(0,b);this._queueUpdate()}a=this._getWindow();if(e!==b){var g=this;this._calculateLHTimer=a.setTimeout(function(){g._calculateLHTimer=null;g._calculateLineHeightTimer(!0)},0)}else this._calculateLHTimer&&(a.clearTimeout(this._calculateLHTimer),this._calculateLHTimer=void 0)}},_calculateLineHeight:function(a){a=this._getLine(a);
var b=a.getBoundingClientRect();a.destroy();return Math.max(1,b.bottom-b.top)},_calculateMetrics:function(){var a=this._clientDiv,b=a.ownerDocument,e=f.createElement(b,"div");e.style.lineHeight="normal";var g={type:"LineStyle",textView:this,0:0,lineText:this._model.getLine(0),lineStart:0};this.onLineStyle(g);d(g.style,e);e.style.position="fixed";e.style.left="-1000px";var p=f.createElement(b,"span");p.appendChild(b.createTextNode(" "));e.appendChild(p);var h=f.createElement(b,"span");h.style.fontStyle=
"italic";h.appendChild(b.createTextNode(" "));e.appendChild(h);var k=f.createElement(b,"span");k.style.fontWeight="bold";k.appendChild(b.createTextNode(" "));e.appendChild(k);g=f.createElement(b,"span");g.style.fontWeight="bold";g.style.fontStyle="italic";g.appendChild(b.createTextNode(" "));e.appendChild(g);a.appendChild(e);var l=e.getBoundingClientRect(),p=p.getBoundingClientRect(),h=h.getBoundingClientRect(),k=k.getBoundingClientRect(),g=g.getBoundingClientRect(),p=p.bottom-p.top,h=h.bottom-h.top,
k=k.bottom-k.top,m=g.bottom-g.top,u=0,g=0>=l.bottom-l.top,l=Math.max(1,l.bottom-l.top);h>p&&(u=1);k>h&&(u=2);m>k&&(u=3);var n;0!==u&&(n={style:{}},0!==(u&1)&&(n.style.fontStyle="italic"),0!==(u&2)&&(n.style.fontWeight="bold"));p=s(e);a.removeChild(e);m=q(this._viewDiv);e=f.createElement(b,"div");e.style.position="fixed";e.style.left="-1000px";e.style.paddingLeft=m.left+"px";e.style.paddingTop=m.top+"px";e.style.paddingRight=m.right+"px";e.style.paddingBottom=m.bottom+"px";e.style.width="100px";e.style.height=
"100px";m=f.createElement(b,"div");m.style.width="100%";m.style.height="100%";e.appendChild(m);a.appendChild(e);u=e.getBoundingClientRect();h=m.getBoundingClientRect();k=0;this._singleMode||(e.style.overflow="hidden",m.style.height="200px",k=e.clientWidth,e.style.overflow="scroll",k-=e.clientWidth);a.removeChild(e);m={left:h.left-u.left,top:h.top-u.top,right:u.right-h.right,bottom:u.bottom-h.bottom};h=u=0;if(!g&&(this._wrapOffset||this._marginOffset))e=f.createElement(b,"div"),e.style.position="fixed",
e.style.left="-1000px",e.innerHTML=Array(this._wrapOffset+1+(f.isWebkit?0:1)).join(" "),a.appendChild(e),u=e.getBoundingClientRect(),u=Math.ceil(u.right-u.left),e.innerHTML=Array(this._marginOffset+1).join(" "),h=e.getBoundingClientRect(),h=Math.ceil(h.right-h.left),a.removeChild(e);return{lineHeight:l,largestFontStyle:n,lineTrim:p,viewPadding:m,scrollWidth:k,wrapWidth:u,marginWidth:h,invalid:g}},_cancelAnimation:function(){this._animation&&(this._animation.stop(),this._animation=null)},_clearSelection:function(a){var b=
this._getSelection();if(b.isEmpty())return!1;"next"===a?b.start=b.end:b.end=b.start;this._setSelection(b,!0);return!0},_commitIME:function(a){if(-1!==this._imeOffset){var b=this._model,e=b.getLineAtOffset(this._imeOffset),d=b.getLineStart(e),g=this._getLineNode(e);if(!a){this._scrollDiv.focus();this._clientDiv.focus();var p=this._getDOMText(g).text,b=b.getLine(e),d=this._imeOffset-d,b=d+p.length-b.length;d!==b&&(a=p.substring(d,b))}a&&(!this._doContent(a)&&!f.isWebkit)&&(g.lineRemoved=!0,this._queueUpdate());
this._imeOffset=-1}},_createActions:function(){this.addKeyMode(new m.DefaultKeyMode(this));var a=this;this._actions={noop:{defaultHandler:function(){return a._doNoop()}},lineUp:{defaultHandler:function(b){return a._doLineUp(e(b,{select:!1}))},actionDescription:{name:l.lineUp}},lineDown:{defaultHandler:function(b){return a._doLineDown(e(b,{select:!1}))},actionDescription:{name:l.lineDown}},lineStart:{defaultHandler:function(b){return a._doHome(e(b,{select:!1,ctrl:!1}))},actionDescription:{name:l.lineStart}},
lineEnd:{defaultHandler:function(b){return a._doEnd(e(b,{select:!1,ctrl:!1}))},actionDescription:{name:l.lineEnd}},charPrevious:{defaultHandler:function(b){return a._doCursorPrevious(e(b,{select:!1,unit:"character"}))},actionDescription:{name:l.charPrevious}},charNext:{defaultHandler:function(b){return a._doCursorNext(e(b,{select:!1,unit:"character"}))},actionDescription:{name:l.charNext}},pageUp:{defaultHandler:function(b){return a._doPageUp(e(b,{select:!1}))},actionDescription:{name:l.pageUp}},
pageDown:{defaultHandler:function(b){return a._doPageDown(e(b,{select:!1}))},actionDescription:{name:l.pageDown}},scrollPageUp:{defaultHandler:function(b){return a._doScroll(e(b,{type:"pageUp"}))},actionDescription:{name:l.scrollPageUp}},scrollPageDown:{defaultHandler:function(b){return a._doScroll(e(b,{type:"pageDown"}))},actionDescription:{name:l.scrollPageDown}},scrollLineUp:{defaultHandler:function(b){return a._doScroll(e(b,{type:"lineUp"}))},actionDescription:{name:l.scrollLineUp}},scrollLineDown:{defaultHandler:function(b){return a._doScroll(e(b,
{type:"lineDown"}))},actionDescription:{name:l.scrollLineDown}},wordPrevious:{defaultHandler:function(b){return a._doCursorPrevious(e(b,{select:!1,unit:"word"}))},actionDescription:{name:l.wordPrevious}},wordNext:{defaultHandler:function(b){return a._doCursorNext(e(b,{select:!1,unit:"word"}))},actionDescription:{name:l.wordNext}},textStart:{defaultHandler:function(b){return a._doHome(e(b,{select:!1,ctrl:!0}))},actionDescription:{name:l.textStart}},textEnd:{defaultHandler:function(b){return a._doEnd(e(b,
{select:!1,ctrl:!0}))},actionDescription:{name:l.textEnd}},scrollTextStart:{defaultHandler:function(b){return a._doScroll(e(b,{type:"textStart"}))},actionDescription:{name:l.scrollTextStart}},scrollTextEnd:{defaultHandler:function(b){return a._doScroll(e(b,{type:"textEnd"}))},actionDescription:{name:l.scrollTextEnd}},centerLine:{defaultHandler:function(b){return a._doScroll(e(b,{type:"centerLine"}))},actionDescription:{name:l.centerLine}},selectLineUp:{defaultHandler:function(b){return a._doLineUp(e(b,
{select:!0}))},actionDescription:{name:l.selectLineUp}},selectLineDown:{defaultHandler:function(b){return a._doLineDown(e(b,{select:!0}))},actionDescription:{name:l.selectLineDown}},selectWholeLineUp:{defaultHandler:function(b){return a._doLineUp(e(b,{select:!0,wholeLine:!0}))},actionDescription:{name:l.selectWholeLineUp}},selectWholeLineDown:{defaultHandler:function(b){return a._doLineDown(e(b,{select:!0,wholeLine:!0}))},actionDescription:{name:l.selectWholeLineDown}},selectLineStart:{defaultHandler:function(b){return a._doHome(e(b,
{select:!0,ctrl:!1}))},actionDescription:{name:l.selectLineStart}},selectLineEnd:{defaultHandler:function(b){return a._doEnd(e(b,{select:!0,ctrl:!1}))},actionDescription:{name:l.selectLineEnd}},selectCharPrevious:{defaultHandler:function(b){return a._doCursorPrevious(e(b,{select:!0,unit:"character"}))},actionDescription:{name:l.selectCharPrevious}},selectCharNext:{defaultHandler:function(b){return a._doCursorNext(e(b,{select:!0,unit:"character"}))},actionDescription:{name:l.selectCharNext}},selectPageUp:{defaultHandler:function(b){return a._doPageUp(e(b,
{select:!0}))},actionDescription:{name:l.selectPageUp}},selectPageDown:{defaultHandler:function(b){return a._doPageDown(e(b,{select:!0}))},actionDescription:{name:l.selectPageDown}},selectWordPrevious:{defaultHandler:function(b){return a._doCursorPrevious(e(b,{select:!0,unit:"word"}))},actionDescription:{name:l.selectWordPrevious}},selectWordNext:{defaultHandler:function(b){return a._doCursorNext(e(b,{select:!0,unit:"word"}))},actionDescription:{name:l.selectWordNext}},selectTextStart:{defaultHandler:function(b){return a._doHome(e(b,
{select:!0,ctrl:!0}))},actionDescription:{name:l.selectTextStart}},selectTextEnd:{defaultHandler:function(b){return a._doEnd(e(b,{select:!0,ctrl:!0}))},actionDescription:{name:l.selectTextEnd}},deletePrevious:{defaultHandler:function(b){return a._doBackspace(e(b,{unit:"character"}))},actionDescription:{name:l.deletePrevious}},deleteNext:{defaultHandler:function(b){return a._doDelete(e(b,{unit:"character"}))},actionDescription:{name:l.deleteNext}},deleteWordPrevious:{defaultHandler:function(b){return a._doBackspace(e(b,
{unit:"word"}))},actionDescription:{name:l.deleteWordPrevious}},deleteWordNext:{defaultHandler:function(b){return a._doDelete(e(b,{unit:"word"}))},actionDescription:{name:l.deleteWordNext}},deleteLineStart:{defaultHandler:function(b){return a._doBackspace(e(b,{unit:"line"}))},actionDescription:{name:l.deleteLineStart}},deleteLineEnd:{defaultHandler:function(b){return a._doDelete(e(b,{unit:"line"}))},actionDescription:{name:l.deleteLineEnd}},tab:{defaultHandler:function(b){return a._doTab()},actionDescription:{name:l.tab}},
shiftTab:{defaultHandler:function(b){return a._doShiftTab()},actionDescription:{name:l.shiftTab}},enter:{defaultHandler:function(b){return a._doEnter()},actionDescription:{name:l.enter}},enterNoCursor:{defaultHandler:function(b){return a._doEnter(e(b,{noCursor:!0}))},actionDescription:{name:l.enterNoCursor}},selectAll:{defaultHandler:function(b){return a._doSelectAll()},actionDescription:{name:l.selectAll}},copy:{defaultHandler:function(b){return a._doCopy()},actionDescription:{name:l.copy}},cut:{defaultHandler:function(b){return a._doCut()},
actionDescription:{name:l.cut}},paste:{defaultHandler:function(b){return a._doPaste()},actionDescription:{name:l.paste}},uppercase:{defaultHandler:function(b){return a._doCase(e(b,{type:"upper"}))},actionDescription:{name:l.uppercase}},lowercase:{defaultHandler:function(b){return a._doCase(e(b,{type:"lower"}))},actionDescription:{name:l.lowercase}},capitalize:{defaultHandler:function(b){return a._doCase(e(b,{unit:"word",type:"capitalize"}))},actionDescription:{name:l.capitalize}},reversecase:{defaultHandler:function(b){return a._doCase(e(b,
{type:"reverse"}))},actionDescription:{name:l.reversecase}},toggleOverwriteMode:{defaultHandler:function(b){return a._doOverwriteMode()},actionDescription:{name:l.toggleOverwriteMode}},toggleTabMode:{defaultHandler:function(b){return a._doTabMode()},actionDescription:{name:l.toggleTabMode}},toggleWrapMode:{defaultHandler:function(b){return a._doWrapMode()},actionDescription:{name:l.toggleWrapMode}}}},_createRulerParent:function(a,b){var e=f.createElement(a,"div");e.className=b;e.tabIndex=-1;e.style.overflow=
"hidden";e.style.MozUserSelect="none";e.style.WebkitUserSelect="none";e.style.position="absolute";e.style.top="0px";e.style.bottom="0px";e.style.cursor="default";e.style.display="none";e.setAttribute("aria-hidden","true");this._rootDiv.appendChild(e);return e},_createRuler:function(a,b){if(this._clientDiv){var e=this._getRulerParent(a);if(e){if(e!==this._marginDiv||this._marginOffset)e.style.display="block";var d=f.createElement(e.ownerDocument,"div");d._ruler=a;d.rulerChanged=!0;d.style.position=
"relative";d.style.cssFloat="left";d.style.styleFloat="left";d.style.outline="none";if(void 0===b||0>b||b>=e.children.length)e.appendChild(d);else{for(var g=e.firstChild;g&&0<b--;)g=g.nextSibling;e.insertBefore(d,g)}}}},_createView:function(){function a(){p._rootDiv&&(p.update(!0),p._metrics.invalid&&p._getWindow().setTimeout(function(){a()},100))}if(!this._clientDiv){for(var b=this._parent;b.hasChildNodes();)b.removeChild(b.lastChild);var e=b.ownerDocument,d=f.createElement(e,"div");this._rootDiv=
d;d.tabIndex=-1;d.style.position="relative";d.style.overflow="hidden";d.style.width="100%";d.style.height="100%";d.style.overflow="hidden";d.style.WebkitTextSizeAdjust="100%";d.setAttribute("role","application");b.appendChild(d);this._leftDiv=this._createRulerParent(e,"textviewLeftRuler");b=f.createElement(e,"div");b.className="textviewScroll";this._viewDiv=b;b.tabIndex=-1;b.style.position="absolute";b.style.top="0px";b.style.bottom="0px";b.style.borderWidth="0px";b.style.margin="0px";b.style.outline=
"none";b.style.background="transparent";d.appendChild(b);var g=this._createRulerParent(e,"textviewRightRuler");this._rightDiv=g;g.style.right="0px";this._scrollDiv=g=f.createElement(e,"div");g.style.margin="0px";g.style.borderWidth="0px";g.style.padding="0px";b.appendChild(g);(this._marginDiv=this._createRulerParent(e,"textviewMarginRuler")).style.zIndex="4";!f.isIE&&!f.isIOS&&(this._clipDiv=b=f.createElement(e,"div"),b.style.position="absolute",b.style.overflow="hidden",b.style.margin="0px",b.style.borderWidth=
"0px",b.style.padding="0px",b.style.background="transparent",d.appendChild(b),this._clipScrollDiv=g=f.createElement(e,"div"),g.style.position="absolute",g.style.height="1px",g.style.top="-1000px",g.style.background="transparent",b.appendChild(g));this._setFullSelection(this._fullSelection,!0);b=f.createElement(e,"div");b.className="textviewContent";this._clientDiv=b;b.tabIndex=0;b.style.position="absolute";b.style.borderWidth="0px";b.style.margin="0px";b.style.padding="0px";b.style.outline="none";
b.style.zIndex="1";b.style.WebkitUserSelect="text";b.setAttribute("spellcheck","false");if(f.isIOS||f.isAndroid)b.style.WebkitTapHighlightColor="transparent";(this._clipDiv||d).appendChild(b);if(f.isIOS||f.isAndroid)this._vScrollDiv=g=f.createElement(e,"div"),g.style.position="absolute",g.style.borderWidth="1px",g.style.borderColor="white",g.style.borderStyle="solid",g.style.borderRadius="4px",g.style.backgroundColor="black",g.style.opacity="0.5",g.style.margin="0px",g.style.padding="0px",g.style.outline=
"none",g.style.zIndex="3",g.style.width="8px",g.style.display="none",d.appendChild(g),this._hScrollDiv=g=f.createElement(e,"div"),g.style.position="absolute",g.style.borderWidth="1px",g.style.borderColor="white",g.style.borderStyle="solid",g.style.borderRadius="4px",g.style.backgroundColor="black",g.style.opacity="0.5",g.style.margin="0px",g.style.padding="0px",g.style.outline="none",g.style.zIndex="3",g.style.height="8px",g.style.display="none",d.appendChild(g);f.isFirefox&&!b.setCapture&&(this._overlayDiv=
g=f.createElement(e,"div"),g.style.position=b.style.position,g.style.borderWidth=b.style.borderWidth,g.style.margin=b.style.margin,g.style.padding=b.style.padding,g.style.cursor="text",g.style.zIndex="2",(this._clipDiv||d).appendChild(g));b.contentEditable="true";b.setAttribute("role","textbox");b.setAttribute("aria-multiline","true");this._setWrapMode(this._wrapMode,!0);this._setReadOnly(this._readonly);this._setThemeClass(this._themeClass,!0);this._setTabSize(this._tabSize,!0);this._setMarginOffset(this._marginOffset,
!0);this._hookEvents();b=this._rulers;for(g=0;g<b.length;g++)this._createRuler(b[g]);this._update();var p=this;u(e,d,"textview",a)}},_defaultOptions:function(){return{parent:{value:void 0,update:null},model:{value:void 0,update:this.setModel},scrollAnimation:{value:0,update:null},readonly:{value:!1,update:this._setReadOnly},fullSelection:{value:!0,update:this._setFullSelection},tabMode:{value:!0,update:null},tabSize:{value:8,update:this._setTabSize},expandTab:{value:!1,update:null},singleMode:{value:!1,
update:this._setSingleMode},overwriteMode:{value:!1,update:this._setOverwriteMode},blockCursorVisible:{value:!1,update:this._setBlockCursor},marginOffset:{value:0,update:this._setMarginOffset},wrapOffset:{value:0,update:this._setWrapOffset},wrapMode:{value:!1,update:this._setWrapMode},wrappable:{value:!1,update:null},theme:{value:g.TextTheme.getTheme(),update:this._setTheme},themeClass:{value:void 0,update:this._setThemeClass}}},_destroyRuler:function(a){var b=this._getRulerParent(a);if(b)for(var e=
b.firstChild;e;){if(e._ruler===a){e._ruler=void 0;b.removeChild(e);if(0===b.children.length&&(b!==this._marginDiv||!this._marginOffset))b.style.display="none";break}e=e.nextSibling}},_destroyView:function(){if(this._clientDiv){this._setGrab(null);this._unhookEvents();var a=this._getWindow();this._autoScrollTimerID&&(a.clearTimeout(this._autoScrollTimerID),this._autoScrollTimerID=null);this._updateTimer&&(a.clearTimeout(this._updateTimer),this._updateTimer=null);a=this._rootDiv;a.parentNode.removeChild(a);
this._hScrollDiv=this._vScrollDiv=this._cursorDiv=this._marginDiv=this._rightDiv=this._leftDiv=this._overlayDiv=this._clientDiv=this._clipScrollDiv=this._clipDiv=this._viewDiv=this._scrollDiv=this._rootDiv=this._clipboardDiv=this._selDiv3=this._selDiv2=this._selDiv1=null}},_doAutoScroll:function(a,b,e){this._autoScrollDir=a;this._autoScrollX=b;this._autoScrollY=e;this._autoScrollTimerID||this._autoScrollTimer()},_endAutoScroll:function(){this._autoScrollTimerID&&this._getWindow().clearTimeout(this._autoScrollTimerID);
this._autoScrollTimerID=this._autoScrollDir=void 0},_fixCaret:function(){var a=this._clientDiv;if(a){var b=this._hasFocus;this._ignoreFocus=!0;b&&a.blur();a.contentEditable=!1;a.contentEditable=!0;b&&a.focus();this._ignoreFocus=!1}},_getBaseText:function(a,b){var e=this._model;e.getBaseModel&&(a=e.mapOffset(a),b=e.mapOffset(b),e=e.getBaseModel());return e.getText(a,b)},_getBottomIndex:function(a){var b=this._bottomChild;if(a&&this._getClientHeight()>this._getLineHeight()){a=b.getBoundingClientRect();
var e=this._clientDiv.getBoundingClientRect();a.bottom>e.bottom&&(b=this._getLinePrevious(b)||b)}return b.lineIndex},_getBoundsAtOffset:function(a){var b=this._getLine(this._model.getLineAtOffset(a));a=b.getBoundingClientRect(a);var e=this._getLinePixel(b.lineIndex);a.top+=e;a.bottom+=e;b.destroy();return a},_getClientHeight:function(){var a=this._getViewPadding();return Math.max(0,this._viewDiv.clientHeight-a.top-a.bottom)},_getClientWidth:function(){var a=this._getViewPadding();return Math.max(0,
this._viewDiv.clientWidth-a.left-a.right)},_getClipboardText:function(a,b){var e=this._model.getLineDelimiter(),d,g,h=this._getWindow(),k=h.clipboardData;!k&&a&&(k=a.clipboardData);if(k)return d=[],g=k.getData(f.isIE?"Text":"text/plain"),p(g,function(a){d.push(a)},function(){d.push(e)}),g=d.join(""),b&&b(g),g;if(f.isFirefox){this._ignoreFocus=!0;var l=this._clipboardDiv,k=this._rootDiv.ownerDocument;l||(this._clipboardDiv=l=f.createElement(k,"div"),l.style.position="fixed",l.style.whiteSpace="pre",
l.style.left="-1000px",this._rootDiv.appendChild(l));l.innerHTML="\x3cpre contenteditable\x3d''\x3e\x3c/pre\x3e";l.firstChild.focus();var q=this,s=function(){var a=q._getTextFromElement(l);l.innerHTML="";d=[];p(a,function(a){d.push(a)},function(){d.push(e)});return d.join("")},m=!1;this._ignorePaste=!0;if(!f.isLinux||2!==this._lastMouseButton)try{m=k.execCommand("paste",!1,null)}catch(u){m=1<l.childNodes.length||l.firstChild&&0<l.firstChild.childNodes.length}this._ignorePaste=!1;if(!m){if(a)return h.setTimeout(function(){q.focus();
(g=s())&&b&&b(g);q._ignoreFocus=!1},0),null;this.focus();this._ignoreFocus=!1;return""}this.focus();this._ignoreFocus=!1;(g=s())&&b&&b(g);return g}return""},_getDOMText:function(a,b){return a._line.getText(b)},_getTextFromElement:function(a){var b=a.ownerDocument,e=b.defaultView;if(!e.getSelection)return a.innerText||a.textContent;b=b.createRange();b.selectNode(a);a=e.getSelection();var e=[],d;for(d=0;d<a.rangeCount;d++)e.push(a.getRangeAt(d));this._ignoreSelect=!0;a.removeAllRanges();a.addRange(b);
b=a.toString();a.removeAllRanges();for(d=0;d<e.length;d++)a.addRange(e[d]);this._ignoreSelect=!1;return b},_getViewPadding:function(){return this._metrics.viewPadding},_getLine:function(a){var b=this._getLineNode(a);return b&&!b.lineChanged&&!b.lineRemoved?b._line:new y(this,a)},_getLineHeight:function(a,b){if(void 0!==a&&this._lineHeight){var e=this._lineHeight[a];if(e)return e;if(b||void 0===b)return this._lineHeight[a]=this._calculateLineHeight(a)}return this._metrics.lineHeight},_getLineNode:function(a){for(var b=
this._clientDiv.firstChild;b;){if(a===b.lineIndex)return b;b=b.nextSibling}},_getLineNext:function(a){for(a=a?a.nextSibling:this._clientDiv.firstChild;a&&(-1===a.lineIndex||!a._line);)a=a.nextSibling;return a},_getLinePrevious:function(a){for(a=a?a.previousSibling:this._clientDiv.lastChild;a&&(-1===a.lineIndex||!a._line);)a=a.previousSibling;return a},_getLinePixel:function(a){a=Math.min(Math.max(0,a),this._model.getLineCount());if(this._lineHeight){var b=this._getTopIndex(),e=-this._topIndexY+this._getScroll().y;
if(a>b)for(;b<a;b++)e+=this._getLineHeight(b);else for(b-=1;b>=a;b--)e-=this._getLineHeight(b);return e}return this._getLineHeight()*a},_getLineIndex:function(a){var b,e=0,d=this._model.getLineCount();if(this._lineHeight){var e=this._getTopIndex(),f=-this._topIndexY+this._getScroll().y;if(a!==f)if(a<f)for(;a<f&&0<e;)a+=this._getLineHeight(--e);else for(b=this._getLineHeight(e);a-b>=f&&e<d-1;)a-=b,b=this._getLineHeight(++e)}else b=this._getLineHeight(),e=Math.floor(a/b);return Math.max(0,Math.min(d-
1,e))},_getRulerParent:function(a){switch(a.getLocation()){case "left":return this._leftDiv;case "right":return this._rightDiv;case "margin":return this._marginDiv}return null},_getScroll:function(a){(void 0===a||a)&&this._cancelAnimation();a=this._viewDiv;return{x:a.scrollLeft,y:a.scrollTop}},_getSelection:function(){return this._selection.clone()},_getTopIndex:function(a){var b=this._topChild;if(a&&this._getClientHeight()>this._getLineHeight()){a=b.getBoundingClientRect();var e=this._getViewPadding(),
d=this._viewDiv.getBoundingClientRect();a.top<d.top+e.top&&(b=this._getLineNext(b)||b)}return b.lineIndex},_hookEvents:function(){var a=this;this._modelListener={onChanging:function(b){a._onModelChanging(b)},onChanged:function(b){a._onModelChanged(b)}};this._model.addEventListener("preChanging",this._modelListener.onChanging);this._model.addEventListener("postChanged",this._modelListener.onChanged);this._themeListener={onChanged:function(b){a._setThemeClass(a._themeClass)}};this._theme.addEventListener("ThemeChanged",
this._themeListener.onChanged);var b=this._handlers=[],e=this._clientDiv,d=this._viewDiv,g=this._rootDiv,p=this._overlayDiv||e,h=e.ownerDocument,k=this._getWindow(),l=f.isIE?h:k;b.push({target:k,type:"resize",handler:function(b){return a._handleResize(b?b:k.event)}});b.push({target:e,type:"blur",handler:function(b){return a._handleBlur(b?b:k.event)}});b.push({target:e,type:"focus",handler:function(b){return a._handleFocus(b?b:k.event)}});b.push({target:d,type:"focus",handler:function(a){e.focus()}});
b.push({target:d,type:"scroll",handler:function(b){return a._handleScroll(b?b:k.event)}});b.push({target:e,type:"textInput",handler:function(b){return a._handleTextInput(b?b:k.event)}});b.push({target:e,type:"keydown",handler:function(b){return a._handleKeyDown(b?b:k.event)}});b.push({target:e,type:"keypress",handler:function(b){return a._handleKeyPress(b?b:k.event)}});b.push({target:e,type:"keyup",handler:function(b){return a._handleKeyUp(b?b:k.event)}});f.isIE&&b.push({target:h,type:"keyup",handler:function(b){return a._handleDocKeyUp(b?
b:k.event)}});b.push({target:e,type:"contextmenu",handler:function(b){return a._handleContextMenu(b?b:k.event)}});b.push({target:e,type:"copy",handler:function(b){return a._handleCopy(b?b:k.event)}});b.push({target:e,type:"cut",handler:function(b){return a._handleCut(b?b:k.event)}});b.push({target:e,type:"paste",handler:function(b){return a._handlePaste(b?b:k.event)}});b.push({target:h,type:"selectionchange",handler:function(b){return a._handleSelectionChange(b?b:k.event)}});if(f.isIOS||f.isAndroid)b.push({target:e,
type:"touchstart",handler:function(b){return a._handleTouchStart(b?b:k.event)}}),b.push({target:e,type:"touchmove",handler:function(b){return a._handleTouchMove(b?b:k.event)}}),b.push({target:e,type:"touchend",handler:function(b){return a._handleTouchEnd(b?b:k.event)}});else{b.push({target:e,type:"selectstart",handler:function(b){return a._handleSelectStart(b?b:k.event)}});b.push({target:e,type:"mousedown",handler:function(b){return a._handleMouseDown(b?b:k.event)}});b.push({target:e,type:"mouseover",
handler:function(b){return a._handleMouseOver(b?b:k.event)}});b.push({target:e,type:"mouseout",handler:function(b){return a._handleMouseOut(b?b:k.event)}});b.push({target:l,type:"mouseup",handler:function(b){return a._handleMouseUp(b?b:k.event)}});b.push({target:l,type:"mousemove",handler:function(b){return a._handleMouseMove(b?b:k.event)}});b.push({target:g,type:"mousedown",handler:function(b){return a._handleRootMouseDown(b?b:k.event)}});b.push({target:g,type:"mouseup",handler:function(b){return a._handleRootMouseUp(b?
b:k.event)}});b.push({target:p,type:"dragstart",handler:function(b){return a._handleDragStart(b?b:k.event)}});b.push({target:p,type:"drag",handler:function(b){return a._handleDrag(b?b:k.event)}});b.push({target:p,type:"dragend",handler:function(b){return a._handleDragEnd(b?b:k.event)}});b.push({target:p,type:"dragenter",handler:function(b){return a._handleDragEnter(b?b:k.event)}});b.push({target:p,type:"dragover",handler:function(b){return a._handleDragOver(b?b:k.event)}});b.push({target:p,type:"dragleave",
handler:function(b){return a._handleDragLeave(b?b:k.event)}});b.push({target:p,type:"drop",handler:function(b){return a._handleDrop(b?b:k.event)}});b.push({target:this._clientDiv,type:26<f.isFirefox?"wheel":f.isFirefox?"DOMMouseScroll":"mousewheel",handler:function(b){return a._handleMouseWheel(b?b:k.event)}});this._clipDiv&&b.push({target:this._clipDiv,type:26<f.isFirefox?"wheel":f.isFirefox?"DOMMouseScroll":"mousewheel",handler:function(b){return a._handleMouseWheel(b?b:k.event)}});if(f.isFirefox&&
(!f.isWindows||15<=f.isFirefox))(d=k.MutationObserver||k.MozMutationObserver)?(this._mutationObserver=new d(function(b){a._handleDataModified(b)}),this._mutationObserver.observe(e,{subtree:!0,characterData:!0})):b.push({target:this._clientDiv,type:"DOMCharacterDataModified",handler:function(b){return a._handleDataModified(b?b:k.event)}});if(f.isFirefox&&(!f.isWindows||15<=f.isFirefox)||f.isIE)b.push({target:this._clientDiv,type:"compositionstart",handler:function(b){return a._handleCompositionStart(b?
b:k.event)}}),b.push({target:this._clientDiv,type:"compositionend",handler:function(b){return a._handleCompositionEnd(b?b:k.event)}});this._overlayDiv&&(b.push({target:this._overlayDiv,type:"mousedown",handler:function(b){return a._handleMouseDown(b?b:k.event)}}),b.push({target:this._overlayDiv,type:"mouseover",handler:function(b){return a._handleMouseOver(b?b:k.event)}}),b.push({target:this._overlayDiv,type:"mouseout",handler:function(b){return a._handleMouseOut(b?b:k.event)}}),b.push({target:this._overlayDiv,
type:"contextmenu",handler:function(b){return a._handleContextMenu(b?b:k.event)}}));this._isW3CEvents||b.push({target:this._clientDiv,type:"dblclick",handler:function(b){return a._handleDblclick(b?b:k.event)}})}this._hookRulerEvents(this._leftDiv,b);this._hookRulerEvents(this._rightDiv,b);this._hookRulerEvents(this._marginDiv,b);for(d=0;d<b.length;d++)g=b[d],t(g.target,g.type,g.handler,g.capture)},_hookRulerEvents:function(a,b){if(a){var e=this,d=this._getWindow();f.isIE&&b.push({target:a,type:"selectstart",
handler:function(){return!1}});b.push({target:a,type:26<f.isFirefox?"wheel":f.isFirefox?"DOMMouseScroll":"mousewheel",handler:function(a){return e._handleMouseWheel(a?a:d.event)}});b.push({target:a,type:"click",handler:function(a){e._handleRulerEvent(a?a:d.event)}});b.push({target:a,type:"dblclick",handler:function(a){e._handleRulerEvent(a?a:d.event)}});b.push({target:a,type:"mousemove",handler:function(a){e._handleRulerEvent(a?a:d.event)}});b.push({target:a,type:"mouseover",handler:function(a){e._handleRulerEvent(a?
a:d.event)}});b.push({target:a,type:"mouseout",handler:function(a){e._handleRulerEvent(a?a:d.event)}})}},_getWindow:function(){return this._parent.ownerDocument.defaultView||this._parent.ownerDocument.parentWindow},_ignoreEvent:function(a){for(a=a.target;a&&a!==this._clientDiv;){if(a.ignore)return!0;a=a.parentNode}return!1},_init:function(a){var b=a.parent;"string"===typeof b&&(b=(a.document||document).getElementById(b));if(!b)throw"no parent";a.parent=b;a.model=a.model||new n.TextModel;var e=this._defaultOptions(),
d;for(d in e)e.hasOwnProperty(d)&&(this["_"+d]=void 0!==a[d]?a[d]:e[d].value);this._keyModes=[];this._rulers=[];this._selection=new w(0,0,!1);this._linksVisible=!1;this._maxLineWidth=this._redrawCount=0;this._maxLineIndex=-1;this._ignoreSelect=!0;this._hasFocus=this._ignoreFocus=!1;this._dragOffset=this._columnX=-1;this._isRangeRects=(!f.isIE||9<=f.isIE)&&"function"===typeof b.ownerDocument.createRange().getBoundingClientRect;this._isW3CEvents=b.addEventListener;this._autoScrollTimerID=this._autoScrollY=
this._autoScrollX=null;this._AUTO_SCROLL_RATE=50;this._mouseUpClosure=this._moseMoveClosure=this._grabControl=null;this._clickCount=this._lastMouseTime=this._lastMouseY=this._lastMouseX=0;this._clickTime=250;this._clickDist=5;this._isMouseDown=!1;this._doubleClickSelection=null;this._vScroll=this._hScroll=0;this._imeOffset=-1;this._createActions();this._createView()},_checkOverlayScroll:function(){if(f.isMac&&f.isWebkit&&!this._metrics.invalid&&0===this._metrics.scrollWidth){var a=this._viewDiv,b=
this._isOverOverlayScroll();a.style.pointerEvents=b.vertical||b.horizontal?"":"none"}},_isOverOverlayScroll:function(){if(!(200>(new Date).getTime()-this._lastScrollTime))return{};var a=this._viewDiv.getBoundingClientRect(),b=this._lastMouseMoveX,e=this._lastMouseMoveY;return{vertical:a.top<=e&&e<a.bottom&&a.right-15<=b&&b<a.right,horizontal:a.bottom-15<=e&&e<a.bottom&&a.left<=b&&b<a.right}},_modifyContent:function(a,b){if(this._readonly&&!a._code)return!1;a.type="Verify";this.onVerify(a);if(null===
a.text||void 0===a.text)return!1;var e=this._model;try{a._ignoreDOMSelection&&(this._ignoreDOMSelection=!0),e.setText(a.text,a.start,a.end)}finally{a._ignoreDOMSelection&&(this._ignoreDOMSelection=!1)}if(b){e=this._getSelection();e.setCaret(a.start+a.text.length);try{a._ignoreDOMSelection1&&(this._ignoreDOMSelection=!0),this._setSelection(e,!0)}finally{a._ignoreDOMSelection1&&(this._ignoreDOMSelection=!1)}}this.onModify({type:"Modify"});return!0},_onModelChanged:function(a){a.type="ModelChanged";
this.onModelChanged(a);a.type="Changed";var b=a.start,e=a.addedCharCount,d=a.removedCharCount,f=a.addedLineCount,g=a.removedLineCount,p=this._getSelection();p.end>b&&(p.end>b&&p.start<b+d?p.setCaret(b+e):(p.start+=e-d,p.end+=e-d),this._setSelection(p,!1,!1));b=this._model.getLineAtOffset(b);for(e=this._getLineNext();e;)d=e.lineIndex,b<=d&&d<=b+g&&(b===d&&!e.modelChangedEvent&&!e.lineRemoved?(e.modelChangedEvent=a,e.lineChanged=!0):(e.lineRemoved=!0,e.lineChanged=!1,e.modelChangedEvent=null)),d>b+
g&&(e.lineIndex=d+f-g,e._line.lineIndex=e.lineIndex),e=this._getLineNext(e);this._lineHeight&&(a=[b,g].concat(Array(f)),Array.prototype.splice.apply(this._lineHeight,a));!this._wrapMode&&(b<=this._maxLineIndex&&this._maxLineIndex<=b+g)&&(this._checkMaxLineIndex=this._maxLineIndex,this._maxLineIndex=-1,this._maxLineWidth=0);this._update()},_onModelChanging:function(a){a.type="ModelChanging";this.onModelChanging(a);a.type="Changing"},_queueUpdate:function(){if(!this._updateTimer&&!this._ignoreQueueUpdate){var a=
this;this._updateTimer=this._getWindow().setTimeout(function(){a._updateTimer=null;a._update()},0)}},_resetLineHeight:function(a,b){if(this._wrapMode||this._variableLineHeight){if(void 0!==a&&void 0!==b)for(var e=a;e<b;e++)this._lineHeight[e]=void 0;else this._lineHeight=Array(this._model.getLineCount());this._calculateLineHeightTimer()}else this._lineHeight=null},_resetLineWidth:function(){var a=this._clientDiv;if(a)for(a=a.firstChild;a;)a.lineWidth=void 0,a=a.nextSibling},_reset:function(){this._maxLineIndex=
-1;this._maxLineWidth=0;this._columnX=-1;this._bottomChild=this._topChild=null;this._topIndexY=0;this._variableLineHeight=!1;this._resetLineHeight();this._setSelection(new w(0,0,!1),!1,!1);this._viewDiv&&(this._viewDiv.scrollLeft=0,this._viewDiv.scrollTop=0);var a=this._clientDiv;if(a){for(a=a.firstChild;a;)a.lineRemoved=!0,a=a.nextSibling;13>f.isFirefox&&this._fixCaret()}},_scrollViewAnimated:function(a,b,e){var d=this._getWindow();if(e&&this._scrollAnimation){var f=this;this._animation=new B({window:d,
duration:this._scrollAnimation,curve:[b,0],onAnimate:function(a){a=b-Math.floor(a);f._scrollView(0,a);b-=a},onEnd:function(){f._animation=null;f._scrollView(a,b);e&&d.setTimeout(e,0)}});this._animation.play()}else this._scrollView(a,b),e&&d.setTimeout(e,0)},_scrollView:function(a,b){this._ensureCaretVisible=!1;var e=this._viewDiv;a&&(e.scrollLeft+=a);b&&(e.scrollTop+=b)},_setClipboardText:function(a,b){var e,d=this._getWindow(),g=d.clipboardData;!g&&b&&(g=b.clipboardData);if(g&&(e=[],p(a,function(a){e.push(a)},
function(){e.push(f.platformDelimiter)}),g.setData(f.isIE?"Text":"text/plain",e.join(""))||21<f.isFirefox))return!0;var h=this._parent.ownerDocument,k=f.createElement(h,"pre");k.style.position="fixed";k.style.left="-1000px";p(a,function(a){k.appendChild(h.createTextNode(a))},function(){k.appendChild(f.createElement(h,"br"))});k.appendChild(h.createTextNode(" "));this._clientDiv.appendChild(k);g=h.createRange();g.setStart(k.firstChild,0);g.setEndBefore(k.lastChild);var l=d.getSelection();0<l.rangeCount&&
l.removeAllRanges();l.addRange(g);var q=this,g=function(){k&&k.parentNode===q._clientDiv&&q._clientDiv.removeChild(k);q._updateDOMSelection()},l=!1;this._ignoreCopy=!0;try{l=h.execCommand("copy",!1,null)}catch(s){}this._ignoreCopy=!1;if(!l&&b)return d.setTimeout(g,0),!1;g();return!0},_setDOMSelection:function(a,b,e,d,g){this._setDOMFullSelection(a,b,e,d);a=a._line.getNodeOffset(b);e=e._line.getNodeOffset(d);d=this._getWindow();b=this._parent.ownerDocument;if(d.getSelection){var p=d.getSelection();
d=b.createRange();d.setStart(a.node,a.offset);d.setEnd(e.node,e.offset);if(this._hasFocus&&(p.anchorNode!==a.node||p.anchorOffset!==a.offset||p.focusNode!==e.node||p.focusOffset!==e.offset||p.anchorNode!==e.node||p.anchorOffset!==e.offset||p.focusNode!==a.node||p.focusOffset!==a.offset))this._anchorNode=a.node,this._anchorOffset=a.offset,this._focusNode=e.node,this._focusOffset=e.offset,this._ignoreSelect=!1,0<p.rangeCount&&p.removeAllRanges(),p.addRange(d),this._ignoreSelect=!0;this._cursorDiv&&
(d=b.createRange(),g?(d.setStart(a.node,a.offset),d.setEnd(a.node,a.offset)):(d.setStart(e.node,e.offset),d.setEnd(e.node,e.offset)),g=d.getClientRects()[0],a=this._cursorDiv.parentNode,e=a.getBoundingClientRect(),g&&e&&(this._cursorDiv.style.top=g.top-e.top+a.scrollTop+"px",this._cursorDiv.style.left=g.left-e.left+a.scrollLeft+"px"))}else b.selection&&this._hasFocus&&(g=b.body,d=f.createElement(b,"div"),g.appendChild(d),g.removeChild(d),d=g.createTextRange(),d.moveToElementText(a.node.parentNode),
d.moveStart("character",a.offset),g=g.createTextRange(),g.moveToElementText(e.node.parentNode),g.moveStart("character",e.offset),d.setEndPoint("EndToStart",g),this._ignoreSelect=!1,d.select(),this._ignoreSelect=!0)},_setDOMFullSelection:function(a,b,e,d){if(this._selDiv1){var f=this._selDiv1;f.style.width="0px";f.style.height="0px";f=this._selDiv2;f.style.width="0px";f.style.height="0px";f=this._selDiv3;f.style.width="0px";f.style.height="0px";if(!(a===e&&b===d)){var g=this._getViewPadding(),p=this._clientDiv.getBoundingClientRect(),
h=this._viewDiv.getBoundingClientRect(),f=h.left+g.left,k=p.right,g=h.top+g.top,l=p.bottom,h=p=0;this._clipDiv?(h=this._clipDiv.getBoundingClientRect(),p=h.left-this._clipDiv.scrollLeft):(h=this._rootDiv.getBoundingClientRect(),p=h.left);h=h.top;this._ignoreDOMSelection=!0;var q=(new y(this,a.lineIndex,a)).getBoundingClientRect(b,!1),s=q.left;b=(new y(this,e.lineIndex,e)).getBoundingClientRect(d,!1);var m=b.left;this._ignoreDOMSelection=!1;var u=this._selDiv1,s=Math.min(k,Math.max(f,s)),n=Math.min(l,
Math.max(g,q.top)),t=k;d=Math.min(l,Math.max(g,q.bottom));u.style.left=s-p+"px";u.style.top=n-h+"px";u.style.width=Math.max(0,t-s)+"px";u.style.height=Math.max(0,d-n)+"px";a.lineIndex===e.lineIndex?(t=Math.min(m,k),u.style.width=Math.max(0,t-s)+"px"):(q=Math.min(l,Math.max(g,b.top)),m=Math.min(k,Math.max(f,m)),g=Math.min(l,Math.max(g,b.bottom)),l=this._selDiv3,l.style.left=f-p+"px",l.style.top=q-h+"px",l.style.width=Math.max(0,m-f)+"px",l.style.height=Math.max(0,g-q)+"px",1<Math.abs(a.lineIndex-e.lineIndex)&&
(a=this._selDiv2,a.style.left=f-p+"px",a.style.top=d-h+"px",a.style.width=Math.max(0,k-f)+"px",a.style.height=Math.max(0,q-d)+"px"))}}},_setGrab:function(a){a!==this._grabControl&&(a?(a.setCapture&&a.setCapture(),this._grabControl=a):(this._grabControl.releaseCapture&&this._grabControl.releaseCapture(),this._grabControl=null))},_setLinksVisible:function(a){if(this._linksVisible!==a){this._linksVisible=a;f.isIE&&a&&(this._hadFocus=this._hasFocus);var b=this._clientDiv;b.contentEditable=!a;this._hadFocus&&
!a&&b.focus();this._overlayDiv&&(this._overlayDiv.style.zIndex=a?"-1":"1");for(a=this._getLineNext();a;)a._line.updateLinks(),a=this._getLineNext(a);this._updateDOMSelection()}},_setSelection:function(a,b,e,d,f){if(a){this._columnX=-1;void 0===e&&(e=!0);var g=this._selection;this._selection=a;!1!==b&&this._showCaret(!1,d,b,f);e&&this._updateDOMSelection();if(!g.equals(a))this.onSelection({type:"Selection",oldValue:{start:g.start,end:g.end},newValue:{start:a.start,end:a.end}})}},_setSelectionTo:function(a,
b,e,d){var f=this._model,g=this._getSelection();b=this.convert({x:a,y:b},"page","document");a=this._getLineIndex(b.y);if(1===this._clickCount){f=this._getLine(a);a=f.getOffset(b.x,b.y-this._getLinePixel(a));f.destroy();if(d&&!e&&g.start<=a&&a<g.end)return this._dragOffset=a,!1;g.extend(a);e||g.collapse()}else 0===(this._clickCount&1)?(f=this._getLine(a),a=f.getOffset(b.x,b.y-this._getLinePixel(a)),this._doubleClickSelection?a>=this._doubleClickSelection.start?(e=this._doubleClickSelection.start,d=
f.getNextOffset(a,{unit:"wordend",count:1})):(e=f.getNextOffset(a,{unit:"word",count:-1}),d=this._doubleClickSelection.end):(e=f.getNextOffset(a,{unit:"word",count:-1}),d=f.getNextOffset(e,{unit:"wordend",count:1})),f.destroy()):this._doubleClickSelection?(d=f.getLineAtOffset(this._doubleClickSelection.start),a>=d?(e=f.getLineStart(d),d=f.getLineEnd(a)):(e=f.getLineStart(a),d=f.getLineEnd(d))):(e=f.getLineStart(a),d=f.getLineEnd(a)),g.setCaret(e),g.extend(d);this._setSelection(g,!0,!0);return!0},
_setFullSelection:function(a,b){this._fullSelection=a;f.isWebkit&&(this._fullSelection=!0);var e=this._clipDiv||this._rootDiv;if(e)if(this._fullSelection){if(!this._selDiv1&&this._fullSelection&&!f.isIOS){var d=e.ownerDocument;this._highlightRGB=f.isWebkit?"transparent":"Highlight";var g=f.createElement(d,"div");this._selDiv1=g;g.style.position="absolute";g.style.borderWidth="0px";g.style.margin="0px";g.style.padding="0px";g.style.outline="none";g.style.background=this._highlightRGB;g.style.width=
"0px";g.style.height="0px";g.style.zIndex="0";e.appendChild(g);var p=f.createElement(d,"div");this._selDiv2=p;p.style.position="absolute";p.style.borderWidth="0px";p.style.margin="0px";p.style.padding="0px";p.style.outline="none";p.style.background=this._highlightRGB;p.style.width="0px";p.style.height="0px";p.style.zIndex="0";e.appendChild(p);this._selDiv3=d=f.createElement(d,"div");d.style.position="absolute";d.style.borderWidth="0px";d.style.margin="0px";d.style.padding="0px";d.style.outline="none";
d.style.background=this._highlightRGB;d.style.width="0px";d.style.height="0px";d.style.zIndex="0";e.appendChild(d);if(f.isFirefox&&f.isMac){e=this._getWindow().getComputedStyle(d,null).getPropertyValue("background-color");switch(e){case "rgb(119, 141, 168)":e="rgb(199, 208, 218)";break;case "rgb(127, 127, 127)":e="rgb(198, 198, 198)";break;case "rgb(255, 193, 31)":e="rgb(250, 236, 115)";break;case "rgb(243, 70, 72)":e="rgb(255, 176, 139)";break;case "rgb(255, 138, 34)":e="rgb(255, 209, 129)";break;
case "rgb(102, 197, 71)":e="rgb(194, 249, 144)";break;case "rgb(140, 78, 184)":e="rgb(232, 184, 255)";break;default:e="rgb(180, 213, 255)"}this._highlightRGB=e;g.style.background=e;p.style.background=e;d.style.background=e}b||this._updateDOMSelection()}}else this._selDiv1&&(e.removeChild(this._selDiv1),this._selDiv1=null),this._selDiv2&&(e.removeChild(this._selDiv2),this._selDiv2=null),this._selDiv3&&(e.removeChild(this._selDiv3),this._selDiv3=null)},_setBlockCursor:function(a){this._blockCursorVisible=
a;this._updateBlockCursorVisible()},_setOverwriteMode:function(a){this._overwriteMode=a;this._updateBlockCursorVisible()},_updateBlockCursorVisible:function(){if(this._blockCursorVisible||this._overwriteMode){if(!this._cursorDiv){var a=this._viewDiv,b=f.createElement(a.ownerDocument,"div");b.className="textviewBlockCursor";this._cursorDiv=b;b.tabIndex=-1;b.style.zIndex="2";b.style.color="transparent";b.style.position="absolute";b.style.pointerEvents="none";b.innerHTML="\x26nbsp;";a.appendChild(b);
this._updateDOMSelection()}}else this._cursorDiv&&(this._cursorDiv.parentNode.removeChild(this._cursorDiv),this._cursorDiv=null)},_setMarginOffset:function(a,b){this._marginOffset=a;this._marginDiv.style.display=a?"block":"none";b||(this._metrics=this._calculateMetrics(),this._queueUpdate())},_setWrapOffset:function(a,b){this._wrapOffset=a;b||(this._metrics=this._calculateMetrics(),this._queueUpdate())},_setReadOnly:function(a){this._readonly=a;this._clientDiv.setAttribute("aria-readonly",a?"true":
"false")},_setSingleMode:function(a,b){this._singleMode=a;this._updateOverflow();this._updateStyle(b)},_setTabSize:function(a,b){this._tabSize=a;this._customTabSize=void 0;var e=this._clientDiv;f.isOpera?e&&(e.style.OTabSize=this._tabSize+""):537.1<=f.isWebkit?e&&(e.style.tabSize=this._tabSize+""):4<=f.isFirefox?e&&(e.style.MozTabSize=this._tabSize+""):8!==this._tabSize&&(this._customTabSize=this._tabSize);b||(this.redrawLines(),this._resetLineWidth())},_setTheme:function(a){this._theme&&this._theme.removeEventListener("ThemeChanged",
this._themeListener.onChanged);(this._theme=a)&&this._theme.addEventListener("ThemeChanged",this._themeListener.onChanged);this._setThemeClass(this._themeClass)},_setThemeClass:function(a,b){this._themeClass=a;var e="textview",d=this._theme.getThemeClass();d&&(e+=" "+d);this._themeClass&&d!==this._themeClass&&(e+=" "+this._themeClass);this._rootDiv.className=e;this._updateStyle(b)},_setWrapMode:function(a,b){this._wrapMode=a&&this._wrappable;var e=this._clientDiv;this._wrapMode?(e.style.whiteSpace=
"pre-wrap",e.style.wordWrap="break-word"):(e.style.whiteSpace="pre",e.style.wordWrap="normal");this._updateOverflow();b||(this.redraw(),this._resetLineWidth());this._resetLineHeight()},_showCaret:function(a,b,e,d){if(this._clientDiv&&!(0<this._redrawCount)&&!this._ignoreDOMSelection){var f=this._model,g=this._getSelection(),p=this._getScroll(),h=g.getCaret(),k=g.start,l=g.end,q=f.getLineAtOffset(k),s=f.getLineAtOffset(l),m=Math.max(Math.max(k,f.getLineStart(s)),l-1),f=this._getClientWidth(),u=this._getClientHeight(),
n=f/4,t=this._getBoundsAtOffset(h===k?k:m),w=t.left,x=t.right,r=t.top,z=t.bottom,y=0,B="object"===typeof e;if((a||B)&&!g.isEmpty())t=this._getBoundsAtOffset(h===l?k:m),y=(t.bottom>z?t.bottom:z)-(t.top<r?t.top:r),a&&(t.top===r?h===k?x=w+Math.min(t.right-w,f):w=x-Math.min(x-t.left,f):h===k?z=r+Math.min(t.bottom-r,u):r=z-Math.min(z-t.top,u));a=0;w<p.x&&(a=Math.min(w-p.x,-n));x>p.x+f&&(a=Math.max(x-p.x-f,n));g=0;r<p.y?g=r-p.y:z>p.y+u&&(g=z-p.y-u);d&&(0<d?0<g&&(g=Math.max(g,d)):0>g&&(g=Math.min(g,d)));
d=B&&"always"===e.scrollPolicy;if(0!==a||0!==g||d)return B?(d=0<g,0===g&&(g=r-p.y),p=e.viewAnchor,r=e.selectionAnchor,e=Math.min(Math.max(0,e.viewAnchorOffset||0)),g="top"===p?g+Math.floor(d?(1-e)*u:-e*u):"bottom"===p?g+Math.floor(d?e*u:-(1-e)*u):"center"===p?g+Math.floor(d?u/2+e*u:u/2-(1-e)*u):g+Math.floor(d?e*u:-e*u),q!==s&&("top"===r&&h!==k?g+=Math.floor(-y):"bottom"===r&&h!==l?g+=Math.floor(y):"center"===r&&(g+=Math.floor(y/2)))):0!==g&&"number"===typeof e&&(0>e&&(e=0),1<e&&(e=1),g+=Math.floor(0<
g?e*u:-e*u)),this._scrollViewAnimated(a,g,b),u!==this._getClientHeight()||f!==this._getClientWidth()?this._showCaret():this._ensureCaretVisible=!0,!0;b&&b();return!1}},_startIME:function(){if(-1===this._imeOffset){var a=this._getSelection();a.isEmpty()||this._modifyContent({text:"",start:a.start,end:a.end},!0);this._imeOffset=a.start}},_unhookEvents:function(){this._model.removeEventListener("preChanging",this._modelListener.onChanging);this._model.removeEventListener("postChanged",this._modelListener.onChanged);
this._theme.removeEventListener("ThemeChanged",this._themeListener.onChanged);this._modelListener=null;for(var a=0;a<this._handlers.length;a++){var b=this._handlers[a];z(b.target,b.type,b.handler)}this._handlers=null;this._mutationObserver&&(this._mutationObserver.disconnect(),this._mutationObserver=null)},_updateDOMSelection:function(){if(!(0<this._redrawCount)&&!this._ignoreDOMSelection&&this._clientDiv){var a=this._getSelection(),b=this._model,e=b.getLineAtOffset(a.start),d=b.getLineAtOffset(a.end),
f=this._getLineNext();if(f){var g=this._getLinePrevious(),p;e<f.lineIndex?(e=f,p=b.getLineStart(f.lineIndex)):e>g.lineIndex?(e=g,p=b.getLineStart(g.lineIndex)):(e=this._getLineNode(e),p=a.start);d<f.lineIndex?(d=f,b=b.getLineStart(f.lineIndex)):d>g.lineIndex?(d=g,b=b.getLineStart(g.lineIndex)):(d=this._getLineNode(d),b=a.end);this._setDOMSelection(e,p,d,b,a.caret)}}},_update:function(a){if(!(0<this._redrawCount)){this._updateTimer&&(this._getWindow().clearTimeout(this._updateTimer),this._updateTimer=
null,a=!1);var b=this._clientDiv,e=this._viewDiv;if(b){this._metrics.invalid&&(this._ignoreQueueUpdate=!0,this._updateStyle(),this._ignoreQueueUpdate=!1);var d=this._model,g=this._getScroll(!1),p=this._getViewPadding(),h=d.getLineCount(),k=this._getLineHeight(),l=!1,q=!1,s=!1,u=this._metrics.scrollWidth;this._wrapMode&&(b.style.width=(this._metrics.wrapWidth||this._getClientWidth())+"px");var m,n,t,w,x=0,r=0,z;if(this._lineHeight){for(;r<h;){z=this._getLineHeight(r);if(x+z>g.y)break;x+=z;r++}m=r;
n=Math.max(0,m-1);t=d=g.y-x;0<m&&(d+=this._getLineHeight(m-1))}else w=Math.max(0,g.y)/k,m=Math.floor(w),n=Math.max(0,m-1),d=Math.round((w-n)*k),t=Math.round((w-m)*k);this._topIndexY=t;w=this._rootDiv;var B=w.clientWidth,Q=w.clientHeight;if(a){k=0;this._leftDiv&&(m=this._leftDiv.getBoundingClientRect(),k=m.right-m.left);m=this._getClientWidth();w=this._getClientHeight();q=m;this._wrapMode?this._metrics.wrapWidth&&(q=this._metrics.wrapWidth):q=Math.max(this._maxLineWidth,q);for(;r<h;)z=this._getLineHeight(r,
!1),x+=z,r++;h=x}else{w=this._getClientHeight();t=Math.min(m+Math.floor((w+t)/k),h-1);var g=Math.min(t+1,h-1),N;for(z=b.firstChild;z;){N=z.lineIndex;var M=z.nextSibling;if(!(n<=N&&N<=g)||z.lineRemoved||-1===z.lineIndex)this._mouseWheelLine===z?(z.style.display="none",z.lineIndex=-1):b.removeChild(z);z=M}z=this._getLineNext();var M=e.ownerDocument,O=M.createDocumentFragment();for(N=n;N<=g;N++)!z||z.lineIndex>N?(new y(this,N)).create(O,null):(O.firstChild&&(b.insertBefore(O,z),O=M.createDocumentFragment()),
z&&z.lineChanged&&(z=(new y(this,N)).create(O,z),z.lineChanged=!1),z=this._getLineNext(z));O.firstChild&&b.insertBefore(O,z);f.isWebkit&&!this._wrapMode&&(b.style.width="0x7fffffffpx");z=this._getLineNext();N=w+d;for(O=!1;z;)n=z.lineWidth,void 0===n&&(M=z._line.getBoundingClientRect(),n=z.lineWidth=Math.ceil(M.right-M.left),M=M.bottom-M.top,this._lineHeight?this._lineHeight[z.lineIndex]=M:0!==k&&(0!==M&&Math.ceil(k)!==Math.ceil(M))&&(this._variableLineHeight=!0,this._lineHeight=[],this._lineHeight[z.lineIndex]=
M)),this._lineHeight&&!O&&(N-=this._lineHeight[z.lineIndex],0>N&&(t=z.lineIndex,O=!0)),this._wrapMode||(n>=this._maxLineWidth&&(this._maxLineWidth=n,this._maxLineIndex=z.lineIndex),this._checkMaxLineIndex===z.lineIndex&&(this._checkMaxLineIndex=-1)),z.lineIndex===m&&(this._topChild=z),z.lineIndex===t&&(this._bottomChild=z),z=this._getLineNext(z);-1!==this._checkMaxLineIndex&&(N=this._checkMaxLineIndex,this._checkMaxLineIndex=-1,0<=N&&N<h&&(k=new y(this,N),M=k.getBoundingClientRect(),n=M.right-M.left,
n>=this._maxLineWidth&&(this._maxLineWidth=n,this._maxLineIndex=N),k.destroy()));for(;r<h;)z=this._getLineHeight(r,r<=t),x+=z,r++;h=x;this._updateRuler(this._leftDiv,m,g,Q);this._updateRuler(this._rightDiv,m,g,Q);this._updateRuler(this._marginDiv,m,g,Q);k=0;this._leftDiv&&(m=this._leftDiv.getBoundingClientRect(),k=m.right-m.left);g=0;this._rightDiv&&(g=this._rightDiv.getBoundingClientRect(),g=g.right-g.left);e.style.left=k+"px";e.style.right=g+"px";g=this._scrollDiv;g.style.height=h+"px";m=this._getClientWidth();
!this._singleMode&&!this._wrapMode&&(x=l=w,(r="scroll"===e.style.overflowX)?l+=u:x-=u,z=t=m,(n="scroll"===e.style.overflowY)?t+=u:z-=u,w=l,m=t,h>w&&(s=!0,m=z),this._maxLineWidth>m&&(q=!0,w=x,h>w&&(s=!0,m=z)),r!==q&&(e.style.overflowX=q?"scroll":"hidden"),n!==s&&(e.style.overflowY=s?"scroll":"hidden"),l=r!==q||n!==s);s=m;this._wrapMode?this._metrics.wrapWidth&&(s=this._metrics.wrapWidth):s=Math.max(this._maxLineWidth,s);q=s;if((!f.isIE||9<=f.isIE)&&this._maxLineWidth>m)s+=p.right+p.left;g.style.width=
s+"px";this._clipScrollDiv&&(this._clipScrollDiv.style.width=s+"px");g=this._getScroll(!1)}this._vScrollDiv&&(s=w-8,x=Math.max(15,Math.ceil(Math.min(1,s/(h+p.top+p.bottom))*s)),this._vScrollDiv.style.left=k+m-8+"px",this._vScrollDiv.style.top=Math.floor(Math.max(0,g.y*s/h))+"px",this._vScrollDiv.style.height=x+"px");!this._wrapMode&&this._hScrollDiv&&(s=m-8,x=Math.max(15,Math.ceil(Math.min(1,s/(this._maxLineWidth+p.left+p.right))*s)),this._hScrollDiv.style.left=k+Math.floor(Math.max(0,Math.floor(g.x*
s/this._maxLineWidth)))+"px",this._hScrollDiv.style.top=w-9+"px",this._hScrollDiv.style.width=x+"px");r=g.x;x=this._clipDiv;s=this._overlayDiv;if(t=this._marginDiv)t.style.left=-r+k+this._metrics.marginWidth+p.left+"px",t.style.bottom=("scroll"===e.style.overflowX?u:0)+"px";x?(x.scrollLeft=r,x.scrollTop=0,e=k+p.left,u=p.top,a=m,k=w,r=0,t=-d,0===g.x&&(e-=p.left,a+=p.left,r=p.left),g.x+m===q&&(a+=p.right),0===g.y&&(u-=p.top,k+=p.top,t+=p.top),g.y+w===h&&(k+=p.bottom),x.style.left=e+"px",x.style.top=
u+"px",x.style.right=B-a-e+"px",x.style.bottom=Q-k-u+"px",b.style.left=r+"px",b.style.top=t+"px",b.style.width=q+"px",b.style.height=w+d+"px",s&&(s.style.left=b.style.left,s.style.top=b.style.top,s.style.width=b.style.width,s.style.height=b.style.height)):(e=r,u=d,B=r+m,Q=d+w,0===e&&(e-=p.left),0===u&&(u-=p.top),B===q&&(B+=p.right),g.y+w===h&&(Q+=p.bottom),b.style.clip="rect("+u+"px,"+B+"px,"+Q+"px,"+e+"px)",b.style.left=-r+k+p.left+"px",b.style.width=(this._wrapMode||f.isWebkit?q:m+r)+"px",a||(b.style.top=
-d+p.top+"px",b.style.height=w+d+"px"),s&&(s.style.clip=b.style.clip,s.style.left=b.style.left,s.style.width=b.style.width,a||(s.style.top=b.style.top,s.style.height=b.style.height)));this._updateDOMSelection();l&&(b=this._ensureCaretVisible,this._ensureCaretVisible=!1,b&&this._showCaret(),this._queueUpdate())}}},_updateOverflow:function(){var a=this._viewDiv;this._wrapMode?(a.style.overflowX="hidden",a.style.overflowY="scroll"):a.style.overflow="hidden"},_updateRuler:function(a,b,e,g){if(a){var p=
this._parent.ownerDocument,h=this._getLineHeight(),k=this._getViewPadding();for(a=a.firstChild;a;){var l=a._ruler,q=h,s=l.getOverview();"page"===s&&(q+=this._topIndexY);a.style.top=-q+"px";a.style.height=g+q+"px";a.rulerChanged&&d(l.getRulerStyle(),a);var m,u=a.firstChild;u?(m=u,u=u.nextSibling):(m=f.createElement(p,"div"),m.style.visibility="hidden",a.appendChild(m));var n;if(a.rulerChanged&&m){q=-1;if(n=l.getWidestAnnotation())d(n.style,m),n.html&&(m.innerHTML=n.html);m.lineIndex=q;m.style.height=
h+k.top+"px"}var t;if("page"===s){for(l=l.getAnnotations(b,e+1);u;)q=u.lineIndex,n=u.nextSibling,(!(b<=q&&q<=e)||u.lineChanged)&&a.removeChild(u),u=n;u=a.firstChild.nextSibling;t=p.createDocumentFragment();for(q=b;q<=e;q++)if(!u||u.lineIndex>q){m=f.createElement(p,"div");if(n=l[q])d(n.style,m),n.html&&(m.innerHTML=n.html),m.annotation=n;m.lineIndex=q;m.style.height=this._getLineHeight(q)+"px";t.appendChild(m)}else t.firstChild&&(a.insertBefore(t,u),t=p.createDocumentFragment()),u&&(u=u.nextSibling);
t.firstChild&&a.insertBefore(t,u)}else{n=this._getClientHeight();q=this._model.getLineCount();u=n+k.top+k.bottom-2*this._metrics.scrollWidth;s=h*q<u?h:u/q;if(a.rulerChanged){for(n=a.childNodes.length;1<n;)a.removeChild(a.lastChild),n--;l=l.getAnnotations(0,q);t=p.createDocumentFragment();for(var w in l)q=w>>>0,0>q||(m=f.createElement(p,"div"),n=l[w],d(n.style,m),m.style.position="absolute",m.style.top=this._metrics.scrollWidth+h+Math.floor(q*s)+"px",n.html&&(m.innerHTML=n.html),m.annotation=n,m.lineIndex=
q,t.appendChild(m));a.appendChild(t)}else if(a._oldTrackHeight!==u)for(m=a.firstChild?a.firstChild.nextSibling:null;m;)m.style.top=this._metrics.scrollWidth+h+Math.floor(m.lineIndex*s)+"px",m=m.nextSibling;a._oldTrackHeight=u}a.rulerChanged=!1;a=a.nextSibling}}},_updateStyleSheet:function(){var a="";f.isWebkit&&0<this._metrics.scrollWidth&&(a+="\n.textview ::-webkit-scrollbar-corner {background: #eeeeee;}");f.isFirefox&&(f.isMac&&this._highlightRGB&&"Highlight"!==this._highlightRGB)&&(a+="\n.textview ::-moz-selection {background: "+
this._highlightRGB+";}");if(a){var b=this._clientDiv.ownerDocument,e=b.getElementById("_textviewStyle");if(e)e.removeChild(e.firstChild),e.appendChild(b.createTextNode(a));else{e=f.createElement(b,"style");e.id="_textviewStyle";var d=b.getElementsByTagName("head")[0]||b.documentElement;e.appendChild(b.createTextNode(a));d.insertBefore(e,d.firstChild)}}},_updateStyle:function(a){!a&&f.isIE&&(this._rootDiv.style.lineHeight="normal");var b=this._metrics=this._calculateMetrics();this._variableLineHeight&&
(this._variableLineHeight=!1,this._resetLineHeight());this._rootDiv.style.lineHeight=f.isIE?b.lineHeight-(b.lineTrim.top+b.lineTrim.bottom)+"px":"normal";this._updateStyleSheet();if(f.isMac&&f.isWebkit){var e=this._viewDiv;!b.invalid&&0===b.scrollWidth?(e.style.pointerEvents="none",e.style.zIndex="2"):(e.style.pointerEvents="",e.style.zIndex="")}a||(this.redraw(),this._resetLineWidth())}};k.EventTarget.addMixin(r.prototype);return{TextView:r}});
define("orion/editor/projectionTextModel",["orion/editor/textModel","orion/editor/eventTarget"],function(l,n){function m(k){this._model=k;this._projections=[];var g=this;this._listener={onChanged:function(h){g._onChanged(h)},onChanging:function(h){g._onChanging(h)}};k.addEventListener("postChanged",this._listener.onChanged);k.addEventListener("preChanging",this._listener.onChanging)}m.prototype={destroy:function(){this._model&&(this._model.removeEventListener("postChanged",this._listener.onChanged),
this._model.removeEventListener("preChanging",this._listener.onChanging),this._model=null)},addProjection:function(k){if(k){var g=this._model,h=this._projections;k._lineIndex=g.getLineAtOffset(k.start);k._lineCount=g.getLineAtOffset(k.end)-k._lineIndex;var f=k.text;f||(f="");k._model="string"===typeof f?new l.TextModel(f,g.getLineDelimiter()):f;var g=this.mapOffset(k.start,!0),f=k.end-k.start,d=k._lineCount,a=k._model.getCharCount(),e=k._model.getLineCount()-1,b={type:"Changing",text:k._model.getText(),
start:g,removedCharCount:f,addedCharCount:a,removedLineCount:d,addedLineCount:e};this.onChanging(b);b=this._binarySearch(h,k.start);h.splice(b,0,k);this.onChanged({type:"Changed",start:g,removedCharCount:f,addedCharCount:a,removedLineCount:d,addedLineCount:e})}},getProjections:function(){return this._projections.slice(0)},getBaseModel:function(){return this._model},mapOffset:function(k,g){var h=this._projections,f=0,d,a;if(g){for(d=0;d<h.length;d++){a=h[d];if(a.start>k)break;if(a.end>k)return-1;f+=
a._model.getCharCount()-(a.end-a.start)}return k+f}for(d=0;d<h.length;d++){a=h[d];if(a.start>k-f)break;var e=a._model.getCharCount();if(a.start+e>k-f)return-1;f+=e-(a.end-a.start)}return k-f},removeProjection:function(k){this._removeProjection(k)},_removeProjection:function(k,g){var h,f=0;for(h=0;h<this._projections.length;h++){var d=this._projections[h];if(d===k){k=d;break}f+=d._model.getCharCount()-(d.end-d.start)}if(h<this._projections.length){var d=this._model,f=k.start+f,a=k.end-k.start,e=k._lineCount,
b=k._model.getCharCount(),p=k._model.getLineCount()-1;g||(d={type:"Changing",text:d.getText(k.start,k.end),start:f,removedCharCount:b,addedCharCount:a,removedLineCount:p,addedLineCount:e},this.onChanging(d));this._projections.splice(h,1);if(!g)this.onChanged({type:"Changed",start:f,removedCharCount:b,addedCharCount:a,removedLineCount:p,addedLineCount:e})}},_binarySearch:function(k,g){for(var h=k.length,f=-1,d;1<h-f;)d=Math.floor((h+f)/2),g<=k[d].start?h=d:f=d;return h},getCharCount:function(){for(var k=
this._model.getCharCount(),g=this._projections,h=0;h<g.length;h++)var f=g[h],k=k+(f._model.getCharCount()-(f.end-f.start));return k},getLine:function(k,g){if(0>k)return null;var h=this._model,f=this._projections,d=0,a=[],e=0,b,p,l;for(b=0;b<f.length;b++){l=f[b];if(l._lineIndex>=k-d)break;p=l._model.getLineCount()-1;if(l._lineIndex+p>=k-d){e=k-(l._lineIndex+d);if(e<p)return l._model.getLine(e,g);a.push(l._model.getLine(p))}e=l.end;d+=p-l._lineCount}for(e=Math.max(e,h.getLineStart(k-d));b<f.length;b++){l=
f[b];if(l._lineIndex>k-d)break;a.push(h.getText(e,l.start));p=l._model.getLineCount()-1;if(l._lineIndex+p>k-d)return a.push(l._model.getLine(0,g)),a.join("");a.push(l._model.getText());e=l.end;d+=p-l._lineCount}f=h.getLineEnd(k-d,g);e<f&&a.push(h.getText(e,f));return a.join("")},getLineAtOffset:function(k){for(var g=this._model,h=this._projections,f=0,d=0,a=0;a<h.length;a++){var e=h[a];if(e.start>k-f)break;var b=e._model.getCharCount();if(e.start+b>k-f){h=k-(e.start+f);d+=e._model.getLineAtOffset(h);
f+=h;break}d+=e._model.getLineCount()-1-e._lineCount;f+=b-(e.end-e.start)}return g.getLineAtOffset(k-f)+d},getLineCount:function(){for(var k=this._projections,g=this._model.getLineCount(),h=0;h<k.length;h++)var f=k[h],g=g+(f._model.getLineCount()-1-f._lineCount);return g},getLineDelimiter:function(){return this._model.getLineDelimiter()},getLineEnd:function(k,g){if(0>k)return-1;for(var h=this._model,f=this._projections,d=0,a=0,e=0;e<f.length;e++){var b=f[e];if(b._lineIndex>k-d)break;var p=b._model.getLineCount()-
1;if(b._lineIndex+p>k-d)return b._model.getLineEnd(k-(b._lineIndex+d),g)+b.start+a;a+=b._model.getCharCount()-(b.end-b.start);d+=p-b._lineCount}return h.getLineEnd(k-d,g)+a},getLineStart:function(k){if(0>k)return-1;for(var g=this._model,h=this._projections,f=0,d=0,a=0;a<h.length;a++){var e=h[a];if(e._lineIndex>=k-f)break;var b=e._model.getLineCount()-1;if(e._lineIndex+b>=k-f)return e._model.getLineStart(k-(e._lineIndex+f))+e.start+d;d+=e._model.getCharCount()-(e.end-e.start);f+=b-e._lineCount}return g.getLineStart(k-
f)+d},getText:function(k,g){void 0===k&&(k=0);var h=this._model,f=this._projections,d=0,a=[],e,b,p;for(e=0;e<f.length;e++){b=f[e];if(b.start>k-d)break;p=b._model.getCharCount();if(b.start+p>k-d){if(void 0!==g&&b.start+p>g-d)return b._model.getText(k-(b.start+d),g-(b.start+d));a.push(b._model.getText(k-(b.start+d)));k=b.end+d+p-(b.end-b.start)}d+=p-(b.end-b.start)}var l=k-d;if(void 0!==g){for(;e<f.length;e++){b=f[e];if(b.start>g-d)break;a.push(h.getText(l,b.start));p=b._model.getCharCount();if(b.start+
p>g-d)return a.push(b._model.getText(0,g-(b.start+d))),a.join("");a.push(b._model.getText());l=b.end;d+=p-(b.end-b.start)}a.push(h.getText(l,g-d))}else{for(;e<f.length;e++)b=f[e],a.push(h.getText(l,b.start)),a.push(b._model.getText()),l=b.end;a.push(h.getText(l))}return a.join("")},_onChanged:function(k){k=this._change;var g=k.baseStart,h=k.baseEnd,f,d,a=this._projections;for(f=0;f<a.length&&!(d=a[f],d.end>g);f++);var e=f;for(f=0;f<a.length&&!(d=a[f],d.start>=h);f++);var b=f,p=this._model,g=k.baseText.length-
(h-g);for(f=b;f<a.length;f++)d=a[f],d.start+=g,d.end+=g,d._lineIndex=p.getLineAtOffset(d.start);d=a.splice(e,b-e);for(f=0;f<d.length;f++)d[f].annotation&&d[f].annotation._expand();this.onChanged({type:"Changed",start:k.start,removedCharCount:k.removedCharCount,addedCharCount:k.addedCharCount,removedLineCount:k.removedLineCount,addedLineCount:k.addedLineCount});this._change=void 0},_onChanging:function(k){var g=!!this._change,h=this._change||{},f=k.start,d=f+k.removedCharCount;h.baseStart=f;h.baseEnd=
d;h.baseText=k.text;h.addedLineCount=k.addedLineCount;if(!g){this._change=h;h.text=k.text;var a=this._projections,e,b,p;k=function(d){for(e=b=0;b<a.length;b++){p=a[b];if(p.start>d)break;if(p.end>d)return-1;e+=p._model.getCharCount()-(p.end-p.start)}return d+e};h.start=k(f);-1===h.start&&(h.text=this._model.getText(p.start,f)+h.text,h.addedLineCount+=this._model.getLineAtOffset(f)-this._model.getLineAtOffset(p.start),h.start=p.start+e);h.end=k(d);-1===h.end&&(h.text+=this._model.getText(d,p.end),h.addedLineCount+=
this._model.getLineAtOffset(p.end)-this._model.getLineAtOffset(d),h.end=p.start+e)}h.addedCharCount=h.text.length;h.removedCharCount=h.end-h.start;h.removedLineCount=this.getLineAtOffset(h.end)-this.getLineAtOffset(h.start);this.onChanging({type:"Changing",text:h.text,start:h.start,removedCharCount:h.removedCharCount,addedCharCount:h.addedCharCount,removedLineCount:h.removedLineCount,addedLineCount:h.addedLineCount})},onChanging:function(k){return this.dispatchEvent(k)},onChanged:function(k){return this.dispatchEvent(k)},
setLineDelimiter:function(k){this._model.setLineDelimiter(k)},setText:function(k,g,h){function f(f){for(a=e=0;e<d.length;e++){b=d[e];if(b.start>f-a)break;var g=b._model.getCharCount();if(b.start+g>f-a)return-1;a+=g-(b.end-b.start)}return f-a}this._change={text:k||"",start:g||0,end:void 0===h?this.getCharCount():h};var d=this._projections,a,e,b,p,l;k=f(this._change.start);-1===k&&(p={projection:b,start:this._change.start-(b.start+a)},k=b.end);g=f(this._change.end);-1===g&&(l={projection:b,end:this._change.end-
(b.start+a)},g=b.start);p&&l&&p.projection===l.projection?b._model.setText(this._change.text,p.start,l.end):(this._model.setText(this._change.text,k,g),p&&(b=p.projection,b._model.setText("",p.start)),l&&(b=l.projection,b._model.setText("",0,l.end),b.start=b.end,b._lineCount=0));this._change=void 0}};n.EventTarget.addMixin(m.prototype);return{ProjectionTextModel:m}});
define("orion/editor/tooltip","i18n!orion/editor/nls/messages orion/editor/textView orion/editor/textModel orion/editor/projectionTextModel orion/editor/util orion/util".split(" "),function(l,n,m,k,g,h){function f(d){this._view=d;this._fadeDelay=500;this._hideDelay=200;this._showDelay=500;this._autoHideDelay=5E3;this._create(d.getOptions("parent").ownerDocument)}f.getTooltip=function(d){d._tooltip||(d._tooltip=new f(d));return d._tooltip};f.prototype={_create:function(d){if(!this._tooltipDiv){var a=
this._tooltipDiv=h.createElement(d,"div");a.tabIndex=0;a.className="textviewTooltip";a.setAttribute("aria-live","assertive");a.setAttribute("aria-atomic","true");var e=this._tooltipContents=h.createElement(d,"div");a.appendChild(e);d.body.appendChild(a);var b=this;g.addEventListener(a,"mouseover",function(a){b._hideDelay&&(a=b._getWindow(),b._delayedHideTimeout&&(a.clearTimeout(b._delayedHideTimeout),b._delayedHideTimeout=null),b._hideTimeout&&(a.clearTimeout(b._hideTimeout),b._hideTimeout=null),
b._nextTarget=null)},!1);g.addEventListener(a,"mouseout",function(e){e=e.relatedTarget||e.toElement;!(e===a||b._hasFocus())&&(!e||!g.contains(a,e))&&b._hide()},!1);g.addEventListener(a,"keydown",function(a){27===a.keyCode&&b._hide()},!1);g.addEventListener(d,"mousedown",this._mouseDownHandler=function(e){b.isVisible()&&(g.contains(a,e.target||e.srcElement)||b._hide())},!0);this._view.addEventListener("Destroy",function(){b.destroy()});this._hide()}},_getWindow:function(){var d=this._tooltipDiv.ownerDocument;
return d.defaultView||d.parentWindow},destroy:function(){if(this._tooltipDiv){this._hide();var d=this._tooltipDiv.parentNode;d&&d.removeChild(this._tooltipDiv);g.removeEventListener(this._tooltipDiv.ownerDocument,"mousedown",this._mouseDownHandler,!0);this._tooltipDiv=null}},_hasFocus:function(){var d=this._tooltipDiv;return!d?!1:g.contains(d,d.ownerDocument.activeElement)},hide:function(d){void 0===d&&(d=this._hideDelay);var a=this._getWindow();this._delayedHideTimeout&&(a.clearTimeout(this._delayedHideTimeout),
this._delayedHideTimeout=null);var e=this;d?e._delayedHideTimeout=a.setTimeout(function(){e._delayedHideTimeout=null;e._hide();e.setTarget(e._nextTarget,0)},d):(e._hide(),e.setTarget(e._nextTarget,0))},_hide:function(){var d=this._tooltipDiv;d&&(this._hasFocus()&&this._view.focus(),this._contentsView&&(this._contentsView.destroy(),this._contentsView=null),this._tooltipContents&&(this._tooltipContents.innerHTML=""),d.style.visibility="hidden",d=this._getWindow(),this._showTimeout&&(d.clearTimeout(this._showTimeout),
this._showTimeout=null),this._delayedHideTimeout&&(d.clearTimeout(this._delayedHideTimeout),this._delayedHideTimeout=null),this._hideTimeout&&(d.clearTimeout(this._hideTimeout),this._hideTimeout=null),this._fadeTimeout&&(d.clearInterval(this._fadeTimeout),this._fadeTimeout=null))},isVisible:function(){return this._tooltipDiv&&"visible"===this._tooltipDiv.style.visibility},setTarget:function(d,a,e){if(this.isVisible())this._hasFocus()||(this._nextTarget=d,this.hide(e));else if(this._target=d){var b=
this;d=b._getWindow();b._showTimeout&&(d.clearTimeout(b._showTimeout),b._showTimeout=null);0===a?b.show(!0):b._showTimeout=d.setTimeout(function(){b._showTimeout=null;b.show(!0)},a?a:b._showDelay)}},show:function(d){if(this._target){var a=this._target.getTooltipInfo();if(a){var e=this._tooltipDiv,b=this._tooltipContents;e.style.left=e.style.right=e.style.width=e.style.height=b.style.width=b.style.height="auto";var f=a.contents;f instanceof Array&&(f=this._getAnnotationContents(f));if("string"===typeof f)b.innerHTML=
f;else if(this._isNode(f))b.appendChild(f);else if(f instanceof k.ProjectionTextModel){var g=this._view,h=g.getOptions();h.wrapMode=!1;h.parent=b;var l=h.themeClass;l?((l=l.replace("tooltipTheme",""))&&(l=" "+l),l="tooltipTheme"+l):l="tooltipTheme";h.themeClass=l;h=this._contentsView=new n.TextView(h);h.addEventListener("LineStyle",function(a){g.onLineStyle(a)});h.setModel(f);f=h.computeSize();b.style.width=f.width+"px";b.style.height=f.height+"px";h.resize()}else return;b=e.ownerDocument.documentElement;
"right"===a.anchor?(f=b.clientWidth-a.x,e.style.right=f+"px"):(f=parseInt(this._getNodeStyle(e,"padding-left","0"),10),f+=parseInt(this._getNodeStyle(e,"border-left-width","0"),10),f=a.x-f,e.style.left=f+"px");e.style.maxWidth=b.clientWidth-f-10+"px";f=parseInt(this._getNodeStyle(e,"padding-top","0"),10);f+=parseInt(this._getNodeStyle(e,"border-top-width","0"),10);f=a.y-f;e.style.top=f+"px";e.style.maxHeight=b.clientHeight-f-10+"px";e.style.opacity="1";e.style.visibility="visible";if(d){var m=this,
x=this._getWindow();m._hideTimeout=x.setTimeout(function(){m._hideTimeout=null;var a=parseFloat(m._getNodeStyle(e,"opacity","1"));m._fadeTimeout=x.setInterval(function(){"visible"===e.style.visibility&&0<a?(a-=0.1,e.style.opacity=a):m._hide()},m._fadeDelay/10)},m._autoHideDelay)}}}},_getAnnotationContents:function(d){function a(a,b){var e=y.getLineStart(y.getLineAtOffset(a)),d=y.getLineEnd(y.getLineAtOffset(b),!0);return y.getText(e,d)}function e(b){var e=b.title,d=h.createElement(m,"div");d.className=
"tooltipRow";b.html&&(d.innerHTML=b.html,d.lastChild&&g.addEventListener(d.lastChild,"click",function(a){a=b.start;var e=b.end;x.getBaseModel&&(a=x.mapOffset(a,!0),e=x.mapOffset(e,!0));n.setSelection(a,e,1/3,function(){s._hide()})},!1),d.appendChild(m.createTextNode("\u00a0")));e||(e=a(b.start,b.end));"function"===typeof e&&(e=b.title());if("string"===typeof e){var f=h.createElement(m,"span");f.appendChild(m.createTextNode(e));e=f}d.appendChild(e);return d}for(var b,f=[],q=0;q<d.length;q++)b=d[q],
""!==b.title&&!b.groupAnnotation&&f.push(b);d=f;if(0===d.length)return null;var s=this,m=this._tooltipDiv.ownerDocument,n=this._view,x=n.getModel(),y=x.getBaseModel?x.getBaseModel():x;if(1===d.length){b=d[0];if(void 0!==b.title)return b=e(b),b.firstChild&&((d=b.firstChild.className)&&(d+=" "),b.firstChild.className=d+"single"),b;d=new k.ProjectionTextModel(y);f=y.getLineStart(y.getLineAtOffset(b.start));q=y.getCharCount();b.end!==q&&d.addProjection({start:b.end,end:q});0<f&&d.addProjection({start:0,
end:f});return d}f=h.createElement(m,"div");b=h.createElement(m,"em");b.appendChild(m.createTextNode(l.multipleAnnotations));f.appendChild(b);for(q=0;q<d.length;q++)b=d[q],(b=e(b))&&f.appendChild(b);return f},_getNodeStyle:function(d,a,e){var b;if(d&&(b=d.style[a],!b))if(d.currentStyle){for(b=0;-1!==(b=a.indexOf("-",b));)a=a.substring(0,b)+a.substring(b+1,b+2).toUpperCase()+a.substring(b+2);b=d.currentStyle[a]}else b=(d=d.ownerDocument.defaultView.getComputedStyle(d,null))?d.getPropertyValue(a):null;
return b||e},_isNode:function(d){return"object"===typeof Node?d instanceof Node:d&&"object"===typeof d&&"number"===typeof d.nodeType&&"string"===typeof d.nodeName}};return{Tooltip:f}});
define("orion/editor/annotations",["i18n!orion/editor/nls/messages","orion/editor/eventTarget"],function(l,n){function m(){}function k(a,e,d){this.start=a;this.end=e;this._projectionModel=d;this.html=this._expandedHTML;this.style=this._expandedStyle;this.expanded=!0}function g(a,e){var d=a.lastIndexOf("."),d=a.substring(d+1),f={title:l[d],style:{styleClass:"annotation "+d},html:"\x3cdiv class\x3d'annotationHTML "+d+"'\x3e\x3c/div\x3e",overviewStyle:{styleClass:"annotationOverview "+d}};e?f.lineStyle=
{styleClass:"annotationLine "+d}:f.rangeStyle={styleClass:"annotationRange "+d};m.registerType(a,f)}function h(){}function f(a,e,d,f,g){var h;void 0===f&&(f=-1);void 0===g&&(g=a.length);for(;1<g-f;)if(h=Math.floor((g+f)/2),e<=a[h].start)g=h;else if(d&&e<a[h].end){g=h;break}else f=h;return g}function d(a){this._annotations=[];var e=this;this._listener={onChanged:function(a){e._onChanged(a)}};this.setTextModel(a)}function a(a,e){this._view=a;this._annotationModel=e;var d=this;this._listener={onDestroy:function(a){d._onDestroy(a)},
onLineStyle:function(a){d._onLineStyle(a)},onChanged:function(a){d._onAnnotationModelChanged(a)}};a.addEventListener("Destroy",this._listener.onDestroy);a.addEventListener("postLineStyle",this._listener.onLineStyle);e.addEventListener("Changed",this._listener.onChanged)}k.prototype={_expandedHTML:"\x3cdiv class\x3d'annotationHTML expanded'\x3e\x3c/div\x3e",_expandedStyle:{styleClass:"annotation expanded"},_collapsedHTML:"\x3cdiv class\x3d'annotationHTML collapsed'\x3e\x3c/div\x3e",_collapsedStyle:{styleClass:"annotation collapsed"},
_collapse:function(){if(!this.expanded)return!1;this.expanded=!1;this.html=this._collapsedHTML;this.style=this._collapsedStyle;this._annotationModel&&this._annotationModel.modifyAnnotation(this);return!0},_expand:function(){if(this.expanded)return!1;this.expanded=!0;this.html=this._expandedHTML;this.style=this._expandedStyle;this._annotationModel&&this._annotationModel.modifyAnnotation(this);return!0},_collapseImpl:function(a){if(this._collapse()){a&&this._forEachOverlaping(function(a){a.expanded||
(a._expandImpl(!1),a._recollapse=!0)});a=this._projectionModel;var e=a.getBaseModel();this._projection={annotation:this,start:e.getLineStart(e.getLineAtOffset(this.start)+1),end:e.getLineEnd(e.getLineAtOffset(this.end),!0)};a.addProjection(this._projection)}},_expandImpl:function(a){this._expand()&&(this._projectionModel._removeProjection(this._projection,!this._annotationModel),a&&this._forEachOverlaping(function(a){a._recollapse&&(a._collapseImpl(!1),a._recollapse=!1)}))},_forEachOverlaping:function(a){if(this._annotationModel)for(var e=
this._annotationModel.getAnnotations(this.start,this.end);e.hasNext();){var d=e.next();d!==this&&d.type===m.ANNOTATION_FOLDING&&a.call(this,d)}},collapse:function(){this._recollapse=!1;this._collapseImpl(!0)},expand:function(){this._recollapse=!1;this._expandImpl(!0)}};m.ANNOTATION_ERROR="orion.annotation.error";m.ANNOTATION_WARNING="orion.annotation.warning";m.ANNOTATION_TASK="orion.annotation.task";m.ANNOTATION_BREAKPOINT="orion.annotation.breakpoint";m.ANNOTATION_BOOKMARK="orion.annotation.bookmark";
m.ANNOTATION_FOLDING="orion.annotation.folding";m.ANNOTATION_CURRENT_BRACKET="orion.annotation.currentBracket";m.ANNOTATION_MATCHING_BRACKET="orion.annotation.matchingBracket";m.ANNOTATION_CURRENT_LINE="orion.annotation.currentLine";m.ANNOTATION_CURRENT_SEARCH="orion.annotation.currentSearch";m.ANNOTATION_MATCHING_SEARCH="orion.annotation.matchingSearch";m.ANNOTATION_READ_OCCURRENCE="orion.annotation.readOccurrence";m.ANNOTATION_WRITE_OCCURRENCE="orion.annotation.writeOccurrence";m.ANNOTATION_SELECTED_LINKED_GROUP=
"orion.annotation.selectedLinkedGroup";m.ANNOTATION_CURRENT_LINKED_GROUP="orion.annotation.currentLinkedGroup";m.ANNOTATION_LINKED_GROUP="orion.annotation.linkedGroup";m.ANNOTATION_BLAME="orion.annotation.blame";m.ANNOTATION_CURRENT_BLAME="orion.annotation.currentBlame";var e={};m.registerType=function(a,d){var f=d;"function"!==typeof f&&(f=function(a,b,e){this.start=a;this.end=b;void 0!==e&&(this.title=e)},f.prototype=d);f.prototype.type=a;e[a]=f;return a};m.createAnnotation=function(a,e,d,f){return new (this.getType(a))(e,
d,f)};m.getType=function(a){return e[a]};g(m.ANNOTATION_ERROR);g(m.ANNOTATION_WARNING);g(m.ANNOTATION_TASK);g(m.ANNOTATION_BREAKPOINT);g(m.ANNOTATION_BOOKMARK);g(m.ANNOTATION_CURRENT_BRACKET);g(m.ANNOTATION_MATCHING_BRACKET);g(m.ANNOTATION_CURRENT_SEARCH);g(m.ANNOTATION_MATCHING_SEARCH);g(m.ANNOTATION_READ_OCCURRENCE);g(m.ANNOTATION_WRITE_OCCURRENCE);g(m.ANNOTATION_SELECTED_LINKED_GROUP);g(m.ANNOTATION_CURRENT_LINKED_GROUP);g(m.ANNOTATION_LINKED_GROUP);g(m.ANNOTATION_CURRENT_LINE,!0);g(m.ANNOTATION_BLAME,
!0);g(m.ANNOTATION_CURRENT_BLAME,!0);m.registerType(m.ANNOTATION_FOLDING,k);h.addMixin=function(a){var e=h.prototype,d;for(d in e)e.hasOwnProperty(d)&&(a[d]=e[d])};h.prototype={addAnnotationType:function(a,e){this._annotationTypes||(this._annotationTypes=[]);var d=e-1;void 0==e||!(0<=d&&d<this._annotationTypes.length)?this._annotationTypes.push(a):this._annotationTypes.splice(d,0,a)},getAnnotationTypePriority:function(a){if(this._annotationTypes)for(var e=0;e<this._annotationTypes.length;e++)if(this._annotationTypes[e]===
a)return e+1;return 0},getAnnotationsByType:function(a,e,d){a=a.getAnnotations(e,d);for(d=[];a.hasNext();)e=a.next(),0!==this.getAnnotationTypePriority(e.type)&&d.push(e);var f=this;d.sort(function(a,b){return f.getAnnotationTypePriority(a.type)-f.getAnnotationTypePriority(b.type)});return d},isAnnotationTypeVisible:function(a){return 0!==this.getAnnotationTypePriority(a)},removeAnnotationType:function(a){if(this._annotationTypes)for(var e=0;e<this._annotationTypes.length;e++)if(this._annotationTypes[e]===
a){this._annotationTypes.splice(e,1);break}}};d.prototype={addAnnotation:function(a){if(a){var e=this._annotations,d=f(e,a.start);e.splice(d,0,a);a._annotationModel=this;this.onChanged({type:"Changed",added:[a],removed:[],changed:[]})}},getTextModel:function(){return this._model},getAnnotations:function(a,e){var d=this._annotations,f,g=0,h;h=void 0===a&&void 0===e?function(){return g<d.length?d[g++]:null}:function(){for(;g<d.length;){var f=d[g++];if(a===f.start||(a>f.start?a<f.end:f.start<e))return f;
if(f.start>=e)break}return null};f=h();return{next:function(){var a=f;a&&(f=h());return a},hasNext:function(){return null!==f}}},modifyAnnotation:function(a){if(a&&!(0>this._getAnnotationIndex(a)))this.onChanged({type:"Changed",added:[],removed:[],changed:[a]})},onChanged:function(a){return this.dispatchEvent(a)},removeAnnotations:function(a){var e=this._annotations,d,f;if(a){d=[];for(f=e.length-1;0<=f;f--){var g=e[f];g.type===a&&(e.splice(f,1),d.splice(0,0,g),g._annotationModel=null)}}else d=e;this.onChanged({type:"Changed",
removed:d,added:[],changed:[]})},removeAnnotation:function(a){if(a){var e=this._getAnnotationIndex(a);0>e||(a._annotationModel=null,a={type:"Changed",removed:this._annotations.splice(e,1),added:[],changed:[]},this.onChanged(a))}},replaceAnnotations:function(a,e){var d=this._annotations,g,h,k,l=[];if(a)for(g=a.length-1;0<=g;g--)k=a[g],h=this._getAnnotationIndex(k),0>h||(k._annotationModel=null,d.splice(h,1),l.splice(0,0,k));e||(e=[]);for(g=0;g<e.length;g++)k=e[g],h=f(d,k.start),k._annotationModel=
this,d.splice(h,0,k);this.onChanged({type:"Changed",removed:l,added:e,changed:[]})},setTextModel:function(a){this._model&&this._model.removeEventListener("Changed",this._listener.onChanged);(this._model=a)&&this._model.addEventListener("Changed",this._listener.onChanged)},_getAnnotationIndex:function(a){for(var e=this._annotations,d=f(e,a.start);d<e.length&&e[d].start===a.start;){if(e[d]===a)return d;d++}return-1},_onChanged:function(a){var e=a.start,d=a.addedCharCount,f=a.removedCharCount,g=this._annotations,
h=e+f;if(0<g.length){a={type:"Changed",added:[],removed:[],changed:[],textModelChangedEvent:a};d-=f;for(f=0;f<g.length;f++){var k=g[f];k.start>=h?(k._oldStart=k.start,k._oldEnd=k.end,k.start+=d,k.end+=d,a.changed.push(k)):k.end<=e||(k.start<e&&h<k.end?(k._oldStart=k.start,k._oldEnd=k.end,k.end+=d,a.changed.push(k)):(g.splice(f,1),a.removed.push(k),k._annotationModel=null,k.expand&&k.expand(),f--))}if(0<a.added.length||0<a.removed.length||0<a.changed.length)this.onChanged(a)}}};n.EventTarget.addMixin(d.prototype);
a.prototype={destroy:function(){var a=this._view;a&&(a.removeEventListener("Destroy",this._listener.onDestroy),a.removeEventListener("LineStyle",this._listener.onLineStyle),this.view=null);(a=this._annotationModel)&&a.removeEventListener("Changed",this._listener.onChanged)},_mergeStyle:function(a,e){if(e){a||(a={});a.styleClass=a.styleClass&&e.styleClass&&a.styleClass!==e.styleClass?a.styleClass+(" "+e.styleClass):e.styleClass;var d;e.tagName&&!a.tagName&&(a.tagName=e.tagName);if(e.style)for(d in a.style||
(a.style={}),e.style)a.style[d]||(a.style[d]=e.style[d]);if(e.attributes)for(d in a.attributes||(a.attributes={}),e.attributes)a.attributes[d]||(a.attributes[d]=e.attributes[d])}return a},_mergeStyleRanges:function(a,e){a||(a=[]);for(var d,g=f(a,e.start,!0);g<a.length&&e;g++){var h=a[g];if(e.end<=h.start)break;if(!(e.start>=h.end)){d=this._mergeStyle({},h.style);d=this._mergeStyle(d,e.style);var k=[];k.push(g,1);e.start<h.start&&k.push({start:e.start,end:h.start,style:e.style});e.start>h.start&&k.push({start:h.start,
end:e.start,style:h.style});k.push({start:Math.max(h.start,e.start),end:Math.min(h.end,e.end),style:d});e.end<h.end&&k.push({start:e.end,end:h.end,style:h.style});e=e.end>h.end?{start:h.end,end:e.end,style:e.style}:null;Array.prototype.splice.apply(a,k)}}e&&(d=this._mergeStyle({},e.style),a.splice(g,0,{start:e.start,end:e.end,style:d}));return a},_onAnnotationModelChanged:function(a){function e(a,b){h.getBaseModel&&(a=h.mapOffset(a,!0),b=h.mapOffset(b,!0));-1!==a&&-1!==b&&f.redrawRange(a,b)}function d(a,
b){for(var f=0;f<a.length;f++)if(g.isAnnotationTypeVisible(a[f].type)){var h=a[f];e(h.start,h.end);b&&(void 0!==h._oldStart&&h._oldEnd)&&e(h._oldStart,h._oldEnd)}}var f=this._view;if(f){var g=this,h=f.getModel();d(a.added);d(a.removed);d(a.changed,!0)}},_onDestroy:function(a){this.destroy()},_onLineStyle:function(a){var e=this._annotationModel,d=a.textView.getModel(),f=e.getTextModel(),g=a.lineStart,h=a.lineStart+a.lineText.length;f!==d&&(g=d.mapOffset(g),h=d.mapOffset(h));for(e=e.getAnnotations(g,
h);e.hasNext();)if(g=e.next(),this.isAnnotationTypeVisible(g.type)){if(g.rangeStyle){var h=g.start,k=g.end;f!==d&&(h=d.mapOffset(h,!0),k=d.mapOffset(k,!0));a.ranges=this._mergeStyleRanges(a.ranges,{start:h,end:k,style:g.rangeStyle})}g.lineStyle&&(a.style=this._mergeStyle({},a.style),a.style=this._mergeStyle(a.style,g.lineStyle))}}};h.addMixin(a.prototype);return{FoldingAnnotation:k,AnnotationType:m,AnnotationTypeList:h,AnnotationModel:d,AnnotationStyler:a}});
define("orion/editor/editor","i18n!orion/editor/nls/messages orion/editor/eventTarget orion/editor/tooltip orion/editor/annotations orion/objects orion/util".split(" "),function(l,n,m,k,g,h){function f(a){a=a||{};this._domNode=a.domNode;this._model=a.model;this._undoStack=a.undoStack;this._statusReporter=a.statusReporter;this._title=null;var b=this;this._listener={onChanged:function(a){b.onChanged(a)}};this._model&&this._model.addEventListener("Changed",this._listener.onChanged);this.checkDirty()}
function d(a){a=a||{};f.call(this,a);this._textViewFactory=a.textViewFactory;this._undoStackFactory=a.undoStackFactory;this._textDNDFactory=a.textDNDFactory;this._annotationFactory=a.annotationFactory;this._foldingRulerFactory=a.foldingRulerFactory;this._lineNumberRulerFactory=a.lineNumberRulerFactory;this._contentAssistFactory=a.contentAssistFactory;this._keyBindingFactory=a.keyBindingFactory;this._contentAssist=this._foldingRuler=this._overviewRuler=this._lineNumberRuler=this._annotationRuler=this._annotationModel=
this._annotationStyler=null}var a=k.AnnotationType;f.prototype={destroy:function(){this.uninstall();this._statusReporter=this._domNode=null;this._model&&this._model.removeEventListener("Changed",this._listener.onChanged)},checkDirty:function(){this.setDirty(this._undoStack&&!this._undoStack.isClean())},focus:function(){},getModel:function(){return this._model},getText:function(a,b){return this.getModel().getText(a,b)},getTitle:function(){return this._title},getUndoStack:function(){return this._undoStack},
install:function(){this.installed=!0},isDirty:function(){return this._dirty},markClean:function(){this.getUndoStack().markClean();this.setDirty(!1)},onDirtyChanged:function(a){return this.dispatchEvent(a)},onInputChanged:function(a){return this.dispatchEvent(a)},onChanged:function(a){this.checkDirty()},reportStatus:function(a,b,d){this._statusReporter&&this._statusReporter(a,b,d)},resize:function(){},setDirty:function(a){this._dirty!==a&&(this._dirty=a,this.onDirtyChanged({type:"DirtyChanged"}))},
_setModelText:function(a){this._model&&this._model.setText(a)},setInput:function(a,b,d,f){this._title=a;f||(b?this.reportStatus(b,"error"):null!==d&&(void 0!==d&&"string"===typeof d)&&this._setModelText(d),this._undoStack&&this._undoStack.reset());this.checkDirty();this.onInputChanged({type:"InputChanged",title:a,message:b,contents:d,contentsSaved:f})},setText:function(a,b,d){this.getModel().setText(a,b,d)},uninstall:function(){this.installed=!1}};n.EventTarget.addMixin(f.prototype);d.prototype=new f;
g.mixin(d.prototype,{destroy:function(){f.prototype.destroy.call(this);this._textViewFactory=this._undoStackFactory=this._textDNDFactory=this._annotationFactory=this._foldingRulerFactory=this._lineNumberRulerFactory=this._contentAssistFactory=this._keyBindingFactory=null},getAnnotationModel:function(){return this._annotationModel},getAnnotationRuler:function(){return this._annotationRuler},getAnnotationStyler:function(){return this._annotationStyler},getContentAssist:function(){return this._contentAssist},
getFoldingRuler:function(){return this._foldingRuler},getLineNumberRuler:function(){return this._lineNumberRuler},getModel:function(){if(!this._textView)return null;var a=this._textView.getModel();a.getBaseModel&&(a=a.getBaseModel());return a},getOverviewRuler:function(){return this._overviewRuler},getTextView:function(){return this._textView},getKeyModes:function(){return this._textView.getKeyModes()},getSourceCodeActions:function(){return this._sourceCodeActions},getLinkedMode:function(){return this._linkedMode},
getTextActions:function(){return this._textActions},focus:function(){this._textView&&this._textView.focus()},resize:function(){this._textView&&this._textView.resize()},setAnnotationRulerVisible:function(a,b){if(this._annotationRulerVisible!==a||b)if(this._annotationRulerVisible=a,this._annotationRuler){var d=this._textView;a?d.addRuler(this._annotationRuler,0):d.removeRuler(this._annotationRuler)}},setFoldingRulerVisible:function(a,b){if(this._foldingRulerVisible!==a||b)if(this._foldingRulerVisible=
a,this._foldingRuler){var d=this._textView;d.getModel().getBaseModel&&(a?d.addRuler(this._foldingRuler):d.removeRuler(this._foldingRuler))}},setLineNumberRulerVisible:function(a,b){if(this._lineNumberRulerVisible!==a||b)if(this._lineNumberRulerVisible=a,this._lineNumberRuler){var d=this._textView;a?d.addRuler(this._lineNumberRuler,!this._annotationRulerVisible?0:1):d.removeRuler(this._lineNumberRuler)}},setOverviewRulerVisible:function(a,b){if(this._overviewRulerVisible!==a||b)if(this._overviewRulerVisible=
a,this._overviewRuler){var d=this._textView;a?d.addRuler(this._overviewRuler):d.removeRuler(this._overviewRuler)}},mapOffset:function(a,b){var d=this._textView.getModel();d.getBaseModel&&(a=d.mapOffset(a,b));return a},getLineAtOffset:function(a){return this.getModel().getLineAtOffset(this.mapOffset(a))},getLineStart:function(a){return this.getModel().getLineStart(a)},getCaretOffset:function(){return this.mapOffset(this._textView.getCaretOffset())},getSelection:function(){var a=this._textView,b=a.getSelection(),
a=a.getModel();a.getBaseModel&&(b.start=a.mapOffset(b.start),b.end=a.mapOffset(b.end));return b},_expandOffset:function(e){var b=this._textView.getModel(),d=this._annotationModel;if(d&&b.getBaseModel)for(e=d.getAnnotations(e,e+1);e.hasNext();)b=e.next(),b.type===a.ANNOTATION_FOLDING&&b.expand&&b.expand()},setCaretOffset:function(a,b,d){var f=this._textView,g=f.getModel();g.getBaseModel&&(this._expandOffset(a),a=g.mapOffset(a,!0));f.setCaretOffset(a,b,d)},setText:function(a,b,d){var f=this._textView,
g=f.getModel();g.getBaseModel&&(void 0!==b&&(this._expandOffset(b),b=g.mapOffset(b,!0)),void 0!==d&&(this._expandOffset(d),d=g.mapOffset(d,!0)));f.setText(a,b,d)},setSelection:function(a,b,d,f){var g=this._textView,h=g.getModel();h.getBaseModel&&(this._expandOffset(a),this._expandOffset(b),a=h.mapOffset(a,!0),b=h.mapOffset(b,!0));g.setSelection(a,b,d,f)},moveSelection:function(a,b,d,f){var g=this._textView;this.setSelection(a,b||a,1/3,function(){(void 0===f||f)&&g.focus();d&&d()})},_getTooltipInfo:function(a,
b){var d=this._textView,f=this.getAnnotationModel();if(!f)return null;var g=this._annotationStyler;if(!g)return null;var h=d.getOffsetAtLocation(a,b);if(-1===h)return null;h=this.mapOffset(h);g=g.getAnnotationsByType(f,h,h+1);f=[];for(h=0;h<g.length;h++)g[h].rangeStyle&&f.push(g[h]);if(0===f.length)return null;d=d.convert({x:a,y:b},"document","page");return{contents:f,anchor:"left",x:d.x+10,y:d.y+20}},_highlightCurrentLine:function(e,b){var d=this._annotationModel;if(d){var f=this._textView;if(!f.getOptions("singleMode")){var g=
f.getModel(),h=b?g.getLineAtOffset(b.start):-1,k=g.getLineAtOffset(e.start),f=e.start===e.end,l=!b||b.start===b.end,m=g.getLineStart(k),n=g.getLineEnd(k);g.getBaseModel&&(m=g.mapOffset(m),n=g.mapOffset(n));g=this._currentLineAnnotation;if(!(h===k&&l&&f&&g&&g.start===m&&g.end===n)){var h=g?[g]:null,t;f&&(g=a.createAnnotation(a.ANNOTATION_CURRENT_LINE,m,n),t=[g]);this._currentLineAnnotation=g;d.replaceAnnotations(h,t)}}}},installTextView:function(){this.install()},install:function(){if(!this._textView){this._textView=
this._textViewFactory();this._undoStackFactory&&(this._undoStack=this._undoStackFactory.createUndoStack(this),this.checkDirty());this._textDNDFactory&&(this._textDND=this._textDNDFactory.createTextDND(this,this._undoStack));this._contentAssistFactory&&(this._contentAssist=this._contentAssistFactory.createContentAssistMode(this).getContentAssist());var e=this,b=this._textView,d=this;this._listener={onModelChanged:function(a){d.checkDirty()},onMouseOver:function(a){d._listener.onMouseMove(a)},onMouseMove:function(a){var e=
m.Tooltip.getTooltip(b);e&&!(d._listener.lastMouseX===a.event.clientX&&d._listener.lastMouseY===a.event.clientY)&&(d._listener.lastMouseX=a.event.clientX,d._listener.lastMouseY=a.event.clientY,e.setTarget({x:a.x,y:a.y,getTooltipInfo:function(){return d._getTooltipInfo(this.x,this.y)}}))},onMouseOut:function(a){var e=m.Tooltip.getTooltip(b);e&&!(d._listener.lastMouseX===a.event.clientX&&d._listener.lastMouseY===a.event.clientY)&&(d._listener.lastMouseX=a.event.clientX,d._listener.lastMouseY=a.event.clientY,
e.setTarget(null))},onScroll:function(a){(a=m.Tooltip.getTooltip(b))&&a.setTarget(null,0,0)},onSelection:function(a){d._updateCursorStatus();d._highlightCurrentLine(a.newValue,a.oldValue)}};b.addEventListener("ModelChanged",this._listener.onModelChanged);b.addEventListener("Selection",this._listener.onSelection);b.addEventListener("MouseOver",this._listener.onMouseOver);b.addEventListener("MouseOut",this._listener.onMouseOut);b.addEventListener("MouseMove",this._listener.onMouseMove);b.addEventListener("Scroll",
this._listener.onScroll);if(this._keyBindingFactory){var g;if(g="function"===typeof this._keyBindingFactory?this._keyBindingFactory(this,this.getKeyModes(),this._undoStack,this._contentAssist):this._keyBindingFactory.createKeyBindings(e,this._undoStack,this._contentAssist))this._textActions=g.textActions,this._linkedMode=g.linkedMode,this._sourceCodeActions=g.sourceCodeActions}g=function(b,d){if(void 0!==b&&-1!==b){for(var f=this.getView().getModel(),g=this.getAnnotationModel(),h=e.mapOffset(f.getLineStart(b)),
f=e.mapOffset(f.getLineEnd(b)),p=g.getAnnotations(h,f),k=null;p.hasNext();){var l=p.next();if(l.type===a.ANNOTATION_BOOKMARK){k=l;break}}k?g.removeAnnotation(k):(k=a.createAnnotation(a.ANNOTATION_BOOKMARK,h,f),k.title=void 0,g.addAnnotation(k))}};if(this._annotationFactory){var h=b.getModel();h.getBaseModel&&(h=h.getBaseModel());if(this._annotationModel=this._annotationFactory.createAnnotationModel(h))if(h=this._annotationStyler=this._annotationFactory.createAnnotationStyler(b,this._annotationModel))h.addAnnotationType(a.ANNOTATION_CURRENT_SEARCH),
h.addAnnotationType(a.ANNOTATION_MATCHING_SEARCH),h.addAnnotationType(a.ANNOTATION_ERROR),h.addAnnotationType(a.ANNOTATION_WARNING),h.addAnnotationType(a.ANNOTATION_MATCHING_BRACKET),h.addAnnotationType(a.ANNOTATION_CURRENT_BRACKET),h.addAnnotationType(a.ANNOTATION_CURRENT_LINE),h.addAnnotationType(a.ANNOTATION_READ_OCCURRENCE),h.addAnnotationType(a.ANNOTATION_WRITE_OCCURRENCE),h.addAnnotationType(a.ANNOTATION_SELECTED_LINKED_GROUP),h.addAnnotationType(a.ANNOTATION_CURRENT_LINKED_GROUP),h.addAnnotationType(a.ANNOTATION_LINKED_GROUP),
h.addAnnotationType("orion.annotation.highlightError");var h=this._annotationFactory.createAnnotationRulers(this._annotationModel),k=this._annotationRuler=h.annotationRuler;k&&(k.onDblClick=g,k.setMultiAnnotationOverlay({html:"\x3cdiv class\x3d'annotationHTML overlay'\x3e\x3c/div\x3e"}),k.addAnnotationType(a.ANNOTATION_ERROR),k.addAnnotationType(a.ANNOTATION_WARNING),k.addAnnotationType(a.ANNOTATION_TASK),k.addAnnotationType(a.ANNOTATION_BOOKMARK));this.setAnnotationRulerVisible(this._annotationRulerVisible||
void 0===this._annotationRulerVisible,!0);if(k=this._overviewRuler=h.overviewRuler)k.addAnnotationType(a.ANNOTATION_CURRENT_SEARCH),k.addAnnotationType(a.ANNOTATION_MATCHING_SEARCH),k.addAnnotationType(a.ANNOTATION_READ_OCCURRENCE),k.addAnnotationType(a.ANNOTATION_WRITE_OCCURRENCE),k.addAnnotationType(a.ANNOTATION_CURRENT_BLAME),k.addAnnotationType(a.ANNOTATION_ERROR),k.addAnnotationType(a.ANNOTATION_WARNING),k.addAnnotationType(a.ANNOTATION_TASK),k.addAnnotationType(a.ANNOTATION_BOOKMARK),k.addAnnotationType(a.ANNOTATION_MATCHING_BRACKET),
k.addAnnotationType(a.ANNOTATION_CURRENT_BRACKET),k.addAnnotationType(a.ANNOTATION_CURRENT_LINE);this.setOverviewRulerVisible(this._overviewRulerVisible||void 0===this._overviewRulerVisible,!0)}this._lineNumberRulerFactory&&(this._lineNumberRuler=this._lineNumberRulerFactory.createLineNumberRuler(this._annotationModel),this._lineNumberRuler.addAnnotationType(a.ANNOTATION_CURRENT_BLAME),this._lineNumberRuler.addAnnotationType(a.ANNOTATION_BLAME),this._lineNumberRuler.onDblClick=g,this.setLineNumberRulerVisible(this._lineNumberRulerVisible||
void 0===this._lineNumberRulerVisible,!0));this._foldingRulerFactory&&(this._foldingRuler=this._foldingRulerFactory.createFoldingRuler(this._annotationModel),this._foldingRuler.addAnnotationType(a.ANNOTATION_FOLDING),this.setFoldingRulerVisible(this._foldingRulerVisible||void 0===this._foldingRulerVisible,!0));this.dispatchEvent({type:"TextViewInstalled",textView:b});f.prototype.install.call(this)}},uninstallTextView:function(){this.uninstall()},uninstall:function(){var a=this._textView;a&&(a.destroy(),
this._annotationModel&&this._annotationModel.setTextModel(null),this._textView=this._undoStack=this._textDND=this._contentAssist=this._listener=this._annotationModel=this._annotationStyler=this._annotationRuler=this._overviewRuler=this._lineNumberRuler=this._foldingRuler=this._currentLineAnnotation=this._title=null,this._dirty=!1,this._foldingRulerVisible=this._overviewRulerVisible=this._lineNumberRulerVisible=this._annotationRulerVisible=void 0,this.dispatchEvent({type:"TextViewUninstalled",textView:a}),
f.prototype.uninstall.call(this))},_updateCursorStatus:function(){for(var a=this.getModel(),b=this.getCaretOffset(),d=a.getLineAtOffset(b),a=a.getLineStart(d),b=b-a,a=this.getKeyModes(),f=0;f<a.length;f++){var g=a[f];if(g.isActive()&&g.isStatusActive&&g.isStatusActive())return}this.reportStatus(h.formatMessage(l.lineColumn,d+1,b+1))},showAnnotations:function(e,b,d,f){var g=this._annotationModel;if(g){for(var h=[],k=[],l=g.getTextModel(),m=g.getAnnotations(),n;m.hasNext();)n=m.next(),-1!==b.indexOf(n.type)&&
n.creatorID===this&&h.push(n);if(e)for(b=0;b<e.length;b++)if(n=e[b]){if(d)n=d(n);else{var t;"number"===typeof n.line?(t=l.getLineStart(n.line-1),m=t+n.start-1,t=t+n.end-1):(m=n.start,t=n.end);var z=f(n);if(!z)continue;n=a.createAnnotation(z,m,t,n.description)}n.creatorID=this;k.push(n)}g.replaceAnnotations(h,k)}},showProblems:function(e){this.showAnnotations(e,[a.ANNOTATION_ERROR,a.ANNOTATION_WARNING,a.ANNOTATION_TASK],null,function(b){switch(b.severity){case "error":return a.ANNOTATION_ERROR;case "warning":return a.ANNOTATION_WARNING;
case "task":return a.ANNOTATION_TASK}return null})},showOccurrences:function(e){this.showAnnotations(e,[a.ANNOTATION_READ_OCCURRENCE,a.ANNOTATION_WRITE_OCCURRENCE],null,function(b){return b.readAccess?a.ANNOTATION_READ_OCCURRENCE:a.ANNOTATION_WRITE_OCCURRENCE})},showBlame:function(e){var b=this._blameRGB,d=this.getTextView().getOptions("parent").ownerDocument;if(!b){var f=h.createElement(d,"div");f.className="annotation blame";d.body.appendChild(f);var s=(d.defaultView||d.parentWindow).getComputedStyle(f).getPropertyValue("background-color");
f.parentNode.removeChild(f);var f=s.indexOf("("),m=s.indexOf(")"),s=s.substring(f+1,m);this._blameRGB=b=s.split(",").slice(0,3)}var n=function(){var a=k.AnnotationType.createAnnotation(this.groupType,this.start,this.end,this.title);a.style=g.mixin({},a.style);a.style.style=g.mixin({},a.style.style);a.style.style.backgroundColor="";this.groupAnnotation=a;a.blame=this.blame;a.html=this.html;a.creatorID=this.creatorID;return a},x=function(){var a=h.createElement(d,"div");a.className="tooltipTitle";var b=
this.blame.Message.indexOf("\n");-1===b&&(b=this.blame.Message.length);var e=h.createElement(d,"a");e.href=this.blame.CommitLink;e.appendChild(d.createTextNode(this.blame.Message.substring(0,b)));a.appendChild(e);a.appendChild(h.createElement(d,"br"));a.appendChild(d.createTextNode(h.formatMessage(l.committerOnTime,this.blame.AuthorName,this.blame.Time)));return a},y=this.getModel();this.showAnnotations(e,[a.ANNOTATION_BLAME,a.ANNOTATION_CURRENT_BLAME],function(e){var d=y.getLineStart(e.Start-1),
f=y.getLineEnd(e.End-1,!0),d=k.AnnotationType.createAnnotation(a.ANNOTATION_BLAME,d,f,x),f=b.slice(0);f.push(e.Shade);d.style=g.mixin({},d.style);d.style.style=g.mixin({},d.style.style);d.style.style.backgroundColor="rgba("+f.join()+")";d.groupId=e.Name;d.groupType=a.ANNOTATION_CURRENT_BLAME;d.createGroupAnnotation=n;d.html='\x3cimg class\x3d"annotationHTML blame" src\x3d"'+e.AuthorImage+'"/\x3e';d.blame=e;return d})},showSelection:function(a,b,d,f,g){"number"===typeof a?("number"!==typeof b&&(b=
a),this.moveSelection(a,b)):"number"===typeof d&&(a=this.getModel().getLineStart(d-1),"number"===typeof f&&(a+=f),"number"!==typeof g&&(g=0),this.moveSelection(a,a+g))},_setModelText:function(a){this._textView&&(this._textView.setText(a),this._textView.getModel().setLineDelimiter("auto"),this._highlightCurrentLine(this._textView.getSelection()))},setInput:function(a,b,d,g,h){f.prototype.setInput.call(this,a,b,d,g);this._textView&&(!g&&!h)&&this._textView.focus()},onGotoLine:function(a,b,d,f){if(this._textView){var g=
this.getModel();a=Math.max(0,Math.min(a,g.getLineCount()-1));var h=g.getLineStart(a),k=0;void 0===d&&(d=0);"string"===typeof b?(a=g.getLine(a).indexOf(b),-1!==a&&(k=a,d=k+b.length)):(k=b,b=g.getLineEnd(a)-h,k=Math.min(k,b),d=Math.min(d,b));this.moveSelection(h+k,h+d,f)}}});return{BaseEditor:f,Editor:d}});
define("orion/editor/find","i18n!orion/editor/nls/messages orion/keyBinding orion/editor/keyModes orion/editor/annotations orion/regex orion/objects orion/util".split(" "),function(l,n,m,k,g,h,f){function d(a){var e=a.getTextView();m.KeyMode.call(this,e);this.editor=a;this._active=!1;this._success=!0;this._ignoreSelection=!1;this._prefix="";e.setAction("incrementalFindCancel",function(){this.setActive(!1);return!0}.bind(this));e.setAction("incrementalFindBackspace",function(){return this._backspace()}.bind(this));
var d=this;this._listener={onVerify:function(a){var b=d.editor,e=b.getModel(),f=b.mapOffset(a.start),b=b.mapOffset(a.end),e=e.getText(f,b);if((e=d._prefix.match(RegExp("^"+g.escape(e),"i")))&&0<e.length)d._prefix+=a.text,d._success=!0,d._status(),d.find(d._forward,!0),a.text=null},onSelection:function(){d._ignoreSelection||d.setActive(!1)}}}function a(a,e,d){if(a){this._editor=a;this._undoStack=e;this._showAll=!0;this._visible=!1;this._wrap=this._caseInsensitive=!0;this._wholeWord=!1;this._incremental=
!0;this._regex=!1;this._findAfterReplace=!0;this._reverse=this._hideAfterFind=!1;this._timer=this._end=this._start=void 0;this._lastString="";var f=this;this._listeners={onEditorFocus:function(a){f._removeCurrentAnnotation(a)}};this.setOptions(d)}}var e={};d.prototype=new m.KeyMode;h.mixin(d.prototype,{createKeyBindings:function(){var a=n.KeyBinding,e=[];e.push({actionID:"incrementalFindBackspace",keyBinding:new a(8)});e.push({actionID:"incrementalFindCancel",keyBinding:new a(13)});e.push({actionID:"incrementalFindCancel",
keyBinding:new a(27)});e.push({actionID:"incrementalFindReverse",keyBinding:new a(38)});e.push({actionID:"incrementalFind",keyBinding:new a(40)});e.push({actionID:"incrementalFindReverse",keyBinding:new a("k",!0,!0)});e.push({actionID:"incrementalFind",keyBinding:new a("k",!0)});return e},find:function(a,e){this._forward=a;if(!this.isActive())return this.setActive(!0),!1;var d=this._prefix;if(0===d.length)return!1;var f=this.editor,g=f.getModel(),g=a?this._success?e?this._start:f.getCaretOffset()+
1:0:this._success?e?this._start:f.getCaretOffset():g.getCharCount()-1;(d=f.getModel().find({string:d,start:g,reverse:!a,caseInsensitive:d.toLowerCase()===d}).next())?(e||(this._start=g),this._ignoreSelection=this._success=!0,f.moveSelection(a?d.start:d.end,a?d.end:d.start),this._ignoreSelection=!1):this._success=!1;this._status();return!0},isActive:function(){return this._active},isStatusActive:function(){return this.isActive()},setActive:function(a){this._active!==a&&(this._active=a,this._prefix=
"",this._success=!0,a=this.editor.getTextView(),this._start=this.editor.getCaretOffset(),this.editor.setCaretOffset(this._start),this._active?(a.addEventListener("Verify",this._listener.onVerify),a.addEventListener("Selection",this._listener.onSelection),a.addKeyMode(this)):(a.removeEventListener("Verify",this._listener.onVerify),a.removeEventListener("Selection",this._listener.onSelection),a.removeKeyMode(this)),this._status())},_backspace:function(){var a=this._prefix,a=this._prefix=a.substring(0,
a.length-1);return 0===a.length?(this._ignoreSelection=this._success=!0,this.editor.setCaretOffset(this.editor.getSelection().start),this._ignoreSelection=!1,this._status(),!0):this.find(this._forward,!0)},_status:function(){if(this.isActive()){var a;a=this._forward?this._success?l.incrementalFindStr:l.incrementalFindStrNotFound:this._success?l.incrementalFindReverseStr:l.incrementalFindReverseStrNotFound;a=f.formatMessage(a,this._prefix);this.editor.reportStatus(a,this._success?"":"error")}else this.editor.reportStatus("")}});
e.IncrementalFind=d;a.prototype={find:function(a,e,d){this.setOptions({reverse:!a});var f=this.getFindString(),g;e&&(f=e.findString||f,g=e.count);a=this.getOptions();this.setOptions(e);e=d?this._startOffset:this.getStartOffset();if((g=this._doFind(f,e,g))&&!d)this._startOffset=g.start;this.setOptions(a);this._hideAfterFind&&this.hide();return g},getStartOffset:function(){return void 0!==this._start?this._start:this._reverse?this._editor.getSelection().start-1:this._editor.getCaretOffset()},getFindString:function(){var a=
this._editor.getSelection(),a=this._editor.getText(a.start,a.end);this._regex&&(a=g.escape(a));return a||this._lastString},getOptions:function(){return{showAll:this._showAll,caseInsensitive:this._caseInsensitive,wrap:this._wrap,wholeWord:this._wholeWord,incremental:this._incremental,regex:this._regex,findAfterReplace:this._findAfterReplace,hideAfterFind:this._hideAfterFind,reverse:this._reverse,findCallback:this._findCallback,start:this._start,end:this._end}},getReplaceString:function(){return""},
hide:function(){this._visible=!1;this._savedOptions&&(this.setOptions(this._savedOptions.pop()),0===this._savedOptions.length&&(this._savedOptions=null));this._removeAllAnnotations();var a=this._editor.getTextView();a&&(a.removeEventListener("Focus",this._listeners.onEditorFocus),a.focus())},_processReplaceString:function(a){var e=a;if(this._regex){for(var e="",d=!1,f=this._editor.getModel().getLineDelimiter(),g=0;g<a.length;g++){var h=a.substring(g,g+1);if(d){switch(h){case "R":e+=f;break;case "r":e+=
"\r";break;case "n":e+="\n";break;case "t":e+="\t";break;case "\\":e+="\\";break;default:e+="\\"+h}d=!1}else"\\"===h?d=!0:e+=h}d&&(e+="\\")}return e},isVisible:function(){return this._visible},replace:function(){var a=this.getFindString();if(a){var e=this._editor,d=this._processReplaceString(this.getReplaceString()),f=e.getSelection().start;if(e=e.getModel().find({string:a,start:f,reverse:!1,wrap:this._wrap,regex:this._regex,wholeWord:this._wholeWord,caseInsensitive:this._caseInsensitive}).next())this.startUndo(),
this._doReplace(e.start,e.end,a,d),this.endUndo()}this._findAfterReplace&&a&&this._doFind(a,this.getStartOffset())},replaceAll:function(){var a=this.getFindString();if(a){this._replacingAll=!0;var e=this._editor,d=e.getTextView();e.reportStatus(l.replacingAll);var g=this._processReplaceString(this.getReplaceString()),h=this;window.setTimeout(function(){for(var k=0,m=0;;){var n=h._doFind(a,k,null,!0);if(!n)break;m++;1===m&&(d.setRedraw(!1),h.startUndo());h._doReplace(n.start,n.end,a,g);k=h.getStartOffset()}0<
m&&(h.endUndo(),d.setRedraw(!0));0<k?e.reportStatus(f.formatMessage(l.replacedMatches,m)):e.reportStatus(l.nothingReplaced,"error");h._replacingAll=!1},100)}},setOptions:function(a){if(a){if((!0===a.showAll||!1===a.showAll)&&this._showAll!==a.showAll)if(this._showAll=a.showAll,this.isVisible())if(this._showAll)this._markAllOccurrences();else{var e=this._editor.getAnnotationModel();e&&e.removeAnnotations(k.AnnotationType.ANNOTATION_MATCHING_SEARCH)}if(!0===a.caseInsensitive||!1===a.caseInsensitive)this._caseInsensitive=
a.caseInsensitive;if(!0===a.wrap||!1===a.wrap)this._wrap=a.wrap;if(!0===a.wholeWord||!1===a.wholeWord)this._wholeWord=a.wholeWord;if(!0===a.incremental||!1===a.incremental)this._incremental=a.incremental;if(!0===a.regex||!1===a.regex)this._regex=a.regex;if(!0===a.findAfterReplace||!1===a.findAfterReplace)this._findAfterReplace=a.findAfterReplace;if(!0===a.hideAfterFind||!1===a.hideAfterFind)this._hideAfterFind=a.hideAfterFind;if(!0===a.reverse||!1===a.reverse)this._reverse=a.reverse;a.hasOwnProperty("findCallback")&&
(this._findCallback=a.findCallback);a.hasOwnProperty("start")&&(this._start=a.start);a.hasOwnProperty("end")&&(this._end=a.end)}},show:function(a){this._visible=!0;a&&(this._savedOptions||(this._savedOptions=[]),this._savedOptions.push(this.getOptions()),this.setOptions(a));this._startOffset=this._editor.getSelection().start;this._editor.getTextView().addEventListener("Focus",this._listeners.onEditorFocus);var e=this;window.setTimeout(function(){e._incremental&&e.find(!0,null,!0)},0)},startUndo:function(){this._undoStack&&
this._undoStack.startCompoundChange()},endUndo:function(){this._undoStack&&this._undoStack.endCompoundChange()},_find:function(a,e,d){return this._editor.getModel().find({string:a,start:e,end:this._end,reverse:this._reverse,wrap:d?!1:this._wrap,regex:this._regex,wholeWord:this._wholeWord,caseInsensitive:this._caseInsensitive})},_doFind:function(a,e,d,f){d=d||1;var g=this._editor;if(!a)return this._removeAllAnnotations(),null;this._lastString=a;var h,m;if(this._regex)try{m=this._find(a,e,f)}catch(n){g.reportStatus(n.message,
"error");return}else m=this._find(a,e,f);for(a=0;a<d&&m.hasNext();a++)h=m.next();if(!this._replacingAll){h?this._editor.reportStatus(""):this._editor.reportStatus(l.notFound,"error");if(this.isVisible()){d=k.AnnotationType.ANNOTATION_CURRENT_SEARCH;if(m=g.getAnnotationModel())m.removeAnnotations(d),h&&m.addAnnotation(k.AnnotationType.createAnnotation(d,h.start,h.end));if(this._showAll){this._timer&&window.clearTimeout(this._timer);var r=this;this._timer=window.setTimeout(function(){r._markAllOccurrences();
r._timer=null},500)}}this._findCallback?this._findCallback(h):h&&g.moveSelection(h.start,h.end,null,!1)}return h},_doReplace:function(a,e,d,f){var g=this._editor;this._regex&&(f=g.getText(a,e).replace(RegExp(d,this._caseInsensitive?"i":""),f));g.setText(f,a,e);g.setSelection(a,a+f.length,!0)},_markAllOccurrences:function(){var a=this._editor.getAnnotationModel();if(a){for(var e=k.AnnotationType.ANNOTATION_MATCHING_SEARCH,d=a.getAnnotations(),f=[],g;d.hasNext();){var h=d.next();h.type===e&&f.push(h)}if(this.isVisible()){d=
this.getFindString();d=this._editor.getModel().find({string:d,regex:this._regex,wholeWord:this._wholeWord,caseInsensitive:this._caseInsensitive});for(g=[];d.hasNext();)h=d.next(),g.push(k.AnnotationType.createAnnotation(e,h.start,h.end))}a.replaceAnnotations(f,g)}},_removeAllAnnotations:function(){var a=this._editor.getAnnotationModel();a&&(a.removeAnnotations(k.AnnotationType.ANNOTATION_CURRENT_SEARCH),a.removeAnnotations(k.AnnotationType.ANNOTATION_MATCHING_SEARCH))},_removeCurrentAnnotation:function(a){(a=
this._editor.getAnnotationModel())&&a.removeAnnotations(k.AnnotationType.ANNOTATION_CURRENT_SEARCH)}};e.Find=a;return e});
define("orion/editor/findUI",["i18n!orion/editor/nls/messages","orion/editor/find","orion/objects","orion/editor/util","orion/util"],function(l,n,m,k,g){function h(f,d,a){n.Find.call(this,f,d,a)}h.prototype=new n.Find;m.mixin(h.prototype,{getFindString:function(){var f=this._findInput;return!f?n.Find.prototype.getFindString.call(this):f.value},getReplaceString:function(){var f=this._replaceInput;return!f?n.Find.prototype.getReplaceString(this):f.value},hide:function(){var f=this.isVisible();n.Find.prototype.hide.call(this);
f&&(this._rootDiv.className="textViewFind")},show:function(f){n.Find.prototype.show.call(this,f);var d=f.findString;f=f.replaceString;var a=this._findInput;a||(this._create(),a=this._findInput);d&&(a.value=d);f&&(this._replaceInput.value=f);var e=this;window.setTimeout(function(){e._rootDiv.className="textViewFind show";a.select();a.focus()},0)},_create:function(){var f=this,d=this._editor.getTextView(),a=d.getOptions("parent").ownerDocument,e=g.createElement(a,"div");e.className="textViewFind";k.addEventListener(e,
"keydown",function(a){f._handleKeyDown(a)});this._rootDiv=e;this._createContents(a,e);d._rootDiv.insertBefore(e,d._rootDiv.firstChild)},_createContents:function(f,d){var a=this,e=g.createElement(f,"input");e.className="textViewFindInput";this._findInput=e;e.type="text";e.placeholder=l.findWith;k.addEventListener(e,"input",function(b){return a._handleInput(b)});d.appendChild(e);e=g.createElement(f,"span");a._createButton(f,e,l.next,function(){a.find(!0)});a._createButton(f,e,l.previous,function(){a.find(!1)});
d.appendChild(e);a._editor.getTextView().getOptions("readonly")||(e=g.createElement(f,"input"),e.className="textViewReplaceInput",this._replaceInput=e,e.type="text",e.placeholder=l.replaceWith,d.appendChild(e),e=g.createElement(f,"span"),a._createButton(f,e,l.replace,function(){a.replace()}),a._createButton(f,e,l.replaceAll,function(){a.replaceAll()}),d.appendChild(e));e=g.createElement(f,"span");a._createButton(f,e,l.regex,function(b){a._toggle("regex",b.target)},this._regex,l.regexTooltip);a._createButton(f,
e,l.caseInsensitive,function(b){a._toggle("caseInsensitive",b.target)},this._caseInsensitive,l.caseInsensitiveTooltip);a._createButton(f,e,l.wholeWord,function(b){a._toggle("wholeWord",b.target)},this._wholeWord,l.wholeWordTooltip);d.appendChild(e);e=a._createButton(f,d,"",function(){a.hide()});e.className="textViewFindCloseButton";e.title=l.closeTooltip},_createButton:function(f,d,a,e,b,g){var h=f.createElement("button");this._checked(b,h);g&&(h.title=g);k.addEventListener(h,"click",function(a){e.call(this,
a)},!1);a&&h.appendChild(f.createTextNode(a));d.appendChild(h);return h},_toggle:function(f,d){var a={};a[f]=!this["_"+f];this.setOptions(a);this._checked(a[f],d)},_checked:function(f,d){d.className="textViewFindButton";f&&(d.className+=" checked")},_handleInput:function(){this._incremental&&this.find(!0,null,!0);return!0},_handleKeyDown:function(f){var d,a=(g.isMac?f.metaKey:f.ctrlKey)&&!f.altKey&&!f.shiftKey;a&&70===f.keyCode&&(d=!0);if((g.isMac?f.metaKey:f.ctrlKey)&&!f.altKey&&75===f.keyCode||
13===f.keyCode)13===f.keyCode?this.find(this._reverse?f.shiftKey:!f.shiftKey):this.find(!f.shiftKey),d=!0;a&&82===f.keyCode&&(this.replace(),d=!0);27===f.keyCode&&(this.hide(),d=!0);return d?(f.stopPropagation&&f.stopPropagation(),f.preventDefault&&f.preventDefault(),f.cancelBubble=!0,!1):!0}});return{FindUI:h}});
define("orion/editor/actions","i18n!orion/editor/nls/messages orion/keyBinding orion/editor/annotations orion/editor/tooltip orion/editor/find orion/editor/findUI orion/util".split(" "),function(l,n,m,k,g,h,f){function d(a,b,e){this.editor=a;this.undoStack=b;this._incrementalFind=new g.IncrementalFind(a);this._find=e?e:new h.FindUI(a,b);this._lastEditLocation=null;this.init()}function a(a,b,e,d){this.editor=a;this.undoStack=b;this.contentAssist=e;this.linkedMode=d;this.contentAssist&&this.contentAssist.addEventListener("ProposalApplied",
this.contentAssistProposalApplied.bind(this));this.init()}var e=m.AnnotationType,b={};d.prototype={init:function(){var a=this.editor.getTextView();this._lastEditListener={onModelChanged:function(a){this.editor.isDirty()&&(this._lastEditLocation=a.start+a.addedCharCount)}.bind(this)};a.addEventListener("ModelChanged",this._lastEditListener.onModelChanged);a.setAction("undo",function(a){if(this.undoStack){var b=1;a&&a.count&&(b=a.count);for(;0<b;)this.undoStack.undo(),--b;return!0}return!1}.bind(this),
{name:l.undo});a.setAction("redo",function(a){if(this.undoStack){var b=1;a&&a.count&&(b=a.count);for(;0<b;)this.undoStack.redo(),--b;return!0}return!1}.bind(this),{name:l.redo});a.setKeyBinding(new n.KeyBinding("f",!0),"find");a.setAction("find",function(){if(this._find){var a=this.editor.getSelection();this._find.show({findString:this.editor.getText(a.start,a.end)});return!0}return!1}.bind(this),{name:l.find});a.setKeyBinding(new n.KeyBinding("k",!0),"findNext");a.setAction("findNext",function(a){return this._find?
(this._find.find(!0,a),!0):!1}.bind(this),{name:l.findNext});a.setKeyBinding(new n.KeyBinding("k",!0,!0),"findPrevious");a.setAction("findPrevious",function(a){return this._find?(this._find.find(!1,a),!0):!1}.bind(this),{name:l.findPrevious});a.setKeyBinding(new n.KeyBinding("j",!0),"incrementalFind");a.setAction("incrementalFind",function(){this._incrementalFind&&this._incrementalFind.find(!0);return!0}.bind(this),{name:l.incrementalFind});a.setKeyBinding(new n.KeyBinding("j",!0,!0),"incrementalFindReverse");
a.setAction("incrementalFindReverse",function(){this._incrementalFind&&this._incrementalFind.find(!1);return!0}.bind(this),{name:l.incrementalFindReverse});a.setAction("tab",function(){return this.indentLines()}.bind(this));a.setAction("shiftTab",function(){return this.unindentLines()}.bind(this),{name:l.unindentLines});a.setKeyBinding(new n.KeyBinding(38,!1,!1,!0),"moveLinesUp");a.setAction("moveLinesUp",function(){return this.moveLinesUp()}.bind(this),{name:l.moveLinesUp});a.setKeyBinding(new n.KeyBinding(40,
!1,!1,!0),"moveLinesDown");a.setAction("moveLinesDown",function(){return this.moveLinesDown()}.bind(this),{name:l.moveLinesDown});a.setKeyBinding(new n.KeyBinding(38,!0,!1,!0),"copyLinesUp");a.setAction("copyLinesUp",function(){return this.copyLinesUp()}.bind(this),{name:l.copyLinesUp});a.setKeyBinding(new n.KeyBinding(40,!0,!1,!0),"copyLinesDown");a.setAction("copyLinesDown",function(){return this.copyLinesDown()}.bind(this),{name:l.copyLinesDown});a.setKeyBinding(new n.KeyBinding("d",!0,!1,!1),
"deleteLines");a.setAction("deleteLines",function(a){return this.deleteLines(a)}.bind(this),{name:l.deleteLines});a.setKeyBinding(new n.KeyBinding("l",!f.isMac,!1,!1,f.isMac),"gotoLine");a.setAction("gotoLine",function(){return this.gotoLine()}.bind(this),{name:l.gotoLine});a.setKeyBinding(new n.KeyBinding(190,!0),"nextAnnotation");a.setAction("nextAnnotation",function(){return this.nextAnnotation(!0)}.bind(this),{name:l.nextAnnotation});a.setKeyBinding(new n.KeyBinding(188,!0),"previousAnnotation");
a.setAction("previousAnnotation",function(){return this.nextAnnotation(!1)}.bind(this),{name:l.prevAnnotation});a.setKeyBinding(new n.KeyBinding("e",!0,!1,!0,!1),"expand");a.setAction("expand",function(){return this.expandAnnotation(!0)}.bind(this),{name:l.expand});a.setKeyBinding(new n.KeyBinding("c",!0,!1,!0,!1),"collapse");a.setAction("collapse",function(){return this.expandAnnotation(!1)}.bind(this),{name:l.collapse});a.setKeyBinding(new n.KeyBinding("e",!0,!0,!0,!1),"expandAll");a.setAction("expandAll",
function(){return this.expandAnnotations(!0)}.bind(this),{name:l.expandAll});a.setKeyBinding(new n.KeyBinding("c",!0,!0,!0,!1),"collapseAll");a.setAction("collapseAll",function(){return this.expandAnnotations(!1)}.bind(this),{name:l.collapseAll});a.setKeyBinding(new n.KeyBinding("q",!f.isMac,!1,!1,f.isMac),"lastEdit");a.setAction("lastEdit",function(){return this.gotoLastEdit()}.bind(this),{name:l.lastEdit})},copyLinesDown:function(){var a=this.editor;if(a.getTextView().getOptions("readonly"))return!1;
var b=a.getModel(),e=a.getSelection(),d=b.getLineAtOffset(e.start),e=b.getLineAtOffset(e.end>e.start?e.end-1:e.end),f=b.getLineStart(d),d=b.getLineEnd(e,!0),g=b.getLineCount(),h="",f=b.getText(f,d);e===g-1&&(f=(h=b.getLineDelimiter())+f);a.setText(f,d,d);a.setSelection(d+h.length,d+f.length);return!0},copyLinesUp:function(){var a=this.editor;if(a.getTextView().getOptions("readonly"))return!1;var b=a.getModel(),e=a.getSelection(),d=b.getLineAtOffset(e.start),e=b.getLineAtOffset(e.end>e.start?e.end-
1:e.end),d=b.getLineStart(d),f=b.getLineEnd(e,!0),g=b.getLineCount(),h="",f=b.getText(d,f);e===g-1&&(f+=h=b.getLineDelimiter());a.setText(f,d,d);a.setSelection(d,d+f.length-h.length);return!0},deleteLines:function(a){var b=this.editor;if(b.getTextView().getOptions("readonly"))return!1;var e=1;a&&a.count&&(e=a.count);var d=b.getSelection(),f=b.getModel(),g=f.getLineAtOffset(d.start);a=f.getLineStart(g);e=d.start!==d.end||1===e?f.getLineAtOffset(d.end>d.start?d.end-1:d.end):Math.min(g+e-1,f.getLineCount()-
1);e=f.getLineEnd(e,!0);b.setText("",a,e);return!0},expandAnnotation:function(a){var b=this.editor,e=b.getAnnotationModel();if(!e)return!0;var d=b.getModel(),f=b.getCaretOffset(),g=d.getLineAtOffset(f),f=d.getLineStart(g),g=d.getLineEnd(g,!0);d.getBaseModel&&(f=d.mapOffset(f),g=d.mapOffset(g),d.getBaseModel());for(var h,e=e.getAnnotations(f,g);!h&&e.hasNext();)d=e.next(),d.type===m.AnnotationType.ANNOTATION_FOLDING&&(h=d);h&&a!==h.expanded&&(a?h.expand():(b.setCaretOffset(h.start),h.collapse()));
return!0},expandAnnotations:function(a){var b=this.editor,e=b.getTextView(),b=b.getAnnotationModel();if(!b)return!0;var d=b.getAnnotations();for(e.setRedraw(!1);d.hasNext();)b=d.next(),b.type===m.AnnotationType.ANNOTATION_FOLDING&&a!==b.expanded&&(a?b.expand():b.collapse());e.setRedraw(!0);return!0},indentLines:function(){var a=this.editor,b=a.getTextView();if(b.getOptions("readonly"))return!1;if(b.getOptions("tabMode")){var e=a.getModel(),d=a.getSelection(),f=e.getLineAtOffset(d.start),g=e.getLineAtOffset(d.end>
d.start?d.end-1:d.end);if(f!==g){var h=[];h.push("");for(var k=f;k<=g;k++)h.push(e.getLine(k,!0));k=e.getLineStart(f);e=e.getLineEnd(g,!0);b=b.getOptions("tabSize","expandTab");b=b.expandTab?Array(b.tabSize+1).join(" "):"\t";a.setText(h.join(b),k,e);a.setSelection(k===d.start?d.start:d.start+b.length,d.end+(g-f+1)*b.length);return!0}return!1}},gotoLastEdit:function(){"number"===typeof this._lastEditLocation&&this.editor.showSelection(this._lastEditLocation);return!0},gotoLine:function(){var a=this.editor,
b=a.getModel().getLineAtOffset(a.getCaretOffset());if(b=prompt(l.gotoLinePrompty,b+1))b=parseInt(b,10),a.onGotoLine(b-1,0);return!0},moveLinesDown:function(){var a=this.editor;if(a.getTextView().getOptions("readonly"))return!1;var b=a.getModel(),e=a.getSelection(),d=b.getLineAtOffset(e.start),f=b.getLineAtOffset(e.end>e.start?e.end-1:e.end),g=b.getLineCount();if(f===g-1)return!0;var d=b.getLineStart(d),e=b.getLineEnd(f,!0),h=b.getLineEnd(f+1,!0)-(e-d),k=0;f!==g-2?b=b.getText(d,e):(f=b.getLineEnd(f),
b=b.getText(f,e)+b.getText(d,f),k+=e-f);this.startUndo();a.setText("",d,e);a.setText(b,h,h);a.setSelection(h+k,h+k+b.length);this.endUndo();return!0},moveLinesUp:function(){var a=this.editor;if(a.getTextView().getOptions("readonly"))return!1;var b=a.getModel(),e=a.getSelection(),d=b.getLineAtOffset(e.start);if(0===d)return!0;var f=b.getLineAtOffset(e.end>e.start?e.end-1:e.end),g=b.getLineCount(),e=b.getLineStart(d-1),h=b.getLineStart(d),k=b.getLineEnd(f,!0),l=b.getText(h,k),m=0;f===g-1&&(f=b.getLineEnd(d-
1),d=b.getLineEnd(d-1,!0),l+=b.getText(f,d),h=f,m=d-f);this.startUndo();a.setText("",h,k);a.setText(l,e,e);a.setSelection(e,e+l.length-m);this.endUndo();return!0},nextAnnotation:function(a){function b(a){return!!a.lineStyle||a.type===e.ANNOTATION_MATCHING_BRACKET||a.type===e.ANNOTATION_CURRENT_BRACKET||!g.isAnnotationTypeVisible(a.type)}var d=this.editor,f=d.getAnnotationModel();if(!f)return!0;var g=d.getOverviewRuler()||d.getAnnotationStyler();if(!g)return!0;for(var h=d.getModel(),l=d.getCaretOffset(),
m=f.getAnnotations(a?l:0,a?h.getCharCount():l),n=null;m.hasNext();){var z=m.next();if(a){if(z.start<=l)continue}else if(z.start>=l)continue;if(!b(z)&&(n=z,a))break}if(n){for(var B=[n],m=f.getAnnotations(n.start,n.start);m.hasNext();)z=m.next(),z!==n&&!b(z)&&B.push(z);var v=d.getTextView(),A=h.getLineAtOffset(n.start),C=k.Tooltip.getTooltip(v);if(!C)return d.moveSelection(n.start),!0;d.moveSelection(n.start,n.start,function(){C.setTarget({getTooltipInfo:function(){var a=v.convert({x:v.getLocationAtOffset(n.start).x,
y:v.getLocationAtOffset(h.getLineStart(A)).y},"document","page");return{contents:B,x:a.x,y:a.y+Math.floor(1.33*v.getLineHeight(A))}}},0)})}return!0},unindentLines:function(){var a=this.editor,b=a.getTextView();if(b.getOptions("readonly"))return!1;if(b.getOptions("tabMode")){for(var e=a.getModel(),d=a.getSelection(),f=e.getLineAtOffset(d.start),g=e.getLineAtOffset(d.end>d.start?d.end-1:d.end),h=b.getOptions("tabSize"),k=Array(h+1).join(" "),l=[],m=b=0,n=f;n<=g;n++){var v=e.getLine(n,!0);if(e.getLineStart(n)!==
e.getLineEnd(n))if(0===v.indexOf("\t"))v=v.substring(1),b++;else if(0===v.indexOf(k))v=v.substring(h),b+=h;else return!0;n===f&&(m=b);l.push(v)}f=e.getLineStart(f);h=e.getLineEnd(g,!0);e=e.getLineStart(g);a.setText(l.join(""),f,h);g=f===d.start?d.start:d.start-m;d=Math.max(g,d.end-b+(d.end===e+1&&d.start!==d.end?1:0));a.setSelection(g,d);return!0}},startUndo:function(){this.undoStack&&this.undoStack.startCompoundChange()},endUndo:function(){this.undoStack&&this.undoStack.endCompoundChange()}};b.TextActions=
d;a.prototype={init:function(){var a=this.editor.getTextView();a.setAction("lineStart",function(){return this.lineStart()}.bind(this));a.setAction("enter",function(){return this.autoIndent()}.bind(this));a.setKeyBinding(new n.KeyBinding("t",!0,!1,!0),"trimTrailingWhitespaces");a.setAction("trimTrailingWhitespaces",function(){return this.trimTrailingWhitespaces()}.bind(this),{name:l.trimTrailingWhitespaces});a.setKeyBinding(new n.KeyBinding(191,!0),"toggleLineComment");a.setAction("toggleLineComment",
function(){return this.toggleLineComment()}.bind(this),{name:l.toggleLineComment});a.setKeyBinding(new n.KeyBinding(191,!0,!f.isMac,!1,f.isMac),"addBlockComment");a.setAction("addBlockComment",function(){return this.addBlockComment()}.bind(this),{name:l.addBlockComment});a.setKeyBinding(new n.KeyBinding(220,!0,!f.isMac,!1,f.isMac),"removeBlockComment");a.setAction("removeBlockComment",function(){return this.removeBlockComment()}.bind(this),{name:l.removeBlockComment});a.setKeyBinding(new n.KeyBinding("[",
!1,!1,!1,!1,"keypress"),"autoPairSquareBracket");a.setAction("autoPairSquareBracket",function(){return this.autoPairBrackets("[","]")}.bind(this));a.setKeyBinding(new n.KeyBinding("]",!1,!1,!1,!1,"keypress"),"skipClosingSquareBracket");a.setAction("skipClosingSquareBracket",function(){return this.skipClosingBracket("]")}.bind(this));a.setKeyBinding(new n.KeyBinding("\x3c",!1,!1,!1,!1,"keypress"),"autoPairAngleBracket");a.setAction("autoPairAngleBracket",function(){return this.autoPairBrackets("\x3c",
"\x3e")}.bind(this));a.setKeyBinding(new n.KeyBinding("\x3e",!1,!1,!1,!1,"keypress"),"skipClosingAngleBracket");a.setAction("skipClosingAngleBracket",function(){return this.skipClosingBracket("\x3e")}.bind(this));a.setKeyBinding(new n.KeyBinding("(",!1,!1,!1,!1,"keypress"),"autoPairParentheses");a.setAction("autoPairParentheses",function(){return this.autoPairBrackets("(",")")}.bind(this));a.setKeyBinding(new n.KeyBinding(")",!1,!1,!1,!1,"keypress"),"skipClosingParenthesis");a.setAction("skipClosingParenthesis",
function(){return this.skipClosingBracket(")")}.bind(this));a.setKeyBinding(new n.KeyBinding("{",!1,!1,!1,!1,"keypress"),"autoPairBraces");a.setAction("autoPairBraces",function(){return this.autoPairBrackets("{","}")}.bind(this));a.setKeyBinding(new n.KeyBinding("}",!1,!1,!1,!1,"keypress"),"skipClosingBrace");a.setAction("skipClosingBrace",function(){return this.skipClosingBracket("}")}.bind(this));a.setKeyBinding(new n.KeyBinding("'",!1,!1,!1,!1,"keypress"),"autoPairSingleQuotation");a.setAction("autoPairSingleQuotation",
function(){return this.autoPairQuotations("'")}.bind(this));a.setKeyBinding(new n.KeyBinding('"',!1,!1,!1,!1,"keypress"),"autoPairDblQuotation");a.setAction("autoPairDblQuotation",function(){return this.autoPairQuotations('"')}.bind(this));a.setAction("deletePrevious",function(){return this.deletePrevious()}.bind(this))},autoIndent:function(){var a=this.editor,b=a.getTextView();if(b.getOptions("readonly"))return!1;var e=a.getSelection();if(e.start===e.end){for(var d=a.getModel(),f=d.getLineAtOffset(e.start),
g=d.getLine(f,!1),h=d.getLineStart(f),k=0,l=e.start-h,m;k<l&&(32===(m=g.charCodeAt(k))||9===m);)k++;var h=g.substring(0,k),b=b.getOptions("tabSize","expandTab"),n=b.expandTab?Array(b.tabSize+1).join(" "):"\t",b=d.getLineDelimiter(),v=/^[\s]*\/\*[\*]*[\s]*$/,A=/^[\s]*\*/,C=/\*\/[\s]*$/,D=g.substring(0,l),E=g.substring(l),K;if(this.smartIndentation&&123===g.charCodeAt(K=D.trimRight().length-1))return d=l-K-1,E=E.length-E.trimLeft().length,g=125===g.charCodeAt(l+E)?b+h+n+b+h:b+h+n,a.setText(g,e.start-
d,e.end+E),a.setCaretOffset(e.start+b.length+h.length+n.length-d),!0;if(this.autoCompleteComments&&!C.test(D)&&(v.test(D)||A.test(D))){if(k=v.exec(D)){g=b+h+" * ";g=C.test(E)?g+E.substring(0,E.length-2).trim():g+E.trim();if(d.getLineCount()===f+1||!A.test(d.getLine(f+1)))g+=b+h+" */";a.setText(g,e.start,e.end+E.length);a.setCaretOffset(e.start+b.length+h.length+3);return!0}if(k=A.exec(D))for(f-=1;0<=f;f--){k=d.getLine(f,!1);if(v.test(k))return C.test(E)||47===g.charCodeAt(l)?(g=b+h+"*"+E,h=e.start+
b.length+h.length+1):(g=b+h+"* "+E,h=e.start+b.length+h.length+2),a.setText(g,e.start,e.end+E.length),a.setCaretOffset(h),!0;if(!A.test(k))break}}else{if(C.test(D)&&32===h.charCodeAt(h.length-1))return g=b+h.substring(0,h.length-1),a.setText(g,e.start,e.end),a.setCaretOffset(e.start+g.length),!0;if(0<k){for(k=l;k<g.length&&(32===(m=g.charCodeAt(k++))||9===m);)e.end++;a.setText(d.getLineDelimiter()+h,e.start,e.end);return!0}}}return!1},addBlockComment:function(){var a=this.editor;if(a.getTextView().getOptions("readonly"))return!1;
var b=a.getModel(),e=a.getSelection(),d=this._findEnclosingComment(b,e.start,e.end);if(void 0!==d.commentStart&&void 0!==d.commentEnd)return!0;b=b.getText(e.start,e.end);if(0===b.length)return!0;var d=b.length,b=b.replace(/\/\*|\*\//g,""),f=b.length;a.setText("/*"+b+"*/",e.start,e.end);a.setSelection(e.start+2,e.end+2+(f-d));return!0},autoPairBrackets:function(a,b){if("["===a&&!this.autoPairSquareBrackets||"{"===a&&!this.autoPairBraces||"("===a&&!this.autoPairParentheses||"\x3c"===a&&!this.autoPairAngleBrackets)return!1;
var e=this.editor;if(e.getTextView().getOptions("readonly"))return!1;var d=e.getSelection(),f=e.getModel(),g=e.getCaretOffset()===f.getCharCount()?"":f.getText(d.start,d.start+1).trim(),h=/^$|[)}\]>]/;return d.start===d.end&&h.test(g)?(e.setText(a+b,d.start,d.start),e.setCaretOffset(d.start+1),!0):d.start!==d.end?(f=f.getText(d.start,d.end),e.setText(a+f+b,d.start,d.end),e.setSelection(d.start+1,d.end+1),!0):!1},autoPairQuotations:function(a){if(!this.autoPairQuotation)return!1;var b=this.editor;
if(b.getTextView().getOptions("readonly"))return!1;var e=b.getSelection(),d=b.getModel(),f=b.getCaretOffset(),g=0===f?"":d.getText(e.start-1,e.start).trim(),h=f===d.getCharCount()?"":d.getText(e.start,e.start+1).trim(),f=/^"$|^'$/,k=/\w/,l=/^$|[)}\]>]/;if(e.start!==e.end){d=d.getText(e.start,e.end);if(f.test(d))return!1;b.setText(a+d+a,e.start,e.end);b.setSelection(e.start+1,e.end+1)}else{if(h!==a){if(g===a||f.test(h)||k.test(g)||!l.test(h))return!1;b.setText(a+a,e.start,e.start)}b.setCaretOffset(e.start+
1)}return!0},contentAssistProposalApplied:function(a){a=a.data.proposal;if(a.positions&&0<a.positions.length&&this.linkedMode){for(var b=[],e=0;e<a.positions.length;++e)b[e]={positions:[{offset:a.positions[e].offset,length:a.positions[e].length}]};this.linkedMode.enterLinkedMode({groups:b,escapePosition:a.escapePosition})}else a.groups&&0<a.groups.length&&this.linkedMode?this.linkedMode.enterLinkedMode({groups:a.groups,escapePosition:a.escapePosition}):a.escapePosition&&this.editor.getTextView().setCaretOffset(a.escapePosition);
return!0},deletePrevious:function(){var a=this.editor;if(a.getTextView().getOptions("readonly"))return!1;var b=a.getSelection();if(b.start!==b.end)return!1;var e=a.getModel(),d=a.getCaretOffset(),f=0===d?"":e.getText(b.start-1,b.start),e=d===e.getCharCount()?"":e.getText(b.start,b.start+1);("("===f&&")"===e||"["===f&&"]"===e||"{"===f&&"}"===e||"\x3c"===f&&"\x3e"===e||'"'===f&&'"'===e||"'"===f&&"'"===e)&&a.setText("",b.start,b.start+1);return!1},_findEnclosingComment:function(a,b,e){var d=a.getLineAtOffset(b),
f=a.getLineAtOffset(e),g,h,k,l,m,n;for(g=d;0<=g&&!(h=a.getLine(g),k=g===d?b-a.getLineStart(d):h.length,l=h.lastIndexOf("/*",k),h=h.lastIndexOf("*/",k),h>l);g--)if(-1!==l){m=a.getLineStart(g)+l;break}for(g=f;g<a.getLineCount()&&!(h=a.getLine(g),k=g===f?e-a.getLineStart(f):0,l=h.indexOf("/*",k),h=h.indexOf("*/",k),-1!==l&&l<h);g++)if(-1!==h){n=a.getLineStart(g)+h;break}return{commentStart:m,commentEnd:n}},lineStart:function(){for(var a=this.editor,b=a.getModel(),e=a.getCaretOffset(),d=b.getLineAtOffset(e),
f=b.getLineStart(d),b=b.getLine(d),d=0;d<b.length;d++){var g=b.charCodeAt(d);if(!(32===g||9===g))break}d+=f;return e!==d?(a.setSelection(d,d),!0):!1},removeBlockComment:function(){var a=this.editor;if(a.getTextView().getOptions("readonly"))return!1;var b=a.getModel(),e=a.getSelection(),d=b.getText(e.start,e.end),f,g,h;for(h=0;h<d.length;h++)if("/*"===d.substring(h,h+2)){f=e.start+h;break}for(;h<d.length;h++)if("*/"===d.substring(h,h+2)){g=e.start+h;break}if(void 0!==f&&void 0!==g)a.setText(b.getText(f+
2,g),f,g+2),a.setSelection(f,g);else{d=this._findEnclosingComment(b,e.start,e.end);if(void 0===d.commentStart||void 0===d.commentEnd)return!0;b=b.getText(d.commentStart+2,d.commentEnd);a.setText(b,d.commentStart,d.commentEnd+2);a.setSelection(e.start-2,e.end-2)}return!0},toggleLineComment:function(){var a=this.editor,b=a.getTextView();if(b.getOptions("readonly"))return!1;for(var e=this.lineComment||"//",d=a.getModel(),f=a.getSelection(),g=d.getLineAtOffset(f.start),h=d.getLineAtOffset(f.end>f.start?
f.end-1:f.end),k=!0,l=[],m,n=g;n<=h;n++){var v=d.getLine(n,!0);m=v.indexOf(e);l.push(m);if(!k||-1===m)k=!1;else if(0!==m){for(k=0;k<m;k++){var A=v.charCodeAt(k);if(!(32===A||9===A))break}k=k===m}}n=e.length;v=d.getLineStart(g);b.setRedraw(!1);this.startUndo();if(k){for(k=l.length-1;0<=k;k--)m=l[k]+d.getLineStart(g+k),a.setText("",m,m+n);d=d.getLineStart(h);e=v===f.start?f.start:f.start-n;f=f.end-n*(h-g+1)+(f.end===d+1?n:0)}else{for(k=l.length-1;0<=k;k--)m=d.getLineStart(g+k),a.setText(e,m,m);e=v===
f.start?f.start:f.start+n;f=f.end+n*(h-g+1)}this.endUndo();b.setRedraw(!0);a.setSelection(e,f);return!0},trimTrailingWhitespaces:function(){var a=this.editor,b=a.getModel(),e=a.getSelection();a.getTextView().setRedraw(!1);a.getUndoStack().startCompoundChange();for(var d=/(\s+$)/,f=b.getLineCount(),g=0;g<f;g++){var h=b.getLine(g),k=d.exec(h);if(k){var l=b.getLineStart(g),h=k[0].length,k=l+k.index;b.setText("",k,k+h);e.start>k&&(e.start=Math.max(k,e.start-h));e.start!==e.end&&e.end>k&&(e.end=Math.max(k,
e.end-h))}}a.getUndoStack().endCompoundChange();a.getTextView().setRedraw(!0);a.setSelection(e.start,e.end,!1)},startUndo:function(){this.undoStack&&this.undoStack.startCompoundChange()},skipClosingBracket:function(a){var b=this.editor;if(b.getTextView().getOptions("readonly"))return!1;var e=b.getSelection(),d=b.getModel();return(b.getCaretOffset()===d.getCharCount()?"":d.getText(e.start,e.start+1))===a?(b.setCaretOffset(e.start+1),!0):!1},endUndo:function(){this.undoStack&&this.undoStack.endCompoundChange()},
setAutoPairParentheses:function(a){this.autoPairParentheses=a},setAutoPairBraces:function(a){this.autoPairBraces=a},setAutoPairSquareBrackets:function(a){this.autoPairSquareBrackets=a},setAutoPairAngleBrackets:function(a){this.autoPairAngleBrackets=a},setAutoPairQuotations:function(a){this.autoPairQuotation=a},setAutoCompleteComments:function(a){this.autoCompleteComments=a},setLineComment:function(a){this.lineComment=a},setSmartIndentation:function(a){this.smartIndentation=a}};b.SourceCodeActions=
a;String.prototype.trimLeft||(String.prototype.trimLeft=function(){return this.replace(/^\s+/g,"")});String.prototype.trimRight||(String.prototype.trimRight=function(){return this.replace(/\s+$/g,"")});return b});
define("orion/editor/undoStack",[],function(){function l(k,g,h,f,d){this.model=k;this.offset=g;this.text=h;this.previousText=f;this.type=d}function n(k){this.owner=k;this.changes=[]}function m(k,g){this.size=void 0!==g?g:100;this.reset();var h=this;this._listener={onChanging:function(d){h._onChanging(d)},onDestroy:function(d){h._onDestroy(d)}};if(k.getModel){var f=k.getModel();f.getBaseModel&&(f=f.getBaseModel());this.model=f;this.setView(k)}else this.shared=!0,this.model=k;this.model.addEventListener("Changing",
this._listener.onChanging)}l.prototype={getRedoChanges:function(){return[{start:this.offset,end:this.offset+this.previousText.length,text:this.text}]},getUndoChanges:function(){return[{start:this.offset,end:this.offset+this.text.length,text:this.previousText}]},undo:function(k,g){this._doUndoRedo(this.offset,this.previousText,this.text,k,g);return!0},redo:function(k,g){this._doUndoRedo(this.offset,this.text,this.previousText,k,g);return!0},merge:function(k,g,h,f,d){if(f===this.type){if(1===f&&k===
this.offset+this.text.length)return this.text+=g,!0;if(-1===f&&d===this.offset)return this.offset=k,this.previousText=h+this.previousText,!0;if(-1===f&&k===this.offset)return this.previousText+=h,!0}return!1},_doUndoRedo:function(k,g,h,f,d){this.model.setText(g,k,k+h.length);d&&f&&(h=f.getModel(),h!==this.model&&(k=h.mapOffset(k,!0)),f.setSelection(k,k+g.length))}};n.prototype={getRedoChanges:function(){for(var k=[],g=0;g<this.changes.length;g++)k=k.concat(this.changes[g].getRedoChanges());return k},
getUndoChanges:function(){for(var k=[],g=this.changes.length-1;0<=g;g--)k=k.concat(this.changes[g].getUndoChanges());return k},add:function(k){this.changes.push(k)},end:function(k){k&&(this.endSelection=k.getSelection(),this.endCaret=k.getCaretOffset());(k=this.owner)&&k.end&&k.end()},undo:function(k,g){1<this.changes.length&&k&&k.setRedraw(!1);for(var h=this.changes.length-1;0<=h;h--)this.changes[h].undo(k,!1);1<this.changes.length&&k&&k.setRedraw(!0);if(g&&k){var h=this.startSelection.start,f=this.startSelection.end;
k.setSelection(this.startCaret?h:f,this.startCaret?f:h)}(h=this.owner)&&h.undo&&h.undo();return 0<this.changes.length},redo:function(k,g){1<this.changes.length&&k&&k.setRedraw(!1);for(var h=0;h<this.changes.length;h++)this.changes[h].redo(k,!1);(1<this.changes.length,k)&&k.setRedraw(!0);if(g&&k){var h=this.endSelection.start,f=this.endSelection.end;k.setSelection(this.endCaret?h:f,this.endCaret?f:h)}(h=this.owner)&&h.redo&&h.redo();return 0<this.changes.length},merge:function(k,g,h,f,d){var a=this.changes.length;
return 0<a?this.changes[a-1].merge(k,g,h,f,d):!1},start:function(k){k&&(this.startSelection=k.getSelection(),this.startCaret=k.getCaretOffset());(k=this.owner)&&k.start&&k.start()}};m.prototype={destroy:function(){this._onDestroy()},add:function(k){this.compoundChange?this.compoundChange.add(k):(this.stack.splice(this.index,this.stack.length-this.index,k),this.index++,this.stack.length>this.size&&(this.stack.shift(),this.index--))},markClean:function(){this._commitUndo();if(this.cleanChange=this.stack[this.index-
1])this.cleanChange.type=2},isClean:function(){return this.cleanChange===this.stack[this.index-1]},canUndo:function(){return 0<this.index},canRedo:function(){return 0<this.stack.length-this.index},endCompoundChange:function(){this.compoundChange&&this.compoundChange.end(this.view);this.compoundChange=void 0},getSize:function(){return{undo:this.index,redo:this.stack.length-this.index}},getRedoChanges:function(){this._commitUndo();for(var k=[],g=this.index;g<this.stack.length;g++)k=k.concat(this.stack[g].getRedoChanges());
return k},getUndoChanges:function(){this._commitUndo();for(var k=[],g=this.index;0<=g;g--)k=k.concat(this.stack[g].getUndoChanges());return k},undo:function(){this._commitUndo();var k;k=!1;this._ignoreUndo=!0;do{if(0>=this.index)break;k=this.stack[--this.index]}while(!(k=k.undo(this.view,!0)));this._ignoreUndo=!1;return k},redo:function(){this._commitUndo();var k;this._ignoreUndo=!0;do{if(this.index>=this.stack.length)break;k=this.stack[this.index++]}while(!k.redo(this.view,!0));this._ignoreUndo=
!1;return!0},reset:function(){this.index=0;this.cleanChange=void 0;this.stack=[];this._ignoreUndo=!1;this._compoundChange=void 0},setView:function(k){this.view!==k&&(this.view&&k.removeEventListener("Destroy",this._listener.onDestroy),(this.view=k)&&k.addEventListener("Destroy",this._listener.onDestroy))},startCompoundChange:function(k){this._commitUndo();k=new n(k);this.add(k);this.compoundChange=k;this.compoundChange.start(this.view);return this.compoundChange},_commitUndo:function(){this.endCompoundChange()},
_onDestroy:function(k){(!k||!this.shared)&&this.model.removeEventListener("Changing",this._listener.onChanging);this.view&&(this.view.removeEventListener("Destroy",this._listener.onDestroy),this.view=null)},_onChanging:function(k){if(!this._ignoreUndo){var g=k.text,h=k.start,f=k.addedCharCount,d=k.removedCharCount;k=h+d;var a=0;0===f&&1===d?a=-1:1===f&&0===d&&(a=1);f=this.stack.length;d=this.model.getText(h,k);(!(0<f&&this.index===f)||!this.stack[f-1].merge(h,g,d,a,k))&&this.add(new l(this.model,
h,g,d,a))}}};return{UndoStack:m}});
define("orion/editor/rulers",["i18n!orion/editor/nls/messages","orion/editor/annotations","orion/editor/tooltip","orion/util"],function(l,n,m,k){function g(a,b,d,f){this._location=b||"left";this._overview=d||"page";this._rulerStyle=f;this._view=null;var g=this;this._listener={onTextModelChanged:function(a){g._onTextModelChanged(a)},onAnnotationModelChanged:function(a){g._onAnnotationModelChanged(a)}};this.setAnnotationModel(a)}function h(a,b,d,f,h){g.call(this,a,b,"page",d);this._oddStyle=f||{style:{backgroundColor:"white"}};
this._evenStyle=h||{style:{backgroundColor:"white"}};this._numOfDigits=0;this._firstLine=1}function f(a,b,d){g.call(this,a,b,"page",d)}function d(a,b,d){g.call(this,a,b,"document",d)}function a(a,b,d){f.call(this,a,b,d)}g.prototype={getAnnotations:function(a,b){var d=this._annotationModel;if(!d)return[];var f=this._view.getModel(),g=f.getLineStart(a),h=f.getLineEnd(b-1),k=f;f.getBaseModel&&(k=f.getBaseModel(),g=f.mapOffset(g),h=f.mapOffset(h));for(var l=[],d=this.getAnnotationsByType(d,g,h),g=0;g<
d.length;g++)for(var h=d[g],m=k.getLineAtOffset(h.start),n=k.getLineAtOffset(Math.max(h.start,h.end-1)),t=m;t<=n;t++){var z=t;if(f!==k){z=k.getLineStart(t);z=f.mapOffset(z,!0);if(-1===z)continue;z=f.getLineAtOffset(z)}if(a<=z&&z<b){var B=this._mergeAnnotation(l[z],h,t-m,n-m+1);B&&(l[z]=B)}}if(!this._multiAnnotation&&this._multiAnnotationOverlay)for(var v in l)l[v]._multiple&&(l[v].html+=this._multiAnnotationOverlay.html);return l},getAnnotationModel:function(){return this._annotationModel},getLocation:function(){return this._location},
getOverview:function(){return this._overview},getRulerStyle:function(){return this._rulerStyle},getView:function(){return this._view},getWidestAnnotation:function(){return null},setAnnotationModel:function(a){this._annotationModel&&this._annotationModel.removEventListener("Changed",this._listener.onAnnotationModelChanged);(this._annotationModel=a)&&this._annotationModel.addEventListener("Changed",this._listener.onAnnotationModelChanged)},setMultiAnnotation:function(a){this._multiAnnotation=a},setMultiAnnotationOverlay:function(a){this._multiAnnotationOverlay=
a},setView:function(a){this._onTextModelChanged&&this._view&&this._view.removeEventListener("ModelChanged",this._listener.onTextModelChanged);this._view=a;this._onTextModelChanged&&this._view&&this._view.addEventListener("ModelChanged",this._listener.onTextModelChanged)},onClick:function(a,b){if(void 0!==a){var d=this._view,f=d.getModel(),g=f,h=f.getLineStart(a),k=h,l=h,n=this._annotationModel;if(n){d=d.getSelection();l=f.getLineEnd(a,!0);h<=d.start&&d.start<l&&(h=d.start);f.getBaseModel&&(h=f.mapOffset(h),
l=f.mapOffset(l),g=f.getBaseModel());for(var r,l=n.getAnnotations(h,l),n=null;!r&&l.hasNext();)d=l.next(),this.isAnnotationTypeVisible(d.type)&&(n=d,d.start<=h||(r=d));n&&void 0!==n.groupId&&(this._currentClickGroup=this._currentClickGroup===n.groupId?null:n.groupId,this._setCurrentGroup(a));r&&g.getLineAtOffset(r.start)===g.getLineAtOffset(h)?(h=r.start,l=r.end):l=h=k;f.getBaseModel&&(h=f.mapOffset(h,!0),l=f.mapOffset(l,!0))}(f=m.Tooltip.getTooltip(this._view))&&f.setTarget(null);this._view.setSelection(l,
h,1/3,function(){})}},onDblClick:function(a,b){},onMouseMove:function(a,b){var d=m.Tooltip.getTooltip(this._view);if(d&&!(d.isVisible()&&this._tooltipLineIndex===a)){this._tooltipLineIndex=a;var f=this;d.setTarget({y:b.clientY,getTooltipInfo:function(){return f._getTooltipInfo(f._tooltipLineIndex,this.y)}})}},onMouseOver:function(a,b){this.onMouseMove(a,b);this._currentClickGroup||this._setCurrentGroup(a)},onMouseOut:function(a,b){this._currentClickGroup||this._setCurrentGroup(-1);var d=m.Tooltip.getTooltip(this._view);
d&&d.setTarget(null)},_getTooltipInfo:function(a,b){if(void 0!==a){var d=this._view,f=d.getModel(),g=this._annotationModel,h=[];if(g){var h=f.getLineStart(a),k=f.getLineEnd(a);f.getBaseModel&&(h=f.mapOffset(h),k=f.mapOffset(k));h=this.getAnnotationsByType(g,h,k)}g=this._getTooltipContents(a,h);if(!g)return null;g={contents:g,anchor:this.getLocation()};h=d.getClientArea();"document"===this.getOverview()?h.y=d.convert({y:b},"view","document").y:h.y=d.getLocationAtOffset(f.getLineStart(a)).y;d.convert(h,
"document","page");g.x=h.x;g.y=h.y;"right"===g.anchor&&(g.x+=h.width);return g}},_getTooltipContents:function(a,b){return b},_onAnnotationModelChanged:function(a){function b(a){for(var b=0;b<a.length;b++)if(g.isAnnotationTypeVisible(a[b].type)){var e=a[b].start,h=a[b].end;f.getBaseModel&&(e=f.mapOffset(e,!0),h=f.mapOffset(h,!0));-1!==e&&-1!==h&&d.redrawLines(f.getLineAtOffset(e),f.getLineAtOffset(Math.max(e,h-1))+1,g)}}var d=this._view;if(d){var f=d.getModel(),g=this,h=f.getLineCount();a.textModelChangedEvent?
(a=a.textModelChangedEvent.start,f.getBaseModel&&(a=f.mapOffset(a,!0)),a=f.getLineAtOffset(a),d.redrawLines(a,h,g)):(b(a.added),b(a.removed),b(a.changed))}},_mergeAnnotation:function(a,b,d,f){a||(a={});0===d&&(a.html&&b.html?(b.html!==a.html&&(!a._multiple&&this._multiAnnotation)&&(a.html=this._multiAnnotation.html),a._multiple=!0):a.html=b.html);a.style=this._mergeStyle(a.style,b.style);return a},_mergeStyle:function(a,b){if(b){a||(a={});a.styleClass=a.styleClass&&b.styleClass&&a.styleClass!==b.styleClass?
a.styleClass+(" "+b.styleClass):b.styleClass;var d;if(b.style)for(d in a.style||(a.style={}),b.style)void 0===a.style[d]&&(a.style[d]=b.style[d]);if(b.attributes)for(d in a.attributes||(a.attributes={}),b.attributes)void 0===a.attributes[d]&&(a.attributes[d]=b.attributes[d])}return a},_setCurrentGroup:function(a){var b=this._annotationModel,d=null,f=b.getTextModel(),g,h=this._currentGroupAnnotation;if(-1!==a){var k=f.getLineStart(a),l=f.getLineEnd(a);f.getBaseModel&&(k=f.mapOffset(k),l=f.mapOffset(l));
for(g=b.getAnnotations(k,l);g.hasNext();)if(f=g.next(),this.isAnnotationTypeVisible(f.type)&&f.start<=k&&f.end>=l&&void 0!==f.groupId){d=f;break}if(h&&d&&h.groupId===d.groupId)return}this._currentGroupAnnotation=null;h&&b.removeAnnotations(h.groupType);if(d&&-1!==a){this._currentGroupAnnotation=d;g=b.getAnnotations();for(a=[];g.hasNext();)f=g.next(),delete f.groupAnnotation,f.groupId===d.groupId&&(f=f.createGroupAnnotation(),a.push(f));b.replaceAnnotations(null,a)}}};n.AnnotationTypeList.addMixin(g.prototype);
h.prototype=new g;h.prototype.getAnnotations=function(a,b){for(var d=g.prototype.getAnnotations.call(this,a,b),f=this._view.getModel(),h=a;h<b;h++){var k=h&1?this._oddStyle:this._evenStyle,l=h;f.getBaseModel&&(l=f.getLineStart(l),l=f.getBaseModel().getLineAtOffset(f.mapOffset(l)));d[h]||(d[h]={});d[h].html=this._firstLine+l+"";d[h].style||(d[h].style=k)}return d};h.prototype.getWidestAnnotation=function(){var a=this._view.getModel().getLineCount();return this.getAnnotations(a-1,a)[a-1]};h.prototype.setFirstLine=
function(a){this._firstLine=void 0!==a?a:1};h.prototype._onTextModelChanged=function(a){var b=a.start;a=this._view.getModel();var d=a.getBaseModel?a.getBaseModel().getLineCount():a.getLineCount(),d=(this._firstLine+d-1+"").length;this._numOfDigits!==d&&(this._numOfDigits=d,b=a.getLineAtOffset(b),this._view.redrawLines(b,a.getLineCount(),this))};f.prototype=new g;d.prototype=new g;d.prototype.getRulerStyle=function(){var a={style:{lineHeight:"1px",fontSize:"1px"}};return a=this._mergeStyle(a,this._rulerStyle)};
d.prototype._getTooltipContents=function(a,b){if(0===b.length){var d=this._view.getModel(),f=a;d.getBaseModel&&(f=d.getLineStart(f),f=d.getBaseModel().getLineAtOffset(d.mapOffset(f)));return k.formatMessage(l.line,f+1)}return g.prototype._getTooltipContents.call(this,a,b)};d.prototype._mergeAnnotation=function(a,b,d,f){if(0===d)return a||(a={html:"\x26nbsp;",style:{style:{height:3*f+"px"}}},a.style=this._mergeStyle(a.style,b.overviewStyle)),a};a.prototype=new f;a.prototype.onClick=function(a,b){if(void 0!==
a){var d=this._annotationModel;if(d){var f=this._view.getModel(),g=f.getLineStart(a),h=f.getLineEnd(a,!0);f.getBaseModel&&(g=f.mapOffset(g),h=f.mapOffset(h),f=f.getBaseModel());for(var k,d=d.getAnnotations(g,h);!k&&d.hasNext();)h=d.next(),this.isAnnotationTypeVisible(h.type)&&f.getLineAtOffset(h.start)===f.getLineAtOffset(g)&&(k=h);k&&((f=m.Tooltip.getTooltip(this._view))&&f.setTarget(null),k.expanded?k.collapse():k.expand())}}};a.prototype._getTooltipContents=function(a,b){if(0<b.length){var d=this._view.getModel(),
g=d.getLineStart(a);d.getBaseModel&&(g=d.mapOffset(g),d=d.getBaseModel());for(var g=d.getLineAtOffset(g),h=0;h<b.length;h++){var k=b[h];if(this.isAnnotationTypeVisible(k.type)&&d.getLineAtOffset(k.start)===g){if(b[h].expanded)break;return f.prototype._getTooltipContents.call(this,a,[k])}}}return null};a.prototype._onAnnotationModelChanged=function(a){function b(a){for(k=0;k<a.length;k++)if(h.isAnnotationTypeVisible(a[k].type)){var b=a[k].start;g.getBaseModel&&(b=g.mapOffset(b,!0));-1!==b&&(m=Math.min(m,
g.getLineAtOffset(b)))}}if(a.textModelChangedEvent)f.prototype._onAnnotationModelChanged.call(this,a);else{var d=this._view;if(d){var g=d.getModel(),h=this,k,l=g.getLineCount(),m=l;b(a.added);b(a.removed);b(a.changed);a=d.getRulers();for(k=0;k<a.length;k++)d.redrawLines(m,l,a[k])}}};return{Ruler:g,AnnotationRuler:f,LineNumberRuler:h,OverviewRuler:d,FoldingRuler:a}});
define("orion/editor/textDND",["orion/util"],function(l){function n(l,k){this._view=l;this._undoStack=k;this._dragSelection=null;this._dropOffset=-1;this._dropText=null;var g=this;this._listener={onDragStart:function(h){g._onDragStart(h)},onDragEnd:function(h){g._onDragEnd(h)},onDragEnter:function(h){g._onDragEnter(h)},onDragOver:function(h){g._onDragOver(h)},onDrop:function(h){g._onDrop(h)},onDestroy:function(h){g._onDestroy(h)}};l.addEventListener("DragStart",this._listener.onDragStart);l.addEventListener("DragEnd",
this._listener.onDragEnd);l.addEventListener("DragEnter",this._listener.onDragEnter);l.addEventListener("DragOver",this._listener.onDragOver);l.addEventListener("Drop",this._listener.onDrop);l.addEventListener("Destroy",this._listener.onDestroy)}n.prototype={destroy:function(){var l=this._view;l&&(l.removeEventListener("DragStart",this._listener.onDragStart),l.removeEventListener("DragEnd",this._listener.onDragEnd),l.removeEventListener("DragEnter",this._listener.onDragEnter),l.removeEventListener("DragOver",
this._listener.onDragOver),l.removeEventListener("Drop",this._listener.onDrop),l.removeEventListener("Destroy",this._listener.onDestroy),this._view=null)},_onDestroy:function(l){this.destroy()},_onDragStart:function(l){var k=this._view,g=k.getSelection(),k=k.getModel();k.getBaseModel&&(g.start=k.mapOffset(g.start),g.end=k.mapOffset(g.end),k=k.getBaseModel());if(k=k.getText(g.start,g.end))this._dragSelection=g,l.event.dataTransfer.effectAllowed="copyMove",l.event.dataTransfer.setData("Text",k)},_onDragEnd:function(m){if(this._dragSelection){var k=
this._view,g=m.event.dataTransfer.dropEffect;if(!l.isFirefox&&("none"!==g||this._dropText))g=m.event.dataTransfer.dropEffect=this._dropEffect;this._undoStack&&this._undoStack.startCompoundChange();(m="move"===g)&&k.setText("",this._dragSelection.start,this._dragSelection.end);if(this._dropText){var g=this._dropText,h=this._dropOffset;m&&(h>=this._dragSelection.end?h-=this._dragSelection.end-this._dragSelection.start:h>=this._dragSelection.start&&(h=this._dragSelection.start));k.setText(g,h,h);k.setSelection(h,
h+g.length);this._dropText=null;this._dropOffset=-1}this._undoStack&&this._undoStack.endCompoundChange()}this._dragSelection=null},_onDragEnter:function(l){this._onDragOver(l)},_onDragOver:function(m){var k=m.event.dataTransfer.types,g=!this._view.getOptions("readonly");g&&k&&(g=k.contains?k.contains("text/plain")||k.contains("Text"):-1!==k.indexOf("text/plain")||-1!==k.indexOf("Text"));g?l.isFirefox||(this._dropEffect=m.event.dataTransfer.dropEffect=(l.isMac?m.event.altKey:m.event.ctrlKey)?"copy":
"move"):m.event.dataTransfer.dropEffect="none"},_onDrop:function(m){var k=this._view,g=m.event.dataTransfer.getData("Text");g&&(l.isFirefox||(m.event.dataTransfer.dropEffect=this._dropEffect),m=k.getOffsetAtLocation(m.x,m.y),this._dragSelection?(this._dropOffset=m,this._dropText=g):(k.setText(g,m,m),k.setSelection(m,m+g.length)))}};return{TextDND:n}});
define("orion/editor/templates",[],function(){function l(l,k,g,h){this.prefix=l;this.description=k;this.template=g;this.name=h;this._parse()}function n(l,k){this._keywords=l||[];this._templates=[];this.addTemplates(k||[])}l.prototype={getProposal:function(l,k,g){l=k-l.length;k={};var h,f=void 0!==g.delimiter?g.delimiter:"\n";g.indentation&&(f+=g.indentation);var d=void 0!==g.tab?g.tab:"\t",a=0,e=this.variables,b=this.segments;g=[];for(var p=0;p<b.length;p++){var n=b[p],s=e[n];if(void 0!==s)switch(n){case "${tab}":n=
d;break;case "${delimiter}":n=f;break;case "${cursor}":n="";h=a;break;default:var u=k[n];u||(u=k[n]={data:s.data,positions:[]});n=s.substitution;u.data&&u.data.values&&(n=u.data.values[0]);u.positions.push({offset:l+a,length:n.length})}g.push(n);a+=n.length}var f=[],w;for(w in k)k.hasOwnProperty(w)&&f.push(k[w]);g=g.join("");void 0===h&&(h=g.length);return{proposal:g,name:this.name,description:this.description,groups:f,escapePosition:l+h,style:"noemphasis"}},match:function(l){return 0===this.prefix.indexOf(l)},
_parse:function(){var l=this.template,k=[],g={},h,f=0,l=l.replace(/\n/g,"${delimiter}"),l=l.replace(/\t/g,"${tab}");l.replace(/\$\{((?:[^\\}]+|\\.))*\}/g,function(d,a,e){var b=d.substring(2,d.length-1);a=d;var p=b,n=null,s=p.indexOf(":");-1!==s&&(p=p.substring(0,s),a="${"+p+"}",n=JSON.parse(b.substring(s+1).replace("\\}","}").trim()));(b=g[a])||(b=g[a]={});b.substitution=p;n&&(b.data=n);(h=l.substring(f,e))&&k.push(h);k.push(a);f=e+d.length;return p});(h=l.substring(f,l.length))&&k.push(h);this.segments=
k;this.variables=g}};n.prototype={addTemplates:function(m){for(var k=this.getTemplates(),g=0;g<m.length;g++)k.push(new l(m[g].prefix,m[g].description,m[g].template,m[g].name))},initialize:function(){},computeProposals:function(l,k,g){var h=this.getPrefix(l,k,g),f=[];this.isValid(h,l,k,g)&&(f=f.concat(this.getTemplateProposals(h,k,g)),f=f.concat(this.getKeywordProposals(h)));return f},getKeywords:function(){return this._keywords},getKeywordProposals:function(l){var k=[],g=this.getKeywords();if(g){for(var h=
0;h<g.length;h++)0===g[h].indexOf(l)&&k.push({proposal:g[h].substring(l.length),description:g[h],style:"noemphasis_keyword"});0<k.length&&k.splice(0,0,{proposal:"",description:"Keywords",style:"noemphasis_title_keywords",unselectable:!0})}return k},getPrefix:function(l,k,g){return g.prefix},getTemplates:function(){return this._templates},getTemplateProposals:function(l,k,g){for(var h=[],f=this.getTemplates(),d=0;d<f.length;d++){var a=f[d];a.match(l)&&(a=a.getProposal(l,k,g),this.removePrefix(l,a),
h.push(a))}0<h.length&&(h.sort(function(a,b){return a.name<b.name?-1:a.name>b.name?1:0}),h.splice(0,0,{proposal:"",description:"Templates",style:"noemphasis_title",unselectable:!0}));return h},removePrefix:function(l,k){if(!(k.overwrite=k.proposal.substring(0,l.length)!==l))k.proposal=k.proposal.substring(l.length)},isValid:function(l,k,g,h){return!0}};return{Template:l,TemplateContentAssist:n}});
define("orion/editor/linkedMode","i18n!orion/editor/nls/messages orion/keyBinding orion/editor/keyModes orion/editor/annotations orion/editor/templates orion/objects orion/util".split(" "),function(l,n,m,k,g,h){function f(a,e,b){var d=a.getTextView();m.KeyMode.call(this,d);this.editor=a;this.undoStack=e;this.contentAssist=b;this.linkedModeModel=null;d.setAction("linkedModeEnter",function(){this.exitLinkedMode(!0);return!0}.bind(this));d.setAction("linkedModeCancel",function(){this.exitLinkedMode(!1);
return!0}.bind(this));d.setAction("linkedModeNextGroup",function(){var a=this.linkedModeModel;this.selectLinkedGroup((a.selectedGroupIndex+1)%a.groups.length);return!0}.bind(this));d.setAction("linkedModePreviousGroup",function(){var a=this.linkedModeModel;this.selectLinkedGroup(0<a.selectedGroupIndex?a.selectedGroupIndex-1:a.groups.length-1);return!0}.bind(this));this.linkedModeListener={onActivating:function(a){this._groupContentAssistProvider&&(this.contentAssist.setProviders([this._groupContentAssistProvider]),
this.contentAssist.setProgress(null))}.bind(this),onModelChanged:function(a){if(!this.ignoreVerify){for(var b=this.editor.mapOffset(a.start),e=this.linkedModeModel,d,f;e;)if(d=this._getPositionChanged(e,b,b+a.removedCharCount),f=d.position,void 0===f||f.model!==e)this.exitLinkedMode(!1),e=this.linkedModeModel;else break;if(e){e=0;a=a.addedCharCount-a.removedCharCount;d=d.positions;for(var g,h=0;h<d.length;++h){g=d[h];f=g.position;var k=f.offset<=b&&b<=f.offset+f.length;k&&!g.ansestor?(f.offset+=e,
f.length+=a,e+=a):(f.offset+=e,g.ansestor&&k&&(f.length+=a));g.escape&&(g.model.escapePosition=f.offset)}this._updateAnnotations(d)}}}.bind(this),onVerify:function(a){if(!this.ignoreVerify){for(var b=this.editor,e=b.mapOffset(a.start),d=this.editor.mapOffset(a.end),f=this.linkedModeModel,g,h;f;)if(g=this._getPositionChanged(f,e,d),h=g.position,void 0===h||h.model!==f)this.exitLinkedMode(!1),f=this.linkedModeModel;else break;if(f){var k=this._compoundChange;k?k.owner.model===f&&k.owner.group===h.group||
(this.endUndo(),this.startUndo()):this.startUndo();f.selectedGroupIndex=h.group;var k=0,l=a.text.length-(d-e);g=g.positions;for(var p,e=e-h.position.offset,m=d-h.position.offset,n=0;n<g.length;++n)p=g[n],d=p.position,p.oldOffset=d.offset,p.model===f&&p.group===h.group?(d.offset+=k,d.length+=l,k+=l):(d.offset+=k,p.ansestor&&(d.length+=h.count*l)),p.escape&&(p.model.escapePosition=d.offset);this.ignoreVerify=!0;for(n=g.length-1;0<=n;n--)p=g[n],p.model===f&&p.group===h.group&&b.setText(a.text,p.oldOffset+
e,p.oldOffset+m);this.ignoreVerify=!1;a.text=null;this._updateAnnotations(g)}}}.bind(this)}}var d={};f.prototype=new m.KeyMode;h.mixin(f.prototype,{createKeyBindings:function(){var a=n.KeyBinding,e=[];e.push({actionID:"linkedModeEnter",keyBinding:new a(13)});e.push({actionID:"linkedModeCancel",keyBinding:new a(27)});e.push({actionID:"linkedModeNextGroup",keyBinding:new a(9)});e.push({actionID:"linkedModePreviousGroup",keyBinding:new a(9,!1,!0)});return e},enterLinkedMode:function(a){if(!this.linkedModeModel){var e=
this.editor.getTextView();e.addKeyMode(this);e.addEventListener("Verify",this.linkedModeListener.onVerify);e.addEventListener("ModelChanged",this.linkedModeListener.onModelChanged);this.contentAssist.addEventListener("Activating",this.linkedModeListener.onActivating);this.editor.reportStatus(l.linkedModeEntered,null,!0)}this._sortedPositions=null;this.linkedModeModel&&(a.previousModel=this.linkedModeModel,a.parentGroup=this.linkedModeModel.selectedGroupIndex,this.linkedModeModel.nextModel=a);this.linkedModeModel=
a;this.selectLinkedGroup(0)},exitLinkedMode:function(a){if(this.isActive()){this._compoundChange&&(this.endUndo(),this._compoundChange=null);this._sortedPositions=null;var e=this.linkedModeModel;this.linkedModeModel=e.previousModel;e.parentGroup=e.previousModel=void 0;this.linkedModeModel&&(this.linkedModeModel.nextModel=void 0);if(!this.linkedModeModel){var b=this.editor,d=b.getTextView();d.removeKeyMode(this);d.removeEventListener("Verify",this.linkedModeListener.onVerify);d.removeEventListener("ModelChanged",
this.linkedModeListener.onModelChanged);d=this.contentAssist;d.removeEventListener("Activating",this.linkedModeListener.onActivating);d.offset=void 0;this.editor.reportStatus(l.linkedModeExited,null,!0);a&&b.setCaretOffset(e.escapePosition,!1)}this.selectLinkedGroup(0)}},startUndo:function(){if(this.undoStack){var a=this,e=this.linkedModeModel;this._compoundChange=this.undoStack.startCompoundChange({model:e,group:e.selectedGroupIndex,end:function(){a._compoundChange=null}})}},endUndo:function(){this.undoStack&&
this.undoStack.endCompoundChange()},isActive:function(){return!!this.linkedModeModel},isStatusActive:function(){return!!this.linkedModeModel},selectLinkedGroup:function(a){var e=this.linkedModeModel;if(e){e.selectedGroupIndex=a;a=e.groups[a];var b=a.positions[0],d=this.editor;d.setSelection(b.offset,b.offset+b.length);if(e=this.contentAssist)e.offset=void 0,a.data&&"link"===a.data.type&&a.data.values?((this._groupContentAssistProvider=new g.TemplateContentAssist(a.data.values)).getPrefix=function(){var a=
d.getSelection();return a.start===a.end&&(a=d.getCaretOffset(),b.offset<=a&&a<=b.offset+b.length)?d.getText(b.offset,a):""},e.offset=b.offset,e.deactivate(),e.activate()):this._groupContentAssistProvider&&(this._groupContentAssistProvider=null,e.deactivate())}this._updateAnnotations()},_getModelPositions:function(a,e,b){for(var d=e.groups,f=0;f<d.length;f++)for(var g=d[f].positions,h=0;h<g.length;h++){var k=g[h];b&&(k={offset:k.offset+b,length:k.length});k={index:h,group:f,count:g.length,model:e,
position:k};a.push(k);e.nextModel&&e.nextModel.parentGroup===f&&(k.ansestor=!0,this._getModelPositions(a,e.nextModel,(b||0)+g[h].offset-g[0].offset))}},_getSortedPositions:function(a){var e=this._sortedPositions;if(!e){for(e=[];a.previousModel;)a=a.previousModel;for(this._getModelPositions(e,a);a;)void 0!==a.escapePosition&&e.push({escape:!0,model:a,position:{offset:a.escapePosition,length:0}}),a=a.nextModel;e.sort(function(a,e){return a.position.offset-e.position.offset});this._sortedPositions=e}return e},
_getPositionChanged:function(a,e,b){var d;a=this._getSortedPositions(a);for(var f=a.length-1;0<=f;f--){var g=a[f].position;if(g.offset<=e&&b<=g.offset+g.length){d=a[f];break}}return{position:d,positions:a}},_updateAnnotations:function(a){var e=this.editor.getAnnotationModel();if(e){for(var b=[],d=[],f=e.getAnnotations(),g;f.hasNext();)switch(g=f.next(),g.type){case k.AnnotationType.ANNOTATION_LINKED_GROUP:case k.AnnotationType.ANNOTATION_CURRENT_LINKED_GROUP:case k.AnnotationType.ANNOTATION_SELECTED_LINKED_GROUP:b.push(g)}if(f=
this.linkedModeModel){a=a||this._getSortedPositions(f);for(var h=0;h<a.length;h++)if(g=a[h],g.model===f){var l=k.AnnotationType.ANNOTATION_LINKED_GROUP;g.group===f.selectedGroupIndex&&(l=0===g.index?k.AnnotationType.ANNOTATION_SELECTED_LINKED_GROUP:k.AnnotationType.ANNOTATION_CURRENT_LINKED_GROUP);g=g.position;g=k.AnnotationType.createAnnotation(l,g.offset,g.offset+g.length,"");d.push(g)}}e.replaceAnnotations(b,d)}}});d.LinkedMode=f;return d});
define("orion/editor/factories","orion/editor/actions orion/editor/undoStack orion/editor/rulers orion/editor/annotations orion/editor/textDND orion/editor/linkedMode".split(" "),function(l,n,m,k,g,h){function f(){}function d(){}function a(){}function e(){}function b(){}function p(){}var q={};f.prototype={createKeyBindings:function(a,b,e,d){d=new l.TextActions(a,b,d);var f=new h.LinkedMode(a,b,e);a=new l.SourceCodeActions(a,b,e,f);return{textActions:d,linkedMode:f,sourceCodeActions:a}}};q.KeyBindingsFactory=
f;d.prototype={createUndoStack:function(a){a=a.getTextView();return new n.UndoStack(a,200)}};q.UndoFactory=d;a.prototype={createLineNumberRuler:function(a){return new m.LineNumberRuler(a,"left",{styleClass:"ruler lines"},{styleClass:"rulerLines odd"},{styleClass:"rulerLines even"})}};q.LineNumberRulerFactory=a;e.prototype={createFoldingRuler:function(a){return new m.FoldingRuler(a,"left",{styleClass:"ruler folding"})}};q.FoldingRulerFactory=e;b.prototype={createAnnotationModel:function(a){return new k.AnnotationModel(a)},
createAnnotationStyler:function(a,b){return new k.AnnotationStyler(a,b)},createAnnotationRulers:function(a){var b=new m.AnnotationRuler(a,"left",{styleClass:"ruler annotations"});a=new m.OverviewRuler(a,"right",{styleClass:"ruler overview"});return{annotationRuler:b,overviewRuler:a}}};q.AnnotationFactory=b;p.prototype={createTextDND:function(a,b){return new g.TextDND(a.getTextView(),b)}};q.TextDNDFactory=p;return q});
define("orion/editor/editorFeatures",["orion/editor/factories","orion/editor/actions","orion/editor/linkedMode","orion/objects"],function(l,n,m,k){return k.mixin({},l,n,m)});define("text!orion/compare/sideBySideTemplate.html",[],function(){return'\x3cdiv id\x3d"topWidget_id" style\x3d"height:100%;width:100%;position:relative"\x3e\n\t\x3cdiv class\x3d"leftPanelLayout "\x3e\n\t\t\x3cdiv class\x3d"titleActionContainer"\x3e\n\t\t\t\x3cdiv class\x3d"compareActionContainer" id\x3d"left_action_id"\x3e\x3c/div\x3e\n\t\t\t\x3cdiv class\x3d"titleContainer" id\x3d"left_title_id"\x3e\x3c/div\x3e\n\t\t\x3c/div\x3e\n\t\t\x3cdiv class\x3d"compareEditorParent" id\x3d"left_editor_id"\x3e\x3c/div\x3e\n\t\t\x3cdiv class\x3d"statusContainer" id\x3d"left_status_id"\x3e\x3c/div\x3e\n\t\x3c/div\x3e\n\t\x3cdiv class\x3d"split compareSplitLayout"\x3e\x3c/div\x3e\n\t\x3cdiv class\x3d"rightPanelLayout"\x3e\n\t\t\x3cdiv class\x3d"titleActionContainer"\x3e\n\t\t\t\x3cdiv class\x3d"compareActionContainer" id\x3d"right_action_id"\x3e\x3c/div\x3e\n\t\t\t\x3cdiv class\x3d"titleContainer" id\x3d"right_title_id"\x3e\x3c/div\x3e\n\t\t\x3c/div\x3e\n\t\t\x3cdiv class\x3d"compareEditorParent"  id\x3d"right_editor_wrapper_id"\x3e\n\t\t\t\x3cdiv class\x3d"canvasContainer"\x3e\n\t\t\t\t\x3ccanvas id\x3d"diff_canvas_id" class\x3d"compareCanvas" width\x3d"46" height\x3d"3000"\x3e\x3c/canvas\x3e\n\t\t\t\x3c/div\x3e\n\t\t\t\x3cdiv class\x3d"compareEditorParentWithCanvas" id\x3d"right_editor_id"\x3e\x3c/div\x3e\n\t\t\x3c/div\x3e\n\t\t\x3cdiv class\x3d"statusContainer" id\x3d"right_status_id"\x3e\x3c/div\x3e\n\t\x3c/div\x3e\n\x3c/div\x3e'});
define("orion/compare/compareUIFactory",["orion/webui/littlelib","orion/webui/splitter","text!orion/compare/sideBySideTemplate.html"],function(l,n,m){var k=k||{};k.TwoWayCompareUIFactory=function(){function g(g){this._parentDivID=g.parentDivID;this._commandSpanId=g.commandSpanId;this._showTitle=g.showTitle;this._leftTitle=g.leftTitle;this._rightTitle=g.rightTitle;this._showLineStatus=g.showLineStatus}g.prototype={_init:function(){var g=this._parentDivID+"_";this._topWidgetDiv=l.node("topWidget_id");
this._topWidgetDiv.id=g+"topWidget_id";this._leftEditorParentDiv=l.node("left_editor_id");this._leftEditorParentDiv.id=g+"left_editor_id";this._rightEditorParentDiv=l.node("right_editor_id");this._rightEditorParentDiv.id=g+"right_editor_id";this._rightEditorWrapperDiv=l.node("right_editor_wrapper_id");this._rightEditorWrapperDiv.id=g+"right_editor_wrapper_id";this._leftActionDiv=l.node("left_action_id");this._leftActionDiv.id=g+"left_action_id";this._rightActionDiv=l.node("right_action_id");this._rightActionDiv.id=
g+"right_action_id";this._leftTitleDiv=l.node("left_title_id");this._leftTitleDiv.id=g+"left_title_id";this._rightTitleDiv=l.node("right_title_id");this._rightTitleDiv.id=g+"right_title_id";this._leftStatusDiv=l.node("left_status_id");this._leftStatusDiv.id=g+"left_status_id";this._rightStatusDiv=l.node("right_status_id");this._rightStatusDiv.id=g+"right_status_id";this._diffCanvasDiv=l.node("diff_canvas_id");this._diffCanvasDiv.id=g+"diff_canvas_id";this._splitterId=g+"orion_splitter";this._showTitle||
this.disableTitle();this._showLineStatus||this.disableLineStatus()},_createSplitter:function(){var g=l.$(".split",this._topWidgetDiv);g.id=this._splitterId;var f=l.$(".leftPanelLayout",this._topWidgetDiv),d=l.$(".rightPanelLayout",this._topWidgetDiv);g&&(f&&d)&&(this._splitter=new n.Splitter({node:g,sidePanel:f,mainPanel:d}))},buildUI:function(){l.node(this._parentDivID).innerHTML=m;this._init();this._createSplitter()},destroy:function(){},getSplitter:function(){return this._splitter},isLeftPane:function(g){return l.$(".leftPanelLayout",
this._topWidgetDiv)===g},getEditorParentDiv:function(g){return g?this._leftEditorParentDiv:this._rightEditorParentDiv},getTitleDiv:function(g){return g?this._leftTitleDiv:this._rightTitleDiv},getActionDivId:function(g){return g?this._leftActionDiv.id:this._rightActionDiv.id},getStatusDiv:function(g){return g?this._leftStatusDiv:this._rightStatusDiv},getCommandSpanId:function(){return this._commandSpanId},getDiffCanvasDiv:function(){return this._diffCanvasDiv},disableTitle:function(){this._leftEditorParentDiv.style.top=
"0px";this._rightEditorWrapperDiv.style.top="0px";this._leftTitleDiv.style.height="0px";this._rightTitleDiv.style.height="0px"},disableLineStatus:function(){this._leftEditorParentDiv.style.marginBottom="0px";this._rightEditorWrapperDiv.style.marginBottom="0px";this._leftStatusDiv.style.height="0px";this._rightStatusDiv.style.height="0px"}};return g}();return k});
var JsDiff=function(){function l(d){for(var a=[],e=0;e<d.length;e++)d[e]&&a.push(d[e]);return a}function n(d){d=d.replace(/&/g,"\x26amp;");d=d.replace(/</g,"\x26lt;");d=d.replace(/>/g,"\x26gt;");return d=d.replace(/"/g,"\x26quot;")}var m=function(d){this.ignoreWhitespace=d};m.prototype={diff:function(d,a){if(a==d)return[{value:a}];if(!a)return[{value:d,removed:!0}];if(!d)return[{value:a,added:!0}];a=this.tokenize(a);d=this.tokenize(d);var e=a.length,b=d.length,f=e+b,g=[{newPos:-1,components:[]}],
h=this.extractCommon(g[0],a,d,0);if(g[0].newPos+1>=e&&h+1>=b)return g[0].components;for(var k=1;k<=f;k++)for(var l=-1*k;l<=k;l+=2){var m;m=g[l-1];var n=g[l+1],h=(n?n.newPos:0)-l;m&&(g[l-1]=void 0);var r=m&&m.newPos+1<e,t=n&&0<=h&&h<b;if(!r&&!t)g[l]=void 0;else{!r||t&&m.newPos<n.newPos?(m={newPos:n.newPos,components:n.components.slice(0)},this.pushComponent(m.components,d[h],void 0,!0)):(m={newPos:m.newPos,components:m.components.slice(0)},m.newPos++,this.pushComponent(m.components,a[m.newPos],!0,
void 0));h=this.extractCommon(m,a,d,l);if(m.newPos+1>=e&&h+1>=b)return m.components;g[l]=m}}},pushComponent:function(d,a,e,b){var f=d[d.length-1];f&&f.added===e&&f.removed===b?d[d.length-1]={value:this.join(f.value,a),added:e,removed:b}:d.push({value:a,added:e,removed:b})},extractCommon:function(d,a,e,b){var f=a.length,g=e.length,h=d.newPos;for(b=h-b;h+1<f&&b+1<g&&this.equals(a[h+1],e[b+1]);)h++,b++,this.pushComponent(d.components,a[h],void 0,void 0);d.newPos=h;return b},equals:function(d,a){var e=
/\S/;return this.ignoreWhitespace&&!e.test(d)&&!e.test(a)?!0:d==a},join:function(d,a){return d+a},tokenize:function(d){return d}};var k=new m,g=new m(!1);g.tokenize=function(d){return l(d.split(/(\s+|\b)/))};var h=new m(!0);h.tokenize=function(d){return l(d.split(/([{}:;,]|\s+)/))};var f=new m;f.tokenize=function(d){return d.split(/^/m)};return{diffChars:function(d,a){return k.diff(d,a)},diffWords:function(d,a){return g.diff(d,a)},diffLines:function(d,a){return f.diff(d,a)},diffCss:function(d,a){return h.diff(d,
a)},createPatch:function(d,a,e,b,g){var h=[];h.push("Index: "+d);h.push("\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d\x3d");h.push("--- "+d+"\t"+b);h.push("+++ "+d+"\t"+g);d=f.diff(a,e);d.push({value:"",lines:[]});e=a=0;b=[];for(var k=g=1,l=0;l<d.length;l++){var m=d[l],n=m.lines||
m.value.replace(/\n$/,"").split("\n");m.lines=n;if(m.added||m.removed){if(!a){var y=d[l-1];a=g;e=k;y&&(b.push.apply(b,y.lines.slice(-4).map(function(a){return" "+a})),a-=4,e-=4)}b.push.apply(b,n.map(function(a){return(m.added?"+":"-")+a}));m.added?k+=n.length:g+=n.length}else a&&(8>=n.length&&l<d.length-1?b.push.apply(b,n.map(function(a){return" "+a})):(y=Math.min(n.length,4),h.push("@@ -"+a+","+(g-a+y)+" +"+e+","+(k-e+y)+" @@"),h.push.apply(h,b),h.push.apply(h,n.slice(0,y).map(function(a){return" "+
a})),e=a=0,b=[])),g+=n.length,k+=n.length}1<d.length&&!/\n$/.test(d[d.length-2].value)&&h.push("\\ No newline at end of file\n");return h.join("\n")},convertChangesToXML:function(d){for(var a=[],e=0;e<d.length;e++){var b=d[e];b.added?a.push("\x3cins\x3e"):b.removed&&a.push("\x3cdel\x3e");a.push(n(b.value));b.added?a.push("\x3c/ins\x3e"):b.removed&&a.push("\x3c/del\x3e")}return a.join("")}}}();"undefined"!==typeof module&&(module.exports=JsDiff);
"function"===typeof define&&define.amd&&define("jsdiff/diff",[],function(){return JsDiff});
define("orion/compare/jsdiffAdapter",["jsdiff/diff"],function(l){var n=n||{};n.JSDiffAdapter=function(){function m(){}m.prototype={_specialLine:function(k,g,h){return g.value===k&&h!==k},adapt:function(k,g,h){h||(h="\n");var f=k.split(h),d=g.split(h),a=""===f[f.length-1],d=""===d[d.length-1],e=l.diffLines(k,g);k=[];g=[];for(var b=0,p=0,m=-1,n=0,u=!0,w=h,x=0;x<e.length;x++){var y=e[x],r=y.lines||y.value.split(h),t=r.length,z=0;1<r.length&&""===r[r.length-1]&&t--;1<t&&!u&&""===r[0]&&(t--,z++);y.lines=
r;if(!y.added&&!y.removed){if(!this._specialLine(h,y,w)){if(b||p)k.push([b,p,m]),p=b=0,m=-1,n+=p;k.push([t,t,0]);n+=t}}else if(y.added){-1===m&&(m=g.length+1);b+=t;for(u=z;u<t+z;u++)g.push(y.lines[u])}else p+=t;u=!1;1<r.length&&""===r[r.length-1]&&(u=!0);w=y.value?y.value[y.value.length-1]:h}if(b||p)k.push([b,p,m]),n+=p;n<f.length&&1<f.length&&(h=k[k.length-1],0===h[2]?(h[0]+=1,h[1]+=1):-1===h[2]?k.push([1,1,0]):a===d?k.push([1,1,0]):(d&&(h[0]+=1),a&&(h[1]+=1)));return{mapper:k,changContents:{array:g,
index:0}}},adaptCharDiff:function(k,g,h){k=h?l.diffWords(k,g):l.diffChars(k,g);g=[];for(var f=h=0,d=0,a=0,e=0;e<k.length;e++){var b=k[e];if(!b.added&&!b.removed){if(0<d||0<a)g.push([f,f+d,h,h+a]),f+=d,h+=a,a=d=0;f+=b.value.length;h+=b.value.length}else b.added?d+=b.value.length:a+=b.value.length}(0<d||0<a)&&g.push([f,f+d,h,h+a]);return g}};return m}();return n});
define("orion/compare/diffTreeNavigator",["orion/treeModelIterator","orion/compare/compareUtils","orion/editor/annotations","orion/compare/jsdiffAdapter"],function(l,n,m,k){var g={},h,f,d,a,e,b,p,q,s,u,w,x,y,r,t,z;g.DiffTreeNavigator=function(){function g(a,b,e,d,f,h){this._root={type:"root",children:[]};this._initialized=!1;this.initAll(a,b,e,d,f,h)}h="orion.annotation.diff.addedBlock";f="orion.annotation.diff.currentAddedBlock";d="orion.annotation.diff.deletedBlock";a="orion.annotation.diff.currentDeletedBlock";
e="orion.annotation.diff.blockTop";b="orion.annotation.diff.currentBlockTop";p="orion.annotation.diff.blockConflict";q="orion.annotation.diff.currentBlockConflict";s="orion.annotation.diff.addedWord";u="orion.annotation.diff.currentAddedWord";w="orion.annotation.diff.deletedWord";x="orion.annotation.diff.currentDeletedWord";y="orion.annotation.diff.emptyDeletedWordLeft";r="orion.annotation.diff.emptyDeletedWordRight";t="orion.annotation.diff.emptyAddedWordLeft";z="orion.annotation.diff.emptyAddedWordRight";
m.AnnotationType.registerType(h,{title:"",html:"",lineStyle:{styleClass:"annotationLine addedBlockDiff"}});m.AnnotationType.registerType(f,{title:"",html:"",lineStyle:{styleClass:"annotationLine currentAddedBlockDiff"}});m.AnnotationType.registerType(d,{title:"",html:"",lineStyle:{styleClass:"annotationLine deletedBlockDiff"}});m.AnnotationType.registerType(a,{title:"",html:"",lineStyle:{styleClass:"annotationLine currentDeletedBlockDiff"}});m.AnnotationType.registerType(e,{title:"",html:"",lineStyle:{styleClass:"annotationLine blockDiffTopOnly"}});
m.AnnotationType.registerType(b,{title:"",html:"",lineStyle:{styleClass:"annotationLine currentBlockDiffTopOnly"}});m.AnnotationType.registerType(p,{title:"",html:"",lineStyle:{styleClass:"annotationLine blockDiffConflict"}});m.AnnotationType.registerType(q,{title:"",html:"",lineStyle:{styleClass:"annotationLine currentBlockDiffConflict"}});m.AnnotationType.registerType(s,{title:"word added",html:"",rangeStyle:{styleClass:"annotationRange addedWordDiff"}});m.AnnotationType.registerType(u,{title:"",
html:"",rangeStyle:{styleClass:"annotationRange currentAddedWordDiff"}});m.AnnotationType.registerType(w,{title:"word deleted",html:"",rangeStyle:{styleClass:"annotationRange deletedWordDiff"}});m.AnnotationType.registerType(x,{title:"",html:"",rangeStyle:{styleClass:"annotationRange currentDeletedWordDiff"}});m.AnnotationType.registerType(y,{title:"",html:"",rangeStyle:{styleClass:"annotationRange emptyDeletedWordDiffLeft"}});m.AnnotationType.registerType(r,{title:"",html:"",rangeStyle:{styleClass:"annotationRange emptyDeletedWordDiffRight"}});
m.AnnotationType.registerType(t,{title:"",html:"",rangeStyle:{styleClass:"annotationRange emptyAddedWordDiffLeft"}});m.AnnotationType.registerType(z,{title:"",html:"",rangeStyle:{styleClass:"annotationRange emptyAddedWordDiffRight"}});g.prototype={initAll:function(a,b,e,d,f,g,h){this._charOrWordDiff=a?a:"word";b&&(this._initialized=!0);this.editorWrapper=[{editor:b,diffFeeder:d},{editor:e,diffFeeder:f}];this._curveRuler=h;(this._overviewRuler=g)&&this._overviewRuler.setDiffNavigator(this)},initMapper:function(a){if(a)for(var b=
0;b<this.editorWrapper.length;b++)this.editorWrapper[b].diffFeeder.init(this.editorWrapper[b].editor.getTextView().getModel(),a)},destroy:function(){this.initAll(this._charOrWordDiff)},renderAnnotations:function(){var a;for(a=0;a<this.editorWrapper.length;a++){this.editorWrapper[a].annoTypes=[];this.editorWrapper[a].diffFeeder.getBlockAnnoTypes(this.editorWrapper[a].annoTypes);this.editorWrapper[a].diffFeeder.getWordAnnoTypes(this.editorWrapper[a].annoTypes);for(var b=0;b<this.editorWrapper[a].annoTypes.length;b++)this.editorWrapper[a].annoTypes[b].current&&
this.editorWrapper[a].editor.getAnnotationStyler().addAnnotationType(this.editorWrapper[a].annoTypes[b].current),this.editorWrapper[a].annoTypes[b].normal&&this.editorWrapper[a].editor.getAnnotationStyler().addAnnotationType(this.editorWrapper[a].annoTypes[b].normal)}this._root.children=[];b=this.editorWrapper[0].diffFeeder.getDiffBlocks();if(!b||0===b.length)this.replaceAllAnnotations(!0,0,"block",!1,[]),this.replaceAllAnnotations(!0,1,"block",!1,[]),this.replaceAllAnnotations(!0,0,"word",!1,[]),
this.replaceAllAnnotations(!0,1,"word",!1,[]),this.replaceAllAnnotations(!0,0,"block",!0,[]),this.replaceAllAnnotations(!0,1,"block",!0,[]),this.replaceAllAnnotations(!0,0,"word",!0,[]),this.replaceAllAnnotations(!0,1,"word",!0,[]);else{var e=new k.JSDiffAdapter;for(a=0;a<b.length;a++){var d=this.generatePairBlockAnnotations(this._root,a);this._root.children.push(d);var f=this.generatePairWordAnnotations(d,a,e);f&&(d.children=f)}this.replaceAllAnnotations(!1,0,"block",!0);this.replaceAllAnnotations(!1,
1,"block",!0);this.replaceAllAnnotations(!1,0,"word",!0);this.replaceAllAnnotations(!1,1,"word",!0);this.iterator=new l.TreeModelIterator(this._root.children)}},replaceAllAnnotations:function(a,b,e,d,f){if(this.editorWrapper[b].annoTypes)for(var g=0;g<this.editorWrapper[b].annoTypes.length;g++)this.editorWrapper[b].annoTypes[g].type===e&&this.replaceDiffAnnotations(this.editorWrapper[b].editor,f?f:this.editorWrapper[b].annoTypes[g].list,d?this.editorWrapper[b].annoTypes[g].normal:this.editorWrapper[b].annoTypes[g].current,
a)},getMapper:function(){return this.editorWrapper[0].diffFeeder.getMapper()},getFeeder:function(a){return a?this.editorWrapper[1].diffFeeder:this.editorWrapper[0].diffFeeder},iterateOnBlock:function(a,b){this.iterator&&(this.iterator.iterateOnTop(a,b),this.updateCurrentAnnotation(!0))},iterateOnChange:function(a){if(!this.iterator)return null;var b=this.iterator.iterate(a);if(b){var e=this.iterator.cursor();"block"===e.type&&(e.children&&0<e.children.length)&&this.iterator.iterate(a);this.updateCurrentAnnotation(!0)}return b},
gotoBlock:function(a,b){if(this.iterator){if(0>a||a>=this._root.children.length||0===this._root.children.length)a=0;void 0!==b&&0<=b&&this._root.children[a].children&&b<this._root.children[a].children.length?this.iterator.setCursor(this._root.children[a].children[b]):this.iterator.setCursor(this._root.children[a]);this.updateCurrentAnnotation(!1);this._positionDiffBlock()}},_hitDiffAnnotation:function(a,b,e){if(e===this.editorWrapper[a].editor.getTextView()){for(var d=0;d<this._root.children.length;d++){e=
this._root.children[d];var f=0===a?e.oldA:e.newA;if(b>=f.start&&b<=f.end){d=e;if(e.children&&0<e.children.length)for(f=0;f<e.children.length;f++){var g=e.children[f],h=0===a?g.oldA:g.newA;if(b>=h.start&&b<=h.end){d=g;break}}return d}}return null}},gotoChange:function(a,b){for(var e=0;e<this.editorWrapper.length;e++){var d=this._hitDiffAnnotation(e,a,b);if(d)return this.iterator.setCursor(d),this.updateCurrentAnnotation(!1,b),!0}return!1},getCurrentBlockIndex:function(){if(!this.iterator)return-1;
var a=this.iterator.cursor();return!a?-1:"block"===a.type?a.index:a.parent.index},getCurrentPosition:function(){if(!this.iterator)return{};var a=this.iterator.cursor();return"block"===a.type?{block:a.index+1}:{block:a.parent.index+1,change:a.index+1}},getCurrentMapperIndex:function(){var a=this.getCurrentBlockIndex();0>a&&(a=0);var b=this.getFeeder().getDiffBlocks();if(!b||0===b.length)return-1;a>b.length-1&&(a=0);return b[a][1]},replaceDiffAnnotations:function(a,b,e,d){if(b&&e&&(a=a.getAnnotationModel())){for(var f=
a.getAnnotations(),g=[];d&&f.hasNext();){var h=f.next();h.type===e&&g.push(h)}a.replaceAnnotations(g,b)}},updateCurrentAnnotation:function(a,b){this.replaceAllAnnotations(!0,0,"block",!1,[]);this.replaceAllAnnotations(!0,1,"block",!1,[]);this.replaceAllAnnotations(!0,0,"word",!1,[]);this.replaceAllAnnotations(!0,1,"word",!1,[]);if(this.iterator){var e=this.iterator.cursor();if(e){var d,f,g={start:e.oldA.start,end:e.oldA.end},h={start:e.newA.start,end:e.newA.end};"word"===e.type?(d=this.editorWrapper[0].diffFeeder.getCurrentWordAnnoType(g,
this.editorWrapper[0].editor.getTextView().getModel()),f=this.editorWrapper[1].diffFeeder.getCurrentWordAnnoType(h,this.editorWrapper[1].editor.getTextView().getModel())):(d=this.editorWrapper[0].diffFeeder.getCurrentBlockAnnoType(e.index),f=this.editorWrapper[1].diffFeeder.getCurrentBlockAnnoType(e.index));d&&this.replaceDiffAnnotations(this.editorWrapper[0].editor,[new (m.AnnotationType.getType(d.current))(g.start,g.end)],d,!0);f&&this.replaceDiffAnnotations(this.editorWrapper[1].editor,[new (m.AnnotationType.getType(f.current))(h.start,
h.end)],f,!0);a?(this.autoSelecting=!0,this.editorWrapper[0].editor.setSelection(e.oldA.start,e.oldA.end,!0),this.editorWrapper[1].editor.setSelection(e.newA.start,e.newA.end,!0),this.autoSelecting=!1):b&&(this.autoSelecting=!0,b!==this.editorWrapper[0].editor.getTextView()&&this.editorWrapper[0].editor.setSelection(e.oldA.start,e.oldA.end,!0),b!==this.editorWrapper[1].editor.getTextView()&&this.editorWrapper[1].editor.setSelection(e.newA.start,e.newA.end,!0),this.autoSelecting=!1)}}},generatePairBlockAnnotations:function(a,
b){var e=this.generateBlockDiffAnnotations(0,b),d=this.generateBlockDiffAnnotations(1,b);return{parent:a,index:b,type:"block",oldA:e,newA:d}},generatePairWordAnnotations:function(a,b,e){var d=this.editorWrapper[0].diffFeeder.getTextOnBlock(b),f=this.editorWrapper[1].diffFeeder.getTextOnBlock(b);b=null;var g=0,h=0;if(d&&f&&d.text&&f.text&&5E3>=d.text.length&&5E3>=f.text.length)b=e.adaptCharDiff(d.text,f.text,"word"===this._charOrWordDiff),h=f.start,g=d.start;else return null;e=[];d=[];this.generateWordDiffAnnotations(0,
e,g,b,2,3);this.generateWordDiffAnnotations(1,d,h,b,0,1);b=[];for(g=0;g<e.length;g++)b.push({parent:a,index:g,type:"word",oldA:e[g],newA:d[g]});return b},getAnnoModelList:function(a,b,e){for(var d=0;d<this.editorWrapper[a].annoTypes.length;d++)if(this.editorWrapper[a].annoTypes[d].type===b&&this.editorWrapper[a].annoTypes[d].normal===e)return this.editorWrapper[a].annoTypes[d].list;return null},generateBlockDiffAnnotations:function(a,b){var e=this.editorWrapper[a].diffFeeder.getCurrentBlockAnnoType(b),
d=this.getAnnoModelList(a,"block",e.normal),f=this.editorWrapper[a].diffFeeder.getCharRange(b),e=m.AnnotationType.createAnnotation(e.normal,f.start,f.end);d&&d.push(e);return e},generateWordDiffAnnotations:function(a,b,e,d,f,g){if(d){var h=this.editorWrapper[a].diffFeeder.getCurrentWordAnnoType({start:-1,end:-1});a=this.getAnnoModelList(a,"word",h.normal);for(var k=0;k<d.length;k++){var l=m.AnnotationType.createAnnotation(h.normal,d[k][f]+e,d[k][g]+e);a.push(l);b.push(l)}}},_updateOverviewRuler:function(){if(this._overviewRuler){var a=
this.editorWrapper[0].editor.getTextView().getTopIndex();this.editorWrapper[0].editor.getTextView().redrawLines(a,a+1,this._overviewRuler)}},_updateCurveRuler:function(){this._curveRuler&&this._curveRuler.render()},_setTextViewPosition:function(a,b){var e=a.getLineHeight(),d=a.getClientArea(),e=Math.floor(d.height/e/3);a.setTopIndex(0<b-e?b-e:0)},_positionDiffBlock:function(){var a=this.getCurrentBlockIndex();0>a&&(a=0);var b=this.getFeeder().getDiffBlocks();0!==b.length&&(this._setTextViewPosition(this.editorWrapper[0].editor.getTextView(),
b[a][0]),this.editorWrapper[0].editor!==this.editorWrapper[1].editor&&(a=n.lookUpLineIndex(this.getMapper(),0,b[a][1]),this._setTextViewPosition(this.editorWrapper[1].editor.getTextView(),a)),this._updateOverviewRuler(),this._updateCurveRuler())},matchPositionFromOverview:function(a){this._initialized&&(a=0>a?0:n.getAnnotationIndex(this.getFeeder().getDiffBlocks(),a),this.gotoBlock(a))},gotoDiff:function(a,b){this.gotoChange(a,b)&&(this._updateOverviewRuler(),this._updateCurveRuler())},nextDiff:function(){this.iterateOnBlock(!0,
!0);this._positionDiffBlock()},prevDiff:function(){this.iterateOnBlock(!1,!0);this._positionDiffBlock()},nextChange:function(){var a=this.iterateOnChange(!0);this._positionDiffBlock();return a},prevChange:function(){this.iterateOnChange(!1);this._positionDiffBlock()}};return g}();g.DiffBlockFeeder=function(){function a(){}a.prototype={_isAddedSide:function(){return 0===this._mapperColumnIndex},getWordAnnoTypes:function(a){this._isAddedSide()?a.push({type:"word",current:u,normal:s,list:[]}):a.push({type:"word",
current:x,normal:w,list:[]});a.push({type:"word",current:y});a.push({type:"word",current:r});a.push({type:"word",current:t});a.push({type:"word",current:z})},getCurrentWordAnnoType:function(a,b){return a.start===a.end&&b?this._isAddedSide()?{current:this._repositionEmptyWord(a,b),normal:s}:{current:this._repositionEmptyWord(a,b),normal:w}:this._isAddedSide()?{current:u,normal:s}:{current:x,normal:w}},_repositionEmptyWord:function(a,b){var e=b.getLineAtOffset(a.start),d=b.getLineStart(e),f=b.getLineEnd(e);
if(d!==f){if(a.start===f)return a.start--,this._isAddedSide()?z:r;a.end++}else if(0<e&&(e--,d=b.getLineStart(e),f=b.getLineEnd(e),d!==f))return a.start=f-1,a.end=f,this._isAddedSide()?z:r;return this._isAddedSide()?t:y},getMapper:function(){return this._mapper},getDiffBlocks:function(){return this._diffBlocks},getDiffBlockH:function(a){if(!this._diffBlocks||0===this._diffBlocks.length)return-1;a=this._diffBlocks[a][1];return-1===a?0:this._mapper[a][this._mapperColumnIndex]},getOverviewLineCount:function(){return this._textModel.getLineCount()},
getLineNumber:function(a){return a},getCharRange:function(a){if(!this._diffBlocks||0===this._diffBlocks.length)return null;var b=this._diffBlocks[a][0],e=b+this._mapper[this._diffBlocks[a][1]][this._mapperColumnIndex]-1;a=this._textModel.getLineStart(b);if(e<b)return{start:a,end:a};b=this._textModel.getLineEnd(e,!0);return{start:a,end:b}},getTextOnBlock:function(a){if(!this._diffBlocks||0===this._diffBlocks.length)return null;a=this.getCharRange(a);return{start:a.start,text:this._textModel.getText(a.start,
a.end)}},isMapperEmpty:function(){return 0===this._mapper.length}};return a}();g.TwoWayDiffBlockFeeder=function(){function k(a,b,e,d){this._mapperColumnIndex=e;this._reverseAnnotation=d;this.init(a,b)}k.prototype=new g.DiffBlockFeeder;k.prototype._isAddedSide=function(){return this._reverseAnnotation?0!==this._mapperColumnIndex:0===this._mapperColumnIndex};k.prototype.init=function(a,b){this._textModel=a;this._diffBlocks=void 0;if(b){this._mapper=b;this._diffBlocks=[];for(var e=0,d=0;d<this._mapper.length;d++)0!==
this._mapper[d][2]&&this._diffBlocks.push([e,d]),e+=this._mapper[d][this._mapperColumnIndex]}};k.prototype.getBlockAnnoTypes=function(g){this._isAddedSide()?g.push({type:"block",normal:h,current:f,list:[]}):g.push({type:"block",normal:d,current:a,list:[]});g.push({type:"block",normal:e,current:b,list:[]});g.push({type:"block",normal:p,current:q,list:[]})};k.prototype.getCurrentBlockAnnoType=function(g){if(!this._diffBlocks||0===this._diffBlocks.length||this._diffBlocks.length<=g)return null;g=this._diffBlocks[g][1];
return 0===this._mapper[g][this._mapperColumnIndex]?{normal:e,current:b}:n.isMapperConflict(this.getMapper(),g)?{normal:p,current:q}:this._isAddedSide()?{type:"block",normal:h,current:f,list:[]}:{type:"block",normal:d,current:a,list:[]}};return k}();g.inlineDiffBlockFeeder=function(){function b(a,e){this._mapperColumnIndex=e;this.init(a)}b.prototype=new g.DiffBlockFeeder;b.prototype.setModel=function(a){this._textModel=a};b.prototype.init=function(a){this._diffBlocks=void 0;if(a){this._mapper=a;this._diffBlocks=
[];this._gapBlocks=[];for(var b=a=0,e=0;e<this._mapper.length;e++){if(0!==this._mapper[e][2]){if(this._isAddedSide()){var d=a+this._mapper[e][1];this._diffBlocks.push([d,e]);this._gapBlocks.push([d,d+this._mapper[e][0],b])}else this._diffBlocks.push([a,e]),this._gapBlocks.push([a,a+this._mapper[e][1],b]);a+=this._mapper[e][0]+this._mapper[e][1]}else this._gapBlocks.push([a,a+this._mapper[e][this._mapperColumnIndex],b]),a+=this._mapper[e][this._mapperColumnIndex];b+=this._mapper[e][this._mapperColumnIndex]}}};
b.prototype.getBlockAnnoTypes=function(b){this._isAddedSide()?b.push({type:"block",normal:h,current:f,list:[]}):b.push({type:"block",normal:d,current:a,list:[]});b.push({type:"block",normal:p,current:q,list:[]})};b.prototype.getCurrentBlockAnnoType=function(b){if(!this._diffBlocks||0===this._diffBlocks.length)return null;b=this._diffBlocks[b][1];return 0===this._mapper[b][this._mapperColumnIndex]?{current:u,normal:s}:n.isMapperConflict(this.getMapper(),b)?{normal:p,current:q}:this._isAddedSide()?
{type:"block",normal:h,current:f,list:[]}:{type:"block",normal:d,current:a,list:[]}};b.prototype.getDiffBlockH=function(a){if(!this._diffBlocks||0===this._diffBlocks.length)return-1;a=this._diffBlocks[a][1];return this._mapper[a][0]+this._mapper[a][1]};b.prototype.getLineNumber=function(a){for(var b=0;b<this._gapBlocks.length;b++)if(this._gapBlocks[b][0]!==this._gapBlocks[b][1]&&a>=this._gapBlocks[b][0]&&a<this._gapBlocks[b][1])return a-this._gapBlocks[b][0]+this._gapBlocks[b][2];return-1};return b}();
return g});
define("orion/compare/compareView","i18n!orion/compare/nls/messages orion/Deferred orion/webui/littlelib orion/compare/diffParser orion/compare/compareRulers orion/editor/editor orion/editor/editorFeatures orion/keyBinding orion/editor/textView orion/compare/compareUIFactory orion/compare/compareUtils orion/compare/jsdiffAdapter orion/compare/diffTreeNavigator".split(" "),function(l,n,m,k,g,h,f,d,a,e,b,p,q,s,u,w){var x={};x.CompareView=function(){function a(){this._diffParser=new k.DiffParser}a.prototype=
{_clearOptions:function(){this.options={};this.options.blockNumber=1;this.options.changeNumber=0},_getLineDelim:function(a,b){return"\n"},_generateMapper:function(a,b,e,d,f){var g=this._getLineDelim(a,e);this._diffParser.setLineDelim(g);if(this.options.mapper&&this.options.toggler)return{delim:g,mapper:this.options.mapper,output:this.options.newFile.Content,diffArray:this.options.diffArray};if("string"===typeof b&&"string"===typeof a)return a=(new p.JSDiffAdapter).adapt(a,b,g),this.options.toggler&&
(this.options.mapper=a.mapper,this.options.newFile.Content=b,this.options.diffArray=a.changContents),{delim:g,mapper:a.mapper,output:b,diffArray:a.changContents};b=this._diffParser.parse(a,e,d,f);a=this._diffParser.getDiffArray();this.options.toggler&&(this.options.mapper=b.mapper,this.options.newFile.Content=b.outPutFile,this.options.diffArray=a);return{delim:g,mapper:b.mapper,output:b.outPutFile,diffArray:a}},_loadImageFile:function(a,b,e){var d=document.createElement("img");d.src=a;var f=new n;
d.onload=function(){b.appendChild(d);if(e){var a=document.createElement("hr");b.appendChild(a)}f.resolve(d.height)};d.onerror=function(){f.resolve(0)};return f},_initSyntaxHighlighter:function(a){this._syntaxHighlighters=null;if(this.options.highlighters&&0<this.options.highlighters.length&&!(1>a.length||2<a.length))this._syntaxHighlighters=[{highlighter:this.options.highlighters[0],target:a[0]}],2===a.length&&2===this.options.highlighters.length&&this._syntaxHighlighters.push({highlighter:this.options.highlighters[1],
target:a[1]})},_highlightSyntax:function(){if(this._syntaxHighlighters){var a=[];this._syntaxHighlighters.forEach(function(b){a.push(b.highlighter.highlight(b.target.fileName,b.target.contentType,b.target.editor))}.bind(this));n.all(a,function(a){return{_error:a}}).then(function(a){this._diffNavigator.renderAnnotations();this._diffNavigator.gotoBlock(this.options.blockNumber-1,this.options.changeNumber-1)}.bind(this))}else window.setTimeout(function(){this._diffNavigator.renderAnnotations();this._diffNavigator.gotoBlock(this.options.blockNumber-
1,this.options.changeNumber-1)}.bind(this),50)},setOptions:function(a,b){b&&this._clearOptions();this.options||(this.options={});a&&Object.keys(a).forEach(function(b){this.options[b]=a[b]}.bind(this));if(a.newFileOnRight){var e=this.options.newFile;this.options.newFile=this.options.oldFile;this.options.oldFile=e}},getOptions:function(){return this.options},getCurrentDiffPos:function(){return this._diffNavigator.getCurrentPosition()},initDiffNav:function(){this._diffNavigator.gotoBlock(0,0)},nextDiff:function(){this._diffNavigator.nextDiff()},
prevDiff:function(){this._diffNavigator.prevDiff()},nextChange:function(){return this._diffNavigator.nextChange()},prevChange:function(){this._diffNavigator.prevChange()},getWidget:function(){return this},startup:function(){this.initEditors();this.refresh(!0)},initEditors:function(a){},initImageMode:function(){}};return a}();x.TwoWayCompareView=function(){function b(a){this.setOptions(a,!0);this._diffNavigator=new q.DiffTreeNavigator("word");this.type="twoWay";this._uiFactory=this.options.uiFactory;
this._uiFactory||(this._uiFactory=new e.TwoWayCompareUIFactory({parentDivID:this.options.parentDivId,showTitle:this.options.showTitle?this.options.showTitle:!1,showLineStatus:this.options.showLineStatus?this.options.showLineStatus:!1}),this._uiFactory.buildUI());this._viewLoadedCounter=0;this.options.commandProvider&&this.options.commandProvider.initCommands(this);this._curveRuler=new g.CompareCurveRuler(this._uiFactory.getDiffCanvasDiv())}b.prototype=new x.CompareView;b.prototype.initEditors=function(a){this._editors=
[];this._editors.push(this._createEditor(a,this._uiFactory.getEditorParentDiv(!1),this._uiFactory.getStatusDiv(!1),this.options.oldFile));this._editors.push(this._createEditor(a,this._uiFactory.getEditorParentDiv(!0),this._uiFactory.getStatusDiv(!0),this.options.newFile,!0));this._overviewRuler=new g.CompareOverviewRuler("right",{styleClass:"ruler overview"},null,function(a,b){this._diffNavigator.matchPositionFromOverview(a)}.bind(this));window.onbeforeunload=function(){if(this._editors&&this._editors.some(function(a){return a.isDirty()}))return l["There are unsaved changes."]}.bind(this)};
b.prototype.initImageMode=function(){this._editors&&(this._editors.forEach(function(a){a.destroy()}),this._editors=null);this._uiFactory.getEditorParentDiv(!0).classList.add("compareEditorParentImageMode");this._uiFactory.getEditorParentDiv().classList.add("compareEditorParentImageMode");this._uiFactory.disableTitle();this._uiFactory.disableLineStatus();this._imageMode=!0};b.prototype.getImageMode=function(){return this._imageMode};b.prototype.getEditors=function(){return this._editors};b.prototype.gotoDiff=
function(a,b,e){e=e?this._editors[1].getTextView():this._editors[0].getTextView();a=e.getModel().getLineStart(a)+b;this._diffNavigator.gotoDiff(a,e)};b.prototype.copyToLeft=function(){this._curveRuler.copyTo(!0)};b.prototype.copyToRight=function(){this._curveRuler.copyTo(!1)};b.prototype.resizeEditors=function(){this._editors.forEach(function(a){a.getTextView().resize()})};b.prototype.getSplitter=function(){return this._uiFactory.getSplitter()};b.prototype._createEditor=function(b,e,d,g,k){var p=
"undefined"===typeof g.readonly?!0:g.readonly,m=function(){var b=new a.TextView({parent:e,readonly:p,tabSize:4});this._viewLoadedCounter++;2===this._viewLoadedCounter&&this._diffNavigator.matchPositionFromOverview(-1);if(this.onLoad)this.onLoad();var d=this.getSplitter();d&&d.addResizeListener(function(a){if(a){var e=!1;(e=this._uiFactory.isLeftPane(a)?k:!k)&&b.resize()}}.bind(this));return b}.bind(this),n=g.keyBindingFactory;n||(n=new f.KeyBindingsFactory);var q=null;if(d)var s="",q=function(a,b){d&&
(s=b?l["ERROR: "]+a:a,d.textContent=""+s)};m=new h.Editor({textViewFactory:m,undoStackFactory:new f.UndoFactory,annotationFactory:new f.AnnotationFactory,keyBindingFactory:n,statusReporter:q,domNode:e});m.installTextView();m.setInput(null,null,g.Content?g.Content:b);m.setOverviewRulerVisible(!1);var u=m.getTextView();u.addEventListener("Selection",function(a){!(a.newValue&&a.newValue.start!==a.newValue.end)&&(!this._diffNavigator.autoSelecting&&this._diffNavigator.editorWrapper[0].diffFeeder)&&(a=
u.getCaretOffset(),this._diffNavigator.gotoDiff(a,u))}.bind(this));u.getModel().addEventListener("Changed",function(a){this._curveRuler.onChanged(a,!k)||(this.options.mapper=null)}.bind(this));k?u.addEventListener("Scroll",function(a){this._curveRuler&&(this._curveRuler.matchPositionFrom(!0),this._curveRuler.render());if(this.onScroll)this.onScroll()}.bind(this)):u.addEventListener("Scroll",function(a){this._curveRuler&&this._curveRuler.render()}.bind(this));return m};b.prototype.destroy=function(){this._editors&&
(this._diffNavigator.destroy(),this._editors.forEach(function(a){a.destroy()}),this._uiFactory.destroy())};b.prototype.addRulers=function(){if(this._editors&&!this._hasRuler){var a=new g.LineNumberCompareRuler(this._diffNavigator,0,"left",{styleClass:"ruler lines"},{styleClass:"rulerLines odd"},{styleClass:"rulerLines even"}),b=new g.LineNumberCompareRuler(this._diffNavigator,0,"left",{styleClass:"ruler lines"},{styleClass:"rulerLines odd"},{styleClass:"rulerLines even"});this._editors[1].getTextView().addRuler(a);
this._editors[0].getTextView().addRuler(b);this._editors[0].getTextView().addRuler(this._overviewRuler);this._hasRuler=!0}};b.prototype.refresh=function(a){if(this._imageMode){this.options.commandProvider&&this.options.commandProvider.renderCommands(this);var b=this;return this._loadImageFile(this.options.newFile.URL,this._uiFactory.getEditorParentDiv(!0)).then(function(a){return b._loadImageFile(b.options.oldFile.URL,b._uiFactory.getEditorParentDiv()).then(function(b){return(new n).resolve(a>b?a:
b)})})}var e=this.options.oldFile.Content,d=this.options.newFile.Content,f=this.options.diffContent;"string"===typeof d?f=this._generateMapper(e,d,f,this.options.hasConflicts):(f=this._generateMapper(e,d,f,this.options.hasConflicts),d=f.output);var g=new q.TwoWayDiffBlockFeeder(this._editors[0].getTextView().getModel(),f.mapper,1,this.options.newFileOnRight),h=new q.TwoWayDiffBlockFeeder(this._editors[1].getTextView().getModel(),f.mapper,0,this.options.newFileOnRight);this._diffNavigator.initAll(this.options.charDiff?
"char":"word",this._editors[0],this._editors[1],g,h,this._overviewRuler,this._curveRuler);this._curveRuler.init(f.mapper,this._editors[1],this._editors[0],this._diffNavigator);a&&(this._editors[1].setInput(this.options.newFile.Name,null,d),this._editors[0].setInput(this.options.oldFile.Name,null,e));this._initSyntaxHighlighter([{fileName:this.options.newFile.Name,contentType:this.options.newFile.Type,editor:this._editors[1]},{fileName:this.options.oldFile.Name,contentType:this.options.oldFile.Type,
editor:this._editors[0]}]);this._highlightSyntax();this.options.commandProvider&&this.options.commandProvider.renderCommands(this);this.addRulers();2===this._viewLoadedCounter&&this._diffNavigator.gotoBlock(this.options.blockNumber-1,this.options.changeNumber-1);this.refreshTitle(0);this.refreshTitle(1);a=this._editors[1].getTextView().getModel().getLineCount()*this._editors[1].getTextView().getLineHeight()+5;e=this._editors[0].getTextView().getModel().getLineCount()*this._editors[0].getTextView().getLineHeight()+
5;return a>e?a:e};b.prototype.refreshTitle=function(a,b){if(1===a){var e=this._uiFactory.getTitleDiv(!0);e&&(m.empty(e),e.appendChild(document.createTextNode(b||this._editors[a].isDirty()?this.options.newFile.Name+"*":this.options.newFile.Name)))}else if(e=this._uiFactory.getTitleDiv(!1))m.empty(e),e.appendChild(document.createTextNode(b||this._editors[a].isDirty()?this.options.oldFile.Name+"*":this.options.oldFile.Name))};return b}();x.InlineCompareView=function(){function e(a){this.setOptions(a,
!0);this._diffNavigator=new q.DiffTreeNavigator("word");this.type="inline";this.options.commandProvider&&this.options.commandProvider.initCommands(this);this._editorDiv=this.options.parentDivId}e.prototype=new x.CompareView;e.prototype.addRulers=function(){this._textView&&!this._hasRuler&&(this._textView.addRuler(this._rulerOrigin),this._textView.addRuler(this._rulerNew),this._textView.addRuler(this._overviewRuler),this._hasRuler=!0)};e.prototype.removeRulers=function(){this._textView&&this._hasRuler&&
(this._textView.removeRuler(this._rulerOrigin),this._textView.removeRuler(this._rulerNew),this._textView.removeRuler(this._overviewRuler),this._hasRuler=!1)};e.prototype.destroyEditor=function(){this._textView&&(this._diffNavigator.destroy(),this._textView.setText(""),this.removeRulers())};e.prototype.destroy=function(){this._textView&&(this._diffNavigator.destroy(),this._textView.destroy())};e.prototype.initEditors=function(b){var e=m.node(this._editorDiv),d=function(){return new a.TextView({parent:e,
readonly:!0,tabSize:4})}.bind(this);this._editor=new h.Editor({textViewFactory:d,undoStackFactory:new f.UndoFactory,annotationFactory:new f.AnnotationFactory,domNode:e});this._editor.installTextView();this._editor.setInput(null,null,b);this._editor.setOverviewRulerVisible(!1);this._editor.setAnnotationRulerVisible(!1);this._textView=this._editor.getTextView();this._rulerOrigin=new g.LineNumberCompareRuler(this._diffNavigator,1,"left",{styleClass:"ruler lines inlineRulerLeft"},{styleClass:"rulerLines odd"},
{styleClass:"rulerLines even"});this._rulerNew=new g.LineNumberCompareRuler(this._diffNavigator,0,"left",{styleClass:"ruler lines"},{styleClass:"rulerLines odd"},{styleClass:"rulerLines even"});this._overviewRuler=new g.CompareOverviewRuler("right",{styleClass:"ruler overview"},null,function(a,b){this._diffNavigator.matchPositionFromOverview(a)}.bind(this));this._textView.addEventListener("Selection",function(a){!(a.newValue&&a.newValue.start!==a.newValue.end)&&(!this._diffNavigator.autoSelecting&&
this._diffNavigator.editorWrapper[0].diffFeeder)&&(a=this._textView.getCaretOffset(),this._diffNavigator.gotoDiff(a,this._textView))}.bind(this))};e.prototype.initImageMode=function(){this._editor&&(this._editor.destroy(),this._editor=null);m.node(this._editorDiv).classList.add("compareEditorParentImageMode");this._imageMode=!0};e.prototype.getImageMode=function(){return this._imageMode};e.prototype._initDiffPosition=function(a){var b=a.getModel();if(b&&b.getAnnotations&&(b=b.getAnnotations(),0<b.length)){var b=
b[0][0],e=a.getLineHeight(),d=a.getClientArea(),e=Math.floor(d.height/e/3);a.setTopIndex(0<b-e?b-e:0)}};e.prototype.refresh=function(){if(this._imageMode){this.options.commandProvider&&this.options.commandProvider.renderCommands(this);var a=this;return this._loadImageFile(this.options.newFile.URL,m.node(this._editorDiv),!0).then(function(b){return a._loadImageFile(a.options.oldFile.URL,m.node(a._editorDiv)).then(function(a){return(new n).resolve(b+a+20)})})}var e=this.options.oldFile.Content,d=this.options.newFile.Content,
f=this._generateMapper(e,d,this.options.diffContent,this.options.hasConflicts,!this.options.toggler);"string"!==typeof d&&(d=f.output);this._textView.getModel().setText(e);e=new q.inlineDiffBlockFeeder(f.mapper,1);d=new q.inlineDiffBlockFeeder(f.mapper,0);b.mergeDiffBlocks(this._textView.getModel(),d.getDiffBlocks(),f.mapper,f.diffArray.array,f.diffArray.index,this._diffParser._lineDelimiter);e.setModel(this._textView.getModel());d.setModel(this._textView.getModel());this._diffNavigator.initAll(this.options.charDiff?
"char":"word",this._editor,this._editor,e,d,this._overviewRuler);this._initSyntaxHighlighter([{fileName:this.options.oldFile.Name,contentType:this.options.oldFile.Type,editor:this._editor}]);this._highlightSyntax();this.options.commandProvider&&this.options.commandProvider.renderCommands(this);this.addRulers();f=this._textView.getTopIndex();this._textView.redrawLines(f,f+1,this._overviewRuler);this._textView.redrawLines(f,f+1,this._rulerOrigin);this._textView.redrawLines(f,f+1,this._rulerNew);this._diffNavigator.gotoBlock(this.options.blockNumber-
1,this.options.changeNumber-1);return this._textView.getLineHeight()*this._textView.getModel().getLineCount()+5};e.prototype.setConflicting=function(a){this._conflcit=a};return e}();x.toggleableCompareView=function(){function a(b,e){e&&(e.toggler=this);this._widget="inline"===b?new x.InlineCompareView(e):new x.TwoWayCompareView(e)}a.prototype={startup:function(){this._widget.startup()},initImageMode:function(){this._imageMode=!0;this._widget.initImageMode()},toggle:function(){var a=this._widget.options;
if(!this._imageMode){var b=this._widget.getCurrentDiffPos();a.blockNumber=b.block;a.changeNumber=b.change}this._widget.destroy();m.empty(m.node(a.parentDivId));this._widget="inline"===this._widget.type?new x.TwoWayCompareView(a):new x.InlineCompareView(a);this._imageMode?this._widget.initImageMode():this._widget.initEditors();this._widget.refresh(!0)},getWidget:function(){return this._widget}};return a}();return x});
define("orion/editor/stylers/lib/syntax",[],function(){return{id:"orion.lib",grammars:[{id:"orion.lib",repository:{brace_open:{match:"{",name:"punctuation.section.block.begin"},brace_close:{match:"}",name:"punctuation.section.block.end"},bracket_open:{match:"\\[",name:"punctuation.section.bracket.begin"},bracket_close:{match:"\\]",name:"punctuation.section.bracket.end"},parenthesis_open:{match:"\\(",name:"punctuation.section.parens.begin"},parenthesis_close:{match:"\\)",name:"punctuation.section.parens.end"},
doc_block:{begin:{match:"/\\*\\*",literal:"/**"},end:{match:"\\*/",literal:"*/"},name:"comment.block.documentation",patterns:[{match:"@(?:(?!\\*/)\\S)*",name:"keyword.other.documentation.tag"},{match:"\\\x3c\\S*\\\x3e",name:"keyword.other.documentation.markup"},{match:"(\\b)(TODO)(\\b)(((?!\\*/).)*)",name:"meta.annotation.task.todo",captures:{2:{name:"keyword.other.documentation.task"},4:{name:"comment.block"}}}]},number_decimal:{match:"\\b-?(?:\\.\\d+|\\d+\\.?\\d*)(?:[eE][+-]?\\d+)?\\b",name:"constant.numeric.number"},
number_hex:{match:"\\b0[xX][0-9A-Fa-f]+\\b",name:"constant.numeric.hex"},string_doubleQuote:{match:'"(?:\\\\.|[^"])*"?',name:"string.quoted.double"},string_singleQuote:{match:"'(?:\\\\.|[^'])*'?",name:"string.quoted.single"},todo_comment_singleLine:{match:"(\\b)(TODO)(\\b)(.*)",name:"meta.annotation.task.todo",captures:{2:{name:"keyword.other.documentation.task"},4:{name:"comment.line"}}}}},{id:"orion.c-like",repository:{comment_singleLine:{match:{match:"//.*",literal:"//"},name:"comment.line.double-slash",
patterns:[{include:"orion.lib#todo_comment_singleLine"}]},comment_block:{begin:{match:"/\\*",literal:"/*"},end:{match:"\\*/",literal:"*/"},name:"comment.block",patterns:[{match:"(\\b)(TODO)(\\b)(((?!\\*/).)*)",name:"meta.annotation.task.todo",captures:{2:{name:"keyword.other.documentation.task"},4:{name:"comment.block"}}}]}}}],keywords:[]}});
define("orion/editor/stylers/application_javascript/syntax",["orion/editor/stylers/lib/syntax"],function(l){var n="break case class catch continue const debugger default delete do else enum export extends false finally for function if implements import in instanceof interface let new null package private protected public return static super switch this throw true try typeof undefined var void while with yield".split(" ");l=l.grammars;l.push({id:"orion.js",contentTypes:["application/javascript"],patterns:[{begin:"'(?:\\\\.|[^\\\\'])*\\\\$",
end:"^(?:$|(?:\\\\.|[^\\\\'])*('|[^\\\\]$))",name:"string.quoted.single.js"},{begin:'"(?:\\\\.|[^\\\\"])*\\\\$',end:'^(?:$|(?:\\\\.|[^\\\\"])*("|[^\\\\]$))',name:"string.quoted.double.js"},{include:"orion.lib#string_doubleQuote"},{include:"orion.lib#string_singleQuote"},{include:"orion.c-like#comment_singleLine"},{match:"/(?![\\s\\*])(?:\\\\.|[^/])+/(?:[gim]{0,3})",name:"string.regexp.js"},{include:"orion.lib#doc_block"},{include:"orion.c-like#comment_block"},{include:"orion.lib#brace_open"},{include:"orion.lib#brace_close"},
{include:"orion.lib#bracket_open"},{include:"orion.lib#bracket_close"},{include:"orion.lib#parenthesis_open"},{include:"orion.lib#parenthesis_close"},{include:"orion.lib#number_decimal"},{include:"orion.lib#number_hex"},{match:"\\b(?:"+n.join("|")+")\\b",name:"keyword.control.js"}]});return{id:l[l.length-1].id,grammars:l,keywords:n}});
define("orion/editor/stylers/text_x-java-source/syntax",["orion/editor/stylers/lib/syntax"],function(l){var n="abstract boolean break byte case catch char class continue default do double else extends false final finally float for if implements import instanceof int interface long native new null package private protected public return short static super switch synchronized this throw throws transient true try void volatile while".split(" ");l=l.grammars;l.push({id:"orion.java",contentTypes:["text/x-java-source"],
patterns:[{include:"orion.lib#string_doubleQuote"},{include:"orion.lib#string_singleQuote"},{include:"orion.c-like#comment_singleLine"},{include:"orion.lib#doc_block"},{include:"orion.c-like#comment_block"},{include:"orion.lib#brace_open"},{include:"orion.lib#brace_close"},{include:"orion.lib#bracket_open"},{include:"orion.lib#bracket_close"},{include:"orion.lib#parenthesis_open"},{include:"orion.lib#parenthesis_close"},{include:"orion.lib#number_decimal"},{include:"orion.lib#number_hex"},{match:"\\b(?:"+
n.join("|")+")\\b",name:"keyword.control.java"}]});return{id:l[l.length-1].id,grammars:l,keywords:n}});
define("orion/editor/stylers/text_css/syntax",["orion/editor/stylers/lib/syntax"],function(l){var n="alignment-adjust alignment-baseline animation-delay animation-direction animation-duration animation-iteration-count animation-name animation-play-state animation-timing-function animation appearance azimuth backface-visibility background-attachment background-clip background-color background-image background-origin background-position background-repeat background-size background baseline-shift binding bleed bookmark-label bookmark-level bookmark-state bookmark-target border-bottom-color border-bottom-left-radius border-bottom-right-radius border-bottom-style border-bottom-width border-bottom border-collapse border-color border-image-outset border-image-repeat border-image-slice border-image-source border-image-width border-image border-left-color border-left-style border-left-width border-left border-radius border-right-color border-right-style border-right-width border-right border-spacing border-style border-top-color border-top-left-radius border-top-right-radius border-top-style border-top-width border-top border-width border bottom box-align box-decoration-break box-direction box-flex-group box-flex box-lines box-ordinal-group box-orient box-pack box-shadow box-sizing break-after break-before break-inside caption-side clear clip color-profile color column-count column-fill column-gap column-rule-color column-rule-style column-rule-width column-rule column-span column-width columns content counter-increment counter-reset crop cue-after cue-before cue cursor direction display dominant-baseline drop-initial-after-adjust drop-initial-after-align drop-initial-before-adjust drop-initial-before-align drop-initial-size drop-initial-value elevation empty-cells fit-position fit flex-align flex-flow flex-inline-pack flex-order flex-pack float-offset float font-family font-size font-size-adjust font-stretch font-style font-variant font-weight font grid-columns grid-rows hanging-punctuation height hyphenate-after hyphenate-before hyphenate-character hyphenate-lines hyphenate-resource hyphens icon image-orientation image-rendering image-resolution inline-box-align left letter-spacing line-height line-stacking-ruby line-stacking-shift line-stacking-strategy line-stacking list-style-image list-style-position list-style-type list-style margin-bottom margin-left margin-right margin-top margin mark-after mark-before mark marker-offset marks marquee-direction marquee-loop marquee-play-count marquee-speed marquee-style max-height max-width min-height min-width move-to nav-down nav-index nav-left nav-right nav-up opacity orphans outline-color outline-offset outline-style outline-width outline overflow-style overflow-x overflow-y overflow padding-bottom padding-left padding-right padding-top padding page-break-after page-break-before page-break-inside page-policy page pause-after pause-before pause perspective-origin perspective phonemes pitch-range pitch play-during position presentation-level punctuation-trim quotes rendering-intent resize rest-after rest-before rest richness right rotation-point rotation ruby-align ruby-overhang ruby-position ruby-span size speak-header speak-numeral speak-punctuation speak speech-rate stress string-set table-layout target-name target-new target-position target text-align-last text-align text-decoration text-emphasis text-height text-indent text-justify text-outline text-shadow text-transform text-wrap top transform-origin transform-style transform transition-delay transition-duration transition-property transition-timing-function transition unicode-bidi vertical-align visibility voice-balance voice-duration voice-family voice-pitch-range voice-pitch voice-rate voice-stress voice-volume volume white-space-collapse white-space widows width word-break word-spacing word-wrap z-index".split(" ");l=
l.grammars;l.push({id:"orion.css",contentTypes:["text/css"],patterns:[{begin:"'(?:\\\\.|[^\\\\'])*\\\\$",end:"^(?:$|(?:\\\\.|[^\\\\'])*('|[^\\\\]$))",name:"string.quoted.single.css"},{begin:'"(?:\\\\.|[^\\\\"])*\\\\$',end:'^(?:$|(?:\\\\.|[^\\\\"])*("|[^\\\\]$))',name:"string.quoted.double.css"},{include:"orion.lib#string_doubleQuote"},{include:"orion.lib#string_singleQuote"},{include:"orion.c-like#comment_block"},{include:"orion.lib#brace_open"},{include:"orion.lib#brace_close"},{include:"orion.lib#bracket_open"},
{include:"orion.lib#bracket_close"},{include:"orion.lib#parenthesis_open"},{include:"orion.lib#parenthesis_close"},{include:"orion.lib#number_decimal"},{include:"#number_hex"},{match:"(?i)\\b-?(?:\\.\\d+|\\d+\\.?\\d*)(?:%|em|ex|ch|rem|vw|vh|vmin|vmax|in|cm|mm|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?\\b",name:"constant.numeric.value.css"},{match:"(?:-webkit-|-moz-|-ms-|-o-|\\b)(?:"+n.join("|")+")\\b",name:"keyword.control.css"}],repository:{number_hex:{match:"#[0-9A-Fa-f]+\\b",name:"constant.numeric.hex.css"}}});
return{id:l[l.length-1].id,grammars:l,keywords:n}});
define("examples/editor/textStyler",["orion/editor/annotations","orion/editor/stylers/application_javascript/syntax","orion/editor/stylers/text_x-java-source/syntax","orion/editor/stylers/text_css/syntax"],function(l,n,m,k){function g(a,b){this.keywords=a;this.whitespacesVisible=b;this.setText("")}function h(){g.call(this,null,!0)}function f(a){g.call(this,null,a)}function d(){g.call(this,null,!1)}function a(a,k,l){this.commentStart="/*";this.commentEnd="*/";var m=[];switch(k){case "java":m=b;break;
case "js":m=e;break;case "css":m=p}this.whitespacesVisible=this.spacesVisible=this.tabsVisible=!1;this.detectHyperlinks=!0;this.highlightCaretLine=!1;this.detectTasks=this.foldingEnabled=!0;this._scanner=new g(m,this.whitespacesVisible);this._firstScanner=new d;this._commentScanner=new f(this.whitespacesVisible);this._whitespaceScanner=new h;"css"===k&&(this._scanner.isCSS=!0,this._firstScanner.isCSS=!0);this.view=a;this.annotationModel=l;this._bracketAnnotations=void 0;var n=this;this._listener=
{onChanged:function(a){n._onModelChanged(a)},onDestroy:function(a){n._onDestroy(a)},onLineStyle:function(a){n._onLineStyle(a)},onMouseDown:function(a){n._onMouseDown(a)},onSelection:function(a){n._onSelection(a)}};k=a.getModel();k.getBaseModel&&(k=k.getBaseModel());k.addEventListener("Changed",this._listener.onChanged);a.addEventListener("MouseDown",this._listener.onMouseDown);a.addEventListener("Selection",this._listener.onSelection);a.addEventListener("Destroy",this._listener.onDestroy);a.addEventListener("LineStyle",
this._listener.onLineStyle);this._computeComments();this._computeFolding();a.redrawLines()}var e=n.keywords,b=m.keywords,p=k.keywords,q={styleClass:"comment"},s={styleClass:"comment"},u={styleClass:"comment block documentation"},w={styleClass:"keyword other documentation markup"},x={styleClass:"keyword other documentation task"},y={styleClass:"keyword other documentation tag"},r={styleClass:"string"},t={styleClass:"constant numeric"},z={styleClass:"keyword"},B={styleClass:"punctuation separator space",
unmergeable:!0},v={styleClass:"punctuation separator tab",unmergeable:!0},A={styleClass:"meta annotation currentLine"};g.prototype={getOffset:function(){return this.offset},getStartOffset:function(){return this.startOffset},getData:function(){return this.text.substring(this.startOffset,this.offset)},getDataLength:function(){return this.offset-this.startOffset},_default:function(a){switch(a){case 32:case 9:if(this.whitespacesVisible)return 32===a?11:10;do a=this._read();while(32===a||9===a);this._unread(a);
return 9;case 123:case 125:case 40:case 41:case 91:case 93:case 60:case 62:return a;default:var b=this.isCSS,e=this.offset-1;if(!b&&48<=a&&57>=a){var d=b=!1,f=!1,g=a;do if(a=this._read(),46===a&&!b)b=!0;else if(101===a&&!d)b=d=!0,a=this._read(),45!==a&&this._unread(a);else if(120===a&&48===g&&2===this.offset-e)b=d=f=!0;else if(!(48<=a&&57>=a||f&&(65<=a&&70>=a||97<=a&&102>=a)))break;while(1);this._unread(a);return 3}if(97<=a&&122>=a||65<=a&&90>=a||95===a||45===a&&b){do a=this._read();while(97<=a&&
122>=a||65<=a&&90>=a||95===a||48<=a&&57>=a||45===a&&b);this._unread(a);a=this.keywords;if(0<a.length){e=this.text.substring(e,this.offset);for(b=0;b<a.length;b++)if(this.keywords[b]===e)return 2}}return 1}},_read:function(){return this.offset<this.text.length?this.text.charCodeAt(this.offset++):-1},_unread:function(a){-1!==a&&this.offset--},nextToken:function(){for(this.startOffset=this.offset;;){var a=this._read(),b;switch(a){case -1:return null;case 47:a=this._read();if(!this.isCSS&&47===a)for(;;)if(a=
this._read(),-1===a||10===a||13===a)return this._unread(a),6;if(42===a){a=this._read();b=7;for(42===a&&(b=8);;){for(;42===a;)if(a=this._read(),47===a)return b;if(-1===a)return this._unread(a),b;a=this._read()}}this._unread(a);return 1;case 39:for(b=4;;)switch(a=this._read(),a){case 39:return b;case 13:case 10:case -1:return this._unread(a),b;case 92:switch(a=this._read(),a){case 10:b=5;break;case 13:b=5,a=this._read(),10!==a&&this._unread(a)}}break;case 34:for(b=4;;)switch(a=this._read(),a){case 34:return b;
case 13:case 10:case -1:return this._unread(a),b;case 92:switch(a=this._read(),a){case 10:b=5;break;case 13:b=5,a=this._read(),10!==a&&this._unread(a)}}break;default:return this._default(a)}}},setText:function(a){this.text=a;this.startOffset=this.offset=0}};h.prototype=new g(null);h.prototype.nextToken=function(){for(this.startOffset=this.offset;;){var a=this._read();switch(a){case -1:return null;case 32:return 11;case 9:return 10;default:do a=this._read();while(!(32===a||9===a||-1===a));this._unread(a);
return 1}}};f.prototype=new g(null);f.prototype.setType=function(a){this._type=a};f.prototype.nextToken=function(){for(this.startOffset=this.offset;;){var a=this._read();switch(a){case -1:return null;case 32:case 9:if(this.whitespacesVisible)return 32===a?11:10;do a=this._read();while(32===a||9===a);this._unread(a);return 9;case 60:if(8===this._type){do a=this._read();while(!(62===a||-1===a));if(62===a)return 12}return 1;case 64:if(8===this._type){do a=this._read();while(97<=a&&122>=a||65<=a&&90>=
a||95===a||48<=a&&57>=a);this._unread(a);return 13}return 1;case 84:if(79===(a=this._read()))if(68===(a=this._read()))if(79===(a=this._read()))if(a=this._read(),!(97<=a&&122>=a||65<=a&&90>=a||95===a||48<=a&&57>=a))return this._unread(a),14;this._unread(a);default:do a=this._read();while(!(32===a||9===a||-1===a||60===a||64===a||84===a));this._unread(a);return 1}}};d.prototype=new g(null);d.prototype._default=function(a){for(;;)switch(a=this._read(),a){case 47:case 34:case 39:case -1:return this._unread(a),
1}};a.prototype={destroy:function(){var a=this.view;if(a){var b=a.getModel();b.getBaseModel&&(b=b.getBaseModel());b.removeEventListener("Changed",this._listener.onChanged);a.removeEventListener("MouseDown",this._listener.onMouseDown);a.removeEventListener("Selection",this._listener.onSelection);a.removeEventListener("Destroy",this._listener.onDestroy);a.removeEventListener("LineStyle",this._listener.onLineStyle);this.view=null}},setHighlightCaretLine:function(a){this.highlightCaretLine=a},setWhitespacesVisible:function(a,
b){this.whitespacesVisible!==a&&(this.whitespacesVisible=a,this._scanner.whitespacesVisible=a,this._commentScanner.whitespacesVisible=a,b&&this.view.redraw())},setTabsVisible:function(a){this.tabsVisible!==a&&(this.tabsVisible=a,this.setWhitespacesVisible(this.tabsVisible||this.spacesVisible,!1),this.view.redraw())},setSpacesVisible:function(a){this.spacesVisible!==a&&(this.spacesVisible=a,this.setWhitespacesVisible(this.tabsVisible||this.spacesVisible,!1),this.view.redraw())},setDetectHyperlinks:function(a){this.detectHyperlinks=
a},setFoldingEnabled:function(a){this.foldingEnabled=a},setDetectTasks:function(a){this.detectTasks=a},_binarySearch:function(a,b,e,d,f){var g;void 0===d&&(d=-1);void 0===f&&(f=a.length);for(;1<f-d;)if(g=Math.floor((f+d)/2),b<=a[g].start)f=g;else if(e&&b<a[g].end){f=g;break}else d=g;return f},_computeComments:function(){var a=this.view.getModel();a.getBaseModel&&(a=a.getBaseModel());this.comments=this._findComments(a.getText())},_computeFolding:function(){if(this.foldingEnabled){var a=this.view.getModel();
if(a.getBaseModel){var b=this.annotationModel;if(b){b.removeAnnotations(l.AnnotationType.ANNOTATION_FOLDING);for(var e=[],d=a.getBaseModel(),f=this.comments,g=0;g<f.length;g++){var h=f[g];(h=this._createFoldingAnnotation(a,d,h.start,h.end))&&e.push(h)}b.replaceAnnotations(null,e)}}}},_createFoldingAnnotation:function(a,b,e,d){var f=b.getLineAtOffset(e);b=b.getLineAtOffset(d);return f===b?null:new (l.AnnotationType.getType(l.AnnotationType.ANNOTATION_FOLDING))(e,d,a)},_computeTasks:function(a,b,e){if(this.detectTasks){var d=
this.annotationModel;if(d){var f=this.view.getModel(),g=f;f.getBaseModel&&(g=f.getBaseModel());for(var h=d.getAnnotations(b,e),f=[],k=l.AnnotationType.ANNOTATION_TASK;h.hasNext();){var p=h.next();p.type===k&&f.push(p)}h=[];p=this._commentScanner;p.setText(g.getText(b,e));for(var m;m=p.nextToken();){var n=p.getStartOffset()+b;14===m&&(m=g.getLineEnd(g.getLineAtOffset(n)),6!==a&&(m=Math.min(m,e-this.commentEnd.length)),h.push(l.AnnotationType.createAnnotation(k,n,m,g.getText(n,m))))}d.replaceAnnotations(f,
h)}}},_getLineStyle:function(a){if(this.highlightCaretLine){var b=this.view,e=b.getModel(),b=b.getSelection();if(b.start===b.end&&e.getLineAtOffset(b.start)===a)return A}return null},_getStyles:function(a,b,e){a.getBaseModel&&(e=a.mapOffset(e));for(var d=e+b.length,f=[],g=e,h=this.comments,k=this._binarySearch(h,e,!0);k<h.length&&!(h[k].start>=d);k++){var l=h[k].start,p=h[k].end;g<l&&this._parse(b.substring(g-e,l-e),g,f);var m=h[k].type,n;switch(m){case 8:n=u;break;case 7:n=s;break;case 5:n=r}g=Math.max(g,
l);l=Math.min(d,p);(8===m||7===m)&&(this.whitespacesVisible||this.detectHyperlinks)?this._parseComment(b.substring(g-e,l-e),g,f,n,m):5===m&&this.whitespacesVisible?this._parseString(b.substring(g-e,l-e),g,f,r):f.push({start:g,end:l,style:n});g=p}g<d&&this._parse(b.substring(g-e,d-e),g,f);if(a.getBaseModel)for(b=0;b<f.length;b++)e=f[b].end-f[b].start,f[b].start=a.mapOffset(f[b].start,!0),f[b].end=f[b].start+e;return f},_parse:function(a,b,e){var d=this._scanner;for(d.setText(a);a=d.nextToken();){var f=
d.getStartOffset()+b,g=null;switch(a){case 2:g=z;break;case 3:g=t;break;case 5:case 4:if(this.whitespacesVisible){this._parseString(d.getData(),f,e,r);continue}else g=r;break;case 8:this._parseComment(d.getData(),f,e,u,a);continue;case 6:this._parseComment(d.getData(),f,e,q,a);continue;case 7:this._parseComment(d.getData(),f,e,s,a);continue;case 10:this.whitespacesVisible&&this.tabsVisible&&(g=v);break;case 11:this.whitespacesVisible&&this.spacesVisible&&(g=B)}e.push({start:f,end:d.getOffset()+b,
style:g})}},_parseComment:function(a,b,e,d,f){var g=this._commentScanner;g.setText(a);for(g.setType(f);a=g.nextToken();){f=g.getStartOffset()+b;var h=d;switch(a){case 10:this.whitespacesVisible&&this.tabsVisible&&(h=v);break;case 11:this.whitespacesVisible&&this.spacesVisible&&(h=B);break;case 12:h=w;break;case 13:h=y;break;case 14:h=x;break;default:this.detectHyperlinks&&(h=this._detectHyperlinks(g.getData(),f,e,h))}h&&e.push({start:f,end:g.getOffset()+b,style:h})}},_parseString:function(a,b,e,d){var f=
this._whitespaceScanner;for(f.setText(a);a=f.nextToken();){var g=f.getStartOffset()+b,h=d;switch(a){case 10:this.whitespacesVisible&&this.tabsVisible&&(h=v);break;case 11:this.whitespacesVisible&&this.spacesVisible&&(h=B)}h&&e.push({start:g,end:f.getOffset()+b,style:h})}},_detectHyperlinks:function(a,b,e,d){var f=null,g;if(0<(g=a.indexOf("://"))){for(var f=a,h=g;0<h;){g=f.charCodeAt(h-1);if(!(97<=g&&122>=g||65<=g&&90>=g||45===g||48<=g&&57>=g))break;h--}if(0<h&&(g="\"\"''(){}[]\x3c\x3e".indexOf(f.substring(h-
1,h)),-1!==g&&0===(g&1)&&-1!==(g=f.lastIndexOf("\"\"''(){}[]\x3c\x3e".substring(g+1,g+2))))){var k=g;g=this._clone(d);g.tagName="a";g.attributes={href:f.substring(h,k)};e.push({start:b,end:b+h,style:d});e.push({start:b+h,end:b+k,style:g});e.push({start:b+k,end:b+a.length,style:d});return null}}else 0===a.toLowerCase().indexOf("bug#")&&(f="https://bugs.eclipse.org/bugs/show_bug.cgi?id\x3d"+parseInt(a.substring(4),10));return f?(g=this._clone(d),g.tagName="a",g.attributes={href:f},g):d},_clone:function(a){if(!a)return a;
var b={},e;for(e in a)a.hasOwnProperty(e)&&(b[e]=a[e]);return b},_findComments:function(a,b){b=b||0;var e=this._firstScanner,d;e.setText(a);for(var f=[];d=e.nextToken();)(7===d||8===d||5===d)&&f.push({start:e.getStartOffset()+b,end:e.getOffset()+b,type:d}),(6===d||7===d||8===d)&&this._computeTasks(d,e.getStartOffset()+b,e.getOffset()+b);return f},_findMatchingBracket:function(a,b){var e="{}()[]\x3c\x3e",d=a.getText(b,b+1),f=e.indexOf(d,0);if(-1===f)return-1;var g;g=f&1?e.substring(f-1,f):e.substring(f+
1,f+2);for(var h=a.getLineAtOffset(b),e=a.getLine(h),k=a.getLineStart(h),l=a.getLineEnd(h),e=this._findBrackets(d,g,e,k,k,l),l=0;l<e.length;l++)if(k=0<=e[l]?1:-1,e[l]*k-1===b){var p=1;if(f&1){for(l--;0<=l;l--)if(k=0<=e[l]?1:-1,p+=k,0===p)return e[l]*k-1;for(h-=1;0<=h;){e=a.getLine(h);k=a.getLineStart(h);l=a.getLineEnd(h);e=this._findBrackets(d,g,e,k,k,l);for(f=e.length-1;0<=f;f--)if(k=0<=e[f]?1:-1,p+=k,0===p)return e[f]*k-1;h--}}else{for(l++;l<e.length;l++)if(k=0<=e[l]?1:-1,p+=k,0===p)return e[l]*
k-1;h+=1;for(f=a.getLineCount();h<f;){e=a.getLine(h);k=a.getLineStart(h);l=a.getLineEnd(h);e=this._findBrackets(d,g,e,k,k,l);for(l=0;l<e.length;l++)if(k=0<=e[l]?1:-1,p+=k,0===p)return e[l]*k-1;h++}}break}return-1},_findBrackets:function(a,b,e,d,f,g){var h=[];a=a.charCodeAt(0);b=b.charCodeAt(0);for(var k=f,l=this._scanner,p,m=this.comments,n=this._binarySearch(m,f,!0);n<m.length&&!(m[n].start>=g);n++){p=m[n].start;var q=m[n].end;if(k<p)for(l.setText(e.substring(k-f,p-f));p=l.nextToken();)p===a?h.push(l.getStartOffset()+
k-f+d+1):p===b&&h.push(-(l.getStartOffset()+k-f+d+1));k=q}if(k<g)for(l.setText(e.substring(k-f,g-f));p=l.nextToken();)p===a?h.push(l.getStartOffset()+k-f+d+1):p===b&&h.push(-(l.getStartOffset()+k-f+d+1));return h},_onDestroy:function(a){this.destroy()},_onLineStyle:function(a){a.textView===this.view&&(a.style=this._getLineStyle(a.lineIndex));a.ranges=this._getStyles(a.textView.getModel(),a.lineText,a.lineStart)},_onSelection:function(a){var b=a.oldValue,e=a.newValue,d=this.view;a=d.getModel();var f;
if(this.highlightCaretLine){var g=a.getLineAtOffset(b.start);f=a.getLineAtOffset(e.start);var h=e.start===e.end,b=b.start===b.end;g===f&&b&&h||(b&&d.redrawLines(g,g+1),(g!==f||!b)&&h&&d.redrawLines(f,f+1))}if(this.annotationModel){var b=this._bracketAnnotations,k,p;if(e.start===e.end&&0<(p=d.getCaretOffset()))p-=1,a.getBaseModel&&(p=a.mapOffset(p),a=a.getBaseModel()),a=this._findMatchingBracket(a,p),-1!==a&&(k=[l.AnnotationType.createAnnotation(l.AnnotationType.ANNOTATION_MATCHING_BRACKET,a,a+1),
l.AnnotationType.createAnnotation(l.AnnotationType.ANNOTATION_CURRENT_BRACKET,p,p+1)]);this._bracketAnnotations=k;this.annotationModel.replaceAnnotations(b,k)}},_onMouseDown:function(a){if(2===a.clickCount){var b=this.view,e=b.getModel(),d=b.getOffsetAtLocation(a.x,a.y);if(0<d){var f=d-1,g=e;e.getBaseModel&&(f=e.mapOffset(f),g=e.getBaseModel());f=this._findMatchingBracket(g,f);-1!==f&&(a.preventDefault(),a=f,e.getBaseModel&&(a=e.mapOffset(a,!0)),d>a&&(d--,a++),b.setSelection(a,d))}}},_onModelChanged:function(a){var b=
a.start,e=a.removedCharCount,d=a.addedCharCount-e,f=this.view;a=f.getModel();var g=a.getBaseModel?a.getBaseModel():a,e=b+e,h=g.getCharCount(),k=this.comments.length,p=g.getLineStart(g.getLineAtOffset(b)),m=this._binarySearch(this.comments,p,!0),n=this._binarySearch(this.comments,e,!1,m-1,k);m<k&&this.comments[m].start<=p&&p<this.comments[m].end?(p=this.comments[m].start,p>b&&(p+=d)):p=m===k&&0<k&&h-d===this.comments[k-1].end?this.comments[k-1].start:p;var q;n<k?(q=this.comments[n].end,q>b&&(q+=d),
n+=1):(n=k,q=h);for(var h=g.getText(p,q),s,h=this._findComments(h,p),k=m;k<this.comments.length;k++)s=this.comments[k],s.start>b&&(s.start+=d),s.start>b&&(s.end+=d);var t=n-m!==h.length;if(!t)for(k=0;k<h.length;k++){s=this.comments[m+k];var u=h[k];if(s.start!==u.start||s.end!==u.end||s.type!==u.type){t=!0;break}}k=[m,n-m].concat(h);Array.prototype.splice.apply(this.comments,k);t&&(k=p,s=q,a!==g&&(k=a.mapOffset(k,!0),s=a.mapOffset(s,!0)),f.redrawRange(k,s));if(this.foldingEnabled&&g!==a&&this.annotationModel){f=
this.annotationModel;m=f.getAnnotations(p,q);p=[];for(q=[];m.hasNext();)if(s=m.next(),s.type===l.AnnotationType.ANNOTATION_FOLDING){q.push(s);for(k=0;k<h.length&&!(s.start===h[k].start&&s.end===h[k].end);k++);k===h.length?(p.push(s),s.expand()):(k=s.start,n=s.end,k>b&&(k-=d),n>b&&(n-=d),k<=b&&(b<n&&k<=e&&e<n)&&(k=g.getLineAtOffset(s.start),n=g.getLineAtOffset(s.end),k!==n?s.expanded||s.expand():f.removeAnnotation(s)))}b=[];for(k=0;k<h.length;k++){s=h[k];for(d=0;d<q.length&&!(q[d].start===s.start&&
q[d].end===s.end);d++);d===q.length&&(s=this._createFoldingAnnotation(a,g,s.start,s.end))&&b.push(s)}f.replaceAnnotations(p,b)}}};return{TextStyler:a}});
define("orion/editor/textStyler",["orion/editor/annotations","orion/editor/eventTarget"],function(l,n){function m(a,e){this._patternManager=new k(a,e)}function k(a,e){this._unnamedCounter=0;this._patterns=[];this._rootId=e;a.forEach(function(a){this._addRepositoryPatterns(a.repository||{},a.id);this._addPatterns(a.patterns||[],a.id)}.bind(this))}function g(a,e,b,d,f,g,h){this.start=a.start;this.end=a.end;this.contentStart=a.contentStart;this.contentEnd=a.contentEnd;this.name=e;this.typeId=b;this.styler=
d;this.parent=g;h&&h(this);this._subBlocks=d.computeBlocks(f,f.getText(this.start,this.end),this,this.start,null,null,null)}function h(a){this._styler=a}function f(a,e,b){this._highlightCaretLine=this._whitespacesVisible=this._spacesVisible=this._tabsVisible=!1;this._detectTasks=this._foldingEnabled=!0;this._view=a;this._annotationModel=e;this._stylerAdapter=b;this._stylerAdapter.setStyler(this);this._accessor=new h(this);this._bracketAnnotations;var d=this;this._listener={onChanged:function(a){d._onModelChanged(a)},
onDestroy:function(a){d._onDestroy(a)},onLineStyle:function(a){d._onLineStyle(a)},onMouseDown:function(a){d._onMouseDown(a)},onSelection:function(a){d._onSelection(a)}};b=a.getModel();b.getBaseModel&&(b=b.getBaseModel());b.addEventListener("Changed",this._listener.onChanged);a.addEventListener("MouseDown",this._listener.onMouseDown);a.addEventListener("Selection",this._listener.onSelection);a.addEventListener("Destroy",this._listener.onDestroy);a.addEventListener("LineStyle",this._listener.onLineStyle);
var f=b.getCharCount();this._rootBlock=this._stylerAdapter.createBlock({start:0,contentStart:0,end:f,contentEnd:f},this,b,null);e&&(f=[],e.removeAnnotations(l.AnnotationType.ANNOTATION_FOLDING),this._computeFolding(this._rootBlock.getBlocks(),a.getModel(),f),this._detectTasks&&(e.removeAnnotations(l.AnnotationType.ANNOTATION_TASK),this._computeTasks(this._rootBlock,b,f)),e.replaceAnnotations([],f));a.redrawLines()}var d=function(a,e,b,d,f){var g;void 0===d&&(d=-1);void 0===f&&(f=a.length);for(;1<
f-d;)if(g=Math.floor((f+d)/2),e<=a[g].start)f=g;else if(b&&e<a[g].end){f=g;break}else d=g;return f};m.prototype={blockSpansBeyondEnd:function(a){return a.pattern.regexEnd===this._eolRegex},computeBlocks:function(a,e,b,d,f,g,h){if(!e)return[];var k=[],l=[];f=f||0;g=g||Infinity;h=h||Infinity;b.blockPatterns.forEach(function(a){var b=this._findMatch(a.regexBegin||a.regex,e,f);b&&l.push({result:b,pattern:a})}.bind(this));if(!l.length)return k;l.sort(function(a,b){return a.result.index<b.result.index?
-1:a.result.index>b.result.index?1:a.pattern.pattern.index<b.pattern.pattern.index?-1:1});for(var m=0;0<l.length;){var n=l[0];l.splice(0,1);if(g<n.result.index)break;if(!(n.result.index<m)){var m=d+n.result.index,t=n.result.index,z=null,B=n.pattern.regexEnd;if(B){var t=t+n.result[0].length,v=n.pattern,A=this._substituteCaptureValues(B,n.result);A!==B&&(v={pattern:v.pattern,regexBegin:v.regexBegin,regexEnd:A},B=A);for(A=t;!z;){A=this._findMatch(B,e,A);A||(this._eolRegex.lastIndex=0,A=this._eolRegex.exec(e),
v={pattern:v.pattern,regexBegin:v.regexBegin,regexEnd:this._eolRegex});var C=this.createBlock({start:m,end:d+A.index+A[0].length,contentStart:d+t,contentEnd:d+A.index},b.styler,a,b,v),D=C.getBlocks();if(!D.length||D[D.length-1].end<=A.index+d)z=C;A=A.index+A[0].length}}else z=this.createBlock({start:m,end:m+n.result[0].length,contentStart:m,contentEnd:m+n.result[0].length},b.styler,a,b,n.pattern);k.push(z);if(k.length===h||g<=z.end)break;m=z.end-d}this._updateMatch(n,e,l,m,g)}return k},computeStyle:function(a,
e,b){if(!a.pattern)return null;var f={start:a.start,end:a.end,style:a.pattern.pattern.name};if(a.contentStart<=b&&b<a.contentEnd)return a.pattern.pattern.contentName?{start:a.contentStart,end:a.contentEnd,style:a.pattern.pattern.contentName}:f;var g,h;if(b<a.contentStart){h=a.pattern.pattern.beginCaptures||a.pattern.pattern.captures;if(!h)return f;g=a.pattern.regexBegin;e=e.getText(a.start,a.contentStart);a=a.start}else{h=a.pattern.pattern.endCaptures||a.pattern.pattern.captures;if(!h)return f;g=
a.pattern.regexEnd;e=e.getText(a.contentEnd,a.end);a=a.contentEnd}g.lastIndex=0;if(g=g.exec(e))if(e=[],this._getCaptureStyles(g,h,a,e),(h=e[d(e,b,!0)])&&h.start<=b&&b<h.end)return h;return f},createBlock:function(a,e,b,d,f){return new g(a,f?f.pattern.name:null,f?f.pattern.id:null,e,b,d,function(a){a.pattern=f;a.linePatterns=[];a.blockPatterns=[];a.enclosurePatterns={};this._initPatterns(this._patternManager,a)}.bind(this))},getBlockContentStyleName:function(a){return a.pattern.pattern.contentName||
a.pattern.pattern.name},getBlockEndStyle:function(a,e,b,d){var f;if(a.pattern.regexEnd&&(f=this._findMatch(a.pattern.regexEnd,e,0)))(e=a.pattern.pattern.endCaptures||a.pattern.pattern.captures)?this._getCaptureStyles(f,e,b-f[0].length,d):a.pattern.pattern.name&&d.push({start:b-f[0].length,end:b,style:a.pattern.pattern.name});return f?f[0]:null},getBlockStartStyle:function(a,e,b,d){var f;if(a.pattern.regexBegin&&(f=this._findMatch(a.pattern.regexBegin,e,0)))(e=a.pattern.pattern.beginCaptures||a.pattern.pattern.captures)?
this._getCaptureStyles(f,e,b,d):d.push({start:b,end:b+f[0].length,style:a.pattern.pattern.name});return f?f[0]:null},getBracketMatch:function(a,e){for(var b,d=Object.keys(a.enclosurePatterns),f=0;f<d.length;f++){var g=a.enclosurePatterns[d[f]],h=this._findMatch(g.regex,e,0);if(h&&0===h.index){b=g;break}}if(!b)return null;f=!1;-1!==b.pattern.name.indexOf(this._PUNCTUATION_SECTION_BEGIN)?(f=!0,d=b.pattern.name.replace(this._PUNCTUATION_SECTION_BEGIN,this._PUNCTUATION_SECTION_END)):d=b.pattern.name.replace(this._PUNCTUATION_SECTION_END,
this._PUNCTUATION_SECTION_BEGIN);return!a.enclosurePatterns[d]?null:{beginName:b.pattern.name,endName:d,atStart:f}},parse:function(a,e,b,d,f){if(a&&(b=b.linePatterns)){var g=[];b.forEach(function(b){var e=b.regex||b.regexBegin;e.oldLastIndex=e.lastIndex;(e=this._findMatch(e,a,0))&&g.push({result:e,pattern:b})}.bind(this));g.sort(function(a,b){return a.result.index<b.result.index?-1:a.result.index>b.result.index?1:a.pattern.pattern.index<b.pattern.pattern.index?-1:1});for(var h=0;0<g.length;){var k=
g[0];g.splice(0,1);if(!(k.result.index<h)){var l=k.result.index,m,n=[];if(k.pattern.regex){h=k.result;m=l+h[0].length;m={start:e+l,end:e+m,style:k.pattern.pattern.name};if(!f){k.pattern.pattern.captures&&this._getCaptureStyles(h,k.pattern.pattern.captures,e+l,n);n.sort(function(a,b){return a.start<b.start?-1:a.start>b.start?1:0});for(l=0;l<n.length-1;l++)if(n[l+1].start<n[l].end){var t={start:n[l+1].end,end:n[l].end,style:n[l].style};n[l].end=n[l+1].start;n.splice(l+2,0,t)}}this._mergeStyles(m,n,
d)}else h=k.pattern.regexEnd,h=this._substituteCaptureValues(h,k.result),h=this._findMatch(h,a,k.result.index+k.result[0].length),h||(this._eolRegex.lastIndex=0,h=this._eolRegex.exec(a)),m=h.index+h[0].length,d.push({start:e+l,end:e+m,style:k.pattern.pattern.name});h=h.index+h[0].length}this._updateMatch(k,a,g,h)}b.forEach(function(a){a=a.regex||a.regexBegin;a.lastIndex=a.oldLastIndex})}},setStyler:function(){},verifyBlock:function(a,e,b,d){var f=null,g=[];b.parent.blockPatterns.forEach(function(a){var b=
this._findMatch(a.regexBegin||a.regex,e,0);b&&g.push({result:b,pattern:a})}.bind(this));g.sort(function(a,b){return!a.result.index&&b.result.index?-1:a.result.index&&!b.result.index?1:!a.result.index&&!b.result.index?a.pattern.pattern.index<b.pattern.pattern.index?-1:1:0});if(!g.length||0!==g[0].result.index||g[0].pattern.pattern.id!==b.pattern.pattern.id)f=!1;else{var h=g[0],k=h.pattern.regexEnd;if(k){for(var k=this._substituteCaptureValues(k,h.result),h=h.result[0].length,l=this._findMatch(k,e,
h);null===f&&l&&b.start+l.index!==b.contentEnd+d;){var m=this.computeBlocks(a,e,b,b.start,h,l.index+1,null);!m.length||m[m.length-1].end<=b.start+l.index?f=!1:m.length?(h=m[m.length-1].end-b.start,l=this._findMatch(k,e,h)):l=null}l||(this._eolRegex.lastIndex=0,l=this._eolRegex.exec(e),f=b.start+l.index===b.end+d)}else f=b.start+h.result[0].length===b.end+d}return null!==f?f:!0},_findMatch:function(a,e,b,d){var f=b,g=a.lastIndex;this._linebreakRegex.lastIndex=b;b=this._linebreakRegex.exec(e);var h,
k;a.lastIndex=0;if(b){for(k=b.index;0<=--k&&!(h=e.charAt(k),h===this._NEWLINE||h===this._CR););h=e.substring(k+1,b.index+b[1].length);a.lastIndex=k=b.index-k-1}for(;b&&b.index<e.length;){var l;if(d){var m=a.lastIndex;a.test(h)&&(a.lastIndex=m,l=a.exec(h))}else l=a.exec(h);if(l)return l.index+=f,l.index-=k,a.lastIndex=g,l;k=0;f+=b[0].length;if(b=this._linebreakRegex.exec(e))h=b[1],a.lastIndex=0}a.lastIndex=g;return null},_getCaptureStyles:function(a,e,b,d){if(e[0])d.push({start:b,end:b+a[0].length,
style:e[0].name});else for(var f=0,g=1;g<a.length;g++)if(a[g]){var h=e[g];if(h){var k=b+f;d.push({start:k,end:k+a[g].length,style:h.name})}f+=a[g].length}},_initPatterns:function(a,e){if(e.pattern&&e.pattern.pattern.linePatterns)e.linePatterns=e.pattern.pattern.linePatterns,e.blockPatterns=e.pattern.pattern.blockPatterns,e.enclosurePatterns=e.pattern.pattern.enclosurePatterns;else{var b=a.getPatterns(e.pattern?e.pattern.pattern:null),d=function(a){a="string"===typeof a?a:a.match;var b=this._ignoreCaseRegex.exec(a),
e=this._FLAGS;b&&(a=a.substring(b[0].length),e+="i");return RegExp(a,e)}.bind(this),f=-1,g=0;b.forEach(function(a){var b;if(a.match&&!a.begin&&!a.end){if(b={regex:d(a.match),pattern:a},e.linePatterns.push(b),a.name&&0===a.name.indexOf("punctuation.section")&&(-1!==a.name.indexOf(this._PUNCTUATION_SECTION_BEGIN)||-1!==a.name.indexOf(this._PUNCTUATION_SECTION_END)))e.enclosurePatterns[a.name]=b}else!a.match&&(a.begin&&a.end)&&(f=g,b={regexBegin:d(a.begin),regexEnd:d(a.end),pattern:a},e.linePatterns.push(b));
g++}.bind(this));e.blockPatterns=e.linePatterns.slice(0,f+1);e.pattern&&(e.pattern.pattern.enclosurePatterns=e.enclosurePatterns,e.pattern.pattern.linePatterns=e.linePatterns,e.pattern.pattern.blockPatterns=e.blockPatterns)}},_mergeStyles:function(a,e,b){var d=a.start;e.forEach(function(e){d<=e.start&&b.push({start:d,end:e.start,style:a.style});b.push(e);d=e.end});d<a.end&&b.push({start:d,end:a.end,style:a.style})},_substituteCaptureValues:function(a,e){var b=a.toString();this._captureReferenceRegex.lastIndex=
0;if(!this._captureReferenceRegex.test(b))return a;this._captureReferenceRegex.lastIndex=0;for(var d=this._captureReferenceRegex.exec(b);d;)b=b.replace(d[0],e[d[1]]||""),this._captureReferenceRegex.lastIndex=0,d=this._captureReferenceRegex.exec(b);return RegExp(b.substring(1,b.length-1-this._FLAGS.length),this._FLAGS)},_updateMatch:function(a,e,b,d,f){var g=a.pattern.regex?a.pattern.regex:a.pattern.regexBegin;f=f||Infinity;if((e=this._findMatch(g,e,d,!0))&&e.index<f){a.result=e;for(f=0;f<b.length;f++)if(e.index<
b[f].result.index||e.index===b[f].result.index&&a.pattern.pattern.index<b[f].pattern.pattern.index){b.splice(f,0,a);return}b.push(a)}},_captureReferenceRegex:/\\(\d)/g,_eolRegex:/$/,_ignoreCaseRegex:/^\(\?i\)\s*/,_linebreakRegex:/(.*)(?:[\r\n]|$)/g,_CR:"\r",_FLAGS:"g",_NEWLINE:"\n",_PUNCTUATION_SECTION_BEGIN:".begin",_PUNCTUATION_SECTION_END:".end"};k.prototype={getPatterns:function(a){a?(a="string"===typeof a?a:a.qualifiedId,a+="#"):a=this._rootId+"#"+this._NO_ID;var e=[0],b={},d=RegExp("^"+a+"[^#]+$");
this._patterns.forEach(function(a){d.test(a.qualifiedId)&&(a.include?this._processInclude(a,e,b):(a.index=e[0]++,b[a.id]=a))}.bind(this));var f=[];Object.keys(b).forEach(function(a){f.push(b[a])});return f},_addPattern:function(a,e,b){a.parentId=b;a.id=e;a.qualifiedId=a.parentId+"#"+a.id;this._patterns.push(a);a.patterns&&!a.include&&this._addPatterns(a.patterns,a.qualifiedId)},_addPatterns:function(a,e){a.forEach(function(a){this._addPattern(a,this._NO_ID+this._unnamedCounter++,e)}.bind(this))},
_addRepositoryPatterns:function(a,e){Object.keys(a).forEach(function(b){this._addPattern(a[b],b,e)}.bind(this))},_processInclude:function(a,e,b){var d,f=a.include.indexOf("#");d=0===f?RegExp("^"+a.qualifiedId.substring(0,a.qualifiedId.indexOf("#"))+a.include+"$"):-1===f?RegExp("^"+a.include+"#"+this._NO_ID+"[^#]+$"):RegExp("^"+a.include+"$");this._patterns.forEach(function(a){d.test(a.qualifiedId)&&(a.include?this._processInclude(a,e,b):b[a.id]||(a.index=e[0]++,b[a.id]=a))}.bind(this))},_NO_ID:"NoID"};
g.prototype={adjustBounds:function(a,e){a<this.start&&(this.start+=e);a<this.contentStart&&(this.contentStart+=e);a<=this.end&&(this.end+=e);a<=this.contentEnd&&(this.contentEnd+=e);this._subBlocks.forEach(function(b){a<=b.end&&b.adjustBounds(a,e)})},getBlocks:function(){return this._subBlocks},getBlockAtIndex:function(a){return d(this.getBlocks(),a,!0)},isRenderingWhitespace:function(){return this.styler._isRenderingWhitespace()}};h.prototype={getStyles:function(a){return this._styler.getStyles(a)}};
f.prototype={computeBlocks:function(a,e,b,d,f,g,h){return this._stylerAdapter.computeBlocks(a,e,b,d,f,g,h)},destroy:function(){if(this._view){var a=this._view.getModel();a.getBaseModel&&(a=a.getBaseModel());a.removeEventListener("Changed",this._listener.onChanged);this._view.removeEventListener("MouseDown",this._listener.onMouseDown);this._view.removeEventListener("Selection",this._listener.onSelection);this._view.removeEventListener("Destroy",this._listener.onDestroy);this._view.removeEventListener("LineStyle",
this._listener.onLineStyle);this._view=null}},getBlockAtIndex:function(a){return this._findBlock(this._rootBlock,a)},getRootBlock:function(){return this._rootBlock},getStyleAccessor:function(){return this._accessor},getStyles:function(a){var e=[],b=this._view.getModel();b.getBaseModel&&(b=b.getBaseModel());var f=this._findBlock(this._rootBlock,a),g=b.getLineAtOffset(a),h=b.getLine(g),k=[];this._stylerAdapter.parse(h,b.getLineStart(g),f,k);for((g=k[d(k,a,!0)])&&(g.start<=a&&a<g.end)&&e.push(g);f;)(g=
this._stylerAdapter.computeStyle(f,b,a))&&e.splice(0,0,g),f=f.parent;return e},setDetectHyperlinks:function(){},setDetectTasks:function(a){this._detectTasks=a},setFoldingEnabled:function(a){this._foldingEnabled=a},setHighlightCaretLine:function(a){this._highlightCaretLine=a},setSpacesVisible:function(a){this._spacesVisible!==a&&(this._spacesVisible=a,this.setWhitespacesVisible(this._tabsVisible||this._spacesVisible,!1),this._view.redraw())},setTabsVisible:function(a){this._tabsVisible!==a&&(this._tabsVisible=
a,this.setWhitespacesVisible(this._tabsVisible||this._spacesVisible,!1),this._view.redraw())},setWhitespacesVisible:function(a,e){this._whitespacesVisible!==a&&(this._whitespacesVisible=a,e&&this._view.redraw())},_computeFolding:function(a,e,b){if(e.getBaseModel){var d=e.getBaseModel();a.forEach(function(a){var f=this._createFoldingAnnotation(e,d,a.start,a.end);f&&b.push(f);this._computeFolding(a.getBlocks(),e,b)}.bind(this))}},_computeTasks:function(a,e,b,d,f){d=d||a.start;f=f||a.end;if(a.start<=
f&&d<=a.end&&this._annotationModel){var g=l.AnnotationType.ANNOTATION_TASK;if(a.name&&0===a.name.indexOf("comment")){var h=[];this._stylerAdapter.parse(e.getText(a.contentStart,a.end),a.contentStart,a,h,!0);for(var k=0;k<h.length;k++)"meta.annotation.task.todo"===h[k].style&&(d<=h[k].start&&h[k].end<=f)&&b.push(l.AnnotationType.createAnnotation(g,h[k].start,h[k].end,e.getText(h[k].start,h[k].end)))}a.getBlocks().forEach(function(a){this._computeTasks(a,e,b,d,f)}.bind(this))}},_createFoldingAnnotation:function(a,
e,b,d){var f=e.getLineAtOffset(b),g=e.getLineAtOffset(d);return f===g||f+1===g&&e.getLineStart(g)===e.getLineEnd(g)?null:new (l.AnnotationType.getType(l.AnnotationType.ANNOTATION_FOLDING))(b,d,a)},_findBlock:function(a,e){var b=a.getBlocks();if(!b.length)return a;var f=d(b,e,!0);return f<b.length&&b[f].start<=e&&e<b[f].end?this._findBlock(b[f],e):a},_findBrackets:function(a,e,b,f,g){for(var h=[],k=[],l=f,m=e.getBlocks(),n=d(m,f,!0);n<m.length&&!(m[n].start>=g);n++){var r=m[n].start,t=m[n].end;l<r&&
(this._stylerAdapter.parse(b.substring(l-f,r-f),l,e,k),k.forEach(function(b){0===b.style.indexOf(a.beginName)?h.push(b.start+1):0===b.style.indexOf(a.endName)&&h.push(-(b.start+1))}),k=[]);l=t}l<g&&(this._stylerAdapter.parse(b.substring(l-f,g-f),l,e,k),k.forEach(function(b){b.style&&(0===b.style.indexOf(a.beginName)?h.push(b.start+1):0===b.style.indexOf(a.endName)&&h.push(-(b.start+1)))}));return h},_findMatchingBracket:function(a,e,b){var d=a.getLineAtOffset(b),f=a.getLineEnd(d),g=a.getText(b,f),
g=this._stylerAdapter.getBracketMatch(e,g);if(!g)return-1;for(var h=a.getLine(d),k=a.getLineStart(d),f=this._findBrackets(g,e,h,k,f),l=0;l<f.length;l++)if(h=0<=f[l]?1:-1,f[l]*h-1===b){b=1;if(g.atStart){for(l++;l<f.length;l++)if(h=0<=f[l]?1:-1,b+=h,0===b)return f[l]*h-1;d+=1;for(l=a.getLineCount();d<l;){h=a.getLine(d);k=a.getLineStart(d);f=a.getLineEnd(d);f=this._findBrackets(g,e,h,k,f);for(k=0;k<f.length;k++)if(h=0<=f[k]?1:-1,b+=h,0===b)return f[k]*h-1;d++}}else{for(l--;0<=l;l--)if(h=0<=f[l]?1:-1,
b+=h,0===b)return f[l]*h-1;for(d-=1;0<=d;){h=a.getLine(d);k=a.getLineStart(d);f=a.getLineEnd(d);f=this._findBrackets(g,e,h,k,f);for(l=f.length-1;0<=l;l--)if(h=0<=f[l]?1:-1,b+=h,0===b)return f[l]*h-1;d--}}break}return-1},_getLineStyle:function(a){if(this._highlightCaretLine){var e=this._view.getModel(),b=this._view.getSelection();if(b.start===b.end&&e.getLineAtOffset(b.start)===a)return this._caretLineStyle}return null},_getStyles:function(a,e,b,f){e.getBaseModel&&(f=e.mapOffset(f));for(var g=f+b.length,
h=[],k=f,l=a.getBlocks(),m=d(l,f,!0);m<l.length&&!(l[m].start>=g);m++){var n=l[m].start,r=l[m].end;k<n&&this._stylerAdapter.parse(b.substring(k-f,n-f),k,a,h);var t=Math.max(k,n);t===n&&(n=this._stylerAdapter.getBlockStartStyle(l[m],b.substring(t-f),t,h))&&(t+=n.length);var n=Math.min(g,r),z=[];n===r&&(k=b.substring(n-k-(l[m].end-l[m].contentEnd)),(k=this._stylerAdapter.getBlockEndStyle(l[m],k,n,z))&&(n-=k.length));var k=this._getStyles(l[m],e,b.substring(t-f,n-f),t),B=this._stylerAdapter.getBlockContentStyleName(l[m]);
if(B){var v=t;k.forEach(function(a){a.start-v&&h.push({start:v,end:a.start,style:B});a.mergeable&&(a.style+=","+B);h.push(a);v=a.end});n-v&&h.push({start:v,end:n,style:B})}else h=h.concat(k);h=h.concat(z);k=r}k<g&&this._stylerAdapter.parse(b.substring(k-f,g-f),k,a,h);if(e.getBaseModel)for(a=0;a<h.length;a++)b=h[a].end-h[a].start,h[a].start=e.mapOffset(h[a].start,!0),h[a].end=h[a].start+b;return h},_isRenderingWhitespace:function(){return this._whitespacesVisible&&(this._tabsVisible||this._spacesVisible)},
_onDestroy:function(){this.destroy()},_onLineStyle:function(a){a.textView===this._view&&(a.style=this._getLineStyle(a.lineIndex));a.ranges=this._getStyles(this._rootBlock,a.textView.getModel(),a.lineText,a.lineStart);a.ranges.forEach(function(a){a.style&&(a.style={styleClass:a.style.replace(/\./g," ")})});this._isRenderingWhitespace()&&(this._spacesVisible&&this._spliceStyles(this._spacePattern,a.ranges,a.lineText,a.lineStart),this._tabsVisible&&this._spliceStyles(this._tabPattern,a.ranges,a.lineText,
a.lineStart))},_onModelChanged:function(a){var e=a.start,b=a.removedCharCount;a=a.addedCharCount-b;var f=this._view.getModel(),g=f.getBaseModel?f.getBaseModel():f,b=e+b,h=g.getCharCount(),k=g.getLineStart(g.getLineAtOffset(e)),m=this._findBlock(this._rootBlock,e),n,y,r,t,z,B,v;do{r=m.parent;if(!n&&r&&(z=g.getText(m.start,Math.min(h,m.end+a+1)),!this._stylerAdapter.verifyBlock(g,z,m,a))){m=r;continue}y=m.getBlocks();var A=y.length,C=d(y,k,!0),D=d(y,b,!1,C-1,A);n=!1;if(C&&y.length&&y[C-1].end===e){z=
g.getText(y[C-1].start,Math.min(h,e+1));var E=this.computeBlocks(g,z,m,y[C-1].start,null,null,null);E.length&&E[0].end!==y[C-1].end&&(C--,n=!0)}C<A&&y[C].start<=k&&(k<y[C].end||n)?(v=y[C].start,v>e&&(v+=a)):C===A&&0<A&&m.end-a===y[A-1].end?(v=y[--C].start,v>e&&(v+=a)):v=Math.max(k,m.contentStart);B=D<A?y[D].end:m.contentEnd;e<=B&&(B+=a);B=Math.min(B,h-1);z=g.getText(v,B+1);E=this.computeBlocks(g,z,m,v,null,null,null);if(D<A){if(E.length&&E[E.length-1].end===B&&E[E.length-1].typeId===y[D].typeId)break;
if(E.length&&this._stylerAdapter.blockSpansBeyondEnd(E[E.length-1])){D++;for(var K=E[E.length-1].getBlocks(),K=(K.length?K[K.length-1]:E[E.length-1]).typeId;D<A;){if(y[D].typeId===K){var I=y[D].end+a,I=Math.min(I,h-1);z=g.getText(v,I+1);z=this.computeBlocks(g,z,m,v,null,null,null);if(z.length&&z[z.length-1].end===I){B=I;E=z;break}}D++}if(D<A)break}}else if(!E.length||E[E.length-1].end<=m.contentEnd+a)break;if(!r){B=h;D=A;z=g.getText(v,B);E=this.computeBlocks(g,z,m,v,null,null,null);break}m=r;t=!0}while(1);
this._rootBlock.adjustBounds(e,a);D=Math.min(D+1,A);t||(t=D-C!==E.length);if(!t)for(A=0;A<E.length;A++)if(n=y[C+A],h=E[A],n.start!==h.start||n.end!==h.end||n.typeId!==h.typeId){t=!0;break}!y.length&&!E.length?this.dispatchEvent({type:"BlocksChanged",old:[m],"new":[m]}):this.dispatchEvent({type:"BlocksChanged",old:y.slice(C,D),"new":E});C=[C,D-C].concat(E);Array.prototype.splice.apply(y,C);t&&(y=v,t=B,f!==g&&(y=f.mapOffset(y,!0),t=f.mapOffset(t,!0)),this._view.redrawRange(y,t));if(this._annotationModel){y=
[];var F=[],G=[];t=this._annotationModel.getAnnotations(v,B);C=this._foldingEnabled&&g!==f;for(D=m.parent||m;t.hasNext();)E=t.next(),C&&E.type===l.AnnotationType.ANNOTATION_FOLDING?(G.push(E),n=this._findBlock(D,E.start),!n||!(E.start===n.start&&E.end===n.end)?(y.push(E),E.expand()):(n=E.start,A=E.end,n>e&&(n-=a),A>e&&(A-=a),n<=e&&(e<A&&n<=b&&b<A)&&(n=g.getLineAtOffset(E.start),A=g.getLineAtOffset(E.end),n!==A?E.expanded||E.expand():y.push(E)))):E.type===l.AnnotationType.ANNOTATION_TASK&&m.start<=
E.start&&E.end<=m.end&&y.push(E);C&&D.getBlocks().forEach(function(a){this._updateFolding(a,g,f,G,F,v,B)}.bind(this));this._detectTasks&&this._computeTasks(m,g,F,v,B);this._annotationModel.replaceAnnotations(y,F)}},_onMouseDown:function(a){if(2===a.clickCount){var e=this._view.getModel(),b=this._view.getOffsetAtLocation(a.x,a.y);if(0<b){var d=b-1,f=e;e.getBaseModel&&(d=e.mapOffset(d),f=e.getBaseModel());var g=this._findBlock(this._rootBlock,d),d=this._findMatchingBracket(f,g,d);-1!==d&&(a.preventDefault(),
a=d,e.getBaseModel&&(a=e.mapOffset(a,!0)),b>a&&(b--,a++),this._view.setSelection(a,b))}}},_onSelection:function(a){var e=a.oldValue,b=a.newValue;a=this._view.getModel();var d;if(this._highlightCaretLine){var f=a.getLineAtOffset(e.start);d=a.getLineAtOffset(b.start);var g=b.start===b.end,e=e.start===e.end;f===d&&e&&g||(e&&this._view.redrawLines(f,f+1),(f!==d||!e)&&g&&this._view.redrawLines(d,d+1))}if(this._annotationModel){var e=this._bracketAnnotations,h,k;if(b.start===b.end&&0<(k=this._view.getCaretOffset()))k-=
1,a.getBaseModel&&(k=a.mapOffset(k),a=a.getBaseModel()),b=this._findBlock(this._rootBlock,k),a=this._findMatchingBracket(a,b,k),-1!==a&&(h=[l.AnnotationType.createAnnotation(l.AnnotationType.ANNOTATION_MATCHING_BRACKET,a,a+1),l.AnnotationType.createAnnotation(l.AnnotationType.ANNOTATION_CURRENT_BRACKET,k,k+1)]);this._bracketAnnotations=h;this._annotationModel.replaceAnnotations(e,h)}},_spliceStyles:function(a,e,b,d){for(var f=a.regex,g=f.lastIndex=0,h=f.exec(b);h;){for(h=d+h.index;g<e.length&&!(h<
e[g].end);)g++;var k={start:h,end:h+1,style:a.style};if(g<e.length&&e[g].start<=h){var l={start:h+1,end:e[g].end,style:e[g].style};e[g].end=h;e.splice(g+1,0,l);e.splice(g+1,0,k);g+=2}else e.splice(g,0,k),g++;h=f.exec(b)}},_updateFolding:function(a,e,b,f,g,h,k){h=h||a.start;k=k||a.end;if(!a.doNotFold&&a.start<=k&&h<=a.end){var l=d(f,a.start,!0);l<f.length&&f[l].start===a.start&&f[l].end===a.end||(l=this._createFoldingAnnotation(b,e,a.start,a.end))&&g.push(l);a.getBlocks().forEach(function(a){this._updateFolding(a,
e,b,f,g,h,k)}.bind(this))}},_caretLineStyle:{styleClass:"meta annotation currentLine"},_spacePattern:{regex:/[ ]/g,style:{styleClass:"punctuation separator space",unmergeable:!0}},_tabPattern:{regex:/\t/g,style:{styleClass:"punctuation separator tab",unmergeable:!0}}};n.EventTarget.addMixin(f.prototype);return{TextStyler:f,Block:g,createPatternBasedAdapter:function(a,e){return new m(a,e)}}});
define("orion/editor/textMateStyler",["orion/regex"],function(l){function n(g){var h;if(g instanceof Array){h=Array(g.length);for(var f=0;f<g.length;f++)h[f]=n(g[f])}else for(f in h={},g)if(Object.prototype.hasOwnProperty.call(g,f)){var d=g[f];h[f]="object"===typeof d&&null!==d?n(d):d}return h}function m(g,h,f){this.initialize(g);this.grammar=n(h);this.externalGrammars=f?n(f):[];this._styles={};this._tree=null;this._allGrammars={};this.preprocess(this.grammar)}var k={unsupported:[{regex:/\(\?[ims\-]:/,
func:function(g){return"option on/off for subexp"}},{regex:/\(\?<([=!])/,func:function(g){return"\x3d"===g[1]?"lookbehind":"negative lookbehind"}},{regex:/\(\?>/,func:function(g){return"atomic group"}}],toRegExp:function(g){function h(a,b){throw Error('Unsupported regex feature "'+a+'": "'+b[0]+'" at index: '+b.index+" in "+b.input);}var f="",d;g=k.processGlobalFlag("x",g,function(a){for(var b="",d=!1,f=a.length,g=0;g<f;){var h=a.charAt(g);if(!d&&"#"===h)for(;g<f&&"\r"!==h&&"\n"!==h;)h=a.charAt(++g);
else if(!d&&/\s/.test(h))for(;g<f&&/\s/.test(h);)h=a.charAt(++g);else"\\"===h?(b+=h,/\s/.test(a.charAt(g+1))||(b+=a.charAt(g+1),g+=1)):("["===h?d=!0:"]"===h&&(d=!1),b+=h),g+=1}return b});g=k.processGlobalFlag("i",g,function(a){f+="i";return a});for(d=0;d<this.unsupported.length;d++){var a;(a=this.unsupported[d].regex.exec(g))&&h(this.unsupported[d].func(a),a)}return RegExp(g,f)},processGlobalFlag:function(g,h,f){var d="(?"+g+")";g="(?"+g+":";if(h.substring(0,d.length)===d)return f(h.substring(d.length));
if(h.substring(0,g.length)===g){for(var d=0,a=h.length,e=-1,b=0;b<a&&-1===e;b++)switch(h.charAt(b)){case "\\":b++;break;case "(":d++;break;case ")":d--,0===d&&(e=b)}d=e;if(d<h.length-1)throw Error("Only a "+g+") group that encloses the entire regex is supported in: "+h);return f(h.substring(g.length,d))}return h},hasBackReference:function(g){return/\\\d+/.test(g.source)},getSubstitutedRegex:function(g,h,f){f="undefined"===typeof f?!0:!1;g=g.source.split(/(\\\d+)/g);for(var d=[],a=0;a<g.length;a++){var e=
g[a],b=/\\(\d+)/.exec(e);b?(e=h[b[1]]||"",d.push(f?l.escape(e):e)):d.push(e)}return RegExp(d.join(""))},groupify:function(g,h){for(var f=g.source,d=f.length,a=[],e=0,b=[],k=1,l=1,m=[],n={},w={},x=0;x<d;x++){var y=a[a.length-1],r=f.charAt(x);switch(r){case "(":4===y&&(a.pop(),m.push(")"),b[b.length-1].end=x);var t=x+2<d?f.charAt(x+1)+""+f.charAt(x+2):null;if("?:"===t||"?\x3d"===t||"?!"===t){var z;"?:"===t?z=1:(z=3,e++);a.push(z);b.push({start:x,end:-1,type:z});m.push(r);m.push(t);x+=t.length}else a.push(2),
b.push({start:x,end:-1,type:2,oldNum:k,num:l}),m.push(r),0===e&&(w[l]=null),n[k]=l,k++,l++;break;case ")":y=a.pop();3===y&&e--;b[b.length-1].end=x;m.push(r);break;case "*":case "+":case "?":case "}":var B=r,v=f.charAt(x-1),t=x-1;if("}"===r){for(z=x-1;"{"!==f.charAt(z)&&0<=z;z--);v=f.charAt(z-1);t=z-1;B=f.substring(z,x+1)}z=b[b.length-1];if(")"===v&&(2===z.type||4===z.type)){m.splice(z.start,0,"(");m.push(B);m.push(")");r={start:z.start,end:m.length-1,type:4,num:z.num};for(v=0;v<b.length;v++)if(y=
b[v],(2===y.type||4===y.type)&&y.start>=z.start&&y.end<=t)y.start+=1,y.end+=1,y.num+=1,2===y.type&&(n[y.oldNum]=y.num);b.push(r);l++;break}default:"|"!==r&&(2!==y&&4!==y)&&0===e&&(a.push(4),b.push({start:x,end:-1,type:4,num:l}),m.push("("),w[l]=null,l++),m.push(r),"\\"===r&&(r=f.charAt(x+1),m.push(r),x+=1)}}for(;a.length;)a.pop(),m.push(")");f=RegExp(m.join(""));d={};h=h||n;for(var A in h)h.hasOwnProperty(A)&&(d[A]="\\"+h[A]);f=this.getSubstitutedRegex(f,d,!1);return[f,n,w]},complexCaptures:function(g){if(!g)return!1;
for(var h in g)if(g.hasOwnProperty(h)&&"0"!==h)return!0;return!1}};m.prototype={initialize:function(g){this.textView=g;this.textView.stylerOptions=this;var h=this;this._listener={onModelChanged:function(f){h.onModelChanged(f)},onDestroy:function(f){h.onDestroy(f)},onLineStyle:function(f){h.onLineStyle(f)},onStorage:function(f){h.onStorage(f)}};g.addEventListener("ModelChanged",this._listener.onModelChanged);g.addEventListener("Destroy",this._listener.onDestroy);g.addEventListener("LineStyle",this._listener.onLineStyle);
g.redrawLines()},onDestroy:function(g){this.destroy()},destroy:function(){this.textView&&(this.textView.removeEventListener("ModelChanged",this._listener.onModelChanged),this.textView.removeEventListener("Destroy",this._listener.onDestroy),this.textView.removeEventListener("LineStyle",this._listener.onLineStyle),this.textView=null);this._listener=this._tree=this._styles=this.grammar=null},preprocess:function(g){for(g=[g];0!==g.length;){var h=g.pop();if(!h._resolvedRule||!h._typedRule)if(h._resolvedRule=
this._resolve(h),h._typedRule=this._createTypedRule(h),this.addStyles(h.name),this.addStyles(h.contentName),this.addStylesForCaptures(h.captures),this.addStylesForCaptures(h.beginCaptures),this.addStylesForCaptures(h.endCaptures),h._resolvedRule!==h&&g.push(h._resolvedRule),h.patterns)for(var f=0;f<h.patterns.length;f++)g.push(h.patterns[f])}},addStyles:function(g){if(g&&!this._styles[g]){this._styles[g]=[];for(var h=g.split("."),f=0;f<h.length;f++)this._styles[g].push(h.slice(0,f+1).join("-"))}},
addStylesForCaptures:function(g){for(var h in g)g.hasOwnProperty(h)&&this.addStyles(g[h].name)},ContainerRule:function(){function g(g){this.rule=g;this.subrules=g.patterns}g.prototype.valueOf=function(){return"aa"};return g}(),BeginEndRule:function(){function g(g){this.rule=g;this.beginRegex=k.toRegExp(g.begin);this.endRegex=k.toRegExp(g.end);this.subrules=g.patterns||[];this.endRegexHasBackRef=k.hasBackReference(this.endRegex);var f=k.complexCaptures(g.captures);g=k.complexCaptures(g.beginCaptures)||
k.complexCaptures(g.endCaptures);if(this.isComplex=f||g)f=k.groupify(this.beginRegex),this.beginRegex=f[0],this.beginOld2New=f[1],this.beginConsuming=f[2],f=k.groupify(this.endRegex,this.beginOld2New),this.endRegex=f[0],this.endOld2New=f[1],this.endConsuming=f[2]}g.prototype.valueOf=function(){return this.beginRegex};return g}(),MatchRule:function(){function g(g){this.rule=g;this.matchRegex=k.toRegExp(g.match);if(this.isComplex=k.complexCaptures(g.captures))g=k.groupify(this.matchRegex),this.matchRegex=
g[0],this.matchOld2New=g[1],this.matchConsuming=g[2]}g.prototype.valueOf=function(){return this.matchRegex};return g}(),_createTypedRule:function(g){return g.match?new this.MatchRule(g):g.begin?new this.BeginEndRule(g):new this.ContainerRule(g)},_resolve:function(g){var h=g;if(g.include){if(g.begin||g.end||g.match)throw Error('Unexpected regex pattern in "include" rule '+g.include);g=g.include;if("#"===g.charAt(0)){if(h=this.grammar.repository&&this.grammar.repository[g.substring(1)],!h)throw Error("Couldn't find included rule "+
g+" in grammar repository");}else if("$self"===g)h=this.grammar;else{if("$base"===g)throw Error('Include "$base" is not supported');h=this._allGrammars[g];if(!h)for(var f=0;f<this.externalGrammars.length;f++){var d=this.externalGrammars[f];if(d.scopeName===g){this.preprocess(d);h=this._allGrammars[g]=d;break}}}}return h},ContainerNode:function(){function g(g,f){this.parent=g;this.rule=f;this.children=[];this.end=this.start=null}g.prototype.addChild=function(g){this.children.push(g)};g.prototype.valueOf=
function(){var g=this.rule;return"ContainerNode { "+(g.include||"")+" "+(g.name||"")+(g.comment||"")+"}"};return g}(),BeginEndNode:function(){function g(g,f,d){this.parent=g;this.rule=f;this.children=[];this.setStart(d);this.endMatch=this.end=null;this.endRegexSubstituted=f.endRegexHasBackRef?k.getSubstitutedRegex(f.endRegex,d):null}g.prototype.addChild=function(g){this.children.push(g)};g.prototype.getIndexInParent=function(g){return this.parent?this.parent.children.indexOf(this):-1};g.prototype.setStart=
function(g){this.start=g.index;this.beginMatch=g};g.prototype.setEnd=function(g){g&&"object"===typeof g?(this.endMatch=g,this.end=g.index+g[0].length):(this.endMatch=null,this.end=g)};g.prototype.shiftStart=function(g){this.start+=g;this.beginMatch.index+=g};g.prototype.shiftEnd=function(g){this.end+=g;this.endMatch&&(this.endMatch.index+=g)};g.prototype.valueOf=function(){return"{"+this.rule.beginRegex+" range\x3d"+this.start+".."+this.end+"}"};return g}(),push:function(g,h){if(h)for(var f=h.length;0<
f;)g.push(h[--f])},exec:function(g,h,f){if(h=g.exec(h))h.index+=f;g.lastIndex=0;return h},afterMatch:function(g){return g.index+g[0].length},getEndMatch:function(g,h,f){if(g instanceof this.BeginEndNode){var d=g.rule;g=g.endRegexSubstituted||d.endRegex;return!g?null:this.exec(g,h,f)}return null},initialParse:function(){this.textView.getModel().getCharCount();this._tree=new this.ContainerNode(null,this.grammar._typedRule);this.parse(this._tree,!1,0)},onModelChanged:function(g){var h=g.addedCharCount,
f=g.removedCharCount;g=g.start;if(this._tree){var d=this.textView.getModel(),a=d.getCharCount(),d=d.getLineEnd(d.getLineAtOffset(g)-1),e=this.getFirstDamaged(d,d),d=-1===d?0:d,h=e?this.parse(e,!0,d,g,h,f):a;this.textView.redrawRange(d,h)}else this.initialParse()},getFirstDamaged:function(g,h){if(0>g)return this._tree;for(var f=[this._tree],d=null;f.length;){var a=f.pop();if(!a.parent||this.isDamaged(a,g,h)){a instanceof this.BeginEndNode&&(d=a);for(var e=0;e<a.children.length;e++)f.push(a.children[e])}}return d||
this._tree},isDamaged:function(g,h,f){return g.start<=f&&g.end>h},parse:function(g,h,f,d,a,e){var b=this.textView.getModel(),k=b.getLineStart(b.getLineCount()-1),l=b.getCharCount(),m=this.getInitialExpected(g,f),n=-1;h&&(g.repaired=!0,g.endNeedsUpdate=!0,n=(n=g.children[g.children.length-1])?b.getLineEnd(b.getLineAtOffset(n.end+(a-e))):-1,d=b.getLineEnd(b.getLineAtOffset(d+e)),n=Math.max(n,d));n=-1===n?l:n;d=m;for(var w=g,x=!1,y=f,r=-1;w&&(!h||y<n);){var t=this.getNextMatch(b,w,y);t||(y=y>=k?l:b.getLineStart(b.getLineAtOffset(y)+
1));var z=t&&t.match,B=t&&t.rule,v=t&&t.isEnd;if(t&&t.isSub)y=this.afterMatch(z),B instanceof this.BeginEndRule&&(x=!0,h&&B===d.rule&&w===d.parent?(w=d,w.setStart(z),w.repaired=!0,w.endNeedsUpdate=!0,d=this.getNextExpected(d,"begin")):(h&&(this.prune(w,d),h=!1),z=new this.BeginEndNode(w,B,z),w.addChild(z),w=z));else if(v||y===l)w instanceof this.BeginEndNode&&(z?(x=!0,r=Math.max(r,w.end),w.setEnd(z),y=this.afterMatch(z),h&&w===d&&w.parent===d.parent?(w.repaired=!0,delete w.endNeedsUpdate,d=this.getNextExpected(d,
"end")):h&&(this.prune(w,d),h=!1)):(w.setEnd(l),delete w.endNeedsUpdate)),w=w.parent;h&&(y>=n&&!x)&&(this.prune(g,m),h=!1)}this.removeUnrepairedChildren(g,h,f);this.cleanup(h,g,f,n,l,a,e);return h?Math.max(r,y):y},removeUnrepairedChildren:function(g,h,f){if(h){h=g.children;for(var d=-1,a=0;a<h.length;a++){var e=h[a];if(!e.repaired&&this.isDamaged(e,f,Number.MAX_VALUE)){d=a;break}}-1!==d&&(g.children.length=d)}},cleanup:function(g,h,f,d,a,e,b){if(g){g=e-b;a=this.getIntersecting(d-g+1,a);h=this.getIntersecting(f,
d);for(f=0;f<a.length;f++)d=a[f],!d.repaired&&d instanceof this.BeginEndNode&&(d.shiftEnd(g),d.shiftStart(g));for(f=0;f<h.length;f++)d=h[f],d.repaired&&d.endNeedsUpdate&&d.shiftEnd(g),delete d.endNeedsUpdate,delete d.repaired}else{h=this.getIntersecting(f,d);for(f=0;f<h.length;f++)delete h[f].repaired}},getNextMatch:function(g,h,f,d){var a=g.getLineAtOffset(f),a=g.getLineEnd(a),e=g.getText(f,a),b=[],k=[];g=[];a=[];for(this.push(b,h.rule.subrules);b.length;){var l=b.length?b.pop():null,l=l&&l._resolvedRule._typedRule;
if(l instanceof this.ContainerRule&&-1===k.indexOf(l))k.push(l),this.push(b,l.subrules);else if(!l||!d||l.matchRegex){var m=l&&this.exec(l.matchRegex||l.beginRegex,e,f);m&&(g.push(m),a.push(l))}}b=Number.MAX_VALUE;k=-1;for(l=0;l<g.length;l++)m=g[l],m.index<b&&(b=m.index,k=l);if(!d&&(f=this.getEndMatch(h,e,f)))if(d=h.rule.applyEndPatternLast,-1===k||f.index<b||!d&&f.index===b)return{isEnd:!0,rule:h.rule,match:f};return-1===k?null:{isSub:!0,rule:a[k],match:g[k]}},getInitialExpected:function(g,h){var f,
d;if(g===this._tree)for(f=0;f<g.children.length;f++){if(d=g.children[f],d.start>=h)return d}else if(g instanceof this.BeginEndNode&&g.endMatch){var a=g.endMatch.index;for(f=0;f<g.children.length&&!(d=g.children[f],d.start>=h);f++);if(d&&d.start<a)return d}return g},getNextExpected:function(g,h){if("begin"===h){var f=g.children[0];return f?f:g}if("end"===h&&(f=g.parent)){var d=f.children[f.children.indexOf(g)+1];return d?d:f}return null},prune:function(g,h){h.parent===g?g.children.length=h.getIndexInParent():
g instanceof this.BeginEndNode&&(g.endMatch=null,g.end=null);g.parent&&(g.parent.children.length=g.getIndexInParent()+1)},onLineStyle:function(g){this._tree||this.initialParse();var h=g.lineStart,f=this.textView.getModel(),d=f.getLineEnd(g.lineIndex),a=f.getLineEnd(f.getLineAtOffset(h)-1),a=this.getFirstDamaged(a,a),h=this.getLineScope(f,a,h,d);g.ranges=this.toStyleRanges(h);g.ranges.sort(function(a,b){return a.start-b.start})},getLineScope:function(g,h,f,d){for(var a=f,e=this.getInitialExpected(h,
f),b=[],k=[];h&&a<d;){var l=this.getNextMatch(g,h,a);if(!l)break;var m=l&&l.match,n=l&&l.rule,w=l&&l.isSub,l=l&&l.isEnd;m.index!==a&&k.push({start:a,end:m.index,node:h});w?(a=this.afterMatch(m),n instanceof this.BeginEndRule?(this.addBeginScope(b,m,n),h=e,e=this.getNextExpected(e,"begin")):this.addMatchScope(b,m,n)):l&&(a=this.afterMatch(m),this.addEndScope(b,m,n),e=this.getNextExpected(e,"end"),h=h.parent)}a<d&&k.push({start:a,end:d,node:h});g=this.getInheritedLineScope(k,f,d);return b.concat(g)},
getInheritedLineScope:function(g,h,f){h=[];for(f=0;f<g.length;f++)for(var d=g[f],a=d.node;a;){var e=a.rule.rule,b=e.name;if(e=e.contentName||b){this.addScopeRange(h,d.start,d.end,e);break}a=a.parent}return h},addBeginScope:function(g,h,f){var d=f.rule;this.addCapturesScope(g,h,d.beginCaptures||d.captures,f.isComplex,f.beginOld2New,f.beginConsuming)},addEndScope:function(g,h,f){var d=f.rule;this.addCapturesScope(g,h,d.endCaptures||d.captures,f.isComplex,f.endOld2New,f.endConsuming)},addMatchScope:function(g,
h,f){var d=f.rule,a=d.name;(d=d.captures)?this.addCapturesScope(g,h,d,f.isComplex,f.matchOld2New,f.matchConsuming):this.addScope(g,h,a)},addScope:function(g,h,f){f&&g.push({start:h.index,end:this.afterMatch(h),scope:f})},addScopeRange:function(g,h,f,d){d&&g.push({start:h,end:f,scope:d})},addCapturesScope:function(g,h,f,d,a,e){if(f)if(d){d={1:0};for(var b=0,k=1;void 0!==h[k];k++)void 0!==e[k]&&(b+=h[k].length),void 0!==h[k+1]&&(d[k+1]=b);e=h.index;for(b=1;f[b];b++){var k=f[b].name,l=a[b],m=e+d[l];
"undefined"!==typeof h[l]&&this.addScopeRange(g,m,m+h[l].length,k)}}else this.addScope(g,h,f[0]&&f[0].name)},getIntersecting:function(g,h){for(var f=[],d=this._tree?[this._tree]:[];d.length;){var a=d.pop(),e=!1;a instanceof this.ContainerNode?e=!0:this.isDamaged(a,g,h)&&(e=!0,f.push(a));if(e)for(var e=a.children.length,b=0;b<e;b++)d.push(a.children[b])}return f.reverse()},toStyleRanges:function(g){for(var h=[],f=0;f<g.length;f++){var d=g[f],a=this._styles[d.scope];if(!a)throw Error("styles not found for "+
d.scope);a=a.join(" ");h.push({start:d.start,end:d.end,style:{styleClass:a}})}return h}};return{RegexUtil:k,TextMateStyler:m}});
define("orion/editor/AsyncStyler",["i18n!orion/editor/nls/messages","orion/editor/annotations"],function(l,n){function m(f){return-1!==f.getProperty("objectClass").indexOf(g)&&"highlighter"===f.getProperty("type")}function k(f,d,a){this.initialize(f,d,a);this.lineStyles=[]}var g="orion.edit.highlighter",h=g+" service must be an event emitter";n.AnnotationType.registerType("orion.annotation.highlightError",{title:l.syntaxError,html:"\x3cdiv class\x3d'annotationHTML error'\x3e\x3c/div\x3e",rangeStyle:{styleClass:"annotationRange error"}});
k.prototype={initialize:function(f,d,a){this.textView=f;this.serviceRegistry=d;this.annotationModel=a;this.services=[];var e=this;this.listener={onModelChanging:function(a){e.onModelChanging(a)},onModelChanged:function(a){e.onModelChanged(a)},onDestroy:function(a){e.onDestroy(a)},onLineStyle:function(a){e.onLineStyle(a)},onStyleReady:function(a){e.onStyleReady(a)},onServiceAdded:function(a){e.onServiceAdded(a.serviceReference,e.serviceRegistry.getService(a.serviceReference))},onServiceRemoved:function(a){e.onServiceRemoved(a.serviceReference,
e.serviceRegistry.getService(a.serviceReference))}};f.addEventListener("ModelChanging",this.listener.onModelChanging);f.addEventListener("ModelChanged",this.listener.onModelChanged);f.addEventListener("Destroy",this.listener.onDestroy);f.addEventListener("LineStyle",this.listener.onLineStyle);d.addEventListener("registered",this.listener.onServiceAdded);d.addEventListener("unregistering",this.listener.onServiceRemoved);f=d.getServiceReferences(g);for(a=0;a<f.length;a++){var b=f[a];m(b)&&this.addServiceListener(d.getService(b))}},
onDestroy:function(f){this.destroy()},destroy:function(){this.textView&&(this.textView.removeEventListener("ModelChanging",this.listener.onModelChanging),this.textView.removeEventListener("ModelChanged",this.listener.onModelChanged),this.textView.removeEventListener("Destroy",this.listener.onDestroy),this.textView.removeEventListener("LineStyle",this.listener.onLineStyle),this.textView=null);if(this.services){for(var f=0;f<this.services.length;f++)this.removeServiceListener(this.services[f]);this.services=
null}this.serviceRegistry&&(this.serviceRegistry.removeEventListener("registered",this.listener.onServiceAdded),this.serviceRegistry.removeEventListener("unregistering",this.listener.onServiceRemoved),this.serviceRegistry=null);this.lineStyles=this.listener=null},onModelChanging:function(f){this.startLine=this.textView.getModel().getLineAtOffset(f.start)},onModelChanged:function(f){var d=this.startLine;(f.addedLineCount||f.removedLineCount)&&Array.prototype.splice.apply(this.lineStyles,[d,f.removedLineCount].concat(this._getEmptyStyle(f.addedLineCount)))},
onStyleReady:function(f){var d=f.lineStyles||f.style;f=Number.MAX_VALUE;var a=-1,e=this.textView.getModel(),b;for(b in d)Object.prototype.hasOwnProperty.call(d,b)&&(this.lineStyles[b]=d[b],f=Math.min(f,b),a=Math.max(a,b));f=Math.max(f,0);a=Math.min(a,e.getLineCount());if(d=this.annotationModel){for(var g=d.getAnnotations(e.getLineStart(f),e.getLineEnd(a)),h=[];g.hasNext();){var k=g.next();"orion.annotation.highlightError"===k.type&&h.push(k)}g=[];for(k=f;k<=a;k++){b=k;var l=this.lineStyles[b],l=l&&
l.errors;b=e.getLineStart(b);if(l)for(var m=0;m<l.length;m++){var x=l[m];g.push(n.AnnotationType.createAnnotation("orion.annotation.highlightError",x.start+b,x.end+b))}}d.replaceAnnotations(h,g)}this.textView.redrawLines(f,a+1)},onLineStyle:function(f){var d=this.lineStyles[f.lineIndex];if(d)if(d.ranges){for(var d=d.ranges,a=f.lineStart,e=d.length,b=[],g=0;g<e;g++){var h=d[g];b.push({start:h.start+a,end:h.end+a,style:h.style})}f.ranges=b}else d.style&&(f.style=d.style)},_getEmptyStyle:function(f){for(var d=
[],a=0;a<f;a++)d.push(null);return d},setContentType:function(f){this.contentType=f;if(this.services)for(f=0;f<this.services.length;f++){var d=this.services[f];if(d.setContentType){var a=this.serviceRegistry.getService("orion.page.progress");a?a.progress(d.setContentType(this.contentType),"Styling content type: "+this.contentType.id?this.contentType.id:this.contentType):d.setContentType(this.contentType)}}},onServiceAdded:function(f,d){m(f)&&this.addServiceListener(d)},onServiceRemoved:function(f,
d){-1!==this.services.indexOf(d)&&this.removeServiceListener(d)},addServiceListener:function(f){if("function"===typeof f.addEventListener){if(f.addEventListener("orion.edit.highlighter.styleReady",this.listener.onStyleReady),this.services.push(f),f.setContentType&&this.contentType){var d=this.serviceRegistry.getService("orion.page.progress");d?d.progress(f.setContentType(this.contentType),"Styling content type: "+this.contentType.id?this.contentType.id:this.contentType):f.setContentType(this.contentType)}}else"undefined"!==
typeof console&&console.log(Error(h))},removeServiceListener:function(f){"function"===typeof f.removeEventListener?(f.removeEventListener("orion.edit.highlighter.styleReady",this.listener.onStyleReady),f=this.services.indexOf(f),-1!==f&&this.services.splice(f,1)):"undefined"!==typeof console&&console.log(Error(h))}};return k});
define("orion/highlight",["examples/editor/textStyler","orion/editor/textStyler","orion/editor/textMateStyler","orion/editor/AsyncStyler","orion/Deferred"],function(l,n,m,k,g){function h(a,e,b,f,h,s,u){function w(a,d){var f=a.getProperty("contentType")||a.getProperty("contentTypes"),h=a.getProperty("fileTypes");return f?g.when(e.isSomeExtensionOf(b,f)).then(function(b){return b?a:null}):d&&h&&-1!==h.indexOf(d)?(f=new g,f.resolve(a),f):null}function x(a){var b=null;switch(a&&a.id){case "application/javascript":case "application/json":b=
new l.TextStyler(f,"js",h);break;case "text/x-java-source":b=new l.TextStyler(f,"java",h);break;case "text/css":b=new l.TextStyler(f,"css",h)}return b}if(!d){var y=x(b);if(y)return s=new g,s.resolve(y),s}d&&!this.orionGrammars&&(this.orionGrammars={});y=s&&s.split(".").pop().toLowerCase();s=a.getServiceReferences("orion.edit.highlighter");for(var r=[],t=[],z=0;z<s.length;z++){var B=s[z],v=B.getProperty("type");"grammar"===v||!d&&"undefined"===typeof v?r.push(B.getProperty("grammar")):"highlighter"!==
v&&(v=B.getProperty("id"))&&!this.orionGrammars[v]&&(this.orionGrammars[v]={id:v,contentTypes:B.getProperty("contentTypes"),patterns:B.getProperty("patterns"),repository:B.getProperty("repository")});(B=w(B,y))&&t.push(B)}return g.all(t,function(a){return{_error:a}}).then(function(e){for(var g,l=e.length-1;0<=l;l--){var t=e[l];if(t&&!t._error&&(u||"highlighter"!==t.getProperty("type"))){g=t;break}}var s;if(g)if(e=g.getProperty("type"),"highlighter"===e)s=new k(f,a,h),s.setContentType(b);else if("grammar"===
e||!d&&"undefined"===typeof e)g=g.getProperty("grammar"),s=new m.TextMateStyler(f,g,r);else if(d){s=[];for(var z in this.orionGrammars)s.push(this.orionGrammars[z]);g=new n.createPatternBasedAdapter(s,g.getProperty("id"));s=new n.TextStyler(f,h,g)}return s})}function f(a,d){this.serviceRegistry=a;this.contentTypeService=d;this.styler=null}var d=1;f.prototype={setup:function(a,d,b,f,g){g="undefined"===typeof g?!0:g;this.styler&&(this.styler.destroy&&this.styler.destroy(),this.styler=null);var k=this;
return h(this.serviceRegistry,this.contentTypeService?this.contentTypeService:this.serviceRegistry.getService("orion.core.contentTypeRegistry"),a,d,b,f,g).then(function(a){return k.styler=a})},getStyler:function(){return this.styler}};return{createStyler:h,SyntaxHighlighter:f}});
define("orion/inputCompletion/inputCompletion",["orion/EventTarget"],function(l){function n(m,k,g){l.attach(this);this._binderFunc=k;this.setInputField(m);(m=g?g.group:null)||(m=this._inputField&&this._inputField.id?this._inputField.id:"default__input__group");this._completionIdPrefix=m+"__completion__";this._proposeFromStart=g?g.proposeFromStart:!1;this._extendedProvider=g?g.extendedProvider:null;this._serviceRegistry=g?g.serviceRegistry:null;this._onDelete=g?g.onDelete:null;this._deleteToolTips=
g?g.deleteToolTips:"";this._proposalIndex=-1;this._dismissed=!0;this._mouseDown=!1;this._dataList=[];this._initUI();this._listeners=[];g=function(g){this._binderFunc&&this._binderFunc(function(f){this._bind(f);g.deleting&&(this._proposeOn(this._inputField.value),this._selectProposal(this._proposalIndex,!0))}.bind(this))}.bind(this);this.addEventListener("inputDataListChanged",g);this._listeners.push({evtTarget:this,type:"inputDataListChanged",handler:g});g=function(g){this._mouseDown=!0}.bind(this);
this._completionUIContainer.addEventListener("mousedown",g);this._listeners.push({evtTarget:this._completionUIContainer,type:"mousedown",handler:g});g=function(g){this._mouseDown=!1}.bind(this);this._completionUIContainer.addEventListener("mouseup",g);this._listeners.push({evtTarget:this._completionUIContainer,type:"mouseup",handler:g})}n.prototype._removeListeners=function(l){l&&l.forEach(function(k){k.evtTarget.removeEventListener(k.type,k.handler,!1)})};n.prototype.destroy=function(){this._removeListeners(this._inputFieldListeners);
this._removeListeners(this.listeners)};n.prototype.hasValueOf=function(l){return this._dataList.some(function(k){return k.value===l})};n.prototype.setInputField=function(l){this._inputField&&this._inputFieldListeners&&this._removeListeners(this._inputFieldListeners);this._inputFieldListeners=[];this._inputField=l;"string"===typeof this._inputField&&(this._inputField=document.getElementById(this._inputField));l=function(k){this._mouseDown?window.setTimeout(function(){this._inputField.focus()}.bind(this),
200):document.activeElement!==this._inputField&&this._dismiss()}.bind(this);this._inputField.addEventListener("blur",l);this._inputFieldListeners.push({evtTarget:this._inputField,type:"blur",handler:l});l=function(k){this.onKeyDown(k)}.bind(this);this._inputField.addEventListener("keydown",l);this._inputFieldListeners.push({evtTarget:this._inputField,type:"keydown",handler:l});l=function(k){this._proposeOn(this._inputField.value)}.bind(this);this._inputField.addEventListener("input",l);this._inputFieldListeners.push({evtTarget:this._inputField,
type:"input",handler:l});l=function(k){this._dismissed&&this._binderFunc&&(this._dismissing?this._dismissing=!1:this._binderFunc&&this._binderFunc(function(g){this._bind(g)}.bind(this)))}.bind(this);this._inputField.addEventListener("focus",l);this._inputFieldListeners.push({evtTarget:this._inputField,type:"focus",handler:l})};n.prototype.onKeyDown=function(l){if(this._dismissed)return!0;var k=l.charCode||l.keyCode;if(13===k){if(this._proposalList&&0<this._proposalList.length&&0<=this._proposalIndex&&
this._proposalIndex<this._proposalList.length)return l.preventDefault(),this._dismiss(this._proposalList[this._proposalIndex].item.value,l.ctrlKey),l.stopPropagation(),!1}else{if((40===k||38===k)&&this._proposalList&&0<this._proposalList.length)return l.preventDefault(),this._walk(40===k),l.stopPropagation(),!1;if(27===k)return l.preventDefault(),this._dismiss(),!1;if(46===k&&-1<this._proposalIndex&&this._onDelete)return l.preventDefault(),this._onDelete(this._proposalList[this._proposalIndex].item.value,
this),this._resetIndexAfterDeletion(),l.stopPropagation(),!1}return!0};n.prototype._resetIndexAfterDeletion=function(){1>=this._proposalList.length?this._proposalIndex=-1:this._proposalIndex===this._proposalList.length-1&&(this._proposalIndex=this._proposalList.length-2)};n.prototype._bind=function(l){this._dataList=l};n.prototype._getUIContainerID=function(){return this._completionIdPrefix+"UIContainer"};n.prototype._getUIProposalListId=function(){return this._completionIdPrefix+"UIProposalList"};
n.prototype._initUI=function(){this._completionUIContainer=document.getElementById(this._getUIContainerID());this._completionUIContainer||(this._completionUIContainer=document.createElement("div"),this._completionUIContainer.id=this._getUIContainerID(),this._completionUIContainer.style.display="none",this._completionUIContainer.className="inputCompletionContainer",this._completionUIContainer.setAttribute("role","list"),this._completionUIContainer.setAttribute("aria-atomic","true"),this._completionUIContainer.setAttribute("aria-live",
"assertive"),document.body.appendChild(this._completionUIContainer));this._completionUIContainer.textContent="";this._completionUL=document.getElementById(this._getUIProposalListId());this._completionUL||(this._completionUL=document.createElement("ul"),this._completionUL.id=this._getUIProposalListId(),this._completionUL.className="inputCompletionUL");this._completionUL.textContent="";this._completionUIContainer.appendChild(this._completionUL)};n.prototype._createProposalLink=function(l,k,g,h){var f=
document.createElement("a");f.href=require.toUrl(k);f.appendChild(this._createBoldText(l,g,h));return f};n.prototype._createBoldText=function(l,k,g,h){if(0>k)return document.createTextNode(l);h=h?h:document.createElement("span");var f;0!==k&&(f=document.createTextNode(l.substring(0,k)),h.appendChild(f));var d=document.createElement("b");h.appendChild(d);f=document.createTextNode(l.substring(k,k+g));d.appendChild(f);k+g<l.length&&(f=document.createTextNode(l.substring(k+g)),h.appendChild(f));return h};
n.prototype._proposeOnCategory=function(l,k){if(0!==k.length){var g;if(l){g=document.createElement("li");g.className="inputCompletionLICategory";var h=document.createTextNode(l);g.appendChild(h);this._completionUL.appendChild(g)}k.forEach(function(f){g=document.createElement("li");g.onmouseover=function(a){this._selectProposal(a.currentTarget)}.bind(this);g.onclick=function(a){this._dismiss(a.currentTarget.completionItem.value)}.bind(this);g.className="inputCompletionLINormal";g.completionItem=f.item;
var d;if("string"===typeof f.item.value){var a=document.createElement("table");a.style.width="100%";a.style.tableLayout="fixed";a.style.borderSpacing="0";var e=document.createElement("tr");e.style.width=this._inputField.offsetWidth+"px";a.appendChild(e);var b=document.createElement("td");b.classList.add("inputCompletionLILeftTD");var h=this._createBoldText(f.item.value,f.boldIndex,f.boldLength);b.appendChild(h);b.style.overflow="hidden";e.appendChild(b);this._onDelete&&(d=document.createElement("button"),
d.classList.add("inputCompletionDismissButton"),d.classList.add("layoutRight"),d.classList.add("core-sprite-close"),d.classList.add("imageSprite"),d.style.display="none",d.style.margin="0 0 0",d.title=this._deleteToolTips,d.onclick=function(a){a.stopPropagation();this._onDelete(f.item.value,this);this._resetIndexAfterDeletion()}.bind(this),b=document.createElement("td"),b.classList.add("inputCompletionLIRightTD"),b.appendChild(d),e.appendChild(b));g.appendChild(a)}else f.item.value.name&&"link"===
f.item.value.type&&g.appendChild(this._createProposalLink(f.item.value.name,f.item.value.value,f.boldIndex,f.boldLength));this._completionUL.appendChild(g);this._proposalList.push({item:f.item,domNode:g,deleteBtn:d})}.bind(this))}};n.prototype._domNode2Index=function(l){if(this._proposalList)for(var k=0;k<this._proposalList.length;k++)if(this._proposalList[k].domNode===l)return k;return-1};n.prototype._highlight=function(l,k){var g=l,h,f=!1;isNaN(g)||(f=!0,this._proposalList&&0<=l&&l<this._proposalList.length?
(g=this._proposalList[l].domNode,h=this._proposalList[l].deleteBtn):g=null);g&&(g.className=k?"inputCompletionLISelected":"inputCompletionLINormal",h&&(h.style.display=k?"":"none"),k&&f&&(g.offsetTop<this._completionUIContainer.scrollTop?g.scrollIntoView(!0):g.offsetTop+g.offsetHeight>this._completionUIContainer.scrollTop+this._completionUIContainer.clientHeight&&g.scrollIntoView(!1)))};n.prototype._selectProposal=function(l,k){var g=l;isNaN(g)&&(g=this._domNode2Index(l));if(g!==this._proposalIndex||
k)this._highlight(this._proposalIndex,!1),this._proposalIndex=g,this._highlight(this._proposalIndex,!0)};n.prototype._dismiss=function(l,k){this._mouseDown||(this._dismissed=!0,this._proposalList=null,this._proposalIndex=-1,"string"===typeof l?(this._inputField.value=l,this._dismissing=!0,this._inputField.focus()):l&&(l.name&&"link"===l.type)&&(k?window.open(l.value):window.location.href=l.value),this._completionUIContainer.style.display="none")};n.prototype._show=function(){if(this._proposalList&&
0<this._proposalList.length){for(var l=0,k=0,g=this._inputField;g;)l+=g.offsetLeft,k+=g.offsetTop,g=g.offsetParent;this._completionUIContainer.style.display="block";this._completionUIContainer.style.top=k+this._inputField.offsetHeight+2+"px";this._completionUIContainer.style.left=l+"px";this._completionUIContainer.style.width=this._inputField.offsetWidth+"px";this._dismissed=this._mouseDown=!1}else this._dismissed=!0,this._proposalList=null,this._proposalIndex=-1,this._completionUIContainer.style.display=
"none"};n.prototype._walk=function(l){l=this._proposalIndex+(l?1:-1);-1>l?l=this._proposalList.length-1:l>=this._proposalList.length&&(l=-1);this._selectProposal(l)};n.prototype._proposeOnList=function(l,k,g){var h="",f=[],d=k?k.length:0;l.forEach(function(a){if("category"===a.type)this._proposeOnCategory(h,f),h=a.label,f=[];else{var e=!0,b=-1;if(k&&g){var l;"string"===typeof a.value?l=a.value.toLowerCase():a.value.name&&(l=a.value.name.toLowerCase());b=l.indexOf(k);0>b?e=!1:this._proposeFromStart&&
(e=0===b)}e&&f.push({item:a,boldIndex:b,boldLength:d})}}.bind(this));this._proposeOnCategory(h,f)};n.prototype._proposeOn=function(l){this._completionUL.textContent="";var k=l?l.toLowerCase():null;this._proposalList=[];this._proposeOnList(this._dataList,k,!0);this._extendedProvider&&k?this._extendedProvider(l,function(g){g&&g.forEach(function(g){this._proposeOnList(g.proposals,g.filterForMe?k:l,g.filterForMe)}.bind(this));this._show()}.bind(this),[]):this._show()};n.prototype.constructor=n;return{InputCompletion:n}});
define("orion/searchAndReplace/textSearcher","i18n!orion/search/nls/messages orion/editor/find orion/commands orion/objects orion/searchUtils orion/inputCompletion/inputCompletion orion/webui/littlelib".split(" "),function(l,n,m,k,g,h,f){function d(a,d,b,f,g){n.Find.call(this,a,f,g);this._serviceRegistry=d;this._commandService=b}d.prototype=new n.Find;k.mixin(d.prototype,{getFindString:function(){var a=document.getElementById("localSearchFindWith");return!a?n.Find.prototype.getFindString.call(this):
a.value},getReplaceString:function(){var a=document.getElementById("localSearchReplaceWith");return!a?n.Find.prototype.getReplaceString(this):a.value},hide:function(){var a=this.isVisible();n.Find.prototype.hide.call(this);a&&this._commandService.closeParameterCollector()},show:function(a){n.Find.prototype.show.call(this,a);var d=a.findString;this._addRecentfind(d);a=a.replaceString;var b=document.getElementById("localSearchFindWith");b||(this._createActionTable(),b=document.getElementById("localSearchFindWith"));
d&&(b.value=d);a&&(document.getElementById("localSearchReplaceWith").value=a);window.setTimeout(function(){b.select();b.focus()},10)},_showReplaceInfo:function(){this._regex?(this._replaceInfo.src="data:image/gif;base64,R0lGODlhBwAIAMQAAMzX6cbT5kh4qFiIuKC40FCIuGSXwmWZw2SaxGacxmadxmWcxbPM4GigyJW92JzC26DI0P///////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAABIALAAAAAAHAAgAAAUmoEQUQkFI0PBEz5A2yII0w9AwkUPbRpTsjUNEQUsFIgCXiGSShAAAOw\x3d\x3d",this._replaceInfo.title=l["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 \x3ctd([\\s\\S]*?)\x3c/td\x3e with \x3cspan$1\x3c/span\x3e."]):
(this._replaceInfo.src="data:image/gif;base64,R0lGODlhBwAIAEAAACH5BAEAABIALAAAAAAHAAgAhwAAAAAAMwAAZgAAmQAAzAAA/wArAAArMwArZgArmQArzAAr/wBVAABVMwBVZgBVmQBVzABV/wCAAACAMwCAZgCAmQCAzACA/wCqAACqMwCqZgCqmQCqzACq/wDVAADVMwDVZgDVmQDVzADV/wD/AAD/MwD/ZgD/mQD/zAD//zMAADMAMzMAZjMAmTMAzDMA/zMrADMrMzMrZjMrmTMrzDMr/zNVADNVMzNVZjNVmTNVzDNV/zOAADOAMzOAZjOAmTOAzDOA/zOqADOqMzOqZjOqmTOqzDOq/zPVADPVMzPVZjPVmTPVzDPV/zP/ADP/MzP/ZjP/mTP/zDP//2YAAGYAM2YAZmYAmWYAzGYA/2YrAGYrM2YrZmYrmWYrzGYr/2ZVAGZVM2ZVZmZVmWZVzGZV/2aAAGaAM2aAZmaAmWaAzGaA/2aqAGaqM2aqZmaqmWaqzGaq/2bVAGbVM2bVZmbVmWbVzGbV/2b/AGb/M2b/Zmb/mWb/zGb//5kAAJkAM5kAZpkAmZkAzJkA/5krAJkrM5krZpkrmZkrzJkr/5lVAJlVM5lVZplVmZlVzJlV/5mAAJmAM5mAZpmAmZmAzJmA/5mqAJmqM5mqZpmqmZmqzJmq/5nVAJnVM5nVZpnVmZnVzJnV/5n/AJn/M5n/Zpn/mZn/zJn//8wAAMwAM8wAZswAmcwAzMwA/8wrAMwrM8wrZswrmcwrzMwr/8xVAMxVM8xVZsxVmcxVzMxV/8yAAMyAM8yAZsyAmcyAzMyA/8yqAMyqM8yqZsyqmcyqzMyq/8zVAMzVM8zVZszVmczVzMzV/8z/AMz/M8z/Zsz/mcz/zMz///8AAP8AM/8AZv8Amf8AzP8A//8rAP8rM/8rZv8rmf8rzP8r//9VAP9VM/9VZv9Vmf9VzP9V//+AAP+AM/+AZv+Amf+AzP+A//+qAP+qM/+qZv+qmf+qzP+q///VAP/VM//VZv/Vmf/VzP/V////AP//M///Zv//mf//zP///wAAAAAAAAAAAAAAAAgsAPcpQzMJjbJ9xNAQQ6hwUqaHDws+3PeQoMN9DiUuzFRQ2ZiDyyYdHFhwYUAAOw\x3d\x3d",
this._replaceInfo.title=l["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 \x3ctd([\\s\\S]*?)\x3c/td\x3e with \x3cspan$1\x3c/span\x3e."]);this._replaceInfo.style.display=""},_createActionTable:function(){var a=this;this._commandService.openParameterCollector("pageNavigationActions",function(d){var b=document.createElement("input");b.type="text";b.name=l["Find:"];b.className="parameterInput";b.id="localSearchFindWith";
b.placeholder=l["Find With"];b.oninput=function(b){return a._handleInput(b)};b.onkeydown=function(b){return a._handleKeyDown(b)};d.appendChild(b);a._initCompletion(b);a._createButton(l.Next,d,function(){a._addRecentfind(a.getFindString());a.find(!0)});a._createButton(l.Previous,d,function(){a._addRecentfind(a.getFindString());a.find(!1)});var f=a._editor.getTextView().getOptions("readonly");if(!f){var g=document.createElement("input");g.type="text";g.name=l["ReplaceWith:"];g.className="parameterInput";
g.id="localSearchReplaceWith";g.placeholder=l["Replace With"];g.onkeydown=function(b){return a._handleKeyDown(b)};d.appendChild(g);a._replaceInfo=a._createInfoImage(null,d,null);a._showReplaceInfo();a._createButton(l.Replace,d,function(){a.replace()});a._createButton(l["Replace All"],d,function(){a.replaceAll()})}g=document.createElement("div");d.appendChild(g);g.classList.add("findOptionsDiv");var h=m.createDropdownMenu(g,l.Options,null,"dismissButton",null,!0);h.menuButton.classList.add("parameterInlineButton");
m.createCheckedMenuItem(h.menu,l["Show all"],a._showAll,function(b){a.setOptions({showAll:b.target.checked});h.dropdown.close(!0)});m.createCheckedMenuItem(h.menu,l["Case sensitive"],!a._caseInsensitive,function(b){a.setOptions({caseInsensitive:!b.target.checked});h.dropdown.close(!0);a.find(!0)});m.createCheckedMenuItem(h.menu,l["Wrap search"],a._wrap,function(b){a.setOptions({wrap:b.target.checked});h.dropdown.close(!0)});m.createCheckedMenuItem(h.menu,l["Incremental search"],a._incremental,function(b){a.setOptions({incremental:b.target.checked});
h.dropdown.close(!0)});m.createCheckedMenuItem(h.menu,l["Whole Word"],a._wholeWord,function(b){a.setOptions({wholeWord:b.target.checked});h.dropdown.close(!0);a.find(!0)});a._regExBox=m.createCheckedMenuItem(h.menu,l["Regular expression"],a._regex,function(b){a.setOptions({regex:b.target.checked});h.dropdown.close(!0);a.find(!0);a._showReplaceInfo()});f||m.createCheckedMenuItem(h.menu,l["Find after replace"],a._findAfterReplace,function(b){a.setOptions({findAfterReplace:b.target.checked});h.dropdown.close(!0)});
return b},function(){a.hide()})},_storeRecentFind:function(a,d,b){this._serviceRegistry.getService("orion.core.preference").getPreferences("/window/favorites").then(function(f){f.put("recentFind",a);d&&window.setTimeout(function(){d.dispatchEvent({type:"inputDataListChanged",deleting:b})}.bind(this),20)})},_addRecentfind:function(a){"string"===typeof a&&a&&(!this._completion||!this._completion.hasValueOf(a))&&this._serviceRegistry.getService("orion.core.preference").getPreferences("/window/favorites").then(function(d){var b;
d=d.get("recentFind");"string"===typeof d&&(d=JSON.parse(d));if(d){for(b in d)if(d[b].name===a)return;30<=d.length&&d.splice(29,d.length-30+1)}else d=[];d.splice(0,0,{name:a});this._storeRecentFind(d,this._completion)}.bind(this))},_removeRecentSearch:function(a,d){"string"===typeof a&&a&&this._serviceRegistry.getService("orion.core.preference").getPreferences("/window/favorites").then(function(b){var f;b=b.get("recentFind");"string"===typeof b&&(b=JSON.parse(b));if(b)for(f in b)if(b[f].name===a){b.splice(f,
1);this._storeRecentFind(b,d,!0);break}}.bind(this))},_initCompletion:function(a){if(this._completion)this._completion.setInputField(a);else{var d=function(a){this._serviceRegistry.getService("orion.core.preference").getPreferences("/window/favorites").then(function(d){d=d.get("recentFind");"string"===typeof d&&(d=JSON.parse(d));if(d){var e=[];d.forEach(function(a){e.push({type:"proposal",label:a.name,value:a.name})});a(e)}})}.bind(this);this._completion=new h.InputCompletion(a,d,{serviceRegistry:this._serviceRegistry,
group:"localSearch",onDelete:function(a,d){this._removeRecentSearch(a,d)}.bind(this),deleteToolTips:l["Click or use delete key to delete the search term"]})}},_createButton:function(a,d,b){var g=document.createElement("button");g.addEventListener("click",b.bind(this),!1);var h=this;g.addEventListener("keydown",function(a){a.keyCode===f.KEY.ESCAPE&&h.hide()});g.appendChild(document.createTextNode(a));g.className="dismissButton parameterInlineButton";d.appendChild(g)},_createInfoImage:function(a,d,
b){a=document.createElement("img");a.classList.add("replaceInfo");a.addEventListener("click",function(a){this._regExBox.checked=!this._regex;this.setOptions({regex:!this._regex});this.find(!0);this._showReplaceInfo()}.bind(this));d.appendChild(a);return a},_handleInput:function(a){this._incremental&&this.find(!0,null,!0);return!0},_handleKeyDown:function(a){var d=(this.isMac?a.metaKey:a.ctrlKey)&&!a.altKey&&!a.shiftKey;return d&&70===a.keyCode?(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=
!0,!1):(this.isMac?a.metaKey:a.ctrlKey)&&!a.altKey&&75===a.keyCode||13===a.keyCode?(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0,this._addRecentfind(this.getFindString()),13===a.keyCode?this.find(this._reverse?a.shiftKey:!a.shiftKey):this.find(!a.shiftKey),!1):d&&82===a.keyCode?(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0,this.replace(),!1):27===a.keyCode?(this.hide(),!1):!0}});return{TextSearcher:d}});
define("orion/edit/editorContext",[],function(){return{getEditorContext:function(l){var n=Object.create(null);l.getServiceReferences("orion.edit.context").forEach(function(m){var k=l.getService(m);Object.keys(k).forEach(function(g){"function"===typeof k[g]&&(n[g]=k[g].bind(k))})});return n},getOptions:function(l){var n=Object.create(null);l.getServiceReferences("orion.edit.context").forEach(function(l){l.getPropertyKeys().forEach(function(k){"service.id"!==k&&("service.names"!==k&&"objectClass"!==
k)&&(n[k]=l.getProperty(k))})});return n}}});
define("orion/blamer",["orion/extensionCommands","orion/PageLinks","orion/URITemplate","orion/edit/editorContext"],function(l,n,m,k){function g(g,f){for(var d=f.getFileMetadata(),a=g.getServiceReferences("orion.edit.blamer"),e=0;e<a.length;e++){var b=a[e],k={};k.validationProperties=b.getProperty("validationProperties");k.forceSingleItem=!0;k=l._makeValidator(k,g);if(k.validationFunction.bind(k)(d))return g.getService(b)}return null}return{isVisible:function(h,f){return!!g(h,f)&&!!h.getService("orion.core.blame")},
getBlame:function(h,f){var d=g(h,f);if(d){var a=function(a){for(var d=n.getOrionHome(),e=0;e<a.length;e++){var f=a[e],g=new m(f.CommitLink),k={};k.OrionHome=d;f.CommitLink=g.expand(k)}h.getService("orion.core.blame")._setAnnotations(a)};if(d.computeBlame){var e={metadata:f.getFileMetadata()};d.computeBlame(k.getEditorContext(h),e).then(a)}else d.doBlame(f.getInput()).then(a)}}}});
define("orion/editorCommands","i18n!orion/edit/nls/messages orion/i18nUtil orion/webui/littlelib orion/webui/dialogs/OpenResourceDialog orion/widgets/input/DropDownMenu orion/Deferred orion/URITemplate orion/commands orion/keyBinding orion/commandRegistry orion/extensionCommands orion/contentTypes orion/searchUtils orion/PageUtil orion/PageLinks orion/editor/annotations orion/blamer orion/regex orion/util orion/edit/editorContext".split(" "),function(l,n,m,k,g,h,f,d,a,e,b,p,q,s,u,w,x,y,r,t){function z(a){var b=
new f(a.uriTemplate),d=a.params||{};d.OrionHome=d.OrionHome||u.getOrionHome();var b=b.expand(d),e=document.createElement("div"),g=document.createElement("iframe");g.id=a.id;g.name=a.id;g.type="text/html";g.sandbox="allow-scripts allow-same-origin";g.frameborder=void 0!==a.border?a.border:1;g.src=b;g.className="delegatedUI";a.width&&(e.style.width=a.width,g.style.width=a.width);a.height&&(e.style.height=a.height,g.style.height=a.height);g.style.visibility="hidden";null!==a.parent&&(a.parent||window.document.body).appendChild(e);
e.appendChild(g);g.style.left=a.left||(window.innerWidth-parseInt(g.clientWidth,10))/2+"px";g.style.top=a.top||(window.innerHeight-parseInt(g.clientHeight,10))/2+"px";g.style.visibility="";window.addEventListener("message",function G(b){if(b.source===g.contentWindow&&"string"===typeof b.data&&(b=JSON.parse(b.data),"orion.page.delegatedUI"===b.pageService&&b.source===a.id)){if(b.cancelled)a.cancelled&&a.cancelled();else if(b.result)a.done&&a.done(b.result);else if(b.Status||b.status)a.status&&a.status(b.Status||
b.status);window.removeEventListener("message",G,!1);e.parentNode&&e.parentNode.removeChild(e)}},!1);return e}function B(a){this.serviceRegistry=a.serviceRegistry;this.commandService=a.commandRegistry;this.fileClient=a.fileClient;this.inputManager=a.inputManager;this.toolbarId=a.toolbarId;this.saveToolbarId=a.saveToolbarId;this.editToolbarId=a.editToolbarId;this.pageNavId=a.navToolbarId;this.isReadOnly=a.readonly;this._localSearcher=a.textSearcher;this._searcher=a.searcher;this.editorSettings=a.editorSettings;
this.localSettings=a.localSettings}var v={},A=null;v.createDelegatedUI=z;B.prototype={generateSimpleEditorCommands:function(a,b){this.isReadOnly||(this._generateUndoStackCommands(a),this._generateSaveCommand(a,b));this._generateSearchFilesCommand(a);this._generateGotoLineCommnand(a);this._generateFindCommnand(a)},generateEditorCommands:function(a){this.generateBaseEditorCommands(a);this.generateExtraEditorCommands(a)},generateBaseEditorCommands:function(a){this.isReadOnly||(this._generateUndoStackCommands(a),
this._generateSaveCommand(a),this._generateEditCommands(a))},generateExtraEditorCommands:function(a){this._generateSettingsCommand(a);this._generateSearchFilesCommand(a);this._generateGotoLineCommnand(a);this._generateFindCommnand(a);this._generateBlame(a)},_generateSettingsCommand:function(b){var e=this,f=new d.Command({imageClass:"core-sprite-wrench",tooltip:l.LocalEditorSettings,id:"orion.edit.settings",visibleWhen:function(){return b.installed},callback:function(a){var d=f.settingsDropDown;if(!d||
d.isDestroyed())d=f.settingsDropDown=new g(a.domNode.parentNode,a.domNode,{noClick:!0,selectionClass:"dropdownSelection",onShow:function(){d.focus()},onHide:function(){b.focus()}}),d.updateContent=e.localSettings.show.bind(e.localSettings),a=d.getContentNode(),a.tabIndex=a.style.marginTop=0;d.click()}});this.commandService.addCommand(f);this.commandService.registerCommandContribution("settingsActions","orion.edit.settings",1,null,!1,new a.KeyBinding("s",!0,!0))},_generateUndoStackCommands:function(b){var e=
new d.Command({name:l.Undo,id:"orion.undo",visibleWhen:function(){return b.installed},callback:function(a){b.getUndoStack().undo()}});this.commandService.addCommand(e);this.commandService.registerCommandContribution(this.editToolbarId||this.toolbarId,"orion.undo",400,this.editToolbarId?"orion.menuBarEditGroup/orion.undoGroup":null,!this.editToolbarId,new a.KeyBinding("z",!0));e=new d.Command({name:l.Redo,id:"orion.redo",visibleWhen:function(){return b.installed},callback:function(a){b.getUndoStack().redo()}});
this.commandService.addCommand(e);this.commandService.registerCommandContribution(this.editToolbarId||this.toolbarId,"orion.redo",401,this.editToolbarId?"orion.menuBarEditGroup/orion.undoGroup":null,!this.editToolbarId,r.isMac?new a.KeyBinding("z",!0,!0):new a.KeyBinding("y",!0))},_generateSearchFilesCommand:function(b){var e=this;if(e._searcher){var f=!1,g=new d.Command({name:l.searchFiles,tooltip:l.searchFiles,id:"orion.searchFiles",visibleWhen:function(){return b.installed},callback:function(a){if(!f){a=
b.getSelection();a=b.getText(a.start,a.end);var d=e.serviceRegistry.getService("orion.page.progress"),g=new k.OpenResourceDialog({searcher:e._searcher,progress:d,searchRenderer:e._searcher.defaultRenderer,nameSearch:!1,title:l.searchFiles,message:l.searchTerm,initialText:a,onHide:function(){f=!1;b.focus()}});window.setTimeout(function(){f=!0;g.show(m.node(e.toolbarId))},0)}}});this.commandService.addCommand(g);this.commandService.registerCommandContribution(this.editToolbarId||this.pageNavId,"orion.searchFiles",
1,this.editToolbarId?"orion.menuBarEditGroup/orion.findGroup":null,!this.editToolbarId,new a.KeyBinding("h",!0))}},_generateSaveCommand:function(b,e){var f=this,g=e?e:"orion.save",h=new d.Command({name:l.Save,tooltip:l.saveFile,id:g,visibleWhen:function(){return!b.installed||f.inputManager.getReadOnly()?!1:!0},callback:function(a){f.inputManager.save();return!0}});this.commandService.addCommand(h);this.commandService.registerCommandContribution(this.saveToolbarId||this.toolbarId,g,1,this.saveToolbarId?
"orion.menuBarFileGroup/orion.saveGroup":null,!1,new a.KeyBinding("s",!0));b.getTextView&&b.getTextView()&&(b.getTextView().setKeyBinding(new a.KeyBinding("s",!0),"save"),b.getTextView().setAction("save",h.callback,h))},_generateGotoLineCommnand:function(b){var f=this,g=new e.ParametersDescription([new e.CommandParameter("line","number","Line:")],{hasOptionalParameters:!1},function(){var a=b.getModel().getLineAtOffset(b.getCaretOffset())+1;return[new e.CommandParameter("line","number","Line:",a.toString())]}),
g=new d.Command({name:l.gotoLine,tooltip:l.gotoLineTooltip,id:"orion.gotoLine",visibleWhen:function(){return b.installed},parameters:g,callback:function(a){var d=b.getModel();a.parameters&&a.parameters.valueFor("line")?a=a.parameters.valueFor("line"):(a=d.getLineAtOffset(b.getCaretOffset()),(a=prompt(l.gotoLinePrompt,a+1))&&(a=parseInt(a,10)));if(a)b.onGotoLine(a-1,0)}});this.commandService.addCommand(g);this.commandService.registerCommandContribution(this.editToolbarId||this.pageNavId,"orion.gotoLine",
3,this.editToolbarId?"orion.menuBarEditGroup/orion.findGroup":null,!this.editToolbarId,new a.KeyBinding("l",!r.isMac,!1,!1,r.isMac),new e.URLBinding("gotoLine","line"));b.getTextView&&b.getTextView()&&b.getTextView().setAction("gotoLine",function(a){if(a)return b.onGotoLine(a.line-1,0,void 0,a.callback),!0;f.commandService.runCommand("orion.gotoLine");return!0},g)},_generateFindCommnand:function(b){var f=this,g=new e.ParametersDescription([new e.CommandParameter("find","text","Find:")],{clientCollect:!0},
function(){var a=b.getSelection(),d="";a.end>a.start&&(d=b.getModel().getText(a.start,a.end),f._localSearcher&&f._localSearcher.getOptions().regex&&(d=y.escape(d)));return[new e.CommandParameter("find","text","Find:",d)]}),g=new d.Command({name:l.Find,tooltip:l.Find,id:"orion.editor.find",visibleWhen:function(){return b.installed},parameters:g,callback:function(a){if(f._localSearcher){var d="",e=null,g=b.getSelection();g.end>g.start&&a.parameters.valueFor("useEditorSelection")?(d=b.getModel().getText(g.start,
g.end),f._localSearcher.getOptions().regex&&(d=y.escape(d))):a.parameters&&a.parameters.valueFor("find")&&(d=a.parameters.valueFor("find"),e=s.matchResourceParameters(),q.convertFindURLBinding(e));e?(f._localSearcher.setOptions({regex:e.regEx,caseInsensitive:!e.caseSensitive}),a={},e.atLine&&(a.start=b.getModel().getLineStart(e.atLine-1)),f._localSearcher.show({findString:d,replaceString:e.replaceWith}),f._localSearcher.find(!0,a)):f._localSearcher.show({findString:d});return!0}return!1}});this.commandService.addCommand(g);
this.commandService.registerCommandContribution(this.editToolbarId||this.pageNavId,"orion.editor.find",0,this.editToolbarId?"orion.menuBarEditGroup/orion.findGroup":null,!this.editToolbarId,new a.KeyBinding("f",!0),new e.URLBinding("find","find"));b.getTextView&&b.getTextView()&&b.getTextView().setAction("find",function(a){if(a)return f._localSearcher.show(a),!0;f.commandService.runCommand("orion.editor.find",null,null,new e.ParametersDescription([new e.CommandParameter("useEditorSelection","text",
"","true")],{clientCollect:!0}));return!0},g)},_generateBlame:function(b){var f=this,g=new d.Command({name:l.Blame,tooltip:l.BlameTooltip,id:"orion.edit.blame",parameters:new e.ParametersDescription([new e.CommandParameter("blame","boolean")],{clientCollect:!0}),visibleWhen:function(){return!b.installed?!1:x.isVisible(f.serviceRegistry,f.inputManager)},callback:function(a){for(var d=!1,e=b.getAnnotationModel().getAnnotations();e.hasNext();)if(e.next().type===w.AnnotationType.ANNOTATION_BLAME){d=!0;
break}d=!d;a.parameters&&a.parameters.valueFor("blame")&&(d="true"===a.parameters.valueFor("blame"));d?x.getBlame(f.serviceRegistry,f.inputManager):b.showBlame([])}});this.commandService.addCommand(g);this.commandService.registerCommandContribution(this.toolbarId,"orion.edit.blame",1,"orion.menuBarToolsGroup",!1,new a.KeyBinding("b",!0,!0),new e.URLBinding("blame","blame"))},_generateEditCommands:function(e){function f(b){if(!b)return null;var d=new a.KeyBinding;a.KeyBinding.apply(d,b);return d}function g(a,
b){!b&&(a&&"undefined"!==typeof a.HTML)&&delete a.HTML;var d=k.serviceRegistry.getService("orion.page.message");d?d.setProgressResult(a):window.console.log(a)}var k=this,s=this.toolbarId,q=this.serviceRegistry,v=q.getServiceReferences("orion.edit.command"),u=this.inputManager,r=q.getService("orion.page.progress"),B=function(a,b,f){var h=f.visibleWhen;f.visibleWhen=function(a){return!e.installed||k.inputManager.getReadOnly()?!1:!h||h(a)};f.callback=function(d){e=this;var f=e.getSelection?e.getSelection():
{start:0,end:0};d=e.getModel();var h=function(a){"object"===typeof a&&a?(a.text&&e.setText(a.text),a.selection&&(e.setSelection&&e.setSelection(a.selection.start,a.selection.end,!0),e.focus())):"string"===typeof a&&(e.setText(a,f.start,f.end,!0),e.setSelection&&e.setSelection(f.start,f.start+a.length),e.focus())},k;b.execute?(d={contentType:u.getContentType(),input:u.getInput()},k=t.getEditorContext(q),k.openDelegatedUI=z,k.setStatus=g,d=b.execute(k,d),k=null):(d=b.run(d.getText(f.start,f.end),d.getText(),
f,u.getInput()),k=function(b){if(b&&b.uriTemplate){var d={};d.uriTemplate=b.uriTemplate;d.params=u.getFileMetadata();d.id=a.id;d.width=b.width;d.height=b.height;d.done=h;d.status=g;z(d)}else b&&(b.Status||b.status)?g(b.Status||b.status):h(b)});r.showWhile(d,n.formatMessage(l.running,a.name)).then(k);return!0};f.callback=f.callback.bind(e);return new d.Command(f)};h.when(function(a){if(A)return A;var b=a.getService("orion.core.contentTypeRegistry");b||(b=new p.ContentTypeRegistry(a),b=a.getService("orion.core.contentTypeRegistry"));
return b.getContentTypes().then(function(a){return A=a})}(this.serviceRegistry),function(){var a=[],d=100;v.forEach(function(g){var h=g.getProperty("editor");if(!h||!(e.id&&h!==e.id)){for(var l=k.serviceRegistry.getService(g),p={},h=g.getPropertyKeys(),m=0;m<h.length;m++)p[h[m]]=g.getProperty(h[m]);p.forceSingleItem=!0;g=b._createCommandOptions(p,g,k.serviceRegistry,A,!1,function(a){return u.getFileMetadata()});a.push(g);g.then(function(a){a=B(p,l,a);k.commandService.addCommand(a);k.commandService.registerCommandContribution(k.toolbarId,
a.id,d,"orion.menuBarToolsGroup",p.bindingOnly,f(p.key))});d++}});h.all(a,function(a){return{_error:a}}).then(function(a){if(a=u.getFileMetadata()){var b=m.node(s);b&&(k.commandService.destroy(b),k.commandService.renderCommands(b.id,b,a,e,"button"));if(b=m.node("pageNavigationActions"))k.commandService.destroy(b),k.commandService.renderCommands(b.id,b,e,e,"button")}})})}};v.EditorCommandFactory=B;return v});
define("orion/inputManager","i18n!orion/edit/nls/messages orion/explorers/navigatorRenderer orion/i18nUtil orion/Deferred orion/EventTarget orion/objects orion/PageUtil".split(" "),function(l,n,m,k,g,h,f){function d(a){this._document=a.document||document;this._timeout=a.timeout;a=["keypress","keydown","keyup"];for(var d=function(a){this._resetTimer()}.bind(this),e=0;e<a.length;e++)this._document.addEventListener(a[e],d,!0);g.attach(this)}function a(a,d){if(a){if(!d.Severity){var e=d,f={Severity:"Error",
Message:l.noResponse};if("Cancel"===e.name)d={Severity:"Warning",Message:e.name,Cancel:!0};else{if(0===e.status)f.Cancel=!0;else if(e.responseText){e=e.responseText;try{var g=JSON.parse(e);f.Severity=g.Severity||f.Severity;f.Message=g.Message||f.Message}catch(h){f.Message=e}}else try{f.Message=JSON.stringify(e)}catch(k){}d=f}}a.setProgressResult(d)}else window.console.log(d)}function e(a){g.attach(this);this.serviceRegistry=a.serviceRegistry;this.statusService=a.statusService;this.fileClient=a.fileClient;
this.progressService=a.progressService;this.contentTypeRegistry=a.contentTypeRegistry;this.selection=a.selection;this._input=this._title="";this.dispatcher=null;this._unsavedChanges=[]}d.prototype={_resetTimer:function(){var a=this._document.defaultView||this._document.parentWindow;this._timer&&(a.clearTimeout(this._timer),this._timer=null);-1!==this._timeout&&(this._timer=a.setTimeout(function(){this.onIdle({type:"Idle"});this._timer=null;this._resetTimer()}.bind(this),this._timeout))},onIdle:function(a){return this.dispatchEvent(a)},
setTimeout:function(a){this._timeout=a;this._resetTimer()}};h.mixin(e.prototype,{_maybeLoadWorkspace:function(a){var d=this.fileClient;return a===d.fileServiceRootURL(a)?d.loadWorkspace(a).then(function(a){return a.Location}):(new k).resolve(a)},_read:function(a){var d=this.cachedMetadata||n.getClickedItem();if(d&&d.Location===a&&d.Parents&&d.Attributes&&d.ETag)return(new k).resolve(d);var e=this.fileClient,f=Array.prototype.slice.call(arguments,1);return this._maybeLoadWorkspace(a).then(function(a){return e.read.apply(e,
[a].concat(f))})},load:function(){var b=this.getInput();if(b){var d=this.fileClient,e=this._parsedLocation.resource,f=this.progressService,g=function(a,b,d){return!f?a:f.progress(a,m.formatMessage(b,d))},h=this.getEditor();if(this._fileMetadata)!this._saving&&(!this._fileMetadata.Directory&&!this._readonly)&&g(d.read(e,!0),l.ReadingMetadata,b).then(function(a){this._fileMetadata&&(this._fileMetadata.Location===a.Location&&this._fileMetadata.ETag!==a.ETag)&&(this._fileMetadata=a,(!h.isDirty()||window.confirm(l.loadOutOfSync))&&
g(d.read(e),l.Reading,b).then(function(a){h.setInput(b,null,a);this._unsavedChanges=[]}.bind(this)))}.bind(this));else{var n=e;if(0===n.indexOf("/gitapi/commit/")){var y=n.indexOf("/file"),r=n.indexOf("?",y);-1===r&&(r=n.length);n=n.substring(y,r);this._readonly=!0}var t=window.setTimeout(function(){t=null;this.reportStatus(m.formatMessage(l.Fetching,b))}.bind(this),800),z=function(){this.reportStatus("");t&&window.clearTimeout(t)}.bind(this),B=function(b){z();var d=null;this.serviceRegistry?d=this.serviceRegistry.getService("orion.page.message"):
this.statusService&&(d=this.statusService);a(d,b);this._setNoInput()}.bind(this);this._acceptPatch=null;g(this._read(n,!0),l.ReadingMetadata,n).then(function(a){a?a.Directory?k.when(a.Children||g(d.fetchChildren(a.ChildrenLocation),l.Reading,b),function(d){z();a.Children=d;this._setInputContents(this._parsedLocation,b,d,a)}.bind(this),B):this._isText(a)?g(d.read(e,!1,!0),l.Reading,b).then(function(d){z();"string"!==typeof d&&(this._acceptPatch=d.acceptPatch,d=d.result);this._setInputContents(this._parsedLocation,
b,d,a)}.bind(this),B):g(d._getService(e).readBlob(e),l.Reading,b).then(function(d){z();this._setInputContents(this._parsedLocation,b,d,a)}.bind(this),B):B({responseText:m.formatMessage(l.ReadingMetadataError,n)})}.bind(this),B)}}},processParameters:function(a){var d=this.getEditor();d&&d.processParameters&&d.processParameters(a)},getAutoLoadEnabled:function(){return this._autoLoadEnabled},getAutoSaveEnabled:function(){return this._autoSaveEnabled},getEditor:function(){return this.editor},getInput:function(){return this._input},
getTitle:function(){return this._title},getFileMetadata:function(){return this._fileMetadata},getReadOnly:function(){var a=this._fileMetadata;return this._readonly||!a||a.Attributes&&a.Attributes.ReadOnly},getContentType:function(){return this._contentType},onFocus:function(a){this._autoSaveEnabled&&this._errorSaving?this.save():this._autoLoadEnabled&&this.load()},onChanging:function(a){if(this._getSaveDiffsEnabled()){var d=this._unsavedChanges.length,e=a.removedCharCount,f=a.start,g=a.start+e,h=
0;0===a.addedCharCount?h=-1:0===e&&(h=1);if(0<d&&h===this.previousChangeType){d=this._unsavedChanges[d-1];if(0===e&&f===d.end+d.text.length){d.text+=a.text;return}if(0===a.addedCharCount&&g===d.start){d.start=f;return}}this.previousChangeType=h;this._unsavedChanges.push({start:f,end:g,text:a.text})}},reportStatus:function(a){this.statusReporter?this.statusReporter(a):this.editor&&this.editor.reportStatus(a)},save:function(){function b(a){g===A.getInput()&&(A.getFileMetadata().ETag=a.ETag,e.setInput(g,
null,h,!0));A.reportStatus("");f&&v&&v.setProgressResult({Message:l.Saved,Severity:"Normal"});A.afterSave&&A.afterSave();A._saving=!1}function d(b){A.reportStatus("");a(v,b);A._saving=!1;A._errorSaving=!0}if(!this._saving){var e=this.getEditor();if(e&&e.isDirty()&&!this.getReadOnly()){var f=this._errorSaving;this._saving=!0;var g=this.getInput();this.reportStatus(l["Saving..."]);this.dispatchEvent({type:"Saving",inputManager:this});e.markClean();var h=e.getText(),k=h;if(this._getSaveDiffsEnabled()&&
!this._errorSaving){for(var n=this._unsavedChanges,r=0,t=0;t<n.length;t++)r+=n[t].text.length;h.length>r&&(k={diff:n})}this._unsavedChanges=[];this._errorSaving=!1;var n={ETag:this.getFileMetadata().ETag},z=this._parsedLocation.resource,k=this.fileClient.write(z,k,n),B=this.progressService,v=null;this.serviceRegistry&&(v=this.serviceRegistry.getService("orion.page.message"));B&&(k=B.progress(k,m.formatMessage(l.savingFile,g)));var A=this;k.then(b,function(a){412===a.status?window.confirm(l.saveOutOfSync)?
(a=A.fileClient.write(z,h),B&&(a=B.progress(a,m.formatMessage(l.savingFile,g))),a.then(b,d)):A._saving=!1:d(a)})}}},setAutoLoadEnabled:function(a){this._autoLoadEnabled=a},setAutoSaveTimeout:function(a){this._autoSaveEnabled=-1!==a;this._idle?this._idle.setTimeout(a):(this._idle=new d({document:document,timeout:a}),this._idle.addEventListener("Idle",function(){this._errorSaving||this.save()}.bind(this)))},setContentType:function(a){this._contentType=a},setInput:function(a){if(!this._ignoreInput&&
(a||(a=f.hash()),"string"===typeof a)){var d=this.getEditor();a&&"#"!==a[0]&&(a="#"+a);var e=f.matchResourceParameters(a),g=this._parsedLocation||{};if(d&&d.isDirty()){var h=this._location;if(g.resource!==e.resource)if(this._autoSaveEnabled)this.save();else if(!window.confirm(l.confirmUnsavedChanges)){window.location.hash=h;return}}d=d&&g.editor!==e.editor;this._location=a;this._parsedLocation=e;this._ignoreInput=!0;this.selection&&this.selection.setSelections(a);this._ignoreInput=!1;(a=e.resource)?
a===this._input?d?(this.reportStatus(""),this._setInputContents(e,a,null,this._fileMetadata,this._isText(this._fileMetadata))):this.processParameters(e):(this._input=a,this._readonly=!1,this._fileMetadata=null,this.load()):this._setNoInput(!0)}},setTitle:function(a){var d=a.lastIndexOf("/");-1!==d&&(a=a.substring(d+1));this._title=a},setSaveDiffsEnabled:function(a){this._saveDiffsEnabled=a},_getSaveDiffsEnabled:function(){return this._saveDiffsEnabled&&null!==this._acceptPatch&&-1!==this._acceptPatch.indexOf("application/json-patch")},
_unknownContentTypeAsText:function(){return!0},_isText:function(a){a=this.contentTypeRegistry.getFileContentType(a);if(!a)return this._unknownContentTypeAsText();var d=this.contentTypeRegistry.getContentType("text/plain");return this.contentTypeRegistry.isExtensionOf(a,d)},_setNoInput:function(a){a?this.fileClient.loadWorkspace("").then(function(a){this._input=a.ChildrenLocation;this._setInputContents(a.ChildrenLocation,null,a,a)}.bind(this)):(this._input=this._title=this._fileMetadata=null,this.setContentType(null),
this.dispatchEvent({type:"InputChanged",input:null}))},_setInputContents:function(a,d,e,f,g){var h,k=!1;f?(this._fileMetadata=f,this.setTitle(f.Location||String(f)),this.setContentType(this.contentTypeRegistry.getFileContentType(f)),h=f.Name,k=f.Directory):(this._fileMetadata=null,this.setTitle(d),this.setContentType(this.contentTypeRegistry.getFilenameContentType(this.getTitle())),h=this.getTitle());var l=this.getEditor();this._focusListener&&(l&&(l.getTextView&&l.getTextView())&&l.getTextView().removeEventListener("Focus",
this._focusListener),this._focusListener=null);this._changingListener&&(l&&(l.getModel&&l.getModel())&&l.getModel().removeEventListener("Changing",this._changingListener),this._changingListener=null);f={type:"InputChanged",input:a,name:h,title:d,contentType:this.getContentType(),metadata:f,location:window.location,contents:e};this.dispatchEvent(f);this.editor=l=f.editor;k||(l&&(l.getModel&&l.getModel())&&l.getModel().addEventListener("Changing",this._changingListener=this.onChanging.bind(this)),g||
l.setInput(d,null,e),l&&(l.getTextView&&l.getTextView())&&l.getTextView().addEventListener("Focus",this._focusListener=this.onFocus.bind(this)),this._unsavedChanges=[],this.processParameters(a))}});return{handleError:a,InputManager:e}});
define("orion/compare/resourceComparer","i18n!orion/compare/nls/messages require orion/Deferred orion/webui/littlelib orion/compare/compareUtils orion/compare/diffProvider orion/compare/compareView orion/highlight orion/fileClient orion/globalCommands orion/commands orion/keyBinding orion/searchAndReplace/textSearcher orion/editorCommands orion/objects orion/inputManager orion/editor/editorFeatures orion/URL-shim".split(" "),function(l,n,m,k,g,h,f,d,a,e,b,p,q,s,u,w,x){function y(a){this._syntaxHighlither=
new d.SyntaxHighlighter(a)}n={};n.DefaultDiffProvider=function(){function a(b){this.serviceRegistry=b;this._diffProvider=new h.DiffProvider(b)}a.prototype={_resolveTwoFiles:function(a,b){var d=this;return m.all([d._getContentType(a),d._getContentType(b)],function(a){return{_error:a}}).then(function(e){if(Array.isArray(e)&&2===e.length&&e[0]&&e[1]){var f=e[0];e=e[1];return(new m).resolve({oldFile:{URL:a,Name:d._resolveFileName(a),Type:f},newFile:{URL:b,Name:d._resolveFileName(b),Type:e},diffContent:d._diffContent})}f=
a?d._resolveFileName(a):"";e=b?d._resolveFileName(b):"";return(new m).resolve({oldFile:{URL:a,Name:f,Type:null},newFile:{URL:b,Name:e,Type:null},diffContent:d._diffContent})})},_resolveFileName:function(a){return a.split("?")[0]},_getContentType:function(a){a=this._resolveFileName(a);return this.serviceRegistry.getService("orion.core.contentTypeRegistry").getFilenameContentType(a)},_resolveComplexFileURL:function(a){var b=this;return this._diffProvider.getDiffFileURI(a).then(function(a,d){return b._resolveTwoFiles(a.Old,
a.New)},function(){})},resolveDiff:function(a,b,d){this._hasConflicts=d;if(b)return this._resolveTwoFiles(b,a);if(this._diffProvider){var e=this;return e._diffProvider.getDiffContent(a).then(function(b,d){e._diffContent=e._hasConflicts?b.split("diff --git")[1]:b;return e._resolveComplexFileURL(a)},function(){})}console.log("A diff provider is needed for compound diff URL")}};return a}();y.prototype={highlight:function(a,b,d){return this._syntaxHighlither.setup(b,d.getTextView(),null,a,!1)}};n.ResourceComparer=
function(){function d(b,e,g,h){this._registry=b;this._commandService=e;this._fileClient=new a.FileClient(b);this._fileClient=new a.FileClient(b);this._searchService=this._registry.getService("orion.core.search");this._progress=this._registry.getService("orion.page.progress");this.setOptions(g,!0);this._compareView=g.toggleable?new f.toggleableCompareView("inline"===g.type?"inline":"twoWay",h):"inline"===g.type?new f.inlineCompareView(h):new f.TwoWayCompareView(h);this._compareView.getWidget().setOptions({extCmdHolder:this});
h.highlighters||this._compareView.getWidget().setOptions({highlighters:[new y(b),new y(b)]});h.oldFile||this._compareView.getWidget().setOptions({oldFile:{readonly:this._checkReadonly(g.readonlyRight)}});h.newFile||this._compareView.getWidget().setOptions({newFile:{readonly:this._checkReadonly(g.readonly,!0)}});this.initExtCmds();this._initInputManagers();this._compareView.getWidget().initEditors(l["fetching..."]);this._inputManagers.forEach(function(a){if(a.manager){var b=this._compareView.getWidget().getEditors()[a.manager._editorIndex];
b.addEventListener("DirtyChanged",function(d){a.manager.setDirty(b.isDirty())})}}.bind(this))}d.prototype={_clearOptions:function(){this.options={}},_checkReadonly:function(a,b){return b?"undefined"===typeof a?!1:a:"undefined"===typeof a?!0:a},_getFileOptions:function(a){return 1===a?this._compareView.getWidget().options.newFile:this._compareView.getWidget().options.oldFile},_createInputManager:function(){return new w.InputManager({serviceRegistry:this._registry,fileClient:this._fileClient,progressService:this._progress})},
_initInputManagers:function(){this._inputManagers=[{},{}];!this.options.toggleable&&(this._compareView.getWidget()._uiFactory&&"twoWay"===this._compareView.getWidget().type)&&(this._checkReadonly(this.options.readonlyRight)||(this._inputManagers[0].manager=this._createInputManager(),this._initInputManager(this._inputManagers[0].manager,0,this._compareView.getWidget()._uiFactory.getActionDivId())),this._checkReadonly(this.options.readonly,!0)||(this._inputManagers[1].manager=this._createInputManager(),
this._initInputManager(this._inputManagers[1].manager,1,this._compareView.getWidget()._uiFactory.getActionDivId(!0))));var a=this;this._inputManagers.forEach(function(b){b.manager&&(this._getFileOptions(b.manager._editorIndex).keyBindingFactory=function(d,e,f,g){e=new q.TextSearcher(d,a._registry,a._commandService,f);f=(new x.KeyBindingsFactory).createKeyBindings(d,f,g,e);(new s.EditorCommandFactory({serviceRegistry:a._registry,commandRegistry:a._commandService,fileClient:a._fileClient,inputManager:b.manager,
toolbarId:b.manager._actionBarId,readonly:!1,navToolbarId:"pageNavigationActions",textSearcher:e})).generateSimpleEditorCommands(d,1===b.manager._editorIndex?"orion.compare.save.left":"orion.compare.save.right");return f})}.bind(this))},_initInputManager:function(a,b,d){var f=this;u.mixin(a,{filePath:"",_editorIndex:b,_actionBarId:d,getInput:function(){return this.filePath},setDirty:function(a){var b=f._compareView.getWidget().getEditors(),d=a;b&&2===b.length&&(d=b[0].isDirty()||b[1].isDirty());e.setDirtyIndicator(d);
f._compareView.getWidget().refreshTitle&&f._compareView.getWidget().refreshTitle(this._editorIndex,a)},getFileMetadata:function(){return this._fileMetadata},getEditor:function(){return f._compareView.getWidget().getEditors()[this._editorIndex]},setInput:function(a,b){this._parsedLocation={resource:a};f._progress.progress(f._fileClient.read(a,!0),"Getting file metadata "+a).then(function(a){this._fileMetadata=a;var b=k.node(this._actionBarId);if(b){f._commandService.destroy(b);var d=this._editorIndex;
f._commandService.renderCommands(b.id,b,f._compareView.getWidget().getEditors()[d],f._compareView.getWidget().getEditors()[d],"button")}a&&this.setTitle(a.Location,a)}.bind(this),function(b){console.error("Error loading file metadata: "+b.message);this.setTitle(a)}.bind(this));this.lastFilePath=a},setTitle:function(a,b){"*"===a.charAt(0)?e.setDirtyIndicator(!0):e.setDirtyIndicator(!1)},afterSave:function(){var a=f._compareView.getWidget().getEditors()[this._editorIndex].getTextView().getText();f._getFileOptions(this._editorIndex).Content=
a;f._compareView.getWidget().refresh()}})},setOptions:function(a,b){b&&this._clearOptions();this.options||(this.options={});a&&Object.keys(a).forEach(function(b){this.options[b]=a[b]}.bind(this))},generateLink:function(a){a=a.getCurrentDiffPos();a=g.generateCompareHref(this.options.resource,{compareTo:this.options.compareTo,readonly:this.options.readonly,readonlyRight:this.options.readonlyRight,conflict:this.options.hasConflicts,block:a.block?a.block:1,change:a.change?a.change:0});a=(new URL(a,window.location.href)).href;
prompt(l["Copy the link URL:"],a)},openComparePage:function(a){a=a.getCurrentDiffPos();return g.generateCompareHref(this.options.resource,{compareTo:this.options.compareTo,readonly:!this.options.editableInComparePage,conflict:this.options.hasConflicts,block:a.block?a.block:1,change:a.change?a.change:0})},initExtCmds:function(){var a=this._compareView.getWidget().options.commandProvider;if(a&&a.getOptions().commandSpanId){var a=a.getOptions().commandSpanId,d=new b.Command({tooltip:l["Generate link of the current diff"],
name:l["Generate Link"],id:"orion.compare.generateLink",groupId:"orion.compareGroup",visibleWhen:function(a){return a.options.extCmdHolder.options.resource&&a.options.extCmdHolder.options.generateLink},callback:function(a){a.items.options.extCmdHolder.generateLink(a.items)}}),e=new b.Command({tooltip:l["Open the compare page"],name:l.Compare,id:"orion.compare.openComparePage",groupId:"orion.compareGroup",visibleWhen:function(a){return a.options.extCmdHolder.options.resource&&!a.options.extCmdHolder.options.generateLink},
hrefCallback:function(a){return a.items.options.extCmdHolder.openComparePage(a.items)}});this._commandService.addCommand(d);this._commandService.addCommand(e);this._commandService.registerCommandContribution(a,"orion.compare.openComparePage",98);this._commandService.registerCommandContribution(a,"orion.compare.generateLink",99,null,!1,new p.KeyBinding("l",!0,!0))}},_getFilesContents:function(a){var b=[];a.forEach(function(a){b.push(this._loadSingleFile(a))}.bind(this));return m.all(b,function(a){return{_error:a}})},
_isImage:function(a){switch(a&&a.id){case "image/jpeg":case "image/png":case "image/gif":case "image/ico":case "image/tiff":case "image/svg":return!0}return!1},_loadSingleFile:function(a){return this._registry.getService("orion.page.progress").progress(this._fileClient.read(a.URL),"Getting contents of "+a.URL).then(function(b){a.Content=b;return a}.bind(this),function(b,d){404===b.status&&(a.Content="");return a}.bind(this))},start:function(){if(this.options.resource){if(this.options.diffProvider){var a=
this;return a.options.diffProvider.resolveDiff(a.options.resource,a.options.compareTo,a.options.hasConflicts).then(function(b){a._compareView.getWidget().setOptions(b);b=a._isImage(b.newFile.Type);var d=a._compareView.getWidget().options;if(a._checkReadonly(a.options.readonlyRight)||b)d.oldFile.readonly=!0;if(a._checkReadonly(a.options.readonly,!0)||b)d.newFile.readonly=!0;return b?(a._compareView.initImageMode(),a._compareView.getWidget().refresh().then(function(a){return(new m).resolve(a+5)})):
a._getFilesContents(d.diffContent?[d.oldFile]:[d.oldFile,d.newFile]).then(function(){var b=a._compareView.getWidget().refresh(!0);this._inputManagers.forEach(function(b){if(b.manager){var d=a._getFileOptions(b.manager._editorIndex),e=a._compareView.getWidget().getEditors()[b.manager._editorIndex];b.manager.filePath=d.URL;b.manager.setInput(d.URL,e)}});return(new m).resolve(b)}.bind(a))})}console.log("A diff provider is needed for Complex diff URL")}}};return d}();return n});
define("orion/git/util",["orion/URL-shim"],function(l){function n(h){for(var f=0;f<g.length;f++)if(h.type===g[f])return!0;return!1}function m(g){for(var f=0;f<k.length;f++)if(g.type===k[f])return!0;return!1}var k=["Missing","Modified","Untracked","Conflicting"],g=["Added","Changed","Removed"];return{statusUILocation:"git/git-status.html",isStaged:n,isUnstaged:m,isChange:function(g){return n(g)||m(g)},hasStagedChanges:function(h){for(var f=0;f<g.length;f++)if(0<h[g[f]].length)return!0;return!1},hasUnstagedChanges:function(g){for(var f=
0;f<k.length;f++)if(0<g[k[f]].length)return!0;return!1},parseSshGitUrl:function(g){try{var f=new URL(g);return{host:f.hostname,port:f.port}}catch(d){try{var a=g.split(":")[0].split("@");return{host:1<a.length?a[1]:a[0],port:22}}catch(e){return{host:"",port:""}}}},trimCommitMessage:function(g){g=g.split(/\r\n|\n/);for(var f=0;0<g.length&&/^\s*$/.test(g[f]);)f++;return 100<g[f].length?g[f].substring(0,100)+"...":g[f]},getGerritFooter:function(g){g=g.split(/\r\n|\n/);for(var f={},d=0,a=g.length-1;0<=
a;--a)if(0===g[a].indexOf("Change-Id: ")){if(f.changeId=g[a].substring(11,g[a].length),1<++d){f={};break}}else 0===g[a].indexOf("Signed-off-by: ")&&(f.signedOffBy=g[a].substring(15,g[a].length));return f}}});
define("orion/git/uiUtil",["orion/compare/compareCommands","orion/compare/resourceComparer","orion/webui/littlelib","orion/git/util"],function(l,n,m,k){k=Object.create(k);k.createCompareWidget=function(g,h,f,d,a,e,b,k,q){var s=new n.DefaultDiffProvider(g);e=new l.CompareCommandFactory({commandService:h,commandSpanId:e,gridRenderer:k});(new n.ResourceComparer(g,h,{toggleable:!0,type:"inline",readonly:!0,hasConflicts:d,diffProvider:s,resource:f,compareTo:q,editableInComparePage:b},{parentDivId:a,commandProvider:e})).start().then(function(b){var d=
420;b<d&&(d=b);m.node(a).style.height=d+"px"})};return k});
define("orion/git/gitConfigPreference",["orion/Deferred"],function(l){function n(l){this._prefix="/git/config";this._preferenceService=l.getService("orion.core.preference")}n.prototype={getConfig:function(){var m=new l;this._preferenceService.getPreferences(this._prefix).then(function(k){k=k.get("userInfo");m.resolve(k)});return m},setConfig:function(m){var k=new l;this._preferenceService.getPreferences(this._prefix).then(function(g){g.put("userInfo",m);k.resolve()});return k}};return n.prototype.constructor=
n});
define("orion/git/widgets/CommitDialog",["i18n!git/nls/gitmessages","orion/webui/dialog","orion/git/gitConfigPreference"],function(l,n,m){function k(g){this._init(g)}k.prototype=new n.Dialog;k.prototype.TEMPLATE='\x3cdiv style\x3d"display: none; padding-top: 10px; padding-bottom: 10px;" id\x3d"commitInfoBar"\x3e\x3cstrong id\x3d"commitInfo"\x3e\x3c/strong\x3e\x3c/div\x3e\x3cdiv style\x3d"padding:4px"\x3e\x3cdiv style\x3d"vertical-align:top"\x3e\x3clabel style\x3d"display:block; float:left" id\x3d"commitMessageLabel" for\x3d"commitMessage"\x3e${Message:}\x3c/label\x3e\x3ctextarea id\x3d"commitMessage" rows\x3d"5" style\x3d"width: 30em"\x3e\x3c/textarea\x3e\x3c/div\x3e\x3c/div\x3e\x3cdiv style\x3d"padding:4px"\x3e\x3clabel id\x3d"amendLabel" for\x3d"amend"\x3e${Amend:}\x3c/label\x3e\x3cinput id\x3d"amend" type\x3d"checkbox"\x3e\x3c/div\x3e\x3cdiv style\x3d"padding:4px"\x3e\x3clabel id\x3d"changeIdLabel" for\x3d"changeId"\x3e${ChangeId:}\x3c/label\x3e\x3cinput id\x3d"changeId" type\x3d"checkbox"\x3e\x3c/div\x3e\x3cdiv style\x3d"padding:4px"\x3e\x3clabel id\x3d"committerNameLabel" for\x3d"committerName"\x3e${Committer Name:}\x3c/label\x3e\x3cinput id\x3d"committerName" style\x3d"width: 30em" value\x3d""\x3e\x3c/div\x3e\x3cdiv style\x3d"padding:4px"\x3e\x3clabel id\x3d"committerEmailLabel" for\x3d"committerEmail"\x3e${Committer Email:}\x3c/label\x3e\x3cinput id\x3d"committerEmail" style\x3d"width: 30em" value\x3d""\x3e\x3c/div\x3e\x3cdiv style\x3d"padding:4px"\x3e\x3clabel id\x3d"authorNameLabel" for\x3d"authorName"\x3e${Author Name:}\x3c/label\x3e\x3cinput id\x3d"authorName" style\x3d"width: 30em" value\x3d""\x3e\x3c/div\x3e\x3cdiv style\x3d"padding:4px"\x3e\x3clabel id\x3d"authorEmailLabel" for\x3d"authorEmail"\x3e${Author Email:}\x3c/label\x3e\x3cinput id\x3d"authorEmail" style\x3d"width: 30em" value\x3d""\x3e\x3c/div\x3e\x3cdiv style\x3d"padding:4px"\x3e\x3clabel id\x3d"persistLabel" for\x3d"persist"\x3e${Remember my committer name and email:}\x3c/label\x3e\x3cinput id\x3d"persist" type\x3d"checkbox"\x3e\x3c/div\x3e';k.prototype._init=
function(g){var h=this;this.title=l["Commit Changes"];this.modal=!0;this.messages=l;this.options=g;this.buttons=[];this.buttons.push({callback:function(){h._execute()},text:"OK",id:"commitChangesButton"});this._initialize()};k.prototype._bindToDom=function(g){var h=this;this.options.body.Message&&(this.$commitMessage.value=this.options.body.Message);this.$commitMessage.addEventListener("keyup",function(f){h._validate()});this.options.body.Amend&&(this.$amend.checked=!0);this.options.body.ChangeId&&
(this.$changeId.checked=!0);this.options.body.CommitterName&&(this.$committerName.value=this.options.body.CommitterName);this.$committerName.addEventListener("keyup",function(f){h._validate()});this.options.body.CommitterEmail&&(this.$committerEmail.value=this.options.body.CommitterEmail);this.$committerEmail.addEventListener("keyup",function(f){h._validate()});this.options.body.AuthorName&&(this.$authorName.value=this.options.body.AuthorName);this.$authorName.addEventListener("keyup",function(f){h._validate()});
this.options.body.AuthorEmail&&(this.$authorEmail.value=this.options.body.AuthorEmail);this.$authorEmail.addEventListener("keyup",function(f){h._validate()});this._validate()};k.prototype._validate=function(){this.$commitMessage.value?this.$committerName.value?this.$committerEmail.value?this.$authorName.value?this.$authorEmail.value?(this.$commitInfoBar.style.display="none",this.$commitChangesButton.classList.remove(this.DISABLED)):(this.$commitInfoBar.style.display="block",this.$commitChangesButton.classList.add(this.DISABLED),
this.$commitInfo.textContent=l["The author mail is required."]):(this.$commitInfoBar.style.display="block",this.$commitChangesButton.classList.add(this.DISABLED),this.$commitInfo.textContent=l["The author name is required."]):(this.$commitInfoBar.style.display="block",this.$commitChangesButton.classList.add(this.DISABLED),this.$commitInfo.textContent=l["The committer mail is required."]):(this.$commitInfoBar.style.display="block",this.$commitChangesButton.classList.add(this.DISABLED),this.$commitInfo.textContent=
l["The committer name is required."]):(this.$commitInfoBar.style.display="block",this.$commitChangesButton.classList.add(this.DISABLED),this.$commitInfo.textContent=l["The commit message is required."])};k.prototype._execute=function(){if(!this.$commitChangesButton.classList.contains(this.DISABLED)){if(this.options.func){var g={};g.Message=this.$commitMessage.value;g.Amend=this.$amend.checked?!0:!1;g.ChangeId=this.$changeId.checked?!0:!1;g.CommitterName=this.$committerName.value;g.CommitterEmail=
this.$committerEmail.value;g.AuthorName=this.$authorName.value;g.AuthorEmail=this.$authorEmail.value;g.persist=this.$persist.checked?!0:!1;this.options.func(g)}this.hide()}};k.prototype.constructor=k;return{CommitDialog:k}});
define("orion/git/gitPreferenceStorage",["orion/Deferred"],function(l){function n(l){this._prefix="/git/credentials";this._preferenceService=l.getService("orion.core.preference")}n.prototype={put:function(m,k){var g={gitSshUsername:"",gitSshPassword:"",gitPrivateKey:"",gitPassphrase:""};void 0!==k&&(void 0!==k.gitSshUsername&&null!==k.gitSshUsername&&(g.gitSshUsername=k.gitSshUsername),void 0!==k.gitSshPassword&&null!==k.gitSshPassword&&(g.gitSshPassword=k.gitSshPassword),void 0!==k.gitPrivateKey&&
null!==k.gitPrivateKey&&(g.gitPrivateKey=k.gitPrivateKey),void 0!==k.gitPassphrase&&null!==k.gitPassphrase&&(g.gitPassphrase=k.gitPassphrase));var h=new l;this._preferenceService.getPreferences(this._prefix,2).then(function(f){var d=f.get("settings");void 0===d?h.reject():d.enabled?(f.put(m,g),h.resolve()):h.reject()});return h},get:function(m){var k={gitSshUsername:"",gitSshPassword:"",gitPrivateKey:"",gitPassphrase:""},g=new l;this._preferenceService.getPreferences(this._prefix,2).then(function(h){var f=
h.get("settings");void 0===f?g.reject():f.enabled?(h=h.get(m),void 0!==h?g.resolve(h):g.resolve(k)):g.reject()});return g},isEnabled:function(){var m=new l;this._preferenceService.getPreferences(this._prefix,2).then(function(k){k=k.get("settings");void 0===k?m.resolve(!1):m.resolve(k.enabled)});return m},enable:function(){var m=new l;this._preferenceService.getPreferences(this._prefix,2).then(function(k){k.put("settings",{enabled:!0});m.resolve()});return m},disable:function(){var m=new l;this._preferenceService.getPreferences(this._prefix,
2).then(function(k){k.put("settings",{enabled:!1});m.resolve()});return m},remove:function(m){var k=new l;this._preferenceService.getPreferences(this._prefix,2).then(function(g){g.remove(m);k.resolve()});return k},getRepositories:function(){var m=new l;this._preferenceService.getPreferences(this._prefix,2).then(function(k){var g=[];k=k.keys();for(var h=0;h<k.length;++h)"settings"!==k[h]&&g.push(k[h]);m.resolve(g)});return m}};return n.prototype.constructor=n});
define("orion/git/widgets/GitCredentialsDialog",["i18n!git/nls/gitmessages","orion/git/gitPreferenceStorage","orion/webui/dialog","orion/git/util"],function(l,n,m,k){function g(g){this._init(g)}g.prototype=new m.Dialog;g.prototype.TEMPLATE='\x3cdiv id\x3d"gitCredentialsLabel" style\x3d"padding: 8px"\x3e${Repository URL:}\x3cstrong id\x3d"url"\x3e\x3c/strong\x3e\x3c/div\x3e\x3cdiv id\x3d"gitSshUsernameRow" style\x3d"padding: 8px"\x3e\x3clabel id\x3d"gitSshUsernameLabel" for\x3d"gitSshUsername"\x3e${Username:}\x3c/label\x3e\x3cinput id\x3d"gitSshUsername" value\x3d""\x3e\x3c/div\x3e\x3cdiv id\x3d"gitSshPasswordRow" style\x3d"padding: 8px"\x3e\x3cinput id\x3d"isSshPassword" type\x3d"radio" name\x3d"isSshPassword" checked value\x3d"password"/\x3e\x3clabel id\x3d"gitSshPasswordLabel" for\x3d"gitSshPassword" style\x3d"padding: 0 8px"\x3e${Password:}\x3c/label\x3e\x3cinput type\x3d"password" id\x3d"gitSshPassword" value\x3d"" style\x3d"width: 30em"\x3e\x3c/div\x3e\x3cdiv style\x3d"padding: 8px"\x3e\x3cdiv id\x3d"gitPrivateKeyRow"\x3e\x3cinput id\x3d"isPrivateKey" type\x3d"radio" name\x3d"isSshPassword" value\x3d"privateKey" style\x3d"vertical-align: top"/\x3e\x3clabel id\x3d"gitPrivateKeyLabel" for\x3d"gitPrivateKey" style\x3d"padding: 0 8px; vertical-align: top"\x3e${Private key:}\x3c/label\x3e\x3ctextarea id\x3d"gitPrivateKey" value\x3d""\x3e\x3c/textarea\x3e\x3c/div\x3e\x3cdiv id\x3d"gitPrivateKeyFileRow" style\x3d"padding-left: 8em"\x3e\x3clabel id\x3d"gitPrivateKeyFileLabel" for\x3d"gitPrivateKeyFile"\x3e${Private key file (optional):}\x3c/label\x3e\x3cbr\x3e\x3cinput id\x3d"gitPrivateKeyFile" multiple\x3d"false" type\x3d"file" size\x3d"53" label\x3d"Browse..."\x3e\x3c/div\x3e\x3cdiv id\x3d"gitPassphraseRow" style\x3d"padding-left: 8em"\x3e\x3clabel id\x3d"gitPassphraseLabel" for\x3d"gitPassphrase"\x3e${Passphrase (optional):}\x3c/label\x3e\x3cbr\x3e\x3cinput type\x3d"password" id\x3d"gitPassphrase" value\x3d"" style\x3d"width: 30em"\x3e\x3c/div\x3e\x3c/div\x3e\x3cdiv id\x3d"gitSaveCredentialsRow" style\x3d"padding: 8px"\x3e\x3cimg id\x3d"gitSaveCredentialsInfo" src\x3d"/images/info.gif""\x3e\x3cinput id\x3d"gitSaveCredentials" type\x3d"checkbox" name\x3d"gitSaveCredentials"\x3e\x3clabel id\x3d"gitSaveCredentialsLabel" for\x3d"gitSaveCredentials"\x3e${Don\'t prompt me again:}\x3c/label\x3e\x3c/div\x3e';
g.prototype._init=function(g){var f=this;this.title=g.title||l["Git Credentials"];this.modal=!0;this.messages=l;this.options=g;this._afterHiding=g.closeCallback;!this.options.username&&(!this.options.password&&!this.options.privatekey&&!this.options.passphrase)&&(this.options.username=!0,this.options.password=!0,this.options.privatekey=!0,this.options.passphrase=!0);g.serviceRegistry&&(this._sshService=g.serviceRegistry.getService("orion.net.ssh"),this._progressService=g.serviceRegistry.getService("orion.page.progress"));
this.buttons=[];this.buttons.push({callback:function(){f.destroy();f._execute()},text:"OK",isDefault:!0});this._initialize()};g.prototype._bindToDom=function(g){var f=this;this.options.username||(this.$gitSshUsernameRow.style.display="none");this.options.password||(this.$gitSshPasswordRow.style.display="none");this.options.privatekey||(this.$gitPrivateKeyRow.style.display="none",this.$gitPrivateKeyFileRow.style.display="none");this.options.passphrase||(this.$gitPassphraseRow.style.display="none");
this.options.errordata&&this.options.errordata.Url&&(this.$gitCredentialsLabel.style.display="block",this.$url.textContent=this.options.errordata.Url);this.options.errordata&&(this.options.errordata.User&&""!==this.options.errordata.User)&&(this.$gitSshUsername.value=this.options.errordata.User,this.$gitSshUsernameRow.style.display="none",setTimeout(function(){f.$gitSshPassword.focus()},400));(new n(this.options.serviceRegistry)).isEnabled().then(function(d){d||(f.$gitSaveCredentials.style.display=
"none",f.$gitSaveCredentialsLabel.style.display="none",f.$gitSaveCredentialsInfo.style.display="none")});this.$gitSshPassword.addEventListener("focus",function(d){f.$isSshPassword.checked=!0});this.$gitPrivateKey.addEventListener("focus",function(d){f.$isPrivateKey.checked=!0});this.$gitPrivateKeyFile.addEventListener("focus",function(d){f.$isPrivateKey.checked=!0});this.$gitPassphrase.addEventListener("focus",function(d){f.$isPrivateKey.checked=!0});this.$gitPrivateKeyFile.addEventListener("change",
function(d){f.privateKeyFile=d.target.files[0]})};g.prototype._execute=function(){var g=this,f=this.$gitPrivateKey.value,d=this.$url.textContent,a=function(a){if(g._sshService){var e=k.parseSshGitUrl(d);g._sshService.getKnownHostCredentials(e.host,e.port).then(function(d){if(g.options.func){var e="undefined"===typeof g.options.failedOperation?g.options.errordata.failedOperation:g.options.failedOperation;"undefined"!==e&&g._progressService.removeOperation(e);g.options.func({gitSshUsername:g.$gitSshUsername.value,
gitSshPassword:g.$isSshPassword.checked?g.$gitSshPassword.value:"",gitPrivateKey:g.$isPrivateKey.checked?a:"",gitPassphrase:g.$isPrivateKey.checked?g.$gitPassphrase.value:"",knownHosts:d})}})}else g.options.func&&(e="undefined"===typeof g.options.failedOperation?g.options.errordata.failedOperation:g.options.failedOperation,"undefined"!==e&&g._progressService.removeOperation(e),g.options.func({gitSshUsername:g.$gitSshUsername.value,gitSshPassword:g.$gitSshPassword.value,gitPrivateKey:a,gitPassphrase:g.$gitPassphrase.value,
knownHosts:g.$gitSshKnownHosts.value}))};if(this.privateKeyFile){var e=new FileReader;e.onload=function(b){return function(b){f=b.target.result;b=new n(g.options.serviceRegistry);g.$gitSaveCredentials.checked?b.put(d,{gitPrivateKey:f,gitPassphrase:g.$gitPassphrase.value}).then(function(){a(f)}):a(f)}}(this.privateKeyFile);e.readAsText(this.privateKeyFile)}else 0<f.length?(e=new n(g.options.serviceRegistry),g.$gitSaveCredentials.checked?e.put(d,{gitPrivateKey:f,gitPassphrase:g.$gitPassphrase.value}).then(function(){a(f)}):
a(f)):(e=new n(g.options.serviceRegistry),g.$gitSaveCredentials.checked?e.put(d,{gitSshUsername:g.$gitSshUsername.value,gitSshPassword:g.$gitSshPassword.value}).then(function(){a(f)}):a(f))};g.prototype.constructor=g;return{GitCredentialsDialog:g}});
define("orion/git/logic/gitCommon","orion/git/util orion/i18nUtil orion/git/gitPreferenceStorage orion/git/widgets/GitCredentialsDialog orion/Deferred i18n!git/nls/gitmessages".split(" "),function(l,n,m,k,g,h){function f(a){var b;try{b=JSON.parse(a.responseText)}catch(d){b={Message:h["Problem while performing the action"]}}b.HttpCode=a.status;return b}var d=function(a,b,d,f){if(confirm(n.formatMessage(h["Would you like to add ${0} key for host ${1} to continue operation? Key fingerpt is ${2}."],b.KeyType,
b.Host,b.HostFingerprint))){var g=l.parseSshGitUrl(b.Url);b={host:b.Host,keyType:b.KeyType,hostKey:b.HostKey,port:g.port};a.getService("orion.net.ssh").addKnownHost(b).then(function(b){d.knownHosts=b;"undefined"!==typeof d.failedOperation&&a.getService("orion.page.progress").removeOperation(d.failedOperation);f(d)})}},a=function(a,b,d,f,g,h){b=b?b.Url:void 0;var l=function(){(new k.GitCredentialsDialog({title:g,serviceRegistry:a,func:f,errordata:d.errordata,failedOperation:d.failedOperation,closeCallback:h})).show()};
d.gitSshUsername&&""!==d.gitSshUsername||d.gitSshPassword&&""!==d.gitSshPassword||d.gitPrivateKey&&""!==d.gitPrivateKey?l():(new m(a)).get(b).then(function(b){""!==b.gitPrivateKey||""!==b.gitSshUsername||""!==b.gitSshPassword?("undefined"!==typeof d.failedOperation&&a.getService("orion.page.progress").removeOperation(d.failedOperation),f({knownHosts:d.knownHosts,gitSshUsername:b.gitSshUsername,gitSshPassword:b.gitSshPassword,gitPrivateKey:b.gitPrivateKey,gitPassphrase:b.gitPassphrase})):l()},l)};
return{handleGitServiceResponse:function(a,b,d,g){a&&void 0!==a.status&&(a=f(a));if(!a||!a.HttpCode)d&&d(a);else switch(a.HttpCode){case 401:var k=new m(b);k.isEnabled().then(function(b){b&&void 0!==a.JsonData.Url?k.remove(a.JsonData.Url).then(function(){g(a)}):g(a)});break;case 400:if(a.JsonData&&a.JsonData.HostKey){g(a);break}default:var l=[];l.Severity=a.Severity||"Error";l.HTML=!1;l.Message="REJECTED_NONFASTFORWARD"===(a.DetailedMessage?a.DetailedMessage:a.Message)?h.REJECTED_NONFASTFORWARD:a.DetailedMessage?
a.DetailedMessage:a.Message;b.getService("orion.page.message").setProgressResult(l);d&&d(a)}},handleProgressServiceResponse:function(e,b,g,h,k,l){e&&void 0!==e.status&&(e=f(e));if(!e||void 0===e.HttpCode)h&&h(e);else switch(e.HttpCode){case 401:e.JsonData&&(b.errordata=e.JsonData);e.failedOperation&&(b.failedOperation=e.failedOperation);a(g,e.JsonData,b,k,l);break;case 400:if(e.JsonData&&e.JsonData.HostKey){e.failedOperation&&(b.failedOperation=e.failedOperation);d(g,e.JsonData,b,k);break}else if(e.JsonData&&
e.JsonData.Host){e.JsonData&&(b.errordata=e.JsonData);e.failedOperation&&(b.failedOperation=e.failedOperation);a(g,e.JsonData,b,k,l);break}default:b=[],b.Severity="Error",b.HTML=!1,b.Message=e.DetailedMessage?e.DetailedMessage:e.Message,g.getService("orion.page.message").setProgressResult(b),h&&h(e)}},gatherSshCredentials:function(a,b,d,f){var s=new g,u,w=b.items;w.LocalBranch&&w.RemoteBranch&&(w=w.LocalBranch);void 0!==w.RemoteLocation?u=w.RemoteLocation[0].GitUrl:void 0!==w.GitUrl?u=w.GitUrl:void 0!==
w.errorData?u=w.errorData.Url:void 0!==w.toRef&&(u=w.toRef.RemoteLocation[0].GitUrl);var w=a.getService("orion.net.ssh"),x=l.parseSshGitUrl(u),y=function(d){a.getService("orion.net.ssh").getKnownHostCredentials(x.host,x.port).then(function(a){b.sshObject=d;s.resolve({knownHosts:a,gitSshUsername:d.gitSshUsername,gitSshPassword:d.gitSshPassword,gitPrivateKey:d.gitPrivateKey,gitPassphrase:d.gitPassphrase})})},r=b.errorData;if(r&&r.HostKey){if(confirm(n.formatMessage(h["Would you like to add ${0} key for host ${1} to continue operation? Key fingerpt is ${2}."],
r.KeyType,r.Host,r.HostFingerprint))){var t=l.parseSshGitUrl(r.Url);w.addKnownHost({host:r.Host,keyType:r.KeyType,hostKey:r.HostKey,port:t.port}).then(function(){b.sshObject&&(""!==b.sshObject.gitSshUsername||""!==b.sshObject.gitSshPassword||""!==b.sshObject.gitPrivateKey)?y({gitSshUsername:"",gitSshPassword:"",gitPrivateKey:"",gitPassphrase:""}):(new m(a)).get(u).then(function(a){y(a)},function(){y({gitSshUsername:"",gitSshPassword:"",gitPrivateKey:"",gitPassphrase:""})})})}else"function"===typeof f&&
f();return s}var z=function(){if(!b.parameters&&!b.optionsRequested)y({gitSshUsername:"",gitSshPassword:"",gitPrivateKey:"",gitPassphrase:""});else if(b.parameters&&!b.optionsRequested){var g=b.parameters&&b.parameters.valueFor("sshuser")?b.parameters.valueFor("sshuser"):b.errorData.User,h=b.parameters?b.parameters.valueFor("sshpassword"):"",l=b.parameters&&b.parameters.valueFor("saveCredentials")?b.parameters.valueFor("saveCredentials"):!1,n=new m(a);l?n.put(u,{gitSshUsername:g,gitSshPassword:h}).then(function(){y({gitSshUsername:g,
gitSshPassword:h,gitPrivateKey:"",gitPassphrase:""})}):y({gitSshUsername:g,gitSshPassword:h,gitPrivateKey:"",gitPassphrase:""})}else(new k.GitCredentialsDialog({title:d,serviceRegistry:a,func:y,errordata:r,closeCallback:f})).show()};b.sshObject&&(""!==b.sshObject.gitSshUsername||""!==b.sshObject.gitSshPassword||""!==b.sshObject.gitPrivateKey)?z():(new m(a)).get(u).then(function(a){""!==a.gitPrivateKey||""!==a.gitSshUsername||""!==a.gitSshPassword?y(a):z()},z);return s},handleSshAuthenticationError:a,
handleKnownHostsError:d}});
define("orion/git/logic/gitCommit","i18n!git/nls/gitmessages orion/commandRegistry orion/Deferred orion/git/widgets/CommitDialog orion/git/logic/gitCommon orion/i18nUtil orion/webui/littlelib".split(" "),function(l,n,m,k,g,h,f){var d=g.handleProgressServiceResponse;return function(a){var e=a.serviceRegistry,b=new n.CommandEventListener("change",function(a,b){var d=b.status,f=b.messageTextArea;if(a.target.checked){var g=e.getService("orion.page.message"),d=e.getService("orion.page.progress").progress(e.getService("orion.git.provider").doGitLog(d.CommitLocation+"?page\x3d1\x26pageSize\x3d1"),
l["Fetching previous commit message"]);g.createProgressMonitor(d,l["Fetching previous commit message"],d.then(function(a){f.value=a.Children[0].Message}),function(a){f.value=""})}else f.value=""}),g=function(a,b,d){var f=e.getService("orion.git.provider"),g=new m;f.addCloneConfigurationProperty(d,a,b).then(function(){g.resolve()},function(e){409===e.status?f.getGitCloneConfig(d).then(function(d){if(d.Children)for(var e=0;e<d.Children.length;e++)if(d.Children[e].Key===a){f.editCloneConfigurationProperty(d.Children[e].Location,
b).then(function(){g.resolve()},function(a){g.reject(a)});break}},function(a){g.reject(a)}):g.reject(e)});return g},q=function(a){var b={Severity:"Error",HTML:!1};try{var d=JSON.parse(a.responseText);401===a.status?(b.HTML=!0,b.Message="\x3cspan\x3e",b.Message+=h.formatMessage(l["Authentication required for: ${0}. ${1} and re-try the request."],d.label,'\x3ca target\x3d"_blank" href\x3d"'+d.SignInLocation+'"\x3e'+l.Login+"\x3c/a\x3e")+"\x3c/span\x3e"):b.Message=d.DetailedMessage?d.DetailedMessage:
d.Message?d.Message:l["Problem while performing the action"]}catch(f){b.Message=l["Problem while performing the action"]}e.getService("orion.page.message").setProgressResult(b)};return{perform:function(a){var b=new m,f=a.items.status||a.handler.status,h=f.Clone.ConfigLocation,n=function(a){a.persist&&g("user.name",a.CommitterName,h).then(function(){g("user.email",a.CommitterEmail,h).then(function(){},function(a){d(a,{},e);b.reject(a)})},function(a){d(a,{},e);b.reject(a)});var k=e.getService("orion.page.message"),
m=e.getService("orion.page.progress").progress(e.getService("orion.git.provider").commitAll(f.Clone.HeadLocation,null,JSON.stringify(a)),l["Committing changes"]);k.createProgressMonitor(m,l["Committing changes"]);m.then(function(a){b.resolve()},function(a){q(a);b.reject(a)})},r=function(a,b){for(var d=0;d<b.length;d++)"user.name"===b[d].Key?(a.CommitterName=b[d].Value,a.AuthorName=b[d].Value):"user.email"===b[d].Key&&(a.CommitterEmail=b[d].Value,a.AuthorEmail=b[d].Value);a.Message&&a.CommitterName&&
a.CommitterEmail?n(a):(new k.CommitDialog({body:a,func:n})).show()},t={};t.Message=a.userData.name;t.Amend=a.userData.amend;t.ChangeId=a.userData.changeId;var z=f.Clone.Config;if(t.Amend&&!t.Message){a=e.getService("orion.page.message");var B=e.getService("orion.page.progress").progress(e.getService("orion.git.provider").doGitLog(f.CommitLocation+"?page\x3d1\x26pageSize\x3d1"),l["Committing changes"]);a.createProgressMonitor(B,l["Committing changes"]);B.then(function(a){t.Message=a.Children[0].Message;
r(t,z)},function(a){r(t,z)})}else r(t,z);return b},createParameters:function(a){return new n.ParametersDescription([new n.CommandParameter("name","text",l["Commit message:"],"",4),new n.CommandParameter("amend","boolean",a?l.SmartAmend:l["Amend:"],!1,null,b),new n.CommandParameter("changeId","boolean",a?l.SmartChangeId:l["ChangeId:"],!1)],{hasOptionalParameters:!0,getParameterElement:a?function(a,b){return f.$("#"+a.name+"parameterCollector",b.parentNode.parentNode)}:null,getSubmitName:a?function(a){a=
a.items;Array.isArray(a)||(a=[a]);return h.formatMessage(l.SmartCountCommit,a.length)}:null})},displayErrorOnStatus:q,amendEventListener:b,setGitCloneConfig:g}}});
define("orion/git/widgets/gitChangeList","i18n!git/nls/gitmessages orion/i18nUtil orion/Deferred orion/explorers/explorer orion/git/uiUtil orion/git/util orion/webui/tooltip orion/selection orion/webui/littlelib orion/commands orion/git/logic/gitCommit orion/objects".split(" "),function(l,n,m,k,g,h,f,d,a,e,b,p){function q(a){this.changes=a.changes;this.registry=a.registry;this.prefix=a.prefix;this.location=a.location;this.repository=a.repository;this.handleError=a.handleError;this.changes=a.changes;
this.gitClient=a.gitClient;this.progressService=a.progressService;this.section=a.section}function s(a){this.checkbox="all"===a.prefix;var b=new u({registry:a.serviceRegistry,commandService:a.commandRegistry,actionScopeId:a.actionScopeId,cachePrefix:a.prefix+"Navigator",checkbox:this.checkbox},this);k.Explorer.call(this,a.serviceRegistry,a.selection,b,a.commandRegistry);this.parentId=a.parentId;this.actionScopeId=a.actionScopeId;this.prefix=a.prefix;this.changes=a.changes;this.section=a.section;this.location=
a.location;this.repository=a.repository;this.editableInComparePage=a.editableInComparePage;this.handleError=a.handleError;this.gitClient=a.gitClient;this.progressService=a.progressService;this.explorerSelectionScope="explorerSelection";this.createSelection();this.createCommands();"all"!==this.prefix&&this.updateCommands()}function u(a,b){k.SelectionRenderer.apply(this,arguments);this.registry=a.registry}var w=["Missing","Modified","Untracked","Conflicting"],x=["Added","Changed","Removed"],y=w.concat(x),
r={Missing:{imageClass:"gitImageSprite git-sprite-removal",tooltip:l["Unstaged removal"]},Removed:{imageClass:"gitImageSprite git-sprite-removal",tooltip:l["Staged removal"]},Modified:{imageClass:"gitImageSprite git-sprite-file",tooltip:l["Unstaged change"]},Changed:{imageClass:"gitImageSprite git-sprite-file",tooltip:l["Staged change"]},Untracked:{imageClass:"gitImageSprite git-sprite-addition",tooltip:l["Unstaged addition"]},Added:{imageClass:"gitImageSprite git-sprite-addition",tooltip:l["Staged addition"]},
Conflicting:{imageClass:"gitImageSprite git-sprite-conflict-file",tooltip:l.Conflicting},ADD:{imageClass:"gitImageSprite git-sprite-addition",tooltip:l.Addition},MODIFY:{imageClass:"gitImageSprite git-sprite-file",tooltip:l.Deletion},DELETE:{imageClass:"gitImageSprite git-sprite-removal",tooltip:l.Diffs}};q.prototype=Object.create(k.Explorer.prototype);p.mixin(q.prototype,{destroy:function(){},getRoot:function(a){a(this.changes||this.root||(this.root={Type:"Root"}))},getGroups:function(a){switch(a){case "all":return y;
case "staged":return x;case "unstaged":return w}},getChildren:function(a,b){if(a instanceof Array&&0<a.length)b(a);else if("Root"===a.Type){var d=this;if(a.children)b(a.children);else{var e=this.location,f=this.progressService,h=this.gitClient,k=this.section.createProgressMonitor();k.begin("Getting changes");f.progress(h.getGitStatus(e),l["Loading..."]).then(function(e){if("Status"===e.Type){var g=d.status=d.items=e;m.when(d.repository||f.progress(h.getGitClone(g.CloneLocation),"Getting repository information"),
function(e){var h=e.Children?e.Children[0]:e;d.repository=h;h.status=g;f.progress(d.registry.getService("orion.git.provider").getGitCloneConfig(h.ConfigLocation),"Getting repository configuration ",h.Name).then(function(e){e=e.Children;g.Clone=h;g.Clone.Config=[];for(var f=0;f<e.length;f++)("user.name"===e[f].Key||"user.email"===e[f].Key)&&g.Clone.Config.push(e[f]);e=a.children=d._sortBlock(d.getGroups(d.prefix));"all"===d.prefix&&(0<e.length&&e.unshift({Type:"ExplorerSelection",selectable:!0}),e.unshift({Type:"CommitMsg",
selectable:!1}));e.forEach(function(b){b.parent=a});k.done();b(e)},function(a){k.done();d.handleError(a)})},function(a){k.done();d.handleError(a)})}},function(a){k.done();d.handleError(a)})}}else g.isChange(a)||"Diff"===a.Type?(a.children||(a.children=[],a.children.push({DiffLocation:a.DiffLocation,Type:"Compare",parent:a,selectable:"all"!==this.prefix})),b(a.children)):b([])},getId:function(a){var b=this.prefix;return a instanceof Array&&0<a.length||"Root"===a.Type?b+"Root":g.isChange(a)?b+a.type+
a.name:"ExplorerSelection"===a.Type||"CommitMsg"===a.Type?b+a.Type:b+a.type+a.DiffLocation},getModelType:function(a,b){return b},_markConflict:function(a){var b=this.getGroupData(a[1]);if(b)for(var d=0;d<b.length;d++)if(!b[d].Conflicting){for(var e=b[d].Location,f=[],g=2;g<a.length;g++){var h=this.getGroupData(a[g]);h&&(h=this._findSameFile(e,h))&&f.push(h)}if(f.length===Math.max(0,a.length-2)){b[d].Conflicting=a[0];for(e=0;e<f.length;e++)f[e].Conflicting="Hide"}}},_findSameFile:function(a,b){for(var d=
0;d<b.length;d++)if(!b[d].Conflicting&&a===b[d].Location)return b[d]},_sortBlock:function(a){for(var b=[],d=0;d<a.length;d++){var e=a[d],f=this.getGroupData(e);if(f)for(var g=0;g<f.length;g++){var h=this.getModelType(f[g],e);h&&b.push({name:f[g].Name,type:h,location:f[g].Location,path:f[g].Path,commitURI:f[g].Git.CommitLocation,indexURI:f[g].Git.IndexLocation,DiffLocation:f[g].Git.DiffLocation,CloneLocation:this.items.CloneLocation,conflicting:"Conflicting"===h})}}b.sort(function(a,b){var d=a.name&&
a.name.toLowerCase(),e=b.name&&b.name.toLowerCase();return d<e?-1:d>e?1:0});return b},getGroupData:function(a){return this.items[a]},isStaged:function(a){for(var b=0;b<x.length;b++)if(a===x[b])return!0;return!1},getClass:function(a){return r[a.type].imageClass},getTooltip:function(a){return r[a.type].tooltip}});s.prototype=Object.create(k.Explorer.prototype);p.mixin(s.prototype,{changedItem:function(a){var b=new m;if("all"===this.prefix){var d=a[0].parent,e=this.messageTextArea.value,f=this.amendCheck.checked,
g=this.changeIDCheck.checked,h=this;d.children=d.Children=null;this.model.getChildren(d,function(a){d.removeAll=!0;h.myTree.refresh.bind(h.myTree)(d,a,!1);var k=a.filter(function(a){return h.model.isStaged(a.type)});h.selection.setSelections(k);h.messageTextArea.value=e;h.amendCheck.checked=f;h.changeIDCheck.checked=g;b.resolve(a)})}else b.resolve();return b},destroy:function(){this._selectionListener&&(this.selection.removeEventListener("selectionChanged",this._selectionListener),this._selectionListener=
null)},display:function(){var a=this,b=new m,d=new q({registry:this.registry,progress:this.progressService,prefix:this.prefix,location:this.location,repository:this.repository,handleError:this.handleError,changes:this.changes,gitClient:this.gitClient,progressService:this.progressService,section:this.section});this.createTree(this.parentId,d,{onComplete:function(){var d=a.model;"all"===a.prefix&&(a.updateCommands(),a.selection.setSelections(d._sortBlock(d.getGroups("staged"))));a.status=d.status;b.resolve()}});
return b},isRowSelectable:function(a){return"all"===this.prefix?!1:g.isChange(a)},getItemCount:function(){var a=0,b=this.model;b&&b.getRoot(function(d){b.getChildren(d,function(b){a=Math.max(0,b.length-2)})});return a},updateCommands:function(){k.createExplorerCommands(this.commandService);var b=this.section.actionsNode.id,d=this.section.selectionNode.id,e=this.explorerSelectionScope;this.commandService.registerCommandContribution(e,"orion.explorer.expandAll",200);this.commandService.registerCommandContribution(e,
"orion.explorer.collapseAll",300);if("staged"===this.prefix)this.commandService.addCommandGroup(b,"eclipse.gitCommitGroup",1E3,"Commit",null,null,null,"Commit",null,"eclipse.orion.git.commitCommand"),this.commandService.registerCommandContribution(b,"eclipse.orion.git.commitCommand",100,"eclipse.gitCommitGroup"),this.commandService.registerCommandContribution(b,"eclipse.orion.git.commitAndPushCommand",200,"eclipse.gitCommitGroup"),this.commandService.registerCommandContribution(d,"eclipse.orion.git.unstageCommand",
100),this.commandService.registerCommandContribution("DefaultActionWrapper","eclipse.orion.git.unstageCommand",100);else if("unstaged"===this.prefix)this.commandService.registerCommandContribution(d,"eclipse.orion.git.showPatchCommand",100),this.commandService.registerCommandContribution(d,"eclipse.orion.git.stageCommand",200),this.commandService.registerCommandContribution(d,"eclipse.orion.git.checkoutCommand",300),this.commandService.registerCommandContribution("DefaultActionWrapper","eclipse.orion.git.stageCommand",
100);else if("all"===this.prefix){this.commandService.registerCommandContribution(d,"eclipse.orion.git.showStagedPatchCommand",100);this.commandService.registerCommandContribution(d,"eclipse.orion.git.checkoutStagedCommand",200);this.commandService.registerCommandContribution(d,"eclipse.orion.git.precommitCommand",300);var f=a.node(e);f&&(this.commandService.destroy(f),this.commandService.renderCommands(e,e,this,this,"button"));this.commandService.renderCommands(d,d,[],this,"button",{Clone:this.model.repository})}this.commandService.renderCommands(b,
b,this,this,"button")},createCommands:function(){if("all"===this.prefix){var a=this,b=new e.Command({tooltip:l["Select all"],imageClass:"core-sprite-check",id:"orion.explorer.selectAllCommandChangeList",visibleWhen:function(b){var d=!1;a.model.getRoot(function(b){d=0<b.children.filter(function(b){return!a.model.isStaged(b.type)&&h.isChange(b)}).length});return d},callback:function(b){a.model.getRoot(function(b){b=b.children.filter(function(b){return!a.model.isStaged(b.type)&&h.isChange(b)});a.commandService.runCommand("eclipse.orion.git.stageCommand",
b,a,null,a.status)})}}),d=new e.Command({tooltip:l["Deselect all"],imageClass:"core-sprite-check_on",id:"orion.explorer.deselectAllCommandChangeList",visibleWhen:function(b){var d=!1;a.model.getRoot(function(b){1<b.children.length&&(d=b.children.filter(function(b){return a.model.isStaged(b.type)}).length===Math.max(0,b.children.length-2))});return d},callback:function(b){a.model.getRoot(function(b){b=b.children.filter(function(b){return a.model.isStaged(b.type)});a.commandService.runCommand("eclipse.orion.git.unstageCommand",
b,a,null,a.status)})}}),f=new e.Command({tooltip:l.Commit,id:"eclipse.orion.git.precommitCommand",extraClass:"primaryButton",callback:function(b){var d=a.messageTextArea.value.trim();a.commandService.runCommand("eclipse.orion.git.commitCommand",b.items,b.handler,null,{name:d,amend:a.amendCheck.checked,changeId:a.changeIDCheck.checked})},visibleWhen:function(a){Array.isArray(a)||(a=[a]);f.name=n.formatMessage(l.SmartCountCommit,a.length);return!0}});this.commandService.addCommand(f);this.commandService.addCommand(b);
this.commandService.addCommand(d)}},createSelection:function(){if(!this.selection){this.selection=new d.Selection(this.registry,"orion.selection."+this.prefix+"Section");this.commandService.registerSelectionService(this.section.selectionNode.id,this.selection);var a=this.section,b=this.commandService,e=this;this.selection.addEventListener("selectionChanged",this._selectionListener=function(d){var f=a.selectionNode;f&&(b.destroy(f),b.renderCommands(a.selectionNode.id,f,d.selections,e,"button",{Clone:e.model.repository}));
"all"===e.prefix&&((d=a.titleActionsNode)&&b.destroy(d),b.renderCommands(d.id,d,e,e,"button"))})}},refreshSelection:function(){}});u.prototype=Object.create(k.SelectionRenderer.prototype);p.mixin(u.prototype,{getCellElement:function(a,d,e){var h,k,p,m=this.explorer;switch(a){case 0:h=document.createElement("td");a=document.createElement("div");a.className="sectionTableItem";h.appendChild(a);if("CommitMsg"===d.Type){e.classList.add("gitCommitListSection");k=document.createElement("div");k.id="gitCommitMessage";
k.className="gitCommitMessage toolComposite";h.colSpan=2;e.classList.remove("selectableNavRow");e=document.createElement("div");e.className="gitCommitMessageTopRow";var n=m.messageTextArea=document.createElement("textarea");n.rows=2;n.type="textarea";n.id="nameparameterCollector";n.placeholder=l.SmartCommit;n.classList.add("parameterInput");e.appendChild(n);n=document.createElement("div");n.className="gitCommitMessageBottomRow";var s=document.createElement("span");s.className="layoutRight parameters";
n.appendChild(s);var q=m.amendCheck=document.createElement("input");q.type="checkbox";q.id="amendparameterCollector";var u=b({serviceRegistry:m.registry,commandService:m.commandService}).amendEventListener;q.addEventListener(u.event,function(a){return u.handler(a,m)},u.capture);s.appendChild(q);var r=document.createElement("label");r.classList.add("parameterInput");r.setAttribute("for",q.id);r.textContent=l.SmartAmend;s.appendChild(r);q=m.changeIDCheck=document.createElement("input");q.type="checkbox";
q.id="changeIDparameterCollector";s.appendChild(q);r=document.createElement("label");r.classList.add("parameterInput");r.setAttribute("for",q.id);r.textContent=l.SmartChangeId;s.appendChild(r);k.appendChild(e);k.appendChild(n);a.appendChild(k)}else g.isChange(d)||"Diff"===d.Type?(this.getExpandImage(e,a),e=m.getNavDict()?m.getNavDict().getGridNavHolder(d,!0):null,p=document.createElement("span"),p.id=m.prefix+d.name+d.type+"DiffActionWrapper",p.className="sectionExplorerActions",a.appendChild(p),
m.commandService.destroy(p),m.commandService.renderCommands("DefaultActionWrapper",p,d,m,"tool",null,e),k=document.createElement("span"),k.className=m.model.getClass(d),k.commandTooltip=new f.Tooltip({node:k,text:m.model.getTooltip(d),position:["above","below","right","left"]}),a.appendChild(k),k=document.createElement("span"),k.textContent=d.name,a.appendChild(k)):"ExplorerSelection"===d.Type?(h.colSpan=2,k=document.createElement("span"),k.textContent=l.SelectAll,a.appendChild(k),k=document.createElement("div"),
k.className="layoutRight commandList",k.id=m.explorerSelectionScope,a.appendChild(k),m.commandService.renderCommands(k.id,k,m,m,"button")):(h.colSpan=2,e=document.createElement("div"),e.className="sectionExplorerActions",a.appendChild(e),p=document.createElement("span"),n=m.prefix+d.parent.name+d.parent.type,p.id=n+"DiffActionWrapperChange",e.appendChild(p),k=document.createElement("span"),k.id=n+"CompareWidgetActionWrapper",e.appendChild(k),n=document.createElement("div"),n.id="diffArea_"+d.DiffLocation,
n.style.height="420px",n.style.border="1px solid lightgray",n.style.overflow="hidden",a.appendChild(n),e=this.explorer.getNavDict()?this.explorer.getNavDict().getGridNavHolder(d,!0):null,g.createCompareWidget(m.registry,m.commandService,d.DiffLocation,"Conflicting"===d.parent.type,n,k.id,m.editableInComparePage,{navGridHolder:e,additionalCmdRender:function(a){m.commandService.destroy(p.id);m.commandService.renderCommands("itemLevelCommands",p.id,d.parent,m,"tool",!1,a)},before:!0}));return h}},onCheckedFunc:function(a,
b,d,e){"ExplorerSelection"===e.Type?b?this.explorer.commandService.runCommand("orion.explorer.selectAllCommandChangeList",this.explorer,this.explorer):this.explorer.commandService.runCommand("orion.explorer.deselectAllCommandChangeList",this.explorer,this.explorer):b?this.explorer.commandService.runCommand("eclipse.orion.git.stageCommand",[e],this.explorer):this.explorer.commandService.runCommand("eclipse.orion.git.unstageCommand",[e],this.explorer)},getCheckedFunc:function(a){return"ExplorerSelection"===
a.Type?!this.explorer.commandService.findCommand("orion.explorer.selectAllCommandChangeList").visibleWhen(this.explorer):this.explorer.model.isStaged(a.type)}});return{GitChangeListExplorer:s,GitChangeListRenderer:u,GitChangeListModel:q}});
define("orion/git/widgets/ConfirmPushDialog",["i18n!git/nls/gitmessages","orion/webui/dialog"],function(l,n){function m(k){this._init(k)}m.prototype=new n.Dialog;m.prototype.TEMPLATE='\x3cdiv id\x3d"header"\x3e\x3c/div\x3e';m.prototype._init=function(k){var g=this;this.title="Git Push";this.modal=!0;this.messages=l;this.location=k.location;this.moreCallback=k.moreCallback;this.func=k.func;this._afterHiding=k.closeCallback;this.buttons=[];this.moreCallback&&this.buttons.push({callback:function(){g.destroy();
g.moreCallback()},text:"More"});this.buttons.push({callback:function(){g.destroy();g.func()},text:"OK"});this._initialize()};m.prototype._bindToDom=function(k){k=this.$header;k.appendChild(document.createTextNode("You are going to push to the following remote: "+this.location));k.appendChild(document.createElement("br"));this.moreCallback&&k.appendChild(document.createTextNode(" Click More to push to another remote or OK to push to default."))};m.prototype.constructor=m;return{ConfirmPushDialog:m}});
define("orion/git/widgets/RemotePrompterDialog",["i18n!git/nls/gitmessages","orion/webui/dialog","orion/explorers/explorer","orion/selection"],function(l,n,m,k){function g(d,a){this.explorer=a;this._init(d)}function h(d){this._init(d)}var f=function(){function d(a,d,b,f){this.gitClient=a;this.rootPath=d;this.fetchItems=b;this.root=f?f:null}d.prototype=new m.ExplorerModel;d.prototype.getRoot=function(a){var d=this;this.root?a(this.root):this.fetchItems(this.rootPath).then(function(b){d.root=b;a(b)})};
d.prototype.getIdentity=function(a){a.Location?(a=a.Location,a=a.replace(/[^\.\:\-\_0-9A-Za-z]/g,"")):a="ROOT";return a};d.prototype.getChildren=function(a,d){a.children=[];if(a.Children){for(var b=0;b<a.Children.length;b++)a.Children[b].parent=a,a.children[b]=a.Children[b];d(a.Children)}else a.BranchLocation&&a.RemoteLocation?(a.children=[{GroupNode:"true",Location:a.BranchLocation,Name:"Branches",parent:a},{GroupNode:"true",Location:a.RemoteLocation,BranchLocation:a.BranchLocation,Name:"Remotes",
parent:a},{GroupNode:"true",Location:a.TagLocation,Name:"Tags",parent:a}],d(a.children)):a.GroupNode?this.gitClient.getGitBranch(a.Location).then(function(b){a.children=b.Children;for(var f=0;f<b.Children.length;f++)b.Children[f].parent=a;d(b.Children)}):"Remote"===a.Type&&this.gitClient.getGitBranch(a.Location).then(function(b){a.children=b.Children;for(var f=0;f<b.Children.length;f++)b.Children[f].parent=a;d(b.Children)})};return d}();g.prototype=new m.SelectionRenderer;g.prototype.constructor=
g;g.prototype.getLabelColumnIndex=function(){return 0};g.prototype.getCellElement=function(d,a,e){var b=document.createElement("td");e.appendChild(b);d=document.createElement("span");d.id=e.id+"navSpan";b.appendChild(d);d.className="mainNavColumn singleNavColumn";(a.children||a.Children||a.GroupNode||"Remote"===a.Type||a.BranchLocation&&a.RemoteLocation)&&this.getExpandImage(e,d);e=a.Name;"RemoteTrackingBranch"===a.Type&&!a.Id&&(e=a.Name+l[" [New branch]"]);d.appendChild(document.createTextNode(e))};
h.prototype=new n.Dialog;h.prototype.TEMPLATE='\x3cdiv\x3e\x3cdiv id\x3d"treeContentPane" style\x3d"width:25em; min-height: 25em; max-height: 30em; height: auto; overflow-y: auto; padding: 8px"\x3e\x3c/div\x3e\x3cdiv id\x3d"newBranchPane" style\x3d"padding: 8px"\x3e\x3clabel for\x3d"newBranch"\x3e${New Branch:}\x3c/label\x3e\x3cinput id\x3d"newBranch" value\x3d"" disabled\x3dtrue/\x3e\x3c/div\x3e\x3c/div\x3e';h.prototype._init=function(d){var a=this;this.title=d.title||l["Choose a Folder"];this.modal=
!0;this.messages=l;this.func=d.func;this.treeRoot=d.treeRoot;this.gitClient=d.gitClient;this.hideNewBranch=d.hideNewBranch;this.serviceRegistry=d.serviceRegistry;this._afterHiding=d.closeCallback;this.buttons=[];this.buttons.push({callback:function(){a.$remoteOk.classList.contains(this.DISABLED)||(a.destroy(),a._execute.bind(a)())},text:"OK",isDefault:!0,id:"remoteOk"});this._initialize()};h.prototype._bindToDom=function(d){var a=this;this.$newBranch.addEventListener("input",function(d){a._validate()});
this.$newBranch.placeholder=l["No remote selected"];this.hideNewBranch&&(this.$newBranchPane.style.display="none")};h.prototype._beforeShowing=function(){this._loadRemoteChildren()};h.prototype._afterShowing=function(){this.$treeContentPane.focus();this._validate()};h.prototype._loadRemoteChildren=function(){var d=new f(this.gitClient,null,this.gitClient.getGitClone,this.treeRoot);this._createTree(d)};h.prototype._createTree=function(d){var a=this,e=this.serviceRegistry.getService("orion.remotePrompter.selection");
e||(e=new k.Selection(this.serviceRegistry,"orion.remotePrompter.selection"));var b=new g({checkbox:!1,singleSelection:!0,treeTableClass:"directoryPrompter"});this.explorer=new m.Explorer(this.serviceRegistry,e,b);b.explorer=this.explorer;this.explorer.createTree("treeContentPane",d);e.addEventListener("selectionChanged",function(b){b.selection&&"Remote"===b.selection.Type?(a.$newBranch.disabled=!1,a.$newBranch.placeholder=l["Enter a name..."]):(a.$newBranch.disabled=!0,a.$newBranch.placeholder=l["No remote selected"]);
a._validate(b.selection)})};h.prototype._validate=function(d){var a=function(a){a&&"RemoteTrackingBranch"===a.Type?this.$remoteOk.classList.remove(this.DISABLED):a&&"Remote"===a.Type&&""!==this.$newBranch.value?this.$remoteOk.classList.remove(this.DISABLED):this.$remoteOk.classList.add(this.DISABLED)};d?a.bind(this)(d):this.serviceRegistry.getService("orion.remotePrompter.selection").getSelection(a.bind(this))};h.prototype._execute=function(){var d=this;this.serviceRegistry.getService("orion.remotePrompter.selection").getSelection(function(a){if(d.func)if("RemoteTrackingBranch"===
a.Type)d.func(a,a.parent);else{var e=a.CloneLocation.substring(a.CloneLocation.indexOf(a.CloneLocation.split("/")[3])),b={};b.parent=a;b.FullName="refs/remotes/"+a.Name+"/"+d.$newBranch.value;b.Name=a.Name+"/"+d.$newBranch.value;b.Type="RemoteTrackingBranch";b.Location="/gitapi/remote/"+a.Name+"/"+encodeURIComponent(encodeURIComponent(d.$newBranch.value))+"/"+e;d.func(null,a,b)}})};h.prototype.constructor=h;return{RemotePrompterDialog:h}});
define("orion/git/logic/gitPush","i18n!git/nls/gitmessages orion/commandRegistry orion/git/widgets/ConfirmPushDialog orion/git/gitPreferenceStorage orion/git/logic/gitCommon orion/Deferred orion/git/widgets/RemotePrompterDialog".split(" "),function(l,n,m,k,g,h,f){var d=g.handleGitServiceResponse,a=g.handleProgressServiceResponse,e=g.gatherSshCredentials;return function(b){var g=b.serviceRegistry,q=b.commandService,s=b.tags,u=b.force,w=b.gerrit,x=b.confirmDialogCloseCallback,y=b.remotePrompterDialogCloseCallback,
r=b.sshCredentialsDialogCloseCallback,t=b.sshSlideoutCloseCallback,z=function(b,d,e){var k=new h,m=new h,n=g.getService("orion.git.provider"),s=g.getService("orion.page.progress");1===d.RemoteLocation.length&&d.RemoteLocation[0].Children&&1===d.RemoteLocation[0].Children.length?m=s.progress(n.getGitRemote(b.RemoteLocation),"Getting git remote details "+d.Name):m.resolve({Children:d.RemoteLocation});m.then(function(h){var m=function(b){a(b,{},g);k.reject(b)};(new f.RemotePrompterDialog({title:l["Choose Branch"],
serviceRegistry:g,gitClient:n,closeCallback:function(){k.reject()},treeRoot:{Children:h.Children},hideNewBranch:!1,func:function(a,f,g){var h;h=null===a?g:a;if(void 0===e||e){var l="branch."+d.Name+".remote";s.progress(n.addCloneConfigurationProperty(b.ConfigLocation,l,h.parent.Name),"Adding git configuration property "+d.Name).then(function(){k.resolve(h)},function(a){409===a.status?n.getGitCloneConfig(b.ConfigLocation).then(function(a){if(a.Children)for(var b=0;b<a.Children.length;b++)if(a.Children[b].Key===
l){s.progress(n.editCloneConfigurationProperty(a.Children[b].Location,h.parent.Name),"Updating configuration property "+h.parent.Name).then(function(){k.resolve(h)},m);break}},m):m(a)})}else k.resolve(h)}})).show()});return k};return{perform:function(a){function b(a){var h=a.targetBranch,t=a.confirmedWarnings;if(u&&!t)if(confirm(l["You're going to override content of the remote branch. This can cause the remote repository to lose commits."]+"\n\n"+l["Are you sure?"]))t=a.confirmedWarnings=!0;else{f.reject();
return}var r=a.items;r.LocalBranch&&r.RemoteBranch&&(h=r.RemoteBranch,r=r.LocalBranch);r.toRef&&(r=r.toRef);a.command||(a.command={},a.command.callback=b);var x=function(a,b){a.JsonData.HostKey?(b.parameters=null,b.errorData=a.JsonData,b.errorData.failedOperation=a.failedOperation,q.collectParameters(b,E)):b.optionsRequested?(b.errorData=a.JsonData,b.errorData.failedOperation=a.failedOperation,q.collectParameters(b,E)):(new k(g)).isEnabled().then(function(d){b.parameters=d?a.JsonData.User?new n.ParametersDescription([new n.CommandParameter("sshpassword",
"password",l["Password:"]),new n.CommandParameter("saveCredentials","boolean",l["Don't prompt me again:"])],{hasOptionalParameters:!0}):new n.ParametersDescription([new n.CommandParameter("sshuser","text",l["User Name:"]),new n.CommandParameter("sshpassword","password",l["Password:"]),new n.CommandParameter("saveCredentials","boolean",l["Don't prompt me again:"])],{hasOptionalParameters:!0}):a.JsonData.User?new n.ParametersDescription([new n.CommandParameter("sshpassword","password",l["Password:"])],
{hasOptionalParameters:!0}):new n.ParametersDescription([new n.CommandParameter("sshuser","text",l["User Name:"]),new n.CommandParameter("sshpassword","password",l["Password:"])],{hasOptionalParameters:!0});b.errorData=a.JsonData;b.errorData.failedOperation=a.failedOperation;q.collectParameters(b,E)})};if(a.parameters&&a.parameters.optionsRequested)a.parameters=null,a.optionsRequested=!0,q.collectParameters(a,E);else{var B=g.getService("orion.git.provider"),P=g.getService("orion.page.progress");a.errorData&&
a.errorData.failedOperation&&P.removeOperation(a.errorData.failedOperation);var J=function(b,e,h,k,m){var n=g.getService("orion.page.message");b=P.progress(B.doPush(e,h,s,m,b.gitSshUsername,b.gitSshPassword,b.knownHosts,b.gitPrivateKey,b.gitPassphrase),l["Pushing remote: "]+k);n.createProgressMonitor(b,l["Pushing remote: "]+k);b.then(function(b){d(b,g,function(){f.resolve()},function(b){x(b,a)})},function(b){d(b,g,function(){f.resolve()},function(b){x(b,a)})})};P.progress(B.getGitClone(r.CloneLocation),
"Getting git repository details "+r.Name).then(function(b){var d=b.Children[0];e(g,a,null,D).then(function(b){if(h)J(b,h.Location,"HEAD",h.Name,u);else{var e=function(){z(d,r).then(function(d){a.targetBranch=d;a.items.RemoteLocation=d.parent;J(b,d.Location,"HEAD",d.Name,u)},function(){"function"===typeof y&&y();f.reject()})};if(1===r.RemoteLocation.length&&r.RemoteLocation[0].Children&&1===r.RemoteLocation[0].Children.length){var k=r.RemoteLocation[0].Children[0],n=r.Name;if(w){var s=r.RemoteLocation[0].Children[0].Location.split("/"),
n="refs/for/master";s[4]=encodeURIComponent(encodeURIComponent(n));s=s.join("/");k.Location=s;k.Name=n}(new m.ConfirmPushDialog({title:l["Choose Branch"],serviceRegistry:g,gitClient:B,moreCallback:function(){e()},location:k.Name,func:function(){a.targetBranch=k;J(b,k.Location,"HEAD",n,u)},closeCallback:C})).show()}else e()}})})}}var f=new h,C=function(){"function"===typeof x&&x();f.reject()},D=function(){"function"===typeof r&&r();f.reject()},E=function(){"function"===typeof t&&t();f.reject()};b(a);
return f},chooseRemote:z}}});
define("orion/git/widgets/gitCommitInfo","require i18n!git/nls/gitmessages orion/URITemplate orion/i18nUtil orion/git/util orion/objects".split(" "),function(l,n,m,k,g,h){function f(a){this.parent=a.parent;this.commit=a.commit;this.showTags=a.showTags;this.commitLink=a.commitLink}var d=new m("git/git-commit.html#{,resource,params*}?page\x3d1\x26pageSize\x3d1");h.mixin(f.prototype,{display:function(){var a=this.commit,e=this.parent,b=a.Message.split(/(\r?\n|$)/)[0],f;this.commitLink?(f=document.createElement("a"),
f.className="navlinkonpage",f.href=l.toUrl(d.expand({resource:a.Location}))):f=document.createElement("span");f.appendChild(document.createTextNode(g.trimCommitMessage(b)));e.appendChild(f);b=document.createElement("div");b.style.paddingTop="15px";e.appendChild(b);a.AuthorImage&&(e=new Image,e.src=a.AuthorImage,e.name=a.AuthorName,e.className="git-author-icon",b.appendChild(e));e=document.createElement("div");e.textContent=k.formatMessage(n[" authored by ${0} {${1}) on ${2}"],a.AuthorName,a.AuthorEmail,
(new Date(a.Time)).toLocaleString());b.appendChild(e);e=document.createElement("div");e.textContent=k.formatMessage(n["committed by 0 (1)"],a.CommitterName,a.CommitterEmail);b.appendChild(e);e=document.createElement("div");e.style.paddingTop="15px";e.textContent=n["commit:"]+a.Name;b.appendChild(e);e=g.getGerritFooter(a.Message);e.changeId&&(f=document.createElement("div"),f.style.paddingTop="15px",f.textContent=n["Change-Id: "]+e.changeId,b.appendChild(f));e.signedOffBy&&(f=document.createElement("div"),
f.textContent=n["Signed-off-by: "]+e.signedOffBy,b.appendChild(f));if(a.Parents&&0<a.Parents.length){f=document.createElement("div");f.textContent=n["parent:"];if(e.signedOffBy||e.changeId)f.style.paddingTop="15px";e=document.createElement("a");e.className="navlinkonpage";e.href=l.toUrl(d.expand({resource:a.Parents[0].Location}));e.textContent=a.Parents[0].Name;f.appendChild(e);b.appendChild(f)}f=this.showTags&&a.Tags&&0<a.Tags.length;if(a.Branches&&0<a.Branches.length){e=document.createElement("section");
e.style.paddingTop="15px";e.textContent=n["branches: "];b.appendChild(e);var h=document.createElement("div");e.appendChild(h);for(e=0;e<a.Branches.length;++e){var m=document.createElement("span");m.style.paddingLeft="10px";m.textContent=a.Branches[e].FullName;h.appendChild(m)}}if(f){e=document.createElement("div");e.style.paddingTop="15px";b.appendChild(e);e=document.createElement("section");b.appendChild(e);b=document.createElement("span");b.textContent=n["tags: "];e.appendChild(b);b=document.createElement("div");
e.appendChild(b);for(e=0;e<a.Tags.length;++e)f=document.createElement("span"),f.style.paddingLeft="10px",f.textContent=a.Tags[e].Name,b.appendChild(f)}}});return{GitCommitInfo:f}});
define("orion/git/widgets/CommitTooltipDialog",["orion/git/widgets/gitCommitInfo","orion/webui/popupdialog"],function(l,n){function m(k){this._init(k)}m.prototype=new n.PopupDialog;m.prototype.TEMPLATE='\x3cdiv id\x3d"parentPane" style\x3d"padding:10px; width:520px"\x3e\x3c/div\x3e';m.prototype._init=function(k){this.commit=k.commit;this._initialize(k.triggerNode,null,null,"mouseover",1E3)};m.prototype._bindToDom=function(k){this._displayCommit(this.commit)};m.prototype._displayCommit=function(k){(new l.GitCommitInfo({parent:this.$parentPane,
commit:k,showTags:!0,commitLink:!0})).display()};m.prototype.constructor=m;return{CommitTooltipDialog:m}});
define("orion/git/widgets/gitCommitList","require i18n!git/nls/gitmessages orion/commands orion/Deferred orion/explorers/explorer orion/URITemplate orion/git/util orion/commonHTMLFragments orion/git/logic/gitPush orion/i18nUtil orion/explorers/navigationUtils orion/git/widgets/CommitTooltipDialog orion/webui/littlelib orion/objects".split(" "),function(l,n,m,k,g,h,f,d,a,e,b,p,q,s){function u(a){this.root=a.root;this.section=a.section;this.location=a.location;this.handleError=a.handleError;this.repository=
a.repository;this.progressService=a.progressService;this.statusService=a.statusService;this.gitClient=a.gitClient;this.progressService=a.progressService;this.legacyLog=a.legacyLog;this.logDeferred=new k}function w(a){var b=new x({registry:a.serviceRegistry,commandService:a.commandRegistry,actionScopeId:a.actionScopeId,cachePrefix:"LogNavigator",checkbox:!1},this);g.Explorer.call(this,a.serviceRegistry,a.selection,b,a.commandRegistry);this.checkbox=!1;this.parentId=a.parentId;this.actionScopeId=a.actionScopeId;
this.section=a.section;this.root=a.root;this.handleError=a.handleError;this.location=a.location;this.gitClient=a.gitClient;this.progressService=a.progressService;this.statusService=a.statusService;this.legacyLog=a.legacyLog;this.incomingActionScope="IncomingActions";this.outgoingActionScope="OutgoingActions";this.syncActionScope="SynchronizedActions";this.createCommands()}function x(){g.SelectionRenderer.apply(this,arguments)}var y=new h("git/git-commit.html#{,resource,params*}?page\x3d1\x26pageSize\x3d1");
u.prototype=Object.create(g.Explorer.prototype);s.mixin(u.prototype,{destroy:function(){},getRoot:function(a){a(this.root)},_getRepository:function(){var a=this;return k.when(a.log||a._getLog(),function(b){return a.progressService.progress(a.gitClient.getGitClone(b.CloneLocation),"Getting repository details for "+b.Name).then(function(d){d=d.Children[0];b.Clone=d;b.ContentLocation=d.ContentLocation;return a.root.repository=d})},function(b){a.handleError(b)})},_getLog:function(){var a=this,b=a.location?
n["Getting git log"]:e.formatMessage(n['Getting commits for "${0}" branch'],a.currentBranch.Name);return a.progressService.progress(a.gitClient.doGitLog(a.location||a.currentBranch.CommitLocation+"?page\x3d1\x26pageSize\x3d20"),b).then(function(d){return a.location&&"RemoteTrackingBranch"===d.Type?a.progressService.progress(a.gitClient.doGitLog(d.CommitLocation),b).then(function(b){return a.log=b},function(b){a.handleError(b)}):a.log=d},function(b){a.handleError(b)})},_getOutgoing:function(){var a=
this,b=this.getLocalBranch(),d=this.getRemoteBranch().CommitLocation+(a.log?a.log.RepositoryPath:"");return a.progressService.progress(a.gitClient.getLog(d+"?page\x3d1\x26pageSize\x3d20",b.Name),n["Getting outgoing commits"]).then(function(b){return a.outgoingCommits=b.Children})},_getIncoming:function(){var a=this,b=this.getLocalBranch(),d=this.getRemoteBranch();return a.progressService.progress(a.gitClient.getLog(b.CommitLocation+(a.log?a.log.RepositoryPath:"")+"?page\x3d1\x26pageSize\x3d20",d.Name),
n["Getting git incoming changes..."]).then(function(b){return a.incomingCommits=b.Children})},getLocalBranch:function(){var a=this.log?this.log.toRef:this.currentBranch;return"RemoteTrackingBranch"===a.Type?(this.tracksRemoteBranch(),this.localBranch):a},getRemoteBranch:function(){if(this.remoteBranch)return this.remoteBranch;var a=this.log?this.log.toRef:this.currentBranch;return"RemoteTrackingBranch"===a.Type?a:a.RemoteLocation[0].Children[a.RemoteLocation[0].Children.length-1]},tracksRemoteBranch:function(){if(this.remoteBranch&&
this.isNewBranch(this.remoteBranch))return!1;var a=this.log&&this.log.toRef||this.currentBranch;if(a&&"RemoteTrackingBranch"===a.Type&&this.root.repository&&this.root.repository.Branches){var b=!1,d=this;this.root.repository.Branches.some(function(e){return e.RemoteLocation&&(1===e.RemoteLocation.length&&1===e.RemoteLocation[0].Children.length)&&e.RemoteLocation[0].Children[0].Name===a.Name?(d.localBranch=e,b=!0):!1});return b}return a&&a.RemoteLocation&&1===a.RemoteLocation.length&&1===a.RemoteLocation[0].Children.length},
isRebasing:function(){var a=this.root.repository;return a&&a.status&&"REBASING_INTERACTIVE"===a.status.RepositoryState},isNewBranch:function(a){return"RemoteTrackingBranch"===a.Type&&!a.Id},getChildren:function(a,b){var d=this,f=this.tracksRemoteBranch();if(a instanceof Array&&0<a.length)b(a);else if(a.children)b(a.children);else if("CommitRoot"===a.Type){var g=this.section,h=g.createProgressMonitor();h.begin(n["Getting git log"]);k.when(a.repository||d._getRepository(),function(f){var l=e.formatMessage(n.GettingCurrentBranch,
f.Name);h.worked(l);k.when(d.Branches||d.progressService.progress(d.gitClient.getGitBranch(f.BranchLocation+"?commits\x3d0"),l),function(l){var m;l=l.Children||l;l.some(function(a){return a.Current?(m=a,!0):!1});d.currentBranch=m;if(!d.currentBranch||!m.RemoteLocation[0])d.isRebasing()?(g.setTitle(n.RebaseProgress),b([])):(g.setTitle(n.NoBranch),b(d.processChildren(a,[]))),h.done();else{f.ActiveBranch=m.CommitLocation;d.Branches=l;l=d.getLocalBranch();var p=d.getRemoteBranch();l&&!d.legacyLog?g.setTitle(e.formatMessage(n['Commits for "${0}" branch against'],
l.Name)):g.setTitle(e.formatMessage(n['Commits for "${0}" branch'],p.Name));h.done();if(d.legacyLog)return k.when(d.log||d._getLog(),function(e){a.log=e;d.logDeferred.resolve(e);b(d.processChildren(a,e.Children))},function(a){d.handleError(a)});b(d.processChildren(a,[{Type:"Outgoing",localBranch:l,remoteBranch:p},{Type:"Incoming",localBranch:l,remoteBranch:p},{Type:"Synchronized"}]))}},function(a){h.done();d.handleError(a)})},function(a){h.done();d.handleError(a)})}else if("Incoming"===a.Type)if(f)k.when(d.incomingCommits||
d._getIncoming(),function(e){b(d.processChildren(a,e))},function(a){d.handleError(a)});else return k.when(d.log||d._getLog(),function(e){var f=[];"RemoteTrackingBranch"===e.toRef.Type&&(f=e.Children);b(d.processChildren(a,f))},function(a){d.handleError(a)});else if("Outgoing"===a.Type)if(f)k.when(d.outgoingCommits||d._getOutgoing(),function(e){b(d.processChildren(a,e))},function(a){d.handleError(a)});else return k.when(d.log||d._getLog(),function(e){var f=[];"Branch"===e.toRef.Type&&(f=e.Children);
b(d.processChildren(a,f))},function(a){d.handleError(a)});else if("Synchronized"===a.Type){if(f)return k.when(d.log||d._getLog(),function(e){a.log=e;d.logDeferred.resolve(e);k.when("RemoteTrackingBranch"===e.toRef.Type?d.incomingCommits||d._getIncoming():d.outgoingCommits||d._getOutgoing(),function(f){var g=[];e.Children.forEach(function(a){f.some(function(b){return b.Name===a.Name})||g.push(a)});b(d.processChildren(a,g))},function(a){d.handleError(a)})},function(a){d.handleError(a)});b(d.processChildren(a,
[]))}else b([])},getId:function(a){return a.Name||a.Type},processChildren:function(a,b){0===b.length&&(b=[{Type:"NoCommits"}]);b.forEach(function(b){b.parent=a});return a.children=b}});w.prototype=Object.create(g.Explorer.prototype);s.mixin(w.prototype,{changedItem:function(a){var b=new k,d=this,e=this.model;a||e.getRoot(function(b){a=b});"CommitRoot"===a.Type&&(e.incomingCommits=e.outgoingCommits=null);a.children=e.log=null;e.logDeferred=new k;var f=this.section.createProgressMonitor();f.begin(n["Getting git log"]);
e.getChildren(a,function(e){a.removeAll=!0;d.myTree.refresh.bind(d.myTree)(a,e,!1);d.expandSections(e);"Synchronized"===a.Type?d.updatePageCommands(a):d.updateCommands();f.done();b.resolve(e)});return b},display:function(){var a=this,b=new k,d=new u({root:this.root,registry:this.registry,progressService:this.progressService,statusService:this.statusService,gitClient:this.gitClient,section:this.section,location:this.location,handleError:this.handleError,legacyLog:this.legacyLog});this.createTree(this.parentId,
d,{onComplete:function(){a.status=d.status;var e=function(){a.model.getRoot(function(b){a.model.getChildren(b,function(b){a.expandSections(b)})});a.updateCommands();b.resolve(d.log)};a.fetch().then(e,e)}});return b},expandSections:function(a){!this.legacyLog&&(!this.model.isRebasing()&&2<a.length)&&(this.myTree.expand(this.model.getId(a[0])),this.myTree.expand(this.model.getId(a[1])),this.location&&this.myTree.expand(this.model.getId(a[2])))},createCommands:function(){var b=this,d=this.commandService,
e=new m.Command({name:n["Next Page \x3e"],tooltip:n["Show next page of git log"],id:"eclipse.orion.git.commit.nextPage",callback:function(a){var b=a.items;b.log&&(a.handler.model.location=b.log.NextLocation,a.handler.changedItem(b))},visibleWhen:function(a){return!!a.log.NextLocation}});d.addCommand(e);e=new m.Command({name:n["\x3c Previous Page"],tooltip:n["Show previous page of git log"],id:"eclipse.orion.git.commit.previousPage",callback:function(a){var b=a.items;b.log&&(a.handler.model.location=
b.log.PreviousLocation,a.handler.changedItem(b))},visibleWhen:function(a){return!!a.log.PreviousLocation}});d.addCommand(e);var f=new m.Command({name:n["Choose Branch"],tooltip:n["Choose the remote branch."],id:"eclipse.orion.git.commit.chooseBranch",callback:function(b){var d=b.handler,e=d.model;a({serviceRegistry:d.registry,commandService:d.commandService}).chooseRemote(e.root.repository,e.log?e.log.toRef:e.currentBranch).then(function(a){var d=b.handler.model;d.remoteBranch=a;d.getRoot(function(a){b.handler.changedItem(a)})})},
visibleWhen:function(a){var d=a.Name;b.model.isNewBranch(a)&&(d+=n[" [New branch]"]);f.name=d;return!0}});d.addCommand(f)},fetch:function(){var a=this.model;if(a.tracksRemoteBranch()&&!this.legacyLog&&!a.isRebasing()){var b=this.commandService,d=a.getRemoteBranch(),a=a.getLocalBranch();return b.runCommand("eclipse.orion.git.fetch",{LocalBranch:a,RemoteBranch:d,noAuth:!0},this)}return(new k).resolve()},updateCommands:function(){var a=this.model,b=a.currentBranch,d=this.root.repository,e=this.commandService,
f=this.section,g=f.actionsNode.id,f=f.titleLeftActionsNode.id;if(!b&&a.isRebasing())e.registerCommandContribution(g,"eclipse.orion.git.resetCommand",100),e.registerCommandContribution(g,"eclipse.orion.git.rebaseContinueCommand",200),e.registerCommandContribution(g,"eclipse.orion.git.rebaseSkipPatchCommand",300),e.registerCommandContribution(g,"eclipse.orion.git.rebaseAbortCommand",400),e.renderCommands(g,g,d.status,this,"button");else if(b&&!this.legacyLog){b=this.incomingActionScope;d=this.outgoingActionScope;
q.node(g)&&e.destroy(g);q.node(f)&&e.destroy(f);q.node(b)&&e.destroy(b);q.node(d)&&e.destroy(d);var h=a.tracksRemoteBranch(),k=a.getLocalBranch(),a=a.getRemoteBranch();h&&(e.registerCommandContribution(b,"eclipse.orion.git.fetch",100),e.registerCommandContribution(b,"eclipse.orion.git.merge",300),e.registerCommandContribution(b,"eclipse.orion.git.rebase",200),e.registerCommandContribution(b,"eclipse.orion.git.resetIndex",400),a.GitUrl=k.RemoteLocation[0].GitUrl,e.renderCommands(b,b,a,this,"button"),
e.registerCommandContribution(g,"eclipse.orion.git.sync",100),e.renderCommands(g,g,{LocalBranch:k,RemoteBranch:a},this,"button"));e.registerCommandContribution(f,"eclipse.orion.git.commit.chooseBranch",100);e.renderCommands(f,f,a,this,"button");e.addCommandGroup(d,"eclipse.gitPushGroup",1E3,"Push",null,null,null,"Push",null,"eclipse.orion.git.push");e.registerCommandContribution(d,"eclipse.orion.git.push",1100,"eclipse.gitPushGroup");e.registerCommandContribution(d,"eclipse.orion.git.pushBranch",
1200,"eclipse.gitPushGroup");e.registerCommandContribution(d,"eclipse.orion.git.pushToGerrit",1200,"eclipse.gitPushGroup");e.renderCommands(d,d,{LocalBranch:k,RemoteBranch:a},this,"button")}},updatePageCommands:function(a){var b=this;this.model.logDeferred.then(function(){var d=b.commandService;q.node(b.syncActionScope)&&d.destroy(b.syncActionScope);d.registerCommandContribution(b.syncActionScope,"eclipse.orion.git.commit.nextPage",200);d.registerCommandContribution(b.syncActionScope,"eclipse.orion.git.commit.previousPage",
100);d.renderCommands(b.syncActionScope,b.syncActionScope,a,b,"button")})}});x.prototype=Object.create(g.SelectionRenderer.prototype);s.mixin(x.prototype,{getCellElement:function(a,e,g){var h=this.explorer;switch(a){case 0:a=document.createElement("td");var k=document.createElement("div");a.appendChild(k);var m=document.createElement("div");m.style.overflow="hidden";k.appendChild(m);if("Commit"!==e.Type){if("NoCommits"!==e.Type){k.className="gitCommitSectionTableItem";k=document.createElement("div");
k.style.display="inline-block";k.style.styleFloat="left";k.style.cssFloat="left";var s=this.getExpandImage(g,k);"Synchronized"===e.Type&&s.addEventListener("click",function(){h.updatePageCommands(e)});m.appendChild(k);g.classList.add("gitCommitListSection")}else g.classList.add("gitCommitListNoCommit"),k.classList.add("sectionTableItem");g=document.createElement("div");g.className="stretch";m.appendChild(g);k=document.createElement("div");k.textContent=n[e.Type];"NoCommits"!==e.Type&&k.classList.add("gitCommitListSectionTitle");
g.appendChild(k);g=document.createElement("ul");g.className="layoutRight commandList";g.id=e.Type+"Actions";m.appendChild(g);m.classList.add("toolComposite");g=d.slideoutHTMLFragment(g.id);k=document.createElement("div");k.innerHTML=g;m.appendChild(k)}else{k.className="sectionTableItem";e.AuthorImage&&(g=document.createElement("div"),g.style["float"]="left",k=new Image,k.src=e.AuthorImage,k.name=e.AuthorName,k.className="git-author-icon",g.appendChild(k),m.appendChild(g));g=document.createElement("div");
g.className="stretch";m.appendChild(g);k=document.createElement("a");k.className="navlinkonpage";k.href=l.toUrl(y.expand({resource:e.Location}));k.textContent=f.trimCommitMessage(e.Message);g.appendChild(k);b.addNavGrid(this.explorer.getNavDict(),e,k);new p.CommitTooltipDialog({commit:e,triggerNode:k});k=document.createElement("div");g.appendChild(k);k=document.createElement("div");k.textContent=n[" (SHA "]+e.Name+n[") by "]+e.AuthorName+n[" on "]+(new Date(e.Time)).toLocaleString();g.appendChild(k);
var q=document.createElement("div");q.textContent=n["Tags:"];q.className="gitCommitListTagsTitle";e.Tags&&e.Tags.length?e.Tags.forEach(function(a){var b=document.createElement("span");b.textContent=a.Name;b.className="gitCommitListTag";q.appendChild(b);var d=document.createElement("span");d.className="core-sprite-close gitCommitListTagClose";d.addEventListener("click",function(){h.commandService.runCommand("eclipse.removeTag",a,h)});b.appendChild(d)}):(k=document.createElement("span"),k.textContent=
n.None,q.className="gitCommitListNoTag",q.appendChild(k));g.appendChild(q);g=document.createElement("ul");g.className="layoutRight commandList";g.id="itemLevelCommands";m.appendChild(g);h.commandService.renderCommands("itemLevelCommands",g,e,h,"tool")}return a}},emptyCallback:function(a){var b=document.createElement("tr"),d=document.createElement("td");d.colSpan=1;var e=document.createElement("div");e.classList.add("sectionTableItem");if(this.explorer.model.isRebasing())e.style.whiteSpace="pre",e.appendChild(document.createTextNode(n.RebaseProgressDetails));
else{var f=document.createElement("div");f.textContent=n["The branch is up to date."];e.appendChild(f);f=document.createElement("div");f.textContent=n["You have no outgoing or incoming commits."];e.appendChild(f)}d.appendChild(e);b.appendChild(d);a.appendChild(b)}});return{GitCommitListExplorer:w,GitCommitListRenderer:x}});
define("orion/git/widgets/gitBranchList","i18n!git/nls/gitmessages orion/explorers/explorer orion/URITemplate orion/i18nUtil orion/Deferred orion/objects".split(" "),function(l,n,m,k,g,h){function f(a){this.root=a.root;this.registry=a.registry;this.handleError=a.handleError;this.section=a.section;this.progressService=a.progressService;this.gitClient=a.gitClient}function d(b){var d=new a({registry:b.serviceRegistry,commandService:b.commandRegistry,actionScopeId:b.actionScopeId,cachePrefix:b.prefix+
"Navigator",checkbox:!1},this);n.Explorer.call(this,b.serviceRegistry,b.selection,d,b.commandRegistry);this.checkbox=!1;this.parentId=b.parentId;this.actionScopeId=b.actionScopeId;this.root=b.root;this.section=b.section;this.handleError=b.handleError;this.gitClient=b.gitClient;this.progressService=b.progressService}function a(a){n.SelectionRenderer.apply(this,arguments);this.registry=a.registry}var e=new m("git/git-repository.html#{,resource,params*}");f.prototype=Object.create(n.Explorer.prototype);
h.mixin(f.prototype,{destroy:function(){},getRoot:function(a){a(this.root)},getChildren:function(a,d){var e=this,f,h;if("LocalRoot"===a.Type){f=this.section.createProgressMonitor();var m=a.repository||a.parent.repository;h=k.formatMessage(l["Getting remote branches"],m.Name);f.begin(h);g.when(m.Branches||this.progressService.progress(this.gitClient.getGitBranch(m.BranchLocation+("full"===e.root.mode?"?commits\x3d1":"?commits\x3d1\x26page\x3d1\x26pageSize\x3d5")),h),function(g){f.done();d(e.processChildren(a,
g.Children||g))},function(a){f.done();e.handleError(a)})}else"RemoteRoot"===a.Type?(f=this.section.createProgressMonitor(),h=k.formatMessage(l["Getting remote branches"],a.repository.Name),this.progressService.progress(this.gitClient.getGitRemote(a.repository.RemoteLocation),h).then(function(g){f.done();g=g.Children;g.unshift({Type:"LocalRoot",Name:l.Local});d(e.processChildren(a,g));0===g.length&&this.section.setTitle(l["No Remote Branches"])},function(a){f.done();e.handleError(a)})):"Remote"===
a.Type?(f=this.section.createProgressMonitor(),h=k.formatMessage(l["Getting remote branches"],a.Name),f.begin(h),this.progressService.progress(this.gitClient.getGitRemote(a.Location),h).then(function(g){f.done();d(e.processChildren(a,g.Children))},function(a){f.done();e.handleError(a)})):d([])},processChildren:function(a,d){d.forEach(function(d){d.parent=a});return a.children=d},getId:function(a){return"LocalRoot"===a.Type?"LocalRoot":a.Name}});d.prototype=Object.create(n.Explorer.prototype);h.mixin(d.prototype,
{display:function(){this.createTree(this.parentId,new f({root:this.root,registry:this.registry,progressService:this.progressService,gitClient:this.gitClient,section:this.section,handleError:this.handleError}));this.updateCommands()},isRowSelectable:function(a){return!1},updateCommands:function(){var a=this.root,d=this.section.actionsNode.id;"full"!==a.mode&&(this.commandService.registerCommandContribution(d,"eclipse.orion.git.repositories.viewAllCommand",10),this.commandService.renderCommands(d,d,
{ViewAllLink:e.expand({resource:a.repository.BranchLocation}),ViewAllLabel:l["View All"],ViewAllTooltip:l["View all local and remote tracking branches"]},this,"button"));this.commandService.registerCommandContribution(d,"eclipse.addBranch",200);this.commandService.registerCommandContribution(d,"eclipse.addRemote",100);this.commandService.renderCommands(d,d,a.repository,this,"button")}});a.prototype=Object.create(n.SelectionRenderer.prototype);h.mixin(a.prototype,{getCellElement:function(a,d,e){var f;
switch(a){case 0:a=document.createElement("td");f=document.createElement("div");f.className="sectionTableItem lightTreeTableRow";a.appendChild(f);var g=document.createElement("div");g.style.overflow="hidden";f.appendChild(g);var h,m;f="";"LocalRoot"===d.parent.Type?(d.Current&&(h=document.createElement("span"),h.className="sectionIcon gitImageSprite git-sprite-branch-active",g.appendChild(h),f="activeBranch"),h=d.Commit.Children[0],m=(d.RemoteLocation.length&&1===d.RemoteLocation.length&&d.RemoteLocation[0].Children.length&&
1===d.RemoteLocation[0].Children.length?k.formatMessage(l["tracks ${0}, "],d.RemoteLocation[0].Children[0].Name):l["tracks no branch, "])+k.formatMessage(l["last modified ${0} by ${1}"],(new Date(h.Time)).toLocaleString(),h.AuthorName),h="branchActionsArea"):"RemoteRoot"===d.parent.Type?(h=document.createElement("div"),h.style.display="inline-block",h.style.styleFloat=h.style.cssFloat="left",this.getExpandImage(e,h),g.appendChild(h),m=d.GitUrl||d.Description||d.parent.repository.ContentLocation,h=
"remoteActionsArea"):"Remote"===d.parent.Type&&(h="branchActionsArea",m="");e=document.createElement("div");e.className="stretch";g.appendChild(e);var n=document.createElement("span");n.className=f;n.textContent=d.Name;e.appendChild(n);f=document.createElement("div");m&&(f.textContent=m);e.appendChild(f);m=document.createElement("div");m.className="sectionTableItemActions";m.id=h;g.appendChild(m);this.commandService.renderCommands(this.actionScopeId,m,d,this.explorer,"tool");return a}}});return{GitBranchListExplorer:d,
GitBranchListRenderer:a}});
define("orion/git/widgets/gitConfigList",["i18n!git/nls/gitmessages","orion/explorers/explorer","orion/i18nUtil","orion/URITemplate","orion/objects"],function(l,n,m,k,g){function h(a){this.root=a.root;this.registry=a.registry;this.handleError=a.handleError;this.section=a.section;this.progressService=a.progressService;this.gitClient=a.gitClient}function f(a){var b=new d({registry:a.serviceRegistry,commandService:a.commandRegistry,actionScopeId:a.actionScopeId,cachePrefix:a.prefix+"Navigator",checkbox:!1},
this);n.Explorer.call(this,a.serviceRegistry,a.selection,b,a.commandRegistry);this.checkbox=!1;this.parentId=a.parentId;this.actionScopeId=a.actionScopeId;this.root=a.root;this.section=a.section;this.handleError=a.handleError;this.progressService=a.progressService;this.gitClient=a.gitClient}function d(){n.SelectionRenderer.apply(this,arguments)}var a=new k("git/git-repository.html#{,resource,params*}");h.prototype=Object.create(n.Explorer.prototype);g.mixin(h.prototype,{destroy:function(){},getRoot:function(a){a(this.root)},
getChildren:function(a,b){var d=this,f;if("ConfigRoot"===a.Type){f=this.section.createProgressMonitor();var g=m.formatMessage(l["Getting configuration of"],a.repository.Name);f.begin(g);this.progressService.progress(this.gitClient.getGitCloneConfig(a.repository.ConfigLocation),g).then(function(g){f.worked("Rendering configuration");g=g.Children;0===g.length&&d.section.setTitle("No Configuration");for(var h=[],k=0;k<g.length;k++)("full"===a.mode||-1!==g[k].Key.indexOf("user."))&&h.push(g[k]);f.done();
b(h)},function(a){f.done();d.handleError(a)})}else b([])},getId:function(a){return"ConfigRoot"===a.Type?"ConfigRoot":a.Name}});f.prototype=Object.create(n.Explorer.prototype);g.mixin(f.prototype,{display:function(){this.createTree(this.parentId,new h({root:this.root,registry:this.registry,progressService:this.progressService,gitClient:this.gitClient,section:this.section,handleError:this.handleError}));this.updateCommands()},isRowSelectable:function(a){return!1},updateCommands:function(){var d=this.root,
b=this.section.actionsNode.id;"full"!==d.mode&&(this.commandService.registerCommandContribution(b,"eclipse.orion.git.repositories.viewAllCommand",10),this.commandService.renderCommands(b,b,{ViewAllLink:a.expand({resource:d.repository.ConfigLocation}),ViewAllLabel:l["View All"],ViewAllTooltip:l["View all configuration entries"]},this,"button"));"full"===d.mode&&(this.commandService.registerCommandContribution(b,"eclipse.orion.git.addConfigEntryCommand",1E3),this.commandService.renderCommands(b,b,d.repository,
this,"button"))}});d.prototype=Object.create(n.SelectionRenderer.prototype);g.mixin(d.prototype,{getCellElement:function(a,b,d){if(2<a)return null;var f;f=document.createElement("td");d=document.createElement("div");d.style.overflow="hidden";f.appendChild(d);switch(a){case 0:a=document.createElement("span");a.textContent=b.Key;d.appendChild(a);break;case 1:a=document.createElement("span");a.textContent=b.Value;d.appendChild(a);break;case 2:a=document.createElement("ul"),a.className="sectionTableItemActions layoutRight commandList",
a.id="configActionsArea",d.appendChild(a),this.commandService.renderCommands(this.actionScopeId,a,b,this.explorer,"tool")}return f}});return{GitConfigListExplorer:f,GitConfigListRenderer:d}});
define("orion/dynamicContent",["require","orion/commands","orion/webui/littlelib","orion/webui/tooltip"],function(l,n,m,k){function g(a,b){if(void 0===a)throw Error("Missing reqired argument: id");if(void 0===b)throw Error("Missing reqired argument: anchor");this._id=a;this._anchor=b;this._prefix="progressSpinner:"}function h(a,b){if(void 0===a)throw Error("Missing reqired argument: id");if(void 0===b)throw Error("Missing reqired argument: anchor");this._id=a;this._anchor=b;this._prefix="progressDots:"}
function f(a,b){if(!a)throw Error("Missing reqired argument: objects");if(!b)throw Error("Missing reqired argument: populate");this._objects=a;this._populate=b}function d(){}function a(a){if(!a)throw Error("Missing required argument: model");this._model=a;this.use(new d)}g.prototype={start:function(){var a=document.createElement("img");a.id=this._prefix+this._id;a.src=n.NO_IMAGE;a.className="progressPane_running";this._anchor.appendChild(a)},stop:function(){var a=m.node(this._prefix+this._id);a&&
a.parentNode.removeChild(a)},error:function(a){var b=m.node(this._prefix+this._id);b.src=l.toUrl("images/problem.gif");b.className="";new k.Tooltip({node:b,text:a})}};g.prototype.constructor=g;h.prototype={start:function(){var a=document.createElement("img");a.id=this._prefix+this._id;a.style.textDecoration="blink";a.appendChild(document.createTextNode(" ..."));this._anchor.appendChild(a)},stop:function(){var a=m.node(this._prefix+this._id);a&&a.parentNode.removeChild(a)},error:function(a){var b=
m.node(this._prefix+this._id);b.parentNode.removeChild(b);var d=document.createElement("img");d.src=l.toUrl("images/problem.gif");this._anchor.appendChild(d);new k.Tooltip({node:b,text:a})}};h.prototype.constructor=h;f.prototype={getObjects:function(){return this._objects},getDetails:function(a){return this._populate(a)}};f.prototype.constructor=f;d.prototype={progressIndicator:h,setupProperties:{progressIndicators:[]},errorHandler:function(a,b){this.explorer.progressIndicators[a].error(b)}};d.prototype.constructor=
d;a.prototype={render:function(){var a=this;this._initialRender&&this._initialRender();for(var b=function(b){return function(){a._renderAfterItemPopulation(b);a.progressIndicators[b].stop()}},d=function(b){return function(d){if(a._errorHandler)a._errorHandler(b,d);else throw Error(d);}},f=0;f<this._model.getObjects().length;f++)this._renderBeforeItemPopulation(f),this.progressIndicators[f].start(),this._model.getDetails(f).then(b(f),d(f));this._cleanupRender&&this._cleanupRender()},use:function(a){for(var b in a)if("populateItem"===
b)this._populateItem=a.populateItem.bind(a),a.explorer=this;else if("renderBeforeItemPopulation"===b)this._renderBeforeItemPopulation=a.renderBeforeItemPopulation.bind(a),a.explorer=this;else if("renderAfterItemPopulation"===b)this._renderAfterItemPopulation=a.renderAfterItemPopulation.bind(a),a.explorer=this;else if("errorHandler"===b)this._errorHandler=a.errorHandler.bind(a),a.explorer=this;else if("initialRender"===b)this._initialRender=a.initialRender.bind(a),a.explorer=this;else if("cleanupRender"===
b)this._cleanupRender=a.cleanupRender.bind(a),a.explorer=this;else if("progressIndicator"===b)this.progressIndicator=a.progressIndicator,a.explorer=this;else if("setupProperties"===b){for(var d in a.setupProperties)this[d]=a.setupProperties[d];a.explorer=this}}};a.prototype.constructor=a;return{DynamicContentModel:f,DynamicContentExplorer:a,DynamicContentRenderer:d,ProgressSpinner:g,ProgressDots:h}});
define("orion/git/widgets/gitTagList","require i18n!git/nls/gitmessages orion/URITemplate orion/PageUtil orion/Deferred orion/dynamicContent orion/webui/littlelib orion/git/widgets/CommitTooltipDialog orion/objects".split(" "),function(l,n,m,k,g,h,f,d,a){function e(a){this.registry=a.serviceRegistry;this.commandService=a.commandRegistry;this.parentId=a.parentId;this.actionScopeId=a.actionScopeId;this.repository=a.repository;this.mode=a.mode;this.section=a.section;this.commit=a.commit}var b=new m("git/git-repository.html#{,resource,params*}?page\x3d1\x26pageSize\x3d20"),
p=new m("git/git-commit.html#{,resource,params*}?page\x3d1\x26pageSize\x3d1");a.mixin(e.prototype,{decorateTag:function(a,b){b=b||new g;this.registry.getService("orion.page.progress").progress(this.registry.getService("orion.git.provider").doGitLog(a.CommitLocation+"?page\x3d1\x26pageSize\x3d1"),"Getting tag last commit "+a.Name).then(function(d){a.Commit=d.Children[0];b.resolve()},function(a){b.reject()});return b},display:function(){var a=this,d=this.section,e=document.createElement("a"),m=k.matchResourceParameters();
e.href=m.resource;var e=e.search?e.search:"?page\x3d1\x26pageSize\x3d20",p=d.createProgressMonitor();p.begin(n["Getting tags"]);var y=document.createElement("div");y.className="mainPadding";var r=this.repository,t=this.mode;g.when(this.commit||this.registry.getService("orion.page.progress").progress(this.registry.getService("orion.git.provider").getGitBranch(r.TagLocation+("full"===t?e:"?page\x3d1\x26pageSize\x3d5")),"Getting tags "+r.Name),function(e){var k=e.Children,m=!1;k||(k=e.Tags,m=!0);e=new h.DynamicContentModel(k,
function(b){return m?(new g).resolve():a.decorateTag.bind(a)(k[b])});e=new h.DynamicContentExplorer(e);e.use({initialRender:function(){p.done();var e=f.node(a.parentId);e&&(f.empty(e),e.appendChild(y),a.commandService.destroy(d.actionsNode.id),"full"!==t&&0!==k.length?(a.commandService.registerCommandContribution(d.actionsNode.id,"eclipse.orion.git.repositories.viewAllCommand",10),a.commandService.renderCommands(d.actionsNode.id,d.actionsNode.id,{ViewAllLink:l.toUrl(b.expand({resource:r.TagLocation})),
ViewAllLabel:n["View All"],ViewAllTooltip:n["View all tags"]},a,"button")):a.commit&&(a.commandService.registerCommandContribution(d.actionsNode.id,"eclipse.orion.git.addTag",100),a.commandService.renderCommands(d.actionsNode.id,d.actionsNode,a.commit,a,"button")),0===k.length&&d.setTitle(n["No Tags"]))},renderBeforeItemPopulation:function(b){var d=document.createElement("div");d.className="sectionTableItem lightTreeTableRow";y.appendChild(d);var e=document.createElement("div");e.style.overflow="hidden";
d.appendChild(e);d=document.createElement("div");d.className="stretch";e.appendChild(d);var f=document.createElement("span");f.textContent=k[b].Name;d.appendChild(f);this.explorer.progressIndicators[b]=new this.explorer.progressIndicator(b,f);f=document.createElement("div");f.id="tagDetailsView"+b;d.appendChild(f);d=document.createElement("div");d.className="sectionTableItemActions";d.id="tagActionsArea";e.appendChild(d);a.commandService.renderCommands(a.actionScopeId,d,k[b],a,"tool")},renderAfterItemPopulation:function(b){a.renderTag(k[b],
b)}});e.render()},function(b){p.done();a.handleError(b)})},renderTag:function(a,b){var e=document.createElement("span");e.className="tag-description";f.empty(f.node("tagDetailsView"+b));f.node("tagDetailsView"+b).appendChild(e);var g=a.Commit;if(g){var h=document.createElement("a");h.className="navlinkonpage";h.href=l.toUrl(p.expand({resource:g.Location}));h.textContent=g.Message;e.appendChild(h);e.appendChild(document.createTextNode(n[" by "]+g.AuthorName+n[" on "]+(new Date(g.Time)).toLocaleString()));
new d.CommitTooltipDialog({commit:g,triggerNode:h})}}});return{GitTagListExplorer:e}});
define("orion/section","orion/webui/littlelib orion/selection orion/commandRegistry orion/commonHTMLFragments orion/objects orion/selection".split(" "),function(l,n,m,k,g,h){function f(a,d){var b=this;this._expandImageClass="core-sprite-openarrow";this._collapseImageClass="core-sprite-closedarrow";this._progressImageClass="core-sprite-progress";this._twistieSpriteClass="modelDecorationSprite";if(!d.id)throw Error("Missing required argument: id");this.id=d.id;if(!d.title)throw Error("Missing required argument: title");
var f=d.useAuxStyle?["sectionWrapper","sectionWrapperAux","toolComposite"]:["sectionWrapper","toolComposite"];this.domNode=document.createElement("div");a.appendChild(this.domNode);for(var g=0;g<f.length;g++)this.domNode.classList.add(f[g]);this.domNode.id=d.id;d.canHide&&(this.twistie=document.createElement("span"),this.twistie.classList.add("modelDecorationSprite"),this.twistie.classList.add("layoutLeft"),this.twistie.classList.add("sectionTitleTwistie"),this.domNode.style.cursor="pointer",this.domNode.appendChild(this.twistie),
this.domNode.tabIndex=0,this.domNode.addEventListener("click",function(a){(a.target===b.titleNode||a.target===b.twistie||a.target===b.domNode)&&b._changeExpandedState()},!1),this.domNode.addEventListener("keydown",function(a){a.keyCode===l.KEY.ENTER&&(a.target===b.domNode||a.target===b.titleNode||a.target===b.twistie)&&b._changeExpandedState()},!1));if(d.iconClass){var h=document.createElement("span");h.classList.add("sectionIcon");this.domNode.appendChild(h);f=Array.isArray(d.iconClass)?d.iconClass:
[d.iconClass];f.forEach(function(a){h.classList.add(a)})}d.headerClass&&(f=Array.isArray(d.headerClass)?d.headerClass:[d.headerClass],f.forEach(function(a){this.domNode.classList.add(a)}.bind(this)));this.titleActionsNode=document.createElement("div");this.titleActionsNode.id=d.id+"TitleActionsArea";this.titleActionsNode.classList.add("layoutLeft");this.titleActionsNode.classList.add("sectionActions");this.domNode.appendChild(this.titleActionsNode);this.titleNode=document.createElement("div");this.titleNode.id=
d.id+"Title";this.titleNode.classList.add("sectionAnchor");this.titleNode.classList.add("sectionTitle");this.titleNode.classList.add("layoutLeft");this.domNode.appendChild(this.titleNode);this.titleNode.textContent=d.title;"function"===typeof d.getItemCount&&(f=document.createElement("div"),f.classList.add("layoutLeft"),f.classList.add("sectionItemCount"),this.domNode.appendChild(f),f.textContent=d.getItemCount(this));this._progressNode=document.createElement("div");this._progressNode.id=d.id+"Progress";
this._progressNode.classList.add("sectionProgress");this._progressNode.classList.add("sectionTitle");this._progressNode.classList.add("layoutLeft");this._progressNode.style.display="none";this._progressNode.textContent="...";this.domNode.appendChild(this._progressNode);this.titleLeftActionsNode=document.createElement("div");this.titleLeftActionsNode.id=d.id+"LeftTitleActionsArea";this.titleLeftActionsNode.classList.add("layoutLeft");this.titleLeftActionsNode.classList.add("sectionActions");this.domNode.appendChild(this.titleLeftActionsNode);
f=document.createElement("div");f.id=d.id+"FilterSearchBox";this.domNode.appendChild(f);this._toolActionsNode=document.createElement("div");this._toolActionsNode.id=d.id+"ToolActionsArea";this._toolActionsNode.classList.add("layoutRight");this._toolActionsNode.classList.add("sectionActions");this.domNode.appendChild(this._toolActionsNode);this.actionsNode=document.createElement("ul");this.actionsNode.id=d.id+"ActionArea";this.actionsNode.classList.add("layoutRight");this.actionsNode.classList.add("commandList");
this.actionsNode.classList.add("sectionActions");this.domNode.appendChild(this.actionsNode);this.selectionNode=document.createElement("ul");this.selectionNode.id=d.id+"SelectionArea";this.selectionNode.classList.add("layoutRight");this.selectionNode.classList.add("commandList");this.selectionNode.classList.add("sectionActions");this.domNode.appendChild(this.selectionNode);d.slideout&&(f=k.slideoutHTMLFragment(d.id),g=document.createRange(),g.selectNode(this.domNode),f=g.createContextualFragment(f),
this.domNode.appendChild(f));this._contentParent=document.createElement("div");this._contentParent.id=this.id+"Content";this._contentParent.role="region";this._contentParent.classList.add("sectionTable");this._contentParent.setAttribute("aria-labelledby",this.titleNode.id);a.appendChild(this._contentParent);d.content&&this.setContent(d.content);"function"===typeof d.onExpandCollapse&&(this._onExpandCollapse=d.onExpandCollapse);this._preferenceService=d.preferenceService;this._collapse();if(this._preferenceService){var m=
this;this._preferenceService.getPreferences("/window/views").then(function(a){a=a.get(m.id);void 0===a?d.hidden||m._expand():a&&m._expand();m._updateExpandedState(!1)})}else d.hidden||this._expand(),this._updateExpandedState(!1);this._commandService=d.commandService;this._lastMonitor=0;this._loading={}}function d(a){this._section=a;this._id=++a._lastMonitor}f.prototype={setTitle:function(a){this.titleNode.textContent=a},getHeaderElement:function(a){return this.domNode},getTitleElement:function(a){return this.titleNode},
getActionElement:function(a){return this._toolActionsNode},setContent:function(a){"string"===typeof a?this._contentParent.innerHTML=a:(this._contentParent.innerHTML="",this._contentParent.appendChild(a))},getContentElement:function(){return this._contentParent},embedExplorer:function(a,d,b){this._contentParent.innerHTML="";a.parent||(a.parent=d);this._contentParent.appendChild(a.parent);a.section=this;g.mixin(a,{createActionSections:function(){this.actionsSections&&this.actionsSections.forEach(function(a){if(!l.node(a)){var b=
document.createElement("ul");b.id=a;b.classList.add("commandList");b.classList.add("layoutRight");this.section.actionsNode.appendChild(b)}}.bind(this))},getCommandsVisible:function(){return"hidden"!==this.section.actionsNode.style.visibility},setCommandsVisible:function(a,b){this.section.actionsNode.style.visibility=a?"":"hidden";void 0===b&&(b=a?null:"cursorOnly");this.renderer.selectionPolicy=b;var d=this.getNavHandler();d&&d.setSelectionPolicy(b);a?this.updateCommands():this.actionsSections&&this.actionsSections.forEach(function(a){l.node(a)&&
this.commandRegistry.destroy(a)}.bind(this))},destroy:function(){Object.getPrototypeOf(this).destroy.call(this);var a=this;this.actionsSections&&(this.actionsSections.forEach(function(b){delete a[b]}),delete this.actionsSections)},updateCommands:function(a){this.section.actionsNode&&this.getCommandsVisible()&&(this.createActionSections(),Object.getPrototypeOf(this).updateCommands.call(this,a))},loaded:function(){var a=this;!this.selection&&!b&&(this.serviceRegistry||this.registry?(this.selection=
new h.Selection(this.serviceRegistry||this.registry,this.parent.id+"Selection"),this.selection.addEventListener("selectionChanged",function(b){a.updateCommands(b.selections)})):window.console.error("Could not create a Selection for the explorer because of lack of serviceRegistry"));var d=this.registerCommands();!d||!d.then?a.updateCommands():d.then(function(){a.updateCommands()})}});a.renderer&&(a.renderer.section=this,g.mixin(a.renderer,{getCellHeaderElement:function(a){(a=Object.getPrototypeOf(this).getCellHeaderElement.call(this,
a))&&this.section.setTitle(a.innerHTML);return null}}))},createProgressMonitor:function(){return new d(this)},_setMonitorMessage:function(a,d){this._progressNode.style.display="block";this._loading[a]=d;var b="",f;for(f in this._loading)""!==b&&(b+="\n"),b+=this._loading[f];this._progressNode.title=b;this._updateExpandedState(!1)},_monitorDone:function(a){delete this._loading[a];a="";for(var d in this._loading)""!==a&&(a+="\n"),a+=this._loading[d];this._progressNode.title=a;""===a&&(this._progressNode.style.display=
"none");this._updateExpandedState(!1)},_changeExpandedState:function(){this.hidden?this._expand():this._collapse();this._updateExpandedState(!0)},_updateExpandedState:function(a){var d=!this.hidden,b=this.working,f=this.twistie,g=this.id;f&&(f.classList.remove(this._expandImageClass),f.classList.remove(this._collapseImageClass),f.classList.remove(this._progressImageClass),f.classList.add(b?this._progressImageClass:d?this._expandImageClass:this._collapseImageClass));this._preferenceService&&a&&this._preferenceService.getPreferences("/window/views").then(function(a){a.put(g,
d)});this._onExpandCollapse&&this._onExpandCollapse(d,this)},_expand:function(){this._contentParent.classList.remove("sectionClosed");this.domNode.classList.remove("sectionClosed");this.hidden=!1},_collapse:function(){this.hidden=!0;this._contentParent.classList.add("sectionClosed");this.domNode.classList.add("sectionClosed")}};f.prototype.constructor=f;d.prototype={begin:function(a){this._section.working=!0;this.status=a;this._section._setMonitorMessage(this.id,a)},worked:function(a){this.status=
a;this._section._setMonitorMessage(this.id,a)},done:function(a){this._section.working=!1;this.status=a;this._section._monitorDone(this.id)}};d.prototype.constructor=d;return{Section:f}});
define("orion/git/widgets/gitRepoList","require i18n!git/nls/gitmessages orion/Deferred orion/URITemplate orion/dynamicContent orion/webui/littlelib orion/section orion/i18nUtil orion/objects".split(" "),function(l,n,m,k,g,h,f,d,a){function e(a){this.registry=a.serviceRegistry;this.commandService=a.commandRegistry;this.fileClient=a.fileClient;this.gitClient=a.gitClient;this.progressService=a.progressService;this.parentId=a.parentId;this.actionScopeId=a.actionScopeId;this.repositories=a.repositories;
this.mode=a.mode;this.links=a.links;this.loadingDeferred=a.loadingDeferred}var b=new k("git/git-repository.html#{,resource,params*}");a.mixin(e.prototype,{_repositorySorter:function(a,b){return a.Name.localeCompare(b.Name)},decorateRepository:function(a){var b=this,d=new m,e=this.mode;e||(e="full");this.progressService.progress(this.fileClient.loadWorkspace(a.ContentLocation+"?parts\x3dmeta"),"Loading workspace info").then(function(f){try{a.Content={};var g="root / ";if(null!==f.Parents)for(var h=
f.Parents.length;0<h;h--)g+=f.Parents[h-1].Name+" / ";g+=f.Name;a.Content.Path=g;"full"!==e?d.resolve():b.progressService.progress(b.gitClient.getGitStatus(a.StatusLocation),"Getting status for "+a.Name).then(function(e){try{a.Status=e,b.progressService.progress(b.gitClient.getGitBranch(a.BranchLocation),"Getting branches for "+a.Name).then(function(e){try{var f=e.Children||[],g;for(e=0;e<f.length;e++)if(f[e].Current){g=f[e];break}!g||null===g.RemoteLocation[0]?d.resolve():1===g.RemoteLocation.length&&
1===g.RemoteLocation[0].Children.length&&g.RemoteLocation[0].Children[0].CommitLocation?b.progressService.progress(b.gitClient.getLog(g.RemoteLocation[0].Children[0].CommitLocation+"?page\x3d1\x26pageSize\x3d20","HEAD"),"Getting incomming commits "+a.Name).then(function(b){a.CommitsToPush=void 0===b.Children?0:b.Children.length;d.resolve()},function(a){d.reject()}):b.progressService.progress(b.gitClient.doGitLog(g.CommitLocation+"?page\x3d1\x26pageSize\x3d20"),"Getting outgoing commits "+a.Name).then(function(b){a.CommitsToPush=
void 0===b.Children?0:b.Children.length;d.resolve()},function(a){d.reject()})}catch(h){d.reject()}},function(a){d.reject()})}catch(f){d.reject()}},function(a){d.reject()})}catch(k){d.reject(k)}},function(a){d.reject()});return d},display:function(){var a=this,d=this.repositories,e=this.mode,k=this.links;d&&d.sort(a._repositorySorter);var m=new g.DynamicContentModel(d,function(b){return a.decorateRepository.bind(a)(d[b])}),m=new g.DynamicContentExplorer(m);m.use({initialRender:function(){var b=h.node(a.parentId);
if(b&&(h.empty(b),!d||0===d.length))(new f.Section(b,{id:"repositorySection",title:"Repository",iconClass:["gitImageSprite","git-sprite-repository"]})).setTitle("full"===e?n["No Repositories"]:n["Repository Not Found"]),a.loadingDeferred.resolve()},cleanupRender:function(){a.loadingDeferred.resolve()},renderBeforeItemPopulation:function(f){var g=document.createElement("div");g.className=("mini"===a.mode?"miniWrapper":"sectionWrapper")+" toolComposite";h.node("repositoryNode").appendChild(g);var m=
document.createElement("div");m.className="sectionAnchor sectionTitle layoutLeft";g.appendChild(m);var t=document.createElement("span");m.appendChild(t);k?(m=document.createElement("a"),m.href=l.toUrl(b.expand({resource:d[f].Location})),m.appendChild(document.createTextNode(d[f].Name)),t.appendChild(m)):t.appendChild(document.createTextNode(d[f].Name));this.explorer.progressIndicators[f]=new this.explorer.progressIndicator(f,t);t=document.createElement("div");t.className="layoutRight sectionActions";
t.id="repositoryActionsArea";g.appendChild(t);a.commandService.renderCommands(a.actionScopeId,t,d[f],a,"full"===e?"tool":"button");"full"===e&&(t=document.createElement("div"),t.className="sectionTable sectionTableItem",h.node("repositoryNode").appendChild(t),g=document.createElement("div"),g.className="stretch",t.appendChild(g),t=document.createElement("div"),g.appendChild(t),t=document.createElement("span"),t.textContent=null!==d[f].GitUrl?n["git url:"]+d[f].GitUrl:n["(no remote)"],g.appendChild(t),
t=document.createElement("div"),g.appendChild(t),t=document.createElement("span"),t.id="location"+f,g.appendChild(t),t=document.createElement("div"),t.style.paddingTop="10px",g.appendChild(t),t=document.createElement("span"),t.id="repositoryState"+f,t.style.paddingLeft="10px",g.appendChild(t),t=document.createElement("span"),t.id="workspaceState"+f,t.style.paddingLeft="10px",g.appendChild(t),t=document.createElement("span"),t.id="commitsState"+f,t.style.paddingLeft="10px",g.appendChild(t))},renderAfterItemPopulation:function(b){a.renderRepository(d[b],
b,d.length,e,k)}});m.render()},renderRepository:function(a,b,e,f,g){if(e=h.node("location"+b))e.textContent=n["location: "]+a.Content.Path,e=a.Status,"full"===f&&(f=e.Untracked.length+e.Conflicting.length+e.Modified.length+e.Missing.length,g=e.Changed.length+e.Added.length+e.Removed.length,f=0<f||0<g?d.formatMessage(n["${0} file(s) to stage and ${1} file(s) to commit."],f,g):n["Nothing to commit."],"SAFE"!==e.RepositoryState&&(h.node("repositoryState"+b).textContent=n["Rebase in progress!"]),h.node("workspaceState"+
b).textContent=f,a=a.CommitsToPush,h.node("commitsState"+b).textContent=0<a?a+n[" commit(s) to push."]:n["Nothing to push."])}});return{GitRepoListExplorer:e}});
define("orion/fileUtils",["require","i18n!orion/nls/messages","orion/URL-shim"],function(l,n){var m;m=l.toUrl?(new URL(l.toUrl("workspace"),window.location.href)).href:(new URL("/",window.location.href)).href;return{makeRelative:function(k){if(!k)return k;var g=window.location.protocol+"//"+window.location.host;return 0===k.indexOf(g)?k.substring(g.length):k},isAtRoot:function(k){return!k?!1:"/workspace"===k?!0:0===(new URL(k,window.location.href)).href.indexOf(m)}}});
define("orion/git/gitRepositoryExplorer","require i18n!git/nls/gitmessages orion/git/widgets/gitChangeList orion/git/widgets/gitCommitList orion/git/widgets/gitBranchList orion/git/widgets/gitConfigList orion/git/widgets/gitTagList orion/git/widgets/gitRepoList orion/section orion/webui/littlelib orion/URITemplate orion/PageUtil orion/fileUtils orion/globalCommands orion/Deferred".split(" "),function(l,n,m,k,g,h,f,d,a,e,b,p,q,s,u){var w={},x=new b("git/git-repository.html#{,resource,params*}");w.GitRepositoryExplorer=
function(){function b(a){this.parentId=a.parentId;this.registry=a.registry;this.linkService=a.linkService;this.commandService=a.commandService;this.fileClient=a.fileClient;this.gitClient=a.gitClient;this.progressService=a.progressService;this.preferencesService=a.preferencesService;this.statusService=a.statusService;this.selection=a.selection;this.pageNavId=a.pageNavId;this.actionScopeId=a.actionScopeId;this.checkbox=!1}b.prototype.handleError=function(a){var b={Severity:"Error",HTML:!1};try{var d=
JSON.parse(a.responseText);b.Message=d.DetailedMessage?d.DetailedMessage:d.Message}catch(e){b.Message=a.DetailedMessage||a.Message||a.message}this.statusService.setProgressResult(b);404===a.status&&(this.initTitleBar(),this.displayRepositories())};b.prototype.setDefaultPath=function(a){this.defaultPath=a};b.prototype.changedItem=function(a,b){this.redisplay(!1)};b.prototype.redisplay=function(a){void 0===a&&(a=!0);var b=p.matchResourceParameters();if(b.resource)this.displayRepository(b.resource);
else{var b=q.makeRelative(this.defaultPath),d=l.toUrl("gitapi/clone._"),d=d.substring(0,d.length-2);this.displayRepositories2("/"===b[0]?d+b:d+"/"+b,a)}};b.prototype.displayRepositories2=function(a,b){var d=this;this.loadingDeferred=new u;b&&this.loadingDeferred.then(function(){d.commandService.processURL(window.location.href)});this.progressService.progress(this.gitClient.getGitClone(a),"Getting git repository details").then(function(a){0===a.Children.length?(d.initTitleBar({}),d.displayRepositories([],
"full")):"Clone"===a.Children[0].Type&&(a=a.Children,d.initTitleBar(a),d.displayRepositories(a,"full",!0))},function(a){d.handleError(a)})};b.prototype.displayRepository=function(a){var b=this;this.loadingDeferred=new u;this.progressService.progress(this.gitClient.getGitClone(a),"Getting git repository details").then(function(a){var d=e.node(b.pageNavId);d&&(e.empty(d),b.commandService.renderCommands(b.pageNavId,d,a,b,"button"));a.Children&&(0===a.Children.length?(b.initTitleBar({}),b.displayRepositories([],
"full")):a.Children.length&&1===a.Children.length&&"Clone"===a.Children[0].Type?(a=a.Children,b.initTitleBar(a[0]),b.displayRepositories(a,"mini"),b.statusDeferred=b.displayStatus(a[0]),b.displayCommits(a[0]),b.displayBranches(a[0]),b.displayTags(a[0]),b.displayConfig(a[0],"full")):"Clone"===a.Children[0].Type?(a=a.Children,b.initTitleBar(a),b.displayRepositories(a,"full",!0)):"Branch"===a.Children[0].Type?b.progressService.progress(b.gitClient.getGitClone(a.Children[0].CloneLocation),"Getting git repository details").then(function(a){a=
a.Children;b.initTitleBar(a[0],"Branches");b.displayRepositories(a,"mini",!0);b.displayBranches(a[0],"full")},function(a){b.handleError(a)}):"Tag"===a.Children[0].Type?b.progressService.progress(b.gitClient.getGitClone(a.Children[0].CloneLocation),"Getting git repository details").then(function(a){a=a.Children;b.initTitleBar(a[0],n.Tags);b.displayRepositories(a,"mini",!0);b.displayTags(a[0],"full")},function(a){b.handleError(a)}):"Config"===a.Children[0].Type&&b.progressService.progress(b.gitClient.getGitClone(a.CloneLocation),
"Getting git repository details").then(function(a){a=a.Children;b.initTitleBar(a[0],n.Configuration);b.displayRepositories(a,"mini",!0);b.displayConfig(a[0],"full")},function(a){b.handleError(a)}))},function(a){b.handleError(a)})};var r=function(a,b,d,f,g){if(a=e.node(d))b.destroy(a);else throw"could not find toolbar "+d;b.renderCommands(f,a,g,null,"button")};b.prototype.initTitleBar=function(a,b){var d={},e="repoPageActions",f;a&&"Clone"===a.Type&&b?(f=a,d.Name=b,d.Parents=[],d.Parents[0]={},d.Parents[0].Name=
f.Name,d.Parents[0].Location=f.Location,d.Parents[0].ChildrenLocation=f.Location,d.Parents[1]={},d.Parents[1].Name=n.Repo):a&&"Clone"===a.Type?(f=a,d.Name=f.Name,d.Parents=[],d.Parents[0]={},d.Parents[0].Name=n.Repo):(d.Name=n.Repo,e="reposPageActions");r(this.registry,this.commandService,"pageActions",e,f||{});s.setPageTarget({task:n.Repo,target:f,breadcrumbTarget:d,makeBreadcrumbLink:function(a,b){a.href=l.toUrl(x.expand({resource:b||""}))},serviceRegistry:this.registry,commandService:this.commandService})};
b.prototype.displayRepositories=function(a,b,f){var g=e.node("table");e.empty(g);var h=document.createElement("div");g.appendChild(h);h.innerHTML='\x3cdiv id\x3d"repositoryNode" class\x3d"mainPadding"\x3e\x3c/div\x3e';(new d.GitRepoListExplorer({serviceRegistry:this.registry,commandRegistry:this.commandService,fileClient:this.fileClient,gitClient:this.gitClient,progressService:this.progressService,parentId:"repositoryNode",actionScopeId:"mini"===b?"itemLevelCommandsMini":this.actionScopeId,handleError:this.handleError,
repositories:a,mode:b,links:f,loadingDeferred:this.loadingDeferred})).display()};b.prototype.displayBranches=function(b,d){var f=e.node("table"),f=new a.Section(f,{id:"branchSection",title:n.Branches,iconClass:["gitImageSprite","git-sprite-branch"],slideout:!0,content:'\x3cdiv id\x3d"branchNode"\x3e\x3c/div\x3e',canHide:!0,hidden:!0,preferenceService:this.preferencesService});(new g.GitBranchListExplorer({serviceRegistry:this.registry,commandRegistry:this.commandService,fileClient:this.fileClient,
gitClient:this.gitClient,progressService:this.progressService,parentId:"branchNode",actionScopeId:this.actionScopeId,section:f,handleError:this.handleError,root:{Type:"RemoteRoot",repository:b,mode:d}})).display()};b.prototype.displayStatus=function(b){var d=e.node("table"),d=new a.Section(d,{id:"statusSection",title:n.ChangedFiles,slideout:!0,content:'\x3cdiv id\x3d"statusNode"\x3e\x3c/div\x3e',canHide:!1,preferenceService:this.preferencesService});return(new m.GitChangeListExplorer({serviceRegistry:this.registry,
commandRegistry:this.commandService,selection:this.stagedSelection,parentId:"statusNode",prefix:"all",location:b.StatusLocation,repository:b,section:d,editableInComparePage:!0,handleError:this.handleError,gitClient:this.gitClient,progressService:this.progressService})).display()};b.prototype.displayCommits=function(b){var d=e.node("table"),d=new a.Section(d,{id:"commitSection",title:n.Commits,slideout:!0,content:'\x3cdiv id\x3d"commitNode"\x3e\x3c/div\x3e',canHide:!0,preferenceService:this.preferencesService}),
f=new k.GitCommitListExplorer({serviceRegistry:this.registry,commandRegistry:this.commandService,fileClient:this.fileClient,gitClient:this.gitClient,progressService:this.progressService,statusService:this.statusService,selection:this.selection,actionScopeId:this.actionScopeId,parentId:"commitNode",section:d,handleError:this.handleError,root:{Type:"CommitRoot",repository:b}});this.statusDeferred.then(function(){f.display()})};b.prototype.displayTags=function(b,d){var g=e.node("table"),g=new a.Section(g,
{id:"tagSection",iconClass:["gitImageSprite","git-sprite-tag"],title:"Tags"+("full"===d?"":" (5 most recent)"),content:'\x3cdiv id\x3d"tagNode"\x3e\x3c/div\x3e',canHide:!0,hidden:!0,preferenceService:this.preferencesService});(new f.GitTagListExplorer({serviceRegistry:this.registry,commandRegistry:this.commandService,parentId:"tagNode",actionScopeId:this.actionScopeId,section:g,repository:b,mode:d})).display()};b.prototype.displayConfig=function(b,d){var f=e.node("table"),f=new a.Section(f,{id:"configSection",
title:n.Configuration+("full"===d?"":" (user.*)"),slideout:!0,content:'\x3cdiv id\x3d"configNode" class\x3d"mainPadding"\x3e\x3c/div\x3e',canHide:!0,hidden:!0,preferenceService:this.preferencesService});(new h.GitConfigListExplorer({serviceRegistry:this.registry,commandRegistry:this.commandService,fileClient:this.fileClient,gitClient:this.gitClient,progressService:this.progressService,parentId:"configNode",actionScopeId:this.actionScopeId,section:f,handleError:this.handleError,root:{Type:"ConfigRoot",
repository:b,mode:d}})).display()};return b}();return w});
define("orion/git/widgets/ReviewRequestDialog",["i18n!git/nls/gitmessages","orion/webui/dialog"],function(l,n){function m(k){this._init(k)}m.prototype=new n.Dialog;m.prototype.TEMPLATE='\x3cdiv\x3e\x3cdiv id\x3d"treeContentPane" style\x3d"padding: 8px"\x3e\x3clabel for\x3d"reviewReqUrl"\x3e${Paste link in email or IM}\x3c/label\x3e\x3cbr\x3e\x3cinput id\x3d"reviewReqUrl" style\x3d"width: 50em" value\x3d""/\x3e\x3c/div\x3e\x3cdiv id\x3d"newBranchPane" style\x3d"padding: 8px"\x3e\x3clabel for\x3d"reviewerName"\x3e${Send the link to the reviewer}\x3c/label\x3e\x3cbr\x3e\x3cinput id\x3d"reviewerName" style\x3d"width: 30em"  value\x3d""/\x3e\x3c/div\x3e\x3c/div\x3e';m.prototype._init=
function(k){var g=this;this.title=k.title||l["Contribution Review Request"];this.modal=!0;this.messages=l;this.url=k.url;this.func=k.func;this.buttons=[];this.buttons.push({callback:function(){g.destroy();g.func(g.$reviewerName.value)},text:l.Submit});this._initialize()};m.prototype._bindToDom=function(k){this.$reviewReqUrl.value=this.url};m.prototype.constructor=m;return{ReviewRequestDialog:m}});
define("orion/explorers/explorer-table","i18n!orion/navigate/nls/messages orion/Deferred orion/webui/littlelib orion/i18nUtil orion/fileUtils orion/explorers/explorer orion/EventTarget orion/objects orion/util".split(" "),function(l,n,m,k,g,h,f,d,a){function e(a,b,d,e,f,g){this.registry=a;this.root=b;this.fileClient=d;this.idPrefix=e||"";this.excludeFiles=!!f;this.excludeFolders=!!g}function b(a){f.attach(this);this.registry=a.serviceRegistry;this.treeRoot=a.treeRoot;this.selection=a.selection;this.fileClient=
a.fileClient;this.excludeFiles=a.excludeFiles;this.excludeFolders=a.excludeFolders;this.navHandlerFactory=a.navHandlerFactory;this.parentId=a.parentId;this.renderer=a.rendererFactory(this);this.dragAndDrop=a.dragAndDrop;this.setFocus=a.setFocus;this.myTree=this.model=null;this._hookedDrag=this.checkbox=!1;var b=a.modelEventDispatcher?a.modelEventDispatcher:new f;this.modelEventDispatcher=b;var d=this;this._modelListeners={};"copy copyMultiple create delete deleteMultiple import move moveMultiple".split(" ").forEach(function(a){b.addEventListener(a,
d._modelListeners[a]=d.modelHandler[a].bind(d))});this._clickListener=function(a){if("A"===a.target.tagName){for(a=a.target;a&&!a._item;)a=a.parentNode;if(a&&a._item)d.onLinkClick({type:"linkClick",item:a._item})}};(a=m.node(this.parentId))&&a.addEventListener("click",this._clickListener);var e=this.renderer;this.registry&&this.registry.registerService("orion.cm.managedservice",{updated:function(a){a=a&&"undefined"!==a["links.newtab"]?a["links.newtab"]?"_blank":"_self":"_self";e.setTarget&&e.setTarget(a)}},
{pid:"nav.config"})}e.prototype=new h.ExplorerModel;d.mixin(e.prototype,{getRoot:function(a){a(this.root)},processParent:function(a,b){var d=a.Projects?[]:[a].concat(a.Parents||[]);if(this.excludeFiles||this.excludeFolders){var e=[],f;for(f in b)if(!(b[f].Directory?this.excludeFolders:this.excludeFiles))e.push(b[f]),b[f].parent=a,b[f].Parents||(b[f].Parents=d);b=e}else for(e in b)b[e].parent=a,b[e].Parents||(b[e].Parents=d);a.children=b;a.children.sort(this.sortChildren);return b},sortChildren:function(a,
b){var d=a.Directory;if(d!==b.Directory)return d?-1:1;var d=a.Name&&a.Name.toLowerCase(),e=b.Name&&b.Name.toLowerCase();return d<e?-1:d>e?1:0},getChildren:function(a,b){var d=this;if(a.children)b(a.children);else if(void 0!==a.Directory&&!1===a.Directory)b([]);else if(a.Children)b(d.processParent(a,a.Children));else if(a.Location){var e=null;this.registry&&(e=this.registry.getService("orion.page.progress"));(e?e.progress(this.fileClient.fetchChildren(a.ChildrenLocation),l["Fetching children of "]+
a.Name):this.fileClient.fetchChildren(a.ChildrenLocation)).then(function(e){d.destroyed||b(d.processParent(a,e))},function(){b([])})}else b([])},hasChildren:function(){var a=!1;this.root.Children&&(a=0<this.root.Children.length);return a}});e.prototype.constructor=e;var p,q;b.prototype=Object.create(h.Explorer.prototype);d.mixin(b.prototype,{destroy:function(){var a=this;Object.keys(this._modelListeners).forEach(function(b){a.modelEventDispatcher.removeEventListener(b,a._modelListeners[b])});var b=
m.node(this.parentId);b&&b.removeEventListener("click",this._clickListener);h.Explorer.prototype.destroy.call(this)},onLinkClick:function(a){this.dispatchEvent(a)},onModelCreate:function(a){return this.changedItem(a.parent,!0)},onModelCopy:function(a){var b=this,d={};(a.items||[a]).forEach(function(a){a=(a=a.parent)||b.treeRoot;d[a.Location]=a});return n.all(Object.keys(d).map(function(a){return b.changedItem(d[a],!0)}))},onModelMove:function(a){var b=this,d={};(a.items||[a]).forEach(function(a){var e=
b.treeRoot;if((e.Location||e.ContentLocation)===a.oldValue.Location){var f=b.treeRoot;a=a.newValue;a=a.ChildrenLocation?a:this.fileClient.read(a.ContentLocation,!0);return n.when(a,function(a){b.dispatchEvent({type:"rootMoved",oldValue:f,newValue:a});b.loadResourceList(a)})}e=(e=a.oldValue.parent)||b.treeRoot;d[e.Location]=e;e=(e=a.parent)||b.treeRoot;d[e.Location]=e;a.oldValue.Directory&&(a.newValue&&b.isExpanded(a.oldValue))&&(d[a.newValue.Location]=a.newValue)});return n.all(Object.keys(d).map(function(a){return b.changedItem(d[a],
!0)}))},onModelDelete:function(a){a=a.items||[a];var b=this,d=b.treeRoot,e;if(a.some(function(a){if(a.oldValue.Location===(d.Location||d.ContentLocation)){if(a.oldValue.Location!==(a.parent.Location||a.parent.ContentLocation))e=a.parent;return!0}return!1}))return this.loadResourceList(e);var f={};a.forEach(function(a){a=a.parent;f[a.Location]=a});return n.all(Object.keys(f).map(function(a){return b.changedItem(f[a],!0)}))},modelHandler:{copy:function(a){if(!a.count)return this.onModelCopy(a)},copyMultiple:function(a){return this.onModelCopy(a)},
create:function(a){return this.onModelCreate(a)},"delete":function(a){if(!a.count)return this.onModelDelete(a)},deleteMultiple:function(a){return this.onModelDelete(a)},"import":function(a){return this.changedItem(a.target,!0)},move:function(a){if(!a.count)return this.onModelMove(a)},moveMultiple:function(a){return this.onModelMove(a)}},makeNewChildItemPlaceholder:function(a,b,d){var e=new n;this.model.getChildren(a,function(f){var g=null,h=!1;if(f){f.push(b);f.sort(this.model.sortChildren);var g=
f.indexOf(b),k=g+1;f.length>k?g=f[k]:(h=g-1,g=0<=h?f[h]:a,h=!0)}else g=a;f=this.makeNewItemPlaceholder(g,d,h);e.resolve(f)}.bind(this));return e},_makeDropTarget:function(b,d,e){if(this.dragAndDrop){var f=this,h=this.dragAndDrop,r=function(a){p=a.target};e&&(this._oldDragStart&&d.removeEventListener("dragstart",this._oldDragStart,!1),this._oldDragStart=r);d.addEventListener("dragstart",r,!1);r=function(a){p=null};e&&(this._oldDragEnd&&d.removeEventListener("dragend",this._oldDragEnd,!1),this._oldDragEnd=
r);d.addEventListener("dragend",r,!1);r=function(a){d.classList.remove("dragOver");a.preventDefault();a.stopPropagation()};e&&(this._oldDragLeave&&d.removeEventListener("dragleave",this._oldDragLeave,!1),this._oldDragLeave=r);d.addEventListener("dragleave",r,!1);r=function(b){if(p)q=b.dataTransfer.dropEffect=(a.isMac?b.altKey:b.ctrlKey)?"copy":"move";else if(!a.isIE&&("all"===b.dataTransfer.effectAllowed||"uninitialized"===b.dataTransfer.effectAllowed||0<=b.dataTransfer.effectAllowed.indexOf("copy")))b.dataTransfer.dropEffect=
"copy";d.classList.add("dragOver");m.stop(b)};e&&(this._oldDragEnter&&d.removeEventListener("dragenter",this._oldDragEnter,!1),this._oldDragEnter=r);d.addEventListener("dragenter",r,!1);r=function(b){if(p)q=b.dataTransfer.dropEffect=(a.isMac?b.altKey:b.ctrlKey)?"copy":"move";else if(!a.isIE&&("all"===b.dataTransfer.effectAllowed||"uninitialized"===b.dataTransfer.effectAllowed||0<=b.dataTransfer.effectAllowed.indexOf("copy")))b.dataTransfer.dropEffect="copy";m.stop(b)};e&&!this._oldDragOver&&(d.addEventListener("dragover",
r,!1),this._oldDragOver=r);var t=null,z=null;f.registry&&(t=f.registry.getService("orion.page.progress"),z=f.registry.getService("orion.page.message"));var B=function(a){if(z){var b=null,b="string"===typeof a?{Severity:"Error",Message:a}:a&&a.error?{Severity:"Error",Message:a.error}:a;z.setProgressResult(b)}else window.console.log(a)},v=function(a,d,e,f,h,m){var p=!1,q=g.isAtRoot(d.Location);m?(p=!0,m.entryCount++):a.isDirectory&&(p=!0,m={entryCount:1,deferred:new n},e._makeUploadNode(d,a.name,!0).then(function(a){var b=
function(){a.destroyFunction();q?e.loadResourceList(e.treeRoot.Path,!0):e.changedItem(d)};m.deferred.then(b,b)}));var u=function(){m&&(m.entryCount--,0===m.entryCount&&m.deferred.resolve())},r=function(a){if(z){var b=null,b="string"===typeof a?{Severity:"Error",Message:a}:a&&a.error?{Severity:"Error",Message:a.error}:a;z.setProgressResult(b)}else window.console.log(a);u()};!d.Location&&d.fileMetadata&&(d=d.fileMetadata);if(a.isFile)q?r(l["You cannot copy files directly into the workspace.  Create a folder first."]):
a.file(function(a){if(m){var g=a.name.indexOf(".zip")===a.name.length-4&&window.confirm(k.formatMessage(l["Unzip ${0}?"],a.name));f(d,a,e,g,!1,{error:function(b){b=l["Uploading the following file failed: "]+a.name;z?z.setProgressResult({Severity:"Error",Message:b}):window.console.log(b)},loadend:u},!0)}else e._uploadFile(b,a,!0)}.bind(this));else if(a.isDirectory){var w=a.createReader(),x=function(a){w.readEntries(function(b){for(var d=0;d<b.length;d++)v(b[d],a,e,f,h,m);u()})};q?(t?t.progress(h.createProject(d.ChildrenLocation,
a.name),k.formatMessage(l["Creating ${0}"],a.name)):h.createProject(d.ChildrenLocation,a.name)).then(function(a){(t?t.progress(h.read(a.ContentLocation,!0),l["Loading "]+a.name):h.read(a.ContentLocation,!0)).then(function(a){x(a)},r)},r):(t?t.progress(h.createFolder(d.Location,a.name),k.formatMessage(l["Creating ${0}"],a.name)):h.createFolder(d.Location,a.name)).then(function(a){var d=e.modelEventDispatcher;p||d.dispatchEvent({type:"create",parent:b,newValue:a});x(a)},r)}},r=function(a){var e;d.classList.remove("dragOver");
if(p){e=f.fileClient;for(var n=p,r;n;){if(n._item){r=n._item;break}n=n.parentNode}if(!r)return;var w="copy"===q;e=(w?e.copyFile:e.moveFile).apply(e,[r.Location,b.Location,r.Name]);t&&(n=k.formatMessage(l[w?"Copying ${0}":"Moving ${0}"],r.Location),e=t.showWhile(e,n));e.then(function(a){f.modelEventDispatcher.dispatchEvent({type:w?"copy":"move",oldValue:r,newValue:a,parent:b})},B)}else if(a.dataTransfer.items&&0<a.dataTransfer.items.length)for(e=0;e<a.dataTransfer.items.length;e++)n=null,"function"===
typeof a.dataTransfer.items[e].getAsEntry?n=a.dataTransfer.items[e].getAsEntry():"function"===typeof a.dataTransfer.items[e].webkitGetAsEntry&&(n=a.dataTransfer.items[e].webkitGetAsEntry()),n&&v(n,b,f,h,f.fileClient);else if(a.dataTransfer.files&&0<a.dataTransfer.files.length)for(e=0;e<a.dataTransfer.files.length;e++)n=a.dataTransfer.files[e],!n.size&&!n.type?B(k.formatMessage(l["Did not drop ${0}.  Folder drop is not supported in this browser."],n.name)):g.isAtRoot(b.Location)?B(l["You cannot copy files directly into the workspace.  Create a folder first."]):
f._uploadFile(b,n,!0);m.stop(a)};e&&(this._oldDrop&&d.removeEventListener("drop",this._oldDrop,!1),this._oldDrop=r);d.addEventListener("drop",r,!1)}},_uploadFile:function(a,b,d){var e=a;!e.Location&&e.fileMetadata&&(e=e.fileMetadata);a=function(){this._makeUploadNode(e,b.name,!1).then(function(a){var d=a.refNode,f=a.progressBar,g=a.cancelButton,h=a.destroyFunction,m=this.registry.getService("orion.page.message");a={progress:function(a){var b="";if(a.lengthComputable){b=Math.floor(100*(a.loaded/a.total))+
"%";f.style.width=b;var e=Math.round(a.loaded/1024);a=Math.round(a.total/1024);f.title=l["Upload progress: "]+b+",  "+e+"/"+a+" KB";d.title=f.title}},loadend:function(a){h();this.changedItem(e)}.bind(this),error:function(a){a=l["Uploading the following file failed: "]+b.name;m?m.setProgressResult({Severity:"Error",Message:a}):window.console.log(a)}};var n=b.name.indexOf(".zip")===b.name.length-4&&window.confirm(k.formatMessage(l["Unzip ${0}?"],b.name)),p=this.dragAndDrop(e,b,this,n,!1,a,!0);g.addEventListener("click",
function(){p.abort()})}.bind(this))}.bind(this);d?this.expandItem(e,!1).then(a):a()},_makeUploadNode:function(a,b,d){var e=this.getRow(a).id;return this.makeNewChildItemPlaceholder(a,{Name:b,Directory:d},e).then(function(a){var e=null,f,g;if(a){e={};f=a.refNode;g=a.wrapperNode;f.classList.add("uploadNode");e.refNode=f;e.wrapperNode=g;g=document.createElement("span");g.classList.add("uploadNodeText");g.appendChild(document.createTextNode(b));f.appendChild(g);g=document.createElement("span");g.classList.add("progressBarWrapper");
var h=document.createElement("span");h.classList.add("progressBar");g.appendChild(h);f.appendChild(g);e.progressBar=h;d?(h.classList.add("continuous"),f.title=l["Uploading "]+b,h.title=f.title):(g=document.createElement("button"),g.classList.add("imageSprite"),g.classList.add("core-sprite-delete"),g.classList.add("uploadCancelButton"),g.title=l["Cancel upload"],f.appendChild(g),e.cancelButton=g);e.destroyFunction=a.destroyFunction}return e}.bind(this))},createModel:function(){return new e(this.registry,
this.treeRoot,this.fileClient,this.parentId,this.excludeFiles,this.excludeFolders)},changedItem:function(a,b){if(this.treeRoot&&this.treeRoot.Location===a.Location)return this.loadResourceList(this.treeRoot,b);var d=this,e=new n;a.children=a.Children=null;this.model.getChildren(a,function(f){d.getNavHandler();d.myTree.refresh.bind(d.myTree)(a,f,b);e.resolve(f)});return e},showItem:function(a,b){var d=new n;if(!a||!this.model||!this.myTree||!this.myTree.showRoot&&a.Location===this.treeRoot.Location)return d.reject();
var e=this.getRow(a);if(e)d.resolve(e._item||a);else return a.Parents&&0<a.Parents.length?(a.Parents[0].Parents=a.Parents.slice(1),this.expandItem(a.Parents[0],b).then(function(b){var d=this.getRow(a);return!d?this.changedItem(b,!0).then(function(){var b=this.getRow(a);return b?b._item:(new n).reject()}.bind(this)):d._item||a}.bind(this))):void 0===b||b?this.reroot(a):d.reject();return d},expandItem:function(a,b){var d=new n;this.showItem(a,b).then(function(a){this.myTree.isExpanded(a)?d.resolve(a):
this.myTree.expand(this.model.getId(a),function(){d.resolve(a)})}.bind(this),d.reject);return d},reveal:function(a,b){return this.showItem(a,b).then(function(a){var b=this.getNavHandler();b&&(b.cursorOn(a,!0),b.setSelection(a));return a}.bind(this))},reroot:function(a){return(new n).reject()},isExpanded:function(a){a=this.model.getId(a);return this.renderer.tableTree.isExpanded(a)},getNameNode:function(a){if(a=this.model.getId(a))return m.node(a+"NameLink")},scopeUp:function(){},scopeDown:function(a){},
loadResourceList:function(a,b,d){a&&"object"===typeof a&&(a=a.ChildrenLocation||a.ContentLocation);a=g.makeRelative(a);if(!b&&a===this._lastPath)return(new n).resolve(this.treeRoot);this._lastPath=a;var e=this;return b||a!==this.treeRoot.Path?this.load(this.fileClient.loadWorkspace(a),l["Loading "]+a).then(function(b){e.treeRoot.Path=a;"function"===typeof d&&d();e.dispatchEvent({type:"rootChanged",root:e.treeRoot});return(new n).resolve(e.treeRoot)},function(a){e.treeRoot.Path=null;e.dispatchEvent({type:"rootChanged",
root:e.treeRoot});return(new n).reject(a)}):(new n).resolve(e.treeRoot)},load:function(a,b,d){var e=m.node(this.parentId),f=m.node("progress");f||(f=document.createElement("div"),f.id="progress",m.empty(e),e.appendChild(f));m.empty(f);var g=setTimeout(function(){m.empty(f);f.appendChild(document.createTextNode(b))},500),h=this;return n.when(a,function(a){clearTimeout(g);if(!h.destroyed){h.treeRoot={};for(var b in a)h.treeRoot[b]=a[b];h.model=h.createModel();h.dragAndDrop&&(h._hookedDrag?h._makeDropTarget(h.treeRoot,
e,!0):(a=(a=e&&("draggable"in e||"ondragstart"in e&&"ondrop"in e))&&!(!window.File||!window.FileList||!window.FileReader),h._hookedDrag=!0,a?h._makeDropTarget(h.treeRoot,e,!0):(h.dragAndDrop=null,window.console.log("Local file drag and drop is not supported in this browser."))));var f=new n;h.createTree(h.parentId,h.model,{onComplete:function(a){f.resolve(a)},navHandlerFactory:h.navHandlerFactory,setFocus:"undefined"===typeof h.setFocus?!0:h.setFocus,selectionPolicy:h.renderer.selectionPolicy,onCollapse:function(a){if(h.getNavHandler())h.getNavHandler().onCollapse(a)}});
return f.then(function(){if("function"===typeof d)try{d()}catch(a){h.registry&&h.registry.getService("orion.page.message").setErrorMessage(a)}if("function"===typeof h.onchange)h.onchange(h.treeRoot);return h.treeRoot})}},function(a){clearTimeout(g);h.registry&&h.registry.getService("orion.page.message").setProgressResult(a);return(new n).reject(a)})},onchange:function(a){}});b.prototype.constructor=b;return{FileExplorer:b,FileModel:e}});
define("orion/webui/dialogs/DirectoryPrompterDialog","i18n!orion/widgets/nls/messages orion/webui/littlelib orion/webui/dialog orion/fileUtils orion/selection orion/explorers/navigationUtils orion/explorers/explorer orion/explorers/explorer-table".split(" "),function(l,n,m,k,g,h,f,d){function a(a,d){this.explorer=d;this._init(a)}function e(a){this._init(a)}a.prototype=new f.SelectionRenderer;a.prototype.constructor=a;a.prototype.getLabelColumnIndex=function(){return 0};a.prototype.getCellElement=
function(a,d,e){a=document.createElement("td");e.appendChild(a);var f=document.createElement("span");f.id=e.id+"navSpan";a.appendChild(f);f.className="mainNavColumn singleNavColumn";this.getExpandImage(e,f);f.appendChild(document.createTextNode(d.Name))};e.prototype=new m.Dialog;e.prototype.TEMPLATE='\x3cdiv id\x3d"message" style\x3d"width: 25em; padding-bottom: 5px;"\x3e\x3c/div\x3e\x3cdiv id\x3d"directoryTree" class\x3d"explorerTreeClass" style\x3d"width:25em; min-height: 25em; max-height:30em; height: auto; overflow-y: auto;"\x3e\x3c/div\x3e';
e.prototype._init=function(a){this.title=a.title||l["Choose a Folder"];this.modal=!0;this.buttons=[{text:l.OK,isDefault:!0,callback:this.done.bind(this)}];this.customFocus=!0;this._fileClient=a.fileClient;this._serviceRegistry=a.serviceRegistry;this._message=a.message||"";this._func=a.func;this._initialize()};e.prototype._bindToDom=function(a){this.loadFolderList("/");this._message?this.$message.appendChild(document.createTextNode(this._message)):this.$message.style.display="none";this.$directoryTree.focus()};
e.prototype.loadFolderList=function(b){b=k.makeRelative(b);this.selection=new g.Selection(this._serviceRegistry,"orion.directoryPrompter.selection");this.explorer=new d.FileExplorer({treeRoot:{children:[]},selection:this.selection,serviceRegistry:this._serviceRegistry,fileClient:this._fileClient,parentId:"directoryTree",excludeFiles:!0,rendererFactory:function(b){return new a({checkbox:!1,singleSelection:!0,treeTableClass:"directoryPrompter"},b)}});this.explorer.loadResourceList(b,!0,null)};e.prototype.done=
function(){this.selection.getSelection(function(a){this.hide();this._func(a)}.bind(this))};e.prototype.constructor=e;return{DirectoryPrompterDialog:e}});
define("orion/git/widgets/CloneGitRepositoryDialog",["i18n!git/nls/gitmessages","orion/webui/dialogs/DirectoryPrompterDialog","orion/webui/dialog","orion/URITemplate","require"],function(l,n,m,k,g){function h(d){this._init(d)}var f=new k("edit/edit.html#{,resource,params*}");h.prototype=new m.Dialog;h.prototype.TEMPLATE='\x3cspan id\x3d"basicPane"\x3e\x3cdiv style\x3d"padding: 8px"\x3e\x3clabel for\x3d"gitUrl"\x3e${Repository URL:}\x3c/label\x3e\x3cinput id\x3d"gitUrl" style\x3d"width: 50em" value\x3d""/\x3e\x3c/div\x3e\x3cdiv style\x3d"padding: 8px; text-align: right;"\x3e\x3ca id\x3d"advancedLink" href\x3d"javascript:"\x3e${Choose target location}\x3c/a\x3e\x3ca id\x3d"advancedLinkHide" href\x3d"javascript:" style\x3d"display: none"\x3e${Default target location}\x3c/a\x3e\x3c/div\x3e\x3c/span\x3e\x3cspan id\x3d"advancedPane" style\x3d"display: none;"\x3e\x3cdiv style\x3d"padding: 8px"\x3e\x3cinput id\x3d"isNewProject" type\x3d"radio" name\x3d"isNewProject" checked value\x3d"new"/\x3e\x3clabel for\x3d"gitName" style\x3d"padding: 0 8px"\x3e${New folder:}\x3c/label\x3e\x3cinput id\x3d"gitName" value\x3d""\x3e\x3c/div\x3e\x3cdiv style\x3d"padding: 8px"\x3e\x3cinput id\x3d"isExistingProject" type\x3d"radio" name\x3d"isNewProject" value\x3d"existing"/\x3e\x3clabel for\x3d"gitPath" style\x3d"padding: 0 8px"\x3e${Existing directory:}\x3c/label\x3e\x3cinput id\x3d"gitPath" type\x3d"hidden" value\x3d""\x3e\x3cspan id\x3d"shownGitPath" style\x3d"padding-right: 24px"\x3e\x3c/span\x3e\x3ca id\x3d"changeGitPath" href\x3d"javascript:"\x3e${Change...}\x3c/a\x3e\x3c/div\x3e\x3c/span\x3e';h.prototype._init=
function(d){var a=this;this.title=d.title?d.title:l["Clone Git Repository"];this.modal=!0;this.messages=l;this.advancedShown=!1;this.alwaysShowAdvanced=d.alwaysShowAdvanced;this.advancedOnly=d.advancedOnly;this.url=d.url;this.serviceRegistry=d.serviceRegistry;this.fileClient=d.fileClient;this.func=d.func;this.buttons=[];this.buttons.push({callback:function(){a.destroy();a._execute()},text:"OK"});this._initialize()};h.prototype._bindToDom=function(d){var a=this;this.url&&(this.$gitUrl.value=this.url);
this.advancedOnly&&(this.$basicPane.style.display="none",this.$advancedPane.style.display="",setTimeout(function(){a.$gitName.focus()},400));this.$changeGitPath.addEventListener("click",function(d){a._openDirectoryPickerDialog()});this.$isExistingProject.addEventListener("click",function(d){a._checkNewExisting()});this.$isNewProject.addEventListener("click",function(d){a._checkNewExisting()});this.$gitName.addEventListener("focus",function(d){a._showNewProject()});this.$advancedLink.addEventListener("click",
function(d){a._showAdvanced()});this.$advancedLinkHide.addEventListener("click",function(d){a._hideAdvanced()});this.alwaysShowAdvanced&&this._showAdvanced()};h.prototype._execute=function(){this.func&&this.func(this.advancedOnly?void 0:this.$gitUrl.value,this.advancedShown&&this.$isNewProject.checked?void 0:this.$gitPath.value,this.advancedShown&&!this.$isNewProject.checked?void 0:this.$gitName.value)};h.prototype._showAdvanced=function(){this.advancedShown=!0;this.$advancedPane.style.display="";
this.$advancedLink.style.display="none";this.$advancedLinkHide.style.display=""};h.prototype._hideAdvanced=function(){this.advancedShown=!1;this.$advancedPane.style.display="none";this.$advancedLink.style.display="";this.$advancedLinkHide.style.display="none"};h.prototype._checkNewExisting=function(){this.$isExistingProject.checked?this._openDirectoryPickerDialog():this.$gitName.focus()};h.prototype._showNewProject=function(){this.$isNewProject.checked=!0};h.prototype._openDirectoryPickerDialog=function(){function d(a){var d=
document.createElement("a");d.href=g.toUrl(f.expand({resource:a.ChildrenLocation}));d.textContent=a.Name;return d}var a=this;this.$isExistingProject.checked=!0;var e=new n.DirectoryPrompterDialog({title:l["Choose a Folder"],serviceRegistry:this.serviceRegistry,fileClient:this.fileClient,func:function(b){if(b&&b.Location){for(a.$gitPath.value=b.Location;a.$shownGitPath.hasChildNodes();)a.$shownGitPath.removeChild(a.$shownGitPath.lastChild);for(a.$shownGitPath.appendChild(d(b));b.parent&&"/"!==b.parent.Location;)a.$shownGitPath.insertBefore(document.createTextNode("/"),
a.$shownGitPath.firstChild),a.$shownGitPath.insertBefore(d(b.parent),a.$shownGitPath.firstChild),b=b.parent}}});this._addChildDialog(e);e.show()};h.prototype.constructor=h;return{CloneGitRepositoryDialog:h}});
define("orion/git/widgets/OpenCommitDialog","require i18n!git/nls/gitmessages orion/i18nUtil orion/Deferred orion/webui/dialog orion/URITemplate orion/webui/littlelib".split(" "),function(l,n,m,k,g,h,f){function d(a){this._init(a)}var a=new h("git/git-commit.html#{,resource,params*}?page\x3d1\x26pageSize\x3d1");d.prototype=new g.Dialog;d.prototype.TEMPLATE='\x3cdiv\x3e\x3clabel for\x3d"resourceName"\x3e${Type the commit name (sha1):}\x3c/label\x3e\x3c/div\x3e\x3cdiv\x3e\x3cinput type\x3d"text" id\x3d"resourceName"\x3e\x3c/div\x3e\x3cdiv id\x3d"results" style\x3d"max-height:400px; height:auto; overflow-y:auto;"\x3e\x3c/div\x3e';
d.prototype._init=function(a){this.title=a.title||n["Find Commit"];this.modal=!0;this.messages=n;this.SEARCH_DELAY=500;this.timeoutId=null;this.time=0;this.serviceRegistry=a.serviceRegistry;if(!this.serviceRegistry)throw Error("Missing required argument: serviceRegistry");this.repositories=a.repositories;if(!this.repositories)throw Error("Missing required argument: repositories");this.commitName=a.commitName;this._initialize()};d.prototype._bindToDom=function(a){var b=this;this.$resourceName.addEventListener("input",
function(a){b.time=+new Date;b.timeoutId&&clearTimeout(b.timeoutId);b.timeoutId=setTimeout(b._checkSearch.bind(b),0)},!1);this.$resourceName.addEventListener("keydown",function(a){if(a.keyCode===f.KEY.ENTER){var d=f.$("a",b.$results);d&&(f.stop(a),window.open(d.href),b.hide())}},!1);this.$resourceName.value=this.commitName};d.prototype._checkSearch=function(){clearTimeout(this.timeoutId);var a=(new Date).getTime();a-this.time>this.SEARCH_DELAY?(this.time=a,this._doSearch()):this.timeoutId=setTimeout(this._checkSearch.bind(this),
50)};d.prototype._findCommitLocation=function(a,b,d){var f=this;d||(d=new k);0<a.length?this.serviceRegistry.getService("orion.page.progress").progress(f.serviceRegistry.getService("orion.git.provider").doGitLog("/gitapi/commit/"+b+a[0].ContentLocation+"?page\x3d1\x26pageSize\x3d1"),"Getting commit details "+b).then(function(a){d.resolve(a.Children[0])},function(g){f._findCommitLocation(a.slice(1),b,d)}):d.reject();return d};d.prototype._doSearch=function(){var a=this,b=this.$resourceName&&this.$resourceName.value;
if(b){var d=document.createElement("div");d.appendChild(document.createTextNode(n["Searching..."]));f.empty(this.$results);this.$results.appendChild(d);this.serviceRegistry.getService("orion.page.message").setProgressMessage(n["Looking for the commit"]);this._findCommitLocation(this.repositories,b).then(function(b){f.empty(a.$results);a._displayCommit(b,a.$results);a.serviceRegistry.getService("orion.page.message").setProgressMessage("")},function(b){b=document.createElement("div");b.appendChild(document.createTextNode("No commits found"));
f.empty(a.$results);a.$results.appendChild(b);a.serviceRegistry.getService("orion.page.message").setProgressMessage("")})}};d.prototype._displayCommit=function(d,b){var g=this,h=document.createElement("div");h.style.padding="10px";h.style.maxWidth="480px";f.empty(b);b.appendChild(h);var k=d.Message.split(/(\r?\n|$)/)[0],u=document.createElement("a");u.className="navlinkonpage";u.href=l.toUrl(a.expand({resource:d.Location}));u.textContent=k;h.appendChild(u);u.addEventListener("mouseup",function(a){0===
a.button&&(!a.ctrlKey&&!a.metaKey)&&g.hide()},!1);u.addEventListener("keyup",function(a){a.keyCode===f.KEY.ENTER&&g.hide()},!1);k=document.createElement("div");k.style.paddingTop="15px";h.appendChild(k);d.AuthorImage&&(h=new Image,h.src=d.AuthorImage,h.name=d.AuthorName,h.className="git-author-icon",k.appendChild(h));h=document.createElement("div");h.textContent=m.formatMessage(n[" authored by ${0} {${1}) on ${2}"],d.AuthorName,d.AuthorEmail,(new Date(d.Time)).toLocaleString());k.appendChild(h);h=
document.createElement("div");h.textContent=m.formatMessage(n["committed by 0 (1)"],d.CommitterName,d.CommitterEmail);k.appendChild(h);h=document.createElement("div");h.style.paddingTop="15px";h.textContent=n["commit:"]+d.Name;k.appendChild(h);d.Parents&&0<d.Parents.length&&(b=document.createElement("div"),b.textContent=n["parent:"],h=document.createElement("a"),h.className="navlinkonpage",h.href=l.toUrl(a.expand({resource:d.Parents[0].Location})),h.textContent=d.Parents[0].Name,b.appendChild(h),
h.addEventListener("mouseup",function(a){0===a.button&&(!a.ctrlKey&&!a.metaKey)&&g.hide()},!1),h.addEventListener("keyup",function(a){a.keyCode===f.KEY.ENTER&&g.hide()},!1),k.appendChild(b))};d.prototype._beforeHiding=function(){clearTimeout(this._timeoutId)};d.prototype.constructor=d;return{OpenCommitDialog:d}});
define("orion/git/widgets/ApplyPatchDialog",["i18n!git/nls/gitmessages","orion/webui/dialog"],function(l,n){function m(k){this._init(k)}m.prototype=new n.Dialog;m.prototype.TEMPLATE='\x3cdiv style\x3d"padding:4px"\x3e\x3cinput type\x3d"radio" name\x3d"radio" value\x3d"urlRadio" id\x3d"urlRadio" checked/\x3e'+l["URL:"]+'\x3cinput type\x3d"text" name\x3d"url" id\x3d"url"/\x3e\x3c/div\x3e\x3cdiv style\x3d"padding:4px"\x3e\x3cinput type\x3d"radio" name\x3d"radio" value\x3d"fileRadio" id\x3d"fileRadio"/\x3e'+
l["File:"]+'\x3cinput type\x3d"file" name\x3d"selectedFile" id\x3d"selectedFile" class\x3d"uploadChooser" /\x3e\x3c/div\x3e';m.prototype._init=function(k){var g=this;this.title=l["Apply Patch"];this.modal=!0;this.messages=l;this.options=k;this.buttons=[];this.buttons.push({callback:function(){g._applyPatch()},text:l.OK});this._initialize()};m.prototype._bindToDom=function(k){this.$selectedFile.onchange=function(g){this.$urlRadio.checked=!1;this.$fileRadio.checked="fileRadio"}.bind(this);this.$url.onchange=
function(g){this.$urlRadio.checked="urlRadio";this.$fileRadio.checked=!1}.bind(this)};m.prototype._applyPatch=function(k){k=new FormData;k.append("uploadedfile",this.$selectedFile.files[0]);k.append("url",this.$url.value);k.append("radio",this.$fileRadio.checked?"fileRadio":"urlRadio");this.req=new XMLHttpRequest;this.req.open("post",this.options.diffLocation);this.req.setRequestHeader("Orion-Version","1");this.req.onreadystatechange=this.handleReadyState.bind(this);this.req.send(k)};m.prototype.handleReadyState=
function(k){4===this.req.readyState&&(200===this.req.status?this.options.deferred&&this.options.deferred.resolve(this.req.responseText):this.options.deferred&&this.options.deferred.reject(this.req.responseText),this.hide())};m.prototype.constructor=m;return{ApplyPatchDialog:m}});
define("orion/git/gitCommands","i18n!git/nls/gitmessages require orion/Deferred orion/i18nUtil orion/webui/littlelib orion/commands orion/commandRegistry orion/git/util orion/compare/compareUtils orion/git/gitPreferenceStorage orion/git/gitConfigPreference orion/git/widgets/ConfirmPushDialog orion/git/widgets/RemotePrompterDialog orion/git/widgets/ReviewRequestDialog orion/git/widgets/CloneGitRepositoryDialog orion/git/widgets/GitCredentialsDialog orion/git/widgets/OpenCommitDialog orion/git/widgets/CommitDialog orion/git/widgets/ApplyPatchDialog orion/URL-shim orion/PageLinks orion/URITemplate orion/git/logic/gitPush orion/git/logic/gitCommit orion/objects".split(" "),function(l,
n,m,k,g,h,f,d,a,e,b,p,q,s,u,w,x,y,r,t,z,B,v,A,C){var D={};(function(){function p(a){var b;try{b=JSON.parse(a.responseText)}catch(d){b={Message:l["Problem while performing the action"]}}b.HttpCode=a.status;return b}var q=!1,t=new B("git/git-repository.html#{,resource,params*}"),y=new B("git/git-log.html#{,resource,params*}?page\x3d1"),G=new B("git/git-log.html#{,resource,params*}"),H=new B("git/git-commit.html#{,resource,params*}?page\x3d1\x26pageSize\x3d1"),L=new B("edit/edit.html#{,resource,params*}");
D.updateNavTools=function(a,b,d,e,f,h,k){var l=g.node(e);if(l)b.destroy(l);else throw"could not find toolbar "+e;b.renderCommands(e,l,h,d,"button");if(k&&(e=g.node(k)))b.destroy(e),b.renderCommands(k,e,h,d,"button");if(f&&(h=g.node(f)))b.destroy(f),b.renderCommands(f,h,null,d,"button");q||(q=!0,a.getService("orion.page.selection").addEventListener("selectionChanged",function(a){var e=g.node(f);e&&(b.destroy(e),b.renderCommands(f,e,a.selections,d,"button"))}))};D.handleKnownHostsError=function(a,b,
e,f){if(confirm(k.formatMessage(l["Would you like to add ${0} key for host ${1} to continue operation? Key fingerpt is ${2}."],b.KeyType,b.Host,b.HostFingerprint))){var g=d.parseSshGitUrl(b.Url);b={host:b.Host,keyType:b.KeyType,hostKey:b.HostKey,port:g.port};a.getService("orion.net.ssh").addKnownHost(b).then(function(b){e.knownHosts=b;"undefined"!==typeof e.failedOperation&&a.getService("orion.page.progress").removeOperation(e.failedOperation);f(e)})}};D.handleSshAuthenticationError=function(a,b,
d,f,g){b=b?b.Url:void 0;var h=function(){(new w.GitCredentialsDialog({title:g,serviceRegistry:a,func:f,errordata:d.errordata,failedOperation:d.failedOperation})).show()};d.gitSshUsername&&""!==d.gitSshUsername||d.gitSshPassword&&""!==d.gitSshPassword||d.gitPrivateKey&&""!==d.gitPrivateKey?h():(new e(a)).get(b).then(function(b){""!==b.gitPrivateKey||""!==b.gitSshUsername||""!==b.gitSshPassword?("undefined"!==typeof d.failedOperation&&a.getService("orion.page.progress").removeOperation(d.failedOperation),
f({knownHosts:d.knownHosts,gitSshUsername:b.gitSshUsername,gitSshPassword:b.gitSshPassword,gitPrivateKey:b.gitPrivateKey,gitPassphrase:b.gitPassphrase})):h()},h)};D.getDefaultSshOptions=function(a,b,e){var f=new m;a=a.getService("orion.net.ssh");var g=e&&!e.optionsRequested?e.valueFor("sshuser"):"",h=e&&!e.optionsRequested?e.valueFor("sshpassword"):"",k;void 0!==b.GitUrl?k=b.GitUrl:void 0!==b.errorData?k=b.errorData.Url:void 0!==b.toRef?k=b.toRef.RemoteLocation[0].GitUrl:void 0!==b.RemoteLocation&&
(k=b.RemoteLocation[0].GitUrl);if(!k)return f.resolve({knownHosts:"",gitSshUsername:g,gitSshPassword:h,gitPrivateKey:"",gitPassphrase:""}),f;b=d.parseSshGitUrl(k);a.getKnownHostCredentials(b.host,b.port).then(function(a){f.resolve({knownHosts:a,gitSshUsername:g,gitSshPassword:h,gitPrivateKey:"",gitPassphrase:""})});return f};D.handleProgressServiceResponse=function(a,b,d,e,f,g){a&&void 0!==a.status&&(a=p(a));if(!a||void 0===a.HttpCode)e&&e(a);else switch(a.HttpCode){case 401:a.JsonData&&(b.errordata=
a.JsonData);a.failedOperation&&(b.failedOperation=a.failedOperation);D.handleSshAuthenticationError(d,a.JsonData,b,f,g);break;case 400:if(a.JsonData&&a.JsonData.HostKey){a.failedOperation&&(b.failedOperation=a.failedOperation);D.handleKnownHostsError(d,a.JsonData,b,f);break}else if(a.JsonData&&a.JsonData.Host){a.JsonData&&(b.errordata=a.JsonData);a.failedOperation&&(b.failedOperation=a.failedOperation);D.handleSshAuthenticationError(d,a.JsonData,b,f,g);break}default:b=[],b.Severity="Error",b.HTML=
!1,b.Message=a.DetailedMessage?a.DetailedMessage:a.Message,d.getService("orion.page.message").setProgressResult(b),e&&e(a)}};D.gatherSshCredentials=function(a,b,f,g){var h=new m,n;void 0!==b.items.RemoteLocation?n=b.items.RemoteLocation[0].GitUrl:void 0!==b.items.GitUrl?n=b.items.GitUrl:void 0!==b.items.errorData?n=b.items.errorData.Url:void 0!==b.items.toRef&&(n=b.items.toRef.RemoteLocation[0].GitUrl);g=a.getService("orion.net.ssh");var p=d.parseSshGitUrl(n),q=function(d){a.getService("orion.net.ssh").getKnownHostCredentials(p.host,
p.port).then(function(a){b.sshObject=d;h.resolve({knownHosts:a,gitSshUsername:d.gitSshUsername,gitSshPassword:d.gitSshPassword,gitPrivateKey:d.gitPrivateKey,gitPassphrase:d.gitPassphrase})})},s=b.errorData;if(s&&s.HostKey){if(confirm(k.formatMessage(l["Would you like to add ${0} key for host ${1} to continue operation? Key fingerpt is ${2}."],s.KeyType,s.Host,s.HostFingerprint))){var u=d.parseSshGitUrl(s.Url);g.addKnownHost({host:s.Host,keyType:s.KeyType,hostKey:s.HostKey,port:u.port}).then(function(){b.sshObject&&
(""!==b.sshObject.gitSshUsername||""!==b.sshObject.gitSshPassword||""!==b.sshObject.gitPrivateKey)?q({gitSshUsername:"",gitSshPassword:"",gitPrivateKey:"",gitPassphrase:""}):(new e(a)).get(n).then(function(a){q(a)},function(){q({gitSshUsername:"",gitSshPassword:"",gitPrivateKey:"",gitPassphrase:""})})})}return h}var t=function(){if(!b.parameters&&!b.optionsRequested)q({gitSshUsername:"",gitSshPassword:"",gitPrivateKey:"",gitPassphrase:""});else if(b.parameters&&!b.optionsRequested){var d=b.parameters&&
b.parameters.valueFor("sshuser")?b.parameters.valueFor("sshuser"):b.errorData.User,g=b.parameters?b.parameters.valueFor("sshpassword"):"",h=b.parameters&&b.parameters.valueFor("saveCredentials")?b.parameters.valueFor("saveCredentials"):!1,k=new e(a);h?k.put(n,{gitSshUsername:d,gitSshPassword:g}).then(function(){q({gitSshUsername:d,gitSshPassword:g,gitPrivateKey:"",gitPassphrase:""})}):q({gitSshUsername:d,gitSshPassword:g,gitPrivateKey:"",gitPassphrase:""})}else(new w.GitCredentialsDialog({title:f,
serviceRegistry:a,func:q,errordata:s})).show()};b.sshObject&&(""!==b.sshObject.gitSshUsername||""!==b.sshObject.gitSshPassword||""!==b.sshObject.gitPrivateKey)?t():(new e(a)).get(n).then(function(a){""!==a.gitPrivateKey||""!==a.gitSshUsername||""!==a.gitSshPassword?q(a):t()},t);return h};D.handleGitServiceResponse=function(a,b,d,f){a&&void 0!==a.status&&(a=p(a));if(!a||!a.HttpCode)d&&d(a);else switch(a.HttpCode){case 401:var g=new e(b);g.isEnabled().then(function(b){b&&void 0!==a.JsonData.Url?g.remove(a.JsonData.Url).then(function(){f(a)}):
f(a)});break;case 400:if(a.JsonData&&a.JsonData.HostKey){f(a);break}default:var h=[];h.Severity="Error";h.HTML=!1;h.Message="REJECTED_NONFASTFORWARD"===(a.DetailedMessage?a.DetailedMessage:a.Message)?l.REJECTED_NONFASTFORWARD:a.DetailedMessage?a.DetailedMessage:a.Message;b.getService("orion.page.message").setProgressResult(h);d&&d(a)}};D.createFileCommands=function(b,d,g,p){function q(a){var d={Severity:"Error",HTML:!1};try{var e=JSON.parse(a.responseText);401===a.status?(d.HTML=!0,d.Message="\x3cspan\x3e",
d.Message+=k.formatMessage(l["Authentication required for: ${0}. ${1} and re-try the request."],e.label,'\x3ca target\x3d"_blank" href\x3d"'+e.SignInLocation+'"\x3e'+l.Login+"\x3c/a\x3e")+"\x3c/span\x3e"):d.Message=e.DetailedMessage?e.DetailedMessage:e.Message?e.Message:l["Problem while performing the action"]}catch(f){d.Message=l["Problem while performing the action"]}b.getService("orion.page.message").setProgressResult(d)}var u=function(a){a&&a.handler.changedItem?a.handler.changedItem():g.changedItem()},
r=new f.ParametersDescription([new f.CommandParameter("name","text",l["Local Branch Name:"])]),r=new h.Command({name:l.Checkout,tooltip:l["Checkout the current tag, creating a local branch based on its contents."],imageClass:"git-sprite-checkout",spriteClass:"gitCommandSprite",id:"eclipse.checkoutTag",parameters:r,callback:function(a){var d=a.items,e=function(a,d,e){b.getService("orion.page.progress").showWhile(b.getService("orion.git.provider").checkoutTag(a,d,e),k.formatMessage(l["Checking out tag ${0}"],
e)).then(function(){g.changedItem()},q)},f=d.Repository?d.Repository.Location:d.CloneLocation;a.parameters.valueFor("name")&&!a.parameters.optionsRequested&&e(f,d.Name,a.parameters.valueFor("name"))},visibleWhen:function(a){return"Tag"===a.Type||"Commit"===a.Type}});d.addCommand(r);r=new h.Command({name:l.Checkout,tooltip:l["Checkout the branch or corresponding local branch and make it active. If the remote tracking branch does not have a corresponding local branch, the local branch will be created first."],
imageClass:"git-sprite-checkout",spriteClass:"gitCommandSprite",id:"eclipse.checkoutBranch",callback:function(a){var d=a.items,e=b.getService("orion.git.provider"),f=b.getService("orion.page.message"),h=b.getService("orion.page.progress");f.setProgressMessage(d.Name?k.formatMessage(l["Checking out branch ${0}..."],d.Name):l["Checking out branch..."]);"Branch"===d.Type?h.progress(e.checkoutBranch(d.CloneLocation,d.Name),"Checking out branch "+d.Name).then(function(){f.setProgressResult(l["Branch checked out."]);
g.changedItem(d.parent)},function(a){q(a)}):h.progress(e.addBranch(d.Repository?d.Repository.BranchLocation:d.parent.parent.repository.BranchLocation,null,d.Name),"Adding branch "+d.Name).then(function(a){h.progress(e.checkoutBranch(a.CloneLocation,a.Name),"Checking out branch "+d.Name).then(function(){f.setProgressResult(l["Branch checked out."]);g.changedItem(d.Repository?d.Repository.BranchLocation:d.parent.parent.parent)},function(a){q(a)})},function(a){q(a)})},visibleWhen:function(a){return"Branch"===
a.Type||"RemoteTrackingBranch"===a.Type}});d.addCommand(r);r=new f.ParametersDescription([new f.CommandParameter("name","text","Name:")]);r=new h.Command({name:l["New Branch"],tooltip:l["Add a new local branch to the repository"],id:"eclipse.addBranch",parameters:r,callback:function(a){var d=a.items,e=b.getService("orion.page.progress"),f=function(a,f){e.progress(b.getService("orion.git.provider").addBranch(a,f),"Adding branch "+f).then(function(){g.changedItem(d)},q)},h;h="Clone"===d.Type?d.BranchLocation:
d.Location;a.parameters.valueFor("name")&&!a.parameters.optionsRequested&&f(h,a.parameters.valueFor("name"))},visibleWhen:function(a){return a.GroupNode&&"Branches"===a.Name||"Clone"===a.Type&&"artifacts"===g.parentId}});d.addCommand(r);r=new h.Command({name:l.Delete,tooltip:l["Delete the local branch from the repository"],imageClass:"core-sprite-delete",id:"eclipse.removeBranch",callback:function(a){var d=a.items;a=b.getService("orion.page.progress");confirm(k.formatMessage(l["Are you sure you want to delete branch ${0}?"],
d.Name))&&a.progress(b.getService("orion.git.provider").removeBranch(d.Location),"Removing branch "+d.Name).then(function(){g.changedItem?g.changedItem(d.parent):g.displayBranches&&g.displayBranches(d.ParentLocation,null)},q)},visibleWhen:function(a){return"Branch"===a.Type&&!a.Current}});d.addCommand(r);r=new h.Command({name:l.Delete,tooltip:l["Delete the remote tracking branch from the repository"],imageClass:"core-sprite-delete",id:"eclipse.removeRemoteBranch",callback:function(a){var d=a.items,
e=b.getService("orion.page.progress");confirm(k.formatMessage(l["You're going to delete remote branch ${0} and push the change."],d.Name)+"\n\n"+l["Are you sure?"])&&D.getDefaultSshOptions(b,d).then(function(a){var f=arguments.callee,h=b.getService("orion.git.provider"),k=b.getService("orion.page.message"),h=e.progress(h.doPush(d.Location,"",!1,!1,a.gitSshUsername,a.gitSshPassword,a.knownHosts,a.gitPrivateKey,a.gitPassphrase),l["Removing remote branch: "]+d.Name);k.createProgressMonitor(h,l["Removing remote branch: "]+
d.Name);h.then(function(e){D.handleProgressServiceResponse(e,a,b,function(a){"Ok"==a.Result.Severity&&g.changedItem(d.parent)},f,l["Delete Remote Branch"])},function(e,g){D.handleProgressServiceResponse(e,a,b,function(){},f,l["Removing remote branch: "]+d.Name)})})},visibleWhen:function(a){return"RemoteTrackingBranch"===a.Type}});d.addCommand(r);r=new f.ParametersDescription([new f.CommandParameter("name","text","Name:"),new f.CommandParameter("url","url","Url:")]);r=new h.Command({name:l["New Remote"],
tooltip:l["Add a new remote to the repository"],id:"eclipse.addRemote",parameters:r,callback:function(a){var d=a.items,e=b.getService("orion.page.progress"),f=function(a,f,h){e.progress(b.getService("orion.git.provider").addRemote(a,f,h),"Adding remote "+a).then(function(){g.changedItem(d)},q)},h;h="Clone"===d.Type?d.RemoteLocation:d.Location;a.parameters.valueFor("name")&&a.parameters.valueFor("url")&&f(h,a.parameters.valueFor("name"),a.parameters.valueFor("url"))},visibleWhen:function(a){return a.GroupNode&&
"Remotes"===a.Name||"Clone"===a.Type&&"artifacts"===g.parentId}});d.addCommand(r);r=new h.Command({name:l.Delete,tooltip:l["Delete the remote from the repository"],imageClass:"core-sprite-delete",id:"eclipse.removeRemote",callback:function(a){var d=a.items;confirm(k.formatMessage(l["Are you sure you want to delete remote ${0}?"],d.Name))&&b.getService("orion.page.progress").progress(b.getService("orion.git.provider").removeRemote(d.Location),"Removing remote "+d.Name).then(function(){g.changedItem(d.parent)},
q)},visibleWhen:function(a){return"Remote"===a.Type}});d.addCommand(r);r=new h.Command({name:l.Pull,tooltip:l["Pull from the repository"],imageClass:"git-sprite-pull",spriteClass:"gitCommandSprite",id:"eclipse.orion.git.pull",callback:function(a){var d=a.items,e=d.Location,f=d.Name;D.getDefaultSshOptions(b,d).then(function(a){var h=arguments.callee,k=b.getService("orion.git.provider"),m=b.getService("orion.page.message"),k=b.getService("orion.page.progress").progress(k.doPull(e,!1,a.gitSshUsername,
a.gitSshPassword,a.knownHosts,a.gitPrivateKey,a.gitPassphrase),l["Pulling: "]+f);m.createProgressMonitor(k,l["Pulling: "]+f);var n;k.then(function(e){D.handleProgressServiceResponse(e,a,b,function(a){"Clone"===d.Type&&g.changedItem(d)},h,"Pull Git Repository")},function(e,f){n&&(e.failedOperation=n);D.handleProgressServiceResponse(e,a,b,function(){g.changedItem(d)},h,l["Pull Git Repository"])},function(a){n=a.Location})})},visibleWhen:function(a){return"Clone"===a.Type}});d.addCommand(r);r=new h.Command({name:l["Git Log"],
tooltip:l["Open the log for the branch"],id:"eclipse.openGitLog",hrefCallback:function(a){return n.toUrl(y.expand({resource:a.items.CommitLocation}))},visibleWhen:function(a){return"Branch"===a.Type||"RemoteTrackingBranch"===a.Type}});d.addCommand(r);r=new h.Command({name:l["Git Log"],tooltip:l["Open the log for the repository"],id:"eclipse.openGitLogAll",imageClass:"git-sprite-log",spriteClass:"gitCommandSprite",hrefCallback:function(a){return n.toUrl(y.expand({resource:a.items.CommitLocation}))},
visibleWhen:function(a){return!a.CommitLocation||!a.StatusLocation?!1:!0}});d.addCommand(r);r=new h.Command({name:l.ShowInEditor,tooltip:l.ShowInEditorTooltip,id:"eclipse.openCloneContent",hrefCallback:function(a){return n.toUrl(L.expand({resource:a.items.ContentLocation}))},visibleWhen:function(a){return!a.ContentLocation?!1:!0}});d.addCommand(r);r=new h.Command({name:l["Compare With Each Other"],id:"eclipse.compareGitCommits",hrefCallback:function(d){d=d.items;return b.getService("orion.page.progress").progress(b.getService("orion.git.provider").getDiff(d[1].DiffLocation,
d[0].Name),"Generating Diff for "+d[0].Name+" and "+d[1].Name).then(function(b){return a.generateCompareHref(b.Location,{readonly:!0})})},visibleWhen:function(a){return g.isDirectory?!1:Array.isArray(a)&&2===a.length&&"Commit"===a[0].Type&&"Commit"===a[1].Type?!0:!1}});d.addCommand(r);r=new h.Command({name:l["Compare With Working Tree"],imageClass:"git-sprite-compare",spriteClass:"gitCommandSprite",id:"eclipse.compareWithWorkingTree",hrefCallback:function(b){return a.generateCompareHref(b.items.DiffLocation,
{})},visibleWhen:function(a){return"Commit"===a.Type&&null!==a.ContentLocation&&!g.isDirectory}});d.addCommand(r);r=new h.Command({name:l.Open,id:"eclipse.openGitCommit",imageClass:"git-sprite-open",spriteClass:"gitCommandSprite",hrefCallback:function(a){return n.toUrl(L.expand({resource:a.items.ContentLocation}))},visibleWhen:function(a){return"Commit"===a.Type&&null!=a.ContentLocation&&!g.isDirectory}});d.addCommand(r);var w=function(a,g,h){var k=new m;if(h&&!h(h))return k.reject(),k;h=a.items;
var n=!1;h.LocalBranch&&h.RemoteBranch&&(n=h.noAuth,h=h.RemoteBranch);var p=h.Location,s=h.Name,r=function(a,g){a.JsonData.HostKey?(g.parameters=null,g.errorData=a.JsonData,g.errorData.failedOperation=a.failedOperation,d.collectParameters(g)):g.optionsRequested?(g.errorData=a.JsonData,g.errorData.failedOperation=a.failedOperation,d.collectParameters(g)):(new e(b)).isEnabled().then(function(b){g.parameters=b?a.JsonData.User?new f.ParametersDescription([new f.CommandParameter("sshpassword","password",
l["Password:"]),new f.CommandParameter("saveCredentials","boolean",l["Don't prompt me again:"])],{hasOptionalParameters:!0}):new f.ParametersDescription([new f.CommandParameter("sshuser","text",l["User Name:"]),new f.CommandParameter("sshpassword","password",l["Password:"]),new f.CommandParameter("saveCredentials","boolean",l["Don't prompt me again:"])],{hasOptionalParameters:!0}):a.JsonData.User?new f.ParametersDescription([new f.CommandParameter("sshpassword","password",l["Password:"])],{hasOptionalParameters:!0}):
new f.ParametersDescription([new f.CommandParameter("sshuser","text",l["User Name:"]),new f.CommandParameter("sshpassword","password",l["Password:"])],{hasOptionalParameters:!0});g.errorData=a.JsonData;g.errorData.failedOperation=a.failedOperation;d.collectParameters(g)})},u=function(){a.parameters&&a.parameters.optionsRequested?(a.parameters=null,a.optionsRequested=!0,d.collectParameters(a)):(a.errorData&&a.errorData.failedOperation&&b.getService("orion.page.progress").removeOperation(a.errorData.failedOperation),
D.gatherSshCredentials(b,a,null).then(function(d){var e=b.getService("orion.git.provider"),f=b.getService("orion.page.message");d=b.getService("orion.page.progress").progress(e.doFetch(p,g,d.gitSshUsername,d.gitSshPassword,d.knownHosts,d.gitPrivateKey,d.gitPassphrase),l["Fetching remote: "]+s);f.createProgressMonitor(d,l["Fetching remote: "]+s);d.then(function(d){D.handleGitServiceResponse(d,b,function(){k.resolve()},function(b){r(b,a)})},function(d){var e=d.status||d.HttpCode;n&&(400===e||401===
e)?k.reject():D.handleGitServiceResponse(d,b,function(){k.resolve()},function(b){r(b,a)})})},k.reject))};if(a.items.GitUrl)u();else{var t=b.getService("orion.git.provider"),v=b.getService("orion.page.progress");v.progress(t.getGitRemote(p),"Getting remote details "+s).then(function(b){v.progress(t.getGitClone(b.CloneLocation),"Getting git repository information "+b.Name).then(function(b){a.items.GitUrl=b.Children[0].GitUrl;u()},q)},q)}return k},r=function(a){a.LocalBranch&&a.RemoteBranch&&(a=a.RemoteBranch);
return"RemoteTrackingBranch"===a.Type||"Remote"===a.Type||"Commit"===a.Type&&a.toRef&&"RemoteTrackingBranch"===a.toRef.Type?!0:!1},x=new h.Command({name:l.Fetch,tooltip:l["Fetch from the remote"],imageClass:"git-sprite-fetch",spriteClass:"gitCommandSprite",id:"eclipse.orion.git.fetch",callback:function(a){return w(a,!1).then(function(){u(a)})},visibleWhen:r});d.addCommand(x);r=new h.Command({name:l["Force Fetch"],imageClass:"git-sprite-fetch",spriteClass:"gitCommandSprite",tooltip:l["Fetch from the remote branch into your remote tracking branch overriding its current content"],
id:"eclipse.orion.git.fetchForce",callback:function(a){w(a,!0,l["You're going to override content of the remote tracking branch. This can cause the branch to lose commits."]+"\n\n"+l["Are you sure?"]).then(function(){u(a)})},visibleWhen:r});d.addCommand(r);r=new h.Command({name:l.Merge,tooltip:l["Merge the content from the branch to your active branch"],imageClass:"git-sprite-merge",spriteClass:"gitCommandSprite",id:"eclipse.orion.git.merge",callback:function(a){var d=a.items;a=b.getService("orion.git.provider");
var e=b.getService("orion.page.progress"),f=b.getService("orion.page.message");e.progress(a.doMerge(d.HeadLocation,d.Name,!1),"Merging "+d.Name).then(function(a){var b={};if("FAST_FORWARD"===a.Result||"ALREADY_UP_TO_DATE"===a.Result)b.Severity="Ok",b.HTML=!1,b.Message=a.Result;else if(a.Result){b.Severity="Warning";b.HTML=!0;b.Message="\x3cspan\x3e"+a.Result;if(a.FailingPaths){var e="",h=!0,m;for(m in a.FailingPaths)h||(e+=", "),h=!1,e+=m;h||(b.Severity="Error",b.Message+=". "+k.formatMessage(l["Failing paths: ${0}"],
e))}b.Message+="\x3c/span\x3e"}else a.error&&(b.Severity="Error",a.error.responseText&&JSON.parse(a.error.responseText)?(a=JSON.parse(a.error.responseText),b.Message=a.DetailedMessage?a.DetailedMessage:a.Message):b.Message=a.error.message,b.HTML=!0,b.Message="\x3cspan\x3e"+b.Message+"\x3c/span\x3e");f.setProgressResult(b);g.changedItem(d)},function(a,e){var f={Severity:"Error",HTML:!0};f.Message="\x3cspan\x3e"+JSON.stringify(e.xhr.responseText).DetailedMessage+"\x3c/span\x3e";b.getService("orion.page.message").setProgressResult(f);
g.changedItem(d)})},visibleWhen:function(a){return"RemoteTrackingBranch"===a.Type||"Branch"===a.Type&&!a.Current||"Commit"===a.Type&&a.toRef&&"RemoteTrackingBranch"===a.toRef.Type?!0:!1}});d.addCommand(r);r=new h.Command({name:l["Merge Squash"],tooltip:l["Squash the content of the branch to the index"],imageClass:"git-sprite-merge-squash",spriteClass:"gitCommandSprite",id:"eclipse.orion.git.mergeSquash",callback:function(a){var d=a.items;a=b.getService("orion.git.provider");var e=b.getService("orion.page.progress"),
f=b.getService("orion.page.message");e.progress(a.doMerge(d.HeadLocation,d.Name,!0),"Merging "+d.Name).then(function(a){var b=[];"FAST_FORWARD_SQUASHED"===a.Result||"ALREADY_UP_TO_DATE"===a.Result?(b.Severity="Ok",b.HTML=!1,b.Message=a.Result):a.Result?(b.Severity="Warning",b.HTML=!0,b.Message="\x3cspan\x3e"+a.Result+"\x3c/span\x3e"):a.error&&(b.Severity="Error",a.error.responseText&&JSON.parse(a.error.responseText)?(a=JSON.parse(a.error.responseText),b.Message=a.DetailedMessage?a.DetailedMessage:
a.Message):b.Message=a.error.message,b.HTML=!0,b.Message="\x3cspan\x3e"+b.Message+"\x3c/span\x3e");f.setProgressResult(b);g.changedItem(d)},function(a,e){var f=[];f.Severity="Error";f.HTML=!0;f.Message="\x3cspan\x3e"+JSON.stringify(e.xhr.responseText).DetailedMessage+".\x3c/span\x3e";b.getService("orion.page.message").setProgressResult(f);g.changedItem(d)})},visibleWhen:function(a){return"RemoteTrackingBranch"===a.Type||"Branch"===a.Type&&!a.Current||"Commit"===a.Type&&a.toRef&&"RemoteTrackingBranch"===
a.toRef.Type?!0:!1}});d.addCommand(r);var A=function(a){var d=new m;a=a.items;a.LocalBranch&&a.RemoteBranch&&(a=a.RemoteBranch);var e=b.getService("orion.page.message"),f=b.getService("orion.page.progress").progress(b.getService("orion.git.provider").doRebase(a.HeadLocation,a.Name,"BEGIN"),a.Name?l["Rebase on top of "]+a.Name:l.Rebase);e.createProgressMonitor(f,a.Name?l["Rebase on top of "]+a.Name:l.Rebase);f.then(function(a){var e={};switch(a.Result){case "OK":case "FAST_FORWARD":case "UP_TO_DATE":e.Severity=
"Ok";break;case "FAILED_WRONG_REPOSITORY_STATE":case "FAILED_UNMERGED_PATHS":case "FAILED_PENDING_CHANGES":case "UNCOMMITTED_CHANGES":e.Severity="Error";break;default:e.Severity="Warning"}if("Ok"===e.Severity)e.HTML=!1,e.Message=a.Result,d.resolve(a);else{e.HTML=!0;var f=l["Rebase"+a.Result];e.Message="\x3cspan\x3e"+a.Result+(f?f:"")+"\x3c/span\x3e";d.reject(a)}b.getService("orion.page.message").setProgressResult(e)},function(a){q(a);d.reject()});return d},r=new h.Command({name:l.Rebase,tooltip:l["Rebase your commits by removing them from the active branch, starting the active branch again based on the latest state of the selected branch "]+
"and applying each commit again to the updated active branch.",id:"eclipse.orion.git.rebase",imageClass:"git-sprite-rebase",spriteClass:"gitCommandSprite",callback:function(a){A(a).then(function(){u(a)},function(){u()})},visibleWhen:function(a){this.tooltip=l["Rebase your commits by removing them from the active branch, "]+l["starting the active branch again based on the latest state of '"]+a.Name+"' "+l["and applying each commit again to the updated active branch."];return"RemoteTrackingBranch"===
a.Type||"Branch"===a.Type&&!a.Current}});d.addCommand(r);p={serviceRegistry:b,commandService:d,explorer:g,toolbarId:p};var B=v(C.mixin(p,{tags:!0,force:!1})).perform,M=v(C.mixin(p,{tags:!1,force:!1})).perform,O=v(C.mixin(p,{tags:!0,force:!0})).perform,E=v(C.mixin(p,{tags:!1,force:!0})).perform,$=v(C.mixin(p,{tags:!1,force:!1,gerrit:!0})).perform;p=function(a){a.LocalBranch&&a.RemoteBranch&&(a=a.LocalBranch);return a.toRef?""===a.RepositoryPath&&"Branch"===a.toRef.Type&&a.toRef.Current&&a.toRef.RemoteLocation:
"Branch"===a.Type&&a.Current&&a.RemoteLocation};r=new h.Command({name:l.Sync,tooltip:l.SyncTooltip,extraClass:"primaryButton",id:"eclipse.orion.git.sync",callback:function(a){return w(a).then(function(){return A(a).then(function(b){return B(a).then(function(){u(a)})},function(){u()})})},visibleWhen:p});d.addCommand(r);r=new h.Command({name:l["Push All"],tooltip:l["Push commits and tags from your local branch into the remote branch"],imageClass:"git-sprite-push",spriteClass:"gitCommandSprite",id:"eclipse.orion.git.push",
callback:function(a){B(a).then(function(){u(a)})},visibleWhen:p});d.addCommand(r);r=new h.Command({name:l["Push Branch"],tooltip:l["Push commits without tags from your local branch into the remote branch"],imageClass:"git-sprite-push",spriteClass:"gitCommandSprite",id:"eclipse.orion.git.pushBranch",callback:function(a){M(a).then(function(){u(a)})},visibleWhen:p});d.addCommand(r);r=new h.Command({name:l["Push for Review"],tooltip:l["Push commits to Gerrit Code Review"],imageClass:"git-sprite-push",
spriteClass:"gitCommandSprite",id:"eclipse.orion.git.pushToGerrit",callback:function(a){$(a).then(function(){u(a)})},visibleWhen:function(a){a.LocalBranch&&a.RemoteBranch&&(a=a.LocalBranch);return a.toRef?""===a.RepositoryPath&&"Branch"===a.toRef.Type&&a.toRef.Current&&a.toRef.RemoteLocation&&a.toRef.RemoteLocation[0].IsGerrit:"Branch"===a.Type&&a.Current&&a.RemoteLocation&&a.RemoteLocation[0].IsGerrit}});d.addCommand(r);r=new h.Command({name:l["Force Push All"],tooltip:l["Push commits and tags from your local branch into the remote branch overriding its current content"],
imageClass:"git-sprite-push",spriteClass:"gitCommandSprite",id:"eclipse.orion.git.pushForce",callback:function(a){O(a).then(function(){u(a)})},visibleWhen:p});d.addCommand(r);p=new h.Command({name:l["Force Push Branch"],tooltip:l["Push commits without tags from your local branch into the remote branch overriding its current content"],imageClass:"git-sprite-push",spriteClass:"gitCommandSprite",id:"eclipse.orion.git.pushForceBranch",callback:function(a){E(a).then(function(){u(a)})},visibleWhen:p});
d.addCommand(p);p=new h.Command({name:l["\x3c Previous Page"],tooltip:l["Show previous page of git log"],id:"eclipse.orion.git.previousLogPage",hrefCallback:function(a){return n.toUrl(G.expand({resource:a.items.PreviousLocation}))},visibleWhen:function(a){return"RemoteTrackingBranch"===a.Type||a.toRef&&"Branch"===a.toRef.Type||null!==a.RepositoryPath?void 0!==a.PreviousLocation:!1}});d.addCommand(p);p=new h.Command({name:l["Next Page \x3e"],tooltip:l["Show next page of git log"],id:"eclipse.orion.git.nextLogPage",
hrefCallback:function(a){return n.toUrl(G.expand({resource:a.items.NextLocation}))},visibleWhen:function(a){return"RemoteTrackingBranch"===a.Type||a.toRef&&"Branch"===a.toRef.Type||null!==a.RepositoryPath?void 0!==a.NextLocation:!1}});d.addCommand(p);p=new h.Command({name:l["\x3c Previous Page"],tooltip:l["Show previous page of git tags"],id:"eclipse.orion.git.previousTagPage",hrefCallback:function(a){return n.toUrl(t.expand({resource:a.items.PreviousLocation}))},visibleWhen:function(a){return"Tag"===
a.Type?void 0!==a.PreviousLocation:!1}});d.addCommand(p);p=new h.Command({name:l["Next Page \x3e"],tooltip:l["Show next page of git tags"],id:"eclipse.orion.git.nextTagPage",hrefCallback:function(a){return n.toUrl(t.expand({resource:a.items.NextLocation}))},visibleWhen:function(a){return"Tag"===a.Type?void 0!==a.NextLocation:!1}});d.addCommand(p);var Y=function(a,d,e,f,h){var m=a.items;if(confirm(k.formatMessage(h,e))){a=b.getService("orion.git.provider");var n=b.getService("orion.page.message");
d=b.getService("orion.page.progress").progress(a.resetIndex(d,e,f),"Resetting git index for "+e);n.createProgressMonitor(d,l["Resetting index..."]);d.then(function(a){g.changedItem(m);n.setProgressResult({Severity:"Info",HTML:!1,Message:"Ok"})},function(a){var b={Severity:"Error",HTML:!1};b.Message=a.message;n.setProgressResult(b)})}};p=new h.Command({name:l.Reset,tooltip:l["Reset your active branch to the state of the selected branch. Discard all staged and unstaged changes."],id:"eclipse.orion.git.resetIndex",
imageClass:"git-sprite-reset",spriteClass:"gitCommandSprite",callback:function(a){Y(a,a.items.IndexLocation,a.items.Name,"HARD",l.GitResetIndexConfirm)},visibleWhen:function(a){return"RemoteTrackingBranch"===a.Type}});d.addCommand(p);p=new h.Command({name:l.Undo,tooltip:l.UndoTooltip,id:"eclipse.orion.git.undoCommit",callback:function(a){Y(a,a.items.parent.remoteBranch.IndexLocation,"HEAD^","SOFT",l.UndoConfirm)},visibleWhen:function(a){return"Commit"===a.Type&&a.parent&&"Outgoing"===a.parent.Type&&
a.parent.children&&a.parent.children[0].Name===a.Name}});d.addCommand(p);p=new f.ParametersDescription([new f.CommandParameter("name","text",l["Name:"])]);p=new h.Command({name:l.Tag,tooltip:l["Create a tag for the commit"],imageClass:"git-sprite-tag",spriteClass:"gitCommandSprite",id:"eclipse.orion.git.addTag",parameters:p,callback:function(a){var d=a.items,e=function(a,e){b.getService("orion.page.progress").progress(b.getService("orion.git.provider").doAddTag(a,e),"Adding tag "+e).then(function(){g.changedItem(d)},
q)},f=d.Location;a.parameters.valueFor("name")&&!a.parameters.optionsRequested&&e(f,a.parameters.valueFor("name"))},visibleWhen:function(a){return"Commit"===a.Type}});d.addCommand(p);p=new h.Command({name:l.Delete,tooltip:l["Delete the tag from the repository"],imageClass:"core-sprite-delete",id:"eclipse.removeTag",callback:function(a){var d=a.items;confirm(k.formatMessage(l["Are you sure you want to delete tag ${0}?"],d.Name))&&b.getService("orion.page.progress").progress(b.getService("orion.git.provider").doRemoveTag(d.Location),
"Removing tag "+d.Name).then(function(){g.changedItem(d.parent)},q)},visibleWhen:function(a){return"Tag"===a.Type}});d.addCommand(p);p=new f.ParametersDescription([new f.CommandParameter("reviewer","text",l["Reviewer name"])],{hasOptionalParameters:!0});p=new h.Command({name:l["Ask for review"],tooltip:l["Ask for review tooltip"],imageClass:"core-sprite-tag",id:"eclipse.orion.git.askForReviewCommand",parameters:p,callback:function(a){var d=b.getService("orion.page.progress"),e=function(a){var b=document.createElement("a");
b.href=a;"ssh:"===b.protocol&&(b=a.indexOf("@"),-1!==b&&(a="ssh://"+a.substr(b+1)));return a},f=function(f){var g=a.items,h=g.Location.replace(g.Name,"HEAD"),k=g.AuthorName,l=g.Name,m=g.Message;d.progress(b.getService("orion.git.provider").getGitClone(g.CloneLocation),"Getting repository details "+g.Name).then(function(a){window.location.href.split("#");var n=z.getOrionHome();a=e(a.Children[0].GitUrl);n=n+"/git/reviewRequest.html#"+a+"_"+g.Name;d.progress(b.getService("orion.git.provider").sendCommitReviewRequest(l,
h,f,n,k,m),"Sending review request for "+l).then(function(a){var d={Severity:"Ok",HTML:!1};d.Message=a.Result;b.getService("orion.page.message").setProgressResult(d)},q)})};if(a.parameters.valueFor("reviewer")&&!a.parameters.optionsRequested)f(a.parameters.valueFor("reviewer"));else{var g=a.items;d.progress(b.getService("orion.git.provider").getGitClone(g.CloneLocation),"Getting git details "+g.Name).then(function(a){window.location.href.split("#");var b=z.getOrionHome();a=e(a.Children[0].GitUrl);
(new s.ReviewRequestDialog({title:l["Contribution Review Request"],url:b+"/git/reviewRequest.html#"+a+"_"+g.Name,func:f})).show()},q)}},visibleWhen:function(a){return"Commit"===a.Type}});d.addCommand(p);p=new h.Command({name:l["Cherry-Pick"],tooltip:l["Apply the change introduced by the commit to your active branch"],id:"eclipse.orion.git.cherryPick",imageClass:"git-sprite-cherry-pick",spriteClass:"gitCommandSprite",callback:function(a){a=a.items;var d=b.getService("orion.page.progress"),e=b.getService("orion.git.provider"),
f=a.Location.replace(a.Name,"HEAD");d.progress(e.doCherryPick(f,a.Name),"Cherry picking "+a.Name).then(function(a){var d={};if("OK"===a.Result)d.Severity="Ok",a.HeadUpdated?(d.HTML=!1,d.Message=a.Result):(d.HTML=!0,d.Message="\x3cspan\x3e"+l["Nothing changed."]+"\x3c/span\x3e");else if("CONFLICTING"===a.Result)d.Severity="Warning",d.HTML=!0,d.Message="\x3cspan\x3e"+a.Result+l[". Some conflicts occurred"]+"\x3c/span\x3e";else if("FAILED"===a.Result){d.Severity="Error";d.HTML=!0;d.Message="\x3cspan\x3e"+
a.Result;if(a.FailingPaths){var e="",f=!0,g;for(g in a.FailingPaths)f||(e+=", "),f=!1,e+=g;f||(d.Message+=". "+k.formatMessage(l["Failing paths: ${0}"],e))}d.Message+="\x3c/span\x3e"}else d.Severity="Warning",d.HTML=!1,d.Message=a.Result;b.getService("orion.page.message").setProgressResult(d)},q)},visibleWhen:function(a){return"Commit"===a.Type}});d.addCommand(p);p=new h.Command({name:l.Revert,tooltip:l["Revert changes introduced by the commit into your active branch"],id:"eclipse.orion.git.revert",
imageClass:"git-sprite-reset",spriteClass:"gitCommandSprite",callback:function(a){a=a.items;var d=b.getService("orion.page.progress"),e=b.getService("orion.git.provider"),f=a.Location.replace(a.Name,"HEAD");d.progress(e.doRevert(f,a.Name),"Reverting "+a.Name).then(function(a){var d=[];"OK"===a.Result?(d.Severity="Ok",d.HTML=!1,d.Message=a.Result):"FAILURE"===a.Result?(d.Severity="Warning",d.HTML=!0,d.Message="\x3cspan\x3e"+a.Result+l[". Could not revert into active branch"]+"\x3c/span\x3e"):(d.Severity=
"Warning",d.HTML=!1,d.Message=a.Result);b.getService("orion.page.message").setProgressResult(d)},q)},visibleWhen:function(a){return"Commit"===a.Type}});d.addCommand(p)};D.createGitClonesCommands=function(a,d,g,p,q,s){function v(b){var d={Severity:"Error",HTML:!1};try{var e=JSON.parse(b.responseText);d.Message=e.DetailedMessage?e.DetailedMessage:e.Message?e.Message:l["Problem while performing the action"]}catch(f){d.Message=l["Problem while performing the action"]}a.getService("orion.page.message").setProgressResult(d)}
function w(a){Array.isArray(a)&&(a=1<a.length?{}:a[0]);return a}p=new f.ParametersDescription([new f.CommandParameter("key","text",l["Key:"]),new f.CommandParameter("value","text",l["Value:"])]);p=new h.Command({name:l["New Configuration Entry"],tooltip:"Add a new entry to the repository configuration",id:"eclipse.orion.git.addConfigEntryCommand",parameters:p,callback:function(b){var d=b.items,e=a.getService("orion.git.provider"),f=a.getService("orion.page.progress");b.parameters.valueFor("key")&&
b.parameters.valueFor("value")&&f.progress(e.addCloneConfigurationProperty(d.ConfigLocation,b.parameters.valueFor("key"),b.parameters.valueFor("value")),"Setting configuration propetry: "+b.parameters.valueFor("key")).then(function(a){g.changedItem(d)},v)}});d.addCommand(p);p=new f.ParametersDescription([],null,function(a){a=a.items;var b;a&&(b=a.Value);return[new f.CommandParameter("value","text",l["Value:"],b)]});p=new h.Command({name:l.Edit,tooltip:l["Edit the configuration entry"],imageClass:"core-sprite-edit",
id:"eclipse.orion.git.editConfigEntryCommand",parameters:p,callback:function(b){var d=b.items,e=a.getService("orion.git.provider"),f=a.getService("orion.page.progress");b.parameters.valueFor("value")&&f.progress(e.editCloneConfigurationProperty(d.Location,b.parameters.valueFor("value")),"Editing configuration property "+d.Key).then(function(a){g.changedItem(d)},v)},visibleWhen:function(a){return a.Key&&a.Value&&a.Location}});d.addCommand(p);p=new h.Command({name:l.Delete,tooltip:l["Delete the configuration entry"],
imageClass:"core-sprite-delete",id:"eclipse.orion.git.deleteConfigEntryCommand",callback:function(b){var d=b.items;b=a.getService("orion.git.provider");var e=a.getService("orion.page.progress");confirm(k.formatMessage(l["Are you sure you want to delete ${0}?"],d.Key))&&e.progress(b.deleteCloneConfigurationProperty(d.Location),"Deleting configuration property "+d.Key).then(function(a){g.changedItem(d)},v)},visibleWhen:function(a){return a.Key&&a.Value&&a.Location}});d.addCommand(p);p=new f.ParametersDescription([new f.CommandParameter("url",
"url",l["Repository URL:"])],{hasOptionalParameters:!0});q=new h.Command({name:l["Clone Repository"],tooltip:l["Clone an existing Git repository to a folder"],id:"eclipse.createGitProject",callback:function(d){var e=d.items,f=a.getService("orion.git.provider"),h=a.getService("orion.page.progress"),k=function(d,k,m){e.GitUrl=d;D.getDefaultSshOptions(a,e).then(function(p){var q=arguments.callee,r=new b(a);a.getService("orion.page.message").setProgressMessage("Your project is being set up. This may take a minute...");
r.getConfig().then(function(b){h.progress(f.cloneGitRepository(m,d,k,g.defaultPath,p.gitSshUsername,p.gitSshPassword,p.knownHosts,p.gitPrivateKey,p.gitPassphrase,b,!0),"Cloning repository "+m).then(function(b,d){D.handleProgressServiceResponse(b,p,a,function(a){f.getGitClone(a.Location).then(function(a){var b="",d;for(d in e.projectDescription)b+=d+"\x3d"+e.projectDescription[d]+"\n";s.write(a.Children[0].ContentLocation+".git/.projectInfo",b).then(function(){var b=n.toUrl(L.expand({resource:a.Children[0].ContentLocation}));
window.location=b})})},q,l["Clone Git Repository"])},function(b,d){D.handleProgressServiceResponse(b,p,a,function(){},q,l["Clone Git Repository"])})})})};e.url&&e.projectDescription.name&&(a.getService("orion.page.message").setProgressMessage("Looking for project "+e.projectDescription.name),s.loadWorkspace().then(function(a){for(var b=0;b<a.Children.length;++b){var d=a.Children[b];if(d.Name===e.projectDescription.name){d.Git?f.getGitClone(d.Git.CloneLocation).then(function(a){a.Children[0].GitUrl===
e.url?window.location=n.toUrl(L.expand({resource:a.Children[0].ContentLocation})):console.info("Folder project is used")}):console.info("Folder project is used");return}}k(e.url,null,e.projectDescription.name)}))},visibleWhen:function(a){return!0}});d.addCommand(q);p=new h.Command({name:l["Clone Repository"],tooltip:l["Clone an existing Git repository to a folder"],id:"eclipse.cloneGitRepository",parameters:p,callback:function(d){var e=d.items,f=a.getService("orion.git.provider"),h=a.getService("orion.page.progress"),
k=function(d,k,m){e.GitUrl=d;D.getDefaultSshOptions(a,e).then(function(e){var n=arguments.callee;(new b(a)).getConfig().then(function(b){b=h.progress(f.cloneGitRepository(m,d,k,g.defaultPath,e.gitSshUsername,e.gitSshPassword,e.knownHosts,e.gitPrivateKey,e.gitPassphrase,b),"Cloning repository "+m);a.getService("orion.page.message").createProgressMonitor(b,l["Cloning repository: "]+d);b.then(function(b,d){D.handleProgressServiceResponse(b,e,a,function(a){g.changedItem&&g.changedItem()},n,l["Clone Git Repository"])},
function(b,d){D.handleProgressServiceResponse(b,e,a,function(){},n,l["Clone Git Repository"])})})})};d.parameters.valueFor("url")&&!d.parameters.optionsRequested?k(d.parameters.valueFor("url")):(new u.CloneGitRepositoryDialog({serviceRegistry:a,fileClient:s,url:d.parameters.valueFor("url"),alwaysShowAdvanced:d.parameters.optionsRequested,func:k})).show()},visibleWhen:function(a){return!0}});d.addCommand(p);p=new h.Command({name:l["Clone Repository"],tooltip:l["Clone an existing Git repository to a folder"],
id:"eclipse.cloneGitRepositoryReviewReq",callback:function(d){var e=d.items,f=a.getService("orion.git.provider"),h=a.getService("orion.page.progress");(new u.CloneGitRepositoryDialog({serviceRegistry:a,fileClient:s,url:d.userData,alwaysShowAdvanced:!1,func:function(d,k,m){e.GitUrl=d;D.getDefaultSshOptions(a,e).then(function(e){var n=arguments.callee;(new b(a)).getConfig().then(function(b){b=h.progress(f.cloneGitRepository(m,d,k,g.defaultPath,e.gitSshUsername,e.gitSshPassword,e.knownHosts,e.gitPrivateKey,
e.gitPassphrase,b),"Cloning git repository "+m);a.getService("orion.page.message").createProgressMonitor(b,l["Cloning repository: "]+d);b.then(function(b,d){D.handleProgressServiceResponse(b,e,a,function(a){g.changedItem&&g.changedItem()},n,l["Clone Git Repository"])},function(b,d){D.handleProgressServiceResponse(b,e,a,function(){},n,l["Clone Git Repository"])})})})}})).show()},visibleWhen:function(a){return!0}});d.addCommand(p);p=new h.Command({name:l["Add Remote"],tooltip:l["Add a new remote to the repository"],
id:"eclipse.addRemoteReviewRequestCommand",imageClass:"git-sprite-fetch",spriteClass:"gitCommandSprite",callback:function(b){b.parameters&&b.parameters.valueFor("remoteName")&&(b.remoteName=b.parameters.valueFor("remoteName"));var h=function(b,g){b.JsonData.HostKey?(g.parameters=null,g.errorData=b.JsonData,d.collectParameters(g)):g.optionsRequested?(g.errorData=b.JsonData,d.collectParameters(g)):(new e(a)).isEnabled().then(function(a){g.parameters=a?b.JsonData.User?new f.ParametersDescription([new f.CommandParameter("sshpassword",
"password",l["Password:"]),new f.CommandParameter("saveCredentials","boolean",l["Don't prompt me again:"])],{hasOptionalParameters:!0}):new f.ParametersDescription([new f.CommandParameter("sshuser","text",l["User Name:"]),new f.CommandParameter("sshpassword","password",l["Password:"]),new f.CommandParameter("saveCredentials","boolean",l["Don't prompt me again:"])],{hasOptionalParameters:!0}):b.JsonData.User?new f.ParametersDescription([new f.CommandParameter("sshpassword","password",l["Password:"])],
{hasOptionalParameters:!0}):new f.ParametersDescription([new f.CommandParameter("sshuser","text",l["User Name:"]),new f.CommandParameter("sshpassword","password",l["Password:"])],{hasOptionalParameters:!0});g.errorData=b.JsonData;d.collectParameters(g)})};if(b.parameters&&b.parameters.optionsRequested)b.parameters=null,b.optionsRequested=!0,d.collectParameters(b);else{var k=function(d,e,f){var k=a.getService("orion.page.progress");k.progress(a.getService("orion.git.provider").addRemote(d,e,b.userData),
"Adding git remote "+e).then(function(){D.gatherSshCredentials(a,b).then(function(d){a.getService("orion.git.provider").getGitRemote(f.RemoteLocation).then(function(m){for(var n,p=0;p<m.Children.length;p++)m.Children[p].Name===e&&(n=m.Children[p]);var q=a.getService("orion.git.provider");m=a.getService("orion.page.message");p=k.progress(q.doFetch(n.Location,!1,d.gitSshUsername,d.gitSshPassword,d.knownHosts,d.gitPrivateKey,d.gitPassphrase),"Fetching remote "+e);m.createProgressMonitor(p,l["Fetching remote: "]+
n.Location);p.then(function(d,l){D.handleGitServiceResponse(d,a,function(){k.progress(q.getGitRemote(n.Location),"Getting remote details "+e).then(function(a){g.changedItem(f)},v)},function(a){h(a,b)})},function(d,e){D.handleGitServiceResponse(d,a,function(){g.changedItem(f)},function(a){h(a,b)})})})})},v)};b.remoteName?k(b.items.RemoteLocation,b.remoteName,b.items):(b.parameters=new f.ParametersDescription([new f.CommandParameter("remoteName","text",l["Remote Name:"])],{hasOptionalParameters:!1}),
d.collectParameters(b))}},visibleWhen:function(a){return!0}});d.addCommand(p);p=new f.ParametersDescription([new f.CommandParameter("folderName","text",l["New folder:"])],{hasOptionalParameters:!0});p=new h.Command({name:l["Init Repository"],tooltip:l["Create a new Git repository in a new folder"],id:"eclipse.initGitRepository",parameters:p,callback:function(d){var e=d.items,f=a.getService("orion.git.provider"),h=a.getService("orion.page.progress"),k=function(d,k,m){e.GitUrl=d;D.getDefaultSshOptions(a,
e).then(function(e){var n=arguments.callee;(new b(a)).getConfig().then(function(b){b=h.progress(f.cloneGitRepository(m,d,k,g.defaultPath,null,null,null,null,null,b),l["Initializing repository: "]+m);a.getService("orion.page.message").createProgressMonitor(b,l["Initializing repository: "]+m);b.then(function(b,d){D.handleProgressServiceResponse(b,e,a,function(a){g.changedItem&&g.changedItem()},n,l["Init Git Repository"])},function(b,d){D.handleProgressServiceResponse(b,e,a,function(){},n,l["Init Git Repository"])})})})};
d.parameters.valueFor("folderName")&&!d.parameters.optionsRequested?k(null,null,d.parameters.valueFor("folderName")):(new u.CloneGitRepositoryDialog({serviceRegistry:a,title:l["Init Git Repository"],fileClient:s,advancedOnly:!0,func:k})).show()},visibleWhen:function(a){return!0}});d.addCommand(p);p=new h.Command({name:l.Delete,tooltip:l["Delete the repository"],imageClass:"core-sprite-delete",id:"eclipse.git.deleteClone",visibleWhen:function(a){return"Clone"===a.Type},callback:function(b){var d=b.items;
b=a.getService("orion.git.provider");var e=a.getService("orion.page.progress");if(Array.isArray(d)){if(confirm(k.formatMessage(l["Are you sure you want do delete ${0} repositories?"],d.length)))for(var f=0,h=0;h<d.length;h++)e.progress(b.removeGitRepository(d[h].Location),"Removing repository "+d.Name).then(function(a){f++;f>=d.length&&g.changedItem&&g.changedItem()},v)}else confirm(k.formatMessage(l["Are you sure you want to delete ${0}?"],d.Name))&&e.progress(b.removeGitRepository(d.Location),"Removing repository "+
d.Name).then(function(a){g.changedItem&&(window.location=n.toUrl(t.expand({})),g.changedItem())},v)}});d.addCommand(p);p=new h.Command({name:l["Apply Patch"],tooltip:l["Apply a patch on the selected repository"],id:"eclipse.orion.git.applyPatch",imageClass:"git-sprite-apply-patch",spriteClass:"gitCommandSprite",callback:function(b){b=w(b.items);var d=new m;(new r.ApplyPatchDialog({title:l["Apply Patch"],diffLocation:b.DiffLocation||b.repository.DiffLocation,deferred:d})).show();var e=a.getService("orion.page.message");
d.then(function(a){var b;try{var d=JSON.parse(a);if(d.JsonData&&d.JsonData.modifiedFieles){b="Patch applied, files modified: ";a=!0;for(var f=0;f<d.JsonData.modifiedFieles.length;f++)a||(b+=", "),b+=d.JsonData.modifiedFieles[f],a=!1;d=[];d.Severity="Info";d.HTML=!1;d.Message=b;e.setProgressResult(d);return}}catch(g){}e.setMessage("Patch applied")},function(a){var b=JSON.parse(a);a="Apply patch failed.";b.DetailedMessage?a=a+" "+b.DetailedMessage:b.Message&&(a+=" ",a+=b.Message);b=[];b.Severity="Error";
b.HTML=!1;b.Message=a;e.setProgressResult(b)})},visibleWhen:function(a){return"Clone"===a.Type||a.repository}});d.addCommand(p);p=new f.ParametersDescription([new f.CommandParameter("commitName","text",l["Commit name:"])],{hasOptionalParameters:!0});p=new h.Command({name:l["Open Commit"],tooltip:l["Open the commit with the given name"],id:"eclipse.orion.git.openCommitCommand",imageClass:"git-sprite-apply-patch",spriteClass:"gitCommandSprite",parameters:p,callback:function(b){var d=a.getService("orion.page.progress"),
e=function(f,g,h){null==h&&(h=new m);0<f.length?d.progress(a.getService("orion.git.provider").doGitLog("/gitapi/commit/"+b.parameters.valueFor("commitName")+f[0].ContentLocation+"?page\x3d1\x26pageSize\x3d1",null,null,l["Looking for the commit"]),"Looking for commit "+b.parameters.valueFor("commitName")).then(function(a){h.resolve(a.Children[0].Location)},function(a){e(f.slice(1),g,h)}):h.reject();return h},f=function(d){b.parameters.optionsRequested?(new x.OpenCommitDialog({repositories:d,serviceRegistry:a,
commitName:b.parameters.valueFor("commitName")})).show():(a.getService("orion.page.message").setProgressMessage(l["Looking for the commit"]),e(d,b.parameters.valueFor("commitName")).then(function(b){b&&(b=n.toUrl(H.expand({resource:b})),window.open(b));a.getService("orion.page.message").setProgressMessage("")},function(){var b=[];b.Severity="warning";b.HTML=!1;b.Message=l["No commits found"];a.getService("orion.page.message").setProgressResult(b)}))};if("Clone"===b.items.Type){var g=[b.items];f(g)}else b.items.CloneLocation?
d.progress(a.getService("orion.git.provider").getGitClone(b.items.CloneLocation),"Getting git repository details").then(function(a){f(a.Children)}):(g=b.items,f(g))},visibleWhen:function(a){return"Clone"===a.Type||a.CloneLocation||1<a.length&&"Clone"===a[0].Type}});d.addCommand(p)};D.createGitStatusCommands=function(a,b,e,f){function g(a){Array.isArray(a)||(a=[a]);return a}function m(b,d){var f=a.getService("orion.page.message"),g=a.getService("orion.page.progress").progress(a.getService("orion.git.provider").doRebase(b,
"",d),"Rebasing git repository");f.createProgressMonitor(g,d);g.then(function(b){if("OK"===b.Result||"ABORTED"===b.Result||"FAST_FORWARD"===b.Result||"UP_TO_DATE"===b.Result){var d=[];d.Severity="Ok";d.HTML=!1;d.Message=b.Result;a.getService("orion.page.message").setProgressResult(d);e.changedItem({})}"STOPPED"===b.Result?(d=[],d.Severity="Warning",d.HTML=!1,d.Message=b.Result+l[". Repository still contains conflicts."],a.getService("orion.page.message").setProgressResult(d),e.changedItem({})):"FAILED_UNMERGED_PATHS"===
b.Result&&(d=[],d.Severity="Error",d.HTML=!1,d.Message=b.Result+l[". Repository contains unmerged paths. Resolve conflicts first."],a.getService("orion.page.message").setProgressResult(d))},q)}var n=A({serviceRegistry:a,commandService:b}),p=n.perform,q=n.displayErrorOnStatus,n=new h.Command({name:l.Stage,tooltip:l["Stage the change"],imageClass:f?"core-sprite-check":"git-sprite-stage",spriteClass:f?"commandSprite":"gitCommandSprite",id:"eclipse.orion.git.stageCommand",callback:function(b){var d=g(b.items),
h=a.getService("orion.page.message"),k=a.getService("orion.page.progress");if(1===d.length)k=k.progress(a.getService("orion.git.provider").stage(d[0].indexURI),l["Staging changes"]),h.createProgressMonitor(k,l["Staging changes"]),k.then(function(a){f?b.handler.changedItem(d):e.changedItem(d)},q);else{for(var m=[],n=0;n<d.length;n++)m[n]=d[n].name;k=k.progress(a.getService("orion.git.provider").stageMultipleFiles(b.userData.Clone.IndexLocation,m),l["Staging changes"]);h.createProgressMonitor(k,"Staging changes");
k.then(function(a){f?b.handler.changedItem(d):e.changedItem(d)},q)}},visibleWhen:function(a){a=g(a);if(0===a.length)return!1;for(var b=0;b<a.length;b++)if(!d.isChange(a[b])||d.isStaged(a[b]))return!1;return!0}});b.addCommand(n);var s=function(b){var d=g(b.items),e=a.getService("orion.page.message"),f=a.getService("orion.page.progress");if(1===d.length)b=f.progress(a.getService("orion.git.provider").unstage(d[0].indexURI,d[0].name),"Unstaging changes");else{for(var h=[],k=0;k<d.length;k++)h[k]=d[k].name;
b=f.progress(a.getService("orion.git.provider").unstage(b.userData.Clone.IndexLocation,h),"Unstaging changes")}e.createProgressMonitor(b,l["Staging changes"]);return b.then(function(){return d})},n=new h.Command({name:l.Unstage,tooltip:l["Unstage the change"],imageClass:f?"core-sprite-check_on":"git-sprite-unstage",spriteClass:f?"commandSprite":"gitCommandSprite",id:"eclipse.orion.git.unstageCommand",callback:function(a){s(a).then(function(b){f?a.handler.changedItem(b):e.changedItem(b)},q)},visibleWhen:function(a){a=
g(a);if(0===a.length)return!1;for(var b=0;b<a.length;b++)if(!d.isChange(a[b])||!d.isStaged(a[b]))return!1;return!0}});b.addCommand(n);n=new h.Command({name:f?l.SmartCommit:l.Commit,tooltip:f?"":l.Commit,id:"eclipse.orion.git.commitCommand",callback:function(a){p(a).then(function(){e.changedItem()})},visibleWhen:function(a){return!0}});b.addCommand(n);n=new h.Command({name:l.Reset,tooltip:l["Reset the branch, discarding all staged and unstaged changes"],imageClass:"core-sprite-refresh",id:"eclipse.orion.git.resetCommand",
callback:function(b){var d=b.items;a.getService("orion.page.dialog").confirm(l["All unstaged and staged changes in the working directory and index will be discarded and cannot be recovered."]+"\n"+l["Are you sure you want to continue?"],function(b){if(b){b=a.getService("orion.page.message");var f=a.getService("orion.page.progress").progress(a.getService("orion.git.provider").unstageAll(d.IndexLocation,"HARD"),l["Resetting local changes"]);b.createProgressMonitor(f,l["Resetting local changes"]);f.then(function(a){e.changedItem(d)},
q)}})},visibleWhen:function(a){return"Status"!==a.Type?!1:d.hasStagedChanges(a)||d.hasUnstagedChanges(a)}});b.addCommand(n);n=new h.Command({name:l.Checkout,tooltip:l["Checkout all the selected files, discarding all changes"],imageClass:"git-sprite-checkout",spriteClass:"gitCommandSprite",id:"eclipse.orion.git.checkoutCommand",callback:function(b){var d=g(b.items);a.getService("orion.page.dialog").confirm(l["Your changes to the selected files will be discarded and cannot be recovered."]+"\n"+l["Are you sure you want to continue?"],
function(f){if(f){f=a.getService("orion.page.message");for(var g=a.getService("orion.page.progress"),h=[],k=0;k<d.length;k++)h[k]=d[k].name;g=g.progress(a.getService("orion.git.provider").checkoutPath(b.userData.Clone.Location,h),l["Resetting local changes"]);f.createProgressMonitor(g,l["Resetting local changes"]);g.then(function(a){e.changedItem(d)},q)}})},visibleWhen:function(a){a=g(a);if(0===a.length)return!1;for(var b=0;b<a.length;b++)if(!d.isChange(a[b])||d.isStaged(a[b]))return!1;return!0}});
b.addCommand(n);var r=new h.Command({name:l.Discard,tooltip:l["Checkout all the selected files, discarding all changes"],imageClass:"git-sprite-checkout",spriteClass:"gitCommandSprite",id:"eclipse.orion.git.checkoutStagedCommand",callback:function(b){a.getService("orion.page.dialog").confirm(l["Your changes to the selected files will be discarded and cannot be recovered."]+"\n"+l["Are you sure you want to continue?"],function(d){d&&s(b).then(function(d){for(var g=a.getService("orion.page.message"),
h=a.getService("orion.page.progress"),k=[],m=0;m<d.length;m++)k[m]=d[m].name;h=h.progress(a.getService("orion.git.provider").checkoutPath(b.userData.Clone.Location,k),l["Resetting local changes"]);g.createProgressMonitor(h,l["Resetting local changes"]);return h.then(function(a){f?b.handler.changedItem(d):e.changedItem(d)},q)})})},visibleWhen:function(a){a=g(a);r.name=k.formatMessage(l.Discard,a.length);return!0}});b.addCommand(r);n=new h.Command({name:l["Show Patch"],tooltip:l["Show workspace changes as a patch"],
id:"eclipse.orion.git.showPatchCommand",hrefCallback:function(a){var b=g(a.items);a=a.userData.Clone.DiffLocation+"?parts\x3ddiff";for(var d=0;d<b.length;d++)a+="\x26Path\x3d",a+=b[d].name;return a},visibleWhen:function(a){a=g(a);if(0===a.length)return!1;for(var b=0;b<a.length;b++)if(d.isStaged(a[b]))return!1;return!0}});b.addCommand(n);n=new h.Command({name:l["Show Patch"],tooltip:l["Show checked changes as a patch"],id:"eclipse.orion.git.showStagedPatchCommand",hrefCallback:function(a){var b=g(a.items);
a=a.userData.Clone.DiffLocation.replace("/Default/","/Cached/")+"?parts\x3ddiff";for(var d=0;d<b.length;d++)a+="\x26Path\x3d",a+=b[d].name;return a},visibleWhen:function(a){return 0!==g(a).length}});b.addCommand(n);n=new h.Command({name:l.Continue,tooltip:l["Contibue Rebase"],id:"eclipse.orion.git.rebaseContinueCommand",callback:function(a){return m(a.items.Clone.HeadLocation,"CONTINUE")},visibleWhen:function(a){return a.RepositoryState&&-1!==a.RepositoryState.indexOf("REBASING")}});b.addCommand(n);
n=new h.Command({name:l["Skip Patch"],tooltip:l["Skip Patch"],id:"eclipse.orion.git.rebaseSkipPatchCommand",callback:function(a){return m(a.items.Clone.HeadLocation,"SKIP")},visibleWhen:function(a){return a.RepositoryState&&-1!==a.RepositoryState.indexOf("REBASING")}});b.addCommand(n);n=new h.Command({name:l.Abort,tooltip:l["Abort Rebase"],id:"eclipse.orion.git.rebaseAbortCommand",callback:function(a){return m(a.items.Clone.HeadLocation,"ABORT")},visibleWhen:function(a){return a.RepositoryState&&
-1!==a.RepositoryState.indexOf("REBASING")}});b.addCommand(n)};D.createSharedCommands=function(a,b,d,e,f,g){var k=function(){d.changedItem()};f={serviceRegistry:a,commandService:b};e=v({serviceRegistry:a,commandService:b,explorer:d,toolbarId:e,tags:!0,confirmDialogCloseCallback:k,remotePrompterDialogCloseCallback:k,sshCredentialsDialogCloseCallback:k,sshSlideoutCloseCallback:k});f=A(f);g=f.createParameters(!1);var m=f.perform,n=f.displayErrorOnStatus,p=e.perform;e=new h.Command({name:l["Commit and Push"],
tooltip:l["Commit and Push"],id:"eclipse.orion.git.commitAndPushCommand",parameters:g,callback:function(b){m(b).then(function(){a.getService("orion.git.provider").getGitBranch(b.items.status.Clone.BranchLocation).then(function(a){a=a.Children;for(var d,e=0;e<a.length;e++)if(a[e].Current){d=a[e];break}b.command=void 0;b.targetBranch=void 0;b.parameters=void 0;b.items=d;p(b).then(function(){k()})},function(a){n(a)})},function(a){n(a);k()})},visibleWhen:function(a){return!0}});b.addCommand(e)}})();return D});
define("orion/operation",["orion/xhr","orion/Deferred"],function(l,n){function m(g,h,f,d){l("GET",g,{headers:{"Orion-Version":"1"},timeout:15E3}).then(function(a){a=a.response?JSON.parse(a.response):null;h.progress(a);!a.type||"loadstart"===a.type||"progress"===a.type?setTimeout(function(){m(g,h,f,d)},2E3):("error"===a.type||"abort"===a.type?h.reject(d?d(a):a.Result):h.resolve(f?f(a):a.Result.JsonData),a.Location||l("DELETE",g,{headers:{"Orion-Version":"1"},timeout:15E3}))},function(a){var d=a;if(void 0!==
a.responseText){d=a.responseText;try{d=JSON.parse(a.responseText)}catch(b){}}void 0!==d.Message?(d.HttpCode=void 0===d.HttpCode?a.status:d.HttpCode,d.Severity=void 0===d.Severity?"Error":d.Severity,h.reject(d)):h.reject({Severity:"Error",Message:d,HttpCode:a.status})})}function k(g,h){h.then(null,function(f){f instanceof Error&&"Cancel"===f.name&&l("PUT",g,{headers:{"Orion-Version":"1"},data:JSON.stringify({abort:!0}),timeout:15E3})})}return{handle:function(g,h,f){var d=new n;k(g,d);m(g,d,h,f);return d}}});
define("orion/git/gitClient",["require","orion/xhr","orion/Deferred","orion/operation"],function(l,n,m,k){var g=g||{};g.GitService=function(){function g(f){f&&(this._serviceRegistry=f,this._serviceRegistration=f.registerService("orion.git.provider",this))}g.prototype={checkGitService:function(){},cloneGitRepository:function(f,d,a,e,b,g,h,k,u,w,x){var y=this,r={};f&&(r.Name=f);a&&(r.Path=a);d&&(r.GitUrl=d);r.Location=e;b&&(r.GitSshUsername=b);g&&(r.GitSshPassword=g);h&&(r.GitSshKnownHost=h);k&&(r.GitSshPrivateKey=
k);u&&(r.GitSshPassphrase=u);w&&(w.GitMail&&(r.GitMail=w.GitMail),w.GitName&&(r.GitName=w.GitName));x&&(r.initProject=x);f=l.toUrl("gitapi/clone/._");f=f.substring(0,f.length-2);var t=new m;n("POST",f,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset\x3dUTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify(r)}).then(function(a){y._getGitServiceResponse(t,a)},function(a){y._handleGitServiceResponseError(t,a)});return t},removeGitRepository:function(f){var d=this,a=new m;n("DELETE",
f,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset\x3dUTF-8"},timeout:15E3,handleAs:"json"}).then(function(e){d._getGitServiceResponse(a,e)},function(e){d._handleGitServiceResponseError(a,e)});return a},getGitStatus:function(f){var d=this,a=new m;n("GET",f,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset\x3dUTF-8"},timeout:15E3,handleAs:"json"}).then(function(e){d._getGitServiceResponse(a,e)},function(e){d._handleGitServiceResponseError(a,e)});return a},
stage:function(f){var d=this,a=new m;n("PUT",f,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset\x3dUTF-8"},timeout:15E3,handleAs:"json"}).then(function(e){d._getGitServiceResponse(a,e)},function(e){d._handleGitServiceResponseError(a,e)});return a},stageMultipleFiles:function(f,d){var a=this,e=new m;n("PUT",f,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset\x3dUTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Path:d})}).then(function(b){a._getGitServiceResponse(e,
b)},function(b){a._handleGitServiceResponseError(e,b)});return e},unstageAll:function(f,d){var a=this,e=new m;n("POST",f,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset\x3dUTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Reset:d})}).then(function(b){a._getGitServiceResponse(e,b)},function(b){a._handleGitServiceResponseError(e,b)});return e},unstage:function(f,d){var a=this,e=new m;n("POST",f,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset\x3dUTF-8"},
timeout:15E3,handleAs:"json",data:JSON.stringify({Path:d})}).then(function(b){a._getGitServiceResponse(e,b)},function(b){a._handleGitServiceResponseError(e,b)});return e},checkoutPath:function(f,d){var a=this,e=new m;n("PUT",f,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset\x3dUTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Path:d,RemoveUntracked:"true"})}).then(function(b){a._getGitServiceResponse(e,b)},function(b){a._handleGitServiceResponseError(e,b)});return e},
commitAll:function(f,d,a){var e=this,b=new m;n("POST",f,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset\x3dUTF-8"},timeout:15E3,handleAs:"json",data:a}).then(function(a){e._getGitServiceResponse(b,a)},function(a){e._handleGitServiceResponseError(b,a)});return b},getGitClone:function(f){var d=this,a=new m;n("GET",f,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset\x3dUTF-8"},timeout:15E3,handleAs:"json"}).then(function(e){d._getGitServiceResponse(a,e)},
function(e){d._handleGitServiceResponseError(a,e)});return a},getGitCloneConfig:function(f){var d=this,a=new m;n("GET",f,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset\x3dUTF-8"},timeout:15E3,handleAs:"json"}).then(function(e){d._getGitServiceResponse(a,e)},function(e){d._handleGitServiceResponseError(a,e)});return a},getGitBranch:function(f){var d=this,a=new m;n("GET",f,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset\x3dUTF-8"},timeout:15E3,handleAs:"json"}).then(function(e){d._getGitServiceResponse(a,
e)},function(e){d._handleGitServiceResponseError(a,e)});return a},getGitRemote:function(f){var d=this,a=new m;n("GET",f,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset\x3dUTF-8"},timeout:15E3,handleAs:"json"}).then(function(e){d._getGitServiceResponse(a,e)},function(e){d._handleGitServiceResponseError(a,e)});return a},checkoutBranch:function(f,d){var a=this,e=new m;n("PUT",f,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset\x3dUTF-8"},timeout:15E3,handleAs:"json",
data:JSON.stringify({Branch:d})}).then(function(b){a._getGitServiceResponse(e,b)},function(b){a._handleGitServiceResponseError(e,b)});return e},resetIndex:function(f,d,a){var e=this,b=new m;n("POST",f,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset\x3dUTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Commit:d,Reset:a?a:"HARD"})}).then(function(a){e._getGitServiceResponse(b,a)},function(a){e._handleGitServiceResponseError(b,a)});return b},addBranch:function(f,d,a){var e=
this,b={};d&&(b.Name=d);a&&(b.Branch=a);var g=new m;n("POST",f,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset\x3dUTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify(b)}).then(function(a){e._getGitServiceResponse(g,a)},function(a){e._handleGitServiceResponseError(g,a)});return g},removeBranch:function(f){var d=this,a=new m;n("DELETE",f,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset\x3dUTF-8"},timeout:15E3,handleAs:"json"}).then(function(e){d._getGitServiceResponse(a,
e)},function(e){d._handleGitServiceResponseError(a,e)});return a},addRemote:function(f,d,a){var e=this,b=new m;n("POST",f,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset\x3dUTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Remote:d,RemoteURI:a})}).then(function(a){e._getGitServiceResponse(b,a)},function(a){e._handleGitServiceResponseError(b,a)});return b},removeRemote:function(f){var d=this,a=new m;n("DELETE",f,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset\x3dUTF-8"},
timeout:15E3,handleAs:"json"}).then(function(e){d._getGitServiceResponse(a,e)},function(e){d._handleGitServiceResponseError(a,e)});return a},doGitLog:function(f){var d=this,a=new m;n("GET",f,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset\x3dUTF-8"},timeout:15E3,handleAs:"json"}).then(function(e){d._getGitServiceResponse(a,e)},function(e){d._handleGitServiceResponseError(a,e)});return a},getDiff:function(f,d){var a=this,e=new m;n("POST",f,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset\x3dUTF-8"},
timeout:15E3,handleAs:"json",data:JSON.stringify({New:d})}).then(function(b){a._getGitServiceResponse(e,b)},function(b){a._handleGitServiceResponseError(e,b)});return e},doFetch:function(f,d,a,e,b,g,h){var k=this,l=new m;n("POST",f,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset\x3dUTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Fetch:"true",Force:d,GitSshUsername:a,GitSshPassword:e,GitSshKnownHost:b,GitSshPrivateKey:g,GitSshPassphrase:h})}).then(function(a){k._getGitServiceResponse(l,
a)},function(a){k._handleGitServiceResponseError(l,a)});return l},doPull:function(f,d,a,e,b,g,h){var k=this,l=new m;n("POST",f,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset\x3dUTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Pull:"true",Force:d,GitSshUsername:a,GitSshPassword:e,GitSshKnownHost:b,GitSshPrivateKey:g,GitSshPassphrase:h})}).then(function(a){k._getGitServiceResponse(l,a)},function(a){k._handleGitServiceResponseError(l,a)});return l},doMerge:function(f,
d,a){var e=this,b=new m;n("POST",f,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset\x3dUTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Merge:d,Squash:a})}).then(function(a){e._getGitServiceResponse(b,a)},function(a){e._handleGitServiceResponseError(b,a)});return b},doCherryPick:function(f,d){var a=this,e=new m;n("POST",f,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset\x3dUTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({"Cherry-Pick":d})}).then(function(b){a._getGitServiceResponse(e,
b)},function(b){a._handleGitServiceResponseError(e,b)});return e},doRevert:function(f,d){var a=this,e=new m;n("POST",f,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset\x3dUTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Revert:d})}).then(function(b){a._getGitServiceResponse(e,b)},function(b){a._handleGitServiceResponseError(e,b)});return e},doRebase:function(f,d,a){var e=this,b={};b.Rebase=d;a&&(b.Operation=a);var g=new m;n("POST",f,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset\x3dUTF-8"},
timeout:15E3,handleAs:"json",data:JSON.stringify(b)}).then(function(a){e._getGitServiceResponse(g,a)},function(a){e._handleGitServiceResponseError(g,a)});return g},doPush:function(f,d,a,e,b,g,h,k,l){var w=this,x=new m;n("POST",f,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset\x3dUTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({PushSrcRef:d,PushTags:a,Force:e,GitSshUsername:b,GitSshPassword:g,GitSshKnownHost:h,GitSshPrivateKey:k,GitSshPassphrase:l})}).then(function(a){w._getGitServiceResponse(x,
a)},function(a){w._handleGitServiceResponseError(x,a)});return x},getLog:function(f,d){var a=this,e=new m,b=new m;n("POST",f,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset\x3dUTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({New:d})}).then(function(a){b.resolve(a.xhr.getResponseHeader("Location"))},function(b){a._handleGitServiceResponseError(e,b)});b.then(function(b){n("GET",b,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset\x3dUTF-8"},timeout:15E3,
handleAs:"json"}).then(function(b){a._getGitServiceResponse(e,b)},function(b){a._handleGitServiceResponseError(e,b)})});return e},getDefaultRemoteBranch:function(f){var d=this,a=new m,e=new m;n("GET",f,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset\x3dUTF-8"},timeout:15E3,handleAs:"json"}).then(function(a){d._getGitServiceResponse(e,a)},function(b){d._handleGitServiceResponseError(a,b)});e.then(function(b){n("GET",b.Children[0].Location,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset\x3dUTF-8"},
timeout:15E3,handleAs:"json"}).then(function(b){d._getGitServiceResponse(a,b)},function(b){d._handleGitServiceResponseError(a,b)})});return a},doAddTag:function(f,d){var a=this,e=new m;n("PUT",f,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset\x3dUTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Name:d})}).then(function(b){a._getGitServiceResponse(e,b)},function(b){a._handleGitServiceResponseError(e,b)});return e},doRemoveTag:function(f){var d=this,a=new m;n("DELETE",
f,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset\x3dUTF-8"},timeout:15E3,handleAs:"json"}).then(function(e){d._getGitServiceResponse(a,e)},function(e){d._handleGitServiceResponseError(a,e)});return a},checkoutTag:function(f,d,a){var e=this,b=new m;n("PUT",f,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset\x3dUTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Tag:d,Branch:a})}).then(function(a){e._getGitServiceResponse(b,a)},function(a){e._handleGitServiceResponseError(b,
a)});return b},addCloneConfigurationProperty:function(f,d,a){var e=this,b=new m;n("POST",f,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset\x3dUTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Key:d,Value:a})}).then(function(a){e._getGitServiceResponse(b,a)},function(a){e._handleGitServiceResponseError(b,a)});return b},editCloneConfigurationProperty:function(f,d){var a=this,e=new m;n("PUT",f,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset\x3dUTF-8"},
timeout:15E3,handleAs:"json",data:JSON.stringify({Value:d})}).then(function(b){a._getGitServiceResponse(e,b)},function(b){a._handleGitServiceResponseError(e,b)});return e},deleteCloneConfigurationProperty:function(f){var d=this,a=new m;n("DELETE",f,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset\x3dUTF-8"},timeout:15E3,handleAs:"json"}).then(function(e){d._getGitServiceResponse(a,e)},function(e){d._handleGitServiceResponseError(a,e)});return a},sendCommitReviewRequest:function(f,
d,a,e,b,g){var h=this,k=new m;n("POST",d,{headers:{"Orion-Version":"1","Content-Type":"application/json; charset\x3dUTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({ReviewReqCommit:f,ReviewReqUrl:e,ReviewReqNotifyLogin:a,ReviewReqAuthorName:b,ReviewMessage:g})}).then(function(a){h._getGitServiceResponse(k,a)},function(a){h._handleGitServiceResponseError(k,a)});return k},_getGitServiceResponse:function(f,d){var a=d.response?JSON.parse(d.response):null;if(d.xhr&&202===d.xhr.status){var e=k.handle(a.Location);
e.then(f.resolve,function(b){b.failedOperation=a.Location;f.reject(b)},f.progress);f.then(null,function(a){e.reject(a)})}else f.resolve(a)},_handleGitServiceResponseError:function(f,d){f.reject(d)}};return g}();return g});
define("orion/ssh/sshTools",["orion/Deferred","orion/xhr"],function(l,n){var m=m||{};m.SshService=function(){function k(g){if(g&&(this._serviceRegistry=g,this._authService=g.getService("orion.core.auth"),this._serviceRegistration=g.registerService("orion.net.ssh",this),!this._authService)){var h;this._authService={getUser:function(){if(h){var f=new l;f.resolve(h);return f}return n("POST","../../login",{headers:{"Orion-Version":"1"},timeout:15E3}).then(function(d){return h=d.response?JSON.parse(d.response):
null},function(d){h=null;return d instanceof Error&&"Cancel"===d.name?"_cancel":d.response?JSON.parse(d.response):null})}}}}k.prototype={KNOWN_HOSTS:"knownHosts",addKnownHost:function(g){g=g||{};var h=new l,f=this,d=g.host,a=g.keyType,e=g.hostKey,b=g.port||22;if(!d||!a||!e||!b)return h.reject(),h;this._authService.getUser().then(function(g){for(var k=localStorage.getItem(g.login+"/"+f.KNOWN_HOSTS),k=k?JSON.parse(k):[],l=0;l<k.length;++l){var m=k[l];if(m.host===d&&m.port===b){h.resolve(m.host+" "+
m.keyType+" "+m.hostKey);return}}m={host:d,port:b,keyType:a,hostKey:e};k.push(m);localStorage.setItem(g.login+"/"+f.KNOWN_HOSTS,JSON.stringify(k));h.resolve(m.host+" "+m.keyType+" "+m.hostKey)},function(a){h.reject(a)});return h},clearKnownHosts:function(){var g=new l,h=this;this._authService.getUser().then(function(f){var d=localStorage.getItem(f.login+"/"+h.KNOWN_HOSTS),d=d?JSON.parse(d):[];localStorage.removeItem(f.login+"/"+h.KNOWN_HOSTS);g.resolve(d)},function(f){g.reject(f)});return g},getKnownHostCredentials:function(g,
h){var f=new l,d=this;h=h||22;if(!g||!h)return f.reject(),f;this._authService.getUser().then(function(a){a=(a=localStorage.getItem(a.login+"/"+d.KNOWN_HOSTS))?JSON.parse(a):[];for(var e=0;e<a.length;++e){var b=a[e];if(b.host===g&&b.port===h){f.resolve(b.host+" "+b.keyType+" "+b.hostKey);return}}f.resolve("")},function(a){f.reject(a)});return f}};return k}();return m});
define("orion/links",[],function(){function l(l){this._init(l)}l.prototype={_init:function(l){this._registry=l.serviceRegistry;this._serviceRegistration=this._registry.registerService("orion.core.textlink",this)},_replaceLink:function(l,m,k,g,h){var f=l.search(k);0<f&&(m.appendChild(document.createTextNode(l.substring(0,f))),l=l.substring(f));k=l.replace(k,"");var f=l.substring(0,l.length-k.length),d=f.split(" ",g);if(d.length===g){l=document.createElement("a");for(var a=0;a<g;a++)h=h.replace("%"+
(a+1),d[a]);l.setAttribute("href",h);l.textContent=f;m.appendChild(l);l=k}return l},addLinks:function(l,m){var k=m||document.createElement("div"),g=this._registry.getServiceReferences("orion.core.linkScanner");if(0<g.length)for(var h=g[0],g=RegExp(h.getProperty("pattern"),"i"),f=h.getProperty("words"),h=h.getProperty("anchor"),d=l.search(g);0<=d;)l=this._replaceLink(l,k,g,f,h),d=l.search(g);0<l.length&&k.appendChild(document.createTextNode(l));return k}};l.prototype.constructor=l;return{TextLinkService:l}});
var eclipse;
define("git/git-repository","i18n!git/nls/gitmessages require orion/browserCompatibility orion/bootstrap orion/status orion/progress orion/PageUtil orion/keyBinding orion/commandRegistry orion/commands orion/dialogs orion/selection orion/fileClient orion/operationsClient orion/searchClient orion/globalCommands orion/git/gitRepositoryExplorer orion/git/gitCommands orion/git/gitClient orion/ssh/sshTools orion/links".split(" "),function(l,n,m,k,g,h,f,d,a,e,b,p,q,s,u,w,x,y,r,t,z){k.startup().then(function(k){var m=k.serviceRegistry;
k=k.preferences;new b.DialogService(m);var A=new p.Selection(m);new t.SshService(m);var C=new a.CommandRegistry({selection:A}),A=new s.OperationsClient(m),D=new h.ProgressService(m,A,C),A=new g.StatusReportingService(m,A,"statusPane","notifications","notificationArea"),E=new z.TextLinkService({serviceRegistry:m}),K=new r.GitService(m),I=new q.FileClient(m),F=new u.Searcher({serviceRegistry:m,commandService:C,fileService:I}),G=new x.GitRepositoryExplorer({parentId:"artifacts",registry:m,linkService:E,
commandService:C,fileClient:I,gitClient:K,progressService:D,preferencesService:k,statusService:A,selection:null,pageNavId:"pageNavigationActions",actionScopeId:"itemLevelCommands"});w.generateBanner("orion-repository",m,C,k,F,G);y.createFileCommands(m,C,G,"pageActions","selectionTools");y.createGitClonesCommands(m,C,G,"pageActions","selectionTools",I);y.createGitStatusCommands(m,C,G,!0);C.addCommandGroup("pageActions","eclipse.gitGroup",100);C.addCommandGroup("pageActions","eclipse.gitGroup",200);
C.registerCommandContribution("reposPageActions","eclipse.cloneGitRepository",100,"eclipse.gitGroup",!1,null,new a.URLBinding("cloneGitRepository","url"));C.registerCommandContribution("reposPageActions","eclipse.createGitProject",300,"eclipse.gitGroup",!0,null,new a.URLBinding("createProjectContext","name"));C.registerCommandContribution("reposPageActions","eclipse.initGitRepository",200,"eclipse.gitGroup");C.registerCommandContribution("repoPageActions","eclipse.orion.git.openCommitCommand",1E3,
"eclipse.gitGroup",!0,new d.KeyBinding("h",!0,!0),new a.URLBinding("openGitCommit","commitName"));C.registerCommandContribution("itemLevelCommandsMini","eclipse.orion.git.applyPatch",100);C.registerCommandContribution("itemLevelCommandsMini","eclipse.orion.git.pull",200);C.registerCommandContribution("itemLevelCommandsMini","eclipse.git.deleteClone",300);C.registerCommandContribution("itemLevelCommands","eclipse.openCloneContent",100);C.registerCommandContribution("itemLevelCommands","eclipse.openGitLog",
100);C.registerCommandContribution("itemLevelCommands","eclipse.orion.git.pull",200);C.registerCommandContribution("itemLevelCommands","eclipse.removeBranch",1E3);C.registerCommandContribution("itemLevelCommands","eclipse.checkoutTag",0);C.registerCommandContribution("itemLevelCommands","eclipse.removeTag",1E3);C.registerCommandContribution("itemLevelCommands","eclipse.checkoutBranch",200);C.registerCommandContribution("itemLevelCommands","eclipse.orion.git.applyPatch",300);C.registerCommandContribution("itemLevelCommands",
"eclipse.git.deleteClone",1E3);C.registerCommandContribution("itemLevelCommands","eclipse.orion.git.fetch",500);C.registerCommandContribution("itemLevelCommands","eclipse.orion.git.merge",600);C.registerCommandContribution("itemLevelCommands","eclipse.orion.git.mergeSquash",700);C.registerCommandContribution("itemLevelCommands","eclipse.orion.git.rebase",700);C.registerCommandContribution("itemLevelCommands","eclipse.orion.git.resetIndex",800);C.registerCommandContribution("itemLevelCommands","eclipse.orion.git.undoCommit",
900);C.registerCommandContribution("itemLevelCommands","eclipse.removeRemote",1E3);C.registerCommandContribution("itemLevelCommands","eclipse.orion.git.deleteConfigEntryCommand",1E3);C.registerCommandContribution("itemLevelCommands","eclipse.orion.git.editConfigEntryCommand",200);C.registerCommandContribution("itemLevelCommands","eclipse.orion.git.addTag",1);C.registerCommandContribution("itemLevelCommands","eclipse.orion.git.cherryPick",2);C.registerCommandContribution("itemLevelCommands","eclipse.orion.git.revert",
3);C.registerCommandContribution("pageNavigationActions","eclipse.orion.git.previousTagPage",1);C.registerCommandContribution("pageNavigationActions","eclipse.orion.git.nextTagPage",2);m=new e.Command({name:l["View All"],id:"eclipse.orion.git.repositories.viewAllCommand",hrefCallback:function(a){return n.toUrl(a.items.ViewAllLink)},visibleWhen:function(a){this.name=a.ViewAllLabel;this.tooltip=a.ViewAllTooltip;return a.ViewAllLabel&&a.ViewAllTooltip&&a.ViewAllLink}});C.addCommand(m);var H=f.matchResourceParameters();
"undefined"===typeof H["createProject.name"]&&C.processURL(window.location.href);D.progress(I.loadWorkspace(),"Loading default workspace").then(function(a){G.setDefaultPath(a.Location);a={};for(var b in H)-1!=b.indexOf("createProject")&&(a[b.replace("createProject.","")]=H[b]);C.runCommand("eclipse.createGitProject",{url:H.cloneGit,projectDescription:a},null,null);"undefined"===typeof H["createProject.name"]&&G.redisplay()});var L=H.resource;window.addEventListener("hashchange",function(){C.closeParameterCollector();
var a=f.matchResourceParameters().resource;L!==a&&(L=a,D.progress(I.loadWorkspace(),"Loading default workspace").then(function(a){G.setDefaultPath(a.Location);G.redisplay()}))},!1)})});
//@ sourceMappingURL=git-repository.js.map