var DISQUS=function(a){"use strict";var b=a.DISQUS||{};return b.define=function(c,d){"function"==typeof c&&(d=c,c="");for(var e=c.split("."),f=e.shift(),g=b,h=(d||function(){return{}}).call({overwrites:function(a){return a.__overwrites__=!0,a}},a);f;)g=g[f]?g[f]:g[f]={},f=e.shift();for(var i in h)h.hasOwnProperty(i)&&(!h.__overwrites__&&null!==g[i]&&g.hasOwnProperty(i)?b.logError&&b.logError("Unsafe attempt to redefine existing module: "+i):g[i]=h[i]);return g},b.use=function(a){return b.define(a)},b.define("next"),b}(window);define("shared/foundation",function(a){return function(){var b;return b||a.DISQUS}}(this)),DISQUS.define(function(a,b){"use strict";var c=a.DISQUS,d=a.document,e=d.head||d.getElementsByTagName("head")[0]||d.body,f=0;c.getUid=function(a){var b=++f,c=Math.floor(100*Math.random());return 10>c&&(c="0"+c),(a||"")+b+c},c.isOwn=function(a,b){return Object.prototype.hasOwnProperty.call(a,b)},c.isString=function(a){return"[object String]"===Object.prototype.toString.call(a)},c.each=function(a,b){var d=a.length,e=Array.prototype.forEach;if(isNaN(d))for(var f in a)c.isOwn(a,f)&&b(a[f],f,a);else if(e)e.call(a,b);else for(var g=0;d>g;g++)b(a[g],g,a)},c.extend=function(a){return c.each(Array.prototype.slice.call(arguments,1),function(b){for(var c in b)a[c]=b[c]}),a},c.serializeArgs=function(a){var d=[];return c.each(a,function(a,c){a!==b&&d.push(c+(null!==a?"="+encodeURIComponent(a):""))}),d.join("&")},c.serialize=function(a,b,d){if(b&&(a+=a.indexOf("?")>-1?"&"===a.charAt(a.length-1)?"":"&":"?",a+=c.serializeArgs(b)),d){var e={};return e[(new Date).getTime()]=null,c.serialize(a,e)}var f=a.length;return"&"===a.charAt(f-1)?a.slice(0,f-1):a};var g,h,i=2e4;"addEventListener"in a?(g=function(a,b,c){a.addEventListener(b,c,!1)},h=function(a,b,c){a.removeEventListener(b,c,!1)}):(g=function(a,b,c){a.attachEvent("on"+b,c)},h=function(a,b,c){a.detachEvent("on"+b,c)}),c.require=function(b,f,j,k,l){function m(b){b=b||a.event,b.target||(b.target=b.srcElement),("load"===b.type||/^(complete|loaded)$/.test(b.target.readyState))&&(k&&k(),p&&clearTimeout(p),h(b.target,o,m))}var n=d.createElement("script"),o=n.addEventListener?"load":"readystatechange",p=null;return n.src=c.serialize(b,f,j),n.async=!0,n.charset="UTF-8",(k||l)&&g(n,o,m),l&&(p=setTimeout(function(){l()},i)),e.appendChild(n),c}}),define("shared/corefuncs",["shared/foundation"],function(a){return function(){var b;return b||a.DISQUS}}(this)),DISQUS.define(function(a){"use strict";var b=function(a,b){for(var c=0,d=a.length;d>c;c++)if(a[c]===b)return!0;return!1},c={},d=function(d){var e=a.require&&require.defined&&require.defined("remote/config")&&require("remote/config");if(!e||!e.switches)return null;if(DISQUS.isOwn(c,d))return c[d];var f=c[d]=b(e.switches,d);return f},e=function(){a.console&&d("next_logging")!==!1&&(a.console.log.apply?a.console.log.apply(a.console,arguments):a.console.log(Array.prototype.slice.call(arguments,0).join(" ")))};return{log:e,logError:e}}),define("shared/logger",["shared/foundation","shared/corefuncs"],function(a){return function(){var b;return b||a.DISQUS}}(this)),DISQUS.define("next.host.urls",function(){"use strict";var a="default",b="c6ed14e4",c={lounge:"http://disqus.com/embed/comments/",profile:"http://disqus.com/embed/profile/",onboard:"http://disqus.com/embed/onboard/",home:"https://disqus.com/home/"},d=function(a,b){return/^http/.test(b)||(b="http:"),b+"//"+a.replace(/^\s*(\w+:)?\/\//,"")},e=function(e,f,g){var h=c[e];if(!h)throw new Error("Unknown app: "+e);var i=d(h,document.location.protocol),j=DISQUS.extend({base:a,disqus_version:b},f||{}),k=g?"#"+encodeURIComponent(JSON.stringify(g)):"";return DISQUS.serialize(i,j)+k};return{BASE:a,VERSION:b,apps:c,get:e,ensureHttpBasedProtocol:d}}),define("shared/urls",["shared/foundation","shared/corefuncs"],function(a){return function(){var b;return b||a.DISQUS.next.host.urls}}(this)),function(){var a=this,b=a._,c=Array.prototype,d=Object.prototype,e=Function.prototype,f=c.push,g=c.slice,h=c.concat,i=d.toString,j=d.hasOwnProperty,k=Array.isArray,l=Object.keys,m=e.bind,n=function(a){return a instanceof n?a:this instanceof n?void(this._wrapped=a):new n(a)};"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=n),exports._=n):a._=n,n.VERSION="1.7.0";var o=function(a,b,c){if(void 0===b)return a;switch(null==c?3:c){case 1:return function(c){return a.call(b,c)};case 2:return function(c,d){return a.call(b,c,d)};case 3:return function(c,d,e){return a.call(b,c,d,e)};case 4:return function(c,d,e,f){return a.call(b,c,d,e,f)}}return function(){return a.apply(b,arguments)}};n.iteratee=function(a,b,c){return null==a?n.identity:n.isFunction(a)?o(a,b,c):n.isObject(a)?n.matches(a):n.property(a)},n.each=n.forEach=function(a,b,c){if(null==a)return a;b=o(b,c);var d,e=a.length;if(e===+e)for(d=0;e>d;d++)b(a[d],d,a);else{var f=n.keys(a);for(d=0,e=f.length;e>d;d++)b(a[f[d]],f[d],a)}return a},n.map=n.collect=function(a,b,c){if(null==a)return[];b=n.iteratee(b,c);for(var d,e=a.length!==+a.length&&n.keys(a),f=(e||a).length,g=Array(f),h=0;f>h;h++)d=e?e[h]:h,g[h]=b(a[d],d,a);return g};var p="Reduce of empty array with no initial value";n.reduce=n.foldl=n.inject=function(a,b,c,d){null==a&&(a=[]),b=o(b,d,4);var e,f=a.length!==+a.length&&n.keys(a),g=(f||a).length,h=0;if(arguments.length<3){if(!g)throw new TypeError(p);c=a[f?f[h++]:h++]}for(;g>h;h++)e=f?f[h]:h,c=b(c,a[e],e,a);return c},n.reduceRight=n.foldr=function(a,b,c,d){null==a&&(a=[]),b=o(b,d,4);var e,f=a.length!==+a.length&&n.keys(a),g=(f||a).length;if(arguments.length<3){if(!g)throw new TypeError(p);c=a[f?f[--g]:--g]}for(;g--;)e=f?f[g]:g,c=b(c,a[e],e,a);return c},n.find=n.detect=function(a,b,c){var d;return b=n.iteratee(b,c),n.some(a,function(a,c,e){return b(a,c,e)?(d=a,!0):void 0}),d},n.filter=n.select=function(a,b,c){var d=[];return null==a?d:(b=n.iteratee(b,c),n.each(a,function(a,c,e){b(a,c,e)&&d.push(a)}),d)},n.reject=function(a,b,c){return n.filter(a,n.negate(n.iteratee(b)),c)},n.every=n.all=function(a,b,c){if(null==a)return!0;b=n.iteratee(b,c);var d,e,f=a.length!==+a.length&&n.keys(a),g=(f||a).length;for(d=0;g>d;d++)if(e=f?f[d]:d,!b(a[e],e,a))return!1;return!0},n.some=n.any=function(a,b,c){if(null==a)return!1;b=n.iteratee(b,c);var d,e,f=a.length!==+a.length&&n.keys(a),g=(f||a).length;for(d=0;g>d;d++)if(e=f?f[d]:d,b(a[e],e,a))return!0;return!1},n.contains=n.include=function(a,b){return null==a?!1:(a.length!==+a.length&&(a=n.values(a)),n.indexOf(a,b)>=0)},n.invoke=function(a,b){var c=g.call(arguments,2),d=n.isFunction(b);return n.map(a,function(a){return(d?b:a[b]).apply(a,c)})},n.pluck=function(a,b){return n.map(a,n.property(b))},n.where=function(a,b){return n.filter(a,n.matches(b))},n.findWhere=function(a,b){return n.find(a,n.matches(b))},n.max=function(a,b,c){var d,e,f=-1/0,g=-1/0;if(null==b&&null!=a){a=a.length===+a.length?a:n.values(a);for(var h=0,i=a.length;i>h;h++)d=a[h],d>f&&(f=d)}else b=n.iteratee(b,c),n.each(a,function(a,c,d){e=b(a,c,d),(e>g||e===-1/0&&f===-1/0)&&(f=a,g=e)});return f},n.min=function(a,b,c){var d,e,f=1/0,g=1/0;if(null==b&&null!=a){a=a.length===+a.length?a:n.values(a);for(var h=0,i=a.length;i>h;h++)d=a[h],f>d&&(f=d)}else b=n.iteratee(b,c),n.each(a,function(a,c,d){e=b(a,c,d),(g>e||1/0===e&&1/0===f)&&(f=a,g=e)});return f},n.shuffle=function(a){for(var b,c=a&&a.length===+a.length?a:n.values(a),d=c.length,e=Array(d),f=0;d>f;f++)b=n.random(0,f),b!==f&&(e[f]=e[b]),e[b]=c[f];return e},n.sample=function(a,b,c){return null==b||c?(a.length!==+a.length&&(a=n.values(a)),a[n.random(a.length-1)]):n.shuffle(a).slice(0,Math.max(0,b))},n.sortBy=function(a,b,c){return b=n.iteratee(b,c),n.pluck(n.map(a,function(a,c,d){return{value:a,index:c,criteria:b(a,c,d)}}).sort(function(a,b){var c=a.criteria,d=b.criteria;if(c!==d){if(c>d||void 0===c)return 1;if(d>c||void 0===d)return-1}return a.index-b.index}),"value")};var q=function(a){return function(b,c,d){var e={};return c=n.iteratee(c,d),n.each(b,function(d,f){var g=c(d,f,b);a(e,d,g)}),e}};n.groupBy=q(function(a,b,c){n.has(a,c)?a[c].push(b):a[c]=[b]}),n.indexBy=q(function(a,b,c){a[c]=b}),n.countBy=q(function(a,b,c){n.has(a,c)?a[c]++:a[c]=1}),n.sortedIndex=function(a,b,c,d){c=n.iteratee(c,d,1);for(var e=c(b),f=0,g=a.length;g>f;){var h=f+g>>>1;c(a[h])b?[]:g.call(a,0,b)},n.initial=function(a,b,c){return g.call(a,0,Math.max(0,a.length-(null==b||c?1:b)))},n.last=function(a,b,c){return null==a?void 0:null==b||c?a[a.length-1]:g.call(a,Math.max(a.length-b,0))},n.rest=n.tail=n.drop=function(a,b,c){return g.call(a,null==b||c?1:b)},n.compact=function(a){return n.filter(a,n.identity)};var r=function(a,b,c,d){if(b&&n.every(a,n.isArray))return h.apply(d,a);for(var e=0,g=a.length;g>e;e++){var i=a[e];n.isArray(i)||n.isArguments(i)?b?f.apply(d,i):r(i,b,c,d):c||d.push(i)}return d};n.flatten=function(a,b){return r(a,b,!1,[])},n.without=function(a){return n.difference(a,g.call(arguments,1))},n.uniq=n.unique=function(a,b,c,d){if(null==a)return[];n.isBoolean(b)||(d=c,c=b,b=!1),null!=c&&(c=n.iteratee(c,d));for(var e=[],f=[],g=0,h=a.length;h>g;g++){var i=a[g];if(b)g&&f===i||e.push(i),f=i;else if(c){var j=c(i,g,a);n.indexOf(f,j)<0&&(f.push(j),e.push(i))}else n.indexOf(e,i)<0&&e.push(i)}return e},n.union=function(){return n.uniq(r(arguments,!0,!0,[]))},n.intersection=function(a){if(null==a)return[];for(var b=[],c=arguments.length,d=0,e=a.length;e>d;d++){var f=a[d];if(!n.contains(b,f)){for(var g=1;c>g&&n.contains(arguments[g],f);g++);g===c&&b.push(f)}}return b},n.difference=function(a){var b=r(g.call(arguments,1),!0,!0,[]);return n.filter(a,function(a){return!n.contains(b,a)})},n.zip=function(a){if(null==a)return[];for(var b=n.max(arguments,"length").length,c=Array(b),d=0;b>d;d++)c[d]=n.pluck(arguments,d);return c},n.object=function(a,b){if(null==a)return{};for(var c={},d=0,e=a.length;e>d;d++)b?c[a[d]]=b[d]:c[a[d][0]]=a[d][1];return c},n.indexOf=function(a,b,c){if(null==a)return-1;var d=0,e=a.length;if(c){if("number"!=typeof c)return d=n.sortedIndex(a,b),a[d]===b?d:-1;d=0>c?Math.max(0,e+c):c}for(;e>d;d++)if(a[d]===b)return d;return-1},n.lastIndexOf=function(a,b,c){if(null==a)return-1;var d=a.length;for("number"==typeof c&&(d=0>c?d+c+1:Math.min(d,c+1));--d>=0;)if(a[d]===b)return d;return-1},n.range=function(a,b,c){arguments.length<=1&&(b=a||0,a=0),c=c||1;for(var d=Math.max(Math.ceil((b-a)/c),0),e=Array(d),f=0;d>f;f++,a+=c)e[f]=a;return e};var s=function(){};n.bind=function(a,b){var c,d;if(m&&a.bind===m)return m.apply(a,g.call(arguments,1));if(!n.isFunction(a))throw new TypeError("Bind must be called on a function");return c=g.call(arguments,2),d=function(){if(!(this instanceof d))return a.apply(b,c.concat(g.call(arguments)));s.prototype=a.prototype;var e=new s;s.prototype=null;var f=a.apply(e,c.concat(g.call(arguments)));return n.isObject(f)?f:e}},n.partial=function(a){var b=g.call(arguments,1);return function(){for(var c=0,d=b.slice(),e=0,f=d.length;f>e;e++)d[e]===n&&(d[e]=arguments[c++]);for(;c=d)throw new Error("bindAll must be passed function names");for(b=1;d>b;b++)c=arguments[b],a[c]=n.bind(a[c],a);return a},n.memoize=function(a,b){var c=function(d){var e=c.cache,f=b?b.apply(this,arguments):d;return n.has(e,f)||(e[f]=a.apply(this,arguments)),e[f]};return c.cache={},c},n.delay=function(a,b){var c=g.call(arguments,2);return setTimeout(function(){return a.apply(null,c)},b)},n.defer=function(a){return n.delay.apply(n,[a,1].concat(g.call(arguments,1)))},n.throttle=function(a,b,c){var d,e,f,g=null,h=0;c||(c={});var i=function(){h=c.leading===!1?0:n.now(),g=null,f=a.apply(d,e),g||(d=e=null)};return function(){var j=n.now();h||c.leading!==!1||(h=j);var k=b-(j-h);return d=this,e=arguments,0>=k||k>b?(clearTimeout(g),g=null,h=j,f=a.apply(d,e),g||(d=e=null)):g||c.trailing===!1||(g=setTimeout(i,k)),f}},n.debounce=function(a,b,c){var d,e,f,g,h,i=function(){var j=n.now()-g;b>j&&j>0?d=setTimeout(i,b-j):(d=null,c||(h=a.apply(f,e),d||(f=e=null)))};return function(){f=this,e=arguments,g=n.now();var j=c&&!d;return d||(d=setTimeout(i,b)),j&&(h=a.apply(f,e),f=e=null),h}},n.wrap=function(a,b){return n.partial(b,a)},n.negate=function(a){return function(){return!a.apply(this,arguments)}},n.compose=function(){var a=arguments,b=a.length-1;return function(){for(var c=b,d=a[b].apply(this,arguments);c--;)d=a[c].call(this,d);return d}},n.after=function(a,b){return function(){return--a<1?b.apply(this,arguments):void 0}},n.before=function(a,b){var c;return function(){return--a>0?c=b.apply(this,arguments):b=null,c}},n.once=n.partial(n.before,2),n.keys=function(a){if(!n.isObject(a))return[];if(l)return l(a);var b=[];for(var c in a)n.has(a,c)&&b.push(c);return b},n.values=function(a){for(var b=n.keys(a),c=b.length,d=Array(c),e=0;c>e;e++)d[e]=a[b[e]];return d},n.pairs=function(a){for(var b=n.keys(a),c=b.length,d=Array(c),e=0;c>e;e++)d[e]=[b[e],a[b[e]]];return d},n.invert=function(a){for(var b={},c=n.keys(a),d=0,e=c.length;e>d;d++)b[a[c[d]]]=c[d];return b},n.functions=n.methods=function(a){var b=[];for(var c in a)n.isFunction(a[c])&&b.push(c);return b.sort()},n.extend=function(a){if(!n.isObject(a))return a;for(var b,c,d=1,e=arguments.length;e>d;d++){b=arguments[d];for(c in b)j.call(b,c)&&(a[c]=b[c])}return a},n.pick=function(a,b,c){var d,e={};if(null==a)return e;if(n.isFunction(b)){b=o(b,c);for(d in a){var f=a[d];b(f,d,a)&&(e[d]=f)}}else{var i=h.apply([],g.call(arguments,1));a=new Object(a);for(var j=0,k=i.length;k>j;j++)d=i[j],d in a&&(e[d]=a[d])}return e},n.omit=function(a,b,c){if(n.isFunction(b))b=n.negate(b);else{var d=n.map(h.apply([],g.call(arguments,1)),String);b=function(a,b){return!n.contains(d,b)}}return n.pick(a,b,c)},n.defaults=function(a){if(!n.isObject(a))return a;for(var b=1,c=arguments.length;c>b;b++){var d=arguments[b];for(var e in d)void 0===a[e]&&(a[e]=d[e])}return a},n.clone=function(a){return n.isObject(a)?n.isArray(a)?a.slice():n.extend({},a):a},n.tap=function(a,b){return b(a),a};var t=function(a,b,c,d){if(a===b)return 0!==a||1/a===1/b;if(null==a||null==b)return a===b;a instanceof n&&(a=a._wrapped),b instanceof n&&(b=b._wrapped);var e=i.call(a);if(e!==i.call(b))return!1;switch(e){case"[object RegExp]":case"[object String]":return""+a==""+b;case"[object Number]":return+a!==+a?+b!==+b:0===+a?1/+a===1/b:+a===+b;case"[object Date]":case"[object Boolean]":return+a===+b}if("object"!=typeof a||"object"!=typeof b)return!1;for(var f=c.length;f--;)if(c[f]===a)return d[f]===b;var g=a.constructor,h=b.constructor;if(g!==h&&"constructor"in a&&"constructor"in b&&!(n.isFunction(g)&&g instanceof g&&n.isFunction(h)&&h instanceof h))return!1;c.push(a),d.push(b);var j,k;if("[object Array]"===e){if(j=a.length,k=j===b.length)for(;j--&&(k=t(a[j],b[j],c,d)););}else{var l,m=n.keys(a);if(j=m.length,k=n.keys(b).length===j)for(;j--&&(l=m[j],k=n.has(b,l)&&t(a[l],b[l],c,d)););}return c.pop(),d.pop(),k};n.isEqual=function(a,b){return t(a,b,[],[])},n.isEmpty=function(a){if(null==a)return!0;if(n.isArray(a)||n.isString(a)||n.isArguments(a))return 0===a.length;for(var b in a)if(n.has(a,b))return!1;return!0},n.isElement=function(a){return!(!a||1!==a.nodeType)},n.isArray=k||function(a){return"[object Array]"===i.call(a)},n.isObject=function(a){var b=typeof a;return"function"===b||"object"===b&&!!a},n.each(["Arguments","Function","String","Number","Date","RegExp"],function(a){n["is"+a]=function(b){return i.call(b)==="[object "+a+"]"}}),n.isArguments(arguments)||(n.isArguments=function(a){return n.has(a,"callee")}),"function"!=typeof/./&&(n.isFunction=function(a){return"function"==typeof a||!1}),n.isFinite=function(a){return isFinite(a)&&!isNaN(parseFloat(a))},n.isNaN=function(a){return n.isNumber(a)&&a!==+a},n.isBoolean=function(a){return a===!0||a===!1||"[object Boolean]"===i.call(a)},n.isNull=function(a){return null===a},n.isUndefined=function(a){return void 0===a},n.has=function(a,b){return null!=a&&j.call(a,b)},n.noConflict=function(){return a._=b,this},n.identity=function(a){return a},n.constant=function(a){return function(){return a}},n.noop=function(){},n.property=function(a){return function(b){return b[a]}},n.matches=function(a){var b=n.pairs(a),c=b.length;return function(a){if(null==a)return!c;a=new Object(a);for(var d=0;c>d;d++){var e=b[d],f=e[0];if(e[1]!==a[f]||!(f in a))return!1}return!0}},n.times=function(a,b,c){var d=Array(Math.max(0,a));b=o(b,c,1);for(var e=0;a>e;e++)d[e]=b(e);return d},n.random=function(a,b){return null==b&&(b=a,a=0),a+Math.floor(Math.random()*(b-a+1))},n.now=Date.now||function(){return(new Date).getTime()};var u={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},v=n.invert(u),w=function(a){var b=function(b){return a[b]},c="(?:"+n.keys(a).join("|")+")",d=RegExp(c),e=RegExp(c,"g");return function(a){return a=null==a?"":""+a,d.test(a)?a.replace(e,b):a}};n.escape=w(u),n.unescape=w(v),n.result=function(a,b){if(null==a)return void 0;var c=a[b];return n.isFunction(c)?a[b]():c};var x=0;n.uniqueId=function(a){var b=++x+"";return a?a+b:b},n.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var y=/(.)^/,z={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},A=/\\|'|\r|\n|\u2028|\u2029/g,B=function(a){return"\\"+z[a]};n.template=function(a,b,c){!b&&c&&(b=c),b=n.defaults({},b,n.templateSettings);var d=RegExp([(b.escape||y).source,(b.interpolate||y).source,(b.evaluate||y).source].join("|")+"|$","g"),e=0,f="__p+='";a.replace(d,function(b,c,d,g,h){return f+=a.slice(e,h).replace(A,B),e=h+b.length,c?f+="'+\n((__t=("+c+"))==null?'':_.escape(__t))+\n'":d?f+="'+\n((__t=("+d+"))==null?'':__t)+\n'":g&&(f+="';\n"+g+"\n__p+='"),b}),f+="';\n",b.variable||(f="with(obj||{}){\n"+f+"}\n"),f="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+f+"return __p;\n";try{var g=new Function(b.variable||"obj","_",f)}catch(h){throw h.source=f,h}var i=function(a){return g.call(this,a,n)},j=b.variable||"obj";return i.source="function("+j+"){\n"+f+"}",i},n.chain=function(a){var b=n(a);return b._chain=!0,b};var C=function(a){return this._chain?n(a).chain():a};n.mixin=function(a){n.each(n.functions(a),function(b){var c=n[b]=a[b];n.prototype[b]=function(){var a=[this._wrapped];return f.apply(a,arguments),C.call(this,c.apply(n,a))}})},n.mixin(n),n.each(["pop","push","reverse","shift","sort","splice","unshift"],function(a){var b=c[a];n.prototype[a]=function(){var c=this._wrapped;return b.apply(c,arguments),"shift"!==a&&"splice"!==a||0!==c.length||delete c[0],C.call(this,c)}}),n.each(["concat","join","slice"],function(a){var b=c[a];n.prototype[a]=function(){return C.call(this,b.apply(this._wrapped,arguments))}}),n.prototype.value=function(){return this._wrapped},"function"==typeof define&&define.amd&&define("underscore",[],function(){return n})}.call(this),function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){function c(a){var b=a.length,c=eb.type(a);return"function"===c||eb.isWindow(a)?!1:1===a.nodeType&&b?!0:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}function d(a,b,c){if(eb.isFunction(b))return eb.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return eb.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(mb.test(b))return eb.filter(b,a,c);b=eb.filter(b,a)}return eb.grep(a,function(a){return eb.inArray(a,b)>=0!==c})}function e(a,b){do a=a[b];while(a&&1!==a.nodeType);return a}function f(a){var b=ub[a]={};return eb.each(a.match(tb)||[],function(a,c){b[c]=!0}),b}function g(){ob.addEventListener?(ob.removeEventListener("DOMContentLoaded",h,!1),a.removeEventListener("load",h,!1)):(ob.detachEvent("onreadystatechange",h),a.detachEvent("onload",h))}function h(){(ob.addEventListener||"load"===event.type||"complete"===ob.readyState)&&(g(),eb.ready())}function i(a,b,c){if(void 0===c&&1===a.nodeType){var d="data-"+b.replace(zb,"-$1").toLowerCase();if(c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:yb.test(c)?eb.parseJSON(c):c}catch(e){}eb.data(a,b,c)}else c=void 0}return c}function j(a){var b;for(b in a)if(("data"!==b||!eb.isEmptyObject(a[b]))&&"toJSON"!==b)return!1;return!0}function k(a,b,c,d){if(eb.acceptData(a)){var e,f,g=eb.expando,h=a.nodeType,i=h?eb.cache:a,j=h?a[g]:a[g]&&g;if(j&&i[j]&&(d||i[j].data)||void 0!==c||"string"!=typeof b)return j||(j=h?a[g]=W.pop()||eb.guid++:g),i[j]||(i[j]=h?{}:{toJSON:eb.noop}),("object"==typeof b||"function"==typeof b)&&(d?i[j]=eb.extend(i[j],b):i[j].data=eb.extend(i[j].data,b)),f=i[j],d||(f.data||(f.data={}),f=f.data),void 0!==c&&(f[eb.camelCase(b)]=c),"string"==typeof b?(e=f[b],null==e&&(e=f[eb.camelCase(b)])):e=f,e}}function l(a,b,c){if(eb.acceptData(a)){var d,e,f=a.nodeType,g=f?eb.cache:a,h=f?a[eb.expando]:eb.expando;if(g[h]){if(b&&(d=c?g[h]:g[h].data)){eb.isArray(b)?b=b.concat(eb.map(b,eb.camelCase)):b in d?b=[b]:(b=eb.camelCase(b),b=b in d?[b]:b.split(" ")),e=b.length;for(;e--;)delete d[b[e]];if(c?!j(d):!eb.isEmptyObject(d))return}(c||(delete g[h].data,j(g[h])))&&(f?eb.cleanData([a],!0):cb.deleteExpando||g!=g.window?delete g[h]:g[h]=null)}}}function m(){return!0}function n(){return!1}function o(){try{return ob.activeElement}catch(a){}}function p(a){var b=Kb.split("|"),c=a.createDocumentFragment();if(c.createElement)for(;b.length;)c.createElement(b.pop());return c}function q(a,b){var c,d,e=0,f=typeof a.getElementsByTagName!==xb?a.getElementsByTagName(b||"*"):typeof a.querySelectorAll!==xb?a.querySelectorAll(b||"*"):void 0;if(!f)for(f=[],c=a.childNodes||a;null!=(d=c[e]);e++)!b||eb.nodeName(d,b)?f.push(d):eb.merge(f,q(d,b));return void 0===b||b&&eb.nodeName(a,b)?eb.merge([a],f):f}function r(a){Eb.test(a.type)&&(a.defaultChecked=a.checked)}function s(a,b){return eb.nodeName(a,"table")&&eb.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function t(a){return a.type=(null!==eb.find.attr(a,"type"))+"/"+a.type,a}function u(a){var b=Vb.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function v(a,b){for(var c,d=0;null!=(c=a[d]);d++)eb._data(c,"globalEval",!b||eb._data(b[d],"globalEval"))}function w(a,b){if(1===b.nodeType&&eb.hasData(a)){var c,d,e,f=eb._data(a),g=eb._data(b,f),h=f.events;if(h){delete g.handle,g.events={};for(c in h)for(d=0,e=h[c].length;e>d;d++)eb.event.add(b,c,h[c][d])}g.data&&(g.data=eb.extend({},g.data))}}function x(a,b){var c,d,e;if(1===b.nodeType){if(c=b.nodeName.toLowerCase(),!cb.noCloneEvent&&b[eb.expando]){e=eb._data(b);for(d in e.events)eb.removeEvent(b,d,e.handle);b.removeAttribute(eb.expando)}"script"===c&&b.text!==a.text?(t(b).text=a.text,u(b)):"object"===c?(b.parentNode&&(b.outerHTML=a.outerHTML),cb.html5Clone&&a.innerHTML&&!eb.trim(b.innerHTML)&&(b.innerHTML=a.innerHTML)):"input"===c&&Eb.test(a.type)?(b.defaultChecked=b.checked=a.checked,b.value!==a.value&&(b.value=a.value)):"option"===c?b.defaultSelected=b.selected=a.defaultSelected:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}}function y(b,c){var d,e=eb(c.createElement(b)).appendTo(c.body),f=a.getDefaultComputedStyle&&(d=a.getDefaultComputedStyle(e[0]))?d.display:eb.css(e[0],"display");return e.detach(),f}function z(a){var b=ob,c=_b[a];return c||(c=y(a,b),"none"!==c&&c||($b=($b||eb("'}function i(c){function e(b){var h=b.originalEvent.origin;if(d.urls.apiSecure.slice(0,h.length)===h){var j=JSON.parse(b.originalEvent.data);if(j.requestId===g){var k;0===j.code?(l.resolve(j),k=c.success):(l.reject(j),k=c.error),k=k||function(){},delete j.requestId,k(j),document.body.removeChild(f),document.body.removeChild(i),a(window).off("message",e)}}}c=b.defaults(c,o),c.secure&&(c.url=j(c.url));var f,g=b.uniqueId("ft_"),h=document.createElement("div"),i=document.createElement("form"),k="frame_"+g,l=new a.Deferred;return h.innerHTML=q.getIframe(k),f=h.childNodes[0],i.target=k,i.action=c.url.replace(".json",".pm"),i.method=c.method||"GET",c.data=b.extend(c.data,{callback:g,referrer:document.referrer}),b.each(c.data,function(a,c){a===!0?a=[1]:a===!1?a=[0]:null===a?a=[""]:b.isArray(a)||(a=[a]),b.each(a,function(a){var b=document.createElement("input");b.type="hidden",b.name=c,b.value=a,i.appendChild(b)})}),a(window).on("message",e),document.body.appendChild(f),document.body.appendChild(i),i.submit(),l.promise() }function j(a){return a.replace(/^(http\:)?\/\//,"https://")}function k(c){c=b.defaults(c,o),c.secure&&(c.url=j(c.url)),c.traditional=!0;var e=window.location;n.href=c.url,(e.host!==n.host||e.protocol!==n.protocol)&&(c.xhrFields={withCredentials:!0}),c.omitDisqusApiKey||(c.data=c.data||{},c.data.api_key=d.keys.api);var f=c.error;return c.error=function(a){q.trigger("error",a),b.isFunction(f)&&f(a)},a.ajax(c)}function l(a,c){c=c||{},c.url=m(a,{secure:c.secure}),c.data=b.extend(c.data||{},{api_key:d.keys.api}),q.trigger("call",c);var e=(f(c)?i:k)(c);return e&&e.always(b.bind(this.trigger,this,"complete")),e}function m(a,b){return b=b||{},/(https?\:)?\/\//.test(a)?a:(void 0!==b.secure?b.secure:o.secure)||"https:"===window.location.protocol?d.urls.apiSecure+a:d.urls.api+a}var n=document.createElement("a"),o={},p="withCredentials"in new XMLHttpRequest,q={ajax:k,call:l,getURL:m,defaults:function(a){var c,d,e;for(c in a)d=a[c],e=o[c],b.isObject(d)&&b.isObject(e)?b.extend(e,d):o[c]=d},headers:function(a){var c=b.extend({},o.headers,a);return o.headers=b.pick(c,b.map(c,function(a,b){return a?b:void 0})),o.headers},useFormTransport:f,xhrSupportsCredentialedRequests:p,makeHttps:j,formTransport:i,getIframe:h};return b.extend(q,c.Events),q}),define("core/bus",["backbone","underscore"],function(a,b){"use strict";return b.extend({},a.Events)}),define("core/models/BaseUser",["backbone","core/config"],function(a,b){"use strict";var c=a.Model.extend({defaults:{about:null,avatar:{cache:b.urls.avatar.generic,permalink:b.urls.avatar.generic},connections:{},email:null,isAnonymous:!0,isFollowedBy:null,isFollowing:null,joinedAt:null,name:null,profileUrl:null,url:null,username:null,numPosts:null,numFollowing:null,numFollowers:null,numLikesReceived:null},hasValidAvatar:function(a){a||(a=this.attributes);var b=a.avatar;return b&&b.cache},isAnonymous:function(){return!this.get("id")},isRegistered:function(){return!this.isAnonymous()},validate:function(a){return this.hasValidAvatar(a)?void 0:"None of the avatar related properties can be null, undefined or empty on User models."},toJSON:function(){var b=a.Model.prototype.toJSON.apply(this,arguments);return b.thread={},this.hasValidAvatar()||(b.avatar=this.defaults.avatar),b.isRegistered=this.isRegistered(),b}});return c}),define("core/strings",[],function(){"use strict";function a(a){var b=c.translations[a];return void 0!==b?b:a}function b(a,b){function c(c){var d="";return c in b?d=void 0!==b[c]&&null!==b[c]?b[c].toString():"":DISQUS&&DISQUS.logError&&DISQUS.logError("Key `"+c+"` not found in context for: ",a),d}return a.replace(/%\(\w+\)s/g,function(a){return c(a.slice(2,-2))})}var c={get:a,interpolate:b,translations:{}};return c}),define("core/models/User",["underscore","backbone","core/config","core/utils","core/strings","core/api","core/models/BaseUser"],function(a,b,c,d,e,f,g){"use strict";function h(a,b,c){a[b]=a[b]||[],a[b].push(c)}var i=e.get,j=g.extend({validate:function(b){var c={};return b.display_name||h(c,"display_name",i("Please enter your name.")),b.email||h(c,"email",i("Please enter your email address.")),d.validateEmail(b.email)||h(c,"email",i("Invalid email address.")),this.isNew()&&(b.password?b.password.lengthj.MAX_NAME_LEN&&h(c,"name",e.interpolate(i("Name must have less than %(maxLength)s characters."),{maxLength:j.MAX_NAME_LEN}))),b.location&&b.location.length>j.MAX_LOCATION_LEN&&h(c,"location",e.interpolate(i("Location must have less than %(maxLength)s characters."),{maxLength:j.MAX_LOCATION_LEN})),b.url&&(b.url.length>j.MAX_URL_LEN&&h(c,"url",e.interpolate(i("Site must have less than %(maxLength)s characters."),{maxLength:j.MAX_URL_LEN})),d.isUrl(b.url)||h(c,"url",i("Please enter a valid site."))),a.isEmpty(c)?void 0:c},fetch:function(a){var b=this;a=a||{};var c={};return b.id?c.user=b.id:b.get("username")&&(c.user="username:"+b.get("username")),f.call("users/details.json",{data:c,success:function(c){c=c.response,b.set(c),a.success&&a.success(c),a.complete&&a.complete(c),b.trigger("sync",b,c,a)},error:function(b){a.error&&a.error(b),a.complete&&a.complete(b)}})},register:function(a){var b=this;a=a||{},f.call("internal/users/register.json",{secure:!0,data:this.toRegisterJSON(),method:"POST",success:function(c){b.set(c.response),a.success&&a.success(c)},error:a.error})},saveAvatar:function(a){var b=new FormData;return b.append("avatar_file",a),b.append("api_key",c.keys.api),f.call("internal/users/updateAvatar.json",{method:"post",data:b,cache:!1,contentType:!1,processData:!1})},saveProfile:function(){return f.call("users/updateProfile.json",{method:"POST",data:{name:this.get("name"),about:this.get("about"),location:this.get("location"),url:this.get("url")}})},toRegisterJSON:function(){return a.pick(this.toJSON(),"display_name","email","password")},isSession:function(a){return a.user.id&&a.user.id===this.id},isEditable:function(a){return this.isSession(a)&&!this.get("remote")},toJSON:function(a){a=a||{};var b=g.prototype.toJSON.call(this),c=this.collection&&this.collection.thread;return b.thread.canModerate=!!c&&c.isModerator(this),a.session&&(b.isSession=this.isSession(a.session),b.isEditable=this.isEditable(a.session)),b},_changeFollowState:function(a){this.set("isFollowing",a);var b="users/"+(a?"follow":"unfollow"),c=this;f.call(b+".json",{data:{target:this.id},method:"POST",success:function(a){c.trigger("sync",c,a,{})}})},follow:function(){this._changeFollowState(!0)},unfollow:function(){this._changeFollowState(!1)},toggleFollowState:function(){this._changeFollowState(!this.get("isFollowing"))}},{MIN_PASSWORD_LEN:6,MIN_NAME_LEN:2,MAX_NAME_LEN:30,MAX_LOCATION_LEN:255,MAX_URL_LEN:200});return j}),define("core/models/Session",["underscore","backbone","core/api","core/models/BaseUser","core/models/User"],function(a,b,c,d,e){"use strict";var f=b.Model.extend({initialize:function(){this.user=new this.getAnonUserInstance},setUser:function(a){this.user&&this.stopListening(this.user),this.user=a,this.listenTo(a,"all",this.trigger),this.trigger("change:id",a)},isLoggedOut:function(){return!this.isLoggedIn()},isLoggedIn:function(){return!!this.user.get("id")},fetch:function(b){b=b||{};var d={};return d["_"+(new Date).getTime()]=1,c.call("users/details.json",{data:d,success:a.bind(function(a){a=a.response,a.id&&this.setUser(this.getUserInstance(a)),b.success&&b.success(a),b.complete&&b.complete(a)},this),error:a.bind(function(a){b.error&&b.error(a),b.complete&&b.complete(a)},this)})},getAnonUserInstance:function(a){return new d(a)},getUserInstance:function(a){return new e(a)}});return f}),define("core/frameBus",["jquery","underscore","backbone"],function(a,b,c){"use strict";function d(a){return a.hash.slice(1).replace(/(^\d+).*/,"$1")}function e(a){var b=a.split("/");return b[0]+"//"+b[2]}var f=d(window.location),g=window.opener||window.parent,h=document.referrer,i={};i.client=e(document.location.href),i.host=h?e(h):i.client;var j={getUID:d,origins:i,messageHandler:function(a){a=a.originalEvent;var b;try{b=JSON.parse(a.data)}catch(c){return}if(!b.name||"!"!==b.name[0]||a.origin===i.client)switch(b.scope){case"host":break;case"client":j.trigger(b.name,b.data)}},postMessage:function(a){a.sender=f,a=JSON.stringify(a),g.postMessage(a,"*")},sendHostMessage:function(a,b){b=b||[],j.postMessage({scope:"host",name:a,data:b})}};return b.extend(j,c.Events),a(window).on("message",j.messageHandler),a(window).on("unload",function(){j.sendHostMessage("die")}),j}),define("common/bus",["core/frameBus"],function(a){"use strict";return window.DISQUS=window.DISQUS||{},window.DISQUS.Bus=a,a}),define("common/cached-storage",["underscore","common/utils","modernizr"],function(a,b,c){"use strict";var d=function(a,d){this.namespace=a,this.ttl=d||300,this.store=c.localstorage?window.localStorage:b.hashStorage,this.cache=this.getFromStorage()};return a.extend(d.prototype,{getItem:function(a){var b=this.cache[a];if(b){if(!this.isExpired(b))return b.value;delete this.cache[a]}},getCurrentTime:function(){return Math.floor((new Date).getTime()/1e3)},persist:function(){try{this.store.setItem(this.namespace,JSON.stringify(this.cache))}catch(a){}},getFromStorage:function(){try{return JSON.parse(this.store.getItem(this.namespace))||{}}catch(a){return{}}},isExpired:function(a){return this.getCurrentTime()>a.expiry},setItem:function(a,b){this.cache[a]={value:b,expiry:this.getCurrentTime()+this.ttl},this.persist()},removeItem:function(a){delete this.cache[a],this.persist()},getAll:function(){var b=a.compact(a.map(this.cache,function(a,b){return this.getItem(b)},this));return this.persist(),b}}),d}),define("common/collections/LoggedOutNotifications",["underscore","backbone","common/cached-storage","common/CookieBitFlag"],function(a,b,c,d){"use strict";var e=[{id:"welcome",title:"",body:""}],f=new c("notes",7776e3),g=new d("notes",["welcome"]),h=b.Model.extend({markRead:function(){f.setItem(this.id,!0)},isRead:function(){return!(!f.getItem(this.id)&&!g.getFlag(this.id))}}),i=b.Collection.extend({initialize:function(a,b){this.session=b.session},model:h,markAllRead:function(){return this.each(function(a){a.markRead()}),this.session.set("notificationCount",0),this},getUnread:function(){return this.filter(function(a){return!a.isRead()})}});return{storage:f,Collection:i,Model:h,LOGGED_OUT_NOTES:e}}),function(a){function b(a,b,c){switch(arguments.length){case 2:return null!=a?a:b;case 3:return null!=a?a:null!=b?b:c;default:throw new Error("Implement me")}}function c(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1}}function d(a){rb.suppressDeprecationWarnings===!1&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+a)}function e(a,b){var c=!0;return l(function(){return c&&(d(a),c=!1),b.apply(this,arguments)},b)}function f(a,b){nc[a]||(d(b),nc[a]=!0)}function g(a,b){return function(c){return o(a.call(this,c),b)}}function h(a,b){return function(c){return this.localeData().ordinal(a.call(this,c),b)}}function i(){}function j(a,b){b!==!1&&E(a),m(this,a),this._d=new Date(+a._d)}function k(a){var b=x(a),c=b.year||0,d=b.quarter||0,e=b.month||0,f=b.week||0,g=b.day||0,h=b.hour||0,i=b.minute||0,j=b.second||0,k=b.millisecond||0;this._milliseconds=+k+1e3*j+6e4*i+36e5*h,this._days=+g+7*f,this._months=+e+3*d+12*c,this._data={},this._locale=rb.localeData(),this._bubble()}function l(a,b){for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c]);return b.hasOwnProperty("toString")&&(a.toString=b.toString),b.hasOwnProperty("valueOf")&&(a.valueOf=b.valueOf),a}function m(a,b){var c,d,e;if("undefined"!=typeof b._isAMomentObject&&(a._isAMomentObject=b._isAMomentObject),"undefined"!=typeof b._i&&(a._i=b._i),"undefined"!=typeof b._f&&(a._f=b._f),"undefined"!=typeof b._l&&(a._l=b._l),"undefined"!=typeof b._strict&&(a._strict=b._strict),"undefined"!=typeof b._tzm&&(a._tzm=b._tzm),"undefined"!=typeof b._isUTC&&(a._isUTC=b._isUTC),"undefined"!=typeof b._offset&&(a._offset=b._offset),"undefined"!=typeof b._pf&&(a._pf=b._pf),"undefined"!=typeof b._locale&&(a._locale=b._locale),Fb.length>0)for(c in Fb)d=Fb[c],e=b[d],"undefined"!=typeof e&&(a[d]=e);return a}function n(a){return 0>a?Math.ceil(a):Math.floor(a)}function o(a,b,c){for(var d=""+Math.abs(a),e=a>=0;d.lengthd;d++)(c&&a[d]!==b[d]||!c&&z(a[d])!==z(b[d]))&&g++;return g+f}function w(a){if(a){var b=a.toLowerCase().replace(/(.)s$/,"$1");a=gc[a]||hc[b]||b}return a}function x(a){var b,c,d={};for(c in a)a.hasOwnProperty(c)&&(b=w(c),b&&(d[b]=a[c]));return d}function y(b){var c,d;if(0===b.indexOf("week"))c=7,d="day";else{if(0!==b.indexOf("month"))return;c=12,d="month"}rb[b]=function(e,f){var g,h,i=rb._locale[b],j=[];if("number"==typeof e&&(f=e,e=a),h=function(a){var b=rb().utc().set(d,a);return i.call(rb._locale,b,e||"")},null!=f)return h(f);for(g=0;c>g;g++)j.push(h(g));return j}}function z(a){var b=+a,c=0;return 0!==b&&isFinite(b)&&(c=b>=0?Math.floor(b):Math.ceil(b)),c}function A(a,b){return new Date(Date.UTC(a,b+1,0)).getUTCDate()}function B(a,b,c){return fb(rb([a,11,31+b-c]),b,c).week}function C(a){return D(a)?366:365}function D(a){return a%4===0&&a%100!==0||a%400===0}function E(a){var b;a._a&&-2===a._pf.overflow&&(b=a._a[yb]<0||a._a[yb]>11?yb:a._a[zb]<1||a._a[zb]>A(a._a[xb],a._a[yb])?zb:a._a[Ab]<0||a._a[Ab]>23?Ab:a._a[Bb]<0||a._a[Bb]>59?Bb:a._a[Cb]<0||a._a[Cb]>59?Cb:a._a[Db]<0||a._a[Db]>999?Db:-1,a._pf._overflowDayOfYear&&(xb>b||b>zb)&&(b=zb),a._pf.overflow=b)}function F(a){return null==a._isValid&&(a._isValid=!isNaN(a._d.getTime())&&a._pf.overflow<0&&!a._pf.empty&&!a._pf.invalidMonth&&!a._pf.nullInput&&!a._pf.invalidFormat&&!a._pf.userInvalidated,a._strict&&(a._isValid=a._isValid&&0===a._pf.charsLeftOver&&0===a._pf.unusedTokens.length)),a._isValid}function G(a){return a?a.toLowerCase().replace("_","-"):a}function H(a){for(var b,c,d,e,f=0;f0;){if(d=I(e.slice(0,b).join("-")))return d;if(c&&c.length>=b&&v(e,c,!0)>=b-1)break;b--}f++}return null}function I(a){var b=null;if(!Eb[a]&&Gb)try{b=rb.locale(),require("./locale/"+a),rb.locale(b)}catch(c){}return Eb[a]}function J(a,b){return b._isUTC?rb(a).zone(b._offset||0):rb(a).local()}function K(a){return a.match(/\[[\s\S]/)?a.replace(/^\[|\]$/g,""):a.replace(/\\/g,"")}function L(a){var b,c,d=a.match(Kb);for(b=0,c=d.length;c>b;b++)d[b]=mc[d[b]]?mc[d[b]]:K(d[b]);return function(e){var f="";for(b=0;c>b;b++)f+=d[b]instanceof Function?d[b].call(e,a):d[b];return f}}function M(a,b){return a.isValid()?(b=N(b,a.localeData()),ic[b]||(ic[b]=L(b)),ic[b](a)):a.localeData().invalidDate()}function N(a,b){function c(a){return b.longDateFormat(a)||a}var d=5;for(Lb.lastIndex=0;d>=0&&Lb.test(a);)a=a.replace(Lb,c),Lb.lastIndex=0,d-=1;return a}function O(a,b){var c,d=b._strict;switch(a){case"Q":return Wb;case"DDDD":return Yb;case"YYYY":case"GGGG":case"gggg":return d?Zb:Ob;case"Y":case"G":case"g":return _b;case"YYYYYY":case"YYYYY":case"GGGGG":case"ggggg":return d?$b:Pb;case"S":if(d)return Wb;case"SS":if(d)return Xb;case"SSS":if(d)return Yb;case"DDD":return Nb;case"MMM":case"MMMM":case"dd":case"ddd":case"dddd":return Rb;case"a":case"A":return b._locale._meridiemParse;case"X":return Ub;case"Z":case"ZZ":return Sb;case"T":return Tb;case"SSSS":return Qb;case"MM":case"DD":case"YY":case"GG":case"gg":case"HH":case"hh":case"mm":case"ss":case"ww":case"WW":return d?Xb:Mb;case"M":case"D":case"d":case"H":case"h":case"m":case"s":case"w":case"W":case"e":case"E":return Mb;case"Do":return Vb;default:return c=new RegExp(X(W(a.replace("\\","")),"i"))}}function P(a){a=a||"";var b=a.match(Sb)||[],c=b[b.length-1]||[],d=(c+"").match(ec)||["-",0,0],e=+(60*d[1])+z(d[2]);return"+"===d[0]?-e:e}function Q(a,b,c){var d,e=c._a;switch(a){case"Q":null!=b&&(e[yb]=3*(z(b)-1));break;case"M":case"MM":null!=b&&(e[yb]=z(b)-1);break;case"MMM":case"MMMM":d=c._locale.monthsParse(b),null!=d?e[yb]=d:c._pf.invalidMonth=b;break;case"D":case"DD":null!=b&&(e[zb]=z(b));break;case"Do":null!=b&&(e[zb]=z(parseInt(b,10)));break;case"DDD":case"DDDD":null!=b&&(c._dayOfYear=z(b));break;case"YY":e[xb]=rb.parseTwoDigitYear(b);break;case"YYYY":case"YYYYY":case"YYYYYY":e[xb]=z(b);break;case"a":case"A":c._isPm=c._locale.isPM(b);break;case"H":case"HH":case"h":case"hh":e[Ab]=z(b);break;case"m":case"mm":e[Bb]=z(b);break;case"s":case"ss":e[Cb]=z(b);break;case"S":case"SS":case"SSS":case"SSSS":e[Db]=z(1e3*("0."+b));break;case"X":c._d=new Date(1e3*parseFloat(b));break;case"Z":case"ZZ":c._useUTC=!0,c._tzm=P(b);break;case"dd":case"ddd":case"dddd":d=c._locale.weekdaysParse(b),null!=d?(c._w=c._w||{},c._w.d=d):c._pf.invalidWeekday=b;break;case"w":case"ww":case"W":case"WW":case"d":case"e":case"E":a=a.substr(0,1);case"gggg":case"GGGG":case"GGGGG":a=a.substr(0,2),b&&(c._w=c._w||{},c._w[a]=z(b));break;case"gg":case"GG":c._w=c._w||{},c._w[a]=rb.parseTwoDigitYear(b)}}function R(a){var c,d,e,f,g,h,i;c=a._w,null!=c.GG||null!=c.W||null!=c.E?(g=1,h=4,d=b(c.GG,a._a[xb],fb(rb(),1,4).year),e=b(c.W,1),f=b(c.E,1)):(g=a._locale._week.dow,h=a._locale._week.doy,d=b(c.gg,a._a[xb],fb(rb(),g,h).year),e=b(c.w,1),null!=c.d?(f=c.d,g>f&&++e):f=null!=c.e?c.e+g:g),i=gb(d,e,f,h,g),a._a[xb]=i.year,a._dayOfYear=i.dayOfYear}function S(a){var c,d,e,f,g=[];if(!a._d){for(e=U(a),a._w&&null==a._a[zb]&&null==a._a[yb]&&R(a),a._dayOfYear&&(f=b(a._a[xb],e[xb]),a._dayOfYear>C(f)&&(a._pf._overflowDayOfYear=!0),d=bb(f,0,a._dayOfYear),a._a[yb]=d.getUTCMonth(),a._a[zb]=d.getUTCDate()),c=0;3>c&&null==a._a[c];++c)a._a[c]=g[c]=e[c];for(;7>c;c++)a._a[c]=g[c]=null==a._a[c]?2===c?1:0:a._a[c];a._d=(a._useUTC?bb:ab).apply(null,g),null!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()+a._tzm)}}function T(a){var b;a._d||(b=x(a._i),a._a=[b.year,b.month,b.day,b.hour,b.minute,b.second,b.millisecond],S(a))}function U(a){var b=new Date;return a._useUTC?[b.getUTCFullYear(),b.getUTCMonth(),b.getUTCDate()]:[b.getFullYear(),b.getMonth(),b.getDate()]}function V(a){if(a._f===rb.ISO_8601)return void Z(a);a._a=[],a._pf.empty=!0;var b,c,d,e,f,g=""+a._i,h=g.length,i=0;for(d=N(a._f,a._locale).match(Kb)||[],b=0;b0&&a._pf.unusedInput.push(f),g=g.slice(g.indexOf(c)+c.length),i+=c.length),mc[e]?(c?a._pf.empty=!1:a._pf.unusedTokens.push(e),Q(e,c,a)):a._strict&&!c&&a._pf.unusedTokens.push(e);a._pf.charsLeftOver=h-i,g.length>0&&a._pf.unusedInput.push(g),a._isPm&&a._a[Ab]<12&&(a._a[Ab]+=12),a._isPm===!1&&12===a._a[Ab]&&(a._a[Ab]=0),S(a),E(a)}function W(a){return a.replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(a,b,c,d,e){return b||c||d||e})}function X(a){return a.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function Y(a){var b,d,e,f,g;if(0===a._f.length)return a._pf.invalidFormat=!0,void(a._d=new Date(0/0));for(f=0;fg)&&(e=g,d=b));l(a,d||b)}function Z(a){var b,c,d=a._i,e=ac.exec(d);if(e){for(a._pf.iso=!0,b=0,c=cc.length;c>b;b++)if(cc[b][1].exec(d)){a._f=cc[b][0]+(e[6]||" ");break}for(b=0,c=dc.length;c>b;b++)if(dc[b][1].exec(d)){a._f+=dc[b][0];break}d.match(Sb)&&(a._f+="Z"),V(a)}else a._isValid=!1}function $(a){Z(a),a._isValid===!1&&(delete a._isValid,rb.createFromInputFallback(a))}function _(b){var c,d=b._i;d===a?b._d=new Date:u(d)?b._d=new Date(+d):null!==(c=Hb.exec(d))?b._d=new Date(+c[1]):"string"==typeof d?$(b):t(d)?(b._a=d.slice(0),S(b)):"object"==typeof d?T(b):"number"==typeof d?b._d=new Date(d):rb.createFromInputFallback(b)}function ab(a,b,c,d,e,f,g){var h=new Date(a,b,c,d,e,f,g);return 1970>a&&h.setFullYear(a),h}function bb(a){var b=new Date(Date.UTC.apply(null,arguments));return 1970>a&&b.setUTCFullYear(a),b}function cb(a,b){if("string"==typeof a)if(isNaN(a)){if(a=b.weekdaysParse(a),"number"!=typeof a)return null}else a=parseInt(a,10);return a}function db(a,b,c,d,e){return e.relativeTime(b||1,!!c,a,d)}function eb(a,b,c){var d=rb.duration(a).abs(),e=wb(d.as("s")),f=wb(d.as("m")),g=wb(d.as("h")),h=wb(d.as("d")),i=wb(d.as("M")),j=wb(d.as("y")),k=e0,k[4]=c,db.apply({},k)}function fb(a,b,c){var d,e=c-b,f=c-a.day();return f>e&&(f-=7),e-7>f&&(f+=7),d=rb(a).add(f,"d"),{week:Math.ceil(d.dayOfYear()/7),year:d.year()}}function gb(a,b,c,d,e){var f,g,h=bb(a,0,1).getUTCDay();return h=0===h?7:h,c=null!=c?c:e,f=e-h+(h>d?7:0)-(e>h?7:0),g=7*(b-1)+(c-e)+f+1,{year:g>0?a:a-1,dayOfYear:g>0?g:C(a-1)+g}}function hb(b){var c=b._i,d=b._f;return b._locale=b._locale||rb.localeData(b._l),null===c||d===a&&""===c?rb.invalid({nullInput:!0}):("string"==typeof c&&(b._i=c=b._locale.preparse(c)),rb.isMoment(c)?new j(c,!0):(d?t(d)?Y(b):V(b):_(b),new j(b)))}function ib(a,b){var c,d;if(1===b.length&&t(b[0])&&(b=b[0]),!b.length)return rb();for(c=b[0],d=1;d=0?"+":"-";return b+o(Math.abs(a),6)},gg:function(){return o(this.weekYear()%100,2)},gggg:function(){return o(this.weekYear(),4)},ggggg:function(){return o(this.weekYear(),5)},GG:function(){return o(this.isoWeekYear()%100,2)},GGGG:function(){return o(this.isoWeekYear(),4)},GGGGG:function(){return o(this.isoWeekYear(),5)},e:function(){return this.weekday()},E:function(){return this.isoWeekday()},a:function(){return this.localeData().meridiem(this.hours(),this.minutes(),!0)},A:function(){return this.localeData().meridiem(this.hours(),this.minutes(),!1)},H:function(){return this.hours()},h:function(){return this.hours()%12||12},m:function(){return this.minutes()},s:function(){return this.seconds()},S:function(){return z(this.milliseconds()/100)},SS:function(){return o(z(this.milliseconds()/10),2)},SSS:function(){return o(this.milliseconds(),3)},SSSS:function(){return o(this.milliseconds(),3)},Z:function(){var a=-this.zone(),b="+";return 0>a&&(a=-a,b="-"),b+o(z(a/60),2)+":"+o(z(a)%60,2)},ZZ:function(){var a=-this.zone(),b="+";return 0>a&&(a=-a,b="-"),b+o(z(a/60),2)+o(z(a)%60,2)},z:function(){return this.zoneAbbr()},zz:function(){return this.zoneName()},X:function(){return this.unix()},Q:function(){return this.quarter()}},nc={},oc=["months","monthsShort","weekdays","weekdaysShort","weekdaysMin"];kc.length;)tb=kc.pop(),mc[tb+"o"]=h(mc[tb],tb);for(;lc.length;)tb=lc.pop(),mc[tb+tb]=g(mc[tb],2);mc.DDDD=g(mc.DDD,3),l(i.prototype,{set:function(a){var b,c;for(c in a)b=a[c],"function"==typeof b?this[c]=b:this["_"+c]=b},_months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),months:function(a){return this._months[a.month()]},_monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),monthsShort:function(a){return this._monthsShort[a.month()]},monthsParse:function(a){var b,c,d;for(this._monthsParse||(this._monthsParse=[]),b=0;12>b;b++)if(this._monthsParse[b]||(c=rb.utc([2e3,b]),d="^"+this.months(c,"")+"|^"+this.monthsShort(c,""),this._monthsParse[b]=new RegExp(d.replace(".",""),"i")),this._monthsParse[b].test(a))return b},_weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdays:function(a){return this._weekdays[a.day()]},_weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysShort:function(a){return this._weekdaysShort[a.day()]},_weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),weekdaysMin:function(a){return this._weekdaysMin[a.day()]},weekdaysParse:function(a){var b,c,d;for(this._weekdaysParse||(this._weekdaysParse=[]),b=0;7>b;b++)if(this._weekdaysParse[b]||(c=rb([2e3,1]).day(b),d="^"+this.weekdays(c,"")+"|^"+this.weekdaysShort(c,"")+"|^"+this.weekdaysMin(c,""),this._weekdaysParse[b]=new RegExp(d.replace(".",""),"i")),this._weekdaysParse[b].test(a))return b},_longDateFormat:{LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY LT",LLLL:"dddd, MMMM D, YYYY LT"},longDateFormat:function(a){var b=this._longDateFormat[a];return!b&&this._longDateFormat[a.toUpperCase()]&&(b=this._longDateFormat[a.toUpperCase()].replace(/MMMM|MM|DD|dddd/g,function(a){return a.slice(1)}),this._longDateFormat[a]=b),b},isPM:function(a){return"p"===(a+"").toLowerCase().charAt(0)},_meridiemParse:/[ap]\.?m?\.?/i,meridiem:function(a,b,c){return a>11?c?"pm":"PM":c?"am":"AM"},_calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},calendar:function(a,b){var c=this._calendar[a];return"function"==typeof c?c.apply(b):c},_relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},relativeTime:function(a,b,c,d){var e=this._relativeTime[c];return"function"==typeof e?e(a,b,c,d):e.replace(/%d/i,a)},pastFuture:function(a,b){var c=this._relativeTime[a>0?"future":"past"];return"function"==typeof c?c(b):c.replace(/%s/i,b)},ordinal:function(a){return this._ordinal.replace("%d",a)},_ordinal:"%d",preparse:function(a){return a},postformat:function(a){return a},week:function(a){return fb(a,this._week.dow,this._week.doy).week},_week:{dow:0,doy:6},_invalidDate:"Invalid date",invalidDate:function(){return this._invalidDate}}),rb=function(b,d,e,f){var g;return"boolean"==typeof e&&(f=e,e=a),g={},g._isAMomentObject=!0,g._i=b,g._f=d,g._l=e,g._strict=f,g._isUTC=!1,g._pf=c(),hb(g)},rb.suppressDeprecationWarnings=!1,rb.createFromInputFallback=e("moment construction falls back to js Date. This is discouraged and will be removed in upcoming major release. Please refer to https://github.com/moment/moment/issues/1407 for more info.",function(a){a._d=new Date(a._i)}),rb.min=function(){var a=[].slice.call(arguments,0);return ib("isBefore",a)},rb.max=function(){var a=[].slice.call(arguments,0);return ib("isAfter",a)},rb.utc=function(b,d,e,f){var g;return"boolean"==typeof e&&(f=e,e=a),g={},g._isAMomentObject=!0,g._useUTC=!0,g._isUTC=!0,g._l=e,g._i=b,g._f=d,g._strict=f,g._pf=c(),hb(g).utc()},rb.unix=function(a){return rb(1e3*a)},rb.duration=function(a,b){var c,d,e,f,g=a,h=null;return rb.isDuration(a)?g={ms:a._milliseconds,d:a._days,M:a._months}:"number"==typeof a?(g={},b?g[b]=a:g.milliseconds=a):(h=Ib.exec(a))?(c="-"===h[1]?-1:1,g={y:0,d:z(h[zb])*c,h:z(h[Ab])*c,m:z(h[Bb])*c,s:z(h[Cb])*c,ms:z(h[Db])*c}):(h=Jb.exec(a))?(c="-"===h[1]?-1:1,e=function(a){var b=a&&parseFloat(a.replace(",","."));return(isNaN(b)?0:b)*c},g={y:e(h[2]),M:e(h[3]),d:e(h[4]),h:e(h[5]),m:e(h[6]),s:e(h[7]),w:e(h[8])}):"object"==typeof g&&("from"in g||"to"in g)&&(f=q(rb(g.from),rb(g.to)),g={},g.ms=f.milliseconds,g.M=f.months),d=new k(g),rb.isDuration(a)&&a.hasOwnProperty("_locale")&&(d._locale=a._locale),d},rb.version=ub,rb.defaultFormat=bc,rb.ISO_8601=function(){},rb.momentProperties=Fb,rb.updateOffset=function(){},rb.relativeTimeThreshold=function(b,c){return jc[b]===a?!1:c===a?jc[b]:(jc[b]=c,!0)},rb.lang=e("moment.lang is deprecated. Use moment.locale instead.",function(a,b){return rb.locale(a,b)}),rb.locale=function(a,b){var c;return a&&(c="undefined"!=typeof b?rb.defineLocale(a,b):rb.localeData(a),c&&(rb.duration._locale=rb._locale=c)),rb._locale._abbr},rb.defineLocale=function(a,b){return null!==b?(b.abbr=a,Eb[a]||(Eb[a]=new i),Eb[a].set(b),rb.locale(a),Eb[a]):(delete Eb[a],null)},rb.langData=e("moment.langData is deprecated. Use moment.localeData instead.",function(a){return rb.localeData(a)}),rb.localeData=function(a){var b;if(a&&a._locale&&a._locale._abbr&&(a=a._locale._abbr),!a)return rb._locale;if(!t(a)){if(b=I(a))return b;a=[a]}return H(a)},rb.isMoment=function(a){return a instanceof j||null!=a&&a.hasOwnProperty("_isAMomentObject")},rb.isDuration=function(a){return a instanceof k};for(tb=oc.length-1;tb>=0;--tb)y(oc[tb]);rb.normalizeUnits=function(a){return w(a)},rb.invalid=function(a){var b=rb.utc(0/0);return null!=a?l(b._pf,a):b._pf.userInvalidated=!0,b},rb.parseZone=function(){return rb.apply(null,arguments).parseZone()},rb.parseTwoDigitYear=function(a){return z(a)+(z(a)>68?1900:2e3)},l(rb.fn=j.prototype,{clone:function(){return rb(this)},valueOf:function(){return+this._d+6e4*(this._offset||0)},unix:function(){return Math.floor(+this/1e3)},toString:function(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ") },toDate:function(){return this._offset?new Date(+this):this._d},toISOString:function(){var a=rb(this).utc();return 00:!1},parsingFlags:function(){return l({},this._pf)},invalidAt:function(){return this._pf.overflow},utc:function(a){return this.zone(0,a)},local:function(a){return this._isUTC&&(this.zone(0,a),this._isUTC=!1,a&&this.add(this._d.getTimezoneOffset(),"m")),this},format:function(a){var b=M(this,a||rb.defaultFormat);return this.localeData().postformat(b)},add:r(1,"add"),subtract:r(-1,"subtract"),diff:function(a,b,c){var d,e,f=J(a,this),g=6e4*(this.zone()-f.zone());return b=w(b),"year"===b||"month"===b?(d=432e5*(this.daysInMonth()+f.daysInMonth()),e=12*(this.year()-f.year())+(this.month()-f.month()),e+=(this-rb(this).startOf("month")-(f-rb(f).startOf("month")))/d,e-=6e4*(this.zone()-rb(this).startOf("month").zone()-(f.zone()-rb(f).startOf("month").zone()))/d,"year"===b&&(e/=12)):(d=this-f,e="second"===b?d/1e3:"minute"===b?d/6e4:"hour"===b?d/36e5:"day"===b?(d-g)/864e5:"week"===b?(d-g)/6048e5:d),c?e:n(e)},from:function(a,b){return rb.duration({to:this,from:a}).locale(this.locale()).humanize(!b)},fromNow:function(a){return this.from(rb(),a)},calendar:function(a){var b=a||rb(),c=J(b,this).startOf("day"),d=this.diff(c,"days",!0),e=-6>d?"sameElse":-1>d?"lastWeek":0>d?"lastDay":1>d?"sameDay":2>d?"nextDay":7>d?"nextWeek":"sameElse";return this.format(this.localeData().calendar(e,this))},isLeapYear:function(){return D(this.year())},isDST:function(){return this.zone()+rb(a).startOf(b)},isBefore:function(a,b){return b="undefined"!=typeof b?b:"millisecond",+this.clone().startOf(b)<+rb(a).startOf(b)},isSame:function(a,b){return b=b||"ms",+this.clone().startOf(b)===+J(a,this).startOf(b)},min:e("moment().min is deprecated, use moment.min instead. https://github.com/moment/moment/issues/1548",function(a){return a=rb.apply(null,arguments),this>a?this:a}),max:e("moment().max is deprecated, use moment.max instead. https://github.com/moment/moment/issues/1548",function(a){return a=rb.apply(null,arguments),a>this?this:a}),zone:function(a,b){var c,d=this._offset||0;return null==a?this._isUTC?d:this._d.getTimezoneOffset():("string"==typeof a&&(a=P(a)),Math.abs(a)<16&&(a=60*a),!this._isUTC&&b&&(c=this._d.getTimezoneOffset()),this._offset=a,this._isUTC=!0,null!=c&&this.subtract(c,"m"),d!==a&&(!b||this._changeInProgress?s(this,rb.duration(d-a,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,rb.updateOffset(this,!0),this._changeInProgress=null)),this)},zoneAbbr:function(){return this._isUTC?"UTC":""},zoneName:function(){return this._isUTC?"Coordinated Universal Time":""},parseZone:function(){return this._tzm?this.zone(this._tzm):"string"==typeof this._i&&this.zone(this._i),this},hasAlignedHourOffset:function(a){return a=a?rb(a).zone():0,(this.zone()-a)%60===0},daysInMonth:function(){return A(this.year(),this.month())},dayOfYear:function(a){var b=wb((rb(this).startOf("day")-rb(this).startOf("year"))/864e5)+1;return null==a?b:this.add(a-b,"d")},quarter:function(a){return null==a?Math.ceil((this.month()+1)/3):this.month(3*(a-1)+this.month()%3)},weekYear:function(a){var b=fb(this,this.localeData()._week.dow,this.localeData()._week.doy).year;return null==a?b:this.add(a-b,"y")},isoWeekYear:function(a){var b=fb(this,1,4).year;return null==a?b:this.add(a-b,"y")},week:function(a){var b=this.localeData().week(this);return null==a?b:this.add(7*(a-b),"d")},isoWeek:function(a){var b=fb(this,1,4).week;return null==a?b:this.add(7*(a-b),"d")},weekday:function(a){var b=(this.day()+7-this.localeData()._week.dow)%7;return null==a?b:this.add(a-b,"d")},isoWeekday:function(a){return null==a?this.day()||7:this.day(this.day()%7?a:a-7)},isoWeeksInYear:function(){return B(this.year(),1,4)},weeksInYear:function(){var a=this.localeData()._week;return B(this.year(),a.dow,a.doy)},get:function(a){return a=w(a),this[a]()},set:function(a,b){return a=w(a),"function"==typeof this[a]&&this[a](b),this},locale:function(b){return b===a?this._locale._abbr:(this._locale=rb.localeData(b),this)},lang:e("moment().lang() is deprecated. Use moment().localeData() instead.",function(b){return b===a?this.localeData():(this._locale=rb.localeData(b),this)}),localeData:function(){return this._locale}}),rb.fn.millisecond=rb.fn.milliseconds=mb("Milliseconds",!1),rb.fn.second=rb.fn.seconds=mb("Seconds",!1),rb.fn.minute=rb.fn.minutes=mb("Minutes",!1),rb.fn.hour=rb.fn.hours=mb("Hours",!0),rb.fn.date=mb("Date",!0),rb.fn.dates=e("dates accessor is deprecated. Use date instead.",mb("Date",!0)),rb.fn.year=mb("FullYear",!0),rb.fn.years=e("years accessor is deprecated. Use year instead.",mb("FullYear",!0)),rb.fn.days=rb.fn.day,rb.fn.months=rb.fn.month,rb.fn.weeks=rb.fn.week,rb.fn.isoWeeks=rb.fn.isoWeek,rb.fn.quarters=rb.fn.quarter,rb.fn.toJSON=rb.fn.toISOString,l(rb.duration.fn=k.prototype,{_bubble:function(){var a,b,c,d=this._milliseconds,e=this._days,f=this._months,g=this._data,h=0;g.milliseconds=d%1e3,a=n(d/1e3),g.seconds=a%60,b=n(a/60),g.minutes=b%60,c=n(b/60),g.hours=c%24,e+=n(c/24),h=n(nb(e)),e-=n(ob(h)),f+=n(e/30),e%=30,h+=n(f/12),f%=12,g.days=e,g.months=f,g.years=h},abs:function(){return this._milliseconds=Math.abs(this._milliseconds),this._days=Math.abs(this._days),this._months=Math.abs(this._months),this._data.milliseconds=Math.abs(this._data.milliseconds),this._data.seconds=Math.abs(this._data.seconds),this._data.minutes=Math.abs(this._data.minutes),this._data.hours=Math.abs(this._data.hours),this._data.months=Math.abs(this._data.months),this._data.years=Math.abs(this._data.years),this},weeks:function(){return n(this.days()/7)},valueOf:function(){return this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*z(this._months/12)},humanize:function(a){var b=eb(this,!a,this.localeData());return a&&(b=this.localeData().pastFuture(+this,b)),this.localeData().postformat(b)},add:function(a,b){var c=rb.duration(a,b);return this._milliseconds+=c._milliseconds,this._days+=c._days,this._months+=c._months,this._bubble(),this},subtract:function(a,b){var c=rb.duration(a,b);return this._milliseconds-=c._milliseconds,this._days-=c._days,this._months-=c._months,this._bubble(),this},get:function(a){return a=w(a),this[a.toLowerCase()+"s"]()},as:function(a){var b,c;if(a=w(a),b=this._days+this._milliseconds/864e5,"month"===a||"year"===a)return c=this._months+12*nb(b),"month"===a?c:c/12;switch(b+=ob(this._months/12),a){case"week":return b/7;case"day":return b;case"hour":return 24*b;case"minute":return 24*b*60;case"second":return 24*b*60*60;case"millisecond":return 24*b*60*60*1e3;default:throw new Error("Unknown unit "+a)}},lang:rb.fn.lang,locale:rb.fn.locale,toIsoString:e("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",function(){return this.toISOString()}),toISOString:function(){var a=Math.abs(this.years()),b=Math.abs(this.months()),c=Math.abs(this.days()),d=Math.abs(this.hours()),e=Math.abs(this.minutes()),f=Math.abs(this.seconds()+this.milliseconds()/1e3);return this.asSeconds()?(this.asSeconds()<0?"-":"")+"P"+(a?a+"Y":"")+(b?b+"M":"")+(c?c+"D":"")+(d||e||f?"T":"")+(d?d+"H":"")+(e?e+"M":"")+(f?f+"S":""):"P0D"},localeData:function(){return this._locale}});for(tb in fc)fc.hasOwnProperty(tb)&&pb(tb.toLowerCase());rb.duration.fn.asMilliseconds=function(){return this.as("ms")},rb.duration.fn.asSeconds=function(){return this.as("s")},rb.duration.fn.asMinutes=function(){return this.as("m")},rb.duration.fn.asHours=function(){return this.as("h")},rb.duration.fn.asDays=function(){return this.as("d")},rb.duration.fn.asWeeks=function(){return this.as("weeks")},rb.duration.fn.asMonths=function(){return this.as("M")},rb.duration.fn.asYears=function(){return this.as("y")},rb.locale("en",{ordinal:function(a){var b=a%10,c=1===z(a%100/10)?"th":1===b?"st":2===b?"nd":3===b?"rd":"th";return a+c}}),Gb?module.exports=rb:"function"==typeof define&&define.amd?(define("moment",["require","exports","module"],function(a,b,c){return c.config&&c.config()&&c.config().noGlobal===!0&&(vb.moment=sb),rb}),qb(!0)):qb()}.call(this),define("core/time",[],function(){"use strict";function a(a){return a.indexOf("+")>=0?a:a+"+00:00"}var b="YYYY-MM-DDTHH:mm:ssZ";return{ISO_8601:b,assureTzOffset:a}}),define("core/advice",["underscore"],function(a){"use strict";function b(){a.each(["before","after","around"],function(a){this[a]=function(b,d){return this[b]="function"==typeof this[b]?c[a](this[b],d):d}},this)}var c={around:function(b,c){return function(){var d=a.toArray(arguments);return c.apply(this,[a.bind(b,this)].concat(d))}},before:function(b,d){return c.around(b,function(){var b=a.toArray(arguments),c=b.shift();return d.apply(this,b),c.apply(this,b)})},after:function(b,d){return c.around(b,function(){var b=a.toArray(arguments),c=b.shift(),e=c.apply(this,b);return d.apply(this,b),e})}};return{withAdvice:b}}),define("core/models/mixins",["underscore","moment","core/time"],function(a,b,c){"use strict";function d(){this._getCreatedMoment=a.memoize(function(){var a=this.get("createdAt");if(a)return b(c.assureTzOffset(a),c.ISO_8601)},function(){return this.get("createdAt")}),this.getRelativeCreatedAt=function(){var a=this._getCreatedMoment();return a&&a.from(+new Date)},this.getFormattedCreatedAt=a.memoize(function(){var a=this._getCreatedMoment();return a&&a.format("LLLL")},function(){return this.get("createdAt")})}return{withCreatedAt:d}}),define("core/collections/UserCollection",["underscore","backbone","core/api","core/models/User"],function(a,b,c,d){"use strict";var e=b.Collection.extend({model:d,initialize:function(a,c){b.Collection.prototype.initialize.apply(this,arguments),this.thread=c&&c.thread}});return e}),define("core/collections/UpvotersUserCollection",["underscore","backbone","core/api","core/collections/UserCollection"],function(a,b,c,d){"use strict";var e=d.extend({LIMIT:50,url:function(){return c.getURL("posts/listUsersVotedPost")},initialize:function(a,b){this.postId=b.postId,this.threadId=b.threadId},fetch:function(c){return b.Collection.prototype.fetch.call(this,a.extend({data:{post:this.postId,thread:this.threadId,vote:1,limit:this.LIMIT}},c))}});return e}),define("core/models/Vote",["backbone"],function(a){"use strict";var b=a.Model.extend({defaults:{score:0}});return b}),define("core/collections/VoteCollection",["backbone","core/models/Vote"],function(a,b){"use strict";var c=a.Collection.extend({model:b});return c}),define("core/models/Post",["jquery","underscore","backbone","moment","core/api","core/strings","core/time","core/utils","core/advice","core/models/mixins","core/models/User","core/collections/UserCollection","core/collections/UpvotersUserCollection","core/collections/VoteCollection"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n){"use strict";var o=f.get,p=c.Model.extend({upvotersCollectionClass:m,defaults:function(){return{createdAt:d().format(g.ISO_8601),dislikes:0,isApproved:!0,isDeleted:!1,isEdited:!1,isFlagged:!1,isFlaggedByUser:!1,isHighlighted:!1,isRealtime:!1,isImmediateReply:!1,isMinimized:null,hasMedia:!1,message:null,raw_message:null,likes:0,media:[],parent:null,points:0,depth:0,userScore:0}},initialize:function(){this.votes=new n},messageText:function(){var a=this.get("message");return h.strip(a)},relatedIds:function(){var a=this.get("forum");b.isObject(a)&&(a=a.id);var c=this.get("thread");return b.isObject(c)&&(c=c.id),{forum:a,thread:c,post:this.id}},permalink:function(a,b){var c=this.id;if(!c||!a)return"";var d=b!==!1&&a.currentUrl||a.permalink(),e=document.createElement("a");return e.href=d,e.hash="#comment-"+c,e.href},twitterText:function(a){var b=140,c=this.author.get("name")||this.author.get("username");b-=c.length+3,b-=a.length+1,b-=2;var d=h.niceTruncate(this.messageText(),b);return'"'+d+'" — '+c},toJSON:function(a){var b=c.Model.prototype.toJSON.call(this);if(a){var d=a.session,e=a.thread;b.canBeEdited=this.canBeEdited(d,e),b.canBeRepliedTo=this.canBeRepliedTo(d,e),b.canBeShared=this.canBeShared(),b.permalink=this.permalink(e)}return b.isMinimized=this.isMinimized(),b.relativeCreatedAt=this.getRelativeCreatedAt(),b.formattedCreatedAt=this.getFormattedCreatedAt(),b.cid=this.cid,b},isPublic:function(){return this.get("isHighlighted")||this.get("isSponsored")?!0:this.get("isDeleted")?!1:this.get("isApproved")},isMinimized:function(){return this.get("isHighlighted")?!1:this.get("isMinimized")===!1?!1:!this.get("isApproved")},isAuthorSessionUser:function(){return!1},canBeEdited:function(){return!1},canBeRepliedTo:function(){return!1},canBeShared:function(){return!1},validate:function(a){if(!this.id&&!a.id){if(b.isString(a.raw_message)){if(""===a.raw_message)return o("Comments can't be blank.");if(a.raw_message.length<2)return o("Comments must have at least 2 characters.")}return""===a.author_email&&""===a.author_name?o("Please sign in or enter a name and email address."):""===a.author_email||""===a.author_name?o("Please enter both a name and email address."):b.isString(a.author_email)&&!this.validateEmail(a.author_email)?o("Invalid email address format."):void 0}},validateEmail:function(a){return h.validateEmail(a)},report:function(){this.set("isFlagged",!0),e.call("posts/report.json",{data:{post:this.id},method:"POST"})},_highlight:function(a){this.set("isHighlighted",a),e.call("posts/"+(a?"highlight":"unhighlight")+".json",{data:{post:this.id},method:"POST"})},highlight:function(){this._highlight(!0)},unhighlight:function(){this._highlight(!1)},getThreadId:function(){return this.get("thread")},getUpvotersUserCollection:b.memoize(function(){var a=this.upvotersCollectionClass;return new a(void 0,{postId:this.id,threadId:this.getThreadId()})},function(){return this.id}),_vote:function(a,b,c){var d=a-b,e={likes:this.get("likes"),dislikes:this.get("dislikes"),points:this.get("points")};return 0===d?d:(a>0?(e.likes+=a,e.dislikes+=b):0>a?(e.dislikes-=a,e.likes-=b):b>0?e.likes-=b:e.dislikes+=b,e.points+=d,c&&this.getUpvotersUserCollection()[a>0?"add":"remove"](c),this.set(e),d)},vote:function(a){var b=this,c=b._vote(a,b.get("userScore"));0!==c&&(b.set("userScore",a),e.call("posts/vote.json",{data:{post:b.id,vote:a},method:"POST",success:function(c){b.votes.add({id:c.response.id,score:a},{merge:!0})}}))},_delete:function(){return this.set({isApproved:!1,isDeleted:!0}),e.call("posts/remove.json",{data:{post:this.id},method:"POST"})},spam:function(){this.set({isApproved:!1,isDeleted:!0,isSpam:!0}),this.trigger("spam"),e.call("posts/spam.json",{data:{post:this.id},method:"POST"})},_create:function(a,b){var c=this,d=a.attributes,f={thread:d.thread,message:d.raw_message};return d.parent&&(f.parent=d.parent),d.author_name&&(f.author_name=d.author_name,f.author_email=d.author_email),e.call("posts/create.json",{data:f,method:"POST",success:function(a){c.set(a.response),b.success&&b.success()},error:b.error})},_update:function(a,b){var c=this,d=a.attributes,f={post:d.id,message:d.raw_message};return e.call("posts/update.json",{data:f,method:"POST",success:function(a){c.set(a.response),b.success&&b.success()},error:b.error})},_read:function(a,b){var c=this;return b=b||{},e.call("posts/details.json",{data:{post:c.id},method:"GET",success:function(a){c.set(a.response),b.success&&b.success()},error:b.error})},sync:function(a,b,c){c=c||{};var d=c.error;switch(d&&(c.error=function(a){d(JSON.parse(a.responseText||"{}"))}),a){case"create":return this._create(b,c);case"update":return this._update(b,c);case"delete":return this._delete();case"read":return this._read(b,c)}}},{formatMessage:function(){var a=/(?:\r\n|\r|\n){2,}/,c=/\r\n|\r|\n/;return function(d){var e=b.chain(d.split(a)).compact().value(),f=b.map(e,function(a){return b.chain(a.split(c)).compact().map(b.escape).join("
").value()}).join("

");return"

"+f+"

"}}()});return j.withCreatedAt.call(p.prototype),i.withAdvice.call(p.prototype),p.withAuthor=function(a){this.after("set",function(b){b&&"string"!=typeof b&&b.author&&(this.author=new a(b.author),delete b.author)}),this.around("toJSON",function(a){var c=a.apply(this,b.rest(arguments));return this.author&&(c.author=this.author.toJSON()),c})},p.withMediaCollection=function(a){this.after("set",function(c){c&&"string"!=typeof c&&(b.isUndefined(c.media)||(this.media?this.media.reset(c.media):this.media=new a(c.media),delete c.media))}),this.around("toJSON",function(a){var c=a.apply(this,b.rest(arguments));return this.media&&(c.media=this.media.toJSON()),c})},p}),define("core/models/LegacyMedia",["backbone"],function(a){"use strict";var b=a.Model.extend({defaults:{type:null,location:"",metadata:{}}});return b}),define("core/models/RichMedia",["backbone"],function(a){"use strict";var b=a.Model.extend({idAttribute:"url",defaults:{mediaType:null,html:"",htmlWidth:null,htmlHeight:null,thumbnailUrl:"",thumbnailWidth:null,thumbnailHeight:null,url:"",resolvedUrl:"",title:"",description:"",providerName:""}});return b}),define("core/models/Media",["underscore","backbone","core/models/LegacyMedia","core/models/RichMedia"],function(a,b,c,d){"use strict";var e=b.Model.extend(a.extend({},d.prototype,c.prototype,{idAttribute:"id"}),{MEDIA_TYPES:{IMAGE:"1",IMAGE_UPLOAD:"2",YOUTUBE_VIDEO:"3",WEBPAGE:"4",TWITTER_STATUS:"5",FACEBOOK_PAGE:"6",FACEBOOK_POST:"7",FACEBOOK_PHOTO:"8",FACEBOOK_VIDEO:"9",SOUNDCLOUD_SOUND:"10",GOOGLE_MAP:"11",VIMEO_VIDEO:"12",VINE_VIDEO:"14"},WEBPAGE_TYPES:["4","6","7"]});return e}),define("core/models/Thread",["underscore","backbone","core/utils","core/api","core/config","core/advice","core/models/User"],function(a,b,c,d,e,f,g){"use strict";var h=b.Model.extend({defaults:{author:null,category:null,createdAt:null,forum:null,identifiers:[],ipAddress:null,isClosed:!1,isDeleted:!1,hasStreaming:!1,link:null,message:null,slug:null,title:null,userSubscription:!1,posts:0,likes:0,dislikes:0,userScore:0},initialize:function(a,b){var c=this;b=b||{},c.moderators=b.moderators,c.forum=b.forum,c.on("change:userScore",function(){var a=c.get("userScore");a>0&&0===c.get("likes")&&c.set("likes",a)})},_vote:function(a,b){var c=a-b;return 0===c?c:(this.set("likes",this.get("likes")+c),c)},vote:function(a){var b=this,c=b._vote(a,b.get("userScore"));0!==c&&(this.set("userScore",a),d.call("threads/vote.json",{data:{thread:this.id,vote:a},method:"POST",success:function(a){a.response.id&&b.trigger("vote:success",a)}}))},fetch:function(a){var b,c=this,f=c.attributes;a=a||{},b=f.identifier?"ident:"+f.identifier:"link:"+f.url,d.call("threads/details.json",{data:{thread:b,forum:f.forum},success:function(b){c.set(b.response),a.success&&a.success()},error:function(){return e.debug?void c.save({},{success:a.success}):void console.log("Couldn't find thread; not creating in production.")}})},_toggleState:function(a,b){b||(b={});var c=a?"open.json":"close.json";this.set("isClosed",!a),d.call("threads/"+c,{method:"POST",data:{thread:this.id},success:b.success,error:b.error})},open:function(a){this._toggleState(!0,a)},close:function(a){this._toggleState(!1,a)},sync:function(){var a=this,b=a.attributes;d.call("threads/create.json",{data:{title:b.title,forum:b.forum,identifier:b.identifier,url:b.url},method:"POST",success:function(b){a.set(b.response)}})},incrementPostCount:function(a){var b=this.get("posts")+a;this.set("posts",b>0?b:0)},isModerator:function(b){var c;if(this.moderators)return c=b instanceof g||a.isObject(b)?b.id:b,c=parseInt(c,10),a(this.moderators).contains(c)},subscribe:function(a,b){a=a!==!1;var c=this.get("userSubscription");if(c!==a){a?this.set("userSubscription",b||!0):this.set("userSubscription",!1);var e=a?"subscribe.json":"unsubscribe.json",f={thread:this.id};b?f.email=b:a||"string"!=typeof c||(f.email=c),d.call("threads/"+e,{data:f,method:"POST"})}},relatedIds:function(){var b=this.get("forum");return a.isObject(b)&&(b=b.id),{forum:this.get("forum"),thread:this.id}},twitterText:function(a){var b=140-(a.length+1),d=c.htmlDecode(this.get("title"));return d=c.niceTruncate(d,b)},permalink:function(){return this.get("url")||this.get("link")||this.currentUrl},toJSON:function(){var a=b.Model.prototype.toJSON.call(this);return a.permalink=this.permalink(),a}});return f.withAdvice.call(h.prototype),h.withThreadVoteCollection=function(a){this.after("initialize",function(){this.votes=new a,this.on("vote:success",function(a){this.votes.get(a.response.id)||this.votes.add({id:a.response.id,score:a.response.score})},this)})},h.withPostCollection=function(b){this.after("initialize",function(c){c=c||{},this.posts=new b(c.posts,{thread:this,cursor:c.postCursor,order:c.order,perPage:this.postsPerPage}),this.listenTo(this.posts,"add reset",function(b){b=b.models?b.models:[b],this.users&&a.each(b,function(a){this.users.get(a.author.id)||this.users.add(a.author)}),this.recalculatePostCount()}),this.listenTo(this.posts,"change:isDeleted change:isFlagged",function(a,b){b&&this.incrementPostCount(-1)})}),this.recalculatePostCount=function(){var a=this.get("posts");a>50||(a=this.posts.reduce(function(a,b){return b.isPublic()?a+1:a},0),this.set("posts",a))}},h}),define("core/models/ThreadVote",["backbone"],function(a){"use strict";var b=a.Model.extend({defaults:{score:0}});return b}),define("core/models/Notification",["underscore","backbone","moment","core/models/mixins","core/models/Post"],function(a,b,c,d,e){"use strict";var f=b.Model.extend({defaults:function(){return{sender:"",timestamp:c().valueOf(),type:0,formatted:"",theme:"",createdAt:null,post:null}},set:function(a,c){return a&&"string"!=typeof a&&a.post&&(this.post=new e(a.post),delete a.post),b.Model.prototype.set.call(this,a,c)},toJSON:function(){var a=b.Model.prototype.toJSON.call(this);return this.post&&(a.post=this.post.toJSON()),a.relativeCreatedAt=this.getRelativeCreatedAt(),a}});return d.withCreatedAt.call(f.prototype),f}),define("core/collections/MediaCollection",["backbone","core/models/Media"],function(a,b){"use strict";var c=a.Collection.extend({model:b});return c}),define("core/utils/fingerprint",[],function(){"use strict";function a(){try{var a=(new Date).getTimezoneOffset(),b=1,c=window.screen;c&&c.availWidth?b=c.availWidth*c.availHeight+c.colorDepth:c&&c.width&&(b=c.width*c.height);var d=document.documentElement,e=d.clientWidth*d.clientHeight;return Math.abs(17*a+25*b-e)}catch(f){return 1}}return{get:a}}),define("core/utils/guid",["core/utils/fingerprint"],function(a){"use strict";function b(){try{var a=new Uint32Array(1);return window.crypto.getRandomValues(a)[0]}catch(b){return Math.floor(1e9*Math.random())}}function c(){if(window.performance&&window.performance.timing){var a=window.performance.timing,b=a.domainLookupEnd-a.domainLookupStart,c=a.connectEnd-a.connectStart,d=a.responseStart-a.navigationStart;return 11*b+13*c+17*d}return 1e5}function d(){var d=+(new Date).getTime().toString().substring(3),e=Math.abs(d+c()-a.get()).toString(32);return e+=b().toString(32)}return{generate:d}}),function(a,b){if("function"==typeof define&&define.amd)define("backbone.uniquemodel",["backbone"],function(a){a.UniqueModel=b(a)});else if("undefined"!=typeof exports){var c=require("backbone");c.UniqueModel=b(c)}else a.Backbone.UniqueModel=b(a.Backbone)}(this,function(a){"use strict";function b(a,c,d){c=c||_.uniqueId("UniqueModel_"),d=d||b.STORAGE_DEFAULT_ADAPTER;var e=b.addModel(a,c,d);return e.modelConstructor}function c(b,c,e){var f=this;this.instances={},this.Model=b,this.modelName=c,this.storage=null,"localStorage"===e?this.storage=new d(this.modelName,localStorage):"sessionStorage"===e&&(this.storage=new d(this.modelName,sessionStorage)),this.storage&&(this.storage.on("sync",this.storageSync,this),this.storage.on("destroy",this.storageDestroy,this));var g=function(a,b){return f.get(a,b)};_.extend(g,a.Events),g.prototype=this.Model.prototype,this.modelConstructor=g}function d(a,b){this.modelName=a,this.store=b,d.instances[a]=this,d.listener||(d.listener=window.addEventListener?window.addEventListener("storage",d.onStorage,!1):window.attachEvent("onstorage",d.onStorage))}var e={};return b.STORAGE_DEFAULT_ADAPTER="memory",b.STORAGE_KEY_DELIMETER=".",b.STORAGE_NAMESPACE="UniqueModel",b.getModelCache=function(a){var b=e[a];if(!b)throw"Unrecognized model: "+a;return b},b.addModel=function(a,b,d){if(e[b])return e[b];var f=new c(a,b,d);return e[b]=f,f},b.clear=function(){for(var a in e)e.hasOwnProperty(a)&&delete e[a]},_.extend(c.prototype,{newModel:function(a,b){var c=new this.Model(a,b);return this.storage&&(c.id&&this.storage.save(c.id,c.attributes),c.on("sync",this.instanceSync,this),c.on("destroy",this.instanceDestroy,this)),c},instanceSync:function(a){this.storage&&this.storage.save(a.id,a.attributes)},instanceDestroy:function(a){this.storage&&this.storage.remove(a.id)},storageSync:function(a,b){this.get(b,{fromStorage:!0})},storageDestroy:function(a){var b=this.instances[a];b&&(b.trigger("destroy",b),delete this.instances[a])},add:function(a,b,c){var d=this.newModel(b,c);return this.instances[a]=d,d},get:function(a,b){b=b||{};var c=this.Model,d=a&&a[c.prototype.idAttribute];if(!d)return this.newModel(a,b);var e=this.instances[d];if(this.storage&&!b.fromStorage&&!e){var f=this.storage.getFromStorage(this.storage.getStorageKey(d));f&&(e=this.add(d,f,b))}return e?(e.set(a),b.fromStorage||this.instanceSync(e)):(e=this.add(d,a,b),b.fromStorage&&this.modelConstructor.trigger("uniquemodel.add",e)),e}}),d.instances={},d.listener=null,d.onStorage=function(a){var c=a.key,e=new RegExp([b.STORAGE_NAMESPACE,"(\\w+)","(.+)"].join("\\"+b.STORAGE_KEY_DELIMETER)),f=c.match(e);if(f){var g=f[1],h=f[2],i=d.instances[g];i&&i.handleStorageEvent(c,h)}},_.extend(d.prototype,{handleStorageEvent:function(a,b){var c=this.getFromStorage(a);c?this.trigger("sync",b,c):this.trigger("destroy",b)},getFromStorage:function(a){try{return JSON.parse(this.store.getItem(a))}catch(b){return}},getStorageKey:function(a){var c=[b.STORAGE_NAMESPACE,this.modelName,a].join(b.STORAGE_KEY_DELIMETER);return c},save:function(a,b){if(!a)throw"Cannot save without id";var c=JSON.stringify(b);this.store.setItem(this.getStorageKey(a),c)},remove:function(a){if(!a)throw"Cannot remove without id";this.store.removeItem(this.getStorageKey(a))}},a.Events),_.extend(b,{ModelCache:c,StorageAdapter:d}),b}),define("common/models",["require","jquery","underscore","backbone","moment","modernizr","core/api","core/models/User","core/models/Post","core/models/Media","core/models/LegacyMedia","core/models/RichMedia","core/models/Thread","core/models/Vote","core/models/ThreadVote","core/models/Notification","core/collections/MediaCollection","core/utils/guid","common/defines","common/utils","core/strings","core/time","common/urls","common/keys","shared/corefuncs","backbone.uniquemodel"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y){"use strict";function z(a,b,c){var d=z.pool(a),e=b&&b[a.prototype.idAttribute];if(!e)return new a(b,c);var f=z.get(a,e);return f?d[e].set(b):d[e]=new a(b,c),d[e]}z.pool={},z.pool=function(a){var b=z.pool[a.__type__];if(!b)throw new Error("Model not registered. Use UniqueModel.addType");return b},z.get=function(a,b){return z.pool(a)[b]},z.addType=function(a,b){b.__type__&&z.pool[a]||(b.__type__=a,z.pool[a]={})},z.wrap=function(a){var b=c.partial(z,a);return b.prototype=a.prototype,b};var A=d.Model.extend({defaults:{settings:{}}}),B=m.extend({initialize:function(b,d){m.prototype.initialize.apply(this,arguments),d=d||{};var e=this,f=a("common/collections");e.users=new f.UserCollection(d.users,{thread:e}),e.forum&&(e.moderatorList=new f.ModeratorCollection(null,{forum:e.forum.get("id")})),e.posts=new f.SubpaginatedPostCollection(d.posts,{thread:e,cursor:d.postCursor,order:d.order,perPage:t.isMobile(window)?20:50}),e.votes=new f.ThreadVoteCollection,e.posts.on("add reset",function(a){a=a.models?a.models:[a],c.each(a,function(a){e.users.get(a.author.id)||e.users.add(a.author)}),e.recalculatePostCount()}),e.listenTo(e.posts,"change:isDeleted change:isFlagged",function(a,b){b&&e.incrementPostCount(-1)}),e.queue=new f.QueuedPostCollection(null,{thread:e})},recalculatePostCount:function(){var a=this.get("posts");a>50||(a=this.posts.buffer.reduce(function(a,b){return b.isPublic()?a+1:a},0),this.set("posts",a))}}),C=B.extend({defaults:c.extend({postsInInterval:0,posts:0,topPost:null},B.prototype.defaults)}),D=i.extend({initialize:function(){i.prototype.initialize.apply(this,arguments);var b=a("common/collections");this.usersTyping=new b.TypingUserCollection},isAuthorSessionUser:function(a){return a.user.id&&this.author&&this.author.id?this.author.id===a.user.id:!1},canBeEdited:function(a,b){return!b.get("isClosed")&&!this.get("isDeleted")&&a.isLoggedIn()&&this.isAuthorSessionUser(a)&&this.get("raw_message")&&!this.get("isHighlighted")&&!this.get("isSponsored")},canBeRepliedTo:function(a,b){var c=a.get("canReply")&&this.get("isSponsored");return c||!b.get("isClosed")&&a.get("canReply")&&!this.get("isDeleted")&&(this.get("isApproved")||b.isModerator(a.user))},canBeShared:function(){return!this.get("isDeleted")&&!this.get("isSponsored")},getParent:function(){var a=this.get("parent");if(a)return new z(D,{id:a+""})}},{fetchContext:function(a,d,e){e=e||{};var f=b.Deferred();return g.call("posts/getContext.json",{method:"GET",data:{post:a},success:function(a){var b=c.filter(a.response,function(a){return a.thread===d.get("id")});return b?(c.each(b,function(a){a=new z(D,a),e.requestedByPermalink&&(a.requestedByPermalink=!0),d.posts.add(a)}),void f.resolve(b)):void f.reject()}}),f.promise()}});i.withAuthor.call(D.prototype,z.wrap(h)),i.withMediaCollection.call(D.prototype,q),z.addType("Post",D);var E=d.Model.extend({defaults:{userId:null,message:null,parentId:null,immedReply:!1,createdAt:void 0},getVisibleParent:function(a){for(var b,c=this;c.get("parentId");){if(b=a.posts.get(c.get("parentId")))return b;if(c=a.queue.get(c.get("parentId")),!c)return null}return null},toPost:function(a){var b=this,c=a.posts.get(b.get("parentId")),d=c?c.get("depth")+1:0,e=new z(D,{id:b.id,thread:a.id,message:b.get("message"),parent:b.get("parentId"),depth:d,createdAt:b.get("createdAt"),isRealtime:!0,media:b.get("media"),isImmediateReply:b.get("immedReply")});return e.author=a.users.get(b.get("userId")),e}}),F=d.Model.extend({defaults:{user:null,post:null,thread:null,client_context:null,typing:!0},idAttribute:"client_context",set:function(){return this.lastModified=new Date,d.Model.prototype.set.apply(this,arguments)},sync:function(){var a=this.toJSON(),b=y.serialize(w.realertime+"/api/typing",a);t.attempt(function(){t.CORS.request("GET",b).send()})}},{make:function(a){return a.client_context||(a.client_context=r.generate()),new z(F,a)}});z.addType("TypingUser",F),c.extend(h.prototype,{getFollowing:function(){var b=a("common/collections/profile");return this.following||(this.following=new b.FollowingCollection(null,{user:this}))}}),z.addType("User",h);var G=h.extend({defaults:c.extend({numPosts:0},h.prototype.defaults)}),H=f.sessionstorage?"sessionStorage":null,I=d.UniqueModel(h,"User",H),J=d.UniqueModel(G,"User",H),K=d.Model.extend({}); return{UniqueModel:z,Forum:A,Thread:B,TopThread:C,Post:D,QueuedPost:E,TypingUser:F,User:h,TopUser:G,Vote:n,ThreadVote:o,Notification:p,Switch:K,LegacyMedia:k,RichMedia:l,Media:j,SyncedUser:I,SyncedTopUser:J}}),define("common/Session",["jquery","underscore","backbone","modernizr","core/api","core/bus","core/models/Session","core/strings","core/utils/cookies","common/bus","common/collections/LoggedOutNotifications","common/models","common/urls","common/utils","shared/corefuncs"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o){"use strict";var p,q=c.Model.extend({storageKey:"disqus.bus",initialize:function(){d.localstorage&&a(window).on("storage",b.bind(this.onStorageEvent,this))},broadcast:function(a,b){if(d.localstorage){var c=JSON.stringify({name:a,data:b,time:(new Date).getTime()});try{window.localStorage.setItem(this.storageKey,c)}catch(e){return}}},onStorageEvent:function(a){var b=a.originalEvent.key,c=a.originalEvent.newValue;if(c&&b===this.storageKey)try{c=JSON.parse(c),this.trigger(c.name,c.data)}catch(d){return}}}),r=new q,s=g.extend({defaults:{canReply:!0,canAdminister:!1,canModerate:!1,mustVerifyEmail:!1,isReadOnly:!1,audienceSyncVerified:!1,notificationCount:0,sso:null},windowOpen:function(a,b,c){n.windowOpen(a,"_blank",{width:b,height:c})},start:function(a){this.set(a),this.listenTo(r,"auth:success",this.fetch),this.listenTo(j,{"!auth:success":function(a){a&&(a.sessionId&&e.headers({"X-Sessionid":a.sessionId}),a.message&&this.trigger("alert",a.message,{type:"info"}),a.logEvent&&f.trigger("uiAction:"+a.logEvent)),r.broadcast("auth:success"),this.fetch()}}),this.bindAudienceSyncHandlers()},stop:function(){this.stopListening(),this.off()},shouldFetchSession:function(){return this.get("remoteAuthS3")||i.read("disqusauth")},getUserInstance:function(a){return new l.UniqueModel(l.User,a)},toJSON:function(){var a=this.user.toJSON.apply(this.user,arguments);return a.thread.canReply=this.get("canReply"),a.thread.canModerate||(a.thread.canModerate=this.get("canModerate")),a.logoutUrl=this.getLogoutUrl(),a},fetch:function(){return this.has("thread")?this.fetchThreadDetails(this.get("thread")):g.prototype.fetch.apply(this,arguments)},fetchThreadDetails:function(a){var c=this;c._request&&(c._request.abort(),c._request=null);var d={thread:a.id,post:a.posts.pluck("id")};return d["_"+(new Date).getTime()]=1,c._request=e.call("embed/threadDetails.json",{data:d,success:function(d){var e=d.response,f={};e.user&&b.extend(f,e.user,{votes:e.votes}),c.set(e.session),f.id?(c.setUser(new l.UniqueModel(l.User,f)),a.users.add(c.user),e.thread&&(a.set("userScore",e.thread.userScore),a.set("userSubscription",e.thread.userSubscription))):c.setUser(c.getAnonUserInstance())},complete:function(){c._request=null}}),c._request},getLogoutUrl:function(){var a=this.get("sso");return this.isSSO()&&a&&a.logout?a.logout:m.logout},isSSO:function(){return this.user&&"sso"===this.user.get("user_type")},authenticate:function(a){var c=this.authServices[a];if(c){if(b.isFunction(c))return c.call(this);f.trigger("uiAction:openLogin",a);var d={forum:this.get("thread")&&this.get("thread").forum.id};"https:"===window.location.protocol&&(d.redirect_secure=1),b.extend(d,c.params),this.windowOpen(o.serialize(c.url,d),c.width,c.height)}},authServices:{disqus:{url:m.login,width:460,height:355},disqusDotcom:{url:m.dotcomLogin,width:478,height:590,params:{next:m.login}},twitter:{url:m.oauth.twitter,width:650,height:680},facebook:{url:m.oauth.facebook,width:550,height:300},google:{url:m.oauth.google,width:650,height:440},sso:function(){var a=this.get("sso"),c=parseInt(a.width||"800",10),d=parseInt(a.height||"500",10),e=window.open(a.url,"_blank","width="+c+",height="+d);!function f(){n.isWindowClosed(e)?j.sendHostMessage("reload"):b.delay(f,500)}()}},verifyEmail:function(){var a=o.serialize(m.verifyEmail,{f:this.get("thread").forum.id});window.open(a,"_blank","width=460,height=355")},bindAudienceSyncHandlers:function(){this.listenTo(this,"change:id change:audienceSyncVerified",function(){this.get("audienceSyncVerified")&&j.sendHostMessage("session.identify",this.user.id)}),this.listenTo(j,{"!audiencesync:grant":function(){this.set("audienceSyncVerified",!0)}})},getAudienceSyncUrl:function(){var a={client_id:this.get("apiKey"),response_type:"audiencesync",forum_id:this.get("thread").forum.id};return"https:"===window.location.protocol&&(a.ssl=1),o.serialize(m.authorize,a)},audienceSync:function(){this.windowOpen(this.getAudienceSyncUrl(),460,355)},needsAudienceSyncAuth:function(a){return a.get("settings").audienceSyncEnabled&&this.isLoggedIn()&&!this.get("audienceSyncVerified")},getLoggedOutNotes:function(){return this._loggedOutNotes?this._loggedOutNotes:(this._loggedOutNotes=new k.Collection(k.LOGGED_OUT_NOTES,{session:this}),this._loggedOutNotes)}});return{get:function(){return p=p||new s},setDefaults:function(a){if(p)throw new Error("Session defaults cannot be changed after a session instance is created!");return s.defaults=b.extend(s.prototype.defaults,a),s.defaults},forget:function(){p&&(p.stop(),p=null)}}}),define("common/analytics/google",["require","common/keys","common/defines"],function(a,b,c){"use strict";var d,e=function(a){d=a},f=function(a){d?d(a):window._gaq.push(a)},g=function(){var d="";if(!c.debug||d){var e="https:"===window.location.protocol?"https://ssl":"http://www",f=e+".google-analytics.com/"+(d?"u/ga_debug":"ga")+".js";l(b.googleAnalytics),m(".disqus.com"),a([f])}},h={component:1,"package":2,forum:3,version:4,userType:5},i=function(a,b){f(["_setCustomVar",h[a],a,b])},j=function(){f(["_trackPageview"])},k=function(a,b,c){f(["_trackEvent",b,a,c,1])},l=function(a){f(["_setAccount",a])},m=function(a){f(["_setDomainName",a])};return window._gaq||(window._gaq=[]),g(),{setCaller:e,setAccount:l,setCustomVar:i,trackPageview:j,trackEvent:k,setDomainName:m}}),define("core/collections/PaginatedCollection",["underscore","backbone"],function(a,b){"use strict";var c=b.Collection.extend({PER_PAGE:30,initialize:function(a,b){b=b||{},this.cursor=b.cursor||{}},fetch:function(c){return c=c||{},c.data=a.defaults(c.data||{},{cursor:c.cursor||"",limit:c.PER_PAGE||this.PER_PAGE}),b.Collection.prototype.fetch.call(this,c)},hasNext:function(){return this.cursor.hasNext},more:function(b){function c(a){e.push(a)}var d=this;if(b=b||{},!this.cursor.hasNext)return void d.trigger("nodata");var e=[];this.on("add",c),this.fetch(a.extend({},b,{add:!0,remove:!1,cursor:this.cursor.next,limit:this.PER_PAGE,success:function(){d.trigger("add:many",e,d,b),d.off("add",c),b.success&&b.success.apply(this,arguments)}}))},parse:function(a){return this.cursor=a.cursor||{hasNext:!1},a.response},getLength:function(){return this.length}});return c}),define("common/collections",["underscore","backbone","moment","core/api","core/collections/UserCollection","core/collections/MediaCollection","core/collections/VoteCollection","core/collections/UpvotersUserCollection","core/collections/PaginatedCollection","common/models","common/cached-storage"],function(a,b,c,d,e,f,g,h,i,j,k){"use strict";var l=b.Collection.extend({model:j.ThreadVote}),m=i.extend({PER_PAGE:50,model:j.UniqueModel.wrap(j.Post),url:d.getURL("threads/listPostsThreaded"),initialize:function(a,b){i.prototype.initialize.apply(this,arguments),b=b||{},this.thread=b.thread,this.setOrder(b.order)},fetch:function(b){return b=b||{},b=a.extend(b,{data:{limit:this.PER_PAGE,thread:this.thread.id,forum:this.thread.get("forum"),order:this.getOrder()}}),i.prototype.fetch.call(this,b)},getOrder:function(){return this.order},setOrder:function(a){this.order=a}}),n=b.Collection.extend({collection:b.Collection,initialize:function(a,b){this.thread=b.thread,this.perPage=b.perPage||20,this.buffer=new this.collection(a,b),this.resetPage(),this.listenTo(this.buffer,"reset",this.resetPage)},resetPage:function(a,c,d){return c=this.buffer.slice(0,this.perPage),b.Collection.prototype.reset.call(this,c,d)},currentPage:function(){var a=Math.floor(this.length/this.perPage);return this.length%this.perPage&&a++,a},setPageFor:function(a,b){var c=this.buffer.get(a),d=this.perPage;c&&(d=Math.floor(this.buffer.indexOf(c)/this.perPage+1)*this.perPage),this.add(this.buffer.slice(0,d),b)},hasNext:function(){return this.buffer.length>this.length||this.buffer.hasNext()},more:function(a){a=a||{};var b=this,c=b.length+this.perPage,d=a.success;a.success=function(){b.add(b.buffer.slice(0,c)),d&&d()},b.buffer.length0&&null===b.gc?void(b.gc=setInterval(a.bind(b.cleanup,b),6e4)):void(0>=c&&null!==b.gc&&(clearInterval(b.gc),b.gc=null))},b)},count:function(a){var b=this.filter(function(b){return!(a&&b.id===a)&&b.get("typing")});return b.length},cleanup:function(){var a=c();this.reset(this.filter(function(b){return a.diff(b.lastModified,"minutes")<5}))}}),s=i.extend({model:j.UniqueModel.wrap(j.Post),url:d.getURL("users/listPostActivity")}),t=b.Collection.extend({model:j.TopThread,url:d.getURL("threads/listPopular"),initialize:function(a,b){this.forum=b.forum,this.limit=b.limit},set:function(c,d){d.parse&&(c=this.parse(c,d),delete d.parse),a.isArray(c)||(c=c?[c]:[]),c=a.reject(c,function(a){return a.title.match(/^http/i)}),b.Collection.prototype.set.call(this,c,d)},fetch:function(c){return b.Collection.prototype.fetch.call(this,a.extend({data:{forum:this.forum,limit:this.limit,interval:"7d",with_top_post:!0}},c))}}),u=b.Collection.extend({model:j.SyncedTopUser,url:d.getURL("forums/listMostActiveUsers"),initialize:function(a,b){this.forum=b.forum,this.limit=b.limit},fetch:function(c){return b.Collection.prototype.fetch.call(this,a.extend({data:{forum:this.forum,limit:this.limit}},c))},parse:function(b){return a.filter(b.response,function(a){return parseFloat(a.rep)>.7?a:void 0})}});e.prototype.model=j.UniqueModel.wrap(j.User);var v=b.Collection.extend({model:j.SyncedUser,url:d.getURL("forums/listModerators"),initialize:function(a,b){this.forum=b.forum},fetch:function(c){return b.Collection.prototype.fetch.call(this,a.extend({data:{forum:this.forum}},c))},parse:function(b){return a.map(b.response,function(a){return a.user})}});return{PaginatedCollection:i,UserCollection:e,PostCollection:m,SubpaginatedPostCollection:o,TypingUserCollection:r,TopUserCollection:u,TopThreadCollection:t,VoteCollection:g,ThreadVoteCollection:l,PostActivityCollection:s,PostMediaCollection:f,QueuedPostCollection:p,SwitchCollection:q,UpvotersUserCollection:h,ModeratorCollection:v}}),define("common/collections/profile",["underscore","backbone","core/api","common/models","common/collections"],function(a,b,c,d,e){"use strict";var f=e.PaginatedCollection.extend({initialize:function(a,b){this.user=b.user,e.PaginatedCollection.prototype.initialize.apply(this,arguments)},fetch:function(a){return a=a||{},a.data=a.data||{},a.data.user=this.user.id,e.PaginatedCollection.prototype.fetch.call(this,a)}}),g=f.extend({model:d.SyncedUser,url:c.getURL("users/listFollowers"),PER_PAGE:20}),h=f.extend({model:d.SyncedUser,url:c.getURL("users/listFollowing"),PER_PAGE:20}),i=f.extend({model:d.Forum,url:c.getURL("users/listActiveForums")}),j=e.PaginatedCollection.extend({model:d.Post,url:c.getURL("users/listPosts"),initialize:function(a,b){this.user=b.user,e.PaginatedCollection.prototype.initialize.apply(this,arguments)},fetch:function(b){b=b||{},b.data=b.data||{},a.extend(b.data,{related:["thread","forum"],user:this.user.id}),e.PaginatedCollection.prototype.fetch.call(this,b)}});return{SessionPaginatedCollection:f,FollowerCollection:g,FollowingCollection:h,CommunityCollection:i,UserPostCollection:j}}),define("common/intelligence",["underscore","common/analytics/google"],function(a,b){"use strict";function c(a){return a.has("remote")?a.get("remote").domain:a.id?"disqus":"not_logged_in"}function d(a){return a.support_preferred?"plus":a.support_priority?"pro":a.support_vip?"vip":"free"}function e(){b.trackPageview()}function f(a,c){b.setCustomVar(a,c)}function g(){this.version="next",this.forum=null,this.userType=null}return g.prototype.init=function(a){a=a||{},f("component","embed"),a.version&&(this.version=a.version),f("version",this.version),a.forum&&(this.forum=a.forum,f("forum",a.forum)),a.features&&f("package",d(a.features)),this.setSession(a.session||"not_logged_in"),e()},g.prototype.setSession=function(b){var d=a.isString(b)?b:c(b);d!==this.userType&&(this.userType=d,f("userType",d))},g.prototype.trackEvent=function(a){b.trackEvent(a,this.version,this.forum)},{Intelligence:g,setCustomVar:f,trackPageview:e,getUserType:c,getPackageType:d}}),define("core/utils/hash",[],function(){"use strict";var a=function(a){var b,c,d,e=0;if(0===a.length)return e;for(b=0,c=a.length;c>b;b++)d=a.charCodeAt(b),e=(e<<5)-e+d,e|=0;return e};return{calculate:a}}),define("core/analytics/identity",["backbone","core/utils/cookies","core/utils/guid","core/utils/hash","core/utils/fingerprint"],function(a,b,c,d,e){"use strict";var f=function(){var d=a.Model.extend({COOKIE_NAME:"__jid",TTL:18e5,initialize:function(){this.prevImp=b.read(this.COOKIE_NAME),this.impId=c.generate(),this.persist()},persist:function(){b.create(this.COOKIE_NAME,this.impId,{expiresIn:this.TTL})}});return new d}(),g=function(){var d=a.Model.extend({COOKIE_NAME:"disqus_unique",isPersistent:function(){return b.read(this.COOKIE_NAME)===this.get("value")},initialize:function(){var a=b.read(this.COOKIE_NAME);a||(a=c.generate()),b.deprecated.create(this.COOKIE_NAME,a),this.set("value",a)}});return new d}(),h=function(){var a,b=g;return b.isPersistent()&&(a=b.get("value")),a||e.get().toString()},i=function(){return Math.abs(d.calculate(this.clientId())%100)};return{unique:g,impression:f,clientId:h,clientPercent:i}}),define("common/juggler",["core/analytics/identity","shared/corefuncs"],function(a,b){"use strict";var c={},d=function(a){c[a]=this,this._emit=null,this.meta={},this.allowedOverwrites=["thread","forum","forum_id","user_id"],this.reservedKeys=this.allowedOverwrites.slice().concat(["imp","event","prev_imp"]),this.preloadBuffer=[]};return b.extend(d.prototype,{disable:function(){this._emit=function(){},this.preloadBuffer=[]},copySettings:function(){return b.extend({},this.settings,this.meta)},overwrite:function(a){for(var b=0,c=this.allowedOverwrites.length;c>b;b++){var d=this.allowedOverwrites[b];a.hasOwnProperty(d)&&(this.meta[d]=a[d])}},load:function(c){var d=this;if(d.settings=c,d.url=c.url,c.disable)return void d.disable();if("https:"===window.location.protocol){if(c.disableSSL)return void d.disable();d.url=d.url.replace("http:","https:")}b.each(d.allowedOverwrites,function(a){d.meta[a]=c[a]}),d.meta.imp=a.impression.impId,d.meta.prev_imp=a.impression.prevImp,d._emit=function(a){b.each(d.meta,function(b,c){a[c]=d.meta[c]}),b.require(d.url,a,!1)},b.each(d.preloadBuffer,function(a){d._emit(a)})},emit:function(a,c){var d=this;c=b.extend({},c),b.each(d.reservedKeys,function(a){if(null!=c[a])throw'Error: cannot overwrite event context "'+a+'"'}),c.event=a,null==d._emit?d.preloadBuffer.push(c):d._emit(c)}}),{client:function(a,b){return c[a]||b&&new d(a)}}}),define("common/outboundlinkhandler",["jquery","underscore"],function(a,b){"use strict";function c(){this.handlers=[],this.locked={},this.timeout=1e3}return b.extend(c.prototype,{handleClick:function(c){var d=a(c.currentTarget),e=this.getLinkTrackingId(d);if(this.shouldHandleClick(c,d,e)){var f=b.chain(this.handlers).map(function(a){return a[0].call(a[1],c,d)}).compact().value();this.shouldDelayNavigation(c,d)&&(c.preventDefault(),this.setLatestClick(e),this.delayNavigation(c,d,f))}},delayNavigation:function(c,d,e){this.lockLink(this.getLinkTrackingId(d));var f=b.bind(function(){this.isLatestClick(this.getLinkTrackingId(d))&&d.triggerClick(c.originalEvent)},this);b.delay(f,this.timeout),a.when.apply(a,e).always(f)},registerBeforeNavigationHandler:function(a,b){this.handlers.push([a,b])},getLinkTrackingId:function(a){var c=a.attr("data-tid");return c||(c=b.uniqueId(),a.attr("data-tid",c)),c},shouldHandleClick:function(a,b){if(!this.isLinkLocked(this.getLinkTrackingId(b))){if(a.isDefaultPrevented())return!1;if(!b.is("a"))return!1;var c=/\#.*/,d=(b.attr("href")||"").replace(c,"");return d?!0:!1}},shouldDelayNavigation:function(a,b){return!("_blank"===b.attr("target")||a.ctrlKey||a.metaKey||a.shiftKey||a.altKey)},setLatestClick:function(a){this.latestLinkId=a},isLatestClick:function(a){return this.latestLinkId===a},lockLink:function(a){this.locked[a]=!0},isLinkLocked:function(a){return this.locked[a]}}),c}),define("common/switches",["underscore","remote/config","core/analytics/identity","core/utils/cookies"],function(a,b,c,d){"use strict";var e="disqusauth",f={};return f.getDisqusAuth=function(){var a=(d.read(e)||"").replace(/\"/g,"").split("|");return a[1]&&a[6]?{username:a[1],id:parseInt(a[6],10)}:{}},f.isFeatureActive=function(e){if("1"===d.read("switch:"+e))return!0;var g=(b.lounge&&b.lounge.switches||{})[e];if(!g)return!1;if(a.isNumber(g.percent)&&g.percent>=c.clientPercent())return!0;var h=f.getDisqusAuth();return a.contains(g.user_ids,h.id)?!0:!1},f}),function(a,b){"function"==typeof define&&define.amd?define("handlebars",[],b):"object"==typeof exports?module.exports=b():a.Handlebars=a.Handlebars||b()}(this,function(){var a=function(){"use strict";function a(a){this.string=a}var b;return a.prototype.toString=function(){return""+this.string},b=a}(),b=function(a){"use strict";function b(a){return i[a]}function c(a){for(var b=1;b":">",'"':""","'":"'","`":"`"},j=/[&<>"'`]/g,k=/[&<>"'`]/;g.extend=c;var l=Object.prototype.toString;g.toString=l;var m=function(a){return"function"==typeof a};m(/x/)&&(m=function(a){return"function"==typeof a&&"[object Function]"===l.call(a)});var m;g.isFunction=m;var n=Array.isArray||function(a){return a&&"object"==typeof a?"[object Array]"===l.call(a):!1};return g.isArray=n,g.escapeExpression=d,g.isEmpty=e,g.appendContextPath=f,g}(a),c=function(){"use strict";function a(a,b){var d;b&&b.firstLine&&(d=b.firstLine,a+=" - "+d+":"+b.firstColumn);for(var e=Error.prototype.constructor.call(this,a),f=0;f0?(c.ids&&(c.ids=[c.name]),a.helpers.each(b,c)):d(this);if(c.data&&c.ids){var g=q(c.data);g.contextPath=f.appendContextPath(c.data.contextPath,c.name),c={data:g}}return e(b,c)}),a.registerHelper("each",function(a,b){if(!b)throw new g("Must pass iterator to #each");var c,d,e=b.fn,h=b.inverse,i=0,j="";if(b.data&&b.ids&&(d=f.appendContextPath(b.data.contextPath,b.ids[0])+"."),l(a)&&(a=a.call(this)),b.data&&(c=q(b.data)),a&&"object"==typeof a)if(k(a))for(var m=a.length;m>i;i++)c&&(c.index=i,c.first=0===i,c.last=i===a.length-1,d&&(c.contextPath=d+i)),j+=e(a[i],{data:c});else for(var n in a)a.hasOwnProperty(n)&&(c&&(c.key=n,c.index=i,c.first=0===i,d&&(c.contextPath=d+n)),j+=e(a[n],{data:c}),i++);return 0===i&&(j=h(this)),j}),a.registerHelper("if",function(a,b){return l(a)&&(a=a.call(this)),!b.hash.includeZero&&!a||f.isEmpty(a)?b.inverse(this):b.fn(this)}),a.registerHelper("unless",function(b,c){return a.helpers["if"].call(this,b,{fn:c.inverse,inverse:c.fn,hash:c.hash})}),a.registerHelper("with",function(a,b){l(a)&&(a=a.call(this));var c=b.fn;if(f.isEmpty(a))return b.inverse(this);if(b.data&&b.ids){var d=q(b.data);d.contextPath=f.appendContextPath(b.data.contextPath,b.ids[0]),b={data:d}}return c(a,b)}),a.registerHelper("log",function(b,c){var d=c.data&&null!=c.data.level?parseInt(c.data.level,10):1;a.log(d,b)}),a.registerHelper("lookup",function(a,b){return a&&a[b]})}var e={},f=a,g=b,h="2.0.0";e.VERSION=h;var i=6;e.COMPILER_REVISION=i;var j={1:"<= 1.0.rc.2",2:"== 1.0.0-rc.3",3:"== 1.0.0-rc.4",4:"== 1.x.x",5:"== 2.0.0-alpha.x",6:">= 2.0.0-beta.1"};e.REVISION_CHANGES=j;var k=f.isArray,l=f.isFunction,m=f.toString,n="[object Object]";e.HandlebarsEnvironment=c,c.prototype={constructor:c,logger:o,log:p,registerHelper:function(a,b){if(m.call(a)===n){if(b)throw new g("Arg not supported with multiple helpers");f.extend(this.helpers,a)}else this.helpers[a]=b},unregisterHelper:function(a){delete this.helpers[a]},registerPartial:function(a,b){m.call(a)===n?f.extend(this.partials,a):this.partials[a]=b},unregisterPartial:function(a){delete this.partials[a]}};var o={methodMap:{0:"debug",1:"info",2:"warn",3:"error"},DEBUG:0,INFO:1,WARN:2,ERROR:3,level:3,log:function(a,b){if(o.level<=a){var c=o.methodMap[a];"undefined"!=typeof console&&console[c]&&console[c].call(console,b)}}};e.logger=o;var p=o.log;e.log=p;var q=function(a){var b=f.extend({},a);return b._parent=a,b};return e.createFrame=q,e}(b,c),e=function(a,b,c){"use strict";function d(a){var b=a&&a[0]||1,c=m;if(b!==c){if(c>b){var d=n[c],e=n[b];throw new l("Template was precompiled with an older version of Handlebars than the current runtime. Please update your precompiler to a newer version ("+d+") or downgrade your runtime to an older version ("+e+").")}throw new l("Template was precompiled with a newer version of Handlebars than the current runtime. Please update your runtime to a newer version ("+a[1]+").")}}function e(a,b){if(!b)throw new l("No environment passed to template");if(!a||!a.main)throw new l("Unknown template object: "+typeof a);b.VM.checkRevision(a.compiler);var c=function(c,d,e,f,g,h,i,j,m){g&&(f=k.extend({},f,g));var n=b.VM.invokePartial.call(this,c,e,f,h,i,j,m);if(null==n&&b.compile){var o={helpers:h,partials:i,data:j,depths:m};i[e]=b.compile(c,{data:void 0!==j,compat:a.compat},b),n=i[e](f,o)}if(null!=n){if(d){for(var p=n.split("\n"),q=0,r=p.length;r>q&&(p[q]||q+1!==r);q++)p[q]=d+p[q];n=p.join("\n")}return n}throw new l("The partial "+e+" could not be compiled when running in runtime-only mode")},d={lookup:function(a,b){for(var c=a.length,d=0;c>d;d++)if(a[d]&&null!=a[d][b])return a[d][b]},lambda:function(a,b){return"function"==typeof a?a.call(b):a},escapeExpression:k.escapeExpression,invokePartial:c,fn:function(b){return a[b]},programs:[],program:function(a,b,c){var d=this.programs[a],e=this.fn(a);return b||c?d=f(this,a,e,b,c):d||(d=this.programs[a]=f(this,a,e)),d},data:function(a,b){for(;a&&b--;)a=a._parent;return a},merge:function(a,b){var c=a||b;return a&&b&&a!==b&&(c=k.extend({},b,a)),c},noop:b.VM.noop,compilerInfo:a.compiler},e=function(b,c){c=c||{};var f=c.data;e._setup(c),!c.partial&&a.useData&&(f=i(b,f));var g;return a.useDepths&&(g=c.depths?[b].concat(c.depths):[b]),a.main.call(d,b,d.helpers,d.partials,f,g)};return e.isTop=!0,e._setup=function(c){c.partial?(d.helpers=c.helpers,d.partials=c.partials):(d.helpers=d.merge(c.helpers,b.helpers),a.usePartial&&(d.partials=d.merge(c.partials,b.partials)))},e._child=function(b,c,e){if(a.useDepths&&!e)throw new l("must pass parent depths");return f(d,b,a[b],c,e)},e}function f(a,b,c,d,e){var f=function(b,f){return f=f||{},c.call(a,b,a.helpers,a.partials,f.data||d,e&&[b].concat(e))};return f.program=b,f.depth=e?e.length:0,f}function g(a,b,c,d,e,f,g){var h={partial:!0,helpers:d,partials:e,data:f,depths:g};if(void 0===a)throw new l("The partial "+b+" could not be found");return a instanceof Function?a(c,h):void 0}function h(){return""}function i(a,b){return b&&"root"in b||(b=b?o(b):{},b.root=a),b}var j={},k=a,l=b,m=c.COMPILER_REVISION,n=c.REVISION_CHANGES,o=c.createFrame;return j.checkRevision=d,j.template=e,j.program=f,j.invokePartial=g,j.noop=h,j}(b,c,d),f=function(a,b,c,d,e){"use strict";var f,g=a,h=b,i=c,j=d,k=e,l=function(){var a=new g.HandlebarsEnvironment;return j.extend(a,g),a.SafeString=h,a.Exception=i,a.Utils=j,a.escapeExpression=j.escapeExpression,a.VM=k,a.template=function(b){return k.template(b,a)},a},m=l();return m.create=l,m["default"]=m,f=m}(d,a,c,b,e);return f}),define("core/config/urls",["common/urls"],function(a){"use strict";return a}),define("core/extensions/handlebars.helpers",["handlebars","core/strings","core/config/urls"],function(a,b,c){"use strict";var d=a.Utils;return a.registerHelper("any",function(){for(var a=arguments.length,b=0;a-1>b;b++)if(arguments[b])return arguments[b]}),a.registerHelper("eq",function(a,b){return a===b}),a.registerHelper("ne",function(a,b){return a!==b}),a.registerHelper("gt",function(a,b){return a>b}),a.registerHelper("lt",function(a,b){return b>a}),a.registerHelper("ge",function(a,b){return a>=b}),a.registerHelper("le",function(a,b){return b>=a}),a.registerHelper("typeof",function(a,b){return typeof a===b}),a.registerHelper("notNull",function(a){return null!==a}),a.registerHelper("if_any",function(){for(var a=arguments.length,b=arguments[a-1],c=0;a-1>c;c++)if(arguments[c])return b.fn(this);return b.inverse(this)}),a.registerHelper("if_all",function(){for(var a=arguments.length,b=arguments[a-1],c=0;a-1>c;c++)if(!arguments[c])return b.inverse(this);return b.fn(this)}),a.registerHelper("getPartial",function(b,c,d){return"undefined"==typeof d&&(d=c,c=this,a.Utils.extend(c,d.hash)),new a.SafeString(a.partials[b](c,d))}),a.registerHelper("gettext",function(){var c,e,f,g,h=arguments.length,i=arguments[h-1],j=i.hash,k=arguments[0],l=a.partials;k=b.get(k);for(f in j)j.hasOwnProperty(f)&&(e=new RegExp("%\\(("+f+")\\)s","gm"),c=j[f],g=c&&c.executePartial,g&&(c=l[c.partial].call(this,c.context,i)),void 0===c||null===c||"number"==typeof c&&isNaN(c)?c="":g||(c=d.escapeExpression(c)),k=k.replace(e,c.toString()));return new a.SafeString(k)}),a.registerHelper("urlfor",function(a){for(var b=a.split("."),d=b.length,e=c,f=0;e.hasOwnProperty(b[f])&&d>f;)e=e[b[f]],f++;return e}),a.registerHelper("html",function(b){return new a.SafeString(b||"")}),a.registerHelper("partial",function(b,c){a.registerPartial(b,c.fn)}),a.registerHelper("with",function(){var a=arguments.length,b=arguments[a-1],c=arguments[0];return 3===a?(c={},c[arguments[0]]=arguments[1]):"_window_"===c&&(c=window),b.fn(c)}),a.registerHelper("each",function(b,c){var d,e=c.fn,f=c.inverse,g=0,h="";if(c.data&&(d=a.createFrame(c.data)),b&&"object"==typeof b)if("[object Array]"===Object.prototype.toString.call(b))for(var i=b.length;i>g;g++)d&&(d.index=g,d.length=b.length),h+=e(b[g],{data:d});else for(var j in b)b.hasOwnProperty(j)&&(d&&(d.key=j),h+=e(b[j],{data:d}),g++);return 0===g&&(h=f(this)),h}),a.registerHelper("log",function(a){window.console.log(a,this)}),a.registerHelper("debug",function(){}),a.registerHelper("geturl",function(a){return a}),a.registerHelper("truncate",function(b,c){return b.length<=c?b:new a.SafeString(d.escapeExpression(b.slice(0,c))+"…")}),a.registerHelper("tag",function(b,c){var d=["<"+b],e=c.hash.text;delete c.hash.text;for(var f in c.hash)c.hash.hasOwnProperty(f)&&d.push(" "+f+'="'+c.hash[f]+'"');return d.push(">"+e+""),new a.SafeString(d.join(""))}),a}),define("common/templates",["handlebars","core/extensions/handlebars.helpers"],function(a){"use strict";function b(b,c){return a.partials[b](c||{})}function c(b){return a.partials[b]}return{render:b,getTemplate:c}}),define("common/views/mixins",["jquery","modernizr","underscore","remote/config","shared/urls","core/bus","common/bus","common/defines","common/utils","common/Session","common/switches"],function(a,b,c,d,e,f,g,h,i,j){"use strict";function k(){this._getStyleProperty=function(a){var b=this.forum.get("settings");return this.config.forceAutoStyles||"auto"===b[a]?this.config[a]:b[a]},this.getTypeface=function(){return this._getStyleProperty("typeface")},this.getColorScheme=function(){return this._getStyleProperty("colorScheme")},this.applyPublisherClasses=function(){var b=a("body");"serif"===this.getTypeface()&&b.addClass("serif"),"dark"===this.getColorScheme()&&b.addClass("dark")}}var l={proxyViewEvents:function(a){this.listenTo(a,"all",function(a){0===a.indexOf("uiAction:")&&this.trigger.apply(this,arguments)},this)}},m={showOnboardApp:function(a){b.sessionstorage&&sessionStorage.setItem("onboard.session",JSON.stringify(a.session.user.toJSON()));var d=c.pick(a,"threadId","forumId","forumPk","activeSection");h.browser.mobile?(d.fullscreen=!0,i.windowOpen(e.get("onboard",{f:a.forumId},d))):g.sendHostMessage("onboard.show",d),this.trigger("uiAction:onboardOpen")}},n={updateUserAvatarHelper:function(b,c){a("img[data-user="+b+'][data-role="user-avatar"]').attr("src",c)},updateUserNameHelper:function(b,d){var e='[data-user="'+b+'"][data-role="username"]';a("a"+e+", span"+e).html(c.escape(d))},bindProfileUIListeners:function(a){this.listenTo(a,{"change:avatar":function(){this.updateUserAvatarHelper(a.user.id,a.user.get("avatar").cache)},"change:name":function(){this.updateUserNameHelper(a.user.id,a.user.get("name"))}})}},o={toggleFollow:function(b){b.preventDefault(),b.stopPropagation();var c=b&&a(b.target).closest("a[data-user]").attr("data-user"),d=this.collection&&c?this.collection.get(c):this.user,e=j.get();return e.isLoggedOut()?(this.trigger("authenticating"),this.listenToOnce(e,"change:id",function(){e.isLoggedIn()&&this.follow(d)}),void e.authenticate("disqusDotcom")):void(d.get("isFollowing")?this.unfollow(d):this.follow(d)) },unfollow:function(a){a.unfollow(),f.trigger("uiAction:unfollowUser",a)},follow:function(a){a.follow(),f.trigger("uiAction:followUser",a)}},p={topEdgeOffset:0,bottomEdgeOffset:0,offset:null,calculateOffsetTop:function(){var a=this.$el.offset();return a.top||a.left?a.top:null},getOffset:function(){if(!this.offset){var a=this.calculateOffsetTop(),b=this.$el.height();c.isNumber(a)&&(this.offset={visibleTop:a+c.result(this,"topEdgeOffset"),visibleBottom:a+b-c.result(this,"bottomEdgeOffset"),offsetTop:a,height:b})}return this.offset},invalidateOffset:function(){this.offset=null},isVisible:function(a){var b=this.getRelativeScreenTop(a),c=this.getRelativeScreenBottom(a),d=this.getOffset();return d?d.offsetTop>=b&&d.visibleTop<=c||d.offsetTop+d.height<=c&&d.visibleBottom>=b:null},getRelativeScreenBottom:function(a){return a.pageOffset+a.height-a.frameOffset.top},getRelativeScreenTop:function(a){return a.pageOffset-a.frameOffset.top},isAboveOffset:function(a){var b=this.getOffset();return b?b.visibleTop<=a:null}};return{FollowButtonMixin:o,IsVisibleViewMixin:p,UiActionEventProxy:l,appliesPublisherClasses:k,ProfileHtmlHelpers:n,OnboardHelper:m}}),define("common/views/popup",["jquery","underscore","backbone","common/bus","common/models","common/utils","common/Session"],function(a,b,c,d,e,f,g){"use strict";var h=c.View.extend({el:document.body,events:{"click .overlay":"handleClick",keydown:"handleKeyPress","click [data-action=close]":"close"},initialize:function(){this.user=null,this.session=g.get(),this.fullscreen=!0,this.$overlay=this.$el.find(".overlay");var a=this;if(f.isIframed(window))this.listenTo(d,"init",this.bootstrap),this.listenTo(d,"open",this._open);else{var b=f.getConfigFromHash(window);a.bootstrap(b),a.load(b)}},handleClick:function(b){a(b.target).closest(this.containerId).length||this.close()},handleKeyPress:function(a){return 27===a.which?(a.preventDefault(),a.stopPropagation(),void this.close()):void 0},open:function(){f.isIframed(window)?d.sendHostMessage("openReady"):this._open()},_open:function(){this.trigger("open"),this.$overlay.addClass("active"),window.focus()},close:function(){var a=this;if(a.fullscreen){a.$overlay.removeClass("active");var c=f.transitionEndEvent;c?a.$overlay.one(c,function(){a._closeWindow()}):b.defer(b.bind(a._closeWindow,a))}},_closeWindow:function(){f.isIframed(window)?d.sendHostMessage("close"):window.close()},bootstrap:a.noop,load:a.noop});return{PopupManager:h}}),function(a){"use strict";a("when",[],function(){function a(a,c,d,e){return b(a).then(c,d,e)}function b(a){var b,c;return a instanceof d?b=a:h(a)?(c=g(),a.then(function(a){c.resolve(a)},function(a){c.reject(a)},function(a){c.progress(a)}),b=c.promise):b=e(a),b}function c(b){return a(b,f)}function d(a){this.then=a}function e(a){var c=new d(function(c){try{return b(c?c(a):a)}catch(d){return f(d)}});return c}function f(a){var c=new d(function(c,d){try{return d?b(d(a)):f(a)}catch(e){return f(e)}});return c}function g(){function a(a,b,c){return m(a,b,c)}function c(a){return o(a)}function e(a){return o(f(a))}function h(a){return n(a)}var i,j,k,l,m,n,o;return j=new d(a),i={then:a,resolve:c,reject:e,progress:h,promise:j,resolver:{resolve:c,reject:e,progress:h}},k=[],l=[],m=function(a,b,c){var d,e;return d=g(),e="function"==typeof c?function(a){try{d.progress(c(a))}catch(b){d.progress(b)}}:function(a){d.progress(a)},k.push(function(c){c.then(a,b).then(d.resolve,d.reject,e)}),l.push(e),d.promise},n=function(a){return p(l,a),a},o=function(a){return a=b(a),m=a.then,o=b,n=r,p(k,a),l=k=v,a},i}function h(a){return a&&"function"==typeof a.then}function i(b,c,d,e,f){return q(2,arguments),a(b,function(b){function h(a){p(a)}function i(a){o(a)}var j,k,l,m,n,o,p,q,s,t;if(s=b.length>>>0,j=Math.max(0,Math.min(c,s)),l=[],k=s-j+1,m=[],n=g(),j)for(q=n.progress,p=function(a){m.push(a),--k||(o=p=r,n.reject(m))},o=function(a){l.push(a),--j||(o=p=r,n.resolve(l))},t=0;s>t;++t)t in b&&a(b[t],i,h,q);else n.resolve(l);return n.then(d,e,f)})}function j(a,b,c,d){function e(a){return b?b(a[0]):a[0]}return i(a,1,e,c,d)}function k(a,b,c,d){return q(1,arguments),m(a,s).then(b,c,d)}function l(){return m(arguments,s)}function m(b,c){return a(b,function(b){var d,e,f,h,i,j;if(f=e=b.length>>>0,d=[],j=g(),f)for(h=function(b,e){a(b,c).then(function(a){d[e]=a,--f||j.resolve(d)},j.reject)},i=0;e>i;i++)i in b?h(b[i],i):--f;else j.resolve(d);return j.promise})}function n(b,c){var d=u.call(arguments,1);return a(b,function(b){var e;return e=b.length,d[0]=function(b,d,f){return a(b,function(b){return a(d,function(a){return c(b,a,f,e)})})},t.apply(b,d)})}function o(b,c,d){var e=arguments.length>2;return a(b,function(a){return a=e?d:a,c.resolve(a),a},function(a){return c.reject(a),f(a)},c.progress)}function p(a,b){for(var c,d=0;c=a[d++];)c(b)}function q(a,b){for(var c,d=b.length;d>a;)if(c=b[--d],null!=c&&"function"!=typeof c)throw new Error("arg "+d+" must be a function")}function r(){}function s(a){return a}var t,u,v;return a.defer=g,a.resolve=b,a.reject=c,a.join=l,a.all=k,a.map=m,a.reduce=n,a.any=j,a.some=i,a.chain=o,a.isPromise=h,d.prototype={always:function(a,b){return this.then(a,a,b)},otherwise:function(a){return this.then(v,a)},spread:function(a){return this.then(function(b){return k(b,function(b){return a.apply(v,b)})})}},u=[].slice,t=[].reduce||function(a){var b,c,d,e,f;if(f=0,b=Object(this),e=b.length>>>0,c=arguments,c.length<=1)for(;;){if(f in b){d=b[f++];break}if(++f>=e)throw new TypeError}else d=c[1];for(;e>f;++f)f in b&&(d=a(d,b[f],f,b));return d},a})}("function"==typeof define&&define.amd?define:function(a){"object"==typeof exports?module.exports=a():this.when=a()}),function(a,b){"use strict";function c(a,b){var c,d;b=b||{},a="raven"+a.substr(0,1).toUpperCase()+a.substr(1),document.createEvent?(c=document.createEvent("HTMLEvents"),c.initEvent(a,!0,!0)):(c=document.createEventObject(),c.eventType=a);for(d in b)j(b,d)&&(c[d]=b[d]);if(document.createEvent)document.dispatchEvent(c);else try{document.fireEvent("on"+c.eventType.toLowerCase(),c)}catch(e){}}function d(a){this.name="RavenConfigError",this.message=a}function e(a){var b=Q.exec(a),c={},e=7;try{for(;e--;)c[P[e]]=b[e]||""}catch(f){throw new d("Invalid DSN: "+a)}if(c.pass)throw new d("Do not specify your private key in the DSN!");return c}function f(a){return"undefined"==typeof a}function g(a){return"function"==typeof a}function h(a){return"string"==typeof a}function i(a){for(var b in a)return!1;return!0}function j(a,b){return Object.prototype.hasOwnProperty.call(a,b)}function k(a,b){var c,d;if(f(a.length))for(c in a)j(a,c)&&b.call(null,c,a[c]);else if(d=a.length)for(c=0;d>c;c++)b.call(null,c,a[c])}function l(){J="?sentry_version=4&sentry_client=raven-js/"+O.VERSION+"&sentry_key="+H}function m(a,b){var d=[];a.stack&&a.stack.length&&k(a.stack,function(a,b){var c=n(b);c&&d.push(c)}),c("handle",{stackInfo:a,options:b}),p(a.name,a.message,a.url,a.lineno,d,b)}function n(a){if(a.url){var b,c={filename:a.url,lineno:a.line,colno:a.column,"function":a.func||"?"},d=o(a);if(d){var e=["pre_context","context_line","post_context"];for(b=3;b--;)c[e[b]]=d[b]}return c.in_app=!(!M.includePaths.test(c.filename)||/(Raven|TraceKit)\./.test(c["function"])||/raven\.(min\.)?js$/.test(c.filename)),c}}function o(a){if(a.context&&M.fetchContext){for(var b=a.context,c=~~(b.length/2),d=b.length,e=!1;d--;)if(b[d].length>300){e=!0;break}if(e){if(f(a.column))return;return[[],b[c].substr(a.column,50),[]]}return[b.slice(0,c),b[c],b.slice(c+1)]}}function p(a,b,c,d,e,f){var g,h;b+="",("Error"!==a||b)&&(M.ignoreErrors.test(b)||(e&&e.length?(c=e[0].filename||c,e.reverse(),g={frames:e}):c&&(g={frames:[{filename:c,lineno:d,in_app:!0}]}),b=r(b,100),M.ignoreUrls&&M.ignoreUrls.test(c)||(!M.whitelistUrls||M.whitelistUrls.test(c))&&(h=d?b+" at "+d:b,t(q({exception:{type:a,value:b},stacktrace:g,culprit:c,message:h},f)))))}function q(a,b){return b?(k(b,function(b,c){a[b]=c}),a):a}function r(a,b){return a.length<=b?a:a.substr(0,b)+"…"}function s(){var a={url:document.location.href,headers:{"User-Agent":navigator.userAgent}};return document.referrer&&(a.headers.Referer=document.referrer),a}function t(a){v()&&(a=q({project:I,logger:M.logger,site:M.site,platform:"javascript",request:s()},a),a.tags=q(M.tags,a.tags),a.extra=q(M.extra,a.extra),i(a.tags)&&delete a.tags,i(a.extra)&&delete a.extra,G&&(a.user=G),g(M.dataCallback)&&(a=M.dataCallback(a)),(!g(M.shouldSendCallback)||M.shouldSendCallback(a))&&(E=a.event_id||(a.event_id=x()),u(a)))}function u(a){var b=new Image,d=F+J+"&sentry_data="+encodeURIComponent(JSON.stringify(a));b.onload=function(){c("success",{data:a,src:d})},b.onerror=b.onabort=function(){c("failure",{data:a,src:d})},b.src=d}function v(){return L?F?!0:(y("error","Error: Raven has not been configured."),!1):!1}function w(a){for(var b,c=[],d=0,e=a.length;e>d;d++)b=a[d],h(b)?c.push(b.replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1")):b&&b.source&&c.push(b.source);return new RegExp(c.join("|"),"i")}function x(){return"xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx".replace(/[xy]/g,function(a){var b=16*Math.random()|0,c="x"==a?b:3&b|8;return c.toString(16)})}function y(b,c){a.console&&console[b]&&O.debug&&console[b](c)}function z(){var b=a.RavenConfig;b&&O.config(b.dsn,b.config).install()}var A={remoteFetching:!1,collectWindowErrors:!0,linesOfContext:7},B=[].slice,C="?";A.wrap=function(a){function b(){try{return a.apply(this,arguments)}catch(b){throw A.report(b),b}}return b},A.report=function(){function c(a){h(),o.push(a)}function d(a){for(var b=o.length-1;b>=0;--b)o[b]===a&&o.splice(b,1)}function e(){i(),o=[]}function f(a,b){var c=null;if(!b||A.collectWindowErrors){for(var d in o)if(j(o,d))try{o[d].apply(null,[a].concat(B.call(arguments,2)))}catch(e){c=e}if(c)throw c}}function g(a,b,c,d,e){var g=null;if(r)A.computeStackTrace.augmentStackTraceWithInitialElement(r,b,c,a),k();else if(e)g=A.computeStackTrace(e),f(g,!0);else{var h={url:b,line:c,column:d};h.func=A.computeStackTrace.guessFunctionName(h.url,h.line),h.context=A.computeStackTrace.gatherContext(h.url,h.line),g={message:a,url:document.location.href,stack:[h]},f(g,!0)}return m?m.apply(this,arguments):!1}function h(){n||(m=a.onerror,a.onerror=g,n=!0)}function i(){n&&(a.onerror=m,n=!1,m=b)}function k(){var a=r,b=p;p=null,r=null,q=null,f.apply(null,[a,!1].concat(b))}function l(b,c){var d=B.call(arguments,1);if(r){if(q===b)return;k()}var e=A.computeStackTrace(b);if(r=e,q=b,p=d,a.setTimeout(function(){q===b&&k()},e.incomplete?2e3:0),c!==!1)throw b}var m,n,o=[],p=null,q=null,r=null;return l.subscribe=c,l.unsubscribe=d,l.uninstall=e,l}(),A.computeStackTrace=function(){function b(b){if(!A.remoteFetching)return"";try{var c=function(){try{return new a.XMLHttpRequest}catch(b){return new a.ActiveXObject("Microsoft.XMLHTTP")}},d=c();return d.open("GET",b,!1),d.send(""),d.responseText}catch(e){return""}}function c(a){if(!h(a))return[];if(!j(v,a)){var c="";-1!==a.indexOf(document.domain)&&(c=b(a)),v[a]=c?c.split("\n"):[]}return v[a]}function d(a,b){var d,e=/function ([^(]*)\(([^)]*)\)/,g=/['"]?([0-9A-Za-z$_]+)['"]?\s*[:=]\s*(function|eval|new Function)/,h="",i=10,j=c(a);if(!j.length)return C;for(var k=0;i>k;++k)if(h=j[b-k]+h,!f(h)){if(d=g.exec(h))return d[1];if(d=e.exec(h))return d[1]}return C}function e(a,b){var d=c(a);if(!d.length)return null;var e=[],g=Math.floor(A.linesOfContext/2),h=g+A.linesOfContext%2,i=Math.max(0,b-g-1),j=Math.min(d.length,b+h-1);b-=1;for(var k=i;j>k;++k)f(d[k])||e.push(d[k]);return e.length>0?e:null}function g(a){return a.replace(/[\-\[\]{}()*+?.,\\\^$|#]/g,"\\$&")}function i(a){return g(a).replace("<","(?:<|<)").replace(">","(?:>|>)").replace("&","(?:&|&)").replace('"','(?:"|")').replace(/\s+/g,"\\s+")}function k(a,b){for(var d,e,f=0,g=b.length;g>f;++f)if((d=c(b[f])).length&&(d=d.join("\n"),e=a.exec(d)))return{url:b[f],line:d.substring(0,e.index).split("\n").length,column:e.index-d.lastIndexOf("\n",e.index)-1};return null}function l(a,b,d){var e,f=c(b),h=new RegExp("\\b"+g(a)+"\\b");return d-=1,f&&f.length>d&&(e=h.exec(f[d]))?e.index:null}function m(b){for(var c,d,e,f,h=[a.location.href],j=document.getElementsByTagName("script"),l=""+b,m=/^function(?:\s+([\w$]+))?\s*\(([\w\s,]*)\)\s*\{\s*(\S[\s\S]*\S)\s*\}\s*$/,n=/^function on([\w$]+)\s*\(event\)\s*\{\s*(\S[\s\S]*\S)\s*\}\s*$/,o=0;om;++m){if(b=h.exec(i[m]))c={url:b[3],func:b[1]||C,args:b[2]?b[2].split(","):"",line:+b[4],column:b[5]?+b[5]:null};else{if(!(b=g.exec(i[m])))continue;c={url:b[2],func:b[1]||C,line:+b[3],column:b[4]?+b[4]:null}}!c.func&&c.line&&(c.func=d(c.url,c.line)),c.line&&(c.context=e(c.url,c.line)),j.push(c)}return j.length?(j[0].line&&!j[0].column&&k?j[0].column=l(k[1],j[0].url,j[0].line):j[0].column||f(a.columnNumber)||(j[0].column=a.columnNumber+1),{name:a.name,message:a.message,url:document.location.href,stack:j}):null}function o(a){for(var b,c=a.stacktrace,f=/ line (\d+), column (\d+) in (?:]+)>|([^\)]+))\((.*)\) in (.*):\s*$/i,g=c.split("\n"),h=[],i=0,j=g.length;j>i;i+=2)if(b=f.exec(g[i])){var k={line:+b[1],column:+b[2],func:b[3]||b[4],args:b[5]?b[5].split(","):[],url:b[6]};if(!k.func&&k.line&&(k.func=d(k.url,k.line)),k.line)try{k.context=e(k.url,k.line)}catch(l){}k.context||(k.context=[g[i+1]]),h.push(k)}return h.length?{name:a.name,message:a.message,url:document.location.href,stack:h}:null}function p(b){var f=b.message.split("\n");if(f.length<4)return null;var g,h,l,m,n=/^\s*Line (\d+) of linked script ((?:file|https?)\S+)(?:: in function (\S+))?\s*$/i,o=/^\s*Line (\d+) of inline#(\d+) script in ((?:file|https?)\S+)(?:: in function (\S+))?\s*$/i,p=/^\s*Line (\d+) of function script\s*$/i,q=[],r=document.getElementsByTagName("script"),s=[];for(h in r)j(r,h)&&!r[h].src&&s.push(r[h]);for(h=2,l=f.length;l>h;h+=2){var t=null;if(g=n.exec(f[h]))t={url:g[2],func:g[3],line:+g[1]};else if(g=o.exec(f[h])){t={url:g[3],func:g[4]};var u=+g[1],v=s[g[2]-1];if(v&&(m=c(t.url))){m=m.join("\n");var w=m.indexOf(v.innerText);w>=0&&(t.line=u+m.substring(0,w).split("\n").length)}}else if(g=p.exec(f[h])){var x=a.location.href.replace(/#.*$/,""),y=g[1],z=new RegExp(i(f[h+1]));m=k(z,[x]),t={url:x,line:m?m.line:y,func:""}}if(t){t.func||(t.func=d(t.url,t.line));var A=e(t.url,t.line),B=A?A[Math.floor(A.length/2)]:null;t.context=A&&B.replace(/^\s*/,"")===f[h+1].replace(/^\s*/,"")?A:[f[h+1]],q.push(t)}}return q.length?{name:b.name,message:f[0],url:document.location.href,stack:q}:null}function q(a,b,c,f){var g={url:b,line:c};if(g.url&&g.line){a.incomplete=!1,g.func||(g.func=d(g.url,g.line)),g.context||(g.context=e(g.url,g.line));var h=/ '([^']+)' /.exec(f);if(h&&(g.column=l(h[1],g.url,g.line)),a.stack.length>0&&a.stack[0].url===g.url){if(a.stack[0].line===g.line)return!1;if(!a.stack[0].line&&a.stack[0].func===g.func)return a.stack[0].line=g.line,a.stack[0].context=g.context,!1}return a.stack.unshift(g),a.partial=!0,!0}return a.incomplete=!0,!1}function r(a,b){for(var c,e,f,g=/function\s+([_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*)?\s*\(/i,h=[],i={},j=!1,k=r.caller;k&&!j;k=k.caller)if(k!==s&&k!==A.report){if(e={url:null,func:C,line:null,column:null},k.name?e.func=k.name:(c=g.exec(k.toString()))&&(e.func=c[1]),f=m(k)){e.url=f.url,e.line=f.line,e.func===C&&(e.func=d(e.url,e.line));var n=/ '([^']+)' /.exec(a.message||a.description);n&&(e.column=l(n[1],f.url,f.line))}i[""+k]?j=!0:i[""+k]=!0,h.push(e)}b&&h.splice(0,b);var o={name:a.name,message:a.message,url:document.location.href,stack:h};return q(o,a.sourceURL||a.fileName,a.line||a.lineNumber,a.message||a.description),o}function s(a,b){var c=null;b=null==b?0:+b;try{if(c=o(a))return c}catch(d){if(u)throw d}try{if(c=n(a))return c}catch(d){if(u)throw d}try{if(c=p(a))return c}catch(d){if(u)throw d}try{if(c=r(a,b+1))return c}catch(d){if(u)throw d}return{}}function t(a){a=(null==a?0:+a)+1;try{throw new Error}catch(b){return s(b,a+1)}}var u=!1,v={};return s.augmentStackTraceWithInitialElement=q,s.guessFunctionName=d,s.gatherContext=e,s.ofCaller=t,s}();var D,E,F,G,H,I,J,K=a.Raven,L=!(!a.JSON||!a.JSON.stringify),M={logger:"javascript",ignoreErrors:[],ignoreUrls:[],whitelistUrls:[],includePaths:[],collectWindowErrors:!0,tags:{},extra:{}},N=!1,O={VERSION:"1.1.16",debug:!0,noConflict:function(){return a.Raven=K,O},config:function(a,b){if(F)return y("error","Error: Raven has already been configured"),O;if(!a)return O;var c=e(a),d=c.path.lastIndexOf("/"),f=c.path.substr(1,d);return b&&k(b,function(a,b){M[a]=b}),M.ignoreErrors.push("Script error."),M.ignoreErrors.push("Script error"),M.ignoreErrors.push("Javascript error: Script error on line 0"),M.ignoreErrors.push("Javascript error: Script error. on line 0"),M.ignoreErrors=w(M.ignoreErrors),M.ignoreUrls=M.ignoreUrls.length?w(M.ignoreUrls):!1,M.whitelistUrls=M.whitelistUrls.length?w(M.whitelistUrls):!1,M.includePaths=w(M.includePaths),H=c.user,I=c.path.substr(d+1),F="//"+c.host+(c.port?":"+c.port:"")+"/"+f+"api/"+I+"/store/",c.protocol&&(F=c.protocol+":"+F),M.fetchContext&&(A.remoteFetching=!0),M.linesOfContext&&(A.linesOfContext=M.linesOfContext),A.collectWindowErrors=!!M.collectWindowErrors,l(),O},install:function(){return v()&&!N&&(A.report.subscribe(m),N=!0),O},context:function(a,c,d){return g(a)&&(d=c||[],c=a,a=b),O.wrap(a,c).apply(this,d)},wrap:function(a,c){function d(){for(var b=[],d=arguments.length,e=!a||a&&a.deep!==!1;d--;)b[d]=e?O.wrap(a,arguments[d]):arguments[d];try{return c.apply(this,b)}catch(f){throw O.captureException(f,a),f}}if(f(c)&&!g(a))return a;if(g(a)&&(c=a,a=b),!g(c))return c;if(c.__raven__)return c;for(var e in c)j(c,e)&&(d[e]=c[e]);return d.__raven__=!0,d.__inner__=c,d},uninstall:function(){return A.report.uninstall(),N=!1,O},captureException:function(a,b){if(!(a instanceof Error))return O.captureMessage(a,b);D=a;try{A.report(a,b)}catch(c){if(a!==c)throw c}return O},captureMessage:function(a,b){return t(q({message:a+""},b)),O},setUserContext:function(a){return G=a,O},setExtraContext:function(a){return M.extra=a||{},O},setTagsContext:function(a){return M.tags=a||{},O},lastException:function(){return D},lastEventId:function(){return E}};O.setUser=O.setUserContext;var P="source protocol user pass host port path".split(" "),Q=/^(?:(\w+):)?\/\/(\w+)(:\w+)?@([\w\.-]+)(?::(\d+))?(\/.*)/;d.prototype=new Error,d.prototype.constructor=d,z(),a.Raven=O,"function"==typeof define&&define.amd&&define("raven",[],function(){return O})}(this),function(){for(var a=0,b=["webkit","moz"],c=0;c