/**
 * @license RequireJS domReady 1.0.0 Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved.
 * Available via the MIT or new BSD license.
 * see: http://github.com/jrburke/requirejs 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 1.0.0 Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved.
 Available via the MIT or new BSD license.
 see: http://github.com/jrburke/requirejs 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) 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 k(c){for(var g=0,d;d=c[g];g++)d(f)}function h(){var d=e,b=g;c&&(d.length&&(e=[],k(d)),v.resourcesDone&&b.length&&(g=[],k(b)))}function i(){c||(c=!0,q&&clearInterval(q),h())}function b(g){c?g(f):e.push(g);return b}var d=typeof window!=="undefined"&&window.document,c=!d,f=d?document:null,e=[],g=[],v=requirejs||require||{},w=v.resourcesReady,q;if("resourcesReady"in v)v.resourcesReady=function(c){w&&w(c);c&&h()};d&&(document.addEventListener?(document.addEventListener("DOMContentLoaded",
i,!1),window.addEventListener("load",i,!1)):window.attachEvent&&(window.attachEvent("onload",i),self===self.top&&(q=setInterval(function(){try{document.body&&(document.documentElement.doScroll("left"),i())}catch(c){}},30))),document.readyState==="complete"&&i());b.withResources=function(d){c&&v.resourcesDone?d(f):g.push(d);return b};b.version="1.0.0";b.load=function(c,g,d,f){f.isBuild?d(null):b(d)};return b});
(function(k,h){typeof define==="function"&&define.amd?define("orion/Deferred",[],h):typeof exports==="object"?module.exports=h():(k.orion=k.orion||{},k.orion.Deferred=h())})(this,function(){function k(g){if(e)b?(d.next={fn:g,next:null},d=d.next):d=b={fn:g,next:null};else{e=!0;do{for(;g;){g();if(c)b?d.next=c:b=c,d=f;b?(c=b.next,f=d,g=b.fn,b=d=null):g=null}e=!1}while(e)}}function h(c){return function(){c.apply(null,arguments)}}function i(c){function d(){for(;e;){var a=e;e=e.next;var c=a.deferred,g=
t.isResolved()?"resolve":"reject";if(a[g])try{var r=a[g](f);r&&typeof r.then==="function"?(a.cancel=r.cancel,r.then(h(c.resolve),h(c.reject),c.progress)):c.resolve(r)}catch(b){c.reject(b)}else c[g](f)}e=n=null}function b(a){if(j){if(a)throw Error("already "+j);return!0}return!1}var f,j,e,n,u=!1,t=this;this.reject=function(a,c){b(c)||(j="rejected",f=a,e&&k(d));return t.promise};this.resolve=function(a,c){b(c)||(j="resolved",f=a,e&&k(d));return t.promise};this.progress=function(a,c){if(!b(c))for(var d=
e;d;)d.progress&&d.progress(a),d=d.next;return t.promise};this.cancel=function(a,f){if(!b(f))return u=!0,c&&(a=c(a)||a),a=a||Error("canceled"),k(t.reject.bind(t,a)),a;for(var s=e;s;){if(s.canceling)return delete s.canceling,d(),s.cancel&&s.cancel(a);s=s.next}};this.then=function(a,c,g){var r={resolve:a,reject:c,progress:g,cancel:this.cancel,deferred:new i(function(a){r.canceling=!0;return r.cancel&&r.cancel(a)})};e?n.next=r:e=r;n=r;j&&k(d);return r.deferred.promise};this.isResolved=function(){return j===
"resolved"};this.isRejected=function(){return j==="rejected"};this.isFulfilled=function(){return!!j};this.isCanceled=function(){return u};this.promise={then:this.then,cancel:this.cancel,isResolved:this.isResolved,isRejected:this.isRejected,isFulfilled:this.isFulfilled,isCanceled:this.isCanceled};this.notify=this.progress;this.state=function(){return j||"pending"};this.promise.state=this.state}var b,d,c,f,e=!1;i.all=function(c,d){function b(c,d){n.isFulfilled()||(h[c]=d,--e===0&&n.resolve(h))}function f(c,
g){if(!n.isFulfilled()){if(d)try{b(c,d(g));return}catch(a){g=a}n.reject(g)}}var e=c.length,h=[],n=new i(function(d){c.forEach(function(c){c.cancel&&c.cancel(d)})});e===0?n.resolve(h):c.forEach(function(c,d){c.then(b.bind(null,d),f.bind(null,d))});return n.promise};i.when=function(c,d,b,f){var e;if(!(c&&typeof c.then==="function"))e=new i,e.resolve(c),c=e.promise;return c.then(d,b,f)};return i});
define("orion/xhr",["orion/Deferred"],function(k){function h(b){return encodeURIComponent(b).replace(/[!'()*]/g,function(d){return"%"+d.charCodeAt(0).toString(16).toUpperCase()})}function i(b,d,c,f){var e=typeof c.response!=="undefined"?c.response:c.responseText,b={args:d,response:e,responseText:typeof e==="string"?e:null,status:c.status,url:b,xhr:c};if(typeof f!=="undefined")b.error=f;return b}return function(b,d,c){var c=c||{},f=arguments.length>3&&arguments[3]?arguments[3]:new XMLHttpRequest,e=
new k,g=c.headers||{},v=c.log||!1,w,q;typeof g["X-Requested-With"]==="undefined"&&(g["X-Requested-With"]="XMLHttpRequest");if(c.query&&typeof c.query==="object"){var j=c.query,A=Object.keys(j),n=[];for(q=0;q<A.length;q++){var u=A[q],t=j[u];n.push(h(u)+"="+h(t))}n.length&&(j=d.split("#"),j[0]+=(j[0].indexOf("?")===-1?"?":"&")+n.join("&"),d=j.join("#"))}if(typeof c.data!=="undefined"&&(b==="POST"||b==="PUT"))w=c.data;if(typeof c.responseType==="string")f.responseType=c.responseType;f.onreadystatechange=
function(){if(f.readyState===4){var a=i(d,c,f),b=f.status;200<=b&&b<400?e.resolve(a):(v&&typeof console!=="undefined"&&console.log(Error(f.statusText)),e.reject(a))}};try{f.open(b,d,!0);if(typeof c.timeout==="number")typeof f.timeout==="number"?(f.timeout=c.timeout,f.addEventListener("timeout",function(){e.reject(i(d,c,f,"Timeout exceeded"))})):setTimeout(function(){e.state()!=="resolved"&&e.state()!=="rejected"&&e.reject(i(d,c,f,"Timeout exceeded"))},c.timeout);var a=Object.keys(g);for(q=0;q<a.length;q++){var x=
a[q];f.setRequestHeader(x,g[x])}f.send(w)}catch(s){e.reject(i(d,c,f,s))}return e}});
define("orion/PageUtil",[],function(){var k=/^http[s]?/i;return{matchResourceParameters:function(h){var h=h||window.location.toString(),i={resource:""},b=h.indexOf("#");if(b!==-1&&(h=h.substring(b+1),h.length!==0)){h=h.split(",");i.resource=decodeURIComponent(h[0]);for(b=1;b<h.length;b++){var d=h[b].split("="),c=decodeURIComponent(d[0]),d=d.length===2?decodeURIComponent(d[1]):null;d!==null&&c!=="resource"&&(i[c]=d)}}return i},validateURLScheme:function(h,i){var b=h;if(h.indexOf("://")===-1){var d=
document.createElement("a");d.href=h;b=d.href}d=!1;return(d=i?i.some(function(c){return RegExp("^"+c+":","i").test(b)}):k.test(b))?h:(console.log("Illegal URL Scheme: '"+h+"'"),"")}}});
(function(){var k=function(){function a(a){return Array.isArray?Array.isArray(a):a.constructor.toString().indexOf("Array")!=-1}function c(a,d,f,g){function e(l){for(var c=0;c<l.length;c++)if(l[c].win===a)return!0;return!1}var h=!1;if(d==="*")for(var m in b){if(b.hasOwnProperty(m)&&m!=="*"&&typeof b[m][f]=="object"&&(h=e(b[m][f])))break}else b["*"]&&b["*"][f]&&(h=e(b["*"][f])),!h&&b[d]&&b[d][f]&&(h=e(b[d][f]));if(h)throw"A channel is already bound to the same window which overlaps with origin '"+d+
"' and has scope '"+f+"'";typeof b[d]!="object"&&(b[d]={});typeof b[d][f]!="object"&&(b[d][f]=[]);b[d][f].push({win:a,handler:g})}var d=Math.floor(Math.random()*1000001),b={},f={},g=function(a){try{var c=JSON.parse(a.data);if(typeof c!="object"||c===null)throw"malformed";}catch(d){return}var g=a.source,a=a.origin,e,h,m;if(typeof c.method=="string"){var l=c.method.split("::");l.length==2?(e=l[0],m=l[1]):m=c.method}typeof c.id!="undefined"&&(h=c.id);if(typeof m=="string"){h=!1;if(b[a]&&b[a][e])for(l=
0;l<b[a][e].length;l++)if(b[a][e][l].win===g){b[a][e][l].handler(a,m,c);h=!0;break}if(!h&&b["*"]&&b["*"][e])for(l=0;l<b["*"][e].length;l++)if(b["*"][e][l].win===g){b["*"][e][l].handler(a,m,c);break}}else typeof h!="undefined"&&f[h]&&f[h](a,m,c)};window.addEventListener?window.addEventListener("message",g,!1):window.attachEvent&&window.attachEvent("onmessage",g);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(c){}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 m;e.origin==="*"?h=!0:null!==(m=e.origin.match(/^https?:\/\/(?:[-a-zA-Z0-9_\.])+(?::\d+)?/))&&(e.origin=m[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="",c=0;c<5;c++)a+="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789".charAt(Math.floor(Math.random()*
62));return a}(),j={},o={},l={},y=!1,z=[],K=function(a,c,e){var d=!1,b=!1;return{origin:c,invoke:function(c,d){if(!l[a])throw"attempting to invoke a callback of a nonexistent transaction: "+a;for(var b=!1,f=0;f<e.length;f++)if(c===e[f]){b=!0;break}if(!b)throw"request supports no such callback '"+c+"'";k({id:a,callback:c,params:d})},error:function(c,d){b=!0;if(!l[a])throw"error called for nonexistent message: "+a;delete l[a];k({id:a,error:c,message:d})},complete:function(c){b=!0;if(!l[a])throw"complete called for nonexistent message: "+
a;delete l[a];k({id:a,result:c})},delayReturn:function(a){typeof a=="boolean"&&(d=a===!0);return d},completed:function(){return b}}},n=function(a,c,l){return window.setTimeout(function(){o[a]&&((0,o[a].error)("timeout_error","timeout ("+c+"ms) exceeded on method '"+l+"'"),delete o[a],delete f[a])},c)},D=function(c,d,b){if(typeof e.gotMessageObserver=="function")try{e.gotMessageObserver(c,b)}catch(h){g("gotMessageObserver() raised an exception: "+h.toString())}if(b.id&&d){if(j[d]){var m=K(b.id,c,b.callbacks?
b.callbacks:[]);l[b.id]={};try{if(b.callbacks&&a(b.callbacks)&&b.callbacks.length>0)for(c=0;c<b.callbacks.length;c++){for(var y=b.callbacks[c],z=b.params,i=y.split("/"),x=0;x<i.length-1;x++){var s=i[x];typeof z[s]!="object"&&(z[s]={});z=z[s]}z[i[i.length-1]]=function(){var a=y;return function(b){return m.invoke(a,b)}}()}var r=j[d](m,b.params);!m.delayReturn()&&!m.completed()&&m.complete(r)}catch(p){d="runtime_error";b=null;typeof p=="string"?b=p:typeof p=="object"&&(p&&a(p)&&p.length==2?(d=p[0],b=
p[1]):typeof p.error=="string"&&(d=p.error,p.message?typeof p.message=="string"?b=p.message:p=p.message:b=""));if(b===null)try{b=JSON.stringify(p),typeof b=="undefined"&&(b=p.toString())}catch(k){b=p.toString()}m.error(d,b)}}}else b.id&&b.callback?!o[b.id]||!o[b.id].callbacks||!o[b.id].callbacks[b.callback]?g("ignoring invalid callback, id:"+b.id+" ("+b.callback+")"):o[b.id].callbacks[b.callback](b.params):b.id?o[b.id]?(b.error?(0,o[b.id].error)(b.error,b.message):b.result!==void 0?(0,o[b.id].success)(b.result):
(0,o[b.id].success)(),delete o[b.id],delete f[b.id]):g("ignoring invalid response: "+b.id):d&&j[d]&&j[d](null,b.params)};c(e.window,e.origin,typeof e.scope=="string"?e.scope:"",D);var E=function(a){typeof e.scope=="string"&&e.scope.length&&(a=[e.scope,a].join("::"));return a},k=function(a,b){if(!a)throw"postMessage called with null message";g((y?"post  ":"queue ")+" message: "+JSON.stringify(a));if(!b&&!y)z.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)}},p={unbind:function(a){if(j[a]){if(delete j[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(j[a])throw"method '"+a+"' is already bound!";j[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 b={},c=[],l=function(a,d){if(typeof d=="object")for(var e in d)if(d.hasOwnProperty(e)){var f=a+(a.length?"/":"")+e;typeof d[e]=="function"?(b[f]=d[e],c.push(f),delete d[e]):typeof d[e]=="object"&&l(f,d[e])}};l("",a.params);var e={id:d,method:E(a.method),params:a.params};c.length&&(e.callbacks=c);a.timeout&&n(d,a.timeout,
E(a.method));o[d]={callbacks:b,error:a.error,success:a.success};f[d]=D;d++;k(e)},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";k({method:E(a.method),params:a.params})},destroy:function(){for(var a=e.window,c=e.origin,d=typeof e.scope=="string"?e.scope:"",f=b[c][d],m=0;m<f.length;m++)f[m].win===a&&f.splice(m,1);b[c][d].length===0&&delete b[c][d];window.removeEventListener?window.removeEventListener("message",
D,!1):window.detachEvent&&window.detachEvent("onmessage",D);y=!1;j={};l={};o={};e.origin=null;z=[];g("channel destroyed");i=""}};p.bind("__ready",function(a,b){g("ready msg received");if(y)throw"received ready message while in ready state.  help!";for(b==="ping"?i+="-R":i+="-L",p.unbind("__ready"),y=!0,g("ready msg accepted."),b==="ping"&&p.notify({method:"__ready",params:"pong"});z.length;)k(z.pop());typeof e.onReady=="function"&&e.onReady(p)});setTimeout(function(){},0);return p}}}();WinChan=function(){function a(a){/^https?:\/\//.test(a)||
(a=window.location.href);var b=/^(https?:\/\/[\-_a-zA-Z\.0-9:]+)/.exec(a);return b?b[1]:a}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")o.postMessage(y,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(){k&&document.body.removeChild(k);k=void 0;if(l)try{l.close()}catch(a){o.postMessage(d,n)}l=o=void 0}if(!g)throw"missing required callback argument";var j;f.url||(j="missing required 'url' parameter");f.relay_url||(j="missing required 'relay_url' parameter");j&&setTimeout(function(){g(j)},0);f.window_name||(f.window_name=null);if(!f.window_features||b())f.window_features=void 0;var k,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 o;e&&(k=document.createElement("iframe"),k.setAttribute("src",f.relay_url),k.style.display="none",k.setAttribute("name","__winchan_relay_frame"),document.body.appendChild(k),o=k.contentWindow);var l=window.open(f.url,f.window_name,f.window_features);o||(o=l);var y=JSON.stringify({a:"request",d:f.params});c(window,"unload",i);c(window,"message",h);return{close:i,focus:function(){if(l)try{l.focus()}catch(a){}}}}}:{open:function(a,b,c,d){setTimeout(function(){d("unsupported browser")},0)}}}();
var h=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,b=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",d,c={login:null,
logout:null,ready:null},f=void 0,e=function(a){if(f===void 0)f=a;else if(f!=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()";},g,v=h.isSupported(),w=function(){if(v)try{if(!g){var a=window.document,b=a.createElement("iframe");b.style.display="none";a.body.appendChild(b);b.src="https://login.persona.org/communication_iframe";g=k.build({window:b.contentWindow,
origin:"https://login.persona.org",scope:"mozid_ni",onReady:function(){g.call({method:"loaded",success:function(){c.ready&&c.ready()},error:function(){}})}});g.bind("logout",function(){c.logout&&c.logout()});g.bind("login",function(a,b){c.login&&c.login(b)})}}catch(d){g=void 0}},q=function(a){return typeof a!="undefined"},j=function(a){try{console.warn(a)}catch(b){}},A=function(a,b){if(q(a[b]))return j(b+" has been deprecated"),!0},n=function(a,b,c){if(q(a[b])&&q(a[c]))throw"you cannot supply *both* "+
b+" and "+c;A(a,b)&&(a[c]=a[b],delete a[b])},u=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()";c.login=a.onlogin||null;c.logout=a.onlogout||null;c.ready=
a.onready||null;w();n(a,"loggedInEmail","loggedInUser");typeof a.loggedInUser!="undefined"&&g&&g.notify({method:"loggedInUser",params:a.loggedInUser})}},t=function(a){A(a,"requiredEmail");n(a,"tosURL","termsOfService");n(a,"privacyURL","privacyPolicy");a.termsOfService&&!a.privacyPolicy&&j("termsOfService ignored unless privacyPolicy also defined");a.privacyPolicy&&!a.termsOfService&&j("privacyPolicy ignored unless termsOfService also defined");if(d)try{d.focus()}catch(e){}else if(h.isSupported())g&&
g.notify({method:"dialog_running"}),d=WinChan.open({url:"https://login.persona.org/sign_in",relay_url:"https://login.persona.org/relay",window_features:b,window_name:"__persona_dialog",params:{method:"get",params:a}},function(b,e){g&&(!b&&e&&e.email&&g.notify({method:"loggedInUser",params:e.email}),g.notify({method:"dialog_complete"}));d=void 0;if(!b&&e&&e.assertion)try{c.login&&c.login(e.assertion)}catch(f){}if(b==="client closed window"||!e)a&&a.oncancel&&a.oncancel(),delete a.oncancel});else{var f=
"unsupported_dialog";h.getNoSupportReason()==="LOCALSTORAGE_DISABLED"&&(f="cookies_disabled");d=window.open("https://login.persona.org/"+f,null,b)}};navigator.id={request:function(a){if(this!=navigator.id)throw Error("all navigator.id calls must be made on the navigator.id object");a=a||{};e(!1);a.returnTo||(a.returnTo=document.location.pathname);return t(a)},watch:function(a){if(this!=navigator.id)throw Error("all navigator.id calls must be made on the navigator.id object");e(!1);u(a)},logout:function(a){if(this!=
navigator.id)throw Error("all navigator.id calls must be made on the navigator.id object");w();g&&g.notify({method:"logout"});typeof a=="function"&&setTimeout(a,0)},get:function(a,b){var d={};b=b||{};d.privacyPolicy=b.privacyPolicy||void 0;d.termsOfService=b.termsOfService||void 0;d.privacyURL=b.privacyURL||void 0;d.tosURL=b.tosURL||void 0;A(b,"silent")?a&&setTimeout(function(){a(null)},0):(e(!0),u({onlogin:function(b){a&&(a(b),a=null)},onlogout:function(){}}),d.oncancel=function(){a&&(a(null),a=
null);c.login=c.logout=c.ready=null},t(d))},getVerifiedEmail:function(a){j("navigator.id.getVerifiedEmail has been deprecated");e(!0);navigator.id.get(a)},_shimmed:!0}}})();define("persona/include",function(){});
define("mixloginstatic/LoginWindow",["domReady","orion/xhr","orion/PageUtil","persona/include"],function(k,h,i){function b(){function a(b){b=b.target;if(b.value===b.getAttribute("placeholder"))b.value=""}function b(a){a=a.target;if(a.value==="")a.value=a.getAttribute("placeholder")}function c(a){a=a.target;if(a.value===a.getAttribute("placeholder"))a.value="",a.type="password"}function d(a){a=a.target;if(a.value==="")a.value=a.getAttribute("placeholder"),a.type="text"}if(typeof document.createElement("input").placeholder===
"undefined")for(var e=document.getElementsByTagName("input"),f=0;f<e.length;f++){var g=e[f],h=g.getAttribute("placeholder");switch(h&&g.type){case "text":g.value=h;g.addEventListener("focus",a);g.addEventListener("blur",b);break;case "password":g.value=h,g.addEventListener("focus",c),g.addEventListener("blur",d),g.type="text"}}}function d(a){a=RegExp("[\\?&]"+a+"=([^&#]*)").exec(window.location.href);return a===null?void 0:a[1]}function c(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 f(a){if(typeof a!=="undefined")document.getElementById("errorMessage").textContent=a;document.getElementById("errorWin").style.visibility=""}function e(){document.getElementById("errorMessage").textContent=
"\u00a0";document.getElementById("errorWin").style.visibility="hidden"}function g(){var a;if(document.getElementById("reset").value===""&&document.getElementById("resetEmail").value==="")f("Provide username or email to reset.");else{var b=new XMLHttpRequest;b.onreadystatechange=function(){e();if(b.readyState===4)if(b.status===200)a=JSON.parse(b.responseText),a.Message?f(a.Message):f();else{try{if(a=JSON.parse(b.responseText),a.Message){f(a.Message);return}}catch(c){}f(b.statusText)}};b.open("POST",
"../useremailconfirmation",!0);b.setRequestHeader("Content-type","application/x-www-form-urlencoded");b.setRequestHeader("Orion-Version","1");b.send("{login='"+document.getElementById("reset").value+"', email='"+document.getElementById("resetEmail").value+"'}");f("Sending password reset confirmation...")}}function v(){var a=/[\?&]redirect=([^&#]*)/.exec(window.location.href);return a===null?null:a[1]}function w(){var a=v();if(a!==null&&(a=decodeURIComponent(a),i.validateURLScheme(a))){window.location=
decodeURIComponent(a);return}window.close()}function q(a){if(a!==""&&a!==null){var b=v();return b!==null&&i.validateURLScheme(decodeURIComponent(b))?"../login/openid?openid="+encodeURIComponent(a)+"&redirect="+b:"../login/openid?openid="+encodeURIComponent(a)}}function j(a){var b=!1;if(a.type==="click"||a.keyCode===13)b=!0;a.stopPropagation();return b}function A(a){j(a)&&(o=!0,navigator.id.request())}function n(){navigator.id.watch({loggedInUser:null,onlogin:function(a){o&&h("POST","../login/persona",
{headers:{"Content-type":"application/x-www-form-urlencoded","Orion-Version":"1"},data:"assertion="+encodeURIComponent(a)}).then(function(){w()},function(a){f(JSON.parse(a.responseText).error)})},onlogout:function(){}})}function u(a,b){if(!a)a=document.getElementById("login").value,b=document.getElementById("password").value;if(a.length>0&&b.length>0){var c=new XMLHttpRequest;c.onreadystatechange=function(){if(c.readyState===4)if(c.status!==200&&window.location.href.indexOf("http")!==-1){var a=JSON.parse(c.responseText);
f(a.error)}else w()};var d="login="+encodeURIComponent(a)+"&password="+encodeURIComponent(b);c.open("POST","../login/form",!0);c.setRequestHeader("Content-type","application/x-www-form-urlencoded");c.setRequestHeader("Orion-Version","1");c.send(d)}}function t(){if(document.getElementById("create_password").value!==document.getElementById("create_passwordRetype").value)return f("Passwords don't match!"),!1;e();return!0}function a(){document.getElementById("newUserHeaderShown").style.visibility="hidden";
document.getElementById("orionOpen").style.visibility="";if(C||B)document.getElementById("orionRegister").style.visibility=""}function x(){if(t()){document.getElementById("create_password").setAttribute("aria-invalid","false");document.getElementById("create_passwordRetype").setAttribute("aria-invalid","false");var b=new XMLHttpRequest,c=document.getElementById("create_login").value,d=document.getElementById("create_password").value,e=document.getElementById("create_email").value;b.onreadystatechange=
function(){if(b.readyState===4)if(b.status!==200&&window.location.href.indexOf("http")!==-1){if(b.responseText){var e=JSON.parse(b.responseText);f(e.Message);b.status===201&&a()}}else u(c,d)};e="login="+encodeURIComponent(c)+"&password="+encodeURIComponent(d)+"&email="+encodeURIComponent(e);b.open("POST","../users",!0);b.setRequestHeader("Content-type","application/x-www-form-urlencoded");b.setRequestHeader("Orion-Version","1");b.send(e)}else document.getElementById("create_password").setAttribute("aria-invalid",
"true"),document.getElementById("create_passwordRetype").setAttribute("aria-invalid","true")}function s(a){if(j(a))!C&&B?window.open(B):(document.getElementById("orionOpen").style.visibility="hidden",document.getElementById("orionRegister").style.visibility="hidden",document.getElementById("orionLogin").style.visibility="hidden",document.getElementById("orionRegister").style.visibility="hidden",document.getElementById("newUserHeaderShown").style.visibility="",document.getElementById("create_login").focus())}
function r(){document.getElementById("orionLogin").style.visibility="hidden";if(!C&&!B)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 H(){document.getElementById("orionLogin").style.visibility="";document.getElementById("newUserHeaderShown").style.display=
"";document.getElementById("orionReset").style.visibility="hidden"}function m(){window.open("/mixloginstatic/ServerStatus.html")}function F(a){if(j(a))a.stopPropagation(),document.getElementById("orionOpen").style.visibility="hidden",document.getElementById("orionRegister").style.visibility="hidden",document.getElementById("orionLogin").style.visibility="",document.getElementById("login").focus()}function I(){document.getElementById("orionLogin").style.visibility="hidden";document.getElementById("orionOpen").style.visibility=
"";if(C||B)document.getElementById("orionRegister").style.visibility="";e()}function J(a){j(a)&&a.srcElement.click()}var C,B,G,o=!1;k(function(){n(document.getElementById("personaLogin"));var e=d("error");e&&(e=c(e),f(e));var i=new XMLHttpRequest;i.onreadystatechange=function(){if(i.readyState===4&&i.status===200){var a=JSON.parse(i.responseText);C=a.CanAddUsers;G=a.ForceEmail;document.getElementById("create_email").setAttribute("aria-required",G);B=a.RegistrationURI;if(!C&&!B)document.getElementById("orionRegister").style.visibility=
"hidden";document.getElementById("login-window").style.display="";document.getElementById("myopenidLogin").focus()}};i.open("POST","../login/canaddusers",!0);i.setRequestHeader("Content-type","application/x-www-form-urlencoded");i.setRequestHeader("Orion-Version","1");i.send();var j=new XMLHttpRequest;j.onreadystatechange=function(){if(j.readyState===4&&j.status===200&&JSON.parse(j.responseText).emailConfigured===!1)document.getElementById("resetUserLink").style.display="none"};j.open("POST","../useremailconfirmation/cansendemails",
!0);j.setRequestHeader("Content-type","application/x-www-form-urlencoded");j.setRequestHeader("Orion-Version","1");j.send();h("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(){});
b();document.getElementById("login").onkeypress=function(a){if(a.keyCode===13)u();else return!0};document.getElementById("password").onkeypress=function(a){if(a.keyCode===13)u();else return!0};document.getElementById("loginButton").onclick=function(){u()};document.getElementById("orionInfoArea").onclick=m;document.getElementById("resetUserLink").onclick=r;document.getElementById("reset").onkeypress=function(a){a.keyCode===13&&g();return!0};document.getElementById("resetEmail").onkeypress=function(a){a.keyCode===
13&&g();return!0};document.getElementById("registerButton").onclick=s;document.getElementById("registerButton").onkeydown=s;document.getElementById("create_password").onkeyup=function(a){a.keyCode===13?x():t()};document.getElementById("create_passwordRetype").onkeyup=function(a){a.keyCode===13?x():t()};document.getElementById("createButton").onclick=x;document.getElementById("cancelLoginButton").onclick=I;document.getElementById("hideRegisterButton").onclick=a;document.getElementById("googleLoginLink").href=
q("https://www.google.com/accounts/o8/id");document.getElementById("googleLogin").onkeydown=J;document.getElementById("orionLoginLink").onclick=F;document.getElementById("myopenidLogin").onkeydown=F;document.getElementById("personaLogin").onclick=A;document.getElementById("personaLogin").onkeydown=A;document.getElementById("cancelResetButton").onclick=H;document.getElementById("sendResetButton").onclick=g})});