From f0ed816edb08352c6e564942b97cb4df4fb429fa Mon Sep 17 00:00:00 2001 From: A Catty Alpaca Date: Tue, 23 Dec 2014 23:49:15 +0100 Subject: [PATCH 001/897] fix generated widgets areas glitching on small screens because columns should always be in rows --- public/src/widgets.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/public/src/widgets.js b/public/src/widgets.js index 9e34ba9513..2200f58d5e 100644 --- a/public/src/widgets.js +++ b/public/src/widgets.js @@ -51,12 +51,12 @@ if (!area.length && window.location.pathname.indexOf('/admin') === -1 && renderedWidgets.length) { if (location === 'footer' && !$('#content [widget-area="footer"]').length) { - $('#content').append($('
')); + $('#content').append($('
')); } else if (location === 'sidebar' && !$('#content [widget-area="sidebar"]').length) { - $('#content > *').wrapAll($('
')); - $('#content').append($('
')); + $('#content > *').wrapAll($('
')); + $('#content').append($('
')); } else if (location === 'header' && !$('#content [widget-area="header"]').length) { - $('#content').prepend($('
')); + $('#content').prepend($('
')); } area = $('#content [widget-area="' + location + '"]'); From f9887de478e5e8323c8673a7c2c041f8a652217d Mon Sep 17 00:00:00 2001 From: Oleksandr Pidlisnyi Date: Fri, 2 Jan 2015 17:29:03 +0200 Subject: [PATCH 002/897] footer.tpl loggedIn variable support --- src/middleware/middleware.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/middleware/middleware.js b/src/middleware/middleware.js index 72dc37245f..57b8f20159 100644 --- a/src/middleware/middleware.js +++ b/src/middleware/middleware.js @@ -190,7 +190,7 @@ middleware.buildHeader = function(req, res, next) { controllers.api.getConfig(req, res, next); }, footer: function(next) { - app.render('footer', {}, next); + app.render('footer', {loggedIn: (req.user ? parseInt(req.user.uid, 10) !== 0 : false)}, next); } }, function(err, results) { if (err) { From 3da64660454b4a9d4803bcb0ee43d5f70eb68a5c Mon Sep 17 00:00:00 2001 From: psychobunny Date: Sat, 3 Jan 2015 03:37:53 -0500 Subject: [PATCH 003/897] I thought I was on holiday (fixes infinite loop on language calls) --- public/src/translator.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/src/translator.js b/public/src/translator.js index 1802e858d8..2fd8b79d1a 100644 --- a/public/src/translator.js +++ b/public/src/translator.js @@ -123,7 +123,7 @@ var parsedKey = key.replace('[[', '').replace(']]', '').split(':'); if (!(parsedKey[0] && parsedKey[1])) { - return; + return callback(data); } var languageFile = parsedKey[0]; From 112a1e8c8594ce494d8c2ca8b02d0cc9810fea22 Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Sat, 3 Jan 2015 17:53:25 -0500 Subject: [PATCH 004/897] happy new year! --- src/views/admin/footer.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/views/admin/footer.tpl b/src/views/admin/footer.tpl index 92aba3d202..c54c67dd3c 100644 --- a/src/views/admin/footer.tpl +++ b/src/views/admin/footer.tpl @@ -43,7 +43,7 @@
From f3a113d318d9722c4d58afdd8fd7e2be1bf96fef Mon Sep 17 00:00:00 2001 From: psychobunny Date: Sat, 3 Jan 2015 20:07:09 -0500 Subject: [PATCH 005/897] jslinting on holiday ftw --- tests/categories.js | 2 ++ tests/database.js | 6 ++++-- tests/groups.js | 5 ++++- tests/messaging.js | 15 +++++++++------ tests/topics.js | 1 + tests/user.js | 3 +++ tests/utils.js | 25 ++++++++++++++----------- 7 files changed, 37 insertions(+), 20 deletions(-) diff --git a/tests/categories.js b/tests/categories.js index 7909f0a0f8..95c7a0f14b 100644 --- a/tests/categories.js +++ b/tests/categories.js @@ -1,3 +1,5 @@ +'use strict'; +/*global require, process, after*/ var winston = require('winston'); diff --git a/tests/database.js b/tests/database.js index 9118823d00..3f8c119002 100644 --- a/tests/database.js +++ b/tests/database.js @@ -1,6 +1,8 @@ +'use strict'; +/*global require*/ + var assert = require('assert'), - db = require('./mocks/databasemock'), - async = require('async'); + db = require('./mocks/databasemock'); describe('Test database', function() { diff --git a/tests/groups.js b/tests/groups.js index 02d9cd2ffa..6f36cbfa2c 100644 --- a/tests/groups.js +++ b/tests/groups.js @@ -1,3 +1,6 @@ +'use strict'; +/*global require, before, after*/ + var assert = require('assert'), async = require('async'), @@ -14,7 +17,7 @@ describe('Groups', function() { }, function(next) { // Create a new user - User.create({ + User.create({ username: 'testuser', email: 'b@c.com' }, done); diff --git a/tests/messaging.js b/tests/messaging.js index 29d3e79418..a709640430 100644 --- a/tests/messaging.js +++ b/tests/messaging.js @@ -1,3 +1,6 @@ +'use strict'; +/*global require, before, after*/ + var assert = require('assert'), db = require('./mocks/databasemock'), async = require('async'), @@ -6,7 +9,7 @@ var assert = require('assert'), Messaging = require('../src/messaging'), testUids; -describe("Messaging Library", function() { +describe('Messaging Library', function() { before(function(done) { // Create 3 users: 1 admin, 2 regular async.parallel([ @@ -22,7 +25,7 @@ describe("Messaging Library", function() { }); }); - describe(".canMessage()", function() { + describe('.canMessage()', function() { it('should not error out', function(done) { Messaging.canMessage(testUids[1], testUids[2], function(err, allowed) { assert.ifError(err); @@ -30,14 +33,14 @@ describe("Messaging Library", function() { }); }); - it("should allow messages to be sent to an unrestricted user", function(done) { + it('should allow messages to be sent to an unrestricted user', function(done) { Messaging.canMessage(testUids[1], testUids[2], function(err, allowed) { assert.strictEqual(allowed, true, 'should be true, received ' + allowed); done(); }); }); - it("should NOT allow messages to be sent to a restricted user", function(done) { + it('should NOT allow messages to be sent to a restricted user', function(done) { User.setSetting(testUids[1], 'restrictChat', '1', function() { Messaging.canMessage(testUids[2], testUids[1], function(err, allowed) { assert.strictEqual(allowed, false, 'should be false, received ' + allowed); @@ -46,14 +49,14 @@ describe("Messaging Library", function() { }); }); - it("should always allow admins through", function(done) { + it('should always allow admins through', function(done) { Messaging.canMessage(testUids[0], testUids[1], function(err, allowed) { assert.strictEqual(allowed, true, 'should be true, received ' + allowed); done(); }); }); - it("should allow messages to be sent to a restricted user if restricted user follows sender", function(done) { + it('should allow messages to be sent to a restricted user if restricted user follows sender', function(done) { User.follow(testUids[1], testUids[2], function() { Messaging.canMessage(testUids[2], testUids[1], function(err, allowed) { assert.strictEqual(allowed, true, 'should be true, received ' + allowed); diff --git a/tests/topics.js b/tests/topics.js index 6ee2d3ca79..bdc15643ba 100644 --- a/tests/topics.js +++ b/tests/topics.js @@ -1,4 +1,5 @@ 'use strict'; +/*global require, before, beforeEach, after*/ var assert = require('assert'), db = require('./mocks/databasemock'), diff --git a/tests/user.js b/tests/user.js index 9e53b4c4c5..3ef541623b 100644 --- a/tests/user.js +++ b/tests/user.js @@ -1,3 +1,6 @@ +'use strict'; +/*global require, process, before, beforeEach, after*/ + var winston = require('winston'); process.on('uncaughtException', function (err) { diff --git a/tests/utils.js b/tests/utils.js index ec88aa24c1..befb2f78d2 100644 --- a/tests/utils.js +++ b/tests/utils.js @@ -1,35 +1,38 @@ +'use strict'; +/*global require*/ + var assert = require('assert'), utils = require('./../public/src/utils.js'); -describe("Utility Methods", function(){ - describe("username validation", function(){ - it("accepts latin-1 characters", function(){ +describe('Utility Methods', function(){ + describe('username validation', function(){ + it('accepts latin-1 characters', function(){ var username = "John\"'-. Doeäâèéë1234"; assert(utils.isUserNameValid(username), 'invalid username'); }); - it("rejects empty string", function(){ - var username = ""; + it('rejects empty string', function(){ + var username = ''; assert.ifError(utils.isUserNameValid(username), 'accepted as valid username'); }); }); - describe("email validation", function(){ - it("accepts sample address", function(){ + describe('email validation', function(){ + it('accepts sample address', function(){ var email = 'sample@example.com'; assert(utils.isEmailValid(email), 'invalid email'); }); - it("rejects empty address", function(){ + it('rejects empty address', function(){ var email = ''; assert.ifError(utils.isEmailValid(email), 'accepted as valid email'); }); }); - describe("UUID generation", function(){ - it("return unique random value every time", function(){ + describe('UUID generation', function(){ + it('return unique random value every time', function(){ var uuid1 = utils.generateUUID(), uuid2 = utils.generateUUID(); - assert.notEqual(uuid1, uuid2, "matches"); + assert.notEqual(uuid1, uuid2, 'matches'); }); }); }); From 357de92624d1dcd1d05bfcf2d24c8d0048176f6b Mon Sep 17 00:00:00 2001 From: psychobunny Date: Sat, 3 Jan 2015 20:08:49 -0500 Subject: [PATCH 006/897] tests/database linting --- tests/database/hash.js | 4 ++-- tests/database/keys.js | 1 + tests/database/list.js | 1 + tests/database/sets.js | 4 ++-- tests/database/sorted.js | 4 ++-- 5 files changed, 8 insertions(+), 6 deletions(-) diff --git a/tests/database/hash.js b/tests/database/hash.js index 2086dc1af7..1478f401a1 100644 --- a/tests/database/hash.js +++ b/tests/database/hash.js @@ -1,7 +1,7 @@ 'use strict'; +/*global require, after*/ -var async = require('async'), - assert = require('assert'), +var assert = require('assert'), db = require('../mocks/databasemock'); describe('Hash methods', function() { diff --git a/tests/database/keys.js b/tests/database/keys.js index 415238832a..faa3133dcf 100644 --- a/tests/database/keys.js +++ b/tests/database/keys.js @@ -1,4 +1,5 @@ 'use strict'; +/*global require, after*/ var async = require('async'), assert = require('assert'), diff --git a/tests/database/list.js b/tests/database/list.js index 485526852d..abb4c0e939 100644 --- a/tests/database/list.js +++ b/tests/database/list.js @@ -1,4 +1,5 @@ 'use strict'; +/*global require, after*/ var async = require('async'), assert = require('assert'), diff --git a/tests/database/sets.js b/tests/database/sets.js index bdcd4fba30..b93d9a90e7 100644 --- a/tests/database/sets.js +++ b/tests/database/sets.js @@ -1,7 +1,7 @@ 'use strict'; +/*global require, after*/ -var async = require('async'), - assert = require('assert'), +var assert = require('assert'), db = require('../mocks/databasemock'); describe('Set methods', function() { diff --git a/tests/database/sorted.js b/tests/database/sorted.js index a675c709ec..fbe8ebb569 100644 --- a/tests/database/sorted.js +++ b/tests/database/sorted.js @@ -1,7 +1,7 @@ 'use strict'; +/*global require, after*/ -var async = require('async'), - assert = require('assert'), +var assert = require('assert'), db = require('../mocks/databasemock'); describe('Sorted Set methods', function() { From 64468a6f169786b0127140a4506debe5d5b8fa25 Mon Sep 17 00:00:00 2001 From: psychobunny Date: Sat, 3 Jan 2015 20:10:08 -0500 Subject: [PATCH 007/897] more linting --- tests/mocks/databasemock.js | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/tests/mocks/databasemock.js b/tests/mocks/databasemock.js index e694a9c9ba..d3dea94a8c 100644 --- a/tests/mocks/databasemock.js +++ b/tests/mocks/databasemock.js @@ -5,10 +5,9 @@ (function(module) { 'use strict'; - /*global before*/ + /*global require, before*/ - var utils = require('./../../public/src/utils.js'), - path = require('path'), + var path = require('path'), nconf = require('nconf'), winston = require('winston'), errorText; @@ -30,23 +29,23 @@ if(!testDbConfig){ errorText = 'test_database is not defined'; winston.info( - "\n===========================================================\n"+ - "Please, add parameters for test database in config.json\n"+ - "For example (redis):\n"+ + '\n===========================================================\n'+ + 'Please, add parameters for test database in config.json\n'+ + 'For example (redis):\n'+ '"test_database": {' + '\n' + ' "host": "127.0.0.1",' + '\n' + ' "port": "6379",' + '\n' + ' "password": "",' + '\n' + ' "database": "1"' + '\n' + '}\n'+ - " or (mongo):\n" + + ' or (mongo):\n' + '"test_database": {' + '\n' + ' "host": "127.0.0.1",' + '\n' + ' "port": "27017",' + '\n' + ' "password": "",' + '\n' + ' "database": "1"' + '\n' + '}\n'+ - "===========================================================" + '===========================================================' ); winston.error(errorText); throw new Error(errorText); From 8522af504a489f199798b577e3c9c66a9076f156 Mon Sep 17 00:00:00 2001 From: Baris Usakli Date: Sun, 4 Jan 2015 11:37:20 -0500 Subject: [PATCH 008/897] closed #2571 --- src/controllers/api.js | 3 ++- src/controllers/index.js | 6 +++--- src/meta/title.js | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/controllers/api.js b/src/controllers/api.js index 52bfd6233f..75e4d558dd 100644 --- a/src/controllers/api.js +++ b/src/controllers/api.js @@ -6,6 +6,7 @@ var pkg = require('./../../package.json'), plugins = require('./../plugins'), widgets = require('../widgets'), + validator = require('validator'), nconf = require('nconf'); var apiController = {}; @@ -16,7 +17,7 @@ apiController.getConfig = function(req, res, next) { config.socketioTransports = nconf.get('socket.io:transports') || ['polling', 'websocket']; config.websocketAddress = nconf.get('socket.io:address') || ''; config.version = pkg.version; - config.siteTitle = meta.config.title || meta.config.browserTitle || 'NodeBB'; + config.siteTitle = validator.escape(meta.config.title || meta.config.browserTitle || 'NodeBB'); config.showSiteTitle = parseInt(meta.config.showSiteTitle, 10) === 1; config.postDelay = meta.config.postDelay; config.minimumTitleLength = meta.config.minimumTitleLength; diff --git a/src/controllers/index.js b/src/controllers/index.js index 2398ae7b00..0e982c59fa 100644 --- a/src/controllers/index.js +++ b/src/controllers/index.js @@ -43,13 +43,13 @@ Controllers.home = function(req, res, next) { header: function (next) { res.locals.metaTags = [{ name: "title", - content: meta.config.title || 'NodeBB' + content: validator.escape(meta.config.title || 'NodeBB') }, { name: "description", - content: meta.config.description || '' + content: validator.escape(meta.config.description || '') }, { property: 'og:title', - content: 'Index | ' + (meta.config.title || 'NodeBB') + content: 'Index | ' + validator.escape(meta.config.title || 'NodeBB') }, { property: 'og:type', content: 'website' diff --git a/src/meta/title.js b/src/meta/title.js index 286c25ac6b..a476cb61a3 100644 --- a/src/meta/title.js +++ b/src/meta/title.js @@ -17,7 +17,7 @@ module.exports = function(Meta) { Meta.title.build = function (urlFragment, language, locals, callback) { var uri = ''; - var fallbackTitle = Meta.config.browserTitle || Meta.config.title || 'NodeBB'; + var fallbackTitle = validator.escape(Meta.config.browserTitle || Meta.config.title || 'NodeBB'); try { uri = decodeURIComponent(urlFragment); } catch(e) { From a36391864a3e66a46c72ecd7b75e2816dd65118e Mon Sep 17 00:00:00 2001 From: Baris Usakli Date: Sun, 4 Jan 2015 11:41:37 -0500 Subject: [PATCH 009/897] fix recent replies crash, closes #2575 --- src/categories/recentreplies.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/categories/recentreplies.js b/src/categories/recentreplies.js index cbf5f5cd8b..bb1ae32775 100644 --- a/src/categories/recentreplies.js +++ b/src/categories/recentreplies.js @@ -61,7 +61,7 @@ module.exports = function(Categories) { function assignPostsToCategory(category, posts) { category.posts = posts.filter(function(post) { - return parseInt(post.category.cid, 10) === parseInt(category.cid, 10); + return post.category && parseInt(post.category.cid, 10) === parseInt(category.cid, 10); }).sort(function(a, b) { return b.timestamp - a.timestamp; }).slice(0, parseInt(category.numRecentReplies, 10)); From e26f8c3290a80567e1a6e123ff23c8a0ec55cb8b Mon Sep 17 00:00:00 2001 From: TheBronx Date: Mon, 5 Jan 2015 13:43:44 +0100 Subject: [PATCH 010/897] update bootstrap js to v3.3.1 fixes #2579 update bootstrap.min.js to v3.3.1 fixes #2579 --- public/vendor/bootstrap/js/bootstrap.min.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/public/vendor/bootstrap/js/bootstrap.min.js b/public/vendor/bootstrap/js/bootstrap.min.js index 1a6258efcb..d839865900 100644 --- a/public/vendor/bootstrap/js/bootstrap.min.js +++ b/public/vendor/bootstrap/js/bootstrap.min.js @@ -1,7 +1,7 @@ /*! - * Bootstrap v3.0.3 (http://getbootstrap.com) - * Copyright 2013 Twitter, Inc. - * Licensed under http://www.apache.org/licenses/LICENSE-2.0 + * Bootstrap v3.3.1 (http://getbootstrap.com) + * Copyright 2011-2014 Twitter, Inc. + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) */ - -if("undefined"==typeof jQuery)throw new Error("Bootstrap requires 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]}}a.fn.emulateTransitionEnd=function(b){var c=!1,d=this;a(this).one(a.support.transition.end,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()})}(jQuery),+function(a){"use strict";var b='[data-dismiss="alert"]',c=function(c){a(c).on("click",b,this.close)};c.prototype.close=function(b){function c(){f.trigger("closed.bs.alert").remove()}var d=a(this),e=d.attr("data-target");e||(e=d.attr("href"),e=e&&e.replace(/.*(?=#[^\s]*$)/,""));var f=a(e);b&&b.preventDefault(),f.length||(f=d.hasClass("alert")?d:d.parent()),f.trigger(b=a.Event("close.bs.alert")),b.isDefaultPrevented()||(f.removeClass("in"),a.support.transition&&f.hasClass("fade")?f.one(a.support.transition.end,c).emulateTransitionEnd(150):c())};var d=a.fn.alert;a.fn.alert=function(b){return this.each(function(){var d=a(this),e=d.data("bs.alert");e||d.data("bs.alert",e=new c(this)),"string"==typeof b&&e[b].call(d)})},a.fn.alert.Constructor=c,a.fn.alert.noConflict=function(){return a.fn.alert=d,this},a(document).on("click.bs.alert.data-api",b,c.prototype.close)}(jQuery),+function(a){"use strict";var b=function(c,d){this.$element=a(c),this.options=a.extend({},b.DEFAULTS,d)};b.DEFAULTS={loadingText:"loading..."},b.prototype.setState=function(a){var b="disabled",c=this.$element,d=c.is("input")?"val":"html",e=c.data();a+="Text",e.resetText||c.data("resetText",c[d]()),c[d](e[a]||this.options[a]),setTimeout(function(){"loadingText"==a?c.addClass(b).attr(b,b):c.removeClass(b).removeAttr(b)},0)},b.prototype.toggle=function(){var a=this.$element.closest('[data-toggle="buttons"]'),b=!0;if(a.length){var c=this.$element.find("input");"radio"===c.prop("type")&&(c.prop("checked")&&this.$element.hasClass("active")?b=!1:a.find(".active").removeClass("active")),b&&c.prop("checked",!this.$element.hasClass("active")).trigger("change")}b&&this.$element.toggleClass("active")};var c=a.fn.button;a.fn.button=function(c){return this.each(function(){var d=a(this),e=d.data("bs.button"),f="object"==typeof c&&c;e||d.data("bs.button",e=new b(this,f)),"toggle"==c?e.toggle():c&&e.setState(c)})},a.fn.button.Constructor=b,a.fn.button.noConflict=function(){return a.fn.button=c,this},a(document).on("click.bs.button.data-api","[data-toggle^=button]",function(b){var c=a(b.target);c.hasClass("btn")||(c=c.closest(".btn")),c.button("toggle"),b.preventDefault()})}(jQuery),+function(a){"use strict";var b=function(b,c){this.$element=a(b),this.$indicators=this.$element.find(".carousel-indicators"),this.options=c,this.paused=this.sliding=this.interval=this.$active=this.$items=null,"hover"==this.options.pause&&this.$element.on("mouseenter",a.proxy(this.pause,this)).on("mouseleave",a.proxy(this.cycle,this))};b.DEFAULTS={interval:5e3,pause:"hover",wrap:!0},b.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},b.prototype.getActiveIndex=function(){return this.$active=this.$element.find(".item.active"),this.$items=this.$active.parent().children(),this.$items.index(this.$active)},b.prototype.to=function(b){var c=this,d=this.getActiveIndex();return b>this.$items.length-1||0>b?void 0:this.sliding?this.$element.one("slid.bs.carousel",function(){c.to(b)}):d==b?this.pause().cycle():this.slide(b>d?"next":"prev",a(this.$items[b]))},b.prototype.pause=function(b){return b||(this.paused=!0),this.$element.find(".next, .prev").length&&a.support.transition.end&&(this.$element.trigger(a.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},b.prototype.next=function(){return this.sliding?void 0:this.slide("next")},b.prototype.prev=function(){return this.sliding?void 0:this.slide("prev")},b.prototype.slide=function(b,c){var d=this.$element.find(".item.active"),e=c||d[b](),f=this.interval,g="next"==b?"left":"right",h="next"==b?"first":"last",i=this;if(!e.length){if(!this.options.wrap)return;e=this.$element.find(".item")[h]()}this.sliding=!0,f&&this.pause();var j=a.Event("slide.bs.carousel",{relatedTarget:e[0],direction:g});if(!e.hasClass("active")){if(this.$indicators.length&&(this.$indicators.find(".active").removeClass("active"),this.$element.one("slid.bs.carousel",function(){var b=a(i.$indicators.children()[i.getActiveIndex()]);b&&b.addClass("active")})),a.support.transition&&this.$element.hasClass("slide")){if(this.$element.trigger(j),j.isDefaultPrevented())return;e.addClass(b),e[0].offsetWidth,d.addClass(g),e.addClass(g),d.one(a.support.transition.end,function(){e.removeClass([b,g].join(" ")).addClass("active"),d.removeClass(["active",g].join(" ")),i.sliding=!1,setTimeout(function(){i.$element.trigger("slid.bs.carousel")},0)}).emulateTransitionEnd(600)}else{if(this.$element.trigger(j),j.isDefaultPrevented())return;d.removeClass("active"),e.addClass("active"),this.sliding=!1,this.$element.trigger("slid.bs.carousel")}return f&&this.cycle(),this}};var c=a.fn.carousel;a.fn.carousel=function(c){return this.each(function(){var d=a(this),e=d.data("bs.carousel"),f=a.extend({},b.DEFAULTS,d.data(),"object"==typeof c&&c),g="string"==typeof c?c:f.slide;e||d.data("bs.carousel",e=new b(this,f)),"number"==typeof c?e.to(c):g?e[g]():f.interval&&e.pause().cycle()})},a.fn.carousel.Constructor=b,a.fn.carousel.noConflict=function(){return a.fn.carousel=c,this},a(document).on("click.bs.carousel.data-api","[data-slide], [data-slide-to]",function(b){var c,d=a(this),e=a(d.attr("data-target")||(c=d.attr("href"))&&c.replace(/.*(?=#[^\s]+$)/,"")),f=a.extend({},e.data(),d.data()),g=d.attr("data-slide-to");g&&(f.interval=!1),e.carousel(f),(g=d.attr("data-slide-to"))&&e.data("bs.carousel").to(g),b.preventDefault()}),a(window).on("load",function(){a('[data-ride="carousel"]').each(function(){var b=a(this);b.carousel(b.data())})})}(jQuery),+function(a){"use strict";var b=function(c,d){this.$element=a(c),this.options=a.extend({},b.DEFAULTS,d),this.transitioning=null,this.options.parent&&(this.$parent=a(this.options.parent)),this.options.toggle&&this.toggle()};b.DEFAULTS={toggle:!0},b.prototype.dimension=function(){var a=this.$element.hasClass("width");return a?"width":"height"},b.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var b=a.Event("show.bs.collapse");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.$parent&&this.$parent.find("> .panel > .in");if(c&&c.length){var d=c.data("bs.collapse");if(d&&d.transitioning)return;c.collapse("hide"),d||c.data("bs.collapse",null)}var e=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[e](0),this.transitioning=1;var f=function(){this.$element.removeClass("collapsing").addClass("in")[e]("auto"),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!a.support.transition)return f.call(this);var g=a.camelCase(["scroll",e].join("-"));this.$element.one(a.support.transition.end,a.proxy(f,this)).emulateTransitionEnd(350)[e](this.$element[0][g])}}},b.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").removeClass("in"),this.transitioning=1;var d=function(){this.transitioning=0,this.$element.trigger("hidden.bs.collapse").removeClass("collapsing").addClass("collapse")};return a.support.transition?(this.$element[c](0).one(a.support.transition.end,a.proxy(d,this)).emulateTransitionEnd(350),void 0):d.call(this)}}},b.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()};var c=a.fn.collapse;a.fn.collapse=function(c){return this.each(function(){var d=a(this),e=d.data("bs.collapse"),f=a.extend({},b.DEFAULTS,d.data(),"object"==typeof c&&c);e||d.data("bs.collapse",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.collapse.Constructor=b,a.fn.collapse.noConflict=function(){return a.fn.collapse=c,this},a(document).on("click.bs.collapse.data-api","[data-toggle=collapse]",function(b){var c,d=a(this),e=d.attr("data-target")||b.preventDefault()||(c=d.attr("href"))&&c.replace(/.*(?=#[^\s]+$)/,""),f=a(e),g=f.data("bs.collapse"),h=g?"toggle":d.data(),i=d.attr("data-parent"),j=i&&a(i);g&&g.transitioning||(j&&j.find('[data-toggle=collapse][data-parent="'+i+'"]').not(d).addClass("collapsed"),d[f.hasClass("in")?"addClass":"removeClass"]("collapsed")),f.collapse(h)})}(jQuery),+function(a){"use strict";function b(){a(d).remove(),a(e).each(function(b){var d=c(a(this));d.hasClass("open")&&(d.trigger(b=a.Event("hide.bs.dropdown")),b.isDefaultPrevented()||d.removeClass("open").trigger("hidden.bs.dropdown"))})}function c(b){var c=b.attr("data-target");c||(c=b.attr("href"),c=c&&/#/.test(c)&&c.replace(/.*(?=#[^\s]*$)/,""));var d=c&&a(c);return d&&d.length?d:b.parent()}var d=".dropdown-backdrop",e="[data-toggle=dropdown]",f=function(b){a(b).on("click.bs.dropdown",this.toggle)};f.prototype.toggle=function(d){var e=a(this);if(!e.is(".disabled, :disabled")){var f=c(e),g=f.hasClass("open");if(b(),!g){if("ontouchstart"in document.documentElement&&!f.closest(".navbar-nav").length&&a(''}),b.prototype=a.extend({},a.fn.tooltip.Constructor.prototype),b.prototype.constructor=b,b.prototype.getDefaults=function(){return b.DEFAULTS},b.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")[this.options.html?"html":"text"](c),a.removeClass("fade top bottom left right in"),a.find(".popover-title").html()||a.find(".popover-title").hide()},b.prototype.hasContent=function(){return this.getTitle()||this.getContent()},b.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)},b.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")},b.prototype.tip=function(){return this.$tip||(this.$tip=a(this.options.template)),this.$tip};var c=a.fn.popover;a.fn.popover=function(c){return this.each(function(){var d=a(this),e=d.data("bs.popover"),f="object"==typeof c&&c;e||d.data("bs.popover",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.popover.Constructor=b,a.fn.popover.noConflict=function(){return a.fn.popover=c,this}}(jQuery),+function(a){"use strict";function b(c,d){var e,f=a.proxy(this.process,this);this.$element=a(c).is("body")?a(window):a(c),this.$body=a("body"),this.$scrollElement=this.$element.on("scroll.bs.scroll-spy.data-api",f),this.options=a.extend({},b.DEFAULTS,d),this.selector=(this.options.target||(e=a(c).attr("href"))&&e.replace(/.*(?=#[^\s]+$)/,"")||"")+" .nav li > a",this.offsets=a([]),this.targets=a([]),this.activeTarget=null,this.refresh(),this.process()}b.DEFAULTS={offset:10},b.prototype.refresh=function(){var b=this.$element[0]==window?"offset":"position";this.offsets=a([]),this.targets=a([]);var c=this;this.$body.find(this.selector).map(function(){var d=a(this),e=d.data("target")||d.attr("href"),f=/^#\w/.test(e)&&a(e);return f&&f.length&&[[f[b]().top+(!a.isWindow(c.$scrollElement.get(0))&&c.$scrollElement.scrollTop()),e]]||null}).sort(function(a,b){return a[0]-b[0]}).each(function(){c.offsets.push(this[0]),c.targets.push(this[1])})},b.prototype.process=function(){var a,b=this.$scrollElement.scrollTop()+this.options.offset,c=this.$scrollElement[0].scrollHeight||this.$body[0].scrollHeight,d=c-this.$scrollElement.height(),e=this.offsets,f=this.targets,g=this.activeTarget;if(b>=d)return g!=(a=f.last()[0])&&this.activate(a);for(a=e.length;a--;)g!=f[a]&&b>=e[a]&&(!e[a+1]||b<=e[a+1])&&this.activate(f[a])},b.prototype.activate=function(b){this.activeTarget=b,a(this.selector).parents(".active").removeClass("active");var c=this.selector+'[data-target="'+b+'"],'+this.selector+'[href="'+b+'"]',d=a(c).parents("li").addClass("active");d.parent(".dropdown-menu").length&&(d=d.closest("li.dropdown").addClass("active")),d.trigger("activate.bs.scrollspy")};var c=a.fn.scrollspy;a.fn.scrollspy=function(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]()})},a.fn.scrollspy.Constructor=b,a.fn.scrollspy.noConflict=function(){return a.fn.scrollspy=c,this},a(window).on("load",function(){a('[data-spy="scroll"]').each(function(){var b=a(this);b.scrollspy(b.data())})})}(jQuery),+function(a){"use strict";var b=function(b){this.element=a(b)};b.prototype.show=function(){var b=this.element,c=b.closest("ul:not(.dropdown-menu)"),d=b.data("target");if(d||(d=b.attr("href"),d=d&&d.replace(/.*(?=#[^\s]*$)/,"")),!b.parent("li").hasClass("active")){var e=c.find(".active:last a")[0],f=a.Event("show.bs.tab",{relatedTarget:e});if(b.trigger(f),!f.isDefaultPrevented()){var g=a(d);this.activate(b.parent("li"),c),this.activate(g,g.parent(),function(){b.trigger({type:"shown.bs.tab",relatedTarget:e})})}}},b.prototype.activate=function(b,c,d){function e(){f.removeClass("active").find("> .dropdown-menu > .active").removeClass("active"),b.addClass("active"),g?(b[0].offsetWidth,b.addClass("in")):b.removeClass("fade"),b.parent(".dropdown-menu")&&b.closest("li.dropdown").addClass("active"),d&&d()}var f=c.find("> .active"),g=d&&a.support.transition&&f.hasClass("fade");g?f.one(a.support.transition.end,e).emulateTransitionEnd(150):e(),f.removeClass("in")};var c=a.fn.tab;a.fn.tab=function(c){return this.each(function(){var d=a(this),e=d.data("bs.tab");e||d.data("bs.tab",e=new b(this)),"string"==typeof c&&e[c]()})},a.fn.tab.Constructor=b,a.fn.tab.noConflict=function(){return a.fn.tab=c,this},a(document).on("click.bs.tab.data-api",'[data-toggle="tab"], [data-toggle="pill"]',function(b){b.preventDefault(),a(this).tab("show")})}(jQuery),+function(a){"use strict";var b=function(c,d){this.options=a.extend({},b.DEFAULTS,d),this.$window=a(window).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(c),this.affixed=this.unpin=null,this.checkPosition()};b.RESET="affix affix-top affix-bottom",b.DEFAULTS={offset:0},b.prototype.checkPositionWithEventLoop=function(){setTimeout(a.proxy(this.checkPosition,this),1)},b.prototype.checkPosition=function(){if(this.$element.is(":visible")){var c=a(document).height(),d=this.$window.scrollTop(),e=this.$element.offset(),f=this.options.offset,g=f.top,h=f.bottom;"object"!=typeof f&&(h=g=f),"function"==typeof g&&(g=f.top()),"function"==typeof h&&(h=f.bottom());var i=null!=this.unpin&&d+this.unpin<=e.top?!1:null!=h&&e.top+this.$element.height()>=c-h?"bottom":null!=g&&g>=d?"top":!1;this.affixed!==i&&(this.unpin&&this.$element.css("top",""),this.affixed=i,this.unpin="bottom"==i?e.top-d:null,this.$element.removeClass(b.RESET).addClass("affix"+(i?"-"+i:"")),"bottom"==i&&this.$element.offset({top:document.body.offsetHeight-h-this.$element.height()}))}};var c=a.fn.affix;a.fn.affix=function(c){return this.each(function(){var d=a(this),e=d.data("bs.affix"),f="object"==typeof c&&c;e||d.data("bs.affix",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.affix.Constructor=b,a.fn.affix.noConflict=function(){return a.fn.affix=c,this},a(window).on("load",function(){a('[data-spy="affix"]').each(function(){var b=a(this),c=b.data();c.offset=c.offset||{},c.offsetBottom&&(c.offset.bottom=c.offsetBottom),c.offsetTop&&(c.offset.top=c.offsetTop),b.affix(c)})})}(jQuery); \ No newline at end of file +if("undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");+function(a){var b=a.fn.jquery.split(" ")[0].split(".");if(b[0]<2&&b[1]<9||1==b[0]&&9==b[1]&&b[2]<1)throw new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher")}(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){return a(b.target).is(this)?b.handleObj.handler.apply(this,arguments):void 0}})})}(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.1",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);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.1",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)):this.isLoading&&(this.isLoading=!1,d.removeClass(c).removeAttr(c))},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")&&this.$element.hasClass("active")?a=!1:b.find(".active").removeClass("active")),a&&c.prop("checked",!this.$element.hasClass("active")).trigger("change")}else this.$element.attr("aria-pressed",!this.$element.hasClass("active"));a&&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);d.hasClass("btn")||(d=d.closest(".btn")),b.call(d,"toggle"),c.preventDefault()}).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=this.sliding=this.interval=this.$active=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.1",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="prev"==a?-1:1,d=this.getItemIndex(b),e=(d+c)%this.$items.length;return this.$items.eq(e)},c.prototype.to=function(a){var b=this,c=this.getItemIndex(this.$active=this.$element.find(".item.active"));return a>this.$items.length-1||0>a?void 0: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(){return this.sliding?void 0:this.slide("next")},c.prototype.prev=function(){return this.sliding?void 0: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="next"==b?"first":"last",j=this;if(!f.length){if(!this.options.wrap)return;f=this.$element.find(".item")[i]()}if(f.hasClass("active"))return this.sliding=!1;var k=f[0],l=a.Event("slide.bs.carousel",{relatedTarget:k,direction:h});if(this.$element.trigger(l),!l.isDefaultPrevented()){if(this.sliding=!0,g&&this.pause(),this.$indicators.length){this.$indicators.find(".active").removeClass("active");var m=a(this.$indicators.children()[this.getItemIndex(f)]);m&&m.addClass("active")}var n=a.Event("slid.bs.carousel",{relatedTarget:k,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(" ")),j.sliding=!1,setTimeout(function(){j.$element.trigger(n)},0)}).emulateTransitionEnd(c.TRANSITION_DURATION)):(e.removeClass("active"),f.addClass("active"),this.sliding=!1,this.$element.trigger(n)),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"==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(this.options.trigger).filter('[href="#'+b.id+'"], [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.1",d.TRANSITION_DURATION=350,d.DEFAULTS={toggle:!0,trigger:'[data-toggle="collapse"]'},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.find("> .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":a.extend({},e.data(),{trigger:this});c.call(f,h)})}(jQuery),+function(a){"use strict";function b(b){b&&3===b.which||(a(e).remove(),a(f).each(function(){var d=a(this),e=c(d),f={relatedTarget:this};e.hasClass("open")&&(e.trigger(b=a.Event("hide.bs.dropdown",f)),b.isDefaultPrevented()||(d.attr("aria-expanded","false"),e.removeClass("open").trigger("hidden.bs.dropdown",f)))}))}function c(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 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.1",g.prototype.toggle=function(d){var e=a(this);if(!e.is(".disabled, :disabled")){var f=c(e),g=f.hasClass("open");if(b(),!g){"ontouchstart"in document.documentElement&&!f.closest(".navbar-nav").length&&a('