").append(b.parseHTML(e)).find(i):e)}).complete(r&&function(e,t){u.each(r,s||[e.responseText,t,e])}),this},b.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){b.fn[t]=function(e){return this.on(t,e)}}),b.each(["get","post"],function(e,n){b[n]=function(e,r,i,s){return b.isFunction(r)&&(s=s||i,i=r,r=t),b.ajax({url:e,type:n,dataType:s,data:r,success:i})}}),b.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:gn,type:"GET",isLocal:xn.test(mn[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":On,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":e.String,"text html":!0,"text json":b.parseJSON,"text xml":b.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?Pn(Pn(e,b.ajaxSettings),t):Pn(b.ajaxSettings,e)},ajaxPrefilter:_n(Ln),ajaxTransport:_n(An),ajax:function(e,n){function N(e,n,r,i){var l,g,y,E,S,T=n;if(w===2)return;w=2,u&&clearTimeout(u),f=t,o=i||"",x.readyState=e>0?4:0,r&&(E=Hn(c,x,r));if(e>=200&&e<300||e===304)c.ifModified&&(S=x.getResponseHeader("Last-Modified"),S&&(b.lastModified[s]=S),S=x.getResponseHeader("etag"),S&&(b.etag[s]=S)),e===204?(l=!0,T="nocontent"):e===304?(l=!0,T="notmodified"):(l=Bn(c,E),T=l.state,g=l.data,y=l.error,l=!y);else{y=T;if(e||!T)T="error",e<0&&(e=0)}x.status=e,x.statusText=(n||T)+"",l?d.resolveWith(h,[g,T,x]):d.rejectWith(h,[x,T,y]),x.statusCode(m),m=t,a&&p.trigger(l?"ajaxSuccess":"ajaxError",[x,c,l?g:y]),v.fireWith(h,[x,T]),a&&(p.trigger("ajaxComplete",[x,c]),--b.active||b.event.trigger("ajaxStop"))}typeof e=="object"&&(n=e,e=t),n=n||{};var r,i,s,o,u,a,f,l,c=b.ajaxSetup({},n),h=c.context||c,p=c.context&&(h.nodeType||h.jquery)?b(h):b.event,d=b.Deferred(),v=b.Callbacks("once memory"),m=c.statusCode||{},g={},y={},w=0,S="canceled",x={readyState:0,getResponseHeader:function(e){var t;if(w===2){if(!l){l={};while(t=Sn.exec(o))l[t[1].toLowerCase()]=t[2]}t=l[e.toLowerCase()]}return t==null?null:t},getAllResponseHeaders:function(){return w===2?o:null},setRequestHeader:function(e,t){var n=e.toLowerCase();return w||(e=y[n]=y[n]||e,g[e]=t),this},overrideMimeType:function(e){return w||(c.mimeType=e),this},statusCode:function(e){var t;if(e)if(w<2)for(t in e)m[t]=[m[t],e[t]];else x.always(e[x.status]);return this},abort:function(e){var t=e||S;return f&&f.abort(t),N(0,t),this}};d.promise(x).complete=v.add,x.success=x.done,x.error=x.fail,c.url=((e||c.url||gn)+"").replace(wn,"").replace(Nn,mn[1]+"//"),c.type=n.method||n.type||c.method||c.type,c.dataTypes=b.trim(c.dataType||"*").toLowerCase().match(E)||[""],c.crossDomain==null&&(r=Cn.exec(c.url.toLowerCase()),c.crossDomain=!(!r||r[1]===mn[1]&&r[2]===mn[2]&&(r[3]||(r[1]==="http:"?80:443))==(mn[3]||(mn[1]==="http:"?80:443)))),c.data&&c.processData&&typeof c.data!="string"&&(c.data=b.param(c.data,c.traditional)),Dn(Ln,c,n,x);if(w===2)return x;a=c.global,a&&b.active++===0&&b.event.trigger("ajaxStart"),c.type=c.type.toUpperCase(),c.hasContent=!Tn.test(c.type),s=c.url,c.hasContent||(c.data&&(s=c.url+=(bn.test(s)?"&":"?")+c.data,delete c.data),c.cache===!1&&(c.url=En.test(s)?s.replace(En,"$1_="+yn++):s+(bn.test(s)?"&":"?")+"_="+yn++)),c.ifModified&&(b.lastModified[s]&&x.setRequestHeader("If-Modified-Since",b.lastModified[s]),b.etag[s]&&x.setRequestHeader("If-None-Match",b.etag[s])),(c.data&&c.hasContent&&c.contentType!==!1||n.contentType)&&x.setRequestHeader("Content-Type",c.contentType),x.setRequestHeader("Accept",c.dataTypes[0]&&c.accepts[c.dataTypes[0]]?c.accepts[c.dataTypes[0]]+(c.dataTypes[0]!=="*"?", "+On+"; q=0.01":""):c.accepts["*"]);for(i in c.headers)x.setRequestHeader(i,c.headers[i]);if(!c.beforeSend||c.beforeSend.call(h,x,c)!==!1&&w!==2){S="abort";for(i in{success:1,error:1,complete:1})x[i](c[i]);f=Dn(An,c,n,x);if(!f)N(-1,"No Transport");else{x.readyState=1,a&&p.trigger("ajaxSend",[x,c]),c.async&&c.timeout>0&&(u=setTimeout(function(){x.abort("timeout")},c.timeout));try{w=1,f.send(g,N)}catch(T){if(!(w<2))throw T;N(-1,T)}}return x}return x.abort()},getScript:function(e,n){return b.get(e,t,n,"script")},getJSON:function(e,t,n){return b.get(e,t,n,"json")}}),b.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(e){return b.globalEval(e),e}}}),b.ajaxPrefilter("script",function(e){e.cache===t&&(e.cache=!1),e.crossDomain&&(e.type="GET",e.global=!1)}),b.ajaxTransport("script",function(e){if(e.crossDomain){var n,r=s.head||b("head")[0]||s.documentElement;return{send:function(t,i){n=s.createElement("script"),n.async=!0,e.scriptCharset&&(n.charset=e.scriptCharset),n.src=e.url,n.onload=n.onreadystatechange=function(e,t){if(t||!n.readyState||/loaded|complete/.test(n.readyState))n.onload=n.onreadystatechange=null,n.parentNode&&n.parentNode.removeChild(n),n=null,t||i(200,"success")},r.insertBefore(n,r.firstChild)},abort:function(){n&&n.onload(t,!0)}}}});var jn=[],Fn=/(=)\?(?=&|$)|\?\?/;b.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=jn.pop()||b.expando+"_"+yn++;return this[e]=!0,e}}),b.ajaxPrefilter("json jsonp",function(n,r,i){var s,o,u,a=n.jsonp!==!1&&(Fn.test(n.url)?"url":typeof n.data=="string"&&!(n.contentType||"").indexOf("application/x-www-form-urlencoded")&&Fn.test(n.data)&&"data");if(a||n.dataTypes[0]==="jsonp")return s=n.jsonpCallback=b.isFunction(n.jsonpCallback)?n.jsonpCallback():n.jsonpCallback,a?n[a]=n[a].replace(Fn,"$1"+s):n.jsonp!==!1&&(n.url+=(bn.test(n.url)?"&":"?")+n.jsonp+"="+s),n.converters["script json"]=function(){return u||b.error(s+" was not called"),u[0]},n.dataTypes[0]="json",o=e[s],e[s]=function(){u=arguments},i.always(function(){e[s]=o,n[s]&&(n.jsonpCallback=r.jsonpCallback,jn.push(s)),u&&b.isFunction(o)&&o(u[0]),u=o=t}),"script"});var In,qn,Rn=0,Un=e.ActiveXObject&&function(){var e;for(e in In)In[e](t,!0)};b.ajaxSettings.xhr=e.ActiveXObject?function(){return!this.isLocal&&zn()||Wn()}:zn,qn=b.ajaxSettings.xhr(),b.support.cors=!!qn&&"withCredentials"in qn,qn=b.support.ajax=!!qn,qn&&b.ajaxTransport(function(n){if(!n.crossDomain||b.support.cors){var r;return{send:function(i,s){var o,u,a=n.xhr();n.username?a.open(n.type,n.url,n.async,n.username,n.password):a.open(n.type,n.url,n.async);if(n.xhrFields)for(u in n.xhrFields)a[u]=n.xhrFields[u];n.mimeType&&a.overrideMimeType&&a.overrideMimeType(n.mimeType),!n.crossDomain&&!i["X-Requested-With"]&&(i["X-Requested-With"]="XMLHttpRequest");try{for(u in i)a.setRequestHeader(u,i[u])}catch(f){}a.send(n.hasContent&&n.data||null),r=function(e,i){var u,f,l,c;try{if(r&&(i||a.readyState===4)){r=t,o&&(a.onreadystatechange=b.noop,Un&&delete In[o]);if(i)a.readyState!==4&&a.abort();else{c={},u=a.status,f=a.getAllResponseHeaders(),typeof a.responseText=="string"&&(c.text=a.responseText);try{l=a.statusText}catch(h){l=""}!u&&n.isLocal&&!n.crossDomain?u=c.text?200:404:u===1223&&(u=204)}}}catch(p){i||s(-1,p)}c&&s(u,l,c,f)},n.async?a.readyState===4?setTimeout(r):(o=++Rn,Un&&(In||(In={},b(e).unload(Un)),In[o]=r),a.onreadystatechange=r):r()},abort:function(){r&&r(t,!0)}}}});var Xn,Vn,$n=/^(?:toggle|show|hide)$/,Jn=new RegExp("^(?:([+-])=|)("+w+")([a-z%]*)$","i"),Kn=/queueHooks$/,Qn=[nr],Gn={"*":[function(e,t){var n,r,i=this.createTween(e,t),s=Jn.exec(t),o=i.cur(),u=+o||0,a=1,f=20;if(s){n=+s[2],r=s[3]||(b.cssNumber[e]?"":"px");if(r!=="px"&&u){u=b.css(i.elem,e,!0)||n||1;do a=a||".5",u/=a,b.style(i.elem,e,u+r);while(a!==(a=i.cur()/o)&&a!==1&&--f)}i.unit=r,i.start=u,i.end=s[1]?u+(s[1]+1)*n:n}return i}]};b.Animation=b.extend(er,{tweener:function(e,t){b.isFunction(e)?(t=e,e=["*"]):e=e.split(" ");var n,r=0,i=e.length;for(;r
-1,f={},l={},c,h;a?(l=i.position(),c=l.top,h=l.left):(c=parseFloat(o)||0,h=parseFloat(u)||0),b.isFunction(t)&&(t=t.call(e,n,s)),t.top!=null&&(f.top=t.top-s.top+c),t.left!=null&&(f.left=t.left-s.left+h),"using"in t?t.using.call(e,f):i.css(f)}},b.fn.extend({position:function(){if(!this[0])return;var e,t,n={top:0,left:0},r=this[0];return b.css(r,"position")==="fixed"?t=r.getBoundingClientRect():(e=this.offsetParent(),t=this.offset(),b.nodeName(e[0],"html")||(n=e.offset()),n.top+=b.css(e[0],"borderTopWidth",!0),n.left+=b.css(e[0],"borderLeftWidth",!0)),{top:t.top-n.top-b.css(r,"marginTop",!0),left:t.left-n.left-b.css(r,"marginLeft",!0)}},offsetParent:function(){return this.map(function(){var e=this.offsetParent||s.documentElement;while(e&&!b.nodeName(e,"html")&&b.css(e,"position")==="static")e=e.offsetParent;return e||s.documentElement})}}),b.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,n){var r=/Y/.test(n);b.fn[e]=function(i){return b.access(this,function(e,i,s){var o=sr(e);if(s===t)return o?n in o?o[n]:o.document.documentElement[i]:e[i];o?o.scrollTo(r?b(o).scrollLeft():s,r?s:b(o).scrollTop()):e[i]=s},e,i,arguments.length,null)}}),b.each({Height:"height",Width:"width"},function(e,n){b.each({padding:"inner"+e,content:n,"":"outer"+e},function(r,i){b.fn[i]=function(i,s){var o=arguments.length&&(r||typeof i!="boolean"),u=r||(i===!0||s===!0?"margin":"border");return b.access(this,function(n,r,i){var s;return b.isWindow(n)?n.document.documentElement["client"+e]:n.nodeType===9?(s=n.documentElement,Math.max(n.body["scroll"+e],s["scroll"+e],n.body["offset"+e],s["offset"+e],s["client"+e])):i===t?b.css(n,r,u):b.style(n,r,i,u)},n,o?i:t,o,null)}})}),e.jQuery=e.$=b,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return b})})(window),function(){var e=this,t=e._,n={},r=Array.prototype,i=Object.prototype,s=Function.prototype,o=r.push,u=r.slice,a=r.concat,f=i.toString,l=i.hasOwnProperty,c=r.forEach,h=r.map,p=r.reduce,d=r.reduceRight,v=r.filter,m=r.every,g=r.some,y=r.indexOf,b=r.lastIndexOf,w=Array.isArray,E=Object.keys,S=s.bind,x=function(e){if(e instanceof x)return e;if(!(this instanceof x))return new x(e);this._wrapped=e};typeof exports!="undefined"?(typeof module!="undefined"&&module.exports&&(exports=module.exports=x),exports._=x):e._=x,x.VERSION="1.4.4";var T=x.each=x.forEach=function(e,t,r){if(e==null)return;if(c&&e.forEach===c)e.forEach(t,r);else if(e.length===+e.length){for(var i=0,s=e.length;i2;e==null&&(e=[]);if(p&&e.reduce===p)return r&&(t=x.bind(t,r)),i?e.reduce(t,n):e.reduce(t);T(e,function(e,s,o){i?n=t.call(r,n,e,s,o):(n=e,i=!0)});if(!i)throw new TypeError(N);return n},x.reduceRight=x.foldr=function(e,t,n,r){var i=arguments.length>2;e==null&&(e=[]);if(d&&e.reduceRight===d)return r&&(t=x.bind(t,r)),i?e.reduceRight(t,n):e.reduceRight(t);var s=e.length;if(s!==+s){var o=x.keys(e);s=o.length}T(e,function(u,a,f){a=o?o[--s]:--s,i?n=t.call(r,n,e[a],a,f):(n=e[a],i=!0)});if(!i)throw new TypeError(N);return n},x.find=x.detect=function(e,t,n){var r;return C(e,function(e,i,s){if(t.call(n,e,i,s))return r=e,!0}),r},x.filter=x.select=function(e,t,n){var r=[];return e==null?r:v&&e.filter===v?e.filter(t,n):(T(e,function(e,i,s){t.call(n,e,i,s)&&(r[r.length]=e)}),r)},x.reject=function(e,t,n){return x.filter(e,function(e,r,i){return!t.call(n,e,r,i)},n)},x.every=x.all=function(e,t,r){t||(t=x.identity);var i=!0;return e==null?i:m&&e.every===m?e.every(t,r):(T(e,function(e,s,o){if(!(i=i&&t.call(r,e,s,o)))return n}),!!i)};var C=x.some=x.any=function(e,t,r){t||(t=x.identity);var i=!1;return e==null?i:g&&e.some===g?e.some(t,r):(T(e,function(e,s,o){if(i||(i=t.call(r,e,s,o)))return n}),!!i)};x.contains=x.include=function(e,t){return e==null?!1:y&&e.indexOf===y?e.indexOf(t)!=-1:C(e,function(e){return e===t})},x.invoke=function(e,t){var n=u.call(arguments,2),r=x.isFunction(t);return x.map(e,function(e){return(r?t:e[t]).apply(e,n)})},x.pluck=function(e,t){return x.map(e,function(e){return e[t]})},x.where=function(e,t,n){return x.isEmpty(t)?n?null:[]:x[n?"find":"filter"](e,function(e){for(var n in t)if(t[n]!==e[n])return!1;return!0})},x.findWhere=function(e,t){return x.where(e,t,!0)},x.max=function(e,t,n){if(!t&&x.isArray(e)&&e[0]===+e[0]&&e.length<65535)return Math.max.apply(Math,e);if(!t&&x.isEmpty(e))return-Infinity;var r={computed:-Infinity,value:-Infinity};return T(e,function(e,i,s){var o=t?t.call(n,e,i,s):e;o>=r.computed&&(r={value:e,computed:o})}),r.value},x.min=function(e,t,n){if(!t&&x.isArray(e)&&e[0]===+e[0]&&e.length<65535)return Math.min.apply(Math,e);if(!t&&x.isEmpty(e))return Infinity;var r={computed:Infinity,value:Infinity};return T(e,function(e,i,s){var o=t?t.call(n,e,i,s):e;or||n===void 0)return 1;if(n>>1;n.call(r,e[u])=0})})},x.difference=function(e){var t=a.apply(r,u.call(arguments,1));return x.filter(e,function(e){return!x.contains(t,e)})},x.zip=function(){var e=u.call(arguments),t=x.max(x.pluck(e,"length")),n=new Array(t);for(var r=0;r=0;n--)t=[e[n].apply(this,t)];return t[0]}},x.after=function(e,t){return e<=0?t():function(){if(--e<1)return t.apply(this,arguments)}},x.keys=E||function(e){if(e!==Object(e))throw new TypeError("Invalid object");var t=[];for(var n in e)x.has(e,n)&&(t[t.length]=n);return t},x.values=function(e){var t=[];for(var n in e)x.has(e,n)&&t.push(e[n]);return t},x.pairs=function(e){var t=[];for(var n in e)x.has(e,n)&&t.push([n,e[n]]);return t},x.invert=function(e){var t={};for(var n in e)x.has(e,n)&&(t[e[n]]=n);return t},x.functions=x.methods=function(e){var t=[];for(var n in e)x.isFunction(e[n])&&t.push(n);return t.sort()},x.extend=function(e){return T(u.call(arguments,1),function(t){if(t)for(var n in t)e[n]=t[n]}),e},x.pick=function(e){var t={},n=a.apply(r,u.call(arguments,1));return T(n,function(n){n in e&&(t[n]=e[n])}),t},x.omit=function(e){var t={},n=a.apply(r,u.call(arguments,1));for(var i in e)x.contains(n,i)||(t[i]=e[i]);return t},x.defaults=function(e){return T(u.call(arguments,1),function(t){if(t)for(var n in t)e[n]==null&&(e[n]=t[n])}),e},x.clone=function(e){return x.isObject(e)?x.isArray(e)?e.slice():x.extend({},e):e},x.tap=function(e,t){return t(e),e};var O=function(e,t,n,r){if(e===t)return e!==0||1/e==1/t;if(e==null||t==null)return e===t;e instanceof x&&(e=e._wrapped),t instanceof x&&(t=t._wrapped);var i=f.call(e);if(i!=f.call(t))return!1;switch(i){case"[object String]":return e==String(t);case"[object Number]":return e!=+e?t!=+t:e==0?1/e==1/t:e==+t;case"[object Date]":case"[object Boolean]":return+e==+t;case"[object RegExp]":return e.source==t.source&&e.global==t.global&&e.multiline==t.multiline&&e.ignoreCase==t.ignoreCase}if(typeof e!="object"||typeof t!="object")return!1;var s=n.length;while(s--)if(n[s]==e)return r[s]==t;n.push(e),r.push(t);var o=0,u=!0;if(i=="[object Array]"){o=e.length,u=o==t.length;if(u)while(o--)if(!(u=O(e[o],t[o],n,r)))break}else{var a=e.constructor,l=t.constructor;if(a!==l&&!(x.isFunction(a)&&a instanceof a&&x.isFunction(l)&&l instanceof l))return!1;for(var c in e)if(x.has(e,c)){o++;if(!(u=x.has(t,c)&&O(e[c],t[c],n,r)))break}if(u){for(c in t)if(x.has(t,c)&&!(o--))break;u=!o}}return n.pop(),r.pop(),u};x.isEqual=function(e,t){return O(e,t,[],[])},x.isEmpty=function(e){if(e==null)return!0;if(x.isArray(e)||x.isString(e))return e.length===0;for(var t in e)if(x.has(e,t))return!1;return!0},x.isElement=function(e){return!!e&&e.nodeType===1},x.isArray=w||function(e){return f.call(e)=="[object Array]"},x.isObject=function(e){return e===Object(e)},T(["Arguments","Function","String","Number","Date","RegExp"],function(e){x["is"+e]=function(t){return f.call(t)=="[object "+e+"]"}}),x.isArguments(arguments)||(x.isArguments=function(e){return!!e&&!!x.has(e,"callee")}),typeof /./!="function"&&(x.isFunction=function(e){return typeof e=="function"}),x.isFinite=function(e){return isFinite(e)&&!isNaN(parseFloat(e))},x.isNaN=function(e){return x.isNumber(e)&&e!=+e},x.isBoolean=function(e){return e===!0||e===!1||f.call(e)=="[object Boolean]"},x.isNull=function(e){return e===null},x.isUndefined=function(e){return e===void 0},x.has=function(e,t){return l.call(e,t)},x.noConflict=function(){return e._=t,this},x.identity=function(e){return e},x.times=function(e,t,n){var r=Array(e);for(var i=0;i":">",'"':""","'":"'","/":"/"}};M.unescape=x.invert(M.escape);var _={escape:new RegExp("["+x.keys(M.escape).join("")+"]","g"),unescape:new RegExp("("+x.keys(M.unescape).join("|")+")","g")};x.each(["escape","unescape"],function(e){x[e]=function(t){return t==null?"":(""+t).replace(_[e],function(t){return M[e][t]})}}),x.result=function(e,t){if(e==null)return null;var n=e[t];return x.isFunction(n)?n.call(e):n},x.mixin=function(e){T(x.functions(e),function(t){var n=x[t]=e[t];x.prototype[t]=function(){var e=[this._wrapped];return o.apply(e,arguments),j.call(this,n.apply(x,e))}})};var D=0;x.uniqueId=function(e){var t=++D+"";return e?e+t:t},x.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var P=/(.)^/,H={"'":"'","\\":"\\","\r":"r","\n":"n"," ":"t","\u2028":"u2028","\u2029":"u2029"},B=/\\|'|\r|\n|\t|\u2028|\u2029/g;x.template=function(e,t,n){var r;n=x.defaults({},n,x.templateSettings);var i=new RegExp([(n.escape||P).source,(n.interpolate||P).source,(n.evaluate||P).source].join("|")+"|$","g"),s=0,o="__p+='";e.replace(i,function(t,n,r,i,u){return o+=e.slice(s,u).replace(B,function(e){return"\\"+H[e]}),n&&(o+="'+\n((__t=("+n+"))==null?'':_.escape(__t))+\n'"),r&&(o+="'+\n((__t=("+r+"))==null?'':__t)+\n'"),i&&(o+="';\n"+i+"\n__p+='"),s=u+t.length,t}),o+="';\n",n.variable||(o="with(obj||{}){\n"+o+"}\n"),o="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+o+"return __p;\n";try{r=new Function(n.variable||"obj","_",o)}catch(u){throw u.source=o,u}if(t)return r(t,x);var a=function(e){return r.call(this,e,x)};return a.source="function("+(n.variable||"obj")+"){\n"+o+"}",a},x.chain=function(e){return x(e).chain()};var j=function(e){return this._chain?x(e).chain():e};x.mixin(x),T(["pop","push","reverse","shift","sort","splice","unshift"],function(e){var t=r[e];x.prototype[e]=function(){var n=this._wrapped;return t.apply(n,arguments),(e=="shift"||e=="splice")&&n.length===0&&delete n[0],j.call(this,n)}}),T(["concat","join","slice"],function(e){var t=r[e];x.prototype[e]=function(){return j.call(this,t.apply(this._wrapped,arguments))}}),x.extend(x.prototype,{chain:function(){return this._chain=!0,this},value:function(){return this._wrapped}})}.call(this),define("underscore",function(e){return function(){var t,n;return t||e._}}(this));var saveAs=saveAs||navigator.msSaveBlob&&navigator.msSaveBlob.bind(navigator)||function(e){try{var t=e.document,n=function(){return e.URL||e.webkitURL||e},r=e.URL||e.webkitURL||e,i=t.createElementNS("http://www.w3.org/1999/xhtml","a"),s="download"in i,o=function(n){var r=t.createEvent("MouseEvents");r.initMouseEvent("click",!0,!1,e,0,0,0,0,0,!1,!1,!1,!1,0,null),n.dispatchEvent(r)},u=e.webkitRequestFileSystem,a=e.requestFileSystem||u||e.mozRequestFileSystem,f=function(t){(e.setImmediate||e.setTimeout)(function(){throw t},0)},l="application/octet-stream",c=0,h=[],p=function(){var e=h.length;while(e--){var t=h[e];typeof t=="string"?r.revokeObjectURL(t):t.remove()}h.length=0},d=function(e,t,n){t=[].concat(t);var r=t.length;while(r--){var i=e["on"+t[r]];if(typeof i=="function")try{i.call(e,n||e)}catch(s){f(s)}}},v=function(t,r){var f=this,p=t.type,v=!1,m,g,y=function(){var e=n().createObjectURL(t);return h.push(e),e},b=function(){d(f,"writestart progress write writeend".split(" "))},w=function(){if(v||!m)m=y(t);g&&(g.location.href=m),f.readyState=f.DONE,b()},E=function(e){return function(){if(f.readyState!==f.DONE)return e.apply(this,arguments)}},S={create:!0,exclusive:!1},x;f.readyState=f.INIT,r||(r="download");if(s){m=y(t),i.href=m,i.download=r,o(i),f.readyState=f.DONE,b();return}e.chrome&&p&&p!==l&&(x=t.slice||t.webkitSlice,t=x.call(t,0,t.size,l),v=!0),u&&r!=="download"&&(r+=".download"),p===l||u?g=e:g=e.open();if(!a){w();return}c+=t.size,a(e.TEMPORARY,c,E(function(e){e.root.getDirectory("saved",S,E(function(e){var n=function(){e.getFile(r,S,E(function(e){e.createWriter(E(function(n){n.onwriteend=function(t){g.location.href=e.toURL(),h.push(e),f.readyState=f.DONE,d(f,"writeend",t)},n.onerror=function(){var e=n.error;e.code!==e.ABORT_ERR&&w()},"writestart progress write abort".split(" ").forEach(function(e){n["on"+e]=f["on"+e]}),n.write(t),f.abort=function(){n.abort(),f.readyState=f.DONE},f.readyState=f.WRITING}),w)}),w)};e.getFile(r,{create:!1},E(function(e){e.remove(),n()}),E(function(e){e.code===e.NOT_FOUND_ERR?n():w()}))}),w)}),w)},m=v.prototype,g=function(e,t){return new v(e,t)};return m.abort=function(){var e=this;e.readyState=e.DONE,d(e,"abort")},m.readyState=m.INIT=0,m.WRITING=1,m.DONE=2,m.error=m.onwritestart=m.onprogress=m.onwrite=m.onabort=m.onerror=m.onwriteend=null,e.addEventListener("unload",p,!1),g}catch(y){return undefined}}(self);define("libs/FileSaver",function(){}),define("utils",["jquery","underscore","libs/FileSaver"],function(e,t){function r(n){return t.isString(n)?e(n):n}function i(e,t){t!==undefined&&(e.stop(!0,!0).addClass("error").delay(1e3).switchClass("error"),t.stopPropagation())}var n={};n.getURLParameter=function(e){var t=new RegExp(e+"=(.+?)(&|$)");try{return decodeURIComponent(t.exec(location.search)[1])}catch(n){return undefined}},n.getInputValue=function(e){return e=r(e),e.val()},n.setInputValue=function(e,t){e=r(e),e.val(t)},n.getInputTextValue=function(e,t,s){e=r(e);var o=e.val();return o===undefined?(i(e,t),undefined):(o=n.trim(o),o.length===0||s!==undefined&&!o.match(s)?(i(e,t),undefined):o)},n.getInputIntValue=function(e,t,s,o){e=r(e);var u=n.getInputTextValue(e,t);return u===undefined?undefined:(u=parseInt(u),u===NaN||s!==undefined&&uo?(i(e,t),undefined):u)},n.getInputRegExpValue=function(e,t){e=r(e);var s=n.getInputTextValue(e,t);if(s===undefined)return undefined;try{new RegExp(s)}catch(o){return i(e,t),undefined}return s},n.getInputChecked=function(e){return e=r(e),e.prop("checked")},n.setInputChecked=function(e,t){e=r(e),e.prop("checked",t)},n.getInputRadio=function(t){return e("input:radio[name="+t+"]:checked").prop("value")},n.setInputRadio=function(t,n){e("input:radio[name="+t+"][value="+n+"]").prop("checked",!0)},n.resetModalInputs=function(){e(".modal input[type=text]:not([disabled]), .modal input[type=password]").val("")},n.trim=function(t){return e.trim(t)},n.slugify=function(e){return e.toLowerCase().replace(/\s+/g,"-").replace(/[^\w\-]+/g,"").replace(/\-\-+/g,"-").replace(/^-+/,"").replace(/-+$/,"")},n.checkUrl=function(e,t){return e?(e.indexOf("http")!==0&&(e="http://"+e),t&&e.indexOf("/",e.length-1)===-1&&(e+="/"),e):e},n.popupWindow=function(e,t,n,r){var i=screen.width/2-n/2,s=screen.height/2-r/2;return window.open(e,t,["toolbar=no, ","location=no, ","directories=no, ","status=no, ","menubar=no, ","scrollbars=no, ","resizable=no, ","copyhistory=no, ","width="+n+", ","height="+r+", ","top="+s+", ","left="+i].join(""))},n.saveAs=function(e,t){if(saveAs!==undefined){var r=new Blob([e],{type:"text/plain;charset=utf-8"});saveAs(r,t)}else{var i="data:application/octet-stream;base64,"+n.encodeBase64(e);window.open(i,"file")}},n.randomString=function(){return t.random(4294967296).toString(36)},n.updateCurrentTime=function(){n.currentTime=(new Date).getTime()},n.updateCurrentTime(),n.storeAttributes=function(e){var n=e.syncIndex||e.publishIndex;e=t.omit(e,"syncIndex","publishIndex"),e.provider=e.provider.providerId,localStorage[n]=JSON.stringify(e)},n.retrieveIndexArray=function(e){try{return t.compact(localStorage[e].split(";"))}catch(n){return localStorage[e]=";",[]}},n.appendIndexToArray=function(e,t){localStorage[e]+=t+";"},n.removeIndexFromArray=function(e,t){localStorage[e]=localStorage[e].replace(";"+t+";",";")},n.retrieveIgnoreError=function(e){try{return JSON.parse(localStorage[e])}catch(t){return undefined}},n.encodeBase64=function(e){if(e.length===0)return"";var t=[],n=0,r,i;e=encodeURI(e),r=e.length;while(n>18)),f.push(o.charAt(a>>12&63)),f.push(o.charAt(a>>6&63)),f.push(o.charAt(a&63));switch(t.length-l){case 1:a=t[u]<<16,f.push(o.charAt(a>>18)+o.charAt(a>>12&63)+s+s);break;case 2:a=t[u]<<16|t[u+1]<<8,f.push(o.charAt(a>>18)+o.charAt(a>>12&63)+o.charAt(a>>6&63)+s)}return f.join("")};var s=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117];return n.crc32=function(e){var t=0,n=-1;for(var r=0;r>>8^s[t];return n^=-1,n<0&&(n=4294967295+n+1),n.toString(16)},n});var MAIN_URL="http://benweet.github.io/stackedit/",GOOGLE_ANALYTICS_ACCOUNT_ID="UA-39556145-1",GOOGLE_API_KEY="AIzaSyAeCU8CGcSkn0z9js6iocHuPBX4f_mMWkw",GOOGLE_SCOPES=["https://www.googleapis.com/auth/drive.install","https://www.googleapis.com/auth/drive","https://www.googleapis.com/auth/blogger"],GOOGLE_DRIVE_APP_ID="241271498917",DROPBOX_APP_KEY="lq6mwopab8wskas",DROPBOX_APP_SECRET="851fgnucpezy84t",BITLY_ACCESS_TOKEN="317e033bfd48cf31155a68a536b1860013b09c4c",DEFAULT_FILE_TITLE="Title",GDRIVE_DEFAULT_FILE_TITLE="New Markdown document",CHECK_ONLINE_PERIOD=12e4,AJAX_TIMEOUT=3e4,ASYNC_TASK_DEFAULT_TIMEOUT=6e4,ASYNC_TASK_LONG_TIMEOUT=18e4,SYNC_PERIOD=18e4,USER_IDLE_THRESHOLD=3e5,TEMPORARY_FILE_INDEX="file.tempIndex",WELCOME_DOCUMENT_TITLE="Welcome document",DOWNLOAD_PROXY_URL="http://stackedit-download-proxy.herokuapp.com/",WORDPRESS_CLIENT_ID="3185",WORDPRESS_PROXY_URL="http://stackedit-wordpress-proxy.herokuapp.com/",SSH_PROXY_URL="http://stackedit-ssh-proxy.herokuapp.com/",delayedFunction=undefined,BASE_URL="http://localhost/",GOOGLE_CLIENT_ID="241271498917-lev37kef013q85avc91am1gccg5g8lrb.apps.googleusercontent.com",GITHUB_CLIENT_ID="e47fef6055344579799d",GATEKEEPER_URL="http://stackedit-gatekeeper-localhost.herokuapp.com/",TUMBLR_PROXY_URL="http://stackedit-tumblr-proxy-local.herokuapp.com/";location.hostname.indexOf("benweet.github.io")===0&&(BASE_URL=MAIN_URL,GOOGLE_CLIENT_ID="241271498917-jpto9lls9fqnem1e4h6ppds9uob8rpvu.apps.googleusercontent.com",GITHUB_CLIENT_ID="fa0d09514da8377ee32e",GATEKEEPER_URL="http://stackedit-gatekeeper.herokuapp.com/",TUMBLR_PROXY_URL="http://stackedit-tumblr-proxy.herokuapp.com/");var THEME_LIST={"":"Default","blue-gray":"Blue-Gray",night:"Night"};define("config",function(){}),define("settings",["underscore","config"],function(e){var t={layoutOrientation:"horizontal",lazyRendering:!0,editorFontSize:14,defaultContent:"\n\n\n> Written with [StackEdit]("+MAIN_URL+").",commitMsg:"Published with "+MAIN_URL,template:["\n","\n","\n",' \n',"<%= documentTitle %> \n",' \n',"\n","<%= documentHTML %>\n",""].join(""),sshProxy:SSH_PROXY_URL,extensionSettings:{}};try{e.extend(t,JSON.parse(localStorage.settings))}catch(n){}return t}),define("text",["module"],function(e){var t,n,r,i,s=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"],o=/^\s*<\?xml(\s)+version=[\'\"](\d)*.(\d)*[\'\"](\s)*\?>/im,u=/]*>\s*([\s\S]+)\s*<\/body>/im,a=typeof location!="undefined"&&location.href,f=a&&location.protocol&&location.protocol.replace(/\:/,""),l=a&&location.hostname,c=a&&(location.port||undefined),h=[],p=e.config&&e.config()||{};t={version:"2.0.6",strip:function(e){if(e){e=e.replace(o,"");var t=e.match(u);t&&(e=t[1])}else e="";return e},jsEscape:function(e){return e.replace(/(['\\])/g,"\\$1").replace(/[\f]/g,"\\f").replace(/[\b]/g,"\\b").replace(/[\n]/g,"\\n").replace(/[\t]/g,"\\t").replace(/[\r]/g,"\\r").replace(/[\u2028]/g,"\\u2028").replace(/[\u2029]/g,"\\u2029")},createXhr:p.createXhr||function(){var e,t,n;if(typeof XMLHttpRequest!="undefined")return new XMLHttpRequest;if(typeof ActiveXObject!="undefined")for(t=0;t<3;t+=1){n=s[t];try{e=new ActiveXObject(n)}catch(r){}if(e){s=[n];break}}return e},parseName:function(e){var t,n,r,i=!1,s=e.indexOf("."),o=e.indexOf("./")===0||e.indexOf("../")===0;return s!==-1&&(!o||s>1)?(t=e.substring(0,s),n=e.substring(s+1,e.length)):t=e,r=n||t,s=r.indexOf("!"),s!==-1&&(i=r.substring(s+1)==="strip",r=r.substring(0,s),n?n=r:t=r),{moduleName:t,ext:n,strip:i}},xdRegExp:/^((\w+)\:)?\/\/([^\/\\]+)/,useXhr:function(e,n,r,i){var s,o,u,a=t.xdRegExp.exec(e);return a?(s=a[2],o=a[3],o=o.split(":"),u=o[1],o=o[0],(!s||s===n)&&(!o||o.toLowerCase()===r.toLowerCase())&&(!u&&!o||u===i)):!0},finishLoad:function(e,n,r,i){r=n?t.strip(r):r,p.isBuild&&(h[e]=r),i(r)},load:function(e,n,r,i){if(i.isBuild&&!i.inlineText){r();return}p.isBuild=i.isBuild;var s=t.parseName(e),o=s.moduleName+(s.ext?"."+s.ext:""),u=n.toUrl(o),h=p.useXhr||t.useXhr;!a||h(u,f,l,c)?t.get(u,function(n){t.finishLoad(e,s.strip,n,r)},function(e){r.error&&r.error(e)}):n([o],function(e){t.finishLoad(s.moduleName+"."+s.ext,s.strip,e,r)})},write:function(e,n,r,i){if(h.hasOwnProperty(n)){var s=t.jsEscape(h[n]);r.asModule(e+"!"+n,"define(function () { return '"+s+"';});\n")}},writeFile:function(e,n,r,i,s){var o=t.parseName(n),u=o.ext?"."+o.ext:"",a=o.moduleName+u,f=r.toUrl(o.moduleName+u)+".js";t.load(a,r,function(n){var r=function(e){return i(f,e)};r.asModule=function(e,t){return i.asModule(e,f,t)},t.write(e,a,r,s)},s)}};if(p.env==="node"||!p.env&&typeof process!="undefined"&&process.versions&&!!process.versions.node)n=require.nodeRequire("fs"),t.get=function(e,t){var r=n.readFileSync(e,"utf8");r.indexOf("")===0&&(r=r.substring(1)),t(r)};else if(p.env==="xhr"||!p.env&&t.createXhr())t.get=function(e,n,r,i){var s=t.createXhr(),o;s.open("GET",e,!0);if(i)for(o in i)i.hasOwnProperty(o)&&s.setRequestHeader(o.toLowerCase(),i[o]);p.onXhr&&p.onXhr(s,e),s.onreadystatechange=function(t){var i,o;s.readyState===4&&(i=s.status,i>399&&i<600?(o=new Error(e+" HTTP status: "+i),o.xhr=s,r(o)):n(s.responseText),p.onXhrComplete&&p.onXhrComplete(s,e))},s.send(null)};else if(p.env==="rhino"||!p.env&&typeof Packages!="undefined"&&typeof java!="undefined")t.get=function(e,t){var n,r,i="utf-8",s=new java.io.File(e),o=java.lang.System.getProperty("line.separator"),u=new java.io.BufferedReader(new java.io.InputStreamReader(new java.io.FileInputStream(s),i)),a="";try{n=new java.lang.StringBuffer,r=u.readLine(),r&&r.length()&&r.charAt(0)===65279&&(r=r.substring(1)),n.append(r);while((r=u.readLine())!==null)n.append(o),n.append(r);a=String(n.toString())}finally{u.close()}t(a)};else if(p.env==="xpconnect"||!p.env&&typeof Components!="undefined"&&Components.classes&&Components.interfaces)r=Components.classes,i=Components.interfaces,Components.utils["import"]("resource://gre/modules/FileUtils.jsm"),t.get=function(e,t){var n,s,o={},u=new FileUtils.File(e);try{n=r["@mozilla.org/network/file-input-stream;1"].createInstance(i.nsIFileInputStream),n.init(u,1,0,!1),s=r["@mozilla.org/intl/converter-input-stream;1"].createInstance(i.nsIConverterInputStream),s.init(n,"utf-8",n.available(),i.nsIConverterInputStream.DEFAULT_REPLACEMENT_CHARACTER),s.readString(n.available(),o),s.close(),n.close(),t(o.value)}catch(a){throw new Error((u&&u.path||"")+": "+a)}};return t}),define("text!html/settingsExtensionsAccordion.html",[],function(){return'\r\n
\r\n
\r\n
<%= settingsBloc %>
\r\n
\r\n
\r\n'}),define("extensions/googleAnalytics",["jquery","underscore","settings","config"],function(e,t,n){var r={extensionId:"googleAnalytics",extensionName:"Google Analytics",optional:!0,settingsBloc:"Sends anonymous statistics about usage and errors to help improve StackEdit.
"},i=!1,s=!1;window._gaq=[];var o=function(){if(i===!1&&s===!1){var t="/ga.js";location.search.match(/(\?|&)console/)&&(t="/u/ga_debug.js"),e.ajax({url:"http://www.google-analytics.com"+t,dataType:"script"}).done(function(){i=!0})}},u="Unknown";r.onReady=function(){_gaq.push(["_setAccount",GOOGLE_ANALYTICS_ACCOUNT_ID]),_gaq.push(["_trackPageview"]),_gaq.push(["_trackEvent","Settings","layoutOrientation",""+n.layoutOrientation]),_gaq.push(["_trackEvent","Settings","lazyRendering",""+n.lazyRendering]),_gaq.push(["_trackEvent","Settings","editorFontSize",""+n.editorFontSize]),_gaq.push(["_trackEvent","Settings","defaultContent backlink",""+(n.defaultContent.indexOf(MAIN_URL)!==-1)]),_gaq.push(["_trackEvent","Settings","commitMsg backlink",""+(n.commitMsg.indexOf(MAIN_URL)!==-1)]),_gaq.push(["_trackEvent","Settings","sshProxy unchanged",""+(n.sshProxy==SSH_PROXY_URL)]),t.each(n.extensionSettings,function(e,t){_gaq.push(["_trackEvent","Extensions",t+" enabled",""+(e.enabled===!0)])}),window.onerror=function(e,t,n){_gaq.push(["_trackEvent",u,"JS error",e+"("+t+": "+n+")"])},o()},r.onOfflineChanged=function(e){s=e,o()};var a=0;return r.onSyncRunning=function(e){e===!0&&(u="Sync",a=(new Date).getTime())},r.onPublishRunning=function(e){e===!0&&(u="Publish",a=(new Date).getTime())},r.onAsyncRunning=function(e){e===!1&&(u="Unknown")},r.onSyncSuccess=function(){var e=(new Date).getTime();_gaq.push(["_trackTiming","Sync","SyncTime",e-a])},r.onSyncImportSuccess=function(e,t){_gaq.push(["_trackEvent","Sync","SyncImport"]),_gaq.push(["_trackEvent","Sync","SyncImport provider",t.providerId])},r.onSyncExportSuccess=function(e,t){_gaq.push(["_trackEvent","Sync","SyncExport"]),_gaq.push(["_trackEvent","Sync","SyncExport provider",t.provider.providerId])},r.onPublishSuccess=function(e){var n=(new Date).getTime();_gaq.push(["_trackTiming","Publish","PublishSuccess",n-a]),t.each(e.publishLocations,function(e){_gaq.push(["_trackEvent","Publish","PublishSuccess provider",e.provider.providerId])})},r.onNewPublishSuccess=function(e,t){_gaq.push(["_trackEvent","Publish","NewPublish provider",t.provider.providerId])},r.onError=function(e){if(t.isString(e)||!e.message)return;_gaq.push(["_trackEvent",u,"Error",e.message])},r}),define("text!html/buttonSync.html",[],function(){return'\r\n \r\n '}),define("text!html/buttonSyncSettingsBloc.html",[],function(){return'Adds a "Synchronize documents" button in the navigation bar.
\r\n'}),define("extensions/buttonSync",["jquery","underscore","utils","text!html/buttonSync.html","text!html/buttonSyncSettingsBloc.html"],function(e,t,n,r,i){var s={extensionId:"buttonSync",extensionName:'Button "Synchronize"',defaultConfig:{syncPeriod:18e4},settingsBloc:i};s.onLoadSettings=function(){n.setInputValue("#input-sync-period",s.config.syncPeriod)},s.onSaveSettings=function(e,t){e.syncPeriod=n.getInputIntValue("#input-sync-period",undefined,0)};var o=undefined,u=!1,a=!1,f=!1,l=function(){if(o===undefined)return;u===!0||a===!1||f?o.addClass("disabled"):o.removeClass("disabled")},c=undefined;s.onSynchronizerCreated=function(e){c=e};var h=0;s.onPeriodicRun=function(){if(viewerMode===!0||!s.config.syncPeriod||h+s.config.syncPeriod>n.currentTime)return;c.sync()===!0&&(h=n.currentTime)},s.onCreateButton=function(){return o=e(r).click(function(){e(this).hasClass("disabled")||c.sync()}),o},s.onReady=l,s.onSyncRunning=function(e){u=e,a=!0,l()},s.onSyncSuccess=function(){a=!1,l()},s.onOfflineChanged=function(e){f=e,l()};var p=function(e){t.size(e.syncLocations)!==0&&(a=!0,l())};return s.onContentChanged=p,s.onTitleChanged=p,s}),define("text!html/buttonPublish.html",[],function(){return'\r\n \r\n '}),define("extensions/buttonPublish",["jquery","underscore","text!html/buttonPublish.html"],function(e,t,n){function f(){if(i===undefined)return;o===!0||u===!1||a===!0?i.addClass("disabled"):i.removeClass("disabled")}var r={extensionId:"buttonPublish",extensionName:'Button "Publish"',settingsBloc:'Adds a "Publish document" button in the navigation bar.
'},i=undefined,s=undefined,o=!1,u=!1,a=!1,l=undefined;r.onPublisherCreated=function(e){l=e},r.onCreateButton=function(){return i=e(n).click(function(){e(this).hasClass("disabled")||l.publish()}),i},r.onPublishRunning=function(e){o=e,f()},r.onOfflineChanged=function(e){a=e,f()};var c=function(){t.size(s.publishLocations)===0?u=!1:u=!0,f()};return r.onFileSelected=function(e){s=e,c()},r.onPublishRemoved=c,r.onNewPublishSuccess=c,r}),define("text!html/buttonShare.html",[],function(){return'\r\n \r\n \r\n\r\n'}),define("text!html/buttonShareLocation.html",[],function(){return'\r\n'}),define("extensions/buttonShare",["jquery","underscore","text!html/buttonShare.html","text!html/buttonShareLocation.html"],function(e,t,n,r){var i={extensionId:"buttonShare",extensionName:'Button "Share"',optional:!0,settingsBloc:'Adds a "Share document" button in the navigation bar.
'};i.onCreateButton=function(){return e(n)};var s=undefined,o=function(n){if(n!==undefined&&n!==s)return;var i=e("#link-container .link-list").empty();e("#link-container .no-link").show();var o=t.values(s.publishLocations);t.each(o,function(n){if(n.sharingLink){var s=e(t.template(r,{link:n.sharingLink}));s.click(function(e){e.stopPropagation()}),i.append(s),e("#link-container .no-link").hide()}})};return i.onFileSelected=function(e){s=e,o(e)},i.onNewPublishSuccess=o,i.onPublishRemoved=o,i}),define("text!html/buttonStat.html",[],function(){return'\r\n \r\n \r\n\r\n'}),define("text!html/buttonStatSettingsBloc.html",[],function(){return'Adds a "Document\'s statistics" button in the navigation bar.
\r\n\r\n'}),define("extensions/buttonStat",["jquery","underscore","utils","text!html/buttonStat.html","text!html/buttonStatSettingsBloc.html"],function(e,t,n,r,i){var s={extensionId:"buttonStat",extensionName:'Button "Statistics"',optional:!0,defaultConfig:{name1:"Characters",value1:"\\S",name2:"Words",value2:"\\S+",name3:"Paragraphs",value3:"\\S.*"},settingsBloc:i};return s.onLoadSettings=function(){t.each([1,2,3],function(e){n.setInputValue("#input-stat-name"+e,s.config["name"+e]),n.setInputValue("#input-stat-value"+e,s.config["value"+e])})},s.onSaveSettings=function(e,r){t.each([1,2,3],function(t){e["name"+t]=n.getInputTextValue("#input-stat-name"+t,r),e["value"+t]=n.getInputRegExpValue("#input-stat-value"+t,r)})},s.onCreateButton=function(){return e(t.template(r,s.config))},s.onPreviewFinished=function(){var t=e("#wmd-preview").clone().find("script").remove().end().text();e("#span-stat-value1").text((t.match(new RegExp(s.config.value1,"g"))||[]).length),e("#span-stat-value2").text((t.match(new RegExp(s.config.value2,"g"))||[]).length),e("#span-stat-value3").text((t.match(new RegExp(s.config.value3,"g"))||[]).length)},s}),define("text!html/dialogAbout.html",[],function(){return'\r\n\r\n About: \r\n \r\n GitHub\r\n page / issue tracker \r\n \r\n \r\n Chrome\r\n app (thanks for your review!)\r\n \r\n \r\n Follow on\r\n Twitter \r\n \r\n \r\n Follow\r\n on Facebook \r\n \r\n \r\n Follow\r\n on Google+ \r\n \r\n \r\n\r\n Developers: \r\n \r\n Benoit\r\n Schweblin \r\n \r\n Pete Eigel (contributor)\r\n \r\n \r\n\r\n Credit: \r\n <% _.each(libraries, function(url, name) { %>\r\n \r\n <%= name %> \r\n \r\n <% }); %>\r\n \r\n\r\n Related projects: \r\n <% _.each(projects, function(url, name) { %>\r\n \r\n <%= name %> \r\n \r\n <% }); %>\r\n \r\nCopyright 2013 Benoit Schweblin \r\n Licensed under an Apache License
\r\n'}),define("extensions/dialogAbout",["jquery","underscore","text!html/dialogAbout.html"],function(e,t,n){var r={extensionId:"dialogAbout",extensionName:'Dialog "About"',settingsBloc:'Prints the content of the "About" dialog box.
'},i={Bootstrap:"http://twitter.github.io/bootstrap/","CSS Browser Selector":"https://github.com/rafaelp/css_browser_selector/","Dropbox-js":"https://github.com/dropbox/dropbox-js","FileSaver.js":"https://github.com/eligrey/FileSaver.js/",Gatekeeper:"https://github.com/prose/gatekeeper","Github.js":"https://github.com/michael/github",Glyphicons:"http://glyphicons.com/",jGrowl:"https://github.com/stanlemon/jGrowl/",jQuery:"http://jquery.com/","jQuery Mouse Wheel Plugin":"https://github.com/brandonaaron/jquery-mousewheel",Mousetrap:"http://craig.is/killing/mice",PageDown:"https://code.google.com/p/pagedown/","Pagedown-extra":"https://github.com/jmcmanus/pagedown-extra/",Prettify:"https://code.google.com/p/google-code-prettify/",RequireJS:"http://requirejs.org/","UI Layout":"http://layout.jquery-dev.net/","Underscore.js":"http://underscorejs.org/",waitForImages:"https://github.com/alexanderdickson/waitForImages"},s={"StackEdit Download Proxy":"https://github.com/benweet/stackedit-download-proxy","StackEdit SSH Proxy":"https://github.com/benweet/stackedit-ssh-proxy","StackEdit Tumblr Proxy":"https://github.com/benweet/stackedit-tumblr-proxy","StackEdit WordPress Proxy":"https://github.com/benweet/stackedit-wordpress-proxy"};return r.onReady=function(){e("#modal-about .modal-body").html(t.template(n,{libraries:i,projects:s}))},r}),define("text!html/dialogManagePublicationLocation.html",[],function(){return'\r\n \r\n \r\n
\r\n'}),define("extensions/dialogManagePublication",["jquery","underscore","text!html/dialogManagePublicationLocation.html"],function(e,t,n){var r={extensionId:"dialogManagePublication",extensionName:'Dialog "Manage publication"',settingsBloc:'Populates the "Manage publication" dialog box.
'},i=undefined;r.onFileMgrCreated=function(e){i=e};var s=undefined,o=' ',u=function(r){if(r!==undefined&&r!==s)return;var u=t.values(s.publishLocations);e(".msg-no-publish, .msg-publish-list").addClass("hide");var a=e("#manage-publish-list").empty();u.length>0?e(".msg-publish-list").removeClass("hide"):e(".msg-no-publish").removeClass("hide"),t.each(u,function(r){formattedAttributes=t.omit(r,"provider","publishIndex","sharingLink"),formattedAttributes.password&&(formattedAttributes.password="********");var s=JSON.stringify(formattedAttributes).replace(/{|}|"/g,"").replace(/,/g,", "),u=e(t.template(n,{provider:r.provider,publishDesc:s}));u.append(e(o).click(function(){i.removePublish(r)})),a.append(u)})};return r.onFileSelected=function(e){s=e,u(e)},r.onNewPublishSuccess=u,r.onPublishRemoved=u,r}),define("text!html/dialogManageSynchronizationLocation.html",[],function(){return'\r\n \r\n \r\n
\r\n'}),define("extensions/dialogManageSynchronization",["jquery","underscore","text!html/dialogManageSynchronizationLocation.html"],function(e,t,n){var r={extensionId:"dialogManageSynchronization",extensionName:'Dialog "Manage synchronization"',settingsBloc:'Populates the "Manage synchronization" dialog box.
'},i=undefined;r.onFileMgrCreated=function(e){i=e};var s=undefined,o=' ',u=function(r){if(r!==undefined&&r!==s)return;var u=t.values(s.syncLocations);e(".msg-no-sync, .msg-sync-list").addClass("hide");var a=e("#manage-sync-list").empty();u.length>0?e(".msg-sync-list").removeClass("hide"):e(".msg-no-sync").removeClass("hide"),t.each(u,function(r){var s=r.id||r.path,u=e(t.template(n,{provider:r.provider,syncDesc:s}));u.append(e(o).click(function(){i.removeSync(r)})),a.append(u)})};return r.onFileSelected=function(e){s=e,u(e)},r.onSyncExportSuccess=u,r.onSyncRemoved=u,r.onReady=function(){e(".sync-manual").each(function(){var t=e(this);t.find("input").keyup(function(e){e.which==13&&(t.find("a").click(),e.stopPropagation())})})},r}),function(){function h(e,t,n){if(e.addEventListener){e.addEventListener(t,n,!1);return}e.attachEvent("on"+t,n)}function p(n){if(n.type=="keypress"){var r=String.fromCharCode(n.which);return n.shiftKey||(r=r.toLowerCase()),r}return e[n.which]?e[n.which]:t[n.which]?t[n.which]:String.fromCharCode(n.which).toLowerCase()}function d(e,t){return e.sort().join(",")===t.sort().join(",")}function v(e){e=e||{};var t=!1,n;for(n in u){if(e[n]){t=!0;continue}u[n]=0}t||(l=!1)}function m(e,t,n,r,i,o){var a,f,l=[],c=n.type;if(!s[e])return[];c=="keyup"&&E(e)&&(t=[e]);for(a=0;a95&&t<112)continue;e.hasOwnProperty(t)&&(i[e[t]]=t)}}return i}function T(e,t,n){return n||(n=x()[e]?"keydown":"keypress"),n=="keypress"&&t.length&&(n="keydown"),n}function N(e,t,n,r){function i(t){return function(){l=t,++u[e],S()}}function s(t){y(n,t,e),r!=="keyup"&&(f=p(t)),setTimeout(v,10)}u[e]=0;for(var o=0;o1){N(e,u,t,n);return}a=k(e,n),s[a.key]=s[a.key]||[],m(a.key,a.modifiers,{type:a.action},r,e,i),s[a.key][r?"unshift":"push"]({callback:t,modifiers:a.modifiers,action:a.action,seq:r,level:i,combo:e})}function A(e,t,n){for(var r=0;r":".","?":"/","|":"\\"},r={option:"alt",command:"meta","return":"enter",escape:"esc",mod:/Mac|iPod|iPhone|iPad/.test(navigator.platform)?"meta":"ctrl"},i,s={},o={},u={},a,f=!1,l=!1;for(var c=1;c<20;++c)e[111+c]="f"+c;for(c=0;c<=9;++c)e[c+96]=c;h(document,"keypress",w),h(document,"keydown",w),h(document,"keyup",w);var O={bind:function(e,t,n){return e=e instanceof Array?e:[e],A(e,t,n),this},unbind:function(e,t){return O.bind(e,function(){},t)},trigger:function(e,t){return o[e+":"+t]&&o[e+":"+t]({},e),this},reset:function(){return s={},o={},this},stopCallback:function(e,t){return(" "+t.className+" ").indexOf(" mousetrap ")>-1?!1:t.tagName=="INPUT"||t.tagName=="SELECT"||t.tagName=="TEXTAREA"||t.contentEditable&&t.contentEditable=="true"},handleKey:b};window.Mousetrap=O,typeof define=="function"&&define.amd&&define("mousetrap",O)}(),define("fileSystem",{}),define("text!html/documentSelectorSettingsBloc.html",[],function(){return'Builds the "Open document" dropdown menu.
\r\n'}),define("extensions/documentSelector",["jquery","underscore","utils","mousetrap","fileSystem","text!html/documentSelectorSettingsBloc.html"],function(e,t,n,r,i,s){function p(n){var r=e("#file-selector li:not(.stick)");r.show();if(n){var i=n.toLowerCase().split(/\s+/);r.each(function(){var n=e(this).text().toLowerCase();t.some(i,function(e){return n.indexOf(e)===-1})&&e(this).hide()})}}var o={extensionId:"documentSelector",extensionName:"Document Selector",defaultConfig:{orderBy:"title",shortcutPrevious:"Ctrl+[",shortcutNext:"Ctrl+]"},settingsBloc:s};o.onLoadSettings=function(){n.setInputValue("#select-document-selector-orderby",o.config.sortBy),n.setInputValue("#input-document-selector-shortcut-previous",o.config.shortcutPrevious),n.setInputValue("#input-document-selector-shortcut-next",o.config.shortcutNext)},o.onSaveSettings=function(e,t){e.orderBy=n.getInputValue("#select-document-selector-orderby"),e.shortcutPrevious=n.getInputTextValue("#input-document-selector-shortcut-previous",t),e.shortcutNext=n.getInputTextValue("#input-document-selector-shortcut-next",t)};var u=undefined;o.onFileMgrCreated=function(e){u=e};var a=undefined,f=undefined,l=undefined,c=function(){function n(e){var n=[],r=t.values(e.syncLocations),i=t.values(e.publishLocations),s=r.concat(i);return t.chain(s).sortBy(function(e){return e.provider.providerId}).each(function(e){n.push(' ')}),n.push(" "),n.push(e.title),n.join("")}a={},e("#file-selector li:not(.stick)").empty(),t.chain(i).sortBy(l).each(function(t){var r=e('').html(n(t)).click(function(){a[t.fileIndex].is(".disabled")?e("#wmd-input").focus():u.selectFile(t)}),i=e("").append(r);a[t.fileIndex]=i,e("#file-selector").append(i)}),f=t.values(a)},h=undefined;return o.onFileSelected=function(t){h=t,c(),e("#file-selector li:not(.stick)").removeClass("disabled");var n=a[t.fileIndex];if(n===undefined)return;n.addClass("disabled")},o.onFileCreated=c,o.onFileDeleted=c,o.onTitleChanged=c,o.onSyncExportSuccess=c,o.onSyncRemoved=c,o.onNewPublishSuccess=c,o.onPublishRemoved=c,o.onReady=function(){o.config.orderBy=="title"?l=function(e){return e.title.toLowerCase()}:o.config.orderBy=="mru"&&(l=function(e){return-e.selectTime});var n=undefined;e(".action-open-file").click(function(){if(e("#file-selector").parent().is(".open"))return;p();if(n!==undefined)return;t.defer(function(){e("#file-search").val("").focus()})}).prop("title",t.template("<%= title %> <%= shortcutPrevious %> <%= shortcutNext %>",{title:e(".action-open-file").prop("title"),shortcutPrevious:o.config.shortcutPrevious,shortcutNext:o.config.shortcutNext})),e("#file-search").keyup(function(t){t.which==13||t.which==27?e(this).parent().click():p(e(this).val())}).click(function(e){e.stopPropagation()}),r.bind(o.config.shortcutPrevious.toLowerCase(),function(){n===undefined&&(e("#file-selector").parent().is(".open")||e(".action-open-file").click(),n=a[h.fileIndex]);var r=t.indexOf(f,n)-1;return r===-2&&(r=-1),n=f[(r+f.length)%f.length],t.defer(function(){n.find("a").focus()}),!1}),r.bind(o.config.shortcutNext.toLowerCase(),function(){n===undefined&&(e("#file-selector").parent().is(".open")||e(".action-open-file").click(),n=a[h.fileIndex]);var r=t.indexOf(f,n)+1;return n=f[r%f.length],t.defer(function(){n.find("a").focus()}),!1}),r.bind("ctrl",function(){n!==undefined&&(n.find("a").click(),n=undefined)},"keyup")},o}),define("extensions/documentTitle",["jquery","underscore"],function(e,t){var n={extensionId:"documentTitle",extensionName:"Document Title",settingsBloc:"Responsible for showing the document title in the navigation bar.
"},r=undefined;n.onLayoutCreated=function(e){r=e};var i=undefined,s=function(n){function s(e){var n=[],r=t.values(e.syncLocations),i=t.values(e.publishLocations),s=r.concat(i);return t.chain(s).sortBy(function(e){return e.provider.providerId}).each(function(e){n.push(' ')}),n.push(" "),n.push(e.title),n.join("")}if(n!==i)return;var o=i.title;document.title="StackEdit - "+o,e("#file-title").html(s(i)),e(".file-title").text(o),e("#file-title-input").val(o),r!==undefined&&t.defer(r.resizeAll)};return n.onFileSelected=function(e){i=e,s(e)},n.onTitleChanged=s,n.onSyncExportSuccess=s,n.onSyncRemoved=s,n.onNewPublishSuccess=s,n.onPublishRemoved=s,n}),define("extensions/workingIndicator",["jquery","underscore"],function(e,t){var n={extensionId:"workingIndicator",extensionName:"Working Indicator",settingsBloc:"Displays an animated image when a network operation is running.
"};return n.onAsyncRunning=function(t){t===!1?(e(".working-indicator").removeClass("show"),e("body").removeClass("working")):(e(".working-indicator").addClass("show"),e("body").addClass("working"))},n}),function(e){var t=function(){return!1===e.support.boxModel&&e.support.objectAll&&e.support.leadingWhitespace}();e.jGrowl=function(t,n){e("#jGrowl").size()==0&&e('
').addClass(n&&n.position?n.position:e.jGrowl.defaults.position).appendTo("body"),e("#jGrowl").jGrowl(t,n)},e.fn.jGrowl=function(t,n){if(e.isFunction(this.each)){var r=arguments;return this.each(function(){var i=this;e(this).data("jGrowl.instance")==undefined&&(e(this).data("jGrowl.instance",e.extend(new e.fn.jGrowl,{notifications:[],element:null,interval:null})),e(this).data("jGrowl.instance").startup(this)),e.isFunction(e(this).data("jGrowl.instance")[t])?e(this).data("jGrowl.instance")[t].apply(e(this).data("jGrowl.instance"),e.makeArray(r).slice(1)):e(this).data("jGrowl.instance").create(t,n)})}},e.extend(e.fn.jGrowl.prototype,{defaults:{pool:0,header:"",group:"",sticky:!1,position:"top-right",glue:"after",theme:"default",themeState:"highlight",corners:"10px",check:250,life:3e3,closeDuration:"normal",openDuration:"normal",easing:"swing",closer:!0,closeTemplate:"×",closerTemplate:"[ close all ]
",log:function(e,t,n){},beforeOpen:function(e,t,n){},afterOpen:function(e,t,n){},open:function(e,t,n){},beforeClose:function(e,t,n){},close:function(e,t,n){},animateOpen:{opacity:"show"},animateClose:{opacity:"hide"}},notifications:[],element:null,interval:null,create:function(t,n){var n=e.extend({},this.defaults,n);typeof n.speed!="undefined"&&(n.openDuration=n.speed,n.closeDuration=n.speed),this.notifications.push({message:t,options:n}),n.log.apply(this.element,[this.element,t,n])},render:function(t){var n=this,r=t.message,i=t.options;i.themeState=i.themeState==""?"":"ui-state-"+i.themeState;var t=e("
").addClass("jGrowl-notification "+i.themeState+" ui-corner-all"+(i.group!=undefined&&i.group!=""?" "+i.group:"")).append(e("
").addClass("jGrowl-close").html(i.closeTemplate)).append(e("
").addClass("jGrowl-header").html(i.header)).append(e("
").addClass("jGrowl-message").html(r)).data("jGrowl",i).addClass(i.theme).children("div.jGrowl-close").bind("click.jGrowl",function(){e(this).parent().trigger("jGrowl.beforeClose")}).parent();e(t).bind("mouseover.jGrowl",function(){e("div.jGrowl-notification",n.element).data("jGrowl.pause",!0)}).bind("mouseout.jGrowl",function(){e("div.jGrowl-notification",n.element).data("jGrowl.pause",!1)}).bind("jGrowl.beforeOpen",function(){i.beforeOpen.apply(t,[t,r,i,n.element])!=0&&e(this).trigger("jGrowl.open")}).bind("jGrowl.open",function(){i.open.apply(t,[t,r,i,n.element])!=0&&(i.glue=="after"?e("div.jGrowl-notification:last",n.element).after(t):e("div.jGrowl-notification:first",n.element).before(t),e(this).animate(i.animateOpen,i.openDuration,i.easing,function(){e.support.opacity===!1&&this.style.removeAttribute("filter"),e(this).data("jGrowl")!=null&&(e(this).data("jGrowl").created=new Date),e(this).trigger("jGrowl.afterOpen")}))}).bind("jGrowl.afterOpen",function(){i.afterOpen.apply(t,[t,r,i,n.element])}).bind("jGrowl.beforeClose",function(){i.beforeClose.apply(t,[t,r,i,n.element])!=0&&e(this).trigger("jGrowl.close")}).bind("jGrowl.close",function(){e(this).data("jGrowl.pause",!0),e(this).animate(i.animateClose,i.closeDuration,i.easing,function(){e.isFunction(i.close)?i.close.apply(t,[t,r,i,n.element])!==!1&&e(this).remove():e(this).remove()})}).trigger("jGrowl.beforeOpen"),i.corners!=""&&e.fn.corner!=undefined&&e(t).corner(i.corners),e("div.jGrowl-notification:parent",n.element).size()>1&&e("div.jGrowl-closer",n.element).size()==0&&this.defaults.closer!=0&&e(this.defaults.closerTemplate).addClass("jGrowl-closer "+this.defaults.themeState+" ui-corner-all").addClass(this.defaults.theme).appendTo(n.element).animate(this.defaults.animateOpen,this.defaults.speed,this.defaults.easing).bind("click.jGrowl",function(){e(this).siblings().trigger("jGrowl.beforeClose"),e.isFunction(n.defaults.closer)&&n.defaults.closer.apply(e(this).parent()[0],[e(this).parent()[0]])})},update:function(){e(this.element).find("div.jGrowl-notification:parent").each(function(){e(this).data("jGrowl")!=undefined&&e(this).data("jGrowl").created!=undefined&&e(this).data("jGrowl").created.getTime()+parseInt(e(this).data("jGrowl").life)<(new Date).getTime()&&e(this).data("jGrowl").sticky!=1&&(e(this).data("jGrowl.pause")==undefined||e(this).data("jGrowl.pause")!=1)&&e(this).trigger("jGrowl.beforeClose")}),this.notifications.length>0&&(this.defaults.pool==0||e(this.element).find("div.jGrowl-notification:parent").size() '),this.interval=setInterval(function(){e(n).data("jGrowl.instance").update()},parseInt(this.defaults.check)),t&&e(this.element).addClass("ie6")},shutdown:function(){e(this.element).removeClass("jGrowl").find("div.jGrowl-notification").trigger("jGrowl.close").parent().empty()},close:function(){e(this.element).find("div.jGrowl-notification").each(function(){e(this).trigger("jGrowl.beforeClose")})}}),e.jGrowl.defaults=e.fn.jGrowl.prototype.defaults}(jQuery),define("jgrowl",["jquery"],function(e){return function(){var t,n;return t||e.jQuery.jGrowl}}(this)),define("text!html/notificationsSettingsBloc.html",[],function(){return'