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