/*! * jQuery JavaScript Library v1.9.1 * http://jquery.com/ * * Includes Sizzle.js * http://sizzlejs.com/ * * Copyright 2005, 2012 jQuery Foundation, Inc. and other contributors * Released under the MIT license * http://jquery.org/license * * Date: 2013-2-4 */ /*! * Sizzle CSS Selector Engine * Copyright 2012 jQuery Foundation and other contributors * Released under the MIT license * http://sizzlejs.com/ */ /* =================================================== * bootstrap-transition.js v2.3.2 * http://twitter.github.com/bootstrap/javascript.html#transitions * =================================================== * Copyright 2012 Twitter, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ========================================================== */ /* ========================================================== * bootstrap-alert.js v2.3.2 * http://twitter.github.com/bootstrap/javascript.html#alerts * ========================================================== * Copyright 2012 Twitter, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ========================================================== */ /* ============================================================ * bootstrap-button.js v2.3.2 * http://twitter.github.com/bootstrap/javascript.html#buttons * ============================================================ * Copyright 2012 Twitter, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================ */ /* ========================================================== * bootstrap-carousel.js v2.3.2 * http://twitter.github.com/bootstrap/javascript.html#carousel * ========================================================== * Copyright 2012 Twitter, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ========================================================== */ /* ============================================================= * bootstrap-collapse.js v2.3.2 * http://twitter.github.com/bootstrap/javascript.html#collapse * ============================================================= * Copyright 2012 Twitter, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================ */ /* ============================================================ * bootstrap-dropdown.js v2.3.2 * http://twitter.github.com/bootstrap/javascript.html#dropdowns * ============================================================ * Copyright 2012 Twitter, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================ */ /* ========================================================= * bootstrap-modal.js v2.3.2 * http://twitter.github.com/bootstrap/javascript.html#modals * ========================================================= * Copyright 2012 Twitter, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ========================================================= */ /* =========================================================== * bootstrap-tooltip.js v2.3.2 * http://twitter.github.com/bootstrap/javascript.html#tooltips * Inspired by the original jQuery.tipsy by Jason Frame * =========================================================== * Copyright 2012 Twitter, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ========================================================== */ /* =========================================================== * bootstrap-popover.js v2.3.2 * http://twitter.github.com/bootstrap/javascript.html#popovers * =========================================================== * Copyright 2012 Twitter, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * =========================================================== */ /* ============================================================= * bootstrap-scrollspy.js v2.3.2 * http://twitter.github.com/bootstrap/javascript.html#scrollspy * ============================================================= * Copyright 2012 Twitter, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================== */ /* ======================================================== * bootstrap-tab.js v2.3.2 * http://twitter.github.com/bootstrap/javascript.html#tabs * ======================================================== * Copyright 2012 Twitter, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ======================================================== */ /* ============================================================= * bootstrap-typeahead.js v2.3.2 * http://twitter.github.com/bootstrap/javascript.html#typeahead * ============================================================= * Copyright 2012 Twitter, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================ */ /* ========================================================== * bootstrap-affix.js v2.3.2 * http://twitter.github.com/bootstrap/javascript.html#affix * ========================================================== * Copyright 2012 Twitter, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ========================================================== */ /** * jGrowl 1.2.11 * * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses. * * Written by Stan Lemon * Last updated: 2013.02.14 * * jGrowl is a jQuery plugin implementing unobtrusive userland notifications. These * notifications function similarly to the Growl Framework available for * Mac OS X (http://growl.info). * * To Do: * - Move library settings to containers and allow them to be changed per container * * Changes in 1.2.11 * - Fix artifacts left behind by the shutdown method and text-cleanup * * Changes in 1.2.10 * - Fix beforeClose to be called in click event * * Changes in 1.2.9 * - Fixed BC break in jQuery 2.0 beta * * Changes in 1.2.8 * - Fixes for jQuery 1.9 and the MSIE6 check, note that with jQuery 2.0 support * jGrowl intends to drop support for IE6 altogether * * Changes in 1.2.6 * - Fixed js error when a notification is opening and closing at the same time * * Changes in 1.2.5 * - Changed wrapper jGrowl's options usage to "o" instead of $.jGrowl.defaults * - Added themeState option to control 'highlight' or 'error' for jQuery UI * - Ammended some CSS to provide default positioning for nested usage. * - Changed some CSS to be prefixed with jGrowl- to prevent namespacing issues * - Added two new options - openDuration and closeDuration to allow * better control of notification open and close speeds, respectively * Patch contributed by Jesse Vincet. * - Added afterOpen callback. Patch contributed by Russel Branca. * * Changes in 1.2.4 * - Fixed IE bug with the close-all button * - Fixed IE bug with the filter CSS attribute (special thanks to gotwic) * - Update IE opacity CSS * - Changed font sizes to use "em", and only set the base style * * Changes in 1.2.3 * - The callbacks no longer use the container as context, instead they use the actual notification * - The callbacks now receive the container as a parameter after the options parameter * - beforeOpen and beforeClose now check the return value, if it's false - the notification does * not continue. The open callback will also halt execution if it returns false. * - Fixed bug where containers would get confused * - Expanded the pause functionality to pause an entire container. * * Changes in 1.2.2 * - Notification can now be theme rolled for jQuery UI, special thanks to Jeff Chan! * * Changes in 1.2.1 * - Fixed instance where the interval would fire the close method multiple times. * - Added CSS to hide from print media * - Fixed issue with closer button when div { position: relative } is set * - Fixed leaking issue with multiple containers. Special thanks to Matthew Hanlon! * * Changes in 1.2.0 * - Added message pooling to limit the number of messages appearing at a given time. * - Closing a notification is now bound to the notification object and triggered by the close button. * * Changes in 1.1.2 * - Added iPhone styled example * - Fixed possible IE7 bug when determining if the ie6 class shoudl be applied. * - Added template for the close button, so that it's content could be customized. * * Changes in 1.1.1 * - Fixed CSS styling bug for ie6 caused by a mispelling * - Changes height restriction on default notifications to min-height * - Added skinned examples using a variety of images * - Added the ability to customize the content of the [close all] box * - Added jTweet, an example of using jGrowl + Twitter * * Changes in 1.1.0 * - Multiple container and instances. * - Standard $.jGrowl() now wraps $.fn.jGrowl() by first establishing a generic jGrowl container. * - Instance methods of a jGrowl container can be called by $.fn.jGrowl(methodName) * - Added glue preferenced, which allows notifications to be inserted before or after nodes in the container * - Added new log callback which is called before anything is done for the notification * - Corner's attribute are now applied on an individual notification basis. * * Changes in 1.0.4 * - Various CSS fixes so that jGrowl renders correctly in IE6. * * Changes in 1.0.3 * - Fixed bug with options persisting across notifications * - Fixed theme application bug * - Simplified some selectors and manipulations. * - Added beforeOpen and beforeClose callbacks * - Reorganized some lines of code to be more readable * - Removed unnecessary this.defaults context * - If corners plugin is present, it's now customizable. * - Customizable open animation. * - Customizable close animation. * - Customizable animation easing. * - Added customizable positioning (top-left, top-right, bottom-left, bottom-right, center) * * Changes in 1.0.2 * - All CSS styling is now external. * - Added a theme parameter which specifies a secondary class for styling, such * that notifications can be customized in appearance on a per message basis. * - Notification life span is now customizable on a per message basis. * - Added the ability to disable the global closer, enabled by default. * - Added callbacks for when a notification is opened or closed. * - Added callback for the global closer. * - Customizable animation speed. * - jGrowl now set itself up and tears itself down. * * Changes in 1.0.1: * - Removed dependency on metadata plugin in favor of .data() * - Namespaced all events */ /*! jQuery UI - v1.9.2 - 2013-03-26 * http://jqueryui.com * Includes: jquery.ui.core.js, jquery.ui.widget.js, jquery.ui.mouse.js, jquery.ui.position.js, jquery.ui.draggable.js, jquery.ui.effect.js, jquery.ui.effect-slide.js * Copyright 2013 jQuery Foundation and other contributors Licensed MIT */ /*! * jQuery Color Animations v2.0.0 * http://jquery.com/ * * Copyright 2012 jQuery Foundation and other contributors * Released under the MIT license. * http://jquery.org/license * * Date: Mon Aug 13 13:41:02 2012 -0500 */ /** * @preserve * jquery.layout 1.3.0 - Release Candidate 30.79 * $Date: 2013-01-12 08:00:00 (Sat, 12 Jan 2013) $ * $Rev: 303007 $ * * Copyright (c) 2013 Kevin Dalman (http://allpro.net) * Based on work by Fabrizio Balliano (http://www.fabrizioballiano.net) * * Dual licensed under the GPL (http://www.gnu.org/licenses/gpl.html) * and MIT (http://www.opensource.org/licenses/mit-license.php) licenses. * * SEE: http://layout.jquery-dev.net/LICENSE.txt * * Changelog: http://layout.jquery-dev.net/changelog.cfm#1.3.0.rc30.79 * * Docs: http://layout.jquery-dev.net/documentation.html * Tips: http://layout.jquery-dev.net/tips.html * Help: http://groups.google.com/group/jquery-ui-layout */ /** * jquery.layout.state 1.0 * $Date: 2011-07-16 08:00:00 (Sat, 16 July 2011) $ * * Copyright (c) 2012 * Kevin Dalman (http://allpro.net) * * Dual licensed under the GPL (http://www.gnu.org/licenses/gpl.html) * and MIT (http://www.opensource.org/licenses/mit-license.php) licenses. * * @requires: UI Layout 1.3.0.rc30.1 or higher * @requires: $.ui.cookie (above) * * @see: http://groups.google.com/group/jquery-ui-layout */ /** * jquery.layout.buttons 1.0 * $Date: 2011-07-16 08:00:00 (Sat, 16 July 2011) $ * * Copyright (c) 2012 * Kevin Dalman (http://allpro.net) * * Dual licensed under the GPL (http://www.gnu.org/licenses/gpl.html) * and MIT (http://www.opensource.org/licenses/mit-license.php) licenses. * * @requires: UI Layout 1.3.0.rc30.1 or higher * * @see: http://groups.google.com/group/jquery-ui-layout * * Docs: [ to come ] * Tips: [ to come ] */ /** * jquery.layout.browserZoom 1.0 * $Date: 2011-12-29 08:00:00 (Thu, 29 Dec 2011) $ * * Copyright (c) 2012 * Kevin Dalman (http://allpro.net) * * Dual licensed under the GPL (http://www.gnu.org/licenses/gpl.html) * and MIT (http://www.opensource.org/licenses/mit-license.php) licenses. * * @requires: UI Layout 1.3.0.rc30.1 or higher * * @see: http://groups.google.com/group/jquery-ui-layout * * TODO: Extend logic to handle other problematic zooming in browsers * TODO: Add hotkey/mousewheel bindings to _instantly_ respond to these zoom event */ // Copyright (C) 2006 Google Inc. // http://www.apache.org/licenses/LICENSE-2.0 // > (c) 2009-2013 Jeremy Ashkenas, DocumentCloud Inc. // > Underscore may be freely distributed under the MIT license. /*! @source http://purl.eligrey.com/github/FileSaver.js/blob/master/FileSaver.js */ /* CSS Browser Selector 0.6.1 Originally written by Rafael Lima (http://rafael.adm.br) http://rafael.adm.br/css_browser_selector License: http://creativecommons.org/licenses/by/2.5/ Co-maintained by: https://github.com/verbatim/css_browser_selector */ /** * @license RequireJS text 2.0.6 Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved. * Available via the MIT or new BSD license. * see: http://github.com/requirejs/text for details */ function runDelayedFunction(){delayedFunction!==undefined&&delayedFunction()}function log(e){window.console&&showLog&&console.log(e)}function css_browser_selector(e){function w(){var e=window.outerWidth||y.clientWidth,i=window.outerHeight||y.clientHeight;t.orientation=e=0;s--)if(e>=n[s]){t.maxw=n[s];break}widthClasses="";for(var o in t)widthClasses+=" "+o+"_"+t[o];return y.className=y.className+widthClasses,widthClasses}var t={},n=[320,480,640,768,1024,1152,1280,1440,1680,1920,2560],r=n.length,i=e.toLowerCase(),s=function(e){return RegExp(e,"i").test(i)},o=function(e,t){t=t.replace(".","_");var n=t.indexOf("_"),r="";while(n>0)r+=" "+e+t.substring(0,n),n=t.indexOf("_",n+1);return r+=" "+e+t,r},u="gecko",a="webkit",f="chrome",l="firefox",c="safari",h="opera",p="mobile",d="android",v="blackberry",m="lang_",g="device_",y=document.documentElement,b=[!/opera|webtv/i.test(i)&&/msie\s(\d+)/.test(i)?"ie ie"+(/trident\/4\.0/.test(i)?"8":RegExp.$1):s("firefox/")?u+" "+l+(/firefox\/((\d+)(\.(\d+))(\.\d+)*)/.test(i)?" "+l+RegExp.$2+" "+l+RegExp.$2+"_"+RegExp.$4:""):s("gecko/")?u:s("opera")?h+(/version\/((\d+)(\.(\d+))(\.\d+)*)/.test(i)?" "+h+RegExp.$2+" "+h+RegExp.$2+"_"+RegExp.$4:/opera(\s|\/)(\d+)\.(\d+)/.test(i)?" "+h+RegExp.$2+" "+h+RegExp.$2+"_"+RegExp.$3:""):s("konqueror")?"konqueror":s("blackberry")?v+(/Version\/(\d+)(\.(\d+)+)/i.test(i)?" "+v+RegExp.$1+" "+v+RegExp.$1+RegExp.$2.replace(".","_"):/Blackberry ?(([0-9]+)([a-z]?))[\/|;]/gi.test(i)?" "+v+RegExp.$2+(RegExp.$3?" "+v+RegExp.$2+RegExp.$3:""):""):s("android")?d+(/Version\/(\d+)(\.(\d+))+/i.test(i)?" "+d+RegExp.$1+" "+d+RegExp.$1+RegExp.$2.replace(".","_"):"")+(/Android (.+); (.+) Build/i.test(i)?" "+g+RegExp.$2.replace(/ /g,"_").replace(/-/g,"_"):""):s("chrome")?a+" "+f+(/chrome\/((\d+)(\.(\d+))(\.\d+)*)/.test(i)?" "+f+RegExp.$2+(RegExp.$4>0?" "+f+RegExp.$2+"_"+RegExp.$4:""):""):s("iron")?a+" iron":s("applewebkit/")?a+" "+c+(/version\/((\d+)(\.(\d+))(\.\d+)*)/.test(i)?" "+c+RegExp.$2+" "+c+RegExp.$2+RegExp.$3.replace(".","_"):/ Safari\/(\d+)/i.test(i)?RegExp.$1=="419"||RegExp.$1=="417"||RegExp.$1=="416"||RegExp.$1=="412"?" "+c+"2_0":RegExp.$1=="312"?" "+c+"1_3":RegExp.$1=="125"?" "+c+"1_2":RegExp.$1=="85"?" "+c+"1_0":"":""):s("mozilla/")?u:"",s("android|mobi|mobile|j2me|iphone|ipod|ipad|blackberry|playbook|kindle|silk")?p:"",s("j2me")?"j2me":s("ipad|ipod|iphone")?(/CPU( iPhone)? OS (\d+[_|\.]\d+([_|\.]\d+)*)/i.test(i)?"ios"+o("ios",RegExp.$2):"")+" "+(/(ip(ad|od|hone))/gi.test(i)?RegExp.$1:""):s("playbook")?"playbook":s("kindle|silk")?"kindle":s("playbook")?"playbook":s("mac")?"mac"+(/mac os x ((\d+)[.|_](\d+))/.test(i)?" mac"+RegExp.$2+" mac"+RegExp.$1.replace(".","_"):""):s("win")?"win"+(s("windows nt 6.2")?" win8":s("windows nt 6.1")?" win7":s("windows nt 6.0")?" vista":s("windows nt 5.2")||s("windows nt 5.1")?" win_xp":s("windows nt 5.0")?" win_2k":s("windows nt 4.0")||s("WinNT4.0")?" win_nt":""):s("freebsd")?"freebsd":s("x11|linux")?"linux":"",/[; |\[](([a-z]{2})(\-[a-z]{2})?)[)|;|\]]/i.test(i)?(m+RegExp.$2).replace("-","_")+(RegExp.$3!=""?(" "+m+RegExp.$1).replace("-","_"):""):"",s("ipad|iphone|ipod")&&!s("safari")?"ipad_app":""];window.onresize=w,w();var E=b.join(" ")+" js ";return y.className=(E+y.className.replace(/\b(no[-|_]?)?js\b/g,"")).replace(/^ /,"").replace(/ +/g," "),E}(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("mathjax-editing",["MathJax"],function(){function h(e,t){var n=i.slice(e,t+1).join("").replace(/&/g,"&").replace(//g,">");l.Browser.isMSIE&&(n=n.replace(/(%[^\n]*)\n/g,"$1
\n"));while(t>e)i[t]="",t--;i[e]="@@"+f.length+"@@",f.push(n),s=o=u=null}function p(e){s=o=u=null,f=[],i=e.replace(/\r\n?/g,"\n").split(c);for(var t=1,n=i.length;tthis.$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(!0)),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(".dropdown-backdrop").remove(),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||("ontouchstart"in document.documentElement&&e('
\n","\n"].join("");for(a=0;a",v,"\n"].join("")}d+="\n\n";var m=s.split("\n");for(a=0;a\n";for(b=0;b",w,"\n"].join("")}d+="\n"}return d+="
\n",n.hashExtraBlock(d)}var n=this,r=new RegExp(["^","[ ]{0,3}","[|]","(.+)\\n","[ ]{0,3}","[|]([ ]*[-:]+[-| :]*)\\n","(","(?:[ ]*[|].*\\n?)*",")","(?:\\n|$)"].join(""),"gm"),i=new RegExp(["^","[ ]{0,3}","(\\S.*[|].*)\\n","[ ]{0,3}","([-:]+[ ]*[|][-| :]*)\\n","(","(?:.*[|].*\\n?)*",")","(?:\\n|$)"].join(""),"gm");return e=e.replace(r,s),e=e.replace(i,s),e},Markdown.Extra.prototype.fencedCodeBlocks=function(e){function t(e){return e=e.replace(/&/g,"&"),e=e.replace(//g,">"),e}var n=this;return e=e.replace(/(?:^|\n)```(.*)\n([\s\S]*?)\n```/g,function(e,r,i){var s=r,o=i,u=n.googleCodePrettify?' class="prettyprint"':"",a="";s&&(n.googleCodePrettify||n.highlightJs?a=' class="language-'+s+'"':a=' class="'+s+'"');var f=["",t(o),""].join("");return n.hashExtraBlock(f)}),e},Markdown.Extra.prototype.definitionLists=function(e){var n=new RegExp(["(\\x02\\n?|\\n\\n)","(?:","(","(","[ ]{0,3}","((?:[ \\t]*\\S.*\\n)+)","\\n?","[ ]{0,3}:[ ]+",")","([\\s\\S]+?)","(","(?=\\0x03)","|","(?=","\\n{2,}","(?=\\S)","(?!","[ ]{0,3}","(?:\\S.*\\n)+?","\\n?","[ ]{0,3}:[ ]+",")","(?!","[ ]{0,3}:[ ]+",")",")",")",")",")"].join(""),"gm"),r=this;return e=u(e),e=e.replace(n,function(e,n,i){var s=t(r.processDefListItems(i));return s="
\n"+s+"\n
",n+r.hashExtraBlock(s)+"\n\n"}),a(e)},Markdown.Extra.prototype.processDefListItems=function(e){var i=this,s=new RegExp(["(\\x02\\n?|\\n\\n+)","(","[ ]{0,3}","(?![:][ ]|[ ])","(?:\\S.*\\n)+?",")","(?=\\n?[ ]{0,3}:[ ])"].join(""),"gm"),o=new RegExp(["\\n(\\n+)?","(","[ ]{0,3}","[:][ ]+",")","([\\s\\S]+?)","(?=\\n*","(?:","\\n[ ]{0,3}[:][ ]|","
|\\x03",")",")"].join(""),"gm");return e=u(e),e=e.replace(/\n{2,}(?=\\x03)/,"\n"),e=e.replace(s,function(e,n,r){var s=t(r).split("\n"),o="";for(var u=0;u"+a+"
"}return o+"\n"}),e=e.replace(o,function(e,t,s,o){return t||o.match(/\n{2,}/)?(o=Array(s.length+1).join(" ")+o,o=r(o)+"\n\n",o="\n"+l(o,i.converter)+"\n"):(o=n(o),o=f(r(o),i.converter)),"\n
"+o+"
\n"}),a(e)}}(),define("Markdown.Extra",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,o){var a=this,f,l,c,h=3e3,p="delayed",d=function(t,n){e.addEvent(t,"input",n),t.onpaste=n,t.ondrop=n,e.addEvent(t,"keypress",n),e.addEvent(t,"keydown",n)},v=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},m=function(){if(!i.preview)return;var e=i.input.value;if(e!==undefined&&e==c)return;c=e;var t=(new Date).getTime();e=n.makeHtml(e);var r=(new Date).getTime();l=r-t,N(e)};o!==undefined&&(m=o(m));var g=function(){f&&(clearTimeout(f),f=undefined);if(p!=="manual"){var e=0;p==="delayed"&&(e=l),e>h&&(e=h),f=setTimeout(m,e)}},y=function(e){return e.scrollHeight<=e.clientHeight?1:e.scrollTop/(e.scrollHeight-e.clientHeight)},b=function(){i.preview&&(i.preview.scrollTop=(i.preview.scrollHeight-i.preview.clientHeight)*y(i.preview))};this.refresh=function(e){e?(c="",m()):g()},this.processingTime=function(){return l};var w=!0,E=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)},S=function(e){i.preview.innerHTML=e},x,T=function(e){if(x)return x(e);try{S(e),x=S}catch(t){x=E,x(e)}},N=function(e){var n=t.getTop(i.input)-v();i.preview&&(T(e),s()),b();if(w){w=!1;return}var r=t.getTop(i.input)-v();u.isIE?setTimeout(function(){window.scrollBy(0,r-n)},0):window.scrollBy(0,r-n)},C=function(){d(i.input,g),m(),i.preview&&(i.preview.scrollTop=0)};C()}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(a){if(u)return;u=new h(t);var f=new g(s,i),l=new v(e,u,function(){s.onPreviewRefresh()},a),c,d;/\?noundo/.test(r.location.href)||(c=new p(function(){l.refresh(),d&&d.setUndoRedoButtonStates()},u),this.textOperation=function(e){c.setCommandMode(),e(),o.refreshPreview()}),d=new m(t,u,c,l,f,n.helpButton,i),d.setUndoRedoButtonStates();var y=o.refreshPreview=function(){l.refresh(!0)};y()}},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(){}),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("storage",["underscore"],function(){localStorage["file.list"]===undefined&&(localStorage["file.list"]=";");var e=_.compact(localStorage["file.list"].split(";")),t=localStorage.version;t===undefined&&(localStorage.removeItem("sync.queue"),localStorage.removeItem("sync.current"),localStorage.removeItem("file.counter"),_.each(e,function(e){localStorage[e+".publish"]=";";var t=_.compact(localStorage[e+".sync"].split(";"));_.each(t,function(e){localStorage[e+".contentCRC"]="0",localStorage[e+".etag"]!==undefined&&(localStorage[e+".titleCRC"]="0")})}),t="v1");if(t=="v1"){var n=localStorage["sync.gdrive.lastChangeId"];n&&(localStorage["gdrive.lastChangeId"]=n,localStorage.removeItem("sync.gdrive.lastChangeId"));var r=localStorage["sync.dropbox.lastChangeId"];r&&(localStorage["dropbox.lastChangeId"]=r,localStorage.removeItem("sync.dropbox.lastChangeId"));var i="gdrive",s="dropbox",o="sync."+i+".",u="sync."+s+".";_.each(e,function(e){var t=_.compact(localStorage[e+".sync"].split(";"));_.each(t,function(e){var t={};e.indexOf(o)===0?(t.provider=i,t.id=e.substring(o.length),t.etag=localStorage[e+".etag"],t.contentCRC=localStorage[e+".contentCRC"],t.titleCRC=localStorage[e+".titleCRC"]):e.indexOf(u)===0&&(t.provider=s,t.path=decodeURIComponent(e.substring(u.length)),t.version=localStorage[e+".version"],t.contentCRC=localStorage[e+".contentCRC"]),localStorage[e]=JSON.stringify(t),localStorage.removeItem(e+".etag"),localStorage.removeItem(e+".version"),localStorage.removeItem(e+".contentCRC"),localStorage.removeItem(e+".titleCRC")})}),t="v2"}t=="v2"&&(_.each(e,function(e){_.has(localStorage,e+".sync")||(localStorage.removeItem(e+".title"),localStorage.removeItem(e+".publish"),localStorage.removeItem(e+".content"),localStorage["file.list"]=localStorage["file.list"].replace(";"+e+";",";"))}),t="v3");if(t=="v3"){var a=localStorage["file.current"];a!==undefined&&localStorage["file.list"].indexOf(";"+a+";")===-1&&localStorage.removeItem("file.current"),t="v4"}t=="v4"&&(localStorage.removeItem("githubToken"),t="v5"),t=="v5"&&(_.each(e,function(e){var t=_.compact(localStorage[e+".publish"].split(";"));_.each(t,function(e){var t=JSON.parse(localStorage[e]);t.provider=="gdrive"&&(t.id=t.fileId,t.fileId=undefined,localStorage[e]=JSON.stringify(t))})}),localStorage.missingSharingLink=!0,t="v6"),localStorage.version=t});var MAIN_URL="http://benweet.github.io/stackedit/",GOOGLE_API_KEY="AIzaSyAeCU8CGcSkn0z9js6iocHuPBX4f_mMWkw",GOOGLE_SCOPES=["https://www.googleapis.com/auth/drive.install","https://www.googleapis.com/auth/drive","https://www.googleapis.com/auth/blogger"],GOOGLE_DRIVE_APP_ID="241271498917",DROPBOX_APP_KEY="lq6mwopab8wskas",DROPBOX_APP_SECRET="851fgnucpezy84t",BITLY_ACCESS_TOKEN="317e033bfd48cf31155a68a536b1860013b09c4c",DEFAULT_FILE_TITLE="Title",GDRIVE_DEFAULT_FILE_TITLE="New Markdown document",CHECK_ONLINE_PERIOD=12e4,AJAX_TIMEOUT=3e4,ASYNC_TASK_DEFAULT_TIMEOUT=6e4,ASYNC_TASK_LONG_TIMEOUT=12e4,SYNC_PERIOD=18e4,USER_IDLE_THRESHOLD=3e5,WELCOME_DOCUMENT_TITLE="Welcome document",DOWNLOAD_PROXY_URL="http://stackedit-download-proxy.herokuapp.com/",WORDPRESS_CLIENT_ID="3185",WORDPRESS_PROXY_URL="http://stackedit-wordpress-proxy.herokuapp.com/",SSH_PROXY_URL="http://stackedit-ssh-proxy.herokuapp.com/",delayedFunction=undefined,BASE_URL="http://localhost/",GOOGLE_CLIENT_ID="241271498917-lev37kef013q85avc91am1gccg5g8lrb.apps.googleusercontent.com",GITHUB_CLIENT_ID="e47fef6055344579799d",GATEKEEPER_URL="http://stackedit-gatekeeper-localhost.herokuapp.com/",TUMBLR_PROXY_URL="http://stackedit-tumblr-proxy-local.herokuapp.com/";location.hostname.indexOf("benweet.github.io")===0&&(BASE_URL=MAIN_URL,GOOGLE_CLIENT_ID="241271498917-jpto9lls9fqnem1e4h6ppds9uob8rpvu.apps.googleusercontent.com",GITHUB_CLIENT_ID="fa0d09514da8377ee32e",GATEKEEPER_URL="http://stackedit-gatekeeper.herokuapp.com/",TUMBLR_PROXY_URL="http://stackedit-tumblr-proxy.herokuapp.com/");var THEME_LIST={"":"Default","blue-gray":"Blue-Gray",night:"Night"};define("config",function(){});var saveAs=saveAs||navigator.msSaveBlob&&navigator.msSaveBlob.bind(navigator)||function(e){try{var t=e.document,n=function(){return e.URL||e.webkitURL||e},r=e.URL||e.webkitURL||e,i=t.createElementNS("http://www.w3.org/1999/xhtml","a"),s="download"in i,o=function(n){var r=t.createEvent("MouseEvents");r.initMouseEvent("click",!0,!1,e,0,0,0,0,0,!1,!1,!1,!1,0,null),n.dispatchEvent(r)},u=e.webkitRequestFileSystem,a=e.requestFileSystem||u||e.mozRequestFileSystem,f=function(t){(e.setImmediate||e.setTimeout)(function(){throw t},0)},l="application/octet-stream",c=0,h=[],p=function(){var e=h.length;while(e--){var t=h[e];typeof t=="string"?r.revokeObjectURL(t):t.remove()}h.length=0},d=function(e,t,n){t=[].concat(t);var r=t.length;while(r--){var i=e["on"+t[r]];if(typeof i=="function")try{i.call(e,n||e)}catch(s){f(s)}}},v=function(t,r){var f=this,p=t.type,v=!1,m,g,y=function(){var e=n().createObjectURL(t);return h.push(e),e},b=function(){d(f,"writestart progress write writeend".split(" "))},w=function(){if(v||!m)m=y(t);g&&(g.location.href=m),f.readyState=f.DONE,b()},E=function(e){return function(){if(f.readyState!==f.DONE)return e.apply(this,arguments)}},S={create:!0,exclusive:!1},x;f.readyState=f.INIT,r||(r="download");if(s){m=y(t),i.href=m,i.download=r,o(i),f.readyState=f.DONE,b();return}e.chrome&&p&&p!==l&&(x=t.slice||t.webkitSlice,t=x.call(t,0,t.size,l),v=!0),u&&r!=="download"&&(r+=".download"),p===l||u?g=e:g=e.open();if(!a){w();return}c+=t.size,a(e.TEMPORARY,c,E(function(e){e.root.getDirectory("saved",S,E(function(e){var n=function(){e.getFile(r,S,E(function(e){e.createWriter(E(function(n){n.onwriteend=function(t){g.location.href=e.toURL(),h.push(e),f.readyState=f.DONE,d(f,"writeend",t)},n.onerror=function(){var e=n.error;e.code!==e.ABORT_ERR&&w()},"writestart progress write abort".split(" ").forEach(function(e){n["on"+e]=f["on"+e]}),n.write(t),f.abort=function(){n.abort(),f.readyState=f.DONE},f.readyState=f.WRITING}),w)}),w)};e.getFile(r,{create:!1},E(function(e){e.remove(),n()}),E(function(e){e.code===e.NOT_FOUND_ERR?n():w()}))}),w)}),w)},m=v.prototype,g=function(e,t){return new v(e,t)};return m.abort=function(){var e=this;e.readyState=e.DONE,d(e,"abort")},m.readyState=m.INIT=0,m.WRITING=1,m.DONE=2,m.error=m.onwritestart=m.onprogress=m.onwrite=m.onabort=m.onerror=m.onwriteend=null,e.addEventListener("unload",p,!1),g}catch(y){return undefined}}(self);define("FileSaver",function(){}),showLog=!0,css_browser_selector(navigator.userAgent),define("css_browser_selector",function(){}),define("core",["jquery","mathjax-editing","bootstrap","jgrowl","layout","Markdown.Editor","storage","config","underscore","FileSaver","css_browser_selector"],function(e,t){function r(){n.currentTime=(new Date).getTime()}function l(){o=!0,u=!0,f=n.currentTime}function c(){return u===!0&&n.currentTime-f>USER_IDLE_THRESHOLD&&(u=!1),u&&a}function p(e,t){t!==undefined&&(e.stop(!0,!0).addClass("error").delay(1e3).switchClass("error"),t.stopPropagation())}function m(){n.isOffline===!0&&navigator.onLine===!0&&d+CHECK_ONLINE_PERIODi?(p(e,t),undefined):s)},n.resetModalInputs=function(){e(".modal input[type=text]:not([disabled]), .modal input[type=password]").val("")},n.trim=function(e){return e.replace(/^\s+|\s+$/g,"")},n.checkUrl=function(e,t){return e?(e.indexOf("http")!==0&&(e="http://"+e),t&&e.indexOf("/",e.length-1)===-1&&(e+="/"),e):e},n.saveFile=function(e,t){if(saveAs!==undefined){var r=new Blob([e],{type:"text/plain;charset=utf-8"});saveAs(r,t)}else{var i="data:application/octet-stream;base64,"+n.encodeBase64(e);window.open(i,"file")}},n.showWorkingIndicator=function(t){t===!1?(e(".working-indicator").removeClass("show"),e("body").removeClass("working")):(e(".working-indicator").addClass("show"),e("body").addClass("working"))},n.showMessage=function(t,n,r){if(!t)return;var i=t.indexOf("|");if(i!==-1){t=t.substring(0,i);if(!t)return}r=r||{},n=n||"icon-info-sign",e.jGrowl(" "+_.escape(t),r)},n.showError=function(e){n.showMessage(e,"icon-warning-sign")},n.isOffline=!1;var d=n.currentTime,v=[];n.addOfflineListener=function(e){v.push(e)},n.setOffline=function(){d=n.currentTime;if(n.isOffline===!1){n.isOffline=!0,n.showMessage("You are offline.","icon-exclamation-sign msg-offline",{sticky:!0,close:function(){n.showMessage("You are back online!","icon-signal")}});for(var e=0;e Written with [StackEdit](http://benweet.github.io/stackedit/).",commitMsg:"Published by http://benweet.github.io/stackedit",template:["\n","\n","\n","<%= documentTitle %>\n","\n","<%= documentHTML %>\n",""].join(""),sshProxy:SSH_PROXY_URL,sshConnectionList:[]},n.loadSettings=function(){localStorage.settings&&e.extend(n.settings,JSON.parse(localStorage.settings)),e("input:radio[name=radio-layout-orientation][value="+n.settings.layoutOrientation+"]").prop("checked",!0),e("#input-settings-scroll-link").prop("checked",n.settings.scrollLink),e("#input-settings-theme").val(localStorage.theme),e("#input-settings-converter-type").val(n.settings.converterType),e("#input-settings-enable-mathjax").prop("checked",n.settings.enableMathJax),e("#input-settings-lazy-rendering").prop("checked",n.settings.lazyRendering),e("#input-settings-editor-font-size").val(n.settings.editorFontSize),e("#textarea-settings-default-content").val(n.settings.defaultContent),e("#input-settings-publish-commit-msg").val(n.settings.commitMsg),e("#textarea-settings-publish-template").val(n.settings.template),e("#input-settings-ssh-proxy").val(n.settings.sshProxy)},n.saveSettings=function(t){var r={};r.layoutOrientation=e("input:radio[name=radio-layout-orientation]:checked").prop("value");var i=e("#input-settings-theme").val();r.converterType=e("#input-settings-converter-type").val(),r.enableMathJax=e("#input-settings-enable-mathjax").prop("checked"),r.scrollLink=e("#input-settings-scroll-link").prop("checked"),r.lazyRendering=e("#input-settings-lazy-rendering").prop("checked"),r.editorFontSize=n.getInputIntValue(e("#input-settings-editor-font-size"),t,1,99),r.defaultContent=e("#textarea-settings-default-content").val(),r.commitMsg=n.getInputValue(e("#input-settings-publish-commit-msg"),t),r.template=n.getInputValue(e("#textarea-settings-publish-template"),t),r.sshProxy=n.checkUrl(n.getInputValue(e("#input-settings-ssh-proxy"),t),!0),t.isPropagationStopped()||(e.extend(n.settings,r),localStorage.settings=JSON.stringify(r),localStorage.theme=i)};var g=[],y=[],w=_.debounce(function(){function o(e){var t=r;e!==undefined&&(n.val(e),t+=n.prop("scrollHeight"));var i=s+t;g.push({startOffset:s,endOffset:i,height:t}),s=i,r=0}var t=e("#wmd-input");g=[];var n=e("#md-section-helper");n.width(t.width());var r=b(t.css("padding-top")),i=0,s=0,u=t.val()+"\n\n";u.replace(/^```.*\n[\s\S]*?\n```|(^.+[ \t]*\n=+[ \t]*\n+|^.+[ \t]*\n-+[ \t]*\n+|^\#{1,6}[ \t]*.+?[ \t]*\#*\n+)/gm,function(e,t,n){if(t){var r=undefined;n>i&&(r=u.substring(i,n-1)),o(r),i=n}return""}),r+=b(t.css("padding-bottom")),o(u.substring(i,u.length-2));var a=e("#wmd-preview");y=[];var f=0,l=a.scrollTop();a.children("h1,h2,h3,h4,h5,h6").each(function(){var t=e(this).position().top+l+b(e(this).css("margin-top"));y.push({startOffset:f,endOffset:t,height:t-f}),f=t});var c=a.prop("scrollHeight");y.push({startOffset:f,endOffset:c,height:c-f}),E=-9,x=!1,T()},500),E=-9,S=-9,x=!1,T=_.debounce(function(){function s(e,t,n,r,i,s){var o=undefined,u=_.find(t,function(t,n){return o=n,e5?(E=n,s(n,g,r,y,S,function(e){S=e})):Math.abs(i-S)>5&&(S=i,s(i,y,t,g,E,function(e){E=e}))},600),N=undefined;n.createLayout=function(){if(viewerMode===!0)return;var t={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,center__minWidth:200,center__minHeight:200};n.settings.scrollLink===!0&&(t.onresize=w),n.settings.layoutOrientation=="horizontal"?(e(".ui-layout-south").remove(),e(".ui-layout-east").addClass("well").prop("id","wmd-preview"),N=e("body").layout(e.extend(t,{east__resizable:!0,east__size:.5,east__minSize:200}))):n.settings.layoutOrientation=="vertical"&&(e(".ui-layout-east").remove(),e(".ui-layout-south").addClass("well").prop("id","wmd-preview"),N=e("body").layout(e.extend(t,{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(){N.allowOverflow("north")}),n.settings.scrollLink===!0&&e("#wmd-input, #wmd-preview").scroll(T)},n.layoutRefresh=function(){N!==undefined&&_.defer(N.resizeAll)};var C=undefined;n.createEditor=function(r){var i=!0;x=!0,S=-9,e("#wmd-input, #wmd-preview").scrollTop(0),e("#wmd-button-bar").empty();var s=new Markdown.Converter;if(n.settings.converterType.indexOf("markdown-extra")===0){var o={};n.settings.converterType=="markdown-extra-prettify"&&(o.highlighter="prettify"),Markdown.Extra.init(s,o)}s.hooks.chain("postConversion",function(e){return e.replace(/<(mailto\:)?([^\s>]+@[^\s>]+\.\S+?)>/g,function(e,t,n){return''+n+""})});var u=new Markdown.Editor(s);n.settings.converterType=="markdown-extra-prettify"&&u.hooks.chain("onPreviewRefresh",prettyPrint);var a=function(){if(viewerMode===!1&&n.settings.scrollLink===!0){function t(){E=-9,w(),e("#wmd-preview img").load(function(){E=-9,w()})}e("#wmd-preview").scrollTop(S),_.defer(t)}};n.settings.enableMathJax===!0?t.prepareWmdForMathJax(u,[["$","$"],["\\\\(","\\\\)"]],function(){x=!0},a):u.hooks.chain("onPreviewRefresh",a),u.hooks.set("insertLinkDialog",function(t){return C=t,n.resetModalInputs(),e("#modal-insert-link").modal(),_.defer(function(){e("#input-insert-link").focus()}),!0}),u.hooks.set("insertImageDialog",function(t){return C=t,n.resetModalInputs(),e("#modal-insert-image").modal(),_.defer(function(){e("#input-insert-image").focus()}),!0});var f=function(e){return function(){i!==!0&&r(),e()}};n.settings.lazyRendering===!0&&(f=function(e){var t=_.debounce(e,500);return function(){i===!0?e():(r(),t())}}),u.run(f),i=!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"))},n.encodeBase64=function(e){if(e.length===0)return"";var t=[],n=0,r,i;e=encodeURI(e),r=e.length;while(n>18)),f.push(o.charAt(a>>12&63)),f.push(o.charAt(a>>6&63)),f.push(o.charAt(a&63));switch(t.length-l){case 1:a=t[u]<<16,f.push(o.charAt(a>>18)+o.charAt(a>>12&63)+s+s);break;case 2:a=t[u]<<16|t[u+1]<<8,f.push(o.charAt(a>>18)+o.charAt(a>>12&63)+o.charAt(a>>6&63)+s)}return f.join("")};var k=[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];n.crc32=function(e){var t=0,n=-1;for(var r=0;r>>8^k[t];return n^=-1,n<0&&(n=4294967295+n+1),n.toString(16)},n.randomString=function(){return _.random(4294967296).toString(36)},n.getURLParameter=function(e){var t=new RegExp(e+"=(.+?)(&|$)");try{return decodeURIComponent(t.exec(location.search)[1])}catch(n){return undefined}},n.popupWindow=function(e,t,n,r){var i=screen.width/2-n/2,s=screen.height/2-r/2;return window.open(e,t,"toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width="+n+", height="+r+", top="+s+", left="+i)},n.setFileManager=function(e){n.fileManager=e,O()};var L=[];n.onReady=function(e){L.push(e),O()};var A=!1;return e(function(){A=!0,O()}),n.onReady(function(){e.jGrowl.defaults.life=5e3,e.jGrowl.defaults.closer=!1,e.jGrowl.defaults.closeTemplate="",e.jGrowl.defaults.position="bottom-right",_.each(THEME_LIST,function(t,n){e("#input-settings-theme").append(e('"))}),e(window).on("offline",n.setOffline),e(window).on("online",n.setOnline),navigator.onLine===!1&&n.setOffline(),e(document).mousemove(l).keypress(l),e(".dropdown-submenu > a").click(function(e){e.stopPropagation()}),e(".action-insert-link").click(function(t){var r=n.getInputValue(e("#input-insert-link"),t);r!==undefined&&C(r)}),e(".action-insert-image").click(function(t){var r=n.getInputValue(e("#input-insert-image"),t);r!==undefined&&C(r)}),e(".action-close-insert-link").click(function(e){C(null)}),n.loadSettings(),e(".action-load-settings").click(function(){n.loadSettings()}),e(".action-apply-settings").click(function(e){n.saveSettings(e),e.isPropagationStopped()||window.location.reload()}),e(".action-default-settings").click(function(){localStorage.removeItem("settings"),window.location.reload()}),e(".action-app-reset").click(function(){localStorage.clear(),window.location.reload()}),e("#menu-bar, .ui-layout-center, .ui-layout-east, .ui-layout-south").removeClass("hide"),n.createLayout(),e("#wmd-input, #md-section-helper").css({"font-size":n.settings.editorFontSize+"px","line-height":Math.round(n.settings.editorFontSize*(20/14))+"px"}),e("#wmd-input").keydown(function(t){if(t.keyCode===9){var n=e(this).val(),r=this.selectionStart,i=this.selectionEnd;if(r===undefined||i===undefined)return;e(this).val(n.substring(0,r)+" "+n.substring(i)),this.selectionStart=this.selectionEnd=r+1,t.preventDefault()}}),e(".tooltip-scroll-link").tooltip({html:!0,container:"#modal-settings",placement:"right",title:["Scroll Link is a feature that binds together editor and preview scrollbars. ","It allows you to keep an eye on the preview while scrolling the editor and vice versa. ","

      ","The mapping between Markdown and HTML is based on the position of the title elements (h1, h2, ...) in the page. ","Therefore, if your document does not contain any title, the mapping will be linear and consequently less efficient."].join("")}),e(".tooltip-lazy-rendering").tooltip({container:"#modal-settings",placement:"right",title:"Disable preview rendering while typing in order to offload CPU. Refresh preview after 500 ms of inactivity."}),e(".tooltip-default-content").tooltip({html:!0,container:"#modal-settings",placement:"right",title:"Thanks for supporting StackEdit by adding a backlink in your documents!"}),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")}),e(".action-reset-input").click(function(){n.resetModalInputs()}),i=window.setInterval(function(){r(),n.checkWindowUnique();if(c()===!0||viewerMode===!0)_.each(s,function(e){e()}),m()},1e3)}),n}),define("async-runner",["core","underscore"],function(e){function o(s,o,u){try{_.each(o,function(e){e(u)})}finally{s.finished=!0,r===s&&(r=undefined,i=!1),n.length===0?e.showWorkingIndicator(!1):t.runTask()}}var t={},n=[],r=undefined,i=!1,s=0;return t.createTask=function(){var n={};return n.finished=!1,n.timeout=ASYNC_TASK_DEFAULT_TIMEOUT,n.retryCounter=0,n.runCallbacks=[],n.onRun=function(e){n.runCallbacks.push(e)},n.successCallbacks=[],n.onSuccess=function(e){n.successCallbacks.push(e)},n.errorCallbacks=[],n.onError=function(e){n.errorCallbacks.push(e)},n.chain=function(e){if(n.finished===!0)return;n.queue===undefined&&(n.queue=n.runCallbacks.slice());if(e!==undefined){e();return}if(n.queue.length===0){o(n,n.successCallbacks);return}var t=n.queue.shift();t()},n.error=function(t){if(n.finished===!0)return;throw t=t||new Error("Unknown error"),t.message&&e.showError(t.message),o(n,n.errorCallbacks,t),t},n.retry=function(r,o){if(n.finished===!0)return;o=o||5,n.queue=undefined;if(n.retryCounter>=o){n.error(r);return}var u=Math.pow(2,n.retryCounter++)*1e3;s=e.currentTime+u,i=!1,t.runTask()},n},t.runTask=function(){_.defer(function(){if(i===!0){s+r.timeout:"\|?\*]+$/)?e.indexOf("/")!==0?"/"+e:e:(t.showError('"'+e+'" contains invalid characters.'),undefined)}function o(e,n,i){var s={};return s.provider=r,s.path=e,s.version=n,s.contentCRC=t.crc32(i),s}function u(e){return"sync."+r+"."+encodeURIComponent(e.toLowerCase())}function a(e){n.downloadMetadata(e,function(e,r){if(e)return;n.downloadContent(r,function(e,n){if(e)return;var r=[];_.each(n,function(e){var n=o(e.path,e.versionTag,e.content),i=u(n.path);localStorage[i]=JSON.stringify(n);var s=t.fileManager.createFile(e.name,e.content,[i]);t.fileManager.selectFile(s),r.push('"'+e.name+'"')}),t.showMessage(r.join(", ")+" imported successfully from Dropbox.")})})}function f(e,r,i,a){e=s(e);if(e===undefined){a(!0);return}var f=u(e),l=t.fileManager.getFileIndexFromSync(f);if(l!==undefined){var c=localStorage[l+".title"];t.showError('File path is already synchronized with "'+c+'"'),a(!0);return}n.upload(e,i,function(e,t){if(e){a(e);return}var n=o(t.path,t.versionTag,i),r=u(n.path);localStorage[r]=JSON.stringify(n),a(undefined,r)})}var r="dropbox",i={providerId:r,providerName:"Dropbox",defaultPublishFormat:"template",useSync:!1};return i.importFiles=function(){n.picker(function(e,n){if(e||n.length===0)return;var r=[];_.each(n,function(e){var n=u(e),i=t.fileManager.getFileIndexFromSync(n);if(i!==undefined){var s=localStorage[i+".title"];t.showError('"'+s+'" was already imported');return}r.push(e)}),a(r)})},i.exportFile=function(n,r,i,s){var o=t.getInputValue(e("#input-sync-export-dropbox-path"),n);f(o,r,i,s)},i.exportManual=function(n,r,i,s){var o=t.getInputValue(e("#input-sync-manual-dropbox-path"),n);f(o,r,i,s)},i.syncUp=function(e,t,r,i,s,o){var u=s.contentCRC;if(t==u){o(undefined,!1);return}n.upload(s.path,e,function(e,n){if(e){o(e,!0);return}s.version=n.versionTag,s.contentCRC=t,o(undefined,!0)})},i.syncDown=function(e){if(i.useSync===!1){e();return}var s=localStorage[r+".lastChangeId"];n.checkChanges(s,function(i,s,o){if(i){e(i);return}var a=[];_.each(s,function(e){var t=u(e.path),n=localStorage[t];if(n===undefined)return;e.syncIndex=t;if(e.wasRemoved===!0){a.push(e);return}var r=JSON.parse(n);r.version!=e.stat.versionTag&&(a.push(e),e.syncAttributes=r)}),n.downloadContent(a,function(n,i){if(n){e(n);return}var s=!1;_.each(i,function(e){var n=e.syncIndex,r=t.fileManager.getFileIndexFromSync(n);if(r===undefined){t.fileManager.removeSync(n);return}var i=localStorage[r+".title"];if(e.wasRemoved===!0){t.fileManager.removeSync(n),s=!0,t.showMessage('"'+i+'" has been removed from Dropbox.');return}var o=e.syncAttributes,u=localStorage[r+".content"],a=o.contentCRC!=t.crc32(u),f=e.stat,l=t.crc32(f.content),c=o.contentCRC!=l,h=u!=f.content;h===!0&&a===!0&&c===!0&&(t.fileManager.createFile(i+" (backup)",u),s=!0,t.showMessage('Conflict detected on "'+i+'". A backup has been created locally.')),h&&c===!0&&(localStorage[r+".content"]=f.content,t.showMessage('"'+i+'" has been updated from Dropbox.'),t.fileManager.isCurrentFileIndex(r)&&(s=!1,t.fileManager.selectFile())),o.version=f.versionTag,o.contentCRC=l,localStorage[n]=JSON.stringify(o)}),s&&t.fileManager.updateFileTitles(),localStorage[r+".lastChangeId"]=o,e()})})},i.publish=function(e,t,r,i){var o=s(e.path);if(o===undefined){i(!0);return}n.upload(o,r,i)},i.newPublishAttributes=function(n){var r={};return r.path=t.getInputValue(e("#input-publish-dropbox-path"),n),n.isPropagationStopped()?undefined:r},i}),define("google-helper",["jquery","core","async-runner"],function(e,t,n){function o(n){n.onRun(function(){if(t.isOffline===!0){r=!1,n.error(new Error("Operation not available in offline mode.|stopPublish"));return}if(r===!0){n.chain();return}delayedFunction=function(){r=!0,n.chain()},e.ajax({url:"https://apis.google.com/js/client.js?onload=runDelayedFunction",dataType:"script",timeout:AJAX_TIMEOUT}).fail(function(e){var t={code:e.status,message:e.statusText};a(t,n)})})}function u(e){e.onRun(function(){function s(){n===!1&&(t.showMessage("Please make sure the Google authorization popup is not blocked by your browser."),e.timeout=ASYNC_TASK_LONG_TIMEOUT),gapi.auth.authorize({client_id:GOOGLE_CLIENT_ID,scope:GOOGLE_SCOPES,immediate:n},function(t){gapi.client.load("drive","v2",function(){if(!t||t.error){if(r===!0&&n===!0){n=!1,e.chain(s);return}e.error(new Error("Access to Google account is not authorized."));return}i=!0,e.chain()})})}if(i===!0){e.chain();return}var n=!0;e.chain(s)})}function a(e,n){var s=undefined;if(e){console.error(e);if(typeof e=="string")s=e;else{s="Google error ("+e.code+": "+e.message+").";if(e.code>=500&&e.code<600){n.retry(new Error(s));return}if(e.code===401||e.code===403){i=!1,s="Access to Google account is not authorized.",n.retry(new Error(s),1);return}e.code<=0&&(r=!1,i=!1,t.setOffline(),s="|stopPublish")}}n.error(new Error(s))}function l(t){t.onRun(function(){if(f===!0){t.chain();return}e.ajax({url:"//www.google.com/jsapi",data:{key:GOOGLE_API_KEY},dataType:"script",timeout:AJAX_TIMEOUT}).done(function(){google.load("picker","1",{callback:t.chain}),f=!0}).fail(function(e){var n={code:e.status,message:e.statusText};a(n,t)})})}var r=!1,i=!1,s={};s.upload=function(e,r,i,s,f,l){l=l||t.doNothing;var c=undefined,h=n.createTask();o(h),u(h),h.onRun(function(){var n="-------314159265358979323846",o="\r\n--"+n+"\r\n",u="\r\n--"+n+"--",l="text/x-markdown",p={title:i,mimeType:l};r!==undefined&&(p.parents=[{kind:"drive#fileLink",id:r}]);var d="/upload/drive/v2/files",v="POST";e!==undefined&&(d+="/"+e,v="PUT");var m={"Content-Type":'multipart/mixed; boundary="'+n+'"'};f!==undefined;var g=t.encodeBase64(s),y=o+"Content-Type: application/json\r\n\r\n"+JSON.stringify(p)+o+"Content-Type: "+l+"\r\n"+"Content-Transfer-Encoding: base64\r\n"+"\r\n"+g+u,b=gapi.client.request({path:d,method:v,params:{uploadType:"multipart"},headers:m,body:y});b.execute(function(t){if(t&&t.id){c=t,h.chain();return}var n=t.error;n!==undefined&&e!==undefined&&(n.code===404?n='File ID "'+e+'" not found on Google Drive.|removePublish':n.code===412&&(localStorage.removeItem("gdrive.lastChangeId"),n='Conflict on file ID "'+e+'". Please restart the synchronization.')),a(n,h)})}),h.onSuccess(function(){l(undefined,c)}),h.onError(function(e){l(e)}),n.addTask(h)},s.checkChanges=function(e,r){r=r||t.doNothing;var i=[],s=e||0,f=n.createTask();o(f),u(f),f.onRun(function(){function t(){var n=undefined;e===undefined?n=gapi.client.drive.changes.list({startChangeId:s+1}):n=gapi.client.drive.changes.list({pageToken:e}),n.execute(function(n){if(!n||!n.largestChangeId){a(n.error,f);return}s=n.largestChangeId,e=n.nextPageToken,n.items!==undefined&&(i=i.concat(n.items)),e!==undefined?f.chain(t):f.chain()})}var e=undefined;f.chain(t)}),f.onSuccess(function(){r(undefined,i,s)}),f.onError(function(e){r(e)}),n.addTask(f)},s.downloadMetadata=function(r,i,s){i=i||t.doNothing;var f=[],l=n.createTask();o(l),s||u(l),l.onRun(function(){function t(){if(r.length===0){l.chain();return}var n=r[0],i={},s=gapi.auth.getToken();s&&(i.Authorization="Bearer "+s.access_token),e.ajax({url:"https://www.googleapis.com/drive/v2/files/"+n,headers:i,data:{key:GOOGLE_API_KEY},dataType:"json",timeout:AJAX_TIMEOUT}).done(function(e,n,i){f.push(e),r.shift(),l.chain(t)}).fail(function(e){var t={code:e.status,message:e.statusText};t.code===404&&(t='File ID "'+n+'" not found on Google Drive.'),a(t,l)})}l.chain(t)}),l.onSuccess(function(){i(undefined,f)}),l.onError(function(e){i(e)}),n.addTask(l)},s.downloadContent=function(r,i,s){i=i||t.doNothing;var f=[],l=n.createTask();l.timeout=ASYNC_TASK_LONG_TIMEOUT,o(l),s||u(l),l.onRun(function(){function t(){if(r.length===0){l.chain();return}var n=r[0];f.push(n);var i=undefined;n.kind=="drive#file"?i=n:n.kind=="drive#change"&&(i=n.file);if(!i){r.shift(),l.chain(t);return}var s={},o=gapi.auth.getToken();o&&(s.Authorization="Bearer "+o.access_token),e.ajax({url:i.downloadUrl,headers:s,data:{key:GOOGLE_API_KEY},dataType:"text",timeout:AJAX_TIMEOUT}).done(function(e,n,s){i.content=e,r.shift(),l.chain(t)}).fail(function(e){var t={code:e.status,message:e.statusText};a(t,l)})}l.chain(t)}),l.onSuccess(function(){i(undefined,f)}),l.onError(function(e){i(e)}),n.addTask(l)};var f=!1;return s.picker=function(r){function u(){s!==undefined&&(s.setVisible(!1),e(".modal-backdrop, .picker").remove())}r=r||t.doNothing;var i=[],s=undefined,a=n.createTask();o(a),l(a),a.onRun(function(){var t=new google.picker.View(google.picker.ViewId.DOCS);t.setMimeTypes("text/x-markdown,text/plain,application/octet-stream");var n=new google.picker.PickerBuilder;n.enableFeature(google.picker.Feature.NAV_HIDDEN),n.enableFeature(google.picker.Feature.MULTISELECT_ENABLED),n.setAppId(GOOGLE_DRIVE_APP_ID);var r=gapi.auth.getToken();r&&n.setOAuthToken(r.access_token),n.addView(t),n.addView(new google.picker.DocsUploadView),n.setCallback(function(e){if(e.action==google.picker.Action.PICKED||e.action==google.picker.Action.CANCEL){if(e.action==google.picker.Action.PICKED)for(var t=0;t").addClass("modal-backdrop").click(function(){u(),a.chain()})),s.setVisible(!0)}),a.onSuccess(function(){r(undefined,i)}),a.onError(function(e){u(),r(e)}),n.addTask(a)},s.uploadBlogger=function(t,r,i,s,f,l,c){var h=n.createTask();o(h),u(h),h.onRun(function(){function u(){var t="https://www.googleapis.com/blogger/v3/blogs/"+r+"/posts/",o={kind:"blogger#post",blog:{id:r},labels:s,title:f,content:l},u="POST";i!==undefined&&(t+=i,o.id=i,u="PUT"),e.ajax({url:t,data:JSON.stringify(o),headers:n,type:u,contentType:"application/json",dataType:"json",timeout:AJAX_TIMEOUT}).done(function(e,t,n){i=e.id,h.chain()}).fail(function(e){var t={code:e.status,message:e.statusText};t.code===404&&i!==undefined&&(t="Post "+i+" not found on Blogger.|removePublish"),a(t,h)})}function c(){if(r!==undefined){h.chain(u);return}e.ajax({url:"https://www.googleapis.com/blogger/v3/blogs/byurl",data:{url:t},headers:n,dataType:"json",timeout:AJAX_TIMEOUT}).done(function(e,t,n){r=e.id,h.chain(u)}).fail(function(e){var n={code:e.status,message:e.statusText};n.code===404&&(n='Blog "'+t+'" not found on Blogger.|removePublish'),a(n,h)})}var n={},o=gapi.auth.getToken();o&&(n.Authorization="Bearer "+o.access_token),h.chain(c)}),h.onSuccess(function(){c(undefined,r,i)}),h.onError(function(e){c(e)}),n.addTask(h)},s}),define("gdrive-provider",["jquery","core","google-helper","underscore"],function(e,t,n){function s(e,n,i,s){var o={};return o.provider=r,o.id=e,o.etag=n,o.contentCRC=t.crc32(i),o.titleCRC=t.crc32(s),o}function o(e){return"sync."+r+"."+e}function u(e){n.downloadMetadata(e,function(e,r){if(e)return;n.downloadContent(r,function(e,n){if(e)return;var r=[];_.each(n,function(e){var n=s(e.id,e.etag,e.content,e.title),i=o(n.id);localStorage[i]=JSON.stringify(n);var u=t.fileManager.createFile(e.title,e.content,[i]);t.fileManager.selectFile(u),r.push('"'+e.title+'"')});if(r.length===0)return;t.showMessage(r.join(", ")+" imported successfully from Google Drive.")})})}var r="gdrive",i={providerId:r,providerName:"Google Drive",defaultPublishFormat:"template",exportPreferencesInputIds:["gdrive-parentid"],useSync:!1};return i.importFiles=function(){n.picker(function(e,n){if(e||n.length===0)return;var r=[];_.each(n,function(e){var n=o(e),i=t.fileManager.getFileIndexFromSync(n);if(i!==undefined){var s=localStorage[i+".title"];t.showError('"'+s+'" was already imported');return}r.push(e)}),u(r)})},i.exportFile=function(r,i,u,a){var f=t.getInputValue(e("#input-sync-export-gdrive-parentid"));n.upload(undefined,f,i,u,undefined,function(e,t){if(e){a(e);return}var n=s(t.id,t.etag,u,i),r=o(n.id);localStorage[r]=JSON.stringify(n),a(undefined,r)})},i.exportManual=function(r,i,u,a){var f=t.getInputValue(e("#input-sync-manual-gdrive-id"),r);if(!f)return;var l=o(f),c=t.fileManager.getFileIndexFromSync(l);if(c!==undefined){var h=localStorage[c+".title"];t.showError('File ID is already synchronized with "'+h+'"'),a(!0);return}n.upload(f,undefined,i,u,undefined,function(e,t){if(e){a(e);return}var n=s(t.id,t.etag,u,i),r=o(n.id);localStorage[r]=JSON.stringify(n),a(undefined,r)})},i.syncUp=function(e,t,r,i,s,o){var u=s.contentCRC,a=s.titleCRC;if(t==u&&i==a){o(undefined,!1);return}n.upload(s.id,undefined,r,e,s.etag,function(e,n){if(e){o(e,!0);return}s.etag=n.etag,s.contentCRC=t,s.titleCRC=i,o(undefined,!0)})},i.syncDown=function(e){if(i.useSync===!1){e();return}var s=parseInt(localStorage[r+".lastChangeId"]);n.checkChanges(s,function(i,s,u){if(i){e(i);return}var a=[];_.each(s,function(e){var t=o(e.fileId),n=localStorage[t];if(n===undefined)return;e.syncIndex=t;if(e.deleted===!0){a.push(e);return}var r=JSON.parse(n);r.etag!=e.file.etag&&(a.push(e),e.syncAttributes=r)}),n.downloadContent(a,function(n,i){if(n){e(n);return}var s=!1;_.each(i,function(e){var n=e.syncIndex,r=t.fileManager.getFileIndexFromSync(n);if(r===undefined){t.fileManager.removeSync(n);return}var i=localStorage[r+".title"];if(e.deleted===!0){t.fileManager.removeSync(n),s=!0,t.showMessage('"'+i+'" has been removed from Google Drive.');return}var o=e.syncAttributes,u=o.titleCRC!=t.crc32(i),a=localStorage[r+".content"],f=o.contentCRC!=t.crc32(a),l=e.file,c=t.crc32(l.title),h=o.titleCRC!=c,p=i!=l.title,d=t.crc32(l.content),v=o.contentCRC!=d,m=a!=l.content;if(p===!0&&u===!0&&h===!0||m===!0&&f===!0&&v===!0)t.fileManager.createFile(i+" (backup)",a),s=!0,t.showMessage('Conflict detected on "'+i+'". A backup has been created locally.');p&&h===!0&&(localStorage[r+".title"]=l.title,s=!0,t.showMessage('"'+i+'" has been renamed to "'+l.title+'" on Google Drive.')),m&&v===!0&&(localStorage[r+".content"]=l.content,t.showMessage('"'+l.title+'" has been updated from Google Drive.'),t.fileManager.isCurrentFileIndex(r)&&(s=!1,t.fileManager.selectFile())),o.etag=l.etag,o.contentCRC=d,o.titleCRC=c,localStorage[n]=JSON.stringify(o)}),s&&t.fileManager.updateFileTitles(),localStorage[r+".lastChangeId"]=u,e()})})},i.publish=function(e,t,r,i){n.upload(e.id,undefined,e.fileName||t,r,undefined,function(t,n){if(t){i(t);return}e.id=n.id,i()})},i.newPublishAttributes=function(t){var n={};return n.id=e("#input-publish-gdrive-fileid").val()||undefined,n.fileName=e("#input-publish-gdrive-filename").val()||undefined,t.isPropagationStopped()?undefined:n},t.onReady(function(){var e=localStorage[r+".state"];if(e===undefined)return;localStorage.removeItem(r+".state"),e=JSON.parse(e);if(e.action=="create")n.upload(undefined,e.folderId,GDRIVE_DEFAULT_FILE_TITLE,"",undefined,function(e,n){if(e)return;var r=s(n.id,n.etag,n.content,n.title),i=t.fileManager.createFile(n.title,n.content,[r]);t.fileManager.selectFile(i),t.showMessage('"'+n.title+'" created successfully on Google Drive.')});else if(e.action=="open"){var i=[];_.each(e.ids,function(e){var n=o(e),r=t.fileManager.getFileIndexFromSync(n);r!==undefined?t.fileManager.selectFile(r):i.push(e)}),u(i)}}),i}),define("synchronizer",["jquery","core","dropbox-provider","gdrive-provider","underscore"],function(e,t){function l(e){if(s.length===0){h(e);return}var t=s.pop(),n=JSON.parse(localStorage[t]);r[n.provider].syncUp(o,u,a,f,n,function(r,s){s===!0&&(p=!0,i=!0);if(r){e(r);return}s&&(localStorage[t]=JSON.stringify(n)),l(e)})}function h(e){if(c.length===0){d(e);return}var n=c.pop(),r=localStorage[n+".sync"];if(r.length===1){h(e);return}o=localStorage[n+".content"],u=t.crc32(o),a=localStorage[n+".title"],f=t.crc32(a),s=_.compact(r.split(";")),l(e)}function d(e){p===!0?(p=!1,c=_.compact(localStorage["file.list"].split(";")),h(e)):e()}function m(e){if(v.length===0){e();return}var t=v.pop();t.syncDown(function(t){if(t){e(t);return}m(e)})}function g(e){v=_.values(r),m(e)}function S(n){t.resetModalInputs();var r=localStorage[n.providerId+".exportPreferences"];if(r){var i=JSON.parse(r);_.each(n.exportPreferencesInputIds,function(t){e("#input-sync-export-"+t).val(i[t])})}e("#modal-upload-"+n.providerId).modal()}var n={},r=_.chain(arguments).map(function(e){return e&&e.providerId&&[e.providerId,e]}).compact().object().value(),i=!1;n.notifyChange=function(e){localStorage[e+".sync"].length!==1&&(i=!0,n.updateSyncButton())},n.updateSyncButton=function(){y===!0||i===!1||t.isOffline?e(".action-force-sync").addClass("disabled"):e(".action-force-sync").removeClass("disabled")},t.addOfflineListener(n.updateSyncButton),n.forceSync=function(){b=0,n.sync()};var s=[],o=undefined,u=undefined,a=undefined,f=undefined,c=[],p=!1,v=[],y=!1,b=0;n.sync=function(){function e(e){return e!==undefined?(console.error(e),y=!1,n.updateSyncButton(),!0):!1}if(y||b+SYNC_PERIOD>t.currentTime||t.isOffline)return;y=!0,p=!0,b=t.currentTime,n.updateSyncButton(),g(function(t){if(e(t))return;d(function(t){if(e(t))return;y=!1,i=!1})})},viewerMode===!1&&t.addPeriodicCallback(n.sync);var w=['
      ','','','',"
      "].join(""),E='';return n.refreshManageSync=function(){var n=t.fileManager.getCurrentFileIndex(),i=_.compact(localStorage[n+".sync"].split(";"));e(".msg-no-sync, .msg-sync-list").addClass("hide");var s=e("#manage-sync-list").empty();i.length>0?e(".msg-sync-list").removeClass("hide"):e(".msg-no-sync").removeClass("hide"),_.each(i,function(n){var i=JSON.parse(localStorage[n]),o=i.id||i.path,u=e(_.template(w,{provider:r[i.provider],syncDesc:o}));u.append(e(E).click(function(){t.fileManager.removeSync(n),t.fileManager.updateFileTitles()})),s.append(u)})},n.resetSyncFlags=function(){_.each(r,function(e){e.useSync=!1})},n.getSyncAttributesFromFile=function(e){var t=_.compact(localStorage[e+".sync"].split(";")),n=[];return _.each(t,function(e){var t=JSON.parse(localStorage[e]);n.push(t),r[t.provider].useSync=!0}),n},t.onReady(function(){_.each(r,function(r){e(".action-sync-import-"+r.providerId).click(function(e){r.importFiles(e)}),e(".action-sync-export-dialog-"+r.providerId).click(function(){S(r)}),e(".action-sync-export-"+r.providerId).click(function(i){var s=t.fileManager.getCurrentFileIndex(),o=localStorage[s+".title"],u=localStorage[s+".content"];r.exportFile(i,o,u,function(e,i){if(e)return;localStorage[s+".sync"]+=i+";",n.refreshManageSync(),t.fileManager.updateFileTitles(),t.showMessage('"'+o+'" will now be synchronized on '+r.providerName+".")});var a={};_.each(r.exportPreferencesInputIds,function(t){a[t]=e("#input-sync-export-"+t).val()}),localStorage[r.providerId+".exportPreferences"]=JSON.stringify(a)}),e(".action-sync-manual-"+r.providerId).click(function(e){var i=t.fileManager.getCurrentFileIndex(),s=localStorage[i+".title"],o=localStorage[i+".content"];r.exportManual(e,s,o,function(e,o){if(e)return;localStorage[i+".sync"]+=o+";",n.refreshManageSync(),t.fileManager.updateFileTitles(),t.showMessage('"'+s+'" will now be synchronized on '+r.providerName+".")})})}),n.updateSyncButton(),e(".action-force-sync").click(function(){e(this).hasClass("disabled")||n.forceSync()})}),n}),define("download-provider",["jquery","core","async-runner"],function(e,t,n){var r="download",i={providerId:r,sharingAttributes:["url"]};return i.importPublic=function(t,r){var i=n.createTask(),s=undefined,o=undefined;i.onRun(function(){var n=t.url,r=n.lastIndexOf("/");if(r===-1){i.error(new Error("Invalid URL parameter."));return}s=n.substring(r+1),e.ajax({url:DOWNLOAD_PROXY_URL+"download?url="+n,type:"GET",dataType:"text",timeout:AJAX_TIMEOUT}).done(function(e,t,n){o=e,i.chain()}).fail(function(e){i.error(new Error("Unable to access URL "+n))})}),i.onSuccess(function(){r(undefined,s,o)}),i.onError(function(e){r(e)}),n.addTask(i)},i}),define("github-helper",["jquery","core","async-runner"],function(e,t,n){function o(n){n.onRun(function(){if(t.isOffline===!0){r=!1,n.error(new Error("Operation not available in offline mode.|stopPublish"));return}if(r===!0){n.chain();return}e.ajax({url:"lib/github.js",dataType:"script",timeout:AJAX_TIMEOUT}).done(function(){r=!0,n.chain()}).fail(function(e){var t={error:e.status,message:e.statusText};a(t,n)})})}function u(n){var r=undefined,s=undefined;n.onRun(function(){function f(){localStorage.removeItem("githubCode"),r=t.popupWindow("github-oauth-client.html?client_id="+GITHUB_CLIENT_ID,"stackedit-github-oauth",960,600),r.focus(),s=setInterval(function(){if(r.closed===!0){clearInterval(s),r=undefined,s=undefined,a=localStorage.githubCode;if(a===undefined){n.error(new Error(u));return}localStorage.removeItem("githubCode"),n.chain(l)}},500)}function l(){e.getJSON(GATEKEEPER_URL+"authenticate/"+a,function(e){e.token!==undefined?(o=e.token,localStorage.githubToken=o,i=new Github({token:o,auth:"oauth"}),n.chain()):n.error(new Error(u))})}if(i!==undefined){n.chain();return}var o=localStorage.githubToken;if(o!==undefined){i=new Github({token:o,auth:"oauth"}),n.chain();return}t.showMessage("Please make sure the Github authorization popup is not blocked by your browser.");var u="Failed to retrieve a token from GitHub.";n.timeout=ASYNC_TASK_LONG_TIMEOUT;var a=undefined;n.chain(f)}),n.onError(function(){s!==undefined&&clearInterval(s),r!==undefined&&r.close()})}function a(e,n){var s=undefined;if(e){console.error(e);if(typeof e=="string")s=e;else{s="Could not publish on GitHub.";if(e.error===401||e.error===403){i=undefined,localStorage.removeItem("githubToken"),s="Access to GitHub account is not authorized.",n.retry(new Error(s),1);return}e.error<=0&&(r=!1,i=undefined,t.setOffline(),s="|stopPublish")}}n.error(new Error(s))}var r=undefined,i=undefined,s={};return s.upload=function(e,r,s,f,l,c){c=c||t.doNothing;var h=n.createTask();o(h),u(h),h.onRun(function(){function n(){var e=i.getUser();e.show(undefined,function(e,n){if(e){a(e,h);return}t=n.login,h.chain(o)})}function o(){var n=i.getRepo(t,e);n.write(r,s,f,l,function(e){if(e){a(e,h);return}h.chain()})}var t=undefined;h.chain(n)}),h.onSuccess(function(){c()}),h.onError(function(e){c(e)}),n.addTask(h)},s.uploadGist=function(e,r,s,f,l,c){c=c||t.doNothing;var h=n.createTask();o(h),u(h),h.onRun(function(){var t=i.getGist(e),n={};n[r]={content:l},githubFunction=t.update,e===undefined&&(githubFunction=t.create),githubFunction({description:f,"public":s,files:n},function(t,n){if(t){t.error===404&&e!==undefined&&(t="Gist "+e+" not found on GitHub.|removePublish"),a(t,h);return}e=n.id,h.chain()})}),h.onSuccess(function(){c(undefined,e)}),h.onError(function(e){c(e)}),n.addTask(h)},s.downloadGist=function(e,r,i){i=i||t.doNothing;var s=n.createTask();o(s);var u=undefined,a=undefined;s.onRun(function(){var t=new Github({}),n=t.getGist(e);n.read(function(t,n){if(t){s.error(new Error("Error trying to access Gist "+e+"."));return}u=n.description;var i=n.files[r];if(i===undefined){s.error(new Error("Gist "+e+' does not contain "'+r+'".'));return}a=i.content,s.chain()})}),s.onSuccess(function(){i(undefined,u,a)}),s.onError(function(e){i(e)}),n.addTask(s)},s}),define("gist-provider",["jquery","core","github-helper"],function(e,t,n){var r="gist",i={providerId:r,providerName:"Gist",sharingAttributes:["gistId","filename"]};return i.publish=function(e,t,r,i){n.uploadGist(e.gistId,e.filename,e.isPublic,t,r,function(t,n){if(t){i(t);return}e.gistId=n,i()})},i.newPublishAttributes=function(n){var r={};return r.gistId=e("#input-publish-gist-id").val()||undefined,r.filename=t.getInputValue(e("#input-publish-filename"),n),r.isPublic=e("#input-publish-gist-public").is(":checked"),n.isPropagationStopped()?undefined:r},i.importPublic=function(e,t){n.downloadGist(e.gistId,e.filename,t)},i}),define("sharing",["jquery","core","async-runner","download-provider","gist-provider","underscore"],function(e,t,n){function o(){if(t.isOffline===!0)return;if(!_.has(localStorage,"missingSharingLink"))return;localStorage.removeItem("missingSharingLink");var e=_.compact(localStorage["file.list"].split(";"));_.each(e,function(e){var t=localStorage[e+".sync"].split(";"),n=localStorage[e+".publish"].split(";"),i=_.compact(t.concat(n));_.each(i,function(e){var t=JSON.parse(localStorage[e]);r.createLink(t,function(n){n!==undefined&&(localStorage[e]=JSON.stringify(t))})})})}var r={},i=_.chain(arguments).map(function(e){return e&&e.providerId&&[e.providerId,e]}).compact().object().value(),s=['
      ','','',"
      "].join("");return r.refreshDocumentSharing=function(t){var n=e("#link-container .link-list").empty();e("#link-container .no-link").show(),_.each(t,function(t){if(t.sharingLink){var r=e(_.template(s,{link:t.sharingLink}));r.click(function(e){e.stopPropagation()}),n.append(r),e("#link-container .no-link").hide()}})},r.createLink=function(r,s){function f(){a===undefined&&(localStorage.missingSharingLink=!0),s(a)}var o=i[r.provider];if(r.sharingLink!==undefined||o===undefined||r.format!="markdown"){s();return}var u=n.createTask(),a=undefined;u.onRun(function(){if(t.isOffline===!0){u.chain();return}var n=[MAIN_URL,"viewer.html?provider=",r.provider];_.each(o.sharingAttributes,function(e){n.push("&"),n.push(e),n.push("="),n.push(encodeURIComponent(r[e]))}),e.getJSON("https://api-ssl.bitly.com/v3/shorten",{access_token:BITLY_ACCESS_TOKEN,longUrl:n.join("")},function(e){e.data&&(a=e.data.url,r.sharingLink=a),u.chain()})}),u.onSuccess(f),u.onError(f),n.addTask(u)},viewerMode===!1&&t.addPeriodicCallback(o),t.onReady(function(){if(viewerMode===!1)return;var n=t.getURLParameter("provider");n===undefined&&(n="download");var r=i[n];if(r===undefined)return;var s={};_.each(r.sharingAttributes,function(e){var n=t.getURLParameter(e);if(!n){s=undefined;return}s[e]=n});if(s===undefined)return;e("#wmd-preview, #file-title").hide(),r.importPublic(s,function(n,r,i){e("#wmd-preview, #file-title").show();if(n)return;var s=t.fileManager.createFile(r,i,undefined,!0);t.fileManager.selectFile(s)})}),r}),define("blogger-provider",["jquery","core","google-helper"],function(e,t,n){var r="blogger",i={providerId:r,providerName:"Blogger",defaultPublishFormat:"html",publishPreferencesInputIds:["blogger-url"]};return i.publish=function(e,t,r,i){n.uploadBlogger(e.blogUrl,e.blogId,e.postId,e.labelList,t,r,function(t,n,r){if(t){i(t);return}e.blogId=n,e.postId=r,i()})},i.newPublishAttributes=function(n){var r={},i=t.getInputValue(e("#input-publish-blogger-url"),n);i!==undefined&&(r.blogUrl=t.checkUrl(i)),r.postId=e("#input-publish-postid").val()||undefined,r.labelList=[];var s=e("#input-publish-labels").val()||undefined;return s!==undefined&&(r.labelList=_.chain(s.split(",")).map(function(e){return t.trim(e)}).compact().value()),n.isPropagationStopped()?undefined:r},i}),define("github-provider",["jquery","core","github-helper"],function(e,t,n){var r="github",i={providerId:r,providerName:"GitHub",publishPreferencesInputIds:["github-reponame","github-branch"]};return i.publish=function(e,r,i,s){var o=t.settings.commitMsg;n.upload(e.repository,e.branch,e.path,i,o,s)},i.newPublishAttributes=function(n){var r={};return r.repository=t.getInputValue(e("#input-publish-github-reponame"),n),r.branch=t.getInputValue(e("#input-publish-github-branch"),n),r.path=t.getInputValue(e("#input-publish-file-path"),n),n.isPropagationStopped()?undefined:r},i}),define("ssh-helper",["jquery","core","async-runner"],function(e,t,n){function i(e){e.onRun(function(){if(t.isOffline===!0){e.error(new Error("Operation not available in offline mode.|stopPublish"));return}e.chain()})}function s(e,n){var r=undefined;e&&(console.error(e),typeof e=="string"?r="SSH error: "+e+".":(r="Could not publish on SSH server.",e.code<=0&&(t.setOffline(),r="|stopPublish"))),n.error(new Error(r))}var r={};return r.upload=function(r,o,u,a,f,l,c,h){h=h||t.doNothing;var p=n.createTask();i(p),p.onRun(function(){var t=SSH_PROXY_URL+"upload",n={host:r,port:o,username:u,password:a,path:f,title:l,content:c};e.ajax({url:t,data:n,type:"POST",dataType:"json",timeout:AJAX_TIMEOUT}).done(function(e,t,n){if(e.error===undefined){p.chain();return}s(e.error,p)}).fail(function(e){var t={code:e.status,message:e.statusText};s(t,p)})}),p.onSuccess(function(){h()}),p.onError(function(e){h(e)}),n.addTask(p)},r}),define("ssh-provider",["jquery","core","ssh-helper"],function(e,t,n){var r="ssh",i={providerId:r,providerName:"SSH server",publishPreferencesInputIds:["ssh-host","ssh-port","ssh-username","ssh-password"]};return i.publish=function(e,t,r,i){n.upload(e.host,e.port,e.username,e.password,e.path,t,r,i)},i.newPublishAttributes=function(n){var r={};return r.host=t.getInputValue(e("#input-publish-ssh-host"),n,/^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-]*[A-Za-z0-9])$/),r.port=t.getInputIntValue(e("#input-publish-ssh-port"),undefined,0),r.username=t.getInputValue(e("#input-publish-ssh-username"),n),r.password=t.getInputValue(e("#input-publish-ssh-password"),n),r.path=t.getInputValue(e("#input-publish-file-path"),n),n.isPropagationStopped()?undefined:r},i}),define("tumblr-helper",["jquery","core","async-runner"],function(e,t,n){function s(e){e.onRun(function(){if(t.isOffline===!0){e.error(new Error("Operation not available in offline mode.|stopPublish"));return}e.chain()})}function o(n){var i=undefined,s=undefined;n.onRun(function(){function f(){e.getJSON(TUMBLR_PROXY_URL+"request_token",function(e){e.oauth_token!==undefined?(a=e,n.chain(l)):n.error(new Error(u))})}function l(){localStorage.removeItem("tumblrVerifier"),i=t.popupWindow("tumblr-oauth-client.html?oauth_token="+a.oauth_token,"stackedit-tumblr-oauth",800,600),i.focus(),s=setInterval(function(){if(i.closed===!0){clearInterval(s),i=undefined,s=undefined,a.oauth_verifier=localStorage.tumblrVerifier;if(a.oauth_verifier===undefined){n.error(new Error(u));return}localStorage.removeItem("tumblrVerifier"),n.chain(c)}},500)}function c(){e.getJSON(TUMBLR_PROXY_URL+"access_token",a,function(e){e.access_token!==undefined&&e.access_token_secret!==undefined?(localStorage.tumblrOauthParams=JSON.stringify(e),r=e,n.chain()):n.error(new Error(u))})}if(r!==undefined){n.chain();return}var o=localStorage.tumblrOauthParams;if(o!==undefined){r=JSON.parse(o),n.chain();return}t.showMessage("Please make sure the Tumblr authorization popup is not blocked by your browser.");var u="Failed to retrieve a token from Tumblr.";n.timeout=ASYNC_TASK_LONG_TIMEOUT;var a=undefined;n.chain(f)}),n.onError(function(){s!==undefined&&clearInterval(s),i!==undefined&&i.close()})}function u(e,n){var i=undefined;if(e){console.error(e);if(typeof e=="string")i=e;else{i="Could not publish on Tumblr.";if(e.code===401||e.code===403){r=undefined,localStorage.removeItem("tumblrOauthParams"),i="Access to Tumblr account is not authorized.",n.retry(new Error(i),1);return}e.code<=0&&(t.setOffline(),i="|stopPublish")}}n.error(new Error(i))}var r=undefined,i={};return i.upload=function(i,a,f,l,c,h,p){p=p||t.doNothing;var d=n.createTask();s(d),o(d),d.onRun(function(){var t=e.extend({blog_hostname:i,post_id:a,tags:f,format:l,title:c,content:h},r);e.ajax({url:TUMBLR_PROXY_URL+"post",data:t,type:"POST",dataType:"json",timeout:AJAX_TIMEOUT}).done(function(e,t,n){a=e.id,d.chain()}).fail(function(e){var t={code:e.status,message:e.statusText};t.code===404&&a!==undefined&&(t="Post "+a+" not found on Tumblr.|removePublish"),u(t,d)})}),d.onSuccess(function(){p(undefined,a)}),d.onError(function(e){p(e)}),n.addTask(d)},i}),define("tumblr-provider",["jquery","core","tumblr-helper"],function(e,t,n){var r="tumblr",i={providerId:r,providerName:"Tumblr",publishPreferencesInputIds:["tumblr-hostname"]};return i.publish=function(e,t,r,i){n.upload(e.blogHostname,e.postId,e.tags,e.format=="markdown"?"markdown":"html",t,r,function(t,n){if(t){i(t);return}e.postId=n,i()})},i.newPublishAttributes=function(n){var r={};return r.blogHostname=t.getInputValue(e("#input-publish-tumblr-hostname"),n,/^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-]*[A-Za-z0-9])$/),r.postId=e("#input-publish-postid").val()||undefined,r.tags=e("#input-publish-tags").val()||undefined,n.isPropagationStopped()?undefined:r},i}),define("wordpress-helper",["jquery","core","async-runner"],function(e,t,n){function s(e){e.onRun(function(){if(t.isOffline===!0){e.error(new Error("Operation not available in offline mode.|stopPublish"));return}e.chain()})}function o(n){var i=undefined,s=undefined;n.onRun(function(){function a(){localStorage.removeItem("wordpressCode"),i=t.popupWindow("wordpress-oauth-client.html?client_id="+WORDPRESS_CLIENT_ID,"stackedit-wordpress-oauth",960,600),i.focus(),s=setInterval(function(){if(i.closed===!0){clearInterval(s),i=undefined,s=undefined,u=localStorage.wordpressCode;if(u===undefined){n.error(new Error(o));return}localStorage.removeItem("wordpressCode"),n.chain(f)}},500)}function f(){e.getJSON(WORDPRESS_PROXY_URL+"authenticate/"+u,function(e){e.token!==undefined?(r=e.token,localStorage.wordpressToken=r,n.chain()):n.error(new Error(o))})}r=localStorage.wordpressToken;if(r!==undefined){n.chain();return}t.showMessage("Please make sure the Wordpress authorization popup is not blocked by your browser.");var o="Failed to retrieve a token from Wordpress.";n.timeout=ASYNC_TASK_LONG_TIMEOUT;var u=undefined;n.chain(a)}),n.onError(function(){s!==undefined&&clearInterval(s),i!==undefined&&i.close()})}function u(e,n){var r=undefined;if(e){console.error(e);if(typeof e=="string")r=e;else{r="Could not publish on WordPress.";if(e.code===400&&e.message=="invalid_token"||e.code===401||e.code===403){localStorage.removeItem("wordpressToken"),r="Access to WordPress account is not authorized.",n.retry(new Error(r),1);return}e.code<=0&&(t.setOffline(),r="|stopPublish")}}n.error(new Error(r))}var r=undefined,i={};return i.upload=function(i,a,f,l,c,h){h=h||t.doNothing;var p=n.createTask();s(p),o(p),p.onRun(function(){var t=WORDPRESS_PROXY_URL+"post",n={token:r,site:i,postId:a,tags:f,title:l,content:c};e.ajax({url:t,data:n,type:"POST",dataType:"json",timeout:AJAX_TIMEOUT}).done(function(e,t,n){if(e.body.ID){a=e.body.ID,p.chain();return}var r={code:e.code,message:e.body.error};r.code===404&&(r.message=="unknown_blog"?r='Site "'+i+'" not found on WordPress.|removePublish':r.message=="unknown_post"&&(r="Post "+a+" not found on WordPress.|removePublish")),u(r,p)}).fail(function(e){var t={code:e.status,message:e.statusText};u(t,p)})}),p.onSuccess(function(){h(undefined,a)}),p.onError(function(e){h(e)}),n.addTask(p)},i}),define("wordpress-provider",["jquery","core","wordpress-helper"],function(e,t,n){var r="wordpress",i={providerId:r,providerName:"WordPress",defaultPublishFormat:"html",publishPreferencesInputIds:["wordpress-site"]};return i.publish=function(e,t,r,i){n.upload(e.site,e.postId,e.tags,t,r,function(t,n){if(t){i(t);return}e.postId=n,i()})},i.newPublishAttributes=function(n){var r={};return r.site=t.getInputValue(e("#input-publish-wordpress-site"),n,/^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-]*[A-Za-z0-9])$/),r.postId=e("#input-publish-postid").val()||undefined,r.tags=e("#input-publish-tags").val()||undefined,n.isPropagationStopped()?undefined:r},i}),define("publisher",["jquery","core","sharing","blogger-provider","dropbox-provider","gist-provider","github-provider","gdrive-provider","ssh-provider","tumblr-provider","wordpress-provider","underscore"],function(e,t,n){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,n){if(u.length===0){e(n);return}var r=u.pop(),s=JSON.parse(localStorage[r]),l=o(s),c=i[s.provider];c.publish(s,a,l,function(i){if(i!==undefined){var s=i.toString();s.indexOf("|removePublish")!==-1&&(t.fileManager.removePublish(r),t.fileManager.updateFileTitles(),t.showMessage(c.providerName+" publish location has been removed."));if(s.indexOf("|stopPublish")!==-1){e(i);return}}f(e,n||i)})}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+";"}function p(n){var r=n.defaultPublishFormat||"markdown";h=n,e(".publish-provider-name").text(n.providerName),e('div[class*=" modal-publish-"]').hide().filter(".modal-publish-"+n.providerId).show(),t.resetModalInputs(),e("input:radio[name=radio-publish-format][value="+r+"]").prop("checked",!0);var i=localStorage[n.providerId+".publishPreferences"];if(i){var s=JSON.parse(i);_.each(n.publishPreferencesInputIds,function(t){e("#input-publish-"+t).val(s[t])}),e("input:radio[name=radio-publish-format][value="+s.format+"]").prop("checked",!0)}e("#modal-publish").modal()}function d(i){var s=h,u=s.newPublishAttributes(i);if(u===undefined)return;var a=t.fileManager.getCurrentFileIndex(),f=localStorage[a+".title"],l=o(u);s.publish(u,f,l,function(e){e===undefined&&(u.provider=s.providerId,n.createLink(u,function(){c(a,u),r.notifyPublish(),t.fileManager.updateFileTitles(),t.showMessage('"'+f+'" is now published on '+s.providerName+".")}))});var p={};_.each(s.publishPreferencesInputIds,function(t){p[t]=e("#input-publish-"+t).val()}),p.format=u.format,localStorage[s.providerId+".publishPreferences"]=JSON.stringify(p)}var r={},i=_.chain(arguments).map(function(e){return e&&e.providerId&&[e.providerId,e]}).compact().object().value(),s=!1;r.notifyPublish=function(){var e=t.fileManager.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")},t.addOfflineListener(r.updatePublishButton),r.applyTemplate=function(n){var r=t.fileManager.getCurrentFileIndex();try{return _.template(t.settings.template,{documentTitle:localStorage[r+".title"],documentMarkdown:e("#wmd-input").val(),documentHTML:e("#wmd-preview").html(),publishAttributes:n})}catch(i){throw t.showError(i),i}};var u=[],a=undefined,l=!1;r.publish=function(){if(l===!0||t.isOffline)return;l=!0,r.updatePublishButton();var e=t.fileManager.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.')})};var h=undefined,v=['
      ','','','',"
      "].join(""),m='';return r.refreshManagePublish=function(){var n=t.fileManager.getCurrentFileIndex(),r=_.compact(localStorage[n+".publish"].split(";"));e(".msg-no-publish, .msg-publish-list").addClass("hide");var s=e("#manage-publish-list").empty();r.length>0?e(".msg-publish-list").removeClass("hide"):e(".msg-no-publish").removeClass("hide"),_.each(r,function(n){var r=JSON.parse(localStorage[n]);r.password&&(r.password="********");var o=JSON.stringify(r).replace(/{|}|"/g,""),u=e(_.template(v,{provider:i[r.provider],publishDesc:o}));u.append(e(m).click(function(){t.fileManager.removePublish(n),t.fileManager.updateFileTitles()})),s.append(u)})},r.getPublishAttributesFromFile=function(e){var t=_.compact(localStorage[e+".publish"].split(";")),n=[];return _.each(t,function(e){var t=JSON.parse(localStorage[e]);n.push(t)}),n},t.onReady(function(){var t=e("#publish-menu");_.each(i,function(n){t.append(e("
    • ").append(e(' '+n.providerName+"").click(function(){p(n)}))),e(".action-publish-"+n.providerId).click(function(){p(n)})}),e(".action-process-publish").click(d),e(".action-force-publish").click(function(){e(this).hasClass("disabled")||r.publish()})}),r}),define("text",["module"],function(e){var t,n,r,i,s=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"],o=/^\s*<\?xml(\s)+version=[\'\"](\d)*.(\d)*[\'\"](\s)*\?>/im,u=/]*>\s*([\s\S]+)\s*<\/body>/im,a=typeof location!="undefined"&&location.href,f=a&&location.protocol&&location.protocol.replace(/\:/,""),l=a&&location.hostname,c=a&&(location.port||undefined),h=[],p=e.config&&e.config()||{};t={version:"2.0.6",strip:function(e){if(e){e=e.replace(o,"");var t=e.match(u);t&&(e=t[1])}else e="";return e},jsEscape:function(e){return e.replace(/(['\\])/g,"\\$1").replace(/[\f]/g,"\\f").replace(/[\b]/g,"\\b").replace(/[\n]/g,"\\n").replace(/[\t]/g,"\\t").replace(/[\r]/g,"\\r").replace(/[\u2028]/g,"\\u2028").replace(/[\u2029]/g,"\\u2029")},createXhr:p.createXhr||function(){var e,t,n;if(typeof XMLHttpRequest!="undefined")return new XMLHttpRequest;if(typeof ActiveXObject!="undefined")for(t=0;t<3;t+=1){n=s[t];try{e=new ActiveXObject(n)}catch(r){}if(e){s=[n];break}}return e},parseName:function(e){var t,n,r,i=!1,s=e.indexOf("."),o=e.indexOf("./")===0||e.indexOf("../")===0;return s!==-1&&(!o||s>1)?(t=e.substring(0,s),n=e.substring(s+1,e.length)):t=e,r=n||t,s=r.indexOf("!"),s!==-1&&(i=r.substring(s+1)==="strip",r=r.substring(0,s),n?n=r:t=r),{moduleName:t,ext:n,strip:i}},xdRegExp:/^((\w+)\:)?\/\/([^\/\\]+)/,useXhr:function(e,n,r,i){var s,o,u,a=t.xdRegExp.exec(e);return a?(s=a[2],o=a[3],o=o.split(":"),u=o[1],o=o[0],(!s||s===n)&&(!o||o.toLowerCase()===r.toLowerCase())&&(!u&&!o||u===i)):!0},finishLoad:function(e,n,r,i){r=n?t.strip(r):r,p.isBuild&&(h[e]=r),i(r)},load:function(e,n,r,i){if(i.isBuild&&!i.inlineText){r();return}p.isBuild=i.isBuild;var s=t.parseName(e),o=s.moduleName+(s.ext?"."+s.ext:""),u=n.toUrl(o),h=p.useXhr||t.useXhr;!a||h(u,f,l,c)?t.get(u,function(n){t.finishLoad(e,s.strip,n,r)},function(e){r.error&&r.error(e)}):n([o],function(e){t.finishLoad(s.moduleName+"."+s.ext,s.strip,e,r)})},write:function(e,n,r,i){if(h.hasOwnProperty(n)){var s=t.jsEscape(h[n]);r.asModule(e+"!"+n,"define(function () { return '"+s+"';});\n")}},writeFile:function(e,n,r,i,s){var o=t.parseName(n),u=o.ext?"."+o.ext:"",a=o.moduleName+u,f=r.toUrl(o.moduleName+u)+".js";t.load(a,r,function(n){var r=function(e){return i(f,e)};r.asModule=function(e,t){return i.asModule(e,f,t)},t.write(e,a,r,s)},s)}};if(p.env==="node"||!p.env&&typeof process!="undefined"&&process.versions&&!!process.versions.node)n=require.nodeRequire("fs"),t.get=function(e,t){var r=n.readFileSync(e,"utf8");r.indexOf("")===0&&(r=r.substring(1)),t(r)};else if(p.env==="xhr"||!p.env&&t.createXhr())t.get=function(e,n,r,i){var s=t.createXhr(),o;s.open("GET",e,!0);if(i)for(o in i)i.hasOwnProperty(o)&&s.setRequestHeader(o.toLowerCase(),i[o]);p.onXhr&&p.onXhr(s,e),s.onreadystatechange=function(t){var i,o;s.readyState===4&&(i=s.status,i>399&&i<600?(o=new Error(e+" HTTP status: "+i),o.xhr=s,r(o)):n(s.responseText),p.onXhrComplete&&p.onXhrComplete(s,e))},s.send(null)};else if(p.env==="rhino"||!p.env&&typeof Packages!="undefined"&&typeof java!="undefined")t.get=function(e,t){var n,r,i="utf-8",s=new java.io.File(e),o=java.lang.System.getProperty("line.separator"),u=new java.io.BufferedReader(new java.io.InputStreamReader(new java.io.FileInputStream(s),i)),a="";try{n=new java.lang.StringBuffer,r=u.readLine(),r&&r.length()&&r.charAt(0)===65279&&(r=r.substring(1)),n.append(r);while((r=u.readLine())!==null)n.append(o),n.append(r);a=String(n.toString())}finally{u.close()}t(a)};else if(p.env==="xpconnect"||!p.env&&typeof Components!="undefined"&&Components.classes&&Components.interfaces)r=Components.classes,i=Components.interfaces,Components.utils["import"]("resource://gre/modules/FileUtils.jsm"),t.get=function(e,t){var n,s,o={},u=new FileUtils.File(e);try{n=r["@mozilla.org/network/file-input-stream;1"].createInstance(i.nsIFileInputStream),n.init(u,1,0,!1),s=r["@mozilla.org/intl/converter-input-stream;1"].createInstance(i.nsIConverterInputStream),s.init(n,"utf-8",n.available(),i.nsIConverterInputStream.DEFAULT_REPLACEMENT_CHARACTER),s.readString(n.available(),o),s.close(),n.close(),t(o.value)}catch(a){throw new Error((u&&u.path||"")+": "+a)}};return t}),define("text!../WELCOME.md",[],function(){return'\r\nWelcome to StackEdit! {#welcome}\r\n=====================\r\n\r\n\r\nHello, I am your first Markdown document within **StackEdit**. Don\'t delete me, I can be helpful. I can be recovered anyway in the `Utils` tab of the `Settings` dialog.\r\n\r\n----------\r\n\r\n\r\nDocuments\r\n---------\r\n\r\n**StackEdit** stores your documents in the browser local storage, which means all your documents are automatically saved locally and are accessible offline.\r\n\r\n#### Create a document\r\n\r\nYou can create a new document by clicking the button in the navigation bar. This will switch from the current document to the new one.\r\n\r\n#### Switch to another document\r\n\r\nYou can list all your local documents and switch from one to another by clicking the button in the navigation bar.\r\n\r\n#### Rename a document\r\n\r\nYou can rename the current document by clicking the document title in the navigation bar.\r\n\r\n#### Delete a document\r\n\r\nYou can delete the current document by clicking the button in the navigation bar.\r\n\r\n----------\r\n\r\n\r\nSynchronization\r\n---------------\r\n\r\n**StackEdit** can be combined with **Google Drive** and **Dropbox** to have your documents centralized in the *Cloud*. The synchronization mechanism will take care of uploading your modifications or downloading the latest version of your documents.\r\n\r\n#### Import a document\r\n\r\nYou can import a document from the *Cloud* by going to the `Google Drive` or the `Dropbox` sub-menu and by clicking `Import from...`. Once imported, your document will be automatically synchronized with the **Google Drive** / **Dropbox** file.\r\n\r\n#### Export a document\r\n\r\nYou can export any document by going to the `Google Drive` or the `Dropbox` sub-menu and by clicking `Export to...`. Even if your document is already synchronized with **Google Drive** or **Dropbox**, you can export it to a another location. **StackEdit** can synchronize one document with multiple locations.\r\n\r\n#### Synchronize a document\r\n\r\nOnce your document is linked to a **Google Drive** or a **Dropbox** file, **StackEdit** will periodically (every 3 minutes) synchronize it by downloading/uploading any modification. Any conflict will be detected, and a local copy of your document will be created as a backup if necessary.\r\n\r\nIf you just have modified your document and you want to force the synchronization, click the button in the navigation bar.\r\n\r\n> **NOTE:** The button is disabled when:\r\n> \r\n> - you are offline,\r\n> - or the document is not synchronized with any location,\r\n> - or the document has not been modified since the last synchronization.\r\n\r\n#### Manage document synchronization\r\n\r\nSince one document can be synchronized with multiple locations, you can list and manage synchronized locations by clicking `Manage synchronization` in the menu. This will open a dialog box allowing you to add or remove synchronization links that are associated to your document.\r\n\r\n> **NOTE:** If you delete the file from **Google Drive** or from **Dropbox**, the document will no longer be synchronized with that location.\r\n\r\n----------\r\n\r\n\r\nPublication\r\n-----------\r\n\r\nOnce you are happy with your document, you can publish it on different websites directly from **StackEdit**. As for now, **StackEdit** can publish on **Blogger**, **Dropbox**, **Gist**, **GitHub**, **Google Drive**, **Tumblr**, **WordPress** and on any SSH server.\r\n\r\n#### Publish a document\r\n\r\nYou can publish your document by going to the `Publish on` sub-menu and by choosing a website. In the dialog box, you can choose the publication format:\r\n\r\n- Markdown, to publish the Markdown text on a website that can interpret it (**GitHub** for instance),\r\n- HTML, to publish the document converted into HTML (on a blog for instance),\r\n- Template, to have a full control of the output.\r\n\r\n> **NOTE:** The default template is a simple webpage that wraps your document in HTML format. You can customize it in the `Publish` tab of the `Settings` dialog.\r\n\r\n#### Update a publication\r\n\r\nAfter publishing, **StackEdit** will keep your document linked to that publish location so that you can update it easily. Once you have modified your document and you want to update your publication, click on the button in the navigation bar.\r\n\r\n> **NOTE:** The button is disabled when:\r\n> \r\n> - you are offline,\r\n> - or the document has not been published anywhere.\r\n\r\n#### Manage document publication\r\n\r\nSince one document can be published on multiple locations, you can list and manage publish locations by clicking `Manage publication` in the menu. This will open a dialog box allowing you to remove publication links that are associated to your document.\r\n\r\n> **NOTE:** In some cases, if you remove the file from the website or the post from the blog, the document will no longer be published on that location.\r\n\r\n----------\r\n\r\n\r\nMarkdown Extra\r\n--------------\r\n\r\n**StackEdit** supports **Markdown Extra**, which extends **Markdown** syntax with some nice features.\r\n\r\n\r\n### Tables\r\n\r\n**Markdown Extra** has a special syntax for tables:\r\n\r\nItem | Value\r\n--------- | -----\r\nComputer | \\$1600\r\nPhone | \\$12\r\nPipe | \\$1\r\n\r\nYou can specify column alignment with one or two colons:\r\n\r\n| Item | Value | Qty |\r\n| :-------- | ------:| :--: |\r\n| Computer | \\$1600 | 5 |\r\n| Phone | \\$12 | 12 |\r\n| Pipe | \\$1 | 234 |\r\n\r\n\r\n### Definition Lists\r\n\r\n**Markdown Extra** has a special syntax for definition lists too:\r\n\r\nTerm 1\r\nTerm 2\r\n: Definition A\r\n: Definition B\r\n\r\nTerm 3\r\n\r\n: Definition C\r\n\r\n: Definition D\r\n\r\n > part of definition D\r\n\r\n\r\n### Fenced code blocks\r\n\r\n**GitHub**\'s fenced code blocks are also supported with **Prettify** syntax highlighting:\r\n\r\n```\r\n// Foo\r\nvar bar = 0;\r\n```\r\n\r\n\r\n### Special Attributes\r\n\r\nWith **Markdown Extra**, you can specify `class` and `id` attributes on headers and fenced code blocks just like this:\r\n\r\n##### Header example {#my-header}\r\n\r\n``` {#my-id .my-class}\r\nvar foo = bar;\r\n```\r\n\r\nThen you can create cross-references like this: [beginning of the document](#welcome).\r\n\r\n\r\n### MathJax\r\n \r\nYou can include **LaTex** expressions to render mathematical formulas using **MathJax**, as on [math.stackexchange.com][1]:\r\n\r\nThe *Gamma function* satisfying $\\Gamma(n) = (n-1)!\\quad\\forall\r\nn\\in\\mathbb N$ is via through the Euler integral\r\n\r\n$$\r\n\\Gamma(z) = \\int_0^\\infty t^{z-1}e^{-t}dt\\,.\r\n$$\r\n\r\n\r\n> **NOTE:** You can find more information:\r\n>\r\n> - about **Markdown** syntax [here][2],\r\n> - about **Markdown Extra** extension [here][3],\r\n> - about **Prettify** syntax highlighting [here][4],\r\n> - about **Latex** mathematical expressions [here][5].\r\n\r\n----------\r\n\r\n\r\n [1]: http://math.stackexchange.com/\r\n [2]: http://daringfireball.net/projects/markdown/syntax "Markdown"\r\n [3]: http://michelf.ca/projects/php-markdown/extra/ "Markdown Extra"\r\n [4]: https://code.google.com/p/google-code-prettify/\r\n [5]: http://en.wikibooks.org/wiki/LaTeX/Mathematics'}),define("file-manager",["jquery","core","synchronizer","publisher","sharing","text!../WELCOME.md","underscore"],function(e,t,n,r,i,s){function l(t){var n=e("#file-selector li:not(.stick)");n.show();if(t){var r=t.toLowerCase().split(/\s+/);n.each(function(){var t=e(this).text().toLowerCase();_.some(r,function(e){return t.indexOf(e)===-1})&&e(this).hide()})}}var o="file.tempIndex",u={},a=localStorage["file.current"];u.getCurrentFileIndex=function(){return a},u.isCurrentFileIndex=function(e){return e==a},u.setCurrentFileIndex=function(e){a=e,e===undefined?localStorage.removeItem("file.current"):e!=o&&(localStorage["file.current"]=e)};var f=[];return u.selectFile=function(i){localStorage["file.list"].length===1&&(i=u.createFile(WELCOME_DOCUMENT_TITLE,s)),i!==undefined&&u.setCurrentFileIndex(i),u.updateFileTitles(),n.refreshManageSync(),r.notifyPublish(),i==o?e(".action-edit-document").removeClass("hide"):e(".action-edit-document").addClass("hide"),i=u.getCurrentFileIndex(),e("#wmd-input").val(localStorage[i+".content"]),t.createEditor(function(){u.saveFile()})},u.createFile=function(e,n,r,i){n=n!==undefined?n:t.settings.defaultContent,r=r||[];if(!e){e=DEFAULT_FILE_TITLE;var s=2;while(_.some(f,function(t){return t.title==e}))e=DEFAULT_FILE_TITLE+s++}var u=o;if(!i)do u="file."+t.randomString();while(_.has(localStorage,u+".title"));localStorage[u+".content"]=n,localStorage[u+".title"]=e;var a=_.reduce(r,function(e,t){return e+t+";"},";");return localStorage[u+".sync"]=a,localStorage[u+".publish"]=";",i||(localStorage["file.list"]+=u+";"),u},u.deleteFile=function(e){e=e||u.getCurrentFileIndex(),u.isCurrentFileIndex(e)&&u.setCurrentFileIndex();var t=_.compact(localStorage[e+".sync"].split(";"));_.each(t,function(e){u.removeSync(e)});var n=_.compact(localStorage[e+".publish"].split(";"));_.each(n,function(e){u.removePublish(e)}),localStorage["file.list"]=localStorage["file.list"].replace(";"+e+";",";"),localStorage.removeItem(e+".title"),localStorage.removeItem(e+".content"),localStorage.removeItem(e+".sync"),localStorage.removeItem(e+".publish")},u.saveFile=function(){var t=e("#wmd-input").val(),r=u.getCurrentFileIndex();localStorage[r+".content"]=t,n.notifyChange(r)},u.updateFileTitles=function(){function o(e,t){var s=[],o=n.getSyncAttributesFromFile(e),u=r.getPublishAttributesFromFile(e),a=o.concat(u);return t===!0&&i.refreshDocumentSharing(a),_.chain(a).sortBy(function(e){return e.provider}).each(function(e){s.push('')}),s.push(" "),s.push(localStorage[e+".title"]),s.join("")}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 s=u.getCurrentFileIndex();s===undefined&&(s=f[0].index,u.setCurrentFileIndex(s)),n.resetSyncFlags();var a=localStorage[s+".title"];document.title="StackEdit - "+a,e("#file-title").html(o(s,!0)),e(".file-title").text(a),e("#file-title-input").val(a),e("#file-selector li:not(.stick)").empty(),_.each(f,function(t){var n=e("").html(o(t.index)),r=e("
    • ").append(n);t.index==s?r.addClass("disabled"):n.prop("href","#").click(function(e){return function(){u.selectFile(e)}}(t.index)),e("#file-selector").append(r)}),t.layoutRefresh()},u.removeSync=function(e){var t=u.getFileIndexFromSync(e);t!==undefined&&(localStorage[t+".sync"]=localStorage[t+".sync"].replace(";"+e+";",";"),u.isCurrentFileIndex(t)&&n.refreshManageSync()),localStorage.removeItem(e)},u.getFileIndexFromSync=function(e){return _.chain(localStorage["file.list"].split(";")).compact().find(function(t){var n=localStorage[t+".sync"];return n.indexOf(";"+e+";")!==-1}).value()},u.removePublish=function(e){var t=u.getFileIndexFromPublish(e);t!==undefined&&(localStorage[t+".publish"]=localStorage[t+".publish"].replace(";"+e+";",";"),u.isCurrentFileIndex(t)&&r.notifyPublish()),localStorage.removeItem(e)},u.getFileIndexFromPublish=function(e){return _.chain(localStorage["file.list"].split(";")).compact().find(function(t){var n=localStorage[t+".publish"];return n.indexOf(";"+e+";")!==-1}).value()},t.onReady(function(){function n(n){var r=e.trim(n.val()),i=u.getCurrentFileIndex()+".title";r&&r!=localStorage[i]&&(localStorage[i]=r,u.updateFileTitles(),u.saveFile()),n.hide().val(localStorage[i]),e("#file-title").show(),t.layoutRefresh(),e("#wmd-input").focus()}u.selectFile(),e(".action-create-file").click(function(){var t=u.createFile();u.selectFile(t);var n=e("#wmd-input").focus().get(0);n.setSelectionRange&&n.setSelectionRange(0,0),e("#file-title").click()}),e(".action-remove-file").click(function(){u.deleteFile(),u.selectFile()}),e("#file-title").click(function(){if(viewerMode===!0)return;e(this).hide();var t=e("#file-title-input").show();_.defer(function(){t.focus().get(0).select()})}),e("#file-title-input").blur(function(){n(e(this))}).keyup(function(t){t.keyCode==13&&n(e(this)),t.keyCode==27&&(e(this).val(""),n(e(this)))}),e(".action-open-file").click(function(){l(),_.defer(function(){e("#file-search").val("").focus()})}),e("#file-search").keyup(function(){l(e(this).val())}).click(function(e){e.stopPropagation()}),e(".action-open-stackedit").click(function(){window.location.href="."}),e(".action-edit-document").click(function(){var t=e("#wmd-input").val(),n=localStorage[u.getCurrentFileIndex()+".title"],r=u.createFile(n,t);u.selectFile(r),window.location.href="."}),e(".action-download-md").click(function(){var n=e("#wmd-input").val(),r=localStorage[u.getCurrentFileIndex()+".title"];t.saveFile(n,r+".md")}),e(".action-download-html").click(function(){var n=e("#wmd-preview").html(),r=localStorage[u.getCurrentFileIndex()+".title"];t.saveFile(n,r+".html")}),e(".action-download-template").click(function(){var e=r.applyTemplate(),n=localStorage[u.getCurrentFileIndex()+".title"];t.saveFile(e,n+".txt")}),e(".action-welcome-file").click(function(){var e=u.createFile(WELCOME_DOCUMENT_TITLE,s);u.selectFile(e)})}),t.setFileManager(u),u}),requirejs.config({waitSeconds:0,paths:{MathJax:"../lib/MathJax/MathJax.js?config=TeX-AMS_HTML"},shim:{"jquery-ui":["jquery"],bootstrap:["jquery"],jgrowl:["jquery"],layout:["jquery-ui"],"Markdown.Extra":["Markdown.Converter","prettify"],"Markdown.Editor":["Markdown.Extra"]}}),require(["jquery","file-manager","synchronizer","publisher"],function(e){e(function(){window.applicationCache&&window.applicationCache.addEventListener("updateready",function(e){window.applicationCache.status===window.applicationCache.UPDATEREADY&&(window.applicationCache.swapCache(),window.location.reload())},!1)})}),define("main",function(){});