forked from TheBronx/shurscript
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathshurscript.user.js
43 lines (43 loc) · 251 KB
/
shurscript.user.js
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// Shur Scripts SA
// GPLv2 Licensed
// http://www.gnu.org/licenses/gpl-2.0.html
//
// ==UserScript==
// @name ShurScript
// @description Script para ForoCoches
// @namespace http://shurscript.es
// @version 0.20.6.1
// @author TheBronx
// @author xusO
// @author Fritanga / Korrosivo
// @author Juno / ikaros45
// @author Electrosa
// @include http://www.forocoches.com*
// @include http://forocoches.com*
// @grant GM_log
// @grant GM_getValue
// @grant GM_setValue
// @grant GM_deleteValue
// @grant GM_xmlhttpRequest
// @grant GM_registerMenuCommand
// @grant GM_addStyle
// @grant GM_getResourceText
// @grant GM_getResourceURL
// @grant GM_getMetadata
// @run-at document-end
// @resource bootstrapcss https://github.com/TheBronx/shurscript/raw/master/css/bootstrap.css
// @resource modalcss https://github.com/TheBronx/shurscript/raw/master/css/modal.css
// @resource shurbarcss https://github.com/TheBronx/shurscript/raw/master/css/shurbar.css
// @resource modalhtml https://github.com/TheBronx/shurscript/raw/master/html/modal.html
// @resource quotehtml https://github.com/TheBronx/shurscript/raw/master/html/quote.html
// @resource imageuploadercss https://github.com/TheBronx/shurscript/raw/master/css/imageuploader.css
// @resource imageuploaderhtml https://github.com/TheBronx/shurscript/raw/master/html/imageuploader.html
// ==/UserScript==
if(function(){var e=this,t=e._,n={},i=Array.prototype,r=Object.prototype,o=Function.prototype,a=i.push,s=i.slice,l=i.concat,c=r.toString,u=r.hasOwnProperty,d=i.forEach,p=i.map,f=i.reduce,h=i.reduceRight,m=i.filter,g=i.every,v=i.some,y=i.indexOf,b=i.lastIndexOf,x=Array.isArray,w=Object.keys,k=o.bind,T=function(e){return e instanceof T?e:this instanceof T?void(this._wrapped=e):new T(e)};"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=T),exports._=T):e._=T,T.VERSION="1.6.0";var C=T.each=T.forEach=function(e,t,i){if(null==e)return e;if(d&&e.forEach===d)e.forEach(t,i);else if(e.length===+e.length){for(var r=0,o=e.length;o>r;r++)if(t.call(i,e[r],r,e)===n)return}else for(var a=T.keys(e),r=0,o=a.length;o>r;r++)if(t.call(i,e[a[r]],a[r],e)===n)return;return e};T.map=T.collect=function(e,t,n){var i=[];return null==e?i:p&&e.map===p?e.map(t,n):(C(e,function(e,r,o){i.push(t.call(n,e,r,o))}),i)};var S="Reduce of empty array with no initial value";T.reduce=T.foldl=T.inject=function(e,t,n,i){var r=arguments.length>2;if(null==e&&(e=[]),f&&e.reduce===f)return i&&(t=T.bind(t,i)),r?e.reduce(t,n):e.reduce(t);if(C(e,function(e,o,a){r?n=t.call(i,n,e,o,a):(n=e,r=!0)}),!r)throw new TypeError(S);return n},T.reduceRight=T.foldr=function(e,t,n,i){var r=arguments.length>2;if(null==e&&(e=[]),h&&e.reduceRight===h)return i&&(t=T.bind(t,i)),r?e.reduceRight(t,n):e.reduceRight(t);var o=e.length;if(o!==+o){var a=T.keys(e);o=a.length}if(C(e,function(s,l,c){l=a?a[--o]:--o,r?n=t.call(i,n,e[l],l,c):(n=e[l],r=!0)}),!r)throw new TypeError(S);return n},T.find=T.detect=function(e,t,n){var i;return E(e,function(e,r,o){return t.call(n,e,r,o)?(i=e,!0):void 0}),i},T.filter=T.select=function(e,t,n){var i=[];return null==e?i:m&&e.filter===m?e.filter(t,n):(C(e,function(e,r,o){t.call(n,e,r,o)&&i.push(e)}),i)},T.reject=function(e,t,n){return T.filter(e,function(e,i,r){return!t.call(n,e,i,r)},n)},T.every=T.all=function(e,t,i){t||(t=T.identity);var r=!0;return null==e?r:g&&e.every===g?e.every(t,i):(C(e,function(e,o,a){return(r=r&&t.call(i,e,o,a))?void 0:n}),!!r)};var E=T.some=T.any=function(e,t,i){t||(t=T.identity);var r=!1;return null==e?r:v&&e.some===v?e.some(t,i):(C(e,function(e,o,a){return r||(r=t.call(i,e,o,a))?n:void 0}),!!r)};T.contains=T.include=function(e,t){return null==e?!1:y&&e.indexOf===y?-1!=e.indexOf(t):E(e,function(e){return e===t})},T.invoke=function(e,t){var n=s.call(arguments,2),i=T.isFunction(t);return T.map(e,function(e){return(i?t:e[t]).apply(e,n)})},T.pluck=function(e,t){return T.map(e,T.property(t))},T.where=function(e,t){return T.filter(e,T.matches(t))},T.findWhere=function(e,t){return T.find(e,T.matches(t))},T.max=function(e,t,n){if(!t&&T.isArray(e)&&e[0]===+e[0]&&65535>e.length)return Math.max.apply(Math,e);var i=-1/0,r=-1/0;return C(e,function(e,o,a){var s=t?t.call(n,e,o,a):e;s>r&&(i=e,r=s)}),i},T.min=function(e,t,n){if(!t&&T.isArray(e)&&e[0]===+e[0]&&65535>e.length)return Math.min.apply(Math,e);var i=1/0,r=1/0;return C(e,function(e,o,a){var s=t?t.call(n,e,o,a):e;r>s&&(i=e,r=s)}),i},T.shuffle=function(e){var t,n=0,i=[];return C(e,function(e){t=T.random(n++),i[n-1]=i[t],i[t]=e}),i},T.sample=function(e,t,n){return null==t||n?(e.length!==+e.length&&(e=T.values(e)),e[T.random(e.length-1)]):T.shuffle(e).slice(0,Math.max(0,t))};var _=function(e){return null==e?T.identity:T.isFunction(e)?e:T.property(e)};T.sortBy=function(e,t,n){return t=_(t),T.pluck(T.map(e,function(e,i,r){return{value:e,index:i,criteria:t.call(n,e,i,r)}}).sort(function(e,t){var n=e.criteria,i=t.criteria;if(n!==i){if(n>i||void 0===n)return 1;if(i>n||void 0===i)return-1}return e.index-t.index}),"value")};var $=function(e){return function(t,n,i){var r={};return n=_(n),C(t,function(o,a){var s=n.call(i,o,a,t);e(r,s,o)}),r}};T.groupBy=$(function(e,t,n){T.has(e,t)?e[t].push(n):e[t]=[n]}),T.indexBy=$(function(e,t,n){e[t]=n}),T.countBy=$(function(e,t){T.has(e,t)?e[t]++:e[t]=1}),T.sortedIndex=function(e,t,n,i){n=_(n);for(var r=n.call(i,t),o=0,a=e.length;a>o;){var s=o+a>>>1;r>n.call(i,e[s])?o=s+1:a=s}return o},T.toArray=function(e){return e?T.isArray(e)?s.call(e):e.length===+e.length?T.map(e,T.identity):T.values(e):[]},T.size=function(e){return null==e?0:e.length===+e.length?e.length:T.keys(e).length},T.first=T.head=T.take=function(e,t,n){return null==e?void 0:null==t||n?e[0]:0>t?[]:s.call(e,0,t)},T.initial=function(e,t,n){return s.call(e,0,e.length-(null==t||n?1:t))},T.last=function(e,t,n){return null==e?void 0:null==t||n?e[e.length-1]:s.call(e,Math.max(e.length-t,0))},T.rest=T.tail=T.drop=function(e,t,n){return s.call(e,null==t||n?1:t)},T.compact=function(e){return T.filter(e,T.identity)};var A=function(e,t,n){return t&&T.every(e,T.isArray)?l.apply(n,e):(C(e,function(e){T.isArray(e)||T.isArguments(e)?t?a.apply(n,e):A(e,t,n):n.push(e)}),n)};T.flatten=function(e,t){return A(e,t,[])},T.without=function(e){return T.difference(e,s.call(arguments,1))},T.partition=function(e,t){var n=[],i=[];return C(e,function(e){(t(e)?n:i).push(e)}),[n,i]},T.uniq=T.unique=function(e,t,n,i){T.isFunction(t)&&(i=n,n=t,t=!1);var r=n?T.map(e,n,i):e,o=[],a=[];return C(r,function(n,i){(t?i&&a[a.length-1]===n:T.contains(a,n))||(a.push(n),o.push(e[i]))}),o},T.union=function(){return T.uniq(T.flatten(arguments,!0))},T.intersection=function(e){var t=s.call(arguments,1);return T.filter(T.uniq(e),function(e){return T.every(t,function(t){return T.contains(t,e)})})},T.difference=function(e){var t=l.apply(i,s.call(arguments,1));return T.filter(e,function(e){return!T.contains(t,e)})},T.zip=function(){for(var e=T.max(T.pluck(arguments,"length").concat(0)),t=Array(e),n=0;e>n;n++)t[n]=T.pluck(arguments,""+n);return t},T.object=function(e,t){if(null==e)return{};for(var n={},i=0,r=e.length;r>i;i++)t?n[e[i]]=t[i]:n[e[i][0]]=e[i][1];return n},T.indexOf=function(e,t,n){if(null==e)return-1;var i=0,r=e.length;if(n){if("number"!=typeof n)return i=T.sortedIndex(e,t),e[i]===t?i:-1;i=0>n?Math.max(0,r+n):n}if(y&&e.indexOf===y)return e.indexOf(t,n);for(;r>i;i++)if(e[i]===t)return i;return-1},T.lastIndexOf=function(e,t,n){if(null==e)return-1;var i=null!=n;if(b&&e.lastIndexOf===b)return i?e.lastIndexOf(t,n):e.lastIndexOf(t);for(var r=i?n:e.length;r--;)if(e[r]===t)return r;return-1},T.range=function(e,t,n){1>=arguments.length&&(t=e||0,e=0),n=arguments[2]||1;for(var i=Math.max(Math.ceil((t-e)/n),0),r=0,o=Array(i);i>r;)o[r++]=e,e+=n;return o};var N=function(){};T.bind=function(e,t){var n,i;if(k&&e.bind===k)return k.apply(e,s.call(arguments,1));if(!T.isFunction(e))throw new TypeError;return n=s.call(arguments,2),i=function(){if(!(this instanceof i))return e.apply(t,n.concat(s.call(arguments)));N.prototype=e.prototype;var r=new N;N.prototype=null;var o=e.apply(r,n.concat(s.call(arguments)));return Object(o)===o?o:r}},T.partial=function(e){var t=s.call(arguments,1);return function(){for(var n=0,i=t.slice(),r=0,o=i.length;o>r;r++)i[r]===T&&(i[r]=arguments[n++]);for(;arguments.length>n;)i.push(arguments[n++]);return e.apply(this,i)}},T.bindAll=function(e){var t=s.call(arguments,1);if(0===t.length)throw Error("bindAll must be passed function names");return C(t,function(t){e[t]=T.bind(e[t],e)}),e},T.memoize=function(e,t){var n={};return t||(t=T.identity),function(){var i=t.apply(this,arguments);return T.has(n,i)?n[i]:n[i]=e.apply(this,arguments)}},T.delay=function(e,t){var n=s.call(arguments,2);return setTimeout(function(){return e.apply(null,n)},t)},T.defer=function(e){return T.delay.apply(T,[e,1].concat(s.call(arguments,1)))},T.throttle=function(e,t,n){var i,r,o,a=null,s=0;n||(n={});var l=function(){s=n.leading===!1?0:T.now(),a=null,o=e.apply(i,r),i=r=null};return function(){var c=T.now();s||n.leading!==!1||(s=c);var u=t-(c-s);return i=this,r=arguments,0>=u?(clearTimeout(a),a=null,s=c,o=e.apply(i,r),i=r=null):a||n.trailing===!1||(a=setTimeout(l,u)),o}},T.debounce=function(e,t,n){var i,r,o,a,s,l=function(){var c=T.now()-a;t>c?i=setTimeout(l,t-c):(i=null,n||(s=e.apply(o,r),o=r=null))};return function(){o=this,r=arguments,a=T.now();var c=n&&!i;return i||(i=setTimeout(l,t)),c&&(s=e.apply(o,r),o=r=null),s}},T.once=function(e){var t,n=!1;return function(){return n?t:(n=!0,t=e.apply(this,arguments),e=null,t)}},T.wrap=function(e,t){return T.partial(t,e)},T.compose=function(){var e=arguments;return function(){for(var t=arguments,n=e.length-1;n>=0;n--)t=[e[n].apply(this,t)];return t[0]}},T.after=function(e,t){return function(){return 1>--e?t.apply(this,arguments):void 0}},T.keys=function(e){if(!T.isObject(e))return[];if(w)return w(e);var t=[];for(var n in e)T.has(e,n)&&t.push(n);return t},T.values=function(e){for(var t=T.keys(e),n=t.length,i=Array(n),r=0;n>r;r++)i[r]=e[t[r]];return i},T.pairs=function(e){for(var t=T.keys(e),n=t.length,i=Array(n),r=0;n>r;r++)i[r]=[t[r],e[t[r]]];return i},T.invert=function(e){for(var t={},n=T.keys(e),i=0,r=n.length;r>i;i++)t[e[n[i]]]=n[i];return t},T.functions=T.methods=function(e){var t=[];for(var n in e)T.isFunction(e[n])&&t.push(n);return t.sort()},T.extend=function(e){return C(s.call(arguments,1),function(t){if(t)for(var n in t)e[n]=t[n]}),e},T.pick=function(e){var t={},n=l.apply(i,s.call(arguments,1));return C(n,function(n){n in e&&(t[n]=e[n])}),t},T.omit=function(e){var t={},n=l.apply(i,s.call(arguments,1));for(var r in e)T.contains(n,r)||(t[r]=e[r]);return t},T.defaults=function(e){return C(s.call(arguments,1),function(t){if(t)for(var n in t)void 0===e[n]&&(e[n]=t[n])}),e},T.clone=function(e){return T.isObject(e)?T.isArray(e)?e.slice():T.extend({},e):e},T.tap=function(e,t){return t(e),e};var R=function(e,t,n,i){if(e===t)return 0!==e||1/e==1/t;if(null==e||null==t)return e===t;e instanceof T&&(e=e._wrapped),t instanceof T&&(t=t._wrapped);var r=c.call(e);if(r!=c.call(t))return!1;switch(r){case"[object String]":return e==t+"";case"[object Number]":return e!=+e?t!=+t:0==e?1/e==1/t:e==+t;case"[object Date]":case"[object Boolean]":return+e==+t;case"[object RegExp]":return e.source==t.source&&e.global==t.global&&e.multiline==t.multiline&&e.ignoreCase==t.ignoreCase}if("object"!=typeof e||"object"!=typeof t)return!1;for(var o=n.length;o--;)if(n[o]==e)return i[o]==t;var a=e.constructor,s=t.constructor;if(a!==s&&!(T.isFunction(a)&&a instanceof a&&T.isFunction(s)&&s instanceof s)&&"constructor"in e&&"constructor"in t)return!1;n.push(e),i.push(t);var l=0,u=!0;if("[object Array]"==r){if(l=e.length,u=l==t.length)for(;l--&&(u=R(e[l],t[l],n,i)););}else{for(var d in e)if(T.has(e,d)&&(l++,!(u=T.has(t,d)&&R(e[d],t[d],n,i))))break;if(u){for(d in t)if(T.has(t,d)&&!l--)break;u=!l}}return n.pop(),i.pop(),u};T.isEqual=function(e,t){return R(e,t,[],[])},T.isEmpty=function(e){if(null==e)return!0;if(T.isArray(e)||T.isString(e))return 0===e.length;for(var t in e)if(T.has(e,t))return!1;return!0},T.isElement=function(e){return!(!e||1!==e.nodeType)},T.isArray=x||function(e){return"[object Array]"==c.call(e)},T.isObject=function(e){return e===Object(e)},C(["Arguments","Function","String","Number","Date","RegExp"],function(e){T["is"+e]=function(t){return c.call(t)=="[object "+e+"]"}}),T.isArguments(arguments)||(T.isArguments=function(e){return!(!e||!T.has(e,"callee"))}),true&&(T.isFunction=function(e){return"function"==typeof e}),T.isFinite=function(e){return isFinite(e)&&!isNaN(parseFloat(e))},T.isNaN=function(e){return T.isNumber(e)&&e!=+e},T.isBoolean=function(e){return e===!0||e===!1||"[object Boolean]"==c.call(e)},T.isNull=function(e){return null===e},T.isUndefined=function(e){return void 0===e},T.has=function(e,t){return u.call(e,t)},T.noConflict=function(){return e._=t,this},T.identity=function(e){return e},T.constant=function(e){return function(){return e}},T.property=function(e){return function(t){return t[e]}},T.matches=function(e){return function(t){if(t===e)return!0;for(var n in e)if(e[n]!==t[n])return!1;return!0}},T.times=function(e,t,n){for(var i=Array(Math.max(0,e)),r=0;e>r;r++)i[r]=t.call(n,r);return i},T.random=function(e,t){return null==t&&(t=e,e=0),e+Math.floor(Math.random()*(t-e+1))},T.now=Date.now||function(){return(new Date).getTime()};var O={escape:{"&":"&","<":"<",">":">",'"':""","'":"'"}};O.unescape=T.invert(O.escape);var L={escape:RegExp("["+T.keys(O.escape).join("")+"]","g"),unescape:RegExp("("+T.keys(O.unescape).join("|")+")","g")};T.each(["escape","unescape"],function(e){T[e]=function(t){return null==t?"":(""+t).replace(L[e],function(t){return O[e][t]})}}),T.result=function(e,t){if(null==e)return void 0;var n=e[t];return T.isFunction(n)?n.call(e):n},T.mixin=function(e){C(T.functions(e),function(t){var n=T[t]=e[t];T.prototype[t]=function(){var e=[this._wrapped];return a.apply(e,arguments),I.call(this,n.apply(T,e))}})};var M=0;T.uniqueId=function(e){var t=++M+"";return e?e+t:t},T.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var D=/(.)^/,j={"'":"'","\\":"\\","\r":"r","\n":"n"," ":"t","\u2028":"u2028","\u2029":"u2029"},P=/\\|'|\r|\n|\t|\u2028|\u2029/g;T.template=function(e,t,n){var i;n=T.defaults({},n,T.templateSettings);var r=RegExp([(n.escape||D).source,(n.interpolate||D).source,(n.evaluate||D).source].join("|")+"|$","g"),o=0,a="__p+='";e.replace(r,function(t,n,i,r,s){return a+=e.slice(o,s).replace(P,function(e){return"\\"+j[e]}),n&&(a+="'+\n((__t=("+n+"))==null?'':_.escape(__t))+\n'"),i&&(a+="'+\n((__t=("+i+"))==null?'':__t)+\n'"),r&&(a+="';\n"+r+"\n__p+='"),o=s+t.length,t}),a+="';\n",n.variable||(a="with(obj||{}){\n"+a+"}\n"),a="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+a+"return __p;\n";try{i=Function(n.variable||"obj","_",a)}catch(s){throw s.source=a,s}if(t)return i(t,T);var l=function(e){return i.call(this,e,T)};return l.source="function("+(n.variable||"obj")+"){\n"+a+"}",l},T.chain=function(e){return T(e).chain()};var I=function(e){return this._chain?T(e).chain():e};T.mixin(T),C(["pop","push","reverse","shift","sort","splice","unshift"],function(e){var t=i[e];T.prototype[e]=function(){var n=this._wrapped;return t.apply(n,arguments),"shift"!=e&&"splice"!=e||0!==n.length||delete n[0],I.call(this,n)}}),C(["concat","join","slice"],function(e){var t=i[e];T.prototype[e]=function(){return I.call(this,t.apply(this._wrapped,arguments))}}),T.extend(T.prototype,{chain:function(){return this._chain=!0,this},value:function(){return this._wrapped}}),"function"==typeof define&&define.amd&&define("underscore",[],function(){return T})}.call(this),function(e,t){function n(e){var t=e.length,n=ot.type(e);return ot.isWindow(e)?!1:1===e.nodeType&&t?!0:"array"===n||"function"!==n&&(0===t||"number"==typeof t&&t>0&&t-1 in e)}function i(e){var t=ht[e]={};return ot.each(e.match(st)||[],function(e,n){t[n]=!0}),t}function r(){Object.defineProperty(this.cache={},0,{get:function(){return{}}}),this.expando=ot.expando+Math.random()}function o(e,n,i){var r;if(i===t&&1===e.nodeType)if(r="data-"+n.replace(yt,"-$1").toLowerCase(),i=e.getAttribute(r),"string"==typeof i){try{i="true"===i?!0:"false"===i?!1:"null"===i?null:+i+""===i?+i:vt.test(i)?JSON.parse(i):i}catch(o){}mt.set(e,n,i)}else i=t;return i}function a(){return!0}function s(){return!1}function l(){try{return W.activeElement}catch(e){}}function c(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}function u(e,t,n){if(ot.isFunction(t))return ot.grep(e,function(e,i){return!!t.call(e,i,e)!==n});if(t.nodeType)return ot.grep(e,function(e){return e===t!==n});if("string"==typeof t){if($t.test(t))return ot.filter(t,e,n);t=ot.filter(t,e)}return ot.grep(e,function(e){return tt.call(t,e)>=0!==n})}function d(e,t){return ot.nodeName(e,"table")&&ot.nodeName(1===t.nodeType?t:t.firstChild,"tr")?e.getElementsByTagName("tbody")[0]||e.appendChild(e.ownerDocument.createElement("tbody")):e}function p(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function f(e){var t=Ht.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function h(e,t){for(var n=e.length,i=0;n>i;i++)gt.set(e[i],"globalEval",!t||gt.get(t[i],"globalEval"))}function m(e,t){var n,i,r,o,a,s,l,c;if(1===t.nodeType){if(gt.hasData(e)&&(o=gt.access(e),a=gt.set(t,o),c=o.events)){delete a.handle,a.events={};for(r in c)for(n=0,i=c[r].length;i>n;n++)ot.event.add(t,r,c[r][n])}mt.hasData(e)&&(s=mt.access(e),l=ot.extend({},s),mt.set(t,l))}}function g(e,n){var i=e.getElementsByTagName?e.getElementsByTagName(n||"*"):e.querySelectorAll?e.querySelectorAll(n||"*"):[];return n===t||n&&ot.nodeName(e,n)?ot.merge([e],i):i}function v(e,t){var n=t.nodeName.toLowerCase();"input"===n&&jt.test(e.type)?t.checked=e.checked:("input"===n||"textarea"===n)&&(t.defaultValue=e.defaultValue)}function y(e,t){if(t in e)return t;for(var n=t.charAt(0).toUpperCase()+t.slice(1),i=t,r=Zt.length;r--;)if(t=Zt[r]+n,t in e)return t;return i}function b(e,t){return e=t||e,"none"===ot.css(e,"display")||!ot.contains(e.ownerDocument,e)}function x(t){return e.getComputedStyle(t,null)}function w(e,t){for(var n,i,r,o=[],a=0,s=e.length;s>a;a++)i=e[a],i.style&&(o[a]=gt.get(i,"olddisplay"),n=i.style.display,t?(o[a]||"none"!==n||(i.style.display=""),""===i.style.display&&b(i)&&(o[a]=gt.access(i,"olddisplay",S(i.nodeName)))):o[a]||(r=b(i),(n&&"none"!==n||!r)&>.set(i,"olddisplay",r?n:ot.css(i,"display"))));for(a=0;s>a;a++)i=e[a],i.style&&(t&&"none"!==i.style.display&&""!==i.style.display||(i.style.display=t?o[a]||"":"none"));return e}function k(e,t,n){var i=Gt.exec(t);return i?Math.max(0,i[1]-(n||0))+(i[2]||"px"):t}function T(e,t,n,i,r){for(var o=n===(i?"border":"content")?4:"width"===t?1:0,a=0;4>o;o+=2)"margin"===n&&(a+=ot.css(e,n+Jt[o],!0,r)),i?("content"===n&&(a-=ot.css(e,"padding"+Jt[o],!0,r)),"margin"!==n&&(a-=ot.css(e,"border"+Jt[o]+"Width",!0,r))):(a+=ot.css(e,"padding"+Jt[o],!0,r),"padding"!==n&&(a+=ot.css(e,"border"+Jt[o]+"Width",!0,r)));return a}function C(e,t,n){var i=!0,r="width"===t?e.offsetWidth:e.offsetHeight,o=x(e),a=ot.support.boxSizing&&"border-box"===ot.css(e,"boxSizing",!1,o);if(0>=r||null==r){if(r=Bt(e,t,o),(0>r||null==r)&&(r=e.style[t]),Vt.test(r))return r;i=a&&(ot.support.boxSizingReliable||r===e.style[t]),r=parseFloat(r)||0}return r+T(e,t,n||(a?"border":"content"),i,o)+"px"}function S(e){var t=W,n=zt[e];return n||(n=E(e,t),"none"!==n&&n||(Ut=(Ut||ot("<iframe frameborder='0' width='0' height='0'/>").css("cssText","display:block !important")).appendTo(t.documentElement),t=(Ut[0].contentWindow||Ut[0].contentDocument).document,t.write("<!doctype html><html><body>"),t.close(),n=E(e,t),Ut.detach()),zt[e]=n),n}function E(e,t){var n=ot(t.createElement(e)).appendTo(t.body),i=ot.css(n[0],"display");return n.remove(),i}function _(e,t,n,i){var r;if(ot.isArray(t))ot.each(t,function(t,r){n||tn.test(e)?i(e,r):_(e+"["+("object"==typeof r?t:"")+"]",r,n,i)});else if(n||"object"!==ot.type(t))i(e,t);else for(r in t)_(e+"["+r+"]",t[r],n,i)}function $(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var i,r=0,o=t.toLowerCase().match(st)||[];if(ot.isFunction(n))for(;i=o[r++];)"+"===i[0]?(i=i.slice(1)||"*",(e[i]=e[i]||[]).unshift(n)):(e[i]=e[i]||[]).push(n)}}function A(e,n,i,r){function o(l){var c;return a[l]=!0,ot.each(e[l]||[],function(e,l){var u=l(n,i,r);return"string"!=typeof u||s||a[u]?s?!(c=u):t:(n.dataTypes.unshift(u),o(u),!1)}),c}var a={},s=e===bn;return o(n.dataTypes[0])||!a["*"]&&o("*")}function N(e,n){var i,r,o=ot.ajaxSettings.flatOptions||{};for(i in n)n[i]!==t&&((o[i]?e:r||(r={}))[i]=n[i]);return r&&ot.extend(!0,e,r),e}function R(e,n,i){for(var r,o,a,s,l=e.contents,c=e.dataTypes;"*"===c[0];)c.shift(),r===t&&(r=e.mimeType||n.getResponseHeader("Content-Type"));if(r)for(o in l)if(l[o]&&l[o].test(r)){c.unshift(o);break}if(c[0]in i)a=c[0];else{for(o in i){if(!c[0]||e.converters[o+" "+c[0]]){a=o;break}s||(s=o)}a=a||s}return a?(a!==c[0]&&c.unshift(a),i[a]):t}function O(e,t,n,i){var r,o,a,s,l,c={},u=e.dataTypes.slice();if(u[1])for(a in e.converters)c[a.toLowerCase()]=e.converters[a];for(o=u.shift();o;)if(e.responseFields[o]&&(n[e.responseFields[o]]=t),!l&&i&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),l=o,o=u.shift())if("*"===o)o=l;else if("*"!==l&&l!==o){if(a=c[l+" "+o]||c["* "+o],!a)for(r in c)if(s=r.split(" "),s[1]===o&&(a=c[l+" "+s[0]]||c["* "+s[0]])){a===!0?a=c[r]:c[r]!==!0&&(o=s[0],u.unshift(s[1]));break}if(a!==!0)if(a&&e["throws"])t=a(t);else try{t=a(t)}catch(d){return{state:"parsererror",error:a?d:"No conversion from "+l+" to "+o}}}return{state:"success",data:t}}function L(){return setTimeout(function(){$n=t}),$n=ot.now()}function M(e,t,n){for(var i,r=(Mn[t]||[]).concat(Mn["*"]),o=0,a=r.length;a>o;o++)if(i=r[o].call(n,t,e))return i}function D(e,t,n){var i,r,o=0,a=Ln.length,s=ot.Deferred().always(function(){delete l.elem}),l=function(){if(r)return!1;for(var t=$n||L(),n=Math.max(0,c.startTime+c.duration-t),i=n/c.duration||0,o=1-i,a=0,l=c.tweens.length;l>a;a++)c.tweens[a].run(o);return s.notifyWith(e,[c,o,n]),1>o&&l?n:(s.resolveWith(e,[c]),!1)},c=s.promise({elem:e,props:ot.extend({},t),opts:ot.extend(!0,{specialEasing:{}},n),originalProperties:t,originalOptions:n,startTime:$n||L(),duration:n.duration,tweens:[],createTween:function(t,n){var i=ot.Tween(e,c.opts,t,n,c.opts.specialEasing[t]||c.opts.easing);return c.tweens.push(i),i},stop:function(t){var n=0,i=t?c.tweens.length:0;if(r)return this;for(r=!0;i>n;n++)c.tweens[n].run(1);return t?s.resolveWith(e,[c,t]):s.rejectWith(e,[c,t]),this}}),u=c.props;for(j(u,c.opts.specialEasing);a>o;o++)if(i=Ln[o].call(c,e,u,c.opts))return i;return ot.map(u,M,c),ot.isFunction(c.opts.start)&&c.opts.start.call(e,c),ot.fx.timer(ot.extend(l,{elem:e,anim:c,queue:c.opts.queue})),c.progress(c.opts.progress).done(c.opts.done,c.opts.complete).fail(c.opts.fail).always(c.opts.always)}function j(e,t){var n,i,r,o,a;for(n in e)if(i=ot.camelCase(n),r=t[i],o=e[n],ot.isArray(o)&&(r=o[1],o=e[n]=o[0]),n!==i&&(e[i]=o,delete e[n]),a=ot.cssHooks[i],a&&"expand"in a){o=a.expand(o),delete e[i];for(n in o)n in e||(e[n]=o[n],t[n]=r)}else t[i]=r}function P(e,n,i){var r,o,a,s,l,c,u=this,d={},p=e.style,f=e.nodeType&&b(e),h=gt.get(e,"fxshow");i.queue||(l=ot._queueHooks(e,"fx"),null==l.unqueued&&(l.unqueued=0,c=l.empty.fire,l.empty.fire=function(){l.unqueued||c()}),l.unqueued++,u.always(function(){u.always(function(){l.unqueued--,ot.queue(e,"fx").length||l.empty.fire()})})),1===e.nodeType&&("height"in n||"width"in n)&&(i.overflow=[p.overflow,p.overflowX,p.overflowY],"inline"===ot.css(e,"display")&&"none"===ot.css(e,"float")&&(p.display="inline-block")),i.overflow&&(p.overflow="hidden",u.always(function(){p.overflow=i.overflow[0],p.overflowX=i.overflow[1],p.overflowY=i.overflow[2]}));for(r in n)if(o=n[r],Nn.exec(o)){if(delete n[r],a=a||"toggle"===o,o===(f?"hide":"show")){if("show"!==o||!h||h[r]===t)continue;f=!0}d[r]=h&&h[r]||ot.style(e,r)}if(!ot.isEmptyObject(d)){h?"hidden"in h&&(f=h.hidden):h=gt.access(e,"fxshow",{}),a&&(h.hidden=!f),f?ot(e).show():u.done(function(){ot(e).hide()}),u.done(function(){var t;gt.remove(e,"fxshow");for(t in d)ot.style(e,t,d[t])});for(r in d)s=M(f?h[r]:0,r,u),r in h||(h[r]=s.start,f&&(s.end=s.start,s.start="width"===r||"height"===r?1:0))}}function I(e,t,n,i,r){return new I.prototype.init(e,t,n,i,r)}function H(e,t){var n,i={height:e},r=0;for(t=t?1:0;4>r;r+=2-t)n=Jt[r],i["margin"+n]=i["padding"+n]=e;return t&&(i.opacity=i.width=e),i}function q(e){return ot.isWindow(e)?e:9===e.nodeType&&e.defaultView}var F,B,U=typeof t,K=e.location,W=e.document,G=W.documentElement,V=e.jQuery,Q=e.$,z={},X=[],Y="2.0.3",J=X.concat,Z=X.push,et=X.slice,tt=X.indexOf,nt=z.toString,it=z.hasOwnProperty,rt=Y.trim,ot=function(e,t){return new ot.fn.init(e,t,F)},at=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,st=/\S+/g,lt=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,ct=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,ut=/^-ms-/,dt=/-([\da-z])/gi,pt=function(e,t){return t.toUpperCase()},ft=function(){W.removeEventListener("DOMContentLoaded",ft,!1),e.removeEventListener("load",ft,!1),ot.ready()};ot.fn=ot.prototype={jquery:Y,constructor:ot,init:function(e,n,i){var r,o;if(!e)return this;if("string"==typeof e){if(r="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&e.length>=3?[null,e,null]:lt.exec(e),!r||!r[1]&&n)return!n||n.jquery?(n||i).find(e):this.constructor(n).find(e);if(r[1]){if(n=n instanceof ot?n[0]:n,ot.merge(this,ot.parseHTML(r[1],n&&n.nodeType?n.ownerDocument||n:W,!0)),ct.test(r[1])&&ot.isPlainObject(n))for(r in n)ot.isFunction(this[r])?this[r](n[r]):this.attr(r,n[r]);return this}return o=W.getElementById(r[2]),o&&o.parentNode&&(this.length=1,this[0]=o),this.context=W,this.selector=e,this}return e.nodeType?(this.context=this[0]=e,this.length=1,this):ot.isFunction(e)?i.ready(e):(e.selector!==t&&(this.selector=e.selector,this.context=e.context),ot.makeArray(e,this))},selector:"",length:0,toArray:function(){return et.call(this)},get:function(e){return null==e?this.toArray():0>e?this[this.length+e]:this[e]},pushStack:function(e){var t=ot.merge(this.constructor(),e);return t.prevObject=this,t.context=this.context,t},each:function(e,t){return ot.each(this,e,t)},ready:function(e){return ot.ready.promise().done(e),this},slice:function(){return this.pushStack(et.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(0>e?t:0);return this.pushStack(n>=0&&t>n?[this[n]]:[])},map:function(e){return this.pushStack(ot.map(this,function(t,n){return e.call(t,n,t)}))},end:function(){return this.prevObject||this.constructor(null)},push:Z,sort:[].sort,splice:[].splice},ot.fn.init.prototype=ot.fn,ot.extend=ot.fn.extend=function(){var e,n,i,r,o,a,s=arguments[0]||{},l=1,c=arguments.length,u=!1;for("boolean"==typeof s&&(u=s,s=arguments[1]||{},l=2),"object"==typeof s||ot.isFunction(s)||(s={}),c===l&&(s=this,--l);c>l;l++)if(null!=(e=arguments[l]))for(n in e)i=s[n],r=e[n],s!==r&&(u&&r&&(ot.isPlainObject(r)||(o=ot.isArray(r)))?(o?(o=!1,a=i&&ot.isArray(i)?i:[]):a=i&&ot.isPlainObject(i)?i:{},s[n]=ot.extend(u,a,r)):r!==t&&(s[n]=r));return s},ot.extend({expando:"jQuery"+(Y+Math.random()).replace(/\D/g,""),noConflict:function(t){return e.$===ot&&(e.$=Q),t&&e.jQuery===ot&&(e.jQuery=V),ot},isReady:!1,readyWait:1,holdReady:function(e){e?ot.readyWait++:ot.ready(!0)},ready:function(e){(e===!0?--ot.readyWait:ot.isReady)||(ot.isReady=!0,e!==!0&&--ot.readyWait>0||(B.resolveWith(W,[ot]),ot.fn.trigger&&ot(W).trigger("ready").off("ready")))},isFunction:function(e){return"function"===ot.type(e)},isArray:Array.isArray,isWindow:function(e){return null!=e&&e===e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?z[nt.call(e)]||"object":typeof e},isPlainObject:function(e){if("object"!==ot.type(e)||e.nodeType||ot.isWindow(e))return!1;try{if(e.constructor&&!it.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(t){return!1}return!0},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},error:function(e){throw Error(e)},parseHTML:function(e,t,n){if(!e||"string"!=typeof e)return null;"boolean"==typeof t&&(n=t,t=!1),t=t||W;var i=ct.exec(e),r=!n&&[];return i?[t.createElement(i[1])]:(i=ot.buildFragment([e],t,r),r&&ot(r).remove(),ot.merge([],i.childNodes))},parseJSON:JSON.parse,parseXML:function(e){var n,i;if(!e||"string"!=typeof e)return null;try{i=new DOMParser,n=i.parseFromString(e,"text/xml")}catch(r){n=t}return(!n||n.getElementsByTagName("parsererror").length)&&ot.error("Invalid XML: "+e),n},noop:function(){},globalEval:function(e){var t,n=eval;e=ot.trim(e),e&&(1===e.indexOf("use strict")?(t=W.createElement("script"),t.text=e,W.head.appendChild(t).parentNode.removeChild(t)):n(e))},camelCase:function(e){return e.replace(ut,"ms-").replace(dt,pt)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,t,i){var r,o=0,a=e.length,s=n(e);if(i){if(s)for(;a>o&&(r=t.apply(e[o],i),r!==!1);o++);else for(o in e)if(r=t.apply(e[o],i),r===!1)break}else if(s)for(;a>o&&(r=t.call(e[o],o,e[o]),r!==!1);o++);else for(o in e)if(r=t.call(e[o],o,e[o]),r===!1)break;return e},trim:function(e){return null==e?"":rt.call(e)},makeArray:function(e,t){var i=t||[];return null!=e&&(n(Object(e))?ot.merge(i,"string"==typeof e?[e]:e):Z.call(i,e)),i},inArray:function(e,t,n){return null==t?-1:tt.call(t,e,n)},merge:function(e,n){var i=n.length,r=e.length,o=0;if("number"==typeof i)for(;i>o;o++)e[r++]=n[o];else for(;n[o]!==t;)e[r++]=n[o++];return e.length=r,e},grep:function(e,t,n){var i,r=[],o=0,a=e.length;for(n=!!n;a>o;o++)i=!!t(e[o],o),n!==i&&r.push(e[o]);return r},map:function(e,t,i){var r,o=0,a=e.length,s=n(e),l=[];if(s)for(;a>o;o++)r=t(e[o],o,i),null!=r&&(l[l.length]=r);else for(o in e)r=t(e[o],o,i),null!=r&&(l[l.length]=r);return J.apply([],l)},guid:1,proxy:function(e,n){var i,r,o;return"string"==typeof n&&(i=e[n],n=e,e=i),ot.isFunction(e)?(r=et.call(arguments,2),o=function(){return e.apply(n||this,r.concat(et.call(arguments)))},o.guid=e.guid=e.guid||ot.guid++,o):t},access:function(e,n,i,r,o,a,s){var l=0,c=e.length,u=null==i;if("object"===ot.type(i)){o=!0;for(l in i)ot.access(e,n,l,i[l],!0,a,s)}else if(r!==t&&(o=!0,ot.isFunction(r)||(s=!0),u&&(s?(n.call(e,r),n=null):(u=n,n=function(e,t,n){return u.call(ot(e),n)})),n))for(;c>l;l++)n(e[l],i,s?r:r.call(e[l],l,n(e[l],i)));return o?e:u?n.call(e):c?n(e[0],i):a},now:Date.now,swap:function(e,t,n,i){var r,o,a={};for(o in t)a[o]=e.style[o],e.style[o]=t[o];r=n.apply(e,i||[]);for(o in t)e.style[o]=a[o];return r}}),ot.ready.promise=function(t){return B||(B=ot.Deferred(),"complete"===W.readyState?setTimeout(ot.ready):(W.addEventListener("DOMContentLoaded",ft,!1),e.addEventListener("load",ft,!1))),B.promise(t)},ot.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(e,t){z["[object "+t+"]"]=t.toLowerCase()}),F=ot(W),function(e,t){function n(e,t,n,i){var r,o,a,s,l,c,u,d,h,m;if((t?t.ownerDocument||t:q)!==O&&R(t),t=t||O,n=n||[],!e||"string"!=typeof e)return n;if(1!==(s=t.nodeType)&&9!==s)return[];if(M&&!i){if(r=bt.exec(e))if(a=r[1]){if(9===s){if(o=t.getElementById(a),!o||!o.parentNode)return n;if(o.id===a)return n.push(o),n}else if(t.ownerDocument&&(o=t.ownerDocument.getElementById(a))&&I(t,o)&&o.id===a)return n.push(o),n}else{if(r[2])return et.apply(n,t.getElementsByTagName(e)),n;if((a=r[3])&&T.getElementsByClassName&&t.getElementsByClassName)return et.apply(n,t.getElementsByClassName(a)),n}if(T.qsa&&(!D||!D.test(e))){if(d=u=H,h=t,m=9===s&&e,1===s&&"object"!==t.nodeName.toLowerCase()){for(c=p(e),(u=t.getAttribute("id"))?d=u.replace(kt,"\\$&"):t.setAttribute("id",d),d="[id='"+d+"'] ",l=c.length;l--;)c[l]=d+f(c[l]);h=ft.test(e)&&t.parentNode||t,m=c.join(",")}if(m)try{return et.apply(n,h.querySelectorAll(m)),n}catch(g){}finally{u||t.removeAttribute("id")}}}return w(e.replace(ut,"$1"),t,n,i)}function i(){function e(n,i){return t.push(n+=" ")>S.cacheLength&&delete e[t.shift()],e[n]=i}var t=[];return e}function r(e){return e[H]=!0,e}function o(e){var t=O.createElement("div");try{return!!e(t)}catch(n){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function a(e,t){for(var n=e.split("|"),i=e.length;i--;)S.attrHandle[n[i]]=t}function s(e,t){var n=t&&e,i=n&&1===e.nodeType&&1===t.nodeType&&(~t.sourceIndex||z)-(~e.sourceIndex||z);if(i)return i;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function l(e){return function(t){var n=t.nodeName.toLowerCase();return"input"===n&&t.type===e}}function c(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function u(e){return r(function(t){return t=+t,r(function(n,i){for(var r,o=e([],n.length,t),a=o.length;a--;)n[r=o[a]]&&(n[r]=!(i[r]=n[r]))})})}function d(){}function p(e,t){var i,r,o,a,s,l,c,u=K[e+" "];if(u)return t?0:u.slice(0);for(s=e,l=[],c=S.preFilter;s;){(!i||(r=dt.exec(s)))&&(r&&(s=s.slice(r[0].length)||s),l.push(o=[])),i=!1,(r=pt.exec(s))&&(i=r.shift(),o.push({value:i,type:r[0].replace(ut," ")}),s=s.slice(i.length));for(a in S.filter)!(r=vt[a].exec(s))||c[a]&&!(r=c[a](r))||(i=r.shift(),o.push({value:i,type:a,matches:r}),s=s.slice(i.length));if(!i)break}return t?s.length:s?n.error(e):K(e,l).slice(0)}function f(e){for(var t=0,n=e.length,i="";n>t;t++)i+=e[t].value;return i}function h(e,t,n){var i=t.dir,r=n&&"parentNode"===i,o=B++;
return t.first?function(t,n,o){for(;t=t[i];)if(1===t.nodeType||r)return e(t,n,o)}:function(t,n,a){var s,l,c,u=F+" "+o;if(a){for(;t=t[i];)if((1===t.nodeType||r)&&e(t,n,a))return!0}else for(;t=t[i];)if(1===t.nodeType||r)if(c=t[H]||(t[H]={}),(l=c[i])&&l[0]===u){if((s=l[1])===!0||s===C)return s===!0}else if(l=c[i]=[u],l[1]=e(t,n,a)||C,l[1]===!0)return!0}}function m(e){return e.length>1?function(t,n,i){for(var r=e.length;r--;)if(!e[r](t,n,i))return!1;return!0}:e[0]}function g(e,t,n,i,r){for(var o,a=[],s=0,l=e.length,c=null!=t;l>s;s++)(o=e[s])&&(!n||n(o,i,r))&&(a.push(o),c&&t.push(s));return a}function v(e,t,n,i,o,a){return i&&!i[H]&&(i=v(i)),o&&!o[H]&&(o=v(o,a)),r(function(r,a,s,l){var c,u,d,p=[],f=[],h=a.length,m=r||x(t||"*",s.nodeType?[s]:s,[]),v=!e||!r&&t?m:g(m,p,e,s,l),y=n?o||(r?e:h||i)?[]:a:v;if(n&&n(v,y,s,l),i)for(c=g(y,f),i(c,[],s,l),u=c.length;u--;)(d=c[u])&&(y[f[u]]=!(v[f[u]]=d));if(r){if(o||e){if(o){for(c=[],u=y.length;u--;)(d=y[u])&&c.push(v[u]=d);o(null,y=[],c,l)}for(u=y.length;u--;)(d=y[u])&&(c=o?nt.call(r,d):p[u])>-1&&(r[c]=!(a[c]=d))}}else y=g(y===a?y.splice(h,y.length):y),o?o(null,a,y,l):et.apply(a,y)})}function y(e){for(var t,n,i,r=e.length,o=S.relative[e[0].type],a=o||S.relative[" "],s=o?1:0,l=h(function(e){return e===t},a,!0),c=h(function(e){return nt.call(t,e)>-1},a,!0),u=[function(e,n,i){return!o&&(i||n!==A)||((t=n).nodeType?l(e,n,i):c(e,n,i))}];r>s;s++)if(n=S.relative[e[s].type])u=[h(m(u),n)];else{if(n=S.filter[e[s].type].apply(null,e[s].matches),n[H]){for(i=++s;r>i&&!S.relative[e[i].type];i++);return v(s>1&&m(u),s>1&&f(e.slice(0,s-1).concat({value:" "===e[s-2].type?"*":""})).replace(ut,"$1"),n,i>s&&y(e.slice(s,i)),r>i&&y(e=e.slice(i)),r>i&&f(e))}u.push(n)}return m(u)}function b(e,t){var i=0,o=t.length>0,a=e.length>0,s=function(r,s,l,c,u){var d,p,f,h=[],m=0,v="0",y=r&&[],b=null!=u,x=A,w=r||a&&S.find.TAG("*",u&&s.parentNode||s),k=F+=null==x?1:Math.random()||.1;for(b&&(A=s!==O&&s,C=i);null!=(d=w[v]);v++){if(a&&d){for(p=0;f=e[p++];)if(f(d,s,l)){c.push(d);break}b&&(F=k,C=++i)}o&&((d=!f&&d)&&m--,r&&y.push(d))}if(m+=v,o&&v!==m){for(p=0;f=t[p++];)f(y,h,s,l);if(r){if(m>0)for(;v--;)y[v]||h[v]||(h[v]=J.call(c));h=g(h)}et.apply(c,h),b&&!r&&h.length>0&&m+t.length>1&&n.uniqueSort(c)}return b&&(F=k,A=x),y};return o?r(s):s}function x(e,t,i){for(var r=0,o=t.length;o>r;r++)n(e,t[r],i);return i}function w(e,t,n,i){var r,o,a,s,l,c=p(e);if(!i&&1===c.length){if(o=c[0]=c[0].slice(0),o.length>2&&"ID"===(a=o[0]).type&&T.getById&&9===t.nodeType&&M&&S.relative[o[1].type]){if(t=(S.find.ID(a.matches[0].replace(Tt,Ct),t)||[])[0],!t)return n;e=e.slice(o.shift().value.length)}for(r=vt.needsContext.test(e)?0:o.length;r--&&(a=o[r],!S.relative[s=a.type]);)if((l=S.find[s])&&(i=l(a.matches[0].replace(Tt,Ct),ft.test(o[0].type)&&t.parentNode||t))){if(o.splice(r,1),e=i.length&&f(o),!e)return et.apply(n,i),n;break}}return $(e,c)(i,t,!M,n,ft.test(e)),n}var k,T,C,S,E,_,$,A,N,R,O,L,M,D,j,P,I,H="sizzle"+-new Date,q=e.document,F=0,B=0,U=i(),K=i(),W=i(),G=!1,V=function(e,t){return e===t?(G=!0,0):0},Q=typeof t,z=1<<31,X={}.hasOwnProperty,Y=[],J=Y.pop,Z=Y.push,et=Y.push,tt=Y.slice,nt=Y.indexOf||function(e){for(var t=0,n=this.length;n>t;t++)if(this[t]===e)return t;return-1},it="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",rt="[\\x20\\t\\r\\n\\f]",at="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",st=at.replace("w","w#"),lt="\\["+rt+"*("+at+")"+rt+"*(?:([*^$|!~]?=)"+rt+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+st+")|)|)"+rt+"*\\]",ct=":("+at+")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|"+lt.replace(3,8)+")*)|.*)\\)|)",ut=RegExp("^"+rt+"+|((?:^|[^\\\\])(?:\\\\.)*)"+rt+"+$","g"),dt=RegExp("^"+rt+"*,"+rt+"*"),pt=RegExp("^"+rt+"*([>+~]|"+rt+")"+rt+"*"),ft=RegExp(rt+"*[+~]"),ht=RegExp("="+rt+"*([^\\]'\"]*)"+rt+"*\\]","g"),mt=RegExp(ct),gt=RegExp("^"+st+"$"),vt={ID:RegExp("^#("+at+")"),CLASS:RegExp("^\\.("+at+")"),TAG:RegExp("^("+at.replace("w","w*")+")"),ATTR:RegExp("^"+lt),PSEUDO:RegExp("^"+ct),CHILD:RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+rt+"*(even|odd|(([+-]|)(\\d*)n|)"+rt+"*(?:([+-]|)"+rt+"*(\\d+)|))"+rt+"*\\)|)","i"),bool:RegExp("^(?:"+it+")$","i"),needsContext:RegExp("^"+rt+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+rt+"*((?:-\\d)?\\d*)"+rt+"*\\)|)(?=[^-]|$)","i")},yt=/^[^{]+\{\s*\[native \w/,bt=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,xt=/^(?:input|select|textarea|button)$/i,wt=/^h\d$/i,kt=/'|\\/g,Tt=RegExp("\\\\([\\da-f]{1,6}"+rt+"?|("+rt+")|.)","ig"),Ct=function(e,t,n){var i="0x"+t-65536;return i!==i||n?t:0>i?String.fromCharCode(i+65536):String.fromCharCode(55296|i>>10,56320|1023&i)};try{et.apply(Y=tt.call(q.childNodes),q.childNodes),Y[q.childNodes.length].nodeType}catch(St){et={apply:Y.length?function(e,t){Z.apply(e,tt.call(t))}:function(e,t){for(var n=e.length,i=0;e[n++]=t[i++];);e.length=n-1}}}_=n.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?"HTML"!==t.nodeName:!1},T=n.support={},R=n.setDocument=function(e){var n=e?e.ownerDocument||e:q,i=n.defaultView;return n!==O&&9===n.nodeType&&n.documentElement?(O=n,L=n.documentElement,M=!_(n),i&&i.attachEvent&&i!==i.top&&i.attachEvent("onbeforeunload",function(){R()}),T.attributes=o(function(e){return e.className="i",!e.getAttribute("className")}),T.getElementsByTagName=o(function(e){return e.appendChild(n.createComment("")),!e.getElementsByTagName("*").length}),T.getElementsByClassName=o(function(e){return e.innerHTML="<div class='a'></div><div class='a i'></div>",e.firstChild.className="i",2===e.getElementsByClassName("i").length}),T.getById=o(function(e){return L.appendChild(e).id=H,!n.getElementsByName||!n.getElementsByName(H).length}),T.getById?(S.find.ID=function(e,t){if(typeof t.getElementById!==Q&&M){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},S.filter.ID=function(e){var t=e.replace(Tt,Ct);return function(e){return e.getAttribute("id")===t}}):(delete S.find.ID,S.filter.ID=function(e){var t=e.replace(Tt,Ct);return function(e){var n=typeof e.getAttributeNode!==Q&&e.getAttributeNode("id");return n&&n.value===t}}),S.find.TAG=T.getElementsByTagName?function(e,n){return typeof n.getElementsByTagName!==Q?n.getElementsByTagName(e):t}:function(e,t){var n,i=[],r=0,o=t.getElementsByTagName(e);if("*"===e){for(;n=o[r++];)1===n.nodeType&&i.push(n);return i}return o},S.find.CLASS=T.getElementsByClassName&&function(e,n){return typeof n.getElementsByClassName!==Q&&M?n.getElementsByClassName(e):t},j=[],D=[],(T.qsa=yt.test(n.querySelectorAll))&&(o(function(e){e.innerHTML="<select><option selected=''></option></select>",e.querySelectorAll("[selected]").length||D.push("\\["+rt+"*(?:value|"+it+")"),e.querySelectorAll(":checked").length||D.push(":checked")}),o(function(e){var t=n.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("t",""),e.querySelectorAll("[t^='']").length&&D.push("[*^$]="+rt+"*(?:''|\"\")"),e.querySelectorAll(":enabled").length||D.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),D.push(",.*:")})),(T.matchesSelector=yt.test(P=L.webkitMatchesSelector||L.mozMatchesSelector||L.oMatchesSelector||L.msMatchesSelector))&&o(function(e){T.disconnectedMatch=P.call(e,"div"),P.call(e,"[s!='']:x"),j.push("!=",ct)}),D=D.length&&RegExp(D.join("|")),j=j.length&&RegExp(j.join("|")),I=yt.test(L.contains)||L.compareDocumentPosition?function(e,t){var n=9===e.nodeType?e.documentElement:e,i=t&&t.parentNode;return e===i||!(!i||1!==i.nodeType||!(n.contains?n.contains(i):e.compareDocumentPosition&&16&e.compareDocumentPosition(i)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},V=L.compareDocumentPosition?function(e,t){if(e===t)return G=!0,0;var i=t.compareDocumentPosition&&e.compareDocumentPosition&&e.compareDocumentPosition(t);return i?1&i||!T.sortDetached&&t.compareDocumentPosition(e)===i?e===n||I(q,e)?-1:t===n||I(q,t)?1:N?nt.call(N,e)-nt.call(N,t):0:4&i?-1:1:e.compareDocumentPosition?-1:1}:function(e,t){var i,r=0,o=e.parentNode,a=t.parentNode,l=[e],c=[t];if(e===t)return G=!0,0;if(!o||!a)return e===n?-1:t===n?1:o?-1:a?1:N?nt.call(N,e)-nt.call(N,t):0;if(o===a)return s(e,t);for(i=e;i=i.parentNode;)l.unshift(i);for(i=t;i=i.parentNode;)c.unshift(i);for(;l[r]===c[r];)r++;return r?s(l[r],c[r]):l[r]===q?-1:c[r]===q?1:0},n):O},n.matches=function(e,t){return n(e,null,null,t)},n.matchesSelector=function(e,t){if((e.ownerDocument||e)!==O&&R(e),t=t.replace(ht,"='$1']"),!(!T.matchesSelector||!M||j&&j.test(t)||D&&D.test(t)))try{var i=P.call(e,t);if(i||T.disconnectedMatch||e.document&&11!==e.document.nodeType)return i}catch(r){}return n(t,O,null,[e]).length>0},n.contains=function(e,t){return(e.ownerDocument||e)!==O&&R(e),I(e,t)},n.attr=function(e,n){(e.ownerDocument||e)!==O&&R(e);var i=S.attrHandle[n.toLowerCase()],r=i&&X.call(S.attrHandle,n.toLowerCase())?i(e,n,!M):t;return r===t?T.attributes||!M?e.getAttribute(n):(r=e.getAttributeNode(n))&&r.specified?r.value:null:r},n.error=function(e){throw Error("Syntax error, unrecognized expression: "+e)},n.uniqueSort=function(e){var t,n=[],i=0,r=0;if(G=!T.detectDuplicates,N=!T.sortStable&&e.slice(0),e.sort(V),G){for(;t=e[r++];)t===e[r]&&(i=n.push(r));for(;i--;)e.splice(n[i],1)}return e},E=n.getText=function(e){var t,n="",i=0,r=e.nodeType;if(r){if(1===r||9===r||11===r){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=E(e)}else if(3===r||4===r)return e.nodeValue}else for(;t=e[i];i++)n+=E(t);return n},S=n.selectors={cacheLength:50,createPseudo:r,match:vt,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(Tt,Ct),e[3]=(e[4]||e[5]||"").replace(Tt,Ct),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||n.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&n.error(e[0]),e},PSEUDO:function(e){var n,i=!e[5]&&e[2];return vt.CHILD.test(e[0])?null:(e[3]&&e[4]!==t?e[2]=e[4]:i&&mt.test(i)&&(n=p(i,!0))&&(n=i.indexOf(")",i.length-n)-i.length)&&(e[0]=e[0].slice(0,n),e[2]=i.slice(0,n)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(Tt,Ct).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=U[e+" "];return t||(t=RegExp("(^|"+rt+")"+e+"("+rt+"|$)"))&&U(e,function(e){return t.test("string"==typeof e.className&&e.className||typeof e.getAttribute!==Q&&e.getAttribute("class")||"")})},ATTR:function(e,t,i){return function(r){var o=n.attr(r,e);return null==o?"!="===t:t?(o+="","="===t?o===i:"!="===t?o!==i:"^="===t?i&&0===o.indexOf(i):"*="===t?i&&o.indexOf(i)>-1:"$="===t?i&&o.slice(-i.length)===i:"~="===t?(" "+o+" ").indexOf(i)>-1:"|="===t?o===i||o.slice(0,i.length+1)===i+"-":!1):!0}},CHILD:function(e,t,n,i,r){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===i&&0===r?function(e){return!!e.parentNode}:function(t,n,l){var c,u,d,p,f,h,m=o!==a?"nextSibling":"previousSibling",g=t.parentNode,v=s&&t.nodeName.toLowerCase(),y=!l&&!s;if(g){if(o){for(;m;){for(d=t;d=d[m];)if(s?d.nodeName.toLowerCase()===v:1===d.nodeType)return!1;h=m="only"===e&&!h&&"nextSibling"}return!0}if(h=[a?g.firstChild:g.lastChild],a&&y){for(u=g[H]||(g[H]={}),c=u[e]||[],f=c[0]===F&&c[1],p=c[0]===F&&c[2],d=f&&g.childNodes[f];d=++f&&d&&d[m]||(p=f=0)||h.pop();)if(1===d.nodeType&&++p&&d===t){u[e]=[F,f,p];break}}else if(y&&(c=(t[H]||(t[H]={}))[e])&&c[0]===F)p=c[1];else for(;(d=++f&&d&&d[m]||(p=f=0)||h.pop())&&((s?d.nodeName.toLowerCase()!==v:1!==d.nodeType)||!++p||(y&&((d[H]||(d[H]={}))[e]=[F,p]),d!==t)););return p-=r,p===i||0===p%i&&p/i>=0}}},PSEUDO:function(e,t){var i,o=S.pseudos[e]||S.setFilters[e.toLowerCase()]||n.error("unsupported pseudo: "+e);return o[H]?o(t):o.length>1?(i=[e,e,"",t],S.setFilters.hasOwnProperty(e.toLowerCase())?r(function(e,n){for(var i,r=o(e,t),a=r.length;a--;)i=nt.call(e,r[a]),e[i]=!(n[i]=r[a])}):function(e){return o(e,0,i)}):o}},pseudos:{not:r(function(e){var t=[],n=[],i=$(e.replace(ut,"$1"));return i[H]?r(function(e,t,n,r){for(var o,a=i(e,null,r,[]),s=e.length;s--;)(o=a[s])&&(e[s]=!(t[s]=o))}):function(e,r,o){return t[0]=e,i(t,null,o,n),!n.pop()}}),has:r(function(e){return function(t){return n(e,t).length>0}}),contains:r(function(e){return function(t){return(t.textContent||t.innerText||E(t)).indexOf(e)>-1}}),lang:r(function(e){return gt.test(e||"")||n.error("unsupported lang: "+e),e=e.replace(Tt,Ct).toLowerCase(),function(t){var n;do if(n=M?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return n=n.toLowerCase(),n===e||0===n.indexOf(e+"-");while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===L},focus:function(e){return e===O.activeElement&&(!O.hasFocus||O.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeName>"@"||3===e.nodeType||4===e.nodeType)return!1;return!0},parent:function(e){return!S.pseudos.empty(e)},header:function(e){return wt.test(e.nodeName)},input:function(e){return xt.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||t.toLowerCase()===e.type)},first:u(function(){return[0]}),last:u(function(e,t){return[t-1]}),eq:u(function(e,t,n){return[0>n?n+t:n]}),even:u(function(e,t){for(var n=0;t>n;n+=2)e.push(n);return e}),odd:u(function(e,t){for(var n=1;t>n;n+=2)e.push(n);return e}),lt:u(function(e,t,n){for(var i=0>n?n+t:n;--i>=0;)e.push(i);return e}),gt:u(function(e,t,n){for(var i=0>n?n+t:n;t>++i;)e.push(i);return e})}},S.pseudos.nth=S.pseudos.eq;for(k in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})S.pseudos[k]=l(k);for(k in{submit:!0,reset:!0})S.pseudos[k]=c(k);d.prototype=S.filters=S.pseudos,S.setFilters=new d,$=n.compile=function(e,t){var n,i=[],r=[],o=W[e+" "];if(!o){for(t||(t=p(e)),n=t.length;n--;)o=y(t[n]),o[H]?i.push(o):r.push(o);o=W(e,b(r,i))}return o},T.sortStable=H.split("").sort(V).join("")===H,T.detectDuplicates=G,R(),T.sortDetached=o(function(e){return 1&e.compareDocumentPosition(O.createElement("div"))}),o(function(e){return e.innerHTML="<a href='#'></a>","#"===e.firstChild.getAttribute("href")})||a("type|href|height|width",function(e,n,i){return i?t:e.getAttribute(n,"type"===n.toLowerCase()?1:2)}),T.attributes&&o(function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||a("value",function(e,n,i){return i||"input"!==e.nodeName.toLowerCase()?t:e.defaultValue}),o(function(e){return null==e.getAttribute("disabled")})||a(it,function(e,n,i){var r;return i?t:(r=e.getAttributeNode(n))&&r.specified?r.value:e[n]===!0?n.toLowerCase():null}),ot.find=n,ot.expr=n.selectors,ot.expr[":"]=ot.expr.pseudos,ot.unique=n.uniqueSort,ot.text=n.getText,ot.isXMLDoc=n.isXML,ot.contains=n.contains}(e);var ht={};ot.Callbacks=function(e){e="string"==typeof e?ht[e]||i(e):ot.extend({},e);var n,r,o,a,s,l,c=[],u=!e.once&&[],d=function(t){for(n=e.memory&&t,r=!0,l=a||0,a=0,s=c.length,o=!0;c&&s>l;l++)if(c[l].apply(t[0],t[1])===!1&&e.stopOnFalse){n=!1;break}o=!1,c&&(u?u.length&&d(u.shift()):n?c=[]:p.disable())},p={add:function(){if(c){var t=c.length;(function i(t){ot.each(t,function(t,n){var r=ot.type(n);"function"===r?e.unique&&p.has(n)||c.push(n):n&&n.length&&"string"!==r&&i(n)})})(arguments),o?s=c.length:n&&(a=t,d(n))}return this},remove:function(){return c&&ot.each(arguments,function(e,t){for(var n;(n=ot.inArray(t,c,n))>-1;)c.splice(n,1),o&&(s>=n&&s--,l>=n&&l--)}),this},has:function(e){return e?ot.inArray(e,c)>-1:!(!c||!c.length)},empty:function(){return c=[],s=0,this},disable:function(){return c=u=n=t,this},disabled:function(){return!c},lock:function(){return u=t,n||p.disable(),this},locked:function(){return!u},fireWith:function(e,t){return!c||r&&!u||(t=t||[],t=[e,t.slice?t.slice():t],o?u.push(t):d(t)),this},fire:function(){return p.fireWith(this,arguments),this},fired:function(){return!!r}};return p},ot.extend({Deferred:function(e){var t=[["resolve","done",ot.Callbacks("once memory"),"resolved"],["reject","fail",ot.Callbacks("once memory"),"rejected"],["notify","progress",ot.Callbacks("memory")]],n="pending",i={state:function(){return n},always:function(){return r.done(arguments).fail(arguments),this},then:function(){var e=arguments;return ot.Deferred(function(n){ot.each(t,function(t,o){var a=o[0],s=ot.isFunction(e[t])&&e[t];r[o[1]](function(){var e=s&&s.apply(this,arguments);e&&ot.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[a+"With"](this===i?n.promise():this,s?[e]:arguments)})}),e=null}).promise()},promise:function(e){return null!=e?ot.extend(e,i):i}},r={};return i.pipe=i.then,ot.each(t,function(e,o){var a=o[2],s=o[3];i[o[1]]=a.add,s&&a.add(function(){n=s},t[1^e][2].disable,t[2][2].lock),r[o[0]]=function(){return r[o[0]+"With"](this===r?i:this,arguments),this},r[o[0]+"With"]=a.fireWith}),i.promise(r),e&&e.call(r,r),r},when:function(e){var t,n,i,r=0,o=et.call(arguments),a=o.length,s=1!==a||e&&ot.isFunction(e.promise)?a:0,l=1===s?e:ot.Deferred(),c=function(e,n,i){return function(r){n[e]=this,i[e]=arguments.length>1?et.call(arguments):r,i===t?l.notifyWith(n,i):--s||l.resolveWith(n,i)}};if(a>1)for(t=Array(a),n=Array(a),i=Array(a);a>r;r++)o[r]&&ot.isFunction(o[r].promise)?o[r].promise().done(c(r,i,o)).fail(l.reject).progress(c(r,n,t)):--s;return s||l.resolveWith(i,o),l.promise()}}),ot.support=function(t){var n=W.createElement("input"),i=W.createDocumentFragment(),r=W.createElement("div"),o=W.createElement("select"),a=o.appendChild(W.createElement("option"));return n.type?(n.type="checkbox",t.checkOn=""!==n.value,t.optSelected=a.selected,t.reliableMarginRight=!0,t.boxSizingReliable=!0,t.pixelPosition=!1,n.checked=!0,t.noCloneChecked=n.cloneNode(!0).checked,o.disabled=!0,t.optDisabled=!a.disabled,n=W.createElement("input"),n.value="t",n.type="radio",t.radioValue="t"===n.value,n.setAttribute("checked","t"),n.setAttribute("name","t"),i.appendChild(n),t.checkClone=i.cloneNode(!0).cloneNode(!0).lastChild.checked,t.focusinBubbles="onfocusin"in e,r.style.backgroundClip="content-box",r.cloneNode(!0).style.backgroundClip="",t.clearCloneStyle="content-box"===r.style.backgroundClip,ot(function(){var n,i,o="padding:0;margin:0;border:0;display:block;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box",a=W.getElementsByTagName("body")[0];a&&(n=W.createElement("div"),n.style.cssText="border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px",a.appendChild(n).appendChild(r),r.innerHTML="",r.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%",ot.swap(a,null!=a.style.zoom?{zoom:1}:{},function(){t.boxSizing=4===r.offsetWidth}),e.getComputedStyle&&(t.pixelPosition="1%"!==(e.getComputedStyle(r,null)||{}).top,t.boxSizingReliable="4px"===(e.getComputedStyle(r,null)||{width:"4px"}).width,i=r.appendChild(W.createElement("div")),i.style.cssText=r.style.cssText=o,i.style.marginRight=i.style.width="0",r.style.width="1px",t.reliableMarginRight=!parseFloat((e.getComputedStyle(i,null)||{}).marginRight)),a.removeChild(n))}),t):t}({});var mt,gt,vt=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,yt=/([A-Z])/g;r.uid=1,r.accepts=function(e){return e.nodeType?1===e.nodeType||9===e.nodeType:!0},r.prototype={key:function(e){if(!r.accepts(e))return 0;var t={},n=e[this.expando];if(!n){n=r.uid++;try{t[this.expando]={value:n},Object.defineProperties(e,t)}catch(i){t[this.expando]=n,ot.extend(e,t)}}return this.cache[n]||(this.cache[n]={}),n},set:function(e,t,n){var i,r=this.key(e),o=this.cache[r];if("string"==typeof t)o[t]=n;else if(ot.isEmptyObject(o))ot.extend(this.cache[r],t);else for(i in t)o[i]=t[i];return o},get:function(e,n){var i=this.cache[this.key(e)];return n===t?i:i[n]},access:function(e,n,i){var r;return n===t||n&&"string"==typeof n&&i===t?(r=this.get(e,n),r!==t?r:this.get(e,ot.camelCase(n))):(this.set(e,n,i),i!==t?i:n)},remove:function(e,n){var i,r,o,a=this.key(e),s=this.cache[a];if(n===t)this.cache[a]={};else{ot.isArray(n)?r=n.concat(n.map(ot.camelCase)):(o=ot.camelCase(n),n in s?r=[n,o]:(r=o,r=r in s?[r]:r.match(st)||[])),i=r.length;for(;i--;)delete s[r[i]]}},hasData:function(e){return!ot.isEmptyObject(this.cache[e[this.expando]]||{})},discard:function(e){e[this.expando]&&delete this.cache[e[this.expando]]}},mt=new r,gt=new r,ot.extend({acceptData:r.accepts,hasData:function(e){return mt.hasData(e)||gt.hasData(e)},data:function(e,t,n){return mt.access(e,t,n)},removeData:function(e,t){mt.remove(e,t)},_data:function(e,t,n){return gt.access(e,t,n)},_removeData:function(e,t){gt.remove(e,t)}}),ot.fn.extend({data:function(e,n){var i,r,a=this[0],s=0,l=null;if(e===t){if(this.length&&(l=mt.get(a),1===a.nodeType&&!gt.get(a,"hasDataAttrs"))){for(i=a.attributes;i.length>s;s++)r=i[s].name,0===r.indexOf("data-")&&(r=ot.camelCase(r.slice(5)),o(a,r,l[r]));gt.set(a,"hasDataAttrs",!0)}return l}return"object"==typeof e?this.each(function(){mt.set(this,e)}):ot.access(this,function(n){var i,r=ot.camelCase(e);if(a&&n===t){if(i=mt.get(a,e),i!==t)return i;if(i=mt.get(a,r),i!==t)return i;if(i=o(a,r,t),i!==t)return i}else this.each(function(){var i=mt.get(this,r);mt.set(this,r,n),-1!==e.indexOf("-")&&i!==t&&mt.set(this,e,n)})},null,n,arguments.length>1,null,!0)},removeData:function(e){return this.each(function(){mt.remove(this,e)})}}),ot.extend({queue:function(e,n,i){var r;return e?(n=(n||"fx")+"queue",r=gt.get(e,n),i&&(!r||ot.isArray(i)?r=gt.access(e,n,ot.makeArray(i)):r.push(i)),r||[]):t},dequeue:function(e,t){t=t||"fx";var n=ot.queue(e,t),i=n.length,r=n.shift(),o=ot._queueHooks(e,t),a=function(){ot.dequeue(e,t)};"inprogress"===r&&(r=n.shift(),i--),r&&("fx"===t&&n.unshift("inprogress"),delete o.stop,r.call(e,a,o)),!i&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return gt.get(e,n)||gt.access(e,n,{empty:ot.Callbacks("once memory").add(function(){gt.remove(e,[t+"queue",n])})})}}),ot.fn.extend({queue:function(e,n){var i=2;return"string"!=typeof e&&(n=e,e="fx",i--),i>arguments.length?ot.queue(this[0],e):n===t?this:this.each(function(){var t=ot.queue(this,e,n);ot._queueHooks(this,e),"fx"===e&&"inprogress"!==t[0]&&ot.dequeue(this,e)})},dequeue:function(e){return this.each(function(){ot.dequeue(this,e)})},delay:function(e,t){return e=ot.fx?ot.fx.speeds[e]||e:e,t=t||"fx",this.queue(t,function(t,n){var i=setTimeout(t,e);n.stop=function(){clearTimeout(i)}})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,n){var i,r=1,o=ot.Deferred(),a=this,s=this.length,l=function(){--r||o.resolveWith(a,[a])};for("string"!=typeof e&&(n=e,e=t),e=e||"fx";s--;)i=gt.get(a[s],e+"queueHooks"),i&&i.empty&&(r++,i.empty.add(l));return l(),o.promise(n)}});var bt,xt,wt=/[\t\r\n\f]/g,kt=/\r/g,Tt=/^(?:input|select|textarea|button)$/i;ot.fn.extend({attr:function(e,t){return ot.access(this,ot.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){ot.removeAttr(this,e)})},prop:function(e,t){return ot.access(this,ot.prop,e,t,arguments.length>1)},removeProp:function(e){return this.each(function(){delete this[ot.propFix[e]||e]})},addClass:function(e){var t,n,i,r,o,a=0,s=this.length,l="string"==typeof e&&e;if(ot.isFunction(e))return this.each(function(t){ot(this).addClass(e.call(this,t,this.className))});if(l)for(t=(e||"").match(st)||[];s>a;a++)if(n=this[a],i=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(wt," "):" ")){for(o=0;r=t[o++];)0>i.indexOf(" "+r+" ")&&(i+=r+" ");n.className=ot.trim(i)}return this},removeClass:function(e){var t,n,i,r,o,a=0,s=this.length,l=0===arguments.length||"string"==typeof e&&e;if(ot.isFunction(e))return this.each(function(t){ot(this).removeClass(e.call(this,t,this.className))});if(l)for(t=(e||"").match(st)||[];s>a;a++)if(n=this[a],i=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(wt," "):"")){for(o=0;r=t[o++];)for(;i.indexOf(" "+r+" ")>=0;)i=i.replace(" "+r+" "," ");n.className=e?ot.trim(i):""}return this},toggleClass:function(e,t){var n=typeof e;return"boolean"==typeof t&&"string"===n?t?this.addClass(e):this.removeClass(e):ot.isFunction(e)?this.each(function(n){ot(this).toggleClass(e.call(this,n,this.className,t),t)}):this.each(function(){if("string"===n)for(var t,i=0,r=ot(this),o=e.match(st)||[];t=o[i++];)r.hasClass(t)?r.removeClass(t):r.addClass(t);else(n===U||"boolean"===n)&&(this.className&>.set(this,"__className__",this.className),this.className=this.className||e===!1?"":gt.get(this,"__className__")||"")})},hasClass:function(e){for(var t=" "+e+" ",n=0,i=this.length;i>n;n++)if(1===this[n].nodeType&&(" "+this[n].className+" ").replace(wt," ").indexOf(t)>=0)return!0;return!1},val:function(e){var n,i,r,o=this[0];return arguments.length?(r=ot.isFunction(e),this.each(function(i){var o;1===this.nodeType&&(o=r?e.call(this,i,ot(this).val()):e,null==o?o="":"number"==typeof o?o+="":ot.isArray(o)&&(o=ot.map(o,function(e){return null==e?"":e+""})),n=ot.valHooks[this.type]||ot.valHooks[this.nodeName.toLowerCase()],n&&"set"in n&&n.set(this,o,"value")!==t||(this.value=o))})):o?(n=ot.valHooks[o.type]||ot.valHooks[o.nodeName.toLowerCase()],n&&"get"in n&&(i=n.get(o,"value"))!==t?i:(i=o.value,"string"==typeof i?i.replace(kt,""):null==i?"":i)):t}}),ot.extend({valHooks:{option:{get:function(e){var t=e.attributes.value;return!t||t.specified?e.value:e.text}},select:{get:function(e){for(var t,n,i=e.options,r=e.selectedIndex,o="select-one"===e.type||0>r,a=o?null:[],s=o?r+1:i.length,l=0>r?s:o?r:0;s>l;l++)if(n=i[l],!(!n.selected&&l!==r||(ot.support.optDisabled?n.disabled:null!==n.getAttribute("disabled"))||n.parentNode.disabled&&ot.nodeName(n.parentNode,"optgroup"))){if(t=ot(n).val(),o)return t;a.push(t)}return a},set:function(e,t){for(var n,i,r=e.options,o=ot.makeArray(t),a=r.length;a--;)i=r[a],(i.selected=ot.inArray(ot(i).val(),o)>=0)&&(n=!0);return n||(e.selectedIndex=-1),o}}},attr:function(e,n,i){var r,o,a=e.nodeType;return e&&3!==a&&8!==a&&2!==a?typeof e.getAttribute===U?ot.prop(e,n,i):(1===a&&ot.isXMLDoc(e)||(n=n.toLowerCase(),r=ot.attrHooks[n]||(ot.expr.match.bool.test(n)?xt:bt)),i===t?r&&"get"in r&&null!==(o=r.get(e,n))?o:(o=ot.find.attr(e,n),null==o?t:o):null!==i?r&&"set"in r&&(o=r.set(e,i,n))!==t?o:(e.setAttribute(n,i+""),i):(ot.removeAttr(e,n),t)):t},removeAttr:function(e,t){var n,i,r=0,o=t&&t.match(st);if(o&&1===e.nodeType)for(;n=o[r++];)i=ot.propFix[n]||n,ot.expr.match.bool.test(n)&&(e[i]=!1),e.removeAttribute(n)},attrHooks:{type:{set:function(e,t){if(!ot.support.radioValue&&"radio"===t&&ot.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},propFix:{"for":"htmlFor","class":"className"},prop:function(e,n,i){var r,o,a,s=e.nodeType;return e&&3!==s&&8!==s&&2!==s?(a=1!==s||!ot.isXMLDoc(e),a&&(n=ot.propFix[n]||n,o=ot.propHooks[n]),i!==t?o&&"set"in o&&(r=o.set(e,i,n))!==t?r:e[n]=i:o&&"get"in o&&null!==(r=o.get(e,n))?r:e[n]):t},propHooks:{tabIndex:{get:function(e){return e.hasAttribute("tabindex")||Tt.test(e.nodeName)||e.href?e.tabIndex:-1}}}}),xt={set:function(e,t,n){return t===!1?ot.removeAttr(e,n):e.setAttribute(n,n),n}},ot.each(ot.expr.match.bool.source.match(/\w+/g),function(e,n){var i=ot.expr.attrHandle[n]||ot.find.attr;ot.expr.attrHandle[n]=function(e,n,r){var o=ot.expr.attrHandle[n],a=r?t:(ot.expr.attrHandle[n]=t)!=i(e,n,r)?n.toLowerCase():null;return ot.expr.attrHandle[n]=o,a}}),ot.support.optSelected||(ot.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null}}),ot.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){ot.propFix[this.toLowerCase()]=this}),ot.each(["radio","checkbox"],function(){ot.valHooks[this]={set:function(e,n){return ot.isArray(n)?e.checked=ot.inArray(ot(e).val(),n)>=0:t}},ot.support.checkOn||(ot.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})});var Ct=/^key/,St=/^(?:mouse|contextmenu)|click/,Et=/^(?:focusinfocus|focusoutblur)$/,_t=/^([^.]*)(?:\.(.+)|)$/;ot.event={global:{},add:function(e,n,i,r,o){var a,s,l,c,u,d,p,f,h,m,g,v=gt.get(e);if(v){for(i.handler&&(a=i,i=a.handler,o=a.selector),i.guid||(i.guid=ot.guid++),(c=v.events)||(c=v.events={}),(s=v.handle)||(s=v.handle=function(e){return typeof ot===U||e&&ot.event.triggered===e.type?t:ot.event.dispatch.apply(s.elem,arguments)},s.elem=e),n=(n||"").match(st)||[""],u=n.length;u--;)l=_t.exec(n[u])||[],h=g=l[1],m=(l[2]||"").split(".").sort(),h&&(p=ot.event.special[h]||{},h=(o?p.delegateType:p.bindType)||h,p=ot.event.special[h]||{},d=ot.extend({type:h,origType:g,data:r,handler:i,guid:i.guid,selector:o,needsContext:o&&ot.expr.match.needsContext.test(o),namespace:m.join(".")},a),(f=c[h])||(f=c[h]=[],f.delegateCount=0,p.setup&&p.setup.call(e,r,m,s)!==!1||e.addEventListener&&e.addEventListener(h,s,!1)),p.add&&(p.add.call(e,d),d.handler.guid||(d.handler.guid=i.guid)),o?f.splice(f.delegateCount++,0,d):f.push(d),ot.event.global[h]=!0);e=null}},remove:function(e,t,n,i,r){var o,a,s,l,c,u,d,p,f,h,m,g=gt.hasData(e)&>.get(e);if(g&&(l=g.events)){for(t=(t||"").match(st)||[""],c=t.length;c--;)if(s=_t.exec(t[c])||[],f=m=s[1],h=(s[2]||"").split(".").sort(),f){for(d=ot.event.special[f]||{},f=(i?d.delegateType:d.bindType)||f,p=l[f]||[],s=s[2]&&RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=p.length;o--;)u=p[o],!r&&m!==u.origType||n&&n.guid!==u.guid||s&&!s.test(u.namespace)||i&&i!==u.selector&&("**"!==i||!u.selector)||(p.splice(o,1),u.selector&&p.delegateCount--,d.remove&&d.remove.call(e,u));a&&!p.length&&(d.teardown&&d.teardown.call(e,h,g.handle)!==!1||ot.removeEvent(e,f,g.handle),delete l[f])}else for(f in l)ot.event.remove(e,f+t[c],n,i,!0);ot.isEmptyObject(l)&&(delete g.handle,gt.remove(e,"events"))}},trigger:function(n,i,r,o){var a,s,l,c,u,d,p,f=[r||W],h=it.call(n,"type")?n.type:n,m=it.call(n,"namespace")?n.namespace.split("."):[];if(s=l=r=r||W,3!==r.nodeType&&8!==r.nodeType&&!Et.test(h+ot.event.triggered)&&(h.indexOf(".")>=0&&(m=h.split("."),h=m.shift(),m.sort()),u=0>h.indexOf(":")&&"on"+h,n=n[ot.expando]?n:new ot.Event(h,"object"==typeof n&&n),n.isTrigger=o?2:3,n.namespace=m.join("."),n.namespace_re=n.namespace?RegExp("(^|\\.)"+m.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,n.result=t,n.target||(n.target=r),i=null==i?[n]:ot.makeArray(i,[n]),p=ot.event.special[h]||{},o||!p.trigger||p.trigger.apply(r,i)!==!1)){if(!o&&!p.noBubble&&!ot.isWindow(r)){for(c=p.delegateType||h,Et.test(c+h)||(s=s.parentNode);s;s=s.parentNode)f.push(s),l=s;l===(r.ownerDocument||W)&&f.push(l.defaultView||l.parentWindow||e)}for(a=0;(s=f[a++])&&!n.isPropagationStopped();)n.type=a>1?c:p.bindType||h,d=(gt.get(s,"events")||{})[n.type]&>.get(s,"handle"),d&&d.apply(s,i),d=u&&s[u],d&&ot.acceptData(s)&&d.apply&&d.apply(s,i)===!1&&n.preventDefault();return n.type=h,o||n.isDefaultPrevented()||p._default&&p._default.apply(f.pop(),i)!==!1||!ot.acceptData(r)||u&&ot.isFunction(r[h])&&!ot.isWindow(r)&&(l=r[u],l&&(r[u]=null),ot.event.triggered=h,r[h](),ot.event.triggered=t,l&&(r[u]=l)),n.result}},dispatch:function(e){e=ot.event.fix(e);var n,i,r,o,a,s=[],l=et.call(arguments),c=(gt.get(this,"events")||{})[e.type]||[],u=ot.event.special[e.type]||{};if(l[0]=e,e.delegateTarget=this,!u.preDispatch||u.preDispatch.call(this,e)!==!1){for(s=ot.event.handlers.call(this,e,c),n=0;(o=s[n++])&&!e.isPropagationStopped();)for(e.currentTarget=o.elem,i=0;(a=o.handlers[i++])&&!e.isImmediatePropagationStopped();)(!e.namespace_re||e.namespace_re.test(a.namespace))&&(e.handleObj=a,e.data=a.data,r=((ot.event.special[a.origType]||{}).handle||a.handler).apply(o.elem,l),r!==t&&(e.result=r)===!1&&(e.preventDefault(),e.stopPropagation()));
return u.postDispatch&&u.postDispatch.call(this,e),e.result}},handlers:function(e,n){var i,r,o,a,s=[],l=n.delegateCount,c=e.target;if(l&&c.nodeType&&(!e.button||"click"!==e.type))for(;c!==this;c=c.parentNode||this)if(c.disabled!==!0||"click"!==e.type){for(r=[],i=0;l>i;i++)a=n[i],o=a.selector+" ",r[o]===t&&(r[o]=a.needsContext?ot(o,this).index(c)>=0:ot.find(o,this,null,[c]).length),r[o]&&r.push(a);r.length&&s.push({elem:c,handlers:r})}return n.length>l&&s.push({elem:this,handlers:n.slice(l)}),s},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(e,t){return null==e.which&&(e.which=null!=t.charCode?t.charCode:t.keyCode),e}},mouseHooks:{props:"button buttons clientX clientY offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(e,n){var i,r,o,a=n.button;return null==e.pageX&&null!=n.clientX&&(i=e.target.ownerDocument||W,r=i.documentElement,o=i.body,e.pageX=n.clientX+(r&&r.scrollLeft||o&&o.scrollLeft||0)-(r&&r.clientLeft||o&&o.clientLeft||0),e.pageY=n.clientY+(r&&r.scrollTop||o&&o.scrollTop||0)-(r&&r.clientTop||o&&o.clientTop||0)),e.which||a===t||(e.which=1&a?1:2&a?3:4&a?2:0),e}},fix:function(e){if(e[ot.expando])return e;var t,n,i,r=e.type,o=e,a=this.fixHooks[r];for(a||(this.fixHooks[r]=a=St.test(r)?this.mouseHooks:Ct.test(r)?this.keyHooks:{}),i=a.props?this.props.concat(a.props):this.props,e=new ot.Event(o),t=i.length;t--;)n=i[t],e[n]=o[n];return e.target||(e.target=W),3===e.target.nodeType&&(e.target=e.target.parentNode),a.filter?a.filter(e,o):e},special:{load:{noBubble:!0},focus:{trigger:function(){return this!==l()&&this.focus?(this.focus(),!1):t},delegateType:"focusin"},blur:{trigger:function(){return this===l()&&this.blur?(this.blur(),!1):t},delegateType:"focusout"},click:{trigger:function(){return"checkbox"===this.type&&this.click&&ot.nodeName(this,"input")?(this.click(),!1):t},_default:function(e){return ot.nodeName(e.target,"a")}},beforeunload:{postDispatch:function(e){e.result!==t&&(e.originalEvent.returnValue=e.result)}}},simulate:function(e,t,n,i){var r=ot.extend(new ot.Event,n,{type:e,isSimulated:!0,originalEvent:{}});i?ot.event.trigger(r,null,t):ot.event.dispatch.call(t,r),r.isDefaultPrevented()&&n.preventDefault()}},ot.removeEvent=function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n,!1)},ot.Event=function(e,n){return this instanceof ot.Event?(e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||e.getPreventDefault&&e.getPreventDefault()?a:s):this.type=e,n&&ot.extend(this,n),this.timeStamp=e&&e.timeStamp||ot.now(),this[ot.expando]=!0,t):new ot.Event(e,n)},ot.Event.prototype={isDefaultPrevented:s,isPropagationStopped:s,isImmediatePropagationStopped:s,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=a,e&&e.preventDefault&&e.preventDefault()},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=a,e&&e.stopPropagation&&e.stopPropagation()},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=a,this.stopPropagation()}},ot.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(e,t){ot.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,i=this,r=e.relatedTarget,o=e.handleObj;return(!r||r!==i&&!ot.contains(i,r))&&(e.type=o.origType,n=o.handler.apply(this,arguments),e.type=t),n}}}),ot.support.focusinBubbles||ot.each({focus:"focusin",blur:"focusout"},function(e,t){var n=0,i=function(e){ot.event.simulate(t,e.target,ot.event.fix(e),!0)};ot.event.special[t]={setup:function(){0===n++&&W.addEventListener(e,i,!0)},teardown:function(){0===--n&&W.removeEventListener(e,i,!0)}}}),ot.fn.extend({on:function(e,n,i,r,o){var a,l;if("object"==typeof e){"string"!=typeof n&&(i=i||n,n=t);for(l in e)this.on(l,n,i,e[l],o);return this}if(null==i&&null==r?(r=n,i=n=t):null==r&&("string"==typeof n?(r=i,i=t):(r=i,i=n,n=t)),r===!1)r=s;else if(!r)return this;return 1===o&&(a=r,r=function(e){return ot().off(e),a.apply(this,arguments)},r.guid=a.guid||(a.guid=ot.guid++)),this.each(function(){ot.event.add(this,e,r,i,n)})},one:function(e,t,n,i){return this.on(e,t,n,i,1)},off:function(e,n,i){var r,o;if(e&&e.preventDefault&&e.handleObj)return r=e.handleObj,ot(e.delegateTarget).off(r.namespace?r.origType+"."+r.namespace:r.origType,r.selector,r.handler),this;if("object"==typeof e){for(o in e)this.off(o,n,e[o]);return this}return(n===!1||"function"==typeof n)&&(i=n,n=t),i===!1&&(i=s),this.each(function(){ot.event.remove(this,e,i,n)})},trigger:function(e,t){return this.each(function(){ot.event.trigger(e,t,this)})},triggerHandler:function(e,n){var i=this[0];return i?ot.event.trigger(e,n,i,!0):t}});var $t=/^.[^:#\[\.,]*$/,At=/^(?:parents|prev(?:Until|All))/,Nt=ot.expr.match.needsContext,Rt={children:!0,contents:!0,next:!0,prev:!0};ot.fn.extend({find:function(e){var t,n=[],i=this,r=i.length;if("string"!=typeof e)return this.pushStack(ot(e).filter(function(){for(t=0;r>t;t++)if(ot.contains(i[t],this))return!0}));for(t=0;r>t;t++)ot.find(e,i[t],n);return n=this.pushStack(r>1?ot.unique(n):n),n.selector=this.selector?this.selector+" "+e:e,n},has:function(e){var t=ot(e,this),n=t.length;return this.filter(function(){for(var e=0;n>e;e++)if(ot.contains(this,t[e]))return!0})},not:function(e){return this.pushStack(u(this,e||[],!0))},filter:function(e){return this.pushStack(u(this,e||[],!1))},is:function(e){return!!u(this,"string"==typeof e&&Nt.test(e)?ot(e):e||[],!1).length},closest:function(e,t){for(var n,i=0,r=this.length,o=[],a=Nt.test(e)||"string"!=typeof e?ot(e,t||this.context):0;r>i;i++)for(n=this[i];n&&n!==t;n=n.parentNode)if(11>n.nodeType&&(a?a.index(n)>-1:1===n.nodeType&&ot.find.matchesSelector(n,e))){n=o.push(n);break}return this.pushStack(o.length>1?ot.unique(o):o)},index:function(e){return e?"string"==typeof e?tt.call(ot(e),this[0]):tt.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){var n="string"==typeof e?ot(e,t):ot.makeArray(e&&e.nodeType?[e]:e),i=ot.merge(this.get(),n);return this.pushStack(ot.unique(i))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),ot.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return ot.dir(e,"parentNode")},parentsUntil:function(e,t,n){return ot.dir(e,"parentNode",n)},next:function(e){return c(e,"nextSibling")},prev:function(e){return c(e,"previousSibling")},nextAll:function(e){return ot.dir(e,"nextSibling")},prevAll:function(e){return ot.dir(e,"previousSibling")},nextUntil:function(e,t,n){return ot.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return ot.dir(e,"previousSibling",n)},siblings:function(e){return ot.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return ot.sibling(e.firstChild)},contents:function(e){return e.contentDocument||ot.merge([],e.childNodes)}},function(e,t){ot.fn[e]=function(n,i){var r=ot.map(this,t,n);return"Until"!==e.slice(-5)&&(i=n),i&&"string"==typeof i&&(r=ot.filter(i,r)),this.length>1&&(Rt[e]||ot.unique(r),At.test(e)&&r.reverse()),this.pushStack(r)}}),ot.extend({filter:function(e,t,n){var i=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===i.nodeType?ot.find.matchesSelector(i,e)?[i]:[]:ot.find.matches(e,ot.grep(t,function(e){return 1===e.nodeType}))},dir:function(e,n,i){for(var r=[],o=i!==t;(e=e[n])&&9!==e.nodeType;)if(1===e.nodeType){if(o&&ot(e).is(i))break;r.push(e)}return r},sibling:function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n}});var Ot=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,Lt=/<([\w:]+)/,Mt=/<|&#?\w+;/,Dt=/<(?:script|style|link)/i,jt=/^(?:checkbox|radio)$/i,Pt=/checked\s*(?:[^=]|=\s*.checked.)/i,It=/^$|\/(?:java|ecma)script/i,Ht=/^true\/(.*)/,qt=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,Ft={option:[1,"<select multiple='multiple'>","</select>"],thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};Ft.optgroup=Ft.option,Ft.tbody=Ft.tfoot=Ft.colgroup=Ft.caption=Ft.thead,Ft.th=Ft.td,ot.fn.extend({text:function(e){return ot.access(this,function(e){return e===t?ot.text(this):this.empty().append((this[0]&&this[0].ownerDocument||W).createTextNode(e))},null,e,arguments.length)},append:function(){return this.domManip(arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=d(this,e);t.appendChild(e)}})},prepend:function(){return this.domManip(arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=d(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return this.domManip(arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return this.domManip(arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},remove:function(e,t){for(var n,i=e?ot.filter(e,this):this,r=0;null!=(n=i[r]);r++)t||1!==n.nodeType||ot.cleanData(g(n)),n.parentNode&&(t&&ot.contains(n.ownerDocument,n)&&h(g(n,"script")),n.parentNode.removeChild(n));return this},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(ot.cleanData(g(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null==e?!1:e,t=null==t?e:t,this.map(function(){return ot.clone(this,e,t)})},html:function(e){return ot.access(this,function(e){var n=this[0]||{},i=0,r=this.length;if(e===t&&1===n.nodeType)return n.innerHTML;if("string"==typeof e&&!Dt.test(e)&&!Ft[(Lt.exec(e)||["",""])[1].toLowerCase()]){e=e.replace(Ot,"<$1></$2>");try{for(;r>i;i++)n=this[i]||{},1===n.nodeType&&(ot.cleanData(g(n,!1)),n.innerHTML=e);n=0}catch(o){}}n&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var e=ot.map(this,function(e){return[e.nextSibling,e.parentNode]}),t=0;return this.domManip(arguments,function(n){var i=e[t++],r=e[t++];r&&(i&&i.parentNode!==r&&(i=this.nextSibling),ot(this).remove(),r.insertBefore(n,i))},!0),t?this:this.remove()},detach:function(e){return this.remove(e,!0)},domManip:function(e,t,n){e=J.apply([],e);var i,r,o,a,s,l,c=0,u=this.length,d=this,h=u-1,m=e[0],v=ot.isFunction(m);if(v||!(1>=u||"string"!=typeof m||ot.support.checkClone)&&Pt.test(m))return this.each(function(i){var r=d.eq(i);v&&(e[0]=m.call(this,i,r.html())),r.domManip(e,t,n)});if(u&&(i=ot.buildFragment(e,this[0].ownerDocument,!1,!n&&this),r=i.firstChild,1===i.childNodes.length&&(i=r),r)){for(o=ot.map(g(i,"script"),p),a=o.length;u>c;c++)s=i,c!==h&&(s=ot.clone(s,!0,!0),a&&ot.merge(o,g(s,"script"))),t.call(this[c],s,c);if(a)for(l=o[o.length-1].ownerDocument,ot.map(o,f),c=0;a>c;c++)s=o[c],It.test(s.type||"")&&!gt.access(s,"globalEval")&&ot.contains(l,s)&&(s.src?ot._evalUrl(s.src):ot.globalEval(s.textContent.replace(qt,"")))}return this}}),ot.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){ot.fn[e]=function(e){for(var n,i=[],r=ot(e),o=r.length-1,a=0;o>=a;a++)n=a===o?this:this.clone(!0),ot(r[a])[t](n),Z.apply(i,n.get());return this.pushStack(i)}}),ot.extend({clone:function(e,t,n){var i,r,o,a,s=e.cloneNode(!0),l=ot.contains(e.ownerDocument,e);if(!(ot.support.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||ot.isXMLDoc(e)))for(a=g(s),o=g(e),i=0,r=o.length;r>i;i++)v(o[i],a[i]);if(t)if(n)for(o=o||g(e),a=a||g(s),i=0,r=o.length;r>i;i++)m(o[i],a[i]);else m(e,s);return a=g(s,"script"),a.length>0&&h(a,!l&&g(e,"script")),s},buildFragment:function(e,t,n,i){for(var r,o,a,s,l,c,u=0,d=e.length,p=t.createDocumentFragment(),f=[];d>u;u++)if(r=e[u],r||0===r)if("object"===ot.type(r))ot.merge(f,r.nodeType?[r]:r);else if(Mt.test(r)){for(o=o||p.appendChild(t.createElement("div")),a=(Lt.exec(r)||["",""])[1].toLowerCase(),s=Ft[a]||Ft._default,o.innerHTML=s[1]+r.replace(Ot,"<$1></$2>")+s[2],c=s[0];c--;)o=o.lastChild;ot.merge(f,o.childNodes),o=p.firstChild,o.textContent=""}else f.push(t.createTextNode(r));for(p.textContent="",u=0;r=f[u++];)if((!i||-1===ot.inArray(r,i))&&(l=ot.contains(r.ownerDocument,r),o=g(p.appendChild(r),"script"),l&&h(o),n))for(c=0;r=o[c++];)It.test(r.type||"")&&n.push(r);return p},cleanData:function(e){for(var n,i,o,a,s,l,c=ot.event.special,u=0;(i=e[u])!==t;u++){if(r.accepts(i)&&(s=i[gt.expando],s&&(n=gt.cache[s]))){if(o=Object.keys(n.events||{}),o.length)for(l=0;(a=o[l])!==t;l++)c[a]?ot.event.remove(i,a):ot.removeEvent(i,a,n.handle);gt.cache[s]&&delete gt.cache[s]}delete mt.cache[i[mt.expando]]}},_evalUrl:function(e){return ot.ajax({url:e,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})}}),ot.fn.extend({wrapAll:function(e){var t;return ot.isFunction(e)?this.each(function(t){ot(this).wrapAll(e.call(this,t))}):(this[0]&&(t=ot(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){for(var e=this;e.firstElementChild;)e=e.firstElementChild;return e}).append(this)),this)},wrapInner:function(e){return ot.isFunction(e)?this.each(function(t){ot(this).wrapInner(e.call(this,t))}):this.each(function(){var t=ot(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=ot.isFunction(e);return this.each(function(n){ot(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){ot.nodeName(this,"body")||ot(this).replaceWith(this.childNodes)}).end()}});var Bt,Ut,Kt=/^(none|table(?!-c[ea]).+)/,Wt=/^margin/,Gt=RegExp("^("+at+")(.*)$","i"),Vt=RegExp("^("+at+")(?!px)[a-z%]+$","i"),Qt=RegExp("^([+-])=("+at+")","i"),zt={BODY:"block"},Xt={position:"absolute",visibility:"hidden",display:"block"},Yt={letterSpacing:0,fontWeight:400},Jt=["Top","Right","Bottom","Left"],Zt=["Webkit","O","Moz","ms"];ot.fn.extend({css:function(e,n){return ot.access(this,function(e,n,i){var r,o,a={},s=0;if(ot.isArray(n)){for(r=x(e),o=n.length;o>s;s++)a[n[s]]=ot.css(e,n[s],!1,r);return a}return i!==t?ot.style(e,n,i):ot.css(e,n)},e,n,arguments.length>1)},show:function(){return w(this,!0)},hide:function(){return w(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){b(this)?ot(this).show():ot(this).hide()})}}),ot.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Bt(e,"opacity");return""===n?"1":n}}}},cssNumber:{columnCount:!0,fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":"cssFloat"},style:function(e,n,i,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var o,a,s,l=ot.camelCase(n),c=e.style;return n=ot.cssProps[l]||(ot.cssProps[l]=y(c,l)),s=ot.cssHooks[n]||ot.cssHooks[l],i===t?s&&"get"in s&&(o=s.get(e,!1,r))!==t?o:c[n]:(a=typeof i,"string"===a&&(o=Qt.exec(i))&&(i=(o[1]+1)*o[2]+parseFloat(ot.css(e,n)),a="number"),null==i||"number"===a&&isNaN(i)||("number"!==a||ot.cssNumber[l]||(i+="px"),ot.support.clearCloneStyle||""!==i||0!==n.indexOf("background")||(c[n]="inherit"),s&&"set"in s&&(i=s.set(e,i,r))===t||(c[n]=i)),t)}},css:function(e,n,i,r){var o,a,s,l=ot.camelCase(n);return n=ot.cssProps[l]||(ot.cssProps[l]=y(e.style,l)),s=ot.cssHooks[n]||ot.cssHooks[l],s&&"get"in s&&(o=s.get(e,!0,i)),o===t&&(o=Bt(e,n,r)),"normal"===o&&n in Yt&&(o=Yt[n]),""===i||i?(a=parseFloat(o),i===!0||ot.isNumeric(a)?a||0:o):o}}),Bt=function(e,n,i){var r,o,a,s=i||x(e),l=s?s.getPropertyValue(n)||s[n]:t,c=e.style;return s&&(""!==l||ot.contains(e.ownerDocument,e)||(l=ot.style(e,n)),Vt.test(l)&&Wt.test(n)&&(r=c.width,o=c.minWidth,a=c.maxWidth,c.minWidth=c.maxWidth=c.width=l,l=s.width,c.width=r,c.minWidth=o,c.maxWidth=a)),l},ot.each(["height","width"],function(e,n){ot.cssHooks[n]={get:function(e,i,r){return i?0===e.offsetWidth&&Kt.test(ot.css(e,"display"))?ot.swap(e,Xt,function(){return C(e,n,r)}):C(e,n,r):t},set:function(e,t,i){var r=i&&x(e);return k(e,t,i?T(e,n,i,ot.support.boxSizing&&"border-box"===ot.css(e,"boxSizing",!1,r),r):0)}}}),ot(function(){ot.support.reliableMarginRight||(ot.cssHooks.marginRight={get:function(e,n){return n?ot.swap(e,{display:"inline-block"},Bt,[e,"marginRight"]):t}}),!ot.support.pixelPosition&&ot.fn.position&&ot.each(["top","left"],function(e,n){ot.cssHooks[n]={get:function(e,i){return i?(i=Bt(e,n),Vt.test(i)?ot(e).position()[n]+"px":i):t}}})}),ot.expr&&ot.expr.filters&&(ot.expr.filters.hidden=function(e){return 0>=e.offsetWidth&&0>=e.offsetHeight},ot.expr.filters.visible=function(e){return!ot.expr.filters.hidden(e)}),ot.each({margin:"",padding:"",border:"Width"},function(e,t){ot.cssHooks[e+t]={expand:function(n){for(var i=0,r={},o="string"==typeof n?n.split(" "):[n];4>i;i++)r[e+Jt[i]+t]=o[i]||o[i-2]||o[0];return r}},Wt.test(e)||(ot.cssHooks[e+t].set=k)});var en=/%20/g,tn=/\[\]$/,nn=/\r?\n/g,rn=/^(?:submit|button|image|reset|file)$/i,on=/^(?:input|select|textarea|keygen)/i;ot.fn.extend({serialize:function(){return ot.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=ot.prop(this,"elements");return e?ot.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!ot(this).is(":disabled")&&on.test(this.nodeName)&&!rn.test(e)&&(this.checked||!jt.test(e))}).map(function(e,t){var n=ot(this).val();return null==n?null:ot.isArray(n)?ot.map(n,function(e){return{name:t.name,value:e.replace(nn,"\r\n")}}):{name:t.name,value:n.replace(nn,"\r\n")}}).get()}}),ot.param=function(e,n){var i,r=[],o=function(e,t){t=ot.isFunction(t)?t():null==t?"":t,r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};if(n===t&&(n=ot.ajaxSettings&&ot.ajaxSettings.traditional),ot.isArray(e)||e.jquery&&!ot.isPlainObject(e))ot.each(e,function(){o(this.name,this.value)});else for(i in e)_(i,e[i],n,o);return r.join("&").replace(en,"+")},ot.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(e,t){ot.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}}),ot.fn.extend({hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)},bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,i){return this.on(t,e,n,i)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)}});var an,sn,ln=ot.now(),cn=/\?/,un=/#.*$/,dn=/([?&])_=[^&]*/,pn=/^(.*?):[ \t]*([^\r\n]*)$/gm,fn=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,hn=/^(?:GET|HEAD)$/,mn=/^\/\//,gn=/^([\w.+-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,vn=ot.fn.load,yn={},bn={},xn="*/".concat("*");try{sn=K.href}catch(wn){sn=W.createElement("a"),sn.href="",sn=sn.href}an=gn.exec(sn.toLowerCase())||[],ot.fn.load=function(e,n,i){if("string"!=typeof e&&vn)return vn.apply(this,arguments);var r,o,a,s=this,l=e.indexOf(" ");return l>=0&&(r=e.slice(l),e=e.slice(0,l)),ot.isFunction(n)?(i=n,n=t):n&&"object"==typeof n&&(o="POST"),s.length>0&&ot.ajax({url:e,type:o,dataType:"html",data:n}).done(function(e){a=arguments,s.html(r?ot("<div>").append(ot.parseHTML(e)).find(r):e)}).complete(i&&function(e,t){s.each(i,a||[e.responseText,t,e])}),this},ot.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){ot.fn[t]=function(e){return this.on(t,e)}}),ot.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:sn,type:"GET",isLocal:fn.test(an[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":xn,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":ot.parseJSON,"text xml":ot.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?N(N(e,ot.ajaxSettings),t):N(ot.ajaxSettings,e)},ajaxPrefilter:$(yn),ajaxTransport:$(bn),ajax:function(e,n){function i(e,n,i,s){var c,d,y,b,w,T=n;2!==x&&(x=2,l&&clearTimeout(l),r=t,a=s||"",k.readyState=e>0?4:0,c=e>=200&&300>e||304===e,i&&(b=R(p,k,i)),b=O(p,b,k,c),c?(p.ifModified&&(w=k.getResponseHeader("Last-Modified"),w&&(ot.lastModified[o]=w),w=k.getResponseHeader("etag"),w&&(ot.etag[o]=w)),204===e||"HEAD"===p.type?T="nocontent":304===e?T="notmodified":(T=b.state,d=b.data,y=b.error,c=!y)):(y=T,(e||!T)&&(T="error",0>e&&(e=0))),k.status=e,k.statusText=(n||T)+"",c?m.resolveWith(f,[d,T,k]):m.rejectWith(f,[k,T,y]),k.statusCode(v),v=t,u&&h.trigger(c?"ajaxSuccess":"ajaxError",[k,p,c?d:y]),g.fireWith(f,[k,T]),u&&(h.trigger("ajaxComplete",[k,p]),--ot.active||ot.event.trigger("ajaxStop")))}"object"==typeof e&&(n=e,e=t),n=n||{};var r,o,a,s,l,c,u,d,p=ot.ajaxSetup({},n),f=p.context||p,h=p.context&&(f.nodeType||f.jquery)?ot(f):ot.event,m=ot.Deferred(),g=ot.Callbacks("once memory"),v=p.statusCode||{},y={},b={},x=0,w="canceled",k={readyState:0,getResponseHeader:function(e){var t;if(2===x){if(!s)for(s={};t=pn.exec(a);)s[t[1].toLowerCase()]=t[2];t=s[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return 2===x?a:null},setRequestHeader:function(e,t){var n=e.toLowerCase();return x||(e=b[n]=b[n]||e,y[e]=t),this},overrideMimeType:function(e){return x||(p.mimeType=e),this},statusCode:function(e){var t;if(e)if(2>x)for(t in e)v[t]=[v[t],e[t]];else k.always(e[k.status]);return this},abort:function(e){var t=e||w;return r&&r.abort(t),i(0,t),this}};if(m.promise(k).complete=g.add,k.success=k.done,k.error=k.fail,p.url=((e||p.url||sn)+"").replace(un,"").replace(mn,an[1]+"//"),p.type=n.method||n.type||p.method||p.type,p.dataTypes=ot.trim(p.dataType||"*").toLowerCase().match(st)||[""],null==p.crossDomain&&(c=gn.exec(p.url.toLowerCase()),p.crossDomain=!(!c||c[1]===an[1]&&c[2]===an[2]&&(c[3]||("http:"===c[1]?"80":"443"))===(an[3]||("http:"===an[1]?"80":"443")))),p.data&&p.processData&&"string"!=typeof p.data&&(p.data=ot.param(p.data,p.traditional)),A(yn,p,n,k),2===x)return k;u=p.global,u&&0===ot.active++&&ot.event.trigger("ajaxStart"),p.type=p.type.toUpperCase(),p.hasContent=!hn.test(p.type),o=p.url,p.hasContent||(p.data&&(o=p.url+=(cn.test(o)?"&":"?")+p.data,delete p.data),p.cache===!1&&(p.url=dn.test(o)?o.replace(dn,"$1_="+ln++):o+(cn.test(o)?"&":"?")+"_="+ln++)),p.ifModified&&(ot.lastModified[o]&&k.setRequestHeader("If-Modified-Since",ot.lastModified[o]),ot.etag[o]&&k.setRequestHeader("If-None-Match",ot.etag[o])),(p.data&&p.hasContent&&p.contentType!==!1||n.contentType)&&k.setRequestHeader("Content-Type",p.contentType),k.setRequestHeader("Accept",p.dataTypes[0]&&p.accepts[p.dataTypes[0]]?p.accepts[p.dataTypes[0]]+("*"!==p.dataTypes[0]?", "+xn+"; q=0.01":""):p.accepts["*"]);for(d in p.headers)k.setRequestHeader(d,p.headers[d]);if(p.beforeSend&&(p.beforeSend.call(f,k,p)===!1||2===x))return k.abort();w="abort";for(d in{success:1,error:1,complete:1})k[d](p[d]);if(r=A(bn,p,n,k)){k.readyState=1,u&&h.trigger("ajaxSend",[k,p]),p.async&&p.timeout>0&&(l=setTimeout(function(){k.abort("timeout")},p.timeout));try{x=1,r.send(y,i)}catch(T){if(!(2>x))throw T;i(-1,T)}}else i(-1,"No Transport");return k},getJSON:function(e,t,n){return ot.get(e,t,n,"json")},getScript:function(e,n){return ot.get(e,t,n,"script")}}),ot.each(["get","post"],function(e,n){ot[n]=function(e,i,r,o){return ot.isFunction(i)&&(o=o||r,r=i,i=t),ot.ajax({url:e,type:n,dataType:o,data:i,success:r})}}),ot.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(e){return ot.globalEval(e),e}}}),ot.ajaxPrefilter("script",function(e){e.cache===t&&(e.cache=!1),e.crossDomain&&(e.type="GET")}),ot.ajaxTransport("script",function(e){if(e.crossDomain){var t,n;return{send:function(i,r){t=ot("<script>").prop({async:!0,charset:e.scriptCharset,src:e.url}).on("load error",n=function(e){t.remove(),n=null,e&&r("error"===e.type?404:200,e.type)}),W.head.appendChild(t[0])},abort:function(){n&&n()}}}});var kn=[],Tn=/(=)\?(?=&|$)|\?\?/;ot.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=kn.pop()||ot.expando+"_"+ln++;return this[e]=!0,e}}),ot.ajaxPrefilter("json jsonp",function(n,i,r){var o,a,s,l=n.jsonp!==!1&&(Tn.test(n.url)?"url":"string"==typeof n.data&&!(n.contentType||"").indexOf("application/x-www-form-urlencoded")&&Tn.test(n.data)&&"data");return l||"jsonp"===n.dataTypes[0]?(o=n.jsonpCallback=ot.isFunction(n.jsonpCallback)?n.jsonpCallback():n.jsonpCallback,l?n[l]=n[l].replace(Tn,"$1"+o):n.jsonp!==!1&&(n.url+=(cn.test(n.url)?"&":"?")+n.jsonp+"="+o),n.converters["script json"]=function(){return s||ot.error(o+" was not called"),s[0]},n.dataTypes[0]="json",a=e[o],e[o]=function(){s=arguments},r.always(function(){e[o]=a,n[o]&&(n.jsonpCallback=i.jsonpCallback,kn.push(o)),s&&ot.isFunction(a)&&a(s[0]),s=a=t}),"script"):t}),ot.ajaxSettings.xhr=function(){try{return new XMLHttpRequest}catch(e){}};var Cn=ot.ajaxSettings.xhr(),Sn={0:200,1223:204},En=0,_n={};e.ActiveXObject&&ot(e).on("unload",function(){for(var e in _n)_n[e]();_n=t}),ot.support.cors=!!Cn&&"withCredentials"in Cn,ot.support.ajax=Cn=!!Cn,ot.ajaxTransport(function(e){var n;return ot.support.cors||Cn&&!e.crossDomain?{send:function(i,r){var o,a,s=e.xhr();if(s.open(e.type,e.url,e.async,e.username,e.password),e.xhrFields)for(o in e.xhrFields)s[o]=e.xhrFields[o];e.mimeType&&s.overrideMimeType&&s.overrideMimeType(e.mimeType),e.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest");for(o in i)s.setRequestHeader(o,i[o]);n=function(e){return function(){n&&(delete _n[a],n=s.onload=s.onerror=null,"abort"===e?s.abort():"error"===e?r(s.status||404,s.statusText):r(Sn[s.status]||s.status,s.statusText,"string"==typeof s.responseText?{text:s.responseText}:t,s.getAllResponseHeaders()))}},s.onload=n(),s.onerror=n("error"),n=_n[a=En++]=n("abort"),s.send(e.hasContent&&e.data||null)},abort:function(){n&&n()}}:t});var $n,An,Nn=/^(?:toggle|show|hide)$/,Rn=RegExp("^(?:([+-])=|)("+at+")([a-z%]*)$","i"),On=/queueHooks$/,Ln=[P],Mn={"*":[function(e,t){var n=this.createTween(e,t),i=n.cur(),r=Rn.exec(t),o=r&&r[3]||(ot.cssNumber[e]?"":"px"),a=(ot.cssNumber[e]||"px"!==o&&+i)&&Rn.exec(ot.css(n.elem,e)),s=1,l=20;if(a&&a[3]!==o){o=o||a[3],r=r||[],a=+i||1;do s=s||".5",a/=s,ot.style(n.elem,e,a+o);while(s!==(s=n.cur()/i)&&1!==s&&--l)}return r&&(a=n.start=+a||+i||0,n.unit=o,n.end=r[1]?a+(r[1]+1)*r[2]:+r[2]),n}]};ot.Animation=ot.extend(D,{tweener:function(e,t){ot.isFunction(e)?(t=e,e=["*"]):e=e.split(" ");for(var n,i=0,r=e.length;r>i;i++)n=e[i],Mn[n]=Mn[n]||[],Mn[n].unshift(t)},prefilter:function(e,t){t?Ln.unshift(e):Ln.push(e)}}),ot.Tween=I,I.prototype={constructor:I,init:function(e,t,n,i,r,o){this.elem=e,this.prop=n,this.easing=r||"swing",this.options=t,this.start=this.now=this.cur(),this.end=i,this.unit=o||(ot.cssNumber[n]?"":"px")},cur:function(){var e=I.propHooks[this.prop];return e&&e.get?e.get(this):I.propHooks._default.get(this)},run:function(e){var t,n=I.propHooks[this.prop];return this.pos=t=this.options.duration?ot.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):I.propHooks._default.set(this),this}},I.prototype.init.prototype=I.prototype,I.propHooks={_default:{get:function(e){var t;return null==e.elem[e.prop]||e.elem.style&&null!=e.elem.style[e.prop]?(t=ot.css(e.elem,e.prop,""),t&&"auto"!==t?t:0):e.elem[e.prop]},set:function(e){ot.fx.step[e.prop]?ot.fx.step[e.prop](e):e.elem.style&&(null!=e.elem.style[ot.cssProps[e.prop]]||ot.cssHooks[e.prop])?ot.style(e.elem,e.prop,e.now+e.unit):e.elem[e.prop]=e.now}}},I.propHooks.scrollTop=I.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},ot.each(["toggle","show","hide"],function(e,t){var n=ot.fn[t];ot.fn[t]=function(e,i,r){return null==e||"boolean"==typeof e?n.apply(this,arguments):this.animate(H(t,!0),e,i,r)}}),ot.fn.extend({fadeTo:function(e,t,n,i){return this.filter(b).css("opacity",0).show().end().animate({opacity:t},e,n,i)},animate:function(e,t,n,i){var r=ot.isEmptyObject(e),o=ot.speed(t,n,i),a=function(){var t=D(this,ot.extend({},e),o);(r||gt.get(this,"finish"))&&t.stop(!0)};return a.finish=a,r||o.queue===!1?this.each(a):this.queue(o.queue,a)},stop:function(e,n,i){var r=function(e){var t=e.stop;delete e.stop,t(i)};return"string"!=typeof e&&(i=n,n=e,e=t),n&&e!==!1&&this.queue(e||"fx",[]),this.each(function(){var t=!0,n=null!=e&&e+"queueHooks",o=ot.timers,a=gt.get(this);if(n)a[n]&&a[n].stop&&r(a[n]);else for(n in a)a[n]&&a[n].stop&&On.test(n)&&r(a[n]);for(n=o.length;n--;)o[n].elem!==this||null!=e&&o[n].queue!==e||(o[n].anim.stop(i),t=!1,o.splice(n,1));(t||!i)&&ot.dequeue(this,e)})},finish:function(e){return e!==!1&&(e=e||"fx"),this.each(function(){var t,n=gt.get(this),i=n[e+"queue"],r=n[e+"queueHooks"],o=ot.timers,a=i?i.length:0;for(n.finish=!0,ot.queue(this,e,[]),r&&r.stop&&r.stop.call(this,!0),t=o.length;t--;)o[t].elem===this&&o[t].queue===e&&(o[t].anim.stop(!0),o.splice(t,1));for(t=0;a>t;t++)i[t]&&i[t].finish&&i[t].finish.call(this);delete n.finish})}}),ot.each({slideDown:H("show"),slideUp:H("hide"),slideToggle:H("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){ot.fn[e]=function(e,n,i){return this.animate(t,e,n,i)}}),ot.speed=function(e,t,n){var i=e&&"object"==typeof e?ot.extend({},e):{complete:n||!n&&t||ot.isFunction(e)&&e,duration:e,easing:n&&t||t&&!ot.isFunction(t)&&t};return i.duration=ot.fx.off?0:"number"==typeof i.duration?i.duration:i.duration in ot.fx.speeds?ot.fx.speeds[i.duration]:ot.fx.speeds._default,(null==i.queue||i.queue===!0)&&(i.queue="fx"),i.old=i.complete,i.complete=function(){ot.isFunction(i.old)&&i.old.call(this),i.queue&&ot.dequeue(this,i.queue)},i},ot.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2}},ot.timers=[],ot.fx=I.prototype.init,ot.fx.tick=function(){var e,n=ot.timers,i=0;for($n=ot.now();n.length>i;i++)e=n[i],e()||n[i]!==e||n.splice(i--,1);n.length||ot.fx.stop(),$n=t},ot.fx.timer=function(e){e()&&ot.timers.push(e)&&ot.fx.start()},ot.fx.interval=13,ot.fx.start=function(){An||(An=setInterval(ot.fx.tick,ot.fx.interval))},ot.fx.stop=function(){clearInterval(An),An=null},ot.fx.speeds={slow:600,fast:200,_default:400},ot.fx.step={},ot.expr&&ot.expr.filters&&(ot.expr.filters.animated=function(e){return ot.grep(ot.timers,function(t){return e===t.elem}).length}),ot.fn.offset=function(e){if(arguments.length)return e===t?this:this.each(function(t){ot.offset.setOffset(this,e,t)});var n,i,r=this[0],o={top:0,left:0},a=r&&r.ownerDocument;return a?(n=a.documentElement,ot.contains(n,r)?(typeof r.getBoundingClientRect!==U&&(o=r.getBoundingClientRect()),i=q(a),{top:o.top+i.pageYOffset-n.clientTop,left:o.left+i.pageXOffset-n.clientLeft}):o):t},ot.offset={setOffset:function(e,t,n){var i,r,o,a,s,l,c,u=ot.css(e,"position"),d=ot(e),p={};"static"===u&&(e.style.position="relative"),s=d.offset(),o=ot.css(e,"top"),l=ot.css(e,"left"),c=("absolute"===u||"fixed"===u)&&(o+l).indexOf("auto")>-1,c?(i=d.position(),a=i.top,r=i.left):(a=parseFloat(o)||0,r=parseFloat(l)||0),ot.isFunction(t)&&(t=t.call(e,n,s)),null!=t.top&&(p.top=t.top-s.top+a),null!=t.left&&(p.left=t.left-s.left+r),"using"in t?t.using.call(e,p):d.css(p)}},ot.fn.extend({position:function(){if(this[0]){var e,t,n=this[0],i={top:0,left:0};return"fixed"===ot.css(n,"position")?t=n.getBoundingClientRect():(e=this.offsetParent(),t=this.offset(),ot.nodeName(e[0],"html")||(i=e.offset()),i.top+=ot.css(e[0],"borderTopWidth",!0),i.left+=ot.css(e[0],"borderLeftWidth",!0)),{top:t.top-i.top-ot.css(n,"marginTop",!0),left:t.left-i.left-ot.css(n,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var e=this.offsetParent||G;e&&!ot.nodeName(e,"html")&&"static"===ot.css(e,"position");)e=e.offsetParent;
return e||G})}}),ot.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(n,i){var r="pageYOffset"===i;ot.fn[n]=function(o){return ot.access(this,function(n,o,a){var s=q(n);return a===t?s?s[i]:n[o]:(s?s.scrollTo(r?e.pageXOffset:a,r?a:e.pageYOffset):n[o]=a,t)},n,o,arguments.length,null)}}),ot.each({Height:"height",Width:"width"},function(e,n){ot.each({padding:"inner"+e,content:n,"":"outer"+e},function(i,r){ot.fn[r]=function(r,o){var a=arguments.length&&(i||"boolean"!=typeof r),s=i||(r===!0||o===!0?"margin":"border");return ot.access(this,function(n,i,r){var o;return ot.isWindow(n)?n.document.documentElement["client"+e]:9===n.nodeType?(o=n.documentElement,Math.max(n.body["scroll"+e],o["scroll"+e],n.body["offset"+e],o["offset"+e],o["client"+e])):r===t?ot.css(n,i,s):ot.style(n,i,r,s)},n,a?r:t,a,null)}})}),ot.fn.size=function(){return this.length},ot.fn.andSelf=ot.fn.addBack,"object"==typeof module&&module&&"object"==typeof module.exports?module.exports=ot:"function"==typeof define&&define.amd&&define("jquery",[],function(){return ot}),"object"==typeof e&&"object"==typeof e.document&&(e.jQuery=e.$=ot)}(window),"undefined"==typeof jQuery)throw Error("Bootstrap's JavaScript requires jQuery");+function(e){"use strict";function t(){var e=document.createElement("bootstrap"),t={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var n in t)if(void 0!==e.style[n])return{end:t[n]};return!1}e.fn.emulateTransitionEnd=function(t){var n=!1,i=this;e(this).one(e.support.transition.end,function(){n=!0});var r=function(){n||e(i).trigger(e.support.transition.end)};return setTimeout(r,t),this},e(function(){e.support.transition=t()})}(jQuery),+function(e){"use strict";var t='[data-dismiss="alert"]',n=function(n){e(n).on("click",t,this.close)};n.prototype.close=function(t){function n(){o.trigger("closed.bs.alert").remove()}var i=e(this),r=i.attr("data-target");r||(r=i.attr("href"),r=r&&r.replace(/.*(?=#[^\s]*$)/,""));var o=e(r);t&&t.preventDefault(),o.length||(o=i.hasClass("alert")?i:i.parent()),o.trigger(t=e.Event("close.bs.alert")),t.isDefaultPrevented()||(o.removeClass("in"),e.support.transition&&o.hasClass("fade")?o.one(e.support.transition.end,n).emulateTransitionEnd(150):n())};var i=e.fn.alert;e.fn.alert=function(t){return this.each(function(){var i=e(this),r=i.data("bs.alert");r||i.data("bs.alert",r=new n(this)),"string"==typeof t&&r[t].call(i)})},e.fn.alert.Constructor=n,e.fn.alert.noConflict=function(){return e.fn.alert=i,this},e(document).on("click.bs.alert.data-api",t,n.prototype.close)}(jQuery),+function(e){"use strict";var t=function(n,i){this.$element=e(n),this.options=e.extend({},t.DEFAULTS,i),this.isLoading=!1};t.DEFAULTS={loadingText:"loading..."},t.prototype.setState=function(t){var n="disabled",i=this.$element,r=i.is("input")?"val":"html",o=i.data();t+="Text",o.resetText||i.data("resetText",i[r]()),i[r](o[t]||this.options[t]),setTimeout(e.proxy(function(){"loadingText"==t?(this.isLoading=!0,i.addClass(n).attr(n,n)):this.isLoading&&(this.isLoading=!1,i.removeClass(n).removeAttr(n))},this),0)},t.prototype.toggle=function(){var e=!0,t=this.$element.closest('[data-toggle="buttons"]');if(t.length){var n=this.$element.find("input");"radio"==n.prop("type")&&(n.prop("checked")&&this.$element.hasClass("active")?e=!1:t.find(".active").removeClass("active")),e&&n.prop("checked",!this.$element.hasClass("active")).trigger("change")}e&&this.$element.toggleClass("active")};var n=e.fn.button;e.fn.button=function(n){return this.each(function(){var i=e(this),r=i.data("bs.button"),o="object"==typeof n&&n;r||i.data("bs.button",r=new t(this,o)),"toggle"==n?r.toggle():n&&r.setState(n)})},e.fn.button.Constructor=t,e.fn.button.noConflict=function(){return e.fn.button=n,this},e(document).on("click.bs.button.data-api","[data-toggle^=button]",function(t){var n=e(t.target);n.hasClass("btn")||(n=n.closest(".btn")),n.button("toggle"),t.preventDefault()})}(jQuery),+function(e){"use strict";var t=function(t,n){this.$element=e(t),this.$indicators=this.$element.find(".carousel-indicators"),this.options=n,this.paused=this.sliding=this.interval=this.$active=this.$items=null,"hover"==this.options.pause&&this.$element.on("mouseenter",e.proxy(this.pause,this)).on("mouseleave",e.proxy(this.cycle,this))};t.DEFAULTS={interval:5e3,pause:"hover",wrap:!0},t.prototype.cycle=function(t){return t||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(e.proxy(this.next,this),this.options.interval)),this},t.prototype.getActiveIndex=function(){return this.$active=this.$element.find(".item.active"),this.$items=this.$active.parent().children(),this.$items.index(this.$active)},t.prototype.to=function(t){var n=this,i=this.getActiveIndex();return t>this.$items.length-1||0>t?void 0:this.sliding?this.$element.one("slid.bs.carousel",function(){n.to(t)}):i==t?this.pause().cycle():this.slide(t>i?"next":"prev",e(this.$items[t]))},t.prototype.pause=function(t){return t||(this.paused=!0),this.$element.find(".next, .prev").length&&e.support.transition&&(this.$element.trigger(e.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},t.prototype.next=function(){return this.sliding?void 0:this.slide("next")},t.prototype.prev=function(){return this.sliding?void 0:this.slide("prev")},t.prototype.slide=function(t,n){var i=this.$element.find(".item.active"),r=n||i[t](),o=this.interval,a="next"==t?"left":"right",s="next"==t?"first":"last",l=this;if(!r.length){if(!this.options.wrap)return;r=this.$element.find(".item")[s]()}if(r.hasClass("active"))return this.sliding=!1;var c=e.Event("slide.bs.carousel",{relatedTarget:r[0],direction:a});return this.$element.trigger(c),c.isDefaultPrevented()?void 0:(this.sliding=!0,o&&this.pause(),this.$indicators.length&&(this.$indicators.find(".active").removeClass("active"),this.$element.one("slid.bs.carousel",function(){var t=e(l.$indicators.children()[l.getActiveIndex()]);t&&t.addClass("active")})),e.support.transition&&this.$element.hasClass("slide")?(r.addClass(t),r[0].offsetWidth,i.addClass(a),r.addClass(a),i.one(e.support.transition.end,function(){r.removeClass([t,a].join(" ")).addClass("active"),i.removeClass(["active",a].join(" ")),l.sliding=!1,setTimeout(function(){l.$element.trigger("slid.bs.carousel")},0)}).emulateTransitionEnd(1e3*i.css("transition-duration").slice(0,-1))):(i.removeClass("active"),r.addClass("active"),this.sliding=!1,this.$element.trigger("slid.bs.carousel")),o&&this.cycle(),this)};var n=e.fn.carousel;e.fn.carousel=function(n){return this.each(function(){var i=e(this),r=i.data("bs.carousel"),o=e.extend({},t.DEFAULTS,i.data(),"object"==typeof n&&n),a="string"==typeof n?n:o.slide;r||i.data("bs.carousel",r=new t(this,o)),"number"==typeof n?r.to(n):a?r[a]():o.interval&&r.pause().cycle()})},e.fn.carousel.Constructor=t,e.fn.carousel.noConflict=function(){return e.fn.carousel=n,this},e(document).on("click.bs.carousel.data-api","[data-slide], [data-slide-to]",function(t){var n,i=e(this),r=e(i.attr("data-target")||(n=i.attr("href"))&&n.replace(/.*(?=#[^\s]+$)/,"")),o=e.extend({},r.data(),i.data()),a=i.attr("data-slide-to");a&&(o.interval=!1),r.carousel(o),(a=i.attr("data-slide-to"))&&r.data("bs.carousel").to(a),t.preventDefault()}),e(window).on("load",function(){e('[data-ride="carousel"]').each(function(){var t=e(this);t.carousel(t.data())})})}(jQuery),+function(e){"use strict";var t=function(n,i){this.$element=e(n),this.options=e.extend({},t.DEFAULTS,i),this.transitioning=null,this.options.parent&&(this.$parent=e(this.options.parent)),this.options.toggle&&this.toggle()};t.DEFAULTS={toggle:!0},t.prototype.dimension=function(){var e=this.$element.hasClass("width");return e?"width":"height"},t.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var t=e.Event("show.bs.collapse");if(this.$element.trigger(t),!t.isDefaultPrevented()){var n=this.$parent&&this.$parent.find("> .panel > .in");if(n&&n.length){var i=n.data("bs.collapse");if(i&&i.transitioning)return;n.collapse("hide"),i||n.data("bs.collapse",null)}var r=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[r](0),this.transitioning=1;var o=function(){this.$element.removeClass("collapsing").addClass("collapse in")[r]("auto"),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!e.support.transition)return o.call(this);var a=e.camelCase(["scroll",r].join("-"));this.$element.one(e.support.transition.end,e.proxy(o,this)).emulateTransitionEnd(350)[r](this.$element[0][a])}}},t.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var t=e.Event("hide.bs.collapse");if(this.$element.trigger(t),!t.isDefaultPrevented()){var n=this.dimension();this.$element[n](this.$element[n]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse").removeClass("in"),this.transitioning=1;var i=function(){this.transitioning=0,this.$element.trigger("hidden.bs.collapse").removeClass("collapsing").addClass("collapse")};return e.support.transition?void this.$element[n](0).one(e.support.transition.end,e.proxy(i,this)).emulateTransitionEnd(350):i.call(this)}}},t.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()};var n=e.fn.collapse;e.fn.collapse=function(n){return this.each(function(){var i=e(this),r=i.data("bs.collapse"),o=e.extend({},t.DEFAULTS,i.data(),"object"==typeof n&&n);!r&&o.toggle&&"show"==n&&(n=!n),r||i.data("bs.collapse",r=new t(this,o)),"string"==typeof n&&r[n]()})},e.fn.collapse.Constructor=t,e.fn.collapse.noConflict=function(){return e.fn.collapse=n,this},e(document).on("click.bs.collapse.data-api","[data-toggle=collapse]",function(t){var n,i=e(this),r=i.attr("data-target")||t.preventDefault()||(n=i.attr("href"))&&n.replace(/.*(?=#[^\s]+$)/,""),o=e(r),a=o.data("bs.collapse"),s=a?"toggle":i.data(),l=i.attr("data-parent"),c=l&&e(l);a&&a.transitioning||(c&&c.find('[data-toggle=collapse][data-parent="'+l+'"]').not(i).addClass("collapsed"),i[o.hasClass("in")?"addClass":"removeClass"]("collapsed")),o.collapse(s)})}(jQuery),+function(e){"use strict";function t(t){e(i).remove(),e(r).each(function(){var i=n(e(this)),r={relatedTarget:this};i.hasClass("open")&&(i.trigger(t=e.Event("hide.bs.dropdown",r)),t.isDefaultPrevented()||i.removeClass("open").trigger("hidden.bs.dropdown",r))})}function n(t){var n=t.attr("data-target");n||(n=t.attr("href"),n=n&&/#[A-Za-z]/.test(n)&&n.replace(/.*(?=#[^\s]*$)/,""));var i=n&&e(n);return i&&i.length?i:t.parent()}var i=".dropdown-backdrop",r="[data-toggle=dropdown]",o=function(t){e(t).on("click.bs.dropdown",this.toggle)};o.prototype.toggle=function(i){var r=e(this);if(!r.is(".disabled, :disabled")){var o=n(r),a=o.hasClass("open");if(t(),!a){"ontouchstart"in document.documentElement&&!o.closest(".navbar-nav").length&&e('<div class="dropdown-backdrop"/>').insertAfter(e(this)).on("click",t);var s={relatedTarget:this};if(o.trigger(i=e.Event("show.bs.dropdown",s)),i.isDefaultPrevented())return;o.toggleClass("open").trigger("shown.bs.dropdown",s),r.focus()}return!1}},o.prototype.keydown=function(t){if(/(38|40|27)/.test(t.keyCode)){var i=e(this);if(t.preventDefault(),t.stopPropagation(),!i.is(".disabled, :disabled")){var o=n(i),a=o.hasClass("open");if(!a||a&&27==t.keyCode)return 27==t.which&&o.find(r).focus(),i.click();var s=" li:not(.divider):visible a",l=o.find("[role=menu]"+s+", [role=listbox]"+s);if(l.length){var c=l.index(l.filter(":focus"));38==t.keyCode&&c>0&&c--,40==t.keyCode&&l.length-1>c&&c++,~c||(c=0),l.eq(c).focus()}}}};var a=e.fn.dropdown;e.fn.dropdown=function(t){return this.each(function(){var n=e(this),i=n.data("bs.dropdown");i||n.data("bs.dropdown",i=new o(this)),"string"==typeof t&&i[t].call(n)})},e.fn.dropdown.Constructor=o,e.fn.dropdown.noConflict=function(){return e.fn.dropdown=a,this},e(document).on("click.bs.dropdown.data-api",t).on("click.bs.dropdown.data-api",".dropdown form",function(e){e.stopPropagation()}).on("click.bs.dropdown.data-api",r,o.prototype.toggle).on("keydown.bs.dropdown.data-api",r+", [role=menu], [role=listbox]",o.prototype.keydown)}(jQuery),+function(e){"use strict";var t=function(t,n){this.options=n,this.$element=e(t),this.$backdrop=this.isShown=null,this.options.remote&&this.$element.find(".modal-content").load(this.options.remote,e.proxy(function(){this.$element.trigger("loaded.bs.modal")},this))};t.DEFAULTS={backdrop:!0,keyboard:!0,show:!0},t.prototype.toggle=function(e){return this[this.isShown?"hide":"show"](e)},t.prototype.show=function(t){var n=this,i=e.Event("show.bs.modal",{relatedTarget:t});this.$element.trigger(i),this.isShown||i.isDefaultPrevented()||(this.isShown=!0,this.escape(),this.$element.on("click.dismiss.bs.modal",'[data-dismiss="modal"]',e.proxy(this.hide,this)),this.backdrop(function(){var i=e.support.transition&&n.$element.hasClass("fade");n.$element.parent().length||n.$element.appendTo(document.body),n.$element.show().scrollTop(0),i&&n.$element[0].offsetWidth,n.$element.addClass("in").attr("aria-hidden",!1),n.enforceFocus();var r=e.Event("shown.bs.modal",{relatedTarget:t});i?n.$element.find(".modal-dialog").one(e.support.transition.end,function(){n.$element.focus().trigger(r)}).emulateTransitionEnd(300):n.$element.focus().trigger(r)}))},t.prototype.hide=function(t){t&&t.preventDefault(),t=e.Event("hide.bs.modal"),this.$element.trigger(t),this.isShown&&!t.isDefaultPrevented()&&(this.isShown=!1,this.escape(),e(document).off("focusin.bs.modal"),this.$element.removeClass("in").attr("aria-hidden",!0).off("click.dismiss.bs.modal"),e.support.transition&&this.$element.hasClass("fade")?this.$element.one(e.support.transition.end,e.proxy(this.hideModal,this)).emulateTransitionEnd(300):this.hideModal())},t.prototype.enforceFocus=function(){e(document).off("focusin.bs.modal").on("focusin.bs.modal",e.proxy(function(e){this.$element[0]===e.target||this.$element.has(e.target).length||this.$element.focus()},this))},t.prototype.escape=function(){this.isShown&&this.options.keyboard?this.$element.on("keyup.dismiss.bs.modal",e.proxy(function(e){27==e.which&&this.hide()},this)):this.isShown||this.$element.off("keyup.dismiss.bs.modal")},t.prototype.hideModal=function(){var e=this;this.$element.hide(),this.backdrop(function(){e.removeBackdrop(),e.$element.trigger("hidden.bs.modal")})},t.prototype.removeBackdrop=function(){this.$backdrop&&this.$backdrop.remove(),this.$backdrop=null},t.prototype.backdrop=function(t){var n=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var i=e.support.transition&&n;if(this.$backdrop=e('<div class="modal-backdrop '+n+'" />').appendTo(document.body),this.$element.on("click.dismiss.bs.modal",e.proxy(function(e){e.target===e.currentTarget&&("static"==this.options.backdrop?this.$element[0].focus.call(this.$element[0]):this.hide.call(this))},this)),i&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in"),!t)return;i?this.$backdrop.one(e.support.transition.end,t).emulateTransitionEnd(150):t()}else!this.isShown&&this.$backdrop?(this.$backdrop.removeClass("in"),e.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one(e.support.transition.end,t).emulateTransitionEnd(150):t()):t&&t()};var n=e.fn.modal;e.fn.modal=function(n,i){return this.each(function(){var r=e(this),o=r.data("bs.modal"),a=e.extend({},t.DEFAULTS,r.data(),"object"==typeof n&&n);o||r.data("bs.modal",o=new t(this,a)),"string"==typeof n?o[n](i):a.show&&o.show(i)})},e.fn.modal.Constructor=t,e.fn.modal.noConflict=function(){return e.fn.modal=n,this},e(document).on("click.bs.modal.data-api",'[data-toggle="modal"]',function(t){var n=e(this),i=n.attr("href"),r=e(n.attr("data-target")||i&&i.replace(/.*(?=#[^\s]+$)/,"")),o=r.data("bs.modal")?"toggle":e.extend({remote:!/#/.test(i)&&i},r.data(),n.data());n.is("a")&&t.preventDefault(),r.modal(o,this).one("hide",function(){n.is(":visible")&&n.focus()})}),e(document).on("show.bs.modal",".modal",function(){e(document.body).addClass("modal-open")}).on("hidden.bs.modal",".modal",function(){e(document.body).removeClass("modal-open")})}(jQuery),+function(e){"use strict";var t=function(e,t){this.type=this.options=this.enabled=this.timeout=this.hoverState=this.$element=null,this.init("tooltip",e,t)};t.DEFAULTS={animation:!0,placement:"top",selector:!1,template:'<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',trigger:"hover focus",title:"",delay:0,html:!1,container:!1},t.prototype.init=function(t,n,i){this.enabled=!0,this.type=t,this.$element=e(n),this.options=this.getOptions(i);for(var r=this.options.trigger.split(" "),o=r.length;o--;){var a=r[o];if("click"==a)this.$element.on("click."+this.type,this.options.selector,e.proxy(this.toggle,this));else if("manual"!=a){var s="hover"==a?"mouseenter":"focusin",l="hover"==a?"mouseleave":"focusout";this.$element.on(s+"."+this.type,this.options.selector,e.proxy(this.enter,this)),this.$element.on(l+"."+this.type,this.options.selector,e.proxy(this.leave,this))}}this.options.selector?this._options=e.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},t.prototype.getDefaults=function(){return t.DEFAULTS},t.prototype.getOptions=function(t){return t=e.extend({},this.getDefaults(),this.$element.data(),t),t.delay&&"number"==typeof t.delay&&(t.delay={show:t.delay,hide:t.delay}),t},t.prototype.getDelegateOptions=function(){var t={},n=this.getDefaults();return this._options&&e.each(this._options,function(e,i){n[e]!=i&&(t[e]=i)}),t},t.prototype.enter=function(t){var n=t instanceof this.constructor?t:e(t.currentTarget)[this.type](this.getDelegateOptions()).data("bs."+this.type);return clearTimeout(n.timeout),n.hoverState="in",n.options.delay&&n.options.delay.show?void(n.timeout=setTimeout(function(){"in"==n.hoverState&&n.show()},n.options.delay.show)):n.show()},t.prototype.leave=function(t){var n=t instanceof this.constructor?t:e(t.currentTarget)[this.type](this.getDelegateOptions()).data("bs."+this.type);return clearTimeout(n.timeout),n.hoverState="out",n.options.delay&&n.options.delay.hide?void(n.timeout=setTimeout(function(){"out"==n.hoverState&&n.hide()},n.options.delay.hide)):n.hide()},t.prototype.show=function(){var t=e.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){if(this.$element.trigger(t),t.isDefaultPrevented())return;var n=this,i=this.tip();this.setContent(),this.options.animation&&i.addClass("fade");var r="function"==typeof this.options.placement?this.options.placement.call(this,i[0],this.$element[0]):this.options.placement,o=/\s?auto?\s?/i,a=o.test(r);a&&(r=r.replace(o,"")||"top"),i.detach().css({top:0,left:0,display:"block"}).addClass(r),this.options.container?i.appendTo(this.options.container):i.insertAfter(this.$element);var s=this.getPosition(),l=i[0].offsetWidth,c=i[0].offsetHeight;if(a){var u=this.$element.parent(),d=r,p=document.documentElement.scrollTop||document.body.scrollTop,f="body"==this.options.container?window.innerWidth:u.outerWidth(),h="body"==this.options.container?window.innerHeight:u.outerHeight(),m="body"==this.options.container?0:u.offset().left;r="bottom"==r&&s.top+s.height+c-p>h?"top":"top"==r&&0>s.top-p-c?"bottom":"right"==r&&s.right+l>f?"left":"left"==r&&m>s.left-l?"right":r,i.removeClass(d).addClass(r)}var g=this.getCalculatedOffset(r,s,l,c);this.applyPlacement(g,r),this.hoverState=null;var v=function(){n.$element.trigger("shown.bs."+n.type)};e.support.transition&&this.$tip.hasClass("fade")?i.one(e.support.transition.end,v).emulateTransitionEnd(150):v()}},t.prototype.applyPlacement=function(t,n){var i,r=this.tip(),o=r[0].offsetWidth,a=r[0].offsetHeight,s=parseInt(r.css("margin-top"),10),l=parseInt(r.css("margin-left"),10);isNaN(s)&&(s=0),isNaN(l)&&(l=0),t.top=t.top+s,t.left=t.left+l,e.offset.setOffset(r[0],e.extend({using:function(e){r.css({top:Math.round(e.top),left:Math.round(e.left)})}},t),0),r.addClass("in");var c=r[0].offsetWidth,u=r[0].offsetHeight;if("top"==n&&u!=a&&(i=!0,t.top=t.top+a-u),/bottom|top/.test(n)){var d=0;0>t.left&&(d=-2*t.left,t.left=0,r.offset(t),c=r[0].offsetWidth,u=r[0].offsetHeight),this.replaceArrow(d-o+c,c,"left")}else this.replaceArrow(u-a,u,"top");i&&r.offset(t)},t.prototype.replaceArrow=function(e,t,n){this.arrow().css(n,e?50*(1-e/t)+"%":"")},t.prototype.setContent=function(){var e=this.tip(),t=this.getTitle();e.find(".tooltip-inner")[this.options.html?"html":"text"](t),e.removeClass("fade in top bottom left right")},t.prototype.hide=function(){function t(){"in"!=n.hoverState&&i.detach(),n.$element.trigger("hidden.bs."+n.type)}var n=this,i=this.tip(),r=e.Event("hide.bs."+this.type);return this.$element.trigger(r),r.isDefaultPrevented()?void 0:(i.removeClass("in"),e.support.transition&&this.$tip.hasClass("fade")?i.one(e.support.transition.end,t).emulateTransitionEnd(150):t(),this.hoverState=null,this)},t.prototype.fixTitle=function(){var e=this.$element;(e.attr("title")||"string"!=typeof e.attr("data-original-title"))&&e.attr("data-original-title",e.attr("title")||"").attr("title","")},t.prototype.hasContent=function(){return this.getTitle()},t.prototype.getPosition=function(){var t=this.$element[0];return e.extend({},"function"==typeof t.getBoundingClientRect?t.getBoundingClientRect():{width:t.offsetWidth,height:t.offsetHeight},this.$element.offset())},t.prototype.getCalculatedOffset=function(e,t,n,i){return"bottom"==e?{top:t.top+t.height,left:t.left+t.width/2-n/2}:"top"==e?{top:t.top-i,left:t.left+t.width/2-n/2}:"left"==e?{top:t.top+t.height/2-i/2,left:t.left-n}:{top:t.top+t.height/2-i/2,left:t.left+t.width}},t.prototype.getTitle=function(){var e,t=this.$element,n=this.options;return e=t.attr("data-original-title")||("function"==typeof n.title?n.title.call(t[0]):n.title)},t.prototype.tip=function(){return this.$tip=this.$tip||e(this.options.template)},t.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},t.prototype.validate=function(){this.$element[0].parentNode||(this.hide(),this.$element=null,this.options=null)},t.prototype.enable=function(){this.enabled=!0},t.prototype.disable=function(){this.enabled=!1},t.prototype.toggleEnabled=function(){this.enabled=!this.enabled},t.prototype.toggle=function(t){var n=t?e(t.currentTarget)[this.type](this.getDelegateOptions()).data("bs."+this.type):this;n.tip().hasClass("in")?n.leave(n):n.enter(n)},t.prototype.destroy=function(){clearTimeout(this.timeout),this.hide().$element.off("."+this.type).removeData("bs."+this.type)};var n=e.fn.tooltip;e.fn.tooltip=function(n){return this.each(function(){var i=e(this),r=i.data("bs.tooltip"),o="object"==typeof n&&n;(r||"destroy"!=n)&&(r||i.data("bs.tooltip",r=new t(this,o)),"string"==typeof n&&r[n]())})},e.fn.tooltip.Constructor=t,e.fn.tooltip.noConflict=function(){return e.fn.tooltip=n,this}}(jQuery),+function(e){"use strict";var t=function(e,t){this.init("popover",e,t)};if(!e.fn.tooltip)throw Error("Popover requires tooltip.js");t.DEFAULTS=e.extend({},e.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:'<div class="popover"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'}),t.prototype=e.extend({},e.fn.tooltip.Constructor.prototype),t.prototype.constructor=t,t.prototype.getDefaults=function(){return t.DEFAULTS},t.prototype.setContent=function(){var e=this.tip(),t=this.getTitle(),n=this.getContent();e.find(".popover-title")[this.options.html?"html":"text"](t),e.find(".popover-content")[this.options.html?"string"==typeof n?"html":"append":"text"](n),e.removeClass("fade top bottom left right in"),e.find(".popover-title").html()||e.find(".popover-title").hide()},t.prototype.hasContent=function(){return this.getTitle()||this.getContent()},t.prototype.getContent=function(){var e=this.$element,t=this.options;return e.attr("data-content")||("function"==typeof t.content?t.content.call(e[0]):t.content)},t.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")},t.prototype.tip=function(){return this.$tip||(this.$tip=e(this.options.template)),this.$tip};var n=e.fn.popover;e.fn.popover=function(n){return this.each(function(){var i=e(this),r=i.data("bs.popover"),o="object"==typeof n&&n;(r||"destroy"!=n)&&(r||i.data("bs.popover",r=new t(this,o)),"string"==typeof n&&r[n]())})},e.fn.popover.Constructor=t,e.fn.popover.noConflict=function(){return e.fn.popover=n,this}}(jQuery),+function(e){"use strict";function t(n,i){var r,o=e.proxy(this.process,this);this.$element=e(e(n).is("body")?window:n),this.$body=e("body"),this.$scrollElement=this.$element.on("scroll.bs.scroll-spy.data-api",o),this.options=e.extend({},t.DEFAULTS,i),this.selector=(this.options.target||(r=e(n).attr("href"))&&r.replace(/.*(?=#[^\s]+$)/,"")||"")+" .nav li > a",this.offsets=e([]),this.targets=e([]),this.activeTarget=null,this.refresh(),this.process()}t.DEFAULTS={offset:10},t.prototype.refresh=function(){var t=this.$element[0]==window?"offset":"position";this.offsets=e([]),this.targets=e([]);var n=this;this.$body.find(this.selector).map(function(){var i=e(this),r=i.data("target")||i.attr("href"),o=/^#./.test(r)&&e(r);return o&&o.length&&o.is(":visible")&&[[o[t]().top+(!e.isWindow(n.$scrollElement.get(0))&&n.$scrollElement.scrollTop()),r]]||null}).sort(function(e,t){return e[0]-t[0]}).each(function(){n.offsets.push(this[0]),n.targets.push(this[1])})},t.prototype.process=function(){var e,t=this.$scrollElement.scrollTop()+this.options.offset,n=this.$scrollElement[0].scrollHeight||this.$body[0].scrollHeight,i=n-this.$scrollElement.height(),r=this.offsets,o=this.targets,a=this.activeTarget;if(t>=i)return a!=(e=o.last()[0])&&this.activate(e);if(a&&r[0]>=t)return a!=(e=o[0])&&this.activate(e);for(e=r.length;e--;)a!=o[e]&&t>=r[e]&&(!r[e+1]||r[e+1]>=t)&&this.activate(o[e])},t.prototype.activate=function(t){this.activeTarget=t,e(this.selector).parentsUntil(this.options.target,".active").removeClass("active");var n=this.selector+'[data-target="'+t+'"],'+this.selector+'[href="'+t+'"]',i=e(n).parents("li").addClass("active");i.parent(".dropdown-menu").length&&(i=i.closest("li.dropdown").addClass("active")),i.trigger("activate.bs.scrollspy")};var n=e.fn.scrollspy;e.fn.scrollspy=function(n){return this.each(function(){var i=e(this),r=i.data("bs.scrollspy"),o="object"==typeof n&&n;r||i.data("bs.scrollspy",r=new t(this,o)),"string"==typeof n&&r[n]()})},e.fn.scrollspy.Constructor=t,e.fn.scrollspy.noConflict=function(){return e.fn.scrollspy=n,this},e(window).on("load",function(){e('[data-spy="scroll"]').each(function(){var t=e(this);t.scrollspy(t.data())})})}(jQuery),+function(e){"use strict";var t=function(t){this.element=e(t)};t.prototype.show=function(){var t=this.element,n=t.closest("ul:not(.dropdown-menu)"),i=t.data("target");if(i||(i=t.attr("href"),i=i&&i.replace(/.*(?=#[^\s]*$)/,"")),!t.parent("li").hasClass("active")){var r=n.find(".active:last a")[0],o=e.Event("show.bs.tab",{relatedTarget:r});if(t.trigger(o),!o.isDefaultPrevented()){var a=e(i);this.activate(t.parent("li"),n),this.activate(a,a.parent(),function(){t.trigger({type:"shown.bs.tab",relatedTarget:r})})}}},t.prototype.activate=function(t,n,i){function r(){o.removeClass("active").find("> .dropdown-menu > .active").removeClass("active"),t.addClass("active"),a?(t[0].offsetWidth,t.addClass("in")):t.removeClass("fade"),t.parent(".dropdown-menu")&&t.closest("li.dropdown").addClass("active"),i&&i()}var o=n.find("> .active"),a=i&&e.support.transition&&o.hasClass("fade");a?o.one(e.support.transition.end,r).emulateTransitionEnd(150):r(),o.removeClass("in")};var n=e.fn.tab;e.fn.tab=function(n){return this.each(function(){var i=e(this),r=i.data("bs.tab");r||i.data("bs.tab",r=new t(this)),"string"==typeof n&&r[n]()})},e.fn.tab.Constructor=t,e.fn.tab.noConflict=function(){return e.fn.tab=n,this},e(document).on("click.bs.tab.data-api",'[data-toggle="tab"], [data-toggle="pill"]',function(t){t.preventDefault(),e(this).tab("show")})}(jQuery),+function(e){"use strict";var t=function(n,i){this.options=e.extend({},t.DEFAULTS,i),this.$window=e(window).on("scroll.bs.affix.data-api",e.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",e.proxy(this.checkPositionWithEventLoop,this)),this.$element=e(n),this.affixed=this.unpin=this.pinnedOffset=null,this.checkPosition()};t.RESET="affix affix-top affix-bottom",t.DEFAULTS={offset:0},t.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(t.RESET).addClass("affix");var e=this.$window.scrollTop(),n=this.$element.offset();return this.pinnedOffset=n.top-e},t.prototype.checkPositionWithEventLoop=function(){setTimeout(e.proxy(this.checkPosition,this),1)},t.prototype.checkPosition=function(){if(this.$element.is(":visible")){var n=e(document).height(),i=this.$window.scrollTop(),r=this.$element.offset(),o=this.options.offset,a=o.top,s=o.bottom;"top"==this.affixed&&(r.top+=i),"object"!=typeof o&&(s=a=o),"function"==typeof a&&(a=o.top(this.$element)),"function"==typeof s&&(s=o.bottom(this.$element));var l=null!=this.unpin&&r.top>=i+this.unpin?!1:null!=s&&r.top+this.$element.height()>=n-s?"bottom":null!=a&&a>=i?"top":!1;if(this.affixed!==l){this.unpin&&this.$element.css("top","");var c="affix"+(l?"-"+l:""),u=e.Event(c+".bs.affix");this.$element.trigger(u),u.isDefaultPrevented()||(this.affixed=l,this.unpin="bottom"==l?this.getPinnedOffset():null,this.$element.removeClass(t.RESET).addClass(c).trigger(e.Event(c.replace("affix","affixed"))),"bottom"==l&&this.$element.offset({top:n-s-this.$element.height()}))}}};var n=e.fn.affix;e.fn.affix=function(n){return this.each(function(){var i=e(this),r=i.data("bs.affix"),o="object"==typeof n&&n;r||i.data("bs.affix",r=new t(this,o)),"string"==typeof n&&r[n]()})},e.fn.affix.Constructor=t,e.fn.affix.noConflict=function(){return e.fn.affix=n,this},e(window).on("load",function(){e('[data-spy="affix"]').each(function(){var t=e(this),n=t.data();n.offset=n.offset||{},n.offsetBottom&&(n.offset.bottom=n.offsetBottom),n.offsetTop&&(n.offset.top=n.offsetTop),t.affix(n)})})}(jQuery),window.bootbox=window.bootbox||function init(e,t){"use strict";function n(e){return m[f.locale][e]||m.en[e]}function i(t,n,i){t.preventDefault();var r=e.isFunction(i)&&i(t)===!1;r||n.modal("hide")}function r(e){var t,n=0;for(t in e)n++;return n}function o(t,n){var i=0;e.each(t,function(e,t){n(e,t,i++)})}function a(t){var n,i;if("object"!=typeof t)throw Error("Please supply an object of options");if(!t.message)throw Error("Please specify a message");return t=e.extend({},f,t),t.buttons||(t.buttons={}),t.backdrop=t.backdrop?"static":!1,n=t.buttons,i=r(n),o(n,function(e,t,n){if(!t.label)throw Error("button with key "+e+" requires a label");t.className||(t.className=2>=i&&n===i-1?"btn-primary":"btn-default")}),t}function s(e,t){var n=e.length,i={};if(1>n||n>2)throw Error("Invalid argument length");return 2===n||"string"==typeof e[0]?(i[t[0]]=e[0],i[t[1]]=e[1]):i=e[0],i}function l(t,n,i){return e.extend(!0,{},t,s(n,i))}function c(){for(var e={},t=0,i=arguments.length;i>t;t++){var r=arguments[t],o=r.toLowerCase(),a=r.toUpperCase();e[o]={label:n(a)}}return e}function u(){return{buttons:c.apply(null,arguments)}}var d={dialog:"<div class='bootbox modal' tabindex='-1' role='dialog'><div class='modal-dialog'><div class='modal-content'><div class='modal-body'><div class='bootbox-body'></div></div></div></div></div>",header:"<div class='modal-header'><h4 class='modal-title'></h4></div>",footer:"<div class='modal-footer'></div>",closeButton:"<button type='button' class='bootbox-close-button close'>×</button>",form:"<form class='bootbox-form'></form>",inputs:{text:"<input class='bootbox-input form-control' autocomplete=off type=text />"}},p=e("body"),f={locale:"en",backdrop:!0,animate:!0,className:null,closeButton:!0,show:!0},h={};h.alert=function(){var t;if(t=l(u("ok"),arguments,["message","callback"]),t.callback&&!e.isFunction(t.callback))throw Error("alert requires callback property to be a function when provided");
return t.buttons.ok.callback=t.onEscape=function(){return e.isFunction(t.callback)?t.callback():!0},h.dialog(t)},h.confirm=function(){var t;if(t=l(u("cancel","confirm"),arguments,["message","callback"]),t.buttons.cancel.callback=t.onEscape=function(){return t.callback(!1)},t.buttons.confirm.callback=function(){return t.callback(!0)},!e.isFunction(t.callback))throw Error("confirm requires a callback");return h.dialog(t)},h.prompt=function(){var n,i,r,o,a,s;if(o=e(d.form),i={buttons:c("cancel","confirm"),value:""},n=l(i,arguments,["title","callback"]),s=n.show===t?!0:n.show,n.message=o,n.buttons.cancel.callback=n.onEscape=function(){return n.callback(null)},n.buttons.confirm.callback=function(){return n.callback(a.val())},n.show=!1,!n.title)throw Error("prompt requires a title");if(!e.isFunction(n.callback))throw Error("prompt requires a callback");return a=e(d.inputs.text),a.val(n.value),o.append(a),o.on("submit",function(e){e.preventDefault(),r.find(".btn-primary").click()}),r=h.dialog(n),r.off("shown.bs.modal"),r.on("shown.bs.modal",function(){a.focus()}),s===!0&&r.modal("show"),r},h.dialog=function(t){t=a(t);var n=e(d.dialog),r=n.find(".modal-body"),s=t.buttons,l="",c={onEscape:t.onEscape};if(o(s,function(e,t){l+="<button data-bb-handler='"+e+"' type='button' class='btn "+t.className+"'>"+t.label+"</button>",c[e]=t.callback}),r.find(".bootbox-body").html(t.message),t.animate===!0&&n.addClass("fade"),t.className&&n.addClass(t.className),t.title&&r.before(d.header),t.closeButton){var u=e(d.closeButton);t.title?n.find(".modal-header").prepend(u):u.css("margin-top","-10px").prependTo(r)}return t.title&&n.find(".modal-title").html(t.title),l.length&&(r.after(d.footer),n.find(".modal-footer").html(l)),n.on("hidden.bs.modal",function(e){e.target===this&&n.remove()}),n.on("shown.bs.modal",function(){n.find(".btn-primary:first").focus()}),n.on("escape.close.bb",function(e){c.onEscape&&i(e,n,c.onEscape)}),n.on("click",".modal-footer button",function(t){var r=e(this).data("bb-handler");i(t,n,c[r])}),n.on("click",".bootbox-close-button",function(e){i(e,n,c.onEscape)}),n.on("keyup",function(e){27===e.which&&n.trigger("escape.close.bb")}),p.append(n),n.modal({backdrop:t.backdrop,keyboard:!1,show:!1}),t.show&&n.modal("show"),n},h.setDefaults=function(t){e.extend(f,t)},h.hideAll=function(){e(".bootbox").modal("hide")};var m={br:{OK:"OK",CANCEL:"Cancelar",CONFIRM:"Sim"},da:{OK:"OK",CANCEL:"Annuller",CONFIRM:"Accepter"},de:{OK:"OK",CANCEL:"Abbrechen",CONFIRM:"Akzeptieren"},en:{OK:"OK",CANCEL:"Cancel",CONFIRM:"OK"},es:{OK:"OK",CANCEL:"Cancelar",CONFIRM:"Aceptar"},fi:{OK:"OK",CANCEL:"Peruuta",CONFIRM:"OK"},fr:{OK:"OK",CANCEL:"Annuler",CONFIRM:"D'accord"},it:{OK:"OK",CANCEL:"Annulla",CONFIRM:"Conferma"},nl:{OK:"OK",CANCEL:"Annuleren",CONFIRM:"Accepteren"},pl:{OK:"OK",CANCEL:"Anuluj",CONFIRM:"Potwierdź"},ru:{OK:"OK",CANCEL:"Отмена",CONFIRM:"Применить"},zh_CN:{OK:"OK",CANCEL:"取消",CONFIRM:"确认"},zh_TW:{OK:"OK",CANCEL:"取消",CONFIRM:"確認"}};return h.init=function(t){window.bootbox=init(t||e)},h}(window.jQuery);var Markdown;Markdown="object"==typeof exports&&"function"==typeof require?exports:{},function(){function e(e){return e}function t(){return!1}function n(){}function i(){}n.prototype={chain:function(t,n){var i=this[t];if(!i)throw Error("unknown hook "+t);this[t]=i===e?n:function(){var e=Array.prototype.slice.call(arguments,0);return e[0]=i.apply(null,e),n.apply(null,e)}},set:function(e,t){if(!this[e])throw Error("unknown hook "+e);this[e]=t},addNoop:function(t){this[t]=e},addFalse:function(e){this[e]=t}},Markdown.HookCollection=n,i.prototype={set:function(e,t){this["s_"+e]=t},get:function(e){return this["s_"+e]}},Markdown.Converter=function(){function e(e){return e=e.replace(/^[ ]{0,3}\[(.+)\]:[ \t]*\n?[ \t]*<?(\S+?)>?(?=\s|$)[ \t]*\n?[ \t]*((\n*)["(](.+?)[")][ \t]*)?(?:\n+)/gm,function(e,t,n,i,r,o){return t=t.toLowerCase(),M.set(t,T(n)),r?i:(o&&D.set(t,o.replace(/"/g,""")),"")})}function t(e){return e=e.replace(/^(<(p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math|ins|del)\b[^\r]*?\n<\/\2>[ \t]*(?=\n+))/gm,r),e=e.replace(/^(<(p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math)\b[^\r]*?.*<\/\2>[ \t]*(?=\n+)\n)/gm,r),e=e.replace(/\n[ ]{0,3}((<(hr)\b([^<>])*?\/?>)[ \t]*(?=\n{2,}))/g,r),e=e.replace(/\n\n[ ]{0,3}(<!(--(?:|(?:[^>-]|-[^>])(?:[^-]|-[^-])*)--)>[ \t]*(?=\n{2,}))/g,r),e=e.replace(/(?:\n\n)([ ]{0,3}(?:<([?%])[^\r]*?\2>)[ \t]*(?=\n{2,}))/g,r)}function r(e,t){var n=t;return n=n.replace(/^\n+/,""),n=n.replace(/\n+$/g,""),n="\n\n~K"+(j.push(n)-1)+"K\n\n"}function o(e,n){e=L.preBlockGamut(e,I),e=f(e);var i="<hr />\n";return e=e.replace(/^[ ]{0,2}([ ]?\*[ ]?){3,}[ \t]*$/gm,i),e=e.replace(/^[ ]{0,2}([ ]?-[ ]?){3,}[ \t]*$/gm,i),e=e.replace(/^[ ]{0,2}([ ]?_[ ]?){3,}[ \t]*$/gm,i),e=h(e),e=g(e),e=w(e),e=L.postBlockGamut(e,I),e=t(e),e=k(e,n)}function a(e){return e=L.preSpanGamut(e),e=y(e),e=s(e),e=C(e),e=u(e),e=l(e),e=E(e),e=e.replace(/~P/g,"://"),e=T(e),e=x(e),e=e.replace(/ +\n/g," <br>\n"),e=L.postSpanGamut(e)}function s(e){var t=/(<[a-z\/!$]("[^"]*"|'[^']*'|[^'">])*>|<!(--(?:|(?:[^>-]|-[^>])(?:[^-]|-[^-])*)--)>)/gi;return e=e.replace(t,function(e){var t=e.replace(/(.)<\/?code>(?=.)/g,"$1`");return t=R(t,"!"==e.charAt(1)?"\\`*_/":"\\`*_")})}function l(e){return e=e.replace(/(\[((?:\[[^\]]*\]|[^\[\]])*)\][ ]?(?:\n[ ]*)?\[(.*?)\])()()()()/g,c),e=e.replace(/(\[((?:\[[^\]]*\]|[^\[\]])*)\]\([ \t]*()<?((?:\([^)]*\)|[^()\s])*?)>?[ \t]*((['"])(.*?)\6[ \t]*)?\))/g,c),e=e.replace(/(\[([^\[\]]+)\])()()()()()/g,c)}function c(e,t,n,i,r,o,a,s){void 0==s&&(s="");var l=t,c=n.replace(/:\/\//g,"~P"),u=i.toLowerCase(),p=r,f=s;if(""==p)if(""==u&&(u=c.toLowerCase().replace(/ ?\n/g," ")),p="#"+u,void 0!=M.get(u))p=M.get(u),void 0!=D.get(u)&&(f=D.get(u));else{if(!(l.search(/\(\s*\)$/m)>-1))return l;p=""}p=N(p),p=R(p,"*_");var h='<a href="'+p+'"';return""!=f&&(f=d(f),f=R(f,"*_"),h+=' title="'+f+'"'),h+=">"+c+"</a>"}function u(e){return e=e.replace(/(!\[(.*?)\][ ]?(?:\n[ ]*)?\[(.*?)\])()()()()/g,p),e=e.replace(/(!\[(.*?)\]\s?\([ \t]*()<?(\S+?)>?[ \t]*((['"])(.*?)\6[ \t]*)?\))/g,p)}function d(e){return e.replace(/>/g,">").replace(/</g,"<").replace(/"/g,""")}function p(e,t,n,i,r,o,a,s){var l=t,c=n,u=i.toLowerCase(),p=r,f=s;if(f||(f=""),""==p){if(""==u&&(u=c.toLowerCase().replace(/ ?\n/g," ")),p="#"+u,void 0==M.get(u))return l;p=M.get(u),void 0!=D.get(u)&&(f=D.get(u))}c=R(d(c),"*_[]()"),p=R(p,"*_");var h='<img src="'+p+'" alt="'+c+'"';return f=d(f),f=R(f,"*_"),h+=' title="'+f+'"',h+=" />"}function f(e){return e=e.replace(/^(.+)[ \t]*\n=+[ \t]*\n+/gm,function(e,t){return"<h1>"+a(t)+"</h1>\n\n"}),e=e.replace(/^(.+)[ \t]*\n-+[ \t]*\n+/gm,function(e,t){return"<h2>"+a(t)+"</h2>\n\n"}),e=e.replace(/^(\#{1,6})[ \t]*(.+?)[ \t]*\#*\n+/gm,function(e,t,n){var i=t.length;return"<h"+i+">"+a(n)+"</h"+i+">\n\n"})}function h(e,t){e+="~0";var n=/^(([ ]{0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(~0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/gm;return P?e=e.replace(n,function(e,n,i){var r=n,o=i.search(/[*+-]/g)>-1?"ul":"ol",a=m(r,o,t);return a=a.replace(/\s+$/,""),a="<"+o+">"+a+"</"+o+">\n"}):(n=/(\n\n|^\n?)(([ ]{0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(~0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/g,e=e.replace(n,function(e,t,n,i){var r=t,o=n,a=i.search(/[*+-]/g)>-1?"ul":"ol",s=m(o,a);return s=r+"<"+a+">\n"+s+"</"+a+">\n"})),e=e.replace(/~0/,"")}function m(e,t,n){P++,e=e.replace(/\n{2,}$/,"\n"),e+="~0";var i=H[t],r=RegExp("(^[ \\t]*)("+i+")[ \\t]+([^\\r]+?(\\n+))(?=(~0|\\1("+i+")[ \\t]+))","gm"),s=!1;return e=e.replace(r,function(e,t,i,r){var l=r,c=/\n\n$/.test(l),u=c||l.search(/\n{2,}/)>-1;return u||s?l=o($(l),!0):(l=h($(l),!0),l=l.replace(/\n$/,""),n||(l=a(l))),s=c,"<li>"+l+"</li>\n"}),e=e.replace(/~0/g,""),P--,e}function g(e){return e+="~0",e=e.replace(/(?:\n\n|^\n?)((?:(?:[ ]{4}|\t).*\n+)+)(\n*[ ]{0,3}[^ \t\n]|(?=~0))/g,function(e,t,n){var i=t,r=n;return i=b($(i)),i=A(i),i=i.replace(/^\n+/g,""),i=i.replace(/\n+$/g,""),i="<pre><code>"+i+"\n</code></pre>","\n\n"+i+"\n\n"+r}),e=e.replace(/~0/,"")}function v(e){return e=e.replace(/(^\n+|\n+$)/g,""),"\n\n~K"+(j.push(e)-1)+"K\n\n"}function y(e){return e=e.replace(/(^|[^\\])(`+)([^\r]*?[^`])\2(?!`)/gm,function(e,t,n,i){var r=i;return r=r.replace(/^([ \t]*)/g,""),r=r.replace(/[ \t]*$/g,""),r=b(r),r=r.replace(/:\/\//g,"~P"),t+"<code>"+r+"</code>"})}function b(e){return e=e.replace(/&/g,"&"),e=e.replace(/</g,"<"),e=e.replace(/>/g,">"),e=R(e,"*_{}[]\\",!1)}function x(e){return e=e.replace(/([\W_]|^)(\*\*|__)(?=\S)([^\r]*?\S[\*_]*)\2([\W_]|$)/g,"$1<strong>$3</strong>$4"),e=e.replace(/([\W_]|^)(\*|_)(?=\S)([^\r\*_]*?\S)\2([\W_]|$)/g,"$1<em>$3</em>$4")}function w(e){return e=e.replace(/((^[ \t]*>[ \t]?.+\n(.+\n)*\n*)+)/gm,function(e,t){var n=t;return n=n.replace(/^[ \t]*>[ \t]?/gm,"~0"),n=n.replace(/~0/g,""),n=n.replace(/^[ \t]+$/gm,""),n=o(n),n=n.replace(/(^|\n)/g,"$1 "),n=n.replace(/(\s*<pre>[^\r]+?<\/pre>)/gm,function(e,t){var n=t;return n=n.replace(/^ /gm,"~0"),n=n.replace(/~0/g,"")}),v("<blockquote>\n"+n+"\n</blockquote>")})}function k(e,t){e=e.replace(/^\n+/g,""),e=e.replace(/\n+$/g,"");for(var n=e.split(/\n{2,}/g),i=[],r=/~K(\d+)K/,o=n.length,s=0;o>s;s++){var l=n[s];r.test(l)?i.push(l):/\S/.test(l)&&(l=a(l),l=l.replace(/^([ \t]*)/g,"<p>"),l+="</p>",i.push(l))}if(!t){o=i.length;for(var s=0;o>s;s++)for(var c=!0;c;)c=!1,i[s]=i[s].replace(/~K(\d+)K/g,function(e,t){return c=!0,j[t]})}return i.join("\n\n")}function T(e){return e=e.replace(/&(?!#?[xX]?(?:[0-9a-fA-F]+|\w+);)/g,"&"),e=e.replace(/<(?![a-z\/?!]|~D)/gi,"<")}function C(e){return e=e.replace(/\\(\\)/g,O),e=e.replace(/\\([`*_{}\[\]()>#+-.!])/g,O)}function S(e,t,n,i){if(t)return e;if(")"!==i.charAt(i.length-1))return"<"+n+i+">";for(var r=i.match(/[()]/g),o=0,a=0;r.length>a;a++)"("===r[a]?0>=o?o=1:o++:o--;var s="";if(0>o){var l=RegExp("\\){1,"+-o+"}$");i=i.replace(l,function(e){return s=e,""})}if(s){var c=i.charAt(i.length-1);U.test(c)||(s=c+s,i=i.substr(0,i.length-1))}return"<"+n+i+">"+s}function E(e){e=e.replace(B,S);var t=function(e,t){return'<a href="'+t+'">'+L.plainLinkText(t)+"</a>"};return e=e.replace(/<((https?|ftp):[^'">\s]+)>/gi,t)}function _(e){return e=e.replace(/~E(\d+)E/g,function(e,t){var n=parseInt(t);return String.fromCharCode(n)})}function $(e){return e=e.replace(/^(\t|[ ]{1,4})/gm,"~0"),e=e.replace(/~0/g,"")}function A(e){if(!/\t/.test(e))return e;var t,n=[" "," "," "," "],i=0;return e.replace(/[\n\t]/g,function(e,r){return"\n"===e?(i=r+1,e):(t=(r-i)%4,i=r+1,n[t])})}function N(e){if(!e)return"";var t=e.length;return e.replace(K,function(n,i){return"~D"==n?"%24":":"!=n||i!=t-1&&!/[0-9\/]/.test(e.charAt(i+1))?"%"+n.charCodeAt(0).toString(16):":"})}function R(e,t,n){var i="(["+t.replace(/([\[\]\\])/g,"\\$1")+"])";n&&(i="\\\\"+i);var r=RegExp(i,"g");return e=e.replace(r,O)}function O(e,t){var n=t.charCodeAt(0);return"~E"+n+"E"}var L=this.hooks=new n;L.addNoop("plainLinkText"),L.addNoop("preConversion"),L.addNoop("postNormalization"),L.addNoop("preBlockGamut"),L.addNoop("postBlockGamut"),L.addNoop("preSpanGamut"),L.addNoop("postSpanGamut"),L.addNoop("postConversion");var M,D,j,P;this.makeHtml=function(n){if(M)throw Error("Recursive call to converter.makeHtml");return M=new i,D=new i,j=[],P=0,n=L.preConversion(n),n=n.replace(/~/g,"~T"),n=n.replace(/\$/g,"~D"),n=n.replace(/\r\n/g,"\n"),n=n.replace(/\r/g,"\n"),n="\n\n"+n+"\n\n",n=A(n),n=n.replace(/^[ \t]+$/gm,""),n=L.postNormalization(n),n=t(n),n=e(n),n=o(n),n=_(n),n=n.replace(/~D/g,"$$"),n=n.replace(/~T/g,"~"),n=L.postConversion(n),j=D=M=null,n};var I=function(e){return o(e)},H={ol:"\\d+[.]",ul:"[*+-]"},q="[-A-Z0-9+&@#/%?=~_|[\\]()!:,.;]",F="[-A-Z0-9+&@#/%=~_|[\\])]",B=RegExp('(="|<)?\\b(https?|ftp)(://'+q+"*"+F+")(?=$|\\W)","gi"),U=RegExp(F,"i"),K=/(?:["'*()[\]:]|~D)/g}}(),!function(e){"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof exports?module.exports=global.window&&global.window.$?e(global.window.$):function(t){if(!t.$&&!t.fn)throw Error("Tokenfield requires a window object with jQuery or a jQuery instance");return e(t.$||t)}:e(jQuery)}(function(e,t){"use strict";var n=function(n,i){var r=this;this.$element=e(n),this.textDirection=this.$element.css("direction"),this.options=e.extend(!0,{},e.fn.tokenfield.defaults,{tokens:this.$element.val()},this.$element.data(),i),this._delimiters="string"==typeof this.options.delimiter?[this.options.delimiter]:this.options.delimiter,this._triggerKeys=e.map(this._delimiters,function(e){return e.charCodeAt(0)}),this._firstDelimiter=this._delimiters[0];var o=e.inArray(" ",this._delimiters),a=e.inArray("-",this._delimiters);o>=0&&(this._delimiters[o]="\\s"),a>=0&&(delete this._delimiters[a],this._delimiters.unshift("-"));var s=["\\","$","[","{","^",".","|","?","*","+","(",")"];e.each(this._delimiters,function(t,n){var i=e.inArray(n,s);i>=0&&(r._delimiters[t]="\\"+n)});var l,c=t&&"function"==typeof t.getMatchedCSSRules?t.getMatchedCSSRules(n):null,u=n.style.width,d=this.$element.width();c&&e.each(c,function(e,t){t.style.width&&(l=t.style.width)});var p="rtl"===e("body").css("direction")?"right":"left",f={position:this.$element.css("position")};f[p]=this.$element.css(p),this.$element.data("original-styles",f).data("original-tabindex",this.$element.prop("tabindex")).css("position","absolute").css(p,"-10000px").prop("tabindex",-1),this.$wrapper=e('<div class="tokenfield form-control" />'),this.$element.hasClass("input-lg")&&this.$wrapper.addClass("input-lg"),this.$element.hasClass("input-sm")&&this.$wrapper.addClass("input-sm"),"rtl"===this.textDirection&&this.$wrapper.addClass("rtl");var h=this.$element.prop("id")||(new Date).getTime()+""+Math.floor(100*(1+Math.random()));this.$input=e('<input type="text" class="token-input" autocomplete="off" />').appendTo(this.$wrapper).prop("placeholder",this.$element.prop("placeholder")).prop("id",h+"-tokenfield").prop("tabindex",this.$element.data("original-tabindex"));var m=e('label[for="'+this.$element.prop("id")+'"]');if(m.length&&m.prop("for",this.$input.prop("id")),this.$copyHelper=e('<input type="text" />').css("position","absolute").css(p,"-10000px").prop("tabindex",-1).prependTo(this.$wrapper),u?this.$wrapper.css("width",u):l?this.$wrapper.css("width",l):this.$element.parents(".form-inline").length&&this.$wrapper.width(d),(this.$element.prop("disabled")||this.$element.parents("fieldset[disabled]").length)&&this.disable(),this.$mirror=e('<span style="position:absolute; top:-999px; left:0; white-space:pre;"/>'),this.$input.css("min-width",this.options.minWidth+"px"),e.each(["fontFamily","fontSize","fontWeight","fontStyle","letterSpacing","textTransform","wordSpacing","textIndent"],function(e,t){r.$mirror[0].style[t]=r.$input.css(t)}),this.$mirror.appendTo("body"),this.$wrapper.insertBefore(this.$element),this.$element.prependTo(this.$wrapper),this.update(),this.setTokens(this.options.tokens,!1,!1),this.listen(),!e.isEmptyObject(this.options.autocomplete)){var g="rtl"===this.textDirection?"right":"left",v=e.extend({minLength:this.options.showAutocompleteOnFocus?0:null,position:{my:g+" top",at:g+" bottom",of:this.$wrapper}},this.options.autocomplete);this.$input.autocomplete(v)}if(!e.isEmptyObject(this.options.typeahead)){var y=e.extend({minLength:this.options.showAutocompleteOnFocus?0:null},this.options.typeahead);this.$input.typeahead(null,y),this.typeahead=!0}this.$element.trigger("tokenfield:initialize")};n.prototype={constructor:n,createToken:function(t,n){"string"==typeof t&&(t={value:t,label:t}),n===void 0&&(n=!0);var i=this,r=e.trim(t.value),o=t.label&&t.label.length?e.trim(t.label):r;if(!(!r.length||!o.length||this.options.minLength>r.length||this.options.limit&&this.getTokens().length>=this.options.limit)){var a=e.Event("tokenfield:preparetoken");if(a.token={value:r,label:o},this.$element.trigger(a),a.token){if(r=a.token.value,o=a.token.label,!this.options.allowDuplicates&&e.grep(this.getTokens(),function(e){return e.value===r}).length){var s=e.Event("tokenfield:preventduplicate");s.token={value:r,label:o},this.$element.trigger(s);var l=this.$wrapper.find('.token[data-value="'+r+'"]').addClass("duplicate");return setTimeout(function(){l.removeClass("duplicate")},250),!1}var c=e('<div class="token" />').attr("data-value",r).append('<span class="token-label" />').append('<a href="#" class="close" tabindex="-1">×</a>');this.$input.hasClass("tt-input")?this.$input.parent().before(c):this.$input.before(c),this.$input.css("width",this.options.minWidth+"px");var u=c.find(".token-label"),d=c.find(".close");this.maxTokenWidth||(this.maxTokenWidth=this.$wrapper.width()-d.outerWidth()-parseInt(d.css("margin-left"),10)-parseInt(d.css("margin-right"),10)-parseInt(c.css("border-left-width"),10)-parseInt(c.css("border-right-width"),10)-parseInt(c.css("padding-left"),10)-parseInt(c.css("padding-right"),10),parseInt(u.css("border-left-width"),10)-parseInt(u.css("border-right-width"),10)-parseInt(u.css("padding-left"),10)-parseInt(u.css("padding-right"),10),parseInt(u.css("margin-left"),10)-parseInt(u.css("margin-right"),10)),u.text(o).css("max-width",this.maxTokenWidth),c.on("mousedown",function(){return i.disabled?!1:(i.preventDeactivation=!0,void 0)}).on("click",function(e){return i.disabled?!1:(i.preventDeactivation=!1,e.ctrlKey||e.metaKey?(e.preventDefault(),i.toggle(c)):(i.activate(c,e.shiftKey,e.shiftKey),void 0))}).on("dblclick",function(){return i.disabled||!i.options.allowEditing?!1:(i.edit(c),void 0)}),d.on("click",e.proxy(this.remove,this));var p=e.Event("tokenfield:createtoken");p.token=a.token,p.relatedTarget=c.get(0),this.$element.trigger(p);var f=e.Event("change");return f.initiator="tokenfield",n&&this.$element.val(this.getTokensList()).trigger(f),this.update(),this.$input.get(0)}}},setTokens:function(t,n,i){if(t){n||this.$wrapper.find(".token").remove(),i===void 0&&(i=!0),"string"==typeof t&&(t=this._delimiters.length?t.split(RegExp("["+this._delimiters.join("")+"]")):[t]);var r=this;return e.each(t,function(e,t){r.createToken(t,i)}),this.$element.get(0)}},getTokenData:function(t){var n=t.map(function(){var t=e(this);return{value:t.attr("data-value"),label:t.find(".token-label").text()}}).get();return 1==n.length&&(n=n[0]),n},getTokens:function(t){var n=this,i=[],r=t?".active":"";return this.$wrapper.find(".token"+r).each(function(){i.push(n.getTokenData(e(this)))}),i},getTokensList:function(t,n,i){t=t||this._firstDelimiter,n=n!==void 0&&null!==n?n:this.options.beautify;var r=t+(n&&" "!==t?" ":"");return e.map(this.getTokens(i),function(e){return e.value}).join(r)},getInput:function(){return this.$input.val()},listen:function(){var n=this;this.$element.on("change",e.proxy(this.change,this)),this.$wrapper.on("mousedown",e.proxy(this.focusInput,this)),this.$input.on("focus",e.proxy(this.focus,this)).on("blur",e.proxy(this.blur,this)).on("paste",e.proxy(this.paste,this)).on("keydown",e.proxy(this.keydown,this)).on("keypress",e.proxy(this.keypress,this)).on("keyup",e.proxy(this.keyup,this)),this.$copyHelper.on("focus",e.proxy(this.focus,this)).on("blur",e.proxy(this.blur,this)).on("keydown",e.proxy(this.keydown,this)).on("keyup",e.proxy(this.keyup,this)),this.$input.on("keypress",e.proxy(this.update,this)).on("keyup",e.proxy(this.update,this)),this.$input.on("autocompletecreate",function(){var t=e(this).data("ui-autocomplete").menu.element,i=n.$wrapper.outerWidth()-parseInt(t.css("border-left-width"),10)-parseInt(t.css("border-right-width"),10);t.css("min-width",i+"px")}).on("autocompleteselect",function(e,t){return n.createToken(t.item)&&(n.$input.val(""),n.$input.data("edit")&&n.unedit(!0)),!1}).on("typeahead:selected",function(e,t){n.createToken(t)&&(n.$input.typeahead("val",""),n.$input.data("edit")&&n.unedit(!0))}).on("typeahead:autocompleted",function(){n.createToken(n.$input.val()),n.$input.typeahead("val",""),n.$input.data("edit")&&n.unedit(!0)}),e(t).on("resize",e.proxy(this.update,this))},keydown:function(t){function n(e){if(r.$input.is(document.activeElement)){if(r.$input.val().length>0)return;e+="All";var n=r.$input.hasClass("tt-input")?r.$input.parent()[e](".token:first"):r.$input[e](".token:first");if(!n.length)return;r.preventInputFocus=!0,r.preventDeactivation=!0,r.activate(n),t.preventDefault()}else r[e](t.shiftKey),t.preventDefault()}function i(n){if(t.shiftKey){if(r.$input.is(document.activeElement)){if(r.$input.val().length>0)return;var i=r.$input.hasClass("tt-input")?r.$input.parent()[n+"All"](".token:first"):r.$input[n+"All"](".token:first");if(!i.length)return;r.activate(i)}var o="prev"===n?"next":"prev",a="prev"===n?"first":"last";r.firstActiveToken[o+"All"](".token").each(function(){r.deactivate(e(this))}),r.activate(r.$wrapper.find(".token:"+a),!0,!0),t.preventDefault()}}if(this.focused){var r=this;switch(t.keyCode){case 8:if(!this.$input.is(document.activeElement))break;this.lastInputValue=this.$input.val();break;case 37:n("rtl"===this.textDirection?"next":"prev");break;case 38:i("prev");break;case 39:n("rtl"===this.textDirection?"prev":"next");break;case 40:i("next");break;case 65:if(this.$input.val().length>0||!t.ctrlKey&&!t.metaKey)break;this.activateAll(),t.preventDefault();break;case 9:case 13:if(this.$input.data("ui-autocomplete")&&this.$input.data("ui-autocomplete").menu.element.find("li:has(a.ui-state-focus)").length)break;if(this.$input.hasClass("tt-input")&&this.$wrapper.find(".tt-cursor").length)break;if(this.$input.hasClass("tt-input")&&this.$wrapper.find(".tt-hint").val().length)break;if(this.$input.is(document.activeElement)&&this.$input.val().length||this.$input.data("edit"))return this.createTokensFromInput(t,this.$input.data("edit"));if(13===t.keyCode){if(!this.$copyHelper.is(document.activeElement)||1!==this.$wrapper.find(".token.active").length)break;if(!r.options.allowEditing)break;this.edit(this.$wrapper.find(".token.active"))}}this.lastKeyDown=t.keyCode}},keypress:function(t){return this.lastKeyPressCode=t.keyCode,this.lastKeyPressCharCode=t.charCode,-1!==e.inArray(t.charCode,this._triggerKeys)&&this.$input.is(document.activeElement)?(this.$input.val()&&this.createTokensFromInput(t),!1):void 0},keyup:function(e){if(this.preventInputFocus=!1,this.focused){switch(e.keyCode){case 8:if(this.$input.is(document.activeElement)){if(this.$input.val().length||this.lastInputValue.length&&8===this.lastKeyDown)break;this.preventDeactivation=!0;var t=this.$input.hasClass("tt-input")?this.$input.parent().prevAll(".token:first"):this.$input.prevAll(".token:first");if(!t.length)break;this.activate(t)}else this.remove(e);break;case 46:this.remove(e,"next")}this.lastKeyUp=e.keyCode}},focus:function(){this.focused=!0,this.$wrapper.addClass("focus"),this.$input.is(document.activeElement)&&(this.$wrapper.find(".active").removeClass("active"),this.firstActiveToken=null,this.options.showAutocompleteOnFocus&&this.search())},blur:function(e){this.focused=!1,this.$wrapper.removeClass("focus"),this.preventDeactivation||this.$element.is(document.activeElement)||(this.$wrapper.find(".active").removeClass("active"),this.firstActiveToken=null),!this.preventCreateTokens&&(this.$input.data("edit")&&!this.$input.is(document.activeElement)||this.options.createTokensOnBlur)&&this.createTokensFromInput(e),this.preventDeactivation=!1,this.preventCreateTokens=!1},paste:function(e){var t=this;setTimeout(function(){t.createTokensFromInput(e)},1)},change:function(e){"tokenfield"!==e.initiator&&this.setTokens(this.$element.val())},createTokensFromInput:function(e,t){if(!(this.options.minLength>this.$input.val().length)){var n=this.getTokensList();return this.setTokens(this.$input.val(),!0),n==this.getTokensList()&&this.$input.val().length?!1:(this.$input.hasClass("tt-input")?this.$input.typeahead("val",""):this.$input.val(""),this.$input.data("edit")&&this.unedit(t),!1)}},next:function(e){if(e){var t=this.$wrapper.find(".active:first"),n=t&&this.firstActiveToken?this.firstActiveToken.index()>t.index():!1;if(n)return this.deactivate(t)}var i=this.$wrapper.find(".active:last"),r=i.nextAll(".token:first");return r.length?(this.activate(r,e),void 0):(this.$input.focus(),void 0)},prev:function(e){if(e){var t=this.$wrapper.find(".active:last"),n=t&&this.firstActiveToken?t.index()>this.firstActiveToken.index():!1;if(n)return this.deactivate(t)}var i=this.$wrapper.find(".active:first"),r=i.prevAll(".token:first");return r.length||(r=this.$wrapper.find(".token:first")),r.length||e?(this.activate(r,e),void 0):(this.$input.focus(),void 0)},activate:function(t,n,i,r){if(t&&this.$wrapper.find(".token.active").length!==this.$wrapper.find(".token").length){if(r===void 0)var r=!0;if(i)var n=!0;if(this.$copyHelper.focus(),n||(this.$wrapper.find(".active").removeClass("active"),r?this.firstActiveToken=t:delete this.firstActiveToken),i&&this.firstActiveToken){var o=this.firstActiveToken.index()-2,a=t.index()-2,s=this;this.$wrapper.find(".token").slice(Math.min(o,a)+1,Math.max(o,a)).each(function(){s.activate(e(this),!0)})}t.addClass("active"),this.$copyHelper.val(this.getTokensList(null,null,!0)).select()}},activateAll:function(){var t=this;this.$wrapper.find(".token").each(function(n){t.activate(e(this),0!==n,!1,!1)})},deactivate:function(e){e&&(e.removeClass("active"),this.$copyHelper.val(this.getTokensList(null,null,!0)).select())},toggle:function(e){e&&(e.toggleClass("active"),this.$copyHelper.val(this.getTokensList(null,null,!0)).select())},edit:function(t){if(t){var n=t.data("value"),i=t.find(".token-label").text(),r=e.Event("tokenfield:edittoken");if(r.token={value:n,label:i},r.relatedTarget=t.get(0),this.$element.trigger(r),r.token){n=r.token.value,i=r.token.label,t.find(".token-label").text(n);var o=t.outerWidth(),a=this.$input.hasClass("tt-input")?this.$input.parent():this.$input;t.replaceWith(a),this.preventCreateTokens=!0,this.$input.val(n).select().data("edit",!0).width(o),this.update()}}},unedit:function(e){var t=this.$input.hasClass("tt-input")?this.$input.parent():this.$input;if(t.appendTo(this.$wrapper),this.$input.data("edit",!1),this.$mirror.text(""),this.update(),e){var n=this;setTimeout(function(){n.$input.focus()},1)}},remove:function(t,n){if(!this.$input.is(document.activeElement)&&!this.disabled){var i="click"===t.type?e(t.target).closest(".token"):this.$wrapper.find(".token.active");if("click"!==t.type){if(!n)var n="prev";if(this[n](),"prev"===n)var r=0===i.first().prevAll(".token:first").length}var o=e.Event("tokenfield:removetoken");o.token=this.getTokenData(i);var a=e.Event("change");a.initiator="tokenfield",i.remove(),this.$element.val(this.getTokensList()).trigger(o).trigger(a),(!this.$wrapper.find(".token").length||"click"===t.type||r)&&this.$input.focus(),this.$input.css("width",this.options.minWidth+"px"),this.update(),t.preventDefault(),t.stopPropagation()}},update:function(){var e=this.$input.val(),t=parseInt(this.$input.css("padding-left"),10),n=parseInt(this.$input.css("padding-right"),10),i=t+n;if(this.$input.data("edit")){if(e||(e=this.$input.prop("placeholder")),e===this.$mirror.text())return;this.$mirror.text(e);var r=this.$mirror.width()+10;if(r>this.$wrapper.width())return this.$input.width(this.$wrapper.width());this.$input.width(r)}else{if(this.$input.css("width",this.options.minWidth+"px"),"rtl"===this.textDirection)return this.$input.width(this.$input.offset().left+this.$input.outerWidth()-this.$wrapper.offset().left-parseInt(this.$wrapper.css("padding-left"),10)-i-1);this.$input.width(this.$wrapper.offset().left+this.$wrapper.width()+parseInt(this.$wrapper.css("padding-left"),10)-this.$input.offset().left-i)}},focusInput:function(t){if(!e(t.target).closest(".token").length&&!e(t.target).closest(".token-input").length){var n=this;setTimeout(function(){n.$input.focus()},0)}},search:function(){this.$input.data("ui-autocomplete")&&this.$input.autocomplete("search")},disable:function(){this.disabled=!0,this.$input.prop("disabled",!0),this.$element.prop("disabled",!0),this.$wrapper.addClass("disabled")},enable:function(){this.disabled=!1,this.$input.prop("disabled",!1),this.$element.prop("disabled",!1),this.$wrapper.removeClass("disabled")},destroy:function(){this.$element.val(this.getTokensList()),this.$element.css(this.$element.data("original-styles")),this.$element.prop("tabindex",this.$element.data("original-tabindex"));var t=e('label[for="'+this.$input.prop("id")+'"]');t.length&&t.prop("for",this.$element.prop("id")),this.$element.insertBefore(this.$wrapper),this.$element.removeData("original-styles"),this.$element.removeData("original-tabindex"),this.$element.removeData("bs.tokenfield"),this.$wrapper.remove();var n=this.$element;return delete this,n}};var i=e.fn.tokenfield;return e.fn.tokenfield=function(t,i){var r,o=[];Array.prototype.push.apply(o,arguments);var a=this.each(function(){var a=e(this),s=a.data("bs.tokenfield"),l="object"==typeof t&&t;"string"==typeof t&&s&&s[t]?(o.shift(),r=s[t].apply(s,o)):s||"string"==typeof t||i||a.data("bs.tokenfield",s=new n(this,l))});return r!==void 0?r:a},e.fn.tokenfield.defaults={minWidth:60,minLength:0,allowDuplicates:!1,allowEditing:!0,limit:0,autocomplete:{},typeahead:{},showAutocompleteOnFocus:!1,createTokensOnBlur:!1,delimiter:",",beautify:!0},e.fn.tokenfield.Constructor=n,e.fn.tokenfield.noConflict=function(){return e.fn.tokenfield=i,this},n}),function(e,t,n){e.ichecked||(e.ichecked=function(){n=e.jQuery||e.Zepto;var i={autoInit:!0,autoAjax:!0,tap:!0,checkboxClass:"icheckbox",radioClass:"iradio",checkedClass:"checked",disabledClass:"disabled",indeterminateClass:"indeterminate",hoverClass:"hover",callbacks:{ifCreated:!1},classes:{base:"icheck",div:"#-item",area:"#-area-",input:"#-input",label:"#-label"}};e.icheck=n.extend(i,e.icheck);var r=e.navigator.userAgent,o=/MSIE [5-8]/.test(r)||9>t.documentMode,a=/Opera Mini/.test(r),s=i.classes.base,l=i.classes.div.replace("#",s),c=i.classes.area.replace("#",s),u=i.classes.input.replace("#",s),d=i.classes.label.replace("#",s);delete i.classes;var p,f,h={},m={},g=RegExp(s+"\\[(.*?)\\]"),v=function(e,t,n){return e&&(t=g.exec(e))&&m[t[1]]&&(n=t[1]),n},y=e.getComputedStyle,b=e.PointerEvent||e.MSPointerEvent,x="ontouchend"in e,w=/mobile|tablet|phone|ip(ad|od)|android|silk|webos/i.test(r),r=["mouse","down","up","over","out"],k=e.PointerEvent?["pointer",r[1],r[2],r[3],r[4]]:["MSPointer","Down","Up","Over","Out"],T=["touch","start","end"],C=x&&w||b,S=C?x?T[0]+T[1]:k[0]+k[3]:r[0]+r[3],E=C?x?T[0]+T[2]:k[0]+k[4]:r[0]+r[4],_=C?x?!1:k[0]+k[1]:r[0]+r[1],$=C?x?!1:k[0]+k[2]:r[0]+r[2],r=a?"":S+".i "+E+".i ",k=!a&&_?_+".i "+$+".i":"",A=!1!==i.areaStyle?'position:absolute;display:block;content:"";top:#;bottom:#;left:#;right:#;':0,N=function(n,i,r){p||(p=t.createElement("style"),(t.head||t.getElementsByTagName("head")[0]).appendChild(p),e.createPopup||p.appendChild(t.createTextNode("")),f=p.sheet||p.styleSheet),i||(i="div."+(r?c+r+":after":l+" input."+u)),n=n.replace(/!/g," !important"),f.addRule?f.addRule(i,n,0):f.insertRule(i+"{"+n+"}",0)};N("position:absolute!;display:block!;outline:none!;"+(i.debug?"":"opacity:0!;z-index:-99!;clip:rect(0 0 0 0)!;")),(x&&w||a)&&N("cursor:pointer!;","label."+d+",div."+l),N("display:none!","iframe.icheck-frame");var R=function(e,t,n,i,r,o,a){return(i=e.className)?(r=" "+i+" ",1===n?o=t:0===n?a=t:(o=t[0],a=t[1]),o&&0>r.indexOf(" "+o+" ")&&(r+=o+" "),a&&~r.indexOf(" "+a+" ")&&(r=r.replace(" "+a+" "," ")),r=r.replace(/^\s+|\s+$/g,""),r!==i&&(e.className=r),r):void 0},O=function(e,t,i,r,o,a){m[t]&&(r=m[t],o=r.className,a=n(M(e,"div",o)),a.length&&(n(e).removeClass(u+" "+o).attr("style",r.style),n("label."+r.esc).removeClass(d+" "+o),n(a).replaceWith(n(e)),i&&D(e,t,i)),m[t]=!1)},L=function(e,t,i,r,o){for(i=[],r=e.length;r--;)if(t=e[r],t.type)~"input[type=checkbox],input[type=radio]".indexOf(t.type)&&i.push(t);else for(t=n(t).find("input[type=checkbox],input[type=radio]"),o=t.length;o--;)i.push(t[o]);return i},M=function(e,t,n,i){for(;9!==e.nodeType;)if(e=e.parentNode,e.tagName==t.toUpperCase()&&~e.className.indexOf(n)){i=e;break}return i},D=function(e,t,i){i="if"+i,!1!==m[t].callbacks&&("function"==typeof m[t].callbacks[i]&&m[t].callbacks[i](e,m[t]),!1!==m[t].callbacks[i]&&n(e).trigger(i))
},j=function(r,o,a,p){r=L(r);for(var f=r.length;f--;){var g,b,x,w,k,T,C=r[f],S=C.attributes,E={},_=S.length,$={},j={},I=C.id,H=C.className,q=C.type,F=n.cache?n.cache[C[n.expando]]:0,B=v(H),U="",K=!1;T=[];for(var W=e.FastClick?" needsclick":"";_--;)g=S[_].name,b=S[_].value,~g.indexOf("data-")&&($[g.substr(5)]=b),"style"==g&&(w=b),E[g]=b;F&&F.data&&($=n.extend($,F.data));for(x in $)b=$[x],("true"==b||"false"==b)&&(b="true"==b),j[x.replace(/checkbox|radio|class|id|label/g,function(e,t){return 0===t?e:e.charAt(0).toUpperCase()+e.slice(1)})]=b;if(S=n.extend({},i,e.icheck,j,o),_=S.handle,"checkbox"!==_&&"radio"!==_&&(_="input[type=checkbox],input[type=radio]"),!1!==S.init&&~_.indexOf(q)){for(B&&O(C,B);!m[B];)if(B=Math.random().toString(36).substr(2,5),!m[B]){k=s+"["+B+"]";break}if(delete S.autoInit,delete S.autoAjax,S.style=w||"",S.className=k,S.esc=k.replace(/(\[|\])/g,"\\$1"),m[B]=S,(_=M(C,"label",""))&&(!_.htmlFor&&I&&(_.htmlFor=I),T.push(_)),I)for(g=n('label[for="'+I+'"]');g.length--;)I=g[g.length],I!==_&&T.push(I);for(b=T.length;b--;)I=T[b],g=I.className,g=(_=v(g))?R(I,s+"["+_+"]",0):(g?g+" ":"")+d,I.className=g+" "+k+W;if(T=t.createElement("div"),S.inherit)for(I=S.inherit.split(/\s*,\s*/),g=I.length;g--;)_=I[g],void 0!==E[_]&&("class"==_?U+=E[_]+" ":T.setAttribute(_,"id"==_?s+"-"+E[_]:E[_]));U+=S[q+"Class"],U+=" "+l+" "+k,S.area&&A&&(K=0|(""+S.area).replace(/%|px|em|\+|-/g,""))&&(h[K]||(N(A.replace(/#/g,"-"+K+"%"),!1,K),h[K]=!0),U+=" "+c+K),T.className=U+W,C.className=(H?H+" ":"")+u+" "+k,C.parentNode.replaceChild(T,C),T.appendChild(C),S.insert&&n(T).append(S.insert),K&&(E=y?y(T,null).getPropertyValue("position"):T.currentStyle.position,"static"==E&&(T.style.position="relative")),P(C,T,B,"updated",!0,!1,a),m[B].done=!0,p||D(C,B,"Created")}}},P=function(e,t,n,i,r,o,a){var s=m[n],l={},c={};l.checked=[e.checked,"Checked","Unchecked"],o&&!a||"click"===i||(l.disabled=[e.disabled,"Disabled","Enabled"],l.indeterminate=["true"==e.getAttribute("indeterminate")||!!e.indeterminate,"Indeterminate","Determinate"]),"updated"==i||"click"==i?(c.checked=o?!l.checked[0]:l.checked[0],o&&!a||"click"===i||(c.disabled=l.disabled[0],c.indeterminate=l.indeterminate[0])):"checked"==i||"unchecked"==i?c.checked="checked"==i:"disabled"==i||"enabled"==i?c.disabled="disabled"==i:"indeterminate"==i||"determinate"==i?c.indeterminate="determinate"!==i:c.checked=!l.checked[0],I(e,t,l,c,n,s,i,r,o,a)},I=function(e,t,i,r,o,a,s,l,c,u,d){var p,f,h,g,y,b,x,k,T,C,S=e.type,E="radio"==S?"Radio":"Checkbox";if(t||(t=M(e,"div",a.className)),t){for(p in r)if(f=r[p],i[p][0]!==f&&"updated"!==s&&"click"!==s&&(e[p]=f),u&&(f?e.setAttribute(p,p):e.removeAttribute(p)),a[p]!==f){if(a[p]=f,T=!0,"checked"==p&&(C=!0,!d&&f&&(m[o].done||u)&&"radio"==S&&e.name))for(g=M(e,"form",""),h='input[name="'+e.name+'"]',h=g&&!u?n(g).find(h):n(h),g=h.length;g--;)y=h[g],b=v(y.className),e!==y&&m[b]&&m[b].checked&&(x={checked:[!0,"Checked","Unchecked"]},k={checked:!1},I(y,!1,x,k,b,m[b],"updated",l,c,u,!0));if(h=[a[p+"Class"],a[p+E+"Class"],a[i[p][1]+"Class"],a[i[p][1]+E+"Class"],a[p+"LabelClass"]],g=[h[3]||h[2],h[1]||h[0]],f&&g.reverse(),R(t,g),a.mirror&&h[4])for(g=n("label."+a.esc);g.length--;)R(g[g.length],h[4],f?1:0);l&&!d||D(e,o,i[p][f?1:2])}(!l||d)&&(T&&D(e,o,"Changed"),C&&D(e,o,"Toggled")),a.cursor&&!w&&(a.disabled||a.pointer?a.disabled&&a.pointer&&(t.style.cursor="default",a.pointer=!1):(t.style.cursor="pointer",a.pointer=!0)),m[o]=a}};n.fn.icheck=function(e,t){if(/^(checked|unchecked|indeterminate|determinate|disabled|enabled|updated|toggle|destroy|data|styler)$/.test(e))for(var n=L(this),i=n.length;i--;){var r=n[i],o=v(r.className);if(o){if("data"==e)return m[o];if("styler"==e)return M(r,"div",m[o].className);"destroy"==e?O(r,o,"Destroyed"):P(r,!1,o,e),"function"==typeof t&&t(r)}}else"object"!=typeof e&&e||j(this,e||{});return this};var H;n(t).on("click.i "+r+k,"label."+d+",div."+l,function(e){var t=this,i=v(t.className);if(i){var r,s,l,c,u=e.type,d=m[i],p=d.esc,i="DIV"==t.tagName,f=[["label",d.activeLabelClass,d.hoverLabelClass],["div",d.activeClass,d.hoverClass]];if(i&&f.reverse(),u==_||u==$){if(f[0][1]&&R(t,f[0][1],u==_?1:0),d.mirror&&f[1][1])for(l=n(f[1][0]+"."+p);l.length--;)R(l[l.length],f[1][1],u==_?1:0);i&&u==$&&d.tap&&w&&b&&!a&&(c=!0)}else if(u==S||u==E){if(f[0][2]&&R(t,f[0][2],u==S?1:0),d.mirror&&f[1][2])for(l=n(f[1][0]+"."+p);l.length--;)R(l[l.length],f[1][2],u==S?1:0);i&&u==E&&d.tap&&w&&x&&!a&&(c=!0)}else i&&(w&&(x||b)&&d.tap&&!a||(c=!0));c&&setTimeout(function(){s=e.currentTarget||{},"LABEL"!==s.tagName&&(!d.change||+new Date-d.change>100)&&(r=n(t).find("input."+p).click(),(o||a)&&r.change())},2)}}).on("click.i change.i focusin.i focusout.i keyup.i keydown.i","input."+u,function(e){var t=v(this.className);if(t){var i=e.type,r=m[t],o=r.esc,a="click"==i?!1:M(this,"div",r.className);if("click"==i)m[t].change=+new Date,e.stopPropagation();else if("change"==i)a&&!this.disabled&&P(this,a,t,"click");else if(~i.indexOf("focus")){if(e=[r.focusClass,r.focusLabelClass],e[0]&&a&&R(a,e[0],"focusin"==i?1:0),r.mirror&&e[1])for(r=n("label."+o);r.length--;)R(r[r.length],e[1],"focusin"==i?1:0)}else a&&!this.disabled&&("keyup"==i?(("checkbox"==this.type&&32==e.keyCode&&r.keydown||"radio"==this.type&&!this.checked)&&P(this,a,t,"click",!1,!0),m[t].keydown=m[H].keydown=!1):(H=t,m[t].keydown=!0))}}).ready(function(){if(e.icheck.autoInit&&n("."+s).icheck(),e.jQuery){var i=t.body||t.getElementsByTagName("body")[0];n.ajaxSetup({converters:{"text html":function(r){if(e.icheck.autoAjax&&i){var a,l=t.createElement("iframe");o||(l.style="display:none"),l.className="iframe.icheck-frame",l.src="about:blank",i.appendChild(l),a=l.contentDocument?l.contentDocument:l.contentWindow.document,a.open(),a.write(r),a.close(),i.removeChild(l),a=n(a),j(a.find("."+s),{},!0),a=a[0],r=(a.body||a.getElementsByTagName("body")[0]).innerHTML}return r}}})}})},"function"==typeof define&&define.amd?define("icheck",[e.jQuery?"jquery":"zepto"],e.ichecked):e.ichecked())}(window,document);var SHURSCRIPT={GreaseMonkey:{log:GM_log,getValue:GM_getValue,setValue:GM_setValue,deleteValue:GM_deleteValue,xmlhttpRequest:GM_xmlhttpRequest,registerMenuCommand:GM_registerMenuCommand,addStyle:GM_addStyle,getResourceText:GM_getResourceText,getResourceURL:GM_getResourceURL},config:{server:"http://cloud.shurscript.org:8080/"},environment:{page:-1!=location.pathname.indexOf("/foro")?location.pathname.replace("/foro",""):"frontpage"}};(function(e,t,n,i,r,o){"use strict";var a={},s=n.GreaseMonkey;n.core=a;var l=function(){var e;if("undefined"!=typeof GM_info)e=GM_info.script.version;else{if("undefined"==typeof GM_getMetadata)return!1;e=GM_getMetadata("version")+""}var t=e.split("-");return n.scriptVersion=t[0],n.scriptBranch=t[1]||"master",!0},c={__init__:function(e){return this.moduleId=e,delete this.__init__,this},log:function(t){r.log(this._getCallerDescription()+t);var n=e("#shurscript_log");0===n.length&&(e(document.body).append('<div id="shurscript_log" style="display:none;"></div>'),n=e("#shurscript_log")),n.append(t+"<br>")},_getShurKey:function(e,t){var i=t===!0?"_"+n.environment.user.id:"";return"SHURSCRIPT_"+this.moduleId+"_"+e+i},_getCallerDescription:function(){return"[SHURSCRIPT] [Modulo "+this.moduleId+"] "+(new Date).toLocaleTimeString()+": "},setValue:function(e,t,n){s.setValue(this._getShurKey(e,!1),t,n)},getValue:function(e,t){return s.getValue(this._getShurKey(e,!1),t)},deleteValue:function(e,t){s.deleteValue(this._getShurKey(e,!1),t)},setLocalValue:function(e,t){GM_setValue(this._getShurKey(e,!0),t)},getLocalValue:function(e,t){return GM_getValue(this._getShurKey(e,!0),t)},deleteLocalValue:function(e){GM_deleteValue(this._getShurKey(e,!0))},"throw":function(e,t){this.log("[EXCEPTION] - "+e),t!==o&&(this.log(t),r.log(t))},addStyle:function(e){var t=s.getResourceText(e);s.addStyle(t)},showMessageBar:function(e){n.topbar.showMessage(e)},getResourceText:s.getResourceText,getResourceURL:s.getResourceURL,bootbox:i,location:location},u=function(){var e=Object.create(c);return e.createPreferenceOption=n.preferences.createOption,e.templater=n.templater,e.environment=n.environment,e};a.createComponentHelper=function(e){return Object.create(c).__init__(e)},a.createModuleHelper=function(e){return u().__init__(e)},a.helper=a.createComponentHelper("core"),a.createComponent=function(e){e===o&&a.helper.throw("Error al crear componente. El ID no ha sido definido.");var t={id:e};return n[e]=t,a.components===o&&(a.components=[]),a.components.push(e),t.helper=a.createComponentHelper(t.id),t},a.initialize=function(){if(!l())return alert("SHURSCRIPT: El complemento o extensión de userscripts que usas en tu navegador no está soportado."),o;var i=e("body").html(),r=/userid=(\d*)/.exec(i);if(r){var s,c=r[1];s="frontpage"===n.environment.page?e(".cajascat td.cat:nth-child(1)").text().substr(3):e(".smallfont a[href='member.php?u="+c+"']").first().text(),n.environment.user={id:c,name:s},n.environment.browser={name:navigator.userAgent},a.helper.addStyle("bootstrapcss"),a.helper.bootbox.setDefaults({locale:"es",className:"shurscript",closeButton:!1}),e.ajax({type:"GET",url:n.config.server+"config-"+n.scriptBranch}).done(function(e){t.extend(n.config,e),a.loadNextComponent(),a.helper.deleteLocalValue("SERVER_DOWN_ALERT")}).fail(function(){a.helper.getLocalValue("SERVER_DOWN_ALERT")||setTimeout(function(){a.helper.showMessageBar({message:"<strong>Oops...</strong> No se ha podido contactar con el cloud de <strong>shurscript</strong>. Consulta qué puede estar causando este problema en <a href='https://github.com/TheBronx/shurscript/wiki/FAQ#no-se-ha-podido-contactar-con-el-cloud-de-shurscript'>las F.A.Q.</a> y si el problema persiste, deja constancia en el <a href='"+n.config.fcThread+"'>hilo oficial</a>. <strong>{err: config}</strong>",type:"danger",onClose:function(){a.helper.setLocalValue("SERVER_DOWN_ALERT",!0)}})},3e3)})}},a.loadNextComponent=function(){var e=a.getNextComponent();return e===o?(n.moduleManager.startOnDocReadyModules(),o):(n.eventbus.trigger("loadingComponent",e),t.isFunction(e.loadAndCallback)?(a.helper.log("Cargando componente "+e.id),e.loadAndCallback(a.loadNextComponent),o):(t.isFunction(e.load)&&e.load(),a.loadNextComponent(),o))},a.getNextComponent=function(){return a.components!==o?(a.componentIndex===o?a.componentIndex=0:a.componentIndex+=1,n[a.components[a.componentIndex]]):o},a.initializeEagerly=function(){n.moduleManager.startEagerModules()}})(jQuery,_,SHURSCRIPT,bootbox,console),function(e,t){"use strict";var n=t.core.createComponent("eventbus"),i=e({});n.on=function(e,t){i.on(e,t)},n.one=function(e,t){i.one(e,t)},n.off=function(e,t){i.off(e,t)},n.trigger=function(e,t){i.trigger(e,t)},n.triggerDelayed=function(e,t,i){setTimeout(function(){n.trigger(e,i)},t)}}(jQuery,SHURSCRIPT),function(e,t,n){"use strict";function i(){var t=o.helper.getLocalValue("API_KEY");if(!t){var n=new XMLHttpRequest;n.open("GET","http://www.forocoches.com/foro/subscription.php?do=editfolders",!1),n.onreadystatechange=function(){if(4==n.readyState&&"OK"==n.statusText){var i=e.parseHTML(n.responseText),r=e(i).find("input[name='folderlist[50]']");r.length>0&&(t=r.val().replace("shurkey-",""),o.helper.setLocalValue("API_KEY",t))}},n.send()}return t}function r(t){var n=new XMLHttpRequest;n.open("POST","http://www.forocoches.com/foro/subscription.php?do=doeditfolders",!1),n.onreadystatechange=function(){4==n.readyState&&"OK"==n.statusText&&0==i()&&r(t)};var o="shurkey-"+t,a=e("input[name='securitytoken']").val(),s="s=&securitytoken="+a+"&do=doeditfolders&folderlist[50]="+o+"&do=doeditfolders";n.setRequestHeader("Content-type","application/x-www-form-urlencoded"),n.setRequestHeader("Content-length",s.length),n.setRequestHeader("Connection","close"),n.send(s)}var o=t.core.createComponent("sync");({setValue:t.GreaseMonkey.setValue,getValue:t.GreaseMonkey.getValue,deleteValue:t.GreaseMonkey.deleteValue});var a={server:t.config.server,apiKey:"",preferences:{},setValue:function(t,n,i){e.ajax({type:"PUT",url:this.server+"preferences/"+t+"/?apikey="+this.apiKey,data:{value:n},dataType:"json"}).done(i)},getValue:function(t,n){e.ajax({type:"get",url:this.server+"preferences/"+t+"/?apikey="+this.apiKey,data:"",dataType:"json"}).done(n)},getAll:function(n){t.config.apiKey=this.apiKey,o.helper.log("Cloud.getAll() using API key: "+this.apiKey),e.ajax({type:"get",url:this.server+"preferences/?apikey="+this.apiKey,data:"",dataType:"json"}).done(function(e){a.preferences=e,n()}).fail(function(e){switch(e.status){case 403:bootbox.confirm("<h3>¡Un momento!</h3>La Shurkey que estás utilizando no es válida ¿Quieres que te generemos una nueva?",function(e){e&&a.generateApiKey(function(){a.getAll(n)})});break;case 410:o.helper.deleteLocalValue("API_KEY"),a.apiKey=i(),a.getAll(n);break;case 500:default:o.helper.showMessageBar({message:"<strong>Oops...</strong> No se ha podido contactar con el cloud de <strong>shurscript</strong>. Consulta que puede estar causando este problema en <a href='https://github.com/TheBronx/shurscript/wiki/FAQ#no-se-ha-podido-contactar-con-el-cloud-de-shurscript'>las F.A.Q.</a> y si el problema persiste, deja constancia en el <a href='"+t.config.fcThread+"'>hilo oficial</a>. <strong>{err: general}</strong>",type:"danger"})}o.helper.throw("Error al recuperar las preferencias",e)})},deleteValue:function(e,t){this.setValue(e,"",t)},generateApiKey:function(t,i){o.helper.deleteLocalValue("API_KEY"),o.helper.log("Cloud.generateApiKey()"),e.ajax({type:"POST",url:this.server+"preferences/"+(i!==n?"?apikey="+i:""),data:"",dataType:"json"}).done(function(e){o.helper.log("Generated API Key:"+JSON.stringify(e)),a.apiKey=e.apikey,r(a.apiKey),t()})}};o.loadAndCallback=function(e){t.GreaseMonkey.setValue=function(e,t,n){a.preferences[e]=t,a.setValue(e,t,n)},t.GreaseMonkey.getValue=function(e,t){return a.preferences[e]!=n?a.preferences[e]:t},t.GreaseMonkey.deleteValue=function(e,t){a.deleteValue(e,t)};var r=i();r?(a.apiKey=r,a.getAll(e)):a.generateApiKey(function(){a.getAll(e)})},o.generateNewApiKey=function(e){a.generateApiKey(e,i())}}(jQuery,SHURSCRIPT),function(e,t){"use strict";function n(e,t){t.preferences.enabled&&r(t)}function i(e,t){r(t)}function r(e){e.shurbarIcon!==undefined&&o(e.shurbarIcon(),e)}function o(t,n){e.isArray(t)||(t=[t]),t.forEach(function(e){c.push(new u(n&&n.id,e.name,e.description,e.image,e.handler))})}function a(){c.forEach(function(t){e('<li class="shurbar-item" id="'+t.name+'" data-placement="top" data-toggle="tooltip" title="'+t.description+'"><img src="'+t.image+'"/><a href="#">'+t.name+"</a></li>").prependTo(e("#shurbar ul.shurbar-items")).click(t.handler).tooltip({delay:300})})}var s=t.core.createComponent("shurbar"),l='<div id="shurbar" class="shurscript"><div class="pull-right"><ul class="nav navbar-nav shurbar-items"></ul></div></div>',c=[],u=function(e,t,n,i,r){this.moduleId=e,this.name=t,this.description=n,this.image=i,this.handler=r};s.load=function(){s.helper.addStyle("shurbarcss"),e("#AutoNumber9").attr("cellpadding",0);var r;if("frontpage"==t.environment.page){r=e(".cajastip");var o=r.find(".texto:nth-child(2)").html();e("#AutoNumber8").html(o.replace("|","<br/>")),e("#AutoNumber8").addClass("texto"),e("#AutoNumber8").css("margin","7px 0 0 7px")}else r=e("#AutoNumber7").parents(".cajasprin");var c=e('<div id="quick-search-form" class="pull-left">'+r.find("form").parent().html()+"</div>");c.find(".cbutton").addClass("btn btn-default"),c.find(".cfield").addClass("form-control"),c.find("form").append(c.find("input"));var u=e(l);u.append(c),r.replaceWith(u),t.eventbus.on("loadingComponent",i),t.eventbus.on("loadingModule",n),t.eventbus.one("allModulesLoaded",function(){a()})}}(jQuery,SHURSCRIPT),function(e,t,n){"use strict";var i=t.core.createComponent("moduleManager");i.ALL="ALL",i.NO_FRONTPAGE="NO_FRONTPAGE";var r={__init__:function(r){var o=["id","name","author","version","description"],a=this;return e.each(o,function(e,t){if(r[t]===n){var o=r.id||r.name||"no identificado",s="Error generando modulo {"+o+"}.El parametro "+t+" no ha sido definido.";i.helper.log(s),i.helper.throw(s)}a[t]=r[t]}),this.initialPreferences=r.initialPreferences||{},this.preferences={enabled:!0},r.domain!==n&&(this.domain=r.domain),this.helper=t.core.createModuleHelper(r.id),i.modules[this.id]=this,delete this.__init__,this},preferences:{enabled:!0},storePreferences:function(e){var t=JSON.stringify(this.preferences);this.helper.setValue("__preferences",t,e)},refreshPreferences:function(){var t=this.helper.getValue("__preferences",""),n={};""!==t&&(n=JSON.parse(t)),e.extend(!0,this.preferences,this.initialPreferences,n)},migratePreferences:function(e){for(var t in this.preferences){for(var i="",r=0;t.length>r;r++)t[r]==t[r].toUpperCase()&&(i+="_"),i+=t[r].toUpperCase();var o=this.helper.getLocalValue(i);o!==n&&(this.preferences[t]=o,this.helper.log("Migrada: "+i+" = "+o))}this.storePreferences(e)},migrateValues:function(e){e&&e()},domain:i.NO_FRONTPAGE,getPreferenceOptions:function(){return[]},eagerStartCheck:function(){return!1},onEagerStart:function(){},isValidPage:function(){var e=this.domain,n=t.environment.page;return"string"==typeof e?e===i.ALL?!0:e===i.NO_FRONTPAGE?"/"!==n:n===e:e.indexOf(n)>-1},normalStartCheck:function(){return!0},onNormalStart:function(){}};i.modules={},i.createModule=function(e){try{return Object.create(r).__init__(e)}catch(t){mod.helper.throw("Error creando módulo:",t)}},i.migratePreferences=function(n){bootbox.dialog({message:"<center>Migrando preferencias...</center>"});var r=0,o=0,a=function(){r++,r==o&&i.helper.setValue("MIGRATION_DONE",!0,function(){n(),bootbox.hideAll()})},s=GM_getValue("SHURSCRIPT_MODULES_"+t.environment.user.id);s&&(s=JSON.parse(s),e.each(s,function(e,t){try{i.modules[e].preferences.enabled=t,i.helper.log("Migrando active status de "+e+": "+t)}catch(n){i.helper.throw("Error al migrar el active status de "+e,n)}})),e.each(i.modules,function(e,t){try{o++,t.migratePreferences(function(){t.migrateValues(a)})}catch(n){i.helper.throw("Error migrando las preferencias antiguas del modulo "+e,n)}})},i.startOnDocReadyModules=function(){return-1!=i.helper.location.hash.indexOf("newkey")&&i.helper.setValue("MIGRATION_DONE",!0),i.helper.getValue("MIGRATION_DONE")?(e.each(i.modules,function(e,n){try{if(n.refreshPreferences(),t.eventbus.trigger("loadingModule",[n]),!n.preferences.enabled)return!0;if(!n.isValidPage())return!0;if(!n.normalStartCheck())return!0;i.helper.log("Cargando modulo "+n.id),n.onNormalStart(),i.helper.log("Modulo "+n.id+" cargado")}catch(r){i.helper.log("Fallo cargando modulo "+n.id+"\nRazon: "+r)}}),t.eventbus.trigger("allModulesLoaded"),n):(i.migratePreferences(function(){i.startOnDocReadyModules()}),n)},i.startEagerModules=function(){e.each(i.modules,function(e,t){try{if(t.refreshPreferences(),!t.preferences.enabled)return!0;if(!t.eagerStartCheck())return!0;if(!t.isValidPage())return!0;i.helper.log("[Modo prematuro] Cargando modulo "+t.id),t.onEagerStart(),i.helper.log("[Modo prematuro] Modulo "+t.id+" cargado")}catch(n){i.helper.log("[Modo prematuro] Fallo cargando modulo "+t.id+"\nRazon: "+n)}})}}(jQuery,SHURSCRIPT),function(e,t){"use strict";function n(e){"string"==typeof e&&(e={message:e}),e.type=e.type||"info"}var i,r,o=t.core.createComponent("topbar");o.showMessage=function(t){n(t),i||(e('<div class="shurscript" style="height: 62px;">').prependTo(e("body")).append(i=e('<div style="padding: 10px; text-align: center; position: fixed; width: 99%;"><span class="message"/><button type="button" class="close" style="position: absolute; right: 15px; line-height: 15px">×</button></div>')),i.hide()),i.find(".message").html(t.message),i.attr("class","alert alert-"+t.type),i.slideDown();var o=function(){i.slideUp(),t.onClose&&t.onClose()};i.on("click",".close",function(){o()}),"number"==typeof t.timeout&&(r&&clearTimeout(r),r=setTimeout(function(){o()},t.timeout))}}(jQuery,SHURSCRIPT),function(e,t){"use strict";var n=t.core.createComponent("templater"),i={};n.storeTemplate=function(e,t){i[e]={tempName:e,tempText:t,compiled:!1}},n.fillOut=function(e,t){var r=i[e];r.compiled||n.compile(e);try{return i[e].tempFn(t||{})}catch(o){n.helper.throw("Error insertando valores en la plantilla:",o)}},n.compile=function(e){var t=i[e];if(!t.compiled)try{t.tempFn=Function("obj","var p=[],print=function(){p.push.apply(p,arguments);};with(obj){p.push('"+t.tempText.replace(/[\r\t\n]/g," ").split("<%").join(" ").replace(/((^|%>)[^\t]*)'/g,"$1\r").replace(/\t=(.*?)%>/g,"',$1,'").split(" ").join("');").split("%>").join("p.push('").split("\r").join("\\'")+"');}return p.join('');"),t.compiled=!0}catch(r){n.helper.throw("Error compilando template ["+e+"]: ",r)}}}(jQuery,SHURSCRIPT),function(e,t){"use strict";function n(e){t.GreaseMonkey.xmlhttpRequest({method:"GET",url:t.config.updateURL,onload:function(t){var n=/\/\/\s*@version\s+(.+)\s*\n/i.exec(t.responseText)[1],r=n.split("-")[1];n=n.split("-")[0];var o=i(n,r);e(o,n)}})}function i(e,n){var i,r=t.scriptVersion,o=t.scriptBranch;return i="exp"==o&&"dev"==n||"dev"==o&&!n?e>=r:e>r}function r(e){s.getChangelog(function(n){bootbox.dialog({message:"<h4>Hay disponible una nueva versión ("+e+") del Shurscript.</h4><p><br></p>"+n,buttons:[{label:"Más tarde",className:"btn-default"},{label:"Actualizar",className:"btn-primary",callback:function(){bootbox.hideAll(),location.href=t.config.installURL}}]})},e)}function o(e,t){return t=t.replace(/\./g,"\\."),e=e.match(RegExp("##[#]? v"+t+"[ \n].*([\\s\\S]*?(?=---))"))[1].trim(),e=(new Markdown.Converter).makeHtml(e)}var a,s=t.core.createComponent("autoupdater"),l=36e5;s.check=function(e,t){a=(new Date).getTime();var i=parseInt(s.helper.getLocalValue("LAST_SCRIPT_UPDATE",0),10);(e||a>i+l)&&(s.helper.setLocalValue("LAST_SCRIPT_UPDATE",""+a),n(function(e,n){e&&r(n),"function"==typeof t&&t(e)}))},s.load=function(){s.check(!1)},s.getChangelog=function(e,n){t.GreaseMonkey.xmlhttpRequest({method:"GET",url:t.config.rawChangelog+"?"+a,onload:function(i){var r;try{r=o(i.responseText,n||t.scriptVersion)}catch(a){r="Haz clic <a target='_blank' href='"+t.config.visualChangelog+"'>aquí</a> para ver los cambios de esta versión."}e(r)}})}}(jQuery,SHURSCRIPT),function(e,t,n){"use strict";var i=t.core.createComponent("preferences");i.shurbarIcon=function(){return{name:"Shurscript",description:"Abrir preferencias",image:t.config.imagesURL+"roto2.gif",handler:i.onShow}},i.onShow=function(){var n=i.createModal();e("body").append(n),n.on("hidden.bs.modal",function(){n.remove(),e("body").removeClass("prefs-open")}),n.on("show.bs.modal",function(){e("body").addClass("prefs-open")}),n.on("hide.bs.modal",function(){var e=i.$modal.find(".shur-module-preferences.changed");e.length&&bootbox.confirm("Hay cambios sin guardar en sus preferencias, ¿desea guardar los cambios?",function(e){e&&i.saveSettings()})}),n.on("click","#check-shurscript-updates",function(){i.checkUpdates()}),n.on("click",".shur-btn-options",function(){var t=e(this).parent().parent().parent().data("module-id"),i=e(this).parent().parent().find("h3").text(),r=e(this).parent().parent().siblings(".shur-options-body").show(),o=bootbox.dialog({message:r,title:"Preferencias de: ",className:"shurscript modal-module",buttons:{close:{label:"Cerrar",className:"btn-default",callback:function(){var e=o.find(".shur-options-body").hide();n.find('.shur-module-preferences[data-module-id="'+t+'"]').append(e)}}}});o.find(".modal-dialog").css({width:"700px",marginTop:"15px"}),o.find(".modal-body").css({"overflow-y":"auto",height:e(window).height()-255});var a=o.find(".modal-title");e(a).addClass("lead"),e(a).css({fontSize:"18px"}),e(a).append('<h4 style="display:inline;text-transform:lowercase;">'+i+"</h4>"),e(window).on("resize",function(){o.find(".modal-body").css("height",e(window).height()-255)}),e(window).trigger("resize"),o.on("change","input",function(){n.find("[data-module-id="+t+"]").addClass("changed")})}),n.find(".shur-btn-options").tooltip({delay:100}),n.find(".shur-radio-element").icheck({radioClass:"iradio_square-blue"}),n.on("click","#save-settings",function(){i.saveSettings()}),n.on("change","input",function(){e(this).parents(".shur-module-preferences").addClass("changed")}),n.on("click",".shur-module-enabled",function(){var t=e(this).parents(".shur-module-preferences");t.toggleClass("disabled-module"),t.addClass("changed")}),n.modal(),n.css("z-index",1e3),e(".modal-backdrop").css("z-index",999),e(window).on("resize",function(){n.find(".modal-body").css("height",e(window).height()-280)}),e(window).trigger("resize"),n.find('a[data-toggle="tab"][href="#tab-about"]').on("shown.bs.tab",function(){t.autoupdater.getChangelog(function(e){n.find("#shur-changelog .panel-body").html(e)}),e(this).off("shown.bs.tab")}),n.find('a[data-toggle="tab"][href="#tab-help"]').on("shown.bs.tab",function(){t.preferences.getFAQ(function(e){n.find("#shur-faq .panel-body").html(e)}),e(this).off("shown.bs.tab")}),n.on("click","#change-api-key",function(){bootbox.confirm("Recuerde que generar una nueva API Key elimina todos sus datos y configuraciones. Pulse en Aceptar para continuar con el proceso.",function(e){e&&(bootbox.hideAll(),bootbox.dialog({message:"<center>Generando API Key...</center>"}),t.sync.generateNewApiKey(function(){i.helper.location.href="#newkey",i.helper.location.reload()}))})}),n.on("shown.bs.modal",function(){e(".shur-tags-group input[type=text]").tokenfield({allowDuplicates:!1,delimiter:",",minLength:2,limit:150})}),n.find('a[data-toggle="tab"][href="#tab-debug"]').on("shown.bs.tab",function(){e("#debug-log").html(e("#shurscript_log").html())}),n.on("click","#debug-send",function(){bootbox.confirm("Por el bien de la comunidad, no abuse de esta utilidad y <strong>trate de ser todo lo conciso posible</strong> para ayudar a resolver el problema. Confirme que desea enviar el registro de shurscript y el suceso que ha escrito.",function(t){t&&(e.post("http://shurscript.org/report.php",e("#debug-form").serialize()),e("#debug-send").attr({disabled:"disabled",value:"Reporte enviado correctamente"}))})}),i.$modal=n,unsafeWindow.viewPlainText=function(t){bootbox.dialog({message:'<textarea id="textselect" class="form-control" style="min-height:75px;max-height:500px;overflow-y:auto;" readonly></textarea>',buttons:{seleccionar:{label:"Seleccionar el contenido",className:"btn-default",callback:function(){return e("#textselect").select(),!1}},cerrar:{label:"Cerrar",className:"btn-primary"}}});var n=e(t).attr("mapsTo");e("#textselect").text(e("input[data-maps-to='"+n+"']").tokenfield("getTokensList",","))}},i.checkUpdates=function(){var n=e("#check-shurscript-updates");n.button("loading"),t.autoupdater.check(!0,function(e){n.button("reset"),e||bootbox.alert("No hay actualizaciones disponibles del Shurscript")})},i.getFAQ=function(n){t.GreaseMonkey.xmlhttpRequest({method:"GET",url:t.config.visualFAQ,onload:function(i){var r;try{r=e(i.responseText).find(".markdown-body"),r=e(r).find("hr").remove().end(),r=e(r).find("blockquote:first").remove().end()}catch(o){r="Haz clic <a target='_blank' href='"+t.config.visualFAQ+"'>aquí</a> para ver los cambios de esta versión."}n(r)}})},i.saveSettings=function(){var n=0,r=i.$modal.find(".shur-module-preferences.changed");r.length?(bootbox.dialog({message:"<center>Guardando cambios...</center>"}),r.each(function(o,a){var s=e(a),l=s.data("module-id"),c=t.moduleManager.modules[l],u=c.preferences;u.enabled=s.find(".shur-module-enabled").is(":checked"),s.find(".shur-option").each(function(t,n){var i,r,o,a=e(n);a.hasClass("shur-radio-group")?(i=a.find(".icheck-item.checked input[type=radio]"),r=i.val()):a.hasClass("shur-checkbox-group")?(i=a.find(".shur-checkbox input"),r=i.is(":checked")):a.hasClass("shur-text-group")?(i=a.find("input"),r=i.val()):a.hasClass("shur-tags-group")&&(i=a.find("input"),r=i.val()),o=i.data("maps-to"),u[o]=r}),c.storePreferences(function(){n++,n>=r.length&&i.helper.location.reload()})})):i.$modal.modal("hide")},i.createModal=function(){var n={scriptVersion:t.scriptVersion,scriptBranch:t.scriptBranch,apiKey:t.config.apiKey,visualFAQ:t.config.visualFAQ,visualChangelog:t.config.visualChangelog,userDebug:t.environment.user.name,userIdDebug:t.environment.user.id,urlDebug:t.preferences.helper.location.href,agentDebug:t.environment.browser.name,modules:[]};return e.each(t.moduleManager.modules,function(e,t){n.modules.push({id:t.id,name:t.name,description:t.description,options:t.getPreferenceOptions(),preferences:t.preferences})}),e(t.templater.fillOut("modal",n))},i.load=function(){i.helper.addStyle("modalcss"),-1!=i.helper.location.hash.indexOf("newkey")&&(i.onShow(),i.$modal.find('a[data-toggle="tab"][href="#tab-about"]').tab("show"),setTimeout(function(){i.helper.location.href="#"},1e3))},i.createOption=function(t){var r=["checkbox","radio","text","color","header","tags"],o=["type","caption"],a="Error creando opcion: ";return e.each(o,function(e,r){t[r]===n&&i.helper.throw(a+r+" no esta definido")}),-1===r.indexOf(t.type)&&i.helper.throw(a+type+" no es un tipo valido de opcion"),"radio"===t.type&&("[object Array]"!==Object.prototype.toString.call(t.elements)&&i.helper.throw(a+".elements no es un array"),e.each(t.elements,function(e,t){(t.value===n||t.caption===n)&&i.helper.throw(a+"Al elemento radio numero "+e+" le falta la propiedad value y/o caption"),t.subCaption=t.subCaption||""})),"header"!==t.type&&t.mapsTo===n&&i.helper.throw(a+".mapsTo no esta definido"),t.subCaption=t.subCaption||"",t},setTimeout(function(){var e="modal",n=i.helper.getResourceText("modalhtml");t.templater.storeTemplate(e,n),t.templater.compile(e)},0)}(jQuery,SHURSCRIPT),function(e,t){"use strict";function n(){"frontpage"===m.helper.environment.page?(e("#AutoNumber1.contenido tr:first-child").append('<td style="padding: 0px;" rowspan=3 class="alt2"><div class="notifications">0</div></td>'),GM_addStyle("#notificationsBox {right: 19px;}")):e(".page table td.alt2[nowrap]").first().parent().append('<td style="padding: 0px;" class="alt2"><div class="notifications">0</div></td>'),e(".notifications").click(function(){("ERROR"==$||!b||Date.now()-parseFloat(b)>6e4)&&i(),C.is(":visible")?C.hide():a()}),"off"!=v&&"/search.php"!=m.helper.environment.page&&(!b||Date.now()-parseFloat(b)>1e3*60*v)?i(!0):(s(k),$="OK")}function i(t){t=t!==undefined?t:!1,e(".notifications").html("..."),$="QUERY",y=new XMLHttpRequest,y.onreadystatechange=function(){if(4==y.readyState&&"OK"==y.statusText)try{b=Date.now();var n=e.parseHTML(y.responseText),o=e(n).find("#inlinemodform table[id*='post']");if(0==o.length){if(-1!=y.responseText.indexOf("debes estar registrado o identificado")){$="ERROR";var l=e(".notifications");return l.attr("title","Ha ocurrido un error al cargar las notificaciones. Contacta con los desarrolladores en el hilo oficial del Shurscript (ForoCoches)."),l.html("X"),undefined}var u=e(n).find(".page li").text();if(u&&!t){u=u.substring(u.indexOf("aún")+4);var g=u.substring(0,u.indexOf(" ")),v=parseInt(g)+1,T=setInterval(function(){v>0?r("...<sup>"+v--+"</sup>"):(i(),clearInterval(T))},1e3);return}if(t&&k.length>0)return s(k),$="OK",undefined}var C,S=Array();if(x)for(var E=0;o.length>E&&(C=new f(o[E],!1),x!=C.postLink);E++)(m.preferences.mentionsToo||h(C))&&S.push(C);o.length>0&&(x=new f(o[0]).postLink,m.helper.setValue("LAST_READ_QUOTE",x));var _=[],A=[];k=S.concat(k);for(var E=0;k.length>E;E++)k[E].read?A.push(k[E]):_.push(k[E]);k=_.concat(A.slice(0,10-_.length)),w=JSON.stringify(k),m.helper.setValue("LAST_QUOTES_UPDATE",""+Date.now()),m.helper.setValue("LAST_QUOTES",w),s(k),$="OK",m.preferences.showAlerts&&t&&(1==S.length?(C=S[0],bootbox.dialog({message:"El usuario <b>"+C.userName+"</b> te ha citado en el hilo <b>"+C.threadName+"</b><p><br></p><i>"+C.postText+"</i><p><br></p>¿Quieres ver el post ahora?",buttons:[{label:"Ya leída",className:"btn-default",callback:function(){d(C),s(k)}},{label:"Más tarde",className:"btn-default"},{label:"Abrir post",className:"btn-default",callback:function(){d(C,function(){p(C,"_self")})}},{label:"En nueva ventana",className:"btn-primary",callback:function(){d(C,function(){p(C,"_blank"),s(k)
})}}]})):S.length>1&&bootbox.dialog({message:"Tienes <b>"+S.length+" citas nuevas</b> en el foro ¿Quieres verlas ahora?",buttons:[{label:"Ya leídas",className:"btn-default",callback:function(){c()}},{label:"Más tarde",className:"btn-default"},{label:"Ver lista",className:"btn-default",callback:function(){e("html, body").animate({scrollTop:0},"slow"),a()}},{label:"Abrir todas en pestañas",className:"btn-primary",callback:function(){c(function(){S.forEach(function(e){p(e,"_blank")})})}}]}))}catch(N){m.helper.throw(N)}},y.open("GET",g,!0),y.send()}function r(t){var n=e(".notifications");t>0?(document.title="("+t+") - "+_,n.attr("title","Tienes "+t+" "+(1==t?"notificación no leída":"notificaciones no leídas")),n.addClass("unread")):(document.title=_,n.attr("title","No tienes ninguna notificación nueva"),n.removeClass("unread")),T=t,n.html(t)}function o(){C=e("<div id='notificationsBox'/>"),S=e("<div id='notificationsList'/>"),e(document.body).append(C),C.append(S),e(document).mouseup(function(t){"block"!=C.css("display")||C.is(t.target)||e(".notifications").is(t.target)||0!==C.has(t.target).length||(C.hide(),t.stopImmediatePropagation(),t.stopPropagation(),t.preventDefault())})}function a(){C.css("top",e(".notifications").offset().top+e(".notifications").outerHeight()+6),C.show()}function s(t){S.html('<div id="noNotificationsMessage">No tienes ninguna notificación</div>');for(var n=0,i=0;t.length>i;i++)u(t[i]),t[i].read||n++;if(r(n),!E){E=e("<table id='notificationsListButtons' border='0' cellspacing='0'><tr></tr></table>");var o=e("<td title='Marcar todas las citas como leídas'/>");if(o.html("Marcar como leídas"),o.click(function(){c()}),E.append(o),m.preferences.openInTabsButton){var a=e("<td title='Abrir todas las citas no leídas en diferentes pestañas'/>");a.html("Abrir en pestañas"),a.click(function(){var e=l();c(function(){e.forEach(function(e){p(e,"_blank")})})}),E.append(a)}C.append(E)}n>0?E.show():E.hide()}function l(){var e=[];return k.forEach(function(t){t.read||e.push(t)}),e}function c(e){for(var t=0;k.length>t;t++)k[t].read=!0;s(k),w=JSON.stringify(k),m.helper.setValue("LAST_QUOTES",w,e),C.hide()}function u(t){e("#noNotificationsMessage").hide();var n=function(e){return 0===e.indexOf("http")?e:"/foro/"+e},i=n(t.userLink),r=n(t.threadLink),o=n(t.postLink),a=e(SHURSCRIPT.templater.fillOut("quote",{cita:t,postLink:o,threadLink:r,userLink:i}));a.on("mouseup",".postLink",function(e){3===e.which||t.read||d(t,function(){1!==e.which||e.ctrlKey||e.metaKey||p(t,"_self")})}),A[t]=a,S.append(a)}function d(e,t){e.read=!0,w=JSON.stringify(k),m.helper.setValue("LAST_QUOTES",w,t),r(T-1),A[e].addClass("read")}function p(e,t){window.open(0==e.postLink.indexOf("http")?e.postLink:"/foro/"+e.postLink,t)}function f(t,n){var i=e(t).find(".smallfont > em > a");this.postLink=i.attr("href"),this.postText=i.text().replace(/</g,"<"),this.postID=this.postLink.match(/#post([\d]*)/)[1];var r=e(t).find(".alt1 > div > a > strong");this.threadLink=r.parent().attr("href"),this.threadName=r.text();var o=e(t).find(".smallfont > a");this.userLink=o.attr("href"),this.userName=o.text(),this.read=n}function h(t){var n=!1;return y=new XMLHttpRequest,y.onreadystatechange=function(){if(4==y.readyState&&"OK"==y.statusText){var i=e.parseHTML(y.responseText),r=e(i).find("#post_message_"+t.postID).text(),o=m.helper.environment.user.name.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");r.match(RegExp("Originalmente Escrito por "+o,"i"))&&(n=!0)}},y.open("GET",t.postLink,!1),y.send(),n}var m=t({id:"Quotes",name:"Notificador de citas y menciones",author:"xusoO",version:"0.2",description:"Avisará al usuario cada vez que alguien le cite en un post, mostrando alertas y un listado de las ultimas citas no leídas.",domain:"ALL",initialPreferences:{enabled:!0,showAlerts:!0,mentionsToo:!0,openInTabsButton:!1,refreshEvery:2}});m.getPreferenceOptions=function(){var e=m.helper.createPreferenceOption;return unsafeWindow.chromeTabsWarning=function(){bootbox.alert("<p>Si al darle al botón de Abrir en pestañas solo os abre una pestaña y no todas, es porque tenéis bloqueados los pop-ups para Forocoches, tendréis que permitirselos para poder abrir las notificaciones en pestañas.</p> <p>Pero eso no es todo, Google Chrome por norma general solo te abrirá el primer enlace en una nueva pestaña. El resto te los abrirá en ventanas independientes.</p> <p>Cómo sabemos que esto puede ser molesto y no existe solución por nuestra parte, en el caso que de verdad quieras usar esta funcionalidad de abrir las notificaciones en pestañas, deberás instalar <a target='_blank' href='https://chrome.google.com/webstore/detail/one-window/papnlnnbddhckngcblfljaelgceffobn/related'>esta extensión</a> que aunque no es una solución muy limpia, hace su función.</p> <p>Para evitar confusiones, decir que esto no tiene nada que ver con abrir una única notificación en una nueva pestaña, eso funciona perfectamente. El problema descrito solo aplica cuando se abre más de una a la vez.</p> <p>Disculpa las molestias</p>")},[e({type:"checkbox",mapsTo:"showAlerts",caption:"Mostrar una alerta en el navegador cada vez que llegue una nueva notificación"}),e({type:"checkbox",mapsTo:"mentionsToo",caption:"Notificarme también cuando alguien me mencione en un hilo, no solo cuando me citen",subCaption:"<br/>Desmarca esta opción si tienes problemas con tu nick o te llegan citas que no deberían llegarte"}),e({type:"checkbox",mapsTo:"openInTabsButton",caption:"Mostrar botón en la lista de notificaciones para abrir las no leídas en pestañas. <b style='text-decoration:underline;' onclick='chromeTabsWarning()'>Leer usuarios de Chrome</b>"}),e({type:"radio",elements:[{value:2,caption:"Cada 2 minutos"},{value:10,caption:"Cada 10 minutos"},{value:30,caption:"Cada 30 minutos"},{value:"off",caption:"Manualmente",subCaption:"Haciendo clic en el contador de notificaciones"}],caption:"Buscar citas:",mapsTo:"refreshEvery"})]},GM_addStyle(".notifications {cursor: pointer; text-align: center; padding: 3px 0px; width: 70px; background: #CECECE; color: gray; font-size: 24pt;}"),GM_addStyle(".notifications.unread {background: #CC3300; color: white;}"),GM_addStyle(".notifications.unread:hover {background: #E64D1A; color: white;}"),GM_addStyle(".notifications sup {font-size: 10px;}"),GM_addStyle("#notificationsBox {background: #FFF;border: 1px solid #C30;position: absolute;display: none;box-shadow: 0 2px 4px -2px;right: 11px;font:10pt verdana,geneva,lucida,'lucida grande',arial,helvetica,sans-serif}"),GM_addStyle("#notificationsBox #notificationsList{overflow: auto;max-height: 380px;min-height: 83px;width: 340px;}"),GM_addStyle("#notificationsBox:after, #notificationsBox:before {bottom: 100%;border: solid transparent;content: ' ';height: 0;width: 0;position: absolute;pointer-events: none;}"),GM_addStyle("#notificationsBox:after {border-color: rgba(255, 255, 255, 0);border-bottom-color: #fff;border-width: 10px;left: 92%;margin-left: -13px;}"),GM_addStyle("#notificationsBox:before {border-color: rgba(204, 51, 0, 0);border-bottom-color: #CC3300;border-width: 11px;left: 92%;margin-left: -14px;}"),GM_addStyle("#notificationsList a.postLink {font-weight: normal;}"),GM_addStyle(".notificationRow {overflow: visible; padding: 6px; font-size: 9pt; color: #444;border-bottom:1px solid lightgray;}"),GM_addStyle(".notificationRow > div {margin-top: 2px;}"),GM_addStyle(".notificationRow.read {color: #AAA !important;}"),GM_addStyle(".notificationRow.read a {color: #888 !important;}"),GM_addStyle(".notificationRow:hover {background: #eee;}"),GM_addStyle("#noNotificationsMessage {text-align: center; line-height: 83px; font-size: 12pt; color: #646464;}"),GM_addStyle("#notificationsListButtons td {background: #CC3300;color: white;cursor: pointer;font-size: 10pt;height: 30px;line-height: 30px;text-align: center;border-right: 1px solid white;}"),GM_addStyle("#notificationsListButtons td:last-child {border: none;}"),GM_addStyle("#notificationsListButtons td:hover {background: #E64D1A;}"),GM_addStyle("#notificationsListButtons {width: 100%;}"),GM_addStyle("#AutoNumber1.contenido .notifications {padding: 6px 0px;}");var g,v,y,b,x,w,k,T,C,S,E,_,$="QUERY";m.migrateValues=function(e){m.helper.getValue("LAST_QUOTES_UPDATE")?e():m.helper.setValue("LAST_QUOTES_UPDATE",m.helper.getLocalValue("LAST_QUOTES_UPDATE"),function(){m.helper.setValue("LAST_READ_QUOTE",m.helper.getLocalValue("LAST_READ_QUOTE"),function(){m.helper.setValue("LAST_QUOTES",m.helper.getLocalValue("LAST_QUOTES"),e)})})},m.onNormalStart=function(){_=document.title;for(var e=m.helper.environment.user.name,t="",i=0;e.length>i;i++)t+=e.charCodeAt(i)>255?"\\"+e.charCodeAt(i):e.charAt(i);g="http://www.forocoches.com/foro/search.php?do=process&query="+escape(t)+"&titleonly=0&showposts=1",b=m.helper.getValue("LAST_QUOTES_UPDATE"),x=m.helper.getValue("LAST_READ_QUOTE"),w=m.helper.getValue("LAST_QUOTES"),k=Array(),w&&(k=JSON.parse(w)),v=m.preferences.refreshEvery,"off"!=v&&(v=parseInt(v));var r="quote",a=m.helper.getResourceText("quotehtml");SHURSCRIPT.templater.storeTemplate(r,a),SHURSCRIPT.templater.compile(r),o(),n()};var A={}}(jQuery,SHURSCRIPT.moduleManager.createModule),function(e,t,n){"use strict";function i(){""!==M.preferences.favoritesColor&&(M.preferences.favoritesBorderOnly?GM_addStyle(".favorite>td:nth-child(3) {border-left: 4px solid "+M.preferences.favoritesColor+" !important}"):GM_addStyle(".favorite>td:nth-child(3) {background-color:"+M.preferences.favoritesColor+" !important;}")),GM_addStyle(".fav img {display:none;} .fav {cursor: pointer; background-repeat:no-repeat; background-position: center; background-image:url('"+SHURSCRIPT.config.imagesURL+"fav.png"+"');min-width:20px;}"),GM_addStyle(".shurmenu_trigger img, .shurmenu_opened img {display:none;} .shurmenu_trigger, .shurmenu_opened {cursor: pointer; background-repeat:no-repeat; background-position: center; background-image:url('"+SHURSCRIPT.config.imagesURL+"roto2.gif"+"');min-width:20px;}"),GM_addStyle(".not_fav img {display:none;} .not_fav {cursor: pointer; background-repeat:no-repeat; background-position: center; background-image:url('"+SHURSCRIPT.config.imagesURL+"nofav.png"+"');min-width:20px;}"),GM_addStyle(".shur_estrella {width:30px;vertical-align:middle;} .shur_estrella a {cursor: pointer; width:20px; height:20px; display:block; background-repeat:no-repeat; background-position: center; background-image:url('"+SHURSCRIPT.config.imagesURL+"nofav.png"+"'); margin:0 auto;} .shur_estrella a.fav {background-image:url('"+SHURSCRIPT.config.imagesURL+"fav.png"+"');}"),""!==M.preferences.highlightColor&&(M.preferences.highlightBorderOnly?GM_addStyle(".highlighted>td:nth-child(3) {border-left: 4px solid "+M.preferences.highlightColor+"}"):GM_addStyle(".highlighted>td:nth-child(3) {background-color:"+M.preferences.highlightColor+";}")),GM_addStyle(".highlightKeyword {text-decoration: underline; color: black;}"),GM_addStyle(".hiddenKeyword {text-decoration: line-through; color: black;}")}function r(){v(),y(),e("body").click(function(t){-1==t.target.className.indexOf("popover")&&e(".popover").length&&!jQuery.contains(e(".popover")[0],t.target)&&(e(".shurmenu_opened").not(""!=t.target.id?"#"+t.target.id:"").removeClass("shurmenu_opened"),-1==t.target.id.indexOf("statusicon")&&e(".popover").remove())}),I=JSON.parse(M.helper.getValue("HIDDEN_THREADS","[]")),x(),e("#threadslist tr").each(function(){var t={};t.row=e(this),t.title_td=e(this).find('td[id^="td_threadtitle_"]'),0!=t.title_td.length&&(t.title_link=t.title_td.find('div > a[id^="thread_title_"]').first(),t.href=t.title_link.attr("href"),t.id=parseInt(/.*showthread\.php\?.*t=([0-9]+).*/.exec(t.href)[1]),t.title=t.title_link.html(),t.creator_span=t.title_td.find("div.smallfont > span:last-child"),t.creator=t.creator_span.text(),t.icon_td=e(this).find("#td_threadstatusicon_"+t.id),a(t),t.icon_td.popover({content:l(t),container:"body",placement:"right",html:!0,trigger:"manual"}),t.icon_td.click(function(){e(".popover").remove(),e(this).popover("show"),e(".popover .popover-content").html(l(t)),e(".popover .popover-content").css({height:"30px"}),e(this).addClass("shurmenu_opened")}),t.icon_td.hover(function(){e(this).addClass("shurmenu_trigger")},function(){e(this).removeClass("shurmenu_trigger")}),j.push(t))})}function o(){var t=e("#threadtools_menu form>table tr:last a").attr("href");if(-1!=t.indexOf("subscription"))var n=parseInt(t.replace("subscription.php?do=addsubscription&t=",""),10);else var n=parseInt(t.replace("poll.php?do=newpoll&t=",""),10);var i=_.isFavorite(n),r='<td class="shur_estrella shurscript"><a href="#" class="'+(i?"fav":"")+'" data-placement="top" data-toggle="tooltip"></a></td>';e("#poststop").next().find("td.smallfont").first().before(r),e("#posts").next().find("table td.smallfont").first().before(r),e(".shur_estrella a").tooltip({delay:300,title:i?"Desmarcar como favorito":"Marcar como favorito"}),e(".shur_estrella a").each(function(){e(this).click(function(){return i?(e(this).tooltip("destroy"),e(this).tooltip({delay:300,title:"Marcar como favorito"}),i=!1,_.remove(n),k(),e(".shur_estrella a").each(function(){e(this).removeClass("fav")})):(e(this).tooltip("destroy"),e(this).tooltip({delay:300,title:"Desmarcar como favorito"}),i=!0,_.add(n),_.populateAndSave({id:n}),e(".shur_estrella a").each(function(){e(this).addClass("fav")})),!1})})}function a(t){if("/search.php"==M.helper.environment.page)_.isFavorite(t.id)&&(t.row.addClass("favorite"),t.isFavorite=!0);else{var n;I.indexOf(t.id)>=0?(s(t),t.isHidden=!0):_.isFavorite(t.id)?(t.isFavorite=!0,e(".favorite").not(".hiddenThread").length>0?e(".favorite").not(".hiddenThread").last().after(t.row):e(".highlighted").not(".hiddenThread").length>0?e(".highlighted").not(".hiddenThread").first().before(t.row):e("#threadslist > tbody[id^='threadbits_forum'] > tr").first().before(t.row),t.row.addClass("favorite")):R&&(n=b(t.creator,R,"hiddenKeyword"))?(s(t),t.isHidden=!0,t.isHiddenByUser=!0,t.creator_span.html(n)):N&&(n=b(t.title,N,"hiddenKeyword"))&&(s(t),t.isHidden=!0,t.isHiddenByKeywords=!0,t.title=n,t.title_link.html(n));var i;(O&&(n=b(t.title,O,"highlightKeyword"))||L&&(i=b(t.creator,L,"highlightKeyword")))&&(t.isHighlighted=!0,i?t.creator_span.html(i):t.title_link.html(n),t.isHidden||t.isFavorite||(e(".highlighted").not(".hiddenThread").length>0?e(".highlighted").not(".hiddenThread").last().after(t.row):e(".favorite").not(".hiddenThread").length>0?e(".favorite").not(".hiddenThread").last().after(t.row):e("#threadslist > tbody[id^='threadbits_forum'] > tr").first().before(t.row)),t.row.addClass("highlighted"),t.isHiddenByKeywords&&$.find(".tcat").css("background","#FBBD97")),t.isHidden||-1!=t.icon_td.find("img").attr("src").indexOf("new.gif")||(M.preferences.hideReadThreads&&t.row.css("display","none"),P.push(t))}}function s(t){var n=e("#hiddenthreadslist");if(0==n.length){var i=e("#threadslist");n=e('<table id="hiddenthreadslist" class="tborder" cellspacing="1" cellpadding="5" border="0" width="100%" align="center">'),n.append(i.find("tbody").first().clone());var r=i.prev(),o=e('<table id="hiddenthreadsheader" class="tborder" cellspacing="1" cellpadding="5" border="0" width="100%" align="center" style="cursor: pointer;"><tr><td class="tcat" width="100%"><span style="background: url(\''+SHURSCRIPT.config.imagesURL+'trash-black.png\') no-repeat scroll 0% 0% transparent; height: 16px; display: inline-block; vertical-align: middle; width: 20px; margin-top: -2px;"></span><span id="numhiddenthreads">0</span> Hilo(s) oculto(s)</td></tr></table>');o.click(function(){n.parent().slideToggle()}),r.before(n),n.before(o),n.wrap('<div id="hiddenthreadslistwrapper" style="overflow: hidden;"></div>'),n.parent().hide(),e("#hiddenthreadsheader, #hiddenthreadslistwrapper").wrapAll('<div id="hiddenthreads" style="margin-bottom: 15px;"></div>'),$=e("#hiddenthreads")}t.row.addClass("hiddenThread"),n.append(t.row),H++,1==H&&$.show(),$.find("#numhiddenthreads").html(H)}function l(t){var n=e("<div class='shurscript'/>");return(!t.isHidden||t.isHiddenByKeywords)&&n.append(g(t,"Quitar favorito","Favorito",SHURSCRIPT.config.imagesURL+"star.png",t.isFavorite,function(){c(t),t.icon_td.removeClass("shurmenu_opened"),e(".popover").remove()})),"/search.php"!=M.helper.environment.page&&n.append(g(t,"Mostrar de nuevo","Ocultar",SHURSCRIPT.config.imagesURL+"trash.png",t.isHidden&&!t.isHiddenByKeywords,function(){u(t),t.icon_td.removeClass("shurmenu_opened"),e(".popover").remove()},"btn-danger")),n}function c(e){e.isFavorite?p(e):d(e)}function u(e){e.isHidden?e.row.fadeOut({complete:function(){h(e),e.row.show()}}):e.row.fadeOut({complete:function(){f(e),e.row.show()}})}function d(t){_.add(t.id),_.populateAndSave({id:t.id}),e(t.row).addClass("favorite"),t.isFavorite=!0}function p(t){_.remove(t.id),e(t.row).removeClass("favorite"),t.isFavorite=!1,k()}function f(e){e.isHidden=!0,I.push(e.id),(e.isFavorite||_.isFavorite(e.id))&&p(e),s(e),T()}function h(e){C(e.id,I),e.icon_td.removeClass("shurmenu_opened"),e.isHidden=!1,m(e),T()}function m(t){e("#threadslist > tbody[id^='threadbits_forum']").append(t.row),H--,$.find("#numhiddenthreads").html(H),0==H&&($.hide(),$.find("#hiddenthreadslistwrapper").hide())}function g(t,n,i,r,o,a,s){var l=e('<button type="button" data-toggle="button" style="margin: 0 5px; display: inline-block;" class="btn btn-sm '+(s?s:"btn-default")+'"><span style="background: url(\''+r+"') no-repeat scroll 0% 0% transparent; height: 16px; display: inline-block; vertical-align: middle; width: 20px; margin-top: -2px;\"></span><span>"+(o?n:i)+"</span></button>");return l.click(function(){var t;t=e(this).hasClass("active")?i:n,e(this).find("span")[0].style.backgroundImage=r,e(this).find("span")[1].innerHTML=t}),o&&l.addClass("active"),l.click(a),l}function v(){var t=e("#stickies_collapse").length?e("#stickies_collapse"):e("#forumtools"),n=e('<a rel="nofollow">'+(M.preferences.hideReadThreads?"Mostrar todos los hilos":"Mostrar solo los hilos no leídos")+"</a>");A=e('<td class="vbmenu_control" nowrap="nowrap" style="cursor: pointer;"></td>'),A.append(n),A.click(function(){M.preferences.hideReadThreads=!M.preferences.hideReadThreads,M.preferences.hideReadThreads?(e.each(P,function(e,t){t.hideRead=!0,t.row.css("display","none")}),n.html("Mostrar todos los hilos")):(e.each(P,function(e,t){t.hideRead=!1,t.row.css("display","table-row")}),n.html("Mostrar solo los hilos no leídos")),M.storePreferences()}),t.before(A)}function y(){var t=e("<input name='quickFilter' placeholder='Filtro rápido...'/>"),n=e("<td class='tcat' style='padding:0px 4px;'/>");n.append(t),"/search.php"==M.helper.environment.page?e("#threadslist .tcat span").last().append(n):A.before(n);var i,r=function(){if(""==t.val()||2>=t.val().length)j.forEach(function(e){e.hideRead||e.row.css("display","table-row"),e.title_link.html(e.title)});else{var e=w(t.val(),!1,!1);j.forEach(function(t){if(!t.isHidden){var n;!t.hideRead&&(n=b(t.title,e,"highlightKeyword"))?(t.title_link.html(n),t.row.css("display","table-row")):(t.title_link.html(t.title),t.row.css("display","none"))}})}};t.keydown(function(e){27==e.which?setTimeout(function(){t.val(""),t.trigger("input")},1):13==e.which&&e.preventDefault()}),t.on("input",function(){clearTimeout(i),i=setTimeout(r,200)})}function b(e,t,n){for(var i=!1,r=t&&t.exec(e),o=e;null!=r&&""!=r[0];)o=o.replace(r[0].trim(),"<span class='"+n+"'>"+r[0].trim()+"</span>"),e=e.substring(r.index+r[0].length),r=t.exec(e),i=!0;return i&&o}function x(){if(M.preferences.hiddenKeywords)try{N=w(M.preferences.hiddenKeywords,M.preferences.hiddenKeywordsIsRegex)}catch(e){N=null,bootbox.alert("Ha ocurrido un error. Revisa la expresión regular que has introducido para ocultar hilos.")}if(M.preferences.hiddenUsers)try{R=w(M.preferences.hiddenUsers,!1)}catch(e){R=null,bootbox.alert("Ha ocurrido un error. Revisa la expresión regular que has introducido para ocultar hilos por usuario.")}if(M.preferences.highlightKeywords)try{O=w(M.preferences.highlightKeywords,M.preferences.highlightKeywordsIsRegex)}catch(e){O=null,bootbox.alert("Ha ocurrido un error. Revisa la expresión regular que has introducido para resaltar hilos.")}if(M.preferences.highlightUsers)try{L=w(M.preferences.highlightUsers,!1)}catch(e){L=null,bootbox.alert("Ha ocurrido un error. Revisa la expresión regular que has introducido para resaltar hilos por usuario.")}}function w(e,t,i){var r;return t?r=RegExp(e,"i"):(e=e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),e=e.replace(/[\ ]*[\,]+[\ ]*$/,""),r=i===n||i?"(\\b|\\ )":"",r+="("+e.replace(/[aáà]/gi,"[aáà]").replace(/[eéè]/gi,"[eéè]").replace(/[iíï]/gi,"[iíï]").replace(/[oóò]/gi,"[oóò]").replace(/[uúü]/gi,"[uúü]").replace(/[\ ]*[\,]+[\ ]*/g,"|")+")",(i===n||i)&&(r+="(\\b|\\ )"),r=RegExp(r,"i")),r}function k(){M.helper.setValue("FAVORITES",JSON.stringify(_))}function T(){M.helper.setValue("HIDDEN_THREADS",JSON.stringify(I))}function C(e,t){var n=t.indexOf(e);n>-1&&t.splice(n,1)}function S(){var t=new XMLHttpRequest;t.onreadystatechange=function(){if(4===t.readyState&&200===t.status){for(var n=t.responseText,i=new DOMParser,r=i.parseFromString(n,"text/html"),o=r.getElementById("buddylist").getElementsByTagName("a"),a=[],s=0,l=o.length;l>s;s++)a.push(o[s].textContent);var c=a.join(", "),u=e("input[data-maps-to='highlightUsers']").tokenfield("getTokensList",",");a.length>0?u?c!==u?bootbox.confirm("<p>La lista actual se sobreescribirá con el nuevo listado que se obtenga de tu <a href='/foro/profile.php?do=buddylist' target='_blank'>lista de contactos</a>.</p><p>¿Desea continuar?</p>",function(t){t&&e("input[data-maps-to='highlightUsers']").tokenfield("setTokens",c)}):bootbox.alert("No hemos detectado cambios en tu <a href='/foro/profile.php?do=buddylist' target='_blank'>lista de contactos</a> desde la última importación. Realiza cambios en tus contactos antes de volver a intentarlo."):e("input[data-maps-to='highlightUsers']").tokenfield("setTokens",c):bootbox.alert("Tu <a href='/foro/profile.php?do=buddylist' target='_blank'>lista de contactos</a> está vacía. Para resaltar los mensajes de tus contactos... ¡primero añade algunos!")}},t.open("GET","/foro/profile.php?do=buddylist",!0),t.send()}function E(){var t=new XMLHttpRequest;t.onreadystatechange=function(){if(4===t.readyState&&200===t.status){var n=t.responseText,i=new DOMParser,r=i.parseFromString(n,"text/html"),o=r.getElementById("ignorelist");if(o){for(var a=o.getElementsByTagName("a"),s=[],l=0,c=a.length;c>l;l++)s.push(a[l].textContent);var u=s.join(", "),d=e("input[data-maps-to='hiddenUsers']").tokenfield("getTokensList",",");s.length>0&&(d?u!==d?bootbox.confirm("<p>La lista actual se sobreescribirá con el nuevo listado que se obtenga de tu <a href='/foro/profile.php?do=ignorelist' target='_blank'>lista de ignorados</a>.</p><p>¿Desea continuar?</p>",function(t){t&&e("input[data-maps-to='hiddenUsers']").tokenfield("setTokens",u)}):bootbox.alert("No hemos detectado cambios en tu <a href='/foro/profile.php?do=ignorelist' target='_blank'>lista de ignorados</a> desde la última importación. Realiza cambios en tus ignorados antes de volver a intentarlo."):e("input[data-maps-to='hiddenUsers']").tokenfield("setTokens",u))}else bootbox.alert("Tu <a href='/foro/profile.php?do=ignorelist' target='_blank'>lista de ignorados</a> está vacía. Para ocultar los posts de tus usuarios ignorados... ¡primero ignora a alguien!")}},t.open("GET","/foro/profile.php?do=ignorelist",!0),t.send()}var _,$,A,N,R,O,L,M=t({id:"FilterThreads",name:"Filtrado de hilos",author:"xusoO",version:"0.2",description:"Añade varias opciones a la lista de hilos de un subforo: Marcar hilos como favoritos, resaltarlos, u ocultar los temas que no te interesen. Ya sea de forma manual o automática mediante palabras clave.",domain:["/forumdisplay.php","/showthread.php","/search.php"],initialPreferences:{enabled:!0,hideReadThreads:!1,hiddenUsers:"",hiddenKeywords:"",hiddenKeywordsIsRegex:!1,highlightUsers:"",highlightKeywords:"",highlightKeywordsIsRegex:!1,highlightColor:"#FAF7DD",highlightBorderOnly:!1,favoritesColor:"#D5E6EE",favoritesBorderOnly:!1}}),D=function(t){var i=this;if(this.favs=[],this.isFavorite=function(e){var t;if("number"==typeof e)t=e;else{if(e.id===n)return!1;t=e.id}for(var r=0;i.favs.length>r;r++)if(i.favs[r].id==t)return!0;return!1},this.add=function(e){var t={};"number"==typeof e?t.id=e:t=e,i.favs.push(t)},this.remove=function(e){var t;"number"==typeof e?t=e:e.id!==n&&(t=e.id);for(var r=0;i.favs.length>r;r++)if(i.favs[r].id==t){i.favs.splice(r,1);break}},this.update=function(e){for(var t=0;i.favs.length>t;t++)i.favs[t].id==e.id&&(i.favs[t]=e)},this.getSections=function(){for(var e=[],t=0;i.favs.length>t;t++)if(i.favs[t].section!=n){for(var r=!1,o=0;e.length>o;o++)if(i.favs[t].section.id==e[o].id){r=!0;break}r||e.push(i.favs[t].section)}return e},this.populateAndSave=function(t,r){e.ajax({url:"/foro/showthread.php?t="+t.id,dataType:"text"}).done(function(o){var a=e(o).find("div.page td.thead span.cmega").html();a=a.replace("<!-- google_ad_section_start -->",""),a=a.replace("<!-- google_ad_section_end -->","");var s=e(o).find(".bigusername").first().html(),l=e(o).find(".navbar").last().find("a").html(),c=e(o).find(".navbar").last().find("a").attr("href").replace("forumdisplay.php?f=","");t.title=a,t.author=s,t.section={name:l,id:c},i.update(t),k(),r!=n&&r(t)})},this.getFavHTML=function(e){var t='<tr id="shurscript-fav-'+e.id+'">'+'<td style="vertical-align:middle;"><a id="'+e.id+'" style="cursor:pointer;"><img src="'+SHURSCRIPT.config.imagesURL+'trash-black.png" style="width:16px;height:16px;" /></a></td>'+'<td><a href="{link}">{title}</a> <a href="{link}&goto=newpost" class="lastpost-tooltip" data-placement="bottom" data-toggle="tooltip" title="Ir al último mensaje leído">»</a></td>'+'<td style="text-align:center;vertical-align:middle;"><span class="badge" style="font-size:10px;">{author}</span></td></tr>';return t=e.hasOwnProperty("title")?t.replace("{title}",e.title):t.replace("{title}","Cargando datos del hilo..."),t=e.hasOwnProperty("author")?t.replace("{author}",e.author):t.replace("{author}","---"),t=t.replace(/\{link\}/g,"/foro/showthread.php?t="+e.id)},this.getSectionHTML=function(t){var n='<table class="table table-striped table-bordered" style="margin-bottom: 0;"><th></th><th style="text-align:center;font-size:12px;">Hilo</th><th style="text-align:center;font-size:12px;">Autor</th></table>',i=e('<div class="panel panel-default" id="shurscript-favs-section-'+t.id+'">'+'<div class="panel-heading"><h4 class="panel-title"><a data-toggle="collapse" data-parent="#accordion" href="#collapse-'+t.id+'">'+t.name+"</a></h4></div>"+'<div id="collapse-'+t.id+'" class="panel-collapse collapse">'+'<div class="panel-body">'+n+"</div>"+"</div>"+"</div>");return i},t.favs!==n)i.favs=t.favs;else for(var r=0;t.length>r;r++)this.add(t[r])},j=[],P=[],I=[],H=0;M.migrateValues=function(e){M.helper.setValue("FAVORITES",M.helper.getLocalValue("FAVORITES"),function(){M.helper.setValue("HIDDEN_THREADS",M.helper.getLocalValue("HIDDEN_THREADS"),e)})},M.normalStartCheck=function(){return!0},M.onNormalStart=function(){i(),_=new D(JSON.parse(M.helper.getValue("FAVORITES","[]"))),"/forumdisplay.php"==M.helper.environment.page||"/search.php"==M.helper.environment.page?r():"/showthread.php"==M.helper.environment.page&&o()},M.getPreferenceOptions=function(){var e=M.helper.createPreferenceOption;return unsafeWindow.FilterThreads_importBuddyList=function(){S()},unsafeWindow.FilterThreads_importIgnoreList=function(){E()},[e({type:"header",caption:"Ocultar hilos",subCaption:"Puedes ocultar hilos de forma automática, ya sea mediante una lista negra de usuarios o por palabras clave en el título de los temas:"}),e({type:"checkbox",mapsTo:"hideReadThreads",caption:"Mostrar solo hilos no leídos.",subCaption:'<span style="color:gray;">De cualquier modo aparecerá un botón para ocultarlos o mostrarlos. Esta opción solo cambia el comportamiento por defecto.</span>'}),e({type:"tags",mapsTo:"hiddenUsers",caption:"Ignorar hilos por usuario <b>(separados por comas)</b>",buttons:!0,plain:!0,button1:'<a href="#" onclick="FilterThreads_importIgnoreList(); return false;" class="btn btn-xs btn-default">Importar de la lista de ignorados</a>'}),e({type:"text",mapsTo:"hiddenKeywords",caption:"Ignorar hilos por palabras clave <b>(separadas por comas)</b>"}),e({type:"header",caption:"Resaltar hilos",subCaption:"Los hilos que contengan cualquiera de estas palabras serán resaltados con los colores selccionados de entre el resto de hilos:"}),e({type:"tags",mapsTo:"highlightUsers",caption:"Resaltar hilos por usuario <b>(separados por comas)</b>",buttons:!0,plain:!0,button1:'<a href="#" onclick="FilterThreads_importBuddyList(); return false;" class="btn btn-xs btn-default">Importar de la lista de contactos</a>'}),e({type:"text",mapsTo:"highlightKeywords",caption:"Resaltar hilos por palabras clave <b>(separadas por comas)</b>"}),e({type:"color",mapsTo:"highlightColor",caption:"Color",subCaption:'El color de fondo para los hilos resaltados. Por defecto <span class="badge">'+M.initialPreferences.highlightColor+"</span>"}),e({type:"checkbox",mapsTo:"highlightBorderOnly",caption:"Aplicar color solo al borde izquierdo"}),e({type:"header",caption:"Hilos favoritos",subCaption:"Mostrará un icono al lado de cada hilo para marcarlo como favorito. Los hilos favoritos destacarán entre los demás cuando el usuario entre a algún subforo:"}),e({type:"color",mapsTo:"favoritesColor",caption:"Color",subCaption:'Color de fondo", "El color de fondo para los hilos favoritos. Por defecto <span class="badge">'+M.initialPreferences.favoritesColor+"</span>"}),e({type:"checkbox",mapsTo:"favoritesBorderOnly",caption:"Aplicar color solo al borde izquierdo"})]},M.onShurbarClick=function(){_==n&&(_=new D(JSON.parse(M.helper.getValue("FAVORITES","[]"))));var t=e('<div id="shurscript-favs" class="shurscript modal fade" tabindex="-1" role="dialog" aria-labelledby="modalLabel" aria-hidden="true"><div class="modal-dialog modal-favs"><div class="modal-content"><div class="modal-header"><button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button><h4 class="modal-title" id="modalLabel">Hilos Favoritos</h4></div><div class="modal-body panel-group" id="accordion"></div></div></div></div>');e("body").append(t);var i=_.getSections();i.forEach(function(e){t.find(".modal-body").append(_.getSectionHTML(e))});try{var r=location.href.match(/forumdisplay\.php\?f\=(\d+)/i),o=r&&r[1];o||(o=e(".fjsel").val());var a=e("#shurscript-favs #shurscript-favs-section-"+o+" .collapse");a.length||(a=e("#shurscript-favs .collapse").first()),a.collapse("show")}catch(s){}for(var l,c=0;_.favs.length>c;c++)if(l=_.favs[c],"title"in l&&"section"in l&&"author"in l){var u=e("#shurscript-favs-section-"+l.section.id+" table");u.append(_.getFavHTML(l)),u.find("#shurscript-fav-"+l.id+" a#"+l.id).click(function(){var t=e(this).attr("id");bootbox.confirm("Por favor, confirme que desea eliminar este hilo de sus favoritos",function(e){e&&(bootbox.hideAll(),M.favRemove(t))})})}else _.populateAndSave(l,M.favPopulated);_.favs.length||(t.find(".modal-body").css("text-align","center"),t.find(".modal-body").html('<span style="color: gray; font-size: 14pt; display: inline-block; font-weight: 200; margin-bottom: 10px;">Todavía no has añadido ningún hilo como favorito :(</span><img src="'+SHURSCRIPT.config.imagesURL+"howtofav.gif"+'">')),t.on("hidden.bs.modal",function(){t.remove()}),t.find(".lastpost-tooltip").tooltip({delay:300}),t.modal("show"),t.css("z-index",1e3),e(".modal-backdrop").css("z-index",999)},M.favPopulated=function(t){var n=e("#shurscript-favs");if(n.length>0){var i=e("#shurscript-favs-section-"+t.section.id);0>=i.length&&(i=e(_.getSectionHTML(t.section)),n.find(".modal-body").append(i),n.find(".lastpost-tooltip").tooltip({delay:300})),i.find("table").append(_.getFavHTML(t)),i.find("#shurscript-fav-"+t.id+" a#"+t.id).click(function(){var t=e(this).attr("id");bootbox.confirm("Por favor, confirme que desea eliminar este hilo de sus favoritos",function(e){e&&(bootbox.hideAll(),M.favRemove(t))
})})}},M.favRemove=function(t){t=parseInt(t),_.remove(t),k(),e("#shurscript-fav-"+t).remove()},M.shurbarIcon=function(){return{name:"Hilos favoritos",description:"Ver la lista de todos tus hilos favoritos",image:SHURSCRIPT.config.imagesURL+"star.png",actionType:"popover",handler:M.onShurbarClick}}}(jQuery,SHURSCRIPT.moduleManager.createModule),function(e,t){"use strict";function n(){var t=v();y()||e("#"+t.editorid+"_textarea").css("width",600),unsafeWindow.switch_editor_mode(t.editorid),unsafeWindow.is_saf=!1,unsafeWindow.is_moz=!0,t.wysiwyg_mode=1,0==e("#"+t.editorid+"_cmd_switchmode").length&&e('<td><div id="'+t.editorid+'_cmd_switchmode" class="imagebutton" style="background: none repeat scroll 0% 0% rgb(225, 225, 226); color: rgb(0, 0, 0); padding: 1px; border: medium none;"><img height="20" width="21" alt="Cambiar Modo de Editor" src="http://cdn.forocoches.com/foro/images/editor/switchmode.gif" title="Cambiar Modo de Editor"></div></td>').insertAfter(e("#vB_Editor_QR_cmd_resize_0_99").parent())}function i(){SHURSCRIPT.eventbus.triggerDelayed("editorReady",0),y()&&A.preferences.multiQuickReply&&s(),A.preferences.autoGrow&&a(),A.preferences.savePosts&&c(),A.preferences.autoSendReply&&u(),y()&&e("a[href^='editpost.php?do=editpost']").click(function(){var t=setInterval(function(){var n="vB_Editor_QE_"+unsafeWindow.vB_QuickEditor.editorcounter;if(e("#"+n+"_editor").length>0&&S[n]){clearInterval(t);var i=S[n];0==i.wysiwyg_mode?(unsafeWindow.switch_editor_mode(n),i.wysiwyg_mode=1,t=setInterval(function(){S[n].editdoc.body&&(clearInterval(t),o(n))},500)):o(n)}},500)})}function r(){y()&&A.preferences.iconsAndButtons&&(f(),d()),e("input[name='sbutton'], input[name='preview']").on("click",function(){var e=x();e=e.replace(/<div>((?!<\/div>)(?!<div>).)*<\/div>/gi,function(e){var t=e.substring(5,e.length-6);return"<br>"==t?t:"<br>"+t}),w(e),m()})}function o(t){var n=S[t];if(A.preferences.autoGrow){try{-1!=navigator.userAgent.indexOf("AppleWebKit")&&n.editdoc.write("<!doctype HTML>\n"+n.editdoc.head.outerHTML+n.editdoc.body.outerHTML)}catch(i){}e(n.editdoc.body).on("input",function(){n.editbox.style.height=Math.max(n.editdoc.body.offsetHeight+30,200)+"px"}),e(n.editdoc.body).trigger("input")}}function a(){var t=v();try{-1!=navigator.userAgent.indexOf("AppleWebKit")&&t.editdoc.write("<!doctype HTML>\n"+t.editdoc.head.outerHTML+t.editdoc.body.outerHTML)}catch(n){}_=e('<input type="checkbox" checked/>')[0],_.onclick=function(){_.checked?m():t.editbox.style.height=$+"px"},e(t.controlbar).find("> table > tbody > tr").first().append("<td></td>").append(_),_.title="Crecer automáticamente con el contenido",$=y()?g():unsafeWindow.fetch_cookie("editor_height")||430,e(t.editdoc.body).on("input",function(){_.checked&&m()}),e("#vB_Editor_QR_cmd_resize_1_99").click(function(){_.checked=!1,m()}),e("#vB_Editor_QR_cmd_resize_0_99").click(function(){_.checked=!1,m()}),m()}function s(){var t=function(){if(b()){var t=this.id.replace("qr_",""),n="",i=!1,r=unsafeWindow.fetch_cookie("vbulletin_multiquote");if(r&&""!=r&&(r=r.split(","),r.forEach(function(r){if(t==r&&(i=!0),0!=e("#post"+r).length){n+=l(r);var o=e('img[id^="mq_'+r+'"]');o.attr("src",o.attr("src").replace("_on.gif","_off.gif"))}})),i||(n+=l(t)),n+="<br>",C(x())){var o=A.preferences.postOverwrite;switch(o){case"ASK":bootbox.dialog({message:"Actualmente hay texto escrito en el editor <b>¿Quieres añadir la cita al texto actual o sobreescribirlo?</b>",buttons:[{label:"Cancelar",className:"btn-default"},{label:"Añadir",className:"btn-primary",callback:function(){k(n),m()}},{label:"Sobreescribir",className:"btn-danger",callback:function(){w(""),k(n),m()}}]});break;case"OVERWRITE":w("");case"APPEND":k(n),m()}}else k(n),m();unsafeWindow.set_cookie("vbulletin_multiquote","")}};e("body").on("click",'a[id^="qr_"]',t),e("#"+v().editorid).siblings().filter("fieldset").first().hide()}function l(t){var n=e("#post"+t).find(".bigusername").text(),i=e("#post_message_"+t).clone();return i.find("div[style*='margin:20px; margin-top:5px;']").remove(),i.find("div[style='margin:20px; margin-top:5px'] > .smallfont:contains('Código')").parent().each(function(){var t=e(this).find(".alt2"),n=e(this).find(".smallfont").text();return"Código HTML:"==n?(t.find("span").each(function(){var t=this.nextSibling&&0==this.nextSibling.textContent.indexOf("\n")?"</br>":"";this.outerHTML=e(this).text().replace(/</g,"<")+t}),t=t.html().replace(/ /g," "),e(this).replaceWith("[HTML]</br>"+t.trim()+"</br>[/HTML]"),undefined):"Código PHP:"==n?(t=t.find("code span"),t.find("span").each(function(){this.outerHTML=this.innerHTML}),t=t.html().replace(/ /g," "),e(this).replaceWith("[PHP]</br>"+t.trim()+"</br>[/PHP]"),undefined):(t=t.text(),t=t.replace(/\n/g,"</br>").replace(/\ /g," "),"Código:"==n&&e(this).replaceWith("[CODE]</br>"+t.trim()+"</br>[/CODE]"),undefined)}),i.find("iframe.youtube-player").each(function(){var t=e(this).attr("src").match(/^.*\/(.*)/)[1];e(this).replaceWith("[YOUTUBE]"+t+"[/YOUTUBE]")}),i.find('img[class!="inlineimg"]').each(function(){e(this).replaceWith("[IMG]"+e(this).attr("src")+"[/IMG]")}),"[QUOTE="+n+";"+t+"]"+i.html().trim()+"[/QUOTE]"+"<br><br>"}function c(){var t=e('input[name="t"]').val();t||"/newthread.php"!=A.helper.environment.page||(t="new_thread");var n=A.helper.getValue("POST_BACKUP");n&&y()&&(n=JSON.parse(n),n.threadId==t&&(!C(x())&&C(n.postContents)&&w(n.postContents),m()));var i,r=function(){clearTimeout(i),i=setTimeout(function(){A.helper.setValue("POST_BACKUP",JSON.stringify({threadId:t,postContents:x()}))},1e3)};if(e(v().editdoc.body).on("input",r),y())e("input[name='sbutton']").on("click",function(){clearTimeout(i),A.helper.deleteValue("POST_BACKUP")});else{var o=e("input[name='sbutton']");o.attr("type","button");var a=o.parents("form")[0];o.on("click",function(){clearTimeout(i),a.onsubmit()&&A.helper.deleteValue("POST_BACKUP",function(){a.submit()})})}}function u(){var t=function(){var t;unsafeWindow.autoReplyInterval&&clearInterval(unsafeWindow.autoReplyInterval);var n=setInterval(function(){var i=e("td.alt1 ol");i.length>0&&-1!=i.text().indexOf("Debes esperar")?(i=i.find("li").first(),t=t||parseInt(i.text().match(/en ([\d]+)/)[1]),0>=t--?(clearInterval(n),A.helper.deleteValue("POST_BACKUP"),e("form[name='vbform']").submit()):i.html("Debes esperar al menos 30 segundos entre cada envio de nuevos mensajes. El mensaje se enviará automáticamente en "+t+" segundos. <a style='color: #CC3300;cursor:pointer;' onclick='clearInterval(autoReplyInterval); this.remove();'>Cancelar</a>")):clearInterval(n)},1e3);unsafeWindow.autoReplyInterval=n};y()?e("input[name='sbutton']").on("click",t):t()}function d(){var t=e('<fieldset class="fieldset" style="margin:3px 0 0 0"><legend>Iconos</legend></fieldset>');e("#"+v().editorid).parent().append(t),t.append(p(":roto2:","http://cdn.forocoches.com/foro/images/smilies/goofy.gif",164)),t.append(p(":sisi3:","http://cdn.forocoches.com/foro/images/smilies/sisi3.gif",324)),t.append(p(":mola:","http://cdn.forocoches.com/foro/images/smilies/thumbsup.gif",48)),t.append(p(":cantarin:","http://cdn.forocoches.com/foro/images/smilies/Sing.gif",101)),t.append(p(":qmeparto:","http://cdn.forocoches.com/foro/images/smilies/meparto.gif",142)),t.append(p(":nusenuse:","http://cdn.forocoches.com/foro/images/smilies/nusenuse.gif",283)),t.append(p(":facepalm:","http://cdn.forocoches.com/foro/images/smilies/facepalm.gif",318)),t.append(p(":zpalomita","http://cdn.forocoches.com/foro/images/smilies/icon_popcorn.gif",215)),t.append(p(":zplatano2","http://cdn.forocoches.com/foro/images/smilies/b2.gif",236)),t.append(p(":number1:","http://cdn.forocoches.com/foro/images/smilies/number_one.gif",268)),t.append(p(":elrisas:","http://cdn.forocoches.com/foro/images/smilies/qmeparto.gif",76)),t.append(p(":gaydude:","http://cdn.forocoches.com/foro/images/smilies/gaydude.gif",264)),t.append(p(":sisi1:","http://cdn.forocoches.com/foro/images/smilies/sisi1.gif",299)),t.append(p(":babeando:","http://cdn.forocoches.com/foro/images/smilies/babeando.gif",274)),t.append(p(":elboinas:","http://cdn.forocoches.com/foro/images/smilies/elboinas.gif",314)),t.append(p(":qtedoy:","http://cdn.forocoches.com/foro/images/smilies/smiley_1140.gif",191)),t.append(p(":abrazo:","http://cdn.forocoches.com/foro/images/smilies/abrazo.gif",161));var n=e("<a href='#qrform'>Más...</a>");n.click(function(){v().open_smilie_window(785,500)}),t.append(n)}function p(e,t,n){return'<img border="0" class="inlineimg" src="'+t+'" style="cursor: pointer; padding: 5px;" onclick="vB_Editor.'+v().editorid+".insert_smilie(undefined, '"+e+"', '"+t+"', "+n+')">'}function f(){E=function(e){e=unsafeWindow.do_an_e(e),"click"==e.type&&S[v().editorid].format(e,this.cmd,!1,!0),S[v().editorid].button_context(this,e.type)};var t=e(v().controlbar).find("> table > tbody > tr > td:nth-child(8)"),n=[];n.push(h("justifyleft","Alinear a la Izquierda")),n.push(h("justifycenter","Alinear al Centro")),n.push(h("justifyright","Alinear a la Derecha")),n.push('<td><img width="6" height="20" alt="" src="http://cdn.forocoches.com/foro/images/editor/separator.gif"></td>'),n.push(h("insertorderedlist","Lista Ordenada")),n.push(h("insertunorderedlist","Lista sin Ordenar")),n.push('<td><img width="6" height="20" alt="" src="http://cdn.forocoches.com/foro/images/editor/separator.gif"></td>'),n.push(h("undo","Deshacer")),n.push(h("redo","Rehacer")),n.push('<td><img width="6" height="20" alt="" src="http://cdn.forocoches.com/foro/images/editor/separator.gif"></td>'),n.push(h("wrap0_code","Envolver Etiquetas [CODE]","code")),n.push(h("wrap0_html","Envolver Etiquetas [HTML]","html")),n.push(h("wrap0_php","Envolver Etiquetas [PHP]","php")),n.push('<td><img width="6" height="20" alt="" src="http://cdn.forocoches.com/foro/images/editor/separator.gif"></td>'),t.after(n)}function h(t,n,i){var r=i?i:t,o=e('<div id="vB_Editor_001_cmd_'+t+'" class="imagebutton" style="background: none repeat scroll 0% 0% rgb(225, 225, 226); color: rgb(0, 0, 0); padding: 1px; border: medium none;"><img width="21" height="20" alt="'+n+'" src="http://cdn.forocoches.com/foro/images/editor/'+r+'.gif" title="'+n+'"></div>')[0];return o.editorid=v().editorid,o.cmd=t,o.onclick=o.onmousedown=o.onmouseover=o.onmouseout=E,e("<td></td>").append(o)}function m(){_&&_.checked&&(v().editbox.style.height=Math.min(600,Math.max(g()+30,$))+"px")}function g(){var e=v().editdoc.body.offsetHeight;return Math.max(e,100)}function v(){return"/showthread.php"==A.helper.environment.page?S.vB_Editor_QR:S.vB_Editor_001}function y(){return"vB_Editor_QR"==v().editorid}function b(){return 1==v().wysiwyg_mode}function x(){return v().get_editor_contents()}function w(e){T(),v().set_editor_contents(e)}function k(e){T(),v().insert_text(e)}function T(){v().editdoc.body.focus()}function C(e){return e.trim().replace(/\<br\>/g,"")}var S,E,_,$,A=t({id:"BetterPosts",name:"Editor de posts mejorado",author:"xuso0",version:"0.2",description:"Activa varias opciones nuevas en la creación de posts e hilos, tanto el de respuesta rápida como el avanzado. <b>BETA</b>",domain:["/showthread.php","/newthread.php","/newreply.php","/editpost.php"],initialPreferences:{enabled:!0,iconsAndButtons:!0,autoGrow:!0,multiQuickReply:!0,autoSendReply:!0,savePosts:!0,postOverwrite:"ASK"}});A.normalStartCheck=function(){return!0},A.onNormalStart=function(){if(S=unsafeWindow.vB_Editor,r(),b())i();else{n();var e=setInterval(function(){v().editdoc.body&&(clearInterval(e),i())},500)}},A.getPreferenceOptions=function(){var e=A.helper.createPreferenceOption;return[e({type:"checkbox",mapsTo:"iconsAndButtons",caption:"Mostrar nuevos botones e iconos en el formulario de respuesta rápida"}),e({type:"checkbox",mapsTo:"autoGrow",caption:"La caja de texto crece a medida que se va escribiendo el post"}),e({type:"checkbox",mapsTo:"multiQuickReply",caption:"Permitir multi-cita con el botón de Respuesta rápida (y mostrar la propia cita en la caja de texto)"}),e({type:"checkbox",mapsTo:"autoSendReply",caption:"Auto-enviar el mensaje pasados los 30 segundos de espera entre post y post"}),e({type:"checkbox",mapsTo:"savePosts",caption:"Guardar copia de los mensajes sin enviar para evitar perder el contenido de un post accidentalmente"}),e({type:"radio",elements:[{value:"ASK",caption:"Preguntar"},{value:"APPEND",caption:"Añadir"},{value:"OVERWRITE",caption:"Sobreescribir"}],caption:"Cuando cites con respuesta rápida y haya texto escrito en el editor ¿Quieres añadir la cita al texto actual o sobreescribirlo?:",mapsTo:"postOverwrite"})]}}(jQuery,SHURSCRIPT.moduleManager.createModule),function(e,t){"use strict";var n=t({id:"Scrollers",name:"Scroll arriba y abajo",author:"xusoO",version:"0.1",description:"Aparecerán dos flechas en la parte inferior del foro; una para volver al principio de la página y la otra para ir al final.",domain:"ALL",initialPreferences:{enabled:!1,upOrDown:"both",side:"center"}});n.normalStartCheck=function(){return!0},n.onNormalStart=function(){"center"!=n.preferences.side?GM_addStyle("#scrollers {opacity: 0.5;bottom: 5px;"+n.preferences.side+": 13px;position: fixed;}"):GM_addStyle("#scrollers {opacity: 0.5;bottom: 5px;left: calc(50% - 55px);position: fixed;}"),GM_addStyle("#scrollers:hover {opacity: 0.9;}"),GM_addStyle('.scrollerArrow {background: url("'+SHURSCRIPT.config.imagesURL+'scroller.png") no-repeat scroll 0 0 transparent;background-size: 50px;cursor: pointer;height: 50px;width: 50px;display: inline-block;margin: 5px;opacity: 0.4;}'),GM_addStyle(".scrollerArrow:hover {opacity: 0.7;}"),GM_addStyle(".scrollerArrow#scrollToBottomArrow {transform: rotate(180deg);-webkit-transform: rotate(180deg);}");var t=e("<div id='scrollers'></div>"),i=e("<div class='scrollerArrow' id='scrollToTopArrow'></div>");i.click(function(){e("html, body").stop().animate({scrollTop:"0px"},800)});var r=e("<div class='scrollerArrow' id='scrollToBottomArrow'></div>");r.click(function(){e("html, body").stop().animate({scrollTop:(e("#qrform").length>0?e("#qrform").offset().top:e("html").height())+"px"},800)}),"up"==n.preferences.upOrDown?t.append(i):"down"==n.preferences.upOrDown?t.append(r):t.append(i).append(r),e(document.body).append(t)},n.getPreferenceOptions=function(){var e=n.helper.createPreferenceOption;return[e({type:"radio",elements:[{value:"both",caption:"Ambas fechas"},{value:"up",caption:"Solo la de ir al principio"},{value:"down",caption:"Solo la de ir al final"}],caption:"Mostrar:",mapsTo:"upOrDown"}),e({type:"radio",elements:[{value:"left",caption:"A la izquierda"},{value:"right",caption:"A la derecha"},{value:"center",caption:"Centradas"}],caption:"Alinear:",mapsTo:"side"})]}}(jQuery,SHURSCRIPT.moduleManager.createModule),function(e,t,n){"use strict";function i(){var t=e("#vB_Editor_001_textarea");if(t!=n){var i=document.evaluate("//*[@id='vB_Editor_001_smiliebox']",document,null,XPathResult.FIRST_ORDERED_NODE_TYPE,null).singleNodeValue,r=document.createElement("fieldset");r.title="ShurScript",r.style.marginBottom="10px";var a=document.createElement("legend");a.innerHTML="ShurScript",i.parentNode.insertBefore(r,i),r.appendChild(a);var s=document.createElement("input");s.className="button",s.type="BUTTON",s.style.cursor="pointer",s.addEventListener("click",o,!1),s.setAttribute("id","butNestQuote"),s.value=d,r.appendChild(s)}}function r(e,t){var n=jQuery("#butNestQuote"),i=jQuery("#vB_Editor_001_textarea");n.attr("disabled",!e),i.attr("disabled",!e),n.val(t)}function o(){var e=jQuery("#vB_Editor_001_textarea");r(!1,"Trabajando...");var t=e.val().toUpperCase();if(h=t.search(m),h>=0){var n=h+7;for(g="\n",h=t.indexOf("]",h)+1;" "==t.substr(h,1)||" "==t.substr(h,1)||"\n"==t.substr(h,1);)"\n"==t.substr(h,1)&&(g=""),h++;for(;"[QUOTE="==t.substr(h,7)&&t.indexOf(";",h)>0&&t.indexOf("]",h)>t.indexOf(";",h);)for(g="\n",n=h+7,h=t.indexOf("]",h)+1;" "==t.substr(h,1)||" "==t.substr(h,1)||"\n"==t.substr(h,1);)"\n"==t.substr(h,1)&&(g=""),h++;n=t.indexOf(";",n)+1,v=t.substring(n,t.indexOf("]",n));var i=f+"showpost.php?p="+v;u=new XMLHttpRequest,u.onreadystatechange=a,u.open("GET",i,!0),u.send(null)}else r(!0,"Anidar cita"),bootbox.alert(p+"no se han encontrado citas para anidar.")}function a(){if(4==u.readyState){var e=!0,t="";if(200!=u.status&&0>u.responseText.indexOf('id="post_message_'+v+'"')&&(e=!1),e){var n=document.createElement("div");n.innerHTML=u.responseText,t=document.evaluate("//div[@id='post_message_"+v+"']//img[@alt='Ver Mensaje']/..",n,null,XPathResult.FIRST_ORDERED_NODE_TYPE,null).singleNodeValue,null==t?e=!1:t=t.href,n.innerHTML=""}if(e){var i=t.match(/[?&]p=\d+/);null==i?e=!1:t=i[0].substr(3)}if(e){var o=jQuery("#butNestQuote");o.value="Citando...";var a=f+"newreply.php?do=newreply&p="+t;u=new XMLHttpRequest,u.onreadystatechange=l,u.open("GET",a,!0),u.send(null)}e||(r(!0,"Anidar cita"),null==t?bootbox.alert(p+"El mensaje no posee ninguna cita o ya ha sido citado."):bootbox.alert("No se ha podido obtener el post original (status="+u.status+").\nForoCoches podría estar caído. ¡Guarda una copia del mensaje!"))}}function s(e){var t=document.createElement("div");t.innerHTML=e;var n=t.childNodes[0].nodeValue;return t.removeChild(t.firstChild),n}function l(){if(4==u.readyState){var e=!0,t="";if(200!=u.status&&0>u.responseText.indexOf('id="vB_Editor_001_textarea"')&&(e=!1),e){var n=u.responseText.indexOf('id="vB_Editor_001_textarea"'),i=-1;n>=0&&(n=u.responseText.indexOf("[QUOTE",n)),n>=0&&(i=u.responseText.indexOf("[/QUOTE]",n)),0>n?e=!1:t=u.responseText.substring(n,i)+"\n[/QUOTE]"}if(e){var o=jQuery("#vB_Editor_001_textarea");o.val(o.val().substr(0,h)+g+s(t)+"\n"+o.val().substr(h));try{var a=jQuery("#vB_Editor_001_iframe")[0].contentWindow.document.getElementsByClassName("wysiwyg")[0];a.innerHTML=a.innerHTML.replace(/\n/g,""),a.innerHTML=a.innerHTML.replace(/\[QUOTE.*\].*\[\/QUOTE\]/,o.val().substr(0,h)+g+"\n"+o.val().substr(h))}catch(l){}}r(!0,"Anidar cita"),e||null==quoteid&&bootbox.alert("No se ha podido obtener el post original (status="+u.status+").\nForoCoches podría estar caído. ¡Guarda una copia del mensaje!")}}var c=t({id:"NestedQuotes",name:"Citas anidadas",author:"Fritanga",version:"0.1",description:"Permite ir anidando citas hacia arriba hasta el post original",domain:["/newreply.php"],initialPreferences:{enabled:!0}}),u=null,d="Anidar cita",p="No se pudo anidar la cita: ",f=document.URL.substr(0,document.URL.indexOf("newreply.php")),h=-1,m=/\[QUOTE=[^;\]]+;/,g="\n",v=null;c.normalStartCheck=function(){return!0},c.onNormalStart=function(){i()}}(jQuery,SHURSCRIPT.moduleManager.createModule),function(e,t){"use strict";var n=t({id:"BottomNavigation",name:"Barra de navegación duplicada debajo",author:"TheBronx + Fritanga",version:"1.0",description:"Copia la tabla con la navegación a la parte inferior del foro.",domain:["/showthread.php","/newreply.php"]});n.normalStartCheck=function(){return!0},n.onNormalStart=function(){e("#qrform").before('<table width="100%" cellspacing="1" cellpadding="5" border="0" align="center" class="tborder navigation-bot">'+e(".page>div>table").html()+"</table><br>"),e(".navigation-bot .notifications").parent().remove();var t=e(".fjsel").closest("table.tborder"),n=t.find("div.smallfont").parent();e(".tborder.navigation-bot .alt1").after(n),n.addClass("alt1"),t.remove()}}(jQuery,SHURSCRIPT.moduleManager.createModule),function(e,t){"use strict";function n(){"http://www.forocoches.com/foro/search.php?do=process"===location.href?document.getElementById("searchform").submit():location.href+="&ts="+(new Date).getTime()}function i(){a.textContent="Debes esperar al menos "+l+" segundos entre cada búsqueda. Faltan aún "+s+" segundos. [ Recarga automática desactivada ]",c&&clearTimeout(c)}function r(){if(s--,s>0){var e=document.createElement("a");e.href="#",e.textContent="Cancelar",e.onclick=function(){return i(),!1},a.textContent="Debes esperar al menos "+l+" segundos entre cada búsqueda. Faltan aún "+s+" segundos. — ",a.appendChild(e),c=setTimeout(r,967)}else{var e=document.createElement("a");e.href="#",e.textContent="Refrescar",e.onclick=function(){return n(),!1},a.textContent="Cargando… — ",a.appendChild(e),n()}}var o=t({id:"RefreshSearch",name:"Actualizar búsquedas en espera",author:"Electrosa",version:"0.2",description:"Recarga automáticamente las búsquedas en las que el sistema obliga a esperar varios segundos, evitando así tener que actualizar manualmente la página.",domain:["/search.php"],initialPreferences:{enabled:!0},preferences:{}});o.normalStartCheck=function(){return-1!==location.href.indexOf("/search.php?do=")};var a,s,l,c;o.onNormalStart=function(){a="ForoCoches"===document.title?document.getElementsByClassName("panel")[0].childNodes[1].childNodes[3]:document.querySelector("td.alt1 ol li");var e=a.textContent;if(e){var t=e.length;s=parseInt(e.substring(t-12,t-9)),isNaN(s)||(l=parseInt(e.substring(23,26)),c=setTimeout(r,967))}}}(jQuery,SHURSCRIPT.moduleManager.createModule),function(e,t){"use strict";function n(e){var t=new XMLHttpRequest;t.onreadystatechange=function(){if(4===t.readyState&&200===t.status){var e=t.responseText,n=new DOMParser,o=n.parseFromString(e,"text/html"),a=i(o.querySelector("#posts div.page"));sessionStorage["op_"+u]=a,r(a)}},t.open("GET","showthread.php?t="+e,!0),t.send()}function i(e){var t;return(t=e.getElementsByClassName("bigusername")[0])?t.innerHTML:(t=e.querySelector("td.alt2 > a"))?t.innerHTML:null}function r(e){if(!e)return console_log("ERROR"),undefined;var t=c.helper.environment.user.name,n=c.preferences.contacts.split(/\s*,\s*/);GM_addStyle(".op_post, .op_quote { border: 1px solid "+c.preferences.opPostsColor+" !important; border-left: 5px solid "+c.preferences.opPostsColor+" !important; } .op_post td.alt2 { width: 171px; }"),GM_addStyle(".my_post, .my_quote { border: 1px solid "+c.preferences.myPostsColor+" !important; border-left: 5px solid "+c.preferences.myPostsColor+" !important; } .my_post td.alt2 { width: 171px; }"),GM_addStyle(".contacts_post, .contacts_quote { border: 1px solid "+c.preferences.contactsColor+" !important; border-left: 5px solid "+c.preferences.contactsColor+" !important; } .contacts_post td.alt2 { width: 171px; }");for(var i=document.getElementsByClassName("bigusername"),r=0,o=i.length;o>r;r++){var a=i[r].innerHTML,s=i[r].parentNode.parentNode.parentNode.parentNode.parentNode;if(a===e&&a!==t)s.classList.add("op_post");else if(c.preferences.myPosts&&a===t)s.classList.add("my_post");else for(var l=0,d=n.length;d>l;l++)if(a===n[l]){s.classList.add("contacts_post");break}}if(c.preferences.quotes)for(var p=document.getElementsByClassName("alt2"),r=0,o=p.length;o>r;r++){var f=p[r].getElementsByTagName("B");if(f&&f.length>0){var h=f[0].textContent;if(h===e&&h!==t)p[r].classList.add("op_quote");else if(c.preferences.myPosts&&h===t)p[r].classList.add("my_quote");else for(var l=0,d=n.length;d>l;l++)if(h===n[l]){p[r].classList.add("contacts_quote");break}}}var m=document.getElementById("threadtools"),g=m.parentNode,v=document.createElement("TD");v.className="vbmenu_control",v.innerHTML='<a href="/foro/search.php?do=process&searchthreadid='+u+"&searchuser="+escape(e)+'&exactname=1">Buscar posts del OP</a>',g.insertBefore(v,m)}function o(){var t=new XMLHttpRequest;t.onreadystatechange=function(){if(4===t.readyState&&200===t.status){for(var n=t.responseText,i=new DOMParser,r=i.parseFromString(n,"text/html"),o=r.getElementById("buddylist").getElementsByTagName("a"),a=[],s=0,l=o.length;l>s;s++)a.push(o[s].textContent);var c=a.join(", "),u=e("input[data-maps-to='contacts']").tokenfield("getTokensList",",");a.length>0?u?c!==u?bootbox.confirm("<p>La lista actual se sobreescribirá con el nuevo listado que se obtenga de tu <a href='/foro/profile.php?do=buddylist' target='_blank'>lista de contactos</a>.</p><p>¿Desea continuar?</p>",function(t){t&&e("input[data-maps-to='contacts']").tokenfield("setTokens",c)}):bootbox.alert("No hemos detectado cambios en tu <a href='/foro/profile.php?do=buddylist' target='_blank'>lista de contactos</a> desde la última importación. Realiza cambios en tus contactos antes de volver a intentarlo."):e("input[data-maps-to='contacts']").tokenfield("setTokens",c):bootbox.alert("Tu <a href='/foro/profile.php?do=buddylist' target='_blank'>lista de contactos</a> está vacía. Para resaltar los mensajes de tus contactos... ¡primero añade algunos!")}},t.open("GET","/foro/profile.php?do=buddylist",!0),t.send()}function a(e){return decodeURIComponent((RegExp("[?|&]"+e+"="+"([^&;]+?)(&|#|;|$)").exec(location.search)||[undefined,""])[1].replace(/\+/g,"%20"))||null}function s(){var t;return(t=a("page"))?t:(t=document.getElementById("showthread_threadrate_form"))?t.page.value:(t=e("div.pagenav:first-child span strong")[0])?t.html():-1}function l(){var e;return(e=unsafeWindow.threadid)?e:(e=a("t"))?e:(e=document.getElementById("qr_threadid"))?e.t.value:null}var c=t({id:"HighlightOP",name:"Resaltar ciertos mensajes de un hilo",author:"Electrosa",version:"1.1",description:"Resalta tus mensajes, los mensajes del creador del hilo y los posts de los usuarios que elijas, para distingirlos mejor mientras navegas por los hilos.",domain:["/showthread.php"],initialPreferences:{enabled:!0,quotes:!0,opPostsColor:"#DC143C",myPosts:!1,myPostsColor:"#1E90FF",contacts:"",contactsColor:"#2FC726"},preferences:{}});c.getPreferenceOptions=function(){var e=c.helper.createPreferenceOption;return unsafeWindow.importBuddyList=function(){o()},[e({type:"checkbox",mapsTo:"quotes",caption:"Resaltar también las citas."}),e({type:"color",mapsTo:"opPostsColor",caption:"Color de resaltado de los posts del creador del hilo"}),e({type:"checkbox",mapsTo:"myPosts",caption:"Resaltar mis propios posts."}),e({type:"color",mapsTo:"myPostsColor",caption:"Color de resaltado de mis posts"}),e({type:"tags",mapsTo:"contacts",caption:"Resaltar los posts de los siguientes usuarios (separados por comas)",buttons:!0,plain:!0,button1:'<a href="#" onclick="importBuddyList(); return false;" class="btn btn-xs btn-default">Importar de la lista de contactos</a>'}),e({type:"color",mapsTo:"contactsColor",caption:"Color de resaltado de los posts de usuarios conocidos."})]},c.normalStartCheck=function(){return!0};var u,d;c.onNormalStart=function(){if(u=l(),d=s(),1==d){var e=i(document.querySelector("#posts div.page"));sessionStorage["op_"+u]=e,r(e)}else u&&(sessionStorage["op_"+u]?r(sessionStorage["op_"+u]):n(u))}}(jQuery,SHURSCRIPT.moduleManager.createModule),function(e,t,n){"use strict";function i(){if(!g){g=e(b.helper.getResourceText("imageuploaderhtml")),e("body").append(g);var t=e("#imageurl",g),n=e("#imgur_button",g),i=e("#imgur_file",g),a=e("#imgur_url",g);g.on("show.bs.modal",function(){e("input, textarea",this).val(""),n.html("Seleccionar una o más imágenes...")}),g.on("shown.bs.modal",function(){t.focus()}),t.keypress(function(e){13==e.which&&t.val()&&(m(t.val()),g.modal("hide"))}),n.on("click",function(){i.click()}),i.on("change",function(e){var t=e.originalEvent.target.files.length;n.html(t+" "+(t>1?"imágenes seleccionadas":"imagen seleccionada"))}),g.on("click","#insert-images",function(){var e;(e=t.val())?m(e):(e=i.val())?e=o(i.get(0).files):(e=a.val())&&(e=r(e)),e&&g.modal("hide")})}g.modal()}function r(t){var n=t.split("\n");return x+=n.length,e.each(n,function(e,t){0==t.indexOf("http")?a(t,"url"):x--}),x&&s(),x}function o(t,n){n&&(n.stopPropagation(),n.preventDefault()),x+=t.length;var i;return e.each(t,function(e,t){t.type.match("image.*")?(i=new FileReader,i.onload=function(e){a(e.target.result)},i.readAsDataURL(t)):x--}),x&&s(),x}function a(t,n){e.ajax({url:"https://api.imgur.com/3/image",method:"POST",headers:{Authorization:"Client-ID "+SHURSCRIPT.config.imgurClientID,Accept:"application/json"},data:{image:t.replace(/^data:image\/.*;base64,/,""),type:n||"base64"}}).done(function(e){m(e.data.link)}).fail(function(e){var n=JSON.parse(e.responseText).data.error,i="Ha ocurrido un error al subir la imagen a Imgur. Detalles: "+(n.message||n);b.helper.showMessageBar({message:i,type:"danger",timeout:5e3}),b.helper.throw("Error Imgur: "+e.responseText+"\nBase64 Image: "+t,e)}).always(function(){w++,l()})}function s(){y||(y=!0,bootbox.dialog({message:'<center>Subiendo imágenes...<div id="uploadprogress" style="margin-top: 10px;" class="hidden progress progress-striped active"><div class="progress-bar" style="width: 0%"></div></div></center>'})),l()}function l(){x>1&&(e("#uploadprogress").removeClass("hidden"),e("#uploadprogress .progress-bar").css("width",100*w/x+"%"),w&&e("#uploadprogress .progress-bar").text(w+" de "+x)),w==x&&(y=!1,x=w=0,bootbox.hideAll())}function c(){return"/showthread.php"==b.helper.environment.page?unsafeWindow.vB_Editor.vB_Editor_QR:unsafeWindow.vB_Editor.vB_Editor_001}function u(){return 1==c().wysiwyg_mode}function d(){return c().get_editor_contents()}function p(e){h(),c().set_editor_contents(e)}function f(e){h(),c().insert_text(e)}function h(){u()&&c().editdoc.body.focus()}function m(e){if(u()){var t="<br/>";t+="preview"==b.preferences.embedding?'<img src="'+e+'"/>':"[IMG]"+e+"[/IMG]",f(t)}else p(d()+"\n[IMG]"+e+"[/IMG]")}var g,v,y,b=t({id:"ImageUploader",name:"Subir imágenes a Imgur",author:"xus0",version:"1.0",description:"Sube o arrastra imágenes desde tu equipo, y automáticamente se subirán a Imgur y se postearán en el hilo.",domain:["/showthread.php","/newthread.php","/newreply.php"],initialPreferences:{embedding:"preview"}}),x=0,w=0;b.onNormalStart=function(){b.helper.addStyle("imageuploadercss");try{e(".imagebutton[id$='_cmd_insertimage']").get(0).onclick=n,e("body").on("click",".imagebutton[id$='_cmd_insertimage']",i)}catch(t){b.helper.throw("Error al cambiar evento del boton 'Insertar imagen'",t)}try{v=e("<div id='dropzone' style='display: none;'>Suelta aquí las imágenes para subirlas a</div>"),e("body").append(v),e("body").on("dragover",function(t){var n=t.originalEvent.dataTransfer.types;-1!=e.inArray("Files",n)&&-1==e.inArray("text/html",n)&&(t.stopPropagation(),t.preventDefault(),v.show(),t.originalEvent.dataTransfer.dropEffect="copy")}),v.on("dragleave dragend drop",function(){v.hide()}),v.on("drop",function(t){o(t.originalEvent.dataTransfer.files,t)&&(g&&g.modal("hide"),e("html").animate({scrollTop:e("#qrform").offset().top+"px"},800))})}catch(t){b.helper.throw("Error al activar eventos de drag and drop",t)}SHURSCRIPT.eventbus.on("editorReady",function(){e(".imagebutton[id$='_cmd_insertimage']").get(0).onclick=n,e(c().editdoc).on("dragover",function(t){e("body").trigger(t)})})},b.getPreferenceOptions=function(){var e=b.helper.createPreferenceOption;return[e({type:"radio",elements:[{value:"preview",caption:"Previsualizarla dentro de la caja de texto"},{value:"bbcode",caption:"Mostrarla simplemente entre etiquetas [IMG][/IMG]"}],caption:"Al insertar la imagen:",mapsTo:"embedding"})]}}(jQuery,SHURSCRIPT.moduleManager.createModule);window.top===window&&(SHURSCRIPT.core.initializeEagerly(),jQuery(document).ready(SHURSCRIPT.core.initialize));