/**
 * @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) 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) 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
 ******************************************************************************/

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors:
 IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

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

 Contributors: IBM Corporation - initial API and implementation

 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("domReady",[],function(){function h(){if(!c){c=!0;f&&clearInterval(f);var d=b;if(c&&d.length){b=[];var g;for(g=0;g<d.length;g+=1)d[g](a)}}}function e(d){c?d(a):b.push(d);return e}var i,g,f,d=typeof window!=="undefined"&&window.document,c=!d,a=d?document:null,b=[];if(d){if(document.addEventListener)document.addEventListener("DOMContentLoaded",h,!1),window.addEventListener("load",h,!1);else if(window.attachEvent){window.attachEvent("onload",h);g=document.createElement("div");try{i=window.frameElement===
null}catch(p){}g.doScroll&&i&&window.external&&(f=setInterval(function(){try{g.doScroll(),h()}catch(a){}},30))}document.readyState==="complete"&&h()}e.version="2.0.1";e.load=function(a,b,d,c){c.isBuild?d(null):e(d)};return e});
(function(h,e){typeof define==="function"&&define.amd?define("orion/Deferred",e):typeof exports==="object"?module.exports=e():(h.orion=h.orion||{},h.orion.Deferred=e())})(this,function(){function h(){for(var c;c=f.shift();)c();d=!1}function e(c){f.push(c);d||(d=!0,setTimeout(h,0))}function i(d){return function(){d.apply(void 0,arguments)}}function g(){function d(){for(var a;a=m.shift();){var b=a.deferred,l=n==="fulfilled"?"resolve":"reject";if(typeof a[l]==="function")try{var c=(0,a[l])(h),g=c&&(typeof c===
"object"||typeof c==="function")&&c.then;if(typeof g==="function")if(c===b.promise)b.reject(new TypeError);else{var t=c.cancel;typeof t==="function"?b._protected(f).parentCancel=t.bind(c):delete b._protected(f).parentCancel;g.call(c,i(b.resolve),i(b.reject),i(b.progress))}else b.resolve(c)}catch(e){b.reject(e)}else b[l](h)}}function a(a){delete r.parentCancel;n="rejected";h=a;m.length&&e(d)}function b(f){function p(a){return function(b){l||(l=!0,a(b))}}var l=!1;delete r.parentCancel;try{var u=f&&
(typeof f==="object"||typeof f==="function")&&f.then;if(typeof u==="function")if(f===k)a(new TypeError);else{n="assumed";var i=f&&f.cancel;if(typeof i!=="function"){var t=new g,f=t.promise;try{u(t.resolve,t.reject,t.progress)}catch(C){t.reject(C)}i=f.cancel;u=f.then}h=f;u.call(f,p(b),p(a));r.parentCancel=i.bind(f)}else n="fulfilled",h=f,m.length&&e(d)}catch(w){p(a)(w)}}function p(){var b=r.parentCancel;if(b)delete r.parentCancel,b();else if(!n)b=Error("Cancel"),b.name="Cancel",a(b)}var h,n,m=[],k=
this,r={};Object.defineProperty(this,"_protected",{value:function(a){if(a!==f)throw Error("protected");return r}});this.resolve=function(a){n||b(a);return k};this.reject=function(b){n||a(b);return k};this.progress=function(a){n||m.forEach(function(b){if(b.progress)try{b.progress(a)}catch(l){}});return k.promise};this.cancel=function(){r.parentCancel?setTimeout(p,0):p();return k};this.then=function(a,b,l){a={resolve:a,reject:b,progress:l,deferred:new g};m.push(a);a.deferred._protected(f).parentCancel=
k.promise.cancel.bind(k);(n==="fulfilled"||n==="rejected")&&e(d);return a.deferred.promise};this.promise={then:k.then,cancel:k.cancel}}var f=[],d=!1;g.all=function(d,a){function b(a,b){i||(h[a]=b,--e===0&&k.resolve(h))}function f(d,c){if(!i){if(a)try{b(d,a(c));return}catch(g){c=g}k.reject(c)}}var e=d.length,h=[],i=!1,k=new g;k.then(void 0,function(){i=!0;d.forEach(function(a){a.cancel&&a.cancel()})});e===0?k.resolve(h):d.forEach(function(a,d){a.then(b.bind(void 0,d),f.bind(void 0,d))});return k.promise};
g.when=function(d,a,b,f){var e;if(!(d&&typeof d.then==="function"))e=new g,e.resolve(d),d=e.promise;return d.then(a,b,f)};return g});
define("orion/xhr",["orion/Deferred"],function(h){function e(e,g,f,d){var c=typeof f.response!=="undefined"?f.response:f.responseText,a;try{a=f.status}catch(b){a=0}e={args:g,response:c,responseText:typeof c==="string"?c:null,status:a,url:e,xhr:f};if(typeof d!=="undefined")e.error=d;return e}return function(i,g,f){var f=f||{},d=arguments.length>3&&arguments[3]?arguments[3]:new XMLHttpRequest,c=new h,a=f.headers||{},b=f.log||!1,p;typeof a["X-Requested-With"]==="undefined"&&(a["X-Requested-With"]="XMLHttpRequest");
if(typeof f.data!=="undefined"&&(i==="POST"||i==="PUT"))p=f.data;var s=!1,n=!1;c.promise.then(void 0,function(a){s=!0;!n&&a instanceof Error&&a.name==="Cancel"&&d.abort()});d.onabort=function(){n=!0;if(!s){var a=Error("Cancel");a.name="Cancel";c.reject(a)}};d.onload=function(){var a=e(g,f,d);200<=d.status&&d.status<400?c.resolve(a):(c.reject(a),b&&typeof console!=="undefined"&&console.log(Error(d.statusText)))};d.onerror=function(){var a=e(g,f,d);c.reject(a);b&&typeof console!=="undefined"&&console.log(Error(d.statusText))};
d.onprogress=function(a){a.xhr=d;c.progress(a)};try{d.open(i,g,!0);if(typeof f.responseType==="string")d.responseType=f.responseType;if(typeof f.timeout==="number")if(typeof d.timeout==="number")d.timeout=f.timeout,d.addEventListener("timeout",function(){c.reject(e(g,f,d,"Timeout exceeded"))});else{var m=setTimeout(function(){c.reject(e(g,f,d,"Timeout exceeded"))},f.timeout);c.promise.then(clearTimeout.bind(null,m),clearTimeout.bind(null,m))}Object.keys(a).forEach(function(b){d.setRequestHeader(b,
a[b])});d.send(p||null)}catch(k){c.reject(e(g,f,d,k))}return c.promise}});
define("orion/PageUtil",[],function(){var h=/^http[s]?/i;return{hash:function(){var e=window.location.href.split("#")[1];return e?"#"+e:""},matchResourceParameters:function(e){var e=e||window.location.toString(),h={resource:""},g=e.indexOf("#");if(g!==-1&&(e=e.substring(g+1),e.length!==0)){e=e.split(",");h.resource=decodeURIComponent(e[0]);for(g=1;g<e.length;g++){var f=/([^=]*)(=?)(.*)/.exec(e[g]),d=decodeURIComponent(f[1]||""),f=decodeURIComponent(f[3]||"");d!==""&&d!=="resource"&&(h[d]=f)}}return h},
validateURLScheme:function(e,i){var g=e;if(e.indexOf("://")===-1){var f=document.createElement("a");f.href=e;g=f.href}f=!1;return(f=i?i.some(function(d){return RegExp("^"+d+":","i").test(g)}):h.test(g))?e:(console.log("Illegal URL Scheme: '"+e+"'"),"")}}});
define("orion/util",[],function(){var h=navigator.userAgent,e=h.indexOf("MSIE")!==-1||h.indexOf("Trident")!==-1?document.documentMode:void 0,i=parseFloat(h.split("Firefox/")[1]||h.split("Minefield/")[1])||void 0,g=h.indexOf("Opera")!==-1,f=parseFloat(h.split("Chrome/")[1])||void 0,d=h.indexOf("Safari")!==-1&&!f,c=parseFloat(h.split("WebKit/")[1])||void 0,a=h.indexOf("Android")!==-1,b=h.indexOf("iPad")!==-1,h=h.indexOf("iPhone")!==-1,p=b||h,s=navigator.platform.indexOf("Mac")!==-1,n=navigator.platform.indexOf("Win")!==
-1,m=navigator.platform.indexOf("Linux")!==-1;return{formatMessage:function(a){var b=arguments;return a.replace(/\$\{([^\}]+)\}/g,function(a,d){return b[(d<<0)+1]})},createElement:function(a,b){return a.createElementNS?a.createElementNS("http://www.w3.org/1999/xhtml",b):a.createElement(b)},isIE:e,isFirefox:i,isOpera:g,isChrome:f,isSafari:d,isWebkit:c,isAndroid:a,isIPad:b,isIPhone:h,isIOS:p,isMac:s,isWindows:n,isLinux:m,platformDelimiter:n?"\r\n":"\n"}});
define("orion/webui/littlelib",["orion/util"],function(h){function e(a,b){b||(b=document);return b.querySelectorAll(a)}function i(a){if(a.tabIndex>=0)return a;if(a.hasChildNodes())for(var b=0;b<a.childNodes.length;b++){var d=i(a.childNodes[b]);if(d)return d}return null}function g(a){if(a.tabIndex>=0)return a;if(a.hasChildNodes())for(var b=a.childNodes.length-1;b>=0;b--){var d=g(a.childNodes[b]);if(d)return d}return null}function f(a,b){if(a.nodeType===3){var c=d.exec(a.nodeValue);c&&c.length>1&&b(a,
c)}if(a.hasChildNodes())for(c=0;c<a.childNodes.length;c++)f(a.childNodes[c],b)}var d=/\$\{([^\}]+)\}/,c=null;return{$:function(a,b){b||(b=document);return b.querySelector(a)},$$:e,$$array:function(a,b){return Array.prototype.slice.call(e(a,b))},node:function(a){var b=a;typeof a==="string"&&(b=document.getElementById(a));return b},contains:function(a,b){if(!a||!b)return!1;if(a===b)return!0;var d=a.compareDocumentPosition(b);return Boolean(d&16)},bounds:function(a){a=a.getBoundingClientRect();return{left:a.left+
document.body.scrollLeft,top:a.top+document.body.scrollTop,width:a.width,height:a.height}},empty:function(a){for(;a.hasChildNodes();)a.removeChild(a.firstChild)},firstTabbable:i,lastTabbable:g,stop:function(a){if(window.document.all)a.keyCode=0;a.preventDefault&&(a.preventDefault(),a.stopPropagation())},processTextNodes:function(a,b){f(a,function(a,d){a.parentNode.replaceChild(document.createTextNode(b[d[1]]||d[1]),a)})},processDOMNodes:function(a,b){f(a,function(a,d){var f=b[d[1]];if(f){var c=document.createRange(),
e=d.index;c.setStart(a,e);c.setEnd(a,e+d[0].length);c.deleteContents();c.insertNode(f)}})},addAutoDismiss:function(a,b){function d(a){c.forEach(function(d){var b=!1,f=d.excludeNodes.some(function(d){return document.body.contains(d)?(b=!0,d.contains(a.target)):!1});if(b&&!f)try{d.dismiss()}catch(c){typeof console!=="undefined"&&console&&console.error(c&&c.message)}});c=c.filter(function(a){return a.excludeNodes.some(function(a){return document.body.contains(a)})})}c===null&&(c=[],document.addEventListener("click",
d,!0),h.isIOS&&document.addEventListener("touchend",function(a){function d(){a.target.removeEventListener("click",d)}a.touches.length===0&&a.target.addEventListener("click",d)},!1));c.push({excludeNodes:a,dismiss:b})},KEY:{BKSPC:8,TAB:9,ENTER:13,ESCAPE:27,SPACE:32,PAGEUP:33,PAGEDOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,INSERT:45,DEL:46}}});
(function(){var h=function(){function a(d){return Array.isArray?Array.isArray(d):d.constructor.toString().indexOf("Array")!=-1}function d(a,b,l,f){function e(b){for(var d=0;d<b.length;d++)if(b[d].win===a)return!0;return!1}var g=!1;if(b==="*")for(var j in c){if(c.hasOwnProperty(j)&&j!=="*"&&typeof c[j][l]=="object"&&(g=e(c[j][l])))break}else c["*"]&&c["*"][l]&&(g=e(c["*"][l])),!g&&c[b]&&c[b][l]&&(g=e(c[b][l]));if(g)throw"A channel is already bound to the same window which overlaps with origin '"+b+
"' and has scope '"+l+"'";typeof c[b]!="object"&&(c[b]={});typeof c[b][l]!="object"&&(c[b][l]=[]);c[b][l].push({win:a,handler:f})}var b=Math.floor(Math.random()*1000001),c={},f={},e=function(a){try{var b=JSON.parse(a.data);if(typeof b!="object"||b===null)throw"malformed";}catch(d){return}var l=a.source,a=a.origin,e,g,j;if(typeof b.method=="string"){var o=b.method.split("::");o.length==2?(e=o[0],j=o[1]):j=b.method}typeof b.id!="undefined"&&(g=b.id);if(typeof j=="string"){g=!1;if(c[a]&&c[a][e])for(o=
0;o<c[a][e].length;o++)if(c[a][e][o].win===l){c[a][e][o].handler(a,j,b);g=!0;break}if(!g&&c["*"]&&c["*"][e])for(o=0;o<c["*"][e].length;o++)if(c["*"][e][o].win===l){c["*"][e][o].handler(a,j,b);break}}else typeof g!="undefined"&&f[g]&&f[g](a,j,b)};window.addEventListener?window.addEventListener("message",e,!1):window.attachEvent&&window.attachEvent("onmessage",e);return{build:function(e){var g=function(a){if(e.debugOutput&&window.console&&window.console.log){try{typeof a!="string"&&(a=JSON.stringify(a))}catch(b){}console.log("["+
i+"] "+a)}};if(!window.postMessage)throw"jschannel cannot run this browser, no postMessage";if(!window.JSON||!window.JSON.stringify||!window.JSON.parse)throw"jschannel cannot run this browser, no JSON parsing/serialization";if(typeof e!="object")throw"Channel build invoked without a proper object argument";if(!e.window||!e.window.postMessage)throw"Channel.build() called without a valid window argument";if(window===e.window)throw"target window is same as present window -- not allowed";var h=!1;if(typeof e.origin==
"string"){var w;e.origin==="*"?h=!0:null!==(w=e.origin.match(/^https?:\/\/(?:[-a-zA-Z0-9_\.])+(?::\d+)?/))&&(e.origin=w[0].toLowerCase(),h=!0)}if(!h)throw"Channel.build() called with an invalid origin";if(typeof e.scope!="undefined"){if(typeof e.scope!="string")throw"scope, when specified, must be a string";if(e.scope.split("::").length>1)throw"scope may not contain double colons: '::'";}var i=function(){for(var a="",b=0;b<5;b++)a+="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789".charAt(Math.floor(Math.random()*
62));return a}(),k={},j={},o={},v=!1,B=[],n=function(a,b,d){var e=!1,j=!1;return{origin:b,invoke:function(b,e){if(!o[a])throw"attempting to invoke a callback of a nonexistent transaction: "+a;for(var j=!1,c=0;c<d.length;c++)if(b===d[c]){j=!0;break}if(!j)throw"request supports no such callback '"+b+"'";r({id:a,callback:b,params:e})},error:function(b,d){j=!0;if(!o[a])throw"error called for nonexistent message: "+a;delete o[a];r({id:a,error:b,message:d})},complete:function(b){j=!0;if(!o[a])throw"complete called for nonexistent message: "+
a;delete o[a];r({id:a,result:b})},delayReturn:function(a){typeof a=="boolean"&&(e=a===!0);return e},completed:function(){return j}}},G=function(a,b,d){return window.setTimeout(function(){j[a]&&((0,j[a].error)("timeout_error","timeout ("+b+"ms) exceeded on method '"+d+"'"),delete j[a],delete f[a])},b)},m=function(b,d,c){if(typeof e.gotMessageObserver=="function")try{e.gotMessageObserver(b,c)}catch(B){g("gotMessageObserver() raised an exception: "+B.toString())}if(c.id&&d){if(k[d]){var h=n(c.id,b,c.callbacks?
c.callbacks:[]);o[c.id]={};try{if(c.callbacks&&a(c.callbacks)&&c.callbacks.length>0)for(b=0;b<c.callbacks.length;b++){for(var w=c.callbacks[b],i=c.params,u=w.split("/"),v=0;v<u.length-1;v++){var t=u[v];typeof i[t]!="object"&&(i[t]={});i=i[t]}i[u[u.length-1]]=function(){var a=w;return function(b){return h.invoke(a,b)}}()}var m=k[d](h,c.params);!h.delayReturn()&&!h.completed()&&h.complete(m)}catch(q){d="runtime_error";c=null;typeof q=="string"?c=q:typeof q=="object"&&(q&&a(q)&&q.length==2?(d=q[0],c=
q[1]):typeof q.error=="string"&&(d=q.error,q.message?typeof q.message=="string"?c=q.message:q=q.message:c=""));if(c===null)try{c=JSON.stringify(q),typeof c=="undefined"&&(c=q.toString())}catch(G){c=q.toString()}h.error(d,c)}}}else c.id&&c.callback?!j[c.id]||!j[c.id].callbacks||!j[c.id].callbacks[c.callback]?g("ignoring invalid callback, id:"+c.id+" ("+c.callback+")"):j[c.id].callbacks[c.callback](c.params):c.id?j[c.id]?(c.error?(0,j[c.id].error)(c.error,c.message):c.result!==void 0?(0,j[c.id].success)(c.result):
(0,j[c.id].success)(),delete j[c.id],delete f[c.id]):g("ignoring invalid response: "+c.id):d&&k[d]&&k[d](null,c.params)};d(e.window,e.origin,typeof e.scope=="string"?e.scope:"",m);var p=function(a){typeof e.scope=="string"&&e.scope.length&&(a=[e.scope,a].join("::"));return a},r=function(a,b){if(!a)throw"postMessage called with null message";g((v?"post  ":"queue ")+" message: "+JSON.stringify(a));if(!b&&!v)B.push(a);else{if(typeof e.postMessageObserver=="function")try{e.postMessageObserver(e.origin,
a)}catch(c){g("postMessageObserver() raised an exception: "+c.toString())}e.window.postMessage(JSON.stringify(a),e.origin)}},s={unbind:function(a){if(k[a]){if(delete k[a])return!0;throw"can't delete method: "+a;}return!1},bind:function(a,b){if(!a||typeof a!="string")throw"'method' argument to bind must be string";if(!b||typeof b!="function")throw"callback missing from bind params";if(k[a])throw"method '"+a+"' is already bound!";k[a]=b;return this},call:function(a){if(!a)throw"missing arguments to call function";
if(!a.method||typeof a.method!="string")throw"'method' argument to call must be string";if(!a.success||typeof a.success!="function")throw"'success' callback missing from call";var c={},d=[],e=function(a,b){if(typeof b=="object")for(var j in b)if(b.hasOwnProperty(j)){var l=a+(a.length?"/":"")+j;typeof b[j]=="function"?(c[l]=b[j],d.push(l),delete b[j]):typeof b[j]=="object"&&e(l,b[j])}};e("",a.params);var l={id:b,method:p(a.method),params:a.params};d.length&&(l.callbacks=d);a.timeout&&G(b,a.timeout,
p(a.method));j[b]={callbacks:c,error:a.error,success:a.success};f[b]=m;b++;r(l)},notify:function(a){if(!a)throw"missing arguments to notify function";if(!a.method||typeof a.method!="string")throw"'method' argument to notify must be string";r({method:p(a.method),params:a.params})},destroy:function(){for(var a=e.window,b=e.origin,d=typeof e.scope=="string"?e.scope:"",l=c[b][d],f=0;f<l.length;f++)l[f].win===a&&l.splice(f,1);c[b][d].length===0&&delete c[b][d];window.removeEventListener?window.removeEventListener("message",
m,!1):window.detachEvent&&window.detachEvent("onmessage",m);v=!1;k={};o={};j={};e.origin=null;B=[];g("channel destroyed");i=""}};s.bind("__ready",function(a,b){g("ready msg received");if(v)throw"received ready message while in ready state.  help!";for(b==="ping"?i+="-R":i+="-L",s.unbind("__ready"),v=!0,g("ready msg accepted."),b==="ping"&&s.notify({method:"__ready",params:"pong"});B.length;)r(B.pop());typeof e.onReady=="function"&&e.onReady(s)});setTimeout(function(){},0);return s}}}();WinChan=function(){function a(b){/^https?:\/\//.test(b)||
(b=window.location.href);var c=/^(https?:\/\/[\-_a-zA-Z\.0-9:]+)/.exec(b);return c?c[1]:b}function b(){try{var a=navigator.userAgent;return a.indexOf("Fennec/")!=-1||a.indexOf("Firefox/")!=-1&&a.indexOf("Android")!=-1}catch(c){}return!1}function c(a,b,d){a.attachEvent?a.attachEvent("on"+b,d):a.addEventListener&&a.addEventListener(b,d,!1)}var d="die",e=function(){var a=-1;navigator.appName==="Microsoft Internet Explorer"&&/MSIE ([0-9]{1,}[.0-9]{0,})/.exec(navigator.userAgent)!=null&&(a=parseFloat(RegExp.$1));
return a>=8}();return window.JSON&&window.JSON.stringify&&window.JSON.parse&&window.postMessage?{open:function(f,g){function h(a){try{var b=JSON.parse(a.data);if(b.a==="ready")j.postMessage(v,n);else if(b.a==="error")g&&(g(b.d),g=null);else if(b.a==="response"){var a=window,c=h;a.detachEvent?a.detachEvent("onmessage",c):a.removeEventListener&&a.removeEventListener("message",c,!1);a=window;c=i;a.detachEvent?a.detachEvent("onunload",c):a.removeEventListener&&a.removeEventListener("unload",c,!1);i();
g&&(g(null,b.d),g=null)}}catch(d){}}function i(){m&&document.body.removeChild(m);m=void 0;if(o)try{o.close()}catch(a){j.postMessage(d,n)}o=j=void 0}if(!g)throw"missing required callback argument";var k;f.url||(k="missing required 'url' parameter");f.relay_url||(k="missing required 'relay_url' parameter");k&&setTimeout(function(){g(k)},0);f.window_name||(f.window_name=null);if(!f.window_features||b())f.window_features=void 0;var m,n=a(f.url);if(n!==a(f.relay_url))return setTimeout(function(){g("invalid arguments: origin of url and relay_url must match")},
0);var j;e&&(m=document.createElement("iframe"),m.setAttribute("src",f.relay_url),m.style.display="none",m.setAttribute("name","__winchan_relay_frame"),document.body.appendChild(m),j=m.contentWindow);var o=window.open(f.url,f.window_name,f.window_features);j||(j=o);var v=JSON.stringify({a:"request",d:f.params});c(window,"unload",i);c(window,"message",h);return{close:i,focus:function(){if(o)try{o.focus()}catch(a){}}}}}:{open:function(a,b,c,d){setTimeout(function(){d("unsupported browser")},0)}}}();
var e=function(){var a=window,b=navigator,c;return{setTestEnv:function(c,d){b=c;a=d},isSupported:function(){var d;var e;e=-1;b.appName=="Microsoft Internet Explorer"&&/MSIE ([0-9]{1,}[.0-9]{0,})/.exec(b.userAgent)!=null&&(e=parseFloat(RegExp.$1));e>-1&&e<8&&(d="BAD_IE_VERSION");if(!d){var f;try{"localStorage"in a&&a.localStorage!==null?(a.localStorage.setItem("test","true"),a.localStorage.removeItem("test")):f="LOCALSTORAGE_NOT_SUPPORTED"}catch(g){f="LOCALSTORAGE_DISABLED"}if(!f){var h;a.postMessage||
(h="POSTMESSAGE_NOT_SUPPORTED");h||(h=!window.JSON||!window.JSON.stringify||!window.JSON.parse?"JSON_NOT_SUPPORTED":void 0);f=h}d=f}c=d;return!c},getNoSupportReason:function(){return c}}}();navigator.id||(navigator.id={});if(!navigator.id.request||navigator.id._shimmed){var i=navigator.userAgent,g=i.indexOf("Fennec/")!=-1||i.indexOf("Firefox/")!=-1&&i.indexOf("Android")!=-1?void 0:"menubar=0,location=1,resizable=1,scrollbars=1,status=0,dialog=1,minimizable=1,width=700,height=375",f,d={login:null,
logout:null,ready:null},c=void 0,a=function(a){if(c===void 0)c=a;else if(c!=a)throw"you cannot combine the navigator.id.watch() API with navigator.id.getVerifiedEmail() or navigator.id.get()this site should instead use navigator.id.request() and navigator.id.watch()";},b,p=e.isSupported(),s=function(){if(p)try{if(!b){var a=window.document,c=a.createElement("iframe");c.style.display="none";a.body.appendChild(c);c.src="https://login.persona.org/communication_iframe";b=h.build({window:c.contentWindow,
origin:"https://login.persona.org",scope:"mozid_ni",onReady:function(){b.call({method:"loaded",success:function(){d.ready&&d.ready()},error:function(){}})}});b.bind("logout",function(){d.logout&&d.logout()});b.bind("login",function(a,b){d.login&&d.login(b)})}}catch(e){b=void 0}},n=function(a){return typeof a!="undefined"},m=function(a){try{console.warn(a)}catch(b){}},k=function(a,b){if(n(a[b]))return m(b+" has been deprecated"),!0},r=function(a,b,c){if(n(a[b])&&n(a[c]))throw"you cannot supply *both* "+
b+" and "+c;k(a,b)&&(a[c]=a[b],delete a[b])},x=function(a){if(typeof a=="object"){if(a.onlogin&&typeof a.onlogin!="function"||a.onlogout&&typeof a.onlogout!="function"||a.onready&&typeof a.onready!="function")throw"non-function where function expected in parameters to navigator.id.watch()";if(!a.onlogin)throw"'onlogin' is a required argument to navigator.id.watch()";if(!a.onlogout)throw"'onlogout' is a required argument to navigator.id.watch()";d.login=a.onlogin||null;d.logout=a.onlogout||null;d.ready=
a.onready||null;s();r(a,"loggedInEmail","loggedInUser");typeof a.loggedInUser!="undefined"&&b&&b.notify({method:"loggedInUser",params:a.loggedInUser})}},z=function(a){k(a,"requiredEmail");r(a,"tosURL","termsOfService");r(a,"privacyURL","privacyPolicy");a.termsOfService&&!a.privacyPolicy&&m("termsOfService ignored unless privacyPolicy also defined");a.privacyPolicy&&!a.termsOfService&&m("privacyPolicy ignored unless termsOfService also defined");if(f)try{f.focus()}catch(c){}else if(e.isSupported())b&&
b.notify({method:"dialog_running"}),f=WinChan.open({url:"https://login.persona.org/sign_in",relay_url:"https://login.persona.org/relay",window_features:g,window_name:"__persona_dialog",params:{method:"get",params:a}},function(c,e){b&&(!c&&e&&e.email&&b.notify({method:"loggedInUser",params:e.email}),b.notify({method:"dialog_complete"}));f=void 0;if(!c&&e&&e.assertion)try{d.login&&d.login(e.assertion)}catch(g){}if(c==="client closed window"||!e)a&&a.oncancel&&a.oncancel(),delete a.oncancel});else{var h=
"unsupported_dialog";e.getNoSupportReason()==="LOCALSTORAGE_DISABLED"&&(h="cookies_disabled");f=window.open("https://login.persona.org/"+h,null,g)}};navigator.id={request:function(b){if(this!=navigator.id)throw Error("all navigator.id calls must be made on the navigator.id object");b=b||{};a(!1);b.returnTo||(b.returnTo=document.location.pathname);return z(b)},watch:function(b){if(this!=navigator.id)throw Error("all navigator.id calls must be made on the navigator.id object");a(!1);x(b)},logout:function(a){if(this!=
navigator.id)throw Error("all navigator.id calls must be made on the navigator.id object");s();b&&b.notify({method:"logout"});typeof a=="function"&&setTimeout(a,0)},get:function(b,c){var e={};c=c||{};e.privacyPolicy=c.privacyPolicy||void 0;e.termsOfService=c.termsOfService||void 0;e.privacyURL=c.privacyURL||void 0;e.tosURL=c.tosURL||void 0;k(c,"silent")?b&&setTimeout(function(){b(null)},0):(a(!0),x({onlogin:function(a){b&&(b(a),b=null)},onlogout:function(){}}),e.oncancel=function(){b&&(b(null),b=
null);d.login=d.logout=d.ready=null},z(e))},getVerifiedEmail:function(b){m("navigator.id.getVerifiedEmail has been deprecated");a(!0);navigator.id.get(b)},_shimmed:!0}}})();define("persona/include",function(){});
define('built-LoginWindow.js',["domReady","orion/xhr","orion/PageUtil","orion/webui/littlelib","persona/include"],function(h,e,i,g){function f(a){a=RegExp("[\\?&]"+a+"=([^&#]*)").exec(window.location.href);return a===null?void 0:a[1]}function d(a){for(var b="",c,d,e,f,g,h=0,a=a.replace(/[^A-Za-z0-9\+\/\=]/g,"");h<a.length;)c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(a.charAt(h++)),d="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(a.charAt(h++)),
f="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(a.charAt(h++)),g="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(a.charAt(h++)),c=c<<2|d>>4,d=(d&15)<<4|f>>2,e=(f&3)<<6|g,b+=String.fromCharCode(c),f!==64&&(b+=String.fromCharCode(d)),g!==64&&(b+=String.fromCharCode(e));b=b.replace(/\r\n/g,"\n");a="";for(f=0;f<b.length;f++)g=b.charCodeAt(f),g<128?a+=String.fromCharCode(g):(g>127&&g<2048?a+=String.fromCharCode(g>>6|192):(a+=String.fromCharCode(g>>
12|224),a+=String.fromCharCode(g>>6&63|128)),a+=String.fromCharCode(g&63|128));return a}function c(a){if(typeof a!=="undefined")document.getElementById("errorMessage").textContent=a;document.getElementById("errorWin").style.visibility=""}function a(){document.getElementById("errorMessage").textContent="\u00a0";document.getElementById("errorWin").style.visibility="hidden"}function b(){var b;if(document.getElementById("reset").value===""&&document.getElementById("resetEmail").value==="")c("Provide username or email to reset.");
else{var d=new XMLHttpRequest;d.onreadystatechange=function(){a();if(d.readyState===4)if(d.status===200)b=JSON.parse(d.responseText),b.Message?c(b.Message):c();else{try{if(b=JSON.parse(d.responseText),b.Message){c(b.Message);return}}catch(e){}c(d.statusText)}};d.open("POST","../useremailconfirmation",!0);d.setRequestHeader("Content-type","application/x-www-form-urlencoded");d.setRequestHeader("Orion-Version","1");d.send("{login='"+document.getElementById("reset").value+"', email='"+document.getElementById("resetEmail").value+
"'}");c("Sending password reset confirmation...")}}function p(){var a=/[\?&]redirect=([^&#]*)/.exec(window.location.href);return a===null?null:a[1]}function s(){var a=p();if(a!==null&&(a=decodeURIComponent(a),i.validateURLScheme(a))){window.location=a;return}window.close()}function n(a){if(a!==""&&a!==null){var b=p();return b!==null&&i.validateURLScheme(decodeURIComponent(b))?"../login/openid?openid="+encodeURIComponent(a)+"&redirect="+b:"../login/openid?openid="+encodeURIComponent(a)}}function m(a){var b=
!1;if(a.type==="click"||a.keyCode===13)b=!0;a.stopPropagation();return b}function k(a){m(a)&&(F=!0,navigator.id.request())}function r(){navigator.id.watch({loggedInUser:null,onlogin:function(a){F&&e("POST","../login/persona",{headers:{"Content-type":"application/x-www-form-urlencoded","Orion-Version":"1"},data:"assertion="+encodeURIComponent(a)}).then(function(){s()},function(a){c(JSON.parse(a.responseText).error)})},onlogout:function(){}})}function x(a,b){if(!a)a=document.getElementById("login").value,
b=document.getElementById("password").value;if(a.length>0&&b.length>0){var d=new XMLHttpRequest;d.onreadystatechange=function(){if(d.readyState===4)if(d.status!==200&&window.location.href.indexOf("http")!==-1){var a=JSON.parse(d.responseText);c(a.error)}else s()};var e="login="+encodeURIComponent(a)+"&password="+encodeURIComponent(b);d.open("POST","../login/form",!0);d.setRequestHeader("Content-type","application/x-www-form-urlencoded");d.setRequestHeader("Orion-Version","1");d.send(e)}}function z(){if(document.getElementById("create_password").value!==
document.getElementById("create_passwordRetype").value)return c("Passwords don't match!"),!1;a();return!0}function l(){document.getElementById("newUserHeaderShown").style.visibility="hidden";document.getElementById("orionOpen").style.visibility="";if(A||y)document.getElementById("orionRegister").style.visibility="";document.getElementById("registerButton").focus()}function u(){if(z()){document.getElementById("create_password").setAttribute("aria-invalid","false");document.getElementById("create_passwordRetype").setAttribute("aria-invalid",
"false");var a=new XMLHttpRequest,b=document.getElementById("create_login").value,d=document.getElementById("create_password").value,e=document.getElementById("create_email").value;a.onreadystatechange=function(){if(a.readyState===4)if(a.status!==200&&window.location.href.indexOf("http")!==-1){if(a.responseText){var e=JSON.parse(a.responseText);c(e.Message);a.status===201&&l()}}else x(b,d)};e="login="+encodeURIComponent(b)+"&password="+encodeURIComponent(d)+"&email="+encodeURIComponent(e);a.open("POST",
"../users",!0);a.setRequestHeader("Content-type","application/x-www-form-urlencoded");a.setRequestHeader("Orion-Version","1");a.send(e)}else document.getElementById("create_password").setAttribute("aria-invalid","true"),document.getElementById("create_passwordRetype").setAttribute("aria-invalid","true")}function q(a){if(m(a))!A&&y?window.open(y):(document.getElementById("orionOpen").style.visibility="hidden",document.getElementById("orionRegister").style.visibility="hidden",document.getElementById("orionLoginForm").style.visibility=
"hidden",document.getElementById("orionRegister").style.visibility="hidden",document.getElementById("newUserHeaderShown").style.visibility="",document.getElementById("create_login").focus())}function t(){document.getElementById("orionLoginForm").style.visibility="hidden";if(!A&&!y)document.getElementById("orionRegister").style.visibility="hidden",document.getElementById("orionReset").style.height="212px";document.getElementById("newUserHeaderShown").style.display="none";document.getElementById("orionReset").style.visibility=
"";document.getElementById("reset").focus()}function C(){document.getElementById("orionLoginForm").style.visibility="";document.getElementById("newUserHeaderShown").style.display="";document.getElementById("orionReset").style.visibility="hidden"}function w(a){if(m(a))a.stopPropagation(),document.getElementById("orionOpen").style.visibility="hidden",document.getElementById("orionRegister").style.visibility="hidden",document.getElementById("orionLoginForm").style.visibility="",document.getElementById("login").focus()}
function D(){document.getElementById("orionLoginForm").style.visibility="hidden";document.getElementById("orionOpen").style.visibility="";if(A||y)document.getElementById("orionRegister").style.visibility="";document.getElementById("orionLogin").focus();a()}function H(a){m(a)&&a.srcElement.click()}var A,y,E,F=!1;h(function(){r(document.getElementById("personaLogin"));var a=f("error");a&&(a=d(a),c(a));var h=new XMLHttpRequest;h.onreadystatechange=function(){if(h.readyState===4&&h.status===200){var a=
JSON.parse(h.responseText);A=a.CanAddUsers;E=a.ForceEmail;document.getElementById("create_email").setAttribute("aria-required",E);y=a.RegistrationURI;if(!A&&!y)document.getElementById("orionRegister").style.visibility="hidden";document.getElementById("login-window").style.display="";document.getElementById("orionLogin").focus()}};h.open("POST","../login/canaddusers",!0);h.setRequestHeader("Content-type","application/x-www-form-urlencoded");h.setRequestHeader("Orion-Version","1");h.send();var i=new XMLHttpRequest;
i.onreadystatechange=function(){if(i.readyState===4&&i.status===200&&JSON.parse(i.responseText).emailConfigured===!1)document.getElementById("resetUserLink").style.display="none"};i.open("POST","../useremailconfirmation/cansendemails",!0);i.setRequestHeader("Content-type","application/x-www-form-urlencoded");i.setRequestHeader("Orion-Version","1");i.send();e("GET","../server-status.json",{timeout:15E3}).then(function(a){a=JSON.parse(a.response).messages;if(a.length>0){var b=new Date,c=new Date(a[0].startdate);
c.setHours(0,0,0,0);if(!(c>b)&&(c=new Date(a[0].enddate),c.setHours(23,59,59),!(c<=b)))document.getElementById("orionInfoArea").style.visibility="",document.getElementById("orionInfoMessage").textContent=a[0].title}},function(){});document.getElementById("login").addEventListener("keypress",function(a){a.keyCode===g.KEY.ENTER&&(x(),g.stop(a))});document.getElementById("password").addEventListener("keypress",function(a){a.keyCode===g.KEY.ENTER&&(x(),g.stop(a))});document.getElementById("loginButton").addEventListener("click",
function(){x()});document.getElementById("orionLoginForm").addEventListener("keyup",function(a){a.keyCode===g.KEY.ESCAPE&&(D(),g.stop(a))});document.getElementById("resetUserLink").addEventListener("click",t);document.getElementById("reset").addEventListener("keypress",function(a){a.keyCode===g.KEY.ENTER&&(b(),g.stop(a))});document.getElementById("resetEmail").addEventListener("keypress",function(a){a.keyCode===g.KEY.ENTER&&(b(),g.stop(a))});document.getElementById("registerButton").addEventListener("click",
q);document.getElementById("registerButton").addEventListener("keydown",q);document.getElementById("create_password").addEventListener("keyup",function(a){a.keyCode===g.KEY.ENTER?u():z()});document.getElementById("create_passwordRetype").addEventListener("keyup",function(a){a.keyCode===g.KEY.ENTER?u():z()});document.getElementById("newUserHeaderShown").addEventListener("keyup",function(a){a.keyCode===g.KEY.ESCAPE&&l()});document.getElementById("createButton").addEventListener("click",u);document.getElementById("cancelLoginButton").addEventListener("click",
D);document.getElementById("newUserHeaderShown").onkeyup=function(a){a.keyCode===g.KEY.ESCAPE&&l()};document.getElementById("hideRegisterButton").addEventListener("click",l);document.getElementById("googleLoginLink").href=n("https://www.google.com/accounts/o8/id");document.getElementById("googleLogin").addEventListener("keydown",H);document.getElementById("orionLoginLink").addEventListener("click",w);document.getElementById("orionLogin").onkeydown=w;document.getElementById("personaLogin").onclick=
k;document.getElementById("personaLogin").onkeydown=k;document.getElementById("cancelResetButton").onclick=C;document.getElementById("sendResetButton").onclick=b})});