(function(){function k(d,l,b,f,a,g){l[d]&&(b.push(d),(!0===l[d]||1===l[d])&&f.push(a+d+"/"+g))}function m(d,l,b,f,a){l=f+l+"/"+a;require._fileExists(d.toUrl(l+".js"))&&b.push(l)}function n(d,l,b){for(var f in l)l.hasOwnProperty(f)&&(!d.hasOwnProperty(f)||b)?d[f]=l[f]:"object"===typeof l[f]&&n(d[f],l[f],b)}var d=/(^.*(^|\/)nls(\/|$))([^\/]*)\/?([^\/]*)/;define("i18n",["module"],function(h){var l=h.config?h.config():{},l=l||{};return{version:"2.0.1+",load:function(b,f,a,g){g=g||{};g.locale&&(l.locale=
g.locale);var c=d.exec(b),e=c[1],p=c[4],h=c[5],q=p.split("-"),s=[],w={},u,y="";c[5]?(e=c[1],b=e+h):(h=c[4],p=l.locale,p||(p=l.locale="undefined"===typeof navigator?"root":(navigator.language||navigator.userLanguage||"root").toLowerCase()),q=p.split("-"));if(g.isBuild){s.push(b);m(f,"root",s,e,h);for(u=0;u<q.length;u++)g=q[u],y+=(y?"-":"")+g,m(f,y,s,e,h);f(s,function(){a()})}else f([b],function(c){var g=[],b;k("root",c,g,s,e,h);for(u=0;u<q.length;u++)b=q[u],y+=(y?"-":"")+b,k(y,c,g,s,e,h);f(s,function(){var b,
p,d;for(b=g.length-1;-1<b&&g[b];b--){d=g[b];p=c[d];if(!0===p||1===p)p=f(e+d+"/"+h);n(w,p)}a(w)})})}}})})();
define("orion/i18n",[],function(){return{load:function(k,m,n,d){d=d||{};var h=/(^.*(?:^|\/)nls(?:\/|$))([^\/]*)\/?([^\/]*)/,l=h.exec(k);if(l){if(!m.defined||m.defined(k))try{n(m(k));return}catch(b){}if(d.isBuild||d.isTest)n({});else if(m.specified&&!m.specified("orion/bootstrap"))n({});else{var f=l[1],a=l[3]?l[2]:"",g=l[3]||l[2];m(["orion/bootstrap"],function(c){c.startup().then(function(c){var b=c.serviceRegistry;c=b.getServiceReferences("orion.i18n.message");if(a)c.some(function(a){return k===a.getProperty("name")?
(b.getService(a).getMessageBundle().then(function(a){n(a)},function(){n({})}),!0):!1})||n({});else{var r={},q;c.forEach(function(c){var e=c.getProperty("name");if((l=h.exec(e))&&f===l[1]&&g===(l[3]||l[2]))if(a=l[3]?l[2]:""){if((c=d.locale||("undefined"!==typeof navigator?navigator.language||navigator.userLanguage:null))&&0===c.toLowerCase().indexOf(a.toLowerCase()))r[a]=!0,(!m.specified||!m.specified(e))&&define(e,["orion/i18n!"+e],function(a){return a})}else q=c});!m.specified||!m.specified(k)?q?
b.getService(q).getMessageBundle().then(function(a){Object.keys(r).forEach(function(c){"undefined"===typeof a[c]&&(a[c]=r[c])});define(k,[],a);n(a)},function(){define(k,[],r);n(r)}):(define(k,[],r),n(r)):n(r)}})})}}else n(null)}}});
define("orion/shell/nls/root/messages",{Shell:"Shell","Changed to: ":"Changed to: ","Initial directory: ":"Initial directory: ","${0} is not a directory":"${0} is not a directory","${0} was not found":"${0} was not found","Changes the current directory":"Changes the current directory","The name of the directory":"The name of the directory","Edits a file":"Edits a file","The name of the file":"The name of the file","Lists the files in the current directory":"Lists the files in the current directory",
"Prints the current directory location":"Prints the current directory location","Clears the shell screen":"Clears the shell screen","'${0}' is not valid":"'${0}' is not valid","Error: ${0}":"Error: ${0}",NoResponseFromServer:"No response from server for ${0}. Check your internet connection and try again.",ServerError:"Server error: ${0} returned ${1} ${2}",Succeeded:"Succeeded",Aborted:"Aborted","The name of the plug-in":"The name of the plug-in","The name of the contributed plug-in":"The name of the contributed plug-in",
"Lists all registered plug-ins":"Lists all registered plug-ins","Reloads a plug-in":"Reloads a plug-in","Disables a contributed plug-in":"Disables a contributed plug-in","Enables a contributed plug-in":"Enables a contributed plug-in","Uninstalls a contributed plug-in from the configuration":"Uninstalls a contributed plug-in from the configuration","Plug-in is already installed":"Plug-in is already installed","Invalid plug-in URL":"Invalid plug-in URL","Installs a plug-in from a URL":"Installs a plug-in from a URL",
"The plug-in URL":"The plug-in URL","Commands for working with plug-ins":"Commands for working with plug-ins","Are you sure you want to uninstall all contributed plug-ins?":"Are you sure you want to uninstall all contributed plug-ins?","Displays a plug-in's services":"Displays a plug-in's services","Commands for working with a service":"Commands for working with a service","Displays all plug-in contributions for a service":"Displays all plug-in contributions for a service","The service identifier":"The service identifier",
disabled:"disabled","Open Shell":"Open Shell","Open Shell page":"Open the Shell page with this folder as the current directory.","'${0}' already exists":"'${0}' already exists","Source file service does not support binary read":"Source file service does not support binary read","Target file service does not support binary write":"Target file service does not support binary write","Cannot create file, it already exists as a directory":"Cannot create file, it already exists as a directory","Cannot create directory, it already exists as a file":"Cannot create directory, it already exists as a file",
"Wrote ${0}":"Wrote ${0}","Failed to write ${0}":"Failed to write ${0}","Cannot write ${0}, it is not a descendent of the output directory":"Cannot write ${0}, it is not a descendent of the output directory","The file or directory to re-direct output to":"The file or directory to re-direct output to"});
define("orion/shell/nls/messages",["orion/i18n!orion/shell/nls/messages","orion/shell/nls/root/messages"],function(k,m){var n={root:m};Object.keys(k).forEach(function(d){"undefined"===typeof n[d]&&(n[d]=k[d])});return n});
(function(){function k(){for(var d=navigator.userAgent,l={browser:!1,version:!1},b=[{name:"Chrome/Chromium",regExp:/(?:chrome|crios|chromium)\/(\d+)/i,minVersion:24},{name:"Firefox",regExp:/firefox\/(\d+)/i,minVersion:17},{name:"Microsoft Internet Explorer",regExp:/msie\s(\d+)/i,minVersion:10},{name:"Microsoft Internet Explorer",regExp:/Trident\/(\d+)/i,minVersion:6},{name:"Safari",regExp:/version\/(\d+).*?safari/i,minVersion:6}],f=0;f<b.length;f++){var a=b[f],g=d.match(a.regExp);if(g){l.browser=
!0;l.version=g[1]>=a.minVersion;l.name=a.name;break}}return l}function m(){try{return"localStorage"in window&&null!==window.localStorage}catch(d){return!1}}function n(d){alert(d);throw Error("unsupported browser");}var d=k();if(d.browser)d.version||n("Sorry, your browser version is not supported.\n\nTo use Orion, please upgrade to the latest version of "+d.name+".\n");else if(m()&&!localStorage.skipBrowserCheck)if(confirm("Sorry, your browser is not supported. The latest version of Chrome, Firefox or Safari web browser is recommended.\nContinue anyway?"))localStorage.skipBrowserCheck=
1;else throw"unsupported browser";else m()||n("Sorry, your browser is not supported.\n\nTo use Orion, the latest version of the Chrome, Firefox, or Safari web browser is recommended.\n");return{isSupportedBrowser:k,supportsLocalStorage:m,throwBrowserAlert:n}})();define("orion/browserCompatibility",function(){});
(function(k,m){"function"===typeof define&&define.amd?define("orion/Deferred",m):"object"===typeof exports?module.exports=m():(k.orion=k.orion||{},k.orion.Deferred=m())})(this,function(){function k(){for(var f;f=h.shift();)f();l=!1}function m(f){h.push(f);l||(l=!0,b())}function n(f){return function(a){f(a)}}function d(){function f(){for(var a;a=h.shift();){var c=a.deferred,g="fulfilled"===b?"resolve":"reject";a=a[g];if("function"===typeof a)try{var f=a(e),d=f&&("object"===typeof f||"function"===typeof f)&&
f.then;if("function"===typeof d)if(f===c.promise)c.reject(new TypeError);else{var q=f.cancel;"function"===typeof q?c._parentCancel=q.bind(f):delete c._parentCancel;d.call(f,n(c.resolve),n(c.reject),n(c.progress))}else c.resolve(f)}catch(l){c.reject(l)}else c[g](e)}}function a(a){delete q._parentCancel;b="rejected";e=a;h.length&&m(f)}function g(c){function l(a){return function(c){(!b||"assumed"===b)&&a(c)}}delete q._parentCancel;try{var k=c&&("object"===typeof c||"function"===typeof c)&&c.then;if("function"===
typeof k)if(c===q)a(new TypeError);else{b="assumed";var n=c&&c.cancel;if("function"!==typeof n){var t=new d;c=t.promise;try{k(t.resolve,t.reject,t.progress)}catch(v){t.reject(v)}n=c.cancel;k=c.then}e=c;k.call(c,l(g),l(a));q._parentCancel=n.bind(c)}else b="fulfilled",e=c,h.length&&m(f)}catch(A){l(a)(A)}}function c(){var c=q._parentCancel;c?(delete q._parentCancel,c()):b||(c=Error("Cancel"),c.name="Cancel",a(c))}var e,b,h=[],q=this;this.resolve=function(a){b||g(a);return q};this.reject=function(c){b||
a(c);return q};this.progress=function(a){b||h.forEach(function(c){if(c.progress)try{c.progress(a)}catch(e){}});return q.promise};this.cancel=function(){q._parentCancel?setTimeout(c,0):c();return q};this.then=function(a,c,e){var g=new d;g._parentCancel=q.promise.cancel;h.push({resolve:a,reject:c,progress:e,deferred:g});("fulfilled"===b||"rejected"===b)&&m(f);return g.promise};this.promise={then:q.then,cancel:q.cancel}}var h=[],l=!1,b=function(){if("undefined"!==typeof process&&"function"===typeof process.nextTick){var f=
process.nextTick;return function(){f(k)}}if("function"===typeof MutationObserver){var a=document.createElement("div");(new MutationObserver(k)).observe(a,{attributes:!0});return function(){a.setAttribute("class","_tick")}}return function(){setTimeout(k,0)}}();d.all=function(f,a){function g(a,c){h||(b[a]=c,0===--e&&q.resolve(b))}function c(c,e){if(!h){if(a)try{g(c,a(e));return}catch(f){e=f}q.reject(e)}}var e=f.length,b=[],h=!1,q=new d;q.then(void 0,function(){h=!0;f.forEach(function(a){a.cancel&&a.cancel()})});
0===e?q.resolve(b):f.forEach(function(a,e){a.then(g.bind(void 0,e),c.bind(void 0,e))});return q.promise};d.when=function(f,a,g,c){var e;f&&"function"===typeof f.then||(e=new d,e.resolve(f),f=e.promise);return f.then(a,g,c)};return d});
define("orion/EventTarget",[],function(){function k(){this._namedListeners={}}k.prototype={dispatchEvent:function(m){if(!m.type)throw Error("unspecified type");var k=this._namedListeners[m.type];k&&k.forEach(function(d){try{"function"===typeof d?d(m):d.handleEvent(m)}catch(h){"undefined"!==typeof console&&console.log(h)}});return!m.defaultPrevented},addEventListener:function(m,k){if("function"===typeof k||k.handleEvent)this._namedListeners[m]=this._namedListeners[m]||[],this._namedListeners[m].push(k)},
removeEventListener:function(m,k){var d=this._namedListeners[m];if(d)for(var h=0;h<d.length;h++)if(d[h]===k){1===d.length?delete this._namedListeners[m]:d.splice(h,1);break}}};k.prototype.constructor=k;k.attach=function(m){var n=new k;m.dispatchEvent=n.dispatchEvent.bind(n);m.addEventListener=n.addEventListener.bind(n);m.removeEventListener=n.removeEventListener.bind(n)};return k});
define("orion/serviceregistry",["orion/Deferred","orion/EventTarget"],function(k,m){function n(f,a,g){this._properties=g||{};this._properties["service.id"]=f;this._properties.objectClass=a;this._properties["service.names"]=a}function d(f,a,g){this._serviceId=f;this._serviceReference=a;this._internalRegistry=g}function h(f,a){function g(c){return function(){var g;try{if(!a())throw Error("Service was unregistered");var b=f[c].apply(f,Array.prototype.slice.call(arguments));if(b&&"function"===typeof b.then)return b;
g=new k;g.resolve(b)}catch(d){g=new k,g.reject(d)}return g.promise}}for(var c in f)"function"===typeof f[c]&&(this[c]=g(c))}function l(f,a){this.type=f;this.serviceReference=a}function b(){this._entries=[];this._namedReferences={};this._serviceEventTarget=new m;var f=this;this._internalRegistry={isRegistered:function(a){return f._entries[a]?!0:!1},unregisterService:function(a){var g=f._entries[a];if(!g)throw Error("Service has already been unregistered: "+a);var c=g.reference;f._serviceEventTarget.dispatchEvent(new l("unregistering",
c));f._entries[a]=null;c.getProperty("objectClass").forEach(function(a){for(var g=f._namedReferences[a],b=0;b<g.length;b++)if(g[b]===c){1===g.length?delete f._namedReferences[a]:g.splice(b,1);break}})},modifyService:function(a){var g=f._entries[a];if(!g)throw Error("Service not found while trying to send modified event: "+a);f._serviceEventTarget.dispatchEvent(new l("modified",g.reference))}}}n.prototype={getPropertyKeys:function(){var f=[],a;for(a in this._properties)this._properties.hasOwnProperty(a)&&
f.push(a);return f},getProperty:function(f){return this._properties[f]}};n.prototype.constructor=n;d.prototype={unregister:function(){this._internalRegistry.unregisterService(this._serviceId)},getReference:function(){if(!this._internalRegistry.isRegistered(this._serviceId))throw Error("Service has already been unregistered: "+this._serviceId);return this._serviceReference},setProperties:function(f){var a=this._serviceReference._properties;this._serviceReference._properties=f||{};f["service.id"]=this._serviceId;
f.objectClass=a.objectClass;f["service.names"]=a["service.names"];this._internalRegistry.modifyService(this._serviceId)}};d.prototype.constructor=d;b.prototype={getService:function(f){var a;if("string"===typeof f)(f=this._namedReferences[f])&&f.some(function(g){a=this._entries[g.getProperty("service.id")].service;return!!a},this);else if(f=this._entries[f.getProperty("service.id")])a=f.service;return a||null},getServiceReferences:function(f){if(f)return this._namedReferences[f]?this._namedReferences[f]:
[];var a=[];this._entries.forEach(function(g){g&&a.push(g.reference)});return a},registerService:function(f,a,g){if("undefined"===typeof a||null===a)throw Error("invalid service");"string"===typeof f?f=[f]:Array.isArray(f)||(f=[]);var c=this._entries.length,e=new n(c,f,g),b=this._namedReferences;f.forEach(function(a){b[a]=b[a]||[];b[a].push(e)});f=new h(a,this._internalRegistry.isRegistered.bind(null,c));this._entries.push({reference:e,service:f});f=this._internalRegistry;this._serviceEventTarget.dispatchEvent(new l("registered",
e));return new d(c,e,f)},addEventListener:function(f,a){this._serviceEventTarget.addEventListener(f,a)},removeEventListener:function(f,a){this._serviceEventTarget.removeEventListener(f,a)}};b.prototype.constructor=b;return{ServiceRegistry:b}});
define("orion/xhr",["orion/Deferred"],function(k){function m(m,d,h,l){var b="undefined"!==typeof h.response?h.response:h.responseText,f;try{f=h.status}catch(a){f=0}m={args:d,response:b,responseText:"string"===typeof b?b:null,status:f,url:m,xhr:h};"undefined"!==typeof l&&(m.error=l);return m}return function(n,d,h){h=h||{};var l=3<arguments.length&&arguments[3]?arguments[3]:new XMLHttpRequest,b=new k,f=h.headers||{},a=h.log||!1,g;"undefined"===typeof f["X-Requested-With"]&&(f["X-Requested-With"]="XMLHttpRequest");
if("undefined"!==typeof h.data&&("POST"===n||"PUT"===n))g=h.data;var c=!1,e=!1;b.promise.then(void 0,function(a){c=!0;!e&&a instanceof Error&&"Cancel"===a.name&&l.abort()});l.onabort=function(){e=!0;if(!c){var a=Error("Cancel");a.name="Cancel";b.reject(a)}};l.onload=function(){var c=m(d,h,l);200<=l.status&&400>l.status?b.resolve(c):(b.reject(c),a&&"undefined"!==typeof console&&console.log(Error(l.statusText)))};l.onerror=function(){var c=m(d,h,l);b.reject(c);a&&"undefined"!==typeof console&&console.log(Error(l.statusText))};
l.onprogress=function(a){a.xhr=l;b.progress(a)};try{l.open(n,d,!0);"string"===typeof h.responseType&&(l.responseType=h.responseType);if("number"===typeof h.timeout)if("number"===typeof l.timeout)l.timeout=h.timeout,l.addEventListener("timeout",function(a){b.reject(m(d,h,l,"Timeout exceeded"))});else{var p=setTimeout(function(){b.reject(m(d,h,l,"Timeout exceeded"))},h.timeout);b.promise.then(clearTimeout.bind(null,p),clearTimeout.bind(null,p))}Object.keys(f).forEach(function(a){l.setRequestHeader(a,
f[a])});l.send(g||null)}catch(r){b.reject(m(d,h,l,r))}return b.promise}});
define("orion/preferences",["require","orion/Deferred","orion/xhr"],function(k,m,n){function d(a,c){this._name=a;this._providers=c;this._flushPending=!1;this._cached=null;this._stores=[];this._pendingDeletes=[];this._dirty=[]}function h(a,c){return{get:function(e,f){if(0===c)return null;var b=localStorage.getItem(a+e);if(null===b)return null;b=JSON.parse(b);return f||-1===c||b._expires&&b._expires>(new Date).getTime()?(delete b._expires,b):null},set:function(e,f){if(0!==c)if(-1!==c&&(f._expires=(new Date).getTime()+
1E3*c),0===Object.keys(f).length)localStorage.removeItem(a+e);else{var b=JSON.stringify(f);localStorage.setItem(a+e,b);delete f._expires}},remove:function(c){localStorage.removeItem(a+c)}}}function l(a){this._currentPromises={};this._cache=new h("/orion/preferences/user",3600);this._service=null;this.available=function(){if(!this._service){var c=a.getServiceReferences("orion.core.preference.provider");0<c.length&&(this._service=a.getService(c[0]))}return!!this._service}}function b(a){this._location=
a;this._currentPromise=null;this._cache=new h("/orion/preferences/default",3600)}function f(){this._cache=new h("/orion/preferences/local",-1)}function a(a,c){this._userProvider=new l(a);this._localProvider=new f;c=c||"defaults.pref";-1===c.indexOf("://")&&(c=k.toUrl(c));this._defaultsProvider=new b(c);this._serviceRegistration=a.registerService("orion.core.preference",this)}d.prototype={_flush:function(){for(var a=[],c=0;c<this._stores.length;++c){var e=this._stores[c];-1!==this._dirty.indexOf(e)&&
a.push(this._providers[c].put(this._name,e));if(this._pendingDeletes[c]&&0<this._pendingDeletes[c].length){for(e=0;e<this._pendingDeletes[c].length;e++)a.push(this._providers[c].remove(this._name,this._pendingDeletes[c][e]));delete this._pendingDeletes[c]}}this._dirty=[];return m.all(a)},_scheduleFlush:function(a){a&&-1===this._dirty.indexOf(a)&&this._dirty.push(a);this._flushPending||(this._flushPending=!0,window.setTimeout(function(){this._flushPending&&(this._flushPending=!1,this._flush())}.bind(this),
0))},_getCached:function(){if(!this._cached){this._cached={};for(var a=0;a<this._stores.length;++a){var c=this._stores[a],e;for(e in c)c.hasOwnProperty(e)&&"undefined"===typeof this._cached[e]&&(this._cached[e]=c[e])}}return this._cached},keys:function(){return Object.keys(this._getCached())},get:function(a){return this._getCached()[a]},put:function(a,c){if(0!==this._stores.length){var e=this._stores[0];e[a]!==c&&(e[a]=c,this._cached=null,this._scheduleFlush(e))}},remove:function(a){for(var c=0;c<
this._stores.length;++c){var e=this._stores[c];if(e.hasOwnProperty(a))return delete e[a],this._pendingDeletes[c]||(this._pendingDeletes[c]=[]),this._pendingDeletes[c].push(a),this._cached=null,this._scheduleFlush(),!0}return!1},clear:function(){for(var a=0;a<this._stores.length;++a)this._stores[a]={},this._scheduleFlush(this._stores[a]);this._cached=null},sync:function(a){if(this._flushPending)return this._flushPending=!1,this._flush();for(var c=this,e=[],f=0;f<this._providers.length;++f)e.push(this._providers[f].get(this._name,
a).then(function(a){return function(e){c._stores[a]=e}}(f)));return m.all(e).then(function(){c._cached=null;c._getCached()})},flush:function(){this._flush()}};l.prototype={get:function(a,c){if(this._currentPromises[a])return this._currentPromises[a];var e=new m,f=null;c?this._cache.remove(a):f=this._cache.get(a);if(null!==f)e.resolve(f);else{this._currentPromises[a]=e;var b=this;this._service.get(a).then(function(c){b._cache.set(a,c);delete b._currentPromises[a];e.resolve(c)},function(c){404===c.status?
(c={},b._cache.set(a,c),delete b._currentPromises[a],e.resolve(c)):(delete b._currentPromises[a],e.resolve(b._cache.get(a,!0)||{}))})}return e},put:function(a,c){this._cache.set(a,c);return this._service.put(a,c)},remove:function(a,c){var e=this._cache.get(a);delete e[c];this._cache.set(a,e);return this._service.remove(a,c)}};b.prototype={get:function(a,c){if(this._currentPromise)return this._currentPromise;var e=new m,f=null;c?this._cache.remove(a):f=this._cache.get(a);if(null!==f)e.resolve(f);else{this._currentPromise=
e;var b=this;n("GET",this._location,{headers:{"Orion-Version":"1"},timeout:15E3}).then(function(c){c=JSON.parse(c.response);b._cache.set(a,c[a]||{});b._currentPromise=null;e.resolve(c[a]||{})},function(c){401===c.xhr.status||404===c.xhr.status?(b._cache.set(a,{}),b._currentPromise=null,e.resolve({})):(b._currentPromise=null,c=b._cache.get(a,!0),null!==c?e.resolve(c[a]||{}):e.resolve({}))})}return e},put:function(a,c){var e=new m;e.resolve();return e},remove:function(a,c){var e=this._cache.get(a);
delete e[c];this.put(a,e)}};f.prototype={get:function(a){var c=new m;a=this._cache.get(a);null!==a?c.resolve(a):c.resolve({});return c},put:function(a,c){var e=new m;this._cache.set(a,c);e.resolve();return e},remove:function(a,c){var e=this._cache.get(a);delete e[c];this.put(a,e)}};a.DEFAULT_SCOPE=1;a.LOCAL_SCOPE=2;a.USER_SCOPE=4;a.prototype={listenForChangedSettings:function(g,c,e){if(!c||"number"!==typeof c||7<c||1>c)e=c,c=a.DEFAULT_SCOPE|a.LOCAL_SCOPE|a.USER_SCOPE;window.addEventListener("storage",
e,!1);return 0!==(a.USER_SCOPE&c)?"/orion/preferences/user"+g:0!==(a.LOCAL_SCOPE&c)?"/orion/preferences/local"+g:"/orion/preferences/default"+g},getPreferences:function(g,c){if(!c||"number"!==typeof c||7<c||1>c)c=a.DEFAULT_SCOPE|a.LOCAL_SCOPE|a.USER_SCOPE;var e=[];a.USER_SCOPE&c&&this._userProvider.available()&&e.push(this._userProvider);a.LOCAL_SCOPE&c&&e.push(this._localProvider);a.DEFAULT_SCOPE&c&&e.push(this._defaultsProvider);var f=new d(g,e);return f.sync().then(function(){return f})},getSetting:function(a,
c,e){for(var f,b=0;b<a.length;b++)if(a[b].label===c)for(var d=0;d<a[b].data.length;d++)if(a[b].data[d].label===e){f=a[b].data[d].value;break}return f}};return{PreferencesService:a}});
(function(){function k(a){if("string"!==typeof a)throw new TypeError;}function m(a){return a?a.split("\x26"):[]}function n(a){return 0===a.length?"":a.join("\x26")}function d(a){var c=/([^=]*)(?:=?)(.*)/.exec(a);a=c[1]?decodeURIComponent(c[1]):"";c=c[2]?decodeURIComponent(c[2]):"";return[a,c]}function h(a){var c=encodeURIComponent(a[0]);a[1]&&(c+="\x3d"+encodeURIComponent(a[1]));return c}function l(a,c){var e="",g=[],f=0;return{next:function(){e!==a.query&&(e=a.query,g=m(e));if(f<g.length){var b=
d(g[f++]);switch(c){case "keys":return b[0];case "values":return b[1];case "keys+values":return[b[0],b[1]];default:throw new TypeError;}}throw D;}}}function b(a){Object.defineProperty(this,"_url",{get:function(){return a._url}})}function f(a){return a?/[1-9]\d*$/.exec(a)[0]:""}function a(a){var c=[];a.split("/").forEach(function(a){".."===a?c.pop():"."!==a&&c.push(a)});return c.join("/")}function g(a){return a.replace(/\s/g,function(a){return"%"+a.charCodeAt(0).toString(16)})}function c(c,e){if("string"!==
typeof c)throw new TypeError;c=g(c);var b=q.exec(c);if(!b)return null;var d={};d.scheme=b[1]||"";if(d.scheme&&!w.test(d.scheme))return null;var p=b[2];if(p&&(p=s.exec(p),d.userinfo=p[1],d.host=p[2],d.port=p[3],d.port&&!u.test(d.port)))return null;d.path=b[3];d.query=b[4];d.fragment=b[5];!d.scheme&&e&&(d.scheme=e.scheme,!d.host&&e.host&&(d.userinfo=e.userinfo,d.host=e.host,d.port=e.port,d.pathRelative=!0));d.pathRelative&&(d.path?"/"!==d.path[0]&&(b=/^(.*\/)[^\/]*$/.exec(e.path)[1]||"/",d.path=b+d.path):
d.path=e.path);d.scheme&&(d.scheme=d.scheme.toLowerCase());d.port&&(d.port=f(d.port));d.host&&d.path&&(d.path=a(d.path));return d}function e(a,e){var g;if(e){e=e.href||e;g=c(e);if(!g||!g.scheme)throw new SyntaxError;Object.defineProperty(this,"_baseURL",{value:g})}g=c(a,g);if(!g)throw new SyntaxError;Object.defineProperty(this,"_input",{value:a,writable:!0});Object.defineProperty(this,"_url",{value:g,writable:!0});var f=new b(this);Object.defineProperty(this,"query",{get:function(){return this._url?
f:null},enumerable:!0})}try{var p;if("function"===typeof window.URL&&0!==window.URL.length&&"http:"===(p=new window.URL("http://www.w3.org?q")).protocol&&p.query)return}catch(r){}var q=/^(?:([^:\/?#]+):)?(?:\/\/([^\/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?$/,s=/^(?:(.*)@)?(\[[^\]]*\]|[^:]*)(?::(.*))?$/,w=/^([a-zA-Z](?:[a-zA-Z0-9+-.])*)$/,u=/^\d*$/,y=/^(\[[^\]\/?#\s]*\]|[^:\/?#\s]*)$/,t=/^(\[[^\]\/?#\s]*\]|[^:\/?#\s]*)(?::(\d*))?$/,v=/^([^?#\s]*)$/,A=/^([^\s]*)$/,z=/^\S*$/,K=/([^:]*):?(.*)/,D="undefined"!==
typeof StopIteration?StopIteration:Error("Stop Iteration"),F={"ftp:":"21","gopher:":"70","http:":"80","https:":"443","ws:":"80","wss:":"443"};Object.defineProperties(b.prototype,{get:{value:function(a){k(a);var c;m(this._url.query).some(function(e){e=d(e);if(e[0]===a)return c=e[1],!0});return c},enumerable:!0},set:{value:function(a,c){k(a);k(c);var e=m(this._url.query);e.some(function(g,f){var b=d(g);if(b[0]===a)return b[1]=c,e[f]=h(b),!0})||e.push(h([a,c]));this._url.query=n(e)},enumerable:!0},has:{value:function(a){k(a);
return m(this._url.query).some(function(c){if(d(c)[0]===a)return!0})},enumerable:!0},"delete":{value:function(a){k(a);var c=m(this._url.query),e=c.filter(function(c){return d(c)[0]!==a});return e.length!==c.length?(this._url.query=n(e),!0):!1},enumerable:!0},clear:{value:function(){this._url.query=""},enumerable:!0},forEach:{value:function(a,c){if("function"!==typeof a)throw new TypeError;var e=l(this._url,"keys+values");try{for(;;){var g=e.next();a.call(c,g[1],g[0],this)}}catch(f){if(f!==D)throw f;
}},enumerable:!0},keys:{value:function(){return l(this._url,"keys")},enumerable:!0},values:{value:function(){return l(this._url,"values")},enumerable:!0},items:{value:function(){return l(this._url,"keys+values")}},size:{get:function(){return m(this._url.query).length},enumerable:!0},getAll:{value:function(a){k(a);var c=[];m(this._url.query).forEach(function(e){e=d(e);e[0]===a&&c.push(e[1])});return c},enumerable:!0},append:{value:function(a,c){k(a);k(c);var e=m(this._url.query);e.push(h([a,c]));this._url.query=
n(e)},enumerable:!0}});Object.defineProperties(e.prototype,{href:{get:function(){var a;if(this._url){a=this._url;var c=a.scheme?a.scheme+":":"";a.host&&(c+="//",a.userinfo&&(c+=a.userinfo+"@"),c+=a.host,a.port&&(c+=":"+a.port));c+=a.path;a.query&&(c+="?"+a.query);a.fragment&&(c+="#"+a.fragment);a=c}else a=this._input;return a},set:function(a){k(a);this._input=a;this._url=c(this._input,this._baseURL)},enumerable:!0},origin:{get:function(){return this._url&&this._url.host?this.protocol+"//"+this.host:
""},enumerable:!0},protocol:{get:function(){return this._url?this._url.scheme+":":":"},set:function(a){k(a);if(this._url&&(a=":"===a.slice(-1)?a.substring(0,a.length-1):a,""===a||w.test(a)))this._url.scheme=a.toLowerCase()},enumerable:!0},_userinfo:{get:function(){return this._url?this._url.userinfo:""},set:function(a){k(a);this._url&&(this._url.userinfo=a)}},username:{get:function(){if(!this._url)return"";var a=K.exec(this._userinfo);return decodeURIComponent(a[1]||"")},set:function(a){k(a);if(this._url){var c=
K.exec(this._userinfo);a=[encodeURIComponent(a||"")];c[2]&&a.push(c[2]);this._userinfo=a.join(":")}},enumerable:!0},password:{get:function(){if(!this._url)return"";var a=K.exec(this._userinfo);return decodeURIComponent(a[2]||"")},set:function(a){k(a);if(this._url){var c=[K.exec(this._userinfo)[1]||""];a&&c.push(encodeURIComponent(a));this._userinfo=c.join(":")}},enumerable:!0},host:{get:function(){var a="";this._url&&this._url.host&&(a+=this._url.host,this._url.port&&(a+=":"+this._url.port));return a},
set:function(a){k(a);if(this._url&&(a=t.exec(a)))this._url.host=a[1],this._url.port=f(a[2])},enumerable:!0},hostname:{get:function(){return this._url?this._url.host:""},set:function(a){k(a);this._url&&y.exec(a)&&(this._url.host=a)},enumerable:!0},port:{get:function(){var a=this._url?this._url.port||"":"";a&&a===F[this.protocol]&&(a="");return a},set:function(a){k(a);this._url&&u.exec(a)&&(this._url.port=f(a))},enumerable:!0},pathname:{get:function(){return this._url?this._url.path:""},set:function(c){k(c);
this._url&&v.exec(c)&&(this._url.host&&c&&"/"!==c[0]&&(c="/"+c),this._url.path=c?a(c):"")},enumerable:!0},search:{get:function(){return this._url&&this._url.query?"?"+this._url.query:""},set:function(a){k(a);this._url&&(a&&"?"===a[0]&&(a=a.substring(1)),A.exec(a)&&(this._url.query=a))},enumerable:!0},hash:{get:function(){return this._url&&this._url.fragment?"#"+this._url.fragment:""},set:function(a){k(a);this._url&&(a&&"#"===a[0]&&(a=a.substring(1)),z.exec(a)&&(this._url.fragment=a))},enumerable:!0}});
if((p=window.URL||window.webkitURL)&&p.createObjectURL)Object.defineProperty(e,"createObjectURL",{value:p.createObjectURL.bind(p),enumerable:!1}),Object.defineProperty(e,"revokeObjectURL",{value:p.revokeObjectURL.bind(p),enumerable:!1});window.URL=e})();define("orion/URL-shim",function(){});
define("orion/pluginregistry",["orion/Deferred","orion/EventTarget","orion/URL-shim"],function(k,m,n){function d(a,c){var e=Object.keys(a),g=Object.keys(c);if(e.length!==g.length)return!1;e.sort();g.sort();for(var f=0,b=e.length;f<b;f++){var d=e[f];if(d!==g[f])return!1;var h=a[d],d=c[d];if(h!==d&&JSON.stringify(h)!==JSON.stringify(d))return!1}return!0}function h(a){if(-1===a.indexOf("://"))try{return(new URL(a,location.href)).href}catch(c){}return a}function l(a){var c=null,e={key:function(e){return(c=
c||Object.keys(a))[e]},getItem:function(c){return a[c]},setItem:function(e,g){a[e]=g;c=null},removeItem:function(e){delete a[e];c=null},clear:function(){(c=c||Object.keys(a)).forEach(function(c){delete a[c]}.bind(this));c=null}};Object.defineProperty(e,"length",{get:function(){return(c=c||Object.keys(a)).length}});return e}function b(a,c){if(c&&c instanceof XMLHttpRequest){var e,g;try{e=c.status,g=c.statusText}catch(f){e=0,g=""}return{status:e||0,statusText:g}}return c}function f(a){var c=a?JSON.parse(JSON.stringify(a,
b)):a;a instanceof Error&&(c.__isError=!0,c.message=c.message||a.message,c.name=c.name||a.name);return c}function a(a,c){this.type=a;this.plugin=c}function g(a,c){this.__objectId=a;this.__methods=c}function c(c,e,b){function h(a){M&&b.postMessage(a,M)}function l(a){if(!M)return(new k).reject(Error("plugin not connected"));a.id=String(ca++);var c=new k;U[a.id]=c;c.then(null,function(c){"active"===B&&c instanceof Error&&"Cancel"===c.name&&h({requestId:a.id,method:"cancel",params:c.message?[c.message]:
[]})});var e=Object.prototype.toString;a.params.forEach(function(b,f){if("[object Object]"===e.call(b)&&!(b instanceof g)){var d,h;for(d in b)"[object Function]"===e.call(b[d])&&(h=h||[],h.push(d));if(h){var p=Z++;W[p]=b;d=function(){delete W[p]};c.then(d,d);a.params[f]=new g(p,h)}}});b.postMessage(a,M);return c.promise}function u(a,c){a||0===a?h({id:a,result:null,error:c}):console.log(c)}function n(a,c,e,g){g.forEach(function(a,c){if(a&&"undefined"!==typeof a.__objectId){var e={};a.__methods.forEach(function(c){e[c]=
function(){return l({objectId:a.__objectId,method:c,params:Array.prototype.slice.call(arguments)})}});g[c]=e}});var b=void 0===typeof a?null:{id:a,result:null,error:null};try{var d=e.apply(c,g);b&&(d&&"function"===typeof d.then?(T[a]=d,d.then(function(c){delete T[a];b.result=c;h(b)},function(c){T[a]&&(delete T[a],b.error=f(c),h(b))},function(){h({responseId:a,method:"progress",params:Array.prototype.slice.call(arguments)})})):(b.result=d,h(b)))}catch(p){b&&(b.error=f(p),h(b))}}function t(a){try{if(a.method){var c=
a.method,e=a.params||[];if("serviceId"in a){var g=aa[a.serviceId];g||u(a.id,"service not found");c in g?n(a.id,g,g[c],e):u(a.id,"method not found")}else if("objectId"in a){var f=W[a.objectId];f||u(a.id,"object not found");c in f?n(a.id,f,f[c],e):u(a.id,"method not found")}else if("requestId"in a){var d=T[a.requestId];d&&"cancel"===c&&d.cancel&&d.cancel.apply(d,e)}else if("responseId"in a){var h=U[a.responseId];h&&"progress"===c&&h.progress&&h.progress.apply(h,e)}else if("plugin"===a.method){var p=
a.params[0];V({headers:p.headers,services:p.services}).then(function(){J&&J.resolve(D)})}else if("timeout"===a.method)J&&J.reject(a.error);else throw Error("Bad method: "+a.method);}else{var r=U[String(a.id)];delete U[String(a.id)];if(a.error){var l=b.handleServiceError(D,a.error);r.reject(l)}else r.resolve(a.result)}}catch(s){console.log("Plugin._messageHandler "+s)}}function v(a){var c={};if(a.methods&&(a.methods.forEach(function(e){c[e]=function(){var c={serviceId:a.serviceId,method:e,params:Array.prototype.slice.call(arguments)};
return"active"===B?l(c):D.start({"transient":!0}).then(function(){return l(c)})}}),c.addEventListener&&c.removeEventListener)){var e=new m,b=Z++;W[b]={handleEvent:e.dispatchEvent.bind(e)};var f=new g(b,["handleEvent"]),d=c.addEventListener;c.addEventListener=function(a,c){e._namedListeners[a]||d(a,f);e.addEventListener(a,c)};var h=c.removeEventListener;c.removeEventListener=function(a,c){e.removeEventListener(a,c);e._namedListeners[a]||h(a,f)}}return c}function A(a){var e=JSON.parse(JSON.stringify(a.properties));
e.__plugin__=c;a=a.names||a.type||[];Array.isArray(a)||(a=[a]);e.objectClass=a;return e}function z(a){var c=v(a),e=A(a),e=b.registerService(a.names||a.type,c,e);L[a.serviceId]={registration:e,proxy:c}}function K(){b.persist(c,{created:F,headers:E,services:x,autostart:C,lastModified:I})}var D=this;e=e||{};var F=e.created||(new Date).getTime(),E=e.headers||{},x=e.services||[],C=e.autostart,I=e.lastModified||0,B="installed",G,J,M,X,L={},ca=0,Z=0,T={},U={},W={},aa={},V;this._persist=K;this._resolve=function(){B=
"resolved";b.dispatchEvent(new a("resolved",D))};this._getAutostart=function(){return C};this._getCreated=function(){return F};this.getLocation=function(){return c};this.getHeaders=function(){return JSON.parse(JSON.stringify(E))};this.getName=function(){var a=this.getHeaders();return a?a.name||"":null};this.getVersion=function(){var a=this.getHeaders();return a?a.version||"0.0.0":null};this.getLastModified=function(){return I};this.getServiceReferences=function(){var a=[];Object.keys(L).forEach(function(c){a.push(L[c].registration.getReference())});
return a};this.setParent=function(a){return X!==a?(X=a,D.stop({"transient":!0}).then(function(){if("started"===C)return D.start({"transient":!0});if("lazy"===C)return D.start({lazy:!0,"transient":!0})})):(new k).resolve()};this.getState=function(){return B};this.start=function(e){if("uninstalled"===B)return(new k).reject(Error("Plugin is uninstalled"));if(G)return G.promise.then(this.start.bind(this,e));if("active"===B)return(new k).resolve();if(!e||!e.transient){var g=e&&e.lazy?"lazy":"started";
g!==C&&(C=g,K())}g=b.getState();if("starting"!==g&&"active"!==g)return e.transient?(new k).reject(Error("start transient error")):(new k).resolve();if("installed"===B)try{this._resolve()}catch(f){return(new k).reject(f)}"resolved"===B&&x.forEach(function(a){z(a)});if(e&&e.lazy)return"starting"!==B&&(B="starting",b.dispatchEvent(new a("lazy activation",D))),(new k).resolve();var d=new k;G=d;B="starting";b.dispatchEvent(new a("starting",D));J=new k;M=b.connect(c,t,X);J.then(function(){J=null;B="active";
b.dispatchEvent(new a("started",D));G=null;d.resolve()},function(){J=null;B="stopping";b.dispatchEvent(new a("stopping",D));Object.keys(L).forEach(function(a){L[a].registration.unregister();delete L[a]});b.disconnect(M);M=null;B="resolved";G=null;b.dispatchEvent(new a("stopped",D));d.reject(Error("plugin activation error"))});return d.promise};this.stop=function(c){if("uninstalled"===B)return(new k).reject(Error("Plugin is uninstalled"));if(G)return G.promise.then(this.stop.bind(this,c));if((!c||
!c.transient)&&"stopped"!==C)C="stopped",K();if("active"!==B&&"starting"!==B)return(new k).resolve();G=c=new k;B="stopping";b.dispatchEvent(new a("stopping",D));Object.keys(L).forEach(function(a){L[a].registration.unregister();delete L[a]});M&&(b.disconnect(M),M=null);B="resolved";G=null;b.dispatchEvent(new a("stopped",D));c.resolve();return c.promise};V=function(e){if("uninstalled"===B)return(new k).reject(Error("Plugin is uninstalled"));if(!e)return 0===I&&(I=(new Date).getTime(),K()),b.loadManifest(c).then(V);
var g=E,f=x,h=C;E=e.headers||{};x=e.services||{};C=e.autostart||C;e.lastModified?I=e.lastModified:(I=(new Date).getTime(),K());if(d(E,g)&&d(x,f)&&C===h)return(new k).resolve();if("active"===B||"starting"===B){var r=[];Object.keys(x).forEach(function(a){var c=x[a];r.push(a);var e=L[a];if(e){if(d(c.methods,Object.keys(e.proxy))){a=A(c);var g=e.registration.getReference(),b={};g.getPropertyKeys().forEach(function(a){b[a]=g.getProperty(a)});d(a,b)||e.registration.setProperties(a);return}e.registration.unregister();
delete L[a]}z(c)});Object.keys(L).forEach(function(a){-1===r.indexOf(a)&&(L[a].registration.unregister(),delete L[a])})}"active"===B&&(b.disconnect(M),J=new k,M=b.connect(c,t,X),J.then(function(){J=null},function(){J=null;B="stopping";b.dispatchEvent(new a("stopping"),D);Object.keys(L).forEach(function(a){L[a].registration.unregister();delete L[a]});b.disconnect(M);M=null;B="resolved";b.dispatchEvent(new a("stopped",D))}));return(new k).resolve()};this.update=function(c){return V(c).then(function(){b.dispatchEvent(new a("updated",
D))})};this.uninstall=function(){if("uninstalled"===B)return(new k).reject(Error("Plugin is uninstalled"));if("active"===B||"starting"===B||"stopping"===B)return this.stop().then(this.uninstall.bind(this),this.uninstall.bind(this));b.removePlugin(this);B="uninstalled";b.dispatchEvent(new a("uninstalled",D));return(new k).resolve()}}var e=/^http[s]?/i;return{Plugin:c,PluginRegistry:function(g,b){function f(a){var c=a.source;t.some(function(e){if(c===e.target){try{var g;if("undefined"===typeof e.useStructuredClone){var b=
"string"!==typeof a.data;g=b?a.data:JSON.parse(a.data);e.useStructuredClone=b}else g=e.useStructuredClone?a.data:JSON.parse(a.data);e.handler(g)}catch(f){}return!0}})}b=b||{};var d=b.storage||localStorage;d.getItem||(d=l(d));var w="installed",u,n=[],t=[],v=new m,A={},z={registerService:g.registerService.bind(g),connect:function(a,c,e,g){function b(a){a=Error(a);a.name="timeout";c({method:"timeout",error:a})}var f={handler:c,url:a},d=setTimeout(b.bind(null,"Load timeout for: "+a),g||15E3),h=document.createElement("iframe");
h.name=a+"_"+(new Date).getTime();h.src=a;h.onload=function(){clearTimeout(d);d=setTimeout(b.bind(null,"Plugin handshake timeout for: "+a),5E3)};h.sandbox="allow-scripts allow-same-origin";h.style.width=h.style.height="100%";h.frameBorder=0;(e||u).appendChild(h);f.target=h.contentWindow;f.close=function(){clearTimeout(d);if(h){var a=h.parentNode;a&&a.removeChild(h);h=null}};t.push(f);return f},disconnect:function(a){for(var c=0;c<t.length;c++)if(a===t[c]){t.splice(c,1);try{a.close()}catch(e){}break}},
removePlugin:function(a){for(var c=0;c<n.length;c++)if(a===n[c]){n.splice(c,1);break}d.removeItem("plugin."+a.getLocation())},persist:function(a,c){d.setItem("plugin."+a,JSON.stringify(c))},postMessage:function(a,c){c.target.postMessage(c.useStructuredClone?a:JSON.stringify(a),c.url)},dispatchEvent:function(a){try{v.dispatchEvent(a)}catch(c){console&&console.log("PluginRegistry.dispatchEvent "+c)}},loadManifest:function(a){var c=new k,e=z.connect(a,function(a){e&&a.method&&("manifest"===a.method||
"plugin"===a.method?(a=a.params[0],z.disconnect(e),e=null,c.resolve(a)):"timeout"===a.method&&(z.disconnect(e),e=null,c.reject(a.error)))});return c.promise},getState:function(){return w},handleServiceError:function(a,c){if(c&&401===c.status){var g=a.getHeaders(),b=a.getName()||a.getLocation(),f=document.createElement("span");f.appendChild(document.createTextNode("Authentication required for: "+b+"."));g.login&&(f.appendChild(document.createTextNode(" ")),b=document.createElement("a"),b.target="_blank",
b.textContent="Login",b.href=g.login,e.test(b.href)?(f.appendChild(b),f.appendChild(document.createTextNode(" and re-try the request."))):console.log("Illegal Login URL: "+g.login));return{Severity:"Error",HTML:!0,Message:(new XMLSerializer).serializeToString(f)}}if(c.__isError){var d=c;c=Error(d.message);Object.keys(d).forEach(function(a){c[a]=d[a]});delete c.__isError}return c}};this.getLocation=function(){return"System"};this.getHeaders=function(){return{}};this.getName=function(){return"System"};
this.getVersion=function(){return"0.0.0"};this.getLastModified=function(){return 0};this.getState=z.getState;this.init=function(){if(!("starting"===w||"active"===w||"stopping"===w)){addEventListener("message",f,!1);for(var a=[],e=0,g=d.length;e<g;e++)a.push(d.key(e));a.forEach(function(a){if(0===a.indexOf("plugin.")){var e=a.substring(7);a=JSON.parse(d.getItem(a));a.created&&n.push(new c(e,a,z))}});n.sort(function(a,c){return a._getCreated()<c._getCreated()?-1:1});b.parent?u=b.parent:(u=document.createElement("div"),
b.visible||(u.style.display="none",u.style.visibility="hidden"),document.body.appendChild(u));b.plugins&&Object.keys(b.plugins).forEach(function(a){a=h(a);if(!this.getPlugin(a)){var e=b.plugins[a];"object"!==typeof e&&(e={});e.autostart=e.autostart||b.defaultAutostart||"lazy";n.push(new c(a,e,z))}}.bind(this));w="starting"}};this.start=function(){"starting"!==w&&this.init();if("starting"!==w)return(new k).reject("Cannot start framework. Framework is already "+w+".");var a=[],c=(new Date).getTime();
n.forEach(function(e){var g=e._getAutostart();0===e.getLastModified()?a.push(e.update().then(function(){if("started"===g)return e.start({"transient":!0});if("lazy"===g)return e.start({lazy:!0,"transient":!0});e._resolve()})):"started"===g?a.push(e.start({"transient":!0})):"lazy"===g?(a.push(e.start({lazy:!0,"transient":!0})),c>e.getLastModified()+864E5&&e.update()):e._resolve()});return k.all(a,function(a){console.log("PluginRegistry.stop "+a)}).then(function(){w="active"})};this.stop=function(){if("starting"!==
w&&"active"!==w)return(new k).reject("Cannot stop registry. Registry is already "+w+".");w="stopping";var a=[];n.forEach(function(c){a.push(c.stop({"transient":!0}))});return k.all(a,function(a){console.log("PluginRegistry.stop "+a)}).then(function(){if(!b.parent){var a=u.parentNode;a&&a.removeChild(u)}u=null;removeEventListener("message",f);w="resolved"})};this.update=function(){this.stop().then(this.start.bind(this))};this.uninstall=function(){return(new k).reject("Cannot uninstall registry")};
this.installPlugin=function(e,g){e=h(e);var b=this.getPlugin(e);if(b)return(new k).resolve(b);if(A[e])return A[e];if(g)return b=new c(e,g,z),n.push(b),b._persist(),z.dispatchEvent(new a("installed",b)),(new k).resolve(b);var f=z.loadManifest(e).then(function(g){b=new c(e,g,z);n.push(b);b._persist();delete A[e];z.dispatchEvent(new a("installed",b));return b},function(a){delete A[e];throw a;});return A[e]=f};this.getPlugins=function(){return n.slice()};this.getPlugin=function(a){var c=null;a=h(a);n.some(function(e){if(a===
e.getLocation())return c=e,!0});return c};this.addEventListener=v.addEventListener.bind(v);this.removeEventListener=v.removeEventListener.bind(v);this.resolvePlugins=function(){var a=!0;n.forEach(function(c){a=a&&c._resolve()});return a}}}});
define("orion/serviceTracker",[],function(){function k(d,h){function l(c){var e=c.getProperty("service.id"),g=this.addingService(c);g&&(f[e]=c,a[e]=g)}function b(c){var e=c.getProperty("service.id"),g=a[e];delete f[e];delete a[e];this.removedService(c,g)}this.serviceRegistry=d;var f={},a={},g=m,c,e;this.close=function(){if(g!==n)throw"Already closed";g=m;d.removeEventListener("registered",c);d.removeEventListener("unregistering",e);e=c=null;var a=this;this.getServiceReferences().forEach(function(c){b.call(a,
c)});if("function"===typeof this.onClose)this.onClose()};this.getServiceReferences=function(){var a=Object.keys(f);return!a.length?null:a.map(function(a){return f[a]})};this.open=function(){if(g!==m)throw"Already open";g=n;var a=this;c=function(c){if(-1!==c.serviceReference.getProperty("objectClass").indexOf(h)&&(l.call(a,c.serviceReference),"function"===typeof a.onServiceAdded))return a.onServiceAdded(c.serviceReference,a.serviceRegistry.getService(c.serviceReference))};e=function(c){-1!==c.serviceReference.getProperty("objectClass").indexOf(h)&&
b.call(a,c.serviceReference)};d.addEventListener("registered",c);d.addEventListener("unregistering",e);d.getServiceReferences(h).forEach(function(c){l.call(a,c);if("function"===typeof a.onServiceAdded)return a.onServiceAdded(c,d.getService(c))});if("function"===typeof this.onOpen)this.onOpen()}}var m=0,n=1;k.prototype={addingService:function(d){return this.serviceRegistry.getService(d)},onOpen:null,onClose:null,onServiceAdded:null,removedService:function(d,h){}};return k});
define("orion/objects",[],function(){function k(m){for(var k=1;k<arguments.length;k++){var d=arguments[k],h;for(h in d)Object.prototype.hasOwnProperty.call(d,h)&&(m[h]=d[h])}return m}return{clone:function(m){if(Array.isArray(m))return Array.prototype.slice.call(m);var n=Object.create(Object.getPrototypeOf(m));k(n,m);return n},mixin:k,toArray:function(m){return Array.isArray(m)?m:[m]}}});
define("orion/config",["orion/Deferred","orion/serviceTracker","orion/objects"],function(k,m,n){var d,h,l,b,f,a="pid";d=function(c,e,g){function b(a,c,g){c.forEach(function(b,f){try{var d=a[f].getProperty("__plugin__"),h=d&&e.getPlugin(d);(!d||h&&"active"===h.getState())&&c[f].updated(g)}catch(p){"undefined"!==typeof console&&console.log(p)}})}m.call(this,c,"orion.cm.managedservice");var f={},d={},h=function(e){var b=[];e.plugin.getServiceReferences().forEach(function(e){if(-1!==e.getProperty("objectClass").indexOf("orion.cm.managedservice")){var f=
e.getProperty(a);e=c.getService(e);f&&e&&(f=(f=g._find(f))&&f.getProperties(),b.push(e.updated(f)))}});return k.all(b)};this.addingService=function(e){var g=e.getProperty(a),b=c.getService(e);if(!g||!b)return null;f[g]||(f[g]=[]);d[g]||(d[g]=[]);f[g].push(e);d[g].push(b);return b};this.onServiceAdded=function(c,e){var f=c.getProperty(a),f=g._find(f);b([c],[e],f&&f.getProperties())};this.onOpen=function(){e.addEventListener("started",h)};this.onClose=function(){e.removeEventListener("started",h)};
this.notifyUpdated=function(a){var c=a.getPid();b(f[c]||[],d[c]||[],a.getProperties())};this.notifyDeleted=function(a){a=a.getPid();b(f[a]||[],d[a]||[],null)};this.removedService=function(c,e){var g=c.getProperty(a),b=f[g],h=d[g];1<b.length?b.splice(b.indexOf(c),1):delete f[g];1<h.length?h.splice(h.indexOf(e),1):delete d[g]}};h=function(){function a(c,g,f){this.store=new l(this,f);this.configAdmin=new b(this,this.store);this.tracker=new d(c,g,this.store)}a.prototype={getConfigurationAdmin:function(){var a=
this;return this.configAdmin._init().then(function(c){a.tracker.open();return c})},notifyDeleted:function(a){this.tracker.notifyDeleted(a)},notifyUpdated:function(a){this.tracker.notifyUpdated(a)}};return a}();b=function(){function a(c,g){this.factory=c;this.store=g}a.prototype={_init:function(){var a=this;return this.store._init().then(function(){return a})},getConfiguration:function(a){return this.store.get(a)},listConfigurations:function(){return this.store.list()}};return a}();var g="/cm/configurations";
l=function(){function c(c,b){this.factory=c;this.prefsService=b;this.configs=Object.create(null);this.pref=null;var d=this;this.initPromise=this.prefsService.getPreferences(g).then(function(c){d.pref=c;c.keys().forEach(function(e){if(!d.configs[e]){var g=c.get(e);"object"===typeof g&&null!==g&&0<Object.keys(g).length&&(g[a]=e,d.configs[e]=new f(d.factory,d,g))}})})}c.prototype={_init:function(){return this.initPromise},_find:function(a){return this.configs[a]||null},get:function(a){var c=this._find(a);
c||(c=new f(this.factory,this,a),this.configs[a]=c);return c},list:function(){var a=this,c=[];this.pref.keys().forEach(function(g){(g=a._find(g))&&null!==g.getProperties()&&c.push(g)});return c},remove:function(a){this.pref.remove(a);delete this.configs[a]},save:function(a,c){this.pref.put(a,c.getProperties(!0)||{})}};return c}();f=function(){function c(c,e){e=n.clone(e);delete e[a];c.properties=e}function e(e,g,b){this.factory=e;this.store=g;if(null!==b&&"object"===typeof b)this.pid=b[a],c(this,
b);else if("string"===typeof b)this.pid=b,this.properties=null;else throw Error("Invalid pid/properties "+b);}e.prototype={_checkRemoved:function(){if(this._removed)throw Error("Configuration was removed");},getPid:function(){this._checkRemoved();return this.pid},getProperties:function(c){this._checkRemoved();var e=null;this.properties&&(e=n.clone(this.properties),c||(e[a]=this.pid));return e},remove:function(){this._checkRemoved();this.factory.notifyDeleted(this);this.store.remove(this.pid);this._removed=
!0},update:function(a){this._checkRemoved();c(this,a);this.store.save(this.pid,this);this.factory.notifyUpdated(this)},toString:function(){return"[ConfigImpl pid: "+this.pid+", properties: "+JSON.stringify(this.properties)+"]"}};return e}();return{ConfigurationAdminFactory:h}});
define("orion/bootstrap","require orion/Deferred orion/serviceregistry orion/preferences orion/pluginregistry orion/config".split(" "),function(k,m,n,d,h,l){var b;return{startup:function(){if(b)return b;b=new m;var f=new n.ServiceRegistry,a=new d.PreferencesService(f);return a.getPreferences("/plugins").then(function(g){var c={plugins:{}};g.keys().forEach(function(a){var e=k.toUrl(a);c.plugins[e]=g[a]});var e=new h.PluginRegistry(f,c);return e.start().then(function(){if(0<f.getServiceReferences("orion.core.preference.provider").length)return a.getPreferences("/plugins",
a.USER_SCOPE).then(function(a){var c=[];a.keys().forEach(function(a){a=k.toUrl(a);e.getPlugin(a)||c.push(e.installPlugin(a,{autostart:"lazy"}).then(function(a){return a.update().then(function(){return a.start({lazy:!0})})}))});return m.all(c,function(a){console.log(a)})})}).then(function(){return(new l.ConfigurationAdminFactory(f,e,a)).getConfigurationAdmin().then(f.registerService.bind(f,"orion.cm.configadmin"))}).then(function(){var a=f.getService("orion.core.auth");if(a){var c=a.getUser().then(function(c){if(c)localStorage.setItem("lastLogin",
(new Date).getTime());else return a.getAuthForm(window.location.href).then(function(a){setTimeout(function(){window.location=a},0)})}),e=localStorage.getItem("lastLogin");if(!e||e<(new Date).getTime()-9E5)return c}}).then(function(){var c={serviceRegistry:f,preferences:a,pluginRegistry:e};b.resolve(c);return c})})}}});
define("orion/util",[],function(){var k=navigator.userAgent,m=-1!==k.indexOf("MSIE")||-1!==k.indexOf("Trident")?document.documentMode:void 0,n=parseFloat(k.split("Firefox/")[1]||k.split("Minefield/")[1])||void 0,d=-1!==k.indexOf("Opera")?parseFloat(k.split("Version/")[1]):void 0,h=parseFloat(k.split("Chrome/")[1])||void 0,l=-1!==k.indexOf("Safari")&&!h,b=parseFloat(k.split("WebKit/")[1])||void 0,f=-1!==k.indexOf("Android"),a=-1!==k.indexOf("iPad"),k=-1!==k.indexOf("iPhone"),g=a||k,c=-1!==navigator.platform.indexOf("Mac"),
e=-1!==navigator.platform.indexOf("Win"),p=-1!==navigator.platform.indexOf("Linux"),r="ontouchstart"in document.createElement("input");return{formatMessage:function(a){var c=arguments;return a.replace(/\$\{([^\}]+)\}/g,function(a,e){return c[(e<<0)+1]})},createElement:function(a,c){return a.createElementNS?a.createElementNS("http://www.w3.org/1999/xhtml",c):a.createElement(c)},isIE:m,isFirefox:n,isOpera:d,isChrome:h,isSafari:l,isWebkit:b,isAndroid:f,isIPad:a,isIPhone:k,isIOS:g,isMac:c,isWindows:e,
isLinux:p,isTouch:r,platformDelimiter:e?"\r\n":"\n"}});
define("orion/webui/littlelib",["orion/util"],function(k){function m(a,g){g||(g=document);return g.querySelectorAll(a)}function n(a){var g=a.tabIndex;0===g&&k.isIE&&!{a:!0,body:!0,button:!0,frame:!0,iframe:!0,img:!0,input:!0,isindex:!0,object:!0,select:!0,textarea:!0}[a.nodeName.toLowerCase()]&&!a.attributes.tabIndex&&(g=-1);return g}function d(a){if(0<=n(a))return a;if(a.hasChildNodes())for(var g=0;g<a.childNodes.length;g++){var c=d(a.childNodes[g]);if(c)return c}return null}function h(a){if(0<=
n(a))return a;if(a.hasChildNodes())for(var g=a.childNodes.length-1;0<=g;g--){var c=h(a.childNodes[g]);if(c)return c}return null}function l(a,g){if(3===a.nodeType){var c=b.exec(a.nodeValue);c&&1<c.length&&g(a,c)}if(a.hasChildNodes())for(c=0;c<a.childNodes.length;c++)l(a.childNodes[c],g)}var b=/\$\{([^\}]+)\}/,f=null;return{$:function(a,g){g||(g=document);return g.querySelector(a)},$$:m,$$array:function(a,g){return Array.prototype.slice.call(m(a,g))},node:function(a){var g=a;"string"===typeof a&&(g=
document.getElementById(a));return g},contains:function(a,g){if(!a||!g)return!1;if(a===g)return!0;var c=a.compareDocumentPosition(g);return Boolean(c&16)},bounds:function(a){a=a.getBoundingClientRect();return{left:a.left+document.documentElement.scrollLeft,top:a.top+document.documentElement.scrollTop,width:a.width,height:a.height}},empty:function(a){for(;a.hasChildNodes();)a.removeChild(a.firstChild)},firstTabbable:d,lastTabbable:h,stop:function(a){window.document.all&&(a.keyCode=0);a.preventDefault&&
(a.preventDefault(),a.stopPropagation())},processTextNodes:function(a,g){l(a,function(a,e){a.parentNode.replaceChild(document.createTextNode(g[e[1]]||e[1]),a)})},processDOMNodes:function(a,g){l(a,function(a,e){var b=g[e[1]];if(b){var f=document.createRange(),d=e.index;f.setStart(a,d);f.setEnd(a,d+e[0].length);f.deleteContents();f.insertNode(b)}})},addAutoDismiss:function(a,g){function c(a){f.forEach(function(c){var g=!1,b=c.excludeNodes.some(function(c){return document.body.contains(c)?(g=!0,c.contains(a.target)):
!1});if(g&&!b)try{c.dismiss(a)}catch(f){"undefined"!==typeof console&&console&&console.error(f&&f.message)}});f=f.filter(function(a){return a.excludeNodes.some(function(a){return document.body.contains(a)})})}null===f&&(f=[],document.addEventListener("click",c,!0),k.isIOS&&document.addEventListener("touchend",function(a){function c(){a.target.removeEventListener("click",c)}0===a.touches.length&&a.target.addEventListener("click",c)},!1));f.push({excludeNodes:a,dismiss:g})},setFramesEnabled:function(a){for(var g=
document.getElementsByTagName("iframe"),c=0;c<g.length;c++)g[c].parentNode.style.pointerEvents=a?"":"none"},removeAutoDismiss:function(a){f=f.filter(function(g){return a!==g.dismiss})},KEY:{BKSPC:8,TAB:9,ENTER:13,ESCAPE:27,SPACE:32,PAGEUP:33,PAGEDOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,INSERT:45,DEL:46}}});
define("orion/webui/dropdown",["require","orion/webui/littlelib","orion/EventTarget"],function(k,m,n){function d(b){n.attach(this);this._init(b)}function h(b,f){var a=document.createElement(void 0===f?"span":f);a.tabIndex=0;a.className="dropdownMenuItem";a.role="menuitem";var g=document.createElement("span");g.appendChild(document.createTextNode(b));g.classList.add("dropdownCommandName");a.appendChild(g);g=document.createElement("li");g.appendChild(a);return g}function l(){var b=document.createElement("li");
b.classList.add("dropdownSeparator");return b}d.prototype={_init:function(b){this._dropdownNode=m.node(b.dropdown);if(!this._dropdownNode)throw"no dom node for dropdown found";this._populate=b.populate;this._selectionClass=b.selectionClass;this._parentDropdown=b.parentDropdown;this._positioningNode=b.positioningNode;if(!this._parentDropdown)for(var f=this._dropdownNode.parentNode;f&&document!==f;){if(f.classList&&f.classList.contains("dropdownMenu")){this._parentDropdown=f.dropdown;break}f=f.parentNode}this._dropdownNode.tabIndex=
0;this._triggerNode=b.triggerNode?b.triggerNode:m.$(".dropdownTrigger",this._dropdownNode.parentNode);if(!this._triggerNode)throw"no dom node for dropdown trigger found";if(!b.skipTriggerEventListeners){var a=this;this._triggerNode.addEventListener("click",function(g){a.toggle(g)&&m.stop(g)},!1);"span"===this._triggerNode.tagName.toLowerCase()&&this._triggerNode.addEventListener("keydown",function(g){if(g.keyCode===m.KEY.ENTER||g.keyCode===m.KEY.SPACE)a.toggle(),m.stop(g)},!1)}this._dropdownNode.addEventListener("keydown",
this._dropdownKeyDown.bind(this),!1)},addTriggerNode:function(b){var f=this;b.addEventListener("click",function(a){f.toggle(a)&&m.stop(a)},!1)},toggle:function(b){return this.isVisible()?this.close():this.open(b)},isVisible:function(){return this._isVisible},open:function(b){var f=!1;this.isVisible()||(this.dispatchEvent({type:"triggered",dropdown:this,event:b}),m.setFramesEnabled(!1),this._populate&&(this.empty(),this._populate(this._dropdownNode)),0<this.getItems().length&&(this._hookedAutoDismiss||
(this._boundAutoDismiss?m.removeAutoDismiss(this._boundAutoDismiss):this._boundAutoDismiss=this._autoDismiss.bind(this),f=m.$$array(".dropdownSubMenu",this._dropdownNode),m.addAutoDismiss([this._triggerNode].concat(f),this._boundAutoDismiss),this._hookedAutoDismiss=!0),this._triggerNode.classList.add("dropdownTriggerOpen"),this._selectionClass&&this._triggerNode.classList.add(this._selectionClass),this._dropdownNode.classList.add("dropdownMenuOpen"),this._isVisible=!0,this._positionDropdown(b),this._dropdownNode.focus(),
f=!0,this._parentDropdown&&this._parentDropdown.submenuOpen(this)));return f},_autoDismiss:function(b){if(this.close(!1)&&this._dropdownNode.contains(b.target))for(b=this._parentDropdown;b;)b.close(!1),b=b._parentDropdown},_positionDropdown:function(b){this._dropdownNode.style.left="";this._dropdownNode.style.top="";if(this._positioningNode)this._dropdownNode.style.left=this._positioningNode.offsetLeft+"px";else{b=m.bounds(this._dropdownNode);var f=m.bounds(document.body);if(b.left+b.width>f.left+
f.width)if(this._triggerNode.classList.contains("dropdownMenuItem"))this._dropdownNode.style.left=-b.width+"px";else{var a=m.bounds(this._boundingNode(this._triggerNode)),g=m.bounds(this._triggerNode);this._dropdownNode.style.left=g.left-a.left-b.width+g.width+"px"}b=b.top+b.height-(f.top+f.height);0<b&&(this._dropdownNode.style.top=Math.floor(this._dropdownNode.style.top-b)+"px")}},_boundingNode:function(b){var f=window.getComputedStyle(b,null);return null===f||"absolute"===f.getPropertyValue("position")||
!b.parentNode||b===document.body?b:this._boundingNode(b.parentNode)},close:function(b){var f=!1;this.isVisible()&&(this._triggerNode.classList.remove("dropdownTriggerOpen"),this._selectionClass&&this._triggerNode.classList.remove(this._selectionClass),this._dropdownNode.classList.remove("dropdownMenuOpen"),m.setFramesEnabled(!0),b&&this._triggerNode.focus(),this._isVisible=!1,this._selectedItem&&(this._selectedItem.classList.remove("dropdownMenuItemSelected"),this._selectedItem=null),f=!0);return f},
getItems:function(){var b=[],f=this;m.$$array("li:not(.dropdownSeparator) \x3e .dropdownMenuItem",this._dropdownNode,!0).forEach(function(a){a.parentNode.parentNode===f._dropdownNode&&b.push(a)});b.forEach(function(a){a._hasDropdownMouseover||(a.addEventListener("mouseover",function(g){a.dropdown?a.dropdown.open(g):(f._closeSelectedSubmenu(),m.stop(g));f._selectItem(a)}),a._hasDropdownMouseover=!0)});return b},empty:function(){var b=this;m.$$array("li",this._dropdownNode).forEach(function(f){f.parentNode===
b._dropdownNode&&f.parentNode.removeChild(f)});this._hookedAutoDismiss=!1},_dropdownKeyDown:function(b){if(b.keyCode===m.KEY.UP||b.keyCode===m.KEY.DOWN||b.keyCode===m.KEY.RIGHT||b.keyCode===m.KEY.ENTER||b.keyCode===m.KEY.LEFT){var f=this.getItems();if(f.length&&0<f.length){if(this._selectedItem){var a=f.indexOf(this._selectedItem);0>a&&(a=f.indexOf(this._selectedItem.parentNode));0<=a&&(b.keyCode===m.KEY.UP&&0<a?(a--,this._selectItem(f[a])):b.keyCode===m.KEY.DOWN&&a<f.length-1?(a++,this._selectItem(f[a])):
b.keyCode===m.KEY.ENTER||b.keyCode===m.KEY.RIGHT?this._selectedItem.classList.contains("dropdownTrigger")&&this._selectedItem.dropdown?(this._selectedItem.dropdown.open(),this._selectedItem.dropdown._selectItem()):b.keyCode===m.KEY.ENTER&&this._selectedItem.click():b.keyCode===m.KEY.LEFT&&this._selectedItem.parentNode.parentNode.classList.contains("dropdownMenuOpen")&&(this.close(!0),this._parentDropdown&&this._parentDropdown._dropdownNode.focus()))}else this._selectItem(f[0]);m.stop(b)}}else b.keyCode===
m.KEY.ESCAPE&&(this.close(!0),m.stop(b))},_selectItem:function(b){if(b=b||this.getItems()[0])this._selectedItem&&this._selectedItem.classList.remove("dropdownMenuItemSelected"),this._selectedItem=b,this._selectedItem.classList.add("dropdownMenuItemSelected");document.activeElement!==this._dropdownNode&&this._dropdownNode.focus()},submenuOpen:function(b){b!==this._selectedSubmenu&&(this._closeSelectedSubmenu(),this._selectedSubmenu=b)},_closeSelectedSubmenu:function(){for(var b=this._selectedSubmenu;b;)b.close(),
b=b._selectedSubmenu},destroy:function(){this.empty();this._boundAutoDismiss&&m.removeAutoDismiss(this._boundAutoDismiss)},appendMenuItem:function(b,f){var a=h(b,f);this._dropdownNode.appendChild(a);return a},appendSeparator:function(){var b=l();this._dropdownNode.appendChild(b);return b}};d.prototype.constructor=d;return{Dropdown:d,appendKeyBindingString:function(b,f){var a=document.createElement("span");a.classList.add("dropdownKeyBinding");a.appendChild(document.createTextNode(f));b.appendChild(a)},
createMenuItem:h,createSeparator:l}});
define("text",["module"],function(k){var m,n,d=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"],h=/^\s*<\?xml(\s)+version=[\'\"](\d)*.(\d)*[\'\"](\s)*\?>/im,l=/<body[^>]*>\s*([\s\S]+)\s*<\/body>/im,b="undefined"!==typeof location&&location.href,f=b&&location.protocol&&location.protocol.replace(/\:/,""),a=b&&location.hostname,g=b&&(location.port||void 0),c=[],e=k.config&&k.config()||{};m={version:"2.0.5",strip:function(a){if(a){a=a.replace(h,"");var c=a.match(l);c&&(a=c[1])}else a="";return a},
jsEscape:function(a){return a.replace(/(['\\])/g,"\\$1").replace(/[\f]/g,"\\f").replace(/[\b]/g,"\\b").replace(/[\n]/g,"\\n").replace(/[\t]/g,"\\t").replace(/[\r]/g,"\\r").replace(/[\u2028]/g,"\\u2028").replace(/[\u2029]/g,"\\u2029")},createXhr:e.createXhr||function(){var a,c,e;if("undefined"!==typeof XMLHttpRequest)return new XMLHttpRequest;if("undefined"!==typeof ActiveXObject)for(c=0;3>c;c+=1){e=d[c];try{a=new ActiveXObject(e)}catch(g){}if(a){d=[e];break}}return a},parseName:function(a){var c,
e,g=!1,b=a.indexOf(".");c=0===a.indexOf("./")||0===a.indexOf("../");-1!==b&&(!c||1<b)?(c=a.substring(0,b),e=a.substring(b+1,a.length)):c=a;a=e||c;b=a.indexOf("!");-1!==b&&(g="strip"===a.substring(b+1),a=a.substring(0,b),e?e=a:c=a);return{moduleName:c,ext:e,strip:g}},xdRegExp:/^((\w+)\:)?\/\/([^\/\\]+)/,useXhr:function(a,c,e,g){var b,f;b=m.xdRegExp.exec(a);if(!b)return!0;a=b[2];b=b[3];b=b.split(":");f=b[1];b=b[0];return(!a||a===c)&&(!b||b.toLowerCase()===e.toLowerCase())&&(!f&&!b||f===g)},finishLoad:function(a,
g,b,f){b=g?m.strip(b):b;e.isBuild&&(c[a]=b);f(b)},load:function(c,d,h,l){if(l.isBuild&&!l.inlineText)h();else{e.isBuild=l.isBuild;var k=m.parseName(c);l=k.moduleName+(k.ext?"."+k.ext:"");var u=d.toUrl(l),n=e.useXhr||m.useXhr;!b||n(u,f,a,g)?m.get(u,function(a){m.finishLoad(c,k.strip,a,h)},function(a){h.error&&h.error(a)}):d([l],function(a){m.finishLoad(k.moduleName+"."+k.ext,k.strip,a,h)})}},write:function(a,e,g,b){c.hasOwnProperty(e)&&(b=m.jsEscape(c[e]),g.asModule(a+"!"+e,"define(function () { return '"+
b+"';});\n"))},writeFile:function(a,c,e,g,b){c=m.parseName(c);var f=c.ext?"."+c.ext:"",d=c.moduleName+f,h=e.toUrl(c.moduleName+f)+".js";m.load(d,e,function(c){c=function(a){return g(h,a)};c.asModule=function(a,c){return g.asModule(a,h,c)};m.write(a,d,c,b)},b)}};if("node"===e.env||!e.env&&"undefined"!==typeof process&&process.versions&&process.versions.node)n=require.nodeRequire("fs"),m.get=function(a,c){var e=n.readFileSync(a,"utf8");0===e.indexOf("\ufeff")&&(e=e.substring(1));c(e)};else if("xhr"===
e.env||!e.env&&m.createXhr())m.get=function(a,c,g,b){var f=m.createXhr(),d;f.open("GET",a,!0);if(b)for(d in b)b.hasOwnProperty(d)&&f.setRequestHeader(d.toLowerCase(),b[d]);if(e.onXhr)e.onXhr(f,a);f.onreadystatechange=function(e){4===f.readyState&&(e=f.status,399<e&&600>e?(e=Error(a+" HTTP status: "+e),e.xhr=f,g(e)):c(f.responseText))};f.send(null)};else if("rhino"===e.env||!e.env&&"undefined"!==typeof Packages&&"undefined"!==typeof java)m.get=function(a,c){var e,g,b=new java.io.File(a),f=java.lang.System.getProperty("line.separator"),
b=new java.io.BufferedReader(new java.io.InputStreamReader(new java.io.FileInputStream(b),"utf-8")),d="";try{e=new java.lang.StringBuffer;(g=b.readLine())&&g.length()&&65279===g.charAt(0)&&(g=g.substring(1));for(null!==g&&e.append(g);null!==(g=b.readLine());)e.append(f),e.append(g);d=String(e.toString())}finally{b.close()}c(d)};return m});define("text!orion/webui/dropdowntriggerbutton.html",[],function(){return'\x3cbutton class\x3d"dropdownTrigger"\x3e${ButtonText}\x3c!--span class\x3d"dropdownArrowDown core-sprite-openarrow"\x3e\x3c/span--\x3e\x3c/button\x3e\x3cul class\x3d"dropdownMenu"\x3e\x3c/ul\x3e'});
define("text!orion/webui/dropdowntriggerbuttonwitharrow.html",[],function(){return'\x3cbutton class\x3d"dropdownTrigger dropdownDefaultButton"\x3e${ButtonText}\x3cspan class\x3d"dropdownArrowDown core-sprite-openarrow"\x3e\x3c/span\x3e\x3c/button\x3e\x3cul class\x3d"dropdownMenu"\x3e\x3c/ul\x3e'});define("text!orion/webui/submenutriggerbutton.html",[],function(){return'\x3cli class\x3d"dropdownSubMenu"\x3e\x3cspan class\x3d"dropdownTrigger dropdownMenuItem" role\x3d"menuitem" tabindex\x3d"0"\x3e\x3cspan class\x3d"dropdownCommandName"\x3e${ButtonText}\x3c/span\x3e\x3cspan class\x3d"dropdownArrowRight core-sprite-closedarrow"\x3e\x3c/span\x3e\x3c/span\x3e\x3cul class\x3d"dropdownMenu"\x3e\x3c/ul\x3e\x3c/li\x3e'});
define("text!orion/webui/checkedmenuitem.html",[],function(){return'\x3cli\x3e\x3clabel class\x3d"dropdownMenuItem"\x3e\x3cinput class\x3d"checkedMenuItem" role\x3d"menuitem" type\x3d"checkbox" /\x3e${ItemText}\x3c/label\x3e\x3c/li\x3e'});
define("orion/webui/tooltip",["require","orion/webui/littlelib"],function(k,m){function n(d){this._init(d)}n.prototype={_init:function(d){this._node=m.node(d.node);if(!this._node)throw"no dom node for tooltip found";this._position=d.position||["right","above","below","left"];this._text=d.text;this._hideDelay=void 0===d.hideDelay?200:d.hideDelay;this._tailSize=d.tailSize||10;this._trigger=d.trigger||"mouseover";this._afterShowing=d.afterShowing;this._afterHiding=d.afterHiding;var h=this;if("click"===
this._trigger)this._showDelay=0,this._node.addEventListener("click",this._clickHandler=function(b){b.target===h._node&&(h.show(),m.stop(b))},!1);else if("mouseover"===this._trigger){this._showDelay=void 0===d.showDelay?500:d.showDelay;d=["mouseout","click"];this._node.addEventListener("mouseover",this._mouseoverHandler=function(b){m.contains(h._node,b.target)&&(h.show(),m.stop(b))},!1);this._leaveHandler=function(b){m.contains(h._node,b.target)&&h.hide()};for(var l=0;l<d.length;l++)this._node.addEventListener(d[l],
this._leaveHandler,!1)}},_makeTipNode:function(){if(!this._tip){this._tip=document.createElement("span");this._tip.classList.add("tooltipContainer");this._tipInner=document.createElement("div");this._tipInner.classList.add("tooltip");if(this._text){this._tipTextContent=document.createElement("div");this._tipTextContent.classList.add("textContent");this._tipInner.appendChild(this._tipTextContent);var d=document.createTextNode(this._text);this._tipTextContent.appendChild(d)}this._tip.appendChild(this._tipInner);
document.body.appendChild(this._tip);var h=this;m.addAutoDismiss([this._tip,this._node],function(){h.hide()});"mouseover"===this._trigger&&(this._tipInner.role="tooltip",this._tipInner.id="tooltip"+(new Date).getTime().toString(),this._node.setAttribute("aria-describedby",this._tipInner.id),this._tip.addEventListener("mouseover",function(d){h._timeout&&(window.clearTimeout(h._timeout),h._timeout=null);h._tip.addEventListener("mouseout",function(b){m.contains(h._tip,b.target)&&(h.hide(),m.stop(b))},
!1)},!1))}return this._tip},_positionTip:function(d,h){this._makeTipNode();"left"===d?this._tipInner.classList.add("left"):this._tipInner.classList.remove("left");var l=this._node,b;for(b=m.bounds(l);l&&!b.width&&!b.height;l=l.parentNode)b=m.bounds(l);var l=m.bounds(this._tipInner),f;switch(d){case "above":f=b.top-l.height-this._tailSize-1;b=b.left-this._tailSize;break;case "below":f=b.top+b.height+this._tailSize+1;b=b.left-this._tailSize;break;case "left":f=b.top-this._tailSize/2;b=b.left-l.width-
this._tailSize-1;break;default:f=b.top-this._tailSize/2,b=b.left+b.width+this._tailSize+1}var a=m.bounds(document.documentElement);if(f+l.height>a.height)if(h)f=a.height-l.height-1;else return!1;if(b+l.width>a.width)if(h)b=a.width-l.width-1;else return!1;if(0>b)if(h)b=4;else return!1;if(0>f)if(h)f=4;else return!1;this._tail&&this._tail.previousPosition!==d&&(this._tip.removeChild(this._tail),this._tail=null);this._tail||(this._tail=document.createElement("span"),this._tail.classList.add("tooltipTailFrom"+
d),"above"===d||"left"===d?this._tip.appendChild(this._tail):this._tip.insertBefore(this._tail,this._tipInner),"left"===d&&(this._tail.style.left=l.width+"px"),this._tail.previousPosition=d);this._tip.style.top=f+"px";this._tip.style.left=b+"px";return!0},contentContainer:function(){this._makeTipNode();return this._tipInner},show:function(){if(!this._tip||!this._tip.classList.contains("tooltipShowing"))this._timeout&&(window.clearTimeout(this._timeout),this._timeout=null),this._showDelay?this._timeout=
window.setTimeout(this._showImmediately.bind(this),this._showDelay):this._showImmediately()},_showImmediately:function(){for(var d=!1,h=0;!d&&h<this._position.length;)d=this._positionTip(this._position[h]),h++;d||this._positionTip(this._position[0],!0);this._tip.classList.add("tooltipShowing");this._afterShowing&&this._afterShowing()},hide:function(d){this._timeout&&(window.clearTimeout(this._timeout),this._timeout=null);if(this._tip&&this._tip.classList.contains("tooltipShowing")){void 0===d&&(d=
this._hideDelay);var h=this;this._timeout=window.setTimeout(function(){h._tip.classList.remove("tooltipShowing");h._tip.removeAttribute("style");h._afterHiding&&h._afterHiding()},d)}},destroy:function(){this._timeout&&(window.clearTimeout(this._timeout),this._timeout=null);this._tip&&(document.body.removeChild(this._tip),this._tail=this._tipTextContent=this._tipInner=this._tip=null);if(this._node){this._node.removeEventListener("click",this._clickHandler,!1);this._node.removeEventListener("mouseover",
this._mouseoverHandler,!1);for(var d=["mouseout","click"],h=0;h<d.length;h++)this._node.removeEventListener(d[h],this._leaveHandler,!1)}}};n.prototype.constructor=n;return{Tooltip:n}});
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,m,n,d,h,l,b,f){function a(a){var c=a.invocation;if(c){var e=a.command;if(e.hrefCallback)return a=e.hrefCallback.call(c.handler||window,c),a.then?a.then(function(a){window.open(a)}):window.open(a),!0;if(c.commandRegistry)return c.commandRegistry._invoke(c),
!0;if(e.onClick||e.callback)return window.setTimeout(function(){(e.onClick||e.callback).call(c.handler||window,c)},0),!0}return!1}function g(c,e){for(var g in e)if(e[g]&&e[g].keyBinding&&e[g].command&&e[g].keyBinding.match(c)){var b=e[g],f=b.keyBinding;if((!f.domScope||m.contains(m.node(f.domScope),c.target))&&a(b)){m.stop(c);break}}}function c(){var a={};if(u){var c,e,g;e=Object.keys(y);for(c=0;c<e.length;c++)g=e[c],a[g]=y[g];var b=u();e=Object.keys(b);for(c=0;c<e.length;c++)g=e[c],a[g]=b[g]}else a=
y;return a}function e(a){g(a,c())}function p(a,c){a=a||window.event;if(function(a){if(k.isMac){if(a.metaKey&&!a.altKey)return!a.shiftKey&&!a.ctrlKey&&(65===a.keyCode||67===a.keyCode||86===a.keyCode||88===a.keyCode||90===a.keyCode)?!0:!1;if(a.ctrlKey)return!1}else{if(a.ctrlKey&&!a.altKey)return!a.shiftKey&&(65===a.keyCode||67===a.keyCode||86===a.keyCode||88===a.keyCode||90===a.keyCode)?!0:!1;if(a.altKey&&!a.ctrlKey)return!1}if(a["char"])return 0<a["char"].length;if(a.charCode||a.keyCode)switch(a=a.charCode||
a.keyCode,a){case 8:case 9:case 13:case 46:return!0;default:return 32<=a&&112>a||123<a}return!1}(a)){if("true"===a.target.contentEditable)return;var g=a.target.nodeName.toLowerCase();if("input"===g)switch(a.target.type.toLowerCase()){case "text":case "password":case "search":case "color":case "date":case "datetime":case "datetime-local":case "email":case "month":case "number":case "range":case "tel":case "time":case "url":case "week":return}else if("textarea"===g)return}c?c(a):e(a)}function r(){this._init()}
function q(a,c,e){c.classList.add("commandImage");var g;a.imageClass?a.addImageClassToElement?c.classList.add(a.imageClass):(g=document.createElement("span"),c.appendChild(g),g.classList.add(a.spriteClass),g.classList.add(a.imageClass)):(g=new Image,g.alt=a.name,g.name=e,g.id=e,g.src=a.image,c.appendChild(g));return g}function s(a,c,e,g,b){this.commandRegistry=b;this.handler=a;this.items=c;this.userData=e;this.command=g;g.parameters&&(this.parameters=g.parameters.makeCopy());this.id=g.id}function w(a){this._init(a)}
var u=null,y={};r.prototype={setProxy:function(a){this.proxy=a},setKeyBindings:function(a){this.bindings=a},_init:function(){var a=this;document.addEventListener("keydown",function(c){return p(c,function(c){var e=a.proxy,g=a.bindings;if(g&&e)for(var b=0;b<g.length;b++)g[b].match(c)&&(e.processKey({type:c.type,keyCode:c.keyCode,altKey:c.altKey,ctrlKey:c.ctrlKey,metaKey:c.metaKey,shiftKey:c.shiftKey}),m.stop(c))})})}};window.document.addEventListener("keydown",p,!1);s.prototype={collectsParameters:function(){return this.commandRegistry&&
this.commandRegistry.collectsParameters()},makeCopy:function(a){var c=new s(this.handler,this.items,this.userData,this.command,this.commandRegistry);c.domNode=this.domNode;c.domParent=this.domParent;a?c.parameters=a.makeCopy():this.parameters&&(c.parameters=this.parameters.makeCopy());return c}};s.prototype.constructor=s;w.prototype={_init:function(a){this.id=a.id;this.name=a.name;this.tooltip=a.tooltip;this.callback=a.callback;this.hrefCallback=a.hrefCallback;this.choiceCallback=a.choiceCallback;
this.positioningNode=a.positioningNode;this.image=a.image||"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAAA1BMVEUAAACnej3aAAAAAXRSTlMAQObYZgAAAAtJREFUCNdjIBEAAAAwAAFletZ8AAAAAElFTkSuQmCC";this.imageClass=a.imageClass;this.addImageClassToElement=a.addImageClassToElement;this.selectionClass=a.selectionClass;this.spriteClass=a.spriteClass||"commandSprite";this.visibleWhen=a.visibleWhen;this.parameters=a.parameters;this.isEditor=a.isEditor},populateChoicesMenu:function(a,c,e,g,
b){e=this.getChoices(c,e,g);var f=e.some(function(a){return a.checked});e.forEach(function(e){if(e.name){var g=document.createElement("li");a.appendChild(g);var d=document.createElement("span");d.tabIndex=0;d.role="menuitem";d.classList.add("dropdownMenuItem");if(f){var h=document.createElement("span");h.classList.add("check");h.appendChild(document.createTextNode(e.checked?"\u25cf":""));d.appendChild(h)}h=document.createTextNode(e.name);d.appendChild(h);g.appendChild(d);d.choice=e;d.addEventListener("click",
function(a){a.target.choice&&a.target.choice.callback.call(a.target.choice,c)},!1);d.addEventListener("keydown",function(a){(a.keyCode===m.KEY.ENTER||a.keyCode===m.KEY.SPACE)&&a.target.choice&&a.target.choice.callback.call(a.target.choice,c)},!1)}else b._generateMenuSeparator(a)})},getChoices:function(a,c,e){return this.choiceCallback?this.choiceCallback.call(c,a,e):null},makeChoiceCallback:function(a,c){return function(e){a.callback&&a.callback.call(a,c,e)}},hasImage:function(){return this.imageClass||
"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAAA1BMVEUAAACnej3aAAAAAXRSTlMAQObYZgAAAAtJREFUCNdjIBEAAAAwAAFletZ8AAAAAElFTkSuQmCC"!==this.image}};w.prototype.constructor=w;return{Command:w,CommandInvocation:s,createDropdownMenu:function(a,c,e,g,b,f,p,l,r){a=m.node(a);if(!a)throw"no parent node was specified";var s=document.createRange();s.selectNode(a);s=r?s.createContextualFragment(h):s.createContextualFragment(d);m.processTextNodes(s,{ButtonText:c});a.appendChild(s);a=a.lastChild;
var k;r?(r=a.previousSibling,k=r.lastChild):r=a.previousSibling;g?r.classList.add(g):(r.classList.add("orionButton"),r.classList.add("commandButton"));b&&(f||(r.textContent="",r.setAttribute("aria-label",c)),q({spriteClass:"commandSprite",imageClass:b},r,c),r.classList.add("orionButton"));r.dropdown=new n.Dropdown({dropdown:a,populate:e,selectionClass:p,skipTriggerEventListeners:!!k,positioningNode:l});a.dropdown=r.dropdown;return{menuButton:r,menu:a,dropdown:r.dropdown,dropdownArrow:k}},createCheckedMenuItem:function(a,
c,e,g){a=m.node(a);if(!a)throw"no parent node was specified";var f=document.createRange();f.selectNode(a);f=f.createContextualFragment(b);m.processTextNodes(f,{ItemText:c});a.appendChild(f);a=m.$(".checkedMenuItem",a.lastChild);a.checked=e;a.addEventListener("change",g,!1);return a},createCommandItem:function(a,c,e,g,b,d,h){var p;d=d||!c.name&&c.hasImage();if(c.hrefCallback)p=document.createElement("a"),p.id=g,d&&c.hasImage()?q(c,p,g):(p.className="commandLink",p.appendChild(document.createTextNode(c.name))),
h=c.hrefCallback.call(e.handler,e),h.then?h.then(function(a){p.href=a}):p.href=h?h:"#";else{p=document.createElement("button");p.className="orionButton";d?c.hasImage()?(q(c,p,g),c.name&&p.setAttribute("aria-label",c.name)):(p.classList.add("commandButton"),p.classList.add("commandMissingImageButton"),p.appendChild(document.createTextNode(c.name))):(p.classList.add("commandButton"),g=document.createTextNode(c.name),p.appendChild(g));var l=h||c.callback;l&&(c.onClick=l,p.addEventListener("click",function(a){l.call(e.handler,
e)},!1))}"ul"===a.nodeName.toLowerCase()?(h=document.createElement("li"),a.appendChild(h),a=h):p.classList.add("commandMargins");a.appendChild(p);c.tooltip&&(p.commandTooltip=new f.Tooltip({node:p,text:c.tooltip,position:["above","below","right","left"]}));b&&(y[c.id]={keyBinding:b,command:c,invocation:e});return p},createCommandMenuItem:function(a,c,e,g,b,d){var h,p,l=a.dropdown;if(c.hrefCallback)p=n.createMenuItem(c.name,"a"),h=p.firstElementChild,b=c.hrefCallback.call(e.handler,e),b.then?b.then(function(a){h.href=
a}):h.href=b?b:"#",h.addEventListener("keydown",function(a){(a.keyCode===m.KEY.ENTER||a.keyCode===m.KEY.SPACE)&&h.click()},!1);else{p=n.createMenuItem(c.name);h=p.firstElementChild;var r=b||c.callback;r&&(c.onClick=r,h.addEventListener("click",function(a){l.close(!0);r.call(e.handler,e)},!1),h.addEventListener("keydown",function(a){if(a.keyCode===m.KEY.ENTER||a.keyCode===m.KEY.SPACE)a.preventDefault(),h.click()},!1))}c.tooltip&&(h.commandTooltip=new f.Tooltip({node:h,text:c.tooltip,position:["above",
"below","right","left"]}));d&&n.appendKeyBindingString(h,d);a.appendChild(p);g&&(y[c.id]={keyBinding:g,command:c,invocation:e});return h},executeBinding:a,setKeyBindingProvider:function(a){u=a},localKeyBindings:y,CommandsProxy:r,getKeyBindings:c,processKey:e,NO_IMAGE:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAAA1BMVEUAAACnej3aAAAAAXRSTlMAQObYZgAAAAtJREFUCNdjIBEAAAAwAAFletZ8AAAAAElFTkSuQmCC",_testMethodProcessKey:g}});
define("orion/explorers/navigationUtils",[],function(){function k(k,d,h,l){!m&&k&&(k.push({domNode:d}),d.tabIndex=-1,d.style.outline="none")}var m=-1!==navigator.userAgent.indexOf("iPad");return{addNavGrid:function(m,d,h){m&&(m=m.getGridNavHolder(d,!0))&&k(m,h)},generateNavGrid:k,removeNavGrid:function(m,d){if(m)for(var h=0;h<m.length;h++)if(m[h].domNode===d){m.splice(h,1);break}}}});
define("orion/PageUtil",[],function(){var k=/^http[s]?/i;return{hash:function(){var m=window.location.href.split("#")[1];return m?"#"+m:""},matchResourceParameters:function(m){m=m||window.location.toString();var k={resource:""},d=m.indexOf("#");if(-1!==d&&(m=m.substring(d+1),0!==m.length)){m=m.split(",");k.resource=decodeURIComponent(m[0]);for(d=1;d<m.length;d++){var h=/([^=]*)(=?)(.*)/.exec(m[d]),l=decodeURIComponent(h[1]||""),h=decodeURIComponent(h[3]||"");""!==l&&"resource"!==l&&(k[l]=h)}}return k},
validateURLScheme:function(m,n){var d=m;if(-1===m.indexOf("://")){var h=document.createElement("a");h.href=m;d=h.href}h=!1;if(h=n?n.some(function(h){return RegExp("^"+h+":","i").test(d)}):k.test(d))return m;console.log("Illegal URL Scheme: '"+m+"'");return""}}});
define("orion/uiUtils",["orion/webui/littlelib"],function(k){function m(d){var h="",l=-1!==navigator.platform.indexOf("Mac");l?(d.mod4&&(h+="\u2303"),d.mod3&&(h+="\u2325"),d.mod2&&(h+="\u21e7"),d.mod1&&(h+="\u2318")):(d.mod1&&(h+="Ctrl+"),d.mod2&&(h+="Shift+"),d.mod3&&(h+="Alt+"));if(d.alphaKey)return h+d.alphaKey;if("keypress"===d.type)return h+d.keyCode;for(var b in k.KEY)if(typeof("number"===k.KEY[b])&&k.KEY[b]===d.keyCode){if(l)switch(k.KEY[b]){case k.KEY.BKSPC:b="\u232b";break;case k.KEY.TAB:b=
"\u21e5";break;case k.KEY.ENTER:b="\u23ce";break;case k.KEY.ESCAPE:b="\u238b";break;case k.KEY.SPACE:b="\u2423";break;case k.KEY.PAGEUP:b="\u21de";break;case k.KEY.PAGEDOWN:b="\u21df";break;case k.KEY.END:b="\u21f2";break;case k.KEY.HOME:b="\u21f1";break;case k.KEY.DEL:b="\u2326"}switch(k.KEY[b]){case k.KEY.DOWN:b="\u2193";break;case k.KEY.UP:b="\u2191";break;case k.KEY.RIGHT:b="\u2192";break;case k.KEY.LEFT:b="\u2190"}return h+b}var f;switch(d.keyCode){case 59:f=d.mod2?":":";";break;case 61:f=d.mod2?
"+":"\x3d";break;case 188:f=d.mod2?"\x3c":",";break;case 190:f=d.mod2?"\x3e":".";break;case 191:f=d.mod2?"?":"/";break;case 192:f=d.mod2?"~":"`";break;case 219:f=d.mod2?"{":"[";break;case 220:f=d.mod2?"|":"\\";break;case 221:f=d.mod2?"}":"]";break;case 222:f=d.mod2?'"':"'"}return f?h+f:112<=d.keyCode&&123>=d.keyCode?h+"F"+(d.keyCode-111):h+String.fromCharCode(d.keyCode)}function n(d){var h=-1!==window.navigator.platform.indexOf("Mac");return h&&d.metaKey||!h&&d.ctrlKey}return{getUserKeyString:function(d){var h=
"";d=d.getKeys();for(var l=0;l<d.length;l++)0!==l&&(h+=" "),h+=m(d[l]);return h},getUserText:function(d){var h=d.id,l=d.refNode,b=d.hideRefNode,f=d.initialText,a=d.onComplete,g=d.onEditDestroy,c=d.selectTo,e=d.isInitialValid;d=d.insertAsChild;var p=!1,r=function(c){return function(d){if(!p){var r=k.node(h),q=r.value;r&&(c&&d.keyCode===k.KEY.ESCAPE?(b&&(l.style.display="inline"),p=!0,r.parentNode.removeChild(r),g&&g()):c&&d.keyCode!==k.KEY.ENTER||(0===q.length||!e&&q===f?b&&(l.style.display="inline"):
(a(q),b&&l.parentNode&&(l.style.display="inline")),p=!0,r.parentNode&&r.parentNode.removeChild(r),g&&g()))}}},q=document.createElement("input");q.id=h;q.value=f||"";d?l.appendChild(q):l.parentNode.insertBefore(q,l.nextSibling);q.classList.add("userEditBoxPrompt");b&&(l.style.display="none");q.addEventListener("keydown",r(!0),!1);q.addEventListener("blur",r(!1),!1);window.setTimeout(function(){q.focus();if(f){var a=k.node(h),e=c?f.indexOf(c):-1;0<e?a.createTextRange?(a=a.createTextRange(),a.collapse(!0),
a.moveStart("character",0),a.moveEnd("character",e),a.select()):a.setSelectionRange?a.setSelectionRange(0,e):void 0!==a.selectionStart&&(a.selectionStart=0,a.selectionEnd=e):a.select()}},0)},openInNewWindow:n,followLink:function(d,h){h&&n(h)?window.open(d):window.location=d},createButton:function(d,h){var l=document.createElement("button");l.className="orionButton commandButton commandMargins";l.addEventListener("click",function(b){h();k.stop(b)},!1);d&&l.appendChild(document.createTextNode(d));return l},
createDropdownButton:function(d,h,l){},isFormElement:function(d){switch(d.tagName.toLowerCase()){case "button":case "fieldset":case "form":case "input":case "keygen":case "label":case "legend":case "meter":case "optgroup":case "output":case "progress":case "select":case "textarea":return!0}return!1}}});
define("orion/commandRegistry","orion/commands orion/explorers/navigationUtils orion/PageUtil orion/uiUtils orion/webui/littlelib orion/webui/dropdown orion/webui/tooltip text!orion/webui/checkedmenuitem.html text!orion/webui/dropdowntriggerbutton.html text!orion/webui/submenutriggerbutton.html".split(" "),function(k,m,n,d,h,l,b,f,a,g){function c(a){this._commandList={};this._contributionsByScopeId={};this._activeBindings={};this._urlBindings={};this._pendingBindings={};this._init(a);this._parameterCollector=
null}function e(a,c){this.token=a;this.parameterName=c}function p(a,c,e){this.event=a;this.handler=c;this.capture=e||!1}function r(a,c,e,g,b,f){this.name=a;this.type=c;this.label=e;this.value=g;this.lines=b||1;this.eventListeners=Array.isArray(f)?f:f?[f]:[]}function q(a,c,e){this._storeParameters(a);this._hasOptionalParameters=c&&c.hasOptionalParameters;this._options=c;this.optionsRequested=!1;this.getParameters=e;this.clientCollect=c&&c.clientCollect}c.prototype={_init:function(a){this._selectionService=
a.selection;var c=this;k.setKeyBindingProvider(function(){return c._activeBindings})},processURL:function(a){for(var c in this._urlBindings)if(this._urlBindings[c]&&this._urlBindings[c].urlBinding&&this._urlBindings[c].command){var e=this._urlBindings[c].urlBinding.match(a);if(e){var g=this._urlBindings[c],b=g.command,f=g.invocation;if(f&&f.parameters&&b.callback){f.parameters.setValue(e.parameterName,e.parameterValue);var d=this;window.setTimeout(function(){d._invoke(f)},0);break}}}},findCommand:function(a){return this._commandList[a]},
runCommand:function(a,c,e,g){c?(a=this._commandList[a])&&(a.visibleWhen?a.visibleWhen(c):1)&&a.callback&&this._invoke(new k.CommandInvocation(e,c,null,a,this),g):(c=this._urlBindings[a])&&c.command&&c.command.callback&&this._invoke(c.invocation,g)},getSelectionService:function(){return this._selectionService},setParameterCollector:function(a){this._parameterCollector=a},openParameterCollector:function(a,c,e){this._parameterCollector&&(this._parameterCollector.close(),this._parameterCollector.open(a,
c,e))},confirm:function(a,c,e,g,b,f){var d=!1;if(this._parameterCollector&&!b){var h=this;this._parameterCollector.close();if(this._parameterCollector.open(a,function(a,b){var f=document.createElement("span");f.classList.add("parameterPrompt");f.textContent=c;a.appendChild(f);f=document.createElement("button");f.addEventListener("click",function(a){d=!0;h._parameterCollector.close()},!1);b.appendChild(f);f.appendChild(document.createTextNode(e));f.className="dismissButton";var p=document.createElement("button");
p.addEventListener("click",function(a){d=!1;h._parameterCollector.close()},!1);b.appendChild(p);p.appendChild(document.createTextNode(g));p.className="dismissButton";return f},function(){f(d)}))return}d=window.confirm(c);f(d)},closeParameterCollector:function(){this._parameterCollector&&this._parameterCollector.close()},collectsParameters:function(){return this._parameterCollector},_invoke:function(a,c){return this._collectAndInvoke(a.makeCopy(c),!1)},_collectAndInvoke:function(a,c){if(a)if(this._parameterCollector&&
a.parameters&&a.parameters.hasParameters()&&(c||a.parameters.shouldCollectParameters())){var e=!1;a.parameters.updateParameters(a);if(a.parameters.shouldCollectParameters()&&(e=this._parameterCollector.collectParameters(a),!e)){var g=new b.Tooltip({node:a.domNode,afterHiding:function(){this.destroy()},trigger:"click",position:["below","right","above","left"]}),e=g.contentContainer();e.classList.add("parameterPopup");var f=window.document.activeElement,d=this._parameterCollector.getFillFunction(a,
function(){f&&f.focus();g.destroy()})(e);g.show();window.setTimeout(function(){d.focus();d.select()},0);e=!0}e||a.command.callback.call(a.handler||window,a)}else a.command.callback.call(a.handler||window,a);else window.console.log("Client attempted to invoke command without an available (rendered) command invocation")},collectParameters:function(a){this._collectAndInvoke(a,!0)},showKeyBindings:function(a){function c(a){return function(){k.executeBinding(a)}}var e={},g,b,f=[],h;for(h in this._activeBindings)(b=
this._activeBindings[h])&&b.keyBinding&&b.command&&(b.command.name||b.command.tooltip)&&f.push(b);f.sort(function(a,c){return(a.command.name||a.command.tooltip).localeCompare(c.command.name||c.command.tooltip)});for(h=0;h<f.length;h++)b=f[h],b.keyBinding.scopeName?(e[b.keyBinding.scopeName]||(e[b.keyBinding.scopeName]=[]),e[b.keyBinding.scopeName].push(b)):(g=d.getUserKeyString(b.keyBinding),a.createItem(g,b.command.name||b.command.tooltip,c(b)));for(var p in e)e[p].length&&0<e[p].length&&(a.createHeader(p),
e[p].forEach(function(e){g=d.getUserKeyString(e.keyBinding);a.createItem(g,e.command.name||e.command.tooltip,c(e))}))},addCommand:function(a){this._commandList[a.id]=a;var c=this._pendingBindings[a.id];if(c){var e=this;c.forEach(function(c){e._addBinding(a,c.type,c.binding,c.bindingOnly)});delete this._pendingBindings[a.id]}},addCommandGroup:function(a,c,e,g,b,f,d,h,p,l){this._contributionsByScopeId[a]||(this._contributionsByScopeId[a]={});a=this._contributionsByScopeId[a];b&&(a=this._createEntryForPath(a,
b));a[c]?(g&&(a[c].title=g),e&&(a[c].position=e),d&&(a[c].imageClass=d),h&&(a[c].tooltip=h),p&&(a[c].selectionClass=p),!0===l?a[c].pretendDefaultActionId=!0:a[c].defaultActionId=l,a[c].emptyGroupMessage=f):(a[c]={title:g,position:e,emptyGroupMessage:f,imageClass:d,tooltip:h,selectionClass:p,defaultActionId:!0===l?null:l,pretendDefaultActionId:!0===l,children:{}},a.sortedContributions=null)},_createEntryForPath:function(a,c){c&&c.split("/").forEach(function(c){1<c.length&&(a[c]||(a[c]={position:0,
children:{}},a.sortedContributions=null),a=a[c].children)});return a},registerSelectionService:function(a,c){this._contributionsByScopeId[a]||(this._contributionsByScopeId[a]={});this._contributionsByScopeId[a].localSelectionService=c},registerCommandContribution:function(a,c,e,g,b,f,d){this._contributionsByScopeId[a]||(this._contributionsByScopeId[a]={});a=this._contributionsByScopeId[a];g&&(a=this._createEntryForPath(a,g));a[c]={position:e};f&&((e=this._commandList[c])?this._addBinding(e,"key",
f,b):this._addPendingBinding(c,"key",f,b));d&&((e=this._commandList[c])?this._addBinding(e,"url",d,b):this._addPendingBinding(c,"url",d,b));a.sortedContributions=null},unregisterCommandContribution:function(a,c,e){if(this._contributionsByScopeId[a]){delete this._commandList[c];delete this._activeBindings[c];delete this._urlBindings[c];delete this._pendingBindings[c];var g=this._contributionsByScopeId[a];e&&e.split("/").forEach(function(a){1<a.length&&g[a]&&(g=g[a].children)});delete g[c];g.sortedContributions=
null}},_addBinding:function(a,c,e,g){if(!a.id)throw Error("No command id: "+a);"key"===c?this._activeBindings[a.id]={command:a,keyBinding:e,bindingOnly:g}:"url"===c&&(this._urlBindings[a.id]={command:a,urlBinding:e,bindingOnly:g})},_addPendingBinding:function(a,c,e,g){this._pendingBindings[a]=this._pendingBindings[a]||[];this._pendingBindings[a].push({type:c,binding:e,bindingOnly:g})},_checkForTrailingSeparator:function(a,c,e){var g;if("tool"===c||"button"===c)if((g=0<a.childNodes.length?a.childNodes[a.childNodes.length-
1]:null)&&g.classList.contains("commandSeparator"))return e?(a.removeChild(g),!1):!0;if("menu"===c&&(a=h.$$array("li \x3e *",a),0<a.length&&a[a.length-1].classList.contains("dropdownSeparator")))if(g=a[a.length-1],e)g.parentNode.parentNode.removeChild(g.parentNode);else return!0;return!1},renderCommands:function(a,c,e,g,b,f,d){if("string"!==typeof a)throw"a scope id for rendering must be specified";c=h.node(c);if(!c)throw"no parent";var p=this._contributionsByScopeId[a];if(!e&&p){e=p.localSelectionService||
this._selectionService;var l=this;e&&e.getSelections(function(e){l.renderCommands(a,c,e,g,b,f)})}else p&&(this._render(p,c,e,g,b||"button",f,d),this._checkForTrailingSeparator(c,b,!0))},destroy:function(a){a=h.node(a);if(!a)throw"no parent";for(;a.hasChildNodes();){var c=a.firstChild;c.commandTooltip&&c.commandTooltip.destroy();c.emptyGroupTooltip&&c.emptyGroupTooltip.destroy();this.destroy(c);a.removeChild(c)}},_render:function(a,c,e,g,f,h,p){var l=a.sortedContributions;if(!l){var l=[],r=!1,q;for(q in a)if(Object.prototype.hasOwnProperty.call(a,
q)){var n=a[q];n&&"number"===typeof n.position&&(n.id=q,l.push(n),r=!0)}r&&(l.sort(function(a,c){return a.position-c.position}),a.sortedContributions=l)}var E=0,x=this;l.forEach(function(a){var l;a.imageClass||(a.imageClass=null);if(a.children&&0<Object.getOwnPropertyNames(a.children).length){var r=a.children;if("tool"===f||"button"===f)if(a.title){var q;a.defaultActionId&&((r=x._commandList[a.defaultActionId])&&(r.visibleWhen?r.visibleWhen(e):1)?(q=new k.CommandInvocation(g,e,h,r,x),q.domParent=
c):a.pretendDefaultActionId=!0);r=x._createDropdownMenu(c,a.title,null,null,a.imageClass,a.tooltip,a.selectionClass,null,q,a.pretendDefaultActionId);p&&m.generateNavGrid(p,r.menuButton);r&&(x._render(a.children,r.menu,e,g,"menu",h,p),x._checkForTrailingSeparator(r.menu,"menu",!0),0===r.menu.childNodes.length?a.emptyGroupMessage?r.menuButton.emptyGroupTooltip||(r.menuButton.emptyGroupTooltip=new b.Tooltip({node:r.menuButton,text:a.emptyGroupMessage,trigger:"click",position:["below","right","above",
"left"]})):(p&&m.removeNavGrid(p,r.menuButton),a=function(a){a&&a.parentNode&&a.parentNode.removeChild(a)},a(r.menu),a(r.menuButton),a(r.destroyButton)):r.menuButton.style.visibility="visible")}else{var n;0<c.childNodes.length&&!x._checkForTrailingSeparator(c,f)&&(n=x.generateSeparatorImage(c));x._render(r,c,e,g,f,h,p);0<c.childNodes.length&&c.childNodes[c.childNodes.length-1]!==n&&(n=x.generateSeparatorImage(c))}else if(a.title){if(a=x._createDropdownMenu(c,a.title,!0,null,null,a.imageClass))x._render(r,
a.menu,e,g,"menu",h,p),x._checkForTrailingSeparator(a.menu,"menu",!0),0===a.menu.childNodes.length&&a.destroyButton&&c.removeChild(a.destroyButton)}else 0<c.childNodes.length&&x._generateMenuSeparator(c),x._render(r,c,e,g,f,h,p),x._generateMenuSeparator(c)}else{var s=x._commandList[a.id],r=s?!0:!1;q=a=null;if(s){l=new k.CommandInvocation(g,e,h,s,x);l.domParent=c;n=!1;try{n=r&&(s.visibleWhen?s.visibleWhen(e):!0)}catch(z){throw console.log(z),z;}x._activeBindings[s.id]&&x._activeBindings[s.id].keyBinding&&
(a=x._activeBindings[s.id],a.invocation=n?l:null,a.bindingOnly&&(r=!1));x._urlBindings[s.id]&&x._urlBindings[s.id].urlBinding&&(q=x._urlBindings[s.id],q.invocation=n?l:null,q.bindingOnly&&(r=!1));r=r&&n}r&&(s.choiceCallback?("tool"===f||"button"===f?(a=c,r=!1,"ul"===c.nodeName.toLowerCase()&&(a=document.createElement("li"),c.appendChild(a))):(a=c,r=!0),x._createDropdownMenu(a,s.name,r,function(a){s.populateChoicesMenu(a,e,g,h,x)}.bind(s),s.imageClass,s.tooltip||s.title,s.selectionClass,s.positioningNode)):
(l.handler=l.handler||this,l.domParent=c,r=function(a){x._invoke(l)},"menu"===f?(q=null,a&&a.keyBinding&&(q=d.getUserKeyString(a.keyBinding)),a=k.createCommandMenuItem(c,s,l,null,r,q)):(a=f+s.id+E,a=k.createCommandItem(c,s,l,a,null,"tool"===f,r)),m.generateNavGrid(p,a),l.domNode=a,E++))}})},_createDropdownMenu:function(a,c,e,f,d,p,r,q,m,n){a=h.node(a);if(!a||!h.contains(document.body,a))return null;var F,E,x=a;if(e)p=document.createRange(),p.selectNode(a),p=p.createContextualFragment(g),h.processTextNodes(p,
{ButtonText:c}),a.appendChild(p),E=a.lastChild,d=E.lastChild,c=d.previousSibling,c.dropdown=new l.Dropdown({dropdown:d,populate:f,parentDropdown:a.dropdown}),d.dropdown=c.dropdown;else{"ul"===a.nodeName.toLowerCase()&&(x=document.createElement("li"),a.appendChild(x),E=x);a=null;d&&(a="dropdownButtonWithIcon",p=p||c);p=d?p||c:p;var C=k.createDropdownMenu(x,c,f,a,d,!1,r,q,m||n);F=C.dropdownArrow;c=C.menuButton;if(F){m&&(m.domNode=C.menuButton);var I=this;c.onclick=function(a){var c=h.bounds(F);a.clientX>=
c.left&&C.dropdown?C.dropdown.toggle(a):I._invoke(m)};C.dropdown&&(c.onkeydown=function(a){h.KEY.DOWN===a.keyCode&&(C.dropdown.toggle(a),h.stop(a))})}d=C.menu;var B;(f=m&&m.command&&(m.command.tooltip||m.command.name))?B=m.command.tooltip||m.command.name:f&&(B=p);B&&(c.commandTooltip=new b.Tooltip({node:c,text:B,position:["above","below","right","left"]}))}return{menuButton:c,menu:d,dropdown:c.dropdown,destroyButton:E,dropdownArrow:F}},_generateMenuSeparator:function(a){if(!this._checkForTrailingSeparator(a,
"menu")){var c=document.createElement("li");c.classList.add("dropdownSeparator");var e=document.createElement("span");e.classList.add("dropdownSeparator");c.appendChild(e);a.appendChild(c)}},generateSeparatorImage:function(a){var c;c="ul"===a.nodeName.toLowerCase()?document.createElement("li"):document.createElement("span");a.appendChild(c);c.classList.add("core-sprite-sep");c.classList.add("imageSprite");c.classList.add("commandSeparator");return c}};c.prototype.constructor=c;e.prototype={match:function(a){a=
n.matchResourceParameters(a);return"undefined"!==typeof a[this.token]?(this.parameterValue=a[this.token],this):null}};e.prototype.constructor=e;p.prototype.constructor=p;r.prototype={optionsRequested:function(){return this.optionsRequested}};r.prototype.constructor=r;q.prototype={_storeParameters:function(a){this.parameterTable=null;if(a){var c=this.parameterTable={};a.forEach(function(a){c[a.name]=a})}},updateParameters:function(a){"function"===typeof this.getParameters&&this._storeParameters(this.getParameters(a))},
hasParameters:function(){return null!==this.parameterTable},shouldCollectParameters:function(){return!this.clientCollect&&this.hasParameters()},parameterNamed:function(a){return this.parameterTable[a]},valueFor:function(a){return(a=this.parameterTable[a])?a.value:null},setValue:function(a,c){var e=this.parameterTable[a];e&&(e.value=c)},forEach:function(a){for(var c in this.parameterTable)this.parameterTable[c].type&&this.parameterTable[c].name&&a(this.parameterTable[c])},makeCopy:function(){var a=
[];this.forEach(function(c){c=new r(c.name,c.type,c.label,c.value,c.lines,c.eventListeners);a.push(c)});var c=new q(a,this._options,this.getParameters);c.clientCollect=this.clientCollect;return c},hasOptionalParameters:function(){return this._hasOptionalParameters}};q.prototype.constructor=q;return{CommandRegistry:c,URLBinding:e,ParametersDescription:q,CommandParameter:r,CommandEventListener:p}});
define("orion/navigate/nls/root/messages",{"Click one of the tasks below to create an Orion folder.  You can upload, import, or generate files.":"Click one of the tasks below to create an Orion folder.  You can upload, import, or generate files.","Toggle Left Pane":"Toggle Left Pane","Open or close the left pane":"Open or close the left pane",Navigator:"Navigator","Strings Xtrnalizr":"Strings Xtrnalizr","Externalize Strings from JavaScript files in this folder":"Externalize strings from JavaScript files in this folder.",
"Choose a Folder":"Choose a Folder","Copy of ${0}":"Copy of ${0}","Enter a new name for '${0}'":"Enter a new name for '${0}'","Choose folder...":"Choose folder...",Rename:"Rename","Rename the selected files or folders":"Rename the selected files or folders","Compare with each other":"Compare with each other","Compare the selected 2 files with each other":"Compare the selected 2 files with each other","Compare with...":"Compare with...","Compare the selected folder with a specified folder":"Compare the selected folder with a specified folder",
Delete:"Delete","Unknown item":"Unknown item","Are you sure you want to delete these ${0} items?":"Are you sure you want to delete these ${0} items?","Are you sure you want to delete '${0}'?":"Are you sure you want to delete '${0}'?","Export as zip":"Zip","Create a zip file of the folder contents and download it":"Create a zip file of the folder contents and download it","New File":"File","Create a new file":"Create a new file","Name:":"Name:","New Folder":"Folder","Folder name:":"Folder name:","Create a new folder":"Create a new folder",
"Creating folder":"Creating folder",Folder:"Folder","Create an empty folder":"Create an empty folder","Create an empty folder on the Orion server.  You can import, upload, or create content in the editor.":"Create an empty folder on the Orion server.  You can import, upload, or create content in the editor.","Sample HTML5 Site":"Sample HTML5 Site","Generate a sample":"Generate a sample",'Generate an HTML5 "Hello World" website, including JavaScript, HTML, and CSS files.':'Generate an HTML5 "Hello World" website, including JavaScript, HTML, and CSS files.',
"Creating a folder for ${0}":"Creating a folder for ${0}","SFTP Import":"SFTP Import","Import content from SFTP":"Import content from SFTP","Import content from an SFTP location into an Orion folder.  You will be prompted for the SFTP location and credentials.":"Import content from an SFTP location into an Orion folder.  You will be prompted for the SFTP location and credentials.","Imported Content":"Imported Content","Upload a Zip":"Upload a Zip","Upload content from a local zip file":"Upload content from a local zip file",
"Upload content from a local zip file into an Orion folder.  You will be prompted for the local zip file.":"Upload content from a local zip file into an Orion folder.  You will be prompted for the local zip file.","Uploaded Content":"Uploaded Content","Creating an upload folder for ":"Creating an upload folder for ","Clone Git Repository":"Clone Git Repository","Clone a git repository":"Clone a git repository","Go to the Orion repositories page to provide a git repository URL.  Once the repository is created, it will appear in the Navigator.":"Go to the Orion repositories page to provide a git repository URL.  Once the repository is created, it will appear in the Navigator.",
"Link to Server":"Link to Server","Link to existing content on the server":"Link to existing content on the server","Create a folder that links to an existing folder on the server.":"Create a folder that links to an existing folder on the server.","Server path:":"Server path:","The name and server location were not specified.":"The name and server location were not specified.","Go Up":"Go Up","Move up to the parent folder":"Move up to the parent folder","Go Into":"Go Into","Move into the selected folder":"Move into the selected folder",
"Import local file...":"File System","Copy files and folders from your local file system":"Copy files and folders from your local file system","SFTP from...":"SFTP","Copy files and folders from a specified SFTP connection":"Copy files and folders from a specified SFTP connection","Importing from ${0}":"Importing from ${0}","SFTP to...":"SFTP","Copy files and folders to a specified SFTP location":"Copy files and folders to a specified SFTP location",Exporting:"Exporting to ${0}","Pasting ${0}":"Pasting ${0}",
"Copy to":"Copy to","Move to":"Move to","Copying ${0}":"Copying ${0}","Moving ${0}":"Moving ${0}","Renaming ${0}":"Renaming ${0}","Deleting ${0}":"Deleting ${0}","Creating ${0}":"Creating ${0}","Linking to ${0}":"Linking to ${0}","Move files and folders to a new location":"Move files and folders to a new location",Cut:"Cut",Copy:"Copy","Fetching children of ":"Fetching children of ",Paste:"Paste","Cannot paste into the Workspace root":"Cannot paste into the Workspace root","Open With":"Open With",
"Loading ":"Loading ",New:"New",File:"File",Actions:"Actions","Orion Content":"Orion Content"," is not supported in this file system":" is not supported in this file system","Create new content":"Create new content","Import from HTTP...":"HTTP","File URL:":"File URL:","Copy a file from a URL and optionally unzip it":"Copy a file from a URL and optionally unzip it","Unzip *.zip files:":"Unzip *.zip files:","Extracted from:":"Extracted from:","Did not drop ${0}.  Folder drop is not supported in this browser.":"Did not drop ${0}.  Folder drop is not supported in this browser.",
"You cannot copy files directly into the workspace.  Create a folder first.":"You cannot copy files directly into the workspace.  Create a folder first.","Unzip ${0}?":"Unzip ${0}?",NoFile:"Use the ${0} menu to create new files and folders. Click a file to start coding."});define("orion/navigate/nls/messages",["orion/i18n!orion/navigate/nls/messages","orion/navigate/nls/root/messages"],function(k,m){var n={root:m};Object.keys(k).forEach(function(d){"undefined"===typeof n[d]&&(n[d]=k[d])});return n});
define("orion/i18nUtil",["require","orion/Deferred"],function(k,m){function n(d){if(d=localStorage.getItem("orion/messageBundle/"+d))if(d=JSON.parse(d),d._expires&&d._expires>(new Date).getTime())return delete d._expires,d;return null}var d={};return{getMessageBundle:function(h){function l(a){a?k(["i18n!"+h],function(a){if(a){var c=h;a._expires=(new Date).getTime()+9E5;localStorage.setItem("orion/messageBundle/"+c,JSON.stringify(a));delete a._expires}f.resolve(a)}):b(Error(h))}function b(a){f.reject(a)}
if(d[h])return d[h];var f=new m;d[h]=f;var a=n(h);if(a)return f.resolve(a),f;try{k([h],l,b)}catch(g){k(["orion/i18n!"+h],l,b)}return f},formatMessage:function(d){var l=arguments;return d.replace(/\$\{([^\}]+)\}/g,function(b,f){return l[(f<<0)+1]})}}});
define("orion/fileClient",["i18n!orion/navigate/nls/messages","orion/Deferred","orion/i18nUtil"],function(k,m,n){function d(b,f,a){if(!b[f])throw f+k[" is not supported in this file system"];return b[f].apply(b,a)}function h(b,f,a,g){if(!b.readBlob)throw k["source file service does not support binary read"];if(!a.writeBlob)throw k["target file service does not support binary write"];if("/"!==f[f.length-1])return d(b,"readBlob",[f]).then(function(c){return d(a,"writeBlob",[g,c])});var c=g.substring(0,
g.length-1),e=decodeURIComponent(c.substring(c.lastIndexOf("/")+1)),c=c.substring(0,c.lastIndexOf("/")+1);return d(a,"createFolder",[c,e]).then(function(){},function(){}).then(function(){return d(b,"fetchChildren",[f]).then(function(c){for(var e=[],f=0;f<c.length;++f){var d=c[f].Location,l=d;c[f].Directory&&(l=d.substring(0,d.length-1));l=decodeURIComponent(l.substring(l.lastIndexOf("/")+1));l=g+encodeURIComponent(l);c[f].Directory&&(l+="/");e[f]=h(b,d,a,l)}return m.all(e)})})}function l(b,f){function a(a){var c=
new m;c.reject(k["No Matching FileService for location:"]+a);return c}var g=b.getServiceReferences("orion.core.file"),c=g;if(f)for(var c=[],e=0;e<g.length;++e)f(g[e])&&c.push(g[e]);for(var d=[],h=[],l=[],s=[],w={fetchChildren:function(){var a=new m;a.resolve(s);return a},createWorkspace:function(){var a=new m;a.reject(k["no file service"]);return a},loadWorkspaces:function(){var a=new m;a.reject(k["no file service"]);return a},loadWorkspace:function(a){var c=new m;window.setTimeout(function(){c.resolve({Directory:!0,
Length:0,LocalTimeStamp:0,Name:k["File Servers"],Location:"/",Children:s,ChildrenLocation:"/"})},100);return c},search:a,createProject:a,createFolder:a,createFile:a,deleteFile:a,moveFile:a,copyFile:a,read:a,write:a},g=0;g<c.length;++g)s[g]={Directory:!0,Length:0,LocalTimeStamp:0,Location:c[g].getProperty("top"),ChildrenLocation:c[g].getProperty("top"),Name:c[g].getProperty("Name")},e=c[g].getProperty("pattern")||c[g].getProperty("top").replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1"),"^"!==e[0]&&(e=
"^"+e),d[g]=RegExp(e),h[g]=b.getService(c[g]),l[g]=c[g].getProperty("Name"),c[g].getProperty("NameKey")&&c[g].getProperty("nls")&&n.getMessageBundle(c[g].getProperty("nls")).then(function(a,e){s[a].Name=e[c[a].getProperty("NameKey")];l[a]=e[c[a].getProperty("NameKey")]}.bind(this,g));this._getServiceIndex=function(a){if("/"===a)return-1;if(!a||a.length&&0===a.length)return h[0]?0:-1;for(var c=0;c<d.length;++c)if(d[c].test(a))return c;throw k["No Matching FileService for location:"]+a;};this._getService=
function(a){a=this._getServiceIndex(a);return-1===a?w:h[a]};this._getServiceName=function(a){a=this._getServiceIndex(a);return-1===a?w.Name:l[a]};this._getServiceRootURL=function(a){a=this._getServiceIndex(a);return-1===a?w.Location:s[a].Location}}l.prototype={getService:function(b){return this._getService(b)},fileServiceName:function(b){return this._getServiceName(b)},fileServiceRootURL:function(b){return this._getServiceRootURL(b)},fetchChildren:function(b){return d(this._getService(b),"fetchChildren",
arguments)},createWorkspace:function(b){return d(this._getService(),"createWorkspace",arguments)},loadWorkspaces:function(){return d(this._getService(),"loadWorkspaces",arguments)},loadWorkspace:function(b){return d(this._getService(b),"loadWorkspace",arguments)},createProject:function(b,f,a,g){return d(this._getService(b),"createProject",arguments)},createFolder:function(b,f){return d(this._getService(b),"createFolder",arguments)},createFile:function(b,f){return d(this._getService(b),"createFile",
arguments)},deleteFile:function(b){return d(this._getService(b),"deleteFile",arguments)},moveFile:function(b,f,a){var g=this._getService(b),c=this._getService(f);if(g===c)return d(g,"moveFile",arguments);var e="/"===b[b.length-1],p=f;"/"!==p[p.length-1]&&(p+="/");if(a)p+=encodeURIComponent(a);else{var l=b;e&&(l=l.substring(0,l.length-1));p+=l.substring(l.lastIndexOf("/")+1)}e&&"/"!==p[p.length-1]&&(p+="/");return h(g,b,c,p).then(function(){return d(g,"deleteFile",[b])})},copyFile:function(b,f,a){var g=
this._getService(b),c=this._getService(f);if(g===c)return d(g,"copyFile",arguments);var e="/"===b[b.length-1],p=f;"/"!==p[p.length-1]&&(p+="/");if(a)p+=encodeURIComponent(a);else{var l=b;e&&(l=l.substring(0,l.length-1));p+=l.substring(l.lastIndexOf("/")+1)}e&&"/"!==p[p.length-1]&&(p+="/");return h(g,b,c,p)},read:function(b,f){return d(this._getService(b),"read",arguments)},readBlob:function(b){return d(this._getService(b),"readBlob",arguments)},write:function(b,f,a){return d(this._getService(b),"write",
arguments)},remoteImport:function(b,f){return d(this._getService(b),"remoteImport",arguments)},remoteExport:function(b,f){return d(this._getService(b),"remoteExport",arguments)},search:function(b){return d(this._getService(b.resource),"search",arguments)}};l.prototype.constructor=l;return{FileClient:l}});
define("orion/search/nls/root/messages",{"Find:":"Find:","Find With":"Find With","ReplaceWith:":"ReplaceWith:","Replace With":"Replace With","Show all":"Show all","Wrap search":"Wrap search","Incremental search":"Incremental search","Whole Word":"Whole Word","Regular expression":"Regular expression","Find after replace":"Find after replace",Options:"Options","Find next match":"Find next match","Find previous match":"Find previous match",Next:"Next",Previous:"Previous",Replace:"Replace","Replace All":"Replace All",
"Search ${0}":"Search ${0}","Type a keyword or wild card to search in ":"Type a keyword or wild card to search in ","Search failed.":"Search failed.","No matches found for ${0}":"No matches found for ${0}","Searching...":"Searching...","Resource has been changed by others.":"Resource has been changed by others.","Failed to write file.":"Failed to write file.",Results:"Results","Files ${0} of ${1} matching ${2}":"Files ${0} of ${1} matching ${2}","Replace ${0} with ${1} for files ${2} of ${3}":"Replace ${0} with ${1} for files ${2} of ${3}",
Location:"Location","Click to compare":"Click to compare",'Search again in this folder with "${0}"':'Search again in this folder with "${0}"',"Files replaced":"Files replaced",Status:"Status","${0} out of ${1}  matches replaced.":"${0} out of ${1}  matches replaced.","Replace all matches with...":"Replace all matches with...","Apply Changes":"Apply Changes","Replace all selected matches":"Replace all selected matches","Hide Compare":"Hide Compare","Hide compare view of changes":"Hide compare view of changes",
"Show Compare":"Show Compare","Show compare view of changes":"Show compare view of changes","Show All":"Show All","Show all the results in one page":"Show all the results in one page","\x3c Previous Page":"\x3c Previous Page","Show previous page of search result":"Show previous page of search result","Next Page \x3e":"Next Page \x3e","Show next page of search result":"Show next page of search result","Next result":"Next result","Previous result":"Previous result","Expand all results":"Expand all results",
"Collapse all results":"Collapse all results","Writing files...":"Writing files...","Preparing preview...":"Preparing preview...","Replaced File (${0})":"Replaced File (${0})","Original File (${0})":"Original File (${0})","Sort by Name":"Sort by Name","Compare changes":"Compare changes","Search Results":"Search Results","Replace All Matches":"Replace All Matches","No matches":"No matches",Rename:"Rename","My Saved Searches":"My Saved Searches","Save frequently used searches by choosing ${0} shown above.":"Save frequently used searches by choosing ${0} shown above.",
"Save frequently used searches by clicking on the ${0} button above.":"Save frequently used searches by clicking on the ${0} button above.","Files that contain:":"Files that contain:",Search:"Search","All types":"All types","File type":"File type","All ${0} files":"All ${0} files","${0} is already saved":"${0} is already saved","Type a search term":"Type a search term","Type a replace term":"Type a replace term","Case sensitive":"Case sensitive","Sort by":"Sort by","File name":"File name","Path name":"Path name",
Save:"Save","Type a name for the search":"Type a name for the search","Save the current search":"Save the current search","Type filter text":"Type filter text","Scope Search":"Scope Search","Open in Search page for this directory":"Open the Search page for this folder.","${0}. Try your search again.":"${0}. Try your search again.","Click or use delete key to delete the search term":"Click or use delete key to delete the search term","${0} matches":"${0} matches","Regular expression is off. You can click here or use options to turn it on for replacement - e.g. when the option is on you can replace \x3ctd([\\s\\S]*?)\x3c/td\x3e with \x3cspan$1\x3c/span\x3e.":"Regular expression is off. You can click here or use options to turn it on for replacement - e.g. when the option is on you can replace \x3ctd([\\s\\S]*?)\x3c/td\x3e with \x3cspan$1\x3c/span\x3e.",
"Regular expression is on. You can click here or use options to turn it off - e.g. when the option is on you can replace \x3ctd([\\s\\S]*?)\x3c/td\x3e with \x3cspan$1\x3c/span\x3e.":"Regular expression is on. You can click here or use options to turn it off - e.g. when the option is on you can replace \x3ctd([\\s\\S]*?)\x3c/td\x3e with \x3cspan$1\x3c/span\x3e.",root:"root",Scope:"Scope"});
define("orion/search/nls/messages",["orion/i18n!orion/search/nls/messages","orion/search/nls/root/messages"],function(k,m){var n={root:m};Object.keys(k).forEach(function(d){"undefined"===typeof n[d]&&(n[d]=k[d])});return n});
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.":"2014-04-02_22-01-33","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 (* \x3d any string, ? \x3d any character)",
"To view the browser's context menu, trigger the context menu again.":"To view the browser's context menu, trigger the context menu again.",Edit:"Edit",CentralNavTooltip:"Toggle Navigation Menu"});define("orion/nls/messages",["orion/i18n!orion/nls/messages","orion/nls/root/messages"],function(k,m){var n={root:m};Object.keys(k).forEach(function(d){"undefined"===typeof n[d]&&(n[d]=k[d])});return n});
define("orion/regex",[],function(){return{escape:function(k){return k.replace(/([\\$\^*\/+?\.\(\)|{}\[\]])/g,"\\$\x26")},parse:function(k){return(k=/^\s*\/(.+)\/([gim]{0,3})\s*$/.exec(k))?{pattern:k[1],flags:k[2]}:null}}});
define("orion/URITemplate",[],function(){function k(a){this._text=a}function m(a){return a.replace("%25","%")}function n(a,e){if("U"===e)return encodeURIComponent(a).replace(/[!'()*]/g,function(a){return"%"+a.charCodeAt(0).toString(16).toUpperCase()});if("U+R"===e)return encodeURI(a).replace(/%5B/g,"[").replace(/%5D/g,"]").replace(g,m);if("U+R-,"===e)return encodeURI(a).replace(/%5B/g,"[").replace(/%5D/g,"]").replace(/,/g,"%2C");throw Error("Unknown allowed character set: "+e);}function d(a,e,g){for(var b=
[],f=0;f<a.length;f++)"undefined"!==typeof a[f]&&b.push(n(a[f],e));return b.join(g)}function h(a,e,g,b){for(var f=Object.keys(a),d=[],h=0;h<f.length;h++)"undefined"!==typeof a[f[h]]&&d.push(n(f[h],e)+g+n(a[f[h]],e));return d.join(b)}function l(c){if(0===c.length)throw Error("Invalid Expression: 0 length expression");(this._operator=f[c[0]])?c=c.substring(1):this._operator=f.NUL;for(var e=[],g=c.split(","),b=0;b<g.length;b++){var d=g[b].match(a);if(null===d)throw Error("Bad VarSpec: "+c);e.push({name:d[1],
explode:!!d[2],prefix:d[3]?parseInt(d[3],10):-1})}this._varSpecList=e}function b(a){for(var e=[],g=0,b=a.indexOf("{",g);-1!==b;){e.push(new k(a.substring(g,b)));g=a.indexOf("}",b+1);if(-1===g)throw Error("Invalid template: "+a);e.push(new l(a.substring(b+1,g)));g+=1;b=a.indexOf("{",g)}e.push(new k(a.substring(g)));this._templateComponents=e}var f={NUL:{first:"",sep:",",named:!1,ifemp:"",allow:"U"},"+":{first:"",sep:",",named:!1,ifemp:"",allow:"U+R"},".":{first:".",sep:",",named:!1,ifemp:"",allow:"U"},
"/":{first:"/",sep:"/",named:!1,ifemp:"",allow:"U"},";":{first:";",sep:";",named:!0,ifemp:"",allow:"U"},"?":{first:"?",sep:"\x26",named:!0,ifemp:"\x3d",allow:"U"},"\x26":{first:"\x26",sep:"\x26",named:!0,ifemp:"\x3d",allow:"U"},"#":{first:"#",sep:",",named:!1,ifemp:"",allow:"U+R"},",":{first:"",sep:",",named:!1,ifemp:"",allow:"U+R-,"}},a=/^((?:(?:[a-zA-Z0-9_])|(?:%[0-9A-F][0-9A-F]))(?:(?:[a-zA-Z0-9_.])|(?:%[0-9A-F][0-9A-F]))*)(?:(\*)|:([0-9]+))?$/,g=/%25[0-9A-F][0-9A-F]/g;k.prototype={expand:function(a){return encodeURI(this._text)}};
l.prototype={expand:function(a){for(var e=[],g=0;g<this._varSpecList.length;g++){var b=this._varSpecList[g],f=b.name,l=a[f],m=typeof l;if("undefined"!==m&&null!==l){var k=0===e.length?this._operator.first:this._operator.sep;if("string"===m)this._operator.named&&(k+=n(f,"U+R"),k+=0===l.length?this._operator.ifemp:"\x3d"),-1!==b.prefix&&b.prefix<l.length&&(l=l.substring(0,b.prefix)),k+=n(l,this._operator.allow);else if(Array.isArray(l)){if(0===l.length)continue;b.explode?k+=d(l,this._operator.allow,
this._operator.sep):(b=d(l,this._operator.allow,","),this._operator.named&&(k+=n(f,"U+R"),k+=0===b.length?this._operator.ifemp:"\x3d"),k+=b)}else if("object"===m){if(0===Object.keys(l).length)continue;b.explode?k+=h(l,this._operator.allow,"\x3d",this._operator.sep):(b=h(l,this._operator.allow,",",","),this._operator.named&&(k+=n(f,"U+R"),k+=0===b.length?this._operator.ifemp:"\x3d"),k+=b)}else throw Error("bad param type: "+f+" : "+m);e.push(k)}}return e.join("")}};b.prototype={expand:function(a){for(var e=
[],g=0;g<this._templateComponents.length;g++)e.push(this._templateComponents[g].expand(a));return e.join("")}};return b});
define("orion/searchUtils","i18n!orion/nls/messages require orion/regex orion/commandRegistry orion/PageUtil orion/URITemplate".split(" "),function(k,m,n,d,h,l){function b(a,g,c){var e="";c&&(e="^");if(e=n.parse("/"+e+a.searchStr+"/"))c=e.pattern,e=e.flags,-1===e.indexOf("i")&&!g.caseSensitive&&(e+="i"),a.regExp={pattern:c,flags:e},a.wildCard=!0}var f={ALL_FILE_TYPE:"*.*",doSearch:function(a,g,c,e){if(a){var b=!0;"*"===c&&(c="");""===c&&(b=e&&e.type!==f.ALL_FILE_TYPE);b&&(""!==c&&f.addRecentSearch(g,
c,e?e.regEx:!1),a=a.createSearchParams(c,!1,!1,e),a=f.generateSearchHref(a),window.location=a)}else window.alert(k["Can't search: no search service is available"])},generateSearchHelper:function(a,g){var c=a.keyword,e=c,d={};a.fileType&&a.fileType!==f.ALL_FILE_TYPE&&""===c&&(e="*."+a.fileType);if(a.regEx)d.searchStr=c,b(d,a,g);else{var h=-1<c.indexOf("*"),l=-1<c.indexOf("?");h&&(c=c.split("*").join(".*"));l&&(c=c.split("?").join("."));!h&&!l&&!a.nameSearch?(d.searchStr=a.caseSensitive?c.split("\\").join(""):
c.split("\\").join("").toLowerCase(),d.wildCard=!1):(d.searchStr=a.caseSensitive?c:c.toLowerCase(),b(d,a,g),d.wildCard=!0)}d.searchStrLength=d.searchStr.length;return{params:a,inFileQuery:d,displayedSearchTerm:e}},convertSearchParams:function(a){void 0!==a.rows&&(a.rows=parseInt(a.rows,10));void 0!==a.start&&(a.start=parseInt(a.start,10));"string"===typeof a.regEx&&(a.regEx="true"===a.regEx.toLowerCase());"string"===typeof a.caseSensitive&&(a.caseSensitive="true"===a.caseSensitive.toLowerCase());
"string"===typeof a.nameSearch&&(a.nameSearch="true"===a.nameSearch.toLowerCase())},copySearchParams:function(a,g){var c={},e;for(e in a)if(void 0!==a[e]&&null!==a[e]&&(g||"replace"!==e))c[e]=a[e];return c},generateSearchHref:function(a){var g=m.toUrl("search/search.html");a=f.copySearchParams(a,!0);var c=a.resource;a.resource=void 0;return"undefined"!==typeof a.keyword?(new l(g+"#{,resource,params*}")).expand({resource:c,params:a}):(new l(g+"#{,resource}")).expand({resource:c})},generateFindURLBinding:function(a,
g,c,e,b){a={find:g.searchStr,regEx:g.wildCard?!0:void 0,caseSensitive:a.caseSensitive?!0:void 0,replaceWith:"string"===typeof e?e:void 0,atLine:"number"===typeof c?c:void 0};return b?a:","+(new l("{,params*}")).expand({params:a})},convertFindURLBinding:function(a){"string"===typeof a.regEx&&(a.regEx="true"===a.regEx.toLowerCase());"string"===typeof a.caseSensitive&&(a.caseSensitive="true"===a.caseSensitive.toLowerCase());"string"===typeof a.atLine&&(a.atLine=parseInt(a.atLine,10))},replaceRegEx:function(a,
g,c){return a.replace(RegExp(g.pattern,g.flags),c)},replaceStringLiteral:function(a,g,c){g=n.parse("/"+g+"/gim");return f.replaceRegEx(a,g,c)},searchOnelineLiteral:function(a,g,c){var e;e=0;for(var b=!1,f=[];!(e=g.indexOf(a.searchStr,e),0>e);){f.push({startIndex:e,length:a.searchStrLength});b=!0;if(c)break;e+=a.searchStrLength}return b?f:null},findRegExp:function(a,g,c,e){if(!g)return null;c=c||"";c+=(-1===c.indexOf("g")?"g":"")+(-1===c.indexOf("m")?"m":"");var b=null;return(b=RegExp(g,c).exec(a.substring(e)))&&
{startIndex:b.index+e,length:b[0].length}},searchOnelineRegEx:function(a,g,c){for(var e=0,b=!1,d=[];;)if(e=f.findRegExp(g,a.regExp.pattern,a.regExp.flags,e)){d.push(e);b=!0;if(c)break;e=e.startIndex+e.length}else break;return b?d:null},generateNewContents:function(a,g,c,e,b,d){if(e&&g){a||(c.contents=[]);for(var h=0;h<g.length;h++){for(var l=g[h],k=!1,m=!1,n=[],t,v=0,A=0;A<e.children.length;A++)if(e.children[A].lineNumber-1===h){v=A;for(k=0;k<e.children[A].matches.length;k++)!1!==e.children[A+k].checked&&
n.push(k);m=0<n.length;t=e.children[A].matches;k=!0;break}if(k){if(m){n=f.replaceCheckedMatches(l,b,t,n,d);l=n.replacedStr;for(k=0;k<e.children[v].matches.length;k++)e.children[v+k].newMatches=n.newMatches}else for(k=0;k<e.children[v].matches.length;k++)e.children[v+k].newMatches=e.children[v+k].matches;a?c.contents[h]=l:c.contents.push(l)}else a||c.contents.push(l)}}},generateMatchContext:function(a,g,c){var e=[],b=2*a+1,f;g.length<=b?(f=0,a=g.length-1):(f=c-a,0>f?(f=0,a=f+b-1):(a=c+a,a>g.length-
1&&(a=g.length-1,f=a-b+1)));for(b=f;b<=a;b++)e.push({context:g[b],current:b===c});return e},splitFile:function(a){for(var g=0,c=0,e=0,b=0,f=[];;){-1!==g&&g<=e&&(g=a.indexOf("\r",e));-1!==c&&c<=e&&(c=a.indexOf("\n",e));if(-1===c&&-1===g){f.push(a.substring(b));break}var d=1;-1!==g&&-1!==c?g+1===c?(d=2,e=c+1):e=(g<c?g:c)+1:e=-1!==g?g+1:c+1;f.push(a.substring(b,e-d));b=e}return f},searchWithinFile:function(a,g,c,e,b,d){c=f.splitFile(c);b&&(g.contents=c);if(g){g.children=[];for(var h=e=0;h<c.length;h++){var l=
c[h];if(l&&0<l.length){var k=d?l:l.toLowerCase();if(k=a.wildCard?f.searchOnelineRegEx(a,k):f.searchOnelineLiteral(a,k)){var m,n=h+1;if(b)for(var t=0;t<k.length;t++)m=t+1,m={parent:g,checked:g.checked,type:"detail",matches:k,lineNumber:n,matchNumber:m,name:l,location:g.location+"-"+n+"-"+m},g.children.push(m);else m={parent:g,context:f.generateMatchContext(2,c,h),checked:g.checked,type:"detail",matches:k,lineNumber:n,name:l,location:g.location+"-"+n},g.children.push(m);e+=k.length}}}g.totalMatches=
e}},replaceCheckedMatches:function(a,g,c,e,b){for(var f=0,d="",h=[],l=0;l<c.length;l++){f!==c[l].startIndex&&(d+=a.substring(f,c[l].startIndex));c[l].length&&(b=c[l].length);for(var f=!1,k=0;k<e.length;k++)if(e[k]===l){f=!0;break}f?(h.push({startIndex:d.length,length:g.length}),d+=g):(h.push({startIndex:d.length,length:b}),d+=a.substring(c[l].startIndex,c[l].startIndex+b));f=c[l].startIndex+b}f<a.length&&(d+=a.substring(f));return{replacedStr:d,newMatches:h}},fullPathNameByMeta:function(a){var g=
a.length,c="";if(0<g)for(g-=1;-1<g;g--)c=c+(""===c?"":"/")+a[g].Name;return c},path2FolderName:function(a,g,c){return a.substring(0,a.length-g.length-(c?0:1))},_storeRecentSearch:function(a,g,c,e){a.getService("orion.core.preference").getPreferences("/window/favorites").then(function(a){a.put("recentSearch",g);c&&window.setTimeout(function(){c.dispatchEvent({type:"inputDataListChanged",deleting:e})}.bind(this),20)})},addRecentSearch:function(a,g,c){"string"===typeof g&&g&&a.getService("orion.core.preference").getPreferences("/window/favorites").then(function(e){var b;
e=e.get("recentSearch");"string"===typeof e&&(e=JSON.parse(e));if(e){for(b in e)if(e[b].name===g)return;20<=e.length&&e.splice(19,e.length-20+1)}else e=[];e.splice(0,0,{name:g,regEx:c});f._storeRecentSearch(a,e)})},removeRecentSearch:function(a,g,c){"string"===typeof g&&g&&a.getService("orion.core.preference").getPreferences("/window/favorites").then(function(e){var b;e=e.get("recentSearch");"string"===typeof e&&(e=JSON.parse(e));if(e)for(b in e)if(e[b].name===g){e.splice(b,1);f._storeRecentSearch(a,
e,c,!0);break}})},getSearches:function(a,g,c){a.getService("orion.core.preference").getPreferences("/window/favorites").then(function(a){a=a.get(g);"string"===typeof a&&(a=JSON.parse(a));a&&c&&c(a)})},getMixedSearches:function(a,g,c,e){a.getService("orion.core.preference").getPreferences("/window/favorites").then(function(a){var b=a.get("recentSearch");"string"===typeof b&&(b=JSON.parse(b));g&&(a=a.get("search"),"string"===typeof a&&(a=JSON.parse(a)),a&&a.forEach(function(a){if(c){var e=f.parseQueryStr(a.query);
b.some(function(a){return e.searchStrTitle===a.name})||b.push({name:e.searchStrTitle,label:a.name})}else b.push({name:null,label:a.name,value:a.query})}));b&&e&&e(b)})},getOpenSearchPref:function(a,g){a.getService("orion.core.preference").getPreferences("/cm/configurations").then(function(a){a=a.get("nav.config");g(a&&"undefined"!==a["links.newtab"]?a["links.newtab"]?!0:!1:!1)})},setOpenSearchPref:function(a,g){a.getService("orion.core.preference").getPreferences("/window/favorites").then(function(a){a.put("openSearchPref",
{openInNewTab:g})})}};return f});
define("orion/crawler/nls/root/messages",{"Searching file:":"Searching file:","is not supported in this file system":"is not supported in this file system","${0} files found out of ${1}":"${0} files found out of ${1}","The search term on this location will not use indexed files.":"The search term on this location will not use indexed files.","It will take longer time. Do you want to proceed?":"It will take longer time. Do you want to proceed?","Search cancelled by user":"Search cancelled by user",Cancel:"Cancel"});
define("orion/crawler/nls/messages",["orion/i18n!orion/crawler/nls/messages","orion/crawler/nls/root/messages"],function(k,m){var n={root:m};Object.keys(k).forEach(function(d){"undefined"===typeof n[d]&&(n[d]=k[d])});return n});
define("orion/contentTypes",[],function(){function k(a,c){if("string"!==typeof a)return null;for(var e=a&&a.split(".").pop(),b=null,f=0;f<c.length;f++){var d=c[f],h;h=b;var l=d,k=e,m=0<=l.filename.indexOf(a),n;n=k.toLowerCase();n=-1!==l.extension.indexOf(n);if(m||n){if(!(n=!h))m&&(k=k.toLowerCase(),m=-1!==h.extension.indexOf(k)),n=m;n&&(h=l)}h===d&&(b=d)}return b}function m(a){return null===a||"undefined"===typeof a?[]:Array.isArray(a)?a:[a]}function n(a){return m(a).map(function(a){return String.prototype.toLowerCase.call(a)})}
function d(a){return{id:a.id,name:a.name,image:a.image,imageClass:a.imageClass,"extends":a["extends"],extension:n(a.extension),filename:m(a.filename)}}function h(a){var c=Object.create(null);a.map(d).forEach(function(a){Object.prototype.hasOwnProperty.call(c,a.id)||(c[a.id]=a)});return c}function l(g){if(g&&g.registerService){this.serviceRegistry=g;for(var c=g.getServiceReferences(f).concat(g.getServiceReferences(a)),e=[],d=0;d<c.length;d++)for(var l=m(c[d].getProperty("contentTypes")),k=0;k<l.length;k++)e.push(l[k]);
this.map=h(e);g.registerService(b,this)}else if(Array.isArray(g))this.serviceRegistry=null,this.map=h(g);else throw Error("Invalid parameter");}var b="orion.core.contentTypeRegistry",f="orion.core.contenttype",a="orion.file.contenttype";l.prototype={getContentTypes:function(){var a=this.getContentTypesMap(),c=[],e;for(e in a)Object.prototype.hasOwnProperty.call(a,e)&&c.push(a[e]);return c},getContentTypesMap:function(){return this.map},getFileContentType:function(a){return k(a.Name,this.getContentTypes())},
getFilenameContentType:function(a){return k(a,this.getContentTypes())},getContentType:function(a){return this.map[a]||null},isExtensionOf:function(a,c){a="string"===typeof a?this.getContentType(a):a;c="string"===typeof c?this.getContentType(c):c;if(!a||!c)return!1;if(a.id===c.id)return!0;for(var e=a,b={};e&&(e=this.getContentType(e["extends"]));){if(e.id===c.id)return!0;if(b[e.id])throw Error("Cycle: "+e.id);b[e.id]=!0}return!1},isSomeExtensionOf:function(a,c){for(var e=0;e<c.length;e++)if(this.isExtensionOf(a,
c[e]))return!0;return!1}};return{ContentTypeRegistry:l,getFilenameContentType:k}});
define("orion/crawler/searchCrawler","i18n!orion/crawler/nls/messages require orion/i18nUtil orion/searchUtils orion/contentTypes orion/Deferred".split(" "),function(k,m,n,d,h,l){function b(b,a,g,c){this.registry=b;this.fileClient=a;this.fileLocations=[];this.fileSkeleton=[];this._totalCounter=this._hitCounter=0;this._searchOnName=c&&c.searchOnName;this._buildSkeletonOnly=c&&c.buildSkeletonOnly;this._fetchChildrenCallBack=c&&c.fetchChildrenCallBack;this._searchParams=g;this.searchHelper=this._searchOnName||
this._buildSkeletonOnly?null:d.generateSearchHelper(g);this._location=c&&c.location;this._childrenLocation=c&&c.childrenLocation?c.childrenLocation:this._location;this._reportOnCancel=c&&c.reportOnCancel;this._cancelled=!1;this._statusService=this.registry.getService("orion.page.message");this._progressService=this.registry.getService("orion.page.progress");this._statusService&&this._statusService.setCancelFunction(function(){this._cancelFileContentsSearch()}.bind(this))}b.prototype.search=function(b){var a=
this.registry.getService("orion.core.contentTypeRegistry");this._onSearchComplete=b;this._cancelled=!1;this._deferredArray=[];a.getContentTypes().then(function(a){this.contentTypesCache=a;var c=this;this._visitRecursively(this._childrenLocation).then(function(){(!c._cancelled||c._reportOnCancel)&&c._reportResult();c._cancelled&&c._HandleStatus({name:"Cancel"})}.bind(c),function(a){c._reportResult();c._HandleStatus(a)}.bind(c))}.bind(this))};b.prototype.searchName=function(b,a){b&&(this._searchParams=
b,this.searchHelper=d.generateSearchHelper(b,!0));a&&(this.onSearchNameComplete=a);var g=[];this._cancelled=!1;this._deferredArray=[];this._sort(this.fileSkeleton);if(0<this.fileSkeleton.length){for(var c=0;c<this.fileSkeleton.length;c++){var e=this.fileSkeleton[c].Name.toLowerCase();if(this.searchHelper.inFileQuery.wildCard?d.searchOnelineRegEx(this.searchHelper.inFileQuery,e,!0):d.searchOnelineLiteral(this.searchHelper.inFileQuery,e,!0))if(g.push(this.fileSkeleton[c]),g.length>=this.searchHelper.params.rows)break}this.onSearchNameComplete({response:{numFound:g.length,
docs:g}})}else this.onSearchNameComplete({response:{numFound:0,docs:[]}})};b.prototype.buildSkeleton=function(b,a){this._buildingSkeleton=!0;var g=this.registry.getService("orion.core.contentTypeRegistry");this._cancelled=!1;this._deferredArray=[];var c=this;b();g.getContentTypes().then(function(e){c.contentTypesCache=e;c._visitRecursively(c._childrenLocation).then(function(){c._buildingSkeleton=!1;a();c.searchHelper&&!c._buildSkeletonOnly&&c.searchName()})})};b.prototype._sort=function(b){b.sort(function(a,
g){var c,e;if("Path asc"===this._searchParams.sort){c=a.Location&&a.Location.toLowerCase();c=d.path2FolderName(c,a.Name&&a.Name.toLowerCase(),!0);e=g.Location&&g.Location.toLowerCase();e=d.path2FolderName(e,g.Name&&g.Name.toLowerCase(),!0);if(c<e)return-1;if(c>e)return 1}return this._sortOnNameSingle(a,g)}.bind(this))};b.prototype._HandleStatus=function(b){this._statusService&&"Cancel"===b.name&&(console.log("Crawling search cancelled. Deferred array length : "+this._deferredArray.length),this._statusService.setProgressResult({Message:k["Search cancelled by user"],
Severity:"Warning"}))};b.prototype._reportResult=function(){this._sort(this.fileLocations);this._onSearchComplete({response:{numFound:this.fileLocations.length,docs:this.fileLocations}})};b.prototype._sortOnNameSingle=function(b,a){var g=b.Name&&b.Name.toLowerCase(),c=a.Name&&a.Name.toLowerCase();return g<c?-1:g>c?1:0};b.prototype._onFileType=function(b){return this.searchHelper.params.fileType?this.searchHelper.params.fileType===d.ALL_FILE_TYPE?!0:0<=b.extension.indexOf(this.searchHelper.params.fileType):
!0};b.prototype._visitRecursively=function(b){var a=[],g=this;this._fetchChildrenCallBack&&this._fetchChildrenCallBack(b);return(g._progressService?this._progressService.progress(g.fileClient.fetchChildren(b),"Crawling search for children of "+b):g.fileClient.fetchChildren(b)).then(function(c){for(var e=0;e<c.length;e++)if(void 0!==c[e].Directory&&!1===c[e].Directory)if(g._searchOnName)a.push(g._buildSingleSkeleton(c[e]));else if(g._buildSkeletonOnly)a.push(g._buildSingleSkeleton(c[e]));else{if(!g._cancelled){var b=
h.getFilenameContentType(c[e].Name,g.contentTypesCache);if(b&&("text/plain"===b["extends"]||"text/plain"===b.id)&&g._onFileType(b))b=g._sniffSearch(c[e]),a.push(b),g._deferredArray.push(b)}}else if(c[e].Location)if(g._cancelled)break;else b=g._visitRecursively(c[e].ChildrenLocation),a.push(b),g._deferredArray.push(b);return l.all(a)})};b.prototype._hitOnceWithinFile=function(b){b=this._searchParams.caseSensitive?b:b.toLowerCase();return this.searchHelper.inFileQuery.wildCard?d.searchOnelineRegEx(this.searchHelper.inFileQuery,
b,!0):d.searchOnelineLiteral(this.searchHelper.inFileQuery,b,!0)};b.prototype._reportSingleHit=function(b){this._cancelled||(b.LastModified=b.LocalTimeStamp,this.fileLocations.push(b),this._hitCounter++,this._sort(this.fileLocations),this._onSearchComplete({response:{numFound:this.fileLocations.length,docs:this.fileLocations}},!0))};b.prototype._cancelFileContentsSearch=function(){(this._cancelled=!0)&&this._deferredArray.forEach(function(b){b.cancel()})};b.prototype._sniffSearch=function(b){this._totalCounter++;
var a=this;if(!this._cancelled)if(""===this.searchHelper.params.keyword)this._reportSingleHit(b),this._statusService&&this._statusService.setProgressResult({Message:n.formatMessage(k["${0} files found out of ${1}"],this._hitCounter,this._totalCounter)});else return(a._progressService?a._progressService.progress(a.fileClient.read(b.Location),"Reading file "+b.Location):a.fileClient.read(b.Location)).then(function(g){a._hitOnceWithinFile(g)&&a._reportSingleHit(b);a._statusService&&a._statusService.setProgressResult({Message:n.formatMessage(k["${0} files found out of ${1}"],
a._hitCounter,a._totalCounter)},k.Cancel)},function(a){a&&a.message&&"cancel"!==a.message.toLowerCase()&&console.error("Error loading file content: "+a.message)})};b.prototype._buildSingleSkeleton=function(b){this._totalCounter++;this.fileSkeleton.push(b);this.searchHelper&&!this._buildSkeletonOnly&&0===this._totalCounter%100&&this.searchName();b=new l;b.resolve(this._totalCounter);return b};b.prototype.constructor=b;return{SearchCrawler:b}});
define("orion/webui/treetable",["i18n!orion/nls/messages","orion/webui/littlelib"],function(k,m){function n(d){this._init(d)}n.prototype={_init:function(d){var h=d.parent,l=this,h=m.node(h);if(!h)throw k["no parent"];if(!d.model)throw k["no tree model"];if(!d.renderer)throw k["no renderer"];this._parent=h;this._treeModel=d.model;this._onComplete=d.onComplete;this._renderer=d.renderer;this._showRoot=void 0===d.showRoot?!1:d.showRoot;this._indent=void 0===d.indent?16:d.indent;this._onCollapse=d.onCollapse;
this._labelColumnIndex=void 0===d.labelColumnIndex?0:d.labelColumnIndex;this._id=void 0===d.id?"treetable":d.id;this._tableStyle=d.tableStyle;this._tableElement=d.tableElement||"table";this._tableBodyElement=d.tableBodyElement||"tbody";this._tableRowElement=d.tableRowElement||"tr";this._root=this._treeModel.getRoot(function(b){l._showRoot?(b._depth=0,l._generate([b],0)):l._treeModel.getChildren(b,function(b){l.destroyed||l._generate(b,0)})})},destroy:function(){this.destroyed=!0},_generate:function(d,
h){m.empty(this._parent);var l=document.createElement("div");this._renderer.wrapperCallback&&this._renderer.wrapperCallback(l);var b=document.createElement(this._tableElement);this._renderer.tableCallback&&this._renderer.tableCallback(b);b.id=this._id;this._tableStyle&&b.classList.add(this._tableStyle);this._renderer.initTable(b,this);this._bodyElement=document.createElement(this._tableBodyElement);this._renderer.bodyCallback&&this._renderer.bodyCallback(this._bodyElement);this._bodyElement.id=this._id+
"tbody";0===d.length?this._renderer.emptyCallback&&this._renderer.emptyCallback(this._bodyElement):this._generateChildren(d,h);b.appendChild(this._bodyElement);l.appendChild(b);this._parent.appendChild(l);this._rowsChanged();this._onComplete&&this._onComplete(this)},_generateChildren:function(d,h,l){for(var b=0;b<d.length;b++){var f=document.createElement(this._tableRowElement);f.id=this._treeModel.getId(d[b]);f._depth=h;f._item=d[b];this._renderer.render(d[b],f);f.childNodes[this._labelColumnIndex].style.paddingLeft=
this._indent*h+"px";this._renderer.rowCallback&&this._renderer.rowCallback(f,d[b]);l?(this._bodyElement.insertBefore(f,l.nextSibling),l&&(l=f)):this._bodyElement.appendChild(f)}},_rowsChanged:function(){this._renderer.rowsChanged&&this._renderer.rowsChanged()},getSelected:function(){return this._renderer.getSelected()},refresh:function(d,h,l){var b=this._treeModel.getId(d),f;if(b===this._id)this._removeChildRows(b),this._generateChildren(h,0),this._rowsChanged();else{var a=m.node(b);a?(a._item=d,
a&&(l||a._expanded)?(this._removeChildRows(b),h?(a._expanded=!0,this._renderer.updateExpandVisuals(a,!0),this._generateChildren(h,a._depth+1,a),this._rowsChanged()):(f=this,this._renderer.updateExpandVisuals(a,"progress"),h=this._treeModel.getChildren(a._item,function(b){f.destroyed||(f._renderer.updateExpandVisuals(a,!0),a._expanded||(a._expanded=!0,f._generateChildren(b,a._depth+1,a),f._rowsChanged()))}))):this._renderer.updateExpandVisuals(a,!1)):console.log(k["could not find table row "]+b)}},
getItem:function(d){var h=m.node(d);return h&&h._item?h._item:d},toggle:function(d){var h=m.node(d);h&&(h._expanded?this.collapse(d):this.expand(d))},isExpanded:function(d){d="string"===typeof d?d:this._treeModel.getId(d);return(d=m.node(d))?d._expanded:!1},expand:function(d,h,l){d="string"===typeof d?d:this._treeModel.getId(d);var b=m.node(d);if(b){var f=this;b._expanded?h&&h.apply(f,l):(this._renderer.updateExpandVisuals(b,"progress"),this._treeModel.getChildren(b._item,function(a){f.destroyed||
(f._renderer.updateExpandVisuals(b,!0),b._expanded||(b._expanded=!0,f._generateChildren(a,b._depth+1,b),f._rowsChanged()),h&&h.apply(f,l))}))}},_removeChildRows:function(d){for(var h=d===this._id,l=!1,b=-1,f=[],a=m.$$array(".treeTableRow",this._parent),g=0;g<a.length;g++){var c=a[g];if(l)break;h?c._depth>b?f.push(c):l=!0:c.id===d&&(h=!0,b=c._depth)}for(d=0;d<f.length;d++)h=f[d],h.parentNode.removeChild(h)},collapse:function(d){d="string"===typeof d?d:this._treeModel.getId(d);var h=m.node(d);if(h){if(!h._expanded)return;
h._expanded=!1;this._renderer.updateExpandVisuals(h,!1);this._removeChildRows(d);this._rowsChanged()}this._onCollapse&&this._onCollapse(h._item)},getIndent:function(){return this._indent}};n.prototype.constructor=n;return{TableTree:n}});
define("orion/treeModelIterator",[],function(){var k={};k.TreeModelIterator=function(){function k(m,d){this.firstLevelChildren=m;this.reset();this._init(d)}k.prototype={_init:function(k){k&&(this.isExpanded=k.isExpanded,this.isExpandable=k.isExpandable,this.forceExpandFunc=k.forceExpandFunc,this.getChildrenFunc=k.getChildrenFunc)},topLevel:function(k){return k.parent?k.parent===this.root:!0},_getChildren:function(k){return"function"===typeof this.getChildrenFunc?this.getChildrenFunc(k):k?k.children:
null},_expanded:function(k){if(!k)return!0;var d=this._getChildren(k),d=d&&0<d.length;this.isExpanded&&d&&(d=this.isExpanded(k));return d},_expandable:function(k){return!k?!0:this.isExpandable?this.isExpandable(k):!1},_diveIn:function(k){return this._expanded(k)?(k=this._getChildren(k),this.setCursor(k[0]),this.cursor()):null},_drillToLast:function(k){return this._expanded(k)?(k=this._getChildren(k),this._drillToLast(k[k.length-1])):k},_forward:function(k){if(!this._cursor)return null;var d=this._diveIn(this._cursor);
if(!d){if(k&&this._expandable(this._cursor)&&this.forceExpandFunc){var h=this;return this.forceExpandFunc(this._cursor,"first",function(d){d&&h.setCursor(d)})}(d=this._findSibling(this._cursor,!0))&&this.setCursor(d)}return d},_backward:function(k){if(!this._cursor)return null;var d=this._findSibling(this._cursor,!1);d&&d!==this._cursor.parent&&(d=this._drillToLast(d));if(k&&d&&this._expandable(d)&&this.forceExpandFunc&&d!==this._cursor.parent){var h=this;return this.forceExpandFunc(d,"last",function(d){d&&
h.setCursor(d)})}d&&this.setCursor(d);return d},_findSibling:function(k,d){for(var h=this.topLevel(k),l=this._getChildren(k.parent),l=h?this.firstLevelChildren:l,b=0;b<l.length;b++)if(l[b]===k)return 0===b&&!d?h?null:k.parent:b===l.length-1&&d?h?null:this._findSibling(k.parent,d):d?l[b+1]:l[b-1];return null},_inParentChain:function(k,d){for(var h=k.parent;h;){if(h===d)return!0;h=h.parent}return!1},_getTopLevelParent:function(k){if(this.topLevel(k))return k;for(k=k.parent;k;){if(this.topLevel(k))return k;
k=k.parent}return null},_onCollapse:function(k){return this._expanded(k.parent)?k:this._onCollapse(k.parent)},_scan:function(k,d,h){this.setCursor(d);var l=[];for(l.push(d);;){if(this.iterate(k))l.push(this.cursor());else break;if(h===this.cursor())return l}return null},setCursor:function(k){this._prevCursor=this._cursor;this._cursor=k},setTree:function(k){this.firstLevelChildren=k;0<this.firstLevelChildren.length&&(this.root=this.firstLevelChildren[0].parent)},scan:function(k,d){var h=this.cursor(),
l=this._scan(!0,k,d);l||(l=this._scan(!1,k,d));this.setCursor(h);return l},iterate:function(k,d){return k?this._forward(d):this._backward(d)},iterateOnTop:function(k,d){var h=this._findSibling(this._getTopLevelParent(this.cursor()),k);h?this.setCursor(h):d&&0<this.firstLevelChildren.length&&this.setCursor(k?this.firstLevelChildren[0]:this.firstLevelChildren[this.firstLevelChildren.length-1])},collapse:function(k){return!this._cursor?null:this._inParentChain(this._cursor,k)?(this.setCursor(k),this._cursor):
null},reset:function(){this.root=this._prevCursor=this._cursor=null;0<this.firstLevelChildren.length&&(this._cursor=this.firstLevelChildren[0],this.root=this.firstLevelChildren[0].parent)},cursorMoved:function(){return this._cursor!==this._prevCursor},cursor:function(){return this._cursor},prevCursor:function(){return this._prevCursor}};return k}();return k});
define("orion/explorers/explorerNavHandler",["orion/webui/littlelib","orion/treeModelIterator","orion/uiUtils"],function(k,m,n){var d={},h=-1!==navigator.userAgent.indexOf("iPad"),l=-1!==window.navigator.platform.indexOf("Mac");d.ExplorerNavHandler=function(){function b(b,a,g){this.explorer=b;this.model=this.explorer.model;this._navDict=a;this._listeners=[];this._selections=[];this._currentColumn=0;b=this._getEventListeningDiv();b.tabIndex=0;b.classList.add("selectionModelContainer");var c=this;this._modelIterator=
new m.TreeModelIterator([],{isExpanded:this.isExpanded.bind(this),getChildrenFunc:g.getChildrenFunc,isExpandable:this.explorer.renderer.isExpandable?function(a){return c.explorer.renderer.isExpandable(a)}:function(a){return c.isExpandable(a)},forceExpandFunc:this.explorer.forceExpandFunc?function(a,b,g){return c.explorer.forceExpandFunc(a,b,g)}:void 0});this._init(g);(!g||!1!==g.setFocus)&&b.focus();g=function(a){if(n.isFormElement(a.target)||c.explorer.preventDefaultFunc&&c.explorer.preventDefaultFunc(a,
c._modelIterator.cursor()))return!0;if(a.keyCode===k.KEY.DOWN)return c.onDownArrow(a);if(a.keyCode===k.KEY.UP)return c.onUpArrow(a);if(a.keyCode===k.KEY.RIGHT)return c.onRightArrow(a);if(a.keyCode===k.KEY.LEFT)return c.onLeftArrow(a);if(a.keyCode===k.KEY.SPACE)return c.onSpace(a);if(a.keyCode===k.KEY.ENTER)return c.onEnter(a)};b.addEventListener("keydown",g,!1);this._listeners.push({type:"keydown",listener:g});g=function(a){if(c.explorer.onFocus)c.explorer.onFocus(!1);else c.toggleCursor(null,!1)};
b.addEventListener("blur",g,!1);this._listeners.push({type:"blur",listener:g});g=function(a){if(c.explorer.onFocus)c.explorer.onFocus(!0);else c.toggleCursor(null,!0)};b.addEventListener("focus",g,!1);this._listeners.push({type:"focus",listener:g});this._parentDiv=b}b.prototype={destroy:function(){this._parentDiv.classList.remove("selectionModelContainer");this.removeListeners()},_init:function(b){this._linearGridMove=!1;b&&(this._selectionPolicy=b.selectionPolicy,this.gridClickSelectionPolicy=b.gridClickSelectionPolicy||
"none",this.preventDefaultFunc=b.preventDefaultFunc,this.postDefaultFunc=b.postDefaultFunc)},_ctrlKeyOn:function(b){return l?b.metaKey:b.ctrlKey},removeListeners:function(){if(this._listeners)for(var b=0;b<this._listeners.length;b++)this._parentDiv.removeEventListener(this._listeners[b].type,this._listeners[b].listener,!1)},focus:function(){var b=this._getEventListeningDiv();b&&b.focus()},_getEventListeningDiv:function(b){return this.explorer.keyEventListeningDiv&&"function"===typeof this.explorer.keyEventListeningDiv?
this.explorer.keyEventListeningDiv(b):k.node(this.explorer._parentId)},isExpandable:function(b){return!b?!1:k.node(this.explorer.renderer.expandCollapseImageId(this.model.getId(b)))?!0:!1},isExpanded:function(b){return!b?!1:this.explorer.myTree.isExpanded(this.model.getId(b))},refreshSelection:function(b,a){var g=this;this.explorer.selection&&this.explorer.selection.getSelections(function(c){g._clearSelection(a);for(var e=0;e<c.length;e++)g._selections.push(c[e]);0<g._selections.length?g.cursorOn(g._selections[0],
!0,!1,b):g.cursorOn(null,!1,!1,b);g._shiftSelectionAnchor&&0<=g._inSelection(g._shiftSelectionAnchor)||(g._shiftSelectionAnchor=null)})},refreshModel:function(b,a,g,c){this._currentColumn=0;this.topIterationNodes=[];this.model=a;this._navDict=b;this.model.getTopIterationNodes?this.topIterationNodes=this.model.getTopIterationNodes():g&&(this.topIterationNodes=g);this._modelIterator.setTree(this.topIterationNodes);!c&&this.explorer.selection&&(this.toggleCursor(this._modelIterator.cursor(),!1),this._modelIterator.reset());
this.refreshSelection(!0)},getTopLevelNodes:function(){return this._modelIterator.firstLevelChildren},_inSelection:function(b){b=this.model.getId(b);for(var a=0;a<this._selections.length;a++)if(b===this.model.getId(this._selections[a]))return a;return-1},_clearSelection:function(b){if(b)for(b=0;b<this._selections.length;b++)this._checkRow(this._selections[b],!0);this._selections=[]},getSelectionPolicy:function(){return this._selectionPolicy},setSelectionPolicy:function(b){this._selectionPolicy!==
b&&(("readonlySelection"===this._selectionPolicy||"readonlySelection"===b)&&this._toggleSelectionClass("disabledRow","readonlySelection"===b),this._selectionPolicy=b,"cursorOnly"===this._selectionPolicy&&this._clearSelection(!0))},setSelection:function(b,a,g){"readonlySelection"!==this._selectionPolicy&&("cursorOnly"===this._selectionPolicy?a&&this.explorer.renderer._useCheckboxSelection&&this._checkRow(b,!0):this._isRowSelectable(b)&&(!a||"singleSelection"===this._selectionPolicy?(this._clearSelection(!0),
this._checkRow(b,!1),this._selections.push(b),this._lastSelection=b):(a=this._inSelection(b),0<=a?(this._checkRow(b,!0),this._selections.splice(a,1)):(this._checkRow(b,!1),this._selections.push(b),this._lastSelection=b)),g&&(this._shiftSelectionAnchor=this._lastSelection),this.explorer.selection&&(this.explorer.renderer.storeSelections(),this.explorer.selection.setSelections(this._selections))))},moveColumn:function(b,a){b||(b=this.currentModel());var g=this._getGridChildren(b);if(g&&1<g.length||
0===a&&g){0!==a&&this.toggleCursor(b,!1);var c=this._currentColumn,e=!0,c=c+a;0>c?(this._linearGridMove&&0!==a&&(this._modelIterator.iterate(!1)?b=this.currentModel():e=!1),c=e?g.length-1:this._currentColumn):c>=g.length&&(this._linearGridMove&&0!==a&&(this._modelIterator.iterate(!0)?b=this.currentModel():e=!1),c=e?0:this._currentColumn);this._currentColumn=c;0!==a&&this.toggleCursor(b,!0);return!0}return!1},_getGridChildren:function(b){return this._navDict?this._navDict.getGridNavHolder(b):null},
getCurrentGrid:function(b){b||(b=this.currentModel());return(b=this._getGridChildren(b))&&0<b.length?b[this._currentColumn]:null},getAriaContainerElement:function(b){for(var a=this._parentDiv,g;b&&b!==a&&"grid"!==(g=b.getAttribute("role"))&&"tree"!==g&&"treegrid"!==g;)b=b.parentNode;return b===a?null:b},toggleCursor:function(b,a){var g=this.getRowDiv(b),c=this.getCurrentGrid(b);c?(g&&(a?g.classList.add("treeIterationCursorRow"):g.classList.remove("treeIterationCursorRow")),c.domNode&&(g=this.getAriaContainerElement(c.domNode),
a?(c.domNode.classList.add("treeIterationCursor"),g&&g.setAttribute("aria-activedescendant",c.domNode.id)):c.domNode.classList.remove("treeIterationCursor"))):g&&(a?g.classList.add("treeIterationCursorRow_Dotted"):g.classList.remove("treeIterationCursorRow_Dotted"))},currentModel:function(){return this._modelIterator.cursor()},cursorOn:function(b,a,g,c){var e,d;if(b||a){if(d===this._modelIterator.cursor())return;e=this._modelIterator.cursor();d=b;this._modelIterator.setCursor(d)}else e=this._modelIterator.prevCursor(),
d=this._modelIterator.cursor();if(e!==d||a)if(this.toggleCursor(e,!1),!a||d){this.moveColumn(null,0);this.toggleCursor(d,!0);if((b=this.getRowDiv())&&!c){c=b.parentNode;for(a=document.documentElement;c&&c!==a;){var h=window.getComputedStyle(c,null);if(!h)break;h=h.getPropertyValue("overflow-y");if("auto"===h||"scroll"===h)break;c=c.parentNode}c&&(a=!0,b.offsetTop<=c.scrollTop?(a=!1,void 0===g&&(g=!1)):b.offsetTop+b.offsetHeight>=c.scrollTop+c.clientHeight&&(a=!1,void 0===g&&(g=!0)),a||b.scrollIntoView(!g))}if(this.explorer.onCursorChanged)this.explorer.onCursorChanged(e,
d)}},getSelection:function(){return this._selections},getSelectionIds:function(){for(var b=[],a=0;a<this._selections.length;a++)b.push(this.model.getId(this._selections[a]));return b},getRowDiv:function(b){b=b?b:this._modelIterator.cursor();if(!b)return null;b=this.model.getId(b);var a=this._navDict.getValue(b);return a&&a.rowDomNode?a.rowDomNode:k.node(b)},iterate:function(b,a,g,c){var e=null;if(this.topIterationNodes&&0!==this.topIterationNodes.length)if(c){c=this.currentModel();for((e=this._modelIterator.iterate(b,
a))&&this._setCursorOnItem(b,g);e&&e.isNotSelectable;)(e=this._modelIterator.iterate(b,a))&&this._setCursorOnItem(b,g);e||(this.cursorOn(c,!0,!1,!0),this._setCursorOnItem(b,g))}else this._modelIterator.iterate(b,a)&&this._setCursorOnItem(b,g)},_toggleSelectionClass:function(b,a){this._selections.forEach(function(g){(g=this.getRowDiv(g))&&(a?g.classList.add(b):g.classList.remove(b))}.bind(this))},_setCursorOnItem:function(b,a){this.cursorOn(null,!1,b);if(a){var g=this._inSelection(this._modelIterator.prevCursor()),
c=this._inSelection(this._modelIterator.cursor());0<=g&&0<=c?this.setSelection(this._modelIterator.prevCursor(),!0):this.setSelection(this.currentModel(),!0)}},_checkRow:function(b,a){if(this.explorer.renderer._useCheckboxSelection&&"singleSelection"!==this._selectionPolicy){var g=this.getRowDiv(b);if(g){var c=k.node(this.explorer.renderer.getCheckBoxId(g.id)),e=a?!c.checked:!0;if(e!==c.checked)this.explorer.renderer.onCheck(g,c,e,!0)}}else this._select(b,a)},_select:function(b,a){b||(b=this._modelIterator.cursor());
var g=this.getRowDiv(b);g&&(0>this._inSelection(b)?g.classList.add("checkedRow"):g.classList.remove("checkedRow"))},_onModelGrid:function(b,a){var g=this._getGridChildren(b);if(g)for(var c=0;c<g.length;c++)if(a.target===g[c].domNode)return!0;return!1},onClick:function(b,a){if("readonlySelection"===this._selectionPolicy||this.isDisabled(this.getRowDiv(b)))k.stop(a);else{var g=k.node(this.explorer.renderer.expandCollapseImageId(this.model.getId(b)));if(a.target!==g&&!("none"===this.gridClickSelectionPolicy&&
this._onModelGrid(b,a)))if(this.cursorOn(b,!0,!1,!0),h)this.setSelection(b,!0);else if(this._ctrlKeyOn(a))this.setSelection(b,!0,!0);else if(a.shiftKey&&this._shiftSelectionAnchor){if(g=this._modelIterator.scan(this._shiftSelectionAnchor,b)){this._clearSelection(!0);for(var c=0;c<g.length;c++)this.setSelection(g[c],!0)}}else this.setSelection(b,!1,!0)}},onCollapse:function(b){this._modelIterator.collapse(b)&&this.cursorOn()},onUpArrow:function(b){this.iterate(!1,!1,b.shiftKey,!0);!this._ctrlKeyOn(b)&&
!b.shiftKey&&this.setSelection(this.currentModel(),!1,!0);b.preventDefault();return!1},onDownArrow:function(b){this.iterate(!0,!1,b.shiftKey,!0);!this._ctrlKeyOn(b)&&!b.shiftKey&&this.setSelection(this.currentModel(),!1,!0);b.preventDefault();return!1},_shouldMoveColumn:function(b){var a=this.currentModel(),g=this._getGridChildren(a);return g&&1<g.length?this.isExpandable(a)?this._ctrlKeyOn(b):!0:!1},onLeftArrow:function(b){if(this._shouldMoveColumn(b))return this.moveColumn(null,-1),b.preventDefault(),
!0;var a=this._modelIterator.cursor();if(!a)return!1;if(this.isExpandable(a)&&this.isExpanded(a))return this.explorer.myTree.collapse(a),b.preventDefault(),!0;this._modelIterator.topLevel(a)?this.explorer.scopeUp&&"function"===typeof this.explorer.scopeUp&&this.explorer.scopeUp():(this.cursorOn(a.parent),this.setSelection(a.parent,!1,!0))},onRightArrow:function(b){if(this._shouldMoveColumn(b))return this.moveColumn(null,1),b.preventDefault(),!0;var a=this._modelIterator.cursor();if(!a)return!1;if(this.isExpandable(a)&&
!this.isExpanded(a))return this.explorer.myTree.expand(a),this.explorer.postUserExpand&&this.explorer.postUserExpand(this.model.getId(a)),b.preventDefault(),!1},_isRowSelectable:function(b){return this.explorer.isRowSelectable?this.explorer.isRowSelectable(b):!0},onSpace:function(b){this.setSelection(this.currentModel(),!0,!0);b.preventDefault()},onEnter:function(b){var a=this.getCurrentGrid(this._modelIterator.cursor());if(a)if(a.widget)if("function"===typeof a.onClick)a.onClick();else"function"===
typeof a.widget.focus&&a.widget.focus();else{var g=document.createEvent("MouseEvents");g.initMouseEvent("click",!0,!0,window,0,0,0,0,0,this._ctrlKeyOn(b),!1,!1,!1,0,null);a.domNode.dispatchEvent(g)}else if(a=this._modelIterator.cursor())if(this.explorer.renderer.getRowActionElement&&(g=this.explorer.renderer.getRowActionElement(this.model.getId(a)),g.href&&(this._ctrlKeyOn(b)?window.open(g.href):window.location.href=g.href)),this.explorer.renderer.performRowAction)return this.explorer.renderer.performRowAction(b,
a),b.preventDefault(),!1},setIsNotSelectable:function(b,a){b.isNotSelectable=a},disableItem:function(b){var a=this.getRowDiv(b);this.isExpandable(b)&&this.isExpanded(b)&&(this._modelIterator.collapse(b),this.explorer.myTree.toggle(a.id));a.classList.remove("checkedRow");a.classList.add("disabledNavRow");this.setIsNotSelectable(b,!0)},isDisabled:function(b){return b.classList.contains("disabledNavRow")},enableItem:function(b){var a=this.getRowDiv(b);a&&(a.classList.remove("disabledNavRow"),this.setIsNotSelectable(b,
!1))}};return b}();d.ExplorerNavDict=function(){function b(b){this._dict={};this._model=b}b.prototype={addRow:function(b,a){var g=this._model.getId(b);this._dict[g]={model:b,rowDomNode:a}},getValue:function(b){return this._dict[b]},getGridNavHolder:function(b,a){if(!b)return null;var g=this._model.getId(b);return this._dict[g]?(!this._dict[g].gridChildren&&a&&(this._dict[g].gridChildren=[]),this._dict[g].gridChildren):null},initGridNavHolder:function(b){if(!b)return null;b=this._model.getId(b);this._dict[b]&&
(this._dict[b].gridChildren=null)}};return b}();return d});
define("orion/explorers/explorer","i18n!orion/nls/messages require orion/webui/littlelib orion/webui/treetable orion/explorers/explorerNavHandler orion/commands".split(" "),function(k,m,n,d,h,l){var b={};b.Explorer=function(){function b(a,g,c,e){this.registry=a;this.renderer=c;this.selection=g;this.commandService=e;this.renderer&&(this.renderer.explorer=this);this.myTree=null}b.prototype={destroy:function(){this._navHandler&&this._navHandler.destroy();this.model&&this.model.destroy();this.myTree&&
this.myTree.destroy();this.destroyed=!0},changedItem:function(a,b){this.myTree&&this.myTree.refresh.bind(this.myTree)(a,b,!0)},updateCommands:function(a){this.myTree&&this.myTree._renderer.updateCommands.bind(this.myTree._renderer)(a)},makeNewItemPlaceHolder:function(a,b,c,e){a=this.getRow(a);if(c)return a=a.childNodes[c],a.appendChild(document.createElement("br")),e=document.createElement("span"),e.id=b+"placeHolderRow",a.appendChild(e),{tempNode:e,refNode:e};if(a){var d=document.createElement("tr");
d.id=b+"placeHolderRow";c=document.createElement("td");c.id=b+"placeHolderCol";d.appendChild(c);e?(a.parentNode.insertBefore(d,a.nextSibling),a=parseInt(a.firstChild.style.paddingLeft),c.style.paddingLeft=this.myTree.getIndent()+a+"px"):a.appendChild(d);e=n.node(b+"placeHolderRow");a=n.node(b+"placeHolderCol");if(e&&a)return{tempNode:e,refNode:a}}return null},getRow:function(a){if(a=this.model.getId(a))return n.node(a)},collapseAll:function(){for(var a=this._navHandler.getTopLevelNodes(),b=0;b<a.length;b++)this.myTree.collapse(a[b])},
expandAll:function(a){if(a)this._expandRecursively(a);else if(this._navHandler){a=this._navHandler.getTopLevelNodes();for(var b=0;b<a.length;b++)this._expandRecursively(a[b])}},_expandRecursively:function(a){if(this._navHandler&&this._navHandler.isExpandable(a)){var b=this;this.myTree.expand(a,function(){b.model.getChildren(a,function(a){if(!(void 0===a||null===a))for(var e=a.length,d=0;d<e;d++)b._expandRecursively(a[d])})})}},createTree:function(a,b,c){a="string"===typeof a?a:a.id||a;this.selection&&
this.selection.setSelections([]);this.getNavHandler()&&this.getNavHandler()._clearSelection();var e=a+"innerTree",f=n.node(e);f&&n.empty(f);b&&(b.rootId=e);this.model=b;this._parentId=a;this._treeOptions=c;if(!c||c&&!c.noSelection)this.selectionPolicy=c?c.selectionPolicy:"",this._navDict=new h.ExplorerNavDict(this.model);this.myTree=new d.TableTree({id:e,model:b,parent:a,onComplete:c?c.onComplete:void 0,labelColumnIndex:this.renderer.getLabelColumnIndex(),renderer:this.renderer,showRoot:c?!!c.showRoot:
!1,indent:c?c.indent:void 0,onCollapse:c?c.onCollapse:void 0,navHandlerFactory:c?c.navHandlerFactory:void 0,tableElement:c?c.tableElement:void 0,tableBodyElement:c?c.tableBodyElement:void 0,tableRowElement:c?c.tableRowElement:void 0});this.renderer._initializeUIState();"cursorOnly"===this.selectionPolicy&&this.initNavHandler()},getNavHandler:function(){return this._navHandler},getNavDict:function(){return this._navDict},refreshSelection:function(){if(this.selection){var a=this.getNavHandler(),b=[];
if(a&&this.getNavDict())for(var c=a.getSelection(),e=0;e<c.length;e++){var d=a.getRowDiv(c[e]);d&&d.parentNode&&(d=this.getNavDict().getValue(this.model.getId(c[e])),d.model&&b.push(d.model))}this.selection.setSelections(b)}},getRootPath:function(){return this.model&&this.model.root?this.model.root.Location:null},initNavHandler:function(){var a=this._treeOptions;if(!a||a&&!a.noSelection){this.getNavHandler()||(this._navHandler=a&&a.navHandlerFactory&&"function"===typeof a.navHandlerFactory.createNavHandler?
a.navHandlerFactory.createNavHandler(this,this._navDict,a):new h.ExplorerNavHandler(this,this._navDict,{getChildrenFunc:a?a.getChildrenFunc:null,setFocus:a&&a.setFocus,selectionPolicy:a?a.selectionPolicy:null}));var b=this;this.model.getRoot(function(c){c instanceof Array?b.getNavHandler().refreshModel(b.getNavDict(),b.model,c):c.children&&c.children instanceof Array&&b.getNavHandler().refreshModel(b.getNavDict(),b.model,c.children);a&&a.setFocus&&b.getNavHandler().cursorOn(null,!1,!1,!0)})}},_lastHash:null,
checkbox:!1};return b}();b.createExplorerCommands=function(b,a){function g(c){return"function"===typeof c.getItemCount&&0<c.getItemCount()?a?a(c):!0:!1}var c=new l.Command({tooltip:k["Expand all"],imageClass:"core-sprite-expandAll",id:"orion.explorer.expandAll",groupId:"orion.explorerGroup",visibleWhen:function(a){return g(a)},callback:function(a){a.items.expandAll()}}),e=new l.Command({tooltip:k["Collapse all"],imageClass:"core-sprite-collapseAll",id:"orion.explorer.collapseAll",groupId:"orion.explorerGroup",
visibleWhen:function(a){return g(a)},callback:function(a){a.items.collapseAll()}});b.addCommand(c);b.addCommand(e)};b.ExplorerModel=function(){function b(a,g,c){this.rootPath=a;this.fetchItems=g;this.idPrefix=c||""}b.prototype={destroy:function(){this.destroyed=!0},getRoot:function(a){var b=this;this.fetchItems(this.rootPath).then(function(c){b.root=c;a(c)})},getChildren:function(a,b){a.Children?b(a.Children):a.ChildrenLocation?this.fetchItems(a.ChildrenLocation).then(function(c){a.Children=c;b(c)}):
b([])},getId:function(a){if(a.Location===this.root.Location)return this.rootId;a=a.Location.replace(/[\\\/]/g,"");for(var b=this.idPrefix,c=0;c<a.length;c++)b=a[c].match(/[^\.\:\-\_0-9A-Za-z]/g)?b+a.charCodeAt(c):b+a[c];return b}};return b}();b.ExplorerFlatModel=function(){function d(a,b,c){this.rootPath=a;this.fetchItems=b;this.root=c}d.prototype=new b.ExplorerModel;d.prototype.getRoot=function(a){if(this.root)a(this.root);else{var b=this;this.fetchItems(this.rootPath).then(function(c){b.root=c;
a(c)})}};d.prototype.getChildren=function(a,b){a===this.root?b(this.root):b([])};return d}();b.ExplorerRenderer=function(){function b(a,g){this.explorer=g;this._init(a);this._expandImageClass="core-sprite-openarrow";this._collapseImageClass="core-sprite-closedarrow";this._progressImageClass="core-sprite-progress";this._twistieSpriteClass="modelDecorationSprite"}b.prototype={_init:function(a){a&&(this._useCheckboxSelection=void 0===a.checkbox?!1:a.checkbox,this.selectionPolicy=a.singleSelection?"singleSelection":
"",this._cachePrefix=a.cachePrefix,this.getCheckedFunc=a.getCheckedFunc,this.onCheckedFunc=a.onCheckedFunc,this._highlightSelection=!0,this._treeTableClass=a.treeTableClass||"treetable",!1===a.highlightSelection&&(this._highlightSelection=!1),this.actionScopeId||(this.actionScopeId=a.actionScopeId),this.commandService||(this.commandService=a.commandService))},getLabelColumnIndex:function(){return this.explorer.checkbox?1:0},initTable:function(a,b){this.tableTree=b;this.tableNode=a;n.empty(a);this._treeTableClass&&
a.classList.add(this._treeTableClass);this.renderTableHeader(a)},getActionsColumn:function(a,b,c,e,d){c=c||"tool";var f=document.createElement("td");f.id=b.id+"actionswrapper";e&&f.classList.add(e);this.actionScopeId&&this.commandService?this.commandService.renderCommands(this.actionScopeId,f,a,this.explorer,c,null,d&&this.explorer.getNavDict()?this.explorer.getNavDict().getGridNavHolder(a,!0):null):window.console.log("Warning, no command service or action scope was specified.  No commands rendered.");
return f},initCheckboxColumn:function(a){if(this._useCheckboxSelection)return document.createElement("th")},getCheckboxColumn:function(a,b){if(this._useCheckboxSelection){var c=document.createElement("td"),e=document.createElement("span");e.id=this.getCheckBoxId(b.id);e.classList.add("core-sprite-check");e.classList.add("selectionCheckmarkSprite");e.rowId=b.id;this.getCheckedFunc&&(e.checked=this.getCheckedFunc(a),e.checked?(this._highlightSelection&&b.classList.add("checkedRow"),e.classList.add("core-sprite-check_on")):
(this._highlightSelection&&b.classList.remove("checkedRow"),e.classList.remove("core-sprite-check_on")));c.appendChild(e);var d=this;e.addEventListener("click",function(a){d.onCheck(b,a.target,a.target.checked?!1:!0,!0)},!1);return c}},getCheckBoxId:function(a){return a+"selectedState"},onCheck:function(a,b,c,e,d){(b.checked=c)?b.classList.add("core-sprite-check_on"):b.classList.remove("core-sprite-check_on");if(this.onCheckedFunc)this.onCheckedFunc(b.rowId,c,e);this.explorer.getNavHandler()&&d&&
this.explorer.getNavHandler().setSelection(this.explorer.getNavDict().getValue(a.id).model,!0)},storeSelections:function(){if(this.explorer.getNavHandler()){var a=this.explorer.getNavHandler().getSelectionIds(),b=this._getUIStatePreferencePath();b&&window.sessionStorage&&(window.sessionStorage[b+"selection"]=JSON.stringify(a))}},_restoreSelections:function(a){var b=this.explorer.getNavDict(),c=this.explorer.getNavHandler();if(c&&b&&"cursorOnly"!==c.getSelectionPolicy()&&(a=window.sessionStorage[a+
"selection"],"string"===typeof a&&(a=0<a.length?JSON.parse(a):null),a)){for(var e=[],c=0;c<a.length;c++){var d=b.getValue(a[c]);if(d&&d.rowDomNode&&d.model&&(e.push(d.model),this._highlightSelection&&d.rowDomNode.classList.add("checkedRow"),d=n.node(this.getCheckBoxId(d.rowDomNode.id))))d.checked=!0,d.classList.add("core-sprite-check_on")}this.explorer.selection&&(this.explorer.selection.setSelections(e),this.explorer.getNavHandler()&&this.explorer.getNavHandler().refreshSelection())}},_storeExpansions:function(a){window.sessionStorage[a+
"expanded"]=JSON.stringify(this._expanded)},_restoreExpansions:function(a){var b=!1,c=window.sessionStorage[a+"expanded"];"string"===typeof c&&(c=0<c.length?JSON.parse(c):null);var e;if(c)for(e=0;e<c.length;e++)if(n.node(c[e])){this._expanded.push(c[e]);var d=this;this.tableTree.expand(c[e],function(){d._restoreSelections(a)});b=!0}return!b},_getUIStatePreferencePath:function(){if(this.explorer){var a=this.explorer.getRootPath();if(this._cachePrefix&&a)return a=a.replace(/[^\.\:\-\_0-9A-Za-z]/g,""),
"/"+this._cachePrefix+"/"+a+"/uiState"}return null},expandCollapseImageId:function(a){return a+"__expand"},updateExpandVisuals:function(a,b){var c=n.node(this.expandCollapseImageId(a.id));c&&(c.classList.remove(this._expandImageClass),c.classList.remove(this._collapseImageClass),c.classList.remove(this._progressImageClass),c.classList.add("progress"===b?this._progressImageClass:b?this._expandImageClass:this._collapseImageClass))},getExpandImage:function(a,b,c,e){var d=document.createElement("span");
d.id=this.expandCollapseImageId(a.id);b.appendChild(d);d.classList.add(this._twistieSpriteClass);d.classList.add(this._collapseImageClass);if(c){var f=document.createElement("span");b.appendChild(f);f.classList.add(e||"imageSprite");f.classList.add(c)}var h=this;d.onclick=function(c){if(!h.explorer.getNavHandler().isDisabled(a)){h.tableTree.toggle(a.id);if(h.tableTree.isExpanded(a.id))h._expanded.push(a.id),h.explorer.postUserExpand&&h.explorer.postUserExpand(a.id);else for(var b in h._expanded)if(h._expanded[b]===
a.id){h._expanded.splice(b,1);break}(c=h._getUIStatePreferencePath())&&window.sessionStorage&&h._storeExpansions(c)}};return d},render:function(a,b){b.classList.add("navRow");this.renderRow(a,b)},rowsChanged:function(){"cursorOnly"!==this.explorer.selectionPolicy&&(this.explorer.refreshSelection(),this.explorer.initNavHandler());(n.$(".sectionTreeTable",this.tableNode.parentNode)||n.$(".treetable",this.tableNode.parentNode))&&n.$$array(".treeTableRow",this.tableNode).forEach(function(a,b){var c=!(b%
2)?"darkSectionTreeTableRow":"lightSectionTreeTableRow",e="darkSectionTreeTableRow"===c?"lightSectionTreeTableRow":"darkSectionTreeTableRow";a.classList.add(c);a.classList.remove(e)})},updateCommands:function(){if(this.commandService)for(var a=n.$$array(".treeTableRow"),b=0;b<a.length;b++){var c=a[b],e=n.node(c.id+"actionswrapper");this.commandService.destroy(e);this.actionScopeId&&this.commandService.renderCommands(this.actionScopeId,e,c._item,this.explorer,"tool")}},_initializeUIState:function(){this._expanded=
[];var a=this._getUIStatePreferencePath();a&&window.sessionStorage&&this._restoreExpansions(a)&&this._restoreSelections(a)}};return b}();b.SelectionRenderer=function(){function d(a,b){this._init(a);this.explorer=b}d.prototype=new b.ExplorerRenderer;d.prototype.renderTableHeader=function(a){var b=document.createElement("thead"),c=document.createElement("tr");b.classList.add("navTableHeading");this._useCheckboxSelection&&c.appendChild(this.initCheckboxColumn(a));for(var e=0,d=this.getCellHeaderElement(e);d;)0<
d.innerHTML.length&&d.classList.add("navColumn"),c.appendChild(d),d=this.getCellHeaderElement(++e);b.appendChild(c);0<e&&a.appendChild(b)};d.prototype.renderRow=function(a,b){b.verticalAlign="baseline";b.classList.add("treeTableRow");"cursorOnly"!==this.explorer.selectionPolicy&&b.classList.add("selectableNavRow");var c=this.explorer.getNavDict();if(c){c.addRow(a,b);var e=this;b.addEventListener("click",function(c){if(e.explorer.getNavHandler())e.explorer.getNavHandler().onClick(a,c)},!1)}if(c=this.getCheckboxColumn(a,
b))c.classList.add("checkColumn"),b.appendChild(c);for(var c=0,d=this.getCellElement(c,a,b);d;)b.appendChild(d),0===c?this.getPrimColumnStyle?d.classList.add(this.getPrimColumnStyle(a)):d.classList.add("navColumn"):this.getSecondaryColumnStyle?d.classList.add(this.getSecondaryColumnStyle()):d.classList.add("secondaryColumn"),d=this.getCellElement(++c,a,b)};d.prototype.getCellHeaderElement=function(a){};d.prototype.getCellElement=function(a,b,c){};return d}();b.SimpleFlatModel=function(){function d(a,
b,c){this.items=a;this.getKey=c;this.idPrefix=b;this.root={children:a}}d.prototype=new b.ExplorerModel;d.prototype.getRoot=function(a){a(this.root)};d.prototype.getId=function(a){a=this.getKey(a).replace(/[\\\/]/g,"");for(var b="",c=0;c<a.length;c++)b=a[c].match(/[^\.\:\-\_0-9A-Za-z]/g)?b+a.charCodeAt(c):b+a[c];return this.idPrefix+b};d.prototype.getChildren=function(a,b){a===this.root?b(this.items):b([])};return d}();return b});
define("orion/PageLinks","require orion/Deferred orion/PageUtil orion/URITemplate orion/i18nUtil orion/objects orion/URL-shim".split(" "),function(k,m,n,d,h,l,b){function f(){return k.toUrl?(new URL(k.toUrl("orion/../"),window.location.href)).href.slice(0,-1):(new URL("/",window.location.href)).href.slice(0,-1)}function a(a){var c={};a.getPropertyKeys().forEach(function(b){"objectClass"!==b&&"service.names"!==b&&"service.id"!==b&&"__plugin__"!==b&&(c[b]=a.getProperty(b))});return c}function g(a){return h.getMessageBundle(a.nls).then(function(c){a.textContent=
a.nameKey?c[a.nameKey]:a.name;return a},function(c){a.textContent=a.nameKey||a.name;return a})}function c(c,b){var e=c.getServiceReferences(b||"orion.page.link"),h=n.matchResourceParameters(window.location.href),l={OrionHome:f(),Location:h.resource},k=[];e.forEach(function(c){c=a(c);if(c.uriTemplate&&(c.nls||c.name)){var b=(new d(c.uriTemplate)).expand(l),b=n.validateURLScheme(b);c.href=b;c.nls?k.push(g(c)):(c.textContent=c.name,k.push((new m).resolve(c)))}});return m.all(k)}function e(a){var c=this.categories=
Object.create(null);a.forEach(function(a){c[a.id]=a})}function p(a){this.allPageLinks=a;this.allPageLinks.sort(r)}function r(a,c){var b=a.textContent&&a.textContent.toLowerCase(),e=c.textContent&&c.textContent.toLowerCase();return b<e?-1:b>e?1:0}var q;l.mixin(e.prototype,{getCategoryIDs:function(){return Object.keys(this.categories)},getCategory:function(a){return this.categories[a]||null}});l.mixin(p.prototype,{createLinkElements:function(){return this.allPageLinks.map(function(a){var c=a.href;a=
a.textContent;var b=document.createElement("a");b.href=c;b.target="_self";b.classList.add("targetSelector");b.textContent=a;return b})},getAllLinks:function(){return this.allPageLinks}});return{getCategoriesInfo:function(c){var b;return!q?(b=[],c.getServiceReferences("orion.page.link.category").forEach(function(c){c=a(c);if(c.id&&(c.name||c.nameKey))c.nls?b.push(g(c)):(c.textContent=c.name,b.push((new m).resolve(c)))}),m.all(b).then(function(a){return q=new e(a)})):(new m).resolve(q)},getPageLinksInfo:function(a,
b){return c(a,b).then(function(a){return new p(a)})},getOrionHome:f}});
define("orion/edit/nls/root/messages",{Editor:"Editor",switchEditor:"Switch Editor",Fetching:"Fetching: ${0}",confirmUnsavedChanges:"There are unsaved changes.  Do you still want to navigate away?",searchFiles:"Search Files...",searchTerm:"Enter search term:",unsavedChanges:"There are unsaved changes.",unsavedAutoSaveChanges:"Please stay on the page until Auto Save is complete.",Save:"Save",Saved:"Saved",Blame:"Blame",BlameTooltip:"Show blame annotations",saveOutOfSync:"Resource is out of sync with the server. Do you want to save it anyway?",
loadOutOfSync:"Resource is out of sync with the server. Do you want to load it anyway? This will overwrite your local changes.",ReadingMetadata:"Reading metadata of ${0}",ReadingMetadataError:"Can not get metadata of ${0}",Reading:"Reading ${0}",readonly:"Read Only.",saveFile:"Save this file",gotoLine:"Go to Line...",gotoLineTooltip:"Go to specified line number",gotoLinePrompt:"Go to line:",Undo:"Undo",Redo:"Redo",Find:"Find...",noResponse:"No response from server.  Check your internet connection and try again.",
savingFile:"Saving file ${0}",running:"Running ${0}","Saving...":"Saving...",View:"View",SidePanel:"Side Panel",SidePanelTooltip:"Choose what to show in the side panel.",Actions:"Actions",Navigator:"Navigator",FolderNavigator:"Folder Navigator",Project:"Project",New:"New",File:"File",Edit:"Edit",Tools:"Tools",Add:"Add",noActions:"There are no actions for the current selection.",NoFile:"Use the ${0} to create new files and folders. Click a file to start coding.",LocalEditorSettings:"Local Editor Settings",
NoProject:"${0} is not a project. To convert it to a project use ${1}.",NoProjects:"There are no projects in your workspace. Use the ${0} menu to create projects.",disconnected:"(disconnected)",ChooseFS:"Choose Filesystem",ChooseFSTooltip:"Choose the filesystem you want to view.",FSTitle:"${0} (${1})",Deploy:"Deploy","Deploy As":"Deploy As",Import:"Import",Export:"Export",OpenWith:"Open With",OpenRelated:"Open Related",Dependency:"Dependency",UnnamedCommand:"Unnamed"});
define("orion/edit/nls/messages",["orion/i18n!orion/edit/nls/messages","orion/edit/nls/root/messages"],function(k,m){var n={root:m};Object.keys(k).forEach(function(d){"undefined"===typeof n[d]&&(n[d]=k[d])});return n});
define("orion/extensionCommands","require orion/Deferred orion/commands orion/regex orion/contentTypes orion/URITemplate orion/i18nUtil orion/URL-shim orion/PageLinks i18n!orion/edit/nls/messages".split(" "),function(k,m,n,d,h,l,b,f,a,g){function c(a){var c={};a.getPropertyKeys().forEach(function(b){c[b]=a.getProperty(b)});return c}var e={},p=a.getOrionHome();e._cloneItemWithoutChildren=function w(a){if(null===a||"object"!==typeof a)return a;var c=a.constructor(),b;for(b in a)"children"!==b&&"Children"!==
b&&(c[b]=w(a[b]));return c};e._getOpenWithNavCommandExtensions=function(a,c){function b(a,c){for(var e=a.getServiceReferences("orion.navigate.openWith"),g=[],d=[],h=0;h<e.length;h++){var f=e[h];if(f.getProperty("editor")===c.id){var l=f.getProperty("contentType");l instanceof Array?g=g.concat(l):g.push(l||"*/*");f=f.getProperty("excludedContentTypes");f instanceof Array?d=d.concat(f):null!==f&&"undefined"!==typeof f&&d.push(f)}}0===g.length&&(g=null);0===d.length&&(d=null);return{contentTypes:g,excludedContentTypes:d}}
for(var e=function(){for(var c=a.getServiceReferences("orion.edit.editor"),b=[],e=0;e<c.length;e++){var g=c[e],d=g.getProperty("id");b.push({id:d,"default":g.getProperty("default")||!1,name:g.getProperty("name"),nameKey:g.getProperty("nameKey"),nls:g.getProperty("nls"),uriTemplate:g.getProperty("orionTemplate")||g.getProperty("uriTemplate"),validationProperties:g.getProperty("validationProperties")||[]})}return b}(),g=[],d=0;d<e.length;d++){var h=e[d],f=b(a,h);g.push({properties:{name:h.name||h.id,
nameKey:h.nameKey,id:"eclipse.openWithCommand."+h.id,contentType:f.contentTypes,excludedContentTypes:f.excludedContentTypes,uriTemplate:h.uriTemplate,nls:h.nls,forceSingleItem:!0,isEditor:h["default"]?"default":"editor",validationProperties:h.validationProperties},service:{}})}return g};e._makeValidator=function(a,c,b,e){function g(a,c,b,e,d){var h=!1,f;if("!"===c.charAt(0))return"undefined"===typeof a[c.substring(1)];if("undefined"!==typeof a[c]){if("undefined"===typeof b)f=a[c],h=!0;else if("string"===
typeof b){if(!typeof("string"===a[c]))return!1;if(e.variableName){if(b=RegExp(b).exec(a[c]))h=b[0],f="before"===e.variableMatchPosition?a[c].substring(0,b.index):"after"===e.variableMatchPosition?a[c].substring(b.index+h.length):"only"===e.variableMatchPosition?h:a[c],h=!0}else return RegExp(b).test(a[c])}else a[c]===b&&(f=a[c],h=!0);c=e.variableName;e=e.replacements;if(h&&c&&(d[c]=f,d.itemCached=a,e)){if("string"!==typeof f)return window.console.log("Cannot replace "+c+", value is not a string: "+
f),h;for(a=0;a<e.length;a++){f=!1;if(e[a].pattern){b=e[a].pattern;var l=e[a].replacement||"";d[c]=d[c].replace(RegExp(b),l).replace(RegExp(b),l)}else f=!0;f&&window.console.log("Invalid replacements specified in validation property.  "+e[a])}}return h}return!1}function d(a,c,b,e){var h=b.match,f,l;if(0<=(f=c.indexOf("["))){if(0>(l=c.indexOf("]")))return!1;var k=c.substring(0,f),p;if(!(p=a[k])||!Array.isArray(p))return!1;f=c.substring(f+1,l);f=parseInt(f,10);if(isNaN(f))return!1;0>f&&(f+=p.length);
c=c.substring(l+1);c=k+":"+String(f)+c}return 0<=c.indexOf("|")?(f=c.substring(0,c.indexOf("|")),c=c.substring(c.indexOf("|")+1),d(a,f,b,e)?!0:d(a,c,b,e)):0<=c.indexOf(":")?(f=c.substring(0,c.indexOf(":")),c=c.substring(c.indexOf(":")+1),a[f]?d(a[f],c,b,e):!1):g(a,c,h,b,e)}function f(c,b,e){if(e.info.validationProperties)for(var g=0;g<e.info.validationProperties.length;g++){var l=e.info.validationProperties[g];if("undefined"!==typeof l.source){if(!d(c,l.source,l,e))return!1}else return window.console.log("Invalid validationProperties in "+
a.id+".  No source property specified."),!1}var g=!0,k=b?h.getFilenameContentType(c.Name,b):null,k=k||{id:"application/octet-stream"};e.info.excludedContentTypes&&b&&(g=e.info.excludedContentTypes.every(function(a){a=a.replace(/([*?])/g,".$1");return-1!==k.id.search(a)?!1:!0}));g&&e.info.contentType&&b&&(g=e.info.contentType.some(function(a){a=a.replace(/([*?])/g,".$1");return-1!==k.id.search(a)?!0:!1}));return g}return{info:a,validationFunction:function(a){"function"===typeof e&&(a=e.call(this,a));
if(a){if(Array.isArray(a)){if((this.info.forceSingleItem||this.info.uriTemplate)&&1!==a.length||1>a.length)return!1}else a=[a];for(var c=0;c<a.length;c++)if(!f(a[c],b,this))return!1;return!0}return!1},generatesURI:function(){return!!this.info.uriTemplate},getURI:function(a){if(this.info.uriTemplate){var c={},b;for(b in a)Object.prototype.hasOwnProperty.call(a,b)&&(c[b]=a[b]);if(this.info.validationProperties)for(b=0;b<this.info.validationProperties.length;b++){var e=this.info.validationProperties[b];
e.source&&e.variableName&&(this.itemCached===a&&this[e.variableName]||d(a,e.source,e,this),a[e.variableName]?window.console.log("Variable name "+e.variableName+" in the extension "+this.info.id+" conflicts with an existing property in the item metadata."):c[e.variableName]=this[e.variableName])}c.OrionHome=p;return(new l(this.info.uriTemplate)).expand(c)}return null}}};var r=g.UnnamedCommand;e._createCommandOptions=function(a,c,g,d,f,h){function l(b,k){var p=e._makeValidator(a,g,d,h);b.visibleWhen=
p.validationFunction.bind(p);if(f)if(p.generatesURI.bind(p)())b.hrefCallback=function(a){a=Array.isArray(a.items)?a.items[0]:a.items;return p.getURI.bind(p)(a)};else{var m=a;b.callback=function(a){var d;if(m.forceSingleItem)a=Array.isArray(a.items)?a.items[0]:a.items,d=e._cloneItemWithoutChildren(a);else if(Array.isArray(a.items)){d=[];for(var f=0;f<a.items.length;f++)d.push(e._cloneItemWithoutChildren(a.items[f]))}else d=e._cloneItemWithoutChildren(a.items);if(g)var h=g.getService("orion.page.progress");
c.run?h?h.progress(c.run(d),"Running command: "+b.name):c.run(d):g&&(h?h.progress(g.getService(c).run(d),"Running command: "+b.name):g.getService(c).run(d))}}k.resolve(b)}var k=new m;if(a.nls){var p=function(c){var b;c?(b=a.tooltipKey&&c[a.tooltipKey],c=a.nameKey&&c[a.nameKey]||a.name||r,b=b||a.tooltip||""):(c=a.name||a.nameKey||r,b=a.tooltip||a.tooltipKey||"");l({name:c,image:a.image,id:a.id||a.name,tooltip:b,isEditor:a.isEditor,showGlobally:a.showGlobally},k)};b.getMessageBundle(a.nls).then(p,p.bind(this,
null))}else l({name:a.name,image:a.image,id:a.id||a.name,tooltip:a.tooltip,isEditor:a.isEditor,showGlobally:a.showGlobally},k);return k};e.getOpenWithCommand=function(a,c,b){var g;a=b||e.getOpenWithCommands(a);for(b=0;b<a.length;b++)if(a[b].visibleWhen(c)){var d="default"===a[b].isEditor;if(!g||d)if(g=a[b],d)break}return g};e.getOpenWithCommands=function(a){var c=[],b;for(b in a._commandList){var e=a._commandList[b];e.isEditor&&c.push(e)}return c};var q;e.createAndPlaceFileCommandsExtension=function(a,
c,b,d,f,h){return e.createFileCommands(a,null,h?"all":void 0,!!h,c).then(function(a){f&&0<a.length&&(c.addCommandGroup(b,"eclipse.openWith",1E3,g.OpenWith,f,null,null,null,"dropdownSelection"),c.addCommandGroup(b,"eclipse.fileCommandExtensions",1E3,g.OpenRelated,f));a.forEach(function(a){var e=null;f&&(e=a.isEditor?f+"/eclipse.openWith":f+"/eclipse.fileCommandExtensions");c.registerCommandContribution(b,a.id,d,e)});return{}})};e.createFileCommands=function(a,c,b,g,d){b=void 0===b?"global":b;g=void 0===
g?!0:g;var f=[];e._cachedFileCommands||e._createCachedFileCommands(a);("all"===b||"global"===b)&&e._cachedFileCommands.forEach(function(a){var c=a.properties;("all"===b||c.forceSingleItem&&c.showGlobally)&&f.push(a)});return m.when(function(){var b=a.getService("orion.core.contentTypeRegistry")||c;return q||m.when(b.getContentTypes(),function(a){return q=a})}(),function(){g&&(e._cachedOpenWithExtensions||(e._cachedOpenWithExtensions=e._getOpenWithNavCommandExtensions(a,q)),f=f.concat(e._cachedOpenWithExtensions),
d._addedOpenWithCommands=g);var c=f.map(function(c){var b=c.properties;c=c.service;var g=d.findCommand(b.id||b.name);return g?(new m).resolve(g):e._createCommandOptions(b,c,a,q,!0).then(function(a){a=new n.Command(a);d.addCommand(a);return a})});return m.all(c,function(a){return{_error:a}}).then(function(a){return a})})};e._createCachedFileCommands=function(a){var b=a.getServiceReferences("orion.navigate.command");e._cachedFileCommands=[];for(var g=0;g<b.length;g++)if("orion.navigateFromMetadata"!==
b[g].getProperty("id")){var d=a.getService(b[g]),f=c(b[g]);e._cachedFileCommands.push({properties:f,service:d})}};e.getFileCommandIds=function(){var a=[];if(e._cachedFileCommands)e._cachedFileCommands.length&&(a=e._cachedFileCommands.map(function(a){return a.properties.id}));else throw"extensionCommandUtils._cachedFileCommands is not initialized";return a};e.createOpenWithCommands=function(a,c,b){return b&&b._addedOpenWithCommands?(new m).resolve(e.getOpenWithCommands(b)):e.createFileCommands(a,c,
"none",!0,b)};return e});
define("orion/explorers/navigatorRenderer","i18n!orion/navigate/nls/messages orion/Deferred orion/explorers/explorer orion/explorers/navigationUtils orion/extensionCommands orion/objects orion/URITemplate orion/webui/littlelib".split(" "),function(k,m,n,d,h,l,b,f){function a(a){switch(a&&a.id){case "image/jpeg":case "image/png":case "image/gif":case "image/ico":case "image/tiff":case "image/svg":return!0}return!1}function g(c,g,d,f,k,n,t,v,A){g=l.clone(g);var z;if(g.Directory)z=document.createElement("a"),
z.className="navlinkonpage",z.href=!c?e:(new b(c+"#{,resource,params*}")).expand({resource:g.ChildrenLocation}),g.Name&&z.appendChild(document.createTextNode(g.Name));else{k||(k=h.getOpenWithCommands(d));z=document.createElement("a");z.className="navlink targetSelector";n&&"object"===typeof n&&Object.keys(n).forEach(function(a){z[a]=n[a]});var K=null,D=null;if(K=v?v.holderDom:z)D=document.createElement("span"),D.className="core-sprite-file modelDecorationSprite thumbnail",K.appendChild(D);g.Name&&
z.appendChild(document.createTextNode(g.Name));var F=g.Location;t&&"object"===typeof t&&(g.params={},l.mixin(g.params,t));(c=h.getOpenWithCommand(d,g,k))&&(F=c.hrefCallback({items:g}));m.when(f.getFileContentType(g),function(c){if(K){var b=K,e=D;if(c){var d,f=c.imageClass,h=c.image;f?(d=document.createElement("span"),d.className+=f,d.classList.add("thumbnail")):h&&(d=document.createElement("img"),d.src=h,d.classList.add("thumbnail"));d&&b.replaceChild(d,e)}}z.href=F;A&&"function"===typeof A.updateFileNode&&
A.updateFileNode(g,z,a(c))})}z.addEventListener("click",function(){p=g}.bind(this),!1);return z}function c(a,c,b,e){this.explorer=c;this.commandService=b;this.contentTypeService=e;this.openWithCommands=null;this.actionScopeId=a.actionScopeId;this._init(a);this.target="_self"}var e=new b("#{,resource,params*}"),p;c.prototype=new n.SelectionRenderer;c.prototype.wrapperCallback=function(a){a.setAttribute("role","tree")};c.prototype.tableCallback=function(a){a.setAttribute("aria-label",k.Navigator);a.setAttribute("role",
"presentation")};c.prototype.rowCallback=function(a,c){a.setAttribute("role","treeitem")};c.prototype.emptyCallback=function(a){var c=document.createElement("tr"),b=document.createElement("td");b.colSpan=this.oneColumn?1:3;var e=document.createElement("div");e.classList.add("noFile");e.textContent=k.NoFile;var g=document.createElement("span");g.appendChild(document.createTextNode(k.File));f.processDOMNodes(e,[g]);b.appendChild(e);c.appendChild(b);a.appendChild(c)};c.prototype.getCellHeaderElement=
function(a){if(this.oneColumn&&0!==a)return null;switch(a){case 0:case 1:case 2:document.createElement("th").style.height="8px"}};c.prototype.setTarget=function(a){this.target=a};c.prototype.getFolderImage=function(a){if(!this.showFolderImage)return null;a=document.createElement("span");a.className="core-sprite-folder modelDecorationSprite";return a};c.prototype.createFolderNode=function(a){var c;this.showFolderLinks?(c=g(this.folderLink||"",a,this.commandService,this.contentTypeService),(a=this.getFolderImage(a))&&
c.insertBefore(a,c.firstChild)):(c=document.createElement("span"),c.textContent=a.Name);return c};c.prototype.updateFileNode=function(a,c,b){};c.prototype.showFolderLinks=!0;c.prototype.getCellElement=function(a,c,b){switch(a){case 0:a=document.createElement("td");var e=document.createElement("span");e.id=b.id+"MainCol";e.setAttribute("role","presentation");a.appendChild(e);a.setAttribute("role","presentation");e.className="mainNavColumn";var f;c.Directory?(this.getExpandImage(b,e),f=this.createFolderNode(c),
e.appendChild(f),this.explorer._makeDropTarget(c,f),this.explorer._makeDropTarget(c,b)):(this.openWithCommands||(this.openWithCommands=h.getOpenWithCommands(this.commandService)),f=g("",c,this.commandService,this.contentTypeService,this.openWithCommands,{target:this.target},null,null,this),e.appendChild(f));f&&(f.id=b.id+"NameLink",1===f.nodeType&&(d.addNavGrid(this.explorer.getNavDict(),c,f),f.setAttribute("role","link"),f.setAttribute("tabindex","-1")));this.actionScopeId&&this.commandService.renderCommands(this.actionScopeId,
e,c,this.explorer,"tool",null,!0);return a;case 1:if(this.oneColumn)return null;b=document.createElement("td");c.LocalTimeStamp&&(b.textContent=(new Date(c.LocalTimeStamp)).toLocaleString());return b;case 2:if(this.oneColumn)return null;b=document.createElement("td");!c.Directory&&"number"===typeof c.Length&&(c=parseInt(c.Length,10)/1024,b.textContent=Math.ceil(c).toLocaleString()+" KB");b.style.textAlign="right";return b}};c.prototype.constructor=c;return{NavigatorRenderer:c,isImage:a,getClickedItem:function(){return p},
createLink:g}});
define("orion/searchClient","i18n!orion/search/nls/messages require orion/webui/littlelib orion/i18nUtil orion/searchUtils orion/crawler/searchCrawler orion/explorers/navigatorRenderer orion/extensionCommands orion/Deferred".split(" "),function(k,m,n,d,h,l,b,f,a){function g(a,c){this.serviceRegistry=a;this.commandRegistry=c;this.openWithCommands=null}function c(a){this.registry=a.serviceRegistry;this._commandService=a.commandService;this._fileService=a.fileService;this.defaultRenderer=new g(this.registry,
this._commandService);this._fileService||console.error("No file service on search client")}g.prototype.makeRenderFunction=function(c,g,l,q,s){var w=this.serviceRegistry,u=this.commandRegistry;this.openWithCommands=this.openWithCommands||f.createOpenWithCommands(w,c,u);var y=this;return function(f,w,A,z){a.when(y.openWithCommands,function(a){if(A)n.empty(g),a=document.createElement("div"),a.appendChild(document.createTextNode(k["Search failed."])),g.appendChild(a),"function"===typeof q&&q(g);else{var y=
function(){function a(c,b){var e=b.folderName?b.folderName:b.path,g=document.createElement("span");g.id=e.replace(/[^a-zA-Z0-9_\.:\-]/g,"");g.appendChild(document.createTextNode(" - "+e+" "));c.appendChild(g)}var c={};return function(b,e){var g=e.name;if(c.hasOwnProperty(g)){a(b,e);var d=c[g];"function"===typeof d&&(c[g]=null,d())}else c[g]=function(){a(b,e)}}}(),F=!1;n.empty(g);if(f&&0<f.length){var E=document.createElement("table");E.setAttribute("role","presentation");for(var x=0;x<f.length;x++){var C=
f[x],I;F||(F=!0,l&&(I=E.insertRow(0).insertCell(0),I.textContent=l));I=E.insertRow(-1).insertCell(0);I.colspan=2;s&&s(I);var B={Name:C.name,Directory:C.directory,Location:C.path||C.location},G=null;"number"===typeof C.LineNumber&&(G={},G.line=C.LineNumber);if(z&&z.keyword&&!z.nameSearch){var J=h.generateSearchHelper(z),G=G||{};G.find=J.inFileQuery.searchStr;G.regEx=J.inFileQuery.wildCard?!0:void 0}B=b.createLink(m.toUrl("edit/edit.html"),B,u,c,a,{"aria-describedby":(C.folderName?C.folderName:C.path).replace(/[^a-zA-Z0-9_\.:\-]/g,
""),style:{verticalAlign:"middle"}},G);C.LineNumber&&B.appendChild(document.createTextNode(" (Line "+C.LineNumber+")"));I.appendChild(B);y(I,C)}g.appendChild(E);"function"===typeof q&&q(g)}!F&&w&&(a=d.formatMessage(k["No matches found for ${0}"],w),n.empty(g),g.appendChild(document.createTextNode(a)),"function"===typeof q&&q(g))}})}};c.prototype={search:function(a,c,b){var g=function(a){for(var b=[],e=0;e<a.response.docs.length;e++){var g=a.response.docs[e],d=g.Location,f=h.path2FolderName(g.Path?
g.Path:g.Location,g.Name),l=f?f:d;(c?0<=l.indexOf(c):1)&&b.push({name:g.Name,path:d,folderName:f,directory:g.Directory,lineNumber:g.LineNumber})}return b};if(this._crawler&&a.nameSearch)this._crawler.searchName(a,function(c){b(g(c),a.keyword,null,a)});else try{this.registry.getService("orion.page.progress").progress(this._fileService.search(a),"Searching "+a.keyword).then(function(c){var d=a.keyword,d=d.substring(d.indexOf("}")+1),d=d.substring(d.indexOf(":")+1);b(g(c),d,null,a)},function(a){b(null,
null,a,null)})}catch(d){"string"===typeof d&&-1<d.indexOf("search")&&this._crawler?this._crawler.searchName(a,function(c){b(g(c),null,null,a)}):"string"===typeof d&&-1<d.indexOf("search")&&!a.nameSearch?(new l.SearchCrawler(this.registry,this._fileService,a,{childrenLocation:this.getChildrenLocation()})).search(function(c){b(g(c),null,null,a)}):this.registry.getService("orion.page.message").setErrorMessage(d)}},getFileService:function(){return this._fileService},setCrawler:function(a){this._crawler=
a},handleError:function(a,c){console.error(a);n.empty(c);c.appendChild(document.createTextNode(a));return a},setLocationByMetaData:function(a,c){var b="",g=null;this._searchRootLocation=this._fileService.fileServiceRootURL(a.Location);c&&a&&a.Parents&&0<a.Parents.length?g="last"===c.index?a.Parents[a.Parents.length-1]:a.Parents[0]:a&&a.Directory&&a.Location&&a.Parents&&(g=a);g?(this.setLocationbyURL(g.Location),b=g.Name,this._childrenLocation=g.ChildrenLocation):a&&(this.setLocationbyURL(this._searchRootLocation),
b=this._fileService.fileServiceName(a.Location),this._childrenLocation=a.ChildrenLocation);g=n.node("search");b||(b="");if(g&&g.placeholder){g.value="";var f=d.formatMessage(k["Search ${0}"],b);g.placeholder=30<f.length?f.substring(0,27)+"...":d.formatMessage(k["Search ${0}"],b)}g&&g.title&&(g.title=k["Type a keyword or wild card to search in "]+b)},setLocationbyURL:function(a){this._searchLocation=a},setRootLocationbyURL:function(a){this._searchRootLocation=a},setChildrenLocationbyURL:function(a){this._childrenLocation=
a},getSearchLocation:function(){return this._searchLocation?this._searchLocation:this._fileService.fileServiceRootURL()},getSearchRootLocation:function(){return this._searchRootLocation?this._searchRootLocation:this._fileService.fileServiceRootURL()},getChildrenLocation:function(){return this._childrenLocation?this._childrenLocation:this._fileService.fileServiceRootURL()},createSearchParams:function(a,c,b,g){b=b?this.getSearchRootLocation():this.getSearchLocation();return c?{resource:b,sort:"NameLower asc",
rows:100,start:0,nameSearch:!0,keyword:a}:{resource:b,sort:g&&g.sort?g.sort:"Path asc",rows:g&&g.rows?g.rows:40,start:0,caseSensitive:g?g.caseSensitive:void 0,regEx:g?g.regEx:void 0,fileType:g?g.fileType:void 0,keyword:a,replace:g?g.replace:void 0}}};c.prototype.constructor=c;return{Searcher:c}});define("text!orion/banner/slideout.html",[],function(){return'\x3cdiv id\x3d"slideContainer" class\x3d"slideParameters slideContainer"\x3e\n\t\x3cspan id\x3d"pageCommandParameters" class\x3d"layoutLeft parameters"\x3e\x3c/span\x3e\n\t\x3cspan id\x3d"pageCommandDismiss" class\x3d"layoutRight parametersDismiss"\x3e\x3c/span\x3e\n\x3c/div\x3e'});
define("orion/commonHTMLFragments",["require","orion/webui/littlelib","text!orion/banner/slideout.html"],function(k,m,n){return{slideoutHTMLFragment:function(d){var h=document.createElement("div");h.innerHTML=n;var l=m.$("#slideContainer",h);l.id=d+l.id;l=m.$("#pageCommandParameters",h);l.id=d+l.id;l=m.$("#pageCommandDismiss",h);l.id=d+l.id;return h.innerHTML}}});
define("orion/keyBinding",["orion/util"],function(k){function m(d,h,l,b,f,a){this.type=a||"keydown";this.keyCode="string"===typeof d&&"keydown"===this.type?d.toUpperCase().charCodeAt(0):d;this.mod1=void 0!==h&&null!==h?h:!1;this.mod2=void 0!==l&&null!==l?l:!1;this.mod3=void 0!==b&&null!==b?b:!1;this.mod4=void 0!==f&&null!==f?f:!1}function n(d){this.keys=d}m.prototype={getKeys:function(){return[this]},match:function(d,h){if(void 0!==h){if(0!==h)return!1}else if(d instanceof Array){if(1<d.length)return!1;
d=d[0]}return d.type!==this.type?!1:this.keyCode===d.keyCode||this.keyCode===String.fromCharCode(k.isOpera?d.which:void 0!==d.charCode?d.charCode:d.keyCode)?this.mod1!==(k.isMac?d.metaKey:d.ctrlKey)||"keydown"===this.type&&this.mod2!==d.shiftKey||this.mod3!==d.altKey||k.isMac&&this.mod4!==d.ctrlKey?!1:!0:!1},equals:function(d){return!d||this.keyCode!==d.keyCode||this.mod1!==d.mod1||this.mod2!==d.mod2||this.mod3!==d.mod3||this.mod4!==d.mod4||this.type!==d.type?!1:!0}};n.prototype={getKeys:function(){return this.keys.slice(0)},
match:function(d,h){var l=this.keys;if(void 0!==h)return h>l.length?!1:l[h].match(d)?h===l.length-1?!0:h+1:!1;d instanceof Array||(d=[d]);if(d.length>l.length)return!1;var b;for(b=0;b<d.length;b++)if(!l[b].match(d[b]))return!1;return b===l.length?!0:b},equals:function(d){if(!d.keys||d.keys.length!==this.keys.length)return!1;for(var h=0;h<d.keys.length;h++)if(!d.keys[h].equals(this.keys[h]))return!1;return!0}};return{KeyBinding:m,KeyStroke:m,KeySequence:n}});
define("orion/parameterCollectors",["i18n!orion/nls/messages","require","orion/webui/littlelib"],function(k,m,n){function d(d,l){this._activeContainer=null;this._getElementsFunction=d;this._toolbarLayoutFunction=l}d.prototype={close:function(){if(this._activeElements){this._activeElements.parameterArea&&n.empty(this._activeElements.parameterArea);this._activeElements.slideContainer&&this._activeElements.slideContainer.classList.remove("slideContainerActive");this._activeElements.dismissArea&&n.empty(this._activeElements.dismissArea);
this._activeElements.commandNode&&this._activeElements.commandNode.classList.remove("activeCommand");this._toolbarLayoutFunction(this._activeElements);if(this._activeElements.onClose)this._activeElements.onClose();this._oldFocusNode&&(this._oldFocusNode.focus(),this._oldFocusNode=null)}this._activeElements=null},open:function(d,l,b){"string"===typeof d&&(d=n.node(d));if(this._activeElements&&this._activeElements.slideContainer&&this._activeElements.commandNode===d)return this._activeElements.focusNode&&
this._activeElements.focusNode.focus(),!0;this.close();this._activeElements=null;if((this._activeElements=this._getElementsFunction(d))&&this._activeElements.parameterArea&&this._activeElements.slideContainer){this._activeElements.onClose=b;var f=l(this._activeElements.parameterArea,this._activeElements.dismissArea);if(!f)return!1;this._activeElements.focusNode=f;d=n.$$array("#closebox",this._activeElements.dismissArea||this._activeElements.parameterArea);if(0===d.length){l=this._activeElements.dismissArea||
this._activeElements.parameterArea;d=document.createElement("button");d.id="closebox";d.className="imageSprite core-sprite-close dismissButton";d.title=k.Close;l.appendChild(d);var a=this;d.addEventListener("click",function(b){a.close()},!1)}this._activeElements.slideContainer.classList.add("slideContainerActive");this._toolbarLayoutFunction(this._activeElements);f&&(this._oldFocusNode=window.document.activeElement,window.setTimeout(function(){f.focus();f.select&&f.select()},0));this._activeElements.commandNode&&
this._activeElements.commandNode.classList.add("activeCommand");return!0}return!1},_collectAndCall:function(d,l){n.$$array("input",l).forEach(function(b){"checkbox"===b.type?d.parameters.setValue(b.parameterName,b.checked):"button"!==b.type&&d.parameters.setValue(b.parameterName,b.value.trim())});n.$$array("textArea",l).forEach(function(b){d.parameters.setValue(b.parameterName,b.value.trim())});d.command.callback&&d.command.callback.call(d.handler,d)},collectParameters:function(d){return d.parameters?
(d.domNode&&d.domNode.classList.add("commandMarker"),this.open(d.domNode||d.domParent,this.getFillFunction(d))):!1},getFillFunction:function(d,l){var b=this;return function(f,a){var g=null,c=function(){l&&l();b.close()},e=function(a){a.keyCode===n.KEY.ENTER&&b._collectAndCall(d,f);if(a.keyCode===n.KEY.ESCAPE||a.keyCode===n.KEY.ENTER)c(),n.stop(a)};d.parameters.forEach(function(a){var b=null;a.label&&(b=document.createElement("label"),b.classList.add("parameterInput"),b.setAttribute("for",a.name+"parameterCollector"),
b.textContent=a.label,f.appendChild(b));var l=a.name+"parameterCollector",k,b=b||f;"text"===a.type&&"number"===typeof a.lines&&1<a.lines?(k=document.createElement("textarea"),k.rows=a.lines,k.type="textarea",k.id=l,b.appendChild(k),e=function(a){a.keyCode===n.KEY.ESCAPE&&(c(),n.stop(a))}):"boolean"===a.type?(k=document.createElement("input"),k.type="checkbox",k.id=l,b.appendChild(k),a.value&&(k.checked=!0)):(k=document.createElement("input"),k.type=a.type,k.id=l,b.appendChild(k),a.value&&(k.value=
a.value));k.classList.add("parameterInput");k.setAttribute("speech","speech");k.setAttribute("x-webkit-speech","x-webkit-speech");k.parameterName=a.name;g||(g=k);0<a.eventListeners.length&&a.eventListeners.forEach(function(a){k.addEventListener(a.event,function(c){return a.handler(c,d)},a.capture)});k.addEventListener("keydown",e,!1)});var p=a;p||(p=document.createElement("span"),p.classList.add("layoutRight"),p.classList.add("parametersDismiss"),f.appendChild(p));var m=function(a,c){var b=document.createElement("button");
c.appendChild(b);a&&b.appendChild(document.createTextNode(a));b.classList.add("dismissButton");return b};d.parameters.hasOptionalParameters()&&(d.parameters.optionsRequested=!1,m(k.More,p).addEventListener("click",function(){d.parameters.optionsRequested=!0;b._collectAndCall(d,f);c()},!1));m(k.Submit,p).addEventListener("click",function(){b._collectAndCall(d,f);c()},!1);p=m(null,p);p.id="closebox";p.classList.add("imageSprite");p.classList.add("core-sprite-close");p.title=k.Close;p.addEventListener("click",
function(a){c()},!1);return g}}};d.prototype.constructor=d;return{CommandParameterCollector:d}});
define("orion/breadcrumbs",["require","orion/webui/littlelib"],function(k,m){function n(d){this._init(d)}n.prototype={_init:function(d){var h=m.node(d.container);if(!h)throw"no parent container";this._container=h;h.classList.remove("currentLocation");this._id=d.id||"eclipse.breadcrumbs";this._resource=d.resource||null;this._rootSegmentName=d.rootSegmentName;this._workspaceRootSegmentName=d.workspaceRootSegmentName;this._workspaceRootURL=d.workspaceRootURL;this._makeHref=d.makeHref;this._makeFinalHref=
d.makeFinalHref;this._maxLength=d.maxLength;this.path="";this.measure();this.render()},getNavigatorWorkspaceRootSegment:function(){if(this._workspaceRootSegmentName){var d;if(this._resource&&this._resource.Parents&&!this._resource.skip){d=document.createElement("a");var h=this._workspaceRootURL?this._workspaceRootURL:"";this._makeHref?this._makeHref(d,h):d.href=k.toUrl("edit/edit.html")+"#"+h}else d=document.createElement("span");m.empty(d);d.appendChild(document.createTextNode(this._workspaceRootSegmentName));
return d}return null},MAX_LENGTH:500,INCLUDE_FIRST_SECTION:!0,segments:[],buildSegment:function(d){var h=document.createElement("a");h.classList.add("breadcrumb");h.appendChild(document.createTextNode(d));return h},addSegmentHref:function(d,h){this._makeHref?this._makeHref(d,h.Location,h):d.href=k.toUrl("edit/edit.html")+"#"+h.ChildrenLocation},buildSegments:function(d,h){if(this._resource.Parents){var l=this._resource.Parents.slice(0),b,f;l&&(l=l.slice(0),"reverse"===h&&(l=l.reverse().slice(0)),
l.forEach(function(a){a.skip||(d?(f=d,d=null):f=a.Name,b=this.buildSegment(f),this.path+=a.Name,this.addSegmentHref(b,a),b.include=!1,this.segments.push(b))}.bind(this)))}},addDivider:function(){var d=document.createElement("span");d.appendChild(document.createTextNode(" / "));this.path+="/";d.classList.add("breadcrumbSeparator");this.append(d)},refresh:function(){(this.crumbs=m.node(this._id))?m.empty(this.crumbs):(this.crumbs=document.createElement("span"),this.crumbs.id=this._id,this._container.appendChild(this.crumbs),
this.dirty=document.createElement("span"),this.dirty.id="dirty",this.dirty.className="modifiedFileMarker",this._container.appendChild(this.dirty));this.crumbs.style.width="auto";this.crumbs.style.visibility="visible";this.crumbs.parentNode.className="currentLocation";this.crumbs.parentNode.style.width="auto"},append:function(d){this.crumbs.appendChild(d)},addTitle:function(d,h){var l=h||document.title;0===this.crumbs.childNodes.length&&(d=document.createElement("span"),d.appendChild(document.createTextNode(l)),
d.classList.add("breadcrumb"),d.classList.add("currentLocation"),this.append(d))},finalSegment:function(d,h){if(!this._resource.skip){var l;l=h?h:this._resource.Name;this._makeFinalHref?(d=this.buildSegment(l),this.addSegmentHref(d,this._resource)):(d=document.createElement("span"),d.appendChild(document.createTextNode(l)));d.classList.add("currentLocation");this.path+=this._resource.Name;this.append(d)}},firstSegment:function(d){d&&(this.append(d),this._resource&&this._resource.Parents&&!this._resource.skip?
(d.classList.add("breadcrumb"),this.addDivider()):(this._resource.skip||(d.href=""),d.classList.add("currentLocation")))},drawSegments:function(){this._resource.Parents&&this.segments.slice(0).forEach(function(d){!0===d.include&&(this.append(d),this.addDivider())}.bind(this))},measureSegments:function(){this.INCLUDE_FIRST_SECTION=!0;if(this._resource.Parents){var d=this.segments.slice(0).reverse();d.forEach(function(d){this.append(d);this.addDivider();this.crumbs.offsetWidth<this.MAX_LENGTH?d.include=
!0:this.INCLUDE_FIRST_SECTION=!1}.bind(this));this.segments=d.reverse()}},measure:function(){var d=this._container;d.style.width="auto";this.MAX_LENGTH=this._maxLength?this._maxLength:d.offsetWidth;this.refresh();this.segments=[];this.crumbs.style.visibility="hidden";var d=this.getNavigatorWorkspaceRootSegment(),h=this._rootSegmentName;h?this.addTitle(d,h):(this.finalSegment(d,h),this._resource&&this._resource.Parents&&(this.buildSegments(h,"reverse"),this.measureSegments(),this.firstSegment(d)),
this.crumbs.offsetWidth>=this.MAX_LENGTH&&(this.INCLUDE_FIRST_SECTION=!1))},render:function(){this.refresh();var d=this.getNavigatorWorkspaceRootSegment(),h=this._rootSegmentName;h?this.addTitle(d,h):(!0===this.INCLUDE_FIRST_SECTION&&this.firstSegment(d),this._resource&&this._resource.Parents&&(this.drawSegments(),this.finalSegment(d,h)));this.crumbs.parentNode.style.width=this.crumbs.offsetWidth+20+"px"}};n.prototype.constructor=n;return{BreadCrumbs:n}});
define("orion/webui/splitter",["require","orion/EventTarget","orion/webui/littlelib"],function(k,m,n){function d(d){m.attach(this);this._init(d)}d.prototype={_init:function(d){this._tracking=null;this._animationDelay=501;this._closeReversely=d.closeReversely;this.$node=n.node(d.node);if(!this.$node)throw"no dom node for splitter found";this.$sideNode=n.node(d.sidePanel);if(!this.$sideNode)throw"no dom node for side panel found";this.$mainNode=n.node(d.mainPanel);if(!this.$mainNode)throw"no dom node for main panel found";
this._vertical=d.vertical;this._prefix="/orion/splitter/"+(this.$node.id||document.body.id||"");d.toggle&&(this._thumb=document.createElement("div"),this.$node.appendChild(this._thumb),this._thumb.classList.add("splitThumb"),this._thumb.classList.add(this._vertical?"splitVerticalThumbLayout":"splitThumbLayout"));this._closeByDefault="closed"===this.$node.getAttribute("data-initial-state");"undefined"!==typeof d.closeByDefault&&(this._closeByDefault=d.closeByDefault);this._initializeFromStoredSettings();
this._closed?(this._closed=!1,this._thumbDown(!0,!0)):this._adjustToSplitPosition();this.$node.style.visibility="visible";this.$mainNode.style.display="block";this.$sideNode.style.display="block";this.$node.addEventListener("mousedown",this._mouseDown.bind(this),!1);window.addEventListener("mouseup",this._mouseUp.bind(this),!1);window.addEventListener("resize",this._resize.bind(this),!1)},isClosed:function(){return this._closed},toggleSidePanel:function(){this._thumbDown()},openSidePanel:function(){this._closed||
this._thumbDown()},addResizeListener:function(d){this.addEventListener("resize",function(l){d(l.node)})},_initializeFromStoredSettings:function(){var d=localStorage.getItem(this._prefix+"/toggleState");this._closed="string"===typeof d?"closed"===d:this._closeByDefault;var d=n.bounds(this.$node.parentNode),l=n.bounds(this.$node),b;this._vertical?(b=localStorage.getItem(this._prefix+"/yPosition"))?(this._splitTop=parseInt(b,10),this._splitTop>d.top+d.height-l.height&&(this._splitTop=d.top+d.height/
2)):this._closeByDefault&&(this._initialSplit=this._getSplitPosition(),this._splitTop=0):(b=localStorage.getItem(this._prefix+"/xPosition"))?(this._splitLeft=parseInt(b,10),this._splitLeft>d.left+d.width-l.width&&(this._splitLeft=d.left+d.width/2)):this._closeByDefault&&(this._initialSplit=this._getSplitPosition(),this._splitLeft=0)},_getSplitPosition:function(){var d=n.bounds(this.$node),l=n.bounds(this.$node.parentNode);return this.vertical?d.top-l.top:d.left-l.left},_adjustToSplitPosition:function(d){var l=
n.bounds(this.$node),b=n.bounds(this.$node.parentNode);if(this._vertical){this._splitHeight=l.height;if(d||!this._splitTop)this._splitTop=l.top,localStorage.setItem(this._prefix+"/yPosition",this._splitTop);d=this._splitTop;"relative"===this.$node.parentNode.style.position&&(d=this._splitTop-b.top);this.$sideNode.style.height=d+"px";this.$sideNode.style.display="block";this.$node.style.top=d+"px"}else{this._splitWidth=l.width;if(d||!this._splitLeft)this._splitLeft=l.left,localStorage.setItem(this._prefix+
"/xPosition",this._splitLeft);d=this._splitLeft;"relative"===this.$node.parentNode.style.position&&(d=this._splitLeft-b.left);this.$sideNode.style.width=d+"px";this.$sideNode.style.display="block";this.$node.style.left=d+"px"}this._resize()},_resize:function(d,l,b){d=d||0;var f=n.bounds(this.$node.parentNode),a=n.bounds(this.$node);this._vertical?(void 0===b&&(b=a.top-f.top),b+=a.height,this.$mainNode.style.top=b+"px"):(void 0===l&&(l=a.left-f.left),l+=a.width,this.$mainNode.style.left=l+"px");var g=
this;window.setTimeout(function(){g._notifyResizeListeners(g.$mainNode);g._notifyResizeListeners(g.$sideNode)},d)},_notifyResizeListeners:function(d){this.dispatchEvent({type:"resize",node:d})},_notifyToggleListeners:function(){this.dispatchEvent({type:"toggle",closed:this._closed})},_thumbDown:function(d,l){d||this._addAnimation();var b=this._splitTop,f=this._splitLeft;if(this._closed)this._closed=!1,!this._splitLeft&&!this._splitTop&&"number"===typeof this._initialSplit&&(b=f=this._initialSplit);
else if(this._closed=!0,this._closeReversely){var a=n.bounds(this.$node.parentNode),g=n.bounds(this.$node);this._vertical?b=a.height-g.height:f=a.width-g.width}else b=f=0;this._vertical?(this.$sideNode.style.height=b+"px",this.$node.style.top=b+"px"):(this.$sideNode.style.width=f+"px",this.$node.style.left=f+"px");this._resize(this._animationDelay,f,b);d||this._removeAnimation();l||localStorage.setItem(this._prefix+"/toggleState",this._closed?"closed":null);var c=this;window.setTimeout(function(){c._notifyToggleListeners()},
this._animationDelay)},_removeAnimation:function(){var d=this;window.setTimeout(function(){d.$sideNode.classList.remove(d._vertical?"sidePanelVerticalLayoutAnimation":"sidePanelLayoutAnimation");d.$mainNode.classList.remove(d._vertical?"mainPanelVerticalLayoutAnimation":"mainPanelLayoutAnimation");d.$node.classList.remove(d._vertical?"splitVerticalLayoutAnimation":"splitLayoutAnimation")},this._animationDelay)},_addAnimation:function(){this.$sideNode.classList.add(this._vertical?"sidePanelVerticalLayoutAnimation":
"sidePanelLayoutAnimation");this.$mainNode.classList.add(this._vertical?"mainPanelVerticalLayoutAnimation":"mainPanelLayoutAnimation");this.$node.classList.add(this._vertical?"splitVerticalLayoutAnimation":"splitLayoutAnimation")},_mouseDown:function(d){if(d.target===this._thumb)return n.stop(d),this._thumbDown();this._tracking||(this.$node.classList.add("splitTracking"),this.$mainNode.classList.add("panelTracking"),this.$sideNode.classList.add("panelTracking"),this._tracking=this._mouseMove.bind(this),
window.addEventListener("mousemove",this._tracking),n.setFramesEnabled(!1),n.stop(d))},_mouseMove:function(d){if(this._tracking){var l=n.bounds(this.$node.parentNode);if(this._vertical){this._splitTop=d.clientY;this._splitTop<l.top+5?this._splitTop=l.top+5:this._splitTop>l.top+l.height-5&&(this._splitTop=l.top+l.height-5);var b=this._splitTop,b=this._splitTop-l.top;this.$node.style.top=b+"px"}else this._splitLeft=d.clientX,this._splitLeft<l.left+5?this._splitLeft=l.left+5:this._splitLeft>l.left+l.width-
5&&(this._splitLeft=l.left+l.width-5),b=this._splitLeft-2*l.left,this.$node.style.left=b+"px";this._adjustToSplitPosition(!0);n.stop(d)}},_mouseUp:function(d){this._tracking&&(n.setFramesEnabled(!0),window.removeEventListener("mousemove",this._tracking),this._tracking=null,this.$node.classList.remove("splitTracking"),this.$mainNode.classList.remove("panelTracking"),this.$sideNode.classList.remove("panelTracking"),n.stop(d))}};d.prototype.constructor=d;return{Splitter:d}});
define("orion/keyAssist",["i18n!orion/nls/messages","orion/webui/littlelib","orion/util"],function(k,m,n){function d(d){this.commandRegistry=d.commandRegistry;this.create();this._filterString="";this._providers=[]}d.prototype={addProvider:function(d){this._providers.push(d)},create:function(){var d=this._keyAssistDiv=document.createElement("div");d.id="keyAssist";d.style.display="none";d.classList.add("keyAssistFloat");d.setAttribute("role","menu");var l=this._keyAssistInput=document.createElement("input");
l.classList.add("keyAssistInput");l.type="text";l.placeholder=k["Filter bindings"];d.appendChild(l);var b=this._keyAssistContents=document.createElement("div");b.classList.add("keyAssistContents");if(n.isIOS||n.isAndroid)b.style.overflowY="auto";d.appendChild(b);var f=this._keyAssistTable=document.createElement("table");f.tabIndex=0;f.classList.add("keyAssistList");b.appendChild(f);document.body.appendChild(d);l.addEventListener("keydown",function(a){this._keyDown(a)}.bind(this));f.addEventListener("keydown",
function(a){this._keyDown(a)}.bind(this));l.addEventListener("input",function(a){this.filterChanged()}.bind(this));b.addEventListener(n.isFirefox?"DOMMouseScroll":"mousewheel",function(a){this._scrollWheel(a)}.bind(this));document.addEventListener("keydown",function(a){a.keyCode===m.KEY.ESCAPE&&this.hide()}.bind(this));m.addAutoDismiss([d],function(){this.hide()}.bind(this))},createContents:function(){m.empty(this._keyAssistTable);this._selectedIndex=-1;this._selectedRow=null;for(var d=this._idCount=
this._keyAssistContents.scrollTop=0;d<this._providers.length;d++)this._providers[d].showKeyBindings(this);this.createHeader(k.Global);this.commandRegistry.showKeyBindings(this)},createItem:function(d,l,b){if(this._filterString){var f=this._filterString.toLowerCase(),a;f!==this._filterString?(f=this._filterString,a=function(a){return a}):a=function(a){return a.toLowerCase()};if(-1===a(l).indexOf(f)&&-1===a(d).indexOf(f)&&-1===a(this._lastHeader).indexOf(f))return}var g=this._keyAssistTable.insertRow(-1);
g.id="keyAssist-keyBinding-"+this._idCount++;g.setAttribute("role","menuitem");g._execute=b;g.classList.add("keyAssistItem");g.addEventListener("click",function(a){this._selectedRow=g;this.execute();a.preventDefault()}.bind(this));b=g.insertCell(-1);b.classList.add("keyAssistName");b.appendChild(document.createTextNode(l));b=g.insertCell(-1);b.classList.add("keyAssistAccel");b.appendChild(document.createTextNode(d))},createHeader:function(d){this._lastHeader=d;var l=this._keyAssistTable.insertRow(-1);
l.classList.add("keyAssistSection");var l=l.insertCell(-1),b=document.createElement("h2");b.appendChild(document.createTextNode(d));l.appendChild(b)},execute:function(){window.setTimeout(function(){this.hide();var d=this._selectedRow;this._selectedRow=null;d&&d._execute&&d._execute()}.bind(this),0)},filterChanged:function(){this._timeout&&window.clearTimeout(this._timeout);this._timeout=window.setTimeout(function(){this._timeout=null;var d=this._keyAssistInput.value;this._filterString!==d&&(this._filterString=
d,this.createContents())}.bind(this),100)},hide:function(){if(this.isVisible()){var d=document.activeElement,l=this._keyAssistDiv,d=l===d||0!==(l.compareDocumentPosition(d)&16);l.style.display="none";d&&1!==document.compareDocumentPosition(this._previousActiveElement)&&this._previousActiveElement.focus();this._previousActiveElement=null}},isVisible:function(){return"block"===this._keyAssistDiv.style.display},removeProvider:function(d){d=this._providers.indexOf(d);-1!==d&&this._providers.splice(d,
1)},select:function(d){var l=this._keyAssistTable.querySelectorAll(".keyAssistItem");if(0===l.length)this._selectedIndex=-1;else{var b=this._selectedIndex,b=(b+(d?1:-1))%l.length;0>b&&(b=l.length-1);-1!==this._selectedIndex&&(d=l[this._selectedIndex],d.classList.remove("selected"),this._selectedRow=null);this._selectedIndex=b;if(-1!==this._selectedIndex){this._selectedRow=d=l[this._selectedIndex];d.classList.add("selected");this._keyAssistTable.setAttribute("aria-activedescendant",d.id);this._keyAssistTable.focus();
var l=d.getBoundingClientRect(),f=this._keyAssistContents,a=f.getBoundingClientRect();d.offsetTop<f.scrollTop?0===b?f.scrollTop=0:d.scrollIntoView(!0):l.bottom>a.bottom&&d.scrollIntoView(!1)}}},show:function(){this.isVisible()||(this._previousActiveElement=document.activeElement,this.createContents(),this._keyAssistContents.style.height=Math.floor(0.75*this._keyAssistDiv.parentNode.clientHeight)+"px",this._keyAssistDiv.style.display="block",this._keyAssistInput.value=this._filterString,this._keyAssistInput.focus(),
this._keyAssistInput.select())},_keyDown:function(d){if(40===d.keyCode)this.select(!0);else if(38===d.keyCode)this.select(!1);else if(13===d.keyCode)this.execute();else return;d.preventDefault()},_scrollWheel:function(d){var l=0,l=n.isIE||n.isOpera?-d.wheelDelta:n.isFirefox?40*d.detail:-d.wheelDeltaY,b=this._keyAssistContents,f=b.scrollTop;b.scrollTop+=l;if(f!==b.scrollTop)return d.preventDefault&&d.preventDefault(),!1}};return{KeyAssistPanel:d}});
define("orion/widgets/themes/ThemePreferences",[],function(){function k(k,n){this._preferences=k;this._themeData=n;var d=n.getThemeStorageInfo();this._themeVersion=d.version;var h=k.listenForChangedSettings(d.storage,2,function(d){d.key===h&&this.apply()}.bind(this))}k.prototype={_initialize:function(k,n,d){var h,l;void 0===this._themeVersion||d.get("version")===this._themeVersion?(h=d.get(k.styleset),(l=d.get("selected"))&&(l=JSON.parse(l))):l=h=null;h||(h=n.getStyles(),d.put(k.styleset,JSON.stringify(h)));
if(!l||void 0===l[k.selectedKey])l=l||{},l[k.selectedKey]=k.defaultTheme,d.put("selected",JSON.stringify(l));d.put("version",this._themeVersion)},apply:function(){this.setTheme()},getTheme:function(k){var n=this._themeData,d=n.getThemeStorageInfo();this._preferences.getPreferences(d.storage,2).then(function(h){this._initialize(d,n,h);var l=JSON.parse(h.get("selected"));h=JSON.parse(h.get(d.styleset));var b;if(h)for(var f=0;f<h.length;f++)if(h[f].name===l[d.selectedKey]){b=h[f];break}k({style:b,styles:h})}.bind(this))},
setTheme:function(k,n){var d=this._themeData,h=d.getThemeStorageInfo();this._preferences.getPreferences(h.storage,2).then(function(l){this._initialize(h,d,l);var b=JSON.parse(l.get("selected"));k||(k=b[h.selectedKey]);b[h.selectedKey]=k;l.put("selected",JSON.stringify(b));n?l.put(h.styleset,JSON.stringify(n)):n=JSON.parse(l.get(h.styleset));for(var f=0;f<n.length;f++)if(n[f].name===b[h.selectedKey]){d.processSettings(n[f]);break}l.put("version",this._themeVersion)}.bind(this))},setFontSize:function(k){var n=
this._themeData,d=n.getThemeStorageInfo();this._preferences.getPreferences(d.storage,2).then(function(h){this._initialize(d,n,h);var l=JSON.parse(h.get("selected")),b=JSON.parse(h.get(d.styleset)),f;if(b)for(var a=0;a<b.length;a++)b[a].fontSize=k,b[a].name===l[d.selectedKey]&&(f=b[a]);h.put(d.styleset,JSON.stringify(b));n.processSettings(f)}.bind(this))}};return{ThemePreferences:k}});
define("orion/settings/nls/root/messages",{"Plugin Description":"Plugin Description",Create:"Create","Loading...":"Loading...","Label:":"Label:",Title:"Title",Plugins:"Plugins","User Profile":"User Profile",Git:"Git","Git Settings":"Git Settings",General:"General",Navigation:"Navigation",Links:"Links","Open in same tab":"Open in same tab","Open in new tab":"Open in new tab",Font:"Font",Family:"Family","Sans Serif":"Sans Serif",Serif:"Serif",Size:"Size","8pt":"8pt","9pt":"9pt","10pt":"10pt","12pt":"12pt",
Color:"Color",Background:"Background",Strings:"Strings","String Types":"String Types",blue:"blue",Weight:"Weight",Normal:"Normal",Bold:"Bold",Comments:"Comments","Comment Types":"Comment Types",green:"green",Keywords:"Keywords","Keyword Types":"Keyword Types",darkred:"darkred",Categories:"Categories",Username:"Username","Full Name":"Full Name","Email Address":"Email Address","Email Confirmed":"Email Confirmed",Account:"Account","Current Password":"Current Password","New Password":"New Password","Verify Password":"Verify Password",
Password:"Password",OpenId:"OpenId",AOL:"AOL",Yahoo:"Yahoo",Google:"Google",Unlink:"Unlink",Link:"Link",Unlinked:"Unlinked",Linked:"Linked","Linked Accounts":"Linked Accounts","Git Email Address":"Git Email Address","Git Username":"Git Username","Git Credentials Storage":"Git Credentials Storage",Update:"Update","Update Profile Settings":"Update Profile Settings","Update Git User Settings":"Update Git User Settings","Update Git Credentials":"Update Git Credentials","User profile data successfully updated.":"User profile data successfully updated.",
"Git user data successfully updated.":"Git user data successfully updated.","Git Credentials successfully updated.":"Git Credentials successfully updated.","Edit Plugin JavaScript":"Edit Plugin JavaScript","Install Plugin":"Install Plugin","Plugin Name:":"Plugin Name:","Author Name:":"Author Name:","Licence:":"Licence:","Description:":"Description:","A plugin for Eclipse Orion":"A plugin for Eclipse Orion","Plugin Link":"Plugin Link",Install:"Install","Install a plugin by specifying its URL":"Install a plugin by specifying its URL",
"Plugin URL:":"Plugin URL:",Disable:"Disable",DisableTooltip:"Disable the plugin",Enable:"Enable",EnableTooltip:"Enable the plugin","Reload all":"Reload all","Reload all installed plugins":"Reload all installed plugins","Create a new Orion Plugin":"Create a new Orion Plugin","Find More Orion Plugins":"Find More Orion Plugins","Get Plugins":"Get Plugins",Reload:"Reload","Reload the plugin":"Reload the plugin",Delete:"Delete","Delete this plugin from the configuration":"Delete this plugin from the configuration",
"Type a plugin url here ...":"Type a plugin url here ...","Installed ":"Installed ","Installing ":"Installing ","Already installed":"Already installed"," plugin":" plugin","Reloaded ":"Reloaded ","Uninstalled ":"Uninstalled ","Are you sure you want to uninstall '":"Are you sure you want to uninstall '",Services:"Services",Value:"Value","JavaScript Object":"JavaScript Object","click here, then check javascript console to drill down":"click here, then check javascript console to drill down",Item:"Item",
"Git Config":"Git Config","Clear Git Credentials":"Clear Git Credentials","Enable Storage":"Enable Storage","Please be aware that your credentials will be stored persistently in the browser.":"Please be aware that your credentials will be stored persistently in the browser.","Do you wish to enable the Key Storage?":"Do you wish to enable the Key Storage?",general:"General",validation:"Validation","Deleted git credentials for ${0}":"Deleted git credentials for ${0}",Editor:"Editor",editorSettings:"Settings",
EditorThemes:"Themes",Import:"Import","Import a theme":"Import a theme",Export:"Export","Export a theme":"Export a theme","Theme name:":"Theme name:",yourTheme:"yourTheme",fileManagement:"File Management",typing:"Typing",autoSave:"Auto Save",autoSaveTimeout:"Save interval (ms)",autoLoad:"Auto Load",saveDiffs:"Save file as diffs",trimTrailingWhiteSpace:"Trim Trailing Whitespace on Save",Restore:"Restore Defaults",Default:"Default",keys:"Keys",tabs:"Tabs",tabSize:"Tab Size",expandTab:"Insert spaces for tabs",
smoothScrolling:"Smooth Scrolling",scrollAnimation:"Scrolling Animation",scrollAnimationTimeout:"Scrolling Duration (ms)",keyBindings:"Key Bindings",rulers:"Rulers",annotationRuler:"Show Annotation Ruler",lineNumberRuler:"Show Line Number Ruler",foldingRuler:"Show Folding Ruler",overviewRuler:"Show Overview Ruler",whitespaces:"White Spaces",wrapping:"Wrapping",wordWrap:"Word Wrap",showMargin:"Show Margin",marginOffset:"Margin Column",showTabs:"Show Tabs",showSpaces:"Show Spaces",autoSaveTimeoutInvalid:"Invalid save interval.",
scrollAnimationTimeoutInvalid:"Invalid scrolling duration.",tabSizeInvalid:"Invalid tab size.",localSettingsTooltip:"Toggle whether this setting is shown in the local editor settings drop down.",editorSettingsInfo:"Use the ${0} and ${1} to toggle whether a given setting is shown in the local editor settings drop down ${2}.",autoPairParentheses:"Autopair (Parentheses)",autoPairBraces:"Autopair {Braces}",autoPairSquareBrackets:"Autopair [Square] Brackets",autoPairAngleBrackets:"Autopair \x3cAngle\x3e Brackets",
autoPairQuotations:'Autopair "Strings"',autoCompleteComments:"Autocomplete /** Block Comments */",smartIndentation:"Smart Indentation",sourceControl:"Source Control",showBlame:"Show Blame",languageTools:"Language Tools",showOccurrences:"Show Occurrences",contentAssistAutoTrigger:"Show Content Assist automatically","Editor preferences updated":"Editor preferences updated","Editor defaults restored":"Editor defaults restored",Theme:"Theme","Font Size":"Font Size","New Theme Name:":"New Theme Name:",
"Font Size:":"Font Size:","UI Theme":"UI Theme","Navigation Bar":"Navigation Bar","Navigation Text":"Navigation Text","Search Box":"Search Box","Tool Panel":"Tool Panel","Selection Bar":"Selection Bar",Location:"Location",Content:"Content","Main Panel":"Main Panel",Button:"Button","Button Text":"Button Text","Section Text":"Section Text","Side Panel":"Side Panel","Line Color":"Line Color","Line Numbers":"Line Numbers",Foreground:"Foreground","Current Line":"Current Line","HTML Attribute":"HTML Attribute",
"Overview Ruler":"Overview Ruler","HTML Tag":"HTML Tag","Annotation Ruler":"Annotation Ruler","Show Guide":"Show Guide","Check Guide":"Check Guide",Cancel:"Cancel","Revert Theme":"Revert Theme","Update Theme":"Update Theme","Theme:":"Theme:",clickDiagram:"Click diagram to style.",clickUpdate:"Click Update button to save preview.","CSS Class Name":"CSS Class Name","CSS Attribute":"CSS Attribute","CSS Value":"CSS Value","CSS Text":"CSS Text","COLOR:":"Color:","NEW COLOR:":"New Color:",Ok:"Ok","OR HEX:":"Or Hex: "});
define("orion/settings/nls/messages",["orion/i18n!orion/settings/nls/messages","orion/settings/nls/root/messages"],function(k,m){var n={root:m};Object.keys(k).forEach(function(d){"undefined"===typeof n[d]&&(n[d]=k[d])});return n});
define("orion/editor/eventTarget",[],function(){function k(){}k.addMixin=function(m){var n=k.prototype,d;for(d in n)n.hasOwnProperty(d)&&(m[d]=n[d])};k.prototype={addEventListener:function(k,n,d){this._eventTypes||(this._eventTypes={});var h=this._eventTypes[k];h||(h=this._eventTypes[k]={level:0,listeners:[]});h.listeners.push({listener:n,useCapture:d})},dispatchEvent:function(k){var n=k.type;this._dispatchEvent("pre"+n,k);this._dispatchEvent(n,k);this._dispatchEvent("post"+n,k)},_dispatchEvent:function(k,
n){var d=this._eventTypes?this._eventTypes[k]:null;if(d){var h=d.listeners;try{if(d.level++,h)for(var l=0,b=h.length;l<b;l++)if(h[l]){var f=h[l].listener;"function"===typeof f?f.call(this,n):f.handleEvent&&"function"===typeof f.handleEvent&&f.handleEvent(n)}}finally{if(d.level--,d.compact&&0===d.level){for(l=h.length-1;0<=l;l--)h[l]||h.splice(l,1);0===h.length&&delete this._eventTypes[k];d.compact=!1}}}},isListening:function(k){return!this._eventTypes?!1:void 0!==this._eventTypes[k]},removeEventListener:function(k,
n,d){if(this._eventTypes){var h=this._eventTypes[k];if(h){for(var l=h.listeners,b=0,f=l.length;b<f;b++){var a=l[b];if(a&&a.listener===n&&a.useCapture===d){0!==h.level?(l[b]=null,h.compact=!0):l.splice(b,1);break}}0===l.length&&delete this._eventTypes[k]}}}};return{EventTarget:k}});
define("orion/editor/textTheme",["require","orion/editor/eventTarget","orion/util"],function(k,m,n){function d(d){d=d||{};this._document=d.document||document}var h={};d.getTheme=function(l){l=l||"default";var b=h[l];b||(b=h[l]=new d);return b};d.prototype={getThemeClass:function(){return this._themeClass},setThemeClass:function(d,b){var f=this,a=f._themeClass;f._themeClass=d;this._load(d,b,function(){f.onThemeChanged({type:"ThemeChanged",oldValue:a,newValue:f.getThemeClass()})})},onThemeChanged:function(d){return this.dispatchEvent(d)},
buildStyleSheet:function(d,b){function f(b,c,e){c&&(a.push("."+d+" ."+b+" {"),a.push("\t"+(e?"background-color":"color")+": "+c+";"),a.push("}"))}var a=[];a.push("");a.push("."+d+" {");b.fontFamily&&a.push("\tfont-family: "+b.fontFamily+";");b.fontSize&&a.push("\tfont-size: "+b.fontSize+";");b.fontSize&&a.push("\tcolor: "+b.text+";");a.push("}");a.push("."+d+".textview {");b.background&&a.push("\tbackground-color: "+b.background+";");a.push("}");f("ruler.annotations",b.annotationRuler,!0);f("ruler.lines",
b.annotationRuler,!0);f("ruler.folding",b.annotationRuler,!0);f("ruler.overview",b.overviewRuler,!0);f("rulerLines",b.lineNumber,!1);f("rulerLines.even",b.lineNumberEven,!1);f("rulerLines.odd",b.lineNumberOdd,!1);f("annotationLine.currentLine",b.currentLine,!0);f("entity-name-tag",b.keyword,!1);f("entity-other-attribute-name",b.attribute,!1);f("string-quoted",b.string,!1);f("meta.annotation.currentLine",b.currentLine,!0);f("keyword",b.keyword,!1);f("string",b.string,!1);f("comment",b.comment,!1);
f("comment.block.documentation",b.comment,!1);f("keyword.other.documentation.markup",b.comment,!1);return a.join("\n")},_createStyle:function(d,b,f,a){var g=this._document;d="orion-theme-"+d;var c=g.getElementById(d);if(c){if(a||c.firstChild.data===b)return;c.removeChild(c.firstChild);c.appendChild(g.createTextNode(b))}else a?(c=n.createElement(g,"link"),c.rel="stylesheet",c.type="text/css",c.href=b,c.addEventListener("load",function(){f()})):(c=n.createElement(g,"style"),c.appendChild(g.createTextNode(b))),
c.id=d,(g.getElementsByTagName("head")[0]||g.documentElement).appendChild(c);a||f()},_load:function(d,b,f){if(d)if("string"===typeof b)this._createStyle(d,b,f);else if(b=b.href,".css"!==b.substring(b.length-4)&&(b+=".css"),/^\//.test(b)||/[a-zA-Z0-9]+:\/\//i.test(b)||!k.toUrl)this._createStyle(d,b,f,!0);else{var a=this;k(["text!"+b],function(b){a._createStyle(d,b,f,!1)})}else f()}};m.EventTarget.addMixin(d.prototype);return{TextTheme:d}});
define("orion/widgets/themes/ThemeClass",[],function(){function k(k){this.attributes=[];this.element=document.createElement("div");this.style=this.element.style;this.className=k;this.classString="."+k+"{ "}k.prototype.className=null;k.prototype.classString=void 0;k.prototype.style=void 0;k.prototype.closeString=" }\n";k.prototype.toString=function(){return this.classString=this.classString+this.style.cssText+this.closeString};return{ThemeClass:k}});
define("orion/widgets/themes/container/ThemeSheetWriter",["orion/widgets/themes/ThemeClass"],function(k){function m(){}m.prototype.navbar="white";m.prototype.button="#777777";m.prototype.location="#EFEFEF";m.prototype.selection="#cedce7";m.prototype.sidepanel="#F7F7F7";m.prototype.mainpanel="white";m.prototype.navtext="#bfbfbf";m.prototype.content="#3087B3";m.prototype.search="#444";m.prototype.toolpanel="white";m.prototype.writeNavigationStyle=function(){var m="",d=[],h=new k.ThemeClass("orionPage");
h.style.backgroundColor="#fdfdfd";h.style.width="100%";h.style.height="100%";d.push(h);h=new k.ThemeClass("topRowBanner");h.style.margin="0";h.style.border="0";h.style.backgroundColor=this.navbar;h.style.height="16px";h.style.padding="10px";h.style.paddingLeft="6px";h.style.paddingRight="2px";h.style.borderBottom="none";h.style.boxShadow="0 2px 2px 0 rgba(0, 0, 0, 0.1),0 1px 0 0 rgba(0, 0, 0, 0.1)";h.style.zIndex="100";d.push(h);h=new k.ThemeClass("a");h.style.textDecoration="none";h.style.color=
this.content;d.push(h);h=new k.ThemeClass("navlink");h.style.display="inline-block";h.style.padding="2px";h.style.color=this.content;h.style.verticalAlign="bottom";d.push(h);h=new k.ThemeClass("primaryNav");h.style.color=this.navtext;h.style.fontSize="8pt";h.style.fontWeight="normal";h.style.paddingTop="0";h.style.verticalAlign="baseline";d.push(h);h=new k.ThemeClass("primaryNav a");h.style.fontSize="8pt";h.style.color=this.navtext;h.style.marginRight="6px";h.style.marginLeft="6px";h.style.verticalAlign=
"baseline";h.style.textDecoration="none";d.push(h);h=new k.ThemeClass("primaryNav a:hover");h.style.color="#bfbfbf";h.style.cursor="hand";h.style.color="white";h.style.fontWeight="normal";d.push(h);for(var l in d)m+=d[l].toString();return m};m.prototype.writeLocationStyle=function(){var m="",d=[],h=new k.ThemeClass("titleArea");h.style.margin="0";h.style.paddingTop="5px";h.style.border="0";h.style.background=this.location;h.style.background="-webkit-gradient(linear, left top, left bottom, color-stop(0%,"+
this.location+"), color-stop(100%,"+this.location+"))";h.style.borderBottom="1px solid "+this.location;h.style.minHeight="20px";d.push(h);h=new k.ThemeClass("breadcrumb");h.style.fontSize="8pt";h.style.textDecoration="none";h.style.color="#f1f1f2;";h.style.paddingTop="2px";d.push(h);h=new k.ThemeClass("a.breadcrumb:hover");h.style.textDecoration="none";h.style.borderBottom="1px dotted";h.style.color="#F58B0F";h.style.cursor="pointer";d.push(h);h=new k.ThemeClass("breadcrumbSeparator");h.style.fontSize=
"8pt";h.style.textDecoration="none";h.style.color=this.separator;h.style.fontWeight="bold";d.push(h);h=new k.ThemeClass("currentLocation");h.style.fontWeight="bold";h.style.fontSize="8pt";h.style.color=this.breadcrumb;h.style.textDecoration="none";h.style.textWrap="normal";h.style.lineHeight="10pt";d.push(h);h=new k.ThemeClass("a.currentLocation:hover");h.style.fontWeight="bold";h.style.fontSize="10pt";h.style.color="#666666";h.style.textDecoration="none";h.style.borderBottom="0";d.push(h);h=new k.ThemeClass("navlinkonpage");
h.style.color=this.content;h.style.verticalAlign="middle";d.push(h);this.bannerProgress&&(h=new k.ThemeClass("topRowBanner .progressPane_running"),h.style.borderColor=this.bannerProgress,d.push(h));for(var l in d)m+=d[l].toString();return m};m.prototype.writeButtonStyle=function(){var m="",d=[],h=new k.ThemeClass("commandButton");h.style.color="#666";h.style.border="1px solid #dedede";h.style.backgroundColor="#ddd";h.style.textAlign="center";h.style.verticalAlign="middle";h.style.cursor="pointer";
h.style.display="inline-block";h.style.padding="4px 6px";h.style.borderRadius="3px";h.style.lineHeight="12px";h.style.fontSize="9pt";h.style.userSelect="none";d.push(h);h=new k.ThemeClass("commandButton:over");h.style.backgroundColor="#e6e6e6";h.style.border="1px solid #808080";d.push(h);h=new k.ThemeClass("commandMenu");h.style.color="#222";h.style.display="inline-block";h.style.verticalAlign="baseline";h.style.margin="0";h.style.fontSize="8pt";h.style.fontWeight="normal";h.style.border="1px solid #dedede";
h.style.backgroundColor="#efefef";h.style.cursor="pointer";h.style.borderRadius="1px";d.push(h);h=new k.ThemeClass("commandMenuItem");h.style.border="0";h.style.padding="0";h.style.margin="0";d.push(h);for(var l in d)m+=d[l].toString();return m};m.prototype.writeMainStyle=function(){var m="",d=[],h=new k.ThemeClass("searchbox");h.style.backgroundImage="url(../images/core_sprites.png)";h.style.backgroundRepeat="no-repeat";h.style.backgroundPosition="4px -297px";h.style.width="12px";h.style.height=
"12px";h.style.backgroundColor=this.search;h.style.border="1px solid "+this.search;h.style.fontSize="11px";h.style.width="15em";h.style.height="16px";h.style.borderRadius="10px";h.style.color="#999";h.style.padding="0";h.style.paddingLeft="20px";h.style.marginLeft="5px";h.style.marginTop="6px !important";h.style.font="7pt Lucida Sans Unicode,Lucida Grande,Verdana,Arial,Helvetica,Myriad,Tahoma,clean,sans-serif !important";d.push(h);h=new k.ThemeClass("searchbox:focus");h.style.color="white";h.style.outline=
"none";d.push(h);h=new k.ThemeClass("checkedRow");h.style.cssText="background-color:"+this.selection+" !important;";d.push(h);h=new k.ThemeClass("navbar-item-selected");h.style.background=this.selection;h.style.color=this.content;d.push(h);h=new k.ThemeClass("auxpane");h.style.border="0";h.style.background=this.sidepanel;d.push(h);h=new k.ThemeClass("mainpane");h.style.background=this.mainpanel;h.style.border=0;d.push(h);h=new k.ThemeClass("mainToolbar");h.style.background=this.toolpanel;d.push(h);
for(var l in d)m+=d[l].toString();return m};m.prototype.render=function(k){console.log(this.writeNavigationStyle());console.log(this.writeLocationStyle());console.log(this.writeMainStyle());console.log(this.writeButtonStyle())};m.prototype.getSheet=function(k){k.navbar.value?(this.navbar=k.navbar.value,this.button=k.button.value,this.location=k.location.value,this.selection=k.selection.value,this.sidepanel=k.sidepanel.value,this.mainpanel=k.mainpanel.value,this.navtext=k.navtext.value,this.search=
k.search.value,this.content=k.content.value,this.toolpanel=k.toolpanel.value,this.bannerProgress=k.bannerProgress.value):(this.navbar=k.navbar,this.button=k.button,this.location=k.location,this.selection=k.selection,this.sidepanel=k.sidepanel,this.mainpanel=k.mainpanel,this.navtext=k.navtext,this.search=k.search,this.content=k.content,this.toolpanel=k.toolpanel,this.bannerProgress=k.bannerProgress);return this.writeNavigationStyle()+this.writeLocationStyle()+this.writeMainStyle()+this.writeButtonStyle()};
return{ThemeSheetWriter:m}});
define("orion/widgets/themes/container/ThemeData",["i18n!orion/settings/nls/messages","orion/editor/textTheme","orion/widgets/themes/container/ThemeSheetWriter"],function(k,m,n){function d(){}function h(){this.styles=[];var b=new d;b.name="Orion";b.navbar="white";b.button="#EFEFEF";b.location="#efefef";b.selection="FEC";b.sidepanel="#FBFBFB";b.mainpanel="white";b.toolpanel="white";b.navtext="#bfbfbf";b.content="#3087B3";b.search="#444";b.breadcrumb="#3087B3";b.separator="#333";b.bannerProgress="whitesmoke";
this.styles.push(b);b=new d;b.name="Orion2014";b.navbar="white";b.button="#EFEFEF";b.location="#EFEFEF";b.selection="FEC";b.sidepanel="#EEEEEE";b.mainpanel="#EEEEEE";b.toolpanel="#EEEEEE";b.navtext="#BFBFBF";b.content="#333333";b.search="#444444";b.breadcrumb="#333333";b.separator="#333333";b.bannerProgress="orange";this.styles.push(b);b=new d;b.name="Green Zone";b.navbar="seagreen";b.button="lavender";b.location="darkseagreen";b.selection="moccasin";b.sidepanel="aliceblue";b.mainpanel="white";b.toolpanel=
"white";b.navtext="#FBFBFB";b.content="darkgreen";b.search="darkgreen";b.breadcrumb="#3087B3";b.separator="seagreen";b.bannerProgress="#F2F2F2";this.styles.push(b);b=new d;b.name="Pretty In Pink";b.navbar="plum";b.button="lavender";b.location="pink";b.selection="lavender";b.sidepanel="seashell";b.mainpanel="white";b.toolpanel="white";b.navtext="#FBFBFB";b.content="mediumorchid";b.search="violet";b.breadcrumb="#3087B3";b.separator="plum";b.bannerProgress="#F2F2F2";this.styles.push(b);b=new d;b.name=
"Blue Monday";b.navbar="cornflowerblue";b.button="lavender";b.location="skyblue";b.selection="lavender";b.sidepanel="aliceblue";b.mainpanel="white";b.toolpanel="white";b.navtext="#FBFBFB";b.content="royalblue";b.search="royalblue";b.breadcrumb="#3087B3";b.separator="cornflowerblue";b.bannerProgress="#F2F2F2";this.styles.push(b);b=new d;b.name="Vanilla Skies";b.navbar="sandybrown";b.button="lemmonchiffon";b.location="cornsilk";b.selection="lemonchiffon";b.sidepanel="white";b.mainpanel="white";b.toolpanel=
"white";b.navtext="lemonchiffon";b.content="chocolate";b.search="moccasin";b.breadcrumb="#3087B3";b.separator="sandybrown";b.bannerProgress="#F2F2F2";this.styles.push(b);b=new d;b.name="Beetlejuice";b.navbar="indigo";b.button="slateblue";b.location="darkslateblue";b.selection="silver";b.sidepanel="lavender";b.mainpanel="white";b.toolpanel="white";b.navtext="#FBFBFB";b.content="mediumslateblue";b.search="#444";b.breadcrumb="#3087B3";b.separator="indigo";b.bannerProgress="#F2F2F2";this.styles.push(b);
b=new d;b.name="Red";b.navbar="#CD2127";b.button="#777777";b.location="#D85F56";b.selection="lightcoral";b.sidepanel="#EFDAB2";b.mainpanel="#FDFADD";b.toolpanel="#FDFADD";b.navtext="#FBFBFB";b.content="darkred";b.search="#D85F56";b.breadcrumb="darkred";b.separator="#CD2127";b.bannerProgress="#F2F2F2";this.styles.push(b)}function l(){return this.styles}d.prototype.name="Orion";d.prototype.navbar="#404648";d.prototype.button="#EFEFEF";d.prototype.location="#333";d.prototype.breadcrumb="#3087B3";d.prototype.separator=
"#333";d.prototype.selection="FEC";d.prototype.sidepanel="#FBFBFB";d.prototype.mainpanel="white";d.prototype.toolpanel="white";d.prototype.navtext="#bfbfbf";d.prototype.content="#3087B3";d.prototype.search="#444";d.prototype.bannerProgress="white";h.prototype.styles=[];h.prototype.getStyles=l;h.prototype.getThemeStorageInfo=function(){return{storage:"/themes",styleset:"styles",defaultTheme:"Orion2014",selectedKey:"selected",version:"5.0"}};h.prototype.getViewData=function(){var b={top:10,left:10,
width:350,height:350};b.shapes=[{type:"RECTANGLE",name:k["Navigation Bar"],x:10,y:10,width:350,height:32,family:"navbar",fill:"#333",order:1},{type:"TEXT",name:k["Navigation Text"],label:"UserName",x:290,y:30,family:"navtext",fill:"#bfbfbf",font:"8pt sans-serif"},{type:"ROUNDRECTANGLE",name:k["Search Box"],x:215,y:20,width:70,height:12,family:"search",fill:"#444",order:3},{type:"RECTANGLE",name:k["Tool Panel"],x:150,y:71,width:209,height:30,family:"toolpanel",fill:"white",order:4},{type:"RECTANGLE",
name:k["Selection Bar"],x:155,y:133,width:200,height:20,family:"selection",fill:"#FEC",order:7},{type:"RECTANGLE",name:k.Location,x:10,y:42,width:350,height:29,family:"location",fill:"#efefef",order:8},{type:"TEXT",name:k["Navigation Text"],label:"Navigator",x:60,y:30,family:"navtext",fill:"#bfbfbf",font:"8pt sans-serif",order:2},{type:"TEXT",name:k.Content,label:"Breadcrumb",x:15,y:60,family:"content",fill:"#3087B3",font:"8pt sans-serif"},{type:"TEXT",name:k.Content,label:"/",x:78,y:60,family:"content",
fill:"#3087B3",font:"8pt sans-serif",order:9},{type:"TEXT",name:k.Content,label:"Location",x:84,y:60,family:"content",fill:"#3087B3",font:"8pt sans-serif"},{type:"RECTANGLE",name:k["Main Panel"],x:150,y:101,width:209,height:258,family:"mainpanel",fill:"white",order:6},{type:"ROUNDRECTANGLE",name:k.Button,x:155,y:76,width:37,height:20,family:"button",fill:"#EFEFEF",order:11},{type:"TEXT",name:k["Button Text"],label:"Button",x:158,y:90,family:"navbar",fill:"#333",font:"8pt sans-serif"},{type:"TRIANGLE",
name:"userMenu",x1:353,y1:24,x2:347,y2:24,x3:350,y3:29,family:"userMenu",fill:"#BFBFBF"},{type:"TRIANGLE",name:"userMenu",x1:20,y1:88,x2:26,y2:88,x3:23,y3:93,family:"userMenu",fill:"#BFBFBF"},{type:"TEXT",name:k["Section Text"],label:"Section",x:30,y:94,family:"navbar",fill:"#333",font:"8pt sans-serif"},{type:"LINE",name:k["Line Color"],x1:150,y1:101,x2:360,y2:101,linewidth:2,fill:"#DEDEDE"},{type:"LINE",name:k["Line Color"],x1:150,y1:71,x2:150,y2:360,linewidth:2,fill:"#DEDEDE"},{type:"LINE",name:k["Line Color"],
x1:20,y1:100,x2:140,y2:100,linewidth:2,fill:"#DEDEDE"},{type:"RECTANGLE",name:k["Side Panel"],x:10,y:71,width:140,height:289,family:"sidepanel",fill:"#FBFBFB",order:12},{type:"TRIANGLE",name:"userMenu",x1:353,y1:24,x2:347,y2:24,x3:350,y3:29,family:"userMenu",fill:"#BFBFBF"},{type:"TRIANGLE",name:"userMenu",x1:20,y1:88,x2:26,y2:88,x3:23,y3:93,family:"userMenu",fill:"#BFBFBF"},{type:"TEXT",name:k["Navigation Text"],label:"Navigator",x:60,y:30,family:"navtext",fill:"#bfbfbf",font:"8pt sans-serif",order:2},
{type:"TRIANGLE",name:"userMenu",x1:353,y1:24,x2:347,y2:24,x3:350,y3:29,family:"userMenu",fill:"#BFBFBF"},{type:"TRIANGLE",name:"userMenu",x1:20,y1:88,x2:26,y2:88,x3:23,y3:93,family:"userMenu",fill:"#BFBFBF"}];for(var d=0;3>d;d++)b.shapes.push({type:"TEXT",name:k.Content,label:"org.eclipse.orion.content",x:170,y:127+20*d,fill:"#3087B3",family:"content"});for(d=0;3>d;d++)b.shapes.push({type:"TEXT",name:k.Content,label:"Item",x:25,y:115+20*d,fill:"#3087B3",family:"content"});for(d=0;3>d;d++)b.shapes.push({type:"TRIANGLE",
name:"twisty",x1:160,y1:121+20*d,x2:165,y2:124+20*d,x3:160,y3:127+20*d,family:"navbar",fill:"#333"});b.shapes.push({type:"IMAGE",name:"logo",x:15,y:18,source:"../../images/orion-transparent.png",family:"logo"});return b};h.prototype.processSettings=function(b){var d=new n.ThemeSheetWriter;(new m.TextTheme.getTheme("orionTheme")).setThemeClass("orionTheme",d.getSheet(b))};return{ThemeData:h,getStyles:l}});
define("orion/widgets/nls/root/messages",{"no input":"no input","no output":"no output","Choose a Folder":"Choose a Folder",OK:"OK",Profile:"Profile","Sign out":"Sign out","N/A":"N/A","logged in since ":"logged in since ","Sign in":"Sign in","Authentication required!":"Authentication required!","Name:":"Name:","Plug-ins":"Plug-ins"," \x3cNo available services or timed out, check URL and try reloading\x3e":" \x3cNo available services or timed out, check URL and try reloading\x3e",Properties:"Properties",
" (Service Id: ":" (Service Id: ",Services:"Services","SFTP Transfer":"SFTP Transfer","Remote host:":"Remote host:","Port:":"SFTP Port:","Remote path:":"Remote path:","User name:":"User name:","Password:":"Password:","Start Transfer":"Start Transfer","Location:":"Location:","orion.sftpConnections":"orion.sftpConnections","Drag a file here":"Drag a file here","unzip zips":"Unzip *.zip files","or if you prefer":"(or upload a file using the buttons below)",Upload:"Upload","Browse...":"Browse...","Import a file or zip":"Import a file or zip",
"Missing required argument: searchRenderer":"Missing required argument: searchRenderer","Missing required argument: favService":"Missing required argument: favService","Find File Named":"Find File Named","Type the name of a file to open (? \x3d any character, * \x3d any string):":"Type the name of a file to open (? \x3d any character, * \x3d any string):",Search:"Search","FileName FolderName":"FileName FolderName(Optional)","Searching...":"Searching...","Searching for occurrences of":'Searching for occurrences of: "${0}"',
name:"name","orion.widgets.UserMenu":"orion.widgets.UserMenu",test:"test","Sign Out":"Sign Out","Sign Out ":"Sign Out ","\x3c/a\x3e":"\x3c/a\x3e","\x3e":"\x3e","Sign In To ":"Sign In To ","Sign In":"Sign In",Help:"Help","Report a Bug":"Report a Bug","Keyboard Shortcuts":"Keyboard Shortcuts",Settings:"Settings","View profile of ":"View profile of ",Profiles:"Profiles","Information Needed":"Information Needed",Cancel:"Cancel","If the same file exists in both the source and destination:":"If the same file exists in both the source and destination:",
"Cancel the transfer":"Cancel the transfer","Always overwrite destination":"Always overwrite destination","Overwrite if source is newer":"Overwrite if source is newer",New:"New","Building file skeleton...":"Building file skeleton...",Add:"Add","Upload...":"Upload...","For a list of available commands type '${0}'.":"For a list of available commands type '${0}'.","Main Pages":"Main Pages","Related Links":"Related Links"});
define("orion/widgets/nls/messages",["orion/i18n!orion/widgets/nls/messages","orion/widgets/nls/root/messages"],function(k,m){var n={root:m};Object.keys(k).forEach(function(d){"undefined"===typeof n[d]&&(n[d]=k[d])});return n});
define("orion/widgets/userAssistance/UATaskPanel",["orion/webui/littlelib"],function(k){function m(m,d,h){this.elements=h;this.taskPanel=document.createElement("div");this.taskPanel.className="UAContainer";this.taskPanel.innerHTML='\x3cheader class\x3d"UAHeader"\x3eDevelop software from within the cloud\x3c/header\x3e';this.elementNode=document.createElement("div");this.switchesContainer=document.createElement("div");this.switches=document.createElement("span");this.radioButtons=[];this.elementNode.className=
"UAContainer-body";this.taskPanel.appendChild(this.elementNode);this.switchesContainer.className="UAContainer-switch-body";this.switches.className="UAContainer-switches";this.switchesContainer.innerHTML="";this.switchesContainer.appendChild(this.switches);this.taskPanel.appendChild(this.switchesContainer);!0===d?(this.container=document.createElement("div"),this.container.className="UAModal",this.container.appendChild(this.taskPanel),this.backdrop=document.createElement("div"),this.backdrop.className=
"UAModalBackground",document.body.appendChild(this.backdrop),document.body.appendChild(this.container),k.addAutoDismiss([this.container],this.destroy.bind(this))):m.appendChild(this.taskPanel);this.chosenSwitch=this.createSwitch(null,!0);this.chosenSwitch.firstChild.className="chosenCircle";this.initialize();this.elements.forEach(this.createSwitch.bind(this))}m.prototype.elementNode=null;m.prototype.switchesContainer=null;m.prototype.switches=null;m.prototype.radioButtons=null;m.prototype.chosenSwitch=
null;m.prototype.addElement=function(k){var d=document.createElement("span");d.className="UAContainer-icon";d.innerHTML='\x3cspan class\x3d"workingSpan"\x3e\x3cimg src\x3d"'+k.image+'" id\x3d"'+k.label+'ImageNode" alt\x3d"'+k.alt+'" height\x3d"64" width\x3d"64"\x3e\x3c/span\x3e\x3cspan class\x3d"UAIcon-label"\x3e\x3cspan class\x3d"UALabel" id\x3d"'+k.label+'LabelNode" \x3e'+k.label+"\x3c/span\x3e\x3c/span\x3e";d.onmouseover=function(){document.getElementById(k.label+"ImageNode").src=k.secondaryImage;
document.getElementById(k.label+"LabelNode").className="UALabel-live";d.className="UAContainer-icon-live"};d.onmouseout=function(){document.getElementById(k.label+"ImageNode").src=k.image;document.getElementById(k.label+"LabelNode").className="UALabel";d.className="UAContainer-icon"};var h=this;d.onclick=function(){h.showMedia(k)};this.elementNode.appendChild(d)};m.prototype.clearElements=function(){this.elementNode.innerHTML=""};m.prototype.showMedia=function(k){this.clearElements();this.addElement(k);
var d=document.createElement("span");d.className="UAContainer-media";d.innerHTML='\x3cdiv\x3e\x3c/div\x3e\x3cdiv\x3e\x3c/div\x3e\x3cspan class\x3d"mediaSpan"\x3e\x3cimg src\x3d"'+k.media+'" alt\x3d"'+k.alt+'" height\x3d"300" width\x3d"400"\x3e\x3c/span\x3e';this.elementNode.appendChild(d);setTimeout(function(){d.style.opacity=1},100);k=document.getElementById(k.label+"switch");this.chosenSwitch.firstChild.className="circle";this.chosenSwitch=k.parentNode;k.className="chosenCircle"};m.prototype.createSwitch=
function(k){var d;d=k?k.label+"switch":"indexSwitch";var h=document.createElement("span");h.className="workingSpan";h.innerHTML='\x3cdiv class\x3d"circle" id \x3d"'+d+'"\x3e\x3c/div\x3e';var l=this;h.onclick=k?function(){l.showMedia(k)}:function(){l.initialize();l.chosenSwitch.firstChild.className="circle";l.chosenSwitch=h;l.chosenSwitch.firstChild.className="chosenCircle"};this.switches.appendChild(h);return this.radioButtons[this.radioButtons.length]=h};m.prototype.initialize=function(){this.clearElements();
this.elements.forEach(this.addElement.bind(this))};m.prototype.destroy=function(){document.body.removeChild(this.backdrop);document.body.removeChild(this.container)};return m});
define("orion/webui/dialog",["i18n!orion/widgets/nls/messages","require","orion/webui/littlelib","orion/uiUtils"],function(k,m,n,d){function h(){}var l=null;h.prototype={DISABLED:"disabled",CONTAINERTEMPLATE:'\x3cdiv class\x3d"dialog" role\x3d"dialog"\x3e\x3cdiv class\x3d"dialogTitle"\x3e\x3cspan id\x3d"title" class\x3d"dialogTitleText layoutLeft"\x3e\x3c/span\x3e\x3cbutton aria-label\x3d"Close" class\x3d"dismissButton layoutRight core-sprite-close imageSprite" id\x3d"closeDialog"\x3e\x3c/button\x3e\x3c/div\x3e\x3cdiv id\x3d"dialogContent" class\x3d"dialogContent layoutBlock"\x3e\x3c/div\x3e\x3cdiv id\x3d"buttons" class\x3d"dialogButtons"\x3e\x3c/div\x3e\x3c/div\x3e',_initialize:function(){var b=
document.body;this.$frameParent=b;this.$$modalExclusions=this.$$modalExclusions||[];var d=document.createRange();d.selectNode(b);d=d.createContextualFragment(this.CONTAINERTEMPLATE);b.appendChild(d);this.$frame=b.lastChild;this.title&&n.$("#title",this.$frame).appendChild(document.createTextNode(this.title));this.$close=n.$("#closeDialog",this.$frame);var a=this;this.$close.addEventListener("click",function(b){a.hide()},!1);this.$parent=n.$(".dialogContent",this.$frame);d=document.createRange();d.selectNode(this.$parent);
b=d.createContextualFragment(this.TEMPLATE);this.messages&&n.processTextNodes(b,this.messages);this.$parent.appendChild(b);this.$buttonContainer=n.$(".dialogButtons",this.$frame);this._makeButtons();this.$frame.addEventListener("keydown",function(b){b.keyCode===n.KEY.ESCAPE?a.hide():b.keyCode===n.KEY.ENTER&&"function"===typeof a._defaultCallback&&a._defaultCallback()},!1);this._bindElements(this.$parent);"function"===typeof this._bindToDom&&this._bindToDom(this.$parent);this.modal&&this._makeModal()},
_makeButtons:function(){if(this.$buttonContainer&&Array.isArray(this.buttons)){var b=this;this.buttons.forEach(function(f){var a=d.createButton(f.text,f.callback);f.id&&(a.id=f.id,b["$"+a.id]=a);f.isDefault&&(b._defaultCallback=f.callback,b._defaultButton=a);b.$buttonContainer.appendChild(a)})}},_makeModal:function(b){var d=this;this.$frame.addEventListener("blur",function(a){d.$lastFocusedElement=a.target},!0);this._modalListener=function(a){var c=!n.contains(d.$frame,a.target);if(c)for(var b=0;b<
d.$$modalExclusions.length;b++)if(n.contains(d.$$modalExclusions[b],a.target)){c=!1;break}c&&(window.setTimeout(function(){(d.$lastFocusedElement||d.$parent).focus()},0),n.stop(a))};this.$frameParent.addEventListener("focus",this._modalListener,!0);this.$frameParent.addEventListener("click",this._modalListener,!0);b=this.$frameParent.childNodes;var a=!1;this._addedBackdrop=[];for(var g=0;g<b.length;g++){for(var c=0;c<this.$$modalExclusions.length;c++)if(n.contains(this.$$modalExclusions[c],b[g])){a=
!0;break}!a&&b[g]!==d.$frame&&b[g].classList&&!b[g].classList.contains("tooltipContainer")&&(c=b[g],c.classList.contains("modalBackdrop")||(c.classList.add("modalBackdrop"),this._addedBackdrop.push(c)))}(b=n.lastTabbable(this.$buttonContainer)||n.lastTabbable(this.$parent))&&b.addEventListener("keydown",function(a){if(a.keyCode===n.KEY.TAB){var c=d._getFirstFocusField();c&&c!==a.target&&c.focus();n.stop(a)}},!1)},_addChildDialog:function(b){this.$$modalExclusions.push(b.$frame||b.$parent)},_inModalExclusion:function(b){return this.$$modalExclusions.some(function(d){return b.$frame===
d||b.$parent===d})},_bindElements:function(b){for(var d=0;d<b.childNodes.length;d++){var a=b.childNodes[d];a.id&&(this["$"+a.id]=a);this._bindElements(a)}},hide:function(b){!b&&l===this&&(l=null);"function"===typeof this._beforeHiding&&this._beforeHiding();this._modalListener&&(this.$frameParent.removeEventListener("focus",this._modalListener,!0),this.$frameParent.removeEventListener("click",this._modalListener,!0));this.$frame.classList.remove("dialogShowing");n.setFramesEnabled(!0);"function"===
typeof this._afterHiding&&this._afterHiding();var d=this;this.keepAlive||window.setTimeout(function(){d.destroy()},0)},show:function(b){if(this.modal)if(l){if(!l._inModalExclusion(this)){this.hide(!0);return}}else l=this;"function"===typeof this._beforeShowing&&this._beforeShowing();n.setFramesEnabled(!1);var d=n.bounds(this.$frame),a=n.bounds(document.documentElement),g;b?(g=n.bounds(b),b=g.top+g.height+4,g=g.left+4,b+d.height>a.height&&(b=Math.max(0,a.height-d.height-4)),g+d.width>a.width&&(g=Math.max(0,
a.width-d.width-4))):(g=Math.max(0,(a.width-d.width)/2),b=Math.max(0,(a.height-d.height)/2));this.$lastFocusedElement=document.activeElement;this.$frame.style.top=b+"px";this.$frame.style.left=g+"px";this.$frame.classList.add("dialogShowing");"function"===typeof this._afterShowing&&this._afterShowing();this.customFocus||this._getFirstFocusField().focus()},_getFirstFocusField:function(){return n.firstTabbable(this.$parent)||this._defaultButton||n.firstTabbable(this.$buttonContainer)||this.$close},
destroy:function(){this.$frame&&(l===this&&(l=null),n.setFramesEnabled(!0),this._addedBackdrop&&0<this._addedBackdrop.length&&this._addedBackdrop.forEach(function(b){b.classList.remove("modalBackdrop")}),this.$frameParent.removeEventListener("focus",this._modalListener,!0),this.$frameParent.removeEventListener("click",this._modalListener,!0),this.$frameParent.removeChild(this.$frame),this.$parent=this.$frame=void 0)}};h.prototype.constructor=h;return{Dialog:h}});
define("orion/widgets/UserMenu","i18n!orion/widgets/nls/messages require orion/webui/littlelib orion/PageLinks orion/widgets/userAssistance/UATaskPanel orion/webui/dialog orion/webui/dropdown".split(" "),function(k,m,n,d,h,l,b){function f(a){this._displaySignOut=!0;this._init(a)}f.prototype={_init:function(a){this._dropdownNode=n.node(a.dropdownNode);if(!this._dropdownNode)throw"no dom node for dropdown found";this._dropdown=a.dropdown;this._serviceRegistry=a.serviceRegistry;this.authenticatedServices=
{};this.unauthenticatedServices={};this._noSeparator=a.noSeparator;this._dropDownItemClass=a.dropDownItemClass;this._keyAssistClass=a.keyAssistClass;void 0!==a.signOut&&(this._displaySignOut=a.signOut)},isSingleService:function(){return 1===this.length(this.unauthenticatedServices)+this.length(this.authenticatedServices)},hasServices:function(){return 0<this.length(this.unauthenticatedServices)+this.length(this.authenticatedServices)},length:function(a){var b=0,c;for(c in a)a.hasOwnProperty(c)&&b++;
return b},_makeMenuItem:function(a,d){var c=b.createMenuItem(a).firstElementChild;"string"===typeof this._dropDownItemClass&&""!==this._dropDownItemClass&&c.classList.add(this._dropDownItemClass);c.addEventListener("click",d,!1);c.addEventListener("keydown",function(a){(a.keyCode===n.KEY.ENTER||a.keyCode===n.KEY.SPACE)&&d()},!1);return c},_renderAuthenticatedService:function(a,b){var c=this,e=this.authenticatedServices[a].authService;if(e&&e.logout&&this._displaySignOut){var d=this._makeMenuItem(k["Sign Out"],
function(){e.logout().then(function(){c.addUserItem(a,e,c.authenticatedServices[a].label);localStorage.removeItem(a);localStorage.removeItem("lastLogin");for(var b=localStorage.length-1;0<=b;b--){var d=localStorage.key(b);d&&0===d.indexOf("/orion/preferences/user")&&localStorage.removeItem(d)}e.getAuthForm(window.location.href).then(function(a){window.location=a})})});this._dropdownNode.appendChild(d.parentNode)}},renderServices:function(){function a(a){c[a]||(c[a]=g.createDocumentFragment());return c[a]}
var g=document,c=[],e=this._serviceRegistry;d.getPageLinksInfo(e,"orion.page.link.user").then(function(d){this._dropdown?this._dropdown.empty():this._dropdownNode&&n.empty(this._dropdownNode);d.getAllLinks().forEach(function(c){var b,e;if(c.category&&(e=/user\.(\d+)/.exec(c.category)))b=parseInt(e[1],10);if("number"!==typeof b||isNaN(b))b=1;b=a(b);e=g.createElement("li");var d=g.createElement("a");d.role="menuitem";"string"===typeof this._dropDownItemClass?""!==this._dropDownItemClass&&d.classList.add(this._dropDownItemClass):
d.classList.add("dropdownMenuItem");d.href=c.href;d.textContent=c.textContent;e.appendChild(d);b.appendChild(e);d.addEventListener("keydown",function(a){(a.keyCode===n.KEY.ENTER||a.keyCode===n.KEY.SPACE)&&d.click()},!1)}.bind(this));this.keyAssistFunction&&(d=this._makeMenuItem(k["Keyboard Shortcuts"],this.keyAssistFunction),"string"===typeof this._keyAssistClass?""!==this._keyAssistClass&&d.classList.add(this._keyAssistClass):d.classList.add("key-assist-menuitem"),d=d.parentNode,a(0).appendChild(d));
if(d=e.getServiceReferences("orion.page.getstarted")[0])d=d.getProperty("data"),d=this._makeMenuItem("Getting Started",this.getStartedDialog.bind(this,d)).parentNode,a(0).appendChild(d);var f=this;c.sort(function(a,c){return a-c}).forEach(function(a,e){if(e<c.length-1&&!this._noSeparator){var d=b.createSeparator();a.appendChild(d)}f._dropdownNode.appendChild(a)}.bind(this));if(this.isSingleService())for(var h in this.authenticatedServices)this.authenticatedServices.hasOwnProperty(h)&&this._renderAuthenticatedService(h,
0)}.bind(this))},getStartedDialog:function(a){new h(null,!0,a)},setKeyAssist:function(a){this.keyAssistFunction=a;this.renderServices()},addUserItem:function(a,b,c,e){e?(this.unauthenticatedServices[a]&&delete this.unauthenticatedServices[a],this.authenticatedServices[a]={authService:b,label:c,data:e}):(this.authenticatedServices[a]&&delete this.authenticatedServices[a],this.unauthenticatedServices[a]=this.unauthenticatedServices[a]?{authService:b,label:c,pending:this.unauthenticatedServices[a].pending}:
{authService:b,label:c});this.renderServices()}};f.prototype.constructor=f;return{UserMenu:f}});
define("orion/webui/dialogs/OpenResourceDialog","i18n!orion/widgets/nls/messages orion/crawler/searchCrawler orion/contentTypes require orion/webui/littlelib orion/util orion/webui/dialog".split(" "),function(k,m,n,d,h,l,b){function f(a){this._init(a)}f.prototype=new b.Dialog;f.prototype.TEMPLATE='\x3cdiv role\x3d"search"\x3e\x3cdiv\x3e\x3clabel id\x3d"fileNameMessage" for\x3d"fileName"\x3e${Type the name of a file to open (? \x3d any character, * \x3d any string):}\x3c/label\x3e\x3c/div\x3e\x3cdiv\x3e\x3cinput id\x3d"fileName" type\x3d"text" class\x3d"setting-control" style\x3d"width:90%;"/\x3e\x3c/div\x3e\x3cdiv id\x3d"progress" style\x3d"padding: 2px 0 0; width: 100%;"\x3e\x3cimg src\x3d"'+d.toUrl("../../../images/progress_running.gif")+
'" class\x3d"progressPane_running_dialog" id\x3d"crawlingProgress"\x3e\x3c/img\x3e\x3c/div\x3e\x3cdiv id\x3d"results" style\x3d"max-height:250px; height:auto; overflow-y:auto;" aria-live\x3d"off"\x3e\x3c/div\x3e\x3cdiv id\x3d"statusbar"\x3e\x3c/div\x3e\x3c/div\x3e';f.prototype._init=function(a){this.title=a.title||k["Find File Named"];this.modal=!0;this.messages=k;this._searcher=a.searcher;this._progress=a.progress;this._onHide=a.onHide;this._contentTypeService=new n.ContentTypeRegistry(this._searcher.registry);
if(!this._searcher)throw Error("Missing required argument: searcher");this._searchDelay=a.searchDelay||500;this._time=0;this._searcher.setCrawler(null);this._forceUseCrawler=!1;this._initialText=a.initialText;this._message=a.message;this._nameSearch=!0;void 0!==a.nameSearch&&(this._nameSearch=a.nameSearch);this._searchOnRoot=!0;this._fileService=this._searcher.getFileService();if(!this._fileService)throw Error(k["Missing required argument: fileService"]);this._searchRenderer=a.searchRenderer;if(!this._searchRenderer||
"function"!==typeof this._searchRenderer.makeRenderFunction)throw Error(k["Missing required argument: searchRenderer"]);this._initialize()};f.prototype._bindToDom=function(a){var b=this;b.$crawlingProgress.style.display="none";this._nameSearch?this.$fileName.setAttribute("placeholder",k["FileName FolderName"]):this.$fileName.setAttribute("placeholder",k.Search);this.$fileName.addEventListener("input",function(a){b._time=+new Date;b._timeoutId&&clearTimeout(b._timeoutId);b._timeoutId=setTimeout(b.checkSearch.bind(b),
0)},!1);this.$fileName.addEventListener("keydown",function(a){if(a.keyCode===h.KEY.ENTER){var e=h.$("a",b.$results);e&&(h.stop(a),(l.isMac?a.metaKey:a.ctrlKey)?window.open(e.href):(window.location.href=e.href,b.hide()))}},!1);a.addEventListener("keydown",function(a){var e,d,f;if(a.keyCode===h.KEY.DOWN||a.keyCode===h.KEY.UP)e=h.$$array("a",b.$results),d=document.activeElement,f=e.indexOf(d),a.keyCode===h.KEY.DOWN?0<=f?(d.classList.remove("treeIterationCursor"),e=f<e.length-1?e[f+1]:e[0],e.focus(),
e.classList.add("treeIterationCursor")):0<e.length&&(e=e[0],e.focus(),e.classList.add("treeIterationCursor")):0<=f?(d.classList.remove("treeIterationCursor"),d=b.$fileName,e=0<f?e[f-1]:d,e.focus(),0<f&&e.classList.add("treeIterationCursor")):0<e.length&&(e[e.length-1].focus(),e[e.length-1].classList.add("treeIterationCursor")),h.stop(a)});a.addEventListener("mouseup",function(a){a.target.focus()},!1);setTimeout(function(){if(b._forceUseCrawler||!b._fileService.getService(b._searcher.getSearchLocation()).search){var a=
b._searchOnRoot?b._searcher.getSearchRootLocation():b._searcher.getChildrenLocation(),a=new m.SearchCrawler(b._searcher.registry,b._fileService,"",{searchOnName:!0,location:a});b._searcher.setCrawler(a);a.buildSkeleton(function(){b.$crawlingProgress.style.display="inline";b.$progress.appendChild(document.createTextNode(k["Building file skeleton..."]))},function(){b.$crawlingProgress.style.display="none";b.$progress.removeChild(b.$progress.lastChild)})}},0);this._message&&(this.$fileNameMessage.removeChild(this.$fileNameMessage.firstChild),
this.$fileNameMessage.appendChild(document.createTextNode(this._message)));this._initialText&&(this.$fileName.value=this._initialText,this.doSearch())};f.prototype.checkSearch=function(){clearTimeout(this._timeoutId);var a=(new Date).getTime();a-this._time>this._searchDelay?(this._time=a,this.doSearch()):this._timeoutId=setTimeout(this.checkSearch.bind(this),50)};f.prototype._detectFolderKeyword=function(a){var b,c=a,e=null;if(this._nameSearch&&(b=/(\S+)\s*(.*)/,(a=b.exec(a))&&3===a.length))a[1]&&
(c=a[1]),a[2]&&(e=a[2]);return{keyword:c,folderKeyword:e}};f.prototype.doSearch=function(){var a=this.$fileName.value;if(a){var b=this._detectFolderKeyword(a),c=this._searcher.createSearchParams(b.keyword,this._nameSearch,this._searchOnRoot),e=this._searchRenderer.makeRenderFunction(this._contentTypeService,this.$results,!1,this.decorateResult.bind(this));this.currentSearch=e;var d=document.createElement("div");d.appendChild(document.createTextNode(this._nameSearch?k["Searching..."]:l.formatMessage(k["Searching for occurrences of"],
a)));h.empty(this.$results);this.$results.appendChild(d);this._searcher.search(c,b.folderKeyword,function(){e===this.currentSearch&&e.apply(null,arguments)}.bind(this))}};f.prototype.decorateResult=function(a){function b(a){0===a.button&&!a.ctrlKey&&!a.metaKey&&c.hide()}var c=this;a=h.$$array("a",a);for(var e=0;e<a.length;e++)a[e].addEventListener("click",b,!1)};f.prototype._beforeHiding=function(){clearTimeout(this._timeoutId)};f.prototype._afterHiding=function(){this._onHide&&this._onHide()};f.prototype.constructor=
f;return{OpenResourceDialog:f}});define("text!orion/banner/banner.html",[],function(){return'\x3cheader id\x3d"banner" role\x3d"banner"\x3e\n\t\x3c!-- Requires some js code to bind the home link, link to progress image, and binding NLS variables  --\x3e\n\n\t\x3cdiv id\x3d"staticBanner" class\x3d"layoutBlock topRowBanner"\x3e \x3c!-- primaryNav --\x3e\n\t\t\x3cdiv id\x3d"centralNavigationArea" style\x3d"position:absolute;left:0;top:0;width:39px;height:36px; z-index:1;border-right:1px solid #ddd;"\x3e\x3c/div\x3e\n\n\t\t\x3c!-- Static "Home" link. TODO delete this --\x3e\n\t\t\x3ca id\x3d"home" class\x3d"layoutLeft "\x3e\x3c/a\x3e\n\n\t\t\x3c!-- Left banner component: hamburger --\x3e\n\t\t\x3cnav id\x3d"primaryNav" class\x3d"bannerLeftArea" style\x3d"z-index:2;" role\x3d"navigation"\x3e\n\t\t\t\t\x3cbutton class\x3d"centralNavigation commandSprite core-sprite-hamburger" type\x3d"button"id\x3d"centralNavigation"\x3e\x3c/button\x3e\n\t\t\x3c/nav\x3e\n\n\t\t\x3c!-- Middle banner component: Breadcrumb bar --\x3e\n\t\t\x3cdiv class\x3d"clear navigationBreadcrumb bannerMiddleArea" \x3e\n\t\t\t\x3cdiv id\x3d"location" class\x3d"currentLocation"\x3e\x3c/div\x3e\n\t\t\x3c/div\x3e\n\n\t\t\x3c!-- Right banner component: user identity --\x3e\n\t\t\x3cdiv class\x3d"bannerRightArea" style\x3d"z-index:2;"\x3e\n\t\t\t\x3c!-- Global commands support. --\x3e\n\t\t\t\x3cdiv id\x3d"globalActions" class\x3d"spacingLeft layoutLeft"\x3e\x3c/div\x3e\n\n\t\t\t\x3c!-- Search. TODO delete this --\x3e\n\t\t\t\x3cinput type\x3d"text" id\x3d"search" autocomplete\x3d"off" class\x3d"layoutLeft spacingLeft searchbox" role\x3d"search" style\x3d"display:none;"\x3e\n\t\t\t\x3cdiv id\x3d"searchOptions" class\x3d"layoutLeft" style\x3d"padding-top:1px;display:none;"\x3e\x3c/div\x3e\n\n\t\t\t\x3c!-- User identity menu and Progress --\x3e\n\t\t\t\x3cdiv id\x3d"userMenu" class\x3d"spacingRight layoutRight" style\x3d"color:#ccc;line-height:16px;"\x3e\n\t\t\t\t\x3cdiv id\x3d"progressPane" class\x3d"progressWatch" tabindex\x3d"0" role\x3d"progressbar"\x3e\n\t\t\t\t\t\x3cdiv id\x3d"watchButton" class\x3d"watchButton"\x3e\x3c/div\x3e\n\t\t\t\t\t\x3cdiv id\x3d"watchBody" class\x3d"watchBody"\x3e\n\t\t\t\t\t\t\x3cspan class\x3d"hand longMinute"\x3e\n\t\t\t\t\t\t\t\x3cspan class\x3d"darkSide"\x3e\x3c/span\x3e\n\t\t\t\t\t\t\x3c/span\x3e\n\t\t\t\t\t\t\x3cspan class\x3d"hand longHour"\x3e\n\t\t\t\t\t\t\t\x3cspan class\x3d"darkSide"\x3e\x3c/span\x3e\n\t\t\t\t\t\t\x3c/span\x3e\n\t\t\t\t\t\x3c/div\x3e\n\t\t\t\t\x3c/div\x3e\n\t\t\t\t\n\t\t\t\t\x3cdiv style\x3d"position: absolute;right: 0px;top:0;width: 39px;height:36px; z-index:-50;border-left: 1px solid #ddd;"\x3e\x3c/div\x3e\n\t\t\t\t\x3cspan id\x3d"userTrigger" tabindex\x3d"0" role\x3d"button" class\x3d"dropdownTrigger" style\x3d"z-index:2;"\x3e\n\t\t\t\t\x3c/span\x3e\n\t\t\t\t\x3cul id\x3d"userDropdown" class\x3d"dropdownMenu" role\x3d"menu"\x3e\x3c/ul\x3e\n\t\t\t\x3c/div\x3e\n\t\t\x3c/div\x3e\n\t\x3c/div\x3e\n\n\t\x3c!-- IDE notification messages go in here --\x3e\n\t\x3cdiv id\x3d"notificationArea" class\x3d"notificationHide"\x3e\n\t\t\x3cdiv class\x3d"layoutLeft" id\x3d"notifications" aria-live\x3d"assertive" aria-atomic\x3d"true"\x3e\x3c/div\x3e\n\t\t\x3cdiv class\x3d"layoutRight"\x3e\x3cbutton aria-label\x3d"Close" class\x3d"dismissButton layoutRight core-sprite-close imageSprite" type\x3d"button" id\x3d"closeNotifications"\x3e\x3c/span\x3e\x3c/div\x3e\n\t\x3c/div\x3e\n\x3c/header\x3e'});
define("text!orion/banner/footer.html",[],function(){return'\x3c!--\n\x3cfooter id\x3d"footerContent" class\x3d"layoutBlock footerLayout" role\x3d"contentinfo"\x3e\n\t\x3cdiv class\x3d"logoFooter commandSprite core-sprite-orion-logo"\x3e\x3c/div\x3e\n\t\x3cdiv class\x3d"footerBlock"\x3e${Orion is in Beta. Please try it out but BEWARE your data may be lost.}\x3c/div\x3e\n\t\x3cdiv class\x3d"footerRightBlock"\x3e\n\t\t\x3cul\x3e\n\t\t\t\x3cli\x3e\x3ca href\x3d"https://bugs.eclipse.org/bugs/enter_bug.cgi?product\x3dOrion\x26version\x3d5.0" target\x3d"_blank"\x3e${Report a Bug}\x3c/a\x3e\n\t\t\t\x3cli\x3e\x3ca href\x3d"http://www.eclipse.org/legal/privacy.php" target\x3d"_blank"\x3e${Privacy Policy}\x3c/a\x3e\x3c/li\x3e\n\t\t\t\x3cli\x3e\x3ca href\x3d"http://www.eclipse.org/legal/termsofuse.php" target\x3d"_blank"\x3e${Terms of Use}\x3c/a\x3e\x3c/li\x3e\n\t\t\t\x3cli\x3e\x3ca href\x3d"http://www.eclipse.org/legal/copyright.php" target\x3d"_blank"\x3e${Copyright Agent}\x3c/a\x3e\x3c/li\x3e\n\t\t\x3c/ul\x3e\n\t\x3c/div\x3e\n\x3c/footer\x3e\n--\x3e'});
define("text!orion/banner/toolbar.html",[],function(){return'\x3cul class\x3d"layoutLeft commandList pageActions" id\x3d"pageActions"\x3e\x3c/ul\x3e\n\x3cul class\x3d"layoutLeft commandList pageActions" id\x3d"selectionTools"\x3e\x3c/ul\x3e\n\x3cul class\x3d"layoutLeft commandList pageActions" id\x3d"navActions"\x3e\x3c/ul\x3e\n\x3cdiv class\x3d"layoutLeft" style\x3d"padding-left:7px;padding-right:7px;margin-top:2px;" id\x3d"filterBox" style\x3d"visibility: hidden;"\x3e\x3c/div\x3e\n\x3cul class\x3d"layoutRight commandList pageActions" id\x3d"settingsActions"\x3e\x3c/ul\x3e\n\x3cdiv class\x3d"layoutRight status" id\x3d"statusPane" role\x3d"status" aria-live\x3d"off"\x3e\x3c/div\x3e\n\x3cul class\x3d"layoutRight commandList pageActions" id\x3d"pageNavigationActions"\x3e\x3c/ul\x3e'});
define("orion/widgets/input/DropDownMenu",["orion/objects","orion/webui/littlelib"],function(k,m){function n(d,h,k){if(d=m.node(d))this._parent=d;else throw Error("Parent node of dropdown menu not found");this.options=k=k||{};this.navDropDownId=this._parent.id+"_navdropdown";this.selectionClass=k.selectionClass;d=document.createElement("div");d.classList.add("dropdownMenu");d.classList.add("dropdownMenuOpen");d.id=this.navDropDownId;d.style.display="none";this._parent.appendChild(d);this._dropdownMenu=
d;if(h=m.node(h))this._triggerNode=h;else throw"Trigger node of dropdown menu not found";"hidden"===this._triggerNode.style.visibility&&(this._triggerNode.style.visibility="visible");k.noClick||(this._triggerNode.onclick=this.click.bind(this));this._dropdownMenu.addEventListener("keydown",function(b){b.keyCode===m.KEY.ESCAPE&&this.clearPanel()}.bind(this))}k.mixin(n.prototype,{click:function(){"none"===this._dropdownMenu.style.display?this.updateContent(this.getContentNode(),function(){m.setFramesEnabled(!1);
this._dropdownMenu.style.display="";this._positionDropdown();this.selectionClass&&this._triggerNode.classList.add(this.selectionClass);this.handle=m.addAutoDismiss([this._triggerNode,this._dropdownMenu],this.clearPanel.bind(this));if(this.options.onShow)this.options.onShow()}.bind(this)):this.clearPanel()},clearPanel:function(){if(this.isVisible()&&(this._dropdownMenu.style.display="none",m.setFramesEnabled(!0),this.selectionClass&&this._triggerNode.classList.remove(this.selectionClass),this.options.onHide))this.options.onHide()},
addContent:function(d){this._dropdownMenu.innerHTML=d},getContentNode:function(){return this._dropdownMenu},updateContent:function(d,h){h()},_positionDropdown:function(){this._dropdownMenu.style.right="";var d=m.bounds(this._dropdownMenu),h=m.bounds(document.body);d.left+d.width>h.left+h.width&&(d=m.bounds(this._boundingNode(this._triggerNode)),h=m.bounds(this._triggerNode),this._dropdownMenu.style.right=d.width-(h.left-d.left+h.width)+"px")},_boundingNode:function(d){var h=window.getComputedStyle(d,
null);return null===h||"absolute"===h.getPropertyValue("position")||!d.parentNode||d===document.body?d:this._boundingNode(d.parentNode)},isDestroyed:function(){return!this._dropdownMenu.parentNode},isVisible:function(){return"none"!==this._dropdownMenu.style.display&&!this.isDestroyed()},focus:function(){this._dropdownMenu.focus()},destroy:function(){this._parent&&(m.setFramesEnabled(!0),m.empty(this._parent),this._parent=this.select=null)}});return n});define("orion/customGlobalCommands",[],function(){return{}});
define("orion/webui/SideMenu","orion/commands orion/objects orion/webui/littlelib orion/PageLinks orion/PageUtil orion/URITemplate orion/URL-shim orion/util".split(" "),function(k,m,n,d,h,l,b,f){function a(a,c){this.parentNode=n.node(a);this.contentNode=n.node(c);if(!this.parentNode)throw Error("Missing parentNode");this.menuitems=Object.create(null);this.categories=this.links=null;this.anchor=document.createElement("ul");this.anchor.classList.add("sideMenuList");this.parentNode.appendChild(this.anchor);
this.anchor.addEventListener("click",this._handleEvent.bind(this));this.anchor.addEventListener("touchstart",this._handleEvent.bind(this));this.anchor.addEventListener("focus",this._handleEvent.bind(this),!0);n.addAutoDismiss([this.anchor],this._expandMenu.bind(this,null))}function g(a){return!a.isRelatedLink}function c(a,c){var b=a.order,e=c.order;return b<e?-1:e<b?1:0}function e(a,c){var b=a.source.order,e=c.source.order,b="number"===typeof b?b:100,e="number"===typeof e?e:100;return b===e?a.textContent.localeCompare(c.textContent):
b<e?-1:1}var p=f.isTouch;m.mixin(a.prototype,{LOCAL_STORAGE_NAME:"sideMenuNavigation",OPEN_STATE:"open",CLOSED_STATE:"closed",DEFAULT_STATE:"open",SIDE_MENU_OPEN_WIDTH:"40px",TRANSITION_DURATION_MS:301,addMenuItem:function(a,c,b){var e=this.anchor;a=this.createListItem(a,c);b&&a.classList.add("sideMenuItemActive");e.appendChild(a);this.menuitems[c]=a},setSideMenu:function(){var a=this.getDisplayState(),c=this.parentNode;c&&(a===this.CLOSED_STATE&&(this.setPageContentLeft("0"),this._timeout&&(window.clearTimeout(this._timeout),
this._timeout=null),this._timeout=window.setTimeout(function(){c.style.display="none"},this.TRANSITION_DURATION_MS),c.classList.add("animating")),a===this.OPEN_STATE&&(this._timeout&&(window.clearTimeout(this._timeout),this._timeout=null),c.classList.remove("animating"),c.style.display="block",c.style.width=this.SIDE_MENU_OPEN_WIDTH,this.setPageContentLeft(this.SIDE_MENU_OPEN_WIDTH)))},setPageContentLeft:function(a){var c=this.contentNode;c&&(c.style.left=a)},toggleSideMenu:function(){var a=this.getDisplayState(),
c=this.contentNode;c&&c.classList.add("content-fixedHeight-animation");a=a===this.OPEN_STATE?this.CLOSED_STATE:this.OPEN_STATE;a===this.DEFAULT_STATE?localStorage.removeItem(this.LOCAL_STORAGE_NAME):localStorage.setItem(this.LOCAL_STORAGE_NAME,a);this.setSideMenu()},clearMenuItems:function(){this.menuitems=[];n.empty(this.anchor)},getMenuItems:function(){var a=this.menuitems;return Object.keys(a).map(function(c){return a[c]})},getMenuItem:function(a){return this.menuitems[a]},getDisplayState:function(){var a=
localStorage.getItem(this.LOCAL_STORAGE_NAME);a||(a=this.DEFAULT_STATE);return a},createListItem:function(a,c){var b=document.createElement("li");b.className=a;b.classList.add("sideMenuItem");b.categoryId=c;return b},setCategories:function(a){this.categories=a;this.links=Object.create(null)},setPageLinks:function(a){this.pageLinks=a;var c=this,b=a.createLinkElements();a.getAllLinks().forEach(function(a,e){var d=b[e];d.source=a;c._getLinksBin(a.category).push(d)});this._renderLinks()},setRelatedLinks:function(a,
c){this.relatedLinks=a;var b=this;Object.keys(this.links).forEach(function(a){var c=b._getLinksBin(a);b.links[a]=c.filter(g)});var e=document.createDocumentFragment();a.forEach(function(a){var c=a.relatedLink,d=b._getLinksBin(c.category);a=k.createCommandMenuItem(e,a.command,a.invocation);a.classList.remove("dropdownMenuItem");a.isRelatedLink=!0;a.source=c;d.push(a)});this._renderLinks(c)},_getLinksBin:function(a){if(a){var c=this.links;c[a]=c[a]||[];return c[a]}return[]},_sort:function(){var a=this.links;
Object.keys(a).forEach(function(c){a[c].sort(e)})},_renderCategories:function(){var a=this.categories,b=this,e=new URL(window.location.href),g=h.matchResourceParameters();g.OrionHome=d.getOrionHome();var f=!1;this.clearMenuItems();a.getCategoryIDs().map(function(c){return a.getCategory(c)}).sort(c).forEach(function(a){var c=b._getLinksBin(a.id);c.length&&(f?b.addMenuItem(a.imageClass,a.id,!1):(c=c.some(function(a){if(!a.source.uriTemplate)return!1;a=new l(a.source.uriTemplate);a=new URL(a.expand(g),
window.location);return a.protocol===e.protocol&&a.host===e.host&&a.hostname===e.hostname&&a.port===e.port&&a.pathname===e.pathname&&a.search===e.search?f=!0:!1}),b.addMenuItem(a.imageClass,a.id,c)))})},_renderLinks:function(a){a=a||[];this._sort();this._renderCategories();var c=this,b=window.location.href;Object.keys(this.menuitems).forEach(function(e){var d=c.getMenuItem(e);if(d){for(var g=c._getLinksBin(e).slice(),g=g.filter(function(c){var e=c.source;return 0<=a.indexOf(e.id)||!e.default&&!e.force&&
c.href===b?!1:!0}),g=g.filter(function(a){a=a.source;return!(1<g.length&&a.default&&!a.force)}),f=g.length-1;0<f;f--)g[f].href===g[f-1].href&&g.splice(f,1);if(g.length){d.appendChild(c._createCategoryElement(e,d,g[0]));var h=document.createElement("ul");h.className="sideMenuSubMenu";g.forEach(function(a){var c=document.createElement("li");c.className="sideMenuSubMenuItem";var b=document.createElement("a");b.href=a;b.className="sideMenuSubMenuItemLink";var e=document.createElement("span");e.innerHTML=
a.innerHTML;e.className="sideMenuSubMenuItemSpan";b.appendChild(e);c.appendChild(b);h.appendChild(c)});d.appendChild(h)}}})},_createCategoryElement:function(a,c,b){a=this.categories.getCategory(a);var e;p?(e=document.createElement("button"),e.type="button"):(e=document.createElement("a"),e.href=b.href);e.className+=a.imageClass;e.classList.add("submenu-trigger");e.tabIndex="0";c.classList.remove(a.imageClass);return e},_handleEvent:function(a){var c=a.target;a="focus"===a.type;if("A"!==c.tagName||
a)c.classList.contains("submenu-trigger")&&(p||a)&&this._expandMenu(n.$(".sideMenuSubMenu",c.parentNode))},_expandMenu:function(a){this.getMenuItems().forEach(function(c){c=n.$(".sideMenuSubMenu",c);a!==c&&c.classList.remove("expanded")});a&&a.classList.toggle("expanded")}});return a});
define("orion/globalCommands","i18n!orion/nls/messages require orion/commonHTMLFragments orion/keyBinding orion/EventTarget orion/commandRegistry orion/commands orion/parameterCollectors orion/extensionCommands orion/uiUtils orion/keyBinding orion/breadcrumbs orion/webui/littlelib orion/webui/splitter orion/webui/dropdown orion/webui/tooltip orion/contentTypes orion/URITemplate orion/keyAssist orion/PageUtil orion/widgets/themes/ThemePreferences orion/widgets/themes/container/ThemeData orion/Deferred orion/widgets/UserMenu orion/PageLinks orion/webui/dialogs/OpenResourceDialog text!orion/banner/banner.html text!orion/banner/footer.html text!orion/banner/toolbar.html orion/widgets/input/DropDownMenu orion/util orion/customGlobalCommands orion/fileClient orion/webui/SideMenu orion/objects".split(" "),function(k,
m,n,d,h,l,b,f,a,g,c,e,p,r,q,s,w,u,y,t,v,A,z,K,D,F,E,x,C,I,B,G,J,M,X){function L(a,c){if(a.getLabel)return a.getLabel();var b=new z;b.resolve(c.properties.name);return b}function ca(a){p.node("progressPane").setAttribute("aria-label",k["Operations - Press spacebar to show current operations"]);(a=a.getService("orion.page.progress"))&&a.init.bind(a)("progressPane")}function Z(a,c){var b=a.getServiceReferences("orion.core.auth");da=[];var e=R.createMenuGenerator.apply(this,arguments);if(e)for(var d=
0;d<b.length;d++){var g=b[d],f=a.getService(g);L(f,g).then(function(a){f.getKey().then(function(c){da.push(c);f.getUser().then(function(b){e.addUserItem(c,f,a,b)},function(b,d){e.addUserItem(c,f,a,d)});window.addEventListener("storage",function(b){ga[c]!==localStorage.getItem(c)&&(ga[c]=localStorage.getItem(c),f.getUser().then(function(b){e.addUserItem(c,f,a,b)},function(b){e.addUserItem(c,f,a)}))},!1)})})}}function T(a){return a}function U(c,e,d,g,f){function h(){if(q)return q;var a=c.getService("orion.core.contentTypeRegistry");
a||(a=new w.ContentTypeRegistry(c),a=c.getService("orion.core.contentTypeRegistry"));return a.getContentTypes().then(function(a){return q=a})}function k(a){for(var c={},b=a.getPropertyKeys(),e,d=0;d<b.length;d++)e=b[d],c[e]=a.getProperty(e);return c}function l(a,c){var b=null;a.some(function(a){return c===a.getProperty("id")?!!(b=a):!1});return b}function p(a){var c=a.command;return!c.visibleWhen||c.visibleWhen(e)?(a.invocation=new b.CommandInvocation(e,e,null,c,g),(new z).resolve(a)):"function"===
typeof f?(n||(n=f()),z.when(n,function(d){if(d&&e===ea&&(!c.visibleWhen||c.visibleWhen(d)))return a.invocation=new b.CommandInvocation(d,d,null,c,g),a})):(new z).resolve()}function m(a,c,e){return e?(new z).resolve({relatedLink:a,command:e}):c.then(function(c){return{relatedLink:a,command:new b.Command(c)}})}var r=arguments,q,n,s=c&&c.getServiceReferences("orion.page.link.related");if(s&&0!==s.length){var B=this;z.when(h(),function(){if(R.beforeGenerateRelatedLinks.apply(B,r)){var b=c.getServiceReferences("orion.navigate.command"),
e=[];s.forEach(function(d){var f=k(d);if(f.id){var h;if((f.nls&&f.nameKey||f.name)&&f.uriTemplate)h=a._createCommandOptions(f,d,c,q,!0),e.push(m(f,h,null));else if(h=l(b,f.id)){var p=k(h);d={};X.mixin(d,p,f);(f=g.findCommand(f.id))?e.push(m(d,null,f)):(h=a._createCommandOptions(p,h,c,q,!0),e.push(m(d,h,null)))}}});z.all(e,T).then(function(a){a.sort(function(a,c){return a.command.name.localeCompare(c.command.name)});return z.all(a.map(p),T).then(function(c){var b=[];c=c.filter(function(c,e){if(c)return!0;
b.push(a[e]);return!1});R.addRelatedLinkCommands.call(B,g,c,b,d);R.afterGenerateRelatedLinks.apply(B,r)})})}})}}function W(a){var c=p.node("globalActions");c&&(a.destroy(c),a.renderCommands(c.id,c,{},{},"tool"))}function aa(a){var c=window.getComputedStyle(a,null);return null===c||"absolute"===c.getPropertyValue("position")||!a.parentNode||a===document.body?a:aa(a.parentNode)}function V(a){var c={},b=null;"string"===typeof a&&(a=p.node(a));a||(a=p.node("pageActions"));for(var e=a;e&&e.classList;){if(e.classList.contains("toolComposite")){b=
e;break}e=e.parentNode}a.classList.contains("commandMarker")&&(c.commandNode=a);b&&(c.slideContainer=p.$(".slideParameters",b),c.parameterArea=p.$(".parameters",b),c.dismissArea=p.$(".parametersDismiss",b),c.notifications=p.$("#notificationArea",b),b.parentNode&&(c.toolbarTarget=p.$(".toolbarTarget",b.parentNode),c.toolbarTarget&&(a=p.bounds(c.toolbarTarget),e=p.bounds(aa(c.toolbarTarget.parentNode)),c.toolbarTargetY=a.top-e.top,c.toolbar=b)));return c}function Y(a){if(a=a.slideContainer)if(a.style.left=
"",a.style.top="",a.classList.contains("slideContainerActive")){var c=p.bounds(a),b=p.bounds(a.parentNode);a.style.left=(b.width-c.width)/2+"px";a.style.top="0"}}l=function(a){var c=document.createElement("a");c.href=a;return c.href}(m.toUrl("auth/NotifyAuthentication.html"));var ga={},S=null,R={createMenuGenerator:G.createMenuGenerator||function(a,c){if(p.node("userMenu")){var b=p.node("userDropdown"),e=new q.Dropdown({dropdown:b}),b=new K.UserMenu({dropdownNode:b,dropdown:e,serviceRegistry:a}),
e=p.node("userTrigger");new s.Tooltip({node:e,text:k.Options,position:["below","left"]});e=document.getElementById("userTrigger");e.className+=" imageSprite core-sprite-silhouette";b.setKeyAssist(c);return b}},beforeGenerateRelatedLinks:G.beforeGenerateRelatedLinks||function(a,c,b,e,d){return!0},addRelatedLinkCommands:G.addRelatedLinkCommands||function(a,c,b,e){this.sideMenu&&this.sideMenu.setRelatedLinks(c,e)},afterGenerateRelatedLinks:G.afterGenerateRelatedLinks||function(a,c,b,e,d){},afterSetPageTarget:G.afterSetPageTarget||
function(a){},generateNavigationMenu:G.generateNavigationMenu||function(a,c,b,e,d,g,f){if(a=p.node("sideMenu"))c=p.node("centralNavigation"),new s.Tooltip({node:c,text:k.CentralNavTooltip,position:["right"]}),S=this.sideMenu=new M(a,p.node("pageContent")),c.addEventListener("click",S.toggleSideMenu.bind(S)),(a=p.node("sideMenuToggle"))&&a.addEventListener("click",S.toggleSideMenu.bind(S))},afterGenerateNavigationMenu:G.afterGenerateNavigationMenu||function(a,c,b,e,d,g,f){},afterGenerateBanner:G.afterGenerateBanner||
function(a,c,b,e,d,g,f){}},da=[],ea,H=[],O,P=null,Q=null,$=new h;return{generateBanner:function(a,c,e,g,h,l,q,s){function w(a){a.registerService("orion.cm.managedservice",{updated:function(a){a=a&&"undefined"!==a["links.newtab"]?a["links.newtab"]?"_blank":"_self":"_self";for(var c=p.$$array(".targetSelector"),b=0;b<c.length;b++)c[b].target=a}},{pid:"nav.config"})}(new v.ThemePreferences(g,new A.ThemeData)).apply();var t=p.node(a);if(!t)throw k["could not find banner parent, id was "]+a;var u=document.createRange();
u.selectNode(t);u=u.createContextualFragment(E);p.processTextNodes(u,k);t.firstChild?t.insertBefore(u,t.firstChild):t.appendChild(u);t=p.node("home");t.href=m.toUrl("edit/edit.html");t.setAttribute("aria-label",k["Orion Home"]);p.node("progressPane").src=b.NO_IMAGE;if(t=p.node("pageToolbar"))t.classList.add("toolbarLayout"),t.innerHTML=C+n.slideoutHTMLFragment("mainToolbar");(t=p.node("closeNotifications"))&&t.setAttribute("aria-label",k["Close notification"]);if(17>=B.isFirefox&&(t=p.node("staticBanner")))t.style.width=
"100%",t.style.MozBoxSizing="border-box";if(t=p.node("footer"))t.innerHTML=x,p.processTextNodes(t,k);e.setParameterCollector(new f.CommandParameterCollector(V,Y));document.addEventListener("keydown",function(a){a.keyCode===p.KEY.ESCAPE&&(a=c.getService("orion.page.message"))&&a.setProgressMessage("")},!1);R.generateNavigationMenu.apply(this,arguments);R.afterGenerateNavigationMenu.apply(this,arguments);t=D.getCategoriesInfo(c);u=D.getPageLinksInfo(c,"orion.page.link");z.all([t,u]).then(function(a){if(S){var c=
a[1];S.setCategories(a[0]);S.setPageLinks(c);S.setSideMenu()}});if(t=p.$(".split")){var u=p.$(".sidePanelLayout"),G=p.$(".mainPanelLayout");u&&G&&(P={side:u,main:G},P.splitter=new r.Splitter({node:t,sidePanel:u,mainPanel:G,toggle:!0,closeByDefault:s}),t=new b.Command({name:k["Toggle side panel"],tooltip:k["Open or close the side panel"],id:"orion.toggleSidePane",callback:function(){P.splitter.toggleSidePanel()}}),e.addCommand(t),e.registerCommandContribution("pageActions","orion.toggleSidePane",1,
null,!0,new d.KeyBinding("l",B.isMac?!1:!0,!0,!1,B.isMac?!0:!1)))}var J=!1,M=function(a,c){if(!J){var b=c.getService("orion.page.progress"),e=new F.OpenResourceDialog({searcher:a,progress:b,searchRenderer:a.defaultRenderer,onHide:function(){J=!1}});window.setTimeout(function(){J=!0;e.show()},0)}},t=new b.Command({name:k["Find File Named..."],tooltip:k["Choose a file by name and open an editor on it"],id:"orion.openResource",callback:function(a){M(h,c)}});e.addCommand(t);e.registerCommandContribution("globalActions",
"orion.openResource",100,null,!0,new d.KeyBinding("f",!0,!0));t=new b.Command({name:k["Toggle banner and footer"],tooltip:k["Hide or show the page banner and footer"],id:"orion.toggleTrim",callback:function(){var a=p.node("banner"),c=p.node("footer"),b=p.node("sideMenu"),e=p.$(".content-fixedHeight"),d="hidden"===a.style.visibility;d?(a.style.visibility="visible",c.style.visibility="visible",e.classList.remove("content-fixedHeight-maximized"),b&&b.classList.remove("sideMenu-maximized")):(a.style.visibility=
"hidden",c.style.visibility="hidden",e.classList.add("content-fixedHeight-maximized"),b&&b.classList.add("sideMenu-maximized"));$.dispatchEvent({type:"toggleTrim",maximized:!d});return!0}});e.addCommand(t);e.registerCommandContribution("globalActions","orion.toggleTrim",100,null,!0,new d.KeyBinding("m",!0,!0));t=new b.Command({name:k["System Configuration Details"],tooltip:k["System Config Tooltip"],id:"orion.configDetailsPage",hrefCallback:function(){return m.toUrl("help/about.html")}});e.addCommand(t);
e.registerCommandContribution("globalActions","orion.configDetailsPage",100,null,!0,new d.KeyBinding(112,!0,!0));t=new b.Command({name:k["Background Operations"],tooltip:k["Background Operations Tooltip"],id:"orion.backgroundOperations",hrefCallback:function(){return m.toUrl("operations/list.html")}});e.addCommand(t);e.registerCommandContribution("globalActions","orion.backgroundOperations",100,null,!0,new d.KeyBinding("o",!0,!0));Q=new y.KeyAssistPanel({commandRegistry:e});t=new b.Command({name:k["Show Keys"],
tooltip:k["Show a list of all the keybindings on this page"],id:"orion.keyAssist",callback:function(){Q.isVisible()?Q.hide():Q.show();return!0}});e.addCommand(t);e.registerCommandContribution("globalActions","orion.keyAssist",100,null,!0,new d.KeyBinding(191,!1,!0));W(e);Z(c,t.callback);ca(c);window.addEventListener("hashchange",function(){e.processURL(window.location.href)},!1);window.setTimeout(function(){w(c)},0);R.afterGenerateBanner.apply(this,arguments)},getToolbarElements:V,getMainSplitter:function(){return P},
getKeyAssist:function(){return Q},getGlobalEventTarget:function(){return $},layoutToolbarElements:Y,setPageTarget:function(a){var c,b,d=a.breadcrumbRootName,g=a.serviceRegistry;a.target?(a.searchService&&a.searchService.setLocationByMetaData(a.target),a.fileService&&!a.breadcrumbTarget&&!a.staticBreadcrumb&&(b=(d?d+" ":"")+a.fileService.fileServiceName(a.target.Location),d=null),c=a.name||a.target.Name,ea=a.target,U.call(this,g,a.target,H,a.commandService,a.makeAlternate)):(a.breadcrumbTarget||(d=
d||a.task||a.name),c=a.name,U.call(this,g,{NoTarget:""},H,a.commandService,a.makeAlternate));(O=a.title)||(O=c?c+" - "+a.task:a.task);window.document.title=O;R.afterSetPageTarget.apply(this,arguments);if(c=a.breadCrumbContainer?p.node(a.breadCrumbContainer):p.node("location"))if(p.empty(c),a.staticBreadcrumb)new e.BreadCrumbs({container:c,rootSegmentName:d});else{var f=g&&new J.FileClient(g),g=a.breadcrumbTarget||a.target,f=f&&g&&g.Location?f.fileServiceRootURL(g.Location):null;new e.BreadCrumbs({container:c,
resource:g,rootSegmentName:d,workspaceRootSegmentName:b,workspaceRootURL:f,makeFinalHref:a.makeBreadcrumFinalLink,makeHref:a.makeBreadcrumbLink})}},setDirtyIndicator:function(a){O&&("*"===O.charAt(0)&&!a&&(O=O.substring(1)),a&&"*"!==O.charAt(0)&&(O="*"+O),window.document.title=O);var c=p.node("dirty");c&&(c.textContent=a?"*":"")},setPageCommandExclusions:function(a){H=a},notifyAuthenticationSite:l}});
define("util/legacy",["require","exports","module"],function(k,m,n){"undefined"===typeof window||"undefined"===typeof document||(null==window.console&&(window.console={}),"debug log warn error trace group groupEnd".split(" ").forEach(function(d){window.console[d]||(window.console[d]=function(){})}),!("classList"in document.documentElement)&&Object.defineProperty&&"undefined"!==typeof HTMLElement&&Object.defineProperty(HTMLElement.prototype,"classList",{get:function(){function d(b){return function(d){var a=
h.className.split(/\s+/),g=a.indexOf(d);b(a,g,d);h.className=a.join(" ")}}var h=this,k={add:d(function(b,d,a){~d||b.push(a)}),remove:d(function(b,d){~d&&b.splice(d,1)}),toggle:d(function(b,d,a){~d?b.splice(d,1):b.push(a)}),contains:function(b){return!!~h.className.split(/\s+/).indexOf(b)},item:function(b){return h.className.split(/\s+/)[b]||null}};Object.defineProperty(k,"length",{get:function(){return h.className.split(/\s+/).length}});return k}}),String.prototype.trimLeft||(String.prototype.trimLeft=
function(){return String(this).replace(/\s*$/,"")}),Function.prototype.bind||(Function.prototype.bind=function(d){if("function"!==typeof this)throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");var h=Array.prototype.slice.call(arguments,1),k=this,b=function(){},f=function(){return k.apply(this instanceof b&&d?this:d,h.concat(Array.prototype.slice.call(arguments)))};b.prototype=this.prototype;f.prototype=new b;return f}))});
define("util/promise",["require","exports","module"],function(k,m,n){function d(a){return{then:function(b){b(a)}}}function h(a){return{then:function(b,c){c(a)}}}function l(a){return function(b){try{return a(b)}catch(c){return h(c)}}}function b(a){var g=[],c;a=a||null===a?a:Object.prototype;var e={promise:Object.create(a,{then:{value:function(e,f){function k(a){n.resolve(e(a))}function m(a){n.resolve(f(a))}var n=b(a);e=e?l(e):d;f=f?l(f):h;g?g.push([k,m]):c.then(k,m);return n.promise}}}),resolve:function(a){if(g){for(c=
a&&"function"===typeof a.then?a:d(a);g.length;)c.then.apply(c,g.shift());g=null}},reject:function(a){e.resolve(h(a))}};return e}function f(a,d){var c=b(d);c.resolve(a);return c.promise}n.metadata={stability:"unstable"};m.defer=b;m.resolve=f;m.reject=function(a,d){var c=b(d);c.reject(a);return c.promise};k=function(){function a(a){return c.apply(c,a)}function b(a,c){return a.then(function(a){return f(c).then(function(c){return a.concat([c])})})}var c=Function.call,e=Array.prototype.concat;return function(c,
d){return function(){return e.apply([c,this],arguments).reduce(b,f([],d)).then(a)}}}();m.promised=k});
define("util/util",["require","exports","module","util/promise"],function(k,m,n){function d(b,a){for(var d=0;d<a.length;d++)if(b===a[d])return d;return-1}function h(b,a){var d=b.getAttribute("data-command");d||(d=b.querySelector("*[data-command]").getAttribute("data-command"));d?a(d):console.warn("Missing data-command for "+util.findCssSelector(b))}m.createEvent=function(b){var a=[],d=!1,c=[],e=void 0,h=function(b){if(d)c.push(b);else for(var e=0;e<a.length;e++){var f=a[e];f.func.call(f.scope,b)}};
h.add=function(c,b){a.push({func:c,scope:b})};h.remove=function(c,e){var d=!1;a=a.filter(function(a){(a=a.func===c&&a.scope===e)&&(d=!0);return!a});d||console.warn("Handler not found. Attached to "+b)};h.removeAll=function(){a=[]};h.holdFire=function(){d=!0};h.resumeFire=function(){if(!0!==d)throw Error("Event not held: "+b);d=!1;if(0!==c.length){if(1===c.length)h(c[0]);else{var a=c[0],k=c[c.length-1];e?h(e(a,k,c)):h(k)}c=[]}};Object.defineProperty(h,"eventCombiner",{set:function(a){if("function"!==
typeof a)throw Error("eventCombiner is not a function");e=a},enumerable:!0});return h};var l=k("util/promise");m.promised=function(){function b(a){return d.apply(d,a)}function a(a,c){return a.then(function(a){return l.resolve(c).then(function(c){return a.concat([c])})})}var d=Function.call,c=Array.prototype.concat;return function(e,d){return function(){return c.apply([e,this],arguments).reduce(a,l.resolve([],d)).then(b)}}}();m.all=m.promised(Array);m.synchronize=function(b){if(null==b||"function"!==
typeof b.then)return b;var a=void 0,d=void 0;b.then(function(c){a=!1;d=c},function(c){a=!0;d=c});if(void 0===a)throw Error("non synchronizable promise");if(a)throw d;return d};m.promiseEach=function(b,a,d){if(0===b.length)return l.resolve([]);var c=l.defer(),e=function(h){var k=[],m=a.call(d,b[h]);l.resolve(m).then(function(a){k[h]=a;a=h+1;a>=b.length?c.resolve(k):e(a)}).then(null,function(a){c.reject(a)})};e(0);return c.promise};m.NS_XHTML="http://www.w3.org/1999/xhtml";m.NS_XUL="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
m.createElement=function(b,a){return m.isXmlDocument(b)?b.createElementNS(m.NS_XHTML,a):b.createElement(a)};m.clearElement=function(b){for(;b.hasChildNodes();)b.removeChild(b.firstChild)};var b=/^\s*$/;m.removeWhitespace=function(d,a){for(var g=0;g<d.childNodes.length;){var c=d.childNodes.item(g);3===c.nodeType&&b.test(c.textContent)?d.removeChild(c):(a&&1===c.nodeType&&m.removeWhitespace(c,a),g++)}};m.importCss=function(b,a,d){if(b){a=a||document;if(!d){d=0;if(0!=b.length)for(var c=0;c<b.length;c++){var e=
b.charCodeAt(c);d=(d<<5)-d+e;d&=d}d="hash-"+d}if(c=a.getElementById(d))return"style"!==c.tagName.toLowerCase()&&console.error("Warning: importCss passed id\x3d"+d+", but that pre-exists (and isn't a style tag)"),c;c=m.createElement(a,"style");c.id=d;c.appendChild(a.createTextNode(b));(a.getElementsByTagName("head")[0]||a.documentElement).appendChild(c);return c}};m.setTextContent=function(b,a){m.clearElement(b);var d=b.ownerDocument.createTextNode(a);b.appendChild(d)};m.setContents=function(b,a){if("undefined"!==
typeof HTMLElement&&a instanceof HTMLElement)m.clearElement(b),b.appendChild(a);else if("innerHTML"in b)b.innerHTML=a;else try{var d=b.ownerDocument.documentElement.namespaceURI;d||(d=m.NS_XHTML);m.clearElement(b);for(var c=b.ownerDocument.createRange().createContextualFragment('\x3cdiv xmlns\x3d"'+d+'"\x3e'+a+"\x3c/div\x3e").firstChild;c.hasChildNodes();)b.appendChild(c.firstChild)}catch(e){throw console.error("Bad XHTML",e),console.trace(),e;}};m.toDom=function(b,a){var d=m.createElement(b,"div");
m.setContents(d,a);return d.children[0]};m.isXmlDocument=function(b){b=b||document;return b.contentType&&"text/html"!=b.contentType||null!=b.xmlVersion?!0:!1};m.findCssSelector=function(b){var a=b.ownerDocument;if(b.id&&a.getElementById(b.id)===b)return"#"+b.id;var g=b.tagName.toLowerCase();if("html"===g)return"html";if("head"===g)return"head";if("body"===g)return"body";null==b.parentNode&&console.log("danger: "+g);var c,e;if(0<b.classList.length)for(var h=0;h<b.classList.length;h++){c="."+b.classList.item(h);
e=a.querySelectorAll(c);if(1===e.length)return c;c=g+c;e=a.querySelectorAll(c);if(1===e.length)return c;e=d(b,b.parentNode.children)+1;c=c+":nth-child("+e+")";e=a.querySelectorAll(c);if(1===e.length)return c}e=d(b,b.parentNode.children)+1;return m.findCssSelector(b.parentNode)+" \x3e "+g+":nth-child("+e+")"};m.createUrlLookup=function(b){return function(a){try{return k("text!gcli/ui/"+a)}catch(d){if(b.filename)return b.filename+a;var c=b.id.split("/").pop()+".js";return b.uri.substr(-c.length)!==
c?(console.error("Can't work out path from module.uri/module.id"),a):b.uri?b.uri.substr(0,b.uri.length-c.length-1)+"/"+a:c+"/"+a}}};m.updateCommand=function(b,a){h(b,function(b){a.update(b)})};m.executeCommand=function(b,a){h(b,function(b){a.exec({visible:!0,typed:b})})};m.KeyEvent={DOM_VK_CANCEL:3,DOM_VK_HELP:6,DOM_VK_BACK_SPACE:8,DOM_VK_TAB:9,DOM_VK_CLEAR:12,DOM_VK_RETURN:13,DOM_VK_ENTER:14,DOM_VK_SHIFT:16,DOM_VK_CONTROL:17,DOM_VK_ALT:18,DOM_VK_PAUSE:19,DOM_VK_CAPS_LOCK:20,DOM_VK_ESCAPE:27,DOM_VK_SPACE:32,
DOM_VK_PAGE_UP:33,DOM_VK_PAGE_DOWN:34,DOM_VK_END:35,DOM_VK_HOME:36,DOM_VK_LEFT:37,DOM_VK_UP:38,DOM_VK_RIGHT:39,DOM_VK_DOWN:40,DOM_VK_PRINTSCREEN:44,DOM_VK_INSERT:45,DOM_VK_DELETE:46,DOM_VK_0:48,DOM_VK_1:49,DOM_VK_2:50,DOM_VK_3:51,DOM_VK_4:52,DOM_VK_5:53,DOM_VK_6:54,DOM_VK_7:55,DOM_VK_8:56,DOM_VK_9:57,DOM_VK_SEMICOLON:59,DOM_VK_EQUALS:61,DOM_VK_A:65,DOM_VK_B:66,DOM_VK_C:67,DOM_VK_D:68,DOM_VK_E:69,DOM_VK_F:70,DOM_VK_G:71,DOM_VK_H:72,DOM_VK_I:73,DOM_VK_J:74,DOM_VK_K:75,DOM_VK_L:76,DOM_VK_M:77,DOM_VK_N:78,
DOM_VK_O:79,DOM_VK_P:80,DOM_VK_Q:81,DOM_VK_R:82,DOM_VK_S:83,DOM_VK_T:84,DOM_VK_U:85,DOM_VK_V:86,DOM_VK_W:87,DOM_VK_X:88,DOM_VK_Y:89,DOM_VK_Z:90,DOM_VK_CONTEXT_MENU:93,DOM_VK_NUMPAD0:96,DOM_VK_NUMPAD1:97,DOM_VK_NUMPAD2:98,DOM_VK_NUMPAD3:99,DOM_VK_NUMPAD4:100,DOM_VK_NUMPAD5:101,DOM_VK_NUMPAD6:102,DOM_VK_NUMPAD7:103,DOM_VK_NUMPAD8:104,DOM_VK_NUMPAD9:105,DOM_VK_MULTIPLY:106,DOM_VK_ADD:107,DOM_VK_SEPARATOR:108,DOM_VK_SUBTRACT:109,DOM_VK_DECIMAL:110,DOM_VK_DIVIDE:111,DOM_VK_F1:112,DOM_VK_F2:113,DOM_VK_F3:114,
DOM_VK_F4:115,DOM_VK_F5:116,DOM_VK_F6:117,DOM_VK_F7:118,DOM_VK_F8:119,DOM_VK_F9:120,DOM_VK_F10:121,DOM_VK_F11:122,DOM_VK_F12:123,DOM_VK_F13:124,DOM_VK_F14:125,DOM_VK_F15:126,DOM_VK_F16:127,DOM_VK_F17:128,DOM_VK_F18:129,DOM_VK_F19:130,DOM_VK_F20:131,DOM_VK_F21:132,DOM_VK_F22:133,DOM_VK_F23:134,DOM_VK_F24:135,DOM_VK_NUM_LOCK:144,DOM_VK_SCROLL_LOCK:145,DOM_VK_COMMA:188,DOM_VK_PERIOD:190,DOM_VK_SLASH:191,DOM_VK_BACK_QUOTE:192,DOM_VK_OPEN_BRACKET:219,DOM_VK_BACK_SLASH:220,DOM_VK_CLOSE_BRACKET:221,DOM_VK_QUOTE:222,
DOM_VK_META:224}});
define("gcli/nls/strings",["require","exports","module"],function(k,m,n){m.root={canonDescNone:"(No description)",cliEvalJavascript:"Enter JavaScript directly",cliUnusedArg:"Too many arguments",cliOptions:"Available Options",fieldSelectionSelect:"Select a %S\u2026",fieldArrayAdd:"Add",fieldArrayDel:"Delete",fieldMenuMore:"More matches, keep typing",jstypeParseScope:"Scope lost",jstypeParseMissing:"Can't find property '%S'",jstypeBeginSyntax:"Syntax error",jstypeBeginUnterm:"Unterminated string literal",jstypeParseError:"Error",
typesNumberNan:'Can\'t convert "%S" to a number.',typesNumberMax:"%1$S is greater than maximum allowed: %2$S.",typesNumberMin:"%1$S is smaller than minimum allowed: %2$S.",typesNumberNotInt2:'Can\'t convert "%S" to an integer.',typesSelectionNomatch:"Can't use '%S'.",nodeParseSyntax:"Syntax error in CSS query",nodeParseMultiple:"Too many matches (%S)",nodeParseNone:"No matches",helpDesc:"Get help on the available commands",helpManual:"Provide help either on a specific command (if a search string is provided and an exact match is found) or on the available commands (if a search string is not provided, or if no exact match is found).",
helpSearchDesc:"Search string",helpSearchManual3:"search string to use in narrowing down the displayed commands. Regular expressions not supported.",helpManSynopsis:"Synopsis",helpManDescription:"Description",helpManParameters:"Parameters",helpManNone:"None",helpListAll:"Available Commands:",helpListPrefix:"Commands starting with '%1$S':",helpListNone:"No commands starting with '%1$S'",helpManRequired:"required",helpManOptional:"optional",subCommands:"Sub-Commands",subCommandsNone:"None",prefDesc:"Commands to control settings",
prefManual:"Commands to display and alter preferences both for GCLI and the surrounding environment",prefListDesc:"Display available settings",prefListManual:"Display a list of preferences, optionally filtered when using the 'search' parameter",prefListSearchDesc:"Filter the list of settings displayed",prefListSearchManual:"Search for the given string in the list of available preferences",prefShowDesc:"Display setting value",prefShowManual:"Display the value of a given preference",prefShowSettingDesc:"Setting to display",
prefShowSettingManual:"The name of the setting to display",prefSetDesc:"Alter a setting",prefSetManual:"Alter preferences defined by the environment",prefSetSettingDesc:"Setting to alter",prefSetSettingManual:"The name of the setting to alter.",prefSetValueDesc:"New value for setting",prefSetValueManual:"The new value for the specified setting",prefSetCheckHeading:"This might void your warranty!",prefSetCheckBody:"Changing these advanced settings can be harmful to the stability, security, and performance of this application. You should only continue if you are sure of what you are doing.",
prefSetCheckGo:"I'll be careful, I promise!",prefResetDesc:"Reset a setting",prefResetManual:"Reset the value of a setting to the system defaults",prefResetSettingDesc:"Setting to reset",prefResetSettingManual:"The name of the setting to reset to the system default value",prefOutputFilter:"Filter",prefOutputName:"Name",prefOutputValue:"Value",introDesc:"Show the opening message",introManual:"Redisplay the message that is shown to new users until they click the 'Got it!' button",introTextOpening2:"This command line is designed for developers. It focuses on speed of input over JavaScript syntax and a rich display over monospace output.",
introTextCommands:"For a list of commands type",introTextKeys2:", or to show/hide command hints press",introTextF1Escape:"F1/Escape",introTextGo:"Got it!",hideIntroDesc:"Show the initial welcome message",eagerHelperDesc:"How eager are the tooltips",allowSetDesc:"Has the user enabled the 'pref set' command?"}});
define("util/l10n",["require","exports","module","gcli/nls/strings"],function(k,m,n){function d(a,c){return a.replace(/\{[^}]*\}/g,function(a){a=a.slice(1,-1);if(null==c)return console.log("Missing swaps while looking up '"+a+"'"),"";var b=c[a];null==b&&(console.log("Can't find '"+a+"' in "+JSON.stringify(c)),b="");return b})}function h(a,c){var b=0;a=a.replace(/%S/g,function(){return c[b++]});return a=a.replace(/%([0-9])\$S/g,function(a,b){return c[b-1]})}function l(){if(!a){var b=navigator.language||
navigator.userLanguage;f.some(function(c){return-1!==c.locales.indexOf(b)?(a=c,!0):!1});a||(console.error("Failed to find plural rule for "+b),a=f[0])}return a}var b={};m.registerStringsSource=function(a){var c=k(a).root;Object.keys(c).forEach(function(e){b[e]?console.error("Key '"+e+"' (loaded from "+a+") already exists. Ignoring."):b[e]=c[e]},this)};k("gcli/nls/strings");m.registerStringsSource("gcli/nls/strings");m.unregisterStringsSource=function(a){a=k(a).root;Object.keys(a).forEach(function(a){delete b[a]},
this)};m.getPreferredLocales=function(){var a=("undefined"!==typeof navigator?(navigator.language||navigator.userLanguage).toLowerCase():"en-us").split("-"),c=a.map(function(c,b){return a.slice(0,a.length-b).join("-")});c.push("root");return c};m.lookup=function(a){var c=b[a];if(null==c)throw Error("No i18n key: "+a);return c};m.propertyLookup="undefined"!==typeof Proxy?Proxy.create({get:function(a,c){return m.lookup(c)}}):b;m.lookupSwap=function(a,c){var b=m.lookup(a);return d(b,c)};m.lookupFormat=
function(a,c){var b=m.lookup(a);return h(b,c)};m.lookupPlural=function(a,c,b){var f=l().get(c);a=m.lookup(a)[f];b=b||{};b.ord=c;return d(a,b)};var f=[{locales:"fa fa-ir id ja ja-jp-mac ka ko ko-kr th th-th tr tr-tr zh zh-tw zh-cn".split(" "),numForms:1,get:function(a){return 0}},{locales:"af af-za as ast bg br bs bs-ba ca cy cy-gb da de de-de de-ch en en-gb en-us en-za el el-gr eo es es-es es-ar es-cl es-mx et et-ee eu fi fi-fi fy fy-nl gl gl-gl he hu hu-hu hy hy-am it it-it kk ku lg mai ml ml-in mn nb nb-no no no-no nl nn nn-no no no-no nb nb-no nso nso-za pa pa-in pt pt-pt rm rm-ch si si-lk son son-ml sq sq-al sv sv-se vi vi-vn zu zu-za".split(" "),
numForms:2,get:function(a){return 1!=a?1:0}},{locales:"ak ak-gh bn bn-in bn-bd fr fr-fr gu gu-in kn kn-in mr mr-in oc oc-oc or or-in pt-br ta ta-in ta-lk te te-in".split(" "),numForms:2,get:function(a){return 1<a?1:0}},{locales:["lv"],numForms:3,get:function(a){return 1==a%10&&11!=a%100?1:0!=a?2:0}},{locales:["gd","gd-gb"],numForms:4,get:function(a){return 1==a||11==a?0:2==a||12==a?1:0<a&&20>a?2:3}},{locales:["ro","ro-ro"],numForms:3,get:function(a){return 1==a?0:0==a||0<a%100&&20>a%100?1:2}},{locales:["lt"],
numForms:3,get:function(a){return 1==a%10&&11!=a%100?0:2<=a%10&&(10>a%100||20<=a%100)?2:1}},{locales:"be be-by hr hr-hr ru ru-ru sr sr-rs sr-cs uk".split(" "),numForms:3,get:function(a){return 1==a%10&&11!=a%100?0:2<=a%10&&4>=a%10&&(10>a%100||20<=a%100)?1:2}},{locales:["cs","sk"],numForms:3,get:function(a){return 1==a?0:2<=a&&4>=a?1:2}},{locales:["pl"],numForms:3,get:function(a){return 1==a?0:2<=a%10&&4>=a%10&&(10>a%100||20<=a%100)?1:2}},{locales:["sl"],numForms:4,get:function(a){return 1==a%100?
0:2==a%100?1:3==a%100||4==a%100?2:3}},{locales:["ga-ie","ga-ie","ga","en-ie"],numForms:5,get:function(a){return 1==a?0:2==a?1:3<=a&&6>=a?2:7<=a&&10>=a?3:4}},{locales:["ar"],numForms:6,get:function(a){return 0==a?5:1==a?0:2==a?1:3<=a%100&&10>=a%100?2:11<=a%100&&99>=a%100?3:4}},{locales:["mt"],numForms:4,get:function(a){return 1==a?0:0==a||0<a%100&&10>=a%100?1:10<a%100&&20>a%100?2:3}},{locales:["mk","mk-mk"],numForms:3,get:function(a){return 1==a%10?0:2==a%10?1:2}},{locales:["is"],numForms:2,get:function(a){return 1==
a%10&&11!=a%100?0:1}}],a});
define("gcli/argument",["require","exports","module"],function(k,m,n){function d(a,c,b){void 0===a?this.suffix=this.prefix=this.text="":(this.text=a,this.prefix=void 0!==c?c:"",this.suffix=void 0!==b?b:"")}function h(){this.suffix=this.prefix=this.text=""}function l(a,c,b){this.text=void 0!==a?a:"";this.prefix=void 0!==c?c:"";this.suffix=void 0!==b?b:"";l._moveSpaces(this)}function b(a,c,b){if(!Array.isArray(a))throw Error("args is not an array of Arguments");this.args=void 0===c?a:a.slice(c,b);a=
d.merge(this.args);this.text=a.text;this.prefix=a.prefix;this.suffix=a.suffix}function f(a){this.arg=a;this.text=a.text;this.prefix=a.prefix;this.suffix=a.suffix}function a(){this.suffix=this.prefix=this.text=""}function g(a,c,b){"string"===typeof a?(this.valueArg=this.nameArg=null,this.text=a,this.prefix=c,this.suffix=b):null==c?(this.nameArg=a,this.valueArg=null,this.text="",this.prefix=this.nameArg.toString(),this.suffix=""):(this.nameArg=a,this.valueArg=c,this.text=this.valueArg.text,this.prefix=
this.nameArg.toString()+this.valueArg.prefix,this.suffix=this.valueArg.suffix)}function c(){this.args=[]}d.prototype.type="Argument";d.prototype.merge=function(a){return new d(this.text+this.suffix+a.prefix+a.text,this.prefix,a.suffix)};d.prototype.beget=function(a){var c=this.text,b=this.prefix,g=this.suffix;if(null!=a.text&&(c=a.text,!a.dontQuote)){var f=0<=c.indexOf(" ")||0==c.length,h=/['"]$/.test(b);f&&!h&&(b+="'",g="'"+g)}a.prefixSpace&&" "!==b.charAt(0)&&(b=" "+b);a.prefixPostSpace&&" "!==
b.charAt(b.length-1)&&(b+=" ");a.suffixSpace&&" "!==g.charAt(g.length-1)&&(g+=" ");return c===this.text&&g===this.suffix&&b===this.prefix?this:new (a.type||d)(c,b,g)};d.prototype.assign=function(a){this.assignment=a};d.prototype.getArgs=function(){return[this]};d.prototype.equals=function(a){return this===a?!0:null==a||!(a instanceof d)?!1:this.text===a.text&&this.prefix===a.prefix&&this.suffix===a.suffix};d.prototype.toString=function(){return this.prefix+this.text+this.suffix};d.merge=function(a,
c,b){b=void 0===b?a.length:b;var d;for(c=void 0===c?0:c;c<b;c++){var g=a[c];d=d?d.merge(g):g}return d};Object.defineProperty(d.prototype,"_summaryJson",{get:function(){return"\x3c"+this.prefix+":"+this.text+":"+this.suffix+"\x3e (a\x3d"+(null==this.assignment?"null":this.assignment.param.name)+", t\x3d"+this.type+")"},enumerable:!0});m.Argument=d;h.prototype=Object.create(d.prototype);h.prototype.type="BlankArgument";m.BlankArgument=h;l.prototype=Object.create(d.prototype);l.prototype.type="ScriptArgument";
l._moveSpaces=function(a){for(;" "===a.text.charAt(0);)a.prefix+=" ",a.text=a.text.substring(1);for(;" "===a.text.charAt(a.text.length-1);)a.suffix=" "+a.suffix,a.text=a.text.slice(0,-1)};l.prototype.beget=function(a){a.type=l;a=d.prototype.beget.call(this,a);l._moveSpaces(a);return a};m.ScriptArgument=l;b.prototype=Object.create(d.prototype);b.prototype.type="MergedArgument";b.prototype.assign=function(a){this.args.forEach(function(c){c.assign(a)},this);this.assignment=a};b.prototype.getArgs=function(){return this.args};
b.prototype.equals=function(a){return this===a?!0:null==a||!(a instanceof b)?!1:this.text===a.text&&this.prefix===a.prefix&&this.suffix===a.suffix};m.MergedArgument=b;f.prototype=Object.create(d.prototype);f.prototype.type="TrueNamedArgument";f.prototype.assign=function(a){this.arg&&this.arg.assign(a);this.assignment=a};f.prototype.getArgs=function(){return[this.arg]};f.prototype.equals=function(a){return this===a?!0:null==a||!(a instanceof f)?!1:this.text===a.text&&this.prefix===a.prefix&&this.suffix===
a.suffix};f.prototype.beget=function(a){a.text&&console.error("Can't change text of a TrueNamedArgument",this,a);a.type=f;a=d.prototype.beget.call(this,a);a.arg=new d(a.text,a.prefix,a.suffix);return a};m.TrueNamedArgument=f;a.prototype=Object.create(d.prototype);a.prototype.type="FalseNamedArgument";a.prototype.getArgs=function(){return[]};a.prototype.equals=function(c){return this===c?!0:null==c||!(c instanceof a)?!1:this.text===c.text&&this.prefix===c.prefix&&this.suffix===c.suffix};m.FalseNamedArgument=
a;g.prototype=Object.create(d.prototype);g.prototype.type="NamedArgument";g.prototype.assign=function(a){this.nameArg.assign(a);null!=this.valueArg&&this.valueArg.assign(a);this.assignment=a};g.prototype.getArgs=function(){return this.valueArg?[this.nameArg,this.valueArg]:[this.nameArg]};g.prototype.equals=function(a){return this===a?!0:null==a||!(a instanceof g)?!1:this.text===a.text&&this.prefix===a.prefix&&this.suffix===a.suffix};g.prototype.beget=function(a){a.type=g;a=d.prototype.beget.call(this,
a);var c=/^([\s]*)([^\s]*)([\s]*['"]?)$/.exec(a.prefix);null==this.valueArg&&""===a.text?(a.nameArg=new d(c[2],c[1],c[3]),a.valueArg=null):(a.nameArg=new d(c[2],c[1],""),a.valueArg=new d(a.text,c[3],a.suffix));return a};m.NamedArgument=g;c.prototype=Object.create(d.prototype);c.prototype.type="ArrayArgument";c.prototype.addArgument=function(a){this.args.push(a)};c.prototype.addArguments=function(a){Array.prototype.push.apply(this.args,a)};c.prototype.getArguments=function(){return this.args};c.prototype.assign=
function(a){this.args.forEach(function(c){c.assign(a)},this);this.assignment=a};c.prototype.getArgs=function(){return this.args};c.prototype.equals=function(a){if(this===a)return!0;if(null==a||"ArrayArgument"!==a.type||this.args.length!==a.args.length)return!1;for(var c=0;c<this.args.length;c++)if(!this.args[c].equals(a.args[c]))return!1;return!0};c.prototype.toString=function(){return"{"+this.args.map(function(a){return a.toString()},this).join(",")+"}"};m.ArrayArgument=c});
define("gcli/types","require exports module util/promise gcli/argument gcli/argument".split(" "),function(k,m,n){function d(a,c,b,d,f){this.value=a;this.arg=c;if(null==c)throw Error("Missing arg");if(null!=f){a="function"===typeof f?f():f;if("function"!==typeof a.then)throw Error("predictions is not a promise");a.then(function(a){if(!Array.isArray(a))throw Error("prediction resolves to non array");},console.error)}this._status=b||g.VALID;this.message=d;this.predictions=f}function h(a,c){this.arg=
c;this.conversions=a;this.value=a.map(function(a){return a.value},this);this._status=g.combine(a.map(function(a){return a.getStatus()}));this.message="";this.predictions=[]}function l(){}var b=k("util/promise"),f=k("gcli/argument").Argument,a=k("gcli/argument").BlankArgument,g={VALID:{toString:function(){return"VALID"},valueOf:function(){return 0}},INCOMPLETE:{toString:function(){return"INCOMPLETE"},valueOf:function(){return 1}},ERROR:{toString:function(){return"ERROR"},valueOf:function(){return 2}},
combine:function(){for(var a=g.VALID,c=0;c<arguments.length;c++){var b=arguments[c];Array.isArray(b)&&(b=g.combine.apply(null,b));b>a&&(a=b)}return a}};m.Status=g;d.prototype.assign=function(a){this.arg.assign(a)};d.prototype.isDataProvided=function(){return"BlankArgument"!==this.arg.type};d.prototype.equals=function(a){return this===a?!0:null==a?!1:this.valueEquals(a)&&this.argEquals(a)};d.prototype.valueEquals=function(a){return this.value===a.value};d.prototype.argEquals=function(a){return null==
a?!1:this.arg.equals(a.arg)};d.prototype.getStatus=function(a){return this._status};d.prototype.toString=function(){return this.arg.toString()};d.prototype.getPredictions=function(){return"function"===typeof this.predictions?this.predictions():b.resolve(this.predictions||[])};d.prototype.constrainPredictionIndex=function(a){return null==a?b.resolve():this.getPredictions().then(function(c){if(0!==c.length)return a%=c.length,0>a&&(a=c.length+a),a}.bind(this))};d.maxPredictions=11;m.Conversion=d;h.prototype=
Object.create(d.prototype);h.prototype.assign=function(a){this.conversions.forEach(function(c){c.assign(a)},this);this.assignment=a};h.prototype.getStatus=function(a){return a&&a.conversion?a.conversion.getStatus():this._status};h.prototype.isDataProvided=function(){return 0<this.conversions.length};h.prototype.valueEquals=function(a){if(!(a instanceof h))throw Error("Can't compare values with non ArrayConversion");if(this.value===a.value)return!0;if(this.value.length!==a.value.length)return!1;for(var c=
0;c<this.conversions.length;c++)if(!this.conversions[c].valueEquals(a.conversions[c]))return!1;return!0};h.prototype.toString=function(){return"[ "+this.conversions.map(function(a){return a.toString()},this).join(", ")+" ]"};m.ArrayConversion=h;l.prototype.stringify=function(a){throw Error("Not implemented");};l.prototype.parse=function(a){throw Error("Not implemented");};l.prototype.parseString=function(a){return this.parse(new f(a))};l.prototype.name=void 0;l.prototype.increment=function(a){};l.prototype.decrement=
function(a){};l.prototype.getBlank=function(){return new d(void 0,new a,g.INCOMPLETE,"")};l.prototype.getType=function(){return this};m.Type=l;var c={};m.getTypeNames=function(){return Object.keys(c)};m.registerType=function(a){if("object"===typeof a)if(a instanceof l){if(!a.name)throw Error("All registered types must have a name");c[a.name]=a}else throw Error("Can't registerType using: "+a);else if("function"===typeof a){if(!a.prototype.name)throw Error("All registered types must have a name");c[a.prototype.name]=
a}else throw Error("Unknown type: "+a);};m.registerTypes=function(a){Object.keys(a).forEach(function(c){var b=a[c];b.name=c;a.registerType(b)})};m.deregisterType=function(a){delete c[a.name]};m.getType=function(a){var b;if("string"===typeof a)return b=c[a],"function"===typeof b&&(b=new b({})),b;if("object"===typeof a){if(!a.name)throw Error("Missing 'name' member to typeSpec");b=c[a.name];"function"===typeof b&&(b=new b(a));return b}throw Error("Can't extract type from "+a);}});
define("gcli/types/spell",["require","exports","module"],function(k,m,n){m.correct=function(d,h){if(0!==h.length){var k={},b;h.forEach(function(b){var a=d.length,g=b.length,c=Array(a+1),e=Array(a+1),h=Array(a+1),m,q;for(m=0;m<=a;m++)e[m]=1*m;for(q=1;q<=g;q++){c[0]=1*q;for(m=1;m<=a;m++)c[m]=Math.min(c[m-1]+1,e[m]+1,e[m-1]+(d[m-1]===b[q-1]?0:2)),1<m&&1<q&&d[m-1]===b[q-2]&&b[q-1]===d[m-2]&&(c[m]=Math.min(c[m],h[m-2]+1));m=h;h=e;e=c;c=m}k[b]=e[a]});b=h.sort(function(b,a){return k[b]!==k[a]?k[b]-k[a]:
b<a});if(4>=k[b[0]])return b[0]}}});
define("gcli/types/selection","require exports module util/promise util/util util/l10n gcli/types gcli/types gcli/types gcli/types gcli/types/spell gcli/argument".split(" "),function(k,m,n){function d(a){a&&Object.keys(a).forEach(function(c){this[c]=a[c]},this)}function h(a,c){if(q&&!c){var d=b.defer();setTimeout(function(){b.resolve(a).then(function(a){"function"===typeof a&&(a=h(a(),c));d.resolve(a)})},500);return d.promise}return b.resolve(a).then(function(a){return"function"===typeof a?h(a(),
c):a})}function l(a){if(!Array.isArray(a))throw Error("SelectionType has no lookup or data");return a.map(function(a){return{name:a,value:a}},this)}var b=k("util/promise"),f=k("util/util"),a=k("util/l10n"),g=k("gcli/types");n=k("gcli/types").Type;var c=k("gcli/types").Status,e=k("gcli/types").Conversion,p=k("gcli/types/spell"),r=k("gcli/argument").BlankArgument;m.startup=function(){g.registerType(d)};m.shutdown=function(){g.unregisterType(d)};d.prototype=Object.create(n.prototype);d.prototype.stringify=
function(a){if(null==a)return"";if(null!=this.stringifyProperty)return a[this.stringifyProperty];try{var c=null;f.synchronize(this.getLookup()).some(function(b){return b.value===a?(c=b.name,!0):!1},this);return c}catch(b){return a.toString()}};d.prototype.clearCache=function(){delete this._cachedLookup};d.prototype.getLookup=function(){if(null!=this._cachedLookup)return this._cachedLookup;var a;null==this.lookup?a=h(this.data,this.neverForceAsync).then(l):(a="function"===typeof this.lookup?this.lookup.bind(this):
this.lookup,a=h(a,this.neverForceAsync));this.cacheable&&!q&&(this._cachedLookup=a);return a};var q=!1;d.prototype._findPredictions=function(a,c){return b.resolve(this.getLookup()).then(function(b){var d=[],g,f,h=e.maxPredictions,k=a.text.toLowerCase();if(c||0<a.suffix.length){var l;for(g=0;g<b.length&&d.length<h;g++)if(f=b[g],f.name===a.text){if(!f.value.exec){l=!0;d=[];break}this._addToPredictions(d,f,a)}if(!l)return d}for(g=0;g<b.length;g++)f=b[g],null==f._gcliLowerName&&(f._gcliLowerName=f.name.toLowerCase());
for(g=0;g<b.length&&d.length<h;g++)f=b[g],f.name===a.text&&this._addToPredictions(d,f,a);for(g=0;g<b.length&&d.length<h;g++)f=b[g],0===f._gcliLowerName.indexOf(k)&&!f.value.hidden&&-1===d.indexOf(f)&&this._addToPredictions(d,f,a);if(d.length<h/2)for(g=0;g<b.length&&d.length<h;g++)f=b[g],-1!==f._gcliLowerName.indexOf(k)&&!f.value.hidden&&-1===d.indexOf(f)&&this._addToPredictions(d,f,a);if(0===d.length){var m=[];b.forEach(function(a){a.value.hidden||m.push(a.name)});var q=p.correct(k,m);q&&b.forEach(function(a){a.name===
q&&d.push(a)},this)}return d}.bind(this))};d.prototype._addToPredictions=function(a,c,b){a.push(c)};d.prototype.parse=function(d){return this._findPredictions(d).then(function(g){if(0===g.length){var f=a.lookupFormat("typesSelectionNomatch",[d.text]);return new e(void 0,d,c.ERROR,f,b.resolve(g))}this.noMatch&&this.noMatch();return g[0].name===d.text?new e(g[0].value,d,c.VALID,"",b.resolve(g)):new e(void 0,d,c.INCOMPLETE,"",b.resolve(g))}.bind(this))};d.prototype.getBlank=function(){var a=function(){return b.resolve(this.getLookup()).then(function(a){return a.filter(function(a){return!a.value.hidden}).slice(0,
e.maxPredictions-1)},console.error)}.bind(this);return new e(void 0,new r,c.INCOMPLETE,"",a)};d.prototype.decrement=function(a){var c=f.synchronize(this.getLookup());a=this._findValue(c,a);-1===a&&(a=0);a++;a>=c.length&&(a=0);return c[a].value};d.prototype.increment=function(a){var c=f.synchronize(this.getLookup());a=this._findValue(c,a);-1===a&&(a=1);a--;0>a&&(a=c.length-1);return c[a].value};d.prototype._findValue=function(a,c){for(var b=-1,d=0;d<a.length;d++)if(a[d].value===c){b=d;break}return b};
d.prototype.name="selection";m.SelectionType=d});
define("gcli/types/basic","require exports module util/promise util/util util/l10n gcli/types gcli/types gcli/types gcli/types gcli/types gcli/types/selection gcli/argument gcli/argument".split(" "),function(k,m,n){function d(a){}function h(a){this._allowFloat=!!a.allowFloat;if(a){if(this._min=a.min,this._max=a.max,this._step=a.step||1,!this._allowFloat&&(this._isFloat(this._min)||this._isFloat(this._max)||this._isFloat(this._step)))throw Error("allowFloat is false, but non-integer values given in type spec");}else this._step=
1}function l(a){}function b(a){if("function"!==typeof a.delegateType)throw Error("Instances of DelegateType need typeSpec.delegateType to be a function that returns a type");Object.keys(a).forEach(function(c){this[c]=a[c]},this)}function f(a){}function a(a){a.subtype||(console.error("Array.typeSpec is missing subtype. Assuming string."+JSON.stringify(a)),a.subtype="string");Object.keys(a).forEach(function(c){this[c]=a[c]},this);this.subtype=p.getType(this.subtype)}var g=k("util/promise"),c=k("util/util"),
e=k("util/l10n"),p=k("gcli/types");n=k("gcli/types").Type;var r=k("gcli/types").Status,q=k("gcli/types").Conversion,s=k("gcli/types").ArrayConversion,w=k("gcli/types/selection").SelectionType,u=k("gcli/argument").BlankArgument,y=k("gcli/argument").ArrayArgument;m.startup=function(){p.registerType(d);p.registerType(h);p.registerType(l);p.registerType(f);p.registerType(b);p.registerType(a)};m.shutdown=function(){p.unregisterType(d);p.unregisterType(h);p.unregisterType(l);p.unregisterType(f);p.unregisterType(b);
p.unregisterType(a)};d.prototype=Object.create(n.prototype);d.prototype.stringify=function(a){return null==a?"":a.toString()};d.prototype.parse=function(a){return null==a.text||""===a.text?g.resolve(new q(void 0,a,r.INCOMPLETE,"")):g.resolve(new q(a.text,a))};d.prototype.name="string";m.StringType=d;h.prototype=Object.create(n.prototype);h.prototype.stringify=function(a){return null==a?"":""+a};h.prototype.getMin=function(){if(this._min){if("function"===typeof this._min)return this._min();if("number"===
typeof this._min)return this._min}};h.prototype.getMax=function(){if(this._max){if("function"===typeof this._max)return this._max();if("number"===typeof this._max)return this._max}};h.prototype.parse=function(a){if(0===a.text.replace(/^\s*-?/,"").length)return g.resolve(new q(void 0,a,r.INCOMPLETE,""));if(!this._allowFloat&&-1!==a.text.indexOf(".")){var c=e.lookupFormat("typesNumberNotInt2",[a.text]);return g.resolve(new q(void 0,a,r.ERROR,c))}c=this._allowFloat?parseFloat(a.text):parseInt(a.text,
10);if(isNaN(c))return c=e.lookupFormat("typesNumberNan",[a.text]),g.resolve(new q(void 0,a,r.ERROR,c));var b=this.getMax();if(null!=b&&c>b)return c=e.lookupFormat("typesNumberMax",[c,b]),g.resolve(new q(void 0,a,r.ERROR,c));b=this.getMin();return null!=b&&c<b?(c=e.lookupFormat("typesNumberMin",[c,b]),g.resolve(new q(void 0,a,r.ERROR,c))):g.resolve(new q(c,a))};h.prototype.decrement=function(a){if("number"!==typeof a||isNaN(a))return this.getMax()||1;a-=this._step;a=Math.ceil(a/this._step)*this._step;
return this._boundsCheck(a)};h.prototype.increment=function(a){if("number"!==typeof a||isNaN(a))return a=this.getMin(),null!=a?a:0;a+=this._step;a=Math.floor(a/this._step)*this._step;return null==this.getMax()?a:this._boundsCheck(a)};h.prototype._boundsCheck=function(a){var c=this.getMin();if(null!=c&&a<c)return c;c=this.getMax();return null!=c&&a>c?c:a};h.prototype._isFloat=function(a){return"number"===typeof a&&isFinite(a)&&0!==a%1};h.prototype.name="number";m.NumberType=h;l.prototype=Object.create(w.prototype);
l.prototype.lookup=[{name:"false",value:!1},{name:"true",value:!0}];l.prototype.parse=function(a){return"TrueNamedArgument"===a.type?g.resolve(new q(!0,a)):"FalseNamedArgument"===a.type?g.resolve(new q(!1,a)):w.prototype.parse.call(this,a)};l.prototype.stringify=function(a){return null==a?"":""+a};l.prototype.getBlank=function(){return new q(!1,new u,r.VALID,"",g.resolve(this.lookup))};l.prototype.name="boolean";m.BooleanType=l;b.prototype.delegateType=function(){throw Error("Not implemented");};
b.prototype=Object.create(n.prototype);b.prototype.stringify=function(a){return this.delegateType().stringify(a)};b.prototype.parse=function(a){return this.delegateType().parse(a)};b.prototype.decrement=function(a){var c=this.delegateType();return c.decrement?c.decrement(a):void 0};b.prototype.increment=function(a){var c=this.delegateType();return c.increment?c.increment(a):void 0};b.prototype.getType=function(){return this.delegateType()};Object.defineProperty(b.prototype,"isImportant",{get:function(){return this.delegateType().isImportant},
enumerable:!0});b.prototype.name="delegate";m.DelegateType=b;f.prototype=Object.create(n.prototype);f.prototype.stringify=function(a){return""};f.prototype.parse=function(a){return g.resolve(new q(void 0,a))};f.prototype.name="blank";m.BlankType=f;a.prototype=Object.create(n.prototype);a.prototype.stringify=function(a){return null==a?"":a.join(" ")};a.prototype.parse=function(a){if("ArrayArgument"!==a.type)throw console.error("non ArrayArgument to ArrayType.parse",a),Error("non ArrayArgument to ArrayType.parse");
var b=function(a){return this.subtype.parse(a).then(function(c){return a.conversion=c}.bind(this),console.error)}.bind(this),b=a.getArguments().map(b);return c.all(b).then(function(c){return new s(c,a)})};a.prototype.getBlank=function(a){return new s([],new y)};a.prototype.name="array";m.ArrayType=a});
define("gcli/canon","require exports module util/promise util/util util/l10n gcli/types gcli/types gcli/types/basic gcli/types/selection".split(" "),function(k,m,n){function d(a,c){if(null==a)return c?f.lookup(c):a;if("string"===typeof a)return a;if("object"===typeof a){if(a.key)return f.lookup(a.key);var b=f.getPreferredLocales(),d;b.some(function(c){d=a[c];return null!=d});if(null!=d)return d;console.error("Can't find locale in descriptions: locales\x3d"+JSON.stringify(b)+", description\x3d"+JSON.stringify(a));
return"(No description)"}return f.lookup(c)}function h(a){Object.keys(a).forEach(function(c){this[c]=a[c]},this);if(!this.name)throw Error("All registered commands must have a name");null==this.params&&(this.params=[]);if(!Array.isArray(this.params))throw Error("command.params must be an array in "+this.name);this.hasNamedParameters=!1;this.description="description"in this?this.description:void 0;this.description=d(this.description,"canonDescNone");this.manual="manual"in this?this.manual:void 0;this.manual=
d(this.manual);var c=this.params;this.params=[];var b=!1;null==this.returnType&&(this.returnType="string");c.forEach(function(a){if(a.group)a.params.forEach(function(c){c=new l(c,this,a.group);this.params.push(c);c.isPositionalAllowed||(this.hasNamedParameters=!0)},this),b=!0;else{if(b)throw Error("Parameters can't come after param groups. Ignoring "+this.name+"/"+a.name);var c=new l(a,this,null);this.params.push(c);c.isPositionalAllowed||(this.hasNamedParameters=!0)}},this)}function l(b,d,e){this.command=
d||{name:"unnamed"};this.paramSpec=b;this.name=this.paramSpec.name;this.type=this.paramSpec.type;this.groupName=e;if(!this.name)throw Error("In "+this.command.name+": all params must have a name");b=this.type;this.type=a.getType(b);if(null==this.type)throw console.error("Known types: "+a.getTypeNames().join(", ")),Error("In "+this.command.name+"/"+this.name+": can't find type for: "+JSON.stringify(b));if(this.type instanceof c&&void 0!==this.paramSpec.defaultValue)throw Error("In "+this.command.name+
"/"+this.name+": boolean parameters can not have a defaultValue. Ignoring");if(null!=this._defaultValue)try{var f=this.type.stringify(this.paramSpec.defaultValue);this.type.parseString(f).then(function(a){a.getStatus()!==g.VALID&&console.error("In "+this.command.name+"/"+this.name+": Error round tripping defaultValue. status \x3d "+a.getStatus())}.bind(this),console.error)}catch(h){throw Error("In "+this.command.name+"/"+this.name+": "+h);}if(!this.isPositionalAllowed&&void 0===this.paramSpec.defaultValue&&
null==this.type.getBlank&&!(this.type instanceof c))throw Error("In "+this.command.name+"/"+this.name+": Missing defaultValue for optional parameter.");}k("util/promise");var b=k("util/util"),f=k("util/l10n"),a=k("gcli/types"),g=k("gcli/types").Status,c=k("gcli/types/basic").BooleanType;k("gcli/types/selection");m.Command=h;Object.defineProperty(l.prototype,"defaultValue",{get:function(){"_defaultValue"in this||(this._defaultValue=void 0!==this.paramSpec.defaultValue?this.paramSpec.defaultValue:this.type.getBlank().value);
return this._defaultValue},enumerable:!0});l.prototype.isKnownAs=function(a){return a==="--"+this.name?!0:!1};l.prototype.getBlank=function(){return this.type.getBlank()};Object.defineProperty(l.prototype,"manual",{get:function(){return d(this.paramSpec.manual||void 0)},enumerable:!0});Object.defineProperty(l.prototype,"description",{get:function(){return d(this.paramSpec.description||void 0,"canonDescNone")},enumerable:!0});Object.defineProperty(l.prototype,"isDataRequired",{get:function(){return void 0===
this.defaultValue},enumerable:!0});Object.defineProperty(l.prototype,"hidden",{get:function(){return this.paramSpec.hidden},enumerable:!0});Object.defineProperty(l.prototype,"isPositionalAllowed",{get:function(){return null==this.groupName},enumerable:!0});m.Parameter=l;var e={},p=[],r={};m.addCommand=function(a){null!=e[a.name]&&(delete e[a.name],p=p.filter(function(c){return c!==a.name}));var c=new h(a);e[a.name]=c;p.push(a.name);p.sort();r[a.name]=a;m.onCanonChange();return c};m.removeCommand=
function(a){var c="string"===typeof a?a:a.name;if(!e[c])return!1;delete e[c];delete r[c];p=p.filter(function(a){return a!==c});m.onCanonChange();return!0};m.getCommand=function(a){return e[a]||void 0};m.getCommands=function(){return Object.keys(e).map(function(a){return e[a]},this)};m.getCommandNames=function(){return p.slice(0)};m.getCommandSpecs=function(){return r};m.onCanonChange=b.createEvent("canon.onCanonChange");m.CommandOutputManager=function(){this.onOutput=b.createEvent("CommandOutputManager.onOutput")}});
define("gcli/types/command","require exports module util/promise util/l10n gcli/canon gcli/types gcli/types/selection gcli/types gcli/types".split(" "),function(k,m,n){function d(a){this.requisition=a.requisition;this.isIncompleteName=a.isIncompleteName;this.stringifyProperty="name";this.neverForceAsync=!0}function h(){this.stringifyProperty="name";this.neverForceAsync=!0}var l=k("util/promise"),b=k("util/l10n"),f=k("gcli/canon"),a=k("gcli/types"),g=k("gcli/types/selection").SelectionType,c=k("gcli/types").Status,
e=k("gcli/types").Conversion;m.startup=function(){a.registerType(h);a.registerType(d)};m.shutdown=function(){a.unregisterType(h);a.unregisterType(d)};d.prototype=Object.create(g.prototype);d.prototype.name="param";d.prototype.lookup=function(){var a=[],c=this.requisition.commandAssignment.value;null!=c&&c.params.forEach(function(c){var b=this.requisition.getAssignment(c.name).arg;!c.isPositionalAllowed&&"BlankArgument"===b.type&&a.push({name:"--"+c.name,value:c})},this);return a};d.prototype.parse=
function(a,d){if(this.isIncompleteName)return g.prototype.parse.call(this,a);var f=b.lookup("cliUnusedArg");if(d){var h=d.commandAssignment.conversion;h.getStatus()===c.ERROR&&h.message&&(f=h.message)}return l.resolve(new e(void 0,a,c.ERROR,f))};h.prototype=Object.create(g.prototype);h.prototype.name="command";h.prototype.lookup=function(){var a=f.getCommands();a.sort(function(a,c){return a.name.localeCompare(c.name)});return a.map(function(a){return{name:a.name,value:a}},this)};h.prototype._addToPredictions=
function(a,c,b){(0!==b.text.length||-1===c.name.indexOf(" "))&&a.push(c)};h.prototype.parse=function(a,d){var g=function(){return this._findPredictions(a,d)}.bind(this);return this._findPredictions(a,d).then(function(d){if(0===d.length)return d=b.lookupFormat("typesSelectionNomatch",[a.text]),new e(void 0,a,c.ERROR,d,g);var f=d[0].value;return 1===d.length?f.name===a.text&&"function"===typeof f.exec?new e(f,a,c.VALID,""):new e(void 0,a,c.INCOMPLETE,"",g):d[0].name===a.text?new e(f,a,c.VALID,"",g):
new e(void 0,a,c.INCOMPLETE,"",g)}.bind(this))}});
define("gcli/types/javascript","require exports module util/promise util/l10n gcli/types".split(" "),function(k,m,n){function d(a){}function h(a){return 0===a.indexOf("moz")||0===a.indexOf("webkit")||0===a.indexOf("ms")}var l=k("util/promise"),b=k("util/l10n"),f=k("gcli/types"),a=f.Conversion;k=f.Type;var g=f.Status;m.startup=function(){f.registerType(d)};m.shutdown=function(){f.unregisterType(d)};var c=void 0;"undefined"!==typeof window&&(c=window);m.setGlobalObject=function(a){c=a};m.getGlobalObject=
function(){return c};m.unsetGlobalObject=function(){c=void 0};d.prototype=Object.create(k.prototype);d.prototype.stringify=function(a){return null==a?"":a};d.MAX_COMPLETION_MATCHES=10;d.prototype.parse=function(f){var k=f.text,m=c;if(""===k)return l.resolve(new a(void 0,f,g.INCOMPLETE));if(!isNaN(parseFloat(k))&&isFinite(k)||k.trim().match(/(null|undefined|NaN|Infinity|true|false)/))return l.resolve(new a(k,f));var p=this._findCompletionBeginning(k);if(p.err)return l.resolve(new a(k,f,g.ERROR,p.err));
if(p.state===e.COMPLEX)return l.resolve(new a(k,f));if(p.state!==e.NORMAL)return l.resolve(new a(k,f,g.INCOMPLETE,""));var p=k.substring(p.startPos).split("."),n,q=void 0;if(1<p.length){n=p.pop().trimLeft();for(var r=0;r<p.length;r++){q=p[r].trim();if(null==m)return l.resolve(new a(k,f,g.ERROR,b.lookup("jstypeParseScope")));if(""===q)return l.resolve(new a(k,f,g.INCOMPLETE,""));if(this._isSafeProperty(m,q))return l.resolve(new a(k,f));try{m=m[q]}catch(s){return l.resolve(new a(k,f,g.VALID,""))}}}else n=
p[0].trimLeft();if(q&&!q.match(/^[0-9A-Za-z]*$/))return l.resolve(new a(k,f));if(null==m)return p=b.lookupFormat("jstypeParseMissing",[q]),l.resolve(new a(k,f,g.ERROR,p));if(!n.match(/^[0-9A-Za-z]*$/)||this._isIteratorOrGenerator(m))return l.resolve(new a(k,f));var p=n.length,D=0===p?k:k.slice(0,-p),F=g.INCOMPLETE,p="",E={},x=0,q=m;try{for(;null!=q&&Object.keys(E).length<d.MAX_COMPLETION_MATCHES;)Object.keys(q).forEach(function(a){0===a.indexOf(n)&&!(a in E)&&(E[a]={prop:a,distUpPrototypeChain:x})}),
x++,q=Object.getPrototypeOf(q)}catch(C){return l.resolve(new a(k,f,g.INCOMPLETE,""))}E=Object.keys(E).map(function(a){a===n&&(F=g.VALID);return E[a]});E.sort(function(a,c){return a.distUpPrototypeChain!==c.distUpPrototypeChain?a.distUpPrototypeChain-c.distUpPrototypeChain:h(a.prop)?h(c.prop)?a.prop.localeCompare(c.prop):1:h(c.prop)?-1:a.prop.localeCompare(c.prop)});E.length>d.MAX_COMPLETION_MATCHES&&(E=E.slice(0,d.MAX_COMPLETION_MATCHES-1));q=E.map(function(a){var c,d=!0;if(this._isSafeProperty(m,
a.prop))c="(property getter)";else try{var e=m[a.prop];"function"===typeof e?c="(function)":"boolean"===typeof e||"number"===typeof e?(c="\x3d "+e,d=!1):"string"===typeof e?(40<e.length&&(e=e.substring(0,37)+"\u2026"),c="\x3d '"+e+"'",d=!1):c="("+typeof e+")"}catch(g){c="("+b.lookup("jstypeParseError")+")"}return{name:D+a.prop,value:{name:D+a.prop,description:c},description:c,incomplete:d}},this);0===q.length&&(F=g.ERROR,p=b.lookupFormat("jstypeParseMissing",[n]));1===q.length&&F===g.VALID&&(q=[]);
return l.resolve(new a(k,f,F,p,l.resolve(q)))};var e={NORMAL:0,COMPLEX:1,QUOTE:2,DQUOTE:3},p=["{","[","("],r=["}","]",")"],q={"{":"}","[":"]","(":")"},s=/[a-zA-Z0-9.]/;d.prototype._findCompletionBeginning=function(a){for(var c=[],d=e.NORMAL,g=0,f,h=!1,k=0;k<a.length;k++)switch(f=a[k],s.test(f)||(h=!0),d){case e.NORMAL:if('"'===f)d=e.DQUOTE;else if("'"===f)d=e.QUOTE;else if(";"===f)g=k+1;else if(" "===f)g=k+1;else if(-1!=p.indexOf(f))c.push({token:f,start:g}),g=k+1;else if(-1!=r.indexOf(f)){g=c.pop();
if(!g||q[g.token]!=f)return{err:b.lookup("jstypeBeginSyntax")};g="}"===f?k+1:g.start}break;case e.DQUOTE:if("\\"===f)k++;else{if("\n"===f)return{err:b.lookup("jstypeBeginUnterm")};'"'===f&&(d=e.NORMAL)}break;case e.QUOTE:if("\\"===f)k++;else{if("\n"===f)return{err:b.lookup("jstypeBeginUnterm")};"'"===f&&(d=e.NORMAL)}}d===e.NORMAL&&h&&(d=e.COMPLEX);return{state:d,startPos:g}};d.prototype._isIteratorOrGenerator=function(a){if(null===a)return!1;if("object"===typeof aObject){if("function"===typeof a.__iterator__||
a.constructor&&"Iterator"===a.constructor.name)return!0;try{var c=a.toString();if("function"===typeof a.next&&0===c.indexOf("[object Generator"))return!0}catch(b){}}return!1};d.prototype._isSafeProperty=function(a,c){if("object"!==typeof a)return!1;for(var b=void 0;a;){try{if(b=Object.getOwnPropertyDescriptor(a,c))break}catch(d){return"NS_ERROR_XPC_BAD_CONVERT_JS"===d.name||"NS_ERROR_XPC_BAD_OP_ON_WN_PROTO"===d.name?!1:!0}a=Object.getPrototypeOf(a)}return!b||!b.get?!1:"function"!==typeof b.get||"prototype"in
b.get};d.prototype.name="javascript";m.JavascriptType=d});
define("util/host",["require","exports","module"],function(k,m,n){function d(d,k){if(!d.__gcliHighlighting){d.__gcliHighlighting=!0;var b=d.style.background;d.style.background=k?"green":"red";setTimeout(function(){d.style.background=b;delete d.__gcliHighlighting},500)}}m.flashNodes=function(h,k){h.style?d(h,k):Array.prototype.forEach.call(h,function(b){d(b,k)})};m.exec=function(d,k){var b=JSON.stringify(k),f=new XMLHttpRequest;f.open("POST","/exec/",!0);f.setRequestHeader("Content-Type","application/json; charset\x3dutf-8");
f.setRequestHeader("Content-Length",b.length);f.onreadystatechange=function(a){4==f.readyState&&(300<=f.status||200>f.status?d.reject(f.responseText):d.resolve(f.responseText))};f.send(b)};m.func=function(d,k){var b=JSON.stringify(k),f=new XMLHttpRequest;f.open("POST","/func/",!0);f.setRequestHeader("Content-Type","application/json; charset\x3dutf-8");f.setRequestHeader("Content-Length",b.length);f.onreadystatechange=function(a){4==f.readyState&&(300<=f.status||200>f.status?d.reject(JSON.parse(f.responseText)):
d.resolve(JSON.parse(f.responseText)))};f.send(b)}});
define("gcli/types/node","require exports module util/promise util/host util/l10n gcli/types gcli/types gcli/types gcli/types gcli/argument".split(" "),function(k,m,n){function d(a){}function h(a){if("allowEmpty"in a&&"boolean"!==typeof a.allowEmpty)throw Error("Legal values for allowEmpty are [true|false]");this.allowEmpty=a.allowEmpty}var l=k("util/promise"),b=k("util/host"),f=k("util/l10n"),a=k("gcli/types");n=k("gcli/types").Type;var g=k("gcli/types").Status,c=k("gcli/types").Conversion,e=k("gcli/argument").BlankArgument;
m.startup=function(){a.registerType(d);a.registerType(h)};m.shutdown=function(){a.unregisterType(d);a.unregisterType(h)};var p=void 0;"undefined"!==typeof document&&(p=document);m._empty=[];m.setDocument=function(a){p=a;null!=p&&(m._empty=p.querySelectorAll("x\x3e:root"))};m.unsetDocument=function(){p=void 0;m._empty=void 0};m.getDocument=function(){return p};d.prototype=Object.create(n.prototype);d.prototype.stringify=function(a){return null==a?"":a.__gcliQuery||"Error"};d.prototype.parse=function(a){if(""===
a.text)return l.resolve(new c(void 0,a,g.INCOMPLETE));var d;try{d=p.querySelectorAll(a.text)}catch(e){return l.resolve(new c(void 0,a,g.ERROR,f.lookup("nodeParseSyntax")))}if(0===d.length)return l.resolve(new c(void 0,a,g.INCOMPLETE,f.lookup("nodeParseNone")));if(1===d.length)return d=d.item(0),d.__gcliQuery=a.text,b.flashNodes(d,!0),l.resolve(new c(d,a,g.VALID,""));b.flashNodes(d,!1);d=f.lookupFormat("nodeParseMultiple",[d.length]);return l.resolve(new c(void 0,a,g.ERROR,d))};d.prototype.name="node";
h.prototype=Object.create(n.prototype);h.prototype.getBlank=function(){return new c(m._empty,new e,g.VALID)};h.prototype.stringify=function(a){return null==a?"":a.__gcliQuery||"Error"};h.prototype.parse=function(a){if(""===a.text)return l.resolve(new c(void 0,a,g.INCOMPLETE));var d;try{d=p.querySelectorAll(a.text)}catch(e){return l.resolve(new c(void 0,a,g.ERROR,f.lookup("nodeParseSyntax")))}if(0===d.length&&!this.allowEmpty)return l.resolve(new c(void 0,a,g.INCOMPLETE,f.lookup("nodeParseNone")));
b.flashNodes(d,!1);return l.resolve(new c(d,a,g.VALID,""))};h.prototype.name="nodelist"});
define("gcli/types/resource","require exports module util/promise gcli/types gcli/types/selection".split(" "),function(k,m,n){function d(a,c,b,d){this.name=a;this.type=c;this.inline=b;this.element=d}function h(a){(this.name=a.href)||(this.name=a.ownerNode.id?"css#"+a.ownerNode.id:"inline-css");this.inline=null==a.href;this.type=d.TYPE_CSS;this.element=a}function l(a){(this.name=a.src)||(this.name=a.id?"script#"+a.id:"inline-script");this.inline=""===a.src||null==a.src;this.type=d.TYPE_SCRIPT;this.element=
a}function b(a,c){var b={};a.forEach(function(a){null==b[a.name]&&(b[a.name]=[]);b[a.name].push(a)});Object.keys(b).forEach(function(a){a=b[a];1<a.length&&c(a)})}function f(a){this.include=a.include;if(this.include!==d.TYPE_SCRIPT&&this.include!==d.TYPE_CSS&&null!=this.include)throw Error("invalid include property: "+this.include);}var a=k("util/promise"),g=k("gcli/types");k=k("gcli/types/selection").SelectionType;m.startup=function(){g.registerType(f)};m.shutdown=function(){g.unregisterType(f);m.clearResourceCache()};
m.clearResourceCache=function(){e.clear()};var c=void 0;"undefined"!==typeof document&&(c=document);m.setDocument=function(a){c=a};m.unsetDocument=function(){e.clear();c=void 0};m.getDocument=function(){return c};d.prototype.getContents=function(){throw Error("not implemented");};d.TYPE_SCRIPT="text/javascript";d.TYPE_CSS="text/css";h.prototype=Object.create(d.prototype);h.prototype.loadContents=function(a){a(this.element.ownerNode.innerHTML)};h._getAllStyles=function(){var a=[];if(null==c)return a;
Array.prototype.forEach.call(c.styleSheets,function(c){h._getStyle(c,a)});b(a,function(a){for(var c=0;c<a.length;c++)a[c].name=a[c].name+"-"+c});return a};h._getStyle=function(a,c){var b=e.get(a);b||(b=new h(a),e.add(a,b));c.push(b);try{Array.prototype.forEach.call(a.cssRules,function(a){a.type==CSSRule.IMPORT_RULE&&a.styleSheet&&h._getStyle(a.styleSheet,c)},this)}catch(d){}};l.prototype=Object.create(d.prototype);l.prototype.loadContents=function(a){if(this.inline)a(this.element.innerHTML);else{var c=
new XMLHttpRequest;c.onreadystatechange=function(){c.readyState===c.DONE&&a(c.responseText)};c.open("GET",this.element.src,!0);c.send()}};l._getAllScripts=function(){if(null==c)return[];var a=c.querySelectorAll("script"),a=Array.prototype.map.call(a,function(a){var c=e.get(a);c||(c=new l(a),e.add(a,c));return c});b(a,function(a){for(var c=0;c<a.length;c++)a[c].name=a[c].name+"-"+c});return a};f.prototype=Object.create(k.prototype);f.prototype.getLookup=function(){var c=[];this.include!==d.TYPE_SCRIPT&&
Array.prototype.push.apply(c,h._getAllStyles());this.include!==d.TYPE_CSS&&Array.prototype.push.apply(c,l._getAllScripts());return a.resolve(c.map(function(a){return{name:a.name,value:a}}))};f.prototype.name="resource";var e={_cached:[],get:function(a){for(var c=0;c<e._cached.length;c++)if(e._cached[c].node===a)return e._cached[c].resource;return null},add:function(a,c){e._cached.push({node:a,resource:c})},clear:function(){e._cached=[]}}});
define("gcli/settings",["require","exports","module","util/util","gcli/types"],function(k,m,n){function d(){}function h(a,b,d,g){this.name=a;this.type=b;this.description=d;this._defaultValue=g;this.onChange=l.createEvent("Setting.onChange");this.setDefault()}var l=k("util/util"),b=k("gcli/types"),f={},a={},g;m.setDefaults=function(c){Object.keys(c).forEach(function(b){void 0===a[b]&&(a[b]=c[b])})};m.startup=function(){g=new d;g.load(a)};m.shutdown=function(){};m.getAll=function(a){var b=[];Object.keys(f).forEach(function(d){(null==
a||-1!==d.indexOf(a))&&b.push(f[d])}.bind(this));b.sort(function(a,c){return a.name.localeCompare(c.name)}.bind(this));return b};m.addSetting=function(a){var d=b.getType(a.type);a=new h(a.name,d,a.description,a.defaultValue);f[a.name]=a;m.onChange({added:a.name});return a};m.getSetting=function(a){return f[a]};m.removeSetting=function(a){a="string"===typeof nameOrPrefSpec?a:a.name;delete f[a];m.onChange({removed:a})};m.onChange=l.createEvent("Settings.onChange");d.prototype.load=function(a){if("undefined"!==
typeof localStorage){var b=localStorage.getItem("gcli-settings");if(null!=b){var d=JSON.parse(b);Object.keys(d).forEach(function(b){a[b]=d[b]})}}};d.prototype.save=function(a){"undefined"!==typeof localStorage&&(a=JSON.stringify(a),localStorage.setItem("gcli-settings",a))};m.LocalSettingStorage=d;h.prototype.setDefault=function(){this.value=this._defaultValue};Object.defineProperty(h.prototype,"value",{get:function(){return a[this.name]},set:function(c){a[this.name]=c;g.save(a);this.onChange({setting:this,
value:c})},enumerable:!0})});
define("gcli/types/setting","require exports module gcli/settings gcli/types gcli/types/selection gcli/types/basic".split(" "),function(k,m,n){function d(a){l.onChange.add(function(a){this.clearCache()},this)}function h(a){}var l=k("gcli/settings"),b=k("gcli/types"),f=k("gcli/types/selection").SelectionType;k=k("gcli/types/basic").DelegateType;m.startup=function(){b.registerType(d);b.registerType(h)};m.shutdown=function(){b.unregisterType(d);b.unregisterType(h)};var a=null;d.prototype=new f({cacheable:!0});
d.prototype.lookup=function(){return l.getAll().map(function(a){return{name:a.name,value:a}})};d.prototype.noMatch=function(){a=null};d.prototype.stringify=function(b){a=b;return f.prototype.stringify.call(this,b)};d.prototype.parse=function(b){b=f.prototype.parse.call(this,b);b.then(function(c){a=c.value});return b};d.prototype.name="setting";h.prototype=Object.create(k.prototype);h.prototype.delegateType=function(){return null!=a?a.type:b.getType("blank")};h.prototype.name="settingValue"});
define("util/domtemplate",["require","exports","module"],function(k,m,n){function d(d,b,f){f=new h(f||{});f.processNode(d,b);return f}function h(d){null==d&&(d={allowEval:!0});this.options=d;d.stack&&Array.isArray(d.stack)?this.stack=d.stack:this.stack="string"===typeof d.stack?[d.stack]:[];this.nodes=[]}h.prototype._templateRegion=/\$\{([^}]*)\}/g;h.prototype._splitSpecial=/\uF001|\uF002/;h.prototype._isPropertyScript=/^[_a-zA-Z0-9.]*$/;h.prototype.processNode=function(d,b){"string"===typeof d&&
(d=document.getElementById(d));null==b&&(b={});this.stack.push(d.nodeName+(d.id?"#"+d.id:""));var f=!1;try{if(d.attributes&&d.attributes.length){if(d.hasAttribute("foreach")){this._processForEach(d,b);return}if(d.hasAttribute("if")&&!this._processIf(d,b))return;this.nodes.push(b.__element);b.__element=d;for(var f=!0,a=Array.prototype.slice.call(d.attributes),g=0;g<a.length;g++){var c=a[g].value,e=a[g].name;this.stack.push(e);try{if("save"===e)c=this._stripBraces(c),this._property(c,b,d),d.removeAttribute("save");
else if("on"===e.substring(0,2))if("${"===c.substring(0,2)&&"}"===c.slice(-1)&&-1===c.indexOf("${",2)){var c=this._stripBraces(c),h=this._property(c,b);if("function"===typeof h){d.removeAttribute(e);var k=d.hasAttribute("capture"+e.substring(2));d.addEventListener(e.substring(2),h,k);k&&d.removeAttribute("capture"+e.substring(2))}else d.setAttribute(e,h)}else d.setAttribute(e,this._processString(c,b));else{d.removeAttribute(e);"_"===e.charAt(0)&&(e=e.substring(1));var m;0===c.indexOf("${")&&"}"===
c.charAt(c.length-1)?(m=this._envEval(c.slice(2,-1),b,c))&&"function"===typeof m.then?(d.setAttribute(e,""),m.then(function(a){d.setAttribute(e,a)}.bind(this)).then(null,console.error)):(this.options.blankNullUndefined&&null==m&&(m=""),d.setAttribute(e,m)):d.setAttribute(e,this._processString(c,b))}}finally{this.stack.pop()}}}for(var n=Array.prototype.slice.call(d.childNodes),a=0;a<n.length;a++)this.processNode(n[a],b);3===d.nodeType&&this._processTextNode(d,b)}finally{f&&(b.__element=this.nodes.pop()),
this.stack.pop()}};h.prototype._processString=function(d,b){return d.replace(this._templateRegion,function(f){f=this._envEval(f.slice(2,-1),b,d);return this.options.blankNullUndefined&&null==f?"":f}.bind(this))};h.prototype._processIf=function(d,b){this.stack.push("if");try{var f=d.getAttribute("if"),a=this._stripBraces(f),g=!0;try{g=!!this._envEval(a,b,f)}catch(c){this._handleError("Error with '"+a+"'",c),g=!1}g||d.parentNode.removeChild(d);d.removeAttribute("if");return g}finally{this.stack.pop()}};
h.prototype._processForEach=function(d,b){this.stack.push("foreach");try{var f=d.getAttribute("foreach"),a=f,g="param";if("$"===a.charAt(0))a=this._stripBraces(a);else var c=a.split(" in "),g=c[0].trim(),a=this._stripBraces(c[1].trim());d.removeAttribute("foreach");try{var e=this._envEval(a,b,f);this._handleAsync(e,d,function(a,c){this._processForEachLoop(a,d,c,b,g)}.bind(this));d.parentNode.removeChild(d)}catch(h){this._handleError("Error with '"+a+"'",h)}}finally{this.stack.pop()}};h.prototype._processForEachLoop=
function(d,b,f,a,g){if(Array.isArray(d))d.forEach(function(c,d){this._processForEachMember(c,b,f,a,g,""+d)},this);else for(var c in d)d.hasOwnProperty(c)&&this._processForEachMember(c,b,f,a,g,c)};h.prototype._processForEachMember=function(d,b,f,a,g,c){this.stack.push(c);try{this._handleAsync(d,f,function(c,d){a[g]=c;if(null!=d.parentNode)if("loop"===b.nodeName.toLowerCase())for(var f=0;f<b.childNodes.length;f++){var h=b.childNodes[f].cloneNode(!0);d.parentNode.insertBefore(h,d);this.processNode(h,
a)}else h=b.cloneNode(!0),h.removeAttribute("foreach"),d.parentNode.insertBefore(h,d),this.processNode(h,a);delete a[g]}.bind(this))}finally{this.stack.pop()}};h.prototype._processTextNode=function(d,b){var f=d.data,f=f.replace(this._templateRegion,"\uf001$$$1\uf002"),f=f.split(this._splitSpecial);1<f.length&&(f.forEach(function(a){null===a||void 0===a||""===a||("$"===a.charAt(0)&&(a=this._envEval(a.slice(1),b,d.data)),this._handleAsync(a,d,function(a,c){var b=c.ownerDocument;null==a&&(a=this.options.blankNullUndefined?
"":""+a);"function"===typeof a.cloneNode?(a=this._maybeImportNode(a,b),c.parentNode.insertBefore(a,c)):"function"===typeof a.item&&a.length?Array.prototype.slice.call(a,0).forEach(function(a){a=this._maybeImportNode(a,b);c.parentNode.insertBefore(a,c)}.bind(this)):(a=b.createTextNode(a.toString()),c.parentNode.insertBefore(a,c))}.bind(this)))},this),d.parentNode.removeChild(d))};h.prototype._maybeImportNode=function(d,b){return d.ownerDocument===b?d:b.importNode(d,!0)};h.prototype._handleAsync=function(d,
b,f){if(null!=d&&"function"===typeof d.then){var a=b.ownerDocument.createElement("span");b.parentNode.insertBefore(a,b);d.then(function(b){f(b,a);null!=a.parentNode&&a.parentNode.removeChild(a)}.bind(this)).then(null,function(a){console.error(a.stack)})}else f(d,b)};h.prototype._stripBraces=function(d){return!d.match(this._templateRegion)?(this._handleError("Expected "+d+" to match ${...}"),d):d.slice(2,-1)};h.prototype._property=function(d,b,f){try{"string"===typeof d&&(d=d.split("."));var a=b[d[0]];
return 1===d.length?(void 0!==f&&(b[d[0]]=f),"function"===typeof a?a.bind(b):a):!a?(this._handleError('"'+d[0]+'" is undefined'),null):this._property(d.slice(1),a,f)}catch(g){return this._handleError("Path error with '"+d+"'",g),"${"+d+"}"}};h.prototype._envEval=function(d,b,f){try{this.stack.push(f.replace(/\s+/g," "));if(this._isPropertyScript.test(d))return this._property(d,b);if(!this.options.allowEval)return this._handleError("allowEval is not set, however '"+d+"' can not be resolved using a simple property path."),
"${"+d+"}";with(b)return eval(d)}catch(a){return this._handleError("Template error evaluating '"+d+"'",a),"${"+d+"}"}finally{this.stack.pop()}};h.prototype._handleError=function(d,b){this._logError(d+" (In: "+this.stack.join(" \x3e ")+")");b&&this._logError(b)};h.prototype._logError=function(d){console.log(d)};"undefined"!==typeof m&&(m.template=d)});
define("gcli/ui/view",["require","exports","module","util/util","util/domtemplate"],function(k,m,n){var d=k("util/util"),h=k("util/domtemplate");m.createView=function(k){if(null==k.html)throw Error("options.html is missing");return{isView:!0,appendTo:function(b,f){!0===f&&d.clearElement(b);b.appendChild(this.toDom(b.ownerDocument))},toDom:function(b){k.css&&d.importCss(k.css,b,k.cssId);b=d.toDom(b,k.html);h.template(b,k.data||{},k.options||{});return b}}}});
define("gcli/cli","require exports module util/promise util/util util/l10n gcli/ui/view gcli/canon gcli/canon gcli/types gcli/types gcli/types/basic gcli/types/basic gcli/types/basic gcli/types/basic gcli/argument gcli/argument gcli/argument gcli/argument gcli/argument gcli/argument".split(" "),function(k,m,n){function d(a,b){this.param=a;this.conversion=void 0;this.paramIndex=b;this.onAssignmentChange=c.createEvent("Assignment.onAssignmentChange")}function h(){var a={name:"__command",type:"command"},
b=this;Object.defineProperty(a,"description",{get:function(){var a=b.value;return a&&a.description?a.description:"The command to execute"},enumerable:!0});this.param=new r.Parameter(a);this.paramIndex=-1;this.onAssignmentChange=c.createEvent("CommandAssignment.onAssignmentChange")}function l(a,b){this.param=new r.Parameter({name:"__unassigned",description:e.lookup("cliOptions"),type:{name:"param",requisition:a,isIncompleteName:"-"===b.text.charAt(0)}});this.paramIndex=-1;this.onAssignmentChange=c.createEvent("UnassignedAssignment.onAssignmentChange");
this.conversion=c.synchronize(this.param.type.parse(b,a));this.conversion.assign(this)}function b(a,b,d){this.environment=a;this.document=b;if(null==this.document)try{this.document=document}catch(e){}this.commandOutputManager=d||new q;this.commandAssignment=new h;a=this.setAssignment(this.commandAssignment,null,{skipArgUpdate:!0});c.synchronize(a);this._assignments={};this.assignmentCount=0;this._args=[];this._unassigned=[];this._structuralChangeInProgress=!1;this.commandAssignment.onAssignmentChange.add(this._commandAssignmentChanged,
this);this.commandAssignment.onAssignmentChange.add(this._assignmentChanged,this);this.onAssignmentChange=c.createEvent("Requisition.onAssignmentChange");this.onTextChange=c.createEvent("Requisition.onTextChange")}function f(a){for(var c=0;c<a.length;c++){var b=a.charAt(c);if(" "===b||'"'===b||"'"===b||"{"===b||"}"===b||"\\"===b)return!1}return!0}function a(a){a=a||{};this.command=a.command||"";this.args=a.args||{};this.typed=a.typed||"";this.canonical=a.canonical||"";this.hidden=!0===a.hidden?!0:
!1;this.data=void 0;this.error=this.completed=!1;this.start=new Date;this.deferred=g.defer();this.then=this.deferred.promise.then;this.onClose=c.createEvent("Output.onClose");this.onChange=c.createEvent("Output.onChange")}var g=k("util/promise"),c=k("util/util"),e=k("util/l10n"),p=k("gcli/ui/view"),r=k("gcli/canon"),q=k("gcli/canon").CommandOutputManager,s=k("gcli/types").Status,w=k("gcli/types").Conversion,u=k("gcli/types/basic").ArrayType,y=k("gcli/types/basic").StringType,t=k("gcli/types/basic").BooleanType,
v=k("gcli/types/basic").NumberType,A=k("gcli/argument").Argument,z=k("gcli/argument").ArrayArgument,K=k("gcli/argument").NamedArgument,D=k("gcli/argument").TrueNamedArgument,F=k("gcli/argument").MergedArgument,E=k("gcli/argument").ScriptArgument,x;m.startup=function(){x=r.addCommand(I)};m.shutdown=function(){r.removeCommand(I.name);x=void 0};Object.defineProperty(d.prototype,"arg",{get:function(){return this.conversion.arg},enumerable:!0});Object.defineProperty(d.prototype,"value",{get:function(){return this.conversion.value},
enumerable:!0});d.prototype.getMessage=function(){return this.conversion.message?this.conversion.message:""};d.prototype.getPredictions=function(){return this.conversion.getPredictions()};d.prototype.getPredictionAt=function(a){null==a&&(a=0);return this.isInName()?g.resolve(void 0):this.getPredictions().then(function(c){if(0!==c.length)return a%=c.length,0>a&&(a=c.length+a),c[a]}.bind(this),console.error)};d.prototype.isInName=function(){return"NamedArgument"===this.conversion.arg.type&&" "!==this.conversion.arg.prefix.slice(-1)};
d.prototype.ensureVisibleArgument=function(){if("BlankArgument"!==this.conversion.arg.type)return!1;var a=this.conversion.arg.beget({text:"",prefixSpace:this.param instanceof h});this.conversion=c.synchronize(this.param.type.parse(a));this.conversion.assign(this);return!0};d.prototype.getStatus=function(a){return this.param.isDataRequired&&!this.conversion.isDataProvided()?s.INCOMPLETE:!this.param.isDataRequired&&"BlankArgument"===this.arg.type?s.VALID:this.conversion.getStatus(a)};d.prototype.toString=
function(){return this.conversion.toString()};Object.defineProperty(d.prototype,"_summaryJson",{get:function(){var a="\x3casync\x3e";this.getPredictions().then(function(c){a=c.length},console.log);return{param:this.param.name+"/"+this.param.type.name,defaultValue:this.param.defaultValue,arg:this.conversion.arg._summaryJson,value:this.value,message:this.getMessage(),status:this.getStatus().toString(),predictionCount:a}},enumerable:!0});m.Assignment=d;var C=eval;m.setEvalFunction=function(a){C=a};m.unsetEvalFunction=
function(){C=void 0};var I={name:"{",params:[{name:"javascript",type:"javascript",description:""}],hidden:!0,returnType:"object",description:{key:"cliEvalJavascript"},exec:function(a,c){return C(a.javascript)},evalRegexp:/^\s*{\s*/};h.prototype=Object.create(d.prototype);h.prototype.getStatus=function(a){return s.combine(d.prototype.getStatus.call(this,a),this.conversion.value&&this.conversion.value.exec?s.VALID:s.INCOMPLETE)};m.CommandAssignment=h;l.prototype=Object.create(d.prototype);l.prototype.getStatus=
function(a){return this.conversion.getStatus()};b.prototype.destroy=function(){this.commandAssignment.onAssignmentChange.remove(this._commandAssignmentChanged,this);this.commandAssignment.onAssignmentChange.remove(this._assignmentChanged,this);delete this.document;delete this.environment};b.prototype._assignmentChanged=function(a){if(!(null!=a.oldConversion&&a.conversion.valueEquals(a.oldConversion))&&!this._structuralChangeInProgress&&(this.onAssignmentChange(a),!a.conversion.argEquals(a.oldConversion)))this.onTextChange()};
b.prototype._commandAssignmentChanged=function(a){if(!a.conversion.valueEquals(a.oldConversion)){this._assignments={};if(a=this.commandAssignment.value)for(var b=0;b<a.params.length;b++){var e=a.params[b],g=new d(e,b),f=this.setAssignment(g,null,{skipArgUpdate:!0});c.synchronize(f);g.onAssignmentChange.add(this._assignmentChanged,this);this._assignments[e.name]=g}this.assignmentCount=Object.keys(this._assignments).length}};b.prototype.getAssignment=function(a){a="string"===typeof a?a:Object.keys(this._assignments)[a];
return this._assignments[a]||void 0};b.prototype._getFirstBlankPositionalAssignment=function(){var a=null;Object.keys(this._assignments).some(function(c){c=this.getAssignment(c);return"BlankArgument"===c.arg.type&&c.param.isPositionalAllowed?(a=c,!0):!1},this);return a};b.prototype.getParameterNames=function(){return Object.keys(this._assignments)};b.prototype.cloneAssignments=function(){return Object.keys(this._assignments).map(function(a){return this._assignments[a]},this)};b.prototype.getStatus=
function(){var a=s.VALID;if(0!==this._unassigned.length){var c=!0;this._unassigned.forEach(function(a){a.param.type.isIncompleteName||(c=!1)});a=c?s.INCOMPLETE:s.ERROR}this.getAssignments(!0).forEach(function(c){c=c.getStatus();c>a&&(a=c)},this);a===s.INCOMPLETE&&(a=s.ERROR);return a};b.prototype.getArgsObject=function(){var a={};this.getAssignments().forEach(function(c){a[c.param.name]=c.conversion.isDataProvided()?c.value:c.param.defaultValue},this);return a};b.prototype.getAssignments=function(a){var c=
[];!0===a&&c.push(this.commandAssignment);Object.keys(this._assignments).forEach(function(a){c.push(this.getAssignment(a))},this);return c};b.prototype.setAssignment=function(a,c,b){function d(c){var b=a.conversion;a.conversion=c;a.conversion.assign(a);if(!a.conversion.equals(b))a.onAssignmentChange({assignment:a,conversion:a.conversion,oldConversion:b})}b=b||{};if(!0!==b.skipArgUpdate)for(var e=a.arg.getArgs(),f=c.getArgs(),h=Math.max(e.length,f.length),k=0;k<h;k++)if(k>=e.length||"BlankArgument"===
e[k].type)this._args.push(f[k]);else{var l=this._args.indexOf(e[k]);if(-1===l)throw console.error("Couldn't find ",e[k]," in ",this._args),Error("Couldn't find "+e[k]);k>=f.length?this._args.splice(l,1):(b.matchPadding&&(0===f[k].prefix.length&&0!==this._args[l].prefix.length&&(f[k].prefix=this._args[l].prefix),0===f[k].suffix.length&&0!==this._args[l].suffix.length&&(f[k].suffix=this._args[l].suffix)),this._args[l]=f[k])}if(null==c)d(a.param.type.getBlank());else if("function"===typeof c.getStatus)d(c);
else return a.param.type.parse(c).then(function(a){d(a)}.bind(this),console.error);return g.resolve(void 0)};b.prototype.setBlankArguments=function(){this.getAssignments().forEach(function(a){a=this.setAssignment(a,null,{skipArgUpdate:!0});c.synchronize(a)},this)};b.prototype.complete=function(a,b){var d=this.getAssignmentAt(a.start);return d.getPredictionAt(b).then(function(a){var b=[];this.onTextChange.holdFire();if(null==a)" "!==d.arg.suffix.slice(-1)&&d.getStatus()===s.VALID&&b.push(this._addSpace(d)),
d.isInName()&&(a=d.conversion.arg.beget({prefixPostSpace:!0}),a=this.setAssignment(d,a),b.push(a));else{var e=d.arg.beget({text:a.name,dontQuote:d===this.commandAssignment}),e=this.setAssignment(d,e);a.incomplete||(e=e.then(function(){return this._addSpace(d).then(function(){if(d instanceof l)return this.update(this.toString())}.bind(this))}.bind(this)));b.push(e)}return c.all(b).then(function(){this.onTextChange();this.onTextChange.resumeFire()}.bind(this))}.bind(this))};b.prototype._assertArgsAssigned=
function(){this._args.forEach(function(a){null==a.assignment&&console.log("No assignment for "+a)},this)};b.prototype._addSpace=function(a){var c=a.conversion.arg.beget({suffixSpace:!0});return c!==a.conversion.arg?this.setAssignment(a,c):g.resolve(void 0)};b.prototype.decrement=function(a){var b=a.param.type.decrement(a.conversion.value);null!=b&&(b=a.param.type.stringify(b),b=a.conversion.arg.beget({text:b}),a=this.setAssignment(a,b),c.synchronize(a))};b.prototype.increment=function(a){var b=a.param.type.increment(a.conversion.value);
null!=b&&(b=a.param.type.stringify(b),b=a.conversion.arg.beget({text:b}),a=this.setAssignment(a,b),c.synchronize(a))};b.prototype.toCanonicalString=function(){var a=[],c=this.commandAssignment.value?this.commandAssignment.value.name:this.commandAssignment.arg.text;a.push(c);Object.keys(this._assignments).forEach(function(c){c=this._assignments[c];var b=c.param.type;c.value!==c.param.defaultValue&&(a.push(" "),a.push(b.stringify(c.value)))},this);"{"===c&&-1===this.getAssignment(0).arg.suffix.indexOf("}")&&
a.push(" }");return a.join("")};b.prototype.createInputArgTrace=function(){if(!this._args)throw Error("createInputMap requires a command line. See source.");var a=[],c;this._args.forEach(function(b){for(c=0;c<b.prefix.length;c++)a.push({arg:b,character:b.prefix[c],part:"prefix"});for(c=0;c<b.text.length;c++)a.push({arg:b,character:b.text[c],part:"text"});for(c=0;c<b.suffix.length;c++)a.push({arg:b,character:b.suffix[c],part:"suffix"})});return a};b.prototype.toString=function(){return this._args?
this._args.map(function(a){return a.toString()}).join(""):this.toCanonicalString()};b.prototype.typedEndsWithSeparator=function(){if(this._args){var a=this._args.slice(-1)[0];return" "===a.suffix.slice(-1)?!0:""===a.text&&""===a.suffix&&" "===a.prefix.slice(-1)}return" "===this.toCanonicalString().slice(-1)};b.prototype.getInputStatusMarkup=function(a){var c=this.createInputArgTrace();a=c[0===a?0:a-1];for(var b=[],d=0;d<c.length;d++){var e=c[d],g=e.arg,f=s.VALID;if("text"===e.part&&(f=g.assignment.getStatus(g),
f===s.INCOMPLETE)){var k="NamedArgument"===a.arg.assignment.arg.type,k="text"===a.part||k&&"suffix"===a.part;if((g.assignment!==a.arg.assignment||!k)&&!(g.assignment instanceof h))f=s.ERROR}b.push({status:f,string:e.character})}for(d=0;d<b.length-1;)b[d].status===b[d+1].status?(b[d].string+=b[d+1].string,b.splice(d+1,1)):d++;return b};b.prototype.getAssignmentAt=function(a){if(!this._args)throw console.trace(),Error("Missing args");if(0===a)return this.commandAssignment;var c=[],b,d;for(b=0;b<this._args.length;b++){var e=
this._args[b],g=e.assignment;for(d=0;d<e.prefix.length;d++)c.push(g);for(d=0;d<e.text.length;d++)c.push(g);"NamedArgument"!==e.assignment.arg.type&&(this._args.length>b+1?g=this._args[b+1].assignment:(d=this._getFirstBlankPositionalAssignment(),null!=d&&(g=d)));for(d=0;d<e.suffix.length;d++)c.push(g)}c=c[a-1];if(!c)throw Error("Missing assignment. cursor\x3d"+a+" text\x3d"+this.toString());return c};b.prototype.exec=function(c){var b=null,d=null,e=!1;c&&c.hidden&&(e=!0);c&&("string"===typeof input?
this.update(c):"string"===typeof c.typed?this.update(c.typed):null!=c.command&&((b=r.getCommand(c.command))||console.error("Command not found: "+c.command),d=c.args));b||(b=this.commandAssignment.value,d=this.getArgsObject());if(!b)throw Error("Unknown command");c=this.toString();I.evalRegexp.test(c)&&(c=c.replace(I.evalRegexp,""),c=c.replace(/\s*}\s*$/,""));var g=new a({command:b,args:d,typed:c,canonical:this.toCanonicalString(),hidden:e});this.commandOutputManager.onOutput({output:g});e=function(a){g.complete(a,
!1)};c=function(a){g.complete(a,!0)};var f=function(a){g.changed(a)};try{var h=m.createExecutionContext(this),k=b.exec(d,h);this._then(k,e,c,f)}catch(l){console.error(l),c(l)}this.clear();return g};b.prototype.updateExec=function(a,c){return this.update(a).then(function(){return this.exec(c)}.bind(this))};b.prototype.clear=function(){this._structuralChangeInProgress=!0;var a=new A("","","");this._args=[a];a=c.synchronize(this.commandAssignment.param.type.parse(a));this.setAssignment(this.commandAssignment,
a,{skipArgUpdate:!0});this._structuralChangeInProgress=!1;this.onTextChange()};b.prototype._then=function(a,c,b,d){var e=null;null!=a&&"function"===typeof a.then?e=a.then:null!=a&&null!=a.promise&&"function"===typeof a.promise.then&&(e=a.promise.then);null!=e?e(c,b,d):c(a)};b.prototype.update=function(a){this._structuralChangeInProgress=!0;this._args=this._tokenize(a);var c=this._args.slice(0);return this._split(c).then(function(){return this._assign(c).then(function(){this._structuralChangeInProgress=
!1;this.onTextChange()}.bind(this))}.bind(this))};Object.defineProperty(b.prototype,"_summaryJson",{get:function(){var a={$args:this._args.map(function(a){return a._summaryJson}),_command:this.commandAssignment._summaryJson,_unassigned:this._unassigned.forEach(function(a){return a._summaryJson})};Object.keys(this._assignments).forEach(function(c){a[c]=this.getAssignment(c)._summaryJson}.bind(this));return a},enumerable:!0});b.prototype._tokenize=function(a){function c(a){return a.replace(/\uF000/g,
" ").replace(/\uF001/g,"'").replace(/\uF002/g,'"').replace(/\uF003/g,"{").replace(/\uF004/g,"}")}if(null==a||0===a.length)return[new A("","","")];if(f(a))return[new A(a,"","")];var b=1;a=a.replace(/\\\\/g,"\\").replace(/\\b/g,"\b").replace(/\\f/g,"\f").replace(/\\n/g,"\n").replace(/\\r/g,"\r").replace(/\\t/g,"\t").replace(/\\v/g,"\v").replace(/\\n/g,"\n").replace(/\\r/g,"\r").replace(/\\ /g,"\uf000").replace(/\\'/g,"\uf001").replace(/\\"/g,"\uf002").replace(/\\{/g,"\uf003").replace(/\\}/g,"\uf004");
for(var d=0,e=0,g="",h=[],k=0;;){var l=a[d];switch(b){case 1:"'"===l?(g=a.substring(e,d+1),b=3,e=d+1):'"'===l?(g=a.substring(e,d+1),b=4,e=d+1):"{"===l?(g=a.substring(e,d+1),b=5,k++,e=d+1):/ /.test(l)||(g=a.substring(e,d),b=2,e=d);break;case 2:" "===l&&(b=c(a.substring(e,d)),h.push(new A(b,g,"")),b=1,e=d,g="");break;case 3:"'"===l&&(b=c(a.substring(e,d)),h.push(new A(b,g,l)),b=1,e=d+1,g="");break;case 4:'"'===l&&(b=c(a.substring(e,d)),h.push(new A(b,g,l)),b=1,e=d+1,g="");break;case 5:"{"===l?k++:"}"===
l&&(k--,0===k&&(b=c(a.substring(e,d)),h.push(new E(b,g,l)),b=1,e=d+1,g=""))}d++;if(d>=a.length){1===b?d!==e&&(a=a.substring(e,d),(d=h[h.length-1])?d.suffix+=a:h.push(new A("",a,""))):5===b?(b=c(a.substring(e,d+1)),h.push(new E(b,g,""))):(b=c(a.substring(e,d+1)),h.push(new A(b,g,"")));break}}return h};b.prototype._split=function(a){var b={skipArgUpdate:!0},d=void 0;if("ScriptArgument"===a[0].type)return d=new w(x,new E),this.setAssignment(this.commandAssignment,d,b);for(var e=1,g=this.commandAssignment.param.type;e<=
a.length;){d=1===e?a[0]:new F(a,0,e);d=c.synchronize(g.parse(d,1===e&&1<a.length));if(!d.value||d.value.exec)break;e++}for(g=0;g<e;g++)a.shift();return this.setAssignment(this.commandAssignment,d,b)};b.prototype._addUnassignedArgs=function(a){a.forEach(function(a){this._unassigned.push(new l(this,a))}.bind(this))};b.prototype._assign=function(a){var b={skipArgUpdate:!0};this._unassigned=[];var d=[];if(!this.commandAssignment.value)return this._addUnassignedArgs(a),c.all(d);if(0===a.length)return this.setBlankArguments(),
c.all(d);if(0===this.assignmentCount)return this._addUnassignedArgs(a),c.all(d);if(1===this.assignmentCount){var e=this.getAssignment(0);if(e.param.type instanceof y){var g=1===a.length?a[0]:new F(a);d.push(this.setAssignment(e,g,b));return c.all(d)}}var f=this.getParameterNames(),h={};this.getAssignments(!1).forEach(function(c){for(var e=0;e<a.length;)if(c.param.isKnownAs(a[e].text)){var g=a.splice(e,1)[0];f=f.filter(function(a){return a!==c.param.name});if(c.param.type instanceof t)g=new D(g);else{var k=
null;e+1<=a.length&&(k=a.splice(e,1)[0]);g=new K(g,k)}c.param.type instanceof u?(k=h[c.param.name],k||(k=new z,h[c.param.name]=k),k.addArgument(g)):d.push(this.setAssignment(c,g,b))}else e++},this);f.forEach(function(c){c=this.getAssignment(c);if(c.param.isPositionalAllowed)if(c.param.type instanceof u){var e=h[c.param.name];e||(e=new z,h[c.param.name]=e);e.addArguments(a);a=[]}else 0===a.length?d.push(this.setAssignment(c,null,b)):(e=a.splice(0,1)[0],(c.param.type instanceof v?/-[-a-zA-Z_]/.test(e.text):
"-"===e.text.charAt(0))?this._unassigned.push(new l(this,e)):d.push(this.setAssignment(c,e,b)));else d.push(this.setAssignment(c,null,b))},this);Object.keys(h).forEach(function(a){var c=this.getAssignment(a);d.push(this.setAssignment(c,h[a],b))},this);this._addUnassignedArgs(a);return c.all(d)};m.Requisition=b;a.prototype.changed=function(a,c){this.data=a;c=c||{};c.output=this;this.onChange(c)};a.prototype.complete=function(a,c,b){this.end=new Date;this.duration=this.end.getTime()-this.start.getTime();
this.completed=!0;this.error=c;this.changed(a,b);c?this.deferred.reject():this.deferred.resolve()};a.prototype.toDom=function(a){c.clearElement(a);var b=a.ownerDocument,d=this.data;if(null!=d){var e;"undefined"!==typeof HTMLElement&&d instanceof HTMLElement?e=d:d.isView?e=d.toDom(b):("terminal"===this.command.returnType?Array.isArray(d)?(e=c.createElement(b,"div"),d.forEach(function(){var a=c.createElement(b,"textarea");a.classList.add("gcli-row-subterminal");a.readOnly=!0;e.appendChild(a)})):(e=
c.createElement(b,"textarea"),e.classList.add("gcli-row-terminal"),e.readOnly=!0):e=c.createElement(b,"p"),"string"===this.command.returnType?e.textContent=d:c.setContents(e,d.toString()));for(var d=e.querySelectorAll("*[href]"),g=0;g<d.length;g++)d[g].setAttribute("target","_blank");a.appendChild(e)}};a.prototype.toString=function(a){return this.data.isView?this.data.toDom(a).textContent:"undefined"!==typeof HTMLElement&&this.data instanceof HTMLElement?this.data.textContent:null==this.data?"":this.data.toString()};
m.Output=a;m.createExecutionContext=function(a){return{exec:a.exec.bind(a),update:a.update.bind(a),updateExec:a.updateExec.bind(a),document:a.document,environment:a.environment,createView:p.createView,defer:function(){return g.defer()},createPromise:function(){return g.defer()}}}});define("text!gcli/ui/intro.html",[],function(){return'\n\x3cdiv\x3e\n  \x3cp\x3e${l10n.introTextOpening2}\x3c/p\x3e\n\n  \x3cp\x3e\n    ${l10n.introTextCommands}\n    \x3cspan class\x3d"gcli-out-shortcut" onclick\x3d"${onclick}"\n        ondblclick\x3d"${ondblclick}" data-command\x3d"help"\x3ehelp\x3c/span\x3e${l10n.introTextKeys2}\n    \x3ccode\x3e${l10n.introTextF1Escape}\x3c/code\x3e.\n  \x3c/p\x3e\n\n  \x3cbutton onclick\x3d"${onGotIt}" if\x3d"${showHideButton}"\x3e${l10n.introTextGo}\x3c/button\x3e\n\x3c/div\x3e'});
define("gcli/ui/intro","require exports module util/util util/l10n gcli/settings gcli/ui/view gcli/cli text!gcli/ui/intro.html".split(" "),function(k,m,n){var d=k("util/util"),h=k("util/l10n"),l=k("gcli/settings"),b=k("gcli/ui/view"),f=k("gcli/cli").Output,a={name:"hideIntro",type:"boolean",description:h.lookup("hideIntroDesc"),defaultValue:!1},g;m.startup=function(){g=l.addSetting(a)};m.shutdown=function(){l.removeSetting(a);g=void 0};m.maybeShowIntro=function(a,b){if(!g.value){var d=new f;a.onOutput({output:d});
var h=this.createView(b);d.complete(h)}};m.createView=function(a,e){return b.createView({html:k("text!gcli/ui/intro.html"),options:{stack:"intro.html"},data:{l10n:h.propertyLookup,onclick:function(b){d.updateCommand(b.currentTarget,a)},ondblclick:function(b){d.executeCommand(b.currentTarget,a)},showHideButton:null!=e,onGotIt:function(a){g.value=!0;e.onClose()}}})}});
define("gcli/ui/focus","require exports module util/util util/l10n gcli/settings gcli/canon".split(" "),function(k,m,n){function d(a,b){a=a||{};this._document=b.document||document;this._requisition=b.requisition;this._debug=a.debug||!1;this._blurDelay=a.blurDelay||150;this._window=this._document.defaultView;this._requisition.commandOutputManager.onOutput.add(this._outputted,this);this._blurDelayTimeout=null;this._monitoredElements=[];this._recentOutput=this._helpRequested=this._hasFocus=this._isError=
!1;this.onVisibilityChange=h.createEvent("FocusManager.onVisibilityChange");this._focused=this._focused.bind(this);this._document.addEventListener("focus",this._focused,!0);f.onChange.add(this._eagerHelperChanged,this);this.isOutputVisible=this.isTooltipVisible=void 0;this._checkShow()}var h=k("util/util");n=k("util/l10n");var l=k("gcli/settings");k("gcli/canon");var b={name:"eagerHelper",type:{name:"selection",lookup:[{name:"never",value:1},{name:"sometimes",value:2},{name:"always",value:3}]},defaultValue:2,
description:n.lookup("eagerHelperDesc"),ignoreTypeDifference:!0},f;m.startup=function(){f=l.addSetting(b)};m.shutdown=function(){l.removeSetting(b);f=void 0};d.prototype.destroy=function(){f.onChange.remove(this._eagerHelperChanged,this);this._document.removeEventListener("focus",this._focused,!0);this._requisition.commandOutputManager.onOutput.remove(this._outputted,this);for(var a=0;a<this._monitoredElements.length;a++){var b=this._monitoredElements[a];console.error("Hanging monitored element: ",
b.element);b.element.removeEventListener("focus",b.onFocus,!0);b.element.removeEventListener("blur",b.onBlur,!0)}this._blurDelayTimeout&&(this._window.clearTimeout(this._blurDelayTimeout),this._blurDelayTimeout=null);delete this._focused;delete this._document;delete this._window;delete this._requisition};d.prototype.addMonitoredElement=function(a,b){this._debug&&console.log("FocusManager.addMonitoredElement("+(b||"unknown")+")");var c={element:a,where:b,onFocus:function(){this._reportFocus(b)}.bind(this),
onBlur:function(){this._reportBlur(b)}.bind(this)};a.addEventListener("focus",c.onFocus,!0);a.addEventListener("blur",c.onBlur,!0);this._document.activeElement===a&&this._reportFocus(b);this._monitoredElements.push(c)};d.prototype.removeMonitoredElement=function(a,b){this._debug&&console.log("FocusManager.removeMonitoredElement("+(b||"unknown")+")");this._monitoredElements=this._monitoredElements.filter(function(c){return c.element===a?(a.removeEventListener("focus",c.onFocus,!0),a.removeEventListener("blur",
c.onBlur,!0),!1):!0})};d.prototype.updatePosition=function(a){this.onVisibilityChange({tooltipVisible:this.isTooltipVisible,outputVisible:this.isOutputVisible,dimensions:a})};d.prototype._outputted=function(a){this._recentOutput=!0;this._helpRequested=!1;this._checkShow()};d.prototype._focused=function(){this._reportBlur("document")};d.prototype._reportFocus=function(a){this._debug&&console.log("FocusManager._reportFocus("+(a||"unknown")+")");this._blurDelayTimeout&&(this._debug&&console.log("FocusManager.cancelBlur"),
this._window.clearTimeout(this._blurDelayTimeout),this._blurDelayTimeout=null);this._hasFocus||(this._hasFocus=!0);this._checkShow()};d.prototype._reportBlur=function(a){this._debug&&console.log("FocusManager._reportBlur("+a+")");this._hasFocus&&(this._blurDelayTimeout?this._debug&&console.log("FocusManager.blurPending"):this._blurDelayTimeout=this._window.setTimeout(function(){this._debug&&console.log("FocusManager.blur");this._hasFocus=!1;this._checkShow();this._blurDelayTimeout=null}.bind(this),
this._blurDelay))};d.prototype._eagerHelperChanged=function(){this._checkShow()};d.prototype.onInputChange=function(){this._recentOutput=!1;this._checkShow()};d.prototype.helpRequest=function(){this._debug&&console.log("FocusManager.helpRequest");this._helpRequested=!0;this._recentOutput=!1;this._checkShow()};d.prototype.removeHelp=function(){this._debug&&console.log("FocusManager.removeHelp");this._recentOutput=this._helpRequested=this._isError=this._importantFieldFlag=!1;this._checkShow()};d.prototype.setImportantFieldFlag=
function(a){this._debug&&console.log("FocusManager.setImportantFieldFlag",a);this._importantFieldFlag=a;this._checkShow()};d.prototype.setError=function(a){this._debug&&console.log("FocusManager._isError",a);this._isError=a;this._checkShow()};d.prototype._checkShow=function(){var a=!1,b={tooltipVisible:this.isTooltipVisible,outputVisible:this.isOutputVisible},c=this._shouldShowTooltip();this.isTooltipVisible!==c.visible&&(b.tooltipVisible=this.isTooltipVisible=c.visible,a=!0);c=this._shouldShowOutput();
this.isOutputVisible!==c.visible&&(b.outputVisible=this.isOutputVisible=c.visible,a=!0);a&&(this._debug&&console.log("FocusManager.onVisibilityChange",b),this.onVisibilityChange(b))};d.prototype._shouldShowTooltip=function(){return!this._hasFocus?{visible:!1,reason:"notHasFocus"}:1===f.value?{visible:!1,reason:"eagerHelperNever"}:3===f.value?{visible:!0,reason:"eagerHelperAlways"}:this._isError?{visible:!0,reason:"isError"}:this._helpRequested?{visible:!0,reason:"helpRequested"}:this._importantFieldFlag?
{visible:!0,reason:"importantFieldFlag"}:{visible:!1,reason:"default"}};d.prototype._shouldShowOutput=function(){return!this._hasFocus?{visible:!1,reason:"notHasFocus"}:this._recentOutput?{visible:!0,reason:"recentOutput"}:{visible:!1,reason:"default"}};m.FocusManager=d});
define("gcli/ui/fields","require exports module util/promise util/util util/util gcli/types/basic".split(" "),function(k,m,n){function d(a,b){this.type=a;this.document=b.document;this.requisition=b.requisition}function h(a,e){d.call(this,a,e);this.element=b.createElement(this.document,"div");this.onFieldChange=b.createEvent("BlankField.onFieldChange")}var l=k("util/promise"),b=k("util/util"),f=k("util/util").KeyEvent,a=k("gcli/types/basic").BlankType;d.prototype.element=void 0;d.prototype.destroy=
function(){delete this.messageElement};d.prototype.setConversion=function(a){throw Error("Field should not be used directly");};d.prototype.getConversion=function(){throw Error("Field should not be used directly");};d.prototype.setMessageElement=function(a){this.messageElement=a};d.prototype.setMessage=function(a){this.messageElement&&b.setTextContent(this.messageElement,a||"")};d.prototype.onInputChange=function(a){l.resolve(this.getConversion()).then(function(b){this.onFieldChange({conversion:b});
this.setMessage(b.message);a.keyCode===f.DOM_VK_RETURN&&this.requisition.exec()}.bind(this),console.error)};d.prototype.isImportant=!1;d.claim=function(){throw Error("Field should not be used directly");};d.TOOLTIP_MATCH=5;d.TOOLTIP_DEFAULT=4;d.MATCH=3;d.DEFAULT=2;d.BASIC=1;d.NO_MATCH=0;m.Field=d;var g=[];m.addField=function(a){if("function"!==typeof a)throw console.error("addField erroring on ",a),Error("addField requires a Field constructor");g.push(a)};m.removeField=function(a){if("string"!==typeof a)fields=
fields.filter(function(b){return b!==a}),delete fields[a];else if(a instanceof d)removeField(a.name);else throw console.error("removeField erroring on ",a),Error("removeField requires an instance of Field");};m.getField=function(a,b){var f,k=-1;g.forEach(function(b){var d=b.claim(a);d>k&&(k=d,f=b)});if(!f)throw console.error("Unknown field type ",a," in ",g),Error("Can't find field for "+a);return b.tooltip&&k<d.TOOLTIP_DEFAULT?new h(a,b):new f(a,b)};h.prototype=Object.create(d.prototype);h.claim=
function(c){return c instanceof a?d.MATCH:d.NO_MATCH};h.prototype.setConversion=function(a){this.setMessage(a.message)};h.prototype.getConversion=function(){return this.type.parse(new Argument)};m.addField(h)});
define("gcli/ui/fields/basic","require exports module util/util util/l10n gcli/argument gcli/argument gcli/argument gcli/argument gcli/types gcli/types/basic gcli/types/basic gcli/types/basic gcli/types/basic gcli/types/basic gcli/ui/fields gcli/ui/fields".split(" "),function(k,m,n){function d(b,d){v.call(this,b,d);this.arg=new c;this.element=a.createElement(this.document,"input");this.element.type="text";this.element.classList.add("gcli-field");this.onInputChange=this.onInputChange.bind(this);this.element.addEventListener("keyup",
this.onInputChange,!1);this.onFieldChange=a.createEvent("StringField.onFieldChange")}function h(b,d){v.call(this,b,d);this.arg=new c;this.element=a.createElement(this.document,"input");this.element.type="number";this.type.max&&(this.element.max=this.type.max);this.type.min&&(this.element.min=this.type.min);this.type.step&&(this.element.step=this.type.step);this.onInputChange=this.onInputChange.bind(this);this.element.addEventListener("keyup",this.onInputChange,!1);this.onFieldChange=a.createEvent("NumberField.onFieldChange")}
function l(c,b){v.call(this,c,b);this.name=b.name;this.named=b.named;this.element=a.createElement(this.document,"input");this.element.type="checkbox";this.element.id="gcliForm"+this.name;this.onInputChange=this.onInputChange.bind(this);this.element.addEventListener("change",this.onInputChange,!1);this.onFieldChange=a.createEvent("BooleanField.onFieldChange")}function b(c,b){v.call(this,c,b);this.options=b;this.requisition.onAssignmentChange.add(this.update,this);this.element=a.createElement(this.document,
"div");this.update();this.onFieldChange=a.createEvent("DelegateField.onFieldChange")}function f(c,b){v.call(this,c,b);this.options=b;this._onAdd=this._onAdd.bind(this);this.members=[];this.element=a.createElement(this.document,"div");this.element.classList.add("gcli-array-parent");this.addButton=a.createElement(this.document,"button");this.addButton.classList.add("gcli-array-member-add");this.addButton.addEventListener("click",this._onAdd,!1);this.addButton.textContent=g.lookup("fieldArrayAdd");this.element.appendChild(this.addButton);
this.container=a.createElement(this.document,"div");this.container.classList.add("gcli-array-members");this.element.appendChild(this.container);this.onInputChange=this.onInputChange.bind(this);this.onFieldChange=a.createEvent("ArrayField.onFieldChange")}var a=k("util/util"),g=k("util/l10n"),c=k("gcli/argument").Argument,e=k("gcli/argument").TrueNamedArgument,p=k("gcli/argument").FalseNamedArgument,r=k("gcli/argument").ArrayArgument,q=k("gcli/types").ArrayConversion,s=k("gcli/types/basic").StringType,
w=k("gcli/types/basic").NumberType,u=k("gcli/types/basic").BooleanType,y=k("gcli/types/basic").DelegateType,t=k("gcli/types/basic").ArrayType,v=k("gcli/ui/fields").Field,A=k("gcli/ui/fields");m.startup=function(){A.addField(d);A.addField(h);A.addField(l);A.addField(b);A.addField(f)};m.shutdown=function(){A.removeField(d);A.removeField(h);A.removeField(l);A.removeField(b);A.removeField(f)};d.prototype=Object.create(v.prototype);d.prototype.destroy=function(){v.prototype.destroy.call(this);this.element.removeEventListener("keyup",
this.onInputChange,!1);delete this.element;delete this.document;delete this.onInputChange};d.prototype.setConversion=function(a){this.arg=a.arg;this.element.value=a.arg.text;this.setMessage(a.message)};d.prototype.getConversion=function(){this.arg=this.arg.beget({text:this.element.value,prefixSpace:!0});return this.type.parse(this.arg)};d.claim=function(a){return a instanceof s?v.MATCH:v.BASIC};h.prototype=Object.create(v.prototype);h.claim=function(a){return a instanceof w?v.MATCH:v.NO_MATCH};h.prototype.destroy=
function(){v.prototype.destroy.call(this);this.element.removeEventListener("keyup",this.onInputChange,!1);delete this.element;delete this.document;delete this.onInputChange};h.prototype.setConversion=function(a){this.arg=a.arg;this.element.value=a.arg.text;this.setMessage(a.message)};h.prototype.getConversion=function(){this.arg=this.arg.beget({text:this.element.value,prefixSpace:!0});return this.type.parse(this.arg)};l.prototype=Object.create(v.prototype);l.claim=function(a){return a instanceof u?
v.MATCH:v.NO_MATCH};l.prototype.destroy=function(){v.prototype.destroy.call(this);this.element.removeEventListener("change",this.onInputChange,!1);delete this.element;delete this.document;delete this.onInputChange};l.prototype.setConversion=function(a){this.element.checked=a.value;this.setMessage(a.message)};l.prototype.getConversion=function(){var a;a=this.named?this.element.checked?new e(new c(" --"+this.name)):new p:new c(" "+this.element.checked);return this.type.parse(a)};b.prototype=Object.create(v.prototype);
b.prototype.update=function(){var c=this.type.delegateType();c!==this.subtype&&(this.field&&(this.field.onFieldChange.remove(this.fieldChanged,this),this.field.destroy()),this.subtype=c,this.field=A.getField(c,this.options),this.field.onFieldChange.add(this.fieldChanged,this),a.clearElement(this.element),this.element.appendChild(this.field.element))};b.claim=function(a){return a instanceof y?v.MATCH:v.NO_MATCH};b.prototype.destroy=function(){v.prototype.destroy.call(this);this.requisition.onAssignmentChange.remove(this.update,
this);delete this.element;delete this.document;delete this.onInputChange};b.prototype.setConversion=function(a){this.field.setConversion(a)};b.prototype.getConversion=function(){return this.field.getConversion()};Object.defineProperty(b.prototype,"isImportant",{get:function(){return this.field.isImportant},enumerable:!0});f.prototype=Object.create(v.prototype);f.claim=function(a){return a instanceof t?v.MATCH:v.NO_MATCH};f.prototype.destroy=function(){v.prototype.destroy.call(this);this.addButton.removeEventListener("click",
this._onAdd,!1)};f.prototype.setConversion=function(c){a.clearElement(this.container);this.members=[];c.conversions.forEach(function(a){this._onAdd(null,a)},this)};f.prototype.getConversion=function(){for(var a=[],c=new r,b=0;b<this.members.length;b++)Promise.resolve(this.members[b].field.getConversion()).then(function(b){a.push(b);c.addArgument(b.arg)}.bind(this),console.error);return new q(a,c)};f.prototype._onAdd=function(c,b){var d=a.createElement(this.document,"div");d.classList.add("gcli-array-member");
this.container.appendChild(d);var e=A.getField(this.type.subtype,this.options);e.onFieldChange.add(function(){Promise.resolve(this.getConversion()).then(function(a){this.onFieldChange({conversion:a});this.setMessage(a.message)}.bind(this),console.error)},this);b&&e.setConversion(b);d.appendChild(e.element);var f=a.createElement(this.document,"button");f.classList.add("gcli-array-member-del");f.addEventListener("click",this._onDel,!1);f.textContent=g.lookup("fieldArrayDel");d.appendChild(f);d={element:d,
field:e,parent:this};d.onDelete=function(){this.parent.container.removeChild(this.element);this.parent.members=this.parent.members.filter(function(a){return a!==this});this.parent.onInputChange()}.bind(d);f.addEventListener("click",d.onDelete,!1);this.members.push(d)}});define("text!gcli/ui/fields/menu.css",[],function(){return"\n.gcli-menu {\n  width: 100%;\n  overflow: hidden;\n  font-size: 90%;\n}\n.gcli-menu-field {\n  border: 1px solid #aaa;\n  border-top: 0;\n  border-bottom-right-radius: 5px;\n  border-bottom-left-radius: 5px;\n  max-height: 300px;\n  margin: 0 3px;\n  padding: 0;\n}\n.gcli-menu-template {\n  border-collapse: collapse;\n  width: 100%;\n}\n.gcli-menu-option {\n  overflow: hidden;\n  white-space: nowrap;\n  cursor: pointer;\n}\n.gcli-menu-option:hover {\n  background-image: -moz-linear-gradient(top, #f8f8f8, #ccc);\n  background-color: #ddd;\n}\n.gcli-menu-name {\n  padding: 2px 3px;\n  -moz-padding-start: 8px;\n  -webkit-padding-start: 8px;\n}\n.gcli-menu-desc {\n  color: #777;\n  padding: 0 3px;\n  -moz-padding-end: 8px;\n  -webkit-padding-end: 8px;\n}\n.gcli-menu-highlight,\n.gcli-menu-highlight.gcli-menu-option:hover {\n  background-image: -moz-linear-gradient(top, #eee, #b8b8b8);\n  background-color: #c8c8c8;\n}\n.gcli-menu-typed {\n  color: #FF6600;\n}\n.gcli-menu-more {\n  font-size: 80%;\n  text-align: right;\n  -moz-padding-end: 8px;\n  -webkit-padding-end: 8px;\n}"});
define("text!gcli/ui/fields/menu.html",[],function(){return'\n\x3cdiv\x3e\n  \x3ctable class\x3d"gcli-menu-template" aria-live\x3d"polite"\x3e\n    \x3ctr class\x3d"gcli-menu-option" foreach\x3d"item in ${items}"\n        onclick\x3d"${onItemClickInternal}" title\x3d"${item.manual}"\x3e\n      \x3ctd class\x3d"gcli-menu-name"\x3e${item.name}\x3c/td\x3e\n      \x3ctd class\x3d"gcli-menu-desc"\x3e${item.description}\x3c/td\x3e\n    \x3c/tr\x3e\n  \x3c/table\x3e\n  \x3cdiv class\x3d"gcli-menu-more" if\x3d"${items.hasMore}"\x3e${l10n.fieldMenuMore}\x3c/div\x3e\n\x3c/div\x3e'});
define("gcli/ui/fields/menu","require exports module util/util util/l10n util/domtemplate gcli/argument gcli/types gcli/canon text!gcli/ui/fields/menu.css text!gcli/ui/fields/menu.html".split(" "),function(k,m,n){function d(a){a=a||{};this.document=a.document||document;this.type=a.type;if(!this.document)throw Error("No document");this.element=l.createElement(this.document,"div");this.element.classList.add(a.menuClass||"gcli-menu");a&&a.field&&this.element.classList.add(a.menuFieldClass||"gcli-menu-field");
null!=g&&l.importCss(g,this.document,"gcli-menu");this.template=l.toDom(this.document,c);this.templateOptions={blankNullUndefined:!0,stack:"menu.html"};this.items=null;this.onItemClick=l.createEvent("Menu.onItemClick")}function h(a,c,b){return"undefined"===typeof Proxy?a:Proxy.create({get:function(d,g){var f=a[g];if("name"!==g)return f;var h=f.indexOf(c);if(-1===h)return f;var k=f.substr(0,h),f=f.substr(h+c.length),h=b.createElement("span");h.appendChild(b.createTextNode(k));k=b.createElement("span");
k.classList.add("gcli-menu-typed");k.appendChild(b.createTextNode(c));h.appendChild(k);h.appendChild(b.createTextNode(f));return h}})}var l=k("util/util");n=k("util/l10n");var b=k("util/domtemplate"),f=k("gcli/argument").Argument,a=k("gcli/types").Conversion;k("gcli/canon");var g=k("text!gcli/ui/fields/menu.css"),c=k("text!gcli/ui/fields/menu.html");d.prototype.l10n=n.propertyLookup;d.prototype.destroy=function(){delete this.element;delete this.template;delete this.document};d.prototype.onItemClickInternal=
function(a){a=a.currentTarget.querySelector(".gcli-menu-name").textContent;a=new f(a);a.suffix=" ";this.onItemClick({arg:a})};d.prototype.show=function(c,d){this.items=c.filter(function(a){return void 0===a.hidden||!0!==a.hidden}.bind(this));d&&(this.items=this.items.map(function(a){return h(a,d,this.template.ownerDocument)}.bind(this)));if(0===this.items.length)this.element.style.display="none";else{this.items.length>=a.maxPredictions&&(this.items.splice(-1),this.items.hasMore=!0);var g=this.template.cloneNode(!0);
b.template(g,this,this.templateOptions);l.clearElement(this.element);this.element.appendChild(g);this.element.style.display="block"}};d.prototype.setChoiceIndex=function(a){for(var c=this.element.querySelectorAll(".gcli-menu-option"),b=0;b<c.length;b++)c[b].classList.remove("gcli-menu-highlight");null!=a&&(c.length<=a?console.error("Cant highlight "+a+". Only "+c.length+" options"):c.item(a).classList.add("gcli-menu-highlight"))};d.prototype.selectChoice=function(){var a=this.element.querySelector(".gcli-menu-highlight .gcli-menu-name");
if(!a)return!1;a=new f(a.textContent);a.suffix=" ";a.prefix=" ";this.onItemClick({arg:a});return!0};d.prototype.hide=function(){this.element.style.display="none"};d.prototype.setMaxHeight=function(a){this.element.style.maxHeight=a+"px"};m.Menu=d});
define("gcli/ui/fields/javascript","require exports module util/util util/promise gcli/types gcli/types gcli/argument gcli/types/javascript gcli/ui/fields/menu gcli/ui/fields gcli/ui/fields".split(" "),function(k,m,n){function d(d,g){e.call(this,d,g);this.onInputChange=this.onInputChange.bind(this);this.arg=new a("","{ "," }");this.element=h.createElement(this.document,"div");this.input=h.createElement(this.document,"input");this.input.type="text";this.input.addEventListener("keyup",this.onInputChange,
!1);this.input.classList.add("gcli-field");this.input.classList.add("gcli-field-javascript");this.element.appendChild(this.input);this.menu=new c({document:this.document,field:!0,type:d});this.element.appendChild(this.menu.element);var k=new f(void 0,new a(""),b.INCOMPLETE,"");this.setConversion(k);this.onFieldChange=h.createEvent("JavascriptField.onFieldChange");this.menu.onItemClick.add(this.itemClicked,this)}var h=k("util/util"),l=k("util/promise"),b=k("gcli/types").Status,f=k("gcli/types").Conversion,
a=k("gcli/argument").ScriptArgument,g=k("gcli/types/javascript").JavascriptType,c=k("gcli/ui/fields/menu").Menu,e=k("gcli/ui/fields").Field,p=k("gcli/ui/fields");m.startup=function(){p.addField(d)};m.shutdown=function(){p.removeField(d)};d.prototype=Object.create(e.prototype);d.claim=function(a){return a instanceof g?e.TOOLTIP_MATCH:e.NO_MATCH};d.prototype.destroy=function(){e.prototype.destroy.call(this);this.input.removeEventListener("keyup",this.onInputChange,!1);this.menu.onItemClick.remove(this.itemClicked,
this);this.menu.destroy();delete this.element;delete this.input;delete this.menu;delete this.document;delete this.onInputChange};d.prototype.setConversion=function(a){this.arg=a.arg;this.input.value=a.arg.text;var c=0;if(this.type instanceof g){var b=a.arg.text.lastIndexOf(".");-1!==b&&(c=b)}this.setMessage(a.message);a.getPredictions().then(function(a){var b=[];a.forEach(function(a){a.hidden||b.push({name:a.name.substring(c),complete:a.name,description:a.description||""})},this);this.menu.show(b)}.bind(this),
console.error)};d.prototype.itemClicked=function(a){l.resolve(this.type.parse(a.arg)).then(function(a){this.onFieldChange({conversion:a});this.setMessage(a.message)}.bind(this),console.error)};d.prototype.onInputChange=function(a){this.item=a.currentTarget.item;l.resolve(this.getConversion()).then(function(a){this.onFieldChange({conversion:a});this.setMessage(a.message)}.bind(this),console.error)};d.prototype.getConversion=function(){this.arg=new a(this.input.value,"{ "," }");return this.type.parse(this.arg)};
d.DEFAULT_VALUE="__JavascriptField.DEFAULT_VALUE"});
define("gcli/ui/fields/selection","require exports module util/promise util/util util/l10n gcli/argument gcli/types gcli/types gcli/types/basic gcli/types/selection gcli/ui/fields/menu gcli/ui/fields gcli/ui/fields".split(" "),function(k,m,n){function d(a,c){p.call(this,a,c);this.items=[];this.element=b.createElement(this.document,"select");this.element.classList.add("gcli-field");this._addOption({name:f.lookupFormat("fieldSelectionSelect",[c.name])});l.resolve(this.type.getLookup()).then(function(a){a.forEach(this._addOption,
this)}.bind(this),console.error);this.onInputChange=this.onInputChange.bind(this);this.element.addEventListener("change",this.onInputChange,!1);this.onFieldChange=b.createEvent("SelectionField.onFieldChange")}function h(c,d){p.call(this,c,d);this.onInputChange=this.onInputChange.bind(this);this.arg=new a;this.menu=new e({document:this.document,type:c});this.element=this.menu.element;this.onFieldChange=b.createEvent("SelectionTooltipField.onFieldChange");this.menu.onItemClick.add(this.itemClicked,
this)}var l=k("util/promise"),b=k("util/util"),f=k("util/l10n"),a=k("gcli/argument").Argument;k("gcli/types");k("gcli/types");var g=k("gcli/types/basic").BooleanType,c=k("gcli/types/selection").SelectionType,e=k("gcli/ui/fields/menu").Menu,p=k("gcli/ui/fields").Field,r=k("gcli/ui/fields");m.startup=function(){r.addField(d);r.addField(h)};m.shutdown=function(){r.removeField(d);r.removeField(h)};d.prototype=Object.create(p.prototype);d.claim=function(a){return a instanceof g?p.BASIC:a instanceof c?
p.DEFAULT:p.NO_MATCH};d.prototype.destroy=function(){p.prototype.destroy.call(this);this.element.removeEventListener("change",this.onInputChange,!1);delete this.element;delete this.document;delete this.onInputChange};d.prototype.setConversion=function(a){var c;this.items.forEach(function(b){b.value&&b.value===a.value&&(c=b.index)},this);this.element.value=c;this.setMessage(a.message)};d.prototype.getConversion=function(){return this.type.parse(new a(this.items[this.element.value].name," "))};d.prototype._addOption=
function(a){a.index=this.items.length;this.items.push(a);var c=b.createElement(this.document,"option");c.textContent=a.name;c.value=a.index;this.element.appendChild(c)};h.prototype=Object.create(p.prototype);h.claim=function(a){return a.getType()instanceof c?p.TOOLTIP_MATCH:p.NO_MATCH};h.prototype.destroy=function(){p.prototype.destroy.call(this);this.menu.onItemClick.remove(this.itemClicked,this);this.menu.destroy();delete this.element;delete this.document;delete this.onInputChange};h.prototype.setConversion=
function(a){this.arg=a.arg;this.setMessage(a.message);a.getPredictions().then(function(c){c=c.map(function(a){return a.value.description?a.value:a},this);this.menu.show(c,a.arg.text)}.bind(this),console.error)};h.prototype.itemClicked=function(a){l.resolve(this.type.parse(a.arg)).then(function(a){this.onFieldChange({conversion:a});this.setMessage(a.message)}.bind(this),console.error)};h.prototype.onInputChange=function(a){this.item=a.currentTarget.item;l.resolve(this.getConversion()).then(function(a){this.onFieldChange({conversion:a});
this.setMessage(a.message)}.bind(this),console.error)};h.prototype.getConversion=function(){this.arg=this.arg.beget({text:this.input.value});return this.type.parse(this.arg)};h.prototype.setChoiceIndex=function(a){this.menu.setChoiceIndex(a)};h.prototype.selectChoice=function(){return this.menu.selectChoice()};Object.defineProperty(h.prototype,"isImportant",{get:function(){return"command"!==this.type.name},enumerable:!0});h.DEFAULT_VALUE="__SelectionTooltipField.DEFAULT_VALUE"});
define("text!gcli/ui/tooltip.css",[],function(){return"\n.gcli-panel {\n  -moz-transition-property: opacity, height;\n  -moz-transition-duration: 0.5s, 2s;\n  overflow-y: auto;\n  overflow-x: hidden;\n  z-index: 2;\n  position: absolute;\n  max-height: 100%;\n  max-width: 350px;\n  left: 0;\n  bottom: 0;\n  font-family: Segoe UI, Helvetica Neue, Verdana, Arial, sans-serif;\n  margin-bottom: -3px;\n}\n.gcli-panel.gcli-panel-hide {\n  opacity: 0;\n  height: 0;\n}\n.gcli-panel-connector {\n  height: 10px;\n  margin-top: -1px;\n  margin-left: 20px;\n  width: 20px;\n  background: white;\n  border-left: 1px solid #999;\n  border-right: 1px solid #999;\n}\n.gcli-tt-description {\n  padding: 5px 10px 0;\n  font-size: 90%;\n}\n.gcli-tt-error {\n  font-size: 80%;\n  color: #900;\n  padding: 0 10px;\n}\n.gcli-field {\n  width: 100%;\n}\n.gcli-field-javascript {\n  margin-bottom: 0;\n}\n.gcli-tt {\n  box-shadow: 0 0 10px 1px #ddd;\n  border: 1px solid #999;\n  border-radius: 3px;\n  margin: 10px 0 0 0;\n  background: hsla(0, 100%, 100%, 0.95);\n  padding-bottom: 5px;\n}"});
define("text!gcli/ui/tooltip.html",[],function(){return'\n\x3cdiv class\x3d"gcli-tt" aria-live\x3d"polite"\x3e\n  \x3cdiv class\x3d"gcli-tt-description" save\x3d"${descriptionEle}"\x3e${description}\x3c/div\x3e\n  ${field.element}\n  \x3cdiv class\x3d"gcli-tt-error" save\x3d"${errorEle}"\x3e${assignment.conversion.message}\x3c/div\x3e\n  \x3cdiv class\x3d"gcli-tt-highlight" save\x3d"${highlightEle}"\x3e\x3c/div\x3e\n\x3c/div\x3e'});
define("gcli/ui/tooltip","require exports module util/util util/domtemplate gcli/cli gcli/ui/fields text!gcli/ui/tooltip.css text!gcli/ui/tooltip.html".split(" "),function(k,m,n){function d(c,b){this.inputter=b.inputter;this.requisition=b.requisition;this.focusManager=b.focusManager;this.element=b.element;this.element.classList.add(c.tooltipClass||"gcli-tooltip");this.document=this.element.ownerDocument;if(this.panelElement=b.panelElement)this.panelElement.classList.add("gcli-panel-hide"),this.focusManager.onVisibilityChange.add(this.visibilityChanged,
this);this.focusManager.addMonitoredElement(this.element,"tooltip");this.fields=[];null!=a&&(this.style=h.importCss(a,this.document,"gcli-tooltip"));this.template=h.toDom(this.document,g);this.templateOptions={blankNullUndefined:!0,stack:"tooltip.html"};this.inputter.onChoiceChange.add(this.choiceChanged,this);this.inputter.onAssignmentChange.add(this.assignmentChanged,this);this.assignment=void 0;this.assignmentChanged({assignment:this.inputter.assignment})}var h=k("util/util"),l=k("util/domtemplate"),
b=k("gcli/cli").CommandAssignment,f=k("gcli/ui/fields"),a=k("text!gcli/ui/tooltip.css"),g=k("text!gcli/ui/tooltip.html");d.prototype.destroy=function(){this.inputter.onAssignmentChange.remove(this.assignmentChanged,this);this.inputter.onChoiceChange.remove(this.choiceChanged,this);this.panelElement&&this.focusManager.onVisibilityChange.remove(this.visibilityChanged,this);this.focusManager.removeMonitoredElement(this.element,"tooltip");this.style&&(this.style.parentNode.removeChild(this.style),delete this.style);
this.field.onFieldChange.remove(this.fieldChanged,this);this.field.destroy();delete this.errorEle;delete this.descriptionEle;delete this.highlightEle;delete this.document;delete this.element;delete this.panelElement;delete this.template};Object.defineProperty(d.prototype,"isMenuShowing",{get:function(){return this.focusManager.isTooltipVisible&&null!=this.field&&null!=this.field.menu},enumerable:!0});d.prototype.assignmentChanged=function(a){this.assignment!==a.assignment&&(this.assignment&&this.assignment.onAssignmentChange.remove(this.assignmentContentsChanged,
this),this.assignment=a.assignment,this.field&&(this.field.onFieldChange.remove(this.fieldChanged,this),this.field.destroy()),this.field=f.getField(this.assignment.param.type,{document:this.document,name:this.assignment.param.name,requisition:this.requisition,required:this.assignment.param.isDataRequired,named:!this.assignment.param.isPositionalAllowed,tooltip:!0}),this.focusManager.setImportantFieldFlag(this.field.isImportant),this.field.onFieldChange.add(this.fieldChanged,this),this.assignment.onAssignmentChange.add(this.assignmentContentsChanged,
this),this.field.setConversion(this.assignment.conversion),this.highlightEle=this.descriptionEle=this.errorEle=void 0,a=this.template.cloneNode(!0),l.template(a,this,this.templateOptions),h.clearElement(this.element),this.element.appendChild(a),this.element.style.display="block",this.field.setMessageElement(this.errorEle),this._updatePosition())};d.prototype.choiceChanged=function(a){this.field&&this.field.setChoiceIndex&&this.assignment.conversion.constrainPredictionIndex(a.choice).then(function(a){this.field.setChoiceIndex(a)}.bind(this)).then(null,
console.error)};d.prototype.selectChoice=function(a){return this.field&&this.field.selectChoice?this.field.selectChoice():!1};d.prototype.fieldChanged=function(a){this.requisition.setAssignment(this.assignment,a.conversion.arg,{matchPadding:!0});this.focusManager.setError(null!=a.conversion.message&&""!==a.conversion.message);this.document.defaultView.setTimeout(function(){this.inputter.focus()}.bind(this),10)};d.prototype.assignmentContentsChanged=function(a){a.conversion.arg.text===a.oldConversion.arg.text&&
a.conversion.message===a.oldConversion.message||(this.field.setConversion(a.conversion),h.setTextContent(this.descriptionEle,this.description),this._updatePosition())};d.prototype._updatePosition=function(){var a=this.getDimensionsOfAssignment();this.panelElement&&(this.panelElement.style.left=10*a.start+"px");this.focusManager.updatePosition(a)};d.prototype.getDimensionsOfAssignment=function(){for(var a="",b=this.requisition.getAssignments(!0),d=0;d<b.length&&b[d]!==this.assignment;d++)a+=b[d].toString();
a+=this.assignment.arg.prefix;b=a.length;a+=this.assignment.arg.text;return{start:b,end:a.length}};Object.defineProperty(d.prototype,"description",{get:function(){return this.assignment instanceof b&&null==this.assignment.value?"":this.assignment.param.manual||this.assignment.param.description},enumerable:!0});d.prototype.visibilityChanged=function(a){this.panelElement&&(a.tooltipVisible?this.panelElement.classList.remove("gcli-panel-hide"):this.panelElement.classList.add("gcli-panel-hide"))};m.Tooltip=
d});define("text!gcli/ui/output_view.css",[],function(){return"\n.gcli-row-in {\n  padding: 0 4px;\n  box-shadow: 0 -6px 10px -6px #ddd;\n  border-top: 1px solid #bbb;\n}\n.gcli-row-in \x3e img {\n  cursor: pointer;\n}\n.gcli-row-hover {\n  display: none;\n  float: right;\n  padding: 2px 2px 0;\n}\n.gcli-row-in:hover \x3e .gcli-row-hover {\n  display: inline;\n}\n.gcli-row-in:hover \x3e .gcli-row-hover.gcli-row-hidden {\n  display: none;\n}\n.gcli-row-duration {\n  color: #666;\n}\n.gcli-row-prompt {\n  color: #00F;\n  font-weight: bold;\n  font-size: 120%;\n}\n.gcli-row-prompt.gcli-row-complete {\n  color: #060;\n}\n.gcli-row-prompt.gcli-row-error {\n  color: #F00;\n}\n.gcli-row-duration {\n  font-size: 80%;\n}\n.gcli-row-out {\n  margin: 0 10px 15px;\n  padding: 0 10px;\n  line-height: 1.2em;\n  font-size: 95%;\n}\n.gcli-row-out strong,\n.gcli-row-out b,\n.gcli-row-out th,\n.gcli-row-out h1,\n.gcli-row-out h2,\n.gcli-row-out h3 {\n  color: #000;\n}\n.gcli-row-out p {\n  margin: 5px 0;\n}\n.gcli-row-out a {\n  color: hsl(200,40%,40%);\n  text-decoration: none;\n}\n.gcli-row-out a:hover {\n  cursor: pointer;\n  border-bottom: 1px dotted hsl(200,40%,60%);\n}\n.gcli-row-out input[type\x3dpassword],\n.gcli-row-out input[type\x3dtext],\n.gcli-row-out textarea {\n  font-size: 120%;\n  background: transparent;\n  padding: 3px;\n  border-radius: 3px;\n  border: 1px solid #bbb;\n}\n.gcli-row-out table,\n.gcli-row-out td,\n.gcli-row-out th {\n  border: 0;\n  padding: 0 2px;\n}\n.gcli-row-terminal,\n.gcli-row-subterminal {\n  border-radius: 3px;\n  border: 1px solid #ddd;\n}\n.gcli-row-terminal {\n  height: 200px;\n  width: 620px;\n  font-size: 80%;\n}\n.gcli-row-subterminal {\n  height: 150px;\n  width: 300px;\n  font-size: 75%;\n}\n.gcli-out-shortcut {\n  font-weight: normal;\n  border: 1px solid #999;\n  border-radius: 3px;\n  color: #666;\n  cursor: pointer;\n  padding: 0 3px 1px;\n  margin: 1px 4px;\n  display: inline-block;\n}\n.gcli-out-shortcut:before {\n  content: '\\bb';\n  padding-right: 2px;\n  color: hsl(25,78%,50%);\n  font-weight: bold;\n  font-size: 110%;\n}"});
define("text!gcli/ui/output_terminal.html",[],function(){return'\n\x3cdiv class\x3d"gcli-row"\x3e\n  \x3c!-- The div for the input (i.e. what was typed) --\x3e\n  \x3cdiv class\x3d"gcli-row-in" save\x3d"${elems.rowin}" aria-live\x3d"assertive"\n      onclick\x3d"${copyToInput}" ondblclick\x3d"${execute}"\x3e\n\n    \x3c!-- What the user actually typed --\x3e\n    \x3cspan save\x3d"${elems.prompt}" class\x3d"gcli-row-prompt ${elems.error ? \'gcli-row-error\' : \'\'} ${elems.completed ? \'gcli-row-complete\' : \'\'}"\x3e${prompt}\x3c/span\x3e\n    \x3cspan class\x3d"gcli-row-in-typed"\x3e${outputData.canonical}\x3c/span\x3e\n\n    \x3c!-- The extra details that appear on hover --\x3e\n    \x3cspan class\x3d"gcli-row-duration gcli-row-hover" save\x3d"${elems.duration}"\x3e\x3c/span\x3e\n    \x3c!--\n    \x3cimg class\x3d"gcli-row-hover" onclick\x3d"${hideOutput}" save\x3d"${elems.hide}"\n        alt\x3d"Hide command output" _src\x3d"${url(\'images/minus.png\')}"/\x3e\n    \x3cimg class\x3d"gcli-row-hover gcli-row-hidden" onclick\x3d"${showOutput}" save\x3d"${elems.show}"\n        alt\x3d"Show command output" _src\x3d"${url(\'images/plus.png\')}"/\x3e\n    \x3cimg class\x3d"gcli-row-hover" onclick\x3d"${remove}"\n        alt\x3d"Remove this command from the history"\n        _src\x3d"${url(\'images/closer.png\')}"/\x3e\n    --\x3e\n    \x3cimg style\x3d"float:right;" _src\x3d"${url(\'images/throbber.gif\')}" save\x3d"${elems.throb}"/\x3e\n  \x3c/div\x3e\n\n  \x3c!-- The div for the command output --\x3e\n  \x3cdiv class\x3d"gcli-row-out" aria-live\x3d"assertive" save\x3d"${elems.rowout}"\x3e\n  \x3c/div\x3e\n\x3c/div\x3e'});
define("gcli/ui/output_terminal","require exports module util/util util/domtemplate gcli/canon text!gcli/ui/output_view.css text!gcli/ui/output_terminal.html".split(" "),function(k,m,n){function d(b,c){this.element=c.element;this.requisition=c.requisition;this.requisition.commandOutputManager.onOutput.add(this.outputted,this);var d=c.element.ownerDocument;null!=f&&(this.style=l.importCss(f,d,"gcli-output-view"));this.template=l.toDom(d,a);this.templateOptions={allowEval:!0,stack:"output_terminal.html"}}
function h(a,c){this.outputData=a;this.outputTerminal=c;this.url=l.createUrlLookup(n);this.elems={rowin:null,rowout:null,hide:null,show:null,duration:null,throb:null,prompt:null};var d=this.outputTerminal.template.cloneNode(!0);b.template(d,this,this.outputTerminal.templateOptions);this.outputTerminal.element.appendChild(this.elems.rowin);this.outputTerminal.element.appendChild(this.elems.rowout);this.outputData.onClose.add(this.closed,this);this.outputData.onChange.add(this.changed,this)}var l=k("util/util"),
b=k("util/domtemplate");k("gcli/canon");var f=k("text!gcli/ui/output_view.css"),a=k("text!gcli/ui/output_terminal.html");d.prototype.destroy=function(){this.style&&(this.style.parentNode.removeChild(this.style),delete this.style);this.requisition.commandOutputManager.onOutput.remove(this.outputted,this);delete this.requisition;delete this.element;delete this.template};d.prototype.outputted=function(a){a.output.hidden||(a.output.view=new h(a.output,this))};d.prototype.setHeight=function(a){this.element.style.height=
a+"px"};m.OutputTerminal=d;h.prototype.destroy=function(){this.outputData.onChange.remove(this.changed,this);this.outputData.onClose.remove(this.closed,this);this.outputTerminal.element.removeChild(this.elems.rowin);this.outputTerminal.element.removeChild(this.elems.rowout);delete this.outputData;delete this.outputTerminal;delete this.url;delete this.elems};Object.defineProperty(h.prototype,"prompt",{get:function(){return this.outputData.canonical?"\u00bb":""},enumerable:!0});h.prototype.copyToInput=
function(){this.outputTerminal.requisition&&this.outputTerminal.requisition.update(this.outputData.typed)};h.prototype.execute=function(a){this.outputTerminal.requisition&&this.outputTerminal.requisition.updateExec(this.outputData.typed)};h.prototype.hideOutput=function(a){this.elems.rowout.style.display="none";this.elems.hide.classList.add("cmd_hidden");this.elems.show.classList.remove("cmd_hidden");a.stopPropagation()};h.prototype.showOutput=function(a){this.elems.rowout.style.display="block";this.elems.hide.classList.remove("cmd_hidden");
this.elems.show.classList.add("cmd_hidden");a.stopPropagation()};h.prototype.closed=function(a){this.destroy()};h.prototype.changed=function(a){a=null!=this.outputData.duration?"completed in "+this.outputData.duration/1E3+" sec ":"";a=this.elems.rowout.ownerDocument.createTextNode(a);this.elems.duration.appendChild(a);this.outputData.completed&&this.elems.prompt.classList.add("gcli-row-complete");this.outputData.error&&this.elems.prompt.classList.add("gcli-row-error");this.outputData.toDom(this.elems.rowout);
a=Math.max(this.outputTerminal.element.scrollHeight,this.outputTerminal.element.clientHeight);this.outputTerminal.element.scrollTop=a-this.outputTerminal.element.clientHeight;this.elems.throb.style.display=this.outputData.completed?"none":"block"};m.OutputView=h});
define("gcli/history",["require","exports","module"],function(k,m,n){function d(){this._buffer=[""];this._current=0}d.prototype.destroy=function(){delete this._buffer};d.prototype.add=function(d){this._buffer.splice(1,0,d);this._current=0};d.prototype.forward=function(){0<this._current&&this._current--;return this._buffer[this._current]};d.prototype.backward=function(){this._current<this._buffer.length-1&&this._current++;return this._buffer[this._current]};m.History=d});
define("text!gcli/ui/inputter.css",[],function(){return"\n.gcli-in-input,\n.gcli-in-complete,\n.gcli-prompt {\n  font-family: Segoe UI, Helvetica Neue, Verdana, Arial, sans-serif;\n}\n.gcli-in-input,\n.gcli-in-complete {\n  font-size: 110%;\n  font-weight: normal;\n  font-style: normal;\n  padding: 0 0 0 22px;\n  background-color: transparent;\n}\n.gcli-in-input {\n  color: #000;\n  border: 0;\n  box-shadow: 0 0 10px 1px #ddd;\n  border-top: 1px solid #999;\n}\n.gcli-in-complete {\n  position: absolute;\n  z-index: -1000;\n  color: transparent;\n  margin-top: -1px;\n  border-top: 1px solid transparent;\n}\n.gcli-prompt {\n  position: absolute;\n  z-index: -1001;\n  padding: 0 1px;\n  color: hsl(25,78%,50%);\n  font-size: 150%;\n  font-weight: bold;\n  line-height: 95%;\n}\n.gcli-in-incomplete {\n  border-bottom: 2px dotted #999;\n}\n.gcli-in-error {\n  border-bottom: 2px dotted #F00;\n}\n.gcli-in-ontab {\n  color: hsl(200,40%,70%);\n}\n.gcli-in-todo {\n  color: hsl(48,28%,76%);\n}\n.gcli-in-closebrace {\n  color: hsl(0,0%,80%);\n}\n.gcli-in-scratchlink {\n  float: right;\n  font-size: 85%;\n  color: #888;\n  padding-right: 10px;\n}"});
define("gcli/ui/inputter","require exports module util/promise util/util util/util gcli/types gcli/history text!gcli/ui/inputter.css".split(" "),function(k,m,n){function d(c,b){this.requisition=b.requisition;this.focusManager=b.focusManager;this.element=b.element;this.element.classList.add("gcli-in-input");this.element.spellcheck=!1;this.document=this.element.ownerDocument;this.scratchpad=c.scratchpad;null!=a&&(this.style=h.importCss(a,this.document,"gcli-inputter"));this.lastTabDownAt=0;this._caretChange=
null;this.onKeyDown=this.onKeyDown.bind(this);this.onKeyUp=this.onKeyUp.bind(this);this.element.addEventListener("keydown",this.onKeyDown,!1);this.element.addEventListener("keyup",this.onKeyUp,!1);this.history=new f;this._scrollingThroughHistory=!1;this._choice=null;this.onChoiceChange=h.createEvent("Inputter.onChoiceChange");this.onMouseUp=this.onMouseUp.bind(this);this.element.addEventListener("mouseup",this.onMouseUp,!1);this.focusManager&&this.focusManager.addMonitoredElement(this.element,"input");
this._completed=g;this.requisition.onTextChange.add(this.textChanged,this);this.assignment=this.requisition.getAssignmentAt(0);this.onAssignmentChange=h.createEvent("Inputter.onAssignmentChange");this.onInputChange=h.createEvent("Inputter.onInputChange");this.onResize=h.createEvent("Inputter.onResize");this.onWindowResize=this.onWindowResize.bind(this);this.document.defaultView.addEventListener("resize",this.onWindowResize,!1);this.requisition.update(this.element.value||"")}n=k("util/promise");var h=
k("util/util"),l=k("util/util").KeyEvent,b=k("gcli/types").Status,f=k("gcli/history").History,a=k("text!gcli/ui/inputter.css"),g=n.resolve(void 0);d.prototype.destroy=function(){this.document.defaultView.removeEventListener("resize",this.onWindowResize,!1);this.requisition.onTextChange.remove(this.textChanged,this);this.focusManager&&this.focusManager.removeMonitoredElement(this.element,"input");this.element.removeEventListener("mouseup",this.onMouseUp,!1);this.element.removeEventListener("keydown",
this.onKeyDown,!1);this.element.removeEventListener("keyup",this.onKeyUp,!1);this.history.destroy();this.style&&(this.style.parentNode.removeChild(this.style),delete this.style);delete this.onMouseUp;delete this.onKeyDown;delete this.onKeyUp;delete this.onWindowResize;delete this.tooltip;delete this.document;delete this.element};d.prototype.onWindowResize=function(){if(this.element){var a=this.getDimensions();if(a)this.onResize(a)}};d.prototype.getDimensions=function(){if(this.element.getBoundingClientRect){for(var a,
c,b=this.element.parentNode;b&&"#document"!==b.nodeName;){var d=this.document.defaultView.getComputedStyle(b,"");if(d&&(d=d.getPropertyValue("position"),"absolute"===d||"fixed"===d)){c=b.getBoundingClientRect();a=c.top;c=c.left;break}b=b.parentNode}b=this.element.getBoundingClientRect();return{top:b.top-(a||0)+1,height:b.bottom-b.top-1,left:b.left-(c||0)+2,width:b.right-b.left}}};d.prototype.onMouseUp=function(a){this._checkAssignment()};d.prototype.textChanged=function(){if(this.document){null==
this._caretChange&&(this._caretChange=c.TO_ARG_END);var a=this.requisition.toString(),b=this.getInputState();b.typed=a;this._processCaretChange(b);this.element.value!==a&&(this.element.value=a);this.onInputChange({inputState:b})}};var c={NO_CHANGE:0,SELECT_ALL:1,TO_END:2,TO_ARG_END:3};d.prototype._processCaretChange=function(a){var b,d;switch(this._caretChange){case c.SELECT_ALL:b=0;d=a.typed.length;break;case c.TO_END:d=b=a.typed.length;break;case c.TO_ARG_END:b=a.cursor.start;do b++;while(b<a.typed.length&&
" "!==a.typed[b-1]);d=b;break;default:b=a.cursor.start,d=a.cursor.end}b=b>a.typed.length?a.typed.length:b;d=d>a.typed.length?a.typed.length:d;a={typed:a.typed,cursor:{start:b,end:d}};this.element.selectionStart!==b&&(this.element.selectionStart=b);this.element.selectionEnd!==d&&(this.element.selectionEnd=d);this._checkAssignment(b);this._caretChange=null;return a};d.prototype._checkAssignment=function(a){null==a&&(a=this.element.selectionStart);a=this.requisition.getAssignmentAt(a);this.assignment!==
a&&(this.assignment=a,this.onAssignmentChange({assignment:this.assignment}));this.focusManager&&(a=this.assignment.conversion.message,this.focusManager.setError(null!=a&&""!==a))};d.prototype.setInput=function(a){return this.requisition.update(a)};d.prototype.setCursor=function(a){this._caretChange=c.NO_CHANGE;this._processCaretChange({typed:this.element.value,cursor:a})};d.prototype.focus=function(){this.element.focus();this._checkAssignment()};d.prototype.onKeyDown=function(a){if(a.keyCode===l.DOM_VK_UP||
a.keyCode===l.DOM_VK_DOWN)a.preventDefault();else if(!(a.keyCode===l.DOM_VK_F1||a.keyCode===l.DOM_VK_ESCAPE||a.keyCode===l.DOM_VK_UP||a.keyCode===l.DOM_VK_DOWN)){if(this.focusManager)this.focusManager.onInputChange();if(a.keyCode===l.DOM_VK_TAB&&(this.lastTabDownAt=0,a.shiftKey||(a.preventDefault(),this.lastTabDownAt=a.timeStamp),a.metaKey||a.altKey||a.crtlKey))this.document.commandDispatcher?this.document.commandDispatcher.advanceFocus():this.element.blur()}};d.prototype.onKeyUp=function(a){this.handleKeyUp(a).then(null,
console.error)};d.prototype.handleKeyUp=function(a){if(this.focusManager&&a.keyCode===l.DOM_VK_F1)return this.focusManager.helpRequest(),g;if(this.focusManager&&a.keyCode===l.DOM_VK_ESCAPE)return this.focusManager.removeHelp(),g;if(a.keyCode===l.DOM_VK_UP){if(this.tooltip&&this.tooltip.isMenuShowing)this.changeChoice(-1);else{if(""===this.element.value||this._scrollingThroughHistory)return this._scrollingThroughHistory=!0,this.requisition.update(this.history.backward());if(this.assignment.getStatus()===
b.VALID){if(this.requisition.increment(this.assignment),this.focusManager)this.focusManager.onInputChange()}else this.changeChoice(-1)}return g}if(a.keyCode===l.DOM_VK_DOWN){if(this.tooltip&&this.tooltip.isMenuShowing)this.changeChoice(1);else{if(""===this.element.value||this._scrollingThroughHistory)return this._scrollingThroughHistory=!0,this.requisition.update(this.history.forward());if(this.assignment.getStatus()===b.VALID){if(this.requisition.decrement(this.assignment),this.focusManager)this.focusManager.onInputChange()}else this.changeChoice(1)}return g}if(a.keyCode===
l.DOM_VK_RETURN)return this.requisition.getStatus()===b.VALID?(this._scrollingThroughHistory=!1,this.history.add(this.element.value),this.requisition.exec()):this.tooltip.selectChoice()||this.focusManager.setError(!0),this._choice=null,g;if(a.keyCode===l.DOM_VK_TAB&&!a.shiftKey)return 0<this.element.value.length&&this.lastTabDownAt+1E3>a.timeStamp&&(this._caretChange=c.TO_ARG_END,a=this.getInputState(),this._processCaretChange(a),null==this._choice&&(this._choice=0),this._completed=this.requisition.complete(a.cursor,
this._choice)),this.lastTabDownAt=0,this._scrollingThroughHistory=!1,this._completed.then(function(){this._choice=null;this.onChoiceChange({choice:this._choice})}.bind(this));if(this.scratchpad&&this.scratchpad.shouldActivate(a))return this.scratchpad.activate(this.element.value)?this.requisition.update(""):g;this._scrollingThroughHistory=!1;this._caretChange=c.NO_CHANGE;this._completed=this.requisition.update(this.element.value);return this._completed.then(function(){this._choice=null;this.onChoiceChange({choice:this._choice})}.bind(this))};
d.prototype.changeChoice=function(a){null==this._choice&&(this._choice=0);this._choice+=a;this.onChoiceChange({choice:this._choice})};d.prototype.getCurrentAssignment=function(){return this.requisition.getAssignmentAt(this.element.selectionStart)};d.prototype.getInputState=function(){var a={typed:this.element.value,cursor:{start:this.element.selectionStart,end:this.element.selectionEnd}};null==a.typed&&(a={typed:"",cursor:{start:0,end:0}});null==a.cursor.start&&(a.cursor.start=0);return a};m.Inputter=
d});define("text!gcli/ui/completer.html",[],function(){return'\n\x3cdiv\x3e\n  \x3cloop foreach\x3d"member in ${statusMarkup}"\x3e\n    \x3cspan class\x3d"${member.className}"\x3e${member.string}\x3c/span\x3e\n  \x3c/loop\x3e\n  \x3cspan class\x3d"gcli-in-ontab"\x3e${directTabText}\x3c/span\x3e\n  \x3cspan class\x3d"gcli-in-todo" foreach\x3d"param in ${emptyParameters}"\x3e${param}\x3c/span\x3e\n  \x3cspan class\x3d"gcli-in-ontab"\x3e${arrowTabText}\x3c/span\x3e\n  \x3cspan class\x3d"gcli-in-closebrace" if\x3d"${unclosedJs}"\x3e}\x3c/span\x3e\n  \x3cdiv class\x3d"gcli-in-scratchlink" if\x3d"${scratchLink}"\x3e${scratchLink}\x3c/div\x3e\n\x3c/div\x3e'});
define("gcli/ui/completer","require exports module util/promise util/util util/domtemplate text!gcli/ui/completer.html".split(" "),function(k,m,n){function d(a,b){this.requisition=b.requisition;this.scratchpad=a.scratchpad;this.input={typed:"",cursor:{start:0,end:0}};this.choice=0;this.element=b.element;this.element.classList.add("gcli-in-complete");this.element.setAttribute("tabindex","-1");this.element.setAttribute("aria-live","polite");this.document=this.element.ownerDocument;this.inputter=b.inputter;
this.inputter.onInputChange.add(this.update,this);this.inputter.onAssignmentChange.add(this.update,this);this.inputter.onChoiceChange.add(this.update,this);if(this.autoResize=b.autoResize){this.inputter.onResize.add(this.resized,this);var c=this.inputter.getDimensions();c&&this.resized(c)}this.template=l.toDom(this.document,f);l.removeWhitespace(this.template,!0);this.update()}var h=k("util/promise"),l=k("util/util"),b=k("util/domtemplate"),f=k("text!gcli/ui/completer.html");d.prototype.destroy=function(){this.inputter.onInputChange.remove(this.update,
this);this.inputter.onAssignmentChange.remove(this.update,this);this.inputter.onChoiceChange.remove(this.update,this);this.autoResize&&this.inputter.onResize.remove(this.resized,this);delete this.document;delete this.element;delete this.template;delete this.inputter};d.prototype.resized=function(a){this.element.style.top=a.top+"px";this.element.style.height=a.height+"px";this.element.style.lineHeight=a.height+"px";this.element.style.left=a.left+"px";this.element.style.width=a.width+"px"};d.prototype.update=
function(a){this.choice=a&&null!=a.choice?a.choice:0;a=this._getCompleterTemplateData();var d=this.template.cloneNode(!0);b.template(d,a,{stack:"completer.html"});for(l.clearElement(this.element);d.hasChildNodes();)this.element.appendChild(d.firstChild)};d.prototype._getCompleterTemplateData=function(){var a=h.defer(),b=h.defer(),c=h.defer(),d=this.inputter.getInputState(),f=this.requisition.getAssignmentAt(d.cursor.start),k=void 0;0!==d.typed.trim().length&&(k=f.getPredictionAt(this.choice));h.resolve(k).then(function(h){var k=
"",l="",m=[];if(0!==d.typed.trim().length){var n=f.arg;if(h){if(h=h.name,n=n.text,f.isInName()&&(h=" "+h),n!==h){var r=n.replace(/^\s*/,"");0===h.indexOf(r)&&d.cursor.start===d.typed.length?(r=n.match(/^(\s*)/)[0].length,k=h.slice(n.length-r)):l="\u21e5 "+h}}else"NamedArgument"===n.type&&""===n.text&&m.push("\x3c"+f.param.type.name+"\x3e\u00a0")}""!==k?k+="\u00a0":this.requisition.typedEndsWithSeparator()||m.unshift("\u00a0");this.requisition.getAssignments().forEach(function(a){a.param.isPositionalAllowed&&
""===a.arg.toString().trim()&&(""!==k&&f===a||m.push(a.param.isDataRequired?"\x3c"+a.param.name+"\x3e\u00a0":"["+a.param.name+"]\u00a0"))}.bind(this));h=this.requisition.commandAssignment.value;var v=!1;h&&h.hasNamedParameters&&h.params.forEach(function(a){var c=this.requisition.getAssignment(a.name).arg;!a.isPositionalAllowed&&!a.hidden&&"BlankArgument"===c.type&&(v=!0)},this);v&&m.push("[options]\u00a0");a.resolve(k);b.resolve(l);c.resolve(m)}.bind(this),console.error);return{statusMarkup:this._getStatusMarkup(d),
unclosedJs:this._getUnclosedJs(),scratchLink:this._getScratchLink(),directTabText:a.promise,arrowTabText:b.promise,emptyParameters:c.promise}};d.prototype._getStatusMarkup=function(a){a=this.requisition.getInputStatusMarkup(a.cursor.start);a.forEach(function(a){a.string=a.string.replace(/ /g,"\u00a0");a.className="gcli-in-"+a.status.toString().toLowerCase()},this);return a};d.prototype._getUnclosedJs=function(){var a=this.requisition.commandAssignment.value;return a&&"{"===a.name&&-1===this.requisition.getAssignment(0).arg.suffix.indexOf("}")};
d.prototype._getScratchLink=function(){var a=this.requisition.commandAssignment.value;return this.scratchpad&&a&&"{"===a.name?this.scratchpad.linkText:""};m.Completer=d});
define("gcli/ui/prompt",["require","exports","module"],function(k,m,n){function d(d,k){this.element=k.element;this.element.classList.add("gcli-prompt");var b=this.element.ownerDocument.createTextNode(d.promptChar||"\u00bb");this.element.appendChild(b);if(this.inputter=k.inputter)this.inputter.onResize.add(this.resized,this),(b=this.inputter.getDimensions())&&this.resized(b)}d.prototype.destroy=function(){this.inputter&&this.inputter.onResize.remove(this.resized,this);delete this.element};d.prototype.resized=
function(d){this.element.style.top=d.top+"px";this.element.style.height=d.height+"px";this.element.style.left=d.left+"px";this.element.style.width=d.width+"px"};m.Prompt=d});define("text!gcli/ui/display.css",[],function(){return"\n.gcli-output {\n  height: 100%;\n  overflow-x: hidden;\n  overflow-y: auto;\n  font-family: Segoe UI, Helvetica Neue, Verdana, Arial, sans-serif;\n}"});define("text!gcli/ui/display.html",[],function(){return'\n\x3cdiv class\x3d"gcli-panel" save\x3d"${panel}"\x3e\n  \x3cdiv save\x3d"${tooltip}"\x3e\x3c/div\x3e\n  \x3cdiv class\x3d"gcli-panel-connector"\x3e\x3c/div\x3e\n\x3c/div\x3e'});
define("gcli/ui/display","require exports module util/util util/domtemplate gcli/settings gcli/canon gcli/cli gcli/ui/intro gcli/ui/tooltip gcli/ui/output_terminal gcli/ui/inputter gcli/ui/completer gcli/ui/focus gcli/ui/prompt text!gcli/ui/display.css text!gcli/ui/display.html".split(" "),function(k,m,n){function d(a){var d=a.document||document;this.displayStyle=void 0;null!=y&&(this.displayStyle=b.importCss(y,d,"gcli-css-display"));this.commandOutputManager=a.commandOutputManager;null==this.commandOutputManager&&
(this.commandOutputManager=new g);this.requisition=new c(a.environment||{},d,this.commandOutputManager);this.focusManager=new w(a,{document:d,requisition:this.requisition});this.inputElement=h(d,a.inputElement||null,"gcli-input");this.inputter=new q(a,{requisition:this.requisition,focusManager:this.focusManager,element:this.inputElement});this.completeElement=l(this.inputElement,a.completeElement||null,"gcli-row-complete");this.completer=new s(a,{requisition:this.requisition,inputter:this.inputter,
autoResize:this.completeElement.gcliCreated,element:this.completeElement});this.prompt=new u(a,{inputter:this.inputter,element:l(this.inputElement,a.promptElement||null,"gcli-prompt")});this.element=h(d,a.displayElement||null,"gcli-display");this.element.classList.add("gcli-display");this.template=b.toDom(d,t);this.elements={};f.template(this.template,this.elements,{stack:"display.html"});this.element.appendChild(this.template);this.tooltip=new p(a,{requisition:this.requisition,inputter:this.inputter,
focusManager:this.focusManager,element:this.elements.tooltip,panelElement:this.elements.panel});this.inputter.tooltip=this.tooltip;this.outputElement=b.createElement(d,"div");this.outputElement.classList.add("gcli-output");this.outputList=new r(a,{requisition:this.requisition,element:this.outputElement});this.element.appendChild(this.outputElement);e.maybeShowIntro(this.commandOutputManager,this.requisition)}function h(a,c,b){if(!c&&(c=a.getElementById(b),!c))throw Error("Missing element, id\x3d"+
b);return c}function l(a,c,d){d=a.ownerDocument;c||(c=d.getElementById("gcli-row-complete"),c||(c=b.createElement(d,"div"),a.parentNode.insertBefore(c,a.nextSibling),c.gcliCreated=!0));return c}var b=k("util/util"),f=k("util/domtemplate"),a=k("gcli/settings"),g=k("gcli/canon").CommandOutputManager,c=k("gcli/cli").Requisition,e=k("gcli/ui/intro"),p=k("gcli/ui/tooltip").Tooltip,r=k("gcli/ui/output_terminal").OutputTerminal,q=k("gcli/ui/inputter").Inputter,s=k("gcli/ui/completer").Completer,w=k("gcli/ui/focus").FocusManager,
u=k("gcli/ui/prompt").Prompt,y=k("text!gcli/ui/display.css"),t=k("text!gcli/ui/display.html");m.createDisplay=function(c){null!=c.settings&&a.setDefaults(c.settings);c=new d(c);var b=c.requisition;return{exec:b.exec.bind(b),update:b.update.bind(b),updateExec:b.updateExec.bind(b),destroy:c.destroy.bind(c)}};d.prototype.destroy=function(){delete this.element;delete this.template;this.outputList.destroy();delete this.outputList;delete this.outputElement;this.tooltip.destroy();delete this.tooltip;this.prompt.destroy();
delete this.prompt;this.completer.destroy();delete this.completer;delete this.completeElement;this.inputter.destroy();delete this.inputter;delete this.inputElement;this.focusManager.destroy();delete this.focusManager;this.requisition.destroy();delete this.requisition;this.displayStyle&&this.displayStyle.parentNode.removeChild(this.displayStyle);delete this.displayStyle};m.Display=d});
define("gcli/index","require exports module util/legacy gcli/canon gcli/canon gcli/types/basic gcli/types/command gcli/types/javascript gcli/types/node gcli/types/resource gcli/types/selection gcli/types/setting gcli/settings gcli/cli gcli/ui/intro gcli/ui/focus gcli/ui/fields/basic gcli/ui/fields/javascript gcli/ui/fields/selection gcli/ui/display".split(" "),function(k,m,n){k("util/legacy");m.addCommand=k("gcli/canon").addCommand;m.removeCommand=k("gcli/canon").removeCommand;k("gcli/types/basic").startup();
k("gcli/types/command").startup();k("gcli/types/javascript").startup();k("gcli/types/node").startup();k("gcli/types/resource").startup();k("gcli/types/selection").startup();k("gcli/types/setting").startup();k("gcli/settings").startup();k("gcli/cli").startup();k("gcli/ui/intro").startup();k("gcli/ui/focus").startup();k("gcli/ui/fields/basic").startup();k("gcli/ui/fields/javascript").startup();k("gcli/ui/fields/selection").startup();var d=k("gcli/ui/display");m.createDisplay=function(h){return d.createDisplay(h||
{})};m.createView=m.createDisplay});define("text!gcli/commands/help_man.html",[],function(){return'\n\x3cdiv\x3e\n  \x3ch3\x3e${command.name}\x3c/h3\x3e\n\n  \x3ch4 class\x3d"gcli-help-header"\x3e\n    ${l10n.helpManSynopsis}:\n    \x3cspan class\x3d"gcli-out-shortcut" onclick\x3d"${onclick}" data-command\x3d"${command.name}"\x3e\n      ${command.name}\n      \x3cspan foreach\x3d"param in ${command.params}"\x3e\n        ${param.defaultValue !\x3d\x3d undefined ? \'[\' + param.name + \']\' : param.name}\n      \x3c/span\x3e\n    \x3c/span\x3e\n  \x3c/h4\x3e\n\n  \x3ch4 class\x3d"gcli-help-header"\x3e${l10n.helpManDescription}:\x3c/h4\x3e\n\n  \x3cp class\x3d"gcli-help-description"\x3e${describe(command)}\x3c/p\x3e\n\n  \x3cdiv if\x3d"${command.exec}"\x3e\n    \x3ch4 class\x3d"gcli-help-header"\x3e${l10n.helpManParameters}:\x3c/h4\x3e\n\n    \x3cul class\x3d"gcli-help-parameter"\x3e\n      \x3cli if\x3d"${command.params.length \x3d\x3d\x3d 0}"\x3e${l10n.helpManNone}\x3c/li\x3e\n      \x3cli foreach\x3d"param in ${command.params}"\x3e\n        ${param.name} \x3cem\x3e${getTypeDescription(param)}\x3c/em\x3e\n        \x3cbr/\x3e\n        ${describe(param)}\n      \x3c/li\x3e\n    \x3c/ul\x3e\n  \x3c/div\x3e\n\n  \x3cdiv if\x3d"${!command.exec}"\x3e\n    \x3ch4 class\x3d"gcli-help-header"\x3e${l10n.subCommands}:\x3c/h4\x3e\n\n    \x3cul class\x3d"gcli-help-${subcommands}"\x3e\n      \x3cli if\x3d"${subcommands.length \x3d\x3d\x3d 0}"\x3e${l10n.subcommandsNone}\x3c/li\x3e\n      \x3cli foreach\x3d"subcommand in ${subcommands}"\x3e\n        \x3cstrong\x3e${subcommand.name}\x3c/strong\x3e:\n        ${subcommand.description}\n        \x3cspan class\x3d"gcli-out-shortcut" data-command\x3d"help ${subcommand.name}"\n            onclick\x3d"${onclick}" ondblclick\x3d"${ondblclick}"\x3e\n          help ${subcommand.name}\n        \x3c/span\x3e\n      \x3c/li\x3e\n    \x3c/ul\x3e\n  \x3c/div\x3e\n\n\x3c/div\x3e'});
define("text!gcli/commands/help_list.html",[],function(){return'\n\x3cdiv\x3e\n  \x3cdiv if\x3d"${includeIntro}"\x3e\n    \x3ch2\x3eWelcome to GCLI\x3c/h2\x3e\n    \x3cp\x3eGCLI is an experiment to create a highly usable JavaScript command line for developers.\x3c/p\x3e\n    \x3cp\x3e\n      Useful links:\n      \x3ca href\x3d\'https://github.com/joewalker/gcli\'\x3eSource\x3c/a\x3e (Apache-2.0),\n      \x3ca href\x3d\'https://github.com/joewalker/gcli/blob/master/docs/index.md\'\x3eDocumentation\x3c/a\x3e (for users/embedders),\n      \x3ca href\x3d\'https://wiki.mozilla.org/DevTools/Features/GCLI\'\x3eMozilla feature page\x3c/a\x3e (for GCLI in the web console).\n    \x3c/p\x3e\n  \x3c/div\x3e\n\n  \x3ch3\x3e${heading}\x3c/h3\x3e\n\n  \x3ctable\x3e\n    \x3ctr foreach\x3d"command in ${matchingCommands}"\x3e\n      \x3cth class\x3d"gcli-help-name"\x3e${command.name}\x3c/th\x3e\n      \x3ctd class\x3d"gcli-help-arrow"\x3e-\x3c/td\x3e\n      \x3ctd\x3e\n        ${command.description}\n        \x3cspan class\x3d"gcli-out-shortcut"\n            onclick\x3d"${onclick}" ondblclick\x3d"${ondblclick}"\n            data-command\x3d"help ${command.name}"\x3ehelp ${command.name}\x3c/span\x3e\n      \x3c/td\x3e\n    \x3c/tr\x3e\n  \x3c/table\x3e\n\x3c/div\x3e'});
define("text!gcli/commands/help.css",[],function(){return"\n.gcli-help-name {\n  text-align: end;\n}\n.gcli-help-arrow {\n  color: #AAA;\n}\n.gcli-help-description {\n  margin: 0 20px;\n  padding: 0;\n}\n.gcli-help-parameter {\n  margin: 0 30px;\n  padding: 0;\n}\n.gcli-help-header {\n  margin: 10px 0 6px;\n}"});
define("gcli/commands/help","require exports module util/util util/l10n gcli/canon gcli/ui/view text!gcli/commands/help_man.html text!gcli/commands/help_list.html text!gcli/commands/help.css".split(" "),function(k,m,n){function d(a,d){var g=f.getCommands().filter(function(b){return b.hidden||a.search&&0!==b.name.indexOf(a.search)||!a.search&&-1!=b.name.indexOf(" ")?!1:!0});g.sort(function(a,c){return a.name.localeCompare(c.name)});var h;h=0===g.length?b.lookupFormat("helpListNone",[a.search]):null==
a.search?b.lookup("helpListAll"):b.lookupFormat("helpListPrefix",[a.search]);return{l10n:b.propertyLookup,includeIntro:null==a.search,matchingCommands:g,heading:h,onclick:function(a){l.updateCommand(a.currentTarget,d)},ondblclick:function(a){l.executeCommand(a.currentTarget,d)}}}function h(a,d){var g={l10n:b.propertyLookup,command:a,onclick:function(a){l.updateCommand(a.currentTarget,d)},ondblclick:function(a){l.executeCommand(a.currentTarget,d)},describe:function(a){return a.manual||a.description},
getTypeDescription:function(a){var c="",c=void 0===a.defaultValue?b.lookup("helpManRequired"):null===a.defaultValue?b.lookup("helpManOptional"):a.defaultValue;return"("+a.type.name+", "+c+")"}};Object.defineProperty(g,"subcommands",{get:function(){var b=f.getCommands().filter(function(b){return 0===b.name.indexOf(a.name)&&b.name!==a.name});b.sort(function(a,c){return a.name.localeCompare(c.name)});return b},enumerable:!0});return g}var l=k("util/util"),b=k("util/l10n"),f=k("gcli/canon"),a=k("gcli/ui/view");
m.helpManHtml=k("text!gcli/commands/help_man.html");m.helpListHtml=k("text!gcli/commands/help_list.html");m.helpCss=k("text!gcli/commands/help.css");var g={name:"help",description:b.lookup("helpDesc"),manual:b.lookup("helpManual"),params:[{name:"search",type:"string",description:b.lookup("helpSearchDesc"),manual:b.lookup("helpSearchManual3"),defaultValue:null}],returnType:"html",exec:function(c,b){var g=f.getCommand(c.search||void 0);return g?a.createView({html:m.helpManHtml,options:{allowEval:!0,
stack:"help_man.html"},data:h(g,b),css:m.helpCss,cssId:"gcli-help"}):a.createView({html:m.helpListHtml,options:{allowEval:!0,stack:"help_list.html"},data:d(c,b),css:m.helpCss,cssId:"gcli-help"})}};m.startup=function(){f.addCommand(g)};m.shutdown=function(){f.removeCommand(g)}});
define("orion/shell/Shell","i18n!orion/widgets/nls/messages orion/i18nUtil gcli/index gcli/types gcli/types/selection gcli/argument gcli/ui/fields gcli/ui/fields/menu util/util gcli/settings gcli/canon gcli/cli gcli/commands/help util/promise".split(" "),function(k,m,n,d,h,l,b,f,a,g,c,e,p,r){function q(a){}q.prototype=Object.create(h.SelectionType.prototype);var s;s={CompletionStatus:{MATCH:0,PARTIAL:1,ERROR:2}};s.Shell=function(){function h(a){this._init(a.input,a.output)}h.prototype={clear:function(){for(var a=
document.getElementsByClassName("gcli-output")[0];a.hasChildNodes();)a.removeChild(a.lastChild);this.output(m.formatMessage(k["For a list of available commands type '${0}'."],"\x3cb\x3ehelp\x3c/b\x3e"))},output:function(a){var c=new e.Output;this.commandOutputManager.onOutput({output:c});c.complete(a)},registerCommand:function(a){a.exec||(a.exec=a.callback);a.params||(a.params=a.parameters);var c=function(a){return function(c,b){var d=a(c,b);this.registeredTypes.forEach(function(a){a.prototype.lastParseTimestamp=
0});return d}.bind(this)}.bind(this);a.exec&&(a.exec=c(a.exec));n.addCommand(a)},registerType:function(a){a=function(a){function c(a){this.typeSpec=a}c.prototype=Object.create(q.prototype);c.prototype.name=a.getName();c.prototype.lastParseTimestamp=0;c.prototype.parse=function(c){var b=Object.getPrototypeOf(this),e=b.lastParseTimestamp;b.lastParseTimestamp=Math.round((new Date).getTime()/1E3);b=JSON.parse(JSON.stringify(c));return a.parse(b,this.typeSpec,{lastParseTimestamp:e}).then(function(a){var b=
d.Status.VALID;if(a.status)switch(a.status){case s.CompletionStatus.ERROR:b=d.Status.ERROR;break;case s.CompletionStatus.PARTIAL:b=d.Status.INCOMPLETE}var e=r.defer();e.resolve(a.predictions);return new d.Conversion(a.value,c,b,a.message,e.promise)})};c.prototype.lookup=function(){var c=Object.getPrototypeOf(this),b=c.lastParseTimestamp;c.lastParseTimestamp=Math.round((new Date).getTime()/1E3);return a.parse({prefix:"",suffix:"",text:""},this.typeSpec,{lastParseTimestamp:b}).then(function(a){return a.predictions})};
a.stringify&&(c.prototype.stringify=function(c){return a.stringify(c,this.typeSpec)});return c}(a);d.registerType(a);this.registeredTypes.push(a)},setFocusToInput:function(){this.inputText.focus()},setInputText:function(a){a&&(this.inputText.value=a.toString())},addField:function(a){},_init:function(d,e){function h(c,d){b.Field.call(this,c,d);this.isImportant=!0;this.element=a.createElement(this.document,"div");this.element.className="orion";this.menu=new f.Menu({document:this.document,field:!0,type:c});
this.menu.onItemClick=this.onItemClick.bind(this);this.element.appendChild(this.menu.element);this.onFieldChange=a.createEvent("CustomField.fieldChanged");this.onInputChange=this.onInputChange.bind(this)}this.registeredTypes=[];var l=document.createElement("div");l.id="gcli-display";l.style.height="100%";l.style.width="100%";e.appendChild(l);this.inputText=document.createElement("input");this.inputText.type="text";this.inputText.id="gcli-input";this.inputText.style.width="100%";this.inputText.style.height=
"100%";d.appendChild(this.inputText);g.getSetting("hideIntro").value=!0;g.getSetting("eagerHelper").value=2;setTimeout(function(){this.commandOutputManager=new c.CommandOutputManager;n.createDisplay({commandOutputManager:this.commandOutputManager});this.output(m.formatMessage(k["For a list of available commands type '${0}'."],"\x3cb\x3ehelp\x3c/b\x3e"))}.bind(this),1);p.startup();p.helpListHtml=p.helpListHtml.replace('"${includeIntro}"',"${false}");h.prototype=Object.create(b.Field.prototype);h.prototype.destroy=
function(){b.Field.prototype.destroy.call(this);this.menu.destroy();delete this.element;delete this.menu;delete this.document;delete this.onInputChange};h.prototype.setConversion=function(a){this.setMessage(a.message);var c=[];a.getPredictions().forEach(function(a){a.hidden||c.push({name:a.name,complete:a.name,description:a.description||""})},this);this.menu.show(c);a.then&&a.then(function(){this.element&&this.setConversion(this.getConversion())}.bind(this))};h.prototype.onItemClick=function(a){a=
a.conversion;this.onFieldChange({conversion:a});this.setMessage(a.message)};h.claim=function(a){return a instanceof q?b.Field.MATCH+1:b.Field.NO_MATCH};b.addField(h)}};return h}();return s});
define("shell/shellPageFileService",["i18n!orion/shell/nls/messages","orion/bootstrap","orion/fileClient","orion/Deferred"],function(k,m,n,d){var h;h={};var l,b;m.startup().then(function(d){b=d.serviceRegistry;l=new n.FileClient(b)});h.ShellPageFileService=function(){function f(){this.currentDirectory=null;this.withNode(this.SEPARATOR,function(a){this.rootNode=a}.bind(this));this.currentRetrievals={}}f.prototype={SEPARATOR:"/",computePathString:function(a){if(a.Location===this.SEPARATOR)return this.SEPARATOR;
var b=this.SEPARATOR+l.fileServiceName(a.Location),c=a.Parents;if(c){for(var b=b+this.SEPARATOR,d=c.length;0<=--d;)b+=c[d].Name,b+=this.SEPARATOR;b+=a.Name}a.Directory&&(b+=this.SEPARATOR);return b},createDirectory:function(a,b){return this._createResource(a,b,!0)},createFile:function(a,b){return this._createResource(a,b,!1)},ensureDirectory:function(a,b){var c=new d;"string"!==typeof b?b.Directory?c.resolve(b):c.reject(k["Cannot create directory, it already exists as a file"]):(a=a||this.getCurrentDirectory(),
this.withChildren(a,function(d){if(d)for(var f=0;f<d.length;f++)if(d[f].Name===b){d[f].Directory?c.resolve(d[f]):c.reject(k["Cannot create directory, it already exists as a file"]);return}this.createDirectory(a,b).then(function(a){c.resolve(a)},function(a){c.reject(a)})}.bind(this),function(a){c.reject(a)}));return c},ensureFile:function(a,b){var c=new d;"string"!==typeof b?b.Directory?c.reject(k["Cannot create file, it already exists as a directory"]):c.resolve(b):(a=a||this.getCurrentDirectory(),
this.withChildren(a,function(d){if(d)for(var f=0;f<d.length;f++)if(d[f].Name===b){d[f].Directory?c.reject(k["Cannot create file, it already exists as a directory"]):c.resolve(d[f]);return}this.createFile(a,b).then(function(a){c.resolve(a)},function(a){c.reject(a)})}.bind(this),function(a){c.reject(a)}));return c},getChild:function(a,b){if(0===b.length)return null;if("."===b)return a;if(".."===b)return this.getParent(a);if(!a.Children)return null;for(var c=0;c<a.Children.length;c++)if(a.Children[c].Name===
b)return a.Children[c];return null},getCurrentDirectory:function(){return this.currentDirectory},getDirectory:function(a,b){if(0===b.indexOf(this.SEPARATOR))a=this.rootNode,b=b.substring(1);else if(!a){if(!this.currentDirectory)return null;a=this.currentDirectory}for(var c=b.substring(0,b.lastIndexOf(this.SEPARATOR)).split(this.SEPARATOR),d=a,f=0;f<c.length;f++)if(0<c[f].length&&(d=this.getChild(d,c[f]),!d||!d.Directory))return null;c=b.substring(b.lastIndexOf(this.SEPARATOR)+1);(c=this.getChild(d,
c))&&this._retrieveNode(c);d.Children||this._retrieveNode(d);return d},getParent:function(a){a.parent&&this._retrieveNode(a.parent);return a.parent},loadWorkspace:function(a){var d=b.getService("orion.page.progress");return d?d.progress(l.loadWorkspace(a),"Loading workspace "+a):l.loadWorkspace(a)},read:function(a){return l.read(a.Location,!1)},readBlob:function(a){var b=l._getService(a.Location);return!b.readBlob?(a=new d,a.reject(k["Source file service does not support binary read"]),a):b.readBlob(a.Location)},
setCurrentDirectory:function(a){this.currentDirectory=a;this._retrieveNode(a)},withChildren:function(a,d,c){if(a.Children)d&&d(a.Children);else if(a.ChildrenLocation){var e=b.getService("orion.page.progress");(e?e.progress(l.fetchChildren(a.ChildrenLocation),"Getting children of "+a.Name):l.fetchChildren(a.ChildrenLocation)).then(function(c){this._sort(c);var b=a.Parents?a.Parents.slice(0):[];(!a.parent||a.parent!==this.rootNode)&&b.unshift(a);for(var e=0;e<c.length;e++)c[e].parent=a,c[e].Parents=
b;a.Children=c;d&&d(c)}.bind(this),function(a){c&&c(a)})}else d&&d(null)},withNode:function(a,d,c){var e=b.getService("orion.page.progress");(e?e.progress(l.loadWorkspace(a),"Loading workspace "+a):l.loadWorkspace(a)).then(function(a){this._retrieveNode(a,d,c)}.bind(this),c)},write:function(a,b){return l.write(a.Location,b)},writeBlob:function(a,b){var c=l._getService(a.Location);return!c.writeBlob?(c=new d,c.reject(k["Target file service does not support binary write"]),c):c.writeBlob(a.Location,
b)},_createResource:function(a,b,c){var e=a.Location+this.SEPARATOR+b,f=new d,h=this.currentRetrievals[e]||[];h.push(f);if(1===h.length){this.currentRetrievals[e]=h;var k=function(a){c&&(a.Name=b);this.currentRetrievals[e].forEach(function(c){c.resolve(a)});delete this.currentRetrievals[e]}.bind(this),m=function(a){this.currentRetrievals[e].forEach(function(c){c.reject(a.responseText)});delete this.currentRetrievals[e]}.bind(this);c?a.Projects?l.createProject(a.Location,b).then(function(a){l.read(a.ContentLocation,
!0).then(k,m)},m):l.createFolder(a.Location,b).then(k,m):l.createFile(a.Location,b).then(k,m)}return f},_retrieveNode:function(a,d,c){if(a.parent&&a.Children)d&&d(a);else{var e=function(a,c,b){a.Directory&&!a.Children?this.withChildren(a,function(b){c&&c(a)},b):c&&c(a)}.bind(this),f=function(a,c,d){if(a.Location===this.SEPARATOR)c(a);else if(a.Parents)if(0===a.Parents.length){var e=l.fileServiceRootURL(a.Location),g=b.getService("orion.page.progress");(g?g.progress(l.loadWorkspace(e),"Loading workspace "+
e):l.loadWorkspace(e)).then(function(b){b.parent=this.rootNode;a.parent=b;c(a)}.bind(this),d)}else{a.parent=a.Parents[0];for(d=0;d<a.Parents.length-1;d++)a.Parents[d].parent=a.Parents[d+1],a.Parents[d].Directory=!0;c(a)}else a.parent=this.rootNode,c(a)}.bind(this);if(!a.Parents&&!a.Projects&&a.Location!==this.SEPARATOR&&a.Name!==l.fileServiceName(a.Location)){var h=b.getService("orion.page.progress");(h?h.progress(l.loadWorkspace(a.Location),"Loading workspace "+a.Location):l.loadWorkspace(a.Location)).then(function(b){a.Parents=
b.Parents;f(a,function(a){e(a,d,c)},function(b){e(a,d,c)})})}else a.ChildrenLocation&&(a.Directory=!0),f(a,function(a){e(a,d,c)},function(b){e(a,d,c)})}},_sort:function(a){a.sort(function(a,c){if(a.Directory!==c.Directory)return a.Directory?-1:1;var b=a.Name&&a.Name.toLowerCase(),d=c.Name&&c.Name.toLowerCase();return b<d?-1:b>d?1:0})}};return f}();return h});
define("orion/urlUtils",["orion/PageUtil","orion/URL-shim"],function(k){return{detectValidURL:function(m){for(var n=/\[([^\]]*)\]\(([^\)]+)\)/g,d=n.exec(m),h=[],l=0;d;){if(3===d.length&&0<d[2].length){var b=new URL(d[2]);":"!==b.protocol&&k.validateURLScheme(b.href)&&(d.index>l&&h.push({segmentStr:m.substring(l,d.index)}),h.push({segmentStr:0<d[1].length?d[1]:d[2],urlStr:d[2]}),l=d.index+d[0].length)}d=n.exec(m)}if(0===l)return null;l<m.length-1&&h.push({segmentStr:m.substring(l)});return h},processURLSegments:function(k,
n){n.forEach(function(d){if(d.urlStr){var h=document.createElement("a");h.href=d.urlStr;h.appendChild(document.createTextNode(d.segmentStr))}else h=document.createElement("span"),h.textContent=d.segmentStr;k.appendChild(h)})}}});
(function(){function k(c){this.tokens=[];this.tokens.links={};this.options=c||f.defaults;this.rules=a.normal;this.options.gfm&&(this.rules=this.options.tables?a.tables:a.gfm)}function m(a,b){this.options=b||f.defaults;this.links=a;this.rules=g.normal;if(!this.links)throw Error("Tokens array requires a `links` property.");this.options.gfm?this.rules=this.options.breaks?g.breaks:g.gfm:this.options.pedantic&&(this.rules=g.pedantic)}function n(a){this.tokens=[];this.token=null;this.options=a||f.defaults}
function d(a,b){return a.replace(!b?/&(?!#?\w+;)/g:/&/g,"\x26amp;").replace(/</g,"\x26lt;").replace(/>/g,"\x26gt;").replace(/"/g,"\x26quot;").replace(/'/g,"\x26#39;")}function h(a,b){a=a.source;b=b||"";return function r(d,g){if(!d)return RegExp(a,b);g=g.source||g;g=g.replace(/(^|[^\[])\^/g,"$1");a=a.replace(d,g);return r}}function l(){}function b(a){for(var b=1,d,g;b<arguments.length;b++)for(g in d=arguments[b],d)Object.prototype.hasOwnProperty.call(d,g)&&(a[g]=d[g]);return a}function f(a,e,g){if(g||
"function"===typeof e){g||(g=e,e=null);e&&(e=b({},f.defaults,e));var h=e.highlight,l,m,w=0;try{l=k.lex(a,e)}catch(u){return g(u)}m=l.length;var y=function(a){var c,b;!0!==a&&delete e.highlight;try{c=n.parse(l,e)}catch(d){b=d}e.highlight=h;return b?g(b):g(null,c)};if(!h||3>h.length)return y(!0);if(!m)return y();for(;w<l.length;w++)(function(a){return"code"!==a.type?--m||y():h(a.text,a.lang,function(c,b){if(null==b||b===a.text)return--m||y();a.text=b;a.escaped=!0;--m||y()})})(l[w])}else try{return e&&
(e=b({},f.defaults,e)),n.parse(k.lex(a,e),e)}catch(t){t.message+="\nPlease report this to https://github.com/chjj/marked.";if((e||f.defaults).silent)return"\x3cp\x3eAn error occured:\x3c/p\x3e\x3cpre\x3e"+d(t.message+"",!0)+"\x3c/pre\x3e";throw t;}}var a={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:l,hr:/^( *[-*_]){3,} *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/,nptable:l,lheading:/^([^\n]+)\n *(=|-){3,} *\n*/,blockquote:/^( *>[^\n]+(\n[^\n]+)*\n*)+/,list:/^( *)(bull) [\s\S]+?(?:hr|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,
html:/^ *(?:comment|closed|closing) *(?:\n{2,}|\s*$)/,def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +["(]([^\n]+)[")])? *(?:\n+|$)/,table:l,paragraph:/^((?:[^\n]+\n?(?!hr|heading|lheading|blockquote|tag|def))+)\n*/,text:/^[^\n]+/,bullet:/(?:[*+-]|\d+\.)/,item:/^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/};a.item=h(a.item,"gm")(/bull/g,a.bullet)();a.list=h(a.list)(/bull/g,a.bullet)("hr",/\n+(?=(?: *[-*_]){3,} *(?:\n+|$))/)();a._tag="(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:/|@)\\b";
a.html=h(a.html)("comment",/\x3c!--[\s\S]*?--\x3e/)("closed",/<(tag)[\s\S]+?<\/\1>/)("closing",/<tag(?:"[^"]*"|'[^']*'|[^'">])*?>/)(/tag/g,a._tag)();a.paragraph=h(a.paragraph)("hr",a.hr)("heading",a.heading)("lheading",a.lheading)("blockquote",a.blockquote)("tag","\x3c"+a._tag)("def",a.def)();a.normal=b({},a);a.gfm=b({},a.normal,{fences:/^ *(`{3,}|~{3,}) *(\S+)? *\n([\s\S]+?)\s*\1 *(?:\n+|$)/,paragraph:/^/});a.gfm.paragraph=h(a.paragraph)("(?!","(?!"+a.gfm.fences.source.replace("\\1","\\2")+"|")();
a.tables=b({},a.gfm,{nptable:/^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/,table:/^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/});k.rules=a;k.lex=function(a,b){return(new k(b)).lex(a)};k.prototype.lex=function(a){a=a.replace(/\r\n|\r/g,"\n").replace(/\t/g,"    ").replace(/\u00a0/g," ").replace(/\u2424/g,"\n");return this.token(a,!0)};k.prototype.token=function(c,b){c=c.replace(/^ +$/gm,"");for(var d,g,f,h,k,l,m;c;){if(f=this.rules.newline.exec(c))c=c.substring(f[0].length),
1<f[0].length&&this.tokens.push({type:"space"});if(f=this.rules.code.exec(c))c=c.substring(f[0].length),f=f[0].replace(/^ {4}/gm,""),this.tokens.push({type:"code",text:!this.options.pedantic?f.replace(/\n+$/,""):f});else if(f=this.rules.fences.exec(c))c=c.substring(f[0].length),this.tokens.push({type:"code",lang:f[2],text:f[3]});else if(f=this.rules.heading.exec(c))c=c.substring(f[0].length),this.tokens.push({type:"heading",depth:f[1].length,text:f[2]});else if(b&&(f=this.rules.nptable.exec(c))){c=
c.substring(f[0].length);k={type:"table",header:f[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:f[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:f[3].replace(/\n$/,"").split("\n")};for(l=0;l<k.align.length;l++)/^ *-+: *$/.test(k.align[l])?k.align[l]="right":/^ *:-+: *$/.test(k.align[l])?k.align[l]="center":/^ *:-+ *$/.test(k.align[l])?k.align[l]="left":k.align[l]=null;for(l=0;l<k.cells.length;l++)k.cells[l]=k.cells[l].split(/ *\| */);this.tokens.push(k)}else if(f=this.rules.lheading.exec(c))c=
c.substring(f[0].length),this.tokens.push({type:"heading",depth:"\x3d"===f[2]?1:2,text:f[1]});else if(f=this.rules.hr.exec(c))c=c.substring(f[0].length),this.tokens.push({type:"hr"});else if(f=this.rules.blockquote.exec(c))c=c.substring(f[0].length),this.tokens.push({type:"blockquote_start"}),f=f[0].replace(/^ *> ?/gm,""),this.token(f,b),this.tokens.push({type:"blockquote_end"});else if(f=this.rules.list.exec(c)){c=c.substring(f[0].length);h=f[2];this.tokens.push({type:"list_start",ordered:1<h.length});
f=f[0].match(this.rules.item);d=!1;m=f.length;for(l=0;l<m;l++)k=f[l],g=k.length,k=k.replace(/^ *([*+-]|\d+\.) +/,""),~k.indexOf("\n ")&&(g-=k.length,k=!this.options.pedantic?k.replace(RegExp("^ {1,"+g+"}","gm"),""):k.replace(/^ {1,4}/gm,"")),this.options.smartLists&&l!==m-1&&(g=a.bullet.exec(f[l+1])[0],h!==g&&!(1<h.length&&1<g.length)&&(c=f.slice(l+1).join("\n")+c,l=m-1)),g=d||/\n\n(?!\s*$)/.test(k),l!==m-1&&(d="\n"===k[k.length-1],g||(g=d)),this.tokens.push({type:g?"loose_item_start":"list_item_start"}),
this.token(k,!1),this.tokens.push({type:"list_item_end"});this.tokens.push({type:"list_end"})}else if(f=this.rules.html.exec(c))c=c.substring(f[0].length),this.tokens.push({type:this.options.sanitize?"paragraph":"html",pre:"pre"===f[1]||"script"===f[1],text:f[0]});else if(b&&(f=this.rules.def.exec(c)))c=c.substring(f[0].length),this.tokens.links[f[1].toLowerCase()]={href:f[2],title:f[3]};else if(b&&(f=this.rules.table.exec(c))){c=c.substring(f[0].length);k={type:"table",header:f[1].replace(/^ *| *\| *$/g,
"").split(/ *\| */),align:f[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:f[3].replace(/(?: *\| *)?\n$/,"").split("\n")};for(l=0;l<k.align.length;l++)/^ *-+: *$/.test(k.align[l])?k.align[l]="right":/^ *:-+: *$/.test(k.align[l])?k.align[l]="center":/^ *:-+ *$/.test(k.align[l])?k.align[l]="left":k.align[l]=null;for(l=0;l<k.cells.length;l++)k.cells[l]=k.cells[l].replace(/^ *\| *| *\| *$/g,"").split(/ *\| */);this.tokens.push(k)}else if(b&&(f=this.rules.paragraph.exec(c)))c=c.substring(f[0].length),
this.tokens.push({type:"paragraph",text:"\n"===f[1][f[1].length-1]?f[1].slice(0,-1):f[1]});else if(f=this.rules.text.exec(c))c=c.substring(f[0].length),this.tokens.push({type:"text",text:f[0]});else if(c)throw Error("Infinite loop on byte: "+c.charCodeAt(0));}return this.tokens};var g={escape:/^\\([\\`*{}\[\]()#+\-.!_>])/,autolink:/^<([^ >]+(@|:\/)[^ >]+)>/,url:l,tag:/^\x3c!--[\s\S]*?--\x3e|^<\/?\w+(?:"[^"]*"|'[^']*'|[^'">])*?>/,link:/^!?\[(inside)\]\(href\)/,reflink:/^!?\[(inside)\]\s*\[([^\]]*)\]/,
nolink:/^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]/,strong:/^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/,em:/^\b_((?:__|[\s\S])+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/,code:/^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/,br:/^ {2,}\n(?!\s*$)/,del:l,text:/^[\s\S]+?(?=[\\<!\[_*`]| {2,}\n|$)/,_inside:/(?:\[[^\]]*\]|[^\]]|\](?=[^\[]*\]))*/,_href:/\s*<?([^\s]*?)>?(?:\s+['"]([\s\S]*?)['"])?\s*/};g.link=h(g.link)("inside",g._inside)("href",g._href)();g.reflink=h(g.reflink)("inside",g._inside)();g.normal=b({},g);g.pedantic=b({},
g.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/});g.gfm=b({},g.normal,{escape:h(g.escape)("])","~|])")(),url:/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,del:/^~~(?=\S)([\s\S]*?\S)~~/,text:h(g.text)("]|","~]|")("|","|https?://|")()});g.breaks=b({},g.gfm,{br:h(g.br)("{2,}","*")(),text:h(g.gfm.text)("{2,}","*")()});m.rules=g;m.output=function(a,b,d){return(new m(b,d)).output(a)};m.prototype.output=function(a){for(var b=
"",g,f;a;)if(f=this.rules.escape.exec(a))a=a.substring(f[0].length),b+=f[1];else if(f=this.rules.autolink.exec(a))a=a.substring(f[0].length),"@"===f[2]?(g=":"===f[1][6]?this.mangle(f[1].substring(7)):this.mangle(f[1]),f=this.mangle("mailto:")+g):f=g=d(f[1]),b+='\x3ca href\x3d"'+f+'"\x3e'+g+"\x3c/a\x3e";else if(f=this.rules.url.exec(a))a=a.substring(f[0].length),f=g=d(f[1]),b+='\x3ca href\x3d"'+f+'"\x3e'+g+"\x3c/a\x3e";else if(f=this.rules.tag.exec(a))a=a.substring(f[0].length),b+=this.options.sanitize?
d(f[0]):f[0];else if(f=this.rules.link.exec(a))a=a.substring(f[0].length),b+=this.outputLink(f,{href:f[2],title:f[3]});else if((f=this.rules.reflink.exec(a))||(f=this.rules.nolink.exec(a)))a=a.substring(f[0].length),g=(f[2]||f[1]).replace(/\s+/g," "),g=this.links[g.toLowerCase()],!g||!g.href?(b+=f[0][0],a=f[0].substring(1)+a):b+=this.outputLink(f,g);else if(f=this.rules.strong.exec(a))a=a.substring(f[0].length),b+="\x3cstrong\x3e"+this.output(f[2]||f[1])+"\x3c/strong\x3e";else if(f=this.rules.em.exec(a))a=
a.substring(f[0].length),b+="\x3cem\x3e"+this.output(f[2]||f[1])+"\x3c/em\x3e";else if(f=this.rules.code.exec(a))a=a.substring(f[0].length),b+="\x3ccode\x3e"+d(f[2],!0)+"\x3c/code\x3e";else if(f=this.rules.br.exec(a))a=a.substring(f[0].length),b+="\x3cbr\x3e";else if(f=this.rules.del.exec(a))a=a.substring(f[0].length),b+="\x3cdel\x3e"+this.output(f[1])+"\x3c/del\x3e";else if(f=this.rules.text.exec(a))a=a.substring(f[0].length),b+=d(this.smartypants(f[0]));else if(a)throw Error("Infinite loop on byte: "+
a.charCodeAt(0));return b};m.prototype.outputLink=function(a,b){return"!"!==a[0][0]?'\x3ca href\x3d"'+d(b.href)+'"'+(b.title?' title\x3d"'+d(b.title)+'"':"")+"\x3e"+this.output(a[1])+"\x3c/a\x3e":'\x3cimg src\x3d"'+d(b.href)+'" alt\x3d"'+d(a[1])+'"'+(b.title?' title\x3d"'+d(b.title)+'"':"")+"\x3e"};m.prototype.smartypants=function(a){return!this.options.smartypants?a:a.replace(/--/g,"\u2014").replace(/'([^']*)'/g,"\u2018$1\u2019").replace(/"([^"]*)"/g,"\u201c$1\u201d").replace(/\.{3}/g,"\u2026")};
m.prototype.mangle=function(a){for(var b="",d=a.length,f=0,g;f<d;f++)g=a.charCodeAt(f),0.5<Math.random()&&(g="x"+g.toString(16)),b+="\x26#"+g+";";return b};n.parse=function(a,b){return(new n(b)).parse(a)};n.prototype.parse=function(a){this.inline=new m(a.links,this.options);this.tokens=a.reverse();for(a="";this.next();)a+=this.tok();return a};n.prototype.next=function(){return this.token=this.tokens.pop()};n.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0};n.prototype.parseText=
function(){for(var a=this.token.text;"text"===this.peek().type;)a+="\n"+this.next().text;return this.inline.output(a)};n.prototype.tok=function(){switch(this.token.type){case "space":return"";case "hr":return"\x3chr\x3e\n";case "heading":return"\x3ch"+this.token.depth+"\x3e"+this.inline.output(this.token.text)+"\x3c/h"+this.token.depth+"\x3e\n";case "code":if(this.options.highlight){var a=this.options.highlight(this.token.text,this.token.lang);null!=a&&a!==this.token.text&&(this.token.escaped=!0,
this.token.text=a)}this.token.escaped||(this.token.text=d(this.token.text,!0));return"\x3cpre\x3e\x3ccode"+(this.token.lang?' class\x3d"'+this.options.langPrefix+this.token.lang+'"':"")+"\x3e"+this.token.text+"\x3c/code\x3e\x3c/pre\x3e\n";case "table":var b,f,g,h,a="\x3cthead\x3e\n\x3ctr\x3e\n";for(f=0;f<this.token.header.length;f++)b=this.inline.output(this.token.header[f]),a+=this.token.align[f]?'\x3cth align\x3d"'+this.token.align[f]+'"\x3e'+b+"\x3c/th\x3e\n":"\x3cth\x3e"+b+"\x3c/th\x3e\n";a+=
"\x3c/tr\x3e\n\x3c/thead\x3e\n\x3ctbody\x3e\n";for(f=0;f<this.token.cells.length;f++){b=this.token.cells[f];a+="\x3ctr\x3e\n";for(h=0;h<b.length;h++)g=this.inline.output(b[h]),a+=this.token.align[h]?'\x3ctd align\x3d"'+this.token.align[h]+'"\x3e'+g+"\x3c/td\x3e\n":"\x3ctd\x3e"+g+"\x3c/td\x3e\n";a+="\x3c/tr\x3e\n"}return"\x3ctable\x3e\n"+(a+"\x3c/tbody\x3e\n")+"\x3c/table\x3e\n";case "blockquote_start":for(a="";"blockquote_end"!==this.next().type;)a+=this.tok();return"\x3cblockquote\x3e\n"+a+"\x3c/blockquote\x3e\n";
case "list_start":f=this.token.ordered?"ol":"ul";for(a="";"list_end"!==this.next().type;)a+=this.tok();return"\x3c"+f+"\x3e\n"+a+"\x3c/"+f+"\x3e\n";case "list_item_start":for(a="";"list_item_end"!==this.next().type;)a+="text"===this.token.type?this.parseText():this.tok();return"\x3cli\x3e"+a+"\x3c/li\x3e\n";case "loose_item_start":for(a="";"list_item_end"!==this.next().type;)a+=this.tok();return"\x3cli\x3e"+a+"\x3c/li\x3e\n";case "html":return!this.token.pre&&!this.options.pedantic?this.inline.output(this.token.text):
this.token.text;case "paragraph":return"\x3cp\x3e"+this.inline.output(this.token.text)+"\x3c/p\x3e\n";case "text":return"\x3cp\x3e"+this.parseText()+"\x3c/p\x3e\n"}};l.exec=l;f.options=f.setOptions=function(a){b(f.defaults,a);return f};f.defaults={gfm:!0,tables:!0,breaks:!1,pedantic:!1,sanitize:!1,smartLists:!1,silent:!1,highlight:null,langPrefix:"lang-",smartypants:!1};f.Parser=n;f.parser=n.parse;f.Lexer=k;f.lexer=k.lex;f.InlineLexer=m;f.inlineLexer=m.output;f.parse=f;"object"===typeof exports?module.exports=
f:"function"===typeof define&&define.amd?define("marked/marked",[],function(){return f}):this.marked=f}).call(function(){return this||("undefined"!==typeof window?window:global)}());
define("shell/resultWriters",["orion/Deferred","orion/urlUtils","marked/marked"],function(k,m,n){var d;d={};d.FileBlobWriter=function(){function d(h,b){this.destination=h;this.shellPageFileService=b;this.blobs=[]}d.prototype={addBlob:function(d){this.blobs.push(d)},write:function(){var d=new k;this.shellPageFileService.ensureFile(null,this.destination).then(function(b){this.shellPageFileService.writeBlob(b,this.blobs[0]).then(function(){d.resolve()},function(b){d.reject(b)})}.bind(this),function(b){d.reject(b)});
return d}};return d}();d.FileStringWriter=function(){function d(h,b){this.destination=h;this.shellPageFileService=b}d.prototype={write:function(d){var b=new k;this.shellPageFileService.ensureFile(null,this.destination).then(function(f){this.shellPageFileService.write(f,d).then(function(){b.resolve()},function(a){b.reject(a)})}.bind(this),function(d){b.reject(d)});return b}};return d}();d.ShellBlobWriter=function(){function d(h){this.rootElement=h;this.blobCount=0}d.prototype={addBlob:function(d){this.blobCount++},
write:function(){var d=new k,b=document.createElement("span");b.textContent="("+this.blobCount+" blobs)";this.rootElement.appendChild(b);d.resolve();return d}};return d}();d.ShellStringWriter=function(){function d(h,b){this.rootElement=h;this.processMarkdown=b}d.prototype={write:function(d){var b=document.createElement("div");if(this.processMarkdown)b.innerHTML=n(d,{sanitize:!0,breaks:!0});else{this.rootElement.className+=" string-result-output";var f=m.detectValidURL(d);f?m.processURLSegments(b,
f):b.textContent=d}for(d=b.childNodes;0<d.length;)this.rootElement.appendChild(d[0]);d=new k;d.resolve();return d}};return d}();return d});
define("shell/paramType-file",["i18n!orion/shell/nls/messages","orion/shell/Shell","orion/i18nUtil","orion/Deferred","shell/resultWriters"],function(k,m,n,d,h){function l(b,a,d,c){this.value=b;this.typeSpec=a;this.typedPath=d;this.shellPageFileService=c}var b;b={};l.prototype={getPluginRepresentation:function(){var b=new d;if("string"===typeof this.value)b.resolve({file:{path:this.value}});else{var a=0,g=this.value.slice(0),c=[],e=function(d){d&&c.push(d);0===a&&0===g.length&&(this.typeSpec.multiple?
b.resolve(c):b.resolve(c[0]))}.bind(this),h=function(){for(;0<g.length;){var b=g[0],c=this.shellPageFileService.getCurrentDirectory(),d=c.Parents;if((!d||0===d.length)&&c.parent)d=[c.parent];d=d?d.slice(0):[];if(0<d.length)for(var f=d[d.length-1].parent;f;)d.push(f),f=f.parent;d.splice(0,0,c);c=d.length-1;f=b.Parents;if((!f||0===f.length)&&b.parent)f=[b.parent];f=f?f.slice(0):[];if(0<f.length)for(var k=f[f.length-1].parent;k;)f.push(k),k=k.parent;f.splice(0,0,b);for(k=f.length-1;0<=k&&0<=c;)if(f[k].Location===
d[c].Location)k--,c--;else break;d="";if(0===b.Location.indexOf(f[k+1].Location)){for(var l=0;l<=c;l++)d+=".."+this.shellPageFileService.SEPARATOR;d+=b.Location.substring(f[k+1].Location.length)}else d=b.Location;d={isDirectory:b.Directory,path:d.length?d:"."};b.Directory&&this.typeSpec.multiple&&this.typeSpec.recurse&&function(b){a++;this.shellPageFileService.withChildren(b,function(c){a--;if(0===c.length)e();else{var d=b.recursePath?b.recursePath.slice(0):[];d.push(b.Name);var f=function(b){a--;
g.push(b);1===g.length&&h()};c.forEach(function(b){b.recursePath=d;a++;b.parent?f(b):this.shellPageFileService.withNode(b.Location,f,function(b){a--;e()})}.bind(this))}}.bind(this),function(b){a--;e()})}.call(this,b);g.splice(0,1);this.typeSpec.content&&!d.isDirectory?function(c){a++;this.shellPageFileService.readBlob(b).then(function(b){a--;c.blob=b;e(c)},function(b){a--;e(c)})}.call(this,d):e(d)}}.bind(this);h()}return b},getValue:function(){return this.value},resourceExists:function(){return"string"!==
typeof this.value},stringify:function(){return this.typedPath}};b.ParamTypeFile=function(){function b(a){this.shellPageFileService=a}b.prototype={getName:function(){return"file"},parse:function(a,b){var c=new d;this._getPredictions(a.text).then(function(d){c.resolve(this._createCompletion(a.text,d,b))}.bind(this),function(a){c.error(a)});return c},processResult:function(a,b,c,d){var f=document.createElement("div"),l=0,m=function(b){this.callback=function(){var c=n.formatMessage(k["Wrote ${0}"],"string"===
typeof b?b:this.shellPageFileService.computePathString(b));(new h.ShellStringWriter(f)).write(c+"\n");0!==--l||d?a.progress(f):a.resolve(f)}.bind(this);return this}.bind(this),s=function(b){this.callback=function(c){var g=n.formatMessage(k["Failed to write ${0}"],"string"===typeof b?b:this.shellPageFileService.computePathString(b)),g=g+(" ["+c+"]");(new h.ShellStringWriter(f)).write(g+"\n");0!==--l||d?a.progress(f):a.resolve(f)}.bind(this);return this}.bind(this);c=c||this.shellPageFileService.getCurrentDirectory();
l++;this.shellPageFileService.ensureDirectory(null,c).then(function(a){l--;var c=b.getValue();b.isArray()||(c=[c]);c.forEach(function(b){l++;for(var c=b.path.split(this.shellPageFileService.SEPARATOR),d=0;d<c.length;){var e=c[d];if("."===e)c.splice(d,1);else if(".."===e){if(0===d){s(n.formatMessage(k["Cannot write ${0}, it is not a descendent of the output directory"],b.path));return}c.splice(d-- -1,2)}else d++}var f=function(a,b,c){var d=c[0];c.splice(0,1);var e=this.shellPageFileService.computePathString(a)+
this.shellPageFileService.SEPARATOR+d;0===c.length?b.isDirectory?this.shellPageFileService.ensureDirectory(a,d).then(m(e).callback,s(e).callback):this.shellPageFileService.ensureFile(a,d).then(function(a){var c=new h.FileBlobWriter(a,this.shellPageFileService);c.addBlob(b.blob);c.write().then(m(a).callback,s(a).callback)}.bind(this),s(e).callback):this.shellPageFileService.ensureDirectory(a,d).then(function(a){f(a,b,c)},s(this.shellPageFileService.computePathString(a)+this.shellPageFileService.SEPARATOR+
d).callback)}.bind(this);f(a,b,c)}.bind(this))}.bind(this),s(c).callback)},stringify:function(a){return!a?"":"string"===typeof a?a:a.stringify()},_createCompletion:function(a,b,c){if(!b)return{value:void 0,status:m.CompletionStatus.ERROR,message:n.formatMessage(k["'${0}' is not valid"],a),predictions:null};var d,f,h;if(!1===c.exist){var q;for(f=0;f<b.length;f++){var s=b[f];if(s.name===a){q=s;break}}q?(f=m.CompletionStatus.ERROR,d=n.formatMessage(k["'${0}' already exists"],a)):(f=m.CompletionStatus.MATCH,
h=new l(a,c,a,this.shellPageFileService));b=[]}else{var w=[];b.forEach(function(a){(a.value.Directory||c.file)&&w.push(a)});b=w;if(c.exist){var u=[];q=a.replace(/[\-(){}\[\]+,.\\\^$|#]/g,"\\$\x26");q=q.replace(/\?/g,".");q=q.replace(/\*/g,".*");var y=RegExp("^"+q+"$");b.forEach(function(a){a.name.match(y)&&(a.value.Directory&&c.directory||!a.value.Directory&&c.file)&&u.push(a.value)});c.multiple&&u.length||1===u.length?(f=m.CompletionStatus.MATCH,h=new l(u,c,a,this.shellPageFileService)):b.length?
f=m.CompletionStatus.PARTIAL:(f=m.CompletionStatus.ERROR,d=n.formatMessage(k["'${0}' is not valid"],a))}else{for(f=0;f<b.length;f++)if(s=b[f],s.name===a){q=s;break}f=m.CompletionStatus.MATCH;h=q?new l([q.value],c,a,this.shellPageFileService):new l(a,c,a,this.shellPageFileService)}}return{value:h,status:f,message:d,predictions:b}},_find:function(a,b){for(var c=0;c<a.length;c++)if(b(a[c]))return a[c];return null},_getPredictions:function(a){var b=new d,c=this.shellPageFileService.getDirectory(null,
a);c?this.shellPageFileService.withChildren(c,function(d){var f=a.lastIndexOf(this.shellPageFileService.SEPARATOR)+1,h=a.substring(0,f),k=a.substring(f),l=0===k.length||"."===k,f=[],m=[];l&&f.push({name:h+".",value:c,incomplete:!0});if(l||".."===k)(l=this.shellPageFileService.getParent(c))&&f.push({name:h+"..",value:l,incomplete:!0});0===k.trim().length&&0<h.length&&f.push({name:h,value:c,incomplete:!1});for(var k=k.replace(/[\-(){}\[\]+,.\\\^$|#]/g,"\\$\x26"),k=k.replace(/\?/g,"."),k=k.replace(/\*/g,
".*"),l=RegExp("^"+k),n=0;n<d.length;n++){var y=d[n];if(y.Name.match(l)){var t=!y.Directory||y.Children&&0===y.Children.length,k=h+y.Name;y.Directory?f.push({name:k,value:y,incomplete:!t}):m.push({name:k,value:y,incomplete:!t})}}b.resolve(f.concat(m))}.bind(this),function(a){b.error(a)}):b.resolve(null);return b}};return b}();return b});
define("shell/paramType-plugin",["i18n!orion/shell/nls/messages","require","orion/shell/Shell","orion/i18nUtil","orion/Deferred"],function(k,m,n,d,h){var l;l={};var b=function(){function b(a,d){this.plugins=a;this.urlsToExclude=d}b.prototype={name:"all",getPluginLocations:function(){var a=[];this.plugins.forEach(function(b){b=b.getLocation();(!this.urlsToExclude||!this.urlsToExclude[b])&&a.push(b)}.bind(this));return a},isAllPlugin:function(){return!0},start:function(a){return this._invokeOnAllPlugins("start",
a)},stop:function(){return this._invokeOnAllPlugins("stop")},uninstall:function(){return this._invokeOnAllPlugins("uninstall")},update:function(){return this._invokeOnAllPlugins("update")},_invokeOnAllPlugins:function(a,b){var c=this.urlsToExclude?[]:this.plugins;this.urlsToExclude&&this.plugins.forEach(function(a){this.urlsToExclude[a.getLocation()]||c.push(a)}.bind(this));var d=new h,f=c.length,k=0;c.forEach(function(c){c[a](b).then(function(){++k===f&&d.resolve()},function(a){d.reject(a)})});return d}};
return b}();l.ParamTypePlugin=function(){function f(a){this.pluginRegistry=a;a.addEventListener("installed",function(){this._initPluginsList()}.bind(this));a.addEventListener("uninstalled",function(){this._initPluginsList()}.bind(this));a.addEventListener("stopping",function(){this._sort(this.plugins)}.bind(this));a.addEventListener("lazy activation",function(){this._sort(this.plugins)}.bind(this));window.setTimeout(function(){this._computeDefaultPlugins();this._initPluginsList()}.bind(this),1)}f.prototype=
{getName:function(){return"plugin"},getPlugins:function(){return this.plugins.slice(0)},parse:function(a,b){var c=new h,d=this._getPredictions(a.text,b);c.resolve(this._createCompletion(a.text,d));return c},stringify:function(a){return a.name},_defaultPluginUrls:{},_computeDefaultPlugins:function(){var a=localStorage.getItem("/orion/preferences/default/plugins");a&&(a=JSON.parse(a),Object.keys(a).forEach(function(a){var b=this._defaultPluginUrls;a=m.toUrl(a);if(-1===a.indexOf("://")){var d=document.createElement("a");
d.href=a;a=d.href}b[a]=!0}.bind(this)))},_createCompletion:function(a,b){for(var c,e=0;e<b.length;e++){var f=b[e];if(f.name===a){c=f;break}}var h;c?e=n.CompletionStatus.MATCH:b&&0<b.length?e=n.CompletionStatus.PARTIAL:(e=n.CompletionStatus.ERROR,h=d.formatMessage(k["'${0}' is not valid"],a));return{value:c?c.value:void 0,status:e,message:h,predictions:b}},_formatLocationAsPluginName:function(a){var b=a.split("/"),b=b[b.length-1],b=b.split(".html")[0],b=b.replace(/([a-z])([A-Z])/,"$1 $2"),b=function(a){return a.toLowerCase().replace(/\b[a-z]/g,
function(a){return a.toUpperCase()})}(b),b=b.replace("plugin",""),b=b.replace("Plugin","");""===b&&(b=a);return b.trim()},_getPredictions:function(a,d){var c=[];this.plugins&&(this.plugins.forEach(function(b){(!d.excludeDefaultPlugins||!this._defaultPluginUrls[b.getLocation()])&&0===b.name.indexOf(a)&&c.push({name:b.name,value:b})}.bind(this)),d.multiple&&0==="all".indexOf(a)&&c.push({name:"all",value:new b(this.plugins,d.excludeDefaultPlugins?this._defaultPluginUrls:null)}));return c},_initPluginsList:function(){this.plugins=
[];this.pluginRegistry.getPlugins().forEach(function(a){var b=a.getLocation(),c=a.getHeaders();a.name=c.name||this._formatLocationAsPluginName(b);this.plugins.push(a)}.bind(this));this._sort(this.plugins)},_sort:function(a){a.sort(function(a,b){var d=a.getState(),d="active"===d||"starting"===d,f=b.getState();if(d!==("active"===f||"starting"===f))return d?-1:1;d=a.name&&a.name.toLowerCase();f=b.name&&b.name.toLowerCase();return d<f?-1:d>f?1:0})}};return f}();return l});
define("shell/paramType-service",["i18n!orion/shell/nls/messages","orion/shell/Shell","orion/i18nUtil","orion/Deferred"],function(k,m,n,d){var h;h={};h.ParamTypeService=function(){function h(b){this.pluginRegistry=b;b.addEventListener("installed",function(){this._initServicesList()}.bind(this));b.addEventListener("uninstalled",function(){this._initServicesList()}.bind(this));window.setTimeout(function(){this._initServicesList()}.bind(this),1)}h.prototype={getName:function(){return"service"},parse:function(b){var f=
new d,a=this._getPredictions(b.text);f.resolve(this._createCompletion(b.text,a));return f},stringify:function(b){return b},_createCompletion:function(b,d){for(var a,g=0;g<d.length;g++){var c=d[g];if(c.name===b){a=c;break}}var e;a?g=m.CompletionStatus.MATCH:d&&0<d.length?g=m.CompletionStatus.PARTIAL:(g=m.CompletionStatus.ERROR,e=n.formatMessage(k["'${0}' is not valid"],b));return{value:a?a.value:void 0,status:g,message:e,predictions:d}},_getPredictions:function(b){var d=[];this.services&&this.services.forEach(function(a){0===
a.indexOf(b)&&d.push({name:a,value:a})});return d},_initServicesList:function(){var b={};this.pluginRegistry.getPlugins().forEach(function(a){a.getServiceReferences().forEach(function(a){a.getProperty("service.names").forEach(function(a){b[a]=!0})})});this.services=[];for(var d in b)this.services.push(d);this._sort(this.services)},_sort:function(b){b.sort(function(b,a){var d=b.toLowerCase(),c=a.toLowerCase();return d<c?-1:d>c?1:0})}};return h}();return h});
define("orion/status",["i18n!orion/nls/messages","orion/webui/littlelib","orion/globalCommands","orion/urlUtils"],function(k,m,n,d){function h(b,d,a,g,c){this._serviceRegistry=b;this._serviceRegistration=b.registerService("orion.page.message",this);this._operationsClient=d;this.notificationContainerDomId=c;this.domId=a;this.progressDomId=g||a;this._hookedClose=!1;this._timer=null;this._clickToDisMiss=!0;this._cancelMsg=null}var l;h.prototype={_init:function(){var b=m.node("closeNotifications");if(b&&
!this._hookedClose){b.style.cursor="pointer";this._hookedClose=!0;var d=m.node(this.notificationContainerDomId);m.addAutoDismiss([d],function(){this._clickToDisMiss&&this.close()}.bind(this));b.addEventListener("click",function(){this.close()}.bind(this));d.addEventListener("click",function(a){a&&a.target&&"a"===a.target.nodeName.toLowerCase()&&(a=m.$$("a",d))&&a.length&&1===a.length&&this.close()}.bind(this))}},close:function(){window.clearTimeout(this._timer);var b=m.node("closeNotifications");
this._cancelMsg&&this._cancelFunc&&b?(b.innerHTML="",b.classList.remove("cancelButton"),b.classList.add("dismissButton"),b.classList.add("core-sprite-close"),b.classList.add("imageSprite"),this._cancelFunc(),this._cancelMsg=null):this.setProgressMessage("")},_getNotifierElements:function(){this._notifierElements||(this._notifierElements=n.getToolbarElements(this.notificationContainerDomId));return this._notifierElements},setMessage:function(b,d,a){this._init();this.currentMessage=b;var g=m.node(this.domId);
if("boolean"===typeof a){var c=g.getAttribute("aria-live");g.setAttribute("aria-live",a?"polite":"off");window.setTimeout(function(){b===this.currentMessage&&(m.empty(g),g.appendChild(document.createTextNode(b)),window.setTimeout(function(){g.setAttribute("aria-live",c)},100))}.bind(this),100)}else m.empty(g),g.appendChild(document.createTextNode(b));"number"===typeof d&&window.setTimeout(function(){b===this.currentMessage&&(m.empty(g),g.appendChild(document.createTextNode("")))}.bind(this),d)},setErrorMessage:function(b){this._clickToDisMiss=
!0;this.currentMessage=b;this._init();var d=b.responseText||b.message||b;if("string"===typeof d)try{d=JSON.parse(d)}catch(a){}b=d.Message||d;var g="red";if(d.Severity)switch(d.Severity){case "Warning":g="#FFCC00";break;case "Error":g="red";break;case "Info":case "Ok":g="green"}d=document.createElement("span");d.style.color=g;d.appendChild(document.createTextNode(b));b=m.node(this.domId);m.empty(b);b.appendChild(d)},setProgressMessage:function(b){this._clickToDisMiss=!1;this._init();this.currentMessage=
b;var d=document.createElement("span");d.classList.add("progressIcon");var a=m.node(this.progressDomId);m.empty(a);a.appendChild(d);a.appendChild(document.createTextNode(b));d=m.node(this.notificationContainerDomId);d.classList.remove("notificationHide");if(b&&0<b.length)d.classList.add("progressNormal"),d.classList.add("notificationShow");else{if(this._progressMonitors&&0<this._progressMonitors.length)return this._renderOngoingMonitors();d.classList.remove("notificationShow");d.classList.add("notificationHide")}},
setCancelFunction:function(b){this._cancelFunc=b},setProgressResult:function(b,f){this._clickToDisMiss=!1;this._cancelMsg=f;this.currentMessage=b;var a=b.responseText||b;if("string"===typeof a)try{a=JSON.parse(a)}catch(g){}this._init();var c=a.Message||a.toString(),e=k.UnknownError,h="core-sprite-information",l="progressNormal",n=document.createElement("span");n.classList.add("imageSprite");n.classList.add("progressIcon");var s=[];if(a.Severity)switch(a.Severity){case "Warning":e=k.UnknownWarning;
h="core-sprite-warning";l="progressWarning";s.push("progressInfo");s.push("progressError");s.push("progressNormal");this._clickToDisMiss=!0;break;case "Error":h="core-sprite-error";l="progressError";s.push("progressWarning");s.push("progressInfo");s.push("progressNormal");this._clickToDisMiss=!0;break;default:l="progressNormal",s.push("progressWarning"),s.push("progressError"),s.push("progressNormal")}s.push("notificationHide");n.classList.add(h);var w=m.node(this.progressDomId),h=m.node(this.notificationContainerDomId);
m.empty(w);w.appendChild(n);c===Object.prototype.toString()&&(c=e);a.HTML?(a=document.createElement("span"),a.innerHTML=c,w.appendChild(a)):((e=d.detectValidURL(c))?(c=document.createDocumentFragment(),d.processURLSegments(c,e),Array.prototype.forEach.call(m.$$("a",c),function(a){a.target="_blank"})):("Warning"!==a.Severity&&"Error"!==a.Severity&&!f&&(this._timer&&window.clearTimeout(this._timer),this._timer=window.setTimeout(function(){this.setProgressMessage("");this._timer=null}.bind(this),5E3)),
c=document.createTextNode(c)),w.appendChild(c));if(l&&this.progressDomId!==this.domId){h.classList.add(l);for(l=0;l<s.length;l++)h.classList.remove(s[l])}h.classList.add("notificationShow");if(s=m.node("closeNotifications"))this._cancelMsg?(s.classList.add("cancelButton"),s.classList.remove("dismissButton"),s.classList.remove("core-sprite-close"),s.classList.remove("imageSprite"),s.innerHTML=this._cancelMsg):(s.innerHTML="",s.classList.remove("cancelButton"),s.classList.add("dismissButton"),s.classList.add("core-sprite-close"),
s.classList.add("imageSprite"))},showWhile:function(b,d){var a=this;if(d){a.setProgressMessage(d);var g=function(){d===a.currentMessage&&a.setProgressMessage("")};b.then(g,g)}return b},_lastProgressId:0,_progressMonitors:{length:0},createProgressMonitor:function(b,d){return new l(this,++this._lastProgressId,b,d)},_renderOngoingMonitors:function(){if(0<this._progressMonitors.length){var b="",d=!0,a;for(a in this._progressMonitors)this._progressMonitors[a].status&&(d||(b+=", "),b+=this._progressMonitors[a].status,
d=!1);this.setProgressMessage(b)}else this.setProgressMessage("")},_beginProgressMonitor:function(b){this._progressMonitors[b.progressId]=b;this._progressMonitors.length++;this._renderOngoingMonitors()},_workedProgressMonitor:function(b){this._progressMonitors[b.progressId]=b;this._renderOngoingMonitors()},_doneProgressMonitor:function(b){delete this._progressMonitors[b.progressId];this._progressMonitors.length--;b.status?this.setProgressResult(b.status):this._renderOngoingMonitors()}};h.prototype.constructor=
h;l=function(b,d,a,g){this.statusService=b;this.progressId=d;if(a){this.deferred=a;this.begin(g);var c=this;a.then(function(a,b){c.done.bind(c)()},function(a,b){c.done.bind(c)()})}};l.prototype.begin=function(b){this.status=b;this.statusService._beginProgressMonitor(this)};l.prototype.done=function(b){this.status=b;this.statusService._doneProgressMonitor(this)};l.prototype.worked=function(b){this.status=b;this.statusService._workedProgressMonitor(this)};l.prototype.constructor=l;return{StatusReportingService:h,
ProgressMonitor:l}});
define("orion/operations/nls/root/messages",{More:"More","No Matching OperationService for location:":"No Matching OperationService for location:","No operations services registered.":"No operations services registered.","could not find toolbar ":"could not find toolbar ","Remove Completed":"Remove Completed","Remove all completed operations":"Remove all completed operations",Remove:"Remove","Remove operations from the operations list.":"Remove operations from the operations list.",Cancel:"Cancel",
"Cancel operations from the operations list.":"Cancel operations from the operations list.","Operation resulted in a warning.":"Operation resulted in a warning.","Operation resulted in an error.":"Operation resulted in an error.","Operation is running.":"Operation is running.","Operation is canceled.":"Operation is canceled.","Operation failed.":"Operation failed.",Name:"Name",Actions:"Actions",Status:"Status",Scheduled:"Scheduled"});
define("orion/operations/nls/messages",["orion/i18n!orion/operations/nls/messages","orion/operations/nls/root/messages"],function(k,m){var n={root:m};Object.keys(k).forEach(function(d){"undefined"===typeof n[d]&&(n[d]=k[d])});return n});
define("orion/webui/popupdialog",["i18n!orion/widgets/nls/messages","require","orion/webui/littlelib","orion/webui/tooltip"],function(k,m,n,d){function h(){}h.prototype={_initialize:function(h,b,f,a,g){this._tooltip=new d.Tooltip({node:h,hideDelay:g||0,afterShowing:this._afterShowingFunction(b).bind(this),afterHiding:f,trigger:a?a:"click"});this.$parent=this._tooltip.contentContainer();this.$parent.role="dialog";h=document.createRange();h.selectNode(this.$parent);h=h.createContextualFragment(this.TEMPLATE);
this.messages&&n.processTextNodes(h,k);this.$parent.appendChild(h);var c=this._tooltip;this.$parent.addEventListener("keydown",function(a){a.keyCode===n.KEY.ESCAPE&&c.hide()},!1);this._bindElements(this.$parent);"function"===typeof this._bindToDom&&this._bindToDom(this.$parent)},_bindElements:function(d){for(var b=0;b<d.childNodes.length;b++){var f=d.childNodes[b];f.id&&(this["$"+f.id]=f);this._bindElements(f)}},_afterShowingFunction:function(d){return function(){d&&d.bind(this)();if(!this.customFocus){var b=
n.firstTabbable(this.$parent);b&&b.focus()}}},hide:function(){this._tooltip.hide()},show:function(){this._tooltip.show()}};h.prototype.constructor=h;return{PopupDialog:h}});
define("orion/operationsCommands",["i18n!orion/operations/nls/messages","require","orion/webui/littlelib","orion/commands"],function(k,m,n,d){var h={};(function(){var l=!1;h.updateNavTools=function(b,d,a,g,c,e){var h=n.node(g);if(h)d.destroy(h);else throw k["could not find toolbar "]+g;d.renderCommands(g,h,e,a,"button");if(c&&(g=n.node(c)))d.destroy(g),d.renderCommands(c,g,null,a,"button");l||(l=!0,b.getService("orion.page.selection").addEventListener("selectionChanged",function(b){var e=n.node(c);
e&&(d.destroy(e),d.renderCommands(c,e,b.selections,a,"button"))}))};h.createOperationsCommands=function(b,f,a){function g(a){return!a.operation||!a.operation.type?!1:"loadstart"===a.operation.type||"progress"===a.operation.type}var c=new d.Command({name:k["Remove Completed"],tooltip:k["Remove all completed operations"],id:"eclipse.removeCompletedOperations",callback:function(b){a.removeCompletedOperations().then(function(a){f.loadOperations.bind(f)()})},visibleWhen:function(a){return!0}});b.addCommand(c);
c=new d.Command({name:k.Remove,tooltip:k["Remove operations from the operations list."],imageClass:"core-sprite-delete",id:"eclipse.removeOperation",callback:function(b){b=Array.isArray(b.items)?b.items:[b.items];for(var c=0;c<b.length;c++){var d=b[c];a.removeOperation.bind(a)(d.Location).then(function(){f.loadOperations.bind(f)()},function(){f.loadOperations.bind(f)()})}},visibleWhen:function(a){if(!Array.isArray(a)||0===a.length)return!g(a);for(var b in a)if(g(a[b]))return!1;return!0}});b.addCommand(c);
c=new d.Command({name:k.Cancel,tooltip:k["Cancel operations from the operations list."],imageClass:"core-sprite-stop",id:"eclipse.cancelOperation",callback:function(a){a=Array.isArray(a.items)?a.items:[a.items];for(var b=0;b<a.length;b++){var c=a[b];c.deferred&&c.deferred.cancel()}},visibleWhen:function(a){if(!Array.isArray(a)||0===a.length)return g(a)&&(a.operation&&a.operation.cancelable?!0:!1);for(var b in a)if(!g(a[b])||!a[b].operation||!a[b].operation.cancelable)return!1;return!0}});b.addCommand(c)}})();
return h});
define("orion/webui/dialogs/OperationsDialog",["i18n!orion/operations/nls/messages","require","orion/webui/littlelib","orion/webui/popupdialog","orion/operationsCommands"],function(k,m,n,d,h){function l(b){this._options=b}l.prototype=new d.PopupDialog;l.prototype.TEMPLATE='\x3ctable style\x3d"width: 360px;"\x3e\x3ctr\x3e\x3ctd\x3e\x3ch2\x3eRecent operations\x3c/h2\x3e\x3c/td\x3e\x3ctd style\x3d"text-align: right;"\x3e\x3ca id\x3d"allOperationsLink" class\x3d"navlinkonpage"\x3eAll Operations\x3c/a\x3e\x3c/td\x3e\x3c/tr\x3e\x3c/table\x3e\x3cdiv id\x3d"operationsExist"\x3e\x3cdiv style\x3d"padding-left: 7px" id\x3d"myOperationsListEmpty"\x3eNo operations running on this page.\x3c/div\x3e\x3ctable id\x3d"myOperationsList" style\x3d"display: none;"\x3e\x3c/table\x3e\x3c/div\x3e\x3cdiv style\x3d"padding-left: 7px" id\x3d"operationsDontExist"\x3eNo operations running.\x3c/div\x3e';l.prototype._init=
function(b){this._myOperations=[];this._operationsDeferreds=[];this._commandService=b.commandRegistry;h.createOperationsCommands(this._commandService);this._commandService.registerCommandContribution("operationsDialogItems","eclipse.cancelOperation",1);this._initialize(b.triggerNode)};l.prototype._bindToDom=function(b){this.$allOperationsLink.href=m.toUrl("operations/list.html");this._setOperationsVisibility()};l.prototype.setOperations=function(b,d){this._myOperations||this._init(this._options);
this._myOperations=[];this._operationsDeferreds=[];if(b)for(var a in b)this._myOperations.push(b[a]),this._operationsDeferreds.push(d[a]);this._renderOperations()};l.prototype.parseProgressResult=function(b){if(!b)return{};b=b.responseText||b;try{b=JSON.parse(b)}catch(d){}var a={Message:b.Message||b,Severity:b.Severity};b.DetailedMessage&&b.DetailedMessage!==a.Message&&(a.DetailedMessage=b.DetailedMessage);return a};l.prototype._renderOperations=function(){this._renderOperationsTable(this.$myOperationsList,
this._myOperations,this._operationsDeferreds)};l.prototype._renderOperationsTable=function(b,d,a){n.empty(b);for(var g=0;g<d.length;g++){var c=d[g],e=document.createElement("tr"),h=document.createElement("td");h.style.paddingLeft="5px";h.style.paddingRight="5px";h.textContent=c.Name;e.appendChild(h);var l=document.createElement("div");h.appendChild(l);h=document.createElement("span");h.style.paddingRight="5px";h.classList.add("imageSprite");switch(c.type){case "Warning":h.classList.add("core-sprite-warning");
h.setAttribute("aria-label",k["Operation resulted in a warning."]);break;case "error":h.classList.add("core-sprite-error");h.setAttribute("aria-label",k["Operation resulted in an error."]);break;case "loadstart":case "progress":h.classList.add("core-sprite-start");h.setAttribute("aria-label",k["Operation is running."]);break;case "abort":h.classList.add("core-sprite-stop");h.setAttribute("aria-label",k["Operation is canceled."]);break;case "load":case "loadend":h.classList.add("core-sprite-ok"),h.setAttribute("aria-label",
"Operation ok.")}l.appendChild(h);h=document.createElement("span");h.classList.add("operationStatus");h.textContent=c.Name;l.appendChild(h);if(c.error){var m=c.error.Message||c.error;c.error.DetailedMessage&&""!==c.error.DetailedMessage&&(m+=": "+c.error.DetailedMessage);h.textContent=m;h.classList.remove("operationStatus");h.classList.add("operationError")}this._commandService.renderCommands("operationsDialogItems",l,{operation:c,deferred:a[g]},this,"tool");b.appendChild(e)}this._setOperationsVisibility()};
l.prototype._setOperationsVisibility=function(){this.$myOperationsList.style.display=0<this._myOperations.length?"":"none";this.$myOperationsListEmpty.style.display=0<this._myOperations.length?"none":"";this.$operationsDontExist.style.display=0<this._myOperations.length?"none":"";this.$operationsExist.style.display=0<this._myOperations.length?"":"none"};l.prototype.constructor=l;return{OperationsDialog:l}});
define("orion/progress",["i18n!orion/nls/messages","require","orion/Deferred","orion/webui/littlelib","orion/webui/dialogs/OperationsDialog"],function(k,m,n,d,h){function l(b,a){if(!this._progressPane){this._progressPane=d.node(b);this._operationsDialog=new h.OperationsDialog({triggerNode:this._progressPane,commandRegistry:a});var g=this;this._progressPane.addEventListener("keydown",function(a){(" "===a.charOrCode||a.keyCode===d.KEY.ENTER)&&g._operationsDialog.show()});this._progressPane.addEventListener("click",
function(a){g._operationsDialog.show()});this._operationsDialog.setOperations(null,null)}}function b(b,a,d,c){this._serviceRegistry=b;this._serviceRegistration=b.registerService("orion.page.progress",this);this._commandRegistry=d;this._operationsClient=a;this._operations={};this._operationDeferrds={};this._operationsIndex=0;this._lastIconClass=this._lastOperation=null;this._progressMonitorClass=c}l.prototype={_switchIconTo:function(b){this._lastIconClass&&this._progressPane.classList.remove(this._lastIconClass);
this._lastIconClass=b;this._progressPane.classList.add(this._lastIconClass)},generateOperationsInfo:function(b,a){var d={},c;for(c in b)b[c].progressMonitor||(d[c]=b[c]);if(this._isEmpty(d))this._switchIconTo("progressPane_empty"),this._progressPane.title=k.Operations,this._progressPane.alt=k.Operations,this._progressPane.hasAttribute("aria-valuetext")&&this._progressPane.removeAttribute("aria-valuetext");else{var e="";for(c in d){var h=d[c];if(h.type&&("loadstart"===h.type||"progress"===h.type)){e=
"running";break}}""===e&&null!=this._lastOperation&&this._lastOperation.type&&"error"===this._lastOperation.type&&"error"==e;switch(e){case "running":this._progressPane.title=k["Operations running"];this._progressPane.alt=k["Operations running"];this._progressPane.setAttribute("aria-valuetext",k["Operations running"]);this._switchIconTo("running");break;case "warning":this._progressPane.title=k["Some operations finished with warning"];this._progressPane.alt=k["Some operations finished with warning"];
this._progressPane.setAttribute("aria-valuetext",k["Some operations finished with warning"]);this._switchIconTo("warning");break;case "error":this._progressPane.title=k["Some operations finished with error"];this._progressPane.alt=k["Some operations finished with error"];this._progressPane.setAttribute("aria-valuetext",k["Some operations finished with error"]);this._switchIconTo("error");break;default:this._progressPane.title=k.Operations,this._progressPane.alt=k.Operations,this._progressPane.hasAttribute("aria-valuetext")&&
this._progressPane.removeAttribute("aria-valuetext"),this._switchIconTo("progressPane_empty")}}this._operationsDialog.setOperations(d,a)},_isEmpty:function(b){for(var a in b)return!1;return!0}};l.prototype.constructor=l;b.prototype={init:function(b){this._progressMonitorClass||(this._progressMonitorTool=new l(b,this._commandRegistry))},progress:function(b,a,d){var c=this,e=this._operationsIndex++;!d&&this._progressMonitorClass&&(d=new this._progressMonitorClass,d.begin(a));b.then(function(h){c._operations[e]&&
(h=c._operations[e],a&&(h.Name=a),c._lastOperation=h,h.type="loadend",d&&(h.progressMonitor=d),c.writeOperation.bind(c)(e,h,b),h.Location||c._removeOperationFromTheList.bind(c)(e))},function(h){if(c._operations[e]){var k=c._operations[e];a&&(k.Name=a);d&&(k.progressMonitor=d);c._lastOperation=k;k.type=h.canceled?"abort":"error";k.error=h;c.writeOperation.bind(c)(e,k,b);k.Location||c._removeOperationFromTheList.bind(c)(e)}},function(h){a&&(h.Name=a);d&&(h.progressMonitor=d);c.writeOperation.bind(c)(e,
h,b)});return b},removeOperation:function(b){for(var a in this._operations)if(this._operations[a].Location&&this._operations[a].Location===b){this._removeOperationFromTheList(a);break}this._operationsClient.removeOperation.bind(this._operationsClient)(b)},_removeOperationFromTheList:function(b){var a=this._operations[b].progressMonitor;delete this._operations[b];delete this._operationDeferrds[b];a?a.done():this._progressMonitorTool.generateOperationsInfo(this._operations,this._operationDeferrds)},
removeCompletedOperations:function(){for(var b in this._operations){var a=this._operations[b];a.type&&"loadstart"!==a.type&&"progress"!==a.type&&((a=this._operations[b].progressMonitor)&&a.done(),delete this._operations[b],delete this._operationDeferrds[b])}this._progressMonitorTool.generateOperationsInfo(this._operations,this._operationDeferrds)},setProgressResult:function(b){this._serviceRegistry.getService("orion.page.message").setProgressResult(b)},showWhile:function(b,a,d){a&&this._serviceRegistry.getService("orion.page.message").setProgressMessage(a);
var c=this;b.then(function(a){c._serviceRegistry.getService("orion.page.message").setProgressMessage("")},function(a){d?c._serviceRegistry.getService("orion.page.message").setProgressMessage(""):c.setProgressResult.bind(c)(a);return a});return this.progress(b,a)},writeOperation:function(b,a,d){this._operations[b]=a;this._operationDeferrds[b]=d;a.Location&&this._serviceRegistry.getService("orion.core.preference").getPreferences("/operations").then(function(b){b.put(a.Location,{Name:a.Name,expires:a.expires})});
a.progressMonitor?a.progressMonitor.progress(a.Name):this._progressMonitorTool.generateOperationsInfo(this._operations,this._operationDeferrds)}};b.prototype.constructor=b;return{ProgressService:b}});
define("orion/operationsClient",["i18n!orion/operations/nls/messages","orion/Deferred"],function(k,m){function n(b,d,a){return b[d].apply(b,a)}function d(b){this._location=b}function h(){var b=new m;b.reject(k["No Matching OperationService for location:"]+this._location);return b}function l(b){this._services=[];this._patterns=[];this._operationListeners=[];this._currentLongpollingIds=[];this._preferenceService=b.getService("orion.core.preference");for(var f=b.getServiceReferences("orion.core.operation"),
a=0;a<f.length;a++){var g=b.getService(f[a]);this._services[a]=g;g=f[a].getProperty("pattern")||".*";"^"!==g[0]&&(g="^"+g);this._patterns[a]=RegExp(g)}this._getService=function(a){if(!a)return this._services[0];for(var b=0;b<this._patterns.length;++b)if(this._patterns[b].test(a))return this._services[b];this._operations.remove(a);return new d(a)}}d.prototype={getOperation:h,getOperations:h,removeCompletedOperations:h,removeOperation:h,cancelOperation:h};d.prototype.constructor=d;l.prototype={getOperations:function(){var b=
new m;if(this._operations)return b.resolve(this._operations),b;var d=this;this._preferenceService.getPreferences("/operations").then(function(a){d._operations=a;b.resolve(d._operations)});return b},getOperation:function(b){return n(this._getService(b),"getOperation",arguments)},removeCompletedOperations:function(){for(var b=[],d=this,a=0;a<this._services.length;a++){var g=this._patterns[a],c=new m;b[a]=c.promise;n(this._services[a],"removeCompletedOperations").then(function(a){return function(b){Array.isArray(b)&&
d.getOperations.bind(d)().then(function(c){for(var d=c.keys(),f=0;f<d.length;f++){var h=d[f];g.test(h)&&0>b.indexOf(h)&&c.remove(h)}a.resolve()})}}(c),function(a){return function(b){a.reject(b)}}(c))}return m.all(b)},removeOperation:function(b){var d=this;return n(this._getService(b),"removeOperation",arguments).then(function(a){d.getOperations.bind(d)().then(function(a){a.remove(b)})},function(a){return a},function(a){return a})}};l.prototype.constructor=l;return{OperationsClient:l}});
define("built-shellPage.js","require i18n!orion/shell/nls/messages orion/browserCompatibility orion/bootstrap orion/commandRegistry orion/fileClient orion/searchClient orion/globalCommands orion/shell/Shell orion/webui/treetable shell/shellPageFileService shell/paramType-file shell/paramType-plugin shell/paramType-service orion/i18nUtil orion/extensionCommands orion/contentTypes orion/pluginregistry orion/PageUtil orion/URITemplate orion/Deferred orion/status orion/progress orion/operationsClient shell/resultWriters orion/URL-shim".split(" "),
function(k,m,n,d,h,l,b,f,a,g,c,e,p,r,q,s,w,u,y,t,v,A,z,K,D,F){function E(){var a=y.matchResourceParameters(window.location.href).resource;return 0<a.length?a:null}function x(a,b){var c=(new t(na)).expand({resource:a.Location});b?window.location.replace(c):window.location.href=c;f.setPageTarget({task:m.Shell,serviceRegistry:N,commandService:P,target:a})}function C(a){var b=s.getOpenWithCommand(P,a);return b?b.hrefCallback({items:a}):null}function I(a){var b=document.createElement("a");if(a.Directory)return b.href=
"#"+a.Location,b.className="shellPageDirectory",b.textContent=a.Name,b;b.href=C(a);b.target="_blank";b.textContent=a.Name;return b}function B(a,b){var c=document.createElement("span");c.appendChild(document.createTextNode(b?m["Initial directory: "]:m["Changed to: "]));var d=document.createElement("b");d.appendChild(document.createTextNode(a));c.appendChild(d);return c}function G(a,b){var c=a.directory.value[0];H.setCurrentDirectory(c);la=!0;x(c,!1);c=H.computePathString(c);return B(c,!1)}function J(a){a=
C(a.file.getValue()[0]);window.open(a)}function M(a,b){var c=b.createPromise(),d=H.getCurrentDirectory(),d=d?d.Location:E()||ja;H.loadWorkspace(d).then(function(a){H.setCurrentDirectory(a);H.withChildren(a,function(a){for(var b=document.createElement("div"),d=0;d<a.length;d++)b.appendChild(I(a[d])),b.appendChild(document.createElement("br"));c.resolve(b);setTimeout(function(){for(var a=Q.querySelectorAll(".shellPageDirectory"),b=0;b<a.length;b++)a[b].setAttribute("target","_self"),a[b].className=
""},1)},function(a){ka(c,a)})},function(a){ka(c,a)});return c}function X(a,b){var c=b.createPromise(),d=H.getCurrentDirectory();H.loadWorkspace(d.Location).then(function(a){a=H.computePathString(a);var b=document.createElement("b");b.appendChild(document.createTextNode(a));c.resolve(b)},function(a){ka(c,a)});return c}function L(a,b){var c=document.createElement("div");a.plugin.getServiceReferences().forEach(function(a){var b={values:[]};a.getPropertyKeys().forEach(function(c){"service.names"===c&&
(b.name=a.getProperty(c).join());"id"===c&&(b.id=a.getProperty(c));b.values.push({name:c,value:a.getProperty(c)})});if(b.name){b.elementId="serviceElement"+ia++;b.values.forEach(function(a){a.elementId="serviceElement"+ia++});var d=document.createElement("div");c.appendChild(d);var e=new qa,d=new g.TableTree({model:new pa(b),showRoot:!0,parent:d,renderer:e});e.tableTree=d}});return c}function ca(a,b){for(var c=ha.getPlugins(),d=document.createElement("table"),e=0;e<c.length;e++){var f=document.createElement("tr");
d.appendChild(f);var g=document.createElement("td");f.appendChild(g);f=document.createElement("b");g.appendChild(f);f.textContent=c[e].name;f=c[e].getState();"active"!==f&&"starting"!==f&&(f=document.createElement("span"),g.appendChild(f),f.textContent=" ("+m.disabled+")")}return d}function Z(a,b){var c=b.createPromise();a.plugin.stop().then(function(){c.resolve(m.Succeeded)},function(a){c.resolve(a)});return c}function T(a,b){var c=b.createPromise();a.plugin.start({lazy:!0}).then(function(){c.resolve(m.Succeeded)},
function(a){c.resolve(a)});return c}function U(a,b){var c=a.url.trim();if(/^\S+$/.test(c)){if(ba.getPlugin(c))return m["Plug-in is already installed"];var d=b.createPromise();ba.installPlugin(c).then(function(a){a.start({lazy:!0}).then(function(){fa.getPreferences("/plugins").then(function(a){a.put(c,!0)});d.resolve(m.Succeeded)},function(a){d.resolve(a)})},function(a){d.resolve(a)});return d}return m["Invalid plug-in URL"]}function W(a,b){var c=b.createPromise();a.plugin.update().then(function(){c.resolve(m.Succeeded)},
function(a){c.resolve(a)});return c}function aa(a,b){var c=b.createPromise();if(a.plugin.isAllPlugin){if(!window.confirm(m["Are you sure you want to uninstall all contributed plug-ins?"]))return m.Aborted;a.plugin.uninstall().then(function(){fa.getPreferences("/plugins").then(function(b){for(var c=a.plugin.getPluginLocations(),d=0;d<c.length;d++)b.remove(c[d])}.bind(this));c.resolve(m.Succeeded)},function(a){c.resolve(a)})}else{var d=a.plugin.getLocation();ba.getPlugin(d).uninstall().then(function(){fa.getPreferences("/plugins").then(function(a){a.remove(d)}.bind(this));
c.resolve(m.Succeeded)},function(a){c.resolve(a)})}return c}function V(a,b){var c=a.id.trim(),d=document.createElement("div");ha.getPlugins().forEach(function(a){a.getServiceReferences().forEach(function(b){if(-1!==b.getProperty("service.names").indexOf(c)){var e={name:a.name,values:[]};b.getPropertyKeys().forEach(function(a){"id"===a&&(e.id=b.getProperty(a));e.values.push({name:a,value:b.getProperty(a)})});e.elementId="serviceElement"+ia++;e.values.forEach(function(a){a.elementId="serviceElement"+
ia++});var f=document.createElement("div");d.appendChild(f);var h=new qa,f=new g.TableTree({model:new pa(e),showRoot:!0,parent:f,renderer:h});h.tableTree=f}})});return d}function Y(a,b){"string"!==typeof a&&(a=a.xhr&&a.xhr.statusText?a.xhr.statusText:a.toString());return b.write(a)}function ga(a,b,c,d){var e,f;c?f=new D.FileBlobWriter(c,H):(e=document.createElement("div"),f=new D.ShellBlobWriter(e));c=b.getValue();b.isArray()||(c=[c]);c.forEach(function(a){f.addBlob(a)});f.write().then(function(){d?
a.progress(e):a.resolve(e)},function(b){e=e||document.createElement("div");f=new D.ShellStringWriter(e);Y(b,f).then(function(){a.reject(e)},function(b){a.reject()})})}function S(a,b,c,d){var e,f;c?f=new D.FileStringWriter(c,H):(e=document.createElement("div"),f=new D.ShellStringWriter(e));Y(b.stringify(),f).then(function(){d?a.progress(e):a.resolve(e)},function(b){e=e||document.createElement("div");f=new D.ShellStringWriter(e);Y(b,f).then(function(){a.reject(e)},function(b){a.reject()})})}function R(a,
b,c,d){var e=b.getType();"file"===e?$.processResult(a,b,c,d):"blob"===e?ga(a,b,c,d):S(a,b,c,d)}function da(a,b,c,d,e){return"function"!==typeof a.callback?void 0:function(f,g){var h=new v,k=null;e&&((k=f.output)&&(k=k.resourceExists()?k.getValue()[0]:k.getValue()),delete f.output);(function(a,b){var c=Object.keys(a);if(0===c.length)b(a);else{var d=0;c.forEach(function(e){(function(e){(function(a,b){a&&a.getPluginRepresentation?a.getPluginRepresentation().then(function(a){b(a)}):b(a)})(a[e],function(f){a[e]=
f;++d===c.length&&b(a)})})(e)})}})(f,function(e){var g=function(a){a=new oa(a,d);R(h,a,k)},l=function(a){ka(h,a)},m=function(a){if(a&&a.uriTemplate){var c=new t(a.uriTemplate);H.getCurrentDirectory();var c=c.expand({}),e=document.createElement("iframe");e.id=b;e.name=b;e.type="text/html";e.sandbox="allow-scripts allow-same-origin";e.frameborder=1;e.src=c;e.className="delegatedUI";a.width&&(e.style.width=a.width);a.height&&(e.style.height=a.height);a=document.getElementsByClassName("gcli-row-out");
var f=a[a.length-1];f.appendChild(e);window.addEventListener("message",function sa(a){a.source===e.contentWindow&&"string"===typeof a.data&&(a=JSON.parse(a.data),"orion.page.delegatedUI"===a.pageService&&a.source===b&&(window.removeEventListener("message",sa,!1),a.error?l(a.error):(f.removeChild(e),a.result?g(a.result):a.progress&&m(a.progress))))},!1)}else"function"===typeof h.progress&&(a=new oa(a,d),R(h,a,k,!0))};c.progress(a.callback(e,{cwd:E()}),"Executing command "+function(a,b){var c=a,d;for(d in b)c+=
" ",c+=b[d];return c}(b,f)).then(g,l,m)});return h}}function ea(a){return"function"!==typeof a?void 0:function(b,c,d){var e=new v;d&&(d.cwd=E());a(b,c,d).then(function(a){e.resolve(a)},function(a){e.reject(a)});return e}}var H,O,P,Q,$,la=!1,ma,N,ba,ha,fa,ia=0,ja=(new URL(k.toUrl("file"),window.location.href)).pathname,na=k.toUrl("shell/shellPage.html")+"#{,resource}",oa=function(){function a(b,c){this.value=b;this.array=!1;0===c.indexOf("[")&&c.lastIndexOf("]")===c.length-1&&(this.array=!0,c=c.substring(1,
c.length-1));this.type=c}a.prototype={getType:function(){return this.type},getValue:function(){return this.value},isArray:function(){return this.array},stringify:function(){if("string"!==this.type&&"markdown"!==this.type)return"("+(this.array?"[":"")+this.value+(this.array?"]":"")+")";if(!this.array)return this.value;for(var a="",b=0;b<this.value.length;b++)a+=this.value[b],b!==this.value.length-1&&(a+="\n");return a}};return a}(),ra=function(){function a(b,c,d){this.name=b;this.parseFn=c;this.stringifyFn=
d}a.prototype={getName:function(){return this.name},parse:function(a,b,c){var d=new v;this.parseFn(a,b,c).then(function(a){d.resolve(a)},function(a){d.reject(a)});return d},stringify:function(a,b){var c=new v;if(!this.stringifyFn)return a?a.name:"";this.stringifyFn(a,b).then(function(a){c.resolve(a)},function(a){c.reject(a)});return c}};return a}(),pa=function(){function a(b){this.root=b}a.prototype={getRoot:function(a){a(this.root)},getChildren:function(a,b){b(a.values)},getId:function(a){return a.elementId}};
return a}(),qa=function(){function a(){}a.prototype={getTwistieElementId:function(a){return a+"__expand"},initTable:function(a){},labelColumnIndex:function(){return 0},render:function(a,b){b.className+=" treeTableRow";var c=document.createElement("td");b.appendChild(c);if(a.value)c=document.createElement("td"),b.appendChild(c),c.textContent=a.name,c=document.createElement("td"),b.appendChild(c),c.textContent=a.value;else{var d=document.createElement("span");c.appendChild(d);c=document.createElement("span");
c.id=this.getTwistieElementId(b.id);d.appendChild(c);c.className="modelDecorationSprite core-sprite-closedarrow";c.onclick=function(a){this.tableTree.toggle(b.id)}.bind(this);c=document.createElement("td");b.appendChild(c);d=document.createElement("b");c.appendChild(d);d.textContent=a.name;a.id&&(d=document.createElement("span"),c.appendChild(d),d.textContent=" ("+a.id+")");c.colSpan="2"}},updateExpandVisuals:function(a,b){var c=document.getElementById(this.getTwistieElementId(a.id));if(c){var d=
c.className;b?d=(d+" core-sprite-openarrow").replace(/\s?core-sprite-closedarrow/g,""):(d+=" core-sprite-closedarrow",d=d.replace(/\s?core-sprite-openarrow/g,""));c.className=d}}};return a}(),ka=function(a,b){var c=b;try{c=JSON.parse(b.responseText)}catch(d){}c&&c.DetailedMessage?c=q.formatMessage(m["Error: ${0}"],c.DetailedMessage):c&&c.Message?c=q.formatMessage(m["Error: ${0}"],c.Message):"string"===typeof b.url&&(c=0===b.status?q.formatMessage(m.NoResponseFromServer,b.url):q.formatMessage(m.ServerError,
b.url,b.status,b.statusText));var e=document.createElement("span");e.textContent=c;a.reject(e)};d.startup().then(function(d){ba=d.pluginRegistry;N=d.serviceRegistry;fa=d.preferences;P=new h.CommandRegistry({});O=new l.FileClient(N);d=new b.Searcher({serviceRegistry:N,commandService:P,fileService:O});var g=new K.OperationsClient(N);new A.StatusReportingService(N,g,"statusPane","notifications","notificationArea");new z.ProgressService(N,g,P);f.generateBanner("orion-shellPage",N,P,fa,d);f.setPageTarget({task:m.Shell,
serviceRegistry:N,commandService:P});Q=document.getElementById("shell-output");d=document.getElementById("shell-input");var k=new a.Shell({input:d,output:Q});Q.onmousedown=function(a){Q.onmouseup=null;0===a.button&&"DIV"===a.target.tagName.toUpperCase()&&(Q.onmouseup=function(b){Q.onmouseup=null;b.target===a.target&&2>=Math.abs(b.clientX-a.clientX)&&2>=Math.abs(b.clientY-a.clientY)&&k.setFocusToInput()})};var n=y.matchResourceParameters(window.location.href);n.command&&(k.setInputText(n.command),
delete n.command,d=(new t(na)).expand(n),window.location.href=d);k.setFocusToInput();H=new c.ShellPageFileService;(function(a,b){var c=function(a){x(a,b);H.setCurrentDirectory(a);a=H.computePathString(a);k.output(B(a,!0))};a?H.loadWorkspace(a).then(c,function(a){H.loadWorkspace(ja).then(c)}):H.loadWorkspace(ja).then(c)})(E(),!0);$=new e.ParamTypeFile(H);k.registerType($);ha=new p.ParamTypePlugin(ba);k.registerType(ha);d=new r.ParamTypeService(ba);k.registerType(d);k.registerCommand({name:"cd",description:m["Changes the current directory"],
callback:G,parameters:[{name:"directory",type:{name:"file",directory:!0,exist:!0},description:m["The name of the directory"]}],returnType:"html"});k.registerCommand({name:"edit",description:m["Edits a file"],callback:J,parameters:[{name:"file",type:{name:"file",file:!0,exist:!0},description:m["The name of the file"]}]});k.registerCommand({name:"ls",description:m["Lists the files in the current directory"],callback:M,returnType:"html"});k.registerCommand({name:"pwd",description:m["Prints the current directory location"],
callback:X,returnType:"html"});k.registerCommand({name:"clear",description:m["Clears the shell screen"],callback:function(a,b){k.clear()}});k.registerCommand({name:"plugins",description:m["Commands for working with plug-ins"]});k.registerCommand({name:"plugins list",description:m["Lists all registered plug-ins"],callback:ca,returnType:"html"});k.registerCommand({name:"plugins install",description:m["Installs a plug-in from a URL"],callback:U,parameters:[{name:"url",type:"string",description:m["The plug-in URL"]}],
returnType:"string"});k.registerCommand({name:"plugins uninstall",description:m["Uninstalls a contributed plug-in from the configuration"],callback:aa,parameters:[{name:"plugin",type:{name:"plugin",multiple:!0,excludeDefaultPlugins:!0},description:m["The name of the contributed plug-in"]}],returnType:"string"});k.registerCommand({name:"plugins reload",description:m["Reloads a plug-in"],callback:W,parameters:[{name:"plugin",type:{name:"plugin",multiple:!0,excludeDefaultPlugins:!1},description:m["The name of the plug-in"]}],
returnType:"string"});k.registerCommand({name:"plugins enable",description:m["Enables a contributed plug-in"],callback:T,parameters:[{name:"plugin",type:{name:"plugin",multiple:!0,excludeDefaultPlugins:!0},description:m["The name of the contributed plug-in"]}],returnType:"string"});k.registerCommand({name:"plugins disable",description:m["Disables a contributed plug-in"],callback:Z,parameters:[{name:"plugin",type:{name:"plugin",multiple:!0,excludeDefaultPlugins:!0},description:m["The name of the contributed plug-in"]}],
returnType:"string"});k.registerCommand({name:"plugins services",description:m["Displays a plug-in's services"],callback:L,parameters:[{name:"plugin",type:{name:"plugin",multiple:!1,excludeDefaultPlugins:!1},description:m["The name of the plug-in"]}],returnType:"html"});k.registerCommand({name:"service",description:m["Commands for working with a service"]});k.registerCommand({name:"service contributors",description:m["Displays all plug-in contributions for a service"],callback:V,parameters:[{name:"id",
type:"service",description:m["The service identifier"]}],returnType:"html"});ma=new w.ContentTypeRegistry(N);s.createOpenWithCommands(N,ma,P);d=N.getServiceReferences("orion.shell.type");for(g=0;g<d.length;++g){var u=d[g],v=N.getService(u);v&&(u=new ra(u.getProperty("name"),ea(v.parse),ea(v.stringify)),k.registerType(u))}d=N.getServiceReferences("orion.shell.command");for(var C=N.getService("orion.page.progress"),g=0;g<d.length;++g)if(u=d[g],v=N.getService(u)){for(var n=u.getProperty("parameters")||
[],D,F=0;F<n.length;F++)if("output"===n[F].name){D=!0;break}D||n.push({name:"output",type:{name:"file",file:!0,directory:!0},description:m["The file or directory to re-direct output to"],defaultValue:null});var I=u.getProperty("returnType")||"string";u.getProperty("nls")&&u.getProperty("descriptionKey")?q.getMessageBundle(u.getProperty("nls")).then(function(a,b){var c=a.getProperty("name");k.registerCommand({name:c,description:b[a.getProperty("descriptionKey")],callback:da(v,c,C,I,!D),returnType:"html",
parameters:n,manual:b[a.getProperty("manual")]})},u):(F=u.getProperty("name"),k.registerCommand({name:F,description:u.getProperty("description"),callback:da(v,F,C,I,!D),returnType:"html",parameters:n,manual:u.getProperty("manual")}))}window.addEventListener("hashchange",function(){if(la)la=!1;else{var a=y.hash().substring(1);0===a.length&&(a=ja);H.loadWorkspace(a).then(function(a){if(H.getCurrentDirectory().Location!==a.Location){H.setCurrentDirectory(a);var b=H.computePathString(a);k.output(B(b,
!1));x(a,!1)}},function(a){x(H.getCurrentDirectory(),!0)})}})})});
//@ sourceMappingURL=built-shellPage.js.map