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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

/*

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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


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


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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

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

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

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

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

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

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

 Contributors:
 IBM Corporation - initial API and implementation
 RequireJS i18n 2.0.2 Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved.
 Available via the MIT or new BSD license.
 see: http://github.com/requirejs/i18n for details
*/
(function(k,h){typeof define==="function"&&define.amd?define("orion/Deferred",h):typeof exports==="object"?module.exports=h():(k.orion=k.orion||{},k.orion.Deferred=h())})(this,function(){function k(){for(var a;a=d.shift();)a();e=!1}function h(a){d.push(a);e||(e=!0,setTimeout(k,0))}function f(a){return function(){a.apply(void 0,arguments)}}function a(){function j(){for(var b;b=e.shift();){var c=b.deferred,i=l==="fulfilled"?"resolve":"reject";if(typeof b[i]==="function")try{var a=(0,b[i])(g),j=a&&(typeof a===
"object"||typeof a==="function")&&a.then;if(typeof j==="function")if(a===c.promise)c.reject(new TypeError);else{var h=a.cancel;typeof h==="function"?c._protected(d).parentCancel=h.bind(a):delete c._protected(d).parentCancel;j.call(a,f(c.resolve),f(c.reject),f(c.progress))}else c.resolve(a)}catch(m){c.reject(m)}else c[i](g)}}function c(b){delete o.parentCancel;l="rejected";g=b;e.length&&h(j)}function b(i){function d(b){return function(c){f||(f=!0,b(c))}}var f=!1;delete o.parentCancel;try{var k=i&&
(typeof i==="object"||typeof i==="function")&&i.then;if(typeof k==="function")if(i===m)c(new TypeError);else{l="assumed";var s=i&&i.cancel;if(typeof s!=="function"){var u=new a,i=u.promise;try{k(u.resolve,u.reject,u.progress)}catch(v){u.reject(v)}s=i.cancel;k=i.then}g=i;k.call(i,d(b),d(c));o.parentCancel=s.bind(i)}else l="fulfilled",g=i,e.length&&h(j)}catch(w){d(c)(w)}}function i(){var b=o.parentCancel;if(b)delete o.parentCancel,b();else if(!l)b=Error("Cancel"),b.name="Cancel",c(b)}var g,l,e=[],m=
this,o={};Object.defineProperty(this,"_protected",{value:function(b){if(b!==d)throw Error("protected");return o}});this.resolve=function(c){l||b(c);return m};this.reject=function(b){l||c(b);return m};this.progress=function(b){l||e.forEach(function(c){if(c.progress)try{c.progress(b)}catch(i){}});return m.promise};this.cancel=function(){o.parentCancel?setTimeout(i,0):i();return m};this.then=function(b,c,i){b={resolve:b,reject:c,progress:i,deferred:new a};e.push(b);b.deferred._protected(d).parentCancel=
m.promise.cancel.bind(m);(l==="fulfilled"||l==="rejected")&&h(j);return b.deferred.promise};this.promise={then:m.then,cancel:m.cancel}}var d=[],e=!1;a.all=function(d,c){function b(b,c){e||(l[b]=c,--g===0&&f.resolve(l))}function i(i,a){if(!e){if(c)try{b(i,c(a));return}catch(g){a=g}f.reject(a)}}var g=d.length,l=[],e=!1,f=new a;f.then(void 0,function(){e=!0;d.forEach(function(b){b.cancel&&b.cancel()})});g===0?f.resolve(l):d.forEach(function(c,a){c.then(b.bind(void 0,a),i.bind(void 0,a))});return f.promise};
a.when=function(d,c,b,i){var g;if(!(d&&typeof d.then==="function"))g=new a,g.resolve(d),d=g.promise;return d.then(c,b,i)};return a});
(function(k,h){typeof define==="function"&&define.amd?define("orion/plugin",["orion/Deferred"],h):typeof exports==="object"?module.exports=h(require("orion/Deferred")):(k.orion=k.orion||{},k.orion.PluginProvider=h(k.orion.Deferred))})(this,function(k){function h(f,a){this.__objectId=f;this.__methods=a}return function(f){function a(b){m&&(typeof ArrayBuffer==="undefined"&&(b=JSON.stringify(b)),m===self?m.postMessage(b):m.postMessage(b,"*"))}function d(){var b=[];Object.keys(u).forEach(function(c){var i=
u[c];b.push({serviceId:c,names:i.names,methods:i.methods,properties:i.properties})});return{headers:l||{},services:b}}function e(b,c){if(c&&c instanceof XMLHttpRequest){var i,a;try{i=c.status,a=c.statusText}catch(g){i=0,a=""}return{status:i||0,statusText:a}}return c}function j(b){var c=b?JSON.parse(JSON.stringify(b,e)):b;if(b instanceof Error)c.__isError=!0,c.message=c.message||b.message,c.name=c.name||b.name;return c}function c(b){if(!m)return(new k).reject(Error("plugin not connected"));b.id=String(o++);
var c=new k;q[b.id]=c;c.then(null,function(c){n&&c instanceof Error&&c.name==="Cancel"&&v({requestId:b.id,method:"cancel",params:c.message?[c.message]:[]})});var i=Object.prototype.toString;b.params.forEach(function(a,g){if(i.call(a)==="[object Object]"&&!(a instanceof h)){var d,l;for(d in a)i.call(a[d])==="[object Function]"&&(l=l||[],l.push(d));if(l){var e=r++;s[e]=a;d=function(){delete s[e]};c.then(d,d);b.params[g]=new h(e,l)}}});v(b);return c.promise}function b(b,c){b||b===0?v({id:b,result:null,
error:c}):console.log(c)}function i(b,i,a,g){g.forEach(function(b,i){if(b&&typeof b.__objectId!=="undefined"){var a={};b.__methods.forEach(function(i){a[i]=function(){return c({objectId:b.__objectId,method:i,params:Array.prototype.slice.call(arguments)})}});g[i]=a}});var d=typeof b===void 0?null:{id:b,result:null,error:null};try{var l=a.apply(i,g);if(d)l&&typeof l.then==="function"?(p[b]=l,l.then(function(c){delete p[b];d.result=c;v(d)},function(c){if(p[b])delete p[b],d.error=j(c),v(d)},function(){v({responseId:b,
method:"progress",params:Array.prototype.slice.call(arguments)})})):(d.result=l,v(d))}catch(e){if(d)d.error=j(e),v(d)}}function g(c){if(c.source===m){c=typeof c.data!=="string"?c.data:JSON.parse(c.data);try{if(c.method){var a=c.method,g=c.params||[];if("serviceId"in c){var d=u[c.serviceId];d||b(c.id,"service not found");d=d.implementation;a in d?i(c.id,d,d[a],g):b(c.id,"method not found")}else if("objectId"in c){var l=s[c.objectId];l||b(c.id,"object not found");!a in l?i(c.id,l,l[a],g):b(c.id,"method not found")}else if("requestId"in
c){var e=p[c.requestId];e&&a==="cancel"&&e.cancel&&e.cancel.apply(e,g)}else if("responseId"in c){var j=q[c.responseId];j&&a==="progress"&&j.progress&&j.progress.apply(j,g)}else throw Error("Bad method: "+c.method);}else{var n=q[String(c.id)];delete q[String(c.id)];c.error?n.reject(c.error):n.resolve(c.result)}}catch(f){console.log("Plugin._messageHandler "+f)}}}var l=f,n=!1,m=null,o=0,r=0,t=0,p={},q={},s={},u={},v=a;this.updateHeaders=function(b){if(n)throw Error("Cannot update headers. Plugin Provider is connected");
l=b};this.registerServiceProvider=this.registerService=function(b,c,i){if(n)throw Error("Cannot register service. Plugin Provider is connected");typeof b==="string"?b=[b]:Array.isArray(b)||(b=[]);var a=null,g=[];for(a in c)typeof c[a]==="function"&&g.push(a);u[t++]={names:b,methods:g,implementation:c,properties:i||{},listeners:{}}};this.connect=function(b,c){if(!n){if(typeof window==="undefined")m=self;else if(window!==window.parent)m=window.parent;else if(window.opener!==null)m=window.opener;else{c&&
c("No valid plugin target");return}addEventListener("message",g,!1);var i={method:"plugin",params:[d()]};a(i);n=!0}b&&b()};this.disconnect=function(){n&&(removeEventListener("message",g),m=null,n=!1)}}});
(function(){function k(a,e,j,c,b,i){e[a]&&(j.push(a),(e[a]===!0||e[a]===1)&&c.push(b+a+"/"+i))}function h(a,e,j,c,b){e=c+e+"/"+b;require._fileExists(a.toUrl(e+".js"))&&j.push(e)}function f(a,e,j){for(var c in e)e.hasOwnProperty(c)&&(!a.hasOwnProperty(c)||j)?a[c]=e[c]:typeof e[c]==="object"&&f(a[c],e[c],j)}var a=/(^.*(^|\/)nls(\/|$))([^\/]*)\/?([^\/]*)/;define("i18n",["module"],function(d){var e=d.config?d.config():{};return{version:"2.0.1+",load:function(d,c,b,i){i=i||{};if(i.locale)e.locale=i.locale;
var g=a.exec(d),l=g[1],n=g[4],m=g[5],o=n.split("-"),r=[],t={},p,q="";if(g[5])l=g[1],d=l+m;else{m=g[4];n=e.locale;if(!n)n=e.locale=typeof navigator==="undefined"?"root":(navigator.language||navigator.userLanguage||"root").toLowerCase();o=n.split("-")}if(i.isBuild){r.push(d);h(c,"root",r,l,m);for(p=0;p<o.length;p++)i=o[p],q+=(q?"-":"")+i,h(c,q,r,l,m);c(r,function(){b()})}else c([d],function(i){var a=[],g;k("root",i,a,r,l,m);for(p=0;p<o.length;p++)g=o[p],q+=(q?"-":"")+g,k(q,i,a,r,l,m);c(r,function(){var g,
d,e;for(g=a.length-1;g>-1&&a[g];g--){e=a[g];d=i[e];if(d===!0||d===1)d=c(l+e+"/"+m);f(t,d)}b(t)})})}}})})();
define("orion/i18n",[],function(){return{load:function(k,h,f,a){var a=a||{},d=/(^.*(?:^|\/)nls(?:\/|$))([^\/]*)\/?([^\/]*)/,e=d.exec(k);if(e){if(!h.defined||h.defined(k))try{f(h(k));return}catch(j){}if(a.isBuild||a.isTest)f({});else if(h.specified&&!h.specified("orion/bootstrap"))f({});else{var c=e[1],b=e[3]?e[2]:"",i=e[3]||e[2];h(["orion/bootstrap"],function(g){g.startup().then(function(g){var j=g.serviceRegistry,g=j.getServiceReferences("orion.i18n.message");if(b)g.some(function(b){return k===b.getProperty("name")?
(j.getService(b).getMessageBundle().then(function(b){f(b)},function(){f({})}),!0):!1})||f({});else{var m={},o;g.forEach(function(g){var l=g.getProperty("name");if((e=d.exec(l))&&c===e[1]&&i===(e[3]||e[2]))if(b=e[3]?e[2]:""){if((g=a.locale||(typeof navigator!=="undefined"?navigator.language||navigator.userLanguage:null))&&g.toLowerCase().indexOf(b.toLowerCase())===0)m[b]=!0,(!h.specified||!h.specified(l))&&define(l,["orion/i18n!"+l],function(b){return b})}else o=g});!h.specified||!h.specified(k)?o?
j.getService(o).getMessageBundle().then(function(b){Object.keys(m).forEach(function(c){typeof b[c]==="undefined"&&(b[c]=m[c])});define(k,[],b);f(b)},function(){define(k,[],m);f(m)}):(define(k,[],m),f(m)):f(m)}})})}}else f(null)}}});
define("orion/nls/root/messages",{Navigator:"Navigator",Sites:"Sites",Shell:"Shell",ShellLinkWorkspace:"Workspace Shell","Get Plugins":"Get Plugins",Global:"Global",Editor:"Editor",EditorRelatedLink:"Show Current Folder",EditorRelatedLinkParent:"Show Enclosing Folder",EditorLinkWorkspace:"Show Workspace",EditorRelatedLinkProj:"Show Project","Filter bindings":"Filter bindings","Orion Editor":"Orion Editor","Orion Image Viewer":"Orion Image Viewer","Orion Markdown Viewer":"Orion Markdown Viewer","Orion JSON Editor":"Orion JSON Editor",
"View on Site":"View on Site","View this file or folder on a web site hosted by Orion":"View this file or folder on a web site hosted by Orion.","Show a list of all the keybindings on this page":"Show a list of all the keybindings on this page","Show Keys":"Show Keys","Hide or show the page banner and footer":"Hide or show the page banner and footer","Toggle banner and footer":"Toggle banner and footer","Choose a file by name and open an editor on it":"Choose a file by name and open an editor on it",
"Find File Named...":"Find File Named...","System Configuration Details":"System Configuration Details","System Config Tooltip":"Go to the System Configuration Details page","Background Operations":"Background Operations","Background Operations Tooltip":"Go to the Background Operations page","Operation status is unknown":"Operation status is unknown","Unknown item":"Unknown item","Can't search: no search service is available":"Can't search: no search service is available","could not find banner parent, id was ":"could not find banner parent, id was ",
Related:"Related",Options:"Options",FAQ:"FAQ","Report a Bug":"Bugs","Privacy Policy":"Privacy","Terms of Use":"Terms","Copyright Agent":"Copyright","Orion Logo":"Orion Logo","Orion is in Beta. Please try it out but BEWARE your data may be lost.":"I20140226-2325","LOG: ":"LOG: ",View:"View","no parent":"no parent","no tree model":"no tree model","no renderer":"no renderer","could not find table row ":"could not find table row ","Resource is out of sync with the server. Do you want to save it anyway?":"Resource is out of sync with the server. Do you want to save it anyway?",
Operations:"Operations","Operations running":"Operations running","Some operations finished with warning":"Some operations finished with warning","Some operations finished with error":"Some operations finished with error","no service registry":"no service registry",Tasks:"Tasks",Close:"Close","Expand all":"Expand all","Collapse all":"Collapse all",Search:"Search","Advanced search":"Advanced search",Submit:"Submit",More:"More","Saved searches":"Saved searches","Recent searches":"Recent searches","Regular expression":"Regular expression",
"Search options":"Search options","Global search":"Global search","Orion Home":"Orion Home","Close notification":"Close notification","Operations - Press spacebar to show current operations":"Operations - Press spacebar to show current operations","Type a keyword or wild card to search in root":"Type a keyword or wild card to search in root","Toggle side panel":"Toggle side panel","Open or close the side panel":"Open or close the side panel",Projects:"Projects","Toggle Sidebar":"Toggle Sidebar","Sample HTML5 Site":"Sample HTML5 Site",
"Generate an HTML5 'Hello World' website, including JavaScript, HTML, and CSS files.":"Generate an HTML5 'Hello World' website, including JavaScript, HTML, and CSS files.","Sample Orion Plugin":"Sample Orion Plugin","Generate a sample plugin for integrating with Orion.":"Generate a sample plugin for integrating with Orion.",Browser:"Web Browser",OutlineProgress:"Getting outline for ${0} from ${1}",UnknownError:"An unknown error occurred.",UnknownWarning:"An unknown warning occurred.",Filter:"Filter (* = any string, ? = any character)",
"To view the browser's context menu, trigger the context menu again.":"To view the browser's context menu, trigger the context menu again.",Edit:"Edit",CentralNavTooltip:"Toggle Navigation Menu"});define("orion/nls/messages",["orion/i18n!orion/nls/messages","orion/nls/root/messages"],function(k,h){var f={root:h};Object.keys(k).forEach(function(a){typeof f[a]==="undefined"&&(f[a]=k[a])});return f});
define("orion/util",[],function(){var k=navigator.userAgent,h=k.indexOf("MSIE")!==-1||k.indexOf("Trident")!==-1?document.documentMode:void 0,f=parseFloat(k.split("Firefox/")[1]||k.split("Minefield/")[1])||void 0,a=k.indexOf("Opera")!==-1?parseFloat(k.split("Version/")[1]):void 0,d=parseFloat(k.split("Chrome/")[1])||void 0,e=k.indexOf("Safari")!==-1&&!d,j=parseFloat(k.split("WebKit/")[1])||void 0,c=k.indexOf("Android")!==-1,b=k.indexOf("iPad")!==-1,k=k.indexOf("iPhone")!==-1,i=b||k,g=navigator.platform.indexOf("Mac")!==
-1,l=navigator.platform.indexOf("Win")!==-1,n=navigator.platform.indexOf("Linux")!==-1,m="ontouchstart"in document.createElement("input");return{formatMessage:function(b){var c=arguments;return b.replace(/\$\{([^\}]+)\}/g,function(b,i){return c[(i<<0)+1]})},createElement:function(b,c){return b.createElementNS?b.createElementNS("http://www.w3.org/1999/xhtml",c):b.createElement(c)},isIE:h,isFirefox:f,isOpera:a,isChrome:d,isSafari:e,isWebkit:j,isAndroid:c,isIPad:b,isIPhone:k,isIOS:i,isMac:g,isWindows:l,
isLinux:n,isTouch:m,platformDelimiter:l?"\r\n":"\n"}});
define("orion/webui/littlelib",["orion/util"],function(k){function h(b,c){c||(c=document);return c.querySelectorAll(b)}function f(b){var c=b.tabIndex;c===0&&k.isIE&&!{a:!0,body:!0,button:!0,frame:!0,iframe:!0,img:!0,input:!0,isindex:!0,object:!0,select:!0,textarea:!0}[b.nodeName.toLowerCase()]&&!b.attributes.tabIndex&&(c=-1);return c}function a(b){if(f(b)>=0)return b;if(b.hasChildNodes())for(var c=0;c<b.childNodes.length;c++){var g=a(b.childNodes[c]);if(g)return g}return null}function d(b){if(f(b)>=
0)return b;if(b.hasChildNodes())for(var c=b.childNodes.length-1;c>=0;c--){var a=d(b.childNodes[c]);if(a)return a}return null}function e(b,c){if(b.nodeType===3){var a=j.exec(b.nodeValue);a&&a.length>1&&c(b,a)}if(b.hasChildNodes())for(a=0;a<b.childNodes.length;a++)e(b.childNodes[a],c)}var j=/\$\{([^\}]+)\}/,c=null;return{$:function(b,c){c||(c=document);return c.querySelector(b)},$$:h,$$array:function(b,c){return Array.prototype.slice.call(h(b,c))},node:function(b){var c=b;typeof b==="string"&&(c=document.getElementById(b));
return c},contains:function(b,c){if(!b||!c)return!1;if(b===c)return!0;var a=b.compareDocumentPosition(c);return Boolean(a&16)},bounds:function(b){b=b.getBoundingClientRect();return{left:b.left+document.documentElement.scrollLeft,top:b.top+document.documentElement.scrollTop,width:b.width,height:b.height}},empty:function(b){for(;b.hasChildNodes();)b.removeChild(b.firstChild)},firstTabbable:a,lastTabbable:d,stop:function(b){if(window.document.all)b.keyCode=0;b.preventDefault&&(b.preventDefault(),b.stopPropagation())},
processTextNodes:function(b,c){e(b,function(b,a){b.parentNode.replaceChild(document.createTextNode(c[a[1]]||a[1]),b)})},processDOMNodes:function(b,c){e(b,function(b,a){var d=c[a[1]];if(d){var e=document.createRange(),j=a.index;e.setStart(b,j);e.setEnd(b,j+a[0].length);e.deleteContents();e.insertNode(d)}})},addAutoDismiss:function(b,a){function g(b){c.forEach(function(c){var a=!1,i=c.excludeNodes.some(function(c){return document.body.contains(c)?(a=!0,c.contains(b.target)):!1});if(a&&!i)try{c.dismiss(b)}catch(g){typeof console!==
"undefined"&&console&&console.error(g&&g.message)}});c=c.filter(function(b){return b.excludeNodes.some(function(b){return document.body.contains(b)})})}c===null&&(c=[],document.addEventListener("click",g,!0),k.isIOS&&document.addEventListener("touchend",function(b){function c(){b.target.removeEventListener("click",c)}b.touches.length===0&&b.target.addEventListener("click",c)},!1));c.push({excludeNodes:b,dismiss:a})},setFramesEnabled:function(b){for(var c=document.getElementsByTagName("iframe"),a=
0;a<c.length;a++)c[a].parentNode.style.pointerEvents=b?"":"none"},removeAutoDismiss:function(b){c=c.filter(function(c){return b!==c.dismiss})},KEY:{BKSPC:8,TAB:9,ENTER:13,ESCAPE:27,SPACE:32,PAGEUP:33,PAGEDOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,INSERT:45,DEL:46}}});
define("orion/webui/treetable",["i18n!orion/nls/messages","orion/webui/littlelib"],function(k,h){function f(a){this._init(a)}f.prototype={_init:function(a){var d=a.parent,e=this,d=h.node(d);if(!d)throw k["no parent"];if(!a.model)throw k["no tree model"];if(!a.renderer)throw k["no renderer"];this._parent=d;this._treeModel=a.model;this._onComplete=a.onComplete;this._renderer=a.renderer;this._showRoot=a.showRoot===void 0?!1:a.showRoot;this._indent=a.indent===void 0?16:a.indent;this._onCollapse=a.onCollapse;
this._labelColumnIndex=a.labelColumnIndex===void 0?0:a.labelColumnIndex;this._id=a.id===void 0?"treetable":a.id;this._tableStyle=a.tableStyle;this._tableElement=a.tableElement||"table";this._tableBodyElement=a.tableBodyElement||"tbody";this._tableRowElement=a.tableRowElement||"tr";this._root=this._treeModel.getRoot(function(a){e._showRoot?(a._depth=0,e._generate([a],0)):e._treeModel.getChildren(a,function(c){e.destroyed||e._generate(c,0)})})},destroy:function(){this.destroyed=!0},_generate:function(a,
d){h.empty(this._parent);var e=document.createElement("div");this._renderer.wrapperCallback&&this._renderer.wrapperCallback(e);var j=document.createElement(this._tableElement);this._renderer.tableCallback&&this._renderer.tableCallback(j);j.id=this._id;this._tableStyle&&j.classList.add(this._tableStyle);this._renderer.initTable(j,this);this._bodyElement=document.createElement(this._tableBodyElement);this._renderer.bodyCallback&&this._renderer.bodyCallback(this._bodyElement);this._bodyElement.id=this._id+
"tbody";a.length===0?this._renderer.emptyCallback&&this._renderer.emptyCallback(this._bodyElement):this._generateChildren(a,d);j.appendChild(this._bodyElement);e.appendChild(j);this._parent.appendChild(e);this._rowsChanged();this._onComplete&&this._onComplete(this)},_generateChildren:function(a,d,e){for(var j=0;j<a.length;j++){var c=document.createElement(this._tableRowElement);c.id=this._treeModel.getId(a[j]);c._depth=d;c._item=a[j];this._renderer.render(a[j],c);c.childNodes[this._labelColumnIndex].style.paddingLeft=
this._indent*d+"px";this._renderer.rowCallback&&this._renderer.rowCallback(c,a[j]);e?(this._bodyElement.insertBefore(c,e.nextSibling),e&&(e=c)):this._bodyElement.appendChild(c)}},_rowsChanged:function(){this._renderer.rowsChanged&&this._renderer.rowsChanged()},getSelected:function(){return this._renderer.getSelected()},refresh:function(a,d,e){var j=this._treeModel.getId(a),c;if(j===this._id)this._removeChildRows(j),this._generateChildren(d,0),this._rowsChanged();else{var b=h.node(j);b?(b._item=a,
b&&(e||b._expanded)?(this._removeChildRows(j),d?(b._expanded=!0,this._renderer.updateExpandVisuals(b,!0),this._generateChildren(d,b._depth+1,b),this._rowsChanged()):(c=this,this._renderer.updateExpandVisuals(b,"progress"),d=this._treeModel.getChildren(b._item,function(a){if(!c.destroyed&&(c._renderer.updateExpandVisuals(b,!0),!b._expanded))b._expanded=!0,c._generateChildren(a,b._depth+1,b),c._rowsChanged()}))):this._renderer.updateExpandVisuals(b,!1)):console.log(k["could not find table row "]+j)}},
getItem:function(a){var d=h.node(a);return d&&d._item?d._item:a},toggle:function(a){var d=h.node(a);d&&(d._expanded?this.collapse(a):this.expand(a))},isExpanded:function(a){a=typeof a==="string"?a:this._treeModel.getId(a);return(a=h.node(a))?a._expanded:!1},expand:function(a,d,e){var a=typeof a==="string"?a:this._treeModel.getId(a),j=h.node(a);if(j)if(j._expanded)d&&d.apply(c,e);else{var c=this;this._renderer.updateExpandVisuals(j,"progress");this._treeModel.getChildren(j._item,function(b){if(!c.destroyed){c._renderer.updateExpandVisuals(j,
!0);if(!j._expanded)j._expanded=!0,c._generateChildren(b,j._depth+1,j),c._rowsChanged();d&&d.apply(c,e)}})}},_removeChildRows:function(a){for(var d=a===this._id,e=!1,j=-1,c=[],b=h.$$array(".treeTableRow",this._parent),i=0;i<b.length;i++){var g=b[i];if(e)break;if(d)g._depth>j?c.push(g):e=!0;else if(g.id===a)d=!0,j=g._depth}for(a=0;a<c.length;a++)d=c[a],d.parentNode.removeChild(d)},collapse:function(a){var a=typeof a==="string"?a:this._treeModel.getId(a),d=h.node(a);if(d){if(!d._expanded)return;d._expanded=
!1;this._renderer.updateExpandVisuals(d,!1);this._removeChildRows(a);this._rowsChanged()}this._onCollapse&&this._onCollapse(d._item)},getIndent:function(){return this._indent}};f.prototype.constructor=f;return{TableTree:f}});
define("orion/treeModelIterator",[],function(){var k={};k.TreeModelIterator=function(){function h(f,a){this.firstLevelChildren=f;this.reset();this._init(a)}h.prototype={_init:function(f){if(f)this.isExpanded=f.isExpanded,this.isExpandable=f.isExpandable,this.forceExpandFunc=f.forceExpandFunc,this.getChildrenFunc=f.getChildrenFunc},topLevel:function(f){return f.parent?f.parent===this.root:!0},_getChildren:function(f){return typeof this.getChildrenFunc==="function"?this.getChildrenFunc(f):f?f.children:
null},_expanded:function(f){if(!f)return!0;var a=this._getChildren(f),a=a&&a.length>0;this.isExpanded&&a&&(a=this.isExpanded(f));return a},_expandable:function(f){return!f?!0:this.isExpandable?this.isExpandable(f):!1},_diveIn:function(f){return this._expanded(f)?(this.setCursor(this._getChildren(f)[0]),this.cursor()):null},_drillToLast:function(f){return this._expanded(f)?(f=this._getChildren(f),this._drillToLast(f[f.length-1])):f},_forward:function(f){if(!this._cursor)return null;var a=this._diveIn(this._cursor);
if(!a){if(f&&this._expandable(this._cursor)&&this.forceExpandFunc){var d=this;return this.forceExpandFunc(this._cursor,"first",function(a){a&&d.setCursor(a)})}(a=this._findSibling(this._cursor,!0))&&this.setCursor(a)}return a},_backward:function(f){if(!this._cursor)return null;var a=this._findSibling(this._cursor,!1);a&&a!==this._cursor.parent&&(a=this._drillToLast(a));if(f&&a&&this._expandable(a)&&this.forceExpandFunc&&a!==this._cursor.parent){var d=this;return this.forceExpandFunc(a,"last",function(a){a&&
d.setCursor(a)})}a&&this.setCursor(a);return a},_findSibling:function(f,a){for(var d=this.topLevel(f),e=this._getChildren(f.parent),e=d?this.firstLevelChildren:e,j=0;j<e.length;j++)if(e[j]===f)return j===0&&!a?d?null:f.parent:j===e.length-1&&a?d?null:this._findSibling(f.parent,a):a?e[j+1]:e[j-1];return null},_inParentChain:function(f,a){for(var d=f.parent;d;){if(d===a)return!0;d=d.parent}return!1},_getTopLevelParent:function(f){if(this.topLevel(f))return f;for(f=f.parent;f;){if(this.topLevel(f))return f;
f=f.parent}return null},_onCollapse:function(f){return this._expanded(f.parent)?f:this._onCollapse(f.parent)},_scan:function(f,a,d){this.setCursor(a);var e=[];for(e.push(a);;){if(this.iterate(f))e.push(this.cursor());else break;if(d===this.cursor())return e}return null},setCursor:function(f){this._prevCursor=this._cursor;this._cursor=f},setTree:function(f){this.firstLevelChildren=f;if(this.firstLevelChildren.length>0)this.root=this.firstLevelChildren[0].parent},scan:function(f,a){var d=this.cursor(),
e=this._scan(!0,f,a);e||(e=this._scan(!1,f,a));this.setCursor(d);return e},iterate:function(f,a){return f?this._forward(a):this._backward(a)},iterateOnTop:function(f,a){var d=this._findSibling(this._getTopLevelParent(this.cursor()),f);d?this.setCursor(d):a&&this.firstLevelChildren.length>0&&this.setCursor(f?this.firstLevelChildren[0]:this.firstLevelChildren[this.firstLevelChildren.length-1])},collapse:function(f){if(!this._cursor)return null;return this._inParentChain(this._cursor,f)?(this.setCursor(f),
this._cursor):null},reset:function(){this.root=this._prevCursor=this._cursor=null;if(this.firstLevelChildren.length>0)this._cursor=this.firstLevelChildren[0],this.root=this.firstLevelChildren[0].parent},cursorMoved:function(){return this._cursor!==this._prevCursor},cursor:function(){return this._cursor},prevCursor:function(){return this._prevCursor}};return h}();return k});
define("orion/uiUtils",["orion/webui/littlelib"],function(k){function h(a){var d="",e=navigator.platform.indexOf("Mac")!==-1;e?(a.mod4&&(d+="\u2303"),a.mod3&&(d+="\u2325"),a.mod2&&(d+="\u21e7"),a.mod1&&(d+="\u2318")):(a.mod1&&(d+="Ctrl+"),a.mod2&&(d+="Shift+"),a.mod3&&(d+="Alt+"));if(a.alphaKey)return d+a.alphaKey;if(a.type==="keypress")return d+a.keyCode;for(var j in k.KEY)if(typeof(k.KEY[j]==="number")&&k.KEY[j]===a.keyCode){if(e)switch(k.KEY[j]){case k.KEY.BKSPC:j="\u232b";break;case k.KEY.TAB:j=
"\u21e5";break;case k.KEY.ENTER:j="\u23ce";break;case k.KEY.ESCAPE:j="\u238b";break;case k.KEY.SPACE:j="\u2423";break;case k.KEY.PAGEUP:j="\u21de";break;case k.KEY.PAGEDOWN:j="\u21df";break;case k.KEY.END:j="\u21f2";break;case k.KEY.HOME:j="\u21f1";break;case k.KEY.DEL:j="\u2326"}switch(k.KEY[j]){case k.KEY.DOWN:j="\u2193";break;case k.KEY.UP:j="\u2191";break;case k.KEY.RIGHT:j="\u2192";break;case k.KEY.LEFT:j="\u2190"}return d+j}var c;switch(a.keyCode){case 59:c=a.mod2?":":";";break;case 61:c=a.mod2?
"+":"=";break;case 188:c=a.mod2?"<":",";break;case 190:c=a.mod2?">":".";break;case 191:c=a.mod2?"?":"/";break;case 192:c=a.mod2?"~":"`";break;case 219:c=a.mod2?"{":"[";break;case 220:c=a.mod2?"|":"\\";break;case 221:c=a.mod2?"}":"]";break;case 222:c=a.mod2?'"':"'"}return c?d+c:a.keyCode>=112&&a.keyCode<=123?d+"F"+(a.keyCode-111):d+String.fromCharCode(a.keyCode)}function f(a){var d=window.navigator.platform.indexOf("Mac")!==-1;return d&&a.metaKey||!d&&a.ctrlKey}return{getUserKeyString:function(a){for(var d=
"",a=a.getKeys(),e=0;e<a.length;e++)e!==0&&(d+=" "),d+=h(a[e]);return d},getUserText:function(a){var d=a.id,e=a.refNode,j=a.hideRefNode,c=a.initialText,b=a.onComplete,i=a.onEditDestroy,g=a.selectTo,l=a.isInitialValid,a=a.insertAsChild,f=!1,h=function(a){return function(g){if(!f){var h=k.node(d),m=h.value;if(h)if(a&&g.keyCode===k.KEY.ESCAPE){if(j)e.style.display="inline";f=!0;h.parentNode.removeChild(h);i&&i()}else if(!(a&&g.keyCode!==k.KEY.ENTER)){if(m.length===0||!l&&m===c){if(j)e.style.display=
"inline"}else if(b(m),j&&e.parentNode)e.style.display="inline";f=!0;h.parentNode&&h.parentNode.removeChild(h);i&&i()}}}},o=document.createElement("input");o.id=d;o.value=c||"";a?e.appendChild(o):e.parentNode.insertBefore(o,e.nextSibling);o.classList.add("userEditBoxPrompt");if(j)e.style.display="none";o.addEventListener("keydown",h(!0),!1);o.addEventListener("blur",h(!1),!1);window.setTimeout(function(){o.focus();if(c){var b=k.node(d),a=g?c.indexOf(g):-1;if(a>0)if(b.createTextRange)b=b.createTextRange(),
b.collapse(!0),b.moveStart("character",0),b.moveEnd("character",a),b.select();else if(b.setSelectionRange)b.setSelectionRange(0,a);else{if(b.selectionStart!==void 0)b.selectionStart=0,b.selectionEnd=a}else b.select()}},0)},openInNewWindow:f,followLink:function(a,d){d&&f(d)?window.open(a):window.location=a},createButton:function(a,d){var e=document.createElement("button");e.className="orionButton commandButton commandMargins";e.addEventListener("click",function(a){d();k.stop(a)},!1);a&&e.appendChild(document.createTextNode(a));
return e},createDropdownButton:function(){},isFormElement:function(a){switch(a.tagName.toLowerCase()){case "button":case "fieldset":case "form":case "input":case "keygen":case "label":case "legend":case "meter":case "optgroup":case "output":case "progress":case "select":case "textarea":return!0}return!1}}});
define("orion/explorers/explorerNavHandler",["orion/webui/littlelib","orion/treeModelIterator","orion/uiUtils"],function(k,h,f){var a={},d=navigator.userAgent.indexOf("iPad")!==-1,e=window.navigator.platform.indexOf("Mac")!==-1;a.ExplorerNavHandler=function(){function a(c,b,i){this.explorer=c;this.model=this.explorer.model;this._navDict=b;this._listeners=[];this._selections=[];this._currentColumn=0;c=this._getEventListeningDiv();c.tabIndex=0;c.classList.add("selectionModelContainer");var g=this;this._modelIterator=
new h.TreeModelIterator([],{isExpanded:this.isExpanded.bind(this),getChildrenFunc:i.getChildrenFunc,isExpandable:this.explorer.renderer.isExpandable?function(b){return g.explorer.renderer.isExpandable(b)}:function(b){return g.isExpandable(b)},forceExpandFunc:this.explorer.forceExpandFunc?function(b,c,a){return g.explorer.forceExpandFunc(b,c,a)}:void 0});this._init(i);(!i||i.setFocus!==!1)&&c.focus();i=function(b){if(f.isFormElement(b.target))return!0;if(g.explorer.preventDefaultFunc&&g.explorer.preventDefaultFunc(b,
g._modelIterator.cursor()))return!0;if(b.keyCode===k.KEY.DOWN)return g.onDownArrow(b);else if(b.keyCode===k.KEY.UP)return g.onUpArrow(b);else if(b.keyCode===k.KEY.RIGHT)return g.onRightArrow(b);else if(b.keyCode===k.KEY.LEFT)return g.onLeftArrow(b);else if(b.keyCode===k.KEY.SPACE)return g.onSpace(b);else if(b.keyCode===k.KEY.ENTER)return g.onEnter(b)};c.addEventListener("keydown",i,!1);this._listeners.push({type:"keydown",listener:i});i=function(){if(g.explorer.onFocus)g.explorer.onFocus(!1);else g.toggleCursor(null,
!1)};c.addEventListener("blur",i,!1);this._listeners.push({type:"blur",listener:i});i=function(){if(g.explorer.onFocus)g.explorer.onFocus(!0);else g.toggleCursor(null,!0)};c.addEventListener("focus",i,!1);this._listeners.push({type:"focus",listener:i});this._parentDiv=c}a.prototype={destroy:function(){this._parentDiv.classList.remove("selectionModelContainer");this.removeListeners()},_init:function(c){this._linearGridMove=!1;if(c)this._selectionPolicy=c.selectionPolicy,this.gridClickSelectionPolicy=
c.gridClickSelectionPolicy||"none",this.preventDefaultFunc=c.preventDefaultFunc,this.postDefaultFunc=c.postDefaultFunc},_ctrlKeyOn:function(c){return e?c.metaKey:c.ctrlKey},removeListeners:function(){if(this._listeners)for(var c=0;c<this._listeners.length;c++)this._parentDiv.removeEventListener(this._listeners[c].type,this._listeners[c].listener,!1)},focus:function(){var c=this._getEventListeningDiv();c&&c.focus()},_getEventListeningDiv:function(c){return this.explorer.keyEventListeningDiv&&typeof this.explorer.keyEventListeningDiv===
"function"?this.explorer.keyEventListeningDiv(c):k.node(this.explorer._parentId)},isExpandable:function(c){return!c?!1:k.node(this.explorer.renderer.expandCollapseImageId(this.model.getId(c)))?!0:!1},isExpanded:function(c){return!c?!1:this.explorer.myTree.isExpanded(this.model.getId(c))},refreshSelection:function(c,b){var a=this;this.explorer.selection&&this.explorer.selection.getSelections(function(g){a._clearSelection(b);for(var d=0;d<g.length;d++)a._selections.push(g[d]);a._selections.length>0?
a.cursorOn(a._selections[0],!0,!1,c):a.cursorOn(null,!1,!1,c);if(!(a._shiftSelectionAnchor&&a._inSelection(a._shiftSelectionAnchor)>=0))a._shiftSelectionAnchor=null})},refreshModel:function(c,b,a,g){this._currentColumn=0;this.topIterationNodes=[];this.model=b;this._navDict=c;if(this.model.getTopIterationNodes)this.topIterationNodes=this.model.getTopIterationNodes();else if(a)this.topIterationNodes=a;this._modelIterator.setTree(this.topIterationNodes);!g&&this.explorer.selection&&(this.toggleCursor(this._modelIterator.cursor(),
!1),this._modelIterator.reset());this.refreshSelection(!0)},getTopLevelNodes:function(){return this._modelIterator.firstLevelChildren},_inSelection:function(c){for(var c=this.model.getId(c),b=0;b<this._selections.length;b++)if(c===this.model.getId(this._selections[b]))return b;return-1},_clearSelection:function(c){if(c)for(c=0;c<this._selections.length;c++)this._checkRow(this._selections[c],!0);this._selections=[]},getSelectionPolicy:function(){return this._selectionPolicy},setSelectionPolicy:function(c){if(this._selectionPolicy!==
c)this._selectionPolicy=c,this._selectionPolicy==="cursorOnly"&&this._clearSelection(!0)},setSelection:function(c,b,a){if(this._selectionPolicy==="cursorOnly")b&&this.explorer.renderer._useCheckboxSelection&&this._checkRow(c,!0);else if(this._isRowSelectable(c)){!b||this._selectionPolicy==="singleSelection"?(this._clearSelection(!0),this._checkRow(c,!1),this._selections.push(c),this._lastSelection=c):(b=this._inSelection(c),b>=0?(this._checkRow(c,!0),this._selections.splice(b,1)):(this._checkRow(c,
!1),this._selections.push(c),this._lastSelection=c));if(a)this._shiftSelectionAnchor=this._lastSelection;this.explorer.selection&&(this.explorer.renderer.storeSelections(),this.explorer.selection.setSelections(this._selections))}},moveColumn:function(c,b){c||(c=this.currentModel());var a=this._getGridChildren(c);if(a&&a.length>1||b===0&&a){b!==0&&this.toggleCursor(c,!1);var g=this._currentColumn,d=!0;g+=b;g<0?(this._linearGridMove&&b!==0&&(this._modelIterator.iterate(!1)?c=this.currentModel():d=!1),
g=d?a.length-1:this._currentColumn):g>=a.length&&(this._linearGridMove&&b!==0&&(this._modelIterator.iterate(!0)?c=this.currentModel():d=!1),g=d?0:this._currentColumn);this._currentColumn=g;b!==0&&this.toggleCursor(c,!0);return!0}return!1},_getGridChildren:function(c){return this._navDict?this._navDict.getGridNavHolder(c):null},getCurrentGrid:function(c){c||(c=this.currentModel());return(c=this._getGridChildren(c))&&c.length>0?c[this._currentColumn]:null},getAriaContainerElement:function(c){for(var b=
this._parentDiv,a;c&&c!==b&&(a=c.getAttribute("role"))!=="grid"&&a!=="tree"&&a!=="treegrid";)c=c.parentNode;return c===b?null:c},toggleCursor:function(c,b){var a=this.getRowDiv(c),g=this.getCurrentGrid(c);g?(a&&(b?a.classList.add("treeIterationCursorRow"):a.classList.remove("treeIterationCursorRow")),g.domNode&&(a=this.getAriaContainerElement(g.domNode),b?(g.domNode.classList.add("treeIterationCursor"),a&&a.setAttribute("aria-activedescendant",g.domNode.id)):g.domNode.classList.remove("treeIterationCursor"))):
a&&(b?a.classList.add("treeIterationCursorRow_Dotted"):a.classList.remove("treeIterationCursorRow_Dotted"))},currentModel:function(){return this._modelIterator.cursor()},cursorOn:function(c,b,a,g){var d,e;if(c||b){if(e===this._modelIterator.cursor())return;d=this._modelIterator.cursor();e=c;this._modelIterator.setCursor(e)}else d=this._modelIterator.prevCursor(),e=this._modelIterator.cursor();if(d!==e||b)if(this.toggleCursor(d,!1),!b||e){this.moveColumn(null,0);this.toggleCursor(e,!0);if((c=this.getRowDiv())&&
!g){g=c.parentNode;for(b=document.documentElement;g&&g!==b;){var j=window.getComputedStyle(g,null);if(!j)break;j=j.getPropertyValue("overflow-y");if(j==="auto"||j==="scroll")break;g=g.parentNode}g&&(b=!0,c.offsetTop<=g.scrollTop?(b=!1,a===void 0&&(a=!1)):c.offsetTop+c.offsetHeight>=g.scrollTop+g.clientHeight&&(b=!1,a===void 0&&(a=!0)),b||c.scrollIntoView(!a))}if(this.explorer.onCursorChanged)this.explorer.onCursorChanged(d,e)}},getSelection:function(){return this._selections},getSelectionIds:function(){for(var c=
[],b=0;b<this._selections.length;b++)c.push(this.model.getId(this._selections[b]));return c},getRowDiv:function(c){c=c?c:this._modelIterator.cursor();if(!c)return null;var c=this.model.getId(c),b=this._navDict.getValue(c);return b&&b.rowDomNode?b.rowDomNode:k.node(c)},iterate:function(c,b,a,g){var d=null;if(this.topIterationNodes&&this.topIterationNodes.length!==0)if(g){g=this.currentModel();for((d=this._modelIterator.iterate(c,b))&&this._setCursorOnItem(c,a);d&&d.isNotSelectable;)(d=this._modelIterator.iterate(c,
b))&&this._setCursorOnItem(c,a);d||(this.cursorOn(g,!0,!1,!0),this._setCursorOnItem(c,a))}else(d=this._modelIterator.iterate(c,b))&&this._setCursorOnItem(c,a)},_setCursorOnItem:function(c,b){this.cursorOn(null,!1,c);if(b){var a=this._inSelection(this._modelIterator.prevCursor()),g=this._inSelection(this._modelIterator.cursor());a>=0&&g>=0?this.setSelection(this._modelIterator.prevCursor(),!0):this.setSelection(this.currentModel(),!0)}},_checkRow:function(c,b){if(this.explorer.renderer._useCheckboxSelection&&
this._selectionPolicy!=="singleSelection"){var a=this.getRowDiv(c);if(a){var g=k.node(this.explorer.renderer.getCheckBoxId(a.id)),d=b?!g.checked:!0;if(d!==g.checked)this.explorer.renderer.onCheck(a,g,d,!0)}}else this._select(c,b)},_select:function(c){c||(c=this._modelIterator.cursor());var b=this.getRowDiv(c);b&&(this._inSelection(c)<0?b.classList.add("checkedRow"):b.classList.remove("checkedRow"))},_onModelGrid:function(c,b){var a=this._getGridChildren(c);if(a)for(var g=0;g<a.length;g++)if(b.target===
a[g].domNode)return!0;return!1},onClick:function(c,b){if(this.isDisabled(this.getRowDiv(c)))k.stop(b);else{var a=k.node(this.explorer.renderer.expandCollapseImageId(this.model.getId(c)));if(b.target!==a&&!(this.gridClickSelectionPolicy==="none"&&this._onModelGrid(c,b)))if(this.cursorOn(c,!0,!1,!0),d)this.setSelection(c,!0);else if(this._ctrlKeyOn(b))this.setSelection(c,!0,!0);else if(b.shiftKey&&this._shiftSelectionAnchor){if(a=this._modelIterator.scan(this._shiftSelectionAnchor,c)){this._clearSelection(!0);
for(var g=0;g<a.length;g++)this.setSelection(a[g],!0)}}else this.setSelection(c,!1,!0)}},onCollapse:function(c){this._modelIterator.collapse(c)&&this.cursorOn()},onUpArrow:function(c){this.iterate(!1,!1,c.shiftKey,!0);!this._ctrlKeyOn(c)&&!c.shiftKey&&this.setSelection(this.currentModel(),!1,!0);c.preventDefault();return!1},onDownArrow:function(c){this.iterate(!0,!1,c.shiftKey,!0);!this._ctrlKeyOn(c)&&!c.shiftKey&&this.setSelection(this.currentModel(),!1,!0);c.preventDefault();return!1},_shouldMoveColumn:function(c){var b=
this.currentModel(),a=this._getGridChildren(b);return a&&a.length>1?this.isExpandable(b)?this._ctrlKeyOn(c):!0:!1},onLeftArrow:function(c){if(this._shouldMoveColumn(c))return this.moveColumn(null,-1),c.preventDefault(),!0;var b=this._modelIterator.cursor();if(!b)return!1;if(this.isExpandable(b)&&this.isExpanded(b))return this.explorer.myTree.collapse(b),c.preventDefault(),!0;this._modelIterator.topLevel(b)?this.explorer.scopeUp&&typeof this.explorer.scopeUp==="function"&&this.explorer.scopeUp():(this.cursorOn(b.parent),
this.setSelection(b.parent,!1,!0))},onRightArrow:function(c){if(this._shouldMoveColumn(c))return this.moveColumn(null,1),c.preventDefault(),!0;var b=this._modelIterator.cursor();if(!b)return!1;if(this.isExpandable(b)&&!this.isExpanded(b))return this.explorer.myTree.expand(b),this.explorer.postUserExpand&&this.explorer.postUserExpand(this.model.getId(b)),c.preventDefault(),!1},_isRowSelectable:function(c){return this.explorer.isRowSelectable?this.explorer.isRowSelectable(c):!0},onSpace:function(c){this.setSelection(this.currentModel(),
!0,!0);c.preventDefault()},onEnter:function(c){var b=this.getCurrentGrid(this._modelIterator.cursor());if(b)if(b.widget)if(typeof b.onClick==="function")b.onClick();else typeof b.widget.focus==="function"&&b.widget.focus();else{var a=document.createEvent("MouseEvents");a.initMouseEvent("click",!0,!0,window,0,0,0,0,0,this._ctrlKeyOn(c),!1,!1,!1,0,null);b.domNode.dispatchEvent(a)}else if(b=this._modelIterator.cursor()){if(this.explorer.renderer.getRowActionElement&&(a=this.explorer.renderer.getRowActionElement(this.model.getId(b)),
a.href))this._ctrlKeyOn(c)?window.open(a.href):window.location.href=a.href;if(this.explorer.renderer.performRowAction)return this.explorer.renderer.performRowAction(c,b),c.preventDefault(),!1}},setIsNotSelectable:function(c,b){c.isNotSelectable=b},disableItem:function(c){var b=this.getRowDiv(c);this.isExpandable(c)&&this.isExpanded(c)&&(this._modelIterator.collapse(c),this.explorer.myTree.toggle(b.id));b.classList.remove("checkedRow");b.classList.add("disabledNavRow");this.setIsNotSelectable(c,!0)},
isDisabled:function(c){return c.classList.contains("disabledNavRow")},enableItem:function(c){var b=this.getRowDiv(c);b&&(b.classList.remove("disabledNavRow"),this.setIsNotSelectable(c,!1))}};return a}();a.ExplorerNavDict=function(){function a(c){this._dict={};this._model=c}a.prototype={addRow:function(c,b){this._dict[this._model.getId(c)]={model:c,rowDomNode:b}},getValue:function(c){return this._dict[c]},getGridNavHolder:function(c,b){if(!c)return null;var a=this._model.getId(c);if(this._dict[a]){if(!this._dict[a].gridChildren&&
b)this._dict[a].gridChildren=[];return this._dict[a].gridChildren}return null},initGridNavHolder:function(c){if(!c)return null;c=this._model.getId(c);if(this._dict[c])this._dict[c].gridChildren=null}};return a}();return a});
define("orion/EventTarget",[],function(){function k(){this._namedListeners={}}k.prototype={dispatchEvent:function(h){if(!h.type)throw Error("unspecified type");var f=this._namedListeners[h.type];f&&f.forEach(function(a){try{typeof a==="function"?a(h):a.handleEvent(h)}catch(d){typeof console!=="undefined"&&console.log(d)}});return!h.defaultPrevented},addEventListener:function(h,f){if(typeof f==="function"||f.handleEvent)this._namedListeners[h]=this._namedListeners[h]||[],this._namedListeners[h].push(f)},
removeEventListener:function(h,f){var a=this._namedListeners[h];if(a)for(var d=0;d<a.length;d++)if(a[d]===f){a.length===1?delete this._namedListeners[h]:a.splice(d,1);break}}};k.prototype.constructor=k;k.attach=function(h){var f=new k;h.dispatchEvent=f.dispatchEvent.bind(f);h.addEventListener=f.addEventListener.bind(f);h.removeEventListener=f.removeEventListener.bind(f)};return k});
define("orion/webui/dropdown",["require","orion/webui/littlelib","orion/EventTarget"],function(k,h,f){function a(a){f.attach(this);this._init(a)}a.prototype={_init:function(a){this._dropdownNode=h.node(a.dropdown);if(!this._dropdownNode)throw"no dom node for dropdown found";this._populate=a.populate;this._selectionClass=a.selectionClass;this._parentDropdown=a.parentDropdown;this._positioningNode=a.positioningNode;if(!this._parentDropdown)for(var e=this._dropdownNode.parentNode;e&&document!==e;){if(e.classList&&
e.classList.contains("dropdownMenu")){this._parentDropdown=e.dropdown;break}e=e.parentNode}this._triggerNode=a.triggerNode?a.triggerNode:h.$(".dropdownTrigger",this._dropdownNode.parentNode);if(!this._triggerNode)throw"no dom node for dropdown trigger found";if(!a.skipTriggerEventListeners){var j=this;this._triggerNode.addEventListener("click",function(a){j.toggle(a)&&h.stop(a)},!1);this._triggerNode.tagName.toLowerCase()==="span"&&this._triggerNode.addEventListener("keydown",function(a){if(a.keyCode===
h.KEY.ENTER||a.keyCode===h.KEY.SPACE)j.toggle(),h.stop(a)},!1)}this._dropdownNode.addEventListener("keydown",this._dropdownKeyDown.bind(this),!1)},addTriggerNode:function(a){var e=this;a.addEventListener("click",function(a){e.toggle(a)&&h.stop(a)},!1)},toggle:function(a){return this.isVisible()?this.close():this.open(a)},isVisible:function(){return this._isVisible},open:function(a){var e=!1;if(!this.isVisible()){this.dispatchEvent({type:"triggered",dropdown:this,event:a});h.setFramesEnabled(!1);this._populate&&
(this.empty(),this._populate(this._dropdownNode));var j=this.getItems();if(j.length>0){if(!this._hookedAutoDismiss)this._boundAutoDismiss?h.removeAutoDismiss(this._boundAutoDismiss):this._boundAutoDismiss=this._autoDismiss.bind(this),e=h.$$array(".dropdownSubMenu",this._dropdownNode),h.addAutoDismiss([this._triggerNode].concat(e),this._boundAutoDismiss),this._hookedAutoDismiss=!0;this._triggerNode.classList.add("dropdownTriggerOpen");this._selectionClass&&this._triggerNode.classList.add(this._selectionClass);
this._dropdownNode.classList.add("dropdownMenuOpen");this._isVisible=!0;this._positionDropdown(a);j[0].focus();e=!0;this._parentDropdown&&this._parentDropdown.submenuOpen(this)}}return e},_autoDismiss:function(a){if(this.close(!1)&&this._dropdownNode.contains(a.target))for(a=this._parentDropdown;a;)a.close(!1),a=a._parentDropdown},_positionDropdown:function(){this._dropdownNode.style.left="";this._dropdownNode.style.top="";if(this._positioningNode)this._dropdownNode.style.left=this._positioningNode.offsetLeft+
"px";else{var a=h.bounds(this._dropdownNode),e=h.bounds(document.body);if(a.left+a.width>e.left+e.width)if(this._triggerNode.classList.contains("dropdownMenuItem"))this._dropdownNode.style.left=-a.width+"px";else{var j=h.bounds(this._boundingNode(this._triggerNode)),c=h.bounds(this._triggerNode);this._dropdownNode.style.left=c.left-j.left-a.width+c.width+"px"}a=a.top+a.height-(e.top+e.height);if(0<a)this._dropdownNode.style.top=Math.floor(this._dropdownNode.style.top-a)+"px"}},_boundingNode:function(a){var e=
window.getComputedStyle(a,null);return e===null?a:e.getPropertyValue("position")==="absolute"||!a.parentNode||a===document.body?a:this._boundingNode(a.parentNode)},close:function(a){var e=!1;if(this.isVisible())this._triggerNode.classList.remove("dropdownTriggerOpen"),this._selectionClass&&this._triggerNode.classList.remove(this._selectionClass),this._dropdownNode.classList.remove("dropdownMenuOpen"),h.setFramesEnabled(!0),a&&this._triggerNode.focus(),this._isVisible=!1,e=!0;return e},getItems:function(){var a=
[],e=this;h.$$array("li:not(.dropdownSeparator) > .dropdownMenuItem",this._dropdownNode,!0).forEach(function(j){j.parentNode.parentNode===e._dropdownNode&&a.push(j)});a.forEach(function(a){if(!a._hasDropdownMouseover)a.addEventListener("mouseover",function(c){a.dropdown?a.dropdown.open(c):(e._closeSelectedSubmenu(),h.stop(c))}),a._hasDropdownMouseover=!0});return a},empty:function(){var a=this;h.$$array("li",this._dropdownNode).forEach(function(e){e.parentNode===a._dropdownNode&&e.parentNode.removeChild(e)});
this._hookedAutoDismiss=!1},_dropdownKeyDown:function(a){if(a.keyCode===h.KEY.UP||a.keyCode===h.KEY.DOWN||a.keyCode===h.KEY.RIGHT||a.keyCode===h.KEY.ENTER||a.keyCode===h.KEY.LEFT){var e=this.getItems(),j=document.activeElement;if(e.length&&e.length>0&&j){var c=e.indexOf(j);c<0&&(c=e.indexOf(j.parentNode));c>=0&&(a.keyCode===h.KEY.UP&&c>0?(c--,e[c].focus()):a.keyCode===h.KEY.DOWN&&c<e.length-1?(c++,e[c].focus()):a.keyCode===h.KEY.ENTER||a.keyCode===h.KEY.RIGHT?j.classList.contains("dropdownTrigger")&&
j.dropdown&&j.dropdown.open():a.keyCode===h.KEY.LEFT&&j.parentNode.parentNode.classList.contains("dropdownMenuOpen")&&this.close(!0),h.stop(a))}}else a.keyCode===h.KEY.ESCAPE&&(this.close(!0),h.stop(a))},submenuOpen:function(a){if(a!==this._selectedSubmenu)this._closeSelectedSubmenu(),this._selectedSubmenu=a},_closeSelectedSubmenu:function(){for(var a=this._selectedSubmenu;a;)a.close(),a=a._selectedSubmenu},destroy:function(){this.empty();this._boundAutoDismiss&&h.removeAutoDismiss(this._boundAutoDismiss)}};
a.prototype.constructor=a;return{Dropdown:a}});
define("text",["module"],function(k){var h,f,a=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"],d=/^\s*<\?xml(\s)+version=[\'\"](\d)*.(\d)*[\'\"](\s)*\?>/im,e=/<body[^>]*>\s*([\s\S]+)\s*<\/body>/im,j=typeof location!=="undefined"&&location.href,c=j&&location.protocol&&location.protocol.replace(/\:/,""),b=j&&location.hostname,i=j&&(location.port||void 0),g=[],l=k.config&&k.config()||{};h={version:"2.0.5",strip:function(b){if(b){var b=b.replace(d,""),a=b.match(e);a&&(b=a[1])}else b="";return b},
jsEscape:function(b){return b.replace(/(['\\])/g,"\\$1").replace(/[\f]/g,"\\f").replace(/[\b]/g,"\\b").replace(/[\n]/g,"\\n").replace(/[\t]/g,"\\t").replace(/[\r]/g,"\\r").replace(/[\u2028]/g,"\\u2028").replace(/[\u2029]/g,"\\u2029")},createXhr:l.createXhr||function(){var b,c,g;if(typeof XMLHttpRequest!=="undefined")return new XMLHttpRequest;else if(typeof ActiveXObject!=="undefined")for(c=0;c<3;c+=1){g=a[c];try{b=new ActiveXObject(g)}catch(i){}if(b){a=[g];break}}return b},parseName:function(b){var a,
c,g=!1,i=b.indexOf(".");a=b.indexOf("./")===0||b.indexOf("../")===0;i!==-1&&(!a||i>1)?(a=b.substring(0,i),c=b.substring(i+1,b.length)):a=b;b=c||a;i=b.indexOf("!");i!==-1&&(g=b.substring(i+1)==="strip",b=b.substring(0,i),c?c=b:a=b);return{moduleName:a,ext:c,strip:g}},xdRegExp:/^((\w+)\:)?\/\/([^\/\\]+)/,useXhr:function(b,a,c,g){var i,d;i=h.xdRegExp.exec(b);if(!i)return!0;b=i[2];i=i[3];i=i.split(":");d=i[1];i=i[0];return(!b||b===a)&&(!i||i.toLowerCase()===c.toLowerCase())&&(!d&&!i||d===g)},finishLoad:function(b,
a,c,i){c=a?h.strip(c):c;l.isBuild&&(g[b]=c);i(c)},load:function(a,g,d,e){if(e.isBuild&&!e.inlineText)d();else{l.isBuild=e.isBuild;var f=h.parseName(a),e=f.moduleName+(f.ext?"."+f.ext:""),k=g.toUrl(e),q=l.useXhr||h.useXhr;!j||q(k,c,b,i)?h.get(k,function(b){h.finishLoad(a,f.strip,b,d)},function(b){d.error&&d.error(b)}):g([e],function(b){h.finishLoad(f.moduleName+"."+f.ext,f.strip,b,d)})}},write:function(b,a,c){if(g.hasOwnProperty(a)){var i=h.jsEscape(g[a]);c.asModule(b+"!"+a,"define(function () { return '"+
i+"';});\n")}},writeFile:function(b,a,c,g,i){var a=h.parseName(a),d=a.ext?"."+a.ext:"",e=a.moduleName+d,f=c.toUrl(a.moduleName+d)+".js";h.load(e,c,function(){var a=function(b){return g(f,b)};a.asModule=function(b,a){return g.asModule(b,f,a)};h.write(b,e,a,i)},i)}};if(l.env==="node"||!l.env&&typeof process!=="undefined"&&process.versions&&process.versions.node)f=require.nodeRequire("fs"),h.get=function(b,a){var c=f.readFileSync(b,"utf8");c.indexOf("\ufeff")===0&&(c=c.substring(1));a(c)};else if(l.env===
"xhr"||!l.env&&h.createXhr())h.get=function(b,a,c,g){var i=h.createXhr(),d;i.open("GET",b,!0);if(g)for(d in g)g.hasOwnProperty(d)&&i.setRequestHeader(d.toLowerCase(),g[d]);if(l.onXhr)l.onXhr(i,b);i.onreadystatechange=function(){var g;if(i.readyState===4)g=i.status,g>399&&g<600?(g=Error(b+" HTTP status: "+g),g.xhr=i,c(g)):a(i.responseText)};i.send(null)};else if(l.env==="rhino"||!l.env&&typeof Packages!=="undefined"&&typeof java!=="undefined")h.get=function(b,a){var c,g,i=new java.io.File(b),d=java.lang.System.getProperty("line.separator"),
i=new java.io.BufferedReader(new java.io.InputStreamReader(new java.io.FileInputStream(i),"utf-8")),e="";try{c=new java.lang.StringBuffer;(g=i.readLine())&&g.length()&&g.charAt(0)===65279&&(g=g.substring(1));for(g!==null&&c.append(g);(g=i.readLine())!==null;)c.append(d),c.append(g);e=String(c.toString())}finally{i.close()}a(e)};return h});define("text!orion/webui/dropdowntriggerbutton.html",[],function(){return'<button class="dropdownTrigger">${ButtonText}<\!--span class="dropdownArrowDown core-sprite-openarrow"></span--\></button><ul class="dropdownMenu"></ul>'});
define("text!orion/webui/dropdowntriggerbuttonwitharrow.html",[],function(){return'<button class="dropdownTrigger dropdownDefaultButton">${ButtonText}<span class="dropdownArrowDown core-sprite-openarrow"></span></button><ul class="dropdownMenu"></ul>'});define("text!orion/webui/submenutriggerbutton.html",[],function(){return'<li class="dropdownSubMenu"><span class="dropdownTrigger dropdownMenuItem" role="menuitem" tabindex="0"><span class="dropdownCommandName">${ButtonText}</span><span class="dropdownArrowRight core-sprite-closedarrow"></span></span><ul class="dropdownMenu"></ul></li>'});
define("text!orion/webui/checkedmenuitem.html",[],function(){return'<li><label class="dropdownMenuItem"><input class="checkedMenuItem" role="menuitem" type="checkbox" />${ItemText}</label></li>'});
define("orion/webui/tooltip",["require","orion/webui/littlelib"],function(k,h){function f(a){this._init(a)}f.prototype={_init:function(a){this._node=h.node(a.node);if(!this._node)throw"no dom node for tooltip found";this._position=a.position||["right","above","below","left"];this._text=a.text;this._hideDelay=a.hideDelay===void 0?200:a.hideDelay;this._tailSize=a.tailSize||10;this._trigger=a.trigger||"mouseover";this._afterShowing=a.afterShowing;this._afterHiding=a.afterHiding;var d=this;if(this._trigger===
"click")this._showDelay=0,this._node.addEventListener("click",this._clickHandler=function(a){a.target===d._node&&(d.show(),h.stop(a))},!1);else if(this._trigger==="mouseover"){this._showDelay=a.showDelay===void 0?500:a.showDelay;a=["mouseout","click"];this._node.addEventListener("mouseover",this._mouseoverHandler=function(a){h.contains(d._node,a.target)&&(d.show(),h.stop(a))},!1);this._leaveHandler=function(a){h.contains(d._node,a.target)&&d.hide()};for(var e=0;e<a.length;e++)this._node.addEventListener(a[e],
this._leaveHandler,!1)}},_makeTipNode:function(){if(!this._tip){this._tip=document.createElement("span");this._tip.classList.add("tooltipContainer");this._tipInner=document.createElement("div");this._tipInner.classList.add("tooltip");if(this._text)this._tipTextContent=document.createElement("div"),this._tipTextContent.classList.add("textContent"),this._tipInner.appendChild(this._tipTextContent),this._tipTextContent.appendChild(document.createTextNode(this._text));this._tip.appendChild(this._tipInner);
document.body.appendChild(this._tip);var a=this;h.addAutoDismiss([this._tip,this._node],function(){a.hide()});if(this._trigger==="mouseover")this._tipInner.role="tooltip",this._tipInner.id="tooltip"+(new Date).getTime().toString(),this._node.setAttribute("aria-describedby",this._tipInner.id),this._tip.addEventListener("mouseover",function(){if(a._timeout)window.clearTimeout(a._timeout),a._timeout=null;a._tip.addEventListener("mouseout",function(d){h.contains(a._tip,d.target)&&(a.hide(),h.stop(d))},
!1)},!1)}return this._tip},_positionTip:function(a,d){this._makeTipNode();a==="left"?this._tipInner.classList.add("left"):this._tipInner.classList.remove("left");var e=this._node,f;for(f=h.bounds(e);e&&!f.width&&!f.height;e=e.parentNode)f=h.bounds(e);var e=h.bounds(this._tipInner),c;switch(a){case "above":c=f.top-e.height-this._tailSize-1;f=f.left-this._tailSize;break;case "below":c=f.top+f.height+this._tailSize+1;f=f.left-this._tailSize;break;case "left":c=f.top-this._tailSize/2;f=f.left-e.width-
this._tailSize-1;break;default:c=f.top-this._tailSize/2,f=f.left+f.width+this._tailSize+1}var b=h.bounds(document.documentElement);if(c+e.height>b.height)if(d)c=b.height-e.height-1;else return!1;if(f+e.width>b.width)if(d)f=b.width-e.width-1;else return!1;if(f<0)if(d)f=4;else return!1;if(c<0)if(d)c=4;else return!1;if(this._tail&&this._tail.previousPosition!==a)this._tip.removeChild(this._tail),this._tail=null;if(!this._tail){this._tail=document.createElement("span");this._tail.classList.add("tooltipTailFrom"+
a);a==="above"||a==="left"?this._tip.appendChild(this._tail):this._tip.insertBefore(this._tail,this._tipInner);if(a==="left")this._tail.style.left=e.width+"px";this._tail.previousPosition=a}this._tip.style.top=c+"px";this._tip.style.left=f+"px";return!0},contentContainer:function(){this._makeTipNode();return this._tipInner},show:function(){if(!this._tip||!this._tip.classList.contains("tooltipShowing")){if(this._timeout)window.clearTimeout(this._timeout),this._timeout=null;this._showDelay?this._timeout=
window.setTimeout(this._showImmediately.bind(this),this._showDelay):this._showImmediately()}},_showImmediately:function(){for(var a=!1,d=0;!a&&d<this._position.length;)a=this._positionTip(this._position[d]),d++;a||this._positionTip(this._position[0],!0);this._tip.classList.add("tooltipShowing");this._afterShowing&&this._afterShowing()},hide:function(a){if(this._timeout)window.clearTimeout(this._timeout),this._timeout=null;if(this._tip&&this._tip.classList.contains("tooltipShowing")){if(a===void 0)a=
this._hideDelay;var d=this;this._timeout=window.setTimeout(function(){d._tip.classList.remove("tooltipShowing");d._tip.removeAttribute("style");d._afterHiding&&d._afterHiding()},a)}},destroy:function(){if(this._timeout)window.clearTimeout(this._timeout),this._timeout=null;if(this._tip)document.body.removeChild(this._tip),this._tail=this._tipTextContent=this._tipInner=this._tip=null;if(this._node){this._node.removeEventListener("click",this._clickHandler,!1);this._node.removeEventListener("mouseover",
this._mouseoverHandler,!1);for(var a=["mouseout","click"],d=0;d<a.length;d++)this._node.removeEventListener(a[d],this._leaveHandler,!1)}}};f.prototype.constructor=f;return{Tooltip:f}});
define("orion/commands","orion/util,orion/webui/littlelib,orion/webui/dropdown,text!orion/webui/dropdowntriggerbutton.html,text!orion/webui/dropdowntriggerbuttonwitharrow.html,text!orion/webui/submenutriggerbutton.html,text!orion/webui/checkedmenuitem.html,orion/webui/tooltip".split(","),function(k,h,f,a,d,e,j,c){function b(b){var a=b.invocation;if(a){var c=b.command;if(c.hrefCallback)return b=c.hrefCallback.call(a.handler||window,a),b.then?b.then(function(b){window.open(b)}):window.open(b),!0;else if(a.commandRegistry)return a.commandRegistry._invoke(a),
!0;else if(c.onClick||c.callback)return window.setTimeout(function(){(c.onClick||c.callback).call(a.handler||window,a)},0),!0}return!1}function i(a,c){for(var g in c)if(c[g]&&c[g].keyBinding&&c[g].command&&c[g].keyBinding.match(a)){var i=c[g],d=i.keyBinding;if((!d.domScope||h.contains(h.node(d.domScope),a.target))&&b(i)){h.stop(a);break}}}function g(){var b={};if(q){var a,c,g;c=Object.keys(s);for(a=0;a<c.length;a++)g=c[a],b[g]=s[g];var i=q();c=Object.keys(i);for(a=0;a<c.length;a++)g=c[a],b[g]=i[g]}else b=
s;return b}function l(b){i(b,g())}function n(b,a){b=b||window.event;if(function(b){if(k.isMac){if(b.metaKey&&!b.altKey)return!b.shiftKey&&!b.ctrlKey&&(b.keyCode===65||b.keyCode===67||b.keyCode===86||b.keyCode===88||b.keyCode===90)?!0:!1;if(b.ctrlKey)return!1}else{if(b.ctrlKey&&!b.altKey)return!b.shiftKey&&(b.keyCode===65||b.keyCode===67||b.keyCode===86||b.keyCode===88||b.keyCode===90)?!0:!1;if(b.altKey&&!b.ctrlKey)return!1}if(b["char"])return b["char"].length>0;else if(b.charCode||b.keyCode)switch(b=
b.charCode||b.keyCode,b){case 8:case 9:case 13:case 46:return!0;default:return b>=32&&b<112||b>123}return!1}(b)){if(b.target.contentEditable==="true")return;var c=b.target.nodeName.toLowerCase();if(c==="input")switch(b.target.type.toLowerCase()){case "text":case "password":case "search":case "color":case "date":case "datetime":case "datetime-local":case "email":case "month":case "number":case "range":case "tel":case "time":case "url":case "week":return}else if(c==="textarea")return}a?a(b):l(b)}function m(){this._init()}
function o(b,a,c){a.classList.add("commandImage");var g;b.imageClass?b.addImageClassToElement?a.classList.add(b.imageClass):(g=document.createElement("span"),a.appendChild(g),g.classList.add(b.spriteClass),g.classList.add(b.imageClass)):(g=new Image,g.alt=b.name,g.name=c,g.id=c,g.src=b.image,a.appendChild(g));return g}function r(b,a){var c=document.createElement("span");c.classList.add("dropdownKeyBinding");c.appendChild(document.createTextNode(a));b.appendChild(c)}function t(b,a,c,g,i){this.commandRegistry=
i;this.handler=b;this.items=a;this.userData=c;this.command=g;if(g.parameters)this.parameters=g.parameters.makeCopy();this.id=g.id}function p(b){this._init(b)}var q=null,s={};m.prototype={setProxy:function(b){this.proxy=b},setKeyBindings:function(b){this.bindings=b},_init:function(){var b=this;document.addEventListener("keydown",function(a){return n(a,function(a){var c=b.proxy,g=b.bindings;if(g&&c)for(var i=0;i<g.length;i++)g[i].match(a)&&(c.processKey({type:a.type,keyCode:a.keyCode,altKey:a.altKey,
ctrlKey:a.ctrlKey,metaKey:a.metaKey,shiftKey:a.shiftKey}),h.stop(a))})})}};window.document.addEventListener("keydown",n,!1);t.prototype={collectsParameters:function(){return this.commandRegistry&&this.commandRegistry.collectsParameters()},makeCopy:function(b){var a=new t(this.handler,this.items,this.userData,this.command,this.commandRegistry);a.domNode=this.domNode;a.domParent=this.domParent;if(b)a.parameters=b.makeCopy();else if(this.parameters)a.parameters=this.parameters.makeCopy();return a}};
t.prototype.constructor=t;p.prototype={_init:function(b){this.id=b.id;this.name=b.name;this.tooltip=b.tooltip;this.callback=b.callback;this.hrefCallback=b.hrefCallback;this.choiceCallback=b.choiceCallback;this.positioningNode=b.positioningNode;this.image=b.image||"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAAA1BMVEUAAACnej3aAAAAAXRSTlMAQObYZgAAAAtJREFUCNdjIBEAAAAwAAFletZ8AAAAAElFTkSuQmCC";this.imageClass=b.imageClass;this.addImageClassToElement=b.addImageClassToElement;this.selectionClass=
b.selectionClass;this.spriteClass=b.spriteClass||"commandSprite";this.visibleWhen=b.visibleWhen;this.parameters=b.parameters;this.isEditor=b.isEditor},populateChoicesMenu:function(b,a,c,g,i){var c=this.getChoices(a,c,g),d=c.some(function(b){return b.checked});c.forEach(function(c){if(c.name){var g=document.createElement("li");b.appendChild(g);var e=document.createElement("span");e.tabIndex=0;e.role="menuitem";e.classList.add("dropdownMenuItem");if(d){var f=document.createElement("span");f.classList.add("check");
f.appendChild(document.createTextNode(c.checked?"\u25cf":""));e.appendChild(f)}f=document.createTextNode(c.name);e.appendChild(f);g.appendChild(e);e.choice=c;e.addEventListener("click",function(b){b.target.choice&&b.target.choice.callback.call(b.target.choice,a)},!1);e.addEventListener("keydown",function(b){(b.keyCode===h.KEY.ENTER||b.keyCode===h.KEY.SPACE)&&b.target.choice&&b.target.choice.callback.call(b.target.choice,a)},!1)}else i._generateMenuSeparator(b)})},getChoices:function(b,a,c){return this.choiceCallback?
this.choiceCallback.call(a,b,c):null},makeChoiceCallback:function(b,a){return function(c){b.callback&&b.callback.call(b,a,c)}},hasImage:function(){return this.imageClass||this.image!=="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAAA1BMVEUAAACnej3aAAAAAXRSTlMAQObYZgAAAAtJREFUCNdjIBEAAAAwAAFletZ8AAAAAElFTkSuQmCC"}};p.prototype.constructor=p;return{Command:p,CommandInvocation:t,createDropdownMenu:function(b,c,g,i,e,l,j,k,n){b=h.node(b);if(!b)throw"no parent node was specified";
var m=document.createRange();m.selectNode(b);m=n?m.createContextualFragment(d):m.createContextualFragment(a);h.processTextNodes(m,{ButtonText:c});b.appendChild(m);var b=b.lastChild,r;n?(n=b.previousSibling,r=n.lastChild):n=b.previousSibling;i?n.classList.add(i):(n.classList.add("orionButton"),n.classList.add("commandButton"));if(e){if(!l)n.textContent="",n.setAttribute("aria-label",c);o({spriteClass:"commandSprite",imageClass:e},n,c);n.classList.add("orionButton")}n.dropdown=new f.Dropdown({dropdown:b,
populate:g,selectionClass:j,skipTriggerEventListeners:!!r,positioningNode:k});b.dropdown=n.dropdown;return{menuButton:n,menu:b,dropdown:n.dropdown,dropdownArrow:r}},createCheckedMenuItem:function(b,a,c,g){b=h.node(b);if(!b)throw"no parent node was specified";var i=document.createRange();i.selectNode(b);i=i.createContextualFragment(j);h.processTextNodes(i,{ItemText:a});b.appendChild(i);b=h.$(".checkedMenuItem",b.lastChild);b.checked=c;b.addEventListener("change",g,!1);return b},createCommandItem:function(b,
a,g,i,d,e,f){var h,e=e||!a.name&&a.hasImage();if(a.hrefCallback)h=document.createElement("a"),h.id=i,e&&a.hasImage()?o(a,h,i):(h.className="commandLink",h.appendChild(document.createTextNode(a.name))),f=a.hrefCallback.call(g.handler,g),f.then?f.then(function(b){h.href=b}):h.href=f?f:"#";else{h=document.createElement("button");h.className="orionButton";e?a.hasImage()?(o(a,h,i),a.name&&h.setAttribute("aria-label",a.name)):(h.classList.add("commandButton"),h.classList.add("commandMissingImageButton"),
h.appendChild(document.createTextNode(a.name))):(h.classList.add("commandButton"),i=document.createTextNode(a.name),h.appendChild(i));var l=f||a.callback;if(l)a.onClick=l,h.addEventListener("click",function(){l.call(g.handler,g)},!1)}b.nodeName.toLowerCase()==="ul"?(f=document.createElement("li"),b.appendChild(f),b=f):h.classList.add("commandMargins");b.appendChild(h);if(a.tooltip)h.commandTooltip=new c.Tooltip({node:h,text:a.tooltip,position:["above","below","right","left"]});d&&(s[a.id]={keyBinding:d,
command:a,invocation:g});return h},createCommandMenuItem:function(b,a,g,i,d,e){var f,l=b.dropdown;if(a.hrefCallback){f=document.createElement("a");var j=document.createElement("span");j.appendChild(document.createTextNode(a.name));j.classList.add("dropdownCommandName");f.appendChild(j);d=a.hrefCallback.call(g.handler,g);d.then?d.then(function(b){f.href=b}):f.href=d?d:"#";f.addEventListener("keydown",function(b){(b.keyCode===h.KEY.ENTER||b.keyCode===h.KEY.SPACE)&&f.click()},!1)}else{f=document.createElement("span");
f.tabIndex=0;j=document.createElement("span");j.appendChild(document.createTextNode(a.name));j.classList.add("dropdownCommandName");f.appendChild(j);var k=d||a.callback;if(k)a.onClick=k,f.addEventListener("click",function(){l.close(!0);k.call(g.handler,g)},!1),f.addEventListener("keydown",function(b){if(b.keyCode===h.KEY.ENTER||b.keyCode===h.KEY.SPACE)b.preventDefault(),f.click()},!1)}f.className="dropdownMenuItem";f.role="menuitem";if(a.tooltip)f.commandTooltip=new c.Tooltip({node:f,text:a.tooltip,
position:["above","below","right","left"]});e&&r(f,e);e=document.createElement("li");b.appendChild(e);e.appendChild(f);i&&(s[a.id]={keyBinding:i,command:a,invocation:g});return f},executeBinding:b,setKeyBindingProvider:function(b){q=b},localKeyBindings:s,CommandsProxy:m,getKeyBindings:g,processKey:l,NO_IMAGE:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAAA1BMVEUAAACnej3aAAAAAXRSTlMAQObYZgAAAAtJREFUCNdjIBEAAAAwAAFletZ8AAAAAElFTkSuQmCC",_testMethodProcessKey:i}});
define("orion/explorers/explorer","i18n!orion/nls/messages,require,orion/webui/littlelib,orion/webui/treetable,orion/explorers/explorerNavHandler,orion/commands".split(","),function(k,h,f,a,d,e){var j={};j.Explorer=function(){function c(b,a,c,d){this.registry=b;this.renderer=c;this.selection=a;this.commandService=d;if(this.renderer)this.renderer.explorer=this;this.myTree=null}c.prototype={destroy:function(){this._navHandler&&this._navHandler.destroy();this.model&&this.model.destroy();this.myTree&&
this.myTree.destroy();this.destroyed=!0},changedItem:function(b,a){this.myTree&&this.myTree.refresh.bind(this.myTree)(b,a,!0)},updateCommands:function(b){this.myTree&&this.myTree._renderer.updateCommands.bind(this.myTree._renderer)(b)},makeNewItemPlaceHolder:function(b,a,c,d){b=this.getRow(b);if(c)return b=b.childNodes[c],b.appendChild(document.createElement("br")),d=document.createElement("span"),d.id=a+"placeHolderRow",b.appendChild(d),{tempNode:d,refNode:d};if(b){var e=document.createElement("tr");
e.id=a+"placeHolderRow";c=document.createElement("td");c.id=a+"placeHolderCol";e.appendChild(c);d?(b.parentNode.insertBefore(e,b.nextSibling),b=parseInt(b.firstChild.style.paddingLeft),c.style.paddingLeft=this.myTree.getIndent()+b+"px"):b.appendChild(e);d=f.node(a+"placeHolderRow");b=f.node(a+"placeHolderCol");if(d&&b)return{tempNode:d,refNode:b}}return null},getRow:function(b){if(b=this.model.getId(b))return f.node(b)},collapseAll:function(){for(var b=this._navHandler.getTopLevelNodes(),a=0;a<b.length;a++)this.myTree.collapse(b[a])},
expandAll:function(b){if(b)this._expandRecursively(b);else if(this._navHandler)for(var b=this._navHandler.getTopLevelNodes(),a=0;a<b.length;a++)this._expandRecursively(b[a])},_expandRecursively:function(b){if(this._navHandler&&this._navHandler.isExpandable(b)){var a=this;this.myTree.expand(b,function(){a.model.getChildren(b,function(b){if(!(b===void 0||b===null))for(var c=b.length,d=0;d<c;d++)a._expandRecursively(b[d])})})}},createTree:function(b,c,g){b=typeof b==="string"?b:b.id||b;this.selection&&
this.selection.setSelections([]);this.getNavHandler()&&this.getNavHandler()._clearSelection();var e=b+"innerTree",h=f.node(e);h&&f.empty(h);if(c)c.rootId=e;this.model=c;this._parentId=b;this._treeOptions=g;if(!g||g&&!g.noSelection)this.selectionPolicy=g?g.selectionPolicy:"",this._navDict=new d.ExplorerNavDict(this.model);this.myTree=new a.TableTree({id:e,model:c,parent:b,onComplete:g?g.onComplete:void 0,labelColumnIndex:this.renderer.getLabelColumnIndex(),renderer:this.renderer,showRoot:g?!!g.showRoot:
!1,indent:g?g.indent:void 0,onCollapse:g?g.onCollapse:void 0,navHandlerFactory:g?g.navHandlerFactory:void 0,tableElement:g?g.tableElement:void 0,tableBodyElement:g?g.tableBodyElement:void 0,tableRowElement:g?g.tableRowElement:void 0});this.renderer._initializeUIState();this.selectionPolicy==="cursorOnly"&&this.initNavHandler()},getNavHandler:function(){return this._navHandler},getNavDict:function(){return this._navDict},refreshSelection:function(){if(this.selection){var b=this.getNavHandler(),a=[];
if(b&&this.getNavDict())for(var c=b.getSelection(),d=0;d<c.length;d++){var e=b.getRowDiv(c[d]);e&&e.parentNode&&(e=this.getNavDict().getValue(this.model.getId(c[d])),e.model&&a.push(e.model))}this.selection.setSelections(a)}},getRootPath:function(){return this.model&&this.model.root?this.model.root.Location:null},initNavHandler:function(){var b=this._treeOptions;if(!b||b&&!b.noSelection){if(!this.getNavHandler())this._navHandler=b&&b.navHandlerFactory&&typeof b.navHandlerFactory.createNavHandler===
"function"?b.navHandlerFactory.createNavHandler(this,this._navDict,b):new d.ExplorerNavHandler(this,this._navDict,{getChildrenFunc:b?b.getChildrenFunc:null,setFocus:b&&b.setFocus,selectionPolicy:b?b.selectionPolicy:null});var a=this;this.model.getRoot(function(c){c instanceof Array?a.getNavHandler().refreshModel(a.getNavDict(),a.model,c):c.children&&c.children instanceof Array&&a.getNavHandler().refreshModel(a.getNavDict(),a.model,c.children);b&&b.setFocus&&a.getNavHandler().cursorOn(null,!1,!1,!0)})}},
_lastHash:null,checkbox:!1};return c}();j.createExplorerCommands=function(a,b){function d(a){return typeof a.getItemCount==="function"?a.getItemCount()>0?b?b(a):!0:!1:!1}var g=new e.Command({tooltip:k["Expand all"],imageClass:"core-sprite-expandAll",id:"orion.explorer.expandAll",groupId:"orion.explorerGroup",visibleWhen:function(b){return d(b)},callback:function(b){b.items.expandAll()}}),f=new e.Command({tooltip:k["Collapse all"],imageClass:"core-sprite-collapseAll",id:"orion.explorer.collapseAll",
groupId:"orion.explorerGroup",visibleWhen:function(b){return d(b)},callback:function(b){b.items.collapseAll()}});a.addCommand(g);a.addCommand(f)};j.ExplorerModel=function(){function a(b,c,g){this.rootPath=b;this.fetchItems=c;this.idPrefix=g||""}a.prototype={destroy:function(){this.destroyed=!0},getRoot:function(b){var a=this;this.fetchItems(this.rootPath).then(function(c){a.root=c;b(c)})},getChildren:function(b,a){b.Children?a(b.Children):b.ChildrenLocation?this.fetchItems(b.ChildrenLocation).then(function(c){b.Children=
c;a(c)}):a([])},getId:function(b){if(b.Location===this.root.Location)return this.rootId;for(var b=b.Location.replace(/[\\\/]/g,""),a=this.idPrefix,c=0;c<b.length;c++)a+=b[c].match(/[^\.\:\-\_0-9A-Za-z]/g)?b.charCodeAt(c):b[c];return a}};return a}();j.ExplorerFlatModel=function(){function a(b,c,g){this.rootPath=b;this.fetchItems=c;this.root=g}a.prototype=new j.ExplorerModel;a.prototype.getRoot=function(b){if(this.root)b(this.root);else{var a=this;this.fetchItems(this.rootPath).then(function(c){a.root=
c;b(c)})}};a.prototype.getChildren=function(b,a){b===this.root?a(this.root):a([])};return a}();j.ExplorerRenderer=function(){function a(b,c){this.explorer=c;this._init(b);this._expandImageClass="core-sprite-openarrow";this._collapseImageClass="core-sprite-closedarrow";this._progressImageClass="core-sprite-progress";this._twistieSpriteClass="modelDecorationSprite"}a.prototype={_init:function(b){if(b){this._useCheckboxSelection=b.checkbox===void 0?!1:b.checkbox;this.selectionPolicy=b.singleSelection?
"singleSelection":"";this._cachePrefix=b.cachePrefix;this.getCheckedFunc=b.getCheckedFunc;this.onCheckedFunc=b.onCheckedFunc;this._highlightSelection=!0;this._treeTableClass=b.treeTableClass||"treetable";if(b.highlightSelection===!1)this._highlightSelection=!1;if(!this.actionScopeId)this.actionScopeId=b.actionScopeId;if(!this.commandService)this.commandService=b.commandService}},getLabelColumnIndex:function(){return this.explorer.checkbox?1:0},initTable:function(b,a){this.tableTree=a;this.tableNode=
b;f.empty(b);this._treeTableClass&&b.classList.add(this._treeTableClass);this.renderTableHeader(b)},getActionsColumn:function(b,a,c,d,e){var c=c||"tool",f=document.createElement("td");f.id=a.id+"actionswrapper";d&&f.classList.add(d);this.actionScopeId&&this.commandService?this.commandService.renderCommands(this.actionScopeId,f,b,this.explorer,c,null,e&&this.explorer.getNavDict()?this.explorer.getNavDict().getGridNavHolder(b,!0):null):window.console.log("Warning, no command service or action scope was specified.  No commands rendered.");
return f},initCheckboxColumn:function(){if(this._useCheckboxSelection)return document.createElement("th")},getCheckboxColumn:function(b,a){if(this._useCheckboxSelection){var c=document.createElement("td"),d=document.createElement("span");d.id=this.getCheckBoxId(a.id);d.classList.add("core-sprite-check");d.classList.add("selectionCheckmarkSprite");d.rowId=a.id;if(this.getCheckedFunc)d.checked=this.getCheckedFunc(b),d.checked?(this._highlightSelection&&a.classList.add("checkedRow"),d.classList.add("core-sprite-check_on")):
(this._highlightSelection&&a.classList.remove("checkedRow"),d.classList.remove("core-sprite-check_on"));c.appendChild(d);var e=this;d.addEventListener("click",function(b){e.onCheck(a,b.target,b.target.checked?!1:!0,!0)},!1);return c}},getCheckBoxId:function(b){return b+"selectedState"},onCheck:function(b,a,c,d,e){(a.checked=c)?a.classList.add("core-sprite-check_on"):a.classList.remove("core-sprite-check_on");if(this.onCheckedFunc)this.onCheckedFunc(a.rowId,c,d);this.explorer.getNavHandler()&&e&&this.explorer.getNavHandler().setSelection(this.explorer.getNavDict().getValue(b.id).model,
!0)},storeSelections:function(){if(this.explorer.getNavHandler()){var b=this.explorer.getNavHandler().getSelectionIds(),a=this._getUIStatePreferencePath();a&&window.sessionStorage&&(window.sessionStorage[a+"selection"]=JSON.stringify(b))}},_restoreSelections:function(b){var a=this.explorer.getNavDict(),c=this.explorer.getNavHandler();if(c&&a&&c.getSelectionPolicy()!=="cursorOnly"&&(b=window.sessionStorage[b+"selection"],typeof b==="string"&&(b=b.length>0?JSON.parse(b):null),b)){for(var d=[],c=0;c<
b.length;c++){var e=a.getValue(b[c]);if(e&&e.rowDomNode&&e.model&&(d.push(e.model),this._highlightSelection&&e.rowDomNode.classList.add("checkedRow"),e=f.node(this.getCheckBoxId(e.rowDomNode.id))))e.checked=!0,e.classList.add("core-sprite-check_on")}this.explorer.selection&&(this.explorer.selection.setSelections(d),this.explorer.getNavHandler()&&this.explorer.getNavHandler().refreshSelection())}},_storeExpansions:function(b){window.sessionStorage[b+"expanded"]=JSON.stringify(this._expanded)},_restoreExpansions:function(b){var a=
!1,c=window.sessionStorage[b+"expanded"];typeof c==="string"&&(c=c.length>0?JSON.parse(c):null);var d;if(c)for(d=0;d<c.length;d++)if(f.node(c[d])){this._expanded.push(c[d]);var e=this;this.tableTree.expand(c[d],function(){e._restoreSelections(b)});a=!0}return!a},_getUIStatePreferencePath:function(){if(this.explorer){var b=this.explorer.getRootPath();if(this._cachePrefix&&b)return"/"+this._cachePrefix+"/"+b.replace(/[^\.\:\-\_0-9A-Za-z]/g,"")+"/uiState"}return null},expandCollapseImageId:function(b){return b+
"__expand"},updateExpandVisuals:function(b,a){var c=f.node(this.expandCollapseImageId(b.id));c&&(c.classList.remove(this._expandImageClass),c.classList.remove(this._collapseImageClass),c.classList.remove(this._progressImageClass),c.classList.add(a==="progress"?this._progressImageClass:a?this._expandImageClass:this._collapseImageClass))},getExpandImage:function(b,a,c,d){var e=document.createElement("span");e.id=this.expandCollapseImageId(b.id);a.appendChild(e);e.classList.add(this._twistieSpriteClass);
e.classList.add(this._collapseImageClass);if(c){var f=document.createElement("span");a.appendChild(f);f.classList.add(d||"imageSprite");f.classList.add(c)}var h=this;e.onclick=function(){if(!h.explorer.getNavHandler().isDisabled(b)){h.tableTree.toggle(b.id);if(h.tableTree.isExpanded(b.id))h._expanded.push(b.id),h.explorer.postUserExpand&&h.explorer.postUserExpand(b.id);else for(var a in h._expanded)if(h._expanded[a]===b.id){h._expanded.splice(a,1);break}(a=h._getUIStatePreferencePath())&&window.sessionStorage&&
h._storeExpansions(a)}};return e},render:function(b,a){a.classList.add("navRow");this.renderRow(b,a)},rowsChanged:function(){this.explorer.selectionPolicy!=="cursorOnly"&&(this.explorer.refreshSelection(),this.explorer.initNavHandler());(f.$(".sectionTreeTable",this.tableNode.parentNode)||f.$(".treetable",this.tableNode.parentNode))&&f.$$array(".treeTableRow",this.tableNode).forEach(function(b,a){var c=!(a%2)?"darkSectionTreeTableRow":"lightSectionTreeTableRow",d=c==="darkSectionTreeTableRow"?"lightSectionTreeTableRow":
"darkSectionTreeTableRow";b.classList.add(c);b.classList.remove(d)})},updateCommands:function(){if(this.commandService)for(var b=f.$$array(".treeTableRow"),a=0;a<b.length;a++){var c=b[a],d=f.node(c.id+"actionswrapper");this.commandService.destroy(d);this.actionScopeId&&this.commandService.renderCommands(this.actionScopeId,d,c._item,this.explorer,"tool")}},_initializeUIState:function(){this._expanded=[];var b=this._getUIStatePreferencePath();b&&window.sessionStorage&&this._restoreExpansions(b)&&this._restoreSelections(b)}};
return a}();j.SelectionRenderer=function(){function a(b,c){this._init(b);this.explorer=c}a.prototype=new j.ExplorerRenderer;a.prototype.renderTableHeader=function(b){var a=document.createElement("thead"),c=document.createElement("tr");a.classList.add("navTableHeading");this._useCheckboxSelection&&c.appendChild(this.initCheckboxColumn(b));for(var d=0,e=this.getCellHeaderElement(d);e;)e.innerHTML.length>0&&e.classList.add("navColumn"),c.appendChild(e),e=this.getCellHeaderElement(++d);a.appendChild(c);
d>0&&b.appendChild(a)};a.prototype.renderRow=function(b,a){a.verticalAlign="baseline";a.classList.add("treeTableRow");var c=this.explorer.getNavDict();if(c){c.addRow(b,a);var d=this;a.addEventListener("click",function(a){if(d.explorer.getNavHandler())d.explorer.getNavHandler().onClick(b,a)},!1)}if(c=this.getCheckboxColumn(b,a))c.classList.add("checkColumn"),a.appendChild(c);for(var c=0,e=this.getCellElement(c,b,a);e;)a.appendChild(e),c===0?this.getPrimColumnStyle?e.classList.add(this.getPrimColumnStyle(b)):
e.classList.add("navColumn"):this.getSecondaryColumnStyle?e.classList.add(this.getSecondaryColumnStyle()):e.classList.add("secondaryColumn"),e=this.getCellElement(++c,b,a)};a.prototype.getCellHeaderElement=function(){};a.prototype.getCellElement=function(){};return a}();j.SimpleFlatModel=function(){function a(b,c,d){this.items=b;this.getKey=d;this.idPrefix=c;this.root={children:b}}a.prototype=new j.ExplorerModel;a.prototype.getRoot=function(a){a(this.root)};a.prototype.getId=function(a){for(var a=
this.getKey(a).replace(/[\\\/]/g,""),c="",d=0;d<a.length;d++)c+=a[d].match(/[^\.\:\-\_0-9A-Za-z]/g)?a.charCodeAt(d):a[d];return this.idPrefix+c};a.prototype.getChildren=function(a,c){a===this.root?c(this.items):c([])};return a}();return j});
define("orion/objects",[],function(){function k(h){for(var f=1;f<arguments.length;f++){var a=arguments[f],d;for(d in a)Object.prototype.hasOwnProperty.call(a,d)&&(h[d]=a[d])}return h}return{clone:function(h){if(Array.isArray(h))return Array.prototype.slice.call(h);var f=Object.create(Object.getPrototypeOf(h));k(f,h);return f},mixin:k,toArray:function(h){return Array.isArray(h)?h:[h]}}});
define("edit/content/jsonExplorer",["orion/explorers/explorer","orion/objects","orion/uiUtils","orion/Deferred","orion/webui/littlelib"],function(k,h,f,a,d){function e(a){this._root={key:"json",value:a,id:"json"};this._id="json"}function j(a,c){this._init(a);this.options=a;this.explorer=c}function c(a){this.checkbox=!1;this.parentId=a.parentId;this.update=a.update;var c=this;d.node(this.parentId).addEventListener("click",function(a){var b=a.target;if(b.isKey||b.isValue){var a=b,e=b.id+"EditBox";if(!d.node(e)){for(;a;){if(a._item)break;
a=a.parentNode}var h=a._item;f.getUserText({id:e,refNode:b,hideRefNode:!0,initialText:b.textContent,onComplete:function(a){if(b.isValue){var d=a;if(a==="null")d=null;else if(a==="true")d=!0;else if(a==="false")d=!1;else if(a.charAt(0)>="0"&&a.charAt(0)<="9")try{d=parseInt(a)}catch(g){}else if(a.charAt(0)==='"'||a.charAt(0)==="'")d=a.substring(1,a.length-1);else if(a.charAt(0)==="{"||a.charAt(0)==="[")try{d=JSON.parse(a)}catch(e){}h.parent.value[h.key]=d;c.update(h)}else if(!h.parent.value[a])h.parent.value[a]=
h.value,delete h.parent.value[h.key],c.update({key:a,value:h.value,id:h.parent.id+"-"+a,parent:h.parent})}})}}})}e.prototype={getRoot:function(a){a(this._root)},getChildren:function(a,c){if(a.children)c(a.children);else{var d=[],e=a.value;if(Array.isArray(e))for(var f=0;f<e.length;f++)d.push({key:String(f),value:e[f],id:a.id+"-"+f,parent:a});else typeof e==="object"&&e&&Object.keys(e).sort().forEach(function(c){d.push({key:c,value:e[c],id:a.id+"-"+c,parent:a})});a.children=d;c(d)}},getId:function(a){return a.id}};
j.prototype=new k.SelectionRenderer;h.mixin(j.prototype,{labelColumnIndex:0,emptyCallback:function(a){var c=this.explorer.emptyMessage;if(c){var d=document.createElement("tr"),e=document.createElement("td");e.colSpan=3;var f=document.createElement("div");f.classList.add("emptyJSON");f.appendChild(document.createTextNode(c));e.appendChild(f);d.appendChild(e);a.appendChild(d)}},getCellElement:function(a,c,d){switch(a){case 0:return a=document.createElement("td"),Array.isArray(c.value)||typeof c.value===
"object"?(a.noWrap=!0,this.getExpandImage(d,a)):(d=document.createElement("scan"),d.classList.add("typeimage"),typeof c.value==="number"?d.classList.add("numbertype"):typeof c.value==="boolean"?d.classList.add("booleantype"):typeof c.value==="string"&&d.classList.add("stringtype"),a.appendChild(d)),d=document.createElement("span"),a.appendChild(d),d.isKey=c.parent&&!Array.isArray(c.parent.value),d.appendChild(document.createTextNode(c.key)),d.classList.add("tablelabel"),a;case 1:var a=document.createElement("td"),
d=document.createElement("span"),e="";c.value===null?e="null":c.value===void 0?e="undefined":Array.isArray(c.value)||typeof c.value==="object"?Array.isArray(c.value)?e="[]":typeof c.value==="object"&&(e="{}"):e=c.value;d.isValue=!0;d.appendChild(document.createTextNode(e));a.appendChild(d);d.classList.add("tablelabel");return a;case 2:return a=document.createElement("td"),d=document.createElement("span"),e="object",Array.isArray(c.value)?e="array":typeof c.value==="number"?e="number":typeof c.value===
"boolean"?e="boolean":typeof c.value==="string"&&(e="string"),d.appendChild(document.createTextNode(e)),a.appendChild(d),a}}});c.prototype=new k.Explorer;h.mixin(c.prototype,{display:function(a){this.json=a;d.empty(this.parentId);this.renderer=new j({},this);this.createTree(this.parentId,new e(a||{}),{selectionPolicy:"cursorOnly"})},expandItem:function(b){var c=new a;this.showItem(b).then(function(a){this.myTree.isExpanded(a)?c.resolve(a):this.myTree.expand(this.model.getId(a),function(){c.resolve(a)})}.bind(this),
c.reject);return c},reveal:function(a){return this.showItem(a).then(function(a){var b=this.getNavHandler();b&&b.cursorOn(a,!0);return a}.bind(this))},showItem:function(b){var c=new a,d=this.getRow(b);if(d)c.resolve(d._item||b);else if(b.parent)return this.expandItem(b.parent).then(function(){var c=this.getRow(b);return!c?(new a).reject():c._item||b}.bind(this));return c}});return{JSONExplorer:c}});
define("orion/keyBinding",["orion/util"],function(k){function h(a,d,e,f,c,b){this.type=b||"keydown";this.keyCode=typeof a==="string"&&this.type==="keydown"?a.toUpperCase().charCodeAt(0):a;this.mod1=d!==void 0&&d!==null?d:!1;this.mod2=e!==void 0&&e!==null?e:!1;this.mod3=f!==void 0&&f!==null?f:!1;this.mod4=c!==void 0&&c!==null?c:!1}function f(a){this.keys=a}h.prototype={getKeys:function(){return[this]},match:function(a,d){if(d!==void 0){if(d!==0)return!1}else if(a instanceof Array){if(a.length>1)return!1;
a=a[0]}return a.type!==this.type?!1:this.keyCode===a.keyCode||this.keyCode===String.fromCharCode(k.isOpera?a.which:a.charCode!==void 0?a.charCode:a.keyCode)?this.mod1!==(k.isMac?a.metaKey:a.ctrlKey)?!1:this.type==="keydown"&&this.mod2!==a.shiftKey?!1:this.mod3!==a.altKey?!1:k.isMac&&this.mod4!==a.ctrlKey?!1:!0:!1},equals:function(a){return!a?!1:this.keyCode!==a.keyCode?!1:this.mod1!==a.mod1?!1:this.mod2!==a.mod2?!1:this.mod3!==a.mod3?!1:this.mod4!==a.mod4?!1:this.type!==a.type?!1:!0}};f.prototype=
{getKeys:function(){return this.keys.slice(0)},match:function(a,d){var e=this.keys;if(d!==void 0)return d>e.length?!1:e[d].match(a)?d===e.length-1?!0:d+1:!1;else{a instanceof Array||(a=[a]);if(a.length>e.length)return!1;var f;for(f=0;f<a.length;f++)if(!e[f].match(a[f]))return!1;return f===e.length?!0:f}},equals:function(a){if(!a.keys)return!1;if(a.keys.length!==this.keys.length)return!1;for(var d=0;d<a.keys.length;d++)if(!a.keys[d].equals(this.keys[d]))return!1;return!0}};return{KeyBinding:h,KeyStroke:h,
KeySequence:f}});
define('built-jsonEditorPlugin.js',"orion/plugin,edit/content/jsonExplorer,orion/Deferred,orion/commands,orion/keyBinding,orion/webui/littlelib".split(","),function(k,h,f,a,d){function e(a,d){return g?(b=a,i=d,g.setText(JSON.stringify(c,null,"\t"))):(new f).reject()}function j(){g&&g.getText().then(function(a){c={};l||(l=new h.JSONExplorer({parentId:document.body,update:e}));try{c=JSON.parse(a)}catch(d){l.emptyMessage="Error parsing JSON text: "+d.message}l.display(c);b&&(i?l.expandItem(b).then(function(){l.reveal(b)}):l.reveal(b))})}
var c,b,i,g,l,n=new a.CommandsProxy,k=new k({name:"Orion JSON Editor Plugin",version:"1.0",description:"This plugin provides editor for JSON files."});k.registerService("orion.edit.editor",{setTextModel:function(a){g=a;j();n.setProxy(g);return new f},onChanged:function(){j()},registerKeys:function(a){var b=[];a.forEach(function(a){b.push(new d.KeyBinding(a.keyCode,a.mod1,a.mod2,a.mod3,a.mod4))});n.setKeyBindings(b)}},{id:"orion.editor.json",nameKey:"Orion JSON Editor",nls:"orion/nls/messages",uriTemplate:"../edit/edit.html#{,Location,params*},editor=orion.editor.json"});
k.registerService("orion.navigate.openWith",{},{editor:"orion.editor.json",contentType:["application/json"]});k.registerService("orion.edit.command",{run:function(){for(var a="NewKey",b,c=l.getNavHandler().currentModel()||l.model._root;c;){b=c.value;if(Array.isArray(b))a=b.length+"",b.push("NewValue");else if(typeof b==="object")b[a]="NewValue";else{c=c.parent;continue}e({key:a,value:"NewValue",id:c.id+"-"+a,parent:c});break}return null}},{name:"Add",contentTypes:["application/json"],editor:"orion.editor.json",
key:["a",!0]});k.registerService("orion.edit.command",{run:function(){var a=l.getNavHandler().currentModel();if(a){var b=a.parent.value;Array.isArray(b)?b.splice(a.key,1):delete b[a.key];e(a.parent,!0)}return null}},{name:"Delete",contentTypes:["application/json"],editor:"orion.editor.json",key:[46]});k.connect()});