/*

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors:
     IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors:
     IBM Corporation - initial API and implementation

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

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

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

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

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

 Contributors:
     IBM Corporation - initial API and implementation

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

 Contributors:
     IBM Corporation - initial API and implementation
*/
(function(d,b){"function"===typeof define&&define.amd?define("orion/Deferred",b):"object"===typeof exports?module.exports=b():(d.orion=d.orion||{},d.orion.Deferred=b())})(this,function(){function d(){for(var a;a=f.shift();)a();h=!1}function b(b){f.push(b);h||(h=!0,a())}function m(a){return function(e){a(e)}}function c(){function a(){for(var e;e=q.shift();){var b=e.deferred,c="fulfilled"===k?"resolve":"reject";e=e[c];if("function"===typeof e)try{var g=e(d),t=g&&("object"===typeof g||"function"===typeof g)&&
g.then;if("function"===typeof t)if(g===b.promise)b.reject(new TypeError);else{var u=g.cancel;"function"===typeof u?b._parentCancel=u.bind(g):delete b._parentCancel;t.call(g,m(b.resolve),m(b.reject),m(b.progress))}else b.resolve(g)}catch(f){b.reject(f)}else b[c](d)}}function e(e){delete p._parentCancel;k="rejected";d=e;q.length&&b(a)}function v(s){function f(a){return function(e){(!k||"assumed"===k)&&a(e)}}delete p._parentCancel;try{var h=s&&("object"===typeof s||"function"===typeof s)&&s.then;if("function"===
typeof h)if(s===p)e(new TypeError);else{k="assumed";var m=s&&s.cancel;if("function"!==typeof m){var t=new c;s=t.promise;try{h(t.resolve,t.reject,t.progress)}catch(u){t.reject(u)}m=s.cancel;h=s.then}d=s;h.call(s,f(v),f(e));p._parentCancel=m.bind(s)}else k="fulfilled",d=s,q.length&&b(a)}catch(z){f(e)(z)}}function f(){var a=p._parentCancel;a?(delete p._parentCancel,a()):k||(a=Error("Cancel"),a.name="Cancel",e(a))}var d,k,q=[],p=this;this.resolve=function(a){k||v(a);return p};this.reject=function(a){k||
e(a);return p};this.progress=function(a){k||q.forEach(function(e){if(e.progress)try{e.progress(a)}catch(b){}});return p.promise};this.cancel=function(){p._parentCancel?setTimeout(f,0):f();return p};this.then=function(e,f,d){var v=new c;v._parentCancel=p.promise.cancel;q.push({resolve:e,reject:f,progress:d,deferred:v});("fulfilled"===k||"rejected"===k)&&b(a);return v.promise};this.promise={then:p.then,cancel:p.cancel}}var f=[],h=!1,a=function(){if("undefined"!==typeof process&&"function"===typeof process.nextTick){var a=
process.nextTick;return function(){a(d)}}if("function"===typeof MutationObserver){var e=document.createElement("div");(new MutationObserver(d)).observe(e,{attributes:!0});return function(){e.setAttribute("class","_tick")}}return function(){setTimeout(d,0)}}();c.all=function(a,e){function b(a,e){q||(k[a]=e,0===--d&&p.resolve(k))}function f(a,c){if(!q){if(e)try{b(a,e(c));return}catch(g){c=g}p.reject(c)}}var d=a.length,k=[],q=!1,p=new c;p.then(void 0,function(){q=!0;a.forEach(function(a){a.cancel&&a.cancel()})});
0===d?p.resolve(k):a.forEach(function(a,e){a.then(b.bind(void 0,e),f.bind(void 0,e))});return p.promise};c.when=function(a,e,b,f){var d;a&&"function"===typeof a.then||(d=new c,d.resolve(a),a=d.promise);return a.then(e,b,f)};return c});
(function(d,b){"function"===typeof define&&define.amd?define("orion/plugin",["orion/Deferred"],b):"object"===typeof exports?module.exports=b(require("orion/Deferred")):(d.orion=d.orion||{},d.orion.PluginProvider=b(d.orion.Deferred))})(this,function(d){function b(b,c){this.__objectId=b;this.__methods=c}return function(m){function c(a){q&&("undefined"===typeof ArrayBuffer&&(a=JSON.stringify(a)),q===self?q.postMessage(a):q.postMessage(a,"*"))}function f(){var a=[];Object.keys(u).forEach(function(e){var b=
u[e];a.push({serviceId:e,names:b.names,methods:b.methods,properties:b.properties})});return{headers:r||{},services:a}}function h(a,e){if(e&&e instanceof XMLHttpRequest){var b,c;try{b=e.status,c=e.statusText}catch(l){b=0,c=""}return{status:b||0,statusText:c}}return e}function a(a){var e=a?JSON.parse(JSON.stringify(a,h)):a;a instanceof Error&&(e.__isError=!0,e.message=e.message||a.message,e.name=e.name||a.name);return e}function g(a){if(!q)return(new d).reject(Error("plugin not connected"));a.id=String(p++);
var e=new d;x[a.id]=e;e.then(null,function(e){k&&(e instanceof Error&&"Cancel"===e.name)&&z({requestId:a.id,method:"cancel",params:e.message?[e.message]:[]})});var c=Object.prototype.toString;a.params.forEach(function(u,l){if("[object Object]"===c.call(u)&&!(u instanceof b)){var n,g;for(n in u)"[object Function]"===c.call(u[n])&&(g=g||[],g.push(n));if(g){var k=s++;t[k]=u;n=function(){delete t[k]};e.then(n,n);a.params[l]=new b(k,g)}}});z(a);return e.promise}function e(a,e){a||0===a?z({id:a,result:null,
error:e}):console.log(e)}function v(e,b,c,t){t.forEach(function(a,l){if(a&&"undefined"!==typeof a.__objectId){var e={};a.__methods.forEach(function(l){e[l]=function(){return g({objectId:a.__objectId,method:l,params:Array.prototype.slice.call(arguments)})}});t[l]=e}});var l=void 0===typeof e?null:{id:e,result:null,error:null};try{var n=c.apply(b,t);l&&(n&&"function"===typeof n.then?(w[e]=n,n.then(function(a){delete w[e];l.result=a;z(l)},function(b){w[e]&&(delete w[e],l.error=a(b),z(l))},function(){z({responseId:e,
method:"progress",params:Array.prototype.slice.call(arguments)})})):(l.result=n,z(l)))}catch(u){l&&(l.error=a(u),z(l))}}function y(a){if(!(a.source!==q&&"undefined"!==typeof window)){a="string"!==typeof a.data?a.data:JSON.parse(a.data);try{if(a.method){var b=a.method,c=a.params||[];if("serviceId"in a){var g=u[a.serviceId];g||e(a.id,"service not found");g=g.implementation;b in g?v(a.id,g,g[b],c):e(a.id,"method not found")}else if("objectId"in a){var l=t[a.objectId];l||e(a.id,"object not found");!b in
l?v(a.id,l,l[b],c):e(a.id,"method not found")}else if("requestId"in a){var n=w[a.requestId];n&&("cancel"===b&&n.cancel)&&n.cancel.apply(n,c)}else if("responseId"in a){var k=x[a.responseId];k&&("progress"===b&&k.progress)&&k.progress.apply(k,c)}else throw Error("Bad method: "+a.method);}else{var f=x[String(a.id)];delete x[String(a.id)];a.error?f.reject(a.error):f.resolve(a.result)}}catch(d){console.log("Plugin._messageHandler "+d)}}}var r=m,k=!1,q=null,p=0,s=0,B=0,w={},x={},t={},u={},z=c;this.updateHeaders=
function(a){if(k)throw Error("Cannot update headers. Plugin Provider is connected");r=a};this.registerServiceProvider=this.registerService=function(a,e,b){if(k)throw Error("Cannot register service. Plugin Provider is connected");"string"===typeof a?a=[a]:Array.isArray(a)||(a=[]);var c=null,l=[];for(c in e)"function"===typeof e[c]&&l.push(c);u[B++]={names:a,methods:l,implementation:e,properties:b||{},listeners:{}}};this.connect=function(a,e){if(!k){if("undefined"===typeof window)q=self;else if(window!==
window.parent)q=window.parent;else if(null!==window.opener)q=window.opener;else{e&&e("No valid plugin target");return}addEventListener("message",y,!1);var b={method:"plugin",params:[f()]};c(b);k=!0}a&&a()};this.disconnect=function(){k&&(removeEventListener("message",y),q=null,k=!1)}}});
define("orion/util",[],function(){var d=navigator.userAgent,b=-1!==d.indexOf("MSIE")||-1!==d.indexOf("Trident")?document.documentMode:void 0,m=parseFloat(d.split("Firefox/")[1]||d.split("Minefield/")[1])||void 0,c=-1!==d.indexOf("Opera")?parseFloat(d.split("Version/")[1]):void 0,f=parseFloat(d.split("Chrome/")[1])||void 0,h=-1!==d.indexOf("Safari")&&!f,a=parseFloat(d.split("WebKit/")[1])||void 0,g=-1!==d.indexOf("Android"),e=-1!==d.indexOf("iPad"),d=-1!==d.indexOf("iPhone"),v=e||d,y=-1!==navigator.platform.indexOf("Mac"),
r=-1!==navigator.platform.indexOf("Win"),k=-1!==navigator.platform.indexOf("Linux"),q="undefined"!==typeof document&&"ontouchstart"in document.createElement("input");return{formatMessage:function(a){var e=arguments;return a.replace(/\$\{([^\}]+)\}/g,function(a,b){return e[(b<<0)+1]})},createElement:function(a,e){return a.createElementNS?a.createElementNS("http://www.w3.org/1999/xhtml",e):a.createElement(e)},isIE:b,isFirefox:m,isOpera:c,isChrome:f,isSafari:h,isWebkit:a,isAndroid:g,isIPad:e,isIPhone:d,
isIOS:v,isMac:y,isWindows:r,isLinux:k,isTouch:q,platformDelimiter:r?"\r\n":"\n"}});
define("orion/webui/littlelib",["orion/util"],function(d){function b(a,b){b||(b=document);return b.querySelectorAll(a)}function m(a){var b=a.tabIndex;0===b&&d.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&&(b=-1);return b}function c(a){if(0<=m(a))return a;if(a.hasChildNodes())for(var b=0;b<a.childNodes.length;b++){var g=c(a.childNodes[b]);if(g)return g}return null}function f(a){if(0<=
m(a))return a;if(a.hasChildNodes())for(var b=a.childNodes.length-1;0<=b;b--){var c=f(a.childNodes[b]);if(c)return c}return null}function h(e,b){if(3===e.nodeType){var c=a.exec(e.nodeValue);c&&1<c.length&&b(e,c)}if(e.hasChildNodes())for(c=0;c<e.childNodes.length;c++)h(e.childNodes[c],b)}var a=/\$\{([^\}]+)\}/,g=null;return{$:function(a,b){b||(b=document);return b.querySelector(a)},$$:b,$$array:function(a,c){return Array.prototype.slice.call(b(a,c))},node:function(a){var b=a;"string"===typeof a&&(b=
document.getElementById(a));return b},contains:function(a,b){if(!a||!b)return!1;if(a===b)return!0;var c=a.compareDocumentPosition(b);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:c,lastTabbable:f,stop:function(a){window.document.all&&(a.keyCode=0);a.preventDefault&&
(a.preventDefault(),a.stopPropagation())},processTextNodes:function(a,b){h(a,function(a,e){a.parentNode.replaceChild(document.createTextNode(b[e[1]]||e[1]),a)})},processDOMNodes:function(a,b){h(a,function(a,e){var c=b[e[1]];if(c){var g=document.createRange(),f=e.index;g.setStart(a,f);g.setEnd(a,f+e[0].length);g.deleteContents();g.insertNode(c)}})},addAutoDismiss:function(a,b){function c(a){g.forEach(function(b){var e=!1,c=b.excludeNodes.some(function(b){return document.body.contains(b)?(e=!0,b.contains(a.target)):
!1});if(e&&!c)try{b.dismiss(a)}catch(g){"undefined"!==typeof console&&console&&console.error(g&&g.message)}});g=g.filter(function(a){return a.excludeNodes.some(function(a){return document.body.contains(a)})})}null===g&&(g=[],document.addEventListener("click",c,!0),d.isIOS&&document.addEventListener("touchend",function(a){function b(){a.target.removeEventListener("click",b)}0===a.touches.length&&a.target.addEventListener("click",b)},!1));g.push({excludeNodes:a,dismiss:b})},setFramesEnabled:function(a){for(var b=
document.getElementsByTagName("iframe"),c=0;c<b.length;c++)b[c].parentNode.style.pointerEvents=a?"":"none"},removeAutoDismiss:function(a){g=g.filter(function(b){return a!==b.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/EventTarget",[],function(){function d(){this._namedListeners={}}d.prototype={dispatchEvent:function(b){if(!b.type)throw Error("unspecified type");var d=this._namedListeners[b.type];d&&d.forEach(function(c){try{"function"===typeof c?c(b):c.handleEvent(b)}catch(f){"undefined"!==typeof console&&console.log(f)}});return!b.defaultPrevented},addEventListener:function(b,d){if("function"===typeof d||d.handleEvent)this._namedListeners[b]=this._namedListeners[b]||[],this._namedListeners[b].push(d)},
removeEventListener:function(b,d){var c=this._namedListeners[b];if(c)for(var f=0;f<c.length;f++)if(c[f]===d){1===c.length?delete this._namedListeners[b]:c.splice(f,1);break}}};d.prototype.constructor=d;d.attach=function(b){var m=new d;b.dispatchEvent=m.dispatchEvent.bind(m);b.addEventListener=m.addEventListener.bind(m);b.removeEventListener=m.removeEventListener.bind(m)};return d});
define("orion/webui/dropdown",["require","orion/webui/littlelib","orion/EventTarget"],function(d,b,m){function c(a){m.attach(this);this._init(a)}function f(a,b){var c=document.createElement(void 0===b?"span":b);c.tabIndex=0;c.className="dropdownMenuItem";c.role="menuitem";var d=document.createElement("span");d.appendChild(document.createTextNode(a));d.classList.add("dropdownCommandName");c.appendChild(d);d=document.createElement("li");d.appendChild(c);return d}function h(){var a=document.createElement("li");
a.classList.add("dropdownSeparator");return a}c.prototype={_init:function(a){this._dropdownNode=b.node(a.dropdown);if(!this._dropdownNode)throw"no dom node for dropdown found";this._populate=a.populate;this._selectionClass=a.selectionClass;this._parentDropdown=a.parentDropdown;this._positioningNode=a.positioningNode;if(!this._parentDropdown)for(var 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=a.triggerNode?a.triggerNode:b.$(".dropdownTrigger",this._dropdownNode.parentNode);if(!this._triggerNode)throw"no dom node for dropdown trigger found";if(!a.skipTriggerEventListeners){var e=this;this._triggerNode.addEventListener("click",function(a){e.toggle(a)&&b.stop(a)},!1);"span"===this._triggerNode.tagName.toLowerCase()&&this._triggerNode.addEventListener("keydown",function(a){if(a.keyCode===b.KEY.ENTER||a.keyCode===b.KEY.SPACE)e.toggle(),b.stop(a)},!1)}this._dropdownNode.addEventListener("keydown",
this._dropdownKeyDown.bind(this),!1)},addTriggerNode:function(a){var c=this;a.addEventListener("click",function(a){c.toggle(a)&&b.stop(a)},!1)},toggle:function(a){return this.isVisible()?this.close():this.open(a)},isVisible:function(){return this._isVisible},open:function(a){var c=!1;this.isVisible()||(this.dispatchEvent({type:"triggered",dropdown:this,event:a}),b.setFramesEnabled(!1),this._populate&&(this.empty(),this._populate(this._dropdownNode)),0<this.getItems().length&&(this._hookedAutoDismiss||
(this._boundAutoDismiss?b.removeAutoDismiss(this._boundAutoDismiss):this._boundAutoDismiss=this._autoDismiss.bind(this),c=b.$$array(".dropdownSubMenu",this._dropdownNode),b.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(a),this._focusDropdownNode(),
c=!0,this._parentDropdown&&this._parentDropdown.submenuOpen(this)));return c},_focusDropdownNode:function(){this._dropdownNode.focus()},_autoDismiss:function(a){if(this.close(!1)&&this._dropdownNode.contains(a.target))for(a=this._parentDropdown;a;)a.close(!1),a=a._parentDropdown},_positionDropdown:function(a){this._dropdownNode.style.left="";this._dropdownNode.style.top="";if(this._positioningNode)this._dropdownNode.style.left=this._positioningNode.offsetLeft+"px";else{a=b.bounds(this._dropdownNode);
var c=b.bounds(document.body);if(a.left+a.width>c.left+c.width)if(this._triggerNode.classList.contains("dropdownMenuItem"))this._dropdownNode.style.left=-a.width+"px";else{var e=b.bounds(this._boundingNode(this._triggerNode)),d=b.bounds(this._triggerNode);this._dropdownNode.style.left=d.left-e.left-a.width+d.width+"px"}a=a.top+a.height-(c.top+c.height);0<a&&(this._dropdownNode.style.top=Math.floor(this._dropdownNode.style.top-a)+"px")}},_boundingNode:function(a){var b=window.getComputedStyle(a,null);
return null===b||"absolute"===b.getPropertyValue("position")||!a.parentNode||a===document.body?a:this._boundingNode(a.parentNode)},close:function(a){var c=!1;this.isVisible()&&(this._triggerNode.classList.remove("dropdownTriggerOpen"),this._selectionClass&&this._triggerNode.classList.remove(this._selectionClass),this._dropdownNode.classList.remove("dropdownMenuOpen"),b.setFramesEnabled(!0),a&&this._triggerNode.focus(),this._isVisible=!1,this._selectedItem&&(this._selectedItem.classList.remove("dropdownMenuItemSelected"),
this._selectedItem=null),c=!0);return c},getItems:function(){var a=[],c=this;b.$$array("li:not(.dropdownSeparator) \x3e .dropdownMenuItem",this._dropdownNode,!0).forEach(function(b){b.parentNode.parentNode===c._dropdownNode&&a.push(b)});a.forEach(function(a){a._hasDropdownMouseover||(a.addEventListener("mouseover",function(d){a.dropdown?a.dropdown.open(d):(c._closeSelectedSubmenu(),b.stop(d));c._selectItem(a)}),a._hasDropdownMouseover=!0)});return a},empty:function(){var a=this;b.$$array("li",this._dropdownNode).forEach(function(b){b.parentNode===
a._dropdownNode&&b.parentNode.removeChild(b)});this._hookedAutoDismiss=!1},_dropdownKeyDown:function(a){if(a.keyCode===b.KEY.UP||a.keyCode===b.KEY.DOWN||a.keyCode===b.KEY.RIGHT||a.keyCode===b.KEY.ENTER||a.keyCode===b.KEY.LEFT){var c=this.getItems();if(c.length&&0<c.length){if(this._selectedItem){var e=c.indexOf(this._selectedItem);0>e&&(e=c.indexOf(this._selectedItem.parentNode));0<=e&&(a.keyCode===b.KEY.UP&&0<e?(e--,this._selectItem(c[e])):a.keyCode===b.KEY.DOWN&&e<c.length-1?(e++,this._selectItem(c[e])):
a.keyCode===b.KEY.ENTER||a.keyCode===b.KEY.RIGHT?this._selectedItem.classList.contains("dropdownTrigger")&&this._selectedItem.dropdown?(this._selectedItem.dropdown.open(),this._selectedItem.dropdown._selectItem()):a.keyCode===b.KEY.ENTER&&this._selectedItem.click():a.keyCode===b.KEY.LEFT&&this._selectedItem.parentNode.parentNode.classList.contains("dropdownMenuOpen")&&(this.close(!0),this._parentDropdown&&this._parentDropdown._dropdownNode.focus()))}else this._selectItem(c[0]);b.stop(a)}}else a.keyCode===
b.KEY.ESCAPE&&(this.close(!0),b.stop(a))},_selectItem:function(a){if(a=a||this.getItems()[0])this._selectedItem&&this._selectedItem.classList.remove("dropdownMenuItemSelected"),this._selectedItem=a,this._selectedItem.classList.add("dropdownMenuItemSelected");document.activeElement!==this._dropdownNode&&this._dropdownNode.focus()},submenuOpen:function(a){a!==this._selectedSubmenu&&(this._closeSelectedSubmenu(),this._selectedSubmenu=a)},_closeSelectedSubmenu:function(){for(var a=this._selectedSubmenu;a;)a.close(),
a=a._selectedSubmenu},destroy:function(){this.empty();this._boundAutoDismiss&&b.removeAutoDismiss(this._boundAutoDismiss)},appendMenuItem:function(a,b){var c=f(a,b);this._dropdownNode.appendChild(c);return c},appendSeparator:function(){var a=h();this._dropdownNode.appendChild(a);return a}};c.prototype.constructor=c;return{Dropdown:c,appendKeyBindingString:function(a,b){var c=document.createElement("span");c.classList.add("dropdownKeyBinding");c.appendChild(document.createTextNode(b));a.appendChild(c)},
createMenuItem:f,createSeparator:h}});
define("text",["module"],function(d){var b,m,c=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"],f=/^\s*<\?xml(\s)+version=[\'\"](\d)*.(\d)*[\'\"](\s)*\?>/im,h=/<body[^>]*>\s*([\s\S]+)\s*<\/body>/im,a="undefined"!==typeof location&&location.href,g=a&&location.protocol&&location.protocol.replace(/\:/,""),e=a&&location.hostname,v=a&&(location.port||void 0),y=[],r=d.config&&d.config()||{};b={version:"2.0.5",strip:function(a){if(a){a=a.replace(f,"");var b=a.match(h);b&&(a=b[1])}else a="";return a},
jsEscape:function(a){return a.replace(/(['\\])/g,"\\$1").replace(/[\f]/g,"\\f").replace(/[\b]/g,"\\b").replace(/[\n]/g,"\\n").replace(/[\t]/g,"\\t").replace(/[\r]/g,"\\r").replace(/[\u2028]/g,"\\u2028").replace(/[\u2029]/g,"\\u2029")},createXhr:r.createXhr||function(){var a,b,e;if("undefined"!==typeof XMLHttpRequest)return new XMLHttpRequest;if("undefined"!==typeof ActiveXObject)for(b=0;3>b;b+=1){e=c[b];try{a=new ActiveXObject(e)}catch(d){}if(a){c=[e];break}}return a},parseName:function(a){var b,
c,e=!1,d=a.indexOf(".");b=0===a.indexOf("./")||0===a.indexOf("../");-1!==d&&(!b||1<d)?(b=a.substring(0,d),c=a.substring(d+1,a.length)):b=a;a=c||b;d=a.indexOf("!");-1!==d&&(e="strip"===a.substring(d+1),a=a.substring(0,d),c?c=a:b=a);return{moduleName:b,ext:c,strip:e}},xdRegExp:/^((\w+)\:)?\/\/([^\/\\]+)/,useXhr:function(a,c,e,d){var f,g;f=b.xdRegExp.exec(a);if(!f)return!0;a=f[2];f=f[3];f=f.split(":");g=f[1];f=f[0];return(!a||a===c)&&(!f||f.toLowerCase()===e.toLowerCase())&&(!g&&!f||g===d)},finishLoad:function(a,
c,e,d){e=c?b.strip(e):e;r.isBuild&&(y[a]=e);d(e)},load:function(c,d,f,h){if(h.isBuild&&!h.inlineText)f();else{r.isBuild=h.isBuild;var m=b.parseName(c);h=m.moduleName+(m.ext?"."+m.ext:"");var w=d.toUrl(h),x=r.useXhr||b.useXhr;!a||x(w,g,e,v)?b.get(w,function(a){b.finishLoad(c,m.strip,a,f)},function(a){f.error&&f.error(a)}):d([h],function(a){b.finishLoad(m.moduleName+"."+m.ext,m.strip,a,f)})}},write:function(a,c,e,d){y.hasOwnProperty(c)&&(d=b.jsEscape(y[c]),e.asModule(a+"!"+c,"define(function () { return '"+
d+"';});\n"))},writeFile:function(a,c,e,d,f){c=b.parseName(c);var g=c.ext?"."+c.ext:"",h=c.moduleName+g,t=e.toUrl(c.moduleName+g)+".js";b.load(h,e,function(c){c=function(a){return d(t,a)};c.asModule=function(a,b){return d.asModule(a,t,b)};b.write(a,h,c,f)},f)}};if("node"===r.env||!r.env&&"undefined"!==typeof process&&process.versions&&process.versions.node)m=require.nodeRequire("fs"),b.get=function(a,b){var c=m.readFileSync(a,"utf8");0===c.indexOf("\ufeff")&&(c=c.substring(1));b(c)};else if("xhr"===
r.env||!r.env&&b.createXhr())b.get=function(a,c,e,d){var f=b.createXhr(),g;f.open("GET",a,!0);if(d)for(g in d)d.hasOwnProperty(g)&&f.setRequestHeader(g.toLowerCase(),d[g]);if(r.onXhr)r.onXhr(f,a);f.onreadystatechange=function(b){4===f.readyState&&(b=f.status,399<b&&600>b?(b=Error(a+" HTTP status: "+b),b.xhr=f,e(b)):c(f.responseText))};f.send(null)};else if("rhino"===r.env||!r.env&&"undefined"!==typeof Packages&&"undefined"!==typeof java)b.get=function(a,b){var c,e,d=new java.io.File(a),f=java.lang.System.getProperty("line.separator"),
d=new java.io.BufferedReader(new java.io.InputStreamReader(new java.io.FileInputStream(d),"utf-8")),g="";try{c=new java.lang.StringBuffer;(e=d.readLine())&&(e.length()&&65279===e.charAt(0))&&(e=e.substring(1));for(null!==e&&c.append(e);null!==(e=d.readLine());)c.append(f),c.append(e);g=String(c.toString())}finally{d.close()}b(g)};return b});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(d,b){function m(b){this._init(b)}m.prototype={_init:function(c){this._node=b.node(c.node);if(!this._node)throw"no dom node for tooltip found";this._position=c.position||["right","above","below","left"];this._text=c.text;this._hideDelay=void 0===c.hideDelay?200:c.hideDelay;this._tailSize=c.tailSize||10;this._trigger=c.trigger||"mouseover";this._afterShowing=c.afterShowing;this._afterHiding=c.afterHiding;var d=this;if("click"===
this._trigger)this._showDelay=0,this._node.addEventListener("click",this._clickHandler=function(a){a.target===d._node&&(d.show(),b.stop(a))},!1);else if("mouseover"===this._trigger){this._showDelay=void 0===c.showDelay?500:c.showDelay;c=["mouseout","click"];this._node.addEventListener("mouseover",this._mouseoverHandler=function(a){b.contains(d._node,a.target)&&(d.show(),b.stop(a))},!1);this._leaveHandler=function(a){b.contains(d._node,a.target)&&d.hide()};for(var h=0;h<c.length;h++)this._node.addEventListener(c[h],
this._leaveHandler,!1)}},_makeTipNode:function(){if(!this._tip){this._tip=document.createElement("span");this._tip.classList.add("tooltipContainer");this._tipInner=document.createElement("div");this._tipInner.classList.add("tooltip");if(this._text){this._tipTextContent=document.createElement("div");this._tipTextContent.classList.add("textContent");this._tipInner.appendChild(this._tipTextContent);var c=document.createTextNode(this._text);this._tipTextContent.appendChild(c)}this._tip.appendChild(this._tipInner);
document.body.appendChild(this._tip);var d=this;b.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(c){d._timeout&&(window.clearTimeout(d._timeout),d._timeout=null);d._tip.addEventListener("mouseout",function(a){b.contains(d._tip,a.target)&&(d.hide(),b.stop(a))},
!1)},!1))}return this._tip},_positionTip:function(c,d){this._makeTipNode();"left"===c?this._tipInner.classList.add("left"):this._tipInner.classList.remove("left");var h=this._node,a;for(a=b.bounds(h);h&&!a.width&&!a.height;h=h.parentNode)a=b.bounds(h);var h=b.bounds(this._tipInner),g;switch(c){case "above":g=a.top-h.height-this._tailSize-1;a=a.left-this._tailSize;break;case "below":g=a.top+a.height+this._tailSize+1;a=a.left-this._tailSize;break;case "left":g=a.top-this._tailSize/2;a=a.left-h.width-
this._tailSize-1;break;default:g=a.top-this._tailSize/2,a=a.left+a.width+this._tailSize+1}var e=b.bounds(document.documentElement);if(g+h.height>e.height)if(d)g=e.height-h.height-1;else return!1;if(a+h.width>e.width)if(d)a=e.width-h.width-1;else return!1;if(0>a)if(d)a=4;else return!1;if(0>g)if(d)g=4;else return!1;this._tail&&this._tail.previousPosition!==c&&(this._tip.removeChild(this._tail),this._tail=null);this._tail||(this._tail=document.createElement("span"),this._tail.classList.add("tooltipTailFrom"+
c),"above"===c||"left"===c?this._tip.appendChild(this._tail):this._tip.insertBefore(this._tail,this._tipInner),this._tail.previousPosition=c);this._tip.style.top=g+"px";this._tip.style.left=a+"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)}}};m.prototype.constructor=m;return{Tooltip:m}});
define("orion/commands","orion/util orion/webui/littlelib orion/webui/dropdown text!orion/webui/dropdowntriggerbutton.html text!orion/webui/dropdowntriggerbuttonwitharrow.html text!orion/webui/submenutriggerbutton.html text!orion/webui/checkedmenuitem.html orion/webui/tooltip".split(" "),function(d,b,m,c,f,h,a,g){function e(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 v(a,c){for(var d in c)if(c[d]&&(c[d].keyBinding&&c[d].command)&&c[d].keyBinding.match(a)){var f=c[d],g=f.keyBinding;if((!g.domScope||b.contains(b.node(g.domScope),a.target))&&e(f)){b.stop(a);break}}}function y(){var a={};if(w){var b,c,d;c=Object.keys(x);for(b=0;b<c.length;b++)d=c[b],a[d]=x[d];var e=w();c=Object.keys(e);for(b=0;b<c.length;b++)d=c[b],a[d]=e[d]}else a=
x;return a}function r(a){v(a,y())}function k(a,b){a=a||window.event;if(function(a){if(d.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):r(a)}function q(){this._init()}
function p(a,b,c){b.classList.add("commandImage");var d;a.imageClass?a.addImageClassToElement?b.classList.add(a.imageClass):(d=document.createElement("span"),b.appendChild(d),d.classList.add(a.spriteClass),d.classList.add(a.imageClass)):(d=new Image,d.alt=a.name,d.name=c,d.id=c,d.src=a.image,b.appendChild(d));return d}function s(a,b,c,d,e){this.commandRegistry=e;this.handler=a;this.items=b;this.userData=c;this.command=d;d.parameters&&(this.parameters=d.parameters.makeCopy());this.id=d.id}function B(a){this._init(a)}
var w=null,x={};q.prototype={setProxy:function(a){this.proxy=a},setKeyBindings:function(a){this.bindings=a},_init:function(){var a=this;document.addEventListener("keydown",function(c){return k(c,function(c){var d=a.proxy,e=a.bindings;if(e&&d)for(var f=0;f<e.length;f++)e[f].match(c)&&(d.processKey({type:c.type,keyCode:c.keyCode,altKey:c.altKey,ctrlKey:c.ctrlKey,metaKey:c.metaKey,shiftKey:c.shiftKey}),b.stop(c))})})}};window.document.addEventListener("keydown",k,!1);s.prototype={collectsParameters:function(){return this.commandRegistry&&
this.commandRegistry.collectsParameters()},makeCopy:function(a){var b=new s(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}};s.prototype.constructor=s;B.prototype={_init:function(a){this.id=a.id;this.name=a.name;this.tooltip=a.tooltip;this.callback=a.callback;this.hrefCallback=a.hrefCallback;this.choiceCallback=a.choiceCallback;
this.positioningNode=a.positioningNode;this.image=a.image||"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAAA1BMVEUAAACnej3aAAAAAXRSTlMAQObYZgAAAAtJREFUCNdjIBEAAAAwAAFletZ8AAAAAElFTkSuQmCC";this.imageClass=a.imageClass;this.addImageClassToElement=a.addImageClassToElement;this.extraClass=a.extraClass;this.selectionClass=a.selectionClass;this.spriteClass=a.spriteClass||"commandSprite";this.visibleWhen=a.visibleWhen;this.parameters=a.parameters;this.isEditor=a.isEditor},populateChoicesMenu:function(a,
c,d,e,f){d=this.getChoices(c,d,e);var g=d.some(function(a){return a.checked});d.forEach(function(d){if(d.name){var l=document.createElement("li");a.appendChild(l);var e=document.createElement("span");e.tabIndex=0;e.role="menuitem";e.classList.add("dropdownMenuItem");if(g){var h=document.createElement("span");h.classList.add("check");h.appendChild(document.createTextNode(d.checked?"\u25cf":""));e.appendChild(h)}h=document.createTextNode(d.name);e.appendChild(h);l.appendChild(e);e.choice=d;e.addEventListener("click",
function(a){a.target.choice&&a.target.choice.callback.call(a.target.choice,c)},!1);e.addEventListener("keydown",function(a){(a.keyCode===b.KEY.ENTER||a.keyCode===b.KEY.SPACE)&&a.target.choice&&a.target.choice.callback.call(a.target.choice,c)},!1)}else f._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}};B.prototype.constructor=B;return{Command:B,CommandInvocation:s,createDropdownMenu:function(a,d,e,g,h,k,D,l,n){a=b.node(a);if(!a)throw"no parent node was specified";var A=document.createRange();A.selectNode(a);A=n?A.createContextualFragment(f):A.createContextualFragment(c);b.processTextNodes(A,{ButtonText:d});a.appendChild(A);a=a.lastChild;
var E;n?(n=a.previousSibling,E=n.lastChild):n=a.previousSibling;g?n.classList.add(g):(n.classList.add("orionButton"),n.classList.add("commandButton"));h&&(k||(n.textContent="",n.setAttribute("aria-label",d)),p({spriteClass:"commandSprite",imageClass:h},n,d),n.classList.add("orionButton"));n.dropdown=new m.Dropdown({dropdown:a,populate:e,selectionClass:D,skipTriggerEventListeners:!!E,positioningNode:l});a.dropdown=n.dropdown;return{menuButton:n,menu:a,dropdown:n.dropdown,dropdownArrow:E}},createCheckedMenuItem:function(c,
d,e,f){c=b.node(c);if(!c)throw"no parent node was specified";var g=document.createRange();g.selectNode(c);g=g.createContextualFragment(a);b.processTextNodes(g,{ItemText:d});c.appendChild(g);c=b.$(".checkedMenuItem",c.lastChild);c.checked=e;c.addEventListener("change",f,!1);return c},createCommandItem:function(a,b,c,d,e,f,h){var l;f=f||!b.name&&b.hasImage();if(b.hrefCallback)l=document.createElement("a"),l.id=d,f&&b.hasImage()?p(b,l,d):(l.className="commandLink",l.appendChild(document.createTextNode(b.name))),
h=b.hrefCallback.call(c.handler,c),h.then?h.then(function(a){l.href=a}):l.href=h?h:"#";else{l=document.createElement("button");l.className="orionButton";b.extraClass&&l.classList.add(b.extraClass);f?b.hasImage()?(p(b,l,d),b.name&&l.setAttribute("aria-label",b.name)):(l.classList.add("commandButton"),l.classList.add("commandMissingImageButton"),l.appendChild(document.createTextNode(b.name))):(l.classList.add("commandButton"),d=document.createTextNode(b.name),l.appendChild(d));var n=h||b.callback;n&&
(b.onClick=n,l.addEventListener("click",function(a){n.call(c.handler,c)},!1))}"ul"===a.nodeName.toLowerCase()?(h=document.createElement("li"),a.appendChild(h),a=h):l.classList.add("commandMargins");a.appendChild(l);b.tooltip&&(l.commandTooltip=new g.Tooltip({node:l,text:b.tooltip,position:["above","below","right","left"]}));e&&(x[b.id]={keyBinding:e,command:b,invocation:c});return l},createCommandMenuItem:function(a,c,d,e,f,h){var k,l,n=a.dropdown;if(c.hrefCallback)l=m.createMenuItem(c.name,"a"),
k=l.firstElementChild,f=c.hrefCallback.call(d.handler,d),f.then?f.then(function(a){k.href=a}):k.href=f?f:"#",k.addEventListener("keydown",function(a){(a.keyCode===b.KEY.ENTER||a.keyCode===b.KEY.SPACE)&&k.click()},!1);else{l=m.createMenuItem(c.name);k=l.firstElementChild;var A=f||c.callback;A&&(c.onClick=A,k.addEventListener("click",function(a){n.close(!0);A.call(d.handler,d)},!1),k.addEventListener("keydown",function(a){if(a.keyCode===b.KEY.ENTER||a.keyCode===b.KEY.SPACE)a.preventDefault(),k.click()},
!1))}c.tooltip&&(k.commandTooltip=new g.Tooltip({node:k,text:c.tooltip,position:["above","below","right","left"]}));h&&m.appendKeyBindingString(k,h);a.appendChild(l);e&&(x[c.id]={keyBinding:e,command:c,invocation:d});return k},executeBinding:e,setKeyBindingProvider:function(a){w=a},localKeyBindings:x,CommandsProxy:q,getKeyBindings:y,processKey:r,NO_IMAGE:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAAA1BMVEUAAACnej3aAAAAAXRSTlMAQObYZgAAAAtJREFUCNdjIBEAAAAwAAFletZ8AAAAAElFTkSuQmCC",
_testMethodProcessKey:v}});
define("orion/keyBinding",["orion/util"],function(d){function b(b,d,h,a,g,e){this.type=e||"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!==h&&null!==h?h:!1;this.mod3=void 0!==a&&null!==a?a:!1;this.mod4=void 0!==g&&null!==g?g:!1}function m(b){this.keys=b}b.prototype={getKeys:function(){return[this]},match:function(b,f){if(void 0!==f){if(0!==f)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(d.isOpera?b.which:void 0!==b.charCode?b.charCode:b.keyCode)?this.mod1!==(d.isMac?b.metaKey:b.ctrlKey)||"keydown"===this.type&&this.mod2!==b.shiftKey||this.mod3!==b.altKey||d.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}};m.prototype={getKeys:function(){return this.keys.slice(0)},
match:function(b,d){var h=this.keys;if(void 0!==d)return d>h.length?!1:h[d].match(b)?d===h.length-1?!0:d+1:!1;b instanceof Array||(b=[b]);if(b.length>h.length)return!1;var a;for(a=0;a<b.length;a++)if(!h[a].match(b[a]))return!1;return a===h.length?!0:a},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:b,KeyStroke:b,KeySequence:m}});
(function(){function d(a){if("string"!==typeof a)throw new TypeError;}function b(a){return a?a.split("\x26"):[]}function m(a){return 0===a.length?"":a.join("\x26")}function c(a){var b=/([^=]*)(?:=?)(.*)/.exec(a);a=b[1]?decodeURIComponent(b[1]):"";b=b[2]?decodeURIComponent(b[2]):"";return[a,b]}function f(a){var b=encodeURIComponent(a[0]);a[1]&&(b+="\x3d"+encodeURIComponent(a[1]));return b}function h(a,d){var e="",f=[],g=0;return{next:function(){e!==a.query&&(e=a.query,f=b(e));if(g<f.length){var h=
c(f[g++]);switch(d){case "keys":return h[0];case "values":return h[1];case "keys+values":return[h[0],h[1]];default:throw new TypeError;}}throw F;}}}function a(a){Object.defineProperty(this,"_url",{get:function(){return a._url}})}function g(a){return a?/[1-9]\d*$/.exec(a)[0]:""}function e(a){var b=[];a.split("/").forEach(function(a){".."===a?b.pop():"."!==a&&b.push(a)});return b.join("/")}function v(a){return a.replace(/\s/g,function(a){return"%"+a.charCodeAt(0).toString(16)})}function y(a,b){if("string"!==
typeof a)throw new TypeError;a=v(a);var c=p.exec(a);if(!c)return null;var d={};d.scheme=c[1]||"";if(d.scheme&&!B.test(d.scheme))return null;var f=c[2];if(f&&(f=s.exec(f),d.userinfo=f[1],d.host=f[2],d.port=f[3],d.port&&!w.test(d.port)))return null;d.path=c[3];d.query=c[4];d.fragment=c[5];!d.scheme&&b&&(d.scheme=b.scheme,!d.host&&b.host&&(d.userinfo=b.userinfo,d.host=b.host,d.port=b.port,d.pathRelative=!0));d.pathRelative&&(d.path?"/"!==d.path[0]&&(c=/^(.*\/)[^\/]*$/.exec(b.path)[1]||"/",d.path=c+d.path):
d.path=b.path);d.scheme&&(d.scheme=d.scheme.toLowerCase());d.port&&(d.port=g(d.port));d.host&&d.path&&(d.path=e(d.path));return d}function r(b,d){var c;if(d){d=d.href||d;c=y(d);if(!c||!c.scheme)throw new SyntaxError;Object.defineProperty(this,"_baseURL",{value:c})}c=y(b,c);if(!c)throw new SyntaxError;Object.defineProperty(this,"_input",{value:b,writable:!0});Object.defineProperty(this,"_url",{value:c,writable:!0});var e=new a(this);Object.defineProperty(this,"query",{get:function(){return this._url?
e:null},enumerable:!0})}try{var k;if("function"===typeof window.URL&&0!==window.URL.length&&"http:"===(k=new window.URL("http://www.w3.org?q")).protocol&&k.query)return}catch(q){}var p=/^(?:([^:\/?#]+):)?(?:\/\/([^\/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?$/,s=/^(?:(.*)@)?(\[[^\]]*\]|[^:]*)(?::(.*))?$/,B=/^([a-zA-Z](?:[a-zA-Z0-9+-.])*)$/,w=/^\d*$/,x=/^(\[[^\]\/?#\s]*\]|[^:\/?#\s]*)$/,t=/^(\[[^\]\/?#\s]*\]|[^:\/?#\s]*)(?::(\d*))?$/,u=/^([^?#\s]*)$/,z=/^([^\s]*)$/,G=/^\S*$/,C=/([^:]*):?(.*)/,F="undefined"!==
typeof StopIteration?StopIteration:Error("Stop Iteration"),D={"ftp:":"21","gopher:":"70","http:":"80","https:":"443","ws:":"80","wss:":"443"};Object.defineProperties(a.prototype,{get:{value:function(a){d(a);var e;b(this._url.query).some(function(b){b=c(b);if(b[0]===a)return e=b[1],!0});return e},enumerable:!0},set:{value:function(a,e){d(a);d(e);var g=b(this._url.query);g.some(function(b,d){var h=c(b);if(h[0]===a)return h[1]=e,g[d]=f(h),!0})||g.push(f([a,e]));this._url.query=m(g)},enumerable:!0},has:{value:function(a){d(a);
return b(this._url.query).some(function(b){if(c(b)[0]===a)return!0})},enumerable:!0},"delete":{value:function(a){d(a);var e=b(this._url.query),f=e.filter(function(b){return c(b)[0]!==a});return f.length!==e.length?(this._url.query=m(f),!0):!1},enumerable:!0},clear:{value:function(){this._url.query=""},enumerable:!0},forEach:{value:function(a,b){if("function"!==typeof a)throw new TypeError;var c=h(this._url,"keys+values");try{for(;;){var d=c.next();a.call(b,d[1],d[0],this)}}catch(e){if(e!==F)throw e;
}},enumerable:!0},keys:{value:function(){return h(this._url,"keys")},enumerable:!0},values:{value:function(){return h(this._url,"values")},enumerable:!0},items:{value:function(){return h(this._url,"keys+values")}},size:{get:function(){return b(this._url.query).length},enumerable:!0},getAll:{value:function(a){d(a);var e=[];b(this._url.query).forEach(function(b){b=c(b);b[0]===a&&e.push(b[1])});return e},enumerable:!0},append:{value:function(a,c){d(a);d(c);var e=b(this._url.query);e.push(f([a,c]));this._url.query=
m(e)},enumerable:!0}});Object.defineProperties(r.prototype,{href:{get:function(){var a;if(this._url){a=this._url;var b=a.scheme?a.scheme+":":"";a.host&&(b+="//",a.userinfo&&(b+=a.userinfo+"@"),b+=a.host,a.port&&(b+=":"+a.port));b+=a.path;a.query&&(b+="?"+a.query);a.fragment&&(b+="#"+a.fragment);a=b}else a=this._input;return a},set:function(a){d(a);this._input=a;this._url=y(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){d(a);if(this._url&&(a=":"===a.slice(-1)?a.substring(0,a.length-1):a,""===a||B.test(a)))this._url.scheme=a.toLowerCase()},enumerable:!0},_userinfo:{get:function(){return this._url?this._url.userinfo:""},set:function(a){d(a);this._url&&(this._url.userinfo=a)}},username:{get:function(){if(!this._url)return"";var a=C.exec(this._userinfo);return decodeURIComponent(a[1]||"")},set:function(a){d(a);if(this._url){var b=
C.exec(this._userinfo);a=[encodeURIComponent(a||"")];b[2]&&a.push(b[2]);this._userinfo=a.join(":")}},enumerable:!0},password:{get:function(){if(!this._url)return"";var a=C.exec(this._userinfo);return decodeURIComponent(a[2]||"")},set:function(a){d(a);if(this._url){var b=[C.exec(this._userinfo)[1]||""];a&&b.push(encodeURIComponent(a));this._userinfo=b.join(":")}},enumerable:!0},host:{get:function(){var a="";this._url&&this._url.host&&(a+=this._url.host,this._url.port&&(a+=":"+this._url.port));return a},
set:function(a){d(a);if(this._url&&(a=t.exec(a)))this._url.host=a[1],this._url.port=g(a[2])},enumerable:!0},hostname:{get:function(){return this._url?this._url.host:""},set:function(a){d(a);this._url&&x.exec(a)&&(this._url.host=a)},enumerable:!0},port:{get:function(){var a=this._url?this._url.port||"":"";a&&a===D[this.protocol]&&(a="");return a},set:function(a){d(a);this._url&&w.exec(a)&&(this._url.port=g(a))},enumerable:!0},pathname:{get:function(){return this._url?this._url.path:""},set:function(a){d(a);
this._url&&u.exec(a)&&(this._url.host&&(a&&"/"!==a[0])&&(a="/"+a),this._url.path=a?e(a):"")},enumerable:!0},search:{get:function(){return this._url&&this._url.query?"?"+this._url.query:""},set:function(a){d(a);this._url&&(a&&"?"===a[0]&&(a=a.substring(1)),z.exec(a)&&(this._url.query=a))},enumerable:!0},hash:{get:function(){return this._url&&this._url.fragment?"#"+this._url.fragment:""},set:function(a){d(a);this._url&&(a&&"#"===a[0]&&(a=a.substring(1)),G.exec(a)&&(this._url.fragment=a))},enumerable:!0}});
if((k=window.URL||window.webkitURL)&&k.createObjectURL)Object.defineProperty(r,"createObjectURL",{value:k.createObjectURL.bind(k),enumerable:!1}),Object.defineProperty(r,"revokeObjectURL",{value:k.revokeObjectURL.bind(k),enumerable:!1});window.URL=r})();define("orion/URL-shim",function(){});
define("edit/content/imageViewerPlugin","orion/plugin orion/Deferred orion/commands orion/keyBinding orion/webui/littlelib orion/URL-shim".split(" "),function(d,b,m,c,f){var h=new m.CommandsProxy;d=new d({name:"Orion Image Viewer Plugin",version:"1.0",description:"This plugin provides viewer for image files."});d.registerService("orion.edit.editor",{setBlob:function(a){var b=document.createElement("img"),c=URL.createObjectURL(a);b.src=c;b.onload=function(){URL.revokeObjectURL(c)};a=document.getElementById("imagecontent");
f.empty(a);a.appendChild(b)},setTextModel:function(a){h.setProxy(a);return new b},onChanged:function(a){},registerKeys:function(a){var b=[];a.forEach(function(a){b.push(new c.KeyBinding(a.keyCode,a.mod1,a.mod2,a.mod3,a.mod4))});h.setKeyBindings(b)}},{id:"orion.viewer.image","default":!0,nameKey:"Orion Image Viewer",nls:"orion/nls/messages",uriTemplate:"../edit/edit.html#{,Location,params*},editor\x3dorion.viewer.image"});d.registerService("orion.navigate.openWith",{},{editor:"orion.viewer.image",
contentType:"image/gif image/jpeg image/ico image/png image/tiff image/svg".split(" ")});d.connect()});
//@ sourceMappingURL=imageViewerPlugin.js.map