From b7b63b843c1e82cf4f7c666914b6ba4c51e2f5d1 Mon Sep 17 00:00:00 2001 From: benweet Date: Sun, 14 Apr 2013 22:15:40 +0100 Subject: [PATCH] Support for template --- cache.manifest | 2 +- css/main.css | 7 +++- index.html | 4 +- js/file-manager.js | 12 +++--- js/github-provider.js | 6 +-- js/main-min.js | 10 ++--- js/publisher.js | 89 ++++++++++++++++++++++++++++--------------- test.html | 58 ---------------------------- 8 files changed, 80 insertions(+), 108 deletions(-) delete mode 100644 test.html diff --git a/cache.manifest b/cache.manifest index 3bd7ee3c..d42103f8 100644 --- a/cache.manifest +++ b/cache.manifest @@ -1 +1 @@ -CACHE MANIFEST # v35 CACHE: index.html css/bootstrap.css css/jgrowl.css css/main.css js/main-min.js js/require.js NETWORK: * +CACHE MANIFEST # v36 CACHE: index.html css/bootstrap.css css/jgrowl.css css/main.css js/main-min.js js/require.js NETWORK: * diff --git a/css/main.css b/css/main.css index a46e102c..a1915153 100644 --- a/css/main.css +++ b/css/main.css @@ -329,6 +329,9 @@ hr { } #modal-settings textarea { - max-width: 206px; - height: 150px; + height: 180px; +} + +.tooltip-inner { + text-align: left; } diff --git a/index.html b/index.html index 51d52063..a7c9f86d 100644 --- a/index.html +++ b/index.html @@ -488,10 +488,10 @@ RequireJS
- Underscore.js + UI Layout
- UI Layout + Underscore.js

Copyright 2013 http://underscorejs.org +// > (c) 2009-2013 Jeremy Ashkenas, DocumentCloud Inc. +// > Underscore may be freely distributed under the MIT license. + /* =================================================== * bootstrap-transition.js v2.3.0 * http://twitter.github.com/bootstrap/javascript.html#transitions @@ -477,8 +481,4 @@ * TODO: Add hotkey/mousewheel bindings to _instantly_ respond to these zoom event */ -// > http://underscorejs.org -// > (c) 2009-2013 Jeremy Ashkenas, DocumentCloud Inc. -// > Underscore may be freely distributed under the MIT license. - -function runDelayedFunction(){delayedFunction!==undefined&&delayedFunction()}(function(e,t){function P(e){var t=e.length,n=b.type(e);return b.isWindow(e)?!1:e.nodeType===1&&t?!0:n==="array"||n!=="function"&&(t===0||typeof t=="number"&&t>0&&t-1 in e)}function B(e){var t=H[e]={};return b.each(e.match(E)||[],function(e,n){t[n]=!0}),t}function I(e,n,r,i){if(!b.acceptData(e))return;var s,o,u=b.expando,a=typeof n=="string",f=e.nodeType,c=f?b.cache:e,h=f?e[u]:e[u]&&u;if((!h||!c[h]||!i&&!c[h].data)&&a&&r===t)return;h||(f?e[u]=h=l.pop()||b.guid++:h=u),c[h]||(c[h]={},f||(c[h].toJSON=b.noop));if(typeof n=="object"||typeof n=="function")i?c[h]=b.extend(c[h],n):c[h].data=b.extend(c[h].data,n);return s=c[h],i||(s.data||(s.data={}),s=s.data),r!==t&&(s[b.camelCase(n)]=r),a?(o=s[n],o==null&&(o=s[b.camelCase(n)])):o=s,o}function q(e,t,n){if(!b.acceptData(e))return;var r,i,s,o=e.nodeType,u=o?b.cache:e,a=o?e[b.expando]:b.expando;if(!u[a])return;if(t){s=n?u[a]:u[a].data;if(s){b.isArray(t)?t=t.concat(b.map(t,b.camelCase)):t in s?t=[t]:(t=b.camelCase(t),t in s?t=[t]:t=t.split(" "));for(r=0,i=t.length;r=0===n})}function pt(e){var t=dt.split("|"),n=e.createDocumentFragment();if(n.createElement)while(t.length)n.createElement(t.pop());return n}function Mt(e,t){return e.getElementsByTagName(t)[0]||e.appendChild(e.ownerDocument.createElement(t))}function _t(e){var t=e.getAttributeNode("type");return e.type=(t&&t.specified)+"/"+e.type,e}function Dt(e){var t=Ct.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function Pt(e,t){var n,r=0;for(;(n=e[r])!=null;r++)b._data(n,"globalEval",!t||b._data(t[r],"globalEval"))}function Ht(e,t){if(t.nodeType!==1||!b.hasData(e))return;var n,r,i,s=b._data(e),o=b._data(t,s),u=s.events;if(u){delete o.handle,o.events={};for(n in u)for(r=0,i=u[n].length;r").css("cssText","display:block !important")).appendTo(t.documentElement),t=(It[0].contentWindow||It[0].contentDocument).document,t.write(""),t.close(),n=fn(e,t),It.detach();Qt[e]=n}return n}function fn(e,t){var n=b(t.createElement(e)).appendTo(t.body),r=b.css(n[0],"display");return n.remove(),r}function vn(e,t,n,r){var i;if(b.isArray(t))b.each(t,function(t,i){n||cn.test(e)?r(e,i):vn(e+"["+(typeof i=="object"?t:"")+"]",i,n,r)});else if(!n&&b.type(t)==="object")for(i in t)vn(e+"["+i+"]",t[i],n,r);else r(e,t)}function _n(e){return function(t,n){typeof t!="string"&&(n=t,t="*");var r,i=0,s=t.toLowerCase().match(E)||[];if(b.isFunction(n))while(r=s[i++])r[0]==="+"?(r=r.slice(1)||"*",(e[r]=e[r]||[]).unshift(n)):(e[r]=e[r]||[]).push(n)}}function Dn(e,t,n,r){function o(u){var a;return i[u]=!0,b.each(e[u]||[],function(e,u){var f=u(t,n,r);if(typeof f=="string"&&!s&&!i[f])return t.dataTypes.unshift(f),o(f),!1;if(s)return!(a=f)}),a}var i={},s=e===An;return o(t.dataTypes[0])||!i["*"]&&o("*")}function Pn(e,n){var r,i,s=b.ajaxSettings.flatOptions||{};for(i in n)n[i]!==t&&((s[i]?e:r||(r={}))[i]=n[i]);return r&&b.extend(!0,e,r),e}function Hn(e,n,r){var i,s,o,u,a=e.contents,f=e.dataTypes,l=e.responseFields;for(u in l)u in r&&(n[l[u]]=r[u]);while(f[0]==="*")f.shift(),s===t&&(s=e.mimeType||n.getResponseHeader("Content-Type"));if(s)for(u in a)if(a[u]&&a[u].test(s)){f.unshift(u);break}if(f[0]in r)o=f[0];else{for(u in r){if(!f[0]||e.converters[u+" "+f[0]]){o=u;break}i||(i=u)}o=o||i}if(o)return o!==f[0]&&f.unshift(o),r[o]}function Bn(e,t){var n,r,i,s,o={},u=0,a=e.dataTypes.slice(),f=a[0];e.dataFilter&&(t=e.dataFilter(t,e.dataType));if(a[1])for(i in e.converters)o[i.toLowerCase()]=e.converters[i];for(;r=a[++u];)if(r!=="*"){if(f!=="*"&&f!==r){i=o[f+" "+r]||o["* "+r];if(!i)for(n in o){s=n.split(" ");if(s[1]===r){i=o[f+" "+s[0]]||o["* "+s[0]];if(i){i===!0?i=o[n]:o[n]!==!0&&(r=s[0],a.splice(u--,0,r));break}}}if(i!==!0)if(i&&e["throws"])t=i(t);else try{t=i(t)}catch(l){return{state:"parsererror",error:i?l:"No conversion from "+f+" to "+r}}}f=r}return{state:"success",data:t}}function zn(){try{return new e.XMLHttpRequest}catch(t){}}function Wn(){try{return new e.ActiveXObject("Microsoft.XMLHTTP")}catch(t){}}function Yn(){return setTimeout(function(){Xn=t}),Xn=b.now()}function Zn(e,t){b.each(t,function(t,n){var r=(Gn[t]||[]).concat(Gn["*"]),i=0,s=r.length;for(;i)[^>]*|#([\w-]*))$/,T=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,N=/^[\],:{}\s]*$/,C=/(?:^|:|,)(?:\s*\[)+/g,k=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,L=/"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g,A=/^-ms-/,O=/-([\da-z])/gi,M=function(e,t){return t.toUpperCase()},_=function(e){if(s.addEventListener||e.type==="load"||s.readyState==="complete")D(),b.ready()},D=function(){s.addEventListener?(s.removeEventListener("DOMContentLoaded",_,!1),e.removeEventListener("load",_,!1)):(s.detachEvent("onreadystatechange",_),e.detachEvent("onload",_))};b.fn=b.prototype={jquery:c,constructor:b,init:function(e,n,r){var i,o;if(!e)return this;if(typeof e=="string"){e.charAt(0)==="<"&&e.charAt(e.length-1)===">"&&e.length>=3?i=[null,e,null]:i=x.exec(e);if(i&&(i[1]||!n)){if(i[1]){n=n instanceof b?n[0]:n,b.merge(this,b.parseHTML(i[1],n&&n.nodeType?n.ownerDocument||n:s,!0));if(T.test(i[1])&&b.isPlainObject(n))for(i in n)b.isFunction(this[i])?this[i](n[i]):this.attr(i,n[i]);return this}o=s.getElementById(i[2]);if(o&&o.parentNode){if(o.id!==i[2])return r.find(e);this.length=1,this[0]=o}return this.context=s,this.selector=e,this}return!n||n.jquery?(n||r).find(e):this.constructor(n).find(e)}return e.nodeType?(this.context=this[0]=e,this.length=1,this):b.isFunction(e)?r.ready(e):(e.selector!==t&&(this.selector=e.selector,this.context=e.context),b.makeArray(e,this))},selector:"",length:0,size:function(){return this.length},toArray:function(){return d.call(this)},get:function(e){return e==null?this.toArray():e<0?this[this.length+e]:this[e]},pushStack:function(e){var t=b.merge(this.constructor(),e);return t.prevObject=this,t.context=this.context,t},each:function(e,t){return b.each(this,e,t)},ready:function(e){return b.ready.promise().done(e),this},slice:function(){return this.pushStack(d.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(n>=0&&n0)return;n.resolveWith(s,[b]),b.fn.trigger&&b(s).trigger("ready").off("ready")},isFunction:function(e){return b.type(e)==="function"},isArray:Array.isArray||function(e){return b.type(e)==="array"},isWindow:function(e){return e!=null&&e==e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return e==null?String(e):typeof e=="object"||typeof e=="function"?f[m.call(e)]||"object":typeof e},isPlainObject:function(e){if(!e||b.type(e)!=="object"||e.nodeType||b.isWindow(e))return!1;try{if(e.constructor&&!g.call(e,"constructor")&&!g.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(n){return!1}var r;for(r in e);return r===t||g.call(e,r)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},error:function(e){throw new Error(e)},parseHTML:function(e,t,n){if(!e||typeof e!="string")return null;typeof t=="boolean"&&(n=t,t=!1),t=t||s;var r=T.exec(e),i=!n&&[];return r?[t.createElement(r[1])]:(r=b.buildFragment([e],t,i),i&&b(i).remove(),b.merge([],r.childNodes))},parseJSON:function(t){if(e.JSON&&e.JSON.parse)return e.JSON.parse(t);if(t===null)return t;if(typeof t=="string"){t=b.trim(t);if(t&&N.test(t.replace(k,"@").replace(L,"]").replace(C,"")))return(new Function("return "+t))()}b.error("Invalid JSON: "+t)},parseXML:function(n){var r,i;if(!n||typeof n!="string")return null;try{e.DOMParser?(i=new DOMParser,r=i.parseFromString(n,"text/xml")):(r=new ActiveXObject("Microsoft.XMLDOM"),r.async="false",r.loadXML(n))}catch(s){r=t}return(!r||!r.documentElement||r.getElementsByTagName("parsererror").length)&&b.error("Invalid XML: "+n),r},noop:function(){},globalEval:function(t){t&&b.trim(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(A,"ms-").replace(O,M)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,t,n){var r,i=0,s=e.length,o=P(e);if(n)if(o)for(;i-1)a.splice(r,1),n&&(r<=s&&s--,r<=o&&o--)}),this},has:function(e){return e?b.inArray(e,a)>-1:!!a&&!!a.length},empty:function(){return a=[],this},disable:function(){return a=f=r=t,this},disabled:function(){return!a},lock:function(){return f=t,r||c.disable(),this},locked:function(){return!f},fireWith:function(e,t){return t=t||[],t=[e,t.slice?t.slice():t],a&&(!i||f)&&(n?f.push(t):l(t)),this},fire:function(){return c.fireWith(this,arguments),this},fired:function(){return!!i}};return c},b.extend({Deferred:function(e){var t=[["resolve","done",b.Callbacks("once memory"),"resolved"],["reject","fail",b.Callbacks("once memory"),"rejected"],["notify","progress",b.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return b.Deferred(function(n){b.each(t,function(t,s){var o=s[0],u=b.isFunction(e[t])&&e[t];i[s[1]](function(){var e=u&&u.apply(this,arguments);e&&b.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[o+"With"](this===r?n.promise():this,u?[e]:arguments)})}),e=null}).promise()},promise:function(e){return e!=null?b.extend(e,r):r}},i={};return r.pipe=r.then,b.each(t,function(e,s){var o=s[2],u=s[3];r[s[1]]=o.add,u&&o.add(function(){n=u},t[e^1][2].disable,t[2][2].lock),i[s[0]]=function(){return i[s[0]+"With"](this===i?r:this,arguments),this},i[s[0]+"With"]=o.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t=0,n=d.call(arguments),r=n.length,i=r!==1||e&&b.isFunction(e.promise)?r:0,s=i===1?e:b.Deferred(),o=function(e,t,n){return function(r){t[e]=this,n[e]=arguments.length>1?d.call(arguments):r,n===u?s.notifyWith(t,n):--i||s.resolveWith(t,n)}},u,a,f;if(r>1){u=new Array(r),a=new Array(r),f=new Array(r);for(;t
a",n=p.getElementsByTagName("*"),r=p.getElementsByTagName("a")[0];if(!n||!r||!n.length)return{};u=s.createElement("select"),f=u.appendChild(s.createElement("option")),o=p.getElementsByTagName("input")[0],r.style.cssText="top:1px;float:left;opacity:.5",t={getSetAttribute:p.className!=="t",leadingWhitespace:p.firstChild.nodeType===3,tbody:!p.getElementsByTagName("tbody").length,htmlSerialize:!!p.getElementsByTagName("link").length,style:/top/.test(r.getAttribute("style")),hrefNormalized:r.getAttribute("href")==="/a",opacity:/^0.5/.test(r.style.opacity),cssFloat:!!r.style.cssFloat,checkOn:!!o.value,optSelected:f.selected,enctype:!!s.createElement("form").enctype,html5Clone:s.createElement("nav").cloneNode(!0).outerHTML!=="<:nav>",boxModel:s.compatMode==="CSS1Compat",deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,boxSizingReliable:!0,pixelPosition:!1},o.checked=!0,t.noCloneChecked=o.cloneNode(!0).checked,u.disabled=!0,t.optDisabled=!f.disabled;try{delete p.test}catch(d){t.deleteExpando=!1}o=s.createElement("input"),o.setAttribute("value",""),t.input=o.getAttribute("value")==="",o.value="t",o.setAttribute("type","radio"),t.radioValue=o.value==="t",o.setAttribute("checked","t"),o.setAttribute("name","t"),a=s.createDocumentFragment(),a.appendChild(o),t.appendChecked=o.checked,t.checkClone=a.cloneNode(!0).cloneNode(!0).lastChild.checked,p.attachEvent&&(p.attachEvent("onclick",function(){t.noCloneEvent=!1}),p.cloneNode(!0).click());for(h in{submit:!0,change:!0,focusin:!0})p.setAttribute(l="on"+h,"t"),t[h+"Bubbles"]=l in e||p.attributes[l].expando===!1;return p.style.backgroundClip="content-box",p.cloneNode(!0).style.backgroundClip="",t.clearCloneStyle=p.style.backgroundClip==="content-box",b(function(){var n,r,o,u="padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;",a=s.getElementsByTagName("body")[0];if(!a)return;n=s.createElement("div"),n.style.cssText="border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px",a.appendChild(n).appendChild(p),p.innerHTML="
t
",o=p.getElementsByTagName("td"),o[0].style.cssText="padding:0;margin:0;border:0;display:none",c=o[0].offsetHeight===0,o[0].style.display="",o[1].style.display="none",t.reliableHiddenOffsets=c&&o[0].offsetHeight===0,p.innerHTML="",p.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",t.boxSizing=p.offsetWidth===4,t.doesNotIncludeMarginInBodyOffset=a.offsetTop!==1,e.getComputedStyle&&(t.pixelPosition=(e.getComputedStyle(p,null)||{}).top!=="1%",t.boxSizingReliable=(e.getComputedStyle(p,null)||{width:"4px"}).width==="4px",r=p.appendChild(s.createElement("div")),r.style.cssText=p.style.cssText=u,r.style.marginRight=r.style.width="0",p.style.width="1px",t.reliableMarginRight=!parseFloat((e.getComputedStyle(r,null)||{}).marginRight)),typeof p.style.zoom!==i&&(p.innerHTML="",p.style.cssText=u+"width:1px;padding:1px;display:inline;zoom:1",t.inlineBlockNeedsLayout=p.offsetWidth===3,p.style.display="block",p.innerHTML="

",p.firstChild.style.width="5px",t.shrinkWrapBlocks=p.offsetWidth!==3,t.inlineBlockNeedsLayout&&(a.style.zoom=1)),a.removeChild(n),n=p=o=r=null}),n=u=a=f=r=o=null,t}();var j=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,F=/([A-Z])/g;b.extend({cache:{},expando:"jQuery"+(c+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(e){return e=e.nodeType?b.cache[e[b.expando]]:e[b.expando],!!e&&!U(e)},data:function(e,t,n){return I(e,t,n)},removeData:function(e,t){return q(e,t)},_data:function(e,t,n){return I(e,t,n,!0)},_removeData:function(e,t){return q(e,t,!0)},acceptData:function(e){if(e.nodeType&&e.nodeType!==1&&e.nodeType!==9)return!1;var t=e.nodeName&&b.noData[e.nodeName.toLowerCase()];return!t||t!==!0&&e.getAttribute("classid")===t}}),b.fn.extend({data:function(e,n){var r,i,s=this[0],o=0,u=null;if(e===t){if(this.length){u=b.data(s);if(s.nodeType===1&&!b._data(s,"parsedAttrs")){r=s.attributes;for(;o1,null,!0)},removeData:function(e){return this.each(function(){b.removeData(this,e)})}}),b.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=b._data(e,t),n&&(!r||b.isArray(n)?r=b._data(e,t,b.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=b.queue(e,t),r=n.length,i=n.shift(),s=b._queueHooks(e,t),o=function(){b.dequeue(e,t)};i==="inprogress"&&(i=n.shift(),r--),s.cur=i,i&&(t==="fx"&&n.unshift("inprogress"),delete s.stop,i.call(e,o,s)),!r&&s&&s.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return b._data(e,n)||b._data(e,n,{empty:b.Callbacks("once memory").add(function(){b._removeData(e,t+"queue"),b._removeData(e,n)})})}}),b.fn.extend({queue:function(e,n){var r=2;return typeof e!="string"&&(n=e,e="fx",r--),arguments.length1)},removeAttr:function(e){return this.each(function(){b.removeAttr(this,e)})},prop:function(e,t){return b.access(this,b.prop,e,t,arguments.length>1)},removeProp:function(e){return e=b.propFix[e]||e,this.each(function(){try{this[e]=t,delete this[e]}catch(n){}})},addClass:function(e){var t,n,r,i,s,o=0,u=this.length,a=typeof e=="string"&&e;if(b.isFunction(e))return this.each(function(t){b(this).addClass(e.call(this,t,this.className))});if(a){t=(e||"").match(E)||[];for(;o=0)r=r.replace(" "+i+" "," ");n.className=e?b.trim(r):""}}}return this},toggleClass:function(e,t){var n=typeof e,r=typeof t=="boolean";return b.isFunction(e)?this.each(function(n){b(this).toggleClass(e.call(this,n,this.className,t),t)}):this.each(function(){if(n==="string"){var s,o=0,u=b(this),a=t,f=e.match(E)||[];while(s=f[o++])a=r?a:!u.hasClass(s),u[a?"addClass":"removeClass"](s)}else if(n===i||n==="boolean")this.className&&b._data(this,"__className__",this.className),this.className=this.className||e===!1?"":b._data(this,"__className__")||""})},hasClass:function(e){var t=" "+e+" ",n=0,r=this.length;for(;n=0)return!0;return!1},val:function(e){var n,r,i,s=this[0];if(!arguments.length){if(s)return r=b.valHooks[s.type]||b.valHooks[s.nodeName.toLowerCase()],r&&"get"in r&&(n=r.get(s,"value"))!==t?n:(n=s.value,typeof n=="string"?n.replace(V,""):n==null?"":n);return}return i=b.isFunction(e),this.each(function(n){var s,o=b(this);if(this.nodeType!==1)return;i?s=e.call(this,n,o.val()):s=e,s==null?s="":typeof s=="number"?s+="":b.isArray(s)&&(s=b.map(s,function(e){return e==null?"":e+""})),r=b.valHooks[this.type]||b.valHooks[this.nodeName.toLowerCase()];if(!r||!("set"in r)||r.set(this,s,"value")===t)this.value=s})}}),b.extend({valHooks:{option:{get:function(e){var t=e.attributes.value;return!t||t.specified?e.value:e.text}},select:{get:function(e){var t,n,r=e.options,i=e.selectedIndex,s=e.type==="select-one"||i<0,o=s?null:[],u=s?i+1:r.length,a=i<0?u:s?i:0;for(;a=0}),n.length||(e.selectedIndex=-1),n}}},attr:function(e,n,r){var s,o,u,a=e.nodeType;if(!e||a===3||a===8||a===2)return;if(typeof e.getAttribute===i)return b.prop(e,n,r);o=a!==1||!b.isXMLDoc(e),o&&(n=n.toLowerCase(),s=b.attrHooks[n]||(K.test(n)?W:z));if(r===t)return s&&o&&"get"in s&&(u=s.get(e,n))!==null?u:(typeof e.getAttribute!==i&&(u=e.getAttribute(n)),u==null?t:u);if(r!==null)return s&&o&&"set"in s&&(u=s.set(e,r,n))!==t?u:(e.setAttribute(n,r+""),r);b.removeAttr(e,n)},removeAttr:function(e,t){var n,r,i=0,s=t&&t.match(E);if(s&&e.nodeType===1)while(n=s[i++])r=b.propFix[n]||n,K.test(n)?!G&&Q.test(n)?e[b.camelCase("default-"+n)]=e[r]=!1:e[r]=!1:b.attr(e,n,""),e.removeAttribute(G?n:r)},attrHooks:{type:{set:function(e,t){if(!b.support.radioValue&&t==="radio"&&b.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(e,n,r){var i,s,o,u=e.nodeType;if(!e||u===3||u===8||u===2)return;return o=u!==1||!b.isXMLDoc(e),o&&(n=b.propFix[n]||n,s=b.propHooks[n]),r!==t?s&&"set"in s&&(i=s.set(e,r,n))!==t?i:e[n]=r:s&&"get"in s&&(i=s.get(e,n))!==null?i:e[n]},propHooks:{tabIndex:{get:function(e){var n=e.getAttributeNode("tabindex");return n&&n.specified?parseInt(n.value,10):$.test(e.nodeName)||J.test(e.nodeName)&&e.href?0:t}}}}),W={get:function(e,n){var r=b.prop(e,n),i=typeof r=="boolean"&&e.getAttribute(n),s=typeof r=="boolean"?Y&&G?i!=null:Q.test(n)?e[b.camelCase("default-"+n)]:!!i:e.getAttributeNode(n);return s&&s.value!==!1?n.toLowerCase():t},set:function(e,t,n){return t===!1?b.removeAttr(e,n):Y&&G||!Q.test(n)?e.setAttribute(!G&&b.propFix[n]||n,n):e[b.camelCase("default-"+n)]=e[n]=!0,n}};if(!Y||!G)b.attrHooks.value={get:function(e,n){var r=e.getAttributeNode(n);return b.nodeName(e,"input")?e.defaultValue:r&&r.specified?r.value:t},set:function(e,t,n){if(!b.nodeName(e,"input"))return z&&z.set(e,t,n);e.defaultValue=t}};G||(z=b.valHooks.button={get:function(e,n){var r=e.getAttributeNode(n);return r&&(n==="id"||n==="name"||n==="coords"?r.value!=="":r.specified)?r.value:t},set:function(e,n,r){var i=e.getAttributeNode(r);return i||e.setAttributeNode(i=e.ownerDocument.createAttribute(r)),i.value=n+="",r==="value"||n===e.getAttribute(r)?n:t}},b.attrHooks.contenteditable={get:z.get,set:function(e,t,n){z.set(e,t===""?!1:t,n)}},b.each(["width","height"],function(e,t){b.attrHooks[t]=b.extend(b.attrHooks[t],{set:function(e,n){if(n==="")return e.setAttribute(t,"auto"),n}})})),b.support.hrefNormalized||(b.each(["href","src","width","height"],function(e,n){b.attrHooks[n]=b.extend(b.attrHooks[n],{get:function(e){var r=e.getAttribute(n,2);return r==null?t:r}})}),b.each(["href","src"],function(e,t){b.propHooks[t]={get:function(e){return e.getAttribute(t,4)}}})),b.support.style||(b.attrHooks.style={get:function(e){return e.style.cssText||t},set:function(e,t){return e.style.cssText=t+""}}),b.support.optSelected||(b.propHooks.selected=b.extend(b.propHooks.selected,{get:function(e){var t=e.parentNode;return t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex),null}})),b.support.enctype||(b.propFix.enctype="encoding"),b.support.checkOn||b.each(["radio","checkbox"],function(){b.valHooks[this]={get:function(e){return e.getAttribute("value")===null?"on":e.value}}}),b.each(["radio","checkbox"],function(){b.valHooks[this]=b.extend(b.valHooks[this],{set:function(e,t){if(b.isArray(t))return e.checked=b.inArray(b(e).val(),t)>=0}})});var Z=/^(?:input|select|textarea)$/i,et=/^key/,tt=/^(?:mouse|contextmenu)|click/,nt=/^(?:focusinfocus|focusoutblur)$/,rt=/^([^.]*)(?:\.(.+)|)$/;b.event={global:{},add:function(e,n,r,s,o){var u,a,f,l,c,h,p,d,v,m,g,y=b._data(e);if(!y)return;r.handler&&(l=r,r=l.handler,o=l.selector),r.guid||(r.guid=b.guid++),(a=y.events)||(a=y.events={}),(h=y.handle)||(h=y.handle=function(e){return typeof b===i||!!e&&b.event.triggered===e.type?t:b.event.dispatch.apply(h.elem,arguments)},h.elem=e),n=(n||"").match(E)||[""],f=n.length;while(f--){u=rt.exec(n[f])||[],v=g=u[1],m=(u[2]||"").split(".").sort(),c=b.event.special[v]||{},v=(o?c.delegateType:c.bindType)||v,c=b.event.special[v]||{},p=b.extend({type:v,origType:g,data:s,handler:r,guid:r.guid,selector:o,needsContext:o&&b.expr.match.needsContext.test(o),namespace:m.join(".")},l);if(!(d=a[v])){d=a[v]=[],d.delegateCount=0;if(!c.setup||c.setup.call(e,s,m,h)===!1)e.addEventListener?e.addEventListener(v,h,!1):e.attachEvent&&e.attachEvent("on"+v,h)}c.add&&(c.add.call(e,p),p.handler.guid||(p.handler.guid=r.guid)),o?d.splice(d.delegateCount++,0,p):d.push(p),b.event.global[v]=!0}e=null},remove:function(e,t,n,r,i){var s,o,u,a,f,l,c,h,p,d,v,m=b.hasData(e)&&b._data(e);if(!m||!(l=m.events))return;t=(t||"").match(E)||[""],f=t.length;while(f--){u=rt.exec(t[f])||[],p=v=u[1],d=(u[2]||"").split(".").sort();if(!p){for(p in l)b.event.remove(e,p+t[f],n,r,!0);continue}c=b.event.special[p]||{},p=(r?c.delegateType:c.bindType)||p,h=l[p]||[],u=u[2]&&new RegExp("(^|\\.)"+d.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=s=h.length;while(s--)o=h[s],(i||v===o.origType)&&(!n||n.guid===o.guid)&&(!u||u.test(o.namespace))&&(!r||r===o.selector||r==="**"&&o.selector)&&(h.splice(s,1),o.selector&&h.delegateCount--,c.remove&&c.remove.call(e,o));a&&!h.length&&((!c.teardown||c.teardown.call(e,d,m.handle)===!1)&&b.removeEvent(e,p,m.handle),delete l[p])}b.isEmptyObject(l)&&(delete m.handle,b._removeData(e,"events"))},trigger:function(n,r,i,o){var u,a,f,l,c,h,p,d=[i||s],v=g.call(n,"type")?n.type:n,m=g.call(n,"namespace")?n.namespace.split("."):[];f=h=i=i||s;if(i.nodeType===3||i.nodeType===8)return;if(nt.test(v+b.event.triggered))return;v.indexOf(".")>=0&&(m=v.split("."),v=m.shift(),m.sort()),a=v.indexOf(":")<0&&"on"+v,n=n[b.expando]?n:new b.Event(v,typeof n=="object"&&n),n.isTrigger=!0,n.namespace=m.join("."),n.namespace_re=n.namespace?new RegExp("(^|\\.)"+m.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,n.result=t,n.target||(n.target=i),r=r==null?[n]:b.makeArray(r,[n]),c=b.event.special[v]||{};if(!o&&c.trigger&&c.trigger.apply(i,r)===!1)return;if(!o&&!c.noBubble&&!b.isWindow(i)){l=c.delegateType||v,nt.test(l+v)||(f=f.parentNode);for(;f;f=f.parentNode)d.push(f),h=f;h===(i.ownerDocument||s)&&d.push(h.defaultView||h.parentWindow||e)}p=0;while((f=d[p++])&&!n.isPropagationStopped())n.type=p>1?l:c.bindType||v,u=(b._data(f,"events")||{})[n.type]&&b._data(f,"handle"),u&&u.apply(f,r),u=a&&f[a],u&&b.acceptData(f)&&u.apply&&u.apply(f,r)===!1&&n.preventDefault();n.type=v;if(!o&&!n.isDefaultPrevented()&&(!c._default||c._default.apply(i.ownerDocument,r)===!1)&&(v!=="click"||!b.nodeName(i,"a"))&&b.acceptData(i)&&a&&i[v]&&!b.isWindow(i)){h=i[a],h&&(i[a]=null),b.event.triggered=v;try{i[v]()}catch(y){}b.event.triggered=t,h&&(i[a]=h)}return n.result},dispatch:function(e){e=b.event.fix(e);var n,r,i,s,o,u=[],a=d.call(arguments),f=(b._data(this,"events")||{})[e.type]||[],l=b.event.special[e.type]||{};a[0]=e,e.delegateTarget=this;if(l.preDispatch&&l.preDispatch.call(this,e)===!1)return;u=b.event.handlers.call(this,e,f),n=0;while((s=u[n++])&&!e.isPropagationStopped()){e.currentTarget=s.elem,o=0;while((i=s.handlers[o++])&&!e.isImmediatePropagationStopped())if(!e.namespace_re||e.namespace_re.test(i.namespace))e.handleObj=i,e.data=i.data,r=((b.event.special[i.origType]||{}).handle||i.handler).apply(s.elem,a),r!==t&&(e.result=r)===!1&&(e.preventDefault(),e.stopPropagation())}return l.postDispatch&&l.postDispatch.call(this,e),e.result},handlers:function(e,n){var r,i,s,o,u=[],a=n.delegateCount,f=e.target;if(a&&f.nodeType&&(!e.button||e.type!=="click"))for(;f!=this;f=f.parentNode||this)if(f.nodeType===1&&(f.disabled!==!0||e.type!=="click")){s=[];for(o=0;o=0:b.find(r,this,null,[f]).length),s[r]&&s.push(i);s.length&&u.push({elem:f,handlers:s})}return ai.cacheLength&&delete e[t.shift()],e[n]=r}}function st(e){return e[w]=!0,e}function ot(e){var t=c.createElement("div");try{return e(t)}catch(n){return!1}finally{t=null}}function ut(e,t,n,r){var i,s,o,u,a,f,h,v,m,y;(t?t.ownerDocument||t:E)!==c&&l(t),t=t||c,n=n||[];if(!e||typeof e!="string")return n;if((u=t.nodeType)!==1&&u!==9)return[];if(!p&&!r){if(i=K.exec(e))if(o=i[1]){if(u===9){s=t.getElementById(o);if(!s||!s.parentNode)return n;if(s.id===o)return n.push(s),n}else if(t.ownerDocument&&(s=t.ownerDocument.getElementById(o))&&g(t,s)&&s.id===o)return n.push(s),n}else{if(i[2])return _.apply(n,D.call(t.getElementsByTagName(e),0)),n;if((o=i[3])&&S.getByClassName&&t.getElementsByClassName)return _.apply(n,D.call(t.getElementsByClassName(o),0)),n}if(S.qsa&&!d.test(e)){h=!0,v=w,m=t,y=u===9&&e;if(u===1&&t.nodeName.toLowerCase()!=="object"){f=ht(e),(h=t.getAttribute("id"))?v=h.replace(Y,"\\$&"):t.setAttribute("id",v),v="[id='"+v+"'] ",a=f.length;while(a--)f[a]=v+pt(f[a]);m=$.test(e)&&t.parentNode||t,y=f.join(",")}if(y)try{return _.apply(n,D.call(m.querySelectorAll(y),0)),n}catch(b){}finally{h||t.removeAttribute("id")}}}return Et(e.replace(R,"$1"),t,n,r)}function at(e,t){var n=t&&e,r=n&&(~t.sourceIndex||A)-(~e.sourceIndex||A);if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function ft(e){return function(t){var n=t.nodeName.toLowerCase();return n==="input"&&t.type===e}}function lt(e){return function(t){var n=t.nodeName.toLowerCase();return(n==="input"||n==="button")&&t.type===e}}function ct(e){return st(function(t){return t=+t,st(function(n,r){var i,s=e([],n.length,t),o=s.length;while(o--)n[i=s[o]]&&(n[i]=!(r[i]=n[i]))})})}function ht(e,t){var n,r,s,o,u,a,f,l=C[e+" "];if(l)return t?0:l.slice(0);u=e,a=[],f=i.preFilter;while(u){if(!n||(r=U.exec(u)))r&&(u=u.slice(r[0].length)||u),a.push(s=[]);n=!1;if(r=z.exec(u))n=r.shift(),s.push({value:n,type:r[0].replace(R," ")}),u=u.slice(n.length);for(o in i.filter)(r=V[o].exec(u))&&(!f[o]||(r=f[o](r)))&&(n=r.shift(),s.push({value:n,type:o,matches:r}),u=u.slice(n.length));if(!n)break}return t?u.length:u?ut.error(e):C(e,a).slice(0)}function pt(e){var t=0,n=e.length,r="";for(;t1?function(t,n,r){var i=e.length;while(i--)if(!e[i](t,n,r))return!1;return!0}:e[0]}function mt(e,t,n,r,i){var s,o=[],u=0,a=e.length,f=t!=null;for(;u-1&&(s[f]=!(o[f]=c))}}else g=mt(g===o?g.splice(d,g.length):g),i?i(null,o,g,a):_.apply(o,g)})}function yt(e){var t,n,r,s=e.length,o=i.relative[e[0].type],u=o||i.relative[" "],a=o?1:0,l=dt(function(e){return e===t},u,!0),c=dt(function(e){return P.call(t,e)>-1},u,!0),h=[function(e,n,r){return!o&&(r||n!==f)||((t=n).nodeType?l(e,n,r):c(e,n,r))}];for(;a1&&vt(h),a>1&&pt(e.slice(0,a-1)).replace(R,"$1"),n,a0,o=e.length>0,u=function(u,a,l,h,p){var d,v,m,g=[],y=0,b="0",w=u&&[],E=p!=null,S=f,T=u||o&&i.find.TAG("*",p&&a.parentNode||a),N=x+=S==null?1:Math.random()||.1;E&&(f=a!==c&&a,r=n);for(;(d=T[b])!=null;b++){if(o&&d){v=0;while(m=e[v++])if(m(d,a,l)){h.push(d);break}E&&(x=N,r=++n)}s&&((d=!m&&d)&&y--,u&&w.push(d))}y+=b;if(s&&b!==y){v=0;while(m=t[v++])m(w,g,a,l);if(u){if(y>0)while(b--)!w[b]&&!g[b]&&(g[b]=M.call(h));g=mt(g)}_.apply(h,g),E&&!u&&g.length>0&&y+t.length>1&&ut.uniqueSort(h)}return E&&(x=N,f=S),w};return s?st(u):u}function wt(e,t,n){var r=0,i=t.length;for(;r2&&(a=o[0]).type==="ID"&&t.nodeType===9&&!p&&i.relative[o[1].type]){t=i.find.ID(a.matches[0].replace(et,tt),t)[0];if(!t)return n;e=e.slice(o.shift().value.length)}s=V.needsContext.test(e)?0:o.length;while(s--){a=o[s];if(i.relative[f=a.type])break;if(l=i.find[f])if(r=l(a.matches[0].replace(et,tt),$.test(o[0].type)&&t.parentNode||t)){o.splice(s,1),e=r.length&&pt(o);if(!e)return _.apply(n,D.call(r,0)),n;break}}}return u(e,c)(r,t,p,n,$.test(e)),n}function St(){}var n,r,i,s,o,u,a,f,l,c,h,p,d,v,m,g,y,w="sizzle"+ -(new Date),E=e.document,S={},x=0,T=0,N=it(),C=it(),k=it(),L=typeof t,A=1<<31,O=[],M=O.pop,_=O.push,D=O.slice,P=O.indexOf||function(e){var t=0,n=this.length;for(;t+~])"+H+"*"),W=new RegExp(q),X=new RegExp("^"+j+"$"),V={ID:new RegExp("^#("+B+")"),CLASS:new RegExp("^\\.("+B+")"),NAME:new RegExp("^\\[name=['\"]?("+B+")['\"]?\\]"),TAG:new RegExp("^("+B.replace("w","w*")+")"),ATTR:new RegExp("^"+I),PSEUDO:new RegExp("^"+q),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+H+"*(even|odd|(([+-]|)(\\d*)n|)"+H+"*(?:([+-]|)"+H+"*(\\d+)|))"+H+"*\\)|)","i"),needsContext:new RegExp("^"+H+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+H+"*((?:-\\d)?\\d*)"+H+"*\\)|)(?=[^-]|$)","i")},$=/[\x20\t\r\n\f]*[+~]/,J=/^[^{]+\{\s*\[native code/,K=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,Q=/^(?:input|select|textarea|button)$/i,G=/^h\d$/i,Y=/'|\\/g,Z=/\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,et=/\\([\da-fA-F]{1,6}[\x20\t\r\n\f]?|.)/g,tt=function(e,t){var n="0x"+t-65536;return n!==n?t:n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,n&1023|56320)};try{D.call(E.documentElement.childNodes,0)[0].nodeType}catch(nt){D=function(e){var t,n=[];while(t=this[e++])n.push(t);return n}}o=ut.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?t.nodeName!=="HTML":!1},l=ut.setDocument=function(e){var n=e?e.ownerDocument||e:E;if(n===c||n.nodeType!==9||!n.documentElement)return c;c=n,h=n.documentElement,p=o(n),S.tagNameNoComments=ot(function(e){return e.appendChild(n.createComment("")),!e.getElementsByTagName("*").length}),S.attributes=ot(function(e){e.innerHTML="";var t=typeof e.lastChild.getAttribute("multiple");return t!=="boolean"&&t!=="string"}),S.getByClassName=ot(function(e){return e.innerHTML="",!e.getElementsByClassName||!e.getElementsByClassName("e").length?!1:(e.lastChild.className="e",e.getElementsByClassName("e").length===2)}),S.getByName=ot(function(e){e.id=w+0,e.innerHTML="
",h.insertBefore(e,h.firstChild);var t=n.getElementsByName&&n.getElementsByName(w).length===2+n.getElementsByName(w+0).length;return S.getIdNotName=!n.getElementById(w),h.removeChild(e),t}),i.attrHandle=ot(function(e){return e.innerHTML="",e.firstChild&&typeof e.firstChild.getAttribute!==L&&e.firstChild.getAttribute("href")==="#"})?{}:{href:function(e){return e.getAttribute("href",2)},type:function(e){return e.getAttribute("type")}},S.getIdNotName?(i.find.ID=function(e,t){if(typeof t.getElementById!==L&&!p){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},i.filter.ID=function(e){var t=e.replace(et,tt);return function(e){return e.getAttribute("id")===t}}):(i.find.ID=function(e,n){if(typeof n.getElementById!==L&&!p){var r=n.getElementById(e);return r?r.id===e||typeof r.getAttributeNode!==L&&r.getAttributeNode("id").value===e?[r]:t:[]}},i.filter.ID=function(e){var t=e.replace(et,tt);return function(e){var n=typeof e.getAttributeNode!==L&&e.getAttributeNode("id");return n&&n.value===t}}),i.find.TAG=S.tagNameNoComments?function(e,t){if(typeof t.getElementsByTagName!==L)return t.getElementsByTagName(e)}:function(e,t){var n,r=[],i=0,s=t.getElementsByTagName(e);if(e==="*"){while(n=s[i++])n.nodeType===1&&r.push(n);return r}return s},i.find.NAME=S.getByName&&function(e,t){if(typeof t.getElementsByName!==L)return t.getElementsByName(name)},i.find.CLASS=S.getByClassName&&function(e,t){if(typeof t.getElementsByClassName!==L&&!p)return t.getElementsByClassName(e)},v=[],d=[":focus"];if(S.qsa=rt(n.querySelectorAll))ot(function(e){e.innerHTML="",e.querySelectorAll("[selected]").length||d.push("\\["+H+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),e.querySelectorAll(":checked").length||d.push(":checked")}),ot(function(e){e.innerHTML="",e.querySelectorAll("[i^='']").length&&d.push("[*^$]="+H+"*(?:\"\"|'')"),e.querySelectorAll(":enabled").length||d.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),d.push(",.*:")});return(S.matchesSelector=rt(m=h.matchesSelector||h.mozMatchesSelector||h.webkitMatchesSelector||h.oMatchesSelector||h.msMatchesSelector))&&ot(function(e){S.disconnectedMatch=m.call(e,"div"),m.call(e,"[s!='']:x"),v.push("!=",q)}),d=new RegExp(d.join("|")),v=new RegExp(v.join("|")),g=rt(h.contains)||h.compareDocumentPosition?function(e,t){var n=e.nodeType===9?e.documentElement:e,r=t&&t.parentNode;return e===r||!!r&&r.nodeType===1&&!!(n.contains?n.contains(r):e.compareDocumentPosition&&e.compareDocumentPosition(r)&16)}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},y=h.compareDocumentPosition?function(e,t){var r;if(e===t)return a=!0,0;if(r=t.compareDocumentPosition&&e.compareDocumentPosition&&e.compareDocumentPosition(t))return r&1||e.parentNode&&e.parentNode.nodeType===11?e===n||g(E,e)?-1:t===n||g(E,t)?1:0:r&4?-1:1;return e.compareDocumentPosition?-1:1}:function(e,t){var r,i=0,s=e.parentNode,o=t.parentNode,u=[e],f=[t];if(e===t)return a=!0,0;if(!s||!o)return e===n?-1:t===n?1:s?-1:o?1:0;if(s===o)return at(e,t);r=e;while(r=r.parentNode)u.unshift(r);r=t;while(r=r.parentNode)f.unshift(r);while(u[i]===f[i])i++;return i?at(u[i],f[i]):u[i]===E?-1:f[i]===E?1:0},a=!1,[0,0].sort(y),S.detectDuplicates=a,c},ut.matches=function(e,t){return ut(e,null,null,t)},ut.matchesSelector=function(e,t){(e.ownerDocument||e)!==c&&l(e),t=t.replace(Z,"='$1']");if(S.matchesSelector&&!p&&(!v||!v.test(t))&&!d.test(t))try{var n=m.call(e,t);if(n||S.disconnectedMatch||e.document&&e.document.nodeType!==11)return n}catch(r){}return ut(t,c,null,[e]).length>0},ut.contains=function(e,t){return(e.ownerDocument||e)!==c&&l(e),g(e,t)},ut.attr=function(e,t){var n;return(e.ownerDocument||e)!==c&&l(e),p||(t=t.toLowerCase()),(n=i.attrHandle[t])?n(e):p||S.attributes?e.getAttribute(t):((n=e.getAttributeNode(t))||e.getAttribute(t))&&e[t]===!0?t:n&&n.specified?n.value:null},ut.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},ut.uniqueSort=function(e){var t,n=[],r=1,i=0;a=!S.detectDuplicates,e.sort(y);if(a){for(;t=e[r];r++)t===e[r-1]&&(i=n.push(r));while(i--)e.splice(n[i],1)}return e},s=ut.getText=function(e){var t,n="",r=0,i=e.nodeType;if(!i)for(;t=e[r];r++)n+=s(t);else if(i===1||i===9||i===11){if(typeof e.textContent=="string")return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=s(e)}else if(i===3||i===4)return e.nodeValue;return n},i=ut.selectors={cacheLength:50,createPseudo:st,match:V,find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(et,tt),e[3]=(e[4]||e[5]||"").replace(et,tt),e[2]==="~="&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),e[1].slice(0,3)==="nth"?(e[3]||ut.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*(e[3]==="even"||e[3]==="odd")),e[5]=+(e[7]+e[8]||e[3]==="odd")):e[3]&&ut.error(e[0]),e},PSEUDO:function(e){var t,n=!e[5]&&e[2];return V.CHILD.test(e[0])?null:(e[4]?e[2]=e[4]:n&&W.test(n)&&(t=ht(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){return e==="*"?function(){return!0}:(e=e.replace(et,tt).toLowerCase(),function(t){return t.nodeName&&t.nodeName.toLowerCase()===e})},CLASS:function(e){var t=N[e+" "];return t||(t=new RegExp("(^|"+H+")"+e+"("+H+"|$)"))&&N(e,function(e){return t.test(e.className||typeof e.getAttribute!==L&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var i=ut.attr(r,e);return i==null?t==="!=":t?(i+="",t==="="?i===n:t==="!="?i!==n:t==="^="?n&&i.indexOf(n)===0:t==="*="?n&&i.indexOf(n)>-1:t==="$="?n&&i.slice(-n.length)===n:t==="~="?(" "+i+" ").indexOf(n)>-1:t==="|="?i===n||i.slice(0,n.length+1)===n+"-":!1):!0}},CHILD:function(e,t,n,r,i){var s=e.slice(0,3)!=="nth",o=e.slice(-4)!=="last",u=t==="of-type";return r===1&&i===0?function(e){return!!e.parentNode}:function(t,n,a){var f,l,c,h,p,d,v=s!==o?"nextSibling":"previousSibling",m=t.parentNode,g=u&&t.nodeName.toLowerCase(),y=!a&&!u;if(m){if(s){while(v){c=t;while(c=c[v])if(u?c.nodeName.toLowerCase()===g:c.nodeType===1)return!1;d=v=e==="only"&&!d&&"nextSibling"}return!0}d=[o?m.firstChild:m.lastChild];if(o&&y){l=m[w]||(m[w]={}),f=l[e]||[],p=f[0]===x&&f[1],h=f[0]===x&&f[2],c=p&&m.childNodes[p];while(c=++p&&c&&c[v]||(h=p=0)||d.pop())if(c.nodeType===1&&++h&&c===t){l[e]=[x,p,h];break}}else if(y&&(f=(t[w]||(t[w]={}))[e])&&f[0]===x)h=f[1];else while(c=++p&&c&&c[v]||(h=p=0)||d.pop())if((u?c.nodeName.toLowerCase()===g:c.nodeType===1)&&++h){y&&((c[w]||(c[w]={}))[e]=[x,h]);if(c===t)break}return h-=i,h===r||h%r===0&&h/r>=0}}},PSEUDO:function(e,t){var n,r=i.pseudos[e]||i.setFilters[e.toLowerCase()]||ut.error("unsupported pseudo: "+e);return r[w]?r(t):r.length>1?(n=[e,e,"",t],i.setFilters.hasOwnProperty(e.toLowerCase())?st(function(e,n){var i,s=r(e,t),o=s.length;while(o--)i=P.call(e,s[o]),e[i]=!(n[i]=s[o])}):function(e){return r(e,0,n)}):r}},pseudos:{not:st(function(e){var t=[],n=[],r=u(e.replace(R,"$1"));return r[w]?st(function(e,t,n,i){var s,o=r(e,null,i,[]),u=e.length;while(u--)if(s=o[u])e[u]=!(t[u]=s)}):function(e,i,s){return t[0]=e,r(t,null,s,n),!n.pop()}}),has:st(function(e){return function(t){return ut(e,t).length>0}}),contains:st(function(e){return function(t){return(t.textContent||t.innerText||s(t)).indexOf(e)>-1}}),lang:st(function(e){return X.test(e||"")||ut.error("unsupported lang: "+e),e=e.replace(et,tt).toLowerCase(),function(t){var n;do if(n=p?t.getAttribute("xml:lang")||t.getAttribute("lang"):t.lang)return n=n.toLowerCase(),n===e||n.indexOf(e+"-")===0;while((t=t.parentNode)&&t.nodeType===1);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===h},focus:function(e){return e===c.activeElement&&(!c.hasFocus||c.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return t==="input"&&!!e.checked||t==="option"&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeName>"@"||e.nodeType===3||e.nodeType===4)return!1;return!0},parent:function(e){return!i.pseudos.empty(e)},header:function(e){return G.test(e.nodeName)},input:function(e){return Q.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return t==="input"&&e.type==="button"||t==="button"},text:function(e){var t;return e.nodeName.toLowerCase()==="input"&&e.type==="text"&&((t=e.getAttribute("type"))==null||t.toLowerCase()===e.type)},first:ct(function(){return[0]}),last:ct(function(e,t){return[t-1]}),eq:ct(function(e,t,n){return[n<0?n+t:n]}),even:ct(function(e,t){var n=0;for(;n=0;)e.push(r);return e}),gt:ct(function(e,t,n){var r=n<0?n+t:n;for(;++r1?b.unique(n):n),n.selector=(this.selector?this.selector+" ":"")+e,n},has:function(e){var t,n=b(e,this),r=n.length;return this.filter(function(){for(t=0;t=0:b.filter(e,this).length>0:this.filter(e).length>0)},closest:function(e,t){var n,r=0,i=this.length,s=[],o=ft.test(e)||typeof e!="string"?b(e,t||this.context):0;for(;r-1:b.find.matchesSelector(n,e)){s.push(n);break}n=n.parentNode}}return this.pushStack(s.length>1?b.unique(s):s)},index:function(e){return e?typeof e=="string"?b.inArray(this[0],b(e)):b.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){var n=typeof e=="string"?b(e,t):b.makeArray(e&&e.nodeType?[e]:e),r=b.merge(this.get(),n);return this.pushStack(b.unique(r))},addBack:function(e){return this.add(e==null?this.prevObject:this.prevObject.filter(e))}}),b.fn.andSelf=b.fn.addBack,b.each({parent:function(e){var t=e.parentNode;return t&&t.nodeType!==11?t:null},parents:function(e){return b.dir(e,"parentNode")},parentsUntil:function(e,t,n){return b.dir(e,"parentNode",n)},next:function(e){return ct(e,"nextSibling")},prev:function(e){return ct(e,"previousSibling")},nextAll:function(e){return b.dir(e,"nextSibling")},prevAll:function(e){return b.dir(e,"previousSibling")},nextUntil:function(e,t,n){return b.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return b.dir(e,"previousSibling",n)},siblings:function(e){return b.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return b.sibling(e.firstChild)},contents:function(e){return b.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:b.merge([],e.childNodes)}},function(e,t){b.fn[e]=function(n,r){var i=b.map(this,t,n);return ot.test(e)||(r=n),r&&typeof r=="string"&&(i=b.filter(r,i)),i=this.length>1&&!lt[e]?b.unique(i):i,this.length>1&&ut.test(e)&&(i=i.reverse()),this.pushStack(i)}}),b.extend({filter:function(e,t,n){return n&&(e=":not("+e+")"),t.length===1?b.find.matchesSelector(t[0],e)?[t[0]]:[]:b.find.matches(e,t)},dir:function(e,n,r){var i=[],s=e[n];while(s&&s.nodeType!==9&&(r===t||s.nodeType!==1||!b(s).is(r)))s.nodeType===1&&i.push(s),s=s[n];return i},sibling:function(e,t){var n=[];for(;e;e=e.nextSibling)e.nodeType===1&&e!==t&&n.push(e);return n}});var dt="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",vt=/ jQuery\d+="(?:null|\d+)"/g,mt=new RegExp("<(?:"+dt+")[\\s/>]","i"),gt=/^\s+/,yt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,bt=/<([\w:]+)/,wt=/\s*$/g,Lt={option:[1,""],legend:[1,"
","
"],area:[1,"",""],param:[1,"",""],thead:[1,"","
"],tr:[2,"","
"],col:[2,"","
"],td:[3,"","
"],_default:b.support.htmlSerialize?[0,"",""]:[1,"X
","
"]},At=pt(s),Ot=At.appendChild(s.createElement("div"));Lt.optgroup=Lt.option,Lt.tbody=Lt.tfoot=Lt.colgroup=Lt.caption=Lt.thead,Lt.th=Lt.td,b.fn.extend({text:function(e){return b.access(this,function(e){return e===t?b.text(this):this.empty().append((this[0]&&this[0].ownerDocument||s).createTextNode(e))},null,e,arguments.length)},wrapAll:function(e){if(b.isFunction(e))return this.each(function(t){b(this).wrapAll(e.call(this,t))});if(this[0]){var t=b(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstChild&&e.firstChild.nodeType===1)e=e.firstChild;return e}).append(this)}return this},wrapInner:function(e){return b.isFunction(e)?this.each(function(t){b(this).wrapInner(e.call(this,t))}):this.each(function(){var t=b(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=b.isFunction(e);return this.each(function(n){b(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){b.nodeName(this,"body")||b(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(e){(this.nodeType===1||this.nodeType===11||this.nodeType===9)&&this.appendChild(e)})},prepend:function(){return this.domManip(arguments,!0,function(e){(this.nodeType===1||this.nodeType===11||this.nodeType===9)&&this.insertBefore(e,this.firstChild)})},before:function(){return this.domManip(arguments,!1,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return this.domManip(arguments,!1,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},remove:function(e,t){var n,r=0;for(;(n=this[r])!=null;r++)if(!e||b.filter(e,[n]).length>0)!t&&n.nodeType===1&&b.cleanData(jt(n)),n.parentNode&&(t&&b.contains(n.ownerDocument,n)&&Pt(jt(n,"script")),n.parentNode.removeChild(n));return this},empty:function(){var e,t=0;for(;(e=this[t])!=null;t++){e.nodeType===1&&b.cleanData(jt(e,!1));while(e.firstChild)e.removeChild(e.firstChild);e.options&&b.nodeName(e,"select")&&(e.options.length=0)}return this},clone:function(e,t){return e=e==null?!1:e,t=t==null?e:t,this.map(function(){return b.clone(this,e,t)})},html:function(e){return b.access(this,function(e){var n=this[0]||{},r=0,i=this.length;if(e===t)return n.nodeType===1?n.innerHTML.replace(vt,""):t;if(typeof e=="string"&&!St.test(e)&&(b.support.htmlSerialize||!mt.test(e))&&(b.support.leadingWhitespace||!gt.test(e))&&!Lt[(bt.exec(e)||["",""])[1].toLowerCase()]){e=e.replace(yt,"<$1>");try{for(;r")?s=e.cloneNode(!0):(Ot.innerHTML=e.outerHTML,Ot.removeChild(s=Ot.firstChild));if((!b.support.noCloneEvent||!b.support.noCloneChecked)&&(e.nodeType===1||e.nodeType===11)&&!b.isXMLDoc(e)){r=jt(s),u=jt(e);for(o=0;(i=u[o])!=null;++o)r[o]&&Bt(i,r[o])}if(t)if(n){u=u||jt(e),r=r||jt(s);for(o=0;(i=u[o])!=null;o++)Ht(i,r[o])}else Ht(e,s);return r=jt(s,"script"),r.length>0&&Pt(r,!a&&jt(e,"script")),r=u=i=null,s},buildFragment:function(e,t,n,r){var i,s,o,u,a,f,l,c=e.length,h=pt(t),p=[],d=0;for(;d")+l[2],i=l[0];while(i--)u=u.lastChild;!b.support.leadingWhitespace&>.test(s)&&p.push(t.createTextNode(gt.exec(s)[0]));if(!b.support.tbody){s=a==="table"&&!wt.test(s)?u.firstChild:l[1]===""&&!wt.test(s)?u:0,i=s&&s.childNodes.length;while(i--)b.nodeName(f=s.childNodes[i],"tbody")&&!f.childNodes.length&&s.removeChild(f)}b.merge(p,u.childNodes),u.textContent="";while(u.firstChild)u.removeChild(u.firstChild);u=h.lastChild}}u&&h.removeChild(u),b.support.appendChecked||b.grep(jt(p,"input"),Ft),d=0;while(s=p[d++]){if(r&&b.inArray(s,r)!==-1)continue;o=b.contains(s.ownerDocument,s),u=jt(h.appendChild(s),"script"),o&&Pt(u);if(n){i=0;while(s=u[i++])Nt.test(s.type||"")&&n.push(s)}}return u=null,h},cleanData:function(e,t){var n,r,s,o,u=0,a=b.expando,f=b.cache,c=b.support.deleteExpando,h=b.event.special;for(;(n=e[u])!=null;u++)if(t||b.acceptData(n)){s=n[a],o=s&&f[s];if(o){if(o.events)for(r in o.events)h[r]?b.event.remove(n,r):b.removeEvent(n,r,o.handle);f[s]&&(delete f[s],c?delete n[a]:typeof n.removeAttribute!==i?n.removeAttribute(a):n[a]=null,l.push(s))}}}});var It,qt,Rt,Ut=/alpha\([^)]*\)/i,zt=/opacity\s*=\s*([^)]*)/,Wt=/^(top|right|bottom|left)$/,Xt=/^(none|table(?!-c[ea]).+)/,Vt=/^margin/,$t=new RegExp("^("+w+")(.*)$","i"),Jt=new RegExp("^("+w+")(?!px)[a-z%]+$","i"),Kt=new RegExp("^([+-])=("+w+")","i"),Qt={BODY:"block"},Gt={position:"absolute",visibility:"hidden",display:"block"},Yt={letterSpacing:0,fontWeight:400},Zt=["Top","Right","Bottom","Left"],en=["Webkit","O","Moz","ms"];b.fn.extend({css:function(e,n){return b.access(this,function(e,n,r){var i,s,o={},u=0;if(b.isArray(n)){s=qt(e),i=n.length;for(;u1)},show:function(){return rn(this,!0)},hide:function(){return rn(this)},toggle:function(e){var t=typeof e=="boolean";return this.each(function(){(t?e:nn(this))?b(this).show():b(this).hide()})}}),b.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Rt(e,"opacity");return n===""?"1":n}}}},cssNumber:{columnCount:!0,fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":b.support.cssFloat?"cssFloat":"styleFloat"},style:function(e,n,r,i){if(!e||e.nodeType===3||e.nodeType===8||!e.style)return;var s,o,u,a=b.camelCase(n),f=e.style;n=b.cssProps[a]||(b.cssProps[a]=tn(f,a)),u=b.cssHooks[n]||b.cssHooks[a];if(r===t)return u&&"get"in u&&(s=u.get(e,!1,i))!==t?s:f[n];o=typeof r,o==="string"&&(s=Kt.exec(r))&&(r=(s[1]+1)*s[2]+parseFloat(b.css(e,n)),o="number");if(r==null||o==="number"&&isNaN(r))return;o==="number"&&!b.cssNumber[a]&&(r+="px"),!b.support.clearCloneStyle&&r===""&&n.indexOf("background")===0&&(f[n]="inherit");if(!u||!("set"in u)||(r=u.set(e,r,i))!==t)try{f[n]=r}catch(l){}},css:function(e,n,r,i){var s,o,u,a=b.camelCase(n);return n=b.cssProps[a]||(b.cssProps[a]=tn(e.style,a)),u=b.cssHooks[n]||b.cssHooks[a],u&&"get"in u&&(o=u.get(e,!0,r)),o===t&&(o=Rt(e,n,i)),o==="normal"&&n in Yt&&(o=Yt[n]),r===""||r?(s=parseFloat(o),r===!0||b.isNumeric(s)?s||0:o):o},swap:function(e,t,n,r){var i,s,o={};for(s in t)o[s]=e.style[s],e.style[s]=t[s];i=n.apply(e,r||[]);for(s in t)e.style[s]=o[s];return i}}),e.getComputedStyle?(qt=function(t){return e.getComputedStyle(t,null)},Rt=function(e,n,r){var i,s,o,u=r||qt(e),a=u?u.getPropertyValue(n)||u[n]:t,f=e.style;return u&&(a===""&&!b.contains(e.ownerDocument,e)&&(a=b.style(e,n)),Jt.test(a)&&Vt.test(n)&&(i=f.width,s=f.minWidth,o=f.maxWidth,f.minWidth=f.maxWidth=f.width=a,a=u.width,f.width=i,f.minWidth=s,f.maxWidth=o)),a}):s.documentElement.currentStyle&&(qt=function(e){return e.currentStyle},Rt=function(e,n,r){var i,s,o,u=r||qt(e),a=u?u[n]:t,f=e.style;return a==null&&f&&f[n]&&(a=f[n]),Jt.test(a)&&!Wt.test(n)&&(i=f.left,s=e.runtimeStyle,o=s&&s.left,o&&(s.left=e.currentStyle.left),f.left=n==="fontSize"?"1em":a,a=f.pixelLeft+"px",f.left=i,o&&(s.left=o)),a===""?"auto":a}),b.each(["height","width"],function(e,t){b.cssHooks[t]={get:function(e,n,r){if(n)return e.offsetWidth===0&&Xt.test(b.css(e,"display"))?b.swap(e,Gt,function(){return un(e,t,r)}):un(e,t,r)},set:function(e,n,r){var i=r&&qt(e);return sn(e,n,r?on(e,t,r,b.support.boxSizing&&b.css(e,"boxSizing",!1,i)==="border-box",i):0)}}}),b.support.opacity||(b.cssHooks.opacity={get:function(e,t){return zt.test((t&&e.currentStyle?e.currentStyle.filter:e.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":t?"1":""},set:function(e,t){var n=e.style,r=e.currentStyle,i=b.isNumeric(t)?"alpha(opacity="+t*100+")":"",s=r&&r.filter||n.filter||"";n.zoom=1;if((t>=1||t==="")&&b.trim(s.replace(Ut,""))===""&&n.removeAttribute){n.removeAttribute("filter");if(t===""||r&&!r.filter)return}n.filter=Ut.test(s)?s.replace(Ut,i):s+" "+i}}),b(function(){b.support.reliableMarginRight||(b.cssHooks.marginRight={get:function(e,t){if(t)return b.swap(e,{display:"inline-block"},Rt,[e,"marginRight"])}}),!b.support.pixelPosition&&b.fn.position&&b.each(["top","left"],function(e,t){b.cssHooks[t]={get:function(e,n){if(n)return n=Rt(e,t),Jt.test(n)?b(e).position()[t]+"px":n}}})}),b.expr&&b.expr.filters&&(b.expr.filters.hidden=function(e){return e.offsetWidth<=0&&e.offsetHeight<=0||!b.support.reliableHiddenOffsets&&(e.style&&e.style.display||b.css(e,"display"))==="none"},b.expr.filters.visible=function(e){return!b.expr.filters.hidden(e)}),b.each({margin:"",padding:"",border:"Width"},function(e,t){b.cssHooks[e+t]={expand:function(n){var r=0,i={},s=typeof n=="string"?n.split(" "):[n];for(;r<4;r++)i[e+Zt[r]+t]=s[r]||s[r-2]||s[0];return i}},Vt.test(e)||(b.cssHooks[e+t].set=sn)});var ln=/%20/g,cn=/\[\]$/,hn=/\r?\n/g,pn=/^(?:submit|button|image|reset|file)$/i,dn=/^(?:input|select|textarea|keygen)/i;b.fn.extend({serialize:function(){return b.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=b.prop(this,"elements");return e?b.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!b(this).is(":disabled")&&dn.test(this.nodeName)&&!pn.test(e)&&(this.checked||!xt.test(e))}).map(function(e,t){var n=b(this).val();return n==null?null:b.isArray(n)?b.map(n,function(e){return{name:t.name,value:e.replace(hn,"\r\n")}}):{name:t.name,value:n.replace(hn,"\r\n")}}).get()}}),b.param=function(e,n){var r,i=[],s=function(e,t){t=b.isFunction(t)?t():t==null?"":t,i[i.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};n===t&&(n=b.ajaxSettings&&b.ajaxSettings.traditional);if(b.isArray(e)||e.jquery&&!b.isPlainObject(e))b.each(e,function(){s(this.name,this.value)});else for(r in e)vn(r,e[r],n,s);return i.join("&").replace(ln,"+")},b.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(e,t){b.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}}),b.fn.hover=function(e,t){return this.mouseenter(e).mouseleave(t||e)};var mn,gn,yn=b.now(),bn=/\?/,wn=/#.*$/,En=/([?&])_=[^&]*/,Sn=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,xn=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Tn=/^(?:GET|HEAD)$/,Nn=/^\/\//,Cn=/^([\w.+-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,kn=b.fn.load,Ln={},An={},On="*/".concat("*");try{gn=o.href}catch(Mn){gn=s.createElement("a"),gn.href="",gn=gn.href}mn=Cn.exec(gn.toLowerCase())||[],b.fn.load=function(e,n,r){if(typeof e!="string"&&kn)return kn.apply(this,arguments);var i,s,o,u=this,a=e.indexOf(" ");return a>=0&&(i=e.slice(a,e.length),e=e.slice(0,a)),b.isFunction(n)?(r=n,n=t):n&&typeof n=="object"&&(o="POST"),u.length>0&&b.ajax({url:e,type:o,dataType:"html",data:n}).done(function(e){s=arguments,u.html(i?b("
").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),define("async-runner",[],function(){function o(){if(i===!0){var o=r.timeout||ASYNC_TASK_DEFAULT_TIMEOUT;s+o=500&&e.code<600){o="Google Drive is not accessible.",t.retry();return}e.code===401||e.code===403?(s=!1,o="Access to Google Drive is not authorized."):e.code<=0?(i=!1,s=!1,n.setOffline()):o="Google Drive error ("+e.code+": "+e.message+")."}t.error()}function c(r){u(function(){if(i===!1){l=!1,r();return}var s={};s.run=function(){if(l===!0){s.success();return}e.ajax({url:"//www.google.com/jsapi",data:{key:GOOGLE_KEY},dataType:"script",timeout:AJAX_TIMEOUT}).done(function(){s.success()}).fail(function(){s.error()})},s.onSuccess=function(){google.load("picker","1",{callback:r}),l=!0},s.onError=function(){n.setOffline(),r()},t.addTask(s)})}var n=undefined,r=undefined,i=!1,s=!1,o={};o.upload=function(e,r,s,o,u){u=u||n.doNothing,a(function(){if(i===!1){u();return}var a=undefined,l={};l.run=function(){var t="-------314159265358979323846",i="\r\n--"+t+"\r\n",c="\r\n--"+t+"--",h="text/x-markdown",p={title:s,mimeType:h};r!==undefined&&(p.parents=[{kind:"drive#fileLink",id:r}]);var d="/upload/drive/v2/files",v="POST",m=undefined;e!==undefined&&(d+="/"+e,v="PUT",m=localStorage[SYNC_PROVIDER_GDRIVE+e+".etag"]);var g={"Content-Type":'multipart/mixed; boundary="'+t+'"'};m!==undefined&&(g["If-Match"]=m);var y=n.encodeBase64(o),b=i+"Content-Type: application/json\r\n\r\n"+JSON.stringify(p)+i+"Content-Type: "+h+"\r\n"+"Content-Transfer-Encoding: base64\r\n"+"\r\n"+y+c,w=gapi.client.request({path:d,method:v,params:{uploadType:"multipart"},headers:g,body:b});w.execute(function(t){if(t&&t.id){a=SYNC_PROVIDER_GDRIVE+t.id,localStorage[a+".etag"]=t.etag,l.success();return}var n=t.error;n!==undefined&&e!==undefined&&(n.code===404?n='File ID "'+e+'" does not exist on Google Drive.':n.code===412&&(localStorage.removeItem("sync.gdrive.lastChangeId"),n='Conflict on file ID "'+e+'". Please restart the synchronization.')),f(n,l,u)})},l.onSuccess=function(){u(a)},l.onError=function(){u()},t.addTask(l)})},o.checkUpdates=function(e,r){r=r||n.doNothing,a(function(){function o(e){var i=undefined,u={};u.run=function(){e.execute(function(e){if(e&&e.largestChangeId){s=e.largestChangeId,i=e.nextPageToken;if(e.items!==undefined)for(var t=0;t").addClass("modal-backdrop").click(function(){s.setVisible(!1),e(".modal-backdrop, .picker").remove(),t()})),s.setVisible(!0)})},o.importFiles=function(e){o.downloadMetadata(e,function(e){if(e===undefined)return;o.downloadContent(e,function(e){if(e===undefined)return;for(var t=0;t:"\|?\*]+$/)?e.indexOf("/")!==0?"/"+e:e:(n.showError('"'+e+'" contains invalid characters.'),undefined)},o}),define("github-helper",["jquery","async-runner"],function(e,t){function o(i){i=i||n.doNothing;var s={};s.run=function(){if(n.isOffline===!0){r=!1,n.showMessage("Operation not available in offline mode."),s.error();return}if(r===!0){s.success();return}e.ajax({url:"lib/github.js",dataType:"script",timeout:AJAX_TIMEOUT}).done(function(){r=!0,s.success()}).fail(function(){s.error()})},s.onSuccess=function(){i()},s.onError=function(){n.setOffline(),i()},t.addTask(s)}function u(s,a){s=s||n.doNothing,o(function(){if(r===!1){s();return}var o=undefined,f=undefined,l=localStorage.githubToken,c="Access to GitHub is not authorized.",h={};h.run=function(){if(i!==undefined){h.success();return}if(l!==undefined){i=new Github({token:l,auth:"oauth"}),h.success();return}if(a===!0){n.showError(),h.error();return}h.timeout=AUTH_POPUP_TIMEOUT,n.showMessage("Please make sure the Github authorization popup is not blocked by your browser."),localStorage.removeItem("githubCode"),f=n.popupWindow("github-oauth-client.html?client_id="+GITHUB_CLIENT_ID,"stackedit-github-oauth",960,600),f.focus(),o=setInterval(function(){var t=localStorage.githubCode;if(f.closed===!0||t!==undefined){localStorage.removeItem("githubCode");if(t===undefined){h.error();return}e.getJSON(GATEKEEPER_URL+"authenticate/"+t,function(e){e.token!==undefined?(localStorage.githubToken=e.token,h.success()):h.error()})}},500)},h.onSuccess=function(){o!==undefined&&clearInterval(o);if(i!==undefined){s();return}u(s,!0)},h.onError=function(){o!==undefined&&clearInterval(o),f!==undefined&&f.close(),n.showError(c),s()},t.addTask(h)})}var n=undefined,r=undefined,i=undefined,s={};return s.upload=function(e,s,o,a,f,l){l=l||n.doNothing,u(function(){if(i===undefined){l("error");return}var u=undefined,c={};c.run=function(){var t=i.getUser();t.show(undefined,function(t,n){if(t){u=t.error,c.error();return}var r=i.getRepo(n.login,e);r.write(s,o,a,f,function(e){if(e){u=e.error,c.error();return}c.success()})})},c.onSuccess=function(){l(u)},c.onError=function(){var e="Could not publish on GitHub.";u===401||u===403?(i=undefined,localStorage.removeItem("githubToken"),e="Access to GitHub is not authorized."):u===0&&(r=!1,i=undefined,n.setOffline()),n.showError(e),l(u)},t.addTask(c)})},s.init=function(e){n=e},s}),define("synchronizer",["jquery","google-helper","dropbox-helper"],function(e,t,n){function h(e){if(u.length===0){d(e);return}var r=u.pop();if(!r){h(e);return}var i=localStorage[r+".contentCRC"],s=localStorage[r+".titleCRC"];if(f==i&&(s===undefined||c==s)){h(e);return}v=!0,o=!0;if(r.indexOf(SYNC_PROVIDER_GDRIVE)===0){var p=r.substring(SYNC_PROVIDER_GDRIVE.length);t.upload(p,undefined,l,a,function(t){if(t!==undefined){localStorage[r+".contentCRC"]=f,localStorage[r+".titleCRC"]=c,h(e);return}e("abort");return})}else if(r.indexOf(SYNC_PROVIDER_DROPBOX)===0){var m=r.substring(SYNC_PROVIDER_DROPBOX.length);m=decodeURIComponent(m),n.upload(m,a,function(t){if(t!==undefined){localStorage[r+".contentCRC"]=f,h(e);return}e("abort");return})}else console.error("Invalid fileSyncIndex: "+r),e("error")}function d(e){if(p.length===0){m(e);return}var t=p.pop(),n=localStorage[t+".sync"];if(!t||n.length===1){d(e);return}a=localStorage[t+".content"],f=i.crc32(a),l=localStorage[t+".title"],c=i.crc32(l),u=n.split(";"),h(e)}function m(e){v===!0?(v=!1,p=localStorage["file.list"].split(";"),d(e)):e()}function g(e){if(r.useGoogleDrive===!1){e();return}var n=parseInt(localStorage[SYNC_PROVIDER_GDRIVE+"lastChangeId"]);t.checkUpdates(n,function(n,r){if(n===undefined){e("error");return}t.downloadContent(n,function(t){if(t===undefined){e("error");return}var n=!1;for(var o=0;oi.currentTime||i.isOffline)return;w=!0,v=!0,E=i.currentTime,r.updateSyncButton(),b(function(t){if(e(t))return;m(function(t){if(e(t))return;w=!1,o=!1})})},r.init=function(t,n){i=t,s=n,r.updateSyncButton(),e(".action-force-sync").click(function(){e(this).hasClass("disabled")||r.forceSync()})},r}),define("publish-github",["jquery","github-helper"],function(e,t){var n=undefined,r={publishProvider:"github"};return r.publishNew=function(e,r,i){var s=n.settings.commitMsg;t.upload(e.repository,e.branch,e.path,i,s,function(e){})},r.init=function(e){n=e},r}),define("publisher",["jquery","google-helper","github-helper","publish-github"],function(e,t,n){function a(t){return t.format===undefined&&(t.format=e("input:radio[name=radio-publish-format]:checked").prop("value")),t.format=="markdown"?e("#wmd-input").val():e("#wmd-preview").html()}function l(e,t){if(f.length===0){e(t);return}var i=f.pop();if(!i){l(e,t);return}var s=JSON.parse(localStorage[i]),o=a(s),u=r.settings.commitMsg;s.provider==PUBLISH_PROVIDER_GITHUB&&n.upload(s.repository,s.branch,s.path,o,u,function(t){l(e,t)})}var r=undefined,i=undefined,s={},o={},u=!1;s.notifyCurrentFile=function(){var e=localStorage["file.current"];localStorage[e+".publish"].length===1?u=!1:u=!0,s.updatePublishButton()},s.updatePublishButton=function(){c===!0||u===!1||r.isOffline?e(".action-force-publish").addClass("disabled"):e(".action-force-publish").removeClass("disabled")};var f=[],c=!1;return s.publish=function(){if(c===!0||r.isOffline)return;c=!0,s.updatePublishButton();var e=localStorage["file.current"],t=localStorage[e+".title"];f=localStorage[e+".publish"].split(";"),l(function(e){c=!1,s.updatePublishButton(),e===undefined&&r.showMessage('"'+t+'" successfully published.')})},s.newLocation=function(e,t){var n=localStorage["file.current"],r=localStorage[n+".title"],i=a(e)},_.each(arguments,function(e){e.publishProvider&&(o[e.publishProvider]=e)}),s.init=function(t,n){r=t,i=n,e(".action-force-publish").click(function(){e(this).hasClass("disabled")||s.publish()})},s}),define("file-manager",["jquery","google-helper","dropbox-helper","github-helper","synchronizer","publisher"],function(e,t,n,r,i,s){function f(e,n){var r=localStorage["file.current"],i=localStorage[r+".content"],s=localStorage[r+".title"];t.upload(e,n,s,i,function(e){if(e===undefined)return;var t=u.crc32(i);localStorage[e+".contentCRC"]=t;var n=u.crc32(s);localStorage[e+".titleCRC"]=n,localStorage[r+".sync"]+=e+";",d(),o.updateFileTitles(),u.showMessage('"'+s+'" will now be synchronized on Google Drive.')})}function l(e){if(!e)return;var t=SYNC_PROVIDER_GDRIVE+e,n=o.getFileIndexFromSync(t);if(n!==undefined){var r=localStorage[n+".title"];u.showError('File ID is already synchronized with "'+r+'"');return}f(e)}function c(e){if(e===undefined)return;var n=[];for(var r=0;r2?e(".msg-sync-list").removeClass("hide"):e(".msg-no-sync").removeClass("hide");for(var r=1;r").addClass("input-prepend input-append");t.indexOf(SYNC_PROVIDER_GDRIVE)===0?(n.append(e("").addClass("add-on").prop("title","Google Drive").html('')),n.append(e("").prop("type","text").prop("disabled",!0).addClass("span5").val(t.substring(SYNC_PROVIDER_GDRIVE.length)))):t.indexOf(SYNC_PROVIDER_DROPBOX)===0&&(n.append(e("").addClass("add-on").prop("title","Dropbox").html('')),n.append(e("").prop("type","text").prop("disabled",!0).addClass("span5").val(decodeURIComponent(t.substring(SYNC_PROVIDER_DROPBOX.length))))),n.append(e("").addClass("btn").html('').prop("title","Remove this location").click(function(){o.removeSync(t),o.updateFileTitles()})),e("#manage-sync-list").append(n)})(i)}}function v(){var t=localStorage["file.current"],n=localStorage[t+".publish"].split(";");e(".msg-no-publish, .msg-publish-list").addClass("hide"),e("#manage-publish-list .input-append").remove(),n.length>2?e(".msg-publish-list").removeClass("hide"):e(".msg-no-publish").removeClass("hide");for(var r=1;r").addClass("input-prepend input-append");n.provider==PUBLISH_PROVIDER_GITHUB?(i.append(e("").addClass("add-on").prop("title","GitHub").html('')),i.append(e("").prop("type","text").prop("disabled",!0).addClass("span5").val(r))):n.provider==PUBLISH_PROVIDER_BLOGGER&&(i.append(e("").addClass("add-on").prop("title","Blogger").html('')),i.append(e("").prop("type","text").prop("disabled",!0).addClass("span5").val(r))),i.append(e("").addClass("btn").html('').prop("title","Remove this location").click(function(){o.removePublish(t)})),e("#manage-publish-list").append(i)})(i,JSON.parse(s),s.replace(/{|}|"/g,""))}}function g(t,n){n=n||"markdown",m=t,e('div[class*=" modal-publish-"]').hide().filter(".modal-publish-"+t).show(),u.resetModalInputs(),e("input:radio[name=radio-publish-format][value="+n+"]").prop("checked",!0),e("#modal-publish").modal()}function y(e,t){var n=undefined;do n="publish."+u.randomString();while(localStorage[n]!==undefined);localStorage[n]=JSON.stringify(e),localStorage[t+".publish"]+=n+";"}function b(t){var n={};n.repository=u.getInputValue(e("#input-publish-github-reponame"),t),n.branch=u.getInputValue(e("#input-publish-github-branch"),t),n.path=u.getInputValue(e("#input-publish-github-path"),t),n.provider=m;if(t.isPropagationStopped())return;var i=localStorage["file.current"],o=localStorage[i+".title"],a=s.getPublishContent(n),f=u.settings.commitMsg;r.upload(n.repository,n.branch,n.path,a,f,function(e){e===undefined&&(y(n,i),v(),s.notifyCurrentFile(),u.showMessage('"'+o+'" will now be published on GitHub.'))})}function w(n){var r=u.getInputValue(e("#input-publish-blogger-url"),n);if(n.isPropagationStopped())return;t.getBlogByUrl(r,function(e){console.log(e)})}var o={},u=undefined,a=[];o.selectFile=function(t){localStorage["file.list"].length===1&&(t=this.createFile()),t!==undefined&&(u.checkWindowUnique(),localStorage["file.current"]=t),o.updateFileTitles(),d(),v(),s.notifyCurrentFile(),t=localStorage["file.current"],e("#wmd-input").val(localStorage[t+".content"]),u.createEditor(function(){o.saveFile()})},o.createFile=function(e,t,n){t=t||"",n=n||[];if(!e){e=DEFAULT_FILE_TITLE;function r(e){for(var t=0;t'+t),n.indexOf(";"+SYNC_PROVIDER_GDRIVE)!==-1&&(f=!0,t=''+t),t}a=[],e("#file-selector").empty();var t=localStorage["file.list"].split(";");for(var n=1;nt.title.toLowerCase()?1:0});var r=localStorage["file.current"];r||(u.checkWindowUnique(),r=a[0].index,localStorage["file.current"]=r);var f=!1,l=!1,s=localStorage[r+".title"];document.title="StackEdit - "+s,e("#file-title").html(c(r)),e(".file-title").text(s),e("#file-title-input").val(s),e("#file-selector").empty();for(var n=0;n").html(c(h.index)),d=e("
  • ").append(p);h.index==r?d.addClass("disabled"):p.prop("href","#").click(function(e){return function(){u.checkWindowUnique(),localStorage["file.current"]=e,o.selectFile()}}(h.index)),e("#file-selector").append(d)}i.useGoogleDrive=f,i.useDropbox=l},o.removeSync=function(e){var t=localStorage["file.current"],n=this.getFileIndexFromSync(e);n!==undefined&&(localStorage[n+".sync"]=localStorage[n+".sync"].replace(";"+e+";",";"),n==t&&d()),localStorage.removeItem(e+".etag"),localStorage.removeItem(e+".version"),localStorage.removeItem(e+".contentCRC"),localStorage.removeItem(e+".titleCRC")},o.getFileIndexFromSync=function(e){var t=localStorage["file.list"].split(";");for(var n=1;nthis.$items.length-1||t<0)return;return this.sliding?this.$element.one("slid",function(){r.to(t)}):n==t?this.pause().cycle():this.slide(t>n?"next":"prev",e(this.$items[t]))},pause:function(t){return t||(this.paused=!0),this.$element.find(".next, .prev").length&&e.support.transition.end&&(this.$element.trigger(e.support.transition.end),this.cycle()),clearInterval(this.interval),this.interval=null,this},next:function(){if(this.sliding)return;return this.slide("next")},prev:function(){if(this.sliding)return;return this.slide("prev")},slide:function(t,n){var r=this.$element.find(".item.active"),i=n||r[t](),s=this.interval,o=t=="next"?"left":"right",u=t=="next"?"first":"last",a=this,f;this.sliding=!0,s&&this.pause(),i=i.length?i:this.$element.find(".item")[u](),f=e.Event("slide",{relatedTarget:i[0],direction:o});if(i.hasClass("active"))return;this.$indicators.length&&(this.$indicators.find(".active").removeClass("active"),this.$element.one("slid",function(){var t=e(a.$indicators.children()[a.getActiveIndex()]);t&&t.addClass("active")}));if(e.support.transition&&this.$element.hasClass("slide")){this.$element.trigger(f);if(f.isDefaultPrevented())return;i.addClass(t),i[0].offsetWidth,r.addClass(o),i.addClass(o),this.$element.one(e.support.transition.end,function(){i.removeClass([t,o].join(" ")).addClass("active"),r.removeClass(["active",o].join(" ")),a.sliding=!1,setTimeout(function(){a.$element.trigger("slid")},0)})}else{this.$element.trigger(f);if(f.isDefaultPrevented())return;r.removeClass("active"),i.addClass("active"),this.sliding=!1,this.$element.trigger("slid")}return s&&this.cycle(),this}};var n=e.fn.carousel;e.fn.carousel=function(n){return this.each(function(){var r=e(this),i=r.data("carousel"),s=e.extend({},e.fn.carousel.defaults,typeof n=="object"&&n),o=typeof n=="string"?n:s.slide;i||r.data("carousel",i=new t(this,s)),typeof n=="number"?i.to(n):o?i[o]():s.interval&&i.pause().cycle()})},e.fn.carousel.defaults={interval:5e3,pause:"hover"},e.fn.carousel.Constructor=t,e.fn.carousel.noConflict=function(){return e.fn.carousel=n,this},e(document).on("click.carousel.data-api","[data-slide], [data-slide-to]",function(t){var n=e(this),r,i=e(n.attr("data-target")||(r=n.attr("href"))&&r.replace(/.*(?=#[^\s]+$)/,"")),s=e.extend({},i.data(),n.data()),o;i.carousel(s),(o=n.attr("data-slide-to"))&&i.data("carousel").pause().to(o).cycle(),t.preventDefault()})}(window.jQuery),!function(e){var t=function(t,n){this.$element=e(t),this.options=e.extend({},e.fn.collapse.defaults,n),this.options.parent&&(this.$parent=e(this.options.parent)),this.options.toggle&&this.toggle()};t.prototype={constructor:t,dimension:function(){var e=this.$element.hasClass("width");return e?"width":"height"},show:function(){var t,n,r,i;if(this.transitioning||this.$element.hasClass("in"))return;t=this.dimension(),n=e.camelCase(["scroll",t].join("-")),r=this.$parent&&this.$parent.find("> .accordion-group > .in");if(r&&r.length){i=r.data("collapse");if(i&&i.transitioning)return;r.collapse("hide"),i||r.data("collapse",null)}this.$element[t](0),this.transition("addClass",e.Event("show"),"shown"),e.support.transition&&this.$element[t](this.$element[0][n])},hide:function(){var t;if(this.transitioning||!this.$element.hasClass("in"))return;t=this.dimension(),this.reset(this.$element[t]()),this.transition("removeClass",e.Event("hide"),"hidden"),this.$element[t](0)},reset:function(e){var t=this.dimension();return this.$element.removeClass("collapse")[t](e||"auto")[0].offsetWidth,this.$element[e!==null?"addClass":"removeClass"]("collapse"),this},transition:function(t,n,r){var i=this,s=function(){n.type=="show"&&i.reset(),i.transitioning=0,i.$element.trigger(r)};this.$element.trigger(n);if(n.isDefaultPrevented())return;this.transitioning=1,this.$element[t]("in"),e.support.transition&&this.$element.hasClass("collapse")?this.$element.one(e.support.transition.end,s):s()},toggle:function(){this[this.$element.hasClass("in")?"hide":"show"]()}};var n=e.fn.collapse;e.fn.collapse=function(n){return this.each(function(){var r=e(this),i=r.data("collapse"),s=e.extend({},e.fn.collapse.defaults,r.data(),typeof n=="object"&&n);i||r.data("collapse",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.collapse.defaults={toggle:!0},e.fn.collapse.Constructor=t,e.fn.collapse.noConflict=function(){return e.fn.collapse=n,this},e(document).on("click.collapse.data-api","[data-toggle=collapse]",function(t){var n=e(this),r,i=n.attr("data-target")||t.preventDefault()||(r=n.attr("href"))&&r.replace(/.*(?=#[^\s]+$)/,""),s=e(i).data("collapse")?"toggle":n.data();n[e(i).hasClass("in")?"addClass":"removeClass"]("collapsed"),e(i).collapse(s)})}(window.jQuery),!function(e){function r(){e(t).each(function(){i(e(this)).removeClass("open")})}function i(t){var n=t.attr("data-target"),r;n||(n=t.attr("href"),n=n&&/#/.test(n)&&n.replace(/.*(?=#[^\s]*$)/,"")),r=n&&e(n);if(!r||!r.length)r=t.parent();return r}var t="[data-toggle=dropdown]",n=function(t){var n=e(t).on("click.dropdown.data-api",this.toggle);e("html").on("click.dropdown.data-api",function(){n.parent().removeClass("open")})};n.prototype={constructor:n,toggle:function(t){var n=e(this),s,o;if(n.is(".disabled, :disabled"))return;return s=i(n),o=s.hasClass("open"),r(),o||s.toggleClass("open"),n.focus(),!1},keydown:function(n){var r,s,o,u,a,f;if(!/(38|40|27)/.test(n.keyCode))return;r=e(this),n.preventDefault(),n.stopPropagation();if(r.is(".disabled, :disabled"))return;u=i(r),a=u.hasClass("open");if(!a||a&&n.keyCode==27)return n.which==27&&u.find(t).focus(),r.click();s=e("[role=menu] li:not(.divider):visible a",u);if(!s.length)return;f=s.index(s.filter(":focus")),n.keyCode==38&&f>0&&f--,n.keyCode==40&&f').appendTo(document.body),this.$backdrop.click(this.options.backdrop=="static"?e.proxy(this.$element[0].focus,this.$element[0]):e.proxy(this.hide,this)),i&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in");if(!t)return;i?this.$backdrop.one(e.support.transition.end,t):t()}else!this.isShown&&this.$backdrop?(this.$backdrop.removeClass("in"),e.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one(e.support.transition.end,t):t()):t&&t()}};var n=e.fn.modal;e.fn.modal=function(n){return this.each(function(){var r=e(this),i=r.data("modal"),s=e.extend({},e.fn.modal.defaults,r.data(),typeof n=="object"&&n);i||r.data("modal",i=new t(this,s)),typeof n=="string"?i[n]():s.show&&i.show()})},e.fn.modal.defaults={backdrop:!0,keyboard:!0,show:!0},e.fn.modal.Constructor=t,e.fn.modal.noConflict=function(){return e.fn.modal=n,this},e(document).on("click.modal.data-api",'[data-toggle="modal"]',function(t){var n=e(this),r=n.attr("href"),i=e(n.attr("data-target")||r&&r.replace(/.*(?=#[^\s]+$)/,"")),s=i.data("modal")?"toggle":e.extend({remote:!/#/.test(r)&&r},i.data(),n.data());t.preventDefault(),i.modal(s).one("hide",function(){n.focus()})})}(window.jQuery),!function(e){var t=function(e,t){this.init("tooltip",e,t)};t.prototype={constructor:t,init:function(t,n,r){var i,s,o,u,a;this.type=t,this.$element=e(n),this.options=this.getOptions(r),this.enabled=!0,o=this.options.trigger.split(" ");for(a=o.length;a--;)u=o[a],u=="click"?this.$element.on("click."+this.type,this.options.selector,e.proxy(this.toggle,this)):u!="manual"&&(i=u=="hover"?"mouseenter":"focus",s=u=="hover"?"mouseleave":"blur",this.$element.on(i+"."+this.type,this.options.selector,e.proxy(this.enter,this)),this.$element.on(s+"."+this.type,this.options.selector,e.proxy(this.leave,this)));this.options.selector?this._options=e.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},getOptions:function(t){return t=e.extend({},e.fn[this.type].defaults,this.$element.data(),t),t.delay&&typeof t.delay=="number"&&(t.delay={show:t.delay,hide:t.delay}),t},enter:function(t){var n=e(t.currentTarget)[this.type](this._options).data(this.type);if(!n.options.delay||!n.options.delay.show)return n.show();clearTimeout(this.timeout),n.hoverState="in",this.timeout=setTimeout(function(){n.hoverState=="in"&&n.show()},n.options.delay.show)},leave:function(t){var n=e(t.currentTarget)[this.type](this._options).data(this.type);this.timeout&&clearTimeout(this.timeout);if(!n.options.delay||!n.options.delay.hide)return n.hide();n.hoverState="out",this.timeout=setTimeout(function(){n.hoverState=="out"&&n.hide()},n.options.delay.hide)},show:function(){var t,n,r,i,s,o,u=e.Event("show");if(this.hasContent()&&this.enabled){this.$element.trigger(u);if(u.isDefaultPrevented())return;t=this.tip(),this.setContent(),this.options.animation&&t.addClass("fade"),s=typeof this.options.placement=="function"?this.options.placement.call(this,t[0],this.$element[0]):this.options.placement,t.detach().css({top:0,left:0,display:"block"}),this.options.container?t.appendTo(this.options.container):t.insertAfter(this.$element),n=this.getPosition(),r=t[0].offsetWidth,i=t[0].offsetHeight;switch(s){case"bottom":o={top:n.top+n.height,left:n.left+n.width/2-r/2};break;case"top":o={top:n.top-i,left:n.left+n.width/2-r/2};break;case"left":o={top:n.top+n.height/2-i/2,left:n.left-r};break;case"right":o={top:n.top+n.height/2-i/2,left:n.left+n.width}}this.applyPlacement(o,s),this.$element.trigger("shown")}},applyPlacement:function(e,t){var n=this.tip(),r=n[0].offsetWidth,i=n[0].offsetHeight,s,o,u,a;n.offset(e).addClass(t).addClass("in"),s=n[0].offsetWidth,o=n[0].offsetHeight,t=="top"&&o!=i&&(e.top=e.top+i-o,a=!0),t=="bottom"||t=="top"?(u=0,e.left<0&&(u=e.left*-2,e.left=0,n.offset(e),s=n[0].offsetWidth,o=n[0].offsetHeight),this.replaceArrow(u-r+s,s,"left")):this.replaceArrow(o-i,o,"top"),a&&n.offset(e)},replaceArrow:function(e,t,n){this.arrow().css(n,e?50*(1-e/t)+"%":"")},setContent:function(){var e=this.tip(),t=this.getTitle();e.find(".tooltip-inner")[this.options.html?"html":"text"](t),e.removeClass("fade in top bottom left right")},hide:function(){function i(){var t=setTimeout(function(){n.off(e.support.transition.end).detach()},500);n.one(e.support.transition.end,function(){clearTimeout(t),n.detach()})}var t=this,n=this.tip(),r=e.Event("hide");this.$element.trigger(r);if(r.isDefaultPrevented())return;return n.removeClass("in"),e.support.transition&&this.$tip.hasClass("fade")?i():n.detach(),this.$element.trigger("hidden"),this},fixTitle:function(){var e=this.$element;(e.attr("title")||typeof e.attr("data-original-title")!="string")&&e.attr("data-original-title",e.attr("title")||"").attr("title","")},hasContent:function(){return this.getTitle()},getPosition:function(){var t=this.$element[0];return e.extend({},typeof t.getBoundingClientRect=="function"?t.getBoundingClientRect():{width:t.offsetWidth,height:t.offsetHeight},this.$element.offset())},getTitle:function(){var e,t=this.$element,n=this.options;return e=t.attr("data-original-title")||(typeof n.title=="function"?n.title.call(t[0]):n.title),e},tip:function(){return this.$tip=this.$tip||e(this.options.template)},arrow:function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},validate:function(){this.$element[0].parentNode||(this.hide(),this.$element=null,this.options=null)},enable:function(){this.enabled=!0},disable:function(){this.enabled=!1},toggleEnabled:function(){this.enabled=!this.enabled},toggle:function(t){var n=t?e(t.currentTarget)[this.type](this._options).data(this.type):this;n.tip().hasClass("in")?n.hide():n.show()},destroy:function(){this.hide().$element.off("."+this.type).removeData(this.type)}};var n=e.fn.tooltip;e.fn.tooltip=function(n){return this.each(function(){var r=e(this),i=r.data("tooltip"),s=typeof n=="object"&&n;i||r.data("tooltip",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.tooltip.Constructor=t,e.fn.tooltip.defaults={animation:!0,placement:"top",selector:!1,template:'
    ',trigger:"hover focus",title:"",delay:0,html:!1,container:!1},e.fn.tooltip.noConflict=function(){return e.fn.tooltip=n,this}}(window.jQuery),!function(e){var t=function(e,t){this.init("popover",e,t)};t.prototype=e.extend({},e.fn.tooltip.Constructor.prototype,{constructor:t,setContent:function(){var e=this.tip(),t=this.getTitle(),n=this.getContent();e.find(".popover-title")[this.options.html?"html":"text"](t),e.find(".popover-content")[this.options.html?"html":"text"](n),e.removeClass("fade top bottom left right in")},hasContent:function(){return this.getTitle()||this.getContent()},getContent:function(){var e,t=this.$element,n=this.options;return e=(typeof n.content=="function"?n.content.call(t[0]):n.content)||t.attr("data-content"),e},tip:function(){return this.$tip||(this.$tip=e(this.options.template)),this.$tip},destroy:function(){this.hide().$element.off("."+this.type).removeData(this.type)}});var n=e.fn.popover;e.fn.popover=function(n){return this.each(function(){var r=e(this),i=r.data("popover"),s=typeof n=="object"&&n;i||r.data("popover",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.popover.Constructor=t,e.fn.popover.defaults=e.extend({},e.fn.tooltip.defaults,{placement:"right",trigger:"click",content:"",template:'

    '}),e.fn.popover.noConflict=function(){return e.fn.popover=n,this}}(window.jQuery),!function(e){function t(t,n){var r=e.proxy(this.process,this),i=e(t).is("body")?e(window):e(t),s;this.options=e.extend({},e.fn.scrollspy.defaults,n),this.$scrollElement=i.on("scroll.scroll-spy.data-api",r),this.selector=(this.options.target||(s=e(t).attr("href"))&&s.replace(/.*(?=#[^\s]+$)/,"")||"")+" .nav li > a",this.$body=e("body"),this.refresh(),this.process()}t.prototype={constructor:t,refresh:function(){var t=this,n;this.offsets=e([]),this.targets=e([]),n=this.$body.find(this.selector).map(function(){var n=e(this),r=n.data("target")||n.attr("href"),i=/^#\w/.test(r)&&e(r);return i&&i.length&&[[i.position().top+(!e.isWindow(t.$scrollElement.get(0))&&t.$scrollElement.scrollTop()),r]]||null}).sort(function(e,t){return e[0]-t[0]}).each(function(){t.offsets.push(this[0]),t.targets.push(this[1])})},process:function(){var e=this.$scrollElement.scrollTop()+this.options.offset,t=this.$scrollElement[0].scrollHeight||this.$body[0].scrollHeight,n=t-this.$scrollElement.height(),r=this.offsets,i=this.targets,s=this.activeTarget,o;if(e>=n)return s!=(o=i.last()[0])&&this.activate(o);for(o=r.length;o--;)s!=i[o]&&e>=r[o]&&(!r[o+1]||e<=r[o+1])&&this.activate(i[o])},activate:function(t){var n,r;this.activeTarget=t,e(this.selector).parent(".active").removeClass("active"),r=this.selector+'[data-target="'+t+'"],'+this.selector+'[href="'+t+'"]',n=e(r).parent("li").addClass("active"),n.parent(".dropdown-menu").length&&(n=n.closest("li.dropdown").addClass("active")),n.trigger("activate")}};var n=e.fn.scrollspy;e.fn.scrollspy=function(n){return this.each(function(){var r=e(this),i=r.data("scrollspy"),s=typeof n=="object"&&n;i||r.data("scrollspy",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.scrollspy.Constructor=t,e.fn.scrollspy.defaults={offset:10},e.fn.scrollspy.noConflict=function(){return e.fn.scrollspy=n,this},e(window).on("load",function(){e('[data-spy="scroll"]').each(function(){var t=e(this);t.scrollspy(t.data())})})}(window.jQuery),!function(e){var t=function(t){this.element=e(t)};t.prototype={constructor:t,show:function(){var t=this.element,n=t.closest("ul:not(.dropdown-menu)"),r=t.attr("data-target"),i,s,o;r||(r=t.attr("href"),r=r&&r.replace(/.*(?=#[^\s]*$)/,""));if(t.parent("li").hasClass("active"))return;i=n.find(".active:last a")[0],o=e.Event("show",{relatedTarget:i}),t.trigger(o);if(o.isDefaultPrevented())return;s=e(r),this.activate(t.parent("li"),n),this.activate(s,s.parent(),function(){t.trigger({type:"shown",relatedTarget:i})})},activate:function(t,n,r){function o(){i.removeClass("active").find("> .dropdown-menu > .active").removeClass("active"),t.addClass("active"),s?(t[0].offsetWidth,t.addClass("in")):t.removeClass("fade"),t.parent(".dropdown-menu")&&t.closest("li.dropdown").addClass("active"),r&&r()}var i=n.find("> .active"),s=r&&e.support.transition&&i.hasClass("fade");s?i.one(e.support.transition.end,o):o(),i.removeClass("in")}};var n=e.fn.tab;e.fn.tab=function(n){return this.each(function(){var r=e(this),i=r.data("tab");i||r.data("tab",i=new t(this)),typeof n=="string"&&i[n]()})},e.fn.tab.Constructor=t,e.fn.tab.noConflict=function(){return e.fn.tab=n,this},e(document).on("click.tab.data-api",'[data-toggle="tab"], [data-toggle="pill"]',function(t){t.preventDefault(),e(this).tab("show")})}(window.jQuery),!function(e){var t=function(t,n){this.$element=e(t),this.options=e.extend({},e.fn.typeahead.defaults,n),this.matcher=this.options.matcher||this.matcher,this.sorter=this.options.sorter||this.sorter,this.highlighter=this.options.highlighter||this.highlighter,this.updater=this.options.updater||this.updater,this.source=this.options.source,this.$menu=e(this.options.menu),this.shown=!1,this.listen()};t.prototype={constructor:t,select:function(){var e=this.$menu.find(".active").attr("data-value");return this.$element.val(this.updater(e)).change(),this.hide()},updater:function(e){return e},show:function(){var t=e.extend({},this.$element.position(),{height:this.$element[0].offsetHeight});return this.$menu.insertAfter(this.$element).css({top:t.top+t.height,left:t.left}).show(),this.shown=!0,this},hide:function(){return this.$menu.hide(),this.shown=!1,this},lookup:function(t){var n;return this.query=this.$element.val(),!this.query||this.query.length"+t+""})},render:function(t){var n=this;return t=e(t).map(function(t,r){return t=e(n.options.item).attr("data-value",r),t.find("a").html(n.highlighter(r)),t[0]}),t.first().addClass("active"),this.$menu.html(t),this},next:function(t){var n=this.$menu.find(".active").removeClass("active"),r=n.next();r.length||(r=e(this.$menu.find("li")[0])),r.addClass("active")},prev:function(e){var t=this.$menu.find(".active").removeClass("active"),n=t.prev();n.length||(n=this.$menu.find("li").last()),n.addClass("active")},listen:function(){this.$element.on("focus",e.proxy(this.focus,this)).on("blur",e.proxy(this.blur,this)).on("keypress",e.proxy(this.keypress,this)).on("keyup",e.proxy(this.keyup,this)),this.eventSupported("keydown")&&this.$element.on("keydown",e.proxy(this.keydown,this)),this.$menu.on("click",e.proxy(this.click,this)).on("mouseenter","li",e.proxy(this.mouseenter,this)).on("mouseleave","li",e.proxy(this.mouseleave,this))},eventSupported:function(e){var t=e in this.$element;return t||(this.$element.setAttribute(e,"return;"),t=typeof this.$element[e]=="function"),t},move:function(e){if(!this.shown)return;switch(e.keyCode){case 9:case 13:case 27:e.preventDefault();break;case 38:e.preventDefault(),this.prev();break;case 40:e.preventDefault(),this.next()}e.stopPropagation()},keydown:function(t){this.suppressKeyPressRepeat=~e.inArray(t.keyCode,[40,38,9,13,27]),this.move(t)},keypress:function(e){if(this.suppressKeyPressRepeat)return;this.move(e)},keyup:function(e){switch(e.keyCode){case 40:case 38:case 16:case 17:case 18:break;case 9:case 13:if(!this.shown)return;this.select();break;case 27:if(!this.shown)return;this.hide();break;default:this.lookup()}e.stopPropagation(),e.preventDefault()},focus:function(e){this.focused=!0},blur:function(e){this.focused=!1,!this.mousedover&&this.shown&&this.hide()},click:function(e){e.stopPropagation(),e.preventDefault(),this.select(),this.$element.focus()},mouseenter:function(t){this.mousedover=!0,this.$menu.find(".active").removeClass("active"),e(t.currentTarget).addClass("active")},mouseleave:function(e){this.mousedover=!1,!this.focused&&this.shown&&this.hide()}};var n=e.fn.typeahead;e.fn.typeahead=function(n){return this.each(function(){var r=e(this),i=r.data("typeahead"),s=typeof n=="object"&&n;i||r.data("typeahead",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.typeahead.defaults={source:[],items:8,menu:'',item:'
  • ',minLength:1},e.fn.typeahead.Constructor=t,e.fn.typeahead.noConflict=function(){return e.fn.typeahead=n,this},e(document).on("focus.typeahead.data-api",'[data-provide="typeahead"]',function(t){var n=e(this);if(n.data("typeahead"))return;n.typeahead(n.data())})}(window.jQuery),!function(e){var t=function(t,n){this.options=e.extend({},e.fn.affix.defaults,n),this.$window=e(window).on("scroll.affix.data-api",e.proxy(this.checkPosition,this)).on("click.affix.data-api",e.proxy(function(){setTimeout(e.proxy(this.checkPosition,this),1)},this)),this.$element=e(t),this.checkPosition()};t.prototype.checkPosition=function(){if(!this.$element.is(":visible"))return;var t=e(document).height(),n=this.$window.scrollTop(),r=this.$element.offset(),i=this.options.offset,s=i.bottom,o=i.top,u="affix affix-top affix-bottom",a;typeof i!="object"&&(s=o=i),typeof o=="function"&&(o=i.top()),typeof s=="function"&&(s=i.bottom()),a=this.unpin!=null&&n+this.unpin<=r.top?!1:s!=null&&r.top+this.$element.height()>=t-s?"bottom":o!=null&&n<=o?"top":!1;if(this.affixed===a)return;this.affixed=a,this.unpin=a=="bottom"?r.top-n:null,this.$element.removeClass(u).addClass("affix"+(a?"-"+a:""))};var n=e.fn.affix;e.fn.affix=function(n){return this.each(function(){var r=e(this),i=r.data("affix"),s=typeof n=="object"&&n;i||r.data("affix",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.affix.Constructor=t,e.fn.affix.defaults={offset:0},e.fn.affix.noConflict=function(){return e.fn.affix=n,this},e(window).on("load",function(){e('[data-spy="affix"]').each(function(){var t=e(this),n=t.data();n.offset=n.offset||{},n.offsetBottom&&(n.offset.bottom=n.offsetBottom),n.offsetTop&&(n.offset.top=n.offsetTop),t.affix(n)})})}(window.jQuery),define("bootstrap",function(){}),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",function(){}),function(e,t){function i(t,n){var r,i,o,u=t.nodeName.toLowerCase();return"area"===u?(r=t.parentNode,i=r.name,!t.href||!i||r.nodeName.toLowerCase()!=="map"?!1:(o=e("img[usemap=#"+i+"]")[0],!!o&&s(o))):(/input|select|textarea|button|object/.test(u)?!t.disabled:"a"===u?t.href||n:n)&&s(t)}function s(t){return e.expr.filters.visible(t)&&!e(t).parents().andSelf().filter(function(){return e.css(this,"visibility")==="hidden"}).length}var n=0,r=/^ui-id-\d+$/;e.ui=e.ui||{};if(e.ui.version)return;e.extend(e.ui,{version:"1.9.2",keyCode:{BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38}}),e.fn.extend({_focus:e.fn.focus,focus:function(t,n){return typeof t=="number"?this.each(function(){var r=this;setTimeout(function(){e(r).focus(),n&&n.call(r)},t)}):this._focus.apply(this,arguments)},scrollParent:function(){var t;return e.ui.ie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?t=this.parents().filter(function(){return/(relative|absolute|fixed)/.test(e.css(this,"position"))&&/(auto|scroll)/.test(e.css(this,"overflow")+e.css(this,"overflow-y")+e.css(this,"overflow-x"))}).eq(0):t=this.parents().filter(function(){return/(auto|scroll)/.test(e.css(this,"overflow")+e.css(this,"overflow-y")+e.css(this,"overflow-x"))}).eq(0),/fixed/.test(this.css("position"))||!t.length?e(document):t},zIndex:function(n){if(n!==t)return this.css("zIndex",n);if(this.length){var r=e(this[0]),i,s;while(r.length&&r[0]!==document){i=r.css("position");if(i==="absolute"||i==="relative"||i==="fixed"){s=parseInt(r.css("zIndex"),10);if(!isNaN(s)&&s!==0)return s}r=r.parent()}}return 0},uniqueId:function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++n)})},removeUniqueId:function(){return this.each(function(){r.test(this.id)&&e(this).removeAttr("id")})}}),e.extend(e.expr[":"],{data:e.expr.createPseudo?e.expr.createPseudo(function(t){return function(n){return!!e.data(n,t)}}):function(t,n,r){return!!e.data(t,r[3])},focusable:function(t){return i(t,!isNaN(e.attr(t,"tabindex")))},tabbable:function(t){var n=e.attr(t,"tabindex"),r=isNaN(n);return(r||n>=0)&&i(t,!r)}}),e(function(){var t=document.body,n=t.appendChild(n=document.createElement("div"));n.offsetHeight,e.extend(n.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0}),e.support.minHeight=n.offsetHeight===100,e.support.selectstart="onselectstart"in n,t.removeChild(n).style.display="none"}),e("").outerWidth(1).jquery||e.each(["Width","Height"],function(n,r){function u(t,n,r,s){return e.each(i,function(){n-=parseFloat(e.css(t,"padding"+this))||0,r&&(n-=parseFloat(e.css(t,"border"+this+"Width"))||0),s&&(n-=parseFloat(e.css(t,"margin"+this))||0)}),n}var i=r==="Width"?["Left","Right"]:["Top","Bottom"],s=r.toLowerCase(),o={innerWidth:e.fn.innerWidth,innerHeight:e.fn.innerHeight,outerWidth:e.fn.outerWidth,outerHeight:e.fn.outerHeight};e.fn["inner"+r]=function(n){return n===t?o["inner"+r].call(this):this.each(function(){e(this).css(s,u(this,n)+"px")})},e.fn["outer"+r]=function(t,n){return typeof t!="number"?o["outer"+r].call(this,t):this.each(function(){e(this).css(s,u(this,t,!0,n)+"px")})}}),e("").data("a-b","a").removeData("a-b").data("a-b")&&(e.fn.removeData=function(t){return function(n){return arguments.length?t.call(this,e.camelCase(n)):t.call(this)}}(e.fn.removeData)),function(){var t=/msie ([\w.]+)/.exec(navigator.userAgent.toLowerCase())||[];e.ui.ie=t.length?!0:!1,e.ui.ie6=parseFloat(t[1],10)===6}(),e.fn.extend({disableSelection:function(){return this.bind((e.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(e){e.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}}),e.extend(e.ui,{plugin:{add:function(t,n,r){var i,s=e.ui[t].prototype;for(i in r)s.plugins[i]=s.plugins[i]||[],s.plugins[i].push([n,r[i]])},call:function(e,t,n){var r,i=e.plugins[t];if(!i||!e.element[0].parentNode||e.element[0].parentNode.nodeType===11)return;for(r=0;r0?!0:(t[r]=1,i=t[r]>0,t[r]=0,i)},isOverAxis:function(e,t,n){return e>t&&e",options:{disabled:!1,create:null},_createWidget:function(t,r){r=e(r||this.defaultElement||this)[0],this.element=e(r),this.uuid=n++,this.eventNamespace="."+this.widgetName+this.uuid,this.options=e.widget.extend({},this.options,this._getCreateOptions(),t),this.bindings=e(),this.hoverable=e(),this.focusable=e(),r!==this&&(e.data(r,this.widgetName,this),e.data(r,this.widgetFullName,this),this._on(!0,this.element,{remove:function(e){e.target===r&&this.destroy()}}),this.document=e(r.style?r.ownerDocument:r.document||r),this.window=e(this.document[0].defaultView||this.document[0].parentWindow)),this._create(),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:e.noop,_getCreateEventData:e.noop,_create:e.noop,_init:e.noop,destroy:function(){this._destroy(),this.element.unbind(this.eventNamespace).removeData(this.widgetName).removeData(this.widgetFullName).removeData(e.camelCase(this.widgetFullName)),this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName+"-disabled "+"ui-state-disabled"),this.bindings.unbind(this.eventNamespace),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")},_destroy:e.noop,widget:function(){return this.element},option:function(n,r){var i=n,s,o,u;if(arguments.length===0)return e.widget.extend({},this.options);if(typeof n=="string"){i={},s=n.split("."),n=s.shift();if(s.length){o=i[n]=e.widget.extend({},this.options[n]);for(u=0;u=9||!!t.button?this._mouseStarted?(this._mouseDrag(t),t.preventDefault()):(this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,t)!==!1,this._mouseStarted?this._mouseDrag(t):this._mouseUp(t)),!this._mouseStarted):this._mouseUp(t)},_mouseUp:function(t){return e(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,t.target===this._mouseDownEvent.target&&e.data(t.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(t)),!1},_mouseDistanceMet:function(e){return Math.max(Math.abs(this._mouseDownEvent.pageX-e.pageX),Math.abs(this._mouseDownEvent.pageY-e.pageY))>=this.options.distance},_mouseDelayMet:function(e){return this.mouseDelayMet},_mouseStart:function(e){},_mouseDrag:function(e){},_mouseStop:function(e){},_mouseCapture:function(e){return!0}})}(jQuery),function(e,t){function h(e,t,n){return[parseInt(e[0],10)*(l.test(e[0])?t/100:1),parseInt(e[1],10)*(l.test(e[1])?n/100:1)]}function p(t,n){return parseInt(e.css(t,n),10)||0}e.ui=e.ui||{};var n,r=Math.max,i=Math.abs,s=Math.round,o=/left|center|right/,u=/top|center|bottom/,a=/[\+\-]\d+%?/,f=/^\w+/,l=/%$/,c=e.fn.position;e.position={scrollbarWidth:function(){if(n!==t)return n;var r,i,s=e("
    "),o=s.children()[0];return e("body").append(s),r=o.offsetWidth,s.css("overflow","scroll"),i=o.offsetWidth,r===i&&(i=s[0].clientWidth),s.remove(),n=r-i},getScrollInfo:function(t){var n=t.isWindow?"":t.element.css("overflow-x"),r=t.isWindow?"":t.element.css("overflow-y"),i=n==="scroll"||n==="auto"&&t.width0?"right":"center",vertical:u<0?"top":o>0?"bottom":"middle"};lr(i(o),i(u))?h.important="horizontal":h.important="vertical",t.using.call(this,e,h)}),a.offset(e.extend(C,{using:u}))})},e.ui.position={fit:{left:function(e,t){var n=t.within,i=n.isWindow?n.scrollLeft:n.offset.left,s=n.width,o=e.left-t.collisionPosition.marginLeft,u=i-o,a=o+t.collisionWidth-s-i,f;t.collisionWidth>s?u>0&&a<=0?(f=e.left+u+t.collisionWidth-s-i,e.left+=u-f):a>0&&u<=0?e.left=i:u>a?e.left=i+s-t.collisionWidth:e.left=i:u>0?e.left+=u:a>0?e.left-=a:e.left=r(e.left-o,e.left)},top:function(e,t){var n=t.within,i=n.isWindow?n.scrollTop:n.offset.top,s=t.within.height,o=e.top-t.collisionPosition.marginTop,u=i-o,a=o+t.collisionHeight-s-i,f;t.collisionHeight>s?u>0&&a<=0?(f=e.top+u+t.collisionHeight-s-i,e.top+=u-f):a>0&&u<=0?e.top=i:u>a?e.top=i+s-t.collisionHeight:e.top=i:u>0?e.top+=u:a>0?e.top-=a:e.top=r(e.top-o,e.top)}},flip:{left:function(e,t){var n=t.within,r=n.offset.left+n.scrollLeft,s=n.width,o=n.isWindow?n.scrollLeft:n.offset.left,u=e.left-t.collisionPosition.marginLeft,a=u-o,f=u+t.collisionWidth-s-o,l=t.my[0]==="left"?-t.elemWidth:t.my[0]==="right"?t.elemWidth:0,c=t.at[0]==="left"?t.targetWidth:t.at[0]==="right"?-t.targetWidth:0,h=-2*t.offset[0],p,d;if(a<0){p=e.left+l+c+h+t.collisionWidth-s-r;if(p<0||p0){d=e.left-t.collisionPosition.marginLeft+l+c+h-o;if(d>0||i(d)a&&(v<0||v0&&(d=e.top-t.collisionPosition.marginTop+c+h+p-o,e.top+c+h+p>f&&(d>0||i(d)10&&i<11,t.innerHTML="",n.removeChild(t)}(),e.uiBackCompat!==!1&&function(e){var n=e.fn.position;e.fn.position=function(r){if(!r||!r.offset)return n.call(this,r);var i=r.offset.split(" "),s=r.at.split(" ");return i.length===1&&(i[1]=i[0]),/^\d/.test(i[0])&&(i[0]="+"+i[0]),/^\d/.test(i[1])&&(i[1]="+"+i[1]),s.length===1&&(/left|center|right/.test(s[0])?s[1]="center":(s[1]=s[0],s[0]="center")),n.call(this,e.extend(r,{at:s[0]+i[0]+" "+s[1]+i[1],offset:t}))}}(jQuery)}(jQuery),function(e,t){e.widget("ui.draggable",e.ui.mouse,{version:"1.9.2",widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1},_create:function(){this.options.helper=="original"&&!/^(?:r|a|f)/.test(this.element.css("position"))&&(this.element[0].style.position="relative"),this.options.addClasses&&this.element.addClass("ui-draggable"),this.options.disabled&&this.element.addClass("ui-draggable-disabled"),this._mouseInit()},_destroy:function(){this.element.removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled"),this._mouseDestroy()},_mouseCapture:function(t){var n=this.options;return this.helper||n.disabled||e(t.target).is(".ui-resizable-handle")?!1:(this.handle=this._getHandle(t),this.handle?(e(n.iframeFix===!0?"iframe":n.iframeFix).each(function(){e('
    ').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1e3}).css(e(this).offset()).appendTo("body")}),!0):!1)},_mouseStart:function(t){var n=this.options;return this.helper=this._createHelper(t),this.helper.addClass("ui-draggable-dragging"),this._cacheHelperProportions(),e.ui.ddmanager&&(e.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(),this.offset=this.positionAbs=this.element.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},e.extend(this.offset,{click:{left:t.pageX-this.offset.left,top:t.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.originalPosition=this.position=this._generatePosition(t),this.originalPageX=t.pageX,this.originalPageY=t.pageY,n.cursorAt&&this._adjustOffsetFromHelper(n.cursorAt),n.containment&&this._setContainment(),this._trigger("start",t)===!1?(this._clear(),!1):(this._cacheHelperProportions(),e.ui.ddmanager&&!n.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,t),this._mouseDrag(t,!0),e.ui.ddmanager&&e.ui.ddmanager.dragStart(this,t),!0)},_mouseDrag:function(t,n){this.position=this._generatePosition(t),this.positionAbs=this._convertPositionTo("absolute");if(!n){var r=this._uiHash();if(this._trigger("drag",t,r)===!1)return this._mouseUp({}),!1;this.position=r.position}if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left=this.position.left+"px";if(!this.options.axis||this.options.axis!="x")this.helper[0].style.top=this.position.top+"px";return e.ui.ddmanager&&e.ui.ddmanager.drag(this,t),!1},_mouseStop:function(t){var n=!1;e.ui.ddmanager&&!this.options.dropBehaviour&&(n=e.ui.ddmanager.drop(this,t)),this.dropped&&(n=this.dropped,this.dropped=!1);var r=this.element[0],i=!1;while(r&&(r=r.parentNode))r==document&&(i=!0);if(!i&&this.options.helper==="original")return!1;if(this.options.revert=="invalid"&&!n||this.options.revert=="valid"&&n||this.options.revert===!0||e.isFunction(this.options.revert)&&this.options.revert.call(this.element,n)){var s=this;e(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){s._trigger("stop",t)!==!1&&s._clear()})}else this._trigger("stop",t)!==!1&&this._clear();return!1},_mouseUp:function(t){return e("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)}),e.ui.ddmanager&&e.ui.ddmanager.dragStop(this,t),e.ui.mouse.prototype._mouseUp.call(this,t)},cancel:function(){return this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear(),this},_getHandle:function(t){var n=!this.options.handle||!e(this.options.handle,this.element).length?!0:!1;return e(this.options.handle,this.element).find("*").andSelf().each(function(){this==t.target&&(n=!0)}),n},_createHelper:function(t){var n=this.options,r=e.isFunction(n.helper)?e(n.helper.apply(this.element[0],[t])):n.helper=="clone"?this.element.clone().removeAttr("id"):this.element;return r.parents("body").length||r.appendTo(n.appendTo=="parent"?this.element[0].parentNode:n.appendTo),r[0]!=this.element[0]&&!/(fixed|absolute)/.test(r.css("position"))&&r.css("position","absolute"),r},_adjustOffsetFromHelper:function(t){typeof t=="string"&&(t=t.split(" ")),e.isArray(t)&&(t={left:+t[0],top:+t[1]||0}),"left"in t&&(this.offset.click.left=t.left+this.margins.left),"right"in t&&(this.offset.click.left=this.helperProportions.width-t.right+this.margins.left),"top"in t&&(this.offset.click.top=t.top+this.margins.top),"bottom"in t&&(this.offset.click.top=this.helperProportions.height-t.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var t=this.offsetParent.offset();this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&e.contains(this.scrollParent[0],this.offsetParent[0])&&(t.left+=this.scrollParent.scrollLeft(),t.top+=this.scrollParent.scrollTop());if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&e.ui.ie)t={top:0,left:0};return{top:t.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:t.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var e=this.element.position();return{top:e.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:e.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var t=this.options;t.containment=="parent"&&(t.containment=this.helper[0].parentNode);if(t.containment=="document"||t.containment=="window")this.containment=[t.containment=="document"?0:e(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,t.containment=="document"?0:e(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,(t.containment=="document"?0:e(window).scrollLeft())+e(t.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(t.containment=="document"?0:e(window).scrollTop())+(e(t.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(t.containment)&&t.containment.constructor!=Array){var n=e(t.containment),r=n[0];if(!r)return;var i=n.offset(),s=e(r).css("overflow")!="hidden";this.containment=[(parseInt(e(r).css("borderLeftWidth"),10)||0)+(parseInt(e(r).css("paddingLeft"),10)||0),(parseInt(e(r).css("borderTopWidth"),10)||0)+(parseInt(e(r).css("paddingTop"),10)||0),(s?Math.max(r.scrollWidth,r.offsetWidth):r.offsetWidth)-(parseInt(e(r).css("borderLeftWidth"),10)||0)-(parseInt(e(r).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(s?Math.max(r.scrollHeight,r.offsetHeight):r.offsetHeight)-(parseInt(e(r).css("borderTopWidth"),10)||0)-(parseInt(e(r).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relative_container=n}else t.containment.constructor==Array&&(this.containment=t.containment)},_convertPositionTo:function(t,n){n||(n=this.position);var r=t=="absolute"?1:-1,i=this.options,s=this.cssPosition!="absolute"||this.scrollParent[0]!=document&&!!e.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,o=/(html|body)/i.test(s[0].tagName);return{top:n.top+this.offset.relative.top*r+this.offset.parent.top*r-(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():o?0:s.scrollTop())*r,left:n.left+this.offset.relative.left*r+this.offset.parent.left*r-(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():o?0:s.scrollLeft())*r}},_generatePosition:function(t){var n=this.options,r=this.cssPosition!="absolute"||this.scrollParent[0]!=document&&!!e.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,i=/(html|body)/i.test(r[0].tagName),s=t.pageX,o=t.pageY;if(this.originalPosition){var u;if(this.containment){if(this.relative_container){var a=this.relative_container.offset();u=[this.containment[0]+a.left,this.containment[1]+a.top,this.containment[2]+a.left,this.containment[3]+a.top]}else u=this.containment;t.pageX-this.offset.click.leftu[2]&&(s=u[2]+this.offset.click.left),t.pageY-this.offset.click.top>u[3]&&(o=u[3]+this.offset.click.top)}if(n.grid){var f=n.grid[1]?this.originalPageY+Math.round((o-this.originalPageY)/n.grid[1])*n.grid[1]:this.originalPageY;o=u?f-this.offset.click.topu[3]?f-this.offset.click.topu[2]?l-this.offset.click.left=0;l--){var c=r.snapElements[l].left,h=c+r.snapElements[l].width,p=r.snapElements[l].top,d=p+r.snapElements[l].height;if(!(c-se?0:r.max")[0],c,h=t.each;l.style.cssText="background-color:rgba(1,1,1,.5)",f.rgba=l.style.backgroundColor.indexOf("rgba")>-1,h(u,function(e,t){t.cache="_"+e,t.props.alpha={idx:3,type:"percent",def:1}}),o.fn=t.extend(o.prototype,{parse:function(r,i,s,a){if(r===n)return this._rgba=[null,null,null,null],this;if(r.jquery||r.nodeType)r=t(r).css(i),i=n;var f=this,l=t.type(r),v=this._rgba=[];i!==n&&(r=[r,i,s,a],l="array");if(l==="string")return this.parse(d(r)||c._default);if(l==="array")return h(u.rgba.props,function(e,t){v[t.idx]=p(r[t.idx],t)}),this;if(l==="object")return r instanceof o?h(u,function(e,t){r[t.cache]&&(f[t.cache]=r[t.cache].slice())}):h(u,function(t,n){var i=n.cache;h(n.props,function(e,t){if(!f[i]&&n.to){if(e==="alpha"||r[e]==null)return;f[i]=n.to(f._rgba)}f[i][t.idx]=p(r[e],t,!0)}),f[i]&&e.inArray(null,f[i].slice(0,3))<0&&(f[i][3]=1,n.from&&(f._rgba=n.from(f[i])))}),this},is:function(e){var t=o(e),n=!0,r=this;return h(u,function(e,i){var s,o=t[i.cache];return o&&(s=r[i.cache]||i.to&&i.to(r._rgba)||[],h(i.props,function(e,t){if(o[t.idx]!=null)return n=o[t.idx]===s[t.idx],n})),n}),n},_space:function(){var e=[],t=this;return h(u,function(n,r){t[r.cache]&&e.push(n)}),e.pop()},transition:function(e,t){var n=o(e),r=n._space(),i=u[r],s=this.alpha()===0?o("transparent"):this,f=s[i.cache]||i.to(s._rgba),l=f.slice();return n=n[i.cache],h(i.props,function(e,r){var i=r.idx,s=f[i],o=n[i],u=a[r.type]||{};if(o===null)return;s===null?l[i]=o:(u.mod&&(o-s>u.mod/2?s+=u.mod:s-o>u.mod/2&&(s-=u.mod)),l[i]=p((o-s)*t+s,r))}),this[r](l)},blend:function(e){if(this._rgba[3]===1)return this;var n=this._rgba.slice(),r=n.pop(),i=o(e)._rgba;return o(t.map(n,function(e,t){return(1-r)*i[t]+r*e}))},toRgbaString:function(){var e="rgba(",n=t.map(this._rgba,function(e,t){return e==null?t>2?1:0:e});return n[3]===1&&(n.pop(),e="rgb("),e+n.join()+")"},toHslaString:function(){var e="hsla(",n=t.map(this.hsla(),function(e,t){return e==null&&(e=t>2?1:0),t&&t<3&&(e=Math.round(e*100)+"%"),e});return n[3]===1&&(n.pop(),e="hsl("),e+n.join()+")"},toHexString:function(e){var n=this._rgba.slice(),r=n.pop();return e&&n.push(~~(r*255)),"#"+t.map(n,function(e){return e=(e||0).toString(16),e.length===1?"0"+e:e}).join("")},toString:function(){return this._rgba[3]===0?"transparent":this.toRgbaString()}}),o.fn.parse.prototype=o.fn,u.hsla.to=function(e){if(e[0]==null||e[1]==null||e[2]==null)return[null,null,null,e[3]];var t=e[0]/255,n=e[1]/255,r=e[2]/255,i=e[3],s=Math.max(t,n,r),o=Math.min(t,n,r),u=s-o,a=s+o,f=a*.5,l,c;return o===s?l=0:t===s?l=60*(n-r)/u+360:n===s?l=60*(r-t)/u+120:l=60*(t-n)/u+240,f===0||f===1?c=f:f<=.5?c=u/a:c=u/(2-a),[Math.round(l)%360,c,f,i==null?1:i]},u.hsla.from=function(e){if(e[0]==null||e[1]==null||e[2]==null)return[null,null,null,e[3]];var t=e[0]/360,n=e[1],r=e[2],i=e[3],s=r<=.5?r*(1+n):r+n-r*n,o=2*r-s;return[Math.round(v(o,s,t+1/3)*255),Math.round(v(o,s,t)*255),Math.round(v(o,s,t-1/3)*255),i]},h(u,function(e,r){var s=r.props,u=r.cache,a=r.to,f=r.from;o.fn[e]=function(e){a&&!this[u]&&(this[u]=a(this._rgba));if(e===n)return this[u].slice();var r,i=t.type(e),l=i==="array"||i==="object"?e:arguments,c=this[u].slice();return h(s,function(e,t){var n=l[i==="object"?e:t.idx];n==null&&(n=c[t.idx]),c[t.idx]=p(n,t)}),f?(r=o(f(c)),r[u]=c,r):o(c)},h(s,function(n,r){if(o.fn[n])return;o.fn[n]=function(s){var o=t.type(s),u=n==="alpha"?this._hsla?"hsla":"rgba":e,a=this[u](),f=a[r.idx],l;return o==="undefined"?f:(o==="function"&&(s=s.call(this,f),o=t.type(s)),s==null&&r.empty?this:(o==="string"&&(l=i.exec(s),l&&(s=f+parseFloat(l[2])*(l[1]==="+"?1:-1))),a[r.idx]=s,this[u](a)))}})}),h(r,function(e,n){t.cssHooks[n]={set:function(e,r){var i,s,u="";if(t.type(r)!=="string"||(i=d(r))){r=o(i||r);if(!f.rgba&&r._rgba[3]!==1){s=n==="backgroundColor"?e.parentNode:e;while((u===""||u==="transparent")&&s&&s.style)try{u=t.css(s,"backgroundColor"),s=s.parentNode}catch(a){}r=r.blend(u&&u!=="transparent"?u:"_default")}r=r.toRgbaString()}try{e.style[n]=r}catch(l){}}},t.fx.step[n]=function(e){e.colorInit||(e.start=o(e.elem,n),e.end=o(e.end),e.colorInit=!0),t.cssHooks[n].set(e.elem,e.start.transition(e.end,e.pos))}}),t.cssHooks.borderColor={expand:function(e){var t={};return h(["Top","Right","Bottom","Left"],function(n,r){t["border"+r+"Color"]=e}),t}},c=t.Color.names={aqua:"#00ffff",black:"#000000",blue:"#0000ff",fuchsia:"#ff00ff",gray:"#808080",green:"#008000",lime:"#00ff00",maroon:"#800000",navy:"#000080",olive:"#808000",purple:"#800080",red:"#ff0000",silver:"#c0c0c0",teal:"#008080",white:"#ffffff",yellow:"#ffff00",transparent:[null,null,null,0],_default:"#ffffff"}}(jQuery),function(){function i(){var t=this.ownerDocument.defaultView?this.ownerDocument.defaultView.getComputedStyle(this,null):this.currentStyle,n={},r,i;if(t&&t.length&&t[0]&&t[t[0]]){i=t.length;while(i--)r=t[i],typeof t[r]=="string"&&(n[e.camelCase(r)]=t[r])}else for(r in t)typeof t[r]=="string"&&(n[r]=t[r]);return n}function s(t,n){var i={},s,o;for(s in n)o=n[s],t[s]!==o&&!r[s]&&(e.fx.step[s]||!isNaN(parseFloat(o)))&&(i[s]=o);return i}var n=["add","remove","toggle"],r={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};e.each(["borderLeftStyle","borderRightStyle","borderBottomStyle","borderTopStyle"],function(t,n){e.fx.step[n]=function(e){if(e.end!=="none"&&!e.setAttr||e.pos===1&&!e.setAttr)jQuery.style(e.elem,n,e.end),e.setAttr=!0}}),e.effects.animateClass=function(t,r,o,u){var a=e.speed(r,o,u);return this.queue(function(){var r=e(this),o=r.attr("class")||"",u,f=a.children?r.find("*").andSelf():r;f=f.map(function(){var t=e(this);return{el:t,start:i.call(this)}}),u=function(){e.each(n,function(e,n){t[n]&&r[n+"Class"](t[n])})},u(),f=f.map(function(){return this.end=i.call(this.el[0]),this.diff=s(this.start,this.end),this}),r.attr("class",o),f=f.map(function(){var t=this,n=e.Deferred(),r=jQuery.extend({},a,{queue:!1,complete:function(){n.resolve(t)}});return this.el.animate(this.diff,r),n.promise()}),e.when.apply(e,f.get()).done(function(){u(),e.each(arguments,function(){var t=this.el;e.each(this.diff,function(e){t.css(e,"")})}),a.complete.call(r[0])})})},e.fn.extend({_addClass:e.fn.addClass,addClass:function(t,n,r,i){return n?e.effects.animateClass.call(this,{add:t},n,r,i):this._addClass(t)},_removeClass:e.fn.removeClass,removeClass:function(t,n,r,i){return n?e.effects.animateClass.call(this,{remove:t},n,r,i):this._removeClass(t)},_toggleClass:e.fn.toggleClass,toggleClass:function(n,r,i,s,o){return typeof r=="boolean"||r===t?i?e.effects.animateClass.call(this,r?{add:n}:{remove:n},i,s,o):this._toggleClass(n,r):e.effects.animateClass.call(this,{toggle:n},r,i,s)},switchClass:function(t,n,r,i,s){return e.effects.animateClass.call(this,{add:n,remove:t},r,i,s)}})}(),function(){function i(t,n,r,i){e.isPlainObject(t)&&(n=t,t=t.effect),t={effect:t},n==null&&(n={}),e.isFunction(n)&&(i=n,r=null,n={});if(typeof n=="number"||e.fx.speeds[n])i=r,r=n,n={};return e.isFunction(r)&&(i=r,r=null),n&&e.extend(t,n),r=r||n.duration,t.duration=e.fx.off?0:typeof r=="number"?r:r in e.fx.speeds?e.fx.speeds[r]:e.fx.speeds._default,t.complete=i||n.complete,t}function s(t){return!t||typeof t=="number"||e.fx.speeds[t]?!0:typeof t=="string"&&!e.effects.effect[t]?n&&e.effects[t]?!1:!0:!1}e.extend(e.effects,{version:"1.9.2",save:function(e,t){for(var n=0;n
    ").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),i={width:t.width(),height:t.height()},s=document.activeElement;try{s.id}catch(o){s=document.body}return t.wrap(r),(t[0]===s||e.contains(t[0],s))&&e(s).focus(),r=t.parent(),t.css("position")==="static"?(r.css({position:"relative"}),t.css({position:"relative"})):(e.extend(n,{position:t.css("position"),zIndex:t.css("z-index")}),e.each(["top","left","bottom","right"],function(e,r){n[r]=t.css(r),isNaN(parseInt(n[r],10))&&(n[r]="auto")}),t.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})),t.css(i),r.css(n).show()},removeWrapper:function(t){var n=document.activeElement;return t.parent().is(".ui-effects-wrapper")&&(t.parent().replaceWith(t),(t[0]===n||e.contains(t[0],n))&&e(n).focus()),t},setTransition:function(t,n,r,i){return i=i||{},e.each(n,function(e,n){var s=t.cssUnit(n);s[0]>0&&(i[n]=s[0]*r+s[1])}),i}}),e.fn.extend({effect:function(){function a(n){function u(){e.isFunction(i)&&i.call(r[0]),e.isFunction(n)&&n()}var r=e(this),i=t.complete,s=t.mode;(r.is(":hidden")?s==="hide":s==="show")?u():o.call(r[0],t,u)}var t=i.apply(this,arguments),r=t.mode,s=t.queue,o=e.effects.effect[t.effect],u=!o&&n&&e.effects[t.effect];return e.fx.off||!o&&!u?r?this[r](t.duration,t.complete):this.each(function(){t.complete&&t.complete.call(this)}):o?s===!1?this.each(a):this.queue(s||"fx",a):u.call(this,{options:t,duration:t.duration,callback:t.complete,mode:t.mode})},_show:e.fn.show,show:function(e){if(s(e))return this._show.apply(this,arguments);var t=i.apply(this,arguments);return t.mode="show",this.effect.call(this,t)},_hide:e.fn.hide,hide:function(e){if(s(e))return this._hide.apply(this,arguments);var t=i.apply(this,arguments);return t.mode="hide",this.effect.call(this,t)},__toggle:e.fn.toggle,toggle:function(t){if(s(t)||typeof t=="boolean"||e.isFunction(t))return this.__toggle.apply(this,arguments);var n=i.apply(this,arguments);return n.mode="toggle",this.effect.call(this,n)},cssUnit:function(t){var n=this.css(t),r=[];return e.each(["em","px","%","pt"],function(e,t){n.indexOf(t)>0&&(r=[parseFloat(n),t])}),r}})}(),function(){var t={};e.each(["Quad","Cubic","Quart","Quint","Expo"],function(e,n){t[n]=function(t){return Math.pow(t,e+2)}}),e.extend(t,{Sine:function(e){return 1-Math.cos(e*Math.PI/2)},Circ:function(e){return 1-Math.sqrt(1-e*e)},Elastic:function(e){return e===0||e===1?e:-Math.pow(2,8*(e-1))*Math.sin(((e-1)*80-7.5)*Math.PI/15)},Back:function(e){return e*e*(3*e-2)},Bounce:function(e){var t,n=4;while(e<((t=Math.pow(2,--n))-1)/11);return 1/Math.pow(4,3-n)-7.5625*Math.pow((t*3-2)/22-e,2)}}),e.each(t,function(t,n){e.easing["easeIn"+t]=n,e.easing["easeOut"+t]=function(e){return 1-n(1-e)},e.easing["easeInOut"+t]=function(e){return e<.5?n(e*2)/2:1-n(e*-2+2)/2}})}()}(jQuery),function(e,t){e.effects.effect.slide=function(t,n){var r=e(this),i=["position","top","bottom","left","right","width","height"],s=e.effects.setMode(r,t.mode||"show"),o=s==="show",u=t.direction||"left",a=u==="up"||u==="down"?"top":"left",f=u==="up"||u==="left",l,c={};e.effects.save(r,i),r.show(),l=t.distance||r[a==="top"?"outerHeight":"outerWidth"](!0),e.effects.createWrapper(r).css({overflow:"hidden"}),o&&r.css(a,f?isNaN(l)?"-"+l:-l:l),c[a]=(o?f?"+=":"-=":f?"-=":"+=")+l,r.animate(c,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){s==="hide"&&r.hide(),e.effects.restore(r,i),e.effects.removeWrapper(r),n()}})}}(jQuery),define("jquery-ui",function(){}),function($){var min=Math.min,max=Math.max,round=Math.floor,isStr=function(e){return $.type(e)==="string"},runPluginCallbacks=function(Instance,a_fn){function g(e){return e}if($.isArray(a_fn))for(var i=0,c=a_fn.length;i
    ').appendTo("body"),n={width:t.css("width")-t[0].clientWidth,height:t.height()-t[0].clientHeight};return t.remove(),window.scrollbarWidth=n.width,window.scrollbarHeight=n.height,e.match(/^(width|height)$/)?n[e]:n},showInvisibly:function(e,t){if(e&&e.length&&(t||e.css("display")==="none")){var n=e[0].style,r={display:n.display||"",visibility:n.visibility||""};return e.css({display:"block",visibility:"hidden"}),r}return{}},getElementDimensions:function(e,t){var n={css:{},inset:{}},r=n.css,i={bottom:0},s=$.layout.cssNum,o=e.offset(),u,a,f;return n.offsetLeft=o.left,n.offsetTop=o.top,t||(t={}),$.each("Left,Right,Top,Bottom".split(","),function(s,o){u=r["border"+o]=$.layout.borderWidth(e,o),a=r["padding"+o]=$.layout.cssNum(e,"padding"+o),f=o.toLowerCase(),n.inset[f]=t[f]>=0?t[f]:a,i[f]=n.inset[f]+u}),r.width=e.width(),r.height=e.height(),r.top=s(e,"top",!0),r.bottom=s(e,"bottom",!0),r.left=s(e,"left",!0),r.right=s(e,"right",!0),n.outerWidth=e.outerWidth(),n.outerHeight=e.outerHeight(),n.innerWidth=max(0,n.outerWidth-i.left-i.right),n.innerHeight=max(0,n.outerHeight-i.top-i.bottom),n.layoutWidth=e.innerWidth(),n.layoutHeight=e.innerHeight(),n},getElementStyles:function(e,t){var n={},r=e[0].style,i=t.split(","),s="Top,Bottom,Left,Right".split(","),o="Color,Style,Width".split(","),u,a,f,l,c,h;for(l=0;l=s&&a<=o&&f>=i&&f<=u},msg:function(e,t,n,r){function a(){var e=$.support.fixedPosition?"fixed":"absolute",t=$('
    '+'
    '+'XLayout console.log
    '+'
      '+"
      ").appendTo("body");return t.css("left",$(window).width()-t.outerWidth()-5),$.ui.draggable&&t.draggable({handle:":first-child"}),t}if($.isPlainObject(e)&&window.debugData){typeof t=="string"?(r=n,n=t):typeof n=="object"&&(r=n,n=null);var i=n||"log( )",s=$.extend({sort:!1,returnHTML:!1,display:!1},r);t===!0||s.display?debugData(e,i,s):window.console&&console.log(debugData(e,i,s))}else if(t)alert(e);else if(window.console)console.log(e);else{var o="#layoutLogger",u=$(o);u.length||(u=a()),u.children("ul").append('
    • '+e.replace(/\/g,">")+"
    • ")}}};var u=navigator.userAgent.toLowerCase(),m=/(chrome)[ \/]([\w.]+)/.exec(u)||/(webkit)[ \/]([\w.]+)/.exec(u)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(u)||/(msie) ([\w.]+)/.exec(u)||u.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(u)||[],b=m[1]||"",v=m[2]||0,ie=b==="msie";$.layout.browser={version:v,safari:b==="webkit",webkit:b==="chrome",msie:ie,isIE6:ie&&v==6,boxModel:!ie||$.support.boxModel!==!1},b&&($.layout.browser[b]=!0),ie&&$(function(){$.layout.browser.boxModel=$.support.boxModel}),$.layout.defaults={name:"",containerClass:"ui-layout-container",inset:null,scrollToBookmarkOnLoad:!0,resizeWithWindow:!0,resizeWithWindowDelay:200,resizeWithWindowMaxDelay:0,maskPanesEarly:!1,onresizeall_start:null,onresizeall_end:null,onload_start:null,onload_end:null,onunload_start:null,onunload_end:null,initPanes:!0,showErrorMessages:!0,showDebugMessages:!1,zIndex:null,zIndexes:{pane_normal:0,content_mask:1,resizer_normal:2,pane_sliding:100,pane_animate:1e3,resizer_drag:1e4},errors:{pane:"pane",selector:"selector",addButtonError:"Error Adding Button\nInvalid ",containerMissing:"UI Layout Initialization Error\nThe specified layout-container does not exist.",centerPaneMissing:"UI Layout Initialization Error\nThe center-pane element does not exist.\nThe center-pane is a required element.",noContainerHeight:"UI Layout Initialization Warning\nThe layout-container \"CONTAINER\" has no height.\nTherefore the layout is 0-height and hence 'invisible'!",callbackError:"UI Layout Callback Error\nThe EVENT callback is not a valid function."},panes:{applyDemoStyles:!1,closable:!0,resizable:!0,slidable:!0,initClosed:!1,initHidden:!1,contentSelector:".ui-layout-content",contentIgnoreSelector:".ui-layout-ignore",findNestedContent:!1,paneClass:"ui-layout-pane",resizerClass:"ui-layout-resizer",togglerClass:"ui-layout-toggler",buttonClass:"ui-layout-button",minSize:0,maxSize:0,spacing_open:6,spacing_closed:6,togglerLength_open:50,togglerLength_closed:50,togglerAlign_open:"center",togglerAlign_closed:"center",togglerContent_open:"",togglerContent_closed:"",resizerDblClickToggle:!0,autoResize:!0,autoReopen:!0,resizerDragOpacity:1,maskContents:!1,maskObjects:!1,maskZindex:null,resizingGrid:!1,livePaneResizing:!1,liveContentResizing:!1,liveResizingTolerance:1,sliderCursor:"pointer",slideTrigger_open:"click",slideTrigger_close:"mouseleave",slideDelay_open:300,slideDelay_close:300,hideTogglerOnSlide:!1,preventQuickSlideClose:$.layout.browser.webkit,preventPrematureSlideClose:!1,tips:{Open:"Open",Close:"Close",Resize:"Resize",Slide:"Slide Open",Pin:"Pin",Unpin:"Un-Pin",noRoomToOpen:"Not enough room to show this panel.",minSizeWarning:"Panel has reached its minimum size",maxSizeWarning:"Panel has reached its maximum size"},showOverflowOnHover:!1,enableCursorHotkey:!0,customHotkeyModifier:"SHIFT",fxName:"slide",fxSpeed:null,fxSettings:{},fxOpacityFix:!0,animatePaneSizing:!1,children:null,containerSelector:"",initChildren:!0,destroyChildren:!0,resizeChildren:!0,triggerEventsOnLoad:!1,triggerEventsDuringLiveResize:!0,onshow_start:null,onshow_end:null,onhide_start:null,onhide_end:null,onopen_start:null,onopen_end:null,onclose_start:null,onclose_end:null,onresize_start:null,onresize_end:null,onsizecontent_start:null,onsizecontent_end:null,onswap_start:null,onswap_end:null,ondrag_start:null,ondrag_end:null},north:{paneSelector:".ui-layout-north",size:"auto",resizerCursor:"n-resize",customHotkey:""},south:{paneSelector:".ui-layout-south",size:"auto",resizerCursor:"s-resize",customHotkey:""},east:{paneSelector:".ui-layout-east",size:200,resizerCursor:"e-resize",customHotkey:""},west:{paneSelector:".ui-layout-west",size:200,resizerCursor:"w-resize",customHotkey:""},center:{paneSelector:".ui-layout-center",minWidth:0,minHeight:0}},$.layout.optionsMap={layout:"name,instanceKey,stateManagement,effects,inset,zIndexes,errors,zIndex,scrollToBookmarkOnLoad,showErrorMessages,maskPanesEarly,outset,resizeWithWindow,resizeWithWindowDelay,resizeWithWindowMaxDelay,onresizeall,onresizeall_start,onresizeall_end,onload,onload_start,onload_end,onunload,onunload_start,onunload_end".split(","),center:"paneClass,contentSelector,contentIgnoreSelector,findNestedContent,applyDemoStyles,triggerEventsOnLoad,showOverflowOnHover,maskContents,maskObjects,liveContentResizing,containerSelector,children,initChildren,resizeChildren,destroyChildren,onresize,onresize_start,onresize_end,onsizecontent,onsizecontent_start,onsizecontent_end".split(","),noDefault:"paneSelector,resizerCursor,customHotkey".split(",")},$.layout.transformData=function(e,t){var n=t?{panes:{},center:{}}:{},r,i,s,o,u,a,f;if(typeof e!="object")return n;for(i in e){r=n,u=e[i],s=i.split("__"),f=s.length-1;for(a=0;a<=f;a++)o=s[a],a===f?$.isPlainObject(u)?r[o]=$.layout.transformData(u):r[o]=u:(r[o]||(r[o]={}),r=r[o])}return n},$.layout.backwardCompatibility={map:{applyDefaultStyles:"applyDemoStyles",childOptions:"children",initChildLayout:"initChildren",destroyChildLayout:"destroyChildren",resizeChildLayout:"resizeChildren",resizeNestedLayout:"resizeChildren",resizeWhileDragging:"livePaneResizing",resizeContentWhileDragging:"liveContentResizing",triggerEventsWhileDragging:"triggerEventsDuringLiveResize",maskIframesOnResize:"maskContents",useStateCookie:"stateManagement.enabled","cookie.autoLoad":"stateManagement.autoLoad","cookie.autoSave":"stateManagement.autoSave","cookie.keys":"stateManagement.stateKeys","cookie.name":"stateManagement.cookie.name","cookie.domain":"stateManagement.cookie.domain","cookie.path":"stateManagement.cookie.path","cookie.expires":"stateManagement.cookie.expires","cookie.secure":"stateManagement.cookie.secure",noRoomToOpenTip:"tips.noRoomToOpen",togglerTip_open:"tips.Close",togglerTip_closed:"tips.Open",resizerTip:"tips.Resize",sliderTip:"tips.Slide"},renameOptions:function(e){function o(t,n){var r=t.split("."),i=r.length-1,s={branch:e,key:r[i]},o=0,u,a;for(;o=37&&t<=40,u,a,f,l;return o&&options[n[t]].enableCursorHotkey?l=n[t]:(s||i)&&$.each(_c.borderPanes,function(e,n){u=options[n],a=u.customHotkey,f=u.customHotkeyModifier;if(i&&f=="SHIFT"||s&&f=="CTRL"||s&&i)if(a&&t===(isNaN(a)||a<=9?a.toUpperCase().charCodeAt(0):a))return l=n,!1}),!l||!$Ps[l]||!options[l].closable||state[l].isHidden?!0:(toggle(l),e.stopPropagation(),e.returnValue=!1,!1)}function allowOverflow(e){if(!isInitialized())return;this&&this.tagName&&(e=this);var t;isStr(e)?t=$Ps[e]:$(e).data("layoutRole")?t=$(e):$(e).parents().each(function(){if($(this).data("layoutRole"))return t=$(this),!1});if(!t||!t.length)return;var n=t.data("layoutEdge"),r=state[n];r.cssSaved&&resetOverflow(n);if(r.isSliding||r.isResizing||r.isClosed){r.cssSaved=!1;return}var i={zIndex:options.zIndexes.resizer_normal+1},s={},o=t.css("overflow"),u=t.css("overflowX"),a=t.css("overflowY");o!="visible"&&(s.overflow=o,i.overflow="visible"),u&&!u.match(/(visible|auto)/)&&(s.overflowX=u,i.overflowX="visible"),a&&!a.match(/(visible|auto)/)&&(s.overflowY=u,i.overflowY="visible"),r.cssSaved=s,t.css(i),$.each(_c.allPanes,function(e,t){t!=n&&resetOverflow(t)})}function resetOverflow(e){if(!isInitialized())return;this&&this.tagName&&(e=this);var t;isStr(e)?t=$Ps[e]:$(e).data("layoutRole")?t=$(e):$(e).parents().each(function(){if($(this).data("layoutRole"))return t=$(this),!1});if(!t||!t.length)return;var n=t.data("layoutEdge"),r=state[n],i=r.cssSaved||{};!r.isSliding&&!r.isResizing&&t.css("zIndex",options.zIndexes.pane_normal),t.css(i),r.cssSaved=!1}var browser=$.layout.browser,_c=$.layout.config,cssW=$.layout.cssWidth,cssH=$.layout.cssHeight,elDims=$.layout.getElementDimensions,styles=$.layout.getElementStyles,evtObj=$.layout.getEventObject,evtPane=$.layout.parsePaneName,options=$.extend(!0,{},$.layout.defaults),effects=options.effects=$.extend(!0,{},$.layout.effects),state={id:"layout"+$.now(),initialized:!1,paneResizing:!1,panesSliding:{},container:{innerWidth:0,innerHeight:0,outerWidth:0,outerHeight:0,layoutWidth:0,layoutHeight:0},north:{childIdx:0},south:{childIdx:0},east:{childIdx:0},west:{childIdx:0},center:{childIdx:0}},children={north:null,south:null,east:null,west:null,center:null},timer={data:{},set:function(e,t,n){timer.clear(e),timer.data[e]=setTimeout(t,n)},clear:function(e){var t=timer.data;t[e]&&(clearTimeout(t[e]),delete t[e])}},_log=function(e,t,n){var r=options;return(r.showErrorMessages&&!n||n&&r.showDebugMessages)&&$.layout.msg(r.name+" / "+e,t!==!1),!1},_runCallbacks=function(evtName,pane,skipBoundEvents){function g(e){return e}var hasPane=pane&&isStr(pane),s=hasPane?state[pane]:state,o=hasPane?options[pane]:options,lName=options.name,lng=evtName+(evtName.match(/_/)?"":"_end"),shrt=lng.match(/_end$/)?lng.substr(0,lng.length-4):"",fn=o[lng]||o[shrt],retVal="NC",args=[],$P;!hasPane&&$.type(pane)==="boolean"&&(skipBoundEvents=pane,pane="");if(fn)try{isStr(fn)&&(fn.match(/,/)?(args=fn.split(","),fn=eval(args[0])):fn=eval(fn)),$.isFunction(fn)&&(args.length?retVal=g(fn)(args[1]):hasPane?retVal=g(fn)(pane,$Ps[pane],s,o,lName):retVal=g(fn)(Instance,s,o,lName))}catch(ex){_log(options.errors.callbackError.replace(/EVENT/,$.trim((pane||"")+" "+lng)),!1),$.type(ex)==="string"&&string.length&&_log("Exception: "+ex,!1)}return!skipBoundEvents&&retVal!==!1&&(hasPane?($P=$Ps[pane],o=options[pane],s=state[pane],$P.triggerHandler("layoutpane"+lng,[pane,$P,s,o,lName]),shrt&&$P.triggerHandler("layoutpane"+shrt,[pane,$P,s,o,lName])):($N.triggerHandler("layout"+lng,[Instance,s,o,lName]),shrt&&$N.triggerHandler("layout"+shrt,[Instance,s,o,lName]))),hasPane&&evtName==="onresize_end"&&resizeChildren(pane+"",!0),retVal},_fixIframe=function(e){if(browser.mozilla)return;var t=$Ps[e];state[e].tagName==="IFRAME"?t.css(_c.hidden).css(_c.visible):t.find("IFRAME").css(_c.hidden).css(_c.visible)},cssSize=function(e,t){var n=_c[e].dir=="horz"?cssH:cssW;return n($Ps[e],t)},cssMinDims=function(e){var t=$Ps[e],n=_c[e].dir,r={minWidth:1001-cssW(t,1e3),minHeight:1001-cssH(t,1e3)};return n==="horz"&&(r.minSize=r.minHeight),n==="vert"&&(r.minSize=r.minWidth),r},setOuterWidth=function(e,t,n){var r=e,i;isStr(e)?r=$Ps[e]:e.jquery||(r=$(e)),i=cssW(r,t),r.css({width:i}),i>0?n&&r.data("autoHidden")&&r.innerHeight()>0&&(r.show().data("autoHidden",!1),browser.mozilla||r.css(_c.hidden).css(_c.visible)):n&&!r.data("autoHidden")&&r.hide().data("autoHidden",!0)},setOuterHeight=function(e,t,n){var r=e,i;isStr(e)?r=$Ps[e]:e.jquery||(r=$(e)),i=cssH(r,t),r.css({height:i,visibility:"visible"}),i>0&&r.innerWidth()>0?n&&r.data("autoHidden")&&(r.show().data("autoHidden",!1),browser.mozilla||r.css(_c.hidden).css(_c.visible)):n&&!r.data("autoHidden")&&r.hide().data("autoHidden",!0)},_parseSize=function(e,t,n){n||(n=_c[e].dir),isStr(t)&&t.match(/%/)&&(t=t==="100%"?-1:parseInt(t,10)/100);if(t===0)return 0;if(t>=1)return parseInt(t,10);var r=options,i=0;n=="horz"?i=sC.innerHeight-($Ps.north?r.north.spacing_open:0)-($Ps.south?r.south.spacing_open:0):n=="vert"&&(i=sC.innerWidth-($Ps.west?r.west.spacing_open:0)-($Ps.east?r.east.spacing_open:0));if(t===-1)return i;if(t>0)return round(i*t);if(e=="center")return 0;var s=n==="horz"?"height":"width",o=$Ps[e],u=s==="height"?$Cs[e]:!1,a=$.layout.showInvisibly(o),f=o.css(s),l=u?u.css(s):0;return o.css(s,"auto"),u&&u.css(s,"auto"),t=s==="height"?o.outerHeight():o.outerWidth(),o.css(s,f).css(a),u&&u.css(s,l),t},getPaneSize=function(e,t){var n=$Ps[e],r=options[e],i=state[e],s=t?r.spacing_open:0,o=t?r.spacing_closed:0;return!n||i.isHidden?0:i.isClosed||i.isSliding&&t?o:_c[e].dir==="horz"?n.outerHeight()+s:n.outerWidth()+s},setSizeLimits=function(e,t){if(!isInitialized())return;var n=options[e],r=state[e],i=_c[e],s=i.dir,o=i.sizeType.toLowerCase(),u=t!=undefined?t:r.isSliding,a=$Ps[e],f=n.spacing_open,l=_c.oppositeEdge[e],c=state[l],h=$Ps[l],p=!h||c.isVisible===!1||c.isSliding?0:s=="horz"?h.outerHeight():h.outerWidth(),d=(!h||c.isHidden?0:options[l][c.isClosed!==!1?"spacing_closed":"spacing_open"])||0,v=s=="horz"?sC.innerHeight:sC.innerWidth,m=cssMinDims("center"),g=s=="horz"?max(options.center.minHeight,m.minHeight):max(options.center.minWidth,m.minWidth),y=v-f-(u?0:_parseSize("center",g,s)+p+d),b=r.minSize=max(_parseSize(e,n.minSize),cssMinDims(e).minSize),w=r.maxSize=min(n.maxSize?_parseSize(e,n.maxSize):1e5,y),E=r.resizerPosition={},S=sC.inset.top,x=sC.inset.left,T=sC.innerWidth,N=sC.innerHeight,C=n.spacing_open;switch(e){case"north":E.min=S+b,E.max=S+w;break;case"west":E.min=x+b,E.max=x+w;break;case"south":E.min=S+N-w-C,E.max=S+N-b-C;break;case"east":E.min=x+T-w-C,E.max=x+T-b-C}},calcNewCenterPaneDims=function(){var e={top:getPaneSize("north",!0),bottom:getPaneSize("south",!0),left:getPaneSize("west",!0),right:getPaneSize("east",!0),width:0,height:0};return e.width=sC.innerWidth-e.left-e.right,e.height=sC.innerHeight-e.bottom-e.top,e.top+=sC.inset.top,e.bottom+=sC.inset.bottom,e.left+=sC.inset.left,e.right+=sC.inset.right,e},getHoverClasses=function(e,t){var n=$(e),r=n.data("layoutRole"),i=n.data("layoutEdge"),s=options[i],o=s[r+"Class"],u="-"+i,a="-open",f="-closed",l="-sliding",c="-hover ",h=n.hasClass(o+f)?f:a,p=h===f?a:f,d=o+c+(o+u+c)+(o+h+c)+(o+u+h+c);return t&&(d+=o+p+c+(o+u+p+c)),r=="resizer"&&n.hasClass(o+l)&&(d+=o+l+c+(o+u+l+c)),$.trim(d)},addHover=function(e,t){var n=$(t||this);e&&n.data("layoutRole")==="toggler"&&e.stopPropagation(),n.addClass(getHoverClasses(n))},removeHover=function(e,t){var n=$(t||this);n.removeClass(getHoverClasses(n,!0))},onResizerEnter=function(e){var t=$(this).data("layoutEdge"),n=state[t];if(n.isClosed||n.isResizing||state.paneResizing)return;$.fn.disableSelection&&$("body").disableSelection(),options.maskPanesEarly&&showMasks(t,{resizing:!0})},onResizerLeave=function(e,t){var n=t||this,r=$(n).data("layoutEdge"),i=r+"ResizerLeave";timer.clear(r+"_openSlider"),timer.clear(i),t?state.paneResizing||($.fn.enableSelection&&$("body").enableSelection(),options.maskPanesEarly&&hideMasks()):timer.set(i,function(){onResizerLeave(e,n)},200)},_create=function(){initOptions();var e=options,t=state;return t.creatingLayout=!0,runPluginCallbacks(Instance,$.layout.onCreate),!1===_runCallbacks("onload_start")?"cancel":(_initContainer(),initHotkeys(),$(window).bind("unload."+sID,unload),runPluginCallbacks(Instance,$.layout.onLoad),e.initPanes&&_initLayoutElements(),delete t.creatingLayout,state.initialized)},isInitialized=function(){return state.initialized||state.creatingLayout?!0:_initLayoutElements()},_initLayoutElements=function(e){var t=options;if(!$N.is(":visible"))return!e&&browser.webkit&&$N[0].tagName==="BODY"&&setTimeout(function(){_initLayoutElements(!0)},50),!1;if(!getPane("center").length)return _log(t.errors.centerPaneMissing);state.creatingLayout=!0,$.extend(sC,elDims($N,t.inset)),initPanes();if(t.scrollToBookmarkOnLoad){var n=self.location;n.hash&&n.replace(n.hash)}return Instance.hasParentLayout?t.resizeWithWindow=!1:t.resizeWithWindow&&$(window).bind("resize."+sID,windowResize),delete state.creatingLayout,state.initialized=!0,runPluginCallbacks(Instance,$.layout.onReady),_runCallbacks("onload_end"),!0},createChildren=function(e,t){var n=evtPane.call(this,e),r=$Ps[n];if(!r)return;var i=$Cs[n],s=state[n],o=options[n],u=options.stateManagement||{},a=t?o.children=t:o.children;if($.isPlainObject(a))a=[a];else if(!a||!$.isArray(a))return;$.each(a,function(e,t){if(!$.isPlainObject(t))return;var o=t.containerSelector?r.find(t.containerSelector):i||r;o.each(function(){var e=$(this),r=e.data("layout");if(!r){setInstanceKey({container:e,options:t},s);if(u.includeChildren&&state.stateData[n]){var i=state.stateData[n].children||{},o=i[t.instanceKey],a=t.stateManagement||(t.stateManagement={autoLoad:!0});a.autoLoad===!0&&o&&(a.autoSave=!1,a.includeChildren=!0,a.autoLoad=$.extend(!0,{},o))}r=e.layout(t),r&&refreshChildren(n,r)}})})},setInstanceKey=function(e,t){var n=e.container,r=e.options,i=r.stateManagement,s=r.instanceKey||n.data("layoutInstanceKey");return s||(s=(i&&i.cookie?i.cookie.name:"")||r.name),s?s=s.replace(/[^\w-]/gi,"_").replace(/_{2,}/g,"_"):s="layout"+ ++t.childIdx,r.instanceKey=s,n.data("layoutInstanceKey",s),s},refreshChildren=function(e,t){var n=$Ps[e],r=children[e],i=state[e],s;$.isPlainObject(r)&&($.each(r,function(e,t){t.destroyed&&delete r[e]}),$.isEmptyObject(r)&&(r=children[e]=null)),!t&&!r&&(t=n.data("layout")),t&&(t.hasParentLayout=!0,s=t.options,setInstanceKey(t,i),r||(r=children[e]={}),r[s.instanceKey]=t.container.data("layout")),Instance[e].children=children[e],t||createChildren(e)},windowResize=function(){var e=options,t=Number(e.resizeWithWindowDelay);t<10&&(t=100),timer.clear("winResize"),timer.set("winResize",function(){timer.clear("winResize"),timer.clear("winResizeRepeater");var t=elDims($N,e.inset);(t.innerWidth!==sC.innerWidth||t.innerHeight!==sC.innerHeight)&&resizeAll()},t),timer.data.winResizeRepeater||setWindowResizeRepeater()},setWindowResizeRepeater=function(){var e=Number(options.resizeWithWindowMaxDelay);e>0&&timer.set("winResizeRepeater",function(){setWindowResizeRepeater(),resizeAll()},e)},unload=function(){var e=options;_runCallbacks("onunload_start"),runPluginCallbacks(Instance,$.layout.onUnload),_runCallbacks("onunload_end")},_initContainer=function(){var e=$N[0],t=$("html"),n=sC.tagName=e.tagName,r=sC.id=e.id,i=sC.className=e.className,s=options,o=s.name,u="position,margin,padding,border",a="layoutCSS",f={},l="hidden",c=$N.data("parentLayout"),h=$N.data("layoutEdge"),p=c&&h,d=$.layout.cssNum,v,m;sC.selector=$N.selector.split(".slice")[0],sC.ref=(s.name?s.name+" layout / ":"")+n+(r?"#"+r:i?".["+i+"]":""),sC.isBody=n==="BODY",!p&&!sC.isBody&&(v=$N.closest("."+$.layout.defaults.panes.paneClass),c=v.data("parentLayout"),h=v.data("layoutEdge"),p=c&&h),$N.data({layout:Instance,layoutContainer:sID}).addClass(s.containerClass);var g={destroy:"",initPanes:"",resizeAll:"resizeAll",resize:"resizeAll"};for(o in g)$N.bind("layout"+o.toLowerCase()+"."+sID,Instance[g[o]||o]);p&&(Instance.hasParentLayout=!0,c.refreshChildren(h,Instance)),$N.data(a)||(sC.isBody?($N.data(a,$.extend(styles($N,u),{height:$N.css("height"),overflow:$N.css("overflow"),overflowX:$N.css("overflowX"),overflowY:$N.css("overflowY")})),t.data(a,$.extend(styles(t,"padding"),{height:"auto",overflow:t.css("overflow"),overflowX:t.css("overflowX"),overflowY:t.css("overflowY")}))):$N.data(a,styles($N,u+",top,bottom,left,right,width,height,overflow,overflowX,overflowY")));try{f={overflow:l,overflowX:l,overflowY:l},$N.css(f),s.inset&&!$.isPlainObject(s.inset)&&(m=parseInt(s.inset,10)||0,s.inset={top:m,bottom:m,left:m,right:m});if(sC.isBody)s.outset?$.isPlainObject(s.outset)||(m=parseInt(s.outset,10)||0,s.outset={top:m,bottom:m,left:m,right:m}):s.outset={top:d(t,"paddingTop"),bottom:d(t,"paddingBottom"),left:d(t,"paddingLeft"),right:d(t,"paddingRight")},t.css(f).css({height:"100%",border:"none",padding:0,margin:0}),browser.isIE6?($N.css({width:"100%",height:"100%",border:"none",padding:0,margin:0,position:"relative"}),s.inset||(s.inset=elDims($N).inset)):($N.css({width:"auto",height:"auto",margin:0,position:"absolute"}),$N.css(s.outset)),$.extend(sC,elDims($N,s.inset));else{var y=$N.css("position");(!y||!y.match(/(fixed|absolute|relative)/))&&$N.css("position","relative"),$N.is(":visible")&&($.extend(sC,elDims($N,s.inset)),sC.innerHeight<1&&_log(s.errors.noContainerHeight.replace(/CONTAINER/,sC.ref)))}d($N,"minWidth")&&$N.parent().css("overflowX","auto"),d($N,"minHeight")&&$N.parent().css("overflowY","auto")}catch(b){}},initHotkeys=function(e){e=e?e.split(","):_c.borderPanes,$.each(e,function(e,t){var n=options[t];if(n.enableCursorHotkey||n.customHotkey)return $(document).bind("keydown."+sID,keyDown),!1})},initOptions=function(){function c(e){var t=options[e],n=options.panes;t.fxSettings||(t.fxSettings={}),n.fxSettings||(n.fxSettings={}),$.each(["_open","_close","_size"],function(r,i){var s="fxName"+i,o="fxSpeed"+i,u="fxSettings"+i,a=t[s]=t[s]||n[s]||t.fxName||n.fxName||"none",f=$.effects&&($.effects[a]||$.effects.effect&&$.effects.effect[a]);if(a==="none"||!options.effects[a]||!f)a=t[s]="none";var l=options.effects[a]||{},c=l.all||null,h=l[e]||null;t[o]=t[o]||n[o]||t.fxSpeed||n.fxSpeed||null,t[u]=$.extend(!0,{},c,h,n.fxSettings,t.fxSettings,n[u],t[u])}),delete t.fxName,delete t.fxSpeed,delete t.fxSettings}var e,t,n,r,i,s,o,u;opts=$.layout.transformData(opts,!0),opts=$.layout.backwardCompatibility.renameAllOptions(opts);if(!$.isEmptyObject(opts.panes)){e=$.layout.optionsMap.noDefault;for(s=0,o=e.length;s0&&(l.pane_normal=f,l.content_mask=max(f+1,l.content_mask),l.resizer_normal=max(f+2,l.resizer_normal)),delete options.panes},getPane=function(e){var t=options[e].paneSelector;if(t.substr(0,1)==="#")return $N.find(t).eq(0);var n=$N.children(t).eq(0);return n.length?n:$N.children("form:first").children(t).eq(0)},initPanes=function(e){evtPane(e),$.each(_c.allPanes,function(e,t){addPane(t,!0)}),initHandles(),$.each(_c.borderPanes,function(e,t){$Ps[t]&&state[t].isVisible&&(setSizeLimits(t),makePaneFit(t))}),sizeMidPanes("center"),$.each(_c.allPanes,function(e,t){afterInitPane(t)})},addPane=function(e,t){if(!t&&!isInitialized())return;var n=options[e],r=state[e],i=_c[e],s=i.dir,o=r.fx,u=n.spacing_open||0,a=e==="center",f={},l=$Ps[e],c,h,p,d;l?removePane(e,!1,!0,!1):$Cs[e]=!1,l=$Ps[e]=getPane(e);if(!l.length){$Ps[e]=!1;return}if(!l.data("layoutCSS")){var v="position,top,left,bottom,right,width,height,overflow,zIndex,display,backgroundColor,padding,margin,border";l.data("layoutCSS",styles(l,v))}Instance[e]={name:e,pane:$Ps[e],content:$Cs[e],options:options[e],state:state[e],children:children[e]},l.data({parentLayout:Instance,layoutPane:Instance[e],layoutEdge:e,layoutRole:"pane"}).css(i.cssReq).css("zIndex",options.zIndexes.pane_normal).css(n.applyDemoStyles?i.cssDemo:{}).addClass(n.paneClass+" "+n.paneClass+"-"+e).bind("mouseenter."+sID,addHover).bind("mouseleave."+sID,removeHover);var m={hide:"",show:"",toggle:"",close:"",open:"",slideOpen:"",slideClose:"",slideToggle:"",size:"sizePane",sizePane:"sizePane",sizeContent:"",sizeHandles:"",enableClosable:"",disableClosable:"",enableSlideable:"",disableSlideable:"",enableResizable:"",disableResizable:"",swapPanes:"swapPanes",swap:"swapPanes",move:"swapPanes",removePane:"removePane",remove:"removePane",createChildren:"",resizeChildren:"",resizeAll:"resizeAll",resizeLayout:"resizeAll"},g;for(g in m)l.bind("layoutpane"+g.toLowerCase()+"."+sID,Instance[m[g]||g]);initContent(e,!1),a||(c=r.size=_parseSize(e,n.size),h=_parseSize(e,n.minSize)||1,p=_parseSize(e,n.maxSize)||1e5,c>0&&(c=max(min(c,p),h)),r.autoResize=n.autoResize,r.isClosed=!1,r.isSliding=!1,r.isResizing=!1,r.isHidden=!1,r.pins||(r.pins=[])),r.tagName=l[0].tagName,r.edge=e,r.noRoom=!1,r.isVisible=!0,setPanePosition(e),s==="horz"?f.height=cssH(l,c):s==="vert"&&(f.width=cssW(l,c)),l.css(f),s!="horz"&&sizeMidPanes(e,!0),state.initialized&&(initHandles(e),initHotkeys(e)),n.initClosed&&n.closable&&!n.initHidden?close(e,!0,!0):n.initHidden||n.initClosed?hide(e):r.noRoom||l.css("display","block"),l.css("visibility","visible"),n.showOverflowOnHover&&l.hover(allowOverflow,resetOverflow),state.initialized&&afterInitPane(e)},afterInitPane=function(e){var t=$Ps[e],n=state[e],r=options[e];if(!t)return;t.data("layout")&&refreshChildren(e,t.data("layout")),n.isVisible&&(state.initialized?resizeAll():sizeContent(e),r.triggerEventsOnLoad?_runCallbacks("onresize_end",e):resizeChildren(e,!0)),r.initChildren&&r.children&&createChildren(e)},setPanePosition=function(e){e=e?e.split(","):_c.borderPanes,$.each(e,function(e,t){var n=$Ps[t],r=$Rs[t],i=options[t],s=state[t],o=_c[t].side,u={};if(!n)return;switch(t){case"north":u.top=sC.inset.top,u.left=sC.inset.left,u.right=sC.inset.right;break;case"south":u.bottom=sC.inset.bottom,u.left=sC.inset.left,u.right=sC.inset.right;break;case"west":u.left=sC.inset.left;break;case"east":u.right=sC.inset.right;break;case"center":}n.css(u),r&&s.isClosed?r.css(o,sC.inset[o]):r&&!s.isHidden&&r.css(o,sC.inset[o]+getPaneSize(t))})},initHandles=function(e){e=e?e.split(","):_c.borderPanes,$.each(e,function(e,t){var n=$Ps[t];$Rs[t]=!1,$Ts[t]=!1;if(!n)return;var r=options[t],i=state[t],s=_c[t],o=r.paneSelector.substr(0,1)==="#"?r.paneSelector.substr(1):"",u=r.resizerClass,a=r.togglerClass,f=i.isVisible?r.spacing_open:r.spacing_closed,l="-"+t,c=i.isVisible?"-open":"-closed",h=Instance[t],p=h.resizer=$Rs[t]=$("
      "),d=h.toggler=r.closable?$Ts[t]=$("
      "):!1;!i.isVisible&&r.slidable&&p.attr("title",r.tips.Slide).css("cursor",r.sliderCursor),p.attr("id",o?o+"-resizer":"").data({parentLayout:Instance,layoutPane:Instance[t],layoutEdge:t,layoutRole:"resizer"}).css(_c.resizers.cssReq).css("zIndex",options.zIndexes.resizer_normal).css(r.applyDemoStyles?_c.resizers.cssDemo:{}).addClass(u+" "+u+l).hover(addHover,removeHover).hover(onResizerEnter,onResizerLeave).appendTo($N),r.resizerDblClickToggle&&p.bind("dblclick."+sID,toggle),d&&(d.attr("id",o?o+"-toggler":"").data({parentLayout:Instance,layoutPane:Instance[t],layoutEdge:t,layoutRole:"toggler"}).css(_c.togglers.cssReq).css(r.applyDemoStyles?_c.togglers.cssDemo:{}).addClass(a+" "+a+l).hover(addHover,removeHover).bind("mouseenter",onResizerEnter).appendTo(p),r.togglerContent_open&&$(""+r.togglerContent_open+"").data({layoutEdge:t,layoutRole:"togglerContent"}).data("layoutRole","togglerContent").data("layoutEdge",t).addClass("content content-open").css("display","none").appendTo(d),r.togglerContent_closed&&$(""+r.togglerContent_closed+"").data({layoutEdge:t,layoutRole:"togglerContent"}).addClass("content content-closed").css("display","none").appendTo(d),enableClosable(t)),initResizable(t),i.isVisible?setAsOpen(t):(setAsClosed(t),bindStartSlidingEvents(t,!0))}),sizeHandles()},initContent=function(e,t){if(!isInitialized())return;var n=options[e],r=n.contentSelector,i=Instance[e],s=$Ps[e],o;r&&(o=i.content=$Cs[e]=n.findNestedContent?s.find(r).eq(0):s.children(r).eq(0)),o&&o.length?(o.data("layoutRole","content"),o.data("layoutCSS")||o.data("layoutCSS",styles(o,"height")),o.css(_c.content.cssReq),n.applyDemoStyles&&(o.css(_c.content.cssDemo),s.css(_c.content.cssDemoPane)),s.css("overflowX").match(/(scroll|auto)/)&&s.css("overflow","hidden"),state[e].content={},t!==!1&&sizeContent(e)):i.content=$Cs[e]=!1},initResizable=function(e){var t=$.layout.plugins.draggable,n;e=e?e.split(","):_c.borderPanes,$.each(e,function(e,n){var i=options[n];if(!t||!$Ps[n]||!i.resizable)return i.resizable=!1,!0;var s=state[n],o=options.zIndexes,u=_c[n],a=u.dir=="horz"?"top":"left",f=$Ps[n],l=$Rs[n],c=i.resizerClass,h=0,p,d,v=c+"-drag",m=c+"-"+n+"-drag",g=c+"-dragging",y=c+"-"+n+"-dragging",b=c+"-dragging-limit",w=c+"-"+n+"-dragging-limit",E=!1;s.isClosed||l.attr("title",i.tips.Resize).css("cursor",i.resizerCursor),l.draggable({containment:$N[0],axis:u.dir=="horz"?"y":"x",delay:0,distance:1,grid:i.resizingGrid,helper:"clone",opacity:i.resizerDragOpacity,addClasses:!1,zIndex:o.resizer_drag,start:function(e,t){i=options[n],s=state[n],d=i.livePaneResizing;if(!1===_runCallbacks("ondrag_start",n))return!1;s.isResizing=!0,state.paneResizing=n,timer.clear(n+"_closeSlider"),setSizeLimits(n),p=s.resizerPosition,h=t.position[a],l.addClass(v+" "+m),E=!1,$("body").disableSelection(),showMasks(n,{resizing:!0})},drag:function(e,t){E||(t.helper.addClass(g+" "+y).css({right:"auto",bottom:"auto"}).children().css("visibility","hidden"),E=!0,s.isSliding&&$Ps[n].css("zIndex",o.pane_sliding));var u=0;t.position[a]p.max&&(t.position[a]=p.max,u=1),u?(t.helper.addClass(b+" "+w),window.defaultStatus=u>0&&n.match(/(north|west)/)||u<0&&n.match(/(south|east)/)?i.tips.maxSizeWarning:i.tips.minSizeWarning):(t.helper.removeClass(b+" "+w),window.defaultStatus=""),d&&Math.abs(t.position[a]-h)>=i.liveResizingTolerance&&(h=t.position[a],r(e,t,n))},stop:function(e,t){$("body").enableSelection(),window.defaultStatus="",l.removeClass(v+" "+m),s.isResizing=!1,state.paneResizing=!1,r(e,t,n,!0)}})});var r=function(e,t,n,r){var i=t.position,s=_c[n],o=options[n],u=state[n],a;switch(n){case"north":a=i.top;break;case"west":a=i.left;break;case"south":a=sC.layoutHeight-i.top-o.spacing_open;break;case"east":a=sC.layoutWidth-i.left-o.spacing_open}var f=a-sC.inset[s.side];if(!r){if(Math.abs(f-u.size)=0;t--)r=$Ms.eq(t),n=r.data("layoutMask"),options[n].maskObjects||r.hide()}},getMasks=function(e){var t=$([]),n,r=0,i=$Ms.length;for(;rf.maxSize)return syncPinBtns(i,!1),!r&&a.tips.noRoomToOpen&&alert(a.tips.noRoomToOpen),e();t?bindStopSlidingEvents(i,!0):f.isSliding?bindStopSlidingEvents(i,!1):a.slidable&&bindStartSlidingEvents(i,!1),f.noRoom=!1,makePaneFit(i),h=f.isShowing,delete f.isShowing,c=!n&&f.isClosed&&a.fxName_open!="none",f.isMoving=!0,f.isVisible=!0,f.isClosed=!1,h&&(f.isHidden=!1),c?(lockPaneForFX(i,!0),s.show(a.fxName_open,a.fxSettings_open,a.fxSpeed_open,function(){lockPaneForFX(i,!1),f.isVisible&&p(),e()})):(_showPane(i),p(),e())})},setAsOpen=function(e,t){var n=$Ps[e],r=$Rs[e],i=$Ts[e],s=options[e],o=state[e],u=_c[e].side,a=s.resizerClass,f=s.togglerClass,l="-"+e,c="-open",h="-closed",p="-sliding";r.css(u,sC.inset[u]+getPaneSize(e)).removeClass(a+h+" "+a+l+h).addClass(a+c+" "+a+l+c),o.isSliding?r.addClass(a+p+" "+a+l+p):r.removeClass(a+p+" "+a+l+p),removeHover(0,r),s.resizable&&$.layout.plugins.draggable?r.draggable("enable").css("cursor",s.resizerCursor).attr("title",s.tips.Resize):o.isSliding||r.css("cursor","default"),i&&(i.removeClass(f+h+" "+f+l+h).addClass(f+c+" "+f+l+c).attr("title",s.tips.Close),removeHover(0,i),i.children(".content-closed").hide(),i.children(".content-open").css("display","block")),syncPinBtns(e,!o.isSliding),$.extend(o,elDims(n)),state.initialized&&(sizeHandles(),sizeContent(e,!0)),!t&&(state.initialized||s.triggerEventsOnLoad)&&n.is(":visible")&&(_runCallbacks("onopen_end",e),o.isShowing&&_runCallbacks("onshow_end",e),state.initialized&&_runCallbacks("onresize_end",e))},slideOpen=function(e){function s(){r.isClosed?r.isMoving||open(n,!0):bindStopSlidingEvents(n,!0)}if(!isInitialized())return;var t=evtObj(e),n=evtPane.call(this,e),r=state[n],i=options[n].slideDelay_open;t&&t.stopImmediatePropagation(),r.isClosed&&t&&t.type==="mouseenter"&&i>0?timer.set(n+"_openSlider",s,i):s()},slideClose=function(e){function o(){i.isClosed?bindStopSlidingEvents(n,!1):i.isMoving||close(n)}if(!isInitialized())return;var t=evtObj(e),n=evtPane.call(this,e),r=options[n],i=state[n],s=i.isMoving?1e3:300;if(i.isClosed||i.isResizing)return;if(r.slideTrigger_close==="click")o();else{if(r.preventQuickSlideClose&&i.isMoving)return;if(r.preventPrematureSlideClose&&t&&$.layout.isMouseOverElem(t,$Ps[n]))return;t?timer.set(n+"_closeSlider",o,max(r.slideDelay_close,s)):o()}},slideToggle=function(e){var t=evtPane.call(this,e);toggle(t,!0)},lockPaneForFX=function(e,t){var n=$Ps[e],r=state[e],i=options[e],s=options.zIndexes;t?(showMasks(e,{animation:!0,objectsOnly:!0}),n.css({zIndex:s.pane_animate}),e=="south"?n.css({top:sC.inset.top+sC.innerHeight-n.outerHeight()}):e=="east"&&n.css({left:sC.inset.left+sC.innerWidth-n.outerWidth()})):(hideMasks(),n.css({zIndex:r.isSliding?s.pane_sliding:s.pane_normal}),e=="south"?n.css({top:"auto"}):e=="east"&&!n.css("left").match(/\-99999/)&&n.css({left:"auto"}),browser.msie&&i.fxOpacityFix&&i.fxName_open!="slide"&&n.css("filter")&&n.css("opacity")==1&&n[0].style.removeAttribute("filter"))},bindStartSlidingEvents=function(e,t){var n=options[e],r=$Ps[e],i=$Rs[e],s=n.slideTrigger_open.toLowerCase();if(!i||t&&!n.slidable)return;s.match(/mouseover/)?s=n.slideTrigger_open="mouseenter":s.match(/(click|dblclick|mouseenter)/)||(s=n.slideTrigger_open="click"),n.resizerDblClickToggle&&s.match(/click/)&&i[t?"unbind":"bind"]("dblclick."+sID,toggle),i[t?"bind":"unbind"](s+"."+sID,slideOpen).css("cursor",t?n.sliderCursor:"default").attr("title",t?n.tips.Slide:"")},bindStopSlidingEvents=function(e,t){function l(t){timer.clear(e+"_closeSlider"),t.stopPropagation()}var n=options[e],r=state[e],i=_c[e],s=options.zIndexes,o=n.slideTrigger_close.toLowerCase(),u=t?"bind":"unbind",a=$Ps[e],f=$Rs[e];timer.clear(e+"_closeSlider"),t?(r.isSliding=!0,state.panesSliding[e]=!0,bindStartSlidingEvents(e,!1)):(r.isSliding=!1,delete state.panesSliding[e]),a.css("zIndex",t?s.pane_sliding:s.pane_normal),f.css("zIndex",t?s.pane_sliding+2:s.resizer_normal),o.match(/(click|mouseleave)/)||(o=n.slideTrigger_close="mouseleave"),f[u](o,slideClose),o==="mouseleave"&&(a[u]("mouseleave."+sID,slideClose),f[u]("mouseenter."+sID,l),a[u]("mouseenter."+sID,l)),t?o==="click"&&!n.resizable&&(f.css("cursor",t?n.sliderCursor:"default"),f.attr("title",t?n.tips.Close:"")):timer.clear(e+"_closeSlider")},makePaneFit=function(e,t,n,r){var i=options[e],s=state[e],o=_c[e],u=$Ps[e],a=$Rs[e],f=o.dir==="vert",l=!1;if(e==="center"||f&&s.noVerticalRoom)l=s.maxHeight>=0,l&&s.noRoom?(_showPane(e),a&&a.show(),s.isVisible=!0,s.noRoom=!1,f&&(s.noVerticalRoom=!1),_fixIframe(e)):!l&&!s.noRoom&&(_hidePane(e),a&&a.hide(),s.isVisible=!1,s.noRoom=!0);if(e!=="center")if(s.minSize<=s.maxSize){l=!0;if(s.size>s.maxSize)sizePane(e,s.maxSize,n,!0,r);else if(s.sizet?p.attempt=max(0,o.attempt-(o.actual-t)):p.attempt=max(0,o.attempt+(t-o.actual)),p.cssSize=cssSize(s,p.attempt),a.css(c,p.cssSize),p.actual=c=="width"?a.outerWidth():a.outerHeight(),p.correct=t===p.actual,r.length===1&&(_log(m,!1,!0),_log(o,!1,!0)),_log(p,!1,!0);if(r.length>3)break;r.push(p),o=r[r.length-1]}u.size=t,$.extend(u,elDims(a)),u.isVisible&&a.is(":visible")&&(f&&f.css(l,t+sC.inset[l]),sizeContent(s)),!n&&!h&&state.initialized&&u.isVisible&&_runCallbacks("onresize_end",s),n||(u.isSliding||sizeMidPanes(_c[s].dir=="horz"?"":"center",h,i),sizeHandles());var g=_c.oppositeEdge[s];t1&&_log(m+"\nSee the Error Console for details.",!0,!0)}if(!isInitialized())return;var s=evtPane.call(this,e),o=options[s],u=state[s],a=$Ps[s],f=$Rs[s],l=_c[s].side,c=_c[s].sizeType.toLowerCase(),h=u.isResizing&&!o.triggerEventsDuringLiveResize,p=r!==!0&&o.animatePaneSizing,d,v;$N.queue(function(e){setSizeLimits(s),d=u.size,t=_parseSize(s,t),t=max(t,_parseSize(s,o.minSize)),t=min(t,u.maxSize);if(t=0&&l.height>=0;if(!state.initialized&&i.minWidth>h.width){var p=i.minWidth-s.outerWidth,d=options.east.minSize||0,v=options.west.minSize||0,m=state.east.size,g=state.west.size,y=m,b=g;p>0&&state.east.isVisible&&m>d&&(y=max(m-d,m-p),p-=m-y),p>0&&state.west.isVisible&&g>v&&(b=max(g-v,g-p),p-=g-b);if(p===0){m&&m!=d&&sizePane("east",y,!0,!0,n),g&&g!=v&&sizePane("west",b,!0,!0,n),sizeMidPanes("center",t,n),o.css(c);return}}}else{s.isVisible&&!s.noVerticalRoom&&$.extend(s,elDims(o),cssMinDims(r));if(!n&&!s.noVerticalRoom&&h.height===s.outerHeight)return o.css(c),!0;l.top=h.top,l.bottom=h.bottom,s.newSize=h.height,l.height=cssH(o,h.height),s.maxHeight=l.height,f=s.maxHeight>=0,f||(s.noVerticalRoom=!0)}f?(!t&&state.initialized&&_runCallbacks("onresize_start",r),o.css(l),r!=="center"&&sizeHandles(r),s.noRoom&&!s.isClosed&&!s.isHidden&&makePaneFit(r),s.isVisible&&($.extend(s,elDims(o)),state.initialized&&sizeContent(r))):!s.noRoom&&s.isVisible&&makePaneFit(r),o.css(c),delete s.newSize,delete s.newWidth,delete s.newHeight;if(!s.isVisible)return!0;if(r==="center"){var w=browser.isIE6||!browser.boxModel;$Ps.north&&(w||state.north.tagName=="IFRAME")&&$Ps.north.css("width",cssW($Ps.north,sC.innerWidth)),$Ps.south&&(w||state.south.tagName=="IFRAME")&&$Ps.south.css("width",cssW($Ps.south,sC.innerWidth))}!t&&state.initialized&&_runCallbacks("onresize_end",r)})},resizeAll=function(e){var t=sC.innerWidth,n=sC.innerHeight;evtPane(e);if(!$N.is(":visible"))return;if(!state.initialized){_initLayoutElements();return}e===!0&&$.isPlainObject(options.outset)&&$N.css(options.outset),$.extend(sC,elDims($N,options.inset));if(!sC.outerHeight)return;e===!0&&setPanePosition();if(!1===_runCallbacks("onresizeall_start"))return!1;var r=sC.innerHeight0&&r.css("overflow")==="hidden"&&(r.css("overflow","visible"),l(),r.css("overflow","hidden"));var a=o.innerHeight-(u.spaceAbove-o.css.paddingTop)-(u.spaceBelow-o.css.paddingBottom);if(!i.is(":visible")||u.height!=a)setOuterHeight(i,a,!0),u.height=a;state.initialized&&_runCallbacks("onsizecontent_end",n)})},sizeHandles=function(e){var t=evtPane.call(this,e);t=t?t.split(","):_c.borderPanes,$.each(t,function(e,t){var n=options[t],r=state[t],i=$Ps[t],s=$Rs[t],o=$Ts[t],u;if(!i||!s)return;var a=_c[t].dir,f=r.isClosed?"_closed":"_open",l=n["spacing"+f],c=n["togglerAlign"+f],h=n["togglerLength"+f],p,d,v,m={};if(l===0){s.hide();return}!r.noRoom&&!r.isHidden&&s.show(),a==="horz"?(p=sC.innerWidth,r.resizerLength=p,d=$.layout.cssNum(i,"left"),s.css({width:cssW(s,p),height:cssH(s,l),left:d>-9999?d:sC.inset.left})):(p=i.outerHeight(),r.resizerLength=p,s.css({height:cssH(s,p),width:cssW(s,l),top:sC.inset.top+getPaneSize("north",!0)})),removeHover(n,s);if(o){if(h===0||r.isSliding&&n.hideTogglerOnSlide){o.hide();return}o.show();if(!(h>0)||h==="100%"||h>p)h=p,v=0;else if(isStr(c))switch(c){case"top":case"left":v=0;break;case"bottom":case"right":v=p-h;break;case"middle":case"center":default:v=round((p-h)/2)}else{var g=parseInt(c,10);c>=0?v=g:v=p-h+g}if(a==="horz"){var y=cssW(o,h);o.css({width:y,height:cssH(o,l),left:v,top:0}),o.children(".content").each(function(){u=$(this),u.css("marginLeft",round((y-u.outerWidth())/2))})}else{var b=cssH(o,h);o.css({height:b,width:cssW(o,l),top:v,left:0}),o.children(".content").each(function(){u=$(this),u.css("marginTop",round((b-u.outerHeight())/2))})}removeHover(0,o)}!state.initialized&&(n.initHidden||r.isHidden)&&(s.hide(),o&&o.hide())})},enableClosable=function(e){if(!isInitialized())return;var t=evtPane.call(this,e),n=$Ts[t],r=options[t];if(!n)return;r.closable=!0,n.bind("click."+sID,function(e){e.stopPropagation(),toggle(t)}).css("visibility","visible").css("cursor","pointer").attr("title",state[t].isClosed?r.tips.Open:r.tips.Close).show()},disableClosable=function(e,t){if(!isInitialized())return;var n=evtPane.call(this,e),r=$Ts[n];if(!r)return;options[n].closable=!1,state[n].isClosed&&open(n,!1,!0),r.unbind("."+sID).css("visibility",t?"hidden":"visible").css("cursor","default").attr("title","")},enableSlidable=function(e){if(!isInitialized())return;var t=evtPane.call(this,e),n=$Rs[t];if(!n||!n.data("draggable"))return;options[t].slidable=!0,state[t].isClosed&&bindStartSlidingEvents(t,!0)},disableSlidable=function(e){if(!isInitialized())return;var t=evtPane.call(this,e),n=$Rs[t];if(!n)return;options[t].slidable=!1,state[t].isSliding?close(t,!1,!0):(bindStartSlidingEvents(t,!1),n.css("cursor","default").attr("title",""),removeHover(null,n[0]))},enableResizable=function(e){if(!isInitialized())return;var t=evtPane.call(this,e),n=$Rs[t],r=options[t];if(!n||!n.data("draggable"))return;r.resizable=!0,n.draggable("enable"),state[t].isClosed||n.css("cursor",r.resizerCursor).attr("title",r.tips.Resize)},disableResizable=function(e){if(!isInitialized())return;var t=evtPane.call(this,e),n=$Rs[t];if(!n||!n.data("draggable"))return;options[t].resizable=!1,n.draggable("disable").css("cursor","default").attr("title",""),removeHover(null,n[0])},swapPanes=function(e,t){function o(e){var t=$Ps[e],n=$Cs[e];return t?{pane:e,P:t?t[0]:!1,C:n?n[0]:!1,state:$.extend(!0,{},state[e]),options:$.extend(!0,{},options[e])}:!1}function u(e,t){if(!e)return;var n=e.P,r=e.C,i=e.pane,o=_c[t],u=$.extend(!0,{},state[t]),a=options[t],f={resizerCursor:a.resizerCursor},l,c,h;$.each("fxName,fxSpeed,fxSettings".split(","),function(e,t){f[t+"_open"]=a[t+"_open"],f[t+"_close"]=a[t+"_close"],f[t+"_size"]=a[t+"_size"]}),$Ps[t]=$(n).data({layoutPane:Instance[t],layoutEdge:t}).css(_c.hidden).css(o.cssReq),$Cs[t]=r?$(r):!1,options[t]=$.extend(!0,{},e.options,f),state[t]=$.extend(!0,{},e.state),l=new RegExp(a.paneClass+"-"+i,"g"),n.className=n.className.replace(l,a.paneClass+"-"+t),initHandles(t),o.dir!=_c[i].dir?(c=s[t]||0,setSizeLimits(t),c=max(c,state[t].minSize),manualSizePane(t,c,!0,!0)):$Rs[t].css(o.side,sC.inset[o.side]+(state[t].isVisible?getPaneSize(t):0)),e.state.isVisible&&!u.isVisible?setAsOpen(t,!0):(setAsClosed(t),bindStartSlidingEvents(t,!0)),e=null}if(!isInitialized())return;var n=evtPane.call(this,e);state[n].edge=t,state[t].edge=n;if(!1===_runCallbacks("onswap_start",n)||!1===_runCallbacks("onswap_start",t)){state[n].edge=n,state[t].edge=t;return}var r=o(n),i=o(t),s={};s[n]=r?r.state.size:0,s[t]=i?i.state.size:0,$Ps[n]=!1,$Ps[t]=!1,state[n]={},state[t]={},$Ts[n]&&$Ts[n].remove(),$Ts[t]&&$Ts[t].remove(),$Rs[n]&&$Rs[n].remove(),$Rs[t]&&$Rs[t].remove(),$Rs[n]=$Rs[t]=$Ts[n]=$Ts[t]=!1,u(r,t),u(i,n),r=i=s=null,$Ps[n]&&$Ps[n].css(_c.visible),$Ps[t]&&$Ps[t].css(_c.visible),resizeAll(),_runCallbacks("onswap_end",n),_runCallbacks("onswap_end",t);return},syncPinBtns=function(e,t){$.layout.plugins.buttons&&$.each(state[e].pins,function(n,r){$.layout.buttons.setPinState(Instance,$(r),e,t)})},$N=$(this).eq(0);if(!$N.length)return _log(options.errors.containerMissing);if($N.data("layoutContainer")&&$N.data("layout"))return $N.data("layout");var $Ps={},$Cs={},$Rs={},$Ts={},$Ms=$([]),sC=state.container,sID=state.id,Instance={options:options,state:state,container:$N,panes:$Ps,contents:$Cs,resizers:$Rs,togglers:$Ts,hide:hide,show:show,toggle:toggle,open:open,close:close,slideOpen:slideOpen,slideClose:slideClose,slideToggle:slideToggle,setSizeLimits:setSizeLimits,_sizePane:sizePane,sizePane:manualSizePane,sizeContent:sizeContent,swapPanes:swapPanes,showMasks:showMasks,hideMasks:hideMasks,initContent:initContent,addPane:addPane,removePane:removePane,createChildren:createChildren,refreshChildren:refreshChildren,enableClosable:enableClosable,disableClosable:disableClosable,enableSlidable:enableSlidable,disableSlidable:disableSlidable,enableResizable:enableResizable,disableResizable:disableResizable,allowOverflow:allowOverflow,resetOverflow:resetOverflow,destroy:destroy,initPanes:isInitialized,resizeAll:resizeAll,runCallbacks:_runCallbacks,hasParentLayout:!1,children:children,north:!1,south:!1,west:!1,east:!1,center:!1};return _create()==="cancel"?null:Instance}}(jQuery),function(e){e.ui||(e.ui={}),e.ui.cookie={acceptsCookies:!!navigator.cookieEnabled,read:function(t){var n=document.cookie,r=n?n.split(";"):[],i;for(var s=0,o=r.length;s0&&(a=parseInt(a,10),f="number"),f==="number"&&(s=new Date,a>0?s.setDate(s.getDate()+a):(s.setFullYear(1970),o=!0)),s&&(i+=";expires="+s.toUTCString()),u.path&&(i+=";path="+u.path),u.domain&&(i+=";domain="+u.domain),u.secure&&(i+=";secure"),document.cookie=t+"="+(o?"":encodeURIComponent(n))+i},clear:function(t){e.ui.cookie.write(t,"",{expires:-1})}},e.cookie||(e.cookie=function(t,n,r){var i=e.ui.cookie;if(n===null)i.clear(t);else{if(n===undefined)return i.read(t);i.write(t,n,r)}}),e.layout.plugins.stateManagement=!0,e.layout.config.optionRootKeys.push("stateManagement"),e.layout.defaults.stateManagement={enabled:!1,autoSave:!0,autoLoad:!0,animateLoad:!0,includeChildren:!0,stateKeys:"north.size,south.size,east.size,west.size,north.isClosed,south.isClosed,east.isClosed,west.isClosed,north.isHidden,south.isHidden,east.isHidden,west.isHidden",cookie:{name:"",domain:"",path:"",expires:"",secure:!1}},e.layout.optionsMap.layout.push("stateManagement"),e.layout.state={saveCookie:function(t,n,r){var i=t.options,s=i.stateManagement,o=e.extend(!0,{},s.cookie,r||null),u=t.state.stateData=t.readState(n||s.stateKeys);return e.ui.cookie.write(o.name||i.name||"Layout",e.layout.state.encodeJSON(u),o),e.extend(!0,{},u)},deleteCookie:function(t){var n=t.options;e.ui.cookie.clear(n.stateManagement.cookie.name||n.name||"Layout")},readCookie:function(t){var n=t.options,r=e.ui.cookie.read(n.stateManagement.cookie.name||n.name||"Layout");return r?e.layout.state.decodeJSON(r):{}},loadCookie:function(t){var n=e.layout.state.readCookie(t);return n&&(t.state.stateData=e.extend(!0,{},n),t.loadState(n)),n},loadState:function(t,n,r){if(!e.isPlainObject(n)||e.isEmptyObject(n))return;n=t.state.stateData=e.layout.transformData(n);var i=t.options.stateManagement;r=e.extend({animateLoad:!1,includeChildren:i.includeChildren},r);if(!t.state.initialized){var o=e.extend(!0,{},n);e.each(e.layout.config.allPanes,function(e,t){o[t]&&delete o[t].children}),e.extend(!0,t.options,o)}else{var u=!r.animateLoad,o,a,f,l,c;e.each(e.layout.config.borderPanes,function(r,i){o=n[i];if(!e.isPlainObject(o))return;s=o.size,a=o.initClosed,f=o.initHidden,ar=o.autoResize,l=t.state[i],c=l.isVisible,ar&&(l.autoResize=ar),c||t._sizePane(i,s,!1,!1,!1),f===!0?t.hide(i,u):a===!0?t.close(i,!1,u):a===!1?t.open(i,!1,u):f===!1&&t.show(i,!1,u),c&&t._sizePane(i,s,!1,!1,u)});if(r.includeChildren){var h,p;e.each(t.children,function(t,r){h=n[t]?n[t].children:0,h&&r&&e.each(r,function(e,t){p=h[e],t&&p&&t.loadState(p)})})}}},readState:function(t,n){e.type(n)==="string"&&(n={keys:n}),n||(n={});var r=t.options.stateManagement,i=n.includeChildren,s=i!==undefined?i:r.includeChildren,o=n.stateKeys||r.stateKeys,u={isClosed:"initClosed",isHidden:"initHidden"},a=t.state,f=e.layout.config.allPanes,l={},c,h,p,d,v,m,g,y,b,w;e.isArray(o)&&(o=o.join(",")),o=o.replace(/__/g,".").split(",");for(var E=0,S=o.length;E8||!s.msie?!1:n.deviceXDPI&&n.systemXDPI?l(n.deviceXDPI,n.systemXDPI):s.webkit&&(u=r.body.getBoundingClientRect)?l(u.left-u.right,r.body.offsetWidth):s.webkit&&(a=t.outerWidth)?l(a,t.innerWidth):(a=n.width)&&(f=i.clientWidth)?l(a,f):!1}},e.layout.onReady.push(e.layout.browserZoom._init)}(jQuery),define("layout",function(){});var Markdown;typeof exports=="object"&&typeof require=="function"?Markdown=exports:Markdown={},function(){function e(e){return e}function t(e){return!1}function n(){}function r(){}n.prototype={chain:function(t,n){var r=this[t];if(!r)throw new Error("unknown hook "+t);r===e?this[t]=n:this[t]=function(e){var t=Array.prototype.slice.call(arguments,0);return t[0]=r.apply(null,t),n.apply(null,t)}},set:function(e,t){if(!this[e])throw new Error("unknown hook "+e);this[e]=t},addNoop:function(t){this[t]=e},addFalse:function(e){this[e]=t}},Markdown.HookCollection=n,r.prototype={set:function(e,t){this["s_"+e]=t},get:function(e){return this["s_"+e]}},Markdown.Converter=function(){function u(e){return e=e.replace(/^[ ]{0,3}\[(.+)\]:[ \t]*\n?[ \t]*?(?=\s|$)[ \t]*\n?[ \t]*((\n*)["(](.+?)[")][ \t]*)?(?:\n+)/gm,function(e,n,r,s,o,u){return n=n.toLowerCase(),t.set(n,O(r)),o?s:(u&&i.set(n,u.replace(/"/g,""")),"")}),e}function a(e){var t="p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math|ins|del",n="p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math";return e=e.replace(/^(<(p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math|ins|del)\b[^\r]*?\n<\/\2>[ \t]*(?=\n+))/gm,f),e=e.replace(/^(<(p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math)\b[^\r]*?.*<\/\2>[ \t]*(?=\n+)\n)/gm,f),e=e.replace(/\n[ ]{0,3}((<(hr)\b([^<>])*?\/?>)[ \t]*(?=\n{2,}))/g,f),e=e.replace(/\n\n[ ]{0,3}(-]|-[^>])(?:[^-]|-[^-])*)--)>[ \t]*(?=\n{2,}))/g,f),e=e.replace(/(?:\n\n)([ ]{0,3}(?:<([?%])[^\r]*?\2>)[ \t]*(?=\n{2,}))/g,f),e}function f(e,t){var n=t;return n=n.replace(/^\n+/,""),n=n.replace(/\n+$/g,""),n="\n\n~K"+(s.push(n)-1)+"K\n\n",n}function c(t,n){t=e.preBlockGamut(t,l),t=b(t);var r="
      \n";return t=t.replace(/^[ ]{0,2}([ ]?\*[ ]?){3,}[ \t]*$/gm,r),t=t.replace(/^[ ]{0,2}([ ]?-[ ]?){3,}[ \t]*$/gm,r),t=t.replace(/^[ ]{0,2}([ ]?_[ ]?){3,}[ \t]*$/gm,r),t=w(t),t=x(t),t=L(t),t=e.postBlockGamut(t,l),t=a(t),t=A(t,n),t}function h(t){return t=e.preSpanGamut(t),t=N(t),t=p(t),t=M(t),t=m(t),t=d(t),t=D(t),t=t.replace(/~P/g,"://"),t=O(t),t=k(t),t=t.replace(/ +\n/g,"
      \n"),t=e.postSpanGamut(t),t}function p(e){var t=/(<[a-z\/!$]("[^"]*"|'[^']*'|[^'">])*>|-]|-[^>])(?:[^-]|-[^-])*)--)>)/gi;return e=e.replace(t,function(e){var t=e.replace(/(.)<\/?code>(?=.)/g,"$1`");return t=I(t,e.charAt(1)=="!"?"\\`*_/":"\\`*_"),t}),e}function d(e){return e=e.replace(/(\[((?:\[[^\]]*\]|[^\[\]])*)\][ ]?(?:\n[ ]*)?\[(.*?)\])()()()()/g,v),e=e.replace(/(\[((?:\[[^\]]*\]|[^\[\]])*)\]\([ \t]*()?[ \t]*((['"])(.*?)\6[ \t]*)?\))/g,v),e=e.replace(/(\[([^\[\]]+)\])()()()()()/g,v),e}function v(e,n,r,s,o,u,a,f){f==undefined&&(f="");var l=n,c=r.replace(/:\/\//g,"~P"),h=s.toLowerCase(),p=o,d=f;if(p==""){h==""&&(h=c.toLowerCase().replace(/ ?\n/g," ")),p="#"+h;if(t.get(h)!=undefined)p=t.get(h),i.get(h)!=undefined&&(d=i.get(h));else{if(!(l.search(/\(\s*\)$/m)>-1))return l;p=""}}p=F(p),p=I(p,"*_");var v='",v}function m(e){return e=e.replace(/(!\[(.*?)\][ ]?(?:\n[ ]*)?\[(.*?)\])()()()()/g,y),e=e.replace(/(!\[(.*?)\]\s?\([ \t]*()?[ \t]*((['"])(.*?)\6[ \t]*)?\))/g,y),e}function g(e){return e.replace(/>/g,">").replace(/"+h(t)+"\n\n"}),e=e.replace(/^(.+)[ \t]*\n-+[ \t]*\n+/gm,function(e,t){return"

      "+h(t)+"

      \n\n"}),e=e.replace(/^(\#{1,6})[ \t]*(.+?)[ \t]*\#*\n+/gm,function(e,t,n){var r=t.length;return""+h(n)+"\n\n"}),e}function w(e){e+="~0";var t=/^(([ ]{0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(~0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/gm;return o?e=e.replace(t,function(e,t,n){var r=t,i=n.search(/[*+-]/g)>-1?"ul":"ol",s=S(r,i);return s=s.replace(/\s+$/,""),s="<"+i+">"+s+"\n",s}):(t=/(\n\n|^\n?)(([ ]{0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(~0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/g,e=e.replace(t,function(e,t,n,r){var i=t,s=n,o=r.search(/[*+-]/g)>-1?"ul":"ol",u=S(s,o);return u=i+"<"+o+">\n"+u+"\n",u})),e=e.replace(/~0/,""),e}function S(e,t){o++,e=e.replace(/\n{2,}$/,"\n"),e+="~0";var n=E[t],r=new RegExp("(^[ \\t]*)("+n+")[ \\t]+([^\\r]+?(\\n+))(?=(~0|\\1("+n+")[ \\t]+))","gm"),i=!1;return e=e.replace(r,function(e,t,n,r){var s=r,o=t,u=/\n\n$/.test(s),a=u||s.search(/\n{2,}/)>-1;return a||i?s=c(H(s),!0):(s=w(H(s)),s=s.replace(/\n$/,""),s=h(s)),i=u,"
    • "+s+"
    • \n"}),e=e.replace(/~0/g,""),o--,e}function x(e){return e+="~0",e=e.replace(/(?:\n\n|^\n?)((?:(?:[ ]{4}|\t).*\n+)+)(\n*[ ]{0,3}[^ \t\n]|(?=~0))/g,function(e,t,n){var r=t,i=n;return r=C(H(r)),r=B(r),r=r.replace(/^\n+/g,""),r=r.replace(/\n+$/g,""),r="
      "+r+"\n
      ","\n\n"+r+"\n\n"+i}),e=e.replace(/~0/,""),e}function T(e){return e=e.replace(/(^\n+|\n+$)/g,""),"\n\n~K"+(s.push(e)-1)+"K\n\n"}function N(e){return e=e.replace(/(^|[^\\])(`+)([^\r]*?[^`])\2(?!`)/gm,function(e,t,n,r,i){var s=r;return s=s.replace(/^([ \t]*)/g,""),s=s.replace(/[ \t]*$/g,""),s=C(s),s=s.replace(/:\/\//g,"~P"),t+""+s+""}),e}function C(e){return e=e.replace(/&/g,"&"),e=e.replace(//g,">"),e=I(e,"*_{}[]\\",!1),e}function k(e){return e=e.replace(/([\W_]|^)(\*\*|__)(?=\S)([^\r]*?\S[\*_]*)\2([\W_]|$)/g,"$1$3$4"),e=e.replace(/([\W_]|^)(\*|_)(?=\S)([^\r\*_]*?\S)\2([\W_]|$)/g,"$1$3$4"),e}function L(e){return e=e.replace(/((^[ \t]*>[ \t]?.+\n(.+\n)*\n*)+)/gm,function(e,t){var n=t;return n=n.replace(/^[ \t]*>[ \t]?/gm,"~0"),n=n.replace(/~0/g,""),n=n.replace(/^[ \t]+$/gm,""),n=c(n),n=n.replace(/(^|\n)/g,"$1 "),n=n.replace(/(\s*
      [^\r]+?<\/pre>)/gm,function(e,t){var n=t;return n=n.replace(/^  /mg,"~0"),n=n.replace(/~0/g,""),n}),T("
      \n"+n+"\n
      ")}),e}function A(e,t){e=e.replace(/^\n+/g,""),e=e.replace(/\n+$/g,"");var n=e.split(/\n{2,}/g),r=[],i=/~K(\d+)K/,o=n.length;for(var u=0;u"),a+="

      ",r.push(a))}if(!t){o=r.length;for(var u=0;u#+-.!])/g,q),e}function _(e,t,n,r){if(t)return e;if(r.charAt(r.length-1)!==")")return"<"+n+r+">";var i=r.match(/[()]/g),s=0;for(var o=0;o"+u}function D(t){t=t.replace(/(="|<)?\b(https?|ftp)(:\/\/[-A-Z0-9+&@#\/%?=~_|\[\]\(\)!:,\.;]*[-A-Z0-9+&@#\/%=~_|\[\])])(?=$|\W)/gi,_);var n=function(t,n){return'
      '+e.plainLinkText(n)+""};return t=t.replace(/<((https?|ftp):[^'">\s]+)>/gi,n),t}function P(e){return e=e.replace(/~E(\d+)E/g,function(e,t){var n=parseInt(t);return String.fromCharCode(n)}),e}function H(e){return e=e.replace(/^(\t|[ ]{1,4})/gm,"~0"),e=e.replace(/~0/g,""),e}function B(e){if(!/\t/.test(e))return e;var t=[" "," "," "," "],n=0,r;return e.replace(/[\n\t]/g,function(e,i){return e==="\n"?(n=i+1,e):(r=(i-n)%4,n=i+1,t[r])})}function F(e){if(!e)return"";var t=e.length;return e.replace(j,function(n,r){if(n=="~D")return"%24";if(n==":")if(r==t-1||/[0-9\/]/.test(e.charAt(r+1)))return":";return"%"+n.charCodeAt(0).toString(16)})}function I(e,t,n){var r="(["+t.replace(/([\[\]\\])/g,"\\$1")+"])";n&&(r="\\\\"+r);var i=new RegExp(r,"g");return e=e.replace(i,q),e}function q(e,t){var n=t.charCodeAt(0);return"~E"+n+"E"}var e=this.hooks=new n;e.addNoop("plainLinkText"),e.addNoop("preConversion"),e.addNoop("postNormalization"),e.addNoop("preBlockGamut"),e.addNoop("postBlockGamut"),e.addNoop("preSpanGamut"),e.addNoop("postSpanGamut"),e.addNoop("postConversion");var t,i,s,o;this.makeHtml=function(n){if(t)throw new Error("Recursive call to converter.makeHtml");return t=new r,i=new r,s=[],o=0,n=e.preConversion(n),n=n.replace(/~/g,"~T"),n=n.replace(/\$/g,"~D"),n=n.replace(/\r\n/g,"\n"),n=n.replace(/\r/g,"\n"),n="\n\n"+n+"\n\n",n=B(n),n=n.replace(/^[ \t]+$/mg,""),n=e.postNormalization(n),n=a(n),n=u(n),n=c(n),n=P(n),n=n.replace(/~D/g,"$$"),n=n.replace(/~T/g,"~"),n=e.postConversion(n),s=i=t=null,n};var l=function(e){return c(e)},E={ol:"\\d+[.]",ul:"[*+-]"},j=/(?:["'*()[\]:]|~D)/g}}(),define("Markdown.Converter",function(){}),function(){function n(e){return e.replace(/<[^>]*>?/gi,o)}function o(e){return e.match(r)||e.match(i)||e.match(s)?e:""}function u(e){if(e=="")return"";var t=/<\/?\w+[^>]*(\s|$|>)/g,n=e.toLowerCase().match(t),r=(n||[]).length;if(r==0)return e;var i,s,o="



    • ",u,a=[],f=[],l=!1;for(var c=0;c")>-1)continue;s=n[c],u=-1;if(!/^<\//.test(s))for(var h=c+1;h"){u=h;break}u==-1?l=f[c]=!0:a[u]=!0}if(!l)return e;var c=0;return e=e.replace(t,function(e){var t=f[c]?"":e;return c++,t}),e}var e,t;typeof exports=="object"&&typeof require=="function"?(e=exports,t=require("./Markdown.Converter").Converter):(e=window.Markdown,t=e.Converter),e.getSanitizingConverter=function(){var e=new t;return e.hooks.chain("postConversion",n),e.hooks.chain("postConversion",u),e};var r=/^(<\/?(b|blockquote|code|del|dd|dl|dt|em|h1|h2|h3|i|kbd|li|ol|p|pre|s|sup|sub|strong|strike|ul)>|<(br|hr)\s?\/?>)$/i,i=/^(]+")?\s?>|<\/a>)$/i,s=/^(]*")?(\stitle="[^"<>]*")?\s?\/?>)$/i}(),define("Markdown.Sanitizer",function(){}),function(){function c(){}function h(e){this.buttonBar=r.getElementById("wmd-button-bar"+e),this.preview=r.getElementById("wmd-preview"+e),this.input=r.getElementById("wmd-input"+e)}function p(t,n){var r=this,i=[],s=0,o="none",a,f,l,c=function(e,t){o!=e&&(o=e,t||p()),!u.isIE||o!="moving"?f=setTimeout(h,1):l=null},h=function(e){l=new d(n,e),f=undefined};this.setCommandMode=function(){o="command",p(),f=setTimeout(h,0)},this.canUndo=function(){return s>1},this.canRedo=function(){return i[s+1]?!0:!1},this.undo=function(){r.canUndo()&&(a?(a.restore(),a=null):(i[s]=new d(n),i[--s].restore(),t&&t())),o="none",n.input.focus(),h()},this.redo=function(){r.canRedo()&&(i[++s].restore(),t&&t()),o="none",n.input.focus(),h()};var p=function(){var e=l||new d(n);if(!e)return!1;if(o=="moving"){a||(a=e);return}a&&(i[s-1].text!=a.text&&(i[s++]=a),a=null),i[s++]=e,i[s+1]=null,t&&t()},v=function(e){var t=!1;if((e.ctrlKey||e.metaKey)&&!e.altKey){var n=e.charCode||e.keyCode,i=String.fromCharCode(n);switch(i.toLowerCase()){case"y":r.redo(),t=!0;break;case"z":e.shiftKey?r.redo():r.undo(),t=!0}}if(t){e.preventDefault&&e.preventDefault(),window.event&&(window.event.returnValue=!1);return}},m=function(e){if(!e.ctrlKey&&!e.metaKey){var t=e.keyCode;t>=33&&t<=40||t>=63232&&t<=63235?c("moving"):t==8||t==46||t==127?c("deleting"):t==13?c("newlines"):t==27?c("escape"):(t<16||t>20)&&t!=91&&c("typing")}},g=function(){e.addEvent(n.input,"keypress",function(e){(e.ctrlKey||e.metaKey)&&!e.altKey&&(e.keyCode==89||e.keyCode==90)&&e.preventDefault()});var t=function(){(u.isIE||l&&l.text!=n.input.value)&&f==undefined&&(o="paste",p(),h())};e.addEvent(n.input,"keydown",v),e.addEvent(n.input,"keydown",m),e.addEvent(n.input,"mousedown",function(){c("moving")}),n.input.onpaste=t,n.input.ondrop=t},y=function(){g(),h(!0),p()};y()}function d(t,n){var i=this,s=t.input;this.init=function(){if(!e.isVisible(s))return;if(!n&&r.activeElement&&r.activeElement!==s)return;this.setInputAreaSelectionStartEnd(),this.scrollTop=s.scrollTop;if(!this.text&&s.selectionStart||s.selectionStart===0)this.text=s.value},this.setInputAreaSelection=function(){if(!e.isVisible(s))return;if(s.selectionStart!==undefined&&!u.isOpera)s.focus(),s.selectionStart=i.start,s.selectionEnd=i.end,s.scrollTop=i.scrollTop;else if(r.selection){if(r.activeElement&&r.activeElement!==s)return;s.focus();var t=s.createTextRange();t.moveStart("character",-s.value.length),t.moveEnd("character",-s.value.length),t.moveEnd("character",i.end),t.moveStart("character",i.start),t.select()}},this.setInputAreaSelectionStartEnd=function(){if(!t.ieCachedRange&&(s.selectionStart||s.selectionStart===0))i.start=s.selectionStart,i.end=s.selectionEnd;else if(r.selection){i.text=e.fixEolChars(s.value);var n=t.ieCachedRange||r.selection.createRange(),o=e.fixEolChars(n.text),u="",a=u+o+u;n.text=a;var f=e.fixEolChars(s.value);n.moveStart("character",-a.length),n.text=o,i.start=f.indexOf(u),i.end=f.lastIndexOf(u)-u.length;var l=i.text.length-e.fixEolChars(s.value).length;if(l){n.moveStart("character",-o.length);while(l--)o+="\n",i.end+=1;n.text=o}t.ieCachedRange&&(i.scrollTop=t.ieCachedScrollTop),t.ieCachedRange=null,this.setInputAreaSelection()}},this.restore=function(){i.text!=undefined&&i.text!=s.value&&(s.value=i.text),this.setInputAreaSelection(),s.scrollTop=i.scrollTop},this.getChunks=function(){var t=new c;return t.before=e.fixEolChars(i.text.substring(0,i.start)),t.startTag="",t.selection=e.fixEolChars(i.text.substring(i.start,i.end)),t.endTag="",t.after=e.fixEolChars(i.text.substring(i.end)),t.scrollTop=i.scrollTop,t},this.setChunks=function(e){e.before=e.before+e.startTag,e.after=e.endTag+e.after,this.start=e.before.length,this.end=e.before.length+e.selection.length,this.text=e.before+e.selection+e.after,this.scrollTop=e.scrollTop},this.init()}function v(n,i,s){var o=this,a,f,l,c=3e3,h="delayed",p=function(t,n){e.addEvent(t,"input",n),t.onpaste=n,t.ondrop=n,e.addEvent(t,"keypress",n),e.addEvent(t,"keydown",n)},d=function(){var e=0;return window.innerHeight?e=window.pageYOffset:r.documentElement&&r.documentElement.scrollTop?e=r.documentElement.scrollTop:r.body&&(e=r.body.scrollTop),e},v=function(){if(!i.preview)return;var e=i.input.value;if(e!==undefined&&e==l)return;l=e;var t=(new Date).getTime();e=n.makeHtml(e);var r=(new Date).getTime();f=r-t,T(e)},m=function(){a&&(clearTimeout(a),a=undefined);if(h!=="manual"){var e=0;h==="delayed"&&(e=f),e>c&&(e=c),a=setTimeout(v,e)}},g=function(e){return e.scrollHeight<=e.clientHeight?1:e.scrollTop/(e.scrollHeight-e.clientHeight)},y=function(){i.preview&&(i.preview.scrollTop=(i.preview.scrollHeight-i.preview.clientHeight)*g(i.preview))};this.refresh=function(e){e?(l="",v()):m()},this.processingTime=function(){return f};var b=!0,w=function(e){var t=i.preview,n=t.parentNode,r=t.nextSibling;n.removeChild(t),t.innerHTML=e,r?n.insertBefore(t,r):n.appendChild(t)},E=function(e){i.preview.innerHTML=e},S,x=function(e){if(S)return S(e);try{E(e),S=E}catch(t){S=w,S(e)}},T=function(e){var n=t.getTop(i.input)-d();i.preview&&(x(e),s()),y();if(b){b=!1;return}var r=t.getTop(i.input)-d();u.isIE?setTimeout(function(){window.scrollBy(0,r-n)},0):window.scrollBy(0,r-n)},N=function(){p(i.input,m),v(),i.preview&&(i.preview.scrollTop=0)};N()}function m(t,n,i,o,a,f,l){function v(e){c.focus();if(e.textOp){i&&i.setCommandMode();var t=new d(n);if(!t)return;var r=t.getChunks(),s=function(){c.focus(),r&&t.setChunks(r),t.restore(),o.refresh()},u=e.textOp(r,s);u||s()}e.execute&&e.execute(i)}function m(e,t){var i="0px",s="-20px",o="-40px",a=e.getElementsByTagName("span")[0];t?(a.style.backgroundPosition=e.XShift+" "+i,e.onmouseover=function(){a.style.backgroundPosition=this.XShift+" "+o},e.onmouseout=function(){a.style.backgroundPosition=this.XShift+" "+i},u.isIE&&(e.onmousedown=function(){if(r.activeElement&&r.activeElement!==n.input)return;n.ieCachedRange=document.selection.createRange(),n.ieCachedScrollTop=n.input.scrollTop}),e.isHelp||(e.onclick=function(){return this.onmouseout&&this.onmouseout(),v(this),!1}),e.className=e.className.replace(/ disabled/g,"")):(a.style.backgroundPosition=e.XShift+" "+s,e.onmouseover=e.onmouseout=e.onclick=function(){},e.className+=" disabled")}function g(e){return typeof e=="string"&&(e=a[e]),function(){e.apply(a,arguments)}}function y(){var e=n.buttonBar,r="0px",i="-20px",o="-40px",u=document.createElement("ul");u.id="wmd-button-row"+t,u.className="wmd-button-row",u=e.appendChild(u);var a=0,c=function(e,n,r,i){var s=document.createElement("li");s.className="wmd-button",s.style.left=a+"px",a+=25;var o=document.createElement("span");return s.id=e+t,s.appendChild(o),s.title=n,s.XShift=r,i&&(s.textOp=i),m(s,!0),u.appendChild(s),s},p=function(e){var n=document.createElement("li");n.className="wmd-spacer wmd-spacer"+e,n.id="wmd-spacer"+e+t,u.appendChild(n),a+=25};h.bold=c("wmd-bold-button",l("bold"),"0px",g("doBold")),h.italic=c("wmd-italic-button",l("italic"),"-20px",g("doItalic")),p(1),h.link=c("wmd-link-button",l("link"),"-40px",g(function(e,t){return this.doLinkOrImage(e,t,!1)})),h.quote=c("wmd-quote-button",l("quote"),"-60px",g("doBlockquote")),h.code=c("wmd-code-button",l("code"),"-80px",g("doCode")),h.image=c("wmd-image-button",l("image"),"-100px",g(function(e,t){return this.doLinkOrImage(e,t,!0)})),p(2),h.olist=c("wmd-olist-button",l("olist"),"-120px",g(function(e,t){this.doList(e,t,!0)})),h.ulist=c("wmd-ulist-button",l("ulist"),"-140px",g(function(e,t){this.doList(e,t,!1)})),h.heading=c("wmd-heading-button",l("heading"),"-160px",g("doHeading")),h.hr=c("wmd-hr-button",l("hr"),"-180px",g("doHorizontalRule")),p(3),h.undo=c("wmd-undo-button",l("undo"),"-200px",null),h.undo.execute=function(e){e&&e.undo()};var d=/win/.test(s.platform.toLowerCase())?l("redo"):l("redomac");h.redo=c("wmd-redo-button",d,"-220px",null),h.redo.execute=function(e){e&&e.redo()};if(f){var v=document.createElement("li"),y=document.createElement("span");v.appendChild(y),v.className="wmd-button wmd-help-button",v.id="wmd-help-button"+t,v.XShift="-240px",v.isHelp=!0,v.style.right="0px",v.title=l("help"),v.onclick=f.handler,m(v,!0),u.appendChild(v),h.help=v}b()}function b(){i&&(m(h.undo,i.canUndo()),m(h.redo,i.canRedo()))}var c=n.input,h={};y();var p="keydown";u.isOpera&&(p="keypress"),e.addEvent(c,p,function(e){if((e.ctrlKey||e.metaKey)&&!e.altKey&&!e.shiftKey){var t=e.charCode||e.keyCode,n=String.fromCharCode(t).toLowerCase();switch(n){case"b":v(h.bold);break;case"i":v(h.italic);break;case"l":v(h.link);break;case"q":v(h.quote);break;case"k":v(h.code);break;case"g":v(h.image);break;case"o":v(h.olist);break;case"u":v(h.ulist);break;case"h":v(h.heading);break;case"r":v(h.hr);break;case"y":v(h.redo);break;case"z":e.shiftKey?v(h.redo):v(h.undo);break;default:return}e.preventDefault&&e.preventDefault(),window.event&&(window.event.returnValue=!1)}}),e.addEvent(c,"keyup",function(e){if(e.shiftKey&&!e.ctrlKey&&!e.metaKey){var t=e.charCode||e.keyCode;if(t===13){var n={};n.textOp=g("doAutoindent"),v(n)}}}),u.isIE&&e.addEvent(c,"keydown",function(e){var t=e.keyCode;if(t===27)return!1}),this.setUndoRedoButtonStates=b}function g(e,t){this.hooks=e,this.getString=t}function b(e){return e.replace(/^\s*(.*?)(?:\s+"(.+)")?\s*$/,function(e,t,n){return t=t.replace(/\?.*$/,function(e){return e.replace(/\+/g," ")}),t=decodeURIComponent(t),t=encodeURI(t).replace(/'/g,"%27").replace(/\(/g,"%28").replace(/\)/g,"%29"),t=t.replace(/\?.*$/,function(e){return e.replace(/\+/g,"%2b")}),n&&(n=n.trim?n.trim():n.replace(/^\s*/,"").replace(/\s*$/,""),n=n.replace(/"/g,"quot;").replace(/\(/g,"(").replace(/\)/g,")").replace(//g,">")),n?t+' "'+n+'"':t})}var e={},t={},n={},r=window.document,i=window.RegExp,s=window.navigator,o={lineLength:72},u={isIE:/msie/.test(s.userAgent.toLowerCase()),isIE_5or6:/msie 6/.test(s.userAgent.toLowerCase())||/msie 5/.test(s.userAgent.toLowerCase()),isOpera:/opera/.test(s.userAgent.toLowerCase())},a={bold:"Strong Ctrl+B",boldexample:"strong text",italic:"Emphasis Ctrl+I",italicexample:"emphasized text",link:"Hyperlink Ctrl+L",linkdescription:"enter link description here",linkdialog:'

      Insert Hyperlink

      http://example.com/ "optional title"

      ',quote:"Blockquote
      Ctrl+Q",quoteexample:"Blockquote",code:"Code Sample
       Ctrl+K",codeexample:"enter code here",image:"Image  Ctrl+G",imagedescription:"enter image description here",imagedialog:"

      Insert Image

      http://example.com/images/diagram.jpg \"optional title\"

      Need
      free image hosting?

      ",olist:"Numbered List
        Ctrl+O",ulist:"Bulleted List
          Ctrl+U",litem:"List item",heading:"Heading

          /

          Ctrl+H",headingexample:"Heading",hr:"Horizontal Rule
          Ctrl+R",undo:"Undo - Ctrl+Z",redo:"Redo - Ctrl+Y",redomac:"Redo - Ctrl+Shift+Z",help:"Markdown Editing Help"},f="http://",l="http://";Markdown.Editor=function(e,t,n){n=n||{},typeof n.handler=="function"&&(n={helpButton:n}),n.strings=n.strings||{},n.helpButton&&(n.strings.help=n.strings.help||n.helpButton.title);var i=function(e){return n.strings[e]||a[e]};t=t||"";var s=this.hooks=new Markdown.HookCollection;s.addNoop("onPreviewRefresh"),s.addNoop("postBlockquoteCreation"),s.addFalse("insertImageDialog"),s.addFalse("insertLinkDialog"),this.getConverter=function(){return e};var o=this,u;this.run=function(){if(u)return;u=new h(t);var a=new g(s,i),f=new v(e,u,function(){s.onPreviewRefresh()}),l,c;/\?noundo/.test(r.location.href)||(l=new p(function(){f.refresh(),c&&c.setUndoRedoButtonStates()},u),this.textOperation=function(e){l.setCommandMode(),e(),o.refreshPreview()}),c=new m(t,u,l,f,a,n.helpButton,i),c.setUndoRedoButtonStates();var d=o.refreshPreview=function(){f.refresh(!0)};d()}},c.prototype.findTags=function(t,n){var r=this,i;t&&(i=e.extendRegExp(t,"","$"),this.before=this.before.replace(i,function(e){return r.startTag=r.startTag+e,""}),i=e.extendRegExp(t,"^",""),this.selection=this.selection.replace(i,function(e){return r.startTag=r.startTag+e,""})),n&&(i=e.extendRegExp(n,"","$"),this.selection=this.selection.replace(i,function(e){return r.endTag=e+r.endTag,""}),i=e.extendRegExp(n,"^",""),this.after=this.after.replace(i,function(e){return r.endTag=e+r.endTag,""}))},c.prototype.trimWhitespace=function(e){var t,n,r=this;e?t=n="":(t=function(e){return r.before+=e,""},n=function(e){return r.after=e+r.after,""}),this.selection=this.selection.replace(/^(\s*)/,t).replace(/(\s*)$/,n)},c.prototype.skipLines=function(e,t,n){e===undefined&&(e=1),t===undefined&&(t=1),e++,t++;var r,s;navigator.userAgent.match(/Chrome/)&&"X".match(/()./),this.selection=this.selection.replace(/(^\n*)/,""),this.startTag=this.startTag+i.$1,this.selection=this.selection.replace(/(\n*$)/,""),this.endTag=this.endTag+i.$1,this.startTag=this.startTag.replace(/(^\n*)/,""),this.before=this.before+i.$1,this.endTag=this.endTag.replace(/(\n*$)/,""),this.after=this.after+i.$1;if(this.before){r=s="";while(e--)r+="\\n?",s+="\n";n&&(r="\\n*"),this.before=this.before.replace(new i(r+"$",""),s)}if(this.after){r=s="";while(t--)r+="\\n?",s+="\n";n&&(r="\\n*"),this.after=this.after.replace(new i(r,""),s)}},e.isVisible=function(e){if(window.getComputedStyle)return window.getComputedStyle(e,null).getPropertyValue("display")!=="none";if(e.currentStyle)return e.currentStyle.display!=="none"},e.addEvent=function(e,t,n){e.attachEvent?e.attachEvent("on"+t,n):e.addEventListener(t,n,!1)},e.removeEvent=function(e,t,n){e.detachEvent?e.detachEvent("on"+t,n):e.removeEventListener(t,n,!1)},e.fixEolChars=function(e){return e=e.replace(/\r\n/g,"\n"),e=e.replace(/\r/g,"\n"),e},e.extendRegExp=function(e,t,n){if(t===null||t===undefined)t="";if(n===null||n===undefined)n="";var r=e.toString(),s;return r=r.replace(/\/([gim]*)$/,function(e,t){return s=t,""}),r=r.replace(/(^\/|\/$)/g,""),r=t+r+n,new i(r,s)},t.getTop=function(e,t){var n=e.offsetTop;if(!t)while(e=e.offsetParent)n+=e.offsetTop;return n},t.getHeight=function(e){return e.offsetHeight||e.scrollHeight},t.getWidth=function(e){return e.offsetWidth||e.scrollWidth},t.getPageSize=function(){var e,t,n,i;self.innerHeight&&self.scrollMaxY?(e=r.body.scrollWidth,t=self.innerHeight+self.scrollMaxY):r.body.scrollHeight>r.body.offsetHeight?(e=r.body.scrollWidth,t=r.body.scrollHeight):(e=r.body.offsetWidth,t=r.body.offsetHeight),self.innerHeight?(n=self.innerWidth,i=self.innerHeight):r.documentElement&&r.documentElement.clientHeight?(n=r.documentElement.clientWidth,i=r.documentElement.clientHeight):r.body&&(n=r.body.clientWidth,i=r.body.clientHeight);var s=Math.max(e,n),o=Math.max(t,i);return[s,o,n,i]},n.createBackground=function(){var e=r.createElement("div"),n=e.style;e.className="wmd-prompt-background",n.position="absolute",n.top="0",n.zIndex="1000",u.isIE?n.filter="alpha(opacity=50)":n.opacity="0.5";var i=t.getPageSize();return n.height=i[1]+"px",u.isIE?(n.left=r.documentElement.scrollLeft,n.width=r.documentElement.clientWidth):(n.left="0",n.width="100%"),r.body.appendChild(e),e},n.prompt=function(n,i,s){var o,a;i===undefined&&(i="");var f=function(e){var t=e.charCode||e.keyCode;t===27&&l(!0)},l=function(t){e.removeEvent(r.body,"keydown",f);var n=a.value;return t?n=null:(n=n.replace(/^http:\/\/(https?|ftp):\/\//,"$1://"),/^(?:https?|ftp):\/\//.test(n)||(n="http://"+n)),o.parentNode.removeChild(o),s(n),!1},c=function(){o=r.createElement("div"),o.className="wmd-prompt-dialog",o.style.padding="10px;",o.style.position="fixed",o.style.width="400px",o.style.zIndex="1001";var s=r.createElement("div");s.innerHTML=n,s.style.padding="5px",o.appendChild(s);var c=r.createElement("form"),h=c.style;c.onsubmit=function(){return l(!1)},h.padding="0",h.margin="0",h.cssFloat="left",h.width="100%",h.textAlign="center",h.position="relative",o.appendChild(c),a=r.createElement("input"),a.type="text",a.value=i,h=a.style,h.display="block",h.width="80%",h.marginLeft=h.marginRight="auto",c.appendChild(a);var p=r.createElement("input");p.type="button",p.onclick=function(){return l(!1)},p.value="OK",h=p.style,h.margin="10px",h.display="inline",h.width="7em";var d=r.createElement("input");d.type="button",d.onclick=function(){return l(!0)},d.value="Cancel",h=d.style,h.margin="10px",h.display="inline",h.width="7em",c.appendChild(p),c.appendChild(d),e.addEvent(r.body,"keydown",f),o.style.top="50%",o.style.left="50%",o.style.display="block",u.isIE_5or6&&(o.style.position="absolute",o.style.top=r.documentElement.scrollTop+200+"px",o.style.left="50%"),r.body.appendChild(o),o.style.marginTop=-(t.getHeight(o)/2)+"px",o.style.marginLeft=-(t.getWidth(o)/2)+"px"};setTimeout(function(){c();var e=i.length;if(a.selectionStart!==undefined)a.selectionStart=0,a.selectionEnd=e;else if(a.createTextRange){var t=a.createTextRange();t.collapse(!1),t.moveStart("character",-e),t.moveEnd("character",e),t.select()}a.focus()},0)};var y=g.prototype;y.prefixes="(?:\\s{4,}|\\s*>|\\s*-\\s+|\\s*\\d+\\.|=|\\+|-|_|\\*|#|\\s*\\[[^\n]]+\\]:)",y.unwrap=function(e){var t=new i("([^\\n])\\n(?!(\\n|"+this.prefixes+"))","g");e.selection=e.selection.replace(t,"$1 $2")},y.wrap=function(e,t){this.unwrap(e);var n=new i("(.{1,"+t+"})( +|$\\n?)","gm"),r=this;e.selection=e.selection.replace(n,function(e,t){return(new i("^"+r.prefixes,"")).test(e)?e:t+"\n"}),e.selection=e.selection.replace(/\s+$/,"")},y.doBold=function(e,t){return this.doBorI(e,t,2,this.getString("boldexample"))},y.doItalic=function(e,t){return this.doBorI(e,t,1,this.getString("italicexample"))},y.doBorI=function(e,t,n,r){e.trimWhitespace(),e.selection=e.selection.replace(/\n{2,}/g,"\n");var s=/(\**$)/.exec(e.before)[0],o=/(^\**)/.exec(e.after)[0],u=Math.min(s.length,o.length);if(u>=n&&(u!=2||n!=1))e.before=e.before.replace(i("[*]{"+n+"}$",""),""),e.after=e.after.replace(i("^[*]{"+n+"}",""),"");else if(!e.selection&&o){e.after=e.after.replace(/^([*_]*)/,""),e.before=e.before.replace(/(\s?)$/,"");var a=i.$1;e.before=e.before+o+a}else{!e.selection&&!o&&(e.selection=r);var f=n<=1?"*":"**";e.before=e.before+f,e.after=f+e.after}return},y.stripLinkDefs=function(e,t){return e=e.replace(/^[ ]{0,3}\[(\d+)\]:[ \t]*\n?[ \t]*?[ \t]*\n?[ \t]*(?:(\n*)["(](.+?)[")][ \t]*)?(?:\n+|$)/gm,function(e,n,r,i,s){return t[n]=e.replace(/\s*$/,""),i?(t[n]=e.replace(/["(](.+?)[")]$/,""),i+s):""}),e},y.addLinkDef=function(e,t){var n=0,r={};e.before=this.stripLinkDefs(e.before,r),e.selection=this.stripLinkDefs(e.selection,r),e.after=this.stripLinkDefs(e.after,r);var i="",s=/(\[)((?:\[[^\]]*\]|[^\[\]])*)(\][ ]?(?:\n[ ]*)?\[)(\d+)(\])/g,o=function(e){n++,e=e.replace(/^[ ]{0,3}\[(\d+)\]:/," ["+n+"]:"),i+="\n"+e},u=function(e,t,i,a,f,l){return i=i.replace(s,u),r[f]?(o(r[f]),t+i+a+n+l):e};e.before=e.before.replace(s,u),t?o(t):e.selection=e.selection.replace(s,u);var a=n;return e.after=e.after.replace(s,u),e.after&&(e.after=e.after.replace(/\n*$/,"")),e.after||(e.selection=e.selection.replace(/\n*$/,"")),e.after+="\n\n"+i,a},y.doLinkOrImage=function(e,t,r){e.trimWhitespace(),e.findTags(/\s*!?\[/,/\][ ]?(?:\n[ ]*)?(\[.*?\])?/);var i;if(!(e.endTag.length>1&&e.startTag.length>0)){e.selection=e.startTag+e.selection+e.endTag,e.startTag=e.endTag="";if(/\n\n/.test(e.selection)){this.addLinkDef(e,null);return}var s=this,o=function(n){i.parentNode.removeChild(i);if(n!==null){e.selection=(" "+e.selection).replace(/([^\\](?:\\\\)*)(?=[[\]])/g,"$1\\").substr(1);var o=" [999]: "+b(n),u=s.addLinkDef(e,o);e.startTag=r?"![":"[",e.endTag="]["+u+"]",e.selection||(r?e.selection=s.getString("imagedescription"):e.selection=s.getString("linkdescription"))}t()};return i=n.createBackground(),r?this.hooks.insertImageDialog(o)||n.prompt(this.getString("imagedialog"),f,o):this.hooks.insertLinkDialog(o)||n.prompt(this.getString("linkdialog"),l,o),!0}e.startTag=e.startTag.replace(/!?\[/,""),e.endTag="",this.addLinkDef(e,null)},y.doAutoindent=function(e,t){var n=this,r=!1;e.before=e.before.replace(/(\n|^)[ ]{0,3}([*+-]|\d+[.])[ \t]*\n$/,"\n\n"),e.before=e.before.replace(/(\n|^)[ ]{0,3}>[ \t]*\n$/,"\n\n"),e.before=e.before.replace(/(\n|^)[ \t]+\n$/,"\n\n"),!e.selection&&!/^[ \t]*(?:\n|$)/.test(e.after)&&(e.after=e.after.replace(/^[^\n]*/,function(t){return e.selection=t,""}),r=!0),/(\n|^)[ ]{0,3}([*+-]|\d+[.])[ \t]+.*\n$/.test(e.before)&&n.doList&&n.doList(e),/(\n|^)[ ]{0,3}>[ \t]+.*\n$/.test(e.before)&&n.doBlockquote&&n.doBlockquote(e),/(\n|^)(\t|[ ]{4,}).*\n$/.test(e.before)&&n.doCode&&n.doCode(e),r&&(e.after=e.selection+e.after,e.selection="")},y.doBlockquote=function(e,t){e.selection=e.selection.replace(/^(\n*)([^\r]+?)(\n*)$/,function(t,n,r,i){return e.before+=n,e.after=i+e.after,r}),e.before=e.before.replace(/(>[ \t]*)$/,function(t,n){return e.selection=n+e.selection,""}),e.selection=e.selection.replace(/^(\s|>)+$/,""),e.selection=e.selection||this.getString("quoteexample");var n="",r="",i;if(e.before){var s=e.before.replace(/\n$/,"").split("\n"),u=!1;for(var a=0;a0,/^>/.test(i)?(f=!0,!u&&i.length>1&&(u=!0)):/^[ \t]*$/.test(i)?f=!0:f=u,f?n+=i+"\n":(r+=n+i,n="\n")}/(^|\n)>/.test(n)||(r+=n,n="")}e.startTag=n,e.before=r,e.after&&(e.after=e.after.replace(/^\n?/,"\n")),e.after=e.after.replace(/^(((\n|^)(\n[ \t]*)*>(.+\n)*.*)+(\n[ \t]*)*)/,function(t){return e.endTag=t,""});var l=function(t){var n=t?"> ":"";e.startTag&&(e.startTag=e.startTag.replace(/\n((>|\s)*)\n$/,function(e,t){return"\n"+t.replace(/^[ ]{0,3}>?[ \t]*$/gm,n)+"\n"})),e.endTag&&(e.endTag=e.endTag.replace(/^\n((>|\s)*)\n/,function(e,t){return"\n"+t.replace(/^[ ]{0,3}>?[ \t]*$/gm,n)+"\n"}))};/^(?![ ]{0,3}>)/m.test(e.selection)?(this.wrap(e,o.lineLength-2),e.selection=e.selection.replace(/^/gm,"> "),l(!0),e.skipLines()):(e.selection=e.selection.replace(/^[ ]{0,3}> ?/gm,""),this.unwrap(e),l(!1),!/^(\n|^)[ ]{0,3}>/.test(e.selection)&&e.startTag&&(e.startTag=e.startTag.replace(/\n{0,2}$/,"\n\n")),!/(\n|^)[ ]{0,3}>.*$/.test(e.selection)&&e.endTag&&(e.endTag=e.endTag.replace(/^\n{0,2}/,"\n\n"))),e.selection=this.hooks.postBlockquoteCreation(e.selection),/\n/.test(e.selection)||(e.selection=e.selection.replace(/^(> *)/,function(t,n){return e.startTag+=n,""}))},y.doCode=function(e,t){var n=/\S[ ]*$/.test(e.before),r=/^[ ]*\S/.test(e.after);if(!r&&!n||/\n/.test(e.selection)){e.before=e.before.replace(/[ ]{4}$/,function(t){return e.selection=t+e.selection,""});var i=1,s=1;/(\n|^)(\t|[ ]{4,}).*\n$/.test(e.before)&&(i=0),/^\n(\t|[ ]{4,})/.test(e.after)&&(s=0),e.skipLines(i,s),e.selection?/^[ ]{0,3}\S/m.test(e.selection)?/\n/.test(e.selection)?e.selection=e.selection.replace(/^/gm," "):e.before+=" ":e.selection=e.selection.replace(/^(?:[ ]{4}|[ ]{0,3}\t)/gm,""):(e.startTag=" ",e.selection=this.getString("codeexample"))}else e.trimWhitespace(),e.findTags(/`/,/`/),!e.startTag&&!e.endTag?(e.startTag=e.endTag="`",e.selection||(e.selection=this.getString("codeexample"))):e.endTag&&!e.startTag?(e.before+=e.endTag,e.endTag=""):e.startTag=e.endTag=""},y.doList=function(e,t,n){var r=/(\n|^)(([ ]{0,3}([*+-]|\d+[.])[ \t]+.*)(\n.+|\n{2,}([*+-].*|\d+[.])[ \t]+.*|\n{2,}[ \t]+\S.*)*)\n*$/,s=/^\n*(([ ]{0,3}([*+-]|\d+[.])[ \t]+.*)(\n.+|\n{2,}([*+-].*|\d+[.])[ \t]+.*|\n{2,}[ \t]+\S.*)*)\n*/,u="-",a=1,f=function(){var e;return n?(e=" "+a+". ",a++):e=" "+u+" ",e},l=function(e){return n===undefined&&(n=/^\s*\d/.test(e)),e=e.replace(/^[ ]{0,3}([*+-]|\d+[.])\s/gm,function(e){return f()}),e};e.findTags(/(\n|^)*[ ]{0,3}([*+-]|\d+[.])\s+/,null),e.before&&!/\n$/.test(e.before)&&!/^\n/.test(e.startTag)&&(e.before+=e.startTag,e.startTag="");if(e.startTag){var c=/\d+[.]/.test(e.startTag);e.startTag="",e.selection=e.selection.replace(/\n[ ]{4}/g,"\n"),this.unwrap(e),e.skipLines(),c&&(e.after=e.after.replace(s,l));if(n==c)return}var h=1;e.before=e.before.replace(r,function(e){return/^\s*([*+-])/.test(e)&&(u=i.$1),h=/[^\n]\n\n[^\n]/.test(e)?1:0,l(e)}),e.selection||(e.selection=this.getString("litem"));var p=f(),d=1;e.after=e.after.replace(s,function(e){return d=/[^\n]\n\n[^\n]/.test(e)?1:0,l(e)}),e.trimWhitespace(!0),e.skipLines(h,d,!0),e.startTag=p;var v=p.replace(/./g," ");this.wrap(e,o.lineLength-v.length),e.selection=e.selection.replace(/\n/g,"\n"+v)},y.doHeading=function(e,t){e.selection=e.selection.replace(/\s+/g," "),e.selection=e.selection.replace(/(^\s+|\s+$)/g,"");if(!e.selection){e.startTag="## ",e.selection=this.getString("headingexample"),e.endTag=" ##";return}var n=0;e.findTags(/#+[ ]*/,/[ ]*#+/),/#+/.test(e.startTag)&&(n=i.lastMatch.length),e.startTag=e.endTag="",e.findTags(null,/\s?(-+|=+)/),/=+/.test(e.endTag)&&(n=1),/-+/.test(e.endTag)&&(n=2),e.startTag=e.endTag="",e.skipLines(1,1);var r=n==0?2:n-1;if(r>0){var s=r>=2?"-":"=",u=e.selection.length;u>o.lineLength&&(u=o.lineLength),e.endTag="\n";while(u--)e.endTag+=s}},y.doHorizontalRule=function(e,t){e.startTag="----------\n",e.selection="",e.skipLines(2,1,!0)}}(),define("Markdown.Editor",function(){});var 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",DEFAULT_FILE_TITLE="Title",GDRIVE_DEFAULT_FILE_TITLE="New Markdown document",CHECK_ONLINE_PERIOD=6e4,AJAX_TIMEOUT=1e4,ASYNC_TASK_DEFAULT_TIMEOUT=3e4,AUTH_POPUP_TIMEOUT=9e4,SYNC_PERIOD=18e4,USER_IDLE_THRESHOLD=3e5,SYNC_PROVIDER_GDRIVE="sync.gdrive.",SYNC_PROVIDER_DROPBOX="sync.dropbox.",PUBLISH_PROVIDER_GITHUB="github",PUBLISH_PROVIDER_BLOGGER="blogger",delayedFunction=undefined,BASE_URL="http://localhost/",GOOGLE_KEY="AIzaSyAeCU8CGcSkn0z9js6iocHuPBX4f_mMWkw",GOOGLE_CLIENT_ID="241271498917-lev37kef013q85avc91am1gccg5g8lrb.apps.googleusercontent.com",GITHUB_CLIENT_ID="e47fef6055344579799d",GATEKEEPER_URL="http://stackedit-gatekeeper-localhost.herokuapp.com/";location.hostname.indexOf("benweet.github.io")===0&&(BASE_URL="http://benweet.github.io/stackedit/",GOOGLE_KEY="AIzaSyB1Bc1wI_YUWkkOR-5Gri5BFuypgZl0Sxc",GOOGLE_CLIENT_ID="241271498917-jpto9lls9fqnem1e4h6ppds9uob8rpvu.apps.googleusercontent.com",GITHUB_CLIENT_ID="fa0d09514da8377ee32e",GATEKEEPER_URL="http://stackedit-gatekeeper.herokuapp.com/"),define("config",function(){}),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(){}),define("core",["jquery","file-manager","google-helper","dropbox-helper","github-helper","synchronizer","publisher","async-runner","bootstrap","jgrowl","layout","Markdown.Editor","config","underscore"],function(e,t,n,r,i,s,o,u){function l(){a.currentTime=(new Date).getTime()}function v(){c=!0,h=!0,d=a.currentTime}function m(){return h===!0&&a.currentTime-d>USER_IDLE_THRESHOLD&&(h=!1),h&&p}function y(e,t){e.stop(!0,!0).addClass("error").delay(400).switchClass("error"),t!==undefined&&t.stopPropagation()}function E(){a.isOffline===!0&&navigator.onLine===!0&&b+CHECK_ONLINE_PERIODr?(y(e,t),undefined):i)},a.resetModalInputs=function(){e(".modal input[type=text]:not([disabled])").val("")},a.showWorkingIndicator=function(t){t===!1?(e(".working-indicator").addClass("hide"),e("body").removeClass("working")):(e(".working-indicator").removeClass("hide"),e("body").addClass("working"))},a.showMessage=function(t,n,r){r=r||{},n=n||"icon-info-sign",e.jGrowl(" "+e("
          ").text(t).html(),r)},a.showError=function(e){a.showMessage(e,"icon-warning-sign")},a.isOffline=!1;var b=a.currentTime,w=[];a.setOffline=function(){b=a.currentTime;if(a.isOffline===!1){a.isOffline=!0,a.showMessage("You are offline.","icon-exclamation-sign msg-offline",{sticky:!0,close:function(){a.showMessage("You are back online!","icon-signal")}});for(var e=0;e").addClass("caret")),e(".ui-layout-toggler-south").addClass("btn").append(e("").addClass("caret")),e(".ui-layout-toggler-east").addClass("btn").append(e("").addClass("caret")),e("#navbar").click(function(){t.allowOverflow("north")})};var S=undefined;a.createEditor=function(t){e("#wmd-button-bar").empty();var n=Markdown.getSanitizingConverter(),r=!0;n.hooks.chain("preConversion",function(e){return r||t(),e});var i=new Markdown.Editor(n);i.hooks.set("insertLinkDialog",function(t){return S=t,a.resetModalInputs(),e("#modal-insert-link").modal(),!0}),i.hooks.set("insertImageDialog",function(t){return S=t,a.resetModalInputs(),e("#modal-insert-image").modal(),!0}),i.run(),r=!1,e(".wmd-button-row").addClass("btn-group").find("li:not(.wmd-spacer)").addClass("btn").css("left",0).find("span").hide(),e("#wmd-bold-button").append(e("").addClass("icon-bold")),e("#wmd-italic-button").append(e("").addClass("icon-italic")),e("#wmd-link-button").append(e("").addClass("icon-globe")),e("#wmd-quote-button").append(e("").addClass("icon-indent-left")),e("#wmd-code-button").append(e("").addClass("icon-code")),e("#wmd-image-button").append(e("").addClass("icon-picture")),e("#wmd-olist-button").append(e("").addClass("icon-numbered-list")),e("#wmd-ulist-button").append(e("").addClass("icon-list")),e("#wmd-heading-button").append(e("").addClass("icon-text-height")),e("#wmd-hr-button").append(e("").addClass("icon-hr")),e("#wmd-undo-button").append(e("").addClass("icon-undo")),e("#wmd-redo-button").append(e("").addClass("icon-share-alt"))},a.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 x=[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 a.crc32=function(e){var t=0,n=-1;for(var r=0;r>>8^x[t];return n^=-1,n<0&&(n=4294967295+n+1),n.toString(16)},a.randomString=function(){return Math.ceil(Math.random()*4294967296).toString(36)},a.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)},a.init=function(){T(),N(),e.jGrowl.defaults.life=5e3,e.jGrowl.defaults.closer=!1,e.jGrowl.defaults.closeTemplate="",e.jGrowl.defaults.position="bottom-right",e(window).on("offline",a.setOffline),e(window).on("online",a.setOnline),navigator.onLine===!1&&a.setOffline(),e(document).mousemove(v).keypress(v),e(".dropdown-submenu > a").click(function(e){e.stopPropagation()}),e(".action-insert-link").click(function(t){var n=a.getInputValue(e("#input-insert-link"),t);n!==undefined&&S(n)}),e(".action-insert-image").click(function(t){var n=a.getInputValue(e("#input-insert-image"),t);n!==undefined&&S(n)}),e(".action-close-insert-link").click(function(e){S(null)}),e("#menu-bar, .ui-layout-center, .ui-layout-east, .ui-layout-south").removeClass("hide"),a.loadSettings(),a.createLayout(),e("#wmd-input").css({"font-size":a.settings.editorFontSize+"px","line-height":Math.round(a.settings.editorFontSize*(20/14))+"px"}),e(".action-load-settings").click(function(){a.loadSettings()}),e(".action-apply-settings").click(function(e){a.saveSettings(e),e.isPropagationStopped()||window.location.reload()}),e(".action-reset-input").click(function(){a.resetModalInputs()}),u.init(a),n.init(a,t),r.init(a,t),i.init(a,t),s.init(a,t),o.init(a,t),w.push(s.updateSyncButton),w.push(o.updatePublishButton),t.init(a),f=window.setInterval(function(){l(),a.checkWindowUnique();if(m()===!1)return;s.sync(),u.runTask(),E()},1e3)},a}),requirejs.config({waitSeconds:0,shim:{"jquery-ui":["jquery"],bootstrap:["jquery"],jgrowl:["jquery"],layout:["jquery-ui"],"Markdown.Sanitizer":["Markdown.Converter"],"Markdown.Editor":["Markdown.Sanitizer"]}}),require(["jquery","core"],function(e,t){e(function(){if(window.applicationCache&&window.applicationCache.status===window.applicationCache.UPDATEREADY){window.applicationCache.swapCache(),window.location.reload();return}t.init()})}),define("main",function(){}); \ No newline at end of file +function runDelayedFunction(){delayedFunction!==undefined&&delayedFunction()}(function(e,t){function P(e){var t=e.length,n=b.type(e);return b.isWindow(e)?!1:e.nodeType===1&&t?!0:n==="array"||n!=="function"&&(t===0||typeof t=="number"&&t>0&&t-1 in e)}function B(e){var t=H[e]={};return b.each(e.match(E)||[],function(e,n){t[n]=!0}),t}function I(e,n,r,i){if(!b.acceptData(e))return;var s,o,u=b.expando,a=typeof n=="string",f=e.nodeType,c=f?b.cache:e,h=f?e[u]:e[u]&&u;if((!h||!c[h]||!i&&!c[h].data)&&a&&r===t)return;h||(f?e[u]=h=l.pop()||b.guid++:h=u),c[h]||(c[h]={},f||(c[h].toJSON=b.noop));if(typeof n=="object"||typeof n=="function")i?c[h]=b.extend(c[h],n):c[h].data=b.extend(c[h].data,n);return s=c[h],i||(s.data||(s.data={}),s=s.data),r!==t&&(s[b.camelCase(n)]=r),a?(o=s[n],o==null&&(o=s[b.camelCase(n)])):o=s,o}function q(e,t,n){if(!b.acceptData(e))return;var r,i,s,o=e.nodeType,u=o?b.cache:e,a=o?e[b.expando]:b.expando;if(!u[a])return;if(t){s=n?u[a]:u[a].data;if(s){b.isArray(t)?t=t.concat(b.map(t,b.camelCase)):t in s?t=[t]:(t=b.camelCase(t),t in s?t=[t]:t=t.split(" "));for(r=0,i=t.length;r=0===n})}function pt(e){var t=dt.split("|"),n=e.createDocumentFragment();if(n.createElement)while(t.length)n.createElement(t.pop());return n}function Mt(e,t){return e.getElementsByTagName(t)[0]||e.appendChild(e.ownerDocument.createElement(t))}function _t(e){var t=e.getAttributeNode("type");return e.type=(t&&t.specified)+"/"+e.type,e}function Dt(e){var t=Ct.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function Pt(e,t){var n,r=0;for(;(n=e[r])!=null;r++)b._data(n,"globalEval",!t||b._data(t[r],"globalEval"))}function Ht(e,t){if(t.nodeType!==1||!b.hasData(e))return;var n,r,i,s=b._data(e),o=b._data(t,s),u=s.events;if(u){delete o.handle,o.events={};for(n in u)for(r=0,i=u[n].length;r").css("cssText","display:block !important")).appendTo(t.documentElement),t=(It[0].contentWindow||It[0].contentDocument).document,t.write(""),t.close(),n=fn(e,t),It.detach();Qt[e]=n}return n}function fn(e,t){var n=b(t.createElement(e)).appendTo(t.body),r=b.css(n[0],"display");return n.remove(),r}function vn(e,t,n,r){var i;if(b.isArray(t))b.each(t,function(t,i){n||cn.test(e)?r(e,i):vn(e+"["+(typeof i=="object"?t:"")+"]",i,n,r)});else if(!n&&b.type(t)==="object")for(i in t)vn(e+"["+i+"]",t[i],n,r);else r(e,t)}function _n(e){return function(t,n){typeof t!="string"&&(n=t,t="*");var r,i=0,s=t.toLowerCase().match(E)||[];if(b.isFunction(n))while(r=s[i++])r[0]==="+"?(r=r.slice(1)||"*",(e[r]=e[r]||[]).unshift(n)):(e[r]=e[r]||[]).push(n)}}function Dn(e,t,n,r){function o(u){var a;return i[u]=!0,b.each(e[u]||[],function(e,u){var f=u(t,n,r);if(typeof f=="string"&&!s&&!i[f])return t.dataTypes.unshift(f),o(f),!1;if(s)return!(a=f)}),a}var i={},s=e===An;return o(t.dataTypes[0])||!i["*"]&&o("*")}function Pn(e,n){var r,i,s=b.ajaxSettings.flatOptions||{};for(i in n)n[i]!==t&&((s[i]?e:r||(r={}))[i]=n[i]);return r&&b.extend(!0,e,r),e}function Hn(e,n,r){var i,s,o,u,a=e.contents,f=e.dataTypes,l=e.responseFields;for(u in l)u in r&&(n[l[u]]=r[u]);while(f[0]==="*")f.shift(),s===t&&(s=e.mimeType||n.getResponseHeader("Content-Type"));if(s)for(u in a)if(a[u]&&a[u].test(s)){f.unshift(u);break}if(f[0]in r)o=f[0];else{for(u in r){if(!f[0]||e.converters[u+" "+f[0]]){o=u;break}i||(i=u)}o=o||i}if(o)return o!==f[0]&&f.unshift(o),r[o]}function Bn(e,t){var n,r,i,s,o={},u=0,a=e.dataTypes.slice(),f=a[0];e.dataFilter&&(t=e.dataFilter(t,e.dataType));if(a[1])for(i in e.converters)o[i.toLowerCase()]=e.converters[i];for(;r=a[++u];)if(r!=="*"){if(f!=="*"&&f!==r){i=o[f+" "+r]||o["* "+r];if(!i)for(n in o){s=n.split(" ");if(s[1]===r){i=o[f+" "+s[0]]||o["* "+s[0]];if(i){i===!0?i=o[n]:o[n]!==!0&&(r=s[0],a.splice(u--,0,r));break}}}if(i!==!0)if(i&&e["throws"])t=i(t);else try{t=i(t)}catch(l){return{state:"parsererror",error:i?l:"No conversion from "+f+" to "+r}}}f=r}return{state:"success",data:t}}function zn(){try{return new e.XMLHttpRequest}catch(t){}}function Wn(){try{return new e.ActiveXObject("Microsoft.XMLHTTP")}catch(t){}}function Yn(){return setTimeout(function(){Xn=t}),Xn=b.now()}function Zn(e,t){b.each(t,function(t,n){var r=(Gn[t]||[]).concat(Gn["*"]),i=0,s=r.length;for(;i)[^>]*|#([\w-]*))$/,T=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,N=/^[\],:{}\s]*$/,C=/(?:^|:|,)(?:\s*\[)+/g,k=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,L=/"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g,A=/^-ms-/,O=/-([\da-z])/gi,M=function(e,t){return t.toUpperCase()},_=function(e){if(s.addEventListener||e.type==="load"||s.readyState==="complete")D(),b.ready()},D=function(){s.addEventListener?(s.removeEventListener("DOMContentLoaded",_,!1),e.removeEventListener("load",_,!1)):(s.detachEvent("onreadystatechange",_),e.detachEvent("onload",_))};b.fn=b.prototype={jquery:c,constructor:b,init:function(e,n,r){var i,o;if(!e)return this;if(typeof e=="string"){e.charAt(0)==="<"&&e.charAt(e.length-1)===">"&&e.length>=3?i=[null,e,null]:i=x.exec(e);if(i&&(i[1]||!n)){if(i[1]){n=n instanceof b?n[0]:n,b.merge(this,b.parseHTML(i[1],n&&n.nodeType?n.ownerDocument||n:s,!0));if(T.test(i[1])&&b.isPlainObject(n))for(i in n)b.isFunction(this[i])?this[i](n[i]):this.attr(i,n[i]);return this}o=s.getElementById(i[2]);if(o&&o.parentNode){if(o.id!==i[2])return r.find(e);this.length=1,this[0]=o}return this.context=s,this.selector=e,this}return!n||n.jquery?(n||r).find(e):this.constructor(n).find(e)}return e.nodeType?(this.context=this[0]=e,this.length=1,this):b.isFunction(e)?r.ready(e):(e.selector!==t&&(this.selector=e.selector,this.context=e.context),b.makeArray(e,this))},selector:"",length:0,size:function(){return this.length},toArray:function(){return d.call(this)},get:function(e){return e==null?this.toArray():e<0?this[this.length+e]:this[e]},pushStack:function(e){var t=b.merge(this.constructor(),e);return t.prevObject=this,t.context=this.context,t},each:function(e,t){return b.each(this,e,t)},ready:function(e){return b.ready.promise().done(e),this},slice:function(){return this.pushStack(d.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(n>=0&&n0)return;n.resolveWith(s,[b]),b.fn.trigger&&b(s).trigger("ready").off("ready")},isFunction:function(e){return b.type(e)==="function"},isArray:Array.isArray||function(e){return b.type(e)==="array"},isWindow:function(e){return e!=null&&e==e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return e==null?String(e):typeof e=="object"||typeof e=="function"?f[m.call(e)]||"object":typeof e},isPlainObject:function(e){if(!e||b.type(e)!=="object"||e.nodeType||b.isWindow(e))return!1;try{if(e.constructor&&!g.call(e,"constructor")&&!g.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(n){return!1}var r;for(r in e);return r===t||g.call(e,r)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},error:function(e){throw new Error(e)},parseHTML:function(e,t,n){if(!e||typeof e!="string")return null;typeof t=="boolean"&&(n=t,t=!1),t=t||s;var r=T.exec(e),i=!n&&[];return r?[t.createElement(r[1])]:(r=b.buildFragment([e],t,i),i&&b(i).remove(),b.merge([],r.childNodes))},parseJSON:function(t){if(e.JSON&&e.JSON.parse)return e.JSON.parse(t);if(t===null)return t;if(typeof t=="string"){t=b.trim(t);if(t&&N.test(t.replace(k,"@").replace(L,"]").replace(C,"")))return(new Function("return "+t))()}b.error("Invalid JSON: "+t)},parseXML:function(n){var r,i;if(!n||typeof n!="string")return null;try{e.DOMParser?(i=new DOMParser,r=i.parseFromString(n,"text/xml")):(r=new ActiveXObject("Microsoft.XMLDOM"),r.async="false",r.loadXML(n))}catch(s){r=t}return(!r||!r.documentElement||r.getElementsByTagName("parsererror").length)&&b.error("Invalid XML: "+n),r},noop:function(){},globalEval:function(t){t&&b.trim(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(A,"ms-").replace(O,M)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,t,n){var r,i=0,s=e.length,o=P(e);if(n)if(o)for(;i-1)a.splice(r,1),n&&(r<=s&&s--,r<=o&&o--)}),this},has:function(e){return e?b.inArray(e,a)>-1:!!a&&!!a.length},empty:function(){return a=[],this},disable:function(){return a=f=r=t,this},disabled:function(){return!a},lock:function(){return f=t,r||c.disable(),this},locked:function(){return!f},fireWith:function(e,t){return t=t||[],t=[e,t.slice?t.slice():t],a&&(!i||f)&&(n?f.push(t):l(t)),this},fire:function(){return c.fireWith(this,arguments),this},fired:function(){return!!i}};return c},b.extend({Deferred:function(e){var t=[["resolve","done",b.Callbacks("once memory"),"resolved"],["reject","fail",b.Callbacks("once memory"),"rejected"],["notify","progress",b.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return b.Deferred(function(n){b.each(t,function(t,s){var o=s[0],u=b.isFunction(e[t])&&e[t];i[s[1]](function(){var e=u&&u.apply(this,arguments);e&&b.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[o+"With"](this===r?n.promise():this,u?[e]:arguments)})}),e=null}).promise()},promise:function(e){return e!=null?b.extend(e,r):r}},i={};return r.pipe=r.then,b.each(t,function(e,s){var o=s[2],u=s[3];r[s[1]]=o.add,u&&o.add(function(){n=u},t[e^1][2].disable,t[2][2].lock),i[s[0]]=function(){return i[s[0]+"With"](this===i?r:this,arguments),this},i[s[0]+"With"]=o.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t=0,n=d.call(arguments),r=n.length,i=r!==1||e&&b.isFunction(e.promise)?r:0,s=i===1?e:b.Deferred(),o=function(e,t,n){return function(r){t[e]=this,n[e]=arguments.length>1?d.call(arguments):r,n===u?s.notifyWith(t,n):--i||s.resolveWith(t,n)}},u,a,f;if(r>1){u=new Array(r),a=new Array(r),f=new Array(r);for(;t

    • a",n=p.getElementsByTagName("*"),r=p.getElementsByTagName("a")[0];if(!n||!r||!n.length)return{};u=s.createElement("select"),f=u.appendChild(s.createElement("option")),o=p.getElementsByTagName("input")[0],r.style.cssText="top:1px;float:left;opacity:.5",t={getSetAttribute:p.className!=="t",leadingWhitespace:p.firstChild.nodeType===3,tbody:!p.getElementsByTagName("tbody").length,htmlSerialize:!!p.getElementsByTagName("link").length,style:/top/.test(r.getAttribute("style")),hrefNormalized:r.getAttribute("href")==="/a",opacity:/^0.5/.test(r.style.opacity),cssFloat:!!r.style.cssFloat,checkOn:!!o.value,optSelected:f.selected,enctype:!!s.createElement("form").enctype,html5Clone:s.createElement("nav").cloneNode(!0).outerHTML!=="<:nav>",boxModel:s.compatMode==="CSS1Compat",deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,boxSizingReliable:!0,pixelPosition:!1},o.checked=!0,t.noCloneChecked=o.cloneNode(!0).checked,u.disabled=!0,t.optDisabled=!f.disabled;try{delete p.test}catch(d){t.deleteExpando=!1}o=s.createElement("input"),o.setAttribute("value",""),t.input=o.getAttribute("value")==="",o.value="t",o.setAttribute("type","radio"),t.radioValue=o.value==="t",o.setAttribute("checked","t"),o.setAttribute("name","t"),a=s.createDocumentFragment(),a.appendChild(o),t.appendChecked=o.checked,t.checkClone=a.cloneNode(!0).cloneNode(!0).lastChild.checked,p.attachEvent&&(p.attachEvent("onclick",function(){t.noCloneEvent=!1}),p.cloneNode(!0).click());for(h in{submit:!0,change:!0,focusin:!0})p.setAttribute(l="on"+h,"t"),t[h+"Bubbles"]=l in e||p.attributes[l].expando===!1;return p.style.backgroundClip="content-box",p.cloneNode(!0).style.backgroundClip="",t.clearCloneStyle=p.style.backgroundClip==="content-box",b(function(){var n,r,o,u="padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;",a=s.getElementsByTagName("body")[0];if(!a)return;n=s.createElement("div"),n.style.cssText="border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px",a.appendChild(n).appendChild(p),p.innerHTML="
      t
      ",o=p.getElementsByTagName("td"),o[0].style.cssText="padding:0;margin:0;border:0;display:none",c=o[0].offsetHeight===0,o[0].style.display="",o[1].style.display="none",t.reliableHiddenOffsets=c&&o[0].offsetHeight===0,p.innerHTML="",p.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",t.boxSizing=p.offsetWidth===4,t.doesNotIncludeMarginInBodyOffset=a.offsetTop!==1,e.getComputedStyle&&(t.pixelPosition=(e.getComputedStyle(p,null)||{}).top!=="1%",t.boxSizingReliable=(e.getComputedStyle(p,null)||{width:"4px"}).width==="4px",r=p.appendChild(s.createElement("div")),r.style.cssText=p.style.cssText=u,r.style.marginRight=r.style.width="0",p.style.width="1px",t.reliableMarginRight=!parseFloat((e.getComputedStyle(r,null)||{}).marginRight)),typeof p.style.zoom!==i&&(p.innerHTML="",p.style.cssText=u+"width:1px;padding:1px;display:inline;zoom:1",t.inlineBlockNeedsLayout=p.offsetWidth===3,p.style.display="block",p.innerHTML="
      ",p.firstChild.style.width="5px",t.shrinkWrapBlocks=p.offsetWidth!==3,t.inlineBlockNeedsLayout&&(a.style.zoom=1)),a.removeChild(n),n=p=o=r=null}),n=u=a=f=r=o=null,t}();var j=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,F=/([A-Z])/g;b.extend({cache:{},expando:"jQuery"+(c+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(e){return e=e.nodeType?b.cache[e[b.expando]]:e[b.expando],!!e&&!U(e)},data:function(e,t,n){return I(e,t,n)},removeData:function(e,t){return q(e,t)},_data:function(e,t,n){return I(e,t,n,!0)},_removeData:function(e,t){return q(e,t,!0)},acceptData:function(e){if(e.nodeType&&e.nodeType!==1&&e.nodeType!==9)return!1;var t=e.nodeName&&b.noData[e.nodeName.toLowerCase()];return!t||t!==!0&&e.getAttribute("classid")===t}}),b.fn.extend({data:function(e,n){var r,i,s=this[0],o=0,u=null;if(e===t){if(this.length){u=b.data(s);if(s.nodeType===1&&!b._data(s,"parsedAttrs")){r=s.attributes;for(;o1,null,!0)},removeData:function(e){return this.each(function(){b.removeData(this,e)})}}),b.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=b._data(e,t),n&&(!r||b.isArray(n)?r=b._data(e,t,b.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=b.queue(e,t),r=n.length,i=n.shift(),s=b._queueHooks(e,t),o=function(){b.dequeue(e,t)};i==="inprogress"&&(i=n.shift(),r--),s.cur=i,i&&(t==="fx"&&n.unshift("inprogress"),delete s.stop,i.call(e,o,s)),!r&&s&&s.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return b._data(e,n)||b._data(e,n,{empty:b.Callbacks("once memory").add(function(){b._removeData(e,t+"queue"),b._removeData(e,n)})})}}),b.fn.extend({queue:function(e,n){var r=2;return typeof e!="string"&&(n=e,e="fx",r--),arguments.length1)},removeAttr:function(e){return this.each(function(){b.removeAttr(this,e)})},prop:function(e,t){return b.access(this,b.prop,e,t,arguments.length>1)},removeProp:function(e){return e=b.propFix[e]||e,this.each(function(){try{this[e]=t,delete this[e]}catch(n){}})},addClass:function(e){var t,n,r,i,s,o=0,u=this.length,a=typeof e=="string"&&e;if(b.isFunction(e))return this.each(function(t){b(this).addClass(e.call(this,t,this.className))});if(a){t=(e||"").match(E)||[];for(;o=0)r=r.replace(" "+i+" "," ");n.className=e?b.trim(r):""}}}return this},toggleClass:function(e,t){var n=typeof e,r=typeof t=="boolean";return b.isFunction(e)?this.each(function(n){b(this).toggleClass(e.call(this,n,this.className,t),t)}):this.each(function(){if(n==="string"){var s,o=0,u=b(this),a=t,f=e.match(E)||[];while(s=f[o++])a=r?a:!u.hasClass(s),u[a?"addClass":"removeClass"](s)}else if(n===i||n==="boolean")this.className&&b._data(this,"__className__",this.className),this.className=this.className||e===!1?"":b._data(this,"__className__")||""})},hasClass:function(e){var t=" "+e+" ",n=0,r=this.length;for(;n=0)return!0;return!1},val:function(e){var n,r,i,s=this[0];if(!arguments.length){if(s)return r=b.valHooks[s.type]||b.valHooks[s.nodeName.toLowerCase()],r&&"get"in r&&(n=r.get(s,"value"))!==t?n:(n=s.value,typeof n=="string"?n.replace(V,""):n==null?"":n);return}return i=b.isFunction(e),this.each(function(n){var s,o=b(this);if(this.nodeType!==1)return;i?s=e.call(this,n,o.val()):s=e,s==null?s="":typeof s=="number"?s+="":b.isArray(s)&&(s=b.map(s,function(e){return e==null?"":e+""})),r=b.valHooks[this.type]||b.valHooks[this.nodeName.toLowerCase()];if(!r||!("set"in r)||r.set(this,s,"value")===t)this.value=s})}}),b.extend({valHooks:{option:{get:function(e){var t=e.attributes.value;return!t||t.specified?e.value:e.text}},select:{get:function(e){var t,n,r=e.options,i=e.selectedIndex,s=e.type==="select-one"||i<0,o=s?null:[],u=s?i+1:r.length,a=i<0?u:s?i:0;for(;a=0}),n.length||(e.selectedIndex=-1),n}}},attr:function(e,n,r){var s,o,u,a=e.nodeType;if(!e||a===3||a===8||a===2)return;if(typeof e.getAttribute===i)return b.prop(e,n,r);o=a!==1||!b.isXMLDoc(e),o&&(n=n.toLowerCase(),s=b.attrHooks[n]||(K.test(n)?W:z));if(r===t)return s&&o&&"get"in s&&(u=s.get(e,n))!==null?u:(typeof e.getAttribute!==i&&(u=e.getAttribute(n)),u==null?t:u);if(r!==null)return s&&o&&"set"in s&&(u=s.set(e,r,n))!==t?u:(e.setAttribute(n,r+""),r);b.removeAttr(e,n)},removeAttr:function(e,t){var n,r,i=0,s=t&&t.match(E);if(s&&e.nodeType===1)while(n=s[i++])r=b.propFix[n]||n,K.test(n)?!G&&Q.test(n)?e[b.camelCase("default-"+n)]=e[r]=!1:e[r]=!1:b.attr(e,n,""),e.removeAttribute(G?n:r)},attrHooks:{type:{set:function(e,t){if(!b.support.radioValue&&t==="radio"&&b.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(e,n,r){var i,s,o,u=e.nodeType;if(!e||u===3||u===8||u===2)return;return o=u!==1||!b.isXMLDoc(e),o&&(n=b.propFix[n]||n,s=b.propHooks[n]),r!==t?s&&"set"in s&&(i=s.set(e,r,n))!==t?i:e[n]=r:s&&"get"in s&&(i=s.get(e,n))!==null?i:e[n]},propHooks:{tabIndex:{get:function(e){var n=e.getAttributeNode("tabindex");return n&&n.specified?parseInt(n.value,10):$.test(e.nodeName)||J.test(e.nodeName)&&e.href?0:t}}}}),W={get:function(e,n){var r=b.prop(e,n),i=typeof r=="boolean"&&e.getAttribute(n),s=typeof r=="boolean"?Y&&G?i!=null:Q.test(n)?e[b.camelCase("default-"+n)]:!!i:e.getAttributeNode(n);return s&&s.value!==!1?n.toLowerCase():t},set:function(e,t,n){return t===!1?b.removeAttr(e,n):Y&&G||!Q.test(n)?e.setAttribute(!G&&b.propFix[n]||n,n):e[b.camelCase("default-"+n)]=e[n]=!0,n}};if(!Y||!G)b.attrHooks.value={get:function(e,n){var r=e.getAttributeNode(n);return b.nodeName(e,"input")?e.defaultValue:r&&r.specified?r.value:t},set:function(e,t,n){if(!b.nodeName(e,"input"))return z&&z.set(e,t,n);e.defaultValue=t}};G||(z=b.valHooks.button={get:function(e,n){var r=e.getAttributeNode(n);return r&&(n==="id"||n==="name"||n==="coords"?r.value!=="":r.specified)?r.value:t},set:function(e,n,r){var i=e.getAttributeNode(r);return i||e.setAttributeNode(i=e.ownerDocument.createAttribute(r)),i.value=n+="",r==="value"||n===e.getAttribute(r)?n:t}},b.attrHooks.contenteditable={get:z.get,set:function(e,t,n){z.set(e,t===""?!1:t,n)}},b.each(["width","height"],function(e,t){b.attrHooks[t]=b.extend(b.attrHooks[t],{set:function(e,n){if(n==="")return e.setAttribute(t,"auto"),n}})})),b.support.hrefNormalized||(b.each(["href","src","width","height"],function(e,n){b.attrHooks[n]=b.extend(b.attrHooks[n],{get:function(e){var r=e.getAttribute(n,2);return r==null?t:r}})}),b.each(["href","src"],function(e,t){b.propHooks[t]={get:function(e){return e.getAttribute(t,4)}}})),b.support.style||(b.attrHooks.style={get:function(e){return e.style.cssText||t},set:function(e,t){return e.style.cssText=t+""}}),b.support.optSelected||(b.propHooks.selected=b.extend(b.propHooks.selected,{get:function(e){var t=e.parentNode;return t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex),null}})),b.support.enctype||(b.propFix.enctype="encoding"),b.support.checkOn||b.each(["radio","checkbox"],function(){b.valHooks[this]={get:function(e){return e.getAttribute("value")===null?"on":e.value}}}),b.each(["radio","checkbox"],function(){b.valHooks[this]=b.extend(b.valHooks[this],{set:function(e,t){if(b.isArray(t))return e.checked=b.inArray(b(e).val(),t)>=0}})});var Z=/^(?:input|select|textarea)$/i,et=/^key/,tt=/^(?:mouse|contextmenu)|click/,nt=/^(?:focusinfocus|focusoutblur)$/,rt=/^([^.]*)(?:\.(.+)|)$/;b.event={global:{},add:function(e,n,r,s,o){var u,a,f,l,c,h,p,d,v,m,g,y=b._data(e);if(!y)return;r.handler&&(l=r,r=l.handler,o=l.selector),r.guid||(r.guid=b.guid++),(a=y.events)||(a=y.events={}),(h=y.handle)||(h=y.handle=function(e){return typeof b===i||!!e&&b.event.triggered===e.type?t:b.event.dispatch.apply(h.elem,arguments)},h.elem=e),n=(n||"").match(E)||[""],f=n.length;while(f--){u=rt.exec(n[f])||[],v=g=u[1],m=(u[2]||"").split(".").sort(),c=b.event.special[v]||{},v=(o?c.delegateType:c.bindType)||v,c=b.event.special[v]||{},p=b.extend({type:v,origType:g,data:s,handler:r,guid:r.guid,selector:o,needsContext:o&&b.expr.match.needsContext.test(o),namespace:m.join(".")},l);if(!(d=a[v])){d=a[v]=[],d.delegateCount=0;if(!c.setup||c.setup.call(e,s,m,h)===!1)e.addEventListener?e.addEventListener(v,h,!1):e.attachEvent&&e.attachEvent("on"+v,h)}c.add&&(c.add.call(e,p),p.handler.guid||(p.handler.guid=r.guid)),o?d.splice(d.delegateCount++,0,p):d.push(p),b.event.global[v]=!0}e=null},remove:function(e,t,n,r,i){var s,o,u,a,f,l,c,h,p,d,v,m=b.hasData(e)&&b._data(e);if(!m||!(l=m.events))return;t=(t||"").match(E)||[""],f=t.length;while(f--){u=rt.exec(t[f])||[],p=v=u[1],d=(u[2]||"").split(".").sort();if(!p){for(p in l)b.event.remove(e,p+t[f],n,r,!0);continue}c=b.event.special[p]||{},p=(r?c.delegateType:c.bindType)||p,h=l[p]||[],u=u[2]&&new RegExp("(^|\\.)"+d.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=s=h.length;while(s--)o=h[s],(i||v===o.origType)&&(!n||n.guid===o.guid)&&(!u||u.test(o.namespace))&&(!r||r===o.selector||r==="**"&&o.selector)&&(h.splice(s,1),o.selector&&h.delegateCount--,c.remove&&c.remove.call(e,o));a&&!h.length&&((!c.teardown||c.teardown.call(e,d,m.handle)===!1)&&b.removeEvent(e,p,m.handle),delete l[p])}b.isEmptyObject(l)&&(delete m.handle,b._removeData(e,"events"))},trigger:function(n,r,i,o){var u,a,f,l,c,h,p,d=[i||s],v=g.call(n,"type")?n.type:n,m=g.call(n,"namespace")?n.namespace.split("."):[];f=h=i=i||s;if(i.nodeType===3||i.nodeType===8)return;if(nt.test(v+b.event.triggered))return;v.indexOf(".")>=0&&(m=v.split("."),v=m.shift(),m.sort()),a=v.indexOf(":")<0&&"on"+v,n=n[b.expando]?n:new b.Event(v,typeof n=="object"&&n),n.isTrigger=!0,n.namespace=m.join("."),n.namespace_re=n.namespace?new RegExp("(^|\\.)"+m.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,n.result=t,n.target||(n.target=i),r=r==null?[n]:b.makeArray(r,[n]),c=b.event.special[v]||{};if(!o&&c.trigger&&c.trigger.apply(i,r)===!1)return;if(!o&&!c.noBubble&&!b.isWindow(i)){l=c.delegateType||v,nt.test(l+v)||(f=f.parentNode);for(;f;f=f.parentNode)d.push(f),h=f;h===(i.ownerDocument||s)&&d.push(h.defaultView||h.parentWindow||e)}p=0;while((f=d[p++])&&!n.isPropagationStopped())n.type=p>1?l:c.bindType||v,u=(b._data(f,"events")||{})[n.type]&&b._data(f,"handle"),u&&u.apply(f,r),u=a&&f[a],u&&b.acceptData(f)&&u.apply&&u.apply(f,r)===!1&&n.preventDefault();n.type=v;if(!o&&!n.isDefaultPrevented()&&(!c._default||c._default.apply(i.ownerDocument,r)===!1)&&(v!=="click"||!b.nodeName(i,"a"))&&b.acceptData(i)&&a&&i[v]&&!b.isWindow(i)){h=i[a],h&&(i[a]=null),b.event.triggered=v;try{i[v]()}catch(y){}b.event.triggered=t,h&&(i[a]=h)}return n.result},dispatch:function(e){e=b.event.fix(e);var n,r,i,s,o,u=[],a=d.call(arguments),f=(b._data(this,"events")||{})[e.type]||[],l=b.event.special[e.type]||{};a[0]=e,e.delegateTarget=this;if(l.preDispatch&&l.preDispatch.call(this,e)===!1)return;u=b.event.handlers.call(this,e,f),n=0;while((s=u[n++])&&!e.isPropagationStopped()){e.currentTarget=s.elem,o=0;while((i=s.handlers[o++])&&!e.isImmediatePropagationStopped())if(!e.namespace_re||e.namespace_re.test(i.namespace))e.handleObj=i,e.data=i.data,r=((b.event.special[i.origType]||{}).handle||i.handler).apply(s.elem,a),r!==t&&(e.result=r)===!1&&(e.preventDefault(),e.stopPropagation())}return l.postDispatch&&l.postDispatch.call(this,e),e.result},handlers:function(e,n){var r,i,s,o,u=[],a=n.delegateCount,f=e.target;if(a&&f.nodeType&&(!e.button||e.type!=="click"))for(;f!=this;f=f.parentNode||this)if(f.nodeType===1&&(f.disabled!==!0||e.type!=="click")){s=[];for(o=0;o=0:b.find(r,this,null,[f]).length),s[r]&&s.push(i);s.length&&u.push({elem:f,handlers:s})}return ai.cacheLength&&delete e[t.shift()],e[n]=r}}function st(e){return e[w]=!0,e}function ot(e){var t=c.createElement("div");try{return e(t)}catch(n){return!1}finally{t=null}}function ut(e,t,n,r){var i,s,o,u,a,f,h,v,m,y;(t?t.ownerDocument||t:E)!==c&&l(t),t=t||c,n=n||[];if(!e||typeof e!="string")return n;if((u=t.nodeType)!==1&&u!==9)return[];if(!p&&!r){if(i=K.exec(e))if(o=i[1]){if(u===9){s=t.getElementById(o);if(!s||!s.parentNode)return n;if(s.id===o)return n.push(s),n}else if(t.ownerDocument&&(s=t.ownerDocument.getElementById(o))&&g(t,s)&&s.id===o)return n.push(s),n}else{if(i[2])return _.apply(n,D.call(t.getElementsByTagName(e),0)),n;if((o=i[3])&&S.getByClassName&&t.getElementsByClassName)return _.apply(n,D.call(t.getElementsByClassName(o),0)),n}if(S.qsa&&!d.test(e)){h=!0,v=w,m=t,y=u===9&&e;if(u===1&&t.nodeName.toLowerCase()!=="object"){f=ht(e),(h=t.getAttribute("id"))?v=h.replace(Y,"\\$&"):t.setAttribute("id",v),v="[id='"+v+"'] ",a=f.length;while(a--)f[a]=v+pt(f[a]);m=$.test(e)&&t.parentNode||t,y=f.join(",")}if(y)try{return _.apply(n,D.call(m.querySelectorAll(y),0)),n}catch(b){}finally{h||t.removeAttribute("id")}}}return Et(e.replace(R,"$1"),t,n,r)}function at(e,t){var n=t&&e,r=n&&(~t.sourceIndex||A)-(~e.sourceIndex||A);if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function ft(e){return function(t){var n=t.nodeName.toLowerCase();return n==="input"&&t.type===e}}function lt(e){return function(t){var n=t.nodeName.toLowerCase();return(n==="input"||n==="button")&&t.type===e}}function ct(e){return st(function(t){return t=+t,st(function(n,r){var i,s=e([],n.length,t),o=s.length;while(o--)n[i=s[o]]&&(n[i]=!(r[i]=n[i]))})})}function ht(e,t){var n,r,s,o,u,a,f,l=C[e+" "];if(l)return t?0:l.slice(0);u=e,a=[],f=i.preFilter;while(u){if(!n||(r=U.exec(u)))r&&(u=u.slice(r[0].length)||u),a.push(s=[]);n=!1;if(r=z.exec(u))n=r.shift(),s.push({value:n,type:r[0].replace(R," ")}),u=u.slice(n.length);for(o in i.filter)(r=V[o].exec(u))&&(!f[o]||(r=f[o](r)))&&(n=r.shift(),s.push({value:n,type:o,matches:r}),u=u.slice(n.length));if(!n)break}return t?u.length:u?ut.error(e):C(e,a).slice(0)}function pt(e){var t=0,n=e.length,r="";for(;t1?function(t,n,r){var i=e.length;while(i--)if(!e[i](t,n,r))return!1;return!0}:e[0]}function mt(e,t,n,r,i){var s,o=[],u=0,a=e.length,f=t!=null;for(;u-1&&(s[f]=!(o[f]=c))}}else g=mt(g===o?g.splice(d,g.length):g),i?i(null,o,g,a):_.apply(o,g)})}function yt(e){var t,n,r,s=e.length,o=i.relative[e[0].type],u=o||i.relative[" "],a=o?1:0,l=dt(function(e){return e===t},u,!0),c=dt(function(e){return P.call(t,e)>-1},u,!0),h=[function(e,n,r){return!o&&(r||n!==f)||((t=n).nodeType?l(e,n,r):c(e,n,r))}];for(;a1&&vt(h),a>1&&pt(e.slice(0,a-1)).replace(R,"$1"),n,a0,o=e.length>0,u=function(u,a,l,h,p){var d,v,m,g=[],y=0,b="0",w=u&&[],E=p!=null,S=f,T=u||o&&i.find.TAG("*",p&&a.parentNode||a),N=x+=S==null?1:Math.random()||.1;E&&(f=a!==c&&a,r=n);for(;(d=T[b])!=null;b++){if(o&&d){v=0;while(m=e[v++])if(m(d,a,l)){h.push(d);break}E&&(x=N,r=++n)}s&&((d=!m&&d)&&y--,u&&w.push(d))}y+=b;if(s&&b!==y){v=0;while(m=t[v++])m(w,g,a,l);if(u){if(y>0)while(b--)!w[b]&&!g[b]&&(g[b]=M.call(h));g=mt(g)}_.apply(h,g),E&&!u&&g.length>0&&y+t.length>1&&ut.uniqueSort(h)}return E&&(x=N,f=S),w};return s?st(u):u}function wt(e,t,n){var r=0,i=t.length;for(;r2&&(a=o[0]).type==="ID"&&t.nodeType===9&&!p&&i.relative[o[1].type]){t=i.find.ID(a.matches[0].replace(et,tt),t)[0];if(!t)return n;e=e.slice(o.shift().value.length)}s=V.needsContext.test(e)?0:o.length;while(s--){a=o[s];if(i.relative[f=a.type])break;if(l=i.find[f])if(r=l(a.matches[0].replace(et,tt),$.test(o[0].type)&&t.parentNode||t)){o.splice(s,1),e=r.length&&pt(o);if(!e)return _.apply(n,D.call(r,0)),n;break}}}return u(e,c)(r,t,p,n,$.test(e)),n}function St(){}var n,r,i,s,o,u,a,f,l,c,h,p,d,v,m,g,y,w="sizzle"+ -(new Date),E=e.document,S={},x=0,T=0,N=it(),C=it(),k=it(),L=typeof t,A=1<<31,O=[],M=O.pop,_=O.push,D=O.slice,P=O.indexOf||function(e){var t=0,n=this.length;for(;t+~])"+H+"*"),W=new RegExp(q),X=new RegExp("^"+j+"$"),V={ID:new RegExp("^#("+B+")"),CLASS:new RegExp("^\\.("+B+")"),NAME:new RegExp("^\\[name=['\"]?("+B+")['\"]?\\]"),TAG:new RegExp("^("+B.replace("w","w*")+")"),ATTR:new RegExp("^"+I),PSEUDO:new RegExp("^"+q),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+H+"*(even|odd|(([+-]|)(\\d*)n|)"+H+"*(?:([+-]|)"+H+"*(\\d+)|))"+H+"*\\)|)","i"),needsContext:new RegExp("^"+H+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+H+"*((?:-\\d)?\\d*)"+H+"*\\)|)(?=[^-]|$)","i")},$=/[\x20\t\r\n\f]*[+~]/,J=/^[^{]+\{\s*\[native code/,K=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,Q=/^(?:input|select|textarea|button)$/i,G=/^h\d$/i,Y=/'|\\/g,Z=/\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,et=/\\([\da-fA-F]{1,6}[\x20\t\r\n\f]?|.)/g,tt=function(e,t){var n="0x"+t-65536;return n!==n?t:n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,n&1023|56320)};try{D.call(E.documentElement.childNodes,0)[0].nodeType}catch(nt){D=function(e){var t,n=[];while(t=this[e++])n.push(t);return n}}o=ut.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?t.nodeName!=="HTML":!1},l=ut.setDocument=function(e){var n=e?e.ownerDocument||e:E;if(n===c||n.nodeType!==9||!n.documentElement)return c;c=n,h=n.documentElement,p=o(n),S.tagNameNoComments=ot(function(e){return e.appendChild(n.createComment("")),!e.getElementsByTagName("*").length}),S.attributes=ot(function(e){e.innerHTML="";var t=typeof e.lastChild.getAttribute("multiple");return t!=="boolean"&&t!=="string"}),S.getByClassName=ot(function(e){return e.innerHTML="",!e.getElementsByClassName||!e.getElementsByClassName("e").length?!1:(e.lastChild.className="e",e.getElementsByClassName("e").length===2)}),S.getByName=ot(function(e){e.id=w+0,e.innerHTML="
      ",h.insertBefore(e,h.firstChild);var t=n.getElementsByName&&n.getElementsByName(w).length===2+n.getElementsByName(w+0).length;return S.getIdNotName=!n.getElementById(w),h.removeChild(e),t}),i.attrHandle=ot(function(e){return e.innerHTML="",e.firstChild&&typeof e.firstChild.getAttribute!==L&&e.firstChild.getAttribute("href")==="#"})?{}:{href:function(e){return e.getAttribute("href",2)},type:function(e){return e.getAttribute("type")}},S.getIdNotName?(i.find.ID=function(e,t){if(typeof t.getElementById!==L&&!p){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},i.filter.ID=function(e){var t=e.replace(et,tt);return function(e){return e.getAttribute("id")===t}}):(i.find.ID=function(e,n){if(typeof n.getElementById!==L&&!p){var r=n.getElementById(e);return r?r.id===e||typeof r.getAttributeNode!==L&&r.getAttributeNode("id").value===e?[r]:t:[]}},i.filter.ID=function(e){var t=e.replace(et,tt);return function(e){var n=typeof e.getAttributeNode!==L&&e.getAttributeNode("id");return n&&n.value===t}}),i.find.TAG=S.tagNameNoComments?function(e,t){if(typeof t.getElementsByTagName!==L)return t.getElementsByTagName(e)}:function(e,t){var n,r=[],i=0,s=t.getElementsByTagName(e);if(e==="*"){while(n=s[i++])n.nodeType===1&&r.push(n);return r}return s},i.find.NAME=S.getByName&&function(e,t){if(typeof t.getElementsByName!==L)return t.getElementsByName(name)},i.find.CLASS=S.getByClassName&&function(e,t){if(typeof t.getElementsByClassName!==L&&!p)return t.getElementsByClassName(e)},v=[],d=[":focus"];if(S.qsa=rt(n.querySelectorAll))ot(function(e){e.innerHTML="",e.querySelectorAll("[selected]").length||d.push("\\["+H+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),e.querySelectorAll(":checked").length||d.push(":checked")}),ot(function(e){e.innerHTML="",e.querySelectorAll("[i^='']").length&&d.push("[*^$]="+H+"*(?:\"\"|'')"),e.querySelectorAll(":enabled").length||d.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),d.push(",.*:")});return(S.matchesSelector=rt(m=h.matchesSelector||h.mozMatchesSelector||h.webkitMatchesSelector||h.oMatchesSelector||h.msMatchesSelector))&&ot(function(e){S.disconnectedMatch=m.call(e,"div"),m.call(e,"[s!='']:x"),v.push("!=",q)}),d=new RegExp(d.join("|")),v=new RegExp(v.join("|")),g=rt(h.contains)||h.compareDocumentPosition?function(e,t){var n=e.nodeType===9?e.documentElement:e,r=t&&t.parentNode;return e===r||!!r&&r.nodeType===1&&!!(n.contains?n.contains(r):e.compareDocumentPosition&&e.compareDocumentPosition(r)&16)}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},y=h.compareDocumentPosition?function(e,t){var r;if(e===t)return a=!0,0;if(r=t.compareDocumentPosition&&e.compareDocumentPosition&&e.compareDocumentPosition(t))return r&1||e.parentNode&&e.parentNode.nodeType===11?e===n||g(E,e)?-1:t===n||g(E,t)?1:0:r&4?-1:1;return e.compareDocumentPosition?-1:1}:function(e,t){var r,i=0,s=e.parentNode,o=t.parentNode,u=[e],f=[t];if(e===t)return a=!0,0;if(!s||!o)return e===n?-1:t===n?1:s?-1:o?1:0;if(s===o)return at(e,t);r=e;while(r=r.parentNode)u.unshift(r);r=t;while(r=r.parentNode)f.unshift(r);while(u[i]===f[i])i++;return i?at(u[i],f[i]):u[i]===E?-1:f[i]===E?1:0},a=!1,[0,0].sort(y),S.detectDuplicates=a,c},ut.matches=function(e,t){return ut(e,null,null,t)},ut.matchesSelector=function(e,t){(e.ownerDocument||e)!==c&&l(e),t=t.replace(Z,"='$1']");if(S.matchesSelector&&!p&&(!v||!v.test(t))&&!d.test(t))try{var n=m.call(e,t);if(n||S.disconnectedMatch||e.document&&e.document.nodeType!==11)return n}catch(r){}return ut(t,c,null,[e]).length>0},ut.contains=function(e,t){return(e.ownerDocument||e)!==c&&l(e),g(e,t)},ut.attr=function(e,t){var n;return(e.ownerDocument||e)!==c&&l(e),p||(t=t.toLowerCase()),(n=i.attrHandle[t])?n(e):p||S.attributes?e.getAttribute(t):((n=e.getAttributeNode(t))||e.getAttribute(t))&&e[t]===!0?t:n&&n.specified?n.value:null},ut.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},ut.uniqueSort=function(e){var t,n=[],r=1,i=0;a=!S.detectDuplicates,e.sort(y);if(a){for(;t=e[r];r++)t===e[r-1]&&(i=n.push(r));while(i--)e.splice(n[i],1)}return e},s=ut.getText=function(e){var t,n="",r=0,i=e.nodeType;if(!i)for(;t=e[r];r++)n+=s(t);else if(i===1||i===9||i===11){if(typeof e.textContent=="string")return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=s(e)}else if(i===3||i===4)return e.nodeValue;return n},i=ut.selectors={cacheLength:50,createPseudo:st,match:V,find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(et,tt),e[3]=(e[4]||e[5]||"").replace(et,tt),e[2]==="~="&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),e[1].slice(0,3)==="nth"?(e[3]||ut.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*(e[3]==="even"||e[3]==="odd")),e[5]=+(e[7]+e[8]||e[3]==="odd")):e[3]&&ut.error(e[0]),e},PSEUDO:function(e){var t,n=!e[5]&&e[2];return V.CHILD.test(e[0])?null:(e[4]?e[2]=e[4]:n&&W.test(n)&&(t=ht(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){return e==="*"?function(){return!0}:(e=e.replace(et,tt).toLowerCase(),function(t){return t.nodeName&&t.nodeName.toLowerCase()===e})},CLASS:function(e){var t=N[e+" "];return t||(t=new RegExp("(^|"+H+")"+e+"("+H+"|$)"))&&N(e,function(e){return t.test(e.className||typeof e.getAttribute!==L&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var i=ut.attr(r,e);return i==null?t==="!=":t?(i+="",t==="="?i===n:t==="!="?i!==n:t==="^="?n&&i.indexOf(n)===0:t==="*="?n&&i.indexOf(n)>-1:t==="$="?n&&i.slice(-n.length)===n:t==="~="?(" "+i+" ").indexOf(n)>-1:t==="|="?i===n||i.slice(0,n.length+1)===n+"-":!1):!0}},CHILD:function(e,t,n,r,i){var s=e.slice(0,3)!=="nth",o=e.slice(-4)!=="last",u=t==="of-type";return r===1&&i===0?function(e){return!!e.parentNode}:function(t,n,a){var f,l,c,h,p,d,v=s!==o?"nextSibling":"previousSibling",m=t.parentNode,g=u&&t.nodeName.toLowerCase(),y=!a&&!u;if(m){if(s){while(v){c=t;while(c=c[v])if(u?c.nodeName.toLowerCase()===g:c.nodeType===1)return!1;d=v=e==="only"&&!d&&"nextSibling"}return!0}d=[o?m.firstChild:m.lastChild];if(o&&y){l=m[w]||(m[w]={}),f=l[e]||[],p=f[0]===x&&f[1],h=f[0]===x&&f[2],c=p&&m.childNodes[p];while(c=++p&&c&&c[v]||(h=p=0)||d.pop())if(c.nodeType===1&&++h&&c===t){l[e]=[x,p,h];break}}else if(y&&(f=(t[w]||(t[w]={}))[e])&&f[0]===x)h=f[1];else while(c=++p&&c&&c[v]||(h=p=0)||d.pop())if((u?c.nodeName.toLowerCase()===g:c.nodeType===1)&&++h){y&&((c[w]||(c[w]={}))[e]=[x,h]);if(c===t)break}return h-=i,h===r||h%r===0&&h/r>=0}}},PSEUDO:function(e,t){var n,r=i.pseudos[e]||i.setFilters[e.toLowerCase()]||ut.error("unsupported pseudo: "+e);return r[w]?r(t):r.length>1?(n=[e,e,"",t],i.setFilters.hasOwnProperty(e.toLowerCase())?st(function(e,n){var i,s=r(e,t),o=s.length;while(o--)i=P.call(e,s[o]),e[i]=!(n[i]=s[o])}):function(e){return r(e,0,n)}):r}},pseudos:{not:st(function(e){var t=[],n=[],r=u(e.replace(R,"$1"));return r[w]?st(function(e,t,n,i){var s,o=r(e,null,i,[]),u=e.length;while(u--)if(s=o[u])e[u]=!(t[u]=s)}):function(e,i,s){return t[0]=e,r(t,null,s,n),!n.pop()}}),has:st(function(e){return function(t){return ut(e,t).length>0}}),contains:st(function(e){return function(t){return(t.textContent||t.innerText||s(t)).indexOf(e)>-1}}),lang:st(function(e){return X.test(e||"")||ut.error("unsupported lang: "+e),e=e.replace(et,tt).toLowerCase(),function(t){var n;do if(n=p?t.getAttribute("xml:lang")||t.getAttribute("lang"):t.lang)return n=n.toLowerCase(),n===e||n.indexOf(e+"-")===0;while((t=t.parentNode)&&t.nodeType===1);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===h},focus:function(e){return e===c.activeElement&&(!c.hasFocus||c.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return t==="input"&&!!e.checked||t==="option"&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeName>"@"||e.nodeType===3||e.nodeType===4)return!1;return!0},parent:function(e){return!i.pseudos.empty(e)},header:function(e){return G.test(e.nodeName)},input:function(e){return Q.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return t==="input"&&e.type==="button"||t==="button"},text:function(e){var t;return e.nodeName.toLowerCase()==="input"&&e.type==="text"&&((t=e.getAttribute("type"))==null||t.toLowerCase()===e.type)},first:ct(function(){return[0]}),last:ct(function(e,t){return[t-1]}),eq:ct(function(e,t,n){return[n<0?n+t:n]}),even:ct(function(e,t){var n=0;for(;n=0;)e.push(r);return e}),gt:ct(function(e,t,n){var r=n<0?n+t:n;for(;++r1?b.unique(n):n),n.selector=(this.selector?this.selector+" ":"")+e,n},has:function(e){var t,n=b(e,this),r=n.length;return this.filter(function(){for(t=0;t=0:b.filter(e,this).length>0:this.filter(e).length>0)},closest:function(e,t){var n,r=0,i=this.length,s=[],o=ft.test(e)||typeof e!="string"?b(e,t||this.context):0;for(;r-1:b.find.matchesSelector(n,e)){s.push(n);break}n=n.parentNode}}return this.pushStack(s.length>1?b.unique(s):s)},index:function(e){return e?typeof e=="string"?b.inArray(this[0],b(e)):b.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){var n=typeof e=="string"?b(e,t):b.makeArray(e&&e.nodeType?[e]:e),r=b.merge(this.get(),n);return this.pushStack(b.unique(r))},addBack:function(e){return this.add(e==null?this.prevObject:this.prevObject.filter(e))}}),b.fn.andSelf=b.fn.addBack,b.each({parent:function(e){var t=e.parentNode;return t&&t.nodeType!==11?t:null},parents:function(e){return b.dir(e,"parentNode")},parentsUntil:function(e,t,n){return b.dir(e,"parentNode",n)},next:function(e){return ct(e,"nextSibling")},prev:function(e){return ct(e,"previousSibling")},nextAll:function(e){return b.dir(e,"nextSibling")},prevAll:function(e){return b.dir(e,"previousSibling")},nextUntil:function(e,t,n){return b.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return b.dir(e,"previousSibling",n)},siblings:function(e){return b.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return b.sibling(e.firstChild)},contents:function(e){return b.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:b.merge([],e.childNodes)}},function(e,t){b.fn[e]=function(n,r){var i=b.map(this,t,n);return ot.test(e)||(r=n),r&&typeof r=="string"&&(i=b.filter(r,i)),i=this.length>1&&!lt[e]?b.unique(i):i,this.length>1&&ut.test(e)&&(i=i.reverse()),this.pushStack(i)}}),b.extend({filter:function(e,t,n){return n&&(e=":not("+e+")"),t.length===1?b.find.matchesSelector(t[0],e)?[t[0]]:[]:b.find.matches(e,t)},dir:function(e,n,r){var i=[],s=e[n];while(s&&s.nodeType!==9&&(r===t||s.nodeType!==1||!b(s).is(r)))s.nodeType===1&&i.push(s),s=s[n];return i},sibling:function(e,t){var n=[];for(;e;e=e.nextSibling)e.nodeType===1&&e!==t&&n.push(e);return n}});var dt="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",vt=/ jQuery\d+="(?:null|\d+)"/g,mt=new RegExp("<(?:"+dt+")[\\s/>]","i"),gt=/^\s+/,yt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,bt=/<([\w:]+)/,wt=/\s*$/g,Lt={option:[1,""],legend:[1,"
      ","
      "],area:[1,"",""],param:[1,"",""],thead:[1,"","
      "],tr:[2,"","
      "],col:[2,"","
      "],td:[3,"","
      "],_default:b.support.htmlSerialize?[0,"",""]:[1,"X
      ","
      "]},At=pt(s),Ot=At.appendChild(s.createElement("div"));Lt.optgroup=Lt.option,Lt.tbody=Lt.tfoot=Lt.colgroup=Lt.caption=Lt.thead,Lt.th=Lt.td,b.fn.extend({text:function(e){return b.access(this,function(e){return e===t?b.text(this):this.empty().append((this[0]&&this[0].ownerDocument||s).createTextNode(e))},null,e,arguments.length)},wrapAll:function(e){if(b.isFunction(e))return this.each(function(t){b(this).wrapAll(e.call(this,t))});if(this[0]){var t=b(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstChild&&e.firstChild.nodeType===1)e=e.firstChild;return e}).append(this)}return this},wrapInner:function(e){return b.isFunction(e)?this.each(function(t){b(this).wrapInner(e.call(this,t))}):this.each(function(){var t=b(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=b.isFunction(e);return this.each(function(n){b(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){b.nodeName(this,"body")||b(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(e){(this.nodeType===1||this.nodeType===11||this.nodeType===9)&&this.appendChild(e)})},prepend:function(){return this.domManip(arguments,!0,function(e){(this.nodeType===1||this.nodeType===11||this.nodeType===9)&&this.insertBefore(e,this.firstChild)})},before:function(){return this.domManip(arguments,!1,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return this.domManip(arguments,!1,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},remove:function(e,t){var n,r=0;for(;(n=this[r])!=null;r++)if(!e||b.filter(e,[n]).length>0)!t&&n.nodeType===1&&b.cleanData(jt(n)),n.parentNode&&(t&&b.contains(n.ownerDocument,n)&&Pt(jt(n,"script")),n.parentNode.removeChild(n));return this},empty:function(){var e,t=0;for(;(e=this[t])!=null;t++){e.nodeType===1&&b.cleanData(jt(e,!1));while(e.firstChild)e.removeChild(e.firstChild);e.options&&b.nodeName(e,"select")&&(e.options.length=0)}return this},clone:function(e,t){return e=e==null?!1:e,t=t==null?e:t,this.map(function(){return b.clone(this,e,t)})},html:function(e){return b.access(this,function(e){var n=this[0]||{},r=0,i=this.length;if(e===t)return n.nodeType===1?n.innerHTML.replace(vt,""):t;if(typeof e=="string"&&!St.test(e)&&(b.support.htmlSerialize||!mt.test(e))&&(b.support.leadingWhitespace||!gt.test(e))&&!Lt[(bt.exec(e)||["",""])[1].toLowerCase()]){e=e.replace(yt,"<$1>");try{for(;r")?s=e.cloneNode(!0):(Ot.innerHTML=e.outerHTML,Ot.removeChild(s=Ot.firstChild));if((!b.support.noCloneEvent||!b.support.noCloneChecked)&&(e.nodeType===1||e.nodeType===11)&&!b.isXMLDoc(e)){r=jt(s),u=jt(e);for(o=0;(i=u[o])!=null;++o)r[o]&&Bt(i,r[o])}if(t)if(n){u=u||jt(e),r=r||jt(s);for(o=0;(i=u[o])!=null;o++)Ht(i,r[o])}else Ht(e,s);return r=jt(s,"script"),r.length>0&&Pt(r,!a&&jt(e,"script")),r=u=i=null,s},buildFragment:function(e,t,n,r){var i,s,o,u,a,f,l,c=e.length,h=pt(t),p=[],d=0;for(;d")+l[2],i=l[0];while(i--)u=u.lastChild;!b.support.leadingWhitespace&>.test(s)&&p.push(t.createTextNode(gt.exec(s)[0]));if(!b.support.tbody){s=a==="table"&&!wt.test(s)?u.firstChild:l[1]===""&&!wt.test(s)?u:0,i=s&&s.childNodes.length;while(i--)b.nodeName(f=s.childNodes[i],"tbody")&&!f.childNodes.length&&s.removeChild(f)}b.merge(p,u.childNodes),u.textContent="";while(u.firstChild)u.removeChild(u.firstChild);u=h.lastChild}}u&&h.removeChild(u),b.support.appendChecked||b.grep(jt(p,"input"),Ft),d=0;while(s=p[d++]){if(r&&b.inArray(s,r)!==-1)continue;o=b.contains(s.ownerDocument,s),u=jt(h.appendChild(s),"script"),o&&Pt(u);if(n){i=0;while(s=u[i++])Nt.test(s.type||"")&&n.push(s)}}return u=null,h},cleanData:function(e,t){var n,r,s,o,u=0,a=b.expando,f=b.cache,c=b.support.deleteExpando,h=b.event.special;for(;(n=e[u])!=null;u++)if(t||b.acceptData(n)){s=n[a],o=s&&f[s];if(o){if(o.events)for(r in o.events)h[r]?b.event.remove(n,r):b.removeEvent(n,r,o.handle);f[s]&&(delete f[s],c?delete n[a]:typeof n.removeAttribute!==i?n.removeAttribute(a):n[a]=null,l.push(s))}}}});var It,qt,Rt,Ut=/alpha\([^)]*\)/i,zt=/opacity\s*=\s*([^)]*)/,Wt=/^(top|right|bottom|left)$/,Xt=/^(none|table(?!-c[ea]).+)/,Vt=/^margin/,$t=new RegExp("^("+w+")(.*)$","i"),Jt=new RegExp("^("+w+")(?!px)[a-z%]+$","i"),Kt=new RegExp("^([+-])=("+w+")","i"),Qt={BODY:"block"},Gt={position:"absolute",visibility:"hidden",display:"block"},Yt={letterSpacing:0,fontWeight:400},Zt=["Top","Right","Bottom","Left"],en=["Webkit","O","Moz","ms"];b.fn.extend({css:function(e,n){return b.access(this,function(e,n,r){var i,s,o={},u=0;if(b.isArray(n)){s=qt(e),i=n.length;for(;u1)},show:function(){return rn(this,!0)},hide:function(){return rn(this)},toggle:function(e){var t=typeof e=="boolean";return this.each(function(){(t?e:nn(this))?b(this).show():b(this).hide()})}}),b.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Rt(e,"opacity");return n===""?"1":n}}}},cssNumber:{columnCount:!0,fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":b.support.cssFloat?"cssFloat":"styleFloat"},style:function(e,n,r,i){if(!e||e.nodeType===3||e.nodeType===8||!e.style)return;var s,o,u,a=b.camelCase(n),f=e.style;n=b.cssProps[a]||(b.cssProps[a]=tn(f,a)),u=b.cssHooks[n]||b.cssHooks[a];if(r===t)return u&&"get"in u&&(s=u.get(e,!1,i))!==t?s:f[n];o=typeof r,o==="string"&&(s=Kt.exec(r))&&(r=(s[1]+1)*s[2]+parseFloat(b.css(e,n)),o="number");if(r==null||o==="number"&&isNaN(r))return;o==="number"&&!b.cssNumber[a]&&(r+="px"),!b.support.clearCloneStyle&&r===""&&n.indexOf("background")===0&&(f[n]="inherit");if(!u||!("set"in u)||(r=u.set(e,r,i))!==t)try{f[n]=r}catch(l){}},css:function(e,n,r,i){var s,o,u,a=b.camelCase(n);return n=b.cssProps[a]||(b.cssProps[a]=tn(e.style,a)),u=b.cssHooks[n]||b.cssHooks[a],u&&"get"in u&&(o=u.get(e,!0,r)),o===t&&(o=Rt(e,n,i)),o==="normal"&&n in Yt&&(o=Yt[n]),r===""||r?(s=parseFloat(o),r===!0||b.isNumeric(s)?s||0:o):o},swap:function(e,t,n,r){var i,s,o={};for(s in t)o[s]=e.style[s],e.style[s]=t[s];i=n.apply(e,r||[]);for(s in t)e.style[s]=o[s];return i}}),e.getComputedStyle?(qt=function(t){return e.getComputedStyle(t,null)},Rt=function(e,n,r){var i,s,o,u=r||qt(e),a=u?u.getPropertyValue(n)||u[n]:t,f=e.style;return u&&(a===""&&!b.contains(e.ownerDocument,e)&&(a=b.style(e,n)),Jt.test(a)&&Vt.test(n)&&(i=f.width,s=f.minWidth,o=f.maxWidth,f.minWidth=f.maxWidth=f.width=a,a=u.width,f.width=i,f.minWidth=s,f.maxWidth=o)),a}):s.documentElement.currentStyle&&(qt=function(e){return e.currentStyle},Rt=function(e,n,r){var i,s,o,u=r||qt(e),a=u?u[n]:t,f=e.style;return a==null&&f&&f[n]&&(a=f[n]),Jt.test(a)&&!Wt.test(n)&&(i=f.left,s=e.runtimeStyle,o=s&&s.left,o&&(s.left=e.currentStyle.left),f.left=n==="fontSize"?"1em":a,a=f.pixelLeft+"px",f.left=i,o&&(s.left=o)),a===""?"auto":a}),b.each(["height","width"],function(e,t){b.cssHooks[t]={get:function(e,n,r){if(n)return e.offsetWidth===0&&Xt.test(b.css(e,"display"))?b.swap(e,Gt,function(){return un(e,t,r)}):un(e,t,r)},set:function(e,n,r){var i=r&&qt(e);return sn(e,n,r?on(e,t,r,b.support.boxSizing&&b.css(e,"boxSizing",!1,i)==="border-box",i):0)}}}),b.support.opacity||(b.cssHooks.opacity={get:function(e,t){return zt.test((t&&e.currentStyle?e.currentStyle.filter:e.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":t?"1":""},set:function(e,t){var n=e.style,r=e.currentStyle,i=b.isNumeric(t)?"alpha(opacity="+t*100+")":"",s=r&&r.filter||n.filter||"";n.zoom=1;if((t>=1||t==="")&&b.trim(s.replace(Ut,""))===""&&n.removeAttribute){n.removeAttribute("filter");if(t===""||r&&!r.filter)return}n.filter=Ut.test(s)?s.replace(Ut,i):s+" "+i}}),b(function(){b.support.reliableMarginRight||(b.cssHooks.marginRight={get:function(e,t){if(t)return b.swap(e,{display:"inline-block"},Rt,[e,"marginRight"])}}),!b.support.pixelPosition&&b.fn.position&&b.each(["top","left"],function(e,t){b.cssHooks[t]={get:function(e,n){if(n)return n=Rt(e,t),Jt.test(n)?b(e).position()[t]+"px":n}}})}),b.expr&&b.expr.filters&&(b.expr.filters.hidden=function(e){return e.offsetWidth<=0&&e.offsetHeight<=0||!b.support.reliableHiddenOffsets&&(e.style&&e.style.display||b.css(e,"display"))==="none"},b.expr.filters.visible=function(e){return!b.expr.filters.hidden(e)}),b.each({margin:"",padding:"",border:"Width"},function(e,t){b.cssHooks[e+t]={expand:function(n){var r=0,i={},s=typeof n=="string"?n.split(" "):[n];for(;r<4;r++)i[e+Zt[r]+t]=s[r]||s[r-2]||s[0];return i}},Vt.test(e)||(b.cssHooks[e+t].set=sn)});var ln=/%20/g,cn=/\[\]$/,hn=/\r?\n/g,pn=/^(?:submit|button|image|reset|file)$/i,dn=/^(?:input|select|textarea|keygen)/i;b.fn.extend({serialize:function(){return b.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=b.prop(this,"elements");return e?b.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!b(this).is(":disabled")&&dn.test(this.nodeName)&&!pn.test(e)&&(this.checked||!xt.test(e))}).map(function(e,t){var n=b(this).val();return n==null?null:b.isArray(n)?b.map(n,function(e){return{name:t.name,value:e.replace(hn,"\r\n")}}):{name:t.name,value:n.replace(hn,"\r\n")}}).get()}}),b.param=function(e,n){var r,i=[],s=function(e,t){t=b.isFunction(t)?t():t==null?"":t,i[i.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};n===t&&(n=b.ajaxSettings&&b.ajaxSettings.traditional);if(b.isArray(e)||e.jquery&&!b.isPlainObject(e))b.each(e,function(){s(this.name,this.value)});else for(r in e)vn(r,e[r],n,s);return i.join("&").replace(ln,"+")},b.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(e,t){b.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}}),b.fn.hover=function(e,t){return this.mouseenter(e).mouseleave(t||e)};var mn,gn,yn=b.now(),bn=/\?/,wn=/#.*$/,En=/([?&])_=[^&]*/,Sn=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,xn=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Tn=/^(?:GET|HEAD)$/,Nn=/^\/\//,Cn=/^([\w.+-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,kn=b.fn.load,Ln={},An={},On="*/".concat("*");try{gn=o.href}catch(Mn){gn=s.createElement("a"),gn.href="",gn=gn.href}mn=Cn.exec(gn.toLowerCase())||[],b.fn.load=function(e,n,r){if(typeof e!="string"&&kn)return kn.apply(this,arguments);var i,s,o,u=this,a=e.indexOf(" ");return a>=0&&(i=e.slice(a,e.length),e=e.slice(0,a)),b.isFunction(n)?(r=n,n=t):n&&typeof n=="object"&&(o="POST"),u.length>0&&b.ajax({url:e,type:o,dataType:"html",data:n}).done(function(e){s=arguments,u.html(i?b("
      ").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(){}),define("async-runner",["underscore"],function(){function o(){if(i===!0){var o=r.timeout||ASYNC_TASK_DEFAULT_TIMEOUT;s+o=500&&e.code<600){o="Google Drive is not accessible.",t.retry();return}e.code===401||e.code===403?(s=!1,o="Access to Google Drive is not authorized."):e.code<=0?(i=!1,s=!1,n.setOffline()):o="Google Drive error ("+e.code+": "+e.message+")."}}t.error()}function c(r){u(function(){if(i===!1){l=!1,r();return}var s={};s.run=function(){if(l===!0){s.success();return}e.ajax({url:"//www.google.com/jsapi",data:{key:GOOGLE_KEY},dataType:"script",timeout:AJAX_TIMEOUT}).done(function(){s.success()}).fail(function(){s.error()})},s.onSuccess=function(){google.load("picker","1",{callback:r}),l=!0},s.onError=function(){n.setOffline(),r()},t.addTask(s)})}var n=undefined,r=undefined,i=!1,s=!1,o={};o.upload=function(e,r,s,o,u){u=u||n.doNothing,a(function(){if(i===!1){u();return}var a=undefined,l={};l.run=function(){var t="-------314159265358979323846",i="\r\n--"+t+"\r\n",c="\r\n--"+t+"--",h="text/x-markdown",p={title:s,mimeType:h};r!==undefined&&(p.parents=[{kind:"drive#fileLink",id:r}]);var d="/upload/drive/v2/files",v="POST",m=undefined;e!==undefined&&(d+="/"+e,v="PUT",m=localStorage[SYNC_PROVIDER_GDRIVE+e+".etag"]);var g={"Content-Type":'multipart/mixed; boundary="'+t+'"'};m!==undefined&&(g["If-Match"]=m);var y=n.encodeBase64(o),b=i+"Content-Type: application/json\r\n\r\n"+JSON.stringify(p)+i+"Content-Type: "+h+"\r\n"+"Content-Transfer-Encoding: base64\r\n"+"\r\n"+y+c,w=gapi.client.request({path:d,method:v,params:{uploadType:"multipart"},headers:g,body:b});w.execute(function(t){if(t&&t.id){a=SYNC_PROVIDER_GDRIVE+t.id,localStorage[a+".etag"]=t.etag,l.success();return}var n=t.error;n!==undefined&&e!==undefined&&(n.code===404?n='File ID "'+e+'" does not exist on Google Drive.':n.code===412&&(localStorage.removeItem("sync.gdrive.lastChangeId"),n='Conflict on file ID "'+e+'". Please restart the synchronization.')),f(n,l,u)})},l.onSuccess=function(){u(a)},l.onError=function(){u()},t.addTask(l)})},o.checkUpdates=function(e,r){r=r||n.doNothing,a(function(){function o(e){var i=undefined,u={};u.run=function(){e.execute(function(e){if(e&&e.largestChangeId){s=e.largestChangeId,i=e.nextPageToken;if(e.items!==undefined)for(var t=0;t").addClass("modal-backdrop").click(function(){s.setVisible(!1),e(".modal-backdrop, .picker").remove(),t()})),s.setVisible(!0)})},o.importFiles=function(e){o.downloadMetadata(e,function(e){if(e===undefined)return;o.downloadContent(e,function(e){if(e===undefined)return;for(var t=0;t:"\|?\*]+$/)?e.indexOf("/")!==0?"/"+e:e:(n.showError('"'+e+'" contains invalid characters.'),undefined)},o}),define("github-helper",["jquery","async-runner"],function(e,t){function o(i){i=i||n.doNothing;var s={};s.run=function(){if(n.isOffline===!0){r=!1,n.showMessage("Operation not available in offline mode."),s.error();return}if(r===!0){s.success();return}e.ajax({url:"lib/github.js",dataType:"script",timeout:AJAX_TIMEOUT}).done(function(){r=!0,s.success()}).fail(function(){s.error()})},s.onSuccess=function(){i()},s.onError=function(){n.setOffline(),i()},t.addTask(s)}function u(s,a){s=s||n.doNothing,o(function(){if(r===!1){s();return}var o=undefined,f=undefined,l=localStorage.githubToken,c="Access to GitHub is not authorized.",h={};h.run=function(){if(i!==undefined){h.success();return}if(l!==undefined){i=new Github({token:l,auth:"oauth"}),h.success();return}if(a===!0){n.showError(),h.error();return}h.timeout=AUTH_POPUP_TIMEOUT,n.showMessage("Please make sure the Github authorization popup is not blocked by your browser."),localStorage.removeItem("githubCode"),f=n.popupWindow("github-oauth-client.html?client_id="+GITHUB_CLIENT_ID,"stackedit-github-oauth",960,600),f.focus(),o=setInterval(function(){var t=localStorage.githubCode;if(f.closed===!0||t!==undefined){localStorage.removeItem("githubCode");if(t===undefined){h.error();return}e.getJSON(GATEKEEPER_URL+"authenticate/"+t,function(e){e.token!==undefined?(localStorage.githubToken=e.token,h.success()):h.error()})}},500)},h.onSuccess=function(){o!==undefined&&clearInterval(o);if(i!==undefined){s();return}u(s,!0)},h.onError=function(){o!==undefined&&clearInterval(o),f!==undefined&&f.close(),n.showError(c),s()},t.addTask(h)})}var n=undefined,r=undefined,i=undefined,s={};return s.upload=function(e,s,o,a,f,l){l=l||n.doNothing,u(function(){if(i===undefined){l("error");return}var u=undefined,c={};c.run=function(){var t=i.getUser();t.show(undefined,function(t,n){if(t){u=t.error,c.error();return}var r=i.getRepo(n.login,e);r.write(s,o,a,f,function(e){if(e){u=e.error,c.error();return}c.success()})})},c.onSuccess=function(){l(u)},c.onError=function(){console.error(u);var e="Could not publish on GitHub.";u===401||u===403?(i=undefined,localStorage.removeItem("githubToken"),e="Access to GitHub is not authorized."):u===0&&(r=!1,i=undefined,n.setOffline()),n.showError(e),l(u)},t.addTask(c)})},s.init=function(e){n=e},s}),define("synchronizer",["jquery","google-helper","dropbox-helper"],function(e,t,n){function h(e){if(u.length===0){d(e);return}var r=u.pop();if(!r){h(e);return}var i=localStorage[r+".contentCRC"],s=localStorage[r+".titleCRC"];if(f==i&&(s===undefined||c==s)){h(e);return}v=!0,o=!0;if(r.indexOf(SYNC_PROVIDER_GDRIVE)===0){var p=r.substring(SYNC_PROVIDER_GDRIVE.length);t.upload(p,undefined,l,a,function(t){if(t!==undefined){localStorage[r+".contentCRC"]=f,localStorage[r+".titleCRC"]=c,h(e);return}e("abort");return})}else if(r.indexOf(SYNC_PROVIDER_DROPBOX)===0){var m=r.substring(SYNC_PROVIDER_DROPBOX.length);m=decodeURIComponent(m),n.upload(m,a,function(t){if(t!==undefined){localStorage[r+".contentCRC"]=f,h(e);return}e("abort");return})}else console.error("Invalid fileSyncIndex: "+r),e("error")}function d(e){if(p.length===0){m(e);return}var t=p.pop(),n=localStorage[t+".sync"];if(!t||n.length===1){d(e);return}a=localStorage[t+".content"],f=i.crc32(a),l=localStorage[t+".title"],c=i.crc32(l),u=n.split(";"),h(e)}function m(e){v===!0?(v=!1,p=localStorage["file.list"].split(";"),d(e)):e()}function g(e){if(r.useGoogleDrive===!1){e();return}var n=parseInt(localStorage[SYNC_PROVIDER_GDRIVE+"lastChangeId"]);t.checkUpdates(n,function(n,r){if(n===undefined){e("error");return}t.downloadContent(n,function(t){if(t===undefined){e("error");return}var n=!1;for(var o=0;oi.currentTime||i.isOffline)return;w=!0,v=!0,E=i.currentTime,r.updateSyncButton(),b(function(t){if(e(t))return;m(function(t){if(e(t))return;w=!1,o=!1})})},r.init=function(t,n){i=t,s=n,r.updateSyncButton(),e(".action-force-sync").click(function(){e(this).hasClass("disabled")||r.forceSync()})},r}),define("github-provider",["jquery","github-helper"],function(e,t){var n=undefined,r={providerType:PROVIDER_TYPE_PUBLISH_FLAG,providerId:PROVIDER_GITHUB,providerName:"GitHub"};return r.publish=function(e,r,i,s){var o=n.settings.commitMsg;t.upload(e.repository,e.branch,e.path,i,o,s)},r.init=function(e){n=e},r}),define("publisher",["jquery","github-provider","underscore"],function(e){function o(t){return t.format===undefined&&(t.format=e("input:radio[name=radio-publish-format]:checked").prop("value")),t.format=="markdown"?e("#wmd-input").val():t.format=="html"?e("#wmd-preview").html():r.applyTemplate(t)}function f(e,t){if(u.length===0){e(t);return}var n=u.pop(),r=JSON.parse(localStorage[n]),s=o(r),l=i[r.provider];l.publish(r,a,s,function(n){f(e,t)})}function c(e,n){var r=undefined;do r="publish."+t.randomString();while(_.has(localStorage,r));localStorage[r]=JSON.stringify(n),localStorage[e+".publish"]+=r+";"}var t=undefined,n=undefined,r={},i=_.chain(arguments).map(function(e){return e&&e.providerType&PROVIDER_TYPE_PUBLISH_FLAG&&[e.providerId,e]}).compact().object().value(),s=!1;r.notifyPublish=function(){var e=n.getCurrentFileIndex();localStorage[e+".publish"].length===1?s=!1:s=!0,r.updatePublishButton(),r.refreshManagePublish()},r.updatePublishButton=function(){l===!0||s===!1||t.isOffline?e(".action-force-publish").addClass("disabled"):e(".action-force-publish").removeClass("disabled")},r.applyTemplate=function(r){var i=n.getCurrentFileIndex();try{return _.template(t.settings.template,{documentTitle:localStorage[i+".title"],documentMarkdown:e("#wmd-input").val(),documentHTML:e("#wmd-preview").html(),publishAttributes:r})}catch(s){throw t.showError(s),s}};var u=[],a=undefined,l=!1;r.publish=function(){if(l===!0||t.isOffline)return;l=!0,r.updatePublishButton();var e=n.getCurrentFileIndex();a=localStorage[e+".title"],u=_.compact(localStorage[e+".publish"].split(";")),f(function(e){l=!1,r.updatePublishButton(),e===undefined&&t.showMessage('"'+a+'" successfully published.')})},r.newLocation=function(e){var s=n.getCurrentFileIndex(),u=localStorage[s+".title"],a=o(e),f=i[e.provider];f.publish(e,u,a,function(n){n===undefined&&(c(s,e),r.notifyPublish(),t.showMessage('"'+u+'" will now be published on GitHub.'))})};var h=['
      ','','','',"
      "].join(""),p='';return r.refreshManagePublish=function(){var t=n.getCurrentFileIndex(),r=_.compact(localStorage[t+".publish"].split(";"));e(".msg-no-publish, .msg-publish-list").addClass("hide"),e("#manage-publish-list .input-append").remove(),r.length>0?e(".msg-publish-list").removeClass("hide"):e(".msg-no-publish").removeClass("hide"),_.each(r,function(t){var r=localStorage[t],s=JSON.parse(r),o=JSON.stringify(_.omit(s,"provider")).replace(/{|}|"/g,"");lineElement=e(_.template(h,{provider:i[s.provider],publishDesc:o})),lineElement.append(e(p).click(function(){n.removePublish(t)})),e("#manage-publish-list").append(lineElement)})},r.init=function(s,o){t=s,n=o,_.each(i,function(e){e.init(t)}),e(".action-force-publish").click(function(){e(this).hasClass("disabled")||r.publish()}),e(".tooltip-template").tooltip({html:!0,container:"#modal-settings",placement:"right",trigger:"manual",title:["Available variables:
      ","
      • documentTitle: document title
      • ","
      • documentMarkdown: document in Markdown format
      • ","
      • documentHTML: document in HTML format
      • ",'
      • publishAttributes: attributes of the publish location (undefined when using "Save")
      ',"Examples:
      ",_.escape("<%= documentTitle %>"),"
      ",_.escape("
      <%- documentHTML %>
      "),"
      ",_.escape('<% if(publishAttributes.provider == "github") print(documentMarkdown); %>'),'

      More info'].join("")}).click(function(t){e(this).tooltip("show"),t.stopPropagation()}),e(document).click(function(t){e(".tooltip-template").tooltip("hide")})},r}),define("file-manager",["jquery","google-helper","dropbox-helper","github-helper","synchronizer","publisher","underscore"],function(e,t,n,r,i,s){function l(e,n){var r=o.getCurrentFileIndex(),i=localStorage[r+".content"],s=localStorage[r+".title"];t.upload(e,n,s,i,function(e){if(e===undefined)return;var t=u.crc32(i);localStorage[e+".contentCRC"]=t;var n=u.crc32(s);localStorage[e+".titleCRC"]=n,localStorage[r+".sync"]+=e+";",v(),o.updateFileTitles(),u.showMessage('"'+s+'" will now be synchronized on Google Drive.')})}function c(e){if(!e)return;var t=SYNC_PROVIDER_GDRIVE+e,n=o.getFileIndexFromSync(t);if(n!==undefined){var r=localStorage[n+".title"];u.showError('File ID is already synchronized with "'+r+'"');return}l(e)}function h(e){if(e===undefined)return;var n=[];for(var r=0;r0?e(".msg-sync-list").removeClass("hide"):e(".msg-no-sync").removeClass("hide"),_.each(n,function(t){var n=e("
      ").addClass("input-prepend input-append");t.indexOf(SYNC_PROVIDER_GDRIVE)===0?(n.append(e("").addClass("add-on").prop("title","Google Drive").html('')),n.append(e("").prop("type","text").prop("disabled",!0).addClass("span5").val(t.substring(SYNC_PROVIDER_GDRIVE.length)))):t.indexOf(SYNC_PROVIDER_DROPBOX)===0&&(n.append(e("").addClass("add-on").prop("title","Dropbox").html('')),n.append(e("").prop("type","text").prop("disabled",!0).addClass("span5").val(decodeURIComponent(t.substring(SYNC_PROVIDER_DROPBOX.length))))),n.append(e("").addClass("btn").html('').prop("title","Remove this location").click(function(){o.removeSync(t),o.updateFileTitles()})),e("#manage-sync-list").append(n)})}function g(t,n){n=n||"markdown",m=t,e('div[class*=" modal-publish-"]').hide().filter(".modal-publish-"+t).show(),u.resetModalInputs(),e("input:radio[name=radio-publish-format][value="+n+"]").prop("checked",!0),e("#modal-publish").modal()}function y(t){var n={};n.repository=u.getInputValue(e("#input-publish-github-reponame"),t),n.branch=u.getInputValue(e("#input-publish-github-branch"),t),n.path=u.getInputValue(e("#input-publish-github-path"),t),n.provider=m;if(t.isPropagationStopped())return;s.newLocation(n)}function b(n){var r=u.getInputValue(e("#input-publish-blogger-url"),n);if(n.isPropagationStopped())return;t.getBlogByUrl(r,function(e){console.log(e)})}var o={},u=undefined,a=localStorage["file.current"];o.getCurrentFileIndex=function(){return a},o.isCurrentFileIndex=function(e){return e==a},o.setCurrentFileIndex=function(e){a=e,u.checkWindowUnique(),e===undefined?localStorage.removeItem("file.current"):localStorage["file.current"]=e};var f=[];o.selectFile=function(t){localStorage["file.list"].length===1&&(t=this.createFile()),t!==undefined&&o.setCurrentFileIndex(t),o.updateFileTitles(),v(),s.notifyPublish(),t=o.getCurrentFileIndex(),e("#wmd-input").val(localStorage[t+".content"]),u.createEditor(function(){o.saveFile()})},o.createFile=function(e,t,n){t=t||"",n=n||[];if(!e){e=DEFAULT_FILE_TITLE;var r=2;while(_.some(f,function(t){return t.title==e}))e=DEFAULT_FILE_TITLE+r++}var i=undefined;do i="file."+u.randomString();while(_.has(localStorage,i+".title"));localStorage[i+".content"]=t,localStorage[i+".title"]=e;var s=_.reduce(n,function(e,t){return e+t+";"},";");return localStorage[i+".sync"]=s,localStorage[i+".publish"]=";",localStorage["file.list"]+=i+";",i},o.deleteFile=function(e){e=e||o.getCurrentFileIndex(),o.isCurrentFileIndex(e)&&o.setCurrentFileIndex();var t=_.compact(localStorage[e+".sync"].split(";"));localStorage.removeItem(e+".sync"),_.each(t,function(e){o.removeSync(e)});var n=_.compact(localStorage[e+".publish"].split(";"));localStorage.removeItem(e+".publish"),_.each(n,function(e){o.removePublish(e)}),localStorage["file.list"]=localStorage["file.list"].replace(";"+e+";",";"),localStorage.removeItem(e+".title"),localStorage.removeItem(e+".content")},o.saveFile=function(){var t=e("#wmd-input").val(),n=o.getCurrentFileIndex();localStorage[n+".content"]=t,i.notifyChange(n)},o.updateFileTitles=function(){function s(e){var t=" "+localStorage[e+".title"],i=localStorage[e+".sync"];return i.indexOf(";"+SYNC_PROVIDER_DROPBOX)!==-1&&(r=!0,t=''+t),i.indexOf(";"+SYNC_PROVIDER_GDRIVE)!==-1&&(n=!0,t=''+t),t}e("#file-selector").empty(),f=_.chain(localStorage["file.list"].split(";")).compact().reduce(function(e,t){var n=localStorage[t+".title"];return e.push({index:t,title:n}),e},[]).sortBy(function(e){return e.title.toLowerCase()}).value();var t=o.getCurrentFileIndex();t===undefined&&(t=f[0].index,o.setCurrentFileIndex(t));var n=!1,r=!1,u=localStorage[t+".title"];document.title="StackEdit - "+u,e("#file-title").html(s(t)),e(".file-title").text(u),e("#file-title-input").val(u),e("#file-selector").empty(),_.each(f,function(n){var r=e("").html(s(n.index)),i=e("
    • ").append(r);n.index==t?i.addClass("disabled"):r.prop("href","#").click(function(e){return function(){o.selectFile(e)}}(n.index)),e("#file-selector").append(i)}),i.useGoogleDrive=n,i.useDropbox=r},o.removeSync=function(e){var t=o.getFileIndexFromSync(e);t!==undefined&&(localStorage[t+".sync"]=localStorage[t+".sync"].replace(";"+e+";",";"),o.isCurrentFileIndex(t)&&v()),localStorage.removeItem(e+".etag"),localStorage.removeItem(e+".version"),localStorage.removeItem(e+".contentCRC"),localStorage.removeItem(e+".titleCRC")},o.getFileIndexFromSync=function(e){return _.chain(localStorage["file.list"].split(";")).compact().find(function(t){var n=localStorage[t+".sync"];return n.indexOf(";"+e+";")!==-1}).value()},o.removePublish=function(e){var t=o.getFileIndexFromPublish(e);t!==undefined&&(localStorage[t+".publish"]=localStorage[t+".publish"].replace(";"+e+";",";"),o.isCurrentFileIndex(t)&&s.notifyPublish()),localStorage.removeItem(e)},o.getFileIndexFromPublish=function(e){return _.chain(localStorage["file.list"].split(";")).compact().find(function(t){var n=localStorage[t+".publish"];return n.indexOf(";"+e+";")!==-1}).value()};var m=undefined;return o.init=function(r){u=r,o.selectFile(),e(".action-create-file").click(function(){var t=o.createFile();o.selectFile(t),e("#file-title").click()}),e(".action-remove-file").click(function(){o.deleteFile(),o.selectFile()}),e("#file-title").click(function(){e(this).hide(),e("#file-title-input").show().focus()}),e("#file-title-input").blur(function(){var t=e.trim(e(this).val());if(t){var n=o.getCurrentFileIndex()+".title";t!=localStorage[n]&&(localStorage[n]=t,o.updateFileTitles(),o.saveFile())}e(this).hide(),e("#file-title").show()}),e(".action-download-md").click(function(){var t=e("#wmd-input").val(),n="data:application/octet-stream;base64,"+u.encodeBase64(t);window.open(n,"file")}),e(".action-download-html").click(function(){var t=e("#wmd-preview").html(),n="data:application/octet-stream;base64,"+u.encodeBase64(t);window.open(n,"file")}),e(".action-download-template").click(function(){var e=s.applyTemplate(),t="data:application/octet-stream;base64,"+u.encodeBase64(e);window.open(t,"file")}),e(".action-upload-gdrive-root").click(function(){l()}),e(".action-upload-gdrive-select").click(function(){t.picker(function(e){e!==undefined&&e.length!==0&&l(undefined,e[0])},!0)}),e(".action-download-gdrive").click(function(){t.picker(h)}),e(".action-manual-gdrive").click(function(t){var n=u.getInputValue(e("#manual-gdrive-fileid"),t);c(n)}),e(".action-download-dropbox").click(function(){n.picker(d)}),e(".action-upload-dropbox").click(function(t){var n=u.getInputValue(e("#upload-dropbox-path"),t);p(n)}),e(".action-manual-dropbox").click(function(t){var n=u.getInputValue(e("#manual-dropbox-path"),t);p(n)}),e(".action-publish-github").click(function(){g(PROVIDER_GITHUB)}),e(".action-publish-blogger").click(function(){g(PROVIDER_BLOGGER,"html")}),e(".action-process-publish").click(function(e){m==PROVIDER_GITHUB?y(e):m==PROVIDER_BLOGGER&&b(e)})},o}),!function(e){e(function(){e.support.transition=function(){var e=function(){var e=document.createElement("bootstrap"),t={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"},n;for(n in t)if(e.style[n]!==undefined)return t[n]}();return e&&{end:e}}()})}(window.jQuery),!function(e){var t='[data-dismiss="alert"]',n=function(n){e(n).on("click",t,this.close)};n.prototype.close=function(t){function s(){i.trigger("closed").remove()}var n=e(this),r=n.attr("data-target"),i;r||(r=n.attr("href"),r=r&&r.replace(/.*(?=#[^\s]*$)/,"")),i=e(r),t&&t.preventDefault(),i.length||(i=n.hasClass("alert")?n:n.parent()),i.trigger(t=e.Event("close"));if(t.isDefaultPrevented())return;i.removeClass("in"),e.support.transition&&i.hasClass("fade")?i.on(e.support.transition.end,s):s()};var r=e.fn.alert;e.fn.alert=function(t){return this.each(function(){var r=e(this),i=r.data("alert");i||r.data("alert",i=new n(this)),typeof t=="string"&&i[t].call(r)})},e.fn.alert.Constructor=n,e.fn.alert.noConflict=function(){return e.fn.alert=r,this},e(document).on("click.alert.data-api",t,n.prototype.close)}(window.jQuery),!function(e){var t=function(t,n){this.$element=e(t),this.options=e.extend({},e.fn.button.defaults,n)};t.prototype.setState=function(e){var t="disabled",n=this.$element,r=n.data(),i=n.is("input")?"val":"html";e+="Text",r.resetText||n.data("resetText",n[i]()),n[i](r[e]||this.options[e]),setTimeout(function(){e=="loadingText"?n.addClass(t).attr(t,t):n.removeClass(t).removeAttr(t)},0)},t.prototype.toggle=function(){var e=this.$element.closest('[data-toggle="buttons-radio"]');e&&e.find(".active").removeClass("active"),this.$element.toggleClass("active")};var n=e.fn.button;e.fn.button=function(n){return this.each(function(){var r=e(this),i=r.data("button"),s=typeof n=="object"&&n;i||r.data("button",i=new t(this,s)),n=="toggle"?i.toggle():n&&i.setState(n)})},e.fn.button.defaults={loadingText:"loading..."},e.fn.button.Constructor=t,e.fn.button.noConflict=function(){return e.fn.button=n,this},e(document).on("click.button.data-api","[data-toggle^=button]",function(t){var n=e(t.target);n.hasClass("btn")||(n=n.closest(".btn")),n.button("toggle")})}(window.jQuery),!function(e){var t=function(t,n){this.$element=e(t),this.$indicators=this.$element.find(".carousel-indicators"),this.options=n,this.options.pause=="hover"&&this.$element.on("mouseenter",e.proxy(this.pause,this)).on("mouseleave",e.proxy(this.cycle,this))};t.prototype={cycle:function(t){return t||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(e.proxy(this.next,this),this.options.interval)),this},getActiveIndex:function(){return this.$active=this.$element.find(".item.active"),this.$items=this.$active.parent().children(),this.$items.index(this.$active)},to:function(t){var n=this.getActiveIndex(),r=this;if(t>this.$items.length-1||t<0)return;return this.sliding?this.$element.one("slid",function(){r.to(t)}):n==t?this.pause().cycle():this.slide(t>n?"next":"prev",e(this.$items[t]))},pause:function(t){return t||(this.paused=!0),this.$element.find(".next, .prev").length&&e.support.transition.end&&(this.$element.trigger(e.support.transition.end),this.cycle()),clearInterval(this.interval),this.interval=null,this},next:function(){if(this.sliding)return;return this.slide("next")},prev:function(){if(this.sliding)return;return this.slide("prev")},slide:function(t,n){var r=this.$element.find(".item.active"),i=n||r[t](),s=this.interval,o=t=="next"?"left":"right",u=t=="next"?"first":"last",a=this,f;this.sliding=!0,s&&this.pause(),i=i.length?i:this.$element.find(".item")[u](),f=e.Event("slide",{relatedTarget:i[0],direction:o});if(i.hasClass("active"))return;this.$indicators.length&&(this.$indicators.find(".active").removeClass("active"),this.$element.one("slid",function(){var t=e(a.$indicators.children()[a.getActiveIndex()]);t&&t.addClass("active")}));if(e.support.transition&&this.$element.hasClass("slide")){this.$element.trigger(f);if(f.isDefaultPrevented())return;i.addClass(t),i[0].offsetWidth,r.addClass(o),i.addClass(o),this.$element.one(e.support.transition.end,function(){i.removeClass([t,o].join(" ")).addClass("active"),r.removeClass(["active",o].join(" ")),a.sliding=!1,setTimeout(function(){a.$element.trigger("slid")},0)})}else{this.$element.trigger(f);if(f.isDefaultPrevented())return;r.removeClass("active"),i.addClass("active"),this.sliding=!1,this.$element.trigger("slid")}return s&&this.cycle(),this}};var n=e.fn.carousel;e.fn.carousel=function(n){return this.each(function(){var r=e(this),i=r.data("carousel"),s=e.extend({},e.fn.carousel.defaults,typeof n=="object"&&n),o=typeof n=="string"?n:s.slide;i||r.data("carousel",i=new t(this,s)),typeof n=="number"?i.to(n):o?i[o]():s.interval&&i.pause().cycle()})},e.fn.carousel.defaults={interval:5e3,pause:"hover"},e.fn.carousel.Constructor=t,e.fn.carousel.noConflict=function(){return e.fn.carousel=n,this},e(document).on("click.carousel.data-api","[data-slide], [data-slide-to]",function(t){var n=e(this),r,i=e(n.attr("data-target")||(r=n.attr("href"))&&r.replace(/.*(?=#[^\s]+$)/,"")),s=e.extend({},i.data(),n.data()),o;i.carousel(s),(o=n.attr("data-slide-to"))&&i.data("carousel").pause().to(o).cycle(),t.preventDefault()})}(window.jQuery),!function(e){var t=function(t,n){this.$element=e(t),this.options=e.extend({},e.fn.collapse.defaults,n),this.options.parent&&(this.$parent=e(this.options.parent)),this.options.toggle&&this.toggle()};t.prototype={constructor:t,dimension:function(){var e=this.$element.hasClass("width");return e?"width":"height"},show:function(){var t,n,r,i;if(this.transitioning||this.$element.hasClass("in"))return;t=this.dimension(),n=e.camelCase(["scroll",t].join("-")),r=this.$parent&&this.$parent.find("> .accordion-group > .in");if(r&&r.length){i=r.data("collapse");if(i&&i.transitioning)return;r.collapse("hide"),i||r.data("collapse",null)}this.$element[t](0),this.transition("addClass",e.Event("show"),"shown"),e.support.transition&&this.$element[t](this.$element[0][n])},hide:function(){var t;if(this.transitioning||!this.$element.hasClass("in"))return;t=this.dimension(),this.reset(this.$element[t]()),this.transition("removeClass",e.Event("hide"),"hidden"),this.$element[t](0)},reset:function(e){var t=this.dimension();return this.$element.removeClass("collapse")[t](e||"auto")[0].offsetWidth,this.$element[e!==null?"addClass":"removeClass"]("collapse"),this},transition:function(t,n,r){var i=this,s=function(){n.type=="show"&&i.reset(),i.transitioning=0,i.$element.trigger(r)};this.$element.trigger(n);if(n.isDefaultPrevented())return;this.transitioning=1,this.$element[t]("in"),e.support.transition&&this.$element.hasClass("collapse")?this.$element.one(e.support.transition.end,s):s()},toggle:function(){this[this.$element.hasClass("in")?"hide":"show"]()}};var n=e.fn.collapse;e.fn.collapse=function(n){return this.each(function(){var r=e(this),i=r.data("collapse"),s=e.extend({},e.fn.collapse.defaults,r.data(),typeof n=="object"&&n);i||r.data("collapse",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.collapse.defaults={toggle:!0},e.fn.collapse.Constructor=t,e.fn.collapse.noConflict=function(){return e.fn.collapse=n,this},e(document).on("click.collapse.data-api","[data-toggle=collapse]",function(t){var n=e(this),r,i=n.attr("data-target")||t.preventDefault()||(r=n.attr("href"))&&r.replace(/.*(?=#[^\s]+$)/,""),s=e(i).data("collapse")?"toggle":n.data();n[e(i).hasClass("in")?"addClass":"removeClass"]("collapsed"),e(i).collapse(s)})}(window.jQuery),!function(e){function r(){e(t).each(function(){i(e(this)).removeClass("open")})}function i(t){var n=t.attr("data-target"),r;n||(n=t.attr("href"),n=n&&/#/.test(n)&&n.replace(/.*(?=#[^\s]*$)/,"")),r=n&&e(n);if(!r||!r.length)r=t.parent();return r}var t="[data-toggle=dropdown]",n=function(t){var n=e(t).on("click.dropdown.data-api",this.toggle);e("html").on("click.dropdown.data-api",function(){n.parent().removeClass("open")})};n.prototype={constructor:n,toggle:function(t){var n=e(this),s,o;if(n.is(".disabled, :disabled"))return;return s=i(n),o=s.hasClass("open"),r(),o||s.toggleClass("open"),n.focus(),!1},keydown:function(n){var r,s,o,u,a,f;if(!/(38|40|27)/.test(n.keyCode))return;r=e(this),n.preventDefault(),n.stopPropagation();if(r.is(".disabled, :disabled"))return;u=i(r),a=u.hasClass("open");if(!a||a&&n.keyCode==27)return n.which==27&&u.find(t).focus(),r.click();s=e("[role=menu] li:not(.divider):visible a",u);if(!s.length)return;f=s.index(s.filter(":focus")),n.keyCode==38&&f>0&&f--,n.keyCode==40&&f').appendTo(document.body),this.$backdrop.click(this.options.backdrop=="static"?e.proxy(this.$element[0].focus,this.$element[0]):e.proxy(this.hide,this)),i&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in");if(!t)return;i?this.$backdrop.one(e.support.transition.end,t):t()}else!this.isShown&&this.$backdrop?(this.$backdrop.removeClass("in"),e.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one(e.support.transition.end,t):t()):t&&t()}};var n=e.fn.modal;e.fn.modal=function(n){return this.each(function(){var r=e(this),i=r.data("modal"),s=e.extend({},e.fn.modal.defaults,r.data(),typeof n=="object"&&n);i||r.data("modal",i=new t(this,s)),typeof n=="string"?i[n]():s.show&&i.show()})},e.fn.modal.defaults={backdrop:!0,keyboard:!0,show:!0},e.fn.modal.Constructor=t,e.fn.modal.noConflict=function(){return e.fn.modal=n,this},e(document).on("click.modal.data-api",'[data-toggle="modal"]',function(t){var n=e(this),r=n.attr("href"),i=e(n.attr("data-target")||r&&r.replace(/.*(?=#[^\s]+$)/,"")),s=i.data("modal")?"toggle":e.extend({remote:!/#/.test(r)&&r},i.data(),n.data());t.preventDefault(),i.modal(s).one("hide",function(){n.focus()})})}(window.jQuery),!function(e){var t=function(e,t){this.init("tooltip",e,t)};t.prototype={constructor:t,init:function(t,n,r){var i,s,o,u,a;this.type=t,this.$element=e(n),this.options=this.getOptions(r),this.enabled=!0,o=this.options.trigger.split(" ");for(a=o.length;a--;)u=o[a],u=="click"?this.$element.on("click."+this.type,this.options.selector,e.proxy(this.toggle,this)):u!="manual"&&(i=u=="hover"?"mouseenter":"focus",s=u=="hover"?"mouseleave":"blur",this.$element.on(i+"."+this.type,this.options.selector,e.proxy(this.enter,this)),this.$element.on(s+"."+this.type,this.options.selector,e.proxy(this.leave,this)));this.options.selector?this._options=e.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},getOptions:function(t){return t=e.extend({},e.fn[this.type].defaults,this.$element.data(),t),t.delay&&typeof t.delay=="number"&&(t.delay={show:t.delay,hide:t.delay}),t},enter:function(t){var n=e(t.currentTarget)[this.type](this._options).data(this.type);if(!n.options.delay||!n.options.delay.show)return n.show();clearTimeout(this.timeout),n.hoverState="in",this.timeout=setTimeout(function(){n.hoverState=="in"&&n.show()},n.options.delay.show)},leave:function(t){var n=e(t.currentTarget)[this.type](this._options).data(this.type);this.timeout&&clearTimeout(this.timeout);if(!n.options.delay||!n.options.delay.hide)return n.hide();n.hoverState="out",this.timeout=setTimeout(function(){n.hoverState=="out"&&n.hide()},n.options.delay.hide)},show:function(){var t,n,r,i,s,o,u=e.Event("show");if(this.hasContent()&&this.enabled){this.$element.trigger(u);if(u.isDefaultPrevented())return;t=this.tip(),this.setContent(),this.options.animation&&t.addClass("fade"),s=typeof this.options.placement=="function"?this.options.placement.call(this,t[0],this.$element[0]):this.options.placement,t.detach().css({top:0,left:0,display:"block"}),this.options.container?t.appendTo(this.options.container):t.insertAfter(this.$element),n=this.getPosition(),r=t[0].offsetWidth,i=t[0].offsetHeight;switch(s){case"bottom":o={top:n.top+n.height,left:n.left+n.width/2-r/2};break;case"top":o={top:n.top-i,left:n.left+n.width/2-r/2};break;case"left":o={top:n.top+n.height/2-i/2,left:n.left-r};break;case"right":o={top:n.top+n.height/2-i/2,left:n.left+n.width}}this.applyPlacement(o,s),this.$element.trigger("shown")}},applyPlacement:function(e,t){var n=this.tip(),r=n[0].offsetWidth,i=n[0].offsetHeight,s,o,u,a;n.offset(e).addClass(t).addClass("in"),s=n[0].offsetWidth,o=n[0].offsetHeight,t=="top"&&o!=i&&(e.top=e.top+i-o,a=!0),t=="bottom"||t=="top"?(u=0,e.left<0&&(u=e.left*-2,e.left=0,n.offset(e),s=n[0].offsetWidth,o=n[0].offsetHeight),this.replaceArrow(u-r+s,s,"left")):this.replaceArrow(o-i,o,"top"),a&&n.offset(e)},replaceArrow:function(e,t,n){this.arrow().css(n,e?50*(1-e/t)+"%":"")},setContent:function(){var e=this.tip(),t=this.getTitle();e.find(".tooltip-inner")[this.options.html?"html":"text"](t),e.removeClass("fade in top bottom left right")},hide:function(){function i(){var t=setTimeout(function(){n.off(e.support.transition.end).detach()},500);n.one(e.support.transition.end,function(){clearTimeout(t),n.detach()})}var t=this,n=this.tip(),r=e.Event("hide");this.$element.trigger(r);if(r.isDefaultPrevented())return;return n.removeClass("in"),e.support.transition&&this.$tip.hasClass("fade")?i():n.detach(),this.$element.trigger("hidden"),this},fixTitle:function(){var e=this.$element;(e.attr("title")||typeof e.attr("data-original-title")!="string")&&e.attr("data-original-title",e.attr("title")||"").attr("title","")},hasContent:function(){return this.getTitle()},getPosition:function(){var t=this.$element[0];return e.extend({},typeof t.getBoundingClientRect=="function"?t.getBoundingClientRect():{width:t.offsetWidth,height:t.offsetHeight},this.$element.offset())},getTitle:function(){var e,t=this.$element,n=this.options;return e=t.attr("data-original-title")||(typeof n.title=="function"?n.title.call(t[0]):n.title),e},tip:function(){return this.$tip=this.$tip||e(this.options.template)},arrow:function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},validate:function(){this.$element[0].parentNode||(this.hide(),this.$element=null,this.options=null)},enable:function(){this.enabled=!0},disable:function(){this.enabled=!1},toggleEnabled:function(){this.enabled=!this.enabled},toggle:function(t){var n=t?e(t.currentTarget)[this.type](this._options).data(this.type):this;n.tip().hasClass("in")?n.hide():n.show()},destroy:function(){this.hide().$element.off("."+this.type).removeData(this.type)}};var n=e.fn.tooltip;e.fn.tooltip=function(n){return this.each(function(){var r=e(this),i=r.data("tooltip"),s=typeof n=="object"&&n;i||r.data("tooltip",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.tooltip.Constructor=t,e.fn.tooltip.defaults={animation:!0,placement:"top",selector:!1,template:'
      ',trigger:"hover focus",title:"",delay:0,html:!1,container:!1},e.fn.tooltip.noConflict=function(){return e.fn.tooltip=n,this}}(window.jQuery),!function(e){var t=function(e,t){this.init("popover",e,t)};t.prototype=e.extend({},e.fn.tooltip.Constructor.prototype,{constructor:t,setContent:function(){var e=this.tip(),t=this.getTitle(),n=this.getContent();e.find(".popover-title")[this.options.html?"html":"text"](t),e.find(".popover-content")[this.options.html?"html":"text"](n),e.removeClass("fade top bottom left right in")},hasContent:function(){return this.getTitle()||this.getContent()},getContent:function(){var e,t=this.$element,n=this.options;return e=(typeof n.content=="function"?n.content.call(t[0]):n.content)||t.attr("data-content"),e},tip:function(){return this.$tip||(this.$tip=e(this.options.template)),this.$tip},destroy:function(){this.hide().$element.off("."+this.type).removeData(this.type)}});var n=e.fn.popover;e.fn.popover=function(n){return this.each(function(){var r=e(this),i=r.data("popover"),s=typeof n=="object"&&n;i||r.data("popover",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.popover.Constructor=t,e.fn.popover.defaults=e.extend({},e.fn.tooltip.defaults,{placement:"right",trigger:"click",content:"",template:'

      '}),e.fn.popover.noConflict=function(){return e.fn.popover=n,this}}(window.jQuery),!function(e){function t(t,n){var r=e.proxy(this.process,this),i=e(t).is("body")?e(window):e(t),s;this.options=e.extend({},e.fn.scrollspy.defaults,n),this.$scrollElement=i.on("scroll.scroll-spy.data-api",r),this.selector=(this.options.target||(s=e(t).attr("href"))&&s.replace(/.*(?=#[^\s]+$)/,"")||"")+" .nav li > a",this.$body=e("body"),this.refresh(),this.process()}t.prototype={constructor:t,refresh:function(){var t=this,n;this.offsets=e([]),this.targets=e([]),n=this.$body.find(this.selector).map(function(){var n=e(this),r=n.data("target")||n.attr("href"),i=/^#\w/.test(r)&&e(r);return i&&i.length&&[[i.position().top+(!e.isWindow(t.$scrollElement.get(0))&&t.$scrollElement.scrollTop()),r]]||null}).sort(function(e,t){return e[0]-t[0]}).each(function(){t.offsets.push(this[0]),t.targets.push(this[1])})},process:function(){var e=this.$scrollElement.scrollTop()+this.options.offset,t=this.$scrollElement[0].scrollHeight||this.$body[0].scrollHeight,n=t-this.$scrollElement.height(),r=this.offsets,i=this.targets,s=this.activeTarget,o;if(e>=n)return s!=(o=i.last()[0])&&this.activate(o);for(o=r.length;o--;)s!=i[o]&&e>=r[o]&&(!r[o+1]||e<=r[o+1])&&this.activate(i[o])},activate:function(t){var n,r;this.activeTarget=t,e(this.selector).parent(".active").removeClass("active"),r=this.selector+'[data-target="'+t+'"],'+this.selector+'[href="'+t+'"]',n=e(r).parent("li").addClass("active"),n.parent(".dropdown-menu").length&&(n=n.closest("li.dropdown").addClass("active")),n.trigger("activate")}};var n=e.fn.scrollspy;e.fn.scrollspy=function(n){return this.each(function(){var r=e(this),i=r.data("scrollspy"),s=typeof n=="object"&&n;i||r.data("scrollspy",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.scrollspy.Constructor=t,e.fn.scrollspy.defaults={offset:10},e.fn.scrollspy.noConflict=function(){return e.fn.scrollspy=n,this},e(window).on("load",function(){e('[data-spy="scroll"]').each(function(){var t=e(this);t.scrollspy(t.data())})})}(window.jQuery),!function(e){var t=function(t){this.element=e(t)};t.prototype={constructor:t,show:function(){var t=this.element,n=t.closest("ul:not(.dropdown-menu)"),r=t.attr("data-target"),i,s,o;r||(r=t.attr("href"),r=r&&r.replace(/.*(?=#[^\s]*$)/,""));if(t.parent("li").hasClass("active"))return;i=n.find(".active:last a")[0],o=e.Event("show",{relatedTarget:i}),t.trigger(o);if(o.isDefaultPrevented())return;s=e(r),this.activate(t.parent("li"),n),this.activate(s,s.parent(),function(){t.trigger({type:"shown",relatedTarget:i})})},activate:function(t,n,r){function o(){i.removeClass("active").find("> .dropdown-menu > .active").removeClass("active"),t.addClass("active"),s?(t[0].offsetWidth,t.addClass("in")):t.removeClass("fade"),t.parent(".dropdown-menu")&&t.closest("li.dropdown").addClass("active"),r&&r()}var i=n.find("> .active"),s=r&&e.support.transition&&i.hasClass("fade");s?i.one(e.support.transition.end,o):o(),i.removeClass("in")}};var n=e.fn.tab;e.fn.tab=function(n){return this.each(function(){var r=e(this),i=r.data("tab");i||r.data("tab",i=new t(this)),typeof n=="string"&&i[n]()})},e.fn.tab.Constructor=t,e.fn.tab.noConflict=function(){return e.fn.tab=n,this},e(document).on("click.tab.data-api",'[data-toggle="tab"], [data-toggle="pill"]',function(t){t.preventDefault(),e(this).tab("show")})}(window.jQuery),!function(e){var t=function(t,n){this.$element=e(t),this.options=e.extend({},e.fn.typeahead.defaults,n),this.matcher=this.options.matcher||this.matcher,this.sorter=this.options.sorter||this.sorter,this.highlighter=this.options.highlighter||this.highlighter,this.updater=this.options.updater||this.updater,this.source=this.options.source,this.$menu=e(this.options.menu),this.shown=!1,this.listen()};t.prototype={constructor:t,select:function(){var e=this.$menu.find(".active").attr("data-value");return this.$element.val(this.updater(e)).change(),this.hide()},updater:function(e){return e},show:function(){var t=e.extend({},this.$element.position(),{height:this.$element[0].offsetHeight});return this.$menu.insertAfter(this.$element).css({top:t.top+t.height,left:t.left}).show(),this.shown=!0,this},hide:function(){return this.$menu.hide(),this.shown=!1,this},lookup:function(t){var n;return this.query=this.$element.val(),!this.query||this.query.length"+t+""})},render:function(t){var n=this;return t=e(t).map(function(t,r){return t=e(n.options.item).attr("data-value",r),t.find("a").html(n.highlighter(r)),t[0]}),t.first().addClass("active"),this.$menu.html(t),this},next:function(t){var n=this.$menu.find(".active").removeClass("active"),r=n.next();r.length||(r=e(this.$menu.find("li")[0])),r.addClass("active")},prev:function(e){var t=this.$menu.find(".active").removeClass("active"),n=t.prev();n.length||(n=this.$menu.find("li").last()),n.addClass("active")},listen:function(){this.$element.on("focus",e.proxy(this.focus,this)).on("blur",e.proxy(this.blur,this)).on("keypress",e.proxy(this.keypress,this)).on("keyup",e.proxy(this.keyup,this)),this.eventSupported("keydown")&&this.$element.on("keydown",e.proxy(this.keydown,this)),this.$menu.on("click",e.proxy(this.click,this)).on("mouseenter","li",e.proxy(this.mouseenter,this)).on("mouseleave","li",e.proxy(this.mouseleave,this))},eventSupported:function(e){var t=e in this.$element;return t||(this.$element.setAttribute(e,"return;"),t=typeof this.$element[e]=="function"),t},move:function(e){if(!this.shown)return;switch(e.keyCode){case 9:case 13:case 27:e.preventDefault();break;case 38:e.preventDefault(),this.prev();break;case 40:e.preventDefault(),this.next()}e.stopPropagation()},keydown:function(t){this.suppressKeyPressRepeat=~e.inArray(t.keyCode,[40,38,9,13,27]),this.move(t)},keypress:function(e){if(this.suppressKeyPressRepeat)return;this.move(e)},keyup:function(e){switch(e.keyCode){case 40:case 38:case 16:case 17:case 18:break;case 9:case 13:if(!this.shown)return;this.select();break;case 27:if(!this.shown)return;this.hide();break;default:this.lookup()}e.stopPropagation(),e.preventDefault()},focus:function(e){this.focused=!0},blur:function(e){this.focused=!1,!this.mousedover&&this.shown&&this.hide()},click:function(e){e.stopPropagation(),e.preventDefault(),this.select(),this.$element.focus()},mouseenter:function(t){this.mousedover=!0,this.$menu.find(".active").removeClass("active"),e(t.currentTarget).addClass("active")},mouseleave:function(e){this.mousedover=!1,!this.focused&&this.shown&&this.hide()}};var n=e.fn.typeahead;e.fn.typeahead=function(n){return this.each(function(){var r=e(this),i=r.data("typeahead"),s=typeof n=="object"&&n;i||r.data("typeahead",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.typeahead.defaults={source:[],items:8,menu:'',item:'
    • ',minLength:1},e.fn.typeahead.Constructor=t,e.fn.typeahead.noConflict=function(){return e.fn.typeahead=n,this},e(document).on("focus.typeahead.data-api",'[data-provide="typeahead"]',function(t){var n=e(this);if(n.data("typeahead"))return;n.typeahead(n.data())})}(window.jQuery),!function(e){var t=function(t,n){this.options=e.extend({},e.fn.affix.defaults,n),this.$window=e(window).on("scroll.affix.data-api",e.proxy(this.checkPosition,this)).on("click.affix.data-api",e.proxy(function(){setTimeout(e.proxy(this.checkPosition,this),1)},this)),this.$element=e(t),this.checkPosition()};t.prototype.checkPosition=function(){if(!this.$element.is(":visible"))return;var t=e(document).height(),n=this.$window.scrollTop(),r=this.$element.offset(),i=this.options.offset,s=i.bottom,o=i.top,u="affix affix-top affix-bottom",a;typeof i!="object"&&(s=o=i),typeof o=="function"&&(o=i.top()),typeof s=="function"&&(s=i.bottom()),a=this.unpin!=null&&n+this.unpin<=r.top?!1:s!=null&&r.top+this.$element.height()>=t-s?"bottom":o!=null&&n<=o?"top":!1;if(this.affixed===a)return;this.affixed=a,this.unpin=a=="bottom"?r.top-n:null,this.$element.removeClass(u).addClass("affix"+(a?"-"+a:""))};var n=e.fn.affix;e.fn.affix=function(n){return this.each(function(){var r=e(this),i=r.data("affix"),s=typeof n=="object"&&n;i||r.data("affix",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.affix.Constructor=t,e.fn.affix.defaults={offset:0},e.fn.affix.noConflict=function(){return e.fn.affix=n,this},e(window).on("load",function(){e('[data-spy="affix"]').each(function(){var t=e(this),n=t.data();n.offset=n.offset||{},n.offsetBottom&&(n.offset.bottom=n.offsetBottom),n.offsetTop&&(n.offset.top=n.offsetTop),t.affix(n)})})}(window.jQuery),define("bootstrap",function(){}),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",function(){}),function(e,t){function i(t,n){var r,i,o,u=t.nodeName.toLowerCase();return"area"===u?(r=t.parentNode,i=r.name,!t.href||!i||r.nodeName.toLowerCase()!=="map"?!1:(o=e("img[usemap=#"+i+"]")[0],!!o&&s(o))):(/input|select|textarea|button|object/.test(u)?!t.disabled:"a"===u?t.href||n:n)&&s(t)}function s(t){return e.expr.filters.visible(t)&&!e(t).parents().andSelf().filter(function(){return e.css(this,"visibility")==="hidden"}).length}var n=0,r=/^ui-id-\d+$/;e.ui=e.ui||{};if(e.ui.version)return;e.extend(e.ui,{version:"1.9.2",keyCode:{BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38}}),e.fn.extend({_focus:e.fn.focus,focus:function(t,n){return typeof t=="number"?this.each(function(){var r=this;setTimeout(function(){e(r).focus(),n&&n.call(r)},t)}):this._focus.apply(this,arguments)},scrollParent:function(){var t;return e.ui.ie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?t=this.parents().filter(function(){return/(relative|absolute|fixed)/.test(e.css(this,"position"))&&/(auto|scroll)/.test(e.css(this,"overflow")+e.css(this,"overflow-y")+e.css(this,"overflow-x"))}).eq(0):t=this.parents().filter(function(){return/(auto|scroll)/.test(e.css(this,"overflow")+e.css(this,"overflow-y")+e.css(this,"overflow-x"))}).eq(0),/fixed/.test(this.css("position"))||!t.length?e(document):t},zIndex:function(n){if(n!==t)return this.css("zIndex",n);if(this.length){var r=e(this[0]),i,s;while(r.length&&r[0]!==document){i=r.css("position");if(i==="absolute"||i==="relative"||i==="fixed"){s=parseInt(r.css("zIndex"),10);if(!isNaN(s)&&s!==0)return s}r=r.parent()}}return 0},uniqueId:function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++n)})},removeUniqueId:function(){return this.each(function(){r.test(this.id)&&e(this).removeAttr("id")})}}),e.extend(e.expr[":"],{data:e.expr.createPseudo?e.expr.createPseudo(function(t){return function(n){return!!e.data(n,t)}}):function(t,n,r){return!!e.data(t,r[3])},focusable:function(t){return i(t,!isNaN(e.attr(t,"tabindex")))},tabbable:function(t){var n=e.attr(t,"tabindex"),r=isNaN(n);return(r||n>=0)&&i(t,!r)}}),e(function(){var t=document.body,n=t.appendChild(n=document.createElement("div"));n.offsetHeight,e.extend(n.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0}),e.support.minHeight=n.offsetHeight===100,e.support.selectstart="onselectstart"in n,t.removeChild(n).style.display="none"}),e("").outerWidth(1).jquery||e.each(["Width","Height"],function(n,r){function u(t,n,r,s){return e.each(i,function(){n-=parseFloat(e.css(t,"padding"+this))||0,r&&(n-=parseFloat(e.css(t,"border"+this+"Width"))||0),s&&(n-=parseFloat(e.css(t,"margin"+this))||0)}),n}var i=r==="Width"?["Left","Right"]:["Top","Bottom"],s=r.toLowerCase(),o={innerWidth:e.fn.innerWidth,innerHeight:e.fn.innerHeight,outerWidth:e.fn.outerWidth,outerHeight:e.fn.outerHeight};e.fn["inner"+r]=function(n){return n===t?o["inner"+r].call(this):this.each(function(){e(this).css(s,u(this,n)+"px")})},e.fn["outer"+r]=function(t,n){return typeof t!="number"?o["outer"+r].call(this,t):this.each(function(){e(this).css(s,u(this,t,!0,n)+"px")})}}),e("").data("a-b","a").removeData("a-b").data("a-b")&&(e.fn.removeData=function(t){return function(n){return arguments.length?t.call(this,e.camelCase(n)):t.call(this)}}(e.fn.removeData)),function(){var t=/msie ([\w.]+)/.exec(navigator.userAgent.toLowerCase())||[];e.ui.ie=t.length?!0:!1,e.ui.ie6=parseFloat(t[1],10)===6}(),e.fn.extend({disableSelection:function(){return this.bind((e.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(e){e.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}}),e.extend(e.ui,{plugin:{add:function(t,n,r){var i,s=e.ui[t].prototype;for(i in r)s.plugins[i]=s.plugins[i]||[],s.plugins[i].push([n,r[i]])},call:function(e,t,n){var r,i=e.plugins[t];if(!i||!e.element[0].parentNode||e.element[0].parentNode.nodeType===11)return;for(r=0;r0?!0:(t[r]=1,i=t[r]>0,t[r]=0,i)},isOverAxis:function(e,t,n){return e>t&&e",options:{disabled:!1,create:null},_createWidget:function(t,r){r=e(r||this.defaultElement||this)[0],this.element=e(r),this.uuid=n++,this.eventNamespace="."+this.widgetName+this.uuid,this.options=e.widget.extend({},this.options,this._getCreateOptions(),t),this.bindings=e(),this.hoverable=e(),this.focusable=e(),r!==this&&(e.data(r,this.widgetName,this),e.data(r,this.widgetFullName,this),this._on(!0,this.element,{remove:function(e){e.target===r&&this.destroy()}}),this.document=e(r.style?r.ownerDocument:r.document||r),this.window=e(this.document[0].defaultView||this.document[0].parentWindow)),this._create(),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:e.noop,_getCreateEventData:e.noop,_create:e.noop,_init:e.noop,destroy:function(){this._destroy(),this.element.unbind(this.eventNamespace).removeData(this.widgetName).removeData(this.widgetFullName).removeData(e.camelCase(this.widgetFullName)),this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName+"-disabled "+"ui-state-disabled"),this.bindings.unbind(this.eventNamespace),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")},_destroy:e.noop,widget:function(){return this.element},option:function(n,r){var i=n,s,o,u;if(arguments.length===0)return e.widget.extend({},this.options);if(typeof n=="string"){i={},s=n.split("."),n=s.shift();if(s.length){o=i[n]=e.widget.extend({},this.options[n]);for(u=0;u=9||!!t.button?this._mouseStarted?(this._mouseDrag(t),t.preventDefault()):(this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,t)!==!1,this._mouseStarted?this._mouseDrag(t):this._mouseUp(t)),!this._mouseStarted):this._mouseUp(t)},_mouseUp:function(t){return e(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,t.target===this._mouseDownEvent.target&&e.data(t.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(t)),!1},_mouseDistanceMet:function(e){return Math.max(Math.abs(this._mouseDownEvent.pageX-e.pageX),Math.abs(this._mouseDownEvent.pageY-e.pageY))>=this.options.distance},_mouseDelayMet:function(e){return this.mouseDelayMet},_mouseStart:function(e){},_mouseDrag:function(e){},_mouseStop:function(e){},_mouseCapture:function(e){return!0}})}(jQuery),function(e,t){function h(e,t,n){return[parseInt(e[0],10)*(l.test(e[0])?t/100:1),parseInt(e[1],10)*(l.test(e[1])?n/100:1)]}function p(t,n){return parseInt(e.css(t,n),10)||0}e.ui=e.ui||{};var n,r=Math.max,i=Math.abs,s=Math.round,o=/left|center|right/,u=/top|center|bottom/,a=/[\+\-]\d+%?/,f=/^\w+/,l=/%$/,c=e.fn.position;e.position={scrollbarWidth:function(){if(n!==t)return n;var r,i,s=e("
      "),o=s.children()[0];return e("body").append(s),r=o.offsetWidth,s.css("overflow","scroll"),i=o.offsetWidth,r===i&&(i=s[0].clientWidth),s.remove(),n=r-i},getScrollInfo:function(t){var n=t.isWindow?"":t.element.css("overflow-x"),r=t.isWindow?"":t.element.css("overflow-y"),i=n==="scroll"||n==="auto"&&t.width0?"right":"center",vertical:u<0?"top":o>0?"bottom":"middle"};lr(i(o),i(u))?h.important="horizontal":h.important="vertical",t.using.call(this,e,h)}),a.offset(e.extend(C,{using:u}))})},e.ui.position={fit:{left:function(e,t){var n=t.within,i=n.isWindow?n.scrollLeft:n.offset.left,s=n.width,o=e.left-t.collisionPosition.marginLeft,u=i-o,a=o+t.collisionWidth-s-i,f;t.collisionWidth>s?u>0&&a<=0?(f=e.left+u+t.collisionWidth-s-i,e.left+=u-f):a>0&&u<=0?e.left=i:u>a?e.left=i+s-t.collisionWidth:e.left=i:u>0?e.left+=u:a>0?e.left-=a:e.left=r(e.left-o,e.left)},top:function(e,t){var n=t.within,i=n.isWindow?n.scrollTop:n.offset.top,s=t.within.height,o=e.top-t.collisionPosition.marginTop,u=i-o,a=o+t.collisionHeight-s-i,f;t.collisionHeight>s?u>0&&a<=0?(f=e.top+u+t.collisionHeight-s-i,e.top+=u-f):a>0&&u<=0?e.top=i:u>a?e.top=i+s-t.collisionHeight:e.top=i:u>0?e.top+=u:a>0?e.top-=a:e.top=r(e.top-o,e.top)}},flip:{left:function(e,t){var n=t.within,r=n.offset.left+n.scrollLeft,s=n.width,o=n.isWindow?n.scrollLeft:n.offset.left,u=e.left-t.collisionPosition.marginLeft,a=u-o,f=u+t.collisionWidth-s-o,l=t.my[0]==="left"?-t.elemWidth:t.my[0]==="right"?t.elemWidth:0,c=t.at[0]==="left"?t.targetWidth:t.at[0]==="right"?-t.targetWidth:0,h=-2*t.offset[0],p,d;if(a<0){p=e.left+l+c+h+t.collisionWidth-s-r;if(p<0||p0){d=e.left-t.collisionPosition.marginLeft+l+c+h-o;if(d>0||i(d)a&&(v<0||v0&&(d=e.top-t.collisionPosition.marginTop+c+h+p-o,e.top+c+h+p>f&&(d>0||i(d)10&&i<11,t.innerHTML="",n.removeChild(t)}(),e.uiBackCompat!==!1&&function(e){var n=e.fn.position;e.fn.position=function(r){if(!r||!r.offset)return n.call(this,r);var i=r.offset.split(" "),s=r.at.split(" ");return i.length===1&&(i[1]=i[0]),/^\d/.test(i[0])&&(i[0]="+"+i[0]),/^\d/.test(i[1])&&(i[1]="+"+i[1]),s.length===1&&(/left|center|right/.test(s[0])?s[1]="center":(s[1]=s[0],s[0]="center")),n.call(this,e.extend(r,{at:s[0]+i[0]+" "+s[1]+i[1],offset:t}))}}(jQuery)}(jQuery),function(e,t){e.widget("ui.draggable",e.ui.mouse,{version:"1.9.2",widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1},_create:function(){this.options.helper=="original"&&!/^(?:r|a|f)/.test(this.element.css("position"))&&(this.element[0].style.position="relative"),this.options.addClasses&&this.element.addClass("ui-draggable"),this.options.disabled&&this.element.addClass("ui-draggable-disabled"),this._mouseInit()},_destroy:function(){this.element.removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled"),this._mouseDestroy()},_mouseCapture:function(t){var n=this.options;return this.helper||n.disabled||e(t.target).is(".ui-resizable-handle")?!1:(this.handle=this._getHandle(t),this.handle?(e(n.iframeFix===!0?"iframe":n.iframeFix).each(function(){e('
      ').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1e3}).css(e(this).offset()).appendTo("body")}),!0):!1)},_mouseStart:function(t){var n=this.options;return this.helper=this._createHelper(t),this.helper.addClass("ui-draggable-dragging"),this._cacheHelperProportions(),e.ui.ddmanager&&(e.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(),this.offset=this.positionAbs=this.element.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},e.extend(this.offset,{click:{left:t.pageX-this.offset.left,top:t.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.originalPosition=this.position=this._generatePosition(t),this.originalPageX=t.pageX,this.originalPageY=t.pageY,n.cursorAt&&this._adjustOffsetFromHelper(n.cursorAt),n.containment&&this._setContainment(),this._trigger("start",t)===!1?(this._clear(),!1):(this._cacheHelperProportions(),e.ui.ddmanager&&!n.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,t),this._mouseDrag(t,!0),e.ui.ddmanager&&e.ui.ddmanager.dragStart(this,t),!0)},_mouseDrag:function(t,n){this.position=this._generatePosition(t),this.positionAbs=this._convertPositionTo("absolute");if(!n){var r=this._uiHash();if(this._trigger("drag",t,r)===!1)return this._mouseUp({}),!1;this.position=r.position}if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left=this.position.left+"px";if(!this.options.axis||this.options.axis!="x")this.helper[0].style.top=this.position.top+"px";return e.ui.ddmanager&&e.ui.ddmanager.drag(this,t),!1},_mouseStop:function(t){var n=!1;e.ui.ddmanager&&!this.options.dropBehaviour&&(n=e.ui.ddmanager.drop(this,t)),this.dropped&&(n=this.dropped,this.dropped=!1);var r=this.element[0],i=!1;while(r&&(r=r.parentNode))r==document&&(i=!0);if(!i&&this.options.helper==="original")return!1;if(this.options.revert=="invalid"&&!n||this.options.revert=="valid"&&n||this.options.revert===!0||e.isFunction(this.options.revert)&&this.options.revert.call(this.element,n)){var s=this;e(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){s._trigger("stop",t)!==!1&&s._clear()})}else this._trigger("stop",t)!==!1&&this._clear();return!1},_mouseUp:function(t){return e("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)}),e.ui.ddmanager&&e.ui.ddmanager.dragStop(this,t),e.ui.mouse.prototype._mouseUp.call(this,t)},cancel:function(){return this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear(),this},_getHandle:function(t){var n=!this.options.handle||!e(this.options.handle,this.element).length?!0:!1;return e(this.options.handle,this.element).find("*").andSelf().each(function(){this==t.target&&(n=!0)}),n},_createHelper:function(t){var n=this.options,r=e.isFunction(n.helper)?e(n.helper.apply(this.element[0],[t])):n.helper=="clone"?this.element.clone().removeAttr("id"):this.element;return r.parents("body").length||r.appendTo(n.appendTo=="parent"?this.element[0].parentNode:n.appendTo),r[0]!=this.element[0]&&!/(fixed|absolute)/.test(r.css("position"))&&r.css("position","absolute"),r},_adjustOffsetFromHelper:function(t){typeof t=="string"&&(t=t.split(" ")),e.isArray(t)&&(t={left:+t[0],top:+t[1]||0}),"left"in t&&(this.offset.click.left=t.left+this.margins.left),"right"in t&&(this.offset.click.left=this.helperProportions.width-t.right+this.margins.left),"top"in t&&(this.offset.click.top=t.top+this.margins.top),"bottom"in t&&(this.offset.click.top=this.helperProportions.height-t.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var t=this.offsetParent.offset();this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&e.contains(this.scrollParent[0],this.offsetParent[0])&&(t.left+=this.scrollParent.scrollLeft(),t.top+=this.scrollParent.scrollTop());if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&e.ui.ie)t={top:0,left:0};return{top:t.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:t.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var e=this.element.position();return{top:e.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:e.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var t=this.options;t.containment=="parent"&&(t.containment=this.helper[0].parentNode);if(t.containment=="document"||t.containment=="window")this.containment=[t.containment=="document"?0:e(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,t.containment=="document"?0:e(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,(t.containment=="document"?0:e(window).scrollLeft())+e(t.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(t.containment=="document"?0:e(window).scrollTop())+(e(t.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(t.containment)&&t.containment.constructor!=Array){var n=e(t.containment),r=n[0];if(!r)return;var i=n.offset(),s=e(r).css("overflow")!="hidden";this.containment=[(parseInt(e(r).css("borderLeftWidth"),10)||0)+(parseInt(e(r).css("paddingLeft"),10)||0),(parseInt(e(r).css("borderTopWidth"),10)||0)+(parseInt(e(r).css("paddingTop"),10)||0),(s?Math.max(r.scrollWidth,r.offsetWidth):r.offsetWidth)-(parseInt(e(r).css("borderLeftWidth"),10)||0)-(parseInt(e(r).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(s?Math.max(r.scrollHeight,r.offsetHeight):r.offsetHeight)-(parseInt(e(r).css("borderTopWidth"),10)||0)-(parseInt(e(r).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relative_container=n}else t.containment.constructor==Array&&(this.containment=t.containment)},_convertPositionTo:function(t,n){n||(n=this.position);var r=t=="absolute"?1:-1,i=this.options,s=this.cssPosition!="absolute"||this.scrollParent[0]!=document&&!!e.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,o=/(html|body)/i.test(s[0].tagName);return{top:n.top+this.offset.relative.top*r+this.offset.parent.top*r-(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():o?0:s.scrollTop())*r,left:n.left+this.offset.relative.left*r+this.offset.parent.left*r-(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():o?0:s.scrollLeft())*r}},_generatePosition:function(t){var n=this.options,r=this.cssPosition!="absolute"||this.scrollParent[0]!=document&&!!e.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,i=/(html|body)/i.test(r[0].tagName),s=t.pageX,o=t.pageY;if(this.originalPosition){var u;if(this.containment){if(this.relative_container){var a=this.relative_container.offset();u=[this.containment[0]+a.left,this.containment[1]+a.top,this.containment[2]+a.left,this.containment[3]+a.top]}else u=this.containment;t.pageX-this.offset.click.leftu[2]&&(s=u[2]+this.offset.click.left),t.pageY-this.offset.click.top>u[3]&&(o=u[3]+this.offset.click.top)}if(n.grid){var f=n.grid[1]?this.originalPageY+Math.round((o-this.originalPageY)/n.grid[1])*n.grid[1]:this.originalPageY;o=u?f-this.offset.click.topu[3]?f-this.offset.click.topu[2]?l-this.offset.click.left=0;l--){var c=r.snapElements[l].left,h=c+r.snapElements[l].width,p=r.snapElements[l].top,d=p+r.snapElements[l].height;if(!(c-se?0:r.max")[0],c,h=t.each;l.style.cssText="background-color:rgba(1,1,1,.5)",f.rgba=l.style.backgroundColor.indexOf("rgba")>-1,h(u,function(e,t){t.cache="_"+e,t.props.alpha={idx:3,type:"percent",def:1}}),o.fn=t.extend(o.prototype,{parse:function(r,i,s,a){if(r===n)return this._rgba=[null,null,null,null],this;if(r.jquery||r.nodeType)r=t(r).css(i),i=n;var f=this,l=t.type(r),v=this._rgba=[];i!==n&&(r=[r,i,s,a],l="array");if(l==="string")return this.parse(d(r)||c._default);if(l==="array")return h(u.rgba.props,function(e,t){v[t.idx]=p(r[t.idx],t)}),this;if(l==="object")return r instanceof o?h(u,function(e,t){r[t.cache]&&(f[t.cache]=r[t.cache].slice())}):h(u,function(t,n){var i=n.cache;h(n.props,function(e,t){if(!f[i]&&n.to){if(e==="alpha"||r[e]==null)return;f[i]=n.to(f._rgba)}f[i][t.idx]=p(r[e],t,!0)}),f[i]&&e.inArray(null,f[i].slice(0,3))<0&&(f[i][3]=1,n.from&&(f._rgba=n.from(f[i])))}),this},is:function(e){var t=o(e),n=!0,r=this;return h(u,function(e,i){var s,o=t[i.cache];return o&&(s=r[i.cache]||i.to&&i.to(r._rgba)||[],h(i.props,function(e,t){if(o[t.idx]!=null)return n=o[t.idx]===s[t.idx],n})),n}),n},_space:function(){var e=[],t=this;return h(u,function(n,r){t[r.cache]&&e.push(n)}),e.pop()},transition:function(e,t){var n=o(e),r=n._space(),i=u[r],s=this.alpha()===0?o("transparent"):this,f=s[i.cache]||i.to(s._rgba),l=f.slice();return n=n[i.cache],h(i.props,function(e,r){var i=r.idx,s=f[i],o=n[i],u=a[r.type]||{};if(o===null)return;s===null?l[i]=o:(u.mod&&(o-s>u.mod/2?s+=u.mod:s-o>u.mod/2&&(s-=u.mod)),l[i]=p((o-s)*t+s,r))}),this[r](l)},blend:function(e){if(this._rgba[3]===1)return this;var n=this._rgba.slice(),r=n.pop(),i=o(e)._rgba;return o(t.map(n,function(e,t){return(1-r)*i[t]+r*e}))},toRgbaString:function(){var e="rgba(",n=t.map(this._rgba,function(e,t){return e==null?t>2?1:0:e});return n[3]===1&&(n.pop(),e="rgb("),e+n.join()+")"},toHslaString:function(){var e="hsla(",n=t.map(this.hsla(),function(e,t){return e==null&&(e=t>2?1:0),t&&t<3&&(e=Math.round(e*100)+"%"),e});return n[3]===1&&(n.pop(),e="hsl("),e+n.join()+")"},toHexString:function(e){var n=this._rgba.slice(),r=n.pop();return e&&n.push(~~(r*255)),"#"+t.map(n,function(e){return e=(e||0).toString(16),e.length===1?"0"+e:e}).join("")},toString:function(){return this._rgba[3]===0?"transparent":this.toRgbaString()}}),o.fn.parse.prototype=o.fn,u.hsla.to=function(e){if(e[0]==null||e[1]==null||e[2]==null)return[null,null,null,e[3]];var t=e[0]/255,n=e[1]/255,r=e[2]/255,i=e[3],s=Math.max(t,n,r),o=Math.min(t,n,r),u=s-o,a=s+o,f=a*.5,l,c;return o===s?l=0:t===s?l=60*(n-r)/u+360:n===s?l=60*(r-t)/u+120:l=60*(t-n)/u+240,f===0||f===1?c=f:f<=.5?c=u/a:c=u/(2-a),[Math.round(l)%360,c,f,i==null?1:i]},u.hsla.from=function(e){if(e[0]==null||e[1]==null||e[2]==null)return[null,null,null,e[3]];var t=e[0]/360,n=e[1],r=e[2],i=e[3],s=r<=.5?r*(1+n):r+n-r*n,o=2*r-s;return[Math.round(v(o,s,t+1/3)*255),Math.round(v(o,s,t)*255),Math.round(v(o,s,t-1/3)*255),i]},h(u,function(e,r){var s=r.props,u=r.cache,a=r.to,f=r.from;o.fn[e]=function(e){a&&!this[u]&&(this[u]=a(this._rgba));if(e===n)return this[u].slice();var r,i=t.type(e),l=i==="array"||i==="object"?e:arguments,c=this[u].slice();return h(s,function(e,t){var n=l[i==="object"?e:t.idx];n==null&&(n=c[t.idx]),c[t.idx]=p(n,t)}),f?(r=o(f(c)),r[u]=c,r):o(c)},h(s,function(n,r){if(o.fn[n])return;o.fn[n]=function(s){var o=t.type(s),u=n==="alpha"?this._hsla?"hsla":"rgba":e,a=this[u](),f=a[r.idx],l;return o==="undefined"?f:(o==="function"&&(s=s.call(this,f),o=t.type(s)),s==null&&r.empty?this:(o==="string"&&(l=i.exec(s),l&&(s=f+parseFloat(l[2])*(l[1]==="+"?1:-1))),a[r.idx]=s,this[u](a)))}})}),h(r,function(e,n){t.cssHooks[n]={set:function(e,r){var i,s,u="";if(t.type(r)!=="string"||(i=d(r))){r=o(i||r);if(!f.rgba&&r._rgba[3]!==1){s=n==="backgroundColor"?e.parentNode:e;while((u===""||u==="transparent")&&s&&s.style)try{u=t.css(s,"backgroundColor"),s=s.parentNode}catch(a){}r=r.blend(u&&u!=="transparent"?u:"_default")}r=r.toRgbaString()}try{e.style[n]=r}catch(l){}}},t.fx.step[n]=function(e){e.colorInit||(e.start=o(e.elem,n),e.end=o(e.end),e.colorInit=!0),t.cssHooks[n].set(e.elem,e.start.transition(e.end,e.pos))}}),t.cssHooks.borderColor={expand:function(e){var t={};return h(["Top","Right","Bottom","Left"],function(n,r){t["border"+r+"Color"]=e}),t}},c=t.Color.names={aqua:"#00ffff",black:"#000000",blue:"#0000ff",fuchsia:"#ff00ff",gray:"#808080",green:"#008000",lime:"#00ff00",maroon:"#800000",navy:"#000080",olive:"#808000",purple:"#800080",red:"#ff0000",silver:"#c0c0c0",teal:"#008080",white:"#ffffff",yellow:"#ffff00",transparent:[null,null,null,0],_default:"#ffffff"}}(jQuery),function(){function i(){var t=this.ownerDocument.defaultView?this.ownerDocument.defaultView.getComputedStyle(this,null):this.currentStyle,n={},r,i;if(t&&t.length&&t[0]&&t[t[0]]){i=t.length;while(i--)r=t[i],typeof t[r]=="string"&&(n[e.camelCase(r)]=t[r])}else for(r in t)typeof t[r]=="string"&&(n[r]=t[r]);return n}function s(t,n){var i={},s,o;for(s in n)o=n[s],t[s]!==o&&!r[s]&&(e.fx.step[s]||!isNaN(parseFloat(o)))&&(i[s]=o);return i}var n=["add","remove","toggle"],r={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};e.each(["borderLeftStyle","borderRightStyle","borderBottomStyle","borderTopStyle"],function(t,n){e.fx.step[n]=function(e){if(e.end!=="none"&&!e.setAttr||e.pos===1&&!e.setAttr)jQuery.style(e.elem,n,e.end),e.setAttr=!0}}),e.effects.animateClass=function(t,r,o,u){var a=e.speed(r,o,u);return this.queue(function(){var r=e(this),o=r.attr("class")||"",u,f=a.children?r.find("*").andSelf():r;f=f.map(function(){var t=e(this);return{el:t,start:i.call(this)}}),u=function(){e.each(n,function(e,n){t[n]&&r[n+"Class"](t[n])})},u(),f=f.map(function(){return this.end=i.call(this.el[0]),this.diff=s(this.start,this.end),this}),r.attr("class",o),f=f.map(function(){var t=this,n=e.Deferred(),r=jQuery.extend({},a,{queue:!1,complete:function(){n.resolve(t)}});return this.el.animate(this.diff,r),n.promise()}),e.when.apply(e,f.get()).done(function(){u(),e.each(arguments,function(){var t=this.el;e.each(this.diff,function(e){t.css(e,"")})}),a.complete.call(r[0])})})},e.fn.extend({_addClass:e.fn.addClass,addClass:function(t,n,r,i){return n?e.effects.animateClass.call(this,{add:t},n,r,i):this._addClass(t)},_removeClass:e.fn.removeClass,removeClass:function(t,n,r,i){return n?e.effects.animateClass.call(this,{remove:t},n,r,i):this._removeClass(t)},_toggleClass:e.fn.toggleClass,toggleClass:function(n,r,i,s,o){return typeof r=="boolean"||r===t?i?e.effects.animateClass.call(this,r?{add:n}:{remove:n},i,s,o):this._toggleClass(n,r):e.effects.animateClass.call(this,{toggle:n},r,i,s)},switchClass:function(t,n,r,i,s){return e.effects.animateClass.call(this,{add:n,remove:t},r,i,s)}})}(),function(){function i(t,n,r,i){e.isPlainObject(t)&&(n=t,t=t.effect),t={effect:t},n==null&&(n={}),e.isFunction(n)&&(i=n,r=null,n={});if(typeof n=="number"||e.fx.speeds[n])i=r,r=n,n={};return e.isFunction(r)&&(i=r,r=null),n&&e.extend(t,n),r=r||n.duration,t.duration=e.fx.off?0:typeof r=="number"?r:r in e.fx.speeds?e.fx.speeds[r]:e.fx.speeds._default,t.complete=i||n.complete,t}function s(t){return!t||typeof t=="number"||e.fx.speeds[t]?!0:typeof t=="string"&&!e.effects.effect[t]?n&&e.effects[t]?!1:!0:!1}e.extend(e.effects,{version:"1.9.2",save:function(e,t){for(var n=0;n
      ").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),i={width:t.width(),height:t.height()},s=document.activeElement;try{s.id}catch(o){s=document.body}return t.wrap(r),(t[0]===s||e.contains(t[0],s))&&e(s).focus(),r=t.parent(),t.css("position")==="static"?(r.css({position:"relative"}),t.css({position:"relative"})):(e.extend(n,{position:t.css("position"),zIndex:t.css("z-index")}),e.each(["top","left","bottom","right"],function(e,r){n[r]=t.css(r),isNaN(parseInt(n[r],10))&&(n[r]="auto")}),t.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})),t.css(i),r.css(n).show()},removeWrapper:function(t){var n=document.activeElement;return t.parent().is(".ui-effects-wrapper")&&(t.parent().replaceWith(t),(t[0]===n||e.contains(t[0],n))&&e(n).focus()),t},setTransition:function(t,n,r,i){return i=i||{},e.each(n,function(e,n){var s=t.cssUnit(n);s[0]>0&&(i[n]=s[0]*r+s[1])}),i}}),e.fn.extend({effect:function(){function a(n){function u(){e.isFunction(i)&&i.call(r[0]),e.isFunction(n)&&n()}var r=e(this),i=t.complete,s=t.mode;(r.is(":hidden")?s==="hide":s==="show")?u():o.call(r[0],t,u)}var t=i.apply(this,arguments),r=t.mode,s=t.queue,o=e.effects.effect[t.effect],u=!o&&n&&e.effects[t.effect];return e.fx.off||!o&&!u?r?this[r](t.duration,t.complete):this.each(function(){t.complete&&t.complete.call(this)}):o?s===!1?this.each(a):this.queue(s||"fx",a):u.call(this,{options:t,duration:t.duration,callback:t.complete,mode:t.mode})},_show:e.fn.show,show:function(e){if(s(e))return this._show.apply(this,arguments);var t=i.apply(this,arguments);return t.mode="show",this.effect.call(this,t)},_hide:e.fn.hide,hide:function(e){if(s(e))return this._hide.apply(this,arguments);var t=i.apply(this,arguments);return t.mode="hide",this.effect.call(this,t)},__toggle:e.fn.toggle,toggle:function(t){if(s(t)||typeof t=="boolean"||e.isFunction(t))return this.__toggle.apply(this,arguments);var n=i.apply(this,arguments);return n.mode="toggle",this.effect.call(this,n)},cssUnit:function(t){var n=this.css(t),r=[];return e.each(["em","px","%","pt"],function(e,t){n.indexOf(t)>0&&(r=[parseFloat(n),t])}),r}})}(),function(){var t={};e.each(["Quad","Cubic","Quart","Quint","Expo"],function(e,n){t[n]=function(t){return Math.pow(t,e+2)}}),e.extend(t,{Sine:function(e){return 1-Math.cos(e*Math.PI/2)},Circ:function(e){return 1-Math.sqrt(1-e*e)},Elastic:function(e){return e===0||e===1?e:-Math.pow(2,8*(e-1))*Math.sin(((e-1)*80-7.5)*Math.PI/15)},Back:function(e){return e*e*(3*e-2)},Bounce:function(e){var t,n=4;while(e<((t=Math.pow(2,--n))-1)/11);return 1/Math.pow(4,3-n)-7.5625*Math.pow((t*3-2)/22-e,2)}}),e.each(t,function(t,n){e.easing["easeIn"+t]=n,e.easing["easeOut"+t]=function(e){return 1-n(1-e)},e.easing["easeInOut"+t]=function(e){return e<.5?n(e*2)/2:1-n(e*-2+2)/2}})}()}(jQuery),function(e,t){e.effects.effect.slide=function(t,n){var r=e(this),i=["position","top","bottom","left","right","width","height"],s=e.effects.setMode(r,t.mode||"show"),o=s==="show",u=t.direction||"left",a=u==="up"||u==="down"?"top":"left",f=u==="up"||u==="left",l,c={};e.effects.save(r,i),r.show(),l=t.distance||r[a==="top"?"outerHeight":"outerWidth"](!0),e.effects.createWrapper(r).css({overflow:"hidden"}),o&&r.css(a,f?isNaN(l)?"-"+l:-l:l),c[a]=(o?f?"+=":"-=":f?"-=":"+=")+l,r.animate(c,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){s==="hide"&&r.hide(),e.effects.restore(r,i),e.effects.removeWrapper(r),n()}})}}(jQuery),define("jquery-ui",function(){}),function($){var min=Math.min,max=Math.max,round=Math.floor,isStr=function(e){return $.type(e)==="string"},runPluginCallbacks=function(Instance,a_fn){function g(e){return e}if($.isArray(a_fn))for(var i=0,c=a_fn.length;i
      ').appendTo("body"),n={width:t.css("width")-t[0].clientWidth,height:t.height()-t[0].clientHeight};return t.remove(),window.scrollbarWidth=n.width,window.scrollbarHeight=n.height,e.match(/^(width|height)$/)?n[e]:n},showInvisibly:function(e,t){if(e&&e.length&&(t||e.css("display")==="none")){var n=e[0].style,r={display:n.display||"",visibility:n.visibility||""};return e.css({display:"block",visibility:"hidden"}),r}return{}},getElementDimensions:function(e,t){var n={css:{},inset:{}},r=n.css,i={bottom:0},s=$.layout.cssNum,o=e.offset(),u,a,f;return n.offsetLeft=o.left,n.offsetTop=o.top,t||(t={}),$.each("Left,Right,Top,Bottom".split(","),function(s,o){u=r["border"+o]=$.layout.borderWidth(e,o),a=r["padding"+o]=$.layout.cssNum(e,"padding"+o),f=o.toLowerCase(),n.inset[f]=t[f]>=0?t[f]:a,i[f]=n.inset[f]+u}),r.width=e.width(),r.height=e.height(),r.top=s(e,"top",!0),r.bottom=s(e,"bottom",!0),r.left=s(e,"left",!0),r.right=s(e,"right",!0),n.outerWidth=e.outerWidth(),n.outerHeight=e.outerHeight(),n.innerWidth=max(0,n.outerWidth-i.left-i.right),n.innerHeight=max(0,n.outerHeight-i.top-i.bottom),n.layoutWidth=e.innerWidth(),n.layoutHeight=e.innerHeight(),n},getElementStyles:function(e,t){var n={},r=e[0].style,i=t.split(","),s="Top,Bottom,Left,Right".split(","),o="Color,Style,Width".split(","),u,a,f,l,c,h;for(l=0;l=s&&a<=o&&f>=i&&f<=u},msg:function(e,t,n,r){function a(){var e=$.support.fixedPosition?"fixed":"absolute",t=$('
      '+'
      '+'XLayout console.log
      '+'
        '+"
        ").appendTo("body");return t.css("left",$(window).width()-t.outerWidth()-5),$.ui.draggable&&t.draggable({handle:":first-child"}),t}if($.isPlainObject(e)&&window.debugData){typeof t=="string"?(r=n,n=t):typeof n=="object"&&(r=n,n=null);var i=n||"log( )",s=$.extend({sort:!1,returnHTML:!1,display:!1},r);t===!0||s.display?debugData(e,i,s):window.console&&console.log(debugData(e,i,s))}else if(t)alert(e);else if(window.console)console.log(e);else{var o="#layoutLogger",u=$(o);u.length||(u=a()),u.children("ul").append('
      • '+e.replace(/\/g,">")+"
      • ")}}};var u=navigator.userAgent.toLowerCase(),m=/(chrome)[ \/]([\w.]+)/.exec(u)||/(webkit)[ \/]([\w.]+)/.exec(u)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(u)||/(msie) ([\w.]+)/.exec(u)||u.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(u)||[],b=m[1]||"",v=m[2]||0,ie=b==="msie";$.layout.browser={version:v,safari:b==="webkit",webkit:b==="chrome",msie:ie,isIE6:ie&&v==6,boxModel:!ie||$.support.boxModel!==!1},b&&($.layout.browser[b]=!0),ie&&$(function(){$.layout.browser.boxModel=$.support.boxModel}),$.layout.defaults={name:"",containerClass:"ui-layout-container",inset:null,scrollToBookmarkOnLoad:!0,resizeWithWindow:!0,resizeWithWindowDelay:200,resizeWithWindowMaxDelay:0,maskPanesEarly:!1,onresizeall_start:null,onresizeall_end:null,onload_start:null,onload_end:null,onunload_start:null,onunload_end:null,initPanes:!0,showErrorMessages:!0,showDebugMessages:!1,zIndex:null,zIndexes:{pane_normal:0,content_mask:1,resizer_normal:2,pane_sliding:100,pane_animate:1e3,resizer_drag:1e4},errors:{pane:"pane",selector:"selector",addButtonError:"Error Adding Button\nInvalid ",containerMissing:"UI Layout Initialization Error\nThe specified layout-container does not exist.",centerPaneMissing:"UI Layout Initialization Error\nThe center-pane element does not exist.\nThe center-pane is a required element.",noContainerHeight:"UI Layout Initialization Warning\nThe layout-container \"CONTAINER\" has no height.\nTherefore the layout is 0-height and hence 'invisible'!",callbackError:"UI Layout Callback Error\nThe EVENT callback is not a valid function."},panes:{applyDemoStyles:!1,closable:!0,resizable:!0,slidable:!0,initClosed:!1,initHidden:!1,contentSelector:".ui-layout-content",contentIgnoreSelector:".ui-layout-ignore",findNestedContent:!1,paneClass:"ui-layout-pane",resizerClass:"ui-layout-resizer",togglerClass:"ui-layout-toggler",buttonClass:"ui-layout-button",minSize:0,maxSize:0,spacing_open:6,spacing_closed:6,togglerLength_open:50,togglerLength_closed:50,togglerAlign_open:"center",togglerAlign_closed:"center",togglerContent_open:"",togglerContent_closed:"",resizerDblClickToggle:!0,autoResize:!0,autoReopen:!0,resizerDragOpacity:1,maskContents:!1,maskObjects:!1,maskZindex:null,resizingGrid:!1,livePaneResizing:!1,liveContentResizing:!1,liveResizingTolerance:1,sliderCursor:"pointer",slideTrigger_open:"click",slideTrigger_close:"mouseleave",slideDelay_open:300,slideDelay_close:300,hideTogglerOnSlide:!1,preventQuickSlideClose:$.layout.browser.webkit,preventPrematureSlideClose:!1,tips:{Open:"Open",Close:"Close",Resize:"Resize",Slide:"Slide Open",Pin:"Pin",Unpin:"Un-Pin",noRoomToOpen:"Not enough room to show this panel.",minSizeWarning:"Panel has reached its minimum size",maxSizeWarning:"Panel has reached its maximum size"},showOverflowOnHover:!1,enableCursorHotkey:!0,customHotkeyModifier:"SHIFT",fxName:"slide",fxSpeed:null,fxSettings:{},fxOpacityFix:!0,animatePaneSizing:!1,children:null,containerSelector:"",initChildren:!0,destroyChildren:!0,resizeChildren:!0,triggerEventsOnLoad:!1,triggerEventsDuringLiveResize:!0,onshow_start:null,onshow_end:null,onhide_start:null,onhide_end:null,onopen_start:null,onopen_end:null,onclose_start:null,onclose_end:null,onresize_start:null,onresize_end:null,onsizecontent_start:null,onsizecontent_end:null,onswap_start:null,onswap_end:null,ondrag_start:null,ondrag_end:null},north:{paneSelector:".ui-layout-north",size:"auto",resizerCursor:"n-resize",customHotkey:""},south:{paneSelector:".ui-layout-south",size:"auto",resizerCursor:"s-resize",customHotkey:""},east:{paneSelector:".ui-layout-east",size:200,resizerCursor:"e-resize",customHotkey:""},west:{paneSelector:".ui-layout-west",size:200,resizerCursor:"w-resize",customHotkey:""},center:{paneSelector:".ui-layout-center",minWidth:0,minHeight:0}},$.layout.optionsMap={layout:"name,instanceKey,stateManagement,effects,inset,zIndexes,errors,zIndex,scrollToBookmarkOnLoad,showErrorMessages,maskPanesEarly,outset,resizeWithWindow,resizeWithWindowDelay,resizeWithWindowMaxDelay,onresizeall,onresizeall_start,onresizeall_end,onload,onload_start,onload_end,onunload,onunload_start,onunload_end".split(","),center:"paneClass,contentSelector,contentIgnoreSelector,findNestedContent,applyDemoStyles,triggerEventsOnLoad,showOverflowOnHover,maskContents,maskObjects,liveContentResizing,containerSelector,children,initChildren,resizeChildren,destroyChildren,onresize,onresize_start,onresize_end,onsizecontent,onsizecontent_start,onsizecontent_end".split(","),noDefault:"paneSelector,resizerCursor,customHotkey".split(",")},$.layout.transformData=function(e,t){var n=t?{panes:{},center:{}}:{},r,i,s,o,u,a,f;if(typeof e!="object")return n;for(i in e){r=n,u=e[i],s=i.split("__"),f=s.length-1;for(a=0;a<=f;a++)o=s[a],a===f?$.isPlainObject(u)?r[o]=$.layout.transformData(u):r[o]=u:(r[o]||(r[o]={}),r=r[o])}return n},$.layout.backwardCompatibility={map:{applyDefaultStyles:"applyDemoStyles",childOptions:"children",initChildLayout:"initChildren",destroyChildLayout:"destroyChildren",resizeChildLayout:"resizeChildren",resizeNestedLayout:"resizeChildren",resizeWhileDragging:"livePaneResizing",resizeContentWhileDragging:"liveContentResizing",triggerEventsWhileDragging:"triggerEventsDuringLiveResize",maskIframesOnResize:"maskContents",useStateCookie:"stateManagement.enabled","cookie.autoLoad":"stateManagement.autoLoad","cookie.autoSave":"stateManagement.autoSave","cookie.keys":"stateManagement.stateKeys","cookie.name":"stateManagement.cookie.name","cookie.domain":"stateManagement.cookie.domain","cookie.path":"stateManagement.cookie.path","cookie.expires":"stateManagement.cookie.expires","cookie.secure":"stateManagement.cookie.secure",noRoomToOpenTip:"tips.noRoomToOpen",togglerTip_open:"tips.Close",togglerTip_closed:"tips.Open",resizerTip:"tips.Resize",sliderTip:"tips.Slide"},renameOptions:function(e){function o(t,n){var r=t.split("."),i=r.length-1,s={branch:e,key:r[i]},o=0,u,a;for(;o=37&&t<=40,u,a,f,l;return o&&options[n[t]].enableCursorHotkey?l=n[t]:(s||i)&&$.each(_c.borderPanes,function(e,n){u=options[n],a=u.customHotkey,f=u.customHotkeyModifier;if(i&&f=="SHIFT"||s&&f=="CTRL"||s&&i)if(a&&t===(isNaN(a)||a<=9?a.toUpperCase().charCodeAt(0):a))return l=n,!1}),!l||!$Ps[l]||!options[l].closable||state[l].isHidden?!0:(toggle(l),e.stopPropagation(),e.returnValue=!1,!1)}function allowOverflow(e){if(!isInitialized())return;this&&this.tagName&&(e=this);var t;isStr(e)?t=$Ps[e]:$(e).data("layoutRole")?t=$(e):$(e).parents().each(function(){if($(this).data("layoutRole"))return t=$(this),!1});if(!t||!t.length)return;var n=t.data("layoutEdge"),r=state[n];r.cssSaved&&resetOverflow(n);if(r.isSliding||r.isResizing||r.isClosed){r.cssSaved=!1;return}var i={zIndex:options.zIndexes.resizer_normal+1},s={},o=t.css("overflow"),u=t.css("overflowX"),a=t.css("overflowY");o!="visible"&&(s.overflow=o,i.overflow="visible"),u&&!u.match(/(visible|auto)/)&&(s.overflowX=u,i.overflowX="visible"),a&&!a.match(/(visible|auto)/)&&(s.overflowY=u,i.overflowY="visible"),r.cssSaved=s,t.css(i),$.each(_c.allPanes,function(e,t){t!=n&&resetOverflow(t)})}function resetOverflow(e){if(!isInitialized())return;this&&this.tagName&&(e=this);var t;isStr(e)?t=$Ps[e]:$(e).data("layoutRole")?t=$(e):$(e).parents().each(function(){if($(this).data("layoutRole"))return t=$(this),!1});if(!t||!t.length)return;var n=t.data("layoutEdge"),r=state[n],i=r.cssSaved||{};!r.isSliding&&!r.isResizing&&t.css("zIndex",options.zIndexes.pane_normal),t.css(i),r.cssSaved=!1}var browser=$.layout.browser,_c=$.layout.config,cssW=$.layout.cssWidth,cssH=$.layout.cssHeight,elDims=$.layout.getElementDimensions,styles=$.layout.getElementStyles,evtObj=$.layout.getEventObject,evtPane=$.layout.parsePaneName,options=$.extend(!0,{},$.layout.defaults),effects=options.effects=$.extend(!0,{},$.layout.effects),state={id:"layout"+$.now(),initialized:!1,paneResizing:!1,panesSliding:{},container:{innerWidth:0,innerHeight:0,outerWidth:0,outerHeight:0,layoutWidth:0,layoutHeight:0},north:{childIdx:0},south:{childIdx:0},east:{childIdx:0},west:{childIdx:0},center:{childIdx:0}},children={north:null,south:null,east:null,west:null,center:null},timer={data:{},set:function(e,t,n){timer.clear(e),timer.data[e]=setTimeout(t,n)},clear:function(e){var t=timer.data;t[e]&&(clearTimeout(t[e]),delete t[e])}},_log=function(e,t,n){var r=options;return(r.showErrorMessages&&!n||n&&r.showDebugMessages)&&$.layout.msg(r.name+" / "+e,t!==!1),!1},_runCallbacks=function(evtName,pane,skipBoundEvents){function g(e){return e}var hasPane=pane&&isStr(pane),s=hasPane?state[pane]:state,o=hasPane?options[pane]:options,lName=options.name,lng=evtName+(evtName.match(/_/)?"":"_end"),shrt=lng.match(/_end$/)?lng.substr(0,lng.length-4):"",fn=o[lng]||o[shrt],retVal="NC",args=[],$P;!hasPane&&$.type(pane)==="boolean"&&(skipBoundEvents=pane,pane="");if(fn)try{isStr(fn)&&(fn.match(/,/)?(args=fn.split(","),fn=eval(args[0])):fn=eval(fn)),$.isFunction(fn)&&(args.length?retVal=g(fn)(args[1]):hasPane?retVal=g(fn)(pane,$Ps[pane],s,o,lName):retVal=g(fn)(Instance,s,o,lName))}catch(ex){_log(options.errors.callbackError.replace(/EVENT/,$.trim((pane||"")+" "+lng)),!1),$.type(ex)==="string"&&string.length&&_log("Exception: "+ex,!1)}return!skipBoundEvents&&retVal!==!1&&(hasPane?($P=$Ps[pane],o=options[pane],s=state[pane],$P.triggerHandler("layoutpane"+lng,[pane,$P,s,o,lName]),shrt&&$P.triggerHandler("layoutpane"+shrt,[pane,$P,s,o,lName])):($N.triggerHandler("layout"+lng,[Instance,s,o,lName]),shrt&&$N.triggerHandler("layout"+shrt,[Instance,s,o,lName]))),hasPane&&evtName==="onresize_end"&&resizeChildren(pane+"",!0),retVal},_fixIframe=function(e){if(browser.mozilla)return;var t=$Ps[e];state[e].tagName==="IFRAME"?t.css(_c.hidden).css(_c.visible):t.find("IFRAME").css(_c.hidden).css(_c.visible)},cssSize=function(e,t){var n=_c[e].dir=="horz"?cssH:cssW;return n($Ps[e],t)},cssMinDims=function(e){var t=$Ps[e],n=_c[e].dir,r={minWidth:1001-cssW(t,1e3),minHeight:1001-cssH(t,1e3)};return n==="horz"&&(r.minSize=r.minHeight),n==="vert"&&(r.minSize=r.minWidth),r},setOuterWidth=function(e,t,n){var r=e,i;isStr(e)?r=$Ps[e]:e.jquery||(r=$(e)),i=cssW(r,t),r.css({width:i}),i>0?n&&r.data("autoHidden")&&r.innerHeight()>0&&(r.show().data("autoHidden",!1),browser.mozilla||r.css(_c.hidden).css(_c.visible)):n&&!r.data("autoHidden")&&r.hide().data("autoHidden",!0)},setOuterHeight=function(e,t,n){var r=e,i;isStr(e)?r=$Ps[e]:e.jquery||(r=$(e)),i=cssH(r,t),r.css({height:i,visibility:"visible"}),i>0&&r.innerWidth()>0?n&&r.data("autoHidden")&&(r.show().data("autoHidden",!1),browser.mozilla||r.css(_c.hidden).css(_c.visible)):n&&!r.data("autoHidden")&&r.hide().data("autoHidden",!0)},_parseSize=function(e,t,n){n||(n=_c[e].dir),isStr(t)&&t.match(/%/)&&(t=t==="100%"?-1:parseInt(t,10)/100);if(t===0)return 0;if(t>=1)return parseInt(t,10);var r=options,i=0;n=="horz"?i=sC.innerHeight-($Ps.north?r.north.spacing_open:0)-($Ps.south?r.south.spacing_open:0):n=="vert"&&(i=sC.innerWidth-($Ps.west?r.west.spacing_open:0)-($Ps.east?r.east.spacing_open:0));if(t===-1)return i;if(t>0)return round(i*t);if(e=="center")return 0;var s=n==="horz"?"height":"width",o=$Ps[e],u=s==="height"?$Cs[e]:!1,a=$.layout.showInvisibly(o),f=o.css(s),l=u?u.css(s):0;return o.css(s,"auto"),u&&u.css(s,"auto"),t=s==="height"?o.outerHeight():o.outerWidth(),o.css(s,f).css(a),u&&u.css(s,l),t},getPaneSize=function(e,t){var n=$Ps[e],r=options[e],i=state[e],s=t?r.spacing_open:0,o=t?r.spacing_closed:0;return!n||i.isHidden?0:i.isClosed||i.isSliding&&t?o:_c[e].dir==="horz"?n.outerHeight()+s:n.outerWidth()+s},setSizeLimits=function(e,t){if(!isInitialized())return;var n=options[e],r=state[e],i=_c[e],s=i.dir,o=i.sizeType.toLowerCase(),u=t!=undefined?t:r.isSliding,a=$Ps[e],f=n.spacing_open,l=_c.oppositeEdge[e],c=state[l],h=$Ps[l],p=!h||c.isVisible===!1||c.isSliding?0:s=="horz"?h.outerHeight():h.outerWidth(),d=(!h||c.isHidden?0:options[l][c.isClosed!==!1?"spacing_closed":"spacing_open"])||0,v=s=="horz"?sC.innerHeight:sC.innerWidth,m=cssMinDims("center"),g=s=="horz"?max(options.center.minHeight,m.minHeight):max(options.center.minWidth,m.minWidth),y=v-f-(u?0:_parseSize("center",g,s)+p+d),b=r.minSize=max(_parseSize(e,n.minSize),cssMinDims(e).minSize),w=r.maxSize=min(n.maxSize?_parseSize(e,n.maxSize):1e5,y),E=r.resizerPosition={},S=sC.inset.top,x=sC.inset.left,T=sC.innerWidth,N=sC.innerHeight,C=n.spacing_open;switch(e){case"north":E.min=S+b,E.max=S+w;break;case"west":E.min=x+b,E.max=x+w;break;case"south":E.min=S+N-w-C,E.max=S+N-b-C;break;case"east":E.min=x+T-w-C,E.max=x+T-b-C}},calcNewCenterPaneDims=function(){var e={top:getPaneSize("north",!0),bottom:getPaneSize("south",!0),left:getPaneSize("west",!0),right:getPaneSize("east",!0),width:0,height:0};return e.width=sC.innerWidth-e.left-e.right,e.height=sC.innerHeight-e.bottom-e.top,e.top+=sC.inset.top,e.bottom+=sC.inset.bottom,e.left+=sC.inset.left,e.right+=sC.inset.right,e},getHoverClasses=function(e,t){var n=$(e),r=n.data("layoutRole"),i=n.data("layoutEdge"),s=options[i],o=s[r+"Class"],u="-"+i,a="-open",f="-closed",l="-sliding",c="-hover ",h=n.hasClass(o+f)?f:a,p=h===f?a:f,d=o+c+(o+u+c)+(o+h+c)+(o+u+h+c);return t&&(d+=o+p+c+(o+u+p+c)),r=="resizer"&&n.hasClass(o+l)&&(d+=o+l+c+(o+u+l+c)),$.trim(d)},addHover=function(e,t){var n=$(t||this);e&&n.data("layoutRole")==="toggler"&&e.stopPropagation(),n.addClass(getHoverClasses(n))},removeHover=function(e,t){var n=$(t||this);n.removeClass(getHoverClasses(n,!0))},onResizerEnter=function(e){var t=$(this).data("layoutEdge"),n=state[t];if(n.isClosed||n.isResizing||state.paneResizing)return;$.fn.disableSelection&&$("body").disableSelection(),options.maskPanesEarly&&showMasks(t,{resizing:!0})},onResizerLeave=function(e,t){var n=t||this,r=$(n).data("layoutEdge"),i=r+"ResizerLeave";timer.clear(r+"_openSlider"),timer.clear(i),t?state.paneResizing||($.fn.enableSelection&&$("body").enableSelection(),options.maskPanesEarly&&hideMasks()):timer.set(i,function(){onResizerLeave(e,n)},200)},_create=function(){initOptions();var e=options,t=state;return t.creatingLayout=!0,runPluginCallbacks(Instance,$.layout.onCreate),!1===_runCallbacks("onload_start")?"cancel":(_initContainer(),initHotkeys(),$(window).bind("unload."+sID,unload),runPluginCallbacks(Instance,$.layout.onLoad),e.initPanes&&_initLayoutElements(),delete t.creatingLayout,state.initialized)},isInitialized=function(){return state.initialized||state.creatingLayout?!0:_initLayoutElements()},_initLayoutElements=function(e){var t=options;if(!$N.is(":visible"))return!e&&browser.webkit&&$N[0].tagName==="BODY"&&setTimeout(function(){_initLayoutElements(!0)},50),!1;if(!getPane("center").length)return _log(t.errors.centerPaneMissing);state.creatingLayout=!0,$.extend(sC,elDims($N,t.inset)),initPanes();if(t.scrollToBookmarkOnLoad){var n=self.location;n.hash&&n.replace(n.hash)}return Instance.hasParentLayout?t.resizeWithWindow=!1:t.resizeWithWindow&&$(window).bind("resize."+sID,windowResize),delete state.creatingLayout,state.initialized=!0,runPluginCallbacks(Instance,$.layout.onReady),_runCallbacks("onload_end"),!0},createChildren=function(e,t){var n=evtPane.call(this,e),r=$Ps[n];if(!r)return;var i=$Cs[n],s=state[n],o=options[n],u=options.stateManagement||{},a=t?o.children=t:o.children;if($.isPlainObject(a))a=[a];else if(!a||!$.isArray(a))return;$.each(a,function(e,t){if(!$.isPlainObject(t))return;var o=t.containerSelector?r.find(t.containerSelector):i||r;o.each(function(){var e=$(this),r=e.data("layout");if(!r){setInstanceKey({container:e,options:t},s);if(u.includeChildren&&state.stateData[n]){var i=state.stateData[n].children||{},o=i[t.instanceKey],a=t.stateManagement||(t.stateManagement={autoLoad:!0});a.autoLoad===!0&&o&&(a.autoSave=!1,a.includeChildren=!0,a.autoLoad=$.extend(!0,{},o))}r=e.layout(t),r&&refreshChildren(n,r)}})})},setInstanceKey=function(e,t){var n=e.container,r=e.options,i=r.stateManagement,s=r.instanceKey||n.data("layoutInstanceKey");return s||(s=(i&&i.cookie?i.cookie.name:"")||r.name),s?s=s.replace(/[^\w-]/gi,"_").replace(/_{2,}/g,"_"):s="layout"+ ++t.childIdx,r.instanceKey=s,n.data("layoutInstanceKey",s),s},refreshChildren=function(e,t){var n=$Ps[e],r=children[e],i=state[e],s;$.isPlainObject(r)&&($.each(r,function(e,t){t.destroyed&&delete r[e]}),$.isEmptyObject(r)&&(r=children[e]=null)),!t&&!r&&(t=n.data("layout")),t&&(t.hasParentLayout=!0,s=t.options,setInstanceKey(t,i),r||(r=children[e]={}),r[s.instanceKey]=t.container.data("layout")),Instance[e].children=children[e],t||createChildren(e)},windowResize=function(){var e=options,t=Number(e.resizeWithWindowDelay);t<10&&(t=100),timer.clear("winResize"),timer.set("winResize",function(){timer.clear("winResize"),timer.clear("winResizeRepeater");var t=elDims($N,e.inset);(t.innerWidth!==sC.innerWidth||t.innerHeight!==sC.innerHeight)&&resizeAll()},t),timer.data.winResizeRepeater||setWindowResizeRepeater()},setWindowResizeRepeater=function(){var e=Number(options.resizeWithWindowMaxDelay);e>0&&timer.set("winResizeRepeater",function(){setWindowResizeRepeater(),resizeAll()},e)},unload=function(){var e=options;_runCallbacks("onunload_start"),runPluginCallbacks(Instance,$.layout.onUnload),_runCallbacks("onunload_end")},_initContainer=function(){var e=$N[0],t=$("html"),n=sC.tagName=e.tagName,r=sC.id=e.id,i=sC.className=e.className,s=options,o=s.name,u="position,margin,padding,border",a="layoutCSS",f={},l="hidden",c=$N.data("parentLayout"),h=$N.data("layoutEdge"),p=c&&h,d=$.layout.cssNum,v,m;sC.selector=$N.selector.split(".slice")[0],sC.ref=(s.name?s.name+" layout / ":"")+n+(r?"#"+r:i?".["+i+"]":""),sC.isBody=n==="BODY",!p&&!sC.isBody&&(v=$N.closest("."+$.layout.defaults.panes.paneClass),c=v.data("parentLayout"),h=v.data("layoutEdge"),p=c&&h),$N.data({layout:Instance,layoutContainer:sID}).addClass(s.containerClass);var g={destroy:"",initPanes:"",resizeAll:"resizeAll",resize:"resizeAll"};for(o in g)$N.bind("layout"+o.toLowerCase()+"."+sID,Instance[g[o]||o]);p&&(Instance.hasParentLayout=!0,c.refreshChildren(h,Instance)),$N.data(a)||(sC.isBody?($N.data(a,$.extend(styles($N,u),{height:$N.css("height"),overflow:$N.css("overflow"),overflowX:$N.css("overflowX"),overflowY:$N.css("overflowY")})),t.data(a,$.extend(styles(t,"padding"),{height:"auto",overflow:t.css("overflow"),overflowX:t.css("overflowX"),overflowY:t.css("overflowY")}))):$N.data(a,styles($N,u+",top,bottom,left,right,width,height,overflow,overflowX,overflowY")));try{f={overflow:l,overflowX:l,overflowY:l},$N.css(f),s.inset&&!$.isPlainObject(s.inset)&&(m=parseInt(s.inset,10)||0,s.inset={top:m,bottom:m,left:m,right:m});if(sC.isBody)s.outset?$.isPlainObject(s.outset)||(m=parseInt(s.outset,10)||0,s.outset={top:m,bottom:m,left:m,right:m}):s.outset={top:d(t,"paddingTop"),bottom:d(t,"paddingBottom"),left:d(t,"paddingLeft"),right:d(t,"paddingRight")},t.css(f).css({height:"100%",border:"none",padding:0,margin:0}),browser.isIE6?($N.css({width:"100%",height:"100%",border:"none",padding:0,margin:0,position:"relative"}),s.inset||(s.inset=elDims($N).inset)):($N.css({width:"auto",height:"auto",margin:0,position:"absolute"}),$N.css(s.outset)),$.extend(sC,elDims($N,s.inset));else{var y=$N.css("position");(!y||!y.match(/(fixed|absolute|relative)/))&&$N.css("position","relative"),$N.is(":visible")&&($.extend(sC,elDims($N,s.inset)),sC.innerHeight<1&&_log(s.errors.noContainerHeight.replace(/CONTAINER/,sC.ref)))}d($N,"minWidth")&&$N.parent().css("overflowX","auto"),d($N,"minHeight")&&$N.parent().css("overflowY","auto")}catch(b){}},initHotkeys=function(e){e=e?e.split(","):_c.borderPanes,$.each(e,function(e,t){var n=options[t];if(n.enableCursorHotkey||n.customHotkey)return $(document).bind("keydown."+sID,keyDown),!1})},initOptions=function(){function c(e){var t=options[e],n=options.panes;t.fxSettings||(t.fxSettings={}),n.fxSettings||(n.fxSettings={}),$.each(["_open","_close","_size"],function(r,i){var s="fxName"+i,o="fxSpeed"+i,u="fxSettings"+i,a=t[s]=t[s]||n[s]||t.fxName||n.fxName||"none",f=$.effects&&($.effects[a]||$.effects.effect&&$.effects.effect[a]);if(a==="none"||!options.effects[a]||!f)a=t[s]="none";var l=options.effects[a]||{},c=l.all||null,h=l[e]||null;t[o]=t[o]||n[o]||t.fxSpeed||n.fxSpeed||null,t[u]=$.extend(!0,{},c,h,n.fxSettings,t.fxSettings,n[u],t[u])}),delete t.fxName,delete t.fxSpeed,delete t.fxSettings}var e,t,n,r,i,s,o,u;opts=$.layout.transformData(opts,!0),opts=$.layout.backwardCompatibility.renameAllOptions(opts);if(!$.isEmptyObject(opts.panes)){e=$.layout.optionsMap.noDefault;for(s=0,o=e.length;s0&&(l.pane_normal=f,l.content_mask=max(f+1,l.content_mask),l.resizer_normal=max(f+2,l.resizer_normal)),delete options.panes},getPane=function(e){var t=options[e].paneSelector;if(t.substr(0,1)==="#")return $N.find(t).eq(0);var n=$N.children(t).eq(0);return n.length?n:$N.children("form:first").children(t).eq(0)},initPanes=function(e){evtPane(e),$.each(_c.allPanes,function(e,t){addPane(t,!0)}),initHandles(),$.each(_c.borderPanes,function(e,t){$Ps[t]&&state[t].isVisible&&(setSizeLimits(t),makePaneFit(t))}),sizeMidPanes("center"),$.each(_c.allPanes,function(e,t){afterInitPane(t)})},addPane=function(e,t){if(!t&&!isInitialized())return;var n=options[e],r=state[e],i=_c[e],s=i.dir,o=r.fx,u=n.spacing_open||0,a=e==="center",f={},l=$Ps[e],c,h,p,d;l?removePane(e,!1,!0,!1):$Cs[e]=!1,l=$Ps[e]=getPane(e);if(!l.length){$Ps[e]=!1;return}if(!l.data("layoutCSS")){var v="position,top,left,bottom,right,width,height,overflow,zIndex,display,backgroundColor,padding,margin,border";l.data("layoutCSS",styles(l,v))}Instance[e]={name:e,pane:$Ps[e],content:$Cs[e],options:options[e],state:state[e],children:children[e]},l.data({parentLayout:Instance,layoutPane:Instance[e],layoutEdge:e,layoutRole:"pane"}).css(i.cssReq).css("zIndex",options.zIndexes.pane_normal).css(n.applyDemoStyles?i.cssDemo:{}).addClass(n.paneClass+" "+n.paneClass+"-"+e).bind("mouseenter."+sID,addHover).bind("mouseleave."+sID,removeHover);var m={hide:"",show:"",toggle:"",close:"",open:"",slideOpen:"",slideClose:"",slideToggle:"",size:"sizePane",sizePane:"sizePane",sizeContent:"",sizeHandles:"",enableClosable:"",disableClosable:"",enableSlideable:"",disableSlideable:"",enableResizable:"",disableResizable:"",swapPanes:"swapPanes",swap:"swapPanes",move:"swapPanes",removePane:"removePane",remove:"removePane",createChildren:"",resizeChildren:"",resizeAll:"resizeAll",resizeLayout:"resizeAll"},g;for(g in m)l.bind("layoutpane"+g.toLowerCase()+"."+sID,Instance[m[g]||g]);initContent(e,!1),a||(c=r.size=_parseSize(e,n.size),h=_parseSize(e,n.minSize)||1,p=_parseSize(e,n.maxSize)||1e5,c>0&&(c=max(min(c,p),h)),r.autoResize=n.autoResize,r.isClosed=!1,r.isSliding=!1,r.isResizing=!1,r.isHidden=!1,r.pins||(r.pins=[])),r.tagName=l[0].tagName,r.edge=e,r.noRoom=!1,r.isVisible=!0,setPanePosition(e),s==="horz"?f.height=cssH(l,c):s==="vert"&&(f.width=cssW(l,c)),l.css(f),s!="horz"&&sizeMidPanes(e,!0),state.initialized&&(initHandles(e),initHotkeys(e)),n.initClosed&&n.closable&&!n.initHidden?close(e,!0,!0):n.initHidden||n.initClosed?hide(e):r.noRoom||l.css("display","block"),l.css("visibility","visible"),n.showOverflowOnHover&&l.hover(allowOverflow,resetOverflow),state.initialized&&afterInitPane(e)},afterInitPane=function(e){var t=$Ps[e],n=state[e],r=options[e];if(!t)return;t.data("layout")&&refreshChildren(e,t.data("layout")),n.isVisible&&(state.initialized?resizeAll():sizeContent(e),r.triggerEventsOnLoad?_runCallbacks("onresize_end",e):resizeChildren(e,!0)),r.initChildren&&r.children&&createChildren(e)},setPanePosition=function(e){e=e?e.split(","):_c.borderPanes,$.each(e,function(e,t){var n=$Ps[t],r=$Rs[t],i=options[t],s=state[t],o=_c[t].side,u={};if(!n)return;switch(t){case"north":u.top=sC.inset.top,u.left=sC.inset.left,u.right=sC.inset.right;break;case"south":u.bottom=sC.inset.bottom,u.left=sC.inset.left,u.right=sC.inset.right;break;case"west":u.left=sC.inset.left;break;case"east":u.right=sC.inset.right;break;case"center":}n.css(u),r&&s.isClosed?r.css(o,sC.inset[o]):r&&!s.isHidden&&r.css(o,sC.inset[o]+getPaneSize(t))})},initHandles=function(e){e=e?e.split(","):_c.borderPanes,$.each(e,function(e,t){var n=$Ps[t];$Rs[t]=!1,$Ts[t]=!1;if(!n)return;var r=options[t],i=state[t],s=_c[t],o=r.paneSelector.substr(0,1)==="#"?r.paneSelector.substr(1):"",u=r.resizerClass,a=r.togglerClass,f=i.isVisible?r.spacing_open:r.spacing_closed,l="-"+t,c=i.isVisible?"-open":"-closed",h=Instance[t],p=h.resizer=$Rs[t]=$("
        "),d=h.toggler=r.closable?$Ts[t]=$("
        "):!1;!i.isVisible&&r.slidable&&p.attr("title",r.tips.Slide).css("cursor",r.sliderCursor),p.attr("id",o?o+"-resizer":"").data({parentLayout:Instance,layoutPane:Instance[t],layoutEdge:t,layoutRole:"resizer"}).css(_c.resizers.cssReq).css("zIndex",options.zIndexes.resizer_normal).css(r.applyDemoStyles?_c.resizers.cssDemo:{}).addClass(u+" "+u+l).hover(addHover,removeHover).hover(onResizerEnter,onResizerLeave).appendTo($N),r.resizerDblClickToggle&&p.bind("dblclick."+sID,toggle),d&&(d.attr("id",o?o+"-toggler":"").data({parentLayout:Instance,layoutPane:Instance[t],layoutEdge:t,layoutRole:"toggler"}).css(_c.togglers.cssReq).css(r.applyDemoStyles?_c.togglers.cssDemo:{}).addClass(a+" "+a+l).hover(addHover,removeHover).bind("mouseenter",onResizerEnter).appendTo(p),r.togglerContent_open&&$(""+r.togglerContent_open+"").data({layoutEdge:t,layoutRole:"togglerContent"}).data("layoutRole","togglerContent").data("layoutEdge",t).addClass("content content-open").css("display","none").appendTo(d),r.togglerContent_closed&&$(""+r.togglerContent_closed+"").data({layoutEdge:t,layoutRole:"togglerContent"}).addClass("content content-closed").css("display","none").appendTo(d),enableClosable(t)),initResizable(t),i.isVisible?setAsOpen(t):(setAsClosed(t),bindStartSlidingEvents(t,!0))}),sizeHandles()},initContent=function(e,t){if(!isInitialized())return;var n=options[e],r=n.contentSelector,i=Instance[e],s=$Ps[e],o;r&&(o=i.content=$Cs[e]=n.findNestedContent?s.find(r).eq(0):s.children(r).eq(0)),o&&o.length?(o.data("layoutRole","content"),o.data("layoutCSS")||o.data("layoutCSS",styles(o,"height")),o.css(_c.content.cssReq),n.applyDemoStyles&&(o.css(_c.content.cssDemo),s.css(_c.content.cssDemoPane)),s.css("overflowX").match(/(scroll|auto)/)&&s.css("overflow","hidden"),state[e].content={},t!==!1&&sizeContent(e)):i.content=$Cs[e]=!1},initResizable=function(e){var t=$.layout.plugins.draggable,n;e=e?e.split(","):_c.borderPanes,$.each(e,function(e,n){var i=options[n];if(!t||!$Ps[n]||!i.resizable)return i.resizable=!1,!0;var s=state[n],o=options.zIndexes,u=_c[n],a=u.dir=="horz"?"top":"left",f=$Ps[n],l=$Rs[n],c=i.resizerClass,h=0,p,d,v=c+"-drag",m=c+"-"+n+"-drag",g=c+"-dragging",y=c+"-"+n+"-dragging",b=c+"-dragging-limit",w=c+"-"+n+"-dragging-limit",E=!1;s.isClosed||l.attr("title",i.tips.Resize).css("cursor",i.resizerCursor),l.draggable({containment:$N[0],axis:u.dir=="horz"?"y":"x",delay:0,distance:1,grid:i.resizingGrid,helper:"clone",opacity:i.resizerDragOpacity,addClasses:!1,zIndex:o.resizer_drag,start:function(e,t){i=options[n],s=state[n],d=i.livePaneResizing;if(!1===_runCallbacks("ondrag_start",n))return!1;s.isResizing=!0,state.paneResizing=n,timer.clear(n+"_closeSlider"),setSizeLimits(n),p=s.resizerPosition,h=t.position[a],l.addClass(v+" "+m),E=!1,$("body").disableSelection(),showMasks(n,{resizing:!0})},drag:function(e,t){E||(t.helper.addClass(g+" "+y).css({right:"auto",bottom:"auto"}).children().css("visibility","hidden"),E=!0,s.isSliding&&$Ps[n].css("zIndex",o.pane_sliding));var u=0;t.position[a]p.max&&(t.position[a]=p.max,u=1),u?(t.helper.addClass(b+" "+w),window.defaultStatus=u>0&&n.match(/(north|west)/)||u<0&&n.match(/(south|east)/)?i.tips.maxSizeWarning:i.tips.minSizeWarning):(t.helper.removeClass(b+" "+w),window.defaultStatus=""),d&&Math.abs(t.position[a]-h)>=i.liveResizingTolerance&&(h=t.position[a],r(e,t,n))},stop:function(e,t){$("body").enableSelection(),window.defaultStatus="",l.removeClass(v+" "+m),s.isResizing=!1,state.paneResizing=!1,r(e,t,n,!0)}})});var r=function(e,t,n,r){var i=t.position,s=_c[n],o=options[n],u=state[n],a;switch(n){case"north":a=i.top;break;case"west":a=i.left;break;case"south":a=sC.layoutHeight-i.top-o.spacing_open;break;case"east":a=sC.layoutWidth-i.left-o.spacing_open}var f=a-sC.inset[s.side];if(!r){if(Math.abs(f-u.size)=0;t--)r=$Ms.eq(t),n=r.data("layoutMask"),options[n].maskObjects||r.hide()}},getMasks=function(e){var t=$([]),n,r=0,i=$Ms.length;for(;rf.maxSize)return syncPinBtns(i,!1),!r&&a.tips.noRoomToOpen&&alert(a.tips.noRoomToOpen),e();t?bindStopSlidingEvents(i,!0):f.isSliding?bindStopSlidingEvents(i,!1):a.slidable&&bindStartSlidingEvents(i,!1),f.noRoom=!1,makePaneFit(i),h=f.isShowing,delete f.isShowing,c=!n&&f.isClosed&&a.fxName_open!="none",f.isMoving=!0,f.isVisible=!0,f.isClosed=!1,h&&(f.isHidden=!1),c?(lockPaneForFX(i,!0),s.show(a.fxName_open,a.fxSettings_open,a.fxSpeed_open,function(){lockPaneForFX(i,!1),f.isVisible&&p(),e()})):(_showPane(i),p(),e())})},setAsOpen=function(e,t){var n=$Ps[e],r=$Rs[e],i=$Ts[e],s=options[e],o=state[e],u=_c[e].side,a=s.resizerClass,f=s.togglerClass,l="-"+e,c="-open",h="-closed",p="-sliding";r.css(u,sC.inset[u]+getPaneSize(e)).removeClass(a+h+" "+a+l+h).addClass(a+c+" "+a+l+c),o.isSliding?r.addClass(a+p+" "+a+l+p):r.removeClass(a+p+" "+a+l+p),removeHover(0,r),s.resizable&&$.layout.plugins.draggable?r.draggable("enable").css("cursor",s.resizerCursor).attr("title",s.tips.Resize):o.isSliding||r.css("cursor","default"),i&&(i.removeClass(f+h+" "+f+l+h).addClass(f+c+" "+f+l+c).attr("title",s.tips.Close),removeHover(0,i),i.children(".content-closed").hide(),i.children(".content-open").css("display","block")),syncPinBtns(e,!o.isSliding),$.extend(o,elDims(n)),state.initialized&&(sizeHandles(),sizeContent(e,!0)),!t&&(state.initialized||s.triggerEventsOnLoad)&&n.is(":visible")&&(_runCallbacks("onopen_end",e),o.isShowing&&_runCallbacks("onshow_end",e),state.initialized&&_runCallbacks("onresize_end",e))},slideOpen=function(e){function s(){r.isClosed?r.isMoving||open(n,!0):bindStopSlidingEvents(n,!0)}if(!isInitialized())return;var t=evtObj(e),n=evtPane.call(this,e),r=state[n],i=options[n].slideDelay_open;t&&t.stopImmediatePropagation(),r.isClosed&&t&&t.type==="mouseenter"&&i>0?timer.set(n+"_openSlider",s,i):s()},slideClose=function(e){function o(){i.isClosed?bindStopSlidingEvents(n,!1):i.isMoving||close(n)}if(!isInitialized())return;var t=evtObj(e),n=evtPane.call(this,e),r=options[n],i=state[n],s=i.isMoving?1e3:300;if(i.isClosed||i.isResizing)return;if(r.slideTrigger_close==="click")o();else{if(r.preventQuickSlideClose&&i.isMoving)return;if(r.preventPrematureSlideClose&&t&&$.layout.isMouseOverElem(t,$Ps[n]))return;t?timer.set(n+"_closeSlider",o,max(r.slideDelay_close,s)):o()}},slideToggle=function(e){var t=evtPane.call(this,e);toggle(t,!0)},lockPaneForFX=function(e,t){var n=$Ps[e],r=state[e],i=options[e],s=options.zIndexes;t?(showMasks(e,{animation:!0,objectsOnly:!0}),n.css({zIndex:s.pane_animate}),e=="south"?n.css({top:sC.inset.top+sC.innerHeight-n.outerHeight()}):e=="east"&&n.css({left:sC.inset.left+sC.innerWidth-n.outerWidth()})):(hideMasks(),n.css({zIndex:r.isSliding?s.pane_sliding:s.pane_normal}),e=="south"?n.css({top:"auto"}):e=="east"&&!n.css("left").match(/\-99999/)&&n.css({left:"auto"}),browser.msie&&i.fxOpacityFix&&i.fxName_open!="slide"&&n.css("filter")&&n.css("opacity")==1&&n[0].style.removeAttribute("filter"))},bindStartSlidingEvents=function(e,t){var n=options[e],r=$Ps[e],i=$Rs[e],s=n.slideTrigger_open.toLowerCase();if(!i||t&&!n.slidable)return;s.match(/mouseover/)?s=n.slideTrigger_open="mouseenter":s.match(/(click|dblclick|mouseenter)/)||(s=n.slideTrigger_open="click"),n.resizerDblClickToggle&&s.match(/click/)&&i[t?"unbind":"bind"]("dblclick."+sID,toggle),i[t?"bind":"unbind"](s+"."+sID,slideOpen).css("cursor",t?n.sliderCursor:"default").attr("title",t?n.tips.Slide:"")},bindStopSlidingEvents=function(e,t){function l(t){timer.clear(e+"_closeSlider"),t.stopPropagation()}var n=options[e],r=state[e],i=_c[e],s=options.zIndexes,o=n.slideTrigger_close.toLowerCase(),u=t?"bind":"unbind",a=$Ps[e],f=$Rs[e];timer.clear(e+"_closeSlider"),t?(r.isSliding=!0,state.panesSliding[e]=!0,bindStartSlidingEvents(e,!1)):(r.isSliding=!1,delete state.panesSliding[e]),a.css("zIndex",t?s.pane_sliding:s.pane_normal),f.css("zIndex",t?s.pane_sliding+2:s.resizer_normal),o.match(/(click|mouseleave)/)||(o=n.slideTrigger_close="mouseleave"),f[u](o,slideClose),o==="mouseleave"&&(a[u]("mouseleave."+sID,slideClose),f[u]("mouseenter."+sID,l),a[u]("mouseenter."+sID,l)),t?o==="click"&&!n.resizable&&(f.css("cursor",t?n.sliderCursor:"default"),f.attr("title",t?n.tips.Close:"")):timer.clear(e+"_closeSlider")},makePaneFit=function(e,t,n,r){var i=options[e],s=state[e],o=_c[e],u=$Ps[e],a=$Rs[e],f=o.dir==="vert",l=!1;if(e==="center"||f&&s.noVerticalRoom)l=s.maxHeight>=0,l&&s.noRoom?(_showPane(e),a&&a.show(),s.isVisible=!0,s.noRoom=!1,f&&(s.noVerticalRoom=!1),_fixIframe(e)):!l&&!s.noRoom&&(_hidePane(e),a&&a.hide(),s.isVisible=!1,s.noRoom=!0);if(e!=="center")if(s.minSize<=s.maxSize){l=!0;if(s.size>s.maxSize)sizePane(e,s.maxSize,n,!0,r);else if(s.sizet?p.attempt=max(0,o.attempt-(o.actual-t)):p.attempt=max(0,o.attempt+(t-o.actual)),p.cssSize=cssSize(s,p.attempt),a.css(c,p.cssSize),p.actual=c=="width"?a.outerWidth():a.outerHeight(),p.correct=t===p.actual,r.length===1&&(_log(m,!1,!0),_log(o,!1,!0)),_log(p,!1,!0);if(r.length>3)break;r.push(p),o=r[r.length-1]}u.size=t,$.extend(u,elDims(a)),u.isVisible&&a.is(":visible")&&(f&&f.css(l,t+sC.inset[l]),sizeContent(s)),!n&&!h&&state.initialized&&u.isVisible&&_runCallbacks("onresize_end",s),n||(u.isSliding||sizeMidPanes(_c[s].dir=="horz"?"":"center",h,i),sizeHandles());var g=_c.oppositeEdge[s];t1&&_log(m+"\nSee the Error Console for details.",!0,!0)}if(!isInitialized())return;var s=evtPane.call(this,e),o=options[s],u=state[s],a=$Ps[s],f=$Rs[s],l=_c[s].side,c=_c[s].sizeType.toLowerCase(),h=u.isResizing&&!o.triggerEventsDuringLiveResize,p=r!==!0&&o.animatePaneSizing,d,v;$N.queue(function(e){setSizeLimits(s),d=u.size,t=_parseSize(s,t),t=max(t,_parseSize(s,o.minSize)),t=min(t,u.maxSize);if(t=0&&l.height>=0;if(!state.initialized&&i.minWidth>h.width){var p=i.minWidth-s.outerWidth,d=options.east.minSize||0,v=options.west.minSize||0,m=state.east.size,g=state.west.size,y=m,b=g;p>0&&state.east.isVisible&&m>d&&(y=max(m-d,m-p),p-=m-y),p>0&&state.west.isVisible&&g>v&&(b=max(g-v,g-p),p-=g-b);if(p===0){m&&m!=d&&sizePane("east",y,!0,!0,n),g&&g!=v&&sizePane("west",b,!0,!0,n),sizeMidPanes("center",t,n),o.css(c);return}}}else{s.isVisible&&!s.noVerticalRoom&&$.extend(s,elDims(o),cssMinDims(r));if(!n&&!s.noVerticalRoom&&h.height===s.outerHeight)return o.css(c),!0;l.top=h.top,l.bottom=h.bottom,s.newSize=h.height,l.height=cssH(o,h.height),s.maxHeight=l.height,f=s.maxHeight>=0,f||(s.noVerticalRoom=!0)}f?(!t&&state.initialized&&_runCallbacks("onresize_start",r),o.css(l),r!=="center"&&sizeHandles(r),s.noRoom&&!s.isClosed&&!s.isHidden&&makePaneFit(r),s.isVisible&&($.extend(s,elDims(o)),state.initialized&&sizeContent(r))):!s.noRoom&&s.isVisible&&makePaneFit(r),o.css(c),delete s.newSize,delete s.newWidth,delete s.newHeight;if(!s.isVisible)return!0;if(r==="center"){var w=browser.isIE6||!browser.boxModel;$Ps.north&&(w||state.north.tagName=="IFRAME")&&$Ps.north.css("width",cssW($Ps.north,sC.innerWidth)),$Ps.south&&(w||state.south.tagName=="IFRAME")&&$Ps.south.css("width",cssW($Ps.south,sC.innerWidth))}!t&&state.initialized&&_runCallbacks("onresize_end",r)})},resizeAll=function(e){var t=sC.innerWidth,n=sC.innerHeight;evtPane(e);if(!$N.is(":visible"))return;if(!state.initialized){_initLayoutElements();return}e===!0&&$.isPlainObject(options.outset)&&$N.css(options.outset),$.extend(sC,elDims($N,options.inset));if(!sC.outerHeight)return;e===!0&&setPanePosition();if(!1===_runCallbacks("onresizeall_start"))return!1;var r=sC.innerHeight0&&r.css("overflow")==="hidden"&&(r.css("overflow","visible"),l(),r.css("overflow","hidden"));var a=o.innerHeight-(u.spaceAbove-o.css.paddingTop)-(u.spaceBelow-o.css.paddingBottom);if(!i.is(":visible")||u.height!=a)setOuterHeight(i,a,!0),u.height=a;state.initialized&&_runCallbacks("onsizecontent_end",n)})},sizeHandles=function(e){var t=evtPane.call(this,e);t=t?t.split(","):_c.borderPanes,$.each(t,function(e,t){var n=options[t],r=state[t],i=$Ps[t],s=$Rs[t],o=$Ts[t],u;if(!i||!s)return;var a=_c[t].dir,f=r.isClosed?"_closed":"_open",l=n["spacing"+f],c=n["togglerAlign"+f],h=n["togglerLength"+f],p,d,v,m={};if(l===0){s.hide();return}!r.noRoom&&!r.isHidden&&s.show(),a==="horz"?(p=sC.innerWidth,r.resizerLength=p,d=$.layout.cssNum(i,"left"),s.css({width:cssW(s,p),height:cssH(s,l),left:d>-9999?d:sC.inset.left})):(p=i.outerHeight(),r.resizerLength=p,s.css({height:cssH(s,p),width:cssW(s,l),top:sC.inset.top+getPaneSize("north",!0)})),removeHover(n,s);if(o){if(h===0||r.isSliding&&n.hideTogglerOnSlide){o.hide();return}o.show();if(!(h>0)||h==="100%"||h>p)h=p,v=0;else if(isStr(c))switch(c){case"top":case"left":v=0;break;case"bottom":case"right":v=p-h;break;case"middle":case"center":default:v=round((p-h)/2)}else{var g=parseInt(c,10);c>=0?v=g:v=p-h+g}if(a==="horz"){var y=cssW(o,h);o.css({width:y,height:cssH(o,l),left:v,top:0}),o.children(".content").each(function(){u=$(this),u.css("marginLeft",round((y-u.outerWidth())/2))})}else{var b=cssH(o,h);o.css({height:b,width:cssW(o,l),top:v,left:0}),o.children(".content").each(function(){u=$(this),u.css("marginTop",round((b-u.outerHeight())/2))})}removeHover(0,o)}!state.initialized&&(n.initHidden||r.isHidden)&&(s.hide(),o&&o.hide())})},enableClosable=function(e){if(!isInitialized())return;var t=evtPane.call(this,e),n=$Ts[t],r=options[t];if(!n)return;r.closable=!0,n.bind("click."+sID,function(e){e.stopPropagation(),toggle(t)}).css("visibility","visible").css("cursor","pointer").attr("title",state[t].isClosed?r.tips.Open:r.tips.Close).show()},disableClosable=function(e,t){if(!isInitialized())return;var n=evtPane.call(this,e),r=$Ts[n];if(!r)return;options[n].closable=!1,state[n].isClosed&&open(n,!1,!0),r.unbind("."+sID).css("visibility",t?"hidden":"visible").css("cursor","default").attr("title","")},enableSlidable=function(e){if(!isInitialized())return;var t=evtPane.call(this,e),n=$Rs[t];if(!n||!n.data("draggable"))return;options[t].slidable=!0,state[t].isClosed&&bindStartSlidingEvents(t,!0)},disableSlidable=function(e){if(!isInitialized())return;var t=evtPane.call(this,e),n=$Rs[t];if(!n)return;options[t].slidable=!1,state[t].isSliding?close(t,!1,!0):(bindStartSlidingEvents(t,!1),n.css("cursor","default").attr("title",""),removeHover(null,n[0]))},enableResizable=function(e){if(!isInitialized())return;var t=evtPane.call(this,e),n=$Rs[t],r=options[t];if(!n||!n.data("draggable"))return;r.resizable=!0,n.draggable("enable"),state[t].isClosed||n.css("cursor",r.resizerCursor).attr("title",r.tips.Resize)},disableResizable=function(e){if(!isInitialized())return;var t=evtPane.call(this,e),n=$Rs[t];if(!n||!n.data("draggable"))return;options[t].resizable=!1,n.draggable("disable").css("cursor","default").attr("title",""),removeHover(null,n[0])},swapPanes=function(e,t){function o(e){var t=$Ps[e],n=$Cs[e];return t?{pane:e,P:t?t[0]:!1,C:n?n[0]:!1,state:$.extend(!0,{},state[e]),options:$.extend(!0,{},options[e])}:!1}function u(e,t){if(!e)return;var n=e.P,r=e.C,i=e.pane,o=_c[t],u=$.extend(!0,{},state[t]),a=options[t],f={resizerCursor:a.resizerCursor},l,c,h;$.each("fxName,fxSpeed,fxSettings".split(","),function(e,t){f[t+"_open"]=a[t+"_open"],f[t+"_close"]=a[t+"_close"],f[t+"_size"]=a[t+"_size"]}),$Ps[t]=$(n).data({layoutPane:Instance[t],layoutEdge:t}).css(_c.hidden).css(o.cssReq),$Cs[t]=r?$(r):!1,options[t]=$.extend(!0,{},e.options,f),state[t]=$.extend(!0,{},e.state),l=new RegExp(a.paneClass+"-"+i,"g"),n.className=n.className.replace(l,a.paneClass+"-"+t),initHandles(t),o.dir!=_c[i].dir?(c=s[t]||0,setSizeLimits(t),c=max(c,state[t].minSize),manualSizePane(t,c,!0,!0)):$Rs[t].css(o.side,sC.inset[o.side]+(state[t].isVisible?getPaneSize(t):0)),e.state.isVisible&&!u.isVisible?setAsOpen(t,!0):(setAsClosed(t),bindStartSlidingEvents(t,!0)),e=null}if(!isInitialized())return;var n=evtPane.call(this,e);state[n].edge=t,state[t].edge=n;if(!1===_runCallbacks("onswap_start",n)||!1===_runCallbacks("onswap_start",t)){state[n].edge=n,state[t].edge=t;return}var r=o(n),i=o(t),s={};s[n]=r?r.state.size:0,s[t]=i?i.state.size:0,$Ps[n]=!1,$Ps[t]=!1,state[n]={},state[t]={},$Ts[n]&&$Ts[n].remove(),$Ts[t]&&$Ts[t].remove(),$Rs[n]&&$Rs[n].remove(),$Rs[t]&&$Rs[t].remove(),$Rs[n]=$Rs[t]=$Ts[n]=$Ts[t]=!1,u(r,t),u(i,n),r=i=s=null,$Ps[n]&&$Ps[n].css(_c.visible),$Ps[t]&&$Ps[t].css(_c.visible),resizeAll(),_runCallbacks("onswap_end",n),_runCallbacks("onswap_end",t);return},syncPinBtns=function(e,t){$.layout.plugins.buttons&&$.each(state[e].pins,function(n,r){$.layout.buttons.setPinState(Instance,$(r),e,t)})},$N=$(this).eq(0);if(!$N.length)return _log(options.errors.containerMissing);if($N.data("layoutContainer")&&$N.data("layout"))return $N.data("layout");var $Ps={},$Cs={},$Rs={},$Ts={},$Ms=$([]),sC=state.container,sID=state.id,Instance={options:options,state:state,container:$N,panes:$Ps,contents:$Cs,resizers:$Rs,togglers:$Ts,hide:hide,show:show,toggle:toggle,open:open,close:close,slideOpen:slideOpen,slideClose:slideClose,slideToggle:slideToggle,setSizeLimits:setSizeLimits,_sizePane:sizePane,sizePane:manualSizePane,sizeContent:sizeContent,swapPanes:swapPanes,showMasks:showMasks,hideMasks:hideMasks,initContent:initContent,addPane:addPane,removePane:removePane,createChildren:createChildren,refreshChildren:refreshChildren,enableClosable:enableClosable,disableClosable:disableClosable,enableSlidable:enableSlidable,disableSlidable:disableSlidable,enableResizable:enableResizable,disableResizable:disableResizable,allowOverflow:allowOverflow,resetOverflow:resetOverflow,destroy:destroy,initPanes:isInitialized,resizeAll:resizeAll,runCallbacks:_runCallbacks,hasParentLayout:!1,children:children,north:!1,south:!1,west:!1,east:!1,center:!1};return _create()==="cancel"?null:Instance}}(jQuery),function(e){e.ui||(e.ui={}),e.ui.cookie={acceptsCookies:!!navigator.cookieEnabled,read:function(t){var n=document.cookie,r=n?n.split(";"):[],i;for(var s=0,o=r.length;s0&&(a=parseInt(a,10),f="number"),f==="number"&&(s=new Date,a>0?s.setDate(s.getDate()+a):(s.setFullYear(1970),o=!0)),s&&(i+=";expires="+s.toUTCString()),u.path&&(i+=";path="+u.path),u.domain&&(i+=";domain="+u.domain),u.secure&&(i+=";secure"),document.cookie=t+"="+(o?"":encodeURIComponent(n))+i},clear:function(t){e.ui.cookie.write(t,"",{expires:-1})}},e.cookie||(e.cookie=function(t,n,r){var i=e.ui.cookie;if(n===null)i.clear(t);else{if(n===undefined)return i.read(t);i.write(t,n,r)}}),e.layout.plugins.stateManagement=!0,e.layout.config.optionRootKeys.push("stateManagement"),e.layout.defaults.stateManagement={enabled:!1,autoSave:!0,autoLoad:!0,animateLoad:!0,includeChildren:!0,stateKeys:"north.size,south.size,east.size,west.size,north.isClosed,south.isClosed,east.isClosed,west.isClosed,north.isHidden,south.isHidden,east.isHidden,west.isHidden",cookie:{name:"",domain:"",path:"",expires:"",secure:!1}},e.layout.optionsMap.layout.push("stateManagement"),e.layout.state={saveCookie:function(t,n,r){var i=t.options,s=i.stateManagement,o=e.extend(!0,{},s.cookie,r||null),u=t.state.stateData=t.readState(n||s.stateKeys);return e.ui.cookie.write(o.name||i.name||"Layout",e.layout.state.encodeJSON(u),o),e.extend(!0,{},u)},deleteCookie:function(t){var n=t.options;e.ui.cookie.clear(n.stateManagement.cookie.name||n.name||"Layout")},readCookie:function(t){var n=t.options,r=e.ui.cookie.read(n.stateManagement.cookie.name||n.name||"Layout");return r?e.layout.state.decodeJSON(r):{}},loadCookie:function(t){var n=e.layout.state.readCookie(t);return n&&(t.state.stateData=e.extend(!0,{},n),t.loadState(n)),n},loadState:function(t,n,r){if(!e.isPlainObject(n)||e.isEmptyObject(n))return;n=t.state.stateData=e.layout.transformData(n);var i=t.options.stateManagement;r=e.extend({animateLoad:!1,includeChildren:i.includeChildren},r);if(!t.state.initialized){var o=e.extend(!0,{},n);e.each(e.layout.config.allPanes,function(e,t){o[t]&&delete o[t].children}),e.extend(!0,t.options,o)}else{var u=!r.animateLoad,o,a,f,l,c;e.each(e.layout.config.borderPanes,function(r,i){o=n[i];if(!e.isPlainObject(o))return;s=o.size,a=o.initClosed,f=o.initHidden,ar=o.autoResize,l=t.state[i],c=l.isVisible,ar&&(l.autoResize=ar),c||t._sizePane(i,s,!1,!1,!1),f===!0?t.hide(i,u):a===!0?t.close(i,!1,u):a===!1?t.open(i,!1,u):f===!1&&t.show(i,!1,u),c&&t._sizePane(i,s,!1,!1,u)});if(r.includeChildren){var h,p;e.each(t.children,function(t,r){h=n[t]?n[t].children:0,h&&r&&e.each(r,function(e,t){p=h[e],t&&p&&t.loadState(p)})})}}},readState:function(t,n){e.type(n)==="string"&&(n={keys:n}),n||(n={});var r=t.options.stateManagement,i=n.includeChildren,s=i!==undefined?i:r.includeChildren,o=n.stateKeys||r.stateKeys,u={isClosed:"initClosed",isHidden:"initHidden"},a=t.state,f=e.layout.config.allPanes,l={},c,h,p,d,v,m,g,y,b,w;e.isArray(o)&&(o=o.join(",")),o=o.replace(/__/g,".").split(",");for(var E=0,S=o.length;E8||!s.msie?!1:n.deviceXDPI&&n.systemXDPI?l(n.deviceXDPI,n.systemXDPI):s.webkit&&(u=r.body.getBoundingClientRect)?l(u.left-u.right,r.body.offsetWidth):s.webkit&&(a=t.outerWidth)?l(a,t.innerWidth):(a=n.width)&&(f=i.clientWidth)?l(a,f):!1}},e.layout.onReady.push(e.layout.browserZoom._init)}(jQuery),define("layout",function(){});var Markdown;typeof exports=="object"&&typeof require=="function"?Markdown=exports:Markdown={},function(){function e(e){return e}function t(e){return!1}function n(){}function r(){}n.prototype={chain:function(t,n){var r=this[t];if(!r)throw new Error("unknown hook "+t);r===e?this[t]=n:this[t]=function(e){var t=Array.prototype.slice.call(arguments,0);return t[0]=r.apply(null,t),n.apply(null,t)}},set:function(e,t){if(!this[e])throw new Error("unknown hook "+e);this[e]=t},addNoop:function(t){this[t]=e},addFalse:function(e){this[e]=t}},Markdown.HookCollection=n,r.prototype={set:function(e,t){this["s_"+e]=t},get:function(e){return this["s_"+e]}},Markdown.Converter=function(){function u(e){return e=e.replace(/^[ ]{0,3}\[(.+)\]:[ \t]*\n?[ \t]*?(?=\s|$)[ \t]*\n?[ \t]*((\n*)["(](.+?)[")][ \t]*)?(?:\n+)/gm,function(e,n,r,s,o,u){return n=n.toLowerCase(),t.set(n,O(r)),o?s:(u&&i.set(n,u.replace(/"/g,""")),"")}),e}function a(e){var t="p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math|ins|del",n="p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math";return e=e.replace(/^(<(p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math|ins|del)\b[^\r]*?\n<\/\2>[ \t]*(?=\n+))/gm,f),e=e.replace(/^(<(p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math)\b[^\r]*?.*<\/\2>[ \t]*(?=\n+)\n)/gm,f),e=e.replace(/\n[ ]{0,3}((<(hr)\b([^<>])*?\/?>)[ \t]*(?=\n{2,}))/g,f),e=e.replace(/\n\n[ ]{0,3}(-]|-[^>])(?:[^-]|-[^-])*)--)>[ \t]*(?=\n{2,}))/g,f),e=e.replace(/(?:\n\n)([ ]{0,3}(?:<([?%])[^\r]*?\2>)[ \t]*(?=\n{2,}))/g,f),e}function f(e,t){var n=t;return n=n.replace(/^\n+/,""),n=n.replace(/\n+$/g,""),n="\n\n~K"+(s.push(n)-1)+"K\n\n",n}function c(t,n){t=e.preBlockGamut(t,l),t=b(t);var r="
        \n";return t=t.replace(/^[ ]{0,2}([ ]?\*[ ]?){3,}[ \t]*$/gm,r),t=t.replace(/^[ ]{0,2}([ ]?-[ ]?){3,}[ \t]*$/gm,r),t=t.replace(/^[ ]{0,2}([ ]?_[ ]?){3,}[ \t]*$/gm,r),t=w(t),t=x(t),t=L(t),t=e.postBlockGamut(t,l),t=a(t),t=A(t,n),t}function h(t){return t=e.preSpanGamut(t),t=N(t),t=p(t),t=M(t),t=m(t),t=d(t),t=D(t),t=t.replace(/~P/g,"://"),t=O(t),t=k(t),t=t.replace(/ +\n/g,"
        \n"),t=e.postSpanGamut(t),t}function p(e){var t=/(<[a-z\/!$]("[^"]*"|'[^']*'|[^'">])*>|-]|-[^>])(?:[^-]|-[^-])*)--)>)/gi;return e=e.replace(t,function(e){var t=e.replace(/(.)<\/?code>(?=.)/g,"$1`");return t=I(t,e.charAt(1)=="!"?"\\`*_/":"\\`*_"),t}),e}function d(e){return e=e.replace(/(\[((?:\[[^\]]*\]|[^\[\]])*)\][ ]?(?:\n[ ]*)?\[(.*?)\])()()()()/g,v),e=e.replace(/(\[((?:\[[^\]]*\]|[^\[\]])*)\]\([ \t]*()?[ \t]*((['"])(.*?)\6[ \t]*)?\))/g,v),e=e.replace(/(\[([^\[\]]+)\])()()()()()/g,v),e}function v(e,n,r,s,o,u,a,f){f==undefined&&(f="");var l=n,c=r.replace(/:\/\//g,"~P"),h=s.toLowerCase(),p=o,d=f;if(p==""){h==""&&(h=c.toLowerCase().replace(/ ?\n/g," ")),p="#"+h;if(t.get(h)!=undefined)p=t.get(h),i.get(h)!=undefined&&(d=i.get(h));else{if(!(l.search(/\(\s*\)$/m)>-1))return l;p=""}}p=F(p),p=I(p,"*_");var v='",v}function m(e){return e=e.replace(/(!\[(.*?)\][ ]?(?:\n[ ]*)?\[(.*?)\])()()()()/g,y),e=e.replace(/(!\[(.*?)\]\s?\([ \t]*()?[ \t]*((['"])(.*?)\6[ \t]*)?\))/g,y),e}function g(e){return e.replace(/>/g,">").replace(/"+h(t)+"\n\n"}),e=e.replace(/^(.+)[ \t]*\n-+[ \t]*\n+/gm,function(e,t){return"

        "+h(t)+"

        \n\n"}),e=e.replace(/^(\#{1,6})[ \t]*(.+?)[ \t]*\#*\n+/gm,function(e,t,n){var r=t.length;return""+h(n)+"\n\n"}),e}function w(e){e+="~0";var t=/^(([ ]{0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(~0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/gm;return o?e=e.replace(t,function(e,t,n){var r=t,i=n.search(/[*+-]/g)>-1?"ul":"ol",s=S(r,i);return s=s.replace(/\s+$/,""),s="<"+i+">"+s+"\n",s}):(t=/(\n\n|^\n?)(([ ]{0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(~0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/g,e=e.replace(t,function(e,t,n,r){var i=t,s=n,o=r.search(/[*+-]/g)>-1?"ul":"ol",u=S(s,o);return u=i+"<"+o+">\n"+u+"\n",u})),e=e.replace(/~0/,""),e}function S(e,t){o++,e=e.replace(/\n{2,}$/,"\n"),e+="~0";var n=E[t],r=new RegExp("(^[ \\t]*)("+n+")[ \\t]+([^\\r]+?(\\n+))(?=(~0|\\1("+n+")[ \\t]+))","gm"),i=!1;return e=e.replace(r,function(e,t,n,r){var s=r,o=t,u=/\n\n$/.test(s),a=u||s.search(/\n{2,}/)>-1;return a||i?s=c(H(s),!0):(s=w(H(s)),s=s.replace(/\n$/,""),s=h(s)),i=u,"
      • "+s+"
      • \n"}),e=e.replace(/~0/g,""),o--,e}function x(e){return e+="~0",e=e.replace(/(?:\n\n|^\n?)((?:(?:[ ]{4}|\t).*\n+)+)(\n*[ ]{0,3}[^ \t\n]|(?=~0))/g,function(e,t,n){var r=t,i=n;return r=C(H(r)),r=B(r),r=r.replace(/^\n+/g,""),r=r.replace(/\n+$/g,""),r="
        "+r+"\n
        ","\n\n"+r+"\n\n"+i}),e=e.replace(/~0/,""),e}function T(e){return e=e.replace(/(^\n+|\n+$)/g,""),"\n\n~K"+(s.push(e)-1)+"K\n\n"}function N(e){return e=e.replace(/(^|[^\\])(`+)([^\r]*?[^`])\2(?!`)/gm,function(e,t,n,r,i){var s=r;return s=s.replace(/^([ \t]*)/g,""),s=s.replace(/[ \t]*$/g,""),s=C(s),s=s.replace(/:\/\//g,"~P"),t+""+s+""}),e}function C(e){return e=e.replace(/&/g,"&"),e=e.replace(//g,">"),e=I(e,"*_{}[]\\",!1),e}function k(e){return e=e.replace(/([\W_]|^)(\*\*|__)(?=\S)([^\r]*?\S[\*_]*)\2([\W_]|$)/g,"$1$3$4"),e=e.replace(/([\W_]|^)(\*|_)(?=\S)([^\r\*_]*?\S)\2([\W_]|$)/g,"$1$3$4"),e}function L(e){return e=e.replace(/((^[ \t]*>[ \t]?.+\n(.+\n)*\n*)+)/gm,function(e,t){var n=t;return n=n.replace(/^[ \t]*>[ \t]?/gm,"~0"),n=n.replace(/~0/g,""),n=n.replace(/^[ \t]+$/gm,""),n=c(n),n=n.replace(/(^|\n)/g,"$1 "),n=n.replace(/(\s*
        [^\r]+?<\/pre>)/gm,function(e,t){var n=t;return n=n.replace(/^  /mg,"~0"),n=n.replace(/~0/g,""),n}),T("
        \n"+n+"\n
        ")}),e}function A(e,t){e=e.replace(/^\n+/g,""),e=e.replace(/\n+$/g,"");var n=e.split(/\n{2,}/g),r=[],i=/~K(\d+)K/,o=n.length;for(var u=0;u"),a+="

        ",r.push(a))}if(!t){o=r.length;for(var u=0;u#+-.!])/g,q),e}function _(e,t,n,r){if(t)return e;if(r.charAt(r.length-1)!==")")return"<"+n+r+">";var i=r.match(/[()]/g),s=0;for(var o=0;o"+u}function D(t){t=t.replace(/(="|<)?\b(https?|ftp)(:\/\/[-A-Z0-9+&@#\/%?=~_|\[\]\(\)!:,\.;]*[-A-Z0-9+&@#\/%=~_|\[\])])(?=$|\W)/gi,_);var n=function(t,n){return'
        '+e.plainLinkText(n)+""};return t=t.replace(/<((https?|ftp):[^'">\s]+)>/gi,n),t}function P(e){return e=e.replace(/~E(\d+)E/g,function(e,t){var n=parseInt(t);return String.fromCharCode(n)}),e}function H(e){return e=e.replace(/^(\t|[ ]{1,4})/gm,"~0"),e=e.replace(/~0/g,""),e}function B(e){if(!/\t/.test(e))return e;var t=[" "," "," "," "],n=0,r;return e.replace(/[\n\t]/g,function(e,i){return e==="\n"?(n=i+1,e):(r=(i-n)%4,n=i+1,t[r])})}function F(e){if(!e)return"";var t=e.length;return e.replace(j,function(n,r){if(n=="~D")return"%24";if(n==":")if(r==t-1||/[0-9\/]/.test(e.charAt(r+1)))return":";return"%"+n.charCodeAt(0).toString(16)})}function I(e,t,n){var r="(["+t.replace(/([\[\]\\])/g,"\\$1")+"])";n&&(r="\\\\"+r);var i=new RegExp(r,"g");return e=e.replace(i,q),e}function q(e,t){var n=t.charCodeAt(0);return"~E"+n+"E"}var e=this.hooks=new n;e.addNoop("plainLinkText"),e.addNoop("preConversion"),e.addNoop("postNormalization"),e.addNoop("preBlockGamut"),e.addNoop("postBlockGamut"),e.addNoop("preSpanGamut"),e.addNoop("postSpanGamut"),e.addNoop("postConversion");var t,i,s,o;this.makeHtml=function(n){if(t)throw new Error("Recursive call to converter.makeHtml");return t=new r,i=new r,s=[],o=0,n=e.preConversion(n),n=n.replace(/~/g,"~T"),n=n.replace(/\$/g,"~D"),n=n.replace(/\r\n/g,"\n"),n=n.replace(/\r/g,"\n"),n="\n\n"+n+"\n\n",n=B(n),n=n.replace(/^[ \t]+$/mg,""),n=e.postNormalization(n),n=a(n),n=u(n),n=c(n),n=P(n),n=n.replace(/~D/g,"$$"),n=n.replace(/~T/g,"~"),n=e.postConversion(n),s=i=t=null,n};var l=function(e){return c(e)},E={ol:"\\d+[.]",ul:"[*+-]"},j=/(?:["'*()[\]:]|~D)/g}}(),define("Markdown.Converter",function(){}),function(){function n(e){return e.replace(/<[^>]*>?/gi,o)}function o(e){return e.match(r)||e.match(i)||e.match(s)?e:""}function u(e){if(e=="")return"";var t=/<\/?\w+[^>]*(\s|$|>)/g,n=e.toLowerCase().match(t),r=(n||[]).length;if(r==0)return e;var i,s,o="



      • ",u,a=[],f=[],l=!1;for(var c=0;c")>-1)continue;s=n[c],u=-1;if(!/^<\//.test(s))for(var h=c+1;h"){u=h;break}u==-1?l=f[c]=!0:a[u]=!0}if(!l)return e;var c=0;return e=e.replace(t,function(e){var t=f[c]?"":e;return c++,t}),e}var e,t;typeof exports=="object"&&typeof require=="function"?(e=exports,t=require("./Markdown.Converter").Converter):(e=window.Markdown,t=e.Converter),e.getSanitizingConverter=function(){var e=new t;return e.hooks.chain("postConversion",n),e.hooks.chain("postConversion",u),e};var r=/^(<\/?(b|blockquote|code|del|dd|dl|dt|em|h1|h2|h3|i|kbd|li|ol|p|pre|s|sup|sub|strong|strike|ul)>|<(br|hr)\s?\/?>)$/i,i=/^(]+")?\s?>|<\/a>)$/i,s=/^(]*")?(\stitle="[^"<>]*")?\s?\/?>)$/i}(),define("Markdown.Sanitizer",function(){}),function(){function c(){}function h(e){this.buttonBar=r.getElementById("wmd-button-bar"+e),this.preview=r.getElementById("wmd-preview"+e),this.input=r.getElementById("wmd-input"+e)}function p(t,n){var r=this,i=[],s=0,o="none",a,f,l,c=function(e,t){o!=e&&(o=e,t||p()),!u.isIE||o!="moving"?f=setTimeout(h,1):l=null},h=function(e){l=new d(n,e),f=undefined};this.setCommandMode=function(){o="command",p(),f=setTimeout(h,0)},this.canUndo=function(){return s>1},this.canRedo=function(){return i[s+1]?!0:!1},this.undo=function(){r.canUndo()&&(a?(a.restore(),a=null):(i[s]=new d(n),i[--s].restore(),t&&t())),o="none",n.input.focus(),h()},this.redo=function(){r.canRedo()&&(i[++s].restore(),t&&t()),o="none",n.input.focus(),h()};var p=function(){var e=l||new d(n);if(!e)return!1;if(o=="moving"){a||(a=e);return}a&&(i[s-1].text!=a.text&&(i[s++]=a),a=null),i[s++]=e,i[s+1]=null,t&&t()},v=function(e){var t=!1;if((e.ctrlKey||e.metaKey)&&!e.altKey){var n=e.charCode||e.keyCode,i=String.fromCharCode(n);switch(i.toLowerCase()){case"y":r.redo(),t=!0;break;case"z":e.shiftKey?r.redo():r.undo(),t=!0}}if(t){e.preventDefault&&e.preventDefault(),window.event&&(window.event.returnValue=!1);return}},m=function(e){if(!e.ctrlKey&&!e.metaKey){var t=e.keyCode;t>=33&&t<=40||t>=63232&&t<=63235?c("moving"):t==8||t==46||t==127?c("deleting"):t==13?c("newlines"):t==27?c("escape"):(t<16||t>20)&&t!=91&&c("typing")}},g=function(){e.addEvent(n.input,"keypress",function(e){(e.ctrlKey||e.metaKey)&&!e.altKey&&(e.keyCode==89||e.keyCode==90)&&e.preventDefault()});var t=function(){(u.isIE||l&&l.text!=n.input.value)&&f==undefined&&(o="paste",p(),h())};e.addEvent(n.input,"keydown",v),e.addEvent(n.input,"keydown",m),e.addEvent(n.input,"mousedown",function(){c("moving")}),n.input.onpaste=t,n.input.ondrop=t},y=function(){g(),h(!0),p()};y()}function d(t,n){var i=this,s=t.input;this.init=function(){if(!e.isVisible(s))return;if(!n&&r.activeElement&&r.activeElement!==s)return;this.setInputAreaSelectionStartEnd(),this.scrollTop=s.scrollTop;if(!this.text&&s.selectionStart||s.selectionStart===0)this.text=s.value},this.setInputAreaSelection=function(){if(!e.isVisible(s))return;if(s.selectionStart!==undefined&&!u.isOpera)s.focus(),s.selectionStart=i.start,s.selectionEnd=i.end,s.scrollTop=i.scrollTop;else if(r.selection){if(r.activeElement&&r.activeElement!==s)return;s.focus();var t=s.createTextRange();t.moveStart("character",-s.value.length),t.moveEnd("character",-s.value.length),t.moveEnd("character",i.end),t.moveStart("character",i.start),t.select()}},this.setInputAreaSelectionStartEnd=function(){if(!t.ieCachedRange&&(s.selectionStart||s.selectionStart===0))i.start=s.selectionStart,i.end=s.selectionEnd;else if(r.selection){i.text=e.fixEolChars(s.value);var n=t.ieCachedRange||r.selection.createRange(),o=e.fixEolChars(n.text),u="",a=u+o+u;n.text=a;var f=e.fixEolChars(s.value);n.moveStart("character",-a.length),n.text=o,i.start=f.indexOf(u),i.end=f.lastIndexOf(u)-u.length;var l=i.text.length-e.fixEolChars(s.value).length;if(l){n.moveStart("character",-o.length);while(l--)o+="\n",i.end+=1;n.text=o}t.ieCachedRange&&(i.scrollTop=t.ieCachedScrollTop),t.ieCachedRange=null,this.setInputAreaSelection()}},this.restore=function(){i.text!=undefined&&i.text!=s.value&&(s.value=i.text),this.setInputAreaSelection(),s.scrollTop=i.scrollTop},this.getChunks=function(){var t=new c;return t.before=e.fixEolChars(i.text.substring(0,i.start)),t.startTag="",t.selection=e.fixEolChars(i.text.substring(i.start,i.end)),t.endTag="",t.after=e.fixEolChars(i.text.substring(i.end)),t.scrollTop=i.scrollTop,t},this.setChunks=function(e){e.before=e.before+e.startTag,e.after=e.endTag+e.after,this.start=e.before.length,this.end=e.before.length+e.selection.length,this.text=e.before+e.selection+e.after,this.scrollTop=e.scrollTop},this.init()}function v(n,i,s){var o=this,a,f,l,c=3e3,h="delayed",p=function(t,n){e.addEvent(t,"input",n),t.onpaste=n,t.ondrop=n,e.addEvent(t,"keypress",n),e.addEvent(t,"keydown",n)},d=function(){var e=0;return window.innerHeight?e=window.pageYOffset:r.documentElement&&r.documentElement.scrollTop?e=r.documentElement.scrollTop:r.body&&(e=r.body.scrollTop),e},v=function(){if(!i.preview)return;var e=i.input.value;if(e!==undefined&&e==l)return;l=e;var t=(new Date).getTime();e=n.makeHtml(e);var r=(new Date).getTime();f=r-t,T(e)},m=function(){a&&(clearTimeout(a),a=undefined);if(h!=="manual"){var e=0;h==="delayed"&&(e=f),e>c&&(e=c),a=setTimeout(v,e)}},g=function(e){return e.scrollHeight<=e.clientHeight?1:e.scrollTop/(e.scrollHeight-e.clientHeight)},y=function(){i.preview&&(i.preview.scrollTop=(i.preview.scrollHeight-i.preview.clientHeight)*g(i.preview))};this.refresh=function(e){e?(l="",v()):m()},this.processingTime=function(){return f};var b=!0,w=function(e){var t=i.preview,n=t.parentNode,r=t.nextSibling;n.removeChild(t),t.innerHTML=e,r?n.insertBefore(t,r):n.appendChild(t)},E=function(e){i.preview.innerHTML=e},S,x=function(e){if(S)return S(e);try{E(e),S=E}catch(t){S=w,S(e)}},T=function(e){var n=t.getTop(i.input)-d();i.preview&&(x(e),s()),y();if(b){b=!1;return}var r=t.getTop(i.input)-d();u.isIE?setTimeout(function(){window.scrollBy(0,r-n)},0):window.scrollBy(0,r-n)},N=function(){p(i.input,m),v(),i.preview&&(i.preview.scrollTop=0)};N()}function m(t,n,i,o,a,f,l){function v(e){c.focus();if(e.textOp){i&&i.setCommandMode();var t=new d(n);if(!t)return;var r=t.getChunks(),s=function(){c.focus(),r&&t.setChunks(r),t.restore(),o.refresh()},u=e.textOp(r,s);u||s()}e.execute&&e.execute(i)}function m(e,t){var i="0px",s="-20px",o="-40px",a=e.getElementsByTagName("span")[0];t?(a.style.backgroundPosition=e.XShift+" "+i,e.onmouseover=function(){a.style.backgroundPosition=this.XShift+" "+o},e.onmouseout=function(){a.style.backgroundPosition=this.XShift+" "+i},u.isIE&&(e.onmousedown=function(){if(r.activeElement&&r.activeElement!==n.input)return;n.ieCachedRange=document.selection.createRange(),n.ieCachedScrollTop=n.input.scrollTop}),e.isHelp||(e.onclick=function(){return this.onmouseout&&this.onmouseout(),v(this),!1}),e.className=e.className.replace(/ disabled/g,"")):(a.style.backgroundPosition=e.XShift+" "+s,e.onmouseover=e.onmouseout=e.onclick=function(){},e.className+=" disabled")}function g(e){return typeof e=="string"&&(e=a[e]),function(){e.apply(a,arguments)}}function y(){var e=n.buttonBar,r="0px",i="-20px",o="-40px",u=document.createElement("ul");u.id="wmd-button-row"+t,u.className="wmd-button-row",u=e.appendChild(u);var a=0,c=function(e,n,r,i){var s=document.createElement("li");s.className="wmd-button",s.style.left=a+"px",a+=25;var o=document.createElement("span");return s.id=e+t,s.appendChild(o),s.title=n,s.XShift=r,i&&(s.textOp=i),m(s,!0),u.appendChild(s),s},p=function(e){var n=document.createElement("li");n.className="wmd-spacer wmd-spacer"+e,n.id="wmd-spacer"+e+t,u.appendChild(n),a+=25};h.bold=c("wmd-bold-button",l("bold"),"0px",g("doBold")),h.italic=c("wmd-italic-button",l("italic"),"-20px",g("doItalic")),p(1),h.link=c("wmd-link-button",l("link"),"-40px",g(function(e,t){return this.doLinkOrImage(e,t,!1)})),h.quote=c("wmd-quote-button",l("quote"),"-60px",g("doBlockquote")),h.code=c("wmd-code-button",l("code"),"-80px",g("doCode")),h.image=c("wmd-image-button",l("image"),"-100px",g(function(e,t){return this.doLinkOrImage(e,t,!0)})),p(2),h.olist=c("wmd-olist-button",l("olist"),"-120px",g(function(e,t){this.doList(e,t,!0)})),h.ulist=c("wmd-ulist-button",l("ulist"),"-140px",g(function(e,t){this.doList(e,t,!1)})),h.heading=c("wmd-heading-button",l("heading"),"-160px",g("doHeading")),h.hr=c("wmd-hr-button",l("hr"),"-180px",g("doHorizontalRule")),p(3),h.undo=c("wmd-undo-button",l("undo"),"-200px",null),h.undo.execute=function(e){e&&e.undo()};var d=/win/.test(s.platform.toLowerCase())?l("redo"):l("redomac");h.redo=c("wmd-redo-button",d,"-220px",null),h.redo.execute=function(e){e&&e.redo()};if(f){var v=document.createElement("li"),y=document.createElement("span");v.appendChild(y),v.className="wmd-button wmd-help-button",v.id="wmd-help-button"+t,v.XShift="-240px",v.isHelp=!0,v.style.right="0px",v.title=l("help"),v.onclick=f.handler,m(v,!0),u.appendChild(v),h.help=v}b()}function b(){i&&(m(h.undo,i.canUndo()),m(h.redo,i.canRedo()))}var c=n.input,h={};y();var p="keydown";u.isOpera&&(p="keypress"),e.addEvent(c,p,function(e){if((e.ctrlKey||e.metaKey)&&!e.altKey&&!e.shiftKey){var t=e.charCode||e.keyCode,n=String.fromCharCode(t).toLowerCase();switch(n){case"b":v(h.bold);break;case"i":v(h.italic);break;case"l":v(h.link);break;case"q":v(h.quote);break;case"k":v(h.code);break;case"g":v(h.image);break;case"o":v(h.olist);break;case"u":v(h.ulist);break;case"h":v(h.heading);break;case"r":v(h.hr);break;case"y":v(h.redo);break;case"z":e.shiftKey?v(h.redo):v(h.undo);break;default:return}e.preventDefault&&e.preventDefault(),window.event&&(window.event.returnValue=!1)}}),e.addEvent(c,"keyup",function(e){if(e.shiftKey&&!e.ctrlKey&&!e.metaKey){var t=e.charCode||e.keyCode;if(t===13){var n={};n.textOp=g("doAutoindent"),v(n)}}}),u.isIE&&e.addEvent(c,"keydown",function(e){var t=e.keyCode;if(t===27)return!1}),this.setUndoRedoButtonStates=b}function g(e,t){this.hooks=e,this.getString=t}function b(e){return e.replace(/^\s*(.*?)(?:\s+"(.+)")?\s*$/,function(e,t,n){return t=t.replace(/\?.*$/,function(e){return e.replace(/\+/g," ")}),t=decodeURIComponent(t),t=encodeURI(t).replace(/'/g,"%27").replace(/\(/g,"%28").replace(/\)/g,"%29"),t=t.replace(/\?.*$/,function(e){return e.replace(/\+/g,"%2b")}),n&&(n=n.trim?n.trim():n.replace(/^\s*/,"").replace(/\s*$/,""),n=n.replace(/"/g,"quot;").replace(/\(/g,"(").replace(/\)/g,")").replace(//g,">")),n?t+' "'+n+'"':t})}var e={},t={},n={},r=window.document,i=window.RegExp,s=window.navigator,o={lineLength:72},u={isIE:/msie/.test(s.userAgent.toLowerCase()),isIE_5or6:/msie 6/.test(s.userAgent.toLowerCase())||/msie 5/.test(s.userAgent.toLowerCase()),isOpera:/opera/.test(s.userAgent.toLowerCase())},a={bold:"Strong Ctrl+B",boldexample:"strong text",italic:"Emphasis Ctrl+I",italicexample:"emphasized text",link:"Hyperlink Ctrl+L",linkdescription:"enter link description here",linkdialog:'

        Insert Hyperlink

        http://example.com/ "optional title"

        ',quote:"Blockquote
        Ctrl+Q",quoteexample:"Blockquote",code:"Code Sample
         Ctrl+K",codeexample:"enter code here",image:"Image  Ctrl+G",imagedescription:"enter image description here",imagedialog:"

        Insert Image

        http://example.com/images/diagram.jpg \"optional title\"

        Need
        free image hosting?

        ",olist:"Numbered List
          Ctrl+O",ulist:"Bulleted List
            Ctrl+U",litem:"List item",heading:"Heading

            /

            Ctrl+H",headingexample:"Heading",hr:"Horizontal Rule
            Ctrl+R",undo:"Undo - Ctrl+Z",redo:"Redo - Ctrl+Y",redomac:"Redo - Ctrl+Shift+Z",help:"Markdown Editing Help"},f="http://",l="http://";Markdown.Editor=function(e,t,n){n=n||{},typeof n.handler=="function"&&(n={helpButton:n}),n.strings=n.strings||{},n.helpButton&&(n.strings.help=n.strings.help||n.helpButton.title);var i=function(e){return n.strings[e]||a[e]};t=t||"";var s=this.hooks=new Markdown.HookCollection;s.addNoop("onPreviewRefresh"),s.addNoop("postBlockquoteCreation"),s.addFalse("insertImageDialog"),s.addFalse("insertLinkDialog"),this.getConverter=function(){return e};var o=this,u;this.run=function(){if(u)return;u=new h(t);var a=new g(s,i),f=new v(e,u,function(){s.onPreviewRefresh()}),l,c;/\?noundo/.test(r.location.href)||(l=new p(function(){f.refresh(),c&&c.setUndoRedoButtonStates()},u),this.textOperation=function(e){l.setCommandMode(),e(),o.refreshPreview()}),c=new m(t,u,l,f,a,n.helpButton,i),c.setUndoRedoButtonStates();var d=o.refreshPreview=function(){f.refresh(!0)};d()}},c.prototype.findTags=function(t,n){var r=this,i;t&&(i=e.extendRegExp(t,"","$"),this.before=this.before.replace(i,function(e){return r.startTag=r.startTag+e,""}),i=e.extendRegExp(t,"^",""),this.selection=this.selection.replace(i,function(e){return r.startTag=r.startTag+e,""})),n&&(i=e.extendRegExp(n,"","$"),this.selection=this.selection.replace(i,function(e){return r.endTag=e+r.endTag,""}),i=e.extendRegExp(n,"^",""),this.after=this.after.replace(i,function(e){return r.endTag=e+r.endTag,""}))},c.prototype.trimWhitespace=function(e){var t,n,r=this;e?t=n="":(t=function(e){return r.before+=e,""},n=function(e){return r.after=e+r.after,""}),this.selection=this.selection.replace(/^(\s*)/,t).replace(/(\s*)$/,n)},c.prototype.skipLines=function(e,t,n){e===undefined&&(e=1),t===undefined&&(t=1),e++,t++;var r,s;navigator.userAgent.match(/Chrome/)&&"X".match(/()./),this.selection=this.selection.replace(/(^\n*)/,""),this.startTag=this.startTag+i.$1,this.selection=this.selection.replace(/(\n*$)/,""),this.endTag=this.endTag+i.$1,this.startTag=this.startTag.replace(/(^\n*)/,""),this.before=this.before+i.$1,this.endTag=this.endTag.replace(/(\n*$)/,""),this.after=this.after+i.$1;if(this.before){r=s="";while(e--)r+="\\n?",s+="\n";n&&(r="\\n*"),this.before=this.before.replace(new i(r+"$",""),s)}if(this.after){r=s="";while(t--)r+="\\n?",s+="\n";n&&(r="\\n*"),this.after=this.after.replace(new i(r,""),s)}},e.isVisible=function(e){if(window.getComputedStyle)return window.getComputedStyle(e,null).getPropertyValue("display")!=="none";if(e.currentStyle)return e.currentStyle.display!=="none"},e.addEvent=function(e,t,n){e.attachEvent?e.attachEvent("on"+t,n):e.addEventListener(t,n,!1)},e.removeEvent=function(e,t,n){e.detachEvent?e.detachEvent("on"+t,n):e.removeEventListener(t,n,!1)},e.fixEolChars=function(e){return e=e.replace(/\r\n/g,"\n"),e=e.replace(/\r/g,"\n"),e},e.extendRegExp=function(e,t,n){if(t===null||t===undefined)t="";if(n===null||n===undefined)n="";var r=e.toString(),s;return r=r.replace(/\/([gim]*)$/,function(e,t){return s=t,""}),r=r.replace(/(^\/|\/$)/g,""),r=t+r+n,new i(r,s)},t.getTop=function(e,t){var n=e.offsetTop;if(!t)while(e=e.offsetParent)n+=e.offsetTop;return n},t.getHeight=function(e){return e.offsetHeight||e.scrollHeight},t.getWidth=function(e){return e.offsetWidth||e.scrollWidth},t.getPageSize=function(){var e,t,n,i;self.innerHeight&&self.scrollMaxY?(e=r.body.scrollWidth,t=self.innerHeight+self.scrollMaxY):r.body.scrollHeight>r.body.offsetHeight?(e=r.body.scrollWidth,t=r.body.scrollHeight):(e=r.body.offsetWidth,t=r.body.offsetHeight),self.innerHeight?(n=self.innerWidth,i=self.innerHeight):r.documentElement&&r.documentElement.clientHeight?(n=r.documentElement.clientWidth,i=r.documentElement.clientHeight):r.body&&(n=r.body.clientWidth,i=r.body.clientHeight);var s=Math.max(e,n),o=Math.max(t,i);return[s,o,n,i]},n.createBackground=function(){var e=r.createElement("div"),n=e.style;e.className="wmd-prompt-background",n.position="absolute",n.top="0",n.zIndex="1000",u.isIE?n.filter="alpha(opacity=50)":n.opacity="0.5";var i=t.getPageSize();return n.height=i[1]+"px",u.isIE?(n.left=r.documentElement.scrollLeft,n.width=r.documentElement.clientWidth):(n.left="0",n.width="100%"),r.body.appendChild(e),e},n.prompt=function(n,i,s){var o,a;i===undefined&&(i="");var f=function(e){var t=e.charCode||e.keyCode;t===27&&l(!0)},l=function(t){e.removeEvent(r.body,"keydown",f);var n=a.value;return t?n=null:(n=n.replace(/^http:\/\/(https?|ftp):\/\//,"$1://"),/^(?:https?|ftp):\/\//.test(n)||(n="http://"+n)),o.parentNode.removeChild(o),s(n),!1},c=function(){o=r.createElement("div"),o.className="wmd-prompt-dialog",o.style.padding="10px;",o.style.position="fixed",o.style.width="400px",o.style.zIndex="1001";var s=r.createElement("div");s.innerHTML=n,s.style.padding="5px",o.appendChild(s);var c=r.createElement("form"),h=c.style;c.onsubmit=function(){return l(!1)},h.padding="0",h.margin="0",h.cssFloat="left",h.width="100%",h.textAlign="center",h.position="relative",o.appendChild(c),a=r.createElement("input"),a.type="text",a.value=i,h=a.style,h.display="block",h.width="80%",h.marginLeft=h.marginRight="auto",c.appendChild(a);var p=r.createElement("input");p.type="button",p.onclick=function(){return l(!1)},p.value="OK",h=p.style,h.margin="10px",h.display="inline",h.width="7em";var d=r.createElement("input");d.type="button",d.onclick=function(){return l(!0)},d.value="Cancel",h=d.style,h.margin="10px",h.display="inline",h.width="7em",c.appendChild(p),c.appendChild(d),e.addEvent(r.body,"keydown",f),o.style.top="50%",o.style.left="50%",o.style.display="block",u.isIE_5or6&&(o.style.position="absolute",o.style.top=r.documentElement.scrollTop+200+"px",o.style.left="50%"),r.body.appendChild(o),o.style.marginTop=-(t.getHeight(o)/2)+"px",o.style.marginLeft=-(t.getWidth(o)/2)+"px"};setTimeout(function(){c();var e=i.length;if(a.selectionStart!==undefined)a.selectionStart=0,a.selectionEnd=e;else if(a.createTextRange){var t=a.createTextRange();t.collapse(!1),t.moveStart("character",-e),t.moveEnd("character",e),t.select()}a.focus()},0)};var y=g.prototype;y.prefixes="(?:\\s{4,}|\\s*>|\\s*-\\s+|\\s*\\d+\\.|=|\\+|-|_|\\*|#|\\s*\\[[^\n]]+\\]:)",y.unwrap=function(e){var t=new i("([^\\n])\\n(?!(\\n|"+this.prefixes+"))","g");e.selection=e.selection.replace(t,"$1 $2")},y.wrap=function(e,t){this.unwrap(e);var n=new i("(.{1,"+t+"})( +|$\\n?)","gm"),r=this;e.selection=e.selection.replace(n,function(e,t){return(new i("^"+r.prefixes,"")).test(e)?e:t+"\n"}),e.selection=e.selection.replace(/\s+$/,"")},y.doBold=function(e,t){return this.doBorI(e,t,2,this.getString("boldexample"))},y.doItalic=function(e,t){return this.doBorI(e,t,1,this.getString("italicexample"))},y.doBorI=function(e,t,n,r){e.trimWhitespace(),e.selection=e.selection.replace(/\n{2,}/g,"\n");var s=/(\**$)/.exec(e.before)[0],o=/(^\**)/.exec(e.after)[0],u=Math.min(s.length,o.length);if(u>=n&&(u!=2||n!=1))e.before=e.before.replace(i("[*]{"+n+"}$",""),""),e.after=e.after.replace(i("^[*]{"+n+"}",""),"");else if(!e.selection&&o){e.after=e.after.replace(/^([*_]*)/,""),e.before=e.before.replace(/(\s?)$/,"");var a=i.$1;e.before=e.before+o+a}else{!e.selection&&!o&&(e.selection=r);var f=n<=1?"*":"**";e.before=e.before+f,e.after=f+e.after}return},y.stripLinkDefs=function(e,t){return e=e.replace(/^[ ]{0,3}\[(\d+)\]:[ \t]*\n?[ \t]*?[ \t]*\n?[ \t]*(?:(\n*)["(](.+?)[")][ \t]*)?(?:\n+|$)/gm,function(e,n,r,i,s){return t[n]=e.replace(/\s*$/,""),i?(t[n]=e.replace(/["(](.+?)[")]$/,""),i+s):""}),e},y.addLinkDef=function(e,t){var n=0,r={};e.before=this.stripLinkDefs(e.before,r),e.selection=this.stripLinkDefs(e.selection,r),e.after=this.stripLinkDefs(e.after,r);var i="",s=/(\[)((?:\[[^\]]*\]|[^\[\]])*)(\][ ]?(?:\n[ ]*)?\[)(\d+)(\])/g,o=function(e){n++,e=e.replace(/^[ ]{0,3}\[(\d+)\]:/," ["+n+"]:"),i+="\n"+e},u=function(e,t,i,a,f,l){return i=i.replace(s,u),r[f]?(o(r[f]),t+i+a+n+l):e};e.before=e.before.replace(s,u),t?o(t):e.selection=e.selection.replace(s,u);var a=n;return e.after=e.after.replace(s,u),e.after&&(e.after=e.after.replace(/\n*$/,"")),e.after||(e.selection=e.selection.replace(/\n*$/,"")),e.after+="\n\n"+i,a},y.doLinkOrImage=function(e,t,r){e.trimWhitespace(),e.findTags(/\s*!?\[/,/\][ ]?(?:\n[ ]*)?(\[.*?\])?/);var i;if(!(e.endTag.length>1&&e.startTag.length>0)){e.selection=e.startTag+e.selection+e.endTag,e.startTag=e.endTag="";if(/\n\n/.test(e.selection)){this.addLinkDef(e,null);return}var s=this,o=function(n){i.parentNode.removeChild(i);if(n!==null){e.selection=(" "+e.selection).replace(/([^\\](?:\\\\)*)(?=[[\]])/g,"$1\\").substr(1);var o=" [999]: "+b(n),u=s.addLinkDef(e,o);e.startTag=r?"![":"[",e.endTag="]["+u+"]",e.selection||(r?e.selection=s.getString("imagedescription"):e.selection=s.getString("linkdescription"))}t()};return i=n.createBackground(),r?this.hooks.insertImageDialog(o)||n.prompt(this.getString("imagedialog"),f,o):this.hooks.insertLinkDialog(o)||n.prompt(this.getString("linkdialog"),l,o),!0}e.startTag=e.startTag.replace(/!?\[/,""),e.endTag="",this.addLinkDef(e,null)},y.doAutoindent=function(e,t){var n=this,r=!1;e.before=e.before.replace(/(\n|^)[ ]{0,3}([*+-]|\d+[.])[ \t]*\n$/,"\n\n"),e.before=e.before.replace(/(\n|^)[ ]{0,3}>[ \t]*\n$/,"\n\n"),e.before=e.before.replace(/(\n|^)[ \t]+\n$/,"\n\n"),!e.selection&&!/^[ \t]*(?:\n|$)/.test(e.after)&&(e.after=e.after.replace(/^[^\n]*/,function(t){return e.selection=t,""}),r=!0),/(\n|^)[ ]{0,3}([*+-]|\d+[.])[ \t]+.*\n$/.test(e.before)&&n.doList&&n.doList(e),/(\n|^)[ ]{0,3}>[ \t]+.*\n$/.test(e.before)&&n.doBlockquote&&n.doBlockquote(e),/(\n|^)(\t|[ ]{4,}).*\n$/.test(e.before)&&n.doCode&&n.doCode(e),r&&(e.after=e.selection+e.after,e.selection="")},y.doBlockquote=function(e,t){e.selection=e.selection.replace(/^(\n*)([^\r]+?)(\n*)$/,function(t,n,r,i){return e.before+=n,e.after=i+e.after,r}),e.before=e.before.replace(/(>[ \t]*)$/,function(t,n){return e.selection=n+e.selection,""}),e.selection=e.selection.replace(/^(\s|>)+$/,""),e.selection=e.selection||this.getString("quoteexample");var n="",r="",i;if(e.before){var s=e.before.replace(/\n$/,"").split("\n"),u=!1;for(var a=0;a0,/^>/.test(i)?(f=!0,!u&&i.length>1&&(u=!0)):/^[ \t]*$/.test(i)?f=!0:f=u,f?n+=i+"\n":(r+=n+i,n="\n")}/(^|\n)>/.test(n)||(r+=n,n="")}e.startTag=n,e.before=r,e.after&&(e.after=e.after.replace(/^\n?/,"\n")),e.after=e.after.replace(/^(((\n|^)(\n[ \t]*)*>(.+\n)*.*)+(\n[ \t]*)*)/,function(t){return e.endTag=t,""});var l=function(t){var n=t?"> ":"";e.startTag&&(e.startTag=e.startTag.replace(/\n((>|\s)*)\n$/,function(e,t){return"\n"+t.replace(/^[ ]{0,3}>?[ \t]*$/gm,n)+"\n"})),e.endTag&&(e.endTag=e.endTag.replace(/^\n((>|\s)*)\n/,function(e,t){return"\n"+t.replace(/^[ ]{0,3}>?[ \t]*$/gm,n)+"\n"}))};/^(?![ ]{0,3}>)/m.test(e.selection)?(this.wrap(e,o.lineLength-2),e.selection=e.selection.replace(/^/gm,"> "),l(!0),e.skipLines()):(e.selection=e.selection.replace(/^[ ]{0,3}> ?/gm,""),this.unwrap(e),l(!1),!/^(\n|^)[ ]{0,3}>/.test(e.selection)&&e.startTag&&(e.startTag=e.startTag.replace(/\n{0,2}$/,"\n\n")),!/(\n|^)[ ]{0,3}>.*$/.test(e.selection)&&e.endTag&&(e.endTag=e.endTag.replace(/^\n{0,2}/,"\n\n"))),e.selection=this.hooks.postBlockquoteCreation(e.selection),/\n/.test(e.selection)||(e.selection=e.selection.replace(/^(> *)/,function(t,n){return e.startTag+=n,""}))},y.doCode=function(e,t){var n=/\S[ ]*$/.test(e.before),r=/^[ ]*\S/.test(e.after);if(!r&&!n||/\n/.test(e.selection)){e.before=e.before.replace(/[ ]{4}$/,function(t){return e.selection=t+e.selection,""});var i=1,s=1;/(\n|^)(\t|[ ]{4,}).*\n$/.test(e.before)&&(i=0),/^\n(\t|[ ]{4,})/.test(e.after)&&(s=0),e.skipLines(i,s),e.selection?/^[ ]{0,3}\S/m.test(e.selection)?/\n/.test(e.selection)?e.selection=e.selection.replace(/^/gm," "):e.before+=" ":e.selection=e.selection.replace(/^(?:[ ]{4}|[ ]{0,3}\t)/gm,""):(e.startTag=" ",e.selection=this.getString("codeexample"))}else e.trimWhitespace(),e.findTags(/`/,/`/),!e.startTag&&!e.endTag?(e.startTag=e.endTag="`",e.selection||(e.selection=this.getString("codeexample"))):e.endTag&&!e.startTag?(e.before+=e.endTag,e.endTag=""):e.startTag=e.endTag=""},y.doList=function(e,t,n){var r=/(\n|^)(([ ]{0,3}([*+-]|\d+[.])[ \t]+.*)(\n.+|\n{2,}([*+-].*|\d+[.])[ \t]+.*|\n{2,}[ \t]+\S.*)*)\n*$/,s=/^\n*(([ ]{0,3}([*+-]|\d+[.])[ \t]+.*)(\n.+|\n{2,}([*+-].*|\d+[.])[ \t]+.*|\n{2,}[ \t]+\S.*)*)\n*/,u="-",a=1,f=function(){var e;return n?(e=" "+a+". ",a++):e=" "+u+" ",e},l=function(e){return n===undefined&&(n=/^\s*\d/.test(e)),e=e.replace(/^[ ]{0,3}([*+-]|\d+[.])\s/gm,function(e){return f()}),e};e.findTags(/(\n|^)*[ ]{0,3}([*+-]|\d+[.])\s+/,null),e.before&&!/\n$/.test(e.before)&&!/^\n/.test(e.startTag)&&(e.before+=e.startTag,e.startTag="");if(e.startTag){var c=/\d+[.]/.test(e.startTag);e.startTag="",e.selection=e.selection.replace(/\n[ ]{4}/g,"\n"),this.unwrap(e),e.skipLines(),c&&(e.after=e.after.replace(s,l));if(n==c)return}var h=1;e.before=e.before.replace(r,function(e){return/^\s*([*+-])/.test(e)&&(u=i.$1),h=/[^\n]\n\n[^\n]/.test(e)?1:0,l(e)}),e.selection||(e.selection=this.getString("litem"));var p=f(),d=1;e.after=e.after.replace(s,function(e){return d=/[^\n]\n\n[^\n]/.test(e)?1:0,l(e)}),e.trimWhitespace(!0),e.skipLines(h,d,!0),e.startTag=p;var v=p.replace(/./g," ");this.wrap(e,o.lineLength-v.length),e.selection=e.selection.replace(/\n/g,"\n"+v)},y.doHeading=function(e,t){e.selection=e.selection.replace(/\s+/g," "),e.selection=e.selection.replace(/(^\s+|\s+$)/g,"");if(!e.selection){e.startTag="## ",e.selection=this.getString("headingexample"),e.endTag=" ##";return}var n=0;e.findTags(/#+[ ]*/,/[ ]*#+/),/#+/.test(e.startTag)&&(n=i.lastMatch.length),e.startTag=e.endTag="",e.findTags(null,/\s?(-+|=+)/),/=+/.test(e.endTag)&&(n=1),/-+/.test(e.endTag)&&(n=2),e.startTag=e.endTag="",e.skipLines(1,1);var r=n==0?2:n-1;if(r>0){var s=r>=2?"-":"=",u=e.selection.length;u>o.lineLength&&(u=o.lineLength),e.endTag="\n";while(u--)e.endTag+=s}},y.doHorizontalRule=function(e,t){e.startTag="----------\n",e.selection="",e.skipLines(2,1,!0)}}(),define("Markdown.Editor",function(){});var 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",DEFAULT_FILE_TITLE="Title",GDRIVE_DEFAULT_FILE_TITLE="New Markdown document",CHECK_ONLINE_PERIOD=6e4,AJAX_TIMEOUT=1e4,ASYNC_TASK_DEFAULT_TIMEOUT=3e4,AUTH_POPUP_TIMEOUT=9e4,SYNC_PERIOD=18e4,USER_IDLE_THRESHOLD=3e5,SYNC_PROVIDER_GDRIVE="sync.gdrive.",SYNC_PROVIDER_DROPBOX="sync.dropbox.",PROVIDER_TYPE_PUBLISH_FLAG=1,PROVIDER_GITHUB="github",PROVIDER_BLOGGER="blogger",delayedFunction=undefined,BASE_URL="http://localhost/",GOOGLE_KEY="AIzaSyAeCU8CGcSkn0z9js6iocHuPBX4f_mMWkw",GOOGLE_CLIENT_ID="241271498917-lev37kef013q85avc91am1gccg5g8lrb.apps.googleusercontent.com",GITHUB_CLIENT_ID="e47fef6055344579799d",GATEKEEPER_URL="http://stackedit-gatekeeper-localhost.herokuapp.com/";location.hostname.indexOf("benweet.github.io")===0&&(BASE_URL="http://benweet.github.io/stackedit/",GOOGLE_KEY="AIzaSyB1Bc1wI_YUWkkOR-5Gri5BFuypgZl0Sxc",GOOGLE_CLIENT_ID="241271498917-jpto9lls9fqnem1e4h6ppds9uob8rpvu.apps.googleusercontent.com",GITHUB_CLIENT_ID="fa0d09514da8377ee32e",GATEKEEPER_URL="http://stackedit-gatekeeper.herokuapp.com/"),define("config",function(){}),define("core",["jquery","file-manager","google-helper","dropbox-helper","github-helper","synchronizer","publisher","async-runner","bootstrap","jgrowl","layout","Markdown.Editor","config","underscore"],function(e,t,n,r,i,s,o,u){function l(){a.currentTime=(new Date).getTime()}function v(){c=!0,h=!0,d=a.currentTime}function m(){return h===!0&&a.currentTime-d>USER_IDLE_THRESHOLD&&(h=!1),h&&p}function y(e,t){e.stop(!0,!0).addClass("error").delay(400).switchClass("error"),t!==undefined&&t.stopPropagation()}function E(){a.isOffline===!0&&navigator.onLine===!0&&b+CHECK_ONLINE_PERIODr?(y(e,t),undefined):i)},a.resetModalInputs=function(){e(".modal input[type=text]:not([disabled])").val("")},a.showWorkingIndicator=function(t){t===!1?(e(".working-indicator").addClass("hide"),e("body").removeClass("working")):(e(".working-indicator").removeClass("hide"),e("body").addClass("working"))},a.showMessage=function(t,n,r){r=r||{},n=n||"icon-info-sign",e.jGrowl(" "+_.escape(t),r)},a.showError=function(e){a.showMessage(e,"icon-warning-sign")},a.isOffline=!1;var b=a.currentTime,w=[];a.setOffline=function(){b=a.currentTime;if(a.isOffline===!1){a.isOffline=!0,a.showMessage("You are offline.","icon-exclamation-sign msg-offline",{sticky:!0,close:function(){a.showMessage("You are back online!","icon-signal")}});for(var e=0;e\n","\n","\n","<%= documentTitle %>\n","\n","<%= documentHTML %>\n",""].join("")},a.loadSettings=function(){localStorage.settings&&e.extend(a.settings,JSON.parse(localStorage.settings)),e("input:radio[name=radio-layout-orientation][value="+a.settings.layoutOrientation+"]").prop("checked",!0),e("#input-settings-editor-font-size").val(a.settings.editorFontSize),e("#input-settings-publish-commit-msg").val(a.settings.commitMsg),e("#textarea-settings-publish-template").val(a.settings.template)},a.saveSettings=function(t){var n={};n.layoutOrientation=e("input:radio[name=radio-layout-orientation]:checked").prop("value"),n.editorFontSize=a.getInputIntValue(e("#input-settings-editor-font-size"),t,1,99),n.commitMsg=a.getInputValue(e("#input-settings-publish-commit-msg"),t),n.template=a.getInputValue(e("#textarea-settings-publish-template"),t),t.isPropagationStopped()||(a.settings=n,localStorage.settings=JSON.stringify(n))},a.createLayout=function(){var t=undefined,n={closable:!0,resizable:!1,slidable:!1,livePaneResizing:!0,enableCursorHotkey:!1,spacing_open:15,spacing_closed:15,togglerLength_open:90,togglerLength_closed:90,stateManagement__enabled:!1};a.settings.layoutOrientation=="horizontal"?(e(".ui-layout-south").remove(),e(".ui-layout-east").addClass("well").prop("id","wmd-preview"),t=e("body").layout(e.extend(n,{east__resizable:!0,east__size:.5,east__minSize:200}))):a.settings.layoutOrientation=="vertical"&&(e(".ui-layout-east").remove(),e(".ui-layout-south").addClass("well").prop("id","wmd-preview"),t=e("body").layout(e.extend(n,{south__resizable:!0,south__size:.5,south__minSize:200}))),e(".ui-layout-toggler-north").addClass("btn").append(e("").addClass("caret")),e(".ui-layout-toggler-south").addClass("btn").append(e("").addClass("caret")),e(".ui-layout-toggler-east").addClass("btn").append(e("").addClass("caret")),e("#navbar").click(function(){t.allowOverflow("north")})};var S=undefined;a.createEditor=function(t){e("#wmd-button-bar").empty();var n=Markdown.getSanitizingConverter(),r=!0;n.hooks.chain("preConversion",function(e){return r||t(),e});var i=new Markdown.Editor(n);i.hooks.set("insertLinkDialog",function(t){return S=t,a.resetModalInputs(),e("#modal-insert-link").modal(),!0}),i.hooks.set("insertImageDialog",function(t){return S=t,a.resetModalInputs(),e("#modal-insert-image").modal(),!0}),i.run(),r=!1,e(".wmd-button-row").addClass("btn-group").find("li:not(.wmd-spacer)").addClass("btn").css("left",0).find("span").hide(),e("#wmd-bold-button").append(e("").addClass("icon-bold")),e("#wmd-italic-button").append(e("").addClass("icon-italic")),e("#wmd-link-button").append(e("").addClass("icon-globe")),e("#wmd-quote-button").append(e("").addClass("icon-indent-left")),e("#wmd-code-button").append(e("").addClass("icon-code")),e("#wmd-image-button").append(e("").addClass("icon-picture")),e("#wmd-olist-button").append(e("").addClass("icon-numbered-list")),e("#wmd-ulist-button").append(e("").addClass("icon-list")),e("#wmd-heading-button").append(e("").addClass("icon-text-height")),e("#wmd-hr-button").append(e("").addClass("icon-hr")),e("#wmd-undo-button").append(e("").addClass("icon-undo")),e("#wmd-redo-button").append(e("").addClass("icon-share-alt"))},a.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 x=[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 a.crc32=function(e){var t=0,n=-1;for(var r=0;r>>8^x[t];return n^=-1,n<0&&(n=4294967295+n+1),n.toString(16)},a.randomString=function(){return _.random(4294967296).toString(36)},a.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)},a.init=function(){T(),N(),e.jGrowl.defaults.life=5e3,e.jGrowl.defaults.closer=!1,e.jGrowl.defaults.closeTemplate="",e.jGrowl.defaults.position="bottom-right",e(window).on("offline",a.setOffline),e(window).on("online",a.setOnline),navigator.onLine===!1&&a.setOffline(),e(document).mousemove(v).keypress(v),e(".dropdown-submenu > a").click(function(e){e.stopPropagation()}),e(".action-insert-link").click(function(t){var n=a.getInputValue(e("#input-insert-link"),t);n!==undefined&&S(n)}),e(".action-insert-image").click(function(t){var n=a.getInputValue(e("#input-insert-image"),t);n!==undefined&&S(n)}),e(".action-close-insert-link").click(function(e){S(null)}),e("#menu-bar, .ui-layout-center, .ui-layout-east, .ui-layout-south").removeClass("hide"),a.loadSettings(),a.createLayout(),e("#wmd-input").css({"font-size":a.settings.editorFontSize+"px","line-height":Math.round(a.settings.editorFontSize*(20/14))+"px"}),e(".action-load-settings").click(function(){a.loadSettings()}),e(".action-apply-settings").click(function(e){a.saveSettings(e),e.isPropagationStopped()||window.location.reload()}),e(".action-reset-input").click(function(){a.resetModalInputs()}),u.init(a),n.init(a,t),r.init(a,t),i.init(a,t),s.init(a,t),o.init(a,t),w.push(s.updateSyncButton),w.push(o.updatePublishButton),t.init(a),f=window.setInterval(function(){l(),a.checkWindowUnique();if(m()===!1)return;s.sync(),u.runTask(),E()},1e3)},a}),requirejs.config({waitSeconds:0,shim:{"jquery-ui":["jquery"],bootstrap:["jquery"],jgrowl:["jquery"],layout:["jquery-ui"],"Markdown.Sanitizer":["Markdown.Converter"],"Markdown.Editor":["Markdown.Sanitizer"]}}),require(["jquery","core"],function(e,t){e(function(){if(window.applicationCache&&window.applicationCache.status===window.applicationCache.UPDATEREADY){window.applicationCache.swapCache(),window.location.reload();return}t.init()})}),define("main",function(){}); \ No newline at end of file diff --git a/js/publisher.js b/js/publisher.js index 83338c2e..96dd66fd 100644 --- a/js/publisher.js +++ b/js/publisher.js @@ -41,28 +41,34 @@ define(["jquery", "github-provider", "underscore"], function($) { }; // Apply template to the current document - publisher.applyTemplate = function() { + publisher.applyTemplate = function(publishAttributes) { var fileIndex = fileManager.getCurrentFileIndex(); - return _.template(core.settings.template, { - documentTitle: localStorage[fileIndex + ".title"], - documentMarkdown: $("#wmd-input").val(), - documentHTML: $("#wmd-preview").html() - }); + try { + return _.template(core.settings.template, { + documentTitle: localStorage[fileIndex + ".title"], + documentMarkdown: $("#wmd-input").val(), + documentHTML: $("#wmd-preview").html(), + publishAttributes: publishAttributes + }); + } catch(e) { + core.showError(e); + throw e; + } }; // Used to get content to publish - function getPublishContent(publishObject) { - if(publishObject.format === undefined) { - publishObject.format = $("input:radio[name=radio-publish-format]:checked").prop("value"); + function getPublishContent(publishAttributes) { + if(publishAttributes.format === undefined) { + publishAttributes.format = $("input:radio[name=radio-publish-format]:checked").prop("value"); } - if(publishObject.format == "markdown") { + if(publishAttributes.format == "markdown") { return $("#wmd-input").val(); } - else if(publishObject.format == "html") { + else if(publishAttributes.format == "html") { return $("#wmd-preview").html(); } else { - return publisher.applyTemplate(); + return publisher.applyTemplate(publishAttributes); } } @@ -79,12 +85,12 @@ define(["jquery", "github-provider", "underscore"], function($) { // Dequeue a synchronized location var publishIndex = publishIndexList.pop(); - var publishObject = JSON.parse(localStorage[publishIndex]); - var content = getPublishContent(publishObject); + var publishAttributes = JSON.parse(localStorage[publishIndex]); + var content = getPublishContent(publishAttributes); // Call the provider - var provider = providerMap[publishObject.provider]; - provider.publish(publishObject, publishTitle, content, function(error) { + var provider = providerMap[publishAttributes.provider]; + provider.publish(publishAttributes, publishTitle, content, function(error) { publishLocation(callback, errorFlag); }); } @@ -105,30 +111,30 @@ define(["jquery", "github-provider", "underscore"], function($) { publishRunning = false; publisher.updatePublishButton(); if(errorFlag === undefined) { - core.showMessage('"' + title + '" successfully published.'); + core.showMessage('"' + publishTitle + '" successfully published.'); } }); }; - // Generate a publishIndex associated to a fileIndex and store a publishObject - function createPublishIndex(fileIndex, publishObject) { + // Generate a publishIndex associated to a fileIndex and store publishAttributes + function createPublishIndex(fileIndex, publishAttributes) { var publishIndex = undefined; do { publishIndex = "publish." + core.randomString(); } while(_.has(localStorage, publishIndex)); - localStorage[publishIndex] = JSON.stringify(publishObject); + localStorage[publishIndex] = JSON.stringify(publishAttributes); localStorage[fileIndex + ".publish"] += publishIndex + ";"; } // Add a new publish location to a local document - publisher.newLocation = function(publishObject) { + publisher.newLocation = function(publishAttributes) { var fileIndex = fileManager.getCurrentFileIndex(); var title = localStorage[fileIndex + ".title"]; - var content = getPublishContent(publishObject); - var provider = providerMap[publishObject.provider]; - provider.publish(publishObject, title, content, function(error) { + var content = getPublishContent(publishAttributes); + var provider = providerMap[publishAttributes.provider]; + provider.publish(publishAttributes, title, content, function(error) { if(error === undefined) { - createPublishIndex(fileIndex, publishObject); + createPublishIndex(fileIndex, publishAttributes); publisher.notifyPublish(); core.showMessage('"' + title + '" will now be published on GitHub.'); @@ -155,10 +161,10 @@ define(["jquery", "github-provider", "underscore"], function($) { } _.each(publishIndexList, function(publishIndex) { var serializedObject = localStorage[publishIndex]; - var publishObject = JSON.parse(serializedObject); - var publishDesc = JSON.stringify(_.omit(publishObject, 'provider')).replace(/{|}|"/g, ""); + var publishAttributes = JSON.parse(serializedObject); + var publishDesc = JSON.stringify(_.omit(publishAttributes, 'provider')).replace(/{|}|"/g, ""); lineElement = $(_.template(lineTemplate, { - provider: providerMap[publishObject.provider], + provider: providerMap[publishAttributes.provider], publishDesc: publishDesc })); lineElement.append($(removeButtonTemplate).click(function() { @@ -184,9 +190,30 @@ define(["jquery", "github-provider", "underscore"], function($) { }); $(".tooltip-template").tooltip({ - title: ['Variables:\n', - 'documentTitle: the document title' - ].join("") + html: true, + container: '#modal-settings', + placement: 'right', + trigger: 'manual', + title: ['Available variables:
            ', + '
            • documentTitle: document title
            • ', + '
            • documentMarkdown: document in Markdown format
            • ', + '
            • documentHTML: document in HTML format
            • ', + '
            • publishAttributes: attributes of the publish location (undefined when using "Save")
            ', + 'Examples:
            ', + _.escape('<%= documentTitle %>'), + '
            ', + _.escape('
            <%- documentHTML %>
            '), + '
            ', + _.escape('<% if(publishAttributes.provider == "github") print(documentMarkdown); %>'), + '

            More info', + ].join("") + }).click(function(e) { + $(this).tooltip('show'); + e.stopPropagation(); + }); + + $(document).click(function(e) { + $(".tooltip-template").tooltip('hide'); }); }; diff --git a/test.html b/test.html deleted file mode 100644 index 9a03cd20..00000000 --- a/test.html +++ /dev/null @@ -1,58 +0,0 @@ - - - -README.md - -

            StackEdit

            - -

            StackEdit is a free, open-source Markdown editor based on PageDown, the Markdown library used by Stack Overflow and the other Stack Exchange sites.

            - -

            StackEdit can:

            - -
              -
            • Manage multiple Markdown documents locally
            • -
            • Export your documents in Markdown or HTML format
            • -
            • Synchronize your Markdown documents in the Cloud
            • -
            • Edit existing Markdown documents from Google Drive and Dropbox
            • -
            • Publish your document on GitHub in one click
            • -
            - -

            Features:

            - -
              -
            • Real-time HTML preview
            • -
            • WYSIWYG control buttons
            • -
            • Configurable layout
            • -
            • Offline editing
            • -
            • Online synchronization using Google Drive and Dropbox
            • -
            • Publish on GitHub
            • -
            - -
            -

            NOTE: This page has been written with StackEdit.

            -
            StackEdit -========= - -StackEdit is a free, open-source Markdown editor based on PageDown, the Markdown library used by Stack Overflow and the other Stack Exchange sites. - -### StackEdit can: - - - Manage multiple Markdown documents locally - - Export your documents in Markdown or HTML format - - Synchronize your Markdown documents in the Cloud - - Edit existing Markdown documents from Google Drive and Dropbox - - Publish your document on GitHub in one click - -### Features: - - - Real-time HTML preview - - WYSIWYG control buttons - - Configurable layout - - Offline editing - - Online synchronization using Google Drive and Dropbox - - Publish on GitHub - -> **NOTE:** This page has been written with [StackEdit][1]. - - [1]: http://benweet.github.io/stackedit/ "StackEdit" - \ No newline at end of file