Skip to content

Instantly share code, notes, and snippets.

@adamyi

adamyi/qos.js Secret

Created September 17, 2020 14:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adamyi/2e27c6b685bf97df572b5f9524520125 to your computer and use it in GitHub Desktop.
Save adamyi/2e27c6b685bf97df572b5f9524520125 to your computer and use it in GitHub Desktop.
qos.js
// When you can read assembly, every software is open-sourced.
// When you can read minified javascript, every front-end is open-sourced.
// -- "I didn't say that" by Albert Einsten
// I'm told that open-source software should have a license. Here we go:
// Copyright 2020 Adam Yi <i@adamyi.com>
// SPDX-License-Identifier: LicenseRef-Good-Luck-With-That-Public-License
// Protip: browser dev console is a really nice javascript debugging tool - it even supports breakpoints! You can inspect and modify variable states at runtime
var n,aa="function"==typeof Object.defineProperties?Object.defineProperty:function(a,b,c){if(a==Array.prototype||a==Object.prototype)return a;a[b]=c.value;return a};function ba(a){a=["object"==typeof globalThis&&globalThis,a,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof global&&global];for(var b=0;b<a.length;++b){var c=a[b];if(c&&c.Math==Math)return c}throw Error("Cannot find global object");}var ca=ba(this);
function da(a,b){if(b)a:{var c=ca;a=a.split(".");for(var d=0;d<a.length-1;d++){var f=a[d];if(!(f in c))break a;c=c[f]}a=a[a.length-1];d=c[a];b=b(d);b!=d&&null!=b&&aa(c,a,{configurable:!0,writable:!0,value:b})}}function fa(a){var b=0;return function(){return b<a.length?{done:!1,value:a[b++]}:{done:!0}}}da("Object.is",function(a){return a?a:function(b,c){return b===c?0!==b||1/b===1/c:b!==b&&c!==c}});
da("Array.prototype.includes",function(a){return a?a:function(b,c){var d=this;d instanceof String&&(d=String(d));var f=d.length;c=c||0;for(0>c&&(c=Math.max(c+f,0));c<f;c++){var g=d[c];if(g===b||Object.is(g,b))return!0}return!1}});function ha(a){var b="undefined"!=typeof Symbol&&Symbol.iterator&&a[Symbol.iterator];return b?b.call(a):{next:fa(a)}}
da("Promise",function(a){function b(e){this.b=0;this.c=void 0;this.a=[];var h=this.f();try{e(h.resolve,h.reject)}catch(k){h.reject(k)}}function c(){this.a=null}function d(e){return e instanceof b?e:new b(function(h){h(e)})}if(a)return a;c.prototype.b=function(e){if(null==this.a){this.a=[];var h=this;this.c(function(){h.g()})}this.a.push(e)};var f=ca.setTimeout;c.prototype.c=function(e){f(e,0)};c.prototype.g=function(){for(;this.a&&this.a.length;){var e=this.a;this.a=[];for(var h=0;h<e.length;++h){var k=
e[h];e[h]=null;try{k()}catch(l){this.f(l)}}}this.a=null};c.prototype.f=function(e){this.c(function(){throw e;})};b.prototype.f=function(){function e(l){return function(m){k||(k=!0,l.call(h,m))}}var h=this,k=!1;return{resolve:e(this.u),reject:e(this.g)}};b.prototype.u=function(e){if(e===this)this.g(new TypeError("A Promise cannot resolve to itself"));else if(e instanceof b)this.A(e);else{a:switch(typeof e){case "object":var h=null!=e;break a;case "function":h=!0;break a;default:h=!1}h?this.l(e):this.h(e)}};
b.prototype.l=function(e){var h=void 0;try{h=e.then}catch(k){this.g(k);return}"function"==typeof h?this.F(h,e):this.h(e)};b.prototype.g=function(e){this.i(2,e)};b.prototype.h=function(e){this.i(1,e)};b.prototype.i=function(e,h){if(0!=this.b)throw Error("Cannot settle("+e+", "+h+"): Promise already settled in state"+this.b);this.b=e;this.c=h;this.j()};b.prototype.j=function(){if(null!=this.a){for(var e=0;e<this.a.length;++e)g.b(this.a[e]);this.a=null}};var g=new c;b.prototype.A=function(e){var h=this.f();
e.M(h.resolve,h.reject)};b.prototype.F=function(e,h){var k=this.f();try{e.call(h,k.resolve,k.reject)}catch(l){k.reject(l)}};b.prototype.then=function(e,h){function k(t,F){return"function"==typeof t?function(qa){try{l(t(qa))}catch(ea){m(ea)}}:F}var l,m,w=new b(function(t,F){l=t;m=F});this.M(k(e,l),k(h,m));return w};b.prototype.catch=function(e){return this.then(void 0,e)};b.prototype.M=function(e,h){function k(){switch(l.b){case 1:e(l.c);break;case 2:h(l.c);break;default:throw Error("Unexpected state: "+
l.b);}}var l=this;null==this.a?g.b(k):this.a.push(k)};b.resolve=d;b.reject=function(e){return new b(function(h,k){k(e)})};b.race=function(e){return new b(function(h,k){for(var l=ha(e),m=l.next();!m.done;m=l.next())d(m.value).M(h,k)})};b.all=function(e){var h=ha(e),k=h.next();return k.done?d([]):new b(function(l,m){function w(qa){return function(ea){t[qa]=ea;F--;0==F&&l(t)}}var t=[],F=0;do t.push(void 0),F++,d(k.value).M(w(t.length-1),m),k=h.next();while(!k.done)})};return b});
var ia=ia||{},p=this||self;function ja(a){return"string"==typeof a}function ka(a,b){a=a.split(".");b=b||p;for(var c=0;c<a.length;c++)if(b=b[a[c]],null==b)return null;return b}function la(){}
function q(a){var b=typeof a;if("object"==b)if(a){if(a instanceof Array)return"array";if(a instanceof Object)return b;var c=Object.prototype.toString.call(a);if("[object Window]"==c)return"object";if("[object Array]"==c||"number"==typeof a.length&&"undefined"!=typeof a.splice&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("splice"))return"array";if("[object Function]"==c||"undefined"!=typeof a.call&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("call"))return"function"}else return"null";
else if("function"==b&&"undefined"==typeof a.call)return"object";return b}function ma(a){return"array"==q(a)}function na(a){var b=q(a);return"array"==b||"object"==b&&"number"==typeof a.length}function oa(a){return"function"==q(a)}function pa(a){var b=typeof a;return"object"==b&&null!=a||"function"==b}var ra="closure_uid_"+(1E9*Math.random()>>>0),sa=0;function ta(a,b,c){return a.call.apply(a.bind,arguments)}
function ua(a,b,c){if(!a)throw Error();if(2<arguments.length){var d=Array.prototype.slice.call(arguments,2);return function(){var f=Array.prototype.slice.call(arguments);Array.prototype.unshift.apply(f,d);return a.apply(b,f)}}return function(){return a.apply(b,arguments)}}function r(a,b,c){Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?r=ta:r=ua;return r.apply(null,arguments)}var va=Date.now||function(){return+new Date};
function u(a,b){function c(){}c.prototype=b.prototype;a.oa=b.prototype;a.prototype=new c;a.prototype.constructor=a};function wa(a){if(Error.captureStackTrace)Error.captureStackTrace(this,wa);else{var b=Error().stack;b&&(this.stack=b)}a&&(this.message=String(a))}u(wa,Error);wa.prototype.name="CustomError";function xa(a,b){a=a.split("%s");for(var c="",d=a.length-1,f=0;f<d;f++)c+=a[f]+(f<b.length?b[f]:"%s");wa.call(this,c+a[d])}u(xa,wa);xa.prototype.name="AssertionError";function v(a,b){throw new xa("Failure"+(a?": "+a:""),Array.prototype.slice.call(arguments,1));};var ya=Array.prototype.indexOf?function(a,b){return Array.prototype.indexOf.call(a,b,void 0)}:function(a,b){if("string"===typeof a)return"string"!==typeof b||1!=b.length?-1:a.indexOf(b,0);for(var c=0;c<a.length;c++)if(c in a&&a[c]===b)return c;return-1},za=Array.prototype.forEach?function(a,b){Array.prototype.forEach.call(a,b,void 0)}:function(a,b){for(var c=a.length,d="string"===typeof a?a.split(""):a,f=0;f<c;f++)f in d&&b.call(void 0,d[f],f,a)},Aa=Array.prototype.map?function(a,b){return Array.prototype.map.call(a,
b,void 0)}:function(a,b){for(var c=a.length,d=Array(c),f="string"===typeof a?a.split(""):a,g=0;g<c;g++)g in f&&(d[g]=b.call(void 0,f[g],g,a));return d};function Ba(a){a:{var b=Ca;for(var c=a.length,d="string"===typeof a?a.split(""):a,f=0;f<c;f++)if(f in d&&b.call(void 0,d[f],f,a)){b=f;break a}b=-1}return 0>b?null:"string"===typeof a?a.charAt(b):a[b]}function Da(a){var b=a.length;if(0<b){for(var c=Array(b),d=0;d<b;d++)c[d]=a[d];return c}return[]}
function Ea(a,b,c){return 2>=arguments.length?Array.prototype.slice.call(a,b):Array.prototype.slice.call(a,b,c)};var Fa=String.prototype.trim?function(a){return a.trim()}:function(a){return/^[\s\xa0]*([\s\S]*?)[\s\xa0]*$/.exec(a)[1]},Ga=/&/g,Ha=/</g,Ia=/>/g,Ja=/"/g,Ka=/'/g,La=/\x00/g,Ma=/[\x00&<>"']/;function x(a,b){return-1!=a.indexOf(b)}function Na(a,b){return a<b?-1:a>b?1:0};var y;a:{var Oa=p.navigator;if(Oa){var Pa=Oa.userAgent;if(Pa){y=Pa;break a}}y=""};function Qa(a,b){for(var c in a)b.call(void 0,a[c],c,a)}function Ra(a,b){var c={},d;for(d in a)c[d]=b.call(void 0,a[d],d,a);return c}var Sa="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");function Ta(a,b){for(var c,d,f=1;f<arguments.length;f++){d=arguments[f];for(c in d)a[c]=d[c];for(var g=0;g<Sa.length;g++)c=Sa[g],Object.prototype.hasOwnProperty.call(d,c)&&(a[c]=d[c])}};function z(a,b){this.b=a===Ua&&b||"";this.c=Va}z.prototype.Z=!0;z.prototype.X=function(){return this.b.toString()};z.prototype.a=function(){return 1};z.prototype.toString=function(){return"TrustedResourceUrl{"+this.b+"}"};function Wa(a){if(a instanceof z&&a.constructor===z&&a.c===Va)return a.b;v("expected object of type TrustedResourceUrl, got '"+a+"' of type "+q(a));return"type_error:TrustedResourceUrl"}var Va={},Ua={};function A(a,b){this.b=a===Xa&&b||"";this.c=Ya}A.prototype.Z=!0;A.prototype.X=function(){return this.b.toString()};A.prototype.a=function(){return 1};A.prototype.toString=function(){return"SafeUrl{"+this.b+"}"};var Ya={},Xa={};function B(){this.b="";this.c=Za}B.prototype.a=function(){return null};B.prototype.Z=!0;B.prototype.X=function(){return this.b.toString()};B.prototype.toString=function(){return"SafeHtml{"+this.b+"}"};var Za={};function $a(a){Ma.test(a)&&(-1!=a.indexOf("&")&&(a=a.replace(Ga,"&amp;")),-1!=a.indexOf("<")&&(a=a.replace(Ha,"&lt;")),-1!=a.indexOf(">")&&(a=a.replace(Ia,"&gt;")),-1!=a.indexOf('"')&&(a=a.replace(Ja,"&quot;")),-1!=a.indexOf("'")&&(a=a.replace(Ka,"&#39;")),-1!=a.indexOf("\x00")&&(a=a.replace(La,"&#0;")));return a}function ab(a){var b=1;a=a.split(":");for(var c=[];0<b&&a.length;)c.push(a.shift()),b--;a.length&&c.push(a.join(":"));return c};function bb(a){bb[" "](a);return a}bb[" "]=la;function cb(a,b){var c=db;return Object.prototype.hasOwnProperty.call(c,a)?c[a]:c[a]=b(a)};var eb=x(y,"Opera"),C=x(y,"Trident")||x(y,"MSIE"),fb=x(y,"Edge"),gb=x(y,"Gecko")&&!(x(y.toLowerCase(),"webkit")&&!x(y,"Edge"))&&!(x(y,"Trident")||x(y,"MSIE"))&&!x(y,"Edge"),hb=x(y.toLowerCase(),"webkit")&&!x(y,"Edge");function ib(){var a=p.document;return a?a.documentMode:void 0}var jb;
a:{var kb="",lb=function(){var a=y;if(gb)return/rv:([^\);]+)(\)|;)/.exec(a);if(fb)return/Edge\/([\d\.]+)/.exec(a);if(C)return/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(a);if(hb)return/WebKit\/(\S+)/.exec(a);if(eb)return/(?:Version)[ \/]?(\S+)/.exec(a)}();lb&&(kb=lb?lb[1]:"");if(C){var mb=ib();if(null!=mb&&mb>parseFloat(kb)){jb=String(mb);break a}}jb=kb}var db={};
function nb(a){return cb(a,function(){for(var b=0,c=Fa(String(jb)).split("."),d=Fa(String(a)).split("."),f=Math.max(c.length,d.length),g=0;0==b&&g<f;g++){var e=c[g]||"",h=d[g]||"";do{e=/(\d*)(\D*)(.*)/.exec(e)||["","","",""];h=/(\d*)(\D*)(.*)/.exec(h)||["","","",""];if(0==e[0].length&&0==h[0].length)break;b=Na(0==e[1].length?0:parseInt(e[1],10),0==h[1].length?0:parseInt(h[1],10))||Na(0==e[2].length,0==h[2].length)||Na(e[2],h[2]);e=e[3];h=h[3]}while(0==b)}return 0<=b})}var ob;
ob=p.document&&C?ib():void 0;var pb=Object.freeze||function(a){return a};function qb(a,b,c){this.reset(a,b,c,void 0,void 0)}qb.prototype.a=null;var rb=0;qb.prototype.reset=function(a,b,c,d,f){"number"==typeof f||rb++;this.c=d||va();this.f=a;this.g=b;this.b=c;delete this.a};function sb(a){this.g=a;this.a=this.f=this.b=this.c=null}function D(a,b){this.name=a;this.value=b}D.prototype.toString=function(){return this.name};var tb=new D("SEVERE",1E3),ub=new D("WARNING",900),vb=new D("INFO",800),wb=new D("CONFIG",700),xb=new D("FINE",500),yb=new D("FINEST",300);function zb(a){if(a.b)return a.b;if(a.c)return zb(a.c);v("Root logger has no level set.");return null}
sb.prototype.log=function(a,b,c){if(a.value>=zb(this).value)for(oa(b)&&(b=b()),a=new qb(a,String(b),this.g),c&&(a.a=c),c=this;c;){var d=c,f=a;if(d.a)for(var g=0;b=d.a[g];g++)b(f);c=c.c}};sb.prototype.info=function(a,b){this.log(vb,a,b)};var Ab={},Bb=null;function Cb(){Bb||(Bb=new sb(""),Ab[""]=Bb,Bb.b=wb)}function Db(){Cb();return Bb}function E(a){Cb();var b;if(!(b=Ab[a])){b=new sb(a);var c=a.lastIndexOf("."),d=a.substr(c+1);c=E(a.substr(0,c));c.f||(c.f={});c.f[d]=b;b.c=c;Ab[a]=b}return b};function Eb(){this.a=va()}var Fb=null;Eb.prototype.set=function(a){this.a=a};Eb.prototype.reset=function(){this.set(va())};Eb.prototype.get=function(){return this.a};function Gb(a){this.f=a||"";Fb||(Fb=new Eb);this.g=Fb}Gb.prototype.a=!0;Gb.prototype.b=!0;Gb.prototype.c=!1;function G(a){return 10>a?"0"+a:String(a)}function Hb(a,b){a=(a.c-b)/1E3;b=a.toFixed(3);var c=0;if(1>a)c=2;else for(;100>a;)c++,a*=10;for(;0<c--;)b=" "+b;return b}function Ib(a){Gb.call(this,a)}u(Ib,Gb);
function Jb(a,b){var c=[];c.push(a.f," ");if(a.b){var d=new Date(b.c);c.push("[",G(d.getFullYear()-2E3)+G(d.getMonth()+1)+G(d.getDate())+" "+G(d.getHours())+":"+G(d.getMinutes())+":"+G(d.getSeconds())+"."+G(Math.floor(d.getMilliseconds()/10)),"] ")}c.push("[",Hb(b,a.g.get()),"s] ");c.push("[",b.b,"] ");c.push(b.g);a.c&&(b=b.a)&&c.push("\n",b instanceof Error?b.message:b.toString());a.a&&c.push("\n");return c.join("")};function Kb(){this.g=r(this.c,this);this.a=new Ib;this.a.b=!1;this.a.c=!1;this.b=this.a.a=!1;this.f={}}Kb.prototype.c=function(a){function b(g){if(g){if(g.value>=tb.value)return"error";if(g.value>=ub.value)return"warn";if(g.value>=wb.value)return"log"}return"debug"}if(!this.f[a.b]){var c=Jb(this.a,a),d=Lb;if(d){var f=b(a.f);Mb(d,f,c,a.a)}}};var Lb=p.console;function Mb(a,b,c,d){if(a[b])a[b](c,d||"");else a.log(c,d||"")};function Nb(a){if(8192>=a.length)return String.fromCharCode.apply(null,a);for(var b="",c=0;c<a.length;c+=8192)b+=String.fromCharCode.apply(null,Ea(a,c,c+8192));return b}function Ob(a){return Aa(a,function(b){b=b.toString(16);return 1<b.length?b:"0"+b}).join("")};var Pb=!C||9<=Number(ob);function Qb(a){var b=document;return"string"===typeof a?b.getElementById(a):a}function Rb(){var a=document;return a.querySelectorAll&&a.querySelector?a.querySelectorAll(".e-g-b"):Sb(document,"e-g-b")}function H(a){var b=document;b.getElementsByClassName?a=b.getElementsByClassName(a)[0]:(b=document,a=b.querySelectorAll&&b.querySelector&&a?b.querySelector(a?"."+a:""):Sb(b,a)[0]||null);return a||null}
function Sb(a,b){var c,d;if(a.querySelectorAll&&a.querySelector&&b)return a.querySelectorAll(b?"."+b:"");if(b&&a.getElementsByClassName){var f=a.getElementsByClassName(b);return f}f=a.getElementsByTagName("*");if(b){var g={};for(c=d=0;a=f[c];c++){var e=a.className,h;if(h="function"==typeof e.split)h=0<=ya(e.split(/\s+/),b);h&&(g[d++]=a)}g.length=d;return g}return f}
function Tb(a,b){Qa(b,function(c,d){c&&"object"==typeof c&&c.Z&&(c=c.X());"style"==d?a.style.cssText=c:"class"==d?a.className=c:"for"==d?a.htmlFor=c:Ub.hasOwnProperty(d)?a.setAttribute(Ub[d],c):0==d.lastIndexOf("aria-",0)||0==d.lastIndexOf("data-",0)?a.setAttribute(d,c):a[d]=c})}
var Ub={cellpadding:"cellPadding",cellspacing:"cellSpacing",colspan:"colSpan",frameborder:"frameBorder",height:"height",maxlength:"maxLength",nonce:"nonce",role:"role",rowspan:"rowSpan",type:"type",usemap:"useMap",valign:"vAlign",width:"width"};
function Vb(a,b,c){var d=arguments,f=document,g=String(d[0]),e=d[1];if(!Pb&&e&&(e.name||e.type)){g=["<",g];e.name&&g.push(' name="',$a(e.name),'"');if(e.type){g.push(' type="',$a(e.type),'"');var h={};Ta(h,e);delete h.type;e=h}g.push(">");g=g.join("")}g=String(g);"application/xhtml+xml"===f.contentType&&(g=g.toLowerCase());g=f.createElement(g);e&&("string"===typeof e?g.className=e:ma(e)?g.className=e.join(" "):Tb(g,e));2<d.length&&Wb(f,g,d);return g}
function Wb(a,b,c){function d(h){h&&b.appendChild("string"===typeof h?a.createTextNode(h):h)}for(var f=2;f<c.length;f++){var g=c[f];if(!na(g)||pa(g)&&0<g.nodeType)d(g);else{a:{if(g&&"number"==typeof g.length){if(pa(g)){var e="function"==typeof g.item||"string"==typeof g.item;break a}if(oa(g)){e="function"==typeof g.item;break a}}e=!1}za(e?Da(g):g,d)}}}
function Xb(a,b){if("textContent"in a)a.textContent=b;else if(3==a.nodeType)a.data=String(b);else if(a.firstChild&&3==a.firstChild.nodeType){for(;a.lastChild!=a.firstChild;)a.removeChild(a.lastChild);a.firstChild.data=String(b)}else{for(var c;c=a.firstChild;)a.removeChild(c);a.appendChild((9==a.nodeType?a:a.ownerDocument||a.document).createTextNode(String(b)))}};function Yb(a,b){this.b={};this.a=[];this.c=0;var c=arguments.length;if(1<c){if(c%2)throw Error("Uneven number of arguments");for(var d=0;d<c;d+=2)this.set(arguments[d],arguments[d+1])}else a&&Zb(this,a)}n=Yb.prototype;n.W=function(){$b(this);return this.a.concat()};n.remove=function(a){return ac(this.b,a)?(delete this.b[a],this.c--,this.a.length>2*this.c&&$b(this),!0):!1};
function $b(a){if(a.c!=a.a.length){for(var b=0,c=0;b<a.a.length;){var d=a.a[b];ac(a.b,d)&&(a.a[c++]=d);b++}a.a.length=c}if(a.c!=a.a.length){var f={};for(c=b=0;b<a.a.length;)d=a.a[b],ac(f,d)||(a.a[c++]=d,f[d]=1),b++;a.a.length=c}}n.get=function(a,b){return ac(this.b,a)?this.b[a]:b};n.set=function(a,b){ac(this.b,a)||(this.c++,this.a.push(a));this.b[a]=b};function Zb(a,b){if(b instanceof Yb)for(var c=b.W(),d=0;d<c.length;d++)a.set(c[d],b.get(c[d]));else for(c in b)a.set(c,b[c])}
n.forEach=function(a,b){for(var c=this.W(),d=0;d<c.length;d++){var f=c[d],g=this.get(f);a.call(b,g,f,this)}};function ac(a,b){return Object.prototype.hasOwnProperty.call(a,b)};function bc(a){var b=a.type;if("string"===typeof b)switch(b.toLowerCase()){case "checkbox":case "radio":return a.checked?a.value:null;case "select-one":return b=a.selectedIndex,0<=b?a.options[b].value:null;case "select-multiple":b=[];for(var c,d=0;c=a.options[d];d++)c.selected&&b.push(c.value);return b.length?b:null}return null!=a.value?a.value:null};var cc=!C||9<=Number(ob),dc=C&&!nb("9"),ec=function(){if(!p.addEventListener||!Object.defineProperty)return!1;var a=!1,b=Object.defineProperty({},"passive",{get:function(){a=!0}});try{p.addEventListener("test",la,b),p.removeEventListener("test",la,b)}catch(c){}return a}();function fc(){0!=gc&&(this[ra]||(this[ra]=++sa));this.S=this.S}var gc=0;fc.prototype.S=!1;function I(a,b){this.type=a;this.a=this.target=b}I.prototype.b=function(){};function hc(a,b){I.call(this,a?a.type:"");this.relatedTarget=this.a=this.target=null;this.button=this.screenY=this.screenX=this.clientY=this.clientX=0;this.key="";this.metaKey=this.shiftKey=this.altKey=this.ctrlKey=!1;this.pointerId=0;this.pointerType="";this.c=null;a&&this.$(a,b)}u(hc,I);var ic=pb({2:"touch",3:"pen",4:"mouse"});
hc.prototype.$=function(a,b){var c=this.type=a.type,d=a.changedTouches&&a.changedTouches.length?a.changedTouches[0]:null;this.target=a.target||a.srcElement;this.a=b;if(b=a.relatedTarget){if(gb){a:{try{bb(b.nodeName);var f=!0;break a}catch(g){}f=!1}f||(b=null)}}else"mouseover"==c?b=a.fromElement:"mouseout"==c&&(b=a.toElement);this.relatedTarget=b;d?(this.clientX=void 0!==d.clientX?d.clientX:d.pageX,this.clientY=void 0!==d.clientY?d.clientY:d.pageY,this.screenX=d.screenX||0,this.screenY=d.screenY||
0):(this.clientX=void 0!==a.clientX?a.clientX:a.pageX,this.clientY=void 0!==a.clientY?a.clientY:a.pageY,this.screenX=a.screenX||0,this.screenY=a.screenY||0);this.button=a.button;this.key=a.key||"";this.ctrlKey=a.ctrlKey;this.altKey=a.altKey;this.shiftKey=a.shiftKey;this.metaKey=a.metaKey;this.pointerId=a.pointerId||0;this.pointerType="string"===typeof a.pointerType?a.pointerType:ic[a.pointerType]||"";this.c=a;a.defaultPrevented&&this.b()};
hc.prototype.b=function(){hc.oa.b.call(this);var a=this.c;if(a.preventDefault)a.preventDefault();else if(a.returnValue=!1,dc)try{if(a.ctrlKey||112<=a.keyCode&&123>=a.keyCode)a.keyCode=-1}catch(b){}};var jc="closure_listenable_"+(1E6*Math.random()|0),kc=0;function lc(a,b,c,d,f){this.listener=a;this.proxy=null;this.src=b;this.type=c;this.capture=!!d;this.N=f;this.key=++kc;this.D=this.L=!1}function mc(a){a.D=!0;a.listener=null;a.proxy=null;a.src=null;a.N=null};function nc(a){this.src=a;this.a={};this.b=0}nc.prototype.add=function(a,b,c,d,f){var g=a.toString();a=this.a[g];a||(a=this.a[g]=[],this.b++);var e=oc(a,b,d,f);-1<e?(b=a[e],c||(b.L=!1)):(b=new lc(b,this.src,g,!!d,f),b.L=c,a.push(b));return b};nc.prototype.remove=function(a,b,c,d){a=a.toString();if(!(a in this.a))return!1;var f=this.a[a];b=oc(f,b,c,d);return-1<b?(mc(f[b]),Array.prototype.splice.call(f,b,1),0==f.length&&(delete this.a[a],this.b--),!0):!1};
function pc(a,b){var c=b.type;if(c in a.a){var d=a.a[c],f=ya(d,b),g;(g=0<=f)&&Array.prototype.splice.call(d,f,1);g&&(mc(b),0==a.a[c].length&&(delete a.a[c],a.b--))}}function oc(a,b,c,d){for(var f=0;f<a.length;++f){var g=a[f];if(!g.D&&g.listener==b&&g.capture==!!c&&g.N==d)return f}return-1};var qc="closure_lm_"+(1E6*Math.random()|0),rc={},sc=0;function J(a,b,c,d,f){if(d&&d.once)tc(a,b,c,d,f);else if(ma(b))for(var g=0;g<b.length;g++)J(a,b[g],c,d,f);else c=uc(c),a&&a[jc]?a.c.add(String(b),c,!1,pa(d)?!!d.capture:!!d,f):vc(a,b,c,!1,d,f)}
function vc(a,b,c,d,f,g){if(!b)throw Error("Invalid event type");var e=pa(f)?!!f.capture:!!f,h=wc(a);h||(a[qc]=h=new nc(a));c=h.add(b,c,d,e,g);if(!c.proxy){d=xc();c.proxy=d;d.src=a;d.listener=c;if(a.addEventListener)ec||(f=e),void 0===f&&(f=!1),a.addEventListener(b.toString(),d,f);else if(a.attachEvent)a.attachEvent(yc(b.toString()),d);else if(a.addListener&&a.removeListener)a.addListener(d);else throw Error("addEventListener and attachEvent are unavailable.");sc++}}
function xc(){var a=zc,b=cc?function(c){return a.call(b.src,b.listener,c)}:function(c){c=a.call(b.src,b.listener,c);if(!c)return c};return b}function tc(a,b,c,d,f){if(ma(b))for(var g=0;g<b.length;g++)tc(a,b[g],c,d,f);else c=uc(c),a&&a[jc]?a.c.add(String(b),c,!0,pa(d)?!!d.capture:!!d,f):vc(a,b,c,!0,d,f)}
function Ac(a,b,c,d,f){if(ma(b))for(var g=0;g<b.length;g++)Ac(a,b[g],c,d,f);else(d=pa(d)?!!d.capture:!!d,c=uc(c),a&&a[jc])?a.c.remove(String(b),c,d,f):a&&(a=wc(a))&&(b=a.a[b.toString()],a=-1,b&&(a=oc(b,c,d,f)),(c=-1<a?b[a]:null)&&Bc(c))}
function Bc(a){if("number"!==typeof a&&a&&!a.D){var b=a.src;if(b&&b[jc])pc(b.c,a);else{var c=a.type,d=a.proxy;b.removeEventListener?b.removeEventListener(c,d,a.capture):b.detachEvent?b.detachEvent(yc(c),d):b.addListener&&b.removeListener&&b.removeListener(d);sc--;(c=wc(b))?(pc(c,a),0==c.b&&(c.src=null,b[qc]=null)):mc(a)}}}function yc(a){return a in rc?rc[a]:rc[a]="on"+a}
function Cc(a,b,c,d){var f=!0;if(a=wc(a))if(b=a.a[b.toString()])for(b=b.concat(),a=0;a<b.length;a++){var g=b[a];g&&g.capture==c&&!g.D&&(g=Dc(g,d),f=f&&!1!==g)}return f}function Dc(a,b){var c=a.listener,d=a.N||a.src;a.L&&Bc(a);return c.call(d,b)}
function zc(a,b){if(a.D)return!0;if(!cc){var c=b||ka("window.event");b=new hc(c,this);var d=!0;if(!(0>c.keyCode||void 0!=c.returnValue)){a:{var f=!1;if(0==c.keyCode)try{c.keyCode=-1;break a}catch(e){f=!0}if(f||void 0==c.returnValue)c.returnValue=!0}c=[];for(f=b.a;f;f=f.parentNode)c.push(f);a=a.type;for(f=c.length-1;0<=f;f--){b.a=c[f];var g=Cc(c[f],a,!0,b);d=d&&g}for(f=0;f<c.length;f++)b.a=c[f],g=Cc(c[f],a,!1,b),d=d&&g}return d}return Dc(a,new hc(b,this))}
function wc(a){a=a[qc];return a instanceof nc?a:null}var Ec="__closure_events_fn_"+(1E9*Math.random()>>>0);function uc(a){if(oa(a))return a;a[Ec]||(a[Ec]=function(b){return a.handleEvent(b)});return a[Ec]};function K(a,b){a&&a.log(tb,b,void 0)}function L(a,b){a&&a.info(b,void 0)}function M(a,b){a&&a.log(xb,b,void 0)};function Fc(){this.b=-1};function Gc(){this.b=64;this.a=Array(4);this.h=Array(this.b);this.g=this.f=0;this.reset()}u(Gc,Fc);Gc.prototype.reset=function(){this.a[0]=1732584193;this.a[1]=4023233417;this.a[2]=2562383102;this.a[3]=271733878;this.g=this.f=0};
function Hc(a,b,c){c||(c=0);var d=Array(16);if("string"===typeof b)for(var f=0;16>f;++f)d[f]=b.charCodeAt(c++)|b.charCodeAt(c++)<<8|b.charCodeAt(c++)<<16|b.charCodeAt(c++)<<24;else for(f=0;16>f;++f)d[f]=b[c++]|b[c++]<<8|b[c++]<<16|b[c++]<<24;b=a.a[0];c=a.a[1];f=a.a[2];var g=a.a[3];var e=b+(g^c&(f^g))+d[0]+3614090360&4294967295;b=c+(e<<7&4294967295|e>>>25);e=g+(f^b&(c^f))+d[1]+3905402710&4294967295;g=b+(e<<12&4294967295|e>>>20);e=f+(c^g&(b^c))+d[2]+606105819&4294967295;f=g+(e<<17&4294967295|e>>>15);
e=c+(b^f&(g^b))+d[3]+3250441966&4294967295;c=f+(e<<22&4294967295|e>>>10);e=b+(g^c&(f^g))+d[4]+4118548399&4294967295;b=c+(e<<7&4294967295|e>>>25);e=g+(f^b&(c^f))+d[5]+1200080426&4294967295;g=b+(e<<12&4294967295|e>>>20);e=f+(c^g&(b^c))+d[6]+2821735955&4294967295;f=g+(e<<17&4294967295|e>>>15);e=c+(b^f&(g^b))+d[7]+4249261313&4294967295;c=f+(e<<22&4294967295|e>>>10);e=b+(g^c&(f^g))+d[8]+1770035416&4294967295;b=c+(e<<7&4294967295|e>>>25);e=g+(f^b&(c^f))+d[9]+2336552879&4294967295;g=b+(e<<12&4294967295|
e>>>20);e=f+(c^g&(b^c))+d[10]+4294925233&4294967295;f=g+(e<<17&4294967295|e>>>15);e=c+(b^f&(g^b))+d[11]+2304563134&4294967295;c=f+(e<<22&4294967295|e>>>10);e=b+(g^c&(f^g))+d[12]+1804603682&4294967295;b=c+(e<<7&4294967295|e>>>25);e=g+(f^b&(c^f))+d[13]+4254626195&4294967295;g=b+(e<<12&4294967295|e>>>20);e=f+(c^g&(b^c))+d[14]+2792965006&4294967295;f=g+(e<<17&4294967295|e>>>15);e=c+(b^f&(g^b))+d[15]+1236535329&4294967295;c=f+(e<<22&4294967295|e>>>10);e=b+(f^g&(c^f))+d[1]+4129170786&4294967295;b=c+(e<<
5&4294967295|e>>>27);e=g+(c^f&(b^c))+d[6]+3225465664&4294967295;g=b+(e<<9&4294967295|e>>>23);e=f+(b^c&(g^b))+d[11]+643717713&4294967295;f=g+(e<<14&4294967295|e>>>18);e=c+(g^b&(f^g))+d[0]+3921069994&4294967295;c=f+(e<<20&4294967295|e>>>12);e=b+(f^g&(c^f))+d[5]+3593408605&4294967295;b=c+(e<<5&4294967295|e>>>27);e=g+(c^f&(b^c))+d[10]+38016083&4294967295;g=b+(e<<9&4294967295|e>>>23);e=f+(b^c&(g^b))+d[15]+3634488961&4294967295;f=g+(e<<14&4294967295|e>>>18);e=c+(g^b&(f^g))+d[4]+3889429448&4294967295;c=
f+(e<<20&4294967295|e>>>12);e=b+(f^g&(c^f))+d[9]+568446438&4294967295;b=c+(e<<5&4294967295|e>>>27);e=g+(c^f&(b^c))+d[14]+3275163606&4294967295;g=b+(e<<9&4294967295|e>>>23);e=f+(b^c&(g^b))+d[3]+4107603335&4294967295;f=g+(e<<14&4294967295|e>>>18);e=c+(g^b&(f^g))+d[8]+1163531501&4294967295;c=f+(e<<20&4294967295|e>>>12);e=b+(f^g&(c^f))+d[13]+2850285829&4294967295;b=c+(e<<5&4294967295|e>>>27);e=g+(c^f&(b^c))+d[2]+4243563512&4294967295;g=b+(e<<9&4294967295|e>>>23);e=f+(b^c&(g^b))+d[7]+1735328473&4294967295;
f=g+(e<<14&4294967295|e>>>18);e=c+(g^b&(f^g))+d[12]+2368359562&4294967295;c=f+(e<<20&4294967295|e>>>12);e=b+(c^f^g)+d[5]+4294588738&4294967295;b=c+(e<<4&4294967295|e>>>28);e=g+(b^c^f)+d[8]+2272392833&4294967295;g=b+(e<<11&4294967295|e>>>21);e=f+(g^b^c)+d[11]+1839030562&4294967295;f=g+(e<<16&4294967295|e>>>16);e=c+(f^g^b)+d[14]+4259657740&4294967295;c=f+(e<<23&4294967295|e>>>9);e=b+(c^f^g)+d[1]+2763975236&4294967295;b=c+(e<<4&4294967295|e>>>28);e=g+(b^c^f)+d[4]+1272893353&4294967295;g=b+(e<<11&4294967295|
e>>>21);e=f+(g^b^c)+d[7]+4139469664&4294967295;f=g+(e<<16&4294967295|e>>>16);e=c+(f^g^b)+d[10]+3200236656&4294967295;c=f+(e<<23&4294967295|e>>>9);e=b+(c^f^g)+d[13]+681279174&4294967295;b=c+(e<<4&4294967295|e>>>28);e=g+(b^c^f)+d[0]+3936430074&4294967295;g=b+(e<<11&4294967295|e>>>21);e=f+(g^b^c)+d[3]+3572445317&4294967295;f=g+(e<<16&4294967295|e>>>16);e=c+(f^g^b)+d[6]+76029189&4294967295;c=f+(e<<23&4294967295|e>>>9);e=b+(c^f^g)+d[9]+3654602809&4294967295;b=c+(e<<4&4294967295|e>>>28);e=g+(b^c^f)+d[12]+
3873151461&4294967295;g=b+(e<<11&4294967295|e>>>21);e=f+(g^b^c)+d[15]+530742520&4294967295;f=g+(e<<16&4294967295|e>>>16);e=c+(f^g^b)+d[2]+3299628645&4294967295;c=f+(e<<23&4294967295|e>>>9);e=b+(f^(c|~g))+d[0]+4096336452&4294967295;b=c+(e<<6&4294967295|e>>>26);e=g+(c^(b|~f))+d[7]+1126891415&4294967295;g=b+(e<<10&4294967295|e>>>22);e=f+(b^(g|~c))+d[14]+2878612391&4294967295;f=g+(e<<15&4294967295|e>>>17);e=c+(g^(f|~b))+d[5]+4237533241&4294967295;c=f+(e<<21&4294967295|e>>>11);e=b+(f^(c|~g))+d[12]+1700485571&
4294967295;b=c+(e<<6&4294967295|e>>>26);e=g+(c^(b|~f))+d[3]+2399980690&4294967295;g=b+(e<<10&4294967295|e>>>22);e=f+(b^(g|~c))+d[10]+4293915773&4294967295;f=g+(e<<15&4294967295|e>>>17);e=c+(g^(f|~b))+d[1]+2240044497&4294967295;c=f+(e<<21&4294967295|e>>>11);e=b+(f^(c|~g))+d[8]+1873313359&4294967295;b=c+(e<<6&4294967295|e>>>26);e=g+(c^(b|~f))+d[15]+4264355552&4294967295;g=b+(e<<10&4294967295|e>>>22);e=f+(b^(g|~c))+d[6]+2734768916&4294967295;f=g+(e<<15&4294967295|e>>>17);e=c+(g^(f|~b))+d[13]+1309151649&
4294967295;c=f+(e<<21&4294967295|e>>>11);e=b+(f^(c|~g))+d[4]+4149444226&4294967295;b=c+(e<<6&4294967295|e>>>26);e=g+(c^(b|~f))+d[11]+3174756917&4294967295;g=b+(e<<10&4294967295|e>>>22);e=f+(b^(g|~c))+d[2]+718787259&4294967295;f=g+(e<<15&4294967295|e>>>17);e=c+(g^(f|~b))+d[9]+3951481745&4294967295;a.a[0]=a.a[0]+b&4294967295;a.a[1]=a.a[1]+(f+(e<<21&4294967295|e>>>11))&4294967295;a.a[2]=a.a[2]+f&4294967295;a.a[3]=a.a[3]+g&4294967295}
Gc.prototype.c=function(a,b){void 0===b&&(b=a.length);for(var c=b-this.b,d=this.h,f=this.f,g=0;g<b;){if(0==f)for(;g<=c;)Hc(this,a,g),g+=this.b;if("string"===typeof a)for(;g<b;){if(d[f++]=a.charCodeAt(g++),f==this.b){Hc(this,d);f=0;break}}else for(;g<b;)if(d[f++]=a[g++],f==this.b){Hc(this,d);f=0;break}}this.f=f;this.g+=b};
Gc.prototype.j=function(){var a=Array((56>this.f?this.b:2*this.b)-this.f);a[0]=128;for(var b=1;b<a.length-8;++b)a[b]=0;var c=8*this.g;for(b=a.length-8;b<a.length;++b)a[b]=c&255,c/=256;this.c(a);a=Array(16);for(b=c=0;4>b;++b)for(var d=0;32>d;d+=8)a[c++]=this.a[b]>>>d&255;return a};var Ic=/^(?:([^:/?#.]+):)?(?:\/\/(?:([^/?#]*)@)?([^/#?]*?)(?::([0-9]+))?(?=[/#?]|$))?([^?#]+)?(?:\?([^#]*))?(?:#([\s\S]*))?$/;var Jc={ra:!0},Kc={ta:!0},Lc={sa:!0};function Mc(){throw Error("Do not instantiate directly");}Mc.prototype.ea=null;Mc.prototype.toString=function(){return this.Y};function Nc(){Mc.call(this)}u(Nc,Mc);Nc.prototype.G=Jc;function Oc(a){if(null!=a)switch(a.ea){case 1:return 1;case -1:return-1;case 0:return 0}return null}function Pc(a){if(null==a||a.G!==Jc)if(a instanceof B){var b=N;if(a instanceof B&&a.constructor===B&&a.c===Za)var c=a.b;else v("expected object of type SafeHtml, got '"+a+"' of type "+q(a)),c="type_error:SafeHtml";a=b(c.toString(),a.a())}else a=N($a(String(String(a))),Oc(a));return a}
var N=function(a){function b(c){this.Y=c}b.prototype=a.prototype;return function(c,d){c=new b(String(c));void 0!==d&&(c.ea=d);return c}}(Nc);function O(a){null!=a&&a.G===Jc?(a=String(a.Y).replace(Qc,"").replace(Rc,"&lt;"),a=String(a).replace(Sc,Tc)):a=$a(String(a));return a}
function P(a,b,c,d){a||v("expected param "+b+" of type "+d+(", but got "+(c instanceof Function?c.displayName||c.name||"unknown type name":c instanceof Object?c.constructor.displayName||c.constructor.name||Object.prototype.toString.call(c):null===c?"null":typeof c))+".");return c}
var Uc={"\x00":"&#0;","\t":"&#9;","\n":"&#10;","\x0B":"&#11;","\f":"&#12;","\r":"&#13;"," ":"&#32;",'"':"&quot;","&":"&amp;","'":"&#39;","-":"&#45;","/":"&#47;","<":"&lt;","=":"&#61;",">":"&gt;","`":"&#96;","\u0085":"&#133;","\u00a0":"&#160;","\u2028":"&#8232;","\u2029":"&#8233;"};function Tc(a){return Uc[a]}
var Vc={"\x00":"%00","\u0001":"%01","\u0002":"%02","\u0003":"%03","\u0004":"%04","\u0005":"%05","\u0006":"%06","\u0007":"%07","\b":"%08","\t":"%09","\n":"%0A","\x0B":"%0B","\f":"%0C","\r":"%0D","\u000e":"%0E","\u000f":"%0F","\u0010":"%10","\u0011":"%11","\u0012":"%12","\u0013":"%13","\u0014":"%14","\u0015":"%15","\u0016":"%16","\u0017":"%17","\u0018":"%18","\u0019":"%19","\u001a":"%1A","\u001b":"%1B","\u001c":"%1C","\u001d":"%1D","\u001e":"%1E","\u001f":"%1F"," ":"%20",'"':"%22","'":"%27","(":"%28",
")":"%29","<":"%3C",">":"%3E","\\":"%5C","{":"%7B","}":"%7D","\u007f":"%7F","\u0085":"%C2%85","\u00a0":"%C2%A0","\u2028":"%E2%80%A8","\u2029":"%E2%80%A9","\uff01":"%EF%BC%81","\uff03":"%EF%BC%83","\uff04":"%EF%BC%84","\uff06":"%EF%BC%86","\uff07":"%EF%BC%87","\uff08":"%EF%BC%88","\uff09":"%EF%BC%89","\uff0a":"%EF%BC%8A","\uff0b":"%EF%BC%8B","\uff0c":"%EF%BC%8C","\uff0f":"%EF%BC%8F","\uff1a":"%EF%BC%9A","\uff1b":"%EF%BC%9B","\uff1d":"%EF%BC%9D","\uff1f":"%EF%BC%9F","\uff20":"%EF%BC%A0","\uff3b":"%EF%BC%BB",
"\uff3d":"%EF%BC%BD"};function Wc(a){return Vc[a]}var Sc=/[\x00\x22\x27\x3c\x3e]/g,Xc=/[\x00- \x22\x27-\x29\x3c\x3e\\\x7b\x7d\x7f\x85\xa0\u2028\u2029\uff01\uff03\uff04\uff06-\uff0c\uff0f\uff1a\uff1b\uff1d\uff1f\uff20\uff3b\uff3d]/g,Yc=/^[^&:\/?#]*(?:[\/?#]|$)|^https?:|^data:image\/[a-z0-9+]+;base64,[a-z0-9+\/]+=*$|^blob:/i,Qc=/<(?:!|\/?([a-zA-Z][a-zA-Z0-9:\-]*))(?:[^>'"]|"[^"]*"|'[^']*')*>/g,Rc=/</g;function Zc(){this.b=64;this.a=[];this.i=[];this.l=[];this.g=[];this.g[0]=128;for(var a=1;a<this.b;++a)this.g[a]=0;this.h=this.f=0;this.reset()}u(Zc,Fc);Zc.prototype.reset=function(){this.a[0]=1732584193;this.a[1]=4023233417;this.a[2]=2562383102;this.a[3]=271733878;this.a[4]=3285377520;this.h=this.f=0};
function $c(a,b,c){c||(c=0);var d=a.l;if("string"===typeof b)for(var f=0;16>f;f++)d[f]=b.charCodeAt(c)<<24|b.charCodeAt(c+1)<<16|b.charCodeAt(c+2)<<8|b.charCodeAt(c+3),c+=4;else for(f=0;16>f;f++)d[f]=b[c]<<24|b[c+1]<<16|b[c+2]<<8|b[c+3],c+=4;for(f=16;80>f;f++){var g=d[f-3]^d[f-8]^d[f-14]^d[f-16];d[f]=(g<<1|g>>>31)&4294967295}b=a.a[0];c=a.a[1];var e=a.a[2],h=a.a[3],k=a.a[4];for(f=0;80>f;f++){if(40>f)if(20>f){g=h^c&(e^h);var l=1518500249}else g=c^e^h,l=1859775393;else 60>f?(g=c&e|h&(c|e),l=2400959708):
(g=c^e^h,l=3395469782);g=(b<<5|b>>>27)+g+k+l+d[f]&4294967295;k=h;h=e;e=(c<<30|c>>>2)&4294967295;c=b;b=g}a.a[0]=a.a[0]+b&4294967295;a.a[1]=a.a[1]+c&4294967295;a.a[2]=a.a[2]+e&4294967295;a.a[3]=a.a[3]+h&4294967295;a.a[4]=a.a[4]+k&4294967295}
Zc.prototype.c=function(a,b){if(null!=a){void 0===b&&(b=a.length);for(var c=b-this.b,d=0,f=this.i,g=this.f;d<b;){if(0==g)for(;d<=c;)$c(this,a,d),d+=this.b;if("string"===typeof a)for(;d<b;){if(f[g]=a.charCodeAt(d),++g,++d,g==this.b){$c(this,f);g=0;break}}else for(;d<b;)if(f[g]=a[d],++g,++d,g==this.b){$c(this,f);g=0;break}}this.f=g;this.h+=b}};
Zc.prototype.j=function(){var a=[],b=8*this.h;56>this.f?this.c(this.g,56-this.f):this.c(this.g,this.b-(this.f-56));for(var c=this.b-1;56<=c;c--)this.i[c]=b&255,b/=256;$c(this,this.i);for(c=b=0;5>c;c++)for(var d=24;0<=d;d-=8)a[b]=this.a[c]>>d&255,++b;return a};function ad(){var a=bd;a=P(ja(a),"version",a,"string");return N('<div class="'+O("a-b")+'"><h1>Course Handbook ('+Pc(a)+')</h1><input type="text" class="'+O("a-d")+'" placeholder="algorithm"><button class="'+O("v-w")+" "+O("a-search")+'">Search</button><div class="'+O("a-c")+'"></div></div>')};function Q(){fc.call(this);this.c=new nc(this);this.ga=this}u(Q,fc);Q.prototype[jc]=!0;Q.prototype.removeEventListener=function(a,b,c,d){Ac(this,a,b,c,d)};function R(a,b){a=a.ga;var c=b.type||b;if("string"===typeof b)b=new I(b,a);else if(b instanceof I)b.target=b.target||a;else{var d=b;b=new I(c,a);Ta(b,d)}a=b.a=a;cd(a,c,!0,b);cd(a,c,!1,b)}
function cd(a,b,c,d){if(b=a.c.a[String(b)]){b=b.concat();for(var f=!0,g=0;g<b.length;++g){var e=b[g];if(e&&!e.D&&e.capture==c){var h=e.listener,k=e.N||e.src;e.L&&pc(a.c,e);f=!1!==h.call(k,d)&&f}}}};function dd(a,b,c){if(oa(a))c&&(a=r(a,c));else if(a&&"function"==typeof a.handleEvent)a=r(a.handleEvent,a);else throw Error("Invalid listener argument");return 2147483647<Number(b)?-1:p.setTimeout(a,b||0)};var ed=p.JSON.stringify;var fd=p.JSON.parse;function gd(a){switch(a){case 0:return"No Error";case 1:return"Access denied to content document";case 2:return"File not found";case 3:return"Firefox silently errored";case 4:return"Application custom error";case 5:return"An exception occurred";case 6:return"Http response at 400 or 500 level";case 7:return"Request was aborted";case 8:return"Request timed out";case 9:return"The resource is not available offline";default:return"Unrecognized error code"}};function hd(){}hd.prototype.a=null;function id(a){var b;(b=a.a)||(b={},jd(a)&&(b[0]=!0,b[1]=!0),b=a.a=b);return b};var kd;function ld(){}u(ld,hd);function md(a){return(a=jd(a))?new ActiveXObject(a):new XMLHttpRequest}function jd(a){if(!a.b&&"undefined"==typeof XMLHttpRequest&&"undefined"!=typeof ActiveXObject){for(var b=["MSXML2.XMLHTTP.6.0","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP","Microsoft.XMLHTTP"],c=0;c<b.length;c++){var d=b[c];try{return new ActiveXObject(d),a.b=d}catch(f){}}throw Error("Could not create ActiveXObject. ActiveX might be disabled, or MSXML might not be installed");}return a.b}kd=new ld;function S(a){Q.call(this);this.headers=new Yb;this.K=a||null;this.f=!1;this.J=this.a=null;this.aa=this.F="";this.g=0;this.i="";this.h=this.U=this.A=this.T=!1;this.l=0;this.P=null;this.j=nd;this.R=this.u=!1}u(S,Q);var nd="";S.prototype.b=E("goog.net.XhrIo");var od=/^https?$/i,pd=["POST","PUT"];
function qd(a,b,c,d){if(a.a)throw Error("[goog.net.XhrIo] Object is active with another request="+a.F+"; newUri="+b);c=c?c.toUpperCase():"GET";a.F=b;a.i="";a.g=0;a.aa=c;a.T=!1;a.f=!0;a.a=a.K?md(a.K):md(kd);a.J=a.K?id(a.K):id(kd);a.a.onreadystatechange=r(a.ba,a);try{M(a.b,T(a,"Opening Xhr")),a.U=!0,a.a.open(c,String(b),!0),a.U=!1}catch(e){M(a.b,T(a,"Error opening Xhr: "+e.message));rd(a,e);return}b=d||"";d=new Yb(a.headers);var f=Ba(d.W()),g=p.FormData&&b instanceof p.FormData;!(0<=ya(pd,c))||f||g||
d.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8");d.forEach(function(e,h){this.a.setRequestHeader(h,e)},a);a.j&&(a.a.responseType=a.j);"withCredentials"in a.a&&a.a.withCredentials!==a.u&&(a.a.withCredentials=a.u);try{sd(a),0<a.l&&(a.R=td(a.a),M(a.b,T(a,"Will abort after "+a.l+"ms if incomplete, xhr2 "+a.R)),a.R?(a.a.timeout=a.l,a.a.ontimeout=r(a.ca,a)):a.P=dd(a.ca,a.l,a)),M(a.b,T(a,"Sending request")),a.A=!0,a.a.send(b),a.A=!1}catch(e){M(a.b,T(a,"Send error: "+e.message)),rd(a,
e)}}function td(a){return C&&nb(9)&&"number"===typeof a.timeout&&void 0!==a.ontimeout}function Ca(a){return"content-type"==a.toLowerCase()}S.prototype.ca=function(){"undefined"!=typeof ia&&this.a&&(this.i="Timed out after "+this.l+"ms, aborting",this.g=8,M(this.b,T(this,this.i)),R(this,"timeout"),this.abort(8))};function rd(a,b){a.f=!1;a.a&&(a.h=!0,a.a.abort(),a.h=!1);a.i=b;a.g=5;ud(a);vd(a)}function ud(a){a.T||(a.T=!0,R(a,"complete"),R(a,"error"))}
S.prototype.abort=function(a){this.a&&this.f&&(M(this.b,T(this,"Aborting")),this.f=!1,this.h=!0,this.a.abort(),this.h=!1,this.g=a||7,R(this,"complete"),R(this,"abort"),vd(this))};S.prototype.ba=function(){this.S||(this.U||this.A||this.h?wd(this):this.ha())};S.prototype.ha=function(){wd(this)};
function wd(a){if(a.f&&"undefined"!=typeof ia)if(a.J[1]&&4==U(a)&&2==xd(a))M(a.b,T(a,"Local request error detected and ignored"));else if(a.A&&4==U(a))dd(a.ba,0,a);else if(R(a,"readystatechange"),4==U(a)){M(a.b,T(a,"Request complete"));a.f=!1;try{var b=xd(a);a:switch(b){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:var c=!0;break a;default:c=!1}var d;if(!(d=c)){var f;if(f=0===b){var g=String(a.F).match(Ic)[1]||null;if(!g&&p.self&&p.self.location){var e=p.self.location.protocol;g=
e.substr(0,e.length-1)}f=!od.test(g?g.toLowerCase():"")}d=f}if(d)R(a,"complete"),R(a,"success");else{a.g=6;try{var h=2<U(a)?a.a.statusText:""}catch(k){M(a.b,"Can not get status: "+k.message),h=""}a.i=h+" ["+xd(a)+"]";ud(a)}}finally{vd(a)}}}function vd(a){if(a.a){sd(a);var b=a.a,c=a.J[0]?la:null;a.a=null;a.J=null;R(a,"ready");try{b.onreadystatechange=c}catch(d){K(a.b,"Problem encountered resetting onreadystatechange: "+d.message)}}}
function sd(a){a.a&&a.R&&(a.a.ontimeout=null);a.P&&(p.clearTimeout(a.P),a.P=null)}function U(a){return a.a?a.a.readyState:0}function xd(a){try{return 2<U(a)?a.a.status:-1}catch(b){return-1}}
function yd(a){try{if(!a.a)return null;if("response"in a.a)return a.a.response;switch(a.j){case nd:case "text":return a.a.responseText;case "arraybuffer":if("mozResponseArrayBuffer"in a.a)return a.a.mozResponseArrayBuffer}K(a.b,"Response type "+a.j+" is not supported on this browser");return null}catch(b){return M(a.b,"Can not get response: "+b.message),null}}function zd(a,b){if(a.a&&4==U(a))return a=a.a.getResponseHeader(b),null===a?void 0:a}
function Ad(a){var b={};a=(a.a&&4==U(a)?a.a.getAllResponseHeaders()||"":"").split("\r\n");for(var c=0;c<a.length;c++)if(!/^[\s\xa0]*$/.test(a[c])){var d=ab(a[c]),f=d[0];d=d[1];if("string"===typeof d){d=d.trim();var g=b[f]||[];b[f]=g;g.push(d)}}return Ra(b,function(e){return e.join(", ")})}function T(a,b){return b+" ["+a.aa+" "+a.F+" "+xd(a)+"]"};var Bd=E("com.quoccabank.qos.lockscreen"),Cd=new S,bd;function Dd(a){a=a.target;var b=a.a?fd(a.a.responseText):void 0;a=H("a-c");var c="<table><tr><th>Code</th><th>Name</th></tr>";b=b.courses;for(var d=b.length,f=0;f<d;f++){var g=b[f];c+="<tr><td>"+Pc(g.id)+"</td><td>"+Pc(g.title)+"</td></tr>"}c=N(c+"</table>");a.innerHTML=c}
function Ed(a){L(Bd,"starting handbook ("+a+")...");bd=a;Cd.u=!0;Cd.c.add("complete",Dd,!1,void 0,void 0);Qb("qos-container").innerHTML=ad();J(H("a-search"),"click",function(){var b=bc(H("a-d"));Fd(b)});Fd("")}function Fd(a){qd(Cd,"https://qos-handbook-"+bd+".quoccabank.com/?query="+encodeURIComponent(String(a)))};function Gd(a,b,c){this.c=a;this.a=b;this.b=c}Gd.prototype.getMetadata=function(){return this.b};function Hd(a,b,c){this.name=a;this.a=b;this.b=c}function Id(a,b,c){c=void 0===c?{}:c;return new Gd(b,a,c)};function Jd(a,b){return b instanceof Hd?b:new Hd(a,b.a,b.b)};function Kd(){this.j=null;this.i=[];this.l=0;this.b=Ld;this.f=this.a=this.h=0;this.c=null;this.g=0}var Ld=0;function Md(a,b,c,d){a.b=3;a.j="The stream is broken @"+a.l+"/"+c+". Error: "+d+". With input:\n"+b;throw Error(a.j);}
function Nd(a,b){function c(l){0==l?e.h=l:128==l?e.h=l:Md(e,h,k,"invalid frame byte");e.b=1;e.a=0;e.f=0}function d(l){e.f++;e.a=(e.a<<8)+l;4==e.f&&(e.b=2,e.g=0,"undefined"!==typeof Uint8Array?e.c=new Uint8Array(e.a):e.c=Array(e.a),0==e.a&&g())}function f(l){e.c[e.g++]=l;e.g==e.a&&g()}function g(){var l={};l[e.h]=e.c;e.i.push(l);e.b=Ld}var e=a,h,k=0;for(b instanceof Uint8Array||b instanceof Array?h=b:h=new Uint8Array(b);k<h.length;){switch(e.b){case 3:Md(e,h,k,"stream already broken");break;case Ld:c(h[k]);
break;case 1:d(h[k]);break;case 2:f(h[k]);break;default:throw Error("unexpected parser state: "+e.b);}e.l++;k++}a=e.i;e.i=[];return 0<a.length?a:null};function Od(a){switch(a){case 200:return 0;case 400:return 3;case 401:return 16;case 403:return 7;case 404:return 5;case 409:return 10;case 412:return 9;case 429:return 8;case 499:return 1;case 500:return 2;case 501:return 12;case 503:return 14;case 504:return 4;default:return 2}};var Pd={},Qd=null;function Rd(a){var b=a.length,c=3*b/4;c%3?c=Math.floor(c):x("=.",a[b-1])&&(c=x("=.",a[b-2])?c-2:c-1);var d=new Uint8Array(c),f=0;Sd(a,function(g){d[f++]=g});return d.subarray(0,f)}
function Sd(a,b){function c(k){for(;d<a.length;){var l=a.charAt(d++),m=Qd[l];if(null!=m)return m;if(!/^[\s\xa0]*$/.test(l))throw Error("Unknown base64 encoding at char: "+l);}return k}Td();for(var d=0;;){var f=c(-1),g=c(0),e=c(64),h=c(64);if(64===h&&-1===f)break;b(f<<2|g>>4);64!=e&&(b(g<<4&240|e>>2),64!=h&&b(e<<6&192|h))}}
function Td(){if(!Qd){Qd={};for(var a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),b=["+/=","+/","-_=","-_.","-_"],c=0;5>c;c++){var d=a.concat(b[c].split(""));Pd[c]=d;for(var f=0;f<d.length;f++){var g=d[f];void 0===Qd[g]&&(Qd[g]=f)}}}};var Ud=["content-type","grpc-status","grpc-message"];
function V(a){this.a=a.qa;this.f=this.b=this.g=this.c=this.j=this.l=null;this.i=!1;this.h=0;this.u=new Kd;var b=this;J(this.a,"readystatechange",function(){var c=b.a;if(c=c.a?c.a.getResponseHeader("Content-Type"):null){c=c.toLowerCase();if(0==c.lastIndexOf("application/grpc-web-text",0)){c=b.a;try{var d=c.a?c.a.responseText:""}catch(k){M(c.b,"Can not get responseText: "+k.message),d=""}c=d.length-d.length%4;d=d.substr(b.h,c-b.h);if(0==d.length)return;b.h=c;d=Rd(d)}else if(0==c.lastIndexOf("application/grpc",
0))d=new Uint8Array(yd(b.a));else return;if(d=Nd(b.u,d))for(c=0;c<d.length;c++){if(0 in d[c]){var f=d[c][0];f&&(f=b.l(f))&&b.j(f)}if(128 in d[c]&&0<d[c][128].length){f="";for(var g=0;g<d[c][128].length;g++)f+=String.fromCharCode(d[c][128][g]);f=f.trim().split("\r\n");g={};for(var e=0;e<f.length;e++){var h=f[e].indexOf(":");g[f[e].substring(0,h).trim()]=f[e].substring(h+1).trim()}f=g;g=0;e="";"grpc-status"in f&&(g=f["grpc-status"],delete f["grpc-status"]);"grpc-message"in f&&(e=f["grpc-message"],delete f["grpc-message"]);
b.c&&b.c({code:Number(g),details:e,O:f})}}}});J(this.a,"complete",function(){var c=b.a.g,d="",f={},g=Ad(b.a);b.g&&(Object.keys(g).forEach(function(h){Ud.includes(h)||(f[h]=g[h])}),b.g(f));if(0!=c){switch(c){case 7:var e=10;break;case 8:e=4;break;case 6:e=Od(xd(b.a));break;default:e=14}10==e&&b.i||!b.b||b.b({code:e,message:gd(c)})}else c=!1,"grpc-status"in g&&(e=zd(b.a,"grpc-status"),"grpc-message"in g&&(d=zd(b.a,"grpc-message")),0!=Number(e)&&b.b&&(b.b({code:Number(e),message:d,O:g}),c=!0),!c&&b.c&&
b.c({code:Number(e),details:d,O:g})),!c&&b.f&&b.f()})}V.prototype.B=function(a,b){"data"==a?this.j=b:"status"==a?this.c=b:"metadata"==a?this.g=b:"end"==a?this.f=b:"error"==a&&(this.b=b);return this};V.prototype.on=V.prototype.B;V.prototype.cancel=function(){this.i=!0;this.a.abort()};V.prototype.cancel=V.prototype.cancel;function Vd(a){var b="";Qa(a,function(c,d){b+=d;b+=":";b+=c;b+="\r\n"});return b};function Wd(a,b){this.ma=a;this.a=b||{}}Wd.prototype.getMetadata=function(){return this.a};function W(a){this.a=ka("format",a)||"text";this.f=ka("suppressCorsPreflight",a)||!1;this.c=ka("withCredentials",a)||!1;this.b=ka("streamInterceptors",a)||[];this.g=ka("unaryInterceptors",a)||[]}W.prototype.I=function(a,b,c,d,f){var g=this;d=Jd(a,d);var e=a.substr(0,a.length-d.name.length);a=Xd(function(h){return Yd(g,h,e)},this.b).call(this,Id(d,b,c));Zd(a,f,!1);return a};W.prototype.rpcCall=W.prototype.I;
W.prototype.pa=function(a,b,c,d){var f=this;d=Jd(a,d);var g=a.substr(0,a.length-d.name.length);return Xd(function(e){return new Promise(function(h,k){var l=Yd(f,e,g),m,w;Zd(l,function(t,F,qa,ea){t?k(t):F?w=F:qa||(ea?m=ea:h(new Wd(w,m)))},!0)})},this.g).call(this,Id(d,b,c)).then(function(e){return e.ma})};W.prototype.unaryCall=W.prototype.pa;
W.prototype.na=function(a,b,c,d){var f=this;d=Jd(a,d);var g=a.substr(0,a.length-d.name.length);return Xd(function(e){return Yd(f,e,g)},this.b).call(this,Id(d,b,c))};W.prototype.serverStreaming=W.prototype.na;
function Yd(a,b,c){var d=b.a,f=c+d.name;c=new S;c.u=a.c;var g=new V({qa:c});g.l=d.b;Zb(c.headers,b.getMetadata());"text"==a.a?(c.headers.set("Content-Type","application/grpc-web-text"),c.headers.set("Accept","application/grpc-web-text")):c.headers.set("Content-Type","application/grpc-web+proto");c.headers.set("X-User-Agent","grpc-web-javascript/0.1");c.headers.set("X-Grpc-Web","1");if(ac(c.headers.b,"deadline")){var e=c.headers.get("deadline");e=Math.round(e-(new Date).getTime());c.headers.remove("deadline");
Infinity===e&&(e=0);0<e&&c.headers.set("grpc-timeout",e+"m")}if(a.f){var h=c.headers;$b(h);e={};for(var k=0;k<h.a.length;k++){var l=h.a[k];e[l]=h.b[l]}h=c.headers;h.b={};h.a.length=0;h.c=0;b:{for(m in e){var m=!1;break b}m=!0}if(!m)if(e=Vd(e),"string"===typeof f){if(m=encodeURIComponent("$httpHeaders"),e=null!=e?"="+encodeURIComponent(String(e)):"",m+=e)e=f.indexOf("#"),0>e&&(e=f.length),h=f.indexOf("?"),0>h||h>e?(h=e,k=""):k=f.substring(h+1,e),f=[f.substr(0,h),k,f.substr(e)],e=f[1],f[1]=m?e?e+"&"+
m:m:e,f=f[0]+(f[1]?"?"+f[1]:"")+f[2]}else f.a("$httpHeaders",e)}b=d.a(b.c);d=b.length;m=[0,0,0,0];e=new Uint8Array(5+d);for(h=3;0<=h;h--)m[h]=d%256,d>>>=8;e.set(new Uint8Array(m),1);e.set(b,5);b=e;if("text"==a.a){a=b;var w;void 0===w&&(w=0);Td();w=Pd[w];b=[];for(d=0;d<a.length;d+=3){l=a[d];var t=(m=d+1<a.length)?a[d+1]:0;k=(e=d+2<a.length)?a[d+2]:0;h=l>>2;l=(l&3)<<4|t>>4;t=(t&15)<<2|k>>6;k&=63;e||(k=64,m||(t=64));b.push(w[h],w[l],w[t]||"",w[k]||"")}b=b.join("")}else"binary"==a.a&&(c.j="arraybuffer");
qd(c,f,"POST",b);return g}function Zd(a,b,c){a.B("data",function(d){b(null,d)});a.B("error",function(d){0!=d.code&&b(d,null)});a.B("status",function(d){0!=d.code?b({code:d.code,message:d.details,O:d.O},null):c&&b(null,null,d)});c&&(a.B("metadata",function(d){b(null,null,null,d)}),a.B("end",function(){b(null,null)}))}function Xd(a,b){var c=a;b.forEach(function(d){var f=c;c=function(g){return d.a(g,f)}});return c};function $d(a){if(a.constructor===Uint8Array)return a;if(a.constructor===ArrayBuffer)return new Uint8Array(a);if("undefined"!=typeof Buffer&&a.constructor===Buffer)return new Uint8Array(a);if(a.constructor===Array)return new Uint8Array(a);if(a.constructor===String)return Rd(a);v("Type not convertible to Uint8Array.");return new Uint8Array(0)};function ae(a){this.b=null;this.a=this.c=this.f=0;this.g=!1;a&&be(this,a)}var ce=[];function be(a,b){a.b=$d(b);a.f=0;a.c=a.b.length;a.a=a.f}ae.prototype.reset=function(){this.a=this.f};
function de(a){var b=a.b;var c=b[a.a];var d=c&127;if(128>c)return a.a+=1,d;c=b[a.a+1];d|=(c&127)<<7;if(128>c)return a.a+=2,d;c=b[a.a+2];d|=(c&127)<<14;if(128>c)return a.a+=3,d;c=b[a.a+3];d|=(c&127)<<21;if(128>c)return a.a+=4,d;c=b[a.a+4];d|=(c&15)<<28;if(128>c)return a.a+=5,d>>>0;a.a+=5;128<=b[a.a++]&&128<=b[a.a++]&&128<=b[a.a++]&&128<=b[a.a++]&&a.a++;return d};function ee(a){if(ce.length){var b=ce.pop();a&&be(b,a);a=b}else a=new ae(a);this.a=a;this.g=this.a.a;this.b=this.c=-1;this.f=!1}ee.prototype.reset=function(){this.a.reset();this.b=this.c=-1};function fe(a){var b=a.a;if(b.a==b.c)return!1;(b=a.f)||(b=a.a,b=b.g||0>b.a||b.a>b.c);if(b)return v("Decoder hit an error"),!1;a.g=a.a.a;var c=de(a.a);b=c>>>3;c&=7;if(0!=c&&5!=c&&1!=c&&2!=c&&3!=c&&4!=c)return v("Invalid wire type: %s (at position %s)",c,a.g),a.f=!0,!1;a.c=b;a.b=c;return!0}
function X(a){switch(a.b){case 0:if(0!=a.b)v("Invalid wire type for skipVarintField"),X(a);else{for(a=a.a;a.b[a.a]&128;)a.a++;a.a++}break;case 1:1!=a.b?(v("Invalid wire type for skipFixed64Field"),X(a)):(a=a.a,a.a+=8);break;case 2:if(2!=a.b)v("Invalid wire type for skipDelimitedField"),X(a);else{var b=de(a.a);a=a.a;a.a+=b}break;case 5:5!=a.b?(v("Invalid wire type for skipFixed32Field"),X(a)):(a=a.a,a.a+=4);break;case 3:b=a.c;do{if(!fe(a)){v("Unmatched start-group tag: stream EOF");a.f=!0;break}if(4==
a.b){a.c!=b&&(v("Unmatched end-group tag"),a.f=!0);break}X(a)}while(1);break;default:v("Invalid wire encoding for field.")}}
function ge(a){var b=de(a.a);a=a.a;var c=a.b,d=a.a;b=d+b;for(var f=[],g="";d<b;){var e=c[d++];if(128>e)f.push(e);else if(192>e)continue;else if(224>e){var h=c[d++];f.push((e&31)<<6|h&63)}else if(240>e){h=c[d++];var k=c[d++];f.push((e&15)<<12|(h&63)<<6|k&63)}else if(248>e){h=c[d++];k=c[d++];var l=c[d++];e=(e&7)<<18|(h&63)<<12|(k&63)<<6|l&63;e-=65536;f.push((e>>10&1023)+55296,(e&1023)+56320)}8192<=f.length&&(g+=String.fromCharCode.apply(null,f),f.length=0)}g+=Nb(f);a.a=d;return g}
function he(a){var b=de(a.a);a=a.a;if(0>b||a.a+b>a.b.length)a.g=!0,v("Invalid byte length!"),b=new Uint8Array(0);else{var c=a.b.subarray(a.a,a.a+b);a.a+=b;b=c}return b};function ie(){this.a=[]}ie.prototype.length=function(){return this.a.length};function je(a){var b=a.a;a.a=[];return b}function ke(a,b){for(;127<b;)a.a.push(b&127|128),b>>>=7;a.a.push(b)};function le(){this.c=[];this.b=0;this.a=new ie}le.prototype.reset=function(){this.c=[];je(this.a);this.b=0};function me(a){for(var b=new Uint8Array(a.b+a.a.length()),c=a.c,d=c.length,f=0,g=0;g<d;g++){var e=c[g];b.set(e,f);f+=e.length}c=je(a.a);b.set(c,f);a.c=[b];return b}
function ne(a,b,c){if(null!=c){ke(a.a,8*b+2);b=je(a.a);a.c.push(b);a.b+=b.length;b.push(a.b);for(var d=a.a,f=0;f<c.length;f++){var g=c.charCodeAt(f);if(128>g)d.a.push(g);else if(2048>g)d.a.push(g>>6|192),d.a.push(g&63|128);else if(65536>g)if(55296<=g&&56319>=g&&f+1<c.length){var e=c.charCodeAt(f+1);56320<=e&&57343>=e&&(g=1024*(g-55296)+e-56320+65536,d.a.push(g>>18|240),d.a.push(g>>12&63|128),d.a.push(g>>6&63|128),d.a.push(g&63|128),f++)}else d.a.push(g>>12|224),d.a.push(g>>6&63|128),d.a.push(g&63|
128)}c=b.pop();for(c=a.b+a.a.length()-c;127<c;)b.push(c&127|128),c>>>=7,a.b++;b.push(c);a.b++}}function oe(a,b,c){null!=c&&(c=$d(c),ke(a.a,8*b+2),ke(a.a,c.length),b=je(a.a),a.c.push(b),a.c.push(c),a.b+=b.length+c.length)};function pe(){}var qe="function"==typeof Uint8Array;function re(a,b){a.i=null;b||(b=[]);a.h=void 0;a.b=-1;a.a=b;a:{if(b=a.a.length){--b;var c=a.a[b];if(!(null===c||"object"!=typeof c||ma(c)||qe&&c instanceof Uint8Array)){a.f=b-a.b;a.c=c;break a}}a.f=Number.MAX_VALUE}a.g={}}var se=Object.freeze?Object.freeze([]):[];function te(a){if(null==a||a instanceof Uint8Array)return a;if("string"===typeof a)return Rd(a);v("Cannot coerce to Uint8Array: "+q(a));return null}
function Y(a,b){if(b<a.f){b+=a.b;var c=a.a[b];a=c===se?a.a[b]=[]:c}else a.c?(c=a.c[b],a=c===se?a.c[b]=[]:c):a=void 0;return null==a?"":a}function ue(a,b,c){if(""!==c)if(b<a.f)a.a[b+a.b]=c;else{var d=a.f+a.b;a.a[d]||(a.c=a.a[d]={});a.c[b]=c}else a.a[b+a.b]=null}pe.prototype.toString=function(){return this.a.toString()};function ve(a){re(this,a)}u(ve,pe);function we(a){re(this,a)}u(we,pe);function xe(a){re(this,a)}u(xe,pe);function ye(a){re(this,a)}u(ye,pe);function ze(a){re(this,a)}u(ze,pe);function Ae(){var a;a||(a={});a.format="text";this.a=new W(a)}var Be=new Hd("/qos.QuoccaOS/GetUsername",function(){return me(new le)},function(a){a=new ee(a);for(var b=new ze;fe(a)&&4!=a.b;)switch(a.c){case 1:var c=ge(a);ue(b,1,c);break;default:X(a)}return b});function Ce(a){var b=De,c=new ve;b.a.I("/rpc/qos.QuoccaOS/GetUsername",c,{},Be,a)}
var Ee=new Hd("/qos.QuoccaOS/Login",function(a){var b=new le;var c=Y(a,1);0<c.length&&ne(b,1,c);c=Y(a,2);0<c.length&&ne(b,2,c);return me(b)},function(a){a=new ee(a);for(var b=new ye;fe(a)&&4!=a.b;)switch(a.c){case 1:var c=ge(a);ue(b,1,c);break;case 2:c=ge(a);ue(b,2,c);break;default:X(a)}return b});function Fe(a,b){De.a.I("/rpc/qos.QuoccaOS/Login",a,{},Ee,b)}
var Ge=new Hd("/qos.QuoccaOS/SetProfile",function(a){var b=new le;var c=te(Y(a,1));0<c.length&&oe(b,1,c);c=te(Y(a,2));0<c.length&&oe(b,2,c);return me(b)},function(a){a=new ee(a);for(var b=new we;fe(a)&&4!=a.b;)switch(a.c){case 1:var c=he(a);ue(b,1,c);break;case 2:c=he(a);ue(b,2,c);break;default:X(a)}return b});function He(a){Ie.a.I("/rpc/qos.QuoccaOS/SetProfile",a,{},Ge,Je)}
var Ke=new Hd("/qos.QuoccaOS/RecommendProfile",function(){return me(new le)},function(a){a=new ee(a);for(var b=new ve;fe(a)&&4!=a.b;)X(a);return b});function Le(a){var b=Ie,c=new ve;b.a.I("/rpc/qos.QuoccaOS/RecommendProfile",c,{},Ke,a)};var Me=E("com.quoccabank.qos.lockscreen"),Ie=new Ae;
function Je(a,b){if(a)K(Me,a.message),alert("error getting/setting profile"),Ne();else{a=Qb("qos-container");var c=Nb(Y(b,1)),d=N(Nb(Y(b,2)));c=P(ja(c),"tmpl",c,"string");b=N;d='<div class="'+O("r-b")+'"><h1>Your profile</h1><div class="'+O("r-s")+'">'+Pc(d)+'</div><hr><textarea class="'+O("r-t")+'" rows="3">';c=null!=c&&c.G===Jc?String(c.Y).replace(Sc,Tc):$a(String(c));b=b(d+c+'</textarea><br><button class="'+O("v-w")+" "+O("r-edit")+'">Save</button><button class="'+O("v-w")+" "+O("r-recommend")+
'">Recommend my profile to admin</button></div>');a.innerHTML=b;J(H("r-edit"),"click",Oe);J(H("r-recommend"),"click",Pe)}}function Ne(){L(Me,"starting profile...");He(new we)}function Oe(){for(var a=bc(H("r-t")),b=new we,c=[],d=0,f=0;f<a.length;f++){var g=a.charCodeAt(f);255<g&&(c[d++]=g&255,g>>=8);c[d++]=g}a=new Uint8Array(c);ue(b,1,a);He(b)}
function Pe(){Le(function(a){a?(K(Me,"error recommending profile: "+a.message),alert("something went wrong")):alert("an admin will look at your profile soon :)")})};function Qe(){var a=Re;a=P(ma(a),"apps",a,"!Array<{id: number, image: string, name: string,}>");for(var b='<div class="'+O("e-f")+'">',c=a.length,d=0;d<c;d++){var f=a[d],g=f.id;var e=f.name;f=f.image;g=P("number"==typeof g,"id",g,"number");e=P(ja(e),"name",e,"string");var h=P(ja(f),"image",f,"string");f=N;g='<div class="'+O("e-g-b")+'" qos-app="'+O(g)+'"><div class="'+O("e-g-i")+'"><img src="';null!=h&&h.G===Kc||null!=h&&h.G===Lc?h=String(h).replace(Xc,Wc):h instanceof A?(h instanceof A&&h.constructor===
A&&h.c===Ya?h=h.b:(v("expected object of type SafeUrl, got '"+h+"' of type "+q(h)),h="type_error:SafeUrl"),h=String(h).replace(Xc,Wc)):h instanceof z?h=String(Wa(h).toString()).replace(Xc,Wc):(h=String(h),Yc.test(h)?h=h.replace(Xc,Wc):(v("Bad value `%s` for |filterNormalizeMediaUri",[h]),h="about:invalid#zSoyz"));e=f(g+O(h)+'" width="100%"></div><div class="'+O("e-g-h")+'">'+Pc(e)+"</div></div>");b+=e}return N(b+"</div>")};var Se=E("com.quoccabank.qos.tictactoe");function Te(a,b,c){this.x=a;this.y=b;this.b=c}Te.prototype.c=function(){L(Se,"making move "+this.x+" "+this.y);if(this.a.classList.contains("x-y-z")){var a=this.b,b=ed({x:this.x,y:this.y,p:a.f});a.a.m.send(b)}else L(Se,"no longer clickable")};function Ue(a,b){Q.call(this);"object"!=typeof a&&(a={a:a,b:b});this.f=0!=a.a;this.b=a.b||Ve;this.g=a.c||We;this.a=this.b(this.H)}u(Ue,Q);var We="blob";n=Ue.prototype;n.m=null;n.s=null;n.C=void 0;n.V=!1;n.H=0;n.v=null;n.o=E("goog.net.WebSocket");function Ve(a){return Math.min(1E3*Math.pow(2,a),6E4)}
n.fa=function(a,b){null!=this.v&&p.clearTimeout(this.v);this.v=null;this.s=a;(this.C=b)?(L(this.o,"Opening the WebSocket on "+this.s+" with protocol "+this.C),this.m=new WebSocket(this.s,this.C)):(L(this.o,"Opening the WebSocket on "+this.s),this.m=new WebSocket(this.s));this.m.binaryType=this.g;this.m.onopen=r(this.la,this);this.m.onclose=r(this.ia,this);this.m.onmessage=r(this.ka,this);this.m.onerror=r(this.ja,this)};
n.close=function(){null!=this.v&&p.clearTimeout(this.v);this.v=null;this.m&&(L(this.o,"Closing the WebSocket."),this.V=!0,this.m.close(),this.m=null)};n.la=function(){L(this.o,"WebSocket opened on "+this.s);R(this,"d");this.H=0;this.a=this.b(this.H)};
n.ia=function(a){L(this.o,"The WebSocket on "+this.s+" closed.");R(this,"a");this.m=null;this.V?(L(this.o,"The WebSocket closed normally."),this.s=null,this.C=void 0):(K(this.o,"The WebSocket disconnected unexpectedly: "+a.data),this.f&&(L(this.o,"Seconds until next reconnect attempt: "+Math.floor(this.a/1E3)),this.v=dd(r(this.fa,this,this.s,this.C),this.a,this),this.H++,this.a=this.b(this.H)));this.V=!1};n.ka=function(a){R(this,new Xe(a.data))};
n.ja=function(a){a=a.data;K(this.o,"An error occurred: "+a);R(this,new Ye(a))};function Xe(a){I.call(this,"c");this.message=a}u(Xe,I);function Ye(a){I.call(this,"b");this.data=a}u(Ye,I);var Ze=E("com.quoccabank.qos.tictactoe");function $e(){var a=H("x-f"),b=H("x-p");this.a=new Ue;this.f="X";this.da=a;this.c=b;J(this.a,"d",this.h,!1,this);J(this.a,"c",this.g,!1,this);try{this.a.fa("wss://qos-tictactoe.quoccabank.com/ws")}catch(c){K(Ze,c)}}
$e.prototype.h=function(){L(Ze,"Opened connection");this.da.innerHTML="";this.b=[];for(var a=0;3>a;a++){this.b[a]=[];for(var b=0;3>b;b++){var c=new Te(a,b,this),d=c,f=[];2==d.y?f.push("border-right: none;"):0==d.y&&f.push("border-left: none;");2==d.x?f.push("border-bottom: none;"):0==d.x&&f.push("border-top: none;");d.a=Vb("DIV",{style:f.join(";")},null);d.a.className="x-y x-y-z";d.b.da.appendChild(d.a);J(d.a,"click",d.c,!1,d);this.b[a].push(c)}}};
$e.prototype.g=function(a){L(Ze,"Message received");var b=JSON.parse(a.message);switch(b.res){case "e":K(Ze,"error occured on server side");K(Ze,b.stacktrace);Xb(this.c,"error occured on server side, restarting new game");break;case "d":L(Ze,"draw");Xb(this.c,"draw! restarting new game");break;case "c":a=this.b[b.req.x][b.req.y];b=b.req.p;a.a.classList.remove("x-y-z");Xb(a.a,b);this.f="O"==this.f?"X":"O";break;default:L(Ze,b.res+" won the game"),Xb(this.c,b.res+" won the game! restarting new game")}};var af=E("com.quoccabank.qos.tictactoe");function bf(){L(af,"init tictactoe");try{fetch("https://qos-tictactoe.quoccabank.com")}catch(a){}Qb("qos-container").innerHTML=N('<div class="'+O("x-b")+'"><div class="'+O("x-p")+'"></div><div class="'+O("x-f")+'"></div></div>');new $e};var cf=E("com.quoccabank.qos.launchpad"),df=0;function ef(a,b){var c=df++,d=a.toLowerCase().replace(new RegExp(" ".replace(/([-()\[\]{}+?*.$\^|,:#<!\\])/g,"\\$1").replace(/\x08/g,"\\x08"),"g"),"".replace(/\$/g,"$$$$"))+".png",f=new Zc;f.c(d);f.c("_this_is_my_secret_salt");f=Ob(f.j());return{id:c,name:a,image:"/api/getappimage?f="+d+"&signature="+f,$:b}}var Re=[];
function ff(){L(cf,"starting launchpad...");Re.push(ef("Tic Tac Toe",bf));Re.push(ef("Profile",Ne));Re.push(ef("handbook v1",function(){Ed("v1")}));Re.push(ef("handbook v2",function(){Ed("v2")}));Qb("qos-wallpaper").classList.add("u");Qb("qos-container").innerHTML=Qe();for(var a=Rb(),b=0;b<a.length;b++)J(a[b],"click",gf,!1,a[b])}function gf(){var a=parseInt(this.getAttribute("qos-app"));L(cf,"launching app "+Re[a].name);Re[a].$()};var hf=E("com.quoccabank.qos.lockscreen"),De=new Ae;
function jf(){L(hf,"starting lockscreen...");Ce(function(a,b){a?(K(hf,a.message),alert("error getting username"),jf()):(a=Qb("qos-container"),b=Y(b,1),b=P(ja(b),"name",b,"string"),b=N('<div class="'+O("k-b")+'"><img class="'+O("k-q")+'" src="/static/qos.svg"><div class="'+O("k-p")+'"></div><img class="'+O("k-o")+'" src="/static/avatar.jpg"><p>'+Pc(b)+'</p><input type="password" class="'+O("k-l")+'" placeholder="Password" autofocus><br><button class="'+O("v-w")+" "+O("k-m")+'">Login to QuoccaOS</button><br><button class="'+
O("v-w")+" "+O("k-n")+'">Guest Signin</button></div>'),a.innerHTML=b,H("k-p").style.display="none",J(H("k-m"),"click",kf),J(H("k-n"),"click",ff))})}
function lf(){var a=H("k-p");Xb(a,"Incorrect password");a.style.display="";a=H("k-l");var b=a.type;switch("string"===typeof b&&b.toLowerCase()){case "checkbox":case "radio":a.checked="";break;case "select-one":a.selectedIndex=-1;for(var c=0;b=a.options[c];c++)if(""==b.value){b.selected=!0;break}break;case "select-multiple":b="";"string"===typeof b&&(b=[b]);for(var d=0;c=a.options[d];d++)if(c.selected=!1,b)for(var f,g=0;f=b[g];g++)c.value==f&&(c.selected=!0);break;default:a.value=""}}
function kf(){var a=bc(H("k-l")),b=new Gc;b.c(a);a=Ob(b.j());"8f60992665ca6329da8bb3422b576de0"!=a?(K(hf,"password md5 check failed"),lf()):(L(hf,"password is correct"),b=new xe,ue(b,2,a),Fe(b,function(c,d){c?(K(hf,"login failed"),lf()):(L(hf,Y(d,2)),alert(Y(d,2)+" (protip: you can copy this from console)"),ff())}))};function mf(){var a=new Kb;if(1!=a.b){var b=Db(),c=a.g;b.a||(b.a=[]);b.a.push(c);a.b=!0}Db().b=yb;jf()}var nf=["com","quoccabank","qos","init"],Z=p;nf[0]in Z||"undefined"==typeof Z.execScript||Z.execScript("var "+nf[0]);for(var of;nf.length&&(of=nf.shift());)nf.length||void 0===mf?Z[of]&&Z[of]!==Object.prototype[of]?Z=Z[of]:Z=Z[of]={}:Z[of]=mf;
// Thanks for reading me! Have a flag! COMP6443FINAL{CLOSED_SOURCE_SOFTWARE_DOES_NOT_EXIST.ejUyMzE1MjE=.QI5N4incdsSOb2dJyOZmtQ==}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment