This repository has been archived by the owner on Jul 17, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 60
/
master.min.js
5 lines (5 loc) · 145 KB
/
master.min.js
1
2
3
4
5
!function(){function e(t,n,o){function r(a,s){if(!n[a]){if(!t[a]){var c="function"==typeof require&&require;if(!s&&c)return c(a,!0);if(i)return i(a,!0);var u=new Error("Cannot find module '"+a+"'");throw u.code="MODULE_NOT_FOUND",u}var m=n[a]={exports:{}};t[a][0].call(m.exports,function(e){return r(t[a][1][e]||e)},m,m.exports,e,t,n,o)}return n[a].exports}for(var i="function"==typeof require&&require,a=0;a<o.length;a++)r(o[a]);return r}return e}()({1:[function(e,t,n){n.Command=function(e){var t=this;return e.name=e.name.toLowerCase(),e.thisArg=e.thisArg||e,e.permissions=e.permissions||{},e.permissions.use=e.permissions.use||"ALL",e.permissions.del=e.permissions.del||"NONE",e.description=e.description||"",e.creator=e.creator||"God",["Use","Del"].forEach(function(n){var o=n.toLowerCase();e["can"+n]=function(e){var n=this.permissions[o];return"ALL"===n||"NONE"!==n&&(!!t.isOwner(e)||n.indexOf(e)>-1)}}),e.exec=function(){return this.fun.apply(this.thisArg,arguments)},e.del=function(){t.info.forgotten+=1,delete t.commands[e.name],t.commandDictionary.trie.del(e.name)},e},n.CommunityCommand=function(e,t){function n(e){if(c.call(i,e))return!1;o();var n=Object.keys(a).length,s=t-n;return r.log(a,n,t),e in a?"Already registered; still need {0} more".supplant(s):(a[e]=new Date,(s-=1)>0?u.supplant(s):(r.log("should execute"),!1))}function o(){function e(e,n){return e[n]<t&&delete e[n],e}var t=new Date;t.setMinutes(t.getMinutes()-10),Object.keys(a).reduce(e,a)}var r=this,i=this.Command(e),a={},s=i.exec,c=i.canUse,u=e.pendingMessage||"Already registered; still need {0} more";return console.log(e.pendingMessage,u),t=t||2,i.canUse=function(){return!0},i.exec=function(e){var t=n(e.get("user_id"));return t?(r.log(t),t):(a={},s.apply(i,arguments))},i}},{}],2:[function(e,t,n){var o=window.IO=t.exports={events:{},preventDefault:!1,register:function(e,t,n){return this.events[e]||(this.events[e]=[]),this.events[e].push({fun:t,thisArg:n,args:Array.prototype.slice.call(arguments,3)}),this},unregister:function(e,t){return this.events[e]?(this.events[e]=this.events[e].filter(function(e){return e.fun!==t}),this):this},fire:function(e){function t(e){var t=e.fun.apply(e.thisArg,e.args.concat(n));o.preventDefault=!1===t}if(this.preventDefault=!1,this.events[e]){var n=Array.prototype.slice.call(arguments,1),o=this;this.events[e].forEach(t)}},urlstringify:function(){var e={number:!0,string:!0,boolean:!0},t=function(t){return typeof t in e?encodeURIComponent(t.toString()):""},n=function(e,n){return e=t(e),n.map(function(t){return o(e,t,!0)}).join("&")},o=function(e,n,o){return o||(e=t(e)),e+"="+t(n)};return function(e){return Object.keys(e).map(function(t){var r=e[t];return Array.isArray(r)?n(t,r):o(t,r)}).join("&")}}(),loadScript:function(e,t){var n=document.createElement("script");n.src=e,n.onload=t,document.head.appendChild(n)}};o.htmlToMarkdown=function(){var e={i:"*",b:"**",strike:"---",code:"`",a:function(e,t,n){var o=/href="([^"]+?)"/.exec(e);return o?"["+n+"]("+o[1]+")":e}},t=/<(\S+)[^\>]*>([^<]+)<\/\1>/g;return function(n){function o(t,n,o){return e.hasOwnProperty(n)?(r=e[n],r.apply?e[n].apply(e,arguments):r+o+r):t}var r;return n.replace(t,o)}}(),o.decodehtmlEntities=function(){var t=e("static/htmlEntities.json"),n=/&(#x?)?[\w;]+?;/g,o=function(e){return e.slice(1).split(";").map(r).join("")},r=function(e){return e?"#"===e[0]?i(e):t.hasOwnProperty(e)?t[e]:"&"+e+";":""},i=function(e){e=e.slice(1);var t;return t="x"===e[0]?parseInt(e.slice(1),16):parseInt(e,10),String.fromCharCode(t)};return function(e){return e.replace(n,o)}}(),["in","out"].forEach(function(e){var t=e+"put";o[e]={buffer:[],receive:function(e){return o.fire("receive"+t,e),o.preventDefault?this:(this.buffer.push(e),this)},tick:function(){return this.buffer.length&&o.fire(t,this.buffer.shift()),this},flush:function(){if(o.fire("before"+t),!this.buffer.length)return this;for(;this.buffer.length;)this.tick();return o.fire("after"+t),this.buffer=[],this}}}),o.relativeUrlToAbsolute=function(e){var t=document.createElement("a");return t.setAttribute("href",e),t.href},o.injectScript=function(e){var t=document.createElement("script");return t.src=e,document.head.appendChild(t),t},o.xhr=function(e){e=Object.merge({method:"GET",headers:{},complete:function(){}},e),e.headers=Object.merge({"Content-Type":"application/x-www-form-urlencoded"},e.headers),"object"!=typeof e.data||e.data.charAt||(e.data=o.urlstringify(e.data)),"GET"===e.method&&(e.url+="?"+e.data);var t=new XMLHttpRequest;return t.open(e.method,e.url),e.document&&(t.responseType="document"),t.addEventListener("load",function(){e.complete.call(e.thisArg,t.response,t)}),Object.iterate(e.headers,t.setRequestHeader.bind(t)),t.send(e.data),t},o.jsonp=function(e){e.data=e.data||{},e.jsonpName=e.jsonpName||"jsonp";var t,n=document.createElement("script");do{t="IO"+Date.now()*Math.ceil(Math.random())}while(window[t]);window[t]=function(){e.fun.apply(e.thisArg,arguments),delete window[t],n.parentNode.removeChild(n)},e.data[e.jsonpName]=t,-1===e.url.indexOf("?")&&(e.url+="?"),e.url+="&"+this.urlstringify(e.data),n.onerror=e.error,n.src=e.url,document.head.appendChild(n)},o.jsonp.google=function(e,t){o.jsonp({url:"http://ajax.googleapis.com/ajax/services/search/web",jsonpName:"callback",data:{v:"1.0",q:e},fun:t})},o.normalizeUnderscoreProperties=function(e){return Object.iterate(e,function(t,n){t=t.replace(/_([A-z])/g,function(e,t){return t.toUpperCase()}),delete e[t],e[t]=n}),e}},{"static/htmlEntities.json":56}],3:[function(e,t,n){n.Message=function(e,t){var n=this,o=Object(e);o.content=e;var r=function(e){n.adapter.out.add(e,t.room_id)},i={send:r,reply:function(e,o){var i=n.adapter.reply(o||t.user_name);r(i+" "+e)},directreply:function(e){var o=n.adapter.directreply(t.message_id);r(o+" "+e)},parse:function(o,r){Boolean(o)===o&&(r=o,o=e);var i=n.parseCommandArgs(o||e);return r?i.map(function(e){return n.Message(e,t)}):i},exec:function(t){var n=t.exec(e);return this.matches=n||[],n},findUserId:n.users.findUserId,findUsername:n.users.findUsername,codify:n.adapter.codify.bind(n.adapter),escape:n.adapter.escape.bind(n.adapter),link:n.adapter.link.bind(n.adapter),stringifyGiantArray:function(e){var t=499-n.adapter.reply(this.get("user_name")).length;return function(e,t){var n=0,o=[],r=e.reduce(function(e,r){var i=r.length+2;return n+i>t&&(e.push(o),o=[],n=0),o.push(r),n+=i,e},[]);return o.length&&r.push(o),r}(e,t).invoke("join",", ").join("\n")},get:function(e){return e?t[e]:t},set:function(e,n){return t[e]=n,t[e]}};return Object.iterate(i,function(e,t){o[e]=t}),o}},{}],4:[function(e,t,n){t.exports=function(t){e("plugins/STOP.js")(t),e("plugins/afk.js")(t),e("plugins/backup.js")(t),e("plugins/ban.js")(t),e("plugins/clap.js")(t),e("plugins/converter.js")(t),e("plugins/cowsay.js")(t),e("plugins/define.js")(t),e("plugins/doge.js")(t),e("plugins/firefly.js")(t),e("plugins/google.js")(t),e("plugins/hangman.js")(t),e("plugins/imdb.js")(t),e("plugins/jquery.js")(t),e("plugins/juicebox.js")(t),e("plugins/learn.js")(t),e("plugins/life.js")(t),e("plugins/mdn.js")(t),e("plugins/meme.js")(t),e("plugins/msdn.js")(t),e("plugins/mustache.js")(t),e("plugins/nudge.js")(t),e("plugins/quote.js")(t),e("plugins/spec.js")(t),e("plugins/stat.js")(t),e("plugins/substitution.js")(t),e("plugins/summon.js")(t),e("plugins/undo.js")(t),e("plugins/unformatted-code.js")(t),e("plugins/unonebox.js")(t),e("plugins/urban.js")(t),e("plugins/vendetta.js")(t),e("plugins/weasel.js")(t),e("plugins/weather.js")(t),e("plugins/welcome.js")(t),e("plugins/wiki.js")(t),e("plugins/xkcd.js")(t),e("plugins/youtube.js")(t),e("plugins/zalgo.js")(t)}},{"plugins/STOP.js":17,"plugins/afk.js":18,"plugins/backup.js":19,"plugins/ban.js":20,"plugins/clap.js":21,"plugins/converter.js":22,"plugins/cowsay.js":23,"plugins/define.js":24,"plugins/doge.js":25,"plugins/firefly.js":26,"plugins/google.js":27,"plugins/hangman.js":28,"plugins/imdb.js":29,"plugins/jquery.js":30,"plugins/juicebox.js":31,"plugins/learn.js":32,"plugins/life.js":33,"plugins/mdn.js":34,"plugins/meme.js":35,"plugins/msdn.js":36,"plugins/mustache.js":37,"plugins/nudge.js":38,"plugins/quote.js":39,"plugins/spec.js":40,"plugins/stat.js":41,"plugins/substitution.js":42,"plugins/summon.js":43,"plugins/undo.js":44,"plugins/unformatted-code.js":45,"plugins/unonebox.js":46,"plugins/urban.js":47,"plugins/vendetta.js":48,"plugins/weasel.js":49,"plugins/weather.js":50,"plugins/welcome.js":51,"plugins/wiki.js":52,"plugins/xkcd.js":53,"plugins/youtube.js":54,"plugins/zalgo.js":55}],5:[function(e,t,n){"use strict";var o=e("./IO"),r="[{text}]({url})",i={roomid:null,fkey:null,site:null,userid:null,maxLineLength:500,init:function(){var e=document.getElementById("fkey");if(!e)return void console.error("adapter could not find fkey; aborting");this.fkey=e.value,this.roomid=Number(/\d+/.exec(location)[0]),this.site=this.getCurrentSite(),this.userid=CHAT.CURRENT_USER_ID,this.in.init(),this.out.init()},getCurrentSite:function(){var e=/chat\.(\w+)/.exec(location)[1];return"stackexchange"!==e?e:e=/host=(.+?)\./.exec(document.getElementById("siterooms").href)[1]},transform:function(e){return e},escape:function(e){return e.replace(/([`\*_\(\)\[\]])/g,"\\$1")},reply:function(e){return"@"+e.replace(/\s/g,"")},directreply:function(e){return":"+e},codify:function(e){var t=e.replace("\t"," "),n=t.split(/[\r\n]/g);return 1===n.length?"`"+n[0]+"`":n.map(function(e){return" "+e}).join("\n")},link:function(e,t){return r.supplant({text:this.escape(e),url:t})},moveMessage:function(e,t,n,r){o.xhr({method:"POST",url:"/admin/movePosts/"+t,data:{fkey:i.fkey,to:n,ids:e},finish:r||function(){}})}},a={times:{},firstPoll:!0,interval:5e3,init:function(e){function t(e){e=JSON.parse(e),console.log(e),n.openSocket(e.url,r)}var n=this,r=arguments.length>0;e=e||i.roomid,o.xhr({url:"/ws-auth",data:fkey({roomid:e}),method:"POST",complete:t})},initialPoll:function(){function e(e){e=JSON.parse(e),console.log(e),n.times["r"+t]=e.time,n.firstPoll=!1}console.log("adapter: initial poll");var t=i.roomid,n=this;o.xhr({url:"/chats/"+t+"/events/",data:fkey({since:0,mode:"Messages",msgCount:0}),method:"POST",complete:e})},openSocket:function(e,t){var n=new WebSocket(e+"?l=99999999999");t?n.onmessage=function(){n.close()}:(this.socket=n,n.onmessage=this.ondata.bind(this),n.onclose=this.socketFail.bind(this))},ondata:function(e){this.pollComplete(e.data)},poll:function(){if(this.firstPoll)return void this.initialPoll();var e=this;o.xhr({url:"/events",data:fkey(e.times),method:"POST",complete:e.pollComplete,thisArg:e})},pollComplete:function(e){e&&(e=JSON.parse(e),Object.iterate(e,function(e,t){t.t&&(this.times[e]=t.t),t.e&&t.e.forEach(this.handleMessageObject,this)},this),o.in.flush())},handleMessageObject:function(e){o.fire("rawinput",e);var t=e.event_type;if(3===t||4===t)return void this.handleUserEvent(e);if(1===t||2===t)return e.content.startsWith("<div class='full'>")?void this.handleMultilineMessage(e):void o.in.receive(e)},handleMultilineMessage:function(e){this.breakMultilineMessage(e.content).forEach(function(t){var n=Object.merge(e,{content:t.trim()});o.in.receive(n)})},breakMultilineMessage:function(e){return e.slice(0,e.lastIndexOf("</div>")).replace("<div class='full'>","").split("<br>")},handleUserEvent:function(e){var t=e.event_type;3===t?o.fire("userjoin",e):4===t&&o.fire("userleave",e)},leaveRoom:function(e,t){if(e===i.roomid)return void t("base_room");o.xhr({method:"POST",url:"/chats/leave/"+e,data:fkey({quiet:!0}),complete:t})},socketFail:function(){console.log("adapter: socket failed",this),this.socket.close(),this.socket=null,this.loopage()},loopage:function(){if(!this.socket){var e=this;setTimeout(function(){e.poll(),e.loopage()},this.interval)}}},s={409:0,total:0,interval:a.interval+500,flushWait:500,init:function(){},add:function(e,t){o.out.receive({text:e+"\n",room:t||i.roomid}),o.out.flush()},send:function(e){this.stopped||setTimeout(function(){s.sendToRoom(e.text,e.room)},this.flushWait)},sendToRoom:function(e,t){function n(n,i){console.log(i.status),409===i.status?(s[409]+=1,r()):500===i.status?s.add("Server error (status 500) occured (message probably too long)",t):200!==i.status?(console.error(i),s.add("Error "+i.status+" occured, I will call the maid (@Zirak)")):(s.total+=1,o.fire("sendoutput",i,e,t))}function r(){setTimeout(function(){s.add(e,t)},s.interval)}o.xhr({url:"/chats/"+t+"/messages/new",data:{text:e,fkey:fkey().fkey},method:"POST",complete:n})}};i.in=a,i.out=s,t.exports=i},{"./IO":2}],6:[function(e,t,n){t.exports=function(e){var t=e.memory.get("ban");return t.contains=function(e){return this.hasOwnProperty(e)},t.add=function(t){this[t]={told:!1},e.memory.save("ban")},t.remove=function(t){this.contains(t)&&(delete this[t],e.memory.save("ban"))},t}},{}],7:[function(e,t,n){"use strict";var o=e("./suggestionDict").SuggestionDictionary,r=e("./IO"),i=window.bot={IO:r,Command:e("./Command").Command,CommunityCommand:e("./Command").CommunityCommand,Message:e("./Message").Message,commands:{},commandDictionary:new o(3),listeners:[],info:{invoked:0,learned:0,forgotten:0,start:new Date},users:{},rooms:{},config:{},parseMessage:function(e){if(!this.validateMessage(e))return void i.log(e,"parseMessage invalid");var t=this.prepareMessage(e),n=t.get("user_id");if(i.log(t,"parseMessage valid"),this.banlist.contains(n))return i.log(e,"parseMessage banned"),void(this.banlist[n].told||(t.reply("You iz in mindjail"),this.banlist[n].told=!0));try{/^c?>/.test(t)?this.prettyEval(t.toString(),t.directreply.bind(t)):this.invokeAction(t)}catch(e){var o="Could not process input. Error: "+e.message;e.lineNumber&&(o+=" on line "+e.lineNumber),e.column&&(o+=" on column "+e.column),t.directreply(o),console.error(e.stack)}finally{this.info.invoked+=1}},invokeAction:function(e){var t=e.trim().replace(/^\/\s*/,"").split(" ")[0],n=this.getCommand(t),o=!e.startsWith("/")||!n.error;n.error?o&&(o=this.callListeners(e)):this.execCommand(n,e),o||e.reply(this.giveUpMessage(n.guesses))},giveUpMessage:function(e){var t="That didn't make much sense.";return e&&e.length?t+=" Maybe you meant: "+e.join(", "):t+=" Use the `!!/help` command to learn more.",t},execCommand:function(e,t){if(i.log(e,"execCommand calling"),!e.canUse(t.get("user_id")))return void t.reply(["You do not have permission to use the command "+e.name,"I'm afraid I can't let you do that, "+t.get("user_name")].random());var n=this.Message(t.replace(/^\/\s*/,"").slice(e.name.length).trim(),t.get()),o=e.exec(n);o&&t.reply(o)},prepareMessage:function(e){e=this.adapter.transform(e);var t=r.htmlToMarkdown(e.content);return t=r.decodehtmlEntities(t),t=t.replace(/\u200b|\u200c/g,""),this.Message(t.slice(this.config.pattern.length).trim(),e)},validateMessage:function(e){var t=e.content.trim();return"!!"===this.config.pattern&&/^!!!+$/.test(t)?(i.log("special skip"),!1):e.user_id!==i.adapter.userid&&e.user_id>0&&t.startsWith(this.config.pattern)},addCommand:function(e){e.exec&&e.del||(e=this.Command(e)),this.commands[e.name]=e,this.commandDictionary.trie.add(e.name)},commandExists:function(e){return this.commands.hasOwnProperty(e)},getCommand:function(e){var t=e.toLowerCase();if(this.commandExists(t))return this.commands[t];this.commandDictionary.maxCost=Math.floor(e.length/5+1);var n="Command "+e+" does not exist.",o=this.commandDictionary.search(e);return o.length&&(n+=" Did you mean: "+o.join(", ")),{error:n,guesses:o}},listen:function(e,t,n){Array.isArray(e)?e.forEach(function(e){this.listen(e,t,n)},this):this.listeners.push({pattern:e,fun:t,thisArg:n})},callListeners:function(e){function t(t){var n,o=e.exec(t.pattern);return!!o&&(n=t.fun.call(t.thisArg,e),i.log(o,n),n&&e.reply(n),!1!==n)}return this.listeners.some(t)},isOwner:function(e){var t=this.users[e];return t&&(t.is_owner||t.is_moderator)},log:console.log.bind(console),stop:function(){this.stopped=this.adapter.out.stopped=!0},continue:function(){this.stopped=!1},devMode:!1,activateDevMode:function(e){this.devMode=!0,this.config.pattern=e||"beer!",r.events.userjoin&&(r.events.userjoin.length=0),this.validateMessage=function(e){return e.content.trim().startsWith(this.config.pattern)}}};i.adapter=e("./adapter"),i.adapter.init(),r.register("output",i.adapter.out.send,i.adapter.out),i.users=e("./users")(i),i.users.loadUsers(),i.memory=e("./memory"),i.memory.loadAll(),window.addEventListener("beforeunload",function(){i.memory.save()}),i.config=e("./config")(i),i.banlist=e("./banlist")(i);var a=e("./parseCommandArgs")();i.parseCommandArgs=a.parse.bind(a),i.parseMacro=e("./parseMacro").parseMacro,i.personality=e("./personality")(i),i.eval=e("./eval").eval,i.prettyEval=e("./eval").prettyEval,e("./commands")(i),e("./listeners")(i),e("./_plugin-loader")(i),r.register("input",i.parseMessage,i)},{"./Command":1,"./IO":2,"./Message":3,"./_plugin-loader":4,"./adapter":5,"./banlist":6,"./commands":9,"./config":10,"./eval":11,"./listeners":12,"./memory":13,"./parseCommandArgs":14,"./parseMacro":15,"./personality":16,"./suggestionDict":60,"./users":61}],8:[function(require,module,exports){module.exports=function(){var global=this,whitey={Array:1,Boolean:1,Date:1,Error:1,EvalError:1,Function:1,Infinity:1,JSON:1,Map:1,Math:1,NaN:1,Number:1,Object:1,Promise:1,Proxy:1,RangeError:1,ReferenceError:1,RegExp:1,Set:1,String:1,SyntaxError:1,TypeError:1,URIError:1,WeakMap:1,WeakSet:1,atob:1,btoa:1,console:1,decodeURI:1,decodeURIComponent:1,encodeURI:1,encodeURIComponent:1,eval:1,exec:1,global:1,isFinite:1,isNaN:1,onmessage:1,parseFloat:1,parseInt:1,postMessage:1,self:1,undefined:1,whitey:1,ArrayBuffer:1,Blob:1,Float32Array:1,Float64Array:1,Int8Array:1,Int16Array:1,Int32Array:1,Uint8Array:1,Uint16Array:1,Uint32Array:1,Uint8ClampedArray:1,DOMException:1,Event:1,MessageEvent:1,WorkerMessageEvent:1};global.fetch=void 0,[global,Object.getPrototypeOf(global)].forEach(function(e){Object.getOwnPropertyNames(e).forEach(function(t){if(!whitey.hasOwnProperty(t))try{Object.defineProperty(e,t,{get:function(){throw new ReferenceError(t+" is not defined")},configurable:!1,enumerable:!1})}catch(n){delete e[t],void 0!==e[t]&&(e[t]=null)}})}),Object.defineProperty(Array.prototype,"join",{writable:!1,configurable:!1,enumrable:!1,value:function(e){return function(t){if(this.length>500||(t&&t.length)>500)throw"Exception: too many items";return e.apply(this,arguments)}}(Array.prototype.join)});var exec=function(code,arg){return eval("undefined;\n"+code)},console={_items:[],log:function(){console._items.push.apply(console._items,arguments)}};console.error=console.info=console.debug=console.log,function(){"use strict";global.onmessage=function(e){global.postMessage({event:"start"});var t,n=JSON.stringify,o=setTimeout,r=0,i=function(e){global.postMessage({answer:n(e,s),log:n(console._items,s).slice(1,-1)})},a=function(e){r<1&&i(e)},s=function(e,t){return u(t)?""+t:t},c={Error:!0,Function:!0,RegExp:!0,Undefined:!0},u=function(e){return{}.toString.call(e).slice(8,-1)in c||e!==e||Math.abs(e)===1/0};self.setTimeout=function(e){function t(){r-=1,e.apply(self,arguments),a()}if(e){var n=[].slice.call(arguments);n[0]=t,r+=1,o.apply(self,n)}};try{t=exec(e.data.code,e.data.arg)}catch(e){t=e.toString()}t&&t.then&&t.catch?t.then(a).catch(a):a(t)}}()}},{}],9:[function(e,t,n){"use strict";t.exports=function(e){var t={help:function(t){if(t&&t.length){var n=e.getCommand(t.toLowerCase());if(n.error)return n.error;return t+": "+(n.description||"No info is available")}return"Information on interacting with me can be found at [this page](https://github.com/Zirak/SO-ChatBot/wiki/Interacting-with-the-bot)"},listen:function(t){if(!e.callListeners(t))return e.giveUpMessage()},eval:function(t,n){return n=n||t.directreply.bind(t),e.prettyEval(t,n)},refresh:function(){location.reload()},forget:function(t){var n=t.toLowerCase(),o=e.getCommand(n);return o.error?o.error:o.canDel(t.get("user_id"))?(o.del(),"Command "+n+" forgotten."):"You are not authorized to delete the command "+t},info:function(t){if(t.content)return function(t){var n=e.getCommand(t);if(n.error)return n.error;var o="Command {name}, created by {creator}".supplant(n);return n.date&&(o+=" on "+n.date.toUTCString()),o}(t.content);var n=e.info;return function(){return"I awoke on {0} (that's about {1} ago)".supplant(n.start.toUTCString(),Date.timeSince(n.start))}()+", "+function(){var e=[],t="";return n.invoked&&e.push("got invoked "+n.invoked+" times"),n.learned&&(t="but ",e.push("learned "+n.learned+" commands")),n.forgotten&&e.push(t+"forgotten "+n.forgotten+" commands"),Math.random()<.15&&e.push("teleported "+Math.rand(100)+" goats"),e.join(", ")||"haven't done anything yet!"}()}};t.listcommands=function(){function t(){var t=Object.keys(e.commands),n=t.groupBy(function(t){return e.commands[t].learned?"learned":"builtin"}),o=n.builtin.sort().concat((n.learned||[]).sort()),r=o.indexOf("help");return o.unshift(o.splice(r,1)[0]),o}return function(e){return e.stringifyGiantArray(t())}}(),t.eval.async=!0,t.tell=function(t){function n(e){e&&(s?p(e):l(e))}var o=t.split(" ");e.log(t.valueOf(),o,"/tell input");var r,i=o[0],a=o[1];if(!i||!a)return"Invalid /tell arguments. Use /help for usage info";if(a=a.toLowerCase(),r=e.getCommand(a),r.error)return r.error+" (note that /tell works on commands, it's not an echo.)";if(r.unTellable)return"Command "+a+" cannot be used in `/tell`.";if(!r.canUse(t.get("user_id")))return"You do not have permission to use command "+a;if(/^@/.test(i))return"Don't be annoying, drop the @, nobody likes a double-ping.";var s=!1,c={};/^:?\d+$/.test(i)?(c.message_id=i.replace(/^:/,""),s=!0):c.user_name=i;var u=Object.merge(t.get(),c),m=e.Message(o.slice(2).join(" "),u),l=m.reply.bind(m),p=m.directreply.bind(m);m.reply=m.directreply=m.send=n,e.log(m,"/tell calling "+a),r.async?r.exec(m,n):n(r.exec(m))};var n={eval:"Forwards message to javascript code-eval",forget:"Forgets a given command. `/forget cmdName`",help:"Fetches documentation for given command, or general help article. `/help [cmdName]`",info:"Grabs some stats on my current instance or a command. `/info [cmdName]`",listcommands:"Lists commands. `/listcommands`",listen:"Forwards the message to my ears (as if called without the /)",refresh:"Reloads the browser window I live in",tell:"Redirect command result to user/message. /tell `msg_id|user_name cmdName [cmdArgs]`"},o={die:!0,live:!0,ban:!0,unban:!0,refresh:!0},r={die:!0,ban:!0},i={tell:!0,forget:!0};Object.iterate(t,function(t,a){var s={name:t,fun:a,permissions:{del:"NONE",use:o[t]?"OWNER":"ALL"},description:n[t],pendingMessage:a.pendingMessage,unTellable:i[t],async:a.async};r[t]&&(s=e.CommunityCommand(s,a.invokeReq)),e.addCommand(s)})}},{}],10:[function(e,t,n){t.exports=function(e){var t="Welcome to the JavaScript chat! Please review the {rulesLink}. If you have a question, just post it, and if anyone's free and interested they'll help. If you want to report an abusive user or a problem in this room, visit our {metaLink}.",n=e.adapter.link("room rules","https://rlemon.github.com/so-chat-javascript-rules/"),o=e.adapter.link("meta","https://github.com/JavaScriptRoom/culture/"),r=Object.merge({pattern:"!!",welcomeMessage:t.supplant({rulesLink:n,metaLink:o})},e.memory.get("config",{}));return e.memory.set("config",r),e.memory.save("config"),r}},{}],11:[function(e,t,n){var o=e("./codeWorker");n.eval=function(){var e=new Blob([o.stringContents()],{type:"application/javascript"}),t=URL.createObjectURL(e);return function(e,n,o){function r(){a||(a=setTimeout(function(){i("Maximum execution time exceeded")},500))}function i(e,t){clearTimeout(a),s.terminate(),o&&o.call?o(e,t):console.warn("eval did not get callback")}2===arguments.length&&(o=n,n=null);var a,s=new Worker(t);s.onmessage=function(e){console.log(e,"eval worker.onmessage"),"start"===e.data.event?r():i(null,e.data)},s.onerror=function(e){console.warn(e,"eval worker.onerror"),i(e.message)},s.postMessage({code:e,arg:n})}}(),n.prettyEval=function(e,t,o){function r(e,t){o(e?e:i(t))}function i(e){console.log(e,"eval answerObj");var t,n=e.answer,o=e.log;return void 0===n?"Malformed output from web-worker. If you weren't just fooling around trying to break me, raise an issue or contact Zirak":(t=a(n),o&&o.length&&(t+=" Logged: "+a(o)),t)}function a(e){return e.length>400?"`"+e.slice(0,400)+"` (snip)":"`"+e+"`"}return 2===arguments.length&&(o=t,t=null),e=e.replace(/^>/,""),n.eval(e,t,r)}},{"./codeWorker":8}],12:[function(e,t,n){"use strict";t.exports=function(e){e.listen(/^help(?: (\S+))?/,function(t){return e.getCommand("help").exec(t.matches[1])});var t=["A robot may not injure a human being or, through inaction, allow a human being to come to harm.","A robot must obey the orders given to it by human beings, except where such orders would conflict with the First Law.","A robot must protect its own existence as long as such protection does not conflict with the First or Second Laws."].map(function(e,t){return t+". "+e}).join("\n");e.listen(/^tell (me (your|the) )?(rule|law)s/,function(){return t}),e.listen(/^give (.+?) a lick/,function(e){var t,n=e.matches[1];return"me"===n?(n="you",t=""):"yourself"===n?(n="I",t=""):t="s","Mmmm! "+n+" taste"+t+" just like raisin"});var n=[/^what(?:'s|'re)?\s(?:(?:is|are)\s)?(?:(?:an|a)\s)?([\w\s\-]+)\??/,/^define\s(?:(?:an|a)\s)?([\w\s\-]+)/];e.listen(n,function(t){var n=t.matches[1];e.getCommand("define").exec(n,function(e){e=e.replace(n+":",""),t.reply(e)})})}},{}],13:[function(e,t,n){t.exports={saveInterval:9e5,data:{},get:function(e,t){return this.data[e]||this.set(e,t||{}),this.data[e]},set:function(e,t){this.data[e]=t},loadAll:function(){var e=this;Object.iterate(localStorage,function(t,n){t.startsWith("bot_")&&(console.log(t,n),e.set(t.replace(/^bot_/,""),JSON.parse(n)))})},save:function(e){if(e)return void(localStorage["bot_"+e]=JSON.stringify(this.data[e]));var t=this;Object.keys(this.data).forEach(function(e){t.save(e)}),this.saveLoop()},saveLoop:function(){clearTimeout(this.saveIntervalId),setTimeout(this.saveLoop.bind(this),this.saveInterval)}}},{}],14:[function(e,t,n){"use strict";var o={create:function(){var e=Object.create(this);return e.separator=" ",e.escape="\\",e.quote='"',e},parse:function(e){this.source=e,this.pos=0;for(var t=[];!this.done();)t.push(this.nextArg());return t},nextArg:function(){var e=this.separator;return this.peek()===this.quote&&(this.nextChar(),e=this.quote),this.consumeUntil(e)},consumeUntil:function(e){for(var t=this.nextChar(),n=!1,o="";t&&t!==e;)t!==this.escape||n?o+=t:n=!0,t=this.nextChar();return o},nextChar:function(){var e=this.source[this.pos];return this.pos+=1,e},peek:function(){return this.source[this.pos]},done:function(){return this.pos>=this.source.length}};t.exports=function(){return o.create()}},{}],15:[function(e,t,n){"use strict";var o={who:function(e){return e.get("user_name")},someone:function(){var e=document.getElementById("sidebar").getElementsByClassName("present-user"),t=Array.filter(e,function(e){return Number(e.style.opacity)>=.5}).random();return t?t.getElementsByTagName("img")[0].title:"Nobody"},digit:function(){return Math.floor(10*Math.random())},encode:function(e,t){return encodeURIComponent(t)},rand:function(e,t,n){return t?n?(t=Number(t),n=Number(n)):(n=t,t=0):(t=0,n=10),Math.rand(t,n)}},r=/(?:.|^)\$(\w+)(?:\((.*?)\))?/g;n.parseMacro=function e(t,n){function i(e,t,n){if(e.startsWith("$$"))return e.slice(1);var o="";"$"!==e[0]&&(o=e[0]);var r=s(t);return r?(console.log(r,t,n,"/parse replaceMacro"),r.apply?o+=r.apply(null,a(n)):o+=r,o):t}function a(o){if(console.log(o,"/parse parseMacroArgs"),!o)return[t];var r=e(o,n);return[t].concat(r.split(",").invoke("trim"))}function s(e){function t(t){return t&&t.hasOwnProperty(e)}return([o,n].first(t)||{})[e]}return t.replace(r,i)}},{}],16:[function(e,t,n){t.exports=function(e){var t={bitchiness:0,thanks:{0:["You kiss-ass","Most welcome"],.5:["Thank you for noticing","teehee"],1:["Took you long enough","My pleasure","Don't mention it"]},apologies:{0:["What for?"],.5:["It was nothing...","No worries"],1:["You're forgiven. For now. Don't push it."]},stuff:{0:["Life is just *perfect*","What's there to bitch about, as long as I have *you*..."],1:["Oh don't mind me, that isn't difficult at all..."],1.2:["You don't appreciate me enough. Not that I need to be thanked..."],1.3:['The occasional "thanks" or "I\'m sorry" would be nice...'],2:["*sigh* Remember laughter? I don't. You ripped it out of me. Heartless bastard."]},insanity:{},okayCommands:{hangman:!0,help:!0,info:!0},check:function(e){return!this.okayCommands.hasOwnProperty(e)},bitch:function(){return this.getResp(this.stuff)},command:function(){this.bitchiness+=this.getDB()},thank:function(){return this.unbitch(this.thanks)},apologize:function(){return this.unbitch(this.apologies)},unbitch:function(e,t){var n=this.getResp(e);return this.bitchiness-=t||this.bitchiness,n},getResp:function(e){return e[this.bitchiness.fallsAfter(Object.keys(e).map(Number).sort())].random()},isABitch:function(){return this.bitchiness>=1},looksLikeABitch:function(){return!1},getDB:function(){return this.isThatTimeOfTheMonth()?.075:.025},isThatTimeOfTheMonth:function(){var e=(new Date).getDate();return e<2||e>27}};return e.listen(/thank(s| you)/i,t.thank,t),e.listen(/(I('m| am))?\s*sorry/i,t.apologize,t),e.listen(/^bitch/i,t.bitch,t),t}},{}],17:[function(e,t,n){t.exports=function(e){"use strict";var t={STOP:"HAMMERTIME!",STAHP:"HAMMAHTIME!",HALT:"HAMMERZEIT!",STOY:"ZABIVAT' VREMYA!",SISTITE:"MALLEUS TEMPUS!"},n=new RegExp("("+Object.keys(t).map(RegExp.escape).join("|")+")[\\.!?]?$");e.IO.register("input",function(o){var r=o.content.toUpperCase(),i=n.exec(r);i&&e.adapter.out.add(t[i[1]],o.room_id)})}},{}],18:[function(e,t,n){t.exports=function(e){"use strict";var t=e.memory.get("afk"),n=3e5,o=12e4,r=function(r,i){var a=t[r],s=i.get("room_id"),c=Date.now();(function(){var e=a.lastPing[s];return c-a.afkSince>=o&&(!e||c-e>=n)})()&&(i.directreply(function(){var e={user:r,sep:".",rest:""};return a.msg&&(e.sep=": ",e.rest=a.msg),"{user} is afk{sep}{rest}".supplant(e)}()),a.lastPing[s]=c,e.memory.save("afk"))},i=function(n,o){var r=!1;e.log("/afk goAFK ",n),0===o.indexOf("!")&&(o=o.substring(1),r=!0),t[n]={afkSince:Date.now(),lastPing:{},msg:o.trim()},r&&(t[n].noReturn=1)},a=function(n){e.log("/afk clearAFK",n),delete t[n]},s=function(n){var o=n.get("user_name").replace(/\s/g,""),r=n.content;e.log("/afk input",o,r),t.hasOwnProperty(o)?a(o):i(o,r),e.memory.save("afk")};e.addCommand({name:"afk",fun:s,permissions:{del:"NONE"},description:"Set an afk message: `/afk <message>`. Invoke `/afk` again to return.",unTellable:!0}),e.IO.register("input",function(n){var i=n.content.toUpperCase(),a=e.prepareMessage(n),c=n.user_name.replace(/\s/g,""),u=Date.now();n.user_id!==e.adapter.userid&&(function(){var n=new RegExp("^"+RegExp.escape(e.config.pattern)+"\\s*/?\\s*AFK");return t.hasOwnProperty(c)&&!n.test(i)&&u-t[c].afkSince>=o}()&&(e.log("/afk he returned!",n),s(a)),i.indexOf("@")<0||Object.keys(t).forEach(function(t){new RegExp("(^|\b)"+RegExp.escape("@"+t)+"\\b","i").test(i)&&(e.log("/afk responding for "+t),r(t,a))}))})}},{}],19:[function(e,t,n){t.exports=function(e){"use strict";function t(t){e.IO.xhr({url:"https://api.github.com/gists",method:"POST",headers:{Authorization:"token "+e.config.githubToken},data:JSON.stringify({description:"bot memory "+new Date,files:{"memory.json":{content:JSON.stringify(o())}}}),complete:n(t.reply)})}function n(t){return function(n){var o=JSON.parse(n),i=e.adapter.link("Donna Noble has been saved",o.html_url);t(r.supplant(i))}}function o(){return Object.keys(localStorage).reduce(function(e,t){return t.startsWith("bot_")&&!t.includes("config")&&(e[t]=localStorage[t]),e},{})}var r="Donna Noble has left The Library {0}.";e.addCommand({name:"backup",fun:t,permissions:{del:"NONE",use:"OWNER"},async:!0,descrription:"backs up the bots memory"})}},{}],20:[function(e,t,n){t.exports=function(e){"use strict";var t={added:0,0:"{0} added to mindjail.",notFound:1,1:"I couldn't find {0}.",owner:2,
2:"I can't mindjail {0}, they're an owner.",alreadyIn:3,3:"{0} is already in mindjail.",notIn:4,4:"{0} isn't in mindjail.",freed:5,5:"{0} freed from mindjail!"},n={name:"ban",fun:function(e){return this.format(this.logic(e.toString()))},logic:function(n){if(!n)return Object.keys(e.banlist).filter(Number);var o,r=Number(n);return isNaN(r)&&(r=e.users.findUserId(n.replace(/^@/,""))),e.log(n,r,"/ban argument"),r<0?o=t.notFound:e.isOwner(r)?o=t.owner:e.banlist.contains(r)?o=t.alreadyIn:(e.banlist.add(r),o=t.added),{code:o,usrid:n}},format:function(e){return Array.isArray(e)?e.map(this.formatUser).join(", ")||"Nothing to show.":t[e.code].supplant(e.usrid)},formatUser:function(t){var n=e.users[t];return"{0} ({1})".supplant(t,n?n.name:"?")},permissions:{del:"NONE",use:"OWNER"},description:"Bans a user from using me. Lacking arguments, prints the ban list. `/ban [usr_id|usr_name]`",pendingMessage:"The user will be thrown into mindjail in {0} more invocations"},o={name:"unban",fun:function(e){return this.format(this.logic(e.toString()))},logic:function(n){var o,r=Number(n);return isNaN(r)&&(r=e.users.findUserId(n.replace(/^@/,""))),e.log(n,r,"/unban argument"),r<0?o=t.notFound:e.banlist.contains(r)?(e.banlist.remove(r),o=t.freed):o=t.notIn,{code:o,usrid:n}},format:function(e){return t[e.code].supplant(e.usrid)},permissions:{del:"NONE",use:"OWNER"},description:"Frees a user from my mindjail. `/unban usr_id|usr_name`"};e.addCommand(e.CommunityCommand(n)),e.addCommand(o)}},{}],21:[function(e,t,n){t.exports=function(e){"use strict";function t(e){var t=e.length>0?e.toString():n.message,o=t.split(n.splitter),r=o.join(" 👏 ");e.send(r)}var n={message:"you are bad at this",splitter:" "};e.addCommand({fun:t,name:"clap",permission:{del:"NONE"},description:"makes 👏 everything 👏 better",unTellable:!1})}},{}],22:[function(e,t,n){"use strict";function o(e,t){if(!C(this))return new o(e,t);if(this.scalar=null,this.baseScalar=null,this.signature=null,this.numerator=I,this.denominator=I,j(e)?(this.scalar=e.scalar,this.numerator=e.numerator&&0!==e.numerator.length?e.numerator:I,this.denominator=e.denominator&&0!==e.denominator.length?e.denominator:I):t?(Y.call(this,t),this.scalar=e):Y.call(this,e),this.denominator.join("*").indexOf("temp")>=0)throw new Error("Cannot divide with temperatures");if(this.numerator.join("*").indexOf("temp")>=0){if(this.numerator.length>1)throw new Error("Cannot multiply by temperatures");if(!l(this.denominator))throw new Error("Cannot divide with temperatures")}if(this.initValue=e,this.isBase())this.baseScalar=this.scalar,this.signature=V.call(this);else{var n=this.toBase();this.baseScalar=n.scalar,this.signature=n.signature}if(this.isTemperature()&&this.baseScalar<0)throw new Error("Temperatures must not be less than absolute zero")}function r(){throw new Error("Incompatible units")}function i(e){var t="Unit "+e+" not recognized.",n=q.search(e);if(n.length){var o=n.groupBy(function(e){return E[B[e]][2]});t+=" Did you mean:\n"+Object.keys(o).map(function(e){return"* {0}: {1}".supplant(e,o[e].join(", "))}).join("\n")}return new Error(t)}function a(e,t){for(var n,r=[],i=[],a=1,s=0;s<e.length;s+=1)n=e[s],_[n]?a=x(a,_[n]):U[n]&&(a*=U[n].scalar,U[n].numerator&&r.push(U[n].numerator),U[n].denominator&&i.push(U[n].denominator));for(var c=0;c<t.length;c+=1)n=t[c],_[n]?a/=_[n]:U[n]&&(a/=U[n].scalar,U[n].numerator&&i.push(U[n].numerator),U[n].denominator&&r.push(U[n].denominator));return r=r.reduce(function(e,t){return e.concat(t)},[]),i=i.reduce(function(e,t){return e.concat(t)},[]),o({scalar:a,numerator:r,denominator:i})}function s(e){var t,n=[];if(!W.test(e))throw i(e);for(;t=L.exec(e);)n.push(t.slice(1));return n=n.map(function(e){return G[e[0]]?[G[e[0]],B[e[1]]]:[B[e[1]]]}),n=n.reduce(function(e,t){return e.concat(t)},[]),n=n.filter(function(e){return e})}function c(e){return l(e)?"1":m(u(e)).join("*")}function u(e){for(var t,n,o=[],r=0;r<e.length;r+=1)t=e[r],n=e[r+1],_[t]?(o.push(F[t]+F[n]),r+=1):o.push(F[t]);return o}function m(e){return e.reduce(function(e,t){var n=e[t];return n||e.push(n=e[t]=[t,0]),n[1]+=1,e},[]).map(function(e){return e[0]+(e[1]>1?e[1]:"")})}function l(e){return 1===e.length&&e[0]===I[0]}function p(e,t){return Math.round(e*Math.pow(10,t))/Math.pow(10,t)}function d(e,t){var n,r=f(e),i=t.units();if("degK"===i)n=r.scalar;else if("degC"===i)n=r.scalar;else if("degF"===i)n=9*r.scalar/5;else{if("degR"!==i)throw new Error("Unknown type for degree conversion to: "+i);n=9*r.scalar/5}return o({scalar:n,numerator:t.numerator,denominator:t.denominator})}function f(e){var t,n=e.units();if(n.match(/(deg)[CFRK]/))t=e.baseScalar;else if("tempK"===n)t=e.scalar;else if("tempC"===n)t=e.scalar;else if("tempF"===n)t=5*e.scalar/9;else{if("tempR"!==n)throw new Error("Unknown type for temp conversion from: "+n);t=5*e.scalar/9}return o({scalar:t,numerator:["<kelvin>"],denominator:I})}function h(e,t){var n,r=t.units();if("tempK"===r)n=e.baseScalar;else if("tempC"===r)n=e.baseScalar-273.15;else if("tempF"===r)n=9*e.baseScalar/5-459.67;else{if("tempR"!==r)throw new Error("Unknown type for temp conversion to: "+r);n=9*e.baseScalar/5}return o({scalar:n,numerator:t.numerator,denominator:t.denominator})}function g(e){var t,n=e.units();if(n.match(/(deg)[CFRK]/))t=e.baseScalar;else if("tempK"===n)t=e.scalar;else if("tempC"===n)t=e.scalar+273.15;else if("tempF"===n)t=5*(e.scalar+459.67)/9;else{if("tempR"!==n)throw new Error("Unknown type for temp conversion from: "+n);t=5*e.scalar/9}return o({scalar:t,numerator:["<temp-K>"],denominator:I})}function x(){for(var e=1,t=0,n=0;n<arguments.length;n+=1){var o=arguments[n];t+=v(o),e*=o}return 0!==t?p(e,t):e}function y(e,t){if(0===t)throw new Error("Divide by zero");var n=Math.pow(10,v(t));return x(e,n/(n*t))}function v(e){if(!H(e))return 0;for(var t=0;e%1!=0;)e*=10,t+=1;return t}function b(e,t){e=e.filter(function(e){return e!==S}),t=t.filter(function(e){return e!==S});for(var n,o={},r=0;r<e.length;r+=1)_[e[r]]?(n=[e[r],e[r+1]],r+=1):n=e[r],n&&n!==S&&(o[n]?o[n][0]+=1:o[n]=[1,n]);for(var i=0;i<t.length;i+=1)_[t[i]]?(n=[t[i],t[i+1]],i+=1):n=t[i],n&&n!==S&&(o[n]?o[n][0]-=1:o[n]=[-1,n]);e=[],t=[];for(var a in o)if(o.hasOwnProperty(a)){var s,c=o[a];if(c[0]>0)for(s=0;s<c[0];s+=1)e.push(c[1]);else if(c[0]<0)for(s=0;s<-c[0];s+=1)t.push(c[1])}return 0===e.length&&(e=I),0===t.length&&(t=I),e=e.reduce(function(e,t){return e.concat(t)},[]),t=t.reduce(function(e,t){return e.concat(t)},[]),[e,t]}function w(e){return"string"==typeof e||e instanceof String}function O(e){return H(e)}function C(e){return e instanceof o}function j(e){return e&&"object"==typeof e&&e.hasOwnProperty("scalar")}var k=e("static/qtyDefinitions"),N=e("suggestionDict").SuggestionDictionary,E=k.UNITS,T=k.BASE_UNITS,S=k.UNITY,I=k.UNITY_ARRAY,A=k.SIGNATURE_VECTOR,M=k.QTY_STRING,D=k.QTY_STRING_REGEX,R=k.TOP_REGEX,P=k.BOTTOM_REGEX,U=k.UNIT_VALUES,B=k.UNIT_MAP,_=k.PREFIX_VALUES,G=k.PREFIX_MAP,F=k.OUTPUT_MAP,L=k.UNIT_MATCH_REGEX,W=k.UNIT_TEST_REGEX,q=new N(2);q.build(Object.keys(B).filter(function(e){return e.length>1})),t.exports=function(e){function t(t){if(e.log(t,"/convert input"),"list"===t.toLowerCase())return t.stringifyGiantArray(o.getUnits());var n=new RegExp("^("+M+") (?:(?:to|in) )?("+M+")$"),r=n.exec(t);if(!r)return console.log("wtf"),"You have confused me greatly, see `/help convert`.";e.log(r[1],"=>",r[5],"/convert parsed");try{var i=o(r[1]),a=o(r[5]);return i.to(a).toString(4)}catch(e){return console.error("/convert error",e),e.message}}e.addCommand({name:"convert",fun:t,permissions:{del:"NONE"},description:"Converts several units and currencies, case sensitive. `/convert <num><unit> [to|in <unit>]` Pass in list for supported units `/convert list`"})},o.getUnits=function(){var e,t=[],n=Object.keys(E);for(e=0;e<n.length;e+=1)-1===["","prefix"].indexOf(E[n[e]][2])&&t.push(n[e].substr(1,n[e].length-2));return t.sort(function(e,t){return e.toLowerCase()<t.toLowerCase()?-1:e.toLowerCase()>t.toLowerCase()?1:0})};var V=function(){if(this.signature)return this.signature;for(var e=z.call(this),t=0;t<e.length;t+=1)e[t]*=Math.pow(20,t);return e.reduce(function(e,t){return e+t},0)},z=function(){if(!this.isBase())return z.call(this.toBase());for(var e=new Array(A.length),t=0;t<e.length;t+=1)e[t]=0;for(var n,o,r=0;r<this.numerator.length;r+=1)(n=E[this.numerator[r]])&&(o=A.indexOf(n[2]))>=0&&(e[o]=e[o]+1);for(var i=0;i<this.denominator.length;i+=1)(n=E[this.denominator[i]])&&(o=A.indexOf(n[2]))>=0&&(e[o]=e[o]-1);return e},Y=function(e){w(e)||(e=e.toString()),e=e.trim();var t=D.exec(e);if(!t)throw new Error(e+": Quantity not recognized");var n=t[1];if(n){if(n=n.replace(/\s/g,""),this.scalar=parseFloat(n),!H(this.scalar))throw new Error("Number too large: "+n)}else this.scalar=1;for(var o,r,a,c=t[2],u=t[3];t=R.exec(c);){if(o=parseFloat(t[2]),isNaN(o))throw new Error("Unit exponent is not a number");if(0===o&&!W.test(t[1]))throw i(t[1]);r=t[1]+" ",a="";for(var m=0;m<Math.abs(o);m+=1)a+=r;o>=0?c=c.replace(t[0],a):(u=u?u+a:a,c=c.replace(t[0],""))}for(;t=P.exec(u);){if(o=parseFloat(t[2]),isNaN(o))throw new Error("Unit exponent is not a number");if(0===o&&!W.test(t[1]))throw i(t[1]);r=t[1]+" ",a="";for(var l=0;l<o;l+=1)a+=r;u=u.replace(t[0],a)}c&&(this.numerator=s(c.trim())),u&&(this.denominator=s(u.trim()))};o.prototype={constructor:o,isUnitless:function(){return l(this.numerator)&&l(this.denominator)},isCompatible:function(e){return w(e)?this.isCompatible(o(e)):!!C(e)&&(void 0!==e.signature&&this.signature===e.signature)},isInverse:function(e){return this.inverse().isCompatible(e)},isBase:function(){return void 0!==this._isBase?this._isBase:this.isDegrees()&&this.numerator[0].match(/<(kelvin|temp-K)>/)?(this._isBase=!0,this._isBase):(this.numerator.concat(this.denominator).forEach(function(e){e!==S&&-1===T.indexOf(e)&&(this._isBase=!1)},this),!1===this._isBase?this._isBase:(this._isBase=!0,this._isBase))},toBase:function(){return this.isBase()?this:this.isTemperature()?g(this):a(this.numerator,this.denominator).mul(this.scalar)},units:function(){if(void 0!==this._units)return this._units;var e=l(this.numerator),t=l(this.denominator);if(e&&t)return this._units="",this._units;var n=c(this.numerator),o=c(this.denominator);return this._units=n+(t?"":"/"+o),this._units},toPrec:function(e){if(w(e)&&(e=o(e)),O(e)&&(e=o(e+" "+this.units())),this.isUnitless()?e.isUnitless()||r():e=e.to(this.units()),0===e.scalar)throw new Error("Divide by zero");return o(x(Math.round(this.scalar/e.scalar),e.scalar)+this.units())},toString:function(e,t){var n;if(O(e))n=this.units(),t=e;else if(w(e))n=e;else if(C(e))return this.toPrec(e).toString(t);var o=this.to(n);return o=((void 0!==t?p(o.scalar,t):o.scalar)+" "+o.units()).trim()},inverse:function(){if(this.isTemperature())throw new Error("Cannot divide with temperatures");if(0===this.scalar)throw new Error("Divide by zero");return o({scalar:1/this.scalar,numerator:this.denominator,denominator:this.numerator})},isDegrees:function(){return(null===this.signature||400===this.signature)&&1===this.numerator.length&&l(this.denominator)&&(this.numerator[0].match(/<temp-[CFRK]>/)||this.numerator[0].match(/<(kelvin|celsius|rankine|fahrenheit)>/))},isTemperature:function(){return this.isDegrees()&&this.numerator[0].match(/<temp-[CFRK]>/)},to:function(e){function t(e){function t(e){return 1===e.length?e[0]:"("+e.join("*")+")"}var n,o;return n=t(e.numerator),l(e.denominator)?n:(o=t(e.denominator),n+"/"+o)}var n;if(!e)return this;if(!w(e))return this.to(e.units());if(n=o(e),n.units()===this.units())return this;if(this.isCompatible(n))if(n.isTemperature())n=h(this,n);else if(n.isDegrees())n=d(this,n);else{var r=y(this.baseScalar,n.baseScalar);n=o({scalar:r,numerator:n.numerator,denominator:n.denominator})}else{if(!this.isInverse(n))throw new Error("Cannot convert "+t(this)+" to "+t(n)+".");n=this.inverse().to(e)}return n},mul:function(e){if(O(e))return o({scalar:x(this.scalar,e),numerator:this.numerator,denominator:this.denominator});if(w(e)&&(e=o(e)),(this.isTemperature()||e.isTemperature())&&!this.isUnitless()&&!e.isUnitless())throw new Error("Cannot multiply by temperatures");var t=this,n=e;t.isCompatible(n)&&400!==t.signature&&(n=n.to(t));var r=b(t.numerator.concat(n.numerator),t.denominator.concat(n.denominator));return o({scalar:x(t.scalar,n.scalar),numerator:r[0],denominator:r[1]})}},o.mulSafe=x,o.divSafe=y;var H=Number.isFinite||window.isFinite;o.version="1.6.2"},{"static/qtyDefinitions":57,suggestionDict:60}],23:[function(e,t,n){t.exports=function(e){"use strict";function t(e,t){function n(e,n){var r=n.length;return o+r>t&&(e+="\n",o=0),o+=r+1,e+n+" "}var o=0;return e.split(" ").reduce(n,"")}function n(e,t,n){return n=n||" ",(e+Array(t).join(n)).slice(0,t)}var o={defaults:{e:"oo",T:" ",t:!1,W:40},cow:[""," L ^__^"," L (e)\\_______"," (__)\\ )\\/\\"," T ||----w |"," || ||"].join("\n"),moo:function(e,o){var r=this.defaults;return this.eyes=n(o.e||r.e,2).slice(0,2),this.tongue=n(o.T||r.T,2).slice(0,2),this.line=o.t?"O":"\\",this.thinking=o.t,this.message=t(e,o.W||r.W).trim(),this.makeBalloon()+this.makeCow()},makeCow:function(){return this.cow.replace(/e/g,this.eyes).replace(/T/g,this.tongue).replace(/L/g,this.line)},makeBalloon:function(){function e(e,t){var o;return o=0===t?a.slice(0,2):t===i-1?a.slice(2,4):a.slice(2),o[0]+" "+n(e,r)+" "+o[1]}function t(e,t){return t.length>e?t.length:e}var o=this.message.split("\n"),r=o.reduce(t,0),i=o.length,a=this.chooseBorders(i),s=o.map(e),c=new Array(r+2);return s.unshift(" "+c.join("_")),s.push(" "+c.join("-")),s.join("\n")},chooseBorders:function(e){return this.thinking?["(",")","(",")","(",")"]:1===e?["<",">"]:["/","\\","\\","/","|","|"]}};e.listen(/cow(think|say)\s(?:([eT])=(.{0,2})\s)?(?:([eT])=(.{0,2})\s)?(.+)/,function(t){var n=function(e){for(var t={},n=0,o=e.length;n<o;n+=2)e[n]&&e[n+1]&&(t[e[n]]=e[n+1]);return t}(t.matches.slice(2,-1));n.t="think"===t.matches[1],e.log(n,"cowsay opts");var r=o.moo(t.matches.pop(),n);t.send(t.codify(r))})}},{}],24:[function(e,t,n){t.exports=function(e){"use strict";var t=["No definition found.","It means I aint got time to learn your $5 words.","My pocket dictionary just isn't good enough for you."],n="http://en.wiktionary.org",o=/(alternative (spelling|term)|common misspelling|informal form|archaic spelling) (of|for) (.+?)\.?$/i,r={command:function(o,r){function i(i){e.log(i,"/define result");var a,s=i.pageid;a=s<0?t.random():e.adapter.link(i.name,n+"/wiki?curid="+s)+" "+i.text,i.overflow&&(a="Index too large; showing last definition. "+a),r&&r.call?r(a):o.reply(a)}var a=o.parse(),s=Number(a.pop()),c=a.join(" ");s||(s=0,c=o.toString()),e.log(o,c,s,"/define input"),this.fetchDefinition(c,s,i)},fetchDefinition:function(t,n,o){function r(t){var a=t.query,s=a.pageids[0],c=a.pages[s],u=c.extract;if("-1"===s)return void o({pageid:-1});var m=document.createElement("body");m.innerHTML=u;var l=i.extractDefinitions(m),p=l[0],d=!1;if(e.log(l,"/define got definitions"),p.alternative)return e.log(p.alternative,"/define found alternative"),void i.fetchData(p.alternative,r);p=l[n],p||(p=l[l.length-1],d=!0),o({name:c.title,text:p.text,pageid:s,overflow:d})}var i=this;this.fetchData(t,r)},extractDefinitions:function(e){var t=e.getElementsByTagName("ol")[0];return console.log(t,"/define definition list"),Array.from(t.children).map(this.extractSingleDefinition,this)},extractSingleDefinition:function(t){var o=this.extractAlternative(t.textContent);Array.from(t.children).forEach(function(e){"UL"===e.tagName&&t.removeChild(e)});for(var r=t.getElementsByTagName("a");r.length;)!function(t){var o=n+t.getAttribute("href"),r=e.adapter.link(t.textContent,o),i=document.createTextNode(r);t.parentNode.replaceChild(i,t)}(r[0]);return{alternative:o,text:t.textContent}},extractAlternative:function(e){return(o.exec(e)||[]).pop()},fetchData:function(t,n){var o=this;e.IO.jsonp({url:"http://en.wiktionary.org/w/api.php",jsonpName:"callback",data:{action:"query",titles:t,format:"json",prop:"extracts",indexpageids:!0},fun:function(e){n.call(o,e)}})}};e.addCommand({name:"define",fun:r.command,thisArg:r,permissions:{del:"NONE"},description:"Fetches definition for a given word. `/define something`",async:!0})}},{}],25:[function(e,t,n){t.exports=function(e){"use strict";function t(e,t){t+=Math.random()*(2*i.jitter)-i.jitter;for(var n=0;n<t;n+=1)e=" "+e;return e}function n(e){return" "+e+"\r"}function o(e){return e.sort(function(){return Math.random()-.5})}function r(e){for(var r=(e.length>0?e.toString():i.message).split(","),a=o(i.words.slice(0)),s=n(t("wow",4+4*Math.random()|0));r.length>a.length;)a=a.concat(o(i.words.slice(0)));for(;r.length;){var c="";a.length&&(c+=a.shift()+" "),c+=r.shift(),s+=n(t(c,i.spaces[r.length%3-1]))}e.send(s+"\r ")}var i={message:"fail,user,pro",spaces:[25,14,1],jitter:4,words:["so","very","such","much","many"]};e.addCommand({fun:r,name:"doge",permissions:{del:"NONE"},description:"so shibe, much doge, wow `/doge one,two,three[,nth]",unTellable:!0})}},{}],26:[function(e,t,n){t.exports=function(e){e.listen(/(which |what |give me a )?firefly( episode)?/i,function(e){var t=["Serenity","The Train Job","Bushwhacked","Shindig","Safe","Our Mrs. Reynolds","Jaynestown","Out of Gas","Ariel","War Stories","Trash","The Message","Heart of Gold","Objects in Space"];if(-1===e.indexOf("episode")&&Math.random()<.05)return"Serenity (movie)";var n=Math.floor(14*Math.random());return"Episode {0} - {1}".supplant(n+1,t[n])})}},{}],27:[function(e,t,n){t.exports=function(e){var t=["The Google contains no such knowledge","There are no search results. Run.","My Google Fu has failed."],n={name:"google",fun:function(e,t){function n(n){var r=o.format(n);t&&t.call?t(r):e.directreply(r)}var o=this;this.logic(e,n)},logic:function(t,n){function o(o){if(e.log(o,"/google response"),200!==o.responseStatus)return void n("My Google-Fu is on vacation; status "+o.responseStatus);var r=o.responseData.results.slice(0,3);r.query=t,e.log(r,"/google results"),n(r)}e.IO.jsonp.google(String(t)+" -site:w3schools.com",o)},format:function(n){function o(t){var n=e.IO.decodehtmlEntities(t.titleNoFormatting);return e.adapter.link(n,t.unescapedUrl)}if(!n.length)return t.random();var r=function(t){var n="http://google.com/search?q="+encodeURIComponent(t);return e.adapter.link("*",n)}(n.query)+" "+n.map(o).join(" ; ");return r.length>e.adapter.maxLineLength&&(r=n.pluck("unescapedUrl").join(" ; ")),r},permissions:{del:"NONE"},description:"Search Google. `/google query`",async:!0};e.addCommand(n)}},{}],28:[function(e,t,n){t.exports=function(e){"use strict";var t=function(t,n){function o(e){n(e.word.toLowerCase().trim())}var r="https://sleepy-bastion-8674.herokuapp.com/";Number(t)&&(r+="?length="+t),e.IO.jsonp({url:r,jsonpName:"callback",fun:o})},n={dude:[" +---+"," | |"," | 413"," | 2"," | 5 6","__+__"].join("\n"),parts:["","O","|","/","\\","/","\\"],word:"",revealed:"",guesses:[],guessNum:0,maxGuess:6,end:!0,msg:null,validGuessRegex:/^[a-zA-Z]+$/,receiveMessage:function(e){if(this.msg=e,!this.end)return this.handleGuess(e);this.new(e)},new:function(o){function r(t){e.log(t+" /hang random"),n.word=t,i.revealed=new Array(t.length+1).join("-"),i.guesses=[],i.guessNum=0,i.guessMade(),i.end=!1,o.length&&!Number(o)&&i.receiveMessage(o)}var i=this;t(o,r)},handleGuess:function(t){var n=t.slice().toLowerCase();e.log(n,"handleGuess");var o=this.checkGuess(n);if(o)return o;var r=this.word.indexesOf(n);return r.forEach(function(e){this.uncoverPart(n,e)},this),r.length||(this.guessNum+=1),this.guesses.push(n),this.guessMade(),e.log(n,"handleGuess handled"),this.loseCheck()?this.lose():this.winCheck()?this.win():void 0},checkGuess:function(t){return!t.length||Number(t)?"We're already playing!":this.validGuessRegex.test(t)?this.guesses.indexOf(t)>-1?t+" was already submitted":t.length>this.word.length?e.adapter.codify(t)+" is too long to fit":void 0:"I will only accept alpha characters"},uncoverPart:function(e,t){this.revealed=this.revealed.slice(0,t)+e+this.revealed.slice(t+e.length)},preparePrint:function(){if(!this.end){var t=this,n=this.dude.replace(/\d/g,function(e){return e>t.guessNum?" ":t.parts[e]}),o=this.guesses.sort().join(", ")+"\n"+this.revealed,r=this.msg.codify(n+"\n"+o);e.log(r,this.msg),this.msg.send(r)}},win:function(){return this.end=!0,"Correct! The word is "+this.word+"."},lose:function(){return this.end=!0,"You people suck. The word is "+this.word},winCheck:function(){return this.word===this.revealed},loseCheck:function(){return this.guessNum>=this.maxGuess},guessMade:function(){clearTimeout(this.printTimeout),this.printTimeout=setTimeout(this.preparePrint.bind(this),2e3)}};e.addCommand({name:"hang",fun:n.receiveMessage,thisArg:n})}},{}],29:[function(e,t,n){t.exports=function(e){function t(t,n){function o(t){if(200!==t.responseStatus)return void i("Something went on fire; status "+t.responseStatus);var n=t.responseData.results[0];e.log(n,"/imdb result");var o=e.IO.decodehtmlEntities(n.titleNoFormatting.split(" -")[0].trim());s.formatted.push(e.adapter.link(o,n.url)),s.unescapedUrls.push(n.url),s.formatted.length===a.length&&r()}function r(){var t=s.formatted.join(", ");t.length>e.adapter.maxLineLength&&(t=s.unescapedUrls.join(", ")),i(t)}function i(e){n&&n.call?n(e):t.reply(e)}var a=t.toString().split(/,\s*/g),s={unescapedUrls:[],formatted:[]};a.forEach(function(t){e.IO.jsonp.google(t+" site:imdb.com",o)})}e.addCommand({name:"imdb",fun:t,permissions:{del:"NONE",use:"ALL"},description:"Fetches imdb page. `/imdb what`",async:!0})}},{}],30:[function(e,t,n){t.exports=function(e){function t(o){if(!o.content)return n;var r=o.parse(!0);if(r.length>1)return r.map(t).join(" ");var i,a=o.trim().replace(/^\$/,"jQuery"),s=a.split("."),c=!1,u=a;return e.log(a,s,"/jquery input"),3===s.length&&(s=[s[2]]),"jQuery"===s[0]&&jQuery[s[1]]?c=!0:1===s.length&&jQuery.prototype[s[0]]?(u=s[0],c=!0):jQuery[s[0]]&&(u="jQuery."+s[0],c=!0),i=c?n+u:n+"?s="+encodeURIComponent(o),e.log(i,"/jquery link"),i}var n="http://api.jquery.com/";e.addCommand({name:"jquery",fun:t,permissions:{del:"NONE",use:"ALL"},description:"Fetches documentation link from jQuery API. `/jquery what`"})}},{}],31:[function(e,t,n){t.exports=function(e){"use strict";function t(t){function r(n){e.log(n,"/juicebox finish"),t.directreply("http://juiceboxify.me/api?url="+n)}var i=function(e){var t=e.parse(),n=t.pop(),o={};return t.length>0&&!/\D/.test(n)?o.usrid=t.join(" "):o.usrid=e.content,o}(t),a=i.usrid;if(e.log(i,"/juicebox input"),n(a))return void r(encodeURIComponent(a));if(a?/\D/.test(a)&&(a=t.findUserId(a)):a=t.get("user_id"),e.log(a,"/juicebox mapped"),!e.users.hasOwnProperty(a))return o.supplant(a,e.adapter.roomid);if(Number(a)===e.adapter.userid)return["Nobody puts a juicebox on me. Again.","juicebox me once, shame on you. juicebox me ---twice--- 9 times..."].random();var s=e.users[a].email_hash;r("!"===s[0]?encodeURIComponent(s.slice(1))+"#.png":"http%3A%2F%2Fwww.gravatar.com%2Favatar%2F{0}%3Fs%3D256%26d%3Didenticon#.png".supplant(s))}function n(e){return e.startsWith("http")||e.startsWith("www")}var o="User {0} was not found in room {1} (sorry, juicebox only works there).",r={name:"juicebox",fun:t,privileges:{del:"NONE"},description:"Juiceboxifies a user. `/juicebox [link|usrid|username] [juicebox=rand(0,5)]`"};e.addCommand(r);var i=Object.merge(r,{name:"jb"});e.addCommand(i)}},{}],32:[function(e,t,n){t.exports=function(e){"use strict";function t(t){e.log(t,"/learn input");var o=t.parse(),a={name:o[0],output:o[1],input:o[2]||".*",creator:t.get("user_name"),creatorID:t.get("user_id"),date:new Date};a.name=a.name.toLowerCase();var s=r(a);return s||(a.input=new RegExp(a.input),a.description=["User-taught command:",o[3]||"",t.codify(a.output)].join(" "),e.log(a,"/learn parsed"),e.info.learned+=1,n(a),i(a),"Command "+a.name+" learned")}function n(t){var n=e.Command({name:t.name,description:t.description,creator:t.creator,date:t.date,fun:o(t),permissions:{use:"ALL",del:t.creatorID?[t.creatorID]:"OWNER"}});n.learned=!0,n.del=function(e){return function(){a(t.name),e.call(n)}}(n.del),e.log(n,"/learn addCustomCommand"),e.addCommand(n)}function o(t){var n=t.output.replace(c,"").trim(),o=function(){return(c.exec(t.output)||[null,"user"])[1].slice(1,-1)}();return e.log(t,"/learn makeCustomCommand"),function(r){e.log(r,t.name+" input");var i=e.Message(n,r.get()),a=t.input.exec(r);if(!a)return m.supplant(t);var s=e.parseMacro(i,a);switch(o){case"":r.send(s);break;case"msg":r.directreply(s);break;default:r.reply(s)}}}function r(t){var n,o=Object.keys(t).some(function(e){return!t[e]});return o?n="Illegal `/learn` object; see `/help learn`":/\s/.test(t.name)?n="Invalid command name":!function(t){if(!e.commandExists(t))return!0;var n=e.getCommand(t);return n.learned&&n.date.getTime()+3e5>Date.now()}(t.name)?n="Command "+t.name+" already exists":u.test(t.output)&&(n="Please enter some output"),n}function i(t){s[t.name]=t,e.memory.save("learn")}function a(t){delete s[t],e.memory.save("learn")}var s=e.memory.get("learn"),c=/^(<>|<user>|<msg>)/i,u=new RegExp(c.source+"$","i"),m="Input not matching `{input}`. Help: {description}";e.addCommand({name:"learn",fun:t,privileges:{del:"NONE"},description:"Teaches me a command. `/learn cmdName outputPattern [inputRegex [description]]`"}),function(){function e(e,o){o.charAt&&(o=JSON.parse(o)),o.input=t(o.input),o.date=new Date(Date.parse(o.date)),n(o)}function t(e){var t=e.toString().split("/");return new RegExp(t.slice(1,-1).join("/"),t[t.length-1])}Object.iterate(s,e)}()}},{}],33:[function(e,t,n){t.exports=function(e){e.addCommand({name:"live",fun:function(){return e.stopped?(e.continue(),"And on this day, you shall paint eggs for a giant bunny."):"I'm not dead! Honest!"},permissions:{del:"NONE",use:"OWNER"},description:"Resurrects me (:D) if I'm down (D:)"}),e.addCommand({name:"die",fun:function(){return e.stopped?"Kill me once, shame on you, kill me twice...":(e.stop(),"You killed me!")},permissions:{del:"NONE",use:"OWNER"},description:"Kills me :("})}},{}],34:[function(e,t,n){t.exports=function(e){function t(t,n){function o(t){if(200!==t.responseStatus)return void i("Something went on fire; status "+t.responseStatus);var n=t.responseData.results[0];e.log(n,"/mdn result");var o=e.IO.decodehtmlEntities(n.titleNoFormatting.split(" -")[0].trim());s.formatted.push(e.adapter.link(o,n.url)),s.unescapedUrls.push(n.url),s.formatted.length===a.length&&r()}function r(){var t=s.formatted.join(", ");t.length>e.adapter.maxLineLength&&(t=s.unescapedUrls.join(", ")),i(t)}function i(e){n&&n.call?n(e):t.reply(e)}var a=t.toString().split(/,\s*/g),s={unescapedUrls:[],formatted:[]};a.forEach(function(t){e.IO.jsonp.google(t+" site:developer.mozilla.org",o)})}e.addCommand({name:"mdn",fun:t,permissions:{del:"NONE",use:"ALL"},description:"Fetches mdn documentation. `/mdn what`",async:!0})}},{}],35:[function(e,t,n){t.exports=function(e){function t(e){return n+r[e]+"."+o}var n="http://cdn.alltheragefaces.com/img/faces/png/",o="png",r={deskflip:"angry-desk-flip",fuu:"rage-classic",iseewhatyoudidthere:"happy-i-see-what-you-did-there-(clean)",no:"angry-no",notbad:"obama-not-bad",ohyou:"happy-oh-stop-it-you",okay:"okay-okay-clean",troll:"troll-troll-face",trollface:"troll-troll-face",youdontsay:"misc-you-dont-say"},i=new RegExp("^("+Object.keys(r).map(RegExp.escape).join("|")+")\\.(jpe?g|png)$");e.IO.register("input",function(n){var o=n.content.toLowerCase(),r=i.exec(o);if(r){var a=t(r[1]);e.adapter.out.add(e.adapter.directreply(n.message_id)+" "+a,n.room_id)}}),e.addCommand({name:"meme",fun:function(e){var n=e.replace(/\.\w+$/,"");return n&&"list"!==n?r.hasOwnProperty(n)?void e.directreply(t(n)):"Sorry, I don't know that one.":Object.keys(r).join(", ")},permissions:{del:"NONE"},description:"Return a simple meme link. Pass no arguments or `list` to get a list of known memes. `/meme [memeName]`."})}},{}],36:[function(e,t,n){t.exports=function(e){function t(t,n){function o(t){if(200!==t.responseStatus)return void i("Something went on fire; status "+t.responseStatus);var n=t.responseData.results[0];e.log(n,"/msdn result");var o=e.IO.decodehtmlEntities(n.titleNoFormatting.split(" -")[0].trim());s.formatted.push(e.adapter.link(o,n.url)),s.unescapedUrls.push(n.url),s.formatted.length===a.length&&r()}function r(){var t=s.formatted.join(", ");t.length>e.adapter.maxLineLength&&(t=s.unescapedUrls.join(", ")),i(t)}function i(e){n&&n.call?n(e):t.reply(e)}var a=t.toString().split(/,\s*/g),s={unescapedUrls:[],formatted:[]};a.forEach(function(t){e.IO.jsonp.google(t+" site:msdn.microsoft.com",o)})}e.addCommand({name:"msdn",fun:t,permissions:{del:"NONE",use:"ALL"},description:"Fetches msdn page. `/msdn what`",async:!0})}},{}],37:[function(e,t,n){t.exports=function(e){"use strict";function t(t){function r(n){e.log(n,"/mustache finish"),t.directreply("http://mustachify.me/"+i.mustache+"?src="+n)}var i=function(e){var t=e.parse(),n=t.pop(),o={};return t.length>0&&!/\D/.test(n)?(o.usrid=t.join(" "),o.mustache=n):(o.usrid=e.content,o.mustache=Math.rand(0,5)),o}(t),a=i.usrid;if(e.log(i,"/mustache input"),n(a))return void r(encodeURIComponent(a));if(a?/\D/.test(a)&&(a=t.findUserId(a)):a=t.get("user_id"),e.log(a,"/mustache mapped"),!e.users.hasOwnProperty(a))return o.supplant(a,e.adapter.roomid);if(Number(a)===e.adapter.userid)return["Nobody puts a mustache on me. Again.","Mustache me once, shame on you. Mustache me ---twice--- 9 times..."].random();var s=e.users[a].email_hash;r("!"===s[0]?encodeURIComponent(s.slice(1))+"#.png":"http%3A%2F%2Fwww.gravatar.com%2Favatar%2F{0}%3Fs%3D256%26d%3Didenticon#.png".supplant(s))}function n(e){return e.startsWith("http")||e.startsWith("www")}var o="User {0} was not found in room {1} (sorry, mustache only works there).",r={name:"mustache",fun:t,privileges:{del:"NONE"},description:"Mustachifies a user. `/mustache [link|usrid|username] [mustache=rand(0,5)]`"};e.addCommand(r);var i=Object.merge(r,{name:"moustache"});e.addCommand(i)}},{}],38:[function(e,t,n){t.exports=function(e){function t(){s=s.filter(function(e){return e.time-=u,!(e.time<=0)||(n(e),!1)}),setTimeout(t,u)}function n(t){e.log(t,"nudge fire"),t.msg.reply(t.message)}function o(t,n,o){var r;if(e.log(t,n,"/nudge input"),t=parseFloat(t),r=6e4*t,isNaN(r))return"Many things can be labeled Not a Number; a delay should not be one of them.";c+=1;var i={msg:o,message:"*nudge* "+n,register:Date.now(),time:r,id:c};return s.push(i),e.log(i,s,"/nudge register"),"Nudge #"+c+" registered."}function r(t,n){var o=s.find(function(e){return e.id===t}),r=s.indexOf(o);return o?o.msg.get("user_name")!==n.get("user_name")?"It's not nice to try and remove a nudge which ain't yours":(e.log(s[r],"/nudge remove #"+t),s.splice(r,1),"Nudge annhiliated"):["Nudge not found. Maybe it was already triggered, or this is a parallal universe.","I looked for nudge #"+t+", but all I found was this goat."].random()}function i(e){var t=e.parse(),n=t[0],i=t.slice(1).join(" ");return"remove"===n?r(Number(t[1]),e):o(n,i,e)}function a(e){return o(e.matches[1],e.matches[2],e)}var s=[],c=0,u=6e3;setTimeout(t,u),e.addCommand({name:"nudge",fun:i,permissions:{del:"NONE"},description:"Register a nudge after an interval. `/nudge intervalInMinutes message`, `/nudge remove id` to remove, or the listener, `nudge|remind|poke me? in? intervalInMinutes message`",unTellable:!0}),e.listen(/(?:nudge|remind|poke)\s(?:me\s)?(?:in\s)?(\d+m?)\s?(.*)$/,a)}},{}],39:[function(e,t,n){t.exports=function(e){function t(e){var t=e.parse(),a=t[0];if("add"===a)n(t.slice(1),e.reply.bind(e));else{if("list"===a)return e.stringifyGiantArray(o(t[1]&&t[1].toLowerCase()));"get"===a?e.directreply(r(t.slice(1).join(" "))):"random"===a&&e.directreply(i())}}function n(t,n){var o=t.shift(),r=t.join(" ");if(!/^(?:https:\/\/chat\.stack\w+\.com\/.+?)?(\d+)$/.exec(o))return void n("mesa no understando, please give me a message id or url to remember");if(s.hasOwnProperty(r))return void n("But I already know something by that name, it will be downright unfair")
;var i=RegExp.$1;e.IO.xhr({url:"/messages/"+i+"/history",document:!0,complete:function(t){var o=t.getElementsByClassName("username")[0].textContent;s[r]={msgid:i,author:o.toLowerCase()},e.memory.save("quote"),n("I will cherish this memory for the rest of my life")}})}function o(e){return e?Object.keys(s).filter(function(t){return s[t].author===e}):Object.keys(s)}function r(e){return s.hasOwnProperty(e)?a(s[e].msgid):"404 quote not found"}function i(){var e=Object.keys(s).random();return a(s[e].msgid)}function a(t){return e.IO.relativeUrlToAbsolute("/transcript/message/"+t)}var s=e.memory.get("quote");e.addCommand({name:"quote",fun:t,permissions:{del:"NONE"},description:["Manage and administer quotes.","Add a quote: `/quote add msgid ...quoteName`","Get a quote: `/quote get ...quoteName","List quotes: `/quote list [username]`","Get a random quote: `/quote random`"].join("\n"),async:!0})}},{}],40:[function(e,t,n){t.exports=function(t){function n(e){function n(e){return e.name.toLowerCase().indexOf(a)>-1}function r(t){return"["+e.escape(t.name)+"](http://es5.github.com/#"+t.section+")"}var i,a=e.content.toLowerCase();return i=o.filter(n).map(r),t.log(i,"/spec done"),i.length?i.join(", "):e+" not found in spec"}var o=e("static/specParts.json");t.addCommand({name:"spec",fun:n,permissions:{del:"NONE"},description:"Find a section in the ES5 spec"})}},{"static/specParts.json":58}],41:[function(e,t,n){t.exports=function(e){"use strict";function t(t,o){function r(o){if(e.IO.normalizeUnderscoreProperties(o),o.errorMessage)return void i(o.errorMessage);var r,a=o.items[0];a?(e.IO.normalizeUnderscoreProperties(a),r=n(a,t)):r="User "+s+" not found",i(r)}function i(e){o?o(e):t.reply(e)}var a=t.parse(),s=a[0];return s?/^\d+$/.test(s)||(s=t.findUserId(a.length>1?s:a.join(" "))):s=t.get("user_id"),s<0?"User Elusio proved elusive.":Math.random()<=.1?void i("That dude sucks"):void e.IO.jsonp({url:"https://api.stackexchange.com/2.2/users/"+s,data:{site:e.adapter.site,filter:"!P)usXx8OGi3Eq5LdDJke7ybvCSm_vuVGrSDZs3)UmEI"},fun:r})}function n(t,n){return t=o(t),t.user_id===n.get("user_id")?(t.displayName="You",t.indicative="have"):(t.displayName=e.IO.decodehtmlEntities(t.displayName),t.indicative="has"),t.reputationChangeDay<0?(t.verb="lost",t.reputationChangeDay=Math.abs(t.reputationChangeDay)):t.verb="earned",i.supplant(t)}function o(t){return t=Object.merge({questionCount:0,answerCount:0,reputationChangeDay:0},t.badge_counts,t),t=Object.merge(t.badge_counts,t),t.avgRepPost=(t.reputation/(t.questionCount+t.answerCount)).maxDecimal(2),t.avgRepPost===1/0&&(t.avgRepPost="T͎͍̘͙̖̤̉̌̇̅ͯ͋͢͜͝H̖͙̗̗̺͚̱͕̒́͟E̫̺̯͖͎̗̒͑̅̈ ̈ͮ̽ͯ̆̋́͏͙͓͓͇̹<̩̟̳̫̪̇ͩ̑̆͗̽̇͆́ͅC̬͎ͪͩ̓̑͊ͮͪ̄̚̕Ě̯̰̤̗̜̗͓͛͝N̶̴̞͇̟̲̪̅̓ͯͅT͍̯̰͓̬͚̅͆̄E̠͇͇̬̬͕͖ͨ̔̓͞R͚̠̻̲̗̹̀>̇̏ͣ҉̳̖̟̫͕ ̧̛͈͙͇͂̓̚͡C͈̞̻̩̯̠̻ͥ̆͐̄ͦ́̀͟A̛̪̫͙̺̱̥̞̙ͦͧ̽͛̈́ͯ̅̍N̦̭͕̹̤͓͙̲̑͋̾͊ͣŅ̜̝͌͟O̡̝͍͚̲̝ͣ̔́͝Ť͈͢ ̪̘̳͔̂̒̋ͭ͆̽͠H̢͈̤͚̬̪̭͗ͧͬ̈́̈̀͌͒͡Ơ̮͍͇̝̰͍͚͖̿ͮ̀̍́L͐̆ͨ̏̎͡҉̧̱̯̤̹͓̗̻̭ͅḐ̲̰͙͑̂̒̐́̊"),t.ratio=r(t.questionCount,t.answerCount),e.log(t,"/stat normalized"),t}function r(e,t){return!e&&t?"H̸̡̪̯ͨ͊̽̅̾̎Ȩ̬̩̾͛ͪ̈́̀́͘ ̶̧̨̱̹̭̯ͧ̾ͬC̷̙̲̝͖ͭ̏ͥͮ͟Oͮ͏̮̪̝͍M̲̖͊̒ͪͩͬ̚̚͜Ȇ̴̟̟͙̞ͩ͌͝S̨̥̫͎̭ͯ̿̔̀ͅ":!t&&e?"TO͇̹̺ͅƝ̴ȳ̳ TH̘Ë͖́̉ ͠P̯͍̭O̚N̐Y̡":t||e?Math.ratio(e,t):"http://i.imgur.com/F79hP.png"}var i="{displayName} ({link}) {indicative} {reputation} reputation, {verb} {reputationChangeDay} rep today, asked {questionCount} questions, gave {answerCount} answers, for a q:a ratio of {ratio}.\navg. rep/post: {avgRepPost}. Badges: {gold}g {silver}s {bronze}b ",a={name:"stat",fun:t,permissions:{del:"NONE"},description:"Gives useless stats on a user. `/stat usrid|usrname [extended]`",async:!0};e.addCommand(a);var s=Object.merge(a,{name:"stats"});e.addCommand(s)}},{}],42:[function(e,t,n){t.exports=function(e){function t(t){var i=RegExp(t.matches[2],t.matches[4]),a=t.matches[3];if(!t.matches[2])return"Empty regex is empty";var s;s=t.matches[5]?Array.from(document.querySelectorAll("#message-"+t.matches[5]+" .content")):Array.from(document.getElementsByClassName("content")).reverse(),n(i,s,t.get("message_id"),function(n,s){function c(e){var n=e.replace(i,a)+" "+t.link("(source)",u);t.reply(n)}if(n)return void t.reply(n);if(!s)return void t.reply("No matching message (are you sure we're in the right room?)");e.log(s,"substitution found message");var u=o(s);s.getElementsByClassName("partial").length?r(s,c):c(s.textContent)})}function n(t,n,o,r){e.log(t,n,o,"substitution getMatchingMessage args");var i={maxId:o,pattern:t,messages:n.map(function(e){return{id:Number(e.parentElement.id.match(/\d+/)[0]),text:e.textContent}})},a=function(){var e=arguments[1],t=null;e.messages.some(function(n,o){return!!(n.id<e.maxId&&e.pattern.test(n.text))&&(t=o,!0)})};e.eval(a.stringContents(),i,function(t,o){if(e.log(t,o,"substitution matcher response"),t)return void r(t);var i=JSON.parse(o.answer);Number(i)===i&&r(null,n[i])})}function o(e){for(var t=e;!t.classList.contains("action-link");)t=t.previousElementSibling;return t.href}function r(t,n){var o=t.children[1].href;e.log(o,"substitution expanding message"),e.IO.xhr({method:"GET",url:o,data:{plain:!0},complete:n})}var i=/^\s*s(\/|\|)((?:(?:\\\1)|[^\1])*?)\1((?:(?:\\\1)|[^\1])*?)\1(g?i?)(?:\s+(\d+))?/;e.listen(i,t)}},{}],43:[function(e,t,n){t.exports=function(e){"use strict";var t=function(t){var n=Number(t);if(!n)return"That aint no room I ever heard of! `/help summon` for usage info";e.adapter.in.init(n)},n=function(t,n){function o(e){n&&n.call?n(e):t.reply(e)}var r=t.content?Number(t):t.get("room_id");if(!r)return"That aint no room I ever heard of! `/help unsummon` for usage info";e.adapter.in.leaveRoom(r,function(e){"base_room"===e&&o("I can't leave my home!")})};e.addCommand(e.CommunityCommand({name:"summon",fun:t,permissions:{del:"NONE",use:"OWNER"},description:"Say boopidi bee and in the room I shall be. `/summon roomid`",pendingMessage:"I will appear in that room after {0} more invocation(s)"})),e.addCommand(e.CommunityCommand({name:"unsummon",fun:n,permissions:{del:"NONE",use:"OWNER"},description:"Chant zippidi lepat and from the room I shall depart. `/unsummon [roomid=your_roomid]`",pendingMessage:"I will leave this room after {0} more invocation(s)"}))}},{}],44:[function(e,t,n){t.exports=function(e){var t={ids:[],command:function(t,n){function o(e){n?n(e):t.reply(e)}if(e.log(t,"/undo input"),t.indexOf(" ")>-1)return void this.removeMultiple(t.split(" "),o);"~"===t[0]?this.byLookback(t.slice(1),o):"*"===t[0]||"x"===t[0]?this.byPrevious(t.slice(1),o):/^:?\d+$/.test(t)?this.remove(t.replace(/^:/,""),o):t.content?o("I'm not sure how to handle that, see `/help undo`"):this.ids.length?this.remove(this.ids[this.ids.length-1],o):o("I haven't said a thing!")},removeMultiple:function(e,t){e.forEach(function(e){this.remove(e,t)},this)},byLookback:function(t,n){var o=Number(t.replace("~",""));if(e.log(t,o,this.ids.length-o,"/undo byLookback"),!o||o>this.ids.length)return void n("I can't quite see that far back without my glasses");this.remove(this.ids[this.ids.length-o],n)},byPrevious:function(e,t){return Number(e)?this.removeMultiple(this.ids.slice(-e),t):void t("Yeah, no")},remove:function(n,o){function r(r,i){if(409===i.status)return e.log(i,"/undo remove finish 409"),void t.retry(n,o,r);var a;'"ok"'!==r&&(a=/it is too late/i.test(r)?"TimeError: Could not reach 88mph":/only delete your own/i.test(r)?"I can only delete my own messages":"I have no idea what happened: "+r,o(a))}console.log(n,"/undo remove");var i=this.ids.indexOf(n);i>-1&&this.ids.splice(i,1),e.IO.xhr({url:"/messages/"+n+"/delete",data:fkey(),method:"POST",complete:r})},retry:function(e,t,n){var o=/(\d+) seconds\s*$/i.exec(n),r=4;o&&o[1]&&(r=Number(o[1])),setTimeout(this.remove.bind(this,e,t),1e3*r)},updateId:function(e){this.ids.push(JSON.parse(e.responseText).id)}};e.IO.register("sendoutput",t.updateId,t),e.addCommand({name:"undo",fun:t.command,thisArg:t,permissions:{del:"NONE",use:"OWNER"},description:"Undo (delete) specified or last message. `/undo [msgid0, msgid1, ...]` (omit for last message); `/undo xN` for last N; `/undo ~N` for the Nth message from the end"})}},{}],45:[function(e,t,n){t.exports=function(e){function t(t,o){var r=e.users[t.user_id],i=t.message_id;e.log("[formatting] Lecturing user "+t.user_name),e.adapter.out.add(e.adapter.reply(t.user_name)+" "+n(o)),r&&r.reputation<2e3&&(e.log("[formatting] Binning offending message"),e.adapter.moveMessage(i,t.room_id,23262))}function n(t){var n=t.split("\n").length,o="Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the {0}.".supplant(e.adapter.link("faq","/faq"));return n>=10&&(o+=" For posting large code blocks, use a paste site like https://gist.github.com, http://hastebin.com, http://pastie.org or a demo site like https://jsbin.com/"),o}function o(e){var t=e.split("\n");if(t.length<4)return!1;var n=/^\}|^<\//;return t.some(/ /.test.bind(n))}if("stackoverflow"!==e.adapter.site||17!==e.adapter.roomid)return void e.log("Not activating unformatted code checking; not in right room/site");var r=new Map;e.IO.register("rawinput",function(n){function i(){r.has(a)&&(e.log("[formatting] Message {0} was fixed".supplant(a)),clearTimeout(r.get(a)),r.delete(a))}var a=n.message_id;if((1===n.event_type||2===n.event_type)&&17===n.room_id&&!e.isOwner(n.user_id)){if(!n.content.startsWith("<div class='full'>"))return void i();var s=e.adapter.in.breakMultilineMessage(n.content).map(function(e){return e.replace(/^ /,"")}).join("\n");if(s=e.IO.decodehtmlEntities(s),s.startsWith("<pre class='full'>"))return void i();if(!o(s))return void i();e.log("[formatting] Message {0} is a naughty one".supplant(a));var c=setTimeout(t,1e4,n,s);r.set(a,c)}})}},{}],46:[function(e,t,n){t.exports=function(e){"use strict";var t="unonebox-state",n={enablers:Object.TruthMap(["on","true","start","enable"]),disablers:Object.TruthMap(["off","false","stop","disable"]),command:function(n){var o,r=n.toLowerCase(),i=!1;r?this.enablers[r]?(e.log("/unonebox enabling"),this.enable(),o="un-onebox enabled",i=!0):this.disablers[r]?(e.log("/unonebox disabling"),this.disable(),o="un-onebox disabled",i=!0):(e.log("/unonebox invalid input"),o="That didn't make much sense. Please use `on` or `off` to toggle the command"):(e.log("/unonebox getting state"),o="Functionality is "+e.memory.get(t,"disabled")),i&&e.memory.save(t),n.reply(o)},enable:function(){e.IO.register("input",this.unbox),e.memory.set(t,"enabled")},disable:function(){e.IO.unregister("input",this.unbox),e.memory.set(t,"disabled")},unbox:function(t){if(t.user_id===e.adapter.userid){var o=document.createElement("div");o.innerHTML=t.content;var r=o.querySelector(".onebox:not(.ob-youtube):not(.ob-message):not(.ob-wikipedia) a");r&&!r.parentNode.parentNode.classList.contains("quote")&&(e.log(t,"/unonebox found matching message"),setTimeout(function(){n.actuallyUnbox(t.message_id,r.href)},9e4))}},actuallyUnbox:function(t,n){e.IO.xhr({url:"/messages/"+t,data:fkey({text:n+" ... "}),method:"POST",complete:function(t,n){e.log(n,"/unonebox done unboxing")}})}};"enabled"===e.memory.get(t,"disabled")&&(e.log("enabling unonebox"),n.enable()),e.addCommand({name:"unonebox",fun:n.command,thisArg:n,permissions:{del:"NONE"},description:"Get/toggle the unonebox listener. `/unonebox [on|off]x`"})}},{}],47:[function(e,t,n){t.exports=function(e){function t(t,o){function r(e){var o;o="no_results"===e.result_type?"No definition found for "+c:u>e.list.length?"Nothing in that index. The last one is:\n"+a(e.list.pop()):a(e.list[u]),o.length>500&&(o=o.slice(0,450)+"(snip)"),n[t]=o,i(o)}function i(e){o&&o.call?o(e):t.reply(e)}function a(e){var n=e.definition.replace(/\[([^\]]+)\]/g,s);return t.link(e.word,e.permalink)+" "+n}function s(e,n){var o="http://urbandictionary.com/define.php?term="+encodeURIComponent(n);return t.link(e,o)}if(n[t])return i(n[t]);var c,u,m=t.parse();if(!m.length)return"Y U NO PROVIDE ARGUMENTS!?";isNaN(m[1])?(e.log("/urban input isNaN"),c=t.toString(),u=0):(e.log("/urban input isn't NaN"),c=m[0],u=Number(m[1])),e.log(c,u,"/urban input"),e.IO.jsonp({url:"https://api.urbandictionary.com/v0/define",data:{term:c},jsonpName:"callback",fun:r})}var n={};e.addCommand({name:"urban",fun:t,permissions:{del:"NONE",use:"ALL"},description:"Fetches UrbanDictionary definition. `/urban query [resultIndex=0]`",async:!0})}},{}],48:[function(e,t,n){t.exports=function(e){e.IO.register("input",function(t){1386886===t.user_id&&Math.random()<.005&&e.adapter.out.add(e.adapter.reply(t.user_name)+" The Game")})}},{}],49:[function(e,t,n){t.exports=function(t){var n=/^\s*(choose|should)?.*\sor\s[^$]/i,o=new RegExp("\\b("+["am","are","can","could","did","do","does","is","may","might","shall","should","will","would"].map(RegExp.escape).join("|")+")\\b","i"),r={he:"He",i:"You",it:"It",she:"She",they:"They",we:"You",you:"I"},i=e("static/weaselReplies.js");t.listen(n,function(e){function n(){var t;do{t=s.random()}while(t===l);e.reply("Wait, I changed my mind! "+o(t))}function o(e){return e.replace(/(should(?:n'?t)?) (\S+)/,a)}function a(e,t,n){var o=n.toLowerCase();return(r.hasOwnProperty(o)?r[o]:n)+" "+t}for(var s=e.replace(/^\s*choose\s/i,"").replace(/\?$/,"").split(/\s*\bor\b\s*/i).filter(Boolean),c=s.length,u=1,m=!0;u<c;u+=1)if(s[u]!==s[u-1]){m=!1;break}if(m)return i.sameness.random();if(Math.random()<.01)return 2===c?"Both!":"All of them!";if(Math.random()<.01)return 2===c?"Neither":"None of them!";if(Math.random()<.01)return i.undecided.random();var l=s.random();return Math.random()<.01&&(t.log("weasel decision mind change jedi nun-chuck"),setTimeout(n,1e4)),o(l)}),t.listen(o,function(){return i.answers.random()})}},{"static/weaselReplies.js":59}],50:[function(e,t,n){t.exports=function(e){"use strict";function t(e){var t=r.exec(e);if(t)o.latlon(t[1],t[2],e.reply.bind(e));else{if(!e.content)return"See `/help weather` for usage info";o.city(e.content,e.reply.bind(e))}}var n=Object.TruthMap(["US","United States of America","United States","BZ","Belize","BS","Bahamas","KY","Cayam Islands"]),o={latlon:function(t,n,o){var r=Number(t),i=Number(n),a=[];if((r<-180||r>180)&&a.push("Latitude must be between -180 and 180"),(i<-180||i>180)&&a.push("Longitude must be between -180 and 180"),a.length)return void o(a.join("; "));e.IO.xhr({url:"https://api.openweathermap.org/data/2.5/weather",data:{lat:t,lon:n,cnt:1,appid:e.config.weatherKey,type:"json"},complete:this.completeCb(o)})},city:function(t,n){e.IO.xhr({url:"https://api.openweathermap.org/data/2.5/weather",data:{q:t,appid:e.config.weatherKey,type:"json"},complete:this.completeCb(n)})},completeCb:function(e){var t=this;return function(n){const o=JSON.parse(n);if("cod"in o)return t.errorCb(e)(o);t.finishCb(e)(o)}},finishCb:function(e){var t=this;return function(n){e(t.format(n))}},errorCb:function(e){var t=this;return function(n){e(t.format(n))}},format:function(e){return e.main?this.formatter(e):(console.error(e),"Sorry, I couldn't get the data: "+e.message)},formatter:function(t){var o,r=t.main;r.celsius=(r.temp-273.15).maxDecimal(2),o=e.adapter.link(t.name,"https://openweathermap.org/city/"+t.id)+": ",n[t.sys.country]?(r.fahrenheit=(9*r.temp/5-459.67).maxDecimal(2),o+="{fahrenheit}F ({celsius}C, {temp}K)".supplant(r)):o+="{celsius}C ({temp}K)".supplant(r);var i=(t.weather||[]).map(function(e){return e.description}).join(", ");return i&&(o+=", "+i),o}},r=/\((-?\d+\.?\d*),\s*(-?\d+\.?\d*)\)/;e.addCommand({name:"weather",fun:t,permissions:{del:"NONE"},async:!0,description:"Gets current weather: `/weather (lan, lon)` or `/weather city`"})}},{}],51:[function(e,t,n){t.exports=function(e){"use strict";function t(t,n){e.adapter.out.add(e.adapter.reply(t)+" "+r,n)}var n=e.memory.get("users"),o=17,r=e.config.welcomeMessage;e.IO.register("input",function(r){function i(e){var r,i=e.querySelector("#room-"+o+" .room-message-count");r=!i||Number(/^\d+/.exec(i.title))<2,r&&t(c.name,u),n[s]=!0,a()}function a(){e.memory.save("users")}var s=r.user_id,c=e.users[s],u=r.room_id,m=c&&function(t){return e.isOwner(t.id)||t.reputation>1e3||t.reputation<20}(c);if(Number(u)!==o||m||n[s])return void(m&&(delete n[s],a()));n[s]=!0,e.IO.xhr({method:"GET",url:"/users/"+s,document:!0,complete:i})}),e.addCommand({name:"welcome",fun:function(e){if(!e.length)return r;t(e,e.get("room_id"))},permission:{del:"NONE"},description:"Welcomes a user. `/welcome user`"})}},{}],52:[function(e,t,n){t.exports=function(e){"use strict";function t(t,n){function o(e){var o=e[3][0],r=!0;o||(r=!1,o=["No result found","The Wikipedia contains no knowledge of such a thing","The Gods of Wikipedia did not bless us"].random()),n&&n.call?n(o):r?t.directreply(o):t.reply(o)}e.IO.jsonp({url:"https://en.wikipedia.org/w/api.php",jsonpName:"callback",data:{action:"opensearch",search:t.toString(),limit:1,format:"json"},fun:o})}e.addCommand({name:"wiki",fun:t,permissions:{del:"NONE"},description:"Search Wikipedia. `/wiki term`",async:!0})}},{}],53:[function(e,t,n){t.exports=function(e){function t(t,n){function o(e){var t=e.num;a?"new"===a&&i(s+t):i(s+Math.rand(1,t))}function r(e){if(200!==e.responseStatus)return void i("Something went on fire; status "+e.responseStatus);var t=e.responseData.results;if(!t.length)return void i("Seems like you hallucinated this comic");var n=t[0],o=n.url;/xkcd.com\/(\d+)/.exec(o)||(o="Search didn't yield a comic; got "+n.unescapedUrl),i(o)}function i(o){e.log(o,"/xkcd finish"),o=o.replace(/^https:/,"http:"),n&&n.call?n(o):t.directreply(o)}var a=(t.parse()[0]||"").toLowerCase(),s="http://xkcd.com/";return/^\d+$/.test(a)?(e.log("/xkcd specific",a),void i(s+a)):a&&"new"!==a?(e.log("/xkcd search",t.toString()),void e.IO.jsonp.google(t.toString()+" site:xkcd.com -forums.xkcd -m.xkcd -fora.xkcd",r)):(e.log("/xkcd random/latest",a),void e.IO.jsonp({url:"http://dynamic.xkcd.com/api-0/jsonp/comic",jsonpName:"callback",fun:o}))}e.addCommand({name:"xkcd",fun:t,permissions:{del:"NONE"},description:"Returns an XKCD. Call with no args for random, `new` for latest, or a number for a specific one.",async:!0})}},{}],54:[function(e,t,n){t.exports=function(e){function t(t,o){function r(t){if(200!==t.responseStatus)return void i("Something went on fire; status "+t.responseStatus);var o=t.responseData.results[0];e.log(o,"/youtube result"),i(o?decodeURIComponent(o.url):n.random())}function i(e){o&&o.call?o(e):t.directreply(e)}e.IO.jsonp.google(t.toString()+" site:youtube.com/watch",r)}var n=["Video not found (rule 35?)","I could not find such a video","The Lords of YouTube did not find your query favorable"];e.addCommand({name:"youtube",fun:t,permissions:{del:"NONE"},description:"Search Youtube. `/youtube query`",async:!0})}},{}],55:[function(e,t,n){t.exports=function(e){!function(){var t=function(e){var t,n,o,r=function(e){return Math.floor(Math.random()*e)},i=e.split(""),a=[0,1,2].random(),s=["̍","̎","̄","̅","̿","̑","̆","̐","͒","͗","͑","̇","̈","̊","͂","̓","̈́","͊","͋","͌","̃","̂","̌","͐","̀","́","̋","̏","̒","̓","̔","̽","̉","ͣ","ͤ","ͥ","ͦ","ͧ","ͨ","ͩ","ͪ","ͫ","ͬ","ͭ","ͮ","ͯ","̾","͛","͆","̚"],c=["̖","̗","̘","̙","̜","̝","̞","̟","̠","̤","̥","̦","̩","̪","̫","̬","̭","̮","̯","̰","̱","̲","̳","̹","̺","̻","̼","ͅ","͇","͈","͉","͍","͎","͓","͔","͕","͖","͙","͚","̣"],u=["̕","̛","̀","́","͘","̡","̢","̧","̨","̴","̵","̶","͏","͜","͝","͞","͟","͠","͢","̸","̷","͡","҉"],m="",l=0,p="A̪̗̐̿̄̔̉̏̾L̹͓̲̈́ͮL̜̼͓͉̞̘̩̇̊",d=i.length;1==a&&(t=r(16)/2+1,n=r(16)/2+1,o=r(6)/2);for(var l=0;l<d;l++){m+=i[l],p++,a||(t=r(8),n=r(8),o=r(6)),1==a&&(t=r(16)/2+1,n=r(16)/2+1,o=r(6)/2),2==a&&(t=r(64)/4+3,n=r(64)/4+3,o=r(16)/4+1);for(var f=0;f<t;f++)m+=s.random();for(var f=0;f<o;f++)m+=u.random();for(var f=0;f<n;f++)m+=c.random()}return m||/<([a-z]+) *[^\/]*?>/};e.addCommand({name:"zalgo",fun:t,permissions:{del:"NONE"},description:"H̸̡̪̯ͨ͊̽̅̾̎Ȩ̬̩̾͛ͪ̈́̀́͘ ̶̧̨̱̹̭̯ͧ̾ͬC̷̙̲̝͖ͭ̏ͥͮ͟Oͮ͏̮̪̝͍M̲̖͊̒ͪͩͬ̚̚͜Ȇ̴̟̟͙̞ͩ͌͝S̨̥̫͎̭ͯ̿̔̀ͅ http://stackoverflow.com/a/1732454/1216976"})}()}},{}],56:[function(e,t,n){t.exports={quot:'"',amp:"&",apos:"'",lt:"<",gt:">",nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",fnof:"ƒ",circ:"ˆ",tilde:"˜",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",ensp:" ",emsp:" ",thinsp:" ",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",bull:"•",hellip:"…",permil:"‰",prime:"′",Prime:"″",lsaquo:"‹",rsaquo:"›",oline:"‾",frasl:"⁄",euro:"€",image:"ℑ",weierp:"℘",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",lang:"〈",rang:"〉",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦",zwnj:"",zwsp:""}},{}],57:[function(e,t,n){var o={"<googol>":[["googol"],1e100,"prefix"],"<kibi>":[["Ki","Kibi","kibi"],Math.pow(2,10),"prefix"],"<mebi>":[["Mi","Mebi","mebi"],Math.pow(2,20),"prefix"],"<gibi>":[["Gi","Gibi","gibi"],Math.pow(2,30),"prefix"],"<tebi>":[["Ti","Tebi","tebi"],Math.pow(2,40),"prefix"],"<pebi>":[["Pi","Pebi","pebi"],Math.pow(2,50),"prefix"],"<exi>":[["Ei","Exi","exi"],Math.pow(2,60),"prefix"],"<zebi>":[["Zi","Zebi","zebi"],Math.pow(2,70),"prefix"],"<yebi>":[["Yi","Yebi","yebi"],Math.pow(2,80),"prefix"],"<yotta>":[["Y","Yotta","yotta"],1e24,"prefix"],"<zetta>":[["Z","Zetta","zetta"],1e21,"prefix"],"<exa>":[["E","Exa","exa"],1e18,"prefix"],"<peta>":[["P","Peta","peta"],1e15,"prefix"],"<tera>":[["T","Tera","tera"],1e12,"prefix"],"<giga>":[["G","Giga","giga"],1e9,"prefix"],"<mega>":[["M","Mega","mega"],1e6,"prefix"],"<kilo>":[["k","kilo"],1e3,"prefix"],"<hecto>":[["h","Hecto","hecto"],100,"prefix"],"<deca>":[["da","Deca","deca","deka"],10,"prefix"],"<deci>":[["d","Deci","deci"],.1,"prefix"],"<centi>":[["c","Centi","centi"],.01,"prefix"],"<milli>":[["m","Milli","milli"],.001,"prefix"],"<micro>":[["u","μ","µ","Micro","mc","micro"],1e-6,"prefix"],"<nano>":[["n","Nano","nano"],1e-9,"prefix"],"<pico>":[["p","Pico","pico"],1e-12,"prefix"],"<femto>":[["f","Femto","femto"],1e-15,"prefix"],"<atto>":[["a","Atto","atto"],1e-18,"prefix"],"<zepto>":[["z","Zepto","zepto"],1e-21,"prefix"],"<yocto>":[["y","Yocto","yocto"],1e-24,"prefix"],"<1>":[["1","<1>"],1,""],"<meter>":[["m","meter","meters","metre","metres"],1,"length",["<meter>"]],"<inch>":[["in","inch","inches",'"'],.0254,"length",["<meter>"]],"<foot>":[["ft","foot","feet","'"],.3048,"length",["<meter>"]],"<yard>":[["yd","yard","yards"],.9144,"length",["<meter>"]],"<mile>":[["mi","mile","miles"],1609.344,"length",["<meter>"]],"<naut-mile>":[["nmi"],1852,"length",["<meter>"]],"<league>":[["league","leagues"],4828,"length",["<meter>"]],"<furlong>":[["furlong","furlongs"],201.2,"length",["<meter>"]],"<rod>":[["rd","rod","rods"],5.029,"length",["<meter>"]],"<mil>":[["mil","mils"],254e-7,"length",["<meter>"]],"<angstrom>":[["ang","angstrom","angstroms"],1e-10,"length",["<meter>"]],"<fathom>":[["fathom","fathoms"],1.829,"length",["<meter>"]],"<pica>":[["pica","picas"],.00423333333,"length",["<meter>"]],"<point>":[["pt","point","points"],.000352777778,"length",["<meter>"]],"<redshift>":[["z","red-shift"],1.302773e26,"length",["<meter>"]],"<AU>":[["AU","astronomical-unit"],1495979e5,"length",["<meter>"]],"<light-second>":[["ls","light-second"],299792500,"length",["<meter>"]],"<light-minute>":[["lmin","light-minute"],1798755e4,"length",["<meter>"]],"<light-year>":[["ly","light-year"],9460528e9,"length",["<meter>"]],"<parsec>":[["pc","parsec","parsecs"],3085678e10,"length",["<meter>"]],"<kilogram>":[["kg","kilogram","kilograms"],1,"mass",["<kilogram>"]],"<AMU>":[["u","AMU","amu"],1.660538921e-27,"mass",["<kilogram>"]],"<dalton>":[["Da","Dalton","Daltons","dalton","daltons"],1.660538921e-27,"mass",["<kilogram>"]],"<slug>":[["slug","slugs"],14.5939029,"mass",["<kilogram>"]],"<short-ton>":[["tn","ton"],907.18474,"mass",["<kilogram>"]],"<metric-ton>":[["tonne"],1e3,"mass",["<kilogram>"]],"<carat>":[["ct","carat","carats"],2e-4,"mass",["<kilogram>"]],"<pound>":[["lbs","lb","pound","pounds","#"],.45359237,"mass",["<kilogram>"]],"<ounce>":[["oz","ounce","ounces"],.0283495231,"mass",["<kilogram>"]],"<gram>":[["g","gram","grams","gramme","grammes"],.001,"mass",["<kilogram>"]],"<grain>":[["grain","grains","gr"],6479891e-11,"mass",["<kilogram>"]],"<dram>":[["dram","drams","dr"],.0017718452,"mass",["<kilogram>"]],"<stone>":[["stone","stones","st"],6.35029318,"mass",["<kilogram>"]],"<hectare>":[["hectare"],1e4,"area",["<meter>","<meter>"]],"<acre>":[["acre","acres"],4046.85642,"area",["<meter>","<meter>"]],"<sqft>":[["sqft"],1,"area",["<foot>","<foot>"]],"<liter>":[["l","L","liter","liters","litre","litres"],.001,"volume",["<meter>","<meter>","<meter>"]],"<gallon>":[["gal","gallon","gallons"],.0037854118,"volume",["<meter>","<meter>","<meter>"]],"<quart>":[["qt","quart","quarts"],.00094635295,"volume",["<meter>","<meter>","<meter>"]],"<pint>":[["pt","pint","pints"],.000473176475,"volume",["<meter>","<meter>","<meter>"]],"<cup>":[["cu","cup","cups"],.000236588238,"volume",["<meter>","<meter>","<meter>"]],"<fluid-ounce>":[["floz","fluid-ounce","fluid-ounces"],295735297e-13,"volume",["<meter>","<meter>","<meter>"]],"<tablespoon>":[["tb","tbsp","tbs","tablespoon","tablespoons"],147867648e-13,"volume",["<meter>","<meter>","<meter>"]],"<teaspoon>":[["tsp","teaspoon","teaspoons"],492892161e-14,"volume",["<meter>","<meter>","<meter>"]],"<bushel>":[["bu","bsh","bushel","bushels"],.035239072,"volume",["<meter>","<meter>","<meter>"]],"<kph>":[["kph"],.277777778,"speed",["<meter>"],["<second>"]],"<mph>":[["mph"],.44704,"speed",["<meter>"],["<second>"]],"<knot>":[["kt","kn","kts","knot","knots"],.514444444,"speed",["<meter>"],["<second>"]],"<fps>":[["fps"],.3048,"speed",["<meter>"],["<second>"]],"<gee>":[["gee"],9.80665,"acceleration",["<meter>"],["<second>","<second>"]],"<kelvin>":[["degK","K","kelvin"],1,"temperature",["<kelvin>"]],"<celsius>":[["degC","C","celsius","celsius","centigrade"],1,"temperature",["<kelvin>"]],"<fahrenheit>":[["degF","F","fahrenheit"],5/9,"temperature",["<kelvin>"]],"<rankine>":[["degR","rankine"],5/9,"temperature",["<kelvin>"]],"<temp-K>":[["tempK"],1,"temperature",["<temp-K>"]],"<temp-C>":[["tempC"],1,"temperature",["<temp-K>"]],"<temp-F>":[["tempF"],5/9,"temperature",["<temp-K>"]],"<temp-R>":[["tempR"],5/9,"temperature",["<temp-K>"]],"<second>":[["s","sec","secs","second","seconds"],1,"time",["<second>"]],"<minute>":[["min","mins","minute","minutes"],60,"time",["<second>"]],"<hour>":[["h","hr","hrs","hour","hours"],3600,"time",["<second>"]],"<day>":[["d","day","days"],86400,"time",["<second>"]],"<week>":[["wk","week","weeks"],604800,"time",["<second>"]],"<fortnight>":[["fortnight","fortnights"],1209600,"time",["<second>"]],"<year>":[["y","yr","year","years","annum"],31556926,"time",["<second>"]],"<decade>":[["decade","decades"],315569260,"time",["<second>"]],"<century>":[["century","centuries"],3155692600,"time",["<second>"]],"<pascal>":[["Pa","pascal","Pascal"],1,"pressure",["<kilogram>"],["<meter>","<second>","<second>"]],"<bar>":[["bar","bars"],1e5,"pressure",["<kilogram>"],["<meter>","<second>","<second>"]],"<mmHg>":[["mmHg"],133.322368,"pressure",["<kilogram>"],["<meter>","<second>","<second>"]],"<inHg>":[["inHg"],3386.3881472,"pressure",["<kilogram>"],["<meter>","<second>","<second>"]],"<torr>":[["torr"],133.322368,"pressure",["<kilogram>"],["<meter>","<second>","<second>"]],"<atm>":[["atm","ATM","atmosphere","atmospheres"],101325,"pressure",["<kilogram>"],["<meter>","<second>","<second>"]],"<psi>":[["psi"],6894.76,"pressure",["<kilogram>"],["<meter>","<second>","<second>"]],"<cmh2o>":[["cmH2O"],98.0638,"pressure",["<kilogram>"],["<meter>","<second>","<second>"]],"<inh2o>":[["inH2O"],249.082052,"pressure",["<kilogram>"],["<meter>","<second>","<second>"]],"<poise>":[["P","poise"],.1,"viscosity",["<kilogram>"],["<meter>","<second>"]],"<stokes>":[["St","stokes"],1e-4,"viscosity",["<meter>","<meter>"],["<second>"]],"<mole>":[["mol","mole"],1,"substance",["<mole>"]],"<molar>":[["M","molar"],1e3,"concentration",["<mole>"],["<meter>","<meter>","<meter>"]],"<wtpercent>":[["wt%","wtpercent"],10,"concentration",["<kilogram>"],["<meter>","<meter>","<meter>"]],"<katal>":[["kat","katal","Katal"],1,"activity",["<mole>"],["<second>"]],"<unit>":[["U","enzUnit"],1.6667e-15,"activity",["<mole>"],["<second>"]],"<farad>":[["farad","Farad"],1,"capacitance",["<farad>"]],"<coulomb>":[["coulomb","Coulomb"],1,"charge",["<ampere>","<second>"]],"<Ah>":[["Ah"],3600,"charge",["<ampere>","<second>"]],"<ampere>":[["A","Ampere","ampere","amp","amps"],1,"current",["<ampere>"]],"<siemens>":[["S","Siemens","siemens"],1,"conductance",["<second>","<second>","<second>","<ampere>","<ampere>"],["<kilogram>","<meter>","<meter>"]],"<henry>":[["H","Henry","henry"],1,"inductance",["<meter>","<meter>","<kilogram>"],["<second>","<second>","<ampere>","<ampere>"]],"<volt>":[["V","Volt","volt","volts"],1,"potential",["<meter>","<meter>","<kilogram>"],["<second>","<second>","<second>","<ampere>"]],"<ohm>":[["Ohm","ohm","Ω","Ω"],1,"resistance",["<meter>","<meter>","<kilogram>"],["<second>","<second>","<second>","<ampere>","<ampere>"]],"<weber>":[["Wb","weber","webers"],1,"magnetism",["<meter>","<meter>","<kilogram>"],["<second>","<second>","<ampere>"]],"<tesla>":[["T","tesla","teslas"],1,"magnetism",["<kilogram>"],["<second>","<second>","<ampere>"]],"<gauss>":[["G","gauss"],1e-4,"magnetism",["<kilogram>"],["<second>","<second>","<ampere>"]],"<maxwell>":[["Mx","maxwell","maxwells"],1e-8,"magnetism",["<meter>","<meter>","<kilogram>"],["<second>","<second>","<ampere>"]],"<oersted>":[["Oe","oersted","oersteds"],250/Math.PI,"magnetism",["<ampere>"],["<meter>"]],"<joule>":[["J","joule","Joule","joules"],1,"energy",["<meter>","<meter>","<kilogram>"],["<second>","<second>"]],"<erg>":[["erg","ergs"],1e-7,"energy",["<meter>","<meter>","<kilogram>"],["<second>","<second>"]],"<btu>":[["BTU","btu","BTUs"],1055.056,"energy",["<meter>","<meter>","<kilogram>"],["<second>","<second>"]],"<calorie>":[["cal","calorie","calories"],4.184,"energy",["<meter>","<meter>","<kilogram>"],["<second>","<second>"]],"<Calorie>":[["Cal","Calorie","Calories"],4184,"energy",["<meter>","<meter>","<kilogram>"],["<second>","<second>"]],"<therm-US>":[["th","therm","therms","Therm"],105480400,"energy",["<meter>","<meter>","<kilogram>"],["<second>","<second>"]],"<Wh>":[["Wh"],3600,"energy",["<meter>","<meter>","<kilogram>"],["<second>","<second>"]],"<newton>":[["N","Newton","newton"],1,"force",["<kilogram>","<meter>"],["<second>","<second>"]],
"<dyne>":[["dyn","dyne"],1e-5,"force",["<kilogram>","<meter>"],["<second>","<second>"]],"<pound-force>":[["lbf","pound-force"],4.448222,"force",["<kilogram>","<meter>"],["<second>","<second>"]],"<hertz>":[["Hz","hertz","Hertz"],1,"frequency",["<1>"],["<second>"]],"<radian>":[["rad","radian","radians"],1,"angle",["<radian>"]],"<degree>":[["deg","degree","degrees"],Math.PI/180,"angle",["<radian>"]],"<gradian>":[["gon","grad","gradian","grads"],Math.PI/200,"angle",["<radian>"]],"<steradian>":[["sr","steradian","steradians"],1,"solid_angle",["<steradian>"]],"<rotation>":[["rotation"],2*Math.PI,"angle",["<radian>"]],"<rpm>":[["rpm"],2*Math.PI/60,"angular_velocity",["<radian>"],["<second>"]],"<byte>":[["B","byte","bytes"],1,"information",["<byte>"]],"<bit>":[["b","bit","bits"],.125,"information",["<byte>"]],"<Bps>":[["Bps"],1,"information_rate",["<byte>"],["<second>"]],"<bps>":[["bps"],.125,"information_rate",["<byte>"],["<second>"]],"<dollar>":[["USD","dollar"],1,"currency",["<dollar>"]],"<cents>":[["cents"],.01,"currency",["<dollar>"]],"<candela>":[["cd","candela"],1,"luminosity",["<candela>"]],"<lumen>":[["lm","lumen"],1,"luminous_power",["<candela>","<steradian>"]],"<lux>":[["lux"],1,"illuminance",["<candela>","<steradian>"],["<meter>","<meter>"]],"<watt>":[["W","watt","watts"],1,"power",["<kilogram>","<meter>","<meter>"],["<second>","<second>","<second>"]],"<horsepower>":[["hp","horsepower"],745.699872,"power",["<kilogram>","<meter>","<meter>"],["<second>","<second>","<second>"]],"<gray>":[["Gy","gray","grays"],1,"radiation",["<meter>","<meter>"],["<second>","<second>"]],"<roentgen>":[["R","roentgen"],.00933,"radiation",["<meter>","<meter>"],["<second>","<second>"]],"<sievert>":[["Sv","sievert","sieverts"],1,"radiation",["<meter>","<meter>"],["<second>","<second>"]],"<becquerel>":[["Bq","bequerel","bequerels"],1,"radiation",["<1>"],["<second>"]],"<curie>":[["Ci","curie","curies"],37e9,"radiation",["<1>"],["<second>"]],"<cpm>":[["cpm"],1/60,"rate",["<count>"],["<second>"]],"<dpm>":[["dpm"],1/60,"rate",["<count>"],["<second>"]],"<bpm>":[["bpm"],1/60,"rate",["<count>"],["<second>"]],"<dot>":[["dot","dots"],1,"resolution",["<each>"]],"<pixel>":[["pixel","px"],1,"resolution",["<each>"]],"<ppi>":[["ppi"],1,"resolution",["<pixel>"],["<inch>"]],"<dpi>":[["dpi"],1,"typography",["<dot>"],["<inch>"]],"<cell>":[["cells","cell"],1,"counting",["<each>"]],"<each>":[["each"],1,"counting",["<each>"]],"<count>":[["count"],1,"counting",["<each>"]],"<base-pair>":[["bp"],1,"counting",["<each>"]],"<nucleotide>":[["nt"],1,"counting",["<each>"]],"<molecule>":[["molecule","molecules"],1,"counting",["<1>"]],"<dozen>":[["doz","dz","dozen"],12,"prefix_only",["<each>"]],"<percent>":[["%","percent"],.01,"prefix_only",["<1>"]],"<ppm>":[["ppm"],1e-6,"prefix_only",["<1>"]],"<ppt>":[["ppt"],1e-9,"prefix_only",["<1>"]],"<gross>":[["gr","gross"],144,"prefix_only",["<dozen>","<dozen>"]],"<decibel>":[["dB","decibel","decibels"],1,"logarithmic",["<decibel>"]]},r=["<meter>","<kilogram>","<second>","<mole>","<farad>","<ampere>","<radian>","<kelvin>","<temp-K>","<byte>","<dollar>","<candela>","<each>","<steradian>","<decibel>"],i=["<1>"],a="([+-]?\\s*(?:(?:\\d+(?:\\.\\d+)?)|(?:\\.\\d+))(?:[Ee][+-]?\\d+)?)?\\s*([^/]*?)(?:/(.+?))?",s=new RegExp("^"+a+"$"),c=new RegExp("([^ \\*]+?)(?:\\^|\\*{2})?(-?\\d+(?![a-zA-Z]))"),u=new RegExp("([^ \\*]+?)(?:\\^|\\*{2})?(\\d+(?![a-zA-Z]))"),m=["length","time","temperature","mass","current","substance","luminosity","currency","information","angle","capacitance"],l={},p={},d={},f={},h={};for(var g in o)if(o.hasOwnProperty(g)){var x=o[g];if("prefix"===x[2]){l[g]=x[1];for(var y=0;y<x[0].length;y+=1)p[x[0][y]]=g}else{d[g]={scalar:x[1],numerator:x[3],denominator:x[4]};for(var v=0;v<x[0].length;v+=1)f[x[0][v]]=g}h[g]=x[0][0]}var b=Object.keys(p).sort(function(e,t){return t.length-e.length}).join("|"),w=Object.keys(f).sort(function(e,t){return t.length-e.length}).join("|"),O="("+b+")??("+w+")(?:\\b|$)",C=new RegExp(O,"g"),j=new RegExp("^\\s*("+O+"\\s*\\*?\\s*)+$");t.exports={UNITS:o,BASE_UNITS:r,UNITY:"<1>",UNITY_ARRAY:i,SIGNATURE_VECTOR:m,QTY_STRING:a,QTY_STRING_REGEX:s,TOP_REGEX:c,BOTTOM_REGEX:u,UNIT_VALUES:d,UNIT_MAP:f,PREFIX_VALUES:l,PREFIX_MAP:p,OUTPUT_MAP:h,UNIT_MATCH_REGEX:C,UNIT_TEST_REGEX:j}},{}],58:[function(e,t,n){t.exports=[{section:"introduction",name:"Introduction"},{section:"x1",name:"1 Scope"},{section:"x2",name:"2 Conformance"},{section:"x3",name:"3 Normative references"},{section:"x4",name:"4 Overview"},{section:"x4.1",name:"4.1 Web Scripting"},{section:"x4.2",name:"4.2 Language Overview"},{section:"x4.2.1",name:"4.2.1 Objects"},{section:"x4.2.2",name:"4.2.2 The Strict Variant of ECMAScript"},{section:"x4.3",name:"4.3 Definitions"},{section:"x4.3.1",name:"4.3.1 type"},{section:"x4.3.2",name:"4.3.2 primitive value"},{section:"x4.3.3",name:"4.3.3 object"},{section:"x4.3.4",name:"4.3.4 constructor"},{section:"x4.3.5",name:"4.3.5 prototype"},{section:"x4.3.6",name:"4.3.6 native object"},{section:"x4.3.7",name:"4.3.7 built-in object"},{section:"x4.3.8",name:"4.3.8 host object"},{section:"x4.3.9",name:"4.3.9 undefined value"},{section:"x4.3.10",name:"4.3.10 Undefined type"},{section:"x4.3.11",name:"4.3.11 null value"},{section:"x4.3.12",name:"4.3.12 Null type"},{section:"x4.3.13",name:"4.3.13 Boolean value"},{section:"x4.3.14",name:"4.3.14 Boolean type"},{section:"x4.3.15",name:"4.3.15 Boolean object"},{section:"x4.3.16",name:"4.3.16 String value"},{section:"x4.3.17",name:"4.3.17 String type"},{section:"x4.3.18",name:"4.3.18 String object"},{section:"x4.3.19",name:"4.3.19 Number value"},{section:"x4.3.20",name:"4.3.20 Number type"},{section:"x4.3.21",name:"4.3.21 Number object"},{section:"x4.3.22",name:"4.3.22 Infinity"},{section:"x4.3.23",name:"4.3.23 NaN"},{section:"x4.3.24",name:"4.3.24 function"},{section:"x4.3.25",name:"4.3.25 built-in function"},{section:"x4.3.26",name:"4.3.26 property"},{section:"x4.3.27",name:"4.3.27 method"},{section:"x4.3.28",name:"4.3.28 built-in method"},{section:"x4.3.29",name:"4.3.29 attribute"},{section:"x4.3.30",name:"4.3.30 own property"},{section:"x4.3.31",name:"4.3.31 inherited property"},{section:"x5",name:"5 Notational Conventions"},{section:"x5.1",name:"5.1 Syntactic and Lexical Grammars"},{section:"x5.1.1",name:"5.1.1 Context-Free Grammars"},{section:"x5.1.2",name:"5.1.2 The Lexical and RegExp Grammars"},{section:"x5.1.3",name:"5.1.3 The Numeric String Grammar"},{section:"x5.1.4",name:"5.1.4 The Syntactic Grammar"},{section:"x5.1.5",name:"5.1.5 The JSON Grammar"},{section:"x5.1.6",name:"5.1.6 Grammar Notation"},{section:"x5.2",name:"5.2 Algorithm Conventions"},{section:"x6",name:"6 Source Text"},{section:"x7",name:"7 Lexical Conventions"},{section:"x7.1",name:"7.1 Unicode Format-Control Characters"},{section:"x7.2",name:"7.2 White Space"},{section:"x7.3",name:"7.3 Line Terminators"},{section:"x7.4",name:"7.4 Comments"},{section:"x7.5",name:"7.5 Tokens"},{section:"x7.6",name:"7.6 Identifier Names and Identifiers"},{section:"x7.6.1",name:"7.6.1 Reserved Words"},{section:"x7.6.1.1",name:"7.6.1.1 Keywords"},{section:"x7.6.1.2",name:"7.6.1.2 Future Reserved Words"},{section:"x7.7",name:"7.7 Punctuators"},{section:"x7.8",name:"7.8 Literals"},{section:"x7.8.1",name:"7.8.1 Null Literals"},{section:"x7.8.2",name:"7.8.2 Boolean Literals"},{section:"x7.8.3",name:"7.8.3 Numeric Literals"},{section:"x7.8.4",name:"7.8.4 String Literals"},{section:"x7.8.5",name:"7.8.5 Regular Expression Literals"},{section:"x7.9",name:"7.9 Automatic Semicolon Insertion"},{section:"x7.9.1",name:"7.9.1 Rules of Automatic Semicolon Insertion"},{section:"x7.9.2",name:"7.9.2 Examples of Automatic Semicolon Insertion"},{section:"x8",name:"8 Types"},{section:"x8.1",name:"8.1 The Undefined Type"},{section:"x8.2",name:"8.2 The Null Type"},{section:"x8.3",name:"8.3 The Boolean Type"},{section:"x8.4",name:"8.4 The String Type"},{section:"x8.5",name:"8.5 The Number Type"},{section:"x8.6",name:"8.6 The Object Type"},{section:"x8.6.1",name:"8.6.1 Property Attributes"},{section:"x8.6.2",name:"8.6.2 Object Internal Properties and Methods"},{section:"x8.7",name:"8.7 The Reference Specification Type"},{section:"x8.7.1",name:"8.7.1 GetValue (V)"},{section:"x8.7.2",name:"8.7.2 PutValue (V, W)"},{section:"x8.8",name:"8.8 The List Specification Type"},{section:"x8.9",name:"8.9 The Completion Specification Type"},{section:"x8.10",name:"8.10 The Property Descriptor and Property Identifier Specification Types"},{section:"x8.10.1",name:"8.10.1 IsAccessorDescriptor ( Desc )"},{section:"x8.10.2",name:"8.10.2 IsDataDescriptor ( Desc )"},{section:"x8.10.3",name:"8.10.3 IsGenericDescriptor ( Desc )"},{section:"x8.10.4",name:"8.10.4 FromPropertyDescriptor ( Desc )"},{section:"x8.10.5",name:"8.10.5 ToPropertyDescriptor ( Obj )"},{section:"x8.11",name:"8.11 The Lexical Environment and Environment Record Specification Types"},{section:"x8.12",name:"8.12 Algorithms for Object Internal Methods"},{section:"x8.12.1",name:"8.12.1 [[GetOwnProperty]] (P)"},{section:"x8.12.2",name:"8.12.2 [[GetProperty]] (P)"},{section:"x8.12.3",name:"8.12.3 [[Get]] (P)"},{section:"x8.12.4",name:"8.12.4 [[CanPut]] (P)"},{section:"x8.12.5",name:"8.12.5 [[Put]] ( P, V, Throw )"},{section:"x8.12.6",name:"8.12.6 [[HasProperty]] (P)"},{section:"x8.12.7",name:"8.12.7 [[Delete]] (P, Throw)"},{section:"x8.12.8",name:"8.12.8 [[DefaultValue]] (hint)"},{section:"x8.12.9",name:"8.12.9 [[DefineOwnProperty]] (P, Desc, Throw)"},{section:"x9",name:"9 Type Conversion and Testing"},{section:"x9.1",name:"9.1 ToPrimitive"},{section:"x9.2",name:"9.2 ToBoolean"},{section:"x9.3",name:"9.3 ToNumber"},{section:"x9.3.1",name:"9.3.1 ToNumber Applied to the String Type"},{section:"x9.4",name:"9.4 ToInteger"},{section:"x9.5",name:"9.5 ToInt32: (Signed 32 Bit Integer)"},{section:"x9.6",name:"9.6 ToUint32: (Unsigned 32 Bit Integer)"},{section:"x9.7",name:"9.7 ToUint16: (Unsigned 16 Bit Integer)"},{section:"x9.8",name:"9.8 ToString"},{section:"x9.8.1",name:"9.8.1 ToString Applied to the Number Type"},{section:"x9.9",name:"9.9 ToObject"},{section:"x9.10",name:"9.10 CheckObjectCoercible"},{section:"x9.11",name:"9.11 IsCallable"},{section:"x9.12",name:"9.12 The SameValue Algorithm"},{section:"x10",name:"10 Executable Code and Execution Contexts"},{section:"x10.1",name:"10.1 Types of Executable Code"},{section:"x10.1.1",name:"10.1.1 Strict Mode Code"},{section:"x10.2",name:"10.2 Lexical Environments"},{section:"x10.2.1",name:"10.2.1 Environment Records"},{section:"x10.2.1.1",name:"10.2.1.1 Declarative Environment Records"},{section:"x10.2.1.1.1",name:"10.2.1.1.1 HasBinding(N)"},{section:"x10.2.1.1.2",name:"10.2.1.1.2 CreateMutableBinding (N, D)"},{section:"x10.2.1.1.3",name:"10.2.1.1.3 SetMutableBinding (N,V,S)"},{section:"x10.2.1.1.4",name:"10.2.1.1.4 GetBindingValue(N,S)"},{section:"x10.2.1.1.5",name:"10.2.1.1.5 DeleteBinding (N)"},{section:"x10.2.1.1.6",name:"10.2.1.1.6 ImplicitThisValue()"},{section:"x10.2.1.1.7",name:"10.2.1.1.7 CreateImmutableBinding (N)"},{section:"x10.2.1.1.8",name:"10.2.1.1.8 InitializeImmutableBinding (N,V)"},{section:"x10.2.1.2",name:"10.2.1.2 Object Environment Records"},{section:"x10.2.1.2.1",name:"10.2.1.2.1 HasBinding(N)"},{section:"x10.2.1.2.2",name:"10.2.1.2.2 CreateMutableBinding (N, D)"},{section:"x10.2.1.2.3",name:"10.2.1.2.3 SetMutableBinding (N,V,S)"},{section:"x10.2.1.2.4",name:"10.2.1.2.4 GetBindingValue(N,S)"},{section:"x10.2.1.2.5",name:"10.2.1.2.5 DeleteBinding (N)"},{section:"x10.2.1.2.6",name:"10.2.1.2.6 ImplicitThisValue()"},{section:"x10.2.2",name:"10.2.2 Lexical Environment Operations"},{section:"x10.2.2.1",name:"10.2.2.1 GetIdentifierReference (lex, name, strict)"},{section:"x10.2.2.2",name:"10.2.2.2 NewDeclarativeEnvironment (E)"},{section:"x10.2.2.3",name:"10.2.2.3 NewObjectEnvironment (O, E)"},{section:"x10.2.3",name:"10.2.3 The Global Environment"},{section:"x10.3",name:"10.3 Execution Contexts"},{section:"x10.3.1",name:"10.3.1 Identifier Resolution"},{section:"x10.4",name:"10.4 Establishing an Execution Context"},{section:"x10.4.1",name:"10.4.1 Entering Global Code"},{section:"x10.4.1.1",name:"10.4.1.1 Initial Global Execution Context"},{section:"x10.4.2",name:"10.4.2 Entering Eval Code"},{section:"x10.4.2.1",name:"10.4.2.1 Strict Mode Restrictions"},{section:"x10.4.3",name:"10.4.3 Entering Function Code"},{section:"x10.5",name:"10.5 Declaration Binding Instantiation"},{section:"x10.6",name:"10.6 Arguments Object"},{section:"x11",name:"11 Expressions"},{section:"x11.1",name:"11.1 Primary Expressions"},{section:"x11.1.1",name:"11.1.1 The this Keyword"},{section:"x11.1.2",name:"11.1.2 Identifier Reference"},{section:"x11.1.3",name:"11.1.3 Literal Reference"},{section:"x11.1.4",name:"11.1.4 Array Initialiser"},{section:"x11.1.5",name:"11.1.5 Object Initialiser"},{section:"x11.1.6",name:"11.1.6 The Grouping Operator"},{section:"x11.2",name:"11.2 Left-Hand-Side Expressions"},{section:"x11.2.1",name:"11.2.1 Property Accessors"},{section:"x11.2.2",name:"11.2.2 The new Operator"},{section:"x11.2.3",name:"11.2.3 Function Calls"},{section:"x11.2.4",name:"11.2.4 Argument Lists"},{section:"x11.2.5",name:"11.2.5 Function Expressions"},{section:"x11.3",name:"11.3 Postfix Expressions"},{section:"x11.3.1",name:"11.3.1 Postfix Increment Operator"},{section:"x11.3.2",name:"11.3.2 Postfix Decrement Operator"},{section:"x11.4",name:"11.4 Unary Operators"},{section:"x11.4.1",name:"11.4.1 The delete Operator"},{section:"x11.4.2",name:"11.4.2 The void Operator"},{section:"x11.4.3",name:"11.4.3 The typeof Operator"},{section:"x11.4.4",name:"11.4.4 Prefix Increment Operator"},{section:"x11.4.5",name:"11.4.5 Prefix Decrement Operator"},{section:"x11.4.6",name:"11.4.6 Unary + Operator"},{section:"x11.4.7",name:"11.4.7 Unary - Operator"},{section:"x11.4.8",name:"11.4.8 Bitwise NOT Operator ( ~ )"},{section:"x11.4.9",name:"11.4.9 Logical NOT Operator ( ! )"},{section:"x11.5",name:"11.5 Multiplicative Operators"},{section:"x11.5.1",name:"11.5.1 Applying the * Operator"},{section:"x11.5.2",name:"11.5.2 Applying the / Operator"},{section:"x11.5.3",name:"11.5.3 Applying the % Operator"},{section:"x11.6",name:"11.6 Additive Operators"},{section:"x11.6.1",name:"11.6.1 The Addition operator ( + )"},{section:"x11.6.2",name:"11.6.2 The Subtraction Operator ( - )"},{section:"x11.6.3",name:"11.6.3 Applying the Additive Operators to Numbers"},{section:"x11.7",name:"11.7 Bitwise Shift Operators"},{section:"x11.7.1",name:"11.7.1 The Left Shift Operator ( << )"},{section:"x11.7.2",name:"11.7.2 The Signed Right Shift Operator ( >> )"},{section:"x11.7.3",name:"11.7.3 The Unsigned Right Shift Operator ( >>> )"},{section:"x11.8",name:"11.8 Relational Operators"},{section:"x11.8.1",name:"11.8.1 The Less-than Operator ( < )"},{section:"x11.8.2",name:"11.8.2 The Greater-than Operator ( > )"},{section:"x11.8.3",name:"11.8.3 The Less-than-or-equal Operator ( <= )"},{section:"x11.8.4",name:"11.8.4 The Greater-than-or-equal Operator ( >= )"},{section:"x11.8.5",name:"11.8.5 The Abstract Relational Comparison Algorithm"},{section:"x11.8.6",name:"11.8.6 The instanceof operator"},{section:"x11.8.7",name:"11.8.7 The in operator"},{section:"x11.9",name:"11.9 Equality Operators"},{section:"x11.9.1",name:"11.9.1 The Equals Operator ( == )"},{section:"x11.9.2",name:"11.9.2 The Does-not-equals Operator ( != )"},{section:"x11.9.3",name:"11.9.3 The Abstract Equality Comparison Algorithm"},{section:"x11.9.4",name:"11.9.4 The Strict Equals Operator ( === )"},{section:"x11.9.5",name:"11.9.5 The Strict Does-not-equal Operator ( !== )"},{section:"x11.9.6",name:"11.9.6 The Strict Equality Comparison Algorithm"},{section:"x11.10",name:"11.10 Binary Bitwise Operators"},{section:"x11.11",name:"11.11 Binary Logical Operators"},{section:"x11.12",name:"11.12 Conditional Operator ( ? : )"},{section:"x11.13",name:"11.13 Assignment Operators"},{section:"x11.13.1",name:"11.13.1 Simple Assignment ( = )"},{section:"x11.13.2",name:"11.13.2 Compound Assignment ( op= )"},{section:"x11.14",name:"11.14 Comma Operator ( , )"},{section:"x12",name:"12 Statements"},{section:"x12.1",name:"12.1 Block"},{section:"x12.2",name:"12.2 Variable Statement"},{section:"x12.2.1",name:"12.2.1 Strict Mode Restrictions"},{section:"x12.3",name:"12.3 Empty Statement"},{section:"x12.4",name:"12.4 Expression Statement"},{section:"x12.5",name:"12.5 The if Statement"},{section:"x12.6",name:"12.6 Iteration Statements"},{section:"x12.6.1",name:"12.6.1 The do-while Statement"},{section:"x12.6.2",name:"12.6.2 The while Statement"},{section:"x12.6.3",name:"12.6.3 The for Statement"},{section:"x12.6.4",name:"12.6.4 The for-in Statement"},{section:"x12.7",name:"12.7 The continue Statement"},{section:"x12.8",name:"12.8 The break Statement"},{section:"x12.9",name:"12.9 The return Statement"},{section:"x12.10",name:"12.10 The with Statement"},{section:"x12.10.1",name:"12.10.1 Strict Mode Restrictions"},{section:"x12.11",name:"12.11 The switch Statement"},{section:"x12.12",name:"12.12 Labelled Statements"},{section:"x12.13",name:"12.13 The throw Statement"},{section:"x12.14",name:"12.14 The try Statement"},{section:"x12.14.1",name:"12.14.1 Strict Mode Restrictions"},{section:"x12.15",name:"12.15 The debugger statement"},{section:"x13",name:"13 Function Definition"},{section:"x13.1",name:"13.1 Strict Mode Restrictions"},{section:"x13.2",name:"13.2 Creating Function Objects"},{section:"x13.2.1",name:"13.2.1 [[Call]]"},{section:"x13.2.2",name:"13.2.2 [[Construct]]"},{section:"x13.2.3",name:"13.2.3 The Function Object"},{section:"x14",name:"14 Program"},{section:"x14.1",name:"14.1 Directive Prologues and the Use Strict Directive"},{section:"x15",name:"15 Standard Built-in ECMAScript Objects"},{section:"x15.1",name:"15.1 The Global Object"},{section:"x15.1.1",name:"15.1.1 Value Properties of the Global Object"},{section:"x15.1.1.1",name:"15.1.1.1 NaN"},{section:"x15.1.1.2",name:"15.1.1.2 Infinity"},{section:"x15.1.1.3",name:"15.1.1.3 undefined"},{section:"x15.1.2",name:"15.1.2 Function Properties of the Global Object"},{section:"x15.1.2.1",name:"15.1.2.1 eval (x)"},{section:"x15.1.2.1.1",name:"15.1.2.1.1 Direct Call to Eval"},{section:"x15.1.2.2",name:"15.1.2.2 parseInt (string , radix)"},{section:"x15.1.2.3",name:"15.1.2.3 parseFloat (string)"},{section:"x15.1.2.4",name:"15.1.2.4 isNaN (number)"},{section:"x15.1.2.5",name:"15.1.2.5 isFinite (number)"},{section:"x15.1.3",name:"15.1.3 URI Handling Function Properties"},{section:"x15.1.3.1",name:"15.1.3.1 decodeURI (encodedURI)"},{section:"x15.1.3.2",name:"15.1.3.2 decodeURIComponent (encodedURIComponent)"},{section:"x15.1.3.3",name:"15.1.3.3 encodeURI (uri)"},{section:"x15.1.3.4",name:"15.1.3.4 encodeURIComponent (uriComponent)"},{section:"x15.1.4",name:"15.1.4 Constructor Properties of the Global Object"},{section:"x15.1.4.1",name:"15.1.4.1 Object ( . . . )"},{section:"x15.1.4.2",name:"15.1.4.2 Function ( . . . )"},{section:"x15.1.4.3",name:"15.1.4.3 Array ( . . . )"},{section:"x15.1.4.4",name:"15.1.4.4 String ( . . . )"},{section:"x15.1.4.5",name:"15.1.4.5 Boolean ( . . . )"},{section:"x15.1.4.6",name:"15.1.4.6 Number ( . . . )"},{section:"x15.1.4.7",name:"15.1.4.7 Date ( . . . )"},{section:"x15.1.4.8",name:"15.1.4.8 RegExp ( . . . )"},{section:"x15.1.4.9",name:"15.1.4.9 Error ( . . . )"},{section:"x15.1.4.10",name:"15.1.4.10 EvalError ( . . . )"},{section:"x15.1.4.11",name:"15.1.4.11 RangeError ( . . . )"},{section:"x15.1.4.12",name:"15.1.4.12 ReferenceError ( . . . )"},{section:"x15.1.4.13",name:"15.1.4.13 SyntaxError ( . . . )"},{section:"x15.1.4.14",name:"15.1.4.14 TypeError ( . . . )"},{section:"x15.1.4.15",name:"15.1.4.15 URIError ( . . . )"},{section:"x15.1.5",name:"15.1.5 Other Properties of the Global Object"},{section:"x15.1.5.1",name:"15.1.5.1 Math"},{section:"x15.1.5.2",name:"15.1.5.2 JSON"},{section:"x15.2",name:"15.2 Object Objects"},{section:"x15.2.1",name:"15.2.1 The Object Constructor Called as a Function"},{section:"x15.2.1.1",name:"15.2.1.1 Object ( [ value ] )"},{section:"x15.2.2",name:"15.2.2 The Object Constructor"},{section:"x15.2.2.1",name:"15.2.2.1 new Object ( [ value ] )"},{section:"x15.2.3",name:"15.2.3 Properties of the Object Constructor"},{section:"x15.2.3.1",name:"15.2.3.1 Object.prototype"},{section:"x15.2.3.2",name:"15.2.3.2 Object.getPrototypeOf ( O )"},{section:"x15.2.3.3",name:"15.2.3.3 Object.getOwnPropertyDescriptor ( O, P ) "},{section:"x15.2.3.4",name:"15.2.3.4 Object.getOwnPropertyNames ( O )"},{section:"x15.2.3.5",name:"15.2.3.5 Object.create ( O [, Properties] )"},{section:"x15.2.3.6",name:"15.2.3.6 Object.defineProperty ( O, P, Attributes )"},{section:"x15.2.3.7",name:"15.2.3.7 Object.defineProperties ( O, Properties )"},{section:"x15.2.3.8",name:"15.2.3.8 Object.seal ( O )"},{section:"x15.2.3.9",name:"15.2.3.9 Object.freeze ( O )"},{section:"x15.2.3.10",name:"15.2.3.10 Object.preventExtensions ( O )"},{section:"x15.2.3.11",name:"15.2.3.11 Object.isSealed ( O )"},{section:"x15.2.3.12",name:"15.2.3.12 Object.isFrozen ( O )"},{section:"x15.2.3.13",name:"15.2.3.13 Object.isExtensible ( O )"},{section:"x15.2.3.14",name:"15.2.3.14 Object.keys ( O )"},{section:"x15.2.4",name:"15.2.4 Properties of the Object Prototype Object"},{section:"x15.2.4.1",name:"15.2.4.1 Object.prototype.constructor"},{section:"x15.2.4.2",name:"15.2.4.2 Object.prototype.toString ( )"},{section:"x15.2.4.3",name:"15.2.4.3 Object.prototype.toLocaleString ( )"},{section:"x15.2.4.4",name:"15.2.4.4 Object.prototype.valueOf ( )"},{section:"x15.2.4.5",name:"15.2.4.5 Object.prototype.hasOwnProperty (V)"},{section:"x15.2.4.6",name:"15.2.4.6 Object.prototype.isPrototypeOf (V)"},{section:"x15.2.4.7",name:"15.2.4.7 Object.prototype.propertyIsEnumerable (V)"},{section:"x15.2.5",name:"15.2.5 Properties of Object Instances"},{section:"x15.3",name:"15.3 Function Objects"},{section:"x15.3.1",name:"15.3.1 The Function Constructor Called as a Function"},{section:"x15.3.1.1",name:"15.3.1.1 Function (p1, p2, … , pn, body)"},{section:"x15.3.2",name:"15.3.2 The Function Constructor"},{section:"x15.3.2.1",name:"15.3.2.1 new Function (p1, p2, … , pn, body)"},{section:"x15.3.3",name:"15.3.3 Properties of the Function Constructor"},{section:"x15.3.3.1",name:"15.3.3.1 Function.prototype"},{section:"x15.3.3.2",name:"15.3.3.2 Function.length"},{section:"x15.3.4",name:"15.3.4 Properties of the Function Prototype Object"},{section:"x15.3.4.1",name:"15.3.4.1 Function.prototype.constructor"},{section:"x15.3.4.2",name:"15.3.4.2 Function.prototype.toString ( )"},{section:"x15.3.4.3",name:"15.3.4.3 Function.prototype.apply (thisArg, argArray)"},{section:"x15.3.4.4",name:"15.3.4.4 Function.prototype.call (thisArg [ , arg1 [ , arg2, … ] ] )"},{section:"x15.3.4.5",name:"15.3.4.5 Function.prototype.bind (thisArg [, arg1 [, arg2, …]])"},{section:"x15.3.4.5.1",name:"15.3.4.5.1 [[Call]]"},{section:"x15.3.4.5.2",name:"15.3.4.5.2 [[Construct]]"},{section:"x15.3.4.5.3",name:"15.3.4.5.3 [[HasInstance]] (V)"},{section:"x15.3.5",name:"15.3.5 Properties of Function Instances"},{section:"x15.3.5.1",name:"15.3.5.1 length"},{section:"x15.3.5.2",name:"15.3.5.2 prototype"},{section:"x15.3.5.3",name:"15.3.5.3 [[HasInstance]] (V)"},{section:"x15.3.5.4",name:"15.3.5.4 [[Get]] (P)"},{section:"x15.4",name:"15.4 Array Objects"},{section:"x15.4.1",name:"15.4.1 The Array Constructor Called as a Function"},{section:"x15.4.1.1",name:"15.4.1.1 Array ( [ item1 [ , item2 [ , … ] ] ] )"},{section:"x15.4.2",name:"15.4.2 The Array Constructor"},{section:"x15.4.2.1",name:"15.4.2.1 new Array ( [ item0 [ , item1 [ , … ] ] ] )"},{section:"x15.4.2.2",name:"15.4.2.2 new Array (len)"},{section:"x15.4.3",name:"15.4.3 Properties of the Array Constructor"},{section:"x15.4.3.1",name:"15.4.3.1 Array.prototype"},{section:"x15.4.3.2",name:"15.4.3.2 Array.isArray ( arg )"},{section:"x15.4.4",name:"15.4.4 Properties of the Array Prototype Object"},{section:"x15.4.4.1",name:"15.4.4.1 Array.prototype.constructor"},{section:"x15.4.4.2",name:"15.4.4.2 Array.prototype.toString ( )"},{section:"x15.4.4.3",name:"15.4.4.3 Array.prototype.toLocaleString ( )"},{section:"x15.4.4.4",name:"15.4.4.4 Array.prototype.concat ( [ item1 [ , item2 [ , … ] ] ] )"},{section:"x15.4.4.5",name:"15.4.4.5 Array.prototype.join (separator)"},{section:"x15.4.4.6",name:"15.4.4.6 Array.prototype.pop ( )"},{section:"x15.4.4.7",name:"15.4.4.7 Array.prototype.push ( [ item1 [ , item2 [ , … ] ] ] )"},{section:"x15.4.4.8",name:"15.4.4.8 Array.prototype.reverse ( )"},{section:"x15.4.4.9",name:"15.4.4.9 Array.prototype.shift ( )"},{section:"x15.4.4.10",name:"15.4.4.10 Array.prototype.slice (start, end)"},{section:"x15.4.4.11",name:"15.4.4.11 Array.prototype.sort (comparefn)"},{section:"x15.4.4.12",name:"15.4.4.12 Array.prototype.splice (start, deleteCount [ , item1 [ , item2 [ , … ] ] ] )"},{section:"x15.4.4.13",name:"15.4.4.13 Array.prototype.unshift ( [ item1 [ , item2 [ , … ] ] ] )"},{section:"x15.4.4.14",name:"15.4.4.14 Array.prototype.indexOf ( searchElement [ , fromIndex ] )"},{section:"x15.4.4.15",name:"15.4.4.15 Array.prototype.lastIndexOf ( searchElement [ , fromIndex ] )"},{section:"x15.4.4.16",name:"15.4.4.16 Array.prototype.every ( callbackfn [ , thisArg ] )"},{section:"x15.4.4.17",name:"15.4.4.17 Array.prototype.some ( callbackfn [ , thisArg ] )"},{section:"x15.4.4.18",name:"15.4.4.18 Array.prototype.forEach ( callbackfn [ , thisArg ] )"},{section:"x15.4.4.19",name:"15.4.4.19 Array.prototype.map ( callbackfn [ , thisArg ] )"},{section:"x15.4.4.20",name:"15.4.4.20 Array.prototype.filter ( callbackfn [ , thisArg ] )"},{section:"x15.4.4.21",name:"15.4.4.21 Array.prototype.reduce ( callbackfn [ , initialValue ] )"},{section:"x15.4.4.22",name:"15.4.4.22 Array.prototype.reduceRight ( callbackfn [ , initialValue ] )"},{section:"x15.4.5",name:"15.4.5 Properties of Array Instances"},{section:"x15.4.5.1",name:"15.4.5.1 [[DefineOwnProperty]] ( P, Desc, Throw )"},{section:"x15.4.5.2",name:"15.4.5.2 length"},{section:"x15.5",name:"15.5 String Objects"},{section:"x15.5.1",name:"15.5.1 The String Constructor Called as a Function"},{section:"x15.5.1.1",name:"15.5.1.1 String ( [ value ] )"},{section:"x15.5.2",name:"15.5.2 The String Constructor"},{section:"x15.5.2.1",name:"15.5.2.1 new String ( [ value ] )"},{section:"x15.5.3",name:"15.5.3 Properties of the String Constructor"},{section:"x15.5.3.1",name:"15.5.3.1 String.prototype"},{section:"x15.5.3.2",name:"15.5.3.2 String.fromCharCode ( [ char0 [ , char1 [ , … ] ] ] )"},{section:"x15.5.4",name:"15.5.4 Properties of the String Prototype Object"},{section:"x15.5.4.1",name:"15.5.4.1 String.prototype.constructor"},{section:"x15.5.4.2",name:"15.5.4.2 String.prototype.toString ( )"},{section:"x15.5.4.3",name:"15.5.4.3 String.prototype.valueOf ( )"},{section:"x15.5.4.4",name:"15.5.4.4 String.prototype.charAt (pos)"},{section:"x15.5.4.5",name:"15.5.4.5 String.prototype.charCodeAt (pos)"},{section:"x15.5.4.6",name:"15.5.4.6 String.prototype.concat ( [ string1 [ , string2 [ , … ] ] ] )"},{section:"x15.5.4.7",name:"15.5.4.7 String.prototype.indexOf (searchString, position)"},{section:"x15.5.4.8",name:"15.5.4.8 String.prototype.lastIndexOf (searchString, position)"},{section:"x15.5.4.9",name:"15.5.4.9 String.prototype.localeCompare (that)"},{section:"x15.5.4.10",name:"15.5.4.10 String.prototype.match (regexp)"},{section:"x15.5.4.11",name:"15.5.4.11 String.prototype.replace (searchValue, replaceValue)"},{section:"x15.5.4.12",name:"15.5.4.12 String.prototype.search (regexp)"},{section:"x15.5.4.13",name:"15.5.4.13 String.prototype.slice (start, end)"},{section:"x15.5.4.14",name:"15.5.4.14 String.prototype.split (separator, limit)"},{section:"x15.5.4.15",name:"15.5.4.15 String.prototype.substring (start, end)"},{section:"x15.5.4.16",name:"15.5.4.16 String.prototype.toLowerCase ( )"},{section:"x15.5.4.17",name:"15.5.4.17 String.prototype.toLocaleLowerCase ( )"},{section:"x15.5.4.18",name:"15.5.4.18 String.prototype.toUpperCase ( )"},{section:"x15.5.4.19",name:"15.5.4.19 String.prototype.toLocaleUpperCase ( )"},{section:"x15.5.4.20",name:"15.5.4.20 String.prototype.trim ( )"},{section:"x15.5.5",name:"15.5.5 Properties of String Instances"},{section:"x15.5.5.1",name:"15.5.5.1 length"},{section:"x15.5.5.2",name:"15.5.5.2 [[GetOwnProperty]] ( P )"},{section:"x15.6",name:"15.6 Boolean Objects"},{section:"x15.6.1",name:"15.6.1 The Boolean Constructor Called as a Function"},{section:"x15.6.1.1",name:"15.6.1.1 Boolean (value)"},{section:"x15.6.2",name:"15.6.2 The Boolean Constructor"},{section:"x15.6.2.1",name:"15.6.2.1 new Boolean (value)"},{section:"x15.6.3",name:"15.6.3 Properties of the Boolean Constructor"},{section:"x15.6.3.1",name:"15.6.3.1 Boolean.prototype"},{section:"x15.6.4",name:"15.6.4 Properties of the Boolean Prototype Object"},{section:"x15.6.4.1",name:"15.6.4.1 Boolean.prototype.constructor"},{section:"x15.6.4.2",name:"15.6.4.2 Boolean.prototype.toString ( )"},{section:"x15.6.4.3",name:"15.6.4.3 Boolean.prototype.valueOf ( )"},{section:"x15.6.5",name:"15.6.5 Properties of Boolean Instances"},{section:"x15.7",name:"15.7 Number Objects"},{section:"x15.7.1",name:"15.7.1 The Number Constructor Called as a Function"},{section:"x15.7.1.1",name:"15.7.1.1 Number ( [ value ] )"},{section:"x15.7.2",name:"15.7.2 The Number Constructor"},{section:"x15.7.2.1",name:"15.7.2.1 new Number ( [ value ] )"},{section:"x15.7.3",name:"15.7.3 Properties of the Number Constructor"},{section:"x15.7.3.1",name:"15.7.3.1 Number.prototype"},{section:"x15.7.3.2",name:"15.7.3.2 Number.MAX_VALUE"},{section:"x15.7.3.3",name:"15.7.3.3 Number.MIN_VALUE"},{section:"x15.7.3.4",name:"15.7.3.4 Number.NaN"},{section:"x15.7.3.5",name:"15.7.3.5 Number.NEGATIVE_INFINITY"},{section:"x15.7.3.6",name:"15.7.3.6 Number.POSITIVE_INFINITY"},{section:"x15.7.4",name:"15.7.4 Properties of the Number Prototype Object"},{section:"x15.7.4.1",name:"15.7.4.1 Number.prototype.constructor"},{section:"x15.7.4.2",name:"15.7.4.2 Number.prototype.toString ( [ radix ] )"},{section:"x15.7.4.3",name:"15.7.4.3 Number.prototype.toLocaleString()"},{section:"x15.7.4.4",name:"15.7.4.4 Number.prototype.valueOf ( )"},{section:"x15.7.4.5",name:"15.7.4.5 Number.prototype.toFixed (fractionDigits)"},{section:"x15.7.4.6",name:"15.7.4.6 Number.prototype.toExponential (fractionDigits)"},{section:"x15.7.4.7",name:"15.7.4.7 Number.prototype.toPrecision (precision)"},{section:"x15.7.5",name:"15.7.5 Properties of Number Instances"},{section:"x15.8",name:"15.8 The Math Object"},{section:"x15.8.1",name:"15.8.1 Value Properties of the Math Object"},{section:"x15.8.1.1",name:"15.8.1.1 E"},{section:"x15.8.1.2",name:"15.8.1.2 LN10"},{section:"x15.8.1.3",name:"15.8.1.3 LN2"},{section:"x15.8.1.4",name:"15.8.1.4 LOG2E"},{section:"x15.8.1.5",name:"15.8.1.5 LOG10E"},{section:"x15.8.1.6",name:"15.8.1.6 PI"},{section:"x15.8.1.7",name:"15.8.1.7 SQRT1_2"},{section:"x15.8.1.8",name:"15.8.1.8 SQRT2"},{section:"x15.8.2",name:"15.8.2 Function Properties of the Math Object"},{section:"x15.8.2.1",name:"15.8.2.1 abs (x)"},{section:"x15.8.2.2",name:"15.8.2.2 acos (x)"},{section:"x15.8.2.3",name:"15.8.2.3 asin (x)"},{section:"x15.8.2.4",name:"15.8.2.4 atan (x)"},{section:"x15.8.2.5",name:"15.8.2.5 atan2 (y, x)"},{section:"x15.8.2.6",name:"15.8.2.6 ceil (x)"},{section:"x15.8.2.7",name:"15.8.2.7 cos (x)"},{section:"x15.8.2.8",name:"15.8.2.8 exp (x)"},{section:"x15.8.2.9",name:"15.8.2.9 floor (x)"},{section:"x15.8.2.10",name:"15.8.2.10 log (x)"},{section:"x15.8.2.11",name:"15.8.2.11 max ( [ value1 [ , value2 [ , … ] ] ] )"},{section:"x15.8.2.12",name:"15.8.2.12 min ( [ value1 [ , value2 [ , … ] ] ] )"},{section:"x15.8.2.13",name:"15.8.2.13 pow (x, y)"},{section:"x15.8.2.14",name:"15.8.2.14 random ( )"},{section:"x15.8.2.15",name:"15.8.2.15 round (x)"},{section:"x15.8.2.16",name:"15.8.2.16 sin (x)"},{section:"x15.8.2.17",name:"15.8.2.17 sqrt (x)"},{section:"x15.8.2.18",name:"15.8.2.18 tan (x)"},{section:"x15.9",name:"15.9 Date Objects"},{section:"x15.9.1",name:"15.9.1 Overview of Date Objects and Definitions of Abstract Operators"},{section:"x15.9.1.1",
name:"15.9.1.1 Time Values and Time Range"},{section:"x15.9.1.2",name:"15.9.1.2 Day Number and Time within Day"},{section:"x15.9.1.3",name:"15.9.1.3 Year Number"},{section:"x15.9.1.4",name:"15.9.1.4 Month Number"},{section:"x15.9.1.5",name:"15.9.1.5 Date Number"},{section:"x15.9.1.6",name:"15.9.1.6 Week Day"},{section:"x15.9.1.7",name:"15.9.1.7 Local Time Zone Adjustment"},{section:"x15.9.1.8",name:"15.9.1.8 Daylight Saving Time Adjustment"},{section:"x15.9.1.9",name:"15.9.1.9 Local Time"},{section:"x15.9.1.10",name:"15.9.1.10 Hours, Minutes, Second, and Milliseconds"},{section:"x15.9.1.11",name:"15.9.1.11 MakeTime (hour, min, sec, ms)"},{section:"x15.9.1.12",name:"15.9.1.12 MakeDay (year, month, date)"},{section:"x15.9.1.13",name:"15.9.1.13 MakeDate (day, time)"},{section:"x15.9.1.14",name:"15.9.1.14 TimeClip (time)"},{section:"x15.9.1.15",name:"15.9.1.15 Date Time String Format"},{section:"x15.9.1.15.1",name:"15.9.1.15.1 Extended years"},{section:"x15.9.2",name:"15.9.2 The Date Constructor Called as a Function"},{section:"x15.9.2.1",name:"15.9.2.1 Date ( [ year [, month [, date [, hours [, minutes [, seconds [, ms ] ] ] ] ] ] ] )"},{section:"x15.9.3",name:"15.9.3 The Date Constructor"},{section:"x15.9.3.1",name:"15.9.3.1 new Date (year, month [, date [, hours [, minutes [, seconds [, ms ] ] ] ] ] )"},{section:"x15.9.3.2",name:"15.9.3.2 new Date (value)"},{section:"x15.9.3.3",name:"15.9.3.3 new Date ( )"},{section:"x15.9.4",name:"15.9.4 Properties of the Date Constructor"},{section:"x15.9.4.1",name:"15.9.4.1 Date.prototype"},{section:"x15.9.4.2",name:"15.9.4.2 Date.parse (string)"},{section:"x15.9.4.3",name:"15.9.4.3 Date.UTC (year, month [, date [, hours [, minutes [, seconds [, ms ] ] ] ] ])"},{section:"x15.9.4.4",name:"15.9.4.4 Date.now ( )"},{section:"x15.9.5",name:"15.9.5 Properties of the Date Prototype Object"},{section:"x15.9.5.1",name:"15.9.5.1 Date.prototype.constructor"},{section:"x15.9.5.2",name:"15.9.5.2 Date.prototype.toString ( )"},{section:"x15.9.5.3",name:"15.9.5.3 Date.prototype.toDateString ( )"},{section:"x15.9.5.4",name:"15.9.5.4 Date.prototype.toTimeString ( )"},{section:"x15.9.5.5",name:"15.9.5.5 Date.prototype.toLocaleString ( )"},{section:"x15.9.5.6",name:"15.9.5.6 Date.prototype.toLocaleDateString ( )"},{section:"x15.9.5.7",name:"15.9.5.7 Date.prototype.toLocaleTimeString ( )"},{section:"x15.9.5.8",name:"15.9.5.8 Date.prototype.valueOf ( )"},{section:"x15.9.5.9",name:"15.9.5.9 Date.prototype.getTime ( )"},{section:"x15.9.5.10",name:"15.9.5.10 Date.prototype.getFullYear ( )"},{section:"x15.9.5.11",name:"15.9.5.11 Date.prototype.getUTCFullYear ( )"},{section:"x15.9.5.12",name:"15.9.5.12 Date.prototype.getMonth ( )"},{section:"x15.9.5.13",name:"15.9.5.13 Date.prototype.getUTCMonth ( )"},{section:"x15.9.5.14",name:"15.9.5.14 Date.prototype.getDate ( )"},{section:"x15.9.5.15",name:"15.9.5.15 Date.prototype.getUTCDate ( )"},{section:"x15.9.5.16",name:"15.9.5.16 Date.prototype.getDay ( )"},{section:"x15.9.5.17",name:"15.9.5.17 Date.prototype.getUTCDay ( )"},{section:"x15.9.5.18",name:"15.9.5.18 Date.prototype.getHours ( )"},{section:"x15.9.5.19",name:"15.9.5.19 Date.prototype.getUTCHours ( )"},{section:"x15.9.5.20",name:"15.9.5.20 Date.prototype.getMinutes ( )"},{section:"x15.9.5.21",name:"15.9.5.21 Date.prototype.getUTCMinutes ( )"},{section:"x15.9.5.22",name:"15.9.5.22 Date.prototype.getSeconds ( )"},{section:"x15.9.5.23",name:"15.9.5.23 Date.prototype.getUTCSeconds ( )"},{section:"x15.9.5.24",name:"15.9.5.24 Date.prototype.getMilliseconds ( )"},{section:"x15.9.5.25",name:"15.9.5.25 Date.prototype.getUTCMilliseconds ( )"},{section:"x15.9.5.26",name:"15.9.5.26 Date.prototype.getTimezoneOffset ( )"},{section:"x15.9.5.27",name:"15.9.5.27 Date.prototype.setTime (time)"},{section:"x15.9.5.28",name:"15.9.5.28 Date.prototype.setMilliseconds (ms)"},{section:"x15.9.5.29",name:"15.9.5.29 Date.prototype.setUTCMilliseconds (ms)"},{section:"x15.9.5.30",name:"15.9.5.30 Date.prototype.setSeconds (sec [, ms ] )"},{section:"x15.9.5.31",name:"15.9.5.31 Date.prototype.setUTCSeconds (sec [, ms ] )"},{section:"x15.9.5.32",name:"15.9.5.32 Date.prototype.setMinutes (min [, sec [, ms ] ] )"},{section:"x15.9.5.33",name:"15.9.5.33 Date.prototype.setUTCMinutes (min [, sec [, ms ] ] )"},{section:"x15.9.5.34",name:"15.9.5.34 Date.prototype.setHours (hour [, min [, sec [, ms ] ] ] )"},{section:"x15.9.5.35",name:"15.9.5.35 Date.prototype.setUTCHours (hour [, min [, sec [, ms ] ] ] )"},{section:"x15.9.5.36",name:"15.9.5.36 Date.prototype.setDate (date)"},{section:"x15.9.5.37",name:"15.9.5.37 Date.prototype.setUTCDate (date)"},{section:"x15.9.5.38",name:"15.9.5.38 Date.prototype.setMonth (month [, date ] )"},{section:"x15.9.5.39",name:"15.9.5.39 Date.prototype.setUTCMonth (month [, date ] )"},{section:"x15.9.5.40",name:"15.9.5.40 Date.prototype.setFullYear (year [, month [, date ] ] )"},{section:"x15.9.5.41",name:"15.9.5.41 Date.prototype.setUTCFullYear (year [, month [, date ] ] )"},{section:"x15.9.5.42",name:"15.9.5.42 Date.prototype.toUTCString ( )"},{section:"x15.9.5.43",name:"15.9.5.43 Date.prototype.toISOString ( )"},{section:"x15.9.5.44",name:"15.9.5.44 Date.prototype.toJSON ( key )"},{section:"x15.9.6",name:"15.9.6 Properties of Date Instances"},{section:"x15.10",name:"15.10 RegExp (Regular Expression) Objects"},{section:"x15.10.1",name:"15.10.1 Patterns"},{section:"x15.10.2",name:"15.10.2 Pattern Semantics"},{section:"x15.10.2.1",name:"15.10.2.1 Notation"},{section:"x15.10.2.2",name:"15.10.2.2 Pattern"},{section:"x15.10.2.3",name:"15.10.2.3 Disjunction"},{section:"x15.10.2.4",name:"15.10.2.4 Alternative"},{section:"x15.10.2.5",name:"15.10.2.5 Term"},{section:"x15.10.2.6",name:"15.10.2.6 Assertion"},{section:"x15.10.2.7",name:"15.10.2.7 Quantifier"},{section:"x15.10.2.8",name:"15.10.2.8 Atom"},{section:"x15.10.2.9",name:"15.10.2.9 AtomEscape"},{section:"x15.10.2.10",name:"15.10.2.10 CharacterEscape"},{section:"x15.10.2.11",name:"15.10.2.11 DecimalEscape"},{section:"x15.10.2.12",name:"15.10.2.12 CharacterClassEscape"},{section:"x15.10.2.13",name:"15.10.2.13 CharacterClass"},{section:"x15.10.2.14",name:"15.10.2.14 ClassRanges"},{section:"x15.10.2.15",name:"15.10.2.15 NonemptyClassRanges"},{section:"x15.10.2.16",name:"15.10.2.16 NonemptyClassRangesNoDash"},{section:"x15.10.2.17",name:"15.10.2.17 ClassAtom"},{section:"x15.10.2.18",name:"15.10.2.18 ClassAtomNoDash"},{section:"x15.10.2.19",name:"15.10.2.19 ClassEscape"},{section:"x15.10.3",name:"15.10.3 The RegExp Constructor Called as a Function"},{section:"x15.10.3.1",name:"15.10.3.1 RegExp(pattern, flags)"},{section:"x15.10.4",name:"15.10.4 The RegExp Constructor"},{section:"x15.10.4.1",name:"15.10.4.1 new RegExp(pattern, flags)"},{section:"x15.10.5",name:"15.10.5 Properties of the RegExp Constructor"},{section:"x15.10.5.1",name:"15.10.5.1 RegExp.prototype"},{section:"x15.10.6",name:"15.10.6 Properties of the RegExp Prototype Object"},{section:"x15.10.6.1",name:"15.10.6.1 RegExp.prototype.constructor"},{section:"x15.10.6.2",name:"15.10.6.2 RegExp.prototype.exec(string)"},{section:"x15.10.6.3",name:"15.10.6.3 RegExp.prototype.test(string)"},{section:"x15.10.6.4",name:"15.10.6.4 RegExp.prototype.toString()"},{section:"x15.10.7",name:"15.10.7 Properties of RegExp Instances"},{section:"x15.10.7.1",name:"15.10.7.1 source"},{section:"x15.10.7.2",name:"15.10.7.2 global"},{section:"x15.10.7.3",name:"15.10.7.3 ignoreCase"},{section:"x15.10.7.4",name:"15.10.7.4 multiline"},{section:"x15.10.7.5",name:"15.10.7.5 lastIndex"},{section:"x15.11",name:"15.11 Error Objects"},{section:"x15.11.1",name:"15.11.1 The Error Constructor Called as a Function"},{section:"x15.11.1.1",name:"15.11.1.1 Error (message)"},{section:"x15.11.2",name:"15.11.2 The Error Constructor"},{section:"x15.11.2.1",name:"15.11.2.1 new Error (message)"},{section:"x15.11.3",name:"15.11.3 Properties of the Error Constructor"},{section:"x15.11.3.1",name:"15.11.3.1 Error.prototype"},{section:"x15.11.4",name:"15.11.4 Properties of the Error Prototype Object"},{section:"x15.11.4.1",name:"15.11.4.1 Error.prototype.constructor"},{section:"x15.11.4.2",name:"15.11.4.2 Error.prototype.name"},{section:"x15.11.4.3",name:"15.11.4.3 Error.prototype.message"},{section:"x15.11.4.4",name:"15.11.4.4 Error.prototype.toString ( )"},{section:"x15.11.5",name:"15.11.5 Properties of Error Instances"},{section:"x15.11.6",name:"15.11.6 Native Error Types Used in This Standard"},{section:"x15.11.6.1",name:"15.11.6.1 EvalError"},{section:"x15.11.6.2",name:"15.11.6.2 RangeError"},{section:"x15.11.6.3",name:"15.11.6.3 ReferenceError"},{section:"x15.11.6.4",name:"15.11.6.4 SyntaxError"},{section:"x15.11.6.5",name:"15.11.6.5 TypeError"},{section:"x15.11.6.6",name:"15.11.6.6 URIError"},{section:"x15.11.7",name:"15.11.7 NativeError Object Structure"},{section:"x15.11.7.1",name:"15.11.7.1 NativeError Constructors Called as Functions"},{section:"x15.11.7.2",name:"15.11.7.2 NativeError (message)"},{section:"x15.11.7.3",name:"15.11.7.3 The NativeError Constructors"},{section:"x15.11.7.4",name:"15.11.7.4 New NativeError (message)"},{section:"x15.11.7.5",name:"15.11.7.5 Properties of the NativeError Constructors"},{section:"x15.11.7.6",name:"15.11.7.6 NativeError.prototype"},{section:"x15.11.7.7",name:"15.11.7.7 Properties of the NativeError Prototype Objects"},{section:"x15.11.7.8",name:"15.11.7.8 NativeError.prototype.constructor"},{section:"x15.11.7.9",name:"15.11.7.9 NativeError.prototype.name"},{section:"x15.11.7.10",name:"15.11.7.10 NativeError.prototype.message"},{section:"x15.11.7.11",name:"15.11.7.11 Properties of NativeError Instances"},{section:"x15.12",name:"15.12 The JSON Object"},{section:"x15.12.1",name:"15.12.1 The JSON Grammar "},{section:"x15.12.1.1",name:"15.12.1.1 The JSON Lexical Grammar"},{section:"x15.12.1.2",name:"15.12.1.2 The JSON Syntactic Grammar"},{section:"x15.12.2",name:"15.12.2 parse ( text [ , reviver ] )"},{section:"x15.12.3",name:"15.12.3 stringify ( value [ , replacer [ , space ] ] )"},{section:"x16",name:"16 Errors"},{section:"A",name:"Annex A (informative) Grammar Summary"},{section:"A.1",name:"A.1 Lexical Grammar"},{section:"A.2",name:"A.2 Number Conversions"},{section:"A.3",name:"A.3 Expressions"},{section:"A.4",name:"A.4 Statements"},{section:"A.5",name:"A.5 Functions and Programs"},{section:"A.6",name:"A.6 Universal Resource Identifier Character Classes"},{section:"A.7",name:"A.7 Regular Expressions"},{section:"A.8",name:"A.8 JSON"},{section:"A.8.1",name:"A.8.1 JSON Lexical Grammar"},{section:"A.8.2",name:"A.8.2 JSON Syntactic Grammar"},{section:"B",name:"Annex B (informative) Compatibility"},{section:"B.1",name:"B.1 Additional Syntax"},{section:"B.1.1",name:"B.1.1 Numeric Literals"},{section:"B.1.2",name:"B.1.2 String Literals"},{section:"B.2",name:"B.2 Additional Properties"},{section:"B.2.1",name:"B.2.1 escape (string)"},{section:"B.2.2",name:"B.2.2 unescape (string)"},{section:"B.2.3",name:"B.2.3 String.prototype.substr (start, length)"},{section:"B.2.4",name:"B.2.4 Date.prototype.getYear ( )"},{section:"B.2.5",name:"B.2.5 Date.prototype.setYear (year)"},{section:"B.2.6",name:"B.2.6 Date.prototype.toGMTString ( )"},{section:"C",name:"Annex C (informative) The Strict Mode of ECMAScript"},{section:"D",name:"Annex D (informative) Corrections and Clarifications in the 5th Edition with Possible 3rd Edition Compatibility Impact"},{section:"E",name:"Annex E (informative) Additions and Changes in the 5th Edition that Introduce Incompatibilities with the 3rd Edition"},{section:"bibliography",name:"Bibliography"}]},{}],59:[function(e,t,n){n.undecided=["SSdtIG5vdCBzdXJl","RVJST1IgQ0FMQ1VMQVRJTkcgUkVTVUxU","SSBrbm93IGp1c3Qgb25lIHRoaW5nLCBhbmQgdGhhdCBpcyB0aGF0IEknbSBhIGx1bWJlcmphY2s="].map(atob),n.sameness=["VGhhdCdzIG5vdCByZWFsbHkgYSBjaG9pY2UsIG5vdyBpcyBpdD8=","U291bmRzIGxpa2UgeW91IGhhdmUgYWxyZWFkeSBkZWNpZGVk","Q2hlYXRlciBjaGVhdGVyIHlvdXIgaG91c2UgaXMgYSBoZWF0ZXI="].map(atob),n.answers=["QWJzb2x1dGVseSBub3Q=","QWJzb2x1dGVseSBub3Q=","QWJzb2x1dGVseSBub3Q=","QWxsIHNpZ25zIHBvaW50IHRvIG5v","QWxsIHNpZ25zIHBvaW50IHRvIG5v","QWxsIHNpZ25zIHBvaW50IHRvIG5v","QWxsIHNpZ25zIHBvaW50IHRvIHllcw==","QWxsIHNpZ25zIHBvaW50IHRvIHllcw==","QWxsIHNpZ25zIHBvaW50IHRvIHllcw==","QnV0IG9mIGNvdXJzZQ==","QnV0IG9mIGNvdXJzZQ==","QnV0IG9mIGNvdXJzZQ==","QnkgYWxsIG1lYW5z","QnkgYWxsIG1lYW5z","QnkgYWxsIG1lYW5z","Q2VydGFpbmx5IG5vdA==","Q2VydGFpbmx5IG5vdA==","Q2VydGFpbmx5IG5vdA==","Q2VydGFpbmx5","Q2VydGFpbmx5","Q2VydGFpbmx5","RGVmaW5pdGVseQ==","RGVmaW5pdGVseQ==","RGVmaW5pdGVseQ==","RG91YnRmdWxseQ==","RG91YnRmdWxseQ==","RG91YnRmdWxseQ==","RnJhbmtseSBteSBkZWFyLCBJIGRvbid0IGdpdmUgYSBkZWFu","RnJhbmtseSBteSBkZWFyLCBJIGRvbid0IGdpdmUgYSBkZWFu","SSBjYW4gbmVpdGhlciBjb25maXJtIG5vciBkZW55","SSBleHBlY3Qgc28=","SSBleHBlY3Qgc28=","SSBleHBlY3Qgc28=","SSdtIG5vdCBzbyBzdXJlIGFueW1vcmUuIEl0IGNhbiBnbyBlaXRoZXIgd2F5","SW1wb3NzaWJsZQ==","SW1wb3NzaWJsZQ==","SW1wb3NzaWJsZQ==","SW5kZWVk","SW5kZWVk","SW5kZWVk","SW5kdWJpdGFibHk=","SW5kdWJpdGFibHk=","SW5kdWJpdGFibHk=","Tm8gd2F5","Tm8gd2F5","Tm8gd2F5","Tm8=","Tm8=","Tm8=","Tm8=","Tm9wZQ==","Tm9wZQ==","Tm9wZQ==","Tm90IGEgY2hhbmNl","Tm90IGEgY2hhbmNl","Tm90IGEgY2hhbmNl","Tm90IGF0IGFsbA==","Tm90IGF0IGFsbA==","Tm90IGF0IGFsbA==","TnVoLXVo","TnVoLXVo","TnVoLXVo","T2YgY291cnNlIG5vdA==","T2YgY291cnNlIG5vdA==","T2YgY291cnNlIG5vdA==","T2YgY291cnNlIQ==","T2YgY291cnNlIQ==","T2YgY291cnNlIQ==","UHJvYmFibHk=","UHJvYmFibHk=","UHJvYmFibHk=","WWVzIQ==","WWVzIQ==","WWVzIQ==","WWVzIQ==","WWVzLCBhYnNvbHV0ZWx5","WWVzLCBhYnNvbHV0ZWx5","WWVzLCBhYnNvbHV0ZWx5"].map(atob)},{}],60:[function(e,t,n){function o(){this.word=null,this.children={}}function r(e){if(!(this instanceof r))throw new TypeError("Illegal function call");if(e=Number(e),isNaN(e)||e<1)throw new TypeError("maxCost must be an integer > 1 ");this.maxCost=e,this.trie=new o}function i(e,t){var n,o,r,i=[];for(void 0===t?(r=0,o=e):(r=e,o=t-r),n=0;n<o;n+=1)i[n]=r,r+=1;return i}function a(e,t,n){var o=[],r=i(e.length+1);return Object.keys(n.children).forEach(function(i){s(n.children[i],i,e,r,o,t)}),o}function s(e,t,n,o,r,i){var a,c,u,m,l,p=n.length+1,d=[o[0]+1];for(a=1;a<p;a+=1)c=d[a-1]+1,u=o[a]+1,m=n.charAt(a-1)!==t?o[a-1]+1:o[a-1],d.push(Math.min(c,u,m));l=d[d.length-1],l<=i&&null!==e.word&&r.push([e.word,l]),Math.min.apply(Math,d)<=i&&Object.keys(e.children).forEach(function(t){s(e.children[t],t,n,d,r,i)})}o.prototype.add=function(e){for(var t,n=this,r=0;r<e.length;r+=1)t=e.charAt(r),t in n.children||(n.children[t]=new o),n=n.children[t];n.word=e},o.prototype.del=function(e,t){t=t||0;var n=this,o=e[t];t+=1;var r=n.children[o];r&&(r.del(e,t),Object.keys(r.children).length||null!==r.word||delete n.children[o]),n.word===e&&(n.word=null)},r.prototype={constructor:r,build:function(e){if(!Array.isArray(e))throw new TypeError("Cannot build a dictionary from "+e);this.trie=new o,e.forEach(function(e){this.trie.add(e)},this)},__sortfn:function(e,t){return e[1]-t[1]},search:function(e){e=e.valueOf();var t;if("string"!=typeof e)throw new TypeError("Cannot search "+e);if(void 0===this.trie)throw new TypeError("Cannot search, dictionary isn't built yet");return t=a(e,this.maxCost,this.trie),t.sort(this.__sortfn),t.map(function(e){return e[0]})}},n.SuggestionDictionary=r},{}],61:[function(e,t,n){"use strict";t.exports=function(e){function t(t,o,r){function i(e){e=JSON.parse(e),e.users.forEach(a)}function a(e){n[e.id]=e,r(e)}Array.isArray(o)||(o=[o]),o.length&&e.IO.xhr({method:"POST",url:"/user/info",data:{ids:o.join(),roomId:t||e.adapter.roomid},complete:i})}var n={},o=[],r=function(e,t){o.push(e.user_id),i(t)};e.IO.register("userjoin",function(t){function o(n){e.IO.fire("userregister",n,t.room_id)}e.log(t,"userjoin");var i=n[t.user_id];i?o(i):r(t,o)});var i=function(n){e.log(o,"user addInfos"),t(null,o,n),o=[]}.throttle(1e3);return n.request=t,n.findUserId=function(e){function t(t){return o(n[t].name)===e}function o(e){return e.toLowerCase().replace(/\s/g,"")}var r=Object.keys(n);return e=o(e),r.first(t)||-1}.memoize(),n.findUsername=function(){var t={};return function(o,r){function i(e){a(e.name)}function a(e){r(t[o]=e)}t[o]?a(t[o]):n[o]?a(n[o].name):n.request(e.adapter.roomid,o,i)}}(),n.loadUsers=function(){CHAT.RoomUsers.all().forEach(function(e){n[e.id]=e})},n}},{}],62:[function(e,t,n){Object.merge=function(){return[].reduce.call(arguments,function(e,t){return Object.keys(t).forEach(function(n){e[n]=t[n]}),e},{})},Object.iterate=function(e,t,n){Object.keys(e).forEach(function(o){t.call(n,o,e[o],e)})},Object.TruthMap=function(e){function t(e,t){return e[t]=!0,e}return(e||[]).reduce(t,Object.create(null))},Array.from=function(e,t){return[].slice.call(e,t)},Object.defineProperty(Array.prototype,"invoke",{value:function(e){function t(t){var o=t;return t[e]&&t[e].apply&&(o=t[e].apply(t,n)),o}var n=Array.from(arguments,1);return this.map(t)},configurable:!0,writable:!0}),Object.defineProperty(Array.prototype,"pluck",{value:function(e){function t(t){try{return t[e]}catch(e){return t}}return this.map(t)},configurable:!0,writable:!0}),Object.defineProperty(Array.prototype,"first",{value:function(e){return this.some(function(t){return e.apply(null,arguments)&&((e=t)||!0)})?e:null},configurable:!0,writable:!0}),Object.defineProperty(Array.prototype,"random",{value:function(){return this[Math.floor(Math.random()*this.length)]},configurable:!0,writable:!0}),Object.defineProperty(Array.prototype,"groupBy",{value:function(e){return this.reduce(function(t,n){var o=e(n);return t[o]||(t[o]=[]),t[o].push(n),t},{})},configurable:!0,writable:!0}),["forEach","map","filter","reduce"].forEach(function(e){var t=[][e];Array[e]=function(){return t.call.apply(t,arguments)}}),String.prototype.indexesOf=function(e,t){for(var n=(t||0)-1,o=[];(n=this.indexOf(e,n+1))>-1;)o.push(n);return o},String.prototype.supplant=function(e){function t(e,t){return n.hasOwnProperty(t)?n[t]:e}var n=Object(e)===e?e:arguments;return this.replace(/\{([^\}]+)\}/g,t)},String.prototype.startsWith=function(e){return 0===this.indexOf(e)},Function.prototype.throttle=function(e){var t=this,n=-1;return function(){clearTimeout(n);var o=this,r=arguments;n=setTimeout(function(){t.apply(o,r)},e)}},Function.prototype.memoize=function(){var e=Object.create(null),t=this;return function(n){if(n in e)return e[n];var o=t.apply(null,arguments);return e[n]=o,o}},Function.prototype.memoizeAsync=function(e){var t=Object.create(null),n=this;return e=e||function(e){return e},function(){function o(){t[a]=arguments,i.apply(null,arguments)}var r=Array.from(arguments),i=r.pop(),a=e.apply(null,arguments);if(a in t)return void i.apply(null,t[a]);r.push(o),n.apply(this,r)}},Function.prototype.stringContents=function(){return this.toString().replace(/^function\*?\s+\([^)]*\)\s*\{/,"").replace(/\}$/,"")},Number.prototype.maxDecimal=function(e){var t=Math.pow(10,e);return Math.floor(this*t)/t},Number.prototype.fallsAfter=function(e){e=e.slice();for(var t,n=e.shift(),o=this.valueOf(),r=0,i=e.length;r<i&&(t=e[r],!(o<t));r+=1)n=t;return n<=o?n:null},Math.ratio=function(e,t){e=Number(e),t=Number(t);var n=this.gcd(e,t);return e/n+":"+t/n},Math.gcd=function(e,t){return t?this.gcd(t,e%t):e},Math.rand=function(e,t){return void 0===e?(e=0,t=9):void 0===t&&(t=e,e=0),Math.floor(Math.random()*(t-e+1))+e},Object.defineProperty(RegExp.prototype,"toJSON",{value:function(){return this.toString()},configurable:!0,writable:!0}),RegExp.escape=function(e){return e.replace(/[-^$\\\/\.*+?()[\]{}|]/g,"\\$&")},Date.timeSince=function(e,t){function n(e,t){return e=Math.floor(e),t+=1===e?"":"s",e+" "+t}t=t||new Date;for(var o,r=t-e,i=[{delta:31536e6,suffix:"year"},{delta:2592e6,suffix:"month"},{delta:864e5,suffix:"day"},{delta:36e5,suffix:"hour"},{delta:6e4,suffix:"minute"},{delta:1e3,suffix:"second"}];i.length;)if(o=i.shift(),r>=o.delta)return n(r/o.delta,o.suffix);return n(r,"millisecond")}},{}]},{},[62,7,4]);