/*******************************************************************************
 * @license
 * Copyright (c) 2011, 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). 
 *
 *******************************************************************************/

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

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

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

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

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

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

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

/*

 Copyright (c) 2011, 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). 


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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

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

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation
*/
define("orion/browserCompatibility",[],function(){function c(){for(var c=navigator.userAgent,i={browser:!1,version:!1},m=[{name:"Chrome/Chromium",regExp:/(?:chrome|crios|chromium)\/(\d+)/i,minVersion:24},{name:"Firefox",regExp:/firefox\/(\d+)/i,minVersion:17},{name:"MSIE",regExp:/msie\s(\d+)/i,minVersion:10},{name:"Safari",regExp:/version\/(\d+).*?safari/i,minVersion:5}],e=0;e<m.length;e++){var f=m[e],b=c.match(f.regExp);if(b){i.browser=!0;i.version=b[1]>=f.minVersion;i.name=f.name;break}}return i}
function i(){try{return"localStorage"in window&&window.localStorage!==null}catch(c){return!1}}function k(c){alert(c);throw"unsupported browser";}var m=c();if(m.browser)m.version||k("Sorry, your browser version is not supported.\n\nTo use Orion, please upgrade to the latest version of "+m.name+".\n");else if(i()&&!localStorage.skipBrowserCheck)if(confirm("Sorry, your browser is not supported. The latest version of Chrome, Firefox or Safari web browser is recommended.\nContinue anyway?"))localStorage.skipBrowserCheck=
1;else throw"unsupported browser";else i()||k("Sorry, your browser is not supported.\n\nTo use Orion, the latest version of the Chrome, Firefox, or Safari web browser is recommended.\n");return{isSupportedBrowser:c,supportsLocalStorage:i,throwBrowserAlert:k}});
(function(c,i){typeof define==="function"&&define.amd?define("orion/Deferred",i):typeof exports==="object"?module.exports=i():(c.orion=c.orion||{},c.orion.Deferred=i())})(this,function(){function c(){for(var b;b=n.shift()||e.shift();)b();f=!1}function i(b,a){(a?e:n).push(b);f||(f=!0,a?setTimeout(c,0):c())}function k(b){return function(){b.apply(null,arguments)}}function m(){}function l(){var b=Error("Cancel");b.name="Cancel";return b}function j(){function b(){for(var b;b=h.shift();){var g=b.deferred,
f=d==="resolved"?"resolve":"reject";if(typeof b[f]==="function")try{var e=b[f](a);e&&typeof e.then==="function"?(g.cancel=e.cancel||m,e.then(k(g.resolve),k(g.reject),g.progress)):g.resolve(e)}catch(q){g.reject(q)}else g[f](a)}}var a,d,h=[],g=this;this.reject=function(f){d||(d="rejected",a=f,h.length&&i(b));return g.promise};this.resolve=function(f){d||(d="resolved",a=f,h.length&&i(b));return g.promise};this.progress=function(a){d||h.forEach(function(b){b.progress&&b.progress(a)});return g.promise};
this.cancel=function(){d||g.reject(l())};this.then=function(a,f,e){var a={resolve:a,reject:f,progress:e,deferred:new j},c=a.deferred,q=!1,v=function(){q||(q=!0,i(function(){var a=c.cancel===v?g.cancel:c.cancel;typeof a==="function"&&a()},!0))};c.cancel=v;h.push(a);d&&i(b,!0);return c.promise};this.promise=Object.create(Object.prototype,{then:{value:g.then},cancel:{get:function(){return g.cancel},set:function(a){g.cancel=a}}})}var n=[],e=[],f=!1;j.all=function(b,a){function d(a,b){e||(f[a]=b,--g===
0&&c.resolve(f))}function h(b,g){if(!e){if(a)try{d(b,a(g));return}catch(h){g=h}c.reject(g)}}var g=b.length,f=[],e=!1,c=new j;c.then(null,function(){e=!0;b.forEach(function(a){a.cancel&&a.cancel()})});g===0?c.resolve(f):b.forEach(function(a,b){a.then(d.bind(null,b),h.bind(null,b))});return c.promise};j.when=function(b,a,d,h){var g;if(!(b&&typeof b.then==="function"))g=new j,g.resolve(b),b=g.promise;return b.then(a,d,h)};return j});
define("orion/EventTarget",[],function(){function c(){this._namedListeners={}}c.prototype={dispatchEvent:function(c){if(!c.type)throw Error("unspecified type");var k=this._namedListeners[c.type];k&&k.forEach(function(m){try{typeof m==="function"?m(c):m.handleEvent(c)}catch(k){typeof console!=="undefined"&&console.log(k)}});return!c.defaultPrevented},addEventListener:function(c,k){if(typeof k==="function"||k.handleEvent)this._namedListeners[c]=this._namedListeners[c]||[],this._namedListeners[c].push(k)},
removeEventListener:function(c,k){var m=this._namedListeners[c];if(m)for(var l=0;l<m.length;l++)if(m[l]===k){m.length===1?delete this._namedListeners[c]:m.splice(l,1);break}}};c.prototype.constructor=c;c.attach=function(i){var k=new c;i.dispatchEvent=k.dispatchEvent.bind(k);i.addEventListener=k.addEventListener.bind(k);i.removeEventListener=k.removeEventListener.bind(k)};return c});
define("orion/serviceregistry",["orion/Deferred","orion/EventTarget"],function(c,i){function k(e,f,b){this._properties=b||{};this._properties["service.id"]=e;this._properties.objectClass=f;this._properties["service.names"]=f}function m(e,f,b){this._serviceId=e;this._serviceReference=f;this._internalRegistry=b}function l(e,f){function b(a){return function(){var b;try{if(!f())throw Error("Service was unregistered");var g=e[a].apply(e,Array.prototype.slice.call(arguments));if(g&&typeof g.then==="function")return g;
else b=new c,b.resolve(g)}catch(B){b=new c,b.reject(B)}return b.promise}}for(var a in e)typeof e[a]==="function"&&(this[a]=b(a))}function j(e,f){this.type=e;this.serviceReference=f}function n(){this._entries=[];this._namedReferences={};this._serviceEventTarget=new i;var e=this;this._internalRegistry={isRegistered:function(f){return e._entries[f]?!0:!1},unregisterService:function(f){var b=e._entries[f];if(!b)throw Error("already unregistered");var a=b.reference;e._serviceEventTarget.dispatchEvent(new j("unregistering",
a));e._entries[f]=null;a.getProperty("objectClass").forEach(function(b){for(var h=e._namedReferences[b],g=0;g<h.length;g++)if(h[g]===a){h.length===1?delete e._namedReferences[b]:h.splice(g,1);break}})},modifyService:function(f){f=e._entries[f];if(!f)throw Error("already unregistered");e._serviceEventTarget.dispatchEvent(new j("modified",f.reference))}}}k.prototype={getPropertyKeys:function(){var e=[],f;for(f in this._properties)this._properties.hasOwnProperty(f)&&e.push(f);return e},getProperty:function(e){return this._properties[e]}};
k.prototype.constructor=k;m.prototype={unregister:function(){this._internalRegistry.unregisterService(this._serviceId)},getReference:function(){if(!this._internalRegistry.isRegistered(this._serviceId))throw Error("already unregistered");return this._serviceReference},setProperties:function(e){var f=this._serviceReference._properties;this._serviceReference._properties=e||{};e["service.id"]=this._serviceId;e.objectClass=f.objectClass;e["service.names"]=f["service.names"];this._internalRegistry.modifyService(this._serviceId)}};
m.prototype.constructor=m;n.prototype={getService:function(e){var f;if(typeof e==="string")(e=this._namedReferences[e])&&e.some(function(b){f=this._entries[b.getProperty("service.id")].service;return!!f},this);else if(e=this._entries[e.getProperty("service.id")])f=e.service;return f||null},getServiceReferences:function(e){if(e)return this._namedReferences[e]?this._namedReferences[e]:[];var f=[];this._entries.forEach(function(b){b&&f.push(b.reference)});return f},registerService:function(e,f,b){if(typeof f===
"undefined"||f===null)throw Error("invalid service");typeof e==="string"?e=[e]:Array.isArray(e)||(e=[]);var a=this._entries.length,d=new k(a,e,b),h=this._namedReferences;e.forEach(function(a){h[a]=h[a]||[];h[a].push(d)});e=new l(f,this._internalRegistry.isRegistered.bind(null,a));this._entries.push({reference:d,service:e});e=this._internalRegistry;this._serviceEventTarget.dispatchEvent(new j("registered",d));return new m(a,d,e)},addEventListener:function(e,f){this._serviceEventTarget.addEventListener(e,
f)},removeEventListener:function(e,f){this._serviceEventTarget.removeEventListener(e,f)}};n.prototype.constructor=n;return{ServiceRegistry:n}});
define("orion/xhr",["orion/Deferred"],function(c){function i(c,i,l,j){var n=typeof l.response!=="undefined"?l.response:l.responseText,e;try{e=l.status}catch(f){e=0}c={args:i,response:n,responseText:typeof n==="string"?n:null,status:e,url:c,xhr:l};if(typeof j!=="undefined")c.error=j;return c}return function(k,m,l){var l=l||{},j=arguments.length>3&&arguments[3]?arguments[3]:new XMLHttpRequest,n=new c,e=l.headers||{},f=l.log||!1,b;typeof e["X-Requested-With"]==="undefined"&&(e["X-Requested-With"]="XMLHttpRequest");
if(typeof l.data!=="undefined"&&(k==="POST"||k==="PUT"))b=l.data;j.onprogress=function(a){a.xhr=j;n.progress(a)};j.onreadystatechange=function(){if(j.readyState===4){var a=i(m,l,j),b=j.status;200<=b&&b<400?n.resolve(a):(f&&typeof console!=="undefined"&&console.log(Error(j.statusText)),n.reject(a))}};try{j.open(k,m,!0);if(typeof l.responseType==="string")j.responseType=l.responseType;if(typeof l.timeout==="number")if(typeof j.timeout==="number")j.timeout=l.timeout,j.addEventListener("timeout",function(){n.reject(i(m,
l,j,"Timeout exceeded"))});else{var a=setTimeout(function(){n.reject(i(m,l,j,"Timeout exceeded"))},l.timeout);n.then(clearTimeout.bind(null,a),clearTimeout.bind(null,a))}Object.keys(e).forEach(function(a){j.setRequestHeader(a,e[a])});j.send(b)}catch(d){n.reject(i(m,l,j,d))}return n.promise}});
define("orion/preferences",["require","orion/Deferred","orion/xhr"],function(c,i,k){function m(b,a){this._name=b;this._providers=a;this._flushPending=!1;this._cached=null;this._stores=[];this._dirty=[]}function l(b,a){return{get:function(d,h){if(a===0)return null;var g=localStorage.getItem(b+d);if(g===null)return null;g=JSON.parse(g);return h||a===-1||g._expires&&g._expires>(new Date).getTime()?(delete g._expires,g):null},set:function(d,h){if(a!==0){if(a!==-1)h._expires=(new Date).getTime()+1E3*a;
if(Object.keys(h).length===0)localStorage.removeItem(b+d);else{var g=JSON.stringify(h);localStorage.setItem(b+d,g);delete h._expires}}},remove:function(a){localStorage.removeItem(b+a)}}}function j(b){this._currentPromises={};this._cache=new l("/orion/preferences/user",3600);this._service=null;this.available=function(){if(!this._service){var a=b.getServiceReferences("orion.core.preference.provider");if(a.length>0)this._service=b.getService(a[0])}return!!this._service}}function n(b){this._location=
b;this._currentPromise=null;this._cache=new l("/orion/preferences/default",3600)}function e(){this._cache=new l("/orion/preferences/local",-1)}function f(b,a){this._userProvider=new j(b);this._localProvider=new e;a=a||"defaults.pref";a.indexOf("://")===-1&&(a=c.toUrl(a));this._defaultsProvider=new n(a);this._serviceRegistration=b.registerService("orion.core.preference",this)}m.prototype={_flush:function(){for(var b=[],a=0;a<this._stores.length;++a){var d=this._stores[a];this._dirty.indexOf(d)!==-1&&
b.push(this._providers[a].put(this._name,d))}this._dirty=[];return i.all(b)},_scheduleFlush:function(b){this._dirty.indexOf(b)===-1&&this._dirty.push(b);if(!this._flushPending)this._flushPending=!0,window.setTimeout(function(){if(this._flushPending)this._flushPending=!1,this._flush()}.bind(this),0)},_getCached:function(){if(!this._cached){this._cached={};for(var b=0;b<this._stores.length;++b){var a=this._stores[b],d;for(d in a)a.hasOwnProperty(d)&&typeof this._cached[d]==="undefined"&&(this._cached[d]=
a[d])}}return this._cached},keys:function(){return Object.keys(this._getCached())},get:function(b){return this._getCached()[b]},put:function(b,a){if(this._stores.length!==0){var d=this._stores[0];if(d[b]!==a)d[b]=a,this._cached=null,this._scheduleFlush(d)}},remove:function(b){for(var a=0;a<this._stores.length;++a){var d=this._stores[a];if(d.hasOwnProperty(b))return delete d[b],this._cached=null,this._scheduleFlush(d),!0}return!1},clear:function(){for(var b=0;b<this._stores.length;++b)this._stores[b]=
{},this._scheduleFlush(this._stores[b]);this._cached=null},sync:function(b){if(this._flushPending)return this._flushPending=!1,this._flush();for(var a=this,d=[],h=0;h<this._providers.length;++h)d.push(this._providers[h].get(this._name,b).then(function(b){return function(d){a._stores[b]=d}}(h)));return i.all(d).then(function(){a._cached=null;a._getCached()})},flush:function(){this._flush()}};j.prototype={get:function(b,a){if(this._currentPromises[b])return this._currentPromises[b];var d=new i,h=null;
a?this._cache.remove(b):h=this._cache.get(b);if(h!==null)d.resolve(h);else{this._currentPromises[b]=d;var g=this;this._service.get(b).then(function(a){g._cache.set(b,a);delete g._currentPromises[b];d.resolve(a)},function(a){a.status===404?(a={},g._cache.set(b,a),delete g._currentPromises[b],d.resolve(a)):(delete g._currentPromises[b],d.resolve(g._cache.get(b,!0)||{}))})}return d},put:function(b,a){this._cache.set(b,a);return this._service.put(b,a)}};n.prototype={get:function(b,a){if(this._currentPromise)return this._currentPromise;
var d=new i,h=null;a?this._cache.remove(b):h=this._cache.get(b);if(h!==null)d.resolve(h);else{this._currentPromise=d;var g=this;k("GET",this._location,{headers:{"Orion-Version":"1"},timeout:15E3}).then(function(a){a=JSON.parse(a.response);g._cache.set(b,a[b]||{});g._currentPromise=null;d.resolve(a[b]||{})},function(a){a.xhr.status===401||a.xhr.status===404?(g._cache.set(b,{}),g._currentPromise=null,d.resolve({})):(g._currentPromise=null,a=g._cache.get(b,!0),a!==null?d.resolve(a[b]||{}):d.resolve({}))})}return d},
put:function(){var b=new i;b.resolve();return b}};e.prototype={get:function(b){var a=new i,b=this._cache.get(b);b!==null?a.resolve(b):a.resolve({});return a},put:function(b,a){var d=new i;this._cache.set(b,a);d.resolve();return d}};f.DEFAULT_SCOPE=1;f.LOCAL_SCOPE=2;f.USER_SCOPE=4;f.prototype={listenForChangedSettings:function(b,a,d){if(!a||typeof a!=="number"||a>7||a<1)d=a,a=f.DEFAULT_SCOPE|f.LOCAL_SCOPE|f.USER_SCOPE;window.addEventListener("storage",d,!1);if((f.USER_SCOPE&a)!==0)return"/orion/preferences/user"+
b;else if((f.LOCAL_SCOPE&a)!==0)return"/orion/preferences/local"+b;return"/orion/preferences/default"+b},getPreferences:function(b,a){if(!a||typeof a!=="number"||a>7||a<1)a=f.DEFAULT_SCOPE|f.LOCAL_SCOPE|f.USER_SCOPE;var d=[];f.USER_SCOPE&a&&this._userProvider.available()&&d.push(this._userProvider);f.LOCAL_SCOPE&a&&d.push(this._localProvider);f.DEFAULT_SCOPE&a&&d.push(this._defaultsProvider);var h=new m(b,d);return h.sync().then(function(){return h})},getSetting:function(b,a,d){for(var h,g=0;g<b.length;g++)if(b[g].label===
a)for(var f=0;f<b[g].data.length;f++)if(b[g].data[f].label===d){h=b[g].data[f].value;break}return h}};return{PreferencesService:f}});
(function(){function c(a){if(typeof a!=="string")throw new TypeError;}function i(a){return a?a.split("&"):[]}function k(a){return a.length===0?"":a.join("&")}function m(a){var b=/([^=]*)(?:=?)(.*)/.exec(a),a=b[1]?decodeURIComponent(b[1]):"",b=b[2]?decodeURIComponent(b[2]):"";return[a,b]}function l(a){var b=encodeURIComponent(a[0]);a[1]&&(b+="="+encodeURIComponent(a[1]));return b}function j(a,b){var d="",g=[],f=0;return{next:function(){if(d!==a.query)d=a.query,g=i(d);if(f<g.length){var h=m(g[f++]);
switch(b){case "keys":return h[0];case "values":return h[1];case "keys+values":return[h[0],h[1]];default:throw new TypeError;}}throw y;}}}function n(a){Object.defineProperty(this,"_url",{get:function(){return a._url}})}function e(a){var b=[];a.split("/").forEach(function(a){a===".."?b.pop():a!=="."&&b.push(a)});return b.join("/")}function f(a){return a.replace(/\s/g,function(a){return"%"+a.charCodeAt(0).toString(16)})}function b(a,b){if(typeof a!=="string")throw new TypeError;var a=f(a),d=h.exec(a);
if(!d)return null;var c={};c.scheme=d[1]||"";if(c.scheme&&!B.test(c.scheme))return null;var q=d[2];if(q&&(q=g.exec(q),c.userinfo=q[1],c.host=q[2],c.port=q[3],c.port&&!z.test(c.port)))return null;c.path=d[3];c.query=d[4];c.fragment=d[5];if(!c.scheme&&b&&(c.scheme=b.scheme,!c.host&&b.host))c.userinfo=b.userinfo,c.host=b.host,c.port=b.port,c.pathRelative=!0;if(c.pathRelative)if(c.path){if(c.path[0]!=="/")d=/^(.*\/)[^\/]*$/.exec(b.path)[1]||"/",c.path=d+c.path}else c.path=b.path;if(c.scheme)c.scheme=
c.scheme.toLowerCase();if(c.port)c.port=/[1-9]\d*$/.exec(c.port)[0];if(c.host&&c.path)c.path=e(c.path);return c}function a(a,d){var c;if(d){d=d.href||d;c=b(d);if(!c||!c.scheme)throw new SyntaxError;Object.defineProperty(this,"_baseURL",{value:c})}c=b(a,c);if(!c)throw new SyntaxError;Object.defineProperty(this,"_input",{value:a,writable:!0});Object.defineProperty(this,"_url",{value:c,writable:!0});var g=new n(this);Object.defineProperty(this,"query",{get:function(){return this._url?g:null},enumerable:!0})}
try{if(typeof window.URL==="function"&&window.URL.length!==0&&(new window.URL("http://www.w3.org")).protocol==="http:")return}catch(d){}var h=/^(?:([^:\/?#]+):)?(?:\/\/([^\/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?$/,g=/^(?:(.*)@)?(\[[^\]]*\]|[^:]*)(?::(.*))?$/,B=/^([a-zA-Z](?:[a-zA-Z0-9+-.])*)$/,z=/^\d*$/,A=/^(\[[^\]\/?#\s]*\]|[^:\/?#\s]*)$/,p=/^(\[[^\]\/?#\s]*\]|[^:\/?#\s]*)(?::(\d*))?$/,q=/^([^?#\s]*)$/,v=/^([^\s]*)$/,w=/^\S*$/,s=/([^:]*):?(.*)/,y=typeof StopIteration!=="undefined"?StopIteration:
Error("Stop Iteration"),o={"ftp:":"21","gopher:":"70","http:":"80","https:":"443","ws:":"80","wss:":"443"};Object.defineProperties(n.prototype,{get:{value:function(a){c(a);var b;i(this._url.query).some(function(d){d=m(d);if(d[0]===a)return b=d[1],!0});return b},enumerable:!0},set:{value:function(a,b){c(a);c(b);var d=i(this._url.query);d.some(function(c,g){var f=m(c);if(f[0]===a)return f[1]=b,d[g]=l(f),!0})||d.push(l([a,b]));this._url.query=k(d)},enumerable:!0},has:{value:function(a){c(a);return i(this._url.query).some(function(b){if(m(b)[0]===
a)return!0})},enumerable:!0},"delete":{value:function(a){c(a);var b=i(this._url.query),d=b.filter(function(b){return m(b)[0]!==a});return d.length!==b.length?(this._url.query=k(d),!0):!1},enumerable:!0},clear:{value:function(){this._url.query=""},enumerable:!0},forEach:{value:function(a,b){if(typeof a!=="function")throw new TypeError;var d=j(this._url,"keys+values");try{for(;;){var c=d.next();a.call(b,c[1],c[0],this)}}catch(g){if(g!==y)throw g;}},enumerable:!0},keys:{value:function(){return j(this._url,
"keys")},enumerable:!0},values:{value:function(){return j(this._url,"values")},enumerable:!0},items:{value:function(){return j(this._url,"keys+values")}},size:{get:function(){return i(this._url.query).length},enumerable:!0},getAll:{value:function(a){c(a);var b=[];i(this._url.query).forEach(function(d){d=m(d);d[0]===a&&b.push(d[1])});return b},enumerable:!0},append:{value:function(a,b){c(a);c(b);var d=i(this._url.query);d.push(l([a,b]));this._url.query=k(d)},enumerable:!0}});Object.defineProperties(a.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){c(a);this._input=a;this._url=b(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){c(a);if(this._url&&(a=a.slice(-1)===":"?a.substring(0,a.length-1):a,B.test(a)))this._url.scheme=a.toLowerCase()},enumerable:!0},_userinfo:{get:function(){return this._url?this._url.userinfo:""},set:function(a){c(a);if(this._url)this._url.userinfo=a}},username:{get:function(){if(!this._url)return"";var a=s.exec(this._userinfo);return decodeURIComponent(a[1]||"")},set:function(a){c(a);if(this._url){var b=s.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=s.exec(this._userinfo);return decodeURIComponent(a[2]||"")},set:function(a){c(a);if(this._url){var b=[s.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){c(a);if(this._url&&(a=p.exec(a)))this._url.host=
a[1],this._url.port=/[1-9]\d*$/.exec(a[2])[0]},enumerable:!0},hostname:{get:function(){return this._url?this._url.host:""},set:function(a){c(a);if(this._url&&A.exec(a))this._url.host=a},enumerable:!0},port:{get:function(){var a=this._url?this._url.port||"":"";a&&a===o[this.protocol]&&(a="");return a},set:function(a){c(a);if(this._url&&z.exec(a))this._url.port=/[1-9]\d*$/.exec(a)[0]},enumerable:!0},pathname:{get:function(){return this._url?this._url.path:""},set:function(a){c(a);if(this._url&&q.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){c(a);if(this._url&&(a&&a[0]==="?"&&(a=a.substring(1)),v.exec(a)))this._url.query=a},enumerable:!0},hash:{get:function(){return this._url&&this._url.fragment?"#"+this._url.fragment:""},set:function(a){c(a);if(this._url&&(a&&a[0]==="#"&&(a=a.substring(1)),w.exec(a)))this._url.fragment=a},enumerable:!0}});window.URL&&window.URL.createObjectURL&&
(Object.defineProperty(a,"createObjectURL",{value:window.URL.createObjectURL.bind(window.URL),enumerable:!1}),Object.defineProperty(a,"revokeObjectURL",{value:window.URL.revokeObjectURL.bind(window.URL),enumerable:!1}));window.URL=a})();define("orion/URL-shim",function(){});
define("orion/pluginregistry",["orion/Deferred","orion/EventTarget","orion/URL-shim"],function(c,i){function k(c,b){var a=Object.keys(c),d=Object.keys(b);if(a.length!==d.length)return!1;a.sort();d.sort();for(var h=0,g=a.length;h<g;h++){var e=a[h];if(e!==d[h])return!1;var i=c[e],e=b[e];if(i!==e&&JSON.stringify(i)!==JSON.stringify(e))return!1}return!0}function m(c){if(c.indexOf("://")===-1)try{return(new URL(c,location.href)).href}catch(b){}return c}function l(c){var b=null;return{key:function(a){return(b=
b||Object.keys(c))[a]},getItem:function(a){return c[a]},setItem:function(a,d){c[a]=d;b=null},removeItem:function(a){delete c[a];b=null},clear:function(){(b=b||Object.keys(c)).forEach(function(a){delete c[a]}.bind(this));b=null}}}function j(c,b){return{type:c,plugin:b}}function n(e,b,a){function d(b,d,g){if(!t)return(new c).reject(Error("plugin not connected"));var e=E++,h=new c;h.then(null,function(b){o==="active"&&b instanceof Error&&b.name==="Cancel"&&a.postMessage({id:e,cancel:b.message||"Cancel"},
t)});C[String(e)]=h;a.postMessage({id:e,serviceId:b,method:d,params:g},t);return h.promise}function h(a){var b={};if(a.methods&&(a.methods.forEach(function(c){b[c]=function(){var b=Array.prototype.slice.call(arguments);return o==="active"?d(a.serviceId,c,b):p.start({"transient":!0}).then(function(){return d(a.serviceId,c,b)})}}),b.addEventListener&&b.removeEventListener)){var c=new i;b.dispatchEvent=c.dispatchEvent.bind(c);var g=b.addEventListener;b.addEventListener=function(a,b){c._namedListeners[a]||
g(a);c.addEventListener(a,b)};var e=b.removeEventListener;b.removeEventListener=function(a,b){c.removeEventListener(a,b);c._namedListeners[a]&&e(a)}}return b}function g(a){var b=JSON.parse(JSON.stringify(a.properties));b.__plugin__=e;a=a.names||a.type||[];Array.isArray(a)||(a=[a]);b.objectClass=a;return b}function m(b){var c=h(b),d=g(b),d=a.registerService(b.names||b.type,c,d);r[b.serviceId]={registration:d,proxy:c}}function l(){a.persist(e,{created:q,headers:v,services:w,autostart:s,lastModified:y})}
function n(b){var c;try{if(b.method)if("manifest"===b.method||"plugin"===b.method){var d=b.params[0];D({headers:d.headers,services:d.services}).then(function(){u.resolve(p)})}else if("dispatchEvent"===b.method){var g=r[b.serviceId].proxy;g.dispatchEvent.apply(g,b.params)}else if("progress"===b.method)c=C[String(b.requestId)],c.progress.apply(c,b.params);else if("timeout"===b.method)u&&u.reject(b.error);else throw Error("Bad response method: "+b.method);else if(c=C[String(b.id)],delete C[String(b.id)],
b.error){var e=a.handleServiceError(p,b.error);c.reject(e)}else c.resolve(b.result)}catch(h){console.log("Plugin._responseHandler "+h)}}var p=this,b=b||{},q=b.created||(new Date).getTime(),v=b.headers||{},w=b.services||[],s=b.autostart,y=b.lastModified||0,o="installed",x,u,t,r={},E=0,C={},D;this._persist=l;this._resolve=function(){o="resolved";a.dispatchEvent(new j("resolved",p))};this._getAutostart=function(){return s};this._getCreated=function(){return q};this.getLocation=function(){return e};this.getHeaders=
function(){return JSON.parse(JSON.stringify(v))};this.getName=function(){var a=this.getHeaders();return a?a.name||"":null};this.getVersion=function(){var a=this.getHeaders();return a?a.version||"0.0.0":null};this.getLastModified=function(){return y};this.getServiceReferences=function(){var a=[];Object.keys(r).forEach(function(b){a.push(r[b].registration.getReference())});return a};this.getState=function(){return o};this.start=function(b){if(o==="uninstalled")return(new c).reject(Error("Plugin is uninstalled"));
if(x)return x.promise.then(this.start.bind(this,b));if(o==="active")return(new c).resolve();if(!b||!b["transient"]){var d=b&&b.lazy?"lazy":"started";d!==s&&(s=d,l())}d=a.getState();if(d!=="starting"&&d!=="active")return b["transient"]?(new c).reject(Error("start transient error")):(new c).resolve();if(o==="installed")try{this._resolve()}catch(g){return(new c).reject(g)}o==="resolved"&&w.forEach(function(a){m(a)});if(b&&b.lazy)return o!=="starting"&&(o="starting",a.dispatchEvent(new j("lazy activation",
p))),(new c).resolve();var h=new c;x=h;o="starting";a.dispatchEvent(new j("starting",p));u=new c;t=a.connect(e,n);u.then(function(){u=null;o="active";a.dispatchEvent(new j("started",p));x=null;h.resolve()},function(){u=null;o="stopping";a.dispatchEvent(new j("stopping",p));Object.keys(r).forEach(function(a){r[a].registration.unregister();delete r[a]});a.disconnect(t);t=null;o="resolved";x=null;a.dispatchEvent(new j("stopped",p));h.reject(Error("plugin activation error"))});return h.promise};this.stop=
function(b){if(o==="uninstalled")return(new c).reject(Error("Plugin is uninstalled"));if(x)return x.promise.then(this.stop.bind(this,b));if((!b||!b["transient"])&&"stopped"!==s)s="stopped",l();if(o!=="active"&&o!=="starting")return(new c).resolve();x=b=new c;o="stopping";a.dispatchEvent(new j("stopping",p));Object.keys(r).forEach(function(a){r[a].registration.unregister();delete r[a]});t&&(a.disconnect(t),t=null);o="resolved";x=null;a.dispatchEvent(new j("stopped",p));b.resolve();return b.promise};
D=function(b){if(o==="uninstalled")return(new c).reject(Error("Plugin is uninstalled"));if(!b)return y===0&&(y=(new Date).getTime(),l()),a.loadManifest(e).then(D);var d=v,h=w,q=s;v=b.headers||{};w=b.services||{};s=b.autostart||s;b.lastModified?y=b.lastModified:(y=(new Date).getTime(),l());if(k(v,d)&&k(w,h)&&s===q)return(new c).resolve();if(o==="active"||o==="starting"){var i=[];Object.keys(w).forEach(function(a){var b=w[a];i.push(a);var c=r[a];if(c){if(k(b.methods,Object.keys(c.proxy))){var a=g(b),
d=c.registration.getReference(),h={};d.getPropertyKeys().forEach(function(a){h[a]=d.getProperty(a)});k(a,h)||c.registration.setProperties(a);return}c.registration.unregister();delete r[a]}m(b)});Object.keys(r).forEach(function(a){i.indexOf(a)===-1&&(r[a].registration.unregister(),delete r[a])})}o==="active"&&(a.disconnect(t),u=new c,t=a.connect(e,n),u.then(function(){u=null},function(){u=null;o="stopping";a.dispatchEvent(new j("stopping"),p);Object.keys(r).forEach(function(a){r[a].registration.unregister();
delete r[a]});a.disconnect(t);t=null;o="resolved";a.dispatchEvent(new j("stopped",p))}));return(new c).resolve()};this.update=function(b){return D(b).then(function(){a.dispatchEvent(new j("updated",p))})};this.uninstall=function(){if(o==="uninstalled")return(new c).reject(Error("Plugin is uninstalled"));if(o==="active"||o==="starting"||o==="stopping")return this.stop().then(this.uninstall.bind(this),this.uninstall.bind(this));a.removePlugin(this);o="uninstalled";a.dispatchEvent(new j("uninstalled",
p));return(new c).resolve()}}var e=/^http[s]?/i;return{Plugin:n,PluginRegistry:function(f,b){function a(a){var b=a.source;k.some(function(c){if(b===c.target){if(typeof c.useStructuredClone==="undefined")c.useStructuredClone=typeof a.data!=="string";c.handler(c.useStructuredClone?a.data:JSON.parse(a.data));return!0}})}var b=b||{},d=b.storage||localStorage;d.getItem||(d=l(d));var h="installed",g=[],k=[],z=new i,A={},p={registerService:f.registerService.bind(f),connect:function(a,c,d){function g(a){a=
Error(a);a.name="timeout";c({method:"timeout",error:a})}var h={handler:c,url:a},e=setTimeout(g.bind(null,"Load timeout for: "+a),d||15E3),f=document.createElement("iframe");f.name=a+"_"+(new Date).getTime();if(!b.visible)f.style.display="none",f.style.visibility="hidden";f.src=a;f.onload=function(){clearTimeout(e);setTimeout(g.bind(null,"Plugin handshake timeout for: "+a),5E3)};f.sandbox="allow-scripts allow-same-origin";document.body.appendChild(f);h.target=f.contentWindow;h.close=function(){f&&
(document.body.removeChild(f),f=null)};k.push(h);return h},disconnect:function(a){for(var b=0;b<k.length;b++)if(a===k[b]){k.splice(b,1);try{a.close()}catch(c){}break}},removePlugin:function(a){for(var b=0;b<g.length;b++)if(a===g[b]){g.splice(b,1);break}d.removeItem("plugin."+a.getLocation())},persist:function(a,b){d.setItem("plugin."+a,JSON.stringify(b))},postMessage:function(a,b){b.target.postMessage(b.useStructuredClone?a:JSON.stringify(a),b.url)},dispatchEvent:function(a){try{z.dispatchEvent(a)}catch(b){console&&
console.log("PluginRegistry.dispatchEvent "+b)}},loadManifest:function(a){var b=new c,d=p.connect(a,function(a){d&&a.method&&("manifest"===a.method||"plugin"===a.method?(a=a.params[0],p.disconnect(d),d=null,b.resolve(a)):"timeout"===a.method&&(p.disconnect(d),d=null,b.reject(a.error)))});return b.promise},getState:function(){return h},handleServiceError:function(a,b){if(b&&b.status===401){var c=a.getHeaders(),d=a.getName()||a.getLocation(),g=document.createElement("span");g.appendChild(document.createTextNode("Authentication required for: "+
d+"."));if(c.login)g.appendChild(document.createTextNode(" ")),d=document.createElement("a"),d.target="_blank",d.textContent="Login",d.href=c.login,e.test(d.href)?(g.appendChild(d),g.appendChild(document.createTextNode(" and re-try the request."))):console.log("Illegal Login URL: "+c.login);return{Severity:"Error",HTML:!0,Message:(new XMLSerializer).serializeToString(g)}}if(b.__isError){var h=b,b=Error(h.message);Object.keys(h).forEach(function(a){b[a]=h[a]});delete b.__isError}return b}};this.getLocation=
function(){return"System"};this.getHeaders=function(){return{}};this.getName=function(){return"System"};this.getVersion=function(){return"0.0.0"};this.getLastModified=function(){return 0};this.getState=p.getState;this.init=function(){if(!(h==="starting"||h==="active"||h==="stopping")){addEventListener("message",a,!1);for(var c=[],e=0,f=d.length;e<f;e++)c.push(d.key(e));c.forEach(function(a){if(a.indexOf("plugin.")===0){var b=a.substring(7),a=JSON.parse(d.getItem(a));a.created&&g.push(new n(b,a,p))}});
g.sort(function(a,b){return a._getCreated()<b._getCreated()?-1:1});b.plugins&&Object.keys(b.plugins).forEach(function(a){a=m(a);if(!this.getPlugin(a)){var c=b.plugins[a],c=typeof c==="object"||{};c.autostart=c.autostart||b.defaultAutostart||"lazy";g.push(new n(a,c,p))}}.bind(this));h="starting"}};this.start=function(){h!=="starting"&&this.init();if(h!=="starting")return(new c).reject("Cannot start framework. Framework is already "+h+".");var a=[],b=(new Date).getTime();g.forEach(function(c){var d=
c._getAutostart();c.getLastModified()===0?a.push(c.update().then(function(){if("started"===d)return c.start({"transient":!0});if("lazy"===d)return c.start({lazy:!0,"transient":!0});c._resolve()})):"started"===d?a.push(c.start({"transient":!0})):"lazy"===d?(a.push(c.start({lazy:!0,"transient":!0})),b>c.getLastModified()+864E5&&c.update()):c._resolve()});return c.all(a,function(a){console.log("PluginRegistry.stop "+a)}).then(function(){h="active"})};this.stop=function(){if(h!=="starting"&&h!=="active")return(new c).reject("Cannot stop registry. Registry is already "+
h+".");h="stopping";var b=[];g.forEach(function(a){b.push(a.stop({"transient":!0}))});return c.all(b,function(a){console.log("PluginRegistry.stop "+a)}).then(function(){removeEventListener("message",a);h="resolved"})};this.update=function(){this.stop().then(this.start.bind(this))};this.uninstall=function(){return(new c).reject("Cannot uninstall registry")};this.installPlugin=function(a,b){var a=m(a),d=this.getPlugin(a);if(d)return(new c).resolve(d);if(A[a])return A[a];if(b)return d=new n(a,b,p),g.push(d),
d._persist(),p.dispatchEvent(new j("installed",d)),(new c).resolve(d);var h=p.loadManifest(a).then(function(b){d=new n(a,b,p);g.push(d);d._persist();delete A[a];p.dispatchEvent(new j("installed",d));return d},function(b){delete A[a];throw b;});return A[a]=h};this.getPlugins=function(){return g.slice()};this.getPlugin=function(a){var b=null,a=m(a);g.some(function(c){if(a===c.getLocation())return b=c,!0});return b};this.addEventListener=z.addEventListener.bind(z);this.removeEventListener=z.removeEventListener.bind(z);
this.resolvePlugins=function(){var a=!0;g.forEach(function(b){a=a&&b._resolve()});return a}}}});
define("orion/serviceTracker",[],function(){function c(c,l){function j(a){var b=a.getProperty("service.id"),c=this.addingService(a);c&&(e[b]=a,f[b]=c)}function n(a){var b=a.getProperty("service.id"),c=f[b];delete e[b];delete f[b];this.removedService(a,c)}this.serviceRegistry=c;var e={},f={},b=i,a,d;this.close=function(){if(b!==k)throw"Already closed";b=i;c.removeEventListener("registered",a);c.removeEventListener("unregistering",d);d=a=null;var h=this;this.getServiceReferences().forEach(function(a){n.call(h,
a)});if(typeof this.onClose==="function")this.onClose()};this.getServiceReferences=function(){return e.length?Object.keys(e).map(function(a){return e[a]}):null};this.open=function(){if(b!==i)throw"Already open";b=k;var h=this;a=function(a){if(a.serviceReference.getProperty("objectClass").indexOf(l)!==-1&&(j.call(h,a.serviceReference),typeof h.onServiceAdded==="function"))return h.onServiceAdded(a.serviceReference,h.serviceRegistry.getService(a.serviceReference))};d=function(a){a.serviceReference.getProperty("objectClass").indexOf(l)!==
-1&&n.call(h,a.serviceReference)};c.addEventListener("registered",a);c.addEventListener("unregistering",d);c.getServiceReferences(l).forEach(function(a){j.call(h,a)});if(typeof this.onOpen==="function")this.onOpen()}}var i=0,k=1;c.prototype={addingService:function(c){return this.serviceRegistry.getService(c)},onOpen:null,onClose:null,onServiceAdded:null,removedService:function(){}};return c});
define("orion/config",["orion/Deferred","orion/serviceTracker"],function(c,i){var k,m,l,j,n,e="pid";k=function(b,a,d){function h(b,c,d){c.forEach(function(h,g){try{var e=b[g].getProperty("__plugin__"),f=e&&a.getPlugin(e);(!e||f&&f.getState()==="active")&&c[g].updated(d)}catch(i){typeof console!=="undefined"&&console.log(i)}})}i.call(this,b,"orion.cm.managedservice");var g={},f={},j=function(a){var h=[];a.plugin.getServiceReferences().forEach(function(a){if(a.getProperty("objectClass").indexOf("orion.cm.managedservice")!==
-1){var c=a.getProperty(e),a=b.getService(a);c&&a&&(c=(c=d._find(c))&&c.getProperties(),h.push(a.updated(c)))}});return c.all(h)};this.addingService=function(a){var c=a.getProperty(e),d=b.getService(a);if(!c||!d)return null;g[c]||(g[c]=[]);f[c]||(f[c]=[]);g[c].push(a);f[c].push(d);return d};this.onServiceAdded=function(a,b){var c=a.getProperty(e),c=d._find(c);h([a],[b],c&&c.getProperties())};this.onOpen=function(){a.addEventListener("started",j)};this.onClose=function(){a.removeEventListener("started",
j)};this.notifyUpdated=function(a){var b=a.getPid();h(g[b]||[],f[b]||[],a.getProperties())};this.notifyDeleted=function(a){a=a.getPid();h(g[a]||[],f[a]||[],null)};this.removedService=function(a,b){var c=a.getProperty(e),d=g[c],h=f[c];d.length>1?d.splice(d.indexOf(a),1):delete g[c];h.length>1?h.splice(h.indexOf(b),1):delete f[c]}};m=function(){function b(a,b,c){this.store=new l(this,c);this.configAdmin=new j(this,this.store);this.tracker=new k(a,b,this.store)}b.prototype={getConfigurationAdmin:function(){var a=
this;return this.configAdmin._init().then(function(b){a.tracker.open();return b})},notifyDeleted:function(a){this.tracker.notifyDeleted(a)},notifyUpdated:function(a){this.tracker.notifyUpdated(a)}};return b}();j=function(){function b(a,b){this.factory=a;this.store=b}b.prototype={_init:function(){var a=this;return this.store._init().then(function(){return a})},getConfiguration:function(a){return this.store.get(a)},listConfigurations:function(){return this.store.list()}};return b}();var f="/cm/configurations";
l=function(){function b(a,b){this.factory=a;this.prefsService=b;this.configs=Object.create(null);this.pref=null;var c=this;this.initPromise=this.prefsService.getPreferences(f).then(function(a){c.pref=a;a.keys().forEach(function(b){if(!c.configs[b]){var d=a.get(b);typeof d==="object"&&d!==null&&Object.keys(d).length>0&&(d[e]=b,c.configs[b]=new n(c.factory,c,d))}})})}b.prototype={_init:function(){return this.initPromise},_find:function(a){return this.configs[a]||null},get:function(a){var b=this._find(a);
b||(b=new n(this.factory,this,a),this.configs[a]=b);return b},list:function(){var a=this,b=[];this.pref.keys().forEach(function(c){(c=a._find(c))&&c.getProperties()!==null&&b.push(c)});return b},remove:function(a){this.pref.remove(a);delete this.configs[a]},save:function(a,b){this.pref.put(a,b.getProperties(!0)||{})}};return b}();n=function(){function b(a){for(var b={},c=Object.keys(a),e=0;e<c.length;e++){var f=c[e],i=a[f];b[f]=i instanceof Array?i.slice():i}return b}function a(a,c,g){this.factory=
a;this.store=c;if(g!==null&&typeof g==="object")this.pid=g[e],a=b(g),delete a[e],this.properties=a;else if(typeof g==="string")this.pid=g,this.properties=null;else throw Error("Invalid pid/properties "+g);}a.prototype={_checkRemoved:function(){if(this._removed)throw Error("Configuration was removed");},getPid:function(){this._checkRemoved();return this.pid},getProperties:function(a){this._checkRemoved();var c=null;if(this.properties&&(c=b(this.properties),!a))c[e]=this.pid;return c},remove:function(){this._checkRemoved();
this.factory.notifyDeleted(this);this.store.remove(this.pid);this._removed=!0},update:function(a){this._checkRemoved();a=b(a);delete a[e];this.properties=a;this.store.save(this.pid,this);this.factory.notifyUpdated(this)},toString:function(){return"[ConfigImpl pid: "+this.pid+", properties: "+JSON.stringify(this.properties)+"]"}};return a}();return{ConfigurationAdminFactory:m}});
define("orion/bootstrap","require,orion/Deferred,orion/serviceregistry,orion/preferences,orion/pluginregistry,orion/config".split(","),function(c,i,k,m,l,j){var n;return{startup:function(){if(n)return n;n=new i;var e=new k.ServiceRegistry,f=new m.PreferencesService(e);return f.getPreferences("/plugins").then(function(b){var a={plugins:{}};b.keys().forEach(function(d){var e=c.toUrl(d);a.plugins[e]=b[d]});var d=new l.PluginRegistry(e,a);return d.start().then(function(){if(e.getServiceReferences("orion.core.preference.provider").length>
0)return f.getPreferences("/plugins",f.USER_SCOPE).then(function(a){var b=[];a.keys().forEach(function(a){a=c.toUrl(a);d.getPlugin(a)||b.push(d.installPlugin(a,{autostart:"lazy"}).then(function(a){return a.update().then(function(){return a.start({lazy:!0})})}))});return i.all(b,function(a){console.log(a)})})}).then(function(){return(new j.ConfigurationAdminFactory(e,d,f)).getConfigurationAdmin().then(e.registerService.bind(e,"orion.cm.configadmin"))}).then(function(){var a=e.getService("orion.core.auth");
if(a){var b=a.getUser().then(function(b){if(b)localStorage.setItem("lastLogin",(new Date).getTime());else return a.getAuthForm(window.location.href).then(function(a){setTimeout(function(){window.location=a},0)})}),c=localStorage.getItem("lastLogin");if(!c||c<(new Date).getTime()-9E5)return b}}).then(function(){var a={serviceRegistry:e,preferences:f,pluginRegistry:d};n.resolve(a);return a})})}}});
define("domReady",[],function(){function c(){if(!n){n=!0;l&&clearInterval(l);var a=f;if(n&&a.length){f=[];var b;for(b=0;b<a.length;b+=1)a[b](e)}}}function i(a){n?a(e):f.push(a);return i}var k,m,l,j=typeof window!=="undefined"&&window.document,n=!j,e=j?document:null,f=[];if(j){if(document.addEventListener)document.addEventListener("DOMContentLoaded",c,!1),window.addEventListener("load",c,!1);else if(window.attachEvent){window.attachEvent("onload",c);m=document.createElement("div");try{k=window.frameElement===
null}catch(b){}m.doScroll&&k&&window.external&&(l=setInterval(function(){try{m.doScroll(),c()}catch(a){}},30))}document.readyState==="complete"&&c()}i.version="2.0.1";i.load=function(a,b,c,e){e.isBuild?c(null):i(c)};return i});define('built-index.js',["orion/browserCompatibility","orion/bootstrap","domReady!"],function(c,i){i.startup().then(function(){window.location="navigate/table.html"})});