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