├── Run.bat ├── settings.json ├── flash ├── webcams.fla └── webcams.as ├── static ├── flash │ └── webcams.swf ├── images │ ├── favicon.png │ └── altfavicon.png ├── fonts │ ├── glyphicons-halflings-regular.eot │ ├── glyphicons-halflings-regular.ttf │ ├── glyphicons-halflings-regular.woff │ └── glyphicons-halflings-regular.woff2 ├── js │ ├── settings_example.js │ ├── bootstrap.min.js │ └── jquery-2.1.1.min.js ├── index.htm └── css │ └── main.css ├── install.bat ├── package.json ├── .gitattributes ├── .gitignore ├── cleverbot.js ├── README.md ├── shamchat.js ├── omegle.js └── app.js /Run.bat: -------------------------------------------------------------------------------- 1 | node app.js 2 | pause -------------------------------------------------------------------------------- /settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "defaultLanguage": "en", 3 | "debug": false 4 | } -------------------------------------------------------------------------------- /flash/webcams.fla: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ash47/OmegleMiddleMan/HEAD/flash/webcams.fla -------------------------------------------------------------------------------- /static/flash/webcams.swf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ash47/OmegleMiddleMan/HEAD/static/flash/webcams.swf -------------------------------------------------------------------------------- /static/images/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ash47/OmegleMiddleMan/HEAD/static/images/favicon.png -------------------------------------------------------------------------------- /static/images/altfavicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ash47/OmegleMiddleMan/HEAD/static/images/altfavicon.png -------------------------------------------------------------------------------- /static/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ash47/OmegleMiddleMan/HEAD/static/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /static/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ash47/OmegleMiddleMan/HEAD/static/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /static/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ash47/OmegleMiddleMan/HEAD/static/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /static/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ash47/OmegleMiddleMan/HEAD/static/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /install.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | echo Please wait, attempting to install... 3 | cmd /c npm install && echo Installation Successful || echo Please ensure you have installed NodeJS. Download from https://nodejs.org/en/ 4 | pause 5 | 6 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "OmegleMiddleMan", 3 | "description": "A test omegle project", 4 | "version": "0.0.1", 5 | "private": true, 6 | "dependencies": { 7 | "axios": "^1.2.2", 8 | "express": "*", 9 | "faye": "*", 10 | "qs": "*", 11 | "request": "*", 12 | "socket.io": "*" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | *.sln merge=union 7 | *.csproj merge=union 8 | *.vbproj merge=union 9 | *.fsproj merge=union 10 | *.dbproj merge=union 11 | 12 | # Standard to msysgit 13 | *.doc diff=astextplain 14 | *.DOC diff=astextplain 15 | *.docx diff=astextplain 16 | *.DOCX diff=astextplain 17 | *.dot diff=astextplain 18 | *.DOT diff=astextplain 19 | *.pdf diff=astextplain 20 | *.PDF diff=astextplain 21 | *.rtf diff=astextplain 22 | *.RTF diff=astextplain 23 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Windows image file caches 2 | Thumbs.db 3 | ehthumbs.db 4 | 5 | # Folder config file 6 | Desktop.ini 7 | 8 | # Recycle Bin used on file shares 9 | $RECYCLE.BIN/ 10 | 11 | # Windows Installer files 12 | *.cab 13 | *.msi 14 | *.msm 15 | *.msp 16 | 17 | # ========================= 18 | # Operating System Files 19 | # ========================= 20 | 21 | # OSX 22 | # ========================= 23 | 24 | .DS_Store 25 | .AppleDouble 26 | .LSOverride 27 | 28 | # Icon must ends with two \r. 29 | Icon 30 | 31 | 32 | # Thumbnails 33 | ._* 34 | 35 | # Files that might appear on external disk 36 | .Spotlight-V100 37 | .Trashes 38 | 39 | node_modules/* 40 | 41 | # Ignore the settings file 42 | static/js/settings.js 43 | 44 | b.txt -------------------------------------------------------------------------------- /static/js/settings_example.js: -------------------------------------------------------------------------------- 1 | // Settings 2 | omegleSettings = { 3 | // Default topics 4 | defaultTopics: [ 5 | 'noMultiRP ', // This topic will cause the bots to disconnect if they connect to each other 6 | 'rp', 7 | 'roleplay' 8 | ].join(), 9 | 10 | // The default message to send to people 11 | defaultMessage: 'Please make a copy of static/js/settings_example.js, and call it static/js/settings.js', 12 | 13 | // Extra params to add 14 | bonusParams: { 15 | }, 16 | 17 | // Turn reroll on by default 18 | reroll: true, 19 | 20 | // Turn moderated on by default 21 | moderated: true, 22 | 23 | // Turn spy mode on by default 24 | spy: false, 25 | 26 | // Turn ask question on by default 27 | ask: false, 28 | 29 | // Turn use likes on by default 30 | likes: true, 31 | 32 | // Turn use college on by default 33 | useCollege: false, 34 | 35 | // Turn use any college on by default 36 | anyCollge: true, 37 | 38 | // Turn video mode on by default 39 | video: false, 40 | 41 | // Should cleverbot have a delay 42 | delayed: true, 43 | 44 | // Max number of common interests 45 | maxCommonInterests: null, 46 | 47 | // The max amount of time we will wait for them to start typing 48 | maxWaitType: 15, 49 | 50 | // The max amount of time we will wait for them to send the first message 51 | maxWaitMessage: 45, 52 | 53 | // This will auto disconnect if someone speaks within 3 seconds and didn't send a "typing" command 54 | // This kind of thing is very common for bots, but, you also get it for some phone apps 55 | agressiveBotIgnore: false, 56 | 57 | // College stuff 58 | // college: '', 59 | // college_auth: '', 60 | } 61 | -------------------------------------------------------------------------------- /static/index.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 | 28 |
29 |
30 | 31 |
32 | 33 |
34 | Enter key words, one per line, of things that will cause someone to be auto blackholed:
35 | 36 |
37 | 38 | 39 | -------------------------------------------------------------------------------- /cleverbot.js: -------------------------------------------------------------------------------- 1 | var crypto = require('crypto') 2 | , http = require('http') 3 | , Cleverbot = function(){ 4 | this.params = { 5 | 'stimulus' : '' , 'start' : 'y' , 'sessionid' : '', 6 | 'vText8' : '' , 'vText7' : '' , 'vText6' : '', 7 | 'vText5' : '' , 'vText4' : '' , 'vText3' : '', 8 | 'vText2' : '' , 'icognoid' : 'wsf' , 'icognocheck' : '', 9 | 'fno' : '0', 'prevref' : '' , 'emotionaloutput' : '', 10 | 'emotionalhistory' : '' , 'asbotname' : '' , 'ttsvoice' : '', 11 | 'typing' : '' , 'lineref' : '' , 'sub' : 'Say', 12 | 'islearning' : '1', 'cleanslate' : 'false', 13 | }; 14 | }; 15 | 16 | Cleverbot.parserKeys = [ 17 | 'message', 'sessionid', 'logurl', 'vText8', 18 | 'vText7', 'vText6', 'vText5', 'vText4', 19 | 'vText3', 'vText2', 'prevref', '', 20 | 'emotionalhistory', 'ttsLocMP3', 'ttsLocTXT', 'ttsLocTXT3', 21 | 'ttsText', 'lineref', 'lineURL', 'linePOST', 22 | 'lineChoices', 'lineChoicesAbbrev', 'typingData', 'divert' 23 | ]; 24 | Cleverbot.digest = function(body){ 25 | var m = crypto.createHash('md5'); 26 | m.update(body) 27 | return m.digest('hex'); 28 | }; 29 | 30 | Cleverbot.encodeParams = function(a1){ 31 | var u=[]; 32 | for(x in a1){ 33 | if(a1[x] instanceof Array) 34 | u.push(x+"="+encodeURIComponent(a1[x].join(","))); 35 | else if(a1[x] instanceof Object) 36 | u.push(params(a1[x])); 37 | else 38 | u.push(x+"="+encodeURIComponent(a1[x])); 39 | } 40 | return u.join("&"); 41 | }; 42 | 43 | Cleverbot.prototype = { 44 | 45 | write : function(message,callback){ 46 | var clever = this; 47 | body = this.params; 48 | body.stimulus = message; 49 | body.icognocheck = Cleverbot.digest(Cleverbot.encodeParams(body).substring(9,35)); 50 | var options = { 51 | host: 'www.cleverbot.com', 52 | port: 80, 53 | path: '/webservicemin', 54 | method: 'POST', 55 | headers: { 56 | 'Content-Type': 'application/x-www-form-urlencoded', 57 | 'Content-Length': Cleverbot.encodeParams(body).length, 58 | 'Cache-Control': 'no-cache' 59 | } 60 | }; 61 | var req = http.request(options, function(res) { 62 | var cb = callback || function(){}; 63 | res.on('data', function(chunk) { 64 | var chunk_data = chunk.toString().split("\r") 65 | , responseHash = {}; 66 | for(var i = 0, iLen = chunk_data.length;i= 300) responseHash.message = 'Error: ' + res.statusCode; 70 | cb(responseHash); 71 | }); 72 | }); 73 | 74 | req.on('error', function(error) { 75 | // Log the error 76 | console.log('CLEVER ERROR: ' + error.message); 77 | 78 | // Resend the message 79 | clever.write(message, callback); 80 | }); 81 | 82 | req.write(Cleverbot.encodeParams(body)); 83 | req.end(); 84 | } 85 | }; 86 | 87 | module.exports = Cleverbot; 88 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | OmegleMiddleMan 2 | =============== 3 | 4 | # New Version Coming Soon 5 | - This app is currently being rebuild from the ground up with a nicer UI, more features, and bug fixes 6 | - More features coming soon 7 | 8 | # Unmaintained 9 | - This repo is now considered unmaintained, we will not be merging pull requests, and all the option issues will be fixed in the new version per above 10 | 11 | ### Old stuff: 12 | 13 | - Lets you connect to two or more clients, then middle man the conversation, allowing you to intercept, change and even add new messages. 14 | 15 | ### Requirements / Setup 16 | - You need [Node.js](http://nodejs.org/) 17 | - Open the `install.bat` file, this file will install the required files to run the server 18 | - Run the `Run.bat` file, which will start the server 19 | - By default, it listens on port 3000, you can access the client by going to `localhost:3000` in your webbrower 20 | 21 | ### Onscreen options 22 | - At the top of the screen you will see `New Omegle Window` 23 | - Clicking these will add a new Omegle window, or a new Chat Helper window respectively 24 | - **Reroll:** This option will reconnect you if the stranger disconnects 25 | - **Moderated:** If selected, you will be connected to the moderated section of omegle, you need this selected if you wish to talk to no perverts 26 | - **Spy:** This check box will enable spy mode 27 | - **Ask:** If spy is selected, it will ask the question that is in the box next to the `send` button 28 | - **Use Likes:** This option will use the likes listed in the box at the bottom of the screen 29 | - **College:** This will search for college students, note: You need to setup your college settings, see the Adding prefereces section 30 | - **Any College:** If selected, it will search for people from any college, not jsut your own 31 | - **Video:** This will enable video mode 32 | - Use the console command `setCameraSize(width, height, fps, quality)` to change the settings. The default is `setCameraSize(320, 240, 24, 91)` 33 | 34 | ### How do I know if my message was delivered? 35 | - The icon to the left of a message will highlight green when you send a message 36 | - The highlight will be removed if it is successful 37 | - The highlight will turn red if the message fails to be delivered 38 | - You will likely also get an error message if something went wrong 39 | - The client tends to continue trying to deliver, unless something goes horribly wrong 40 | 41 | ### Auto greeting people 42 | - You can enter a message to auto send to people, or leave it blank if you don't want to send the message 43 | - By default, it will send `hi` 44 | 45 | ### Broadcasting into other windows 46 | - To enable this, you need to set `Auto Broadcast` to on. 47 | - At the bottom of the window are two fields `B` and `A`, `B` is short for Broadcast, `A` is short for Add Name. 48 | - If you tick a B box, it will broadcast into all the windows you tick, if you tick the green box, it will send back what ever the user types, to themselves 49 | - If you have Add Name ticked as well, it will prepend the name field to all messages 50 | - The order of the boxes is from left to right, the green boxes simply help you to see which window is which 51 | 52 | ### Dealing with spam bots 53 | - Introducing the blackhole 54 | - The blackhole will allow you to move onto a new chat, while keeping the old window active, so the bot will think you're still chatting to them 55 | - You can click the "blackhole" button, or use the "auto blackhole" feature at the top to cause certain messages to trigger an auto blackhole, most bots use the same language, pick a key word, or a whole line of their chat, and watch them get blackholed 56 | - You can add tags to the start of blackhole lines to change the behavior 57 | - The following modifiers can be added to all blackhole messages: 58 | - [first] Will only apply blackhole rule to the first message 59 | - [nospaces] Will remove all the spaces from the message before trying to perform the matching 60 | - You can pick one of the following moddifiers: 61 | - By default, with none of these modifiers, if the given line is contained in a string (ignoring case), it will cause the person to be blackholed 62 | - [exact] Will blackhole only if the exact phrase is matched (ignoring case) 63 | - [regex] Will apply the given regex, and block if the regex matches (ignoring case) 64 | - Remember to click "prevent auto disconnect" when using the auto blackhole functionality, otherwise you might lose someone you are talking to 65 | 66 | ### Ignoring Bots 67 | - The ignore bots options will attempt to ignore bots and phone users. 68 | - It will auto disconnect if they haven't started typing within 10 seconds 69 | - It will also disconnect if they send a message without typing first (aka, common bot behavior) 70 | 71 | ### Adding preferences 72 | - Navigate to `static/js` and copy the `settings_example.js` and call it `settings.js` 73 | - Here you can fill in the default topics to search for 74 | - You can add your college settings to search for colleges 75 | - `bonusParams` will send extra params to the omegle server, kind of pointless since this client supports all of them 76 | - To find your college auth settings 77 | - Auth yourself on the omegle website 78 | - Open your cookies, then find omegles cookies 79 | - Find the `college` cookie 80 | - It will be in the following form: `%5B%22%22%2C%20%22%3A%22%5D` 81 | - `` goes into the college tag 82 | - `:` goes into the college_auth tag 83 | 84 | ### Stopping your bot from connecting to itself 85 | - Add `noMultiRP` as an interest, If the bot finds someone with this interest, it will auto disconenct and move on 86 | 87 | ### Limited Search 88 | - By default, it will only try to build one omegle connection at a time. If you want to build as many connections as possible at a time, turn `limited searching` off at the top. 89 | 90 | ### Fix Searching 91 | - It's possible your client may sit on `Creating a connection` forever, if this happens, just hit the `Fix Searching` button 92 | 93 | ### Recapcha 94 | - This is currently broken, and not easy to fix -- You will see the recaptcha and it will tell you that localhost is not supported. 95 | - Simply go onto the real `omegle.com` website, click the recaptcha, and then you can continue to use this omegle client. 96 | 97 | ### Language Options? 98 | - Simply edit the langauge in the `settings.json` file to update the language options. 99 | 100 | ### Chat Helper 101 | - A chat helper lets you define a bunch of common messages that you plan to use over and over, and then broadcast them into a chat. 102 | 103 | ### What if I close the server by mistake? 104 | - If you close the server while you are chatting with someone, simply open the server and the client will reconnect, none of their messages will be lost, it's possible messages you have sent while the server was down did not go through. 105 | 106 | ### Missing Features? 107 | - Currently there are no known missing features 108 | 109 | ### Credits 110 | - Original omegle client was taken from [here](https://github.com/CRogers/omegle), it no longer works as the protocol has mostly changed, and it has many bugs, I would do a pull request, except their code is written in coffee script, and I used javascript 111 | -------------------------------------------------------------------------------- /shamchat.js: -------------------------------------------------------------------------------- 1 | var EventEmitter = require('events').EventEmitter; 2 | var http = require('http'); 3 | var qs = require('qs'); 4 | var util = require('util'); 5 | var faye = require('faye'); 6 | 7 | // The version of our app 8 | var version = '1.0'; 9 | 10 | // Returns a server to connect to 11 | function pickServer() { 12 | // The list is currently hard coded 13 | // We should pull the list from the server really 14 | return 'bee1'+'.shamchat.com'; 15 | } 16 | 17 | function Sham(args) { 18 | // Ensure we have an args object 19 | if(args == null) args = {}; 20 | 21 | // Store data 22 | this.host = pickServer(); 23 | this.userAgent = args.userAgent || 'Sham node.js ' + version; 24 | 25 | // Do we have a client id? 26 | if(args.client_id) { 27 | this.client_id = args.client_id; 28 | } 29 | 30 | // Our character 31 | this.character = args.character || 'Unknown character'; 32 | } 33 | 34 | // Add event emitter methods 35 | util.inherits(Sham, EventEmitter); 36 | 37 | Sham.prototype.start = function(callback) { 38 | var _this = this; 39 | 40 | this.requestPost('/connect', { 41 | // Our character (our name basically) 42 | c: this.character, 43 | 44 | // Our nearID (used for video chat) 45 | nid: null 46 | }, function(res){ 47 | // Ensure the request worked 48 | if (res.statusCode !== 200) { 49 | if (typeof callback === "function") { 50 | callback(res.statusCode); 51 | return; 52 | } 53 | } 54 | 55 | // Process the event 56 | getAllData(res, function(data) { 57 | // Make sure we got some data 58 | if(data != null) { 59 | try { 60 | // Parse the info 61 | var info = JSON.parse(data); 62 | 63 | // Store the clientID 64 | _this.client_id = info.clientID; 65 | 66 | // Emit the newid event 67 | _this.emit('newid', _this.client_id); 68 | 69 | // Cleanup old faye 70 | _this.cleanupFaye(); 71 | 72 | // Setup event handlers 73 | _this.faye = new faye.Client('http://' + this.host + '/faye'); 74 | _this.faye.disable("autodisconnect"); 75 | 76 | _this.faye.subscribe("/" + _this.client_id, function(g) { 77 | console.log('yes!'); 78 | _this.messageReceived(g); 79 | }).then(function() { 80 | console.log('scc'); 81 | 82 | // Find a stranger 83 | _this.pair(callback); 84 | }, function() { 85 | console.log('err'); 86 | }); 87 | 88 | console.log('done setting up!'); 89 | } catch(e) { 90 | // Failure :( 91 | callback('Failed to parse JSON: '+e+'\n\n' + String(data)); 92 | } 93 | } else { 94 | // Run the fail callback 95 | callback(-1); 96 | } 97 | }); 98 | }); 99 | }; 100 | 101 | // Pairs us with a stranger 102 | Sham.prototype.pair = function(callback) { 103 | console.log('pairing...'); 104 | 105 | var _this = this; 106 | 107 | this.requestPost('/pair', { 108 | // Our clientID from the server 109 | id: this.client_id 110 | }, function(res){ 111 | // Ensure the request worked 112 | if (res.statusCode !== 200) { 113 | if (typeof callback === "function") { 114 | callback(res.statusCode); 115 | return; 116 | } 117 | } 118 | 119 | // Run the callback 120 | if (typeof callback === "function") { 121 | callback(); 122 | } 123 | 124 | console.log('Done!'); 125 | }); 126 | } 127 | 128 | // Message Handler 129 | Sham.prototype.messageReceived = function(g) { 130 | console.log('got a message!'); 131 | console.log(g); 132 | } 133 | 134 | // Cleans up Faye 135 | Sham.prototype.cleanupFaye = function() { 136 | if(!this.faye) return; 137 | 138 | this.faye.disconnect(); 139 | delete this.faye.fayeClient 140 | } 141 | 142 | // Store error handler 143 | Sham.prototype.errorHandler = function(callback) { 144 | // Store it 145 | this.errorCallback = callback; 146 | }; 147 | 148 | Sham.prototype.requestGet = function(path, callback) { 149 | return this.requestFull('GET', path, false, true, callback); 150 | }; 151 | 152 | Sham.prototype.requestPost = function(path, data, callback) { 153 | return this.requestFull('POST', path, data, true, callback); 154 | }; 155 | 156 | Sham.prototype.requestKA = function(path, data, callback) { 157 | return this.requestFull('POST', path, data, true, callback); 158 | }; 159 | 160 | Sham.prototype.requestFull = function(method, path, data, keepAlive, callback) { 161 | // Grab a reference to this 162 | var thisSham = this; 163 | 164 | // Grab form data 165 | var formData; 166 | if (data) { 167 | formData = formFormat(data); 168 | } 169 | 170 | // Format the options 171 | var options = { 172 | method: method, 173 | host: this.host, 174 | port: 80, 175 | path: path, 176 | headers: { 177 | 'User-Agent': this.userAgent 178 | }, 179 | agent:false 180 | }; 181 | 182 | // Add headers for form data 183 | if (formData) { 184 | options.headers['Content-Type'] = 'application/x-www-form-urlencoded'; 185 | options.headers['Content-Length'] = formData.length; 186 | } 187 | 188 | // Setup the keep alive header 189 | if (keepAlive) { 190 | options.headers['Connection'] = 'Keep-Alive'; 191 | } 192 | 193 | // Create the request 194 | var req = http.request(options, callback); 195 | 196 | // Handle disconnect error 197 | req.on('error', function(error) { 198 | // Grab the message 199 | var msg = 'ERROR (' + getTimeStamp() + '): ' + error.message; 200 | 201 | // Check if we have a callback 202 | if(thisSham.errorCallback) { 203 | // Run the callback 204 | thisSham.errorCallback(msg); 205 | } else { 206 | // Log the error 207 | console.log(msg); 208 | } 209 | 210 | // Resend the request after a short delay 211 | setTimeout(function() { 212 | thisSham.requestFull(method, path, data, keepAlive, callback); 213 | }, 1000); 214 | }); 215 | 216 | // Submit form data 217 | if (formData) { 218 | req.write(formData); 219 | } 220 | 221 | return req.end(); 222 | }; 223 | 224 | // Formats form data 225 | function formFormat(data) { 226 | var k, v; 227 | 228 | return ((function() { 229 | var _results; 230 | 231 | _results = []; 232 | for (k in data) { 233 | v = data[k]; 234 | _results.push("" + k + "=" + encodeURIComponent(v)); 235 | } 236 | 237 | return _results; 238 | })()).join('&'); 239 | }; 240 | 241 | // Returns all the data for the given resource object 242 | function getAllData(res, callback) { 243 | var buffer; 244 | 245 | buffer = []; 246 | res.on('data', function(chunk) { 247 | return buffer.push(chunk); 248 | }); 249 | 250 | res.on('end', function() { 251 | callback(buffer.join('')); 252 | }); 253 | }; 254 | 255 | // Define exports 256 | exports.Sham = Sham; 257 | -------------------------------------------------------------------------------- /flash/webcams.as: -------------------------------------------------------------------------------- 1 | package { 2 | // Imports 3 | import flash.display.MovieClip; 4 | import flash.media.Video; 5 | import flash.net.NetStream; 6 | import flash.net.NetConnection; 7 | import flash.events.NetStatusEvent; 8 | import flash.external.ExternalInterface; 9 | import flash.media.Camera; 10 | import flash.media.Microphone; 11 | import flash.media.SoundCodec; 12 | 13 | public class webcams extends MovieClip { 14 | // The container for our video 15 | private var videoContainer:MovieClip; 16 | 17 | // The container for us 18 | private var selfContainer:MovieClip; 19 | 20 | // The local stream 21 | private var localVideo:Video; 22 | 23 | // Our network connection 24 | private var netConnection:NetConnection; 25 | 26 | // The video stream 27 | private var receiveStream:NetStream; 28 | 29 | // The output stream 30 | private var sendStream:NetStream; 31 | 32 | // The server to connect to 33 | private var omegleServer = "rtmfp://rtmfp.omegle.com/"; 34 | 35 | // The ID of the pain we are attached to 36 | private var painID:Number; 37 | 38 | // The camera 39 | private var camera:Camera; 40 | 41 | // The microphone 42 | private var microphone:Microphone; 43 | 44 | // The name of the camera 45 | private var cameraName:String; 46 | 47 | // The ID of the mic 48 | private var micID:Number; 49 | 50 | // Camera sizing 51 | private var overrideWidth:Number = 320; 52 | private var overrideHeight:Number = 240; 53 | private var overrideFPS:Number = 24; 54 | private var overrideQuality:Number = 91; 55 | 56 | // Init webcam 57 | public function webcams() { 58 | // Craete the video container 59 | videoContainer = new MovieClip(); 60 | addChild(videoContainer); 61 | 62 | // Create the self container 63 | selfContainer = new MovieClip(); 64 | addChild(selfContainer); 65 | 66 | // Scale of your webcam 67 | var sc:Number = (400-320)/320; 68 | 69 | selfContainer.scaleX = sc; 70 | selfContainer.scaleY = sc; 71 | selfContainer.x = 320; 72 | selfContainer.y = 240 - (240*sc); 73 | 74 | // Craete local stream 75 | localVideo = new Video(); 76 | selfContainer.addChild(localVideo); 77 | 78 | // Hook the stream 79 | ExternalInterface.addCallback("setPainID", this.setPainID); 80 | ExternalInterface.addCallback("gotStrangerPeerID", this.gotStrangerPeerID); 81 | ExternalInterface.addCallback("setCameraName", this.setCameraName); 82 | ExternalInterface.addCallback("setMicID", this.setMicID); 83 | ExternalInterface.addCallback("setCameraSize", this.exteranlCameraSize); 84 | } 85 | 86 | private function setCameraName(cam:String):void { 87 | this.cameraName = cam; 88 | 89 | // The camera changed 90 | cameraChanged(); 91 | } 92 | 93 | private function exteranlCameraSize(width:Number = 320, height:Number = 240, fps:Number = 24, quality:Number = 91):void { 94 | // Store vars 95 | this.overrideWidth = width; 96 | this.overrideHeight = height; 97 | this.overrideFPS = fps; 98 | this.overrideQuality = quality; 99 | 100 | // Do the change 101 | cameraChanged(); 102 | } 103 | 104 | private function setMicID(mic:Number):void { 105 | this.micID = mic; 106 | 107 | // The mic changed 108 | micChanged(); 109 | } 110 | 111 | private function setPainID(newPainID, videoServer, videoPassword):void { 112 | // Store the painID 113 | this.painID = newPainID; 114 | 115 | // Create the connection 116 | this.netConnection = new NetConnection(); 117 | this.netConnection.addEventListener(NetStatusEvent.NET_STATUS,this.netConnectionHandler); 118 | this.netConnection.connect(videoServer || omegleServer, videoPassword); 119 | 120 | // Log it 121 | ExternalInterface.call("console.log", "Connecting to video server..."); 122 | } 123 | 124 | private function stopChat():void { 125 | if(this.sendStream) { 126 | this.sendStream.attachAudio(null); 127 | this.sendStream.attachCamera(null); 128 | } 129 | } 130 | 131 | private function gotStrangerPeerID(peerID:String):void { 132 | // Cleanup old connections 133 | if(this.receiveStream) { 134 | this.receiveStream.close(); 135 | this.receiveStream = null; 136 | } 137 | 138 | // Cleanup the container 139 | while (videoContainer.numChildren > 0) { 140 | videoContainer.removeChildAt(0); 141 | } 142 | 143 | // Create the video 144 | this.receiveStream = new NetStream(this.netConnection, peerID); 145 | var video:Video = new Video(); 146 | video.smoothing = true; 147 | video.attachNetStream(this.receiveStream); 148 | this.receiveStream.play("omegle"); 149 | 150 | // Add it to our container 151 | videoContainer.addChild(video); 152 | 153 | // Attach 154 | cameraChanged(); 155 | micChanged(); 156 | } 157 | 158 | private function cameraChanged():void { 159 | // Ensure they have cams 160 | if(Camera.names.length <= 0) return; 161 | 162 | // Grab the objects 163 | this.camera = Camera.getCamera(this.cameraName); 164 | 165 | if(this.camera) { 166 | this.camera.setMode(this.overrideWidth,this.overrideHeight,this.overrideFPS); 167 | this.camera.setQuality(0,this.overrideQuality); 168 | } 169 | 170 | if(this.sendStream) { 171 | this.sendStream.attachCamera(this.camera); 172 | } 173 | 174 | // Attach to local stream 175 | localVideo.attachCamera(this.camera); 176 | } 177 | 178 | private function micChanged():void { 179 | // Ensure they have mics 180 | if(Microphone.names.length <= 0) return; 181 | 182 | // Grab the objects 183 | this.microphone = Microphone.getMicrophone(this.micID); 184 | 185 | if(this.microphone) { 186 | this.microphone.setSilenceLevel(0, 1000); 187 | this.microphone.setUseEchoSuppression(true); 188 | this.microphone.framesPerPacket = 1; 189 | this.microphone.codec = SoundCodec.SPEEX; 190 | } 191 | 192 | if(this.sendStream) { 193 | this.sendStream.attachAudio(this.microphone); 194 | } 195 | } 196 | 197 | private function netConnectionHandler(status:NetStatusEvent):void { 198 | switch(status.info.code) { 199 | case "NetConnection.Connect.Success": 200 | // Log it 201 | ExternalInterface.call("console.log", "Connected successfully!"); 202 | 203 | // Tell our client our ID 204 | ExternalInterface.call("setPeerID", { 205 | painID: this.painID, 206 | nearID: this.netConnection.nearID, 207 | cameras: Camera.names, 208 | mics: Microphone.names 209 | }); 210 | 211 | // Connection manager 212 | var c:Object = new Object(); 213 | c.onPeerConnect = function(stranger:NetStream):Boolean { 214 | // Implement security? 215 | 216 | return true; 217 | }; 218 | 219 | // Create the send stream 220 | this.sendStream = new NetStream(this.netConnection,NetStream.DIRECT_CONNECTIONS); 221 | this.sendStream.client = c; 222 | this.sendStream.publish("omegle"); 223 | 224 | // Attach 225 | cameraChanged(); 226 | micChanged(); 227 | break; 228 | 229 | case "NetConnection.Connect.Failed": 230 | this.netConnection = null; 231 | 232 | ExternalInterface.call("console.log", "Failed to connect!"); 233 | break; 234 | 235 | case "NetConnection.Connect.Closed": 236 | this.netConnection = null; 237 | 238 | if(this.receiveStream) { 239 | this.receiveStream.close(); 240 | this.receiveStream = null; 241 | } 242 | 243 | ExternalInterface.call("console.log", "Connection was closed!"); 244 | break; 245 | 246 | default: 247 | ExternalInterface.call("console.log", "Unknown connection issue!"); 248 | break; 249 | } 250 | } 251 | } 252 | } 253 | -------------------------------------------------------------------------------- /static/css/main.css: -------------------------------------------------------------------------------- 1 | body { 2 | background: #222; 3 | padding:0px; 4 | margin:0px; 5 | overflow: hidden; 6 | } 7 | 8 | li { 9 | list-style-type: none; 10 | } 11 | 12 | input[type="text"], textarea { 13 | background-color: #343434; 14 | color: white; 15 | } 16 | 17 | 18 | #newCleverBot { 19 | display: none; 20 | } 21 | 22 | #mainCon { 23 | /*position: absolute; 24 | left: 0; 25 | width:0px; 26 | top: 40px; 27 | bottom: 0; 28 | padding-bottom:4px;*/ 29 | 30 | margin-top: 40px; 31 | height: calc(100% - 40px); 32 | } 33 | 34 | #windowManager { 35 | position:fixed; 36 | left:0px; 37 | top:0px; 38 | width:100%; 39 | margin:0px; 40 | margin-bottom:4px; 41 | padding:4px; 42 | background-color:#333; 43 | color: white; 44 | border-bottom:1px solid #000; 45 | } 46 | 47 | .omegleContainer { 48 | width: 400px; 49 | float:left; 50 | margin-right:4px; 51 | 52 | height: calc(100% - 40px); 53 | display: list-item; 54 | } 55 | 56 | .chatMain { 57 | margin: 0px; 58 | margin-left: -8px; 59 | padding: 0px; 60 | color: white; 61 | padding-left: 32px; 62 | vertical-align: top; 63 | } 64 | 65 | .chatLeft { 66 | margin: 0px; 67 | margin-left: -32; 68 | padding: 0px; 69 | vertical-align: top; 70 | display: inline; 71 | } 72 | 73 | .omegleContainer input[type="submit"] { 74 | width: 80px; 75 | height: 40px; 76 | margin-right: 4px; 77 | vertical-align: top; 78 | } 79 | 80 | .omegleContainer button { 81 | height: 40px; 82 | margin-right: 4px; 83 | vertical-align: top; 84 | } 85 | 86 | .omegleContainer label { 87 | margin-left: 8px; 88 | color: white; 89 | } 90 | 91 | .flashCon { 92 | width: 410px; 93 | height: 240px; 94 | text-align: center; 95 | } 96 | 97 | .omegleField { 98 | width: 400px; 99 | height:120px; 100 | border: 4px solid #AAA; 101 | background-color: #343434; 102 | color: white; 103 | resize: none; 104 | padding: 0px; 105 | padding-left: 4px; 106 | padding-right: 4px; 107 | } 108 | 109 | .omegleDebugField { 110 | display: none; 111 | } 112 | 113 | .debugMode .omegleDebugField { 114 | display: block; 115 | width: 400px; 116 | height:120px; 117 | border: 4px solid #AAA; 118 | resize: none; 119 | padding: 0px; 120 | padding-left: 4px; 121 | padding-right: 4px; 122 | overflow-y: scroll; 123 | } 124 | 125 | .omegleWindowContainer { 126 | position: absolute; 127 | top: 46px; 128 | bottom: 366px; 129 | width: 400px; 130 | } 131 | 132 | .debugMode .omegleWindowContainer { 133 | bottom: calc(366px + 120px); 134 | } 135 | 136 | .videoEnabled .omegleWindowContainer { 137 | top: 286px; 138 | bottom: 434px; 139 | } 140 | 141 | .omegleClose { 142 | -webkit-touch-callout: none; 143 | -webkit-user-select: none; 144 | -khtml-user-select: none; 145 | -moz-user-select: none; 146 | -ms-user-select: none; 147 | user-select: none; 148 | 149 | cursor: pointer; 150 | cursor: hand; 151 | 152 | float:right; 153 | 154 | border:1px solid #000; 155 | background:#f54; 156 | padding:0px; 157 | padding-left:7px; 158 | padding-right:7px; 159 | padding-bottom:3px; 160 | 161 | margin-top: 10px; 162 | margin-bottom:-40px; 163 | margin-right:30px; 164 | 165 | -moz-border-radius: 6px; 166 | border-radius: 6px; 167 | } 168 | 169 | .omegleClose.alt { 170 | margin-top: 0px; 171 | margin-bottom: 0px; 172 | margin-right: 4px; 173 | } 174 | 175 | .omegleWindow { 176 | width:400px; 177 | border: 1px solid #CCC; 178 | border-top-left-radius: 8px; 179 | border-top-right-radius: 8px; 180 | -moz-border-radius-topleft: 8px; 181 | -moz-border-radius-topright: 8px; 182 | -webkit-border-top-left-radius: 8px; 183 | -webkit-border-top-right-radius: 8px; 184 | background: #444; 185 | color: white; 186 | font-family: Helvetica,Arial,sans-serif; 187 | padding: 4px; 188 | 189 | overflow-y: scroll; 190 | height: 100%; 191 | } 192 | 193 | .highlight { 194 | background: #FFd5cc; 195 | } 196 | 197 | .highlight .omegleWindow { 198 | border: 1px solid #F00 !important; 199 | } 200 | 201 | .omegleAutoMessage { 202 | width: 120px; 203 | height: 65px !important; 204 | background-color: #343434; 205 | color:white; 206 | resize: none; 207 | display: inline-block; 208 | padding: 4px; 209 | } 210 | 211 | .omegleClientId { 212 | padding: 4px; 213 | width: 120px; 214 | height: 20px !important; 215 | } 216 | 217 | .nameField { 218 | width: 145px; 219 | height: 20px !important; 220 | margin-left:4px; 221 | margin-top:2px; 222 | resize: none; 223 | display: inline-block; 224 | padding: 0px; 225 | overflow: hidden 226 | } 227 | 228 | .timeField { 229 | width: 79px; 230 | height: 20px !important; 231 | margin-left:4px; 232 | margin-top:2px; 233 | resize: none; 234 | display: inline-block; 235 | padding: 0px; 236 | overflow: hidden; 237 | } 238 | 239 | .topicField { 240 | width: 400px; 241 | height: 80px; 242 | resize: none; 243 | } 244 | 245 | .omegleBroadcast { 246 | display: inline; 247 | } 248 | 249 | pre { 250 | margin:0px; 251 | white-space: pre-wrap; 252 | color: #FFF; 253 | } 254 | 255 | #totalOmeglers { 256 | float:right; 257 | margin-right:10px; 258 | } 259 | 260 | .broadcastSelf { 261 | background: #0F0; 262 | padding: 1px; 263 | display: inline; 264 | } 265 | 266 | .easySend { 267 | width: 16px; 268 | padding: 0px 5px 2px 12px; 269 | margin-right: 0px; 270 | color: white; 271 | 272 | -moz-border-radius: 8px; 273 | border-radius: 8px; 274 | 275 | -webkit-touch-callout: none; 276 | -webkit-user-select: none; 277 | -khtml-user-select: none; 278 | -moz-user-select: none; 279 | -ms-user-select: none; 280 | user-select: none; 281 | cursor: pointer; 282 | cursor: hand; 283 | } 284 | 285 | #autoBlackholeList { 286 | position: absolute; 287 | left: 0px; 288 | right: 0px; 289 | top:44px; 290 | bottom: 0px; 291 | background: #222; 292 | color: white; 293 | padding: 4px; 294 | display: none; 295 | } 296 | 297 | #updateBlackHoleList { 298 | margin-bottom: 4px; 299 | } 300 | 301 | #updateBlackHoleListField { 302 | width: 100%; 303 | height: calc(100% - 25px); 304 | } 305 | 306 | .chatHelperMain { 307 | height: 100%; 308 | vertical-align: top; 309 | 310 | border: 1px solid #CCC; 311 | border-top-left-radius: 8px; 312 | border-top-right-radius: 8px; 313 | 314 | padding: 4px; 315 | } 316 | 317 | .chatHelperForceScrollParent { 318 | height: 100%; 319 | overflow-y: scroll; 320 | } 321 | 322 | .chatHelperContainer { 323 | width: 400px; 324 | float:left; 325 | margin-right:4px; 326 | height: calc(100% - 36px); 327 | padding: 4px; 328 | } 329 | 330 | .chatHelperInput { 331 | width: 100%; 332 | min-width: 100px; 333 | background-color: #343434; 334 | color: white; 335 | } 336 | 337 | .chatHelperButtonCon { 338 | white-space: nowrap; 339 | } 340 | 341 | .closeButtonHolder { 342 | height: 32px; 343 | } 344 | 345 | .helperButtonRow { 346 | margin-top: 4px; 347 | } 348 | 349 | .smallButton { 350 | width: auto !important; 351 | white-space: pre; 352 | } 353 | 354 | .omegleWindow pre { 355 | border: none; 356 | background: none; 357 | padding: 0px; 358 | overflow: hidden; 359 | } 360 | 361 | .fixedButton { 362 | width: 120px; 363 | } 364 | 365 | hr { 366 | margin-top: 4px !important; 367 | margin-bottom: 4px !important; 368 | border-top: 1px solid #AAA; 369 | } 370 | 371 | .smallerChatButton { 372 | padding: 2px !important; 373 | padding-left: 4px !important; 374 | padding-right: 4px !important; 375 | margin-right: 4px; 376 | } 377 | 378 | .buttonHolder { 379 | display: inline-block; 380 | height: 90px; 381 | } 382 | 383 | .buttonHolderTable { 384 | margin-top: 4px; 385 | } 386 | 387 | .bottomContainer { 388 | position: absolute; 389 | bottom: 4px; 390 | 391 | height: 360px; 392 | } 393 | 394 | .debugMode .bottomContainer { 395 | height: calc(360px + 120px); 396 | } 397 | 398 | .videoEnabled .bottomContainer { 399 | height: 426px; 400 | } 401 | 402 | .chatHelperBottomButtonCon{ 403 | padding-top: 4px; 404 | text-align: center; 405 | } 406 | 407 | .chatHelperBottomButtonConMargin { 408 | margin-left: 4px; 409 | margin-right: 4px; 410 | } 411 | 412 | .chatHelperStringTable { 413 | width: 100%; 414 | } 415 | 416 | .omegleContainer a { 417 | cursor: pointer; 418 | cursor: hand; 419 | } -------------------------------------------------------------------------------- /omegle.js: -------------------------------------------------------------------------------- 1 | /* 2 | Original Library here: https://github.com/CRogers/omegle 3 | */ 4 | 5 | var EventEmitter = require('events').EventEmitter; 6 | const { default: axios } = require('axios'); 7 | var https = require('https'); 8 | var qs = require('qs'); 9 | var util = require('util'); 10 | 11 | var settings = require('./settings.json'); 12 | 13 | // Server list 14 | var serverList = []; 15 | let antiNudeServerList = []; 16 | 17 | // Callback(s) to run when we are ready 18 | var onReadyCallbacks = []; 19 | 20 | // Gets a time stamp 21 | function getTimeStamp() { 22 | var date = new Date(); 23 | 24 | var hour = date.getHours(); 25 | hour = (hour < 10 ? "0" : "") + hour; 26 | 27 | var min = date.getMinutes(); 28 | min = (min < 10 ? "0" : "") + min; 29 | 30 | var sec = date.getSeconds(); 31 | sec = (sec < 10 ? "0" : "") + sec; 32 | 33 | return hour + ":" + min + ":" + sec; 34 | } 35 | 36 | function Omegle(args) { 37 | // Ensure we have an args object 38 | if (args == null) args = {}; 39 | 40 | // Do we have a client id? 41 | if (args.client_id) { 42 | this.client_id = args.client_id; 43 | } 44 | 45 | // Store data 46 | this.userAgent = args.userAgent || 'Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.117 Safari/537.36'; 47 | this.host = args.host || Omegle.getSelectedServer(); 48 | this.language = args.language || settings.defaultLanguage || 'en'; 49 | this.mobile = args.mobile || false; 50 | 51 | // Store group 52 | this.group = args.group; 53 | 54 | // Attempt to copy the random ID in 55 | if (args.randid) { 56 | // It exists, copy it 57 | this.randid = args.randid; 58 | } else { 59 | // Generate a randomID 60 | this.randid = ''; 61 | var randData = '23456789ABCDEFGHJKLMNPQRSTUVWXYZ'; 62 | for (var i = 0; i < 8; i++) { 63 | this.randid += randData.charAt(Math.floor(Math.random() * randData.length)); 64 | } 65 | } 66 | 67 | // Spy mode? 68 | if (args.wantsspy) { 69 | // What kind of spy mode? 70 | if (args.ask) { 71 | // User is asking a question 72 | this.ask = args.ask; 73 | } else { 74 | // User is answering questions 75 | this.wantsspy = args.wantsspy; 76 | } 77 | } else { 78 | // Store college stuff 79 | if (args.college && args.college_auth) { 80 | this.college = args.college; 81 | this.college_auth = args.college_auth; 82 | 83 | if (args.any_college) { 84 | this.any_college = args.any_college; 85 | } 86 | } 87 | 88 | // Check if we should use topics 89 | if (args.topics != null && this.group != 'unmon') { 90 | this.topics = args.topics; 91 | this.use_likes = 1; 92 | } 93 | 94 | // Check for a camera 95 | if (args.camera && args.spid) { 96 | this.camera = args.camera; 97 | this.spid = args.spid; 98 | } 99 | } 100 | 101 | // Reset our ID when the stranger disconnects 102 | this.on('strangerDisconnected', function () { 103 | // Remove our ID 104 | this.client_id = null; 105 | }); 106 | } 107 | 108 | // Add event emitter methods 109 | util.inherits(Omegle, EventEmitter); 110 | 111 | // Selects a server for us 112 | var serverNumber = 0; 113 | Omegle.getSelectedServer = function () { 114 | return serverList[serverNumber] || 'omegle.com'; 115 | } 116 | 117 | // Function to allow callbacks for when the client is ready 118 | Omegle.onReady = function (callback) { 119 | // We will assume that there WILL be _some_ servers if the client is ready 120 | if (serverList.length > 0) { 121 | callback(serverList); 122 | } else { 123 | onReadyCallbacks.push(callback); 124 | } 125 | } 126 | 127 | // Store error handler 128 | Omegle.prototype.errorHandler = function (callback) { 129 | // Store it 130 | this.errorCallback = callback; 131 | }; 132 | 133 | Omegle.prototype.requestGet = function (path, callback, proxyInfo) { 134 | this.requestFull('GET', path, false, true, callback, proxyInfo); 135 | }; 136 | 137 | Omegle.prototype.requestPost = function (path, data, callback, proxyInfo) { 138 | this.requestFull('POST', path, data, true, callback, proxyInfo); 139 | }; 140 | 141 | Omegle.prototype.requestKA = function (path, data, callback, proxyInfo) { 142 | this.requestFull('POST', path, data, true, callback, proxyInfo); 143 | }; 144 | 145 | Omegle.prototype.requestFull = function (method, path, data, keepAlive, callback, proxyInfo) { 146 | // Grab a reference to this 147 | var thisOmegle = this; 148 | 149 | // Grab form data 150 | var formData; 151 | if (data) { 152 | formData = formFormat(data); 153 | } 154 | 155 | // Format the options 156 | var options = { 157 | method: method, 158 | host: this.host, 159 | port: 443, 160 | path: path, 161 | headers: { 162 | 'User-Agent': this.userAgent, 163 | host: this.host 164 | }, 165 | agent: false 166 | }; 167 | 168 | // Add in proxy info 169 | if (proxyInfo) { 170 | options.host = proxyInfo.ip; 171 | options.port = proxyInfo.port; 172 | } 173 | 174 | // Add headers for form data 175 | if (formData) { 176 | options.headers['Content-Type'] = 'application/x-www-form-urlencoded'; 177 | options.headers['Content-Length'] = formData.length; 178 | } 179 | 180 | // Setup the keep alive header 181 | if (keepAlive) { 182 | options.headers['Connection'] = 'Keep-Alive'; 183 | } 184 | 185 | // Debug mode 186 | if (settings.debug) { 187 | console.log('Requesting: https://' + this.host + path); 188 | 189 | if (data) { 190 | console.log(JSON.stringify(data, null, 4)); 191 | } 192 | } 193 | 194 | // Create the request 195 | var req = https.request(options, callback); 196 | 197 | // Allow no more than 65 seconds to complete the request 198 | setTimeout(function () { 199 | req.socket.end(); 200 | }, 65 * 1000); 201 | 202 | // Handle disconnect error 203 | req.on('error', function (error) { 204 | //console.log('$$$ ERROR!!!! $$$'); 205 | //console.log(error); 206 | 207 | // Grab the message 208 | var msg = 'ERROR (' + getTimeStamp() + '): ' + error.message; 209 | 210 | thisOmegle.nextServer(); 211 | 212 | // Check if we have a callback 213 | if (thisOmegle.errorCallback) { 214 | // Run the callback 215 | thisOmegle.errorCallback(msg); 216 | } else { 217 | // Log the error 218 | console.log(msg); 219 | } 220 | 221 | // Resend the request after a short delay 222 | setTimeout(function () { 223 | thisOmegle.requestFull(method, path, data, keepAlive, callback); 224 | }, 1000); 225 | }); 226 | 227 | // Submit form data 228 | if (formData) { 229 | req.write(formData); 230 | } 231 | 232 | return req.end(); 233 | }; 234 | 235 | // Attempst to reconnect 236 | Omegle.prototype.reconnect = function (callback) { 237 | // Ensure we have a client_id 238 | if (this.client_id == null) { 239 | callback('No client_id found.'); 240 | return; 241 | } 242 | 243 | // Emit the new ID event 244 | this.emit('newid', this.client_id); 245 | 246 | if (settings.debug) { 247 | this.emit('debugEvent', 'eventsLoop() reconnect'); 248 | } 249 | 250 | // Start the events loop again 251 | this.eventsLoop(); 252 | }; 253 | 254 | // Cycles to the next server 255 | Omegle.prototype.nextServer = function () { 256 | if (++serverNumber >= serverList.length) serverNumber = 0; 257 | this.host = Omegle.getSelectedServer(); 258 | } 259 | 260 | // Connects 261 | Omegle.prototype.start = function (callback, proxyInfo) { 262 | var _this = this; 263 | 264 | // get the access code 265 | this.getAccessCode().then(() => { 266 | this.requestGet('/start?' + qs.stringify({ 267 | rcs: 1, 268 | firstevents: 1, 269 | m: mobileValue(this.mobile), 270 | lang: this.language, 271 | randid: this.randid, 272 | use_likes: this.use_likes, 273 | topics: JSON.stringify(this.topics), 274 | group: this.group, 275 | college: this.college, 276 | college_auth: this.college_auth, 277 | any_college: this.any_college, 278 | wantsspy: this.wantsspy, 279 | ask: this.ask, 280 | spid: this.spid, 281 | camera: this.camera, 282 | caps: 'recaptcha2,t3', 283 | cc: this.accessCode, 284 | }), function (res) { 285 | // Ensure the request worked 286 | if (res.statusCode !== 200) { 287 | if (typeof callback === "function") { 288 | callback(res.statusCode); 289 | return; 290 | } 291 | } 292 | 293 | // Process the event 294 | getAllData(res, function (data) { 295 | // Make sure we got some data 296 | if (data != null) { 297 | try { 298 | // Parse the info 299 | var info = JSON.parse(data); 300 | 301 | // Check for errors 302 | if (info.clientID == null) { 303 | // Pick a new server 304 | _this.nextServer(); 305 | 306 | callback('Error: No clientID allocated.'); 307 | _this.start(callback, proxyInfo); 308 | return; 309 | } 310 | 311 | // Store the clientID 312 | _this.client_id = info.clientID; 313 | 314 | // Run the callback 315 | if (typeof callback === "function") { 316 | callback(); 317 | } 318 | 319 | // Emit the newid event 320 | _this.emit('newid', _this.client_id); 321 | 322 | // Push Events 323 | _this.eventReceived(false, JSON.stringify(info.events || {})); 324 | } catch (e) { 325 | // Failure :( 326 | callback('Failed to parse JSON: ' + e + '\n\n' + String(data)); 327 | } finally { 328 | if (settings.debug) { 329 | _this.emit('debugEvent', 'eventsLoop() finally'); 330 | } 331 | 332 | // Run the event loop 333 | _this.eventsLoop(); 334 | } 335 | } else { 336 | // Run the fail callback 337 | callback(-1); 338 | } 339 | }); 340 | }, proxyInfo); 341 | }).catch((e) => { 342 | console.log('Had an error while getting an access code.'); 343 | console.log(e); 344 | }); 345 | }; 346 | 347 | Omegle.prototype.recaptcha = function (answer) { 348 | var _this = this; 349 | 350 | this.requestPost('/recaptcha', { 351 | response: answer 352 | }, function (res) { 353 | getAllData(res, function (data) { 354 | console.log('Recaptcha result: ' + data); 355 | }); 356 | }); 357 | }; 358 | 359 | Omegle.prototype.send = function (msg, callback) { 360 | this.requestPost('/send', { 361 | msg: msg, 362 | id: this.client_id 363 | }, function (res) { 364 | callbackErr(callback, res); 365 | }); 366 | }; 367 | 368 | Omegle.prototype.getStatus = function (callback, proxyInfo) { 369 | this.requestGet('/status?nocache=' + Math.random(), function (res) { 370 | getAllData(res, function (data) { 371 | callback(JSON.parse(data)); 372 | }); 373 | }); 374 | }; 375 | 376 | Omegle.prototype.postEvent = function (event, callback) { 377 | this.requestPost("/" + event, { 378 | id: this.client_id 379 | }, function (res) { 380 | callbackErr(callback, res); 381 | }); 382 | }; 383 | 384 | Omegle.prototype.startTyping = function (callback) { 385 | this.postEvent('typing', callback); 386 | }; 387 | 388 | Omegle.prototype.stopTyping = function (callback) { 389 | this.postEvent('stoppedtyping', callback); 390 | }; 391 | 392 | Omegle.prototype.disconnect = function (callback) { 393 | this.postEvent('disconnect', callback); 394 | this.client_id = null; 395 | }; 396 | 397 | Omegle.prototype.eventsLoop = function () { 398 | var _this = this; 399 | 400 | if (settings.debug) { 401 | this.emit('debugEvent', 'onEventsLoopStart()'); 402 | } 403 | 404 | this.requestKA('/events', { 405 | id: this.client_id 406 | }, function (res) { 407 | if (settings.debug) { 408 | _this.emit('debugEvent', 'onGetStatusCode() ' + res.statusCode); 409 | } 410 | 411 | if (res.statusCode === 200) { 412 | getAllData(res, function (eventData) { 413 | _this.eventReceived(true, eventData); 414 | }); 415 | } else { 416 | // Some kind of error, log i t 417 | console.log('Got an unknown status code in events loop: ' + res.statusCode); 418 | 419 | if (settings.debug) { 420 | _this.emit('debugEvent', 'eventsLoop() bad status code'); 421 | } 422 | 423 | // Restart events loop 424 | _this.eventsLoop(); 425 | } 426 | }); 427 | }; 428 | 429 | Omegle.prototype.eventReceived = function (shouldLoop, data) { 430 | if (settings.debug) { 431 | this.emit('debugEvent', 'onGetEventData() _start_'); 432 | } 433 | 434 | try { 435 | // Did we get any data? 436 | if (data != null) { 437 | var event, _i, _len; 438 | 439 | data = JSON.parse(data); 440 | if (data != null) { 441 | for (_i = 0, _len = data.length; _i < _len; _i++) { 442 | event = data[_i]; 443 | 444 | if (settings.debug) { 445 | this.emit('debugEvent', 'onGetEventData() ' + JSON.stringify(event)); 446 | } 447 | 448 | this.emit.apply(this, event); 449 | } 450 | } 451 | } 452 | } catch (e) { 453 | // Do nothing 454 | console.log('event apply error'); 455 | console.log(e); 456 | } 457 | 458 | // Do we still have a client id? 459 | if (shouldLoop && this.client_id) { 460 | if (settings.debug) { 461 | this.emit('debugEvent', 'eventsLoop() events received'); 462 | } 463 | 464 | // Start the events loop 465 | this.eventsLoop(); 466 | } 467 | }; 468 | 469 | Omegle.prototype.getAccessCode = async function () { 470 | // dont get more than one access code 471 | if(!!this.accessCode) return; 472 | 473 | // pick a server 474 | const selectedAntiNudeServer = antiNudeServerList[Math.floor(Math.random() * antiNudeServerList.length)]; 475 | 476 | // Grab a code 477 | const res = await axios.post('https://' + selectedAntiNudeServer + '/check'); 478 | 479 | // Store our code 480 | this.accessCode = res.data; 481 | } 482 | 483 | function getAllData(res, callback) { 484 | var buffer; 485 | 486 | var finished = false; 487 | 488 | buffer = []; 489 | res.on('data', function (chunk) { 490 | return buffer.push(chunk); 491 | }); 492 | 493 | // If we have an error 494 | res.on('error', function () { 495 | if (finished) return; 496 | finished = true; 497 | 498 | callback(buffer.join('')); 499 | }); 500 | 501 | res.on('end', function () { 502 | if (finished) return; 503 | finished = true; 504 | 505 | callback(buffer.join('')); 506 | }); 507 | }; 508 | 509 | // Export it 510 | Omegle.prototype.getAllData = getAllData; 511 | 512 | function callbackErr(callback, res) { 513 | return typeof callback === "function" ? callback((res.statusCode !== 200 ? res.statusCode : void 0)) : void 0; 514 | }; 515 | 516 | function formFormat(data) { 517 | var k, v; 518 | 519 | return ((function () { 520 | var _results; 521 | 522 | _results = []; 523 | for (k in data) { 524 | v = data[k]; 525 | _results.push("" + k + "=" + encodeURIComponent(v)); 526 | } 527 | 528 | return _results; 529 | })()).join('&'); 530 | }; 531 | 532 | function mobileValue(mobileParam) { 533 | if (mobileParam == null) { 534 | mobileParam = this.mobile; 535 | } 536 | 537 | if (mobileParam === true || mobileParam === 1) { 538 | return 1; 539 | } else { 540 | return 0; 541 | } 542 | }; 543 | 544 | // Update servers 545 | (function () { 546 | var om = new Omegle(); 547 | 548 | om.getStatus(function (status) { 549 | // Store the server list 550 | serverList = ['omegle.com']; 551 | 552 | // Add the entries we just got 553 | for (var i = 0; i < status.servers.length; ++i) { 554 | serverList.push(status.servers[i] + '.omegle.com'); 555 | } 556 | 557 | // Ensure at least one server was found 558 | if (serverList.length == 0) { 559 | console.log('Error: No omegle servers were found!'); 560 | } 561 | 562 | // Get the anti nude servers 563 | antiNudeServerList = status.antinudeservers; 564 | 565 | // Run the callbacks 566 | for (var i = 0; i < onReadyCallbacks.length; ++i) { 567 | onReadyCallbacks[i](serverList); 568 | } 569 | 570 | // Cleanup 571 | delete om; 572 | }); 573 | })(); 574 | 575 | // Define exports 576 | exports.Omegle = Omegle; 577 | -------------------------------------------------------------------------------- /app.js: -------------------------------------------------------------------------------- 1 | var Omegle = require('./omegle.js').Omegle; 2 | var onOmegleReady = require('./omegle.js').onReady; 3 | var express = require('express'); 4 | var app = express(); 5 | 6 | app.use(express.static(__dirname + '/static')); 7 | 8 | var request = require('request'); 9 | var http = require('http'); 10 | var https = require('https'); 11 | var httpServer = http.Server(app); 12 | var io = require('socket.io')(httpServer); 13 | 14 | var settings = require('./settings.json'); 15 | 16 | //var Cleverbot = require('./cleverbot.js'); 17 | //var Sham = require('./shamchat.js').Sham; 18 | 19 | app.get('/', function(req, res) { 20 | res.sendFile(__dirname+'/static/index.htm'); 21 | }); 22 | 23 | // Handle connections 24 | io.on('connection', function(socket) { 25 | // List of omegle clients for this person 26 | var omegleClients = {}; 27 | 28 | // List of clever bot clients 29 | //var cleverClients = {}; 30 | 31 | // Stores challenge omegle clients 32 | var challenges = {}; 33 | 34 | // Stores proxy info 35 | var proxyInfo = null; 36 | var proxyEnabled = false; 37 | 38 | var requiredConnections = []; 39 | var buildingConnection = false; 40 | var currentPain = null; 41 | function buildConnections() { 42 | // Any connections required? 43 | if(!buildingConnection && requiredConnections.length > 0) { 44 | // Stop multiple from happening 45 | buildingConnection = true; 46 | var args = requiredConnections.shift(); 47 | 48 | // Store the current pain 49 | currentPain = args.painID; 50 | 51 | // Make a connection 52 | makeConnection(args, false); 53 | } 54 | } 55 | 56 | // Makes the actual connection 57 | function makeConnection(args, reconnect) { 58 | // Create the new omegle instance 59 | var om = new Omegle(args); 60 | 61 | // Store the args 62 | om.args = args; 63 | 64 | // A store for the clientID 65 | var realClientID; 66 | 67 | // Handle errors 68 | om.errorHandler(function(msg) { 69 | socket.emit('omegleError', args, msg); 70 | }); 71 | 72 | om.on('newid', function(client_id) { 73 | // Store the client 74 | omegleClients[client_id] = om; 75 | 76 | // Send this ID to the user 77 | socket.emit('newOmegle', client_id, args); 78 | 79 | // Store client ID 80 | realClientID = client_id; 81 | }); 82 | 83 | // Omegle has banned us 84 | om.on('antinudeBanned', function() { 85 | if(!reconnect) { 86 | // No longer building a connection 87 | buildingConnection = false; 88 | 89 | // Move on 90 | buildConnections(); 91 | } 92 | 93 | // Send this ID to the user 94 | socket.emit('omegleBanned', args); 95 | }); 96 | 97 | // There was an error 98 | om.on('error', function(err) { 99 | // Send this ID to the user 100 | socket.emit('omegleError', args, err); 101 | }); 102 | 103 | // Omegle is finding a partner 104 | om.on('waiting', function() { 105 | // Tell the client 106 | socket.emit('omegleWaiting', realClientID); 107 | }); 108 | 109 | // Omegle found us a partner 110 | om.on('connected', function(peerID) { 111 | // Tell the client 112 | socket.emit('omegleConnected', realClientID, peerID); 113 | 114 | // Make sure we're not reconnecting 115 | if(!reconnect) { 116 | // Give a brief delay before making a new connection 117 | setTimeout(function() { 118 | // No current pain 119 | currentPain = null; 120 | 121 | // No longer building the connection 122 | buildingConnection = false; 123 | 124 | // Try to build any remaining connections 125 | buildConnections(); 126 | }, 100); 127 | } 128 | 129 | }); 130 | 131 | // Omegle is telling us our common likes 132 | om.on('commonLikes', function(commonLikes) { 133 | // Tell the client 134 | socket.emit('omegleCommonLikes', realClientID, commonLikes); 135 | }); 136 | 137 | // Omegle is sending us status info 138 | om.on('statusInfo', function(statusInfo) { 139 | // Tell the client 140 | socket.emit('omegleStatusInfo', statusInfo); 141 | }); 142 | 143 | // Omegle is telling us our partner's college 144 | om.on('partnerCollege', function(college) { 145 | // Tell the client 146 | socket.emit('omeglePartnerCollege', realClientID, college); 147 | }); 148 | 149 | // Omegle sent us a question 150 | om.on('question', function(question) { 151 | // Tell the client 152 | socket.emit('omegleQuestion', realClientID, question); 153 | }); 154 | 155 | // Handle the capcha 156 | function handleCaptcha(code) { 157 | // Are we trying to avoid this BS? 158 | if(proxyEnabled && proxyInfo) { 159 | // Tell them 160 | socket.emit('proxyMessage', 'Server sent a capcha, seaching for a new proxy...', args); 161 | 162 | // Try to find a new proxy to use 163 | tryFindNewProxy(function() { 164 | // Con failed due to proxy issues 165 | socket.emit('conFailedProxy', args); 166 | }); 167 | return; 168 | } 169 | 170 | // Use the new captcha method 171 | socket.emit('omegleNewChallenge', args, code); 172 | 173 | challenges[code] = om; 174 | 175 | // Don't run the old method 176 | return; 177 | 178 | // URL with challenge data 179 | var toFetch = 'https://www.google.com/recaptcha/api/challenge?k='+code+'&cahcestop='+Math.random(); 180 | 181 | https.get(toFetch, function(res) { 182 | // Ensure the request worked 183 | if (res.statusCode !== 200) { 184 | socket.emit('omegleError', args, 'Captcha failed.'); 185 | return; 186 | } 187 | 188 | // Process the event 189 | om.getAllData(res, function(data) { 190 | // Make sure we got some data 191 | if(data != null) { 192 | // Copy important data 193 | var a = data.indexOf('\'')+1; 194 | var b = data.indexOf('\'', a)-1; 195 | 196 | // Grab the challenge 197 | var challenge = data.substring(a, b+1); 198 | 199 | // Store it 200 | challenges[challenge] = om; 201 | 202 | // Send to client to solve 203 | socket.emit('omegleChallenge', args, code, challenge); 204 | } else { 205 | // Failure 206 | socket.emit('omegleError', args, 'Capcha, no data passed!'); 207 | } 208 | }); 209 | }).on('error', function(e) { 210 | // Send to client 211 | socket.emit('omegleError', args, 'Got capcha error: ' + e.message); 212 | }); 213 | } 214 | 215 | // Recaptcha 216 | om.on('recaptchaRejected', handleCaptcha); 217 | om.on('recaptchaRequired', handleCaptcha); 218 | 219 | // Stranger has disconnected 220 | om.on('strangerDisconnected', function() { 221 | // Tell client 222 | socket.emit('omegleStrangerDisconnected', realClientID); 223 | }); 224 | 225 | // A spy disconnected 226 | om.on('spyDisconnected', function(spy) { 227 | // Tell client 228 | socket.emit('omegleSpyDisconnected', realClientID, spy); 229 | }); 230 | 231 | // Stranger sent us a message 232 | om.on('gotMessage', function(msg) { 233 | // Tell client 234 | socket.emit('omegleGotMessage', realClientID, msg); 235 | }); 236 | 237 | // Got a spy message 238 | om.on('spyMessage', function(spy, msg) { 239 | // Tell client 240 | socket.emit('omegleSpyMessage', realClientID, spy, msg); 241 | }); 242 | 243 | // We have disconnected 244 | om.on('disconnected', function() { 245 | // Tell client 246 | socket.emit('omegleDisconnected', realClientID); 247 | }); 248 | 249 | // Stranger started typing 250 | om.on('typing', function() { 251 | // Tell client 252 | socket.emit('omegleTyping', realClientID); 253 | }); 254 | 255 | // Stranger stopped typing 256 | om.on('stoppedTyping', function() { 257 | // Tell client 258 | socket.emit('omegleStoppedTyping', realClientID); 259 | }); 260 | 261 | // Debug events 262 | if(settings.debug) { 263 | om.on('debugEvent', function(reason) { 264 | // Tell client 265 | socket.emit('debugEvent', realClientID, reason); 266 | }); 267 | } 268 | 269 | // Are we doing a reconnect? 270 | if(reconnect) { 271 | // Reconnect to a client 272 | om.reconnect(function(err) { 273 | if (err) { 274 | // Send to client 275 | socket.emit('omegleError', args, 'Error reconnecting: ' + err); 276 | } 277 | }); 278 | } else { 279 | // Connect to a client 280 | om.start(function(err) { 281 | if (err) { 282 | if(proxyEnabled && proxyInfo) { 283 | // Tell them 284 | socket.emit('proxyMessage', 'Broken proxy, seaching for a new proxy...', args); 285 | 286 | // Try to find a new proxy to use 287 | tryFindNewProxy(function() { 288 | // Con failed due to proxy issues 289 | socket.emit('conFailedProxy', args); 290 | }); 291 | } else { 292 | // Send to client 293 | socket.emit('omegleError', args, 'Error starting: ' + err); 294 | } 295 | } 296 | }, proxyEnabled && proxyInfo); 297 | } 298 | } 299 | 300 | // Creates a new connection 301 | function setupNewConnection(args) { 302 | // Ensure we have args 303 | if(args == null) args = {}; 304 | 305 | // Another connection is required 306 | requiredConnections.push(args); 307 | 308 | // Set the connection up 309 | buildConnections(); 310 | } 311 | 312 | // Client wants to fix broken search 313 | socket.on('omegleUnlock', function() { 314 | // No longer building the connection 315 | buildingConnection = false; 316 | 317 | // Try to build any remaining connections 318 | buildConnections(); 319 | }); 320 | 321 | // Cleanup a client when they disconnect 322 | socket.on('disconnect', function(){ 323 | for(var key in omegleClients) { 324 | // Remove reference to it 325 | delete omegleClients[key]; 326 | } 327 | 328 | /*for(var key in cleverClients) { 329 | if(cleverClients[key] != null) { 330 | delete cleverClients[key]; 331 | } 332 | }*/ 333 | }); 334 | 335 | // Client wants us to disconnect a stranger 336 | socket.on('omegleDisconnect', function(client_id, painID) { 337 | // Check if the client even exists 338 | if(omegleClients[client_id] != null) { 339 | // Disconnect it 340 | omegleClients[client_id].disconnect(); 341 | 342 | // Delete it 343 | omegleClients[client_id] = null; 344 | } 345 | 346 | // Remove any queued requests for this painID 347 | for(var i=0;i= 500) { 575 | tryFindNewProxy(callback); 576 | } else { 577 | // Seems to be working 578 | proxyInfo = { 579 | ip: ip, 580 | port: port 581 | }; 582 | 583 | // Tell them their proxy is ready 584 | socket.emit('proxyMessage', 'Routing intial connection through ' + ip + ':' + port + ' to avoid captcha!'); 585 | 586 | if(callback) { 587 | callback(ip, port); 588 | } 589 | } 590 | }); 591 | } else { 592 | // Try again 593 | tryFindNewProxy(callback) 594 | } 595 | } catch(e) { 596 | // Try again? 597 | tryFindNewProxy(callback) 598 | } 599 | }); 600 | } 601 | 602 | // Find a new proxy 603 | socket.on('newProxy', function() { 604 | proxyEnabled = true; 605 | 606 | // Tell them searching has begun 607 | socket.emit('proxyMessage', 'Searching for a proxy to route initial connection through...'); 608 | 609 | // Try to find a new proxy 610 | tryFindNewProxy(); 611 | }); 612 | 613 | // Disables proxy 614 | socket.on('disableProxy', function() { 615 | // Disable proxy 616 | proxyEnabled = false; 617 | 618 | // Tell them 619 | socket.emit('proxyMessage', 'Captcha bypass turned off. No proxy will be used.'); 620 | }) 621 | }); 622 | 623 | var omeglePortNumber = 3000; 624 | httpServer.listen(omeglePortNumber, function() { 625 | console.log('Listening on port ' + omeglePortNumber + ', searching for omegle servers...'); 626 | }); 627 | 628 | // Run callback for when omegle is ready 629 | Omegle.onReady(function(serverList) { 630 | // Print out the server list 631 | console.log('Found the following servers: ' + serverList.join(', ') + '\n\n' + Omegle.getSelectedServer() + ' was selected!\n'); 632 | console.log('Visit 127.0.0.1:' + omeglePortNumber + ' in your web browser to view the GUI.'); 633 | }); 634 | 635 | /*var test = new Sham(); 636 | test.start(function(err) { 637 | console.log(err); 638 | }); 639 | 640 | test.on('newid', function(client_id) { 641 | console.log('Got a newID: ' + client_id); 642 | }); 643 | */ 644 | -------------------------------------------------------------------------------- /static/js/bootstrap.min.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Bootstrap v3.3.7 (http://getbootstrap.com) 3 | * Copyright 2011-2016 Twitter, Inc. 4 | * Licensed under the MIT license 5 | */ 6 | if("undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");+function(a){"use strict";var b=a.fn.jquery.split(" ")[0].split(".");if(b[0]<2&&b[1]<9||1==b[0]&&9==b[1]&&b[2]<1||b[0]>3)throw new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher, but lower than version 4")}(jQuery),+function(a){"use strict";function b(){var a=document.createElement("bootstrap"),b={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var c in b)if(void 0!==a.style[c])return{end:b[c]};return!1}a.fn.emulateTransitionEnd=function(b){var c=!1,d=this;a(this).one("bsTransitionEnd",function(){c=!0});var e=function(){c||a(d).trigger(a.support.transition.end)};return setTimeout(e,b),this},a(function(){a.support.transition=b(),a.support.transition&&(a.event.special.bsTransitionEnd={bindType:a.support.transition.end,delegateType:a.support.transition.end,handle:function(b){if(a(b.target).is(this))return b.handleObj.handler.apply(this,arguments)}})})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var c=a(this),e=c.data("bs.alert");e||c.data("bs.alert",e=new d(this)),"string"==typeof b&&e[b].call(c)})}var c='[data-dismiss="alert"]',d=function(b){a(b).on("click",c,this.close)};d.VERSION="3.3.7",d.TRANSITION_DURATION=150,d.prototype.close=function(b){function c(){g.detach().trigger("closed.bs.alert").remove()}var e=a(this),f=e.attr("data-target");f||(f=e.attr("href"),f=f&&f.replace(/.*(?=#[^\s]*$)/,""));var g=a("#"===f?[]:f);b&&b.preventDefault(),g.length||(g=e.closest(".alert")),g.trigger(b=a.Event("close.bs.alert")),b.isDefaultPrevented()||(g.removeClass("in"),a.support.transition&&g.hasClass("fade")?g.one("bsTransitionEnd",c).emulateTransitionEnd(d.TRANSITION_DURATION):c())};var e=a.fn.alert;a.fn.alert=b,a.fn.alert.Constructor=d,a.fn.alert.noConflict=function(){return a.fn.alert=e,this},a(document).on("click.bs.alert.data-api",c,d.prototype.close)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.button"),f="object"==typeof b&&b;e||d.data("bs.button",e=new c(this,f)),"toggle"==b?e.toggle():b&&e.setState(b)})}var c=function(b,d){this.$element=a(b),this.options=a.extend({},c.DEFAULTS,d),this.isLoading=!1};c.VERSION="3.3.7",c.DEFAULTS={loadingText:"loading..."},c.prototype.setState=function(b){var c="disabled",d=this.$element,e=d.is("input")?"val":"html",f=d.data();b+="Text",null==f.resetText&&d.data("resetText",d[e]()),setTimeout(a.proxy(function(){d[e](null==f[b]?this.options[b]:f[b]),"loadingText"==b?(this.isLoading=!0,d.addClass(c).attr(c,c).prop(c,!0)):this.isLoading&&(this.isLoading=!1,d.removeClass(c).removeAttr(c).prop(c,!1))},this),0)},c.prototype.toggle=function(){var a=!0,b=this.$element.closest('[data-toggle="buttons"]');if(b.length){var c=this.$element.find("input");"radio"==c.prop("type")?(c.prop("checked")&&(a=!1),b.find(".active").removeClass("active"),this.$element.addClass("active")):"checkbox"==c.prop("type")&&(c.prop("checked")!==this.$element.hasClass("active")&&(a=!1),this.$element.toggleClass("active")),c.prop("checked",this.$element.hasClass("active")),a&&c.trigger("change")}else this.$element.attr("aria-pressed",!this.$element.hasClass("active")),this.$element.toggleClass("active")};var d=a.fn.button;a.fn.button=b,a.fn.button.Constructor=c,a.fn.button.noConflict=function(){return a.fn.button=d,this},a(document).on("click.bs.button.data-api",'[data-toggle^="button"]',function(c){var d=a(c.target).closest(".btn");b.call(d,"toggle"),a(c.target).is('input[type="radio"], input[type="checkbox"]')||(c.preventDefault(),d.is("input,button")?d.trigger("focus"):d.find("input:visible,button:visible").first().trigger("focus"))}).on("focus.bs.button.data-api blur.bs.button.data-api",'[data-toggle^="button"]',function(b){a(b.target).closest(".btn").toggleClass("focus",/^focus(in)?$/.test(b.type))})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.carousel"),f=a.extend({},c.DEFAULTS,d.data(),"object"==typeof b&&b),g="string"==typeof b?b:f.slide;e||d.data("bs.carousel",e=new c(this,f)),"number"==typeof b?e.to(b):g?e[g]():f.interval&&e.pause().cycle()})}var c=function(b,c){this.$element=a(b),this.$indicators=this.$element.find(".carousel-indicators"),this.options=c,this.paused=null,this.sliding=null,this.interval=null,this.$active=null,this.$items=null,this.options.keyboard&&this.$element.on("keydown.bs.carousel",a.proxy(this.keydown,this)),"hover"==this.options.pause&&!("ontouchstart"in document.documentElement)&&this.$element.on("mouseenter.bs.carousel",a.proxy(this.pause,this)).on("mouseleave.bs.carousel",a.proxy(this.cycle,this))};c.VERSION="3.3.7",c.TRANSITION_DURATION=600,c.DEFAULTS={interval:5e3,pause:"hover",wrap:!0,keyboard:!0},c.prototype.keydown=function(a){if(!/input|textarea/i.test(a.target.tagName)){switch(a.which){case 37:this.prev();break;case 39:this.next();break;default:return}a.preventDefault()}},c.prototype.cycle=function(b){return b||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(a.proxy(this.next,this),this.options.interval)),this},c.prototype.getItemIndex=function(a){return this.$items=a.parent().children(".item"),this.$items.index(a||this.$active)},c.prototype.getItemForDirection=function(a,b){var c=this.getItemIndex(b),d="prev"==a&&0===c||"next"==a&&c==this.$items.length-1;if(d&&!this.options.wrap)return b;var e="prev"==a?-1:1,f=(c+e)%this.$items.length;return this.$items.eq(f)},c.prototype.to=function(a){var b=this,c=this.getItemIndex(this.$active=this.$element.find(".item.active"));if(!(a>this.$items.length-1||a<0))return this.sliding?this.$element.one("slid.bs.carousel",function(){b.to(a)}):c==a?this.pause().cycle():this.slide(a>c?"next":"prev",this.$items.eq(a))},c.prototype.pause=function(b){return b||(this.paused=!0),this.$element.find(".next, .prev").length&&a.support.transition&&(this.$element.trigger(a.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},c.prototype.next=function(){if(!this.sliding)return this.slide("next")},c.prototype.prev=function(){if(!this.sliding)return this.slide("prev")},c.prototype.slide=function(b,d){var e=this.$element.find(".item.active"),f=d||this.getItemForDirection(b,e),g=this.interval,h="next"==b?"left":"right",i=this;if(f.hasClass("active"))return this.sliding=!1;var j=f[0],k=a.Event("slide.bs.carousel",{relatedTarget:j,direction:h});if(this.$element.trigger(k),!k.isDefaultPrevented()){if(this.sliding=!0,g&&this.pause(),this.$indicators.length){this.$indicators.find(".active").removeClass("active");var l=a(this.$indicators.children()[this.getItemIndex(f)]);l&&l.addClass("active")}var m=a.Event("slid.bs.carousel",{relatedTarget:j,direction:h});return a.support.transition&&this.$element.hasClass("slide")?(f.addClass(b),f[0].offsetWidth,e.addClass(h),f.addClass(h),e.one("bsTransitionEnd",function(){f.removeClass([b,h].join(" ")).addClass("active"),e.removeClass(["active",h].join(" ")),i.sliding=!1,setTimeout(function(){i.$element.trigger(m)},0)}).emulateTransitionEnd(c.TRANSITION_DURATION)):(e.removeClass("active"),f.addClass("active"),this.sliding=!1,this.$element.trigger(m)),g&&this.cycle(),this}};var d=a.fn.carousel;a.fn.carousel=b,a.fn.carousel.Constructor=c,a.fn.carousel.noConflict=function(){return a.fn.carousel=d,this};var e=function(c){var d,e=a(this),f=a(e.attr("data-target")||(d=e.attr("href"))&&d.replace(/.*(?=#[^\s]+$)/,""));if(f.hasClass("carousel")){var g=a.extend({},f.data(),e.data()),h=e.attr("data-slide-to");h&&(g.interval=!1),b.call(f,g),h&&f.data("bs.carousel").to(h),c.preventDefault()}};a(document).on("click.bs.carousel.data-api","[data-slide]",e).on("click.bs.carousel.data-api","[data-slide-to]",e),a(window).on("load",function(){a('[data-ride="carousel"]').each(function(){var c=a(this);b.call(c,c.data())})})}(jQuery),+function(a){"use strict";function b(b){var c,d=b.attr("data-target")||(c=b.attr("href"))&&c.replace(/.*(?=#[^\s]+$)/,"");return a(d)}function c(b){return this.each(function(){var c=a(this),e=c.data("bs.collapse"),f=a.extend({},d.DEFAULTS,c.data(),"object"==typeof b&&b);!e&&f.toggle&&/show|hide/.test(b)&&(f.toggle=!1),e||c.data("bs.collapse",e=new d(this,f)),"string"==typeof b&&e[b]()})}var d=function(b,c){this.$element=a(b),this.options=a.extend({},d.DEFAULTS,c),this.$trigger=a('[data-toggle="collapse"][href="#'+b.id+'"],[data-toggle="collapse"][data-target="#'+b.id+'"]'),this.transitioning=null,this.options.parent?this.$parent=this.getParent():this.addAriaAndCollapsedClass(this.$element,this.$trigger),this.options.toggle&&this.toggle()};d.VERSION="3.3.7",d.TRANSITION_DURATION=350,d.DEFAULTS={toggle:!0},d.prototype.dimension=function(){var a=this.$element.hasClass("width");return a?"width":"height"},d.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var b,e=this.$parent&&this.$parent.children(".panel").children(".in, .collapsing");if(!(e&&e.length&&(b=e.data("bs.collapse"),b&&b.transitioning))){var f=a.Event("show.bs.collapse");if(this.$element.trigger(f),!f.isDefaultPrevented()){e&&e.length&&(c.call(e,"hide"),b||e.data("bs.collapse",null));var g=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[g](0).attr("aria-expanded",!0),this.$trigger.removeClass("collapsed").attr("aria-expanded",!0),this.transitioning=1;var h=function(){this.$element.removeClass("collapsing").addClass("collapse in")[g](""),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!a.support.transition)return h.call(this);var i=a.camelCase(["scroll",g].join("-"));this.$element.one("bsTransitionEnd",a.proxy(h,this)).emulateTransitionEnd(d.TRANSITION_DURATION)[g](this.$element[0][i])}}}},d.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var b=a.Event("hide.bs.collapse");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.dimension();this.$element[c](this.$element[c]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse in").attr("aria-expanded",!1),this.$trigger.addClass("collapsed").attr("aria-expanded",!1),this.transitioning=1;var e=function(){this.transitioning=0,this.$element.removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse")};return a.support.transition?void this.$element[c](0).one("bsTransitionEnd",a.proxy(e,this)).emulateTransitionEnd(d.TRANSITION_DURATION):e.call(this)}}},d.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()},d.prototype.getParent=function(){return a(this.options.parent).find('[data-toggle="collapse"][data-parent="'+this.options.parent+'"]').each(a.proxy(function(c,d){var e=a(d);this.addAriaAndCollapsedClass(b(e),e)},this)).end()},d.prototype.addAriaAndCollapsedClass=function(a,b){var c=a.hasClass("in");a.attr("aria-expanded",c),b.toggleClass("collapsed",!c).attr("aria-expanded",c)};var e=a.fn.collapse;a.fn.collapse=c,a.fn.collapse.Constructor=d,a.fn.collapse.noConflict=function(){return a.fn.collapse=e,this},a(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',function(d){var e=a(this);e.attr("data-target")||d.preventDefault();var f=b(e),g=f.data("bs.collapse"),h=g?"toggle":e.data();c.call(f,h)})}(jQuery),+function(a){"use strict";function b(b){var c=b.attr("data-target");c||(c=b.attr("href"),c=c&&/#[A-Za-z]/.test(c)&&c.replace(/.*(?=#[^\s]*$)/,""));var d=c&&a(c);return d&&d.length?d:b.parent()}function c(c){c&&3===c.which||(a(e).remove(),a(f).each(function(){var d=a(this),e=b(d),f={relatedTarget:this};e.hasClass("open")&&(c&&"click"==c.type&&/input|textarea/i.test(c.target.tagName)&&a.contains(e[0],c.target)||(e.trigger(c=a.Event("hide.bs.dropdown",f)),c.isDefaultPrevented()||(d.attr("aria-expanded","false"),e.removeClass("open").trigger(a.Event("hidden.bs.dropdown",f)))))}))}function d(b){return this.each(function(){var c=a(this),d=c.data("bs.dropdown");d||c.data("bs.dropdown",d=new g(this)),"string"==typeof b&&d[b].call(c)})}var e=".dropdown-backdrop",f='[data-toggle="dropdown"]',g=function(b){a(b).on("click.bs.dropdown",this.toggle)};g.VERSION="3.3.7",g.prototype.toggle=function(d){var e=a(this);if(!e.is(".disabled, :disabled")){var f=b(e),g=f.hasClass("open");if(c(),!g){"ontouchstart"in document.documentElement&&!f.closest(".navbar-nav").length&&a(document.createElement("div")).addClass("dropdown-backdrop").insertAfter(a(this)).on("click",c);var h={relatedTarget:this};if(f.trigger(d=a.Event("show.bs.dropdown",h)),d.isDefaultPrevented())return;e.trigger("focus").attr("aria-expanded","true"),f.toggleClass("open").trigger(a.Event("shown.bs.dropdown",h))}return!1}},g.prototype.keydown=function(c){if(/(38|40|27|32)/.test(c.which)&&!/input|textarea/i.test(c.target.tagName)){var d=a(this);if(c.preventDefault(),c.stopPropagation(),!d.is(".disabled, :disabled")){var e=b(d),g=e.hasClass("open");if(!g&&27!=c.which||g&&27==c.which)return 27==c.which&&e.find(f).trigger("focus"),d.trigger("click");var h=" li:not(.disabled):visible a",i=e.find(".dropdown-menu"+h);if(i.length){var j=i.index(c.target);38==c.which&&j>0&&j--,40==c.which&&jdocument.documentElement.clientHeight;this.$element.css({paddingLeft:!this.bodyIsOverflowing&&a?this.scrollbarWidth:"",paddingRight:this.bodyIsOverflowing&&!a?this.scrollbarWidth:""})},c.prototype.resetAdjustments=function(){this.$element.css({paddingLeft:"",paddingRight:""})},c.prototype.checkScrollbar=function(){var a=window.innerWidth;if(!a){var b=document.documentElement.getBoundingClientRect();a=b.right-Math.abs(b.left)}this.bodyIsOverflowing=document.body.clientWidth
',trigger:"hover focus",title:"",delay:0,html:!1,container:!1,viewport:{selector:"body",padding:0}},c.prototype.init=function(b,c,d){if(this.enabled=!0,this.type=b,this.$element=a(c),this.options=this.getOptions(d),this.$viewport=this.options.viewport&&a(a.isFunction(this.options.viewport)?this.options.viewport.call(this,this.$element):this.options.viewport.selector||this.options.viewport),this.inState={click:!1,hover:!1,focus:!1},this.$element[0]instanceof document.constructor&&!this.options.selector)throw new Error("`selector` option must be specified when initializing "+this.type+" on the window.document object!");for(var e=this.options.trigger.split(" "),f=e.length;f--;){var g=e[f];if("click"==g)this.$element.on("click."+this.type,this.options.selector,a.proxy(this.toggle,this));else if("manual"!=g){var h="hover"==g?"mouseenter":"focusin",i="hover"==g?"mouseleave":"focusout";this.$element.on(h+"."+this.type,this.options.selector,a.proxy(this.enter,this)),this.$element.on(i+"."+this.type,this.options.selector,a.proxy(this.leave,this))}}this.options.selector?this._options=a.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.getOptions=function(b){return b=a.extend({},this.getDefaults(),this.$element.data(),b),b.delay&&"number"==typeof b.delay&&(b.delay={show:b.delay,hide:b.delay}),b},c.prototype.getDelegateOptions=function(){var b={},c=this.getDefaults();return this._options&&a.each(this._options,function(a,d){c[a]!=d&&(b[a]=d)}),b},c.prototype.enter=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);return c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),b instanceof a.Event&&(c.inState["focusin"==b.type?"focus":"hover"]=!0),c.tip().hasClass("in")||"in"==c.hoverState?void(c.hoverState="in"):(clearTimeout(c.timeout),c.hoverState="in",c.options.delay&&c.options.delay.show?void(c.timeout=setTimeout(function(){"in"==c.hoverState&&c.show()},c.options.delay.show)):c.show())},c.prototype.isInStateTrue=function(){for(var a in this.inState)if(this.inState[a])return!0;return!1},c.prototype.leave=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);if(c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),b instanceof a.Event&&(c.inState["focusout"==b.type?"focus":"hover"]=!1),!c.isInStateTrue())return clearTimeout(c.timeout),c.hoverState="out",c.options.delay&&c.options.delay.hide?void(c.timeout=setTimeout(function(){"out"==c.hoverState&&c.hide()},c.options.delay.hide)):c.hide()},c.prototype.show=function(){var b=a.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(b);var d=a.contains(this.$element[0].ownerDocument.documentElement,this.$element[0]);if(b.isDefaultPrevented()||!d)return;var e=this,f=this.tip(),g=this.getUID(this.type);this.setContent(),f.attr("id",g),this.$element.attr("aria-describedby",g),this.options.animation&&f.addClass("fade");var h="function"==typeof this.options.placement?this.options.placement.call(this,f[0],this.$element[0]):this.options.placement,i=/\s?auto?\s?/i,j=i.test(h);j&&(h=h.replace(i,"")||"top"),f.detach().css({top:0,left:0,display:"block"}).addClass(h).data("bs."+this.type,this),this.options.container?f.appendTo(this.options.container):f.insertAfter(this.$element),this.$element.trigger("inserted.bs."+this.type);var k=this.getPosition(),l=f[0].offsetWidth,m=f[0].offsetHeight;if(j){var n=h,o=this.getPosition(this.$viewport);h="bottom"==h&&k.bottom+m>o.bottom?"top":"top"==h&&k.top-mo.width?"left":"left"==h&&k.left-lg.top+g.height&&(e.top=g.top+g.height-i)}else{var j=b.left-f,k=b.left+f+c;jg.right&&(e.left=g.left+g.width-k)}return e},c.prototype.getTitle=function(){var a,b=this.$element,c=this.options;return a=b.attr("data-original-title")||("function"==typeof c.title?c.title.call(b[0]):c.title)},c.prototype.getUID=function(a){do a+=~~(1e6*Math.random());while(document.getElementById(a));return a},c.prototype.tip=function(){if(!this.$tip&&(this.$tip=a(this.options.template),1!=this.$tip.length))throw new Error(this.type+" `template` option must consist of exactly 1 top-level element!");return this.$tip},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},c.prototype.enable=function(){this.enabled=!0},c.prototype.disable=function(){this.enabled=!1},c.prototype.toggleEnabled=function(){this.enabled=!this.enabled},c.prototype.toggle=function(b){var c=this;b&&(c=a(b.currentTarget).data("bs."+this.type),c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c))),b?(c.inState.click=!c.inState.click,c.isInStateTrue()?c.enter(c):c.leave(c)):c.tip().hasClass("in")?c.leave(c):c.enter(c)},c.prototype.destroy=function(){var a=this;clearTimeout(this.timeout),this.hide(function(){a.$element.off("."+a.type).removeData("bs."+a.type),a.$tip&&a.$tip.detach(),a.$tip=null,a.$arrow=null,a.$viewport=null,a.$element=null})};var d=a.fn.tooltip;a.fn.tooltip=b,a.fn.tooltip.Constructor=c,a.fn.tooltip.noConflict=function(){return a.fn.tooltip=d,this}}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.popover"),f="object"==typeof b&&b;!e&&/destroy|hide/.test(b)||(e||d.data("bs.popover",e=new c(this,f)),"string"==typeof b&&e[b]())})}var c=function(a,b){this.init("popover",a,b)};if(!a.fn.tooltip)throw new Error("Popover requires tooltip.js");c.VERSION="3.3.7",c.DEFAULTS=a.extend({},a.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:''}),c.prototype=a.extend({},a.fn.tooltip.Constructor.prototype),c.prototype.constructor=c,c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.setContent=function(){var a=this.tip(),b=this.getTitle(),c=this.getContent();a.find(".popover-title")[this.options.html?"html":"text"](b),a.find(".popover-content").children().detach().end()[this.options.html?"string"==typeof c?"html":"append":"text"](c),a.removeClass("fade top bottom left right in"),a.find(".popover-title").html()||a.find(".popover-title").hide()},c.prototype.hasContent=function(){return this.getTitle()||this.getContent()},c.prototype.getContent=function(){var a=this.$element,b=this.options;return a.attr("data-content")||("function"==typeof b.content?b.content.call(a[0]):b.content)},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")};var d=a.fn.popover;a.fn.popover=b,a.fn.popover.Constructor=c,a.fn.popover.noConflict=function(){return a.fn.popover=d,this}}(jQuery),+function(a){"use strict";function b(c,d){this.$body=a(document.body),this.$scrollElement=a(a(c).is(document.body)?window:c),this.options=a.extend({},b.DEFAULTS,d),this.selector=(this.options.target||"")+" .nav li > a",this.offsets=[],this.targets=[],this.activeTarget=null,this.scrollHeight=0,this.$scrollElement.on("scroll.bs.scrollspy",a.proxy(this.process,this)),this.refresh(),this.process()}function c(c){return this.each(function(){var d=a(this),e=d.data("bs.scrollspy"),f="object"==typeof c&&c;e||d.data("bs.scrollspy",e=new b(this,f)),"string"==typeof c&&e[c]()})}b.VERSION="3.3.7",b.DEFAULTS={offset:10},b.prototype.getScrollHeight=function(){return this.$scrollElement[0].scrollHeight||Math.max(this.$body[0].scrollHeight,document.documentElement.scrollHeight)},b.prototype.refresh=function(){var b=this,c="offset",d=0;this.offsets=[],this.targets=[],this.scrollHeight=this.getScrollHeight(),a.isWindow(this.$scrollElement[0])||(c="position",d=this.$scrollElement.scrollTop()),this.$body.find(this.selector).map(function(){var b=a(this),e=b.data("target")||b.attr("href"),f=/^#./.test(e)&&a(e);return f&&f.length&&f.is(":visible")&&[[f[c]().top+d,e]]||null}).sort(function(a,b){return a[0]-b[0]}).each(function(){b.offsets.push(this[0]),b.targets.push(this[1])})},b.prototype.process=function(){var a,b=this.$scrollElement.scrollTop()+this.options.offset,c=this.getScrollHeight(),d=this.options.offset+c-this.$scrollElement.height(),e=this.offsets,f=this.targets,g=this.activeTarget;if(this.scrollHeight!=c&&this.refresh(),b>=d)return g!=(a=f[f.length-1])&&this.activate(a);if(g&&b=e[a]&&(void 0===e[a+1]||b .dropdown-menu > .active").removeClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!1),b.addClass("active").find('[data-toggle="tab"]').attr("aria-expanded",!0),h?(b[0].offsetWidth,b.addClass("in")):b.removeClass("fade"),b.parent(".dropdown-menu").length&&b.closest("li.dropdown").addClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!0),e&&e()}var g=d.find("> .active"),h=e&&a.support.transition&&(g.length&&g.hasClass("fade")||!!d.find("> .fade").length);g.length&&h?g.one("bsTransitionEnd",f).emulateTransitionEnd(c.TRANSITION_DURATION):f(),g.removeClass("in")};var d=a.fn.tab;a.fn.tab=b,a.fn.tab.Constructor=c,a.fn.tab.noConflict=function(){return a.fn.tab=d,this};var e=function(c){c.preventDefault(),b.call(a(this),"show")};a(document).on("click.bs.tab.data-api",'[data-toggle="tab"]',e).on("click.bs.tab.data-api",'[data-toggle="pill"]',e)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.affix"),f="object"==typeof b&&b;e||d.data("bs.affix",e=new c(this,f)),"string"==typeof b&&e[b]()})}var c=function(b,d){this.options=a.extend({},c.DEFAULTS,d),this.$target=a(this.options.target).on("scroll.bs.affix.data-api",a.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",a.proxy(this.checkPositionWithEventLoop,this)),this.$element=a(b),this.affixed=null,this.unpin=null,this.pinnedOffset=null,this.checkPosition()};c.VERSION="3.3.7",c.RESET="affix affix-top affix-bottom",c.DEFAULTS={offset:0,target:window},c.prototype.getState=function(a,b,c,d){var e=this.$target.scrollTop(),f=this.$element.offset(),g=this.$target.height();if(null!=c&&"top"==this.affixed)return e=a-d&&"bottom"},c.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(c.RESET).addClass("affix");var a=this.$target.scrollTop(),b=this.$element.offset();return this.pinnedOffset=b.top-a},c.prototype.checkPositionWithEventLoop=function(){setTimeout(a.proxy(this.checkPosition,this),1)},c.prototype.checkPosition=function(){if(this.$element.is(":visible")){var b=this.$element.height(),d=this.options.offset,e=d.top,f=d.bottom,g=Math.max(a(document).height(),a(document.body).height());"object"!=typeof d&&(f=e=d),"function"==typeof e&&(e=d.top(this.$element)),"function"==typeof f&&(f=d.bottom(this.$element));var h=this.getState(g,b,e,f);if(this.affixed!=h){null!=this.unpin&&this.$element.css("top","");var i="affix"+(h?"-"+h:""),j=a.Event(i+".bs.affix");if(this.$element.trigger(j),j.isDefaultPrevented())return;this.affixed=h,this.unpin="bottom"==h?this.getPinnedOffset():null,this.$element.removeClass(c.RESET).addClass(i).trigger(i.replace("affix","affixed")+".bs.affix")}"bottom"==h&&this.$element.offset({top:g-b-f})}};var d=a.fn.affix;a.fn.affix=b,a.fn.affix.Constructor=c,a.fn.affix.noConflict=function(){return a.fn.affix=d,this},a(window).on("load",function(){a('[data-spy="affix"]').each(function(){var c=a(this),d=c.data();d.offset=d.offset||{},null!=d.offsetBottom&&(d.offset.bottom=d.offsetBottom),null!=d.offsetTop&&(d.offset.top=d.offsetTop),b.call(c,d)})})}(jQuery); -------------------------------------------------------------------------------- /static/js/jquery-2.1.1.min.js: -------------------------------------------------------------------------------- 1 | /*! jQuery v2.1.1 | (c) 2005, 2014 jQuery Foundation, Inc. | jquery.org/license */ 2 | !function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=c.slice,e=c.concat,f=c.push,g=c.indexOf,h={},i=h.toString,j=h.hasOwnProperty,k={},l=a.document,m="2.1.1",n=function(a,b){return new n.fn.init(a,b)},o=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,p=/^-ms-/,q=/-([\da-z])/gi,r=function(a,b){return b.toUpperCase()};n.fn=n.prototype={jquery:m,constructor:n,selector:"",length:0,toArray:function(){return d.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:d.call(this)},pushStack:function(a){var b=n.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a,b){return n.each(this,a,b)},map:function(a){return this.pushStack(n.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(d.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:c.sort,splice:c.splice},n.extend=n.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||n.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(a=arguments[h]))for(b in a)c=g[b],d=a[b],g!==d&&(j&&d&&(n.isPlainObject(d)||(e=n.isArray(d)))?(e?(e=!1,f=c&&n.isArray(c)?c:[]):f=c&&n.isPlainObject(c)?c:{},g[b]=n.extend(j,f,d)):void 0!==d&&(g[b]=d));return g},n.extend({expando:"jQuery"+(m+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===n.type(a)},isArray:Array.isArray,isWindow:function(a){return null!=a&&a===a.window},isNumeric:function(a){return!n.isArray(a)&&a-parseFloat(a)>=0},isPlainObject:function(a){return"object"!==n.type(a)||a.nodeType||n.isWindow(a)?!1:a.constructor&&!j.call(a.constructor.prototype,"isPrototypeOf")?!1:!0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?h[i.call(a)]||"object":typeof a},globalEval:function(a){var b,c=eval;a=n.trim(a),a&&(1===a.indexOf("use strict")?(b=l.createElement("script"),b.text=a,l.head.appendChild(b).parentNode.removeChild(b)):c(a))},camelCase:function(a){return a.replace(p,"ms-").replace(q,r)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b,c){var d,e=0,f=a.length,g=s(a);if(c){if(g){for(;f>e;e++)if(d=b.apply(a[e],c),d===!1)break}else for(e in a)if(d=b.apply(a[e],c),d===!1)break}else if(g){for(;f>e;e++)if(d=b.call(a[e],e,a[e]),d===!1)break}else for(e in a)if(d=b.call(a[e],e,a[e]),d===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(o,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(s(Object(a))?n.merge(c,"string"==typeof a?[a]:a):f.call(c,a)),c},inArray:function(a,b,c){return null==b?-1:g.call(b,a,c)},merge:function(a,b){for(var c=+b.length,d=0,e=a.length;c>d;d++)a[e++]=b[d];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,f=0,g=a.length,h=s(a),i=[];if(h)for(;g>f;f++)d=b(a[f],f,c),null!=d&&i.push(d);else for(f in a)d=b(a[f],f,c),null!=d&&i.push(d);return e.apply([],i)},guid:1,proxy:function(a,b){var c,e,f;return"string"==typeof b&&(c=a[b],b=a,a=c),n.isFunction(a)?(e=d.call(arguments,2),f=function(){return a.apply(b||this,e.concat(d.call(arguments)))},f.guid=a.guid=a.guid||n.guid++,f):void 0},now:Date.now,support:k}),n.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(a,b){h["[object "+b+"]"]=b.toLowerCase()});function s(a){var b=a.length,c=n.type(a);return"function"===c||n.isWindow(a)?!1:1===a.nodeType&&b?!0:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var t=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+-new Date,v=a.document,w=0,x=0,y=gb(),z=gb(),A=gb(),B=function(a,b){return a===b&&(l=!0),0},C="undefined",D=1<<31,E={}.hasOwnProperty,F=[],G=F.pop,H=F.push,I=F.push,J=F.slice,K=F.indexOf||function(a){for(var b=0,c=this.length;c>b;b++)if(this[b]===a)return b;return-1},L="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",M="[\\x20\\t\\r\\n\\f]",N="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",O=N.replace("w","w#"),P="\\["+M+"*("+N+")(?:"+M+"*([*^$|!~]?=)"+M+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+O+"))|)"+M+"*\\]",Q=":("+N+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+P+")*)|.*)\\)|)",R=new RegExp("^"+M+"+|((?:^|[^\\\\])(?:\\\\.)*)"+M+"+$","g"),S=new RegExp("^"+M+"*,"+M+"*"),T=new RegExp("^"+M+"*([>+~]|"+M+")"+M+"*"),U=new RegExp("="+M+"*([^\\]'\"]*?)"+M+"*\\]","g"),V=new RegExp(Q),W=new RegExp("^"+O+"$"),X={ID:new RegExp("^#("+N+")"),CLASS:new RegExp("^\\.("+N+")"),TAG:new RegExp("^("+N.replace("w","w*")+")"),ATTR:new RegExp("^"+P),PSEUDO:new RegExp("^"+Q),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+L+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/^(?:input|select|textarea|button)$/i,Z=/^h\d$/i,$=/^[^{]+\{\s*\[native \w/,_=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ab=/[+~]/,bb=/'|\\/g,cb=new RegExp("\\\\([\\da-f]{1,6}"+M+"?|("+M+")|.)","ig"),db=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)};try{I.apply(F=J.call(v.childNodes),v.childNodes),F[v.childNodes.length].nodeType}catch(eb){I={apply:F.length?function(a,b){H.apply(a,J.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function fb(a,b,d,e){var f,h,j,k,l,o,r,s,w,x;if((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,d=d||[],!a||"string"!=typeof a)return d;if(1!==(k=b.nodeType)&&9!==k)return[];if(p&&!e){if(f=_.exec(a))if(j=f[1]){if(9===k){if(h=b.getElementById(j),!h||!h.parentNode)return d;if(h.id===j)return d.push(h),d}else if(b.ownerDocument&&(h=b.ownerDocument.getElementById(j))&&t(b,h)&&h.id===j)return d.push(h),d}else{if(f[2])return I.apply(d,b.getElementsByTagName(a)),d;if((j=f[3])&&c.getElementsByClassName&&b.getElementsByClassName)return I.apply(d,b.getElementsByClassName(j)),d}if(c.qsa&&(!q||!q.test(a))){if(s=r=u,w=b,x=9===k&&a,1===k&&"object"!==b.nodeName.toLowerCase()){o=g(a),(r=b.getAttribute("id"))?s=r.replace(bb,"\\$&"):b.setAttribute("id",s),s="[id='"+s+"'] ",l=o.length;while(l--)o[l]=s+qb(o[l]);w=ab.test(a)&&ob(b.parentNode)||b,x=o.join(",")}if(x)try{return I.apply(d,w.querySelectorAll(x)),d}catch(y){}finally{r||b.removeAttribute("id")}}}return i(a.replace(R,"$1"),b,d,e)}function gb(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function hb(a){return a[u]=!0,a}function ib(a){var b=n.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function jb(a,b){var c=a.split("|"),e=a.length;while(e--)d.attrHandle[c[e]]=b}function kb(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||D)-(~a.sourceIndex||D);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function lb(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function mb(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function nb(a){return hb(function(b){return b=+b,hb(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function ob(a){return a&&typeof a.getElementsByTagName!==C&&a}c=fb.support={},f=fb.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},m=fb.setDocument=function(a){var b,e=a?a.ownerDocument||a:v,g=e.defaultView;return e!==n&&9===e.nodeType&&e.documentElement?(n=e,o=e.documentElement,p=!f(e),g&&g!==g.top&&(g.addEventListener?g.addEventListener("unload",function(){m()},!1):g.attachEvent&&g.attachEvent("onunload",function(){m()})),c.attributes=ib(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ib(function(a){return a.appendChild(e.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=$.test(e.getElementsByClassName)&&ib(function(a){return a.innerHTML="
",a.firstChild.className="i",2===a.getElementsByClassName("i").length}),c.getById=ib(function(a){return o.appendChild(a).id=u,!e.getElementsByName||!e.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if(typeof b.getElementById!==C&&p){var c=b.getElementById(a);return c&&c.parentNode?[c]:[]}},d.filter.ID=function(a){var b=a.replace(cb,db);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(cb,db);return function(a){var c=typeof a.getAttributeNode!==C&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return typeof b.getElementsByTagName!==C?b.getElementsByTagName(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return typeof b.getElementsByClassName!==C&&p?b.getElementsByClassName(a):void 0},r=[],q=[],(c.qsa=$.test(e.querySelectorAll))&&(ib(function(a){a.innerHTML="",a.querySelectorAll("[msallowclip^='']").length&&q.push("[*^$]="+M+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+M+"*(?:value|"+L+")"),a.querySelectorAll(":checked").length||q.push(":checked")}),ib(function(a){var b=e.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+M+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=$.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ib(function(a){c.disconnectedMatch=s.call(a,"div"),s.call(a,"[s!='']:x"),r.push("!=",Q)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=$.test(o.compareDocumentPosition),t=b||$.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===e||a.ownerDocument===v&&t(v,a)?-1:b===e||b.ownerDocument===v&&t(v,b)?1:k?K.call(k,a)-K.call(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,f=a.parentNode,g=b.parentNode,h=[a],i=[b];if(!f||!g)return a===e?-1:b===e?1:f?-1:g?1:k?K.call(k,a)-K.call(k,b):0;if(f===g)return kb(a,b);c=a;while(c=c.parentNode)h.unshift(c);c=b;while(c=c.parentNode)i.unshift(c);while(h[d]===i[d])d++;return d?kb(h[d],i[d]):h[d]===v?-1:i[d]===v?1:0},e):n},fb.matches=function(a,b){return fb(a,null,null,b)},fb.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(U,"='$1']"),!(!c.matchesSelector||!p||r&&r.test(b)||q&&q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return fb(b,n,null,[a]).length>0},fb.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},fb.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&E.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},fb.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},fb.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=fb.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=fb.selectors={cacheLength:50,createPseudo:hb,match:X,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(cb,db),a[3]=(a[3]||a[4]||a[5]||"").replace(cb,db),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||fb.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&fb.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return X.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&V.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(cb,db).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+M+")"+a+"("+M+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||typeof a.getAttribute!==C&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=fb.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h;if(q){if(f){while(p){l=b;while(l=l[p])if(h?l.nodeName.toLowerCase()===r:1===l.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){k=q[u]||(q[u]={}),j=k[a]||[],n=j[0]===w&&j[1],m=j[0]===w&&j[2],l=n&&q.childNodes[n];while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if(1===l.nodeType&&++m&&l===b){k[a]=[w,n,m];break}}else if(s&&(j=(b[u]||(b[u]={}))[a])&&j[0]===w)m=j[1];else while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if((h?l.nodeName.toLowerCase()===r:1===l.nodeType)&&++m&&(s&&((l[u]||(l[u]={}))[a]=[w,m]),l===b))break;return m-=e,m===d||m%d===0&&m/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||fb.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?hb(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=K.call(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:hb(function(a){var b=[],c=[],d=h(a.replace(R,"$1"));return d[u]?hb(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),!c.pop()}}),has:hb(function(a){return function(b){return fb(a,b).length>0}}),contains:hb(function(a){return function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:hb(function(a){return W.test(a||"")||fb.error("unsupported lang: "+a),a=a.replace(cb,db).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return Z.test(a.nodeName)},input:function(a){return Y.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:nb(function(){return[0]}),last:nb(function(a,b){return[b-1]}),eq:nb(function(a,b,c){return[0>c?c+b:c]}),even:nb(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:nb(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:nb(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:nb(function(a,b,c){for(var d=0>c?c+b:c;++db;b++)d+=a[b].value;return d}function rb(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=x++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j=[w,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(i=b[u]||(b[u]={}),(h=i[d])&&h[0]===w&&h[1]===f)return j[2]=h[2];if(i[d]=j,j[2]=a(b,c,g))return!0}}}function sb(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function tb(a,b,c){for(var d=0,e=b.length;e>d;d++)fb(a,b[d],c);return c}function ub(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(!c||c(f,d,e))&&(g.push(f),j&&b.push(h));return g}function vb(a,b,c,d,e,f){return d&&!d[u]&&(d=vb(d)),e&&!e[u]&&(e=vb(e,f)),hb(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||tb(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:ub(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=ub(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?K.call(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=ub(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):I.apply(g,r)})}function wb(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=rb(function(a){return a===b},h,!0),l=rb(function(a){return K.call(b,a)>-1},h,!0),m=[function(a,c,d){return!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d))}];f>i;i++)if(c=d.relative[a[i].type])m=[rb(sb(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;f>e;e++)if(d.relative[a[e].type])break;return vb(i>1&&sb(m),i>1&&qb(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(R,"$1"),c,e>i&&wb(a.slice(i,e)),f>e&&wb(a=a.slice(e)),f>e&&qb(a))}m.push(c)}return sb(m)}function xb(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,m,o,p=0,q="0",r=f&&[],s=[],t=j,u=f||e&&d.find.TAG("*",k),v=w+=null==t?1:Math.random()||.1,x=u.length;for(k&&(j=g!==n&&g);q!==x&&null!=(l=u[q]);q++){if(e&&l){m=0;while(o=a[m++])if(o(l,g,h)){i.push(l);break}k&&(w=v)}c&&((l=!o&&l)&&p--,f&&r.push(l))}if(p+=q,c&&q!==p){m=0;while(o=b[m++])o(r,s,g,h);if(f){if(p>0)while(q--)r[q]||s[q]||(s[q]=G.call(i));s=ub(s)}I.apply(i,s),k&&!f&&s.length>0&&p+b.length>1&&fb.uniqueSort(i)}return k&&(w=v,j=t),r};return c?hb(f):f}return h=fb.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=wb(b[c]),f[u]?d.push(f):e.push(f);f=A(a,xb(e,d)),f.selector=a}return f},i=fb.select=function(a,b,e,f){var i,j,k,l,m,n="function"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&"ID"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(b=(d.find.ID(k.matches[0].replace(cb,db),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=X.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type])break;if((m=d.find[l])&&(f=m(k.matches[0].replace(cb,db),ab.test(j[0].type)&&ob(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&qb(j),!a)return I.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,ab.test(a)&&ob(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ib(function(a){return 1&a.compareDocumentPosition(n.createElement("div"))}),ib(function(a){return a.innerHTML="
","#"===a.firstChild.getAttribute("href")})||jb("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ib(function(a){return a.innerHTML="",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||jb("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),ib(function(a){return null==a.getAttribute("disabled")})||jb(L,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),fb}(a);n.find=t,n.expr=t.selectors,n.expr[":"]=n.expr.pseudos,n.unique=t.uniqueSort,n.text=t.getText,n.isXMLDoc=t.isXML,n.contains=t.contains;var u=n.expr.match.needsContext,v=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,w=/^.[^:#\[\.,]*$/;function x(a,b,c){if(n.isFunction(b))return n.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return n.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(w.test(b))return n.filter(b,a,c);b=n.filter(b,a)}return n.grep(a,function(a){return g.call(b,a)>=0!==c})}n.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?n.find.matchesSelector(d,a)?[d]:[]:n.find.matches(a,n.grep(b,function(a){return 1===a.nodeType}))},n.fn.extend({find:function(a){var b,c=this.length,d=[],e=this;if("string"!=typeof a)return this.pushStack(n(a).filter(function(){for(b=0;c>b;b++)if(n.contains(e[b],this))return!0}));for(b=0;c>b;b++)n.find(a,e[b],d);return d=this.pushStack(c>1?n.unique(d):d),d.selector=this.selector?this.selector+" "+a:a,d},filter:function(a){return this.pushStack(x(this,a||[],!1))},not:function(a){return this.pushStack(x(this,a||[],!0))},is:function(a){return!!x(this,"string"==typeof a&&u.test(a)?n(a):a||[],!1).length}});var y,z=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,A=n.fn.init=function(a,b){var c,d;if(!a)return this;if("string"==typeof a){if(c="<"===a[0]&&">"===a[a.length-1]&&a.length>=3?[null,a,null]:z.exec(a),!c||!c[1]&&b)return!b||b.jquery?(b||y).find(a):this.constructor(b).find(a);if(c[1]){if(b=b instanceof n?b[0]:b,n.merge(this,n.parseHTML(c[1],b&&b.nodeType?b.ownerDocument||b:l,!0)),v.test(c[1])&&n.isPlainObject(b))for(c in b)n.isFunction(this[c])?this[c](b[c]):this.attr(c,b[c]);return this}return d=l.getElementById(c[2]),d&&d.parentNode&&(this.length=1,this[0]=d),this.context=l,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):n.isFunction(a)?"undefined"!=typeof y.ready?y.ready(a):a(n):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),n.makeArray(a,this))};A.prototype=n.fn,y=n(l);var B=/^(?:parents|prev(?:Until|All))/,C={children:!0,contents:!0,next:!0,prev:!0};n.extend({dir:function(a,b,c){var d=[],e=void 0!==c;while((a=a[b])&&9!==a.nodeType)if(1===a.nodeType){if(e&&n(a).is(c))break;d.push(a)}return d},sibling:function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c}}),n.fn.extend({has:function(a){var b=n(a,this),c=b.length;return this.filter(function(){for(var a=0;c>a;a++)if(n.contains(this,b[a]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=u.test(a)||"string"!=typeof a?n(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&n.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?n.unique(f):f)},index:function(a){return a?"string"==typeof a?g.call(n(a),this[0]):g.call(this,a.jquery?a[0]:a):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(n.unique(n.merge(this.get(),n(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function D(a,b){while((a=a[b])&&1!==a.nodeType);return a}n.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return n.dir(a,"parentNode")},parentsUntil:function(a,b,c){return n.dir(a,"parentNode",c)},next:function(a){return D(a,"nextSibling")},prev:function(a){return D(a,"previousSibling")},nextAll:function(a){return n.dir(a,"nextSibling")},prevAll:function(a){return n.dir(a,"previousSibling")},nextUntil:function(a,b,c){return n.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return n.dir(a,"previousSibling",c)},siblings:function(a){return n.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return n.sibling(a.firstChild)},contents:function(a){return a.contentDocument||n.merge([],a.childNodes)}},function(a,b){n.fn[a]=function(c,d){var e=n.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=n.filter(d,e)),this.length>1&&(C[a]||n.unique(e),B.test(a)&&e.reverse()),this.pushStack(e)}});var E=/\S+/g,F={};function G(a){var b=F[a]={};return n.each(a.match(E)||[],function(a,c){b[c]=!0}),b}n.Callbacks=function(a){a="string"==typeof a?F[a]||G(a):n.extend({},a);var b,c,d,e,f,g,h=[],i=!a.once&&[],j=function(l){for(b=a.memory&&l,c=!0,g=e||0,e=0,f=h.length,d=!0;h&&f>g;g++)if(h[g].apply(l[0],l[1])===!1&&a.stopOnFalse){b=!1;break}d=!1,h&&(i?i.length&&j(i.shift()):b?h=[]:k.disable())},k={add:function(){if(h){var c=h.length;!function g(b){n.each(b,function(b,c){var d=n.type(c);"function"===d?a.unique&&k.has(c)||h.push(c):c&&c.length&&"string"!==d&&g(c)})}(arguments),d?f=h.length:b&&(e=c,j(b))}return this},remove:function(){return h&&n.each(arguments,function(a,b){var c;while((c=n.inArray(b,h,c))>-1)h.splice(c,1),d&&(f>=c&&f--,g>=c&&g--)}),this},has:function(a){return a?n.inArray(a,h)>-1:!(!h||!h.length)},empty:function(){return h=[],f=0,this},disable:function(){return h=i=b=void 0,this},disabled:function(){return!h},lock:function(){return i=void 0,b||k.disable(),this},locked:function(){return!i},fireWith:function(a,b){return!h||c&&!i||(b=b||[],b=[a,b.slice?b.slice():b],d?i.push(b):j(b)),this},fire:function(){return k.fireWith(this,arguments),this},fired:function(){return!!c}};return k},n.extend({Deferred:function(a){var b=[["resolve","done",n.Callbacks("once memory"),"resolved"],["reject","fail",n.Callbacks("once memory"),"rejected"],["notify","progress",n.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return n.Deferred(function(c){n.each(b,function(b,f){var g=n.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&n.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?n.extend(a,d):d}},e={};return d.pipe=d.then,n.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=d.call(arguments),e=c.length,f=1!==e||a&&n.isFunction(a.promise)?e:0,g=1===f?a:n.Deferred(),h=function(a,b,c){return function(e){b[a]=this,c[a]=arguments.length>1?d.call(arguments):e,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(e>1)for(i=new Array(e),j=new Array(e),k=new Array(e);e>b;b++)c[b]&&n.isFunction(c[b].promise)?c[b].promise().done(h(b,k,c)).fail(g.reject).progress(h(b,j,i)):--f;return f||g.resolveWith(k,c),g.promise()}});var H;n.fn.ready=function(a){return n.ready.promise().done(a),this},n.extend({isReady:!1,readyWait:1,holdReady:function(a){a?n.readyWait++:n.ready(!0)},ready:function(a){(a===!0?--n.readyWait:n.isReady)||(n.isReady=!0,a!==!0&&--n.readyWait>0||(H.resolveWith(l,[n]),n.fn.triggerHandler&&(n(l).triggerHandler("ready"),n(l).off("ready"))))}});function I(){l.removeEventListener("DOMContentLoaded",I,!1),a.removeEventListener("load",I,!1),n.ready()}n.ready.promise=function(b){return H||(H=n.Deferred(),"complete"===l.readyState?setTimeout(n.ready):(l.addEventListener("DOMContentLoaded",I,!1),a.addEventListener("load",I,!1))),H.promise(b)},n.ready.promise();var J=n.access=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===n.type(c)){e=!0;for(h in c)n.access(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,n.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(n(a),c)})),b))for(;i>h;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f};n.acceptData=function(a){return 1===a.nodeType||9===a.nodeType||!+a.nodeType};function K(){Object.defineProperty(this.cache={},0,{get:function(){return{}}}),this.expando=n.expando+Math.random()}K.uid=1,K.accepts=n.acceptData,K.prototype={key:function(a){if(!K.accepts(a))return 0;var b={},c=a[this.expando];if(!c){c=K.uid++;try{b[this.expando]={value:c},Object.defineProperties(a,b)}catch(d){b[this.expando]=c,n.extend(a,b)}}return this.cache[c]||(this.cache[c]={}),c},set:function(a,b,c){var d,e=this.key(a),f=this.cache[e];if("string"==typeof b)f[b]=c;else if(n.isEmptyObject(f))n.extend(this.cache[e],b);else for(d in b)f[d]=b[d];return f},get:function(a,b){var c=this.cache[this.key(a)];return void 0===b?c:c[b]},access:function(a,b,c){var d;return void 0===b||b&&"string"==typeof b&&void 0===c?(d=this.get(a,b),void 0!==d?d:this.get(a,n.camelCase(b))):(this.set(a,b,c),void 0!==c?c:b)},remove:function(a,b){var c,d,e,f=this.key(a),g=this.cache[f];if(void 0===b)this.cache[f]={};else{n.isArray(b)?d=b.concat(b.map(n.camelCase)):(e=n.camelCase(b),b in g?d=[b,e]:(d=e,d=d in g?[d]:d.match(E)||[])),c=d.length;while(c--)delete g[d[c]]}},hasData:function(a){return!n.isEmptyObject(this.cache[a[this.expando]]||{})},discard:function(a){a[this.expando]&&delete this.cache[a[this.expando]]}};var L=new K,M=new K,N=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,O=/([A-Z])/g;function P(a,b,c){var d;if(void 0===c&&1===a.nodeType)if(d="data-"+b.replace(O,"-$1").toLowerCase(),c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:N.test(c)?n.parseJSON(c):c}catch(e){}M.set(a,b,c)}else c=void 0;return c}n.extend({hasData:function(a){return M.hasData(a)||L.hasData(a)},data:function(a,b,c){return M.access(a,b,c)},removeData:function(a,b){M.remove(a,b) 3 | },_data:function(a,b,c){return L.access(a,b,c)},_removeData:function(a,b){L.remove(a,b)}}),n.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=M.get(f),1===f.nodeType&&!L.get(f,"hasDataAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=n.camelCase(d.slice(5)),P(f,d,e[d])));L.set(f,"hasDataAttrs",!0)}return e}return"object"==typeof a?this.each(function(){M.set(this,a)}):J(this,function(b){var c,d=n.camelCase(a);if(f&&void 0===b){if(c=M.get(f,a),void 0!==c)return c;if(c=M.get(f,d),void 0!==c)return c;if(c=P(f,d,void 0),void 0!==c)return c}else this.each(function(){var c=M.get(this,d);M.set(this,d,b),-1!==a.indexOf("-")&&void 0!==c&&M.set(this,a,b)})},null,b,arguments.length>1,null,!0)},removeData:function(a){return this.each(function(){M.remove(this,a)})}}),n.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=L.get(a,b),c&&(!d||n.isArray(c)?d=L.access(a,b,n.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=n.queue(a,b),d=c.length,e=c.shift(),f=n._queueHooks(a,b),g=function(){n.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return L.get(a,c)||L.access(a,c,{empty:n.Callbacks("once memory").add(function(){L.remove(a,[b+"queue",c])})})}}),n.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.lengthx",k.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue}();var U="undefined";k.focusinBubbles="onfocusin"in a;var V=/^key/,W=/^(?:mouse|pointer|contextmenu)|click/,X=/^(?:focusinfocus|focusoutblur)$/,Y=/^([^.]*)(?:\.(.+)|)$/;function Z(){return!0}function $(){return!1}function _(){try{return l.activeElement}catch(a){}}n.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=L.get(a);if(r){c.handler&&(f=c,c=f.handler,e=f.selector),c.guid||(c.guid=n.guid++),(i=r.events)||(i=r.events={}),(g=r.handle)||(g=r.handle=function(b){return typeof n!==U&&n.event.triggered!==b.type?n.event.dispatch.apply(a,arguments):void 0}),b=(b||"").match(E)||[""],j=b.length;while(j--)h=Y.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o&&(l=n.event.special[o]||{},o=(e?l.delegateType:l.bindType)||o,l=n.event.special[o]||{},k=n.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&n.expr.match.needsContext.test(e),namespace:p.join(".")},f),(m=i[o])||(m=i[o]=[],m.delegateCount=0,l.setup&&l.setup.call(a,d,p,g)!==!1||a.addEventListener&&a.addEventListener(o,g,!1)),l.add&&(l.add.call(a,k),k.handler.guid||(k.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,k):m.push(k),n.event.global[o]=!0)}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=L.hasData(a)&&L.get(a);if(r&&(i=r.events)){b=(b||"").match(E)||[""],j=b.length;while(j--)if(h=Y.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=n.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,m=i[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),g=f=m.length;while(f--)k=m[f],!e&&q!==k.origType||c&&c.guid!==k.guid||h&&!h.test(k.namespace)||d&&d!==k.selector&&("**"!==d||!k.selector)||(m.splice(f,1),k.selector&&m.delegateCount--,l.remove&&l.remove.call(a,k));g&&!m.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||n.removeEvent(a,o,r.handle),delete i[o])}else for(o in i)n.event.remove(a,o+b[j],c,d,!0);n.isEmptyObject(i)&&(delete r.handle,L.remove(a,"events"))}},trigger:function(b,c,d,e){var f,g,h,i,k,m,o,p=[d||l],q=j.call(b,"type")?b.type:b,r=j.call(b,"namespace")?b.namespace.split("."):[];if(g=h=d=d||l,3!==d.nodeType&&8!==d.nodeType&&!X.test(q+n.event.triggered)&&(q.indexOf(".")>=0&&(r=q.split("."),q=r.shift(),r.sort()),k=q.indexOf(":")<0&&"on"+q,b=b[n.expando]?b:new n.Event(q,"object"==typeof b&&b),b.isTrigger=e?2:3,b.namespace=r.join("."),b.namespace_re=b.namespace?new RegExp("(^|\\.)"+r.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=d),c=null==c?[b]:n.makeArray(c,[b]),o=n.event.special[q]||{},e||!o.trigger||o.trigger.apply(d,c)!==!1)){if(!e&&!o.noBubble&&!n.isWindow(d)){for(i=o.delegateType||q,X.test(i+q)||(g=g.parentNode);g;g=g.parentNode)p.push(g),h=g;h===(d.ownerDocument||l)&&p.push(h.defaultView||h.parentWindow||a)}f=0;while((g=p[f++])&&!b.isPropagationStopped())b.type=f>1?i:o.bindType||q,m=(L.get(g,"events")||{})[b.type]&&L.get(g,"handle"),m&&m.apply(g,c),m=k&&g[k],m&&m.apply&&n.acceptData(g)&&(b.result=m.apply(g,c),b.result===!1&&b.preventDefault());return b.type=q,e||b.isDefaultPrevented()||o._default&&o._default.apply(p.pop(),c)!==!1||!n.acceptData(d)||k&&n.isFunction(d[q])&&!n.isWindow(d)&&(h=d[k],h&&(d[k]=null),n.event.triggered=q,d[q](),n.event.triggered=void 0,h&&(d[k]=h)),b.result}},dispatch:function(a){a=n.event.fix(a);var b,c,e,f,g,h=[],i=d.call(arguments),j=(L.get(this,"events")||{})[a.type]||[],k=n.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=n.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,c=0;while((g=f.handlers[c++])&&!a.isImmediatePropagationStopped())(!a.namespace_re||a.namespace_re.test(g.namespace))&&(a.handleObj=g,a.data=g.data,e=((n.event.special[g.origType]||{}).handle||g.handler).apply(f.elem,i),void 0!==e&&(a.result=e)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&(!a.button||"click"!==a.type))for(;i!==this;i=i.parentNode||this)if(i.disabled!==!0||"click"!==a.type){for(d=[],c=0;h>c;c++)f=b[c],e=f.selector+" ",void 0===d[e]&&(d[e]=f.needsContext?n(e,this).index(i)>=0:n.find(e,this,null,[i]).length),d[e]&&d.push(f);d.length&&g.push({elem:i,handlers:d})}return h]*)\/>/gi,bb=/<([\w:]+)/,cb=/<|&#?\w+;/,db=/<(?:script|style|link)/i,eb=/checked\s*(?:[^=]|=\s*.checked.)/i,fb=/^$|\/(?:java|ecma)script/i,gb=/^true\/(.*)/,hb=/^\s*\s*$/g,ib={option:[1,""],thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};ib.optgroup=ib.option,ib.tbody=ib.tfoot=ib.colgroup=ib.caption=ib.thead,ib.th=ib.td;function jb(a,b){return n.nodeName(a,"table")&&n.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function kb(a){return a.type=(null!==a.getAttribute("type"))+"/"+a.type,a}function lb(a){var b=gb.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function mb(a,b){for(var c=0,d=a.length;d>c;c++)L.set(a[c],"globalEval",!b||L.get(b[c],"globalEval"))}function nb(a,b){var c,d,e,f,g,h,i,j;if(1===b.nodeType){if(L.hasData(a)&&(f=L.access(a),g=L.set(b,f),j=f.events)){delete g.handle,g.events={};for(e in j)for(c=0,d=j[e].length;d>c;c++)n.event.add(b,e,j[e][c])}M.hasData(a)&&(h=M.access(a),i=n.extend({},h),M.set(b,i))}}function ob(a,b){var c=a.getElementsByTagName?a.getElementsByTagName(b||"*"):a.querySelectorAll?a.querySelectorAll(b||"*"):[];return void 0===b||b&&n.nodeName(a,b)?n.merge([a],c):c}function pb(a,b){var c=b.nodeName.toLowerCase();"input"===c&&T.test(a.type)?b.checked=a.checked:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}n.extend({clone:function(a,b,c){var d,e,f,g,h=a.cloneNode(!0),i=n.contains(a.ownerDocument,a);if(!(k.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||n.isXMLDoc(a)))for(g=ob(h),f=ob(a),d=0,e=f.length;e>d;d++)pb(f[d],g[d]);if(b)if(c)for(f=f||ob(a),g=g||ob(h),d=0,e=f.length;e>d;d++)nb(f[d],g[d]);else nb(a,h);return g=ob(h,"script"),g.length>0&&mb(g,!i&&ob(a,"script")),h},buildFragment:function(a,b,c,d){for(var e,f,g,h,i,j,k=b.createDocumentFragment(),l=[],m=0,o=a.length;o>m;m++)if(e=a[m],e||0===e)if("object"===n.type(e))n.merge(l,e.nodeType?[e]:e);else if(cb.test(e)){f=f||k.appendChild(b.createElement("div")),g=(bb.exec(e)||["",""])[1].toLowerCase(),h=ib[g]||ib._default,f.innerHTML=h[1]+e.replace(ab,"<$1>")+h[2],j=h[0];while(j--)f=f.lastChild;n.merge(l,f.childNodes),f=k.firstChild,f.textContent=""}else l.push(b.createTextNode(e));k.textContent="",m=0;while(e=l[m++])if((!d||-1===n.inArray(e,d))&&(i=n.contains(e.ownerDocument,e),f=ob(k.appendChild(e),"script"),i&&mb(f),c)){j=0;while(e=f[j++])fb.test(e.type||"")&&c.push(e)}return k},cleanData:function(a){for(var b,c,d,e,f=n.event.special,g=0;void 0!==(c=a[g]);g++){if(n.acceptData(c)&&(e=c[L.expando],e&&(b=L.cache[e]))){if(b.events)for(d in b.events)f[d]?n.event.remove(c,d):n.removeEvent(c,d,b.handle);L.cache[e]&&delete L.cache[e]}delete M.cache[c[M.expando]]}}}),n.fn.extend({text:function(a){return J(this,function(a){return void 0===a?n.text(this):this.empty().each(function(){(1===this.nodeType||11===this.nodeType||9===this.nodeType)&&(this.textContent=a)})},null,a,arguments.length)},append:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=jb(this,a);b.appendChild(a)}})},prepend:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=jb(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},remove:function(a,b){for(var c,d=a?n.filter(a,this):this,e=0;null!=(c=d[e]);e++)b||1!==c.nodeType||n.cleanData(ob(c)),c.parentNode&&(b&&n.contains(c.ownerDocument,c)&&mb(ob(c,"script")),c.parentNode.removeChild(c));return this},empty:function(){for(var a,b=0;null!=(a=this[b]);b++)1===a.nodeType&&(n.cleanData(ob(a,!1)),a.textContent="");return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return n.clone(this,a,b)})},html:function(a){return J(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a&&1===b.nodeType)return b.innerHTML;if("string"==typeof a&&!db.test(a)&&!ib[(bb.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(ab,"<$1>");try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(n.cleanData(ob(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=arguments[0];return this.domManip(arguments,function(b){a=this.parentNode,n.cleanData(ob(this)),a&&a.replaceChild(b,this)}),a&&(a.length||a.nodeType)?this:this.remove()},detach:function(a){return this.remove(a,!0)},domManip:function(a,b){a=e.apply([],a);var c,d,f,g,h,i,j=0,l=this.length,m=this,o=l-1,p=a[0],q=n.isFunction(p);if(q||l>1&&"string"==typeof p&&!k.checkClone&&eb.test(p))return this.each(function(c){var d=m.eq(c);q&&(a[0]=p.call(this,c,d.html())),d.domManip(a,b)});if(l&&(c=n.buildFragment(a,this[0].ownerDocument,!1,this),d=c.firstChild,1===c.childNodes.length&&(c=d),d)){for(f=n.map(ob(c,"script"),kb),g=f.length;l>j;j++)h=c,j!==o&&(h=n.clone(h,!0,!0),g&&n.merge(f,ob(h,"script"))),b.call(this[j],h,j);if(g)for(i=f[f.length-1].ownerDocument,n.map(f,lb),j=0;g>j;j++)h=f[j],fb.test(h.type||"")&&!L.access(h,"globalEval")&&n.contains(i,h)&&(h.src?n._evalUrl&&n._evalUrl(h.src):n.globalEval(h.textContent.replace(hb,"")))}return this}}),n.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){n.fn[a]=function(a){for(var c,d=[],e=n(a),g=e.length-1,h=0;g>=h;h++)c=h===g?this:this.clone(!0),n(e[h])[b](c),f.apply(d,c.get());return this.pushStack(d)}});var qb,rb={};function sb(b,c){var d,e=n(c.createElement(b)).appendTo(c.body),f=a.getDefaultComputedStyle&&(d=a.getDefaultComputedStyle(e[0]))?d.display:n.css(e[0],"display");return e.detach(),f}function tb(a){var b=l,c=rb[a];return c||(c=sb(a,b),"none"!==c&&c||(qb=(qb||n("