Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

0.4.3 - Atom support / Stackoverflow & twitter fixs

  • Loading branch information...
commit 07c603972fd331e8f75ee4303844ff5f229fe04c 1 parent c18e3c7
@christianv authored
View
2  download/js/script.min.js
@@ -1 +1 @@
-function fetchServices(){$.n("Fetching available services..."),$.ajax({url:"services.json",dataType:"json"}).done(buildUI).fail(function(){$.n.error("Could not load service list. Please try reloading page.")})}function buildUI(e){$.n(e.length+" services available"),function(n,t,i,o,r){for(t=0,i=$("legend"),o=$('<div class="col"></div>').insertAfter(i);n>t;++t,i=o,o=$('<div class="col"></div>').insertAfter(i))for(r=t;r<e.length;r+=n)o.append('<div><label for="'+e[r]+'">'+'<input type="checkbox" id="'+e[r]+'">'+e[r]+"</label></div>")}(4),checkboxes=$('input[type="checkbox"]').extend({enable:function(){return this.each(function(){$(this).removeAttr("disabled")}),this},disable:function(){return this.each(function(){$(this).attr("disabled","disabled")}),this}}),buttons.build.disable().click(function(e){e.preventDefault(),build()}),$("form").delegate('form input[type="checkbox"]',"change",function(){var e=0;return function(){this.checked?e++:e--,"undefined"!=typeof uglify&&(e>0?buttons.build.enable():buttons.build.disable())}}()),Downloadify.create("button-bar",{filename:function(){return"jquery.lifestream.custom.min.js"},data:function(){return builtScript},onComplete:onDownloadComplete,onError:function(){alert("You must put something in the File Contents or there will be nothing to save!")},transparent:!1,swf:"js/downloadify.swf",downloadImage:"img/download.png",width:100,height:30,append:!0}),setTimeout(function(){buttons.download=$("#button-bar > object").extend({enable:function(){return this.css({visibility:"visible"}),this},disable:function(){return this.css({visibility:"hidden"}),this}}),buttons.download.disable()},0),$.n("Loading UglifyJS..."),$.getScript("js/uglifyjs-cs.min.js").fail(function(){$.n.error("Could not load UglifyJS. Please reload the page")}).done(function(){$.n("UglifyJS received")})}function build(){$.n("Build started"),checkboxes.disable(),buttons.build.disable(),buildScript($('input[type="checkbox"]').filter(":checked").map(function(){return $(this).attr("id")}).get(),onBuildCompleted,onBuildFailure)}function onBuildCompleted(e){$.n("Build completed"),builtScript=e,buttons.download.enable()}function onBuildFailure(){$.n.error("Build failed, please retry"),builtScript="",checkboxes.enable(),buttons.build.enable()}function onDownloadComplete(){checkboxes.enable(),buttons.download.disable(),buttons.build.enable()}function buildScript(e,n,t){function i(e,n){"abort"==n?$.n.error("Aborted "+this.url):$.n.error("Could not retrieve module "+this.url+": "+e.status)}var o=[],r=[];$.n("Fetching src modules..."),$.ajax({url:"../src/core.js",dataType:"text",cache:!1}).fail(function(){i.apply(this,arguments),t()}).done(function(a){o.push(a),$.whenArray(r=$.map(e,function(e){return $.ajax({url:"../src/services/"+e+".js",dataType:"text",cache:!1}).done(function(e){o.push(e)}).fail(function(){i.apply(this,arguments)})})).done(function(){$.n("All src moduled received"),$.n("Uglification..."),n(uglify(o.join(";")))}).fail(function(){var e,n;for(e=0;e<r.length;++e)n=r[e],n.isResolved()||n.abort();t()})})}function parseQueryString(){var e={};window.location.search.replace(new RegExp("([^?=&]+)(=([^&]*))?","g"),function(n,t,i,o){e[t]=o}),e.mock="true"===e.mock,e.mock?($.n("Fetching Mockjax..."),$.getScript("js/jquery.mockjax.min.js").fail(function(){$.n.warning("Could not load Mockjax")}).done(function(){$.n("Received Mockjax");var n={errorProb:.5,minTime:0,maxTime:1e4};e.errorProb&&(e.errorProb=Number(e.errorProb)),e.minTime&&(e.minTime=Number(e.minTime)),e.maxTime&&(e.maxTime=Number(e.maxTime)),$.extend(n,e),$.n("Start mocking: "+JSON.stringify(n)),$.mockjax(function(e){var t=Math.random()<n.errorProb,i={responseTime:n.minTime+Math.random()*(n.maxTime-n.minTime)};return t?i.status=404:i.proxy=e.url,i})}).always(fetchServices)):fetchServices()}var buttons={build:$("#button").extend({enable:function(){return this.removeAttr("disabled"),this},disable:function(){return this.attr("disabled","disabled"),this}}).disable(),download:void 0},checkboxes,builtScript="";$.whenArray=function(e){return $.when.apply(this,e)},$.n.defaults.timeout=16e3,parseQueryString();
+function fetchServices(){$.n("Fetching available services..."),$.ajax({url:"services.json",dataType:"json"}).done(buildUI).fail(function(){$.n.error("Could not load service list. Please try reloading page.")})}function buildUI(e){$.n(e.length+" services available"),function(n,t,i,o,r){for(t=0,i=$("legend"),o=$('<div class="col"></div>').insertAfter(i);n>t;++t,i=o,o=$('<div class="col"></div>').insertAfter(i))for(r=t;r<e.length;r+=n)o.append('<div><label for="'+e[r]+'"><input type="checkbox" id="'+e[r]+'">'+e[r]+"</label></div>")}(4),checkboxes=$('input[type="checkbox"]').extend({enable:function(){return this.each(function(){$(this).removeAttr("disabled")}),this},disable:function(){return this.each(function(){$(this).attr("disabled","disabled")}),this}}),buttons.build.disable().click(function(e){e.preventDefault(),build()}),$("form").delegate('form input[type="checkbox"]',"change",function(){var e=0;return function(){this.checked?e++:e--,"undefined"!=typeof uglify&&(e>0?buttons.build.enable():buttons.build.disable())}}()),Downloadify.create("button-bar",{filename:function(){return"jquery.lifestream.custom.min.js"},data:function(){return builtScript},onComplete:onDownloadComplete,onError:function(){alert("You must put something in the File Contents or there will be nothing to save!")},transparent:!1,swf:"js/downloadify.swf",downloadImage:"img/download.png",width:100,height:30,append:!0}),setTimeout(function(){buttons.download=$("#button-bar > object").extend({enable:function(){return this.css({visibility:"visible"}),this},disable:function(){return this.css({visibility:"hidden"}),this}}),buttons.download.disable()},0),$.n("Loading UglifyJS..."),$.getScript("js/uglifyjs-cs.min.js").fail(function(){$.n.error("Could not load UglifyJS. Please reload the page")}).done(function(){$.n("UglifyJS received")})}function build(){$.n("Build started"),checkboxes.disable(),buttons.build.disable(),buildScript($('input[type="checkbox"]').filter(":checked").map(function(){return $(this).attr("id")}).get(),onBuildCompleted,onBuildFailure)}function onBuildCompleted(e){$.n("Build completed"),builtScript=e,buttons.download.enable()}function onBuildFailure(){$.n.error("Build failed, please retry"),builtScript="",checkboxes.enable(),buttons.build.enable()}function onDownloadComplete(){checkboxes.enable(),buttons.download.disable(),buttons.build.enable()}function buildScript(e,n,t){function i(e,n){$.n.error("abort"==n?"Aborted "+this.url:"Could not retrieve module "+this.url+": "+e.status)}var o=[],r=[];$.n("Fetching src modules..."),$.ajax({url:"../src/core.js",dataType:"text",cache:!1}).fail(function(){i.apply(this,arguments),t()}).done(function(a){o.push(a),$.whenArray(r=$.map(e,function(e){return $.ajax({url:"../src/services/"+e+".js",dataType:"text",cache:!1}).done(function(e){o.push(e)}).fail(function(){i.apply(this,arguments)})})).done(function(){$.n("All src moduled received"),$.n("Uglification..."),n(uglify(o.join(";")))}).fail(function(){var e,n;for(e=0;e<r.length;++e)n=r[e],n.isResolved()||n.abort();t()})})}function parseQueryString(){var e={};window.location.search.replace(new RegExp("([^?=&]+)(=([^&]*))?","g"),function(n,t,i,o){e[t]=o}),e.mock="true"===e.mock,e.mock?($.n("Fetching Mockjax..."),$.getScript("js/jquery.mockjax.min.js").fail(function(){$.n.warning("Could not load Mockjax")}).done(function(){$.n("Received Mockjax");var n={errorProb:.5,minTime:0,maxTime:1e4};e.errorProb&&(e.errorProb=Number(e.errorProb)),e.minTime&&(e.minTime=Number(e.minTime)),e.maxTime&&(e.maxTime=Number(e.maxTime)),$.extend(n,e),$.n("Start mocking: "+JSON.stringify(n)),$.mockjax(function(e){var t=Math.random()<n.errorProb,i={responseTime:n.minTime+Math.random()*(n.maxTime-n.minTime)};return t?i.status=404:i.proxy=e.url,i})}).always(fetchServices)):fetchServices()}var buttons={build:$("#button").extend({enable:function(){return this.removeAttr("disabled"),this},disable:function(){return this.attr("disabled","disabled"),this}}).disable(),download:void 0},checkboxes,builtScript="";$.whenArray=function(e){return $.when.apply(this,e)},$.n.defaults.timeout=16e3,parseQueryString();
View
4 download/js/uglifyjs-cs.min.js
@@ -1,2 +1,2 @@
-!function(){function u(u,n){n||(n={});var r=t("./parse-js"),e=t("./process"),i=r.parse(u,n.strict_semicolons);i=e.ast_mangle(i,n.mangle_options),i=e.ast_squeeze(i,n.squeeze_options);var o=e.gen_code(i,n.gen_options);return o}var n={"./parse-js":{},"./process":{},"./squeeze-more":{}},t=function(u){return n[u]};Array.prototype.reduce||(Array.prototype.reduce=function(u){var n,t,r=this.length;if("function"!=typeof u)throw new TypeError("First argument is not callable");if((0==r||null===r)&&arguments.length<=1)throw new TypeError("Array length is 0 and no second argument");if(arguments.length<=1){for(n=0;n=r;)throw new TypeError("Empty array and no second argument");t=this[n++]}else t=arguments[1];for(n=n||0;r>n;n++)n in this&&(t=u.call(void 0,t,this[n],n,this));return t}),Array.prototype.forEach||(Array.prototype.forEach=function(u,n){var t,r=Object(this),e=r.length>>>0,i=0;if(!u||!u.call)throw new TypeError;for(n&&(t=n);e>i;){var o,a=String(i),c=r.hasOwnProperty(a);c&&(o=r[a],u.call(t,o,i,r)),i++}}),function(u){function n(u){return j.letter.test(u)}function t(u){return u=u.charCodeAt(0),u>=48&&57>=u}function r(u){return t(u)||n(u)}function e(u){return j.non_spacing_mark.test(u)||j.space_combining_mark.test(u)}function i(u){return j.connector_punctuation.test(u)}function o(u){return"$"==u||"_"==u||n(u)}function a(u){return o(u)||e(u)||t(u)||i(u)||"‌"==u||"‍"==u}function c(u){return b.test(u)?parseInt(u.substr(2),16):_.test(u)?parseInt(u.substr(1),8):x.test(u)?parseFloat(u):void 0}function s(u,n,t,r){this.message=u,this.line=n,this.col=t,this.pos=r;try{({})()}catch(e){this.stack=e.stack}}function f(u,n,t,r){throw new s(u,n,t,r)}function l(u,n,t){return u.type==n&&(null==t||u.value==t)}function A(u){function n(){return P.text.charAt(P.pos)}function e(u){var n=P.text.charAt(P.pos++);if(u&&!n)throw z;return"\n"==n?(P.newline_before=!0,++P.line,P.col=0):++P.col,n}function i(u,n){var t=P.text.indexOf(u,P.pos);if(n&&-1==t)throw z;return t}function s(){P.tokline=P.line,P.tokcol=P.col,P.tokpos=P.pos}function l(u,n,t){P.regex_allowed="operator"==u&&!E(T,n)||"keyword"==u&&E(m,n)||"punc"==u&&E(O,n);var r={type:u,value:n,line:P.tokline,col:P.tokcol,pos:P.tokpos,nlb:P.newline_before};return t||(r.comments_before=P.comments_before,P.comments_before=[]),P.newline_before=!1,r}function A(){for(;E(S,n());)e()}function h(u){for(var t="",r=n(),i=0;r&&u(r,i++);)t+=e(),r=n();return t}function p(u){f(u,P.tokline,P.tokcol,P.tokpos)}function C(u){var n=!1,t=!1,e=!1,i="."==u,o=h(function(o,a){return"x"==o||"X"==o?e?!1:e=!0:e||"E"!=o&&"e"!=o?"-"==o?t||0==a&&!u?!0:!1:"+"==o?t:(t=!1,"."==o?i||e?!1:i=!0:r(o)):n?!1:n=t=!0});u&&(o=u+o);var a=c(o);return isNaN(a)?(p("Invalid syntax: "+o),void 0):l("num",a)}function v(){var u=e(!0);switch(u){case"n":return"\n";case"r":return"\r";case"t":return" ";case"b":return"\b";case"v":return" ";case"f":return"\f";case"0":return"\0";case"x":return String.fromCharCode(B(2));case"u":return String.fromCharCode(B(4));default:return u}}function B(u){for(var n=0;u>0;--u){var t=parseInt(e(!0),16);isNaN(t)&&p("Invalid hex-character pattern in string"),n=n<<4|t}return n}function F(){return N("Unterminated string constant",function(){for(var u=e(),n="";;){var t=e(!0);if("\\"==t)t=v();else if(t==u)break;n+=t}return l("string",n)})}function D(){e();var u,n=i("\n");return-1==n?(u=P.text.substr(P.pos),P.pos=P.text.length):(u=P.text.substring(P.pos,n),P.pos=n),l("comment1",u,!0)}function g(){return e(),N("Unterminated multiline comment",function(){var u=i("*/",!0),n=P.text.substring(P.pos,u),t=l("comment2",n,!0);return P.pos=u+2,P.line+=n.split("\n").length-1,P.newline_before=n.indexOf("\n")>=0,/^@cc_on/i.test(n)&&(U("WARNING: at line "+P.line),U('*** Found "conditional comment": '+n),U("*** UglifyJS DISCARDS ALL COMMENTS. This means your code might no longer work properly in Internet Explorer.")),t})}function y(){for(var u,t=!1,r="";null!=(u=n());)if(t)"u"!=u&&p("Expecting UnicodeEscapeSequence -- uXXXX"),u=v(),a(u)||p("Unicode char: "+u.charCodeAt(0)+" is not valid in identifier"),r+=u,t=!1;else if("\\"==u)t=!0,e();else{if(!a(u))break;r+=e()}return r}function b(){return N("Unterminated regular expression",function(){for(var u,n=!1,t="",r=!1;u=e(!0);)if(n)t+="\\"+u,n=!1;else if("["==u)r=!0,t+=u;else if("]"==u&&r)r=!1,t+=u;else{if("/"==u&&!r)break;"\\"==u?n=!0:t+=u}var i=y();return l("regexp",[t,i])})}function _(u){function t(u){if(!n())return u;var r=u+n();return E(q,r)?(e(),t(r)):u}return l("operator",t(u||e()))}function x(){e();var u=P.regex_allowed;switch(n()){case"/":return P.comments_before.push(D()),P.regex_allowed=u,I();case"*":return P.comments_before.push(g()),P.regex_allowed=u,I()}return P.regex_allowed?b():_("/")}function j(){return e(),t(n())?C("."):l("punc",".")}function $(){var u=y();return E(d,u)?E(q,u)?l("operator",u):E(w,u)?l("atom",u):l("keyword",u):l("name",u)}function N(u,n){try{return n()}catch(t){if(t!==z)throw t;p(u)}}function I(u){if(u)return b();A(),s();var r=n();return r?t(r)?C():'"'==r||"'"==r?F():E(R,r)?l("punc",e()):"."==r?j():"/"==r?x():E(k,r)?_():"\\"==r||o(r)?$():(p("Unexpected character '"+r+"'"),void 0):l("eof")}var P={text:u.replace(/\r\n?|[\n\u2028\u2029]/g,"\n").replace(/^\uFEFF/,""),pos:0,tokpos:0,line:0,tokline:0,col:0,tokcol:0,newline_before:!1,regex_allowed:!1,comments_before:[]};return I.context=function(u){return u&&(P=u),P},I}function h(u,n,t){this.name=u,this.start=n,this.end=t}function p(u,n,t){function r(u,n){return l(on.token,u,n)}function e(){return on.peeked||(on.peeked=on.input())}function i(){return on.prev=on.token,on.peeked?(on.token=on.peeked,on.peeked=null):on.token=on.input(),on.token}function o(){return on.prev}function a(u,n,t,r){var e=on.input.context();f(u,null!=n?n:e.tokline,null!=t?t:e.tokcol,null!=r?r:e.tokpos)}function c(u,n){a(n,u.line,u.col)}function s(u){null==u&&(u=on.token),c(u,"Unexpected token: "+u.type+" ("+u.value+")")}function p(u,n){return r(u,n)?i():(c(on.token,"Unexpected token "+on.token.type+", expected "+u),void 0)}function B(u){return p("punc",u)}function D(){return!n&&(on.token.nlb||r("eof")||r("punc","}"))}function d(){r("punc",";")?i():D()||s()}function y(){return F(arguments)}function m(){B("(");var u=ln();return B(")"),u}function w(u,n,t){return u instanceof h?u:new h(u,n,t)}function k(u){return t?function(){var n=on.token,t=u.apply(this,arguments);return t[0]=w(t[0],n,o()),t}:u}function b(u){on.labels.push(u);var t=on.token,r=an();return n&&!E(P,r[0])&&s(t),on.labels.pop(),y("label",u,r)}function _(){return y("stat",v(ln,d))}function x(u){var n;return D()||(n=r("name")?on.token.value:null),null!=n?(i(),g(n,on.labels)||a("Label "+n+" without matching loop or statement")):0==on.in_loop&&a(u+" not inside a loop or switch"),d(),y(u,n)}function q(){B("(");var u=null;return!r("punc",";")&&(u=r("keyword","var")?(i(),W(!0)):ln(!0,!0),r("operator","in"))?O(u):S(u)}function S(u){B(";");var n=r("punc",";")?null:ln();B(";");var t=r("punc",")")?null:ln();return B(")"),y("for",u,n,t,en(an))}function O(u){var n="var"==u[0]?y("name",u[1][0]):u;i();var t=ln();return B(")"),y("for-in",u,n,t,en(an))}function R(){var u,n=m(),t=an();return r("keyword","else")&&(i(),u=an()),y("if",n,t,u)}function j(){B("{");for(var u=[];!r("punc","}");)r("eof")&&s(),u.push(an());return i(),u}function z(){var u,n,t=j();if(r("keyword","catch")){i(),B("("),r("name")||a("Name expected");var e=on.token.value;i(),B(")"),u=[e,j()]}return r("keyword","finally")&&(i(),n=j()),u||n||a("Missing catch/finally blocks"),y("try",t,u,n)}function U(u){for(var n=[];;){r("name")||s();var t=on.token.value;if(i(),r("operator","=")?(i(),n.push([t,ln(!1,u)])):n.push([t]),!r("punc",","))break;i()}return n}function W(u){return y("var",U(u))}function K(){return y("const",U())}function X(){var u,n=fn(!1);return r("punc","(")?(i(),u=L(")")):u=[],H(y("new",n,u),!0)}function L(u,n,t){for(var e=!0,o=[];!r("punc",u)&&(e?e=!1:B(","),!n||!r("punc",u));)r("punc",",")&&t?o.push(["atom","undefined"]):o.push(ln(!1));return i(),o}function Y(){return y("array",L("]",!n,!0))}function J(){for(var u=!0,t=[];!r("punc","}")&&(u?u=!1:B(","),n||!r("punc","}"));){var e=on.token.type,o=V();"name"!=e||"get"!=o&&"set"!=o||r("punc",":")?(B(":"),t.push([o,ln(!1)])):t.push([G(),cn(!1),o])}return i(),y("object",t)}function V(){switch(on.token.type){case"num":case"string":return v(on.token.value,i)}return G()}function G(){switch(on.token.type){case"name":case"operator":case"keyword":case"atom":return v(on.token.value,i);default:s()}}function H(u,n){return r("punc",".")?(i(),H(y("dot",u,G()),n)):r("punc","[")?(i(),H(y("sub",u,v(ln,C(B,"]"))),n)):n&&r("punc","(")?(i(),H(y("call",u,L(")")),!0)):n&&r("operator")&&E(T,on.token.value)?v(C(Q,"unary-postfix",on.token.value,u),i):u}function Q(u,n,t){return"++"!=n&&"--"!=n||tn(t)||a("Invalid use of "+n+" operator"),y(u,n,t)}function Z(u,n,t){var e=r("operator")?on.token.value:null;e&&"in"==e&&t&&(e=null);var o=null!=e?I[e]:null;if(null!=o&&o>n){i();var a=Z(fn(!0),o,t);return Z(y("binary",e,u,a),n,t)}return u}function un(u){return Z(fn(!0),0,u)}function nn(u){var n=un(u);if(r("operator","?")){i();var t=ln(!1);return B(":"),y("conditional",n,t,ln(!1,u))}return n}function tn(u){if(!n)return!0;switch(u[0]){case"dot":case"sub":case"new":case"call":return!0;case"name":return"this"!=u[1]}}function rn(u){var n=nn(u),t=on.token.value;if(r("operator")&&E(N,t)){if(tn(n))return i(),y("assign",N[t],n,rn(u));a("Invalid assignment")}return n}function en(u){try{return++on.in_loop,u()}finally{--on.in_loop}}var on={input:"string"==typeof u?A(u,!0):u,token:null,prev:null,peeked:null,in_function:0,in_loop:0,labels:[]};on.token=i();var an=k(function(){switch(r("operator","/")&&(on.peeked=null,on.token=on.input(!0)),on.token.type){case"num":case"string":case"regexp":case"operator":case"atom":return _();case"name":return l(e(),"punc",":")?b(v(on.token.value,i,i)):_();case"punc":switch(on.token.value){case"{":return y("block",j());case"[":case"(":return _();case";":return i(),y("block");default:s()}case"keyword":switch(v(on.token.value,i)){case"break":return x("break");case"continue":return x("continue");case"debugger":return d(),y("debugger");case"do":return function(u){return p("keyword","while"),y("do",v(m,d),u)}(en(an));case"for":return q();case"function":return cn(!0);case"if":return R();case"return":return 0==on.in_function&&a("'return' outside of function"),y("return",r("punc",";")?(i(),null):D()?null:v(ln,d));case"switch":return y("switch",m(),sn());case"throw":return y("throw",v(ln,d));case"try":return z();case"var":return v(W,d);case"const":return v(K,d);case"while":return y("while",m(),en(an));case"with":return y("with",m(),an());default:s()}}}),cn=k(function(u){var n=r("name")?v(on.token.value,i):null;return u&&!n&&s(),B("("),y(u?"defun":"function",n,function(u,n){for(;!r("punc",")");)u?u=!1:B(","),r("name")||s(),n.push(on.token.value),i();return i(),n}(!0,[]),function(){++on.in_function;var u=on.in_loop;on.in_loop=0;var n=j();return--on.in_function,on.in_loop=u,n}())}),sn=C(en,function(){B("{");for(var u=[],n=null;!r("punc","}");)r("eof")&&s(),r("keyword","case")?(i(),n=[],u.push([ln(),n]),B(":")):r("keyword","default")?(i(),B(":"),n=[],u.push([null,n])):(n||s(),n.push(an()));return i(),u}),fn=k(function(u){if(r("operator","new"))return i(),X();if(r("operator")&&E($,on.token.value))return Q("unary-prefix",v(on.token.value,i),fn(u));if(r("punc")){switch(on.token.value){case"(":return i(),H(v(ln,C(B,")")),u);case"[":return i(),H(Y(),u);case"{":return i(),H(J(),u)}s()}if(r("keyword","function"))return i(),H(cn(!1),u);if(E(M,on.token.type)){var n="regexp"==on.token.type?y("regexp",on.token.value[0],on.token.value[1]):y(on.token.type,on.token.value);return H(v(n,i),u)}s()}),ln=k(function(u,n){0==arguments.length&&(u=!0);var t=rn(n);return u&&r("punc",",")?(i(),y("seq",t,ln(!0,n))):t});return y("toplevel",function(u){for(;!r("eof");)u.push(an());return u}([]))}function C(u){var n=F(arguments,1);return function(){return u.apply(this,n.concat(F(arguments)))}}function v(u){u instanceof Function&&(u=u());for(var n=1,t=arguments.length;--t>0;++n)arguments[n]();return u}function B(u){for(var n={},t=0;t<u.length;++t)n[u[t]]=!0;return n}function F(u,n){return Array.prototype.slice.call(u,null==n?0:n)}function D(u){return u.split("")}function g(u,n){for(var t=n.length;--t>=0;)if(n[t]===u)return!0;return!1}function E(u,n){return Object.prototype.hasOwnProperty.call(u,n)}var d=B(["break","case","catch","const","continue","default","delete","do","else","finally","for","function","if","in","instanceof","new","return","switch","throw","try","typeof","var","void","while","with"]),y=B(["abstract","boolean","byte","char","class","debugger","double","enum","export","extends","final","float","goto","implements","import","int","interface","long","native","package","private","protected","public","short","static","super","synchronized","throws","transient","volatile"]),m=B(["return","new","delete","throw","else","case"]),w=B(["false","null","true","undefined"]),k=B(D("+-*&%=<>!?|~^")),b=/^0x[0-9a-f]+$/i,_=/^0[0-7]+$/,x=/^\d*\.?\d*(?:e[+-]?\d*(?:\d\.?|\.?\d)\d*)?$/i,q=B(["in","instanceof","typeof","new","void","delete","++","--","+","-","!","~","&","|","^","*","/","%",">>","<<",">>>","<",">","<=",">=","==","===","!=","!==","?","=","+=","-=","/=","*=","%=",">>=","<<=",">>>=","|=","^=","&=","&&","||"]),S=B(D("  \n\r \f ​")),O=B(D("[{}(,.;:")),R=B(D("[]{}(),;:"));B(D("gmsiy"));var j={letter:new RegExp("[\\u0041-\\u005A\\u0061-\\u007A\\u00AA\\u00B5\\u00BA\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u0523\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0621-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971\\u0972\\u097B-\\u097F\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C33\\u0C35-\\u0C39\\u0C3D\\u0C58\\u0C59\\u0C60\\u0C61\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDE\\u0CE0\\u0CE1\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D28\\u0D2A-\\u0D39\\u0D3D\\u0D60\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC\\u0EDD\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8B\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10D0-\\u10FA\\u10FC\\u1100-\\u1159\\u115F-\\u11A2\\u11A8-\\u11F9\\u1200-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u1676\\u1681-\\u169A\\u16A0-\\u16EA\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1877\\u1880-\\u18A8\\u18AA\\u1900-\\u191C\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19A9\\u19C1-\\u19C7\\u1A00-\\u1A16\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u2094\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2183\\u2184\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2C6F\\u2C71-\\u2C7D\\u2C80-\\u2CE4\\u2D00-\\u2D25\\u2D30-\\u2D65\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005\\u3006\\u3031-\\u3035\\u303B\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31B7\\u31F0-\\u31FF\\u3400\\u4DB5\\u4E00\\u9FC3\\uA000-\\uA48C\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA65F\\uA662-\\uA66E\\uA67F-\\uA697\\uA717-\\uA71F\\uA722-\\uA788\\uA78B\\uA78C\\uA7FB-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA90A-\\uA925\\uA930-\\uA946\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAC00\\uD7A3\\uF900-\\uFA2D\\uFA30-\\uFA6A\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]"),non_spacing_mark:new RegExp("[\\u0300-\\u036F\\u0483-\\u0487\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u0610-\\u061A\\u064B-\\u065E\\u0670\\u06D6-\\u06DC\\u06DF-\\u06E4\\u06E7\\u06E8\\u06EA-\\u06ED\\u0711\\u0730-\\u074A\\u07A6-\\u07B0\\u07EB-\\u07F3\\u0816-\\u0819\\u081B-\\u0823\\u0825-\\u0827\\u0829-\\u082D\\u0900-\\u0902\\u093C\\u0941-\\u0948\\u094D\\u0951-\\u0955\\u0962\\u0963\\u0981\\u09BC\\u09C1-\\u09C4\\u09CD\\u09E2\\u09E3\\u0A01\\u0A02\\u0A3C\\u0A41\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A70\\u0A71\\u0A75\\u0A81\\u0A82\\u0ABC\\u0AC1-\\u0AC5\\u0AC7\\u0AC8\\u0ACD\\u0AE2\\u0AE3\\u0B01\\u0B3C\\u0B3F\\u0B41-\\u0B44\\u0B4D\\u0B56\\u0B62\\u0B63\\u0B82\\u0BC0\\u0BCD\\u0C3E-\\u0C40\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C62\\u0C63\\u0CBC\\u0CBF\\u0CC6\\u0CCC\\u0CCD\\u0CE2\\u0CE3\\u0D41-\\u0D44\\u0D4D\\u0D62\\u0D63\\u0DCA\\u0DD2-\\u0DD4\\u0DD6\\u0E31\\u0E34-\\u0E3A\\u0E47-\\u0E4E\\u0EB1\\u0EB4-\\u0EB9\\u0EBB\\u0EBC\\u0EC8-\\u0ECD\\u0F18\\u0F19\\u0F35\\u0F37\\u0F39\\u0F71-\\u0F7E\\u0F80-\\u0F84\\u0F86\\u0F87\\u0F90-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u102D-\\u1030\\u1032-\\u1037\\u1039\\u103A\\u103D\\u103E\\u1058\\u1059\\u105E-\\u1060\\u1071-\\u1074\\u1082\\u1085\\u1086\\u108D\\u109D\\u135F\\u1712-\\u1714\\u1732-\\u1734\\u1752\\u1753\\u1772\\u1773\\u17B7-\\u17BD\\u17C6\\u17C9-\\u17D3\\u17DD\\u180B-\\u180D\\u18A9\\u1920-\\u1922\\u1927\\u1928\\u1932\\u1939-\\u193B\\u1A17\\u1A18\\u1A56\\u1A58-\\u1A5E\\u1A60\\u1A62\\u1A65-\\u1A6C\\u1A73-\\u1A7C\\u1A7F\\u1B00-\\u1B03\\u1B34\\u1B36-\\u1B3A\\u1B3C\\u1B42\\u1B6B-\\u1B73\\u1B80\\u1B81\\u1BA2-\\u1BA5\\u1BA8\\u1BA9\\u1C2C-\\u1C33\\u1C36\\u1C37\\u1CD0-\\u1CD2\\u1CD4-\\u1CE0\\u1CE2-\\u1CE8\\u1CED\\u1DC0-\\u1DE6\\u1DFD-\\u1DFF\\u20D0-\\u20DC\\u20E1\\u20E5-\\u20F0\\u2CEF-\\u2CF1\\u2DE0-\\u2DFF\\u302A-\\u302F\\u3099\\u309A\\uA66F\\uA67C\\uA67D\\uA6F0\\uA6F1\\uA802\\uA806\\uA80B\\uA825\\uA826\\uA8C4\\uA8E0-\\uA8F1\\uA926-\\uA92D\\uA947-\\uA951\\uA980-\\uA982\\uA9B3\\uA9B6-\\uA9B9\\uA9BC\\uAA29-\\uAA2E\\uAA31\\uAA32\\uAA35\\uAA36\\uAA43\\uAA4C\\uAAB0\\uAAB2-\\uAAB4\\uAAB7\\uAAB8\\uAABE\\uAABF\\uAAC1\\uABE5\\uABE8\\uABED\\uFB1E\\uFE00-\\uFE0F\\uFE20-\\uFE26]"),space_combining_mark:new RegExp("[\\u0903\\u093E-\\u0940\\u0949-\\u094C\\u094E\\u0982\\u0983\\u09BE-\\u09C0\\u09C7\\u09C8\\u09CB\\u09CC\\u09D7\\u0A03\\u0A3E-\\u0A40\\u0A83\\u0ABE-\\u0AC0\\u0AC9\\u0ACB\\u0ACC\\u0B02\\u0B03\\u0B3E\\u0B40\\u0B47\\u0B48\\u0B4B\\u0B4C\\u0B57\\u0BBE\\u0BBF\\u0BC1\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCC\\u0BD7\\u0C01-\\u0C03\\u0C41-\\u0C44\\u0C82\\u0C83\\u0CBE\\u0CC0-\\u0CC4\\u0CC7\\u0CC8\\u0CCA\\u0CCB\\u0CD5\\u0CD6\\u0D02\\u0D03\\u0D3E-\\u0D40\\u0D46-\\u0D48\\u0D4A-\\u0D4C\\u0D57\\u0D82\\u0D83\\u0DCF-\\u0DD1\\u0DD8-\\u0DDF\\u0DF2\\u0DF3\\u0F3E\\u0F3F\\u0F7F\\u102B\\u102C\\u1031\\u1038\\u103B\\u103C\\u1056\\u1057\\u1062-\\u1064\\u1067-\\u106D\\u1083\\u1084\\u1087-\\u108C\\u108F\\u109A-\\u109C\\u17B6\\u17BE-\\u17C5\\u17C7\\u17C8\\u1923-\\u1926\\u1929-\\u192B\\u1930\\u1931\\u1933-\\u1938\\u19B0-\\u19C0\\u19C8\\u19C9\\u1A19-\\u1A1B\\u1A55\\u1A57\\u1A61\\u1A63\\u1A64\\u1A6D-\\u1A72\\u1B04\\u1B35\\u1B3B\\u1B3D-\\u1B41\\u1B43\\u1B44\\u1B82\\u1BA1\\u1BA6\\u1BA7\\u1BAA\\u1C24-\\u1C2B\\u1C34\\u1C35\\u1CE1\\u1CF2\\uA823\\uA824\\uA827\\uA880\\uA881\\uA8B4-\\uA8C3\\uA952\\uA953\\uA983\\uA9B4\\uA9B5\\uA9BA\\uA9BB\\uA9BD-\\uA9C0\\uAA2F\\uAA30\\uAA33\\uAA34\\uAA4D\\uAA7B\\uABE3\\uABE4\\uABE6\\uABE7\\uABE9\\uABEA\\uABEC]"),connector_punctuation:new RegExp("[\\u005F\\u203F\\u2040\\u2054\\uFE33\\uFE34\\uFE4D-\\uFE4F\\uFF3F]")};s.prototype.toString=function(){return this.message+" (line: "+this.line+", col: "+this.col+", pos: "+this.pos+")"+"\n\n"+this.stack};var z={},$=B(["typeof","void","delete","--","++","!","~","-","+"]),T=B(["--","++"]),N=function(u,n,t){for(;t<u.length;)n[u[t]]=u[t].substr(0,u[t].length-1),t++;return n}(["+=","-=","/=","*=","%=",">>=","<<=",">>>=","|=","^=","&="],{"=":!0},0),I=function(u,n){for(var t=0,r=1;t<u.length;++t,++r)for(var e=u[t],i=0;i<e.length;++i)n[e[i]]=r;return n}([["||"],["&&"],["|"],["^"],["&"],["==","===","!=","!=="],["<",">","<=",">=","in","instanceof"],[">>","<<",">>>"],["+","-"],["*","/","%"]],{}),P=B(["for","do","while","switch"]),M=B(["atom","num","string","regexp","name"]);h.prototype.toString=function(){return this.name};var U=function(){};u.tokenizer=A,u.parse=p,u.slice=F,u.curry=C,u.member=g,u.array_to_hash=B,u.PRECEDENCE=I,u.KEYWORDS_ATOM=w,u.RESERVED_WORDS=y,u.KEYWORDS=d,u.ATOMIC_START_TOKEN=M,u.OPERATORS=q,u.is_alphanumeric_char=r,u.set_logger=function(u){U=u}}(n["./parse-js"]),function(u){function n(){function u(u){return[this[0],q(u,function(u){var n=[u[0]];return u.length>1&&(n[1]=t(u[1])),n})]}function n(u){var n=[this[0]];return null!=u&&n.push(q(u,t)),n}function t(u){if(null==u)return null;try{o.push(u);var n=u[0],t=i[n];if(t){var r=t.apply(u,u.slice(1));if(null!=r)return r}return t=e[n],t.apply(u,u.slice(1))}finally{o.pop()}}function r(u,n){var t,r={};for(t in u)y(u,t)&&(r[t]=i[t],i[t]=u[t]);var e=n();for(t in r)y(r,t)&&(r[t]?i[t]=r[t]:delete i[t]);return e}var e={string:function(u){return[this[0],u]},num:function(u){return[this[0],u]},name:function(u){return[this[0],u]},toplevel:function(u){return[this[0],q(u,t)]},block:n,splice:n,"var":u,"const":u,"try":function(u,n,r){return[this[0],q(u,t),null!=n?[n[0],q(n[1],t)]:null,null!=r?q(r,t):null]},"throw":function(u){return[this[0],t(u)]},"new":function(u,n){return[this[0],t(u),q(n,t)]},"switch":function(u,n){return[this[0],t(u),q(n,function(u){return[u[0]?t(u[0]):null,q(u[1],t)]})]},"break":function(u){return[this[0],u]},"continue":function(u){return[this[0],u]},conditional:function(u,n,r){return[this[0],t(u),t(n),t(r)]},assign:function(u,n,r){return[this[0],u,t(n),t(r)]},dot:function(u){return[this[0],t(u)].concat(w(arguments,1))},call:function(u,n){return[this[0],t(u),q(n,t)]},"function":function(u,n,r){return[this[0],u,n.slice(),q(r,t)]},defun:function(u,n,r){return[this[0],u,n.slice(),q(r,t)]},"if":function(u,n,r){return[this[0],t(u),t(n),t(r)]},"for":function(u,n,r,e){return[this[0],t(u),t(n),t(r),t(e)]},"for-in":function(u,n,r,e){return[this[0],t(u),t(n),t(r),t(e)]},"while":function(u,n){return[this[0],t(u),t(n)]},"do":function(u,n){return[this[0],t(u),t(n)]},"return":function(u){return[this[0],t(u)]},binary:function(u,n,r){return[this[0],u,t(n),t(r)]},"unary-prefix":function(u,n){return[this[0],u,t(n)]},"unary-postfix":function(u,n){return[this[0],u,t(n)]},sub:function(u,n){return[this[0],t(u),t(n)]},object:function(u){return[this[0],q(u,function(u){return 2==u.length?[u[0],t(u[1])]:[u[0],t(u[1]),u[2]]})]},regexp:function(u,n){return[this[0],u,n]},array:function(u){return[this[0],q(u,t)]},stat:function(u){return[this[0],t(u)]},seq:function(){return[this[0]].concat(q(w(arguments),t))},label:function(u,n){return[this[0],u,t(n)]},"with":function(u,n){return[this[0],t(u),t(n)]},atom:function(u){return[this[0],u]}},i={},o=[];return{walk:t,with_walkers:r,parent:function(){return o[o.length-2]},stack:function(){return o}}}function r(u){this.names={},this.mangled={},this.rev_mangled={},this.cname=-1,this.refs={},this.uses_with=!1,this.uses_eval=!1,this.parent=u,this.children=[],u?(this.level=u.level+1,u.children.push(this)):this.level=0}function e(u){function t(u){a=new r(a);var n=a.body=u();return n.scope=a,a=a.parent,n}function e(u){return a.define(u)}function i(u){a.refs[u]=!0}function o(u,n,r){var i="defun"==this[0];return[this[0],i?e(u):u,n,t(function(){return i||e(u),q(n,e),q(r,s)})]}var a=null,c=n(),s=c.walk,f=[];return t(function(){function n(u,t){for(t=u.children.length;--t>=0;)n(u.children[t]);for(t in u.refs)if(y(u.refs,t))for(var r=u.has(t),e=u;e&&(e.refs[t]=r,e!==r);e=e.parent);}var t=c.with_walkers({"function":o,defun:o,"with":function(){for(var u=a;u;u=u.parent)u.uses_with=!0},"var":function(u){q(u,function(u){e(u[0])})},"const":function(u){q(u,function(u){e(u[0])})},"try":function(u,n,t){return null!=n?[this[0],q(u,s),[e(n[0]),q(n[1],s)],null!=t?q(t,s):null]:void 0},name:function(u){"eval"==u&&f.push(a),i(u)}},function(){return s(u)});return q(f,function(u){if(!u.has("eval"))for(;u;)u.uses_eval=!0,u=u.parent}),n(a),t})}function i(u,t){function r(u,n){return t.toplevel||s.parent?t.except&&k(u,t.except)?u:s.get_mangled(u,n):u}function i(u){return t.defines?!s.has(u)&&y(t.defines,u)?t.defines[u]:null:void 0}function o(u,n,t){var e,i="defun"==this[0];return u&&(i?u=r(u):(e={},s.uses_eval||s.uses_with?e[u]=u:u=e[u]=s.next_mangled())),t=a(t.scope,function(){return n=q(n,function(u){return r(u)}),q(t,l)},e),[this[0],u,n,t]}function a(u,n,t){var e=s;if(s=u,t)for(var i in t)y(t,i)&&u.set_mangle(i,t[i]);for(var i in u.names)y(u.names,i)&&r(i,!0);var o=n();return o.scope=u,s=e,o}function c(u){return[this[0],q(u,function(u){return[r(u[0]),l(u[1])]})]}var s,f=n(),l=f.walk;return t=t||{},f.with_walkers({"function":o,defun:function(){var u=o.apply(this,arguments);switch(f.parent()[0]){case"toplevel":case"function":case"defun":return q.at_top(u)}return u},"var":c,"const":c,name:function(u){return i(u)||[this[0],r(u)]},"try":function(u,n,t){return[this[0],q(u,l),null!=n?[r(n[0]),q(n[1],l)]:null,null!=t?q(t,l):null]},toplevel:function(u){var n=this;return a(n.scope,function(){return[n[0],q(u,l)]})}},function(){return l(e(u))})}function o(u,n){return F(u).length>F("stat"==n[0]?n[1]:n).length?n:u}function a(u){return"block"==u[0]&&u[1]&&u[1].length>0?u[1][u[1].length-1]:u}function c(u){return u&&(u=a(u),"return"==u[0]||"break"==u[0]||"continue"==u[0]||"throw"==u[0])?!0:void 0}function s(u){return"unary-prefix"==u[0]&&k(u[1],["!","delete"])||"binary"==u[0]&&k(u[1],["in","instanceof","==","!=","===","!==","<","<=",">=",">"])||"binary"==u[0]&&k(u[1],["&&","||"])&&s(u[2])&&s(u[3])||"conditional"==u[0]&&s(u[2])&&s(u[3])||"assign"==u[0]&&u[1]===!0&&s(u[3])||"seq"==u[0]&&s(u[u.length-1])}function f(u,n,t){var r=function(){return"unary-prefix"==u[0]&&"!"==u[1]?t?["conditional",u[2],t,n]:["binary","||",u[2],n]:t?["conditional",u,n,t]:["binary","&&",u,n]};return O(u,function(u,r){return h(r?t:n),r?n:t},r)}function l(u){return!u||"block"==u[0]&&(!u[1]||0==u[1].length)}function A(u){return"string"==u[0]||"unary-prefix"==u[0]&&"typeof"==u[1]||"binary"==u[0]&&"+"==u[1]&&(A(u[2])||A(u[3]))}function h(u){l(u)||S("Dropping unreachable code: "+F(u,!0))}function p(u){function t(u){u=q(u,o);for(var n=0;n<u.length;++n){var r=u[n];if(!("if"!=r[0]||r[3]&&o(r[3]))){var e=o(r[2]);if(c(e)){var i,a=o(r[1]),s=u.slice(n+1);i=1==s.length?s[0]:["block",s];var f=u.slice(0,n).concat([[r[0],a,e,i]]);return t(f)}}}return u}function r(u,n,r){return r=t(r),[this[0],u,n.slice(),r]}function e(u){var n=[this[0]];return null!=u&&n.push(t(u)),n}var i=n(),o=i.walk;return i.with_walkers({defun:r,"function":r,block:e,splice:e,toplevel:function(u){return[this[0],t(u)]},"try":function(u,n,r){return[this[0],t(u),null!=n?[n[0],t(n[1])]:null,null!=r?t(r):null]},"with":function(u,n){return[this[0],o(u),t(n)]}},function(){return o(u)})}function C(u,t){function r(u){var n=["unary-prefix","!",u];switch(u[0]){case"unary-prefix":return"!"==u[1]&&s(u[2])?u[2]:n;case"seq":return u=w(u),u[u.length-1]=r(u[u.length-1]),u;case"conditional":return o(n,["conditional",u[1],r(u[2]),r(u[3])]);case"binary":var e=u[1],i=u[2],a=u[3];if(!t.keep_comps)switch(e){case"<=":return["binary",">",i,a];case"<":return["binary",">=",i,a];case">=":return["binary","<",i,a];case">":return["binary","<=",i,a]}switch(e){case"==":return["binary","!=",i,a];case"!=":return["binary","==",i,a];case"===":return["binary","!==",i,a];case"!==":return["binary","===",i,a];case"&&":return o(n,["binary","||",r(i),r(a)]);case"||":return o(n,["binary","&&",r(i),r(a)])}}return n}function i(u,n){var t=m;m=u;var r=n();return r.scope=u,m=t,r}function A(u){return null!=u&&"block"==u[0]&&u[1]&&(1==u[1].length?u=u[1][0]:0==u[1].length&&(u=["block"])),u}function C(u,n,t){var r="defun"==this[0];return t=i(t.scope,function(){var n=v(q(t,_),"lambda");return r||!u||y(m.refs,u)||(u=null),n}),[this[0],u,n,t]}function v(u,n){return u=u.reduce(function(u,n){return"block"==n[0]?n[1]&&u.push.apply(u,n[1]):u.push(n),u},[]),u=function(n,t){return u.forEach(function(u){t&&("var"==u[0]&&"var"==t[0]||"const"==u[0]&&"const"==t[0])?t[1]=t[1].concat(u[1]):(n.push(u),t=u)}),n}([]),t.dead_code&&(u=function(n,r){return u.forEach(function(u){r?k(u[0],["function","defun","var","const"])?n.push(u):t.no_warnings||h(u):(n.push(u),k(u[0],["return","throw","break","continue"])&&(r=!0))}),n}([])),t.make_seqs&&(u=function(n,t){return u.forEach(function(u){t&&"stat"==t[0]&&"stat"==u[0]?t[1]=["seq",t[1],u[1]]:(n.push(u),t=u)}),n}([])),"lambda"==n&&(u=function(n,t,e){for(;n<u.length;){if(e=u[n++],"if"==e[0]&&!e[3]){if("return"==e[2][0]&&null==e[2][1]){t.push(B(r(e[1]),["block",u.slice(n)]));break}var i=a(e[2]);if("return"==i[0]&&null==i[1]){t.push(B(e[1],["block",e[2][1].slice(0,-1)],["block",u.slice(n)]));break}}t.push(e)}return t}(0,[])),u}function B(u,n,t){return O(u,function(u,r){return r?(h(t),n):(h(n),t)},function(){return D(u,n,t)})}function D(u,n,t){if(u=_(u),n=_(n),t=_(t),l(n)?(u=r(u),n=t,t=null):l(t)?t=null:function(){var e=F(u),i=r(u),o=F(i);if(o.length<e.length){var a=n;n=t,t=a,u=i}}(),l(t)&&l(n))return["stat",u];var e=["if",u,n,t];return"if"==n[0]&&l(n[3])&&l(t)?e=o(e,_(["if",["binary","&&",u,n[1]],n[2]])):"stat"==n[0]?t?"stat"==t[0]&&(e=o(e,["stat",f(u,n[1],t[1])])):e=o(e,["stat",f(u,n[1])]):t&&n[0]==t[0]&&("return"==n[0]||"throw"==n[0])&&n[1]&&t[1]?e=o(e,[n[0],f(u,n[1],t[1])]):t&&c(n)?(e=[["if",u,n]],"block"==t[0]?t[1]&&(e=e.concat(t[1])):e.push(t),e=_(["block",e])):n&&c(t)&&(e=[["if",r(u),t]],"block"==n[0]?n[1]&&(e=e.concat(n[1])):e.push(n),e=_(["block",e])),e}function g(u,n){return O(u,function(u,t){return t?["for",null,null,null,_(n)]:(h(n),["block"])})}t=E(t,{make_seqs:!0,dead_code:!0,keep_comps:!0,no_warnings:!1});var m,b=n(),_=b.walk;return u=p(u),u=e(u),b.with_walkers({sub:function(u,n){if("string"==n[0]){var t=n[1];if(d(t))return["dot",_(u),t];if(/^[1-9][0-9]*$/.test(t)||"0"===t)return["sub",_(u),["num",parseInt(t,10)]]}},"if":B,toplevel:function(u){return["toplevel",i(this.scope,function(){return v(q(u,_))})]},"switch":function(u,n){var t=n.length-1;return["switch",_(u),q(n,function(u,n){var r=v(q(u[1],_));if(n==t&&r.length>0){var e=r[r.length-1];
-"break"!=e[0]||e[1]||r.pop()}return[u[0]?_(u[0]):null,r]})]},"function":C,defun:C,block:function(u){return u?A(["block",v(q(u,_))]):void 0},binary:function(u,n,t){return O(["binary",u,_(n),_(t)],function(u){return o(_(u),this)},function(){return this})},conditional:function(u,n,t){return f(_(u),_(n),_(t))},"try":function(u,n,t){return["try",v(q(u,_)),null!=n?[n[0],v(q(n[1],_))]:null,null!=t?v(q(t,_)):null]},"unary-prefix":function(u,n){n=_(n);var t=["unary-prefix",u,n];return"!"==u&&(t=o(t,r(n))),O(t,function(u){return _(u)},function(){return t})},name:function(u){switch(u){case"true":return["unary-prefix","!",["num",0]];case"false":return["unary-prefix","!",["num",1]]}},"new":function(u,n){return"name"!=u[0]||"Array"!=u[1]||m.has("Array")?void 0:1!=n.length?["array",n]:["call",["name","Array"],n]},call:function(u,n){return"name"!=u[0]||"Array"!=u[1]||1==n.length||m.has("Array")?void 0:["array",n]},"while":g},function(){return _(u)})}function v(u,n){var t=0,r=0;return u=u.replace(/[\\\b\f\n\r\t\x22\x27\u2028\u2029]/g,function(u){switch(u){case"\\":return"\\\\";case"\b":return"\\b";case"\f":return"\\f";case"\n":return"\\n";case"\r":return"\\r";case" ":return"\\t";case"\u2028":return"\\u2028";case"\u2029":return"\\u2029";case'"':return++t,'"';case"'":return++r,"'"}return u}),n&&(u=B(u)),t>r?"'"+u.replace(/\x27/g,"\\'")+"'":'"'+u.replace(/\x22/g,'\\"')+'"'}function B(u){return u.replace(/[\u0080-\uffff]/g,function(u){for(var n=u.charCodeAt(0).toString(16);n.length<4;)n="0"+n;return"\\u"+n})}function F(u,t){function r(u){return v(u,t.ascii_only)}function e(u){return u=u.toString(),t.ascii_only&&(u=B(u)),u}function i(u){return null==u&&(u=""),z&&(u=g(" ",t.indent_start+$*t.indent_level)+u),u}function o(u,n){null==n&&(n=1),$+=n;try{return u.apply(null,w(arguments,1))}finally{$-=n}}function a(u){if(z)return u.join(" ");for(var n=[],t=0;t<u.length;++t){var r=u[t+1];n.push(u[t]),r&&(/[a-z0-9_\x24]$/i.test(u[t].toString())&&/^[a-z0-9_\x24]/i.test(r.toString())||/[\+\-]$/.test(u[t].toString())&&/^[\+\-]/.test(r.toString()))&&n.push(" ")}return n.join("")}function c(u){return u.join(","+N)}function s(u){for(var n=O(u),t=1;t<arguments.length;++t){var r=arguments[t];if(r instanceof Function&&r(u)||u[0]==r)return"("+n+")"}return n}function f(u){if(1==u.length)return u[0];if(2==u.length){var n=u[1];return u=u[0],u.length<=n.length?u:n}return f([u[0],f(u.slice(1))])}function A(u){if("function"==u[0]||"object"==u[0])for(var n=w(P),t=n.pop(),r=n.pop();r;){if("stat"==r[0])return!0;if(("seq"!=r[0]&&"call"!=r[0]&&"dot"!=r[0]&&"sub"!=r[0]&&"conditional"!=r[0]||r[1]!==t)&&("binary"!=r[0]&&"assign"!=r[0]&&"unary-postfix"!=r[0]||r[2]!==t))return!1;t=r,r=n.pop()}return!y(R,u[0])}function h(u){var n,t=u.toString(10),r=[t.replace(/^0\./,".")];return Math.floor(u)===u?(r.push("0x"+u.toString(16).toLowerCase(),"0"+u.toString(8)),(n=/^(.*?)(0+)$/.exec(u))&&r.push(n[1]+"e"+n[2].length)):(n=/^0?\.(0+)(.*)$/.exec(u))&&r.push(n[2]+"e-"+(n[1].length+n[2].length),t.substr(t.indexOf("."))),f(r)}function p(u){if("do"==u[0])return O(["block",[u]]);for(var n=u;;){var t=n[0];if("if"==t){if(!n[3])return O(["block",[u]]);n=n[3]}else if("while"==t||"do"==t)n=n[2];else{if("for"!=t&&"for-in"!=t)break;n=n[4]}}return O(u)}function C(u,n,t,r){var i=r||"function";return u&&(i+=" "+e(u)),i+="("+c(q(n,e))+")",a([i,x(t)])}function F(u,n){for(var t=[],r=u.length-1,e=0;r>=e;++e){var o=u[e],a=O(o);";"!=a&&(z||e!=r||(a="while"==o[0]&&l(o[2])||k(o[0],["for","for-in"])&&l(o[4])||"if"==o[0]&&l(o[2])&&!o[3]||"if"==o[0]&&o[3]&&l(o[3])?a.replace(/;*\s*$/,";"):a.replace(/;+\s*$/,"")),t.push(a))}return n?t:q(t,i)}function D(u){var n=u.length;return 0==n?"{}":"{"+T+q(u,function(u,t){var r=u[1].length>0,e=o(function(){return i(u[0]?a(["case",O(u[0])+":"]):"default:")},.5)+(r?T+o(function(){return F(u[1]).join(T)}):"");return!z&&r&&n-1>t&&(e+=";"),e}).join(T)+T+i("}")}function x(u){return u?0==u.length?"{}":"{"+T+o(function(){return F(u).join(T)})+T+i("}"):";"}function S(u){var n=u[0],t=u[1];return null!=t&&(n=a([e(n),"=",s(t,"seq")])),n}function O(u){var n=u[0],t=I[n];if(!t)throw new Error("Can't find generator for \""+n+'"');P.push(u);var r=t.apply(n,u.slice(1));return P.pop(),r}t=E(t,{indent_start:0,indent_level:4,quote_keys:!1,space_colon:!1,beautify:!1,ascii_only:!1});var z=!!t.beautify,$=0,T=z?"\n":"",N=z?" ":"",I={string:r,num:h,name:e,toplevel:function(u){return F(u).join(T+T)},splice:function(u){var n=P[P.length-2][0];return y(j,n)?x.apply(this,arguments):q(F(u,!0),function(u,n){return n>0?i(u):u}).join(T)},block:x,"var":function(u){return"var "+c(q(u,S))+";"},"const":function(u){return"const "+c(q(u,S))+";"},"try":function(u,n,t){var r=["try",x(u)];return n&&r.push("catch","("+n[0]+")",x(n[1])),t&&r.push("finally",x(t)),a(r)},"throw":function(u){return a(["throw",O(u)])+";"},"new":function(u,t){return t=t.length>0?"("+c(q(t,O))+")":"",a(["new",s(u,"seq","binary","conditional","assign",function(u){var t=n(),r={};try{t.with_walkers({call:function(){throw r},"function":function(){return this}},function(){t.walk(u)})}catch(e){if(e===r)return!0;throw e}})+t])},"switch":function(u,n){return a(["switch","("+O(u)+")",D(n)])},"break":function(u){var n="break";return null!=u&&(n+=" "+e(u)),n+";"},"continue":function(u){var n="continue";return null!=u&&(n+=" "+e(u)),n+";"},conditional:function(u,n,t){return a([s(u,"assign","seq","conditional"),"?",s(n,"seq"),":",s(t,"seq")])},assign:function(u,n,t){return u&&u!==!0?u+="=":u="=",a([O(n),u,s(t,"seq")])},dot:function(u){var n=O(u),t=1;for("num"==u[0]?/\./.test(u[1])||(n+="."):A(u)&&(n="("+n+")");t<arguments.length;)n+="."+e(arguments[t++]);return n},call:function(u,n){var t=O(u);return A(u)&&(t="("+t+")"),t+"("+c(q(n,function(u){return s(u,"seq")}))+")"},"function":C,defun:C,"if":function(u,n,t){var r=["if","("+O(u)+")",t?p(n):O(n)];return t&&r.push("else",O(t)),a(r)},"for":function(u,n,t,r){var e=["for"];u=(null!=u?O(u):"").replace(/;*\s*$/,";"+N),n=(null!=n?O(n):"").replace(/;*\s*$/,";"+N),t=(null!=t?O(t):"").replace(/;*\s*$/,"");var i=u+n+t;return"; ; "==i&&(i=";;"),e.push("("+i+")",O(r)),a(e)},"for-in":function(u,n,t,r){return a(["for","("+(u?O(u).replace(/;+$/,""):O(n)),"in",O(t)+")",O(r)])},"while":function(u,n){return a(["while","("+O(u)+")",O(n)])},"do":function(u,n){return a(["do",O(n),"while","("+O(u)+")"])+";"},"return":function(u){var n=["return"];return null!=u&&n.push(O(u)),a(n)+";"},binary:function(u,n,t){var r=O(n),e=O(t);return(k(n[0],["assign","conditional","seq"])||"binary"==n[0]&&b[u]>b[n[1]])&&(r="("+r+")"),(k(t[0],["assign","conditional","seq"])||"binary"==t[0]&&b[u]>=b[t[1]]&&(t[1]!=u||!k(u,["&&","||","*"])))&&(e="("+e+")"),a([r,u,e])},"unary-prefix":function(u,n){var t=O(n);return"num"!=n[0]&&("unary-prefix"!=n[0]||y(_,u+n[1]))&&A(n)&&(t="("+t+")"),u+(m.is_alphanumeric_char(u.charAt(0))?" ":"")+t},"unary-postfix":function(u,n){var t=O(n);return"num"!=n[0]&&("unary-postfix"!=n[0]||y(_,u+n[1]))&&A(n)&&(t="("+t+")"),t+u},sub:function(u,n){var t=O(u);return A(u)&&(t="("+t+")"),t+"["+O(n)+"]"},object:function(u){return 0==u.length?"{}":"{"+T+o(function(){return q(u,function(u){if(3==u.length)return i(C(u[0],u[1][2],u[1][3],u[2]));var n=u[0],e=O(u[1]);return t.quote_keys?n=r(n):("number"==typeof n||!z&&+n+""==n)&&parseFloat(n)>=0?n=h(+n):d(n)||(n=r(n)),i(a(z&&t.space_colon?[n,":",e]:[n+":",e]))}).join(","+T)})+T+i("}")},regexp:function(u,n){return"/"+u+"/"+n},array:function(u){return 0==u.length?"[]":a(["[",c(q(u,function(u){return z||"atom"!=u[0]||"undefined"!=u[1]?s(u,"seq"):""})),"]"])},stat:function(u){return O(u).replace(/;*\s*$/,";")},seq:function(){return c(q(w(arguments),O))},label:function(u,n){return a([e(u),":",O(n)])},"with":function(u,n){return a(["with","("+O(u)+")",O(n)])},atom:function(u){return e(u)}},P=[];return O(u)}function D(u,n){var t=[0];return m.parse(function(){function r(u){return u.pos-c}function e(u){c=u.pos,t.push(c)}function i(){var u=a.apply(this,arguments);u:if((!o||"keyword"!=o.type)&&r(u)>n)switch(u.type){case"keyword":case"atom":case"name":case"punc":e(u);break u}return o=u,u}var o,a=m.tokenizer(u),c=0;return i.context=function(){return a.context.apply(this,arguments)},i}()),t.map(function(n,r){return u.substring(n,t[r+1]||u.length)}).join("\n")}function g(u,n){if(0>=n)return"";if(1==n)return u;var t=g(u,n>>1);return t+=t,1&n&&(t+=u),t}function E(u,n){var t={};u===!0&&(u={});for(var r in n)y(n,r)&&(t[r]=u&&y(u,r)?u[r]:n[r]);return t}function d(u){return/^[a-z_$][a-z0-9_$]*$/i.test(u)&&"this"!=u&&!y(m.KEYWORDS_ATOM,u)&&!y(m.RESERVED_WORDS,u)&&!y(m.KEYWORDS,u)}function y(u,n){return Object.prototype.hasOwnProperty.call(u,n)}var m=t("./parse-js"),w=m.slice,k=m.member,b=m.PRECEDENCE,_=m.OPERATORS,x=function(){var u="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_";return function(n){var t="";do t=u.charAt(n%54)+t,n=Math.floor(n/54);while(n>0);return t}}();r.prototype={has:function(u){for(var n=this;n;n=n.parent)if(y(n.names,u))return n},has_mangled:function(u){for(var n=this;n;n=n.parent)if(y(n.rev_mangled,u))return n},toJSON:function(){return{names:this.names,uses_eval:this.uses_eval,uses_with:this.uses_with}},next_mangled:function(){for(;;){var u,n=x(++this.cname);if(u=this.has_mangled(n),!(u&&this.refs[u.rev_mangled[n]]===u||(u=this.has(n),u&&u!==this&&this.refs[n]===u&&!u.has_mangled(n)||y(this.refs,n)&&null==this.refs[n]||!d(n))))return n}},set_mangle:function(u,n){return this.rev_mangled[n]=u,this.mangled[u]=n},get_mangled:function(u,n){if(this.uses_eval||this.uses_with)return u;var t=this.has(u);return t?y(t.mangled,u)?t.mangled[u]:n?t.set_mangle(u,t.next_mangled()):u:u},define:function(u){return null!=u?this.names[u]=u:void 0}};var q,S=function(){},O=function(){function u(t){switch(t[0]){case"string":case"num":return t[1];case"name":case"atom":switch(t[1]){case"true":return!0;case"false":return!1}break;case"unary-prefix":switch(t[1]){case"!":return!u(t[2]);case"typeof":return typeof u(t[2]);case"~":return~u(t[2]);case"-":return-u(t[2]);case"+":return+u(t[2])}break;case"binary":var r=t[2],e=t[3];switch(t[1]){case"&&":return u(r)&&u(e);case"||":return u(r)||u(e);case"|":return u(r)|u(e);case"&":return u(r)&u(e);case"^":return u(r)^u(e);case"+":return u(r)+u(e);case"*":return u(r)*u(e);case"/":return u(r)/u(e);case"-":return u(r)-u(e);case"<<":return u(r)<<u(e);case">>":return u(r)>>u(e);case">>>":return u(r)>>>u(e);case"==":return u(r)==u(e);case"===":return u(r)===u(e);case"!=":return u(r)!=u(e);case"!==":return u(r)!==u(e);case"<":return u(r)<u(e);case"<=":return u(r)<=u(e);case">":return u(r)>u(e);case">=":return u(r)>=u(e);case"in":return u(r)in u(e);case"instanceof":return u(r)instanceof u(e)}}throw n}var n={};return function(t,r,e){try{var i,o=u(t);switch(typeof o){case"string":i=["string",o];break;case"number":i=["num",o];break;case"boolean":i=["name",String(o)];break;default:throw new Error("Can't handle constant of type: "+typeof o)}return r.call(t,i,o)}catch(a){if(a===n){if("binary"!=t[0]||"==="!=t[1]&&"!=="!=t[1]||!(A(t[2])&&A(t[3])||s(t[2])&&s(t[3]))){if(e&&"binary"==t[0]&&("||"==t[1]||"&&"==t[1]))try{var c=u(t[2]);t="&&"==t[1]&&(c?t[3]:c)||"||"==t[1]&&(c?c:t[3])||t}catch(f){}}else t[1]=t[1].substr(0,2);return e?e.call(t,t):null}throw a}}}(),R=m.array_to_hash(["name","array","object","string","dot","sub","call","regexp"]),j=m.array_to_hash(["if","while","do","for","for-in","with"]);!function(){function u(u){this.v=u}q=function(n,t,r){for(var e=[],i=0;i<n.length;++i){var o=t.call(r,n[i],i);o instanceof u?e.unshift(o.v):e.push(o)}return e},q.at_top=function(n){return new u(n)}}(),u.ast_walker=n,u.ast_mangle=i,u.ast_squeeze=C,u.gen_code=F,u.ast_add_scope=e,u.set_logger=function(u){S=u},u.make_string=v,u.split_lines=D,u.MAP=q,u.ast_squeeze_more=t("./squeeze-more").ast_squeeze_more}(n["./process"]),function(u){function n(u){var n=e.ast_walker(),t=n.walk;return n.with_walkers({call:function(u,n){return"dot"==u[0]&&"toString"==u[2]&&0==n.length?["binary","+",u[1],["string",""]]:void 0}},function(){return t(u)})}var r=t("./parse-js"),e=t("./process");r.slice,r.member,r.PRECEDENCE,r.OPERATORS,u.ast_squeeze_more=n}(n["./squeeze-more"]),t("./process").ast_squeeze_more=t("./squeeze-more").ast_squeeze_more,window.uglify=u}();
+!function(){function u(u,n){n||(n={});var r=t("./parse-js"),e=t("./process"),i=r.parse(u,n.strict_semicolons);i=e.ast_mangle(i,n.mangle_options),i=e.ast_squeeze(i,n.squeeze_options);var o=e.gen_code(i,n.gen_options);return o}var n={"./parse-js":{},"./process":{},"./squeeze-more":{}},t=function(u){return n[u]};Array.prototype.reduce||(Array.prototype.reduce=function(u){var n,t,r=this.length;if("function"!=typeof u)throw new TypeError("First argument is not callable");if((0==r||null===r)&&arguments.length<=1)throw new TypeError("Array length is 0 and no second argument");if(arguments.length<=1){for(n=0;n=r;)throw new TypeError("Empty array and no second argument");t=this[n++]}else t=arguments[1];for(n=n||0;r>n;n++)n in this&&(t=u.call(void 0,t,this[n],n,this));return t}),Array.prototype.forEach||(Array.prototype.forEach=function(u,n){var t,r=Object(this),e=r.length>>>0,i=0;if(!u||!u.call)throw new TypeError;for(n&&(t=n);e>i;){var o,a=String(i),c=r.hasOwnProperty(a);c&&(o=r[a],u.call(t,o,i,r)),i++}}),function(u){function n(u){return j.letter.test(u)}function t(u){return u=u.charCodeAt(0),u>=48&&57>=u}function r(u){return t(u)||n(u)}function e(u){return j.non_spacing_mark.test(u)||j.space_combining_mark.test(u)}function i(u){return j.connector_punctuation.test(u)}function o(u){return"$"==u||"_"==u||n(u)}function a(u){return o(u)||e(u)||t(u)||i(u)||"‌"==u||"‍"==u}function c(u){return b.test(u)?parseInt(u.substr(2),16):_.test(u)?parseInt(u.substr(1),8):x.test(u)?parseFloat(u):void 0}function s(u,n,t,r){this.message=u,this.line=n,this.col=t,this.pos=r;try{({})()}catch(e){this.stack=e.stack}}function f(u,n,t,r){throw new s(u,n,t,r)}function l(u,n,t){return u.type==n&&(null==t||u.value==t)}function A(u){function n(){return P.text.charAt(P.pos)}function e(u){var n=P.text.charAt(P.pos++);if(u&&!n)throw z;return"\n"==n?(P.newline_before=!0,++P.line,P.col=0):++P.col,n}function i(u,n){var t=P.text.indexOf(u,P.pos);if(n&&-1==t)throw z;return t}function s(){P.tokline=P.line,P.tokcol=P.col,P.tokpos=P.pos}function l(u,n,t){P.regex_allowed="operator"==u&&!E(T,n)||"keyword"==u&&E(m,n)||"punc"==u&&E(O,n);var r={type:u,value:n,line:P.tokline,col:P.tokcol,pos:P.tokpos,nlb:P.newline_before};return t||(r.comments_before=P.comments_before,P.comments_before=[]),P.newline_before=!1,r}function A(){for(;E(S,n());)e()}function h(u){for(var t="",r=n(),i=0;r&&u(r,i++);)t+=e(),r=n();return t}function p(u){f(u,P.tokline,P.tokcol,P.tokpos)}function C(u){var n=!1,t=!1,e=!1,i="."==u,o=h(function(o,a){return"x"==o||"X"==o?e?!1:e=!0:e||"E"!=o&&"e"!=o?"-"==o?t||0==a&&!u?!0:!1:"+"==o?t:(t=!1,"."==o?i||e?!1:i=!0:r(o)):n?!1:n=t=!0});u&&(o=u+o);var a=c(o);return isNaN(a)?void p("Invalid syntax: "+o):l("num",a)}function v(){var u=e(!0);switch(u){case"n":return"\n";case"r":return"\r";case"t":return" ";case"b":return"\b";case"v":return" ";case"f":return"\f";case"0":return"\x00";case"x":return String.fromCharCode(B(2));case"u":return String.fromCharCode(B(4));default:return u}}function B(u){for(var n=0;u>0;--u){var t=parseInt(e(!0),16);isNaN(t)&&p("Invalid hex-character pattern in string"),n=n<<4|t}return n}function F(){return N("Unterminated string constant",function(){for(var u=e(),n="";;){var t=e(!0);if("\\"==t)t=v();else if(t==u)break;n+=t}return l("string",n)})}function D(){e();var u,n=i("\n");return-1==n?(u=P.text.substr(P.pos),P.pos=P.text.length):(u=P.text.substring(P.pos,n),P.pos=n),l("comment1",u,!0)}function g(){return e(),N("Unterminated multiline comment",function(){var u=i("*/",!0),n=P.text.substring(P.pos,u),t=l("comment2",n,!0);return P.pos=u+2,P.line+=n.split("\n").length-1,P.newline_before=n.indexOf("\n")>=0,/^@cc_on/i.test(n)&&(U("WARNING: at line "+P.line),U('*** Found "conditional comment": '+n),U("*** UglifyJS DISCARDS ALL COMMENTS. This means your code might no longer work properly in Internet Explorer.")),t})}function y(){for(var u,t=!1,r="";null!=(u=n());)if(t)"u"!=u&&p("Expecting UnicodeEscapeSequence -- uXXXX"),u=v(),a(u)||p("Unicode char: "+u.charCodeAt(0)+" is not valid in identifier"),r+=u,t=!1;else if("\\"==u)t=!0,e();else{if(!a(u))break;r+=e()}return r}function b(){return N("Unterminated regular expression",function(){for(var u,n=!1,t="",r=!1;u=e(!0);)if(n)t+="\\"+u,n=!1;else if("["==u)r=!0,t+=u;else if("]"==u&&r)r=!1,t+=u;else{if("/"==u&&!r)break;"\\"==u?n=!0:t+=u}var i=y();return l("regexp",[t,i])})}function _(u){function t(u){if(!n())return u;var r=u+n();return E(q,r)?(e(),t(r)):u}return l("operator",t(u||e()))}function x(){e();var u=P.regex_allowed;switch(n()){case"/":return P.comments_before.push(D()),P.regex_allowed=u,I();case"*":return P.comments_before.push(g()),P.regex_allowed=u,I()}return P.regex_allowed?b():_("/")}function j(){return e(),t(n())?C("."):l("punc",".")}function $(){var u=y();return E(d,u)?E(q,u)?l("operator",u):E(w,u)?l("atom",u):l("keyword",u):l("name",u)}function N(u,n){try{return n()}catch(t){if(t!==z)throw t;p(u)}}function I(u){if(u)return b();A(),s();var r=n();return r?t(r)?C():'"'==r||"'"==r?F():E(R,r)?l("punc",e()):"."==r?j():"/"==r?x():E(k,r)?_():"\\"==r||o(r)?$():void p("Unexpected character '"+r+"'"):l("eof")}var P={text:u.replace(/\r\n?|[\n\u2028\u2029]/g,"\n").replace(/^\uFEFF/,""),pos:0,tokpos:0,line:0,tokline:0,col:0,tokcol:0,newline_before:!1,regex_allowed:!1,comments_before:[]};return I.context=function(u){return u&&(P=u),P},I}function h(u,n,t){this.name=u,this.start=n,this.end=t}function p(u,n,t){function r(u,n){return l(on.token,u,n)}function e(){return on.peeked||(on.peeked=on.input())}function i(){return on.prev=on.token,on.peeked?(on.token=on.peeked,on.peeked=null):on.token=on.input(),on.token}function o(){return on.prev}function a(u,n,t,r){var e=on.input.context();f(u,null!=n?n:e.tokline,null!=t?t:e.tokcol,null!=r?r:e.tokpos)}function c(u,n){a(n,u.line,u.col)}function s(u){null==u&&(u=on.token),c(u,"Unexpected token: "+u.type+" ("+u.value+")")}function p(u,n){return r(u,n)?i():void c(on.token,"Unexpected token "+on.token.type+", expected "+u)}function B(u){return p("punc",u)}function D(){return!n&&(on.token.nlb||r("eof")||r("punc","}"))}function d(){r("punc",";")?i():D()||s()}function y(){return F(arguments)}function m(){B("(");var u=ln();return B(")"),u}function w(u,n,t){return u instanceof h?u:new h(u,n,t)}function k(u){return t?function(){var n=on.token,t=u.apply(this,arguments);return t[0]=w(t[0],n,o()),t}:u}function b(u){on.labels.push(u);var t=on.token,r=an();return n&&!E(P,r[0])&&s(t),on.labels.pop(),y("label",u,r)}function _(){return y("stat",v(ln,d))}function x(u){var n;return D()||(n=r("name")?on.token.value:null),null!=n?(i(),g(n,on.labels)||a("Label "+n+" without matching loop or statement")):0==on.in_loop&&a(u+" not inside a loop or switch"),d(),y(u,n)}function q(){B("(");var u=null;return!r("punc",";")&&(u=r("keyword","var")?(i(),W(!0)):ln(!0,!0),r("operator","in"))?O(u):S(u)}function S(u){B(";");var n=r("punc",";")?null:ln();B(";");var t=r("punc",")")?null:ln();return B(")"),y("for",u,n,t,en(an))}function O(u){var n="var"==u[0]?y("name",u[1][0]):u;i();var t=ln();return B(")"),y("for-in",u,n,t,en(an))}function R(){var u,n=m(),t=an();return r("keyword","else")&&(i(),u=an()),y("if",n,t,u)}function j(){B("{");for(var u=[];!r("punc","}");)r("eof")&&s(),u.push(an());return i(),u}function z(){var u,n,t=j();if(r("keyword","catch")){i(),B("("),r("name")||a("Name expected");var e=on.token.value;i(),B(")"),u=[e,j()]}return r("keyword","finally")&&(i(),n=j()),u||n||a("Missing catch/finally blocks"),y("try",t,u,n)}function U(u){for(var n=[];;){r("name")||s();var t=on.token.value;if(i(),r("operator","=")?(i(),n.push([t,ln(!1,u)])):n.push([t]),!r("punc",","))break;i()}return n}function W(u){return y("var",U(u))}function K(){return y("const",U())}function X(){var u,n=fn(!1);return r("punc","(")?(i(),u=L(")")):u=[],H(y("new",n,u),!0)}function L(u,n,t){for(var e=!0,o=[];!r("punc",u)&&(e?e=!1:B(","),!n||!r("punc",u));)o.push(r("punc",",")&&t?["atom","undefined"]:ln(!1));return i(),o}function Y(){return y("array",L("]",!n,!0))}function J(){for(var u=!0,t=[];!r("punc","}")&&(u?u=!1:B(","),n||!r("punc","}"));){var e=on.token.type,o=V();"name"!=e||"get"!=o&&"set"!=o||r("punc",":")?(B(":"),t.push([o,ln(!1)])):t.push([G(),cn(!1),o])}return i(),y("object",t)}function V(){switch(on.token.type){case"num":case"string":return v(on.token.value,i)}return G()}function G(){switch(on.token.type){case"name":case"operator":case"keyword":case"atom":return v(on.token.value,i);default:s()}}function H(u,n){return r("punc",".")?(i(),H(y("dot",u,G()),n)):r("punc","[")?(i(),H(y("sub",u,v(ln,C(B,"]"))),n)):n&&r("punc","(")?(i(),H(y("call",u,L(")")),!0)):n&&r("operator")&&E(T,on.token.value)?v(C(Q,"unary-postfix",on.token.value,u),i):u}function Q(u,n,t){return"++"!=n&&"--"!=n||tn(t)||a("Invalid use of "+n+" operator"),y(u,n,t)}function Z(u,n,t){var e=r("operator")?on.token.value:null;e&&"in"==e&&t&&(e=null);var o=null!=e?I[e]:null;if(null!=o&&o>n){i();var a=Z(fn(!0),o,t);return Z(y("binary",e,u,a),n,t)}return u}function un(u){return Z(fn(!0),0,u)}function nn(u){var n=un(u);if(r("operator","?")){i();var t=ln(!1);return B(":"),y("conditional",n,t,ln(!1,u))}return n}function tn(u){if(!n)return!0;switch(u[0]){case"dot":case"sub":case"new":case"call":return!0;case"name":return"this"!=u[1]}}function rn(u){var n=nn(u),t=on.token.value;if(r("operator")&&E(N,t)){if(tn(n))return i(),y("assign",N[t],n,rn(u));a("Invalid assignment")}return n}function en(u){try{return++on.in_loop,u()}finally{--on.in_loop}}var on={input:"string"==typeof u?A(u,!0):u,token:null,prev:null,peeked:null,in_function:0,in_loop:0,labels:[]};on.token=i();var an=k(function(){switch(r("operator","/")&&(on.peeked=null,on.token=on.input(!0)),on.token.type){case"num":case"string":case"regexp":case"operator":case"atom":return _();case"name":return l(e(),"punc",":")?b(v(on.token.value,i,i)):_();case"punc":switch(on.token.value){case"{":return y("block",j());case"[":case"(":return _();case";":return i(),y("block");default:s()}case"keyword":switch(v(on.token.value,i)){case"break":return x("break");case"continue":return x("continue");case"debugger":return d(),y("debugger");case"do":return function(u){return p("keyword","while"),y("do",v(m,d),u)}(en(an));case"for":return q();case"function":return cn(!0);case"if":return R();case"return":return 0==on.in_function&&a("'return' outside of function"),y("return",r("punc",";")?(i(),null):D()?null:v(ln,d));case"switch":return y("switch",m(),sn());case"throw":return y("throw",v(ln,d));case"try":return z();case"var":return v(W,d);case"const":return v(K,d);case"while":return y("while",m(),en(an));case"with":return y("with",m(),an());default:s()}}}),cn=k(function(u){var n=r("name")?v(on.token.value,i):null;return u&&!n&&s(),B("("),y(u?"defun":"function",n,function(u,n){for(;!r("punc",")");)u?u=!1:B(","),r("name")||s(),n.push(on.token.value),i();return i(),n}(!0,[]),function(){++on.in_function;var u=on.in_loop;on.in_loop=0;var n=j();return--on.in_function,on.in_loop=u,n}())}),sn=C(en,function(){B("{");for(var u=[],n=null;!r("punc","}");)r("eof")&&s(),r("keyword","case")?(i(),n=[],u.push([ln(),n]),B(":")):r("keyword","default")?(i(),B(":"),n=[],u.push([null,n])):(n||s(),n.push(an()));return i(),u}),fn=k(function(u){if(r("operator","new"))return i(),X();if(r("operator")&&E($,on.token.value))return Q("unary-prefix",v(on.token.value,i),fn(u));if(r("punc")){switch(on.token.value){case"(":return i(),H(v(ln,C(B,")")),u);case"[":return i(),H(Y(),u);case"{":return i(),H(J(),u)}s()}if(r("keyword","function"))return i(),H(cn(!1),u);if(E(M,on.token.type)){var n="regexp"==on.token.type?y("regexp",on.token.value[0],on.token.value[1]):y(on.token.type,on.token.value);return H(v(n,i),u)}s()}),ln=k(function(u,n){0==arguments.length&&(u=!0);var t=rn(n);return u&&r("punc",",")?(i(),y("seq",t,ln(!0,n))):t});return y("toplevel",function(u){for(;!r("eof");)u.push(an());return u}([]))}function C(u){var n=F(arguments,1);return function(){return u.apply(this,n.concat(F(arguments)))}}function v(u){u instanceof Function&&(u=u());for(var n=1,t=arguments.length;--t>0;++n)arguments[n]();return u}function B(u){for(var n={},t=0;t<u.length;++t)n[u[t]]=!0;return n}function F(u,n){return Array.prototype.slice.call(u,null==n?0:n)}function D(u){return u.split("")}function g(u,n){for(var t=n.length;--t>=0;)if(n[t]===u)return!0;return!1}function E(u,n){return Object.prototype.hasOwnProperty.call(u,n)}var d=B(["break","case","catch","const","continue","default","delete","do","else","finally","for","function","if","in","instanceof","new","return","switch","throw","try","typeof","var","void","while","with"]),y=B(["abstract","boolean","byte","char","class","debugger","double","enum","export","extends","final","float","goto","implements","import","int","interface","long","native","package","private","protected","public","short","static","super","synchronized","throws","transient","volatile"]),m=B(["return","new","delete","throw","else","case"]),w=B(["false","null","true","undefined"]),k=B(D("+-*&%=<>!?|~^")),b=/^0x[0-9a-f]+$/i,_=/^0[0-7]+$/,x=/^\d*\.?\d*(?:e[+-]?\d*(?:\d\.?|\.?\d)\d*)?$/i,q=B(["in","instanceof","typeof","new","void","delete","++","--","+","-","!","~","&","|","^","*","/","%",">>","<<",">>>","<",">","<=",">=","==","===","!=","!==","?","=","+=","-=","/=","*=","%=",">>=","<<=",">>>=","|=","^=","&=","&&","||"]),S=B(D("  \n\r \f ​")),O=B(D("[{}(,.;:")),R=B(D("[]{}(),;:")),j=(B(D("gmsiy")),{letter:new RegExp("[\\u0041-\\u005A\\u0061-\\u007A\\u00AA\\u00B5\\u00BA\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u0523\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0621-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971\\u0972\\u097B-\\u097F\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C33\\u0C35-\\u0C39\\u0C3D\\u0C58\\u0C59\\u0C60\\u0C61\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDE\\u0CE0\\u0CE1\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D28\\u0D2A-\\u0D39\\u0D3D\\u0D60\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC\\u0EDD\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8B\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10D0-\\u10FA\\u10FC\\u1100-\\u1159\\u115F-\\u11A2\\u11A8-\\u11F9\\u1200-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u1676\\u1681-\\u169A\\u16A0-\\u16EA\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1877\\u1880-\\u18A8\\u18AA\\u1900-\\u191C\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19A9\\u19C1-\\u19C7\\u1A00-\\u1A16\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u2094\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2183\\u2184\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2C6F\\u2C71-\\u2C7D\\u2C80-\\u2CE4\\u2D00-\\u2D25\\u2D30-\\u2D65\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005\\u3006\\u3031-\\u3035\\u303B\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31B7\\u31F0-\\u31FF\\u3400\\u4DB5\\u4E00\\u9FC3\\uA000-\\uA48C\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA65F\\uA662-\\uA66E\\uA67F-\\uA697\\uA717-\\uA71F\\uA722-\\uA788\\uA78B\\uA78C\\uA7FB-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA90A-\\uA925\\uA930-\\uA946\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAC00\\uD7A3\\uF900-\\uFA2D\\uFA30-\\uFA6A\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]"),non_spacing_mark:new RegExp("[\\u0300-\\u036F\\u0483-\\u0487\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u0610-\\u061A\\u064B-\\u065E\\u0670\\u06D6-\\u06DC\\u06DF-\\u06E4\\u06E7\\u06E8\\u06EA-\\u06ED\\u0711\\u0730-\\u074A\\u07A6-\\u07B0\\u07EB-\\u07F3\\u0816-\\u0819\\u081B-\\u0823\\u0825-\\u0827\\u0829-\\u082D\\u0900-\\u0902\\u093C\\u0941-\\u0948\\u094D\\u0951-\\u0955\\u0962\\u0963\\u0981\\u09BC\\u09C1-\\u09C4\\u09CD\\u09E2\\u09E3\\u0A01\\u0A02\\u0A3C\\u0A41\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A70\\u0A71\\u0A75\\u0A81\\u0A82\\u0ABC\\u0AC1-\\u0AC5\\u0AC7\\u0AC8\\u0ACD\\u0AE2\\u0AE3\\u0B01\\u0B3C\\u0B3F\\u0B41-\\u0B44\\u0B4D\\u0B56\\u0B62\\u0B63\\u0B82\\u0BC0\\u0BCD\\u0C3E-\\u0C40\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C62\\u0C63\\u0CBC\\u0CBF\\u0CC6\\u0CCC\\u0CCD\\u0CE2\\u0CE3\\u0D41-\\u0D44\\u0D4D\\u0D62\\u0D63\\u0DCA\\u0DD2-\\u0DD4\\u0DD6\\u0E31\\u0E34-\\u0E3A\\u0E47-\\u0E4E\\u0EB1\\u0EB4-\\u0EB9\\u0EBB\\u0EBC\\u0EC8-\\u0ECD\\u0F18\\u0F19\\u0F35\\u0F37\\u0F39\\u0F71-\\u0F7E\\u0F80-\\u0F84\\u0F86\\u0F87\\u0F90-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u102D-\\u1030\\u1032-\\u1037\\u1039\\u103A\\u103D\\u103E\\u1058\\u1059\\u105E-\\u1060\\u1071-\\u1074\\u1082\\u1085\\u1086\\u108D\\u109D\\u135F\\u1712-\\u1714\\u1732-\\u1734\\u1752\\u1753\\u1772\\u1773\\u17B7-\\u17BD\\u17C6\\u17C9-\\u17D3\\u17DD\\u180B-\\u180D\\u18A9\\u1920-\\u1922\\u1927\\u1928\\u1932\\u1939-\\u193B\\u1A17\\u1A18\\u1A56\\u1A58-\\u1A5E\\u1A60\\u1A62\\u1A65-\\u1A6C\\u1A73-\\u1A7C\\u1A7F\\u1B00-\\u1B03\\u1B34\\u1B36-\\u1B3A\\u1B3C\\u1B42\\u1B6B-\\u1B73\\u1B80\\u1B81\\u1BA2-\\u1BA5\\u1BA8\\u1BA9\\u1C2C-\\u1C33\\u1C36\\u1C37\\u1CD0-\\u1CD2\\u1CD4-\\u1CE0\\u1CE2-\\u1CE8\\u1CED\\u1DC0-\\u1DE6\\u1DFD-\\u1DFF\\u20D0-\\u20DC\\u20E1\\u20E5-\\u20F0\\u2CEF-\\u2CF1\\u2DE0-\\u2DFF\\u302A-\\u302F\\u3099\\u309A\\uA66F\\uA67C\\uA67D\\uA6F0\\uA6F1\\uA802\\uA806\\uA80B\\uA825\\uA826\\uA8C4\\uA8E0-\\uA8F1\\uA926-\\uA92D\\uA947-\\uA951\\uA980-\\uA982\\uA9B3\\uA9B6-\\uA9B9\\uA9BC\\uAA29-\\uAA2E\\uAA31\\uAA32\\uAA35\\uAA36\\uAA43\\uAA4C\\uAAB0\\uAAB2-\\uAAB4\\uAAB7\\uAAB8\\uAABE\\uAABF\\uAAC1\\uABE5\\uABE8\\uABED\\uFB1E\\uFE00-\\uFE0F\\uFE20-\\uFE26]"),space_combining_mark:new RegExp("[\\u0903\\u093E-\\u0940\\u0949-\\u094C\\u094E\\u0982\\u0983\\u09BE-\\u09C0\\u09C7\\u09C8\\u09CB\\u09CC\\u09D7\\u0A03\\u0A3E-\\u0A40\\u0A83\\u0ABE-\\u0AC0\\u0AC9\\u0ACB\\u0ACC\\u0B02\\u0B03\\u0B3E\\u0B40\\u0B47\\u0B48\\u0B4B\\u0B4C\\u0B57\\u0BBE\\u0BBF\\u0BC1\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCC\\u0BD7\\u0C01-\\u0C03\\u0C41-\\u0C44\\u0C82\\u0C83\\u0CBE\\u0CC0-\\u0CC4\\u0CC7\\u0CC8\\u0CCA\\u0CCB\\u0CD5\\u0CD6\\u0D02\\u0D03\\u0D3E-\\u0D40\\u0D46-\\u0D48\\u0D4A-\\u0D4C\\u0D57\\u0D82\\u0D83\\u0DCF-\\u0DD1\\u0DD8-\\u0DDF\\u0DF2\\u0DF3\\u0F3E\\u0F3F\\u0F7F\\u102B\\u102C\\u1031\\u1038\\u103B\\u103C\\u1056\\u1057\\u1062-\\u1064\\u1067-\\u106D\\u1083\\u1084\\u1087-\\u108C\\u108F\\u109A-\\u109C\\u17B6\\u17BE-\\u17C5\\u17C7\\u17C8\\u1923-\\u1926\\u1929-\\u192B\\u1930\\u1931\\u1933-\\u1938\\u19B0-\\u19C0\\u19C8\\u19C9\\u1A19-\\u1A1B\\u1A55\\u1A57\\u1A61\\u1A63\\u1A64\\u1A6D-\\u1A72\\u1B04\\u1B35\\u1B3B\\u1B3D-\\u1B41\\u1B43\\u1B44\\u1B82\\u1BA1\\u1BA6\\u1BA7\\u1BAA\\u1C24-\\u1C2B\\u1C34\\u1C35\\u1CE1\\u1CF2\\uA823\\uA824\\uA827\\uA880\\uA881\\uA8B4-\\uA8C3\\uA952\\uA953\\uA983\\uA9B4\\uA9B5\\uA9BA\\uA9BB\\uA9BD-\\uA9C0\\uAA2F\\uAA30\\uAA33\\uAA34\\uAA4D\\uAA7B\\uABE3\\uABE4\\uABE6\\uABE7\\uABE9\\uABEA\\uABEC]"),connector_punctuation:new RegExp("[\\u005F\\u203F\\u2040\\u2054\\uFE33\\uFE34\\uFE4D-\\uFE4F\\uFF3F]")});s.prototype.toString=function(){return this.message+" (line: "+this.line+", col: "+this.col+", pos: "+this.pos+")\n\n"+this.stack};var z={},$=B(["typeof","void","delete","--","++","!","~","-","+"]),T=B(["--","++"]),N=function(u,n,t){for(;t<u.length;)n[u[t]]=u[t].substr(0,u[t].length-1),t++;return n}(["+=","-=","/=","*=","%=",">>=","<<=",">>>=","|=","^=","&="],{"=":!0},0),I=function(u,n){for(var t=0,r=1;t<u.length;++t,++r)for(var e=u[t],i=0;i<e.length;++i)n[e[i]]=r;return n}([["||"],["&&"],["|"],["^"],["&"],["==","===","!=","!=="],["<",">","<=",">=","in","instanceof"],[">>","<<",">>>"],["+","-"],["*","/","%"]],{}),P=B(["for","do","while","switch"]),M=B(["atom","num","string","regexp","name"]);h.prototype.toString=function(){return this.name};var U=function(){};u.tokenizer=A,u.parse=p,u.slice=F,u.curry=C,u.member=g,u.array_to_hash=B,u.PRECEDENCE=I,u.KEYWORDS_ATOM=w,u.RESERVED_WORDS=y,u.KEYWORDS=d,u.ATOMIC_START_TOKEN=M,u.OPERATORS=q,u.is_alphanumeric_char=r,u.set_logger=function(u){U=u}}(n["./parse-js"]),function(u){function n(){function u(u){return[this[0],q(u,function(u){var n=[u[0]];return u.length>1&&(n[1]=t(u[1])),n})]}function n(u){var n=[this[0]];return null!=u&&n.push(q(u,t)),n}function t(u){if(null==u)return null;try{o.push(u);var n=u[0],t=i[n];if(t){var r=t.apply(u,u.slice(1));if(null!=r)return r}return t=e[n],t.apply(u,u.slice(1))}finally{o.pop()}}function r(u,n){var t,r={};for(t in u)y(u,t)&&(r[t]=i[t],i[t]=u[t]);var e=n();for(t in r)y(r,t)&&(r[t]?i[t]=r[t]:delete i[t]);return e}var e={string:function(u){return[this[0],u]},num:function(u){return[this[0],u]},name:function(u){return[this[0],u]},toplevel:function(u){return[this[0],q(u,t)]},block:n,splice:n,"var":u,"const":u,"try":function(u,n,r){return[this[0],q(u,t),null!=n?[n[0],q(n[1],t)]:null,null!=r?q(r,t):null]},"throw":function(u){return[this[0],t(u)]},"new":function(u,n){return[this[0],t(u),q(n,t)]},"switch":function(u,n){return[this[0],t(u),q(n,function(u){return[u[0]?t(u[0]):null,q(u[1],t)]})]},"break":function(u){return[this[0],u]},"continue":function(u){return[this[0],u]},conditional:function(u,n,r){return[this[0],t(u),t(n),t(r)]},assign:function(u,n,r){return[this[0],u,t(n),t(r)]},dot:function(u){return[this[0],t(u)].concat(w(arguments,1))},call:function(u,n){return[this[0],t(u),q(n,t)]},"function":function(u,n,r){return[this[0],u,n.slice(),q(r,t)]},defun:function(u,n,r){return[this[0],u,n.slice(),q(r,t)]},"if":function(u,n,r){return[this[0],t(u),t(n),t(r)]},"for":function(u,n,r,e){return[this[0],t(u),t(n),t(r),t(e)]},"for-in":function(u,n,r,e){return[this[0],t(u),t(n),t(r),t(e)]},"while":function(u,n){return[this[0],t(u),t(n)]},"do":function(u,n){return[this[0],t(u),t(n)]},"return":function(u){return[this[0],t(u)]},binary:function(u,n,r){return[this[0],u,t(n),t(r)]},"unary-prefix":function(u,n){return[this[0],u,t(n)]},"unary-postfix":function(u,n){return[this[0],u,t(n)]},sub:function(u,n){return[this[0],t(u),t(n)]},object:function(u){return[this[0],q(u,function(u){return 2==u.length?[u[0],t(u[1])]:[u[0],t(u[1]),u[2]]})]},regexp:function(u,n){return[this[0],u,n]},array:function(u){return[this[0],q(u,t)]},stat:function(u){return[this[0],t(u)]},seq:function(){return[this[0]].concat(q(w(arguments),t))},label:function(u,n){return[this[0],u,t(n)]},"with":function(u,n){return[this[0],t(u),t(n)]},atom:function(u){return[this[0],u]}},i={},o=[];return{walk:t,with_walkers:r,parent:function(){return o[o.length-2]},stack:function(){return o}}}function r(u){this.names={},this.mangled={},this.rev_mangled={},this.cname=-1,this.refs={},this.uses_with=!1,this.uses_eval=!1,this.parent=u,this.children=[],u?(this.level=u.level+1,u.children.push(this)):this.level=0}function e(u){function t(u){a=new r(a);var n=a.body=u();return n.scope=a,a=a.parent,n}function e(u){return a.define(u)}function i(u){a.refs[u]=!0}function o(u,n,r){var i="defun"==this[0];return[this[0],i?e(u):u,n,t(function(){return i||e(u),q(n,e),q(r,s)})]}var a=null,c=n(),s=c.walk,f=[];return t(function(){function n(u,t){for(t=u.children.length;--t>=0;)n(u.children[t]);for(t in u.refs)if(y(u.refs,t))for(var r=u.has(t),e=u;e&&(e.refs[t]=r,e!==r);e=e.parent);}var t=c.with_walkers({"function":o,defun:o,"with":function(){for(var u=a;u;u=u.parent)u.uses_with=!0},"var":function(u){q(u,function(u){e(u[0])})},"const":function(u){q(u,function(u){e(u[0])})},"try":function(u,n,t){return null!=n?[this[0],q(u,s),[e(n[0]),q(n[1],s)],null!=t?q(t,s):null]:void 0},name:function(u){"eval"==u&&f.push(a),i(u)}},function(){return s(u)});return q(f,function(u){if(!u.has("eval"))for(;u;)u.uses_eval=!0,u=u.parent}),n(a),t})}function i(u,t){function r(u,n){return t.toplevel||s.parent?t.except&&k(u,t.except)?u:s.get_mangled(u,n):u}function i(u){return t.defines?!s.has(u)&&y(t.defines,u)?t.defines[u]:null:void 0}function o(u,n,t){var e,i="defun"==this[0];return u&&(i?u=r(u):(e={},s.uses_eval||s.uses_with?e[u]=u:u=e[u]=s.next_mangled())),t=a(t.scope,function(){return n=q(n,function(u){return r(u)}),q(t,l)},e),[this[0],u,n,t]}function a(u,n,t){var e=s;if(s=u,t)for(var i in t)y(t,i)&&u.set_mangle(i,t[i]);for(var i in u.names)y(u.names,i)&&r(i,!0);var o=n();return o.scope=u,s=e,o}function c(u){return[this[0],q(u,function(u){return[r(u[0]),l(u[1])]})]}var s,f=n(),l=f.walk;return t=t||{},f.with_walkers({"function":o,defun:function(){var u=o.apply(this,arguments);switch(f.parent()[0]){case"toplevel":case"function":case"defun":return q.at_top(u)}return u},"var":c,"const":c,name:function(u){return i(u)||[this[0],r(u)]},"try":function(u,n,t){return[this[0],q(u,l),null!=n?[r(n[0]),q(n[1],l)]:null,null!=t?q(t,l):null]},toplevel:function(u){var n=this;return a(n.scope,function(){return[n[0],q(u,l)]})}},function(){return l(e(u))})}function o(u,n){return F(u).length>F("stat"==n[0]?n[1]:n).length?n:u}function a(u){return"block"==u[0]&&u[1]&&u[1].length>0?u[1][u[1].length-1]:u}function c(u){return u&&(u=a(u),"return"==u[0]||"break"==u[0]||"continue"==u[0]||"throw"==u[0])?!0:void 0}function s(u){return"unary-prefix"==u[0]&&k(u[1],["!","delete"])||"binary"==u[0]&&k(u[1],["in","instanceof","==","!=","===","!==","<","<=",">=",">"])||"binary"==u[0]&&k(u[1],["&&","||"])&&s(u[2])&&s(u[3])||"conditional"==u[0]&&s(u[2])&&s(u[3])||"assign"==u[0]&&u[1]===!0&&s(u[3])||"seq"==u[0]&&s(u[u.length-1])}function f(u,n,t){var r=function(){return"unary-prefix"==u[0]&&"!"==u[1]?t?["conditional",u[2],t,n]:["binary","||",u[2],n]:t?["conditional",u,n,t]:["binary","&&",u,n]};return O(u,function(u,r){return h(r?t:n),r?n:t},r)}function l(u){return!u||"block"==u[0]&&(!u[1]||0==u[1].length)}function A(u){return"string"==u[0]||"unary-prefix"==u[0]&&"typeof"==u[1]||"binary"==u[0]&&"+"==u[1]&&(A(u[2])||A(u[3]))}function h(u){l(u)||S("Dropping unreachable code: "+F(u,!0))}function p(u){function t(u){u=q(u,o);for(var n=0;n<u.length;++n){var r=u[n];if(!("if"!=r[0]||r[3]&&o(r[3]))){var e=o(r[2]);if(c(e)){var i,a=o(r[1]),s=u.slice(n+1);i=1==s.length?s[0]:["block",s];var f=u.slice(0,n).concat([[r[0],a,e,i]]);return t(f)}}}return u}function r(u,n,r){return r=t(r),[this[0],u,n.slice(),r]}function e(u){var n=[this[0]];return null!=u&&n.push(t(u)),n}var i=n(),o=i.walk;return i.with_walkers({defun:r,"function":r,block:e,splice:e,toplevel:function(u){return[this[0],t(u)]},"try":function(u,n,r){return[this[0],t(u),null!=n?[n[0],t(n[1])]:null,null!=r?t(r):null]},"with":function(u,n){return[this[0],o(u),t(n)]}},function(){return o(u)})}function C(u,t){function r(u){var n=["unary-prefix","!",u];switch(u[0]){case"unary-prefix":return"!"==u[1]&&s(u[2])?u[2]:n;case"seq":return u=w(u),u[u.length-1]=r(u[u.length-1]),u;case"conditional":return o(n,["conditional",u[1],r(u[2]),r(u[3])]);case"binary":var e=u[1],i=u[2],a=u[3];if(!t.keep_comps)switch(e){case"<=":return["binary",">",i,a];case"<":return["binary",">=",i,a];case">=":return["binary","<",i,a];case">":return["binary","<=",i,a]}switch(e){case"==":return["binary","!=",i,a];case"!=":return["binary","==",i,a];case"===":return["binary","!==",i,a];case"!==":return["binary","===",i,a];case"&&":return o(n,["binary","||",r(i),r(a)]);case"||":return o(n,["binary","&&",r(i),r(a)])}}return n}function i(u,n){var t=m;m=u;var r=n();return r.scope=u,m=t,r}function A(u){return null!=u&&"block"==u[0]&&u[1]&&(1==u[1].length?u=u[1][0]:0==u[1].length&&(u=["block"])),u}function C(u,n,t){var r="defun"==this[0];return t=i(t.scope,function(){var n=v(q(t,_),"lambda");return r||!u||y(m.refs,u)||(u=null),n}),[this[0],u,n,t]}function v(u,n){return u=u.reduce(function(u,n){return"block"==n[0]?n[1]&&u.push.apply(u,n[1]):u.push(n),u},[]),u=function(n,t){return u.forEach(function(u){t&&("var"==u[0]&&"var"==t[0]||"const"==u[0]&&"const"==t[0])?t[1]=t[1].concat(u[1]):(n.push(u),t=u)}),n}([]),t.dead_code&&(u=function(n,r){return u.forEach(function(u){r?k(u[0],["function","defun","var","const"])?n.push(u):t.no_warnings||h(u):(n.push(u),k(u[0],["return","throw","break","continue"])&&(r=!0))}),n}([])),t.make_seqs&&(u=function(n,t){return u.forEach(function(u){t&&"stat"==t[0]&&"stat"==u[0]?t[1]=["seq",t[1],u[1]]:(n.push(u),t=u)}),n}([])),"lambda"==n&&(u=function(n,t,e){for(;n<u.length;){if(e=u[n++],"if"==e[0]&&!e[3]){if("return"==e[2][0]&&null==e[2][1]){t.push(B(r(e[1]),["block",u.slice(n)]));break}var i=a(e[2]);if("return"==i[0]&&null==i[1]){t.push(B(e[1],["block",e[2][1].slice(0,-1)],["block",u.slice(n)]));break}}t.push(e)}return t}(0,[])),u}function B(u,n,t){return O(u,function(u,r){return r?(h(t),n):(h(n),t)},function(){return D(u,n,t)})}function D(u,n,t){if(u=_(u),n=_(n),t=_(t),l(n)?(u=r(u),n=t,t=null):l(t)?t=null:!function(){var e=F(u),i=r(u),o=F(i);if(o.length<e.length){var a=n;n=t,t=a,u=i}}(),l(t)&&l(n))return["stat",u];var e=["if",u,n,t];return"if"==n[0]&&l(n[3])&&l(t)?e=o(e,_(["if",["binary","&&",u,n[1]],n[2]])):"stat"==n[0]?t?"stat"==t[0]&&(e=o(e,["stat",f(u,n[1],t[1])])):e=o(e,["stat",f(u,n[1])]):t&&n[0]==t[0]&&("return"==n[0]||"throw"==n[0])&&n[1]&&t[1]?e=o(e,[n[0],f(u,n[1],t[1])]):t&&c(n)?(e=[["if",u,n]],"block"==t[0]?t[1]&&(e=e.concat(t[1])):e.push(t),e=_(["block",e])):n&&c(t)&&(e=[["if",r(u),t]],"block"==n[0]?n[1]&&(e=e.concat(n[1])):e.push(n),e=_(["block",e])),e}function g(u,n){return O(u,function(u,t){return t?["for",null,null,null,_(n)]:(h(n),["block"])})}t=E(t,{make_seqs:!0,dead_code:!0,keep_comps:!0,no_warnings:!1});var m,b=n(),_=b.walk;return u=p(u),u=e(u),b.with_walkers({sub:function(u,n){if("string"==n[0]){var t=n[1];if(d(t))return["dot",_(u),t];if(/^[1-9][0-9]*$/.test(t)||"0"===t)return["sub",_(u),["num",parseInt(t,10)]]}},"if":B,toplevel:function(u){return["toplevel",i(this.scope,function(){return v(q(u,_))})]},"switch":function(u,n){var t=n.length-1;return["switch",_(u),q(n,function(u,n){var r=v(q(u[1],_));if(n==t&&r.length>0){var e=r[r.length-1];
+"break"!=e[0]||e[1]||r.pop()}return[u[0]?_(u[0]):null,r]})]},"function":C,defun:C,block:function(u){return u?A(["block",v(q(u,_))]):void 0},binary:function(u,n,t){return O(["binary",u,_(n),_(t)],function(u){return o(_(u),this)},function(){return this})},conditional:function(u,n,t){return f(_(u),_(n),_(t))},"try":function(u,n,t){return["try",v(q(u,_)),null!=n?[n[0],v(q(n[1],_))]:null,null!=t?v(q(t,_)):null]},"unary-prefix":function(u,n){n=_(n);var t=["unary-prefix",u,n];return"!"==u&&(t=o(t,r(n))),O(t,function(u){return _(u)},function(){return t})},name:function(u){switch(u){case"true":return["unary-prefix","!",["num",0]];case"false":return["unary-prefix","!",["num",1]]}},"new":function(u,n){return"name"!=u[0]||"Array"!=u[1]||m.has("Array")?void 0:1!=n.length?["array",n]:["call",["name","Array"],n]},call:function(u,n){return"name"!=u[0]||"Array"!=u[1]||1==n.length||m.has("Array")?void 0:["array",n]},"while":g},function(){return _(u)})}function v(u,n){var t=0,r=0;return u=u.replace(/[\\\b\f\n\r\t\x22\x27\u2028\u2029]/g,function(u){switch(u){case"\\":return"\\\\";case"\b":return"\\b";case"\f":return"\\f";case"\n":return"\\n";case"\r":return"\\r";case" ":return"\\t";case"\u2028":return"\\u2028";case"\u2029":return"\\u2029";case'"':return++t,'"';case"'":return++r,"'"}return u}),n&&(u=B(u)),t>r?"'"+u.replace(/\x27/g,"\\'")+"'":'"'+u.replace(/\x22/g,'\\"')+'"'}function B(u){return u.replace(/[\u0080-\uffff]/g,function(u){for(var n=u.charCodeAt(0).toString(16);n.length<4;)n="0"+n;return"\\u"+n})}function F(u,t){function r(u){return v(u,t.ascii_only)}function e(u){return u=u.toString(),t.ascii_only&&(u=B(u)),u}function i(u){return null==u&&(u=""),z&&(u=g(" ",t.indent_start+$*t.indent_level)+u),u}function o(u,n){null==n&&(n=1),$+=n;try{return u.apply(null,w(arguments,1))}finally{$-=n}}function a(u){if(z)return u.join(" ");for(var n=[],t=0;t<u.length;++t){var r=u[t+1];n.push(u[t]),r&&(/[a-z0-9_\x24]$/i.test(u[t].toString())&&/^[a-z0-9_\x24]/i.test(r.toString())||/[\+\-]$/.test(u[t].toString())&&/^[\+\-]/.test(r.toString()))&&n.push(" ")}return n.join("")}function c(u){return u.join(","+N)}function s(u){for(var n=O(u),t=1;t<arguments.length;++t){var r=arguments[t];if(r instanceof Function&&r(u)||u[0]==r)return"("+n+")"}return n}function f(u){if(1==u.length)return u[0];if(2==u.length){var n=u[1];return u=u[0],u.length<=n.length?u:n}return f([u[0],f(u.slice(1))])}function A(u){if("function"==u[0]||"object"==u[0])for(var n=w(P),t=n.pop(),r=n.pop();r;){if("stat"==r[0])return!0;if(("seq"!=r[0]&&"call"!=r[0]&&"dot"!=r[0]&&"sub"!=r[0]&&"conditional"!=r[0]||r[1]!==t)&&("binary"!=r[0]&&"assign"!=r[0]&&"unary-postfix"!=r[0]||r[2]!==t))return!1;t=r,r=n.pop()}return!y(R,u[0])}function h(u){var n,t=u.toString(10),r=[t.replace(/^0\./,".")];return Math.floor(u)===u?(r.push("0x"+u.toString(16).toLowerCase(),"0"+u.toString(8)),(n=/^(.*?)(0+)$/.exec(u))&&r.push(n[1]+"e"+n[2].length)):(n=/^0?\.(0+)(.*)$/.exec(u))&&r.push(n[2]+"e-"+(n[1].length+n[2].length),t.substr(t.indexOf("."))),f(r)}function p(u){if("do"==u[0])return O(["block",[u]]);for(var n=u;;){var t=n[0];if("if"==t){if(!n[3])return O(["block",[u]]);n=n[3]}else if("while"==t||"do"==t)n=n[2];else{if("for"!=t&&"for-in"!=t)break;n=n[4]}}return O(u)}function C(u,n,t,r){var i=r||"function";return u&&(i+=" "+e(u)),i+="("+c(q(n,e))+")",a([i,x(t)])}function F(u,n){for(var t=[],r=u.length-1,e=0;r>=e;++e){var o=u[e],a=O(o);";"!=a&&(z||e!=r||(a="while"==o[0]&&l(o[2])||k(o[0],["for","for-in"])&&l(o[4])||"if"==o[0]&&l(o[2])&&!o[3]||"if"==o[0]&&o[3]&&l(o[3])?a.replace(/;*\s*$/,";"):a.replace(/;+\s*$/,"")),t.push(a))}return n?t:q(t,i)}function D(u){var n=u.length;return 0==n?"{}":"{"+T+q(u,function(u,t){var r=u[1].length>0,e=o(function(){return i(u[0]?a(["case",O(u[0])+":"]):"default:")},.5)+(r?T+o(function(){return F(u[1]).join(T)}):"");return!z&&r&&n-1>t&&(e+=";"),e}).join(T)+T+i("}")}function x(u){return u?0==u.length?"{}":"{"+T+o(function(){return F(u).join(T)})+T+i("}"):";"}function S(u){var n=u[0],t=u[1];return null!=t&&(n=a([e(n),"=",s(t,"seq")])),n}function O(u){var n=u[0],t=I[n];if(!t)throw new Error("Can't find generator for \""+n+'"');P.push(u);var r=t.apply(n,u.slice(1));return P.pop(),r}t=E(t,{indent_start:0,indent_level:4,quote_keys:!1,space_colon:!1,beautify:!1,ascii_only:!1});var z=!!t.beautify,$=0,T=z?"\n":"",N=z?" ":"",I={string:r,num:h,name:e,toplevel:function(u){return F(u).join(T+T)},splice:function(u){var n=P[P.length-2][0];return y(j,n)?x.apply(this,arguments):q(F(u,!0),function(u,n){return n>0?i(u):u}).join(T)},block:x,"var":function(u){return"var "+c(q(u,S))+";"},"const":function(u){return"const "+c(q(u,S))+";"},"try":function(u,n,t){var r=["try",x(u)];return n&&r.push("catch","("+n[0]+")",x(n[1])),t&&r.push("finally",x(t)),a(r)},"throw":function(u){return a(["throw",O(u)])+";"},"new":function(u,t){return t=t.length>0?"("+c(q(t,O))+")":"",a(["new",s(u,"seq","binary","conditional","assign",function(u){var t=n(),r={};try{t.with_walkers({call:function(){throw r},"function":function(){return this}},function(){t.walk(u)})}catch(e){if(e===r)return!0;throw e}})+t])},"switch":function(u,n){return a(["switch","("+O(u)+")",D(n)])},"break":function(u){var n="break";return null!=u&&(n+=" "+e(u)),n+";"},"continue":function(u){var n="continue";return null!=u&&(n+=" "+e(u)),n+";"},conditional:function(u,n,t){return a([s(u,"assign","seq","conditional"),"?",s(n,"seq"),":",s(t,"seq")])},assign:function(u,n,t){return u&&u!==!0?u+="=":u="=",a([O(n),u,s(t,"seq")])},dot:function(u){var n=O(u),t=1;for("num"==u[0]?/\./.test(u[1])||(n+="."):A(u)&&(n="("+n+")");t<arguments.length;)n+="."+e(arguments[t++]);return n},call:function(u,n){var t=O(u);return A(u)&&(t="("+t+")"),t+"("+c(q(n,function(u){return s(u,"seq")}))+")"},"function":C,defun:C,"if":function(u,n,t){var r=["if","("+O(u)+")",t?p(n):O(n)];return t&&r.push("else",O(t)),a(r)},"for":function(u,n,t,r){var e=["for"];u=(null!=u?O(u):"").replace(/;*\s*$/,";"+N),n=(null!=n?O(n):"").replace(/;*\s*$/,";"+N),t=(null!=t?O(t):"").replace(/;*\s*$/,"");var i=u+n+t;return"; ; "==i&&(i=";;"),e.push("("+i+")",O(r)),a(e)},"for-in":function(u,n,t,r){return a(["for","("+(u?O(u).replace(/;+$/,""):O(n)),"in",O(t)+")",O(r)])},"while":function(u,n){return a(["while","("+O(u)+")",O(n)])},"do":function(u,n){return a(["do",O(n),"while","("+O(u)+")"])+";"},"return":function(u){var n=["return"];return null!=u&&n.push(O(u)),a(n)+";"},binary:function(u,n,t){var r=O(n),e=O(t);return(k(n[0],["assign","conditional","seq"])||"binary"==n[0]&&b[u]>b[n[1]])&&(r="("+r+")"),(k(t[0],["assign","conditional","seq"])||"binary"==t[0]&&b[u]>=b[t[1]]&&(t[1]!=u||!k(u,["&&","||","*"])))&&(e="("+e+")"),a([r,u,e])},"unary-prefix":function(u,n){var t=O(n);return"num"!=n[0]&&("unary-prefix"!=n[0]||y(_,u+n[1]))&&A(n)&&(t="("+t+")"),u+(m.is_alphanumeric_char(u.charAt(0))?" ":"")+t},"unary-postfix":function(u,n){var t=O(n);return"num"!=n[0]&&("unary-postfix"!=n[0]||y(_,u+n[1]))&&A(n)&&(t="("+t+")"),t+u},sub:function(u,n){var t=O(u);return A(u)&&(t="("+t+")"),t+"["+O(n)+"]"},object:function(u){return 0==u.length?"{}":"{"+T+o(function(){return q(u,function(u){if(3==u.length)return i(C(u[0],u[1][2],u[1][3],u[2]));var n=u[0],e=O(u[1]);return t.quote_keys?n=r(n):("number"==typeof n||!z&&+n+""==n)&&parseFloat(n)>=0?n=h(+n):d(n)||(n=r(n)),i(a(z&&t.space_colon?[n,":",e]:[n+":",e]))}).join(","+T)})+T+i("}")},regexp:function(u,n){return"/"+u+"/"+n},array:function(u){return 0==u.length?"[]":a(["[",c(q(u,function(u){return z||"atom"!=u[0]||"undefined"!=u[1]?s(u,"seq"):""})),"]"])},stat:function(u){return O(u).replace(/;*\s*$/,";")},seq:function(){return c(q(w(arguments),O))},label:function(u,n){return a([e(u),":",O(n)])},"with":function(u,n){return a(["with","("+O(u)+")",O(n)])},atom:function(u){return e(u)}},P=[];return O(u)}function D(u,n){var t=[0];return m.parse(function(){function r(u){return u.pos-c}function e(u){c=u.pos,t.push(c)}function i(){var u=a.apply(this,arguments);u:if((!o||"keyword"!=o.type)&&r(u)>n)switch(u.type){case"keyword":case"atom":case"name":case"punc":e(u);break u}return o=u,u}var o,a=m.tokenizer(u),c=0;return i.context=function(){return a.context.apply(this,arguments)},i}()),t.map(function(n,r){return u.substring(n,t[r+1]||u.length)}).join("\n")}function g(u,n){if(0>=n)return"";if(1==n)return u;var t=g(u,n>>1);return t+=t,1&n&&(t+=u),t}function E(u,n){var t={};u===!0&&(u={});for(var r in n)y(n,r)&&(t[r]=u&&y(u,r)?u[r]:n[r]);return t}function d(u){return/^[a-z_$][a-z0-9_$]*$/i.test(u)&&"this"!=u&&!y(m.KEYWORDS_ATOM,u)&&!y(m.RESERVED_WORDS,u)&&!y(m.KEYWORDS,u)}function y(u,n){return Object.prototype.hasOwnProperty.call(u,n)}var m=t("./parse-js"),w=m.slice,k=m.member,b=m.PRECEDENCE,_=m.OPERATORS,x=function(){var u="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_";return function(n){var t="";do t=u.charAt(n%54)+t,n=Math.floor(n/54);while(n>0);return t}}();r.prototype={has:function(u){for(var n=this;n;n=n.parent)if(y(n.names,u))return n},has_mangled:function(u){for(var n=this;n;n=n.parent)if(y(n.rev_mangled,u))return n},toJSON:function(){return{names:this.names,uses_eval:this.uses_eval,uses_with:this.uses_with}},next_mangled:function(){for(;;){var u,n=x(++this.cname);if(u=this.has_mangled(n),!(u&&this.refs[u.rev_mangled[n]]===u||(u=this.has(n),u&&u!==this&&this.refs[n]===u&&!u.has_mangled(n)||y(this.refs,n)&&null==this.refs[n]||!d(n))))return n}},set_mangle:function(u,n){return this.rev_mangled[n]=u,this.mangled[u]=n},get_mangled:function(u,n){if(this.uses_eval||this.uses_with)return u;var t=this.has(u);return t?y(t.mangled,u)?t.mangled[u]:n?t.set_mangle(u,t.next_mangled()):u:u},define:function(u){return null!=u?this.names[u]=u:void 0}};var q,S=function(){},O=function(){function u(t){switch(t[0]){case"string":case"num":return t[1];case"name":case"atom":switch(t[1]){case"true":return!0;case"false":return!1}break;case"unary-prefix":switch(t[1]){case"!":return!u(t[2]);case"typeof":return typeof u(t[2]);case"~":return~u(t[2]);case"-":return-u(t[2]);case"+":return+u(t[2])}break;case"binary":var r=t[2],e=t[3];switch(t[1]){case"&&":return u(r)&&u(e);case"||":return u(r)||u(e);case"|":return u(r)|u(e);case"&":return u(r)&u(e);case"^":return u(r)^u(e);case"+":return u(r)+u(e);case"*":return u(r)*u(e);case"/":return u(r)/u(e);case"-":return u(r)-u(e);case"<<":return u(r)<<u(e);case">>":return u(r)>>u(e);case">>>":return u(r)>>>u(e);case"==":return u(r)==u(e);case"===":return u(r)===u(e);case"!=":return u(r)!=u(e);case"!==":return u(r)!==u(e);case"<":return u(r)<u(e);case"<=":return u(r)<=u(e);case">":return u(r)>u(e);case">=":return u(r)>=u(e);case"in":return u(r)in u(e);case"instanceof":return u(r)instanceof u(e)}}throw n}var n={};return function(t,r,e){try{var i,o=u(t);switch(typeof o){case"string":i=["string",o];break;case"number":i=["num",o];break;case"boolean":i=["name",String(o)];break;default:throw new Error("Can't handle constant of type: "+typeof o)}return r.call(t,i,o)}catch(a){if(a===n){if("binary"!=t[0]||"==="!=t[1]&&"!=="!=t[1]||!(A(t[2])&&A(t[3])||s(t[2])&&s(t[3]))){if(e&&"binary"==t[0]&&("||"==t[1]||"&&"==t[1]))try{var c=u(t[2]);t="&&"==t[1]&&(c?t[3]:c)||"||"==t[1]&&(c?c:t[3])||t}catch(f){}}else t[1]=t[1].substr(0,2);return e?e.call(t,t):null}throw a}}}(),R=m.array_to_hash(["name","array","object","string","dot","sub","call","regexp"]),j=m.array_to_hash(["if","while","do","for","for-in","with"]);!function(){function u(u){this.v=u}q=function(n,t,r){for(var e=[],i=0;i<n.length;++i){var o=t.call(r,n[i],i);o instanceof u?e.unshift(o.v):e.push(o)}return e},q.at_top=function(n){return new u(n)}}(),u.ast_walker=n,u.ast_mangle=i,u.ast_squeeze=C,u.gen_code=F,u.ast_add_scope=e,u.set_logger=function(u){S=u},u.make_string=v,u.split_lines=D,u.MAP=q,u.ast_squeeze_more=t("./squeeze-more").ast_squeeze_more}(n["./process"]),function(u){function n(u){var n=e.ast_walker(),t=n.walk;return n.with_walkers({call:function(u,n){return"dot"==u[0]&&"toString"==u[2]&&0==n.length?["binary","+",u[1],["string",""]]:void 0}},function(){return t(u)})}{var r=t("./parse-js"),e=t("./process");r.slice,r.member,r.PRECEDENCE,r.OPERATORS}u.ast_squeeze_more=n}(n["./squeeze-more"]),t("./process").ast_squeeze_more=t("./squeeze-more").ast_squeeze_more,window.uglify=u}();
View
2  download/services.json
@@ -1 +1 @@
-["bitbucket","bitly","blogger","citeulike","dailymotion","delicious","deviantart","disqus","dribbble","facebook_page","fancy","flickr","foomark","formspring","forrst","foursquare","gimmebar","github","googleplus","hypem","instapaper","iusethis","lastfm","librarything","linkedin","mendeley","miso","mlkshk","pinboard","pocket","posterous","quora","reddit","rss","slideshare","snipplr","stackoverflow","tumblr","twitter","vimeo","wikipedia","wordpress","youtube","zotero"]
+["atom","bitbucket","bitly","blogger","citeulike","dailymotion","delicious","deviantart","disqus","dribbble","facebook_page","fancy","flickr","foomark","formspring","forrst","foursquare","gimmebar","github","googleplus","hypem","instapaper","iusethis","lastfm","librarything","linkedin","mendeley","miso","mlkshk","pinboard","pocket","posterous","quora","reddit","rss","slideshare","snipplr","stackoverflow","tumblr","twitter","vimeo","wikipedia","wordpress","youtube","zotero"]
View
70 jquery.lifestream.js
@@ -1,9 +1,9 @@
/*!
* jQuery Lifestream Plug-in
* Show a stream of your online activity
- * @version 0.4.2
+ * @version 0.4.3
* @author Christian Vuerings et al.
- * @copyright Copyright 2011, Christian Vuerings - http://denbuzze.com
+ * @copyright Copyright 2014, Christian Vuerings - http://denbuzze.com
* @license https://github.com/christianv/jquery-lifestream/blob/master/LICENSE MIT
*/
/*global jQuery */
@@ -194,6 +194,55 @@
}( jQuery ));
(function($) {
+$.fn.lifestream.feeds.atom = function( config, callback ) {
+
+ var template = $.extend({},
+ {
+ posted: 'posted <a href="${link.href}">${title.content}</a>'
+ },
+ config.template),
+
+ /**
+ * Parse the input from atom feed
+ */
+ parseAtom = function( input ) {
+ var output = [], list = [], i = 0, j = 0, url = '';
+ if(input.query && input.query.count && input.query.count > 0) {
+ list = input.query.results.feed.entry;
+ j = list.length;
+
+ for( ; i<j; i++) {
+ var item = list[i];
+
+ output.push({
+ url: item.link.href,
+ date: new Date( item.updated ),
+ config: config,
+ html: $.tmpl( template.posted, item )
+ });
+ }
+ }
+ return output;
+ };
+
+ $.ajax({
+ url: $.fn.lifestream.createYqlUrl('select * from xml where url="' +
+ config.user + '"'),
+ dataType: 'jsonp',
+ success: function( data ) {
+ callback(parseAtom(data));
+ }
+ });
+
+ // Expose the template.
+ // We use this to check which templates are available
+ return {
+ "template" : template
+ };
+
+};
+})(jQuery);
+(function($) {
$.fn.lifestream.feeds.bitbucket = function( config, callback ) {
var template = $.extend({},
@@ -2146,7 +2195,7 @@ $.fn.lifestream.feeds.stackoverflow = function( config, callback ) {
};
$.ajax({
- url: "http://api.stackoverflow.com/1.1/users/" + config.user +
+ url: "https://api.stackoverflow.com/1.1/users/" + config.user +
"/timeline?jsonp",
dataType: "jsonp",
jsonp: 'jsonp',
@@ -2176,7 +2225,8 @@ $.fn.lifestream.feeds.stackoverflow = function( config, callback ) {
};
};
-})(jQuery);(function($) {
+})(jQuery);
+(function($) {
$.fn.lifestream.feeds.tumblr = function( config, callback ) {
var template = $.extend({},
@@ -2338,7 +2388,7 @@ $.fn.lifestream.feeds.tumblr = function( config, callback ) {
var link = function( t ) {
return t.replace(
- /[a-z]+:\/\/[a-z0-9\-_]+\.[a-z0-9\-_:~%&\?\/.=]+[^:\.,\)\s*$]/ig,
+ /([a-z]+:\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/ig,
function( m ) {
return '<a href="' + m + '">' +
( ( m.length > 25 ) ? m.substr( 0, 24 ) + '...' : m ) +
@@ -2359,7 +2409,7 @@ $.fn.lifestream.feeds.tumblr = function( config, callback ) {
return t.replace(
/(^|[^\w'"]+)\#([a-zA-Z0-9ÅåÄäÖöØøÆæÉéÈèÜüÊêÛûÎî_]+)/g,
function( m, m1, m2 ) {
- return m1 + '<a href="http://www.twitter.com/search?q=%23' +
+ return m1 + '<a href="http://search.twitter.com/search?q=%23' +
m2 + '">#' + m2 + '</a>';
}
);
@@ -2384,7 +2434,7 @@ $.fn.lifestream.feeds.tumblr = function( config, callback ) {
"date": new Date(status.created_at * 1000), // unix time
"config": config,
"html": $.tmpl( template.posted, {
- "tweet": linkify(status.text),
+ "tweet": linkify($('<div/>').html(status.text).text()),
"complete_url": 'http://twitter.com/' + config.user +
"/status/" + status.id_str
} ),
@@ -2483,14 +2533,16 @@ $.fn.lifestream.feeds.vimeo = function( config, callback ) {
var output = [];
// check for likes & parse
- if ( response.query.results.videos[0].video.length > 0 ) {
+ if ( response.query.results.videos[0] != null &&
+ response.query.results.videos[0].video.length > 0 ) {
output = output.concat(parseVimeo(
response.query.results.videos[0].video
));
}
// check for uploads & parse
- if ( response.query.results.videos[1].video.length > 0 ) {
+ if ( response.query.results.videos[1] != null &&
+ response.query.results.videos[1].video.length > 0 ) {
output = output.concat(
parseVimeo(response.query.results.videos[1].video, 'posted')
);
View
8 jquery.lifestream.min.js
@@ -1,10 +1,10 @@
/*!
* jQuery Lifestream Plug-in
* Show a stream of your online activity
- * @version 0.4.2
+ * @version 0.4.3
* @author Christian Vuerings et al.
- * @copyright Copyright 2011, Christian Vuerings - http://denbuzze.com
+ * @copyright Copyright 2014, Christian Vuerings - http://denbuzze.com
* @license https://github.com/christianv/jquery-lifestream/blob/master/LICENSE MIT
*/
-!function(e){"use strict";e.fn.lifestream=function(t){return this.each(function(){var r=e(this),a=jQuery.extend({classname:"lifestream",feedloaded:null,limit:10,list:[]},t),n={count:a.list.length,items:[]},s=jQuery.extend(!0,{},a),u=function(t){e.merge(n.items,t),n.items.sort(function(e,t){return t.date-e.date});for(var s,u=n.items,o=u.length<a.limit?u.length:a.limit,l=0,i=e('<ul class="'+a.classname+'"/>');o>l;l++)s=u[l],s.html&&e('<li class="'+a.classname+"-"+s.config.service+'">').data("name",s.config.service).data("url",s.url||"#").data("time",s.date).append(s.html).appendTo(i);r.html(i),e.isFunction(a.feedloaded)&&a.feedloaded()},o=function(){var t=0,r=a.list.length;for(delete s.list;r>t;t++){var n=a.list[t];e.fn.lifestream.feeds[n.service]&&e.isFunction(e.fn.lifestream.feeds[n.service])&&n.user&&(n._settings=s,e.fn.lifestream.feeds[n.service](n,u))}};jQuery.tmpl?o():jQuery.getScript("//ajax.aspnetcdn.com/ajax/jquery.templates/beta1/jquery.tmpl.min.js",o)})},e.fn.lifestream.createYqlUrl=function(e){return(("https:"===document.location.protocol?"https":"http")+"://query.yahooapis.com/v1/public/yql?q=__QUERY__"+"&env="+"store://datatables.org/alltableswithkeys&format=json").replace("__QUERY__",encodeURIComponent(e))},e.fn.lifestream.feeds=e.fn.lifestream.feeds||{},Object.keys||(Object.keys=function(e){if(e!==Object(e))throw new TypeError("Object.keys called on non-object");var t,r=[];for(t in e)Object.prototype.hasOwnProperty.call(e,t)&&r.push(t);return r})}(jQuery),function(e){e.fn.lifestream.feeds.bitbucket=function(t,r){var a=e.extend({},{commit:'<a href="http://bitbucket.org/${owner}/${name}/changeset/${node}/">committed</a> at <a href="http://bitbucket.org/${owner}/${name}/">${owner}/${name}</a>',pullrequest_fulfilled:'fulfilled a pull request at <a href="http://bitbucket.org/${owner}/${name}/">${owner}/${name}</a>',pullrequest_rejected:'rejected a pull request at <a href="http://bitbucket.org/${owner}/${name}/">${owner}/${name}</a>',pullrequest_created:'created a pull request at <a href="http://bitbucket.org/${owner}/${name}/">${owner}/${name}</a>',create:'created a new project at <a href="http://bitbucket.org/${owner}/${name}/">${owner}/${name}</a>',fork:'forked <a href="http://bitbucket.org/${owner}/${name}/">${owner}/${name}</a>'},t.template),n=["commit","pullrequest_fulfilled","pullrequest_rejected","pullrequest_created","create","fork"],s=function(t){return-1!==e.inArray(t.event,n)&&t.repository?"commit"===t.event?e.tmpl(a.commit,{owner:t.repository.owner,name:t.repository.name,node:t.node}):e.tmpl(a[t.event],{owner:t.repository.owner,name:t.repository.name}):void 0},u=function(r){var a=[];return r.query&&r.query.count&&r.query.count>0&&e.each(r.query.results.json,function(){a.push({date:new Date(this.events.created_on.replace(/-/g,"/")),config:t,html:s(this.events)})}),a};return e.ajax({url:e.fn.lifestream.createYqlUrl('select events.event,events.node, events.created_on,events.repository.name, events.repository.owner from json where url = "https://api.bitbucket.org/1.0/users/'+t.user+'/events/"'),dataType:"jsonp",success:function(e){r(u(e))}}),{template:a}}}(jQuery),function(e){e.fn.lifestream.feeds.bitly=function(t,r){var a=e.extend({},{created:'created URL <a href="${short_url}" title="${title}">${short_url}</a>'},t.template);return e.ajax({url:e.fn.lifestream.createYqlUrl('select data.short_url, data.created, data.title from json where url="http://bitly.com/u/'+t.user+'.json"'),dataType:"jsonp",success:function(n){var s,u,o=[],l=0;if(n.query&&n.query.count&&n.query.results.json)for(u=n.query.results.json,s=u.length;s>l;l++){var i=u[l].data;o.push({date:new Date(1e3*i.created),config:t,html:e.tmpl(a.created,i)})}r(o)}}),{template:a}}}(jQuery),function(e){e.fn.lifestream.feeds.blogger=function(t,r){var a=e.extend({},{posted:'posted <a href="${origLink}">${title}</a>'},t.template),n=function(r){var n,s,u,o,l,i=[],c=0;if(r.query&&r.query.count&&r.query.count>0&&r.query.results.feed.entry)for(n=r.query.results.feed.entry,s=n.length;s>c;c++){if(u=n[c],!u.origLink)for(o=0,l=u.link.length;l>o;o++)"alternate"===u.link[o].rel&&(u.origLink=u.link[o].href);u.origLink&&(u.title.content&&(u.title=u.title.content),i.push({date:new Date(u.published),config:t,html:e.tmpl(a.posted,u)}))}return i};return e.ajax({url:e.fn.lifestream.createYqlUrl('select * from xml where url="http://'+t.user+'.blogspot.com/feeds/posts/default"'),dataType:"jsonp",success:function(e){r(n(e))}}),{template:a}}}(jQuery),function(e){e.fn.lifestream.feeds.citeulike=function(t,r){var a=e.extend({},{saved:'saved <a href="${href}">${title}</a> by ${authors}'},t.template),n=function(r){var n,s=[],u=0;if(r&&r.length&&r.length>0)for(n=r.length;n>u;u++){var o=r[u];s.push({date:new Date(o.date),config:t,url:"http://www.citeulike.org/user/"+t.user,html:e.tmpl(a.saved,o)})}return s};return e.ajax({url:"http://www.citeulike.org/json/user/"+t.user,dataType:"jsonp",success:function(e){r(n(e))}}),{template:a}}}(jQuery),function(e){e.fn.lifestream.feeds.dailymotion=function(t,r){var a=e.extend({},{uploaded:'uploaded a video <a href="${link}">${title[0]}</a>'},t.template),n=function(r){var n,s,u,o=[],l=0;if(r.query&&r.query.count&&r.query.count>0&&r.query.results.rss.channel.item)for(n=r.query.results.rss.channel.item,s=n.length;s>l;l++)u=n[l],o.push({date:new Date(u.pubDate),config:t,html:e.tmpl(a.uploaded,u)});return o};return e.ajax({url:e.fn.lifestream.createYqlUrl('select * from xml where url="http://www.dailymotion.com/rss/user/'+t.user+'"'),dataType:"jsonp",success:function(e){r(n(e))}}),{template:a}}}(jQuery),function(e){e.fn.lifestream.feeds.delicious=function(t,r){var a=e.extend({},{bookmarked:'bookmarked <a href="${u}">${d}</a>'},t.template);return e.ajax({url:"http://feeds.delicious.com/v2/json/"+t.user,dataType:"jsonp",success:function(n){var s,u=[],o=0;if(n&&n.length&&n.length>0)for(s=n.length;s>o;o++){var l=n[o];u.push({date:new Date(l.dt),config:t,html:e.tmpl(a.bookmarked,l)})}r(u)}}),{template:a}}}(jQuery),function(e){e.fn.lifestream.feeds.deviantart=function(t,r){var a=e.extend({},{posted:'posted <a href="${link}">${title}</a>'},t.template);return e.ajax({url:e.fn.lifestream.createYqlUrl('select title,link,pubDate from rss where url="http://backend.deviantart.com/rss.xml?q=gallery%3A'+encodeURIComponent(t.user)+"&type=deviation"+'" | unique(field="title")'),dataType:"jsonp",success:function(n){var s,u,o,l=[],i=0;if(n.query&&n.query.count>0)for(s=n.query.results.item,o=s.length;o>i;i++)u=s[i],l.push({date:new Date(u.pubDate),config:t,html:e.tmpl(a.posted,u)});r(l)}}),{template:a}}}(jQuery),function(e){e.fn.lifestream.feeds.disqus=function(t,r){var a=e.extend({},{post:'commented on <a href="${url}">${thread.title}</a>',thread_like:'liked <a href="${url}">${thread.title}</a>'},t.template),n=function(r){var n,s,u=[],o=0;if(r)for(n=r.length;n>o;o++)s=r[o],"reply"!==s.type&&u.push({date:new Date(s.createdAt),config:t,html:e.tmpl(a[s.type],s.object)});return u};return e.ajax({url:"https://disqus.com/api/3.0/users/listActivity.json",data:{user:t.user,api_key:t.key},dataType:"jsonp",success:function(e){return 2===e.code?(r([]),console&&console.error&&console.error("Error loading Disqus stream.",e.response),void 0):(r(n(e.response)),void 0)}}),{template:a}}}(jQuery),function(e){e.fn.lifestream.feeds.dribbble=function(t,r){var a=e.extend({},{posted:'posted a shot <a href="${url}">${title}</a>'},t.template);return e.ajax({url:"http://api.dribbble.com/players/"+t.user+"/shots",dataType:"jsonp",success:function(n){var s,u=[],o=0;if(n&&n.total)for(s=n.shots.length;s>o;o++){var l=n.shots[o];u.push({date:new Date(l.created_at),config:t,html:e.tmpl(a.posted,l)})}r(u)}}),{template:a}}}(jQuery),function(e){e.fn.lifestream.feeds.facebook_page=function(t,r){var a=e.extend({},{wall_post:'post on wall <a href="${link}">${title}</a>'},t.template),n=function(r){var n,s,u=[],o=0;if(r.query&&r.query.count&&r.query.count>0)for(n=r.query.results.rss.channel.item,s=n.length;s>o;o++){var l=n[o];e.trim(l.title)&&u.push({date:new Date(l.pubDate),config:t,html:e.tmpl(a.wall_post,l)})}return u};return e.ajax({url:e.fn.lifestream.createYqlUrl('select * from xml where url="www.facebook.com/feeds/page.php?id='+t.user+'&format=rss20"'),dataType:"jsonp",success:function(e){r(n(e))}}),{template:a}}}(jQuery),function(e){"use strict";e.fn.lifestream.feeds.fancy=function(t,r){var a=e.extend({},{fancied:'fancy\'d <a href="${link}">${title}</a>'},t.template),n=function(r){var n,s=[],u=0;if(r.query&&r.query.count&&r.query.count>0)for(n=r.query.count;n>u;u++){var o=r.query.results.item[u];s.push({date:new Date(o.pubDate),config:t,html:e.tmpl(a.fancied,o)})}return s};return e.ajax({url:e.fn.lifestream.createYqlUrl('SELECT * FROM xml WHERE url="http://www.fancy.com/rss/'+t.user+'" AND itemPath="/rss/channel/item"'),dataType:"jsonp",success:function(e){r(n(e))}}),{template:a}}}(jQuery),function(e){e.fn.lifestream.feeds.flickr=function(t,r){var a=e.extend({},{posted:'posted a photo <a href="${link}">${title}</a>'},t.template);return e.ajax({url:"http://api.flickr.com/services/feeds/photos_public.gne?id="+t.user+"&lang=en-us&format=json",dataType:"jsonp",jsonp:"jsoncallback",success:function(n){var s,u=[],o=0;if(n&&n.items&&n.items.length>0)for(s=n.items.length;s>o;o++){var l=n.items[o];u.push({date:new Date(l.published),config:t,html:e.tmpl(a.posted,l)})}r(u)}}),{template:a}}}(jQuery),function(e){e.fn.lifestream.feeds.foomark=function(t,r){var a=e.extend({},{bookmarked:'bookmarked <a href="${url}">${url}</a>'},t.template);return e.ajax({url:"http://api.foomark.com/urls/list/",data:{format:"jsonp",username:t.user},dataType:"jsonp",success:function(n){var s,u=[],o=0;if(n&&n.length&&n.length>0)for(s=n.length;s>o;o++){var l=n[o];u.push({date:new Date(l.created_at.replace(/-/g,"/")),config:t,html:e.tmpl(a.bookmarked,l)})}r(u)}}),{template:a}}}(jQuery),function(e){e.fn.lifestream.feeds.formspring=function(t,r){var a=e.extend({},{answered:'answered a question <a href="${link}">${title}</a>'},t.template),n=function(r){var n,s,u,o=[],l=0;if(r.query&&r.query.count&&r.query.count>0&&r.query.results.rss.channel.item)for(n=r.query.results.rss.channel.item,s=n.length;s>l;l++)u=n[l],o.push({date:new Date(u.pubDate),config:t,html:e.tmpl(a.answered,u)});return o};return e.ajax({url:e.fn.lifestream.createYqlUrl('select * from xml where url="http://www.formspring.me/profile/'+t.user+'.rss"'),dataType:"jsonp",success:function(e){r(n(e))}}),{template:a}}}(jQuery),function(e){e.fn.lifestream.feeds.forrst=function(t,r){var a=e.extend({},{posted:'posted a ${post_type} <a href="${post_url}">${title}</a>'},t.template);return e.ajax({url:"http://forrst.com/api/v2/users/posts?username="+t.user,dataType:"jsonp",success:function(n){var s,u=[],o=0;if(n&&n.resp.length&&n.resp.length>0)for(s=n.resp.length;s>o;o++){var l=n.resp[o];u.push({date:new Date(l.created_at.replace(" ","T")),config:t,html:e.tmpl(a.posted,l)})}r(u)}}),{template:a}}}(jQuery),function(e){e.fn.lifestream.feeds.foursquare=function(t,r){var a=e.extend({},{checkedin:'checked in @ <a href="${link}">${title}</a>'},t.template),n=function(r){var n,s=[],u=0;if(r.query&&r.query.count&&r.query.count>0)for(n=r.query.count;n>u;u++){var o=r.query.results.item[u];s.push({date:new Date(o.pubDate),config:t,html:e.tmpl(a.checkedin,o)})}return s};return e.ajax({url:e.fn.lifestream.createYqlUrl('select * from rss where url="https://feeds.foursquare.com/history/'+t.user+'.rss"'),dataType:"jsonp",success:function(e){r(n(e))}}),{template:a}}}(jQuery),function(e){e.fn.lifestream.feeds.gimmebar=function(t,r){var a=e.extend({},{bookmarked:'bookmarked <a href="${short_url}">${title}</a>'},t.template);return e.ajax({url:"https://gimmebar.com/api/v0/public/assets/"+t.user+".json?jsonp_callback=?",dataType:"json",success:function(n){n=n.records;var s,u=[],o=0;if(n&&n.length&&n.length>0)for(s=n.length;s>o;o++){var l=n[o];u.push({date:new Date(1e3*l.date),config:t,html:e.tmpl(a.bookmarked,l)})}r(u)}}),{template:a}}}(jQuery),function(e){e.fn.lifestream.feeds.github=function(t,r){var a=e.extend({},{commitCommentEvent:'commented on <a href="http://github.com/${status.repo.name}">${status.repo.name}</a>',createBranchEvent:'created branch <a href="http://github.com/${status.repo.name}/tree/${status.payload.ref}">${status.payload.ref}</a> at <a href="http://github.com/${status.repo.name}">${status.repo.name}</a>',createRepositoryEvent:'created repository <a href="http://github.com/${status.repo.name}">${status.repo.name}</a>',createTagEvent:'created tag <a href="http://github.com/${status.repo.name}/tree/${status.payload.ref}">${status.payload.ref}</a> at <a href="http://github.com/${status.repo.name}">${status.repo.name}</a>',deleteBranchEvent:'deleted branch ${status.payload.ref} at <a href="http://github.com/${status.repo.name}">${status.repo.name}</a>',deleteTagEvent:'deleted tag ${status.payload.ref} at <a href="http://github.com/${status.repo.name}">${status.repo.name}</a>',followEvent:'started following <a href="http://github.com/${status.payload.target.login}">${status.payload.target.login}</a>',forkEvent:'forked <a href="http://github.com/${status.repo.name}">${status.repo.name}</a>',gistEvent:'${status.payload.action} gist <a href="http://gist.github.com/${status.payload.gist.id}">${status.payload.gist.id}</a>',issueCommentEvent:'commented on issue <a href="http://github.com/${status.repo.name}/issues/${status.payload.issue.number}">${status.payload.issue.number}</a> on <a href="http://github.com/${status.repo.name}">${status.repo.name}</a>',issuesEvent:'${status.payload.action} issue <a href="http://github.com/${status.repo.name}/issues/${status.payload.issue.number}">${status.payload.issue.number}</a> on <a href="http://github.com/${status.repo.name}">${status.repo.name}</a>',pullRequestEvent:'${status.payload.action} pull request <a href="http://github.com/${status.repo.name}/pull/${status.payload.number}">${status.payload.number}</a> on <a href="http://github.com/${status.repo.name}">${status.repo.name}</a>',pushEvent:'pushed to <a href="http://github.com/${status.repo.name}/tree/${status.payload.ref}">${status.payload.ref}</a> at <a href="http://github.com/${status.repo.name}">${status.repo.name}</a>',watchEvent:'started watching <a href="http://github.com/${status.repo.name}">${status.repo.name}</a>'},t.template),n=function(t){return"CommitCommentEvent"===t.type?e.tmpl(a.commitCommentEvent,{status:t}):"CreateEvent"===t.type&&"branch"===t.payload.ref_type?e.tmpl(a.createBranchEvent,{status:t}):"CreateEvent"===t.type&&"repository"===t.payload.ref_type?e.tmpl(a.createRepositoryEvent,{status:t}):"CreateEvent"===t.type&&"tag"===t.payload.ref_type?e.tmpl(a.createTagEvent,{status:t}):"DeleteEvent"===t.type&&"branch"===t.payload.ref_type?e.tmpl(a.deleteBranchEvent,{status:t}):"DeleteEvent"===t.type&&"tag"===t.payload.ref_type?e.tmpl(a.deleteTagEvent,{status:t}):"FollowEvent"===t.type?e.tmpl(a.followEvent,{status:t}):"ForkEvent"===t.type?e.tmpl(a.forkEvent,{status:t}):"GistEvent"===t.type?("create"===t.payload.action?t.payload.action="created":"update"===t.payload.action&&(t.payload.action="updated"),e.tmpl(a.gistEvent,{status:t})):"IssueCommentEvent"===t.type?e.tmpl(a.issueCommentEvent,{status:t}):"IssuesEvent"===t.type?e.tmpl(a.issuesEvent,{status:t}):"PullRequestEvent"===t.type?e.tmpl(a.pullRequestEvent,{status:t}):"PushEvent"===t.type?(t.payload.ref=t.payload.ref.split("/")[2],e.tmpl(a.pushEvent,{status:t})):"WatchEvent"===t.type?e.tmpl(a.watchEvent,{status:t}):void 0},s=function(e){var r,a=[],s=0;if(e.query&&e.query.count&&e.query.count>0)for(r=e.query.count;r>s;s++){var u=e.query.results.json[s].json;a.push({date:new Date(u.created_at),config:t,html:n(u),url:"https://github.com/"+t.user})}return a};return e.ajax({url:e.fn.lifestream.createYqlUrl('select json.type, json.actor, json.repo, json.payload, json.created_at from json where url="https://api.github.com/users/'+t.user+'/events/public?per_page=100"'),dataType:"jsonp",success:function(e){r(s(e))}}),{template:a}}}(jQuery),function(e){e.fn.lifestream.feeds.googleplus=function(t,r){var a=e.extend({},{posted:'<a href="${actor.url}">${actor.displayName}</a> has posted a new entry <a href="${url}" title="${id}">${title}</a> <!--With--> ${object.replies.totalItems} replies, ${object.plusoners.totalItems} +1s, ${object.resharers.totalItems} Reshares'},t.template),n=function(r){var n,s,u=[],o=0;if(r&&r.items)for(n=r.items.length;n>o;o++)s=r.items[o],u.push({date:new Date(s.published),config:t,html:e.tmpl(a.posted,s)});return u};return e.ajax({url:"https://www.googleapis.com/plus/v1/people/"+t.user+"/activities/public",data:{key:t.key},dataType:"jsonp",success:function(e){return e.error?(r([]),console&&console.error&&console.error("Error loading Google+ stream.",e.error),void 0):(r(n(e)),void 0)}}),{template:a}}}(jQuery),function(e){e.fn.lifestream.feeds.hypem=function(t,r){t.type&&"history"===t.type&&"loved"===t.type||(t.type="loved");var a=e.extend({},{loved:'loved <a href="http://hypem.com/item/${mediaid}">${title}</a> by <a href="http://hypem.com/artist/${artist}">${artist}</a>',history:'listened to <a href="http://hypem.com/item/${mediaid}">${title}</a> by <a href="http://hypem.com/artist/${artist}">${artist}</a>'},t.template);return e.ajax({url:"http://hypem.com/playlist/"+t.type+"/"+t.user+"/json/1/data.js",dataType:"json",success:function(n){var s=[],u=0,o=-1;for(var l in n)n.hasOwnProperty(l)&&o++;if(n&&o>0)for(;o>u;u++){var i=n[u];s.push({date:new Date(1e3*("history"===t.type?i.dateplayed:i.dateloved)),config:t,html:e.tmpl("history"===t.type?a.history:a.loved,i)})}r(s)}}),{template:a}}}(jQuery),function(e){e.fn.lifestream.feeds.instapaper=function(t,r){var a=e.extend({},{loved:'loved <a href="${link}">${title}</a>'},t.template),n=function(r){var n,s,u,o=[],l=0;if(r.query&&r.query.count&&r.query.count>0&&r.query.results.rss.channel.item)for(n=r.query.results.rss.channel.item,s=n.length;s>l;l++)u=n[l],o.push({date:new Date(u.pubDate),config:t,html:e.tmpl(a.loved,u)});return o};return e.ajax({url:e.fn.lifestream.createYqlUrl('select * from xml where url="http://www.instapaper.com/starred/rss/'+t.user+'"'),dataType:"jsonp",success:function(e){r(n(e))}}),{template:a}}}(jQuery),function(e){e.fn.lifestream.feeds.iusethis=function(t,r){var a=e.extend({},{global:'${action} <a href="${link}">${what}</a> on (${os})'},t.template),n=function(r){var n,s,u,o,l,i,c,p,f,d,m,h,y=[],v=0,g=["iPhone","OS X","Windows"];if(r.query&&r.query.count&&r.query.count>0&&r.query.results.rss)for(i=r.query.results.rss.length,f=["started using","stopped using","stopped loving","Downloaded","commented on","updated entry for","started loving","registered"],l=f.length;i>v;v++)for(h=g[v],n=r.query.results.rss[v].channel.item,s=0,u=n.length;u>s;s++){for(c=n[s],p=c.title.replace(t.user+" ",""),o=0;l>o;o++)if(p.indexOf(f[o])>-1){d=f[o];break}m=p.split(d),y.push({date:new Date(c.pubDate),config:t,html:e.tmpl(a.global,{action:d.toLowerCase(),link:c.link,what:m[1],os:h})})}return y};return e.ajax({url:e.fn.lifestream.createYqlUrl('select * from xml where url="http://iphone.iusethis.com/user/feed.rss/'+t.user+'" or '+'url="http://osx.iusethis.com/user/feed.rss/'+t.user+'" or '+'url="http://win.iusethis.com/user/feed.rss/'+t.user+'"'),dataType:"jsonp",success:function(e){r(n(e))}}),{template:a}}}(jQuery),function(e){e.fn.lifestream.feeds.lastfm=function(t,r){var a=e.extend({},{loved:'loved <a href="${url}">${name}</a> by <a href="${artist.url}">${artist.name}</a>'},t.template),n=function(r){var n,s,u=[],o=0;if(r.query&&r.query.count&&r.query.count>0&&r.query.results.lovedtracks&&r.query.results.lovedtracks.track)for(n=r.query.results.lovedtracks.track,s=n.length;s>o;o++){var l=n[o],i=l.nowplaying?new Date:l.date.uts;u.push({date:new Date(parseInt(1e3*i,10)),config:t,html:e.tmpl(a.loved,l)})}return u};return e.ajax({url:e.fn.lifestream.createYqlUrl('select * from xml where url="http://ws.audioscrobbler.com/2.0/user/'+t.user+'/lovedtracks.xml"'),dataType:"jsonp",success:function(e){r(n(e))}}),{template:a}}}(jQuery),function(e){e.fn.lifestream.feeds.librarything=function(t,r){var a=e.extend({},{book:'added <a href="http://www.librarything.com/work/book/${book.book_id}" title="${book.title} by ${book.author_fl}">${book.title} by ${book.author_fl}</a> to my library'},t.template),n=function(r){var n=[],s="";if(r.books)for(s in r.books)if(r.books.hasOwnProperty(s)){var u=r.books[s];n.push({date:new Date(1e3*u.entry_stamp),config:t,html:e.tmpl(a.book,{book:u}),url:"http://www.librarything.com/profile/"+t.user})}return n};return e.ajax({url:"http://www.librarything.com/api_getdata.php?booksort=entry_REV&userid="+t.user,dataType:"jsonp",success:function(e){r(n(e))}}),{template:a}}}(jQuery),function(e){"use strict";e.fn.lifestream.feeds.linkedin=function(t,r){var a=e.extend({},{posted:'<a href="${link}">${title}</a>'},t.template),n="jlsLinkedinCallback"+t.user,s=function(){var e='SELECT * FROM feed WHERE url="'+t.url+'"';return t.user&&(e+=' AND link LIKE "%'+t.user+'%"'),e},u=function(r){return{date:new Date(r.pubDate),config:t,html:e.tmpl(a.posted,r)}};return window[n]=function(e){var t=[],a=0;if(e.query&&e.query.count&&e.query.count>0)if(1===e.query.count)t.push(u(e.query.results.item));else for(a;a<e.query.count;a++){var n=e.query.results.item[a];t.push(u(n))}r(t)},e.ajax({url:e.fn.lifestream.createYqlUrl(s()),cache:!0,data:{_maxage:300},dataType:"jsonp",jsonpCallback:n}),{template:a}}}(jQuery),function(e){e.fn.lifestream.feeds.mendeley=function(t,r){var a=e.extend({},{flagged1:'flagged <a href="http://www.mendeley.com${link}">${title}</a>',flagged2:'flagged <a href="${link}">${title}</a>'},t.template),n=function(r){var n,s,u=[],o=0;if(r.query&&r.query.count&&r.query.count>0)for(n=r.query.results.rss.channel.item,s=n.length;s>o;o++){var l=n[o],i="/"===l.link.charAt(0)?a.flagged1:a.flagged2;u.push({date:new Date(l.pubDate),config:t,url:"http://mendeley.com/groups/"+t.user,html:e.tmpl(i,l)})}return u};return e.ajax({url:e.fn.lifestream.createYqlUrl('select * from xml where url="http://www.mendeley.com/groups/'+t.user+'/feed/rss/"'),dataType:"jsonp",success:function(e){r(n(e))}}),{template:a}}}(jQuery),function(e){e.fn.lifestream.feeds.miso=function(t,r){var a=e.extend({},{watched:'checked in to <a href="${link}">${title}</a>'},t.template),n=function(r){var n,s,u=[],o=0;if(r.query&&r.query.count&&r.query.count>0)for(n=r.query.results.rss.channel.item,s=n.length;s>o;o++){var l=n[o];u.push({url:"http://www.gomiso.com/feeds/user/"+t.user+"/checkins.rss",date:new Date(l.pubDate),config:t,html:e.tmpl(a.watched,l)})}return u};return e.ajax({url:e.fn.lifestream.createYqlUrl('select * from xml where url="http://www.gomiso.com/feeds/user/'+t.user+'/checkins.rss"'),dataType:"jsonp",success:function(e){r(n(e))}}),{template:a}}}(jQuery),function(e){e.fn.lifestream.feeds.mlkshk=function(t,r){var a=e.extend({},{posted:'posted <a href="${link}">${title}</a>'},t.template),n=function(r){var n,s,u,o=[],l=0;if(r.query&&r.query.count&&r.query.count>0&&r.query.results.rss.channel.item)for(n=r.query.results.rss.channel.item,s=n.length;s>l;l++)u=n[l],o.push({date:new Date(u.pubDate),config:t,html:e.tmpl(a.posted,u)});return o};return e.ajax({url:e.fn.lifestream.createYqlUrl('select * from xml where url="http://mlkshk.com/user/'+t.user+'/rss"'),dataType:"jsonp",success:function(e){r(n(e))}}),{template:a}}}(jQuery),function(e){e.fn.lifestream.feeds.pinboard=function(t,r){var a=e.extend({},{bookmarked:'bookmarked <a href="${link}">${title}</a>'},t.template),n=function(r){var n,s,u,o=[],l=0;if(r.query&&r.query.count&&r.query.count>0)for(n=r.query.results.RDF.item,s=n.length;s>l;l++)u=n[l],o.push({date:new Date(u.date),config:t,html:e.tmpl(a.bookmarked,u)});return o};return e.ajax({url:e.fn.lifestream.createYqlUrl('select * from xml where url="http://feeds.pinboard.in/rss/u:'+t.user+'"'),dataType:"jsonp",success:function(e){r(n(e))}}),{template:a}}}(jQuery),function(e){e.fn.lifestream.feeds.pocket=function(t,r){var a=e.extend({},{pocketed:'pocketed <a href="${link}">${title}</a>'},t.template),n=function(r){var n,s,u=[],o=0;if(r.query&&r.query.results)for(n=r.query.results.rss.channel.item,s=n.length;s>o;o++){var l=n[o],i=a.pocketed;u.push({date:new Date(l.pubDate),config:t,url:"http://getpocket.com",html:e.tmpl(i,l)})}return u};return e.ajax({url:e.fn.lifestream.createYqlUrl('select * from xml where url="http://www.getpocket.com/users/'+t.user+'/feed/all/"'),dataType:"json",success:function(e){r(n(e))}}),{template:a}}}(jQuery),function(e){e.fn.lifestream.feeds.posterous=function(t,r){var a=e.extend({},{posted:'posted <a href="${link}">${title}</a>'},t.template),n=function(r){var n,s,u,o=[],l=0;if(r.query&&r.query.count&&r.query.count>0&&r.query.results.rss.channel.item)for(n=r.query.results.rss.channel.item,s=n.length;s>l;l++)u=n[l],o.push({date:new Date(u.pubDate),config:t,html:e.tmpl(a.posted,u)});return o};return e.ajax({url:e.fn.lifestream.createYqlUrl('select * from xml where url="http://'+t.user+'.posterous.com/rss.xml"'),dataType:"jsonp",success:function(e){r(n(e))}}),{template:a}}}(jQuery),function(e){e.fn.lifestream.feeds.quora=function(t,r){var a=e.extend({},{posted:'<a href="${link}">${title}</a>'},t.template),n=function(e){for(var t=0,r=e.link.length;r>t;t++){var a=e.link[t];if("string"==typeof a)return a}return""},s=function(r){var s=[],u=[],o=0,l=0,i="";if(r.query&&r.query.count&&r.query.count>0)for(u=r.query.results.rss.channel.item,l=u.length,i=n(r.query.results.rss.channel);l>o;o++){var c=u[o];s.push({url:i,date:new Date(c.pubDate),config:t,html:e.tmpl(a.posted,c)})}return s};return e.ajax({url:e.fn.lifestream.createYqlUrl('select * from xml where url="http://www.quora.com/'+t.user+'/rss"'),dataType:"jsonp",success:function(e){r(s(e))}}),{template:a}}}(jQuery),function(e){e.fn.lifestream.feeds.reddit=function(t,r){var a=e.extend({},{commented:'<a href="http://www.reddit.com/r/${item.data.subreddit}/comments/${item.data.link_id.substring(3)}/u/${item.data.name.substring(3)}?context=3">commented (${score})</a> in <a href="http://www.reddit.com/r/${item.data.subreddit}">${item.data.subreddit}</a>',created:'<a href="http://www.reddit.com${item.data.permalink}">created new thread (${score})</a> in <a href="http://www.reddit.com/r/${item.data.subreddit}">${item.data.subreddit}</a>'},t.template),n=function(t){var r=t.data.ups-t.data.downs,n={item:t,score:r>0?"+"+r:r};return"t1"===t.kind?e.tmpl(a.commented,n):"t3"===t.kind?e.tmpl(a.created,n):void 0},s=function(e){return new Date(1e3*e)};return e.ajax({url:"http://www.reddit.com/user/"+t.user+".json",dataType:"jsonp",jsonp:"jsonp",success:function(e){var a,u=[],o=0;if(e&&e.data&&e.data.children&&e.data.children.length>0)for(a=e.data.children.length;a>o;o++){var l=e.data.children[o];u.push({date:s(l.data.created_utc),config:t,html:n(l),url:"http://reddit.com/user/"+t.user})}r(u)}}),{template:a}}}(jQuery),function(e){e.fn.lifestream.feeds.rss=function(t,r){var a=e.extend({},{posted:'posted <a href="${link}">${title}</a>'},t.template),n=function(e){for(var t=0,r=e.link.length;r>t;t++){var a=e.link[t];if("string"==typeof a)return a}return""},s=function(r){var s=[],u=[],o=0,l=0,i="";if(r.query&&r.query.count&&r.query.count>0)for(u=r.query.results.rss.channel.item,l=u.length,i=n(r.query.results.rss.channel);l>o;o++){var c=u[o];s.push({url:i,date:new Date(c.pubDate),config:t,html:e.tmpl(a.posted,c)})}return s};return e.ajax({url:e.fn.lifestream.createYqlUrl('select * from xml where url="'+t.user+'"'),dataType:"jsonp",success:function(e){r(s(e))}}),{template:a}}}(jQuery),function(e){e.fn.lifestream.feeds.slideshare=function(t,r){var a=e.extend({},{uploaded:'uploaded a presentation <a href="${link}">${title}</a>'},t.template),n=function(r){var n,s,u,o=[],l=0;if(r.query&&r.query.count&&r.query.count>0)for(n=r.query.results.rss.channel.item,s=n.length;s>l;l++)u=n[l],o.push({date:new Date(u.pubDate),config:t,html:e.tmpl(a.uploaded,u)});return o};return e.ajax({url:e.fn.lifestream.createYqlUrl('select * from xml where url="http://www.slideshare.net/rss/user/'+t.user+'"'),dataType:"jsonp",success:function(e){r(n(e))}}),{template:a}}}(jQuery),function(e){e.fn.lifestream.feeds.snipplr=function(t,r){var a=e.extend({},{posted:'posted a snippet <a href="${link}">${title}</a>'},t.template),n=function(r){var n,s,u,o=[],l=0;if(r.query&&r.query.count&&r.query.count>0&&r.query.results.rss.channel.item)for(n=r.query.results.rss.channel.item,s=n.length;s>l;l++)u=n[l],o.push({date:new Date(u.pubDate),config:t,html:e.tmpl(a.posted,u)});return o};e.ajax({url:e.fn.lifestream.createYqlUrl('select * from xml where url="http://snipplr.com/rss/users/'+t.user+'"'),dataType:"jsonp",success:function(e){r(n(e))}})}}(jQuery),function(e){e.fn.lifestream.feeds.stackoverflow=function(t,r){var a=e.extend({},{global:'<a href="${link}">${text}</a> - ${title}'},t.template),n=function(e){var r="",a="",n="",s="http://stackoverflow.com/users/"+t.user,u="http://stackoverflow.com/questions/";return"badge"===e.timeline_type?(r="was "+e.action+" the '"+e.description+"' badge",a=e.detail,n=s+"?tab=reputation"):"comment"===e.timeline_type?(r="commented on",a=e.description,n=u+e.post_id):("revision"===e.timeline_type||"accepted"===e.timeline_type||"askoranswered"===e.timeline_type)&&(r="askoranswered"===e.timeline_type?e.action:e.action+" "+e.post_type,a=e.detail||e.description||"",n=u+e.post_id),{link:n,title:a,text:r}},s=function(e){return new Date(1e3*e)};return e.ajax({url:"http://api.stackoverflow.com/1.1/users/"+t.user+"/timeline?jsonp",dataType:"jsonp",jsonp:"jsonp",success:function(u){var o,l=[],i=0;if(u&&u.total&&u.total>0&&u.user_timelines)for(o=u.user_timelines.length;o>i;i++){var c=u.user_timelines[i];l.push({date:s(c.creation_date),config:t,html:e.tmpl(a.global,n(c))})}r(l)}}),{template:a}}}(jQuery),function(e){e.fn.lifestream.feeds.tumblr=function(t,r){var a=e.extend({},{posted:'posted a ${type} <a href="${url}">${title}</a>'},t.template),n=t.limit||20,s=function(t){switch(t.type){case"photo":var r=t["photo-url"];return e('<img width="75" height="75"/>').attr({src:r[r.length-1].content,title:l(t),alt:l(t)}).wrap("<div/>").parent().html();case"video":var a=t["video-player"],n=a[a.length-1].content;return n.match(/<\s*script/)?null:n;case"audio":return t["audio-player"]+" "+e("<div/>").text(l(t)).html();default:return null}},u=function(t,r){return e(t[r]).filter(":not(:empty):first").text()},o=function(e){var t;switch(e.type){case"regular":return e["regular-title"]||u(e,"regular-body");case"link":return t=e["link-text"]||u(e,"link-description"),""===t&&(t=e["link-url"]),t;case"video":return u(e,"video-caption");case"audio":return u(e,"audio-caption");case"photo":return u(e,"photo-caption");case"quote":return'"'+e["quote-text"].replace(/<.+?>/g," ").trim()+'"';case"conversation":return t=e["conversation-title"],t||(t=e.conversation.line,"string"!=typeof t&&(t=t[0].label+" "+t[0].content+" ...")),t;case"answer":return e.question;default:return e.type}},l=function(e){var t=o(e)||"";return t.replace(/<.+?>/gi," ")},i=function(t,r){return{date:new Date(r.date),config:t,html:e.tmpl(a.posted,{type:r.type.replace("regular","blog entry"),url:r.url,image:s(r),title:l(r)})}},c=function(r){var a,n,s=[],u=0;if(r.query&&r.query.count&&r.query.count>0)if(e.isArray(r.query.results.posts.post))for(a=r.query.results.posts.post.length;a>u;u++)n=r.query.results.posts.post[u],s.push(i(t,n));else e.isPlainObject(r.query.results.posts.post)&&s.push(i(t,r.query.results.posts.post));return s};return e.ajax({url:e.fn.lifestream.createYqlUrl('select * from tumblr.posts where username="'+t.user+'"'+' and num="'+n+'"'),dataType:"jsonp",success:function(e){r(c(e))}}),{template:a}}}(jQuery),function(e){"use strict";e.fn.lifestream.feeds.twitter=function(t,r){var a=e.extend({},{posted:"{{html tweet}}"},t.template),n="jlsTwitterCallback"+t.user.replace(/[^a-zA-Z0-9]+/g,""),s=function(e){var t=function(e){return e.replace(/[a-z]+:\/\/[a-z0-9\-_]+\.[a-z0-9\-_:~%&\?\/.=]+[^:\.,\)\s*$]/gi,function(e){return'<a href="'+e+'">'+(e.length>25?e.substr(0,24)+"...":e)+"</a>"
-})},r=function(e){return e.replace(/(^|[^\w]+)\@([a-zA-Z0-9_]{1,15})/g,function(e,t,r){return t+'<a href="http://twitter.com/'+r+'">@'+r+"</a>"})},a=function(e){return e.replace(/(^|[^\w'"]+)\#([a-zA-Z0-9ÅåÄäÖöØøÆæÉéÈèÜüÊêÛûÎî_]+)/g,function(e,t,r){return t+'<a href="http://search.twitter.com/search?q=%23'+r+'">#'+r+"</a>"})};return a(r(t(e)))},u=function(r){var n=[],u=0,o=r.length;for(u;o>u;u++){var l=r[u];n.push({date:new Date(1e3*l.created_at),config:t,html:e.tmpl(a.posted,{tweet:s(l.text),complete_url:"http://twitter.com/"+t.user+"/status/"+l.id_str}),url:"http://twitter.com/"+t.user})}return n};return window[n]=function(e){e.query&&e.query.count>0&&r(u(e.query.results.items))},e.ajax({url:e.fn.lifestream.createYqlUrl('USE "http://arminrosu.github.io/twitter-open-data-table/table.xml" AS twitter; SELECT * FROM twitter WHERE screen_name = "'+t.user+'"'),cache:!0,data:{_maxage:300},dataType:"jsonp",jsonpCallback:n}),{template:a}}}(jQuery),function(e){e.fn.lifestream.feeds.vimeo=function(t,r){var a=e.extend({},{liked:'liked <a href="${url}" title="${description}">${title}</a>',posted:'posted <a href="${url}" title="${description}">${title}</a>'},t.template),n=function(r,n){var s,u,o,l,i=[],c=0,p=n||"liked";if(r)for(s=r.length;s>c;c++)u=r[c],o="posted"===p?new Date(u.upload_date.replace(" ","T")):new Date(u.liked_on.replace(" ","T")),l=u.description?u.description.replace(/"/g,"'").replace(/<.+?>/gi,""):"",i.push({date:o,config:t,html:e.tmpl(a[p],{url:u.url,description:u.description?u.description.replace(/"/g,"'").replace(/<.+?>/gi,""):"",title:u.title})});return i};return e.ajax({url:e.fn.lifestream.createYqlUrl('SELECT * FROM xml WHERE url="http://vimeo.com/api/v2/'+t.user+'/likes.xml" OR '+'url="http://vimeo.com/api/v2/'+t.user+'/videos.xml"'),dataType:"jsonp",success:function(e){var t=[];e.query.results.videos[0].video.length>0&&(t=t.concat(n(e.query.results.videos[0].video))),e.query.results.videos[1].video.length>0&&(t=t.concat(n(e.query.results.videos[1].video,"posted"))),r(t)}}),{template:a}}}(jQuery),function(e){e.fn.lifestream.feeds.wikipedia=function(t,r){var a=t.language||"en",n=e.extend({},{contribution:'contributed to <a href="${url}">${title}</a>'},t.template);return e.ajax({url:"http://"+a+".wikipedia.org/w/api.php?action=query&ucuser="+t.user+"&list=usercontribs&ucdir=older&format=json",dataType:"jsonp",success:function(s){var u,o=[],l=0;if(s&&s.query.usercontribs)for(u=s.query.usercontribs.length;u>l;l++){var i=s.query.usercontribs[l];i.url="http://"+a+".wikipedia.org/wiki/"+i.title.replace(" ","_"),o.push({date:new Date(i.timestamp),config:t,html:e.tmpl(n.contribution,i)})}r(o)}}),{template:n}}}(jQuery),function(e){e.fn.lifestream.feeds.wordpress=function(t,r){var a=e.extend({},{posted:'posted <a href="${link}">${title}</a>'},t.template),n=function(r){var n,s,u,o=[],l=0;if(r.query&&r.query.count&&r.query.count>0&&r.query.results.rss.channel.item)for(n=r.query.results.rss.channel.item,s=n.length;s>l;l++)u=n[l],o.push({date:new Date(u.pubDate),config:t,html:e.tmpl(a.posted,u)});return o},s="";return t.user&&(s=0===t.user.indexOf("http://")?t.user+"/feed":"http://"+t.user+".wordpress.com/feed",e.ajax({url:e.fn.lifestream.createYqlUrl('select * from xml where url="'+s+'"'),dataType:"jsonp",success:function(e){r(n(e))}})),{template:a}}}(jQuery),function(e){e.fn.lifestream.feeds.youtube=function(t,r){var a=e.extend({},{uploaded:'uploaded <a href="${video.player.default}" title="${video.description}">${video.title}</a>',favorited:'favorited <a href="${video.player.default}" title="${video.description}">${video.title}</a>'},t.template),n=function(r,n){var s,u,o,l,i,c=[],p=0;if(r.data&&r.data.items)for(s=r.data.items.length;s>p;p++){switch(u=r.data.items[p],n){case"favorited":o=u.video,l=u.created,i=u;break;case"uploaded":o=u,l=o.uploaded,i={video:o}}o.player&&o.player["default"]&&c.push({date:new Date(l),config:t,html:e.tmpl(a[n],i)})}return c};return e.ajax({url:"http://gdata.youtube.com/feeds/api/users/"+t.user+"/favorites?v=2&alt=jsonc",dataType:"jsonp",success:function(e){r(n(e,"favorited"))}}),e.ajax({url:"http://gdata.youtube.com/feeds/api/users/"+t.user+"/uploads?v=2&alt=jsonc",dataType:"jsonp",success:function(e){r(n(e,"uploaded"))}}),{template:a}}}(jQuery),function(e){e.fn.lifestream.feeds.zotero=function(t,r){var a=e.extend({},{flagged:'flagged <a href="${id}">${title}</a> by ${creatorSummary}'},t.template),n=function(r){var n,s,u=[],o=0;if(r.query&&r.query.count&&r.query.count>0)for(n=r.query.results.feed.entry,s=n.length;s>o;o++){var l=n[o];u.push({date:new Date(l.updated),config:t,url:"http://zotero.com/users/"+t.user,html:e.tmpl(a.flagged,l)})}return u};return e.ajax({url:e.fn.lifestream.createYqlUrl('select * from xml where url="https://api.zotero.org/users/'+t.user+'/items"'),dataType:"jsonp",success:function(e){r(n(e))}}),{template:a}}}(jQuery);
+!function(e){"use strict";e.fn.lifestream=function(t){return this.each(function(){var r=e(this),a=jQuery.extend({classname:"lifestream",feedloaded:null,limit:10,list:[]},t),n={count:a.list.length,items:[]},s=jQuery.extend(!0,{},a),u=function(t){e.merge(n.items,t),n.items.sort(function(e,t){return t.date-e.date});for(var s,u=n.items,o=u.length<a.limit?u.length:a.limit,l=0,i=e('<ul class="'+a.classname+'"/>');o>l;l++)s=u[l],s.html&&e('<li class="'+a.classname+"-"+s.config.service+'">').data("name",s.config.service).data("url",s.url||"#").data("time",s.date).append(s.html).appendTo(i);r.html(i),e.isFunction(a.feedloaded)&&a.feedloaded()},o=function(){var t=0,r=a.list.length;for(delete s.list;r>t;t++){var n=a.list[t];e.fn.lifestream.feeds[n.service]&&e.isFunction(e.fn.lifestream.feeds[n.service])&&n.user&&(n._settings=s,e.fn.lifestream.feeds[n.service](n,u))}};jQuery.tmpl?o():jQuery.getScript("//ajax.aspnetcdn.com/ajax/jquery.templates/beta1/jquery.tmpl.min.js",o)})},e.fn.lifestream.createYqlUrl=function(e){return(("https:"===document.location.protocol?"https":"http")+"://query.yahooapis.com/v1/public/yql?q=__QUERY__&env=store://datatables.org/alltableswithkeys&format=json").replace("__QUERY__",encodeURIComponent(e))},e.fn.lifestream.feeds=e.fn.lifestream.feeds||{},Object.keys||(Object.keys=function(e){if(e!==Object(e))throw new TypeError("Object.keys called on non-object");var t,r=[];for(t in e)Object.prototype.hasOwnProperty.call(e,t)&&r.push(t);return r})}(jQuery),function(e){e.fn.lifestream.feeds.atom=function(t,r){var a=e.extend({},{posted:'posted <a href="${link.href}">${title.content}</a>'},t.template),n=function(r){var n=[],s=[],u=0,o=0;if(r.query&&r.query.count&&r.query.count>0)for(s=r.query.results.feed.entry,o=s.length;o>u;u++){var l=s[u];n.push({url:l.link.href,date:new Date(l.updated),config:t,html:e.tmpl(a.posted,l)})}return n};return e.ajax({url:e.fn.lifestream.createYqlUrl('select * from xml where url="'+t.user+'"'),dataType:"jsonp",success:function(e){r(n(e))}}),{template:a}}}(jQuery),function(e){e.fn.lifestream.feeds.bitbucket=function(t,r){var a=e.extend({},{commit:'<a href="http://bitbucket.org/${owner}/${name}/changeset/${node}/">committed</a> at <a href="http://bitbucket.org/${owner}/${name}/">${owner}/${name}</a>',pullrequest_fulfilled:'fulfilled a pull request at <a href="http://bitbucket.org/${owner}/${name}/">${owner}/${name}</a>',pullrequest_rejected:'rejected a pull request at <a href="http://bitbucket.org/${owner}/${name}/">${owner}/${name}</a>',pullrequest_created:'created a pull request at <a href="http://bitbucket.org/${owner}/${name}/">${owner}/${name}</a>',create:'created a new project at <a href="http://bitbucket.org/${owner}/${name}/">${owner}/${name}</a>',fork:'forked <a href="http://bitbucket.org/${owner}/${name}/">${owner}/${name}</a>'},t.template),n=["commit","pullrequest_fulfilled","pullrequest_rejected","pullrequest_created","create","fork"],s=function(t){return-1!==e.inArray(t.event,n)&&t.repository?"commit"===t.event?e.tmpl(a.commit,{owner:t.repository.owner,name:t.repository.name,node:t.node}):e.tmpl(a[t.event],{owner:t.repository.owner,name:t.repository.name}):void 0},u=function(r){var a=[];return r.query&&r.query.count&&r.query.count>0&&e.each(r.query.results.json,function(){a.push({date:new Date(this.events.created_on.replace(/-/g,"/")),config:t,html:s(this.events)})}),a};return e.ajax({url:e.fn.lifestream.createYqlUrl('select events.event,events.node, events.created_on,events.repository.name, events.repository.owner from json where url = "https://api.bitbucket.org/1.0/users/'+t.user+'/events/"'),dataType:"jsonp",success:function(e){r(u(e))}}),{template:a}}}(jQuery),function(e){e.fn.lifestream.feeds.bitly=function(t,r){var a=e.extend({},{created:'created URL <a href="${short_url}" title="${title}">${short_url}</a>'},t.template);return e.ajax({url:e.fn.lifestream.createYqlUrl('select data.short_url, data.created, data.title from json where url="http://bitly.com/u/'+t.user+'.json"'),dataType:"jsonp",success:function(n){var s,u,o=[],l=0;if(n.query&&n.query.count&&n.query.results.json)for(u=n.query.results.json,s=u.length;s>l;l++){var i=u[l].data;o.push({date:new Date(1e3*i.created),config:t,html:e.tmpl(a.created,i)})}r(o)}}),{template:a}}}(jQuery),function(e){e.fn.lifestream.feeds.blogger=function(t,r){var a=e.extend({},{posted:'posted <a href="${origLink}">${title}</a>'},t.template),n=function(r){var n,s,u,o,l,i=[],c=0;if(r.query&&r.query.count&&r.query.count>0&&r.query.results.feed.entry)for(n=r.query.results.feed.entry,s=n.length;s>c;c++){if(u=n[c],!u.origLink)for(o=0,l=u.link.length;l>o;o++)"alternate"===u.link[o].rel&&(u.origLink=u.link[o].href);u.origLink&&(u.title.content&&(u.title=u.title.content),i.push({date:new Date(u.published),config:t,html:e.tmpl(a.posted,u)}))}return i};return e.ajax({url:e.fn.lifestream.createYqlUrl('select * from xml where url="http://'+t.user+'.blogspot.com/feeds/posts/default"'),dataType:"jsonp",success:function(e){r(n(e))}}),{template:a}}}(jQuery),function(e){e.fn.lifestream.feeds.citeulike=function(t,r){var a=e.extend({},{saved:'saved <a href="${href}">${title}</a> by ${authors}'},t.template),n=function(r){var n,s=[],u=0;if(r&&r.length&&r.length>0)for(n=r.length;n>u;u++){var o=r[u];s.push({date:new Date(o.date),config:t,url:"http://www.citeulike.org/user/"+t.user,html:e.tmpl(a.saved,o)})}return s};return e.ajax({url:"http://www.citeulike.org/json/user/"+t.user,dataType:"jsonp",success:function(e){r(n(e))}}),{template:a}}}(jQuery),function(e){e.fn.lifestream.feeds.dailymotion=function(t,r){var a=e.extend({},{uploaded:'uploaded a video <a href="${link}">${title[0]}</a>'},t.template),n=function(r){var n,s,u,o=[],l=0;if(r.query&&r.query.count&&r.query.count>0&&r.query.results.rss.channel.item)for(n=r.query.results.rss.channel.item,s=n.length;s>l;l++)u=n[l],o.push({date:new Date(u.pubDate),config:t,html:e.tmpl(a.uploaded,u)});return o};return e.ajax({url:e.fn.lifestream.createYqlUrl('select * from xml where url="http://www.dailymotion.com/rss/user/'+t.user+'"'),dataType:"jsonp",success:function(e){r(n(e))}}),{template:a}}}(jQuery),function(e){e.fn.lifestream.feeds.delicious=function(t,r){var a=e.extend({},{bookmarked:'bookmarked <a href="${u}">${d}</a>'},t.template);return e.ajax({url:"http://feeds.delicious.com/v2/json/"+t.user,dataType:"jsonp",success:function(n){var s,u=[],o=0;if(n&&n.length&&n.length>0)for(s=n.length;s>o;o++){var l=n[o];u.push({date:new Date(l.dt),config:t,html:e.tmpl(a.bookmarked,l)})}r(u)}}),{template:a}}}(jQuery),function(e){e.fn.lifestream.feeds.deviantart=function(t,r){var a=e.extend({},{posted:'posted <a href="${link}">${title}</a>'},t.template);return e.ajax({url:e.fn.lifestream.createYqlUrl('select title,link,pubDate from rss where url="http://backend.deviantart.com/rss.xml?q=gallery%3A'+encodeURIComponent(t.user)+'&type=deviation" | unique(field="title")'),dataType:"jsonp",success:function(n){var s,u,o,l=[],i=0;if(n.query&&n.query.count>0)for(s=n.query.results.item,o=s.length;o>i;i++)u=s[i],l.push({date:new Date(u.pubDate),config:t,html:e.tmpl(a.posted,u)});r(l)}}),{template:a}}}(jQuery),function(e){e.fn.lifestream.feeds.disqus=function(t,r){var a=e.extend({},{post:'commented on <a href="${url}">${thread.title}</a>',thread_like:'liked <a href="${url}">${thread.title}</a>'},t.template),n=function(r){var n,s,u=[],o=0;if(r)for(n=r.length;n>o;o++)s=r[o],"reply"!==s.type&&u.push({date:new Date(s.createdAt),config:t,html:e.tmpl(a[s.type],s.object)});return u};return e.ajax({url:"https://disqus.com/api/3.0/users/listActivity.json",data:{user:t.user,api_key:t.key},dataType:"jsonp",success:function(e){return 2===e.code?(r([]),void(console&&console.error&&console.error("Error loading Disqus stream.",e.response))):void r(n(e.response))}}),{template:a}}}(jQuery),function(e){e.fn.lifestream.feeds.dribbble=function(t,r){var a=e.extend({},{posted:'posted a shot <a href="${url}">${title}</a>'},t.template);return e.ajax({url:"http://api.dribbble.com/players/"+t.user+"/shots",dataType:"jsonp",success:function(n){var s,u=[],o=0;if(n&&n.total)for(s=n.shots.length;s>o;o++){var l=n.shots[o];u.push({date:new Date(l.created_at),config:t,html:e.tmpl(a.posted,l)})}r(u)}}),{template:a}}}(jQuery),function(e){e.fn.lifestream.feeds.facebook_page=function(t,r){var a=e.extend({},{wall_post:'post on wall <a href="${link}">${title}</a>'},t.template),n=function(r){var n,s,u=[],o=0;if(r.query&&r.query.count&&r.query.count>0)for(n=r.query.results.rss.channel.item,s=n.length;s>o;o++){var l=n[o];e.trim(l.title)&&u.push({date:new Date(l.pubDate),config:t,html:e.tmpl(a.wall_post,l)})}return u};return e.ajax({url:e.fn.lifestream.createYqlUrl('select * from xml where url="www.facebook.com/feeds/page.php?id='+t.user+'&format=rss20"'),dataType:"jsonp",success:function(e){r(n(e))}}),{template:a}}}(jQuery),function(e){"use strict";e.fn.lifestream.feeds.fancy=function(t,r){var a=e.extend({},{fancied:'fancy\'d <a href="${link}">${title}</a>'},t.template),n=function(r){var n,s=[],u=0;if(r.query&&r.query.count&&r.query.count>0)for(n=r.query.count;n>u;u++){var o=r.query.results.item[u];s.push({date:new Date(o.pubDate),config:t,html:e.tmpl(a.fancied,o)})}return s};return e.ajax({url:e.fn.lifestream.createYqlUrl('SELECT * FROM xml WHERE url="http://www.fancy.com/rss/'+t.user+'" AND itemPath="/rss/channel/item"'),dataType:"jsonp",success:function(e){r(n(e))}}),{template:a}}}(jQuery),function(e){e.fn.lifestream.feeds.flickr=function(t,r){var a=e.extend({},{posted:'posted a photo <a href="${link}">${title}</a>'},t.template);return e.ajax({url:"http://api.flickr.com/services/feeds/photos_public.gne?id="+t.user+"&lang=en-us&format=json",dataType:"jsonp",jsonp:"jsoncallback",success:function(n){var s,u=[],o=0;if(n&&n.items&&n.items.length>0)for(s=n.items.length;s>o;o++){var l=n.items[o];u.push({date:new Date(l.published),config:t,html:e.tmpl(a.posted,l)})}r(u)}}),{template:a}}}(jQuery),function(e){e.fn.lifestream.feeds.foomark=function(t,r){var a=e.extend({},{bookmarked:'bookmarked <a href="${url}">${url}</a>'},t.template);return e.ajax({url:"http://api.foomark.com/urls/list/",data:{format:"jsonp",username:t.user},dataType:"jsonp",success:function(n){var s,u=[],o=0;if(n&&n.length&&n.length>0)for(s=n.length;s>o;o++){var l=n[o];u.push({date:new Date(l.created_at.replace(/-/g,"/")),config:t,html:e.tmpl(a.bookmarked,l)})}r(u)}}),{template:a}}}(jQuery),function(e){e.fn.lifestream.feeds.formspring=function(t,r){var a=e.extend({},{answered:'answered a question <a href="${link}">${title}</a>'},t.template),n=function(r){var n,s,u,o=[],l=0;if(r.query&&r.query.count&&r.query.count>0&&r.query.results.rss.channel.item)for(n=r.query.results.rss.channel.item,s=n.length;s>l;l++)u=n[l],o.push({date:new Date(u.pubDate),config:t,html:e.tmpl(a.answered,u)});return o};return e.ajax({url:e.fn.lifestream.createYqlUrl('select * from xml where url="http://www.formspring.me/profile/'+t.user+'.rss"'),dataType:"jsonp",success:function(e){r(n(e))}}),{template:a}}}(jQuery),function(e){e.fn.lifestream.feeds.forrst=function(t,r){var a=e.extend({},{posted:'posted a ${post_type} <a href="${post_url}">${title}</a>'},t.template);return e.ajax({url:"http://forrst.com/api/v2/users/posts?username="+t.user,dataType:"jsonp",success:function(n){var s,u=[],o=0;if(n&&n.resp.length&&n.resp.length>0)for(s=n.resp.length;s>o;o++){var l=n.resp[o];u.push({date:new Date(l.created_at.replace(" ","T")),config:t,html:e.tmpl(a.posted,l)})}r(u)}}),{template:a}}}(jQuery),function(e){e.fn.lifestream.feeds.foursquare=function(t,r){var a=e.extend({},{checkedin:'checked in @ <a href="${link}">${title}</a>'},t.template),n=function(r){var n,s=[],u=0;if(r.query&&r.query.count&&r.query.count>0)for(n=r.query.count;n>u;u++){var o=r.query.results.item[u];s.push({date:new Date(o.pubDate),config:t,html:e.tmpl(a.checkedin,o)})}return s};return e.ajax({url:e.fn.lifestream.createYqlUrl('select * from rss where url="https://feeds.foursquare.com/history/'+t.user+'.rss"'),dataType:"jsonp",success:function(e){r(n(e))}}),{template:a}}}(jQuery),function(e){e.fn.lifestream.feeds.gimmebar=function(t,r){var a=e.extend({},{bookmarked:'bookmarked <a href="${short_url}">${title}</a>'},t.template);return e.ajax({url:"https://gimmebar.com/api/v0/public/assets/"+t.user+".json?jsonp_callback=?",dataType:"json",success:function(n){n=n.records;var s,u=[],o=0;if(n&&n.length&&n.length>0)for(s=n.length;s>o;o++){var l=n[o];u.push({date:new Date(1e3*l.date),config:t,html:e.tmpl(a.bookmarked,l)})}r(u)}}),{template:a}}}(jQuery),function(e){e.fn.lifestream.feeds.github=function(t,r){var a=e.extend({},{commitCommentEvent:'commented on <a href="http://github.com/${status.repo.name}">${status.repo.name}</a>',createBranchEvent:'created branch <a href="http://github.com/${status.repo.name}/tree/${status.payload.ref}">${status.payload.ref}</a> at <a href="http://github.com/${status.repo.name}">${status.repo.name}</a>',createRepositoryEvent:'created repository <a href="http://github.com/${status.repo.name}">${status.repo.name}</a>',createTagEvent:'created tag <a href="http://github.com/${status.repo.name}/tree/${status.payload.ref}">${status.payload.ref}</a> at <a href="http://github.com/${status.repo.name}">${status.repo.name}</a>',deleteBranchEvent:'deleted branch ${status.payload.ref} at <a href="http://github.com/${status.repo.name}">${status.repo.name}</a>',deleteTagEvent:'deleted tag ${status.payload.ref} at <a href="http://github.com/${status.repo.name}">${status.repo.name}</a>',followEvent:'started following <a href="http://github.com/${status.payload.target.login}">${status.payload.target.login}</a>',forkEvent:'forked <a href="http://github.com/${status.repo.name}">${status.repo.name}</a>',gistEvent:'${status.payload.action} gist <a href="http://gist.github.com/${status.payload.gist.id}">${status.payload.gist.id}</a>',issueCommentEvent:'commented on issue <a href="http://github.com/${status.repo.name}/issues/${status.payload.issue.number}">${status.payload.issue.number}</a> on <a href="http://github.com/${status.repo.name}">${status.repo.name}</a>',issuesEvent:'${status.payload.action} issue <a href="http://github.com/${status.repo.name}/issues/${status.payload.issue.number}">${status.payload.issue.number}</a> on <a href="http://github.com/${status.repo.name}">${status.repo.name}</a>',pullRequestEvent:'${status.payload.action} pull request <a href="http://github.com/${status.repo.name}/pull/${status.payload.number}">${status.payload.number}</a> on <a href="http://github.com/${status.repo.name}">${status.repo.name}</a>',pushEvent:'pushed to <a href="http://github.com/${status.repo.name}/tree/${status.payload.ref}">${status.payload.ref}</a> at <a href="http://github.com/${status.repo.name}">${status.repo.name}</a>',watchEvent:'started watching <a href="http://github.com/${status.repo.name}">${status.repo.name}</a>'},t.template),n=function(t){return"CommitCommentEvent"===t.type?e.tmpl(a.commitCommentEvent,{status:t}):"CreateEvent"===t.type&&"branch"===t.payload.ref_type?e.tmpl(a.createBranchEvent,{status:t}):"CreateEvent"===t.type&&"repository"===t.payload.ref_type?e.tmpl(a.createRepositoryEvent,{status:t}):"CreateEvent"===t.type&&"tag"===t.payload.ref_type?e.tmpl(a.createTagEvent,{status:t}):"DeleteEvent"===t.type&&"branch"===t.payload.ref_type?e.tmpl(a.deleteBranchEvent,{status:t}):"DeleteEvent"===t.type&&"tag"===t.payload.ref_type?e.tmpl(a.deleteTagEvent,{status:t}):"FollowEvent"===t.type?e.tmpl(a.followEvent,{status:t}):"ForkEvent"===t.type?e.tmpl(a.forkEvent,{status:t}):"GistEvent"===t.type?("create"===t.payload.action?t.payload.action="created":"update"===t.payload.action&&(t.payload.action="updated"),e.tmpl(a.gistEvent,{status:t})):"IssueCommentEvent"===t.type?e.tmpl(a.issueCommentEvent,{status:t}):"IssuesEvent"===t.type?e.tmpl(a.issuesEvent,{status:t}):"PullRequestEvent"===t.type?e.tmpl(a.pullRequestEvent,{status:t}):"PushEvent"===t.type?(t.payload.ref=t.payload.ref.split("/")[2],e.tmpl(a.pushEvent,{status:t})):"WatchEvent"===t.type?e.tmpl(a.watchEvent,{status:t}):void 0},s=function(e){var r,a=[],s=0;if(e.query&&e.query.count&&e.query.count>0)for(r=e.query.count;r>s;s++){var u=e.query.results.json[s].json;a.push({date:new Date(u.created_at),config:t,html:n(u),url:"https://github.com/"+t.user})}return a};return e.ajax({url:e.fn.lifestream.createYqlUrl('select json.type, json.actor, json.repo, json.payload, json.created_at from json where url="https://api.github.com/users/'+t.user+'/events/public?per_page=100"'),dataType:"jsonp",success:function(e){r(s(e))}}),{template:a}}}(jQuery),function(e){e.fn.lifestream.feeds.googleplus=function(t,r){var a=e.extend({},{posted:'<a href="${actor.url}">${actor.displayName}</a> has posted a new entry <a href="${url}" title="${id}">${title}</a> <!--With--> ${object.replies.totalItems} replies, ${object.plusoners.totalItems} +1s, ${object.resharers.totalItems} Reshares'},t.template),n=function(r){var n,s,u=[],o=0;if(r&&r.items)for(n=r.items.length;n>o;o++)s=r.items[o],u.push({date:new Date(s.published),config:t,html:e.tmpl(a.posted,s)});return u};return e.ajax({url:"https://www.googleapis.com/plus/v1/people/"+t.user+"/activities/public",data:{key:t.key},dataType:"jsonp",success:function(e){return e.error?(r([]),void(console&&console.error&&console.error("Error loading Google+ stream.",e.error))):void r(n(e))}}),{template:a}}}(jQuery),function(e){e.fn.lifestream.feeds.hypem=function(t,r){t.type&&"history"===t.type&&"loved"===t.type||(t.type="loved");var a=e.extend({},{loved:'loved <a href="http://hypem.com/item/${mediaid}">${title}</a> by <a href="http://hypem.com/artist/${artist}">${artist}</a>',history:'listened to <a href="http://hypem.com/item/${mediaid}">${title}</a> by <a href="http://hypem.com/artist/${artist}">${artist}</a>'},t.template);return e.ajax({url:"http://hypem.com/playlist/"+t.type+"/"+t.user+"/json/1/data.js",dataType:"json",success:function(n){var s=[],u=0,o=-1;for(var l in n)n.hasOwnProperty(l)&&o++;if(n&&o>0)for(;o>u;u++){var i=n[u];s.push({date:new Date(1e3*("history"===t.type?i.dateplayed:i.dateloved)),config:t,html:e.tmpl("history"===t.type?a.history:a.loved,i)})}r(s)}}),{template:a}}}(jQuery),function(e){e.fn.lifestream.feeds.instapaper=function(t,r){var a=e.extend({},{loved:'loved <a href="${link}">${title}</a>'},t.template),n=function(r){var n,s,u,o=[],l=0;if(r.query&&r.query.count&&r.query.count>0&&r.query.results.rss.channel.item)for(n=r.query.results.rss.channel.item,s=n.length;s>l;l++)u=n[l],o.push({date:new Date(u.pubDate),config:t,html:e.tmpl(a.loved,u)});return o};return e.ajax({url:e.fn.lifestream.createYqlUrl('select * from xml where url="http://www.instapaper.com/starred/rss/'+t.user+'"'),dataType:"jsonp",success:function(e){r(n(e))}}),{template:a}}}(jQuery),function(e){e.fn.lifestream.feeds.iusethis=function(t,r){var a=e.extend({},{global:'${action} <a href="${link}">${what}</a> on (${os})'},t.template),n=function(r){var n,s,u,o,l,i,c,p,f,d,m,h,y=[],v=0,g=["iPhone","OS X","Windows"];if(r.query&&r.query.count&&r.query.count>0&&r.query.results.rss)for(i=r.query.results.rss.length,f=["started using","stopped using","stopped loving","Downloaded","commented on","updated entry for","started loving","registered"],l=f.length;i>v;v++)for(h=g[v],n=r.query.results.rss[v].channel.item,s=0,u=n.length;u>s;s++){for(c=n[s],p=c.title.replace(t.user+" ",""),o=0;l>o;o++)if(p.indexOf(f[o])>-1){d=f[o];break}m=p.split(d),y.push({date:new Date(c.pubDate),config:t,html:e.tmpl(a.global,{action:d.toLowerCase(),link:c.link,what:m[1],os:h})})}return y};return e.ajax({url:e.fn.lifestream.createYqlUrl('select * from xml where url="http://iphone.iusethis.com/user/feed.rss/'+t.user+'" or url="http://osx.iusethis.com/user/feed.rss/'+t.user+'" or url="http://win.iusethis.com/user/feed.rss/'+t.user+'"'),dataType:"jsonp",success:function(e){r(n(e))}}),{template:a}}}(jQuery),function(e){e.fn.lifestream.feeds.lastfm=function(t,r){var a=e.extend({},{loved:'loved <a href="${url}">${name}</a> by <a href="${artist.url}">${artist.name}</a>'},t.template),n=function(r){var n,s,u=[],o=0;if(r.query&&r.query.count&&r.query.count>0&&r.query.results.lovedtracks&&r.query.results.lovedtracks.track)for(n=r.query.results.lovedtracks.track,s=n.length;s>o;o++){var l=n[o],i=l.nowplaying?new Date:l.date.uts;u.push({date:new Date(parseInt(1e3*i,10)),config:t,html:e.tmpl(a.loved,l)})}return u};return e.ajax({url:e.fn.lifestream.createYqlUrl('select * from xml where url="http://ws.audioscrobbler.com/2.0/user/'+t.user+'/lovedtracks.xml"'),dataType:"jsonp",success:function(e){r(n(e))}}),{template:a}}}(jQuery),function(e){e.fn.lifestream.feeds.librarything=function(t,r){var a=e.extend({},{book:'added <a href="http://www.librarything.com/work/book/${book.book_id}" title="${book.title} by ${book.author_fl}">${book.title} by ${book.author_fl}</a> to my library'},t.template),n=function(r){var n=[],s="";if(r.books)for(s in r.books)if(r.books.hasOwnProperty(s)){var u=r.books[s];n.push({date:new Date(1e3*u.entry_stamp),config:t,html:e.tmpl(a.book,{book:u}),url:"http://www.librarything.com/profile/"+t.user})}return n};return e.ajax({url:"http://www.librarything.com/api_getdata.php?booksort=entry_REV&userid="+t.user,dataType:"jsonp",success:function(e){r(n(e))}}),{template:a}}}(jQuery),function(e){"use strict";e.fn.lifestream.feeds.linkedin=function(t,r){var a=e.extend({},{posted:'<a href="${link}">${title}</a>'},t.template),n="jlsLinkedinCallback"+t.user,s=function(){var e='SELECT * FROM feed WHERE url="'+t.url+'"';return t.user&&(e+=' AND link LIKE "%'+t.user+'%"'),e},u=function(r){return{date:new Date(r.pubDate),config:t,html:e.tmpl(a.posted,r)}};return window[n]=function(e){var t=[],a=0;if(e.query&&e.query.count&&e.query.count>0)if(1===e.query.count)t.push(u(e.query.results.item));else for(a;a<e.query.count;a++){var n=e.query.results.item[a];t.push(u(n))}r(t)},e.ajax({url:e.fn.lifestream.createYqlUrl(s()),cache:!0,data:{_maxage:300},dataType:"jsonp",jsonpCallback:n}),{template:a}}}(jQuery),function(e){e.fn.lifestream.feeds.mendeley=function(t,r){var a=e.extend({},{flagged1:'flagged <a href="http://www.mendeley.com${link}">${title}</a>',flagged2:'flagged <a href="${link}">${title}</a>'},t.template),n=function(r){var n,s,u=[],o=0;if(r.query&&r.query.count&&r.query.count>0)for(n=r.query.results.rss.channel.item,s=n.length;s>o;o++){var l=n[o],i="/"===l.link.charAt(0)?a.flagged1:a.flagged2;u.push({date:new Date(l.pubDate),config:t,url:"http://mendeley.com/groups/"+t.user,html:e.tmpl(i,l)})}return u};return e.ajax({url:e.fn.lifestream.createYqlUrl('select * from xml where url="http://www.mendeley.com/groups/'+t.user+'/feed/rss/"'),dataType:"jsonp",success:function(e){r(n(e))}}),{template:a}}}(jQuery),function(e){e.fn.lifestream.feeds.miso=function(t,r){var a=e.extend({},{watched:'checked in to <a href="${link}">${title}</a>'},t.template),n=function(r){var n,s,u=[],o=0;if(r.query&&r.query.count&&r.query.count>0)for(n=r.query.results.rss.channel.item,s=n.length;s>o;o++){var l=n[o];u.push({url:"http://www.gomiso.com/feeds/user/"+t.user+"/checkins.rss",date:new Date(l.pubDate),config:t,html:e.tmpl(a.watched,l)})}return u};return e.ajax({url:e.fn.lifestream.createYqlUrl('select * from xml where url="http://www.gomiso.com/feeds/user/'+t.user+'/checkins.rss"'),dataType:"jsonp",success:function(e){r(n(e))}}),{template:a}}}(jQuery),function(e){e.fn.lifestream.feeds.mlkshk=function(t,r){var a=e.extend({},{posted:'posted <a href="${link}">${title}</a>'},t.template),n=function(r){var n,s,u,o=[],l=0;if(r.query&&r.query.count&&r.query.count>0&&r.query.results.rss.channel.item)for(n=r.query.results.rss.channel.item,s=n.length;s>l;l++)u=n[l],o.push({date:new Date(u.pubDate),config:t,html:e.tmpl(a.posted,u)});return o};return e.ajax({url:e.fn.lifestream.createYqlUrl('select * from xml where url="http://mlkshk.com/user/'+t.user+'/rss"'),dataType:"jsonp",success:function(e){r(n(e))}}),{template:a}}}(jQuery),function(e){e.fn.lifestream.feeds.pinboard=function(t,r){var a=e.extend({},{bookmarked:'bookmarked <a href="${link}">${title}</a>'},t.template),n=function(r){var n,s,u,o=[],l=0;if(r.query&&r.query.count&&r.query.count>0)for(n=r.query.results.RDF.item,s=n.length;s>l;l++)u=n[l],o.push({date:new Date(u.date),config:t,html:e.tmpl(a.bookmarked,u)});return o};return e.ajax({url:e.fn.lifestream.createYqlUrl('select * from xml where url="http://feeds.pinboard.in/rss/u:'+t.user+'"'),dataType:"jsonp",success:function(e){r(n(e))}}),{template:a}}}(jQuery),function(e){e.fn.lifestream.feeds.pocket=function(t,r){var a=e.extend({},{pocketed:'pocketed <a href="${link}">${title}</a>'},t.template),n=function(r){var n,s,u=[],o=0;if(r.query&&r.query.results)for(n=r.query.results.rss.channel.item,s=n.length;s>o;o++){var l=n[o],i=a.pocketed;u.push({date:new Date(l.pubDate),config:t,url:"http://getpocket.com",html:e.tmpl(i,l)})}return u};return e.ajax({url:e.fn.lifestream.createYqlUrl('select * from xml where url="http://www.getpocket.com/users/'+t.user+'/feed/all/"'),dataType:"json",success:function(e){r(n(e))}}),{template:a}}}(jQuery),function(e){e.fn.lifestream.feeds.posterous=function(t,r){var a=e.extend({},{posted:'posted <a href="${link}">${title}</a>'},t.template),n=function(r){var n,s,u,o=[],l=0;if(r.query&&r.query.count&&r.query.count>0&&r.query.results.rss.channel.item)for(n=r.query.results.rss.channel.item,s=n.length;s>l;l++)u=n[l],o.push({date:new Date(u.pubDate),config:t,html:e.tmpl(a.posted,u)});return o};return e.ajax({url:e.fn.lifestream.createYqlUrl('select * from xml where url="http://'+t.user+'.posterous.com/rss.xml"'),dataType:"jsonp",success:function(e){r(n(e))}}),{template:a}}}(jQuery),function(e){e.fn.lifestream.feeds.quora=function(t,r){var a=e.extend({},{posted:'<a href="${link}">${title}</a>'},t.template),n=function(e){for(var t=0,r=e.link.length;r>t;t++){var a=e.link[t];if("string"==typeof a)return a}return""},s=function(r){var s=[],u=[],o=0,l=0,i="";if(r.query&&r.query.count&&r.query.count>0)for(u=r.query.results.rss.channel.item,l=u.length,i=n(r.query.results.rss.channel);l>o;o++){var c=u[o];s.push({url:i,date:new Date(c.pubDate),config:t,html:e.tmpl(a.posted,c)})}return s};return e.ajax({url:e.fn.lifestream.createYqlUrl('select * from xml where url="http://www.quora.com/'+t.user+'/rss"'),dataType:"jsonp",success:function(e){r(s(e))}}),{template:a}}}(jQuery),function(e){e.fn.lifestream.feeds.reddit=function(t,r){var a=e.extend({},{commented:'<a href="http://www.reddit.com/r/${item.data.subreddit}/comments/${item.data.link_id.substring(3)}/u/${item.data.name.substring(3)}?context=3">commented (${score})</a> in <a href="http://www.reddit.com/r/${item.data.subreddit}">${item.data.subreddit}</a>',created:'<a href="http://www.reddit.com${item.data.permalink}">created new thread (${score})</a> in <a href="http://www.reddit.com/r/${item.data.subreddit}">${item.data.subreddit}</a>'},t.template),n=function(t){var r=t.data.ups-t.data.downs,n={item:t,score:r>0?"+"+r:r};return"t1"===t.kind?e.tmpl(a.commented,n):"t3"===t.kind?e.tmpl(a.created,n):void 0},s=function(e){return new Date(1e3*e)};return e.ajax({url:"http://www.reddit.com/user/"+t.user+".json",dataType:"jsonp",jsonp:"jsonp",success:function(e){var a,u=[],o=0;if(e&&e.data&&e.data.children&&e.data.children.length>0)for(a=e.data.children.length;a>o;o++){var l=e.data.children[o];u.push({date:s(l.data.created_utc),config:t,html:n(l),url:"http://reddit.com/user/"+t.user})}r(u)}}),{template:a}}}(jQuery),function(e){e.fn.lifestream.feeds.rss=function(t,r){var a=e.extend({},{posted:'posted <a href="${link}">${title}</a>'},t.template),n=function(e){for(var t=0,r=e.link.length;r>t;t++){var a=e.link[t];if("string"==typeof a)return a}return""},s=function(r){var s=[],u=[],o=0,l=0,i="";if(r.query&&r.query.count&&r.query.count>0)for(u=r.query.results.rss.channel.item,l=u.length,i=n(r.query.results.rss.channel);l>o;o++){var c=u[o];s.push({url:i,date:new Date(c.pubDate),config:t,html:e.tmpl(a.posted,c)})}return s};return e.ajax({url:e.fn.lifestream.createYqlUrl('select * from xml where url="'+t.user+'"'),dataType:"jsonp",success:function(e){r(s(e))}}),{template:a}}}(jQuery),function(e){e.fn.lifestream.feeds.slideshare=function(t,r){var a=e.extend({},{uploaded:'uploaded a presentation <a href="${link}">${title}</a>'},t.template),n=function(r){var n,s,u,o=[],l=0;if(r.query&&r.query.count&&r.query.count>0)for(n=r.query.results.rss.channel.item,s=n.length;s>l;l++)u=n[l],o.push({date:new Date(u.pubDate),config:t,html:e.tmpl(a.uploaded,u)});return o};return e.ajax({url:e.fn.lifestream.createYqlUrl('select * from xml where url="http://www.slideshare.net/rss/user/'+t.user+'"'),dataType:"jsonp",success:function(e){r(n(e))}}),{template:a}}}(jQuery),function(e){e.fn.lifestream.feeds.snipplr=function(t,r){var a=e.extend({},{posted:'posted a snippet <a href="${link}">${title}</a>'},t.template),n=function(r){var n,s,u,o=[],l=0;if(r.query&&r.query.count&&r.query.count>0&&r.query.results.rss.channel.item)for(n=r.query.results.rss.channel.item,s=n.length;s>l;l++)u=n[l],o.push({date:new Date(u.pubDate),config:t,html:e.tmpl(a.posted,u)});return o};e.ajax({url:e.fn.lifestream.createYqlUrl('select * from xml where url="http://snipplr.com/rss/users/'+t.user+'"'),dataType:"jsonp",success:function(e){r(n(e))}})}}(jQuery),function(e){e.fn.lifestream.feeds.stackoverflow=function(t,r){var a=e.extend({},{global:'<a href="${link}">${text}</a> - ${title}'},t.template),n=function(e){var r="",a="",n="",s="http://stackoverflow.com/users/"+t.user,u="http://stackoverflow.com/questions/";return"badge"===e.timeline_type?(r="was "+e.action+" the '"+e.description+"' badge",a=e.detail,n=s+"?tab=reputation"):"comment"===e.timeline_type?(r="commented on",a=e.description,n=u+e.post_id):("revision"===e.timeline_type||"accepted"===e.timeline_type||"askoranswered"===e.timeline_type)&&(r="askoranswered"===e.timeline_type?e.action:e.action+" "+e.post_type,a=e.detail||e.description||"",n=u+e.post_id),{link:n,title:a,text:r}},s=function(e){return new Date(1e3*e)};return e.ajax({url:"https://api.stackoverflow.com/1.1/users/"+t.user+"/timeline?jsonp",dataType:"jsonp",jsonp:"jsonp",success:function(u){var o,l=[],i=0;if(u&&u.total&&u.total>0&&u.user_timelines)for(o=u.user_timelines.length;o>i;i++){var c=u.user_timelines[i];l.push({date:s(c.creation_date),config:t,html:e.tmpl(a.global,n(c))})}r(l)}}),{template:a}}}(jQuery),function(e){e.fn.lifestream.feeds.tumblr=function(t,r){var a=e.extend({},{posted:'posted a ${type} <a href="${url}">${title}</a>'},t.template),n=t.limit||20,s=function(t){switch(t.type){case"photo":var r=t["photo-url"];return e('<img width="75" height="75"/>').attr({src:r[r.length-1].content,title:l(t),alt:l(t)}).wrap("<div/>").parent().html();case"video":var a=t["video-player"],n=a[a.length-1].content;return n.match(/<\s*script/)?null:n;case"audio":return t["audio-player"]+" "+e("<div/>").text(l(t)).html();default:return null}},u=function(t,r){return e(t[r]).filter(":not(:empty):first").text()},o=function(e){var t;switch(e.type){case"regular":return e["regular-title"]||u(e,"regular-body");case"link":return t=e["link-text"]||u(e,"link-description"),""===t&&(t=e["link-url"]),t;case"video":return u(e,"video-caption");case"audio":return u(e,"audio-caption");case"photo":return u(e,"photo-caption");case"quote":return'"'+e["quote-text"].replace(/<.+?>/g," ").trim()+'"';case"conversation":return t=e["conversation-title"],t||(t=e.conversation.line,"string"!=typeof t&&(t=t[0].label+" "+t[0].content+" ...")),t;case"answer":return e.question;default:return e.type}},l=function(e){var t=o(e)||"";return t.replace(/<.+?>/gi," ")},i=function(t,r){return{date:new Date(r.date),config:t,html:e.tmpl(a.posted,{type:r.type.replace("regular","blog entry"),url:r.url,image:s(r),title:l(r)})}},c=function(r){var a,n,s=[],u=0;if(r.query&&r.query.count&&r.query.count>0)if(e.isArray(r.query.results.posts.post))for(a=r.query.results.posts.post.length;a>u;u++)n=r.query.results.posts.post[u],s.push(i(t,n));else e.isPlainObject(r.query.results.posts.post)&&s.push(i(t,r.query.results.posts.post));
+return s};return e.ajax({url:e.fn.lifestream.createYqlUrl('select * from tumblr.posts where username="'+t.user+'" and num="'+n+'"'),dataType:"jsonp",success:function(e){r(c(e))}}),{template:a}}}(jQuery),function(e){"use strict";e.fn.lifestream.feeds.twitter=function(t,r){var a=e.extend({},{posted:"{{html tweet}}"},t.template),n="jlsTwitterCallback"+t.user.replace(/[^a-zA-Z0-9]+/g,""),s=function(e){var t=function(e){return e.replace(/([a-z]+:\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/gi,function(e){return'<a href="'+e+'">'+(e.length>25?e.substr(0,24)+"...":e)+"</a>"})},r=function(e){return e.replace(/(^|[^\w]+)\@([a-zA-Z0-9_]{1,15})/g,function(e,t,r){return t+'<a href="http://twitter.com/'+r+'">@'+r+"</a>"})},a=function(e){return e.replace(/(^|[^\w'"]+)\#([a-zA-Z0-9ÅåÄäÖöØøÆæÉéÈèÜüÊêÛûÎî_]+)/g,function(e,t,r){return t+'<a href="http://search.twitter.com/search?q=%23'+r+'">#'+r+"</a>"})};return a(r(t(e)))},u=function(r){var n=[],u=0,o=r.length;for(u;o>u;u++){var l=r[u];n.push({date:new Date(1e3*l.created_at),config:t,html:e.tmpl(a.posted,{tweet:s(e("<div/>").html(l.text).text()),complete_url:"http://twitter.com/"+t.user+"/status/"+l.id_str}),url:"http://twitter.com/"+t.user})}return n};return window[n]=function(e){e.query&&e.query.count>0&&r(u(e.query.results.items))},e.ajax({url:e.fn.lifestream.createYqlUrl('USE "http://arminrosu.github.io/twitter-open-data-table/table.xml" AS twitter; SELECT * FROM twitter WHERE screen_name = "'+t.user+'"'),cache:!0,data:{_maxage:300},dataType:"jsonp",jsonpCallback:n}),{template:a}}}(jQuery),function(e){e.fn.lifestream.feeds.vimeo=function(t,r){var a=e.extend({},{liked:'liked <a href="${url}" title="${description}">${title}</a>',posted:'posted <a href="${url}" title="${description}">${title}</a>'},t.template),n=function(r,n){var s,u,o,l,i=[],c=0,p=n||"liked";if(r)for(s=r.length;s>c;c++)u=r[c],o=new Date("posted"===p?u.upload_date.replace(" ","T"):u.liked_on.replace(" ","T")),l=u.description?u.description.replace(/"/g,"'").replace(/<.+?>/gi,""):"",i.push({date:o,config:t,html:e.tmpl(a[p],{url:u.url,description:u.description?u.description.replace(/"/g,"'").replace(/<.+?>/gi,""):"",title:u.title})});return i};return e.ajax({url:e.fn.lifestream.createYqlUrl('SELECT * FROM xml WHERE url="http://vimeo.com/api/v2/'+t.user+'/likes.xml" OR url="http://vimeo.com/api/v2/'+t.user+'/videos.xml"'),dataType:"jsonp",success:function(e){var t=[];null!=e.query.results.videos[0]&&e.query.results.videos[0].video.length>0&&(t=t.concat(n(e.query.results.videos[0].video))),null!=e.query.results.videos[1]&&e.query.results.videos[1].video.length>0&&(t=t.concat(n(e.query.results.videos[1].video,"posted"))),r(t)}}),{template:a}}}(jQuery),function(e){e.fn.lifestream.feeds.wikipedia=function(t,r){var a=t.language||"en",n=e.extend({},{contribution:'contributed to <a href="${url}">${title}</a>'},t.template);return e.ajax({url:"http://"+a+".wikipedia.org/w/api.php?action=query&ucuser="+t.user+"&list=usercontribs&ucdir=older&format=json",dataType:"jsonp",success:function(s){var u,o=[],l=0;if(s&&s.query.usercontribs)for(u=s.query.usercontribs.length;u>l;l++){var i=s.query.usercontribs[l];i.url="http://"+a+".wikipedia.org/wiki/"+i.title.replace(" ","_"),o.push({date:new Date(i.timestamp),config:t,html:e.tmpl(n.contribution,i)})}r(o)}}),{template:n}}}(jQuery),function(e){e.fn.lifestream.feeds.wordpress=function(t,r){var a=e.extend({},{posted:'posted <a href="${link}">${title}</a>'},t.template),n=function(r){var n,s,u,o=[],l=0;if(r.query&&r.query.count&&r.query.count>0&&r.query.results.rss.channel.item)for(n=r.query.results.rss.channel.item,s=n.length;s>l;l++)u=n[l],o.push({date:new Date(u.pubDate),config:t,html:e.tmpl(a.posted,u)});return o},s="";return t.user&&(s=0===t.user.indexOf("http://")?t.user+"/feed":"http://"+t.user+".wordpress.com/feed",e.ajax({url:e.fn.lifestream.createYqlUrl('select * from xml where url="'+s+'"'),dataType:"jsonp",success:function(e){r(n(e))}})),{template:a}}}(jQuery),function(e){e.fn.lifestream.feeds.youtube=function(t,r){var a=e.extend({},{uploaded:'uploaded <a href="${video.player.default}" title="${video.description}">${video.title}</a>',favorited:'favorited <a href="${video.player.default}" title="${video.description}">${video.title}</a>'},t.template),n=function(r,n){var s,u,o,l,i,c=[],p=0;if(r.data&&r.data.items)for(s=r.data.items.length;s>p;p++){switch(u=r.data.items[p],n){case"favorited":o=u.video,l=u.created,i=u;break;case"uploaded":o=u,l=o.uploaded,i={video:o}}o.player&&o.player["default"]&&c.push({date:new Date(l),config:t,html:e.tmpl(a[n],i)})}return c};return e.ajax({url:"http://gdata.youtube.com/feeds/api/users/"+t.user+"/favorites?v=2&alt=jsonc",dataType:"jsonp",success:function(e){r(n(e,"favorited"))}}),e.ajax({url:"http://gdata.youtube.com/feeds/api/users/"+t.user+"/uploads?v=2&alt=jsonc",dataType:"jsonp",success:function(e){r(n(e,"uploaded"))}}),{template:a}}}(jQuery),function(e){e.fn.lifestream.feeds.zotero=function(t,r){var a=e.extend({},{flagged:'flagged <a href="${id}">${title}</a> by ${creatorSummary}'},t.template),n=function(r){var n,s,u=[],o=0;if(r.query&&r.query.count&&r.query.count>0)for(n=r.query.results.feed.entry,s=n.length;s>o;o++){var l=n[o];u.push({date:new Date(l.updated),config:t,url:"http://zotero.com/users/"+t.user,html:e.tmpl(a.flagged,l)})}return u};return e.ajax({url:e.fn.lifestream.createYqlUrl('select * from xml where url="https://api.zotero.org/users/'+t.user+'/items"'),dataType:"jsonp",success:function(e){r(n(e))}}),{template:a}}}(jQuery);
View
4 src/core.js
@@ -1,9 +1,9 @@
/*!
* jQuery Lifestream Plug-in
* Show a stream of your online activity
- * @version 0.4.2
+ * @version 0.4.3
* @author Christian Vuerings et al.
- * @copyright Copyright 2011, Christian Vuerings - http://denbuzze.com
+ * @copyright Copyright 2014, Christian Vuerings - http://denbuzze.com
* @license https://github.com/christianv/jquery-lifestream/blob/master/LICENSE MIT
*/
/*global jQuery */
Please sign in to comment.
Something went wrong with that request. Please try again.