/*

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

 Contributors:
 IBM Corporation - initial API and implementation

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

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

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

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

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

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

 Contributors: IBM Corporation - initial API and implementation

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

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

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - _initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

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

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

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

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

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

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

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

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

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

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

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

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

 Contributors: IBM Corporation - initial API and implementation

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

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

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

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

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

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

 Contributors: IBM Corporation - initial API and implementation 

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

 Contributors: IBM Corporation - initial API and implementation 

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

 Contributors: 
 Anton McConville (IBM Corporation) - initial API and implementation
 Felipe Heidrich (IBM Corporation) - initial API and implementation 

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

 Copyright (c) 2004, 2011, The Dojo Foundation and others. All Rights Reserved.
 Available via Academic Free License >= 2.1 OR the modified BSD license.
 see: http://dojotoolkit.org/license for details

 Contributors:
 Dojo Foundation: _handleOnChange function, and cookie management code
 IBM Corporation: Initial API and implementation of the remainder of the script

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

 Contributors: IBM Corporation - initial API and implementation
*/
(function(){function f(a,c,d){(function(){if(typeof this.loadFirebugConsole=="function")this.loadFirebugConsole();else{this.console=this.console||{};for(var g=["assert","count","debug","dir","dirxml","error","group","groupEnd","info","profile","profileEnd","time","timeEnd","trace","warn","log"],h=0,i;i=g[h++];)console[i]||function(){var r=i+"";console[r]="log"in console?function(){var w=Array.apply({},arguments);w.unshift(r+":");console.log(w.join(" "))}:function(){};console[r]._fake=true}()}if(typeof a==
"undefined")a={_scopeName:"dojo",_scopePrefix:"",_scopePrefixArgs:"",_scopeSuffix:"",_scopeMap:{},_scopeMapRev:{}};var j=a;if(typeof c=="undefined")c={_scopeName:"dijit"};if(typeof d=="undefined")d={_scopeName:"dojox"};if(!j._scopeArgs)j._scopeArgs=[a,c,d];j.global=this;j.config={isDebug:false,debugAtAllCosts:false};if(g=typeof djConfig!="undefined"?djConfig:typeof dojoConfig!="undefined"?dojoConfig:null)for(var k in g)j.config[k]=g[k];a.locale=j.config.locale;k="$Rev: 24595 $".match(/\d+/);a.version=
{major:1,minor:6,patch:1,flag:"",revision:k?+k[0]:NaN,toString:function(){with(j.version)return major+"."+minor+"."+patch+flag+" ("+revision+")"}};typeof OpenAjax!="undefined"&&OpenAjax.hub.registerLibrary(a._scopeName,"http://dojotoolkit.org",j.version.toString());var m,n,p={};for(h in{toString:1}){m=[];break}a._extraNames=m=m||["hasOwnProperty","valueOf","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","constructor"];n=m.length;a._mixin=function(r,w){var s,u,t;for(s in w){u=w[s];
if(!(s in r)||r[s]!==u&&(!(s in p)||p[s]!==u))r[s]=u}if(n&&w)for(t=0;t<n;++t){s=m[t];u=w[s];if(!(s in r)||r[s]!==u&&(!(s in p)||p[s]!==u))r[s]=u}return r};a.mixin=function(r){r||(r={});for(var w=1,s=arguments.length;w<s;w++)j._mixin(r,arguments[w]);return r};a._getProp=function(r,w,s){s=s||j.global;for(var u=0,t;s&&(t=r[u]);u++){if(u==0&&j._scopeMap[t])t=j._scopeMap[t];s=t in s?s[t]:w?(s[t]={}):undefined}return s};a.setObject=function(r,w,s){var u=r.split(".");r=u.pop();return(s=j._getProp(u,true,
s))&&r?(s[r]=w):undefined};a.getObject=function(r,w,s){return j._getProp(r.split("."),w,s)};a.exists=function(r,w){return j.getObject(r,false,w)!==undefined};a.eval=function(r){return j.global.eval?j.global.eval(r):eval(r)};j.deprecated=j.experimental=function(){}})();return{dojo:a,dijit:c,dojox:d}}if(this.define)define("dojo/_base/_loader/bootstrap",[],function(){var a=f();a.dojo._dijit=a.dijit;a.dojo._dojox=a.dojox;return a.dojo});else{var e=f();dojo=e.dojo;dijit=e.dijit;dojox=e.dojox}})();
define("dojo/lib/backCompat",["require","dojo/_base/_loader/bootstrap"],function(f,e){var a=["_moduleHasPrefix","_loadPath","_loadUri","_loadUriAndCheck","loaded","_callLoaded","_getModuleSymbols","_loadModule","require","provide","platformRequire","requireIf","requireAfterIf","registerModulePath"],c,d;for(c=0;c<a.length;){d=a[c++];e[d]=function(r){return function(){console.warn("dojo."+r+" not available when using an AMD loader.")}}(d)}var g=function(r){var w=[],s;for(s=0;s<r.length;)w.push(r[s++]);
return w},h=function(r,w){return w?typeof w=="string"?function(){r[w]()}:function(){w.call(r)}:r};e.ready=e.addOnLoad=function(r,w){f.ready(w?h(r,w):r)};e.addOnLoad(function(){e.postLoad=e.config.afterOnLoad=true});if(a=e.config.addOnLoad)e.addOnLoad[a instanceof Array?"apply":"call"](e,a);var i=e._loaders=[],j=function(){var r=i.slice(0);for(Array.prototype.splice.apply(i,[0,i.length]);r.length;)r.shift().call()};i.unshift=function(){Array.prototype.unshift.apply(i,g(arguments));f.ready(j)};i.splice=
function(){Array.prototype.splice.apply(i,g(arguments));f.ready(j)};var k=e._unloaders=[];e.unloaded=function(){for(;k.length;)k.pop().call()};e._onto=function(r,w,s){r.push(s?h(w,s):w)};e._modulesLoaded=function(){};e.loadInit=function(r){r()};var m=function(r){return r.replace(/\./g,"/")};e.getL10nName=function(r,w,s){s=s?s.toLowerCase():e.locale;r="i18n!"+m(r);return/root/i.test(s)?r+"/nls/"+w:r+"/nls/"+s+"/"+w};e.requireLocalization=function(r,w,s){if(f.vendor!="altoviso.com")s=!s||s.toLowerCase()===
e.locale?"root":s;return f(e.getL10nName(r,w,s))};e.i18n={getLocalization:e.requireLocalization,normalizeLocale:function(r){r=r?r.toLowerCase():e.locale;if(r=="root")r="ROOT";return r}};var n=/^(([^:\/?#]+):)?(\/\/([^\/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/,p=/^((([^\[:]+):)?([^@]+)@)?(\[([^\]]+)\]|([^\[:]*))(:([0-9]+))?$/;e._Url=function(){for(var r=arguments,w=[r[0]],s=1;s<r.length;s++)if(r[s]){var u=new e._Url(r[s]+"");w=new e._Url(w[0]+"");if(u.path==""&&!u.scheme&&!u.authority&&!u.query){if(u.fragment!=
null)w.fragment=u.fragment;u=w}else if(!u.scheme){u.scheme=w.scheme;if(!u.authority){u.authority=w.authority;if(u.path.charAt(0)!="/"){w=(w.path.substring(0,w.path.lastIndexOf("/")+1)+u.path).split("/");for(var t=0;t<w.length;t++)if(w[t]==".")if(t==w.length-1)w[t]="";else{w.splice(t,1);t--}else if(t>0&&!(t==1&&w[0]=="")&&w[t]==".."&&w[t-1]!="..")if(t==w.length-1){w.splice(t,1);w[t-1]=""}else{w.splice(t-1,2);t-=2}u.path=w.join("/")}}}w=[];u.scheme&&w.push(u.scheme,":");u.authority&&w.push("//",u.authority);
w.push(u.path);u.query&&w.push("?",u.query);u.fragment&&w.push("#",u.fragment)}this.uri=w.join("");s=this.uri.match(n);this.scheme=s[2]||(s[1]?"":null);this.authority=s[4]||(s[3]?"":null);this.path=s[5];this.query=s[7]||(s[6]?"":null);this.fragment=s[9]||(s[8]?"":null);if(this.authority!=null){s=this.authority.match(p);this.user=s[3]||null;this.password=s[4]||null;this.host=s[6]||s[7];this.port=s[9]||null}};e._Url.prototype.toString=function(){return this.uri};e.moduleUrl=function(r,w){if(!r)return null;
r=m(r)+(w?"/"+w:"");w="";var s=r.match(/(.+)(\.[^\/]*)$/);if(s){r=s[1];w=s[2]}return new e._Url(f.nameToUrl(r,w))};return e});
define("dojo/_base/_loader/hostenv_browser",["dojo/lib/backCompat"],function(f){if(typeof window!="undefined"){f.isBrowser=true;f._name="browser";(function(){var a=f;if(document&&document.getElementsByTagName)for(var c=document.getElementsByTagName("script"),d=/dojo(\.xd)?\.js(\W|$)/i,g=0;g<c.length;g++){var h=c[g].getAttribute("src");if(h){var i=h.match(d);if(i){if(!a.config.baseUrl)a.config.baseUrl=h.substring(0,i.index);if(c=c[g].getAttribute("djConfig")||c[g].getAttribute("data-dojo-config")){c=
eval("({ "+c+" })");for(var j in c)f.config[j]=c[j]}break}}}a.baseUrl=a.config.baseUrl;j=navigator;c=j.userAgent;d=j.appVersion;g=parseFloat(d);if(c.indexOf("Opera")>=0)a.isOpera=g;if(c.indexOf("AdobeAIR")>=0)a.isAIR=1;a.isKhtml=d.indexOf("Konqueror")>=0?g:0;a.isWebKit=parseFloat(c.split("WebKit/")[1])||undefined;a.isChrome=parseFloat(c.split("Chrome/")[1])||undefined;a.isMac=d.indexOf("Macintosh")>=0;if((h=Math.max(d.indexOf("WebKit"),d.indexOf("Safari"),0))&&!f.isChrome){a.isSafari=parseFloat(d.split("Version/")[1]);
if(!a.isSafari||parseFloat(d.substr(h+7))<=419.3)a.isSafari=2}if(c.indexOf("Gecko")>=0&&!a.isKhtml&&!a.isWebKit)a.isMozilla=a.isMoz=g;if(a.isMoz)a.isFF=parseFloat(c.split("Firefox/")[1]||c.split("Minefield/")[1])||undefined;if(document.all&&!a.isOpera){a.isIE=parseFloat(d.split("MSIE ")[1])||undefined;if((c=document.documentMode)&&c!=5&&Math.floor(a.isIE)!=c)a.isIE=c}if(f.isIE&&window.location.protocol==="file:")f.config.ieForceActiveXXhr=true;a.isQuirks=document.compatMode=="BackCompat";a.locale=
f.config.locale||(a.isIE?j.userLanguage:j.language).toLowerCase();a._XMLHTTP_PROGIDS=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"];a._xhrObj=function(){var s,u;if(!f.isIE||!f.config.ieForceActiveXXhr)try{s=new XMLHttpRequest}catch(t){}if(!s)for(var y=0;y<3;++y){var B=a._XMLHTTP_PROGIDS[y];try{s=new ActiveXObject(B)}catch(D){u=D}if(s){a._XMLHTTP_PROGIDS=[B];break}}if(!s)throw new Error("XMLHTTP not available: "+u);return s};a._isDocumentOk=function(s){s=s.status||0;var u=location.protocol;
return s>=200&&s<300||s==304||s==1223||!s&&(u=="file:"||u=="chrome:"||u=="chrome-extension:"||u=="app:")};var k=window.location+"";var m=(j=document.getElementsByTagName("base"))&&j.length>0;a._getText=function(s,u){var t=a._xhrObj();if(!m&&f._Url)s=(new f._Url(k,s)).toString();if(a.config.cacheBust){s+="";s+=(s.indexOf("?")==-1?"?":"&")+String(a.config.cacheBust).replace(/\W+/g,"")}t.open("GET",s,false);try{t.send(null);if(!a._isDocumentOk(t)){var y=Error("Unable to load "+s+" status:"+t.status);
y.status=t.status;y.responseText=t.responseText;throw y;}}catch(B){if(u)return null;throw B;}return t.responseText};var n=window,p=function(s,u){var t=n.attachEvent||n.addEventListener;s=n.attachEvent?s:s.substring(2);t(s,function(){u.apply(n,arguments)},false)};a._windowUnloaders=[];a.windowUnloaded=function(){for(var s=a._windowUnloaders;s.length;)s.pop()();a=null};var r=0;a.addOnWindowUnload=function(s,u){a._onto(a._windowUnloaders,s,u);if(!r){r=1;p("onunload",a.windowUnloaded)}};var w=0;a.addOnUnload=
function(s,u){a._onto(a._unloaders,s,u);if(!w){w=1;p("onbeforeunload",f.unloaded)}}})();f._initFired=false;f._loadInit=function(){if(f._scrollIntervalId){clearInterval(f._scrollIntervalId);f._scrollIntervalId=0}if(!f._initFired){f._initFired=true;!f.config.afterOnLoad&&window.detachEvent&&window.detachEvent("onload",f._loadInit);f._inFlightCount==0&&f._modulesLoaded()}};if(!f.config.afterOnLoad)if(document.addEventListener){document.addEventListener("DOMContentLoaded",f._loadInit,false);window.addEventListener("load",
f._loadInit,false)}else if(window.attachEvent){window.attachEvent("onload",f._loadInit);if(!f.config.skipIeDomLoaded&&self===self.top)f._scrollIntervalId=setInterval(function(){try{if(document.body){document.documentElement.doScroll("left");f._loadInit()}}catch(a){}},30)}if(f.isIE)try{(function(){document.namespaces.add("v","urn:schemas-microsoft-com:vml");var a=["*","group","roundrect","oval","shape","rect","imagedata","path","textpath","text"],c=0,d=1,g=document.createStyleSheet();if(f.isIE>=8){c=
1;d=a.length}for(;c<d;++c)g.addRule("v\\:"+a[c],"behavior:url(#default#VML); display:inline-block")})()}catch(e){}}(function(){var a=f.config.modulePaths;if(a)for(var c in a)f.registerModulePath(c,a[c])})();f.config.isDebug&&f.require("dojo._firebug.firebug");if(f.config.debugAtAllCosts){f.require("dojo._base._loader.loader_debug");f.require("dojo.i18n")}return f});define("dojo/lib/kernel",["dojo/_base/_loader/hostenv_browser"],function(f){return dojo=f});
define("dojo/_base/lang",["dojo/lib/kernel"],function(f){(function(){var e=Object.prototype.toString;f.isString=function(j){return typeof j=="string"||j instanceof String};f.isArray=function(j){return j&&(j instanceof Array||typeof j=="array")};f.isFunction=function(j){return e.call(j)==="[object Function]"};f.isObject=function(j){return j!==undefined&&(j===null||typeof j=="object"||f.isArray(j)||f.isFunction(j))};f.isArrayLike=function(j){return j&&j!==undefined&&!f.isString(j)&&!f.isFunction(j)&&
!(j.tagName&&j.tagName.toLowerCase()=="form")&&(f.isArray(j)||isFinite(j.length))};f.isAlien=function(j){return j&&!f.isFunction(j)&&/\{\s*\[native code\]\s*\}/.test(String(j))};f.extend=function(j){for(var k=1,m=arguments.length;k<m;k++)f._mixin(j.prototype,arguments[k]);return j};f._hitchArgs=function(j,k){var m=f._toArray(arguments,2),n=f.isString(k);return function(){var p=f._toArray(arguments),r=n?(j||f.global)[k]:k;return r&&r.apply(j||this,m.concat(p))}};f.hitch=function(j,k){if(arguments.length>
2)return f._hitchArgs.apply(f,arguments);if(!k){k=j;j=null}if(f.isString(k)){j=j||f.global;if(!j[k])throw['dojo.hitch: scope["',k,'"] is null (scope="',j,'")'].join("");return function(){return j[k].apply(j,arguments||[])}}return!j?k:function(){return k.apply(j,arguments||[])}};f.delegate=f._delegate=function(){function j(){}return function(k,m){j.prototype=k;k=new j;j.prototype=null;m&&f._mixin(k,m);return k}}();var a=function(j,k,m){return(m||[]).concat(Array.prototype.slice.call(j,k||0))},c=function(j,
k,m){m=m||[];for(k=k||0;k<j.length;k++)m.push(j[k]);return m};f._toArray=f.isIE?function(j){return(j.item?c:a).apply(this,arguments)}:a;f.partial=function(){return f.hitch.apply(f,[null].concat(f._toArray(arguments)))};var d=f._extraNames,g=d.length,h={};f.clone=function(j){if(!j||typeof j!="object"||f.isFunction(j))return j;if(j.nodeType&&"cloneNode"in j)return j.cloneNode(true);if(j instanceof Date)return new Date(j.getTime());if(j instanceof RegExp)return new RegExp(j);var k,m,n,p;if(f.isArray(j)){k=
[];m=0;for(n=j.length;m<n;++m)m in j&&k.push(f.clone(j[m]))}else k=j.constructor?new j.constructor:{};for(p in j){n=j[p];if(!(p in k)||k[p]!==n&&(!(p in h)||h[p]!==n))k[p]=f.clone(n)}if(g)for(m=0;m<g;++m){p=d[m];n=j[p];if(!(p in k)||k[p]!==n&&(!(p in h)||h[p]!==n))k[p]=n}return k};f.trim=String.prototype.trim?function(j){return j.trim()}:function(j){return j.replace(/^\s\s*/,"").replace(/\s\s*$/,"")};var i=/\{([^\}]+)\}/g;f.replace=function(j,k,m){return j.replace(m||i,f.isFunction(k)?k:function(n,
p){return f.getObject(p,false,k)})}})();return f});
define("dojo/_base/array",["dojo/lib/kernel","dojo/_base/lang"],function(f){(function(){var e=function(c,d,g){return[typeof c=="string"?c.split(""):c,d||f.global,typeof g=="string"?new Function("item","index","array",g):g]},a=function(c,d,g,h){var i=e(d,h,g);d=i[0];g=0;for(h=d.length;g<h;++g){var j=!!i[2].call(i[1],d[g],g,d);if(c^j)return j}return c};f.mixin(f,{indexOf:function(c,d,g,h){var i=1,j=c.length||0,k=0;if(h){k=j-1;i=j=-1}if(g!=undefined)k=g;if(h&&k>j||k<j)for(;k!=j;k+=i)if(c[k]==d)return k;
return-1},lastIndexOf:function(c,d,g){return f.indexOf(c,d,g,true)},forEach:function(c,d,g){if(c&&c.length){var h=e(c,g,d);c=h[0];d=0;for(g=c.length;d<g;++d)h[2].call(h[1],c[d],d,c)}},every:function(c,d,g){return a(true,c,d,g)},some:function(c,d,g){return a(false,c,d,g)},map:function(c,d,g,h){var i=e(c,g,d);c=i[0];d=h?new h:[];g=0;for(h=c.length;g<h;++g)d.push(i[2].call(i[1],c[g],g,c));return d},filter:function(c,d,g){var h=e(c,g,d);c=h[0];d=[];g=0;for(var i=c.length;g<i;++g)h[2].call(h[1],c[g],g,
c)&&d.push(c[g]);return d}})})();return f});
define("dojo/_base/declare",["dojo/lib/kernel","dojo/_base/lang","dojo/_base/array"],function(f){(function(){function e(o,q){throw new Error("declare"+(q?" "+q:"")+": "+o);}function a(o,q){for(var v=[],x=[{cls:0,refs:[]}],z={},C=1,A=o.length,F=0,H,N,I,O,M;F<A;++F){if(H=o[F])y.call(H)!="[object Function]"&&e("mixin #"+F+" is not a callable constructor.",q);else e("mixin #"+F+" is unknown. Did you use dojo.require to pull it in?",q);N=H._meta?H._meta.bases:[H];I=0;for(H=N.length-1;H>=0;--H){O=N[H].prototype;
if(!O.hasOwnProperty("declaredClass"))O.declaredClass="uniqName_"+D++;O=O.declaredClass;if(!z.hasOwnProperty(O)){z[O]={count:0,refs:[],cls:N[H]};++C}O=z[O];if(I&&I!==O){O.refs.push(I);++I.count}I=O}++I.count;x[0].refs.push(I)}for(;x.length;){I=x.pop();v.push(I.cls);for(--C;M=I.refs,M.length==1;){I=M[0];if(!I||--I.count){I=0;break}v.push(I.cls);--C}if(I){F=0;for(A=M.length;F<A;++F){I=M[F];--I.count||x.push(I)}}}C&&e("can't build consistent linearization",q);H=o[0];v[0]=H?H._meta&&H===v[v.length-H._meta.bases.length]?
H._meta.bases.length:1:0;return v}function c(o,q,v){var x,z,C,A,F,H,N,I=this._inherited=this._inherited||{};if(typeof o=="string"){x=o;o=q;q=v}v=0;A=o.callee;(x=x||A.nom)||e("can't deduce a name to call inherited()",this.declaredClass);F=this.constructor._meta;C=F.bases;N=I.p;if(x!=l){if(I.c!==A){N=0;H=C[0];F=H._meta;if(F.hidden[x]!==A){(z=F.chains)&&typeof z[x]=="string"&&e("calling chained method with inherited: "+x,this.declaredClass);do{F=H._meta;z=H.prototype;if(F&&(z[x]===A&&z.hasOwnProperty(x)||
F.hidden[x]===A))break}while(H=C[++N]);N=H?N:-1}}if(H=C[++N]){z=H.prototype;if(H._meta&&z.hasOwnProperty(x))v=z[x];else{A=t[x];do{z=H.prototype;if((v=z[x])&&(H._meta?z.hasOwnProperty(x):v!==A))break}while(H=C[++N])}}v=H&&v||t[x]}else{if(I.c!==A){N=0;if((F=C[0]._meta)&&F.ctor!==A){z=F.chains;if(!z||z.constructor!=="manual")e("calling chained constructor with inherited",this.declaredClass);for(;H=C[++N];)if((F=H._meta)&&F.ctor===A)break;N=H?N:-1}}for(;H=C[++N];)if(v=(F=H._meta)?F.ctor:H)break;v=H&&
v}I.c=v;I.p=N;if(v)return q===true?v:v.apply(this,q||o)}function d(o,q){if(typeof o=="string")return this.inherited(o,q,true);return this.inherited(o,true)}function g(o){for(var q=this.constructor._meta.bases,v=0,x=q.length;v<x;++v)if(q[v]===o)return true;return this instanceof o}function h(o,q){var v,x=0,z=s._extraNames.length;for(v in q)if(v!=l&&q.hasOwnProperty(v))o[v]=q[v];for(;x<z;++x){v=s._extraNames[x];if(v!=l&&q.hasOwnProperty(v))o[v]=q[v]}}function i(o,q){var v,x,z=0,C=s._extraNames.length;
for(v in q){x=q[v];if((x!==t[v]||!(v in t))&&v!=l){if(y.call(x)=="[object Function]")x.nom=v;o[v]=x}}for(;z<C;++z){v=s._extraNames[z];x=q[v];if((x!==t[v]||!(v in t))&&v!=l){if(y.call(x)=="[object Function]")x.nom=v;o[v]=x}}return o}function j(o){i(this.prototype,o);return this}function k(o,q){return function(){var v=arguments,x=v,z=v[0],C,A;A=o.length;var F;if(!(this instanceof v.callee))return w(v);if(q&&(z&&z.preamble||this.preamble)){F=new Array(o.length);F[0]=v;for(C=0;;){if(z=v[0])if(z=z.preamble)v=
z.apply(this,v)||v;z=o[C].prototype;if(z=z.hasOwnProperty("preamble")&&z.preamble)v=z.apply(this,v)||v;if(++C==A)break;F[C]=v}}for(C=A-1;C>=0;--C){z=o[C];if(z=(A=z._meta)?A.ctor:z)z.apply(this,F?F[C]:v)}(z=this.postscript)&&z.apply(this,x)}}function m(o,q){return function(){var v=arguments,x=v,z=v[0];if(!(this instanceof v.callee))return w(v);if(q){if(z)if(z=z.preamble)x=z.apply(this,x)||x;(z=this.preamble)&&z.apply(this,x)}o&&o.apply(this,v);(z=this.postscript)&&z.apply(this,v)}}function n(o){return function(){var q=
arguments,v=0,x,z;if(!(this instanceof q.callee))return w(q);for(;x=o[v];++v)if(x=(z=x._meta)?z.ctor:x){x.apply(this,q);break}(x=this.postscript)&&x.apply(this,q)}}function p(o,q,v){return function(){var x,z,C=0,A=1;if(v){C=q.length-1;A=-1}for(;x=q[C];C+=A){z=x._meta;(x=(z?z.hidden:x.prototype)[o])&&x.apply(this,arguments)}}}function r(o){B.prototype=o.prototype;o=new B;B.prototype=null;return o}function w(o){var q=o.callee,v=r(q);q.apply(v,o);return v}var s=f,u=s._mixin,t=Object.prototype,y=t.toString,
B=new Function,D=0,l="constructor";s.declare=function(o,q,v){if(typeof o!="string"){v=q;q=o;o=""}v=v||{};var x,z,C,A,F,H,N,I=1,O=q;if(y.call(q)=="[object Array]"){H=a(q,o);C=H[0];I=H.length-C;q=H[I]}else{H=[0];if(q)if(y.call(q)=="[object Function]"){C=q._meta;H=H.concat(C?C.bases:q)}else e("base class is not a callable constructor.",o);else q!==null&&e("unknown base class. Did you use dojo.require to pull it in?",o)}if(q)for(z=I-1;;--z){x=r(q);if(!z)break;C=H[z];(C._meta?h:u)(x,C.prototype);A=new Function;
A.superclass=q;A.prototype=x;q=x.constructor=A}else x={};i(x,v);C=v.constructor;if(C!==t.constructor){C.nom=l;x.constructor=C}for(z=I-1;z;--z)if((C=H[z]._meta)&&C.chains)N=u(N||{},C.chains);if(x["-chains-"])N=u(N||{},x["-chains-"]);C=!N||!N.hasOwnProperty(l);H[0]=A=N&&N.constructor==="manual"?n(H):H.length==1?m(v.constructor,C):k(H,C);A._meta={bases:H,hidden:v,chains:N,parents:O,ctor:v.constructor};A.superclass=q&&q.prototype;A.extend=j;A.prototype=x;x.constructor=A;x.getInherited=d;x.inherited=c;
x.isInstanceOf=g;if(o){x.declaredClass=o;s.setObject(o,A)}if(N)for(F in N)if(x[F]&&typeof N[F]=="string"&&F!=l){C=x[F]=p(F,H,N[F]==="after");C.nom=F}return A};s.safeMixin=i})();return f.declare});
define("dojo/_base/connect",["dojo/lib/kernel","dojo/_base/lang"],function(f){f._listener={getDispatcher:function(){return function(){var e=Array.prototype,a=arguments.callee,c=a._listeners;a=(a=a.target)&&a.apply(this,arguments);var d;c=[].concat(c);for(d in c)d in e||c[d].apply(this,arguments);return a}},add:function(e,a,c){e=e||f.global;var d=e[a];if(!d||!d._listeners){var g=f._listener.getDispatcher();g.target=d;g._listeners=[];d=e[a]=g}return d._listeners.push(c)},remove:function(e,a,c){(e=(e||
f.global)[a])&&e._listeners&&c--&&delete e._listeners[c]}};f.connect=function(){var e=arguments,a=[],c=0;a.push(f.isString(e[0])?null:e[c++],e[c++]);var d=e[c+1];a.push(f.isString(d)||f.isFunction(d)?e[c++]:null,e[c++]);for(d=e.length;c<d;c++)a.push(e[c]);return f._connect.apply(this,a)};f._connect=function(e,a,c,d){var g=f._listener;c=g.add(e,a,f.hitch(c,d));return[e,a,c,g]};f.disconnect=function(e){if(e&&e[0]!==undefined){f._disconnect.apply(this,e);delete e[0]}};f._disconnect=function(e,a,c,d){d.remove(e,
a,c)};f._topics={};f.subscribe=function(e,a,c){return[e,f._listener.add(f._topics,e,f.hitch(a,c))]};f.unsubscribe=function(e){e&&f._listener.remove(f._topics,e[0],e[1])};f.publish=function(e,a){if(e=f._topics[e])e.apply(this,a||[])};f.connectPublisher=function(e,a,c){var d=function(){f.publish(e,arguments)};return c?f.connect(a,c,d):f.connect(a,d)};return f.connect});
define("dojo/_base/Deferred",["dojo/lib/kernel","dojo/_base/lang"],function(f){(function(){var e=function(){},a=Object.freeze||function(){},c=function(){var d,g,h,i,j=false,k=function(){};return function(m){if(j)if(d){g.next={task:m,next:null};g=g.next}else g=d={task:m,next:null};else{j=true;do try{for(;m;){m();if(h){if(d)g.next=h;else d=h;g=i}if(d){h=d.next;i=g;m=d.task;d=g=null}else m=null}j=false}catch(n){m=k;console.error(n)}while(j)}}}();f.Deferred=function(d){function g(w){if(j)throw new Error("This deferred has already been resolved");
i=w;j=true;c(h)}function h(){for(var w;!w&&n;){var s=n;n=n.next;if(w=s.progress==e)j=false;var u=k?s.error:s.resolved;if(u)try{var t=u(i);if(t&&typeof t.then==="function")t.then(f.hitch(s.deferred,"resolve"),f.hitch(s.deferred,"reject"),f.hitch(s.deferred,"progress"));else{u=w&&t===undefined;if(w&&!u)k=t instanceof Error;s.deferred[u&&k?"reject":"resolve"](u?i:t)}}catch(y){s.deferred.reject(y)}else k?s.deferred.reject(i):s.deferred.resolve(i)}}var i,j,k,m,n,p=this.promise={};this.resolve=this.callback=
function(w){this.fired=0;this.results=[w,null];g(w)};this.reject=this.errback=function(w){k=true;this.fired=1;g(w);this.results=[null,w];if(!w||w.log!==false)(f.config.deferredOnError||function(s){console.error(s)})(w)};this.progress=function(w){for(var s=n;s;){var u=s.progress;u&&u(w);s=s.next}};this.addCallbacks=function(w,s){this.then(w,s,e);return this};this.then=p.then=function(w,s,u){var t=u==e?this:new f.Deferred(p.cancel);w={resolved:w,error:s,progress:u,deferred:t};if(n)m=m.next=w;else n=
m=w;j&&c(h);return t.promise};var r=this;this.cancel=p.cancel=function(){if(!j){var w=d&&d(r);if(!j){w instanceof Error||(w=new Error(w));w.log=false;r.reject(w)}}};a(p)};f.extend(f.Deferred,{addCallback:function(){return this.addCallbacks(f.hitch.apply(f,arguments))},addErrback:function(){return this.addCallbacks(null,f.hitch.apply(f,arguments))},addBoth:function(){var d=f.hitch.apply(f,arguments);return this.addCallbacks(d,d)},fired:-1})})();f.when=function(e,a,c,d){if(e&&typeof e.then==="function")return e.then(a,
c,d);return a(e)};return f.Deferred});
define("dojo/_base/json",["dojo/lib/kernel"],function(f){f.fromJson=function(e){return eval("("+e+")")};f._escapeString=function(e){return('"'+e.replace(/(["\\])/g,"\\$1")+'"').replace(/[\f]/g,"\\f").replace(/[\b]/g,"\\b").replace(/[\n]/g,"\\n").replace(/[\t]/g,"\\t").replace(/[\r]/g,"\\r")};f.toJsonIndentStr="\t";f.toJson=function(e,a,c){if(e===undefined)return"undefined";var d=typeof e;if(d=="number"||d=="boolean")return e+"";if(e===null)return"null";if(f.isString(e))return f._escapeString(e);var g=
arguments.callee,h;c=c||"";var i=a?c+f.toJsonIndentStr:"";h=e.__json__||e.json;if(f.isFunction(h)){h=h.call(e);if(e!==h)return g(h,a,i)}if(e.nodeType&&e.cloneNode)throw new Error("Can't serialize DOM nodes");h=a?" ":"";var j=a?"\n":"";if(f.isArray(e))return"["+f.map(e,function(p){p=g(p,a,i);if(typeof p!="string")p="undefined";return j+i+p}).join(","+h)+j+c+"]";if(d=="function")return null;d=[];var k;for(k in e){var m,n;if(typeof k=="number")m='"'+k+'"';else if(typeof k=="string")m=f._escapeString(k);
else continue;n=g(e[k],a,i);typeof n=="string"&&d.push(j+i+m+":"+h+n)}return"{"+d.join(","+h)+j+c+"}"};return f});
define("dojo/_base/Color",["dojo/lib/kernel","dojo/_base/array","dojo/_base/lang"],function(f){(function(){f.Color=function(e){e&&this.setColor(e)};f.Color.named={black:[0,0,0],silver:[192,192,192],gray:[128,128,128],white:[255,255,255],maroon:[128,0,0],red:[255,0,0],purple:[128,0,128],fuchsia:[255,0,255],green:[0,128,0],lime:[0,255,0],olive:[128,128,0],yellow:[255,255,0],navy:[0,0,128],blue:[0,0,255],teal:[0,128,128],aqua:[0,255,255],transparent:f.config.transparentColor||[255,255,255]};f.extend(f.Color,
{r:255,g:255,b:255,a:1,_set:function(e,a,c,d){this.r=e;this.g=a;this.b=c;this.a=d},setColor:function(e){if(f.isString(e))f.colorFromString(e,this);else if(f.isArray(e))f.colorFromArray(e,this);else{this._set(e.r,e.g,e.b,e.a);e instanceof f.Color||this.sanitize()}return this},sanitize:function(){return this},toRgb:function(){return[this.r,this.g,this.b]},toRgba:function(){return[this.r,this.g,this.b,this.a]},toHex:function(){return"#"+f.map(["r","g","b"],function(e){e=this[e].toString(16);return e.length<
2?"0"+e:e},this).join("")},toCss:function(e){var a=this.r+", "+this.g+", "+this.b;return(e?"rgba("+a+", "+this.a:"rgb("+a)+")"},toString:function(){return this.toCss(true)}});f.blendColors=function(e,a,c,d){var g=d||new f.Color;f.forEach(["r","g","b","a"],function(h){g[h]=e[h]+(a[h]-e[h])*c;if(h!="a")g[h]=Math.round(g[h])});return g.sanitize()};f.colorFromRgb=function(e,a){return(e=e.toLowerCase().match(/^rgba?\(([\s\.,0-9]+)\)/))&&f.colorFromArray(e[1].split(/\s*,\s*/),a)};f.colorFromHex=function(e,
a){var c=a||new f.Color,d=e.length==4?4:8,g=(1<<d)-1;e=Number("0x"+e.substr(1));if(isNaN(e))return null;f.forEach(["b","g","r"],function(h){var i=e&g;e>>=d;c[h]=d==4?17*i:i});c.a=1;return c};f.colorFromArray=function(e,a){a=a||new f.Color;a._set(Number(e[0]),Number(e[1]),Number(e[2]),Number(e[3]));if(isNaN(a.a))a.a=1;return a.sanitize()};f.colorFromString=function(e,a){var c=f.Color.named[e];return c&&f.colorFromArray(c,a)||f.colorFromRgb(e,a)||f.colorFromHex(e,a)}})();return f.Color});
define("dojo/_base/window",["dojo/lib/kernel"],function(f){f.doc=window.document||null;f.body=function(){return f.doc.body||f.doc.getElementsByTagName("body")[0]};f.setContext=function(e,a){f.global=e;f.doc=a};f.withGlobal=function(e,a,c,d){var g=f.global;try{f.global=e;return f.withDoc.call(null,e.document,a,c,d)}finally{f.global=g}};f.withDoc=function(e,a,c,d){var g=f.doc,h=f._bodyLtr,i=f.isQuirks;try{f.doc=e;delete f._bodyLtr;f.isQuirks=f.doc.compatMode=="BackCompat";if(c&&typeof a=="string")a=
c[a];return a.apply(c,d||[])}finally{f.doc=g;delete f._bodyLtr;if(h!==undefined)f._bodyLtr=h;f.isQuirks=i}};return f});
define("dojo/_base/event",["dojo/lib/kernel","dojo/_base/connect"],function(f){(function(){var e=f._event_listener={add:function(j,k,m){if(j){k=e._normalizeEventName(k);m=e._fixCallback(k,m);if(!f.isIE&&(k=="mouseenter"||k=="mouseleave")){var n=m;k=k=="mouseenter"?"mouseover":"mouseout";m=function(p){if(!f.isDescendant(p.relatedTarget,j))return n.call(this,p)}}j.addEventListener(k,m,false);return m}},remove:function(j,k,m){if(j){k=e._normalizeEventName(k);if(!f.isIE&&(k=="mouseenter"||k=="mouseleave"))k=
k=="mouseenter"?"mouseover":"mouseout";j.removeEventListener(k,m,false)}},_normalizeEventName:function(j){return j.slice(0,2)=="on"?j.slice(2):j},_fixCallback:function(j,k){return j!="keypress"?k:function(m){return k.call(this,e._fixEvent(m,this))}},_fixEvent:function(j){switch(j.type){case "keypress":e._setKeyChar(j);break}return j},_setKeyChar:function(j){j.keyChar=j.charCode>=32?String.fromCharCode(j.charCode):"";j.charOrCode=j.keyChar||j.keyCode},_punctMap:{106:42,111:47,186:59,187:43,188:44,
189:45,190:46,191:47,192:96,219:91,220:92,221:93,222:39}};f.fixEvent=function(j,k){return e._fixEvent(j,k)};f.stopEvent=function(j){j.preventDefault();j.stopPropagation()};var a=f._listener;f._connect=function(j,k,m,n,p){p=j&&(j.nodeType||j.attachEvent||j.addEventListener)?p?2:1:0;m=[f._listener,e,a][p].add(j,k,f.hitch(m,n));return[j,k,m,p]};f._disconnect=function(j,k,m,n){[f._listener,e,a][n].remove(j,k,m)};f.keys={BACKSPACE:8,TAB:9,CLEAR:12,ENTER:13,SHIFT:16,CTRL:17,ALT:18,META:f.isSafari?91:224,
PAUSE:19,CAPS_LOCK:20,ESCAPE:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT_ARROW:37,UP_ARROW:38,RIGHT_ARROW:39,DOWN_ARROW:40,INSERT:45,DELETE:46,HELP:47,LEFT_WINDOW:91,RIGHT_WINDOW:92,SELECT:93,NUMPAD_0:96,NUMPAD_1:97,NUMPAD_2:98,NUMPAD_3:99,NUMPAD_4:100,NUMPAD_5:101,NUMPAD_6:102,NUMPAD_7:103,NUMPAD_8:104,NUMPAD_9:105,NUMPAD_MULTIPLY:106,NUMPAD_PLUS:107,NUMPAD_ENTER:108,NUMPAD_MINUS:109,NUMPAD_PERIOD:110,NUMPAD_DIVIDE:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,
F11:122,F12:123,F13:124,F14:125,F15:126,NUM_LOCK:144,SCROLL_LOCK:145,copyKey:f.isMac&&!f.isAIR?f.isSafari?91:224:17};var c=f.isMac?"metaKey":"ctrlKey";f.isCopyKey=function(j){return j[c]};f.mouseButtons=f.isIE<9||f.isIE&&f.isQuirks?{LEFT:1,MIDDLE:4,RIGHT:2,isButton:function(j,k){return j.button&k},isLeft:function(j){return j.button&1},isMiddle:function(j){return j.button&4},isRight:function(j){return j.button&2}}:{LEFT:0,MIDDLE:1,RIGHT:2,isButton:function(j,k){return j.button==k},isLeft:function(j){return j.button==
0},isMiddle:function(j){return j.button==1},isRight:function(j){return j.button==2}};if(f.isIE){var d=function(j,k){try{return j.keyCode=k}catch(m){return 0}},g=f._listener,h=f._ieListenersName="_"+f._scopeName+"_listeners";if(!f.config._allow_leaks){a=g=f._ie_listener={handlers:[],add:function(j,k,m){j=j||f.global;var n=j[k];if(!n||!n[h]){var p=f._getIeDispatcher();p.target=n&&i.push(n)-1;p[h]=[];n=j[k]=p}return n[h].push(i.push(m)-1)},remove:function(j,k,m){k=(j=(j||f.global)[k])&&j[h];if(j&&k&&
m--){delete i[k[m]];delete k[m]}}};var i=g.handlers}f.mixin(e,{add:function(j,k,m){if(j){k=e._normalizeEventName(k);if(k=="onkeypress"){var n=j.onkeydown;if(!n||!n[h]||!n._stealthKeydownHandle){var p=e.add(j,"onkeydown",e._stealthKeyDown);n=j.onkeydown;n._stealthKeydownHandle=p;n._stealthKeydownRefs=1}else n._stealthKeydownRefs++}return g.add(j,k,e._fixCallback(m))}},remove:function(j,k,m){k=e._normalizeEventName(k);g.remove(j,k,m);if(k=="onkeypress"){k=j.onkeydown;if(--k._stealthKeydownRefs<=0){g.remove(j,
"onkeydown",k._stealthKeydownHandle);delete k._stealthKeydownHandle}}},_normalizeEventName:function(j){return j.slice(0,2)!="on"?"on"+j:j},_nop:function(){},_fixEvent:function(j,k){if(!j)j=(k&&(k.ownerDocument||k.document||k).parentWindow||window).event;if(!j)return j;j.target=j.srcElement;j.currentTarget=k||j.srcElement;j.layerX=j.offsetX;j.layerY=j.offsetY;k=(k=j.srcElement)&&k.ownerDocument||document;k=f.isIE<6||k.compatMode=="BackCompat"?k.body:k.documentElement;var m=f._getIeDocumentElementOffset();
j.pageX=j.clientX+f._fixIeBiDiScrollLeft(k.scrollLeft||0)-m.x;j.pageY=j.clientY+(k.scrollTop||0)-m.y;if(j.type=="mouseover")j.relatedTarget=j.fromElement;if(j.type=="mouseout")j.relatedTarget=j.toElement;if(f.isIE<9||f.isQuirks){j.stopPropagation=e._stopPropagation;j.preventDefault=e._preventDefault}return e._fixKeys(j)},_fixKeys:function(j){switch(j.type){case "keypress":var k="charCode"in j?j.charCode:j.keyCode;if(k==10){k=0;j.keyCode=13}else if(k==13||k==27)k=0;else if(k==3)k=99;j.charCode=k;e._setKeyChar(j);
break}return j},_stealthKeyDown:function(j){var k=j.currentTarget.onkeypress;if(k&&k[h]){var m=j.keyCode,n=(m!=13||f.isIE>=9&&!f.isQuirks)&&m!=32&&m!=27&&(m<48||m>90)&&(m<96||m>111)&&(m<186||m>192)&&(m<219||m>222);if(n||j.ctrlKey){n=n?0:m;if(j.ctrlKey)if(m==3||m==13)return;else if(n>95&&n<106)n-=48;else if(!j.shiftKey&&n>=65&&n<=90)n+=32;else n=e._punctMap[n]||n;m=e._synthesizeEvent(j,{type:"keypress",faux:true,charCode:n});k.call(j.currentTarget,m);if(f.isIE<9||f.isIE&&f.isQuirks)j.cancelBubble=
m.cancelBubble;j.returnValue=m.returnValue;d(j,m.keyCode)}}},_stopPropagation:function(){this.cancelBubble=true},_preventDefault:function(){this.bubbledKeyCode=this.keyCode;this.ctrlKey&&d(this,0);this.returnValue=false}});f.stopEvent=f.isIE<9||f.isQuirks?function(j){j=j||window.event;e._stopPropagation.call(j);e._preventDefault.call(j)}:f.stopEvent}e._synthesizeEvent=function(j,k){k=f.mixin({},j,k);e._setKeyChar(k);k.preventDefault=function(){j.preventDefault()};k.stopPropagation=function(){j.stopPropagation()};
return k};f.isOpera&&f.mixin(e,{_fixEvent:function(j){switch(j.type){case "keypress":var k=j.which;if(k==3)k=99;k=k<41&&!j.shiftKey?0:k;if(j.ctrlKey&&!j.shiftKey&&k>=65&&k<=90)k+=32;return e._synthesizeEvent(j,{charCode:k})}return j}});if(f.isWebKit){e._add=e.add;e._remove=e.remove;f.mixin(e,{add:function(j,k,m){if(j){var n=e._add(j,k,m);if(e._normalizeEventName(k)=="keypress")n._stealthKeyDownHandle=e._add(j,"keydown",function(p){var r=p.keyCode,w=r!=13&&r!=32&&(r<48||r>90)&&(r<96||r>111)&&(r<186||
r>192)&&(r<219||r>222);if(w||p.ctrlKey){w=w?0:r;if(p.ctrlKey)if(r==3||r==13)return;else if(w>95&&w<106)w-=48;else if(!p.shiftKey&&w>=65&&w<=90)w+=32;else w=e._punctMap[w]||w;r=e._synthesizeEvent(p,{type:"keypress",faux:true,charCode:w});m.call(p.currentTarget,r)}});return n}},remove:function(j,k,m){if(j){m._stealthKeyDownHandle&&e._remove(j,"keydown",m._stealthKeyDownHandle);e._remove(j,k,m)}},_fixEvent:function(j){switch(j.type){case "keypress":if(j.faux)return j;var k=j.charCode;k=k>=32?k:0;return e._synthesizeEvent(j,
{charCode:k,faux:true})}return j}})}})();if(f.isIE){f._ieDispatcher=function(e,a){var c=Array.prototype,d=f._ie_listener.handlers,g=e.callee,h=g[f._ieListenersName];g=(g=d[g.target])&&g.apply(a,e);h=[].concat(h);for(var i in h){var j=d[h[i]];!(i in c)&&j&&j.apply(a,e)}return g};f._getIeDispatcher=function(){return new Function(f._scopeName+"._ieDispatcher(arguments, this)")};f._event_listener._fixCallback=function(e){var a=f._event_listener._fixEvent;return function(c){return e.call(this,a(c,this))}}}return f.connect});
define("dojo/_base/html",["dojo/lib/kernel","dojo/_base/lang"],function(f){try{document.execCommand("BackgroundImageCache",false,true)}catch(e){}f.byId=f.isIE?function(a,c){if(typeof a!="string")return a;var d=c||f.doc;if((c=d.getElementById(a))&&(c.attributes.id.value==a||c.id==a))return c;else{var g=d.all[a];if(!g||g.nodeName)g=[g];for(var h=0;c=g[h++];)if(c.attributes&&c.attributes.id&&c.attributes.id.value==a||c.id==a)return c}}:function(a,c){return(typeof a=="string"?(c||f.doc).getElementById(a):
a)||null};(function(){var a=f.byId,c=null,d;f.addOnWindowUnload(function(){c=null});f._destroyElement=f.destroy=function(E){E=a(E);try{var G=E.ownerDocument;if(!c||d!=G){c=G.createElement("div");d=G}c.appendChild(E.parentNode?E.parentNode.removeChild(E):E);c.innerHTML=""}catch(K){}};f.isDescendant=function(E,G){try{E=a(E);for(G=a(G);E;){if(E==G)return true;E=E.parentNode}}catch(K){}return false};f.setSelectable=function(E,G){E=a(E);if(f.isMozilla)E.style.MozUserSelect=G?"":"none";else if(f.isKhtml||
f.isWebKit)E.style.KhtmlUserSelect=G?"auto":"none";else if(f.isIE){G=E.unselectable=G?"":"on";f.query("*",E).forEach("item.unselectable = '"+G+"'")}};var g=function(E,G){var K=G.parentNode;K&&K.insertBefore(E,G)},h=function(E,G){var K=G.parentNode;if(K)K.lastChild==G?K.appendChild(E):K.insertBefore(E,G.nextSibling)};f.place=function(E,G,K){G=a(G);if(typeof E=="string")E=/^\s*</.test(E)?f._toDom(E,G.ownerDocument):a(E);if(typeof K=="number"){var R=G.childNodes;!R.length||R.length<=K?G.appendChild(E):
g(E,R[K<0?0:K])}else switch(K){case "before":g(E,G);break;case "after":h(E,G);break;case "replace":G.parentNode.replaceChild(E,G);break;case "only":f.empty(G);G.appendChild(E);break;case "first":if(G.firstChild){g(E,G.firstChild);break}default:G.appendChild(E)}return E};f.boxModel="content-box";if(f.isIE)f.boxModel=document.compatMode=="BackCompat"?"border-box":"content-box";var i;i=f.isWebKit?function(E){var G;if(E.nodeType==1){var K=E.ownerDocument.defaultView;G=K.getComputedStyle(E,null);if(!G&&
E.style){E.style.display="";G=K.getComputedStyle(E,null)}}return G||{}}:f.isIE?function(E){return E.nodeType==1?E.currentStyle:{}}:function(E){return E.nodeType==1?E.ownerDocument.defaultView.getComputedStyle(E,null):{}};f.getComputedStyle=i;f._toPixelValue=f.isIE?function(E,G){if(!G)return 0;if(G=="medium")return 4;if(G.slice&&G.slice(-2)=="px")return parseFloat(G);with(E){E=style.left;var K=runtimeStyle.left;runtimeStyle.left=currentStyle.left;try{style.left=G;G=style.pixelLeft}catch(R){G=0}style.left=
E;runtimeStyle.left=K}return G}:function(E,G){return parseFloat(G)||0};var j=f._toPixelValue,k=function(E,G){try{return E.filters.item("DXImageTransform.Microsoft.Alpha")}catch(K){return G?{}:null}};f._getOpacity=f.isIE<9?function(E){try{return k(E).Opacity/100}catch(G){return 1}}:function(E){return i(E).opacity};f._setOpacity=f.isIE<9?function(E,G){var K=G*100,R=G==1;E.style.zoom=R?"":1;if(k(E))k(E,1).Opacity=K;else{if(R)return G;E.style.filter+=" progid:DXImageTransform.Microsoft.Alpha(Opacity="+
K+")"}k(E,1).Enabled=!R;E.nodeName.toLowerCase()=="tr"&&f.query("> td",E).forEach(function(U){f._setOpacity(U,G)});return G}:function(E,G){return E.style.opacity=G};var m={left:true,top:true},n=/margin|padding|width|height|max|min|offset/,p=function(E,G,K){G=G.toLowerCase();if(f.isIE){if(K=="auto"){if(G=="height")return E.offsetHeight;if(G=="width")return E.offsetWidth}if(G=="fontweight")switch(K){case 700:return"bold";case 400:default:return"normal"}}G in m||(m[G]=n.test(G));return m[G]?j(E,K):K},
r=f.isIE?"styleFloat":"cssFloat",w={cssFloat:r,styleFloat:r,"float":r};f.style=function(E,G,K){var R=a(E),U=arguments.length,V=G=="opacity";G=w[G]||G;if(U==3)return V?f._setOpacity(R,K):(R.style[G]=K);if(U==2&&V)return f._getOpacity(R);V=i(R);if(U==2&&typeof G!="string"){for(var X in G)f.style(E,X,G[X]);return V}return U==1?V:p(R,G,V[G]||R.style[G])};f._getPadExtents=function(E,G){G=G||i(E);var K=j(E,G.paddingLeft),R=j(E,G.paddingTop);return{l:K,t:R,w:K+j(E,G.paddingRight),h:R+j(E,G.paddingBottom)}};
f._getBorderExtents=function(E,G){G=G||i(E);var K=G.borderLeftStyle!="none"?j(E,G.borderLeftWidth):0,R=G.borderTopStyle!="none"?j(E,G.borderTopWidth):0;return{l:K,t:R,w:K+(G.borderRightStyle!="none"?j(E,G.borderRightWidth):0),h:R+(G.borderBottomStyle!="none"?j(E,G.borderBottomWidth):0)}};f._getPadBorderExtents=function(E,G){var K=G||i(E);G=f._getPadExtents(E,K);E=f._getBorderExtents(E,K);return{l:G.l+E.l,t:G.t+E.t,w:G.w+E.w,h:G.h+E.h}};f._getMarginExtents=function(E,G){G=G||i(E);var K=j(E,G.marginLeft),
R=j(E,G.marginTop),U=j(E,G.marginRight);E=j(E,G.marginBottom);if(f.isWebKit&&G.position!="absolute")U=K;return{l:K,t:R,w:K+U,h:R+E}};f._getMarginBox=function(E,G){var K=G||i(E);G=f._getMarginExtents(E,K);var R=E.offsetLeft-G.l,U=E.offsetTop-G.t,V=E.parentNode;if(f.isMoz){var X=parseFloat(K.left);K=parseFloat(K.top);if(!isNaN(X)&&!isNaN(K)){R=X;U=K}else if(V&&V.style){X=i(V);if(X.overflow!="visible"){V=f._getBorderExtents(V,X);R+=V.l;U+=V.t}}}else if(f.isOpera||f.isIE>7&&!f.isQuirks)if(V){V=f._getBorderExtents(V);
R-=V.l;U-=V.t}return{l:R,t:U,w:E.offsetWidth+G.w,h:E.offsetHeight+G.h}};f._getMarginSize=function(E,G){E=a(E);G=f._getMarginExtents(E,G||i(E));E=E.getBoundingClientRect();return{w:E.right-E.left+G.w,h:E.bottom-E.top+G.h}};f._getContentBox=function(E,G){var K=G||i(E);G=f._getPadExtents(E,K);K=f._getBorderExtents(E,K);var R=E.clientWidth;if(R){E=E.clientHeight;K.w=K.h=0}else{R=E.offsetWidth;E=E.offsetHeight}if(f.isOpera){G.l+=K.l;G.t+=K.t}return{l:G.l,t:G.t,w:R-G.w-K.w,h:E-G.h-K.h}};f._getBorderBox=
function(E,G){var K=G||i(E);G=f._getPadExtents(E,K);E=f._getContentBox(E,K);return{l:E.l-G.l,t:E.t-G.t,w:E.w+G.w,h:E.h+G.h}};f._setBox=function(E,G,K,R,U,V){V=V||"px";E=E.style;if(!isNaN(G))E.left=G+V;if(!isNaN(K))E.top=K+V;if(R>=0)E.width=R+V;if(U>=0)E.height=U+V};f._isButtonTag=function(E){return E.tagName=="BUTTON"||E.tagName=="INPUT"&&(E.getAttribute("type")||"").toUpperCase()=="BUTTON"};f._usesBorderBox=function(E){var G=E.tagName;return f.boxModel=="border-box"||G=="TABLE"||f._isButtonTag(E)};
f._setContentSize=function(E,G,K,R){if(f._usesBorderBox(E)){R=f._getPadBorderExtents(E,R);if(G>=0)G+=R.w;if(K>=0)K+=R.h}f._setBox(E,NaN,NaN,G,K)};f._setMarginBox=function(E,G,K,R,U,V){var X=V||i(E);V=f._usesBorderBox(E)?s:f._getPadBorderExtents(E,X);if(f.isWebKit)if(f._isButtonTag(E)){var ba=E.style;if(R>=0&&!ba.width)ba.width="4px";if(U>=0&&!ba.height)ba.height="4px"}X=f._getMarginExtents(E,X);if(R>=0)R=Math.max(R-V.w-X.w,0);if(U>=0)U=Math.max(U-V.h-X.h,0);f._setBox(E,G,K,R,U)};var s={l:0,t:0,w:0,
h:0};f.marginBox=function(E,G){E=a(E);var K=i(E);return!G?f._getMarginBox(E,K):f._setMarginBox(E,G.l,G.t,G.w,G.h,K)};f.contentBox=function(E,G){E=a(E);var K=i(E);return!G?f._getContentBox(E,K):f._setContentSize(E,G.w,G.h,K)};f._docScroll=function(){var E=f.global;return"pageXOffset"in E?{x:E.pageXOffset,y:E.pageYOffset}:(E=f.isQuirks?f.doc.body:f.doc.documentElement,{x:f._fixIeBiDiScrollLeft(E.scrollLeft||0),y:E.scrollTop||0})};f._isBodyLtr=function(){return"_bodyLtr"in f?f._bodyLtr:(f._bodyLtr=(f.body().dir||
f.doc.documentElement.dir||"ltr").toLowerCase()=="ltr")};f._getIeDocumentElementOffset=function(){var E=f.doc.documentElement;if(f.isIE<8){var G=E.getBoundingClientRect(),K=G.left;G=G.top;if(f.isIE<7){K+=E.clientLeft;G+=E.clientTop}return{x:K<0?0:K,y:G<0?0:G}}else return{x:0,y:0}};f._fixIeBiDiScrollLeft=function(E){var G=f.isIE;if(G&&!f._isBodyLtr()){var K=f.isQuirks,R=K?f.doc.body:f.doc.documentElement;if(G==6&&!K&&f.global.frameElement&&R.scrollHeight>R.clientHeight)E+=R.clientLeft;return G<8||
K?E+R.clientWidth-R.scrollWidth:-E}return E};f._abs=f.position=function(E,G){E=a(E);var K=f.body(),R=K.parentNode;E=E.getBoundingClientRect();E={x:E.left,y:E.top,w:E.right-E.left,h:E.bottom-E.top};if(f.isIE){R=f._getIeDocumentElementOffset();E.x-=R.x+(f.isQuirks?K.clientLeft+K.offsetLeft:0);E.y-=R.y+(f.isQuirks?K.clientTop+K.offsetTop:0)}else if(f.isFF==3){K=i(R);E.x-=j(R,K.marginLeft)+j(R,K.borderLeftWidth);E.y-=j(R,K.marginTop)+j(R,K.borderTopWidth)}if(G){G=f._docScroll();E.x+=G.x;E.y+=G.y}return E};
f.coords=function(E,G){E=a(E);var K=i(E);K=f._getMarginBox(E,K);G=f.position(E,G);K.x=G.x;K.y=G.y;return K};var u={"class":"className","for":"htmlFor",tabindex:"tabIndex",readonly:"readOnly",colspan:"colSpan",frameborder:"frameBorder",rowspan:"rowSpan",valuetype:"valueType"},t={classname:"class",htmlfor:"for",tabindex:"tabIndex",readonly:"readOnly"},y={innerHTML:1,className:1,htmlFor:f.isIE,value:1},B=function(E){return t[E.toLowerCase()]||E},D=function(E,G){return(E=E.getAttributeNode&&E.getAttributeNode(G))&&
E.specified};f.hasAttr=function(E,G){var K=G.toLowerCase();return y[u[K]||G]||D(a(E),t[K]||G)};var l={},o=0,q=f._scopeName+"attrid",v={col:1,colgroup:1,table:1,tbody:1,tfoot:1,thead:1,tr:1,title:1};f.attr=function(E,G,K){E=a(E);var R=arguments.length;if(R==2&&typeof G!="string"){for(var U in G)f.attr(E,U,G[U]);return E}var V=G.toLowerCase();U=u[V]||G;var X=y[U];V=t[V]||G;if(R==3){if(U=="style"&&typeof K!="string")f.style(E,K);else if(U=="innerHTML")if(f.isIE&&E.tagName.toLowerCase()in v){f.empty(E);
E.appendChild(f._toDom(K,E.ownerDocument))}else E[U]=K;else if(f.isFunction(K)){R=f.attr(E,q);if(!R){R=o++;f.attr(E,q,R)}l[R]||(l[R]={});if(X=l[R][U])f.disconnect(X);else try{delete E[U]}catch(ba){}l[R][U]=f.connect(E,U,K)}else if(X||typeof K=="boolean")E[U]=K;else E.setAttribute(V,K);return E}K=E[U];if(X&&typeof K!="undefined")return K;if(U!="href"&&(typeof K=="boolean"||f.isFunction(K)))return K;return D(E,V)?E.getAttribute(V):null};f.removeAttr=function(E,G){a(E).removeAttribute(B(G))};f.getNodeProp=
function(E,G){E=a(E);var K=G.toLowerCase(),R=u[K]||G;if(R in E&&R!="href")return E[R];G=t[K]||G;return D(E,G)?E.getAttribute(G):null};f.create=function(E,G,K,R){var U=f.doc;if(K){K=a(K);U=K.ownerDocument}if(typeof E=="string")E=U.createElement(E);G&&f.attr(E,G);K&&f.place(E,K,R);return E};f.empty=f.isIE?function(E){E=a(E);for(var G;G=E.lastChild;)f.destroy(G)}:function(E){a(E).innerHTML=""};var x={option:["select"],tbody:["table"],thead:["table"],tfoot:["table"],tr:["table","tbody"],td:["table","tbody",
"tr"],th:["table","thead","tr"],legend:["fieldset"],caption:["table"],colgroup:["table"],col:["table","colgroup"],li:["ul"]},z=/<\s*([\w\:]+)/,C={},A=0,F="__"+f._scopeName+"ToDomId";for(var H in x)if(x.hasOwnProperty(H)){var N=x[H];N.pre=H=="option"?'<select multiple="multiple">':"<"+N.join("><")+">";N.post="</"+N.reverse().join("></")+">"}f._toDom=function(E,G){G=G||f.doc;var K=G[F];if(!K){G[F]=K=++A+"";C[K]=G.createElement("div")}E+="";var R=E.match(z),U=R?R[1].toLowerCase():"";K=C[K];if(R&&x[U]){R=
x[U];K.innerHTML=R.pre+E+R.post;for(E=R.length;E;--E)K=K.firstChild}else K.innerHTML=E;if(K.childNodes.length==1)return K.removeChild(K.firstChild);for(E=G.createDocumentFragment();G=K.firstChild;)E.appendChild(G);return E};var I="className";f.hasClass=function(E,G){return(" "+a(E)[I]+" ").indexOf(" "+G+" ")>=0};var O=/\s+/,M=[""],Q={},T=function(E){if(typeof E=="string"||E instanceof String)if(E.indexOf(" ")<0){M[0]=E;return M}else return E.split(O);return E||""};f.addClass=function(E,G){E=a(E);
G=T(G);var K=E[I],R;K=K?" "+K+" ":" ";R=K.length;for(var U=0,V=G.length,X;U<V;++U)if((X=G[U])&&K.indexOf(" "+X+" ")<0)K+=X+" ";if(R<K.length)E[I]=K.substr(1,K.length-2)};f.removeClass=function(E,G){E=a(E);var K;if(G!==undefined){G=T(G);K=" "+E[I]+" ";for(var R=0,U=G.length;R<U;++R)K=K.replace(" "+G[R]+" "," ");K=f.trim(K)}else K="";if(E[I]!=K)E[I]=K};f.replaceClass=function(E,G,K){E=a(E);Q.className=E.className;f.removeClass(Q,K);f.addClass(Q,G);if(E.className!==Q.className)E.className=Q.className};
f.toggleClass=function(E,G,K){if(K===undefined)K=!f.hasClass(E,G);f[K?"addClass":"removeClass"](E,G)}})();return f});
define("dojo/_base/NodeList",["dojo/lib/kernel","dojo/_base/lang","dojo/_base/array","dojo/_base/connect","dojo/_base/html"],function(f){(function(){var e=Array.prototype,a=e.slice,c=e.concat,d=function(r,w,s){r.sort||(r=a.call(r,0));s=s||this._NodeListCtor||f._NodeListCtor;r.constructor=s;f._mixin(r,s.prototype);r._NodeListCtor=s;return w?r._stash(w):r},g=function(r,w,s){w=[0].concat(a.call(w,0));s=s||f.global;return function(u){w[0]=u;return r.apply(s,w)}},h=function(r,w){return function(){this.forEach(g(r,
arguments,w));return this}},i=function(r,w){return function(){return this.map(g(r,arguments,w))}},j=function(r,w,s){return function(){var u=arguments,t=g(r,u,s);if(w.call(s||f.global,u))return this.map(t);this.forEach(t);return this}},k=function(r){return r.length==1&&typeof r[0]=="string"},m=function(r){var w=r.parentNode;w&&w.removeChild(r)};f.NodeList=function(){return d(Array.apply(null,arguments))};var n=f._NodeListCtor=f.NodeList,p=n.prototype;n._wrap=p._wrap=d;n._adaptAsMap=i;n._adaptAsForEach=
h;n._adaptAsFilter=function(r,w){return function(){return this.filter(g(r,arguments,w))}};n._adaptWithCondition=j;f.forEach(["slice","splice"],function(r){var w=e[r];p[r]=function(){return this._wrap(w.apply(this,arguments),r=="slice"?this:null)}});f.forEach(["indexOf","lastIndexOf","every","some"],function(r){var w=f[r];p[r]=function(){return w.apply(f,[this].concat(a.call(arguments,0)))}});f.forEach(["attr","style"],function(r){p[r]=j(f[r],k)});f.forEach(["connect","addClass","removeClass","replaceClass",
"toggleClass","empty","removeAttr"],function(r){p[r]=h(f[r])});f.extend(f.NodeList,{_normalize:function(r,w){var s=r.parse===true?true:false;if(typeof r.template=="string"){var u=r.templateFunc||f.string&&f.string.substitute;r=u?u(r.template,r):r}u=typeof r;if(u=="string"||u=="number"){r=f._toDom(r,w&&w.ownerDocument);r=r.nodeType==11?f._toArray(r.childNodes):[r]}else if(f.isArrayLike(r))f.isArray(r)||(r=f._toArray(r));else r=[r];if(s)r._runParse=true;return r},_cloneNode:function(r){return r.cloneNode(true)},
_place:function(r,w,s,u){if(!(w.nodeType!=1&&s=="only")){w=w;for(var t,y=r.length,B=y-1;B>=0;B--){var D=u?this._cloneNode(r[B]):r[B];if(r._runParse&&f.parser&&f.parser.parse){t||(t=w.ownerDocument.createElement("div"));t.appendChild(D);f.parser.parse(t);for(D=t.firstChild;t.firstChild;)t.removeChild(t.firstChild)}B==y-1?f.place(D,w,s):w.parentNode.insertBefore(D,w);w=D}}},_stash:function(r){this._parent=r;return this},end:function(){return this._parent?this._parent:new this._NodeListCtor},concat:function(){var r=
f.isArray(this)?this:a.call(this,0),w=f.map(arguments,function(s){return s&&!f.isArray(s)&&(typeof NodeList!="undefined"&&s.constructor===NodeList||s.constructor===this._NodeListCtor)?a.call(s,0):s});return this._wrap(c.apply(r,w),this)},map:function(r,w){return this._wrap(f.map(this,r,w),this)},forEach:function(r,w){f.forEach(this,r,w);return this},coords:i(f.coords),position:i(f.position),place:function(r,w){var s=f.query(r)[0];return this.forEach(function(u){f.place(u,s,w)})},orphan:function(r){return(r?
f._filterQueryResult(this,r):this).forEach(m)},adopt:function(r,w){return f.query(r).place(this[0],w)._stash(this)},query:function(r){if(!r)return this;var w=this.map(function(s){return f.query(r,s).filter(function(u){return u!==undefined})});return this._wrap(c.apply([],w),this)},filter:function(r){var w=arguments,s=this,u=0;if(typeof r=="string"){s=f._filterQueryResult(this,w[0]);if(w.length==1)return s._stash(this);u=1}return this._wrap(f.filter(s,w[u],w[u+1]),this)},addContent:function(r,w){r=
this._normalize(r,this[0]);for(var s=0,u;u=this[s];s++)this._place(r,u,w,s>0);return this},instantiate:function(r,w){var s=f.isFunction(r)?r:f.getObject(r);w=w||{};return this.forEach(function(u){new s(w,u)})},at:function(){var r=new this._NodeListCtor;f.forEach(arguments,function(w){if(w<0)w=this.length+w;this[w]&&r.push(this[w])},this);return r._stash(this)}});n.events=["blur","focus","change","click","error","keydown","keypress","keyup","load","mousedown","mouseenter","mouseleave","mousemove",
"mouseout","mouseover","mouseup","submit"];f.forEach(n.events,function(r){var w="on"+r;p[w]=function(s,u){return this.connect(w,s,u)}})})();return f.NodeList});
(function(){var f=function(a){var c=a.trim,d=a.forEach,g=a._NodeListCtor=a.NodeList,h=function(){return a.doc},i=(a.isWebKit||a.isMozilla)&&h().compatMode=="BackCompat",j=h().firstChild.children?"children":"childNodes",k=false,m=function(){return true},n=function(L){L+=">~+".indexOf(L.slice(-1))>=0?" * ":" ";for(var J=function(pa,qa){return c(L.slice(pa,qa))},P=[],S=-1,W=-1,Y=-1,aa=-1,Z=-1,ca=-1,ia=-1,ka="",ja="",na,ha=0,ra=L.length,fa=null,la=null,sa=function(){if(ia>=0){var pa=ia==ha?null:J(ia,
ha);fa[">~+".indexOf(pa)<0?"tag":"oper"]=pa;ia=-1}},ta=function(){if(ca>=0){fa.id=J(ca,ha).replace(/\\/g,"");ca=-1}},ua=function(){if(Z>=0){fa.classes.push(J(Z+1,ha).replace(/\\/g,""));Z=-1}},oa=function(){ta();sa();ua()},va=function(){oa();aa>=0&&fa.pseudos.push({name:J(aa+1,ha)});fa.loops=fa.pseudos.length||fa.attrs.length||fa.classes.length;fa.oquery=fa.query=J(na,ha);fa.otag=fa.tag=fa.oper?null:fa.tag||"*";if(fa.tag)fa.tag=fa.tag.toUpperCase();if(P.length&&P[P.length-1].oper){fa.infixOper=P.pop();
fa.query=fa.infixOper.query+" "+fa.query}P.push(fa);fa=null};ka=ja,ja=L.charAt(ha),ha<ra;ha++)if(ka!="\\"){if(!fa){na=ha;fa={query:null,pseudos:[],attrs:[],classes:[],tag:null,oper:null,id:null,getTag:function(){return k?this.otag:this.tag}};ia=ha}if(S>=0)if(ja=="]"){if(la.attr)la.matchFor=J(Y||S+1,ha);else la.attr=J(S+1,ha);if(S=la.matchFor)if(S.charAt(0)=='"'||S.charAt(0)=="'")la.matchFor=S.slice(1,-1);fa.attrs.push(la);la=null;S=Y=-1}else{if(ja=="="){Y="|~^$*".indexOf(ka)>=0?ka:"";la.type=Y+ja;
la.attr=J(S+1,ha-Y.length);Y=ha+1}}else if(W>=0){if(ja==")"){if(aa>=0)la.value=J(W+1,ha);aa=W=-1}}else if(ja=="#"){oa();ca=ha+1}else if(ja=="."){oa();Z=ha}else if(ja==":"){oa();aa=ha}else if(ja=="["){oa();S=ha;la={}}else if(ja=="("){if(aa>=0){la={name:J(aa+1,ha),value:null};fa.pseudos.push(la)}W=ha}else ja==" "&&ka!=ja&&va()}return P},p=function(L,J){if(!L)return J;if(!J)return L;return function(){return L.apply(window,arguments)&&J.apply(window,arguments)}},r=function(L,J){J=J||[];L&&J.push(L);return J},
w=function(L){return 1==L.nodeType},s=function(L,J){if(!L)return"";if(J=="class")return L.className||"";if(J=="for")return L.htmlFor||"";if(J=="style")return L.style.cssText||"";return(k?L.getAttribute(J):L.getAttribute(J,2))||""},u={"*=":function(L,J){return function(P){return s(P,L).indexOf(J)>=0}},"^=":function(L,J){return function(P){return s(P,L).indexOf(J)==0}},"$=":function(L,J){return function(P){P=" "+s(P,L);return P.lastIndexOf(J)==P.length-J.length}},"~=":function(L,J){var P=" "+J+" ";
return function(S){return(" "+s(S,L)+" ").indexOf(P)>=0}},"|=":function(L,J){var P=" "+J+"-";return function(S){S=" "+s(S,L);return S==J||S.indexOf(P)==0}},"=":function(L,J){return function(P){return s(P,L)==J}}},t=typeof h().firstChild.nextElementSibling=="undefined",y=!t?"nextElementSibling":"nextSibling",B=!t?"previousElementSibling":"previousSibling",D=t?w:m,l=function(L){for(;L=L[B];)if(D(L))return false;return true},o=function(L){for(;L=L[y];)if(D(L))return false;return true},q=function(L){var J=
L.parentNode,P=0,S=J[j],W=L._i||-1,Y=J._l||-1;if(!S)return-1;S=S.length;if(Y==S&&W>=0&&Y>=0)return W;J._l=S;W=-1;for(J=J.firstElementChild||J.firstChild;J;J=J[y])if(D(J)){J._i=++P;if(L===J)W=P}return W},v=function(L){return!(q(L)%2)},x=function(L){return q(L)%2},z={checked:function(){return function(L){return!!("checked"in L?L.checked:L.selected)}},"first-child":function(){return l},"last-child":function(){return o},"only-child":function(){return function(L){if(!l(L))return false;if(!o(L))return false;
return true}},empty:function(){return function(L){var J=L.childNodes;for(L=L.childNodes.length-1;L>=0;L--){var P=J[L].nodeType;if(P===1||P==3)return false}return true}},contains:function(L,J){L=J.charAt(0);if(L=='"'||L=="'")J=J.slice(1,-1);return function(P){return P.innerHTML.indexOf(J)>=0}},not:function(L,J){L=n(J)[0];J={el:1};if(L.tag!="*")J.tag=1;if(!L.classes.length)J.classes=1;var P=A(L,J);return function(S){return!P(S)}},"nth-child":function(L,J){L=parseInt;if(J=="odd")return x;else if(J==
"even")return v;if(J.indexOf("n")!=-1){J=J.split("n",2);var P=J[0]?J[0]=="-"?-1:L(J[0]):1,S=J[1]?L(J[1]):0,W=0,Y=-1;if(P>0)if(S<0)S=S%P&&P+S%P;else{if(S>0){if(S>=P)W=S-S%P;S%=P}}else if(P<0){P*=-1;if(S>0){Y=S;S%=P}}if(P>0)return function(Z){Z=q(Z);return Z>=W&&(Y<0||Z<=Y)&&Z%P==S};else J=S}var aa=L(J);return function(Z){return q(Z)==aa}}},C=a.isIE<9||dojo.isIE&&dojo.isQuirks?function(L){var J=L.toLowerCase();if(J=="class")L="className";return function(P){return k?P.getAttribute(L):P[L]||P[J]}}:function(L){return function(J){return J&&
J.getAttribute&&J.hasAttribute(L)}},A=function(L,J){if(!L)return m;J=J||{};var P=null;"el"in J||(P=p(P,w));if(!("tag"in J))if(L.tag!="*")P=p(P,function(S){return S&&S.tagName==L.getTag()});"classes"in J||d(L.classes,function(S,W){var Y=new RegExp("(?:^|\\s)"+S+"(?:\\s|$)");P=p(P,function(aa){return Y.test(aa.className)});P.count=W});"pseudos"in J||d(L.pseudos,function(S){var W=S.name;if(z[W])P=p(P,z[W](W,S.value))});"attrs"in J||d(L.attrs,function(S){var W,Y=S.attr;if(S.type&&u[S.type])W=u[S.type](Y,
S.matchFor);else if(Y.length)W=C(Y);if(W)P=p(P,W)});if(!("id"in J))if(L.id)P=p(P,function(S){return!!S&&S.id==L.id});P||"default"in J||(P=m);return P},F=function(L){return function(J,P,S){for(;J=J[y];)if(!(t&&!w(J))){if((!S||ea(J,S))&&L(J))P.push(J);break}return P}},H=function(L){return function(J,P,S){for(J=J[y];J;){if(D(J)){if(S&&!ea(J,S))break;L(J)&&P.push(J)}J=J[y]}return P}},N=function(L){L=L||m;return function(J,P,S){for(var W=0,Y=J[j];J=Y[W++];)if(D(J)&&(!S||ea(J,S))&&L(J,W))P.push(J);return P}},
I=function(L,J){for(L=L.parentNode;L;){if(L==J)break;L=L.parentNode}return!!L},O={},M=function(L){var J=O[L.query];if(J)return J;var P=L.infixOper;P=P?P.oper:"";var S=A(L,{el:1}),W="*"==L.tag,Y=h().getElementsByClassName;if(P){Y={el:1};if(W)Y.tag=1;S=A(L,Y);if("+"==P)J=F(S);else if("~"==P)J=H(S);else if(">"==P)J=N(S)}else if(L.id){S=!L.loops&&W?m:A(L,{el:1,id:1});J=function(Z,ca){var ia=a.byId(L.id,Z.ownerDocument||Z);if(ia&&S(ia))if(9==Z.nodeType)return r(ia,ca);else if(I(ia,Z))return r(ia,ca)}}else if(Y&&
/\{\s*\[native code\]\s*\}/.test(String(Y))&&L.classes.length&&!i){S=A(L,{el:1,classes:1,id:1});var aa=L.classes.join(" ");J=function(Z,ca,ia){ca=r(0,ca);for(var ka,ja=0,na=Z.getElementsByClassName(aa);ka=na[ja++];)S(ka,Z)&&ea(ka,ia)&&ca.push(ka);return ca}}else if(!W&&!L.loops)J=function(Z,ca,ia){ca=r(0,ca);for(var ka=0,ja=Z.getElementsByTagName(L.getTag());Z=ja[ka++];)ea(Z,ia)&&ca.push(Z);return ca};else{S=A(L,{el:1,tag:1,id:1});J=function(Z,ca,ia){ca=r(0,ca);for(var ka,ja=0,na=Z.getElementsByTagName(L.getTag());ka=
na[ja++];)S(ka,Z)&&ea(ka,ia)&&ca.push(ka);return ca}}return O[L.query]=J},Q=function(L,J){L=r(L);for(var P,S,W=J.length,Y,aa,Z=0;Z<W;Z++){aa=[];P=J[Z];S=L.length-1;if(S>0){Y={};aa.nozip=true}S=M(P);for(var ca=0;P=L[ca];ca++)S(P,aa,Y);if(!aa.length)break;L=aa}return aa},T={},E={},G=function(L){var J=n(c(L));if(J.length==1){var P=M(J[0]);return function(S){if(S=P(S,new g))S.nozip=true;return S}}return function(S){return Q(S,J)}},K=navigator.userAgent;K=a.isWebKit&&K.indexOf("WebKit/")>0&&parseFloat(K.split("WebKit/")[1])>
528;var R=a.isIE?"commentStrip":"nozip",U=!!h().querySelectorAll&&(!a.isSafari||a.isSafari>3.1||K),V=/n\+\d|([^ ])?([>~+])([^ =])?/g,X=function(L,J,P,S){return P?(J?J+" ":"")+P+(S?" "+S:""):L},ba=function(L,J){L=L.replace(V,X);if(U){var P=E[L];if(P&&!J)return P}if(P=T[L])return P;P=L.charAt(0);var S=-1==L.indexOf(" ");if(L.indexOf("#")>=0&&S)J=true;if(U&&!J&&">~+".indexOf(P)==-1&&(!a.isIE||L.indexOf(":")==-1)&&!(i&&L.indexOf(".")>=0)&&L.indexOf(":contains")==-1&&L.indexOf(":checked")==-1&&L.indexOf("|=")==
-1){var W=">~+".indexOf(L.charAt(L.length-1))>=0?L+" *":L;return E[L]=function(aa){try{if(!(9==aa.nodeType||S))throw"";var Z=aa.querySelectorAll(W);Z[R]=true;return Z}catch(ca){return ba(L,true)(aa)}}}else{var Y=L.split(/\s*,\s*/);return T[L]=Y.length<2?G(L):function(aa){for(var Z=0,ca=[],ia;ia=Y[Z++];)ca=ca.concat(G(ia)(aa));return ca}}},$=0,da=a.isIE?function(L){return k?L.getAttribute("_uid")||L.setAttribute("_uid",++$)||$:L.uniqueID}:function(L){return L._uid||(L._uid=++$)},ea=function(L,J){if(!J)return 1;
L=da(L);if(!J[L])return J[L]=1;return 0},ga="_zipIdx",ma=function(L){if(L&&L.nozip)return g._wrap?g._wrap(L):L;var J=new g;if(!L||!L.length)return J;L[0]&&J.push(L[0]);if(L.length<2)return J;$++;if(a.isIE&&k){var P=$+"";L[0].setAttribute(ga,P);for(var S=1,W;W=L[S];S++){L[S].getAttribute(ga)!=P&&J.push(W);W.setAttribute(ga,P)}}else if(a.isIE&&L.commentStrip)try{for(S=1;W=L[S];S++)w(W)&&J.push(W)}catch(Y){}else{if(L[0])L[0][ga]=$;for(S=1;W=L[S];S++){L[S][ga]!=$&&J.push(W);W[ga]=$}}return J};a.query=
function(L,J){g=a._NodeListCtor;if(!L)return new g;if(L.constructor==g)return L;if(typeof L!="string")return new g(L);if(typeof J=="string"){J=a.byId(J);if(!J)return new g}J=J||h();var P=J.ownerDocument||J.documentElement;k=J.contentType&&J.contentType=="application/xml"||a.isOpera&&(J.doctype||P.toString()=="[object XMLDocument]")||!!P&&(a.isIE?P.xml:J.xmlVersion||P.xmlVersion);if((L=ba(L)(J))&&L.nozip&&!g._wrap)return L;return ma(L)};a.query.pseudos=z;a._filterQueryResult=function(L,J,P){var S=
new a._NodeListCtor,W=n(J);W=W.length==1&&!/[^\w#\.]/.test(J)?A(W[0]):function(Z){return dojo.query(J,P).indexOf(Z)!=-1};for(var Y=0,aa;aa=L[Y];Y++)W(aa)&&S.push(aa);return S}},e=function(){acme={trim:function(g){g=g.replace(/^\s+/,"");for(var h=g.length-1;h>=0;h--)if(/\S/.test(g.charAt(h))){g=g.substring(0,h+1);break}return g},forEach:function(g,h,i){if(g&&g.length)for(var j=0,k=g.length;j<k;++j)h.call(i||window,g[j],j,g)},byId:function(g,h){return typeof g=="string"?(h||document).getElementById(g):
g},doc:document,NodeList:Array};var a=navigator,c=a.userAgent;a=a.appVersion;var d=parseFloat(a);acme.isOpera=c.indexOf("Opera")>=0?d:undefined;acme.isKhtml=a.indexOf("Konqueror")>=0?d:undefined;acme.isWebKit=parseFloat(c.split("WebKit/")[1])||undefined;acme.isChrome=parseFloat(c.split("Chrome/")[1])||undefined;if((c=Math.max(a.indexOf("WebKit"),a.indexOf("Safari"),0))&&!acme.isChrome){acme.isSafari=parseFloat(a.split("Version/")[1]);if(!acme.isSafari||parseFloat(a.substr(c+7))<=419.3)acme.isSafari=
2}if(document.all&&!acme.isOpera)acme.isIE=parseFloat(a.split("MSIE ")[1])||undefined;Array._wrap=function(g){return g};return acme};typeof define=="function"&&define("dojo/_base/query",["dojo/lib/kernel","dojo/_base/NodeList","dojo/_base/lang","dojo/_base/window"],function(a){f(this.queryPortability||this.acme||a)});if(typeof define!="function")if(this.dojo){dojo.provide("dojo._base.query");dojo.require("dojo._base.NodeList");dojo.require("dojo._base.lang");f(this.queryPortability||this.acme||dojo)}else f(this.queryPortability||
this.acme||e())})();
define("dojo/_base/xhr",["dojo/lib/kernel","dojo/_base/Deferred","dojo/_base/json","dojo/_base/lang","dojo/_base/query"],function(f){(function(){function e(t,y,B){if(B!==null){var D=t[y];if(typeof D=="string")t[y]=[D,B];else if(a.isArray(D))D.push(B);else t[y]=B}}var a=f,c=a.config;f.fieldToObject=function(t){var y=null;if(t=a.byId(t)){var B=t.name,D=(t.type||"").toLowerCase();if(B&&D&&!t.disabled)if(D=="radio"||D=="checkbox"){if(t.checked)y=t.value}else if(t.multiple){y=[];a.query("option",t).forEach(function(l){l.selected&&
y.push(l.value)})}else y=t.value}return y};f.formToObject=function(t){var y={};a.forEach(f.byId(t).elements,function(B){var D=B.name,l=(B.type||"").toLowerCase();if(D&&l&&"file|submit|image|reset|button|".indexOf(l)==-1&&!B.disabled){e(y,D,a.fieldToObject(B));if(l=="image")y[D+".x"]=y[D+".y"]=y[D].x=y[D].y=0}});return y};f.objectToQuery=function(t){var y=encodeURIComponent,B=[],D={};for(var l in t){var o=t[l];if(o!=D[l]){var q=y(l)+"=";if(a.isArray(o))for(var v=0;v<o.length;v++)B.push(q+y(o[v]));
else B.push(q+y(o))}}return B.join("&")};f.formToQuery=function(t){return a.objectToQuery(a.formToObject(t))};f.formToJson=function(t,y){return a.toJson(a.formToObject(t),y)};f.queryToObject=function(t){var y={};t=t.split("&");var B=decodeURIComponent;a.forEach(t,function(D){if(D.length){var l=D.split("=");D=B(l.shift());l=B(l.join("="));if(typeof y[D]=="string")y[D]=[y[D]];if(a.isArray(y[D]))y[D].push(l);else y[D]=l}});return y};f._blockAsync=false;var d=a._contentHandlers=f.contentHandlers={text:function(t){return t.responseText},
json:function(t){return a.fromJson(t.responseText||null)},"json-comment-filtered":function(t){f.config.useCommentedJson||console.warn("Consider using the standard mimetype:application/json. json-commenting can introduce security issues. To decrease the chances of hijacking, use the standard the 'json' handler and prefix your json with: {}&&\nUse djConfig.useCommentedJson=true to turn off this message.");t=t.responseText;var y=t.indexOf("/*"),B=t.lastIndexOf("*/");if(y==-1||B==-1)throw new Error("JSON was not comment filtered");
return a.fromJson(t.substring(y+2,B))},javascript:function(t){return a.eval(t.responseText)},xml:function(t){var y=t.responseXML;if(a.isIE&&(!y||!y.documentElement)){var B=function(D){return"MSXML"+D+".DOMDocument"};B=["Microsoft.XMLDOM",B(6),B(4),B(3),B(2)];a.some(B,function(D){try{var l=new ActiveXObject(D);l.async=false;l.loadXML(t.responseText);y=l}catch(o){return false}return true})}return y},"json-comment-optional":function(t){return t.responseText&&/^[^{\[]*\/\*/.test(t.responseText)?d["json-comment-filtered"](t):
d.json(t)}};f._ioSetArgs=function(t,y,B,D){var l={args:t,url:t.url},o=null;if(t.form){o=a.byId(t.form);var q=o.getAttributeNode("action");l.url=l.url||(q?q.value:null);o=a.formToObject(o)}q=[{}];o&&q.push(o);t.content&&q.push(t.content);t.preventCache&&q.push({"dojo.preventCache":(new Date).valueOf()});l.query=a.objectToQuery(a.mixin.apply(null,q));l.handleAs=t.handleAs||"text";var v=new a.Deferred(y);v.addCallbacks(B,function(A){return D(A,v)});var x=t.load;x&&a.isFunction(x)&&v.addCallback(function(A){return x.call(t,
A,l)});var z=t.error;z&&a.isFunction(z)&&v.addErrback(function(A){return z.call(t,A,l)});var C=t.handle;C&&a.isFunction(C)&&v.addBoth(function(A){return C.call(t,A,l)});if(c.ioPublish&&a.publish&&l.args.ioPublish!==false){v.addCallbacks(function(A){a.publish("/dojo/io/load",[v,A]);return A},function(A){a.publish("/dojo/io/error",[v,A]);return A});v.addBoth(function(A){a.publish("/dojo/io/done",[v,A]);return A})}v.ioArgs=l;return v};var g=function(t){t.canceled=true;var y=t.ioArgs.xhr,B=typeof y.abort;
if(B=="function"||B=="object"||B=="unknown")y.abort();t=t.ioArgs.error;if(!t){t=new Error("xhr cancelled");t.dojoType="cancel"}return t},h=function(t){t=d[t.ioArgs.handleAs](t.ioArgs.xhr);return t===undefined?null:t},i=function(t,y){y.ioArgs.args.failOk||console.error(t);return t},j=null,k=[],m=0,n=function(t){if(m<=0){m=0;if(c.ioPublish&&a.publish&&(!t||t&&t.ioArgs.args.ioPublish!==false))a.publish("/dojo/io/stop")}},p=function(){var t=(new Date).getTime();if(!a._blockAsync)for(var y=0,B;y<k.length&&
(B=k[y]);y++){var D=B.dfd,l=function(){if(!D||D.canceled||!B.validCheck(D)){k.splice(y--,1);m-=1}else if(B.ioCheck(D)){k.splice(y--,1);B.resHandle(D);m-=1}else if(D.startTime)if(D.startTime+(D.ioArgs.args.timeout||0)<t){k.splice(y--,1);var q=new Error("timeout exceeded");q.dojoType="timeout";D.errback(q);D.cancel();m-=1}};if(f.config.debugAtAllCosts)l.call(this);else try{l.call(this)}catch(o){D.errback(o)}}n(D);if(!k.length){clearInterval(j);j=null}};f._ioCancelAll=function(){try{a.forEach(k,function(y){try{y.dfd.cancel()}catch(B){}})}catch(t){}};
a.isIE&&a.addOnWindowUnload(a._ioCancelAll);a._ioNotifyStart=function(t){if(c.ioPublish&&a.publish&&t.ioArgs.args.ioPublish!==false){m||a.publish("/dojo/io/start");m+=1;a.publish("/dojo/io/send",[t])}};a._ioWatch=function(t,y,B,D){var l=t.ioArgs.args;if(l.timeout)t.startTime=(new Date).getTime();k.push({dfd:t,validCheck:y,ioCheck:B,resHandle:D});j||(j=setInterval(p,50));l.sync&&p()};var r="application/x-www-form-urlencoded",w=function(t){return t.ioArgs.xhr.readyState},s=function(t){return 4==t.ioArgs.xhr.readyState},
u=function(t){var y=t.ioArgs.xhr;if(a._isDocumentOk(y))t.callback(t);else{var B=new Error("Unable to load "+t.ioArgs.url+" status:"+y.status);B.status=y.status;B.responseText=y.responseText;t.errback(B)}};f._ioAddQueryToUrl=function(t){if(t.query.length){t.url+=(t.url.indexOf("?")==-1?"?":"&")+t.query;t.query=null}};f.xhr=function(t,y,B){var D=a._ioSetArgs(y,g,h,i),l=D.ioArgs,o=l.xhr=a._xhrObj(l.args);if(!o){D.cancel();return D}if("postData"in y)l.query=y.postData;else if("putData"in y)l.query=y.putData;
else if("rawBody"in y)l.query=y.rawBody;else if(arguments.length>2&&!B||"POST|PUT".indexOf(t.toUpperCase())==-1)a._ioAddQueryToUrl(l);o.open(t,l.url,y.sync!==true,y.user||undefined,y.password||undefined);if(y.headers)for(var q in y.headers)if(q.toLowerCase()==="content-type"&&!y.contentType)y.contentType=y.headers[q];else y.headers[q]&&o.setRequestHeader(q,y.headers[q]);o.setRequestHeader("Content-Type",y.contentType||r);if(!y.headers||!("X-Requested-With"in y.headers))o.setRequestHeader("X-Requested-With",
"XMLHttpRequest");a._ioNotifyStart(D);if(f.config.debugAtAllCosts)o.send(l.query);else try{o.send(l.query)}catch(v){l.error=v;D.cancel()}a._ioWatch(D,w,s,u);return D};f.xhrGet=function(t){return a.xhr("GET",t)};f.rawXhrPost=f.xhrPost=function(t){return a.xhr("POST",t,true)};f.rawXhrPut=f.xhrPut=function(t){return a.xhr("PUT",t,true)};f.xhrDelete=function(t){return a.xhr("DELETE",t)}})();return f.xhr});
define("dojo/_base/fx",["dojo/lib/kernel","dojo/_base/Color","dojo/_base/connect","dojo/_base/lang","dojo/_base/html"],function(f){(function(){var e=f._mixin;f._Line=function(i,j){this.start=i;this.end=j};f._Line.prototype.getValue=function(i){return(this.end-this.start)*i+this.start};f.Animation=function(i){e(this,i);if(f.isArray(this.curve))this.curve=new f._Line(this.curve[0],this.curve[1])};f._Animation=f.Animation;f.extend(f.Animation,{duration:350,repeat:0,rate:20,_percent:0,_startRepeatCount:0,
_getStep:function(){var i=this._percent,j=this.easing;return j?j(i):i},_fire:function(i,j){j=j||[];if(this[i])if(f.config.debugAtAllCosts)this[i].apply(this,j);else try{this[i].apply(this,j)}catch(k){console.error("exception in animation handler for:",i);console.error(k)}return this},play:function(i,j){var k=this;k._delayTimer&&k._clearTimer();if(j){k._stopTimer();k._active=k._paused=false;k._percent=0}else if(k._active&&!k._paused)return k;k._fire("beforeBegin",[k.node]);i=i||k.delay;var m=f.hitch(k,
"_play",j);if(i>0){k._delayTimer=setTimeout(m,i);return k}m();return k},_play:function(){var i=this;i._delayTimer&&i._clearTimer();i._startTime=(new Date).valueOf();if(i._paused)i._startTime-=i.duration*i._percent;i._active=true;i._paused=false;var j=i.curve.getValue(i._getStep());if(!i._percent){if(!i._startRepeatCount)i._startRepeatCount=i.repeat;i._fire("onBegin",[j])}i._fire("onPlay",[j]);i._cycle();return i},pause:function(){var i=this;i._delayTimer&&i._clearTimer();i._stopTimer();if(!i._active)return i;
i._paused=true;i._fire("onPause",[i.curve.getValue(i._getStep())]);return i},gotoPercent:function(i,j){var k=this;k._stopTimer();k._active=k._paused=true;k._percent=i;j&&k.play();return k},stop:function(i){var j=this;j._delayTimer&&j._clearTimer();if(!j._timer)return j;j._stopTimer();if(i)j._percent=1;j._fire("onStop",[j.curve.getValue(j._getStep())]);j._active=j._paused=false;return j},status:function(){if(this._active)return this._paused?"paused":"playing";return"stopped"},_cycle:function(){var i=
this;if(i._active){var j=((new Date).valueOf()-i._startTime)/i.duration;if(j>=1)j=1;i._percent=j;if(i.easing)j=i.easing(j);i._fire("onAnimate",[i.curve.getValue(j)]);if(i._percent<1)i._startTimer();else{i._active=false;if(i.repeat>0){i.repeat--;i.play(null,true)}else if(i.repeat==-1)i.play(null,true);else if(i._startRepeatCount){i.repeat=i._startRepeatCount;i._startRepeatCount=0}i._percent=0;i._fire("onEnd",[i.node]);!i.repeat&&i._stopTimer()}}return i},_clearTimer:function(){clearTimeout(this._delayTimer);
delete this._delayTimer}});var a=0,c=null,d={run:function(){}};f.extend(f.Animation,{_startTimer:function(){if(!this._timer){this._timer=f.connect(d,"run",this,"_cycle");a++}c||(c=setInterval(f.hitch(d,"run"),this.rate))},_stopTimer:function(){if(this._timer){f.disconnect(this._timer);this._timer=null;a--}if(a<=0){clearInterval(c);c=null;a=0}}});var g=f.isIE?function(i){var j=i.style;if(!j.width.length&&f.style(i,"width")=="auto")j.width="auto"}:function(){};f._fade=function(i){i.node=f.byId(i.node);
var j=e({properties:{}},i);i=j.properties.opacity={};i.start=!("start"in j)?function(){return+f.style(j.node,"opacity")||0}:j.start;i.end=j.end;i=f.animateProperty(j);f.connect(i,"beforeBegin",f.partial(g,j.node));return i};f.fadeIn=function(i){return f._fade(e({end:1},i))};f.fadeOut=function(i){return f._fade(e({end:0},i))};f._defaultEasing=function(i){return 0.5+Math.sin((i+1.5)*Math.PI)/2};var h=function(i){this._properties=i;for(var j in i){var k=i[j];if(k.start instanceof f.Color)k.tempColor=
new f.Color}};h.prototype.getValue=function(i){var j={};for(var k in this._properties){var m=this._properties[k],n=m.start;if(n instanceof f.Color)j[k]=f.blendColors(n,m.end,i,m.tempColor).toCss();else f.isArray(n)||(j[k]=(m.end-n)*i+n+(k!="opacity"?m.units||"px":0))}return j};f.animateProperty=function(i){var j=i.node=f.byId(i.node);if(!i.easing)i.easing=f._defaultEasing;i=new f.Animation(i);f.connect(i,"beforeBegin",i,function(){var k={};for(var m in this.properties){if(m=="width"||m=="height")this.node.display=
"block";var n=this.properties[m];if(f.isFunction(n))n=n(j);n=k[m]=e({},f.isObject(n)?n:{end:n});if(f.isFunction(n.start))n.start=n.start(j);if(f.isFunction(n.end))n.end=n.end(j);var p=m.toLowerCase().indexOf("color")>=0,r=function(w,s){var u={height:w.offsetHeight,width:w.offsetWidth}[s];if(u!==undefined)return u;u=f.style(w,s);return s=="opacity"?+u:p?u:parseFloat(u)};if("end"in n){if(!("start"in n))n.start=r(j,m)}else n.end=r(j,m);if(p){n.start=new f.Color(n.start);n.end=new f.Color(n.end)}else n.start=
m=="opacity"?+n.start:parseFloat(n.start)}this.curve=new h(k)});f.connect(i,"onAnimate",f.hitch(f,"style",i.node));return i};f.anim=function(i,j,k,m,n,p){return f.animateProperty({node:i,duration:k||f.Animation.prototype.duration,properties:j,easing:m,onEnd:n}).play(p||0)}})();return f.animateProperty});
define("dojo",["dojo/lib/kernel","dojo/_base/lang","dojo/_base/array","dojo/_base/declare","dojo/_base/connect","dojo/_base/Deferred","dojo/_base/json","dojo/_base/Color","dojo/_base/window","dojo/_base/event","dojo/_base/html","dojo/_base/NodeList","dojo/_base/query","dojo/_base/xhr","dojo/_base/fx"],function(f){return f});
define("orion/serviceregistry",["dojo"],function(f){function e(h,i,j){this.serviceId=h;this.name=i;this.properties=j}function a(h,i,j){this.serviceId=h;this.serviceReference=i;this.internalRegistry=j}function c(h,i,j){this.serviceId=h;this.implementation=i;this.internalRegistry=j;var k;for(k in i)if(typeof i[k]==="function")this[k]=function(m){return function(){if(j.isRegistered(h)){var n=new f.Deferred;try{var p=i[m].apply(i,Array.prototype.slice.call(arguments));f.when(p,f.hitch(n,n.resolve),f.hitch(n,
n.reject),f.hitch(n,n.progress))}catch(r){n.reject(r)}return n}throw new Error("Service was unregistered");}}(k)}function d(){this._namedlisteners={}}function g(){this._entries=[];this._namedReferences={};this._serviceEventTarget=new d;var h=this;this.internalRegistry={isRegistered:function(i){return h._entries[i]?true:false},unregisterService:function(i){var j=h._entries[i];if(j){for(var k=j.reference,m=h._namedReferences[k.getName()],n=0;n<m.length;n++)if(m[n]===k){if(m.length===1)delete h._namedReferences[k.getName()];
else m.splice(n,1);break}h._entries[i]=null;h._serviceEventTarget.dispatchEvent("serviceRemoved",k,j.service)}},dispatchEvent:function(i,j){var k=h._entries[i];k&&k.eventTarget.dispatchEvent.apply(k.eventTarget,[j].concat(Array.prototype.slice.call(arguments,2)))},addEventListener:function(i,j,k){(i=h._entries[i])&&i.eventTarget.addEventListener(j,k)},removeEventListener:function(i,j,k){(i=h._entries[i])&&i.eventTarget.removeEventListener(j,k)}}}e.prototype={getServiceId:function(){return this.serviceId},
getName:function(){return this.name},getPropertyNames:function(){var h=[],i;for(i in this.properties)this.properties.hasOwnProperty(i)&&h.push(i);return h},getProperty:function(h){return this.properties[h]}};e.prototype.constructor=e;a.prototype={unregister:function(){this.internalRegistry.unregisterService(this.serviceId)},dispatchEvent:function(h){this.internalRegistry.dispatchEvent.apply(this.internalRegistry,[this.serviceId,h].concat(Array.prototype.slice.call(arguments,1)))},getServiceReference:function(){return this.serviceReference}};
a.prototype.constructor=a;c.prototype={addEventListener:function(h,i){this.internalRegistry.addEventListener(this.serviceId,h,i)},removeEventListener:function(h,i){this.internalRegistry.removeEventListener(this.serviceId,h,i)}};c.prototype.constructor=c;d.prototype={dispatchEvent:function(h){var i=this._namedlisteners[h];if(i)for(var j=0;j<i.length;j++)try{var k=Array.prototype.slice.call(arguments,1);i[j].apply(null,k)}catch(m){console.log(m)}},addEventListener:function(h,i){this._namedlisteners[h]=
this._namedlisteners[h]||[];this._namedlisteners[h].push(i)},removeEventListener:function(h,i){var j=this._namedlisteners[h];if(j)for(var k=0;k<j.length;k++)if(j[k]===i){if(j.length===1)delete this._namedlisteners[h];else j.splice(k,1);break}}};d.prototype.constructor=d;g.prototype={getService:function(h){var i;if(typeof h==="string"){if(this._namedReferences[h])for(var j=0;j<this._namedReferences[h].length;j++)if(i=this._entries[this._namedReferences[h][j].getServiceId()].service)break}else i=this._entries[h.getServiceId()].service;
return i},getServiceReferences:function(h){if(h)return this._namedReferences[h]?this._namedReferences[h]:[];h=[];for(var i=0;i<this._entries.length;i++)this._entries[i]&&h.push(this._entries[i].reference);return h},registerService:function(h,i,j){var k=this._entries.length;j=new e(k,h,j);i=new c(k,i,this.internalRegistry);this._namedReferences[h]=this._namedReferences[h]||[];this._namedReferences[h].push(j);this._entries.push({reference:j,service:i,eventTarget:new d});this._serviceEventTarget.dispatchEvent("serviceAdded",
j,i);return new a(k,j,this.internalRegistry)},addEventListener:function(h,i){this._serviceEventTarget.addEventListener(h,i)},removeEventListener:function(h,i){this._serviceEventTarget.removeEventListener(h,i)}};g.prototype.constructor=g;return{ServiceReference:e,ServiceRegistration:a,Service:c,EventTarget:d,ServiceRegistry:g}});define("dijit",["dojo"],function(f){return dijit=f._dijit||{}});
define("orion/commonHTMLFragments",["require"],function(f){var e='<div id="staticBanner" class="layoutBlock topRowBanner"><a id="home" class="layoutLeft logo" href="'+f.toUrl("index.html")+'"><img src="'+f.toUrl("images/orion-small-lightondark.gif")+'" alt="Orion Logo"/></a><div id="primaryNav" class="layoutLeft primaryNav"></div><div id="userMenu" class="layoutRight textless"></div><div id="userInfo" class="layoutRight primaryNav"></div><div class="layoutRight primaryNav">|</div></div><div id="titleArea" class="layoutBlock titleArea"><div id="pageTitle" class="layoutLeft pageTitle"></div><input type="search" id="search" placeholder="Search" title="Type a keyword or wild card to search in root" class="layoutRight searchbox"><div id="relatedLinks" class="layoutRight pageNav"></div><div id="extras" class="layoutRight pageNav"><div id="globalActions" class="pageNav"></div><span id="pageFavorite" tabindex="0" role="button" aria-label="Add this page to the favorites list" class="imageSprite core-sprite-favorite_sml"></span></div><div id="dimension" class="clear dimension"></div><div id="location" class="clear currentLocation"></div></div>';
f='<div class="layoutLeft pageActions" id="pageActions"></div><div class="layoutLeft pageActions" id="selectionTools"></div><img class="layoutRight progressPane" src="'+f.toUrl("images/none.png")+'" id="progressPane"></img><div class="layoutRight status" id="statusPane"></div><div class="layoutRight pageActions" id="pageNavigationActions"></div><div id="notificationArea" class="layoutLeft layoutBlock slideContainer"><div class="layoutLeft" id="notifications" aria-live="assertive" aria-atomic="true"></div><div class="layoutRight"><span tabindex: "0" role: "button" class="layoutRight core-sprite-close imageSprite" id="closeNotifications"></span></div></div><div id="parameterArea" class="layoutBlock slideParameters slideContainer"><span id="pageParameterArea" class="slide"><span id="pageCommandParameters" class="parameters"></span><span id="pageCommandDismiss" class="parametersDismiss"></span></span></div>';
return{topHTMLFragment:e,bottomHTMLFragment:'<div class="layoutBlock"><div class="footerBlock">Orion is in Beta. Please try it out but BEWARE your data may be lost.</div><div class="footerRightBlock"><a href="http://wiki.eclipse.org/Orion/FAQ" target="_blank">FAQ</a> | <a href="https://bugs.eclipse.org/bugs/enter_bug.cgi?product=Orion&version=0.4" target="_blank">Report a Bug</a> | <a href="http://www.eclipse.org/legal/privacy.php" target="_blank">Privacy Policy</a> | <a href="http://www.eclipse.org/legal/termsofuse.php" target="_blank">Terms of Use</a> | <a href="http://www.eclipse.org/legal/copyright.php" target="_blank">Copyright Agent</a></div></div>',
toolbarHTMLFragment:f}});
define("dojo/hash",["dojo"],function(f){(function(){function e(n,p){p=n.indexOf(p);return p>=0?n.substring(p+1):""}function a(){return e(location.href,"#")}function c(){f.publish("/dojo/hashchange",[a()])}function d(){if(a()!==i){i=a();c()}}function g(n){if(j)if(j.isTransitioning())setTimeout(f.hitch(null,g,n),m);else{var p=j.iframe.location.href,r=p.indexOf("?");j.iframe.location.replace(p.substring(0,r)+"?"+n)}else{location.replace("#"+n);!k&&d()}}function h(){function n(){i=a();w=y?i:e(B.href,
"?");s=false;u=null}var p=document.createElement("iframe"),r=f.config.dojoBlankHtmlUrl||f.moduleUrl("dojo","resources/blank.html");f.config.useXDomain&&!f.config.dojoBlankHtmlUrl&&console.warn("dojo.hash: When using cross-domain Dojo builds, please save dojo/resources/blank.html to your domain and set djConfig.dojoBlankHtmlUrl to the path on your domain to blank.html");p.id="dojo-hash-iframe";p.src=r+"?"+a();p.style.display="none";document.body.appendChild(p);this.iframe=f.global["dojo-hash-iframe"];
var w,s,u,t,y,B=this.iframe.location;this.isTransitioning=function(){return s};this.pollLocation=function(){if(!y)try{var D=e(B.href,"?");if(document.title!=t)t=this.iframe.document.title=document.title}catch(l){y=true;console.error("dojo.hash: Error adding history entry. Server unreachable.")}var o=a();if(s&&i===o)if(y||D===u){n();c()}else{setTimeout(f.hitch(this,this.pollLocation),0);return}else if(!(i===o&&(y||w===D)))if(i!==o){i=o;s=true;u=o;p.src=r+"?"+u;y=false;setTimeout(f.hitch(this,this.pollLocation),
0);return}else if(!y){location.href="#"+B.search.substring(1);n();c()}setTimeout(f.hitch(this,this.pollLocation),m)};n();setTimeout(f.hitch(this,this.pollLocation),m)}f.hash=function(n,p){if(!arguments.length)return a();if(n.charAt(0)=="#")n=n.substring(1);if(p)g(n);else location.href="#"+n;return n};var i,j,k,m=f.config.hashPollFrequency||100;f.addOnLoad(function(){if("onhashchange"in f.global&&(!f.isIE||f.isIE>=8&&document.compatMode!="BackCompat"))k=f.connect(f.global,"onhashchange",c);else if(document.addEventListener){i=
a();setInterval(d,m)}else if(document.attachEvent)j=new h})})();return f.hash});
(function(){var f=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"],e=/^\s*<\?xml(\s)+version=[\'\"](\d)*.(\d)*[\'\"](\s)*\?>/im,a=/<body[^>]*>\s*([\s\S]+)\s*<\/body>/im,c=[];define("text",["require","exports","module"],function(){var d,g,h;if(typeof window!=="undefined"&&window.navigator&&window.document)g=function(i,j){var k=d.createXhr();k.open("GET",i,true);k.onreadystatechange=function(){k.readyState===4&&j(k.responseText)};k.send(null)};else if(typeof process!=="undefined"&&process.versions&&
process.versions.node){h=require.nodeRequire("fs");g=function(i,j){j(h.readFileSync(i,"utf8"))}}else if(typeof Packages!=="undefined")g=function(i,j){var k=new java.io.File(i);i=java.lang.System.getProperty("line.separator");k=new java.io.BufferedReader(new java.io.InputStreamReader(new java.io.FileInputStream(k),"utf-8"));var m,n,p="";try{m=new java.lang.StringBuffer;if((n=k.readLine())&&n.length()&&n.charAt(0)===65279)n=n.substring(1);for(m.append(n);(n=k.readLine())!==null;){m.append(i);m.append(n)}p=
String(m.toString())}finally{k.close()}j(p)};return d={version:"0.24.0",strip:function(i){if(i){i=i.replace(e,"");var j=i.match(a);if(j)i=j[1]}else i="";return i},jsEscape:function(i){return i.replace(/(['\\])/g,"\\$1").replace(/[\f]/g,"\\f").replace(/[\b]/g,"\\b").replace(/[\n]/g,"\\n").replace(/[\t]/g,"\\t").replace(/[\r]/g,"\\r")},createXhr:function(){var i,j,k;if(typeof XMLHttpRequest!=="undefined")return new XMLHttpRequest;else for(j=0;j<3;j++){k=f[j];try{i=new ActiveXObject(k)}catch(m){}if(i){f=
[k];break}}if(!i)throw new Error("require.getXhr(): XMLHttpRequest not available");return i},get:g,load:function(i,j,k,m){var n=false,p=i.indexOf("."),r=i.substring(0,p),w=i.substring(p+1,i.length);p=w.indexOf("!");if(p!==-1){n=w.substring(p+1,w.length);n=n==="strip";w=w.substring(0,p)}j=j.nameToUrl(r,"."+w);d.get(j,function(s){s=n?d.strip(s):s;if(m.isBuild&&m.inlineText)c[i]=s;k(s)})},write:function(i,j,k){if(j in c){var m=d.jsEscape(c[j]);k("define('"+i+"!"+j+"', function () { return '"+m+"';});\n")}}}})})();
define("text!dijit/form/templates/ValidationTextBox.html",function(){return'<div class="dijit dijitReset dijitInlineTable dijitLeft"\n\tid="widget_${id}" role="presentation"\n\t><div class=\'dijitReset dijitValidationContainer\'\n\t\t><input class="dijitReset dijitInputField dijitValidationIcon dijitValidationInner" value="&#935; " type="text" tabIndex="-1" readonly="readonly" role="presentation"\n\t/></div\n\t><div class="dijitReset dijitInputField dijitInputContainer"\n\t\t><input class="dijitReset dijitInputInner" dojoAttachPoint=\'textbox,focusNode\' autocomplete="off"\n\t\t\t${!nameAttrSetting} type=\'${type}\'\n\t/></div\n></div>'});
define("dojo/i18n",["require","dojo"],function(f,e){e.getObject("i18n",true,e);e.i18n.getLocalization=e.i18n.getLocalization||function(a,c,d){d=e.i18n.normalizeLocale(d);var g=d.split("-"),h=[a,"nls",c].join(".");if(typeof e.global.require!=="undefined"){var i=f("i18n!"+[a.replace(/\./g,"/"),"nls",c].join("/"));(e._loadedModules[h]=e._loadedModules[h]||{})[g.join("_")]=i.root||i}if(h=e._loadedModules[h]){var j;for(i=g.length;i>0;i--){var k=g.slice(0,i).join("_");if(h[k]){j=h[k];break}}if(!j)j=h.ROOT;
if(j){a=function(){};a.prototype=j;return new a}}throw new Error("Bundle not found: "+c+" in "+a+" , locale="+d);};e.i18n.normalizeLocale=function(a){a=a?a.toLowerCase():e.locale;if(a=="root")a="ROOT";return a};e.i18n._requireLocalization=function(a,c,d,g){d=e.i18n.normalizeLocale(d);var h=[a,"nls",c].join("."),i="";if(g){for(var j=g.split(","),k=0;k<j.length;k++)if(d.indexOf(j[k])==0)if(j[k].length>i.length)i=j[k];i||(i="ROOT")}j=g?i:d;var m=e._loadedModules[h];k=null;if(m){if(e.config.localizationComplete&&
m._built)return;k=j.replace(/-/g,"_");k=e._loadedModules[h+"."+k]}if(!k){m=e.provide(h);var n=e._getModuleSymbols(a).concat("nls").join("/"),p;e.i18n._searchLocalePath(j,g,function(r){var w=r.replace(/-/g,"_"),s=h+"."+w,u=false;if(e._loadedModules[s])u=true;else{e.provide(s);s=[n];r!="ROOT"&&s.push(r);s.push(c);r=s.join("/")+".js";u=e._loadPath(r,null,function(t){t=t.root||t;var y=function(){};y.prototype=p;m[w]=new y;for(var B in t)m[w][B]=t[B]})}if(u&&m[w])p=m[w];else m[w]=p;if(g)return true})}if(g&&
d!=i)m[d.replace(/-/g,"_")]=m[i.replace(/-/g,"_")]};(function(){var a=e.config.extraLocale;if(a){if(!a instanceof Array)a=[a];var c=e.i18n._requireLocalization;e.i18n._requireLocalization=function(d,g,h,i){c(d,g,h,i);if(!h)for(h=0;h<a.length;h++)c(d,g,a[h],i)}}})();e.i18n._searchLocalePath=function(a,c,d){a=e.i18n.normalizeLocale(a);var g=a.split("-");a=[];for(var h=g.length;h>0;h--)a.push(g.slice(0,h).join("-"));a.push(false);c&&a.reverse();for(c=a.length-1;c>=0;c--)if(d(a[c]||"ROOT"))break};e.i18n._preloadLocalizations=
function(a,c){function d(i){i=e.i18n.normalizeLocale(i);e.i18n._searchLocalePath(i,true,function(j){for(var k=0;k<c.length;k++)if(c[k]==j){e.require(a+"_"+j);return true}return false})}d();for(var g=e.config.extraLocale||[],h=0;h<g.length;h++)d(g[h])};return e.i18n});define("text!dijit/form/templates/TextBox.html",function(){return'<div class="dijit dijitReset dijitInline dijitLeft" id="widget_${id}" role="presentation"\n\t><div class="dijitReset dijitInputField dijitInputContainer"\n\t\t><input class="dijitReset dijitInputInner" dojoAttachPoint=\'textbox,focusNode\' autocomplete="off"\n\t\t\t${!nameAttrSetting} type=\'${type}\'\n\t/></div\n></div>'});
define("dojo/window",["dojo"],function(f){f.getObject("window",true,f);f.window.getBox=function(){var e=f.doc.compatMode=="BackCompat"?f.body():f.doc.documentElement,a=f._docScroll();return{w:e.clientWidth,h:e.clientHeight,l:a.x,t:a.y}};f.window.get=function(e){if(f.isIE&&window!==document.parentWindow){e.parentWindow.execScript("document._parentWindow = window;","Javascript");var a=e._parentWindow;e._parentWindow=null;return a}return e.parentWindow||e.defaultView};f.window.scrollIntoView=function(e,
a){try{e=f.byId(e);var c=e.ownerDocument||f.doc,d=c.body||f.body(),g=c.documentElement||d.parentNode,h=f.isIE,i=f.isWebKit;if((!(f.isMoz||h||i||f.isOpera)||e==d||e==g)&&typeof e.scrollIntoView!="undefined")e.scrollIntoView(false);else{var j=c.compatMode=="BackCompat",k=h>=9&&e.ownerDocument.parentWindow.frameElement?g.clientHeight>0&&g.clientWidth>0&&(d.clientHeight==0||d.clientWidth==0||d.clientHeight>g.clientHeight||d.clientWidth>g.clientWidth)?g:d:j?d:g;c=i?d:k;var m=k.clientWidth,n=k.clientHeight,
p=!f._isBodyLtr(),r=a||f.position(e),w=e.parentNode;a=function(z){return h<=6||h&&j?false:f.style(z,"position").toLowerCase()=="fixed"};if(!a(e))for(;w;){if(w==d)w=c;var s=f.position(w),u=a(w);if(w==c){s.w=m;s.h=n;if(c==g&&h&&p)s.x+=c.offsetWidth-s.w;if(s.x<0||!h)s.x=0;if(s.y<0||!h)s.y=0}else{var t=f._getPadBorderExtents(w);s.w-=t.w;s.h-=t.h;s.x+=t.l;s.y+=t.t;var y=w.clientWidth,B=s.w-y;if(y>0&&B>0){s.w=y;s.x+=p&&(h||w.clientLeft>t.l)?B:0}y=w.clientHeight;B=s.h-y;if(y>0&&B>0)s.h=y}if(u){if(s.y<0){s.h+=
s.y;s.y=0}if(s.x<0){s.w+=s.x;s.x=0}if(s.y+s.h>n)s.h=n-s.y;if(s.x+s.w>m)s.w=m-s.x}var D=r.x-s.x,l=r.y-Math.max(s.y,0),o=D+r.w-s.w,q=l+r.h-s.h;if(o*D>0){var v=Math[D<0?"max":"min"](D,o);if(p&&(h==8&&!j||h>=9))v=-v;r.x+=w.scrollLeft;w.scrollLeft+=v;r.x-=w.scrollLeft}if(q*l>0){r.y+=w.scrollTop;w.scrollTop+=Math[l<0?"max":"min"](l,q);r.y-=w.scrollTop}w=w!=c&&!u&&w.parentNode}}}catch(x){console.error("scrollIntoView: "+x);e.scrollIntoView(false)}};return f.window});
define("dijit/_base/manager",["dojo","dijit"],function(f,e){f.declare("dijit.WidgetSet",null,{constructor:function(){this._hash={};this.length=0},add:function(a){if(this._hash[a.id])throw new Error("Tried to register widget with id=="+a.id+" but that id is already registered");this._hash[a.id]=a;this.length++},remove:function(a){if(this._hash[a]){delete this._hash[a];this.length--}},forEach:function(a,c){c=c||f.global;var d=0,g;for(g in this._hash)a.call(c,this._hash[g],d++,this._hash);return this},
filter:function(a,c){c=c||f.global;var d=new e.WidgetSet,g=0,h;for(h in this._hash){var i=this._hash[h];a.call(c,i,g++,this._hash)&&d.add(i)}return d},byId:function(a){return this._hash[a]},byClass:function(a){var c=new e.WidgetSet,d,g;for(d in this._hash){g=this._hash[d];g.declaredClass==a&&c.add(g)}return c},toArray:function(){var a=[];for(var c in this._hash)a.push(this._hash[c]);return a},map:function(a,c){return f.map(this.toArray(),a,c)},every:function(a,c){c=c||f.global;var d=0,g;for(g in this._hash)if(!a.call(c,
this._hash[g],d++,this._hash))return false;return true},some:function(a,c){c=c||f.global;var d=0,g;for(g in this._hash)if(a.call(c,this._hash[g],d++,this._hash))return true;return false}});(function(){e.registry=new e.WidgetSet;var a=e.registry._hash,c=f.attr,d=f.hasAttr,g=f.style;e.byId=function(k){return typeof k=="string"?a[k]:k};var h={};e.getUniqueId=function(k){var m;do m=k+"_"+(k in h?++h[k]:(h[k]=0));while(a[m]);return e._scopeName=="dijit"?m:e._scopeName+"_"+m};e.findWidgets=function(k){function m(p){for(p=
p.firstChild;p;p=p.nextSibling)if(p.nodeType==1){var r=p.getAttribute("widgetId");if(r)(r=a[r])&&n.push(r);else m(p)}}var n=[];m(k);return n};e._destroyAll=function(){e._curFocus=null;e._prevFocus=null;e._activeStack=[];f.forEach(e.findWidgets(f.body()),function(k){if(!k._destroyed)if(k.destroyRecursive)k.destroyRecursive();else k.destroy&&k.destroy()})};f.isIE&&f.addOnWindowUnload(function(){e._destroyAll()});e.byNode=function(k){return a[k.getAttribute("widgetId")]};e.getEnclosingWidget=function(k){for(;k;){var m=
k.getAttribute&&k.getAttribute("widgetId");if(m)return a[m];k=k.parentNode}return null};var i=e._isElementShown=function(k){var m=g(k);return m.visibility!="hidden"&&m.visibility!="collapsed"&&m.display!="none"&&c(k,"type")!="hidden"};e.hasDefaultTabStop=function(k){switch(k.nodeName.toLowerCase()){case "a":return d(k,"href");case "area":case "button":case "input":case "object":case "select":case "textarea":return true;case "iframe":var m;try{var n=k.contentDocument;if("designMode"in n&&n.designMode==
"on")return true;m=n.body}catch(p){try{m=k.contentWindow.document.body}catch(r){return false}}return m.contentEditable=="true"||m.firstChild&&m.firstChild.contentEditable=="true";default:return k.contentEditable=="true"}};var j=e.isTabNavigable=function(k){return c(k,"disabled")?false:d(k,"tabIndex")?c(k,"tabIndex")>=0:e.hasDefaultTabStop(k)};e._getTabNavigable=function(k){function m(D){return D&&D.tagName.toLowerCase()=="input"&&D.type&&D.type.toLowerCase()=="radio"&&D.name&&D.name.toLowerCase()}
function n(D){return y[m(D)]||D}var p,r,w,s,u,t,y={},B=function(D){f.query("> *",D).forEach(function(l){if(!(f.isIE&&l.scopeName!=="HTML"||!i(l))){if(j(l)){var o=c(l,"tabIndex");if(!d(l,"tabIndex")||o==0){p||(p=l);r=l}else if(o>0){if(!w||o<s){s=o;w=l}if(!u||o>=t){t=o;u=l}}o=m(l);if(f.attr(l,"checked")&&o)y[o]=l}l.nodeName.toUpperCase()!="SELECT"&&B(l)}})};i(k)&&B(k);return{first:n(p),last:n(r),lowest:n(w),highest:n(u)}};e.getFirstInTabbingOrder=function(k){k=e._getTabNavigable(f.byId(k));return k.lowest?
k.lowest:k.first};e.getLastInTabbingOrder=function(k){k=e._getTabNavigable(f.byId(k));return k.last?k.last:k.highest};e.defaultDuration=f.config.defaultDuration||200})();return e});
define("dojo/Stateful",["dojo"],function(f){f.declare("dojo.Stateful",null,{postscript:function(e){e&&f.mixin(this,e)},get:function(e){return this[e]},set:function(e,a){if(typeof e==="object"){for(var c in e)this.set(c,e[c]);return this}c=this[e];this[e]=a;this._watchCallbacks&&this._watchCallbacks(e,c,a);return this},watch:function(e,a){var c=this._watchCallbacks;if(!c){var d=this;c=this._watchCallbacks=function(h,i,j,k){var m=function(n){if(n){n=n.slice();for(var p=0,r=n.length;p<r;p++)try{n[p].call(d,
h,i,j)}catch(w){console.error(w)}}};m(c["_"+h]);k||m(c["*"])}}if(!a&&typeof e==="function"){a=e;e="*"}else e="_"+e;var g=c[e];if(typeof g!=="object")g=c[e]=[];g.push(a);return{unwatch:function(){g.splice(f.indexOf(g,a),1)}}}});return f.Stateful});
define("dijit/_WidgetBase",["dojo","dijit","dijit/_base/manager","dojo/Stateful"],function(f,e){(function(){f.declare("dijit._WidgetBase",f.Stateful,{id:"",lang:"",dir:"","class":"",style:"",title:"",tooltip:"",baseClass:"",srcNodeRef:null,domNode:null,containerNode:null,attributeMap:{id:"",dir:"",lang:"","class":"",style:"",title:""},_blankGif:(f.config.blankGif||f.moduleUrl("dojo","resources/blank.gif")).toString(),postscript:function(a,c){this.create(a,c)},create:function(a,c){this.srcNodeRef=
f.byId(c);this._connects=[];this._subscribes=[];if(this.srcNodeRef&&typeof this.srcNodeRef.id=="string")this.id=this.srcNodeRef.id;if(a){this.params=a;f._mixin(this,a)}this.postMixInProperties();if(!this.id)this.id=e.getUniqueId(this.declaredClass.replace(/\./g,"_"));e.registry.add(this);this.buildRendering();if(this.domNode){this._applyAttributes();(a=this.srcNodeRef)&&a.parentNode&&this.domNode!==a&&a.parentNode.replaceChild(this.domNode,a)}this.domNode&&this.domNode.setAttribute("widgetId",this.id);
this.postCreate();this.srcNodeRef&&!this.srcNodeRef.parentNode&&delete this.srcNodeRef;this._created=true},_applyAttributes:function(){var a=function(d,g){if(g.params&&d in g.params||g[d])g.set(d,g[d])};for(var c in this.attributeMap)a(c,this);f.forEach(this._getSetterAttributes(),function(d){d in this.attributeMap||a(d,this)},this)},_getSetterAttributes:function(){var a=this.constructor;if(!a._setterAttrs){var c=a._setterAttrs=[],d,g=a.prototype;for(var h in g)if(f.isFunction(g[h])&&(d=h.match(/^_set([a-zA-Z]*)Attr$/))&&
d[1])c.push(d[1].charAt(0).toLowerCase()+d[1].substr(1))}return a._setterAttrs},postMixInProperties:function(){},buildRendering:function(){if(!this.domNode)this.domNode=this.srcNodeRef||f.create("div");if(this.baseClass){var a=this.baseClass.split(" ");this.isLeftToRight()||(a=a.concat(f.map(a,function(c){return c+"Rtl"})));f.addClass(this.domNode,a)}},postCreate:function(){},startup:function(){this._started=true},destroyRecursive:function(a){this._beingDestroyed=true;this.destroyDescendants(a);this.destroy(a)},
destroy:function(a){this._beingDestroyed=true;this.uninitialize();var c=f.forEach,d=f.unsubscribe;c(this._connects,function(g){c(g,f.disconnect)});c(this._subscribes,function(g){d(g)});c(this._supportingWidgets||[],function(g){if(g.destroyRecursive)g.destroyRecursive();else g.destroy&&g.destroy()});this.destroyRendering(a);e.registry.remove(this.id);this._destroyed=true},destroyRendering:function(a){if(this.bgIframe){this.bgIframe.destroy(a);delete this.bgIframe}if(this.domNode){a?f.removeAttr(this.domNode,
"widgetId"):f.destroy(this.domNode);delete this.domNode}if(this.srcNodeRef){a||f.destroy(this.srcNodeRef);delete this.srcNodeRef}},destroyDescendants:function(a){f.forEach(this.getChildren(),function(c){c.destroyRecursive&&c.destroyRecursive(a)})},uninitialize:function(){return false},_setClassAttr:function(a){f.replaceClass(this[this.attributeMap["class"]||"domNode"],a,this["class"]);this._set("class",a)},_setStyleAttr:function(a){var c=this[this.attributeMap.style||"domNode"];if(f.isObject(a))f.style(c,
a);else if(c.style.cssText)c.style.cssText+="; "+a;else c.style.cssText=a;this._set("style",a)},_attrToDom:function(a,c){var d=this.attributeMap[a];f.forEach(f.isArray(d)?d:[d],function(g){var h=this[g.node||g||"domNode"];switch(g.type||"attribute"){case "attribute":if(f.isFunction(c))c=f.hitch(this,c);g=g.attribute?g.attribute:/^on[A-Z][a-zA-Z]*$/.test(a)?a.toLowerCase():a;f.attr(h,g,c);break;case "innerText":h.innerHTML="";h.appendChild(f.doc.createTextNode(c));break;case "innerHTML":h.innerHTML=
c;break;case "class":f.replaceClass(h,c,this[a]);break}},this)},get:function(a){var c=this._getAttrNames(a);return this[c.g]?this[c.g]():this[a]},set:function(a,c){if(typeof a==="object"){for(var d in a)this.set(d,a[d]);return this}d=this._getAttrNames(a);if(this[d.s])var g=this[d.s].apply(this,Array.prototype.slice.call(arguments,1));else{a in this.attributeMap&&this._attrToDom(a,c);this._set(a,c)}return g||this},_attrPairNames:{},_getAttrNames:function(a){var c=this._attrPairNames;if(c[a])return c[a];
var d=a.charAt(0).toUpperCase()+a.substr(1);return c[a]={n:a+"Node",s:"_set"+d+"Attr",g:"_get"+d+"Attr"}},_set:function(a,c){var d=this[a];this[a]=c;this._watchCallbacks&&this._created&&c!==d&&this._watchCallbacks(a,d,c)},toString:function(){return"[Widget "+this.declaredClass+", "+(this.id||"NO ID")+"]"},getDescendants:function(){return this.containerNode?f.query("[widgetId]",this.containerNode).map(e.byNode):[]},getChildren:function(){return this.containerNode?e.findWidgets(this.containerNode):
[]},connect:function(a,c,d){a=[f._connect(a,c,this,d)];this._connects.push(a);return a},disconnect:function(a){for(var c=0;c<this._connects.length;c++)if(this._connects[c]==a){f.forEach(a,f.disconnect);this._connects.splice(c,1);return}},subscribe:function(a,c){a=f.subscribe(a,this,c);this._subscribes.push(a);return a},unsubscribe:function(a){for(var c=0;c<this._subscribes.length;c++)if(this._subscribes[c]==a){f.unsubscribe(a);this._subscribes.splice(c,1);return}},isLeftToRight:function(){return this.dir?
this.dir=="ltr":f._isBodyLtr()},placeAt:function(a,c){a.declaredClass&&a.addChild?a.addChild(this,c):f.place(this.domNode,a,c);return this}})})();return e._WidgetBase});
define("dijit/_base/focus",["dojo","dijit","dojo/window","dijit/_base/manager"],function(f,e){f.mixin(e,{_curFocus:null,_prevFocus:null,isCollapsed:function(){return e.getBookmark().isCollapsed},getBookmark:function(){var a,c,d=f.doc.selection,g=e._curFocus;if(f.global.getSelection){if(d=f.global.getSelection())if(d.isCollapsed){if(a=g?g.tagName:""){a=a.toLowerCase();if(a=="textarea"||a=="input"&&(!g.type||g.type.toLowerCase()=="text")){d={start:g.selectionStart,end:g.selectionEnd,node:g,pRange:true};
return{isCollapsed:d.end<=d.start,mark:d}}}a={isCollapsed:true};if(d.rangeCount)a.mark=d.getRangeAt(0).cloneRange()}else{c=d.getRangeAt(0);a={isCollapsed:false,mark:c.cloneRange()}}}else if(d){a=g?g.tagName:"";a=a.toLowerCase();if(g&&a&&(a=="button"||a=="textarea"||a=="input"))if(d.type&&d.type.toLowerCase()=="none")return{isCollapsed:true,mark:null};else{c=d.createRange();return{isCollapsed:c.text&&c.text.length?false:true,mark:{range:c,pRange:true}}}a={};try{c=d.createRange();a.isCollapsed=!(d.type==
"Text"?c.htmlText.length:c.length)}catch(h){a.isCollapsed=true;return a}if(d.type.toUpperCase()=="CONTROL")if(c.length){a.mark=[];d=0;for(g=c.length;d<g;)a.mark.push(c.item(d++))}else{a.isCollapsed=true;a.mark=null}else a.mark=c.getBookmark()}else console.warn("No idea how to store the current selection for this browser!");return a},moveToBookmark:function(a){var c=f.doc;if(a=a.mark)if(f.global.getSelection){var d=f.global.getSelection();if(d&&d.removeAllRanges)if(a.pRange){d=a.node;d.selectionStart=
a.start;d.selectionEnd=a.end}else{d.removeAllRanges();d.addRange(a)}else console.warn("No idea how to restore selection for this browser!")}else if(c.selection&&a){var g;if(a.pRange)g=a.range;else if(f.isArray(a)){g=c.body.createControlRange();f.forEach(a,function(h){g.addElement(h)})}else{g=c.body.createTextRange();g.moveToBookmark(a)}g.select()}},getFocus:function(a,c){a=!e._curFocus||a&&f.isDescendant(e._curFocus,a.domNode)?e._prevFocus:e._curFocus;return{node:a,bookmark:a==e._curFocus&&f.withGlobal(c||
f.global,e.getBookmark),openedForWindow:c}},focus:function(a){if(a){var c="node"in a?a.node:a,d=a.bookmark;a=a.openedForWindow;var g=d?d.isCollapsed:false;if(c){var h=c.tagName.toLowerCase()=="iframe"?c.contentWindow:c;if(h&&h.focus)try{h.focus()}catch(i){}e._onFocusNode(c)}if(d&&f.withGlobal(a||f.global,e.isCollapsed)&&!g){a&&a.focus();try{f.withGlobal(a||f.global,e.moveToBookmark,null,[d])}catch(j){}}}},_activeStack:[],registerIframe:function(a){return e.registerWin(a.contentWindow,a)},unregisterIframe:function(a){e.unregisterWin(a)},
registerWin:function(a,c){var d=function(m){e._justMouseDowned=true;setTimeout(function(){e._justMouseDowned=false},0);f.isIE&&m&&m.srcElement&&m.srcElement.parentNode==null||e._onTouchNode(c||m.target||m.srcElement,"mouse")},g=f.isIE?a.document.documentElement:a.document;if(g)if(f.isIE){a.document.body.attachEvent("onmousedown",d);var h=function(m){m.srcElement.tagName.toLowerCase()!="#document"&&e.isTabNavigable(m.srcElement)?e._onFocusNode(c||m.srcElement):e._onTouchNode(c||m.srcElement)};g.attachEvent("onactivate",
h);var i=function(m){e._onBlurNode(c||m.srcElement)};g.attachEvent("ondeactivate",i);return function(){a.document.detachEvent("onmousedown",d);g.detachEvent("onactivate",h);g.detachEvent("ondeactivate",i);g=null}}else{g.body.addEventListener("mousedown",d,true);var j=function(m){e._onFocusNode(c||m.target)};g.addEventListener("focus",j,true);var k=function(m){e._onBlurNode(c||m.target)};g.addEventListener("blur",k,true);return function(){g.body.removeEventListener("mousedown",d,true);g.removeEventListener("focus",
j,true);g.removeEventListener("blur",k,true);g=null}}},unregisterWin:function(a){a&&a()},_onBlurNode:function(){e._prevFocus=e._curFocus;e._curFocus=null;if(!e._justMouseDowned){e._clearActiveWidgetsTimer&&clearTimeout(e._clearActiveWidgetsTimer);e._clearActiveWidgetsTimer=setTimeout(function(){delete e._clearActiveWidgetsTimer;e._setStack([]);e._prevFocus=null},100)}},_onTouchNode:function(a,c){if(e._clearActiveWidgetsTimer){clearTimeout(e._clearActiveWidgetsTimer);delete e._clearActiveWidgetsTimer}var d=
[];try{for(;a;){var g=f.attr(a,"dijitPopupParent");if(g)a=e.byId(g).domNode;else if(a.tagName&&a.tagName.toLowerCase()=="body"){if(a===f.body())break;a=f.window.get(a.ownerDocument).frameElement}else{var h=a.getAttribute&&a.getAttribute("widgetId"),i=h&&e.byId(h);i&&!(c=="mouse"&&i.get("disabled"))&&d.unshift(h);a=a.parentNode}}}catch(j){}e._setStack(d,c)},_onFocusNode:function(a){if(a)if(a.nodeType!=9){e._onTouchNode(a);if(a!=e._curFocus){if(e._curFocus)e._prevFocus=e._curFocus;e._curFocus=a;f.publish("focusNode",
[a])}}},_setStack:function(a,c){var d=e._activeStack;e._activeStack=a;for(var g=0;g<Math.min(d.length,a.length);g++)if(d[g]!=a[g])break;for(var h,i=d.length-1;i>=g;i--)if(h=e.byId(d[i])){h._focused=false;h.set("focused",false);h._hasBeenBlurred=true;h._onBlur&&h._onBlur(c);f.publish("widgetBlur",[h,c])}for(i=g;i<a.length;i++)if(h=e.byId(a[i])){h._focused=true;h.set("focused",true);h._onFocus&&h._onFocus(c);f.publish("widgetFocus",[h,c])}}});f.addOnLoad(function(){var a=e.registerWin(window);f.isIE&&
f.addOnWindowUnload(function(){e.unregisterWin(a);a=null})});return e});
define("dojo/AdapterRegistry",["dojo"],function(f){f.AdapterRegistry=function(e){this.pairs=[];this.returnWrappers=e||false};f.extend(f.AdapterRegistry,{register:function(e,a,c,d,g){this.pairs[g?"unshift":"push"]([e,a,c,d])},match:function(){for(var e=0;e<this.pairs.length;e++){var a=this.pairs[e];if(a[1].apply(this,arguments))return a[3]||this.returnWrappers?a[2]:a[2].apply(this,arguments)}throw new Error("No match found");},unregister:function(e){for(var a=0;a<this.pairs.length;a++)if(this.pairs[a][0]==
e){this.pairs.splice(a,1);return true}return false}});return f.AdapterRegistry});
define("dijit/_base/place",["dojo","dijit","dojo/window","dojo/AdapterRegistry"],function(f,e){e.getViewport=function(){return f.window.getBox()};e.placeOnScreen=function(a,c,d,g){d=f.map(d,function(h){var i={corner:h,pos:{x:c.x,y:c.y}};if(g){i.pos.x+=h.charAt(1)=="L"?g.x:-g.x;i.pos.y+=h.charAt(0)=="T"?g.y:-g.y}return i});return e._place(a,d)};e._place=function(a,c,d,g){var h=f.window.getBox();if(!a.parentNode||String(a.parentNode.tagName).toLowerCase()!="body")f.body().appendChild(a);var i=null;
f.some(c,function(k){var m=k.corner,n=k.pos,p=0,r={w:m.charAt(1)=="L"?h.l+h.w-n.x:n.x-h.l,h:m.charAt(1)=="T"?h.t+h.h-n.y:n.y-h.t};if(d){p=d(a,k.aroundCorner,m,r,g);p=typeof p=="undefined"?0:p}var w=a.style,s=w.display,u=w.visibility;w.visibility="hidden";w.display="";var t=f.marginBox(a);w.display=s;w.visibility=u;w=Math.max(h.l,m.charAt(1)=="L"?n.x:n.x-t.w);s=Math.max(h.t,m.charAt(0)=="T"?n.y:n.y-t.h);u=Math.min(h.l+h.w,m.charAt(1)=="L"?w+t.w:n.x);n=Math.min(h.t+h.h,m.charAt(0)=="T"?s+t.h:n.y);u=
u-w;n=n-s;p+=t.w-u+(t.h-n);if(i==null||p<i.overflow)i={corner:m,aroundCorner:k.aroundCorner,x:w,y:s,w:u,h:n,overflow:p,spaceAvailable:r};return!p});i.overflow&&d&&d(a,i.aroundCorner,i.corner,i.spaceAvailable,g);c=f._isBodyLtr();var j=a.style;j.top=i.y+"px";j[c?"left":"right"]=(c?i.x:h.w-i.x-i.w)+"px";return i};e.placeOnScreenAroundNode=function(a,c,d,g){c=f.byId(c);c=f.position(c,true);return e._placeOnScreenAroundRect(a,c.x,c.y,c.w,c.h,d,g)};e.placeOnScreenAroundRectangle=function(a,c,d,g){return e._placeOnScreenAroundRect(a,
c.x,c.y,c.width,c.height,d,g)};e._placeOnScreenAroundRect=function(a,c,d,g,h,i,j){var k=[];for(var m in i)k.push({aroundCorner:m,corner:i[m],pos:{x:c+(m.charAt(1)=="L"?0:g),y:d+(m.charAt(0)=="T"?0:h)}});return e._place(a,k,j,{w:g,h:h})};e.placementRegistry=new f.AdapterRegistry;e.placementRegistry.register("node",function(a,c){return typeof c=="object"&&typeof c.offsetWidth!="undefined"&&typeof c.offsetHeight!="undefined"},e.placeOnScreenAroundNode);e.placementRegistry.register("rect",function(a,
c){return typeof c=="object"&&"x"in c&&"y"in c&&"width"in c&&"height"in c},e.placeOnScreenAroundRectangle);e.placeOnScreenAroundElement=function(){return e.placementRegistry.match.apply(e.placementRegistry,arguments)};e.getPopupAroundAlignment=function(a,c){var d={};f.forEach(a,function(g){switch(g){case "after":d[c?"BR":"BL"]=c?"BL":"BR";break;case "before":d[c?"BL":"BR"]=c?"BR":"BL";break;case "below-alt":c=!c;case "below":d[c?"BL":"BR"]=c?"TL":"TR";d[c?"BR":"BL"]=c?"TR":"TL";break;case "above-alt":c=
!c;case "above":default:d[c?"TL":"TR"]=c?"BL":"BR";d[c?"TR":"TL"]=c?"BR":"BL";break}});return d};return e});define("dijit/_base/window",["dojo","dijit","dojo/window"],function(f,e){e.getDocumentWindow=function(a){return f.window.get(a)};return e});
define("dijit/_base/popup",["dojo","dijit","dijit/_base/focus","dijit/_base/place","dijit/_base/window"],function(f,e){e.popup={_stack:[],_beginZIndex:1E3,_idGen:1,_createWrapper:function(a){var c=a.declaredClass?a._popupWrapper:a.parentNode&&f.hasClass(a.parentNode,"dijitPopup"),d=a.domNode||a;if(!c){c=f.create("div",{"class":"dijitPopup",style:{display:"none"},role:"presentation"},f.body());c.appendChild(d);d=d.style;d.display="";d.visibility="";d.position="";d.top="0px";if(a.declaredClass){a._popupWrapper=
c;f.connect(a,"destroy",function(){f.destroy(c);delete a._popupWrapper})}}return c},moveOffScreen:function(a){a=this._createWrapper(a);f.style(a,{visibility:"hidden",top:"-9999px",display:""})},hide:function(a){a=this._createWrapper(a);f.style(a,"display","none")},getTopPopup:function(){for(var a=this._stack,c=a.length-1;c>0&&a[c].parent===a[c-1].widget;c--);return a[c]},open:function(a){for(var c=this._stack,d=a.popup,g=a.orient||((a.parent?a.parent.isLeftToRight():f._isBodyLtr())?{BL:"TL",BR:"TR",
TL:"BL",TR:"BR"}:{BR:"TR",BL:"TL",TR:"BR",TL:"BL"}),h=a.around,i=a.around&&a.around.id?a.around.id+"_dropdown":"popup_"+this._idGen++;c.length&&(!a.parent||!f.isDescendant(a.parent.domNode,c[c.length-1].widget.domNode));)e.popup.close(c[c.length-1].widget);var j=this._createWrapper(d);f.attr(j,{id:i,style:{zIndex:this._beginZIndex+c.length},"class":"dijitPopup "+(d.baseClass||d["class"]||"").split(" ")[0]+"Popup",dijitPopupParent:a.parent?a.parent.id:""});if(f.isIE||f.isMoz)if(!d.bgIframe)d.bgIframe=
new e.BackgroundIframe(j);g=h?e.placeOnScreenAroundElement(j,h,g,d.orient?f.hitch(d,"orient"):null):e.placeOnScreen(j,a,g=="R"?["TR","BR","TL","BL"]:["TL","BL","TR","BR"],a.padding);j.style.display="";j.style.visibility="visible";d.domNode.style.visibility="visible";h=[];h.push(f.connect(j,"onkeypress",this,function(k){if(k.charOrCode==f.keys.ESCAPE&&a.onCancel){f.stopEvent(k);a.onCancel()}else if(k.charOrCode===f.keys.TAB){f.stopEvent(k);(k=this.getTopPopup())&&k.onCancel&&k.onCancel()}}));d.onCancel&&
h.push(f.connect(d,"onCancel",a.onCancel));h.push(f.connect(d,d.onExecute?"onExecute":"onChange",this,function(){var k=this.getTopPopup();k&&k.onExecute&&k.onExecute()}));c.push({widget:d,parent:a.parent,onExecute:a.onExecute,onCancel:a.onCancel,onClose:a.onClose,handlers:h});d.onOpen&&d.onOpen(g);return g},close:function(a){for(var c=this._stack;a&&f.some(c,function(i){return i.widget==a})||!a&&c.length;){var d=c.pop(),g=d.widget,h=d.onClose;g.onClose&&g.onClose();f.forEach(d.handlers,f.disconnect);
g&&g.domNode&&this.hide(g);h&&h()}}};e._frames=new (function(){var a=[];this.pop=function(){var c;if(a.length){c=a.pop();c.style.display=""}else{if(f.isIE<9){c="<iframe src='"+(f.config.dojoBlankHtmlUrl||f.moduleUrl("dojo","resources/blank.html")+""||'javascript:""')+"' style='position: absolute; left: 0px; top: 0px;z-index: -1; filter:Alpha(Opacity=\"0\");'>";c=f.doc.createElement(c)}else{c=f.create("iframe");c.src='javascript:""';c.className="dijitBackgroundIframe";f.style(c,"opacity",0.1)}c.tabIndex=
-1;e.setWaiRole(c,"presentation")}return c};this.push=function(c){c.style.display="none";a.push(c)}});e.BackgroundIframe=function(a){if(!a.id)throw new Error("no id");if(f.isIE||f.isMoz){var c=this.iframe=e._frames.pop();a.appendChild(c);if(f.isIE<7||f.isQuirks){this.resize(a);this._conn=f.connect(a,"onresize",this,function(){this.resize(a)})}else f.style(c,{width:"100%",height:"100%"})}};f.extend(e.BackgroundIframe,{resize:function(a){this.iframe&&f.style(this.iframe,{width:a.offsetWidth+"px",height:a.offsetHeight+
"px"})},destroy:function(){if(this._conn){f.disconnect(this._conn);this._conn=null}if(this.iframe){e._frames.push(this.iframe);delete this.iframe}}});return e.popup});define("dijit/_base/scroll",["dojo","dijit","dojo/window"],function(f,e){e.scrollIntoView=function(a,c){f.window.scrollIntoView(a,c)};return e.scrollIntoView});
define("dojo/uacss",["dojo"],function(f){(function(){var e=f.doc.documentElement,a=f.isIE,c=f.isOpera,d=Math.floor,g=f.isFF,h=f.boxModel.replace(/-/,"");a={dj_ie:a,dj_ie6:d(a)==6,dj_ie7:d(a)==7,dj_ie8:d(a)==8,dj_ie9:d(a)==9,dj_quirks:f.isQuirks,dj_iequirks:a&&f.isQuirks,dj_opera:c,dj_khtml:f.isKhtml,dj_webkit:f.isWebKit,dj_safari:f.isSafari,dj_chrome:f.isChrome,dj_gecko:f.isMozilla,dj_ff3:d(g)==3};a["dj_"+h]=true;var i="";for(var j in a)if(a[j])i+=j+" ";e.className=f.trim(e.className+" "+i);f._loaders.unshift(function(){if(!f._isBodyLtr()){var k=
"dj_rtl dijitRtl "+i.replace(/ /g,"-rtl ");e.className=f.trim(e.className+" "+k)}})})();return f});define("dijit/_base/sniff",["dojo","dijit","dojo/uacss"],function(f,e){return e});
define("dijit/_base/typematic",["dojo","dijit"],function(f,e){e.typematic={_fireEventAndReload:function(){this._timer=null;this._callback(++this._count,this._node,this._evt);this._currentTimeout=Math.max(this._currentTimeout<0?this._initialDelay:this._subsequentDelay>1?this._subsequentDelay:Math.round(this._currentTimeout*this._subsequentDelay),this._minDelay);this._timer=setTimeout(f.hitch(this,"_fireEventAndReload"),this._currentTimeout)},trigger:function(a,c,d,g,h,i,j,k){if(h!=this._obj){this.stop();
this._initialDelay=j||500;this._subsequentDelay=i||0.9;this._minDelay=k||10;this._obj=h;this._evt=a;this._node=d;this._count=this._currentTimeout=-1;this._callback=f.hitch(c,g);this._fireEventAndReload();this._evt=f.mixin({faux:true},a)}},stop:function(){if(this._timer){clearTimeout(this._timer);this._timer=null}if(this._obj){this._callback(-1,this._node,this._evt);this._obj=null}},addKeyListener:function(a,c,d,g,h,i,j){if(c.keyCode){c.charOrCode=c.keyCode;f.deprecated("keyCode attribute parameter for dijit.typematic.addKeyListener is deprecated. Use charOrCode instead.",
"","2.0")}else if(c.charCode){c.charOrCode=String.fromCharCode(c.charCode);f.deprecated("charCode attribute parameter for dijit.typematic.addKeyListener is deprecated. Use charOrCode instead.","","2.0")}return[f.connect(a,"onkeypress",this,function(k){if(k.charOrCode==c.charOrCode&&(c.ctrlKey===undefined||c.ctrlKey==k.ctrlKey)&&(c.altKey===undefined||c.altKey==k.altKey)&&(c.metaKey===undefined||c.metaKey==(k.metaKey||false))&&(c.shiftKey===undefined||c.shiftKey==k.shiftKey)){f.stopEvent(k);e.typematic.trigger(k,
d,a,g,c,h,i,j)}else e.typematic._obj==c&&e.typematic.stop()}),f.connect(a,"onkeyup",this,function(){e.typematic._obj==c&&e.typematic.stop()})]},addMouseListener:function(a,c,d,g,h,i){var j=f.connect;return[j(a,"mousedown",this,function(k){f.stopEvent(k);e.typematic.trigger(k,c,a,d,a,g,h,i)}),j(a,"mouseup",this,function(k){f.stopEvent(k);e.typematic.stop()}),j(a,"mouseout",this,function(k){f.stopEvent(k);e.typematic.stop()}),j(a,"mousemove",this,function(k){k.preventDefault()}),j(a,"dblclick",this,
function(k){f.stopEvent(k);if(f.isIE){e.typematic.trigger(k,c,a,d,a,g,h,i);setTimeout(f.hitch(this,e.typematic.stop),50)}})]},addListener:function(a,c,d,g,h,i,j,k){return this.addKeyListener(c,d,g,h,i,j,k).concat(this.addMouseListener(a,g,h,i,j,k))}};return e.typematic});
define("dijit/_base/wai",["dojo","dijit"],function(f,e){e.wai={onload:function(){var a=f.create("div",{id:"a11yTestNode",style:{cssText:'border: 1px solid;border-color:red green;position: absolute;height: 5px;top: -999px;background-image: url("'+(f.config.blankGif||f.moduleUrl("dojo","resources/blank.gif"))+'");'}},f.body()),c=f.getComputedStyle(a);if(c){var d=c.backgroundImage;f[c.borderTopColor==c.borderRightColor||d!=null&&(d=="none"||d=="url(invalid-url:)")?"addClass":"removeClass"](f.body(),
"dijit_a11y");if(f.isIE)a.outerHTML="";else f.body().removeChild(a)}}};if(f.isIE||f.isMoz)f._loaders.unshift(e.wai.onload);f.mixin(e,{hasWaiRole:function(a,c){a=this.getWaiRole(a);return c?a.indexOf(c)>-1:a.length>0},getWaiRole:function(a){return f.trim((f.attr(a,"role")||"").replace("wairole:",""))},setWaiRole:function(a,c){f.attr(a,"role",c)},removeWaiRole:function(a,c){var d=f.attr(a,"role");if(d)if(c){c=f.trim((" "+d+" ").replace(" "+c+" "," "));f.attr(a,"role",c)}else a.removeAttribute("role")},
hasWaiState:function(a,c){return a.hasAttribute?a.hasAttribute("aria-"+c):!!a.getAttribute("aria-"+c)},getWaiState:function(a,c){return a.getAttribute("aria-"+c)||""},setWaiState:function(a,c,d){a.setAttribute("aria-"+c,d)},removeWaiState:function(a,c){a.removeAttribute("aria-"+c)}});return e});
define("dijit/_base",["dojo","dijit","dijit/_base/focus","dijit/_base/manager","dijit/_base/place","dijit/_base/popup","dijit/_base/scroll","dijit/_base/sniff","dijit/_base/typematic","dijit/_base/wai","dijit/_base/window"],function(f,e){return e._base});
define("dijit/_Widget",["dojo","dijit","dijit/_WidgetBase","dijit/_base"],function(f,e){f.connect(f,"_connect",function(a,c){a&&f.isFunction(a._onConnect)&&a._onConnect(c)});e._connectOnUseEventHandler=function(){};e._lastKeyDownNode=null;f.isIE?function(){var a=function(c){e._lastKeyDownNode=c.srcElement};f.doc.attachEvent("onkeydown",a);f.addOnWindowUnload(function(){f.doc.detachEvent("onkeydown",a)})}():f.doc.addEventListener("keydown",function(a){e._lastKeyDownNode=a.target},true);(function(){f.declare("dijit._Widget",
e._WidgetBase,{_deferredConnects:{onClick:"",onDblClick:"",onKeyDown:"",onKeyPress:"",onKeyUp:"",onMouseMove:"",onMouseDown:"",onMouseOut:"",onMouseOver:"",onMouseLeave:"",onMouseEnter:"",onMouseUp:""},onClick:e._connectOnUseEventHandler,onDblClick:e._connectOnUseEventHandler,onKeyDown:e._connectOnUseEventHandler,onKeyPress:e._connectOnUseEventHandler,onKeyUp:e._connectOnUseEventHandler,onMouseDown:e._connectOnUseEventHandler,onMouseMove:e._connectOnUseEventHandler,onMouseOut:e._connectOnUseEventHandler,
onMouseOver:e._connectOnUseEventHandler,onMouseLeave:e._connectOnUseEventHandler,onMouseEnter:e._connectOnUseEventHandler,onMouseUp:e._connectOnUseEventHandler,create:function(){this._deferredConnects=f.clone(this._deferredConnects);for(var a in this.attributeMap)delete this._deferredConnects[a];for(a in this._deferredConnects)this[a]!==e._connectOnUseEventHandler&&delete this._deferredConnects[a];this.inherited(arguments);if(this.domNode)for(a in this.params)this._onConnect(a)},_onConnect:function(a){if(a in
this._deferredConnects){this.connect(this[this._deferredConnects[a]||"domNode"],a.toLowerCase(),a);delete this._deferredConnects[a]}},focused:false,isFocusable:function(){return this.focus&&f.style(this.domNode,"display")!="none"},onFocus:function(){},onBlur:function(){},_onFocus:function(){this.onFocus()},_onBlur:function(){this.onBlur()},setAttribute:function(a,c){f.deprecated(this.declaredClass+"::setAttribute(attr, value) is deprecated. Use set() instead.","","2.0");this.set(a,c)},attr:function(a){if(f.config.isDebug){var c=
arguments.callee._ach||(arguments.callee._ach={}),d=(arguments.callee.caller||"unknown caller").toString();if(!c[d]){f.deprecated(this.declaredClass+"::attr() is deprecated. Use get() or set() instead, called from "+d,"","2.0");c[d]=true}}return arguments.length>=2||typeof a==="object"?this.set.apply(this,arguments):this.get(a)},nodesWithKeyClick:["input","button"],connect:function(a,c,d){var g=f._connect,h=this.inherited(arguments,[a,c=="ondijitclick"?"onclick":c,d]);if(c=="ondijitclick")if(f.indexOf(this.nodesWithKeyClick,
a.nodeName.toLowerCase())==-1){var i=f.hitch(this,d);h.push(g(a,"onkeydown",this,function(j){if((j.keyCode==f.keys.ENTER||j.keyCode==f.keys.SPACE)&&!j.ctrlKey&&!j.shiftKey&&!j.altKey&&!j.metaKey){e._lastKeyDownNode=j.target;"openDropDown"in this&&a==this._buttonNode||j.preventDefault()}}),g(a,"onkeyup",this,function(j){if((j.keyCode==f.keys.ENTER||j.keyCode==f.keys.SPACE)&&j.target==e._lastKeyDownNode&&!j.ctrlKey&&!j.shiftKey&&!j.altKey&&!j.metaKey){e._lastKeyDownNode=null;return i(j)}}))}return h},
_onShow:function(){this.onShow()},onShow:function(){},onHide:function(){},onClose:function(){return true}})})();return e._Widget});
define("dojo/string",["dojo"],function(f){f.getObject("string",true,f);f.string.rep=function(e,a){if(a<=0||!e)return"";for(var c=[];;){a&1&&c.push(e);if(!(a>>=1))break;e+=e}return c.join("")};f.string.pad=function(e,a,c,d){c||(c="0");e=String(e);a=f.string.rep(c,Math.ceil((a-e.length)/c.length));return d?e+a:a+e};f.string.substitute=function(e,a,c,d){d=d||f.global;c=c?f.hitch(d,c):function(g){return g};return e.replace(/\$\{([^\s\:\}]+)(?:\:([^\s\:\}]+))?\}/g,function(g,h,i){g=f.getObject(h,false,
a);if(i)g=f.getObject(i,false,d).call(d,g,h);return c(g,h).toString()})};f.string.trim=String.prototype.trim?f.trim:function(e){e=e.replace(/^\s+/,"");for(var a=e.length-1;a>=0;a--)if(/\S/.test(e.charAt(a))){e=e.substring(0,a+1);break}return e};return f.string});
define("dojo/date/stamp",["dojo"],function(f){f.getObject("date.stamp",true,f);f.date.stamp.fromISOString=function(e,a){if(!f.date.stamp._isoRegExp)f.date.stamp._isoRegExp=/^(?:(\d{4})(?:-(\d{2})(?:-(\d{2}))?)?)?(?:T(\d{2}):(\d{2})(?::(\d{2})(.\d+)?)?((?:[+-](\d{2}):(\d{2}))|Z)?)?$/;var c=f.date.stamp._isoRegExp.exec(e);e=null;if(c){c.shift();c[1]&&c[1]--;if(c[6])c[6]*=1E3;if(a){a=new Date(a);f.forEach(f.map(["FullYear","Month","Date","Hours","Minutes","Seconds","Milliseconds"],function(h){return a["get"+
h]()}),function(h,i){c[i]=c[i]||h})}e=new Date(c[0]||1970,c[1]||0,c[2]||1,c[3]||0,c[4]||0,c[5]||0,c[6]||0);if(c[0]<100)e.setFullYear(c[0]||1970);var d=0,g=c[7]&&c[7].charAt(0);if(g!="Z"){d=(c[8]||0)*60+(Number(c[9])||0);if(g!="-")d*=-1}if(g)d-=e.getTimezoneOffset();d&&e.setTime(e.getTime()+d*6E4)}return e};f.date.stamp.toISOString=function(e,a){var c=function(i){return i<10?"0"+i:i};a=a||{};var d=[],g=a.zulu?"getUTC":"get",h="";if(a.selector!="time"){h=e[g+"FullYear"]();h=["0000".substr((h+"").length)+
h,c(e[g+"Month"]()+1),c(e[g+"Date"]())].join("-")}d.push(h);if(a.selector!="date"){h=[c(e[g+"Hours"]()),c(e[g+"Minutes"]()),c(e[g+"Seconds"]())].join(":");g=e[g+"Milliseconds"]();if(a.milliseconds)h+="."+(g<100?"0":"")+c(g);if(a.zulu)h+="Z";else if(a.selector!="time"){e=e.getTimezoneOffset();a=Math.abs(e);h+=(e>0?"-":"+")+c(Math.floor(a/60))+":"+c(a%60)}d.push(h)}return d.join("T")};return f.date.stamp});
define("dojo/parser",["dojo","dojo/date/stamp"],function(f){f.parser=new (function(){function e(j){if(g.isString(j))return"string";if(typeof j=="number")return"number";if(typeof j=="boolean")return"boolean";if(g.isFunction(j))return"function";if(g.isArray(j))return"array";if(j instanceof Date)return"date";if(j instanceof g._Url)return"url";return"object"}function a(j,k){switch(k){case "string":return j;case "number":return j.length?Number(j):NaN;case "boolean":return typeof j=="boolean"?j:j.toLowerCase()!=
"false";case "function":if(g.isFunction(j)){j=j.toString();j=g.trim(j.substring(j.indexOf("{")+1,j.length-1))}try{return j===""||j.search(/[^\w\.]+/i)!=-1?new Function(j):g.getObject(j,false)||new Function(j)}catch(m){return new Function}case "array":return j?j.split(/\s*,\s*/):[];case "date":switch(j){case "":return new Date("");case "now":return new Date;default:return g.date.stamp.fromISOString(j)}case "url":return g.baseUrl+j;default:return g.fromJson(j)}}function c(j,k){for(var m in j)if(m.charAt(0)!=
"_")m in h||(k[m]=e(j[m]));return k}function d(j,k){var m=i[j];if(m){if(!k&&!m.params)m.params=c(m.cls.prototype,{})}else{j=g.getObject(j);m=null;if(!j)return null;k||(m=c(j.prototype,{}));m={cls:j,params:m}}return m}var g=f,h={},i={};g.connect(g,"extend",function(){i={}});this._functionFromScript=function(j,k){var m="",n="";(k=j.getAttribute(k+"args")||j.getAttribute("args"))&&g.forEach(k.split(/\s*,\s*/),function(p,r){m+="var "+p+" = arguments["+r+"]; "});(k=j.getAttribute("with"))&&k.length&&g.forEach(k.split(/\s*,\s*/),
function(p){m+="with("+p+"){";n+="}"});return new Function(m+j.innerHTML+n)};this.instantiate=function(j,k,m){var n=[];k=k||{};m=m||{};var p=(m.scope||g._scopeName)+"Type",r="data-"+(m.scope||g._scopeName)+"-";g.forEach(j,function(w){if(w){var s,u,t,y,B,D;if(w.node){s=w.node;u=w.type;D=w.fastpath;y=(t=w.clsInfo||u&&d(u,D))&&t.cls;B=w.scripts}else{s=w;B=(y=(t=(u=p in k?k[p]:s.getAttribute(p))&&d(u))&&t.cls)&&(y._noScript||y.prototype._noScript)?[]:g.query("> script[type^='dojo/']",s)}if(!t)throw new Error("Could not load class '"+
u);var l={};m.defaults&&g._mixin(l,m.defaults);w.inherited&&g._mixin(l,w.inherited);if(D){if((t=s.getAttribute(r+"props"))&&t.length)try{t=g.fromJson.call(m.propsThis,"{"+t+"}");g._mixin(l,t)}catch(o){throw new Error(o.toString()+" in data-dojo-props='"+t+"'");}if(t=s.getAttribute(r+"attach-point"))l.dojoAttachPoint=t;if(t=s.getAttribute(r+"attach-event"))l.dojoAttachEvent=t;f.mixin(l,k)}else{w=s.attributes;for(var q in t.params){u=q in k?{value:k[q],specified:true}:w.getNamedItem(q);if(!(!u||!u.specified&&
(!f.isIE||q.toLowerCase()!="value"))){u=u.value;switch(q){case "class":u="className"in k?k.className:s.className;break;case "style":u="style"in k?k.style:s.style&&s.style.cssText}var v=t.params[q];l[q]=typeof u=="string"?a(u,v):u}}}var x=[],z=[];g.forEach(B,function(A){s.removeChild(A);var F=A.getAttribute(r+"event")||A.getAttribute("event"),H=A.getAttribute("type");A=g.parser._functionFromScript(A,r);if(F)if(H=="dojo/connect")x.push({event:F,func:A});else l[F]=A;else z.push(A)});var C=(B=y.markupFactory||
y.prototype&&y.prototype.markupFactory)?B(l,s,y):new y(l,s);n.push(C);(y=s.getAttribute(r+"id")||s.getAttribute("jsId"))&&g.setObject(y,C);g.forEach(x,function(A){g.connect(C,A.event,null,A.func)});g.forEach(z,function(A){A.call(C)})}});k._started||g.forEach(n,function(w){if(!m.noStart&&w&&f.isFunction(w.startup)&&!w._started&&(!w.getParent||!w.getParent()))w.startup()});return n};this.parse=function(j,k){function m(s,u){var t=f.clone(s.inherited);f.forEach(["dir","lang"],function(q){var v=s.node.getAttribute(q);
if(v)t[q]=v});for(var y=s.clsInfo&&!s.clsInfo.cls.prototype._noScript?s.scripts:null,B=!s.clsInfo||!s.clsInfo.cls.prototype.stopParser||k&&k.template,D=s.node.firstChild;D;D=D.nextSibling)if(D.nodeType==1){var l,o=B&&D.getAttribute(p+"type");l=o?o:B&&D.getAttribute(n);o=o==l;if(l){l={type:l,fastpath:o,clsInfo:d(l,o),node:D,scripts:[],inherited:t};u.push(l);m(l,u)}else if(y&&D.nodeName.toLowerCase()=="script")(l=D.getAttribute("type"))&&/^dojo\/\w/i.test(l)&&y.push(D);else B&&m({node:D,inherited:t},
u)}}if(!k&&j&&j.rootNode){k=j;j=k.rootNode}else j=j;j=j?f.byId(j):f.body();k=k||{};var n=(k.scope||g._scopeName)+"Type",p="data-"+(k.scope||g._scopeName)+"-",r={};if(k&&k.inherited)for(var w in k.inherited)if(k.inherited[w])r[w]=k.inherited[w];w=[];m({node:j,inherited:r},w);return this.instantiate(w,k&&k.template?{template:true}:null,k)}});(function(){var e=function(){f.config.parseOnLoad&&f.parser.parse()};f.getObject("dijit.wai.onload")===f._loaders[0]?f._loaders.splice(1,0,e):f._loaders.unshift(e)})();
return f.parser});
define("dojo/cache",["dojo"],function(f){var e={};f.cache=function(a,c,d){if(typeof a=="string")var g=f.moduleUrl(a,c);else{g=a;d=c}g=g.toString();var h=d;if(d!=undefined&&!f.isString(d))h="value"in d?d.value:undefined;d=d&&d.sanitize?true:false;if(typeof h=="string")h=e[g]=d?f.cache._sanitize(h):h;else if(h===null)delete e[g];else{if(!(g in e)){h=undefined;if(f.isFunction(require)&&f.isString(a))try{var i=(a?a.replace(/\./g,"/")+"/":"")+c;h=require("text!"+i)}catch(j){}if(typeof h==="undefined")h=
f._getText(g);e[g]=d?f.cache._sanitize(h):h}h=e[g]}return h};f.cache._sanitize=function(a){if(a){a=a.replace(/^\s*<\?xml(\s)+version=[\'\"](\d)*.(\d)*[\'\"](\s)*\?>/im,"");var c=a.match(/<body[^>]*>\s*([\s\S]+)\s*<\/body>/im);if(c)a=c[1]}else a="";return a};return f.cache});
define("dijit/_Templated",["dojo","dijit","dijit/_Widget","dojo/string","dojo/parser","dojo/cache"],function(f,e){f.declare("dijit._Templated",null,{templateString:null,templatePath:null,widgetsInTemplate:false,_skipNodeCache:false,_earlyTemplatedStartup:false,constructor:function(){this._attachPoints=[];this._attachEvents=[]},_stringRepl:function(a){var c=this.declaredClass,d=this;return f.string.substitute(a,this,function(g,h){if(h.charAt(0)=="!")g=f.getObject(h.substr(1),false,d);if(typeof g==
"undefined")throw new Error(c+" template:"+h);if(g==null)return"";return h.charAt(0)=="!"?g:g.toString().replace(/"/g,"&quot;")},this)},buildRendering:function(){var a=e._Templated.getCachedTemplate(this.templatePath,this.templateString,this._skipNodeCache),c;if(f.isString(a)){c=f._toDom(this._stringRepl(a));if(c.nodeType!=1)throw new Error("Invalid template: "+a);}else c=a.cloneNode(true);this.domNode=c;this.inherited(arguments);this._attachTemplateNodes(c);if(this.widgetsInTemplate){a=this._startupWidgets=
f.parser.parse(c,{noStart:!this._earlyTemplatedStartup,template:true,inherited:{dir:this.dir,lang:this.lang},propsThis:this,scope:"dojo"});this._supportingWidgets=e.findWidgets(c);this._attachTemplateNodes(a,function(d,g){return d[g]})}this._fillContent(this.srcNodeRef)},_fillContent:function(a){var c=this.containerNode;if(a&&c)for(;a.hasChildNodes();)c.appendChild(a.firstChild)},_attachTemplateNodes:function(a,c){c=c||function(n,p){return n.getAttribute(p)};for(var d=f.isArray(a)?a:a.all||a.getElementsByTagName("*"),
g=f.isArray(a)?0:-1;g<d.length;g++){var h=g==-1?a:d[g];if(!(this.widgetsInTemplate&&(c(h,"dojoType")||c(h,"data-dojo-type")))){var i=c(h,"dojoAttachPoint")||c(h,"data-dojo-attach-point");if(i)for(var j=i.split(/\s*,\s*/);i=j.shift();){if(f.isArray(this[i]))this[i].push(h);else this[i]=h;this._attachPoints.push(i)}if(i=c(h,"dojoAttachEvent")||c(h,"data-dojo-attach-event")){j=i.split(/\s*,\s*/);for(var k=f.trim;i=j.shift();)if(i){var m=null;if(i.indexOf(":")!=-1){m=i.split(":");i=k(m[0]);m=k(m[1])}else i=
k(i);m||(m=i);this._attachEvents.push(this.connect(h,i,m))}}(i=c(h,"waiRole"))&&e.setWaiRole(h,i);(i=c(h,"waiState"))&&f.forEach(i.split(/\s*,\s*/),function(n){if(n.indexOf("-")!=-1){n=n.split("-");e.setWaiState(h,n[0],n[1])}})}}},startup:function(){f.forEach(this._startupWidgets,function(a){a&&!a._started&&a.startup&&a.startup()});this.inherited(arguments)},destroyRendering:function(){f.forEach(this._attachPoints,function(a){delete this[a]},this);this._attachPoints=[];f.forEach(this._attachEvents,
this.disconnect,this);this._attachEvents=[];this.inherited(arguments)}});e._Templated._templateCache={};e._Templated.getCachedTemplate=function(a,c,d){var g=e._Templated._templateCache,h=c||a,i=g[h];if(i){try{if(!i.ownerDocument||i.ownerDocument==f.doc)return i}catch(j){}f.destroy(i)}c||(c=f.cache(a,{sanitize:true}));c=f.string.trim(c);if(d||c.match(/\$\{([^\}]+)\}/g))return g[h]=c;else{a=f._toDom(c);if(a.nodeType!=1)throw new Error("Invalid template: "+c);return g[h]=a}};f.isIE&&f.addOnWindowUnload(function(){var a=
e._Templated._templateCache;for(var c in a){var d=a[c];typeof d=="object"&&f.destroy(d);delete a[c]}});f.extend(e._Widget,{dojoAttachEvent:"",dojoAttachPoint:"",waiRole:"",waiState:""});return e._Templated});
define("dijit/_CssStateMixin",["dojo","dijit"],function(f,e){f.declare("dijit._CssStateMixin",[],{cssStateNodes:{},hovering:false,active:false,_applyAttributes:function(){this.inherited(arguments);f.forEach(["onmouseenter","onmouseleave","onmousedown"],function(c){this.connect(this.domNode,c,"_cssMouseEvent")},this);f.forEach(["disabled","readOnly","checked","selected","focused","state","hovering","active"],function(c){this.watch(c,f.hitch(this,"_setStateClass"))},this);for(var a in this.cssStateNodes)this._trackMouseState(this[a],
this.cssStateNodes[a]);this._setStateClass()},_cssMouseEvent:function(a){if(!this.disabled)switch(a.type){case "mouseenter":case "mouseover":this._set("hovering",true);this._set("active",this._mouseDown);break;case "mouseleave":case "mouseout":this._set("hovering",false);this._set("active",false);break;case "mousedown":this._set("active",true);this._mouseDown=true;var c=this.connect(f.body(),"onmouseup",function(){this._mouseDown=false;this._set("active",false);this.disconnect(c)});break}},_setStateClass:function(){function a(j){c=
c.concat(f.map(c,function(k){return k+j}),"dijit"+j)}var c=this.baseClass.split(" ");this.isLeftToRight()||a("Rtl");this.checked&&a("Checked");this.state&&a(this.state);this.selected&&a("Selected");if(this.disabled)a("Disabled");else if(this.readOnly)a("ReadOnly");else if(this.active)a("Active");else this.hovering&&a("Hover");this._focused&&a("Focused");var d=this.stateNode||this.domNode,g={};f.forEach(d.className.split(" "),function(j){g[j]=true});"_stateClasses"in this&&f.forEach(this._stateClasses,
function(j){delete g[j]});f.forEach(c,function(j){g[j]=true});var h=[];for(var i in g)h.push(i);d.className=h.join(" ");this._stateClasses=c},_trackMouseState:function(a,c){function d(){var m="disabled"in j&&j.disabled||"readonly"in j&&j.readonly;f.toggleClass(a,c+"Hover",g&&!h&&!m);f.toggleClass(a,c+"Active",h&&!m);f.toggleClass(a,c+"Focused",i&&!m)}var g=false,h=false,i=false,j=this,k=f.hitch(this,"connect",a);k("onmouseenter",function(){g=true;d()});k("onmouseleave",function(){h=g=false;d()});
k("onmousedown",function(){h=true;d()});k("onmouseup",function(){h=false;d()});k("onfocus",function(){i=true;d()});k("onblur",function(){i=false;d()});this.watch("disabled",d);this.watch("readOnly",d)}});return e._CssStateMixin});
define("dijit/form/_FormWidget",["dojo","dijit","dojo/window","dijit/_Widget","dijit/_Templated","dijit/_CssStateMixin"],function(f,e){f.declare("dijit.form._FormWidget",[e._Widget,e._Templated,e._CssStateMixin],{name:"",alt:"",value:"",type:"text",tabIndex:"0",disabled:false,intermediateChanges:false,scrollOnFocus:true,attributeMap:f.delegate(e._Widget.prototype.attributeMap,{value:"focusNode",id:"focusNode",tabIndex:"focusNode",alt:"focusNode",title:"focusNode"}),postMixInProperties:function(){this.nameAttrSetting=
this.name?'name="'+this.name.replace(/'/g,"&quot;")+'"':"";this.inherited(arguments)},postCreate:function(){this.inherited(arguments);this.connect(this.domNode,"onmousedown","_onMouseDown")},_setDisabledAttr:function(a){this._set("disabled",a);f.attr(this.focusNode,"disabled",a);this.valueNode&&f.attr(this.valueNode,"disabled",a);e.setWaiState(this.focusNode,"disabled",a);if(a){this._set("hovering",false);this._set("active",false);a="tabIndex"in this.attributeMap?this.attributeMap.tabIndex:"focusNode";
f.forEach(f.isArray(a)?a:[a],function(c){c=this[c];f.isWebKit||e.hasDefaultTabStop(c)?c.setAttribute("tabIndex","-1"):c.removeAttribute("tabIndex")},this)}else this.tabIndex!=""&&this.focusNode.setAttribute("tabIndex",this.tabIndex)},setDisabled:function(a){f.deprecated("setDisabled("+a+") is deprecated. Use set('disabled',"+a+") instead.","","2.0");this.set("disabled",a)},_onFocus:function(){this.scrollOnFocus&&f.window.scrollIntoView(this.domNode);this.inherited(arguments)},isFocusable:function(){return!this.disabled&&
this.focusNode&&f.style(this.domNode,"display")!="none"},focus:function(){this.disabled||e.focus(this.focusNode)},compare:function(a,c){return typeof a=="number"&&typeof c=="number"?isNaN(a)&&isNaN(c)?0:a-c:a>c?1:a<c?-1:0},onChange:function(){},_onChangeActive:false,_handleOnChange:function(a,c){if(this._lastValueReported==undefined&&(c===null||!this._onChangeActive))this._resetValue=this._lastValueReported=a;this._pendingOnChange=this._pendingOnChange||typeof a!=typeof this._lastValueReported||this.compare(a,
this._lastValueReported)!=0;if((this.intermediateChanges||c||c===undefined)&&this._pendingOnChange){this._lastValueReported=a;this._pendingOnChange=false;if(this._onChangeActive){this._onChangeHandle&&clearTimeout(this._onChangeHandle);this._onChangeHandle=setTimeout(f.hitch(this,function(){this._onChangeHandle=null;this.onChange(a)}),0)}}},create:function(){this.inherited(arguments);this._onChangeActive=true},destroy:function(){if(this._onChangeHandle){clearTimeout(this._onChangeHandle);this.onChange(this._lastValueReported)}this.inherited(arguments)},
setValue:function(a){f.deprecated("dijit.form._FormWidget:setValue("+a+") is deprecated.  Use set('value',"+a+") instead.","","2.0");this.set("value",a)},getValue:function(){f.deprecated(this.declaredClass+"::getValue() is deprecated. Use get('value') instead.","","2.0");return this.get("value")},_onMouseDown:function(a){if(!a.ctrlKey&&f.mouseButtons.isLeft(a)&&this.isFocusable())var c=this.connect(f.body(),"onmouseup",function(){this.isFocusable()&&this.focus();this.disconnect(c)})}});f.declare("dijit.form._FormValueWidget",
e.form._FormWidget,{readOnly:false,attributeMap:f.delegate(e.form._FormWidget.prototype.attributeMap,{value:"",readOnly:"focusNode"}),_setReadOnlyAttr:function(a){f.attr(this.focusNode,"readOnly",a);e.setWaiState(this.focusNode,"readonly",a);this._set("readOnly",a)},postCreate:function(){this.inherited(arguments);if(f.isIE<9||f.isIE&&f.isQuirks)this.connect(this.focusNode||this.domNode,"onkeydown",this._onKeyDown);if(this._resetValue===undefined)this._lastValueReported=this._resetValue=this.value},
_setValueAttr:function(a,c){this._handleOnChange(a,c)},_handleOnChange:function(a){this._set("value",a);this.inherited(arguments)},undo:function(){this._setValueAttr(this._lastValueReported,false)},reset:function(){this._hasBeenBlurred=false;this._setValueAttr(this._resetValue,true)},_onKeyDown:function(a){if(a.keyCode==f.keys.ESCAPE&&!(a.ctrlKey||a.altKey||a.metaKey)){var c;if(f.isIE){a.preventDefault();c=document.createEventObject();c.keyCode=f.keys.ESCAPE;c.shiftKey=a.shiftKey;a.srcElement.fireEvent("onkeypress",
c)}}},_layoutHackIE7:function(){if(f.isIE==7)for(var a=this.domNode,c=a.parentNode,d=a.firstChild||a,g=d.style.filter,h=this;c&&c.clientHeight==0;){(function(){var i=h.connect(c,"onscroll",function(){h.disconnect(i);d.style.filter=(new Date).getMilliseconds();setTimeout(function(){d.style.filter=g},0)})})();c=c.parentNode}}});return e.form._FormWidget});
define("dijit/form/TextBox",["dojo","dijit","text!dijit/form/templates/TextBox.html","dijit/form/_FormWidget"],function(f,e){f.declare("dijit.form.TextBox",e.form._FormValueWidget,{trim:false,uppercase:false,lowercase:false,propercase:false,maxLength:"",selectOnClick:false,placeHolder:"",templateString:f.cache("dijit.form","templates/TextBox.html"),_singleNodeTemplate:'<input class="dijit dijitReset dijitLeft dijitInputField" dojoAttachPoint="textbox,focusNode" autocomplete="off" type="${type}" ${!nameAttrSetting} />',
_buttonInputDisabled:f.isIE?"disabled":"",baseClass:"dijitTextBox",attributeMap:f.delegate(e.form._FormValueWidget.prototype.attributeMap,{maxLength:"focusNode"}),postMixInProperties:function(){var a=this.type.toLowerCase();if(this.templateString&&this.templateString.toLowerCase()=="input"||(a=="hidden"||a=="file")&&this.templateString==e.form.TextBox.prototype.templateString)this.templateString=this._singleNodeTemplate;this.inherited(arguments)},_setPlaceHolderAttr:function(a){this._set("placeHolder",
a);if(!this._phspan){this._attachPoints.push("_phspan");this._phspan=f.create("span",{className:"dijitPlaceHolder dijitInputField"},this.textbox,"after")}this._phspan.innerHTML="";this._phspan.appendChild(document.createTextNode(a));this._updatePlaceHolder()},_updatePlaceHolder:function(){if(this._phspan)this._phspan.style.display=this.placeHolder&&!this._focused&&!this.textbox.value?"":"none"},_getValueAttr:function(){return this.parse(this.get("displayedValue"),this.constraints)},_setValueAttr:function(a,
c,d){var g;if(a!==undefined){g=this.filter(a);if(typeof d!="string")d=g!==null&&(typeof g!="number"||!isNaN(g))?this.filter(this.format(g,this.constraints)):""}if(d!=null&&d!=undefined&&(typeof d!="number"||!isNaN(d))&&this.textbox.value!=d){this.textbox.value=d;this._set("displayedValue",this.get("displayedValue"))}this._updatePlaceHolder();this.inherited(arguments,[g,c])},displayedValue:"",getDisplayedValue:function(){f.deprecated(this.declaredClass+"::getDisplayedValue() is deprecated. Use set('displayedValue') instead.",
"","2.0");return this.get("displayedValue")},_getDisplayedValueAttr:function(){return this.filter(this.textbox.value)},setDisplayedValue:function(a){f.deprecated(this.declaredClass+"::setDisplayedValue() is deprecated. Use set('displayedValue', ...) instead.","","2.0");this.set("displayedValue",a)},_setDisplayedValueAttr:function(a){if(a===null||a===undefined)a="";else if(typeof a!="string")a=String(a);this.textbox.value=a;this._setValueAttr(this.get("value"),undefined);this._set("displayedValue",
this.get("displayedValue"))},format:function(a){return a==null||a==undefined?"":a.toString?a.toString():a},parse:function(a){return a},_refreshState:function(){},_onInput:function(a){if(a&&a.type&&/key/i.test(a.type)&&a.keyCode)switch(a.keyCode){case f.keys.SHIFT:case f.keys.ALT:case f.keys.CTRL:case f.keys.TAB:return}if(this.intermediateChanges){var c=this;setTimeout(function(){c._handleOnChange(c.get("value"),false)},0)}this._refreshState();this._set("displayedValue",this.get("displayedValue"))},
postCreate:function(){f.isIE&&setTimeout(f.hitch(this,function(){var a=f.getComputedStyle(this.domNode);if(a)if(a=a.fontFamily){var c=this.domNode.getElementsByTagName("INPUT");if(c)for(var d=0;d<c.length;d++)c[d].style.fontFamily=a}}),0);this.textbox.setAttribute("value",this.textbox.value);this.inherited(arguments);if(f.isMoz||f.isOpera)this.connect(this.textbox,"oninput","_onInput");else{this.connect(this.textbox,"onkeydown","_onInput");this.connect(this.textbox,"onkeyup","_onInput");this.connect(this.textbox,
"onpaste","_onInput");this.connect(this.textbox,"oncut","_onInput")}},_blankValue:"",filter:function(a){if(a===null)return this._blankValue;if(typeof a!="string")return a;if(this.trim)a=f.trim(a);if(this.uppercase)a=a.toUpperCase();if(this.lowercase)a=a.toLowerCase();if(this.propercase)a=a.replace(/[^\s]+/g,function(c){return c.substring(0,1).toUpperCase()+c.substring(1)});return a},_setBlurValue:function(){this._setValueAttr(this.get("value"),true)},_onBlur:function(){if(!this.disabled){this._setBlurValue();
this.inherited(arguments);this._selectOnClickHandle&&this.disconnect(this._selectOnClickHandle);if(this.selectOnClick&&f.isMoz)this.textbox.selectionStart=this.textbox.selectionEnd=undefined;this._updatePlaceHolder()}},_onFocus:function(a){if(!(this.disabled||this.readOnly)){if(this.selectOnClick&&a=="mouse")this._selectOnClickHandle=this.connect(this.domNode,"onmouseup",function(){this.disconnect(this._selectOnClickHandle);var c;if(f.isIE){c=f.doc.selection.createRange();c=c.parentElement()==this.textbox&&
c.text.length==0}else c=this.textbox.selectionStart==this.textbox.selectionEnd;c&&e.selectInputText(this.textbox)});this._updatePlaceHolder();this.inherited(arguments);this._refreshState()}},reset:function(){this.textbox.value="";this.inherited(arguments)}});e.selectInputText=function(a,c,d){var g=f.global,h=f.doc;a=f.byId(a);if(isNaN(c))c=0;if(isNaN(d))d=a.value?a.value.length:0;e.focus(a);if(h.selection&&f.body().createTextRange){if(a.createTextRange){a=a.createTextRange();a.collapse(true);a.moveStart("character",
-99999);a.moveStart("character",c);a.moveEnd("character",d-c);a.select()}}else g.getSelection&&a.setSelectionRange&&a.setSelectionRange(c,d)};return e.form.TextBox});define("text!dijit/templates/Tooltip.html",function(){return'<div class="dijitTooltip dijitTooltipLeft" id="dojoTooltip"\n\t><div class="dijitTooltipContainer dijitTooltipContents" dojoAttachPoint="containerNode" role=\'alert\'></div\n\t><div class="dijitTooltipConnector" dojoAttachPoint="connectorNode"></div\n></div>'});
define("dijit/Tooltip",["dojo","dijit","dijit/_Widget","dijit/_Templated","text!dijit/templates/Tooltip.html"],function(f,e){f.declare("dijit._MasterTooltip",[e._Widget,e._Templated],{duration:e.defaultDuration,templateString:f.cache("dijit","templates/Tooltip.html"),postCreate:function(){f.body().appendChild(this.domNode);this.bgIframe=new e.BackgroundIframe(this.domNode);this.fadeIn=f.fadeIn({node:this.domNode,duration:this.duration,onEnd:f.hitch(this,"_onShow")});this.fadeOut=f.fadeOut({node:this.domNode,
duration:this.duration,onEnd:f.hitch(this,"_onHide")})},show:function(a,c,d,g){if(!(this.aroundNode&&this.aroundNode===c)){this.domNode.width="auto";if(this.fadeOut.status()=="playing")this._onDeck=arguments;else{this.containerNode.innerHTML=a;e.placeOnScreenAroundElement(this.domNode,c,e.getPopupAroundAlignment(d&&d.length?d:e.Tooltip.defaultPosition,!g),f.hitch(this,"orient"));f.style(this.domNode,"opacity",0);this.fadeIn.play();this.isShowingNow=true;this.aroundNode=c}}},orient:function(a,c,d,
g,h){this.connectorNode.style.top="";var i=g.w-this.connectorNode.offsetWidth;a.className="dijitTooltip "+{"BL-TL":"dijitTooltipBelow dijitTooltipABLeft","TL-BL":"dijitTooltipAbove dijitTooltipABLeft","BR-TR":"dijitTooltipBelow dijitTooltipABRight","TR-BR":"dijitTooltipAbove dijitTooltipABRight","BR-BL":"dijitTooltipRight","BL-BR":"dijitTooltipLeft"}[c+"-"+d];this.domNode.style.width="auto";var j=f.contentBox(this.domNode),k=Math.min(Math.max(i,1),j.w),m=k<j.w;this.domNode.style.width=k+"px";if(m){this.containerNode.style.overflow=
"auto";m=this.containerNode.scrollWidth;this.containerNode.style.overflow="visible";if(m>k){m=m+f.style(this.domNode,"paddingLeft")+f.style(this.domNode,"paddingRight");this.domNode.style.width=m+"px"}}if(d.charAt(0)=="B"&&c.charAt(0)=="B"){a=f.marginBox(a);c=this.connectorNode.offsetHeight;if(a.h>g.h){this.connectorNode.style.top=g.h-h.h/2-c/2+"px";this.connectorNode.style.bottom=""}else{this.connectorNode.style.bottom=Math.min(Math.max(h.h/2-c/2,0),a.h-c)+"px";this.connectorNode.style.top=""}}else{this.connectorNode.style.top=
"";this.connectorNode.style.bottom=""}return Math.max(0,j.w-i)},_onShow:function(){if(f.isIE)this.domNode.style.filter=""},hide:function(a){if(this._onDeck&&this._onDeck[1]==a)this._onDeck=null;else if(this.aroundNode===a){this.fadeIn.stop();this.isShowingNow=false;this.aroundNode=null;this.fadeOut.play()}},_onHide:function(){this.domNode.style.cssText="";this.containerNode.innerHTML="";if(this._onDeck){this.show.apply(this,this._onDeck);this._onDeck=null}}});e.showTooltip=function(a,c,d,g){if(!e._masterTT)e._masterTT=
new e._MasterTooltip;return e._masterTT.show(a,c,d,g)};e.hideTooltip=function(a){if(!e._masterTT)e._masterTT=new e._MasterTooltip;return e._masterTT.hide(a)};f.declare("dijit.Tooltip",e._Widget,{label:"",showDelay:400,connectId:[],position:[],_setConnectIdAttr:function(a){f.forEach(this._connections||[],function(d){f.forEach(d,f.hitch(this,"disconnect"))},this);var c=f.isArrayLike(a)?a:a?[a]:[];this._connections=f.map(c,function(d){return(d=f.byId(d))?[this.connect(d,"onmouseenter","_onTargetMouseEnter"),
this.connect(d,"onmouseleave","_onTargetMouseLeave"),this.connect(d,"onfocus","_onTargetFocus"),this.connect(d,"onblur","_onTargetBlur")]:[]},this);this._set("connectId",a);this._connectIds=c},addTarget:function(a){a=a.id||a;f.indexOf(this._connectIds,a)==-1&&this.set("connectId",this._connectIds.concat(a))},removeTarget:function(a){a=f.indexOf(this._connectIds,a.id||a);if(a>=0){this._connectIds.splice(a,1);this.set("connectId",this._connectIds)}},buildRendering:function(){this.inherited(arguments);
f.addClass(this.domNode,"dijitTooltipData")},startup:function(){this.inherited(arguments);var a=this.connectId;f.forEach(f.isArrayLike(a)?a:[a],this.addTarget,this)},_onTargetMouseEnter:function(a){this._onHover(a)},_onTargetMouseLeave:function(a){this._onUnHover(a)},_onTargetFocus:function(a){this._focus=true;this._onHover(a)},_onTargetBlur:function(a){this._focus=false;this._onUnHover(a)},_onHover:function(a){if(!this._showTimer){var c=a.target;this._showTimer=setTimeout(f.hitch(this,function(){this.open(c)}),
this.showDelay)}},_onUnHover:function(){if(!this._focus){if(this._showTimer){clearTimeout(this._showTimer);delete this._showTimer}this.close()}},open:function(a){if(this._showTimer){clearTimeout(this._showTimer);delete this._showTimer}e.showTooltip(this.label||this.domNode.innerHTML,a,this.position,!this.isLeftToRight());this._connectNode=a;this.onShow(a,this.position)},close:function(){if(this._connectNode){e.hideTooltip(this._connectNode);delete this._connectNode;this.onHide()}if(this._showTimer){clearTimeout(this._showTimer);
delete this._showTimer}},onShow:function(){},onHide:function(){},uninitialize:function(){this.close();this.inherited(arguments)}});e.Tooltip.defaultPosition=["after","before"];return e.Tooltip});
(function(){function f(c,d,g,h,i,j){if(d[c]){g.push(c);if(d[c]===true||d[c]===1)h.push(i+c+"/"+j)}}function e(c,d,g,h,i){d=h+d+"/"+i;require._fileExists(c.nameToUrl(d,null))&&g.push(d)}var a=/(^.*(^|\/)nls(\/|$))([^\/]*)\/?([^\/]*)/;define("i18n",{version:"0.24.0",load:function(c,d,g,h){h=h||{};var i=a.exec(c),j=i[1],k=i[4],m=i[5],n=k.split("-"),p=[],r={},w,s,u="";if(i[5]){j=i[1];c=j+m}else{c=c;m=i[4];k=h.locale||(h.locale=typeof navigator==="undefined"?"root":(navigator.language||navigator.userLanguage||
"root").toLowerCase());n=k.split("-")}if(h.isBuild){p.push(c);e(d,"root",p,j,m);for(w=0;s=n[w];w++){u+=(u?"-":"")+s;e(d,u,p,j,m)}d(p);g()}else d([c],function(t){var y=[];f("root",t,y,p,j,m);for(w=0;s=n[w];w++){u+=(u?"-":"")+s;f(u,t,y,p,j,m)}d(p,function(){var B,D;for(B=y.length-1;B>-1&&(s=y[B]);B--){D=t[s];if(D===true||D===1)D=d(j+s+"/"+m);require.mixin(r,D)}g(r)})})}})})();
define("dijit/form/nls/validate",{root:{invalidMessage:"The value entered is not valid.",missingMessage:"This value is required.",rangeMessage:"This value is out of range."},zh:true,"zh-tw":true,tr:true,th:true,sv:true,sl:true,sk:true,ru:true,ro:true,pt:true,"pt-pt":true,pl:true,nl:true,nb:true,ko:true,kk:true,ja:true,it:true,hu:true,he:true,fr:true,fi:true,es:true,el:true,de:true,da:true,cs:true,ca:true,ar:true});
define("dijit/form/ValidationTextBox",["dojo","dijit","text!dijit/form/templates/ValidationTextBox.html","dojo/i18n","dijit/form/TextBox","dijit/Tooltip","i18n!dijit/form/nls/validate"],function(f,e){f.declare("dijit.form.ValidationTextBox",e.form.TextBox,{templateString:f.cache("dijit.form","templates/ValidationTextBox.html"),baseClass:"dijitTextBox dijitValidationTextBox",required:false,promptMessage:"",invalidMessage:"$_unset_$",missingMessage:"$_unset_$",message:"",constraints:{},regExp:".*",
regExpGen:function(){return this.regExp},state:"",tooltipPosition:[],_setValueAttr:function(){this.inherited(arguments);this.validate(this._focused)},validator:function(a,c){return(new RegExp("^(?:"+this.regExpGen(c)+")"+(this.required?"":"?")+"$")).test(a)&&(!this.required||!this._isEmpty(a))&&(this._isEmpty(a)||this.parse(a,c)!==undefined)},_isValidSubset:function(){return this.textbox.value.search(this._partialre)==0},isValid:function(){return this.validator(this.textbox.value,this.constraints)},
_isEmpty:function(a){return(this.trim?/^\s*$/:/^$/).test(a)},getErrorMessage:function(){return this.required&&this._isEmpty(this.textbox.value)?this.missingMessage:this.invalidMessage},getPromptMessage:function(){return this.promptMessage},_maskValidSubsetError:true,validate:function(a){var c="",d=this.disabled||this.isValid(a);if(d)this._maskValidSubsetError=true;var g=this._isEmpty(this.textbox.value),h=!d&&a&&this._isValidSubset();this._set("state",d?"":((!this._hasBeenBlurred||a)&&g||h)&&this._maskValidSubsetError?
"Incomplete":"Error");e.setWaiState(this.focusNode,"invalid",d?"false":"true");if(this.state=="Error"){this._maskValidSubsetError=a&&h;c=this.getErrorMessage(a)}else if(this.state=="Incomplete"){c=this.getPromptMessage(a);this._maskValidSubsetError=!this._hasBeenBlurred||a}else if(g)c=this.getPromptMessage(a);this.set("message",c);return d},displayMessage:function(a){e.hideTooltip(this.domNode);a&&this._focused&&e.showTooltip(a,this.domNode,this.tooltipPosition,!this.isLeftToRight())},_refreshState:function(){this.validate(this._focused);
this.inherited(arguments)},constructor:function(){this.constraints={}},_setConstraintsAttr:function(a){if(!a.locale&&this.lang)a.locale=this.lang;this._set("constraints",a);this._computePartialRE()},_computePartialRE:function(){var a=this.regExpGen(this.constraints);this.regExp=a;var c="";a!=".*"&&this.regExp.replace(/\\.|\[\]|\[.*?[^\\]{1}\]|\{.*?\}|\(\?[=:!]|./g,function(g){switch(g.charAt(0)){case "{":case "+":case "?":case "*":case "^":case "$":case "|":case "(":c+=g;break;case ")":c+="|$)";break;
default:c+="(?:"+g+"|$)";break}});try{"".search(c)}catch(d){c=this.regExp;console.warn("RegExp error in "+this.declaredClass+": "+this.regExp)}this._partialre="^(?:"+c+")$"},postMixInProperties:function(){this.inherited(arguments);this.messages=f.i18n.getLocalization("dijit.form","validate",this.lang);if(this.invalidMessage=="$_unset_$")this.invalidMessage=this.messages.invalidMessage;if(!this.invalidMessage)this.invalidMessage=this.promptMessage;if(this.missingMessage=="$_unset_$")this.missingMessage=
this.messages.missingMessage;if(!this.missingMessage)this.missingMessage=this.invalidMessage;this._setConstraintsAttr(this.constraints)},_setDisabledAttr:function(){this.inherited(arguments);this._refreshState()},_setRequiredAttr:function(a){this._set("required",a);e.setWaiState(this.focusNode,"required",a);this._refreshState()},_setMessageAttr:function(a){this._set("message",a);this.displayMessage(a)},reset:function(){this._maskValidSubsetError=true;this.inherited(arguments)},_onBlur:function(){this.displayMessage("");
this.inherited(arguments)}});f.declare("dijit.form.MappedTextBox",e.form.ValidationTextBox,{postMixInProperties:function(){this.inherited(arguments);this.nameAttrSetting=""},serialize:function(a){return a.toString?a.toString():""},toString:function(){var a=this.filter(this.get("value"));return a!=null?typeof a=="string"?a:this.serialize(a,this.constraints):""},validate:function(){this.valueNode.value=this.toString();return this.inherited(arguments)},buildRendering:function(){this.inherited(arguments);
this.valueNode=f.place("<input type='hidden'"+(this.name?" name='"+this.name.replace(/'/g,"&quot;")+"'":"")+"/>",this.textbox,"after")},reset:function(){this.valueNode.value="";this.inherited(arguments)}});f.declare("dijit.form.RangeBoundTextBox",e.form.MappedTextBox,{rangeMessage:"",rangeCheck:function(a,c){return("min"in c?this.compare(a,c.min)>=0:true)&&("max"in c?this.compare(a,c.max)<=0:true)},isInRange:function(){return this.rangeCheck(this.get("value"),this.constraints)},_isDefinitelyOutOfRange:function(){var a=
this.get("value"),c=false,d=false;if("min"in this.constraints){c=this.constraints.min;c=this.compare(a,typeof c=="number"&&c>=0&&a!=0?0:c);c=typeof c=="number"&&c<0}if("max"in this.constraints){d=this.constraints.max;d=this.compare(a,typeof d!="number"||d>0?d:0);d=typeof d=="number"&&d>0}return c||d},_isValidSubset:function(){return this.inherited(arguments)&&!this._isDefinitelyOutOfRange()},isValid:function(a){return this.inherited(arguments)&&(this._isEmpty(this.textbox.value)&&!this.required||
this.isInRange(a))},getErrorMessage:function(a){var c=this.get("value");if(c!==null&&c!==""&&c!==undefined&&(typeof c!="number"||!isNaN(c))&&!this.isInRange(a))return this.rangeMessage;return this.inherited(arguments)},postMixInProperties:function(){this.inherited(arguments);if(!this.rangeMessage){this.messages=f.i18n.getLocalization("dijit.form","validate",this.lang);this.rangeMessage=this.messages.rangeMessage}},_setConstraintsAttr:function(){this.inherited(arguments);if(this.focusNode){this.constraints.min!==
undefined?e.setWaiState(this.focusNode,"valuemin",this.constraints.min):e.removeWaiState(this.focusNode,"valuemin");this.constraints.max!==undefined?e.setWaiState(this.focusNode,"valuemax",this.constraints.max):e.removeWaiState(this.focusNode,"valuemax")}},_setValueAttr:function(a){e.setWaiState(this.focusNode,"valuenow",a);this.inherited(arguments)}});return e.form.ValidationTextBox});
define("orion/util",["dojo","dijit","dojo/hash","dijit/form/ValidationTextBox"],function(f,e){function a(t){var y="",B=navigator.platform.indexOf("Mac")!==-1;if(t.mod1)y+=B?"Cmd+":"Ctrl+";if(t.mod2)y+="Shift+";if(t.mod3)y+="Alt+";if(t.mod4&&B)y+="Ctrl+";if(t.alphaKey)return y+t.alphaKey;for(var D in f.keys)if(typeof(f.keys[D]==="number"))if(f.keys[D]===t.keyCode)return y+D;var l;switch(t.keyCode){case 59:l=t.mod2?":":";";break;case 61:l=t.mod2?"+":"=";break;case 188:l=t.mod2?"<":",";break;case 190:l=
t.mod2?">":".";break;case 191:l=t.mod2?"?":"/";break;case 192:l=t.mod2?"~":"`";break;case 219:l=t.mod2?"{":"[";break;case 220:l=t.mod2?"|":"\\";break;case 221:l=t.mod2?"}":"]";break;case 222:l=t.mod2?'"':"'";break}if(l)return y+l;return y+String.fromCharCode(t.keyCode)}function c(t,y){t.startup();if(typeof y==="string"){var B=f.byId(y);if(!B)if(B=e.byId(y))B=B.domNode;y=B?B:null}if(y){y=f.position(y);t._setStyleAttr("left:"+(y.x+16)+"px !important;");t._setStyleAttr("top:"+(y.y+16)+"px !important;")}t.show()}
function d(t,y,B,D,l,o,q,v,x){q=function(C){return function(A){var F=e.byId(t),H=F.get("value");if(C&&A.keyCode===f.keys.ESCAPE){B&&f.style(y,"display","inline");F.destroyRecursive();o&&o()}else if(!(C&&A.keyCode!==f.keys.ENTER)){if(!F.isValid()||!x&&H===D)B&&f.style(y,"display","inline");else l(H);F.destroyRecursive();o&&o()}}};var z=new e.form.ValidationTextBox({id:t,required:true,value:D||""});f.place(z.domNode,y,"after");f.addClass(z.domNode,"userEditBoxPrompt");B&&f.style(y,"display","none");
f.connect(z,"onKeyDown",q(true));f.connect(z,"onBlur",q(false));window.setTimeout(function(){z.focus();if(D){var C=f.byId(t),A=v?D.indexOf(v):-1;A>0?e.selectInputText(C,0,A):C.select()}},0)}function g(t){var y=window.navigator.platform.indexOf("Mac")!==-1;return y&&t.metaKey||!y&&t.ctrlKey}function h(t,y){if(y&&g(y))window.open(t);else window.location=t}function i(t){if(!t)return t;var y=window.location.href.split("#")[0];y=y.substring(0,y.length-window.location.pathname.length);if(t.indexOf(y)===
0)return t.substring(y.length);return t}function j(t){if(!t)return t;var y=window.location.href.split("#")[0];return y.substring(0,y.length-window.location.pathname.length)+t}function k(t){return this.makeRelative(t).indexOf("/workspace")===0}function m(t,y){t.children=y;for(var B in y)y[B].parent=t;t.children.sort(function(D,l){var o=D.Directory;if(o!==l.Directory)return o?-1:1;D=D.Name&&D.Name.toLowerCase();l=l.Name&&l.Name.toLowerCase();if(D<l)return-1;if(D>l)return 1;return 0})}function n(t,y){t.Parents&&
t.Parents.length===0&&y.getService("orion.core.preference").getPreferences("/window/recent").then(function(B){var D=B.get("projects");if(typeof D==="string")D=JSON.parse(D);var l=[];if(D&&D.length&&D.length>0)for(var o=0;o<D.length;o++)D[o].location!==t.ChildrenLocation&&D[o].name!==t.Name&&l.push(D[o]);l.push({name:t.Name,location:t.ChildrenLocation});if(l.length>5)l=l.slice(-5,l.length);B.put("projects",l)})}function p(t){return typeof t.textContent!=="undefined"?t.textContent:t.innerText}function r(t){return p(document.createTextNode(t))}
function w(t,y){if(typeof t.textContent!=="undefined")t.textContent=y;else t.innerText=y}function s(t,y,B,D,l,o,q,v){l=l||y+"heading";o=o||y+"commands";f.place('<div class="toolComposite" id="'+y+'"><div class="layoutLeft" id="'+y+'"><span style: "inline-block;" id="'+l+'">'+B+'</span></div><div class="layoutRight sectionActions" id="'+o+'"></div><div id="'+t.id+'slideContainer" class="layoutBlock slideParameters slideContainer"><span id="'+t.id+'slideOut" class="slide"><span id="'+t.id+'pageCommandParameters" class="parameters"></span><span id="'+
t.id+'pageCommandDismiss" class="parametersDismiss"></span></span></div></div>',t,"last");D?f.addClass(y,"auxpaneHeading"):f.addClass(y,"paneHeading");q&&q.renderCommands(f.byId(o),"dom",v,v,"button");return f.byId(y)}function u(t){if(typeof t==="string")t=f.byId(t);for(;t;){var y=e.byId(t.id);if(y&&typeof y.layout==="function"){y.layout();return}t=t.parentNode}}return{getUserKeyString:a,openDialog:c,getUserText:d,openInNewWindow:g,followLink:h,makeRelative:i,makeFullPath:j,isAtRoot:k,processNavigatorParent:m,
rememberSuccessfulTraversal:n,getText:p,safeText:r,setText:w,createPaneHeading:s,forceLayout:u}});
define("orion/PageUtil",["require","exports","module"],function(){function f(e){e=e||window.location.toString();var a={resource:""},c=e.indexOf("#");if(c!==-1){e=e.substring(c+1);if(e.length!==0){e=e.split(",");a.resource=decodeURIComponent(e[0]);for(c=1;c<e.length;c++){var d=e[c].split("="),g=decodeURIComponent(d[0]);d=d.length===2?decodeURIComponent(d[1]):null;if(d!==null&&g!=="resource")a[g]=d}}}return a}return{matchResourceParameters:f}});define("text!dijit/templates/Menu.html",function(){return'<table class="dijit dijitMenu dijitMenuPassive dijitReset dijitMenuTable" role="menu" tabIndex="${tabIndex}" dojoAttachEvent="onkeypress:_onKeyPress" cellspacing="0">\n\t<tbody class="dijitReset" dojoAttachPoint="containerNode"></tbody>\n</table>'});
define("dijit/_Container",["dojo","dijit"],function(f,e){f.declare("dijit._Container",null,{isContainer:true,buildRendering:function(){this.inherited(arguments);if(!this.containerNode)this.containerNode=this.domNode},addChild:function(a,c){var d=this.containerNode;if(c&&typeof c=="number"){var g=this.getChildren();if(g&&g.length>=c){d=g[c-1].domNode;c="after"}}f.place(a.domNode,d,c);this._started&&!a._started&&a.startup()},removeChild:function(a){if(typeof a=="number")a=this.getChildren()[a];if(a)(a=
a.domNode)&&a.parentNode&&a.parentNode.removeChild(a)},hasChildren:function(){return this.getChildren().length>0},destroyDescendants:function(a){f.forEach(this.getChildren(),function(c){c.destroyRecursive(a)})},_getSiblingOfChild:function(a,c){a=a.domNode;c=c>0?"nextSibling":"previousSibling";do a=a[c];while(a&&(a.nodeType!=1||!e.byNode(a)));return a&&e.byNode(a)},getIndexOfChild:function(a){return f.indexOf(this.getChildren(),a)},startup:function(){if(!this._started){f.forEach(this.getChildren(),
function(a){a.startup()});this.inherited(arguments)}}});return e._Container});
define("dijit/_KeyNavContainer",["dojo","dijit","dijit/_Container"],function(f,e){f.declare("dijit._KeyNavContainer",e._Container,{tabIndex:"0",_keyNavCodes:{},connectKeyNavHandlers:function(a,c){var d=this._keyNavCodes={},g=f.hitch(this,this.focusPrev),h=f.hitch(this,this.focusNext);f.forEach(a,function(i){d[i]=g});f.forEach(c,function(i){d[i]=h});d[f.keys.HOME]=f.hitch(this,"focusFirstChild");d[f.keys.END]=f.hitch(this,"focusLastChild");this.connect(this.domNode,"onkeypress","_onContainerKeypress");
this.connect(this.domNode,"onfocus","_onContainerFocus")},startupKeyNavChildren:function(){f.forEach(this.getChildren(),f.hitch(this,"_startupChild"))},addChild:function(a){e._KeyNavContainer.superclass.addChild.apply(this,arguments);this._startupChild(a)},focus:function(){this.focusFirstChild()},focusFirstChild:function(){var a=this._getFirstFocusableChild();a&&this.focusChild(a)},focusLastChild:function(){var a=this._getLastFocusableChild();a&&this.focusChild(a)},focusNext:function(){this.focusChild(this._getNextFocusableChild(this.focusedChild,
1))},focusPrev:function(){this.focusChild(this._getNextFocusableChild(this.focusedChild,-1),true)},focusChild:function(a,c){this.focusedChild&&a!==this.focusedChild&&this._onChildBlur(this.focusedChild);a.set("tabIndex",this.tabIndex);a.focus(c?"end":"start");this._set("focusedChild",a)},_startupChild:function(a){a.set("tabIndex","-1");this.connect(a,"_onFocus",function(){a.set("tabIndex",this.tabIndex)});this.connect(a,"_onBlur",function(){a.set("tabIndex","-1")})},_onContainerFocus:function(a){if(a.target===
this.domNode){this.focusFirstChild();f.attr(this.domNode,"tabIndex","-1")}},_onBlur:function(){this.tabIndex&&f.attr(this.domNode,"tabIndex",this.tabIndex);this.inherited(arguments)},_onContainerKeypress:function(a){if(!(a.ctrlKey||a.altKey)){var c=this._keyNavCodes[a.charOrCode];if(c){c();f.stopEvent(a)}}},_onChildBlur:function(){},_getFirstFocusableChild:function(){return this._getNextFocusableChild(null,1)},_getLastFocusableChild:function(){return this._getNextFocusableChild(null,-1)},_getNextFocusableChild:function(a,
c){if(a)a=this._getSiblingOfChild(a,c);for(var d=this.getChildren(),g=0;g<d.length;g++){a||(a=d[c>0?0:d.length-1]);if(a.isFocusable())return a;a=this._getSiblingOfChild(a,c)}return null}});return e._KeyNavContainer});define("text!dijit/templates/MenuItem.html",function(){return'<tr class="dijitReset dijitMenuItem" dojoAttachPoint="focusNode" role="menuitem" tabIndex="-1"\n\t\tdojoAttachEvent="onmouseenter:_onHover,onmouseleave:_onUnhover,ondijitclick:_onClick">\n\t<td class="dijitReset dijitMenuItemIconCell" role="presentation">\n\t\t<img src="${_blankGif}" alt="" class="dijitIcon dijitMenuItemIcon" dojoAttachPoint="iconNode"/>\n\t</td>\n\t<td class="dijitReset dijitMenuItemLabel" colspan="2" dojoAttachPoint="containerNode"></td>\n\t<td class="dijitReset dijitMenuItemAccelKey" style="display: none" dojoAttachPoint="accelKeyNode"></td>\n\t<td class="dijitReset dijitMenuArrowCell" role="presentation">\n\t\t<div dojoAttachPoint="arrowWrapper" style="visibility: hidden">\n\t\t\t<img src="${_blankGif}" alt="" class="dijitMenuExpand"/>\n\t\t\t<span class="dijitMenuExpandA11y">+</span>\n\t\t</div>\n\t</td>\n</tr>'});
define("dijit/_Contained",["dojo","dijit"],function(f,e){f.declare("dijit._Contained",null,{getParent:function(){var a=e.getEnclosingWidget(this.domNode.parentNode);return a&&a.isContainer?a:null},_getSibling:function(a){var c=this.domNode;do c=c[a+"Sibling"];while(c&&c.nodeType!=1);return c&&e.byNode(c)},getPreviousSibling:function(){return this._getSibling("previous")},getNextSibling:function(){return this._getSibling("next")},getIndexInParent:function(){var a=this.getParent();if(!a||!a.getIndexOfChild)return-1;
return a.getIndexOfChild(this)}});return e._Contained});
define("dijit/MenuItem",["dojo","dijit","text!dijit/templates/MenuItem.html","dijit/_Widget","dijit/_Templated","dijit/_Contained","dijit/_CssStateMixin"],function(f,e){f.declare("dijit.MenuItem",[e._Widget,e._Templated,e._Contained,e._CssStateMixin],{templateString:f.cache("dijit","templates/MenuItem.html"),attributeMap:f.delegate(e._Widget.prototype.attributeMap,{label:{node:"containerNode",type:"innerHTML"},iconClass:{node:"iconNode",type:"class"}}),baseClass:"dijitMenuItem",label:"",iconClass:"",
accelKey:"",disabled:false,_fillContent:function(a){a&&!("label"in this.params)&&this.set("label",a.innerHTML)},buildRendering:function(){this.inherited(arguments);var a=this.id+"_text";f.attr(this.containerNode,"id",a);if(this.accelKeyNode){f.attr(this.accelKeyNode,"id",this.id+"_accel");a+=" "+this.id+"_accel"}e.setWaiState(this.domNode,"labelledby",a);f.setSelectable(this.domNode,false)},_onHover:function(){this.getParent().onItemHover(this)},_onUnhover:function(){this.getParent().onItemUnhover(this);
this._set("hovering",false)},_onClick:function(a){this.getParent().onItemClick(this,a);f.stopEvent(a)},onClick:function(){},focus:function(){try{f.isIE==8&&this.containerNode.focus();e.focus(this.focusNode)}catch(a){}},_onFocus:function(){this._setSelected(true);this.getParent()._onItemFocus(this);this.inherited(arguments)},_setSelected:function(a){f.toggleClass(this.domNode,"dijitMenuItemSelected",a)},setLabel:function(a){f.deprecated("dijit.MenuItem.setLabel() is deprecated.  Use set('label', ...) instead.",
"","2.0");this.set("label",a)},setDisabled:function(a){f.deprecated("dijit.Menu.setDisabled() is deprecated.  Use set('disabled', bool) instead.","","2.0");this.set("disabled",a)},_setDisabledAttr:function(a){e.setWaiState(this.focusNode,"disabled",a?"true":"false");this._set("disabled",a)},_setAccelKeyAttr:function(a){this.accelKeyNode.style.display=a?"":"none";this.accelKeyNode.innerHTML=a;f.attr(this.containerNode,"colSpan",a?"1":"2");this._set("accelKey",a)}});return e.MenuItem});
define("dijit/PopupMenuItem",["dojo","dijit","dijit/MenuItem"],function(f,e){f.declare("dijit.PopupMenuItem",e.MenuItem,{_fillContent:function(){if(this.srcNodeRef){var a=f.query("*",this.srcNodeRef);e.PopupMenuItem.superclass._fillContent.call(this,a[0]);this.dropDownContainer=this.srcNodeRef}},startup:function(){if(!this._started){this.inherited(arguments);if(!this.popup){var a=f.query("[widgetId]",this.dropDownContainer)[0];this.popup=e.byNode(a)}f.body().appendChild(this.popup.domNode);this.popup.startup();
this.popup.domNode.style.display="none";this.arrowWrapper&&f.style(this.arrowWrapper,"visibility","");e.setWaiState(this.focusNode,"haspopup","true")}},destroyDescendants:function(){if(this.popup){this.popup._destroyed||this.popup.destroyRecursive();delete this.popup}this.inherited(arguments)}});return e.PopupMenuItem});define("text!dijit/templates/CheckedMenuItem.html",function(){return'<tr class="dijitReset dijitMenuItem" dojoAttachPoint="focusNode" role="menuitemcheckbox" tabIndex="-1"\n\t\tdojoAttachEvent="onmouseenter:_onHover,onmouseleave:_onUnhover,ondijitclick:_onClick">\n\t<td class="dijitReset dijitMenuItemIconCell" role="presentation">\n\t\t<img src="${_blankGif}" alt="" class="dijitMenuItemIcon dijitCheckedMenuItemIcon" dojoAttachPoint="iconNode"/>\n\t\t<span class="dijitCheckedMenuItemIconChar">&#10003;</span>\n\t</td>\n\t<td class="dijitReset dijitMenuItemLabel" colspan="2" dojoAttachPoint="containerNode,labelNode"></td>\n\t<td class="dijitReset dijitMenuItemAccelKey" style="display: none" dojoAttachPoint="accelKeyNode"></td>\n\t<td class="dijitReset dijitMenuArrowCell" role="presentation">&nbsp;</td>\n</tr>'});
define("dijit/CheckedMenuItem",["dojo","dijit","text!dijit/templates/CheckedMenuItem.html","dijit/MenuItem"],function(f,e){f.declare("dijit.CheckedMenuItem",e.MenuItem,{templateString:f.cache("dijit","templates/CheckedMenuItem.html"),checked:false,_setCheckedAttr:function(a){f.toggleClass(this.domNode,"dijitCheckedMenuItemChecked",a);e.setWaiState(this.domNode,"checked",a);this._set("checked",a)},onChange:function(){},_onClick:function(){if(!this.disabled){this.set("checked",!this.checked);this.onChange(this.checked)}this.inherited(arguments)}});
return e.CheckedMenuItem});define("text!dijit/templates/MenuSeparator.html",function(){return'<tr class="dijitMenuSeparator">\n\t<td class="dijitMenuSeparatorIconCell">\n\t\t<div class="dijitMenuSeparatorTop"></div>\n\t\t<div class="dijitMenuSeparatorBottom"></div>\n\t</td>\n\t<td colspan="3" class="dijitMenuSeparatorLabelCell">\n\t\t<div class="dijitMenuSeparatorTop dijitMenuSeparatorLabel"></div>\n\t\t<div class="dijitMenuSeparatorBottom"></div>\n\t</td>\n</tr>'});
define("dijit/MenuSeparator",["dojo","dijit","text!dijit/templates/MenuSeparator.html","dijit/_Widget","dijit/_Templated","dijit/_Contained"],function(f,e){f.declare("dijit.MenuSeparator",[e._Widget,e._Templated,e._Contained],{templateString:f.cache("dijit","templates/MenuSeparator.html"),buildRendering:function(){this.inherited(arguments);f.setSelectable(this.domNode,false)},isFocusable:function(){return false}});return e.MenuSeparator});
define("dijit/Menu",["dojo","dijit","text!dijit/templates/Menu.html","dojo/window","dijit/_Widget","dijit/_KeyNavContainer","dijit/_Templated","dijit/MenuItem","dijit/PopupMenuItem","dijit/CheckedMenuItem","dijit/MenuSeparator"],function(f,e){f.declare("dijit._MenuBase",[e._Widget,e._Templated,e._KeyNavContainer],{parentMenu:null,popupDelay:500,startup:function(){if(!this._started){f.forEach(this.getChildren(),function(a){a.startup()});this.startupKeyNavChildren();this.inherited(arguments)}},onExecute:function(){},
onCancel:function(){},_moveToPopup:function(a){if(this.focusedChild&&this.focusedChild.popup&&!this.focusedChild.disabled)this.focusedChild._onClick(a);else(a=this._getTopMenu())&&a._isMenuBar&&a.focusNext()},_onPopupHover:function(){if(this.currentPopup&&this.currentPopup._pendingClose_timer){var a=this.currentPopup.parentMenu;a.focusedChild&&a.focusedChild._setSelected(false);a.focusedChild=this.currentPopup.from_item;a.focusedChild._setSelected(true);this._stopPendingCloseTimer(this.currentPopup)}},
onItemHover:function(a){if(this.isActive){this.focusChild(a);if(this.focusedChild.popup&&!this.focusedChild.disabled&&!this.hover_timer)this.hover_timer=setTimeout(f.hitch(this,"_openPopup"),this.popupDelay)}this.focusedChild&&this.focusChild(a);this._hoveredChild=a},_onChildBlur:function(a){this._stopPopupTimer();a._setSelected(false);var c=a.popup;if(c){this._stopPendingCloseTimer(c);c._pendingClose_timer=setTimeout(function(){c._pendingClose_timer=null;if(c.parentMenu)c.parentMenu.currentPopup=
null;e.popup.close(c)},this.popupDelay)}},onItemUnhover:function(a){this.isActive&&this._stopPopupTimer();if(this._hoveredChild==a)this._hoveredChild=null},_stopPopupTimer:function(){if(this.hover_timer){clearTimeout(this.hover_timer);this.hover_timer=null}},_stopPendingCloseTimer:function(a){if(a._pendingClose_timer){clearTimeout(a._pendingClose_timer);a._pendingClose_timer=null}},_stopFocusTimer:function(){if(this._focus_timer){clearTimeout(this._focus_timer);this._focus_timer=null}},_getTopMenu:function(){for(var a=
this;a.parentMenu;a=a.parentMenu);return a},onItemClick:function(a,c){typeof this.isShowingNow=="undefined"&&this._markActive();this.focusChild(a);if(a.disabled)return false;if(a.popup)this._openPopup();else{this.onExecute();a.onClick(c)}},_openPopup:function(){this._stopPopupTimer();var a=this.focusedChild;if(a){var c=a.popup;if(!c.isShowingNow){if(this.currentPopup){this._stopPendingCloseTimer(this.currentPopup);e.popup.close(this.currentPopup)}c.parentMenu=this;c.from_item=a;var d=this;e.popup.open({parent:this,
popup:c,around:a.domNode,orient:this._orient||(this.isLeftToRight()?{TR:"TL",TL:"TR",BR:"BL",BL:"BR"}:{TL:"TR",TR:"TL",BL:"BR",BR:"BL"}),onCancel:function(){d.focusChild(a);d._cleanUp();a._setSelected(true);d.focusedChild=a},onExecute:f.hitch(this,"_cleanUp")});this.currentPopup=c;c.connect(c.domNode,"onmouseenter",f.hitch(d,"_onPopupHover"));if(c.focus)c._focus_timer=setTimeout(f.hitch(c,function(){this._focus_timer=null;this.focus()}),0)}}},_markActive:function(){this.isActive=true;f.replaceClass(this.domNode,
"dijitMenuActive","dijitMenuPassive")},onOpen:function(){this.isShowingNow=true;this._markActive()},_markInactive:function(){this.isActive=false;f.replaceClass(this.domNode,"dijitMenuPassive","dijitMenuActive")},onClose:function(){this._stopFocusTimer();this._markInactive();this.isShowingNow=false;this.parentMenu=null},_closeChild:function(){this._stopPopupTimer();if(this.currentPopup){e._curFocus&&f.isDescendant(e._curFocus,this.currentPopup.domNode)&&this.focusedChild.focusNode.focus();e.popup.close(this.currentPopup);
this.currentPopup=null}if(this.focusedChild){this.focusedChild._setSelected(false);this.focusedChild._onUnhover();this.focusedChild=null}},_onItemFocus:function(a){this._hoveredChild&&this._hoveredChild!=a&&this._hoveredChild._onUnhover()},_onBlur:function(){this._cleanUp();this.inherited(arguments)},_cleanUp:function(){this._closeChild();typeof this.isShowingNow=="undefined"&&this._markInactive()}});f.declare("dijit.Menu",e._MenuBase,{constructor:function(){this._bindings=[]},templateString:f.cache("dijit",
"templates/Menu.html"),baseClass:"dijitMenu",targetNodeIds:[],contextMenuForWindow:false,leftClickToOpen:false,refocus:true,postCreate:function(){this.contextMenuForWindow?this.bindDomNode(f.body()):f.forEach(this.targetNodeIds,this.bindDomNode,this);var a=f.keys,c=this.isLeftToRight();this._openSubMenuKey=c?a.RIGHT_ARROW:a.LEFT_ARROW;this._closeSubMenuKey=c?a.LEFT_ARROW:a.RIGHT_ARROW;this.connectKeyNavHandlers([a.UP_ARROW],[a.DOWN_ARROW])},_onKeyPress:function(a){if(!(a.ctrlKey||a.altKey))switch(a.charOrCode){case this._openSubMenuKey:this._moveToPopup(a);
f.stopEvent(a);break;case this._closeSubMenuKey:if(this.parentMenu)this.parentMenu._isMenuBar?this.parentMenu.focusPrev():this.onCancel(false);else f.stopEvent(a);break}},_iframeContentWindow:function(a){return f.window.get(this._iframeContentDocument(a))||this._iframeContentDocument(a).__parent__||a.name&&f.doc.frames[a.name]||null},_iframeContentDocument:function(a){return a.contentDocument||a.contentWindow&&a.contentWindow.document||a.name&&f.doc.frames[a.name]&&f.doc.frames[a.name].document||
null},bindDomNode:function(a){a=f.byId(a);var c;if(a.tagName.toLowerCase()=="iframe"){var d=a,g=this._iframeContentWindow(d);c=f.withGlobal(g,f.body)}else c=a==f.body()?f.doc.documentElement:a;var h={node:a,iframe:d};f.attr(a,"_dijitMenu"+this.id,this._bindings.push(h));var i=f.hitch(this,function(j){return[f.connect(j,this.leftClickToOpen?"onclick":"oncontextmenu",this,function(k){f.stopEvent(k);this._scheduleOpen(k.target,d,{x:k.pageX,y:k.pageY})}),f.connect(j,"onkeydown",this,function(k){if(k.shiftKey&&
k.keyCode==f.keys.F10){f.stopEvent(k);this._scheduleOpen(k.target,d)}})]});h.connects=c?i(c):[];if(d){h.onloadHandler=f.hitch(this,function(){var j=this._iframeContentWindow(d);c=f.withGlobal(j,f.body);h.connects=i(c)});d.addEventListener?d.addEventListener("load",h.onloadHandler,false):d.attachEvent("onload",h.onloadHandler)}},unBindDomNode:function(a){var c;try{c=f.byId(a)}catch(d){return}a="_dijitMenu"+this.id;if(c&&f.hasAttr(c,a)){var g=f.attr(c,a)-1,h=this._bindings[g];f.forEach(h.connects,f.disconnect);
var i=h.iframe;if(i)i.removeEventListener?i.removeEventListener("load",h.onloadHandler,false):i.detachEvent("onload",h.onloadHandler);f.removeAttr(c,a);delete this._bindings[g]}},_scheduleOpen:function(a,c,d){if(!this._openTimer)this._openTimer=setTimeout(f.hitch(this,function(){delete this._openTimer;this._openMyself({target:a,iframe:c,coords:d})}),1)},_openMyself:function(a){function c(){m.refocus&&e.focus(n);e.popup.close(m)}var d=a.target,g=a.iframe;if(a=a.coords){if(g){d=f.position(g,true);var h=
this._iframeContentWindow(g);h=f.withGlobal(h,"_docScroll",f);var i=f.getComputedStyle(g),j=f._toPixelValue,k=(f.isIE&&f.isQuirks?0:j(g,i.paddingLeft))+(f.isIE&&f.isQuirks?j(g,i.borderLeftWidth):0);g=(f.isIE&&f.isQuirks?0:j(g,i.paddingTop))+(f.isIE&&f.isQuirks?j(g,i.borderTopWidth):0);a.x+=d.x+k-h.x;a.y+=d.y+g-h.y}}else{a=f.position(d,true);a.x+=10;a.y+=10}var m=this,n=e.getFocus(this);e.popup.open({popup:this,x:a.x,y:a.y,onExecute:c,onCancel:c,orient:this.isLeftToRight()?"L":"R"});this.focus();this._onBlur=
function(){this.inherited("_onBlur",arguments);e.popup.close(this)}},uninitialize:function(){f.forEach(this._bindings,function(a){a&&this.unBindDomNode(a.node)},this);this.inherited(arguments)}});return e.Menu});define("text!dijit/form/templates/Button.html",function(){return'<span class="dijit dijitReset dijitInline"\n\t><span class="dijitReset dijitInline dijitButtonNode"\n\t\tdojoAttachEvent="ondijitclick:_onButtonClick"\n\t\t><span class="dijitReset dijitStretch dijitButtonContents"\n\t\t\tdojoAttachPoint="titleNode,focusNode"\n\t\t\trole="button" aria-labelledby="${id}_label"\n\t\t\t><span class="dijitReset dijitInline dijitIcon" dojoAttachPoint="iconNode"></span\n\t\t\t><span class="dijitReset dijitToggleButtonIconChar">&#x25CF;</span\n\t\t\t><span class="dijitReset dijitInline dijitButtonText"\n\t\t\t\tid="${id}_label"\n\t\t\t\tdojoAttachPoint="containerNode"\n\t\t\t></span\n\t\t></span\n\t></span\n\t><input ${!nameAttrSetting} type="${type}" value="${value}" class="dijitOffScreen" tabIndex="-1"\n\t\tdojoAttachPoint="valueNode"\n/></span>'});
define("text!dijit/form/templates/DropDownButton.html",function(){return'<span class="dijit dijitReset dijitInline"\n\t><span class=\'dijitReset dijitInline dijitButtonNode\'\n\t\tdojoAttachEvent="ondijitclick:_onButtonClick" dojoAttachPoint="_buttonNode"\n\t\t><span class="dijitReset dijitStretch dijitButtonContents"\n\t\t\tdojoAttachPoint="focusNode,titleNode,_arrowWrapperNode"\n\t\t\trole="button" aria-haspopup="true" aria-labelledby="${id}_label"\n\t\t\t><span class="dijitReset dijitInline dijitIcon"\n\t\t\t\tdojoAttachPoint="iconNode"\n\t\t\t></span\n\t\t\t><span class="dijitReset dijitInline dijitButtonText"\n\t\t\t\tdojoAttachPoint="containerNode,_popupStateNode"\n\t\t\t\tid="${id}_label"\n\t\t\t></span\n\t\t\t><span class="dijitReset dijitInline dijitArrowButtonInner"></span\n\t\t\t><span class="dijitReset dijitInline dijitArrowButtonChar">&#9660;</span\n\t\t></span\n\t></span\n\t><input ${!nameAttrSetting} type="${type}" value="${value}" class="dijitOffScreen" tabIndex="-1"\n\t\tdojoAttachPoint="valueNode"\n/></span>'});
define("text!dijit/form/templates/ComboButton.html",function(){return'<table class="dijit dijitReset dijitInline dijitLeft"\n\tcellspacing=\'0\' cellpadding=\'0\' role="presentation"\n\t><tbody role="presentation"><tr role="presentation"\n\t\t><td class="dijitReset dijitStretch dijitButtonNode" dojoAttachPoint="buttonNode" dojoAttachEvent="ondijitclick:_onButtonClick,onkeypress:_onButtonKeyPress"\n\t\t><div id="${id}_button" class="dijitReset dijitButtonContents"\n\t\t\tdojoAttachPoint="titleNode"\n\t\t\trole="button" aria-labelledby="${id}_label"\n\t\t\t><div class="dijitReset dijitInline dijitIcon" dojoAttachPoint="iconNode" role="presentation"></div\n\t\t\t><div class="dijitReset dijitInline dijitButtonText" id="${id}_label" dojoAttachPoint="containerNode" role="presentation"></div\n\t\t></div\n\t\t></td\n\t\t><td id="${id}_arrow" class=\'dijitReset dijitRight dijitButtonNode dijitArrowButton\'\n\t\t\tdojoAttachPoint="_popupStateNode,focusNode,_buttonNode"\n\t\t\tdojoAttachEvent="onkeypress:_onArrowKeyPress"\n\t\t\ttitle="${optionsTitle}"\n\t\t\trole="button" aria-haspopup="true"\n\t\t\t><div class="dijitReset dijitArrowButtonInner" role="presentation"></div\n\t\t\t><div class="dijitReset dijitArrowButtonChar" role="presentation">&#9660;</div\n\t\t></td\n\t\t><td style="display:none !important;"\n\t\t\t><input ${!nameAttrSetting} type="${type}" value="${value}" dojoAttachPoint="valueNode"\n\t\t/></td></tr></tbody\n></table>'});
define("dijit/_HasDropDown",["dojo","dijit","dijit/_Widget"],function(f,e){f.declare("dijit._HasDropDown",null,{_buttonNode:null,_arrowWrapperNode:null,_popupStateNode:null,_aroundNode:null,dropDown:null,autoWidth:true,forceWidth:false,maxHeight:0,dropDownPosition:["below","above"],_stopClickEvents:true,_onDropDownMouseDown:function(a){if(!(this.disabled||this.readOnly)){f.stopEvent(a);this._docHandler=this.connect(f.doc,"onmouseup","_onDropDownMouseUp");this.toggleDropDown()}},_onDropDownMouseUp:function(a){a&&
this._docHandler&&this.disconnect(this._docHandler);var c=this.dropDown,d=false;if(a&&this._opened){var g=f.position(this._buttonNode,true);if(!(a.pageX>=g.x&&a.pageX<=g.x+g.w)||!(a.pageY>=g.y&&a.pageY<=g.y+g.h)){for(g=a.target;g&&!d;)if(f.hasClass(g,"dijitPopup"))d=true;else g=g.parentNode;if(d){g=a.target;if(c.onItemClick){for(var h;g&&!(h=e.byNode(g));)g=g.parentNode;h&&h.onClick&&h.getParent&&h.getParent().onItemClick(h,a)}return}}}this._opened&&c.focus&&c.autoFocus!==false&&window.setTimeout(f.hitch(c,
"focus"),1)},_onDropDownClick:function(a){this._stopClickEvents&&f.stopEvent(a)},buildRendering:function(){this.inherited(arguments);this._buttonNode=this._buttonNode||this.focusNode||this.domNode;this._popupStateNode=this._popupStateNode||this.focusNode||this._buttonNode;var a={after:this.isLeftToRight()?"Right":"Left",before:this.isLeftToRight()?"Left":"Right",above:"Up",below:"Down",left:"Left",right:"Right"}[this.dropDownPosition[0]]||this.dropDownPosition[0]||"Down";f.addClass(this._arrowWrapperNode||
this._buttonNode,"dijit"+a+"ArrowButton")},postCreate:function(){this.inherited(arguments);this.connect(this._buttonNode,"onmousedown","_onDropDownMouseDown");this.connect(this._buttonNode,"onclick","_onDropDownClick");this.connect(this.focusNode,"onkeypress","_onKey");this.connect(this.focusNode,"onkeyup","_onKeyUp")},destroy:function(){if(this.dropDown){this.dropDown._destroyed||this.dropDown.destroyRecursive();delete this.dropDown}this.inherited(arguments)},_onKey:function(a){if(!(this.disabled||
this.readOnly)){var c=this.dropDown,d=a.target;if(c&&this._opened&&c.handleKey)if(c.handleKey(a)===false){f.stopEvent(a);return}if(c&&this._opened&&a.charOrCode==f.keys.ESCAPE){this.closeDropDown();f.stopEvent(a)}else if(!this._opened&&(a.charOrCode==f.keys.DOWN_ARROW||(a.charOrCode==f.keys.ENTER||a.charOrCode==" ")&&((d.tagName||"").toLowerCase()!=="input"||d.type&&d.type.toLowerCase()!=="text"))){this._toggleOnKeyUp=true;f.stopEvent(a)}}},_onKeyUp:function(){if(this._toggleOnKeyUp){delete this._toggleOnKeyUp;
this.toggleDropDown();var a=this.dropDown;a&&a.focus&&setTimeout(f.hitch(a,"focus"),1)}},_onBlur:function(){this.closeDropDown(e._curFocus&&this.dropDown&&f.isDescendant(e._curFocus,this.dropDown.domNode));this.inherited(arguments)},isLoaded:function(){return true},loadDropDown:function(a){a()},toggleDropDown:function(){if(!(this.disabled||this.readOnly))if(this._opened)this.closeDropDown();else this.isLoaded()?this.openDropDown():this.loadDropDown(f.hitch(this,"openDropDown"))},openDropDown:function(){var a=
this.dropDown,c=a.domNode,d=this._aroundNode||this.domNode,g=this;if(!this._preparedNode){this._preparedNode=true;if(c.style.width)this._explicitDDWidth=true;if(c.style.height)this._explicitDDHeight=true}if(this.maxHeight||this.forceWidth||this.autoWidth){var h={display:"",visibility:"hidden"};if(!this._explicitDDWidth)h.width="";if(!this._explicitDDHeight)h.height="";f.style(c,h);h=this.maxHeight;if(h==-1){h=f.window.getBox();var i=f.position(d,false);h=Math.floor(Math.max(i.y,h.h-(i.y+i.h)))}a.startup&&
!a._started&&a.startup();e.popup.moveOffScreen(a);i=f._getMarginSize(c);var j=h&&i.h>h;f.style(c,{overflowX:"hidden",overflowY:j?"auto":"hidden"});if(j){i.h=h;if("w"in i)i.w+=16}else delete i.h;if(this.forceWidth)i.w=d.offsetWidth;else if(this.autoWidth)i.w=Math.max(i.w,d.offsetWidth);else delete i.w;f.isFunction(a.resize)?a.resize(i):f.marginBox(c,i)}a=e.popup.open({parent:this,popup:a,around:d,orient:e.getPopupAroundAlignment(this.dropDownPosition&&this.dropDownPosition.length?this.dropDownPosition:
["below"],this.isLeftToRight()),onExecute:function(){g.closeDropDown(true)},onCancel:function(){g.closeDropDown(true)},onClose:function(){f.attr(g._popupStateNode,"popupActive",false);f.removeClass(g._popupStateNode,"dijitHasDropDownOpen");g._opened=false}});f.attr(this._popupStateNode,"popupActive","true");f.addClass(g._popupStateNode,"dijitHasDropDownOpen");this._opened=true;return a},closeDropDown:function(a){if(this._opened){a&&this.focus();e.popup.close(this.dropDown);this._opened=false}}});
return e._HasDropDown});
define("dijit/form/Button",["dojo","dijit","text!dijit/form/templates/Button.html","text!dijit/form/templates/DropDownButton.html","text!dijit/form/templates/ComboButton.html","dijit/form/_FormWidget","dijit/_Container","dijit/_HasDropDown"],function(f,e){f.declare("dijit.form.Button",e.form._FormWidget,{label:"",showLabel:true,iconClass:"",type:"button",baseClass:"dijitButton",templateString:f.cache("dijit.form","templates/Button.html"),attributeMap:f.delegate(e.form._FormWidget.prototype.attributeMap,{value:"valueNode"}),
_onClick:function(a){if(this.disabled)return false;this._clicked();return this.onClick(a)},_onButtonClick:function(a){if(this._onClick(a)===false)a.preventDefault();else if(this.type=="submit"&&!(this.valueNode||this.focusNode).form)for(var c=this.domNode;c.parentNode;c=c.parentNode){var d=e.byNode(c);if(d&&typeof d._onSubmit=="function"){d._onSubmit(a);break}}else if(this.valueNode){this.valueNode.click();a.preventDefault()}},buildRendering:function(){this.inherited(arguments);f.setSelectable(this.focusNode,
false)},_fillContent:function(a){if(a&&(!this.params||!("label"in this.params)))this.set("label",a.innerHTML)},_setShowLabelAttr:function(a){this.containerNode&&f.toggleClass(this.containerNode,"dijitDisplayNone",!a);this._set("showLabel",a)},onClick:function(){return true},_clicked:function(){},setLabel:function(a){f.deprecated("dijit.form.Button.setLabel() is deprecated.  Use set('label', ...) instead.","","2.0");this.set("label",a)},_setLabelAttr:function(a){this._set("label",a);this.containerNode.innerHTML=
a;if(this.showLabel==false&&!this.params.title)this.titleNode.title=f.trim(this.containerNode.innerText||this.containerNode.textContent||"")},_setIconClassAttr:function(a){f.replaceClass(this.iconNode,a||"dijitNoIcon",this.iconClass||"dijitNoIcon");this._set("iconClass",a)}});f.declare("dijit.form.DropDownButton",[e.form.Button,e._Container,e._HasDropDown],{baseClass:"dijitDropDownButton",templateString:f.cache("dijit.form","templates/DropDownButton.html"),_fillContent:function(){if(this.srcNodeRef){var a=
f.query("*",this.srcNodeRef);e.form.DropDownButton.superclass._fillContent.call(this,a[0]);this.dropDownContainer=this.srcNodeRef}},startup:function(){if(!this._started){if(!this.dropDown&&this.dropDownContainer){var a=f.query("[widgetId]",this.dropDownContainer)[0];this.dropDown=e.byNode(a);delete this.dropDownContainer}this.dropDown&&e.popup.hide(this.dropDown);this.inherited(arguments)}},isLoaded:function(){var a=this.dropDown;return!!a&&(!a.href||a.isLoaded)},loadDropDown:function(){var a=this.dropDown;
if(a)if(this.isLoaded())this.openDropDown();else{var c=f.connect(a,"onLoad",this,function(){f.disconnect(c);this.openDropDown()});a.refresh()}},isFocusable:function(){return this.inherited(arguments)&&!this._mouseDown}});f.declare("dijit.form.ComboButton",e.form.DropDownButton,{templateString:f.cache("dijit.form","templates/ComboButton.html"),attributeMap:f.mixin(f.clone(e.form.Button.prototype.attributeMap),{id:"",tabIndex:["focusNode","titleNode"],title:"titleNode"}),optionsTitle:"",baseClass:"dijitComboButton",
cssStateNodes:{buttonNode:"dijitButtonNode",titleNode:"dijitButtonContents",_popupStateNode:"dijitDownArrowButton"},_focusedNode:null,_onButtonKeyPress:function(a){if(a.charOrCode==f.keys[this.isLeftToRight()?"RIGHT_ARROW":"LEFT_ARROW"]){e.focus(this._popupStateNode);f.stopEvent(a)}},_onArrowKeyPress:function(a){if(a.charOrCode==f.keys[this.isLeftToRight()?"LEFT_ARROW":"RIGHT_ARROW"]){e.focus(this.titleNode);f.stopEvent(a)}},focus:function(a){this.disabled||e.focus(a=="start"?this.titleNode:this._popupStateNode)}});
f.declare("dijit.form.ToggleButton",e.form.Button,{baseClass:"dijitToggleButton",checked:false,attributeMap:f.mixin(f.clone(e.form.Button.prototype.attributeMap),{checked:"focusNode"}),_clicked:function(){this.set("checked",!this.checked)},_setCheckedAttr:function(a,c){this._set("checked",a);f.attr(this.focusNode||this.domNode,"checked",a);e.setWaiState(this.focusNode||this.domNode,"pressed",a);this._handleOnChange(a,c)},setChecked:function(a){f.deprecated("setChecked("+a+") is deprecated. Use set('checked',"+
a+") instead.","","2.0");this.set("checked",a)},reset:function(){this._hasBeenBlurred=false;this.set("checked",this.params.checked||false)}});return e.form.Button});define("dijit/form/DropDownButton",["dojo","dijit","dijit/form/Button"],function(f,e){return e.form.DropDownButton});define("text!dijit/templates/TooltipDialog.html",function(){return'<div role="presentation" tabIndex="-1">\n\t<div class="dijitTooltipContainer" role="presentation">\n\t\t<div class ="dijitTooltipContents dijitTooltipFocusNode" dojoAttachPoint="containerNode" role="dialog"></div>\n\t</div>\n\t<div class="dijitTooltipConnector" role="presentation"></div>\n</div>'});
define("dijit/layout/_LayoutWidget",["dojo","dijit","dijit/_Widget","dijit/_Container","dijit/_Contained"],function(f,e){f.declare("dijit.layout._LayoutWidget",[e._Widget,e._Container,e._Contained],{baseClass:"dijitLayoutContainer",isLayoutContainer:true,buildRendering:function(){this.inherited(arguments);f.addClass(this.domNode,"dijitContainer")},startup:function(){if(!this._started){this.inherited(arguments);var a=this.getParent&&this.getParent();if(!(a&&a.isLayoutContainer)){this.resize();this.connect(f.isIE?
this.domNode:f.global,"onresize",function(){this.resize()})}}},resize:function(a,c){var d=this.domNode;if(a){f.marginBox(d,a);if(a.t)d.style.top=a.t+"px";if(a.l)d.style.left=a.l+"px"}c=c||{};f.mixin(c,a||{});if(!("h"in c)||!("w"in c))c=f.mixin(f.marginBox(d),c);a=f.getComputedStyle(d);var g=f._getMarginExtents(d,a),h=f._getBorderExtents(d,a);c=this._borderBox={w:c.w-(g.w+h.w),h:c.h-(g.h+h.h)};g=f._getPadExtents(d,a);this._contentBox={l:f._toPixelValue(d,a.paddingLeft),t:f._toPixelValue(d,a.paddingTop),
w:c.w-g.w,h:c.h-g.h};this.layout()},layout:function(){},_setupChild:function(a){f.addClass(a.domNode,this.baseClass+"-child "+(a.baseClass?this.baseClass+"-"+a.baseClass:""))},addChild:function(a){this.inherited(arguments);this._started&&this._setupChild(a)},removeChild:function(a){f.removeClass(a.domNode,this.baseClass+"-child"+(a.baseClass?" "+this.baseClass+"-"+a.baseClass:""));this.inherited(arguments)}});e.layout.marginBox2contentBox=function(a,c){var d=f.getComputedStyle(a),g=f._getMarginExtents(a,
d),h=f._getPadBorderExtents(a,d);return{l:f._toPixelValue(a,d.paddingLeft),t:f._toPixelValue(a,d.paddingTop),w:c.w-(g.w+h.w),h:c.h-(g.h+h.h)}};(function(){var a=function(d){return d.substring(0,1).toUpperCase()+d.substring(1)},c=function(d,g){var h=d.resize?d.resize(g):f.marginBox(d.domNode,g);if(h)f.mixin(d,h);else{f.mixin(d,f.marginBox(d.domNode));f.mixin(d,g)}};e.layout.layoutChildren=function(d,g,h,i,j){g=f.mixin({},g);f.addClass(d,"dijitLayoutContainer");h=f.filter(h,function(k){return k.region!=
"center"&&k.layoutAlign!="client"}).concat(f.filter(h,function(k){return k.region=="center"||k.layoutAlign=="client"}));f.forEach(h,function(k){var m=k.domNode,n=k.region||k.layoutAlign,p=m.style;p.left=g.l+"px";p.top=g.t+"px";p.position="absolute";f.addClass(m,"dijitAlign"+a(n));m={};if(i&&i==k.id)m[k.region=="top"||k.region=="bottom"?"h":"w"]=j;if(n=="top"||n=="bottom"){m.w=g.w;c(k,m);g.h-=k.h;if(n=="top")g.t+=k.h;else p.top=g.t+g.h+"px"}else if(n=="left"||n=="right"){m.h=g.h;c(k,m);g.w-=k.w;if(n==
"left")g.l+=k.w;else p.left=g.l+g.w+"px"}else if(n=="client"||n=="center")c(k,g)})}})();return e.layout._LayoutWidget});
define("dijit/layout/_ContentPaneResizeMixin",["dojo","dijit","dijit/_Contained","dijit/layout/_LayoutWidget"],function(f,e){f.declare("dijit.layout._ContentPaneResizeMixin",null,{doLayout:true,isContainer:true,isLayoutContainer:true,_startChildren:function(){f.forEach(this.getChildren(),function(a){a.startup();a._started=true})},startup:function(){if(!this._started){var a=e._Contained.prototype.getParent.call(this);this._childOfLayoutWidget=a&&a.isLayoutContainer;this._needLayout=!this._childOfLayoutWidget;
this.inherited(arguments);this._startChildren();this._isShown()&&this._onShow();this._childOfLayoutWidget||this.connect(f.isIE?this.domNode:f.global,"onresize",function(){this._needLayout=!this._childOfLayoutWidget;this.resize()})}},_checkIfSingleChild:function(){var a=f.query("> *",this.containerNode).filter(function(g){return g.tagName!=="SCRIPT"}),c=a.filter(function(g){return f.hasAttr(g,"data-dojo-type")||f.hasAttr(g,"dojoType")||f.hasAttr(g,"widgetId")}),d=f.filter(c.map(e.byNode),function(g){return g&&
g.domNode&&g.resize});if(a.length==c.length&&d.length==1)this._singleChild=d[0];else delete this._singleChild;f.toggleClass(this.containerNode,this.baseClass+"SingleChild",!!this._singleChild)},resize:function(a,c){!this._wasShown&&this.open!==false&&this._onShow();this._resizeCalled=true;this._scheduleLayout(a,c)},_scheduleLayout:function(a,c){if(this._isShown())this._layout(a,c);else{this._needLayout=true;this._changeSize=a;this._resultSize=c}},_layout:function(a,c){a&&f.marginBox(this.domNode,
a);var d=this.containerNode;if(d===this.domNode){c=c||{};f.mixin(c,a||{});if(!("h"in c)||!("w"in c))c=f.mixin(f.marginBox(d),c);this._contentBox=e.layout.marginBox2contentBox(d,c)}else this._contentBox=f.contentBox(d);this._layoutChildren();delete this._needLayout},_layoutChildren:function(){this.doLayout&&this._checkIfSingleChild();if(this._singleChild&&this._singleChild.resize){var a=this._contentBox||f.contentBox(this.containerNode);this._singleChild.resize({w:a.w,h:a.h})}else f.forEach(this.getChildren(),
function(c){c.resize&&c.resize()})},_isShown:function(){if(this._childOfLayoutWidget){if(this._resizeCalled&&"open"in this)return this.open;return this._resizeCalled}else if("open"in this)return this.open;else{var a=this.domNode,c=this.domNode.parentNode;return a.style.display!="none"&&a.style.visibility!="hidden"&&!f.hasClass(a,"dijitHidden")&&c&&c.style&&c.style.display!="none"}},_onShow:function(){this._needLayout&&this._layout(this._changeSize,this._resultSize);this.inherited(arguments);this._wasShown=
true}});return e.layout._ContentPaneResizeMixin});
define("dojo/html",["dojo","dojo/parser"],function(f){f.getObject("html",true,f);(function(){var e=0;f.html._secureForInnerHtml=function(a){return a.replace(/(?:\s*<!DOCTYPE\s[^>]+>|<title[^>]*>[\s\S]*?<\/title>)/ig,"")};f.html._emptyNode=f.empty;f.html._setNodeContent=function(a,c){f.empty(a);if(c){if(typeof c=="string")c=f._toDom(c,a.ownerDocument);if(!c.nodeType&&f.isArrayLike(c))for(var d=c.length,g=0;g<c.length;g=d==c.length?g+1:0)f.place(c[g],a,"last");else f.place(c,a,"last")}return a};f.declare("dojo.html._ContentSetter",
null,{node:"",content:"",id:"",cleanContent:false,extractContent:false,parseContent:false,parserScope:f._scopeName,startup:true,constructor:function(a,c){f.mixin(this,a||{});c=this.node=f.byId(this.node||c);if(!this.id)this.id=["Setter",c?c.id||c.tagName:"",e++].join("_")},set:function(a,c){if(undefined!==a)this.content=a;c&&this._mixin(c);this.onBegin();this.setContent();this.onEnd();return this.node},setContent:function(){var a=this.node;if(!a)throw new Error(this.declaredClass+": setContent given no node");
try{a=f.html._setNodeContent(a,this.content)}catch(c){var d=this.onContentError(c);try{a.innerHTML=d}catch(g){console.error("Fatal "+this.declaredClass+".setContent could not change content due to "+g.message,g)}}this.node=a},empty:function(){if(this.parseResults&&this.parseResults.length){f.forEach(this.parseResults,function(a){a.destroy&&a.destroy()});delete this.parseResults}f.html._emptyNode(this.node)},onBegin:function(){var a=this.content;if(f.isString(a)){if(this.cleanContent)a=f.html._secureForInnerHtml(a);
if(this.extractContent){var c=a.match(/<body[^>]*>\s*([\s\S]+)\s*<\/body>/im);if(c)a=c[1]}}this.empty();this.content=a;return this.node},onEnd:function(){this.parseContent&&this._parse();return this.node},tearDown:function(){delete this.parseResults;delete this.node;delete this.content},onContentError:function(a){return"Error occured setting content: "+a},_mixin:function(a){var c={},d;for(d in a)d in c||(this[d]=a[d])},_parse:function(){var a=this.node;try{var c={};f.forEach(["dir","lang","textDir"],
function(g){if(this[g])c[g]=this[g]},this);this.parseResults=f.parser.parse({rootNode:a,noStart:!this.startup,inherited:c,scope:this.parserScope})}catch(d){this._onError("Content",d,"Error parsing in _ContentSetter#"+this.id)}},_onError:function(a,c,d){a=this["on"+a+"Error"].call(this,c);if(d)console.error(d,c);else a&&f.html._setNodeContent(this.node,a,true)}});f.html.set=function(a,c,d){if(undefined==c){console.warn("dojo.html.set: no cont argument provided, using empty string");c=""}return d?(new f.html._ContentSetter(f.mixin(d,
{content:c,node:a}))).set():f.html._setNodeContent(a,c,true)}})();return f.html});define("dijit/nls/loading",{root:{loadingState:"Loading...",errorState:"Sorry, an error occurred"},zh:true,"zh-tw":true,tr:true,th:true,sv:true,sl:true,sk:true,ru:true,ro:true,pt:true,"pt-pt":true,pl:true,nl:true,nb:true,ko:true,kk:true,ja:true,it:true,hu:true,he:true,fr:true,fi:true,es:true,el:true,de:true,da:true,cs:true,ca:true,ar:true});
define("dijit/layout/ContentPane",["dojo","dijit","dijit/_Widget","dijit/layout/_ContentPaneResizeMixin","dojo/string","dojo/html","i18n!dijit/nls/loading"],function(f,e){f.declare("dijit.layout.ContentPane",[e._Widget,e.layout._ContentPaneResizeMixin],{href:"",extractContent:false,parseOnLoad:true,parserScope:f._scopeName,preventCache:false,preload:false,refreshOnShow:false,loadingMessage:"<span class='dijitContentPaneLoading'>${loadingState}</span>",errorMessage:"<span class='dijitContentPaneError'>${errorState}</span>",
isLoaded:false,baseClass:"dijitContentPane",ioArgs:{},onLoadDeferred:null,attributeMap:f.delegate(e._Widget.prototype.attributeMap,{title:[]}),stopParser:true,template:false,create:function(a,c){if((!a||!a.template)&&c&&!("href"in a)&&!("content"in a)){var d=f.doc.createDocumentFragment();for(c=f.byId(c);c.firstChild;)d.appendChild(c.firstChild);a=f.delegate(a,{content:d})}this.inherited(arguments,[a,c])},postMixInProperties:function(){this.inherited(arguments);var a=f.i18n.getLocalization("dijit",
"loading",this.lang);this.loadingMessage=f.string.substitute(this.loadingMessage,a);this.errorMessage=f.string.substitute(this.errorMessage,a)},buildRendering:function(){this.inherited(arguments);if(!this.containerNode)this.containerNode=this.domNode;this.domNode.title="";f.attr(this.domNode,"role")||e.setWaiRole(this.domNode,"group")},_startChildren:function(){this.inherited(arguments);this._contentSetter&&f.forEach(this._contentSetter.parseResults,function(a){if(!a._started&&!a._destroyed&&f.isFunction(a.startup)){a.startup();
a._started=true}},this)},setHref:function(a){f.deprecated("dijit.layout.ContentPane.setHref() is deprecated. Use set('href', ...) instead.","","2.0");return this.set("href",a)},_setHrefAttr:function(a){this.cancel();this.onLoadDeferred=new f.Deferred(f.hitch(this,"cancel"));this.onLoadDeferred.addCallback(f.hitch(this,"onLoad"));this._set("href",a);if(this.preload||this._created&&this._isShown())this._load();else this._hrefChanged=true;return this.onLoadDeferred},setContent:function(a){f.deprecated("dijit.layout.ContentPane.setContent() is deprecated.  Use set('content', ...) instead.",
"","2.0");this.set("content",a)},_setContentAttr:function(a){this._set("href","");this.cancel();this.onLoadDeferred=new f.Deferred(f.hitch(this,"cancel"));this._created&&this.onLoadDeferred.addCallback(f.hitch(this,"onLoad"));this._setContent(a||"");this._isDownloaded=false;return this.onLoadDeferred},_getContentAttr:function(){return this.containerNode.innerHTML},cancel:function(){this._xhrDfd&&this._xhrDfd.fired==-1&&this._xhrDfd.cancel();delete this._xhrDfd;this.onLoadDeferred=null},uninitialize:function(){this._beingDestroyed&&
this.cancel();this.inherited(arguments)},destroyRecursive:function(){this._beingDestroyed||this.inherited(arguments)},_onShow:function(){this.inherited(arguments);if(this.href)if(!this._xhrDfd&&(!this.isLoaded||this._hrefChanged||this.refreshOnShow))return this.refresh()},refresh:function(){this.cancel();this.onLoadDeferred=new f.Deferred(f.hitch(this,"cancel"));this.onLoadDeferred.addCallback(f.hitch(this,"onLoad"));this._load();return this.onLoadDeferred},_load:function(){this._setContent(this.onDownloadStart(),
true);var a=this,c={preventCache:this.preventCache||this.refreshOnShow,url:this.href,handleAs:"text"};f.isObject(this.ioArgs)&&f.mixin(c,this.ioArgs);var d=this._xhrDfd=(this.ioMethod||f.xhrGet)(c);d.addCallback(function(g){try{a._isDownloaded=true;a._setContent(g,false);a.onDownloadEnd()}catch(h){a._onError("Content",h)}delete a._xhrDfd;return g});d.addErrback(function(g){d.canceled||a._onError("Download",g);delete a._xhrDfd;return g});delete this._hrefChanged},_onLoadHandler:function(a){this._set("isLoaded",
true);try{this.onLoadDeferred.callback(a)}catch(c){console.error("Error "+this.widgetId+" running custom onLoad code: "+c.message)}},_onUnloadHandler:function(){this._set("isLoaded",false);try{this.onUnload()}catch(a){console.error("Error "+this.widgetId+" running custom onUnload code: "+a.message)}},destroyDescendants:function(){this.isLoaded&&this._onUnloadHandler();var a=this._contentSetter;f.forEach(this.getChildren(),function(c){c.destroyRecursive&&c.destroyRecursive()});if(a){f.forEach(a.parseResults,
function(c){c.destroyRecursive&&c.domNode&&c.domNode.parentNode==f.body()&&c.destroyRecursive()});delete a.parseResults}f.html._emptyNode(this.containerNode);delete this._singleChild},_setContent:function(a,c){this.destroyDescendants();var d=this._contentSetter;if(!(d&&d instanceof f.html._ContentSetter))d=this._contentSetter=new f.html._ContentSetter({node:this.containerNode,_onError:f.hitch(this,this._onError),onContentError:f.hitch(this,function(h){h=this.onContentError(h);try{this.containerNode.innerHTML=
h}catch(i){console.error("Fatal "+this.id+" could not change content due to "+i.message,i)}})});var g=f.mixin({cleanContent:this.cleanContent,extractContent:this.extractContent,parseContent:this.parseOnLoad,parserScope:this.parserScope,startup:false,dir:this.dir,lang:this.lang},this._contentSetterParams||{});d.set(f.isObject(a)&&a.domNode?a.domNode:a,g);delete this._contentSetterParams;this.doLayout&&this._checkIfSingleChild();if(!c){if(this._started){this._startChildren();this._scheduleLayout()}this._onLoadHandler(a)}},
_onError:function(a,c,d){this.onLoadDeferred.errback(c);a=this["on"+a+"Error"].call(this,c);if(d)console.error(d,c);else a&&this._setContent(a,true)},onLoad:function(){},onUnload:function(){},onDownloadStart:function(){return this.loadingMessage},onContentError:function(){},onDownloadError:function(){return this.errorMessage},onDownloadEnd:function(){}});return e.layout.ContentPane});
define("dijit/form/_FormMixin",["dojo","dijit","dojo/window"],function(f,e){f.declare("dijit.form._FormMixin",null,{state:"",reset:function(){f.forEach(this.getDescendants(),function(a){a.reset&&a.reset()})},validate:function(){var a=false;return f.every(f.map(this.getDescendants(),function(c){c._hasBeenBlurred=true;var d=c.disabled||!c.validate||c.validate();if(!d&&!a){f.window.scrollIntoView(c.containerNode||c.domNode);c.focus();a=true}return d}),function(c){return c})},setValues:function(a){f.deprecated(this.declaredClass+
"::setValues() is deprecated. Use set('value', val) instead.","","2.0");return this.set("value",a)},_setValueAttr:function(a){var c={};f.forEach(this.getDescendants(),function(i){if(i.name)(c[i.name]||(c[i.name]=[])).push(i)});for(var d in c)if(c.hasOwnProperty(d)){var g=c[d],h=f.getObject(d,false,a);if(h!==undefined){f.isArray(h)||(h=[h]);if(typeof g[0].checked=="boolean")f.forEach(g,function(i){i.set("value",f.indexOf(h,i.value)!=-1)});else g[0].multiple?g[0].set("value",h):f.forEach(g,function(i,
j){i.set("value",h[j])})}}},getValues:function(){f.deprecated(this.declaredClass+"::getValues() is deprecated. Use get('value') instead.","","2.0");return this.get("value")},_getValueAttr:function(){var a={};f.forEach(this.getDescendants(),function(c){var d=c.name;if(!(!d||c.disabled)){var g=c.get("value");if(typeof c.checked=="boolean")if(/Radio/.test(c.declaredClass))if(g!==false)f.setObject(d,g,a);else{g=f.getObject(d,false,a);g===undefined&&f.setObject(d,null,a)}else{c=f.getObject(d,false,a);
if(!c){c=[];f.setObject(d,c,a)}g!==false&&c.push(g)}else{c=f.getObject(d,false,a);if(typeof c!="undefined")f.isArray(c)?c.push(g):f.setObject(d,[c,g],a);else f.setObject(d,g,a)}}});return a},isValid:function(){return this.state==""},onValidStateChange:function(){},_getState:function(){var a=f.map(this._descendants,function(c){return c.get("state")||""});return f.indexOf(a,"Error")>=0?"Error":f.indexOf(a,"Incomplete")>=0?"Incomplete":""},disconnectChildren:function(){f.forEach(this._childConnections||
[],f.hitch(this,"disconnect"));f.forEach(this._childWatches||[],function(a){a.unwatch()})},connectChildren:function(a){var c=this;this.disconnectChildren();this._descendants=this.getDescendants();a=a?function(i,j){c[i]=j}:f.hitch(this,"_set");a("value",this.get("value"));a("state",this._getState());var d=this._childConnections=[],g=this._childWatches=[];f.forEach(f.filter(this._descendants,function(i){return i.validate}),function(i){f.forEach(["state","disabled"],function(j){g.push(i.watch(j,function(){c.set("state",
c._getState())}))})});var h=function(){c._onChangeDelayTimer&&clearTimeout(c._onChangeDelayTimer);c._onChangeDelayTimer=setTimeout(function(){delete c._onChangeDelayTimer;c._set("value",c.get("value"))},10)};f.forEach(f.filter(this._descendants,function(i){return i.onChange}),function(i){d.push(c.connect(i,"onChange",h));g.push(i.watch("disabled",h))})},startup:function(){this.inherited(arguments);this.connectChildren(true);this.watch("state",function(a,c,d){this.onValidStateChange(d=="")})},destroy:function(){this.disconnectChildren();
this.inherited(arguments)}});return e.form._FormMixin});
define("dijit/_DialogMixin",["dojo","dijit","dijit/_Widget"],function(f,e){f.declare("dijit._DialogMixin",null,{attributeMap:e._Widget.prototype.attributeMap,execute:function(){},onCancel:function(){},onExecute:function(){},_onSubmit:function(){this.onExecute();this.execute(this.get("value"))},_getFocusItems:function(){var a=e._getTabNavigable(this.containerNode);this._firstFocusItem=a.lowest||a.first||this.closeButtonNode||this.domNode;this._lastFocusItem=a.last||a.highest||this._firstFocusItem}});
return e._DialogMixin});
define("dijit/TooltipDialog",["dojo","dijit","text!dijit/templates/TooltipDialog.html","dijit/layout/ContentPane","dijit/_Templated","dijit/form/_FormMixin","dijit/_DialogMixin"],function(f,e){f.declare("dijit.TooltipDialog",[e.layout.ContentPane,e._Templated,e.form._FormMixin,e._DialogMixin],{title:"",doLayout:false,autofocus:true,baseClass:"dijitTooltipDialog",_firstFocusItem:null,_lastFocusItem:null,templateString:f.cache("dijit","templates/TooltipDialog.html"),_setTitleAttr:function(a){this.containerNode.title=a;
this._set("title",a)},postCreate:function(){this.inherited(arguments);this.connect(this.containerNode,"onkeypress","_onKey")},orient:function(a,c,d){a="dijitTooltipAB"+(d.charAt(1)=="L"?"Left":"Right")+" dijitTooltip"+(d.charAt(0)=="T"?"Below":"Above");f.replaceClass(this.domNode,a,this._currentOrientClass||"");this._currentOrientClass=a},focus:function(){this._getFocusItems(this.containerNode);e.focus(this._firstFocusItem)},onOpen:function(a){this.orient(this.domNode,a.aroundCorner,a.corner);this._onShow()},
onClose:function(){this.onHide()},_onKey:function(a){var c=a.target,d=f.keys;a.charOrCode===d.TAB&&this._getFocusItems(this.containerNode);var g=this._firstFocusItem==this._lastFocusItem;if(a.charOrCode==d.ESCAPE){setTimeout(f.hitch(this,"onCancel"),0);f.stopEvent(a)}else if(c==this._firstFocusItem&&a.shiftKey&&a.charOrCode===d.TAB){g||e.focus(this._lastFocusItem);f.stopEvent(a)}else if(c==this._lastFocusItem&&a.charOrCode===d.TAB&&!a.shiftKey){g||e.focus(this._firstFocusItem);f.stopEvent(a)}else a.charOrCode===
d.TAB&&a.stopPropagation()}});return e.TooltipDialog});
define("orion/commands",["require","dojo","dijit","orion/util","orion/PageUtil","dijit/Menu","dijit/form/DropDownButton","dijit/MenuItem","dijit/PopupMenuItem","dijit/MenuSeparator","dijit/Tooltip","dijit/TooltipDialog"],function(f,e,a,c,d){function g(u,t,y,B,D){this.commandService=u;this.handler=t;this.items=y;this.userData=B;this.command=D;if(D.parameters)this.parameters=D.parameters.makeCopy();this.id=D.id}function h(u){this._domScope={};this._objectScope={};this._globalScope={};this._namedGroups=
{};this._ungrouped={};this._topics={};this._activeBindings={};this._urlBindings={};this._init(u);this._parameterCollector=null}function i(u,t,y){e.addClass(t,"commandImage");var B;if(u.imageClass){B=e.create("span",{},t,"last");e.addClass(B,u.spriteClass);e.addClass(B,u.imageClass)}else{B=new Image;B.alt=u.name;B.name=y;B.id=y;B.src=u.image;e.place(B,t,"last")}return B}function j(u){this._init(u)}function k(u,t,y,B,D){this.keyCode=typeof u==="string"?u.toUpperCase().charCodeAt(0):u;this.mod1=t!==
undefined&&t!==null?t:false;this.mod2=y!==undefined&&y!==null?y:false;this.mod3=B!==undefined&&B!==null?B:false;this.mod4=D!==undefined&&D!==null?D:false}function m(u,t){this.token=u;this.parameterName=t}function n(u,t,y,B){this.name=u;this.type=t;this.label=y;this.value=B}function p(u,t,y){this._storeParameters(u);this.options=t;this.optionsRequested=false;this.getParameters=y}g.prototype={collectsParameters:function(){return this.commandService&&this.commandService.collectsParameters()}};g.prototype.constructor=
g;var r=e.declare(a.MenuItem,{_onClick:function(){this.hrefCallback||this.inherited(arguments)}}),w=e.declare(a.Tooltip,{constructor:function(){this.inherited(arguments);this.options=arguments[0]||{}},_onUnHover:function(){if(this._showTimer){window.clearTimeout(this._showTimer);delete this._showTimer}this.polling=false;this.close()},_onHover:function(){this.inherited(arguments);this.polling=true;this.pollForMissingTarget()},pollForMissingTarget:function(){this.polling&&window.setTimeout(e.hitch(this,
function(){if(this._stillInDocument(this._connectNode))this.pollForMissingTarget();else{this.polling=false;this.close()}}),1E3)},_stillInDocument:function(u){for(;u;){if(u===window.document)return true;u=u.parentNode}return false},postMixInProperties:function(){this.inherited(arguments);this.options.commandParent&&a.byId(this.options.commandParent.id)&&e.connect(this.options.commandParent,"onClose",e.hitch(this,function(){this.close()}))}});h.prototype={_init:function(u){this._registry=u.serviceRegistry;
this._serviceRegistration=this._registry.registerService("orion.page.command",this);this._selection=u.selection;e.connect(window.document,"onkeydown",e.hitch(this,function(t){t=t||window.event;var y=t.target.nodeName.toLowerCase();if(y==="input")switch(t.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(y===
"textarea")return;this._processKey(t)}))},_processKey:function(u){function t(o){if(window.document.all)o.keyCode=0;else{o.preventDefault();o.stopPropagation()}}for(var y in this._activeBindings)if(this._activeBindings[y]&&this._activeBindings[y].keyBinding&&this._activeBindings[y].command)if(this._activeBindings[y].keyBinding.match(u)){var B=this._activeBindings[y],D=B.invocation;if(D){var l=B.command;if(l.hrefCallback){t(u);u=l.hrefCallback.call(D.handler||window,D);u.then?u.then(function(o){window.open(o)}):
window.open(u);return}else if(l.callback){t(u);window.setTimeout(e.hitch(this,function(){D.parameters&&this.collectsParameters()?this._collectParameters(D):l.callback.call(D.handler||window,D)}),0);return}}}},processURL:function(u){for(var t in this._urlBindings)if(this._urlBindings[t]&&this._urlBindings[t].urlBinding&&this._urlBindings[t].command){var y=this._urlBindings[t].urlBinding.match(u);if(y){var B=this._urlBindings[t],D=B.command,l=B.invocation;if(l&&l.parameters&&D.callback){l.parameters.setValue(y.parameterName,
y.parameterValue);window.setTimeout(e.hitch(this,function(){this._collectParameters(l)}),0);return}}}},findCommand:function(u){return this._objectScope[u]||this._domScope[u]||this._globalScope[u]},runCommand:function(u){var t=this._urlBindings[u];t&&t.command&&t.command.callback&&window.setTimeout(e.hitch(this,function(){this._collectParameters(t.invocation)}),0)},getSelectionService:function(){return this._selection},setParameterCollector:function(u){this._parameterCollector=u},openParameterCollector:function(u,
t){if(this._parameterCollector){this._parameterCollector.close();this._parameterCollector.open(u,t)}},closeParameterCollector:function(){this._parameterCollector&&this._parameterCollector.close()},collectsParameters:function(){return this._parameterCollector},_collectParameters:function(u){var t=false;if(this._parameterCollector){u.parameters.updateParameters(u);t=u.parameters.hasParameters()?this._parameterCollector.collectParameters(u):false}if(!t&&u.parameters.hasParameters()){var y=new a.TooltipDialog({onBlur:function(){a.popup.close(y)}}),
B=e.create("div"),D=this._parameterCollector.getFillFunction(u,function(){a.popup.close(y)})(B);y.set("content",B);B=(B=a.byId(u.domParent.id))?e.position(B.eclipseScopeId,true):e.position(u.domNode,true);if(B.x&&B.y&&B.w){a.popup.open({popup:y,x:B.x+B.w-8,y:B.y+8});window.setTimeout(function(){D.focus();D.select()},0);t=true}}if(!t){u.parameters=null;u.command.callback.call(u.handler,u)}},showKeyBindings:function(u){for(var t in this._activeBindings)this._activeBindings[t]&&this._activeBindings[t].keyBinding&&
this._activeBindings[t].command&&e.place('<span role="listitem">'+c.getUserKeyString(this._activeBindings[t].keyBinding)+" = "+this._activeBindings[t].command.name+"<br></span>",u,"last")},addCommand:function(u,t){switch(t){case "dom":this._domScope[u.id]=u;break;case "object":this._objectScope[u.id]=u;break;case "global":this._globalScope[u.id]=u;break;default:throw"unrecognized command scope "+t;}},addCommandGroup:function(u,t,y,B,D){var l=this._namedGroups;if(B)l=this._createEntryForPath(B);if(l[u]){if(y)l[u].title=
y;if(t)l[u].position=t;if(D)l[u].scopeId=D}else{l[u]={title:y,position:t,children:{},scopeId:D};l.sortedCommands=null}},_createEntryForPath:function(u){var t=this._namedGroups;if(u){u=u.split("/");for(var y=0;y<u.length;y++)if(u[y].length>1){t[u[y]]||(t[u[y]]={position:0,children:{}});t=t[u[y]].children}}return t},registerCommandContribution:function(u,t,y,B,D,l,o){B=!y&&!B?this._ungrouped:this._createEntryForPath(B);B[u]={scopeId:y,position:t};if(l)if(t=this._domScope[u]||this._globalScope[u])this._activeBindings[u]=
{command:t,keyBinding:l,bindingOnly:D};if(o)if(t=this._domScope[u]||this._globalScope[u])this._urlBindings[u]={command:t,urlBinding:o,bindingOnly:D};B.sortedCommands=null},_isLastChildSeparator:function(u,t){if(t==="tool"||t==="button")return u.childNodes.length>0&&e.hasClass(u.childNodes[u.childNodes.length-1],"commandSeparator");if(t==="menu"){u=u.getChildren();return u.length>0&&u[u.length-1]instanceof a.MenuSeparator}return false},renderCommands:function(u,t,y,B,D,l,o,q,v){if(typeof u==="string")u=
e.byId(u);if(u){if(!u.id||u.id==="")window.console.log("renderCommands: "+t+","+D+">> WARNING: command parent must have an id")}else throw"no parent";if(y){var x;if(t==="object"){x=this._objectScope;this._render(this._ungrouped,u,t,y,B,D,l,o,x,q,v)}else if(t==="dom")x=this._domScope;else if(t==="global")x=this._globalScope;else throw"Unrecognized command scope "+t;this._render(this._namedGroups,u,t,y,B,D,l,o,x,q,v);if(D==="tool"||D==="button")this._isLastChildSeparator(u,D)&&u.removeChild(u.childNodes[u.childNodes.length-
1]);else if(D==="menu")if(this._isLastChildSeparator(u,D)){y=u.getChildren()[u.getChildren().length-1];u.removeChild(y);y.destroy()}if(t==="dom"||t==="global")c.forceLayout(u)}else{var z=this;this._selection&&this._selection.getSelections(function(C){z.renderCommands(u,t,C,B,D,l,o,q,v)})}},_render:function(u,t,y,B,D,l,o,q,v,x,z){var C=u.sortedCommands;if(!C){C=[];for(var A in u){var F=u[A];if(F&&typeof F.position==="number"){F.id=A;C.push(F)}}C.sort(function(T,E){return T.position-E.position});u.sortedCommands=
C}for(u=0;u<C.length;u++){var H,N;if(C[u].children){A=C[u];if(!(A.scopeId&&t.id!==A.scopeId)){var I;if(l==="tool"||l==="button")if(A.title){H=new a.Menu({style:"display: none;"});H.eclipseScopeId=t.eclipseScopeId||t.id;this._render(C[u].children,H,y,B,D,"menu",o,q,v,x);I=H.getChildren();if(this._isLastChildSeparator(H,"menu")){F=I[I.length-1];H.removeChild(F);F.destroy();I=H.getChildren()}if(I.length>0){F=I[0].eclipseCommand;if(I.length>1){H=new a.form.DropDownButton({label:A.title==="*"?"Actions":
A.title,showLabel:A.title!=="*",dropDown:H});e.addClass(H.domNode,"commandMenu");e.destroy(H.valueNode);if(A.title==="*"){e.addClass(H.domNode,"textless");new w({connectId:[H.domNode],label:"Actions menu",position:["above","left","right","below"],commandParent:t,commandService:this})}F._setupActivateVisuals(H.domNode,H.focusNode,x,z);e.place(H.domNode,t,"last")}else{H=l+F.id+u;N=new g(this,D,B,q,F);l==="button"?F._addButton(t,o,H,N,x,z):F._addTool(t,o,H,N,x,z)}}}else{var O;if(t.childNodes.length>
0&&!this._isLastChildSeparator(t,l))O=this.generateSeparatorImage(t);this._render(C[u].children,t,y,B,D,l,o,q,v,x,z);if(t.childNodes.length>0)if(t.childNodes[t.childNodes.length-1]!==O)O=this.generateSeparatorImage(t)}else if(A.title){F=new a.Menu;this._render(C[u].children,F,y,B,D,l,o,q,v,x,z);F.getChildren().length>0&&t.addChild(new a.PopupMenuItem({label:A.title,popup:F}))}else{var M;if(t.getChildren().length>0&&!this._isLastChildSeparator(t,l)){M=new a.MenuSeparator;t.addChild(M)}this._render(C[u].children,
t,y,B,D,l,o,q,v,x,z);A=t.getChildren();if(A[A.length-1]!==M){M=new a.MenuSeparator;t.addChild(M)}}}}else{F=(A=v[C[u].id])?true:false;I=I=null;if(A){if(y==="dom"||y==="global")F=l==="tool"||l==="button"?t.id===C[u].scopeId:l==="menu"?t.eclipseScopeId===C[u].scopeId:false;else if(y==="object")F=!C[u].scopeId;var Q=F&&(y==="global"||y==="dom");N=new g(this,D,B,q,A);N.domParent=t;H=F&&(A.visibleWhen?A.visibleWhen(B):true);if(Q&&this._activeBindings[A.id]&&this._activeBindings[A.id].keyBinding){I=this._activeBindings[A.id];
I.invocation=H?N:null;if(I.bindingOnly)F=false}if(Q&&this._urlBindings[A.id]&&this._urlBindings[A.id].urlBinding){I=this._urlBindings[A.id];I.invocation=H?N:null;if(I.bindingOnly)F=false}F=F&&H}if(F)if(A.choiceCallback){F=new a.Menu({style:"display: none;"});if(l==="tool"||l==="button"){H=new a.form.DropDownButton({label:A.name,dropDown:F});if(A.image){e.addClass(H.iconNode,"commandImage");H.iconNode.src=A.image}e.place(H.domNode,t,"last");H.eclipseCommand=A;H.eclipseChoices=F;e.connect(H,"onClick",
H,function(){this.eclipseCommand.populateChoicesMenu(this.eclipseChoices,B,D,q)})}else if(l==="menu"){H=new a.PopupMenuItem({label:A.name,popup:F});t.addChild(H);H.eclipseCommand=A;H.eclipseChoices=F;e.connect(t,"_openPopup",H,function(){this.eclipseCommand.populateChoicesMenu(this.eclipseChoices,B,D,q)})}}else if(l==="tool"){H="tool"+A.id+u;A._addTool(t,o,H,N,x,z)}else if(l==="button"){H="button"+A.id+u;A._addButton(t,o,H,N,x,z)}else l==="menu"&&A._addMenuItem(t,N,x,z)}}},whenHidden:function(u,t){u=
typeof u==="string"?u:u.id;if(!this.hidden)this.hidden={};if(this.hidden[u])this.hidden[u].push(t);else this.hidden[u]=[t]},generateSeparatorImage:function(u){u=e.create("span",null,u,"last");e.addClass(u,"core-sprite-sep");e.addClass(u,"imageSprite");e.addClass(u,"commandSeparator");return u}};h.prototype.constructor=h;j.prototype={_init:function(u){this.id=u.id;this.name=u.name;this.tooltip=u.tooltip||u.name;this.callback=u.callback;this.hrefCallback=u.hrefCallback;this.choiceCallback=u.choiceCallback;
this.image=u.image||f.toUrl("images/none.png");this.imageClass=u.imageClass;this.spriteClass=u.spriteClass||"commandSprite";this.visibleWhen=u.visibleWhen;this.parameters=u.parameters},_addTool:function(u,t,y,B,D,l){B.handler=B.handler||this;var o,q;if(this.hrefCallback){o=this._makeLink(B);if(!o)return}else{o=e.create("span",{tabindex:"0",role:"button"});if(t||!this.hasImage()){t=window.document.createTextNode(this.name);e.place(t,o,"last");e.addClass(o,"commandMissingImageButton commandButton")}else{q=
i(this,o,y);this._addAccessibleLabel(o)}this._hookCallback(o,B);this._setupActivateVisuals(o,o,D,l,q?"commandImageOver":"commandButtonOver")}B.domNode=o;B.domParent=u;this.tooltip&&new w({connectId:[o],label:this.tooltip,position:["above","left","right","below"],commandParent:u,commandService:B.commandService});e.place(o,u,"last")},_addButton:function(u,t,y,B,D,l){B.handler=B.handler||this;if(this.hrefCallback){t=this._makeLink(B);if(!t)return}else{t=e.create("span",{tabindex:"0",role:"button"});
this._hookCallback(t,B);var o;if(this.name){e.place(window.document.createTextNode(this.name),t,"last");e.addClass(t,"commandButton");o="commandButtonOver"}else{i(this,t,y);o="commandImageOver";this._addAccessibleLabel(t)}this._setupActivateVisuals(t,t,D,l,o)}t.id=y;this.tooltip&&new w({connectId:[t],label:this.tooltip,position:["above","left","right","below"],commandParent:u,commandService:B.commandService});B.domParent=u;B.domNode=t;e.place(t,u,"last")},_addMenuItem:function(u,t){t.domParent=u.domNode;
var y=new r({labelType:this.hrefCallback?"html":"text",label:this.name,iconClass:this.imageClass,hrefCallback:!!this.hrefCallback});this.tooltip&&new w({connectId:[y.domNode],label:this.tooltip,commandParent:u,commandService:t.commandService});if(this.hrefCallback){var B=this.hrefCallback.call(t.handler,t);if(B)if(B.then)B.then(e.hitch(this,function(D){y.set("label","<a href='"+D+"'>"+this.name+"</a>")}));else if(B)y.set("label","<a href='"+B+"'>"+this.name+"</a>");else return}else if(this.callback)y.onClick=
this.parameters&&t.collectsParameters()?e.hitch(this,function(){t.commandService._collectParameters(t)}):e.hitch(this,function(){this.callback.call(t.handler,t)});y.eclipseCommand=this;u.addChild(y);if(this.imageClass)e.addClass(y.iconNode,this.spriteClass);else if(this.image){e.addClass(y.iconNode,"commandMenuItem");y.iconNode.src=this.image}t.domNode=y.domNode},_makeLink:function(u){var t=e.create("a",{tabindex:"0"});e.addClass(t,"commandLink");e.place(window.document.createTextNode(this.name),
t,"last");u=this.hrefCallback.call(u.handler,u);if(u.then)u.then(function(y){t.href=y});else if(u)t.href=u;else return null;return t},_hookCallback:function(u,t){e.connect(u,"onclick",this,function(){if(this.parameters&&t.collectsParameters())t.commandService._collectParameters(t);else this.callback&&this.callback.call(t.handler,t)});e.connect(u,"onkeypress",this,function(y){if(y.keyCode===e.keys.ENTER||y.keyCode===e.keys.SPACE)if(this.parameters&&t.collectsParameters())t.commandService._collectParameters(t);
else this.callback&&this.callback.call(t.handler,t)})},_addAccessibleLabel:function(u){var t=this.name||this.tooltip;t&&e.attr(u,"aria-label",t)},_setupActivateVisuals:function(u,t,y,B,D){B&&e.addClass(u,B);var l=function(){D&&e.addClass(this,D);y&&e.addClass(this,y);B&&e.removeClass(this,B)},o=function(){D&&e.removeClass(this,D);y&&e.removeClass(this,y);B&&e.addClass(this,B)};e.connect(u,"onmouseover",u,l);e.connect(t,"onfocus",u,l);e.connect(u,"onmouseout",u,o);e.connect(t,"onblur",u,o)},populateChoicesMenu:function(u,
t,y,B){u.focusedChild=null;e.forEach(u.getChildren(),function(o){u.removeChild(o);o.destroy()});y=this.getChoices(t,y,B);for(B=0;B<y.length;B++){var D=y[B],l;if(D.name){l=new a.MenuItem({label:D.name,iconClass:D.imageClass,onClick:this.makeChoiceCallback(D,t)});if(D.imageClass)e.addClass(l.iconNode,D.spriteClass||"commandSprite");else if(D.image){e.addClass(l.iconNode,"commandImage");l.iconNode.src=D.image}}else l=new a.MenuSeparator;u.addChild(l)}},getChoices:function(u,t,y){if(this.choiceCallback)return this.choiceCallback.call(t,
u,y);return null},makeChoiceCallback:function(u,t){return function(y){u.callback&&u.callback.call(u,t,y)}},hasImage:function(){return this.imageClass||this.image!==f.toUrl("images/none.png")}};j.prototype.constructor=j;var s=window.navigator.platform.indexOf("Mac")!==-1;k.prototype={match:function(u){if(this.keyCode===u.keyCode){if(this.mod1!==(s?u.metaKey:u.ctrlKey))return false;if(this.mod2!==u.shiftKey)return false;if(this.mod3!==u.altKey)return false;if(s&&this.mod4!==u.ctrlKey)return false;return true}return false},
equals:function(u){if(!u)return false;if(this.keyCode!==u.keyCode)return false;if(this.mod1!==u.mod1)return false;if(this.mod2!==u.mod2)return false;if(this.mod3!==u.mod3)return false;if(this.mod4!==u.mod4)return false;return true}};k.prototype.constructor=k;m.prototype={match:function(u){u=d.matchResourceParameters(u);if(typeof u[this.token]!=="undefined"){this.parameterValue=u[this.token];return this}return null}};m.prototype.constructor=m;n.prototype={optionsRequested:function(){return this.optionsRequested}};
n.prototype.constructor=n;p.prototype={_storeParameters:function(u){this.parameterTable=null;if(u){this.parameterTable={};for(var t=0;t<u.length;t++)this.parameterTable[u[t].name]=u[t]}},updateParameters:function(u){typeof this.getParameters==="function"&&this._storeParameters(this.getParameters(u))},hasParameters:function(){return this.parameterTable!==null},parameterNamed:function(u){return this.parameterTable[u]},valueFor:function(u){if(u=this.parameterTable[u])return u.value;return null},setValue:function(u,
t){if(u=this.parameterTable[u])u.value=t},forEach:function(u){for(var t in this.parameterTable)this.parameterTable[t].type&&this.parameterTable[t].name&&u(this.parameterTable[t])},makeCopy:function(){var u=[];this.forEach(function(t){t=new n(t.name,t.type,t.label,t.value);u.push(t)});return new p(u,this.options,this.getParameters)}};p.prototype.constructor=p;return{CommandService:h,CommandKeyBinding:k,Command:j,CommandInvocation:g,CommandMenuItem:r,URLBinding:m,ParametersDescription:p,CommandParameter:n,
CommandTooltip:w}});
define("orion/parameterCollectors",["require","dojo","dijit","orion/commands","orion/util","dijit/Menu","dijit/MenuItem","dijit/form/DropDownButton"],function(f,e,a,c,d){function g(){this._activeContainer=null}g.prototype={close:function(){if(this._activeElements){this._activeElements.parameterArea&&e.empty(this._activeElements.parameterArea);if(this._activeElements.parameterContainer){e.removeClass(this._activeElements.parameterContainer,"slideActive");e.removeClass(this._activeElements.slideContainer,"slideContainerActive")}this._activeElements.dismissArea&&
e.empty(this._activeElements.dismissArea);this._activeElements.commandNode&&e.removeClass(this._activeElements.commandNode,"activeCommand");d.forceLayout(this._activeElements.parameterContainer);if(this._oldFocusNode){this._oldFocusNode.focus();this._oldFocusNode=null}}this._activeElements=null},_findParameterElements:function(h){var i={},j=null;if(typeof h==="string")h=e.byId(h);for(var k=h;k;){if(e.hasClass(k,"toolComposite")){j=k;break}k=k.parentNode}if(e.hasClass(h,"commandMarker"))i.commandNode=
h;if(j){i.slideContainer=e.query(".slideParameters",j)[0];i.parameterContainer=e.query(".slide",j)[0];i.parameterArea=e.query(".parameters",j)[0];i.dismissArea=e.query(".parametersDismiss",j)[0]}return i},open:function(h,i){if(typeof h==="string")h=e.byId(h);this.close();this._activeElements=null;if((this._activeElements=this._findParameterElements(h))&&this._activeElements.parameterArea&&this._activeElements.slideContainer&&this._activeElements.parameterContainer){var j=i(this._activeElements.parameterArea);
h=e.query("#closebox",this._activeElements.parameterArea);if(h.length===0){h=e.create("span",{id:"closebox",role:"button",tabindex:"0"},this._activeElements.dismissArea||this._activeElements.parameterArea,"last");e.addClass(h,"imageSprite");e.addClass(h,"core-sprite-close");e.addClass(h,"dismiss");h.title="Close";e.connect(h,"onclick",e.hitch(this,function(){this.close(this._activeElements)}));e.connect(h,"onkeypress",e.hitch(this,function(k){k.keyCode===e.keys.ENTER&&this.close(this._activeElements)}))}e.addClass(this._activeElements.slideContainer,
"slideContainerActive");e.addClass(this._activeElements.parameterContainer,"slideActive");d.forceLayout(this._activeElements.parameterContainer);if(j){this._oldFocusNode=window.document.activeElement;window.setTimeout(function(){j.focus();j.select()},0)}this._activeElements.commandNode&&e.addClass(this._activeElements.commandNode,"activeCommand");return true}return false},_collectAndCall:function(h,i){e.query("input",i).forEach(function(j){j.type!=="button"&&h.parameters.setValue(j.parameterName,
j.value)});h.command.callback&&h.command.callback.call(h.handler,h)},collectParameters:function(h){if(h.parameters){h.domNode&&e.addClass(h.domNode,"commandMarker");return this.open(h.domNode||h.domParent,this.getFillFunction(h))}return false},getFillFunction:function(h,i){return e.hitch(this,function(j){var k=null,m=e.hitch(this,function(){i?i():this.close(h.domNode)}),n=e.hitch(this,function(w){w.keyCode===e.keys.ENTER&&this._collectAndCall(h,j);if(w.keyCode===e.keys.ESCAPE||w.keyCode===e.keys.ENTER){m();
e.stopEvent(w)}});h.parameters.forEach(function(w){w.label&&e.place(document.createTextNode(w.label),j,"last");var s=e.create("input",{type:w.type},j,"last");e.addClass(s,"parameterInput");e.addClass(s,"parameterInput"+w.type);s.setAttribute("speech","speech");s.setAttribute("x-webkit-speech","x-webkit-speech");s.parameterName=w.name;k||(k=s);if(w.value)s.value=w.value;e.connect(s,"onkeypress",n)});var p=function(w){w._collectAndCall(h,j);m()};if(h.parameters.options){h.parameters.optionsRequested=
false;var r=e.create("span",{role:"button",tabindex:"0"},j,"last");e.place(window.document.createTextNode("More"),r,"last");e.addClass(r,"dismiss");e.connect(r,"onclick",e.hitch(this,function(){h.parameters.optionsRequested=true;p(this)}));e.connect(r,"onkeypress",e.hitch(this,function(w){if(w.keyCode===e.keys.ENTER){h.parameters.optionsRequested=true;p(this)}}))}spacer=e.create("span",null,j,"last");e.addClass(spacer,"dismiss");r=e.create("span",{role:"button",tabindex:"0"},j,"last");e.place(window.document.createTextNode("Submit"),
r,"last");e.addClass(r,"dismiss");e.connect(r,"onclick",e.hitch(this,function(){p(this)}));e.connect(r,"onkeypress",e.hitch(this,function(w){w.keyCode===e.keys.ENTER&&p(this)}));spacer=e.create("span",null,j,"last");e.addClass(spacer,"dismiss");r=e.create("span",{id:"closebox",role:"button",tabindex:"0"},j,"last");e.addClass(r,"imageSprite");e.addClass(r,"core-sprite-close");e.addClass(r,"dismiss");r.title="Close";e.connect(r,"onclick",e.hitch(this,function(){m()}));e.connect(r,"onkeypress",e.hitch(this,
function(w){w.keyCode===e.keys.ENTER&&m()}));return k})}};g.prototype.constructor=g;return{CommandParameterCollector:g}});define("orion/editor/regex",[],function(){function f(a){return a.replace(/([\\$\^*\/+?\.\(\)|{}\[\]])/g,"\\$&")}function e(a){if(a=/^\s*\/(.+)\/([gim]{0,3})\s*$/.exec(a))return{pattern:a[1],flags:a[2]};return null}return{escape:f,parse:e}});
define("orion/contentTypes",[],function(){function f(a){function c(k,m,n,p){n=m.filename.indexOf(n)>=0;var r=m.extension.indexOf(p)>=0;if(n||r)if(!k||n&&k.extension.indexOf(p)>=0)return m;return k}for(var d=a&&a.split(".").pop(),g=this.getContentTypes(),h=null,i=0;i<g.length;i++){var j=g[i];if(c(h,j,a,d)===j)h=j}return h}function e(a){function c(d){function g(n){if(n===null||typeof n==="undefined")return[];return n instanceof Array?n:[n]}d=d.getServiceReferences("orion.file.contenttype");for(var h=
{},i=0;i<d.length;i++)for(var j=g(d[i].getProperty("contentTypes")),k=0;k<j.length;k++){var m=j[k];h[m.id]||(h[m.id]={id:m.id,name:m.name,image:m.image,"extends":m["extends"],extension:g(m.extension),filename:g(m.filename)})}return h}this.serviceRegistry=a;this.map=c(a);a.registerService("orion.file.contenttypes",this)}e.prototype={getContentTypes:function(){var a=this.getContentTypesMap(),c=[];for(var d in a)a.hasOwnProperty(d)&&c.push(a[d]);return c},getContentTypesMap:function(){return this.map},
getFileContentType:function(a){return f.call(this,a.Name)},getFilenameContentType:function(a){return f.call(this,a)},getContentType:function(a){return this.map[a]||null},isExtensionOf:function(a,c){a=typeof a==="string"?this.getContentType(a):a;c=typeof c==="string"?this.getContentType(c):c;if(!a||!c)return false;if(a.id===c.id)return true;else{a=a;for(var d={};a&&(a=this.getContentType(a["extends"]));){if(a.id===c.id)return true;if(d[a.id])throw new Error("Cycle: "+a.id);d[a.id]=true}}return false},
isSomeExtensionOf:function(a,c){for(var d=0;d<c.length;d++)if(this.isExtensionOf(a,c[d]))return true;return false}};return{ContentTypeService:e}});
define("orion/URITemplate",["require","exports","module"],function(){function f(m){this._text=m}function e(m,n){if(n==="U")return encodeURIComponent(m).replace(/[!'()*]/g,function(p){return"%"+p.charCodeAt(0).toString(16).toUpperCase()});if(n==="U+R")return encodeURI(m).replace(/%5B/g,"[").replace(/%5D/g,"]");if(n==="U+R-,")return encodeURI(m).replace(/%5B/g,"[").replace(/%5D/g,"]").replace(/,/g,"%2C");throw new Error("Unknown allowed character set: "+n);}function a(m,n,p){for(var r=[],w=0;w<m.length;w++)typeof m[w]!==
"undefined"&&r.push(e(m[w],n));return r.join(p)}function c(m,n,p,r){for(var w=Object.keys(m),s=[],u=0;u<w.length;u++)typeof m[w[u]]!=="undefined"&&s.push(e(w[u],n)+p+e(m[w[u]],n));return s.join(r)}function d(m){for(var n=[],p=m.split(","),r=0;r<p.length;r++){var w=p[r].match(k);if(w===null)throw new Error("Bad VarSpec: "+m);n.push({name:w[1],explode:!!w[2],prefix:w[3]?parseInt(w[3],10):-1})}return n}function g(m){if(m.length===0)throw new Error("Invalid Expression: 0 length expression");if(this._operator=
j[m[0]])m=m.substring(1);else this._operator=j.NUL;this._varSpecList=d(m)}function h(m){for(var n=[],p=0,r=m.indexOf("{",p);r!==-1;){n.push(new f(m.substring(p,r)));p=m.indexOf("}",r+1);if(p===-1)throw new Error("Invalid template: "+m);n.push(new g(m.substring(r+1,p)));p=p+1;r=m.indexOf("{",p)}n.push(new f(m.substring(p)));return n}function i(m){this._templateComponents=h(m)}var j={NUL:{first:"",sep:",",named:false,ifemp:"",allow:"U"},"+":{first:"",sep:",",named:false,ifemp:"",allow:"U+R"},".":{first:".",
sep:",",named:false,ifemp:"",allow:"U"},"/":{first:"/",sep:"/",named:false,ifemp:"",allow:"U"},";":{first:";",sep:";",named:true,ifemp:"",allow:"U"},"?":{first:"?",sep:"&",named:true,ifemp:"=",allow:"U"},"&":{first:"&",sep:"&",named:true,ifemp:"=",allow:"U"},"#":{first:"#",sep:",",named:false,ifemp:"",allow:"U+R"},",":{first:"",sep:",",named:false,ifemp:"",allow:"U+R-,"}},k=/^((?:(?:[a-zA-Z0-9_])|(?:%[0-9A-F][0-9A-F]))(?:(?:[a-zA-Z0-9_.])|(?:%[0-9A-F][0-9A-F]))*)(?:(\*)|:([0-9]+))?$/;f.prototype=
{expand:function(){return encodeURI(this._text)}};g.prototype={expand:function(m){for(var n=[],p=0;p<this._varSpecList.length;p++){var r=this._varSpecList[p],w=r.name,s=m[w],u=typeof s;if(u!=="undefined"&&s!==null){var t=n.length===0?this._operator.first:this._operator.sep;if(u==="string"){if(this._operator.named){t+=e(w,"U+R");t+=s.length===0?this._operator.ifemp:"="}if(r.prefix!==-1&&r.prefix<s.length)s=s.substring(0,r.prefix);t+=e(s,this._operator.allow)}else if(Array.isArray(s))if(r.explode)t+=
a(s,this._operator.allow,this._operator.sep);else{if(this._operator.named){t+=e(w,"U+R");t+=s.length===0?this._operator.ifemp:"="}t+=a(s,this._operator.allow,",")}else if(u==="object")if(r.explode)t+=c(s,this._operator.allow,"=",this._operator.sep);else{if(this._operator.named){t+=e(w,"U+R");t+=Object.keys(s).length===0?this._operator.ifemp:"="}t+=c(s,this._operator.allow,",",",")}else throw new Error("bad param type: "+w+" : "+u);n.push(t)}}return n.join("")}};i.prototype={expand:function(m){for(var n=
[],p=0;p<this._templateComponents.length;p++)n.push(this._templateComponents[p].expand(m));return n.join("")}};return i});define("text!dijit/templates/Dialog.html",function(){return'<div class="dijitDialog" role="dialog" aria-labelledby="${id}_title">\n\t<div dojoAttachPoint="titleBar" class="dijitDialogTitleBar">\n\t<span dojoAttachPoint="titleNode" class="dijitDialogTitle" id="${id}_title"></span>\n\t<span dojoAttachPoint="closeButtonNode" class="dijitDialogCloseIcon" dojoAttachEvent="ondijitclick: onCancel" title="${buttonCancel}" role="button" tabIndex="-1">\n\t\t<span dojoAttachPoint="closeText" class="closeText" title="${buttonCancel}">x</span>\n\t</span>\n\t</div>\n\t\t<div dojoAttachPoint="containerNode" class="dijitDialogPaneContent"></div>\n</div>'});
define("dojo/dnd/common",["dojo"],function(f){f.getObject("dnd",true,f);f.dnd.getCopyKeyState=f.isCopyKey;f.dnd._uniqueId=0;f.dnd.getUniqueId=function(){var e;do e=f._scopeName+"Unique"+ ++f.dnd._uniqueId;while(f.byId(e));return e};f.dnd._empty={};f.dnd.isFormElement=function(e){e=e.target;if(e.nodeType==3)e=e.parentNode;return" button textarea input select option ".indexOf(" "+e.tagName.toLowerCase()+" ")>=0};return f.dnd});
define("dojo/dnd/autoscroll",["dojo","dojo/window"],function(f){f.getObject("dnd",true,f);f.dnd.getViewport=f.window.getBox;f.dnd.V_TRIGGER_AUTOSCROLL=32;f.dnd.H_TRIGGER_AUTOSCROLL=32;f.dnd.V_AUTOSCROLL_VALUE=16;f.dnd.H_AUTOSCROLL_VALUE=16;f.dnd.autoScroll=function(e){var a=f.window.getBox(),c=0,d=0;if(e.clientX<f.dnd.H_TRIGGER_AUTOSCROLL)c=-f.dnd.H_AUTOSCROLL_VALUE;else if(e.clientX>a.w-f.dnd.H_TRIGGER_AUTOSCROLL)c=f.dnd.H_AUTOSCROLL_VALUE;if(e.clientY<f.dnd.V_TRIGGER_AUTOSCROLL)d=-f.dnd.V_AUTOSCROLL_VALUE;
else if(e.clientY>a.h-f.dnd.V_TRIGGER_AUTOSCROLL)d=f.dnd.V_AUTOSCROLL_VALUE;window.scrollBy(c,d)};f.dnd._validNodes={div:1,p:1,td:1};f.dnd._validOverflow={auto:1,scroll:1};f.dnd.autoScrollNodes=function(e){for(var a=e.target;a;){if(a.nodeType==1&&a.tagName.toLowerCase()in f.dnd._validNodes){var c=f.getComputedStyle(a);if(c.overflow.toLowerCase()in f.dnd._validOverflow){var d=f._getContentBox(a,c);c=f.position(a,true);var g=Math.min(f.dnd.H_TRIGGER_AUTOSCROLL,d.w/2),h=Math.min(f.dnd.V_TRIGGER_AUTOSCROLL,
d.h/2),i=e.pageX-c.x,j=e.pageY-c.y,k=c=0;if(f.isWebKit||f.isOpera){i+=f.body().scrollLeft;j+=f.body().scrollTop}if(i>0&&i<d.w)if(i<g)c=-g;else if(i>d.w-g)c=g;if(j>0&&j<d.h)if(j<h)k=-h;else if(j>d.h-h)k=h;d=a.scrollLeft;g=a.scrollTop;a.scrollLeft+=c;a.scrollTop+=k;if(d!=a.scrollLeft||g!=a.scrollTop)return}}try{a=a.parentNode}catch(m){a=null}}f.dnd.autoScroll(e)};return f.dnd});
define("dojo/dnd/Mover",["dojo","dojo/dnd/common","dojo/dnd/autoscroll"],function(f){f.declare("dojo.dnd.Mover",null,{constructor:function(e,a,c){this.node=f.byId(e);var d=a.touches?a.touches[0]:a;this.marginBox={l:d.pageX,t:d.pageY};this.mouseButton=a.button;a=this.host=c;e=e.ownerDocument;this.events=[f.connect(e,"onmousemove",this,"onFirstMove"),f.connect(e,"ontouchmove",this,"onFirstMove"),f.connect(e,"onmousemove",this,"onMouseMove"),f.connect(e,"ontouchmove",this,"onMouseMove"),f.connect(e,
"onmouseup",this,"onMouseUp"),f.connect(e,"ontouchend",this,"onMouseUp"),f.connect(e,"ondragstart",f.stopEvent),f.connect(e.body,"onselectstart",f.stopEvent)];a&&a.onMoveStart&&a.onMoveStart(this)},onMouseMove:function(e){f.dnd.autoScroll(e);var a=this.marginBox,c=e.touches?e.touches[0]:e;this.host.onMove(this,{l:a.l+c.pageX,t:a.t+c.pageY},e);f.stopEvent(e)},onMouseUp:function(e){if(f.isWebKit&&f.isMac&&this.mouseButton==2?e.button==0:this.mouseButton==e.button)this.destroy();f.stopEvent(e)},onFirstMove:function(e){var a=
this.node.style,c,d=this.host;switch(a.position){case "relative":case "absolute":c=Math.round(parseFloat(a.left))||0;a=Math.round(parseFloat(a.top))||0;break;default:a.position="absolute";a=f.marginBox(this.node);c=f.doc.body;var g=f.getComputedStyle(c),h=f._getMarginBox(c,g);g=f._getContentBox(c,g);c=a.l-(g.l-h.l);a=a.t-(g.t-h.t);break}this.marginBox.l=c-this.marginBox.l;this.marginBox.t=a-this.marginBox.t;d&&d.onFirstMove&&d.onFirstMove(this,e);f.disconnect(this.events.shift());f.disconnect(this.events.shift())},
destroy:function(){f.forEach(this.events,f.disconnect);var e=this.host;e&&e.onMoveStop&&e.onMoveStop(this);this.events=this.node=this.host=null}});return f.dnd.Mover});
define("dojo/dnd/Moveable",["dojo","dojo/dnd/Mover"],function(f){f.declare("dojo.dnd.Moveable",null,{handle:"",delay:0,skip:false,constructor:function(e,a){this.node=f.byId(e);a||(a={});this.handle=a.handle?f.byId(a.handle):null;if(!this.handle)this.handle=this.node;this.delay=a.delay>0?a.delay:0;this.skip=a.skip;this.mover=a.mover?a.mover:f.dnd.Mover;this.events=[f.connect(this.handle,"onmousedown",this,"onMouseDown"),f.connect(this.handle,"ontouchstart",this,"onMouseDown"),f.connect(this.handle,
"ondragstart",this,"onSelectStart"),f.connect(this.handle,"onselectstart",this,"onSelectStart")]},markupFactory:function(e,a){return new f.dnd.Moveable(a,e)},destroy:function(){f.forEach(this.events,f.disconnect);this.events=this.node=this.handle=null},onMouseDown:function(e){if(!(this.skip&&f.dnd.isFormElement(e))){if(this.delay){this.events.push(f.connect(this.handle,"onmousemove",this,"onMouseMove"),f.connect(this.handle,"ontouchmove",this,"onMouseMove"),f.connect(this.handle,"onmouseup",this,
"onMouseUp"),f.connect(this.handle,"ontouchend",this,"onMouseUp"));var a=e.touches?e.touches[0]:e;this._lastX=a.pageX;this._lastY=a.pageY}else this.onDragDetected(e);f.stopEvent(e)}},onMouseMove:function(e){var a=e.touches?e.touches[0]:e;if(Math.abs(a.pageX-this._lastX)>this.delay||Math.abs(a.pageY-this._lastY)>this.delay){this.onMouseUp(e);this.onDragDetected(e)}f.stopEvent(e)},onMouseUp:function(e){for(var a=0;a<2;++a)f.disconnect(this.events.pop());f.stopEvent(e)},onSelectStart:function(e){if(!this.skip||
!f.dnd.isFormElement(e))f.stopEvent(e)},onDragDetected:function(e){new this.mover(this.node,e,this)},onMoveStart:function(e){f.publish("/dnd/move/start",[e]);f.addClass(f.body(),"dojoMove");f.addClass(this.node,"dojoMoveItem")},onMoveStop:function(e){f.publish("/dnd/move/stop",[e]);f.removeClass(f.body(),"dojoMove");f.removeClass(this.node,"dojoMoveItem")},onFirstMove:function(){},onMove:function(e,a){this.onMoving(e,a);var c=e.node.style;c.left=a.l+"px";c.top=a.t+"px";this.onMoved(e,a)},onMoving:function(){},
onMoved:function(){}});return f.dnd.Moveable});
define("dojo/dnd/move",["dojo","dojo/dnd/Mover","dojo/dnd/Moveable"],function(f){f.declare("dojo.dnd.move.constrainedMoveable",f.dnd.Moveable,{constraints:function(){},within:false,markupFactory:function(e,a){return new f.dnd.move.constrainedMoveable(a,e)},constructor:function(e,a){a||(a={});this.constraints=a.constraints;this.within=a.within},onFirstMove:function(e){var a=this.constraintBox=this.constraints.call(this,e);a.r=a.l+a.w;a.b=a.t+a.h;if(this.within){e=f._getMarginSize(e.node);a.r-=e.w;
a.b-=e.h}},onMove:function(e,a){var c=this.constraintBox,d=e.node.style;this.onMoving(e,a);a.l=a.l<c.l?c.l:c.r<a.l?c.r:a.l;a.t=a.t<c.t?c.t:c.b<a.t?c.b:a.t;d.left=a.l+"px";d.top=a.t+"px";this.onMoved(e,a)}});f.declare("dojo.dnd.move.boxConstrainedMoveable",f.dnd.move.constrainedMoveable,{box:{},markupFactory:function(e,a){return new f.dnd.move.boxConstrainedMoveable(a,e)},constructor:function(e,a){var c=a&&a.box;this.constraints=function(){return c}}});f.declare("dojo.dnd.move.parentConstrainedMoveable",
f.dnd.move.constrainedMoveable,{area:"content",markupFactory:function(e,a){return new f.dnd.move.parentConstrainedMoveable(a,e)},constructor:function(e,a){var c=a&&a.area;this.constraints=function(){var d=this.node.parentNode,g=f.getComputedStyle(d),h=f._getMarginBox(d,g);if(c=="margin")return h;var i=f._getMarginExtents(d,g);h.l+=i.l;h.t+=i.t;h.w-=i.w;h.h-=i.h;if(c=="border")return h;i=f._getBorderExtents(d,g);h.l+=i.l;h.t+=i.t;h.w-=i.w;h.h-=i.h;if(c=="padding")return h;i=f._getPadExtents(d,g);h.l+=
i.l;h.t+=i.t;h.w-=i.w;h.h-=i.h;return h}}});f.dnd.constrainedMover=f.dnd.move.constrainedMover;f.dnd.boxConstrainedMover=f.dnd.move.boxConstrainedMover;f.dnd.parentConstrainedMover=f.dnd.move.parentConstrainedMover;return f.dnd.move});
define("dojo/dnd/TimedMoveable",["dojo","dojo/dnd/Moveable"],function(f){(function(){var e=f.dnd.Moveable.prototype.onMove;f.declare("dojo.dnd.TimedMoveable",f.dnd.Moveable,{timeout:40,constructor:function(a,c){c||(c={});if(c.timeout&&typeof c.timeout=="number"&&c.timeout>=0)this.timeout=c.timeout},markupFactory:function(a,c){return new f.dnd.TimedMoveable(c,a)},onMoveStop:function(a){if(a._timer){clearTimeout(a._timer);e.call(this,a,a._leftTop)}f.dnd.Moveable.prototype.onMoveStop.apply(this,arguments)},
onMove:function(a,c){a._leftTop=c;if(!a._timer){var d=this;a._timer=setTimeout(function(){a._timer=null;e.call(d,a,a._leftTop)},this.timeout)}}})})();return f.dnd.TimedMoveable});
define("dojo/fx/Toggler",["dojo"],function(f){f.declare("dojo.fx.Toggler",null,{node:null,showFunc:f.fadeIn,hideFunc:f.fadeOut,showDuration:200,hideDuration:200,constructor:function(e){var a=this;f.mixin(a,e);a.node=e.node;a._showArgs=f.mixin({},e);a._showArgs.node=a.node;a._showArgs.duration=a.showDuration;a.showAnim=a.showFunc(a._showArgs);a._hideArgs=f.mixin({},e);a._hideArgs.node=a.node;a._hideArgs.duration=a.hideDuration;a.hideAnim=a.hideFunc(a._hideArgs);f.connect(a.showAnim,"beforeBegin",f.hitch(a.hideAnim,
"stop",true));f.connect(a.hideAnim,"beforeBegin",f.hitch(a.showAnim,"stop",true))},show:function(e){return this.showAnim.play(e||0)},hide:function(e){return this.hideAnim.play(e||0)}});return f.fx.Toggler});
define("dojo/fx",["dojo","dojo/fx/Toggler"],function(f){(function(){var e={_fire:function(d,g){if(this[d])this[d].apply(this,g||[]);return this}},a=function(d){this._index=-1;this._animations=d||[];this._current=this._onAnimateCtx=this._onEndCtx=null;this.duration=0;f.forEach(this._animations,function(g){this.duration+=g.duration;if(g.delay)this.duration+=g.delay},this)};f.extend(a,{_onAnimate:function(){this._fire("onAnimate",arguments)},_onEnd:function(){f.disconnect(this._onAnimateCtx);f.disconnect(this._onEndCtx);
this._onAnimateCtx=this._onEndCtx=null;if(this._index+1==this._animations.length)this._fire("onEnd");else{this._current=this._animations[++this._index];this._onAnimateCtx=f.connect(this._current,"onAnimate",this,"_onAnimate");this._onEndCtx=f.connect(this._current,"onEnd",this,"_onEnd");this._current.play(0,true)}},play:function(d,g){if(!this._current)this._current=this._animations[this._index=0];if(!g&&this._current.status()=="playing")return this;var h=f.connect(this._current,"beforeBegin",this,
function(){this._fire("beforeBegin")}),i=f.connect(this._current,"onBegin",this,function(){this._fire("onBegin",arguments)}),j=f.connect(this._current,"onPlay",this,function(){this._fire("onPlay",arguments);f.disconnect(h);f.disconnect(i);f.disconnect(j)});this._onAnimateCtx&&f.disconnect(this._onAnimateCtx);this._onAnimateCtx=f.connect(this._current,"onAnimate",this,"_onAnimate");this._onEndCtx&&f.disconnect(this._onEndCtx);this._onEndCtx=f.connect(this._current,"onEnd",this,"_onEnd");this._current.play.apply(this._current,
arguments);return this},pause:function(){if(this._current){var d=f.connect(this._current,"onPause",this,function(){this._fire("onPause",arguments);f.disconnect(d)});this._current.pause()}return this},gotoPercent:function(d,g){this.pause();var h=this.duration*d;this._current=null;f.some(this._animations,function(i){if(i.duration<=h){this._current=i;return true}h-=i.duration;return false});this._current&&this._current.gotoPercent(h/this._current.duration,g);return this},stop:function(d){if(this._current){if(d){for(;this._index+
1<this._animations.length;++this._index)this._animations[this._index].stop(true);this._current=this._animations[this._index]}var g=f.connect(this._current,"onStop",this,function(){this._fire("onStop",arguments);f.disconnect(g)});this._current.stop()}return this},status:function(){return this._current?this._current.status():"stopped"},destroy:function(){this._onAnimateCtx&&f.disconnect(this._onAnimateCtx);this._onEndCtx&&f.disconnect(this._onEndCtx)}});f.extend(a,e);f.fx.chain=function(d){return new a(d)};
var c=function(d){this._animations=d||[];this._connects=[];this.duration=this._finished=0;f.forEach(d,function(h){var i=h.duration;if(h.delay)i+=h.delay;if(this.duration<i)this.duration=i;this._connects.push(f.connect(h,"onEnd",this,"_onEnd"))},this);this._pseudoAnimation=new f.Animation({curve:[0,1],duration:this.duration});var g=this;f.forEach(["beforeBegin","onBegin","onPlay","onAnimate","onPause","onStop","onEnd"],function(h){g._connects.push(f.connect(g._pseudoAnimation,h,function(){g._fire(h,
arguments)}))})};f.extend(c,{_doAction:function(d,g){f.forEach(this._animations,function(h){h[d].apply(h,g)});return this},_onEnd:function(){++this._finished>this._animations.length&&this._fire("onEnd")},_call:function(d,g){var h=this._pseudoAnimation;h[d].apply(h,g)},play:function(){this._finished=0;this._doAction("play",arguments);this._call("play",arguments);return this},pause:function(){this._doAction("pause",arguments);this._call("pause",arguments);return this},gotoPercent:function(d,g){var h=
this.duration*d;f.forEach(this._animations,function(i){i.gotoPercent(i.duration<h?1:h/i.duration,g)});this._call("gotoPercent",arguments);return this},stop:function(){this._doAction("stop",arguments);this._call("stop",arguments);return this},status:function(){return this._pseudoAnimation.status()},destroy:function(){f.forEach(this._connects,f.disconnect)}});f.extend(c,e);f.fx.combine=function(d){return new c(d)};f.fx.wipeIn=function(d){var g=d.node=f.byId(d.node),h=g.style,i;d=f.animateProperty(f.mixin({properties:{height:{start:function(){i=
h.overflow;h.overflow="hidden";if(h.visibility=="hidden"||h.display=="none"){h.height="1px";h.display="";h.visibility="";return 1}else{var j=f.style(g,"height");return Math.max(j,1)}},end:function(){return g.scrollHeight}}}},d));f.connect(d,"onEnd",function(){h.height="auto";h.overflow=i});return d};f.fx.wipeOut=function(d){var g=(d.node=f.byId(d.node)).style,h;d=f.animateProperty(f.mixin({properties:{height:{end:1}}},d));f.connect(d,"beforeBegin",function(){h=g.overflow;g.overflow="hidden";g.display=
""});f.connect(d,"onEnd",function(){g.overflow=h;g.height="auto";g.display="none"});return d};f.fx.slideTo=function(d){var g=null,h=null,i=function(j){return function(){var k=f.getComputedStyle(j),m=k.position;g=m=="absolute"?j.offsetTop:parseInt(k.top)||0;h=m=="absolute"?j.offsetLeft:parseInt(k.left)||0;if(m!="absolute"&&m!="relative"){k=f.position(j,true);g=k.y;h=k.x;j.style.position="absolute";j.style.top=g+"px";j.style.left=h+"px"}}}(d.node=f.byId(d.node));i();d=f.animateProperty(f.mixin({properties:{top:d.top||
0,left:d.left||0}},d));f.connect(d,"beforeBegin",d,i);return d}})();return f.fx});
define("dijit/DialogUnderlay",["dojo","dijit","dojo/window","dijit/_Widget","dijit/_Templated"],function(f,e){f.declare("dijit.DialogUnderlay",[e._Widget,e._Templated],{templateString:"<div class='dijitDialogUnderlayWrapper'><div class='dijitDialogUnderlay' dojoAttachPoint='node'></div></div>",dialogId:"","class":"",attributeMap:{id:"domNode"},_setDialogIdAttr:function(a){f.attr(this.node,"id",a+"_underlay");this._set("dialogId",a)},_setClassAttr:function(a){this.node.className="dijitDialogUnderlay "+
a;this._set("class",a)},postCreate:function(){f.body().appendChild(this.domNode)},layout:function(){var a=this.node.style,c=this.domNode.style;c.display="none";var d=f.window.getBox();c.top=d.t+"px";c.left=d.l+"px";a.width=d.w+"px";a.height=d.h+"px";c.display="block"},show:function(){this.domNode.style.display="block";this.layout();this.bgIframe=new e.BackgroundIframe(this.domNode)},hide:function(){this.bgIframe.destroy();delete this.bgIframe;this.domNode.style.display="none"}});return e.DialogUnderlay});
define("dijit/nls/common",{root:{buttonOk:"OK",buttonCancel:"Cancel",buttonSave:"Save",itemClose:"Close"},zh:true,"zh-tw":true,tr:true,th:true,sv:true,sl:true,sk:true,ru:true,ro:true,pt:true,"pt-pt":true,pl:true,nl:true,nb:true,ko:true,kk:true,ja:true,it:true,hu:true,he:true,fr:true,fi:true,es:true,el:true,de:true,da:true,cs:true,ca:true,ar:true});
define("dijit/Dialog",["dojo","dijit","text!dijit/templates/Dialog.html","dojo/dnd/move","dojo/dnd/TimedMoveable","dojo/fx","dojo/window","dijit/_Widget","dijit/_Templated","dijit/_CssStateMixin","dijit/form/_FormMixin","dijit/_DialogMixin","dijit/DialogUnderlay","dijit/layout/ContentPane","i18n!dijit/nls/common","dijit/TooltipDialog"],function(f,e){f.declare("dijit._DialogBase",[e._Templated,e.form._FormMixin,e._DialogMixin,e._CssStateMixin],{templateString:f.cache("dijit","templates/Dialog.html"),
baseClass:"dijitDialog",cssStateNodes:{closeButtonNode:"dijitDialogCloseIcon"},attributeMap:f.delegate(e._Widget.prototype.attributeMap,{title:[{node:"titleNode",type:"innerHTML"},{node:"titleBar",type:"attribute"}],"aria-describedby":""}),open:false,duration:e.defaultDuration,refocus:true,autofocus:true,_firstFocusItem:null,_lastFocusItem:null,doLayout:false,draggable:true,"aria-describedby":"",postMixInProperties:function(){var a=f.i18n.getLocalization("dijit","common");f.mixin(this,a);this.inherited(arguments)},
postCreate:function(){f.style(this.domNode,{display:"none",position:"absolute"});f.body().appendChild(this.domNode);this.inherited(arguments);this.connect(this,"onExecute","hide");this.connect(this,"onCancel","hide");this._modalconnects=[]},onLoad:function(){this._position();if(this.autofocus&&e._DialogLevelManager.isTop(this)){this._getFocusItems(this.domNode);e.focus(this._firstFocusItem)}this.inherited(arguments)},_endDrag:function(a){if(a&&a.node&&a.node===this.domNode)this._relativePosition=
f.position(a.node)},_setup:function(){var a=this.domNode;if(this.titleBar&&this.draggable){this._moveable=f.isIE==6?new f.dnd.TimedMoveable(a,{handle:this.titleBar}):new f.dnd.Moveable(a,{handle:this.titleBar,timeout:0});this._dndListener=f.subscribe("/dnd/move/stop",this,"_endDrag")}else f.addClass(a,"dijitDialogFixed");this.underlayAttrs={dialogId:this.id,"class":f.map(this["class"].split(/\s/),function(c){return c+"_underlay"}).join(" ")}},_size:function(){this._checkIfSingleChild();if(this._singleChild){if(this._singleChildOriginalStyle)this._singleChild.domNode.style.cssText=
this._singleChildOriginalStyle;delete this._singleChildOriginalStyle}else f.style(this.containerNode,{width:"auto",height:"auto"});var a=f._getMarginSize(this.domNode),c=f.window.getBox();if(a.w>=c.w||a.h>=c.h){var d=Math.min(a.w,Math.floor(c.w*0.75));a=Math.min(a.h,Math.floor(c.h*0.75));if(this._singleChild&&this._singleChild.resize){this._singleChildOriginalStyle=this._singleChild.domNode.style.cssText;this._singleChild.resize({w:d,h:a})}else f.style(this.containerNode,{width:d+"px",height:a+"px",
overflow:"auto",position:"relative"})}else this._singleChild&&this._singleChild.resize&&this._singleChild.resize()},_position:function(){if(!f.hasClass(f.body(),"dojoMove")){var a=this.domNode,c=f.window.getBox(),d=this._relativePosition,g=d?null:f._getBorderBox(a),h=Math.floor(c.l+(d?d.x:(c.w-g.w)/2));c=Math.floor(c.t+(d?d.y:(c.h-g.h)/2));f.style(a,{left:h+"px",top:c+"px"})}},_onKey:function(a){if(a.charOrCode){var c=f.keys,d=a.target;a.charOrCode===c.TAB&&this._getFocusItems(this.domNode);var g=
this._firstFocusItem==this._lastFocusItem;if(d==this._firstFocusItem&&a.shiftKey&&a.charOrCode===c.TAB){g||e.focus(this._lastFocusItem);f.stopEvent(a)}else if(d==this._lastFocusItem&&a.charOrCode===c.TAB&&!a.shiftKey){g||e.focus(this._firstFocusItem);f.stopEvent(a)}else{for(;d;){if(d==this.domNode||f.hasClass(d,"dijitPopup"))if(a.charOrCode==c.ESCAPE)this.onCancel();else return;d=d.parentNode}if(a.charOrCode!==c.TAB)f.stopEvent(a);else if(!f.isOpera)try{this._firstFocusItem.focus()}catch(h){}}}},
show:function(){if(!this.open){this._started||this.startup();if(!this._alreadyInitialized){this._setup();this._alreadyInitialized=true}this._fadeOutDeferred&&this._fadeOutDeferred.cancel();this._modalconnects.push(f.connect(window,"onscroll",this,"layout"));this._modalconnects.push(f.connect(window,"onresize",this,function(){var c=f.window.getBox();if(!this._oldViewport||c.h!=this._oldViewport.h||c.w!=this._oldViewport.w){this.layout();this._oldViewport=c}}));this._modalconnects.push(f.connect(this.domNode,
"onkeypress",this,"_onKey"));f.style(this.domNode,{opacity:0,display:""});this._set("open",true);this._onShow();this._size();this._position();var a;this._fadeInDeferred=new f.Deferred(f.hitch(this,function(){a.stop();delete this._fadeInDeferred}));a=f.fadeIn({node:this.domNode,duration:this.duration,beforeBegin:f.hitch(this,function(){e._DialogLevelManager.show(this,this.underlayAttrs)}),onEnd:f.hitch(this,function(){if(this.autofocus&&e._DialogLevelManager.isTop(this)){this._getFocusItems(this.domNode);
e.focus(this._firstFocusItem)}this._fadeInDeferred.callback(true);delete this._fadeInDeferred})}).play();return this._fadeInDeferred}},hide:function(){if(this._alreadyInitialized){this._fadeInDeferred&&this._fadeInDeferred.cancel();var a;this._fadeOutDeferred=new f.Deferred(f.hitch(this,function(){a.stop();delete this._fadeOutDeferred}));a=f.fadeOut({node:this.domNode,duration:this.duration,onEnd:f.hitch(this,function(){this.domNode.style.display="none";e._DialogLevelManager.hide(this);this.onHide();
this._fadeOutDeferred.callback(true);delete this._fadeOutDeferred})}).play();if(this._scrollConnected)this._scrollConnected=false;f.forEach(this._modalconnects,f.disconnect);this._modalconnects=[];this._relativePosition&&delete this._relativePosition;this._set("open",false);return this._fadeOutDeferred}},layout:function(){if(this.domNode.style.display!="none"){e._underlay&&e._underlay.layout();this._position()}},destroy:function(){this._fadeInDeferred&&this._fadeInDeferred.cancel();this._fadeOutDeferred&&
this._fadeOutDeferred.cancel();this._moveable&&this._moveable.destroy();this._dndListener&&f.unsubscribe(this._dndListener);f.forEach(this._modalconnects,f.disconnect);e._DialogLevelManager.hide(this);this.inherited(arguments)}});f.declare("dijit.Dialog",[e.layout.ContentPane,e._DialogBase],{});e._DialogLevelManager={show:function(a,c){var d=e._dialogStack;d[d.length-1].focus=e.getFocus(a);var g=e._underlay;if(!g||g._destroyed)g=e._underlay=new e.DialogUnderlay(c);else g.set(a.underlayAttrs);var h=
d[d.length-1].dialog?d[d.length-1].zIndex+2:950;d.length==1&&g.show();f.style(e._underlay.domNode,"zIndex",h-1);f.style(a.domNode,"zIndex",h);d.push({dialog:a,underlayAttrs:c,zIndex:h})},hide:function(a){var c=e._dialogStack;if(c[c.length-1].dialog==a){c.pop();var d=c[c.length-1];if(c.length==1)e._underlay._destroyed||e._underlay.hide();else{f.style(e._underlay.domNode,"zIndex",d.zIndex-1);e._underlay.set(d.underlayAttrs)}if(a.refocus){c=d.focus;if(!c||d.dialog&&!f.isDescendant(c.node,d.dialog.domNode)){d.dialog._getFocusItems(d.dialog.domNode);
c=d.dialog._firstFocusItem}try{e.focus(c)}catch(g){}}}else{d=f.indexOf(f.map(c,function(h){return h.dialog}),a);d!=-1&&c.splice(d,1)}},isTop:function(a){var c=e._dialogStack;return c[c.length-1].dialog==a}};e._dialogStack=[{dialog:null,focus:null,underlayAttrs:null}];return e.Dialog});define("text!dijit/form/templates/CheckBox.html",function(){return'<div class="dijit dijitReset dijitInline" role="presentation"\n\t><input\n\t \t${!nameAttrSetting} type="${type}" ${checkedAttrSetting}\n\t\tclass="dijitReset dijitCheckBoxInput"\n\t\tdojoAttachPoint="focusNode"\n\t \tdojoAttachEvent="onclick:_onClick"\n/></div>'});
define("dijit/form/ToggleButton",["dojo","dijit","dijit/form/Button"],function(f,e){return e.form.ToggleButton});
define("dijit/form/CheckBox",["dojo","dijit","text!dijit/form/templates/CheckBox.html","dijit/form/ToggleButton"],function(f,e){f.declare("dijit.form.CheckBox",e.form.ToggleButton,{templateString:f.cache("dijit.form","templates/CheckBox.html"),baseClass:"dijitCheckBox",type:"checkbox",value:"on",readOnly:false,attributeMap:f.delegate(e.form._FormWidget.prototype.attributeMap,{readOnly:"focusNode"}),_setReadOnlyAttr:function(a){this._set("readOnly",a);f.attr(this.focusNode,"readOnly",a);e.setWaiState(this.focusNode,
"readonly",a)},_setValueAttr:function(a,c){if(typeof a=="string"){this._set("value",a);f.attr(this.focusNode,"value",a);a=true}this._created&&this.set("checked",a,c)},_getValueAttr:function(){return this.checked?this.value:false},_setLabelAttr:undefined,postMixInProperties:function(){if(this.value=="")this.value="on";this.checkedAttrSetting=this.checked?"checked":"";this.inherited(arguments)},_fillContent:function(){},reset:function(){this._hasBeenBlurred=false;this.set("checked",this.params.checked||
false);this._set("value",this.params.value||"on");f.attr(this.focusNode,"value",this.value)},_onFocus:function(){this.id&&f.query("label[for='"+this.id+"']").addClass("dijitFocusedLabel");this.inherited(arguments)},_onBlur:function(){this.id&&f.query("label[for='"+this.id+"']").removeClass("dijitFocusedLabel");this.inherited(arguments)},_onClick:function(a){if(this.readOnly){f.stopEvent(a);return false}return this.inherited(arguments)}});f.declare("dijit.form.RadioButton",e.form.CheckBox,{type:"radio",
baseClass:"dijitRadio",_setCheckedAttr:function(a){this.inherited(arguments);if(this._created)if(a){var c=this;f.query("INPUT[type=radio]",this.focusNode.form||f.doc).forEach(function(d){if(d.name==c.name&&d!=c.focusNode&&d.form==c.focusNode.form)(d=e.getEnclosingWidget(d))&&d.checked&&d.set("checked",false)})}},_clicked:function(){this.checked||this.set("checked",true)}});return e.form.CheckBox});
define("dijit/form/Form",["dojo","dijit","dijit/_Widget","dijit/_Templated","dijit/form/_FormMixin","dijit/layout/_ContentPaneResizeMixin"],function(f,e){f.declare("dijit.form.Form",[e._Widget,e._Templated,e.form._FormMixin,e.layout._ContentPaneResizeMixin],{name:"",action:"",method:"",encType:"","accept-charset":"",accept:"",target:"",templateString:"<form dojoAttachPoint='containerNode' dojoAttachEvent='onreset:_onReset,onsubmit:_onSubmit' ${!nameAttrSetting}></form>",attributeMap:f.delegate(e._Widget.prototype.attributeMap,
{action:"",method:"",encType:"","accept-charset":"",accept:"",target:""}),postMixInProperties:function(){this.nameAttrSetting=this.name?"name='"+this.name+"'":"";this.inherited(arguments)},execute:function(){},onExecute:function(){},_setEncTypeAttr:function(a){this.encType=a;f.attr(this.domNode,"encType",a);if(f.isIE)this.domNode.encoding=a},postCreate:function(){if(f.isIE&&this.srcNodeRef&&this.srcNodeRef.attributes){var a=this.srcNodeRef.attributes.getNamedItem("encType");a&&!a.specified&&typeof a.value==
"string"&&this.set("encType",a.value)}this.inherited(arguments)},reset:function(a){var c={returnValue:true,preventDefault:function(){this.returnValue=false},stopPropagation:function(){},currentTarget:a?a.target:this.domNode,target:a?a.target:this.domNode};this.onReset(c)!==false&&c.returnValue&&this.inherited(arguments,[])},onReset:function(){return true},_onReset:function(a){this.reset(a);f.stopEvent(a);return false},_onSubmit:function(a){var c=e.form.Form.prototype;if(this.execute!=c.execute||this.onExecute!=
c.onExecute){f.deprecated("dijit.form.Form:execute()/onExecute() are deprecated. Use onSubmit() instead.","","2.0");this.onExecute();this.execute(this.getValues())}this.onSubmit(a)===false&&f.stopEvent(a)},onSubmit:function(){return this.isValid()},submit:function(){this.onSubmit()!==false&&this.containerNode.submit()}});return e.form.Form});
define("dojo/data/util/filter",["dojo"],function(f){f.getObject("data.util.filter",true,f);f.data.util.filter.patternToRegExp=function(e,a){for(var c="^",d=null,g=0;g<e.length;g++){d=e.charAt(g);switch(d){case "\\":c+=d;g++;c+=e.charAt(g);break;case "*":c+=".*";break;case "?":c+=".";break;case "$":case "^":case "/":case "+":case ".":case "|":case "(":case ")":case "{":case "}":case "[":case "]":c+="\\";default:c+=d}}c+="$";return a?new RegExp(c,"mi"):new RegExp(c,"m")};return f.data.util.filter});
define("dojo/data/util/sorter",["dojo"],function(f){f.getObject("data.util.sorter",true,f);f.data.util.sorter.basicComparator=function(e,a){var c=-1;if(e===null)e=undefined;if(a===null)a=undefined;if(e==a)c=0;else if(e>a||e==null)c=1;return c};f.data.util.sorter.createSortFunction=function(e,a){function c(n,p,r,w){return function(s,u){s=w.getValue(s,n);u=w.getValue(u,n);return p*r(s,u)}}for(var d=[],g,h=a.comparatorMap,i=f.data.util.sorter.basicComparator,j=0;j<e.length;j++){g=e[j];var k=g.attribute;
if(k){g=g.descending?-1:1;var m=i;if(h){if(typeof k!=="string"&&"toString"in k)k=k.toString();m=h[k]||i}d.push(c(k,g,m,a))}}return function(n,p){for(var r=0;r<d.length;){var w=d[r++](n,p);if(w!==0)return w}return 0}};return f.data.util.sorter});
define("dojo/data/util/simpleFetch",["dojo","dojo/data/util/sorter"],function(f){f.getObject("data.util.simpleFetch",true,f);f.data.util.simpleFetch.fetch=function(e){e=e||{};if(!e.store)e.store=this;var a=this,c=function(g,h){if(h.onError)h.onError.call(h.scope||f.global,g,h)},d=function(g,h){var i=h.abort||null,j=false,k=h.start?h.start:0,m=h.count&&h.count!==Infinity?k+h.count:g.length;h.abort=function(){j=true;i&&i.call(h)};var n=h.scope||f.global;if(!h.store)h.store=a;h.onBegin&&h.onBegin.call(n,
g.length,h);h.sort&&g.sort(f.data.util.sorter.createSortFunction(h.sort,a));if(h.onItem)for(var p=k;p<g.length&&p<m;++p){var r=g[p];j||h.onItem.call(n,r,h)}if(h.onComplete&&!j){p=null;h.onItem||(p=g.slice(k,m));h.onComplete.call(n,p,h)}};this._fetchItems(e,d,c);return e};return f.data.util.simpleFetch});
define("dojo/data/ItemFileReadStore",["dojo","dojo/data/util/filter","dojo/data/util/simpleFetch","dojo/date/stamp"],function(f){f.declare("dojo.data.ItemFileReadStore",null,{constructor:function(e){this._arrayOfAllItems=[];this._arrayOfTopLevelItems=[];this._loadFinished=false;this.url=this._ccUrl=this._jsonFileUrl=e.url;this._jsonData=e.data;this.data=null;this._datatypeMap=e.typeMap||{};this._datatypeMap.Date||(this._datatypeMap.Date={type:Date,deserialize:function(a){return f.date.stamp.fromISOString(a)}});
this._features={"dojo.data.api.Read":true,"dojo.data.api.Identity":true};this._itemsByIdentity=null;this._storeRefPropName="_S";this._itemNumPropName="_0";this._rootItemPropName="_RI";this._reverseRefMap="_RRM";this._loadInProgress=false;this._queuedFetches=[];if(e.urlPreventCache!==undefined)this.urlPreventCache=e.urlPreventCache?true:false;if(e.hierarchical!==undefined)this.hierarchical=e.hierarchical?true:false;if(e.clearOnClose)this.clearOnClose=true;if("failOk"in e)this.failOk=e.failOk?true:
false},url:"",_ccUrl:"",data:null,typeMap:null,clearOnClose:false,urlPreventCache:false,failOk:false,hierarchical:true,_assertIsItem:function(e){if(!this.isItem(e))throw new Error("dojo.data.ItemFileReadStore: Invalid item argument.");},_assertIsAttribute:function(e){if(typeof e!=="string")throw new Error("dojo.data.ItemFileReadStore: Invalid attribute argument.");},getValue:function(e,a,c){e=this.getValues(e,a);return e.length>0?e[0]:c},getValues:function(e,a){this._assertIsItem(e);this._assertIsAttribute(a);
return(e[a]||[]).slice(0)},getAttributes:function(e){this._assertIsItem(e);var a=[];for(var c in e)c!==this._storeRefPropName&&c!==this._itemNumPropName&&c!==this._rootItemPropName&&c!==this._reverseRefMap&&a.push(c);return a},hasAttribute:function(e,a){this._assertIsItem(e);this._assertIsAttribute(a);return a in e},containsValue:function(e,a,c){var d=undefined;if(typeof c==="string")d=f.data.util.filter.patternToRegExp(c,false);return this._containsValue(e,a,c,d)},_containsValue:function(e,a,c,d){return f.some(this.getValues(e,
a),function(g){if(g!==null&&!f.isObject(g)&&d){if(g.toString().match(d))return true}else if(c===g)return true})},isItem:function(e){if(e&&e[this._storeRefPropName]===this)if(this._arrayOfAllItems[e[this._itemNumPropName]]===e)return true;return false},isItemLoaded:function(e){return this.isItem(e)},loadItem:function(e){this._assertIsItem(e.item)},getFeatures:function(){return this._features},getLabel:function(e){if(this._labelAttr&&this.isItem(e))return this.getValue(e,this._labelAttr)},getLabelAttributes:function(){if(this._labelAttr)return[this._labelAttr];
return null},_fetchItems:function(e,a,c){var d=this,g=function(k,m){var n=[],p,r;if(k.query){var w;p=k.queryOptions?k.queryOptions.ignoreCase:false;var s={};for(r in k.query){w=k.query[r];if(typeof w==="string")s[r]=f.data.util.filter.patternToRegExp(w,p);else if(w instanceof RegExp)s[r]=w}for(p=0;p<m.length;++p){var u=true,t=m[p];if(t===null)u=false;else for(r in k.query){w=k.query[r];d._containsValue(t,r,w,s[r])||(u=false)}u&&n.push(t)}}else for(p=0;p<m.length;++p){r=m[p];r!==null&&n.push(r)}a(n,
k)};if(this._loadFinished)g(e,this._getItemsArray(e.queryOptions));else{if(this._jsonFileUrl!==this._ccUrl){f.deprecated("dojo.data.ItemFileReadStore: ","To change the url, set the url property of the store, not _jsonFileUrl.  _jsonFileUrl support will be removed in 2.0");this.url=this._ccUrl=this._jsonFileUrl}else if(this.url!==this._ccUrl)this._ccUrl=this._jsonFileUrl=this.url;if(this.data!=null){this._jsonData=this.data;this.data=null}if(this._jsonFileUrl)if(this._loadInProgress)this._queuedFetches.push({args:e,
filter:g});else{this._loadInProgress=true;var h=f.xhrGet({url:d._jsonFileUrl,handleAs:"json-comment-optional",preventCache:this.urlPreventCache,failOk:this.failOk});h.addCallback(function(k){try{d._getItemsFromLoadedData(k);d._loadFinished=true;d._loadInProgress=false;g(e,d._getItemsArray(e.queryOptions));d._handleQueuedFetches()}catch(m){d._loadFinished=true;d._loadInProgress=false;c(m,e)}});h.addErrback(function(k){d._loadInProgress=false;c(k,e)});var i=null;if(e.abort)i=e.abort;e.abort=function(){h&&
h.fired===-1&&h.cancel();i&&i.call(e)}}else if(this._jsonData)try{this._loadFinished=true;this._getItemsFromLoadedData(this._jsonData);this._jsonData=null;g(e,this._getItemsArray(e.queryOptions))}catch(j){c(j,e)}else c(new Error("dojo.data.ItemFileReadStore: No JSON source data was provided as either URL or a nested Javascript object."),e)}},_handleQueuedFetches:function(){if(this._queuedFetches.length>0){for(var e=0;e<this._queuedFetches.length;e++){var a=this._queuedFetches[e],c=a.args;(a=a.filter)?
a(c,this._getItemsArray(c.queryOptions)):this.fetchItemByIdentity(c)}this._queuedFetches=[]}},_getItemsArray:function(e){if(e&&e.deep)return this._arrayOfAllItems;return this._arrayOfTopLevelItems},close:function(){if(this.clearOnClose&&this._loadFinished&&!this._loadInProgress){if((this._jsonFileUrl==""||this._jsonFileUrl==null)&&(this.url==""||this.url==null)&&this.data==null)console.debug("dojo.data.ItemFileReadStore: WARNING!  Data reload  information has not been provided.  Please set 'url' or 'data' to the appropriate value before the next fetch");
this._arrayOfAllItems=[];this._arrayOfTopLevelItems=[];this._loadFinished=false;this._itemsByIdentity=null;this._loadInProgress=false;this._queuedFetches=[]}},_getItemsFromLoadedData:function(e){function a(s){return s!==null&&typeof s==="object"&&(!f.isArray(s)||d)&&!f.isFunction(s)&&(s.constructor==Object||f.isArray(s))&&typeof s._reference==="undefined"&&typeof s._type==="undefined"&&typeof s._value==="undefined"&&g.hierarchical}function c(s){g._arrayOfAllItems.push(s);for(var u in s){var t=s[u];
if(t)if(f.isArray(t))for(var y=0;y<t.length;++y){var B=t[y];a(B)&&c(B)}else a(t)&&c(t)}}var d=false,g=this;this._labelAttr=e.label;var h,i;this._arrayOfAllItems=[];this._arrayOfTopLevelItems=e.items;for(h=0;h<this._arrayOfTopLevelItems.length;++h){i=this._arrayOfTopLevelItems[h];if(f.isArray(i))d=true;c(i);i[this._rootItemPropName]=true}var j={},k;for(h=0;h<this._arrayOfAllItems.length;++h){i=this._arrayOfAllItems[h];for(k in i){if(k!==this._rootItemPropName){var m=i[k];if(m!==null)f.isArray(m)||
(i[k]=[m]);else i[k]=[null]}j[k]=k}}for(;j[this._storeRefPropName];)this._storeRefPropName+="_";for(;j[this._itemNumPropName];)this._itemNumPropName+="_";for(;j[this._reverseRefMap];)this._reverseRefMap+="_";if(j=e.identifier){this._itemsByIdentity={};this._features["dojo.data.api.Identity"]=j;for(h=0;h<this._arrayOfAllItems.length;++h){i=this._arrayOfAllItems[h];e=i[j];e=e[0];if(Object.hasOwnProperty.call(this._itemsByIdentity,e))if(this._jsonFileUrl)throw new Error("dojo.data.ItemFileReadStore:  The json data as specified by: ["+
this._jsonFileUrl+"] is malformed.  Items within the list have identifier: ["+j+"].  Value collided: ["+e+"]");else{if(this._jsonData)throw new Error("dojo.data.ItemFileReadStore:  The json data provided by the creation arguments is malformed.  Items within the list have identifier: ["+j+"].  Value collided: ["+e+"]");}else this._itemsByIdentity[e]=i}}else this._features["dojo.data.api.Identity"]=Number;for(h=0;h<this._arrayOfAllItems.length;++h){i=this._arrayOfAllItems[h];i[this._storeRefPropName]=
this;i[this._itemNumPropName]=h}for(h=0;h<this._arrayOfAllItems.length;++h){i=this._arrayOfAllItems[h];for(k in i){e=i[k];for(j=0;j<e.length;++j){m=e[j];if(m!==null&&typeof m=="object"){if("_type"in m&&"_value"in m){var n=m._type,p=this._datatypeMap[n];if(p)if(f.isFunction(p))e[j]=new p(m._value);else if(f.isFunction(p.deserialize))e[j]=p.deserialize(m._value);else throw new Error("dojo.data.ItemFileReadStore: Value provided in typeMap was neither a constructor, nor a an object with a deserialize function");
else throw new Error("dojo.data.ItemFileReadStore: in the typeMap constructor arg, no object class was specified for the datatype '"+n+"'");}if(m._reference){m=m._reference;if(f.isObject(m))for(n=0;n<this._arrayOfAllItems.length;++n){p=this._arrayOfAllItems[n];var r=true;for(var w in m)if(p[w]!=m[w])r=false;if(r)e[j]=p}else e[j]=this._getItemByIdentity(m);if(this.referenceIntegrity){m=e[j];this.isItem(m)&&this._addReferenceToMap(m,i,k)}}else this.isItem(m)&&this.referenceIntegrity&&this._addReferenceToMap(m,
i,k)}}}}},_addReferenceToMap:function(){},getIdentity:function(e){var a=this._features["dojo.data.api.Identity"];if(a===Number)return e[this._itemNumPropName];else if(e=e[a])return e[0];return null},fetchItemByIdentity:function(e){var a,c;if(this._loadFinished){a=this._getItemByIdentity(e.identity);if(e.onItem){c=e.scope?e.scope:f.global;e.onItem.call(c,a)}}else{var d=this;if(this._jsonFileUrl!==this._ccUrl){f.deprecated("dojo.data.ItemFileReadStore: ","To change the url, set the url property of the store, not _jsonFileUrl.  _jsonFileUrl support will be removed in 2.0");
this.url=this._ccUrl=this._jsonFileUrl}else if(this.url!==this._ccUrl)this._ccUrl=this._jsonFileUrl=this.url;if(this.data!=null&&this._jsonData==null){this._jsonData=this.data;this.data=null}if(this._jsonFileUrl)if(this._loadInProgress)this._queuedFetches.push({args:e});else{this._loadInProgress=true;c=f.xhrGet({url:d._jsonFileUrl,handleAs:"json-comment-optional",preventCache:this.urlPreventCache,failOk:this.failOk});c.addCallback(function(g){var h=e.scope?e.scope:f.global;try{d._getItemsFromLoadedData(g);
d._loadFinished=true;d._loadInProgress=false;a=d._getItemByIdentity(e.identity);e.onItem&&e.onItem.call(h,a);d._handleQueuedFetches()}catch(i){d._loadInProgress=false;e.onError&&e.onError.call(h,i)}});c.addErrback(function(g){d._loadInProgress=false;if(e.onError)e.onError.call(e.scope?e.scope:f.global,g)})}else if(this._jsonData){d._getItemsFromLoadedData(d._jsonData);d._jsonData=null;d._loadFinished=true;a=d._getItemByIdentity(e.identity);if(e.onItem){c=e.scope?e.scope:f.global;e.onItem.call(c,a)}}}},
_getItemByIdentity:function(e){var a=null;if(this._itemsByIdentity&&Object.hasOwnProperty.call(this._itemsByIdentity,e))a=this._itemsByIdentity[e];else if(Object.hasOwnProperty.call(this._arrayOfAllItems,e))a=this._arrayOfAllItems[e];if(a===undefined)a=null;return a},getIdentityAttributes:function(){var e=this._features["dojo.data.api.Identity"];return e===Number?null:[e]},_forceLoad:function(){var e=this;if(this._jsonFileUrl!==this._ccUrl){f.deprecated("dojo.data.ItemFileReadStore: ","To change the url, set the url property of the store, not _jsonFileUrl.  _jsonFileUrl support will be removed in 2.0");
this.url=this._ccUrl=this._jsonFileUrl}else if(this.url!==this._ccUrl)this._ccUrl=this._jsonFileUrl=this.url;if(this.data!=null){this._jsonData=this.data;this.data=null}if(this._jsonFileUrl){var a=f.xhrGet({url:this._jsonFileUrl,handleAs:"json-comment-optional",preventCache:this.urlPreventCache,failOk:this.failOk,sync:true});a.addCallback(function(c){try{if(e._loadInProgress!==true&&!e._loadFinished){e._getItemsFromLoadedData(c);e._loadFinished=true}else if(e._loadInProgress)throw new Error("dojo.data.ItemFileReadStore:  Unable to perform a synchronous load, an async load is in progress.");
}catch(d){console.log(d);throw d;}});a.addErrback(function(c){throw c;})}else if(this._jsonData){e._getItemsFromLoadedData(e._jsonData);e._jsonData=null;e._loadFinished=true}}});f.extend(f.data.ItemFileReadStore,f.data.util.simpleFetch);return f.data.ItemFileReadStore});
define("orion/widgets/_OrionDialogMixin",["dojo","dijit"],function(f,e){f.declare("orion.widgets._OrionDialogMixin",null,{postMixInProperties:function(){this.inherited(arguments);this.title=this.options.title||"Information Needed";this.buttonCancel="Cancel"},postCreate:function(){this.inherited(arguments);f.connect(this,"onKeyPress",f.hitch(this,function(a){a.keyCode===f.keys.ENTER&&this._onSubmit()}))},onHide:function(){this.inherited(arguments);setTimeout(f.hitch(this,function(){if(f.isDescendant(e._curFocus,
this.domNode))e._curFocus=null;if(f.isDescendant(e._prevFocus,this.domNode))e._prevFocus=null;this.destroyRecursive()}),this.duration)}})});define("text!orion/widgets/templates/NewItemDialog.html",function(){return'<div class="dijitDialog" tabindex="-1" waiRole="dialog" waiState="labelledby-${id}_title">\n\t<div dojoAttachPoint="titleBar" class="dijitDialogTitleBar">\n\t\t<span dojoAttachPoint="titleNode" class="dijitDialogTitle" id="${id}_title"></span>\n\t\t<span dojoAttachPoint="closeButtonNode" class="dijitDialogCloseIcon" dojoAttachEvent="onclick: onCancel" title="${buttonCancel}">\n\t\t\t<span dojoAttachPoint="closeText" class="closeText" title="${buttonCancel}">x</span>\n\t\t</span>\n\t</div>\n\t<div dojoAttachPoint="containerNode" class="dijitDialogPaneContent">\n\t\t<!-- Actual content here --\>\n\t\t<div style="display: table">\n\t\t\t<div style="display: table-row">\n\t\t\t\t<div style="display: table-cell; padding: 5">\n\t\t\t\t\t<label dojoAttachPoint="itemNameLabel" for="${id}_itemName" style="padding-right: 10">${itemNameLabelText}</label>\n\t\t\t\t</div>\n\t\t\t\t<div style="display: table-cell; padding: 5; width: 30em; text-align: left;">\n\t\t\t\t\t<input dojoType="dijit.form.ValidationTextBox" dojoAttachPoint="itemName" id="${id}_itemName" style="display: inline-block; width: 98%;" value="">\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div style="display: none;" dojoAttachPoint="itemAdvancedInfo">\n\t\t\t\t<div style="display: table-cell; padding: 5">\n\t\t\t\t\t<label dojoAttachPoint="itemURLLabel" for="itemURL" style="padding-right: 10">Server Path:</label>\n\t\t\t\t</div>\n\t\t\t\t<div style="display: table-cell; width: 40em; text-align: left; padding:5;">\n\t\t\t\t\t<input dojoAttachPoint="itemURL" style="display: inline-block; width: 98%;" value="">\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div style="display: none;" dojoAttachPoint="itemAdvancedInfo1">\n\t\t\t\t<div style="display: table-cell;"></div>\n\t\t\t\t<div style="display: table-cell;">\n\t\t\t\t\t<input dojoAttachPoint="createCheckbox" id="${id}_createCheckbox" dojoType="dijit.form.CheckBox" checked="checked" value="on" type="checkbox">\n\t\t\t\t\t<label dojoAttachPoint="createCheckboxLabel" for="${id}_createCheckbox">Create if doesn\'t exist</label>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div style="display: table-row">\n\t\t\t\t<div style="display: table-cell; padding: 5"></div>\n\t\t\t\t<div style="display: table-cell; padding: 5">\n\t\t\t\t\t<button dojoAttachPoint="newItemButton" dojoType="dijit.form.Button" type="submit" value="OK" style="padding: 20 0 10 0; float: right; clear: both;">OK\n\t\t\t\t\t</button>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</div>'});
define("orion/widgets/NewItemDialog",["dojo","dijit","dijit/Dialog","dijit/form/CheckBox","dijit/form/CheckBox","dijit/form/Form","dijit/form/ValidationTextBox","dojo/data/ItemFileReadStore","orion/widgets/_OrionDialogMixin","text!orion/widgets/templates/NewItemDialog.html"],function(f,e){f.declare("orion.widgets.NewItemDialog",[e.Dialog,orion.widgets._OrionDialogMixin],{widgetsInTemplate:true,templateString:f.cache("orion","widgets/templates/NewItemDialog.html"),constructor:function(a){this.options=
a||{};this.options.advanced=this.options.advanced||false},postMixInProperties:function(){this.inherited(arguments);this.itemNameLabelText=this.options.label||"Name:"},postCreate:function(){this.inherited(arguments);if(this.options.advanced){this.itemAdvancedInfo.style.display="table-row";this.itemAdvancedInfo1.style.display="table-row";f.connect(this.itemURL,"onkeyup",null,f.hitch(this,this.onURLChange))}else{this.itemAdvancedInfo.style.display="none";this.itemAdvancedInfo1.style.display="none"}},
execute:function(){var a,c;this.newItemButton.focus();if(this.options.advanced){a=this.itemURL.value.replace(/^\s+|\s+$/g,"");c=this.createCheckbox.get("disabled")?false:this.createCheckbox.get("checked")}this.options.func(this.itemName.value,a&&a!==""?a:undefined,c)},onURLChange:function(){var a=this.itemURL.value;if(a.match(/^file:\/\//))this.createCheckbox.set("disabled",false);else a.match(/^[a-zA-Z][a-zA-Z]+:\/\/.+/)?this.createCheckbox.set("disabled",true):this.createCheckbox.set("disabled",
false)}})});define("text!dijit/templates/TreeNode.html",function(){return'<div class="dijitTreeNode" role="presentation"\n\t><div dojoAttachPoint="rowNode" class="dijitTreeRow" role="presentation" dojoAttachEvent="onmouseenter:_onMouseEnter, onmouseleave:_onMouseLeave, onclick:_onClick, ondblclick:_onDblClick"\n\t\t><img src="${_blankGif}" alt="" dojoAttachPoint="expandoNode" class="dijitTreeExpando" role="presentation"\n\t\t/><span dojoAttachPoint="expandoNodeText" class="dijitExpandoText" role="presentation"\n\t\t></span\n\t\t><span dojoAttachPoint="contentNode"\n\t\t\tclass="dijitTreeContent" role="presentation">\n\t\t\t<img src="${_blankGif}" alt="" dojoAttachPoint="iconNode" class="dijitIcon dijitTreeIcon" role="presentation"\n\t\t\t/><span dojoAttachPoint="labelNode" class="dijitTreeLabel" role="treeitem" tabindex="-1" aria-selected="false" dojoAttachEvent="onfocus:_onLabelFocus"></span>\n\t\t</span\n\t></div>\n\t<div dojoAttachPoint="containerNode" class="dijitTreeContainer" role="presentation" style="display: none;"></div>\n</div>'});
define("text!dijit/templates/Tree.html",function(){return'<div class="dijitTree dijitTreeContainer" role="tree"\n\tdojoAttachEvent="onkeypress:_onKeyPress">\n\t<div class="dijitInline dijitTreeIndent" style="position: absolute; top: -9999px" dojoAttachPoint="indentDetector"></div>\n</div>'});
define("dojo/DeferredList",["dojo"],function(f){f.DeferredList=function(e,a,c,d){var g=[];f.Deferred.call(this);var h=this;e.length===0&&!a&&this.resolve([0,[]]);var i=0;f.forEach(e,function(j,k){function m(n,p){g[k]=[n,p];i++;i===e.length&&h.resolve(g)}j.then(function(n){a?h.resolve([k,n]):m(true,n)},function(n){c?h.reject(n):m(false,n);if(d)return null;throw n;})})};f.DeferredList.prototype=new f.Deferred;f.DeferredList.prototype.gatherResults=function(e){e=new f.DeferredList(e,false,true,false);
e.addCallback(function(a){var c=[];f.forEach(a,function(d){c.push(d[1])});return c});return e};return f.DeferredList});
define("dojo/regexp",["dojo"],function(f){f.getObject("regexp",true,f);f.regexp.escapeString=function(e,a){return e.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g,function(c){if(a&&a.indexOf(c)!=-1)return c;return"\\"+c})};f.regexp.buildGroupRE=function(e,a,c){if(!(e instanceof Array))return a(e);for(var d=[],g=0;g<e.length;g++)d.push(a(e[g]));return f.regexp.group(d.join("|"),c)};f.regexp.group=function(e,a){return"("+(a?"?:":"")+e+")"};return f.regexp});
define("dojo/cookie",["dojo","dojo/regexp"],function(f){f.cookie=function(e,a,c){var d=document.cookie;if(arguments.length==1){var g=d.match(new RegExp("(?:^|; )"+f.regexp.escapeString(e)+"=([^;]*)"));return g?decodeURIComponent(g[1]):undefined}else{c=c||{};d=c.expires;if(typeof d=="number"){var h=new Date;h.setTime(h.getTime()+d*24*60*60*1E3);d=c.expires=h}if(d&&d.toUTCString)c.expires=d.toUTCString();a=encodeURIComponent(a);d=e+"="+a;for(g in c){d+="; "+g;h=c[g];if(h!==true)d+="="+h}document.cookie=
d}};f.cookie.isSupported=function(){if(!("cookieEnabled"in navigator)){this("__djCookieTest__","CookiesAllowed");navigator.cookieEnabled=this("__djCookieTest__")=="CookiesAllowed";navigator.cookieEnabled&&this("__djCookieTest__","",{expires:-1})}return navigator.cookieEnabled};return f.cookie});
define("dijit/tree/TreeStoreModel",["dojo","dijit"],function(f,e){f.declare("dijit.tree.TreeStoreModel",null,{store:null,childrenAttrs:["children"],newItemIdAttr:"id",labelAttr:"",root:null,query:null,deferItemLoadingUntilExpand:false,constructor:function(a){f.mixin(this,a);this.connects=[];a=this.store;if(!a.getFeatures()["dojo.data.api.Identity"])throw new Error("dijit.Tree: store must support dojo.data.Identity");if(a.getFeatures()["dojo.data.api.Notification"])this.connects=this.connects.concat([f.connect(a,
"onNew",this,"onNewItem"),f.connect(a,"onDelete",this,"onDeleteItem"),f.connect(a,"onSet",this,"onSetItem")])},destroy:function(){f.forEach(this.connects,f.disconnect)},getRoot:function(a,c){this.root?a(this.root):this.store.fetch({query:this.query,onComplete:f.hitch(this,function(d){if(d.length!=1)throw new Error(this.declaredClass+": query "+f.toJson(this.query)+" returned "+d.length+" items, but must return exactly one item");this.root=d[0];a(this.root)}),onError:c})},mayHaveChildren:function(a){return f.some(this.childrenAttrs,
function(c){return this.store.hasAttribute(a,c)},this)},getChildren:function(a,c,d){var g=this.store;if(g.isItemLoaded(a)){for(var h=[],i=0;i<this.childrenAttrs.length;i++){var j=g.getValues(a,this.childrenAttrs[i]);h=h.concat(j)}var k=0;this.deferItemLoadingUntilExpand||f.forEach(h,function(n){g.isItemLoaded(n)||k++});k==0?c(h):f.forEach(h,function(n,p){g.isItemLoaded(n)||g.loadItem({item:n,onItem:function(r){h[p]=r;--k==0&&c(h)},onError:d})})}else{var m=f.hitch(this,arguments.callee);g.loadItem({item:a,
onItem:function(n){m(n,c,d)},onError:d})}},isItem:function(a){return this.store.isItem(a)},fetchItemByIdentity:function(a){this.store.fetchItemByIdentity(a)},getIdentity:function(a){return this.store.getIdentity(a)},getLabel:function(a){return this.labelAttr?this.store.getValue(a,this.labelAttr):this.store.getLabel(a)},newItem:function(a,c,d){var g={parent:c,attribute:this.childrenAttrs[0]},h;if(this.newItemIdAttr&&a[this.newItemIdAttr])this.fetchItemByIdentity({identity:a[this.newItemIdAttr],scope:this,
onItem:function(i){if(i)this.pasteItem(i,null,c,true,d);else(h=this.store.newItem(a,g))&&d!=undefined&&this.pasteItem(h,c,c,false,d)}});else(h=this.store.newItem(a,g))&&d!=undefined&&this.pasteItem(h,c,c,false,d)},pasteItem:function(a,c,d,g,h){var i=this.store,j=this.childrenAttrs[0];c&&f.forEach(this.childrenAttrs,function(m){if(i.containsValue(c,m,a)){if(!g){var n=f.filter(i.getValues(c,m),function(p){return p!=a});i.setValues(c,m,n)}j=m}});if(d)if(typeof h=="number"){var k=i.getValues(d,j).slice();
k.splice(h,0,a);i.setValues(d,j,k)}else i.setValues(d,j,i.getValues(d,j).concat(a))},onChange:function(){},onChildrenChange:function(){},onDelete:function(){},onNewItem:function(a,c){c&&this.getChildren(c.item,f.hitch(this,function(d){this.onChildrenChange(c.item,d)}))},onDeleteItem:function(a){this.onDelete(a)},onSetItem:function(a,c){f.indexOf(this.childrenAttrs,c)!=-1?this.getChildren(a,f.hitch(this,function(d){this.onChildrenChange(a,d)})):this.onChange(a)}});return e.tree.TreeStoreModel});
define("dijit/tree/ForestStoreModel",["dojo","dijit","dijit/tree/TreeStoreModel"],function(f,e){f.declare("dijit.tree.ForestStoreModel",e.tree.TreeStoreModel,{rootId:"$root$",rootLabel:"ROOT",query:null,constructor:function(a){this.root={store:this,root:true,id:a.rootId,label:a.rootLabel,children:a.rootChildren}},mayHaveChildren:function(a){return a===this.root||this.inherited(arguments)},getChildren:function(a,c,d){if(a===this.root)this.root.children?c(this.root.children):this.store.fetch({query:this.query,
onComplete:f.hitch(this,function(g){this.root.children=g;c(g)}),onError:d});else this.inherited(arguments)},isItem:function(a){return a===this.root?true:this.inherited(arguments)},fetchItemByIdentity:function(a){if(a.identity==this.root.id){var c=a.scope?a.scope:f.global;a.onItem&&a.onItem.call(c,this.root)}else this.inherited(arguments)},getIdentity:function(a){return a===this.root?this.root.id:this.inherited(arguments)},getLabel:function(a){return a===this.root?this.root.label:this.inherited(arguments)},
newItem:function(a,c){if(c===this.root){this.onNewRootItem(a);return this.store.newItem(a)}else return this.inherited(arguments)},onNewRootItem:function(){},pasteItem:function(a,c,d,g,h){if(c===this.root)g||this.onLeaveRoot(a);e.tree.TreeStoreModel.prototype.pasteItem.call(this,a,c===this.root?null:c,d===this.root?null:d,g,h);d===this.root&&this.onAddToRoot(a)},onAddToRoot:function(a){console.log(this,": item ",a," added to root")},onLeaveRoot:function(a){console.log(this,": item ",a," removed from root")},
_requeryTop:function(){var a=this.root.children||[];this.store.fetch({query:this.query,onComplete:f.hitch(this,function(c){this.root.children=c;if(a.length!=c.length||f.some(a,function(d,g){return c[g]!=d}))this.onChildrenChange(this.root,c)})})},onNewItem:function(){this._requeryTop();this.inherited(arguments)},onDeleteItem:function(a){f.indexOf(this.root.children,a)!=-1&&this._requeryTop();this.inherited(arguments)},onSetItem:function(){this._requeryTop();this.inherited(arguments)}});return e.tree.ForestStoreModel});
define("dojo/dnd/Container",["dojo","dojo/dnd/common","dojo/parser"],function(f){f.declare("dojo.dnd.Container",null,{skipForm:false,constructor:function(e,a){this.node=f.byId(e);a||(a={});this.creator=a.creator||null;this.skipForm=a.skipForm;this.parent=a.dropParent&&f.byId(a.dropParent);this.map={};this.current=null;this.containerState="";f.addClass(this.node,"dojoDndContainer");a&&a._skipStartup||this.startup();this.events=[f.connect(this.node,"onmouseover",this,"onMouseOver"),f.connect(this.node,
"onmouseout",this,"onMouseOut"),f.connect(this.node,"ondragstart",this,"onSelectStart"),f.connect(this.node,"onselectstart",this,"onSelectStart")]},creator:function(){},getItem:function(e){return this.map[e]},setItem:function(e,a){this.map[e]=a},delItem:function(e){delete this.map[e]},forInItems:function(e,a){a=a||f.global;var c=this.map,d=f.dnd._empty;for(var g in c)g in d||e.call(a,c[g],g,this);return a},clearItems:function(){this.map={}},getAllNodes:function(){return f.query("> .dojoDndItem",this.parent)},
sync:function(){var e={};this.getAllNodes().forEach(function(a){if(a.id){var c=this.getItem(a.id);if(c){e[a.id]=c;return}}else a.id=f.dnd.getUniqueId();c=a.getAttribute("dndType");var d=a.getAttribute("dndData");e[a.id]={data:d||a.innerHTML,type:c?c.split(/\s*,\s*/):["text"]}},this);this.map=e;return this},insertNodes:function(e,a,c){if(this.parent.firstChild)if(a){if(!c)c=this.parent.firstChild}else{if(c)c=c.nextSibling}else c=null;if(c)for(a=0;a<e.length;++a){var d=this._normalizedCreator(e[a]);
this.setItem(d.node.id,{data:d.data,type:d.type});this.parent.insertBefore(d.node,c)}else for(a=0;a<e.length;++a){d=this._normalizedCreator(e[a]);this.setItem(d.node.id,{data:d.data,type:d.type});this.parent.appendChild(d.node)}return this},destroy:function(){f.forEach(this.events,f.disconnect);this.clearItems();this.node=this.parent=this.current=null},markupFactory:function(e,a){e._skipStartup=true;return new f.dnd.Container(a,e)},startup:function(){if(!this.parent){this.parent=this.node;if(this.parent.tagName.toLowerCase()==
"table"){var e=this.parent.getElementsByTagName("tbody");if(e&&e.length)this.parent=e[0]}}this.defaultCreator=f.dnd._defaultCreator(this.parent);this.sync()},onMouseOver:function(e){for(var a=e.relatedTarget;a;){if(a==this.node)break;try{a=a.parentNode}catch(c){a=null}}if(!a){this._changeState("Container","Over");this.onOverEvent()}a=this._getChildByEvent(e);if(this.current!=a){this.current&&this._removeItemClass(this.current,"Over");a&&this._addItemClass(a,"Over");this.current=a}},onMouseOut:function(e){for(e=
e.relatedTarget;e;){if(e==this.node)return;try{e=e.parentNode}catch(a){e=null}}if(this.current){this._removeItemClass(this.current,"Over");this.current=null}this._changeState("Container","");this.onOutEvent()},onSelectStart:function(e){if(!this.skipForm||!f.dnd.isFormElement(e))f.stopEvent(e)},onOverEvent:function(){},onOutEvent:function(){},_changeState:function(e,a){var c="dojoDnd"+e;e=e.toLowerCase()+"State";f.replaceClass(this.node,c+a,c+this[e]);this[e]=a},_addItemClass:function(e,a){f.addClass(e,
"dojoDndItem"+a)},_removeItemClass:function(e,a){f.removeClass(e,"dojoDndItem"+a)},_getChildByEvent:function(e){if(e=e.target)for(var a=e.parentNode;a;e=a,a=e.parentNode)if(a==this.parent&&f.hasClass(e,"dojoDndItem"))return e;return null},_normalizedCreator:function(e,a){e=(this.creator||this.defaultCreator).call(this,e,a);if(!f.isArray(e.type))e.type=["text"];if(!e.node.id)e.node.id=f.dnd.getUniqueId();f.addClass(e.node,"dojoDndItem");return e}});f.dnd._createNode=function(e){if(!e)return f.dnd._createSpan;
return function(a){return f.create(e,{innerHTML:a})}};f.dnd._createTrTd=function(e){var a=f.create("tr");f.create("td",{innerHTML:e},a);return a};f.dnd._createSpan=function(e){return f.create("span",{innerHTML:e})};f.dnd._defaultCreatorNodes={ul:"li",ol:"li",div:"div",p:"div"};f.dnd._defaultCreator=function(e){e=e.tagName.toLowerCase();var a=e=="tbody"||e=="thead"?f.dnd._createTrTd:f.dnd._createNode(f.dnd._defaultCreatorNodes[e]);return function(c,d){var g=c&&f.isObject(c),h;if(g&&c.tagName&&c.nodeType&&
c.getAttribute){h=c.getAttribute("dndData")||c.innerHTML;g=(g=c.getAttribute("dndType"))?g.split(/\s*,\s*/):["text"];c=c}else{h=g&&c.data?c.data:c;g=g&&c.type?c.type:["text"];c=(d=="avatar"?f.dnd._createSpan:a)(String(h))}if(!c.id)c.id=f.dnd.getUniqueId();return{node:c,data:h,type:g}}};return f.dnd.Container});
define("dijit/tree/_dndContainer",["dojo","dijit","dojo/dnd/common","dojo/dnd/Container"],function(f,e){f.getObject("tree",true,f);e.tree._compareNodes=function(a,c){if(a===c)return 0;if("sourceIndex"in document.documentElement)return a.sourceIndex-c.sourceIndex;else if("compareDocumentPosition"in document.documentElement)return a.compareDocumentPosition(c)&2?1:-1;else if(document.createRange){var d=doc.createRange();d.setStartBefore(a);a=doc.createRange();a.setStartBefore(c);return d.compareBoundaryPoints(d.END_TO_END,
a)}else throw Error("dijit.tree._compareNodes don't know how to compare two different nodes in this browser");};f.declare("dijit.tree._dndContainer",null,{constructor:function(a,c){this.tree=a;this.node=a.domNode;f.mixin(this,c);this.map={};this.current=null;this.containerState="";f.addClass(this.node,"dojoDndContainer");this.events=[f.connect(this.node,"onmouseenter",this,"onOverEvent"),f.connect(this.node,"onmouseleave",this,"onOutEvent"),f.connect(this.tree,"_onNodeMouseEnter",this,"onMouseOver"),
f.connect(this.tree,"_onNodeMouseLeave",this,"onMouseOut"),f.connect(this.node,"ondragstart",f,"stopEvent"),f.connect(this.node,"onselectstart",f,"stopEvent")]},getItem:function(a){return{data:this.selection[a],type:["treeNode"]}},destroy:function(){f.forEach(this.events,f.disconnect);this.node=this.parent=null},onMouseOver:function(a){this.current=a},onMouseOut:function(){this.current=null},_changeState:function(a,c){var d="dojoDnd"+a;a=a.toLowerCase()+"State";f.replaceClass(this.node,d+c,d+this[a]);
this[a]=c},_addItemClass:function(a,c){f.addClass(a,"dojoDndItem"+c)},_removeItemClass:function(a,c){f.removeClass(a,"dojoDndItem"+c)},onOverEvent:function(){this._changeState("Container","Over")},onOutEvent:function(){this._changeState("Container","")}});return e.tree._dndContainer});
define("dijit/tree/_dndSelector",["dojo","dijit","dojo/dnd/common","dijit/tree/_dndContainer"],function(f,e){f.declare("dijit.tree._dndSelector",e.tree._dndContainer,{constructor:function(){this.selection={};this.anchor=null;e.setWaiState(this.tree.domNode,"multiselect",!this.singular);this.events.push(f.connect(this.tree.domNode,"onmousedown",this,"onMouseDown"),f.connect(this.tree.domNode,"onmouseup",this,"onMouseUp"),f.connect(this.tree.domNode,"onmousemove",this,"onMouseMove"))},singular:false,
getSelectedTreeNodes:function(){var a=[],c=this.selection;for(var d in c)a.push(c[d]);return a},selectNone:function(){this.setSelection([]);return this},destroy:function(){this.inherited(arguments);this.selection=this.anchor=null},addTreeNode:function(a,c){this.setSelection(this.getSelectedTreeNodes().concat([a]));if(c)this.anchor=a;return a},removeTreeNode:function(a){this.setSelection(this._setDifference(this.getSelectedTreeNodes(),[a]));return a},isTreeNodeSelected:function(a){return a.id&&!!this.selection[a.id]},
setSelection:function(a){var c=this.getSelectedTreeNodes();f.forEach(this._setDifference(c,a),f.hitch(this,function(d){d.setSelected(false);this.anchor==d&&delete this.anchor;delete this.selection[d.id]}));f.forEach(this._setDifference(a,c),f.hitch(this,function(d){d.setSelected(true);this.selection[d.id]=d}));this._updateSelectionProperties()},_setDifference:function(a,c){f.forEach(c,function(d){d.__exclude__=true});a=f.filter(a,function(d){return!d.__exclude__});f.forEach(c,function(d){delete d.__exclude__});
return a},_updateSelectionProperties:function(){var a=this.getSelectedTreeNodes(),c=[],d=[];f.forEach(a,function(g){d.push(g);c.push(g.getTreePath())});a=f.map(d,function(g){return g.item});this.tree._set("paths",c);this.tree._set("path",c[0]||[]);this.tree._set("selectedNodes",d);this.tree._set("selectedNode",d[0]||null);this.tree._set("selectedItems",a);this.tree._set("selectedItem",a[0]||null)},onMouseDown:function(a){if(!(!this.current||this.tree.isExpandoNode(a.target,this.current)))if(a.button!=
f.mouseButtons.RIGHT){f.stopEvent(a);var c=this.current,d=f.isCopyKey(a),g=c.id;if(!this.singular&&!a.shiftKey&&this.selection[g])this._doDeselect=true;else{this._doDeselect=false;this.userSelect(c,d,a.shiftKey)}}},onMouseUp:function(a){if(this._doDeselect){this._doDeselect=false;this.userSelect(this.current,f.isCopyKey(a),a.shiftKey)}},onMouseMove:function(){this._doDeselect=false},userSelect:function(a,c,d){if(this.singular)if(this.anchor==a&&c)this.selectNone();else{this.setSelection([a]);this.anchor=
a}else if(d&&this.anchor){d=this.anchor;if(e.tree._compareNodes(this.anchor.rowNode,a.rowNode)<0){c=d;a=a}else{c=a;a=d}for(nodes=[];c!=a;){nodes.push(c);c=this.tree._getNextNode(c)}nodes.push(a);this.setSelection(nodes)}else if(this.selection[a.id]&&c)this.removeTreeNode(a);else if(c)this.addTreeNode(a,true);else{this.setSelection([a]);this.anchor=a}},forInSelectedItems:function(a,c){c=c||f.global;for(var d in this.selection)a.call(c,this.getItem(d),d,this)}});return e.tree._dndSelector});
define("dijit/Tree",["dojo","dijit","text!dijit/templates/TreeNode.html","text!dijit/templates/Tree.html","dojo/fx","dojo/DeferredList","dijit/_Widget","dijit/_Templated","dijit/_Container","dijit/_Contained","dijit/_CssStateMixin","dojo/cookie","dijit/tree/TreeStoreModel","dijit/tree/ForestStoreModel","dijit/tree/_dndSelector"],function(f,e){f.declare("dijit._TreeNode",[e._Widget,e._Templated,e._Container,e._Contained,e._CssStateMixin],{item:null,isTreeNode:true,label:"",isExpandable:null,isExpanded:false,
state:"UNCHECKED",templateString:f.cache("dijit","templates/TreeNode.html"),baseClass:"dijitTreeNode",cssStateNodes:{rowNode:"dijitTreeRow",labelNode:"dijitTreeLabel"},attributeMap:f.delegate(e._Widget.prototype.attributeMap,{label:{node:"labelNode",type:"innerText"},tooltip:{node:"rowNode",type:"attribute",attribute:"title"}}),buildRendering:function(){this.inherited(arguments);this._setExpando();this._updateItemClasses(this.item);this.isExpandable&&e.setWaiState(this.labelNode,"expanded",this.isExpanded);
this.setSelected(false)},_setIndentAttr:function(a){var c=Math.max(a,0)*this.tree._nodePixelIndent+"px";f.style(this.domNode,"backgroundPosition",c+" 0px");f.style(this.rowNode,this.isLeftToRight()?"paddingLeft":"paddingRight",c);f.forEach(this.getChildren(),function(d){d.set("indent",a+1)});this._set("indent",a)},markProcessing:function(){this.state="LOADING";this._setExpando(true)},unmarkProcessing:function(){this._setExpando(false)},_updateItemClasses:function(a){var c=this.tree,d=c.model;if(c._v10Compat&&
a===d.root)a=null;this._applyClassAndStyle(a,"icon","Icon");this._applyClassAndStyle(a,"label","Label");this._applyClassAndStyle(a,"row","Row")},_applyClassAndStyle:function(a,c,d){var g="_"+c+"Class";c=c+"Node";var h=this[g];this[g]=this.tree["get"+d+"Class"](a,this.isExpanded);f.replaceClass(this[c],this[g]||"",h||"");f.style(this[c],this.tree["get"+d+"Style"](a,this.isExpanded)||{})},_updateLayout:function(){var a=this.getParent();!a||a.rowNode.style.display=="none"?f.addClass(this.domNode,"dijitTreeIsRoot"):
f.toggleClass(this.domNode,"dijitTreeIsLast",!this.getNextSibling())},_setExpando:function(a){var c=["dijitTreeExpandoLoading","dijitTreeExpandoOpened","dijitTreeExpandoClosed","dijitTreeExpandoLeaf"],d=["*","-","+","*"];a=a?0:this.isExpandable?this.isExpanded?1:2:3;f.replaceClass(this.expandoNode,c[a],c);this.expandoNodeText.innerHTML=d[a]},expand:function(){if(this._expandDeferred)return this._expandDeferred;this._wipeOut&&this._wipeOut.stop();this.isExpanded=true;e.setWaiState(this.labelNode,"expanded",
"true");if(this.tree.showRoot||this!==this.tree.rootNode)e.setWaiRole(this.containerNode,"group");f.addClass(this.contentNode,"dijitTreeContentExpanded");this._setExpando();this._updateItemClasses(this.item);this==this.tree.rootNode&&e.setWaiState(this.tree.domNode,"expanded","true");var a,c=f.fx.wipeIn({node:this.containerNode,duration:e.defaultDuration,onEnd:function(){a.callback(true)}});a=this._expandDeferred=new f.Deferred(function(){c.stop()});c.play();return a},collapse:function(){if(this.isExpanded){if(this._expandDeferred){this._expandDeferred.cancel();
delete this._expandDeferred}this.isExpanded=false;e.setWaiState(this.labelNode,"expanded","false");this==this.tree.rootNode&&e.setWaiState(this.tree.domNode,"expanded","false");f.removeClass(this.contentNode,"dijitTreeContentExpanded");this._setExpando();this._updateItemClasses(this.item);if(!this._wipeOut)this._wipeOut=f.fx.wipeOut({node:this.containerNode,duration:e.defaultDuration});this._wipeOut.play()}},indent:0,setChildItems:function(a){var c=this.tree,d=c.model,g=[];f.forEach(this.getChildren(),
function(h){e._Container.prototype.removeChild.call(this,h)},this);this.state="LOADED";if(a&&a.length>0){this.isExpandable=true;f.forEach(a,function(h){var i=d.getIdentity(h),j=c._itemNodesMap[i],k;if(j)for(var m=0;m<j.length;m++)if(j[m]&&!j[m].getParent()){k=j[m];k.set("indent",this.indent+1);break}if(!k){k=this.tree._createTreeNode({item:h,tree:c,isExpandable:d.mayHaveChildren(h),label:c.getLabel(h),tooltip:c.getTooltip(h),dir:c.dir,lang:c.lang,indent:this.indent+1});if(j)j.push(k);else c._itemNodesMap[i]=
[k]}this.addChild(k);if(this.tree.autoExpand||this.tree._state(h))g.push(c._expandNode(k))},this);f.forEach(this.getChildren(),function(h){h._updateLayout()})}else this.isExpandable=false;this._setExpando&&this._setExpando(false);this._updateItemClasses(this.item);if(this==c.rootNode)if(a=this.tree.showRoot?this:this.getChildren()[0]){a.setFocusable(true);c.lastFocused=a}else c.domNode.setAttribute("tabIndex","0");return new f.DeferredList(g)},getTreePath:function(){for(var a=this,c=[];a&&a!==this.tree.rootNode;){c.unshift(a.item);
a=a.getParent()}c.unshift(this.tree.rootNode.item);return c},getIdentity:function(){return this.tree.model.getIdentity(this.item)},removeChild:function(){this.inherited(arguments);var a=this.getChildren();if(a.length==0){this.isExpandable=false;this.collapse()}f.forEach(a,function(c){c._updateLayout()})},makeExpandable:function(){this.isExpandable=true;this._setExpando(false)},_onLabelFocus:function(){this.tree._onNodeFocus(this)},setSelected:function(a){e.setWaiState(this.labelNode,"selected",a);
f.toggleClass(this.rowNode,"dijitTreeRowSelected",a)},setFocusable:function(a){this.labelNode.setAttribute("tabIndex",a?"0":"-1")},_onClick:function(a){this.tree._onClick(this,a)},_onDblClick:function(a){this.tree._onDblClick(this,a)},_onMouseEnter:function(a){this.tree._onNodeMouseEnter(this,a)},_onMouseLeave:function(a){this.tree._onNodeMouseLeave(this,a)}});f.declare("dijit.Tree",[e._Widget,e._Templated],{store:null,model:null,query:null,label:"",showRoot:true,childrenAttr:["children"],paths:[],
path:[],selectedItems:null,selectedItem:null,openOnClick:false,openOnDblClick:false,templateString:f.cache("dijit","templates/Tree.html"),persist:true,autoExpand:false,dndController:"dijit.tree._dndSelector",dndParams:["onDndDrop","itemCreator","onDndCancel","checkAcceptance","checkItemAcceptance","dragThreshold","betweenThreshold"],onDndDrop:null,itemCreator:null,onDndCancel:null,checkAcceptance:null,checkItemAcceptance:null,dragThreshold:5,betweenThreshold:0,_nodePixelIndent:19,_publish:function(a,
c){f.publish(this.id,[f.mixin({tree:this,event:a},c||{})])},postMixInProperties:function(){this.tree=this;if(this.autoExpand)this.persist=false;this._itemNodesMap={};if(!this.cookieName)this.cookieName=this.id+"SaveStateCookie";this._loadDeferred=new f.Deferred;this.inherited(arguments)},postCreate:function(){this._initState();this.model||this._store2model();this.connect(this.model,"onChange","_onItemChange");this.connect(this.model,"onChildrenChange","_onItemChildrenChange");this.connect(this.model,
"onDelete","_onItemDelete");this._load();this.inherited(arguments);if(this.dndController){if(f.isString(this.dndController))this.dndController=f.getObject(this.dndController);for(var a={},c=0;c<this.dndParams.length;c++)if(this[this.dndParams[c]])a[this.dndParams[c]]=this[this.dndParams[c]];this.dndController=new this.dndController(this,a)}},_store2model:function(){this._v10Compat=true;f.deprecated("Tree: from version 2.0, should specify a model object rather than a store/query");var a={id:this.id+
"_ForestStoreModel",store:this.store,query:this.query,childrenAttrs:this.childrenAttr};if(this.params.mayHaveChildren)a.mayHaveChildren=f.hitch(this,"mayHaveChildren");if(this.params.getItemChildren)a.getChildren=f.hitch(this,function(c,d,g){this.getItemChildren(this._v10Compat&&c===this.model.root?null:c,d,g)});this.model=new e.tree.ForestStoreModel(a);this.showRoot=Boolean(this.label)},onLoad:function(){},_load:function(){this.model.getRoot(f.hitch(this,function(a){var c=this.rootNode=this.tree._createTreeNode({item:a,
tree:this,isExpandable:true,label:this.label||this.getLabel(a),indent:this.showRoot?0:-1});if(!this.showRoot){c.rowNode.style.display="none";e.setWaiRole(this.domNode,"presentation");e.setWaiRole(c.labelNode,"presentation");e.setWaiRole(c.containerNode,"tree")}this.domNode.appendChild(c.domNode);a=this.model.getIdentity(a);if(this._itemNodesMap[a])this._itemNodesMap[a].push(c);else this._itemNodesMap[a]=[c];c._updateLayout();this._expandNode(c).addCallback(f.hitch(this,function(){this._loadDeferred.callback(true);
this.onLoad()}))}),function(a){console.error(this,": error loading root: ",a)})},getNodesByItem:function(a){if(!a)return[];return[].concat(this._itemNodesMap[f.isString(a)?a:this.model.getIdentity(a)])},_setSelectedItemAttr:function(a){this.set("selectedItems",[a])},_setSelectedItemsAttr:function(a){var c=this;this._loadDeferred.addCallback(f.hitch(this,function(){var d=f.map(a,function(h){return!h||f.isString(h)?h:c.model.getIdentity(h)}),g=[];f.forEach(d,function(h){g=g.concat(c._itemNodesMap[h]||
[])});this.set("selectedNodes",g)}))},_setPathAttr:function(a){return a.length?this.set("paths",[a]):this.set("paths",[])},_setPathsAttr:function(a){function c(h,i,j){var k=h.shift(),m=f.filter(i,function(n){return n.getIdentity()==k})[0];if(m)h.length?g._expandNode(m).addCallback(function(){c(h,m.getChildren(),j)}):j.callback(m);else j.errback("Could not expand path at "+k)}function d(h){g.set("selectedNodes",f.map(f.filter(h,function(i){return i[0]}),function(i){return i[1]}))}var g=this;return(new f.DeferredList(f.map(a,
function(h){var i=new f.Deferred;h=f.map(h,function(j){return f.isString(j)?j:g.model.getIdentity(j)});h.length?g._loadDeferred.addCallback(function(){c(h,[g.rootNode],i)}):i.errback("Empty path");return i}))).addCallback(d)},_setSelectedNodeAttr:function(a){this.set("selectedNodes",[a])},_setSelectedNodesAttr:function(a){this._loadDeferred.addCallback(f.hitch(this,function(){this.dndController.setSelection(a)}))},mayHaveChildren:function(){},getItemChildren:function(){},getLabel:function(a){return this.model.getLabel(a)},
getIconClass:function(a,c){return!a||this.model.mayHaveChildren(a)?c?"dijitFolderOpened":"dijitFolderClosed":"dijitLeaf"},getLabelClass:function(){},getRowClass:function(){},getIconStyle:function(){},getLabelStyle:function(){},getRowStyle:function(){},getTooltip:function(){return""},_onKeyPress:function(a){if(!a.altKey){var c=f.keys,d=e.getEnclosingWidget(a.target);if(d){var g=a.charOrCode;if(typeof g=="string"&&g!=" "){if(!a.altKey&&!a.ctrlKey&&!a.shiftKey&&!a.metaKey){this._onLetterKeyNav({node:d,
key:g.toLowerCase()});f.stopEvent(a)}}else{if(this._curSearch){clearTimeout(this._curSearch.timer);delete this._curSearch}var h=this._keyHandlerMap;if(!h){h={};h[c.ENTER]="_onEnterKey";h[c.SPACE]=h[" "]="_onEnterKey";h[this.isLeftToRight()?c.LEFT_ARROW:c.RIGHT_ARROW]="_onLeftArrow";h[this.isLeftToRight()?c.RIGHT_ARROW:c.LEFT_ARROW]="_onRightArrow";h[c.UP_ARROW]="_onUpArrow";h[c.DOWN_ARROW]="_onDownArrow";h[c.HOME]="_onHomeKey";h[c.END]="_onEndKey";this._keyHandlerMap=h}if(this._keyHandlerMap[g]){this[this._keyHandlerMap[g]]({node:d,
item:d.item,evt:a});f.stopEvent(a)}}}}},_onEnterKey:function(a){this._publish("execute",{item:a.item,node:a.node});this.dndController.userSelect(a.node,f.isCopyKey(a.evt),a.evt.shiftKey);this.onClick(a.item,a.node,a.evt)},_onDownArrow:function(a){(a=this._getNextNode(a.node))&&a.isTreeNode&&this.focusNode(a)},_onUpArrow:function(a){a=a.node;var c=a.getPreviousSibling();if(c)for(a=c;a.isExpandable&&a.isExpanded&&a.hasChildren();){a=a.getChildren();a=a[a.length-1]}else{c=a.getParent();!this.showRoot&&
c===this.rootNode||(a=c)}a&&a.isTreeNode&&this.focusNode(a)},_onRightArrow:function(a){a=a.node;if(a.isExpandable&&!a.isExpanded)this._expandNode(a);else if(a.hasChildren())(a=a.getChildren()[0])&&a.isTreeNode&&this.focusNode(a)},_onLeftArrow:function(a){a=a.node;if(a.isExpandable&&a.isExpanded)this._collapseNode(a);else(a=a.getParent())&&a.isTreeNode&&!(!this.showRoot&&a===this.rootNode)&&this.focusNode(a)},_onHomeKey:function(){var a=this._getRootOrFirstNode();a&&this.focusNode(a)},_onEndKey:function(){for(var a=
this.rootNode;a.isExpanded;){a=a.getChildren();a=a[a.length-1]}a&&a.isTreeNode&&this.focusNode(a)},multiCharSearchDuration:250,_onLetterKeyNav:function(a){var c=this._curSearch;if(c){c.pattern+=a.key;clearTimeout(c.timer)}else c=this._curSearch={pattern:a.key,startNode:a.node};var d=this;c.timer=setTimeout(function(){delete d._curSearch},this.multiCharSearchDuration);a=c.startNode;do(a=this._getNextNode(a))||(a=this._getRootOrFirstNode());while(a!==c.startNode&&a.label.toLowerCase().substr(0,c.pattern.length)!=
c.pattern);a&&a.isTreeNode&&a!==c.startNode&&this.focusNode(a)},isExpandoNode:function(a,c){return f.isDescendant(a,c.expandoNode)},_onClick:function(a,c){var d=this.isExpandoNode(c.target,a);if(this.openOnClick&&a.isExpandable||d)a.isExpandable&&this._onExpandoClick({node:a});else{this._publish("execute",{item:a.item,node:a,evt:c});this.onClick(a.item,a,c);this.focusNode(a)}f.stopEvent(c)},_onDblClick:function(a,c){var d=c.target;d=d==a.expandoNode||d==a.expandoNodeText;if(this.openOnDblClick&&a.isExpandable||
d)a.isExpandable&&this._onExpandoClick({node:a});else{this._publish("execute",{item:a.item,node:a,evt:c});this.onDblClick(a.item,a,c);this.focusNode(a)}f.stopEvent(c)},_onExpandoClick:function(a){a=a.node;this.focusNode(a);a.isExpanded?this._collapseNode(a):this._expandNode(a)},onClick:function(){},onDblClick:function(){},onOpen:function(){},onClose:function(){},_getNextNode:function(a){if(a.isExpandable&&a.isExpanded&&a.hasChildren())return a.getChildren()[0];else{for(;a&&a.isTreeNode;){var c=a.getNextSibling();
if(c)return c;a=a.getParent()}return null}},_getRootOrFirstNode:function(){return this.showRoot?this.rootNode:this.rootNode.getChildren()[0]},_collapseNode:function(a){a._expandNodeDeferred&&delete a._expandNodeDeferred;if(a.isExpandable)if(a.state!="LOADING"){a.collapse();this.onClose(a.item,a);if(a.item){this._state(a.item,false);this._saveState()}}},_expandNode:function(a,c){if(a._expandNodeDeferred&&!c)return a._expandNodeDeferred;c=this.model;var d=a.item,g=this;switch(a.state){case "UNCHECKED":a.markProcessing();
var h=a._expandNodeDeferred=new f.Deferred;c.getChildren(d,function(i){a.unmarkProcessing();i=a.setChildItems(i);var j=g._expandNode(a,true);i.addCallback(function(){j.addCallback(function(){h.callback()})})},function(i){console.error(g,": error loading root children: ",i)});break;default:h=a._expandNodeDeferred=a.expand();this.onOpen(a.item,a);if(d){this._state(d,true);this._saveState()}}return h},focusNode:function(a){e.focus(a.labelNode)},_onNodeFocus:function(a){if(a&&a!=this.lastFocused){this.lastFocused&&
!this.lastFocused._destroyed&&this.lastFocused.setFocusable(false);a.setFocusable(true);this.lastFocused=a}},_onNodeMouseEnter:function(){},_onNodeMouseLeave:function(){},_onItemChange:function(a){var c=this._itemNodesMap[this.model.getIdentity(a)];if(c){var d=this.getLabel(a),g=this.getTooltip(a);f.forEach(c,function(h){h.set({item:a,label:d,tooltip:g});h._updateItemClasses(a)})}},_onItemChildrenChange:function(a,c){(a=this._itemNodesMap[this.model.getIdentity(a)])&&f.forEach(a,function(d){d.setChildItems(c)})},
_onItemDelete:function(a){a=this.model.getIdentity(a);var c=this._itemNodesMap[a];if(c){f.forEach(c,function(d){this.dndController.removeTreeNode(d);var g=d.getParent();g&&g.removeChild(d);d.destroyRecursive()},this);delete this._itemNodesMap[a]}},_initState:function(){if(this.persist){var a=f.cookie(this.cookieName);this._openedItemIds={};a&&f.forEach(a.split(","),function(c){this._openedItemIds[c]=true},this)}},_state:function(a,c){if(!this.persist)return false;var d=this.model.getIdentity(a);if(arguments.length===
1)return this._openedItemIds[d];if(c)this._openedItemIds[d]=true;else delete this._openedItemIds[d]},_saveState:function(){if(this.persist){var a=[];for(var c in this._openedItemIds)a.push(c);f.cookie(this.cookieName,a.join(","),{expires:365})}},destroy:function(){if(this._curSearch){clearTimeout(this._curSearch.timer);delete this._curSearch}this.rootNode&&this.rootNode.destroyRecursive();this.dndController&&!f.isString(this.dndController)&&this.dndController.destroy();this.rootNode=null;this.inherited(arguments)},
destroyRecursive:function(){this.destroy()},resize:function(a){a&&f.marginBox(this.domNode,a);this._nodePixelIndent=f._getMarginSize(this.tree.indentDetector).w;if(this.tree.rootNode)this.tree.rootNode.set("indent",this.showRoot?0:-1)},_createTreeNode:function(a){return new e._TreeNode(a)}});return e.Tree});define("text!orion/widgets/templates/_ExplorerTreeNode.html",function(){return'<div class="dijitTreeNode" waiRole="presentation">\n\t<div dojoAttachPoint="rowNode" class="dijitTreeRow"\n\t\twaiRole="presentation"\n\t\tdojoAttachEvent="onmouseenter:_onMouseEnter, onmouseleave:_onMouseLeave, onclick:_onClick, ondblclick:_onDblClick">\n\t\t<img src="${_blankGif}" alt="" dojoAttachPoint="expandoNode" class="dijitTreeExpando" waiRole="presentation" />\n\t\t<span dojoAttachPoint="expandoNodeText" class="dijitExpandoText" waiRole="presentation"></span>\n\t\t<span dojoAttachPoint="contentNode" class="dijitTreeContent" waiRole="presentation">\n\t\t\t<img src="${_blankGif}" alt="" dojoAttachPoint="iconNode" class="dijitIcon dijitTreeIcon" waiRole="presentation" />\n\t\t\t<!-- labelNode\'s innerText will be label string --\>\n\t\t\t<span dojoAttachPoint="labelNode" class="dijitTreeLabel" wairole="treeitem" tabindex="-1" waiState="selected-false" dojoAttachEvent="onfocus:_onLabelFocus"></span>\n\t\t\t<a href="" dojoAttachPoint="followLink"><img src="${_blankGif}" alt="" dojoAttachPoint="followNode" class="dijitIcon dijitTreeIcon follow" waiRole="link"></a>\n\t\t</span>\n\t</div>\n\t<div dojoAttachPoint="containerNode" class="dijitTreeContainer"\n\t\twaiRole="presentation" style="display: none;">\n\t</div>\n</div>'});
define("orion/widgets/ExplorerTree",["dojo","dijit","dijit/Tree","text!orion/widgets/templates/_ExplorerTreeNode.html"],function(f,e){f.declare("orion.widgets._ExplorerTreeNode",[e._TreeNode],{templateString:f.cache("orion","widgets/templates/_ExplorerTreeNode.html"),_updateItemClasses:function(a){this.inherited(arguments);this._applyClassAndStyle(a,"follow","Follow");typeof this.tree.updateFollowLink==="function"&&this.tree.updateFollowLink(a,this.followLink)}});f.declare("orion.widgets.ExplorerTree",
[e.Tree],{selectedNodes:{},postCreate:function(){f.connect(this,"onMouseDown",this._eatSelectionEvent);f.connect(this.domNode,"onselectstart",this._eatSelectionEvent);this.inherited(arguments)},getFollowClass:function(){},getFollowStyle:function(){},updateFollowLink:function(){},onFollowClick:function(){},getSelectedItems:function(){var a=[];this._forEachSelectedNode(function(c,d){a.push(d.item)});return a},_getSelectedNodes:function(){var a=[];this._forEachSelectedNode(function(c,d){a.push(d)});
return a},_forEachSelectedNode:function(a){var c=this.selectedNodes;for(var d in c)c.hasOwnProperty(d)&&a(d,c[d])},_createTreeNode:function(a){return new orion.widgets._ExplorerTreeNode(a)},_eatSelectionEvent:function(a){if(f.isCopyKey(a)||a.shiftKey)f.stopEvent(a)},_onClick:function(a,c){var d=c.target,g=d===a.expandoNode||d===a.expandoNodeText;d=d===a.followNode;if(f.isCopyKey(c)){this._toggleSelectNode(a);this.focusNode(a)}else if(c.shiftKey){if(this.selectedNode){this._selectRange(this.selectedNode,
a);this.focusNode(a)}}else{if(d)this.onFollowClick(a.item,a,c);else if(this.openOnClick&&a.isExpandable||g)a.isExpandable&&this._onExpandoClick({node:a});else{this._publish("execute",{item:a.item,node:a,evt:c});this.onClick(a.item,a,c);this.focusNode(a)}!g&&!d&&this._selectNode(a)}d||f.stopEvent(c)},_onItemDelete:function(a){var c=this._itemNodesMap[this.model.getIdentity(a)];if(c){var d=this;f.forEach(c,function(g){d._removeFromSelection(g)})}this.inherited(arguments)},_getVisibleAncestor:function(a){if(!a)return null;
for(var c=a.getParent();c&&!(c.isExpandable&&c.isExpanded);){a=c;c=c.getParent()}return a},_toggleSelectNode:function(a){if(this.selectedNodes[a.get("id")]){a.setSelected(false);this._removeFromSelection(a)}else{a.setSelected(true);this._addToSelection(a)}},_addToSelection:function(a){this.selectedNodes[a.get("id")]=a},_removeFromSelection:function(a){delete this.selectedNodes[a.get("id")]},_selectRange:function(a,c){function d(i,j){var k=[];i=i;do{k.push(i);i=g._getNextNode(i)}while(i&&i!==j);if(i===
j){k.push(j);return k}return null}a=this._getVisibleAncestor(a);c=this._getVisibleAncestor(c);if(a&&c)if(a===c)this._selectNode(a);else{var g=this,h=d(a,c);if(h)this._selectNodes(h.reverse(),true);else(h=d(c,a))?this._selectNodes(h,true):console.debug("Warning: couldn't select range from "+a.label+" to "+c.label)}},_selectNode:function(a){this._selectNodes(a?[a]:null)},_selectNodes:function(a){this._forEachSelectedNode(function(g,h){h._destroyed||h.setSelected(false)});this.selectedNodes={};if(a)for(var c=
0;c<a.length;c++){var d=a[c];d.setSelected(true);this._addToSelection(d);this.selectedNode=d}}})});define("text!orion/widgets/templates/DirectoryPrompterDialog.html",function(){return'<div class="dijitDialog" tabindex="-1" waiRole="dialog" waiState="labelledby-${id}_title">\n\t<div dojoAttachPoint="titleBar" class="dijitDialogTitleBar">\n\t\t<span dojoAttachPoint="titleNode" class="dijitDialogTitle" id="${id}_title"></span>\n\t\t<span dojoAttachPoint="closeButtonNode" class="dijitDialogCloseIcon" dojoAttachEvent="onclick: onCancel" title="${buttonCancel}">\n\t\t\t<span dojoAttachPoint="closeText" class="closeText" title="${buttonCancel}">x</span>\n\t\t</span>\n\t</div>\n\t<div dojoAttachPoint="containerNode" class="dijitDialogPaneContent">\n\t\t<!-- Actual content here --\>\n\t\t\t<div style="display: table">\n\t\t\t\t<div style="display: table-row" dojoAttachPoint="messageCell">\n\t\t\t\t\t<div style="display: table-cell;"><div style="width: 25em; padding-bottom: 5px;">${message}</div></div>\n\t\t\t\t</div>\n\t\t\t\t<div style="display: table-row"> \n\n\t\t\t\t\t<div style="display: table-cell; padding: 1px; vertical-align: bottom;">\n\t\t\t\t\t\t<div dojoAttachPoint="treeContainerNode" id="${id}_treeContainerNode" dojoType="dijit.layout.BorderContainer" style="width:25em; height:25em; overflow:auto;" design="sidebar" gutters="true">\n\t\t\t\t\t\t\t<div dojoAttachPoint="treeContentPane" class="dijitDialogPaneContent" id="${id}_treeContentPane dojoType="dijit.layout.ContentPane" region="center" gutters="true">\n\t\t\t\t\t\t\t\t<div dojoAttachPoint="browseDirectoryExplorerTree" class="explorerTreeClass" id="${id}_browseDirectoryExplorerTree" style="margin-top: -3px;"></div> \n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div style="display: table-cell; padding: 1px; vertical-align: bottom;">\n\t\t\t\t\t</div>\n\t\t\t\t\t<div style="display: table-cell; padding: 1px; vertical-align: bottom;">\n\t\t\t\t\t</div>\n\t\t\t\t</div> \n\t\t\t\t<div style="display: table-row">\n\t\t\t\t\t<div style="display: table-cell; padding: 1px;">\n\t\t\t\t\t</div>\n\t\t\t\t\t<div style="display: table-cell; padding: 1px;">\n\t\t\t\t\t</div>\n\t\t\t\t\t<div style="display: table-cell; padding: 1px;">\n\t\t\t\t\t\n\t\t\t\t\t\t<button dojoAttachPoint="directoryBrowserButton" dojoType="dijit.form.Button" type="submit" value="OK" style="padding: 20 0 10 0; float: right; clear: both;">${buttonOk}\n\t\t\t\t\t\t</button>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div> <!-- end table --\>\n\t</div> <!-- content pane --\>\n</div>'});
define("orion/widgets/DirectoryPrompterDialog",["dojo","dijit","orion/util","dijit/Dialog","dijit/form/Button","orion/widgets/ExplorerTree","orion/widgets/_OrionDialogMixin","text!orion/widgets/templates/DirectoryPrompterDialog.html"],function(f,e,a){f.declare("orion.widgets.DirectoryPrompterDialog",[e.Dialog,orion.widgets._OrionDialogMixin],{treeWidget:null,treeRoot:{},widgetsInTemplate:true,templateString:f.cache("orion","widgets/templates/DirectoryPrompterDialog.html"),constructor:function(){this.inherited(arguments);
this.options=arguments[0]||{}},postMixInProperties:function(){this.inherited(arguments);this.title=this.options.title||"Choose a Folder";this.buttonOk="OK";this.message=this.options.message||""},postCreate:function(){this.inherited(arguments);this.loadFolderList("/");this.message||f.style(this.messageCell,{display:"none"})},loadFolderList:function(c){c=a.makeRelative(c);this.treeRoot.Location=c;this.options.fileClient.loadWorkspace(c).then(f.hitch(this,function(d){for(var g in d)this.treeRoot[g]=
d[g];a.processNavigatorParent(this.treeRoot,d.Children);this.createTree()}))},createTree:function(){var c=new orion.widgets.DirectoryTreeModel(this.options.serviceRegistry,this.treeRoot,this.options.fileClient);this.treeWidget=new orion.widgets.ExplorerTree({id:"treeWidget",style:"width:100%; height:100%",model:c,showRoot:false,persist:true,openOnClick:false,getLabel:function(d){return d.Name},getIconClass:function(){return"folderItem"}});this.treeWidget.startup();f.byId(this.treeContentPane.id).appendChild(this.treeWidget.domNode)},
execute:function(){var c=this.treeWidget.getSelectedItems();this.onHide();this.options.func(c[0])}});orion.widgets.DirectoryTreeModel=function(){function c(d,g,h){this.registry=d;this.root=g;this.fileClient=h}c.prototype={destroy:function(){},getRoot:function(d){d(this.root)},mayHaveChildren:function(){return true},getChildren:function(d,g){if(d.children)g(d.children);else if(d.Directory!==undefined&&d.Directory===false)g([]);else d.Location?this.fileClient.fetchChildren(d.ChildrenLocation).then(f.hitch(this,
function(h){for(var i=[],j=0;j<h.length;j++)h[j].Directory&&i.push(h[j]);a.processNavigatorParent(d,i);g(i)})):g([])},getIdentity:function(d){return d.Name?d.Location:"ROOT"},getLabel:function(d){return d.Name},onChildrenChange:function(){}};return c}()});define("dojox",["dojo"],function(f){return dojox=f._dojox||{}});
define("dojox/form/uploader/Base",["dojo","dijit","dojox","dojox/form/uploader/Base","dijit/_Widget","dijit/_Templated"],function(f,e){f.declare("dojox.form.uploader.Base",[e._Widget,e._Templated],{getForm:function(){if(!this.form)for(var a=this.domNode;a&&a.tagName&&a!==document.body;){if(a.tagName.toLowerCase()=="form"){this.form=a;break}a=a.parentNode}return this.form},getUrl:function(){if(this.uploadUrl)this.url=this.uploadUrl;if(this.url)return this.url;if(this.getForm())this.url=this.form.action;
return this.url},connectForm:function(){this.url=this.getUrl();if(!this._fcon&&this.getForm()){this._fcon=true;this.connect(this.form,"onsubmit",function(a){f.stopEvent(a);this.submit(f.formToObject(this.form))})}},supports:function(a){if(!this._hascache){this._hascache={testDiv:f.create("div"),testInput:f.create("input",{type:"file"}),xhr:window.XMLHttpRequest?new XMLHttpRequest:{}};f.style(this._hascache.testDiv,"opacity",0.7)}switch(a){case "FormData":return!!window.FormData;case "sendAsBinary":return!!this._hascache.xhr.sendAsBinary;
case "opacity":return f.style(this._hascache.testDiv,"opacity")==0.7;case "multiple":if(this.force=="flash"||this.force=="iframe")return false;a=f.attr(this._hascache.testInput,"multiple");return a===true||a===false}return false},getMimeType:function(){return"application/octet-stream"},getFileType:function(a){return a.substring(a.lastIndexOf(".")+1).toUpperCase()},convertBytes:function(a){var c=Math.round(a/1024*1E5)/1E5,d=Math.round(a/1048576*1E5)/1E5,g=Math.round(a/1073741824*1E5)/1E5,h=a;if(c>
1)h=c.toFixed(1)+" kb";if(d>1)h=d.toFixed(1)+" mb";if(g>1)h=g.toFixed(1)+" gb";return{kb:c,mb:d,gb:g,bytes:a,value:h}}})});
define("dojox/form/Uploader",["dojo","dijit","dojox","dojox/form/uploader/Base"],function(f,e,a){f.declare("dojox.form.Uploader",[a.form.uploader.Base],{uploadOnSelect:false,tabIndex:0,multiple:false,label:"Upload...",url:"",name:"uploadedfile",flashFieldName:"",uploadType:"form",_nameIndex:0,widgetsInTemplate:true,templateString:'<div class="dojoxFileInput"><div dojoType="dijit.form.Button" dojoAttachPoint="button">${label}</div></div>',postMixInProperties:function(){this._inputs=[];this._getButtonStyle(this.srcNodeRef);
this.inherited(arguments)},postCreate:function(){var c=false,d=this._getNodePosition(this.domNode);if(!this.btnSize.w||!this.btnSize.h){f.body().appendChild(this.domNode);this._getButtonStyle(this.domNode);c=true}this._setButtonStyle();c&&f.place(this.domNode,d.node,d.pos);this.inherited(arguments)},onChange:function(){},onBegin:function(){},onProgress:function(){},onComplete:function(){this.reset()},onCancel:function(){},onAbort:function(){},onError:function(){},upload:function(){},submit:function(){},
reset:function(){this._disconnectButton();f.forEach(this._inputs,f.destroy,f);this._inputs=[];this._nameIndex=0;this._createInput()},getFileList:function(){var c=[];this.supports("multiple")?f.forEach(this.inputNode.files,function(d,g){c.push({index:g,name:d.name,size:d.size,type:d.type})},this):f.forEach(this._inputs,function(d,g){c.push({index:g,name:d.value.substring(d.value.lastIndexOf("\\")+1),size:0,type:d.value.substring(d.value.lastIndexOf(".")+1)})},this);return c},_getValueAttr:function(){return this.getFileList()},
_setValueAttr:function(){console.error("Uploader value is read only")},_getDisabledAttr:function(){return this._disabled},_setDisabledAttr:function(c){if(this._disabled!=c){this.button.set("disabled",c);f.style(this.inputNode,"display",c?"none":"block")}},_getNodePosition:function(c){if(c.previousSibling)return{node:c.previousSibling,pos:"after"};return{node:c.nextSibling,pos:"before"}},_getButtonStyle:function(c){this.btnSize=c?f.marginBox(c):{w:80,h:25}},_setButtonStyle:function(){var c=true;if(!this.domNode.parentNode||
!this.domNode.parentNode.tagName){document.body.appendChild(this.domNode);c=false}f.style(this.domNode,{width:this.btnSize.w+"px",height:this.btnSize.h+4+"px",overflow:"hidden",position:"relative"});this.inputNodeFontSize=Math.max(2,Math.max(Math.ceil(this.btnSize.w/60),Math.ceil(this.btnSize.h/15)));this._createInput();f.style(this.button.domNode,{margin:"0px",display:"block",verticalAlign:"top"});f.style(this.button.domNode.firstChild,{margin:"0px",display:"block"});c||document.body.removeChild(this.domNode)},
_createInput:function(){if(this._inputs.length){f.style(this.inputNode,{top:"500px"});this._disconnectButton();this._nameIndex++}var c;c=this.supports("multiple")?this.name+"s[]":this.name+(this.multiple?this._nameIndex:"");this.inputNode=f.create("input",{type:"file",name:c,className:"dojoxInputNode"},this.domNode,"first");this.supports("multiple")&&this.multiple&&f.attr(this.inputNode,"multiple",true);this._inputs.push(this.inputNode);f.style(this.inputNode,{fontSize:this.inputNodeFontSize+"em"});
c=f.marginBox(this.inputNode);f.style(this.inputNode,{position:"absolute",top:"-2px",left:"-"+(c.w-this.btnSize.w-2)+"px",opacity:0});this._connectButton()},_connectButton:function(){this._cons=[];var c=f.hitch(this,function(g){this._cons.push(f.connect(this.inputNode,g,this,function(){this.button._cssMouseEvent({type:g})}))});c("mouseover");c("mouseout");c("mousedown");this._cons.push(f.connect(this.inputNode,"change",this,function(g){this.onChange(this.getFileList(g));!this.supports("multiple")&&
this.multiple&&this._createInput()}));this.button.set("tabIndex",-1);if(this.tabIndex>-1){this.inputNode.tabIndex=this.tabIndex;var d=f.style(this.button.domNode.firstChild,"border");this._cons.push(f.connect(this.inputNode,"focus",this,function(){f.style(this.button.domNode.firstChild,"border","1px dashed #ccc")}));this._cons.push(f.connect(this.inputNode,"blur",this,function(){f.style(this.button.domNode.firstChild,"border",d)}))}},_disconnectButton:function(){f.forEach(this._cons,f.disconnect,
f)}});(function(){a.form.UploaderOrg=a.form.Uploader;var c=[a.form.UploaderOrg];a.form.addUploaderPlugin=function(d){c.push(d);f.declare("dojox.form.Uploader",c,{})}})()});
define("dojox/form/uploader/FileList",["dojo","dijit","dojox","dojox/form/uploader/Base","dijit/_Widget","dijit/_Templated"],function(f,e,a){f.declare("dojox.form.uploader.FileList",[a.form.uploader.Base],{uploaderId:"",uploader:null,headerIndex:"#",headerType:"Type",headerFilename:"File Name",headerFilesize:"Size",_upCheckCnt:0,rowAmt:0,templateString:'<div class="dojoxUploaderFileList"><div dojoAttachPoint="progressNode" class="dojoxUploaderFileListProgress"><div dojoAttachPoint="percentBarNode" class="dojoxUploaderFileListProgressBar"></div><div dojoAttachPoint="percentTextNode" class="dojoxUploaderFileListPercentText">0%</div></div><table class="dojoxUploaderFileListTable"><tr class="dojoxUploaderFileListHeader"><th class="dojoxUploaderIndex">${headerIndex}</th><th class="dojoxUploaderIcon">${headerType}</th><th class="dojoxUploaderFileName">${headerFilename}</th><th class="dojoxUploaderFileSize">${headerFilesize}</th></tr><tr ><td colSpan="4" class="dojoxUploaderFileListContainer" dojoAttachPoint="containerNode"><table class="dojoxUploaderFileListContent" dojoAttachPoint="listNode"></table></td><tr></table><div>',
postCreate:function(){this.setUploader();this.hideProgress()},reset:function(){for(var c=0;c<this.rowAmt;c++)this.listNode.deleteRow(0);this.rowAmt=0},setUploader:function(){if(!this.uploaderId&&!this.uploader)console.warn("uploaderId not passed to UploaderFileList");else if(this.uploaderId&&!this.uploader)this.uploader=e.byId(this.uploaderId);else if(this._upCheckCnt>4){console.warn("uploader not found for ID ",this.uploaderId);return}if(this.uploader){this.connect(this.uploader,"onChange","_onUploaderChange");
this.connect(this.uploader,"reset","reset");this.connect(this.uploader,"onBegin",function(){this.showProgress(true)});this.connect(this.uploader,"onProgress","_progress");this.connect(this.uploader,"onComplete",function(){setTimeout(f.hitch(this,function(){this.hideProgress(true)}),1250)})}else{this._upCheckCnt++;setTimeout(f.hitch(this,"setUploader"),250)}},hideProgress:function(c){this._hideShowProgress(c?{ani:true,endDisp:"none",beg:15,end:0}:{endDisp:"none",ani:false})},showProgress:function(c){this._hideShowProgress(c?
{ani:true,endDisp:"block",beg:0,end:15}:{endDisp:"block",ani:false})},_progress:function(c){this.percentTextNode.innerHTML=c.percent;f.style(this.percentBarNode,"width",c.percent)},_hideShowProgress:function(c){var d=this.progressNode,g=function(){f.style(d,"display",c.endDisp)};if(c.ani){f.style(d,"display","block");f.animateProperty({node:d,properties:{height:{start:c.beg,end:c.end,units:"px"}},onEnd:g}).play()}else g()},_onUploaderChange:function(c){this.reset();f.forEach(c,function(d,g){this._addRow(g+
1,this.getFileType(d.name),d.name,d.size)},this)},_addRow:function(c,d,g,h){var i,j=this.listNode.insertRow(-1);i=j.insertCell(-1);f.addClass(i,"dojoxUploaderIndex");i.innerHTML=c;i=j.insertCell(-1);f.addClass(i,"dojoxUploaderIcon");i.innerHTML=d;i=j.insertCell(-1);f.addClass(i,"dojoxUploaderFileName");i.innerHTML=g;i=j.insertCell(-1);f.addClass(i,"dojoxUploaderSize");i.innerHTML=this.convertBytes(h).value;this.rowAmt++}})});
define("dojo/io/iframe",["dojo"],function(f){f.getObject("io",true,f);f.io.iframe={create:function(e,a,c){if(window[e])return window[e];if(window.frames[e])return window.frames[e];var d=null;c=c;if(!c){f.config.useXDomain&&!f.config.dojoBlankHtmlUrl&&console.warn("dojo.io.iframe.create: When using cross-domain Dojo builds, please save dojo/resources/blank.html to your domain and set djConfig.dojoBlankHtmlUrl to the path on your domain to blank.html");c=f.config.dojoBlankHtmlUrl||f.moduleUrl("dojo",
"resources/blank.html")}d=f.place('<iframe id="'+e+'" name="'+e+'" src="'+c+'" onload="'+a+'" style="position: absolute; left: 1px; top: 1px; height: 1px; width: 1px; visibility: hidden">',f.body());return window[e]=d},setSrc:function(e,a,c){try{if(c){var d;if(d=f.isIE||f.isWebKit?e.contentWindow.document:e.contentWindow)d.location.replace(a);else e.location=a}else if(f.isWebKit)e.location=a;else frames[e.name].location=a}catch(g){console.log("dojo.io.iframe.setSrc: ",g)}},doc:function(e){return e.contentDocument||
e.name&&e.document&&f.doc.getElementsByTagName("iframe")[e.name].contentWindow&&f.doc.getElementsByTagName("iframe")[e.name].contentWindow.document||e.name&&f.doc.frames[e.name]&&f.doc.frames[e.name].document||null},send:function(e){if(!this._frame)this._frame=this.create(this._iframeName,f._scopeName+".io.iframe._iframeOnload();");e=f._ioSetArgs(e,function(a){a.canceled=true;a.ioArgs._callNext()},function(a){var c=null;try{var d=a.ioArgs,g=f.io.iframe,h=g.doc(g._frame),i=d.handleAs;c=h;if(i!="html")if(i==
"xml"){if(f.isIE<9||f.isIE&&f.isQuirks){f.query("a",g._frame.contentWindow.document.documentElement).orphan();var j=g._frame.contentWindow.document.documentElement.innerText;j=j.replace(/>\s+</g,"><");j=f.trim(j);c=f._contentHandlers.xml({responseText:j})}}else{c=h.getElementsByTagName("textarea")[0].value;if(i=="json")c=f.fromJson(c);else if(i=="javascript")c=f.eval(c)}}catch(k){c=k}finally{d._callNext()}return c},function(a,c){c.ioArgs._hasError=true;c.ioArgs._callNext();return a});e.ioArgs._callNext=
function(){if(!this._calledNext){this._calledNext=true;f.io.iframe._currentDfd=null;f.io.iframe._fireNextRequest()}};this._dfdQueue.push(e);this._fireNextRequest();f._ioWatch(e,function(a){return!a.ioArgs._hasError},function(a){return!!a.ioArgs._finished},function(a){a.ioArgs._finished?a.callback(a):a.errback(new Error("Invalid dojo.io.iframe request state"))});return e},_currentDfd:null,_dfdQueue:[],_iframeName:f._scopeName+"IoIframe",_fireNextRequest:function(){try{if(!(this._currentDfd||this._dfdQueue.length==
0)){do var e=this._currentDfd=this._dfdQueue.shift();while(e&&e.canceled&&this._dfdQueue.length);if(!e||e.canceled)this._currentDfd=null;else{var a=e.ioArgs,c=a.args;a._contentToClean=[];var d=f.byId(c.form),g=c.content||{};if(d){if(g){var h=function(w,s){f.create("input",{type:"hidden",name:w,value:s},d);a._contentToClean.push(w)};for(var i in g){var j=g[i];if(f.isArray(j)&&j.length>1){var k;for(k=0;k<j.length;k++)h(i,j[k])}else if(d[i])d[i].value=j;else h(i,j)}}var m=d.getAttributeNode("action"),
n=d.getAttributeNode("method"),p=d.getAttributeNode("target");if(c.url){a._originalAction=m?m.value:null;if(m)m.value=c.url;else d.setAttribute("action",c.url)}if(!n||!n.value)if(n)n.value=c.method?c.method:"post";else d.setAttribute("method",c.method?c.method:"post");a._originalTarget=p?p.value:null;if(p)p.value=this._iframeName;else d.setAttribute("target",this._iframeName);d.target=this._iframeName;f._ioNotifyStart(e);d.submit()}else{h=c.url+(c.url.indexOf("?")>-1?"&":"?")+a.query;f._ioNotifyStart(e);
this.setSrc(this._frame,h,true)}}}}catch(r){e.errback(r)}},_iframeOnload:function(){var e=this._currentDfd;if(e){e=e.ioArgs;var a=f.byId(e.args.form);if(a){for(var c=e._contentToClean,d=0;d<c.length;d++)for(var g=c[d],h=0;h<a.childNodes.length;h++){var i=a.childNodes[h];if(i.name==g){f.destroy(i);break}}e._originalAction&&a.setAttribute("action",e._originalAction);if(e._originalTarget){a.setAttribute("target",e._originalTarget);a.target=e._originalTarget}}e._finished=true}else this._fireNextRequest()}};
return f.io.iframe});
define("dojox/form/uploader/plugins/HTML5",["dojo","dijit","dojox","dojox/form/Uploader"],function(f,e,a){f.declare("dojox.form.uploader.plugins.HTML5",[],{errMsg:"Error uploading files. Try checking permissions",uploadType:"html5",postCreate:function(){this.connectForm();this.inherited(arguments);this.uploadOnSelect&&this.connect(this,"onChange","upload")},upload:function(c){this.onBegin(this.getFileList());if(this.supports("FormData"))this.uploadWithFormData(c);else this.supports("sendAsBinary")&&this.sendAsBinary(c)},
submit:function(c){c=c?c.tagName?c:this.getForm():this.getForm();c=f.formToObject(c);console.log("form data:",c);this.upload(c)},sendAsBinary:function(c){if(this.getUrl()){var d="---------------------------"+(new Date).getTime(),g=this.createXhr();g.setRequestHeader("Content-Type","multipart/form-data; boundary="+d);(c=this._buildRequestBody(c,d))?g.sendAsBinary(c):this.onError(this.errMsg)}else console.error("No upload url found.",this)},uploadWithFormData:function(c){if(this.getUrl()){var d=new FormData;
f.forEach(this.inputNode.files,function(h){d.append(this.name+"s[]",h)},this);if(c)for(var g in c)d.append(g,c[g]);this.createXhr().send(d)}else console.error("No upload url found.",this)},_xhrProgress:function(c){if(c.lengthComputable){var d={bytesLoaded:c.loaded,bytesTotal:c.total,type:c.type,timeStamp:c.timeStamp};if(c.type=="load"){d.percent="100%";d.decimal=1}else{d.decimal=c.loaded/c.total;d.percent=Math.ceil(c.loaded/c.total*100)+"%"}this.onProgress(d)}},createXhr:function(){var c=new XMLHttpRequest,
d;c.upload.addEventListener("progress",f.hitch(this,"_xhrProgress"),false);c.addEventListener("load",f.hitch(this,"_xhrProgress"),false);c.addEventListener("error",f.hitch(this,function(g){this.onError(g);clearInterval(d)}),false);c.addEventListener("abort",f.hitch(this,function(g){this.onAbort(g);clearInterval(d)}),false);c.onreadystatechange=f.hitch(this,function(){if(c.readyState===4){console.info("COMPLETE");clearInterval(d);this.onComplete(f.eval(c.responseText))}});c.open("POST",this.getUrl());
d=setInterval(f.hitch(this,function(){}),250);return c},_buildRequestBody:function(c,d){var g="";d="--"+d;var h=[];f.forEach(this.inputNode.files,function(j,k){j=this.name+"s[]";var m=this.inputNode.files[k].fileName,n;try{n=this.inputNode.files[k].getAsBinary()+"\r\n";g+=d+"\r\n";g+="Content-Disposition: form-data; ";g+='name="'+j+'"; ';g+='filename="'+m+'"\r\n';g+="Content-Type: "+this.getMimeType()+"\r\n\r\n";g+=n}catch(p){h.push({index:k,name:m})}},this);if(h.length)if(h.length>=this.inputNode.files.length){this.onError({message:this.errMsg,
filesInError:h});g=false}if(!g)return false;if(c)for(var i in c){g+=d+"\r\n";g+="Content-Disposition: form-data; ";g+='name="'+i+'"\r\n\r\n';g+=c[i]+"\r\n"}g+=d+"--\r\n";return g}});a.form.addUploaderPlugin(a.form.uploader.plugins.HTML5)});
define("dojox/form/uploader/plugins/IFrame",["dojo","dijit","dojox","dojo/io/iframe","dojox/form/uploader/plugins/HTML5","dojox/form/Uploader"],function(f,e,a){f.declare("dojox.form.uploader.plugins.IFrame",[],{force:"",postMixInProperties:function(){this.inherited(arguments);if(!this.supports("multiple"))this.uploadType="iframe"},upload:function(c){if(!this.supports("multiple")||this.force=="iframe"){this.uploadIFrame(c);f.stopEvent(c)}},uploadIFrame:function(){this.getUrl();f.io.iframe.send({url:this.getUrl(),
form:this.form,handleAs:"json",error:f.hitch(this,function(c){console.error("HTML Upload Error:"+c.message)}),load:f.hitch(this,function(c){this.onComplete(c)})})}});a.form.addUploaderPlugin(a.form.uploader.plugins.IFrame)});define("text!dijit/templates/ProgressBar.html",function(){return'<div class="dijitProgressBar dijitProgressBarEmpty" role="progressbar"\n\t><div  dojoAttachPoint="internalProgress" class="dijitProgressBarFull"\n\t\t><div class="dijitProgressBarTile" role="presentation"></div\n\t\t><span style="visibility:hidden">&nbsp;</span\n\t></div\n\t><div dojoAttachPoint="labelNode" class="dijitProgressBarLabel" id="${id}_label"></div\n\t><img dojoAttachPoint="indeterminateHighContrastImage" class="dijitProgressBarIndeterminateHighContrastImage" alt=""\n/></div>'});
define("dojo/cldr/nls/number",{root:{scientificFormat:"#E0","currencySpacing-afterCurrency-currencyMatch":"[:letter:]",infinity:"\u221e",list:";",percentSign:"%",minusSign:"-","currencySpacing-beforeCurrency-surroundingMatch":"[:digit:]","decimalFormat-short":"000T","currencySpacing-afterCurrency-insertBetween":"\u00a0",nan:"NaN",nativeZeroDigit:"0",plusSign:"+","currencySpacing-afterCurrency-surroundingMatch":"[:digit:]","currencySpacing-beforeCurrency-currencyMatch":"[:letter:]",currencyFormat:"\u00a4\u00a0#,##0.00",
perMille:"\u2030",group:",",percentFormat:"#,##0%",decimalFormat:"#,##0.###",decimal:".",patternDigit:"#","currencySpacing-beforeCurrency-insertBetween":"\u00a0",exponential:"E"},ar:true,ca:true,cs:true,da:true,de:true,el:true,en:true,"en-au":true,"en-gb":true,es:true,fi:true,fr:true,"fr-ch":true,he:true,hu:true,it:true,ja:true,ko:true,nb:true,nl:true,pl:true,pt:true,"pt-pt":true,ro:true,ru:true,sk:true,sl:true,sv:true,th:true,tr:true,zh:true,"zh-hant":true,"zh-hk":true});
define("dojo/cldr/nls/en/number",{group:",",percentSign:"%",exponential:"E",scientificFormat:"#E0",percentFormat:"#,##0%",list:";",infinity:"\u221e",patternDigit:"#",minusSign:"-",decimal:".",nan:"NaN",nativeZeroDigit:"0",perMille:"\u2030",decimalFormat:"#,##0.###",currencyFormat:"\u00a4#,##0.00;(\u00a4#,##0.00)",plusSign:"+","decimalFormat-short":"000T"});
define("dojo/number",["dojo","dojo/i18n","i18n!dojo/cldr/nls/number","dojo/string","dojo/regexp"],function(f){f.getObject("number",true,f);f.number.format=function(e,a){a=f.mixin({},a||{});var c=f.i18n.normalizeLocale(a.locale);c=f.i18n.getLocalization("dojo.cldr","number",c);a.customs=c;c=a.pattern||c[(a.type||"decimal")+"Format"];if(isNaN(e)||Math.abs(e)==Infinity)return null;return f.number._applyPattern(e,c,a)};f.number._numberPatternRE=/[#0,]*[#0](?:\.0*#*)?/;f.number._applyPattern=function(e,
a,c){c=c||{};var d=c.customs.group,g=c.customs.decimal;a=a.split(";");var h=a[0];a=a[e<0?1:0]||"-"+h;if(a.indexOf("%")!=-1)e*=100;else if(a.indexOf("\u2030")!=-1)e*=1E3;else if(a.indexOf("\u00a4")!=-1){d=c.customs.currencyGroup||d;g=c.customs.currencyDecimal||g;a=a.replace(/\u00a4{1,3}/,function(j){return c[["symbol","currency","displayName"][j.length-1]]||c.currency||""})}else if(a.indexOf("E")!=-1)throw new Error("exponential notation not supported");var i=f.number._numberPatternRE;h=h.match(i);
if(!h)throw new Error("unable to find a number expression in pattern: "+a);if(c.fractional===false)c.places=0;return a.replace(i,f.number._formatAbsolute(e,h[0],{decimal:g,group:d,places:c.places,round:c.round}))};f.number.round=function(e,a,c){c=10/(c||10);return(c*+e).toFixed(a)/c};(0.9).toFixed()==0&&function(){var e=f.number.round;f.number.round=function(a,c,d){var g=Math.pow(10,-c||0),h=Math.abs(a);if(!a||h>=g||h*Math.pow(10,c+1)<5)g=0;return e(a,c,d)+(a>0?g:-g)}}();f.number._formatAbsolute=
function(e,a,c){c=c||{};if(c.places===true)c.places=0;if(c.places===Infinity)c.places=6;a=a.split(".");var d=typeof c.places=="string"&&c.places.indexOf(","),g=c.places;if(d)g=c.places.substring(d+1);else if(!(g>=0))g=(a[1]||[]).length;c.round<0||(e=f.number.round(e,g,c.round));e=String(Math.abs(e)).split(".");var h=e[1]||"";if(a[1]||c.places){if(d)c.places=c.places.substring(0,d);d=c.places!==undefined?c.places:a[1]&&a[1].lastIndexOf("0")+1;if(d>h.length)e[1]=f.string.pad(h,d,"0",true);if(g<h.length)e[1]=
h.substr(0,g)}else e[1]&&e.pop();g=a[0].replace(",","");d=g.indexOf("0");if(d!=-1){d=g.length-d;if(d>e[0].length)e[0]=f.string.pad(e[0],d);if(g.indexOf("#")==-1)e[0]=e[0].substr(e[0].length-d)}g=a[0].lastIndexOf(",");var i,j;if(g!=-1){i=a[0].length-g-1;a=a[0].substr(0,g);g=a.lastIndexOf(",");if(g!=-1)j=a.length-g-1}a=[];for(g=e[0];g;){d=g.length-i;a.push(d>0?g.substr(d):g);g=d>0?g.slice(0,d):"";if(j){i=j;delete j}}e[0]=a.reverse().join(c.group||",");return e.join(c.decimal||".")};f.number.regexp=
function(e){return f.number._parseInfo(e).regexp};f.number._parseInfo=function(e){e=e||{};var a=f.i18n.normalizeLocale(e.locale);a=f.i18n.getLocalization("dojo.cldr","number",a);var c=e.pattern||a[(e.type||"decimal")+"Format"],d=a.group,g=a.decimal,h=1;if(c.indexOf("%")!=-1)h/=100;else if(c.indexOf("\u2030")!=-1)h/=1E3;else{var i=c.indexOf("\u00a4")!=-1;if(i){d=a.currencyGroup||d;g=a.currencyDecimal||g}}a=c.split(";");a.length==1&&a.push("-"+a[0]);a=f.regexp.buildGroupRE(a,function(j){j="(?:"+f.regexp.escapeString(j,
".")+")";return j.replace(f.number._numberPatternRE,function(k){var m={signed:false,separator:e.strict?d:[d,""],fractional:e.fractional,decimal:g,exponent:false};k=k.split(".");var n=e.places;if(k.length==1&&h!=1)k[1]="###";if(k.length==1||n===0)m.fractional=false;else{if(n===undefined)n=e.pattern?k[1].lastIndexOf("0")+1:Infinity;if(n&&e.fractional==undefined)m.fractional=true;if(!e.places&&n<k[1].length)n+=","+k[1].length;m.places=n}k=k[0].split(",");if(k.length>1){m.groupSize=k.pop().length;if(k.length>
1)m.groupSize2=k.pop().length}return"("+f.number._realNumberRegexp(m)+")"})},true);if(i)a=a.replace(/([\s\xa0]*)(\u00a4{1,3})([\s\xa0]*)/g,function(j,k,m,n){j=f.regexp.escapeString(e[["symbol","currency","displayName"][m.length-1]]||e.currency||"");k=k?"[\\s\\xa0]":"";n=n?"[\\s\\xa0]":"";if(!e.strict){if(k)k+="*";if(n)n+="*";return"(?:"+k+j+n+")?"}return k+j+n});return{regexp:a.replace(/[\xa0 ]/g,"[\\s\\xa0]"),group:d,decimal:g,factor:h}};f.number.parse=function(e,a){a=f.number._parseInfo(a);e=(new RegExp("^"+
a.regexp+"$")).exec(e);if(!e)return NaN;var c=e[1];if(!e[1]){if(!e[2])return NaN;c=e[2];a.factor*=-1}c=c.replace(new RegExp("["+a.group+"\\s\\xa0]","g"),"").replace(a.decimal,".");return c*a.factor};f.number._realNumberRegexp=function(e){e=e||{};if(!("places"in e))e.places=Infinity;if(typeof e.decimal!="string")e.decimal=".";if(!("fractional"in e)||/^0/.test(e.places))e.fractional=[true,false];if(!("exponent"in e))e.exponent=[true,false];if(!("eSigned"in e))e.eSigned=[true,false];var a=f.number._integerRegexp(e),
c=f.regexp.buildGroupRE(e.fractional,function(g){var h="";if(g&&e.places!==0){h="\\"+e.decimal;if(e.places==Infinity)h="(?:"+h+"\\d+)?";else h+="\\d{"+e.places+"}"}return h},true),d=f.regexp.buildGroupRE(e.exponent,function(g){if(g)return"([eE]"+f.number._integerRegexp({signed:e.eSigned})+")";return""});a=a+c;if(c)a="(?:(?:"+a+")|(?:"+c+"))";return a+d};f.number._integerRegexp=function(e){e=e||{};if(!("signed"in e))e.signed=[true,false];if("separator"in e){if(!("groupSize"in e))e.groupSize=3}else e.separator=
"";var a=f.regexp.buildGroupRE(e.signed,function(d){return d?"[-+]":""},true),c=f.regexp.buildGroupRE(e.separator,function(d){if(!d)return"(?:\\d+)";d=f.regexp.escapeString(d);if(d==" ")d="\\s";else if(d=="\u00a0")d="\\s\\xa0";var g=e.groupSize,h=e.groupSize2;if(h){d="(?:0|[1-9]\\d{0,"+(h-1)+"}(?:["+d+"]\\d{"+h+"})*["+d+"]\\d{"+g+"})";return g-h>0?"(?:"+d+"|(?:0|[1-9]\\d{0,"+(g-1)+"}))":d}return"(?:0|[1-9]\\d{0,"+(g-1)+"}(?:["+d+"]\\d{"+g+"})*)"},true);return a+c};return f.number});
define("dijit/ProgressBar",["dojo","dijit","text!dijit/templates/ProgressBar.html","dojo/fx","dojo/number","dijit/_Widget","dijit/_Templated"],function(f,e){f.declare("dijit.ProgressBar",[e._Widget,e._Templated],{progress:"0",value:"",maximum:100,places:0,indeterminate:false,label:"",name:"",templateString:f.cache("dijit","templates/ProgressBar.html"),_indeterminateHighContrastImagePath:f.moduleUrl("dijit","themes/a11y/indeterminate_progress.gif"),postMixInProperties:function(){this.inherited(arguments);
if(!("value"in this.params))this.value=this.indeterminate?Infinity:this.progress},buildRendering:function(){this.inherited(arguments);this.indeterminateHighContrastImage.setAttribute("src",this._indeterminateHighContrastImagePath.toString());this.update()},update:function(a){f.mixin(this,a||{});a=this.internalProgress;var c=this.domNode,d=1;if(this.indeterminate){e.removeWaiState(c,"valuenow");e.removeWaiState(c,"valuemin");e.removeWaiState(c,"valuemax")}else{if(String(this.progress).indexOf("%")!=
-1){d=Math.min(parseFloat(this.progress)/100,1);this.progress=d*this.maximum}else{this.progress=Math.min(this.progress,this.maximum);d=this.progress/this.maximum}e.setWaiState(c,"describedby",this.labelNode.id);e.setWaiState(c,"valuenow",this.progress);e.setWaiState(c,"valuemin",0);e.setWaiState(c,"valuemax",this.maximum)}this.labelNode.innerHTML=this.report(d);f.toggleClass(this.domNode,"dijitProgressBarIndeterminate",this.indeterminate);a.style.width=d*100+"%";this.onChange()},_setValueAttr:function(a){this._set("value",
a);a==Infinity?this.update({indeterminate:true}):this.update({indeterminate:false,progress:a})},_setLabelAttr:function(a){this._set("label",a);this.update()},_setIndeterminateAttr:function(a){this.indeterminate=a;this.update()},report:function(a){return this.label?this.label:this.indeterminate?"&nbsp;":f.number.format(a,{type:"percent",places:this.places,locale:this.lang})},onChange:function(){}});return e.ProgressBar});define("text!orion/widgets/templates/ImportDialog.html",function(){return'<div class="dijitDialog" tabindex="-1" waiRole="dialog" waiState="labelledby-${id}_title">\n\t<div dojoAttachPoint="titleBar" class="dijitDialogTitleBar">\n\t\t<span dojoAttachPoint="titleNode" class="dijitDialogTitle" id="${id}_title"></span>\n\t\t<span dojoAttachPoint="closeButtonNode" class="dijitDialogCloseIcon" dojoAttachEvent="onclick: onCancel" title="${buttonCancel}">\n\t\t\t<span dojoAttachPoint="closeText" class="closeText" title="${buttonCancel}">x</span>\n\t\t</span>\n\t</div>\n\t<div dojoAttachPoint="containerNode" class="dijitDialogPaneContent">\n\t\t<!-- Actual content here --\>\n\n\t\t<form method="post" id="importDialog.myForm"\n\t\t\tenctype="multipart/form-data" >\n\t\t\t<fieldset>\n\t\t\t\t<div style="display: table-row">\n\t\t\t\t\t<div style="display: table-row; height: 20px">\n\t\t\t\t\t\t<div style="display: table-cell; padding: 1px;">\n\t\t\t\t\t\t\tFile:\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div style="display: table-cell; padding: 1px; vertical-align: top;">\n\t\t\t\t\t\t\t<div id="files" dojoType="dojox.form.uploader.FileList" uploaderId="importDialog.uploader"></div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div style="display: table-cell; padding: 1px;">\n\t\t\t\t\t\t\t<input name="uploadedfile" multiple="false" type="file" id="importDialog.uploader" force="iframe"\n\t\t\t\t\t\t\t\tdojoType="dojox.form.Uploader" style="height: 20px" label="Browse..." >\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div style="display: table-row">\n\t\t\t\t\t\t<div style="display: table-cell; padding: 1px;">\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div style="display: table-cell; padding: 1px;">\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div style="display: table-cell; padding: 1px;">\n\t\t\t\t\t\t\t<input type="submit" label="Finish" value="OK" dojoType="dijit.form.Button"\n\t\t\t\t\t\t\t\tstyle="padding: 20 0 10 0; float: right; clear: both;"/>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\t\n\t\t\t</fieldset>\n\t\t</form>\n\t</div>\n</div>'});
define("orion/widgets/ImportDialog",["dojo","dijit","dojox","dijit/Dialog","dojo/data/ItemFileReadStore","dojox/form/Uploader","dojox/form/uploader/FileList","dojox/form/uploader/plugins/IFrame","dijit/form/Button","dijit/ProgressBar","orion/widgets/_OrionDialogMixin","text!orion/widgets/templates/ImportDialog.html"],function(f,e){f.declare("orion.widgets.ImportDialog",[e.Dialog,orion.widgets._OrionDialogMixin],{widgetsInTemplate:true,templateString:f.cache("orion","widgets/templates/ImportDialog.html"),
constructor:function(){this.inherited(arguments);this.options=arguments[0]||{}},postMixInProperties:function(){this.inherited(arguments);this.title="Import from zip"},postCreate:function(){this.inherited(arguments);f.byId("importDialog.myForm").action=this.options.importLocation;f.byId("importDialog.uploader").url=this.options.importLocation;f.connect(e.byId("importDialog.uploader"),"onError",f.hitch(this,function(){setTimeout(f.hitch(this,function(){this.hide()}),2E3)}));f.connect(e.byId("importDialog.uploader"),
"onComplete",f.hitch(this,function(){setTimeout(f.hitch(this,function(){this.hide();this.options.func()}),2E3)}))}})});define("text!dijit/form/templates/DropDownBox.html",function(){return'<div class="dijit dijitReset dijitInlineTable dijitLeft"\n\tid="widget_${id}"\n\trole="combobox"\n\t><div class=\'dijitReset dijitRight dijitButtonNode dijitArrowButton dijitDownArrowButton dijitArrowButtonContainer\'\n\t\tdojoAttachPoint="_buttonNode, _popupStateNode" role="presentation"\n\t\t><input class="dijitReset dijitInputField dijitArrowButtonInner" value="&#9660; " type="text" tabIndex="-1" readonly="readonly" role="presentation"\n\t\t\t${_buttonInputDisabled}\n\t/></div\n\t><div class=\'dijitReset dijitValidationContainer\'\n\t\t><input class="dijitReset dijitInputField dijitValidationIcon dijitValidationInner" value="&#935; " type="text" tabIndex="-1" readonly="readonly" role="presentation"\n\t/></div\n\t><div class="dijitReset dijitInputField dijitInputContainer"\n\t\t><input class=\'dijitReset dijitInputInner\' ${!nameAttrSetting} type="text" autocomplete="off"\n\t\t\tdojoAttachPoint="textbox,focusNode" role="textbox" aria-haspopup="true"\n\t/></div\n></div>'});
define("dijit/form/nls/ComboBox",{root:{previousMessage:"Previous choices",nextMessage:"More choices"},zh:true,"zh-tw":true,tr:true,th:true,sv:true,sl:true,sk:true,ru:true,ro:true,pt:true,"pt-pt":true,pl:true,nl:true,nb:true,ko:true,kk:true,ja:true,it:true,hu:true,he:true,fr:true,fi:true,es:true,el:true,de:true,da:true,cs:true,ca:true,ar:true});
define("dijit/form/ComboBox",["dojo","dijit","text!dijit/form/templates/DropDownBox.html","dojo/window","dojo/regexp","dojo/data/util/simpleFetch","dojo/data/util/filter","dijit/_CssStateMixin","dijit/form/_FormWidget","dijit/form/ValidationTextBox","dijit/_HasDropDown","i18n!dijit/form/nls/ComboBox"],function(f,e){f.declare("dijit.form.ComboBoxMixin",e._HasDropDown,{item:null,pageSize:Infinity,store:null,fetchProperties:{},query:{},autoComplete:true,highlightMatch:"first",searchDelay:100,searchAttr:"name",
labelAttr:"",labelType:"text",queryExpr:"${0}*",ignoreCase:true,hasDownArrow:true,templateString:f.cache("dijit.form","templates/DropDownBox.html"),baseClass:"dijitTextBox dijitComboBox",dropDownClass:"dijit.form._ComboBoxMenu",cssStateNodes:{_buttonNode:"dijitDownArrowButton"},maxHeight:-1,_stopClickEvents:false,_getCaretPos:function(a){var c=0;if(typeof a.selectionStart=="number")c=a.selectionStart;else if(f.isIE){var d=f.doc.selection.createRange().duplicate();a=a.createTextRange();d.move("character",
0);a.move("character",0);try{a.setEndPoint("EndToEnd",d);c=String(a.text).replace(/\r/g,"").length}catch(g){}}return c},_setCaretPos:function(a,c){c=parseInt(c);e.selectInputText(a,c,c)},_setDisabledAttr:function(a){this.inherited(arguments);e.setWaiState(this.domNode,"disabled",a)},_abortQuery:function(){if(this.searchTimer){clearTimeout(this.searchTimer);this.searchTimer=null}if(this._fetchHandle){this._fetchHandle.abort&&this._fetchHandle.abort();this._fetchHandle=null}},_onInput:function(a){if(!this.searchTimer&&
(a.type=="paste"||a.type=="input")&&this._lastInput!=this.textbox.value)this.searchTimer=setTimeout(f.hitch(this,function(){this._onKey({charOrCode:229})}),100);this.inherited(arguments)},_onKey:function(a){var c=a.charOrCode;if(!(a.altKey||(a.ctrlKey||a.metaKey)&&c!="x"&&c!="v"||c==f.keys.SHIFT)){var d=false,g=this.dropDown,h=f.keys,i=null;this._prev_key_backspace=false;this._abortQuery();this.inherited(arguments);if(this._opened)i=g.getHighlightedOption();switch(c){case h.PAGE_DOWN:case h.DOWN_ARROW:case h.PAGE_UP:case h.UP_ARROW:this._opened&&
this._announceOption(i);f.stopEvent(a);break;case h.ENTER:if(i)if(i==g.nextButton){this._nextSearch(1);f.stopEvent(a);break}else{if(i==g.previousButton){this._nextSearch(-1);f.stopEvent(a);break}}else{this._setBlurValue();this._setCaretPos(this.focusNode,this.focusNode.value.length)}if(this._opened||this._fetchHandle)a.preventDefault();case h.TAB:c=this.get("displayedValue");if(g&&(c==g._messages.previousMessage||c==g._messages.nextMessage))break;i&&this._selectOption();if(this._opened){this._lastQuery=
null;this.closeDropDown()}break;case " ":if(i){f.stopEvent(a);this._selectOption();this.closeDropDown()}else d=true;break;case h.DELETE:case h.BACKSPACE:d=this._prev_key_backspace=true;break;default:d=typeof c=="string"||c==229}if(d){this.item=undefined;this.searchTimer=setTimeout(f.hitch(this,"_startSearchFromInput"),1)}}},_autoCompleteText:function(a){var c=this.focusNode;e.selectInputText(c,c.value.length);var d=this.ignoreCase?"toLowerCase":"substr";if(a[d](0).indexOf(this.focusNode.value[d](0))==
0){d=this._getCaretPos(c);if(d+1>c.value.length){c.value=a;e.selectInputText(c,d)}}else{c.value=a;e.selectInputText(c)}},_openResultList:function(a,c){this._fetchHandle=null;if(!(this.disabled||this.readOnly||c.query[this.searchAttr]!=this._lastQuery)){var d=this.dropDown._highlighted_option&&f.hasClass(this.dropDown._highlighted_option,"dijitMenuItemSelected");this.dropDown.clearResultList();if(!a.length&&!this._maxOptions)this.closeDropDown();else{c._maxOptions=this._maxOptions;a=this.dropDown.createOptions(a,
c,f.hitch(this,"_getMenuLabelFromItem"));this._showResultList();if(c.direction){if(1==c.direction)this.dropDown.highlightFirstOption();else-1==c.direction&&this.dropDown.highlightLastOption();d&&this._announceOption(this.dropDown.getHighlightedOption())}else this.autoComplete&&!this._prev_key_backspace&&!/^[*]+$/.test(c.query[this.searchAttr])&&this._announceOption(a[1])}}},_showResultList:function(){this.closeDropDown(true);this.displayMessage("");this.openDropDown();e.setWaiState(this.domNode,"expanded",
"true")},loadDropDown:function(){this._startSearchAll()},isLoaded:function(){return false},closeDropDown:function(){this._abortQuery();if(this._opened){this.inherited(arguments);e.setWaiState(this.domNode,"expanded","false");e.removeWaiState(this.focusNode,"activedescendant")}},_setBlurValue:function(){var a=this.get("displayedValue"),c=this.dropDown;if(c&&(a==c._messages.previousMessage||a==c._messages.nextMessage))this._setValueAttr(this._lastValueReported,true);else if(typeof this.item=="undefined"){this.item=
null;this.set("displayedValue",a)}else{this.value!=this._lastValueReported&&e.form._FormValueWidget.prototype._setValueAttr.call(this,this.value,true);this._refreshState()}},_onBlur:function(){this.closeDropDown();this.inherited(arguments)},_setItemAttr:function(a,c,d){d||(d=this.store.getValue(a,this.searchAttr));var g=this._getValueField()!=this.searchAttr?this.store.getIdentity(a):d;this._set("item",a);e.form.ComboBox.superclass._setValueAttr.call(this,g,c,d)},_announceOption:function(a){if(a){var c;
if(a==this.dropDown.nextButton||a==this.dropDown.previousButton){c=a.innerHTML;this.item=undefined;this.value=""}else{c=this.store.getValue(a.item,this.searchAttr).toString();this.set("item",a.item,false,c)}this.focusNode.value=this.focusNode.value.substring(0,this._lastInput.length);e.setWaiState(this.focusNode,"activedescendant",f.attr(a,"id"));this._autoCompleteText(c)}},_selectOption:function(a){a&&this._announceOption(a.target);this.closeDropDown();this._setCaretPos(this.focusNode,this.focusNode.value.length);
e.form._FormValueWidget.prototype._setValueAttr.call(this,this.value,true)},_startSearchAll:function(){this._startSearch("")},_startSearchFromInput:function(){this._startSearch(this.focusNode.value.replace(/([\\\*\?])/g,"\\$1"))},_getQueryString:function(a){return f.string.substitute(this.queryExpr,[a])},_startSearch:function(a){if(!this.dropDown){var c=this.id+"_popup";this.dropDown=new (f.getObject(this.dropDownClass,false))({onChange:f.hitch(this,this._selectOption),id:c,dir:this.dir});e.removeWaiState(this.focusNode,
"activedescendant");e.setWaiState(this.textbox,"owns",c)}c=f.clone(this.query);this._lastInput=a;this._lastQuery=c[this.searchAttr]=this._getQueryString(a);this.searchTimer=setTimeout(f.hitch(this,function(d,g){this.searchTimer=null;d={queryOptions:{ignoreCase:this.ignoreCase,deep:true},query:d,onBegin:f.hitch(this,"_setMaxOptions"),onComplete:f.hitch(this,"_openResultList"),onError:function(h){g._fetchHandle=null;console.error("dijit.form.ComboBox: "+h);g.closeDropDown()},start:0,count:this.pageSize};
f.mixin(d,g.fetchProperties);this._fetchHandle=g.store.fetch(d);this._nextSearch=this.dropDown.onPage=f.hitch(this,function(h,i){h.start+=h.count*i;h.direction=i;this._fetchHandle=this.store.fetch(h);this.focus()},this._fetchHandle)},c,this),this.searchDelay)},_setMaxOptions:function(a){this._maxOptions=a},_getValueField:function(){return this.searchAttr},constructor:function(){this.query={};this.fetchProperties={}},postMixInProperties:function(){if(!this.store){this.store=new e.form._ComboBoxDataStore(this.srcNodeRef);
if(!("value"in this.params)){var a=this.item=this.store.fetchSelectedItem();if(a){var c=this._getValueField();this.value=this.store.getValue(a,c)}}}this.inherited(arguments)},postCreate:function(){var a=f.query('label[for="'+this.id+'"]');if(a.length){a[0].id=this.id+"_label";e.setWaiState(this.domNode,"labelledby",a[0].id)}this.inherited(arguments)},_setHasDownArrowAttr:function(a){this.hasDownArrow=a;this._buttonNode.style.display=a?"":"none"},_getMenuLabelFromItem:function(a){a=this.labelFunc(a,
this.store);var c=this.labelType;if(this.highlightMatch!="none"&&this.labelType=="text"&&this._lastInput){a=this.doHighlight(a,this._escapeHtml(this._lastInput));c="html"}return{html:c=="html",label:a}},doHighlight:function(a,c){var d=(this.ignoreCase?"i":"")+(this.highlightMatch=="all"?"g":""),g=this.queryExpr.indexOf("${0}");c=f.regexp.escapeString(c);return this._escapeHtml(a).replace(new RegExp((g==0?"^":"")+"("+c+")"+(g==this.queryExpr.length-4?"$":""),d),'<span class="dijitComboBoxHighlightMatch">$1</span>')},
_escapeHtml:function(a){return a=String(a).replace(/&/gm,"&amp;").replace(/</gm,"&lt;").replace(/>/gm,"&gt;").replace(/"/gm,"&quot;")},reset:function(){this.item=null;this.inherited(arguments)},labelFunc:function(a,c){return c.getValue(a,this.labelAttr||this.searchAttr).toString()}});f.declare("dijit.form._ComboBoxMenu",[e._Widget,e._Templated,e._CssStateMixin],{templateString:"<ul class='dijitReset dijitMenu' dojoAttachEvent='onmousedown:_onMouseDown,onmouseup:_onMouseUp,onmouseover:_onMouseOver,onmouseout:_onMouseOut' style='overflow: \"auto\"; overflow-x: \"hidden\";'><li class='dijitMenuItem dijitMenuPreviousButton' dojoAttachPoint='previousButton' role='option'></li><li class='dijitMenuItem dijitMenuNextButton' dojoAttachPoint='nextButton' role='option'></li></ul>",
_messages:null,baseClass:"dijitComboBoxMenu",postMixInProperties:function(){this.inherited(arguments);this._messages=f.i18n.getLocalization("dijit.form","ComboBox",this.lang)},buildRendering:function(){this.inherited(arguments);this.previousButton.innerHTML=this._messages.previousMessage;this.nextButton.innerHTML=this._messages.nextMessage},_setValueAttr:function(a){this.value=a;this.onChange(a)},onChange:function(){},onPage:function(){},onClose:function(){this._blurOptionNode()},_createOption:function(a,
c){var d=f.create("li",{"class":"dijitReset dijitMenuItem"+(this.isLeftToRight()?"":" dijitMenuItemRtl"),role:"option"});c=c(a);if(c.html)d.innerHTML=c.label;else d.appendChild(f.doc.createTextNode(c.label));if(d.innerHTML=="")d.innerHTML="&nbsp;";d.item=a;return d},createOptions:function(a,c,d){this.previousButton.style.display=c.start==0?"none":"";f.attr(this.previousButton,"id",this.id+"_prev");f.forEach(a,function(h,i){h=this._createOption(h,d);f.attr(h,"id",this.id+i);this.domNode.insertBefore(h,
this.nextButton)},this);var g=false;if(c._maxOptions&&c._maxOptions!=-1)if(c.start+c.count<c._maxOptions)g=true;else{if(c.start+c.count>c._maxOptions&&c.count==a.length)g=true}else if(c.count==a.length)g=true;this.nextButton.style.display=g?"":"none";f.attr(this.nextButton,"id",this.id+"_next");return this.domNode.childNodes},clearResultList:function(){for(;this.domNode.childNodes.length>2;)this.domNode.removeChild(this.domNode.childNodes[this.domNode.childNodes.length-2]);this._blurOptionNode()},
_onMouseDown:function(a){f.stopEvent(a)},_onMouseUp:function(a){if(!(a.target===this.domNode||!this._highlighted_option))if(a.target==this.previousButton){this._blurOptionNode();this.onPage(-1)}else if(a.target==this.nextButton){this._blurOptionNode();this.onPage(1)}else{for(a=a.target;!a.item;)a=a.parentNode;this._setValueAttr({target:a},true)}},_onMouseOver:function(a){if(a.target!==this.domNode){a=a.target;if(!(a==this.previousButton||a==this.nextButton))for(;!a.item;)a=a.parentNode;this._focusOptionNode(a)}},
_onMouseOut:function(a){a.target!==this.domNode&&this._blurOptionNode()},_focusOptionNode:function(a){if(this._highlighted_option!=a){this._blurOptionNode();this._highlighted_option=a;f.addClass(this._highlighted_option,"dijitMenuItemSelected")}},_blurOptionNode:function(){if(this._highlighted_option){f.removeClass(this._highlighted_option,"dijitMenuItemSelected");this._highlighted_option=null}},_highlightNextOption:function(){if(this.getHighlightedOption()){var a=this._highlighted_option.nextSibling;
a&&a.style.display!="none"?this._focusOptionNode(a):this.highlightFirstOption()}else{a=this.domNode.firstChild;this._focusOptionNode(a.style.display=="none"?a.nextSibling:a)}f.window.scrollIntoView(this._highlighted_option)},highlightFirstOption:function(){var a=this.domNode.firstChild,c=a.nextSibling;this._focusOptionNode(c.style.display=="none"?a:c);f.window.scrollIntoView(this._highlighted_option)},highlightLastOption:function(){this._focusOptionNode(this.domNode.lastChild.previousSibling);f.window.scrollIntoView(this._highlighted_option)},
_highlightPrevOption:function(){if(this.getHighlightedOption()){var a=this._highlighted_option.previousSibling;a&&a.style.display!="none"?this._focusOptionNode(a):this.highlightLastOption()}else{a=this.domNode.lastChild;this._focusOptionNode(a.style.display=="none"?a.previousSibling:a)}f.window.scrollIntoView(this._highlighted_option)},_page:function(a){var c=0,d=this.domNode.scrollTop,g=f.style(this.domNode,"height");for(this.getHighlightedOption()||this._highlightNextOption();c<g;){if(a){if(!this.getHighlightedOption().previousSibling||
this._highlighted_option.previousSibling.style.display=="none")break;this._highlightPrevOption()}else{if(!this.getHighlightedOption().nextSibling||this._highlighted_option.nextSibling.style.display=="none")break;this._highlightNextOption()}var h=this.domNode.scrollTop;c+=(h-d)*(a?-1:1);d=h}},pageUp:function(){this._page(true)},pageDown:function(){this._page(false)},getHighlightedOption:function(){var a=this._highlighted_option;return a&&a.parentNode?a:null},handleKey:function(a){switch(a.charOrCode){case f.keys.DOWN_ARROW:this._highlightNextOption();
return false;case f.keys.PAGE_DOWN:this.pageDown();return false;case f.keys.UP_ARROW:this._highlightPrevOption();return false;case f.keys.PAGE_UP:this.pageUp();return false;default:return true}}});f.declare("dijit.form.ComboBox",[e.form.ValidationTextBox,e.form.ComboBoxMixin],{_setValueAttr:function(a,c,d){this._set("item",null);a||(a="");e.form.ValidationTextBox.prototype._setValueAttr.call(this,a,c,d)}});f.declare("dijit.form._ComboBoxDataStore",null,{constructor:function(a){this.root=a;if(a.tagName!=
"SELECT"&&a.firstChild){a=f.query("select",a);if(a.length>0)a=a[0];else{this.root.innerHTML="<SELECT>"+this.root.innerHTML+"</SELECT>";a=this.root.firstChild}this.root=a}f.query("> option",a).forEach(function(c){c.innerHTML=f.trim(c.innerHTML)})},getValue:function(a,c){return c=="value"?a.value:a.innerText||a.textContent||""},isItemLoaded:function(){return true},getFeatures:function(){return{"dojo.data.api.Read":true,"dojo.data.api.Identity":true}},_fetchItems:function(a,c){if(!a.query)a.query={};
if(!a.query.name)a.query.name="";if(!a.queryOptions)a.queryOptions={};var d=f.data.util.filter.patternToRegExp(a.query.name,a.queryOptions.ignoreCase),g=f.query("> option",this.root).filter(function(h){return(h.innerText||h.textContent||"").match(d)});a.sort&&g.sort(f.data.util.sorter.createSortFunction(a.sort,this));c(g,a)},close:function(){},getLabel:function(a){return a.innerHTML},getIdentity:function(a){return f.attr(a,"value")},fetchItemByIdentity:function(a){var c=f.query("> option[value='"+
a.identity+"']",this.root)[0];a.onItem(c)},fetchSelectedItem:function(){var a=this.root,c=a.selectedIndex;return typeof c=="number"?f.query("> option:nth-child("+(c!=-1?c+1:1)+")",a)[0]:null}});f.extend(e.form._ComboBoxDataStore,f.data.util.simpleFetch);return e.form.ComboBox});define("text!orion/widgets/templates/SFTPConnectionDialog.html",function(){return'<div class="dijitDialog" tabindex="-1" waiRole="dialog" waiState="labelledby-${id}_title">\n\t<div dojoType="dojo.data.ItemFileReadStore" data="sftpConnectionStoreData" jsId="sftpConnectionStore">\n\t</div>\n\t<div dojoAttachPoint="titleBar" class="dijitDialogTitleBar">\n\t\t<span dojoAttachPoint="titleNode" class="dijitDialogTitle" id="${id}_title"></span>\n\t\t<span dojoAttachPoint="closeButtonNode" class="dijitDialogCloseIcon" dojoAttachEvent="onclick: onCancel" title="${buttonCancel}">\n\t\t\t<span dojoAttachPoint="closeText" class="closeText" title="${buttonCancel}">x</span>\n\t\t</span>\n\t</div>\n\t<div dojoAttachPoint="containerNode" class="dijitDialogPaneContent">\n\t\t<!-- Actual content here --\>\n\t\t<div style="display: table">\n\t\t\t<div style="display: table-row">\n\t\t\t\t<div style="display: table-cell; padding: 5">\n\t\t\t\t\t<label dojoAttachPoint="locationLabel" for="${id}_sftpPath" style="padding-right: 10">${locationLabelText}</label>\n\t\t\t\t</div>\n\t\t\t\t<div style="display: table-cell; padding: 5; width: 40em; text-align: left;">\n\t\t\t\t\t<div dojoType="dijit.form.ComboBox" store="sftpConnectionStore" style="display: inline-block; width: 88%;" dojoAttachPoint="sftpConnectionList" searchAttr="name">\n\t\t\t\t\t</div>\n\t\t\t\t\t<div dojoType="dijit.form.DropDownButton">\n\t\t\t\t\t    <span>New</span>\n\t\t\t    \t\t<div dojoType="dijit.TooltipDialog">\n\t\t\t\t\t\t\t<div style="display: table">\n\t\t\t\t\t\t\t\t<div style="display: table-row">\n\t\t\t\t\t\t\t\t\t<div style="display: table-cell; padding: 5">\n\t\t\t\t\t\t\t\t\t\t<label dojoAttachPoint="sftpHostLabel" for="${id}_sftpHost" style="padding-right: 10">${sftpHostLabelText}</label>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t<div style="display: table-cell; padding: 5; width: 40em; text-align: left;">\n\t\t\t\t\t\t\t\t\t\t<input dojoAttachPoint="sftpHost" id="${id}_sftpHost" style="display: inline-block; width: 98%;" value="">\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div style="display: table-row">\n\t\t\t\t\t\t\t\t\t<div style="display: table-cell; padding: 5">\n\t\t\t\t\t\t\t\t\t\t<label dojoAttachPoint="sftpPathLabel" for="${id}_sftpPath" style="padding-right: 10">${sftpPathLabelText}</label>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t<div style="display: table-cell; padding: 5; width: 40em; text-align: left;">\n\t\t\t\t\t\t\t\t\t\t<input dojoAttachPoint="sftpPath" id="${id}_sftpPath" style="display: inline-block; width: 98%;" value="">\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>\t\n\t\t\t\t\t\t\t\t<div style="display: table-row">\n\t\t\t\t\t\t\t\t\t<div style="display: table-cell; padding: 5">\n\t\t\t\t\t\t\t\t\t\t<label dojoAttachPoint="sftpUserLabel" for="${id}_sftpUser" style="padding-right: 10">${sftpUserLabelText}</label>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t<div style="display: table-cell; padding: 5; width: 40em; text-align: left;">\n\t\t\t\t\t\t\t\t\t\t<input dojoAttachPoint="sftpUser" id="${id}_sftpUser" style="display: inline-block; width: 98%;" value="">\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div style="display: table-row">\n\t\t\t\t\t\t\t\t\t<div style="display: table-cell; padding: 5"></div>\n\t\t\t\t\t\t\t\t\t<div style="display: table-cell; padding: 5">\n\t\t\t\t\t\t\t\t\t\t<button dojoAttachPoint="addSFTPConnection" type="submit" dojoType="dijit.form.Button" style="padding: 20 0 10 0; float: right; clear: both;">Add</button>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div><!-- End inner table--\>\n\t\t\t    \t\t</div><!-- End TooltipDialog --\>\n\t\t\t    \t</div><!-- End DropDownButton --\>\n\t\t\t\t</div><!-- End table cell --\>\n\t\t\t</div><!-- End table row --\>\n\t\t\t<div style="display: table-row">\n\t\t\t\t<div style="display: table-cell; padding: 5">\n\t\t\t\t\t<label dojoAttachPoint="sftpPasswordLabel" for="${id}_sftpPassword" style="padding-right: 10">${sftpPasswordLabelText}</label>\n\t\t\t\t</div>\n\t\t\t\t<div style="display: table-cell; padding: 5; width: 40em; text-align: left;">\n\t\t\t\t\t<input type="password" dojoAttachPoint="sftpPassword" id="${id}_sftpPassword" style="display: inline-block; width: 98%;" value="">\n\t\t\t\t</div>\n\t\t\t</div>\t\n\t\t\t<div style="display: table-row">\n\t\t\t\t<div style="display: table-cell; padding: 5"></div>\n\t\t\t\t<div style="display: table-cell; padding: 5">\n\t\t\t\t\t<p>If the same file exists in both the source and destination:</p>\n\t\t\t\t    <input type="radio" dojoAttachPoint="overwriteCancel" dojoType="dijit.form.RadioButton" name="overwriteOption" id="overwriteCancel" checked value="overwriteCancel" />\n\t\t\t\t    <label for="radioOne">Cancel the transfer</label>\n\t\t\t\t    <br />\n\t\t\t\t    <input type="radio" dojoAttachPoint="overwriteAll" dojoType="dijit.form.RadioButton" name="overwriteOption" id="overwriteAll"/>\n\t\t\t\t    <label for="radioOne">Always overwrite destination</label>\n\t\t\t\t    <br />\n\t\t\t\t    <input type="radio" dojoAttachPoint="overwriteOlder" dojoType="dijit.form.RadioButton" name="overwriteOption" id="overwriteOlder"/>\n\t\t\t\t    <label for="radioOne">Overwrite if source is newer</label>\n\t\t\t\t</div>\n\t\t\t</div><!-- End table row --\>\n\t\t\t<div style="display: table-row">\n\t\t\t\t<div style="display: table-cell; padding: 5"></div>\n\t\t\t\t<div style="display: table-cell; padding: 5">\n\t\t\t\t\t<button dojoAttachPoint="sftpConnectionButton" dojoType="dijit.form.Button" type="submit" value="OK" style="padding: 20 0 10 0; float: right; clear: both;">${buttonOk}\n\t\t\t\t\t</button>\n\t\t\t\t</div>\n\t\t\t</div><!-- End table row --\>\n\t\t</div><!-- End table --\>\n\t</div><!-- End dijitDialogPaneContent --\>\n</div>'});
define("orion/widgets/SFTPConnectionDialog",["dojo","dijit","dijit/Dialog","dijit/form/CheckBox","dijit/form/ComboBox","dojo/data/ItemFileReadStore","orion/widgets/_OrionDialogMixin","text!orion/widgets/templates/SFTPConnectionDialog.html"],function(f,e){localStorage.getItem("orion.sftpConnections")||localStorage.setItem("orion.sftpConnections",JSON.stringify({identifier:"name",label:"name",items:[]}));window.sftpConnectionStoreData=JSON.parse(localStorage.getItem("orion.sftpConnections"));f.declare("orion.widgets.SFTPConnectionDialog",
[e.Dialog,orion.widgets._OrionDialogMixin],{widgetsInTemplate:true,templateString:f.cache("orion","widgets/templates/SFTPConnectionDialog.html"),constructor:function(){this.inherited(arguments);this.options=arguments[0]||{}},postMixInProperties:function(){this.inherited(arguments);this.title="SFTP Transfer";this.sftpHostLabelText="Remote host:";this.sftpPathLabelText="Remote path:";this.sftpUserLabelText="User name:";this.sftpPasswordLabelText="Password:";this.buttonOk="Start Transfer";this.locationLabelText=
"Location:";sftpConnectionStoreData=JSON.parse(localStorage.getItem("orion.sftpConnections"))},postCreate:function(){this.inherited(arguments);f.connect(this.addSFTPConnection,"onClick",null,f.hitch(this,this.onAddConnection))},execute:function(){var a=this.sftpConnectionList.value.split("@");if(a.length===2){var c=a[0],d=a[1].indexOf("/");if(!(d<=0)){var g=a[1].substring(0,d);a=a[1].substring(d);this.options.func(g,a,c,this.sftpPassword.value,this._computeOverwriteValue())}}},_computeOverwriteValue:function(){if(this.overwriteCancel.checked)return"no-overwrite";
else if(this.overwriteOlder.checked)return"overwrite-older";return""},onAddConnection:function(){for(var a={name:this.sftpUser.value+"@"+this.sftpHost.value+this.sftpPath.value},c=JSON.parse(localStorage.getItem("orion.sftpConnections")),d=false,g=0;g<c.items.length;g++)if(c.items[g].name===a.name){d=true;break}if(!d){c.items.unshift(a);localStorage.setItem("orion.sftpConnections",JSON.stringify(c));this.sftpConnectionList.set("value",a.name)}}})});
define("orion/extensionCommands",["require","dojo","orion/util","orion/commands","orion/editor/regex","orion/contentTypes","orion/URITemplate","orion/widgets/NewItemDialog","orion/widgets/DirectoryPrompterDialog","orion/widgets/ImportDialog","orion/widgets/SFTPConnectionDialog"],function(f,e,a,c,d,g,h){var i={};i._cloneItemWithoutChildren=function j(k){if(k===null||typeof k!=="object")return k;var m=k.constructor();for(var n in k)if(n!=="children"&&n!=="Children")m[n]=j(k[n]);return m};i._createOpenWithCommands=
function(j,k){function m(){for(var x=j.getServiceReferences("orion.edit.editor"),z=[],C=0;C<x.length;C++){var A=x[C],F=A.getProperty("id");z.push({id:F,name:A.getProperty("name"),uriTemplate:new h(A.getProperty("orionTemplate")||A.getProperty("uriTemplate"))})}return z}function n(x,z){x=x.map(function(C){return d.escape(C)});z=z.map(function(C){return d.escape(C)});x=x.length&&"(*\\.("+x.join("|")+")$)";z=z.length&&"(^("+z.join("|")+")$)";return x&&z?x+"|"+z:x?x:z?z:null}function p(x,z){x=x.getServiceReferences("orion.navigate.openWith");
for(var C=[],A=0;A<x.length;A++){var F=x[A];if(F.getProperty("editor")===z.id){F=F.getProperty("contentType");if(F instanceof Array)C=C.concat(F);else F!==null&&typeof F!=="undefined"&&C.push(F)}}return C}function r(x){for(x=x.getServiceReferences("orion.navigate.openWith.default");0<x.length;)return{editor:x[0].getProperty("editor")};return null}for(var w=m(),s=r(j),u=[],t=0;t<w.length;t++){var y=w[t],B=s&&s.editor===y.id,D=p(j,y);if(D.length){for(var l=[],o=[],q=0;q<D.length;q++){var v=k[D[q]];
if(v){l=l.concat(v.extension);o=o.concat(v.filename)}}D=y.uriTemplate;l={Directory:false,Name:n(l,o)};y={name:y.name||y.id,id:"eclipse.openWithCommand."+y.id,tooltip:y.name,validationProperties:l,href:true,forceSingleItem:true,isEditor:B?"default":"editor"};B={run:e.hitch(D,D.expand)};u.push({properties:y,service:B})}}return u};i._makeValidationFunction=function(j,k){function m(r){for(var w="^",s=0;s<r.length;s++){var u=r.charAt(s);switch(u){case "?":w+=".";break;case "*":w+=".*";break;default:w+=
u}}w+="$";return new RegExp(w)}function n(r,w,s){var u,t;if(w.indexOf(":")>=0){u=m(w.substring(0,w.indexOf(":")));var y=w.substring(w.indexOf(":")+1);for(t in r)if(u.test(t))if(n(r[t],y,s))return true}u=m(w);for(t in r)if(u.test(t))if(typeof s==="string"){if(m(s).test(r[t]))return true}else if(s===r[t])return true;return false}function p(r,w){for(var s in w)if(!n(r,s,w[s]))return false;return true}return e.hitch(j,function(r){if(typeof k==="function")r=k(r);if(e.isArray(r)){if((this.forceSingleItem||
this.href)&&r.length!==1)return false;if(!this.forceSingleItem&&r.length<1)return false}else r=[r];if(!this.validationProperties)return true;for(var w in r)if(!p(r[w],this.validationProperties))return false;return true})};i._createCommandOptions=function(j,k,m,n,p){var r={name:j.name,image:j.image,id:j.id||j.name,tooltip:j.tooltip,isEditor:j.isEditor};r.visibleWhen=i._makeValidationFunction(j,p);if(n)if(j.href)r.hrefCallback=e.hitch(j,function(w){w=e.isArray(w.items)?w.items[0]:w.items;w=i._cloneItemWithoutChildren(w);
if(k.run)return k.run(w);else if(m)return m.getService(k).run(w)});else r.callback=e.hitch(j,function(w){var s;if(this.forceSingleItem){w=e.isArray()?w.items[0]:w.items;s=i._cloneItemWithoutChildren(w)}else if(e.isArray(w.items)){s=[];for(var u=0;u<w.items.length;u++)s.push(i._cloneItemWithoutChildren(w.items[u]))}else s=i._cloneItemWithoutChildren(w.items);if(k.run)k.run(s);else m&&m.getService(k).run(s)});return r};i.getOpenWithCommands=function(j){var k=[];for(var m in j._objectScope){var n=j._objectScope[m];
n.isEditor&&k.push(n)}return k};return i});
define("orion/textview/keyBinding",[],function(){function f(a,c,d,g,h){this.keyCode=typeof a==="string"?a.toUpperCase().charCodeAt(0):a;this.mod1=c!==undefined&&c!==null?c:false;this.mod2=d!==undefined&&d!==null?d:false;this.mod3=g!==undefined&&g!==null?g:false;this.mod4=h!==undefined&&h!==null?h:false}var e=window.navigator.platform.indexOf("Mac")!==-1;f.prototype={match:function(a){if(this.keyCode===a.keyCode){if(this.mod1!==(e?a.metaKey:a.ctrlKey))return false;if(this.mod2!==a.shiftKey)return false;
if(this.mod3!==a.altKey)return false;if(e&&this.mod4!==a.ctrlKey)return false;return true}return false},equals:function(a){if(!a)return false;if(this.keyCode!==a.keyCode)return false;if(this.mod1!==a.mod1)return false;if(this.mod2!==a.mod2)return false;if(this.mod3!==a.mod3)return false;if(this.mod4!==a.mod4)return false;return true}};return{KeyBinding:f}});
define("orion/favorites",["require","dojo","orion/util"],function(f,e,a){function c(d){this._favorites=[];this._searches=[];this._init(d);this._initializeFavorites()}c.prototype={_init:function(d){this._registry=d.serviceRegistry;this._serviceRegistration=this._registry.registerService("orion.core.favorite",this)},_notifyListeners:function(){this._serviceRegistration.dispatchEvent("favoritesChanged",{navigator:this._favorites,search:this._searches,registry:this._registry})},makeFavorites:function(d){d=
e.isArray(d)?d:[d];for(var g=0;g<d.length;g++){var h=d[g],i=h.ChildrenLocation?h.ChildrenLocation:h.Location;i=a.makeRelative(i);this.addFavorite(h.Name,i,h.Directory)}this._storeFavorites();this._notifyListeners()},addFavoriteUrl:function(d){this.addFavorite(d,d,false,true)},addFavorite:function(d,g,h,i){this._favorites.push({name:d,path:g,directory:h,isFavorite:true,isExternalResource:i});this._favorites.sort(this._sorter);this._storeFavorites();this._notifyListeners()},removeFavorite:function(d){for(var g in this._favorites)if(this._favorites[g].path===
d){this._favorites.splice(g,1);break}this._favorites.sort(this._sorter);this._storeFavorites();this._notifyListeners()},renameFavorite:function(d,g){var h=false;for(var i in this._favorites)if(this._favorites[i].path===d){var j=this._favorites[i];if(j.name!==g){j.name=g;h=true}}if(h){this._favorites.sort(this._sorter);this._storeFavorites();this._notifyListeners()}},addFavoriteSearch:function(d,g){this._searches.push({name:d,query:g,isSearch:true});this._searches.sort(this._sorter);this._storeSearches();
this._notifyListeners()},hasFavorite:function(d){for(var g in this._favorites)if(this._favorites[g].path===d)return true;return false},_SPECIAL_CHARS:"^$\\+[]().",queryFavorites:function(d){var g;if(!d)return this._favorites;var h="";for(g=0;g<d.length;g++){var i=d.charAt(g);h+=i==="*"?".*":i==="?"?".?":this._SPECIAL_CHARS.indexOf(i)>=0?"\\"+i:i}h+=".*";d=new RegExp(h);h=[];for(g in this._favorites)this._favorites[g].name.search(d)===0&&h.push(this._favorites[g]);return h},removeSearch:function(d){for(var g in this._searches)if(this._searches[g].query===
d){this._searches.splice(g,1);break}this._searches.sort(this._sorter);this._storeSearches();this._notifyListeners()},renameSearch:function(d,g){var h=false;for(var i in this._searches)if(this._searches[i].query===d){var j=this._searches[i];if(j.name!==g){j.name=g;h=true}}if(h){this._searches.sort(this._sorter);this._storeSearches();this._notifyListeners()}},_initializeFavorites:function(){var d=this;this._registry.getService("orion.core.preference").getPreferences("/window/favorites").then(function(g){var h,
i=g.get("navigate");if(typeof i==="string")i=JSON.parse(i);if(i)for(h in i){i[h].isFavorite=true;d._favorites.push(i[h])}g=g.get("search");if(typeof g==="string")g=JSON.parse(g);if(g)for(h in g){g[h].isSearch=true;d._searches.push(g[h])}d._favorites.sort(d._sorter);d._notifyListeners()})},_storeFavorites:function(){var d=this._favorites;this._registry.getService("orion.core.preference").getPreferences("/window/favorites").then(function(g){g.put("navigate",d)})},_storeSearches:function(){var d=this._searches;
this._registry.getService("orion.core.preference").getPreferences("/window/favorites").then(function(g){g.put("search",d)})},_sorter:function(d,g){d=d.name.toLowerCase();g=g.name.toLowerCase();return d>g?1:d<g?-1:0},getFavorites:function(){return{navigator:this._favorites,search:this._searches}}};c.prototype.constructor=c;return{FavoritesService:c}});define("text!orion/widgets/templates/OpenResourceDialog.html",function(){return'<div class="dijitDialog" tabindex="-1" waiRole="dialog" title="${title}" waiState="labelledby-${id}_title">\n\t<div dojoAttachPoint="titleBar" class="dijitDialogTitleBar">\n\t\t<span dojoAttachPoint="titleNode" class="dijitDialogTitle" id="${id}_title"></span>\n\t\t<span dojoAttachPoint="closeButtonNode" class="dijitDialogCloseIcon" dojoAttachEvent="onclick: onCancel" title="${buttonCancel}">\n\t\t\t<span dojoAttachPoint="closeText" class="closeText" title="${buttonCancel}">x</span>\n\t\t</span>\n\t</div>\n\t<div dojoAttachPoint="containerNode" class="dijitDialogPaneContent">\n\t\t<div style="display:table">\n\t\t\t<div style="display:table-row">\n\t\t\t\t<div style="display:table-cell; padding:5;">\n\t\t\t\t\t<label for="resourceName" style="padding-right:10">${selectFile}</label>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div style="display:table-row">\n\t\t\t\t<div style="display:table-cell; padding:5;">\n\t\t\t\t\t<input type="text" dojoType="dijit.form.TextBox" dojoAttachPoint="resourceName" \n\t\t\t\t\t\tplaceHolder="${searchPlaceHolder}"\n\t\t\t\t\t\tintermediateChanges="true" style="width:30em;">\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div style="display:table-row">\n\t\t\t\t<div dojoAttachPoint="favresults" style="max-height:400px; height:auto; overflow-y:auto;"></div>\n\t\t\t</div>\n\t\t\t<div style="display:table-row">\n\t\t\t\t<div dojoAttachPoint="results" style="max-height:400px; height:auto; overflow-y:auto;"></div>\n\t\t\t</div>\n\t\t\t<div style="display:table-row">\n\t\t\t\t<div dojoAttachPoint="statusbar" style="display:table-cell;"></div>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</div>'});
define("orion/widgets/OpenResourceDialog",["require","dojo","dijit","dijit/Dialog","dijit/form/TextBox","orion/widgets/_OrionDialogMixin","text!orion/widgets/templates/OpenResourceDialog.html"],function(f,e,a){return e.declare("orion.widgets.OpenResourceDialog",[a.Dialog,orion.widgets._OrionDialogMixin],{widgetsInTemplate:true,templateString:e.cache("orion","widgets/templates/OpenResourceDialog.html"),SEARCH_DELAY:500,timeoutId:null,time:null,options:null,searcher:null,searchRenderer:null,favService:null,
constructor:function(){this.inherited(arguments);this.timeoutId=null;this.time=0;this.searcher=(this.options=arguments[0])&&this.options.searcher;if(!this.searcher)throw new Error("Missing required argument: searcher");this.searchRenderer=this.options&&this.options.searchRenderer;if(!this.searchRenderer||typeof this.searchRenderer.makeRenderFunction!=="function")throw new Error("Missing required argument: searchRenderer");this.favService=this.options.favoriteService;if(!this.favService)throw new Error("Missing required argument: favService");
},postMixInProperties:function(){this.options.title=this.options.title||"Find File Named";this.selectFile="Type the name of a file to open (? = any character, * = any string):";this.searchPlaceHolder="Search";this.inherited(arguments)},postCreate:function(){this.inherited(arguments);e.connect(this.resourceName,"onChange",this,function(){this.time=+new Date;clearTimeout(this.timeoutId);this.timeoutId=setTimeout(e.hitch(this,this.checkSearch),0)});e.connect(this.resourceName,"onKeyPress",this,function(c){if(c.keyCode===
e.keys.ENTER&&this.results){c=e.query("a",this.results);if(c.length>0){window.open(c[0].href);this.hide()}}});e.connect(this,"onKeyPress",this,function(c){var d,g,h,i,j;h=function(m,n,p){return n<m.length-1?m[n+1]:p};var k=function(m,n,p){return n>0?m[n-1]:p};if(c.keyCode===e.keys.DOWN_ARROW||c.keyCode===e.keys.UP_ARROW){g=e.query("a",this.results);d=e.query("a",this.favresults);i=a.getFocus();j=g.indexOf(i.node);i=d.indexOf(i.node);if(c.keyCode===e.keys.DOWN_ARROW)if(i>=0)a.focus(h(d,i,g.length>
0?g[0]:d[0]));else if(j>=0)a.focus(h(g,j,d.length>0?d[0]:g[0]));else{if(g.length>0||d.length>0)a.focus(h(d,-1,g[0]))}else if(i>=0){h=this.resourceName&&this.resourceName.get("textbox");a.focus(k(d,i,h))}else if(j>=0){h=this.resourceName&&this.resourceName.get("textbox");a.focus(k(g,j,d.length>0?d[d.length-1]:h))}else if(g.length>0)a.focus(g[g.length-1]);else d.length>0&&a.focus(d[d.length-1]);e.stopEvent(c)}});e.connect(this,"onMouseUp",function(c){c.target.focus()});this.populateFavorites()},populateFavorites:function(){e.place("<div>Populating favorites&#x2026;</div>",
this.favresults,"only");this.favService.getFavorites().then(this.showFavorites());this.favService.addEventListener("favoritesChanged",this.showFavorites())},showFavorites:function(){var c=this;return function(d){if(d.navigator)d=d.navigator;c.searchRenderer.makeRenderFunction(c.favresults,false,e.hitch(c,c.decorateResult),c.showFavoritesImage)(d);d&&d.length>0&&e.place("<hr/>",c.favresults,"last")}},showFavoritesImage:function(c){var d=new Image;e.addClass(d,"commandSprite");e.addClass(d,"core-sprite-makeFavorite");
e.addClass(d,"commandImage");d.src=f.toUrl("images/none.png");d.title="Favorite";c.appendChild(d);e.style(d,"verticalAlign","middle")},checkSearch:function(){clearTimeout(this.timeoutId);var c=(new Date).getTime();if(c-this.time>this.SEARCH_DELAY){this.time=c;this.doSearch()}else this.timeoutId=setTimeout(e.hitch(this,"checkSearch"),50)},doSearch:function(){var c=this.resourceName&&this.resourceName.get("value"),d=this.showFavorites();this.favService.queryFavorites(c).then(function(h){d(h)});if(c){e.place("<div>Searching&#x2026;</div>",
this.results,"only");var g=this;setTimeout(function(){var h=g.searcher.createSearchQuery(null,c,"Name"),i=g.searchRenderer.makeRenderFunction(g.results,false,e.hitch(g,g.decorateResult));g.searcher.search(h,false,i)},0)}},decorateResult:function(c){var d=this;e.query("a",c).forEach(function(g){e.connect(g,"onmouseup",function(h){!e.mouseButtons.isMiddle(h)&&!e.isCopyKey(h)&&d.hide()});e.connect(g,"onkeyup",d,function(h){h.keyCode===e.keys.ENTER&&d.hide()})})},show:function(){this.inherited(arguments);
this.resourceName.focus()},onHide:function(){clearTimeout(this.timeoutId);this.inherited(arguments)}})});define("text!orion/widgets/templates/LoginDialog.html",function(){return'\n<div>\n\t<div class="dijitTooltipContainer" role="presentation" style="width: 300px; padding-left: 0; padding-right: 0; padding-top: 0; padding-bottom: 0.45em">\n\t\t<div class="dijitTooltipContents dijitTooltipFocusNode" role="dialog"\n\t\t\tdojoattachpoint="containerNode" style="padding: 0">\n\t\t\t<table style="width: 100%;">\n\t\t\t\t<tr>\n\t\t\t\t\t<td style="text-align: left; vertical-align: top;">\n\t\t\t\t\t\t<h2 dojoAttachPoint="emptyListInfo" class="LoginWindowLeft">No authentication required.</h2>\n\t\t\t\t\t\t<table dojoAttachPoint="authenticated" style="display: none; width: 100%;">\n\t\t\t\t\t\t\t<tbody dojoAttachPoint="authenticatedList">\n\t\t\t\t\t\t\t</tbody>\n\t\t\t\t\t\t</table>\n\t\t\t\t\t\t<table dojoAttachPoint="otherUnauthenticated" style="display: none; width: 100%;">\n\t\t\t\t\t\t\t<tbody dojoAttachPoint="otherUnauthenticatedList">\n\t\t\t\t\t\t\t</tbody>\n\t\t\t\t\t\t</table>\n\t\t\t\t\t</td>\n\t\t\t\t\t<td style="text-align: right; vertical-align: top; padding-right: 2px; margin: 0">\n\t\t\t\t\t\t<span dojoAttachPoint="closeLink" role="button" title="Close"></span>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t</table>\n\t\t</div>\n\t</div>\n\t<div class="dijitTooltipConnector" role="presentation"></div>\n\n</div>'});
define("orion/widgets/LoginDialog",["require","dojo","dijit","orion/util","dijit/TooltipDialog","text!orion/widgets/templates/LoginDialog.html"],function(f,e,a){e.declare("orion.widgets.LoginDialog",[a.TooltipDialog],{widgetsInTemplate:true,templateString:e.cache("orion","widgets/templates/LoginDialog.html"),constructor:function(){this.inherited(arguments);this.options=arguments[0]||{};this.authenticatedServices={};this.unauthenticatedServices={}},postCreate:function(){this.inherited(arguments);var c=
this;e.addClass(this.closeLink,"imageSprite");e.addClass(this.closeLink,"core-sprite-close");e.connect(this.closeLink,"onmouseover",this.closeLink,function(){c.closeLink.style.cursor="pointer"});e.connect(this.closeLink,"onmouseout",this.closeLink,function(){c.closeLink.style.cursor="default"});e.connect(this.closeLink,"onclick",function(){e.hitch(c,c.closeDialog)()})},setPendingAuthentication:function(c){for(var d in this.unauthenticatedServices)delete this.unauthenticatedServices[d].pending;for(d in c)if(this.unauthenticatedServices[c[d].SignInKey])this.unauthenticatedServices[c[d].SignInKey].pending=
true;else if(this.authenticatedServices[c[d].SignInKey]){this.unauthenticatedServices[c[d].SignInKey]=this.authenticatedServices[c[d].SignInKey];this.unauthenticatedServices[c[d].SignInKey].pending=true;delete this.authenticatedServices[c[d].SignInKey]}else this.unauthenticatedServices[c[d].SignInKey]={label:c[d].label,SignInLocation:c[d].SignInLocation,pending:true};this.renderUnauthenticatedServices();this.renderAuthenticatedServices()},authenticatedService:function(c){if(this.unauthenticatedServices[c]&&
!this.unauthenticatedServices[c].authService){this.authenticatedServices[c]=this.unauthenticatedServices[c];delete this.unauthenticatedServices[c]}},addUserItem:function(c,d,g,h){if(h){this.unauthenticatedServices[c]&&delete this.unauthenticatedServices[c];this.authenticatedServices[c]={authService:d,label:g,data:h}}else{this.authenticatedServices[c]&&delete this.authenticatedServices[c];this.unauthenticatedServices[c]=this.unauthenticatedServices[c]?{authService:d,label:g,pending:this.unauthenticatedServices[c].pending}:
{authService:d,label:g}}e.hitch(this,this.renderAuthenticatedServices)();e.hitch(this,this.renderUnauthenticatedServices)()},renderAuthenticatedServices:function(){e.empty(this.authenticatedList);this.authenticated.style.display=this.isEmpty(this.authenticatedServices)?"none":"";var c=this,d=true;for(var g in this.authenticatedServices){if(!d){var h=e.create("tr",null,this.authenticatedList);e.create("td",{style:"padding: 0; margin 0;",colspan:2,innerHTML:"<hr style='border-bottom: medium none; border-top: 1px solid #D3D3D3; color: gray; height: 0; margin: 2px;'>"},
h)}d=false;h=e.create("tr",{className:"navTableHeading"});var i=this.authenticatedServices[g].authService,j=e.create("td",null,h,"only"),k=e.create("h2",null,j,"only");if(i)if(i.getAuthForm)e.hitch(c,function(p,r){i.getAuthForm(eclipse.globalCommandUtils.notifyAuthenticationSite).then(function(w){if(c.authenticatedServices[r].label)p.innerHTML=c.authenticatedServices[r].label+"<br>";p.innerHTML+=c.getHostname(w)})})(k,g);else k.innerHTML=this.authenticatedServices[g].label?this.authenticatedServices[g].label:
g;else{var m=this.authenticatedServices[g].SignInLocation;if(this.authenticatedServices[g].label)k.innerHTML=this.authenticatedServices[g].label+"<br>";k.innerHTML+=this.getHostname(m)}e.addClass(j,"LoginWindowLeft");j=e.create("td",{style:"text-align: right"},h,"last");e.addClass(j,"LoginWindowRight");k=this.authenticatedServices[g].data;i=this.authenticatedServices[g].authService;if(!i){e.place(h,this.authenticatedList,"last");return}k.Location&&e.create("a",{href:f.toUrl("profile/user-profile.html")+
"#"+k.Location,innerHTML:"Profile"},j,"last");e.place(document.createTextNode(" "),j,"last");if(i.logout){var n=e.create("a",{innerHTML:"Sign out"},j,"last");e.connect(n,"onmouseover",n,function(){n.style.cursor="pointer"});e.connect(n,"onmouseout",n,function(){n.style.cursor="default"});e.connect(n,"onclick",e.hitch(c,function(p,r){return function(){p.logout().then(e.hitch(c,function(){this.addUserItem(r,p,this.authenticatedServices[r].label);this.isSingleService()&&this.closeDialog();localStorage.removeItem(r)}))}})(i,
g))}e.place(h,this.authenticatedList,"last");j="N/A";if(k&&k.lastlogintimestamp)j=e.date.locale.format(new Date(k.lastlogintimestamp),{formatLength:"short"});k=k.Name&&k.Name.replace(/^\s+|\s+$/g,"")!==""?k.Name:k.login;h=e.create("tr");j=k.length>40?e.create("td",{innerHTML:k.substring(0,30)+"... logged in since "+j,colspan:2,title:k+" logged in since "+j},h,"only"):e.create("td",{innerHTML:k+" logged in since "+j,colspan:2},h,"only");e.addClass(j,"LoginWindowLeft");e.addClass(j,"LoginWindowRight");
e.addClass(j,"LoginWindowComment");e.place(h,this.authenticatedList,"last")}},renderUnauthenticatedServices:function(){this.emptyListInfo.style.display=this.unauthenticatedServices.length===0&&this.authenticatedServices.length===0?"":"none";e.empty(this.otherUnauthenticatedList);var c=this;this.otherUnauthenticated.style.display=this.isEmpty(this.unauthenticatedServices)?"none":"";var d=true;for(var g in this.unauthenticatedServices){if(!d||!this.isEmpty(this.authenticatedServices)){var h=e.create("tr",
null,this.otherUnauthenticatedList);e.create("td",{style:"padding: 0; margin 0;",colspan:2,innerHTML:"<hr style='border-bottom: medium none; border-top: 1px solid #D3D3D3; color: gray; height: 0; margin: 2px;'>"},h)}d=false;h=e.create("tr",{className:"navTableHeading"});var i=e.create("td",null,h,"only");e.addClass(i,"LoginWindowLeft");var j=e.create("h2",null,i,"only");i=e.create("td",{style:"text-align: right"},h,"last");e.addClass(i,"LoginWindowRight");var k=this.unauthenticatedServices[g].authService;
if(k)if(k.getAuthForm)e.hitch(c,function(p,r){k.getAuthForm(eclipse.globalCommandUtils.notifyAuthenticationSite).then(function(w){w.indexOf("?")==-1?e.create("a",{target:"_blank",href:w+"?redirect="+eclipse.globalCommandUtils.notifyAuthenticationSite+"?key="+r,innerHTML:"Sign in"},p,"last"):e.create("a",{target:"_blank",href:w+"&redirect="+eclipse.globalCommandUtils.notifyAuthenticationSite+"?key="+r,innerHTML:"Sign in"},p,"last");if(c.unauthenticatedServices[r].label)j.innerHTML=c.unauthenticatedServices[r].label+
"<br>";j.innerHTML+=c.getHostname(w)})})(i,g);else{if(k.login){e.place(document.createTextNode(this.unauthenticatedServices[g].label?this.unauthenticatedServices[g].label:g),j,"only");var m=e.create("a",{innerHTML:"Sign in",style:"cursor: hand;"},i,"last");e.connect(m,"onmouseover",m,function(){m.style.cursor="pointer"});e.connect(m,"onmouseout",m,function(){m.style.cursor="default"});e.connect(m,"onclick",e.hitch(c,function(p){return function(){p.login(eclipse.globalCommandUtils.notifyAuthenticationSite).then(function(){c.isSingleService()&&
a.popup.hide&&a.popup.hide(c);a.popup.close(c)})}})(k))}}else{var n=this.unauthenticatedServices[g].SignInLocation;n.indexOf("?")==-1?e.create("a",{target:"_blank",href:n+"?redirect="+eclipse.globalCommandUtils.notifyAuthenticationSite+"?key="+g,innerHTML:"Sign in"},i,"last"):e.create("a",{target:"_blank",href:n+"&redirect="+eclipse.globalCommandUtils.notifyAuthenticationSite+"?key="+g,innerHTML:"Sign in"},i,"last");if(this.unauthenticatedServices[g].label)j.innerHTML=this.unauthenticatedServices[g].label+
"<br>";j.innerHTML+=this.getHostname(n)}e.place(h,this.otherUnauthenticatedList,"last");if(this.unauthenticatedServices[g].pending){h=e.create("tr");i=e.create("td",{innerHTML:"Authentication required!",style:"padding-left: 10px",colspan:2},h,"only");e.addClass(i,"LoginWindowLeft");e.addClass(i,"LoginWindowRight");e.create("img",{src:f.toUrl("images/warning.gif"),style:"padding-right: 4px; vertical-align: bottom; padding-bottom: 2px;"},i,"first");e.place(h,this.otherUnauthenticatedList,"last")}}},
isSingleService:function(){return this.length(this.unauthenticatedServices)+this.length(this.authenticatedServices)===1},isEmpty:function(c){for(var d in c)if(c.hasOwnProperty(d))return false;return true},length:function(c){var d=0;for(var g in c)c.hasOwnProperty(g)&&d++;return d},getHostname:function(c){var d=document.createElement("img");d.src=c;c=d.src;d.src=null;return c.match(/^(?:f|ht)tp(?:s)?:\/\/([^\/]+)/im)[1].toString()},closeDialog:function(){a.popup.hide&&a.popup.hide(this);a.popup.close(this)}})});
define("orion/widgets/UserMenu",["require","dojo","dijit","orion/util","dijit/Menu"],function(f,e,a){e.declare("orion.widgets.UserMenu",[a.Menu],{widgetsInTemplate:false,id:"userMenu",postCreate:function(){this.inherited(arguments)},constructor:function(){this.inherited(arguments);this.options=arguments[0]||{};this.authenticatedServices={};this.unauthenticatedServices={}},isSingleService:function(){return this.length(this.unauthenticatedServices)+this.length(this.authenticatedServices)===1},hasServices:function(){return this.length(this.unauthenticatedServices)+
this.length(this.authenticatedServices)>0},length:function(c){var d=0;for(var g in c)c.hasOwnProperty(g)&&d++;return d},_renderAuthenticatedService:function(c,d,g){var h=this,i=this.authenticatedServices[c].authService;if(i&&i.logout)this.addChild(new a.MenuItem({label:g?"Sign Out "+g:"Sign Out",onClick:e.hitch(this,function(j,k){return function(){j.logout().then(e.hitch(h,function(){this.addUserItem(k,j,this.authenticatedServices[k].label);localStorage.removeItem(k)}))}})(i,c)}),d)},_renderUnauthenticatedService:function(c,
d,g){var h=this,i=this.unauthenticatedServices[c].authService;if(i)if(i.getAuthForm)e.hitch(h,function(k){i.getAuthForm(eclipse.globalCommandUtils.notifyAuthenticationSite).then(function(m){m+=m.indexOf("?")==-1?"?redirect="+eclipse.globalCommandUtils.notifyAuthenticationSite+"?key="+k:"&redirect="+eclipse.globalCommandUtils.notifyAuthenticationSite+"?key="+k;h.addChild(new a.MenuItem({label:g?"<a target='_blank' href="+m+">Sign In To "+g+"</a>":"<a target='_blank' href="+m+">Sign In</a>",onKeyDown:function(n){n.keyCode===
13&&window.open(m)},_onClick:function(n){this.getParent().onItemClick(this,n)}}),d)})})(c);else{if(i.login)this.addChild(new a.MenuItem({label:g?"Sign In To "+g:"Sign In",onClick:e.hitch(h,function(k){return function(){k.login(eclipse.globalCommandUtils.notifyAuthenticationSite)}})(i)}),d)}else{var j=this.unauthenticatedServices[c].SignInLocation;j+=j.indexOf("?")==-1?"?redirect="+eclipse.globalCommandUtils.notifyAuthenticationSite+"?key="+c:"&redirect="+eclipse.globalCommandUtils.notifyAuthenticationSite+
"?key="+c;this.addChild(new a.MenuItem({label:g?"<a target='_blank' href="+j+">Sign In To "+g+"</a>":"<a target='_blank' href="+j+">Sign In</a>",onKeyDown:function(k){k.keyCode===13&&window.open(j)},_onClick:function(k){this.getParent().onItemClick(this,k)}}),d)}},renderServices:function(){for(var c=this.getChildren(),d=0;d<c.length;d++)this.removeChild(c[d]);if(this.isSingleService())for(d in this.authenticatedServices)this._renderAuthenticatedService(d,0);this.addChild(new a.MenuItem({label:"<a href="+
f.toUrl("settings/settings.html")+">Settings</a>",onKeyDown:function(g){if(g.keyCode===13)window.location=f.toUrl("settings/settings.html")},_onClick:function(g){this.getParent().onItemClick(this,g)}}));this.addChild(new a.MenuItem({label:"<a href="+f.toUrl("operations/list.html")+">Background Operations</a>",onKeyDown:function(g){if(g.keyCode===13)window.location=f.toUrl("operations/list.html")},_onClick:function(g){this.getParent().onItemClick(this,g)}}));this.addChild(new a.MenuSeparator);this.addChild(new a.MenuItem({label:"<a href="+
f.toUrl("help/index.jsp")+">Help</a>",onKeyDown:function(g){if(g.keyCode===13)window.location=f.toUrl("help/index.jsp")},_onClick:function(g){this.getParent().onItemClick(this,g)}}));this.keyAssistFunction&&this.addChild(new a.MenuItem({label:"Keyboard Help",onClick:this.keyAssistFunction}));this.addChild(new a.MenuItem({label:"<a href='"+f.toUrl("help/about.html")+"'>About Orion</a>",onKeyDown:function(g){if(g.keyCode===13)window.location=f.toUrl("help/about.html")},_onClick:function(g){this.getParent().onItemClick(this,
g)}}))},getUserLabel:function(c){if(c.data){var d=c.data.Name&&c.data.Name.replace(/^\s+|\s+$/g,"")!==""?c.data.Name:c.data.login;if(d.length>40)d=d.substring(0,30)+"...";d+=" ("+c.label+")";return d}else return c.label},setKeyAssist:function(c){this.keyAssistFunction=c;this.renderServices()},addUserItem:function(c,d,g,h){var i=this;if(h){this.unauthenticatedServices[c]&&delete this.unauthenticatedServices[c];this.authenticatedServices[c]={authService:d,label:g,data:h}}else{this.authenticatedServices[c]&&
delete this.authenticatedServices[c];this.unauthenticatedServices[c]=this.unauthenticatedServices[c]?{authService:d,label:g,pending:this.unauthenticatedServices[c].pending}:{authService:d,label:g}}e.hitch(this,this.renderServices)();if(e.byId("userInfo"))if(this.isSingleService()&&h){g=c=h.Name&&h.Name.replace(/^\s+|\s+$/g,"")!==""?h.Name:h.login;if(g.length>40)g=g.substring(0,30)+"...";e.create("a",{innerHTML:g,href:f.toUrl("profile/user-profile.html")+"#"+h.Location,title:"View profile of "+c,style:"margin-right: 0px"},
e.byId("userInfo"),"only")}else if(this.isSingleService()&&!h)if(d.getAuthForm)e.hitch(this,function(k){d.getAuthForm(eclipse.globalCommandUtils.notifyAuthenticationSite).then(function(m){m+=m.indexOf("?")==-1?"?redirect="+eclipse.globalCommandUtils.notifyAuthenticationSite+"?key="+k:"&redirect="+eclipse.globalCommandUtils.notifyAuthenticationSite+"?key="+k;e.create("a",{innerHTML:"Sign In",href:m,title:"Sign In",style:"margin-right: 0px",target:"_blank"},e.byId("userInfo"),"only")})})(c);else{if(d.login){var j=
e.create("a",{innerHTML:"Sign In",title:"Sign In",style:"margin-right: 0px"},e.byId("userInfo"),"only");e.connect(j,"onmouseover",j,function(){j.style.cursor="pointer"});e.connect(j,"onmouseout",j,function(){j.style.cursor="default"});e.connect(j,"onclick",function(){d.login(eclipse.globalCommandUtils.notifyAuthenticationSite)})}}else if(this.hasServices()){j=e.create("a",{innerHTML:"Profiles",style:"margin-right: 0px"},e.byId("userInfo"),"only");e.connect(j,"onmouseover",j,function(){j.style.cursor=
"pointer"});e.connect(j,"onmouseout",j,function(){j.style.cursor="default"});e.connect(j,"onclick",function(){try{a.popup.open({popup:i.options.loginDialog,around:e.byId("userInfo")})}catch(k){}a.focus(i.options.loginDialog.domNode)})}else e.empty(e.byId("userInfo"))}})});
define("orion/globalCommands",["require","dojo","dijit","orion/commonHTMLFragments","orion/commands","orion/parameterCollectors","orion/extensionCommands","orion/util","orion/textview/keyBinding","orion/favorites","dijit/Menu","dijit/MenuItem","dijit/form/DropDownButton","orion/widgets/OpenResourceDialog","orion/widgets/LoginDialog","orion/widgets/UserMenu"],function(f,e,a,c,d,g,h,i,j,k){function m(M){var Q=document.createElement("a");Q.href=M;return Q.href}function n(M,Q){if(M.getLabel)return M.getLabel();
else{M=new e.Deferred;M.callback(Q.properties.name);return M}}function p(){return F}function r(M){(M=M.getService("orion.page.progress"))&&e.hitch(M,M.init)("progressPane")}function w(M){var Q=M.getServiceReferences("orion.core.auth");F=[];var T=e.byId("userMenu");if(T){if(!a.byId("logins")){var E=new a.form.DropDownButton({id:"logins",dropDown:A,label:"Options",showLabel:false,alt:"Options"});e.place(E.domNode,T,"only");E.valueNode&&e.destroy(E.valueNode)}for(T=0;T<Q.length;T++){E=Q[T];var G=M.getService(E);
e.hitch(this,function(K,R){n(K,R).then(function(U){K.getKey().then(function(V){F.push(V);K.getUser().then(function(X){C.addUserItem(V,K,U,X);A.addUserItem(V,K,U,X)},function(){C.addUserItem(V,K,U);A.addUserItem(V,K,U,jsonData)});window.addEventListener("storage",function(){if(z[V]!==localStorage.getItem(V)){z[V]=localStorage.getItem(V);K.getUser().then(function(X){C.addUserItem(V,K,U,X);A.addUserItem(V,K,U,X)},function(){C.addUserItem(V,K,U);A.addUserItem(V,K,U)})}},false)})})})(G,E)}}}function s(M){C.setPendingAuthentication(M);
var Q;for(Q in M)if(M.hasOwnProperty(Q)){if(e.byId("userInfo").innerHTML)try{a.popup.open({popup:C,around:e.byId("userInfo")})}catch(T){}else window.setTimeout(function(){try{a.popup.open({popup:C,around:e.byId("userInfo")})}catch(E){}},500);return}a.popup.hide&&a.popup.hide(C);a.popup.close(C)}function u(M){C.authenticatedService(M)}function t(M,Q,T,E,G,K,R){M.closeParameterCollector();if(K=e.byId("pageActions")){e.empty(K);(K=M.renderCommands(K,"dom",T||Q,Q,"button"))&&K.then?K.then(function(){M.processURL(window.location.href)}):
M.processURL(window.location.href)}if(!R)if(K=e.byId("pageNavigationActions")){e.empty(K);M.renderCommands(K,"dom",G||T||Q,E||Q,"button")}}function y(){if(e.byId("relatedLinks")){if(H){H.focusedChild=null;e.forEach(H.getChildren(),function(M){H.removeChild(M);M.destroy()});H.destroy()}return H=new a.Menu({style:"display: none;",id:"relatedLinksMenu"})}}function B(M,Q){H||(H=new a.Menu({style:"display: none;",id:"relatedLinksMenu"}));M._addMenuItem(H,Q);M=a.byId("related");if((Q=e.byId("relatedLinks"))&&
!M){M=new a.form.DropDownButton({id:"related",label:"Related pages",dropDown:H});e.place(M.domNode,Q,"only");i.forceLayout(Q)}}function D(M,Q,T,E,G){var K=M.getServiceReferences("orion.page.link.related");if(!(K.length<=0)){var R=e.byId("relatedLinks");if(R){for(var U=y(),V=false,X=0;X<K.length;X++){for(var ba={},$=K[X].getPropertyNames(),da=0;da<$.length;da++)ba[$[da]]=K[X].getProperty($[da]);if(ba.id)if(e.indexOf(T,ba.id)<0){$=E.findCommand(ba.id);if(!$){var ea=M.getServiceReferences("orion.navigate.command");
for(da=0;da<ea.length;da++)if(ea[da].getProperty("id")===ba.id){ba={};$=ea[da].getPropertyNames();for(var ga=0;ga<$.length;ga++)ba[$[ga]]=ea[da].getProperty($[ga]);da=h._createCommandOptions(ba,ea[da],M,true);$=new d.Command(da);break}}if($)if(!$.visibleWhen||$.visibleWhen(Q)){V=true;da=new d.CommandInvocation(E,Q,Q,null,$);$._addMenuItem(U,da)}else typeof G==="function"&&window.setTimeout(e.hitch($,function(){e.when(G(),e.hitch(this,function(ma){ma&&Q===N&&this.visibleWhen(ma)&&B(this,new d.CommandInvocation(E,
ma,ma,null,this))}))}),0)}}(M=a.byId("related"))&&M.destroy();if(V){M=new a.form.DropDownButton({id:"related",label:"Related pages",dropDown:U});e.place(M.domNode,R,"only")}i.forceLayout(R)}}}function l(M,Q,T){var E=e.byId("globalActions");if(E){e.empty(E);T=(T=e.isArray(T)?T[0]:T)||Q||{};M.renderCommands(E,"global",T,Q,"tool")}}function o(M){I=M}function q(M,Q,T,E,G){N=M;D(Q,M,I,T,E);O=G}function v(M,Q,T,E,G,K,R,U){function V(){var J=Q.getService("orion.core.favorite");if(!J){J=new k.FavoritesService({serviceRegistry:Q});
J=Q.getService("orion.core.favorite")}if(O&&O.Location)J.hasFavorite(O.ChildrenLocation||O.Location).then(function(S){if(S)Q.getService("orion.page.message").setMessage(O.Name+" is already a favorite.",2E3);else{J.makeFavorites([O]);Q.getService("orion.page.message").setMessage(O.Name+" has been added to the favorites list.",2E3)}});else{var P=window.location.pathname+window.location.hash;J.hasFavorite(P).then(function(S){if(S)Q.getService("orion.page.message").setMessage(P+" is already a favorite.",
2E3);else{J.addFavoriteUrl(P);Q.getService("orion.page.message").setMessage(P+" has been added to the favorites list.",2E3)}})}}var X,ba=e.byId(M);if(!ba)throw"could not find banner parent, id was "+M;e.place(c.topHTMLFragment,ba,"only");if(M=e.byId("pageToolbar")){e.place(c.toolbarHTMLFragment,M,"only");e.addClass(M,"toolComposite")}else{M=e.create("div",{id:"pageToolbar","class":"toolbar toolComposite layoutBlock"},"titleArea","after");e.place(c.toolbarHTMLFragment,M,"only")}T.setParameterCollector(new g.CommandParameterCollector);
e.place('<div id="keyAssist" style="display: none" class="keyAssistFloat" role="list" aria-atomic="true" aria-live="assertive"></div>',document.body,"last");if(M=e.byId("primaryNav")){E=Q.getServiceReferences("orion.page.link");for(var $=0;$<E.length;$++){X={};for(var da=E[$].getPropertyNames(),ea=0;ea<da.length;ea++)X[da[ea]]=E[$].getProperty(da[ea]);if(X.href&&X.name){da=e.create("a",{href:X.href},M,"last");X=document.createTextNode(X.name);e.place(X,da,"only")}}}var ga=e.byId("search");if(!ga)throw"failed to generate HTML for banner";
e.connect(ga,"onkeypress",function(J){if(J.charOrCode===e.keys.ENTER)if(G){if(ga.value.length>0){J=G.createSearchQuery(ga.value);window.location=f.toUrl("search/search.html")+"#"+J}}else window.alert("Can't search: no search service is available")});if(M=e.byId("pageTitle")){X=document.createTextNode(document.title);e.place(X,M,"last")}if(M=e.byId("pageFavorite")){e.addClass(M,"commandButton");e.connect(M,"onclick",this,function(){V()});e.connect(M,"onkeypress",this,function(J){if(J.keyCode===e.keys.ENTER||
J.keyCode===e.keys.SPACE)V()});e.connect(M,"onmouseover",M,function(){e.addClass(this,"commandButtonOver")});e.connect(M,"onfocus",M,function(){e.addClass(this,"commandButtonOver")});e.connect(M,"onmouseout",M,function(){e.removeClass(this,"commandButtonOver")});e.connect(M,"onblur",M,function(){e.removeClass(this,"commandButtonOver")});new d.CommandTooltip({connectId:[M],label:"Add this page to the favorites list",position:["below","left","right","above"],commandParent:ba,commandService:T})}M=new d.Command({name:"Make Favorite",
tooltip:"Add to the favorites list",imageClass:"core-sprite-makeFavorite",id:"orion.makeFavorite",visibleWhen:function(J){J=e.isArray(J)?J:[J];for(var P=0;P<J.length;P++)if(!J[P].Location)return false;return true},callback:function(J){J=e.isArray(J.items)?J.items:[J.items];for(var P=Q.getService("orion.core.favorite"),S=function(aa){return function(Z){Z?Q.getService("orion.page.message").setMessage(aa.Name+" is already a favorite.",2E3):P.makeFavorites(aa)}},W=0;W<J.length;W++){var Y=J[W];P.hasFavorite(Y.ChildrenLocation||
Y.Location).then(S(Y))}}});T.addCommand(M,"dom");var ma=function(J,P,S){var W=P.getService("orion.core.favorite");if(!W){W=new k.FavoritesService({serviceRegistry:P});W=P.getService("orion.core.favorite")}var Y=new orion.widgets.OpenResourceDialog({searcher:J,searchRenderer:J.defaultRenderer,favoriteService:W});S&&e.connect(Y,"onHide",function(){S.getTextView().focus()});window.setTimeout(function(){Y.show()},0)};M=new d.Command({name:"Find File Named...",tooltip:"Choose a file by name and open an editor on it",
id:"eclipse.openResource",callback:function(){ma(G,Q,R)}});if(R){R.getTextView().setKeyBinding(new j.KeyBinding("f",true,true,false),"Find File Named...");R.getTextView().setAction("Find File Named...",function(){ma(G,Q,R);return true})}T.addCommand(M,"global");T.registerCommandContribution("eclipse.openResource",100,"globalActions",null,true,new d.CommandKeyBinding("f",true,true));M=new d.Command({name:"Toggle banner and footer",tooltip:"Hide or show the page banner and footer",id:"orion.toggleTrim",
callback:function(){var J=a.byId(ba.parentNode.id);if(J){var P=e.byId("footer");if(ba.style.display==="none"){ba.style.display="block";P.style.display="block"}else{ba.style.display="none";P.style.display="none"}J.layout()}return true}});T.addCommand(M,"global");T.registerCommandContribution("orion.toggleTrim",100,"globalActions",null,true,new d.CommandKeyBinding("m",true,true));if(R){R.getTextView().setKeyBinding(new d.CommandKeyBinding("m",true,true),"Toggle Trim");R.getTextView().setAction("Toggle Trim",
M.callback)}var L=e.byId("keyAssist");e.connect(document,"onkeypress",e.hitch(this,function(J){if(J.charOrCode===e.keys.ESCAPE)L.style.display="none"}));e.connect(document,"onclick",e.hitch(this,function(J){if((J=J.target||J.originalTarget||J.srcElement)&&J.id!=="keyAssist")L.style.display="none"}));R&&R.getTextView().addEventListener("MouseDown",function(){L.style.display="none"});U&&U.addHandler({isActive:function(){return L.style.display==="block"},cancel:function(){if(this.isActive()){L.style.display=
"none";return true}return false}});U=new d.Command({name:"Show Keys",tooltip:"Show a list of all the keybindings on this page",id:"eclipse.keyAssist",callback:function(){if(L.style.display==="none"){e.empty(L);if(R){e.place("<h2>Editor</h2>",L,"last");for(var J=R.getTextView().getActions(false),P=0;P<J.length;P++)for(var S=J[P],W=R.getTextView().getKeyBindings(S),Y=0;Y<W.length;Y++)e.place('<span role="listitem">'+i.getUserKeyString(W[Y])+" = "+S+"<br></span>",L,"last")}e.place("<h2>Global</h2>",
L,"last");T.showKeyBindings(L);L.style.display="block"}else L.style.display="none";return true}});T.addCommand(U,"global");T.registerCommandContribution("eclipse.keyAssist",100,"globalActions",null,true,new d.CommandKeyBinding(191,false,true));if(R){M=window.navigator.platform.indexOf("Mac")!==-1;R.getTextView().setKeyBinding(new d.CommandKeyBinding(191,false,true,!M,M),"Show Keys");R.getTextView().setAction("Show Keys",U.callback)}A.setKeyAssist(U.callback);l(T,K,N);if(e.indexOf(I,"eclipse.openWith")<
0)(K=Q.getService("orion.file.contenttypes"))&&K.getContentTypesMap().then(function(J){J=h._createOpenWithCommands(Q,J);for(var P=0;P<J.length;P++){var S=J[P].properties,W=h._createCommandOptions(S,J[P].service,Q,true);W=new d.Command(W);W.isEditor=S.isEditor;T.addCommand(W,"object");T.addCommandGroup("eclipse.openWith",1E3,"Open With");T.registerCommandContribution(W.id,P,null,"eclipse.openWith")}});w(Q);if(c.bottomHTMLFragment)(K=e.byId("footer"))&&e.place(c.bottomHTMLFragment,K,"only");r(Q);i.forceLayout(ba.parentNode);
e.subscribe("/dojo/hashchange",T,function(){T.processURL(window.location.href)})}var x=m(f.toUrl("auth/NotifyAuthentication.html")),z={},C=new orion.widgets.LoginDialog,A=new orion.widgets.UserMenu({loginDialog:C}),F=[],H,N,I=[],O=null;return{generateUserInfo:w,generateRelatedLinks:D,generateDomCommandsInBanner:t,generateBanner:v,notifyAuthenticationSite:x,setPendingAuthentication:s,getAuthenticationIds:p,setPageTarget:q,setPageCommandExclusions:o,authenticatedService:u}});
define("dojo/date",["dojo"],function(f){f.getObject("date",true,f);f.date.getDaysInMonth=function(e){var a=e.getMonth();if(a==1&&f.date.isLeapYear(e))return 29;return[31,28,31,30,31,30,31,31,30,31,30,31][a]};f.date.isLeapYear=function(e){e=e.getFullYear();return!(e%400)||!(e%4)&&!!(e%100)};f.date.getTimezoneName=function(e){var a=e.toString(),c="",d=a.indexOf("(");if(d>-1)c=a.substring(++d,a.indexOf(")"));else{d=/([A-Z\/]+) \d{4}$/;if(a=a.match(d))c=a[1];else{a=e.toLocaleString();d=/ ([A-Z\/]+)$/;
if(a=a.match(d))c=a[1]}}return c=="AM"||c=="PM"?"":c};f.date.compare=function(e,a,c){e=new Date(+e);a=new Date(+(a||new Date));if(c=="date"){e.setHours(0,0,0,0);a.setHours(0,0,0,0)}else if(c=="time"){e.setFullYear(0,0,0);a.setFullYear(0,0,0)}if(e>a)return 1;if(e<a)return-1;return 0};f.date.add=function(e,a,c){var d=new Date(+e),g=false,h="Date";switch(a){case "day":break;case "weekday":var i;if(a=c%5){a=a;i=parseInt(c/5)}else{a=c>0?5:-5;i=c>0?(c-5)/5:(c+5)/5}var j=e.getDay(),k=0;if(j==6&&c>0)k=1;
else if(j==0&&c<0)k=-1;j=j+a;if(j==0||j==6)k=c>0?2:-2;c=7*i+a+k;break;case "year":h="FullYear";g=true;break;case "week":c*=7;break;case "quarter":c*=3;case "month":g=true;h="Month";break;default:h="UTC"+a.charAt(0).toUpperCase()+a.substring(1)+"s"}h&&d["set"+h](d["get"+h]()+c);g&&d.getDate()<e.getDate()&&d.setDate(0);return d};f.date.difference=function(e,a,c){a=a||new Date;c=c||"day";var d=a.getFullYear()-e.getFullYear(),g=1;switch(c){case "quarter":e=e.getMonth();a=a.getMonth();e=Math.floor(e/3)+
1;a=Math.floor(a/3)+1;a+=d*4;g=a-e;break;case "weekday":d=Math.round(f.date.difference(e,a,"day"));c=parseInt(f.date.difference(e,a,"week"));g=d%7;if(g==0)d=c*5;else{var h=0,i=e.getDay();a=a.getDay();c=parseInt(d/7);g=d%7;e=new Date(e);e.setDate(e.getDate()+c*7);e=e.getDay();if(d>0)switch(true){case i==6:h=-1;break;case i==0:h=0;break;case a==6:h=-1;break;case a==0:h=-2;break;case e+g>5:h=-2}else if(d<0)switch(true){case i==6:h=0;break;case i==0:h=1;break;case a==6:h=2;break;case a==0:h=1;break;case e+
g<0:h=2}d+=h;d-=c*2}g=d;break;case "year":g=d;break;case "month":g=a.getMonth()-e.getMonth()+d*12;break;case "week":g=parseInt(f.date.difference(e,a,"day")/7);break;case "day":g/=24;case "hour":g/=60;case "minute":g/=60;case "second":g/=1E3;case "millisecond":g*=a.getTime()-e.getTime()}return Math.round(g)};return f.date});
define("dojo/cldr/supplemental",["dojo","dojo/i18n"],function(f){f.getObject("cldr.supplemental",true,f);f.cldr.supplemental.getFirstDayOfWeek=function(e){e={mv:5,ae:6,af:6,bh:6,dj:6,dz:6,eg:6,er:6,et:6,iq:6,ir:6,jo:6,ke:6,kw:6,ly:6,ma:6,om:6,qa:6,sa:6,sd:6,so:6,sy:6,tn:6,ye:6,ar:0,as:0,az:0,bw:0,ca:0,cn:0,fo:0,ge:0,gl:0,gu:0,hk:0,il:0,"in":0,jm:0,jp:0,kg:0,kr:0,la:0,mh:0,mn:0,mo:0,mp:0,mt:0,nz:0,ph:0,pk:0,sg:0,th:0,tt:0,tw:0,um:0,us:0,uz:0,vi:0,zw:0}[f.cldr.supplemental._region(e)];return e===undefined?
1:e};f.cldr.supplemental._region=function(e){e=f.i18n.normalizeLocale(e);e=e.split("-");var a=e[1];if(a){if(a.length==4)a=e[2]}else a={de:"de",en:"us",es:"es",fi:"fi",fr:"fr",he:"il",hu:"hu",it:"it",ja:"jp",ko:"kr",nl:"nl",pt:"br",sv:"se",zh:"cn"}[e[0]];return a};f.cldr.supplemental.getWeekend=function(e){var a=f.cldr.supplemental._region(e);e={"in":0,af:4,dz:4,ir:4,om:4,sa:4,ye:4,ae:5,bh:5,eg:5,il:5,iq:5,jo:5,kw:5,ly:5,ma:5,qa:5,sd:5,sy:5,tn:5}[a];a={af:5,dz:5,ir:5,om:5,sa:5,ye:5,ae:6,bh:5,eg:6,
il:6,iq:6,jo:6,kw:6,ly:6,ma:6,qa:6,sd:6,sy:6,tn:6}[a];if(e===undefined)e=6;if(a===undefined)a=0;return{start:e,end:a}};return f.cldr.supplemental});
define("dojo/cldr/nls/gregorian",{root:{"months-format-narrow":["1","2","3","4","5","6","7","8","9","10","11","12"],"quarters-standAlone-narrow":["1","2","3","4"],"field-weekday":"Day of the Week","dateFormatItem-yQQQ":"y QQQ","dateFormatItem-yMEd":"EEE, y-M-d","dateFormatItem-MMMEd":"E MMM d",eraNarrow:["BCE","CE"],"dateTimeFormats-appendItem-Day-Of-Week":"{0} {1}","dateFormat-long":"y MMMM d","months-format-wide":["1","2","3","4","5","6","7","8","9","10","11","12"],"dateTimeFormat-medium":"{1} {0}",
"dateFormatItem-EEEd":"d EEE","dayPeriods-format-wide-pm":"PM","dateFormat-full":"EEEE, y MMMM dd","dateFormatItem-Md":"M-d","dayPeriods-format-abbr-am":"AM","dateTimeFormats-appendItem-Second":"{0} ({2}: {1})","field-era":"Era","dateFormatItem-yM":"y-M","months-standAlone-wide":["1","2","3","4","5","6","7","8","9","10","11","12"],"timeFormat-short":"HH:mm","quarters-format-wide":["Q1","Q2","Q3","Q4"],"timeFormat-long":"HH:mm:ss z","field-year":"Year","dateFormatItem-yMMM":"y MMM","dateFormatItem-yQ":"y Q",
"dateTimeFormats-appendItem-Era":"{0} {1}","field-hour":"Hour","months-format-abbr":["1","2","3","4","5","6","7","8","9","10","11","12"],"timeFormat-full":"HH:mm:ss zzzz","dateTimeFormats-appendItem-Week":"{0} ({2}: {1})","field-day-relative+0":"Today","field-day-relative+1":"Tomorrow","dateFormatItem-H":"HH","months-standAlone-abbr":["1","2","3","4","5","6","7","8","9","10","11","12"],"quarters-format-abbr":["Q1","Q2","Q3","Q4"],"quarters-standAlone-wide":["Q1","Q2","Q3","Q4"],"dateFormatItem-M":"L",
"days-standAlone-wide":["1","2","3","4","5","6","7"],"timeFormat-medium":"HH:mm:ss","dateFormatItem-Hm":"HH:mm","quarters-standAlone-abbr":["Q1","Q2","Q3","Q4"],eraAbbr:["BCE","CE"],"field-minute":"Minute","field-dayperiod":"Dayperiod","days-standAlone-abbr":["1","2","3","4","5","6","7"],"dateFormatItem-d":"d","dateFormatItem-ms":"mm:ss","quarters-format-narrow":["1","2","3","4"],"field-day-relative+-1":"Yesterday","dateFormatItem-h":"h a","dateTimeFormat-long":"{1} {0}","dayPeriods-format-narrow-am":"AM",
"dateFormatItem-MMMd":"MMM d","dateFormatItem-MEd":"E, M-d","dateTimeFormat-full":"{1} {0}","field-day":"Day","days-format-wide":["1","2","3","4","5","6","7"],"field-zone":"Zone","dateTimeFormats-appendItem-Day":"{0} ({2}: {1})","dateFormatItem-y":"y","months-standAlone-narrow":["1","2","3","4","5","6","7","8","9","10","11","12"],"dateFormatItem-hm":"h:mm a","dateTimeFormats-appendItem-Year":"{0} {1}","dateTimeFormats-appendItem-Hour":"{0} ({2}: {1})","dayPeriods-format-abbr-pm":"PM","days-format-abbr":["1",
"2","3","4","5","6","7"],eraNames:["BCE","CE"],"days-format-narrow":["1","2","3","4","5","6","7"],"days-standAlone-narrow":["1","2","3","4","5","6","7"],"dateFormatItem-MMM":"LLL","field-month":"Month","dateTimeFormats-appendItem-Quarter":"{0} ({2}: {1})","dayPeriods-format-wide-am":"AM","dateTimeFormats-appendItem-Month":"{0} ({2}: {1})","dateTimeFormats-appendItem-Minute":"{0} ({2}: {1})","dateFormat-short":"yyyy-MM-dd","field-second":"Second","dateFormatItem-yMMMEd":"EEE, y MMM d","dateTimeFormats-appendItem-Timezone":"{0} {1}",
"field-week":"Week","dateFormat-medium":"y MMM d","dayPeriods-format-narrow-pm":"PM","dateTimeFormat-short":"{1} {0}","dateFormatItem-Hms":"HH:mm:ss","dateFormatItem-hms":"h:mm:ss a"},ar:true,ca:true,cs:true,da:true,de:true,el:true,en:true,"en-au":true,"en-ca":true,"en-gb":true,es:true,fi:true,fr:true,"fr-ch":true,he:true,hu:true,it:true,ja:true,ko:true,nb:true,nl:true,pl:true,pt:true,"pt-pt":true,ro:true,ru:true,sk:true,sl:true,sv:true,th:true,tr:true,zh:true,"zh-hant":true,"zh-hk":true,"zh-tw":true});
define("dojo/cldr/nls/en/gregorian",{"dateFormatItem-yM":"M/y","field-dayperiod":"AM/PM","dateFormatItem-yQ":"Q y","dayPeriods-format-wide-pm":"PM","field-minute":"Minute",eraNames:["Before Christ","Anno Domini"],"dateFormatItem-MMMEd":"E, MMM d","dateTimeFormat-full":"{1} {0}","field-day-relative+-1":"Yesterday","field-weekday":"Day of the Week","dateFormatItem-hms":"h:mm:ss a","dateFormatItem-yQQQ":"QQQ y","days-standAlone-wide":["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],
"dateFormatItem-MMM":"LLL","months-standAlone-narrow":["J","F","M","A","M","J","J","A","S","O","N","D"],"dateTimeFormat-short":"{1} {0}","field-era":"Era","field-hour":"Hour","dayPeriods-format-wide-am":"AM","dateTimeFormat-medium":"{1} {0}","dateFormatItem-y":"y","timeFormat-full":"h:mm:ss a zzzz","months-standAlone-abbr":["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],"dateFormatItem-yMMM":"MMM y","field-day-relative+0":"Today","field-day-relative+1":"Tomorrow","days-standAlone-narrow":["S",
"M","T","W","T","F","S"],eraAbbr:["BC","AD"],"dateFormat-long":"MMMM d, y","timeFormat-medium":"h:mm:ss a","dateFormatItem-EEEd":"d EEE","field-zone":"Zone","dateFormatItem-Hm":"HH:mm","dateFormat-medium":"MMM d, y","dateFormatItem-Hms":"HH:mm:ss","quarters-standAlone-wide":["1st quarter","2nd quarter","3rd quarter","4th quarter"],"dateFormatItem-ms":"mm:ss","field-year":"Year","quarters-standAlone-narrow":["1","2","3","4"],"dateTimeFormat-long":"{1} {0}","field-week":"Week","months-standAlone-wide":["January",
"February","March","April","May","June","July","August","September","October","November","December"],"dateFormatItem-MMMd":"MMM d","timeFormat-long":"h:mm:ss a z","months-format-abbr":["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],"dayPeriods-format-wide-noon":"noon","timeFormat-short":"h:mm a","field-month":"Month","quarters-format-abbr":["Q1","Q2","Q3","Q4"],"days-format-abbr":["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],"dateFormatItem-M":"L","days-format-narrow":["S",
"M","T","W","T","F","S"],"field-second":"Second","field-day":"Day","dateFormatItem-MEd":"E, M/d","months-format-narrow":["J","F","M","A","M","J","J","A","S","O","N","D"],"dateFormatItem-hm":"h:mm a","days-standAlone-abbr":["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],"dateFormat-short":"M/d/yy","dateFormatItem-yMMMEd":"EEE, MMM d, y","dateFormat-full":"EEEE, MMMM d, y","dateFormatItem-Md":"M/d","dateFormatItem-yMEd":"EEE, M/d/y","months-format-wide":["January","February","March","April","May","June",
"July","August","September","October","November","December"],"dateFormatItem-d":"d","quarters-format-wide":["1st quarter","2nd quarter","3rd quarter","4th quarter"],"days-format-wide":["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],eraNarrow:["B","A"]});
define("dojo/date/locale",["dojo","dojo/date","dojo/cldr/supplemental","dojo/regexp","dojo/string","dojo/i18n","i18n!dojo/cldr/nls/gregorian"],function(f){f.getObject("date.locale",true,f);(function(){function e(d,g,h,i){return i.replace(/([a-z])\1*/ig,function(j){var k,m,n=j.charAt(0);j=j.length;var p=["abbr","wide","narrow"];switch(n){case "G":k=g[j<4?"eraAbbr":"eraNames"][d.getFullYear()<0?0:1];break;case "y":k=d.getFullYear();switch(j){case 1:break;case 2:if(!h.fullYear){k=String(k);k=k.substr(k.length-
2);break}default:m=true}break;case "Q":case "q":k=Math.ceil((d.getMonth()+1)/3);m=true;break;case "M":k=d.getMonth();if(j<3){k=k+1;m=true}else{n=["months-format",p[j-3]].join("-");k=g[n][k]}break;case "w":k=f.date.locale._getWeekOfYear(d,0);m=true;break;case "d":k=d.getDate();m=true;break;case "D":k=f.date.locale._getDayOfYear(d);m=true;break;case "E":k=d.getDay();if(j<3){k=k+1;m=true}else{n=["days-format",p[j-3]].join("-");k=g[n][k]}break;case "a":k=d.getHours()<12?"am":"pm";k=h[k]||g["dayPeriods-format-wide-"+
k];break;case "h":case "H":case "K":case "k":m=d.getHours();switch(n){case "h":k=m%12||12;break;case "H":k=m;break;case "K":k=m%12;break;case "k":k=m||24;break}m=true;break;case "m":k=d.getMinutes();m=true;break;case "s":k=d.getSeconds();m=true;break;case "S":k=Math.round(d.getMilliseconds()*Math.pow(10,j-3));m=true;break;case "v":case "z":if(k=f.date.locale._getZone(d,true,h))break;j=4;case "Z":k=f.date.locale._getZone(d,false,h);k=[k<=0?"+":"-",f.string.pad(Math.floor(Math.abs(k)/60),2),f.string.pad(Math.abs(k)%
60,2)];if(j==4){k.splice(0,0,"GMT");k.splice(3,0,":")}k=k.join("");break;default:throw new Error("dojo.date.locale.format: invalid pattern char: "+i);}if(m)k=f.string.pad(k,j);return k})}function a(d,g,h,i){var j=function(n){return n};g=g||j;h=h||j;i=i||j;var k=d.match(/(''|[^'])+/g),m=d.charAt(0)=="'";f.forEach(k,function(n,p){if(n){k[p]=(m?h:g)(n.replace(/''/g,"'"));m=!m}else k[p]=""});return i(k.join(""))}function c(d,g,h,i){i=f.regexp.escapeString(i);h.strict||(i=i.replace(" a"," ?a"));return i.replace(/([a-z])\1*/ig,
function(j){var k;k=j.charAt(0);var m=j.length,n="",p="";if(h.strict){if(m>1)n="0{"+(m-1)+"}";if(m>2)p="0{"+(m-2)+"}"}else{n="0?";p="0{0,2}"}switch(k){case "y":k="\\d{2,4}";break;case "M":k=m>2?"\\S+?":"1[0-2]|"+n+"[1-9]";break;case "D":k="[12][0-9][0-9]|3[0-5][0-9]|36[0-6]|"+p+"[1-9][0-9]|"+n+"[1-9]";break;case "d":k="3[01]|[12]\\d|"+n+"[1-9]";break;case "w":k="[1-4][0-9]|5[0-3]|"+n+"[1-9]";break;case "E":k="\\S+";break;case "h":k="1[0-2]|"+n+"[1-9]";break;case "k":k="1[01]|"+n+"\\d";break;case "H":k=
"1\\d|2[0-3]|"+n+"\\d";break;case "K":k="1\\d|2[0-4]|"+n+"[1-9]";break;case "m":case "s":k="[0-5]\\d";break;case "S":k="\\d{"+m+"}";break;case "a":m=h.am||g["dayPeriods-format-wide-am"];n=h.pm||g["dayPeriods-format-wide-pm"];k=m+"|"+n;if(!h.strict){if(m!=m.toLowerCase())k+="|"+m.toLowerCase();if(n!=n.toLowerCase())k+="|"+n.toLowerCase();if(k.indexOf(".")!=-1)k+="|"+k.replace(/\./g,"")}k=k.replace(/\./g,"\\.");break;default:k=".*"}d&&d.push(j);return"("+k+")"}).replace(/[\xa0 ]/g,"[\\s\\xa0]")}f.date.locale._getZone=
function(d,g){return g?f.date.getTimezoneName(d):d.getTimezoneOffset()};f.date.locale.format=function(d,g){g=g||{};var h=f.i18n.normalizeLocale(g.locale),i=g.formatLength||"short";h=f.date.locale._getGregorianBundle(h);var j=[];d=f.hitch(this,e,d,h,g);if(g.selector=="year")return a(h["dateFormatItem-yyyy"]||"yyyy",d);var k;if(g.selector!="date")(k=g.timePattern||h["timeFormat-"+i])&&j.push(a(k,d));if(g.selector!="time")(k=g.datePattern||h["dateFormat-"+i])&&j.push(a(k,d));return j.length==1?j[0]:
h["dateTimeFormat-"+i].replace(/\{(\d+)\}/g,function(m,n){return j[n]})};f.date.locale.regexp=function(d){return f.date.locale._parseInfo(d).regexp};f.date.locale._parseInfo=function(d){d=d||{};var g=f.i18n.normalizeLocale(d.locale);g=f.date.locale._getGregorianBundle(g);var h=d.formatLength||"short",i=d.datePattern||g["dateFormat-"+h],j=d.timePattern||g["timeFormat-"+h];h=d.selector=="date"?i:d.selector=="time"?j:g["dateTimeFormat-"+h].replace(/\{(\d+)\}/g,function(m,n){return[j,i][n]});var k=[];
return{regexp:a(h,f.hitch(this,c,k,g,d)),tokens:k,bundle:g}};f.date.locale.parse=function(d,g){var h=/[\u200E\u200F\u202A\u202E]/g,i=f.date.locale._parseInfo(g),j=i.tokens,k=i.bundle;d=(new RegExp("^"+i.regexp.replace(h,"")+"$",i.strict?"":"i")).exec(d&&d.replace(h,""));if(!d)return null;var m=["abbr","wide","narrow"],n=[1970,0,1,0,0,0,0],p="";d=f.every(d,function(w,s){if(!s)return true;s=j[s-1];var u=s.length;switch(s.charAt(0)){case "y":if(u!=2&&g.strict)n[0]=w;else if(w<100){w=Number(w);u=""+(new Date).getFullYear();
s=u.substring(0,2)*100;u=Math.min(Number(u.substring(2,4))+20,99);n[0]=w<u?s+w:s-100+w}else{if(g.strict)return false;n[0]=w}break;case "M":if(u>2){s=k["months-format-"+m[u-3]].concat();if(!g.strict){w=w.replace(".","").toLowerCase();s=f.map(s,function(y){return y.replace(".","").toLowerCase()})}w=f.indexOf(s,w);if(w==-1)return false}else w--;n[1]=w;break;case "E":case "e":s=k["days-format-"+m[u-3]].concat();if(!g.strict){w=w.toLowerCase();s=f.map(s,function(y){return y.toLowerCase()})}w=f.indexOf(s,
w);if(w==-1)return false;break;case "D":n[1]=0;case "d":n[2]=w;break;case "a":s=g.am||k["dayPeriods-format-wide-am"];u=g.pm||k["dayPeriods-format-wide-pm"];if(!g.strict){var t=/\./g;w=w.replace(t,"").toLowerCase();s=s.replace(t,"").toLowerCase();u=u.replace(t,"").toLowerCase()}if(g.strict&&w!=s&&w!=u)return false;p=w==u?"p":w==s?"a":"";break;case "K":if(w==24)w=0;case "h":case "H":case "k":if(w>23)return false;n[3]=w;break;case "m":n[4]=w;break;case "s":n[5]=w;break;case "S":n[6]=w}return true});
h=+n[3];if(p==="p"&&h<12)n[3]=h+12;else if(p==="a"&&h==12)n[3]=0;h=new Date(n[0],n[1],n[2],n[3],n[4],n[5],n[6]);g.strict&&h.setFullYear(n[0]);var r=j.join("");i=r.indexOf("d")!=-1;r=r.indexOf("M")!=-1;if(!d||r&&h.getMonth()>n[1]||i&&h.getDate()>n[2])return null;if(r&&h.getMonth()<n[1]||i&&h.getDate()<n[2])h=f.date.add(h,"hour",1);return h}})();(function(){var e=[];f.date.locale.addCustomFormats=function(a,c){e.push({pkg:a,name:c})};f.date.locale._getGregorianBundle=function(a){var c={};f.forEach(e,
function(d){d=f.i18n.getLocalization(d.pkg,d.name,a);c=f.mixin(c,d)},this);return c}})();f.date.locale.addCustomFormats("dojo.cldr","gregorian");f.date.locale.getNames=function(e,a,c,d){var g;d=f.date.locale._getGregorianBundle(d);e=[e,c,a];if(c=="standAlone"){c=e.join("-");g=d[c];if(g[0]==1)g=undefined}e[1]="format";return(g||d[e.join("-")]).concat()};f.date.locale.isWeekend=function(e,a){a=f.cldr.supplemental.getWeekend(a);e=(e||new Date).getDay();if(a.end<a.start){a.end+=7;if(e<a.start)e+=7}return e>=
a.start&&e<=a.end};f.date.locale._getDayOfYear=function(e){return f.date.difference(new Date(e.getFullYear(),0,1,e.getHours()),e)+1};f.date.locale._getWeekOfYear=function(e,a){if(arguments.length==1)a=0;var c=(new Date(e.getFullYear(),0,1)).getDay(),d=(c-a+7)%7;d=Math.floor((f.date.locale._getDayOfYear(e)+d-1)/7);c==a&&d++;return d};return f.date.locale});
define("orion/auth",["dojo","dijit","orion/globalCommands","dojo/date/locale","orion/widgets/LoginDialog"],function(f,e,a){function c(h,i){if(h.status===403){if(typeof d==="undefined")d=new e.Dialog({title:"Forbidden access"});var j=h.message;if(h.responseText)j=JSON.parse(h.responseText).Message||h.message;d.set("content",j);d.show()}else if(h.status===401)try{var k=JSON.parse(h.responseText);if(!k.SignInKey)return k;var m=localStorage.getItem(k.SignInKey),n=function(){var w=localStorage.getItem(k.SignInKey);
if(m!==w){window.removeEventListener("storage",n,false);delete g[k.SignInKey];a.setPendingAuthentication(g);a.authenticatedService(k.SignInKey);i&&i()}};window.addEventListener("storage",n,false);if(k.SignInKey){g[k.SignInKey]=k;a.setPendingAuthentication(g)}}catch(p){}else try{return JSON.parse(h.responseText)}catch(r){return{Message:h.Message,HttpCode:h.status}}}var d,g={};f.addOnLoad(function(){window.dojo=f;window.eclipse=window.eclipse||{};eclipse.globalCommandUtils=a});return{handleAuthenticationError:c}});
define("orion/preferences",["require","dojo","orion/auth","dojo/DeferredList"],function(f,e,a){function c(k,m){this._name=k;this._providers=m;this._flushPending=false;this._cached=null;this._stores=[];this._dirty=[]}function d(k,m){return{get:function(n,p){if(m===0)return null;n=localStorage.getItem(k+n);if(n===null)return null;n=JSON.parse(n);if(p||m===-1||n._expires&&n._expires>(new Date).getTime()){delete n._expires;return n}return null},set:function(n,p){if(m!==0){if(m!==-1)p._expires=(new Date).getTime()+
1E3*m;if(Object.keys(p).length===0)localStorage.removeItem(k+n);else{var r=JSON.stringify(p);localStorage.setItem(k+n,r);delete p._expires}}},remove:function(n){localStorage.removeItem(k+n)}}}function g(k){this._currentPromises={};this._cache=new d("/orion/preferences/user",0);this._service=null;this.available=function(){if(!this._service){var m=k.getServiceReferences("orion.core.preference.provider");if(m.length>0)this._service=k.getService(m[0])}return!!this._service}}function h(k){this._location=
k;this._currentPromise=null;this._cache=new d("/orion/preferences/default",3600)}function i(){this._cache=new d("/orion/preferences/local",-1)}function j(k,m){this._userProvider=new g(k);this._localProvider=new i;m=m||"defaults.pref";if(m.indexOf("://")===-1)m=f.toUrl(m);this._defaultsProvider=new h(m);this._serviceRegistration=k.registerService("orion.core.preference",this)}c.prototype={_flush:function(){for(var k=[],m=0;m<this._stores.length;++m){var n=this._stores[m];this._dirty.indexOf(n)!==-1&&
k.push(this._providers[m].put(this._name,n))}this._dirty=[];return new e.DeferredList(k)},_scheduleFlush:function(k){this._dirty.indexOf(k)===-1&&this._dirty.push(k);if(!this._flushPending){this._flushPending=true;window.setTimeout(e.hitch(this,function(){if(this._flushPending){this._flushPending=false;this._flush()}}),0)}},_getCached:function(){if(!this._cached){this._cached={};for(var k=0;k<this._stores.length;++k){var m=this._stores[k];for(var n in m)if(m.hasOwnProperty(n)&&typeof this._cached[n]===
"undefined")this._cached[n]=m[n]}}return this._cached},keys:function(){return Object.keys(this._getCached())},get:function(k){return this._getCached()[k]},put:function(k,m){if(this._stores.length!==0){var n=this._stores[0];if(n[k]!==m){n[k]=m;this._cached=null;this._scheduleFlush(n)}}},remove:function(k){for(var m=0;m<this._stores.length;++m){var n=this._stores[m];if(n.hasOwnProperty(k)){delete n[k];this._cached=null;this._scheduleFlush(n);return true}}return false},clear:function(){for(var k=0;k<
this._stores.length;++k){this._stores[k]={};this._scheduleFlush(this._stores[k])}this._cached=null},sync:function(k){if(this._flushPending){this._flushPending=false;return this._flush()}for(var m=this,n=[],p=0;p<this._providers.length;++p)n.push(this._providers[p].get(this._name,k).then(function(r){return function(w){m._stores[r]=w}}(p)));return(new e.DeferredList(n)).then(function(){m._cached=null;m._getCached()})},flush:function(){this._flush()}};g.prototype={get:function(k,m){if(this._currentPromises[k])return this._currentPromises[k];
var n=new e.Deferred,p=null;if(m)this._cache.remove(k);else p=this._cache.get(k);if(p!==null)n.resolve(p);else{this._currentPromises[k]=n;var r=this;this._service.get(k).then(function(w){r._cache.set(k,w);delete r._currentPromises[k];n.resolve(w)},function(w){if(w.status===401){delete r._currentPromises[k];n.resolve({});a.handleAuthenticationError(w,function(){r.get(k)})}else if(w.status===404){w={};r._cache.set(k,w);delete r._currentPromises[k];n.resolve(w)}else{delete r._currentPromises[k];n.resolve(r._cache.get(k,
true)||{})}})}return n},put:function(k,m){var n=new e.Deferred;this._cache.set(k,m);var p=this;this._service.put(k,m).then(function(){n.resolve()},function(r){r.status===401?a.handleAuthenticationError(r,function(){p._service.put(k,m).then(function(){n.resolve()},function(){n.resolve()})}):n.resolve()});return n}};h.prototype={get:function(k,m){if(this._currentPromise)return this._currentPromise;var n=new e.Deferred,p=null;if(m)this._cache.remove(k);else p=this._cache.get(k);if(p!==null)n.resolve(p);
else{this._currentPromise=n;var r=this;e.xhrGet({url:this._location,headers:{"Orion-Version":"1"},handleAs:"json",timeout:15E3,load:function(w){r._cache.set(k,w[k]||{});r._currentPromise=null;n.resolve(w[k]||{})},error:function(w,s){if(s.xhr.status===401){r._currentPromise=null;n.resolve({});n=new e.Deferred;r._currentPromise=n;var u=this;a.handleAuthenticationError(s.xhr,function(){e.xhrGet(u)})}else if(s.xhr.status===404){r._cache.set(k,{});r._currentPromise=null;n.resolve({})}else{r._currentPromise=
null;w=r._cache.get(k,true);w!==null?n.resolve(w[k]||{}):n.resolve({})}}})}return n},put:function(){var k=new e.Deferred;k.resolve();return k}};i.prototype={get:function(k){var m=new e.Deferred;k=this._cache.get(k);k!==null?m.resolve(k):m.resolve({});return m},put:function(k,m){var n=new e.Deferred;this._cache.set(k,m);n.resolve();return n}};j.DEFAULT_SCOPE=1;j.LOCAL_SCOPE=2;j.USER_SCOPE=4;j.prototype={getPreferences:function(k,m){if(!m||typeof m!=="number"||m>7||m<1)m=j.DEFAULT_SCOPE|j.LOCAL_SCOPE|
j.USER_SCOPE;var n=[];j.USER_SCOPE&m&&this._userProvider.available()&&n.push(this._userProvider);j.LOCAL_SCOPE&m&&n.push(this._localProvider);j.DEFAULT_SCOPE&m&&n.push(this._defaultsProvider);var p=new c(k,n);return p.sync().then(function(){return p})}};return{PreferencesService:j}});
define("orion/pluginregistry",["dojo","orion/serviceregistry","dojo/DeferredList"],function(f,e){var a=a||{};a.Plugin=function(c,d,g){function h(y,B,D,l){if(!n)throw new Error("plugin not connected");var o=s++;u[String(o)]=l;g.postMessage({id:o,serviceId:y,method:B,params:D},n)}function i(y){var B={};if(y.methods)for(var D=0;D<y.methods.length;D++){var l=y.methods[D];B[l]=function(o){return function(){var q=Array.prototype.slice.call(arguments),v=new f.Deferred;m._load().then(function(){h(y.serviceId,
o,q,v)});return v.promise}}(l)}return B}function j(){var y=d.services;if(y)for(var B=0;B<y.length;B++){var D=y[B],l=i(D);t[D.serviceId]=g.registerService(D.type,l,D.properties)}}function k(y){try{if(y.method)if("plugin"===y.method){if(d){if(JSON.stringify(d)!==JSON.stringify(y.params[0])){for(var B in t)if(t.hasOwnProperty(B)){t[B].unregister();delete t[B]}d=y.params[0];j();g.updatePlugin(m)}}else{d=y.params[0];j()}if(!w){w=true;p.resolve(m)}if(r){r.resolve(m);r=null}}else if("dispatchEvent"===y.method){var D=
t[y.serviceId];D.dispatchEvent.apply(D,y.params)}else if("progress"===y.method){var l=u[String(y.requestId)];l.progress.apply(l,y.params)}else throw new Error("Bad response method: "+y.method);else{l=u[String(y.id)];delete u[String(y.id)];y.error?l.reject(y.error):l.resolve(y.result)}}catch(o){console.log(o)}}var m=this,n=null,p=new f.Deferred,r=null,w=false,s=0,u={},t={};this.getLocation=function(){return c};this.getData=function(){return d};this.uninstall=function(){for(var y in t)if(t.hasOwnProperty(y)){t[y].unregister();
delete t[y]}if(n){g.disconnect(n);n=null}g.uninstallPlugin(this)};this.getServiceReferences=function(){var y=[],B;for(B in t)t.hasOwnProperty(B)&&y.push(t[B].getServiceReference());return y};this.update=function(){if(!w)return this._load();var y;if(r===null){y=r=new f.Deferred;g.disconnect(n);n=g.connect(c,k);setTimeout(function(){r===y&&r.reject(new Error("Load timeout for plugin: "+c))},15E3)}return r};this._load=function(y){if(!n){n=g.connect(c,k);setTimeout(function(){if(!w){if(!y){d={};g.updatePlugin(m)}p.reject(new Error("Load timeout for plugin: "+
c))}},15E3)}return p.promise};if(typeof c!=="string")throw new Error("invalid url:"+c);d&&j()};a.PluginRegistry=function(c,d,g){function h(s){if(s.indexOf("://")===-1){var u=document.createElement("a");u.href=s;return u.href}return s}function i(s){delete m["plugin."+s.getLocation()]}function j(s){s.getData()._expires=(new Date).getTime()+36E5;m["plugin."+s.getLocation()]=JSON.stringify(s.getData())}function k(s){s=h(s);for(var u=0,t=n.length;u<t;u++){var y=n[u];if(s===y.getLocation())return y}return null}
var m=d||localStorage||{},n=[],p=[],r=new e.EventTarget;addEventListener("message",function(s){for(var u=0,t=s.source;u<p.length;u++)if(t===p[u].target){if(typeof p[u].useStructuredClone==="undefined")p[u].useStructuredClone=typeof s.data!=="string";p[u].handler(p[u].useStructuredClone?s.data:JSON.parse(s.data));break}},false);var w={registerService:f.hitch(c,c.registerService),connect:function(s,u){var t=document.createElement("iframe");t.id=s;t.name=s;if(!g){t.style.display="none";t.style.visibility=
"hidden"}t.src=s;document.body.appendChild(t);s={iframe:t,target:t.contentWindow,handler:u,url:s};p.push(s);return s},disconnect:function(s){for(var u=0;u<p.length;u++)if(s===p[u]){p.splice(u,1);try{document.body.removeChild(s.iframe)}catch(t){}break}},uninstallPlugin:function(s){i(s);for(var u=0;u<n.length;u++)if(s===n[u]){n.splice(u,1);r.dispatchEvent("pluginRemoved",s);break}},updatePlugin:function(s){j(s);r.dispatchEvent("pluginUpdated",s)},postMessage:function(s,u){u.target.postMessage(u.useStructuredClone?
s:JSON.stringify(s),u.url)}};this.startup=function(s){for(var u=[],t=0;t<s.length;++t){var y=s[t];y=h(y);var B="plugin."+y,D=m[B]?JSON.parse(m[B]):null;if(D&&D._expires&&D._expires>(new Date).getTime()){if(k(y)===null){delete D._expires;n.push(new a.Plugin(y,D,w))}}else{m[B]="{}";y=new a.Plugin(y,{},w);n.push(y);u.push(y._load(false))}}return new f.DeferredList(u)};this.shutdown=function(){for(var s=0;s<p.length;s++)try{document.body.removeChild(p[s].iframe)}catch(u){}};this.installPlugin=function(s,
u){s=h(s);var t=new f.Deferred,y=k(s);if(y)if(y.getData())t.resolve(y);else{var B=function(D){if(D.getLocation()===s){t.resolve(D);r.removeEventListener("pluginAdded",B)}};r.addEventListener("pluginAdded",B)}else{y=new a.Plugin(s,u,w);n.push(y);if(y.getData()){j(y);r.dispatchEvent("pluginAdded",y);t.resolve(y)}else y._load(true).then(function(){j(y);r.dispatchEvent("pluginAdded",y);t.resolve(y)},function(D){t.reject(D)})}return t.promise};this.getPlugins=function(){for(var s=[],u=0;u<n.length;u++)n[u].getData()&&
s.push(n[u]);return s};this.getPlugin=function(s){if((s=k(s))&&s.getData())return s;return null};this.addEventListener=function(s,u){r.addEventListener(s,u)};this.removeEventListener=function(s,u){r.removeEventListener(s,u)}};return a});
define("orion/bootstrap",["require","dojo","orion/serviceregistry","orion/preferences","orion/pluginregistry"],function(f,e,a,c,d){function g(){var h=new a.ServiceRegistry,i=new c.PreferencesService(h),j=new d.PluginRegistry(h);return i.getPreferences("/plugins").then(function(k){k=k.keys();for(var m=0;m<k.length;++m)if(k[m].indexOf("://")===-1)k[m]=f.toUrl(k[m]);return j.startup(k)}).then(function(){if(h.getServiceReferences("orion.core.preference.provider").length>0)return i.getPreferences("/plugins",
i.USER_SCOPE).then(function(k){k=k.keys();for(var m=0;m<k.length;++m)if(k[m].indexOf("://")===-1)k[m]=f.toUrl(k[m]);return j.startup(k)})}).then(function(){e.addOnWindowUnload(function(){j.shutdown()})}).then(function(){return{serviceRegistry:h,preferences:i,pluginRegistry:j}})}return{startup:g}});
define("orion/status",["require","dojo","orion/util"],function(f,e,a){function c(d,g,h,i,j){this._serviceRegistry=d;this._serviceRegistration=d.registerService("orion.page.message",this);this._operationsClient=g;this.notificationContainerDomId=j;this.domId=h;this.progressDomId=i||h;this._hookedClose=false}c.prototype={_init:function(){var d=e.byId("closeNotifications");if(d&&!this._hookedClose){e.connect(d,"onclick",this,function(){this.setProgressMessage("");e.removeClass(this.notificationContainerDomId,
"slideContainerActive")});e.connect(d,"onkeypress",this,function(g){if(g.keyCode===e.keys.ENTER||g.keyCode===e.keys.SPACE){this.setProgressMessage("");e.removeClass(this.notificationContainerDomId,"slideContainerActive")}})}},setMessage:function(d,g){this._init();e.place(window.document.createTextNode(d),this.domId,"only");if(typeof g==="number"){var h=this;window.setTimeout(function(){var i=e.byId(h.domId);(typeof i.textContent==="string"?i.textContent:i.innerText)===d&&e.place(window.document.createTextNode(""),
h.domId,"only")},g)}},setErrorMessage:function(d){this._init();var g=d.responseText||d.message||d;try{g=JSON.parse(g)}catch(h){}d=g.Message||g;var i="red";if(g.Severity)switch(g.Severity){case "Warning":i="#FFCC00";break;case "Error":i="red";break;case "Info":case "Ok":i="green";break}g=e.create("span",{style:{color:i}});e.place(window.document.createTextNode(d),g);e.place(g,this.domId,"only")},setProgressMessage:function(d){this._init();var g=e.create("span",{"class":"imageSprite core-sprite-progress"});
e.place(g,this.progressDomId,"only");e.place(window.document.createTextNode(d),this.progressDomId,"last");e.addClass(this.notificationContainerDomId,"progressNormal");d.length>0?e.addClass(this.notificationContainerDomId,"slideContainerActive"):e.removeClass(this.notificationContainerDomId,"slideContainerActive");a.forceLayout(this.notificationContainerDomId)},setProgressResult:function(d){d=d.responseText||d;try{d=JSON.parse(d)}catch(g){}this._init();var h=d.Message||d,i="imageSprite core-sprite-info",
j="progressInfo",k="progressWarning progressError progressNormal";if(d.Severity)switch(d.Severity){case "Warning":i="imageSprite core-sprite-warning";j="progressWarning";k="progressInfo progressError progressNormal";break;case "Error":i="imageSprite core-sprite-error";j="progressError";k="progressWarning progressInfo progressNormal";break}i=e.create("span",{"class":i});e.place(i,this.progressDomId,"only");if(d.HTML)e.place(h,this.progressDomId,"last");else{e.place(window.document.createTextNode("   "+
h),this.progressDomId,"last");if(j&&this.progressDomId!==this.domId){e.addClass(this.notificationContainerDomId,j);e.removeClass(this.notificationContainerDomId,k)}}e.addClass(this.notificationContainerDomId,"slideContainerActive");a.forceLayout(this.notificationContainerDomId)},showWhile:function(d,g){var h=this;h.setProgressMessage(g);return d.then(function(i){if(i&&i.Location&&i.Message&&i.Running)return e.hitch(h,h._doProgressWhile)(i);h.setProgressMessage("");i&&i.Result&&h.setProgressResult(i.Result);
return i})},_doProgressWhile:function(d){var g=new e.Deferred,h=this;window.setTimeout(function(){h._operationsClient.getOperation(d.Location).then(function(i){g.callback(i)})},2E3);return this.showWhile(g,d.Message)}};c.prototype.constructor=c;return{StatusReportingService:c}});define("text!orion/widgets/templates/OperationsDialog.html",function(){return'\n<div>\n\t<div class="dijitTooltipContainer" role="presentation" style="padding: 0.5em; min-width: 300px;">\n\t\t<div class="dijitTooltipContents dijitTooltipFocusNode" role="dialog"\n\t\t\tdojoattachpoint="containerNode" style="padding: 0">\n\t\t\t<table style="width: 100%;">\n\t\t\t\t<tr>\n\t\t\t\t\t<td><h2>Recent operations</h2></td>\n\t\t\t\t\t<td style="text-align: right;"><a dojoAttachPoint="allOperationsLink">All Operations</a></td>\n\t\t\t\t</tr>\n\t\t\t</table>\n\t\t\t<span dojoAttachPoint="operationsExist">\n\t\t\t\t<span class="secondaryColumn" dojoAttachPoint="myOperationsListEmpty">No operations running on this page.</span>\n\t\t\t\t<table dojoAttachPoint="myOperationsList" style="display: none;">\n\t\t\t\t</table>\n\t\t\t\t<span class="secondaryColumn" dojoAttachPoint="otherOperations"><br>Operations from other pages:</span>\n\t\t\t\t<table dojoAttachPoint="operationsList" style="display: none;">\n\t\t\t\t</table>\n\t\t\t</span>\n\t\t\t<span class="secondaryColumn" dojoAttachPoint="operationsDontExist">No operations running.</span>\n\t\t</div>\n\t</div>\n\t<div class="dijitTooltipConnector" role="presentation"></div>\n\n</div>'});
define("orion/widgets/OperationsDialog",["require","dojo","dijit","orion/util","dijit/TooltipDialog","text!orion/widgets/templates/OperationsDialog.html"],function(f,e,a){e.declare("orion.widgets.OperationsDialog",[a.TooltipDialog],{widgetsInTemplate:true,closable:true,templateString:e.cache("orion","widgets/templates/OperationsDialog.html"),constructor:function(){this.inherited(arguments);this.options=arguments[0]||{};this._operations=[];this._myOperations=[]},postCreate:function(){this.inherited(arguments);
this.allOperationsLink.href=f.toUrl("operations/list.html");this._setOperationsVisibility()},setOperations:function(c,d){this._operations=[];d=d||{};this._myOperations=[];if(c.Children)for(var g=0;g<c.Children.length;g++)d[c.Children[g].Id]?this._myOperations.push(c.Children[g]):this._operations.push(c.Children[g]);this._operations.sort(function(h,i){return parseInt(i.Modified)-parseInt(h.Modified)});this._myOperations.sort(function(h,i){return parseInt(i.Modified)-parseInt(h.Modified)});this._renderOperations()},
parseProgressResult:function(c){if(!c)return{};c=c.responseText||c;try{c=JSON.parse(c)}catch(d){}var g={Message:c.Message||c,Severity:c.Severity};if(c.DetailedMessage&&c.DetailedMessage!==g.Message)g.DetailedMessage=c.DetailedMessage;return g},_renderOperations:function(){this._renderOperationsTable(this.myOperationsList,this._myOperations);this._renderOperationsTable(this.operationsList,this._operations)},_renderOperationsTable:function(c,d){e.empty(c);for(var g=0;g<d.length;g++){var h=d[g],i=e.create("tr"),
j=e.create("td",{style:"padding-left: 5px; padding-right: 5px",innerHTML:h.Name},i);j=e.create("div",null,j,"only");link=e.create("span",{innerHTML:h.Name,className:"primaryColumn"},j,"last");e.place(document.createTextNode(h.Name),link,"only");var k=e.create("span",null,j,"first");e.addClass(k,"imageSprite");var m=this.parseProgressResult(h.Result);switch(m.Severity){case "Warning":e.addClass(k,"core-sprite-warning");break;case "Error":e.addClass(k,"core-sprite-error");break;default:if(h.Running===
true)e.addClass(k,"core-sprite-start");else if(h.Canceled===true)e.addClass(k,"core-sprite-stop");else h.Failed===true?e.addClass(k,"core-sprite-error"):e.addClass(k,"core-sprite-ok")}if(m.Message||h.Message){h=m.Message||h.Message;if(m.DetailedMessage&&m.DetailedMessage!=="")h+=": "+m.DetailedMessage;e.create("br",null,j,"last");e.create("span",{className:"secondaryColumn",style:"margin-left: 18px;",innerHTML:h},j,"last")}e.place(i,c,"last")}this._setOperationsVisibility()},_setOperationsVisibility:function(){this.operationsList.style.display=
this._operations.length>0?"":"none";this.otherOperations.style.display=this._operations.length>0?"":"none";this.myOperationsList.style.display=this._myOperations.length>0?"":"none";this.myOperationsListEmpty.style.display=this._myOperations.length>0?"none":"";this.operationsDontExist.style.display=this._operations.length+this._myOperations.length>0?"none":"";this.operationsExist.style.display=this._operations.length+this._myOperations.length>0?"":"none"},_onBlur:function(){this.inherited(arguments);
a.popup.hide&&a.popup.hide(this);a.popup.close(this)}})});
define("orion/progress",["require","dojo","orion/globalCommands","orion/widgets/OperationsDialog"],function(f,e,a){function c(d,g){this._serviceRegistry=d;this._serviceRegistration=d.registerService("orion.page.progress",this);this._operationsClient=g;this._initDone=false;this._topicListeners={};this._myOperations={};this._lastIconClass=this._lastOperation=null}c.prototype={init:function(d){if(!this._progressPane){this._progressPane=e.byId(d);this._operationsDialog=new orion.widgets.OperationsDialog;
e.connect(this._progressPane,"onclick",e.hitch(this,this._openOperationsPopup));var g=this;if(new Date-this.getLastListUpdate()>3E5)this._operationsClient.getRunningOperations().then(function(h){e.hitch(g,g._loadOperationsList)(h);window.setTimeout(function(){e.hitch(g,g._checkOperationsChanges())},5E3)},function(h){console.error(h)});else{e.hitch(g,g._generateOperationsInfo(JSON.parse(localStorage.getItem("orionOperations")||'{"Children": []}')));window.setTimeout(function(){e.hitch(g,g._checkOperationsChanges())},
5E3)}window.addEventListener("storage",function(h){a.getAuthenticationIds().indexOf(h.key)>=0&&g._operationsClient.getRunningOperations().then(function(i){e.hitch(g,g._loadOperationsList)(i)},function(i){console.error(i)})},false);window.addEventListener("storage",function(h){if(h.key==="orionOperations")e.hitch(g,g._generateOperationsInfo(JSON.parse(localStorage.getItem("orionOperations")||'{"Children": []}')))})}},_loadOperationsList:function(d){d.lastClientDate=new Date;if(d.lastClientDate-this.getLastListUpdate()>
3E5){localStorage.setItem("orionOperations",JSON.stringify(d));this._generateOperationsInfo(d)}},getLastListUpdate:function(){var d=JSON.parse(localStorage.getItem("orionOperations")||'{"Children": []}');return d.lastClientDate?new Date(d.lastClientDate):new Date(0)},_markOperationAsFailed:function(d,g,h){d.Message="Operation status is unknown";d.Running=false;d.Failed=true;d.Result={HttpCode:h?h.xhr.staus:500,Severity:g,Message:g.Message?g.Message:g};this.writeOperation(d)},_checkOperationsChanges:function(){for(var d=
this,g=JSON.parse(localStorage.getItem("orionOperations")||'{"Children": []}'),h=[],i=[],j=0;j<g.Children.length;j++){var k=g.Children[j];if(k.Running==true&&new Date-new Date(k.lastClientDate?k.lastClientDate:0)>5E3){var m=this._operationsClient.getOperation(k.Location);i.push(m);e.hitch(this,function(n){m.then(function(p){p.lastClientDate=new Date;e.hitch(d,d.writeOperation)(p)},function(p,r){if(p.status==404){h.push(n);return p}e.hitch(d,d._markOperationAsFailed(g.Children[n],p,r))})})(j)}if(!k.Running&&
new Date-new Date(k.lastClientDate?k.lastClientDate:0)>3E5)h.push(j)}(new e.DeferredList(i)).addBoth(function(){if(h.length>0){g.lastClientDate=new Date;for(var n=h.length-1;n>=0;n--)g.Children.splice(h[n],1);localStorage.setItem("orionOperations",JSON.stringify(g));e.hitch(d,d._generateOperationsInfo)(g)}window.setTimeout(function(){e.hitch(d,d._checkOperationsChanges())},5E3)})},_openOperationsPopup:function(){try{dijit.popup.open({popup:this._operationsDialog,around:this._progressPane})}catch(d){}dijit.focus(this._operationsDialog.domNode)},
_switchIconTo:function(d){this._lastIconClass&&e.removeClass(this._progressPane,this._lastIconClass);this._lastIconClass=d;e.addClass(this._progressPane,this._lastIconClass)},_generateOperationsInfo:function(d){this._operationsDialog.setOperations(d,this._myOperations);if(!d.Children||d.Children.length==0){this._switchIconTo("progressPane_empty");this._progressPane.title="Operations"}else{for(var g="",h=0;h<d.Children.length;h++){var i=d.Children[h];if(this._myOperations[i.Id])if(i.Running==true){g=
"running";break}}if(g===""&&this._lastOperation!=null)if(this._lastOperation.Result)switch(this._operationsDialog.parseProgressResult(this._lastOperation.Result).Severity){case "Warning":if(g!=="error")g="warning";break;case "Error":g="error"}switch(g){case "running":this._progressPane.title="Operations running";this._switchIconTo("progressPane_running");break;case "warning":this._progressPane.title="Some operations finished with warning";this._switchIconTo("progressPane_warning");break;case "error":this._progressPane.title=
"Some operations finished with error";this._switchIconTo("progressPane_error");break;default:this._progressPane.title="Operations";this._switchIconTo("progressPane_operations")}}},followOperation:function(d,g,h){if(d.Id)this._myOperations[d.Id]=true;var i=g?g:new e.Deferred;this.writeOperation(d);var j=this;if(d&&d.Location&&d.Running==true)window.setTimeout(function(){j._operationsClient.getOperation(d.Location).then(function(k){e.hitch(j,j.followOperation(k,i,d.Location))},function(k,m){e.hitch(j,
j.setProgressResult)({Severity:"Error",Message:k});e.hitch(j,j._markOperationAsFailed(d,k,m));i.errback(k,m)})},2E3);else if(d&&d.Result){j._serviceRegistry.getService("orion.page.message").setProgressMessage("");g=this._operationsDialog.parseProgressResult(d.Result).Severity;if(g=="Error"||g=="Warning"){d.Result.failedOperation={Location:h,Id:d.Id,Name:d.Name};i.callback(d);setTimeout(function(){j._myOperations[d.Id]&&e.hitch(j,j._openOperationsPopup)()},10)}else i.callback(d);!d.Failed&&d.Idempotent==
true&&window.setTimeout(function(){e.hitch(j,j.removeOperation)(h,d.Id)},5E3)}return i},removeOperation:function(d,g){that=this;if(g){if(this._lastOperation!=null&&this._lastOperation.Id===g)this._lastOperation=null;delete this._myOperations[g]}e.hitch(that._operationsClient,that._operationsClient.removeOperation)(d).then(function(){e.hitch(that,that.removeOperationFromTheList)(g)})},removeOperationFromTheList:function(d){if(this._lastOperation!=null&&this._lastOperation.Id===d)this._lastOperation=
null;delete this._myOperations[d];for(var g=JSON.parse(localStorage.getItem("orionOperations")||'{"Children": []}'),h=0;h<g.Children.length;h++){var i=g.Children[h];if(i.Id&&i.Id===d){g.Children.splice(h,1);break}}localStorage.setItem("orionOperations",JSON.stringify(g));this._generateOperationsInfo(g)},removeCompletedOperations:function(){for(var d=JSON.parse(localStorage.getItem("orionOperations")||'{"Children": []}'),g=d.Children.length-1;g>=0;g--)d.Children[g].Running||d.Children.splice(g,1);
localStorage.setItem("orionOperations",JSON.stringify(d));this._generateOperationsInfo(d)},setProgressResult:function(d){this._serviceRegistry.getService("orion.page.message").setProgressResult(d)},showWhile:function(d,g){g&&this._serviceRegistry.getService("orion.page.message").setProgressMessage(g);var h=this;return d.then(function(i){if(i&&i.Location&&i.Message&&i.Running)return e.hitch(h,h.followOperation)(i,null,i.Location);h._serviceRegistry.getService("orion.page.message").setProgressMessage("");
return i},function(i){e.hitch(h,h.setProgressResult)(i);return i})},followTopic:function(d,g){this._topicListeners[d]||(this._topicListeners[d]=[]);this._topicListeners[d].push(g)},writeOperation:function(d){this._lastOperation=d=JSON.parse(JSON.stringify(d));for(var g=JSON.parse(localStorage.getItem("orionOperations")||'{"Children": []}'),h=0;h<g.Children.length;h++){var i=g.Children[h];if(i.Id&&i.Id===d.Id){g.Children.splice(h,1);break}}!d.Running&&!d.Failed&&delete d.Result;d.lastClientDate=new Date;
g.Children.push(d);g.lastClientDate=new Date;localStorage.setItem("orionOperations",JSON.stringify(g));this._generateOperationsInfo(g)}};c.prototype.constructor=c;return{ProgressService:c}});
define("orion/searchUtils",["require","dojo","orion/editor/regex"],function(f,e,a){var c=c||{};c.searchUtils=c.searchUtils||{};c.searchUtils.parseQueryStr=function(d){var g=d.indexOf("?"),h=d.indexOf("q=");if(g<h&&h>0)d=d.substring(g+1);g=d.split("&");d={queryStr:d,start:0,rows:10,sort:"Path asc",replace:null};for(h=0;h<g.length;h++){var i=g[h].indexOf("q="),j=g[h].indexOf("replace=");if(i>=0)c.searchUtils.parseLocationAndSearchStr(g[h].substring(i+2),d);else if(j>=0)d.replace=g[h].substring(j+8);
else{i=g[h].split("=");if(i.length===2)if(i[0]==="rows")d.rows=parseInt(i[1]);else if(i[0]==="start")d.start=parseInt(i[1]);else if(i[0]==="sort")d.sort=i[1]}}return d};c.searchUtils.copyQueryParams=function(d,g){return{sort:d.sort,rows:d.rows,start:d.start,searchStr:d.searchStr,location:d.location,replace:g?d.replace:null}};c.searchUtils.generateSearchHref=function(d){return f.toUrl("search/search.html")+"#"+c.searchUtils.generateSearchQuery(d)};c.searchUtils.generateSearchQuery=function(d){var g=
"Path asc",h=40,i=0,j="",k="",m="";if(d){if(d.sort)g=d.sort;if(d.rows)h=d.rows;if(d.start)i=d.start;if(d.searchStr){j=d.searchStr;j=j.split(" ").join("")}if(d.location){k=d.location;if(k.length>0&&k[k.length-1]!=="*")k+="*";if(k!=="")k="+Location:"+k}if(d.replace!==null&&d.replace!==undefined)m="&replace="+d.replace}return"?sort="+g+"&rows="+h+"&start="+i+"&q="+j+k+m};c.searchUtils.parseLocationAndSearchStr=function(d,g){var h=d.indexOf("+Location:")>-1;g.location="";g.searchStr=d;if(h){d=d.split("+Location:");
if(d.length===2){h=d[1];if(h.length>0&&h[h.length-1]==="*")h=h.substring(0,h.length-1);g.location=h;g.searchStr=d[0].split(" ").join("")}}g.searchStrTitle=g.searchStr.split("\\").join("");g.inFileQuery=c.searchUtils.generateInFileQuery(g.searchStr)};c.searchUtils.generateInFileQuery=function(d){var g={},h=d.indexOf("*")>-1,i=d.indexOf("?")>-1;if(h)d=d.split("*").join(".*");if(i)d=d.split("?").join(".");if(!h&&!i){g.searchStr=d.split("\\").join("").toLowerCase();g.wildCard=false}else{g.searchStr=d.toLowerCase();
if(h=a.parse("/"+g.searchStr+"/")){d=h.pattern;h=h.flags;h+=h.indexOf("i")===-1?"i":"";g.regExp={pattern:d,flags:h};g.wildCard=true}}g.searchStrLength=g.searchStr.length;return g};c.searchUtils.replaceRegEx=function(d,g,h){return d.replace(new RegExp(g.pattern,g.flags),h)};c.searchUtils.replaceStringLiteral=function(d,g,h){g=a.parse("/"+g+"/gim");return c.searchUtils.replaceRegEx(d,g,h)};c.searchUtils.searchOnelineLiteral=function(d,g,h){var i;i=0;for(var j=false,k=[];;){i=g.indexOf(d.searchStr,i);
if(i<0)break;else{k.push({startIndex:i});j=true;if(h)break;i=i+d.searchStrLength}}if(j)return k;return null};c.searchUtils.findRegExp=function(d,g,h,i){if(!g)return null;h=h||"";h+=(h.indexOf("g")===-1?"g":"")+(h.indexOf("m")===-1?"m":"");var j=null;return(j=(new RegExp(g,h)).exec(d.substring(i)))&&{startIndex:j.index+i,length:j[0].length}};c.searchUtils.searchOnelineRegEx=function(d,g,h){for(var i=0,j=false,k=[];;)if(i=c.searchUtils.findRegExp(g,d.regExp.pattern,d.regExp.flags,i)){k.push(i);j=true;
if(h)break;i=i.startIndex+i.length}else break;if(j)return k;return null};c.searchUtils.generateNewContents=function(d,g,h,i,j){if(h&&d){var k;k=g.length>0?true:false;for(var m=0;m<d.length;m++){for(var n=d[m],p=false,r=false,w=[],s,u=0,t=0;t<h.children.length;t++)if(h.children[t].lineNumber-1===m){u=t;for(p=0;p<h.children[t].matches.length;p++)h.children[t+p].checked!==false&&w.push(p);r=w.length>0;s=h.children[t].matches;p=true;break}if(p){if(r){w=c.searchUtils.replaceCheckedMatches(n,i,s,w,j);n=
w.replacedStr;for(p=0;p<h.children[u].matches.length;p++)h.children[u+p].newMatches=w.newMatches}else{n=n;for(p=0;p<h.children[u].matches.length;p++)h.children[u+p].newMatches=h.children[u+p].matches}if(k)g[m]=n;else g.push(n)}else k||g.push(n)}}};c.searchUtils.generateMatchContext=function(d,g,h){var i=[],j=d*2+1,k;if(g.length<=j){k=0;d=g.length-1}else{k=h-d;if(k<0){k=0;d=k+j-1}else{d=h+d;if(d>g.length-1){d=g.length-1;k=d-j+1}}}for(j=k;j<=d;j++)i.push({context:g[j],current:j===h});return i};c.searchUtils.searchWithinFile=
function(d,g,h,i,j){h=h.split(i);if(j)g.contents=h;if(g){g.children=[];for(var k=i=0;k<h.length;k++){var m=h[k];if(m&&m.length>0){var n=m.toLowerCase();if(n=d.wildCard?c.searchUtils.searchOnelineRegEx(d,n):c.searchUtils.searchOnelineLiteral(d,n)){var p=k+1;if(j)for(var r=0;r<n.length;r++){var w=r+1;w={parent:g,checked:g.checked,type:"detail",matches:n,lineNumber:p,matchNumber:w,name:m,location:g.location+"-"+p+"-"+w};g.children.push(w)}else{w={parent:g,context:c.searchUtils.generateMatchContext(2,
h,k),checked:g.checked,type:"detail",matches:n,lineNumber:p,name:m,linkLocation:g.linkLocation+",line="+p,location:g.location+"-"+p};g.children.push(w)}i+=n.length}}}g.totalMatches=i}};c.searchUtils.replaceCheckedMatches=function(d,g,h,i,j){j=j;for(var k=0,m="",n=[],p=0;p<h.length;p++){if(k!==h[p].startIndex)m+=d.substring(k,h[p].startIndex);if(h[p].length)j=h[p].length;k=false;for(var r=0;r<i.length;r++)if(i[r]===p){k=true;break}if(k){n.push({startIndex:m.length,length:g.length});m+=g}else{n.push({startIndex:m.length,
length:j});m+=d.substring(h[p].startIndex,h[p].startIndex+j)}k=h[p].startIndex+j}if(k<d.length-1)m+=d.substring(k);return{replacedStr:m,newMatches:n}};c.searchUtils.fullPathNameByMeta=function(d){var g=d.length,h="";if(g>0)for(g=g-1;g>-1;g--)h=h+(h===""?"":"/")+d[g].Name;return h};c.searchUtils.path2FolderName=function(d,g,h){return d.substring(0,d.length-g.length-(h?0:1))};return c.searchUtils});
define("dijit/layout/BorderContainer",["dojo","dijit","dijit/layout/_LayoutWidget","dojo/cookie","dijit/_Templated"],function(f,e){f.declare("dijit.layout.BorderContainer",e.layout._LayoutWidget,{design:"headline",gutters:true,liveSplitters:true,persist:false,baseClass:"dijitBorderContainer",_splitterClass:"dijit.layout._Splitter",postMixInProperties:function(){this.gutters||(this.baseClass+="NoGutter");this.inherited(arguments)},startup:function(){if(!this._started){f.forEach(this.getChildren(),
this._setupChild,this);this.inherited(arguments)}},_setupChild:function(a){var c=a.region;if(c){this.inherited(arguments);f.addClass(a.domNode,this.baseClass+"Pane");var d=this.isLeftToRight();if(c=="leading")c=d?"left":"right";if(c=="trailing")c=d?"right":"left";if(c!="center"&&(a.splitter||this.gutters)&&!a._splitterWidget){var g=f.getObject(a.splitter?this._splitterClass:"dijit.layout._Gutter");d=new g({id:a.id+"_splitter",container:this,child:a,region:c,live:this.liveSplitters});d.isSplitter=
true;a._splitterWidget=d;f.place(d.domNode,a.domNode,"after");d.startup()}a.region=c}},layout:function(){this._layoutChildren()},addChild:function(){this.inherited(arguments);this._started&&this.layout()},removeChild:function(a){var c=a.region,d=a._splitterWidget;if(d){d.destroy();delete a._splitterWidget}this.inherited(arguments);this._started&&this._layoutChildren();f.removeClass(a.domNode,this.baseClass+"Pane");f.style(a.domNode,{top:"auto",bottom:"auto",left:"auto",right:"auto",position:"static"});
f.style(a.domNode,c=="top"||c=="bottom"?"width":"height","auto")},getChildren:function(){return f.filter(this.inherited(arguments),function(a){return!a.isSplitter})},getSplitter:function(a){return f.filter(this.getChildren(),function(c){return c.region==a})[0]._splitterWidget},resize:function(){if(!this.cs||!this.pe){var a=this.domNode;this.cs=f.getComputedStyle(a);this.pe=f._getPadExtents(a,this.cs);this.pe.r=f._toPixelValue(a,this.cs.paddingRight);this.pe.b=f._toPixelValue(a,this.cs.paddingBottom);
f.style(a,"padding","0px")}this.inherited(arguments)},_layoutChildren:function(a,c){if(this._borderBox&&this._borderBox.h){var d=f.map(this.getChildren(),function(h,i){return{pane:h,weight:[h.region=="center"?Infinity:0,h.layoutPriority,(this.design=="sidebar"?1:-1)*(/top|bottom/.test(h.region)?1:-1),i]}},this);d.sort(function(h,i){h=h.weight;i=i.weight;for(var j=0;j<h.length;j++)if(h[j]!=i[j])return h[j]-i[j];return 0});var g=[];f.forEach(d,function(h){h=h.pane;g.push(h);h._splitterWidget&&g.push(h._splitterWidget)});
e.layout.layoutChildren(this.domNode,{l:this.pe.l,t:this.pe.t,w:this._borderBox.w-this.pe.w,h:this._borderBox.h-this.pe.h},g,a,c)}},destroyRecursive:function(){f.forEach(this.getChildren(),function(a){var c=a._splitterWidget;c&&c.destroy();delete a._splitterWidget});this.inherited(arguments)}});f.extend(e._Widget,{region:"",layoutPriority:0,splitter:false,minSize:0,maxSize:Infinity});f.declare("dijit.layout._Splitter",[e._Widget,e._Templated],{live:true,templateString:'<div class="dijitSplitter" dojoAttachEvent="onkeypress:_onKeyPress,onmousedown:_startDrag,onmouseenter:_onMouse,onmouseleave:_onMouse" tabIndex="0" role="separator"><div class="dijitSplitterThumb"></div></div>',
postMixInProperties:function(){this.inherited(arguments);this.horizontal=/top|bottom/.test(this.region);this._factor=/top|left/.test(this.region)?1:-1;this._cookieName=this.container.id+"_"+this.region},buildRendering:function(){this.inherited(arguments);f.addClass(this.domNode,"dijitSplitter"+(this.horizontal?"H":"V"));if(this.container.persist){var a=f.cookie(this._cookieName);if(a)this.child.domNode.style[this.horizontal?"height":"width"]=a}},_computeMaxSize:function(){var a=this.horizontal?"h":
"w",c=f.marginBox(this.child.domNode)[a],d=f.filter(this.container.getChildren(),function(g){return g.region=="center"})[0];a=f.marginBox(d.domNode)[a];return Math.min(this.child.maxSize,c+a)},_startDrag:function(a){if(!this.cover){this.cover=f.doc.createElement("div");f.addClass(this.cover,"dijitSplitterCover");f.place(this.cover,this.child.domNode,"after")}f.addClass(this.cover,"dijitSplitterCoverActive");this.fake&&f.destroy(this.fake);if(!(this._resize=this.live)){(this.fake=this.domNode.cloneNode(true)).removeAttribute("id");
f.addClass(this.domNode,"dijitSplitterShadow");f.place(this.fake,this.domNode,"after")}f.addClass(this.domNode,"dijitSplitterActive dijitSplitter"+(this.horizontal?"H":"V")+"Active");if(this.fake)f.removeClass(this.fake,"dijitSplitterHover dijitSplitter"+(this.horizontal?"H":"V")+"Hover");var c=this._factor,d=this.horizontal,g=d?"pageY":"pageX",h=a[g],i=this.domNode.style;d=d?"h":"w";var j=f.marginBox(this.child.domNode)[d],k=this._computeMaxSize(),m=this.child.minSize||20;d=this.region;var n=d==
"top"||d=="bottom"?"top":"left",p=parseInt(i[n],10),r=this._resize,w=f.hitch(this.container,"_layoutChildren",this.child.id);d=f.doc;this._handlers=(this._handlers||[]).concat([f.connect(d,"onmousemove",this._drag=function(s,u){s=s[g]-h;var t=c*s+j,y=Math.max(Math.min(t,k),m);if(r||u)w(y);i[n]=s+p+c*(y-t)+"px"}),f.connect(d,"ondragstart",f.stopEvent),f.connect(f.body(),"onselectstart",f.stopEvent),f.connect(d,"onmouseup",this,"_stopDrag")]);f.stopEvent(a)},_onMouse:function(a){a=a.type=="mouseover"||
a.type=="mouseenter";f.toggleClass(this.domNode,"dijitSplitterHover",a);f.toggleClass(this.domNode,"dijitSplitter"+(this.horizontal?"H":"V")+"Hover",a)},_stopDrag:function(a){try{this.cover&&f.removeClass(this.cover,"dijitSplitterCoverActive");this.fake&&f.destroy(this.fake);f.removeClass(this.domNode,"dijitSplitterActive dijitSplitter"+(this.horizontal?"H":"V")+"Active dijitSplitterShadow");this._drag(a);this._drag(a,true)}finally{this._cleanupHandlers();delete this._drag}if(this.container.persist)f.cookie(this._cookieName,
this.child.domNode.style[this.horizontal?"height":"width"],{expires:365})},_cleanupHandlers:function(){f.forEach(this._handlers,f.disconnect);delete this._handlers},_onKeyPress:function(a){this._resize=true;var c=this.horizontal,d=1,g=f.keys;switch(a.charOrCode){case c?g.UP_ARROW:g.LEFT_ARROW:d*=-1;case c?g.DOWN_ARROW:g.RIGHT_ARROW:break;default:return}c=f._getMarginSize(this.child.domNode)[c?"h":"w"]+this._factor*d;this.container._layoutChildren(this.child.id,Math.max(Math.min(c,this._computeMaxSize()),
this.child.minSize));f.stopEvent(a)},destroy:function(){this._cleanupHandlers();delete this.child;delete this.container;delete this.cover;delete this.fake;this.inherited(arguments)}});f.declare("dijit.layout._Gutter",[e._Widget,e._Templated],{templateString:'<div class="dijitGutter" role="presentation"></div>',postMixInProperties:function(){this.inherited(arguments);this.horizontal=/top|bottom/.test(this.region)},buildRendering:function(){this.inherited(arguments);f.addClass(this.domNode,"dijitGutter"+
(this.horizontal?"H":"V"))}});return e.layout.BorderContainer});
define("orion/searchClient",["require","dojo","dijit","orion/auth","orion/util","orion/searchUtils","dijit/form/Button","dijit/layout/BorderContainer","dijit/layout/ContentPane"],function(f,e,a,c,d,g){function h(i){this.registry=i.serviceRegistry;this._commandService=i.commandService;(this._fileService=i.fileService)||console.error("No file service on search client")}h.prototype={search:function(i,j,k){j=g.parseQueryStr(i);try{this._fileService.search(j.location,i).then(function(n){var p=n.responseHeader.params.q;
p=p.substring(p.indexOf("}")+1);k(function(r){for(var w=[],s=0;s<r.response.docs.length;s++){var u=r.response.docs[s];w.push({name:u.Name,path:u.Location,folderName:g.path2FolderName(u.Path,u.Name),directory:u.Directory,lineNumber:u.LineNumber})}return w}(n),p)})}catch(m){this.registry.getService("orion.page.message").setErrorMessage(m)}},handleError:function(i,j){console.error(i);var k=document.createTextNode(i);e.place(k,j,"only");return i},setLocationByMetaData:function(i,j){var k="",m=null;if(j&&
i&&i.Parents&&i.Parents.length>0)m=j.index==="last"?i.Parents[i.Parents.length-1]:i.Parents[0];else if(i&&i.Directory&&i.Location&&i.Parents)m=i;if(m){this.setLocationByURL(m.Location);k=m.Name}else if(i)k=this._fileService.fileServiceName(i&&i.Location);if((i=e.byId("search"))&&i.placeholder)i.placeholder=k.length>23?"Search "+k.substring(0,20)+"...":"Search "+k;if(i&&i.title)i.title="Type a keyword or wild card to search in "+k},setLocationByURL:function(i){this.location=i},createSearchQuery:function(i,
j,k,m){k||(k="Path");k+=" asc";if(j){i=/\*$/.test(j)?"":"*";return g.generateSearchQuery({sort:k,rows:100,start:0,searchStr:"Name:"+this._luceneEscape(j,true)+i})}return g.generateSearchQuery({sort:k,rows:40,start:0,searchStr:this._luceneEscape(i,true),location:m?"":this.location})},_luceneEscape:function(i,j){var k="";j='+-&|!(){}[]^"~:\\'+(!j?"*?":"");for(var m=0;m<i.length;m++){var n=i.charAt(m);if(j.indexOf(n)>=0)k+="\\";k+=n}return k},defaultRenderer:{makeRenderFunction:function(i,j,k,m){function n(p,
r){var w=function(){function o(x,z){x.appendChild(document.createTextNode(" - "+(z.folderName?z.folderName:z.path)+" "))}function q(x,z){var C=z.name;if(v.hasOwnProperty(C)){o(x,z);var A=v[C];if(typeof A==="function"){v[C]=null;A()}}else v[C]=function(){o(x,z)}}var v={};return q}(),s=false;e.empty(i);if(p&&p.length>0){for(var u=document.createElement("table"),t=0;t<p.length;t++){var y=p[t],B;if(!s){s=true;if(j){B=u.insertRow(0).insertCell(0);B.innerHTML=j}}B=u.insertRow(-1).insertCell(0);B.colspan=
2;m&&m(B);var D=document.createElement("a");e.place(document.createTextNode(y.name),D);y.LineNumber&&e.place(document.createTextNode(" (Line "+y.LineNumber+")"),D);var l=y.location;if(y.isExternalResource)l=y.path;else{l=y.directory?f.toUrl("navigate/table.html")+"#"+y.path:f.toUrl("edit/edit.html")+"#"+y.path;if(l==="#")l=""}D.setAttribute("href",l);e.style(D,"verticalAlign","middle");B.appendChild(D);w(B,y)}e.place(u,i,"last");typeof k==="function"&&k(i)}if(!s)if(r){p=e.place("<div>No matches found for </div>",
i,"only");p=e.create("b",null,p,"last");e.place(document.createTextNode(r),p,"only");typeof k==="function"&&k(i)}}return n}}};h.prototype.constructor=h;return{Searcher:h}});
define("orion/fileClient",["dojo","orion/auth","dojo/DeferredList"],function(f,e){function a(g,h,i){if(!g[h])throw h+" is not supportted in this file system";var j=new f.Deferred;g[h].apply(g,i).then(function(k){j.callback(k)},function(k){k.status===401?e.handleAuthenticationError(k,function(){g[h].apply(g,i).then(function(m){j.callback(m)},function(m){j.errback(m)})}):j.errback(k)});return j}function c(g,h,i,j){if(!g.readBlob)throw"source file service does not support binary read";if(!i.writeBlob)throw"target file service does not support binary write";
if(h[h.length-1]!=="/")return a(g,"readBlob",[h]).then(function(n){return a(i,"writeBlob",[j,n])});var k=j.substring(0,j.length-1),m=decodeURIComponent(k.substring(k.lastIndexOf("/")+1));k=k.substring(0,k.lastIndexOf("/")+1);return a(i,"createFolder",[k,m]).then(function(){},function(){}).then(function(){if(h.indexOf("/")===0)h+="?depth=1";return a(g,"fetchChildren",[h]).then(function(n){for(var p=[],r=0;r<n.length;++r){var w=n[r].Location,s=w;if(n[r].Directory)s=w.substring(0,w.length-1);s=decodeURIComponent(s.substring(s.lastIndexOf("/")+
1));s=j+encodeURIComponent(s);if(n[r].Directory)s+="/";p[r]=c(g,w,i,s)}return new f.DeferredList(p)})})}function d(g,h){function i(u){var t=new f.Deferred;t.reject("No Matching FileService for location:"+u);return t}var j=g.getServiceReferences("orion.core.file"),k=j;if(h){k=[];for(var m=0;m<j.length;++m)h(j[m])&&k.push(j[m])}var n=[],p=[],r=[],w=[],s={fetchChildren:function(){var u=new f.Deferred;u.resolve(w);return u},createWorkspace:function(){var u=new f.Deferred;u.reject("no file service");return u},
loadWorkspaces:function(){var u=new f.Deferred;u.reject("no file service");return u},loadWorkspace:function(){var u=new f.Deferred;window.setTimeout(function(){u.resolve({Directory:true,Length:0,LocalTimeStamp:0,Name:"File Servers",Location:"/",Children:w,ChildrenLocation:"/"})},100);return u},search:i,createProject:i,createFolder:i,createFile:i,deleteFile:i,moveFile:i,copyFile:i,read:i,write:i};for(h=0;h<k.length;++h){w[h]={Directory:true,Length:0,LocalTimeStamp:0,Location:k[h].getProperty("top"),
ChildrenLocation:k[h].getProperty("top"),Name:k[h].getProperty("Name")};j=k[h].getProperty("pattern")||".*";if(j[0]!=="^")j="^"+j;n[h]=new RegExp(j);p[h]=g.getService(k[h]);r[h]=k[h].getProperty("Name")}this._getServiceIndex=function(u){if(u==="/")return-1;else if(!u||u.length&&u.length===0)return 0;for(var t=0;t<n.length;++t)if(n[t].test(u))return t;throw"No Matching FileService for location:"+u;};this._getService=function(u){u=this._getServiceIndex(u);return u===-1?s:p[u]};this._getServiceName=
function(u){u=this._getServiceIndex(u);return u===-1?s.Name:r[u]}}d.prototype={fileServiceName:function(g){return this._getServiceName(g)},fetchChildren:function(g){return a(this._getService(g),"fetchChildren",arguments)},createWorkspace:function(){return a(this._getService(),"createWorkspace",arguments)},loadWorkspaces:function(){return a(this._getService(),"loadWorkspaces",arguments)},loadWorkspace:function(g){return a(this._getService(g),"loadWorkspace",arguments)},createProject:function(g){return a(this._getService(g),
"createProject",arguments)},createFolder:function(g){return a(this._getService(g),"createFolder",arguments)},createFile:function(g){return a(this._getService(g),"createFile",arguments)},deleteFile:function(g){return a(this._getService(g),"deleteFile",arguments)},moveFile:function(g,h,i){var j=this._getService(g),k=this._getService(h);if(j===k)return a(j,"moveFile",arguments);var m=g[g.length-1]==="/",n=h;if(n[n.length-1]!=="/")n+="/";if(i)n+=encodeURIComponent(i);else{var p=g;if(m)p=p.substring(0,
p.length-1);n+=p.substring(p.lastIndexOf("/")+1)}if(m&&n[n.length-1]!=="/")n+="/";return c(j,g,k,n).then(function(){return a(j,"deleteFile",[g])})},copyFile:function(g,h){var i=this._getService(g),j=this._getService(h);if(i===j)return a(i,"copyFile",arguments);var k=g[g.length-1]==="/",m=h;if(m[m.length-1]!=="/")m+="/";var n=g;if(k)n=n.substring(0,n.length-1);m+=n.substring(n.lastIndexOf("/")+1);if(k&&m[m.length-1]!=="/")m+="/";return c(i,g,j,m)},read:function(g){return a(this._getService(g),"read",
arguments)},write:function(g){return a(this._getService(g),"write",arguments)},remoteImport:function(g){return a(this._getService(g),"remoteImport",arguments)},remoteExport:function(g){return a(this._getService(g),"remoteExport",arguments)},search:function(g){return a(this._getService(g),"search",arguments)}};d.prototype.constructor=d;return{FileClient:d}});
define("orion/operationsClient",["dojo","orion/auth","dojo/DeferredList"],function(f,e){function a(m,n,p){var r=new f.Deferred;m[n].apply(m,p).then(function(w){r.callback(w)},function(w){w.status===401?e.handleAuthenticationError(w,function(){m[n].apply(m,p).then(function(s){r.callback(s)},function(s){r.errback(s)})}):r.errback(w)});return r}function c(m,n){return a(m,"getOperations",[n])}function d(m){this._location=m}function g(){var m=new f.Deferred;m.errback("No Matching OperationService for location:"+
this._location);return m}function h(m){this._services=[];this._patterns=[];this._operationListeners=[];this._currentLongpollingIds=[];for(var n=m.getServiceReferences("orion.core.operation"),p=0;p<n.length;p++){var r=m.getService(n[p]);this._services[p]=r;r=n[p].getProperty("pattern")||".*";if(r[0]!=="^")r="^"+r;this._patterns[p]=new RegExp(r)}this._getService=function(w){if(!w)return this._services[0];for(var s=0;s<this._patterns.length;++s)if(this._patterns[s].test(w))return this._services[s];return new d(w)}}
function i(m){if(m.length===1){if(m[0][0])return m[0][1];console.error(m[0][1]);return{Children:[]}}for(var n={Children:[]},p=0;p<m.length;p++)if(m[p][0]){if(m[p][1]&&m[p][1].Children)n.Children=n.Children.concat(m[p][1].Children)}else console.error(m[p][1]);return n}function j(m,n,p){var r=this,w={Longpolling:true};if(p)w.LongpollingId=p;a(m,"getOperations",[w]).then(function(s){if(!(p&&r._currentLongpollingIds.indexOf(p)<0)){n(s,p);if(s.LongpollingId){r._currentLongpollingIds.push(s.LongpollingId);
f.hitch(r,j)(m,n,s.LongpollingId)}else f.hitch(r,j)(m,n,p)}},function(s){p&&r._currentLongpollingIds.indexOf(p)<0||("timeout"===s.dojoType?f.hitch(r,j)(m,n,p):setTimeout(function(){f.hitch(r,j)(m,n,p)},2E3))})}function k(m){for(var n=0;n<this._operationListeners.length;n++)this._operationListeners[n](m)}d.prototype={getOperation:g,getOperations:g,removeCompletedOperations:g,removeOperation:g,cancelOperation:g};d.prototype.constructor=d;h.prototype={getOperations:function(){var m=new f.Deferred,n=
[];if(this._services.length<1){m.errback("No operations services registered.");return m}for(var p=0;p<this._services.length;p++)n[p]=c(this._services[p]);(new f.DeferredList(n)).then(function(r){m.resolve(i(r))});return m},getRunningOperations:function(){var m=new f.Deferred,n=[];if(this._services.length<1){m.errback("No operations services registered.");return m}for(var p=0;p<this._services.length;p++)n[p]=c(this._services[p],{RunningOnly:true});(new f.DeferredList(n)).then(function(r){m.resolve(i(r))});
return m},getOperation:function(m){return a(this._getService(m),"getOperation",arguments)},removeCompletedOperations:function(){var m=[];if(this._services.length<1){result.errback("No operations services registered.");return result}for(var n=0;n<this._services.length;n++)m[n]=a(this._services[n],"removeCompletedOperations");return new f.DeferredList(m)},removeOperation:function(m){return a(this._getService(m),"removeOperation",arguments)},cancelOperation:function(m){return a(this._getService(m),"cancelOperation",
arguments)},addOperationChangeListener:function(m){this._operationListeners.push(m);if(this._operationListeners.length===1){if(this._services.length<1)throw"No operations services registered.";for(m=0;m<this._services.length;m++)f.hitch(this,j)(this._services[m],f.hitch(this,k))}},removeOperationChangeListener:function(m){for(var n=0;n<this._operationListeners.length;n++)if(this._operationListeners[n]===m){this._operationListeners.splice(n,1);break}if(this._operationListeners.length===0)this._currentLongpollingIds=
[]},resetChangeListeners:function(){this._currentLongpollingIds=[];if(this._services.length<1)throw"No operations services registered.";for(var m=0;m<this._services.length;m++)f.hitch(this,j)(this._services[m],f.hitch(this,k))}};h.prototype.constructor=h;return{OperationsClient:h}});
define("orion/git/gitClient",["require","dojo","orion/auth"],function(f,e,a){var c=c||{};c.GitService=function(){function d(g){if(g){this._serviceRegistry=g;this._serviceRegistration=g.registerService("orion.git.provider",this);this._sshService=g.getService("orion.net.ssh")}}d.prototype={checkGitService:function(){},cloneGitRepository:function(g,h,i,j,k,m,n,p,r){var w=this,s={};if(g)s.Name=g;if(i)s.Path=i;if(h)s.GitUrl=h;s.Location=j;if(k)s.GitSshUsername=k;if(m)s.GitSshPassword=m;if(n)s.GitSshKnownHost=
n;if(p)s.GitSshPrivateKey=p;if(r)s.GitSshPassphrase=r;i=f.toUrl("gitapi/clone/._");i=i.substring(0,i.length-2);var u=new e.Deferred;e.xhrPost({url:i,headers:{"Orion-Version":"1"},postData:e.toJson(s),handleAs:"json",timeout:15E3,load:function(t,y){e.hitch(w,w._getGitServiceResponse)(u,t,y,h?"Cloning repository: "+h:"Initializing repository: "+g)},error:function(t,y){return e.hitch(w,w._handleGitServiceResponseError)(u,this,t,y)}});return u},removeGitRepository:function(g){var h=this,i=new e.Deferred;
e.xhrDelete({url:g,headers:{"Orion-Version":"1"},handleAs:"json",timeout:5E3,load:function(j,k){e.hitch(h,h._getGitServiceResponse)(i,j,k,"Removing repository")},error:function(j,k){return e.hitch(h,h._handleGitServiceResponseError)(i,this,j,k)}});return i},getDiffContent:function(g,h,i){var j=this,k=new e.Deferred;e.xhrGet({url:g,headers:{"Orion-Version":"1"},content:{parts:"diff"},handleAs:"text",timeout:15E3,load:function(m,n){e.hitch(j,j._getGitServiceResponse)(k,m,n,"Getting git diff",h,i)},
error:function(m,n){return e.hitch(j,j._handleGitServiceResponseError)(k,this,m,n,h,i,e.xhrGet)}});return k},getDiffFileURI:function(g,h,i){var j=new e.Deferred;e.xhrGet({url:g,headers:{"Orion-Version":"1"},content:{parts:"uris"},handleAs:"json",timeout:15E3,load:function(k,m){e.hitch(service,service._getGitServiceResponse)(j,k,m,"Getting git diff",h,i)},error:function(k,m){e.hitch(service,service._handleGitServiceResponseError)(j,this,k,m,h,i,e.xhrGet)}});return j},getGitStatus:function(g,h,i){var j=
this,k=new e.Deferred;e.xhrGet({url:g,headers:{"Orion-Version":"1"},handleAs:"json",timeout:15E3,load:function(m,n){e.hitch(j,j._getGitServiceResponse)(k,m,n,"Getting git status",h,i)},error:function(m,n){e.hitch(j,j._handleGitServiceResponseError)(k,this,m,n,h,i,e.xhrGet)}});return k},stage:function(g,h,i){var j=this,k=new e.Deferred;e.xhrPut({url:g,headers:{"Orion-Version":"1"},handleAs:"json",timeout:15E3,load:function(m,n){e.hitch(j,j._getGitServiceResponse)(k,m,n,"Staging",h,i)},error:function(m,
n){e.hitch(j,j._handleGitServiceResponseError)(k,this,m,n,h,i)}});return k},stageMultipleFiles:function(g,h,i,j){var k=this,m=new e.Deferred;e.xhrPut({url:g,headers:{"Orion-Version":"1"},putData:e.toJson({Path:h}),handleAs:"json",timeout:15E3,load:function(n,p){e.hitch(k,k._getGitServiceResponse)(m,n,p,"Staging",i,j)},error:function(n,p){e.hitch(k,k._handleGitServiceResponseError)(m,this,n,p,i,j)}});return m},unstageAll:function(g,h,i,j){var k=this,m=new e.Deferred;e.xhrPost({url:g,headers:{"Orion-Version":"1"},
handleAs:"json",timeout:15E3,postData:e.toJson({Reset:h}),load:function(n,p){e.hitch(k,k._getGitServiceResponse)(m,n,p,"Unstaging",i,j)},error:function(n,p){e.hitch(k,k._handleGitServiceResponseError)(m,this,n,p,i,j)}});return m},unstage:function(g,h,i,j){var k=this,m=new e.Deferred;e.xhrPost({url:g,headers:{"Orion-Version":"1"},handleAs:"json",timeout:15E3,postData:e.toJson({Path:h}),load:function(n,p){e.hitch(k,k._getGitServiceResponse)(m,n,p,"Unstaging",i,j)},error:function(n,p){e.hitch(k,k._handleGitServiceResponseError)(m,
this,n,p,i,j)}});return m},checkoutPath:function(g,h,i,j){var k=this,m=new e.Deferred;e.xhrPut({url:g,headers:{"Orion-Version":"1"},putData:e.toJson({Path:h,RemoveUntracked:"true"}),handleAs:"json",timeout:15E3,load:function(n,p){e.hitch(k,k._getGitServiceResponse)(m,n,p,"Checking out",i,j)},error:function(n,p){return e.hitch(k,k._handleGitServiceResponseError)(m,this,n,p,i,j)}});return m},commitAll:function(g,h,i,j,k){var m=this,n=new e.Deferred;e.xhrPost({url:g,headers:{"Orion-Version":"1"},handleAs:"json",
timeout:15E3,postData:i,load:function(p,r){e.hitch(m,m._getGitServiceResponse)(n,p,r,"Committing",j,k)},error:function(p,r){e.hitch(m,m._handleGitServiceResponseError)(n,this,p,r,j,k)}});return n},getGitClone:function(g,h,i){var j=this,k=new e.Deferred;e.xhrGet({url:g,headers:{"Orion-Version":"1"},handleAs:"json",timeout:5E3,load:function(m,n){e.hitch(j,j._getGitServiceResponse)(k,m,n,"Getting git repository information",h)},error:function(m,n){e.hitch(j,j._handleGitServiceResponseError)(k,this,m,
n,h,i,e.xhrGet)}});return k},getGitCloneConfig:function(g){var h=this,i=new e.Deferred;e.xhrGet({url:g,headers:{"Orion-Version":"1"},handleAs:"json",timeout:5E3,load:function(j,k){e.hitch(h,h._getGitServiceResponse)(i,j,k,"Getting git repository configuration")},error:function(j,k){e.hitch(h,h._handleGitServiceResponseError)(i,this,j,k,null,null,e.xhrGet)}});return i},getGitBranch:function(g){var h=this,i=new e.Deferred;e.xhrGet({url:g,headers:{"Orion-Version":"1"},handleAs:"json",timeout:5E3,load:function(j,
k){e.hitch(h,h._getGitServiceResponse)(i,j,k,"Getting branch information")},error:function(j,k){e.hitch(h,h._handleGitServiceResponseError)(i,this,j,k,null,null,e.xhrGet)}});return i},getGitRemote:function(g){var h=this,i=new e.Deferred;e.xhrGet({url:g,headers:{"Orion-Version":"1"},handleAs:"json",timeout:5E3,load:function(j,k){e.hitch(h,h._getGitServiceResponse)(i,j,k,"Getting remote branch information")},error:function(j,k){e.hitch(h,h._handleGitServiceResponseError)(i,this,j,k,null,null,e.xhrGet)}});
return i},checkoutBranch:function(g,h){var i=this,j=new e.Deferred;e.xhrPut({url:g,headers:{"Orion-Version":"1"},putData:e.toJson({Branch:h}),handleAs:"json",timeout:5E3,load:function(k,m){e.hitch(i,i._getGitServiceResponse)(j,k,m,h?"Checking out branch "+h:"Checking out branch")},error:function(k,m){e.hitch(i,i._handleGitServiceResponseError)(j,this,k,m)}});return j},resetIndex:function(g,h){var i=this,j=new e.Deferred;e.xhrPost({url:g,headers:{"Orion-Version":"1"},postData:e.toJson({Commit:h,Reset:"HARD"}),
handleAs:"json",timeout:5E3,load:function(k,m){e.hitch(i,i._getGitServiceResponse)(j,k,m,"Resetting index")},error:function(k,m){e.hitch(i,i._handleGitServiceResponseError)(j,this,k,m)}});return j},addBranch:function(g,h,i){var j=this,k={};if(h)k.Name=h;if(i)k.Branch=i;var m=new e.Deferred;e.xhrPost({url:g,headers:{"Orion-Version":"1"},postData:e.toJson(k),handleAs:"json",timeout:5E3,load:function(n,p){e.hitch(j,j._getGitServiceResponse)(m,n,p,h?"Adding branch "+h:"Adding branch")},error:function(n,
p){e.hitch(j,j._handleGitServiceResponseError)(m,this,n,p)}});return m},removeBranch:function(g){var h=this,i=new e.Deferred;e.xhrDelete({url:g,headers:{"Orion-Version":"1"},handleAs:"json",timeout:5E3,load:function(j,k){e.hitch(h,h._getGitServiceResponse)(i,j,k,"Removing branch")},error:function(j,k){e.hitch(h,h._handleGitServiceResponseError)(i,this,j,k)}});return i},addRemote:function(g,h,i){var j=this,k=new e.Deferred;e.xhrPost({url:g,headers:{"Orion-Version":"1"},putData:e.toJson({Remote:h,RemoteURI:i}),
handleAs:"json",timeout:5E3,load:function(m,n){e.hitch(j,j._getGitServiceResponse)(k,m,n,h?"Adding remote "+h:"Adding remote")},error:function(m,n){e.hitch(j,j._handleGitServiceResponseError)(k,this,m,n)}});return k},removeRemote:function(g){var h=this,i=new e.Deferred;e.xhrDelete({url:g,headers:{"Orion-Version":"1"},handleAs:"json",timeout:5E3,load:function(j,k){e.hitch(h,h._getGitServiceResponse)(i,j,k,"Removing remote")},error:function(j,k){e.hitch(h,h._handleGitServiceResponseError)(i,this,j,
k)}});return i},doGitLog:function(g,h,i,j){var k=this,m=new e.Deferred;e.xhrGet({url:g,headers:{"Orion-Version":"1"},handleAs:"json",timeout:5E3,load:function(n,p){e.hitch(k,k._getGitServiceResponse)(m,n,p,j?j:"Generating git log",h)},error:function(n,p){e.hitch(k,k._handleGitServiceResponseError)(m,this,n,p,h,i,e.xhrGet)}});return m},getDiff:function(g,h,i,j){var k=this,m=new e.Deferred;e.xhrPost({url:g,headers:{"Orion-Version":"1"},postData:e.toJson({New:h}),handleAs:"json",timeout:5E3,load:function(n,
p){e.hitch(k,k._getGitServiceResponse)(m,n,p,h?"Getting git diff for "+h:"Getting git diff",i)},error:function(n,p){e.hitch(k,k._handleGitServiceResponseError)(m,this,n,p,i,j,e.xhrPost)}});return m},doFetch:function(g,h,i,j,k,m,n,p){var r=this,w=new e.Deferred;e.xhrPost({url:g,headers:{"Orion-Version":"1"},postData:e.toJson({Fetch:"true",Force:h,GitSshUsername:j,GitSshPassword:k,GitSshKnownHost:m,GitSshPrivateKey:n,GitSshPassphrase:p}),handleAs:"json",timeout:5E3,load:function(s,u){e.hitch(r,r._getGitServiceResponse)(w,
s,u,"Fetching remote: "+g,i)},error:function(s,u){e.hitch(r,r._handleGitServiceResponseError)(w,this,s,u)}});return w},doPull:function(g,h,i,j,k,m,n,p){var r=this,w=new e.Deferred;e.xhrPost({url:g,headers:{"Orion-Version":"1"},postData:e.toJson({Pull:"true",Force:h,GitSshUsername:j,GitSshPassword:k,GitSshKnownHost:m,GitSshPrivateKey:n,GitSshPassphrase:p}),handleAs:"json",timeout:5E3,load:function(s,u){e.hitch(r,r._getGitServiceResponse)(w,s,u,"Pulling : "+g,i)},error:function(s,u){e.hitch(r,r._handleGitServiceResponseError)(w,
this,s,u)}});return w},doMerge:function(g,h){var i=this,j=new e.Deferred;e.xhrPost({url:g,headers:{"Orion-Version":"1"},postData:e.toJson({Merge:h}),handleAs:"json",timeout:5E3,load:function(k,m){var n=new e.Deferred;e.hitch(i,i._getGitServiceResponse)(n,k,m,"Merging "+g);n.then(function(p){j.callback({jsonData:p})})},error:function(k,m){e.hitch(i,i._handleGitServiceResponseError)(j,this,k,m)}});return j},doCherryPick:function(g,h,i,j){var k=this,m=new e.Deferred;e.xhrPost({url:g,headers:{"Orion-Version":"1"},
postData:e.toJson({"Cherry-Pick":h}),handleAs:"json",timeout:5E3,load:function(n,p){e.hitch(k,k._getGitServiceResponse)(m,n,p,"Cherry pick of "+h,i,j)},error:function(n,p){e.hitch(k,k._handleGitServiceResponseError)(m,this,n,p,i,j)}});return m},doRebase:function(g,h,i,j,k){var m=this,n={};n.Rebase=h;if(i)n.Operation=i;var p=new e.Deferred;e.xhrPost({url:g,headers:{"Orion-Version":"1"},postData:e.toJson(n),handleAs:"json",timeout:5E3,load:function(r,w){e.hitch(m,m._getGitServiceResponse)(p,r,w,h?"Rebase on top of ":
"Rebase"+h,j,k)},error:function(r,w){e.hitch(m,m._handleGitServiceResponseError)(p,this,r,w,j,k)}});return p},doPush:function(g,h,i,j,k,m,n,p,r,w,s){var u=this,t=new e.Deferred;e.xhrPost({url:g,headers:{"Orion-Version":"1"},postData:e.toJson({PushSrcRef:h,PushTags:i,Force:j,GitSshUsername:n,GitSshPassword:p,GitSshKnownHost:r,GitSshPrivateKey:w,GitSshPassphrase:s}),handleAs:"json",timeout:5E3,load:function(y,B){e.hitch(u,u._getGitServiceResponse)(t,y,B,m?m:"Pushing repository")},error:function(y,B){e.hitch(u,
u._handleGitServiceResponseError)(t,this,y,B)}});return t},getLog:function(g,h,i,j,k){var m=this,n=new e.Deferred,p=new e.Deferred;e.xhrPost({url:g,headers:{"Orion-Version":"1"},postData:e.toJson({New:h}),handleAs:"json",timeout:5E3,load:function(r,w){p.callback(w.xhr.getResponseHeader("Location"))},error:function(r,w){e.hitch(m,m._handleGitServiceResponseError)(p,this,r,w,j,k,e.xhrPost)}});p.then(function(r){e.xhrGet({url:r,headers:{"Orion-Version":"1"},handleAs:"json",timeout:5E3,load:function(w,
s){e.hitch(m,m._getGitServiceResponse)(n,w,s,i?i:"Generating git log",j)},error:function(w,s){e.hitch(m,m._handleGitServiceResponseError)(n,this,w,s,j,k,e.xhrGet)}})});return n},getDefaultRemoteBranch:function(g,h,i){var j=this,k=new e.Deferred,m=new e.Deferred;e.xhrGet({url:g,headers:{"Orion-Version":"1"},handleAs:"json",timeout:5E3,load:function(n,p){e.hitch(j,j._getGitServiceResponse)(m,n,p,"Getting remote branches")},error:function(n,p){e.hitch(j,j._handleGitServiceResponseError)(m,this,n,p,h,
i,e.xhrGet)}});m.then(function(n){if(n.Children[0]==null)return null;e.xhrGet({url:n.Children[0].Location,headers:{"Orion-Version":"1"},handleAs:"json",timeout:5E3,load:function(p,r){e.hitch(j,j._getGitServiceResponse)(k,p,r,"Getting default remote branch",h)},error:function(p,r){e.hitch(j,j._handleGitServiceResponseError)(k,this,p,r,h,i,e.xhrGet)}})});return k},doAddTag:function(g,h,i,j){var k=this,m=new e.Deferred;e.xhrPut({url:g,headers:{"Orion-Version":"1"},putData:e.toJson({Name:h}),handleAs:"json",
timeout:5E3,load:function(n,p){e.hitch(k,k._getGitServiceResponse)(m,n,p,"Adding tag ..."+h,i)},error:function(n,p){e.hitch(k,k._handleGitServiceResponseError)(m,this,n,p,i,j)}});return m},doRemoveTag:function(g){var h=this,i=new e.Deferred;e.xhrDelete({url:g,headers:{"Orion-Version":"1"},handleAs:"json",timeout:5E3,load:function(j,k){e.hitch(h,h._getGitServiceResponse)(i,j,k,"Removing tag ...")},error:function(j,k){e.hitch(h,h._handleGitServiceResponseError)(i,this,j,k)}});return i},checkoutTag:function(g,
h,i,j,k){var m=this,n=new e.Deferred;e.xhrPut({url:g,headers:{"Orion-Version":"1"},putData:e.toJson({Tag:h,Branch:i}),handleAs:"json",timeout:5E3,load:function(p,r){e.hitch(m,m._getGitServiceResponse)(n,p,r,"Checking out tag "+h,j,k)},error:function(p,r){e.hitch(m,m._handleGitServiceResponseError)(n,this,p,r,j,k)}});return n},addCloneConfigurationProperty:function(g,h,i,j,k){var m=this,n=new e.Deferred;e.xhrPost({url:g,headers:{"Orion-Version":"1"},postData:e.toJson({Key:h,Value:i}),handleAs:"json",
timeout:15E3,load:function(p,r){e.hitch(m,m._getGitServiceResponse)(n,p,r,"Adding configuration property "+h,j,k)},error:function(p,r){e.hitch(m,m._handleGitServiceResponseError)(n,this,p,r,j,k)}});return n},editCloneConfigurationProperty:function(g,h,i,j){var k=this,m=new e.Deferred;e.xhrPut({url:g,headers:{"Orion-Version":"1"},putData:e.toJson({Value:h}),handleAs:"json",timeout:15E3,load:function(n,p){e.hitch(k,k._getGitServiceResponse)(m,n,p,"Saving configuration property as "+h,i,j)},error:function(n,
p){e.hitch(k,k._handleGitServiceResponseError)(m,this,n,p,i,j)}});return m},deleteCloneConfigurationProperty:function(g,h,i){var j=this,k=new e.Deferred;e.xhrDelete({url:g,headers:{"Orion-Version":"1"},handleAs:"json",timeout:15E3,load:function(m,n){e.hitch(j,j._getGitServiceResponse)(k,m,n,"Deleting configuration property",h,i)},error:function(m,n){e.hitch(j,j._handleGitServiceResponseError)(k,this,m,n,h,i)}});return k},_getGitServiceResponse:function(g,h,i,j,k){var m=this;if(i&&i.xhr.status===202){i=
new e.Deferred;i.callback(h);return this._serviceRegistry.getService("orion.page.progress").showWhile(i,j).then(function(n){n=n.Result.Severity=="Ok"?n.Result.JsonData:n.Result;if(k)typeof k==="function"?k(n):m._serviceRegistration.dispatchEvent(k,n);g.callback(n)})}if(k)typeof k==="function"?k(h,i):m._serviceRegistration.dispatchEvent(k,h);g.callback(h)},_handleGitServiceResponseError:function(g,h,i,j,k,m,n){g||(g=new e.Deferred);if(i.status===401||i.status===403){a.handleAuthenticationError(j.xhr,
function(){n?n(h).then(function(p,r){g.callback(p,r)},function(p,r){m&&m(p,r);g.errback(p,r)}):g.errback(i)})!=null&&g.errback(i);return g}m&&m(i,j);g.errback(i);return g}};return d}();return c});
define("orion/compare/diff-parser",[],function(){var f=f||{};f.DiffParser=function(){function e(c,d){this._lineDelimiter=c?c:a?"\r\n":"\n";this._diffLineDelimiter=d?d:this._lineDelimiter;this._DEBUG=false}var a=navigator.platform.indexOf("Win")!==-1;e.prototype={_init:function(){this._oFileContents=[];this._diffContents=[];this._oBlocks=[];this._nBlocks=[];this._hunkRanges=[];this._lastToken=" ";this._deltaMap=[];this._nFileContents=[];this._nNewLineAtEnd=this._oNewLineAtEnd=true;this._diffContentIndex=
1},setLineDelim:function(c){this._diffLineDelimiter=this._lineDelimiter=c},getDiffArray:function(){return{array:this._diffContents,index:this._diffContentIndex}},parse:function(c,d,g,h){this._init();if(d==="")return{outPutFile:c,mapper:[]};this._oFileContents=c===""?[]:c.split(this._lineDelimiter);this._diffContents=d.split(this._diffLineDelimiter);d=this._diffContents.length;this._hunkRanges=[];for(var i=0;i<d;i++){var j=this._parseHunkRange(i);j&&this._hunkRanges.push(j)}if(0===this._hunkRanges.length)return{outPutFile:c,
mapper:[]};if(this._DEBUG){console.log("***Diff contents: \n");for(c=0;c<this._diffContents.length;c++)console.log(this._diffContents[c]);console.log("***Hunk ranges: \n");console.log(JSON.stringify(this._hunkRanges))}for(c=0;c<this._hunkRanges.length;c++)this._parseHunkBlock(c);if(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(g);if(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)}if(h===undefined||!h)this._buildNewFile();return{outPutFile:this._nFileContents.join(this._diffLineDelimiter),mapper:this._deltaMap}},_logMap:function(){for(var c=0;c<this._deltaMap.length;c++){console.log(JSON.stringify(this._deltaMap[c]));
if(this._deltaMap[c][2]>0){console.log("    **Diff content on change/add: \n");for(var d=0;d<this._deltaMap[c][0];d++)console.log("    "+this._diffContents[this._deltaMap[c][2]+d-1])}}},_logNewFile:function(){for(var c=0;c<this._nFileContents.length;c++)console.log(this._nFileContents[c])},_createBlock:function(c,d,g,h){if(!(h===g&&c===" ")){g=[g,h-g,"s"];if(c==="-")g[2]="r";else if(c==="+")g[2]="a";else if(c==="c")g[2]="c";d.push(g)}},_createMinusBlock:function(c,d,g){var h=this._oBlocks.length;
if(h===0||c!==this._oBlocks[h-1][0]){this._oBlocks.push([c===0?1:c,g]);this._nBlocks.push([d,0,-2])}else this._oBlocks[h-1][1]+=g},_createPlusBlock:function(c,d,g,h){var i=this._nBlocks.length;if(i===0||d!==this._nBlocks[i-1][0]){this._oBlocks.push([c===0?1:c,0]);this._nBlocks.push([d,g,h])}else{this._nBlocks[i-1][1]+=g;this._nBlocks[i-1][2]=h}},_parseHunkBlock:function(c){for(var d=" ",g=this._hunkRanges[c][0]+1,h=c===this._hunkRanges.length-1?this._diffContents.length:this._hunkRanges[c+1][0],i=
0,j=0,k=this._hunkRanges[c][1],m=this._hunkRanges[c][3],n=g,p=g;p<h;p++)if(0!==this._diffContents[p].length){var r=this._diffContents[p][0];if(r==="\\")if("\\ No newline at end of file"===this._diffContents[p].substring(0,this._diffContents[p].length-1)||"\\ No newline at end of file"===this._diffContents[p]){if(d==="-")this._oNewLineAtEnd=false;else if(d===" ")this._oNewLineAtEnd=this._nNewLineAtEnd=false;else this._nNewLineAtEnd=false;if(p>g&&this._diffContents[p-1][this._diffContents[p-1].length-
1]==="\r")this._diffContents[p-1]=this._diffContents[p-1].substring(0,this._diffContents[p-1].length-1);continue}switch(r){case "-":case "+":case " ":break;default:continue}if(d!==r){if(r==="+")n=p;switch(d){case " ":k=this._hunkRanges[c][1]+i;m=this._hunkRanges[c][3]+j;break;case "-":this._createMinusBlock(k,m,this._hunkRanges[c][1]+i-k);break;case "+":this._createPlusBlock(k,m,this._hunkRanges[c][3]+j-m,n);break;default:}d=r}switch(r){case "-":i++;break;case "+":j++;break;case " ":i++;j++;break}}switch(d){case "-":this._createMinusBlock(k,
m,this._hunkRanges[c][1]+i-k);break;case "+":this._createPlusBlock(k,m,this._hunkRanges[c][3]+j-m,n);break}},_detectConflictes:function(c,d){if(c<0)return false;d=c+d;for(c=c;c<d;c++){var g=this._diffContents[c];if(g.indexOf("<<<<<")>-1||g.indexOf(">>>>>")>-1)return true}return false},_buildMap:function(c){for(var d=this._oBlocks.length,g=this._oFileContents.length,h=0,i=1,j=0;j<d;j++){i=this._oBlocks[j][0]-i;if(i>0){this._deltaMap.push([i,i,0]);h+=i}c&&this._detectConflictes(this._nBlocks[j][2],
this._nBlocks[j][1])?this._deltaMap.push([this._nBlocks[j][1],this._oBlocks[j][1],this._nBlocks[j][2]+1,1]):this._deltaMap.push([this._nBlocks[j][1],this._oBlocks[j][1],this._nBlocks[j][2]+1]);h+=this._oBlocks[j][1];i=this._oBlocks[j][0]+this._oBlocks[j][1]}if(0<g-i){this._deltaMap.push([g-i+1,g-i+1,0]);h+=g-i+1}if(h<g){i=g-h;c=this._deltaMap[this._deltaMap.length-1];if(c[2]===0){c[0]+=i;c[1]+=i}else if(c[2]===-1)this._deltaMap.push([i,i,0]);else if(this._nNewLineAtEnd===this._oNewLineAtEnd)this._deltaMap.push([i,
i,0]);else{if(this._nNewLineAtEnd)c[0]+=i;if(this._oNewLineAtEnd)c[1]+=i}}},_buildNewFile:function(){for(var c=1,d=false,g=this._deltaMap.length,h=0;h<g;h++){d=false;if(this._deltaMap[h][2]===0){for(var i=0;i<this._deltaMap[h][0];i++)this._nFileContents.push(this._oFileContents[c+i-1]);d=true}else if(this._deltaMap[h][2]>0)for(i=0;i<this._deltaMap[h][0];i++)this._nFileContents.push(this._diffContents[this._deltaMap[h][2]+i-1].substring(1));c+=this._deltaMap[h][1]}this._nNewLineAtEnd&&!d&&this._nFileContents.push("")},
_parseHRangeBody:function(c,d){if(0<c.indexOf(",")){var g=c.split(",");c=parseInt(g[0]);g=parseInt(g[1]);d.push(c>=0?c:1);d.push(g>=0?g:1)}else{c=parseInt(c);d.push(c>=0?c:1);d.push(1)}},_parseHunkRange:function(c){var d=this._diffContents[c];if(!(8>d.length))if("@@"===d.substring(0,2)){d=d.substring(2);var g=d.indexOf("@@");if(!(g<0)){d=d.substring(0,g);g=d.indexOf("-");var h=d.indexOf("+");if(!(g<0||h<0)){c=[c];if(g<h){d=d.substring(g+1).split("+");this._parseHRangeBody(d[0],c);this._parseHRangeBody(d[1],
c)}else{d=d.substring(h+1).split("-");this._parseHRangeBody(d[1],c);this._parseHRangeBody(d[0],c)}return c}}}}};return e}();return f});
define("orion/compare/compareUtils",[],function(){var f=f||{};f.compareUtils=f.compareUtils||{};f.compareUtils.lookUpMapper=function(e,a,c){for(var d=0,g=0;g<e.length;g++){var h=e[g][a];if(h===0)h=1;if(c>=d&&c<d+h)return{mapperIndex:g,startFrom:d};if(g===e.length-1)break;d+=e[g][a]}return{mapperIndex:e.length-1,startFrom:d}};f.compareUtils.lookUpLineIndex=function(e,a,c){if(c===0)return 0;for(var d=0,g=0;g<c;g++)d+=e[g][a];return d};f.compareUtils.updateMapper=function(e,a,c,d,g){if(d!==g)if(d>0||
g>0){var h=f.compareUtils.lookUpMapper(e,a,c);if(!(h.mapperIndex<0)){if(d>0){d=d;var i=c-h.startFrom;for(c=h.mapperIndex;c<e.length;c++){i=e[c][a]-i;if(d<=i){e[c][a]-=d;break}e[c][a]-=i;d-=i;i=0}}if(g>0)e[h.mapperIndex][a]+=g}}};f.compareUtils.overlapMapper=function(e,a,c,d,g){e=c+e[a]-1;if(e<c)e=c;if(g<d)g=d;if(e<d||g<c)return false;return true};f.compareUtils.findFirstDiff=function(e,a,c,d){for(var g=0,h=undefined,i=0;i<e.length;i++){if(g>d)break;if(f.compareUtils.overlapMapper(e[i],a,g,c,d)){h=
{mapperIndex:i,startFrom:g};if(e[i][2]!==0)break}g+=e[i][a]}return h};f.compareUtils.matchMapper=function(e,a,c,d){if(e.length===0)return c;var g=c+Math.round((d-c)/3),h=f.compareUtils.findFirstDiff(e,a,c,d),i=e[h.mapperIndex][a]===0?h.startFrom:h.startFrom+e[h.mapperIndex][a]-1,j=f.compareUtils.lookUpLineIndex(e,1-a,h.mapperIndex),k=h.startFrom-c;if(e[h.mapperIndex][2]===0)return j-k;if(g>=h.startFrom&&g<=i)return j-Math.round((d-c)/3);if(g<h.startFrom)return j-k;return(e[h.mapperIndex][1-a]===0?
j:j+e[h.mapperIndex][1-a]-1)-(i-c)};f.compareUtils.getMapperLineCount=function(e){for(var a=0,c=0;c<e.length;c++)a+=Math.max(e[c][0],e[c][1]);return a};f.compareUtils.findNextDiff=function(e,a){var c=0;if(a>=0&&a<e.length-1)c=a+1;for(var d=c;d<e.length;d++)if(e[d][2]!==0)return d;for(d=0;d<c;d++)if(e[d][2]!==0)return d;return a};f.compareUtils.getAnnotationIndex=function(e,a){for(var c=0;c<e.length;c++)if(e[c][0]===a)return c;return-1};f.compareUtils.getAnnotationMapperIndex=function(e,a){return e[a][1]};
f.compareUtils.getAnnotationIndexByMapper=function(e,a){for(var c=0;c<e.length;c++)if(e[c][1]===a)return{current:c,prev:c-1,next:c+1};return{current:-1,prev:-1,next:-1}};f.compareUtils.isMapperConflict=function(e,a){if(a<0)return false;if(!e[a][3])return false;return e[a][3]===1};return f.compareUtils});
define("orion/compare/rulers",["orion/compare/compareUtils"],function(f){var e=e||{};e.CompareRuler=function(){function a(c,d,g){this._location=c||"left";this._overview=d||"page";this._rulerStyle=g;this._editor=null;var h=this;this._listener={onModelChanged:function(i){h._onModelChanged(i)}}}a.prototype={setView:function(c){this._onModelChanged&&this._editor&&this._editor.removeEventListener("ModelChanged",this._listener.onModelChanged);this._editor=c;this._onModelChanged&&this._editor&&this._editor.addEventListener("ModelChanged",
this._listener.onModelChanged)},getLocation:function(){return this._location},getOverview:function(){return this._overview},getAnnotationModel:function(){return null},addAnnotationType:function(){},isAnnotationTypeVisible:function(){return false},removeAnnotationType:function(){},setAnnotationModel:function(){},getAnnotations:function(c,d){var g=[];for(c=c;c<d;c++){var h=this.getStyle(c);if(h)g[c]={html:this.getHTML(c),style:h}}return g},getWidestAnnotation:function(){return{html:this.getHTML(-1),
style:this.getStyle(-1)}},getRulerStyle:function(){return this.getStyle(undefined)}};return a}();e.LineNumberCompareRuler=function(){function a(c,d,g,h,i){e.CompareRuler.call(this,d,"page",g);this._oddStyle=h||{style:{backgroundColor:"white"}};this._evenStyle=i||{style:{backgroundColor:"white"}};this._numOfDigits=0;this._mapperColumnIndex=c}a.prototype=new e.CompareRuler;a.prototype.getStyle=function(c){return c===undefined?this._rulerStyle:this._evenStyle};a.prototype.getHTML=function(c){var d=this._editor.getModel();
if(c===-1)return d.getLineCount();else{if(d.getLineNumber){c=d.getLineNumber(c,this._mapperColumnIndex);if(c===-1)return"";return c+1}return c+1}};a.prototype._onModelChanged=function(c){c=c.start;var d=this._editor.getModel(),g=d.getLineCount(),h=(g+"").length;if(this._numOfDigits!==h){this._numOfDigits=h;this._editor.redrawLines(d.getLineAtOffset(c),g,this)}};return a}();e.CompareAnnotation=function(){function a(){this._currentAnnotationIndex=0}a.prototype={init:function(c,d){this._mapper=c;this._editor=
d;this._currentAnnotationIndex=0},getCurrentAnnotationIndex:function(){return this._currentAnnotationIndex},getCurrentMapperIndex:function(){var c=this._editor.getModel().getAnnotations();return c.length===0?-1:c[this._currentAnnotationIndex][1]},matchPositionFromAnnotation:function(c){var d=c;if(c===-1)d=0;else{d=this._editor.getModel();d=f.getAnnotationIndex(d.getAnnotations(),c)}this._currentAnnotationIndex=d},gotoDiff:function(c){this._currentAnnotationIndex=c},nextDiff:function(){var c=this._editor.getModel().getAnnotations();
if(c.length!==0)if(c.length-1===this._currentAnnotationIndex)this._currentAnnotationIndex=0;else this._currentAnnotationIndex+=1},prevDiff:function(){var c=this._editor.getModel().getAnnotations();if(c.length!==0)if(0===this._currentAnnotationIndex)this._currentAnnotationIndex=c.length-1;else this._currentAnnotationIndex-=1}};return a}();e.CompareOverviewRuler=function(){function a(c,d){e.CompareRuler.call(this,c,"document",d)}a.prototype=new e.CompareRuler;a.prototype.getStyle=function(c){var d,
g;if(c===undefined){d=this._rulerStyle||{};g=d.style||(d.style={});g.lineHeight="1px";g.fontSize="1px";g.width="14px"}else{d=c!==-1?{styleClass:"ruler_annotation_breakpoint_overview"}:{};g=d.style||(d.style={});g.cursor="pointer";g.width="8px";g.left="2px";var h=this._editor.getModel();if(c>=0&&h.getAnnotationH){c=h.getAnnotationH(c);h=h.getLineCount();var i=this._editor.getClientArea();c=Math.floor(i.height*c/h);if(c<2)c=2;g.height=c+"px"}else g.height="3px"}return d};a.prototype.getHTML=function(){return"&nbsp;"};
a.prototype.onClick=function(c){if(c!==undefined){var d=this._editor.getLineHeight(),g=this._editor.getClientArea();d=Math.floor(g.height/d/3);this._editor.setTopIndex(c-d>0?c-d:0)}};a.prototype._onModelChanged=function(){this._editor.getModel().getLineCount()>0&&this._editor.redrawLines(0,1,this)};return a}();e.TwoWayCompareOverviewRuler=function(){function a(c,d,g,h){this._compareAnnotaion=g;this._onClick=h;e.CompareRuler.call(this,c,"document",d)}a.prototype=new e.CompareRuler;a.prototype.getStyle=
function(c){var d,g;if(c===undefined){d=this._rulerStyle||{};g=d.style||(d.style={});g.lineHeight="1px";g.fontSize="1px";g.width="14px"}else{d=c!==-1?{styleClass:"ruler_annotation_breakpoint_overview"}:{};g=d.style||(d.style={});g.cursor="pointer";g.width="8px";g.left="2px";var h=this._editor.getModel();if(c>=0&&h.getAnnotationH){c=f.getAnnotationIndex(h.getAnnotations(),c);if(c===-1)return null;var i=f.getAnnotationMapperIndex(h.getAnnotations(),c);if(i=f.isMapperConflict(h.getMapper(),i))g.border=
"1px #FF0000 solid";if(c===this._compareAnnotaion.getCurrentAnnotationIndex())g.backgroundColor=i?"red":"blue";c=h.getAnnotationH(c);h=h.getAnnotationLineCount();i=this._editor.getClientArea();h=Math.floor(i.height*c/h);if(h<2)h=2;g.height=h+"px"}else g.height="3px"}return d};a.prototype.getHTML=function(){return"&nbsp;"};a.prototype.onClick=function(c){c!==undefined&&this._onClick(c,this)};a.prototype._onModelChanged=function(){this._editor.getModel().getLineCount()>0&&this._editor.redrawLines(0,
1,this)};return a}();e.CompareMatchRenderer=function(){function a(c){this._canvasDiv=c;this._mapper=undefined;this._initialized=false;this._annotation=new e.CompareAnnotation}a.prototype={init:function(c,d,g){this._initialized=true;this._mapper=c;this._leftEditor=d;this._rightEditor=g;this._annotation.init(c,g);this.render()},getAnnotation:function(){return this._annotation},getCurrentAnnotationIndex:function(){return this._annotation.getCurrentAnnotationIndex()},getCurrentMapperIndex:function(){return this._annotation.getCurrentMapperIndex()},
setOverviewRuler:function(c){this._overviewRuler=c},_setEditorPosition:function(c,d){var g=c.getLineHeight(),h=c.getClientArea();g=Math.floor(h.height/g/3);c.setTopIndex(d-g>0?d-g:0)},_findBaseLine:function(c){var d=c.getLineHeight(),g=c.getClientArea();d=Math.floor(g.height/d/3);return c.getTopIndex()+d},matchPositionFrom:function(c){var d=c?this._leftEditor:this._rightEditor,g=c?this._rightEditor:this._leftEditor,h=d.getTopIndex();d=d.getBottomIndex();c=f.matchMapper(this._mapper,c?0:1,h,d);g.setTopIndex(c)},
matchPositionFromAnnotation:function(c){if(this._initialized){this._annotation.matchPositionFromAnnotation(c);this.positionAnnotation(this._annotation.getCurrentAnnotationIndex())}},positionAnnotation:function(c){var d=this._rightEditor.getModel().getAnnotations();if(d.length!==0){this._setEditorPosition(this._rightEditor,d[c][0]);this._setEditorPosition(this._leftEditor,this._leftEditor.getModel().getLineIndexFromMapper(d[c][1]));this._leftEditor.redrawRange();this._rightEditor.redrawRange();c=this._rightEditor.getTopIndex();
this._rightEditor.redrawLines(c,c+1,this._overviewRuler)}},gotoDiff:function(c){this._annotation.gotoDiff(c);c=this._rightEditor.getTopIndex();this._leftEditor.redrawRange();this._rightEditor.redrawRange();this._rightEditor.redrawLines(c,c+1,this._overviewRuler)},nextDiff:function(){this._annotation.nextDiff();this.positionAnnotation(this._annotation.getCurrentAnnotationIndex());this.render()},prevDiff:function(){this._annotation.prevDiff();this.positionAnnotation(this._annotation.getCurrentAnnotationIndex());
this.render()},getMapperTextRange:function(c,d,g){var h=c.getModel().getLineIndexFromMapper(d);d=h+this._mapper[d][g]-1;h=c.getModel().getLineStart(h);c=c.getModel().getLineEnd(d,true);return{start:h,end:c}},copyToLeft:function(){var c=this.getCurrentMapperIndex(),d=this.getMapperTextRange(this._rightEditor,c,1);c=this.getMapperTextRange(this._leftEditor,c,0);this._leftEditor.setText(this._rightEditor.getText(d.start,d.end),c.start,c.end);this._leftEditor.redrawRange();this._rightEditor.redrawRange()},
render:function(){if(this._mapper){var c=this._canvasDiv.getContext("2d");c.clearRect(0,0,this._canvasDiv.width,this._canvasDiv.height);c.strokeStyle="#AAAAAA";c.lineWidth=1;c.beginPath();var d=this._leftEditor.getTopIndex(),g=this._leftEditor.getBottomIndex(),h=this._rightEditor.getTopIndex(),i=this._rightEditor.getBottomIndex();this._leftLineH=this._leftEditor.getLineHeight();this._rightLineH=this._rightEditor.getLineHeight();for(var j=0,k=0,m=false,n=0;n<this._mapper.length;n++){if(this._mapper[n][2]!==
0)if(f.overlapMapper(this._mapper[n],0,j,d,g)||f.overlapMapper(this._mapper[n],1,k,h,i)){this._renderCurve(n,j,k,this._canvasDiv,c,d,g,h,i);m=true}else if(m)break;j+=this._mapper[n][0];k+=this._mapper[n][1]}c.stroke()}},_renderCurve:function(c,d,g,h,i){var j=this._mapper[c];d=this._leftEditor.getLinePixel(d+j[0]/2)+j[0]%2*this._leftLineH/3-this._leftEditor.getTopPixel();g=this._rightEditor.getLinePixel(g+j[1]/2)+j[1]%2*this._rightLineH/3-this._rightEditor.getTopPixel();h=h.parentNode.clientWidth;
if(c===this.getCurrentMapperIndex()){i.stroke();i.strokeStyle="#000";i.lineWidth=1;i.beginPath();i.moveTo(0,d);i.bezierCurveTo(h/3,d,h*0.666,g,h,g);i.stroke();i.strokeStyle="#AAAAAA";i.lineWidth=1;i.beginPath()}else{i.moveTo(0,d);i.bezierCurveTo(h/3,d,h*0.666,g,h,g);i.stroke()}},onChanged:function(c){if(c.removedLineCount!==c.addedLineCount)if(c.removedLineCount>0||c.addedLineCount>0)this.render()}};return a}();return e});
define("orion/textview/eventTarget",[],function(){function f(){}f.addMixin=function(e){var a=f.prototype;for(var c in a)if(a.hasOwnProperty(c))e[c]=a[c]};f.prototype={addEventListener:function(e,a,c){if(!this._eventTypes)this._eventTypes={};var d=this._eventTypes[e];d||(d=this._eventTypes[e]={level:0,listeners:[]});d.listeners.push({listener:a,useCapture:c})},dispatchEvent:function(e){if(this._eventTypes){var a=e.type,c=this._eventTypes[a];if(c){var d=c.listeners;try{c.level++;if(d)for(var g=0,h=
d.length;g<h;g++)if(d[g]){var i=d[g].listener;if(typeof i==="function")i.call(this,e);else i.handleEvent&&typeof i.handleEvent==="function"&&i.handleEvent(e)}}finally{c.level--;if(c.compact&&c.level===0){for(e=d.length-1;e>=0;e--)d[e]||d.splice(e,1);d.length===0&&delete this._eventTypes[a];c.compact=false}}}}},isListening:function(e){if(!this._eventTypes)return false;return this._eventTypes[e]!==undefined},removeEventListener:function(e,a,c){if(this._eventTypes){var d=this._eventTypes[e];if(d){for(var g=
d.listeners,h=0,i=g.length;h<i;h++){var j=g[h];if(j&&j.listener===a&&j.useCapture===c){if(d.level!==0){g[h]=null;d.compact=true}else g.splice(h,1);break}}g.length===0&&delete this._eventTypes[e]}}}};return{EventTarget:f}});
define("orion/compare/compare-inline-model",["orion/textview/eventTarget"],function(f){var e=e||{};e.CompareTextModel=function(){function a(c,d,g){this._model=c;this._mapperColumnIndex=d.columnIndex;this._mapper=d.mapper;var h=this;this._listener={onChanging:function(i){h.onChanging(i)},onChanged:function(i){h.onChanged(i)}};c.addEventListener("Changing",this._listener.onChanging);c.addEventListener("Changed",this._listener.onChanged);this._lineFeeder=g;this.init()}navigator.platform.indexOf("Win");
a.prototype={init:function(c,d){if(c)this._mapper=c;c=this._lineFeeder.generateGapBlocks(this._mapper,this._mapperColumnIndex,d);this._dummyLBlock=c.gapBlocks;this._dummyLNumber=c.gapNumber},_getDummyCharCountAt:function(c,d){if(c.blockNumber<0)return 0;for(var g=0,h=0;h<=c.blockNumber;h++){if(h>=this._dummyLBlock.length)break;for(var i=h===c.blockNumber?c.stopAtDelta:this._dummyLBlock[h][1]-1,j=0;j<=i;j++){var k=d?this._lineFeeder.getLineAt(this._dummyLBlock,h,j,true):this._lineFeeder.getLineAt(this._dummyLBlock,
h,j,!(h===c.blockNumber&&j===i));g+=k.length}}return g},lookUpRealIndex:function(c){for(var d=0,g=0,h=0;h<this._dummyLBlock.length;h++){var i=this._dummyLBlock[h][0],j=i+this._dummyLBlock[h][1]-1;if(c<i)break;if(c>=i&&c<=j)return{lineIndex:-1,gapsBefore:d+c-i,lastGapInfo:{blockNumber:h,stopAtDelta:c-i}};g=this._dummyLBlock[h][1];d+=g}return{lineIndex:c-d,gapsBefore:d,lastGapInfo:{blockNumber:h-1,stopAtDelta:g-1}}},getLineType:function(c){return this._lineFeeder.getLineType(c,this._mapperColumnIndex)},
getMapper:function(){return this._mapper},getAnnotations:function(){return this._lineFeeder.getAnnotations()},getAnnotationH:function(c){return this._lineFeeder.getAnnotationH(c)},getAnnotationLineCount:function(){return this.getLineCount()},getLineNumber:function(c,d){if(this._lineFeeder.getLineNumber)return this._lineFeeder.getLineNumber(c,d);return this.lookUpRealIndex(c).lineIndex},getCharCount:function(){var c=this._model.getCharCount();if(this._dummyLBlock.length>0)c+=this._getDummyCharCountAt({blockNumber:this._dummyLBlock.length-
1,stopAtDelta:this._dummyLBlock[this._dummyLBlock.length-1][1]-1},true);return c},getLine:function(c,d){var g=this.getLineCount();if(!(0<=c&&c<g))return null;c=this.lookUpRealIndex(c);return c.lineIndex<0?this._lineFeeder.getLineAt(this._dummyLBlock,c.lastGapInfo.blockNumber,c.lastGapInfo.stopAtDelta,d):this._model.getLine(c.lineIndex,d)},getLineAtOffset:function(c){if(!(0<=c&&c<=this.getCharCount()))return-1;for(var d=this.getLineCount(),g=0,h=0;g<d;){var i=this.lookUpRealIndex(g);if(i.lineIndex<
0)h+=this._lineFeeder.getLineAt(this._dummyLBlock,i.lastGapInfo.blockNumber,i.lastGapInfo.stopAtDelta,true).length;else{i=this._model.getLine(i.lineIndex,true);h+=i?i.length:0}g++;if(h>c)break}if(g>d)return d-1;return g-1},getLineCount:function(){return this._model.getLineCount()+this._dummyLNumber},getLineDelimiter:function(){return this._model.getLineDelimiter()},getLineEnd:function(c,d){var g=this.getLineCount();if(!(0<=c&&c<g))return-1;var h=this.lookUpRealIndex(c);g=0;if(h.lineIndex<0){g+=this._getDummyCharCountAt(h.lastGapInfo,
d);c=c-h.gapsBefore;if(c>0)g+=this._model.getLineEnd(c-1,true)}else{g+=this._getDummyCharCountAt(h.lastGapInfo,true);g+=this._model.getLineEnd(h.lineIndex,d)}return g},getLineStart:function(c){if(!(0<=c&&c<this.getLineCount()))return-1;if(c===0)return 0;return this.getLineEnd(c-1,true)},getText:function(c,d){if(c===d)return this._model.getText(c,d);if(c===undefined)c=0;if(d===undefined)d=this.getCharCount();var g=this.getLineAtOffset(c),h=this.getLineAtOffset(d),i=this.getLineStart(g),j=this.getLineEnd(h,
true),k=this.getLine(g,true);if(!k)return this._model.getText(c,d);if(g===h)return k.substring(c-i,k.length-j+d);i=k.substring(c-i);k=this.getLine(h,true);if(!k)return this._model.getText(c,d);c=k.substring(0,k.length-j+d);d="";for(g=g+1;g<h;g++)d+=this.getLine(g,true);return i+d+c},onChanging:function(c){return this.dispatchEvent(c)},onChanged:function(c){return this.dispatchEvent(c)},setLineDelimiter:function(c){this._model.setLineDelimiter(c)},setText:function(c){this._model.setText(c,0,this._model.getCharCount())}};
f.EventTarget.addMixin(a.prototype);return a}();e.DiffLineFeeder=function(){function a(c,d){if(c){this._diffLinesArray=c.array;this._diffLinesArrayIndex=c.index}this._lineDelimeter=d;this._annotations=[]}navigator.platform.indexOf("Win");a.prototype={generateGapBlocks:function(c,d,g){var h=[];this._mapper=c;if(g){this._diffLinesArray=g.array;this._diffLinesArrayIndex=g.index}this._annotations=[];g=c=0;for(var i=1-d,j=0,k=0;k<this._mapper.length;k++){j=this._mapper[k][2]===0?this._mapper[k][d]:this._mapper[k][d]+
this._mapper[k][i];if(this._mapper[k][2]>0){var m=this._mapper[k][d];c+=m;h.push([g+this._mapper[k][i],m,this._mapper[k][2]])}this._mapper[k][2]!==0&&this._annotations.push([g,k,j]);g+=j}return{gapBlocks:h,gapNumber:c}},getLineAt:function(c,d,g,h){d=c[d][2];d+=g-1;g=this._diffLinesArray[d];g===undefined&&console.log(c);g=g.substring(this._diffLinesArrayIndex);if(h)return g+this._lineDelimeter;return g},getLineType:function(c,d){for(var g=0,h=1-d,i=0,j=0;j<this._mapper.length;j++){i=this._mapper[j][2]===
0?this._mapper[j][d]:this._mapper[j][d]+this._mapper[j][h];if(c>=g&&c<g+i){if(this._mapper[j][2]===0)return{type:"unchnaged",mapperIndex:j};else if(this._mapper[j][2]<0)return{type:"removed",mapperIndex:j};else if(this._mapper[j][1]===0)return{type:"added",mapperIndex:j};else if(c<this._mapper[j][h]+g)return{type:"removed",mapperIndex:j};return{type:"added",mapperIndex:j}}g+=i}return{type:"unchnaged",mapperIndex:-1}},getLineNumber:function(c,d){if(this._mapper.length===0)return c;for(var g=0,h=0,
i=1-d,j=0,k=0;k<this._mapper.length;k++){j=this._mapper[k][2]===0?this._mapper[k][d]:this._mapper[k][d]+this._mapper[k][i];if(c>=g&&c<g+j){i=c-g;if(this._mapper[k][2]===0)return h+i;else if(this._mapper[k][2]<0)return d===0?-1:h+i;else if(this._mapper[k][1]===0)return d===0?h+i:-1;else if(c<this._mapper[k][1]+g)return d===0?-1:h+i;return d===0?h+i-this._mapper[k][1]:-1}g+=j;h+=this._mapper[k][d]}return c},getAnnotations:function(){return this._annotations},getAnnotationH:function(c){return this._annotations[c][2]}};
return a}();e.GapLineFeeder=function(){function a(c){this._lineDelimeter=c;this._annotations=[]}navigator.platform.indexOf("Win");a.prototype={generateGapBlocks:function(c,d){var g=[];this._mapper=c;this._annotations=[];for(var h=c=0,i=1-d,j=0;j<this._mapper.length;j++){if(this._mapper[j][d]<this._mapper[j][i]){var k=this._mapper[j][i]-this._mapper[j][d];c+=k;g.push([h+this._mapper[j][d],k,1])}k=Math.max(this._mapper[j][i],this._mapper[j][d]);this._mapper[j][2]!==0&&this._annotations.push([h,j,k]);
h+=k}return{gapBlocks:g,gapNumber:c}},getLineAt:function(c,d,g,h){if(h)return this._lineDelimeter;return""},getLineType:function(c,d){for(var g=0,h=1-d,i=0;i<this._mapper.length;i++){var j=Math.max(this._mapper[i][d],this._mapper[i][h]);if(c>=g&&c<g+j){if(this._mapper[i][2]===0)return"unchnaged";else if(this._mapper[i][2]<0)return"removed";else if(this._mapper[i][1]===0)return"added";else if(c<this._mapper[i][d]+g)return"changed";return"changed_gap"}g+=Math.max(this._mapper[i][d],this._mapper[i][h])}return"unchnaged"},
getAnnotations:function(){return this._annotations},getAnnotationH:function(c){return this._annotations[c][2]}};return a}();return e});
define("orion/compare/compare-2way-model",["orion/compare/compareUtils","orion/textview/eventTarget"],function(f,e){var a=a||{};a.TwoWayCompareModel=function(){function c(d,g){this._model=d;this._mapperColumnIndex=g.columnIndex;this._mapper=g.mapper;var h=this;this._listener={onChanging:function(i){h.onChanging(i)},onChanged:function(i){h.onChanged(i)}};d.addEventListener("Changing",this._listener.onChanging);d.addEventListener("Changed",this._listener.onChanged);this.init()}navigator.platform.indexOf("Win");
c.prototype={init:function(d){this._initing=true;if(d){this._mapper=d;this._annotations=undefined}},getMapper:function(){return this._mapper},getLineType:function(d){var g=f.lookUpMapper(this._mapper,this._mapperColumnIndex,d);if(g.mapperIndex>-1)if(this._mapper[g.mapperIndex][2]!==0){var h=this._mapper[g.mapperIndex][this._mapperColumnIndex];if(h===0)return{type:"top-only",mapperIndex:g.mapperIndex};if(h===1)return{type:"oneline",mapperIndex:g.mapperIndex};if(d===g.startFrom)return{type:"top",mapperIndex:g.mapperIndex};
if(d===g.startFrom+h-1)return{type:"bottom",mapperIndex:g.mapperIndex};return{type:"middle",mapperIndex:g.mapperIndex}}return{type:"unchanged",mapperIndex:g.mapperIndex}},isMapperEmpty:function(){return this._mapper.length===0},getAnnotations:function(){if(this._annotations===undefined){this._annotations=[];for(var d=0,g=0;g<this._mapper.length;g++){this._mapper[g][2]!==0&&this._annotations.push([d,g]);d+=this._mapper[g][this._mapperColumnIndex]}}return this._annotations},getAnnotationH:function(d){this.getAnnotations();
d=this._annotations[d][1];return d===-1?0:this._mapper[d][this._mapperColumnIndex]},getAnnotationLineCount:function(){return this.getLineCount()},getLineNumber:function(d){return d},getLineIndexFromMapper:function(d){return f.lookUpLineIndex(this._mapper,this._mapperColumnIndex,d)},lookUpMapper:function(d){return f.lookUpMapper(this._mapper,this._mapperColumnIndex,d)},updateMapper:function(d,g,h,i,j){i!==j&&f.updateMapper(this._mapper,this._mapperColumnIndex,this.getLineAtOffset(d),i,j)},getCharCount:function(){return this._model.getCharCount()},
getLine:function(d,g){return this._model.getLine(d,g)},getLineAtOffset:function(d){return this._model.getLineAtOffset(d)},getLineCount:function(){return this._model.getLineCount()},getLineDelimiter:function(){return this._model.getLineDelimiter()},setLineDelimiter:function(d){this._model.setLineDelimiter(d)},getLineEnd:function(d,g){return this._model.getLineEnd(d,g)},getLineStart:function(d){return this._model.getLineStart(d)},setText:function(d,g,h){this._model.setText(d,g,h)},getText:function(d,
g){return this._model.getText(d,g)},onChanging:function(d){return this.dispatchEvent(d)},onChanged:function(d){if(this._initing)this._initing=false;else this.updateMapper(d.start,d.removedCharCount,d.addedCharCount,d.removedLineCount,d.addedLineCount);return this.dispatchEvent(d)}};e.EventTarget.addMixin(c.prototype);return c}();return a});
define("orion/editor/nls/messages",{root:{currentLine:"Current Line",incrementalFind:"Incremental find: {0}",incrementalFindNotFound:"Incremental find: {0} (not found)",find:"Find...",findNext:"Find Next Occurrence",findPrevious:"Find Previous Occurrence",incrementalFindKey:"Incremental Find",indentLines:"Indent Lines",unindentLines:"Unindent Lines",moveLinesUp:"Move Lines Up",moveLinesDown:"Move Lines Down",copyLinesUp:"Copy Lines Up",copyLinesDown:"Copy Lines Down",deleteLines:"Delete Lines",gotoLine:"Goto Line...",
gotoLinePrompty:"Goto Line:",lastEdit:"Last Edit Location",toggleLineComment:"Toggle Line Comment",addBlockComment:"Add Block Comment",removeBlockComment:"Remove Block Comment",linkedModeEntered:"Linked Mode entered",linkedModeExited:"Linked Mode exited",syntaxError:"Syntax Error",contentAssist:"Content Assist",lineColumn:"Line {0} : Col {1}",formatMessage:function(f){var e=arguments;return f.replace(/\{([^\}]+)\}/g,function(a,c){return e[(c<<0)+1]})}},"pt-br":true});
define("orion/editor/contentAssist",["i18n!orion/editor/nls/messages","orion/textview/keyBinding","orion/textview/eventTarget"],function(f,e,a){function c(d,g){this.editor=d;this.textView=d.getTextView();this.contentAssistPanel=document.getElementById(g);this.active=false;this.prefix="";this.filteredProviders=[];this.proposals=[];var h=this;this.contentAssistListener={onModelChanging:function(i){h.ignoreNextChange=h.isIgnorable(i)},onModelChanged:function(i){h.ignoreNextChange?h.cancel():h.showContentAssist(true,
i);h.ignoreNextChange=false},onScroll:function(){h.cancel()},onMouseUp:function(i){i.event.target.parentElement!==h.contentAssistPanel&&h.cancel()}};this.init()}c.prototype={init:function(){this.textView.setKeyBinding(navigator.platform.indexOf("Mac")!==-1?new e.KeyBinding(" ",false,false,false,true):new e.KeyBinding(" ",true),f.contentAssist);this.textView.setAction(f.contentAssist,function(){this.showContentAssist(true);return true}.bind(this))},cancel:function(){this.showContentAssist(false)},
isActive:function(){return this.active},isIgnorable:function(d){var g=d.removedCharCount>0&&d.addedCharCount===0,h=this.textView;h=d.start+1<=h.getModel().getCharCount()&&/^\s*$/.test(h.getText(d.start,d.start+1));return d.removedLineCount>0||g&&h},lineUp:function(){if(this.contentAssistPanel){var d=this.getSelectedNode();d===this.contentAssistPanel.firstChild?this.setSelected(this.contentAssistPanel.lastChild):this.setSelected(d.previousSibling);return true}},lineDown:function(){if(this.contentAssistPanel){var d=
this.getSelectedNode();d===this.contentAssistPanel.lastChild?this.setSelected(this.contentAssistPanel.firstChild):this.setSelected(d.nextSibling);return true}},enter:function(){return this.contentAssistPanel?this.accept():false},accept:function(){var d=this.getSelectedProposal();if(d===null)return false;this.ignoreNextChange=true;this.cancel();this.dispatchEvent({type:"accept",data:{proposal:d,start:this.textView.getCaretOffset()-this.prefix.length,end:this.textView.getCaretOffset()}});return true},
setSelected:function(d){for(var g=this.contentAssistPanel.childNodes,h=0;h<g.length;h++){var i=g[h];if(i.className==="selected")i.className="";if(i===d){i.className="selected";i.focus();if(i.offsetTop<this.contentAssistPanel.scrollTop)i.scrollIntoView(true);else i.offsetTop+i.offsetHeight>this.contentAssistPanel.scrollTop+this.contentAssistPanel.clientHeight&&i.scrollIntoView(false)}}},getSelectedNode:function(){var d=this.getSelectedIndex();return d===-1?null:this.contentAssistPanel.childNodes[d]},
getSelectedIndex:function(){for(var d=this.contentAssistPanel.childNodes,g=0;g<d.length;g++)if(d[g].className==="selected")return g;return-1},getSelectedProposal:function(){var d=this.getSelectedIndex();return d===-1?null:this.proposals[d]},click:function(d){this.setSelected(d.target);this.accept();this.editor.getTextView().focus()},showContentAssist:function(d,g){if(this.contentAssistPanel){this.dispatchEvent({type:d?"show":"hide",data:null});if(d){var h=g?g.start+g.addedCharCount:this.textView.getCaretOffset();
d=h;for(var i;d>0&&(97<=(i=this.textView.getText(d-1,d).charCodeAt(0))&&i<=122||65<=i&&i<=90||i===95||48<=i&&i<=57);)d--;this.prefix=this.textView.getText(d,h);i=this.textView.getText();d=this.textView.getSelection();d.offset=h;this.getKeywords(this.prefix,i,d).then(function(j){this.proposals=[];for(var k=0;k<j.length;k++){var m=j[k];if(!(m===null||m===undefined))if(this.matchesPrefix(m)||this.matchesPrefix(m.proposal))this.proposals.push(m)}if(this.proposals.length===0)this.cancel();else{j=this.textView.getLocationAtOffset(h);
j.y+=this.textView.getLineHeight();this.contentAssistPanel.innerHTML="";for(k=0;k<this.proposals.length;k++)this.createDiv(this.getDisplayString(this.proposals[k]),k===0,this.contentAssistPanel);this.textView.convert(j,"document","page");this.contentAssistPanel.style.position="absolute";this.contentAssistPanel.style.left=j.x+"px";this.contentAssistPanel.style.top=j.y+"px";this.contentAssistPanel.style.display="block";this.contentAssistPanel.scrollTop=0;k=document.documentElement.clientWidth;if(j.y+
this.contentAssistPanel.offsetHeight>document.documentElement.clientHeight)this.contentAssistPanel.style.top=j.y-this.contentAssistPanel.offsetHeight-this.textView.getLineHeight()+"px";if(j.x+this.contentAssistPanel.offsetWidth>k)this.contentAssistPanel.style.left=k-this.contentAssistPanel.offsetWidth+"px";if(!this.listenerAdded){this.textView.addEventListener("ModelChanging",this.contentAssistListener.onModelChanging);this.textView.addEventListener("ModelChanged",this.contentAssistListener.onModelChanged);
this.textView.addEventListener("Scroll",this.contentAssistListener.onScroll);this.textView.addEventListener("MouseUp",this.contentAssistListener.onMouseUp)}this.listenerAdded=true;this.contentAssistPanel.onclick=this.click.bind(this);this.active=true}}.bind(this))}else{if(this.listenerAdded){this.textView.removeEventListener("ModelChanging",this.contentAssistListener.onModelChanging);this.textView.removeEventListener("ModelChanged",this.contentAssistListener.onModelChanged);this.textView.removeEventListener("Scroll",
this.contentAssistListener.onScroll);this.textView.removeEventListener("MouseUp",this.contentAssistListener.onMouseUp);this.listenerAdded=false}this.active=false;this.contentAssistPanel.style.display="none";this.contentAssistPanel.onclick=null}}},createDiv:function(d,g,h){var i=document.createElement("div");if(g)i.className="selected";d=document.createTextNode(d);i.appendChild(d,i);h.appendChild(i)},getDisplayString:function(d){if(typeof d==="string")return d;if(d.description&&typeof d.description===
"string")return d.description;return d.proposal},matchesPrefix:function(d){return typeof d==="string"&&d.substr(0,this.prefix.length)===this.prefix},getKeywords:function(d,g,h){function i(u){if(u)k=k.concat(u);++m===p.length&&n.done(k)}function j(){++m===p.length&&n.done(k)}for(var k=[],m=0,n=new this.Promise,p=this.filteredProviders,r=0;r<p.length;r++){var w=p[r],s=w.getKeywords;if(typeof w.computeProposals==="function")s=w.computeProposals;(w=s.apply(w,[d,g,h]))&&w.then?w.then(i,j):i(w)}return n},
Promise:function(){function d(){}d.prototype.then=function(g){this.callback=g;if(this.result){var h=this;setTimeout(function(){h.callback(h.result)},0)}};d.prototype.done=function(g){this.result=g;this.callback&&this.callback(this.result)};return d}(),setProviders:function(d){this.filteredProviders=d}};a.EventTarget.addMixin(c.prototype);return{ContentAssist:c}});
define("orion/textview/undoStack",[],function(){function f(c,d,g){this.offset=c;this.text=d;this.previousText=g}function e(){this.changes=[]}function a(c,d){this.view=c;this.size=d!==undefined?d:100;this.reset();d=c.getModel();if(d.getBaseModel)d=d.getBaseModel();this.model=d;var g=this;this._listener={onChanging:function(h){g._onChanging(h)},onDestroy:function(h){g._onDestroy(h)}};d.addEventListener("Changing",this._listener.onChanging);c.addEventListener("Destroy",this._listener.onDestroy)}f.prototype=
{undo:function(c,d){this._doUndoRedo(this.offset,this.previousText,this.text,c,d)},redo:function(c,d){this._doUndoRedo(this.offset,this.text,this.previousText,c,d)},_doUndoRedo:function(c,d,g,h,i){var j=h.getModel();if(j.mapOffset&&h.annotationModel){var k=j.mapOffset(c,true);if(k<0)for(var m=h.annotationModel.getAnnotations(c,c+1);m.hasNext();){var n=m.next();if(n.type==="orion.annotation.folding"){n.expand();k=j.mapOffset(c,true);break}}if(k<0)return;c=k}h.setText(d,c,c+g.length);i&&h.setSelection(c,
c+d.length)}};e.prototype={add:function(c){this.changes.push(c)},end:function(c){this.endSelection=c.getSelection();this.endCaret=c.getCaretOffset()},undo:function(c,d){for(var g=this.changes.length-1;g>=0;g--)this.changes[g].undo(c,false);if(d){d=this.startSelection.start;g=this.startSelection.end;c.setSelection(this.startCaret?d:g,this.startCaret?g:d)}},redo:function(c,d){for(var g=0;g<this.changes.length;g++)this.changes[g].redo(c,false);if(d){d=this.endSelection.start;g=this.endSelection.end;
c.setSelection(this.endCaret?d:g,this.endCaret?g:d)}},start:function(c){this.startSelection=c.getSelection();this.startCaret=c.getCaretOffset()}};a.prototype={add:function(c){if(this.compoundChange)this.compoundChange.add(c);else{this.stack.splice(this.index,this.stack.length-this.index,c);this.index++;if(this.stack.length>this.size){this.stack.shift();this.index--;this.cleanIndex--}}},markClean:function(){this.endCompoundChange();this._commitUndo();this.cleanIndex=this.index},isClean:function(){return this.cleanIndex===
this.getSize().undo},canUndo:function(){return this.getSize().undo>0},canRedo:function(){return this.getSize().redo>0},endCompoundChange:function(){this.compoundChange&&this.compoundChange.end(this.view);this.compoundChange=undefined},getSize:function(){var c=this.index,d=this.stack.length;this._undoStart!==undefined&&c++;return{undo:c,redo:d-c}},undo:function(){this._commitUndo();if(this.index<=0)return false;var c=this.stack[--this.index];this._ignoreUndo=true;c.undo(this.view,true);this._ignoreUndo=
false;return true},redo:function(){this._commitUndo();if(this.index>=this.stack.length)return false;var c=this.stack[this.index++];this._ignoreUndo=true;c.redo(this.view,true);this._ignoreUndo=false;return true},reset:function(){this.index=this.cleanIndex=0;this.stack=[];this._undoStart=undefined;this._undoText="";this._undoType=0;this._ignoreUndo=false;this._compoundChange=undefined},startCompoundChange:function(){this._commitUndo();var c=new e;this.add(c);this.compoundChange=c;this.compoundChange.start(this.view)},
_commitUndo:function(){if(this._undoStart!==undefined){this._undoType===-1?this.add(new f(this._undoStart,"",this._undoText)):this.add(new f(this._undoStart,this._undoText,""));this._undoStart=undefined;this._undoText="";this._undoType=0}},_onDestroy:function(){this.model.removeEventListener("Changing",this._listener.onChanging);this.view.removeEventListener("Destroy",this._listener.onDestroy)},_onChanging:function(c){var d=c.text,g=c.start,h=c.removedCharCount;c=c.addedCharCount;if(!this._ignoreUndo){if(this._undoStart!==
undefined&&!(c===1&&h===0&&this._undoType===1&&g===this._undoStart+this._undoText.length||c===0&&h===1&&this._undoType===-1&&(g+1===this._undoStart||g===this._undoStart)))this._commitUndo();if(!this.compoundChange)if(c===1&&h===0){if(this._undoStart===undefined)this._undoStart=g;this._undoText+=d;this._undoType=1;return}else if(c===0&&h===1){d=this._undoText.length>0&&this._undoStart===g;this._undoStart=g;this._undoType=-1;if(d)this._undoText+=this.model.getText(g,g+h);else this._undoText=this.model.getText(g,
g+h)+this._undoText;return}this.add(new f(g,d,this.model.getText(g,g+h)))}}};return{UndoStack:a}});
define("orion/editorCommands",["dojo","orion/commands","orion/globalCommands","orion/extensionCommands","orion/textview/keyBinding","orion/textview/undoStack"],function(f,e,a,c,d,g){var h={};h.EditorCommandFactory=function(){function i(j,k,m,n,p,r,w){this.serviceRegistry=j;this.commandService=k;this.fileClient=m;this.inputManager=n;this.toolbarId=p;this.pageNavId=w;this.isReadOnly=r}i.prototype={generateEditorCommands:function(j){function k(y){var B=new d.KeyBinding;d.KeyBinding.apply(B,y);return B}
if(!this.isReadOnly){j.getTextView().setKeyBinding(new d.KeyBinding("s",true),"Save");this.inputManager.onSave?j.getTextView().setAction("Save",f.hitch(this,function(){var y=j.getText();this.inputManager.onSave(this.inputManager.getInput(),y,f.hitch(this,function(){j.setInput(this.inputManager.getInput(),null,y,true);this.inputManager.afterSave&&this.inputManager.afterSave()}),f.hitch(this,function(B){B.log=true}));return true})):j.getTextView().setAction("Save",f.hitch(this,function(){var y=j.getText(),
B={ETag:this.inputManager.getFileMetadata().ETag};this.fileClient.write(this.inputManager.getInput(),y,B).then(f.hitch(this,function(D){this.inputManager.getFileMetadata().ETag=D.ETag;j.setInput(this.inputManager.getInput(),null,y,true);this.inputManager.afterSave&&this.inputManager.afterSave()}),f.hitch(this,function(D){if(D.status===412)confirm("Resource is out of sync with the server. Do you want to save it anyway?")&&this.fileClient.write(this.inputManager.getInput(),y).then(f.hitch(this,function(l){this.inputManager.getFileMetadata().ETag=
l.ETag;j.setInput(this.inputManager.getInput(),null,y,true);this.inputManager.afterSave&&this.inputManager.afterSave()}));else D.log=true}));return true}));this.commandService.addCommand(new e.Command({name:"Save",tooltip:"Save this file",id:"orion.save",callback:function(y){y.items.getTextView().invokeAction("Save")}}),"dom");this.commandService.addCommandGroup("orion.editorActions.unlabeled",200,null,null,this.toolbarId);this.commandService.registerCommandContribution("orion.save",1,this.toolbarId,
"orion.editorActions.unlabeled",false,new e.CommandKeyBinding("s",true));var m=new e.ParametersDescription([new e.CommandParameter("line","number","Line:")],false);this.commandService.addCommand(new e.Command({name:"Go to Line",tooltip:"Go to specified line number",id:"orion.gotoLine",parameters:m,callback:function(y){var B=j.getModel();if(y.parameters&&y.parameters.valueFor("line"))y=y.parameters.valueFor("line");else{y=B.getLineAtOffset(j.getCaretOffset());if(y=prompt("Go to line:",y+1))y=parseInt(y,
10)}y&&j.onGotoLine(y-1,0)}}),"dom");this.commandService.registerCommandContribution("orion.gotoLine",1,this.pageNavId,null,true,new e.CommandKeyBinding("l",true),new e.URLBinding("gotoLine","line"));j.getTextView().setKeyBinding(new d.KeyBinding("l",true),"gotoLine");j.getTextView().setAction("gotoLine",f.hitch(this,function(){this.commandService.runCommand("orion.gotoLine");return true}));this.commandService.addCommandGroup("orion.editorActions.contributed",101,null,null,this.toolbarId);m=this.serviceRegistry.getServiceReferences("orion.edit.command");
for(var n=this.inputManager,p=function(y,B,D){D.callback=f.hitch(j,function(l){j=l?l.items||this:this;var o=j.getSelection();l=j.getModel();var q=l.getText();B.run(l.getText(o.start,o.end),q,o,n.getInput()).then(function(v){if(v&&v.text){j.setText(v.text);if(v.selection){j.setSelection(v.selection.start,v.selection.end);j.getTextView().focus()}}else if(typeof v==="string"){j.setText(v,o.start,o.end);j.setSelection(o.start,o.start+v.length);j.getTextView().focus()}});return true});return new e.Command(D)},
r=0;r<m.length;r++){for(var w=this.serviceRegistry.getService(m[r]),s={},u=m[r].getPropertyNames(),t=0;t<u.length;t++)s[u[t]]=m[r].getProperty(u[t]);s.forceSingleItem=true;w=p(s,w,c._createCommandOptions(s,m[r],this.serviceRegistry,false,function(){return n.getFileMetadata()}));this.commandService.addCommand(w,"dom");this.commandService.registerCommandContribution(w.id,r,this.toolbarId,"orion.editorActions.contributed");a.generateDomCommandsInBanner(this.commandService,j);if(s.key){u=j.getTextView();
u.setKeyBinding(k(s.key),w.id);u.setAction(w.id,w.callback)}}}}};return i}();h.UndoCommandFactory=function(){function i(j,k,m){this.serviceRegistry=j;this.commandService=k;this.toolbarId=m}i.prototype={createUndoStack:function(j){var k=new g.UndoStack(j.getTextView(),200);j.getTextView().setKeyBinding(new d.KeyBinding("z",true),"Undo");j.getTextView().setAction("Undo",function(){k.undo();return true});this.commandService.addCommand(new e.Command({name:"Undo",id:"orion.undo",callback:function(n){n.items.getTextView().invokeAction("Undo")}}),
"dom");var m=navigator.platform.indexOf("Mac")!==-1?new d.KeyBinding("z",true,true):new d.KeyBinding("y",true);j.getTextView().setKeyBinding(m,"Redo");j.getTextView().setAction("Redo",function(){k.redo();return true});this.commandService.addCommand(new e.Command({name:"Redo",id:"orion.redo",callback:function(n){n.items.getTextView().invokeAction("Redo")}}),"dom");this.commandService.registerCommandContribution("orion.undo",400,this.toolbarId,"orion.editorActions.unlabeled",true,new e.CommandKeyBinding("z",
true));this.commandService.registerCommandContribution("orion.redo",401,this.toolbarId,"orion.editorActions.unlabeled",true,m);return k}};return i}();return h});define("orion/textview/nls/messages",{root:{multipleAnnotations:"Multiple annotations:",line:"Line: {0}",matchingBracket:"Matching Bracket",currentBracket:"Current Bracket",formatMessage:function(f){var e=arguments;return f.replace(/\{([^\}]+)\}/g,function(a,c){return e[(c<<0)+1]})}},"pt-br":true,"fr-fr":true});
define("orion/textview/textModel",["orion/textview/eventTarget"],function(f){function e(c,d){this._lastLineIndex=-1;this._text=[""];this._lineOffsets=[0];this.setText(c);this.setLineDelimiter(d)}var a=window.navigator.platform.indexOf("Win")!==-1;e.prototype={getCharCount:function(){for(var c=0,d=0;d<this._text.length;d++)c+=this._text[d].length;return c},getLine:function(c,d){var g=this.getLineCount();if(!(0<=c&&c<g))return null;var h=this._lineOffsets[c];if(c+1<g){c=this.getText(h,this._lineOffsets[c+
1]);if(d)return c;d=c.length;for(var i;(i=c.charCodeAt(d-1))===10||i===13;)d--;return c.substring(0,d)}else return this.getText(h)},getLineAtOffset:function(c){var d=this.getCharCount();if(!(0<=c&&c<=d))return-1;var g=this.getLineCount();if(c===d)return g-1;var h,i,j=this._lastLineIndex;if(0<=j&&j<g){h=this._lineOffsets[j];i=j+1<g?this._lineOffsets[j+1]:d;if(h<=c&&c<i)return j}for(var k=g,m=-1;k-m>1;){j=Math.floor((k+m)/2);h=this._lineOffsets[j];i=j+1<g?this._lineOffsets[j+1]:d;if(c<=h)k=j;else if(c<
i){k=j;break}else m=j}return this._lastLineIndex=k},getLineCount:function(){return this._lineOffsets.length},getLineDelimiter:function(){return this._lineDelimiter},getLineEnd:function(c,d){var g=this.getLineCount();if(!(0<=c&&c<g))return-1;if(c+1<g){g=this._lineOffsets[c+1];if(d)return g;c=this.getText(Math.max(this._lineOffsets[c],g-2),g);d=c.length;for(var h;(h=c.charCodeAt(d-1))===10||h===13;)d--;return g-(c.length-d)}else return this.getCharCount()},getLineStart:function(c){if(!(0<=c&&c<this.getLineCount()))return-1;
return this._lineOffsets[c]},getText:function(c,d){if(c===undefined)c=0;if(d===undefined)d=this.getCharCount();if(c===d)return"";for(var g=0,h=0,i;h<this._text.length;){i=this._text[h].length;if(c<=g+i)break;g+=i;h++}for(var j=g,k=h;h<this._text.length;){i=this._text[h].length;if(d<=g+i)break;g+=i;h++}g=g;h=h;if(k===h)return this._text[k].substring(c-j,d-g);c=this._text[k].substring(c-j);d=this._text[h].substring(0,d-g);return c+this._text.slice(k+1,h).join("")+d},onChanging:function(c){return this.dispatchEvent(c)},
onChanged:function(c){return this.dispatchEvent(c)},setLineDelimiter:function(c){if(c==="auto"){c=undefined;if(this.getLineCount()>1)c=this.getText(this.getLineEnd(0),this.getLineEnd(0,true))}this._lineDelimiter=c?c:a?"\r\n":"\n"},setText:function(c,d,g){if(c===undefined)c="";if(d===undefined)d=0;if(g===undefined)g=this.getCharCount();if(!(d===g&&c==="")){for(var h=this.getLineAtOffset(d),i=this.getLineAtOffset(g),j=d,k=g-d,m=i-h,n=c.length,p=0,r=this.getLineCount(),w=0,s=0,u=0,t=[];;){if(w!==-1&&
w<=u)w=c.indexOf("\r",u);if(s!==-1&&s<=u)s=c.indexOf("\n",u);if(s===-1&&w===-1)break;u=w!==-1&&s!==-1?w+1===s?s+1:(w<s?w:s)+1:w!==-1?w+1:s+1;t.push(d+u);p++}this.onChanging({type:"Changing",text:c,start:j,removedCharCount:k,addedCharCount:n,removedLineCount:m,addedLineCount:p});if(t.length===0){w=this.getLineStart(h);i=i+1<r?this.getLineStart(i+1):this.getCharCount();if(d!==w){c=this.getText(w,d)+c;d=w}if(g!==i){c+=this.getText(g,i);g=i}}i=n-k;for(w=h+m+1;w<r;w++)this._lineOffsets[w]+=i;h=[h+1,m].concat(t);
Array.prototype.splice.apply(this._lineOffsets,h);for(i=t=0;i<this._text.length;){w=this._text[i].length;if(d<=t+w)break;t+=w;i++}r=t;for(h=i;i<this._text.length;){w=this._text[i].length;if(g<=t+w)break;t+=w;i++}t=t;i=i;w=this._text[i];d=this._text[h].substring(0,d-r);g=w.substring(g-t);h=[h,i-h+1];d&&h.push(d);c&&h.push(c);g&&h.push(g);Array.prototype.splice.apply(this._text,h);if(this._text.length===0)this._text=[""];this.onChanged({type:"Changed",start:j,removedCharCount:k,addedCharCount:n,removedLineCount:m,
addedLineCount:p})}}};f.EventTarget.addMixin(e.prototype);return{TextModel:e}});
define("orion/textview/textView",["orion/textview/textModel","orion/textview/keyBinding","orion/textview/eventTarget"],function(f,e,a){function c(l,o,q,v){typeof l.addEventListener==="function"?l.addEventListener(o,q,v===true):l.attachEvent("on"+o,q)}function d(l,o,q,v){typeof l.removeEventListener==="function"?l.removeEventListener(o,q,v===true):l.detachEvent("on"+o,q)}function g(l,o,q){this.start=l;this.end=o;this.caret=q}function h(l){this._init(l)}var i=navigator.userAgent,j;if(document.selection&&
window.ActiveXObject&&/MSIE/.test(i))j=document.documentMode?document.documentMode:7;var k=parseFloat(i.split("Firefox/")[1]||i.split("Minefield/")[1])||undefined,m=i.indexOf("Opera")!==-1,n=i.indexOf("Chrome")!==-1,p=i.indexOf("Safari")!==-1&&!n,r=i.indexOf("WebKit")!==-1,w=i.indexOf("iPad")!==-1,s=navigator.platform.indexOf("Mac")!==-1,u=navigator.platform.indexOf("Win")!==-1,t=navigator.platform.indexOf("Linux")!==-1,y=typeof window.document.documentElement.addEventListener==="function",B=(!j||
j>=9)&&typeof window.document.createRange().getBoundingClientRect==="function",D=u?"\r\n":"\n";g.prototype={clone:function(){return new g(this.start,this.end,this.caret)},collapse:function(){if(this.caret)this.end=this.start;else this.start=this.end},extend:function(l){if(this.caret)this.start=l;else this.end=l;if(this.start>this.end){l=this.start;this.start=this.end;this.end=l;this.caret=!this.caret}},setCaret:function(l){this.end=this.start=l;this.caret=false},getCaret:function(){return this.caret?
this.start:this.end},toString:function(){return"start="+this.start+" end="+this.end+(this.caret?" caret is at start":" caret is at end")},isEmpty:function(){return this.start===this.end},equals:function(l){return this.caret===l.caret&&this.start===l.start&&this.end===l.end}};h.prototype={addRuler:function(l){this._rulers.push(l);l.setView(this);this._createRuler(l);this._updatePage()},computeSize:function(){var l=0,o=0,q=this._model,v=this._clientDiv;if(!v)return{width:l,height:o};var x=v.style.width;
if(r)v.style.width=(524287).toString()+"px";for(var z=q.getLineCount(),C=this._frameDocument,A=0;A<z;A++){var F=this._getLineNode(A),H=null;if(!F||F.lineChanged||F.lineRemoved)F=H=this._createLine(v,null,C,A,q);F=this._getLineBoundingClientRect(F);l=Math.max(l,F.right-F.left);o+=F.bottom-F.top;H&&v.removeChild(H)}if(r)v.style.width=x;q=this._getViewPadding();l+=q.right-q.left;o+=q.bottom-q.top;return{width:l,height:o}},convert:function(l,o,q){if(this._clientDiv){var v=this._getScroll(),x=this._getViewPadding(),
z=this._frame.getBoundingClientRect(),C=this._viewDiv.getBoundingClientRect();switch(o){case "document":if(l.x!==undefined)l.x+=-v.x+C.left+x.left;if(l.y!==undefined)l.y+=-v.y+C.top+x.top;break;case "page":if(l.x!==undefined)l.x+=-z.left;if(l.y!==undefined)l.y+=-z.top;break}switch(q){case "document":if(l.x!==undefined)l.x+=v.x-C.left-x.left;if(l.y!==undefined)l.y+=v.y-C.top-x.top;break;case "page":if(l.x!==undefined)l.x+=z.left;if(l.y!==undefined)l.y+=z.top;break}return l}},destroy:function(){for(var l=
0;l<this._rulers.length;l++)this._rulers[l].setView(null);this.rulers=null;this._destroyFrame();this.onDestroy({type:"Destroy"});this._actions=this._keyBindings=this._doubleClickSelection=this._selection=this._model=this._parentDocument=this._parent=null},focus:function(){if(this._clientDiv){this._updateDOMSelection();if(w)this._textArea.focus();else{m&&this._clientDiv.blur();this._clientDiv.focus()}this._updateDOMSelection()}},hasFocus:function(){return this._hasFocus},getActions:function(l){for(var o=
[],q=this._actions,v=0;v<q.length;v++)!l&&q[v].defaultHandler||o.push(q[v].name);return o},getBottomIndex:function(l){if(!this._clientDiv)return 0;return this._getBottomIndex(l)},getBottomPixel:function(){if(!this._clientDiv)return 0;return 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 l=this._getScroll();return{x:l.x,y:l.y,width:this._getClientWidth(),
height:this._getClientHeight()}},getHorizontalPixel:function(){if(!this._clientDiv)return 0;return this._getScroll().x},getKeyBindings:function(l){for(var o=[],q=this._keyBindings,v=0;v<q.length;v++)q[v].name===l&&o.push(q[v].keyBinding);return o},getLineHeight:function(){if(!this._clientDiv)return 0;return this._getLineHeight()},getLinePixel:function(l){if(!this._clientDiv)return 0;l=Math.min(Math.max(0,l),this._model.getLineCount());return this._getLineHeight()*l},getLocationAtOffset:function(l){if(!this._clientDiv)return{x:0,
y:0};var o=this._model;l=Math.min(Math.max(0,l),o.getCharCount());o=o.getLineAtOffset(l);var q=this._getScroll(),v=this._viewDiv.getBoundingClientRect(),x=this._getViewPadding();l=this._getOffsetToX(l)+q.x-v.left-x.left;o=this.getLinePixel(o);return{x:l,y:o}},getOptions:function(){var l;if(arguments.length===0)l=this._defaultOptions();else if(arguments.length===1){l=arguments[0];if(typeof l==="string")return this._clone(this["_"+l]);l=l}else{l={};for(var o in arguments)if(arguments.hasOwnProperty(o))l[arguments[o]]=
undefined}for(var q in l)if(l.hasOwnProperty(q))l[q]=this._clone(this["_"+q]);return l},getModel:function(){return this._model},getOffsetAtLocation:function(l,o){if(!this._clientDiv)return 0;var q=this._getScroll(),v=this._viewDiv.getBoundingClientRect(),x=this._getViewPadding();o=this._getYToLine(o-q.y);l+=-q.x+v.left+x.left;return this._getXToOffset(o,l)},getRulers:function(){return this._rulers.slice(0)},getSelection:function(){var l=this._getSelection();return{start:l.start,end:l.end}},getText:function(l,
o){return this._model.getText(l,o)},getTopIndex:function(l){if(!this._clientDiv)return 0;return this._getTopIndex(l)},getTopPixel:function(){if(!this._clientDiv)return 0;return this._getScroll().y},invokeAction:function(l,o){if(this._clientDiv){for(var q=this._actions,v=0;v<q.length;v++){var x=q[v];if(x.name&&x.name===l){if(!o&&x.userHandler)if(x.userHandler())return;if(x.defaultHandler)return x.defaultHandler();return false}}return false}},isLoaded:function(){return!!this._clientDiv},onContextMenu:function(l){return this.dispatchEvent(l)},
onDragStart:function(l){return this.dispatchEvent(l)},onDrag:function(l){return this.dispatchEvent(l)},onDragEnd:function(l){return this.dispatchEvent(l)},onDragEnter:function(l){return this.dispatchEvent(l)},onDragOver:function(l){return this.dispatchEvent(l)},onDragLeave:function(l){return this.dispatchEvent(l)},onDrop:function(l){return this.dispatchEvent(l)},onDestroy:function(l){return this.dispatchEvent(l)},onLineStyle:function(l){return this.dispatchEvent(l)},onLoad:function(l){return this.dispatchEvent(l)},
onModelChanged:function(l){return this.dispatchEvent(l)},onModelChanging:function(l){return this.dispatchEvent(l)},onModify:function(l){return this.dispatchEvent(l)},onMouseDown:function(l){return this.dispatchEvent(l)},onMouseUp:function(l){return this.dispatchEvent(l)},onMouseMove:function(l){return this.dispatchEvent(l)},onMouseOver:function(l){return this.dispatchEvent(l)},onMouseOut:function(l){return this.dispatchEvent(l)},onSelection:function(l){return this.dispatchEvent(l)},onScroll:function(l){return this.dispatchEvent(l)},
onVerify:function(l){return this.dispatchEvent(l)},onUnload:function(l){return this.dispatchEvent(l)},onFocus:function(l){return this.dispatchEvent(l)},onBlur:function(l){return this.dispatchEvent(l)},redraw:function(){if(!(this._redrawCount>0)){for(var l=this._model.getLineCount(),o=this.getRulers(),q=0;q<o.length;q++)this.redrawLines(0,l,o[q]);this.redrawLines(0,l)}},redrawLines:function(l,o,q){if(!(this._redrawCount>0)){if(l===undefined)l=0;if(o===undefined)o=this._model.getLineCount();if(l!==
o){var v=this._clientDiv;if(v){if(q)for(var x=(q.getLocation()==="left"?this._leftDiv:this._rightDiv).firstChild.rows[0].cells,z=0;z<x.length;z++)if(x[z].firstChild._ruler===q){v=x[z].firstChild;break}if(q)v.rulerChanged=true;if(!q||q.getOverview()==="page")for(v=v.firstChild;v;){x=v.lineIndex;if(l<=x&&x<o)v.lineChanged=true;v=v.nextSibling}if(!q)if(l<=this._maxLineIndex&&this._maxLineIndex<o){this._checkMaxLineIndex=this._maxLineIndex;this._maxLineIndex=-1;this._maxLineWidth=0}this._queueUpdatePage()}}}},
redrawRange:function(l,o){if(!(this._redrawCount>0)){var q=this._model;if(l===undefined)l=0;if(o===undefined)o=q.getCharCount();var v=q.getLineAtOffset(l);l=q.getLineAtOffset(Math.max(l,o-1))+1;this.redrawLines(v,l)}},removeRuler:function(l){for(var o=this._rulers,q=0;q<o.length;q++)if(o[q]===l){o.splice(q,1);l.setView(null);this._destroyRuler(l);this._updatePage();break}},setAction:function(l,o){if(l){for(var q=this._actions,v=0;v<q.length;v++){var x=q[v];if(x.name===l){x.userHandler=o;return}}q.push({name:l,
userHandler:o})}},setKeyBinding:function(l,o){for(var q=this._keyBindings,v=0;v<q.length;v++){var x=q[v];if(x.keyBinding.equals(l)){if(o)x.name=o;else if(x.predefined)x.name=null;else{l=x.name;q.splice(v,1);for(v=0;v<q.length&&l!==q[v].name;)v++;if(v===q.length){q=this._actions;for(v=0;v<q.length;v++)if(q[v].name===l)q[v].defaultHandler||q.splice(v,1)}}return}}o&&q.push({keyBinding:l,name:o})},setCaretOffset:function(l,o){var q=this._model.getCharCount();l=Math.max(0,Math.min(l,q));this._setSelection(new g(l,
l,false),o===undefined||o)},setHorizontalPixel:function(l){if(this._clientDiv){l=Math.max(0,l);this._scrollView(l-this._getScroll().x,0)}},setRedraw:function(l){if(l)--this._redrawCount===0&&this.redraw();else this._redrawCount++},setModel:function(l){if(l)if(l!==this._model){this._model.removeEventListener("Changing",this._modelListener.onChanging);this._model.removeEventListener("Changed",this._modelListener.onChanged);var o=this._model.getLineCount(),q=this._model.getCharCount(),v=l.getLineCount(),
x=l.getCharCount(),z={type:"ModelChanging",text:l.getText(),start:0,removedCharCount:q,addedCharCount:x,removedLineCount:o,addedLineCount:v};this.onModelChanging(z);this._model=l;z={type:"ModelChanged",start:0,removedCharCount:q,addedCharCount:x,removedLineCount:o,addedLineCount:v};this.onModelChanged(z);this._model.addEventListener("Changing",this._modelListener.onChanging);this._model.addEventListener("Changed",this._modelListener.onChanged);this._reset();this._updatePage()}},setOptions:function(l){var o=
this._defaultOptions(),q=false,v,x=this._clientDiv;if(x)for(v in l)if(l.hasOwnProperty(v))if(o[v].recreate){q=true;break}var z=false;for(v in l)if(l.hasOwnProperty(v)){var C=l[v];if(!this._compare(this["_"+v],C)){z=true;if(!q){var A=o[v].update;if(x&&A){if(A.call(this,C))q=true;continue}}this["_"+v]=this._clone(C)}}if(z)if(q){this._frame.parentNode.removeChild(this._frame);this._parent.appendChild(this._frame)}},setSelection:function(l,o,q){var v=l>o;if(v){var x=l;l=o;o=x}x=this._model.getCharCount();
l=Math.max(0,Math.min(l,x));o=Math.max(0,Math.min(o,x));this._setSelection(new g(l,o,v),q===undefined||q)},setText:function(l,o,q){var v=o===undefined&&q===undefined;if(o===undefined)o=0;if(q===undefined)q=this._model.getCharCount();this._modifyContent({text:l,start:o,end:q,_code:true},!v);if(v){this._columnX=-1;this._setSelection(new g(0,0,false),true);k&&this._fixCaret()}},setTopIndex:function(l){if(this._clientDiv){var o=this._model;if(o.getCharCount()!==0){o=o.getLineCount();var q=this._getLineHeight(),
v=Math.max(1,Math.min(o,Math.floor(this._getClientHeight()/q)));if(l<0)l=0;else if(l>o-v)l=o-v;this._scrollView(0,l*q-this._getScroll().y)}}},setTopPixel:function(l){if(this._clientDiv){var o=this._getLineHeight(),q=this._getClientHeight(),v=this._model.getLineCount();l=Math.min(Math.max(0,l),o*v-q);this._scrollView(0,l-this._getScroll().y)}},showSelection:function(){return this._showCaret(true)},_handleBodyMouseDown:function(l){if(!l)l=window.event;if(k&&l.which===1){this._clientDiv.contentEditable=
false;this._ignoreBlur=(this._overlayDiv||this._clientDiv).draggable=true}for(var o=m||k&&!this._overlayDiv?this._clientDiv:this._overlayDiv||this._viewDiv,q=l.target?l.target:l.srcElement;q;){if(o===q)return;q=q.parentNode}l.preventDefault&&l.preventDefault();l.stopPropagation&&l.stopPropagation();if(!y){o.setCapture();setTimeout(function(){o.releaseCapture()},0)}},_handleBodyMouseUp:function(l){if(!l)l=window.event;if(k&&l.which===1){this._clientDiv.contentEditable=true;(this._overlayDiv||this._clientDiv).draggable=
false;this._fixCaret();this._ignoreBlur=false}},_handleBlur:function(){if(!this._ignoreBlur){this._hasFocus=false;if(j<9)if(!this._getSelection().isEmpty()){var l=this._frameDocument,o=l.createElement("DIV");l=l.body;l.appendChild(o);l.removeChild(o)}if(k||j)if(this._selDiv1){o=j?"transparent":"#AFAFAF";this._selDiv1.style.background=o;this._selDiv2.style.background=o;this._selDiv3.style.background=o}this._ignoreFocus||this.onBlur({type:"Blur"})}},_handleContextMenu:function(l){if(!l)l=window.event;
k&&this._lastMouseButton===3&&l.timeStamp-this._lastMouseTime<=this._clickTime&&this._updateDOMSelection();if(this.isListening("ContextMenu")){var o=this._createMouseEvent("ContextMenu",l);o.screenX=l.screenX;o.screenY=l.screenY;this.onContextMenu(o)}l.preventDefault&&l.preventDefault();return false},_handleCopy:function(l){if(!this._ignoreCopy){if(!l)l=window.event;if(this._doCopy(l)){l.preventDefault&&l.preventDefault();return false}}},_handleCut:function(l){if(!l)l=window.event;if(this._doCut(l)){l.preventDefault&&
l.preventDefault();return false}},_handleDOMAttrModified:function(l){if(!l)l=window.event;for(var o=false,q=this._parent;q;){if(q===l.target){o=true;break}q=q.parentNode}if(o){l=this._getVisible();if(l==="visible")this._createView();else l==="hidden"&&this._destroyView()}},_handleDataModified:function(){this._startIME()},_handleDblclick:function(l){if(!l)l=window.event;this._lastMouseTime=l.timeStamp?l.timeStamp:(new Date).getTime();if(this._clickCount!==2){this._clickCount=2;this._handleMouse(l)}},
_handleDragStart:function(l){if(!l)l=window.event;if(k){var o=this;setTimeout(function(){o._clientDiv.contentEditable=true;o._clientDiv.draggable=false;o._ignoreBlur=false},0)}if(this.isListening("DragStart")&&this._dragOffset!==-1){this._isMouseDown=false;this.onDragStart(this._createMouseEvent("DragStart",l));this._dragOffset=-1}else{l.preventDefault&&l.preventDefault();return false}},_handleDrag:function(l){if(!l)l=window.event;this.isListening("Drag")&&this.onDrag(this._createMouseEvent("Drag",
l))},_handleDragEnd:function(l){if(!l)l=window.event;this._dropTarget=false;this._dragOffset=-1;this.isListening("DragEnd")&&this.onDragEnd(this._createMouseEvent("DragEnd",l));if(k){this._fixCaret();l.dataTransfer.dropEffect==="none"&&!l.dataTransfer.mozUserCancelled&&this._fixCaret()}},_handleDragEnter:function(l){if(!l)l=window.event;var o=true;this._dropTarget=true;if(this.isListening("DragEnter")){o=false;this.onDragEnter(this._createMouseEvent("DragEnter",l))}if(r||o){l.preventDefault&&l.preventDefault();
return false}},_handleDragOver:function(l){if(!l)l=window.event;var o=true;if(this.isListening("DragOver")){o=false;this.onDragOver(this._createMouseEvent("DragOver",l))}if(r||o){if(o)l.dataTransfer.dropEffect="none";l.preventDefault&&l.preventDefault();return false}},_handleDragLeave:function(l){if(!l)l=window.event;this._dropTarget=false;this.isListening("DragLeave")&&this.onDragLeave(this._createMouseEvent("DragLeave",l))},_handleDrop:function(l){if(!l)l=window.event;this._dropTarget=false;this.isListening("Drop")&&
this.onDrop(this._createMouseEvent("Drop",l));l.preventDefault&&l.preventDefault();return false},_handleDocFocus:function(){this._clientDiv.focus()},_handleFocus:function(){this._hasFocus=true;j&&this._updateDOMSelection();if(k||j)if(this._selDiv1){var l=this._hightlightRGB;this._selDiv1.style.background=l;this._selDiv2.style.background=l;this._selDiv3.style.background=l}this._ignoreFocus||this.onFocus({type:"Focus"})},_handleKeyDown:function(l){if(!l)l=window.event;if(w){if(l.keyCode===8){this._doBackspace({});
l.preventDefault()}}else{switch(l.keyCode){case 16:case 17:case 18:case 91:break;default:this._setLinksVisible(false)}if(l.keyCode===229){if(this._readonly){l.preventDefault&&l.preventDefault();return false}var o=true;if(p&&s)if(l.ctrlKey)o=false;o&&this._startIME()}else this._commitIME();if((s||t)&&k<4||m){this._keyDownEvent=l;return true}if(this._doAction(l)){if(l.preventDefault)l.preventDefault();else{l.cancelBubble=true;l.returnValue=false;l.keyCode=0}return false}}},_handleKeyPress:function(l){if(!l)l=
window.event;if(s&&r)if(63232<=l.keyCode&&l.keyCode<=63487||l.keyCode===13||l.keyCode===8){l.preventDefault&&l.preventDefault();return false}if((s||t)&&k<4||m)if(this._doAction(this._keyDownEvent)){l.preventDefault&&l.preventDefault();return false}var o=s?l.metaKey:l.ctrlKey;if(l.charCode!==undefined)if(o)switch(l.charCode){case 99:case 118:case 120:return true}o=false;if(s){if(l.ctrlKey||l.metaKey)o=true}else if(k){if(l.ctrlKey||l.altKey)o=true}else if(l.ctrlKey^l.altKey)o=true;if(!o){o=m?l.which:
l.charCode!==undefined?l.charCode:l.keyCode;if(o>31){this._doContent(String.fromCharCode(o));l.preventDefault&&l.preventDefault();return false}}},_handleKeyUp:function(l){if(!l)l=window.event;(s?l.metaKey:l.ctrlKey)||this._setLinksVisible(false);l.keyCode===13&&this._commitIME()},_handleLinkClick:function(l){if(!l)l=window.event;if(!(s?l.metaKey:l.ctrlKey)){l.preventDefault&&l.preventDefault();return false}},_handleLoad:function(){var l=this._getVisible();if(l==="visible"||l==="hidden"&&r)this._createView()},
_handleMouse:function(l){var o=true,q=this._frameWindow;if(j||k&&!this._overlayDiv)q=this._clientDiv;if(this._overlayDiv){if(this._hasFocus)this._ignoreFocus=true;var v=this;setTimeout(function(){v.focus();v._ignoreFocus=false},0)}if(this._clickCount===1)(o=this._setSelectionTo(l.clientX,l.clientY,l.shiftKey,!m&&this.isListening("DragStart")))&&this._setGrab(q);else{y&&this._setGrab(q);this._doubleClickSelection=null;this._setSelectionTo(l.clientX,l.clientY,l.shiftKey);this._doubleClickSelection=
this._getSelection()}return o},_handleMouseDown:function(l){if(!l)l=window.event;this.isListening("MouseDown")&&this.onMouseDown(this._createMouseEvent("MouseDown",l));if(this._linksVisible)if((l.target||l.srcElement).tagName!=="A")this._setLinksVisible(false);else return;this._commitIME();var o=l.which;if(!o){if(l.button===4)o=2;if(l.button===2)o=3;if(l.button===1)o=1}var q=o!==2&&l.timeStamp?l.timeStamp:(new Date).getTime(),v=q-this._lastMouseTime,x=Math.abs(this._lastMouseX-l.clientX),z=Math.abs(this._lastMouseY-
l.clientY),C=this._lastMouseButton===o;this._lastMouseX=l.clientX;this._lastMouseY=l.clientY;this._lastMouseTime=q;this._lastMouseButton=o;if(o===1){this._isMouseDown=true;if(C&&v<=this._clickTime&&x<=this._clickDist&&z<=this._clickDist)this._clickCount++;else this._clickCount=1;if(this._handleMouse(l)&&(m||n||k&&!this._overlayDiv)){this._hasFocus||this.focus();l.preventDefault()}}},_handleMouseOver:function(l){if(!l)l=window.event;this.isListening("MouseOver")&&this.onMouseOver(this._createMouseEvent("MouseOver",
l))},_handleMouseOut:function(l){if(!l)l=window.event;this.isListening("MouseOut")&&this.onMouseOut(this._createMouseEvent("MouseOut",l))},_handleMouseMove:function(l){if(!l)l=window.event;if(this.isListening("MouseMove"))for(var o=this._overlayDiv||this._clientDiv,q=l.target?l.target:l.srcElement;q;){if(o===q){this.onMouseMove(this._createMouseEvent("MouseMove",l));break}q=q.parentNode}if(!this._dropTarget){o=this._linksVisible||this._lastMouseMoveX!==l.clientX||this._lastMouseMoveY!==l.clientY;
this._lastMouseMoveX=l.clientX;this._lastMouseMoveY=l.clientY;this._setLinksVisible(o&&!this._isMouseDown&&(s?l.metaKey:l.ctrlKey));if(!y){if(l.button===0){this._setGrab(null);return true}if(!this._isMouseDown&&l.button===1&&(this._clickCount&1)!==0){this._clickCount=2;return this._handleMouse(l,this._clickCount)}}if(!(!this._isMouseDown||this._dragOffset!==-1)){o=l.clientX;q=l.clientY;if(n)if(l.currentTarget!==this._frameWindow){l=this._frame.getBoundingClientRect();o-=l.left;q-=l.top}var v=this._getViewPadding(),
x=this._viewDiv.getBoundingClientRect(),z=this._getClientWidth(),C=this._getClientHeight();l=x.left+v.left;var A=x.top+v.top;z=x.left+v.left+z;v=x.top+v.top+C;x=this._model;C=x.getLineAtOffset(this._getSelection().getCaret());if(q<A&&C!==0)this._doAutoScroll("up",o,q-A);else if(q>v&&C!==x.getLineCount()-1)this._doAutoScroll("down",o,q-v);else if(o<l)this._doAutoScroll("left",o-l,q);else if(o>z)this._doAutoScroll("right",o-z,q);else{this._endAutoScroll();this._setSelectionTo(o,q,true);j&&this._frameDocument.body.getBoundingClientRect()}}}},
_createMouseEvent:function(l,o){var q=this._getScroll(),v=this._viewDiv.getBoundingClientRect(),x=this._getViewPadding();return{type:l,event:o,x:o.clientX+q.x-v.left-x.left,y:o.clientY+q.y-v.top}},_handleMouseUp:function(l){if(!l)l=window.event;this.isListening("MouseUp")&&this.onMouseUp(this._createMouseEvent("MouseUp",l));if(!this._linksVisible)if(l.which?l.button===0:l.button===1){if(this._dragOffset!==-1){var o=this._getSelection();o.extend(this._dragOffset);o.collapse();this._setSelection(o,
true,true);this._dragOffset=-1}this._isMouseDown=false;this._endAutoScroll();y&&this._setGrab(null);k&&l.preventDefault()}},_handleMouseWheel:function(l){if(!l)l=window.event;var o=this._getLineHeight(),q=0,v=0;if(k){o=s?l.detail*3:Math.max(-256,Math.min(256,l.detail))*o;if(l.axis===l.HORIZONTAL_AXIS)q=o;else v=o}else if(s){v=q=40;if(l.wheelDeltaX%120!==0)q=1;if(l.wheelDeltaY%120!==0)v=1;q=-l.wheelDeltaX/q;if(-1<q&&q<0)q=-1;if(0<q&&q<1)q=1;v=-l.wheelDeltaY/v;if(-1<v&&v<0)v=-1;if(0<v&&v<1)v=1}else{q=
-l.wheelDeltaX;v=-l.wheelDeltaY/120*8*o}if(p){for(o=l.target;o&&o.lineIndex===undefined;)o=o.parentNode;this._mouseWheelLine=o}o=this._getScroll();this._scrollView(q,v);q=this._getScroll();if(p)this._mouseWheelLine=null;if(o.x!==q.x||o.y!==q.y){l.preventDefault&&l.preventDefault();return false}},_handlePaste:function(l){if(!this._ignorePaste){if(!l)l=window.event;if(this._doPaste(l)){if(j){var o=this;this._ignoreFocus=true;setTimeout(function(){o._updateDOMSelection();this._ignoreFocus=false},0)}l.preventDefault&&
l.preventDefault();return false}}},_handleResize:function(){var l=this._frameDocument.documentElement,o=l.clientWidth;l=l.clientHeight;if(this._frameWidth!==o||this._frameHeight!==l){this._frameWidth=o;this._frameHeight=l;j<9?this._queueUpdatePage():this._updatePage()}},_handleRulerEvent:function(l){if(!l)l=window.event;var o=l.target?l.target:l.srcElement,q=o.lineIndex;for(o=o;o&&!o._ruler;){if(q===undefined&&o.lineIndex!==undefined)q=o.lineIndex;o=o.parentNode}o=o?o._ruler:null;if(q===undefined&&
o&&o.getOverview()==="document"){q=w?0:17;var v=this._getClientHeight(),x=this._model.getLineCount(),z=this._getViewPadding();q=Math.floor((l.clientY-q)*x/(v+z.top+z.bottom-2*q));0<=q&&q<x||(q=undefined)}if(o)switch(l.type){case "click":o.onClick&&o.onClick(q,l);break;case "dblclick":o.onDblClick&&o.onDblClick(q,l);break;case "mousemove":o.onMouseMove&&o.onMouseMove(q,l);break;case "mouseover":o.onMouseOver&&o.onMouseOver(q,l);break;case "mouseout":o.onMouseOut&&o.onMouseOut(q,l);break}},_handleScroll:function(){var l=
this._getScroll(),o=this._hScroll,q=this._vScroll;if(o!==l.x||q!==l.y){this._hScroll=l.x;this._vScroll=l.y;this._commitIME();this._updatePage(q===l.y);this.onScroll({type:"Scroll",oldValue:{x:o,y:q},newValue:l})}},_handleSelectStart:function(l){if(!l)l=window.event;if(this._ignoreSelect){l&&l.preventDefault&&l.preventDefault();return false}},_handleUnload:function(){this._frameLoaded=false;this._destroyView()},_handleInput:function(l){var o=this._textArea;this._doContent(o.value);o.selectionStart=
o.selectionEnd=0;o.value="";l.preventDefault()},_handleTextInput:function(l){this._doContent(l.data);l.preventDefault()},_touchConvert:function(l){var o=this._frame.getBoundingClientRect(),q=this._parentDocument.body;return{left:l.clientX-o.left-q.scrollLeft,top:l.clientY-o.top-q.scrollTop}},_handleTextAreaClick:function(l){l=this._touchConvert(l);this._clickCount=1;this._ignoreDOMSelection=false;this._setSelectionTo(l.left,l.top,false);this._textArea.focus()},_handleTouchStart:function(l){var o=
l.touches,q,v;this._touchMoved=false;this._touchStartScroll=undefined;if(o.length===1){q=o[0];v=q.pageY;this._touchStartX=q.pageX;this._touchStartY=v;this._touchStartTime=l.timeStamp;this._touchStartScroll=this._getScroll();l=this._getSelection();v=this._touchConvert(o[0]);this._touchGesture="none";if(!l.isEmpty())if(this._hitOffset(l.end,v.left,v.top))this._touchGesture="extendEnd";else if(this._hitOffset(l.start,v.left,v.top))this._touchGesture="extendStart";if(this._touchGesture==="none"){o=this._textArea;
o.value="";o.style.left="-1000px";o.style.top="-1000px";o.style.width="3000px";o.style.height="3000px"}}else if(o.length===2){this._touchGesture="select";if(this._touchTimeout){clearTimeout(this._touchTimeout);this._touchTimeout=null}v=this._touchConvert(o[0]);q=this._getXToOffset(this._getYToLine(v.top),v.left);v=this._touchConvert(o[1]);o=this._getXToOffset(this._getYToLine(v.top),v.left);l=this._getSelection();l.setCaret(q);l.extend(o);this._setSelection(l,true,true)}},_handleTouchMove:function(l){this._touchMoved=
true;var o=l.touches,q;if(o.length===1){o=o[0];var v=o.pageX,x=o.pageY,z=this._touchStartX-v,C=this._touchStartY-x;q=this._touchConvert(o);o=this._getSelection();if(this._touchGesture==="none")this._touchGesture=l.timeStamp-this._touchStartTime<200&&(Math.abs(z)>5||Math.abs(C)>5)?"scroll":"caret";if(this._touchGesture==="select")this._touchGesture=this._hitOffset(o.end,q.left,q.top)?"extendEnd":this._hitOffset(o.start,q.left,q.top)?"extendStart":"caret";switch(this._touchGesture){case "scroll":this._touchStartX=
v;this._touchStartY=x;this._scrollView(z,C);break;case "extendStart":case "extendEnd":this._clickCount=1;q=this._getXToOffset(this._getYToLine(q.top),q.left);o.setCaret(this._touchGesture==="extendStart"?o.end:o.start);o.extend(q);if(q>=o.end&&this._touchGesture==="extendStart")this._touchGesture="extendEnd";if(q<=o.start&&this._touchGesture==="extendEnd")this._touchGesture="extendStart";this._setSelection(o,true,true);break;case "caret":this._setSelectionTo(q.left,q.top,false);break}}else if(o.length===
2){q=this._touchConvert(o[0]);v=this._getXToOffset(this._getYToLine(q.top),q.left);q=this._touchConvert(o[1]);q=this._getXToOffset(this._getYToLine(q.top),q.left);o=this._getSelection();o.setCaret(v);o.extend(q);this._setSelection(o,true,true)}l.preventDefault()},_handleTouchEnd:function(l){var o=this;if(!this._touchMoved)if(l.touches.length===0&&l.changedTouches.length===1){var q=this._touchConvert(l.changedTouches[0]),v=this._textArea;v.value="";v.style.left="-1000px";v.style.top="-1000px";v.style.width=
"3000px";v.style.height="3000px";setTimeout(function(){o._clickCount=1;o._ignoreDOMSelection=false;o._setSelectionTo(q.left,q.top,false)},300)}l.touches.length===0&&setTimeout(function(){var x=o._getSelection(),z=o._model.getText(x.start,x.end),C=o._textArea;C.value=z;C.selectionStart=0;C.selectionEnd=z.length;if(!x.isEmpty()){z=o._touchDiv.getBoundingClientRect();x=o._getOffsetBounds(x.start);C.style.left=z.width/2+"px";C.style.top=(x.top>40?x.top-30:x.top+30)+"px"}},0)},_doAction:function(l){for(var o=
this._keyBindings,q=0;q<o.length;q++){var v=o[q];if(v.keyBinding.match(l)){if(v.name){l=this._actions;for(o=0;o<l.length;o++){q=l[o];if(q.name===v.name){if(q.userHandler){if(!q.userHandler())if(q.defaultHandler)q.defaultHandler();else return false}else q.defaultHandler&&q.defaultHandler();break}}}return true}}return false},_doBackspace:function(l){var o=this._getSelection();if(o.isEmpty()){var q=this._model,v=o.getCaret(),x=q.getLineAtOffset(v),z=q.getLineStart(x);if(v===z)x>0&&o.extend(q.getLineEnd(x-
1));else{x=false;if(this._expandTab&&l.unit==="character"&&(v-z)%this._tabSize===0)x=!/[^ ]/.test(q.getText(z,v));x?o.extend(v-this._tabSize):o.extend(this._getOffset(v,l.unit,-1))}}this._modifyContent({text:"",start:o.start,end:o.end},true);return true},_doContent:function(l){var o=this._getSelection();this._modifyContent({text:l,start:o.start,end:o.end,_ignoreDOMSelection:true},true)},_doCopy:function(l){var o=this._getSelection();if(!o.isEmpty())return this._setClipboardText(this._getBaseText(o.start,
o.end),l);return true},_doCursorNext:function(l){if(!l.select)if(this._clearSelection("next"))return true;var o=this._model,q=this._getSelection(),v=q.getCaret(),x=o.getLineAtOffset(v);if(v===o.getLineEnd(x))x+1<o.getLineCount()&&q.extend(o.getLineStart(x+1));else q.extend(this._getOffset(v,l.unit,1));l.select||q.collapse();this._setSelection(q,true);return true},_doCursorPrevious:function(l){if(!l.select)if(this._clearSelection("previous"))return true;var o=this._model,q=this._getSelection(),v=q.getCaret(),
x=o.getLineAtOffset(v);if(v===o.getLineStart(x))x>0&&q.extend(o.getLineEnd(x-1));else q.extend(this._getOffset(v,l.unit,-1));l.select||q.collapse();this._setSelection(q,true);return true},_doCut:function(l){var o=this._getSelection();if(!o.isEmpty()){o=this._getBaseText(o.start,o.end);this._doContent("");return this._setClipboardText(o,l)}return true},_doDelete:function(l){var o=this._getSelection();if(o.isEmpty()){var q=this._model,v=o.getCaret(),x=q.getLineAtOffset(v);if(v===q.getLineEnd(x))x+1<
q.getLineCount()&&o.extend(q.getLineStart(x+1));else o.extend(this._getOffset(v,l.unit,1))}this._modifyContent({text:"",start:o.start,end:o.end},true);return true},_doEnd:function(l){var o=this._getSelection(),q=this._model;if(l.ctrl)o.extend(q.getCharCount());else{var v=q.getLineAtOffset(o.getCaret());o.extend(q.getLineEnd(v))}l.select||o.collapse();this._setSelection(o,true);return true},_doEnter:function(l){var o=this._model,q=this._getSelection();this._doContent(o.getLineDelimiter());if(l&&l.noCursor){q.end=
q.start;this._setSelection(q)}return true},_doHome:function(l){var o=this._getSelection(),q=this._model;if(l.ctrl)o.extend(0);else{var v=q.getLineAtOffset(o.getCaret());o.extend(q.getLineStart(v))}l.select||o.collapse();this._setSelection(o,true);return true},_doLineDown:function(l){var o=this._model,q=this._getSelection(),v=q.getCaret(),x=o.getLineAtOffset(v);if(x+1<o.getLineCount()){var z=this._getScroll().x,C=this._columnX;if(C===-1||l.wholeLine||l.select&&j)C=this._getOffsetToX(l.wholeLine?o.getLineEnd(x+
1):v)+z;q.extend(this._getXToOffset(x+1,C-z));l.select||q.collapse();this._setSelection(q,true,true);this._columnX=C}return true},_doLineUp:function(l){var o=this._model,q=this._getSelection(),v=q.getCaret(),x=o.getLineAtOffset(v);if(x>0){var z=this._getScroll().x,C=this._columnX;if(C===-1||l.wholeLine||l.select&&j)C=this._getOffsetToX(l.wholeLine?o.getLineStart(x-1):v)+z;q.extend(this._getXToOffset(x-1,C-z));l.select||q.collapse();this._setSelection(q,true,true);this._columnX=C}return true},_doPageDown:function(l){var o=
this._model,q=this._getSelection(),v=q.getCaret(),x=o.getLineAtOffset(v),z=o.getLineCount();if(x<z-1){o=this._getScroll();var C=this._getClientHeight(),A=this._getLineHeight(),F=Math.floor(C/A),H=Math.min(z-x-1,F);H=Math.max(1,H);F=this._columnX;if(F===-1||l.select&&j)F=this._getOffsetToX(v)+o.x;q.extend(this._getXToOffset(x+H,F-o.x));l.select||q.collapse();l=z*A;v=o.y+H*A;if(v+C>l)v=l-C;this._setSelection(q,true,true,v-o.y);this._columnX=F}return true},_doPageUp:function(l){var o=this._model,q=this._getSelection(),
v=q.getCaret(),x=o.getLineAtOffset(v);if(x>0){o=this._getScroll();var z=this._getClientHeight(),C=this._getLineHeight();z=Math.floor(z/C);var A=Math.max(1,Math.min(x,z));z=this._columnX;if(z===-1||l.select&&j)z=this._getOffsetToX(v)+o.x;q.extend(this._getXToOffset(x-A,z-o.x));l.select||q.collapse();l=Math.max(0,o.y-A*C);this._setSelection(q,true,true,l-o.y);this._columnX=z}return true},_doPaste:function(l){var o=this;return this._getClipboardText(l,function(q){if(q){t&&o._lastMouseButton===2&&(new Date).getTime()-
o._lastMouseTime<=o._clickTime&&o._setSelectionTo(o._lastMouseX,o._lastMouseY);o._doContent(q)}})!==null},_doScroll:function(l){var o=l.type,q=this._model,v=q.getLineCount();l=this._getClientHeight();var x=this._getLineHeight();v=v*x;var z=this._getScroll().y,C;switch(o){case "textStart":C=0;break;case "textEnd":C=v-l;break;case "pageDown":C=z+l;break;case "pageUp":C=z-l;break;case "centerLine":o=this._getSelection();C=q.getLineAtOffset(o.start);q=(q.getLineAtOffset(o.end)-C+1)*x;C=C*x-l/2+q/2;break}if(C!==
undefined){C=Math.min(Math.max(0,C),v-l);this._scrollView(0,C-z)}},_doSelectAll:function(){var l=this._model,o=this._getSelection();o.setCaret(0);o.extend(l.getCharCount());this._setSelection(o,false);return true},_doTab:function(){var l="\t";if(this._expandTab){var o=this._model;l=this._getSelection().getCaret();var q=o.getLineAtOffset(l);o=o.getLineStart(q);l=(new Array(this._tabSize-(l-o)%this._tabSize+1)).join(" ")}this._doContent(l);return true},_applyStyle:function(l,o,q){if(q){q=o.attributes;
for(var v=q.length;v-- >0;)q[v].specified&&o.removeAttributeNode(q[v])}if(l){if(l.styleClass)o.className=l.styleClass;if(q=l.style)for(var x in q)if(q.hasOwnProperty(x))o.style[x]=q[x];if(l=l.attributes)for(var z in l)l.hasOwnProperty(z)&&o.setAttribute(z,l[z])}},_autoScroll:function(){var l=this._getSelection(),o,q=this._autoScrollX;if(this._autoScrollDir==="up"||this._autoScrollDir==="down"){var v=this._autoScrollY/this._getLineHeight();v=v<0?Math.floor(v):Math.ceil(v);o=this._model.getLineAtOffset(l.getCaret());
o=Math.max(0,Math.min(this._model.getLineCount()-1,o+v))}else if(this._autoScrollDir==="left"||this._autoScrollDir==="right"){o=this._getYToLine(this._autoScrollY);q+=this._getOffsetToX(l.getCaret())}l.extend(this._getXToOffset(o,q));this._setSelection(l,true)},_autoScrollTimer:function(){this._autoScroll();var l=this;this._autoScrollTimerID=setTimeout(function(){l._autoScrollTimer()},this._AUTO_SCROLL_RATE)},_calculateMetrics:function(){var l=this._clientDiv,o=this._frameDocument,q=o.createElement("DIV"),
v={type:"LineStyle",textView:this,0:0,lineText:this._model.getLine(0),lineStart:0};this.onLineStyle(v);this._applyStyle(v.style,q);q.style.position="fixed";q.style.left="-1000px";v=o.createElement("SPAN");v.appendChild(o.createTextNode(" "));q.appendChild(v);var x=o.createElement("SPAN");x.style.fontStyle="italic";x.appendChild(o.createTextNode(" "));q.appendChild(x);var z=o.createElement("SPAN");z.style.fontWeight="bold";z.appendChild(o.createTextNode(" "));q.appendChild(z);var C=o.createElement("SPAN");
C.style.fontWeight="bold";C.style.fontStyle="italic";C.appendChild(o.createTextNode(" "));q.appendChild(C);l.appendChild(q);o=q.getBoundingClientRect();v=v.getBoundingClientRect();x=x.getBoundingClientRect();z=z.getBoundingClientRect();var A=C.getBoundingClientRect();C=x.bottom-x.top;z=z.bottom-z.top;x=A.bottom-A.top;A=0;o=o.bottom-o.top;if(C>v.bottom-v.top)A=1;if(z>C)A=2;if(x>z)A=3;var F;if(A!==0){F={style:{}};if((A&1)!==0)F.style.fontStyle="italic";if((A&2)!==0)F.style.fontWeight="bold"}v=this._getLineTrim(q);
l.removeChild(q);return{lineHeight:o,largestFontStyle:F,lineTrim:v,viewPadding:this._calculatePadding()}},_calculatePadding:function(){var l=this._frameDocument,o=this._clientDiv,q=this._getPadding(this._viewDiv),v=l.createElement("DIV");v.style.position="fixed";v.style.left="-1000px";v.style.paddingLeft=q.left+"px";v.style.paddingTop=q.top+"px";v.style.paddingRight=q.right+"px";v.style.paddingBottom=q.bottom+"px";v.style.width="100px";v.style.height="100px";q=l.createElement("DIV");q.style.width=
"100%";q.style.height="100%";v.appendChild(q);o.appendChild(v);l=v.getBoundingClientRect();q=q.getBoundingClientRect();o.removeChild(v);return q={left:q.left-l.left,top:q.top-l.top,right:l.right-q.right,bottom:l.bottom-q.bottom}},_clearSelection:function(l){var o=this._getSelection();if(o.isEmpty())return false;if(l==="next")o.start=o.end;else o.end=o.start;this._setSelection(o,true);return true},_clone:function(l){if(l instanceof Array)return l.slice(0);return l},_compare:function(l,o){if(l===o)return true;
if(l&&!o||!l&&o)return false;if(l&&l.constructor===String||o&&o.constructor===String)return false;if(l instanceof Array||o instanceof Array){if(!(l instanceof Array&&o instanceof Array))return false;if(l.length!==o.length)return false;for(var q=0;q<l.length;q++)if(!this._compare(l[q],o[q]))return false;return true}if(!(l instanceof Object)||!(o instanceof Object))return false;for(q in l)if(l.hasOwnProperty(q)){if(!o.hasOwnProperty(q))return false;if(!this._compare(l[q],o[q]))return false}for(q in o)if(!l.hasOwnProperty(q))return false;
return true},_commitIME:function(){if(this._imeOffset!==-1){this._scrollDiv.focus();this._clientDiv.focus();var l=this._model,o=l.getLineAtOffset(this._imeOffset),q=l.getLineStart(o),v=this._getDOMText(o);l=l.getLine(o);q=this._imeOffset-q;l=q+v.length-l.length;q!==l&&this._doContent(v.substring(q,l));this._imeOffset=-1}},_convertDelimiter:function(l,o,q){for(var v=0,x=0,z=0,C=l.length;z<C;){if(v!==-1&&v<=z)v=l.indexOf("\r",z);if(x!==-1&&x<=z)x=l.indexOf("\n",z);var A=z,F;if(x===-1&&v===-1){o(l.substring(z));
break}if(v!==-1&&x!==-1)if(v+1===x){F=v;z=x+1}else{F=v<x?v:x;z=(v<x?v:x)+1}else if(v!==-1){F=v;z=v+1}else{F=x;z=x+1}o(l.substring(A,F));q()}},_createActions:function(){var l=e.KeyBinding,o=this._keyBindings=[];o.push({name:"lineUp",keyBinding:new l(38),predefined:true});o.push({name:"lineDown",keyBinding:new l(40),predefined:true});o.push({name:"charPrevious",keyBinding:new l(37),predefined:true});o.push({name:"charNext",keyBinding:new l(39),predefined:true});if(s){o.push({name:"scrollPageUp",keyBinding:new l(33),
predefined:true});o.push({name:"scrollPageDown",keyBinding:new l(34),predefined:true});o.push({name:"pageUp",keyBinding:new l(33,null,null,true),predefined:true});o.push({name:"pageDown",keyBinding:new l(34,null,null,true),predefined:true});o.push({name:"lineStart",keyBinding:new l(37,true),predefined:true});o.push({name:"lineEnd",keyBinding:new l(39,true),predefined:true});o.push({name:"wordPrevious",keyBinding:new l(37,null,null,true),predefined:true});o.push({name:"wordNext",keyBinding:new l(39,
null,null,true),predefined:true});o.push({name:"scrollTextStart",keyBinding:new l(36),predefined:true});o.push({name:"scrollTextEnd",keyBinding:new l(35),predefined:true});o.push({name:"textStart",keyBinding:new l(38,true),predefined:true});o.push({name:"textEnd",keyBinding:new l(40,true),predefined:true});o.push({name:"scrollPageUp",keyBinding:new l(38,null,null,null,true),predefined:true});o.push({name:"scrollPageDown",keyBinding:new l(40,null,null,null,true),predefined:true});o.push({name:"lineStart",
keyBinding:new l(37,null,null,null,true),predefined:true});o.push({name:"lineEnd",keyBinding:new l(39,null,null,null,true),predefined:true});o.push({name:"lineStart",keyBinding:new l(38,null,null,true),predefined:true});o.push({name:"lineEnd",keyBinding:new l(40,null,null,true),predefined:true})}else{o.push({name:"pageUp",keyBinding:new l(33),predefined:true});o.push({name:"pageDown",keyBinding:new l(34),predefined:true});o.push({name:"lineStart",keyBinding:new l(36),predefined:true});o.push({name:"lineEnd",
keyBinding:new l(35),predefined:true});o.push({name:"wordPrevious",keyBinding:new l(37,true),predefined:true});o.push({name:"wordNext",keyBinding:new l(39,true),predefined:true});o.push({name:"textStart",keyBinding:new l(36,true),predefined:true});o.push({name:"textEnd",keyBinding:new l(35,true),predefined:true})}if(k&&t){o.push({name:"lineUp",keyBinding:new l(38,true),predefined:true});o.push({name:"lineDown",keyBinding:new l(40,true),predefined:true})}o.push({name:"selectLineUp",keyBinding:new l(38,
null,true),predefined:true});o.push({name:"selectLineDown",keyBinding:new l(40,null,true),predefined:true});o.push({name:"selectCharPrevious",keyBinding:new l(37,null,true),predefined:true});o.push({name:"selectCharNext",keyBinding:new l(39,null,true),predefined:true});o.push({name:"selectPageUp",keyBinding:new l(33,null,true),predefined:true});o.push({name:"selectPageDown",keyBinding:new l(34,null,true),predefined:true});if(s){o.push({name:"selectLineStart",keyBinding:new l(37,true,true),predefined:true});
o.push({name:"selectLineEnd",keyBinding:new l(39,true,true),predefined:true});o.push({name:"selectWordPrevious",keyBinding:new l(37,null,true,true),predefined:true});o.push({name:"selectWordNext",keyBinding:new l(39,null,true,true),predefined:true});o.push({name:"selectTextStart",keyBinding:new l(36,null,true),predefined:true});o.push({name:"selectTextEnd",keyBinding:new l(35,null,true),predefined:true});o.push({name:"selectTextStart",keyBinding:new l(38,true,true),predefined:true});o.push({name:"selectTextEnd",
keyBinding:new l(40,true,true),predefined:true});o.push({name:"selectLineStart",keyBinding:new l(37,null,true,null,true),predefined:true});o.push({name:"selectLineEnd",keyBinding:new l(39,null,true,null,true),predefined:true});o.push({name:"selectLineStart",keyBinding:new l(38,null,true,true),predefined:true});o.push({name:"selectLineEnd",keyBinding:new l(40,null,true,true),predefined:true})}else{if(t){o.push({name:"selectWholeLineUp",keyBinding:new l(38,true,true),predefined:true});o.push({name:"selectWholeLineDown",
keyBinding:new l(40,true,true),predefined:true})}o.push({name:"selectLineStart",keyBinding:new l(36,null,true),predefined:true});o.push({name:"selectLineEnd",keyBinding:new l(35,null,true),predefined:true});o.push({name:"selectWordPrevious",keyBinding:new l(37,true,true),predefined:true});o.push({name:"selectWordNext",keyBinding:new l(39,true,true),predefined:true});o.push({name:"selectTextStart",keyBinding:new l(36,true,true),predefined:true});o.push({name:"selectTextEnd",keyBinding:new l(35,true,
true),predefined:true})}o.push({name:"deletePrevious",keyBinding:new l(8),predefined:true});o.push({name:"deletePrevious",keyBinding:new l(8,null,true),predefined:true});o.push({name:"deleteNext",keyBinding:new l(46),predefined:true});o.push({name:"deleteWordPrevious",keyBinding:new l(8,true),predefined:true});o.push({name:"deleteWordPrevious",keyBinding:new l(8,true,true),predefined:true});o.push({name:"deleteWordNext",keyBinding:new l(46,true),predefined:true});o.push({name:"tab",keyBinding:new l(9),
predefined:true});o.push({name:"enter",keyBinding:new l(13),predefined:true});o.push({name:"enter",keyBinding:new l(13,null,true),predefined:true});o.push({name:"selectAll",keyBinding:new l("a",true),predefined:true});if(s){o.push({name:"deleteNext",keyBinding:new l(46,null,true),predefined:true});o.push({name:"deleteWordPrevious",keyBinding:new l(8,null,null,true),predefined:true});o.push({name:"deleteWordNext",keyBinding:new l(46,null,null,true),predefined:true})}if(!k){var q=s&&n;o.push({name:null,
keyBinding:new l("u",!q,false,false,q),predefined:true});o.push({name:null,keyBinding:new l("i",!q,false,false,q),predefined:true});o.push({name:null,keyBinding:new l("b",!q,false,false,q),predefined:true})}if(k){o.push({name:"copy",keyBinding:new l(45,true),predefined:true});o.push({name:"paste",keyBinding:new l(45,null,true),predefined:true});o.push({name:"cut",keyBinding:new l(46,null,true),predefined:true})}if(s){o.push({name:"lineStart",keyBinding:new l("a",false,false,false,true),predefined:true});
o.push({name:"lineEnd",keyBinding:new l("e",false,false,false,true),predefined:true});o.push({name:"lineUp",keyBinding:new l("p",false,false,false,true),predefined:true});o.push({name:"lineDown",keyBinding:new l("n",false,false,false,true),predefined:true});o.push({name:"charPrevious",keyBinding:new l("b",false,false,false,true),predefined:true});o.push({name:"charNext",keyBinding:new l("f",false,false,false,true),predefined:true});o.push({name:"deletePrevious",keyBinding:new l("h",false,false,false,
true),predefined:true});o.push({name:"deleteNext",keyBinding:new l("d",false,false,false,true),predefined:true});o.push({name:"deleteLineEnd",keyBinding:new l("k",false,false,false,true),predefined:true});if(k){o.push({name:"scrollPageDown",keyBinding:new l("v",false,false,false,true),predefined:true});o.push({name:"deleteLineStart",keyBinding:new l("u",false,false,false,true),predefined:true});o.push({name:"deleteWordPrevious",keyBinding:new l("w",false,false,false,true),predefined:true})}else{o.push({name:"pageDown",
keyBinding:new l("v",false,false,false,true),predefined:true});o.push({name:"centerLine",keyBinding:new l("l",false,false,false,true),predefined:true});o.push({name:"enterNoCursor",keyBinding:new l("o",false,false,false,true),predefined:true})}}var v=this;this._actions=[{name:"lineUp",defaultHandler:function(){return v._doLineUp({select:false})}},{name:"lineDown",defaultHandler:function(){return v._doLineDown({select:false})}},{name:"lineStart",defaultHandler:function(){return v._doHome({select:false,
ctrl:false})}},{name:"lineEnd",defaultHandler:function(){return v._doEnd({select:false,ctrl:false})}},{name:"charPrevious",defaultHandler:function(){return v._doCursorPrevious({select:false,unit:"character"})}},{name:"charNext",defaultHandler:function(){return v._doCursorNext({select:false,unit:"character"})}},{name:"pageUp",defaultHandler:function(){return v._doPageUp({select:false})}},{name:"pageDown",defaultHandler:function(){return v._doPageDown({select:false})}},{name:"scrollPageUp",defaultHandler:function(){return v._doScroll({type:"pageUp"})}},
{name:"scrollPageDown",defaultHandler:function(){return v._doScroll({type:"pageDown"})}},{name:"wordPrevious",defaultHandler:function(){return v._doCursorPrevious({select:false,unit:"word"})}},{name:"wordNext",defaultHandler:function(){return v._doCursorNext({select:false,unit:"word"})}},{name:"textStart",defaultHandler:function(){return v._doHome({select:false,ctrl:true})}},{name:"textEnd",defaultHandler:function(){return v._doEnd({select:false,ctrl:true})}},{name:"scrollTextStart",defaultHandler:function(){return v._doScroll({type:"textStart"})}},
{name:"scrollTextEnd",defaultHandler:function(){return v._doScroll({type:"textEnd"})}},{name:"centerLine",defaultHandler:function(){return v._doScroll({type:"centerLine"})}},{name:"selectLineUp",defaultHandler:function(){return v._doLineUp({select:true})}},{name:"selectLineDown",defaultHandler:function(){return v._doLineDown({select:true})}},{name:"selectWholeLineUp",defaultHandler:function(){return v._doLineUp({select:true,wholeLine:true})}},{name:"selectWholeLineDown",defaultHandler:function(){return v._doLineDown({select:true,
wholeLine:true})}},{name:"selectLineStart",defaultHandler:function(){return v._doHome({select:true,ctrl:false})}},{name:"selectLineEnd",defaultHandler:function(){return v._doEnd({select:true,ctrl:false})}},{name:"selectCharPrevious",defaultHandler:function(){return v._doCursorPrevious({select:true,unit:"character"})}},{name:"selectCharNext",defaultHandler:function(){return v._doCursorNext({select:true,unit:"character"})}},{name:"selectPageUp",defaultHandler:function(){return v._doPageUp({select:true})}},
{name:"selectPageDown",defaultHandler:function(){return v._doPageDown({select:true})}},{name:"selectWordPrevious",defaultHandler:function(){return v._doCursorPrevious({select:true,unit:"word"})}},{name:"selectWordNext",defaultHandler:function(){return v._doCursorNext({select:true,unit:"word"})}},{name:"selectTextStart",defaultHandler:function(){return v._doHome({select:true,ctrl:true})}},{name:"selectTextEnd",defaultHandler:function(){return v._doEnd({select:true,ctrl:true})}},{name:"deletePrevious",
defaultHandler:function(){return v._doBackspace({unit:"character"})}},{name:"deleteNext",defaultHandler:function(){return v._doDelete({unit:"character"})}},{name:"deleteWordPrevious",defaultHandler:function(){return v._doBackspace({unit:"word"})}},{name:"deleteWordNext",defaultHandler:function(){return v._doDelete({unit:"word"})}},{name:"deleteLineStart",defaultHandler:function(){return v._doBackspace({unit:"line"})}},{name:"deleteLineEnd",defaultHandler:function(){return v._doDelete({unit:"line"})}},
{name:"tab",defaultHandler:function(){return v._doTab()}},{name:"enter",defaultHandler:function(){return v._doEnter()}},{name:"enterNoCursor",defaultHandler:function(){return v._doEnter({noCursor:true})}},{name:"selectAll",defaultHandler:function(){return v._doSelectAll()}},{name:"copy",defaultHandler:function(){return v._doCopy()}},{name:"cut",defaultHandler:function(){return v._doCut()}},{name:"paste",defaultHandler:function(){return v._doPaste()}}]},_createLine:function(l,o,q,v,x){var z=x.getLine(v),
C=x.getLineStart(v),A={type:"LineStyle",textView:this,lineIndex:v,lineText:z,lineStart:C};this.onLineStyle(A);x=o||q.createElement("DIV");if(!o||!this._compare(o.viewStyle,A.style)){this._applyStyle(A.style,x,o);if(o)o._trim=null;x.viewStyle=A.style;x.setAttribute("role","presentation")}x.lineIndex=v;v=[];this._createRanges(A.ranges,z,0,z.length,C,{tabOffset:0,ranges:v});z=" ";if(!this._fullSelection&&j<9)z="\ufeff";if(r)z="\u200c";v.push({text:z,style:this._metrics.largestFontStyle,ignoreChars:1});
var F,H,N,I,O,M;A=z=0;var Q,T;if(o){if(N=o.modelChangedEvent){if(N.removedLineCount===0&&N.addedLineCount===0){T=N.start-C;Q=N.addedCharCount-N.removedCharCount}else T=-1;o.modelChangedEvent=undefined}N=o.firstChild}for(C=0;C<v.length;C++){F=v[C];O=F.text;z+=O.length;H=F.style;if(N){M=N.firstChild.data;I=N.viewStyle;if(M===O&&this._compare(H,I)){A+=M.length;N._rectsCache=undefined;F=N=N.nextSibling;continue}else for(;N;){if(T!==-1){I=z;if(I>=T)I-=Q;M=N.firstChild.data.length;if(A+M>I)break;A+=M}I=
N.nextSibling;x.removeChild(N);N=I}}F=this._createSpan(x,q,O,H,F.ignoreChars);N?x.insertBefore(F,N):x.appendChild(F);if(o)o.lineWidth=undefined}if(o)for(l=F?F.nextSibling:null;l;){I=l.nextSibling;o.removeChild(l);l=I}else l.appendChild(x);return x},_createRanges:function(l,o,q,v,x,z){if(!(q>=v)){if(l)for(var C=0;C<l.length;C++){var A=l[C];if(!(A.end<=x+q)){var F=Math.max(x+q,A.start)-x;if(F>=v)break;var H=Math.min(x+v,A.end)-x;if(F<H){F=Math.max(q,F);H=Math.min(v,H);for(q<F&&this._createRange(o,q,
F,null,z);C+1<l.length&&l[C+1].start-x===H&&this._compare(A.style,l[C+1].style);){A=l[C+1];H=Math.min(x+v,A.end)-x;C++}this._createRange(o,F,H,A.style,z);q=H}}}q<v&&this._createRange(o,q,v,null,z)}},_createRange:function(l,o,q,v,x){if(!(o>=q)){var z=this._customTabSize;if(z&&z!==8)for(var C=l.indexOf("\t",o);C!==-1&&C<q;){if(o<C){o={text:l.substring(o,C),style:v};x.ranges.push(o);x.tabOffset+=o.text.length}o=z-x.tabOffset%z;if(o>0){for(var A="\u00a0",F=1;F<o;F++)A+=" ";o={text:A,style:v,ignoreChars:o-
1};x.ranges.push(o);x.tabOffset+=o.text.length}o=C+1;C=l.indexOf("\t",o)}if(o<q){o={text:l.substring(o,q),style:v};x.ranges.push(o);x.tabOffset+=o.text.length}}},_createSpan:function(l,o,q,v,x){var z=v&&v.tagName==="A";if(z)l.hasLink=true;l=z&&this._linksVisible?"A":"SPAN";z=o.createElement(l);z.appendChild(o.createTextNode(q));this._applyStyle(v,z);if(l==="A"){var C=this;c(z,"click",function(A){return C._handleLinkClick(A)},false)}z.viewStyle=v;if(x)z.ignoreChars=x;return z},_createRuler:function(l){if(this._clientDiv){var o=
this._frameDocument,q=o.body,v=l.getLocation(),x=v==="left"?this._leftDiv:this._rightDiv;if(!x){x=o.createElement("DIV");x.style.overflow="hidden";x.style.MozUserSelect="none";x.style.WebkitUserSelect="none";j&&x.attachEvent("onselectstart",function(){return false});x.style.position="absolute";x.style.top="0px";x.style.cursor="default";q.appendChild(x);if(v==="left"){this._leftDiv=x;x.className="viewLeftRuler"}else{this._rightDiv=x;x.className="viewRightRuler"}q=o.createElement("TABLE");x.appendChild(q);
q.cellPadding="0px";q.cellSpacing="0px";q.border="0px";q.insertRow(0);var z=this;c(x,"click",function(C){z._handleRulerEvent(C)});c(x,"dblclick",function(C){z._handleRulerEvent(C)});c(x,"mousemove",function(C){z._handleRulerEvent(C)});c(x,"mouseover",function(C){z._handleRulerEvent(C)});c(x,"mouseout",function(C){z._handleRulerEvent(C)})}o=o.createElement("DIV");o._ruler=l;o.rulerChanged=true;o.style.position="relative";l=x.firstChild.rows[0];l=l.insertCell(l.cells.length);l.vAlign="top";l.appendChild(o)}},
_createFrame:function(){if(!this.frame){for(var l=this._parent;l.hasChildNodes();)l.removeChild(l.lastChild);var o=l.ownerDocument;this._parentDocument=o;var q=o.createElement("IFRAME");this._frame=q;q.frameBorder="0px";q.style.border="0px";q.style.width="100%";q.style.height="100%";q.scrolling="no";var v=this;v._frameLoaded=false;this._loadHandler=function(x){v._frameLoaded=true;v._sync?v._handleLoad(x):setTimeout(function(){v._handleLoad(x)},0)};c(q,"load",this._loadHandler,!!k);if(!r)c(o,"DOMAttrModified",
this._attrModifiedHandler=function(x){v._frameLoaded&&v._handleDOMAttrModified(x)});l.appendChild(q);this._sync&&this._handleLoad()}},_getFrameHTML:function(){var l=[];l.push("<!DOCTYPE html>");l.push("<html>");l.push("<head>");j<9&&l.push("<meta http-equiv='X-UA-Compatible' content='IE=EmulateIE7'/>");l.push("<style>");l.push(".viewContainer {font-family: monospace; font-size: 10pt;}");l.push(".view {padding: 1px 2px;}");l.push(".viewContent {}");l.push("</style>");if(this._stylesheet)for(var o=
typeof this._stylesheet==="string"?[this._stylesheet]:this._stylesheet,q=0;q<o.length;q++){var v=o[q],x=this._isLinkURL(v);if(x&&this._sync)try{var z=new XMLHttpRequest;z.overrideMimeType&&z.overrideMimeType("text/css");z.open("GET",v,false);z.send(null);v=z.responseText;x=false}catch(C){}if(x){l.push("<link rel='stylesheet' type='text/css' ");j<9&&l.push("onload='window' ");l.push("href='");l.push(v);l.push("'></link>")}else{l.push("<style>");l.push(v);l.push("</style>")}}l.push("<script>");l.push("var waitForStyleSheets = true;");
l.push("<\/script>");l.push("</head>");l.push("<body spellcheck='false'></body>");l.push("</html>");return l.join("")},_createView:function(){if(!this._frameDocument){var l=this._frameWindow=this._frame.contentWindow,o=this._frameDocument=l.document,q=this;o.open("text/html","replace");o.write(q._getFrameHTML());o.close();q._windowLoadHandler=function(){o.readyState==="complete"&&q._createContent()};c(l,"load",q._windowLoadHandler);if(this._sync)this._createContent();else{this._createViewTimer=function(){q._clientDiv||
(o.readyState==="complete"?q._createContent():setTimeout(q._createViewTimer,10))};setTimeout(this._createViewTimer,10)}}},_createContent:function(){if(!this._clientDiv){var l=this._parent,o=this._parentDocument,q=this._frameDocument,v=q.body;this._setThemeClass(this._themeClass,true);v.style.margin="0px";v.style.borderWidth="0px";v.style.padding="0px";if(w){var x=o.createElement("DIV");this._touchDiv=x;x.style.position="absolute";x.style.border="0px";x.style.padding="0px";x.style.margin="0px";x.style.zIndex=
"2";x.style.overflow="hidden";x.style.background="transparent";x.style.WebkitUserSelect="none";l.appendChild(x);this._textArea=l=o.createElement("TEXTAREA");l.style.position="absolute";l.style.whiteSpace="pre";l.style.left="-1000px";l.tabIndex=1;l.autocapitalize="off";l.autocorrect="off";l.className="viewContainer";l.style.background="transparent";l.style.color="transparent";l.style.border="0px";l.style.padding="0px";l.style.margin="0px";l.style.borderRadius="0px";l.style.WebkitAppearance="none";
l.style.WebkitTapHighlightColor="transparent";x.appendChild(l)}if(k){this._clipboardDiv=x=q.createElement("DIV");x.style.position="fixed";x.style.whiteSpace="pre";x.style.left="-1000px";v.appendChild(x)}x=q.createElement("DIV");x.className="view";this._viewDiv=x;x.id="viewDiv";x.tabIndex=-1;x.style.overflow="auto";x.style.position="absolute";x.style.top="0px";x.style.borderWidth="0px";x.style.margin="0px";x.style.MozOutline="none";x.style.outline="none";x.setAttribute("role","application");v.appendChild(x);
this._scrollDiv=l=q.createElement("DIV");l.id="scrollDiv";l.style.margin="0px";l.style.borderWidth="0px";l.style.padding="0px";x.appendChild(l);if(k){this._clipDiv=o=q.createElement("DIV");o.id="clipDiv";o.style.position="fixed";o.style.overflow="hidden";o.style.margin="0px";o.style.borderWidth="0px";o.style.padding="0px";l.appendChild(o);var z=q.createElement("DIV");this._clipScrollDiv=z;z.id="clipScrollDiv";z.style.position="absolute";z.style.height="1px";z.style.top="-1000px";o.appendChild(z)}this._setFullSelection(this._fullSelection,
true);o=q.createElement("DIV");o.className="viewContent";this._clientDiv=o;o.id="clientDiv";o.style.whiteSpace="pre";o.style.position=this._clipDiv?"absolute":"fixed";o.style.borderWidth="0px";o.style.margin="0px";o.style.padding="0px";o.style.MozOutline="none";o.style.outline="none";o.style.zIndex="1";if(w)o.style.WebkitTapHighlightColor="transparent";(this._clipDiv||l).appendChild(o);if(k&&!o.setCapture){this._overlayDiv=q=q.createElement("DIV");q.id="overlayDiv";q.style.position=o.style.position;
q.style.borderWidth=o.style.borderWidth;q.style.margin=o.style.margin;q.style.padding=o.style.padding;q.style.cursor="text";q.style.zIndex="2";(this._clipDiv||l).appendChild(q)}if(!w)o.contentEditable="true";o.setAttribute("role","textbox");o.setAttribute("aria-multiline","true");q=this._metrics=this._calculateMetrics();if(j)v.style.lineHeight=q.lineHeight-(q.lineTrim.top+q.lineTrim.bottom)+"px";this._setTabSize(this._tabSize,true);this._hookEvents();v=this._rulers;for(q=0;q<v.length;q++)this._createRuler(v[q]);
this._updatePage();v=this._hScroll;q=this._vScroll;this._vScroll=this._hScroll=0;if(v>0||q>0){x.scrollLeft=v;x.scrollTop=q}this.onLoad({type:"Load"})}},_defaultOptions:function(){return{parent:{value:undefined,recreate:true,update:null},model:{value:undefined,recreate:false,update:this.setModel},readonly:{value:false,recreate:false,update:null},fullSelection:{value:true,recreate:false,update:this._setFullSelection},tabSize:{value:8,recreate:false,update:this._setTabSize},expandTab:{value:false,recreate:false,
update:null},stylesheet:{value:[],recreate:false,update:this._setStyleSheet},themeClass:{value:undefined,recreate:false,update:this._setThemeClass},sync:{value:false,recreate:false,update:null}}},_destroyFrame:function(){var l=this._frame;if(l){if(this._loadHandler){d(l,"load",this._loadHandler,!!k);this._loadHandler=null}if(this._attrModifiedHandler){d(this._parentDocument,"DOMAttrModified",this._attrModifiedHandler);this._attrModifiedHandler=null}l.parentNode.removeChild(l);this._frame=null}},_destroyRuler:function(l){var o=
l.getLocation()==="left"?this._leftDiv:this._rightDiv;if(o){o=o.firstChild.rows[0];for(var q=o.cells,v=0;v<q.length;v++)if(q[v].firstChild._ruler===l)break;if(v!==q.length){o.cells[v]._ruler=undefined;o.deleteCell(v)}}},_destroyView:function(){if(this._clientDiv){this._setGrab(null);this._unhookEvents();if(this._windowLoadHandler){d(this._frameWindow,"load",this._windowLoadHandler);this._windowLoadHandler=null}if(this._autoScrollTimerID){clearTimeout(this._autoScrollTimerID);this._autoScrollTimerID=
null}if(this._updateTimer){clearTimeout(this._updateTimer);this._updateTimer=null}for(var l=this._frameDocument.body;l.hasChildNodes();)l.removeChild(l.lastChild);if(this._touchDiv){this._parent.removeChild(this._touchDiv);this._touchDiv=null}this._selDiv3=this._selDiv2=this._selDiv1=null;this._insertedSelRule=false;this._frameWindow=this._frameDocument=this._rightDiv=this._leftDiv=this._overlayDiv=this._clientDiv=this._clipScrollDiv=this._clipDiv=this._viewDiv=this._scrollDiv=this._clipboardDiv=
this._textArea=null;this.onUnload({type:"Unload"})}},_doAutoScroll:function(l,o,q){this._autoScrollDir=l;this._autoScrollX=o;this._autoScrollY=q;this._autoScrollTimerID||this._autoScrollTimer()},_endAutoScroll:function(){this._autoScrollTimerID&&clearTimeout(this._autoScrollTimerID);this._autoScrollTimerID=this._autoScrollDir=undefined},_fixCaret:function(){var l=this._clientDiv;if(l){var o=this._hasFocus;this._ignoreFocus=true;o&&l.blur();l.contentEditable=false;l.contentEditable=true;o&&l.focus();
this._ignoreFocus=false}},_getBaseText:function(l,o){var q=this._model;if(q.getBaseModel){l=q.mapOffset(l);o=q.mapOffset(o);q=q.getBaseModel()}return q.getText(l,o)},_getBorder:function(l){var o,q,v,x;if(this._frameWindow.getComputedStyle){l=this._frameWindow.getComputedStyle(l,null);o=l.getPropertyValue("border-left-width");q=l.getPropertyValue("border-top-width");v=l.getPropertyValue("border-right-width");x=l.getPropertyValue("border-bottom-width")}else if(l.currentStyle){o=l.currentStyle.borderLeftWidth;
q=l.currentStyle.borderTopWidth;v=l.currentStyle.borderRightWidth;x=l.currentStyle.borderBottomWidth}return{left:parseInt(o,10)||0,top:parseInt(q,10)||0,right:parseInt(v,10)||0,bottom:parseInt(x,10)||0}},_getBoundsAtOffset:function(l){var o=this._model,q=this._frameDocument,v=this._clientDiv,x=o.getLineAtOffset(l),z,C=this._getLineNode(x);C||(C=z=this._createLine(v,null,q,x,o));var A=null;if(l<o.getLineEnd(x)){o=o.getLineStart(x);for(x=C.firstChild;x;){var F=x.firstChild,H=F.length;if(x.ignoreChars)H-=
x.ignoreChars;if(o+H>l){A=l-o;if(B){q=q.createRange();q.setStart(F,A);q.setEnd(F,A+1);A=q.getBoundingClientRect()}else if(j){q=q.body.createTextRange();q.moveToElementText(x);q.collapse();q.moveEnd("character",A+1);q.moveStart("character",A);A=q.getBoundingClientRect()}else{l=F.data;x.removeChild(F);x.appendChild(q.createTextNode(l.substring(0,A)));var N=q.createElement("SPAN");N.appendChild(q.createTextNode(l.substring(A,A+1)));x.appendChild(N);x.appendChild(q.createTextNode(l.substring(A+1)));A=
N.getBoundingClientRect();x.innerHTML="";x.appendChild(F);if(!z){q=this._getSelection();if(o<=q.start&&q.start<o+H||o<=q.end&&q.end<o+H)this._updateDOMSelection()}}if(j){q=window.screen.logicalXDPI;o=window.screen.deviceXDPI;A.left=A.left*q/o;A.right=A.right*q/o}break}o+=H;x=x.nextSibling}}if(!A){C=this._getLineBoundingClientRect(C);A={left:C.right,right:C.right}}z&&v.removeChild(z);return A},_getBottomIndex:function(l){var o=this._bottomChild;if(l&&this._getClientHeight()>this._getLineHeight()){l=
o.getBoundingClientRect();var q=this._clientDiv.getBoundingClientRect();if(l.bottom>q.bottom)o=this._getLinePrevious(o)||o}return o.lineIndex},_getFrameHeight:function(){return this._frameDocument.documentElement.clientHeight},_getFrameWidth:function(){return this._frameDocument.documentElement.clientWidth},_getClientHeight:function(){var l=this._getViewPadding();return Math.max(0,this._viewDiv.clientHeight-l.top-l.bottom)},_getClientWidth:function(){var l=this._getViewPadding();return Math.max(0,
this._viewDiv.clientWidth-l.left-l.right)},_getClipboardText:function(l,o){var q=this._model.getLineDelimiter(),v,x;if(this._frameWindow.clipboardData){v=[];x=this._frameWindow.clipboardData.getData("Text");this._convertDelimiter(x,function(I){v.push(I)},function(){v.push(q)});x=v.join("");o&&o(x);return x}if(k){this._ignoreFocus=true;var z=this._frameDocument,C=this._clipboardDiv;C.innerHTML="<pre contenteditable=''></pre>";C.firstChild.focus();var A=this,F=function(){var I=A._getTextFromElement(C);
C.innerHTML="";v=[];A._convertDelimiter(I,function(O){v.push(O)},function(){v.push(q)});return v.join("")},H=false;this._ignorePaste=true;if(!t||this._lastMouseButton!==2)try{H=z.execCommand("paste",false,null)}catch(N){H=C.childNodes.length>1||C.firstChild&&C.firstChild.childNodes.length>0}this._ignorePaste=false;if(!H)if(l){setTimeout(function(){A.focus();(x=F())&&o&&o(x);A._ignoreFocus=false},0);return null}else{this.focus();this._ignoreFocus=false;return""}this.focus();this._ignoreFocus=false;
(x=F())&&o&&o(x);return x}if(l&&l.clipboardData){v=[];x=l.clipboardData.getData("text/plain");this._convertDelimiter(x,function(I){v.push(I)},function(){v.push(q)});(x=v.join(""))&&o&&o(x);return x}return""},_getDOMText:function(l){l=this._getLineNode(l).firstChild;for(var o="";l;){for(var q=l.firstChild;q;){if(l.ignoreChars)for(var v=0;v<q.length;v++){var x=q.data.substring(v,v+1);if(x!==" ")o+=x}else o+=q.data;q=q.nextSibling}l=l.nextSibling}return o},_getTextFromElement:function(l){var o=l.ownerDocument,
q=o.defaultView;if(!q.getSelection)return l.innerText||l.textContent;o=o.createRange();o.selectNode(l);l=q.getSelection();q=[];var v;for(v=0;v<l.rangeCount;v++)q.push(l.getRangeAt(v));this._ignoreSelect=true;l.removeAllRanges();l.addRange(o);o=l.toString();l.removeAllRanges();for(v=0;v<q.length;v++)l.addRange(q[v]);this._ignoreSelect=false;return o},_getViewPadding:function(){return this._metrics.viewPadding},_getLineTrim:function(l){var o=l._trim;if(!o){o=this._getPadding(l);var q=this._getBorder(l);
o.left+=q.left;o.top+=q.top;o.right+=q.right;o.bottom+=q.bottom;l._trim=o}return o},_getLineBoundingClientRect:function(l,o){var q=l.getBoundingClientRect();q={left:q.left,top:q.top,right:q.left,bottom:q.bottom};for(var v=l.lastChild;v&&v.ignoreChars===v.firstChild.length;)v=v.previousSibling;if(v){v=v.getBoundingClientRect();q.right=v.right+this._getLineTrim(l).right}if(o){l=this._getLineTrim(l);q.left+=l.left;q.right-=l.right}return q},_getLineHeight:function(){return this._metrics.lineHeight},
_getLineNode:function(l){for(var o=this._clientDiv.firstChild;o;){if(l===o.lineIndex)return o;o=o.nextSibling}},_getLineNext:function(l){for(l=l?l.nextSibling:this._clientDiv.firstChild;l&&l.lineIndex===-1;)l=l.nextSibling;return l},_getLinePrevious:function(l){for(l=l?l.previousSibling:this._clientDiv.lastChild;l&&l.lineIndex===-1;)l=l.previousSibling;return l},_getOffset:function(l,o,q){if(o==="line"){o=this._model;l=o.getLineAtOffset(l);if(q>0)return o.getLineEnd(l);return o.getLineStart(l)}if(o===
"wordend")return this._getOffset_W3C(l,o,q);return j?this._getOffset_IE(l,o,q):this._getOffset_W3C(l,o,q)},_getOffset_W3C:function(l,o,q){function v(I){return 33<=I&&I<=47||58<=I&&I<=64||91<=I&&I<=94||I===96||123<=I&&I<=126}function x(I){return I===32||I===9}if(o==="word"||o==="wordend"){var z=this._model,C=z.getLineAtOffset(l),A=z.getLine(C),F=z.getLineStart(C);C=z.getLineEnd(C);z=A.length;l=l-F;var H,N;if(q>0){if(l===z)return C;H=A.charCodeAt(l);N=v(H);q=!N&&!x(H);for(l++;l<z;){H=A.charCodeAt(l);
C=v(H);if(o==="wordend"){if(!C&&N)break}else if(C&&!N)break;H=!C&&!x(H);if(o==="wordend"){if(!H&&q)break}else if(H&&!q)break;q=H;N=C;l++}}else{if(l===0)return F;l--;H=A.charCodeAt(l);N=v(H);for(q=!N&&!x(H);0<l;){H=A.charCodeAt(l-1);C=v(H);if(o==="wordend"){if(C&&!N)break}else if(!C&&N)break;H=!C&&!x(H);if(o==="wordend"){if(H&&!q)break}else if(!H&&q)break;q=H;N=C;l--}}return F+l}return l+q},_getOffset_IE:function(l,o,q){var v=this._frameDocument,x=this._model,z=x.getLineAtOffset(l),C=this._clientDiv,
A,F=this._getLineNode(z);F||(F=A=this._createLine(C,null,v,z,x));var H=0,N;N=x.getLineStart(z);if(l===x.getLineEnd(z)){v=v.body.createTextRange();v.moveToElementText(F.lastChild);N=v.text.length;v.moveEnd(o,q);H=l+v.text.length-N}else if(l===N&&q<0)H=N;else for(F=F.firstChild;F;){x=F.firstChild.length;if(F.ignoreChars)x-=F.ignoreChars;if(N+x>l){v=v.body.createTextRange();if(l===N&&q<0)v.moveToElementText(F.previousSibling);else{v.moveToElementText(F);v.collapse();v.moveEnd("character",l-N)}N=v.text.length;
v.moveEnd(o,q);H=l+v.text.length-N;break}N=x+N;F=F.nextSibling}A&&C.removeChild(A);return H},_getOffsetToX:function(l){return this._getBoundsAtOffset(l).left},_getPadding:function(l){var o,q,v,x;if(this._frameWindow.getComputedStyle){l=this._frameWindow.getComputedStyle(l,null);o=l.getPropertyValue("padding-left");q=l.getPropertyValue("padding-top");v=l.getPropertyValue("padding-right");x=l.getPropertyValue("padding-bottom")}else if(l.currentStyle){o=l.currentStyle.paddingLeft;q=l.currentStyle.paddingTop;
v=l.currentStyle.paddingRight;x=l.currentStyle.paddingBottom}return{left:parseInt(o,10)||0,top:parseInt(q,10)||0,right:parseInt(v,10)||0,bottom:parseInt(x,10)||0}},_getScroll:function(){var l=this._viewDiv;return{x:l.scrollLeft,y:l.scrollTop}},_getSelection:function(){return this._selection.clone()},_getTopIndex:function(l){var o=this._topChild;if(l&&this._getClientHeight()>this._getLineHeight()){l=o.getBoundingClientRect();var q=this._getViewPadding(),v=this._viewDiv.getBoundingClientRect();if(l.top<
v.top+q.top)o=this._getLineNext(o)||o}return o.lineIndex},_getXToOffset:function(l,o){function q(ba){var $,da,ea,ga;if(!ba._rectsCache){$=ba.getClientRects();da=[$.length];for(ea=0;ea<$.length;ea++){ga=$[ea];da[ea]={left:ga.left-N+M,top:ga.top,right:ga.right-N+M,bottom:ga.bottom}}ba._rectsCache=da}$=ba._rectsCache;da=[$.length];for(ea=0;ea<$.length;ea++){ga=$[ea];da[ea]={left:ga.left-M,top:ga.top,right:ga.right-M,bottom:ga.bottom}}return da}var v=this._model,x=v.getLineStart(l),z=v.getLineEnd(l);
if(x===z)return x;var C=this._frameDocument,A=this._clientDiv,F,H=this._getLineNode(l);H||(H=F=this._createLine(A,null,C,l,v));l=this._getLineBoundingClientRect(H,true);if(o<l.left)o=l.left;if(o>l.right)o=l.right;var N=0,I;if(j<9){I=H.getClientRects();v=I[0].left;for(var O=1;O<I.length;O++)v=Math.min(I[O].left,v);N=v-l.left-this._getLineTrim(H).left}var M=this._getScroll().x,Q=j?window.screen.logicalXDPI:1,T=j?window.screen.deviceXDPI:1;l=x;v=H.firstChild;a:for(;v;){O=v.firstChild;H=O.length;if(v.ignoreChars)H-=
v.ignoreChars;I=q(v);for(var E=0;E<I.length;E++){var G=I[E];if(G.left<=o&&o<G.right){if(j||B){C=B?C.createRange():C.body.createTextRange();E=H;for(var K=-1;E-K>1;){var R=Math.floor((E+K)/2);I=K+1;G=R===H-1&&v.ignoreChars?O.length:R+1;if(B){C.setStart(O,I);C.setEnd(O,G)}else{C.moveToElementText(v);C.move("character",I);C.moveEnd("character",G-I)}I=C.getClientRects();for(var U=false,V=0;V<I.length;V++){G=I[V];var X=G.right*Q/T-N;if(G.left*Q/T-N<=o&&o<X){U=true;break}}if(U)E=R;else K=R}l+=E;I=E;G=E===
H-1&&v.ignoreChars?O.length:Math.min(E+1,O.length);if(B){C.setStart(O,I);C.setEnd(O,G)}else{C.moveToElementText(v);C.move("character",I);C.moveEnd("character",G-I)}G=C.getClientRects()[0];o>G.left*Q/T-N+(G.right-G.left)*Q/T/2&&l++}else{I=[];for(Q=0;Q<H;Q++){I.push("<span>");Q===H-1?I.push(O.data.substring(Q)):I.push(O.data.substring(Q,Q+1));I.push("</span>")}v.innerHTML=I.join("");for(I=v.firstChild;I;){G=I.getBoundingClientRect();if(G.left<=o&&o<G.right){o>G.left+(G.right-G.left)/2&&l++;break}l++;
I=I.nextSibling}if(!F){v.innerHTML="";v.appendChild(O);o=this._getSelection();if(l<=o.start&&o.start<l+H||l<=o.end&&o.end<l+H)this._updateDOMSelection()}}break a}}l+=H;v=v.nextSibling}F&&A.removeChild(F);return Math.min(z,Math.max(x,l))},_getYToLine:function(l){var o=this._getViewPadding(),q=this._viewDiv.getBoundingClientRect();l-=q.top+o.top;o=this._getLineHeight();l=Math.floor((l+this._getScroll().y)/o);o=this._model.getLineCount();return Math.max(0,Math.min(o-1,l))},_getOffsetBounds:function(l){var o=
this._model.getLineAtOffset(l),q=this._getLineHeight(),v=this._getScroll(),x=this._getViewPadding(),z=this._viewDiv.getBoundingClientRect();l=this._getBoundsAtOffset(l);o=o*q-v.y+z.top+x.top;return{left:l.left,top:o,right:l.right,bottom:o+q}},_getVisible:function(){for(var l=this._parent,o=l.ownerDocument;l!==o;){var q;if(j<9)q=l.currentStyle&&l.currentStyle.display==="none";else q=(q=o.defaultView.getComputedStyle(l,null))&&q.getPropertyValue("display")==="none";if(q)return"hidden";l=l.parentNode;
if(!l)return"disconnected"}return"visible"},_hitOffset:function(l,o,q){var v=this._getOffsetBounds(l);l=v.left;var x=v.right,z=v.top;v=v.bottom;l-=20;z-=20;x+=20;v+=20;return l<=o&&o<=x&&z<=q&&q<=v},_hookEvents:function(){var l=this;this._modelListener={onChanging:function(A){l._onModelChanging(A)},onChanged:function(A){l._onModelChanged(A)}};this._model.addEventListener("Changing",this._modelListener.onChanging);this._model.addEventListener("Changed",this._modelListener.onChanged);var o=this._clientDiv,
q=this._viewDiv,v=this._frameDocument.body,x=this._handlers=[],z=j<9?this._frame:this._frameWindow,C=w?this._textArea:j||k?this._clientDiv:this._frameWindow;x.push({target:this._frameWindow,type:"unload",handler:function(A){return l._handleUnload(A)}});x.push({target:z,type:"resize",handler:function(A){return l._handleResize(A)}});x.push({target:C,type:"blur",handler:function(A){return l._handleBlur(A)}});x.push({target:C,type:"focus",handler:function(A){return l._handleFocus(A)}});x.push({target:q,
type:"scroll",handler:function(A){return l._handleScroll(A)}});if(w){o=this._touchDiv;v=this._textArea;x.push({target:v,type:"keydown",handler:function(A){return l._handleKeyDown(A)}});x.push({target:v,type:"input",handler:function(A){return l._handleInput(A)}});x.push({target:v,type:"textInput",handler:function(A){return l._handleTextInput(A)}});x.push({target:v,type:"click",handler:function(A){return l._handleTextAreaClick(A)}});x.push({target:o,type:"touchstart",handler:function(A){return l._handleTouchStart(A)}});
x.push({target:o,type:"touchmove",handler:function(A){return l._handleTouchMove(A)}});x.push({target:o,type:"touchend",handler:function(A){return l._handleTouchEnd(A)}})}else{q=this._overlayDiv||this._clientDiv;z=j?o:this._frameWindow;x.push({target:o,type:"keydown",handler:function(A){return l._handleKeyDown(A)}});x.push({target:o,type:"keypress",handler:function(A){return l._handleKeyPress(A)}});x.push({target:o,type:"keyup",handler:function(A){return l._handleKeyUp(A)}});x.push({target:o,type:"selectstart",
handler:function(A){return l._handleSelectStart(A)}});x.push({target:o,type:"contextmenu",handler:function(A){return l._handleContextMenu(A)}});x.push({target:o,type:"copy",handler:function(A){return l._handleCopy(A)}});x.push({target:o,type:"cut",handler:function(A){return l._handleCut(A)}});x.push({target:o,type:"paste",handler:function(A){return l._handlePaste(A)}});x.push({target:o,type:"mousedown",handler:function(A){return l._handleMouseDown(A)}});x.push({target:o,type:"mouseover",handler:function(A){return l._handleMouseOver(A)}});
x.push({target:o,type:"mouseout",handler:function(A){return l._handleMouseOut(A)}});x.push({target:z,type:"mouseup",handler:function(A){return l._handleMouseUp(A)}});x.push({target:z,type:"mousemove",handler:function(A){return l._handleMouseMove(A)}});x.push({target:v,type:"mousedown",handler:function(A){return l._handleBodyMouseDown(A)}});x.push({target:v,type:"mouseup",handler:function(A){return l._handleBodyMouseUp(A)}});x.push({target:q,type:"dragstart",handler:function(A){return l._handleDragStart(A)}});
x.push({target:q,type:"drag",handler:function(A){return l._handleDrag(A)}});x.push({target:q,type:"dragend",handler:function(A){return l._handleDragEnd(A)}});x.push({target:q,type:"dragenter",handler:function(A){return l._handleDragEnter(A)}});x.push({target:q,type:"dragover",handler:function(A){return l._handleDragOver(A)}});x.push({target:q,type:"dragleave",handler:function(A){return l._handleDragLeave(A)}});x.push({target:q,type:"drop",handler:function(A){return l._handleDrop(A)}});if(n){x.push({target:this._parentDocument,
type:"mousemove",handler:function(A){return l._handleMouseMove(A)}});x.push({target:this._parentDocument,type:"mouseup",handler:function(A){return l._handleMouseUp(A)}})}j&&x.push({target:this._frameDocument,type:"activate",handler:function(A){return l._handleDocFocus(A)}});k&&x.push({target:this._frameDocument,type:"focus",handler:function(A){return l._handleDocFocus(A)}});if(!j&&!m)x.push({target:this._viewDiv,type:k?"DOMMouseScroll":"mousewheel",handler:function(A){return l._handleMouseWheel(A)}});
k&&!u&&x.push({target:this._clientDiv,type:"DOMCharacterDataModified",handler:function(A){return l._handleDataModified(A)}});if(this._overlayDiv){x.push({target:this._overlayDiv,type:"mousedown",handler:function(A){return l._handleMouseDown(A)}});x.push({target:this._overlayDiv,type:"mouseover",handler:function(A){return l._handleMouseOver(A)}});x.push({target:this._overlayDiv,type:"mouseout",handler:function(A){return l._handleMouseOut(A)}});x.push({target:this._overlayDiv,type:"contextmenu",handler:function(A){return l._handleContextMenu(A)}})}y||
x.push({target:this._clientDiv,type:"dblclick",handler:function(A){return l._handleDblclick(A)}})}for(o=0;o<x.length;o++){v=x[o];c(v.target,v.type,v.handler,v.capture)}},_init:function(l){var o=l.parent;if(typeof o==="string")o=window.document.getElementById(o);if(!o)throw"no parent";l.parent=o;l.model=l.model||new f.TextModel;o=this._defaultOptions();for(var q in o)if(o.hasOwnProperty(q))this["_"+q]=l[q]!==undefined?l[q]:o[q].value;this._rulers=[];this._selection=new g(0,0,false);this._linksVisible=
false;this._maxLineWidth=this._redrawCount=0;this._maxLineIndex=-1;this._ignoreSelect=true;this._ignoreFocus=false;this._dragOffset=this._columnX=-1;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=false;this._doubleClickSelection=null;this._vScroll=this._hScroll=
0;this._imeOffset=-1;this._createActions();this._createFrame()},_isLinkURL:function(l){return l.toLowerCase().lastIndexOf(".css")===l.length-4},_modifyContent:function(l,o){if(!(this._readonly&&!l._code)){l.type="Verify";this.onVerify(l);if(!(l.text===null||l.text===undefined)){var q=this._model;try{if(l._ignoreDOMSelection)this._ignoreDOMSelection=true;q.setText(l.text,l.start,l.end)}finally{if(l._ignoreDOMSelection)this._ignoreDOMSelection=false}if(o){o=this._getSelection();o.setCaret(l.start+l.text.length);
this._setSelection(o,true)}this.onModify({type:"Modify"})}}},_onModelChanged:function(l){l.type="ModelChanged";this.onModelChanged(l);l.type="Changed";var o=l.start,q=l.addedCharCount,v=l.removedCharCount,x=l.addedLineCount,z=l.removedLineCount,C=this._getSelection();if(C.end>o){if(C.end>o&&C.start<o+v)C.setCaret(o+q);else{C.start+=q-v;C.end+=q-v}this._setSelection(C,false,false)}o=this._model.getLineAtOffset(o);for(q=this._getLineNext();q;){v=q.lineIndex;if(o<=v&&v<=o+z)if(o===v&&!q.modelChangedEvent&&
!q.lineRemoved){q.modelChangedEvent=l;q.lineChanged=true}else{q.lineRemoved=true;q.lineChanged=false;q.modelChangedEvent=null}if(v>o+z)q.lineIndex=v+x-z;q=this._getLineNext(q)}if(o<=this._maxLineIndex&&this._maxLineIndex<=o+z){this._checkMaxLineIndex=this._maxLineIndex;this._maxLineIndex=-1;this._maxLineWidth=0}this._updatePage()},_onModelChanging:function(l){l.type="ModelChanging";this.onModelChanging(l);l.type="Changing"},_queueUpdatePage:function(){if(!this._updateTimer){var l=this;this._updateTimer=
setTimeout(function(){l._updateTimer=null;l._updatePage()},0)}},_reset:function(){this._maxLineIndex=-1;this._maxLineWidth=0;this._columnX=-1;this._bottomChild=this._topChild=null;this._partialY=0;this._setSelection(new g(0,0,false),false,false);if(this._viewDiv){this._viewDiv.scrollLeft=0;this._viewDiv.scrollTop=0}var l=this._clientDiv;if(l){for(var o=l.firstChild;o;){o.lineRemoved=true;o=o.nextSibling}if(k){this._ignoreFocus=false;(o=this._hasFocus)&&l.blur();l.contentEditable=false;l.contentEditable=
true;o&&l.focus();this._ignoreFocus=false}}},_resizeTouchDiv:function(){for(var l=this._viewDiv.getBoundingClientRect(),o=this._frame.getBoundingClientRect(),q=this._frame;q;){if(q.style&&q.style.top)break;q=q.parentNode}var v=o.top;if(q)v-=q.getBoundingClientRect().top;else v+=this._parentDocument.body.scrollTop;for(q=this._frame;q;){if(q.style&&q.style.left)break;q=q.parentNode}o=o.left;if(q)o-=q.getBoundingClientRect().left;else o+=this._parentDocument.body.scrollLeft;q=this._touchDiv;q.style.left=
o+l.left+"px";q.style.top=v+l.top+"px";q.style.width=l.width+"px";q.style.height=l.height+"px"},_scrollView:function(l,o){this._ensureCaretVisible=false;var q=this._viewDiv;if(l)q.scrollLeft+=l;if(o)q.scrollTop+=o},_setClipboardText:function(l,o){var q;if(this._frameWindow.clipboardData){q=[];this._convertDelimiter(l,function(F){q.push(F)},function(){q.push(D)});return this._frameWindow.clipboardData.setData("Text",q.join(""))}if(n||k||!o){var v=this._frameWindow,x=this._frameDocument,z=x.createElement("PRE");
z.style.position="fixed";z.style.left="-1000px";this._convertDelimiter(l,function(F){z.appendChild(x.createTextNode(F))},function(){z.appendChild(x.createElement("BR"))});z.appendChild(x.createTextNode(" "));this._clientDiv.appendChild(z);l=x.createRange();l.setStart(z.firstChild,0);l.setEndBefore(z.lastChild);v=v.getSelection();v.rangeCount>0&&v.removeAllRanges();v.addRange(l);var C=this;v=function(){z&&z.parentNode===C._clientDiv&&C._clientDiv.removeChild(z);C._updateDOMSelection()};l=false;this._ignoreCopy=
true;try{l=x.execCommand("copy",false,null)}catch(A){}this._ignoreCopy=false;if(!l)if(o){setTimeout(v,0);return false}v();return true}if(o&&o.clipboardData){q=[];this._convertDelimiter(l,function(F){q.push(F)},function(){q.push(D)});return o.clipboardData.setData("text/plain",q.join(""))}},_setDOMSelection:function(l,o,q,v){for(var x=this._frameWindow,z=this._frameDocument,C,A,F,H,N=0,I=l.firstChild,O,M,Q=this._model.getLine(l.lineIndex).length;I;){O=I.firstChild;M=O.length;if(I.ignoreChars)M-=I.ignoreChars;
if(N+M>o||N+M>=Q){C=O;A=o-N;if(I.ignoreChars&&M>0&&A===M)A+=I.ignoreChars;break}N+=M;I=I.nextSibling}N=0;I=q.firstChild;for(var T=this._model.getLine(q.lineIndex).length;I;){O=I.firstChild;M=O.length;if(I.ignoreChars)M-=I.ignoreChars;if(M+N>v||N+M>=T){F=O;H=v-N;if(I.ignoreChars&&M>0&&H===M)H+=I.ignoreChars;break}N+=M;I=I.nextSibling}this._setDOMFullSelection(l,o,Q,q,v,T);if(!w)if(x.getSelection){z=z.createRange();z.setStart(C,A);z.setEnd(F,H);F=x.getSelection();this._ignoreSelect=false;F.rangeCount>
0&&F.removeAllRanges();F.addRange(z);this._ignoreSelect=true}else if(z.selection){x=z.body;z=z.createElement("DIV");x.appendChild(z);x.removeChild(z);z=x.createTextRange();z.moveToElementText(C.parentNode);z.moveStart("character",A);C=x.createTextRange();C.moveToElementText(F.parentNode);C.moveStart("character",H);z.setEndPoint("EndToStart",C);this._ignoreSelect=false;z.select();this._ignoreSelect=true}},_setDOMFullSelection:function(l,o,q,v,x,z){var C=this._model;if(this._selDiv1){var A,F;A=this._getLineBoundingClientRect(l);
if(o===0)F=A.left;else if(o>=q)F=A.right;else{this._ignoreDOMSelection=true;F=this._getBoundsAtOffset(C.getLineStart(l.lineIndex)+o).left;this._ignoreDOMSelection=false}if((q=this._textArea)&&w){q.selectionStart=q.selectionEnd=0;var H=this._frame.getBoundingClientRect(),N=this._touchDiv.getBoundingClientRect(),I=this._viewDiv.getBoundingClientRect();q.style.left=!(I.left<=F&&F<=I.left+I.width&&I.top<=A.top&&A.top<=I.top+I.height)||!(l===v&&o===x)?"-1000px":F-4+H.left-N.left+"px";q.style.top=A.top+
H.top-N.top+"px";q.style.width="6px";q.style.height=A.bottom-A.top+"px"}q=this._selDiv1;q.style.width="0px";q.style.height="0px";q=this._selDiv2;q.style.width="0px";q.style.height="0px";q=this._selDiv3;q.style.width="0px";q.style.height="0px";if(!(l===v&&o===x)){H=w?2:0;N=H+"px blue solid";var O=this._getViewPadding();I=this._clientDiv.getBoundingClientRect();var M=this._viewDiv.getBoundingClientRect();o=M.left+O.left;q=I.right;M=M.top+O.top;var Q=I.bottom;O=I=0;if(this._clipDiv){O=this._clipDiv.getBoundingClientRect();
I=O.left-this._clipDiv.scrollLeft;O=O.top}var T=this._getLineBoundingClientRect(v);if(x===0)x=T.left;else if(x>=z)x=T.right;else{this._ignoreDOMSelection=true;x=this._getBoundsAtOffset(C.getLineStart(v.lineIndex)+x).left;this._ignoreDOMSelection=false}z=this._selDiv1;F=Math.min(q,Math.max(o,F));C=Math.min(Q,Math.max(M,A.top));var E=q;A=Math.min(Q,Math.max(M,A.bottom));z.style.left=F-I+"px";z.style.top=C-O+"px";z.style.width=Math.max(0,E-F)+"px";z.style.height=Math.max(0,A-C)+(w?1:0)+"px";if(w){z.style.borderLeft=
N;z.style.borderRight="0px"}if(l===v){E=Math.min(x,q);z.style.width=Math.max(0,E-F-H*2)+"px";if(w)z.style.borderRight=N}else{l=Math.min(Q,Math.max(M,T.top));v=Math.min(q,Math.max(o,x));F=Math.min(Q,Math.max(M,T.bottom));x=this._selDiv3;x.style.left=o-I+"px";x.style.top=l-O+"px";x.style.width=Math.max(0,v-o-H)+"px";x.style.height=Math.max(0,F-l)+"px";if(w)x.style.borderRight=N;if(l-A>0){v=this._selDiv2;v.style.left=o-I+"px";v.style.top=A-O+"px";v.style.width=Math.max(0,q-o)+"px";v.style.height=Math.max(0,
l-A)+(w?1:0)+"px"}}}}},_setGrab:function(l){if(l!==this._grabControl)if(l){l.setCapture&&l.setCapture();this._grabControl=l}else{this._grabControl.releaseCapture&&this._grabControl.releaseCapture();this._grabControl=null}},_setLinksVisible:function(l){if(this._linksVisible!==l){this._linksVisible=l;if(j&&l)this._hadFocus=this._hasFocus;var o=this._clientDiv;o.contentEditable=!l;this._hadFocus&&!l&&o.focus();if(this._overlayDiv)this._overlayDiv.style.zIndex=l?"-1":"1";l=this._frameDocument;for(o=this._getLineNext();o;){if(o.hasLink)for(var q=
o.firstChild;q;){var v=q.nextSibling,x=q.viewStyle;x&&x.tagName==="A"&&o.replaceChild(this._createSpan(o,l,q.firstChild.data,x),q);q=v}o=this._getLineNext(o)}}},_setSelection:function(l,o,q,v){if(l){this._columnX=-1;if(q===undefined)q=true;var x=this._selection;if(!x.equals(l)){this._selection=l;this.onSelection({type:"Selection",oldValue:{start:x.start,end:x.end},newValue:{start:l.start,end:l.end}})}if(o)q=!this._showCaret(false,v);q&&this._updateDOMSelection()}},_setSelectionTo:function(l,o,q,v){var x=
this._model,z=this._getSelection();o=this._getYToLine(o);if(this._clickCount===1){x=this._getXToOffset(o,l);if(v&&!q)if(z.start<=x&&x<z.end){this._dragOffset=x;return false}z.extend(x);q||z.collapse()}else{if((this._clickCount&1)===0){x=this._getXToOffset(o,l);if(this._doubleClickSelection)if(x>=this._doubleClickSelection.start){q=this._doubleClickSelection.start;x=this._getOffset(x,"wordend",+1)}else{q=this._getOffset(x,"word",-1);x=this._doubleClickSelection.end}else{q=this._getOffset(x,"word",
-1);x=this._getOffset(q,"wordend",+1)}}else if(this._doubleClickSelection){v=x.getLineAtOffset(this._doubleClickSelection.start);if(o>=v){q=x.getLineStart(v);x=x.getLineEnd(o)}else{q=x.getLineStart(o);x=x.getLineEnd(v)}}else{q=x.getLineStart(o);x=x.getLineEnd(o)}z.setCaret(q);z.extend(x)}this._setSelection(z,true,true);return true},_setStyleSheet:function(l){var o=this._stylesheet;o instanceof Array||(o=[o]);this._stylesheet=l;l instanceof Array||(l=[l]);for(var q=this._frameDocument,v=q.styleSheets,
x=q.getElementsByTagName("head")[0],z=false,C=0,A,F;C<l.length;){if(C>=o.length)break;A=l[C];F=o[C];if(A!==F)if(this._isLinkURL(A))return true;else{z=v[C+1];z=z.ownerNode;F=q.createElement("STYLE");A=q.createTextNode(A);F.appendChild(A);x.replaceChild(F,z);z=true}C++}if(C<o.length)for(;C<o.length;){A=o[C];if(this._isLinkURL(A))return true;else{z=v[C+1];z=z.ownerNode;x.removeChild(z);z=true}C++}else for(;C<l.length;){A=l[C];if(this._isLinkURL(A))return true;else{F=q.createElement("STYLE");A=q.createTextNode(A);
F.appendChild(A);x.appendChild(F);z=true}C++}z&&this._updateStyle();return false},_setFullSelection:function(l,o){this._fullSelection=l;if(j<9)this._fullSelection=false;if(r)this._fullSelection=true;var q=this._clipDiv||this._scrollDiv;if(q)if(!w&&!this._fullSelection){if(this._selDiv1){q.removeChild(this._selDiv1);this._selDiv1=null}if(this._selDiv2){q.removeChild(this._selDiv2);this._selDiv2=null}if(this._selDiv3){q.removeChild(this._selDiv3);this._selDiv3=null}}else if(!this._selDiv1&&(w||this._fullSelection&&
!r)){l=this._frameDocument;this._hightlightRGB="Highlight";var v=l.createElement("DIV");this._selDiv1=v;v.id="selDiv1";v.style.position=this._clipDiv?"absolute":"fixed";v.style.borderWidth="0px";v.style.margin="0px";v.style.padding="0px";v.style.MozOutline="none";v.style.outline="none";v.style.background=this._hightlightRGB;v.style.width="0px";v.style.height="0px";v.style.zIndex="0";q.appendChild(v);var x=l.createElement("DIV");this._selDiv2=x;x.id="selDiv2";x.style.position=this._clipDiv?"absolute":
"fixed";x.style.borderWidth="0px";x.style.margin="0px";x.style.padding="0px";x.style.MozOutline="none";x.style.outline="none";x.style.background=this._hightlightRGB;x.style.width="0px";x.style.height="0px";x.style.zIndex="0";q.appendChild(x);var z=l.createElement("DIV");this._selDiv3=z;z.id="selDiv3";z.style.position=this._clipDiv?"absolute":"fixed";z.style.borderWidth="0px";z.style.margin="0px";z.style.padding="0px";z.style.MozOutline="none";z.style.outline="none";z.style.background=this._hightlightRGB;
z.style.width="0px";z.style.height="0px";z.style.zIndex="0";q.appendChild(z);if(k&&s){q=this._frameWindow.getComputedStyle(z,null).getPropertyValue("background-color");switch(q){case "rgb(119, 141, 168)":q="rgb(199, 208, 218)";break;case "rgb(127, 127, 127)":q="rgb(198, 198, 198)";break;case "rgb(255, 193, 31)":q="rgb(250, 236, 115)";break;case "rgb(243, 70, 72)":q="rgb(255, 176, 139)";break;case "rgb(255, 138, 34)":q="rgb(255, 209, 129)";break;case "rgb(102, 197, 71)":q="rgb(194, 249, 144)";break;
case "rgb(140, 78, 184)":q="rgb(232, 184, 255)";break;default:q="rgb(180, 213, 255)";break}this._hightlightRGB=q;v.style.background=q;x.style.background=q;z.style.background=q;if(!this._insertedSelRule){l.styleSheets[0].insertRule("::-moz-selection {background: "+q+"; }",0);this._insertedSelRule=true}}o||this._updateDOMSelection()}},_setTabSize:function(l,o){this._tabSize=l;this._customTabSize=undefined;l=this._clientDiv;if(m){if(l)l.style.OTabSize=this._tabSize+""}else if(k>=4){if(l)l.style.MozTabSize=
this._tabSize+""}else if(this._tabSize!==8){this._customTabSize=this._tabSize;o||this.redrawLines()}},_setThemeClass:function(l,o){this._themeClass=l;if(l=this._frameDocument){var q="viewContainer";if(this._themeClass)q+=" "+this._themeClass;l.body.className=q;o||this._updateStyle()}},_showCaret:function(l,o){if(this._clientDiv){var q=this._model,v=this._getSelection(),x=this._getScroll(),z=v.getCaret(),C=v.start,A=v.end,F=q.getLineAtOffset(C),H=q.getLineAtOffset(A),N=Math.max(Math.max(C,q.getLineStart(H)),
A-1),I=this._getViewPadding(),O=this._getClientWidth(),M=I.left;I=I.left+O;var Q=this._getBoundsAtOffset(z===C?C:N),T=Q.left,E=Q.right,G=O/4;if(l&&!v.isEmpty()&&F===H){Q=this._getBoundsAtOffset(z===A?C:N);if(O-G>(z===C?Q.right-T:E-Q.left)){if(T>Q.left)T=Q.left;if(E<Q.right)E=Q.right}}v=this._viewDiv.getBoundingClientRect();T-=v.left;E-=v.left;v=0;if(T<M)v=Math.min(T-M,-G);if(E>I)v=Math.min(this._scrollDiv.scrollWidth-x.x-O,Math.max(E-I,G));M=0;T=this._getTopIndex(true);E=this._getBottomIndex(true);
q=q.getLineAtOffset(z);I=this._getClientHeight();if(!(T<=q&&q<=E)){T=this._getLineHeight();l=l?(H-F)*T:0;M=q*T;M-=x.y;if(M+T>I){M-=I-T;if(z===C&&C!==A)M+=Math.min(I-T,l)}else if(z===A)M-=Math.min(I-T,l);if(o)if(o>0){if(M>0)M=Math.max(M,o)}else if(M<0)M=Math.min(M,o)}if(v!==0||M!==0){this._scrollView(v,M);if(I!==this._getClientHeight()||O!==this._getClientWidth())this._showCaret();else this._ensureCaretVisible=true;return true}return false}},_startIME:function(){if(this._imeOffset===-1){var l=this._getSelection();
l.isEmpty()||this._modifyContent({text:"",start:l.start,end:l.end},true);this._imeOffset=l.start}},_unhookEvents:function(){this._model.removeEventListener("Changing",this._modelListener.onChanging);this._model.removeEventListener("Changed",this._modelListener.onChanged);this._modelListener=null;for(var l=0;l<this._handlers.length;l++){var o=this._handlers[l];d(o.target,o.type,o.handler)}this._handlers=null},_updateDOMSelection:function(){if(!this._ignoreDOMSelection)if(this._clientDiv){var l=this._getSelection(),
o=this._model,q=o.getLineAtOffset(l.start),v=o.getLineAtOffset(l.end),x=this._getLineNext();if(x){var z=this._getLinePrevious(),C;if(q<x.lineIndex){C=x;q=0}else if(q>z.lineIndex){C=z;q=0}else{C=this._getLineNode(q);q=l.start-o.getLineStart(q)}if(v<x.lineIndex){x=x;l=0}else if(v>z.lineIndex){x=z;l=0}else{x=this._getLineNode(v);l=l.end-o.getLineStart(v)}this._setDOMSelection(C,q,x,l)}}},_updatePage:function(l){if(!(this._redrawCount>0)){if(this._updateTimer){clearTimeout(this._updateTimer);this._updateTimer=
null;l=false}var o=this._clientDiv;if(o){var q=this._model,v=this._getScroll(),x=this._getViewPadding(),z=q.getLineCount(),C=this._getLineHeight(),A=Math.max(0,v.y)/C,F=Math.floor(A),H=Math.max(0,F-1),N=Math.round((A-H)*C),I=this._partialY=Math.round((A-F)*C);A=z*C;var O,M;if(l){O=this._getClientWidth();M=this._getClientHeight();q=this._leftDiv?this._leftDiv.scrollWidth:0;F=Math.max(this._maxLineWidth,O)}else{var Q=this._frameDocument;v=this._getFrameWidth();M=this._getFrameHeight();Q.body.style.width=
v+"px";Q.body.style.height=M+"px";O=this._viewDiv;O.style.height=Math.max(0,M-x.top-x.bottom)+"px";M=this._getClientHeight();C=Math.floor((M+I)/C);C=Math.min(F+C,z-1);for(var T=Math.min(C+1,z-1),E=o.firstChild;E;){I=E.lineIndex;var G=E.nextSibling;if(!(H<=I&&I<=T)||E.lineRemoved||E.lineIndex===-1)if(this._mouseWheelLine===E){E.style.display="none";E.lineIndex=-1}else o.removeChild(E);E=G}E=this._getLineNext();G=Q.createDocumentFragment();for(I=H;I<=T;I++)if(!E||E.lineIndex>I)this._createLine(G,null,
Q,I,q);else{if(G.firstChild){o.insertBefore(G,E);G=Q.createDocumentFragment()}if(E&&E.lineChanged){E=this._createLine(G,E,Q,I,q);E.lineChanged=false}E=this._getLineNext(E)}G.firstChild&&o.insertBefore(G,E);if(r)o.style.width=(524287).toString()+"px";for(E=this._getLineNext();E;){H=E.lineWidth;if(H===undefined){H=this._getLineBoundingClientRect(E);H=E.lineWidth=H.right-H.left}if(H>=this._maxLineWidth){this._maxLineWidth=H;this._maxLineIndex=E.lineIndex}if(E.lineIndex===F)this._topChild=E;if(E.lineIndex===
C)this._bottomChild=E;if(this._checkMaxLineIndex===E.lineIndex)this._checkMaxLineIndex=-1;E=this._getLineNext(E)}if(this._checkMaxLineIndex!==-1){I=this._checkMaxLineIndex;this._checkMaxLineIndex=-1;if(0<=I&&I<z){q=this._createLine(o,null,Q,I,q);H=this._getLineBoundingClientRect(q);H=H.right-H.left;if(H>=this._maxLineWidth){this._maxLineWidth=H;this._maxLineIndex=I}o.removeChild(q)}}this._updateRuler(this._leftDiv,F,C);this._updateRuler(this._rightDiv,F,C);q=this._leftDiv?this._leftDiv.scrollWidth:
0;F=this._rightDiv?this._rightDiv.scrollWidth:0;O.style.left=q+"px";O.style.width=Math.max(0,v-q-F-x.left-x.right)+"px";if(this._rightDiv)this._rightDiv.style.left=v-F+"px";v=this._scrollDiv;v.style.height=A+"px";O=this._getClientWidth();F=z=Math.max(this._maxLineWidth,O);if(!j||j>=9)z+=x.right;v.style.width=z+"px";if(this._clipScrollDiv)this._clipScrollDiv.style.width=z+"px";v=this._getScroll();z=M+x.top+x.bottom;this._updateRulerSize(this._leftDiv,z);this._updateRulerSize(this._rightDiv,z)}I=v.x;
C=this._clipDiv;z=this._overlayDiv;if(C){C.scrollLeft=I;H=q+x.left;Q=x.top;l=O;q=M;I=0;E=-N;if(v.x===0){H-=x.left;l+=x.left;I=x.left}if(v.x+O===F)l+=x.right;if(v.y===0){Q-=x.top;q+=x.top;E+=x.top}if(v.y+M===A)q+=x.bottom;C.style.left=H+"px";C.style.top=Q+"px";C.style.width=l+"px";C.style.height=q+"px";o.style.left=I+"px";o.style.top=E+"px";o.style.width=F+"px";o.style.height=M+N+"px";if(z){z.style.left=o.style.left;z.style.top=o.style.top;z.style.width=o.style.width;z.style.height=o.style.height}}else{H=
I;Q=N;C=I+O;E=N+M;if(H===0)H-=x.left;if(Q===0)Q-=x.top;if(C===F)C+=x.right;if(v.y+M===A)E+=x.bottom;o.style.clip="rect("+Q+"px,"+C+"px,"+E+"px,"+H+"px)";o.style.left=-I+q+x.left+"px";o.style.width=(r?F:O+I)+"px";if(!l){o.style.top=-N+x.top+"px";o.style.height=M+N+"px"}if(z){z.style.clip=o.style.clip;z.style.left=o.style.left;z.style.width=o.style.width;if(!l){z.style.top=o.style.top;z.style.height=o.style.height}}}this._updateDOMSelection();o=this._ensureCaretVisible;this._ensureCaretVisible=false;
if(M!==this._getClientHeight()){this._updatePage();o&&this._showCaret()}if(w){var K=this;setTimeout(function(){K._resizeTouchDiv()},0)}}}},_updateRulerSize:function(l,o){if(l){for(var q=this._partialY,v=this._getLineHeight(),x=l.firstChild.rows[0].cells,z=0;z<x.length;z++){var C=x[z].firstChild,A=v;if(C._ruler.getOverview()==="page")A+=q;C.style.top=-A+"px";C.style.height=o+A+"px"}l.style.height=o+"px"}},_updateRuler:function(l,o,q){if(l){l=l.firstChild.rows[0].cells;for(var v=this._getLineHeight(),
x=this._frameDocument,z=this._getViewPadding(),C=0;C<l.length;C++){var A=l[C].firstChild,F=A._ruler;A.rulerChanged&&this._applyStyle(F.getRulerStyle(),A);var H,N=A.firstChild;if(N){H=N;N=N.nextSibling}else{H=x.createElement("DIV");H.style.visibility="hidden";A.appendChild(H)}var I,O;if(A.rulerChanged)if(H){I=-1;if(O=F.getWidestAnnotation()){this._applyStyle(O.style,H);if(O.html)H.innerHTML=O.html}H.lineIndex=I;H.style.height=v+z.top+"px"}var M,Q;if(F.getOverview()==="page"){for(F=F.getAnnotations(o,
q+1);N;){I=N.lineIndex;O=N.nextSibling;if(!(o<=I&&I<=q)||N.lineChanged)A.removeChild(N);N=O}N=A.firstChild.nextSibling;Q=x.createDocumentFragment();for(I=o;I<=q;I++)if(!N||N.lineIndex>I){M=x.createElement("DIV");if(O=F[I]){this._applyStyle(O.style,M);if(O.html)M.innerHTML=O.html;M.annotation=O}M.lineIndex=I;M.style.height=v+"px";Q.appendChild(M)}else{if(Q.firstChild){A.insertBefore(Q,N);Q=x.createDocumentFragment()}if(N)N=N.nextSibling}Q.firstChild&&A.insertBefore(Q,N)}else{N=w?0:17;O=this._getClientHeight();
I=this._model.getLineCount();H=O+z.top+z.bottom-2*N;var T;T=v*I<H?v:H/I;if(A.rulerChanged){for(O=A.childNodes.length;O>1;){A.removeChild(A.lastChild);O--}F=F.getAnnotations(0,I);Q=x.createDocumentFragment();for(var E in F){I=E>>>0;if(!(I<0)){M=x.createElement("DIV");O=F[E];this._applyStyle(O.style,M);M.style.position="absolute";M.style.top=N+v+Math.floor(I*T)+"px";if(O.html)M.innerHTML=O.html;M.annotation=O;M.lineIndex=I;Q.appendChild(M)}}A.appendChild(Q)}else if(A._oldTrackHeight!==H)for(M=A.firstChild?
A.firstChild.nextSibling:null;M;){M.style.top=N+v+Math.floor(M.lineIndex*T)+"px";M=M.nextSibling}A._oldTrackHeight=H}A.rulerChanged=false}}},_updateStyle:function(){var l=this._frameDocument;if(j)l.body.style.lineHeight="normal";var o=this._metrics=this._calculateMetrics();if(j)l.body.style.lineHeight=o.lineHeight-(o.lineTrim.top+o.lineTrim.bottom)+"px";this.redraw()}};a.EventTarget.addMixin(h.prototype);return{TextView:h}});
define("orion/textview/projectionTextModel",["orion/textview/textModel","orion/textview/eventTarget"],function(f,e){function a(c){this._model=c;this._projections=[]}a.prototype={addProjection:function(c){if(c){var d=this._model,g=this._projections;c._lineIndex=d.getLineAtOffset(c.start);c._lineCount=d.getLineAtOffset(c.end)-c._lineIndex;var h=c.text;h||(h="");c._model=typeof h==="string"?new f.TextModel(h,d.getLineDelimiter()):h;d=this.mapOffset(c.start,true);h=c.end-c.start;var i=c._lineCount,j=
c._model.getCharCount(),k=c._model.getLineCount()-1;this.onChanging({type:"Changing",text:c._model.getText(),start:d,removedCharCount:h,addedCharCount:j,removedLineCount:i,addedLineCount:k});var m=this._binarySearch(g,c.start);g.splice(m,0,c);this.onChanged({type:"Changed",start:d,removedCharCount:h,addedCharCount:j,removedLineCount:i,addedLineCount:k})}},getProjections:function(){return this._projections.slice(0)},getBaseModel:function(){return this._model},mapOffset:function(c,d){var g=this._projections,
h=0,i;if(d){for(d=0;d<g.length;d++){i=g[d];if(i.start>c)break;if(i.end>c)return-1;h+=i._model.getCharCount()-(i.end-i.start)}return c+h}for(d=0;d<g.length;d++){i=g[d];if(i.start>c-h)break;var j=i._model.getCharCount();if(i.start+j>c-h)return-1;h+=j-(i.end-i.start)}return c-h},removeProjection:function(c){var d,g=0;for(d=0;d<this._projections.length;d++){var h=this._projections[d];if(h===c){c=h;break}g+=h._model.getCharCount()-(h.end-h.start)}if(d<this._projections.length){h=this._model;g=c.start+
g;var i=c.end-c.start,j=c._lineCount,k=c._model.getCharCount(),m=c._model.getLineCount()-1;this.onChanging({type:"Changing",text:h.getText(c.start,c.end),start:g,removedCharCount:k,addedCharCount:i,removedLineCount:m,addedLineCount:j});this._projections.splice(d,1);this.onChanged({type:"Changed",start:g,removedCharCount:k,addedCharCount:i,removedLineCount:m,addedLineCount:j})}},_binarySearch:function(c,d){for(var g=c.length,h=-1,i;g-h>1;){i=Math.floor((g+h)/2);if(d<=c[i].start)g=i;else h=i}return g},
getCharCount:function(){for(var c=this._model.getCharCount(),d=this._projections,g=0;g<d.length;g++){var h=d[g];c+=h._model.getCharCount()-(h.end-h.start)}return c},getLine:function(c,d){if(c<0)return null;var g=this._model,h=this._projections,i=0,j=[],k=0,m,n,p;for(m=0;m<h.length;m++){p=h[m];if(p._lineIndex>=c-i)break;n=p._model.getLineCount()-1;if(p._lineIndex+n>=c-i){k=c-(p._lineIndex+i);if(k<n)return p._model.getLine(k,d);else j.push(p._model.getLine(n))}k=p.end;i+=n-p._lineCount}for(k=Math.max(k,
g.getLineStart(c-i));m<h.length;m++){p=h[m];if(p._lineIndex>c-i)break;j.push(g.getText(k,p.start));n=p._model.getLineCount()-1;if(p._lineIndex+n>c-i){j.push(p._model.getLine(0,d));return j.join("")}j.push(p._model.getText());k=p.end;i+=n-p._lineCount}c=g.getLineEnd(c-i,d);k<c&&j.push(g.getText(k,c));return j.join("")},getLineAtOffset:function(c){for(var d=this._model,g=this._projections,h=0,i=0,j=0;j<g.length;j++){var k=g[j];if(k.start>c-h)break;var m=k._model.getCharCount();if(k.start+m>c-h){g=c-
(k.start+h);i+=k._model.getLineAtOffset(g);h+=g;break}i+=k._model.getLineCount()-1-k._lineCount;h+=m-(k.end-k.start)}return d.getLineAtOffset(c-h)+i},getLineCount:function(){for(var c=this._projections,d=this._model.getLineCount(),g=0;g<c.length;g++){var h=c[g];d+=h._model.getLineCount()-1-h._lineCount}return d},getLineDelimiter:function(){return this._model.getLineDelimiter()},getLineEnd:function(c,d){if(c<0)return-1;for(var g=this._model,h=this._projections,i=0,j=0,k=0;k<h.length;k++){var m=h[k];
if(m._lineIndex>c-i)break;var n=m._model.getLineCount()-1;if(m._lineIndex+n>c-i)return m._model.getLineEnd(c-(m._lineIndex+i),d)+m.start+j;j+=m._model.getCharCount()-(m.end-m.start);i+=n-m._lineCount}return g.getLineEnd(c-i,d)+j},getLineStart:function(c){if(c<0)return-1;for(var d=this._model,g=this._projections,h=0,i=0,j=0;j<g.length;j++){var k=g[j];if(k._lineIndex>=c-h)break;var m=k._model.getLineCount()-1;if(k._lineIndex+m>=c-h)return k._model.getLineStart(c-(k._lineIndex+h))+k.start+i;i+=k._model.getCharCount()-
(k.end-k.start);h+=m-k._lineCount}return d.getLineStart(c-h)+i},getText:function(c,d){if(c===undefined)c=0;var g=this._model,h=this._projections,i=0,j=[],k,m,n;for(k=0;k<h.length;k++){m=h[k];if(m.start>c-i)break;n=m._model.getCharCount();if(m.start+n>c-i)if(d!==undefined&&m.start+n>d-i)return m._model.getText(c-(m.start+i),d-(m.start+i));else{j.push(m._model.getText(c-(m.start+i)));c=m.end+i+n-(m.end-m.start)}i+=n-(m.end-m.start)}c=c-i;if(d!==undefined){for(;k<h.length;k++){m=h[k];if(m.start>d-i)break;
j.push(g.getText(c,m.start));n=m._model.getCharCount();if(m.start+n>d-i){j.push(m._model.getText(0,d-(m.start+i)));return j.join("")}j.push(m._model.getText());c=m.end;i+=n-(m.end-m.start)}j.push(g.getText(c,d-i))}else{for(;k<h.length;k++){m=h[k];j.push(g.getText(c,m.start));j.push(m._model.getText());c=m.end}j.push(g.getText(c))}return j.join("")},_onChanging:function(c,d,g,h,i,j){for(var k=this._model,m=this._projections,n,p=0,r,w=d+g;n<m.length;n++){g=m[n];if(g.start>d)break;p+=g._model.getCharCount()-
(g.end-g.start)}d=d+p;for(var s=n;n<m.length;n++){g=m[n];if(g.start>w)break;p+=g._model.getCharCount()-(g.end-g.start);r+=g._model.getLineCount()-1-g._lineCount}g=w+p;p=n;this.onChanging(d,g-d,h,i+r,j);m.splice(m,p-s);for(c=c.length-(g-d);n<m.length;n++){g=m[n];g.start+=c;g.end+=c;g._lineIndex=k.getLineAtOffset(g.start)}},onChanging:function(c){return this.dispatchEvent(c)},onChanged:function(c){return this.dispatchEvent(c)},setLineDelimiter:function(c){this._model.setLineDelimiter(c)},setText:function(c,
d,g){if(c===undefined)c="";if(d===undefined)d=0;var h=d,i=g,j=this._model,k=this._projections,m=0,n=0,p,r,w,s,u,t=0;for(p=0;p<k.length;p++){r=k[p];if(r.start>d-m)break;w=r._model.getCharCount();if(r.start+w>d-m)if(g!==undefined&&r.start+w>g-m){r._model.setText(c,d-(r.start+m),g-(r.start+m));return}else{t=r._model.getLineCount()-1-r._model.getLineAtOffset(d-(r.start+m));s={projection:r,start:d-(r.start+m)};d=r.end+m+w-(r.end-r.start)}n+=r._model.getLineCount()-1-r._lineCount;m+=w-(r.end-r.start)}d=
d-m;var y=p;t=j.getLineAtOffset(d)+n-t;if(g!==undefined)for(;p<k.length;p++){r=k[p];if(r.start>g-m)break;w=r._model.getCharCount();if(r.start+w>g-m){n+=r._model.getLineAtOffset(g-(r.start+m));w=g-(r.start+m);g=r.end+m;u={projection:r,end:w};break}n+=r._model.getLineCount()-1-r._lineCount;m+=w-(r.end-r.start)}else{for(;p<k.length;p++){r=k[p];n+=r._model.getLineCount()-1-r._lineCount;m+=r._model.getCharCount()-(r.end-r.start)}g=i=j.getCharCount()+m}g=g-m;p=p;r=j.getLineAtOffset(g)+n;i=i-h;n=r-t;t=c.length;
for(var B=w=r=m=0;;){if(r!==-1&&r<=B)r=c.indexOf("\r",B);if(w!==-1&&w<=B)w=c.indexOf("\n",B);if(w===-1&&r===-1)break;B=r!==-1&&w!==-1?r+1===w?w+1:(r<w?r:w)+1:r!==-1?r+1:w+1;m++}this.onChanging({type:"Changing",text:c,start:h,removedCharCount:i,addedCharCount:t,removedLineCount:n,addedLineCount:m});j.setText(c,d,g);if(s){r=s.projection;r._model.setText("",s.start)}if(u){r=u.projection;r._model.setText("",0,u.end);r.start=r.end;r._lineCount=0}k.splice(y,p-y);c=c.length-(g-d);for(p=p;p<k.length;p++){r=
k[p];r.start+=c;r.end+=c;r._lineIndex=j.getLineAtOffset(r.start)}this.onChanged({type:"Changed",start:h,removedCharCount:i,addedCharCount:t,removedLineCount:n,addedLineCount:m})}};e.EventTarget.addMixin(a.prototype);return{ProjectionTextModel:a}});
define("orion/textview/tooltip",["i18n!orion/textview/nls/messages","orion/textview/textView","orion/textview/textModel","orion/textview/projectionTextModel"],function(f,e,a,c){function d(g){this._view=g;this._create(g._parent.ownerDocument);g.addEventListener("Destroy",this,this.destroy)}d.getTooltip=function(g){if(!g._tooltip)g._tooltip=new d(g);return g._tooltip};d.prototype={_create:function(g){if(!this._domNode){this._document=g;var h=this._domNode=g.createElement("DIV");h.className="viewTooltip";
var i=this._viewParent=g.createElement("DIV");h.appendChild(i);i=this._htmlParent=g.createElement("DIV");h.appendChild(i);g.body.appendChild(h);this.hide()}},destroy:function(){if(this._domNode){if(this._contentsView){this._contentsView.destroy();this._emptyModel=this._contentsView=null}var g=this._domNode.parentNode;g&&g.removeChild(this._domNode);this._domNode=null}},hide:function(){this._contentsView&&this._contentsView.setModel(this._emptyModel);if(this._viewParent){this._viewParent.style.left=
"-10000px";this._viewParent.style.position="fixed";this._viewParent.style.visibility="hidden"}if(this._htmlParent){this._htmlParent.style.left="-10000px";this._htmlParent.style.position="fixed";this._htmlParent.style.visibility="hidden";this._htmlParent.innerHTML=""}if(this._domNode)this._domNode.style.visibility="hidden";if(this._showTimeout){clearTimeout(this._showTimeout);this._showTimeout=null}if(this._hideTimeout){clearTimeout(this._hideTimeout);this._hideTimeout=null}if(this._fadeTimeout){clearInterval(this._fadeTimeout);
this._fadeTimeout=null}},isVisible:function(){return this._domNode&&this._domNode.style.visibility==="visible"},setTarget:function(g){if(this.target!==g){this._target=g;this.hide();if(g){var h=this;h._showTimeout=setTimeout(function(){h.show(true)},1E3)}}},show:function(g){if(this._target){var h=this._target.getTooltipInfo();if(h){var i=this._domNode;i.style.left=i.style.right=i.style.width=i.style.height="auto";var j=h.contents,k;if(j instanceof Array)j=this._getAnnotationContents(j);if(typeof j===
"string")(k=this._htmlParent).innerHTML=j;else if(j instanceof Node)(k=this._htmlParent).appendChild(j);else if(j instanceof c.ProjectionTextModel){if(!this._contentsView){this._emptyModel=new a.TextModel("");k=this._contentsView=new e.TextView({model:this._emptyModel,parent:this._viewParent,tabSize:4,sync:true,stylesheet:["/orion/textview/tooltip.css","/orion/textview/rulers.css","/examples/textview/textstyler.css","/css/default-theme.css"]});k._clientDiv.contentEditable=false;var m=this._view;k.addEventListener("LineStyle",
{onLineStyle:function(p){m.onLineStyle(p)}}.onLineStyle)}k=this._contentsView;k.setModel(j);j=k.computeSize();k=this._viewParent;k.style.width=j.width+20+"px";k.style.height=j.height+"px"}else return;k.style.left="auto";k.style.position="static";k.style.visibility="visible";j=parseInt(this._getNodeStyle(i,"padding-left","0"),10);j+=parseInt(this._getNodeStyle(i,"border-left-width","0"),10);if(h.anchor==="right"){k=parseInt(this._getNodeStyle(i,"padding-right","0"),10);k+=parseInt(this._getNodeStyle(i,
"border-right-width","0"),10);i.style.right=i.ownerDocument.body.getBoundingClientRect().right-h.x+j+k+"px"}else i.style.left=h.x-j+"px";j=parseInt(this._getNodeStyle(i,"padding-top","0"),10);j+=parseInt(this._getNodeStyle(i,"border-top-width","0"),10);i.style.top=h.y-j+"px";i.style.maxWidth=h.maxWidth+"px";i.style.maxHeight=h.maxHeight+"px";i.style.opacity="1";i.style.visibility="visible";if(g){var n=this;n._hideTimeout=setTimeout(function(){var p=parseFloat(n._getNodeStyle(i,"opacity","1"));n._fadeTimeout=
setInterval(function(){if(i.style.visibility==="visible"&&p>0){p-=0.1;i.style.opacity=p}else n.hide()},50)},5E3)}}}},_getAnnotationContents:function(g){function h(p,r){p=j.getLineStart(j.getLineAtOffset(p));r=j.getLineEnd(j.getLineAtOffset(r),true);return j.getText(p,r)}if(g.length===0)return null;var i=this._view.getModel(),j=i.getBaseModel?i.getBaseModel():i,k;if(g.length===1){i=g[0];if(i.title){k=i.title.replace(/</g,"&lt;").replace(/>/g,"&gt;");return"<div>"+i.html+"&nbsp;<span style='vertical-align:middle;'>"+
k+"</span><div>"}else{g=new c.ProjectionTextModel(j);k=j.getLineStart(j.getLineAtOffset(i.start));g.addProjection({start:i.end,end:g.getCharCount()});g.addProjection({start:0,end:k});return g}}else{for(var m="<div><em>"+f.multipleAnnotations+"</em></div>",n=0;n<g.length;n++){i=g[n];(k=i.title)||(k=h(i.start,i.end));k=k.replace(/</g,"&lt;").replace(/>/g,"&gt;");m+="<div>"+i.html+"&nbsp;<span style='vertical-align:middle;'>"+k+"</span><div>"}return m}},_getNodeStyle:function(g,h,i){var j;if(g){j=g.style[h];
if(!j)if(g.currentStyle){j=0;for(h=h;(j=h.indexOf("-",j))!==-1;)h=h.substring(0,j)+h.substring(j+1,j+2).toUpperCase()+h.substring(j+2);j=g.currentStyle[h]}else j=(g=g.ownerDocument.defaultView.getComputedStyle(g,null))?g.getPropertyValue(h):null}return j||i}};return{Tooltip:d}});
define("orion/editor/editor",["i18n!orion/editor/nls/messages","orion/textview/keyBinding","orion/textview/eventTarget","orion/textview/tooltip"],function(f,e,a,c){function d(h){this._textViewFactory=h.textViewFactory;this._undoStackFactory=h.undoStackFactory;this._textDNDFactory=h.textDNDFactory;this._annotationFactory=h.annotationFactory;this._foldingRulerFactory=h.foldingRulerFactory;this._lineNumberRulerFactory=h.lineNumberRulerFactory;this._contentAssistFactory=h.contentAssistFactory;this._keyBindingFactory=
h.keyBindingFactory;this._statusReporter=h.statusReporter;this._domNode=h.domNode;this._syntaxHighlightProviders=h.syntaxHighlightProviders;this._foldingRuler=this._overviewRuler=this._annotationRuler=null;this._dirty=false;this._title=this._contentAssist=null;this._keyModes=[]}var g;d.prototype={errorType:"orion.annotation.error",warningType:"orion.annotation.warning",taskType:"orion.annotation.task",foldingType:"orion.annotation.folding",currentBracketType:"orion.annotation.currentBracket",matchingBracketType:"orion.annotation.matchingBracket",
currentLineType:"orion.annotation.currentLine",highlightErrorType:"orion.annotation.highlightError",getTextView:function(){return this._textView},reportStatus:function(h,i){this._statusReporter?this._statusReporter(h,i):window.alert(i==="error"?"ERROR: "+h:h)},getModel:function(){var h=this._textView.getModel();if(h.getBaseModel)h=h.getBaseModel();return h},mapOffset:function(h,i){var j=this._textView.getModel();if(j.getBaseModel)h=j.mapOffset(h,i);return h},getCaretOffset:function(){return this.mapOffset(this._textView.getCaretOffset())},
getSelection:function(){var h=this._textView,i=h.getSelection();h=h.getModel();if(h.getBaseModel){i.start=h.mapOffset(i.start);i.end=h.mapOffset(i.end)}return i},getText:function(h,i){var j=this._textView.getModel();if(j.getBaseModel)j=j.getBaseModel();return j.getText(h,i)},_expandOffset:function(h){var i=this._textView.getModel(),j=this._annotationModel;if(j&&i.getBaseModel)for(h=j.getAnnotations(h,h+1);h.hasNext();){i=h.next();if(i.type==="orion.annotation.folding")if(i.expand){i.expand();j.modifyAnnotation(i)}}},
setCaretOffset:function(h){var i=this._textView,j=i.getModel();if(j.getBaseModel){this._expandOffset(h);h=j.mapOffset(h,true)}i.setCaretOffset(h)},setText:function(h,i,j){var k=this._textView,m=k.getModel();if(m.getBaseModel){if(i!==undefined){this._expandOffset(i);i=m.mapOffset(i,true)}if(j!==undefined){this._expandOffset(j);j=m.mapOffset(j,true)}}k.setText(h,i,j)},setFoldingEnabled:function(h){this._foldingEnabled=h;this._updateFoldingRuler()},_updateFoldingRuler:function(){var h=this._textView;
if(this._foldingEnabled){if(!this._foldingRuler&&this._foldingRulerFactory&&h.getModel().getBaseModel&&this._foldingEnabled){h.annotationModel=this._annotationModel;this._foldingRuler=this._foldingRulerFactory.createFoldingRuler(this._annotationModel);this._foldingRuler.addAnnotationType(this.foldingType);h.addRuler(this._foldingRuler)}}else if(this._foldingRuler){h.removeRuler(this._foldingRuler);this._foldingRuler=null}},setSelection:function(h,i,j){var k=this._textView,m=k.getModel();if(m.getBaseModel){this._expandOffset(h);
this._expandOffset(i);h=m.mapOffset(h,true);i=m.mapOffset(i,true)}k.setSelection(h,i,j)},moveSelection:function(h,i,j){i=i||h;var k=this._textView;this.setSelection(h,i,false);i=k.getTopPixel();var m=k.getBottomPixel();h=this.getModel().getLineAtOffset(h);h=k.getLinePixel(h);if(h<i||h>m){m=Math.max(0,h-Math.floor((h<i?3:1)*(m-i)/4));(new g.Animation({node:k,duration:300,curve:[i,m],onAnimate:function(n){k.setTopPixel(Math.floor(n))},onEnd:function(){k.showSelection();k.focus();j&&j()}})).play()}else{k.showSelection();
k.focus();j&&j()}},isDirty:function(){return this._dirty},setDirty:function(h){if(this._dirty!==h){this._dirty=h;this.onDirtyChanged({type:"DirtyChanged"})}},checkDirty:function(){this.setDirty(!this._undoStack.isClean())},_getTooltipInfo:function(h,i){var j=this._textView,k=this.getAnnotationModel();if(!k)return null;var m=this._annotationStyler;if(!m)return null;var n=j.getOffsetAtLocation(h,i);if(n===-1)return null;n=this.mapOffset(n);m=m.getAnnotationsByType(k,n,n+1);k=[];for(n=0;n<m.length;n++)m[n].rangeStyle&&
k.push(m[n]);if(k.length===0)return null;h=j.convert({x:h,y:i},"document","page");return{contents:k,anchor:"left",x:h.x+10,y:h.y+20}},getAnnotationModel:function(){return this._annotationModel},doFind:function(h,i,j,k){var m=this.getText();if(j){h=h.toLowerCase();m=m.toLowerCase()}if(k){m=m.split("").reverse().join("");h=h.split("").reverse().join("");i=m.length-i-1;i=m.indexOf(h,i);if(i!==-1)return{index:m.length-h.length-i,length:h.length}}else{i=m.indexOf(h,i);if(i!==-1)return{index:i,length:h.length}}return null},
doFindRegExp:function(h,i,j,k){if(!h)return null;i=i||"";i+=(i.indexOf("g")===-1?"g":"")+(i.indexOf("m")===-1?"m":"");h=new RegExp(h,i);i=this.getText();var m=null,n=null;if(k)for(;;)if((m=h.exec(i))&&m.index<=j)n={index:m.index,length:m[0].length};else return n;else return(m=h.exec(i.substring(j)))&&{index:m.index+j,length:m[0].length}},_highlightCurrentLine:function(h,i){var j=this._annotationModel;if(j){var k=this._textView.getModel(),m=i?k.getLineAtOffset(i.start):-1,n=k.getLineAtOffset(h.start);
h=h.start===h.end;i=!i||i.start===i.end;if(!(m===n&&i&&h)){m=this._currentLineAnnotation?[this._currentLineAnnotation]:null;this._currentLineAnnotation=null;var p;if(h){p=k.getLineStart(n);n=k.getLineEnd(n);if(k.getBaseModel){p=k.mapOffset(p);n=k.mapOffset(n)}this._currentLineAnnotation={start:p,end:n,type:this.currentLineType,title:f.currentLine,html:"<div class='annotationHTML currentLine'></div>",overviewStyle:{styleClass:"annotationOverview currentLine"},lineStyle:{styleClass:"annotationLine currentLine"}};
p=[this._currentLineAnnotation]}j.replaceAnnotations(m,p)}}},highlightAnnotations:function(){if(this._annotationStyler){this._annotationStyler.destroy();this._annotationStyler=null}if(this._annotationFactory){this._annotationStyler=this._annotationFactory.createAnnotationStyler(this.getTextView(),this._annotationModel);this._annotationStyler.addAnnotationType(this.errorType);this._annotationStyler.addAnnotationType(this.warningType);this._annotationStyler.addAnnotationType(this.matchingBracketType);
this._annotationStyler.addAnnotationType(this.currentBracketType);this._annotationStyler.addAnnotationType(this.currentLineType);this._annotationStyler.addAnnotationType(this.highlightErrorType)}},installTextView:function(){this._textView=this._textViewFactory();if(this._undoStackFactory)this._undoStack=this._undoStackFactory.createUndoStack(this);if(this._textDNDFactory)this._textDND=this._textDNDFactory.createTextDND(this,this._undoStack);if(this._contentAssistFactory){this._contentAssist=this._contentAssistFactory(this);
this._keyModes.push(this._contentAssist)}var h=this,i=this._textView,j=this;this._listener={onModelChanged:function(){j.checkDirty()},onMouseOver:function(m){j._listener.onMouseMove(m)},onMouseMove:function(m){var n=c.Tooltip.getTooltip(i);n&&n.setTarget({x:m.x,y:m.y,getTooltipInfo:function(){return j._getTooltipInfo(this.x,this.y)}})},onMouseOut:function(){var m=c.Tooltip.getTooltip(i);m&&m.setTarget(null)},onSelection:function(m){j._updateCursorStatus();j._highlightCurrentLine(m.newValue,m.oldValue)}};
i.addEventListener("ModelChanged",this._listener.onModelChanged);i.addEventListener("Selection",this._listener.onSelection);i.addEventListener("MouseOver",this._listener.onMouseOver);i.addEventListener("MouseOut",this._listener.onMouseOut);i.addEventListener("MouseMove",this._listener.onMouseMove);this._keyBindingFactory&&this._keyBindingFactory(this,this._keyModes,this._undoStack,this._contentAssist);i.setKeyBinding(new e.KeyBinding(27),"Cancel Current Mode");i.setAction("Cancel Current Mode",function(){for(var m=
false,n=0;n<this._keyModes.length;n++)if(this._keyModes[n].isActive())m=this._keyModes[n].cancel()||m;return m}.bind(this));i.setAction("lineUp",function(){for(var m=0;m<this._keyModes.length;m++)if(this._keyModes[m].isActive())return this._keyModes[m].lineUp();return false}.bind(this));i.setAction("lineDown",function(){for(var m=0;m<this._keyModes.length;m++)if(this._keyModes[m].isActive())return this._keyModes[m].lineDown();return false}.bind(this));i.setAction("enter",function(){for(var m=0;m<
this._keyModes.length;m++)if(this._keyModes[m].isActive())return this._keyModes[m].enter();return false}.bind(this));if(this._annotationFactory){var k=i.getModel();if(k.getBaseModel)k=k.getBaseModel();this._annotationModel=this._annotationFactory.createAnnotationModel(k);k=this._annotationFactory.createAnnotationRulers(this._annotationModel);this._annotationRuler=k.annotationRuler;this._annotationRuler.onClick=function(m){if(m!==undefined)if(m!==-1){var n=i.getModel(),p=this.getAnnotationModel(),
r=h.mapOffset(n.getLineStart(m));m=h.mapOffset(n.getLineEnd(m));for(m=p.getAnnotations(r,m);m.hasNext();){p=m.next();if(this.isAnnotationTypeVisible(p.type)){m=h.getModel();h.onGotoLine(m.getLineAtOffset(r),p.start-r,p.end-r);break}}}};this._overviewRuler=k.overviewRuler;this._overviewRuler.onClick=function(m){if(m!==undefined){m=i.getModel().getLineStart(m);h.moveSelection(h.mapOffset(m))}};this._annotationRuler.setMultiAnnotationOverlay({html:"<div class='annotationHTML overlay'></div>"});this._annotationRuler.addAnnotationType(this.errorType);
this._annotationRuler.addAnnotationType(this.warningType);this._annotationRuler.addAnnotationType(this.taskType);this._overviewRuler.addAnnotationType(this.errorType);this._overviewRuler.addAnnotationType(this.warningType);this._overviewRuler.addAnnotationType(this.taskType);this._overviewRuler.addAnnotationType(this.matchingBracketType);this._overviewRuler.addAnnotationType(this.currentBracketType);this._overviewRuler.addAnnotationType(this.currentLineType);i.addRuler(this._annotationRuler);i.addRuler(this._overviewRuler)}if(this._lineNumberRulerFactory){this._lineNumberRuler=
this._lineNumberRulerFactory.createLineNumberRuler(this._annotationModel);i.addRuler(this._lineNumberRuler)}this._updateFoldingRuler();this.dispatchEvent({type:"TextViewInstalled",textView:i})},_updateCursorStatus:function(){var h=this.getModel(),i=this.getCaretOffset(),j=h.getLineAtOffset(i);h=h.getLineStart(j);i=i-h;for(h=0;h<this._keyModes.length;h++){var k=this._keyModes[h];if(k.isActive()&&k.isStatusActive&&k.isStatusActive())return}this.reportStatus(f.formatMessage(f.lineColumn,j+1,i+1))},showProblems:function(h){var i=
this._annotationModel;if(i){for(var j=[],k=[],m=i.getTextModel(),n=i.getAnnotations(0,m.getCharCount()),p;n.hasNext();){p=n.next();if(p.type===this.errorType||p.type===this.warningType)j.push(p)}if(h)for(n=0;n<h.length;n++)if(p=h[n]){var r=p.description.replace(/'/g,"&#39;").replace(/"/g,"&#34;"),w=m.getLineStart(p.line-1),s=p.severity;p={type:this[s+"Type"],start:w+p.start-1,end:w+p.end,title:r,html:"<div class='annotationHTML "+s+"'></div>",style:{styleClass:"annotation "+s},overviewStyle:{styleClass:"annotationOverview "+
s},rangeStyle:{styleClass:"annotationRange "+s}};k.push(p)}i.replaceAnnotations(j,k)}},showSelection:function(h,i,j,k,m){if(typeof h==="number"){if(typeof i!=="number")i=h;this.moveSelection(h,i)}else if(typeof j==="number"){h=this.getModel().getLineStart(j-1);if(typeof k==="number")h+=k;if(typeof m!=="number")m=0;this.moveSelection(h,h+m)}},setInput:function(h,i,j,k){this._title=h;if(this._textView)if(k){this._undoStack.markClean();this.checkDirty()}else{if(i)this._textView.setText(i);else if(j!==
null&&j!==undefined){this._textView.setText(j);this._textView.getModel().setLineDelimiter("auto");this._highlightCurrentLine(this._textView.getSelection())}this._undoStack.reset();this.checkDirty();this._textView.focus()}this.onInputChanged({type:"InputChanged",title:h,message:i,contents:j,contentsSaved:k})},onInputChanged:function(h){return this.dispatchEvent(h)},onGotoLine:function(h,i,j){if(this._textView){var k=this.getModel(),m=k.getLineStart(h),n=0;if(j===undefined)j=0;if(typeof i==="string"){h=
k.getLine(h).indexOf(i);if(h!==-1){n=h;j=n+i.length}}else{n=i;i=k.getLineEnd(h)-m;n=Math.min(n,i);j=Math.min(j,i)}this.moveSelection(m+n,m+j)}},onDirtyChanged:function(h){return this.dispatchEvent(h)},getTitle:function(){return this._title}};a.EventTarget.addMixin(d.prototype);g={Animation:function(){function h(i){this.options=i}h.prototype.play=function(){function i(){u=u===-1?(new Date).getTime():u;var t=((new Date).getTime()-u)/j;if(t<1){t=k(t);w=p+t*r;m(w)}else{clearInterval(s);n()}}var j=typeof this.options.duration===
"number"?this.options.duration:350,k=this.options.easing||this.defaultEasing,m=this.options.onAnimate||function(){},n=this.options.onEnd||function(){},p=this.options.curve[0],r=this.options.curve[1]-p,w,s,u=-1;s=setInterval(i,typeof this.options.rate==="number"?this.options.rate:20)};h.prototype.defaultEasing=function(i){return Math.sin(i*(Math.PI/2))};return h}(),bind:function(h){var i=this,j=Array.prototype.slice.call(arguments,1);if(j.length)return function(){return arguments.length?i.apply(h,
j.concat(Array.prototype.slice.call(arguments))):i.apply(h,j)};return function(){return arguments.length?i.apply(h,arguments):i.call(h)}}};if(!Function.prototype.bind)Function.prototype.bind=g.bind;return{Editor:d,util:g}});
define("orion/textview/annotations",["orion/textview/eventTarget"],function(f){function e(g,h,i,j,k,m,n,p){this.type=h;this.start=i;this.end=j;this._projectionModel=g;this._expandedHTML=this.html=k;this._expandedStyle=this.style=m;this._collapsedHTML=n;this._collapsedStyle=p;this.expanded=true}function a(){}function c(g){this._annotations=[];var h=this;this._listener={onChanged:function(i){h._onChanged(i)}};this.setTextModel(g)}function d(g,h){this._view=g;this._annotationModel=h;var i=this;this._listener=
{onDestroy:function(j){i._onDestroy(j)},onLineStyle:function(j){i._onLineStyle(j)},onChanged:function(j){i._onAnnotationModelChanged(j)}};g.addEventListener("Destroy",this._listener.onDestroy);g.addEventListener("LineStyle",this._listener.onLineStyle);h.addEventListener("Changed",this._listener.onChanged)}e.prototype={collapse:function(){if(this.expanded){this.expanded=false;this.html=this._collapsedHTML;this.style=this._collapsedStyle;var g=this._projectionModel,h=g.getBaseModel();this._projection=
{start:h.getLineStart(h.getLineAtOffset(this.start)+1),end:h.getLineEnd(h.getLineAtOffset(this.end),true)};g.addProjection(this._projection)}},expand:function(){if(!this.expanded){this.expanded=true;this.html=this._expandedHTML;this.style=this._expandedStyle;this._projectionModel.removeProjection(this._projection)}}};a.addMixin=function(g){var h=a.prototype;for(var i in h)if(h.hasOwnProperty(i))g[i]=h[i]};a.prototype={addAnnotationType:function(g){if(!this._annotationTypes)this._annotationTypes=[];
this._annotationTypes.push(g)},getAnnotationTypePriority:function(g){if(this._annotationTypes)for(var h=0;h<this._annotationTypes.length;h++)if(this._annotationTypes[h]===g)return h+1;return 0},getAnnotationsByType:function(g,h,i){g=g.getAnnotations(h,i);for(i=[];g.hasNext();){h=g.next();this.getAnnotationTypePriority(h.type)!==0&&i.push(h)}var j=this;i.sort(function(k,m){return j.getAnnotationTypePriority(k.type)-j.getAnnotationTypePriority(m.type)});return i},isAnnotationTypeVisible:function(g){return this.getAnnotationTypePriority(g)!==
0},removeAnnotationType:function(g){if(this._annotationTypes)for(var h=0;h<this._annotationTypes.length;h++)if(this._annotationTypes[h]===g){this._annotationTypes.splice(h,1);break}}};c.prototype={addAnnotation:function(g){if(g){var h=this._annotations,i=this._binarySearch(h,g.start);h.splice(i,0,g);this.onChanged({type:"Changed",added:[g],removed:[],changed:[]})}},getTextModel:function(){return this._model},getAnnotations:function(g,h){var i=this._annotations,j,k=0,m=function(){for(;k<i.length;){var n=
i[k++];if(g===n.start||(g>n.start?g<n.end:n.start<h))return n;if(n.start>=h)break}return null};j=m();return{next:function(){var n=j;if(n)j=m();return n},hasNext:function(){return j!==null}}},modifyAnnotation:function(g){if(g)this._getAnnotationIndex(g)<0||this.onChanged({type:"Changed",added:[],removed:[],changed:[g]})},onChanged:function(g){return this.dispatchEvent(g)},removeAnnotations:function(g){var h=this._annotations,i,j;if(g){i=[];for(j=h.length-1;j>=0;j--){var k=h[j];k.type===g&&h.splice(j,
1);i.splice(0,0,k)}}else i=h;this.onChanged({type:"Changed",removed:i,added:[],changed:[]})},removeAnnotation:function(g){if(g){g=this._getAnnotationIndex(g);g<0||this.onChanged({type:"Changed",removed:this._annotations.splice(g,1),added:[],changed:[]})}},replaceAnnotations:function(g,h){var i=this._annotations,j,k,m,n=[];if(g)for(j=g.length-1;j>=0;j--){m=g[j];k=this._getAnnotationIndex(m);if(!(k<0)){i.splice(k,1);n.splice(0,0,m)}}h||(h=[]);for(j=0;j<h.length;j++){m=h[j];k=this._binarySearch(i,m.start);
i.splice(k,0,m)}this.onChanged({type:"Changed",removed:n,added:h,changed:[]})},setTextModel:function(g){this._model&&this._model.removeEventListener("Changed",this._listener.onChanged);(this._model=g)&&this._model.addEventListener("Changed",this._listener.onChanged)},_binarySearch:function(g,h){for(var i=g.length,j=-1,k;i-j>1;){k=Math.floor((i+j)/2);if(h<=g[k].start)i=k;else j=k}return i},_getAnnotationIndex:function(g){for(var h=this._annotations,i=this._binarySearch(h,g.start);i<h.length&&h[i].start===
g.start;){if(h[i]===g)return i;i++}return-1},_onChanged:function(g){var h=g.start,i=g.removedCharCount,j=this._annotations,k=h+i;if(0<j.length){var m={type:"Changed",added:[],removed:[],changed:[],textModelChangedEvent:g};g=g.addedCharCount-i;for(i=0;i<j.length;i++){var n=j[i];if(n.start>=k){n.start+=g;n.end+=g;m.changed.push(n)}else if(!(n.end<=h))if(n.start<h&&k<n.end){n.end+=g;m.changed.push(n)}else{j.splice(i,1);m.removed.push(n);i--}}if(m.added.length>0||m.removed.length>0||m.changed.length>
0)this.onChanged(m)}}};f.EventTarget.addMixin(c.prototype);d.prototype={destroy:function(){var g=this._view;if(g){g.removeEventListener("Destroy",this._listener.onDestroy);g.removeEventListener("LineStyle",this._listener.onLineStyle);this.view=null}(g=this._annotationModel)&&g.removeEventListener("Changed",this._listener.onChanged)},_mergeStyle:function(g,h){if(h){g||(g={});if(g.styleClass&&h.styleClass&&g.styleClass!==h.styleClass)g.styleClass+=" "+h.styleClass;else g.styleClass=h.styleClass;var i;
if(h.style){if(!g.style)g.style={};for(i in h.style)g.style[i]||(g.style[i]=h.style[i])}if(h.attributes){if(!g.attributes)g.attributes={};for(i in h.attributes)g.attributes[i]||(g.attributes[i]=h.attributes[i])}}return g},_mergeStyleRanges:function(g,h){if(g)for(var i=0;i<g.length;i++){var j=g[i];if(h.end<=j.start)break;if(!(h.start>=j.end)){var k=this._mergeStyle({},j.style);k=this._mergeStyle(k,h.style);if(h.start<=j.start&&h.end>=j.end)g[i]={start:j.start,end:j.end,style:k};else if(h.start>j.start&&
h.end<j.end){g.splice(i,1,{start:j.start,end:h.start,style:j.style},{start:h.start,end:h.end,style:k},{start:h.end,end:j.end,style:j.style});i+=2}else if(h.start>j.start){g.splice(i,1,{start:j.start,end:h.start,style:j.style},{start:h.start,end:j.end,style:k});i+=1}else if(h.end<j.end){g.splice(i,1,{start:j.start,end:h.end,style:k},{start:h.end,end:j.end,style:j.style});i+=1}}}},_onAnnotationModelChanged:function(g){function h(m){for(var n=0;n<m.length;n++)if(j.isAnnotationTypeVisible(m[n].type)){var p=
m[n].start,r=m[n].end;if(k.getBaseModel){p=k.mapOffset(p,true);r=k.mapOffset(r,true)}p!==-1&&r!==-1&&i.redrawRange(p,r)}}if(!g.textModelChangedEvent){var i=this._view;if(i){var j=this,k=i.getModel();h(g.added);h(g.removed);h(g.changed)}}},_onDestroy:function(){this.destroy()},_onLineStyle:function(g){var h=this._annotationModel,i=this._view.getModel(),j=h.getTextModel(),k=g.lineStart,m=g.lineStart+g.lineText.length;if(j!==i){k=i.mapOffset(k);m=i.mapOffset(m)}for(h=h.getAnnotations(k,m);h.hasNext();){k=
h.next();if(this.isAnnotationTypeVisible(k.type)){if(k.rangeStyle){m=k.start;var n=k.end;if(j!==i){m=i.mapOffset(m,true);n=i.mapOffset(n,true)}this._mergeStyleRanges(g.ranges,{start:m,end:n,style:k.rangeStyle})}if(k.lineStyle){g.style=this._mergeStyle({},g.style);g.style=this._mergeStyle(g.style,k.lineStyle)}}}}};a.addMixin(d.prototype);return{FoldingAnnotation:e,AnnotationTypeList:a,AnnotationModel:c,AnnotationStyler:d}});
define("orion/textview/rulers",["i18n!orion/textview/nls/messages","orion/textview/annotations","orion/textview/tooltip"],function(f,e,a){function c(j,k,m,n){this._location=k||"left";this._overview=m||"page";this._rulerStyle=n;this._view=null;var p=this;this._listener={onTextModelChanged:function(r){p._onTextModelChanged(r)},onAnnotationModelChanged:function(r){p._onAnnotationModelChanged(r)}};this.setAnnotationModel(j)}function d(j,k,m,n,p){c.call(this,j,k,"page",m);this._oddStyle=n||{style:{backgroundColor:"white"}};
this._evenStyle=p||{style:{backgroundColor:"white"}};this._numOfDigits=0}function g(j,k,m){c.call(this,j,k,"page",m)}function h(j,k,m){c.call(this,j,k,"document",m)}function i(j,k,m){g.call(this,j,k,m)}c.prototype={getAnnotations:function(j,k){var m=this._annotationModel;if(!m)return[];var n=this._view.getModel(),p=n.getLineStart(j),r=n.getLineEnd(k-1),w=n;if(n.getBaseModel){w=n.getBaseModel();p=n.mapOffset(p);r=n.mapOffset(r)}var s=[];m=this.getAnnotationsByType(m,p,r);for(p=0;p<m.length;p++){r=
m[p];for(var u=w.getLineAtOffset(r.start),t=w.getLineAtOffset(Math.max(r.start,r.end-1)),y=u;y<=t;y++){var B=y;if(n!==w){B=w.getLineStart(y);B=n.mapOffset(B,true);if(B===-1)continue;B=n.getLineAtOffset(B)}if(j<=B&&B<k){var D=this._mergeAnnotation(s[B],r,y-u,t-u+1);if(D)s[B]=D}}}if(!this._multiAnnotation&&this._multiAnnotationOverlay)for(var l in s)if(s[l]._multiple)s[l].html+=this._multiAnnotationOverlay.html;return s},getAnnotationModel:function(){return this._annotationModel},getLocation:function(){return this._location},
getOverview:function(){return this._overview},getRulerStyle:function(){return this._rulerStyle},getWidestAnnotation:function(){return null},setAnnotationModel:function(j){this._annotationModel&&this._annotationModel.removEventListener("Changed",this._listener.onAnnotationModelChanged);(this._annotationModel=j)&&this._annotationModel.addEventListener("Changed",this._listener.onAnnotationModelChanged)},setMultiAnnotation:function(j){this._multiAnnotation=j},setMultiAnnotationOverlay:function(j){this._multiAnnotationOverlay=
j},setView:function(j){this._onTextModelChanged&&this._view&&this._view.removeEventListener("ModelChanged",this._listener.onTextModelChanged);this._view=j;this._onTextModelChanged&&this._view&&this._view.addEventListener("ModelChanged",this._listener.onTextModelChanged)},onClick:function(){},onDblClick:function(){},onMouseMove:function(j,k){var m=a.Tooltip.getTooltip(this._view);if(m)if(!(m.isVisible()&&this._tooltipLineIndex===j)){this._tooltipLineIndex=j;var n=this;m.setTarget({y:k.clientY,getTooltipInfo:function(){return n._getTooltipInfo(n._tooltipLineIndex,
this.y)}})}},onMouseOver:function(j,k){this.onMouseMove(j,k)},onMouseOut:function(){var j=a.Tooltip.getTooltip(this._view);j&&j.setTarget(null)},_getTooltipInfo:function(j,k){if(j!==undefined){var m=this._view,n=m.getModel(),p=this._annotationModel,r=[];if(p){r=n.getLineStart(j);var w=n.getLineEnd(j);if(n.getBaseModel){r=n.mapOffset(r);w=n.mapOffset(w)}r=this.getAnnotationsByType(p,r,w)}p=this._getTooltipContents(j,r);if(!p)return null;p={contents:p,anchor:this.getLocation()};r=m.getClientArea();
r.y=this.getOverview()==="document"?m.convert({y:k},"view","document").y:m.getLocationAtOffset(n.getLineStart(j)).y;m.convert(r,"document","page");p.x=r.x;p.y=r.y;if(p.anchor==="right")p.x+=r.width;p.maxWidth=r.width;p.maxHeight=r.height-(r.y-m._parent.getBoundingClientRect().top);return p}},_getTooltipContents:function(j,k){return k},_onAnnotationModelChanged:function(j){function k(w){for(var s=0;s<w.length;s++)if(p.isAnnotationTypeVisible(w[s].type)){var u=w[s].start,t=w[s].end;if(n.getBaseModel){u=
n.mapOffset(u,true);t=n.mapOffset(t,true)}u!==-1&&t!==-1&&m.redrawLines(n.getLineAtOffset(u),n.getLineAtOffset(Math.max(u,t-1))+1,p)}}var m=this._view;if(m){var n=m.getModel(),p=this,r=n.getLineCount();if(j.textModelChangedEvent){j=j.textModelChangedEvent.start;if(n.getBaseModel)j=n.mapOffset(j,true);j=n.getLineAtOffset(j);m.redrawLines(j,r,p)}else{k(j.added);k(j.removed);k(j.changed)}}},_mergeAnnotation:function(j,k,m){j||(j={});if(m===0)if(j.html&&k.html){if(k.html!==j.html)if(!j._multiple&&this._multiAnnotation)j.html=
this._multiAnnotation.html;j._multiple=true}else j.html=k.html;j.style=this._mergeStyle(j.style,k.style);return j},_mergeStyle:function(j,k){if(k){j||(j={});if(j.styleClass&&k.styleClass&&j.styleClass!==k.styleClass)j.styleClass+=" "+k.styleClass;else j.styleClass=k.styleClass;var m;if(k.style){if(!j.style)j.style={};for(m in k.style)j.style[m]||(j.style[m]=k.style[m])}if(k.attributes){if(!j.attributes)j.attributes={};for(m in k.attributes)j.attributes[m]||(j.attributes[m]=k.attributes[m])}}return j}};
e.AnnotationTypeList.addMixin(c.prototype);d.prototype=new c;d.prototype.getAnnotations=function(j,k){var m=c.prototype.getAnnotations.call(this,j,k),n=this._view.getModel();for(j=j;j<k;j++){var p=j&1?this._oddStyle:this._evenStyle,r=j;if(n.getBaseModel){r=n.getLineStart(r);r=n.getBaseModel().getLineAtOffset(n.mapOffset(r))}m[j]||(m[j]={});m[j].html=r+1+"";if(!m[j].style)m[j].style=p}return m};d.prototype.getWidestAnnotation=function(){var j=this._view.getModel().getLineCount();return this.getAnnotations(j-
1,j)[j-1]};d.prototype._onTextModelChanged=function(j){j=j.start;var k=this._view.getModel(),m=((k.getBaseModel?k.getBaseModel().getLineCount():k.getLineCount())+"").length;if(this._numOfDigits!==m){this._numOfDigits=m;this._view.redrawLines(k.getLineAtOffset(j),k.getLineCount(),this)}};g.prototype=new c;h.prototype=new c;h.prototype.getRulerStyle=function(){var j={style:{lineHeight:"1px",fontSize:"1px"}};return j=this._mergeStyle(j,this._rulerStyle)};h.prototype.onClick=function(j){j!==undefined&&
this._view.setTopIndex(j)};h.prototype._getTooltipContents=function(j,k){if(k.length===0){k=this._view.getModel();j=j;if(k.getBaseModel){j=k.getLineStart(j);j=k.getBaseModel().getLineAtOffset(k.mapOffset(j))}return f.formatMessage(f.line,j+1)}return c.prototype._getTooltipContents.call(this,j,k)};h.prototype._mergeAnnotation=function(j,k,m,n){if(m===0){j=j;if(!j){j={html:"&nbsp;",style:{style:{height:3*n+"px"}}};j.style=this._mergeStyle(j.style,k.overviewStyle)}return j}};i.prototype=new g;i.prototype.onClick=
function(j){if(j!==undefined){var k=this._annotationModel;if(k){var m=this._view.getModel(),n=m.getLineStart(j);j=m.getLineEnd(j,true);if(m.getBaseModel){n=m.mapOffset(n);j=m.mapOffset(j);m=m.getBaseModel()}var p;for(k=k.getAnnotations(n,j);!p&&k.hasNext();){j=k.next();if(this.isAnnotationTypeVisible(j.type))p=j}if(p&&m.getLineAtOffset(p.start)===m.getLineAtOffset(n)){(m=a.Tooltip.getTooltip(this._view))&&m.setTarget(null);p.expanded?p.collapse():p.expand();this._annotationModel.modifyAnnotation(p)}}}};
i.prototype._getTooltipContents=function(j,k){if(k.length===1)if(k[0].expanded)return null;return g.prototype._getTooltipContents.call(this,j,k)};i.prototype._onAnnotationModelChanged=function(j){function k(u){for(r=0;r<u.length;r++)if(p.isAnnotationTypeVisible(u[r].type)){var t=u[r].start;if(n.getBaseModel)t=n.mapOffset(t,true);if(t!==-1)s=Math.min(s,n.getLineAtOffset(t))}}if(j.textModelChangedEvent)g.prototype._onAnnotationModelChanged.call(this,j);else{var m=this._view;if(m){var n=m.getModel(),
p=this,r,w=n.getLineCount(),s=w;k(j.added);k(j.removed);k(j.changed);j=m.getRulers();for(r=0;r<j.length;r++)m.redrawLines(s,w,j[r])}}};return{Ruler:c,AnnotationRuler:g,LineNumberRuler:d,OverviewRuler:h,FoldingRuler:i}});
define("orion/textview/textDND",[],function(){function f(e,a){this._view=e;this._undoStack=a;this._dragSelection=null;this._dropOffset=-1;this._dropText=null;var c=this;this._listener={onDragStart:function(d){c._onDragStart(d)},onDragEnd:function(d){c._onDragEnd(d)},onDragEnter:function(d){c._onDragEnter(d)},onDragOver:function(d){c._onDragOver(d)},onDrop:function(d){c._onDrop(d)},onDestroy:function(d){c._onDestroy(d)}};e.addEventListener("DragStart",this._listener.onDragStart);e.addEventListener("DragEnd",
this._listener.onDragEnd);e.addEventListener("DragEnter",this._listener.onDragEnter);e.addEventListener("DragOver",this._listener.onDragOver);e.addEventListener("Drop",this._listener.onDrop);e.addEventListener("Destroy",this._listener.onDestroy)}f.prototype={destroy:function(){var e=this._view;if(e){e.removeEventListener("DragStart",this._listener.onDragStart);e.removeEventListener("DragEnd",this._listener.onDragEnd);e.removeEventListener("DragEnter",this._listener.onDragEnter);e.removeEventListener("DragOver",
this._listener.onDragOver);e.removeEventListener("Drop",this._listener.onDrop);e.removeEventListener("Destroy",this._listener.onDestroy);this._view=null}},_onDestroy:function(){this.destroy()},_onDragStart:function(e){var a=this._view,c=a.getSelection();a=a.getModel();if(a.getBaseModel){c.start=a.mapOffset(c.start);c.end=a.mapOffset(c.end);a=a.getBaseModel()}if(a=a.getText(c.start,c.end)){this._dragSelection=c;e.event.dataTransfer.effectAllowed="copyMove";e.event.dataTransfer.setData("Text",a)}},
_onDragEnd:function(e){var a=this._view;if(this._dragSelection){this._undoStack&&this._undoStack.startCompoundChange();(e=e.event.dataTransfer.dropEffect==="move")&&a.setText("",this._dragSelection.start,this._dragSelection.end);if(this._dropText){var c=this._dropText,d=this._dropOffset;if(e)if(d>=this._dragSelection.end)d-=this._dragSelection.end-this._dragSelection.start;else if(d>=this._dragSelection.start)d=this._dragSelection.start;a.setText(c,d,d);a.setSelection(d,d+c.length);this._dropText=
null;this._dropOffset=-1}this._undoStack&&this._undoStack.endCompoundChange()}this._dragSelection=null},_onDragEnter:function(e){this._onDragOver(e)},_onDragOver:function(e){var a=e.event.dataTransfer.types;if(a)if(!(a.contains?a.contains("text/plain"):a.indexOf("text/plain")!==-1))e.event.dataTransfer.dropEffect="none"},_onDrop:function(e){var a=this._view,c=e.event.dataTransfer.getData("Text");if(c){e=a.getOffsetAtLocation(e.x,e.y);if(this._dragSelection){this._dropOffset=e;this._dropText=c}else{a.setText(c,
e,e);a.setSelection(e,e+c.length)}}}};return{TextDND:f}});
define("orion/editor/editorFeatures",["i18n!orion/editor/nls/messages","orion/textview/undoStack","orion/textview/keyBinding","orion/textview/rulers","orion/textview/annotations","orion/textview/textDND","orion/editor/regex"],function(f,e,a,c,d,g,h){function i(){}function j(){}function k(){}function m(){}function n(){}function p(s,u,t){this.editor=s;this.textView=s.getTextView();this.undoStack=u;this._incrementalFindActive=false;this._incrementalFindSuccess=true;this._incrementalFindIgnoreSelection=
false;this._incrementalFindPrefix="";(this._searcher=t)&&this._searcher.getAdaptor().setEditor(this.editor);this._lastEditLocation=null;this.init()}function r(s,u,t,y){this.editor=s;this.textView=s.getTextView();this.undoStack=u;this.contentAssist=t;this.linkedMode=y;this.contentAssist&&this.contentAssist.addEventListener("accept",this.contentAssistProposalAccepted.bind(this));this.init()}function w(s){this.editor=s;this.textView=s.getTextView();this.linkedModeActive=false;this.linkedModePositions=
[];this.linkedModeEscapePosition=this.linkedModeCurrentPositionIndex=0;this.linkedModeListener={onVerify:function(u){for(var t=false,y=0,B=0;B<this.linkedModePositions.length;++B){var D=this.linkedModePositions[B];if(t)D.offset+=y;else if(u.start>=D.offset&&u.end<=D.offset+D.length){t=D.length;D.length=u.start-D.offset+u.text.length+(D.offset+D.length-u.end);y=D.length-t;t=true}}if(t)this.linkedModeEscapePosition+=y;else this.cancel()}.bind(this)}}i.prototype={createUndoStack:function(s){s=s.getTextView();
var u=new e.UndoStack(s,200);s.setKeyBinding(new a.KeyBinding("z",true),"Undo");s.setAction("Undo",function(){u.undo();return true});var t=navigator.platform.indexOf("Mac")!==-1;s.setKeyBinding(t?new a.KeyBinding("z",true,true):new a.KeyBinding("y",true),"Redo");s.setAction("Redo",function(){u.redo();return true});return u}};j.prototype={createLineNumberRuler:function(s){return new c.LineNumberRuler(s,"left",{styleClass:"ruler lines"},{styleClass:"rulerLines odd"},{styleClass:"rulerLines even"})}};
k.prototype={createFoldingRuler:function(s){return new c.FoldingRuler(s,"left",{styleClass:"ruler folding"})}};m.prototype={createAnnotationModel:function(s){return new d.AnnotationModel(s)},createAnnotationStyler:function(s,u){return new d.AnnotationStyler(s,u)},createAnnotationRulers:function(s){var u=new c.AnnotationRuler(s,"left",{styleClass:"ruler annotations"});s=new c.OverviewRuler(s,"right",{styleClass:"ruler overview"});return{annotationRuler:u,overviewRuler:s}}};n.prototype={createTextDND:function(s,
u){return new g.TextDND(s.getTextView(),u)}};p.prototype={init:function(){var s=this;this._incrementalFindListener={onVerify:function(t){var y=s.editor,B=y.getModel(),D=y.mapOffset(t.start),l=y.mapOffset(t.end);D=B.getText(D,l);B=s._incrementalFindPrefix;if((B=B.match(new RegExp("^"+h.escape(D),"i")))&&B.length>0){B=s._incrementalFindPrefix+=t.text;s.editor.reportStatus(f.formatMessage(f.incrementalFind,B));D=B.toLowerCase()===B;l=y.getSelection().start;if(D=y.doFind(B,l,D)){s._incrementalFindSuccess=
true;s._incrementalFindIgnoreSelection=true;y.moveSelection(D.index,D.index+D.length);s._incrementalFindIgnoreSelection=false}else{y.reportStatus(f.formatMessage(f.incrementalFindNotFound,B),"error");s._incrementalFindSuccess=false}t.text=null}},onSelection:function(){s._incrementalFindIgnoreSelection||s.toggleIncrementalFind()}};this._lastEditListener={onModelChanged:function(t){if(s.editor.isDirty())s._lastEditLocation=t.start+t.addedCharCount}};this.textView.addEventListener("ModelChanged",this._lastEditListener.onModelChanged);
this.textView.setKeyBinding(new a.KeyBinding("f",true),f.find);this.textView.setAction(f.find,function(){if(this._searcher){var t=this.editor,y=t.getSelection(),B="";if(y.end>y.start)B=t.getModel().getText(y.start,y.end);this._searcher.buildToolBar(B);return true}return false}.bind(this));this.textView.setKeyBinding(new a.KeyBinding("k",true),f.findNext);this.textView.setAction(f.findNext,function(){if(this._searcher){this._searcher.findNext(true);return true}return false}.bind(this));this.textView.setKeyBinding(new a.KeyBinding("k",
true,true),f.findPrevious);this.textView.setAction(f.findPrevious,function(){if(this._searcher){this._searcher.findNext(false);return true}return false}.bind(this));this.textView.setKeyBinding(new a.KeyBinding("j",true),f.incrementalFindKey);this.textView.setAction(f.incrementalFindKey,function(){if(this._searcher&&this._searcher.visible())return true;var t=this.editor;if(this._incrementalFindActive){var y=this._incrementalFindPrefix;if(y.length!==0){var B;if(this._searcher)B=this._searcher.findNext(true,
y);else{B=0;if(this._incrementalFindSuccess)B=t.getSelection().start+1;var D=y.toLowerCase()===y;B=t.doFind(y,B,D)}if(B){this._incrementalFindIgnoreSelection=this._incrementalFindSuccess=true;t.moveSelection(B.index,B.index+B.length);this._incrementalFindIgnoreSelection=false;t.reportStatus(f.formatMessage(f.incrementalFind,y))}else{t.reportStatus(f.formatMessage(f.incrementalFindNotFound,y),"error");this._incrementalFindSuccess=false}}}else{t.setCaretOffset(t.getCaretOffset());this.toggleIncrementalFind()}return true}.bind(this));
this.textView.setAction("deletePrevious",function(){if(this._incrementalFindActive){var t=this.editor,y=this._incrementalFindPrefix;y=this._incrementalFindPrefix=y.substring(0,y.length-1);if(y.length===0){this._incrementalFindIgnoreSelection=this._incrementalFindSuccess=true;t.setCaretOffset(t.getSelection().start);this._incrementalFindIgnoreSelection=false;this.toggleIncrementalFind();return true}t.reportStatus(f.formatMessage(f.incrementalFind,y));var B=t.getCaretOffset();B=t.getModel().getText().lastIndexOf(y,
B-y.length-1);if(B!==-1){this._incrementalFindIgnoreSelection=this._incrementalFindSuccess=true;t.moveSelection(B,B+y.length);this._incrementalFindIgnoreSelection=false}else t.reportStatus(f.formatMessage(f.incrementalFindNotFound,y),"error");return true}return false}.bind(this));this.textView.setAction("tab",function(){var t=this.editor,y=t.getModel(),B=t.getSelection(),D=y.getLineAtOffset(B.start),l=y.getLineAtOffset(B.end>B.start?B.end-1:B.end);if(D!==l){var o=[];o.push("");for(var q=D;q<=l;q++)o.push(y.getLine(q,
true));q=y.getLineStart(D);y=y.getLineEnd(l,true);var v=this.textView.getOptions("tabSize","expandTab");v=v.expandTab?(new Array(v.tabSize+1)).join(" "):"\t";t.setText(o.join(v),q,y);t.setSelection(q===B.start?B.start:B.start+v.length,B.end+(l-D+1)*v.length);return true}return false}.bind(this));this.textView.setKeyBinding(new a.KeyBinding(9,false,true),f.unindentLines);this.textView.setAction(f.unindentLines,function(){for(var t=this.editor,y=t.getModel(),B=t.getSelection(),D=y.getLineAtOffset(B.start),
l=y.getLineAtOffset(B.end>B.start?B.end-1:B.end),o=this.textView.getOptions("tabSize"),q=(new Array(o+1)).join(" "),v=[],x=0,z=0,C=D;C<=l;C++){var A=y.getLine(C,true);if(y.getLineStart(C)!==y.getLineEnd(C))if(A.indexOf("\t")===0){A=A.substring(1);x++}else if(A.indexOf(q)===0){A=A.substring(o);x+=o}else return true;if(C===D)z=x;v.push(A)}D=y.getLineStart(D);o=y.getLineEnd(l,true);y=y.getLineStart(l);t.setText(v.join(""),D,o);t.setSelection(D===B.start?B.start:B.start-z,B.end-x+(B.end===y+1?1:0));return true}.bind(this));
this.textView.setKeyBinding(new a.KeyBinding(38,false,false,true),f.moveLinesUp);this.textView.setAction(f.moveLinesUp,function(){var t=this.editor,y=t.getModel(),B=t.getSelection(),D=y.getLineAtOffset(B.start);if(D===0)return true;var l=y.getLineAtOffset(B.end>B.start?B.end-1:B.end),o=y.getLineCount();B=y.getLineStart(D-1);var q=y.getLineStart(D),v=y.getLineEnd(l,true),x=y.getText(q,v),z=0;if(l===o-1){l=y.getLineEnd(D-1);D=y.getLineEnd(D-1,true);x+=y.getText(l,D);q=l;z=D-l}this.startUndo();t.setText("",
q,v);t.setText(x,B,B);t.setSelection(B,B+x.length-z);this.endUndo();return true}.bind(this));this.textView.setKeyBinding(new a.KeyBinding(40,false,false,true),f.moveLinesDown);this.textView.setAction(f.moveLinesDown,function(){var t=this.editor,y=t.getModel(),B=t.getSelection(),D=y.getLineAtOffset(B.start),l=y.getLineAtOffset(B.end>B.start?B.end-1:B.end),o=y.getLineCount();if(l===o-1)return true;D=y.getLineStart(D);B=y.getLineEnd(l,true);var q=y.getLineEnd(l+1,true)-(B-D),v=0;if(l!==o-2)y=y.getText(D,
B);else{l=y.getLineEnd(l);y=y.getText(l,B)+y.getText(D,l);v+=B-l}this.startUndo();t.setText("",D,B);t.setText(y,q,q);t.setSelection(q+v,q+v+y.length);this.endUndo();return true}.bind(this));this.textView.setKeyBinding(new a.KeyBinding(38,true,false,true),f.copyLinesUp);this.textView.setAction(f.copyLinesUp,function(){var t=this.editor,y=t.getModel(),B=t.getSelection(),D=y.getLineAtOffset(B.start);B=y.getLineAtOffset(B.end>B.start?B.end-1:B.end);D=y.getLineStart(D);var l=y.getLineEnd(B,true),o=y.getLineCount(),
q="";l=y.getText(D,l);if(B===o-1)l+=q=y.getLineDelimiter();t.setText(l,D,D);t.setSelection(D,D+l.length-q.length);return true}.bind(this));this.textView.setKeyBinding(new a.KeyBinding(40,true,false,true),f.copyLinesDown);this.textView.setAction(f.copyLinesDown,function(){var t=this.editor,y=t.getModel(),B=t.getSelection(),D=y.getLineAtOffset(B.start);B=y.getLineAtOffset(B.end>B.start?B.end-1:B.end);var l=y.getLineStart(D);D=y.getLineEnd(B,true);var o=y.getLineCount(),q="";l=y.getText(l,D);if(B===
o-1)l=(q=y.getLineDelimiter())+l;t.setText(l,D,D);t.setSelection(D+q.length,D+l.length);return true}.bind(this));this.textView.setKeyBinding(new a.KeyBinding("d",true,false,false),f.deleteLines);this.textView.setAction(f.deleteLines,function(){var t=this.editor,y=t.getSelection(),B=t.getModel(),D=B.getLineAtOffset(y.start);y=B.getLineAtOffset(y.end>y.start?y.end-1:y.end);D=B.getLineStart(D);B=B.getLineEnd(y,true);t.setText("",D,B);return true}.bind(this));this.textView.setKeyBinding(new a.KeyBinding("l",
true),f.gotoLine);this.textView.setAction(f.gotoLine,function(){var t=this.editor,y=t.getModel().getLineAtOffset(t.getCaretOffset());if(y=prompt(f.gotoLinePrompty,y+1)){y=parseInt(y,10);t.onGotoLine(y-1,0)}return true}.bind(this));var u=navigator.platform.indexOf("Mac")!==-1;this.textView.setKeyBinding(new a.KeyBinding("q",!u,false,false,u),f.lastEdit);this.textView.setAction(f.lastEdit,function(){typeof this._lastEditLocation==="number"&&this.editor.showSelection(this._lastEditLocation);return true}.bind(this))},
toggleIncrementalFind:function(){if(this._incrementalFindActive=!this._incrementalFindActive){this.editor.reportStatus(f.formatMessage(f.incrementalFind,this._incrementalFindPrefix));this.textView.addEventListener("Verify",this._incrementalFindListener.onVerify);this.textView.addEventListener("Selection",this._incrementalFindListener.onSelection)}else{this._incrementalFindPrefix="";this.editor.reportStatus("");this.textView.removeEventListener("Verify",this._incrementalFindListener.onVerify);this.textView.removeEventListener("Selection",
this._incrementalFindListener.onSelection);this.textView.setCaretOffset(this.textView.getCaretOffset())}},startUndo:function(){this.undoStack&&this.undoStack.startCompoundChange()},endUndo:function(){this.undoStack&&this.undoStack.endCompoundChange()},cancel:function(){this.toggleIncrementalFind()},isActive:function(){return this._incrementalFindActive},isStatusActive:function(){return this._incrementalFindActive},lineUp:function(){if(this._incrementalFindActive){var s=this._incrementalFindPrefix;
if(s.length===0)return false;var u=this.editor,t=u.getModel(),y;y=this._incrementalFindSuccess?u.getCaretOffset()-s.length-1:t.getCharCount()-1;t=t.getText().lastIndexOf(s,y);if(t!==-1){this._incrementalFindIgnoreSelection=this._incrementalFindSuccess=true;u.moveSelection(t,t+s.length);this._incrementalFindIgnoreSelection=false;u.reportStatus(f.formatMessage(f.incrementalFind,s))}else{u.reportStatus(f.formatMessage(f.incrementalFindNotFound,s),"error");this._incrementalFindSuccess=false}return true}return false},
lineDown:function(){if(this._incrementalFindActive){var s=this._incrementalFindPrefix;if(s.length===0)return false;var u=this.editor,t=u.getModel(),y=0;if(this._incrementalFindSuccess)y=u.getSelection().start+1;t=t.getText().indexOf(s,y);if(t!==-1){this._incrementalFindIgnoreSelection=this._incrementalFindSuccess=true;u.moveSelection(t,t+s.length);this._incrementalFindIgnoreSelection=false;u.reportStatus(f.formatMessage(f.incrementalFind,s))}else{u.reportStatus(f.formatMessage(f.incrementalFindNotFound,
s),"error");this._incrementalFindSuccess=false}return true}return false},enter:function(){return false}};r.prototype={startUndo:function(){this.undoStack&&this.undoStack.startCompoundChange()},endUndo:function(){this.undoStack&&this.undoStack.endCompoundChange()},init:function(){function s(t,y,B){var D=t.getLineAtOffset(y),l=t.getLineAtOffset(B),o,q,v,x,z,C;for(o=D;o>=0;o--){q=t.getLine(o);v=o===D?y-t.getLineStart(D):q.length;x=q.lastIndexOf("/*",v);q=q.lastIndexOf("*/",v);if(q>x)break;else if(x!==
-1){z=t.getLineStart(o)+x;break}}for(o=l;o<t.getLineCount();o++){q=t.getLine(o);v=o===l?B-t.getLineStart(l):0;x=q.indexOf("/*",v);q=q.indexOf("*/",v);if(x!==-1&&x<q)break;else if(q!==-1){C=t.getLineStart(o)+q;break}}return{commentStart:z,commentEnd:C}}this.textView.setKeyBinding(new a.KeyBinding(191,true),f.toggleLineComment);this.textView.setAction(f.toggleLineComment,function(){for(var t=this.editor,y=t.getModel(),B=t.getSelection(),D=y.getLineAtOffset(B.start),l=y.getLineAtOffset(B.end>B.start?
B.end-1:B.end),o=true,q=[],v,x,z=D;z<=l;z++){v=y.getLine(z,true);q.push(v);if(!o||(x=v.indexOf("//"))===-1)o=false;else if(x!==0){var C;for(C=0;C<x;C++){o=v.charCodeAt(C);if(!(o===32||o===9))break}o=C===x}}z=y.getLineStart(D);C=y.getLineEnd(l,true);if(o){for(o=0;o<q.length;o++){v=q[o];x=v.indexOf("//");q[o]=v.substring(0,x)+v.substring(x+2)}q=q.join("");v=y.getLineStart(l);y=z===B.start?B.start:B.start-2;B=B.end-2*(l-D+1)+(B.end===v+1?2:0)}else{q.splice(0,0,"");q=q.join("//");y=z===B.start?B.start:
B.start+2;B=B.end+2*(l-D+1)}t.setText(q,z,C);t.setSelection(y,B);return true}.bind(this));var u=navigator.platform.indexOf("Mac")!==-1;this.textView.setKeyBinding(new a.KeyBinding(191,true,!u,false,u),f.addBlockComment);this.textView.setAction(f.addBlockComment,function(){var t=this.editor,y=t.getModel(),B=t.getSelection(),D=new RegExp("/\\*|\\*/","g"),l=s(y,B.start,B.end);if(l.commentStart!==undefined&&l.commentEnd!==undefined)return true;y=y.getText(B.start,B.end);if(y.length===0)return true;l=
y.length;y=y.replace(D,"");D=y.length;t.setText("/*"+y+"*/",B.start,B.end);t.setSelection(B.start+2,B.end+2+(D-l));return true}.bind(this));this.textView.setKeyBinding(new a.KeyBinding(220,true,!u,false,u),f.removeBlockComment);this.textView.setAction(f.removeBlockComment,function(){var t=this.editor,y=t.getModel(),B=t.getSelection(),D=y.getText(B.start,B.end),l,o,q;for(q=0;q<D.length;q++)if(D.substring(q,q+2)==="/*"){l=B.start+q;break}for(;q<D.length;q++)if(D.substring(q,q+2)==="*/"){o=B.start+q;
break}if(l!==undefined&&o!==undefined){t.setText(y.getText(l+2,o),l,o+2);t.setSelection(l,o)}else{D=s(y,B.start,B.end);if(D.commentStart===undefined||D.commentEnd===undefined)return true;y=y.getText(D.commentStart+2,D.commentEnd);t.setText(y,D.commentStart,D.commentEnd+2);t.setSelection(B.start-2,B.end-2)}return true}.bind(this))},contentAssistProposalAccepted:function(s){var u=s.data.proposal,t;if(typeof u==="string")t=u;else if(typeof u.proposal==="string")t=u.proposal;this.textView.setText(t,s.data.start,
s.data.end);if(u.positions&&this.linkedMode){s=[];for(t=0;t<u.positions.length;++t)s[t]={positions:[{offset:u.positions[t].offset,length:u.positions[t].length}]};this.linkedMode.enterLinkedMode({groups:s,escapePosition:u.escapePosition})}else u.escapePosition&&this.textView.setCaretOffset(u.escapePosition);return true},cancel:function(){return false},isActive:function(){return true},isStatusActive:function(){return false},lineUp:function(){return false},lineDown:function(){return false},enter:function(){var s=
this.editor,u=s.getSelection();if(u.start===u.end){var t=s.getModel(),y=t.getLineAtOffset(u.start),B=t.getLine(y,true),D=t.getLineStart(y);y=0;D=u.start-D;for(var l;y<D&&((l=B.charCodeAt(y))===32||l===9);)y++;if(y>0){var o=B.substring(0,y);for(y=D;y<B.length&&((l=B.charCodeAt(y++))===32||l===9);)u.end++;s.setText(t.getLineDelimiter()+o,u.start,u.end);return true}}return false}};w.prototype={enterLinkedMode:function(s){if(!this.linkedModeActive){this.linkedModeActive=true;this.linkedModePositions=
[];for(var u=0;u<s.groups.length;++u){var t=s.groups[u];this.linkedModePositions[u]={offset:t.positions[0].offset,length:t.positions[0].length}}this.linkedModeEscapePosition=s.escapePosition;this.linkedModeCurrentPositionIndex=0;this.selectTextForLinkedModePosition(this.linkedModePositions[this.linkedModeCurrentPositionIndex]);this.textView.addEventListener("Verify",this.linkedModeListener.onVerify);this.textView.setKeyBinding(new a.KeyBinding(9),"nextLinkedModePosition");this.textView.setAction("nextLinkedModePosition",
function(){this.linkedModeCurrentPositionIndex=++this.linkedModeCurrentPositionIndex%this.linkedModePositions.length;this.selectTextForLinkedModePosition(this.linkedModePositions[this.linkedModeCurrentPositionIndex]);return true}.bind(this));this.textView.setKeyBinding(new a.KeyBinding(9,false,true),"previousLinkedModePosition");this.textView.setAction("previousLinkedModePosition",function(){this.linkedModeCurrentPositionIndex=this.linkedModeCurrentPositionIndex>0?this.linkedModeCurrentPositionIndex-
1:this.linkedModePositions.length-1;this.selectTextForLinkedModePosition(this.linkedModePositions[this.linkedModeCurrentPositionIndex]);return true}.bind(this));this.editor.reportStatus(f.linkedModeEntered)}},isActive:function(){return this.linkedModeActive},isStatusActive:function(){return this.linkedModeActive},enter:function(){this.cancel();return true},cancel:function(){if(this.linkedModeActive){this.linkedModeActive=false;this.textView.removeEventListener("Verify",this.linkedModeListener.onVerify);
this.textView.setKeyBinding(new a.KeyBinding(9),"tab");this.textView.setKeyBinding(new a.KeyBinding(9,false,true),null);this.textView.setCaretOffset(this.linkedModeEscapePosition,false);this.editor.reportStatus(f.linkedModeExited)}},selectTextForLinkedModePosition:function(s){this.textView.setSelection(s.offset,s.offset+s.length)}};return{UndoFactory:i,LineNumberRulerFactory:j,FoldingRulerFactory:k,AnnotationFactory:m,TextDNDFactory:n,TextActions:p,SourceCodeActions:r,LinkedMode:w}});
define("orion/breadcrumbs",["require","dojo","orion/util"],function(f,e,a){function c(d){this._init(d)}c.prototype={_init:function(d){var g=d.container;if(typeof g==="string")g=e.byId(g);if(!g)throw"no parent container";this._container=g;e.removeClass(g,"currentLocation");this._id=d.id||"eclipse.breadcrumbs";this._resource=d.resource||null;this._firstSegmentName=d.firstSegmentName;this._makeHref=d.makeHref;this.path="";this.render()},getNavigatorRootSegment:function(){if(this._firstSegmentName){var d;
if(this._resource&&this._resource.Parents){d=document.createElement("a");if(this._makeHref)this._makeHref(d,"");else d.href=f.toUrl("navigate/table.html")+"#"}else d=document.createElement("span");e.place(document.createTextNode(this._firstSegmentName),d,"only");return d}return null},render:function(){var d=this._container,g=e.byId(this._id);if(g)e.empty(g);else{g=document.createElement("span");g.id=this._id;d.appendChild(g)}var h;if(h=this.getNavigatorRootSegment()){e.addClass(h,"breadcrumb");g.appendChild(h);
if(this._resource&&this._resource.Parents){h=document.createElement("span");e.place(document.createTextNode(" >> "),h,"only");this.path+="/";e.addClass(h,"breadcrumb");g.appendChild(h)}else{h.href="";e.removeClass(h,"breadcrumb");e.addClass(h,"currentLocation");a.forceLayout(d);return}}if(this._resource){if(this._resource.Parents)for(var i=this._resource.Parents,j=i.length;--j>=0;){h=document.createElement("a");e.addClass(h,"breadcrumb");e.place(document.createTextNode(i[j].Name),h,"only");this.path+=
i[j].Name;if(this._makeHref)this._makeHref(h,i[j].ChildrenLocation);else h.href=f.toUrl("navigate/table.html")+"#"+i[j].ChildrenLocation;g.appendChild(h);h=document.createElement("span");e.place(document.createTextNode(" >> "),h,"only");this.path+="/";e.addClass(h,"breadcrumb");g.appendChild(h)}h=document.createElement("span");e.place("<br>"+this._resource.Name,h,"only");e.addClass(h,"currentLocation");this.path+=this._resource.Name;g.appendChild(h)}if(g.childNodes.length===0){h=document.createElement("a");
e.place(document.createTextNode(document.title),h,"only");e.addClass(h,"breadcrumb");e.addClass(h,"currentLocation");g.appendChild(h)}a.forceLayout(d)}};c.prototype.constructor=c;return{BreadCrumbs:c}});
define("orion/compare/gap-model",["orion/textview/eventTarget"],function(f){var e=e||{};e.GapTextModel=function(){function a(c,d,g){this._model=c;this._myIndex=(this._isOriginal=d===undefined?true:d)?1:0;this._reverseIndex=1-this._myIndex;this._map=g;var h=this;this._listener={onChanging:function(i){h.onChanging(i)},onChanged:function(i){h.onChanged(i)}};c.addEventListener("Changing",this._listener.onChanging);c.addEventListener("Changed",this._listener.onChanged);this._init()}navigator.platform.indexOf("Win");
a.prototype={_init:function(){this._generateGapBlocks()},_generateGapBlocks:function(){this._gapBlocks=[];for(var c=this._gapNumber=0,d=0;d<this._map.length;d++){if(this._map[d][this._myIndex]<this._map[d][this._reverseIndex]){var g=this._map[d][this._reverseIndex]-this._map[d][this._myIndex];this._gapNumber+=g;this._gapBlocks.push([c+this._map[d][this._myIndex],g])}c+=Math.max(this._map[d][this._reverseIndex],this._map[d][this._myIndex])}},lookUpRealIndex:function(c){for(var d=0,g=0;g<this._gapBlocks.length;g++){var h=
this._gapBlocks[g][0],i=this._gapBlocks[g][0]+this._gapBlocks[g][1]-1;if(c<h)break;if(c>=h&&c<=i)return{lineIndex:-1,gapsBefore:d+c-h};d+=this._gapBlocks[g][1]}return{lineIndex:c-d,gapsBefore:d}},getLineType:function(c){for(var d=0,g=0;g<this._map.length;g++){var h=Math.max(this._map[g][this._reverseIndex],this._map[g][this._myIndex]);if(c>=d&&c<d+h){if(this._map[g][2]===0)return"unchnaged";else if(this._map[g][2]<0)return"removed";else if(this._map[g][1]===0)return"added";else if(c<this._map[g][this._myIndex]+
d)return"changed";return"changed_gap"}d+=Math.max(this._map[g][this._reverseIndex],this._map[g][this._myIndex])}return"unchnaged"},getCharCount:function(){var c=this._model.getCharCount();c+=this._gapNumber*this.getLineDelimiter().length;return c},getLine:function(c,d){var g=this.getLineCount();if(!(0<=c&&c<g))return null;c=this.lookUpRealIndex(c);if(c.lineIndex<0){if(d)return this.getLineDelimiter();return""}else return this._model.getLine(c.lineIndex,d)},getLineAtOffset:function(c){if(!(0<=c&&c<=
this.getCharCount()))return-1;for(var d=this.getLineCount(),g=0,h=0;g<d;){var i=this.lookUpRealIndex(g);h+=i.lineIndex<0?this.getLineDelimiter().length:this._model.getLine(i.lineIndex,true).length;g++;if(h>c)break}return g-1},getLineCount:function(){return this._model.getLineCount()+this._gapNumber},getLineDelimiter:function(){return this._model.getLineDelimiter()},getLineEnd:function(c,d){var g=this.getLineCount();if(!(0<=c&&c<g))return-1;var h=this.lookUpRealIndex(c);g=h.gapsBefore*this.getLineDelimiter().length;
if(h.lineIndex<0){c=c-h.gapsBefore;if(c>0)g+=this._model.getLineEnd(c-1,true);if(d)g+=this.getLineDelimiter().length}else g+=this._model.getLineEnd(h.lineIndex,d);return g},getLineStart:function(c){if(!(0<=c&&c<this.getLineCount()))return-1;var d=this.lookUpRealIndex(c),g=0,h=-1;if(d.lineIndex<0){g=d.gapsBefore;if(c-g>=0)h=c-g-1}else{g=d.gapsBefore;h=d.lineIndex}c=0;c+=this.getLineDelimiter().length*g;if(h>=0)c+=d.lineIndex<0?this._model.getLineEnd(h,true):this._model.getLineStart(h);return c},getText:function(c,
d){return this._model.getText(c,d)},onChanging:function(c){return this.dispatchEvent(c)},onChanged:function(c){return this.dispatchEvent(c)},setLineDelimiter:function(c){this._model.setLineDelimiter(c)},setText:function(c,d,g){this._model.setText(c,d,g)}};f.EventTarget.addMixin(a.prototype);return a}();return e});
define("orion/compare/diff-provider",["dojo","orion/auth"],function(f,e){function a(g,h,i){var j=new f.Deferred;g[h].apply(g,i).then(function(k){j.callback(k)},function(k){k.status===401||k.status===403?e.handleAuthenticationError(k,function(){g[h].apply(g,i).then(function(m){j.callback(m)},function(m){j.errback(m)})}):j.errback(k)});return j}function c(g){if(g.indexOf("://")===-1){var h=document.createElement("a");h.href=g;return h.href}return g}function d(g,h){var i=g.getServiceReferences("orion.core.diff"),
j=i;if(h){j=[];for(var k=0;k<i.length;++k)h(i[k])&&j.push(i[k])}var m=[],n=[];for(k=0;k<j.length;++k){m[k]=new RegExp(j[k].getProperty("pattern")||".*");n[k]=g.getService(j[k])}this._getService=function(p){p=c(p);for(var r=0;r<m.length;++r)if(m[r].test(p))return n[r];throw"No Matching DiffService for location:"+p;}}d.prototype={getDiffContent:function(g){return a(this._getService(g),"getDiffContent",arguments)},getDiffFileURI:function(g){return a(this._getService(g),"getDiffFileURI",arguments)}};
return{DiffProvider:d}});
var JsDiff=function(){function f(j){return{newPos:j.newPos,components:j.components.slice(0)}}function e(j){for(var k=[],m=0;m<j.length;m++)j[m]&&k.push(j[m]);return k}function a(j){j=j;j=j.replace(/&/g,"&amp;");j=j.replace(/</g,"&lt;");j=j.replace(/>/g,"&gt;");return j=j.replace(/"/g,"&quot;")}var c=function(j){this.ignoreWhitespace=j};c.prototype={diff:function(j,k){if(k==j)return[{value:k}];if(!k)return[{value:j,removed:true}];if(!j)return[{value:k,added:true}];k=this.tokenize(k);j=this.tokenize(j);
var m=k.length,n=j.length,p=m+n,r=[{newPos:-1,components:[]}],w=this.extractCommon(r[0],k,j,0);if(r[0].newPos+1>=m&&w+1>=n)return r[0].components;for(var s=1;s<=p;s++)for(var u=-1*s;u<=s;u+=2){var t;t=r[u-1];var y=r[u+1];w=(y?y.newPos:0)-u;if(t)r[u-1]=undefined;var B=t&&t.newPos+1<m,D=y&&0<=w&&w<n;if(!B&&!D)r[u]=undefined;else{if(!B||D&&t.newPos<y.newPos){t=f(y);this.pushComponent(t.components,j[w],undefined,true)}else{t=f(t);t.newPos++;this.pushComponent(t.components,k[t.newPos],true,undefined)}w=
this.extractCommon(t,k,j,u);if(t.newPos+1>=m&&w+1>=n)return t.components;else r[u]=t}}},pushComponent:function(j,k,m,n){var p=j[j.length-1];if(p&&p.added===m&&p.removed===n)j[j.length-1]={value:this.join(p.value,k),added:m,removed:n};else j.push({value:k,added:m,removed:n})},extractCommon:function(j,k,m,n){var p=k.length,r=m.length,w=j.newPos;for(n=w-n;w+1<p&&n+1<r&&this.equals(k[w+1],m[n+1]);){w++;n++;this.pushComponent(j.components,k[w],undefined,undefined)}j.newPos=w;return n},equals:function(j,
k){var m=/\S/;return this.ignoreWhitespace&&!m.test(j)&&!m.test(k)?true:j==k},join:function(j,k){return j+k},tokenize:function(j){return j}};var d=new c,g=new c(true);g.tokenize=function(j){return e(j.split(/(\s+|\b)/))};var h=new c(true);h.tokenize=function(j){return e(j.split(/([{}:;,]|\s+)/))};var i=new c;i.tokenize=function(j){return j.split(/^/m)};return{diffChars:function(j,k){return d.diff(j,k)},diffWords:function(j,k){return g.diff(j,k)},diffLines:function(j,k){return i.diff(j,k)},diffCss:function(j,
k){return h.diff(j,k)},createPatch:function(j,k,m,n,p){var r=[];r.push("Index: "+j);r.push("===================================================================");r.push("--- "+j+"\t"+n);r.push("+++ "+j+"\t"+p);j=i.diff(k,m);j.push({value:"",lines:[]});m=k=0;n=[];for(var w=p=1,s=0;s<j.length;s++){var u=j[s],t=u.lines||u.value.replace(/\n$/,"").split("\n");u.lines=t;if(u.added||u.removed){if(!k){var y=j[s-1];k=p;m=w;if(y){n.push.apply(n,y.lines.slice(-4).map(function(B){return" "+B}));k-=4;m-=4}}n.push.apply(n,
t.map(function(B){return(u.added?"+":"-")+B}));if(u.added)w+=t.length;else p+=t.length}else{if(k)if(t.length<=8&&s<j.length-1)n.push.apply(n,t.map(function(B){return" "+B}));else{y=Math.min(t.length,4);r.push("@@ -"+k+","+(p-k+y)+" +"+m+","+(w-m+y)+" @@");r.push.apply(r,n);r.push.apply(r,t.slice(0,y).map(function(B){return" "+B}));m=k=0;n=[]}p+=t.length;w+=t.length}}j.length>1&&!/\n$/.test(j[j.length-2].value)&&r.push("\\ No newline at end of file\n");return r.join("\n")},convertChangesToXML:function(j){for(var k=
[],m=0;m<j.length;m++){var n=j[m];if(n.added)k.push("<ins>");else n.removed&&k.push("<del>");k.push(a(n.value));if(n.added)k.push("</ins>");else n.removed&&k.push("</del>")}return k.join("")}}}();if(typeof module!=="undefined")module.exports=JsDiff;typeof define==="function"&&define.amd&&define("jsdiff/diff",["require","exports","module"],function(){return JsDiff});
define("orion/compare/jsdiffAdapter",["jsdiff/diff"],function(f){var e=e||{};e.JSDiffAdapter=function(){function a(){}a.prototype={adapt:function(c,d){var g=c.split("\n"),h=d.split("\n"),i=g[g.length-1]==="";h=h[h.length-1]==="";var j=f.diffLines(c,d);c=[];d=[];linesRemoved=linesAdded=0;changeIndex=-1;for(var k=0,m=true,n=0;n<j.length;n++){var p=j[n];lines=p.lines||p.value.split("\n");var r=lines.length,w=0;lines.length>1&&lines[lines.length-1]===""&&r--;if(r>1&&!m)if(lines[0]===""){r--;w++}p.lines=
lines;if(!p.added&&!p.removed){if(linesAdded||linesRemoved){c.push([linesAdded,linesRemoved,changeIndex]);linesRemoved=linesAdded=0;changeIndex=-1;k+=linesRemoved}c.push([r,r,0]);k+=r}else if(p.added){if(changeIndex===-1)changeIndex=d.length+1;linesAdded+=r;for(m=w;m<r+w;m++)d.push(p.lines[m])}else linesRemoved+=r;m=false;if(lines.length>1&&lines[lines.length-1]==="")m=true}if(linesAdded||linesRemoved){c.push([linesAdded,linesRemoved,changeIndex]);k+=linesRemoved}if(k<g.length&&g.length>1){g=c[c.length-
1];if(g[2]===0){g[0]+=1;g[1]+=1}else if(g[2]===-1)c.push([1,1,0]);else if(i===h)c.push([1,1,0]);else{if(h)g[0]+=1;if(i)g[1]+=1}}return{mapper:c,changContents:{array:d,index:0}}}};return a}();return e});
define("examples/textview/textStyler",["i18n!orion/textview/nls/messages","orion/textview/annotations"],function(f,e){function a(l,o){this.keywords=l;this.whitespacesVisible=o;this.setText("")}function c(){a.call(this,null,true)}function d(l){a.call(this,null,l)}function g(){a.call(this,null,false)}function h(l,o,q){this.commentStart="/*";this.commentEnd="*/";var v=[];switch(o){case "java":v=j;break;case "js":v=i;break;case "css":v=k;break}this.whitespacesVisible=false;this.detectHyperlinks=true;
this.highlightCaretLine=false;this.detectTasks=this.foldingEnabled=true;this._scanner=new a(v,this.whitespacesVisible);this._firstScanner=new g;this._commentScanner=new d(this.whitespacesVisible);this._whitespaceScanner=new c;if(o==="css"){this._scanner.isCSS=true;this._firstScanner.isCSS=true}this.view=l;this.annotationModel=q;this._bracketAnnotations=undefined;var x=this;this._listener={onChanged:function(z){x._onModelChanged(z)},onDestroy:function(z){x._onDestroy(z)},onLineStyle:function(z){x._onLineStyle(z)},
onSelection:function(z){x._onSelection(z)}};o=l.getModel();o.getBaseModel?o.getBaseModel().addEventListener("Changed",this._listener.onChanged):l.addEventListener("ModelChanged",this._listener.onChanged);l.addEventListener("Selection",this._listener.onSelection);l.addEventListener("Destroy",this._listener.onDestroy);l.addEventListener("LineStyle",this._listener.onLineStyle);this._computeComments();this._computeFolding();l.redrawLines()}var i=["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"],j=["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"],k=["alignment-adjust","alignment-baseline","animation","animation-delay","animation-direction","animation-duration","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","appearance","azimuth","backface-visibility",
"background","background-attachment","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","baseline-shift","binding","bleed","bookmark-label","bookmark-level","bookmark-state","bookmark-target","border","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat",
"border-image-slice","border-image-source","border-image-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group",
"box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","clear","clip","color","color-profile","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","content","counter-increment","counter-reset","crop","cue","cue-after","cue-before","cursor","direction","display","dominant-baseline","drop-initial-after-adjust","drop-initial-after-align","drop-initial-before-adjust",
"drop-initial-before-align","drop-initial-size","drop-initial-value","elevation","empty-cells","fit","fit-position","flex-align","flex-flow","flex-inline-pack","flex-order","flex-pack","float","float-offset","font","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","grid-columns","grid-rows","hanging-punctuation","height","hyphenate-after","hyphenate-before","hyphenate-character","hyphenate-lines","hyphenate-resource","hyphens","icon","image-orientation",
"image-rendering","image-resolution","inline-box-align","left","letter-spacing","line-height","line-stacking","line-stacking-ruby","line-stacking-shift","line-stacking-strategy","list-style","list-style-image","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","mark","mark-after","mark-before","marker-offset","marks","marquee-direction","marquee-loop","marquee-play-count","marquee-speed","marquee-style","max-height","max-width","min-height",
"min-width","move-to","nav-down","nav-index","nav-left","nav-right","nav-up","opacity","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-style","overflow-x","overflow-y","padding","padding-bottom","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","page-policy","pause","pause-after","pause-before","perspective","perspective-origin","phonemes","pitch","pitch-range","play-during","position",
"presentation-level","punctuation-trim","quotes","rendering-intent","resize","rest","rest-after","rest-before","richness","right","rotation","rotation-point","ruby-align","ruby-overhang","ruby-position","ruby-span","size","speak","speak-header","speak-numeral","speak-punctuation","speech-rate","stress","string-set","table-layout","target","target-name","target-new","target-position","text-align","text-align-last","text-decoration","text-emphasis","text-height","text-indent","text-justify","text-outline",
"text-shadow","text-transform","text-wrap","top","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-pitch-range","voice-rate","voice-stress","voice-volume","volume","white-space","white-space-collapse","widows","width","word-break","word-spacing","word-wrap","z-index"],m={styleClass:"token_singleline_comment"},
n={styleClass:"token_multiline_comment"},p={styleClass:"token_doc_comment"},r={styleClass:"token_doc_html_markup"},w={styleClass:"token_task_tag"},s={styleClass:"token_doc_tag"},u={styleClass:"token_string"},t={styleClass:"token_keyword"},y={styleClass:"token_space"},B={styleClass:"token_tab"},D={styleClass:"line_caret"};a.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(l){var o=this.keywords;switch(l){case 32:case 9:if(this.whitespacesVisible)return l===32?9:8;do l=this._read();while(l===32||l===9);this._unread(l);return 7;case 123:case 125:case 40:case 41:case 91:case 93:case 60:case 62:return l;default:var q=this.isCSS;if(97<=l&&l<=122||65<=l&&l<=90||l===95||48<=l&&l<=57||45===l&&q){var v=this.offset-1;do l=this._read();while(97<=l&&l<=122||65<=l&&l<=90||l===95||48<=l&&l<=57||45===
l&&q);this._unread(l);if(o.length>0){l=this.text.substring(v,this.offset);for(q=0;q<o.length;q++)if(this.keywords[q]===l)return 2}}return 1}},_read:function(){if(this.offset<this.text.length)return this.text.charCodeAt(this.offset++);return-1},_unread:function(l){l!==-1&&this.offset--},nextToken:function(){for(this.startOffset=this.offset;;){var l=this._read();switch(l){case -1:return null;case 47:l=this._read();if(!this.isCSS)if(l===47)for(;;){l=this._read();if(l===-1||l===10||l===13){this._unread(l);
return 4}}if(l===42){l=this._read();var o=5;if(l===42)o=6;for(;;){for(;l===42;){l=this._read();if(l===47)return o}if(l===-1){this._unread(l);return o}l=this._read()}}this._unread(l);return 1;case 39:for(;;){l=this._read();switch(l){case 39:return 3;case 13:case 10:case -1:this._unread(l);return 3;case 92:this._read();break}}break;case 34:for(;;){l=this._read();switch(l){case 34:return 3;case 13:case 10:case -1:this._unread(l);return 3;case 92:this._read();break}}break;default:return this._default(l)}}},
setText:function(l){this.text=l;this.startOffset=this.offset=0}};c.prototype=new a(null);c.prototype.nextToken=function(){for(this.startOffset=this.offset;;){var l=this._read();switch(l){case -1:return null;case 32:return 9;case 9:return 8;default:do l=this._read();while(!(l===32||l===9||l===-1));this._unread(l);return 1}}};d.prototype=new a(null);d.prototype.setType=function(l){this._type=l};d.prototype.nextToken=function(){for(this.startOffset=this.offset;;){var l=this._read();switch(l){case -1:return null;
case 32:case 9:if(this.whitespacesVisible)return l===32?9:8;do l=this._read();while(l===32||l===9);this._unread(l);return 7;case 60:if(this._type===6){do l=this._read();while(!(l===62||l===-1));if(l===62)return 10}return 1;case 64:if(this._type===6){do l=this._read();while(97<=l&&l<=122||65<=l&&l<=90||l===95||48<=l&&l<=57);this._unread(l);return 11}return 1;case 84:if((l=this._read())===79)if((l=this._read())===68)if((l=this._read())===79){l=this._read();if(!(97<=l&&l<=122||65<=l&&l<=90||l===95||
48<=l&&l<=57)){this._unread(l);return 12}}this._unread(l);default:do l=this._read();while(!(l===32||l===9||l===-1||l===60||l===64||l===84));this._unread(l);return 1}}};g.prototype=new a(null);g.prototype._default=function(l){for(;;){l=this._read();switch(l){case 47:case 34:case 39:case -1:this._unread(l);return 1}}};h.prototype={getClassNameForToken:function(l){switch(l){case "singleLineComment":return m.styleClass;case "multiLineComment":return n.styleClass;case "docComment":return p.styleClass;
case "docHtmlComment":return r.styleClass;case "tasktag":return w.styleClass;case "doctag":return s.styleClass;case "string":return u.styleClass;case "keyword":return t.styleClass;case "space":return y.styleClass;case "tab":return B.styleClass;case "caretLine":return D.styleClass}return null},destroy:function(){var l=this.view;if(l){var o=l.getModel();o.getBaseModel?o.getBaseModel().removeEventListener("Changed",this._listener.onChanged):l.removeEventListener("ModelChanged",this._listener.onChanged);
l.removeEventListener("Selection",this._listener.onSelection);l.removeEventListener("Destroy",this._listener.onDestroy);l.removeEventListener("LineStyle",this._listener.onLineStyle);this.view=null}},setHighlightCaretLine:function(l){this.highlightCaretLine=l},setWhitespacesVisible:function(l){this.whitespacesVisible=l;this._scanner.whitespacesVisible=l;this._commentScanner.whitespacesVisible=l},setDetectHyperlinks:function(l){this.detectHyperlinks=l},setFoldingEnabled:function(l){this.foldingEnabled=
l},setDetectTasks:function(l){this.detectTasks=l},_binarySearch:function(l,o,q,v,x){var z;if(v===undefined)v=-1;if(x===undefined)x=l.length;for(;x-v>1;){z=Math.floor((x+v)/2);if(o<=l[z].start)x=z;else if(q&&o<l[z].end){x=z;break}else v=z}return x},_computeComments:function(){var l=this.view.getModel();if(l.getBaseModel)l=l.getBaseModel();this.comments=this._findComments(l.getText())},_computeFolding:function(){if(this.foldingEnabled){var l=this.view.getModel();if(l.getBaseModel){var o=this.annotationModel;
if(o){o.removeAnnotations("orion.annotation.folding");for(var q=[],v=l.getBaseModel(),x=this.comments,z=0;z<x.length;z++){var C=x[z];(C=this._createFoldingAnnotation(l,v,C.start,C.end))&&q.push(C)}o.replaceAnnotations(null,q)}}}},_createFoldingAnnotation:function(l,o,q,v){var x=o.getLineAtOffset(q);o=o.getLineAtOffset(v);if(x===o)return null;return new e.FoldingAnnotation(l,"orion.annotation.folding",q,v,"<div class='annotationHTML expanded'></div>",{styleClass:"annotation expanded"},"<div class='annotationHTML collapsed'></div>",
{styleClass:"annotation collapsed"})},_computeTasks:function(l,o,q){if(this.detectTasks){var v=this.annotationModel;if(v){var x=this.view.getModel(),z=x;if(x.getBaseModel)z=x.getBaseModel();var C=v.getAnnotations(o,q);for(x=[];C.hasNext();){var A=C.next();A.type==="orion.annotation.task"&&x.push(A)}C=[];A=this._commentScanner;A.setText(z.getText(o,q));for(var F;F=A.nextToken();){var H=A.getStartOffset()+o;if(F===12){F=z.getLineEnd(z.getLineAtOffset(H));if(l!==4)F=Math.min(F,q-this.commentEnd.length);
C.push({start:H,end:F,type:"orion.annotation.task",title:z.getText(H,F),style:{styleClass:"annotation task"},html:"<div class='annotationHTML task'></div>",overviewStyle:{styleClass:"annotationOverview task"},rangeStyle:{styleClass:"annotationRange task"}})}}v.replaceAnnotations(x,C)}}},_getLineStyle:function(l){if(this.highlightCaretLine){var o=this.view,q=o.getModel();o=o.getSelection();if(o.start===o.end&&q.getLineAtOffset(o.start)===l)return D}return null},_getStyles:function(l,o,q){if(l.getBaseModel)q=
l.mapOffset(q);for(var v=q+o.length,x=[],z=q,C=this.comments,A=this._binarySearch(C,q,true);A<C.length;A++){if(C[A].start>=v)break;var F=C[A].start,H=C[A].end;z<F&&this._parse(o.substring(z-q,F-q),z,x);var N=C[A].type===6?p:n;if(this.whitespacesVisible||this.detectHyperlinks){z=Math.max(z,F);F=Math.min(v,H);this._parseComment(o.substring(z-q,F-q),z,x,N,C[A].type)}else x.push({start:F,end:H,style:N});z=H}z<v&&this._parse(o.substring(z-q,v-q),z,x);if(l.getBaseModel)for(o=0;o<x.length;o++){q=x[o].end-
x[o].start;x[o].start=l.mapOffset(x[o].start,true);x[o].end=x[o].start+q}return x},_parse:function(l,o,q){var v=this._scanner;for(v.setText(l);l=v.nextToken();){var x=v.getStartOffset()+o,z=null;switch(l){case 2:z=t;break;case 3:if(this.whitespacesVisible){this._parseString(v.getData(),x,q,u);continue}else z=u;break;case 6:this._parseComment(v.getData(),x,q,p,l);continue;case 4:this._parseComment(v.getData(),x,q,m,l);continue;case 5:this._parseComment(v.getData(),x,q,n,l);continue;case 8:if(this.whitespacesVisible)z=
B;break;case 9:if(this.whitespacesVisible)z=y;break}q.push({start:x,end:v.getOffset()+o,style:z})}},_parseComment:function(l,o,q,v,x){var z=this._commentScanner;z.setText(l);for(z.setType(x);l=z.nextToken();){x=z.getStartOffset()+o;var C=v;switch(l){case 8:if(this.whitespacesVisible)C=B;break;case 9:if(this.whitespacesVisible)C=y;break;case 10:C=r;break;case 11:C=s;break;case 12:C=w;break;default:if(this.detectHyperlinks)C=this._detectHyperlinks(z.getData(),x,q,C)}C&&q.push({start:x,end:z.getOffset()+
o,style:C})}},_parseString:function(l,o,q,v){var x=this._whitespaceScanner;for(x.setText(l);l=x.nextToken();){var z=x.getStartOffset()+o,C=v;switch(l){case 8:if(this.whitespacesVisible)C=B;break;case 9:if(this.whitespacesVisible)C=y;break}C&&q.push({start:z,end:x.getOffset()+o,style:C})}},_detectHyperlinks:function(l,o,q,v){var x=null,z;if((z=l.indexOf("://"))>0){x=l;for(var C=z;C>0;){z=x.charCodeAt(C-1);if(!(97<=z&&z<=122||65<=z&&z<=90||45===z||48<=z&&z<=57))break;C--}if(C>0){z="\"\"''(){}[]<>".indexOf(x.substring(C-
1,C));if(z!==-1&&(z&1)===0&&(z=x.lastIndexOf("\"\"''(){}[]<>".substring(z+1,z+2)))!==-1){var A=z;z=this._clone(v);z.tagName="A";z.attributes={href:x.substring(C,A)};q.push({start:o,end:o+C,style:v});q.push({start:o+C,end:o+A,style:z});q.push({start:o+A,end:o+l.length,style:v});return null}}}else if(l.toLowerCase().indexOf("bug#")===0)x="https://bugs.eclipse.org/bugs/show_bug.cgi?id="+parseInt(l.substring(4),10);if(x){z=this._clone(v);z.tagName="A";z.attributes={href:x};return z}return v},_clone:function(l){if(!l)return l;
var o={};for(var q in l)if(l.hasOwnProperty(q))o[q]=l[q];return o},_findComments:function(l,o){o=o||0;var q=this._firstScanner;q.setText(l);for(var v=[];l=q.nextToken();){if(l===5||l===6){var x={start:q.getStartOffset()+o,end:q.getOffset()+o,type:l};v.push(x);this._computeTasks(l,q.getStartOffset()+o,q.getOffset()+o)}l===4&&this._computeTasks(l,q.getStartOffset()+o,q.getOffset()+o)}return v},_findMatchingBracket:function(l,o){var q="{}()[]<>",v=l.getText(o,o+1),x=q.indexOf(v,0);if(x===-1)return-1;
var z;z=x&1?q.substring(x-1,x):q.substring(x+1,x+2);var C=l.getLineAtOffset(o);q=l.getLine(C);var A=l.getLineStart(C),F=l.getLineEnd(C);q=this._findBrackets(v,z,q,A,A,F);for(F=0;F<q.length;F++){A=q[F]>=0?1:-1;if(q[F]*A===o){o=1;if(x&1){for(F--;F>=0;F--){A=q[F]>=0?1:-1;o+=A;if(o===0)return q[F]*A}for(C-=1;C>=0;){q=l.getLine(C);A=l.getLineStart(C);F=l.getLineEnd(C);q=this._findBrackets(v,z,q,A,A,F);for(x=q.length-1;x>=0;x--){A=q[x]>=0?1:-1;o+=A;if(o===0)return q[x]*A}C--}}else{for(F++;F<q.length;F++){A=
q[F]>=0?1:-1;o+=A;if(o===0)return q[F]*A}C+=1;for(x=l.getLineCount();C<x;){q=l.getLine(C);A=l.getLineStart(C);F=l.getLineEnd(C);q=this._findBrackets(v,z,q,A,A,F);for(F=0;F<q.length;F++){A=q[F]>=0?1:-1;o+=A;if(o===0)return q[F]*A}C++}}break}}return-1},_findBrackets:function(l,o,q,v,x,z){var C=[];l=l.charCodeAt(0);o=o.charCodeAt(0);for(var A=x,F=this._scanner,H,N=this.comments,I=this._binarySearch(N,x,true);I<N.length;I++){if(N[I].start>=z)break;H=N[I].start;var O=N[I].end;if(A<H)for(F.setText(q.substring(A-
x,H-x));H=F.nextToken();)if(H===l)C.push(F.getStartOffset()+A-x+v);else H===o&&C.push(-(F.getStartOffset()+A-x+v));A=O}if(A<z)for(F.setText(q.substring(A-x,z-x));H=F.nextToken();)if(H===l)C.push(F.getStartOffset()+A-x+v);else H===o&&C.push(-(F.getStartOffset()+A-x+v));return C},_onDestroy:function(){this.destroy()},_onLineStyle:function(l){if(l.textView===this.view)l.style=this._getLineStyle(l.lineIndex);l.ranges=this._getStyles(l.textView.getModel(),l.lineText,l.lineStart)},_onSelection:function(l){var o=
l.oldValue,q=l.newValue,v=this.view;l=v.getModel();var x;if(this.highlightCaretLine){var z=l.getLineAtOffset(o.start);x=l.getLineAtOffset(q.start);var C=q.start===q.end;o=o.start===o.end;if(!(z===x&&o&&C)){o&&v.redrawLines(z,z+1);if((z!==x||!o)&&C)v.redrawLines(x,x+1)}}if(this.annotationModel){o=this._bracketAnnotations;var A,F;if(q.start===q.end&&(F=v.getCaretOffset())>0){F=F-1;if(l.getBaseModel){F=l.mapOffset(F);l=l.getBaseModel()}l=this._findMatchingBracket(l,F);if(l!==-1)A=[{start:l,end:l+1,type:"orion.annotation.matchingBracket",
title:f.matchingBracket,html:"<div class='annotationHTML matchingBracket'></div>",overviewStyle:{styleClass:"annotationOverview matchingBracket"},rangeStyle:{styleClass:"annotationRange matchingBracket"}},{start:F,end:F+1,type:"orion.annotation.currentBracket",title:f.currentBracket,html:"<div class='annotationHTML currentBracket'></div>",overviewStyle:{styleClass:"annotationOverview currentBracket"},rangeStyle:{styleClass:"annotationRange currentBracket"}}]}this._bracketAnnotations=A;this.annotationModel.replaceAnnotations(o,
A)}},_onModelChanged:function(l){var o=l.start,q=l.removedCharCount,v=l.addedCharCount-q,x=this.view;l=x.getModel();var z=l.getBaseModel?l.getBaseModel():l;q=o+q;var C=z.getCharCount(),A=this.comments.length,F=z.getLineStart(z.getLineAtOffset(o)),H=this._binarySearch(this.comments,F,true),N=this._binarySearch(this.comments,q,false,H-1,A);if(H<A&&this.comments[H].start<=F&&F<this.comments[H].end){F=this.comments[H].start;if(F>o)F+=v}else F=H===A&&A>0&&C-v===this.comments[A-1].end?this.comments[A-1].start:
F;var I;if(N<A){I=this.comments[N].end;if(I>o)I+=v;N+=1}else{N=A;I=C}var O;C=this._findComments(z.getText(F,I),F);for(A=H;A<this.comments.length;A++){O=this.comments[A];if(O.start>o)O.start+=v;if(O.start>o)O.end+=v}var M=N-H!==C.length;if(!M)for(A=0;A<C.length;A++){O=this.comments[H+A];var Q=C[A];if(O.start!==Q.start||O.end!==Q.end||O.type!==Q.type){M=true;break}}A=[H,N-H].concat(C);Array.prototype.splice.apply(this.comments,A);if(M){A=F;O=I;if(l!==z){A=l.mapOffset(A,true);O=l.mapOffset(O,true)}x.redrawRange(A,
O)}if(this.foldingEnabled&&z!==l&&this.annotationModel){x=this.annotationModel;H=x.getAnnotations(F,I);F=[];for(I=[];H.hasNext();){O=H.next();if(O.type==="orion.annotation.folding"){I.push(O);for(A=0;A<C.length;A++)if(O.start===C[A].start&&O.end===C[A].end)break;if(A===C.length){F.push(O);O.expand()}else{A=O.start;N=O.end;if(A>o)A-=v;if(N>o)N-=v;if(A<=o&&o<N&&A<=q&&q<N){A=z.getLineAtOffset(O.start);N=z.getLineAtOffset(O.end);if(A!==N){if(!O.expanded){O.expand();x.modifyAnnotation(O)}}else x.removeAnnotation(O)}}}}o=
[];for(A=0;A<C.length;A++){O=C[A];for(v=0;v<I.length;v++)if(I[v].start===O.start&&I[v].end===O.end)break;if(v===I.length)(O=this._createFoldingAnnotation(l,z,O.start,O.end))&&o.push(O)}x.replaceAnnotations(F,o)}}};return{TextStyler:h}});
define("orion/editor/textMateStyler",["orion/editor/regex"],function(f){function e(c,d,g){this.initialize(c);this.grammar=this.copy(d);this.externalGrammars=g?this.copy(g):[];this._styles={};this._tree=null;this._allGrammars={};this.preprocess(this.grammar)}var a={unsupported:[{regex:/\(\?[ims\-]:/,func:function(){return"option on/off for subexp"}},{regex:/\(\?<([=!])/,func:function(c){return c[1]==="="?"lookbehind":"negative lookbehind"}},{regex:/\(\?>/,func:function(){return"atomic group"}}],toRegExp:function(c){function d(k,
m){throw new Error('Unsupported regex feature "'+k+'": "'+m[0]+'" at index: '+m.index+" in "+m.input);}function g(k){for(var m="",n=false,p=k.length,r=0;r<p;){var w=k[r];if(!n&&w==="#")for(;r<p&&w!=="\r"&&w!=="\n";)w=k[++r];else if(!n&&/\s/.test(w))for(;r<p&&/\s/.test(w);)w=k[++r];else{if(w==="\\"){m+=w;if(!/\s/.test(k[r+1])){m+=k[r+1];r+=1}}else{if(w==="[")n=true;else if(w==="]")n=false;m+=w}r+=1}}return m}var h="",i;c=a.processGlobalFlag("x",c,function(k){return g(k)});c=a.processGlobalFlag("i",
c,function(k){h+="i";return k});for(i=0;i<this.unsupported.length;i++){var j;if(j=this.unsupported[i].regex.exec(c))d(this.unsupported[i].func(j),j)}return new RegExp(c,h)},processGlobalFlag:function(c,d,g){function h(j,k){var m=0,n=j.length,p=-1;for(k=k;k<n&&p===-1;k++)switch(j[k]){case "\\":k++;break;case "(":m++;break;case ")":m--;if(m===0)p=k;break}return p}var i="(?"+c+")";c="(?"+c+":";if(d.substring(0,i.length)===i)return g(d.substring(i.length));else if(d.substring(0,c.length)===c){i=h(d,0);
if(i<d.length-1)throw new Error("Only a "+c+") group that encloses the entire regex is supported in: "+d);return g(d.substring(c.length,i))}return d},hasBackReference:function(c){return/\\\d+/.test(c.source)},getSubstitutedRegex:function(c,d,g){g=typeof g==="undefined"?true:false;c=c.source.split(/(\\\d+)/g);for(var h=[],i=0;i<c.length;i++){var j=c[i],k=/\\(\d+)/.exec(j);if(k){j=d[k[1]]||"";h.push(g?f.escape(j):j)}else h.push(j)}return new RegExp(h.join(""))},groupify:function(c,d){var g=c.source,
h=g.length,i=[],j=0,k=[],m=1,n=1,p=[];c={};for(var r={},w=0;w<h;w++){var s=i[i.length-1],u=g[w];switch(u){case "(":if(s===4){i.pop();p.push(")");k[k.length-1].end=w}var t=w+2<h?g[w+1]+""+g[w+2]:null;if(t==="?:"||t==="?="||t==="?!"){var y;if(t==="?:")y=1;else{y=3;j++}i.push(y);k.push({start:w,end:-1,type:y});p.push(u);p.push(t);w+=t.length}else{i.push(2);k.push({start:w,end:-1,type:2,oldNum:m,num:n});p.push(u);if(j===0)r[n]=null;c[m]=n;m++;n++}break;case ")":s=i.pop();s===3&&j--;k[k.length-1].end=
w;p.push(u);break;case "*":case "+":case "?":case "}":var B=u,D=g[w-1];t=w-1;if(u==="}"){for(y=w-1;g[y]!=="{"&&y>=0;y--);D=g[y-1];t=y-1;B=g.substring(y,w+1)}y=k[k.length-1];if(D===")"&&(y.type===2||y.type===4)){p.splice(y.start,0,"(");p.push(B);p.push(")");u={start:y.start,end:p.length-1,type:4,num:y.num};for(D=0;D<k.length;D++){s=k[D];if(s.type===2||s.type===4)if(s.start>=y.start&&s.end<=t){s.start+=1;s.end+=1;s.num+=1;if(s.type===2)c[s.oldNum]=s.num}}k.push(u);n++;break}default:if(u!=="|"&&s!==
2&&s!==4)if(j===0){i.push(4);k.push({start:w,end:-1,type:4,num:n});p.push("(");r[n]=null;n++}p.push(u);if(u==="\\"){p.push(g[w+1]);w+=1}break}}for(;i.length;){i.pop();p.push(")")}g=new RegExp(p.join(""));h={};d=d||c;for(var l in d)if(d.hasOwnProperty(l))h[l]="\\"+d[l];g=this.getSubstitutedRegex(g,h,false);return[g,c,r]},complexCaptures:function(c){if(!c)return false;for(var d in c)if(c.hasOwnProperty(d))if(d!=="0")return true;return false}};e.prototype={initialize:function(c){this.textView=c;var d=
this;this._listener={onModelChanged:function(g){d.onModelChanged(g)},onDestroy:function(g){d.onDestroy(g)},onLineStyle:function(g){d.onLineStyle(g)}};c.addEventListener("ModelChanged",this._listener.onModelChanged);c.addEventListener("Destroy",this._listener.onDestroy);c.addEventListener("LineStyle",this._listener.onLineStyle);c.redrawLines()},onDestroy:function(){this.destroy()},destroy:function(){if(this.textView){this.textView.removeEventListener("ModelChanged",this._listener.onModelChanged);this.textView.removeEventListener("Destroy",
this._listener.onDestroy);this.textView.removeEventListener("LineStyle",this._listener.onLineStyle);this.textView=null}this._listener=this._tree=this._styles=this.grammar=null},copy:function(c){return JSON.parse(JSON.stringify(c))},preprocess:function(c){for(c=[c];c.length!==0;){var d=c.pop();if(!(d._resolvedRule&&d._typedRule)){d._resolvedRule=this._resolve(d);d._typedRule=this._createTypedRule(d);this.addStyles(d.name);this.addStyles(d.contentName);this.addStylesForCaptures(d.captures);this.addStylesForCaptures(d.beginCaptures);
this.addStylesForCaptures(d.endCaptures);d._resolvedRule!==d&&c.push(d._resolvedRule);if(d.patterns)for(var g=0;g<d.patterns.length;g++)c.push(d.patterns[g])}}},addStyles:function(c){if(c&&!this._styles[c]){this._styles[c]=[];for(var d=c.split("."),g=0;g<d.length;g++)this._styles[c].push(d.slice(0,g+1).join("-"))}},addStylesForCaptures:function(c){for(var d in c)c.hasOwnProperty(d)&&this.addStyles(c[d].name)},ContainerRule:function(){function c(d){this.rule=d;this.subrules=d.patterns}c.prototype.valueOf=
function(){return"aa"};return c}(),BeginEndRule:function(){function c(d){this.rule=d;this.beginRegex=a.toRegExp(d.begin);this.endRegex=a.toRegExp(d.end);this.subrules=d.patterns||[];this.endRegexHasBackRef=a.hasBackReference(this.endRegex);var g=a.complexCaptures(d.captures);d=a.complexCaptures(d.beginCaptures)||a.complexCaptures(d.endCaptures);if(this.isComplex=g||d){g=a.groupify(this.beginRegex);this.beginRegex=g[0];this.beginOld2New=g[1];this.beginConsuming=g[2];g=a.groupify(this.endRegex,this.beginOld2New);
this.endRegex=g[0];this.endOld2New=g[1];this.endConsuming=g[2]}}c.prototype.valueOf=function(){return this.beginRegex};return c}(),MatchRule:function(){function c(d){this.rule=d;this.matchRegex=a.toRegExp(d.match);if(this.isComplex=a.complexCaptures(d.captures)){d=a.groupify(this.matchRegex);this.matchRegex=d[0];this.matchOld2New=d[1];this.matchConsuming=d[2]}}c.prototype.valueOf=function(){return this.matchRegex};return c}(),_createTypedRule:function(c){return c.match?new this.MatchRule(c):c.begin?
new this.BeginEndRule(c):new this.ContainerRule(c)},_resolve:function(c){var d=c;if(c.include){if(c.begin||c.end||c.match)throw new Error('Unexpected regex pattern in "include" rule '+c.include);c=c.include;if(c[0]==="#"){d=this.grammar.repository&&this.grammar.repository[c.substring(1)];if(!d)throw new Error("Couldn't find included rule "+c+" in grammar repository");}else if(c==="$self")d=this.grammar;else if(c==="$base")throw new Error('Include "$base" is not supported');else{d=this._allGrammars[c];
if(!d)for(var g=0;g<this.externalGrammars.length;g++){var h=this.externalGrammars[g];if(h.scopeName===c){this.preprocess(h);d=this._allGrammars[c]=h;break}}}}return d},ContainerNode:function(){function c(d,g){this.parent=d;this.rule=g;this.children=[];this.end=this.start=null}c.prototype.addChild=function(d){this.children.push(d)};c.prototype.valueOf=function(){var d=this.rule;return"ContainerNode { "+(d.include||"")+" "+(d.name||"")+(d.comment||"")+"}"};return c}(),BeginEndNode:function(){function c(d,
g,h){this.parent=d;this.rule=g;this.children=[];this.setStart(h);this.endMatch=this.end=null;this.endRegexSubstituted=g.endRegexHasBackRef?a.getSubstitutedRegex(g.endRegex,h):null}c.prototype.addChild=function(d){this.children.push(d)};c.prototype.getIndexInParent=function(){return this.parent?this.parent.children.indexOf(this):-1};c.prototype.setStart=function(d){this.start=d.index;this.beginMatch=d};c.prototype.setEnd=function(d){if(d&&typeof d==="object"){this.endMatch=d;this.end=d.index+d[0].length}else{this.endMatch=
null;this.end=d}};c.prototype.shiftStart=function(d){this.start+=d;this.beginMatch.index+=d};c.prototype.shiftEnd=function(d){this.end+=d;if(this.endMatch)this.endMatch.index+=d};c.prototype.valueOf=function(){return"{"+this.rule.beginRegex+" range="+this.start+".."+this.end+"}"};return c}(),push:function(c,d){if(d)for(var g=d.length;g>0;)c.push(d[--g])},exec:function(c,d,g){if(d=c.exec(d))d.index+=g;c.lastIndex=0;return d},afterMatch:function(c){return c.index+c[0].length},getEndMatch:function(c,
d,g){if(c instanceof this.BeginEndNode){var h=c.rule;c=c.endRegexSubstituted||h.endRegex;if(!c)return null;return this.exec(c,d,g)}return null},initialParse:function(){this.textView.getModel().getCharCount();this._tree=new this.ContainerNode(null,this.grammar._typedRule);this.parse(this._tree,false,0)},onModelChanged:function(c){var d=c.addedCharCount,g=c.removedCharCount;c=c.start;if(this._tree){var h=this.textView.getModel(),i=h.getCharCount();h=h.getLineEnd(h.getLineAtOffset(c)-1);var j=this.getFirstDamaged(h,
h);h=h===-1?0:h;d=j?this.parse(j,true,h,c,d,g):i;this.textView.redrawRange(h,d)}else this.initialParse()},getFirstDamaged:function(c,d){if(c<0)return this._tree;for(var g=[this._tree],h=null;g.length;){var i=g.pop();if(!i.parent||this.isDamaged(i,c,d)){if(i instanceof this.BeginEndNode)h=i;for(var j=0;j<i.children.length;j++)g.push(i.children[j])}}return h||this._tree},isDamaged:function(c,d,g){return c.start<=g&&c.end>d},parse:function(c,d,g,h,i,j){var k=this.textView.getModel(),m=k.getLineStart(k.getLineCount()-
1),n=k.getCharCount(),p=this.getInitialExpected(c,g),r=-1;if(d){c.repaired=true;c.endNeedsUpdate=true;r=c.children[c.children.length-1];var w=i-j;r=r?k.getLineEnd(k.getLineAtOffset(r.end+w)):-1;h=k.getLineEnd(k.getLineAtOffset(h+j));r=Math.max(r,h)}r=r===-1?n:r;h=p;var s=c;w=false;for(var u=g,t=-1;s&&(!d||u<r);){var y=this.getNextMatch(k,s,u);y||(u=u>=m?n:k.getLineStart(k.getLineAtOffset(u)+1));var B=y&&y.match,D=y&&y.rule,l=y&&y.isEnd;if(y&&y.isSub){u=this.afterMatch(B);if(D instanceof this.BeginEndRule){w=
true;if(d&&D===h.rule&&s===h.parent){s=h;s.setStart(B);s.repaired=true;s.endNeedsUpdate=true;s=s;h=this.getNextExpected(h,"begin")}else{if(d){this.prune(s,h);d=false}B=new this.BeginEndNode(s,D,B);s.addChild(B);s=B}}}else if(l||u===n){if(s instanceof this.BeginEndNode)if(B){w=true;t=Math.max(t,s.end);s.setEnd(B);u=this.afterMatch(B);if(d&&s===h&&s.parent===h.parent){s.repaired=true;delete s.endNeedsUpdate;h=this.getNextExpected(h,"end")}else if(d){this.prune(s,h);d=false}}else{s.setEnd(n);delete s.endNeedsUpdate}s=
s.parent}if(d&&u>=r&&!w){this.prune(c,p);d=false}}this.removeUnrepairedChildren(c,d,g);this.cleanup(d,c,g,r,n,i,j);return d?Math.max(t,u):u},removeUnrepairedChildren:function(c,d,g){if(d){d=c.children;for(var h=-1,i=0;i<d.length;i++){var j=d[i];if(!j.repaired&&this.isDamaged(j,g,Number.MAX_VALUE)){h=i;break}}if(h!==-1)c.children.length=h}},cleanup:function(c,d,g,h,i,j,k){if(c){c=j-k;i=this.getIntersecting(h-c+1,i);d=this.getIntersecting(g,h);for(g=0;g<i.length;g++){h=i[g];if(!h.repaired&&h instanceof
this.BeginEndNode){h.shiftEnd(c);h.shiftStart(c)}}for(g=0;g<d.length;g++){h=d[g];h.repaired&&h.endNeedsUpdate&&h.shiftEnd(c);delete h.endNeedsUpdate;delete h.repaired}}else{d=this.getIntersecting(g,h);for(g=0;g<d.length;g++)delete d[g].repaired}},getNextMatch:function(c,d,g,h){var i=c.getLineAtOffset(g);i=c.getLineEnd(i);var j=c.getText(g,i),k=[],m=[];c=[];i=[];for(this.push(k,d.rule.subrules);k.length;){var n=k.length?k.pop():null;n=n&&n._resolvedRule._typedRule;if(n instanceof this.ContainerRule&&
m.indexOf(n)===-1){m.push(n);this.push(k,n.subrules)}else if(!(n&&h&&!n.matchRegex)){var p=n&&this.exec(n.matchRegex||n.beginRegex,j,g);if(p){c.push(p);i.push(n)}}}k=Number.MAX_VALUE;m=-1;for(n=0;n<c.length;n++){p=c[n];if(p.index<k){k=p.index;m=n}}if(!h)if(g=this.getEndMatch(d,j,g)){h=d.rule.applyEndPatternLast;if(m===-1||g.index<k||!h&&g.index===k)return{isEnd:true,rule:d.rule,match:g}}return m===-1?null:{isSub:true,rule:i[m],match:c[m]}},getInitialExpected:function(c,d){var g,h;if(c===this._tree)for(g=
0;g<c.children.length;g++){h=c.children[g];if(h.start>=d)return h}else if(c instanceof this.BeginEndNode)if(c.endMatch){var i=c.endMatch.index;for(g=0;g<c.children.length;g++){h=c.children[g];if(h.start>=d)break}if(h&&h.start<i)return h}return c},getNextExpected:function(c,d){if(d==="begin")return(d=c.children[0])?d:c;else if(d==="end")if(d=c.parent)return(c=d.children[d.children.indexOf(c)+1])?c:d;return null},prune:function(c,d){if(d.parent===c)c.children.length=d.getIndexInParent();else if(c instanceof
this.BeginEndNode){c.endMatch=null;c.end=null}if(c.parent)c.parent.children.length=c.getIndexInParent()+1},onLineStyle:function(c){function d(k,m){return k.start-m.start}this._tree||this.initialParse();var g=c.lineStart,h=this.textView.getModel(),i=h.getLineEnd(c.lineIndex),j=h.getLineEnd(h.getLineAtOffset(g)-1);j=this.getFirstDamaged(j,j);g=this.getLineScope(h,j,g,i);c.ranges=this.toStyleRanges(g);c.ranges.sort(d)},getLineScope:function(c,d,g,h){for(var i=g,j=this.getInitialExpected(d,g),k=[],m=
[];d&&i<h;){var n=this.getNextMatch(c,d,i);if(!n)break;var p=n&&n.match,r=n&&n.rule,w=n&&n.isSub;n=n&&n.isEnd;p.index!==i&&m.push({start:i,end:p.index,node:d});if(w){i=this.afterMatch(p);if(r instanceof this.BeginEndRule){this.addBeginScope(k,p,r);d=j;j=this.getNextExpected(j,"begin")}else this.addMatchScope(k,p,r)}else if(n){i=this.afterMatch(p);this.addEndScope(k,p,r);j=this.getNextExpected(j,"end");d=d.parent}}i<h&&m.push({start:i,end:h,node:d});c=this.getInheritedLineScope(m,g,h);return k.concat(c)},
getInheritedLineScope:function(c){for(var d=[],g=0;g<c.length;g++)for(var h=c[g],i=h.node;i;){var j=i.rule.rule,k=j.name;if(j=j.contentName||k){this.addScopeRange(d,h.start,h.end,j);break}i=i.parent}return d},addBeginScope:function(c,d,g){var h=g.rule;this.addCapturesScope(c,d,h.beginCaptures||h.captures,g.isComplex,g.beginOld2New,g.beginConsuming)},addEndScope:function(c,d,g){var h=g.rule;this.addCapturesScope(c,d,h.endCaptures||h.captures,g.isComplex,g.endOld2New,g.endConsuming)},addMatchScope:function(c,
d,g){var h=g.rule,i=h.name;(h=h.captures)?this.addCapturesScope(c,d,h,g.isComplex,g.matchOld2New,g.matchConsuming):this.addScope(c,d,i)},addScope:function(c,d,g){g&&c.push({start:d.index,end:this.afterMatch(d),scope:g})},addScopeRange:function(c,d,g,h){h&&c.push({start:d,end:g,scope:h})},addCapturesScope:function(c,d,g,h,i,j){if(g)if(h){h={1:0};for(var k=0,m=1;d[m]!==undefined;m++){if(j[m]!==undefined)k+=d[m].length;if(d[m+1]!==undefined)h[m+1]=k}j=d.index;for(k=1;g[k];k++){m=g[k].name;var n=i[k],
p=j+h[n];typeof d[n]!=="undefined"&&this.addScopeRange(c,p,p+d[n].length,m)}}else this.addScope(c,d,g[0]&&g[0].name)},getIntersecting:function(c,d){for(var g=[],h=this._tree?[this._tree]:[];h.length;){var i=h.pop(),j=false;if(i instanceof this.ContainerNode)j=true;else if(this.isDamaged(i,c,d)){j=true;g.push(i)}if(j){j=i.children.length;for(var k=0;k<j;k++)h.push(i.children[k])}}return g.reverse()},toStyleRanges:function(c){for(var d=[],g=0;g<c.length;g++){var h=c[g],i=this._styles[h.scope];if(!i)throw new Error("styles not found for "+
h.scope);i=i.join(" ");d.push({start:h.start,end:h.end,style:{styleClass:i}})}return d}};return{RegexUtil:a,TextMateStyler:e}});
define("orion/editor/asyncStyler",["i18n!orion/editor/nls/messages"],function(f){function e(c){return c.getName()==="orion.edit.highlighter"&&c.getProperty("type")==="highlighter"}function a(c,d,g){this.initialize(c,d,g);this.lineStyles=[]}a.prototype={initialize:function(c,d,g){this.textView=c;this.serviceRegistry=d;this.annotationModel=g;this.services=[];var h=this;this.listener={onModelChanging:function(j){h.onModelChanging(j)},onModelChanged:function(j){h.onModelChanged(j)},onDestroy:function(j){h.onDestroy(j)},
onLineStyle:function(j){h.onLineStyle(j)},onStyleReady:function(j){h.onStyleReady(j)},onServiceAdded:function(j,k){h.onServiceAdded(j,k)},onServiceRemoved:function(j,k){h.onServiceRemoved(j,k)}};c.addEventListener("ModelChanging",this.listener.onModelChanging);c.addEventListener("ModelChanged",this.listener.onModelChanged);c.addEventListener("Destroy",this.listener.onDestroy);c.addEventListener("LineStyle",this.listener.onLineStyle);d.addEventListener("serviceAdded",this.listener.onServiceAdded);
d.addEventListener("serviceRemoved",this.listener.onServiceRemoved);c=d.getServiceReferences("orion.edit.highlighter");for(g=0;g<c.length;g++){var i=c[g];e(i)&&this.addServiceListener(d.getService(i))}},onDestroy:function(){this.destroy()},destroy:function(){if(this.textView){this.textView.removeEventListener("ModelChanging",this.listener.onModelChanging);this.textView.removeEventListener("ModelChanged",this.listener.onModelChanged);this.textView.removeEventListener("Destroy",this.listener.onDestroy);
this.textView.removeEventListener("LineStyle",this.listener.onLineStyle);this.textView=null}if(this.services){for(var c=0;c<this.services.length;c++)this.removeServiceListener(this.services[c]);this.services=null}if(this.serviceRegistry){this.serviceRegistry.removeEventListener("serviceAdded",this.listener.onServiceAdded);this.serviceRegistry.removeEventListener("onServiceRemoved",this.listener.onServiceRemoved);this.serviceRegistry=null}this.lineStyles=this.listener=null},onModelChanging:function(c){this.startLine=
this.textView.getModel().getLineAtOffset(c.start)},onModelChanged:function(c){var d=this.startLine;if(c.addedLineCount||c.removedLineCount)Array.prototype.splice.apply(this.lineStyles,[d,c.removedLineCount].concat(this._getEmptyStyle(c.addedLineCount)))},onStyleReady:function(c){var d=c.lineStyles||c.style;c=Number.MAX_VALUE;var g=-1,h=this.textView.getModel();for(var i in d)if(d.hasOwnProperty(i)){this.lineStyles[i]=d[i];c=Math.min(c,i);g=Math.max(g,i)}c=Math.max(c,0);g=Math.min(g,h.getLineCount());
if(d=this.annotationModel){for(var j=d.getAnnotations(h.getLineStart(c),h.getLineEnd(g)),k=[];j.hasNext();){var m=j.next();m.type==="orion.annotation.highlightError"&&k.push(m)}j=[];for(m=c;m<=g;m++){i=m;var n=this.lineStyles[i];n=n&&n.errors;i=h.getLineStart(i);if(n)for(var p=0;p<n.length;p++){var r=n[p];j.push({start:r.start+i,end:r.end+i,type:"orion.annotation.highlightError",title:f.syntaxError,html:"<div class='annotationHTML error'></div>",rangeStyle:{styleClass:"annotationRange error"}})}}d.replaceAnnotations(k,
j)}this.textView.redrawLines(c,g+1)},onLineStyle:function(c){function d(h,i){for(var j=h.length,k=[],m=0;m<j;m++){var n=h[m];k.push({start:n.start+i,end:n.end+i,style:n.style})}return k}var g=this.lineStyles[c.lineIndex];if(g)if(g.ranges)c.ranges=d(g.ranges,c.lineStart);else if(g.style)c.style=g.style},_getEmptyStyle:function(c){for(var d=[],g=0;g<c;g++)d.push(null);return d},setContentType:function(c){this.contentType=c;if(this.services)for(c=0;c<this.services.length;c++){var d=this.services[c];
d.setContentType&&d.setContentType(this.contentType)}},onServiceAdded:function(c,d){e(c)&&this.addServiceListener(d)},onServiceRemoved:function(c,d){this.services.indexOf(d)!==-1&&this.removeServiceListener(d)},addServiceListener:function(c){c.addEventListener("orion.edit.highlighter.styleReady",this.listener.onStyleReady);this.services.push(c);c.setContentType&&this.contentType&&c.setContentType(this.contentType)},removeServiceListener:function(c){c.removeEventListener("orion.edit.highlighter.styleReady",
this.listener.onStyleReady);c=this.services.indexOf(c);c!==-1&&this.services.splice(c,1)}};return{AsyncStyler:a}});
define("examples/textview/textStylerOptions",[],function(){function f(e){this._styler=e;this._view=this._styler.view;var a=this;this._listener={onLoad:function(c){a._onLoad(c)},onStorage:function(c){a._onStorage(c)}};if(this._view){this._view.isLoaded()?this._updateStylesheet():this._view.addEventListener("Load",this._listener.onLoad);window.addEventListener("storage",this._listener.onStorage,false)}}f.prototype={_getSetting:function(e,a){for(var c=JSON.parse(localStorage.getItem("JavaScript Editor")),
d,g=0;g<c.length;g++)if(c[g].label===e)for(var h=0;h<c[g].data.length;h++)if(c[g].data[h].label===a){d=c[g].data[h].value;break}return d},_getStyleSheet:function(e){function a(m,n){if(m=k.getClassNameForToken(m)){var p=j._getSetting(n,"Color");n=j._getSetting(n,"Weight").toLowerCase();c.push("."+e+" ."+m+" {");c.push("\tcolor: "+p+";");c.push("\tfont-weight: "+n+";");c.push("}")}}var c=[];c.push("");var d=this._getSetting("Font","Family").toLowerCase();d=d==="sans serif"?'"Menlo", "Consolas", "Vera Mono", "monospace"':
"monospace";var g=this._getSetting("Font","Size"),h=this._getSetting("Font","Color"),i=this._getSetting("Font","Background");c.push("."+e+" {");c.push("\tfont-family: "+d+";");c.push("\tfont-size: "+g+";");c.push("\tcolor: "+h+";");c.push("\tbackground-color: "+i+";");c.push("}");c.push("."+e+" .view {");c.push("\tbackground-color: "+i+";");c.push("}");c.push("."+e+" .ruler {");c.push("\tbackground-color: "+i+";");c.push("}");var j=this,k=this._styler;if(k.getClassNameForToken){a("keyword","Keyword Types");
a("string","String Types");a("singleLineComment","Comment Types");a("multiLineComment","Comment Types");a("docComment","Comment Types");a("docHtmlComment","Comment Types")}return c.join("\n")},_updateStylesheet:function(){if(localStorage.getItem("JavaScript Editor")){var e=this._view,a={stylesheet:null,themeClass:null};e.getOptions(a);var c=a.stylesheet;c||(c=[]);c instanceof Array||(c=[c]);for(var d=0;d<c.length;d++)if(c[d].indexOf("/* Orion Editor User Preference CSS (key) */")===0){c.splice(d,
1);break}if(d=a.themeClass){if(d=d.replace("userTheme",""))d+=" ";d+="userTheme"}else d="userTheme";c.push("/* Orion Editor User Preference CSS (key) */"+this._getStyleSheet("userTheme"));a.stylesheet=c;a.themeClass=d;e.setOptions(a)}},_onLoad:function(){this._updateStylesheet();this._view.removeEventListener("Load",this._listener.onLoad)},_onStorage:function(e){e.key==="JavaScript Editor"&&this._updateStylesheet()}};return{TextStylerOptions:f}});
define("orion/highlight",["dojo","examples/textview/textStyler","orion/editor/textMateStyler","orion/editor/asyncStyler","examples/textview/textStylerOptions"],function(f,e,a,c,d){function g(i,j,k,m,n,p){function r(D,l){var o=D.getProperty("contentType"),q=D.getProperty("fileTypes");if(o)return j.isSomeExtensionOf(k,o).then(function(v){return v?D:null});else if(l&&q&&q.indexOf(l)!==-1){l=new f.Deferred;l.callback(D);return l}return null}function w(D){var l=null;switch(D&&D.id){case "text.javascript":case "text.json":l=
new e.TextStyler(m,"js",n);break;case "text.java":l=new e.TextStyler(m,"java",n);break;case "text.css":l=new e.TextStyler(m,"css",n);break}l&&new d.TextStylerOptions(l);return l}var s=w(k);if(s){p=new f.Deferred;p.callback(s);return p}s=p&&p.split(".").pop().toLowerCase();p=i.getServiceReferences("orion.edit.highlighter");for(var u=[],t=[],y=0;y<p.length;y++){var B=p[y];B.getProperty("type")==="grammar"&&u.push(B.getProperty("grammar"));(B=r(B,s))&&t.push(B)}return(new f.DeferredList(t)).then(function(D){for(var l,
o=D.length-1;o>=0;o--){var q=D[o][1];if(q){l=q;break}}var v;if(l){D=l.getProperty("type");if(D==="highlighter"){v=new c.AsyncStyler(m,i,n);v.setContentType(k)}else if(D==="grammar"||typeof D==="undefined"){l=l.getProperty("grammar");v=new a.TextMateStyler(m,l,u)}}return v})}function h(i){this.serviceRegistry=i;this.styler=null}h.prototype={setup:function(i,j,k,m){if(this.styler){this.styler.destroy&&this.styler.destroy();this.styler=null}var n=this;return g(this.serviceRegistry,this.serviceRegistry.getService("orion.file.contenttypes"),
i,j,k,m).then(function(p){return n.styler=p})},getStyler:function(){return this.styler}};return{createStyler:g,SyntaxHighlighter:h}});
define("orion/compare/compare-container",["require","dojo","orion/compare/diff-parser","orion/compare/rulers","orion/compare/compare-inline-model","orion/compare/compare-2way-model","orion/editor/contentAssist","orion/editorCommands","orion/editor/editor","orion/editor/editorFeatures","orion/globalCommands","orion/breadcrumbs","orion/compare/gap-model","orion/commands","orion/textview/textModel","orion/textview/textView","orion/compare/compareUtils","orion/compare/diff-provider","orion/compare/jsdiffAdapter",
"orion/highlight"],function(f,e,a,c,d,g,h,i,j,k,m,n,p,r,w,s,u,t,y,B){var D={};D.CompareContainer=function(){function l(){this._diffParser=new a.DiffParser}l.prototype={_clearOptions:function(){this._complexURL=this._diffProvider=this._hasConflicts=this._readonly=undefined;this._baseFile={URL:"",Name:"",Type:""};this._newFile={URL:"",Name:"",Type:""};this._onSetTitle=this._onSave=this._diffContent=this._diffURL=undefined},setOptions:function(o,q){q&&this._clearOptions();if(o){this._mapper=o.mapper?
o.mapper:this._mapper;this._readonly=o.readonly!==undefined||o.readonly!==null?o.readonly:this._readonly;this._hasConflicts=o.hasConflicts!==undefined||o.hasConflicts!==null?o.hasConflicts:this._hasConflicts;this._diffProvider=o.diffProvider?o.diffProvider:this._diffProvider;this._complexURL=o.complexURL?o.complexURL:this._complexURL;this._baseFile.URL=o.baseFileURL?o.baseFileURL:this._baseFile.URL;this._baseFile.Name=o.baseFileName?o.baseFileName:this._baseFile.Name;this._baseFile.Type=o.baseFileType?
o.baseFileType:this._baseFile.Type;this._baseFile.Content=o.baseFileContent?o.baseFileContent:this._baseFile.Content;this._newFile.URL=o.newFileURL?o.newFileURL:this._newFile.URL;this._newFile.Name=o.newFileName?o.newFileName:this._newFile.Name;this._newFile.Type=o.newFileType?o.newFileType:this._newFile.Type;this._newFile.Content=o.newFileContent?o.newFileContent:this._newFile.Content;this._diffURL=o.diffURL?o.diffURL:this._diffURL;this._diffContent=o.diffContent?o.diffContent:this._diffContent;
this._onSave=o.onSave?o.onSave:this._onSave;this._callback=o.callback?o.callback:this._callback;this._errorCallback=o.errorCallback?o.errorCallback:this._errorCallback;this._onSetTitle=o.onSetTitle?o.onSetTitle:this._onSetTitle}},clearContent:function(){if(this._baseFile)this._baseFile.Content=null;if(this._newFile)this._newFile.Content=null},_getLineDelim:function(){return"\n"},resolveComplexDiff:function(o){if(this._diffProvider){var q=this;q._diffProvider.provide(q._complexURL,o,q._hasConflicts,
function(v){q._baseFile.URL=v.baseFile&&typeof v.baseFile.URL==="string"?v.baseFile.URL:q._baseFile.URL;q._baseFile.Name=v.baseFile&&typeof v.baseFile.Name==="string"?v.baseFile.Name:q._baseFile.Name;q._baseFile.Type=v.baseFile&&typeof v.baseFile.Type==="object"?v.baseFile.Type:q._baseFile.Type;q._baseFile.Content=v.baseFile&&typeof v.baseFile.Content==="string"?v.baseFile.Content:q._baseFile.Content;q._newFile.URL=v.newFile&&typeof v.newFile.URL==="string"?v.newFile.URL:q._newFile.URL;q._newFile.Name=
v.newFile&&typeof v.newFile.Name==="string"?v.newFile.Name:q._newFile.Name;q._newFile.Type=v.newFile&&typeof v.newFile.Type==="object"?v.newFile.Type:q._newFile.Type;q._newFile.Content=v.newFile&&typeof v.newFile.Content==="string"?v.newFile.Content:q._newFile.Content;q._diffContent=typeof v.diff==="string"?v.diff:q._diffContent;if(o||typeof q._baseFile.Content==="string")q.setEditor(o);else{q._callback&&q._callback(q._baseFile.Name,q._newFile.Name);q.getFileContent([q._baseFile],0)}},q._errorCallback)}else console.log("A diff provider is needed for Complex diff URL")},
resolveDiffByContents:function(o){if(typeof this._baseFile.Content==="string"&&typeof this._newFile.Content==="string"){if(!this._diffContent&&!this._mapper)this._diffContent="";this.setEditor(o);return true}else return false},getFileContent:function(o,q){if(this._fileClient){var v=this;v._fileClient.read(o[q].URL).then(function(x){o[q].Content=x;q<o.length-1?v.getFileContent(o,q+1):v.setEditor()},function(x,z){if(x.status===404){o[q].Content="";q<o.length-1?v.getFileContent(o,q+1):v.setEditor()}else v.errorCallback&&
v.errorCallback(x,z)})}else console.log("A file client is needed for getting file content")},parseMapper:function(o,q,v,x,z){var C=this._getLineDelim(o,v);if(this._mapper)return{delim:C,mapper:this._mapper,output:q,diffArray:q};if(q){o=(new y.JSDiffAdapter).adapt(o,q);return{delim:C,mapper:o.mapper,output:q,diffArray:o.changContents}}else{this._diffParser.setLineDelim(C);q=this._diffParser.parse(o,v,x,z);o=this._diffParser.getDiffArray();return{delim:C,mapper:q.mapper,output:q.outPutFile,diffArray:o}}},
startup:function(o){this._complexURL?this.resolveComplexDiff(o):this.resolveDiffByContents(o)}};return l}();D.DefaultDiffProvider=function(){function l(o){this.serviceRegistry=o;this._diffProvider=new t.DiffProvider(o)}l.prototype={_resolveComplexDiff:function(o,q,v){if(this._diffProvider){var x=this;x._diffProvider.getDiffContent(o).then(function(z){x._diffContent=x._hasConflicts?z.split("diff --git")[1]:z;q?x.callBack({diff:x._diffContent}):x._resolveComplexFileURL(o)},v)}else console.log("A diff provider is needed for compound diff URL")},
_resolveFileName:function(o){return o.split("?")[0]},_getContentType:function(o){o=this._resolveFileName(o);return this.serviceRegistry.getService("orion.file.contenttypes").getFilenameContentType(o)},_resolveComplexFileURL:function(o,q){var v=this;this._diffProvider.getDiffFileURI(o).then(function(x){(new e.DeferredList([v._getContentType(x.Old),v._getContentType(x.New)])).then(function(z){var C=z[0][1];z=z[1][1];v.callBack({baseFile:{URL:x.Old,Name:v._resolveFileName(x.Old),Type:C},newFile:{URL:x.New,
Name:v._resolveFileName(x.New),Type:z},diff:v._diffContent})},q)},q)},provide:function(o,q,v,x,z){this.callBack=x;this._hasConflicts=v;this._resolveComplexDiff(o,q,z)}};return l}();D.DiffStyler=function(){function l(o,q){this._compareMatchRenderer=o;this._textView=q}l.prototype={highlight:function(o){this._textView&&this._textView.removeEventListener("LineStyle",this._lineStyleListener);if(o)this._textView=o;if(this._textView&&!this._textView.getModel().isMapperEmpty())this._textView.addEventListener("LineStyle",
this._lineStyleListener=e.hitch(this,this._onLineStyle))},_onLineStyle:function(o){var q=this._textView,v=o.lineIndex,x=q.getModel().getLineType(v);v=x.type;var z=u.getAnnotationIndexByMapper(q.getModel().getAnnotations(),x.mapperIndex).current;q=u.isMapperConflict(q.getModel().getMapper(),x.mapperIndex);z=z===this._compareMatchRenderer.getCurrentAnnotationIndex();if(v==="top-only"){v=z?"url('"+f.toUrl("images/diff-border-sel.png")+"')":"url('"+f.toUrl("images/diff-border.png")+"')";o.style={style:{backgroundImage:v,
backgroundRepeat:"repeat-x"}}}else if(v!=="unchanged")o.style={styleClass:z?q?"diffConflictSelect":"diffNormalSelect":q?"diffConflict":"diffNormal"}}};return l}();D.TwoWayCompareStyler=function(){function l(o,q){this._syntaxHighlither=new B.SyntaxHighlighter(o);this._diffHighlither=new D.DiffStyler(q)}l.prototype={highlight:function(o,q,v){var x=this;this._syntaxHighlither.setup(q,v,null,o).then(function(){x._diffHighlither.highlight(v)})}};return l}();D.TwoWayCompareContainer=function(){function l(o,
q,v){this._registry=o;this._commandService=this._registry.getService("orion.page.command");this._fileClient=this._registry.getService("orion.core.file");this._uiFactory=q;this._viewLoadedCounter=0;this.setOptions(v,true);var x=this;if(!this._callback)this._callback=function(z,C){if(x._uiFactory.getTitleDivId(true)&&x._uiFactory.getTitleDivId(false)){e.place(document.createTextNode(C),x._uiFactory.getTitleDivId(true),"only");e.place(document.createTextNode(z),x._uiFactory.getTitleDivId(false),"only")}};
if(!this._errorCallback)this._errorCallback=function(z,C){if(x._uiFactory.getTitleDivId(true)&&x._uiFactory.getTitleDivId(false)){z=typeof z.message==="string"?z.message:C.xhr.statusText;e.place(document.createTextNode(z),x._uiFactory.getTitleDivId(true),"only");e.place(document.createTextNode(z),x._uiFactory.getTitleDivId(false),"only");e.style(q.getTitleDivId(true),"color","red");e.style(q.getTitleDivId(false),"color","red")}};this._leftEditorDivId=this._uiFactory.getEditorParentDivId(true);this._rightEditorDivId=
this._uiFactory.getEditorParentDivId(false);this.initCommands();x=this;this._inputManager={filePath:"",getInput:function(){return this.filePath},setDirty:function(z){if(z)this._lastTitle&&this._lastTitle.charAt(0)!=="*"&&this.setTitle("*"+this._lastTitle);else this._lastTitle&&this._lastTitle.charAt(0)==="*"&&this.setTitle(this._lastTitle.substring(1))},getFileMetadata:function(){return this._fileMetadata},setInput:function(z){this.onSetTitle?this.onSetTitle(z,e.hitch(this,function(C){this.setTitle(C)}),
e.hitch(this,function(C){console.error("Error loading file metadata: "+C.message);this.setTitle(z)})):x._fileClient.read(z,true).then(e.hitch(this,function(C){this._fileMetadata=C;this.setTitle(C.Location)}),e.hitch(this,function(C){console.error("Error loading file metadata: "+C.message);this.setTitle(z)}));this.lastFilePath=z},setTitle:function(z){var C=z.lastIndexOf("/"),A=z;if(C!==-1){A="Compare "+A.substring(C+1);if(z.charAt(0)==="*")A="*"+A}this._lastTitle=A;window.document.title=A;if((C=e.byId("location"))&&
this._fileMetadata){e.empty(C);new n.BreadCrumbs({container:"location",resource:this._fileMetadata});if(z.charAt(0)==="*")e.create("b",null,C,"last").innerHTML="*"}},afterSave:function(){x.startup(true)}};if(this._onSave)this._inputManager.onSave=this._onSave;if(this._onSetTitle)this._inputManager.onSetTitle=this._onSetTitle;this._compareMatchRenderer=new c.CompareMatchRenderer(document.getElementById(this._uiFactory.getDiffCanvasDivId()));this._highlighter=[];this._highlighter.push(new D.TwoWayCompareStyler(this._registry,
this._compareMatchRenderer));this._highlighter.push(new D.TwoWayCompareStyler(this._registry,this._compareMatchRenderer));this.initEditorContainers("\n","fetching...","fetching...",[])}l.prototype=new D.CompareContainer;l.prototype.initEditorContainers=function(o,q,v,x,z){this._editorLeft=this.createEditorContainer(q,o,x,0,this._leftEditorDivId,this._uiFactory.getStatusDivId(true),this._readonly,z,this._newFile);m.generateDomCommandsInBanner(this._commandService,this._editorLeft,null,null,null,true);
this._textViewLeft=this._editorLeft.getTextView();this._editorRight=this.createEditorContainer(v,o,x,1,this._rightEditorDivId,this._uiFactory.getStatusDivId(false),true,z,this._baseFile);this._textViewRight=this._editorRight.getTextView();var C=this;o=new c.TwoWayCompareOverviewRuler("right",{styleClass:"ruler_overview"},C._compareMatchRenderer.getAnnotation(),function(A){C._compareMatchRenderer.matchPositionFromAnnotation(A)});this._textViewRight.addRuler(o);this._compareMatchRenderer.setOverviewRuler(o);
C=this;window.onbeforeunload=function(){if(C._editorLeft.isDirty())return"There are unsaved changes."}};l.prototype.initCommands=function(){var o=this._uiFactory.getCommandSpanId();if(o){var q=this,v=new r.Command({tooltip:"Go to next diff",imageClass:"core-sprite-move_down",id:"orion.compare.nextDiff",groupId:"orion.compareGroup",callback:function(){q.nextDiff()}}),x=new r.Command({tooltip:"Go to previous diff",imageClass:"core-sprite-move_up",id:"orion.compare.prevDiff",groupId:"orion.compareGroup",
callback:function(){q.prevDiff()}}),z=new r.Command({tooltip:"Copy current change from right to left",imageClass:"core-sprite-leftarrow",id:"orion.compare.copyToLeft",groupId:"orion.compareGroup",callback:function(){q.copyToLeft()}});this._commandService.addCommand(x,"dom");this._commandService.addCommand(v,"dom");this._commandService.addCommand(z,"dom");this._commandService.registerCommandContribution("orion.compare.prevDiff",3,o);this._commandService.registerCommandContribution("orion.compare.nextDiff",
2,o);this._readonly||this._commandService.registerCommandContribution("orion.compare.copyToLeft",1,o);this._commandService.renderCommands(o,"dom",q,q,"button")}};l.prototype.gotoMatch=function(o,q,v,x,z,C){if(!this.onScroll)this.onScroll=z;if(!this.onLoad)this.onLoad=C;z=this._textViewRight.getModel().getLineStart(o)+q.startIndex;this._editorRight.moveSelection(z,z+(q.length?q.length:x));o=this._textViewLeft.getModel().getLineStart(o)+v.startIndex;this._editorLeft.moveSelection(o,o+(v.length?v.length:
x))};l.prototype.nextDiff=function(){this._compareMatchRenderer.nextDiff()};l.prototype.prevDiff=function(){this._compareMatchRenderer.prevDiff()};l.prototype.copyToLeft=function(){this._compareMatchRenderer.copyToLeft()};l.prototype.createEditorContainer=function(o,q,v,x,z,C,A,F,H){var N=e.byId(z),I=this;o=new w.TextModel(o,q);var O=new g.TwoWayCompareModel(o,{mapper:v,columnIndex:x}),M="";v=A?new k.UndoFactory:new i.UndoCommandFactory(I._registry,I._commandService,"pageActions");var Q=new j.Editor({textViewFactory:function(){var G=
new s.TextView({parent:N,model:O,readonly:A,stylesheet:[f.toUrl("orion/compare/editor.css"),f.toUrl("css/default-theme.css")],tabSize:4});G.addEventListener("Load",function(){I._viewLoadedCounter++;I._viewLoadedCounter===2&&I._compareMatchRenderer.matchPositionFromAnnotation(-1);I.onLoad&&I.onLoad()});return G},undoStackFactory:v,contentAssistFactory:function(G){return new h.ContentAssist(G,"contentassist")},keyBindingFactory:function(G,K,R,U){if(!A){(new i.EditorCommandFactory(I._registry,I._commandService,
I._fileClient,I._inputManager,"pageActions")).generateEditorCommands(G);var V=new k.TextActions(G,R);K.push(V);G=new k.SourceCodeActions(G,R,U);K.push(G)}},statusReporter:function(G,K){if(C){M=K?"ERROR: "+G:G;e.byId(C).innerHTML=""+M}},domNode:N});Q.installTextView();if(!A){var T=this._inputManager;Q.addEventListener("DirtyChanged",function(){T.setDirty(Q.isDirty())})}var E=Q.getTextView();if(F&&H&&typeof H.Name==="string"&&typeof H.Type==="string"){Q.setInput(H.Name);this._highlighter[x].highlight(H.Name,
H.Type,Q)}E.addRuler(new c.LineNumberCompareRuler(0,"left",{styleClass:"ruler_lines"},{styleClass:"ruler_lines_odd"},{styleClass:"ruler_lines_even"}));E.addEventListener("Selection",function(){var G=E.getModel().getLineAtOffset(E.getCaretOffset());G=u.lookUpMapper(E.getModel().getMapper(),x,G).mapperIndex;G=u.getAnnotationIndexByMapper(E.getModel().getAnnotations(),G);G.current!==-1&&I._compareMatchRenderer.gotoDiff(G.current)});if(x===0){E.getModel().addEventListener("Changed",function(G){I._compareMatchRenderer.onChanged(G)});
E.addEventListener("Scroll",function(){if(I._compareMatchRenderer){I._compareMatchRenderer.matchPositionFrom(true);I._compareMatchRenderer.render()}I.onScroll&&I.onScroll()})}else E.addEventListener("Scroll",function(){I._compareMatchRenderer&&I._compareMatchRenderer.render()});return Q};l.prototype.setEditor=function(o){var q=this._baseFile.Content,v=this._newFile.Content,x=this._diffContent;if(v)x=this.parseMapper(q,v,x,this._hasConflicts,true);else{x=this.parseMapper(q,v,x,this._hasConflicts,o);
v=x.output}this._compareMatchRenderer.init(x.mapper,this._textViewLeft,this._textViewRight);if(this._editorLeft)if(o){this._textViewLeft.getModel().init(x.mapper);this._textViewRight.getModel().init(x.mapper);this._textViewLeft.redrawRange();this._textViewRight.redrawRange()}else{this._inputManager.filePath=this._newFile.URL;this._textViewLeft.getModel().init(x.mapper);this._textViewRight.getModel().init(x.mapper);this._editorRight.setInput(this._baseFile.Name,null,q);this._highlighter[1].highlight(this._baseFile.Name,
this._baseFile.Type,this._textViewRight);this._editorLeft.setInput(this._newFile.Name,null,v);this._highlighter[0].highlight(this._newFile.Name,this._newFile.Type,this._textViewLeft);this._readonly||this._inputManager.setInput(this._newFile.URL,this._editorLeft)}else this.initEditorContainers(x.delim,v,q,x.mapper,true);this._viewLoadedCounter>1&&this._compareMatchRenderer.matchPositionFromAnnotation(-1)};return l}();D.InlineCompareContainer=function(){function l(o,q,v){this._registry=o;this._commandService=
this._registry.getService("orion.page.command");this._fileClient=this._registry.getService("orion.core.file");this._statusService=this._registry.getService("orion.page.message");this.setOptions(v,true);var x=this;if(!this._callback)this._callback=function(){e.place(document.createTextNode(x._diffTitle),"fileNameInViewer","only");e.style("fileNameInViewer","color","#6d6d6d");x._statusService.setProgressMessage("");e.empty("compare_rightContainerCommands");x._commandService.renderCommands("compare_rightContainerCommands",
"dom",x,x,"button")};if(!this._errorCallback)this._errorCallback=function(z,C){var A=[];A.Severity="Error";A.HTML=false;try{var F=JSON.parse(z.responseText);A.Message=F.DetailedMessage?F.DetailedMessage:F.Message}catch(H){A.Message=typeof z.message==="string"?z.message:C.xhr.statusText}this._statusService.setProgressResult(A);e.empty("compare_rightContainerCommands")};this._annotation=new c.CompareAnnotation;this._editorDivId=q;this.initEditorContainers("","\n",[],[]);this.hasContent=false}l.prototype=
new D.CompareContainer;l.prototype.addRulers=function(){if(this._textView&&!this._hasRuler){this._textView.addRuler(this._rulerOrigin);this._textView.addRuler(this._rulerNew);this._textView.addRuler(this._overview);this._hasRuler=true}};l.prototype.removeRulers=function(){if(this._textView&&this._hasRuler){this._textView.removeRuler(this._rulerOrigin);this._textView.removeRuler(this._rulerNew);this._textView.removeRuler(this._overview);this._hasRuler=false}};l.prototype.destroyEditor=function(){if(this._textView){this._textView.getModel().init([],
[]);this._textView.setText("");this.removeRulers()}this.hasContent=false};l.prototype.createEditorContainer=function(o,q,v,x,z,C){var A=e.byId(this._editorDivId),F=this;o=new w.TextModel(o,q);var H=new d.CompareTextModel(o,{mapper:v,columnIndex:0},new d.DiffLineFeeder(x,q));q=new k.UndoFactory;q=new j.Editor({textViewFactory:function(){return new s.TextView({parent:A,model:H,readonly:true,stylesheet:f.toUrl("orion/compare/editor.css"),tabSize:4})},undoStackFactory:q,keyBindingFactory:function(){},
statusReporter:function(){},domNode:A});q.installTextView();z&&C&&q.setInput(C.Name);var N=q.getTextView();this._rulerOrigin=new c.LineNumberCompareRuler(1,"left",{styleClass:"ruler_lines"},{styleClass:"ruler_lines_odd"},{styleClass:"ruler_lines_even"});this._rulerNew=new c.LineNumberCompareRuler(0,"left",{styleClass:"ruler_lines"},{styleClass:"ruler_lines_odd"},{styleClass:"ruler_lines_even"});F=this;this._overview=new c.TwoWayCompareOverviewRuler("right",{styleClass:"ruler_overview"},F._annotation,
function(I){F._annotation.matchPositionFromAnnotation(I);F.positionAnnotation(I)});N.addEventListener("LineStyle",function(I){F._onLineStyle(I)});N.addEventListener("Selection",function(){var I=N.getModel().getLineAtOffset(N.getCaretOffset());I=N.getModel().getLineType(I).mapperIndex;I=u.getAnnotationIndexByMapper(N.getModel().getAnnotations(),I);if(I.current!==-1){F._annotation.gotoDiff(I.current);I=N.getTopIndex();N.redrawRange();N.redrawLines(I,I+1,F._overview)}});return q};l.prototype.initEditorContainers=
function(o,q,v,x){this._editor=this.createEditorContainer(q,o,v,x,this._newFile);this._textView=this._editor.getTextView()};l.prototype._onLineStyle=function(o){var q=o.lineIndex,v=this._textView.getModel().getLineType(q);q=v.type;v=u.getAnnotationIndexByMapper(this._textView.getModel().getAnnotations(),v.mapperIndex).current;if(q==="added")o.style=v===this._annotation.getCurrentAnnotationIndex()?{styleClass:"diffInlineAddedSelect"}:{styleClass:"diffInlineAdded"};else if(q==="removed")o.style=v===
this._annotation.getCurrentAnnotationIndex()?{styleClass:"diffInlineRemovedSelect"}:{styleClass:"diffInlineRemoved"}};l.prototype._initDiffPosition=function(o){var q=o.getModel();if(q&&q.getAnnotations){q=q.getAnnotations();if(q.length>0){q=q[0][0];var v=o.getLineHeight(),x=o.getClientArea();v=Math.floor(x.height/v/3);o.setTopIndex(q-v>0?q-v:0)}}};l.prototype.setDiffTitle=function(o){this._diffTitle=o};l.prototype.setEditor=function(){var o=this._baseFile.Content,q=this._newFile.Content,v=this._diffContent;
this.hasContent=true;q=this.parseMapper(o,q,v,false,q);if(this._textView){this.addRulers();this._textView.getModel().init([],[]);this._textView.setText("");this._textView.getModel().init(q.mapper,q.diffArray);if(o==="")o=" ";this._textView.setText(o);this._annotation.init(q.mapper,this._textView)}else this.initEditorContainers(q.delim,o,q.mapper,q.diffArray,true);this._initDiffPosition(this._textView)};l.prototype.nextDiff=function(){this._annotation.nextDiff();this.positionAnnotation(this._textView.getModel().getAnnotations()[this._annotation.getCurrentAnnotationIndex()][0])};
l.prototype.setConflicting=function(o){this._conflcit=o};l.prototype.prevDiff=function(){this._annotation.prevDiff();this.positionAnnotation(this._textView.getModel().getAnnotations()[this._annotation.getCurrentAnnotationIndex()][0])};l.prototype.positionAnnotation=function(o){if(this._textView){var q=this._textView.getLineHeight(),v=this._textView.getClientArea();q=Math.floor(v.height/q/3);this._textView.setTopIndex(o-q>0?o-q:0);this._textView.redrawRange();o=this._textView.getTopIndex();this._textView.redrawLines(o,
o+1,this._overview)}};return l}();return D});
define("orion/treetable",["dojo"],function(f){function e(a){this._init(a)}e.prototype={_init:function(a){var c=a.parent,d=this;if(typeof c==="string")c=f.byId(c);if(!c)throw"no parent";if(!a.model)throw"no tree model";if(!a.renderer)throw"no renderer";this._parent=c;this._treeModel=a.model;this._renderer=a.renderer;this._showRoot=a.showRoot===undefined?false:a.showRoot;this._indent=a.indent===undefined?16:a.indent;this._onCollapse=a.onCollapse;this._labelColumnIndex=a.labelColumnIndex===undefined?
0:a.labelColumnIndex;this._id=a.id===undefined?"treetable":a.id;this._tableStyle=a.tableStyle;this._root=this._treeModel.getRoot(function(g){if(this._showRoot){g._depth=0;this._generate([g],0)}else d._treeModel.getChildren(g,function(h){d._generate(h,0)})})},_generate:function(a,c){f.empty(this._parent);var d=document.createElement("table");d.id=this._id;this._tableStyle&&f.addClass(d,this._tableStyle);this._renderer.initTable(d,this);var g=document.createElement("tbody");g.id=this._id+"tbody";this._generateChildren(a,
c,g,"last");d.appendChild(g);this._parent.appendChild(d);this._rowsChanged()},_generateChildren:function(a,c,d,g){for(var h in a){var i=document.createElement("tr");i.id=this._treeModel.getId(a[h]);i._depth=c;i._item=a[h];this._renderer.render(a[h],i);f.style(i.childNodes[this._labelColumnIndex],"paddingLeft",this._indent*c+"px");f.place(i,d,g);if(g==="after")d=i}},_rowsChanged:function(){this._renderer.rowsChanged&&this._renderer.rowsChanged()},getSelected:function(){return this._renderer.getSelected()},
refresh:function(a,c,d,g,h,i){var j=this._treeModel.getId(a),k;if(j===this._id){this._removeChildRows(j);this._generateChildren(c,0,f.byId(j+"tbody"),"last");this._rowsChanged()}else{var m=f.byId(j);if(m){m._item=a;if(m&&(d||m._expanded)){m._expanded=true;this._removeChildRows(j);this._renderer.updateExpandVisuals(m,true);if(c){this._generateChildren(c,m._depth+1,m,"after");this._rowsChanged();if(g&&h){a=f.byId(g);f.addClass(a,h);i&&f.removeClass(a,i)}}else{k=this;c=this._treeModel.getChildren(m._item,
function(n){k._generateChildren(n,m._depth+1,m,"after");k._rowsChanged()})}}else this._renderer.updateExpandVisuals(m,false)}else console.log("could not find table row "+j)}},refreshAndExpand:function(a,c,d,g,h){this.refresh(a,c,true,d,g,h)},getItem:function(a){if(typeof a==="string"){var c=f.byId(a);if(c)return c._item}if(a._item)return a._item;return a},toggle:function(a,c,d,g){var h=f.byId(a);if(h)if(h._expanded){this.collapse(a);if(c){a=f.byId(c);f.addClass(a,g);f.removeClass(a,d)}}else{this.expand(a);
if(c){a=f.byId(c);f.addClass(a,d);f.removeClass(a,g)}}},isExpanded:function(a){if(a=f.byId(a))return a._expanded;return false},expand:function(a,c,d){a=typeof a==="string"?a:this._treeModel.getId(a);var g=f.byId(a);if(g)if(!g._expanded){g._expanded=true;var h=this;this._renderer.updateExpandVisuals(g,true);this._treeModel.getChildren(g._item,function(i){h._generateChildren(i,g._depth+1,g,"after");h._rowsChanged();c&&c.apply(this,d)})}},_removeChildRows:function(a){f.byId(this._id);var c=a===this._id,
d=false,g=-1,h=[];f.query(".treeTableRow").forEach(function(k){if(!d)if(c)if(k._depth>g)h.push(k);else d=true;else if(k.id===a){c=true;g=k._depth}});for(var i in h){var j=h[i];j.parentNode.removeChild(j)}},collapse:function(a){a=typeof a==="string"?a:this._treeModel.getId(a);var c=f.byId(a);if(c){if(!c._expanded)return;c._expanded=false;this._renderer.updateExpandVisuals(c,false);this._removeChildRows(a);this._rowsChanged()}this._onCollapse&&this._onCollapse(c._item)}};e.prototype.constructor=e;return{TableTree:e}});
define("orion/explorer",["require","dojo","orion/treetable"],function(f,e,a){var c={};c.Explorer=function(){function d(g,h,i){this.registry=g;this.renderer=i;this.selection=h;this.myTree=null}d.prototype={changedItem:function(g,h){e.hitch(this.myTree,this.myTree.refreshAndExpand)(g,h)},updateCommands:function(g){this.myTree&&e.hitch(this.myTree._renderer,this.myTree._renderer.updateCommands(g))},makeNewItemPlaceHolder:function(g,h,i){g=this.getRow(g);if(i){g=g.childNodes[i];e.place("<br><span id='"+
h+"placeHolderRow'></span>",g,"last");if(i=e.byId(h+"placeHolderRow"))return{tempNode:i,refNode:i}}if(g){e.place("<tr id='"+h+"placeHolderRow'><td id='"+h+"placeHolderCol'></td>",g,"after");i=e.byId(h+"placeHolderRow");g=e.byId(h+"placeHolderCol");if(i&&g)return{tempNode:i,refNode:g}}return null},getRow:function(g){if(g=this.model.getId(g))return e.byId(g)},createTree:function(g,h,i){var j=g+"innerTree",k=e.byId(j);k&&e.destroy(k);if(h)h.rootId=j;this.model=h;this.myTree=new a.TableTree({id:j,model:h,
showRoot:false,parent:g,labelColumnIndex:this.renderer.getLabelColumnIndex(),renderer:this.renderer,indent:i?i.indent:undefined,onCollapse:i?i.onCollapse:undefined,tableStyle:"mainPadding"});this.renderer._initializeUIState()},getRootPath:function(){if(this.model&&this.model.root)return this.model.root.Location;return null},_lastHash:null,checkbox:this.checkbox||true};return d}();c.ExplorerModel=function(){function d(g,h){this.rootPath=g;this.fetchItems=h}d.prototype={destroy:function(){},getRoot:function(g){this.fetchItems(this.rootPath).then(e.hitch(this,
function(h){this.root=h;g(h)}))},getChildren:function(g,h){if(g.Children)h(g.Children);else g.ChildrenLocation?this.fetchItems(g.ChildrenLocation).then(e.hitch(this,function(i){g.Children=i;h(i)})):h([])},getId:function(g){if(g.Location===this.root.Location)return this.rootId;g=g.Location.replace(/[\\\/]/g,"");for(var h="",i=0;i<g.length;i++)h+=g[i].match(/[^\.\:\-\_0-9A-Za-z]/g)?g.charCodeAt(i):g[i];return h}};return d}();c.ExplorerFlatModel=function(){function d(g,h,i){this.rootPath=g;this.fetchItems=
h;this.root=i}d.prototype=new c.ExplorerModel;d.prototype.getRoot=function(g){this.root?g(this.root):this.fetchItems(this.rootPath).then(e.hitch(this,function(h){this.root=h;g(h)}))};d.prototype.getChildren=function(g,h){g===this.root?h(this.root):h([])};return d}();c.ExplorerRenderer=function(){function d(g,h){this.explorer=h;this._init(g);this._expandImageClass="core-sprite-twistie_open";this._collapseImageClass="core-sprite-twistie_closed";this._twistieSpriteClass="modelDecorationSprite"}d.prototype=
{getLabelColumnIndex:function(){return this.explorer.checkbox?1:0},initTable:function(g,h){this.tableTree=h;e.empty(g);e.addClass(g,"treetable");this.renderTableHeader(g)},getActionsColumn:function(g,h,i,j){i=i||"tool";var k=this.explorer.registry.getService("orion.page.command"),m=document.createElement("td");m.id=h.id+"actionswrapper";j&&e.addClass(m,j);k.renderCommands(m,"object",g,this.explorer,i,false,null,"commandActiveItem","commandInactiveItem");return m},initCheckboxColumn:function(){if(this._useCheckboxSelection)return document.createElement("th")},
getCheckboxColumn:function(g,h){if(this._useCheckboxSelection){var i=document.createElement("td"),j=document.createElement("span");j.id=this.getCheckBoxId(h.id);e.addClass(j,"core-sprite-check selectionCheckmarkSprite");j.itemId=h.id;if(this.getCheckedFunc){j.checked=this.getCheckedFunc(g);this._highlightSelection&&e.toggleClass(h,"checkedRow",j.checked);e.toggleClass(j,"core-sprite-check_on",j.checked)}i.appendChild(j);e.connect(j,"onclick",e.hitch(this,function(k){this.onCheck(h,k.target,k.target.checked?
false:true,true)}));return i}},getCheckBoxId:function(g){return g+"selectedState"},onCheck:function(g,h,i,j){h.checked=i;this._highlightSelection&&g&&e.toggleClass(g,"checkedRow",i);e.toggleClass(h,"core-sprite-check_on",i);this.onCheckedFunc&&this.onCheckedFunc(h.itemId,i,j);this._storeSelections();this.explorer.selection&&this.explorer.selection.setSelections(this.getSelected())},_storeSelections:function(){var g=this.getSelectedIds(),h=this._getUIStatePreferencePath();if(h&&window.sessionStorage)window.sessionStorage[h+
"selection"]=JSON.stringify(g)},_restoreSelections:function(g){g=window.sessionStorage[g+"selection"];if(typeof g==="string")g=g.length>0?JSON.parse(g):null;var h;if(g)for(h=0;h<g.length;h++){var i=e.byId(g[h]);if(i){this._highlightSelection&&e.addClass(i,"checkedRow");if(i=e.byId(this.getCheckBoxId(i.id))){i.checked=true;e.addClass(i,"core-sprite-check_on")}}}g=this.getSelected();this.explorer.selection&&this.explorer.selection.setSelections(g)},_storeExpansions:function(g){window.sessionStorage[g+
"expanded"]=JSON.stringify(this._expanded)},_restoreExpansions:function(g){var h=false,i=window.sessionStorage[g+"expanded"];if(typeof i==="string")i=i.length>0?JSON.parse(i):null;var j;if(i)for(j=0;j<i.length;j++)if(e.byId(i[j])){this._expanded.push(i[j]);this.tableTree.expand(i[j],e.hitch(this,function(){this._restoreSelections(g)}));h=true}return!h},_getUIStatePreferencePath:function(){if(this.explorer){var g=this.explorer.getRootPath();if(this._cachePrefix&&g)return"/"+this._cachePrefix+"/"+g.replace(/[^\.\:\-\_0-9A-Za-z]/g,
"")+"/uiState"}return null},expandCollapseImageId:function(g){return g+"__expand"},updateExpandVisuals:function(g,h){if(g=e.byId(this.expandCollapseImageId(g.id))){e.addClass(g,h?this._expandImageClass:this._collapseImageClass);e.removeClass(g,h?this._collapseImageClass:this._expandImageClass)}},getExpandImage:function(g,h,i,j){var k=e.create("span",{id:this.expandCollapseImageId(g.id)},h,"last");e.addClass(k,this._twistieSpriteClass);e.addClass(k,this._collapseImageClass);if(i){h=e.create("span",
null,h,"last");e.addClass(h,j||"imageSprite");e.addClass(h,i)}k.onclick=e.hitch(this,function(){this.tableTree.toggle(g.id,this.expandCollapseImageId(g.id),this._expandImageClass,this._collapseImageClass);if(this.tableTree.isExpanded(g.id))this._expanded.push(g.id);else for(var m in this._expanded)if(this._expanded[m]===g.id){this._expanded.splice(m,1);break}(m=this._getUIStatePreferencePath())&&window.sessionStorage&&this._storeExpansions(m)});return k},render:function(g,h){h.cellSpacing="8px";this.renderRow(g,
h)},getSelected:function(){var g=[];e.query(".core-sprite-check_on").forEach(e.hitch(this,function(h){g.push(this.tableTree.getItem(h.parentNode.parentNode))}));return g},getSelectedIds:function(){var g=[];e.query(".core-sprite-check_on").forEach(e.hitch(this,function(h){g.push(h.parentNode.parentNode.id)}));return g},rowsChanged:function(){this._decorateAlternatingLines&&e.query(".treeTableRow").forEach(function(g,h){if(h%2){e.addClass(g,"darkTreeTableRow");e.removeClass(g,"lightTreeTableRow")}else{e.addClass(g,
"lightTreeTableRow");e.removeClass(g,"darkTreeTableRow")}});this.explorer.selection&&this.explorer.selection.setSelections(this.getSelected())},updateCommands:function(){var g=this.explorer.registry;e.query(".treeTableRow").forEach(function(h){var i=e.byId(h.id+"actionswrapper");e.empty(i);g.getService("orion.page.command").renderCommands(i,"object",h._item,this.explorer,"tool")})},_init:function(g){if(g){this._useCheckboxSelection=g.checkbox===undefined?false:g.checkbox;this._colums=g.colums||[];
this._cachePrefix=g.cachePrefix;this.getCheckedFunc=g.getCheckedFunc;this.onCheckedFunc=g.onCheckedFunc;this._highlightSelection=true;if(g.highlightSelection===false)this._highlightSelection=false;this._decorateAlternatingLines=true;if(g.decorateAlternatingLines===false)this._decorateAlternatingLines=false}},_initializeUIState:function(){this._expanded=[];var g=this._getUIStatePreferencePath();g&&window.sessionStorage&&this._restoreExpansions(g)&&this._restoreSelections(g)}};return d}();c.SelectionRenderer=
function(){function d(g,h){this._init(g);this.explorer=h}d.prototype=new c.ExplorerRenderer;d.prototype.renderTableHeader=function(g){var h=document.createElement("thead"),i=document.createElement("tr");e.addClass(h,"navTableHeading");this._useCheckboxSelection&&i.appendChild(this.initCheckboxColumn(g));for(var j=0,k=this.getCellHeaderElement(j);k;){k.innerHTML.length>0&&e.addClass(k,"navColumn");i.appendChild(k);k=this.getCellHeaderElement(++j)}h.appendChild(i);g.appendChild(h)};d.prototype.renderRow=
function(g,h){e.style(h,"verticalAlign","baseline");e.addClass(h,"treeTableRow");var i=this.getCheckboxColumn(g,h);if(i){e.addClass(i,"checkColumn");h.appendChild(i)}i=0;for(var j=this.getCellElement(i,g,h);j;){h.appendChild(j);e.addClass(j,"secondaryColumn");j=this.getCellElement(++i,g,h)}};d.prototype.getCellHeaderElement=function(){};d.prototype.getCellElement=function(){};return d}();return c});define("text!orion/git/widgets/templates/CloneGitRepositoryDialog.html",function(){return'<div class="dijitDialog" tabindex="-1" waiRole="dialog" waiState="labelledby-${id}_title">\n\t<div dojoAttachPoint="titleBar" class="dijitDialogTitleBar">\n\t\t<span dojoAttachPoint="titleNode" class="dijitDialogTitle" id="${id}_title"></span>\n\t\t<span dojoAttachPoint="closeButtonNode" class="dijitDialogCloseIcon" dojoAttachEvent="onclick: onCancel" title="${buttonCancel}">\n\t\t\t<span dojoAttachPoint="closeText" class="closeText" title="${buttonCancel}">x</span>\n\t\t</span>\n\t</div>\n\t<div dojoAttachPoint="containerNode" class="dijitDialogPaneContent">\n\t\t<!-- Actual content here --\>\n\t\t\t\t<span dojoAttachPoint="Basic">\n\t\t\t\t\t<div style="display: block; padding: 5; min-width: 120px; clear: both; float: left;">\n\t\t\t\t\t\t<label dojoAttachPoint="gitUrlLabel" for="${id}_gitUrl" style="padding-right: 10">${gitUrlLabelText}</label>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div style="display: block; padding: 5; width: 40em; text-align: right; float: right">\n\t\t\t\t\t\t<input dojoAttachPoint="gitUrl" id="${id}_gitUrl" style="display: inline-block; width: 100%;" value="">\n\t\t\t\t\t</div>\n\t\t\t\t\t<div style="display: block; padding: 5; clear: both; text-align: right;">\n\t\t\t\t\t\t<a dojoAttachPoint="advancedLink" href="javascript:">Choose target location</a>\n\t\t\t\t\t\t<a dojoAttachPoint="advancedLinkHide" href="javascript:" style="display: none">Default target location</a>\n\t\t\t\t\t</div>\n\t\t\t\t</span>\n\t\t\t\t<span dojoAttachPoint="Advanced" style="display: none;">\n\t\t\t\t\t<div style="display: block; padding: 5; min-width: 120px; clear: both; float: left;">\n\t\t\t\t\t\t<input dojoAttachPoint="isNewProject" type="radio" name="${id}_newExisting" checked value="new"/>\n\t\t\t\t\t\t<label dojoAttachPoint="gitNameLabel" for="${id}_gitName" style="padding-right: 10">${gitNameLabelText}</label>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div style="display: block; padding: 5; width: 40em; text-align: right; float: right">\n\t\t\t\t\t\t<input dojoAttachPoint="gitName" id="${id}_gitName" style="display: inline-block; width: 100%;" value="">\n\t\t\t\t\t</div>\n\t\t\t\t\t\n\t\t\t\t\t<div style="display: block; padding: 5; min-width: 120px; clear: both; float: left;">\n\t\t\t\t\t\t<input dojoAttachPoint="isExistingProject" type="radio" name="${id}_newExisting" value="existing"/>\n\t\t\t\t\t\t<label dojoAttachPoint="gitPathLabel" for="${id}_gitPath" style="padding-right: 10">${gitPathLabelText}</label>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div style="display: block; padding: 5; width: 40em; text-align: left; float: right;">\n\t\t\t\t\t\t\t<input dojoAttachPoint="gitPath" id="${id}_gitPath" type="hidden" value="">\n\t\t\t\t\t\t\t<div style="width: 30em; float: left" float="left" dojoAttachPoint="shownGitPath"></div>\n\t\t\t\t\t\t\t<div style="width: 10em; float: right; text-align: right"><a dojoAttachPoint="changeGitPath" href="javascript:">Change...</a></div>\n\t\t\t\t\t</div>\n\t\t\t\t</span>\n\t\t\t\t<div style="display: block; padding: 5; clear: both; text-align: right">\n\t\t\t\t\t<button dojoAttachPoint="cloneItemButton" dojoType="dijit.form.Button" type="submit" value="OK" style="padding: 20 0 10 0;">OK\n\t\t\t\t\t</button>\n\t\t\t\t</div>\n\t</div>\n</div>'});
define("orion/git/widgets/CloneGitRepositoryDialog",["require","dojo","dijit","dijit/Dialog","orion/widgets/_OrionDialogMixin","orion/widgets/DirectoryPrompterDialog","text!orion/git/widgets/templates/CloneGitRepositoryDialog.html"],function(f,e,a){e.declare("orion.git.widgets.CloneGitRepositoryDialog",[a.Dialog,orion.widgets._OrionDialogMixin],{widgetsInTemplate:true,templateString:e.cache("orion","git/widgets/templates/CloneGitRepositoryDialog.html"),constructor:function(){this.inherited(arguments);
this.options=arguments[0]||{}},postMixInProperties:function(){this.inherited(arguments);this.title=this.options.title?this.options.title:"Clone Git Repository";this.gitUrlLabelText="Repository URL:";this.gitPathLabelText="Existing directory:";this.gitNameLabelText="New folder:";this.advancedShown=false},postCreate:function(){var c=this;this.inherited(arguments);if(this.options.url)this.gitUrl.value=this.options.url;if(this.options.advancedOnly){this.Basic.style.display="none";this.Advanced.style.display=
"";setTimeout(function(){c.gitName.focus()},400)}e.connect(this.changeGitPath,"onclick",null,e.hitch(this,this.openDirectoryPickerDialog));e.connect(this.isExistingProject,"onchange",null,e.hitch(this,this.showExistingFolder));e.connect(this.gitName,"onfocus",null,e.hitch(this,this.showNewProject));e.connect(this.advancedLink,"onclick",null,e.hitch(this,this.showAdvanced));e.connect(this.advancedLinkHide,"onclick",null,e.hitch(this,this.hideAdvanced));this.options.alwaysShowAdvanced&&this.showAdvanced()},
execute:function(){if(this.options.func)this.options.func(this.options.advancedOnly?undefined:this.gitUrl.value,this.advancedShown&&this.isNewProject.checked?undefined:this.gitPath.value,this.advancedShown&&!this.isNewProject.checked?undefined:this.gitName.value);delete this.options.func},showAdvanced:function(){this.advancedShown=true;this.Advanced.style.display="";this.advancedLink.style.display="none";this.advancedLinkHide.style.display=""},hideAdvanced:function(){this.advancedShown=false;this.Advanced.style.display=
"none";this.advancedLink.style.display="";this.advancedLinkHide.style.display="none"},showExistingFolder:function(){this.isExistingProject.checked?this.openDirectoryPickerDialog():this.gitName.focus()},showNewProject:function(){this.isNewProject.checked=true},openDirectoryPickerDialog:function(){this.isExistingProject.checked=true;var c=new orion.widgets.DirectoryPrompterDialog({title:"Choose a Folder",serviceRegistry:this.options.serviceRegistry,fileClient:this.options.fileClient,func:e.hitch(this,
function(d){if(d&&d.Location){this.gitPath.value=d.Location;this.shownGitPath.innerHTML="<a href='"+f.toUrl("navigate/table.html")+"#"+d.ChildrenLocation+"'>"+d.Name+"</a>";for(d=d;d.parent&&!d.parent.Projects;){this.shownGitPath.innerHTML="<a href='"+f.toUrl("navigate/table.html")+"#"+d.parent.ChildrenLocation+"'>"+d.parent.Name+"</a>/"+this.shownGitPath.innerHTML;d=d.parent}}})});c.startup();c.show()}})});define("text!orion/git/widgets/templates/InitGitRepositoryDialog.html",function(){return'<div class="dijitDialog" tabindex="-1" waiRole="dialog" waiState="labelledby-${id}_title">\n\t<div dojoAttachPoint="titleBar" class="dijitDialogTitleBar">\n\t\t<span dojoAttachPoint="titleNode" class="dijitDialogTitle" id="${id}_title"></span>\n\t\t<span dojoAttachPoint="closeButtonNode" class="dijitDialogCloseIcon" dojoAttachEvent="onclick: onCancel" title="${buttonCancel}">\n\t\t\t<span dojoAttachPoint="closeText" class="closeText" title="${buttonCancel}">x</span>\n\t\t</span>\n\t</div>\n\t<div dojoAttachPoint="containerNode" class="dijitDialogPaneContent">\n\t\t<!-- Actual content here --\>\n\t\t<div style="display: table">\n\t\t\t<div style="display: table-row">\n\t\t\t\t<div style="display: table-cell; padding: 5">\n\t\t\t\t\t<label dojoAttachPoint="gitTargetLabel" for="${id}_gitTarget" style="padding-right: 10">${gitTargetLabelText}</label>\n\t\t\t\t</div>\n\t\t\t\t<div style="display: table-cell; padding: 5; width: 40em; text-align: left;">\n\t\t\t\t\t<input dojoAttachPoint="gitTarget" id="${id}_gitTarget" style="display: inline-block; width: 98%;" value="">\n\t\t\t\t\t<br><i>This is to be replaced with directory picker dialog</i>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div style="display: table-row">\n\t\t\t\t<div style="display: table-cell; padding: 5"></div>\n\t\t\t\t<div style="display: table-cell; padding: 5">\n\t\t\t\t\t<button dojoAttachPoint="cloneItemButton" dojoType="dijit.form.Button" type="submit" value="OK" style="padding: 20 0 10 0; float: right; clear: both;">OK\n\t\t\t\t\t</button>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</div>'});
define("orion/git/widgets/InitGitRepositoryDialog",["dojo","dijit","dijit/Dialog","orion/widgets/_OrionDialogMixin","text!orion/git/widgets/templates/InitGitRepositoryDialog.html"],function(f,e){f.declare("orion.git.widgets.InitGitRepositoryDialog",[e.Dialog,orion.widgets._OrionDialogMixin],{widgetsInTemplate:true,templateString:f.cache("orion","git/widgets/templates/InitGitRepositoryDialog.html"),constructor:function(){this.inherited(arguments);this.options=arguments[0]||{}},postMixInProperties:function(){this.inherited(arguments);
this.title="Init Git Repository";this.gitTargetLabelText="Target:"},execute:function(){this.options.func&&this.options.func(this.gitTarget.value);delete this.options.func}})});define("text!orion/git/widgets/templates/AddRemoteDialog.html",function(){return'<div class="dijitDialog" tabindex="-1" waiRole="dialog" waiState="labelledby-${id}_title">\n\t<div dojoAttachPoint="titleBar" class="dijitDialogTitleBar">\n\t\t<span dojoAttachPoint="titleNode" class="dijitDialogTitle" id="${id}_title"></span>\n\t\t<span dojoAttachPoint="closeButtonNode" class="dijitDialogCloseIcon" dojoAttachEvent="onclick: onCancel" title="${buttonCancel}">\n\t\t\t<span dojoAttachPoint="closeText" class="closeText" title="${buttonCancel}">x</span>\n\t\t</span>\n\t</div>\n\t<div dojoAttachPoint="containerNode" class="dijitDialogPaneContent">\n\t\t<!-- Actual content here --\>\n\t\t<div style="display: table">\n\t\t\t<div style="display: table-row">\n\t\t\t\t<div style="display: table-cell; padding: 5">\n\t\t\t\t\t<label dojoAttachPoint="gitRemoteLabel" for="${id}_gitRemote" style="padding-right: 10">${gitRemoteLabelText}</label>\n\t\t\t\t</div>\n\t\t\t\t<div style="display: table-cell; padding: 5; width: 40em; text-align: left;">\n\t\t\t\t\t<input dojoAttachPoint="gitRemote" id="${id}_gitRemote" style="display: inline-block; width: 98%;" value="">\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div style="display: table-row">\n\t\t\t\t<div style="display: table-cell; padding: 5">\n\t\t\t\t\t<label dojoAttachPoint="gitRemoteURILabel" for="${id}_gitRemoteURI" style="padding-right: 10">${gitRemoteURILabelText}</label>\n\t\t\t\t</div>\n\t\t\t\t<div style="display: table-cell; padding: 5; width: 40em; text-align: left;">\n\t\t\t\t\t<input dojoAttachPoint="gitRemoteURI" id="${id}_gitRemoteURI" style="display: inline-block; width: 98%;" value="">\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div style="display: table-row">\n\t\t\t\t<div style="display: table-cell; padding: 5"></div>\n\t\t\t\t<div style="display: table-cell; padding: 5">\n\t\t\t\t\t<button dojoAttachPoint="cloneItemButton" dojoType="dijit.form.Button" type="submit" value="OK" style="padding: 20 0 10 0; float: right; clear: both;">OK\n\t\t\t\t\t</button>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</div>'});
define("orion/git/widgets/AddRemoteDialog",["dojo","dijit","dijit/Dialog","orion/widgets/_OrionDialogMixin","text!orion/git/widgets/templates/AddRemoteDialog.html"],function(f,e){f.declare("orion.git.widgets.AddRemoteDialog",[e.Dialog,orion.widgets._OrionDialogMixin],{widgetsInTemplate:true,templateString:f.cache("orion","git/widgets/templates/AddRemoteDialog.html"),constructor:function(){this.inherited(arguments);this.options=arguments[0]||{}},postMixInProperties:function(){this.inherited(arguments);
this.title="Add Remote";this.gitRemoteLabelText="Remote Name:";this.gitRemoteURILabelText="Remote URI:"},execute:function(){this.options.func&&this.options.func(this.gitRemote.value,this.gitRemoteURI.value);delete this.options.func}})});define("text!orion/git/widgets/templates/GitCredentialsDialog.html",function(){return'<div class="dijitDialog" tabindex="-1" waiRole="dialog" waiState="labelledby-${id}_title">\n\t<div dojoAttachPoint="titleBar" class="dijitDialogTitleBar">\n\t\t<span dojoAttachPoint="titleNode" class="dijitDialogTitle" id="${id}_title"></span>\n\t\t<span dojoAttachPoint="closeButtonNode" class="dijitDialogCloseIcon" dojoAttachEvent="onclick: onCancel" title="${buttonCancel}">\n\t\t\t<span dojoAttachPoint="closeText" class="closeText" title="${buttonCancel}">x</span>\n\t\t</span>\n\t</div>\n\t<div dojoAttachPoint="containerNode" class="dijitDialogPaneContent">\n\t\t<!-- Actual content here --\>\n\t\t<div style="display: none; padding-top: 10px; padding-bottom: 10px;" dojoAttachPoint="gitCredentialsLabel">Provide credentials for: <b dojoAttachPoint="url"></b></div>\n\t\t<div style="display: table">\n\t\t\t<div style="display: table-row" dojoAttachPoint="gitSshUsernameRow">\n\t\t\t\t<div style="display: table-cell; padding: 5; vertical-align: top;">\n\t\t\t\t\t<label dojoAttachPoint="gitSshUsernameLabel" for="${id}_gitSshUsername" style="padding-right: 10">${gitSshUsernameLabelText}</label>\n\t\t\t\t</div>\n\t\t\t\t<div style="display: table-cell; padding: 5; width: 40em; text-align: left; vertical-align: top;">\n\t\t\t\t\t<input dojoAttachPoint="gitSshUsername" id="${id}_gitSshUsername" style="display: inline-block; width: 98%;" value="">\n\t\t\t\t</div>\n\t\t\t</div>\t\n\t\t\t<div style="display: table-row" dojoAttachPoint="gitSshPasswordRow">\n\t\t\t\t<div style="display: table-cell; padding: 5; vertical-align: top;">\n\t\t\t\t\t<input dojoAttachPoint="isSshPassword" type="radio" name="${id}_isSshPassword" checked value="password" style="width: 15px;"/>\n\t\t\t\t\t<label dojoAttachPoint="gitSshPasswordLabel" for="${id}_gitSshPassword" style="padding-right: 10">${gitSshPasswordLabelText}</label>\n\t\t\t\t</div>\n\t\t\t\t<div style="display: table-cell; padding: 5; width: 40em; text-align: left; vertical-align: top;">\n\t\t\t\t\t<input type="password" dojoAttachPoint="gitSshPassword" id="${id}_gitSshPassword" style="display: inline-block; width: 98%;" value="">\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div style="display: table-row" dojoAttachPoint="gitPrivateKeyRow">\n\t\t\t\t<div style="display: table-cell; padding: 5; vertical-align: top;">\n\t\t\t\t\t<input dojoAttachPoint="isPrivateKey" type="radio" name="${id}_isSshPassword" value="privateKey" style="width: 15px;"/>\n\t\t\t\t\t<label dojoAttachPoint="gitPrivateKeyLabel" for="${id}_gitPrivateKey" style="padding-right: 10">${gitPrivateKeyLabelText}</label>\n\t\t\t\t</div>\n\t\t\t\t<div style="display: table-cell; padding: 5; width: 40em; text-align: left; vertical-align: top;">\n\t\t\t\t\t<textarea dojoAttachPoint="gitPrivateKey" id="${id}_gitPrivateKey" style="display: inline-block; width: 98%;" value=""></textarea>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div style="display: table-row" dojoAttachPoint="gitPassphraseRow">\n\t\t\t\t<div style="display: table-cell; padding: 5; vertical-align: top;">\n\t\t\t\t\t&nbsp;\n\t\t\t\t</div>\n\t\t\t\t<div style="display: table-cell; padding: 5; width: 40em; text-align: left; vertical-align: top;">\n\t\t\t\t\t<label dojoAttachPoint="gitPassphraseLabel" for="${id}_gitPassphrase">${gitPassphraseLabelText}</label>\n\t\t\t\t</div>\n\n\t\t\t</div>\n\t\t\t<div style="display: table-row" dojoAttachPoint="gitPassphraseRow_1">\n\t\t\t\t<div style="display: table-cell; padding: 5; vertical-align: top;">\n\t\t\t\t\t&nbsp;\n\t\t\t\t</div>\n\t\t\t\t<div style="display: table-cell; padding: 5; width: 40em; text-align: left; vertical-align: top;">\n\t\t\t\t\t<input type="password" dojoAttachPoint="gitPassphrase" id="${id}_gitPassphrase" style="display: inline-block; width: 98%;" value="">\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div style="display: table-row">\n\t\t\t\t<div style="display: table-cell; padding: 5"></div>\n\t\t\t\t<div style="display: table-cell; padding: 5">\n\t\t\t\t\t<button dojoAttachPoint="okButton" dojoType="dijit.form.Button" type="submit" value="OK" style="padding: 20 0 10 0; float: right; clear: both;">Ok\n\t\t\t\t\t</button>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</div>'});
define("orion/git/widgets/GitCredentialsDialog",["dojo","dijit","dijit/Dialog","orion/widgets/_OrionDialogMixin","text!orion/git/widgets/templates/GitCredentialsDialog.html"],function(f,e){f.declare("orion.git.widgets.GitCredentialsDialog",[e.Dialog,orion.widgets._OrionDialogMixin],{widgetsInTemplate:true,templateString:f.cache("orion","git/widgets/templates/GitCredentialsDialog.html"),constructor:function(){this.inherited(arguments);this.options=arguments[0]||{}},postMixInProperties:function(){this.inherited(arguments);
this.title=this.options.title||"Git Credentials";this.gitUrlLabelText="Repository URL:";this.gitSshUsernameLabelText="Username:";this.gitSshPasswordLabelText="Ssh password:";this.gitPrivateKeyLabelText="Private key:";this.gitPassphraseLabelText="Passphrase (optional):";if(!this.options.username&&!this.options.password&&!this.options.privatekey&&!this.options.passphrase){this.options.username=true;this.options.password=true;this.options.privatekey=true;this.options.passphrase=true}if(this.options.serviceRegistry){this._sshService=
this.options.serviceRegistry.getService("orion.net.ssh");this._progressService=this.options.serviceRegistry.getService("orion.page.progress")}},postCreate:function(){this.inherited(arguments);var a=this;this.options.username||f.style(this.gitSshUsernameRow,"display","none");this.options.password||f.style(this.gitSshPasswordRow,"display","none");this.options.privatekey||f.style(this.gitPrivateKeyRow,"display","none");if(!this.options.passphrase){f.style(this.gitPassphraseRow,"display","none");f.style(this.gitPassphraseRow_1,
"display","none")}if(this.options.errordata&&this.options.errordata.Url){f.style(this.gitCredentialsLabel,"display","block");this.url.innerHTML=this.options.errordata.Url}if(this.options.errordata&&this.options.errordata.User&&this.options.errordata.User!==""){this.gitSshUsername.value=this.options.errordata.User;f.style(this.gitSshUsernameRow,"display","none");setTimeout(function(){a.gitSshPassword.focus()},400)}f.connect(this.gitSshPassword,"onfocus",null,f.hitch(this,function(){this.isSshPassword.checked=
true}));f.connect(this.gitPrivateKey,"onfocus",null,f.hitch(this,function(){this.isPrivateKey.checked=true}));f.connect(this.gitPassphrase,"onfocus",null,f.hitch(this,function(){this.isPrivateKey.checked=true}))},execute:function(){if(this._sshService){var a=this;this._sshService.getKnownHosts().then(function(c){if(a.options.func)a.options.func({gitSshUsername:a.gitSshUsername.value,gitSshPassword:a.isSshPassword.checked?a.gitSshPassword.value:"",gitPrivateKey:a.isPrivateKey.checked?a.gitPrivateKey.value:
"",gitPassphrase:a.isPrivateKey.checked?a.gitPassphrase.value:"",knownHosts:c});delete a.options.func})}else{this.options.func&&this.options.func({gitSshUsername:this.gitSshUsername.value,gitSshPassword:this.gitSshPassword.value,gitPrivateKey:this.gitPrivateKey.value,gitPassphrase:this.gitPassphrase.value,knownHosts:this.gitSshKnownHosts.value});delete this.options.func}}})});
define("orion/git/git-clones-explorer",["require","dojo","orion/explorer","orion/util"],function(f,e,a,c){var d={};d.GitClonesExplorer=function(){function g(h,i,j,k,m,n){this.parentId=k;this.registry=h;this.selection=i;this.toolbarId=m;this.selectionToolsId=n;this.cloneDetails=j;this.checkbox=false;this.renderer=new d.GitClonesRenderer({checkbox:false},this)}g.prototype=new a.Explorer;g.prototype.getGitLocation=function(h){h=c.makeRelative(h);var i=f.toUrl("gitapi/clone._");i=i.substring(0,i.length-
2);return h[0]==="/"?i+h:i+"/"+h};g.prototype.setDefaultPath=function(h){this.defaultPath=h};g.prototype.displayClonesList=function(h){h=h||this.defaultPath;h=c.makeRelative(h);if(h!==this._lastHash){this._lastHash=h;e.hash(h,true);h=this.getGitLocation(h);e.create("div",null,e.byId(this.parentId),"only").innerHTML="Loading <b>"+h+"</b>...";var i=this.registry.getService("orion.git.provider");this.createTree(this.parentId,new d.GitClonesModel(i,h,i.getGitClone))}};g.prototype.redisplayClonesList=
function(){if(this._lastHash){var h=this.getGitLocation(this._lastHash);e.create("div",null,e.byId(this.parentId),"only").innerHTML="Loading <b>"+h+"</b>...";var i=this.registry.getService("orion.git.provider");this.createTree(this.parentId,new d.GitClonesModel(i,h,i.getGitClone))}};g.prototype.loadCloneDetails=function(h){this.cloneDetails.loadCloneDetails(h.ConfigLocation)};return g}();d.GitClonesModel=function(){function g(h,i,j,k){this.gitClient=h;this.rootPath=i;this.fetchItems=j;this.root=k?
k:null}g.prototype=new a.ExplorerModel;g.prototype.getRoot=function(h){this.root?h(this.root):this.fetchItems(this.rootPath).then(e.hitch(this,function(i){this.root=i;h(i)}))};g.prototype.mayHaveChildren=function(h){if(h.children||h.Children)return true;else if(h.BranchLocation&&h.RemoteLocation)return true;else if(h.GroupNode)return true;else if(h.Type==="Remote")return true;return false};g.prototype.getIdentity=function(h){if(h.Location){h=h.Location;h=h.replace(/[^\.\:\-\_0-9A-Za-z]/g,"")}else h=
"ROOT";return h};g.prototype.getChildren=function(h,i){h.children=[];if(h.Children){for(var j=0;j<h.Children.length;j++){h.Children[j].parent=h;h.children[j]=h.Children[j]}i(h.Children)}else if(h.BranchLocation&&h.RemoteLocation){h.children=[{GroupNode:"true",Location:h.BranchLocation,Name:"Branches",parent:h},{GroupNode:"true",Location:h.RemoteLocation,BranchLocation:h.BranchLocation,Name:"Remotes",parent:h},{GroupNode:"true",Location:h.TagLocation,Name:"Tags",parent:h}];i(h.children)}else if(h.GroupNode)this.gitClient.getGitBranch(h.Location).then(e.hitch(this,
function(k){h.children=k.Children;for(var m=0;m<k.Children.length;m++)k.Children[m].parent=h;i(k.Children)}));else h.Type==="Remote"&&this.gitClient.getGitBranch(h.Location).then(e.hitch(this,function(k){h.children=k.Children;for(var m=0;m<k.Children.length;m++)k.Children[m].parent=h;i(k.Children)}))};return g}();d.GitClonesRenderer=function(){function g(h,i){this._init(h);this.explorer=i}g.prototype=new a.SelectionRenderer;g.prototype.getCellHeaderElement=function(h){switch(h){case 0:case 1:return e.create("th",
{style:"height: 8px;"})}};g.prototype.getCellElement=function(h,i,j){switch(h){case 0:var k,m;if(i.BranchLocation&&i.RemoteLocation){k=document.createElement("td");h=j.id+"__expand";h=e.create("div",null,k,"only");this.getExpandImage(j,h,"git-sprite-repository","gitImageSprite");m=e.create("a",{className:"navlinkonpage"},h,"last");e.connect(m,"onclick",m,e.hitch(this,function(){this.explorer.loadCloneDetails(i)}));e.connect(m,"onmouseover",m,function(){m.style.cursor="pointer"});e.connect(m,"onmouseout",
m,function(){m.style.cursor="default"});e.place(document.createTextNode(i.Name),m,"only")}else if(i.GroupNode){k=document.createElement("td");h=j.id+"__expand";h=e.create("div",null,k,"only");i.Name==="Branches"&&this.getExpandImage(j,h,"git-sprite-branches","gitImageSprite");i.Name==="Remotes"&&this.getExpandImage(j,h,"git-sprite-remotes","gitImageSprite");i.Name==="Tags"&&this.getExpandImage(j,h,"git-sprite-tags","gitImageSprite");m=e.create("a",{innerHTML:i.Name,className:"navlinkonpage"},h,"last");
e.place(document.createTextNode(i.Name),m,"only")}else if(i.Type==="Branch"){k=document.createElement("td");h=e.create("div",{style:"margin-left: 10px"},k,"only");m=e.create("a",{innerHTML:i.Name,className:"navlinkonpage"},h,"last");if(i.Current)m.style.fontWeight="bold";e.place(document.createTextNode(i.Name),m,"only");j=e.create("span",null,m,"first");e.addClass(j,"gitImageSprite");e.addClass(j,"git-sprite-branch")}else if(i.Type==="Remote"){k=document.createElement("td");h=j.id+"__expand";h=e.create("div",
null,k,"only");this.getExpandImage(j,h,"git-sprite-remote","gitImageSprite");m=e.create("a",{innerHTML:i.Name,className:"navlinkonpage"},h,"last");!i.PushUrl||i.PushUrl===i.GitUrl?e.place(document.createTextNode(i.Name+" ("+i.GitUrl+")"),m,"only"):e.place(document.createTextNode(i.Name+" (See the configuration for fetch/push urls)"),m,"only")}else if(i.Type==="RemoteTrackingBranch"){k=document.createElement("td");h=e.create("div",{style:"margin-left: 10px"},k,"only");m=e.create("a",{innerHTML:i.Name,
className:"navlinkonpage"},h,"last");e.place(document.createTextNode(i.Name),m,"only");j=e.create("span",null,m,"first");e.addClass(j,"gitImageSprite");e.addClass(j,"git-sprite-branch")}else if(i.Type==="Tag"){k=document.createElement("td");h=e.create("div",{style:"margin-left: 10px"},k,"only");m=e.create("a",{innerHTML:i.Name,className:"navlinkonpage"},h,"last");e.place(document.createTextNode(i.Name),m,"only");j=e.create("span",null,m,"first");e.addClass(j,"gitImageSprite");e.addClass(j,"git-sprite-tag")}return k;
case 1:return this.getActionsColumn(i,j,"tool","actionsColumn")}};return g}();return d});define("text!orion/git/widgets/templates/RemotePrompterDialog.html",function(){return'<div class="dijitDialog" tabindex="-1" waiRole="dialog" waiState="labelledby-${id}_title">\n\t<div dojoAttachPoint="titleBar" class="dijitDialogTitleBar">\n\t\t<span dojoAttachPoint="titleNode" class="dijitDialogTitle" id="${id}_title"></span>\n\t\t<span dojoAttachPoint="closeButtonNode" class="dijitDialogCloseIcon" dojoAttachEvent="onclick: onCancel" title="${buttonCancel}">\n\t\t\t<span dojoAttachPoint="closeText" class="closeText" title="${buttonCancel}">x</span>\n\t\t</span>\n\t</div>\n\t<div dojoAttachPoint="containerNode" class="dijitDialogPaneContent">\n\t\t<!-- Actual content here --\>\n\t\t\t<div style="display: table">\n\t\t\t\t<div style="display: table-row"> \n\n\t\t\t\t\t<div style="display: table-cell; padding: 1px; vertical-align: bottom;">\n\t\t\t\t\t\t<div dojoAttachPoint="treeContainerNode" id="${id}_treeContainerNode" dojoType="dijit.layout.BorderContainer" style="width:25em; height:25em; overflow:auto;" design="sidebar" gutters="true">\n\t\t\t\t\t\t\t<div dojoAttachPoint="treeContentPane" class="dijitDialogPaneContent" id="${id}_treeContentPane dojoType="dijit.layout.ContentPane" region="center" gutters="true">\n\t\t\t\t\t\t\t\t<div dojoAttachPoint="browseRemoteExplorerTree" class="explorerTreeClass" id="${id}_browseRemoteExplorerTree" style="margin-top: -3px;"></div> \n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div style="display: table-cell; padding: 1px; vertical-align: bottom;">\n\t\t\t\t\t</div>\n\t\t\t\t\t<div style="display: table-cell; padding: 1px; vertical-align: bottom;">\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t\n\t\t\t\t<div style="display: table-row" dojoAttachPoint="newBranchSection">\n\t\t\t\t\t<div style="display: table-cell; padding: 1px;">\n\t\t\t\t\t<label for="${id}_newBranch">${newBranchText}</label>\n\t\t\t\t\t<input dojoAttachPoint="newBranch" id="${id}_newBranch" value="" disabled=true/>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div style="display: table-cell; padding: 1px;">\n\t\t\t\t\t</div>\n\t\t\t\t\t<div style="display: table-cell; padding: 1px;">\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t \n\t\t\t\t<div style="display: table-row">\n\t\t\t\t\t<div style="display: table-cell; padding: 1px;">\n\t\t\t\t\t</div>\n\t\t\t\t\t<div style="display: table-cell; padding: 1px;">\n\t\t\t\t\t</div>\n\t\t\t\t\t<div style="display: table-cell; padding: 1px;">\n\t\t\t\t\t\n\t\t\t\t\t\t<button dojoAttachPoint="RemoteBrowserButton" disabled=true dojoType="dijit.form.Button" type="submit" value="OK" style="padding: 20 0 10 0; float: right; clear: both;">${buttonOk}\n\t\t\t\t\t\t</button>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div> <!-- end table --\>\n\t</div> <!-- content pane --\>\n</div>'});
define("orion/git/widgets/RemotePrompterDialog",["dojo","dijit","orion/util","orion/git/git-clones-explorer","dijit/Dialog","dijit/form/Button","orion/widgets/ExplorerTree","orion/widgets/_OrionDialogMixin","text!orion/git/widgets/templates/RemotePrompterDialog.html"],function(f,e,a,c){f.declare("orion.git.widgets.RemotePrompterDialog",[e.Dialog,orion.widgets._OrionDialogMixin],{treeWidget:null,treeRoot:{},widgetsInTemplate:true,templateString:f.cache("orion","git/widgets/templates/RemotePrompterDialog.html"),
constructor:function(){this.inherited(arguments);this.options=arguments[0]||{};this.treeRoot=this.options.treeRoot},postMixInProperties:function(){this.inherited(arguments);this.title=this.options.title||"Choose a Folder";this.newBranchText="New Branch:";this.buttonOk="OK"},postCreate:function(){this.inherited(arguments);this.loadRemoteChildren(this.treeRoot);f.connect(this.newBranch,"onchange",f.hitch(this,this.validate));if(this.options.hideNewBranch)this.newBranchSection.style.display="none"},
loadRemoteChildren:function(d){this.treeRoot=d;this.createTree(new c.GitClonesModel(this.gitClient,null,this.gitClient.getGitClone,this.treeRoot))},createTree:function(d){var g=this.treeWidget=new orion.widgets.ExplorerTree({style:"width:100%; height:100%",model:d,region:"center",showRoot:false,persist:true,openOnClick:false,getLabel:function(i){if(i.Type==="RemoteTrackingBranch"&&!i.Id)return i.Name+" [New branch]";return i.Name},getIconClass:function(i){if(i.BranchLocation&&i.RemoteLocation)return"gitRepoItem";
if(i.GroupNode)return i.Name==="Branch"?"gitBranchesItem":"gitRemotesItem";if(i.Type==="Branch"||i.Type==="RemoteTrackingBranch")return"gitBranchItem";if(i.Type==="Remote")return"gitRemoteItem";return"gitDefaultItem"}}),h=this;this.treeWidget._inheritedSelectNode=this.treeWidget._selectNode;this.treeWidget._selectNode=function(i){g._inheritedSelectNode(i);h.newBranch.disabled=i.item&&i.item.Type==="Remote"?false:true;f.hitch(h,h.validate)()};this.treeWidget.startup();f.byId(this.treeContentPane.id).appendChild(this.treeWidget.domNode)},
validate:function(){var d=this.treeWidget.getSelectedItems();if(d.length==1)if(d[0].Type==="RemoteTrackingBranch"){this.RemoteBrowserButton.disabled=false;return}else if(d[0].Type==="Remote")if(this.newBranch.value!=""){this.RemoteBrowserButton.disabled=false;return}this.RemoteBrowserButton.disabled=true},execute:function(){var d=this.treeWidget.getSelectedItems();this.onHide();if(this.options.func)d[0].Type==="RemoteTrackingBranch"?this.options.func(d[0],d[0].parent):this.options.func(null,d[0],
this.newBranch.value);delete this.options.func}})});define("text!orion/git/widgets/templates/ApplyPatchDialog.html",function(){return'<div class="dijitDialog" tabindex="-1" waiRole="dialog" waiState="labelledby-${id}_title">\n\t<div dojoAttachPoint="titleBar" class="dijitDialogTitleBar">\n\t\t<span dojoAttachPoint="titleNode" class="dijitDialogTitle" id="${id}_title"></span>\n\t\t<span dojoAttachPoint="closeButtonNode" class="dijitDialogCloseIcon" dojoAttachEvent="onclick: onCancel" title="${buttonCancel}">\n\t\t\t<span dojoAttachPoint="closeText" class="closeText" title="${buttonCancel}">x</span>\n\t\t</span>\n\t</div>\n\t<div dojoAttachPoint="containerNode" class="dijitDialogPaneContent">\n\t\t<!-- Actual content here --\>\n\n\t\t<form method="post" id="applyPatchDialog.myForm"\n\t\t\tenctype="multipart/form-data">\n\t\t\t<fieldset>\n\t\t\t\t<div style="display: table-row">\n\t\t\t\t\t<div style="display: table-row; height: 20px">\n\t\t\t\t\t\t<div style="display: table-cell; padding: 1px;">\n\t\t\t\t\t\t\t<input type="radio" name="radio" value="urlRadio" id="applyPatchDialog.urlRadio" checked/>URL:\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div style="display: table-cell; padding: 1px;">\n\t\t\t\t\t\t\t<input type="text" name="url" id="applyPatchDialog.url" style="display: inline-block; width: 98%;"\n\t\t\t\t\t\t\t\tdojoType="dijit.form.ValidationTextBox"\n\t\t\t\t\t\t\t\tregExp="^http(s)*://.+" invalidMessage="Invalid URL."/>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div style="display: table-cell; padding: 1px;">\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div style="display: table-row; height: 20px">\n\t\t\t\t\t\t<div style="display: table-cell; padding: 1px;">\n\t\t\t\t\t\t\t<input type="radio" name="radio" value="fileRadio" id="applyPatchDialog.fileRadio"/>File:\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div style="display: table-cell; padding: 1px; vertical-align: top;">\n\t\t\t\t\t\t\t<div id="files" dojoType="dojox.form.uploader.FileList" uploaderId="applyPatchDialog.uploader"></div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div style="display: table-cell; padding: 1px;">\n\t\t\t\t\t\t\t<input name="uploadedfile" multiple="false" type="file" id="applyPatchDialog.uploader" force="iframe"\n\t\t\t\t\t\t\t\tdojoType="dojox.form.Uploader" style="height: 20px" label="Browse..."/>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div style="display: table-row">\n\t\t\t\t\t\t<div style="display: table-cell; padding: 1px;">\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div style="display: table-cell; padding: 1px;">\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div style="display: table-cell; padding: 1px;">\n\t\t\t\t\t\t\t<input type="submit" label="Finish" value="OK" dojoType="dijit.form.Button"\n\t\t\t\t\t\t\t\tstyle="padding: 20 0 10 0; float: right; clear: both;"/>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</fieldset>\n\t\t</form>\n\t</div>\n</div>'});
define("orion/git/widgets/ApplyPatchDialog",["dojo","dijit","dojox","dijit/Dialog","dojo/data/ItemFileReadStore","dojox/form/Uploader","dojox/form/uploader/FileList","dojox/form/uploader/plugins/IFrame","dijit/form/Button","dijit/ProgressBar","orion/widgets/_OrionDialogMixin","text!orion/git/widgets/templates/ApplyPatchDialog.html"],function(f,e){f.declare("orion.git.widgets.ApplyPatchDialog",[e.Dialog,orion.widgets._OrionDialogMixin],{widgetsInTemplate:true,templateString:f.cache("orion","git/widgets/templates/ApplyPatchDialog.html"),
constructor:function(){this.inherited(arguments);this.options=arguments[0]||{}},postMixInProperties:function(){this.inherited(arguments);this.title="Apply Patch"},postCreate:function(){function a(c){e.byId("files").set("disabled",c);e.byId("applyPatchDialog.uploader").set("disabled",c);e.byId("applyPatchDialog.url").set("disabled",!c)}this.inherited(arguments);f.byId("applyPatchDialog.myForm").action=this.options.diffLocation;f.byId("applyPatchDialog.uploader").url=this.options.diffLocation;a(true);
f.connect(e.byId("applyPatchDialog.urlRadio"),"onclick",f.hitch(this,function(c){c.target.id==="applyPatchDialog.urlRadio"&&a(true)}));f.connect(e.byId("applyPatchDialog.fileRadio"),"onclick",f.hitch(this,function(c){c.target.id==="applyPatchDialog.fileRadio"&&a(false)}));f.connect(e.byId("applyPatchDialog.uploader"),"onError",f.hitch(this,function(){setTimeout(f.hitch(this,function(){this.hide()}),2E3)}));f.connect(e.byId("applyPatchDialog.uploader"),"onComplete",f.hitch(this,function(){setTimeout(f.hitch(this,
function(){this.hide()}),2E3)}))}})});define("text!orion/git/widgets/templates/OpenCommitDialog.html",function(){return'<div class="dijitDialog" tabindex="-1" waiRole="dialog" title="${title}" waiState="labelledby-${id}_title">\n\t<div dojoAttachPoint="titleBar" class="dijitDialogTitleBar">\n\t\t<span dojoAttachPoint="titleNode" class="dijitDialogTitle" id="${id}_title"></span>\n\t\t<span dojoAttachPoint="closeButtonNode" class="dijitDialogCloseIcon" dojoAttachEvent="onclick: onCancel" title="${buttonCancel}">\n\t\t\t<span dojoAttachPoint="closeText" class="closeText" title="${buttonCancel}">x</span>\n\t\t</span>\n\t</div>\n\t<div dojoAttachPoint="containerNode" class="dijitDialogPaneContent">\n\t\t<div style="display:table">\n\t\t\t<div style="display:table-row">\n\t\t\t\t<div style="display:table-cell; padding:5;">\n\t\t\t\t\t<label for="resourceName" style="padding-right:10">${selectFile}</label>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div style="display:table-row">\n\t\t\t\t<div style="display:table-cell; padding:5;">\n\t\t\t\t\t<input type="text" dojoType="dijit.form.TextBox" dojoAttachPoint="resourceName" \n\t\t\t\t\t\tplaceHolder="${searchPlaceHolder}"\n\t\t\t\t\t\tintermediateChanges="true" style="width:30em;">\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div style="display:table-row">\n\t\t\t\t<div dojoAttachPoint="results" style="max-height:400px; height:auto; overflow-y:auto;"></div>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</div>'});
define("orion/git/widgets/OpenCommitDialog",["require","dojo","dijit","orion/util","dijit/Dialog","dijit/form/TextBox","orion/widgets/_OrionDialogMixin","text!orion/git/widgets/templates/OpenCommitDialog.html"],function(f,e,a){return e.declare("orion.git.widgets.OpenCommitDialog",[a.Dialog,orion.widgets._OrionDialogMixin],{widgetsInTemplate:true,templateString:e.cache("orion","git/widgets/templates/OpenCommitDialog.html"),SEARCH_DELAY:500,timeoutId:null,time:null,options:null,constructor:function(){this.inherited(arguments);
this.timeoutId=null;this.time=0;this.options=arguments[0];this.serviceRegistry=this.options.serviceRegistry;if(!this.serviceRegistry)throw new Error("Missing required argument: serviceRegistry");this.repositories=this.options.repositories;if(!this.repositories)throw new Error("Missing required argument: repositories");this.commitName=this.options.commitName},postMixInProperties:function(){this.options.title=this.options.title||"Find Commit";this.selectFile="Type the commit name (sha1):";this.searchPlaceHolder=
"Search";this.inherited(arguments)},postCreate:function(){this.inherited(arguments);e.connect(this.resourceName,"onChange",this,function(){this.time=+new Date;clearTimeout(this.timeoutId);this.timeoutId=setTimeout(e.hitch(this,this.checkSearch),0)});e.connect(this.resourceName,"onKeyPress",this,function(c){if(c.keyCode===e.keys.ENTER&&this.results){c=e.query("a",this.results);if(c.length>0){window.open(c[0].href);this.hide()}}});e.connect(this,"onMouseUp",function(c){c.target.focus()});this.resourceName.set("value",
this.commitName)},checkSearch:function(){clearTimeout(this.timeoutId);var c=(new Date).getTime();if(c-this.time>this.SEARCH_DELAY){this.time=c;this.doSearch()}else this.timeoutId=setTimeout(e.hitch(this,"checkSearch"),50)},_findCommitLocation:function(c,d,g){var h=this;if(g==null)g=new e.Deferred;c.length>0?h.serviceRegistry.getService("orion.git.provider").doGitLog("/gitapi/commit/"+d+c[0].ContentLocation+"?page=1&pageSize=1",null,null,"Looking for the commit").then(function(i){g.callback(i.Children[0])},
function(){h._findCommitLocation(c.slice(1),d,g)}):g.errback();return g},doSearch:function(){var c=this.resourceName&&this.resourceName.get("value");if(c){e.place("<div>Searching&#x2026;</div>",this.results,"only");var d=this;this.serviceRegistry.getService("orion.page.message").setProgressMessage("Looking for the commit");this._findCommitLocation(this.repositories,c).then(function(g){e.empty(d.results);d.displayCommit(g,d.results)},function(){e.place("<div>No commits found</div>",d.results,"only");
d.serviceRegistry.getService("orion.page.message").setProgressMessage("")})}},displayCommit:function(c,d){d=e.create("div",{style:"padding:10px; max-width:480px"},d);var g=c.Message.split(/(\r?\n|$)/)[0],h=e.create("a",{"class":"gitMainDescription",href:"/git/git-commit.html#"+c.Location+"?page=1&pageSize=1"},d);e.place(document.createTextNode(g),h);e.connect(h,"onclick",h,e.hitch(this,function(){this.hide()}));e.create("div",{style:"padding-top:15px"},d);e.create("span",{"class":"gitSecondaryDescription",
innerHTML:" commit: "+c.Name},d);if(c.Parents&&c.Parents.length>0){e.create("div",null,d);e.place(document.createTextNode("parent: "),d);g=e.create("a",{"class":"gitSecondaryDescription",href:"/git/git-commit.html#"+c.Parents[0].Location+"?page=1&pageSize=1"},d);e.place(document.createTextNode(c.Parents[0].Name),g);e.connect(g,"onclick",g,e.hitch(this,function(){this.hide()}))}e.create("div",{style:"padding-top:15px"},d);if(c.AuthorImage){g=e.create("span",{"class":"git-author-icon-small",style:"margin-bottom:30px"},
d);h=new Image;h.src=c.AuthorImage;h.name=c.AuthorName;h.width=35;h.height=35;e.place(h,g,"first")}e.create("span",{"class":"gitSecondaryDescription",innerHTML:" authored by "+c.AuthorName+" ("+c.AuthorEmail+") on "+e.date.locale.format(new Date(c.Time),{formatLength:"short"})},d);e.create("div",null,d);e.create("span",{"class":"gitSecondaryDescription",innerHTML:"committed by "+c.CommitterName+" ("+c.CommitterEmail+")"},d)},show:function(){this.inherited(arguments);this.resourceName.focus()},onHide:function(){clearTimeout(this.timeoutId);
this.inherited(arguments)}})});
define("orion/git/gitCommands",["require","dojo","orion/commands","orion/util","orion/git/widgets/CloneGitRepositoryDialog","orion/git/widgets/InitGitRepositoryDialog","orion/git/widgets/AddRemoteDialog","orion/git/widgets/GitCredentialsDialog","orion/widgets/NewItemDialog","orion/git/widgets/RemotePrompterDialog","orion/git/widgets/ApplyPatchDialog","orion/git/widgets/OpenCommitDialog"],function(f,e,a,c){var d={};(function(){function g(i){var j;try{j=JSON.parse(i.responseText)}catch(k){j={Result:i.responseText}}j.HttpCode=
i.status;return j}var h=false;d.updateNavTools=function(i,j,k,m,n,p){var r=e.byId(k);if(r)e.empty(r);else throw"could not find toolbar "+k;var w=i.getService("orion.page.command");w.renderCommands(r,"dom",n,j,"button");if(p)if(k=e.byId(p)){e.empty(k);w.renderCommands(k,"dom",n,j,"button",true)}if(m)if(e.byId(m)){e.empty(m);w.renderCommands(m,"dom",null,j,"button")}if(!h){h=true;i.getService("orion.page.selection").addEventListener("selectionChanged",function(s,u){if(s=e.byId(m)){e.empty(s);w.renderCommands(s,
"dom",u,j,"button")}})}};d.getNewItemName=function(i,j,k,m,n,p,r,w){var s,u;if(k)s=e.byId(m);else if(j.makeNewItemPlaceHolder!=null)if(i=j.makeNewItemPlaceHolder(i,m,r)){s=i.refNode;u=i.tempNode}else s=e.byId(m);if(s)c.getUserText(m+"EditBox",s,false,n,e.hitch(this,function(t){if(t){u&&u.parentNode.removeChild(u);p(t)}}),undefined,undefined,undefined,w);else(m=window.prompt(n))&&p(m)};d.handleKnownHostsError=function(i,j,k,m){if(confirm("Would you like to add "+j.KeyType+" key for host "+j.Host+" to continue operation? Key fingerpt is "+
j.HostFingerprint+".")){var n=i.getService("orion.net.ssh");n.addKnownHosts(j.Host+" "+j.KeyType+" "+j.HostKey).then(function(){n.getKnownHosts().then(function(r){k.knownHosts=r;m(k)});if(k.failedOperation){var p=i.getService("orion.page.progress");e.hitch(p,p.removeOperation)(k.failedOperation.Location,k.failedOperation.Id)}})}};d.handleSshAuthenticationError=function(i,j,k,m,n){j=new orion.git.widgets.GitCredentialsDialog({title:n,serviceRegistry:i,func:m,errordata:k.errordata,failedOperation:k.failedOperation});
j.startup();j.show();if(k.failedOperation){i=i.getService("orion.page.progress");e.hitch(i,i.removeOperation)(k.failedOperation.Location,k.failedOperation.Id)}};d.getDefaultSshOptions=function(i,j){var k=new e.Deferred;i=i.getService("orion.net.ssh");var m=j&&!j.optionsRequested?j.valueFor("sshuser"):"",n=j&&!j.optionsRequested?j.valueFor("sshpassword"):"";i.getKnownHosts().then(function(p){k.callback({knownHosts:p,gitSshUsername:m,gitSshPassword:n,gitPrivateKey:"",gitPassphrase:""})});return k};
d.handleProgressServiceResponse=function(i,j,k,m,n,p){if(i&&i.status)i=g(i);if(!i||!i.HttpCode)m&&m(i);else switch(i.HttpCode){case 200:case 201:case 202:m&&m(i.Result);return;case 401:if(i.JsonData)j.errordata=i.JsonData;if(i.failedOperation)j.failedOperation=i.failedOperation;e.hitch(this,d.handleSshAuthenticationError)(k,i.JsonData,j,n,p);return;case 400:if(i.JsonData&&i.JsonData.HostKey){if(i.failedOperation)j.failedOperation=i.failedOperation;e.hitch(this,d.handleKnownHostsError)(k,i.JsonData,
j,n);return}default:j=[];j.Severity="Error";j.HTML=false;try{j.Message=i.DetailedMessage?i.DetailedMessage:i.Message}catch(r){j.Message=error.message}k.getService("orion.page.message").setProgressResult(j);break}};d.gatherSshCredentials=function(i,j,k,m){var n=new e.Deferred,p=function(r){i.getService("orion.net.ssh").getKnownHosts().then(function(w){n.callback({knownHosts:w,gitSshUsername:r.gitSshUsername,gitSshPassword:r.gitSshPassword,gitPrivateKey:r.gitPrivateKey,gitPassphrase:r.gitPassphrase})})};
if(k&&k.HostKey){confirm("Would you like to add "+k.KeyType+" key for host "+k.Host+" to continue operation? Key fingerpt is "+k.HostFingerprint+".")&&i.getService("orion.net.ssh").addKnownHosts(k.Host+" "+k.KeyType+" "+k.HostKey).then(function(){p({gitSshUsername:"",gitSshPassword:"",gitPrivateKey:"",gitPassphrase:""})});return n}if(j){k=j.parameters?j.parameters.valueFor("sshuser"):"";j=j.parameters?j.parameters.valueFor("sshpassword"):"";p({gitSshUsername:k,gitSshPassword:j,gitPrivateKey:"",gitPassphrase:""});
return n}j=new orion.git.widgets.GitCredentialsDialog({title:m,serviceRegistry:i,func:p,errordata:k});j.startup();j.show();return n};d.handleProgressServiceResponse2=function(i,j,k,m){if(i&&i.status)i=g(i);if(!i||!i.HttpCode)k&&k(i);else switch(i.HttpCode){case 200:case 201:case 202:k&&k(i.Result);return;case 401:if(i.failedOperation){j=j.getService("orion.page.progress");e.hitch(j,j.removeOperation)(i.failedOperation.Location,i.failedOperation.Id)}m(i);return;case 400:if(i.JsonData&&i.JsonData.HostKey){if(i.failedOperation){j=
j.getService("orion.page.progress");e.hitch(j,j.removeOperation)(i.failedOperation.Location,i.failedOperation.Id)}m(i);return}default:m=[];m.Severity="Error";m.HTML=false;try{m.Message=i.DetailedMessage?i.DetailedMessage:i.Message}catch(n){m.Message=error.message}j.getService("orion.page.message").setProgressResult(m);break}};d.createFileCommands=function(i,j,k){function m(p){if(!(p.status===401||p.status===403)){var r=[];r.Severity="Error";r.HTML=false;try{var w=JSON.parse(p.responseText);r.Message=
w.DetailedMessage?w.DetailedMessage:w.Message}catch(s){r.Message=p.message}i.getService("orion.page.message").setProgressResult(r)}}var n=new a.Command({name:"Link Repository",imageClass:"core-sprite-link",id:"eclipse.linkRepository",callback:function(p){var r=new orion.widgets.NewItemDialog({title:"Link Repository",label:"Folder name:",func:function(w){var s=i.getService("orion.core.file");s.loadWorkspace("").then(function(u){s.createProject(u.Location,w,p.items.ContentLocation,false).then(function(t){alert("Repository was linked to "+
t.Name);s.read(t.ContentLocation,true).then(function(y){window.location.replace(f.toUrl("navigate/table.html")+"#"+y.ChildrenLocation)})})})},advanced:false});r.startup();r.show()},visibleWhen:function(p){if(p.ContentLocation)return true;return false}});j.addCommand(n,"object");n=new a.Command({name:"Checkout",tooltip:"Checkout the current tag, creating a local branch based on its contents.",imageClass:"git-sprite-checkout",spriteClass:"gitCommandSprite",id:"eclipse.checkoutTag",callback:function(p){function r(){if(w.Repository)return w.Repository.BranchLocation;
for(var s in w.parent.parent.children)if(w.parent.parent.children[s].Name==="Branches")return w.parent.parent.children[s];return w.parent.parent}var w=p.items;d.getNewItemName(w,k,false,p.domNode.id,"tag_"+w.Name,function(s){if(!(!s&&s=="")){var u;u=w.Repository!=null?w.Repository.Location:w.parent.parent.Location;i.getService("orion.git.provider").checkoutTag(u,w.Name,s).then(function(){e.hitch(k,k.changedItem)(r())},m)}},undefined,true)},visibleWhen:function(p){return p.Type==="Tag"}});j.addCommand(n,
"object");n=new a.Command({name:"Checkout",tooltip:"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(p){var r=p.items,w=i.getService("orion.git.provider"),s=i.getService("orion.page.message");s.setProgressMessage("Checking out branch...");r.Type==="Branch"?
w.checkoutBranch(r.CloneLocation,r.Name).then(function(){e.hitch(k,k.changedItem)(r.parent);s.setProgressResult("Ok")},m):w.addBranch(r.Repository!=null?r.Repository.BranchLocation:r.parent.parent.BranchLocation,null,r.Name).then(function(u){w.checkoutBranch(u.CloneLocation,u.Name).then(function(){e.hitch(k,k.changedItem)(r.Repository?r.Repository.BranchLocation:r.parent.parent.parent);s.setProgressResult("Ok")},m)},m)},visibleWhen:function(p){return p.Type==="Branch"||p.Type==="RemoteTrackingBranch"}});
j.addCommand(n,"object");n=new a.ParametersDescription([new a.CommandParameter("name","text","Name:")],false);n=new a.Command({name:"New Branch",tooltip:"Add a new local branch to the repository",imageClass:"core-sprite-add",id:"eclipse.addBranch",parameters:n,callback:function(p){var r=p.items,w=function(u,t){i.getService("orion.git.provider").addBranch(u,t).then(function(){e.hitch(k,k.changedItem)(r)},m)},s;s=r.Type==="Clone"?r.BranchLocation:r.Location;p.parameters.valueFor("name")&&!p.parameters.optionsRequested?
w(s,p.parameters.valueFor("name")):d.getNewItemName(r,k,false,p.domNode.id,"Branch name",function(u){!u&&u==""||w(s,u)})},visibleWhen:function(p){return p.GroupNode&&p.Name==="Branches"||p.Type==="Clone"&&k.parentId==="artifacts"}});j.addCommand(n,"object");j.addCommand(n,"dom");n=new a.Command({name:"Delete",tooltip:"Delete the local branch from the repository",imageClass:"core-sprite-delete",id:"eclipse.removeBranch",callback:function(p){var r=p.items;confirm("Are you sure you want to delete branch "+
r.Name+"?")&&i.getService("orion.git.provider").removeBranch(r.Location).then(function(){if(k.changedItem)e.hitch(k,k.changedItem)(r.parent);else k.displayBranches&&e.hitch(k,k.displayBranches)(r.ParentLocation,null)},m)},visibleWhen:function(p){return p.Type==="Branch"&&!p.Current}});j.addCommand(n,"object");n=new a.Command({name:"Delete",tooltip:"Delete the remote tracking branch from the repository",imageClass:"core-sprite-delete",id:"eclipse.removeRemoteBranch",callback:function(p){var r=p.items;
confirm("You're going to delete remote branch "+r.Name+" and push the change.\n\nAre you sure?")&&d.getDefaultSshOptions(i).then(function(w){var s=arguments.callee;i.getService("orion.git.provider").doPush(r.Location,"",false,false,null,"Removing remote branch: "+r.Name,w.gitSshUsername,w.gitSshPassword,w.knownHosts,w.gitPrivateKey,w.gitPassphrase).then(function(u){d.handleProgressServiceResponse(u,w,i,function(t){t.Result.Severity=="Ok"&&e.hitch(k,k.changedItem)(r.parent)},s,"Delete Remote Branch")},
function(u){d.handleProgressServiceResponse(u,w,i,function(){},s,"Removing remote branch: "+r.Name)})})},visibleWhen:function(p){return p.Type==="RemoteTrackingBranch"}});j.addCommand(n,"object");n=new a.ParametersDescription([new a.CommandParameter("name","text","Name:"),new a.CommandParameter("url","url","Url:")],false);n=new a.Command({name:"New Remote",tooltip:"Add a new remote to the repository",imageClass:"core-sprite-add",id:"eclipse.addRemote",parameters:n,callback:function(p){var r=p.items,
w=function(u,t,y){i.getService("orion.git.provider").addRemote(u,t,y).then(function(){e.hitch(k,k.changedItem)(r)},m)},s;s=r.Type==="Clone"?r.RemoteLocation:r.Location;if(p.parameters.valueFor("name")&&p.parameters.valueFor("url")&&!p.parameters.optionsRequested)w(s,p.parameters.valueFor("name"),p.parameters.valueFor("url"));else{p=new orion.git.widgets.AddRemoteDialog({func:function(u,t){w(s,u,t)}});p.startup();p.show()}},visibleWhen:function(p){return p.GroupNode&&p.Name==="Remotes"||p.Type==="Clone"&&
k.parentId==="artifacts"}});j.addCommand(n,"object");j.addCommand(n,"dom");n=new a.Command({name:"Delete",tooltip:"Delete the remote from the repository",imageClass:"core-sprite-delete",id:"eclipse.removeRemote",callback:function(p){var r=p.items;confirm("Are you sure you want to delete remote "+r.Name+"?")&&i.getService("orion.git.provider").removeRemote(r.Location).then(function(){e.hitch(k,k.changedItem)(r.parent)},m)},visibleWhen:function(p){return p.Type==="Remote"}});j.addCommand(n,"object");
n=new a.Command({name:"Pull",tooltip:"Pull from the repository",imageClass:"git-sprite-pull",spriteClass:"gitCommandSprite",id:"eclipse.orion.git.pull",callback:function(p){var r=p.items,w=r.Location;d.getDefaultSshOptions(i).then(function(s){var u=arguments.callee;i.getService("orion.git.provider").doPull(w,false,null,s.gitSshUsername,s.gitSshPassword,s.knownHosts,s.gitPrivateKey,s.gitPassphrase).then(function(t){d.handleProgressServiceResponse(t,s,i,function(){e.xhrGet({url:w,headers:{"Orion-Version":"1"},
postData:e.toJson({GitSshUsername:s.gitSshUsername,GitSshPassword:s.gitSshPassword,GitSshPrivateKey:s.gitPrivateKey,GitSshPassphrase:s.gitPassphrase,GitSshKnownHost:s.knownHosts}),handleAs:"json",timeout:5E3,load:function(y){return y},error:function(y,B){console.error("HTTP status code: ",B.xhr.status);return y}}).then(function(){r.Type==="Clone"&&e.hitch(k,k.changedItem)(r)},m)},u,"Pull Git Repository")},function(t){d.handleProgressServiceResponse(t,s,i,function(){},u,"Pull Git Repository")})})},
visibleWhen:function(p){return p.Type==="Clone"}});j.addCommand(n,"object");n=new a.Command({name:"Git Log",tooltip:"Open the log for the branch",id:"eclipse.openGitLog",imageClass:"git-sprite-log",spriteClass:"gitCommandSprite",hrefCallback:function(p){p=p.items;if(p.Type==="RemoteTrackingBranch")return f.toUrl("git/git-log.html")+"#"+p.Location+"?page=1";return f.toUrl("git/git-log.html")+"#"+p.CommitLocation+"?page=1"},visibleWhen:function(p){return p.Type==="Branch"||p.Type==="RemoteTrackingBranch"}});
j.addCommand(n,"object");n=new a.Command({name:"Git Log",tooltip:"Open the log for the repository",id:"eclipse.openGitLogAll",imageClass:"git-sprite-log",spriteClass:"gitCommandSprite",hrefCallback:function(p){return f.toUrl("git/git-log.html")+"#"+p.items.CommitLocation+"?page=1"},visibleWhen:function(p){if(!p.CommitLocation||!p.StatusLocation)return false;return true}});j.addCommand(n,"object");n=new a.Command({name:"Git Status",tooltip:"Open the status for the repository",id:"eclipse.openGitStatus",
imageClass:"git-sprite-status",spriteClass:"gitCommandSprite",hrefCallback:function(p){return f.toUrl("git/git-status.html")+"#"+p.items.StatusLocation},visibleWhen:function(p){if(!p.StatusLocation)return false;return true}});j.addCommand(n,"object");n=new a.Command({name:"Show in Navigator",tooltip:"Show the repository folder in the file navigator",id:"eclipse.openCloneContent",hrefCallback:function(p){return f.toUrl("navigate/table.html")+"#"+p.items.ContentLocation+"?depth=1"},visibleWhen:function(p){if(!p.ContentLocation)return false;
return true}});j.addCommand(n,"object");n=new a.Command({name:"Compare With Each Other",imageClass:"git-sprite-open_compare",spriteClass:"gitCommandSprite",id:"eclipse.compareGitCommits",hrefCallback:function(p){p=p.items;var r=new e.Deferred;i.getService("orion.git.provider").getDiff(p[1].DiffLocation,p[0].Name,function(w,s){r.callback(f.toUrl("compare/compare.html")+"?readonly#"+s.xhr.getResponseHeader("Location"))});return r},visibleWhen:function(p){if(k.isDirectory)return false;if(e.isArray(p)&&
p.length===2&&p[0].Type==="Commit"&&p[1].Type==="Commit")return true;return false}});j.addCommand(n,"dom");n=new a.Command({name:"Compare With Working Tree",imageClass:"git-sprite-open_compare",spriteClass:"gitCommandSprite",id:"eclipse.compareWithWorkingTree",hrefCallback:function(p){return f.toUrl("compare/compare.html")+"#"+p.items.DiffLocation},visibleWhen:function(p){return p.Type==="Commit"&&!k.isDirectory}});j.addCommand(n,"object");n=new a.Command({name:"Open",id:"eclipse.openGitCommit",hrefCallback:function(p){return f.toUrl("edit/edit.html")+
"#"+p.items.ContentLocation},visibleWhen:function(p){return p.Type==="Commit"&&p.ContentLocation!=null&&!k.isDirectory}});j.addCommand(n,"object");n=new a.Command({name:"Fetch",tooltip:"Fetch from the remote",imageClass:"git-sprite-fetch",spriteClass:"gitCommandSprite",id:"eclipse.orion.git.fetch",callback:function(p){var r=p.items,w=r.Location,s=function(t,y){if(t.JsonData.HostKey)u(y,t.JsonData);else if(y){y.parameters=t.JsonData.User?new a.ParametersDescription([new a.CommandParameter("sshpassword",
"password","SSH Password:")],true):new a.ParametersDescription([new a.CommandParameter("sshuser","text","SSH User Name:"),new a.CommandParameter("sshpassword","password","SSH Password:")],true);y.parameters.errorData=t.JsonData;j._collectParameters(y)}else u(null,t.JsonData)},u=function(t,y){d.gatherSshCredentials(i,t,y).then(function(B){var D=i.getService("orion.git.provider");D.doFetch(w,false,null,B.gitSshUsername,B.gitSshPassword,B.knownHosts,B.gitPrivateKey,B.gitPassphrase).then(function(l){d.handleProgressServiceResponse2(l,
i,function(){D.getGitRemote(w).then(function(o){k.parentId==="explorer-tree"&&D.getLog(o.HeadLocation,o.Id,"Getting git incoming changes",function(q){k.renderer.setIncomingCommits(q.Children);k.loadCommitsList(o.CommitLocation+"?page=1",o,true)});e.hitch(k,k.changedItem)(r)},m)},function(o){s(o,t)})},function(l){d.handleProgressServiceResponse2(l,i,function(){},function(o){s(o,t)})})})};if(p.parameters&&p.parameters.optionsRequested){u(null,p.parameters.errorData);p.parameters.optionsRequested=false;
p.parameters.errorData=null}else u(p)},visibleWhen:function(p){return p.Type==="RemoteTrackingBranch"||p.Type==="Remote"}});j.addCommand(n,"dom");j.addCommand(n,"object");n=new a.Command({name:"Force Fetch",tooltip:"Fetch from the remote branch into your remote tracking branch overriding its current content",id:"eclipse.orion.git.fetchForce",callback:function(p){if(confirm("You're going to override content of the remote tracking branch. This can cause the branch to lose commits.\n\nAre you sure?")){var r=
p.items,w=r.Location,s=function(t,y){if(t.JsonData.HostKey)u(y,t.JsonData);else if(y){y.parameters=t.JsonData.User?new a.ParametersDescription([new a.CommandParameter("sshpassword","password","SSH Password:")],true):new a.ParametersDescription([new a.CommandParameter("sshuser","text","SSH User Name:"),new a.CommandParameter("sshpassword","password","SSH Password:")],true);y.parameters.errorData=t.JsonData;j._collectParameters(y)}else u(null,t.JsonData)},u=function(t,y){d.gatherSshCredentials(i,t,
y).then(function(B){var D=i.getService("orion.git.provider");D.doFetch(w,true,null,B.gitSshUsername,B.gitSshPassword,B.knownHosts,B.gitPrivateKey,B.gitPassphrase).then(function(l){d.handleProgressServiceResponse2(l,i,function(){D.getGitRemote(w).then(function(o){k.parentId==="explorer-tree"&&D.getLog(o.HeadLocation,o.Id,"Getting git incoming changes",function(q){k.renderer.setIncomingCommits(q.Children);k.loadCommitsList(o.CommitLocation+"?page=1",o,true)});e.hitch(k,k.changedItem)(r)},m)},function(o){s(o,
t)})},function(l){d.handleProgressServiceResponse2(l,i,function(){},function(o){s(o,t)})})})};if(p.parameters&&p.parameters.optionsRequested){u(null,p.parameters.errorData);p.parameters.optionsRequested=false;p.parameters.errorData=null}else u(p)}},visibleWhen:function(p){return p.Type==="RemoteTrackingBranch"||p.Type==="Remote"}});j.addCommand(n,"dom");j.addCommand(n,"object");n=new a.Command({name:"Merge",tooltip:"Merge the content from the branch to your active branch",imageClass:"git-sprite-merge",
spriteClass:"gitCommandSprite",id:"eclipse.orion.git.merge",callback:function(p){var r=p.items;p=i.getService("orion.git.provider");var w=i.getService("orion.page.message");p.doMerge(r.HeadLocation,r.Name).then(function(s){var u=[];if(s.jsonData&&(s.jsonData.Result=="FAST_FORWARD"||s.jsonData.Result=="ALREADY_UP_TO_DATE")){e.query(".treeTableRow").forEach(function(y){e.toggleClass(y,"incomingCommitsdRow",false)});u.Severity="Ok";u.HTML=false;u.Message=s.jsonData.Result;e.hitch(k,k.changedItem)(r)}else if(s.jsonData){var t=
r.HeadLocation.replace("commit/HEAD","status");u.Severity="Warning";u.HTML=true;u.Message="<span>"+s.jsonData.Result+'. Go to <a href="'+f.toUrl("git/git-status.html")+"#"+t+'">Git Status page</a>.<span>'}else if(s.error){t=r.HeadLocation.replace("commit/HEAD","status");u.Severity="Error";if(s.error.responseText&&JSON.parse(s.error.responseText)){s=JSON.parse(s.error.responseText);u.Message=s.DetailedMessage?s.DetailedMessage:s.Message}else u.Message=s.error.message;u.HTML=true;u.Message="<span>"+
u.Message+' Go to <a href="'+f.toUrl("git/git-status.html")+"#"+t+'">Git Status page</a>.<span>'}w.setProgressResult(u)},function(s,u){s=[];var t=r.HeadLocation.replace("commit/HEAD","status");s.Severity="Error";s.HTML=true;s.Message="<span>"+e.fromJson(u.xhr.responseText).DetailedMessage+'. Go to <a href="'+f.toUrl("git/git-status.html")+"#"+t+'">Git Status page</a>.<span>';i.getService("orion.page.message").setProgressResult(s)})},visibleWhen:function(p){return p.Type==="RemoteTrackingBranch"||
p.Type==="Branch"&&!p.Current}});j.addCommand(n,"dom");j.addCommand(n,"object");n=new a.Command({name:"Rebase",tooltip:"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(p){var r=p.items;i.getService("orion.git.provider").doRebase(r.HeadLocation,
r.Name,"BEGIN",function(w){var s=[],u=r.HeadLocation.replace("commit/HEAD","status");if(w.Result=="OK"||w.Result=="FAST_FORWARD"||w.Result=="UP_TO_DATE"){s.Severity="Ok";s.HTML=false;s.Message=w.Result;e.hitch(k,k.changedItem)(r)}else if(w.Result=="STOPPED"){s.Severity="Warning";s.HTML=true;s.Message="<span>"+w.Result+'. Some conflicts occurred. Please resolve them and continue, skip patch or abort rebasing. Go to <a href="'+f.toUrl("git/git-status.html")+"#"+u+'">Git Status page</a>.<span>'}else if(w.Result==
"FAILED_WRONG_REPOSITORY_STATE"){s.Severity="Error";s.HTML=true;s.Message="<span>"+w.Result+'. Repository state is invalid (i.e. already during rebasing). Go to <a href="'+f.toUrl("git/git-status.html")+"#"+u+'">Git Status page</a>.<span>'}else if(w.Result=="FAILED_UNMERGED_PATHS"){s.Severity="Error";s.HTML=true;s.Message="<span>"+w.Result+'. Repository contains unmerged paths. Go to <a href="'+f.toUrl("git/git-status.html")+"#"+u+'">Git Status page</a>.<span>'}else if(w.Result=="FAILED_PENDING_CHANGES"){s.Severity=
"Error";s.HTML=true;s.Message="<span>"+w.Result+'. Repository contains pending changes. Please commit or stash them. Go to <a href="'+f.toUrl("git/git-status.html")+"#"+u+'">Git Status page</a>.<span>'}else{s.Severity="Warning";s.HTML=true;s.Message="<span>"+w.Result+'. Go to <a href="'+f.toUrl("git/git-status.html")+"#"+u+'">Git Status page</a>.<span>'}i.getService("orion.page.message").setProgressResult(s)},m)},visibleWhen:function(p){this.tooltip="Rebase your commits by removing them from the active branch, starting the active branch again based on the latest state of '"+
p.Name+"' and applying each commit again to the updated active branch.";return p.Type==="RemoteTrackingBranch"||p.Type==="Branch"&&!p.Current}});j.addCommand(n,"dom");j.addCommand(n,"object");n=new a.Command({name:"Push All",tooltip:"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(p){var r=p.items,w=e.hash();if(r.toRef)r=r.toRef;var s=function(t,y){if(t.JsonData.HostKey)u(y,
t.JsonData);else if(y){y.parameters=t.JsonData.User?new a.ParametersDescription([new a.CommandParameter("sshpassword","password","SSH Password:")],true):new a.ParametersDescription([new a.CommandParameter("sshuser","text","SSH User Name:"),new a.CommandParameter("sshpassword","password","SSH Password:")],true);y.parameters.errorData=t.JsonData;j._collectParameters(y)}else u(null,t.JsonData)},u=function(t,y){d.gatherSshCredentials(i,t,y).then(function(B){var D=i.getService("orion.git.provider");if(r.RemoteLocation.length==
1&&r.RemoteLocation[0].Children.length==1)D.doPush(r.RemoteLocation[0].Children[0].Location,"HEAD",true,false,null,"Pushing remote: "+w,B.gitSshUsername,B.gitSshPassword,B.knownHosts,B.gitPrivateKey,B.gitPassphrase).then(function(o){d.handleProgressServiceResponse2(o,i,function(){if(k.parentId==="explorer-tree"){if(!o||!o.HttpCode)e.query(".treeTableRow").forEach(function(q){e.toggleClass(q,"outgoingCommitsdRow",false)})}else e.hitch(k,k.changedItem)()},function(q){s(q,t)})},function(o){d.handleProgressServiceResponse2(o,
i,function(){},function(q){s(q,t)})});else{var l=new orion.git.widgets.RemotePrompterDialog({title:"Choose Branch",serviceRegistry:i,gitClient:D,treeRoot:{Children:r.RemoteLocation},hideNewBranch:true,func:e.hitch(this,function(o,q){D.doPush(o.Location,"HEAD",true,true,null,"Pushing remote: "+q.Name,B.gitSshUsername,B.gitSshPassword,B.knownHosts,B.gitPrivateKey,B.gitPassphrase).then(function(v){d.handleProgressServiceResponse2(v,i,function(){if(k.parentId==="explorer-tree"){if(!v||!v.HttpCode)e.query(".treeTableRow").forEach(function(x){e.toggleClass(x,
"outgoingCommitsdRow",false)})}else e.hitch(k,k.changedItem)()},function(x){s(x,t)})},function(v){d.handleProgressServiceResponse2(v,i,function(){},function(x){s(x,t)})})})});l.startup();l.show()}})};if(p.parameters&&p.parameters.optionsRequested){u(null,p.parameters.errorData);p.parameters.optionsRequested=false;p.parameters.errorData=null}else u(p)},visibleWhen:function(p){return p.toRef?p.RepositoryPath===""&&p.toRef.Type==="Branch"&&p.toRef.Current&&p.toRef.RemoteLocation:p.Type==="Branch"&&p.Current&&
p.RemoteLocation}});j.addCommand(n,"dom");j.addCommand(n,"object");n=new a.Command({name:"Force Push All",tooltip:"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(p){if(confirm("You're going to override content of the remote branch. This can cause the remote repository to lose commits.\n\nAre you sure?")){var r=p.items,w=e.hash();if(r.toRef)r=
r.toRef;var s=function(t,y){if(t.JsonData.HostKey)u(y,t.JsonData);else if(y){y.parameters=t.JsonData.User?new a.ParametersDescription([new a.CommandParameter("sshpassword","password","SSH Password:")],true):new a.ParametersDescription([new a.CommandParameter("sshuser","text","SSH User Name:"),new a.CommandParameter("sshpassword","password","SSH Password:")],true);y.parameters.errorData=t.JsonData;j._collectParameters(y)}else u(null,t.JsonData)},u=function(t,y){d.gatherSshCredentials(i,t,y).then(function(B){var D=
i.getService("orion.git.provider");if(r.RemoteLocation.length==1&&r.RemoteLocation[0].Children.length==1)D.doPush(r.RemoteLocation[0].Children[0].Location,"HEAD",true,true,null,"Pushing remote: "+w,B.gitSshUsername,B.gitSshPassword,B.knownHosts,B.gitPrivateKey,B.gitPassphrase).then(function(o){d.handleProgressServiceResponse2(o,i,function(){if(k.parentId==="explorer-tree"){if(!o||!o.HttpCode)e.query(".treeTableRow").forEach(function(q){e.toggleClass(q,"outgoingCommitsdRow",false)})}else e.hitch(k,
k.changedItem)()},function(q){s(q,t)})},function(o){d.handleProgressServiceResponse2(o,i,function(){},function(q){s(q,t)})});else{var l=new orion.git.widgets.RemotePrompterDialog({title:"Choose Branch",serviceRegistry:i,gitClient:D,treeRoot:{Children:r.RemoteLocation},hideNewBranch:true,func:e.hitch(this,function(o,q){D.doPush(o.Location,"HEAD",true,true,null,"Pushing remote: "+q.Name,B.gitSshUsername,B.gitSshPassword,B.knownHosts,B.gitPrivateKey,B.gitPassphrase).then(function(v){d.handleProgressServiceResponse2(v,
i,function(){if(k.parentId==="explorer-tree"){if(!v||!v.HttpCode)e.query(".treeTableRow").forEach(function(x){e.toggleClass(x,"outgoingCommitsdRow",false)})}else e.hitch(k,k.changedItem)()},function(x){s(x,t)})},function(v){d.handleProgressServiceResponse2(v,i,function(){},function(x){s(x,t)})})})});l.startup();l.show()}})};if(p.parameters&&p.parameters.optionsRequested){u(null,p.parameters.errorData);p.parameters.optionsRequested=false;p.parameters.errorData=null}else u(p)}},visibleWhen:function(p){if(p.toRef)return p.RepositoryPath===
""&&p.toRef.Type==="Branch"&&p.toRef.Current&&p.toRef.RemoteLocation}});j.addCommand(n,"dom");j.addCommand(n,"object");n=new a.Command({name:"Switch to Remote",tooltip:"Show the log for the corresponding remote tracking branch",id:"eclipse.orion.git.switchToRemote",hrefCallback:function(p){return f.toUrl("git/git-log.html")+"#"+p.items.toRef.RemoteLocation[0].Children[0].Location+"?page=1"},visibleWhen:function(p){return p.toRef!=null&&p.toRef.Type==="Branch"&&p.toRef.Current&&p.toRef.RemoteLocation&&
p.toRef.RemoteLocation.length===1&&p.toRef.RemoteLocation[0].Children.length===1}});j.addCommand(n,"dom");n=new a.Command({name:"< Previous Page",tooltip:"Show previous page of git log",id:"eclipse.orion.git.previousLogPage",hrefCallback:function(p){return f.toUrl("git/git-log.html")+"#"+p.items.PreviousLocation},visibleWhen:function(p){if(p.Type==="RemoteTrackingBranch"||p.toRef!=null&&p.toRef.Type==="Branch"||p.RepositoryPath!=null)return p.PreviousLocation!==undefined;return false}});j.addCommand(n,
"dom");n=new a.Command({name:"Next Page >",tooltip:"Show next page of git log",id:"eclipse.orion.git.nextLogPage",hrefCallback:function(p){return f.toUrl("git/git-log.html")+"#"+p.items.NextLocation},visibleWhen:function(p){if(p.Type==="RemoteTrackingBranch"||p.toRef!=null&&p.toRef.Type==="Branch"||p.RepositoryPath!=null)return p.NextLocation!==undefined;return false}});j.addCommand(n,"dom");n=new a.Command({name:"Switch to Active Local",tooltip:"Show the log for the active local branch",id:"eclipse.orion.git.switchToCurrentLocal",
hrefCallback:function(p){p=p.items;var r=new e.Deferred,w=p.CloneLocation;if(w==null)w=JSON.parse(p.responseText).JsonData.CloneLocation;var s=i.getService("orion.git.provider");e.xhrGet({url:w,headers:{"Orion-Version":"1"},handleAs:"json",timeout:5E3,load:function(u){s.getGitClone(u.Children[0].BranchLocation,function(t){e.forEach(t.Children,function(y){y.Current==true&&r.callback(f.toUrl("git/git-log.html")+"#"+y.CommitLocation+"?page=1")})})}});return r},visibleWhen:function(p){if(p.Type==="RemoteTrackingBranch")return true;
try{if(JSON.parse(p.responseText).JsonData)return true}catch(r){}return false}});j.addCommand(n,"dom");n=new a.Command({name:"Push to...",tooltip:"Push from your local branch into the selected remote branch",imageClass:"git-sprite-push",spriteClass:"gitCommandSprite",id:"eclipse.orion.git.pushto",callback:function(p){var r=p.items;p={};for(var w in r.parent.parent.children)if(r.parent.parent.children[w].Name==="Remote")p=r.parent.parent.children[w];w=i.getService("orion.git.provider");p=new orion.git.widgets.RemotePrompterDialog({title:"Choose Branch",
serviceRegistry:i,gitClient:w,treeRoot:p,func:e.hitch(this,function(s,u,t){console.info("Branch "+s+" remote "+u+" new branch "+t)})});p.startup();p.show()},visibleWhen:function(){return false}});j.addCommand(n,"dom");j.addCommand(n,"object");n=new a.Command({name:"Reset",tooltip:"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(p){var r=
p.items;if(confirm("The content of your active branch will be replaced with "+r.Name+". All unstaged and staged changes will be discarded and cannot be recovered. Are you sure?")){p=i.getService("orion.git.provider");var w=i.getService("orion.page.message");w.setProgressMessage("Resetting index...");p.resetIndex(r.IndexLocation,r.Name).then(function(){var s={};s.Severity="Info";s.HTML=false;s.Message="Ok";e.hitch(k,k.changedItem)(r);w.setProgressResult(s)},function(s){var u={};u.Severity="Error";
u.HTML=false;u.Message=s.message;w.setProgressResult(u)})}},visibleWhen:function(p){return p.Type==="RemoteTrackingBranch"}});j.addCommand(n,"object");n=new a.ParametersDescription([new a.CommandParameter("name","text","Name:")],false);n=new a.Command({name:"Tag",tooltip:"Create a tag for the commit",imageClass:"git-sprite-tag",spriteClass:"gitCommandSprite",id:"eclipse.orion.git.addTag",parameters:n,callback:function(p){var r=p.items,w=function(u,t){i.getService("orion.git.provider").doAddTag(u,
t).then(function(){e.hitch(k,k.changedItem)(r)},m)},s=r.Location;p.parameters.valueFor("name")&&!p.parameters.optionsRequested?w(s,p.parameters.valueFor("name")):d.getNewItemName(r,k,false,p.domNode.id,"Tag name",function(u){!u&&u==""||w(s,u)})},visibleWhen:function(p){return p.Type==="Commit"}});j.addCommand(n,"object");j.addCommand(n,"dom");n=new a.Command({name:"Delete",tooltip:"Delete the tag from the repository",imageClass:"core-sprite-delete",id:"eclipse.removeTag",callback:function(p){var r=
p.items;confirm("Are you sure you want to delete tag "+r.Name+"?")&&i.getService("orion.git.provider").doRemoveTag(r.Location).then(function(){e.hitch(k,k.changedItem)(r.parent)},m)},visibleWhen:function(p){return p.Type==="Tag"}});j.addCommand(n,"object");n=new a.Command({name:"Cherry-Pick",tooltip:"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(p){var r=p.items,
w=e.hash(),s=i.getService("orion.git.provider");p=r.Location.replace(r.Name,"HEAD");s.doCherryPick(p,r.Name,function(u){var t=[],y=r.Location.replace("commit/"+r.Name,"status");if(u.Result=="OK"){t.Severity="Ok";if(u.HeadUpdated){t.HTML=false;t.Message=u.Result;k.parentId==="explorer-tree"&&e.xhrGet({url:w,headers:{"Orion-Version":"1"},handleAs:"json",timeout:5E3,load:function(B){return B},error:function(B,D){console.error("HTTP status code: ",D.xhr.status)}}).then(function(B){B.HeadLocation?s.getLog(B.HeadLocation,
B.Id,"Getting git incoming changes",function(D){k.renderer.setIncomingCommits(D.Children);k.loadCommitsList(B.CommitLocation+"?page=1",B,true)}):s.getLog(w,"HEAD","Getting git outgoing changes",function(D){k.renderer.setOutgoingCommits(D.Children);k.loadCommitsList(w,B,true)})})}else{t.HTML=true;t.Message="<span>Nothing changed.</span>"}}else if(u.Result=="CONFLICTING"){t.Severity="Warning";t.HTML=true;t.Message="<span>"+u.Result+'. Some conflicts occurred. Go to <a href="'+f.toUrl("git/git-status.html")+
"#"+y+'">Git Status page</a>.<span>'}else if(u.Result=="FAILED"){t.Severity="Error";t.HTML=true;t.Message="<span>"+u.Result+'. Go to <a href="'+f.toUrl("git/git-status.html")+"#"+y+'">Git Status page</a>.<span>'}else{t.Severity="Warning";t.HTML=false;t.Message=u.Result}i.getService("orion.page.message").setProgressResult(t)},m)},visibleWhen:function(p){return p.Type==="Commit"}});j.addCommand(n,"object");j.addCommand(n,"dom")};d.createStatusCommands=function(i,j,k,m,n){var p=new a.Command({name:"Fetch",
tooltip:"Fetch from the remote branch into your remote tracking branch",imageClass:"git-sprite-fetch",spriteClass:"gitCommandSprite",id:"eclipse.orion.git.fetch",callback:function(r){var w=r.items.Location,s=i.getService("orion.git.provider");d.getDefaultSshOptions(i).then(function(u){var t=arguments.callee;s.doFetch(w,false,null,u.gitSshUsername,u.gitSshPassword,u.knownHosts,u.gitPrivateKey,u.gitPassphrase).then(function(y){d.handleProgressServiceResponse(y,u,i,function(){e.xhrGet({url:w,headers:{"Orion-Version":"1"},
postData:e.toJson({GitSshUsername:u.gitSshUsername,GitSshPassword:u.gitSshPassword,GitSshPrivateKey:u.gitPrivateKey,GitSshPassphrase:u.gitPassphrase,GitSshKnownHost:u.knownHosts}),handleAs:"json",timeout:5E3,load:function(B){return B},error:function(B,D){console.error("HTTP status code: ",D.xhr.status)}}).then(function(B){s.getLog(B.HeadLocation,B.Id,"Getting git incoming changes",function(D){n._gitCommitNavigatorRem.renderer.setIncomingCommits(D.Children);n._gitCommitNavigatorRem.loadCommitsList(B.CommitLocation+
"?page=1&pageSize=5",B,true)})})},t,"Fetch Git Repository")},function(y){d.handleProgressServiceResponse(y,u,i,function(){},t,"Fetch Git Repository")})})},visibleWhen:function(r){return r.Type==="RemoteTrackingBranch"}});j.addCommand(p,"object");j.addCommand(p,"dom");j.registerCommandContribution("eclipse.orion.git.fetch",m+1);p=new a.Command({name:"Merge",tooltip:"Merge the content from the branch to your active branch",imageClass:"git-sprite-merge",spriteClass:"gitCommandSprite",id:"eclipse.orion.git.merge",
callback:function(r){r=r.items;var w=i.getService("orion.git.provider"),s=i.getService("orion.page.message");w.doMerge(r.HeadLocation,r.Name).then(function(u){var t=[];if(u.jsonData&&(u.jsonData.Result=="FAST_FORWARD"||u.jsonData.Result=="ALREADY_UP_TO_DATE")){e.query(".treeTableRow").forEach(function(y){e.toggleClass(y,"incomingCommitsdRow",false)});t.Severity="Ok";t.HTML=false;t.Message=u.jsonData.Result;k();s.setProgressResult(t)}else if(u.jsonData){t.Severity="Warning";t.HTML=true;t.Message="<span>"+
u.jsonData.Result+"<span>";s.setProgressResult(t)}else if(u.error){t.Severity="Error";if(u.error.responseText&&JSON.parse(u.error.responseText)){u=JSON.parse(u.error.responseText);t.Message=u.DetailedMessage?u.DetailedMessage:u.Message}else t.Message=u.error.message;t.HTML=true;t.Message="<span>"+t.Message+"<span>";s.setProgressResult(t)}},function(u,t){u=[];u.Severity="Error";u.HTML=true;u.Message="<span>"+e.fromJson(t.xhr.responseText).DetailedMessage+"</span>";s.setProgressResult(u)})},visibleWhen:function(r){return r.Type===
"RemoteTrackingBranch"||r.Type==="Branch"&&!r.Current}});j.addCommand(p,"object");j.addCommand(p,"dom");j.registerCommandContribution("eclipse.orion.git.merge",m+2);p=new a.Command({name:"Push",tooltip:"Push from your local branch into the remote branch",imageClass:"git-sprite-push",spriteClass:"gitCommandSprite",id:"eclipse.orion.git.push",callback:function(r){var w=r.items,s=e.hash(),u=i.getService("orion.git.provider");if(w.RemoteLocation.length==1&&w.RemoteLocation[0].Children.length==1)d.getDefaultSshOptions(i).then(function(t){var y=
arguments.callee;u.doPush(w.RemoteLocation[0].Children[0].Location,"HEAD",true,false,null,"Pushing remote: "+s,t.gitSshUsername,t.gitSshPassword,t.knownHosts,t.gitPrivateKey,t.gitPassphrase).then(function(B){d.handleProgressServiceResponse(B,t,i,function(D){if(!D||!D.HttpCode){e.query(".treeTableRow").forEach(function(l){e.toggleClass(l,"outgoingCommitsdRow",false)});k()}},y,"Push Git Repository")},function(B){d.handleProgressServiceResponse(B,t,i,function(){},y,"Push Git Repository")})});else{r=
new orion.git.widgets.RemotePrompterDialog({title:"Choose Branch",serviceRegistry:i,gitClient:u,treeRoot:{Children:w.RemoteLocation},hideNewBranch:true,func:e.hitch(this,function(t,y){d.getDefaultSshOptions(i).then(function(B){var D=arguments.callee;u.doPush(t.Location,"HEAD",true,false,null,"Pushing remote: "+y,B.gitSshUsername,B.gitSshPassword,B.knownHosts,B.gitPrivateKey,B.gitPassphrase).then(function(l){d.handleProgressServiceResponse(l,B,i,function(o){if(!o||!o.HttpCode){e.query(".treeTableRow").forEach(function(q){e.toggleClass(q,
"outgoingCommitsdRow",false)});k()}},D,"Push Git Repository")})},function(B){d.handleProgressServiceResponse(B,options,i,function(){},func,"Pushing remote: "+y)})})});r.startup();r.show()}},visibleWhen:function(r){return r.Type==="LocalBranch"}});j.addCommand(p,"object");j.addCommand(p,"dom");j.registerCommandContribution("eclipse.orion.git.push",m+3)};d.createGitClonesCommands=function(i,j,k,m,n,p){function r(s){if(!(s.status===401||s.status===403)){var u=[];u.Severity="Error";u.HTML=false;try{var t=
JSON.parse(s.responseText);u.Message=t.DetailedMessage?t.DetailedMessage:t.Message}catch(y){u.Message=s.message}i.getService("orion.page.message").setProgressResult(u)}}function w(s){if(e.isArray(s))s=s.length>1?{}:s[0];return s}m=new a.ParametersDescription([new a.CommandParameter("key","text","Key:"),new a.CommandParameter("value","text","Value:")],false);m=new a.Command({name:"New Configuration Entry",tooltip:"Add a new entry to the repository configuration",imageClass:"core-sprite-add",id:"eclipse.orion.git.addConfigEntryCommand",
parameters:m,callback:function(s){var u=s.items,t=i.getService("orion.git.provider");s.parameters.valueFor("key")&&s.parameters.valueFor("value")&&t.addCloneConfigurationProperty(u.ConfigLocation,s.parameters.valueFor("key"),s.parameters.valueFor("value")).then(function(){e.hitch(k,k.changedItem)(u)},r)}});j.addCommand(m,"dom");m=new a.ParametersDescription([new a.CommandParameter("value","text","Value:")],false);m=new a.Command({name:"Edit",tooltip:"Edit the configuration entry",imageClass:"core-sprite-edit",
id:"eclipse.orion.git.editConfigEntryCommand",parameters:m,callback:function(s){var u=s.items,t=i.getService("orion.git.provider");s.parameters.valueFor("value")&&t.editCloneConfigurationProperty(u.Location,s.parameters.valueFor("value")).then(function(){e.hitch(k,k.changedItem)(u)},r)},visibleWhen:function(s){return s.Key&&s.Value&&s.Location}});j.addCommand(m,"object");m=new a.Command({name:"Delete",tooltip:"Delete the configuration entry",imageClass:"core-sprite-delete",id:"eclipse.orion.git.deleteConfigEntryCommand",
callback:e.hitch(this,function(s){var u=s.items;s=i.getService("orion.git.provider");confirm("Are you sure you want to delete "+u.Key+"?")&&s.deleteCloneConfigurationProperty(u.Location).then(function(){e.hitch(k,k.changedItem)(u)},r)}),visibleWhen:function(s){return s.Key&&s.Value&&s.Location}});j.addCommand(m,"object");m=new a.ParametersDescription([new a.CommandParameter("url","url","Repository URL:")],true);m=new a.Command({name:"Clone Repository",tooltip:"Clone an existing Git repository to a folder",
id:"eclipse.cloneGitRepository",parameters:m,callback:function(s){var u=i.getService("orion.git.provider"),t=function(y,B,D){d.getDefaultSshOptions(i).then(function(l){var o=arguments.callee;u.cloneGitRepository(D,y,B,k.defaultPath,l.gitSshUsername,l.gitSshPassword,l.knownHosts,l.gitPrivateKey,l.gitPassphrase).then(function(q){d.handleProgressServiceResponse(q,l,i,function(){k.redisplayClonesList&&e.hitch(k,k.redisplayClonesList)()},o,"Clone Git Repository")},function(q){d.handleProgressServiceResponse(q,
l,i,function(){},o,"Clone Git Repository")})})};if(s.parameters.valueFor("url")&&!s.parameters.optionsRequested)t(s.parameters.valueFor("url"));else{s=new orion.git.widgets.CloneGitRepositoryDialog({serviceRegistry:i,fileClient:p,url:s.parameters.valueFor("url"),alwaysShowAdvanced:s.parameters.optionsRequested,func:t});s.startup();s.show()}},visibleWhen:function(){return true}});j.addCommand(m,"dom");m=new a.ParametersDescription([new a.CommandParameter("folderName","text","New folder:")],true);m=
new a.Command({name:"Init Repository",tooltip:"Create a new Git repository in a new folder",id:"eclipse.initGitRepository",parameters:m,callback:function(s){var u=i.getService("orion.git.provider"),t=function(y,B,D){d.getDefaultSshOptions(i).then(function(l){var o=arguments.callee;u.cloneGitRepository(D,y,B,k.defaultPath).then(function(q){d.handleProgressServiceResponse(q,l,i,function(){k.redisplayClonesList&&e.hitch(k,k.redisplayClonesList)()},o,"Init Git Repository")},function(q){d.handleProgressServiceResponse(q,
l,i,function(){},o,"Init Git Repository")})})};if(s.parameters.valueFor("folderName")&&!s.parameters.optionsRequested)t(null,null,s.parameters.valueFor("folderName"));else{s=new orion.git.widgets.CloneGitRepositoryDialog({serviceRegistry:i,title:"Init Git Repository",fileClient:p,advancedOnly:true,func:t});s.startup();s.show()}},visibleWhen:function(){return true}});j.addCommand(m,"dom");m=new a.Command({name:"Delete",tooltip:"Delete the repository",imageClass:"core-sprite-delete",id:"eclipse.git.deleteClone",
visibleWhen:function(s){s=e.isArray(s)?s:[s];if(s.length===0)return false;for(var u=0;u<s.length;u++)if(!s[u].ContentLocation)return false;return true},callback:function(s){var u=s.items;s=i.getService("orion.git.provider");if(e.isArray(u)){if(confirm("Are you sure you want do delete "+u.length+" repositories?"))for(var t=0,y=0;y<u.length;y++)s.removeGitRepository(u[y].Location).then(function(){t++;t>=u.length&&k.redisplayClonesList&&e.hitch(k,k.redisplayClonesList)()},r)}else confirm("Are you sure you want to delete "+
u.Name+"?")&&s.removeGitRepository(u.Location).then(function(){k.redisplayClonesList&&e.hitch(k,k.redisplayClonesList)()},this.displayErrorOnStatus)}});j.addCommand(m,"object");j.addCommand(m,"dom");m=new a.Command({name:"Apply Patch",tooltip:"Apply a patch on the selected repository",id:"eclipse.orion.git.applyPatch",imageClass:"git-sprite-apply_patch",spriteClass:"gitCommandSprite",callback:function(s){s=w(s.items);s=new orion.git.widgets.ApplyPatchDialog({title:"Apply Patch",diffLocation:s.DiffLocation});
s.startup();s.show()},visibleWhen:function(s){return s.Type==="Clone"}});j.addCommand(m,"object");m=new a.ParametersDescription([new a.CommandParameter("commitName","text","Commit name:")],true);m=new a.Command({name:"Open Commit",tooltip:"Open the commit with the given name",id:"eclipse.orion.git.openCommitCommand",imageClass:"git-sprite-apply_patch",spriteClass:"gitCommandSprite",parameters:m,callback:function(s){var u=function(B,D,l){if(l==null)l=new e.Deferred;B.length>0?i.getService("orion.git.provider").doGitLog("/gitapi/commit/"+
s.parameters.valueFor("commitName")+B[0].ContentLocation+"?page=1&pageSize=1",null,null,"Looking for the commit").then(function(o){l.callback(o.Children[0].Location)},function(){u(B.slice(1),D,l)}):l.errback();return l},t=function(B){if(s.parameters.optionsRequested)(new orion.git.widgets.OpenCommitDialog({repositories:B,serviceRegistry:i,commitName:s.parameters.valueFor("commitName")})).show();else{i.getService("orion.page.message").setProgressMessage("Looking for the commit");u(B,s.parameters.valueFor("commitName")).then(function(D){D!==
null&&window.open("/git/git-commit.html#"+D+"?page=1&pageSize=1")},function(){var D=[];D.Severity="warning";D.HTML=false;D.Message="No commits found";i.getService("orion.page.message").setProgressResult(D)})}};if(s.items.Type==="Clone"){var y=[s.items];t(y)}else if(s.items.CloneLocation)i.getService("orion.git.provider").getGitClone(s.items.CloneLocation).then(function(B){t(B.Children)});else{y=s.items;t(y)}},visibleWhen:function(s){return s.Type==="Clone"||s.CloneLocation||s.length>1&&s[0].Type===
"Clone"}});j.addCommand(m,"dom");m=new a.Command({name:"Show in GitHub",tooltip:"Show this repository at GitHub",id:"orion.git.gotoGithub",hrefCallback:function(s){s=/github\.com.*\.git/.exec(s.items.GitUrl)[0];s=s.replace(":","/");return"https://"+s.substring(0,s.length-4)},visibleWhen:function(s){return s.GitUrl&&/github\.com.*\.git/.exec(s.GitUrl)}});j.addCommand(m,"dom");m=new a.Command({name:"Show in eclipse.org",tooltip:"Show this repository at eclipse.org",id:"orion.git.gotoEclipseGit",hrefCallback:function(s){s=
s.items;var u=s.GitUrl.indexOf("git.eclipse.org/gitroot");if(u>-1)return"http://git.eclipse.org/c"+s.GitUrl.substr(u+23,s.GitUrl.length)},visibleWhen:function(s){return s.GitUrl&&s.GitUrl.indexOf("git.eclipse.org/gitroot")>-1}});j.addCommand(m,"dom")}})();return d});
define("orion/git/widgets/CommitTooltipDialog",["require","dojo","dijit","orion/util","dijit/TooltipDialog"],function(f,e,a){e.declare("orion.git.widgets.CommitTooltipDialog",[a.TooltipDialog],{widgetsInTemplate:false,closable:true,constructor:function(){this.inherited(arguments);this.options=arguments[0]||{}},postCreate:function(){this.inherited(arguments);this.displayCommit(this.options.commit)},displayCommit:function(c){var d=e.create("div",{style:"padding:10px; max-width:480px"},this.containerNode),
g=c.Message.split(/(\r?\n|$)/)[0];link=e.create("a",{"class":"gitMainDescription",href:"/git/git-commit.html#"+c.Location+"?page=1&pageSize=1"},d);e.place(document.createTextNode(g),link);e.create("div",{style:"padding-top:15px"},d);e.create("span",{"class":"gitSecondaryDescription",innerHTML:" commit: "+c.Name},d);if(c.Parents&&c.Parents.length>0){e.create("div",null,d);e.place(document.createTextNode("parent: "),d);link=e.create("a",{"class":"gitSecondaryDescription",href:"/git/git-commit.html#"+
c.Parents[0].Location+"?page=1&pageSize=1"},d);e.place(document.createTextNode(c.Parents[0].Name),link)}e.create("div",{style:"padding-top:15px"},d);if(c.AuthorImage){g=e.create("div",{"class":"git-author-icon-small",style:"margin-bottom:30px"},d);var h=new Image;h.src=c.AuthorImage;h.name=c.AuthorName;h.width=35;h.height=35;e.place(h,g,"first")}e.create("span",{"class":"gitSecondaryDescription",innerHTML:" authored by "+c.AuthorName+" ("+c.AuthorEmail+") on "+e.date.locale.format(new Date(c.Time),
{formatLength:"short"})},d);e.create("div",null,d);e.create("span",{"class":"gitSecondaryDescription",innerHTML:"committed by "+c.CommitterName+" ("+c.CommitterEmail+")"},d)},_onBlur:function(){this.inherited(arguments);a.popup.hide&&a.popup.hide(this);a.popup.close(this)}})});
define("orion/git/git-commit-navigator",["dojo","orion/explorer","orion/util","orion/git/gitCommands","orion/git/widgets/CommitTooltipDialog"],function(f,e,a,c){var d={};d.GitCommitNavigator=function(){function g(h,i,j,k,m,n,p,r){this.registry=h;this.selection=i;this.checkbox=j!=null?j.checkbox:true;this.minimal=j!=null?j.minimal:false;this.parentId=k;this.pageTitleId=m;this.toolbarId=n;this.pageNavId=r;this.selectionToolsId=p;this.isDirectory=true;this.myTree=this.model=null;this.renderer=new d.GitCommitRenderer({cachePrefix:"GitCommitsNavigator",
minimal:this.minimal},this)}g.prototype=new e.Explorer;g.prototype.loadCommitsList=function(h,i,j){var k=new f.Deferred;this.renderer._useCheckboxSelection=!this.isDirectory&&this.checkbox;h=a.makeRelative(h);if(h===this._lastHash&&!j){k.callback();return k}this._lastHash=h;this._lastTreeRoot=i;var m=f.byId(this.parentId);(j=f.byId(m.id+"progress"))||(j=f.create("div",{id:m.id+"progress"},m,"only"));f.empty(j);if(i.status&&i.status!=200){h=i.message;try{var n=JSON.parse(i.responseText);if(n.Message)h=
n.Message}catch(p){}i.status!=404&&h!==""&&f.create("b",{innerHTML:"Error "+i.status+": "},j,"only");f.place(document.createTextNode(h),j,"last");this.toolbarId&&this.selectionToolsId&&c.updateNavTools(this.registry,this,this.toolbarId,this.selectionToolsId,i,this.pageNavId);k.callback();return k}b=f.create("b");f.place(document.createTextNode("Loading "),j,"last");f.place(document.createTextNode(h),b,"last");f.place(b,j,"last");f.place(document.createTextNode("..."),j,"last");this.toolbarId&&this.selectionToolsId&&
c.updateNavTools(this.registry,this,this.toolbarId,this.selectionToolsId,i,this.pageNavId);var r=this.registry.getService("orion.git.provider");n=function(w,s){var u=new f.Deferred;r.doGitLog(w,function(t){k.callback();s?s(t.Children):u.callback(t.Children)});return u};if(i.Children){this.createTree(this.parentId,new e.ExplorerFlatModel(h,n,i.Children));k.callback()}else this.createTree(this.parentId,new e.ExplorerFlatModel(h,n));return k};return g}();d.GitCommitRenderer=function(){function g(h,i){this._init(h);
this.options=h;this.explorer=i}g.prototype=new e.SelectionRenderer;g.prototype.getCellHeaderElement=function(h){if(!this.options.minimal)switch(h){case 0:return f.create("th",{style:"padding-left: 5px; padding-right: 5px",innerHTML:"<h2>Message</h2>"});case 1:return f.create("th",{style:"padding-left: 5px; padding-right: 5px",innerHTML:"<h2>Author</h2>"});case 2:return f.create("th",{style:"padding-left: 5px; padding-right: 5px",innerHTML:"<h2>Date</h2>"});case 3:return f.create("th",{style:"padding-left: 5px; padding-right: 5px",
innerHTML:"<h2>Actions</h2>"});case 4:return f.create("th",{style:"padding-left: 5px; padding-right: 5px",innerHTML:"<h2>Branches</h2>"});case 5:return f.create("th",{style:"padding-left: 5px; padding-right: 5px",innerHTML:"<h2>Tags</h2>"})}};g.prototype.setIncomingCommits=function(h){this.incomingCommits=h};g.prototype.setOutgoingCommits=function(h){this.outgoingCommits=h};g.prototype.getCellElement=function(h,i,j){var k=false;f.forEach(this.incomingCommits,function(u){if(i.Name===u.Name)k=true});
var m=false;f.forEach(this.outgoingCommits,function(u){if(i.Name===u.Name)m=true});switch(h){case 0:var n,p;h=document.createElement("td");n=f.create("div",{style:"margin-left: 5px; margin-right: 5px; margin-top: 5px; margin-bottom: 5px; padding-left: 20px;"},h,"only");p=f.create("a",{className:"navlink",href:"/git/git-commit.html#"+i.Location+"?page=1&pageSize=1"},n,"last");f.place(document.createTextNode(i.Message),p,"only");var r,w=new orion.git.widgets.CommitTooltipDialog({commit:i,onMouseLeave:function(){dijit.popup.hide&&
dijit.popup.hide(w);dijit.popup.close(w)},onMouseEnter:function(){clearTimeout(r)}});f.connect(p,"onmouseover",p,function(){clearTimeout(r);r=setTimeout(function(){dijit.popup.open({popup:w,around:p,orient:{BR:"TL",TR:"BL"}})},600)});f.connect(p,"onmouseout",p,function(){clearTimeout(r);r=setTimeout(function(){dijit.popup.hide&&dijit.popup.hide(w);dijit.popup.close(w)},200)});if(k)f.toggleClass(j,"incomingCommitsdRow",true);else m&&f.toggleClass(j,"outgoingCommitsdRow",true);return h;case 1:return f.create("td",
{style:"padding-left: 5px; padding-right: 5px",innerHTML:i.AuthorName+" ("+i.AuthorEmail+")"});case 2:return f.create("td",{style:"padding-left: 5px; padding-right: 5px",innerHTML:f.date.locale.format(new Date(i.Time),{formatLength:"short"})});case 3:if(this.options.minimal)break;j=this.getActionsColumn(i,j);f.style(j,"padding-left","5px");f.style(j,"padding-right","5px");return j;case 4:if(this.options.minimal)break;var s=document.createElement("td",{style:"padding-left: 5px; padding-right: 5px"});
f.forEach(i.Branches,function(u){f.place(document.createTextNode(u.FullName),f.create("p",{style:"margin: 5px"},s,"last"),"only")});return s;case 5:if(this.options.minimal)break;s=document.createElement("td",{style:"padding-left: 5px; padding-right: 5px"});f.forEach(i.Tags,function(u){f.place(document.createTextNode(u.Name),f.create("p",{style:"margin: 5px"},s,"last"),"only")});return s}};return g}();return d});
define("orion/git/git-status-table",["require","dojo","orion/compare/compare-container","orion/commands","orion/globalCommands","orion/git/git-commit-navigator","orion/git/gitCommands","orion/util","dijit/layout/ContentPane"],function(f,e,a,c,d,g,h,i){var j=j||{};j.GitStatusModel=function(){function k(){this.selectedItem=this.selectedFileId=undefined;this.interestedUnstagedGroup=["Missing","Modified","Untracked","Conflicting"];this.interestedStagedGroup=["Added","Changed","Removed"];this.conflictPatterns=
[["Both","Modified","Added","Changed","Missing"],["RemoteDelete","Untracked","Removed"],["LocalDelete","Modified","Added","Missing"]];this.conflictType="Conflicting"}k.prototype={destroy:function(){},interestedCategory:function(){},init:function(m){this.items=m},getModelType:function(m,n){return n},_markConflict:function(m){var n=this.getGroupData(m[1]);if(n)for(var p=0;p<n.length;p++)if(!n[p].Conflicting){for(var r=n[p].Location,w=[],s=2;s<m.length;s++){var u=this.getGroupData(m[s]);if(u)(u=this._findSameFile(r,
u))&&w.push(u)}if(w.length===m.length-2){n[p].Conflicting=m[0];for(r=0;r<w.length;r++)w[r].Conflicting="Hide"}}},_findSameFile:function(m,n){for(var p=0;p<n.length;p++)if(!n[p].Conflicting)if(m===n[p].Location)return n[p]},getGroupData:function(m){return this.items[m]},isConflict:function(m){return m===this.conflictType},isStaged:function(m){for(var n=0;n<this.interestedStagedGroup.length;n++)if(m===this.interestedStagedGroup[n])return true;return false}};return k}();j.statusTypeMap={Missing:[f.toUrl("git/images/removal.gif"),
"Unstaged removal",f.toUrl("git/images/stage.gif"),"Stage"],Removed:[f.toUrl("git/images/removal.gif"),"Staged removal",f.toUrl("git/images/unstage.gif"),"Unstage"],Modified:[f.toUrl("git/images/modification.gif"),"Unstaged change",f.toUrl("git/images/stage.gif"),"Stage"],Changed:[f.toUrl("git/images/modification.gif"),"Staged change",f.toUrl("git/images/unstage.gif"),"Unstage"],Untracked:[f.toUrl("git/images/addition.gif"),"Unstaged add",f.toUrl("git/images/stage.gif"),"Stage"],Added:[f.toUrl("git/images/addition.gif"),
"Staged add",f.toUrl("git/images/unstage.gif"),"Unstage"],Conflicting:[f.toUrl("git/images/conflict-file.gif"),"Conflicting",f.toUrl("git/images/stage.gif"),"Resolve Conflict"]};j.GitStatusContentRenderer=function(){function k(m,n,p,r){this._registry=n;this._useCheckboxSelection=m.useCheckBox===undefined?false:m.useCheckBox;this._tableParentDivId=p;this._controller=r}k.prototype={initTable:function(){tableId=this._tableParentDivId+"_table";var m=e.byId(this._tableParentDivId);e.place(document.createTextNode(""),
m,"only");var n=e.create("table",{id:tableId});e.addClass(n,"statusTable");m.appendChild(n);this._table=n},getSelected:function(){var m=[];e.query(".selectionCheckmark"+this._tableParentDivId).forEach(e.hitch(this,function(n){if(n.checked){n=n.parentNode.parentNode;m.push({rowId:n.id,modelItem:n._item})}}));return m},toggleSelectAll:function(m){e.query(".selectionCheckmark"+this._tableParentDivId).forEach(e.hitch(this,function(n){n.checked=m;e.toggleClass(n.parentNode.parentNode,"checkedRow",!!m)}));
return[]},getCheckboxColumn:function(m){if(this._useCheckboxSelection){var n=document.createElement("td");e.addClass(n,"secondaryColumn");var p=e.create("input",{type:"checkbox",id:m.id+"selectedState"});e.addClass(p,"selectionCheckmark"+this._tableParentDivId);e.addClass(p,"statusCheckBoxRow");p.itemId=m.id;n.appendChild(p);e.connect(p,"onclick",e.hitch(this,function(r){e.toggleClass(m,"checkedRow",!!r.target.checked);this._controller._unstagedTableRenderer.renderAction();this._controller._stagedTableRenderer.renderAction();
this._controller._stagedTableRenderer.updateCheckbox();this._controller._unstagedTableRenderer.updateCheckbox()}));return n}return null},renderRow:function(m,n){var p=this,r=document.createElement("tr");r.id=m.name+"_"+m.type+"_row";r._item=m;n%2?e.addClass(r,"darkTreeTableRow"):e.addClass(r,"lightTreeTableRow");this._table.appendChild(r);this._useCheckboxSelection&&r.appendChild(this.getCheckboxColumn(r));n=document.createElement("td");var w=document.createElement("img");w.src=j.statusTypeMap[m.type][0];
e.style(w,"verticalAlign","middle");n.appendChild(w);r.appendChild(n);n=document.createElement("td");n.noWrap=true;r.appendChild(n);var s=document.createElement("span");e.style(s,"verticalAlign","middle");s.id=r.id+"_nameSpan";e.place(document.createTextNode(m.name),s,"only");e.style(s,"color","#0000FF");s.title="Click to compare";n.appendChild(s);if(s.id===p._controller._model.selectedFileId){p._controller._model.selectedItem=m;e.toggleClass(s,"fileNameSelectedRow",true)}e.connect(s,"onmouseover",
s,function(){s.style.cursor=p._controller.loading?"wait":"pointer";e.toggleClass(s,"fileNameCheckedRow",true)});e.connect(s,"onmouseout",s,function(){s.style.cursor=p._controller.loading?"wait":"default";e.toggleClass(s,"fileNameCheckedRow",false)});e.connect(s,"onclick",s,function(){if(m.name!==p._controller._model.selectedFileId){if(p._controller._model.selectedFileId!==undefined){var u=document.getElementById(p._controller._model.selectedFileId);u&&e.toggleClass(u,"fileNameSelectedRow",false)}e.toggleClass(s,
"fileNameSelectedRow",true);p._controller._model.selectedFileId=s.id;p._controller.loadDiffContent(m)}});n=e.create("td",{id:r.id+"actionswrapper"},r,"last");e.addClass(n,"statusAction");n.noWrap=true;n=e.create("span",{id:r.id+"actionsWrapper"},n,"only");this._registry.getService("orion.page.command").renderCommands(n,"object",{type:"fileItem",object:m,rowId:r.id},this,"tool");this._registry.getService("orion.page.command").renderCommands(n,"object",m,this,"tool");if(this._controller._model.isStaged(m.type))this._controller.hasStaged=
true;else this._controller.hasUnstaged=true}};return k}();j.GitStatusTableRenderer=function(){function k(m,n,p,r,w){this._registry=n;this._parentId=p;this._header=r;this._useCheckboxSelection=m.useCheckBox===undefined?false:m.useCheckBox;this._type=w}k.prototype={render:function(){var m=i.createPaneHeading(this._parentId,this._type+"heading",this._header,true,this._type+"_header",this._type+"commands");e.addClass(m,"paneHeadingFixed");m=e.create("input",{type:"checkbox"},this._type+"_header","after");
e.addClass(m,"statusCheckBoxOverall");this.checkBox=m;e.connect(m,"onclick",e.hitch(this,function(p){this.contentRenderer.toggleSelectAll(p.target.checked);this.renderAction()}));var n=e.byId(this._type+"commands");m=this._type+"commandSpan";this._cmdSpan=e.create("span",{id:m},n,"last");n=this._registry.getService("orion.page.command");if(this._type==="stagedItems"){n.registerCommandContribution("orion.gitUnstage",1,m);n.registerCommandContribution("orion.gitUnstageAll",2,m)}else{n.registerCommandContribution("orion.gitStage",
1,m);n.registerCommandContribution("orion.gitCheckout",2,m);n.registerCommandContribution("orion.gitStageAll",3,m);n.registerCommandContribution("orion.gitCheckoutAll",4,m);n.registerCommandContribution("orion.gitSavePatch",5,m)}e.addClass(this._cmdSpan,"paneHeadingCommands");this._statusContentId=this._parentId+"_"+this._type;e.create("div",{id:this._statusContentId},this._parentId,"last")},select:function(m){this.checkBox.checked=m},disable:function(m){this.checkBox.disabled=m},updateCheckbox:function(){if(this.contentRenderer.totalRow!==
0)this.contentRenderer.totalRow===this.contentRenderer.getSelected().length?this.select(true):this.select(false)},getStatusContentId:function(){return this._statusContentId},renderAction:function(){e.place(document.createTextNode(""),this._cmdSpan,"only");this._registry.getService("orion.page.command").renderCommands(this._cmdSpan,"dom",{type:this._type},this,"button")}};return k}();j.GitCommitZoneRenderer=function(){function k(m,n){this._registry=m;this._parentId=n}k.prototype={render:function(){this._commitZone=
e.create("div",null,this._parentId,"last");var m=e.create("div",null,this._commitZone);e.addClass(m,"auxpaneHeading paneHeadingFixed");e.create("span",{innerHTML:"Commit message"},m);m=e.create("table",null,this._commitZone);m=e.create("tr",null,m);var n=e.create("td",{nowrap:true},m,"last");n=e.create("textarea",{id:"commitMessage",ROWS:6},n,"last");e.addClass(n,"pane");m=e.create("td",{nowrap:true},m,"last");m=e.create("div",{style:"float: left;",align:"left"},m,"last");m=e.create("table",null,
m);n=e.create("tr",null,m);n=e.create("td",{nowrap:true},n,"last");e.create("button",{id:"commit",innerHTML:"Commit",title:"Record changes in the active branch"},n,"last");e.create("tr",{width:"100%",height:"20px"},m);m=e.create("tr",null,m);m=e.create("td",{nowrap:true},m,"last");e.create("input",{id:"amend",type:"checkbox",value:"Amend",title:"Amend last commit"},m,"last");m.appendChild(document.createTextNode(" Amend"))},show:function(){this._commitZone.style.display=""},hide:function(){this._commitZone.style.display=
"none"}};return k}();j.GitRebaseZoneRenderer=function(){function k(m,n){this._registry=m;this._parentId=n}k.prototype={render:function(m){this._rebaseZone=e.create("div",null,this._parentId,"last");var n=e.create("table",{width:"100%"},this._rebaseZone);n=e.create("tr",null,n);n=e.create("td",{nowrap:true},n,"last");e.create("h2",{innerHTML:"Rebase in progress. Choose action:"},n,"last");n=e.create("table",null,this._rebaseZone);n=e.create("tr",null,n);n=e.create("td",{nowrap:true},n,"last");n=e.create("div",
{style:"float: left;",align:"left"},n,"last");this._cmdSpan=e.create("span",{id:"rebaseActions"},n,"last");m&&e.create("table",{width:"100%",height:"10px"},this._rebaseZone)},renderAction:function(){e.place(document.createTextNode(""),this._cmdSpan,"only");this._registry.getService("orion.page.command").renderCommands(this._cmdSpan,"dom",{type:"rebase"},this,"button")},show:function(){this._rebaseZone.style.display=""},hide:function(){this._rebaseZone.style.display="none"}};return k}();j.GitCommitterAndAuthorZoneRenderer=
function(){function k(m,n){this._registry=m;this._parentId=n}k.prototype={render:function(m){this._cmdSpanShow=e.create("span",{id:"personIdentShow"},this._parentId,"last");this._cmdSpanHide=e.create("span",{id:"personIdentHide"},this._parentId,"last");this._personIdentZone=e.create("div",null,this._parentId,"last");var n=e.create("table",null,this._personIdentZone),p=e.create("tr",null,n),r=e.create("td",{nowrap:true},p,"last");e.create("h2",{innerHTML:"Committer name:"},r,"last");r=e.create("td",
{nowrap:true},p,"last");this._committerName=e.create("input",{id:"committerName",type:"text"},r,"last");r=e.create("td",{nowrap:true},p,"last");e.create("h2",{innerHTML:"email:"},r,"last");p=e.create("td",{nowrap:true},p,"last");this._committerEmail=e.create("input",{id:"committerEmail",type:"text"},p,"last");n=e.create("tr",null,n);r=e.create("td",{nowrap:true},n,"last");e.create("h2",{innerHTML:"Author name:\t"},r,"last");r=e.create("td",{nowrap:true},n,"last");this._authorName=e.create("input",
{id:"authorName",type:"text"},r,"last");r=e.create("td",{nowrap:true},n,"last");e.create("h2",{innerHTML:"email:"},r,"last");p=e.create("td",{nowrap:true},n,"last");this._authorEmail=e.create("input",{id:"authorEmail",type:"text"},p,"last");m&&e.create("table",{width:"100%",height:"10px"},this._parentId)},renderAction:function(){e.place(document.createTextNode(""),this._cmdSpanShow,"only");e.place(document.createTextNode(""),this._cmdSpanHide,"only");var m=this._registry.getService("orion.page.command");
m.renderCommands(this._cmdSpanShow,"dom",{type:"personIdentShow"},this,"button");m.renderCommands(this._cmdSpanHide,"dom",{type:"personIdentHide"},this,"button")},setDefaultPersonIdent:function(m,n){this._defName=m;this._defEmail=n},show:function(){this._personIdentZone.style.display="";this._cmdSpanHide.style.display="";this._cmdSpanShow.style.display="none"},hide:function(){this._personIdentZone.style.display="none";this._cmdSpanHide.style.display="none";this._cmdSpanShow.style.display="";this.resetCommitterAndAuthor()},
resetCommitterAndAuthor:function(){this._committerName.value=this._defName;this._committerEmail.value=this._defEmail;this._authorName.value=this._defName;this._authorEmail.value=this._defEmail}};return k}();j.GitLogTableRenderer=function(){function k(m,n,p,r,w){this._controller=m;this._registry=n;this._parentId=p;this._header=r;this._type=w;this._sectionId=this._parentId+"_"+this._type+"_section"}k.prototype={render:function(){var m=e.create("div",{id:this._sectionId},this._parentId),n=i.createPaneHeading(m,
this._type+"heading",this._header,true,this._type+"_header",this._type+"commands");e.addClass(n,"paneHeadingFixed");n=this._type+"commandSpanAdditional";this._cmdSpanAdditional=e.create("span",{id:n},this._type+"commands","last");e.addClass(this._cmdSpanAdditional,"statusLogCmd paneHeadingCommands");var p=this._type+"commandSpan";this._cmdSpan=e.create("span",{id:p},this._type+"commands","last");var r=this._registry.getService("orion.page.command");if(this._type==="gitRemote"){r.registerCommandContribution("orion.openGitRemote",
1,p);r.registerCommandContribution("eclipse.orion.git.fetch",2,n);r.registerCommandContribution("eclipse.orion.git.merge",3,n)}else{r.registerCommandContribution("orion.openGitLog",1,p);r.registerCommandContribution("eclipse.orion.git.push",2,n)}e.addClass(this._cmdSpan,"statusLogCmd paneHeadingCommands");this._logContentId=this._parentId+"_"+this._type+"_content";m=e.create("div",{id:this._logContentId},m,"last");e.addClass(m,"statusLogContent")},getLogContentId:function(){return this._logContentId},
getLogSectionId:function(){return this._sectionId},modifyHeader:function(m){e.byId(this._type+"_header")&&e.place(document.createTextNode("Recent commits on "+m),this._type+"_header","only")},renderAction:function(){e.place(document.createTextNode(""),this._cmdSpan,"only");this._registry.getService("orion.page.command").renderCommands(this._cmdSpan,"dom",{type:this._type,model:this._controller._model,branch:this._controller._curBranch},this,"button")},renderAdditionalAction:function(m){e.place(document.createTextNode(""),
this._cmdSpanAdditional,"only");this._registry.getService("orion.page.command").renderCommands(this._cmdSpanAdditional,"dom",m,this,"button")}};return k}();j.InlineCompareRenderer=function(){function k(m,n){this._registry=m;this._parentId=n}k.prototype={render:function(m){var n=e.create("table",{width:"100%"}),p=e.create("tr",null,n),r=e.create("td",{nowrap:true},p,"last");e.create("h2",{id:"fileNameInViewer",innerHTML:"Select a file on the left to compare..."},r,"last");r=new dijit.layout.ContentPane({region:"top"});
e.addClass(r.domNode,"inlineCompareTitle");r.attr("content",n);var w=new dijit.layout.ContentPane({"class":"mainpane",id:"inline-compare-viewer",splitter:false,region:"center"});e.addClass(w.domNode,"mainpane");e.addClass(w.domNode,"inlineCompareContent");var s=dijit.byId(this._parentId);s.addChild(r);s.addChild(w);if(m){td=document.createElement("td");td.id="compare_rightContainerCommands";p.appendChild(td);td.noWrap=true;p.align="right";n.align="right"}}};return k}();j.GitStatusController=function(){function k(m,
n,p,r){this._registry=n;this._commandService=p;this._statusService=r;this._model=new j.GitStatusModel;this._timerOn=false;this._renderLog=m.renderLog?true:false;this._generateCommands();this._unstagedTableRenderer=new j.GitStatusTableRenderer({useCheckBox:true},n,"statusZone","Unstaged","unstagedItems");this._unstagedTableRenderer.render(true);this._stagedTableRenderer=new j.GitStatusTableRenderer({useCheckBox:true},n,"statusZone","Staged","stagedItems");this._stagedTableRenderer.render(true);this._commitZoneRenderer=
new j.GitCommitZoneRenderer(n,"statusZone");this._commitZoneRenderer.render(true);this._rebaseZoneRenderer=new j.GitRebaseZoneRenderer(n,"statusZone");this._rebaseZoneRenderer.render(true);this._committerAndAuthorZoneRenderer=new j.GitCommitterAndAuthorZoneRenderer(n,"statusZone");this._committerAndAuthorZoneRenderer.render(true);if(this._renderLog){this._logTableRenderer=new j.GitLogTableRenderer(this,n,"logZone","Recent commits on","gitLog");this._logTableRenderer.render(true);this._logTableRenderer.renderAction();
this._remoteTableRenderer=new j.GitLogTableRenderer(this,n,"logZone","Recent commits on","gitRemote");this._remoteTableRenderer.render(true);this._remoteTableRenderer.renderAction()}(new j.InlineCompareRenderer(n,"viewerZone")).render(true);this._generateInlineCompareCmds();this._unstagedContentRenderer=new j.GitStatusContentRenderer({useCheckBox:true},n,this._unstagedTableRenderer.getStatusContentId(),this);this._unstagedTableRenderer.contentRenderer=this._unstagedContentRenderer;this._stagedContentRenderer=
new j.GitStatusContentRenderer({useCheckBox:true},n,this._stagedTableRenderer.getStatusContentId(),this);this._stagedTableRenderer.contentRenderer=this._stagedContentRenderer;var w=this;m={readonly:true,diffProvider:new a.DefaultDiffProvider(n)};this._inlineCompareContainer=new a.InlineCompareContainer(n,"inline-compare-viewer",m);w._staging=false;w._stagingConflict=false;this.startTimer();document.getElementById("commit").onclick=function(){w.commit()}}k.prototype={loadStatus:function(m){this._staging=
false;this._model.init(m);this._getCloneInfo()},_processStatus:function(){this.initViewer();this._model.selectedFileId=null;this._loadBlock(this._unstagedContentRenderer,this._model.interestedUnstagedGroup);this._loadBlock(this._stagedContentRenderer,this._model.interestedStagedGroup);this._stagedTableRenderer.disable(!this.hasStaged);this._unstagedTableRenderer.disable(!this.hasUnstaged);if(this._renderLog&&this._initializing){var m=this,n=this._registry.getService("orion.page.command");h.createStatusCommands(m._registry,
n,function(){m.getGitStatus(m._url,true)},9,m);this._renderLogs(false).then(function(){m._renderLogs(true)})}this._committerAndAuthorZoneRenderer.renderAction();this._unstagedTableRenderer.renderAction();this._stagedTableRenderer.renderAction();this._renderGlobalActions();if(this._stagingConflict){this._stagingConflict=false;this.hasStaged||this.commit("Resolved deletion conflicts on file "+this._stagingName,false)}this._statusService.setProgressMessage("");if(this._model.items.RepositoryState.indexOf("REBASING")!=
-1){this.rebaseState=true;this._rebaseZoneRenderer.renderAction();this._rebaseZoneRenderer.show();this._commitZoneRenderer.hide()}else{this.rebaseState=false;this._commitZoneRenderer.show();this._rebaseZoneRenderer.hide()}},_commitReady:function(){var m=document.getElementById("amend");return this.hasStaged?true:m.checked?true:false},_prepareStage:function(m,n){this._staging=true;if(n)for(n=0;n<m.length;n++)e.style(m[n].rowId+"_nameSpan","color","#666666");else e.style(m+"_nameSpan","color","#666666")},
_renderGlobalActions:function(){var m=e.byId("pageActions");e.place(document.createTextNode(""),m,"only");this._registry.getService("orion.page.command").renderCommands(m,"dom",{type:"global"},this,"button",true)},_processCloneInfo:function(){e.byId("logZone").style.display="block";this._curBranch=undefined;for(var m=0;m<this._branchInfo.Children.length;m++)if(this._branchInfo.Children[m].Current)this._curBranch=this._branchInfo.Children[m];this._curRemote=this._remoteInfo&&this._remoteInfo.Children&&
this._remoteInfo.Children.length>0?this._remoteInfo.Children[0]:null;this._curClone=this._cloneInfo.Children[0];d.setPageTarget(this._curClone,this._registry,this._commandService,e.hitch(this._curBranch||this._curRemote,function(){return this}));this._initTitleBar(true);this._logTableRenderer.renderAction();this._remoteTableRenderer.renderAction();this._committerAndAuthorZoneRenderer.setDefaultPersonIdent(this._userName,this._userEmail);this._committerAndAuthorZoneRenderer.hide()},_initTitleBar:function(m){var n=
"",p=this._curBranch?this._curBranch.Name:"detached";if(m)n=this._curClone.Name+" on "+p;document.title=n;e.place(document.createTextNode("Git Status"),"pageTitle","only");if(m){this._logTableRenderer.modifyHeader(p);if(this._curBranch&&this._curRemote){p=(this._curBranch.RemoteLocation.length>0?this._curBranch.RemoteLocation[0].Name:"")+"/"+this._curBranch.Name;this._remoteTableRenderer.modifyHeader(p)}e.place(document.createTextNode(this._curClone.Name+" on "+p),"location","only")}i.forceLayout("pageTitle")},
_getCloneInfo:function(){var m=this;if(m._initializing){var n=m._model.items.CloneLocation;gitService=m._registry.getService("orion.git.provider");gitService.getGitClone(n,function(p){m._cloneInfo=p;if(m._cloneInfo.Children.length===0){m._renderLog=false;m._initTitleBar();m._processStatus()}else gitService.getGitBranch(m._cloneInfo.Children[0].BranchLocation).then(function(r){m._branchInfo=r;gitService.getGitRemote(m._cloneInfo.Children[0].RemoteLocation).then(function(w){m._remoteInfo=w;w=m._cloneInfo.Children[0].ConfigLocation.replace("config",
"config/user.name");var s=function(u){m._userEmail=u;m._processCloneInfo();m._processStatus()};gitService.getGitCloneConfig(w).then(function(u){m._userName=u.Value;u=m._cloneInfo.Children[0].ConfigLocation.replace("config","config/user.email");gitService.getGitCloneConfig(u).then(function(t){s(t.Value)},function(){s("")})},function(){m._userName="";var u=m._cloneInfo.Children[0].ConfigLocation.replace("config","config/user.email");gitService.getGitCloneConfig(u).then(function(t){s(t.Value)},function(){s("")})})})})})}else m._processStatus()},
_renderLogs:function(m){var n=this;if(this._renderLog){var p=new e.Deferred;if(m){if(!this._curRemote||!this._curBranch||this._curBranch.RemoteLocation.length!==1||this._curBranch.RemoteLocation[0].Children.length!==1){e.empty(this._remoteTableRenderer.getLogSectionId());p.callback();return}this._gitCommitNavigatorRem=new g.GitCommitNavigator(this._registry,null,{checkbox:false,minimal:true},this._remoteTableRenderer.getLogContentId());e.place(document.createTextNode(""),this._remoteTableRenderer.getLogContentId(),
"only");var r=this._curBranch.RemoteLocation[0].Children[0].Location+"?page=1&pageSize=5";e.xhrGet({url:r,headers:{"Orion-Version":"1"},handleAs:"json",timeout:5E3,load:function(w){n._registry.getService("orion.git.provider").getLog(w.HeadLocation,w.Id,"Getting git incoming changes",function(s){n._gitCommitNavigatorRem.renderer.setIncomingCommits(s.Children);n._gitCommitNavigatorRem.loadCommitsList(w.CommitLocation+"?page=1&pageSize=5",w).then(function(){p.callback()});n._remoteTableRenderer.renderAdditionalAction(n._gitCommitNavigatorRem._lastTreeRoot)})},
error:function(w,s){if(s.xhr.status==401||s.xhr.status==403){var u=this;mAuth.handleAuthenticationError(s.xhr,function(){e.xhrGet(u)})}else n._gitCommitNavigatorRem.loadCommitsList(r,w).then(function(){p.callback()});console.error("HTTP status code: ",s.xhr.status)}})}else{this._gitCommitNavigatorLog=new g.GitCommitNavigator(this._registry,null,{checkbox:false,minimal:true},this._logTableRenderer.getLogContentId());e.place(document.createTextNode(""),this._logTableRenderer.getLogContentId(),"only");
r=(n._curBranch?n._curBranch.CommitLocation:n._model.items.CommitLocation)+"?page=1&pageSize=5";e.xhrGet({url:r,headers:{"Orion-Version":"1"},handleAs:"json",timeout:5E3,load:function(w,s){function u(t){if(t.toRef==null||t.toRef.RemoteLocation.length!==1||t.toRef.RemoteLocation[0].Children.length!==1||!n._curBranch){n._gitCommitNavigatorLog.loadCommitsList((n._curBranch?n._curBranch.CommitLocation:n._model.items.CommitLocation)+"?page=1&pageSize=5",{Type:"LocalBranch",RemoteLocation:t.toRef.RemoteLocation,
Children:t.Children}).then(function(){p.callback()});n._curRemote&&n._curBranch&&n._logTableRenderer.renderAdditionalAction(n._gitCommitNavigatorLog._lastTreeRoot)}else e.xhrGet({url:t.toRef.RemoteLocation[0].Children[0].Location,headers:{"Orion-Version":"1"},handleAs:"json",timeout:5E3,load:function(y){n._registry.getService("orion.git.provider").getLog(y.CommitLocation,"HEAD","Getting git incoming changes",function(B){n._gitCommitNavigatorLog.renderer.setOutgoingCommits(B.Children);n._gitCommitNavigatorLog.loadCommitsList(n._curBranch.CommitLocation+
"?page=1&pageSize=5",{Type:"LocalBranch",RemoteLocation:t.toRef.RemoteLocation,Children:t.Children}).then(function(){p.callback()});n._curRemote&&n._logTableRenderer.renderAdditionalAction(n._gitCommitNavigatorLog._lastTreeRoot)})},error:function(y,B){console.error("HTTP status code: ",B.xhr.status);if(B.xhr.status==401||B.xhr.status==403){var D=this;mAuth.handleAuthenticationError(B.xhr,function(){e.xhrGet(D)})}else{n._gitCommitNavigatorLog.loadCommitsList(r,{Type:"LocalBranch",RemoteLocation:t.toRef.RemoteLocation,
Children:t.Children}).then(function(){p.callback()});n._curRemote&&n._curBranch&&n._logTableRenderer.renderAdditionalAction(n._gitCommitNavigatorLog._lastTreeRoot)}}})}if(s.xhr.status===200)u(w);else if(s.xhr.status===202){s=new e.Deferred;s.callback(w);n._registry.getService("orion.page.progress").showWhile(s,"Getting git log").then(function(t){u(t.Result.JsonData)})}},error:function(w,s){console.error("HTTP status code: ",s.xhr.status)}})}return p}},_generateCommands:function(){var m=this,n=new c.Command({name:"Compare",
tooltip:"Show the side-by-side compare",imageClass:"git-sprite-open_compare",spriteClass:"gitCommandSprite",id:"orion.sbsCompare",hrefCallback:function(A){return m.openCompareEditor(A.items.object)},visibleWhen:function(A){return A.type==="fileItem"}}),p=new c.Command({name:"Change Committer or Author",id:"orion.showCommitterAndAuthor",callback:function(){m._committerAndAuthorZoneRenderer.show()},visibleWhen:function(A){return A.type==="personIdentShow"}}),r=new c.Command({name:"Use Default Committer and Author",
id:"orion.hideCommitterAndAuthor",callback:function(){m._committerAndAuthorZoneRenderer.hide()},visibleWhen:function(A){return A.type==="personIdentHide"}}),w=new c.Command({name:"Checkout",tooltip:"Checkout the file, discarding the unstaged change",imageClass:"git-sprite-checkout",spriteClass:"gitCommandSprite",id:"orion.gitCheckout",callback:function(A){m._registry.getService("orion.page.dialog").confirm("Your changes to the file will be lost. Are you sure you want to checkout?",function(F){if(F){m._statusService.setProgressMessage("Checking out...");
m.checkout([A.items.object.name])}})},visibleWhen:function(A){return A.type==="fileItem"&&!m._model.isStaged(A.object.type)}}),s=new c.Command({name:"Stage",tooltip:"Stage the change",imageClass:"git-sprite-stage",spriteClass:"gitCommandSprite",id:"orion.gitStage",callback:function(A){m._statusService.setProgressMessage("Staging...");m._prepareStage(A.items.rowId,false);return m.stage(A.items.object.indexURI,A.items.object)},visibleWhen:function(A){return A.type==="fileItem"&&!m._model.isStaged(A.object.type)}}),
u=new c.Command({name:"Stage",tooltip:"Stage the selected changes",imageClass:"git-sprite-stage_all",spriteClass:"gitCommandSprite",id:"orion.gitStageAll",callback:function(){m._statusService.setProgressMessage("Staging...");return m.stageSelected()},visibleWhen:function(A){return A.type==="unstagedItems"&&m.hasUnstaged&&m._unstagedContentRenderer.getSelected().length>0}}),t=new c.Command({name:"Checkout",tooltip:"Checkout all the selected files, discarding all changes",imageClass:"git-sprite-checkout",
spriteClass:"gitCommandSprite",id:"orion.gitCheckoutAll",callback:function(){m._registry.getService("orion.page.dialog").confirm("Your changes to all the selected files will be lost. Are you sure you want to checkout?",function(A){if(A){m._statusService.setProgressMessage("Checking out...");m.checkoutSelected()}})},visibleWhen:function(A){return A.type==="unstagedItems"&&m.hasUnstaged&&m._unstagedContentRenderer.getSelected().length>0}}),y=new c.Command({name:"Save Patch",tooltip:"Save workspace changes as a patch",
imageClass:"git-sprite-diff",spriteClass:"gitCommandSprite",id:"orion.gitSavePatch",hrefCallback:function(){for(var A=m._curClone.DiffLocation+"?parts=diff",F=m._unstagedContentRenderer.getSelected(),H=0;H<F.length;H++){A+="&Path=";A+=F[H].modelItem.path}return A},visibleWhen:function(A){return A.type==="unstagedItems"&&m.hasUnstaged&&m._unstagedContentRenderer.getSelected().length>0}}),B=new c.Command({name:"Unstage",tooltip:"Unstage the change",imageClass:"git-sprite-unstage",spriteClass:"gitCommandSprite",
id:"orion.gitUnstage",callback:function(A){m._statusService.setProgressMessage("Unstaging...");return m.unstage(A.items.object)},visibleWhen:function(A){return A.type==="fileItem"&&m._model.isStaged(A.object.type)}}),D=new c.Command({name:"Unstage",tooltip:"Unstage the selected changes",imageClass:"git-sprite-unstage_all",spriteClass:"gitCommandSprite",id:"orion.gitUnstageAll",callback:function(){m._statusService.setProgressMessage("Unstaging...");return m.unstageSelected("MIXED")},visibleWhen:function(A){return A.type===
"stagedItems"&&m.hasStaged&&m._stagedContentRenderer.getSelected().length>0}}),l=new c.Command({name:"Reset",tooltip:"Reset the branch, discarding all staged and unstaged changes",imageClass:"git-sprite-refresh",spriteClass:"gitCommandSprite",id:"orion.gitResetChanges",callback:function(){m._registry.getService("orion.page.dialog").confirm("All unstaged and staged changes in the working directory and index will be discarded and cannot be recovered.\nAre you sure you want to continue?",function(A){if(A){m._statusService.setProgressMessage("Resetting local changes...");
return m.unstageAll("HARD")}})},visibleWhen:function(){return m.hasStaged||m.hasUnstaged}}),o=new c.Command({name:"Continue",tooltip:"Continue rebase",id:"orion.gitRebaseContinue",callback:function(){m._statusService.setProgressMessage("Continue rebase...");return m.rebase("CONTINUE")},visibleWhen:function(){return m.rebaseState}}),q=new c.Command({name:"Skip Patch",tooltip:"Skip patch",id:"orion.gitRebaseSkip",callback:function(){m._statusService.setProgressMessage("Skipping patch...");return m.rebase("SKIP")},
visibleWhen:function(){return m.rebaseState}}),v=new c.Command({name:"Abort",tooltip:"Abort rebase",id:"orion.gitRebaseAbort",callback:function(){m._statusService.setProgressMessage("Aborting rebase...");return m.rebase("ABORT")},visibleWhen:function(){return m.rebaseState}}),x=new c.Command({name:"Complete log",id:"orion.openGitLog",hrefCallback:function(A){return f.toUrl("git/git-log.html")+"#"+(A.items.branch?A.items.branch.CommitLocation:A.items.model.items.CommitLocation)+"?page=1"},visibleWhen:function(A){return A.type===
"gitLog"&&(A.branch&&A.branch.CommitLocation||A.model&&A.model.items&&A.model.items.CommitLocation)}}),z=new c.Command({name:"Complete log",id:"orion.openGitRemote",hrefCallback:function(A){return f.toUrl("git/git-log.html")+"#"+A.items.branch.RemoteLocation[0].Children[0].Location+"?page=1"},visibleWhen:function(A){return A.type==="gitRemote"&&A.branch&&A.branch.RemoteLocation.length===1&&A.branch.RemoteLocation[0].Children.length===1}}),C=this._registry.getService("orion.page.command");C.addCommand(n,
"object");C.addCommand(s,"object");C.addCommand(s,"dom");C.addCommand(w,"object");C.addCommand(w,"dom");C.addCommand(u,"dom");C.addCommand(t,"dom");C.addCommand(y,"dom");C.addCommand(D,"dom");C.addCommand(B,"object");C.addCommand(B,"dom");C.addCommand(l,"dom");C.addCommand(o,"dom");C.addCommand(q,"dom");C.addCommand(v,"dom");C.addCommand(l,"dom");C.addCommand(p,"dom");C.addCommand(r,"dom");C.addCommand(x,"dom");C.addCommand(z,"dom");C.registerCommandContribution("orion.gitStage",100);C.registerCommandContribution("orion.gitCheckout",
101);C.registerCommandContribution("orion.gitUnstage",102);C.registerCommandContribution("orion.sbsCompare",103);C.registerCommandContribution("orion.gitResetChanges",1,"pageActions");C.registerCommandContribution("orion.gitRebaseContinue",2,"rebaseActions");C.registerCommandContribution("orion.gitRebaseSkip",3,"rebaseActions");C.registerCommandContribution("orion.gitRebaseAbort",4,"rebaseActions");C.registerCommandContribution("orion.showCommitterAndAuthor",1,"personIdentShow");C.registerCommandContribution("orion.hideCommitterAndAuthor",
2,"personIdentHide")},_generateInlineCompareCmds:function(){var m=this,n=new c.Command({tooltip:"Next Diff",imageClass:"core-sprite-move_down",id:"orion.compare.nextDiff",groupId:"orion.compareGroup",callback:function(){m._inlineCompareContainer.nextDiff()}});this._commandService.addCommand(new c.Command({tooltip:"Previous Diff",imageClass:"core-sprite-move_up",id:"orion.compare.prevDiff",groupId:"orion.compareGroup",callback:function(){m._inlineCompareContainer.prevDiff()}}),"dom");this._commandService.addCommand(n,
"dom");this._commandService.registerCommandContribution("orion.compare.prevDiff",2,"compare_rightContainerCommands");this._commandService.registerCommandContribution("orion.compare.nextDiff",1,"compare_rightContainerCommands");this._commandService.renderCommands("compare_rightContainerCommands","dom",self,self,"button")},startTimer:function(){if(!this.timerOn){this.timerOn=true;this.doTimer()}},stopTimer:function(){if(this.timerOn&&this._timerId){this.timerOn=false;clearTimeout(this._timerId)}},doTimer:function(){var m=
document.getElementById("commitMessage"),n=document.getElementById("commit");if(this._staging){n.disabled=true;m.disabled=false}else{n.disabled=!(this._commitReady()&&m.value!=="");m.disabled=!this._commitReady()}this._timerId=setTimeout(e.hitch(this,function(){this.doTimer()}),150)},initViewer:function(){this._inlineCompareContainer.destroyEditor();this._model.selectedItem=null;this.hasUnstaged=this.hasStaged=false;e.place(document.createTextNode("Select a file on the left to compare..."),"fileNameInViewer",
"only");e.style("fileNameInViewer","color","#6d6d6d");e.empty("compare_rightContainerCommands")},_createImgButton:function(m,n,p,r,w){var s=document.createElement("img");s.src=p;n.appendChild(s);this.modifyImageButton(m,s,r,w)},_modifyImageButton:function(m,n,p,r,w,s){var u=this;if(w===undefined||!w){n.title=p;e.style(n,"opacity","0.4");e.connect(n,"onmouseover",n,function(){var t=false;if(s)t=s();n.style.cursor=u.loading?"wait":t?"default":"pointer";t?e.style(n,"opacity","0.4"):e.style(n,"opacity",
"1")});e.connect(n,"onmouseout",n,function(){n.style.cursor=u.loading?"wait":"default";e.style(n,"opacity","0.4")});n.onclick=function(t){var y=false;if(s)y=s();if(m&&!y)y||r(t)}}else{n.title="";n.style.cursor=u.loading?"wait":"default";e.style(n,"opacity","0.0");e.connect(n,"onmouseover",n,function(){n.style.cursor=u.loading?"wait":"default";e.style(n,"opacity","0")});e.connect(n,"onmouseout",n,function(){n.style.cursor=u.loading?"wait":"default";e.style(n,"opacity","0")});n.onclick=null}},_sortBlock:function(m){for(var n=
[],p=0;p<m.length;p++){var r=m[p],w=this._model.getGroupData(r);if(w)for(var s=0;s<w.length;s++){var u=this._model.getModelType(w[s],r);u&&n.push({name:w[s].Name,type:u,location:w[s].Location,path:w[s].Path,commitURI:w[s].Git.CommitLocation,indexURI:w[s].Git.IndexLocation,diffURI:w[s].Git.DiffLocation,conflicting:this._model.isConflict(u)})}}n.sort(function(t,y){t=t.name&&t.name.toLowerCase();y=y.name&&y.name.toLowerCase();if(t<y)return-1;if(t>y)return 1;return 0});return n},_loadBlock:function(m,
n){m.initTable();n=this._sortBlock(n);for(var p=0;p<n.length;p++)m.renderRow(n[p],p);return m.totalRow=n.length},loadDiffContent:function(m){this._statusService.setProgressMessage("Loading diff...");var n=this._model.isStaged(m.type)?"index VS HEAD ) ":"local VS index ) ";this._inlineCompareContainer.setDiffTitle("Compare( "+j.statusTypeMap[m.type][1]+" : "+n);this._inlineCompareContainer.setOptions({hasConflicts:this._model.isConflict(m.type),complexURL:m.diffURI});this._inlineCompareContainer.clearContent();
this._inlineCompareContainer.startup()},openCompareEditor:function(m){var n="",p=f.toUrl("compare/compare.html")+"#",r=0;if(this._model.isStaged(m.type)){n="readonly";r=1}if(this._model.isConflict(m.type)){if(r===0)n="conflict";else n+="&conflict";r++}if(r>0)p=f.toUrl("compare/compare.html")+"?"+n+"#";return p+m.diffURI},handleServerErrors:function(m,n){var p=[];p.Severity="Error";p.HTML=false;try{var r=JSON.parse(m.responseText);p.Message=r.DetailedMessage?r.DetailedMessage:r.Message}catch(w){p.Message=
typeof m.message==="string"?m.message:n.xhr.statusText}this._statusService.setProgressResult(p)},getGitStatus:function(m,n){this._url=m;if(this._initializing=n?true:false){this._cloneInfo=undefined;this._statusService.setProgressMessage("Loading status...")}var p=this;p._registry.getService("orion.git.provider").getGitStatus(m,function(r){p.loadStatus(r)},function(r,w){p.handleServerErrors(r,w)})},stage:function(m,n){var p=this;if(n&&n.conflicting){p._stagingConflict=true;p._stagingName=n.name}else p._stagingConflict=
false;p._registry.getService("orion.git.provider").stage(m,function(){p.getGitStatus(p._url)},function(r,w){p.handleServerErrors(r,w)})},stageSelected:function(){var m=this._unstagedContentRenderer.getSelected();if(m.length!==0){this._prepareStage(m,true);this._unstagedTableRenderer.select(false);this._stagedTableRenderer.select(false);this.stageMultipleFiles(m)}},checkoutSelected:function(){var m=this._unstagedContentRenderer.getSelected();if(m.length!==0){this._prepareStage(m,true);this._unstagedTableRenderer.select(false);
this._stagedTableRenderer.select(false);for(var n=[],p=0;p<m.length;p++){var r=m[p].modelItem;r&&r.name&&n.push(r.name)}this.checkout(n)}},stageOneSelection:function(m,n){var p=this,r=m[n].modelItem;if(r&&r.conflicting){p._stagingConflict=true;p._stagingName=r.name}p._registry.getService("orion.git.provider").stage(r.indexURI,function(){n===m.length-1?p.getGitStatus(p._url):p.stageOneSelection(m,n+1)},function(w,s){p.handleServerErrors(w,s)})},stageMultipleFiles:function(m){for(var n=this,p=[],r=
0;r<m.length;r++){var w=m[r].modelItem;if(w&&w.conflicting){n._stagingConflict=true;n._stagingName=w.name}p.push(w.path)}n._registry.getService("orion.git.provider").stageMultipleFiles(n._model.items.IndexLocation,p,function(){n.getGitStatus(n._url)},function(s,u){n.handleServerErrors(s,u)})},checkout:function(m){var n=this,p=this._model.items.CloneLocation;n._registry.getService("orion.git.provider").checkoutPath(p,m,function(){n.getGitStatus(n._url)},function(r,w){n.handleServerErrors(r,w)})},stageAll:function(){this.stage(this._curClone.IndexLocation)},
unstageSelected:function(m){var n=this._stagedContentRenderer.getSelected();this._stagedTableRenderer.select(false);this._unstagedTableRenderer.select(false);if(n.length!==0)this._stagedContentRenderer.totalRow===n.length?this.unstageAll(m):this.unstageMultipleFiles(n)},unstage:function(m){var n=this;n._registry.getService("orion.git.provider").unstage(n._model.items.IndexLocation,[m.name],function(){n.getGitStatus(n._url)},function(p,r){n.handleServerErrors(p,r)})},unstageAll:function(m){var n=this;
n._registry.getService("orion.git.provider").unstageAll(n._model.items.IndexLocation,m,function(){n.getGitStatus(n._url)},function(p,r){n.handleServerErrors(p,r)})},unstageMultipleFiles:function(m){for(var n=this,p=[],r=0;r<m.length;r++)p.push(m[r].modelItem.path);n._registry.getService("orion.git.provider").unstage(n._model.items.IndexLocation,p,function(){n.getGitStatus(n._url)},function(w,s){n.handleServerErrors(w,s)})},commitAll:function(m,n,p){var r=this;document.getElementById("commitMessage").value=
"";r._statusService.setProgressMessage("Committing...");r._registry.getService("orion.git.provider").commitAll(m,n,p,function(){r.getGitStatus(r._url,true)},function(w,s){r.handleServerErrors(w,s)})},commit:function(m,n,p,r,w,s){var u={};if(!m){m=document.getElementById("commitMessage").value;if(m!=="")u.Message=m;else return}if(!n)if(n=document.getElementById("amend").checked)u.Amend="true";if(!p){p=document.getElementById("committerName").value;u.CommitterName=p;if(!p){this.reportWarning("The committer name is required.");
this._committerAndAuthorZoneRenderer.show();return}}if(!r){r=document.getElementById("committerEmail").value;u.CommitterEmail=r;if(!r){this.reportWarning("The committer mail is required.");this._committerAndAuthorZoneRenderer.show();return}}if(!w){w=document.getElementById("authorName").value;u.AuthorName=w;if(!w){this.reportWarning("The author name is required.");this._committerAndAuthorZoneRenderer.show();return}}if(!s){s=document.getElementById("authorEmail").value;u.AuthorEmail=s;if(!s){this.reportWarning("The author mail is required.");
this._committerAndAuthorZoneRenderer.show();return}}this.commitAll(this._curClone.HeadLocation,m,e.toJson(u))},reportWarning:function(m){var n=[];n.Severity="Warning";n.Message=m;this._registry.getService("orion.page.message").setProgressResult(n)},rebase:function(m){var n=this;n._registry.getService("orion.git.provider").doRebase(n._curClone.HeadLocation,"",m,function(p){if(p.Result=="OK"||p.Result=="ABORTED"||p.Result=="FAST_FORWARD"||p.Result=="UP_TO_DATE"){var r=[];r.Severity="Ok";r.HTML=false;
r.Message=p.Result;n._statusService.setProgressResult(r);n.getGitStatus(n._url)}if(p.Result=="STOPPED"){r=[];r.Severity="Warning";r.HTML=false;r.Message=p.Result+". Repository still contains conflicts.";n._statusService.setProgressResult(r);n.getGitStatus(n._url)}else if(p.Result=="FAILED_UNMERGED_PATHS"){r=[];r.Severity="Error";r.HTML=false;r.Message=p.Result+". Repository contains unmerged paths. Resolve conflicts first.";n._statusService.setProgressResult(r)}},function(p,r){n.handleServerErrors(p,
r)})}};return k}();return j});define("orion/dialogs",[],function(){function f(e){this._serviceRegistry=e;this._serviceRegistration=e.registerService("orion.page.dialog",this)}f.prototype={confirm:function(e,a){a(window.confirm(e))},openFiles:function(){}};f.prototype.constructor=f;return{DialogService:f}});
define("orion/ssh/sshTools",[],function(){var f=f||{};f.SshService=function(){function e(a){if(a){this._serviceRegistry=a;this._serviceRegistration=a.registerService("orion.net.ssh",this)}}e.prototype={_KNOWN_HOSTS:"known_hosts",addKnownHosts:function(a,c){c||(c="");var d=localStorage.getItem(c+this._KNOWN_HOSTS);if(d)d.indexOf(a)<0&&localStorage.setItem(c+this._KNOWN_HOSTS,d+"\n"+a);else localStorage.setItem(c+this._KNOWN_HOSTS,a)},clearKnownhosts:function(a){a||(a="");localStorage.removeItem(a+
this._KNOWN_HOSTS)},getKnownHosts:function(a){a||(a="");return localStorage.getItem(a+this._KNOWN_HOSTS)}};return e}();return f});
define("dojox/layout/ToggleSplitter",["dojo","dijit","dijit/layout/BorderContainer"],function(f,e){f.declare("dojox.layout.ToggleSplitter",[e.layout._Splitter],{open:true,closedThreshold:5,openSize:"",_closedSize:"0",templateString:'<div class="dijitSplitter dojoxToggleSplitter" dojoAttachEvent="onkeypress:_onKeyPress,onmousedown:_onMouseDown" tabIndex="0" role="separator"><div dojoAttachPoint="toggleNode" class="dijitSplitterThumb dojoxToggleSplitterIcon"></div></div>',postCreate:function(){this._started=
false;this.inherited(arguments);var a=this.region;f.addClass(this.domNode,"dojoxToggleSplitter"+a.charAt(0).toUpperCase()+a.substring(1));this.connect(this,"onDblClick","_toggleMe")},startup:function(){this.inherited(arguments);var a=this.child.domNode,c=f.style(a,this.horizontal?"height":"width");f.forEach(["toggleSplitterOpen","toggleSplitterClosedThreshold","toggleSplitterOpenSize"],function(d){var g=d.substring(14);g=g.charAt(0).toLowerCase()+g.substring(1);if(d in this.child)this[g]=this.child[d]},
this);if(!this.openSize)this.openSize=this.open?c+"px":"75px";this._openStyleProps=this._getStyleProps(a,true);this._started=true;this.set("open",this.open);return this},_onMouseUp:function(){f.disconnect(this._onMoveHandle);f.disconnect(this._onUpHandle);delete this._onMoveHandle;delete this._onUpHandle;delete this._startPosn},_onPrelimMouseMove:function(a){if(Math.abs((this._startPosn||0)-(this.horizontal?a.clientY:a.clientX))>=3){f.disconnect(this._onMoveHandle);this._startDrag(a)}},_onMouseDown:function(a){if(this.open){if(!this._onUpHandle)this._onUpHandle=
f.connect(f.body(),"onmouseup",this,"_onMouseUp");if(!this._onMoveHandle){this._startPosn=this.horizontal?a.clientY:a.clientX;this._onMoveHandle=f.connect(f.body(),"onmousemove",this,"_onPrelimMouseMove")}}},_handleOnChange:function(){var a=this.child.domNode,c;c=this.horizontal?"height":"width";if(this.open){var d=f.mixin({display:"block",overflow:"auto",visibility:"visible"},this._openStyleProps);d[c]=this._openStyleProps&&this._openStyleProps[c]?this._openStyleProps[c]:this.openSize;f.style(a,
d);this.connect(this.domNode,"onmousedown","_onMouseDown")}else{d=f.getComputedStyle(a);c=this._getStyleProps(a,true,d);d=this._getStyleProps(a,false,d);this._openStyleProps=c;f.style(a,d)}this._setStateClass();this.container._started&&this.container._layoutChildren(this.region)},_getStyleProps:function(a,c,d){d||(d=f.getComputedStyle(a));var g={},h=this.horizontal?"height":"width";g.visibility=c?d.visibility:"hidden";g[h]=c?a.style[h]||d[h]:this._closedSize;var i=["Top","Right","Bottom","Left"];
f.forEach(["padding","margin","border"],function(j){for(var k=0;k<i.length;k++){var m=j+i[k];if(j=="border")j+="Width";if(undefined!==d[m])g[m]=c?d[m]:0}});return g},_setStateClass:function(){if(this.open){f.removeClass(this.domNode,"dojoxToggleSplitterClosed");f.addClass(this.domNode,"dojoxToggleSplitterOpen");f.removeClass(this.toggleNode,"dojoxToggleSplitterIconClosed");f.addClass(this.toggleNode,"dojoxToggleSplitterIconOpen")}else{f.addClass(this.domNode,"dojoxToggleSplitterClosed");f.removeClass(this.domNode,
"dojoxToggleSplitterOpen");f.addClass(this.toggleNode,"dojoxToggleSplitterIconClosed");f.removeClass(this.toggleNode,"dojoxToggleSplitterIconOpen")}},_setOpenAttr:function(a){if(this._started){this.open=a;this._handleOnChange(a,true);this[this.open?"onOpen":"onClose"](this.child)}},onOpen:function(){},onClose:function(){},_toggleMe:function(a){a&&f.stopEvent(a);this.set("open",!this.open)},_onKeyPress:function(){this.inherited(arguments)}});f.extend(e._Widget,{toggleSplitterOpen:true,toggleSplitterClosedThreshold:5,
toggleSplitterOpenSize:""})});
define("orion/widgets/eWebBorderContainer",["dojo","dijit","dijit/layout/BorderContainer","dojox/layout/ToggleSplitter"],function(f,e){f.declare("orion.widgets.eWebBorderContainer",e.layout.BorderContainer,{_splitterClass:"orion.widgets.eWebSplitter",getPreferredLeftPaneWidth:function(){var a=this.getSizeCookie();return a<=0?f.position(this.getRightPane()).w*0.25:a},isLeftPaneOpen:function(){var a=this.getSplitter("left");if(a)return a.open;return false},getLeftPane:function(){if(this._left)return this._left;for(var a=
this.getChildren(),c=0;c<a.length;c++)if(a[c].region&&(a[c].region==="leading"||a[c].region==="left"))return this._left=a[c].domNode},getHidingPane:function(){return this.getLeftPane()},getRightPane:function(){if(this._center)return this._center;for(var a=this.getChildren(),c=0;c<a.length;c++)if(a[c].region&&a[c].region==="center")return this._center=a[c].domNode},getSizeCookie:function(){var a=this.getSplitter("left");if(a)return a.getSizeCookie();return 0},setSizeCookie:function(a){var c=this.getSplitter("left");
if(c)return c.setSizeCookie(a)},toggleLeftPaneState:function(){var a=this.getSplitter("left");a&&a.toggleHidingPaneState()},setToggleCallback:function(a){this.toggleCallback=a},toggle:function(){if(!this._left||!this._center)for(var a=this.getChildren(),c=0;c<a.length;c++)if(a[c].region&&a[c].region==="center")this._center=a[c].domNode;else if(a[c].region&&(a[c].region==="leading"||a[c].region==="left"))this._left=a[c].domNode;var d=this._left,g=this._center,h=f.position(d).w,i=this.isLeftPaneOpen(),
j;j=i?0:this.getPreferredLeftPaneWidth();i||this.toggleLeftPaneState();var k=d.style.overflow,m=g.style.overflow;(new f.Animation({node:d,duration:300,curve:[1,100],onAnimate:f.hitch(this,function(n){d.style.width=h+(j-h)*n/100+"px";d.style.overflow="hidden";g.style.overflow="hidden";this.layout()}),onEnd:f.hitch(this,function(){g.style.overflow=m;d.style.overflow=k;this.toggleCallback&&this.toggleCallback.apply();i?this.toggleLeftPaneState():this.setSizeCookie(null)})})).play()}});f.declare("orion.widgets.eWebSplitter",
dojox.layout.ToggleSplitter,{postCreate:function(){this.inherited(arguments);this.connect(this.toggleNode,"onmousedown","_onThumbMouseDown");this.connect(this.toggleNode,"onmouseover","_onThumbMouseOver");this.connect(this.domNode,"onmouseover","_onMouseOver");this.connect(this.toggleNode,"onmouseout","_onThumbMouseOut");this._openStateCookieName=this.container.id+"_"+this.region+"_open"},startup:function(){this.inherited(arguments);if(this.container.persist){var a=f.cookie(this._openStateCookieName);
if(a==="true")this.container.getHidingPane().style.width=this.getSizeCookie()+"px";else{a==="false"?this.set("open",false):this.set("open",true);this._handleOnChange()}}else{this.set("open",true);this._handleOnChange()}return this},_handleOnChange:function(){var a=this.child.domNode,c;c=this.horizontal?"height":"width";if(this.open){var d=f.mixin({display:"block",visibility:"visible"},this._openStyleProps);d[c]=this._openStyleProps&&this._openStyleProps[c]?this._openStyleProps[c]:this.openSize;f.style(a,
d);this.connect(this.domNode,"onmousedown","_onMouseDown")}else{d=f.getComputedStyle(a);c=this._getStyleProps(a,true,d);d=this._getStyleProps(a,false,d);this._openStyleProps=c;f.style(a,d)}this._setStateClass();if(this.container._started){a=0;if(this.open&&this.openSize)a=parseInt(this.openSize.replace("px",""),10);this.container._layoutChildren(this.region,a)}},_removeFocusVisual:function(a){f.stopEvent(a)},_onMouseDown:function(a){this.open?this._startDrag(a):this._removeFocusVisual(a)},_onMouseOver:function(){this.domNode.style.cursor=
this.open?"e-resize":"default"},_onThumbMouseDown:function(a){a.stopPropagation();this._removeFocusVisual(a);this.container.toggle()},_onThumbMouseOver:function(){this.toggleNode.style.backgroundColor="#AAAAAA"},_onThumbMouseOut:function(){this.toggleNode.style.backgroundColor="#DDDDDD"},_toggleMe:function(){},getSizeCookie:function(){if(this.container.persist){var a=f.cookie(this._cookieName);if(a)return parseInt(a.replace("px",""),10)}return 0},setSizeCookie:function(){if(this.container.persist)f.cookie(this._cookieName,
this.child.domNode.style[this.horizontal?"height":"width"],{expires:365})},toggleHidingPaneState:function(){this.set("open",!this.open);this.container.getHidingPane().style.visibility=this.open?"visible":"hidden";if(this.container.persist)f.cookie(this._openStateCookieName,this.open?"true":"false",{expires:365})}});f.declare("orion.widgets.eWebBorderContainerReverse",e.layout.BorderContainer,{_splitterClass:"orion.widgets.eWebSplitter",getPreferredRightPaneWidth:function(){var a=this.getSizeCookie();
return a<=0?f.position(this.getLeftPane()).w*0.25:a},isRightPaneOpen:function(){var a=this.getSplitter("right");if(a)return a.open;return false},getRightPane:function(){if(this._right)return this._right;for(var a=this.getChildren(),c=0;c<a.length;c++)if(a[c].region&&(a[c].region==="trailing"||a[c].region==="right"))return this._right=a[c].domNode},getHidingPane:function(){return this.getRightPane()},getLeftPane:function(){if(this._center)return this._center;for(var a=this.getChildren(),c=0;c<a.length;c++)if(a[c].region&&
a[c].region==="center")return this._center=a[c].domNode},getSizeCookie:function(){var a=this.getSplitter("right");if(a)return a.getSizeCookie();return 0},setSizeCookie:function(a){var c=this.getSplitter("right");if(c)return c.setSizeCookie(a)},toggleRightPaneState:function(){var a=this.getSplitter("right");a&&a.toggleHidingPaneState()},setToggleCallback:function(a){this.toggleCallback=a},toggle:function(){if(!this._right||!this._center)for(var a=this.getChildren(),c=0;c<a.length;c++)if(a[c].region&&
a[c].region==="center")this._center=a[c].domNode;else if(a[c].region&&(a[c].region==="trailing"||a[c].region==="right"))this._right=a[c].domNode;var d=this._right,g=this._center,h=f.position(d).w,i=this.isRightPaneOpen(),j;j=i?0:this.getPreferredRightPaneWidth();i||this.toggleRightPaneState();var k=d.style.overflow,m=g.style.overflow;(new f.Animation({node:d,duration:300,curve:[1,100],onAnimate:f.hitch(this,function(n){d.style.width=h+(j-h)*n/100+"px";d.style.overflow="hidden";g.style.overflow="hidden";
this.layout()}),onEnd:f.hitch(this,function(){g.style.overflow=m;d.style.overflow=k;this.toggleCallback&&this.toggleCallback.apply();i?this.toggleRightPaneState():this.setSizeCookie(null)})})).play()}})});
define("git/git-status",["dojo","orion/bootstrap","orion/status","orion/progress","orion/commands","orion/searchClient","orion/fileClient","orion/operationsClient","orion/globalCommands","orion/git/gitClient","orion/git/git-status-table","orion/breadcrumbs","orion/dialogs","orion/ssh/sshTools","orion/contentTypes","dojo/parser","dojo/hash","dijit/layout/BorderContainer","dijit/layout/ContentPane","orion/widgets/eWebBorderContainer"],function(f,e,a,c,d,g,h,i,j,k,m,n,p,r,w){f.addOnLoad(function(){e.startup().then(function(s){var u=
s.serviceRegistry;s=s.preferences;document.body.style.visibility="visible";f.parser.parse();var t=new d.CommandService({serviceRegistry:u}),y=new h.FileClient(u);new w.ContentTypeService(u);y=new g.Searcher({serviceRegistry:u,commandService:t,fileService:y});new k.GitService(u);new r.SshService(u);new p.DialogService(u);var B=new i.OperationsClient(u),D=new a.StatusReportingService(u,B,"statusPane","notifications","notificationArea");new c.ProgressService(u,B);j.generateBanner("banner",u,t,s,y);j.setPageCommandExclusions(["eclipse.git.status"]);
var l=new m.GitStatusController({renderLog:true},u,t,D,"unstagedZone","stagedZone");l.getGitStatus(f.hash(),true);f.subscribe("/dojo/hashchange",l,function(){l.getGitStatus(f.hash(),true)})})})});