/*! * 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/ */ // > (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 */ /** * 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 */ // Copyright (C) 2006 Google Inc. // http://www.apache.org/licenses/LICENSE-2.0 /* 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 */ /* =================================================== * 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. * ========================================================== */ /* * waitForImages 1.4.2 * ------------------- * Provides a callback when all images have loaded in your given selector. * https://github.com/alexanderdickson/waitForImages * * Copyright (c) 2013 Alex Dickson * Licensed under the MIT license. */ /*! 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 */ /** * @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),function(){var e=this,t=e._,n={},r=Array.prototype,i=Object.prototype,s=Function.prototype,o=r.push,u=r.slice,a=r.concat,f=i.toString,l=i.hasOwnProperty,c=r.forEach,h=r.map,p=r.reduce,d=r.reduceRight,v=r.filter,m=r.every,g=r.some,y=r.indexOf,b=r.lastIndexOf,w=Array.isArray,E=Object.keys,S=s.bind,x=function(e){if(e instanceof x)return e;if(!(this instanceof x))return new x(e);this._wrapped=e};typeof exports!="undefined"?(typeof module!="undefined"&&module.exports&&(exports=module.exports=x),exports._=x):e._=x,x.VERSION="1.4.4";var T=x.each=x.forEach=function(e,t,r){if(e==null)return;if(c&&e.forEach===c)e.forEach(t,r);else if(e.length===+e.length){for(var i=0,s=e.length;i2;e==null&&(e=[]);if(p&&e.reduce===p)return r&&(t=x.bind(t,r)),i?e.reduce(t,n):e.reduce(t);T(e,function(e,s,o){i?n=t.call(r,n,e,s,o):(n=e,i=!0)});if(!i)throw new TypeError(N);return n},x.reduceRight=x.foldr=function(e,t,n,r){var i=arguments.length>2;e==null&&(e=[]);if(d&&e.reduceRight===d)return r&&(t=x.bind(t,r)),i?e.reduceRight(t,n):e.reduceRight(t);var s=e.length;if(s!==+s){var o=x.keys(e);s=o.length}T(e,function(u,a,f){a=o?o[--s]:--s,i?n=t.call(r,n,e[a],a,f):(n=e[a],i=!0)});if(!i)throw new TypeError(N);return n},x.find=x.detect=function(e,t,n){var r;return C(e,function(e,i,s){if(t.call(n,e,i,s))return r=e,!0}),r},x.filter=x.select=function(e,t,n){var r=[];return e==null?r:v&&e.filter===v?e.filter(t,n):(T(e,function(e,i,s){t.call(n,e,i,s)&&(r[r.length]=e)}),r)},x.reject=function(e,t,n){return x.filter(e,function(e,r,i){return!t.call(n,e,r,i)},n)},x.every=x.all=function(e,t,r){t||(t=x.identity);var i=!0;return e==null?i:m&&e.every===m?e.every(t,r):(T(e,function(e,s,o){if(!(i=i&&t.call(r,e,s,o)))return n}),!!i)};var C=x.some=x.any=function(e,t,r){t||(t=x.identity);var i=!1;return e==null?i:g&&e.some===g?e.some(t,r):(T(e,function(e,s,o){if(i||(i=t.call(r,e,s,o)))return n}),!!i)};x.contains=x.include=function(e,t){return e==null?!1:y&&e.indexOf===y?e.indexOf(t)!=-1:C(e,function(e){return e===t})},x.invoke=function(e,t){var n=u.call(arguments,2),r=x.isFunction(t);return x.map(e,function(e){return(r?t:e[t]).apply(e,n)})},x.pluck=function(e,t){return x.map(e,function(e){return e[t]})},x.where=function(e,t,n){return x.isEmpty(t)?n?null:[]:x[n?"find":"filter"](e,function(e){for(var n in t)if(t[n]!==e[n])return!1;return!0})},x.findWhere=function(e,t){return x.where(e,t,!0)},x.max=function(e,t,n){if(!t&&x.isArray(e)&&e[0]===+e[0]&&e.length<65535)return Math.max.apply(Math,e);if(!t&&x.isEmpty(e))return-Infinity;var r={computed:-Infinity,value:-Infinity};return T(e,function(e,i,s){var o=t?t.call(n,e,i,s):e;o>=r.computed&&(r={value:e,computed:o})}),r.value},x.min=function(e,t,n){if(!t&&x.isArray(e)&&e[0]===+e[0]&&e.length<65535)return Math.min.apply(Math,e);if(!t&&x.isEmpty(e))return Infinity;var r={computed:Infinity,value:Infinity};return T(e,function(e,i,s){var o=t?t.call(n,e,i,s):e;or||n===void 0)return 1;if(n>>1;n.call(r,e[u])=0})})},x.difference=function(e){var t=a.apply(r,u.call(arguments,1));return x.filter(e,function(e){return!x.contains(t,e)})},x.zip=function(){var e=u.call(arguments),t=x.max(x.pluck(e,"length")),n=new Array(t);for(var r=0;r=0;n--)t=[e[n].apply(this,t)];return t[0]}},x.after=function(e,t){return e<=0?t():function(){if(--e<1)return t.apply(this,arguments)}},x.keys=E||function(e){if(e!==Object(e))throw new TypeError("Invalid object");var t=[];for(var n in e)x.has(e,n)&&(t[t.length]=n);return t},x.values=function(e){var t=[];for(var n in e)x.has(e,n)&&t.push(e[n]);return t},x.pairs=function(e){var t=[];for(var n in e)x.has(e,n)&&t.push([n,e[n]]);return t},x.invert=function(e){var t={};for(var n in e)x.has(e,n)&&(t[e[n]]=n);return t},x.functions=x.methods=function(e){var t=[];for(var n in e)x.isFunction(e[n])&&t.push(n);return t.sort()},x.extend=function(e){return T(u.call(arguments,1),function(t){if(t)for(var n in t)e[n]=t[n]}),e},x.pick=function(e){var t={},n=a.apply(r,u.call(arguments,1));return T(n,function(n){n in e&&(t[n]=e[n])}),t},x.omit=function(e){var t={},n=a.apply(r,u.call(arguments,1));for(var i in e)x.contains(n,i)||(t[i]=e[i]);return t},x.defaults=function(e){return T(u.call(arguments,1),function(t){if(t)for(var n in t)e[n]==null&&(e[n]=t[n])}),e},x.clone=function(e){return x.isObject(e)?x.isArray(e)?e.slice():x.extend({},e):e},x.tap=function(e,t){return t(e),e};var O=function(e,t,n,r){if(e===t)return e!==0||1/e==1/t;if(e==null||t==null)return e===t;e instanceof x&&(e=e._wrapped),t instanceof x&&(t=t._wrapped);var i=f.call(e);if(i!=f.call(t))return!1;switch(i){case"[object String]":return e==String(t);case"[object Number]":return e!=+e?t!=+t:e==0?1/e==1/t:e==+t;case"[object Date]":case"[object Boolean]":return+e==+t;case"[object RegExp]":return e.source==t.source&&e.global==t.global&&e.multiline==t.multiline&&e.ignoreCase==t.ignoreCase}if(typeof e!="object"||typeof t!="object")return!1;var s=n.length;while(s--)if(n[s]==e)return r[s]==t;n.push(e),r.push(t);var o=0,u=!0;if(i=="[object Array]"){o=e.length,u=o==t.length;if(u)while(o--)if(!(u=O(e[o],t[o],n,r)))break}else{var a=e.constructor,l=t.constructor;if(a!==l&&!(x.isFunction(a)&&a instanceof a&&x.isFunction(l)&&l instanceof l))return!1;for(var c in e)if(x.has(e,c)){o++;if(!(u=x.has(t,c)&&O(e[c],t[c],n,r)))break}if(u){for(c in t)if(x.has(t,c)&&!(o--))break;u=!o}}return n.pop(),r.pop(),u};x.isEqual=function(e,t){return O(e,t,[],[])},x.isEmpty=function(e){if(e==null)return!0;if(x.isArray(e)||x.isString(e))return e.length===0;for(var t in e)if(x.has(e,t))return!1;return!0},x.isElement=function(e){return!!e&&e.nodeType===1},x.isArray=w||function(e){return f.call(e)=="[object Array]"},x.isObject=function(e){return e===Object(e)},T(["Arguments","Function","String","Number","Date","RegExp"],function(e){x["is"+e]=function(t){return f.call(t)=="[object "+e+"]"}}),x.isArguments(arguments)||(x.isArguments=function(e){return!!e&&!!x.has(e,"callee")}),typeof /./!="function"&&(x.isFunction=function(e){return typeof e=="function"}),x.isFinite=function(e){return isFinite(e)&&!isNaN(parseFloat(e))},x.isNaN=function(e){return x.isNumber(e)&&e!=+e},x.isBoolean=function(e){return e===!0||e===!1||f.call(e)=="[object Boolean]"},x.isNull=function(e){return e===null},x.isUndefined=function(e){return e===void 0},x.has=function(e,t){return l.call(e,t)},x.noConflict=function(){return e._=t,this},x.identity=function(e){return e},x.times=function(e,t,n){var r=Array(e);for(var i=0;i":">",'"':""","'":"'","/":"/"}};M.unescape=x.invert(M.escape);var _={escape:new RegExp("["+x.keys(M.escape).join("")+"]","g"),unescape:new RegExp("("+x.keys(M.unescape).join("|")+")","g")};x.each(["escape","unescape"],function(e){x[e]=function(t){return t==null?"":(""+t).replace(_[e],function(t){return M[e][t]})}}),x.result=function(e,t){if(e==null)return null;var n=e[t];return x.isFunction(n)?n.call(e):n},x.mixin=function(e){T(x.functions(e),function(t){var n=x[t]=e[t];x.prototype[t]=function(){var e=[this._wrapped];return o.apply(e,arguments),j.call(this,n.apply(x,e))}})};var D=0;x.uniqueId=function(e){var t=++D+"";return e?e+t:t},x.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var P=/(.)^/,H={"'":"'","\\":"\\","\r":"r","\n":"n"," ":"t","\u2028":"u2028","\u2029":"u2029"},B=/\\|'|\r|\n|\t|\u2028|\u2029/g;x.template=function(e,t,n){var r;n=x.defaults({},n,x.templateSettings);var i=new RegExp([(n.escape||P).source,(n.interpolate||P).source,(n.evaluate||P).source].join("|")+"|$","g"),s=0,o="__p+='";e.replace(i,function(t,n,r,i,u){return o+=e.slice(s,u).replace(B,function(e){return"\\"+H[e]}),n&&(o+="'+\n((__t=("+n+"))==null?'':_.escape(__t))+\n'"),r&&(o+="'+\n((__t=("+r+"))==null?'':__t)+\n'"),i&&(o+="';\n"+i+"\n__p+='"),s=u+t.length,t}),o+="';\n",n.variable||(o="with(obj||{}){\n"+o+"}\n"),o="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+o+"return __p;\n";try{r=new Function(n.variable||"obj","_",o)}catch(u){throw u.source=o,u}if(t)return r(t,x);var a=function(e){return r.call(this,e,x)};return a.source="function("+(n.variable||"obj")+"){\n"+o+"}",a},x.chain=function(e){return x(e).chain()};var j=function(e){return this._chain?x(e).chain():e};x.mixin(x),T(["pop","push","reverse","shift","sort","splice","unshift"],function(e){var t=r[e];x.prototype[e]=function(){var n=this._wrapped;return t.apply(n,arguments),(e=="shift"||e=="splice")&&n.length===0&&delete n[0],j.call(this,n)}}),T(["concat","join","slice"],function(e){var t=r[e];x.prototype[e]=function(){return j.call(this,t.apply(this._wrapped,arguments))}}),x.extend(x.prototype,{chain:function(){return this._chain=!0,this},value:function(){return this._wrapped}})}.call(this),define("underscore",function(e){return function(){var t,n;return t||e._}}(this));var saveAs=saveAs||navigator.msSaveBlob&&navigator.msSaveBlob.bind(navigator)||function(e){try{var t=e.document,n=function(){return e.URL||e.webkitURL||e},r=e.URL||e.webkitURL||e,i=t.createElementNS("http://www.w3.org/1999/xhtml","a"),s="download"in i,o=function(n){var r=t.createEvent("MouseEvents");r.initMouseEvent("click",!0,!1,e,0,0,0,0,0,!1,!1,!1,!1,0,null),n.dispatchEvent(r)},u=e.webkitRequestFileSystem,a=e.requestFileSystem||u||e.mozRequestFileSystem,f=function(t){(e.setImmediate||e.setTimeout)(function(){throw t},0)},l="application/octet-stream",c=0,h=[],p=function(){var e=h.length;while(e--){var t=h[e];typeof t=="string"?r.revokeObjectURL(t):t.remove()}h.length=0},d=function(e,t,n){t=[].concat(t);var r=t.length;while(r--){var i=e["on"+t[r]];if(typeof i=="function")try{i.call(e,n||e)}catch(s){f(s)}}},v=function(t,r){var f=this,p=t.type,v=!1,m,g,y=function(){var e=n().createObjectURL(t);return h.push(e),e},b=function(){d(f,"writestart progress write writeend".split(" "))},w=function(){if(v||!m)m=y(t);g&&(g.location.href=m),f.readyState=f.DONE,b()},E=function(e){return function(){if(f.readyState!==f.DONE)return e.apply(this,arguments)}},S={create:!0,exclusive:!1},x;f.readyState=f.INIT,r||(r="download");if(s){m=y(t),i.href=m,i.download=r,o(i),f.readyState=f.DONE,b();return}e.chrome&&p&&p!==l&&(x=t.slice||t.webkitSlice,t=x.call(t,0,t.size,l),v=!0),u&&r!=="download"&&(r+=".download"),p===l||u?g=e:g=e.open();if(!a){w();return}c+=t.size,a(e.TEMPORARY,c,E(function(e){e.root.getDirectory("saved",S,E(function(e){var n=function(){e.getFile(r,S,E(function(e){e.createWriter(E(function(n){n.onwriteend=function(t){g.location.href=e.toURL(),h.push(e),f.readyState=f.DONE,d(f,"writeend",t)},n.onerror=function(){var e=n.error;e.code!==e.ABORT_ERR&&w()},"writestart progress write abort".split(" ").forEach(function(e){n["on"+e]=f["on"+e]}),n.write(t),f.abort=function(){n.abort(),f.readyState=f.DONE},f.readyState=f.WRITING}),w)}),w)};e.getFile(r,{create:!1},E(function(e){e.remove(),n()}),E(function(e){e.code===e.NOT_FOUND_ERR?n():w()}))}),w)}),w)},m=v.prototype,g=function(e,t){return new v(e,t)};return m.abort=function(){var e=this;e.readyState=e.DONE,d(e,"abort")},m.readyState=m.INIT=0,m.WRITING=1,m.DONE=2,m.error=m.onwritestart=m.onprogress=m.onwrite=m.onabort=m.onerror=m.onwriteend=null,e.addEventListener("unload",p,!1),g}catch(y){return undefined}}(self);define("libs/FileSaver",function(){}),define("utils",["jquery","underscore","libs/FileSaver"],function(e,t){function r(n){return t.isString(n)?e(n):n}function i(e,t){t!==undefined&&(e.stop(!0,!0).addClass("error").delay(1e3).switchClass("error"),t.stopPropagation())}var n={};n.getURLParameter=function(e){var t=new RegExp(e+"=(.+?)(&|$)");try{return decodeURIComponent(t.exec(location.search)[1])}catch(n){return undefined}},n.getInputValue=function(e){return e=r(e),e.val()},n.setInputValue=function(e,t){e=r(e),e.val(t)},n.getInputTextValue=function(e,t,s){e=r(e);var o=e.val();return o===undefined?(i(e,t),undefined):(o=n.trim(o),o.length===0||s!==undefined&&!o.match(s)?(i(e,t),undefined):o)},n.getInputIntValue=function(e,t,s,o){e=r(e);var u=n.getInputTextValue(e,t);return u===undefined?undefined:(u=parseInt(u),u===NaN||s!==undefined&&uo?(i(e,t),undefined):u)},n.getInputRegExpValue=function(e,t){e=r(e);var s=n.getInputTextValue(e,t);if(s===undefined)return undefined;try{new RegExp(s)}catch(o){return i(e,t),undefined}return s},n.getInputChecked=function(e){return e=r(e),e.prop("checked")},n.setInputChecked=function(e,t){e=r(e),e.prop("checked",t)},n.getInputRadio=function(t){return e("input:radio[name="+t+"]:checked").prop("value")},n.setInputRadio=function(t,n){e("input:radio[name="+t+"][value="+n+"]").prop("checked",!0)},n.resetModalInputs=function(){e(".modal input[type=text]:not([disabled]), .modal input[type=password]").val("")},n.trim=function(t){return e.trim(t)},n.slugify=function(e){return e.toLowerCase().replace(/\s+/g,"-").replace(/[^\w\-]+/g,"").replace(/\-\-+/g,"-").replace(/^-+/,"").replace(/-+$/,"")},n.checkUrl=function(e,t){return e?(e.indexOf("http")!==0&&(e="http://"+e),t&&e.indexOf("/",e.length-1)===-1&&(e+="/"),e):e},n.popupWindow=function(e,t,n,r){var i=screen.width/2-n/2,s=screen.height/2-r/2;return window.open(e,t,["toolbar=no, ","location=no, ","directories=no, ","status=no, ","menubar=no, ","scrollbars=no, ","resizable=no, ","copyhistory=no, ","width="+n+", ","height="+r+", ","top="+s+", ","left="+i].join(""))},n.saveAs=function(e,t){if(saveAs!==undefined){var r=new Blob([e],{type:"text/plain;charset=utf-8"});saveAs(r,t)}else{var i="data:application/octet-stream;base64,"+n.encodeBase64(e);window.open(i,"file")}},n.randomString=function(){return t.random(4294967296).toString(36)},n.updateCurrentTime=function(){n.currentTime=(new Date).getTime()},n.updateCurrentTime(),n.storeAttributes=function(e){var n=e.syncIndex||e.publishIndex;e=t.omit(e,"syncIndex","publishIndex"),e.provider=e.provider.providerId,localStorage[n]=JSON.stringify(e)},n.encodeBase64=function(e){if(e.length===0)return"";var t=[],n=0,r,i;e=encodeURI(e),r=e.length;while(n>18)),f.push(o.charAt(a>>12&63)),f.push(o.charAt(a>>6&63)),f.push(o.charAt(a&63));switch(t.length-l){case 1:a=t[u]<<16,f.push(o.charAt(a>>18)+o.charAt(a>>12&63)+s+s);break;case 2:a=t[u]<<16|t[u+1]<<8,f.push(o.charAt(a>>18)+o.charAt(a>>12&63)+o.charAt(a>>6&63)+s)}return f.join("")};var s=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117];return n.crc32=function(e){var t=0,n=-1;for(var r=0;r>>8^s[t];return n^=-1,n<0&&(n=4294967295+n+1),n.toString(16)},n});var MAIN_URL="http://benweet.github.io/stackedit/",GOOGLE_API_KEY="AIzaSyAeCU8CGcSkn0z9js6iocHuPBX4f_mMWkw",GOOGLE_SCOPES=["https://www.googleapis.com/auth/drive.install","https://www.googleapis.com/auth/drive","https://www.googleapis.com/auth/blogger"],GOOGLE_DRIVE_APP_ID="241271498917",DROPBOX_APP_KEY="lq6mwopab8wskas",DROPBOX_APP_SECRET="851fgnucpezy84t",BITLY_ACCESS_TOKEN="317e033bfd48cf31155a68a536b1860013b09c4c",DEFAULT_FILE_TITLE="Title",GDRIVE_DEFAULT_FILE_TITLE="New Markdown document",CHECK_ONLINE_PERIOD=12e4,AJAX_TIMEOUT=3e4,ASYNC_TASK_DEFAULT_TIMEOUT=6e4,ASYNC_TASK_LONG_TIMEOUT=18e4,SYNC_PERIOD=18e4,USER_IDLE_THRESHOLD=3e5,TEMPORARY_FILE_INDEX="file.tempIndex",WELCOME_DOCUMENT_TITLE="Welcome document",DOWNLOAD_PROXY_URL="http://stackedit-download-proxy.herokuapp.com/",WORDPRESS_CLIENT_ID="3185",WORDPRESS_PROXY_URL="http://stackedit-wordpress-proxy.herokuapp.com/",SSH_PROXY_URL="http://stackedit-ssh-proxy.herokuapp.com/",delayedFunction=undefined,BASE_URL="http://localhost/",GOOGLE_CLIENT_ID="241271498917-lev37kef013q85avc91am1gccg5g8lrb.apps.googleusercontent.com",GITHUB_CLIENT_ID="e47fef6055344579799d",GATEKEEPER_URL="http://stackedit-gatekeeper-localhost.herokuapp.com/",TUMBLR_PROXY_URL="http://stackedit-tumblr-proxy-local.herokuapp.com/";location.hostname.indexOf("benweet.github.io")===0&&(BASE_URL=MAIN_URL,GOOGLE_CLIENT_ID="241271498917-jpto9lls9fqnem1e4h6ppds9uob8rpvu.apps.googleusercontent.com",GITHUB_CLIENT_ID="fa0d09514da8377ee32e",GATEKEEPER_URL="http://stackedit-gatekeeper.herokuapp.com/",TUMBLR_PROXY_URL="http://stackedit-tumblr-proxy.herokuapp.com/");var THEME_LIST={"":"Default","blue-gray":"Blue-Gray",night:"Night"};define("config",function(){}),define("settings",["underscore","config"],function(e){var t={layoutOrientation:"horizontal",lazyRendering:!0,editorFontSize:14,defaultContent:"\n\n\n> Written with [StackEdit]("+MAIN_URL+").",commitMsg:"Published with "+MAIN_URL,template:["\n","\n","\n",'\n',"<%= documentTitle %>\n",'\n',"\n","<%= documentHTML %>\n",""].join(""),sshProxy:SSH_PROXY_URL,extensionSettings:{}};return e.has(localStorage,"settings")&&e.extend(t,JSON.parse(localStorage.settings)),t}),define("extensions/button-sync",["jquery","underscore"],function(e,t){var n={extensionId:"buttonSync",extensionName:'Button "Synchronize"',settingsBloc:'

Adds a "Synchronize documents" button in the navigation bar.

'},r=undefined,i=!1,s=!1,o=!1,u=function(){if(r===undefined)return;i===!0||s===!1||o?r.addClass("disabled"):r.removeClass("disabled")},a=undefined;n.onSynchronizerCreated=function(e){a=e},n.onCreateButton=function(){return r=e(['"].join("")).click(function(){e(this).hasClass("disabled")||a.forceSync()}),r},n.onReady=u,n.onSyncRunning=function(e){i=e,s=!0,u()},n.onSyncSuccess=function(){s=!1,u()},n.onOfflineChanged=function(e){o=e,u()};var f=function(e){t.size(e.syncLocations)!==0&&(s=!0,u())};return n.onContentChanged=f,n.onTitleChanged=f,n}),define("extensions/button-publish",["jquery","underscore"],function(e,t){function a(){if(r===undefined)return;s===!0||o===!1||u===!0?r.addClass("disabled"):r.removeClass("disabled")}var n={extensionId:"buttonPublish",extensionName:'Button "Publish"',settingsBloc:'

Adds a "Publish document" button in the navigation bar.

'},r=undefined,i=undefined,s=!1,o=!1,u=!1,f=undefined;n.onPublisherCreated=function(e){f=e},n.onCreateButton=function(){return r=e(['"].join("")).click(function(){e(this).hasClass("disabled")||f.publish()}),r},n.onPublishRunning=function(e){s=e,a()},n.onOfflineChanged=function(e){u=e,a()};var l=function(){t.size(i.publishLocations)===0?o=!1:o=!0,a()};return n.onFileSelected=function(e){i=e,l()},n.onPublishRemoved=l,n.onNewPublishSuccess=l,n}),define("extensions/button-share",["jquery","underscore"],function(e,t){var n={extensionId:"buttonShare",extensionName:'Button "Share"',optional:!0,settingsBloc:'

Adds a "Share document" button in the navigation bar.

'};n.onCreateButton=function(){return e(['",'"].join(""))};var r=undefined,i=['
',' ',' ',"
"].join(""),s=function(n){if(n!==undefined&&n!==r)return;var s=e("#link-container .link-list").empty();e("#link-container .no-link").show();var o=t.values(r.publishLocations);t.each(o,function(n){if(n.sharingLink){var r=e(t.template(i,{link:n.sharingLink}));r.click(function(e){e.stopPropagation()}),s.append(r),e("#link-container .no-link").hide()}})};return n.onFileSelected=function(e){r=e,s(e)},n.onNewPublishSuccess=s,n.onPublishRemoved=s,n}),define("extensions/button-stat",["jquery","underscore","utils"],function(e,t,n){var r={extensionId:"buttonStat",extensionName:'Button "Statistics"',optional:!0,defaultConfig:{name1:"Characters",value1:"\\S",name2:"Words",value2:"\\S+",name3:"Paragraphs",value3:"\\S.*"},settingsBloc:['

Adds a "Document statistics" button in the navigation bar.

','

',' ',' ',' ',' ',"

",'

',' ',' ',' ',' ',"

",'

',' ',' ',' ',' ',"

"].join("")};return r.onLoadSettings=function(){t.each([1,2,3],function(e){n.setInputValue("#input-stat-name"+e,r.config["name"+e]),n.setInputValue("#input-stat-value"+e,r.config["value"+e])})},r.onSaveSettings=function(e,r){t.each([1,2,3],function(t){e["name"+t]=n.getInputTextValue("#input-stat-name"+t,r),e["value"+t]=n.getInputRegExpValue("#input-stat-value"+t,r)})},r.onCreateButton=function(){return e(['",'"].join(""))},r.onPreviewFinished=function(){var t=e("#wmd-preview").clone().find("script").remove().end().text();e("#span-stat-value1").text((t.match(new RegExp(r.config.value1,"g"))||[]).length),e("#span-stat-value2").text((t.match(new RegExp(r.config.value2,"g"))||[]).length),e("#span-stat-value3").text((t.match(new RegExp(r.config.value3,"g"))||[]).length)},r}),define("file-system",{}),define("extensions/document-selector",["jquery","underscore","file-system"],function(e,t,n){function u(n){var r=e("#file-selector li:not(.stick)");r.show();if(n){var i=n.toLowerCase().split(/\s+/);r.each(function(){var n=e(this).text().toLowerCase();t.some(i,function(e){return n.indexOf(e)===-1})&&e(this).hide()})}}var r={extensionId:"documentSelector",extensionName:"Document selector",settingsBloc:'

Builds the "Open document" dropdown menu.

'},i=undefined;r.onFileMgrCreated=function(e){i=e};var s=undefined,o=function(){function r(e){var n=[],r=t.values(e.syncLocations),i=t.values(e.publishLocations),s=r.concat(i);return t.chain(s).sortBy(function(e){return e.provider.providerId}).each(function(e){n.push('')}),n.push(" "),n.push(e.title),n.join("")}s={},e("#file-selector li:not(.stick)").empty(),t.chain(n).sortBy(function(e){return e.title.toLowerCase()}).each(function(t){var n=e('').html(r(t)).click(function(){s[t.fileIndex].is(".disabled")||i.selectFile(t)}),o=e("
  • ").append(n);s[t.fileIndex]=o,e("#file-selector").append(o)})};return r.onFileSelected=function(t){s===undefined&&o(),e("#file-selector li:not(.stick)").removeClass("disabled");var n=s[t.fileIndex];if(n===undefined)return;s[t.fileIndex].addClass("disabled")},r.onFileCreated=o,r.onFileDeleted=o,r.onTitleChanged=o,r.onSyncExportSuccess=o,r.onSyncRemoved=o,r.onNewPublishSuccess=o,r.onPublishRemoved=o,r.onReady=function(){e(".action-open-file").click(function(){u(),t.defer(function(){e("#file-search").val("").focus()})}),e("#file-search").keyup(function(t){t.which==13||t.which==27?e(this).parent().click():u(e(this).val())}).click(function(e){e.stopPropagation()})},r}),define("extensions/document-title",["jquery","underscore"],function(e,t){var n={extensionId:"documentTitle",extensionName:"Document title",settingsBloc:"

    Responsible for showing the document title in the navigation bar.

    "},r=undefined;n.onLayoutCreated=function(e){r=e};var i=undefined,s=function(n){function s(e){var n=[],r=t.values(e.syncLocations),i=t.values(e.publishLocations),s=r.concat(i);return t.chain(s).sortBy(function(e){return e.provider.providerId}).each(function(e){n.push('')}),n.push(" "),n.push(e.title),n.join("")}if(n!==i)return;var o=i.title;document.title="StackEdit - "+o,e("#file-title").html(s(i)),e(".file-title").text(o),e("#file-title-input").val(o),r!==undefined&&t.defer(r.resizeAll)};return n.onFileSelected=function(e){i=e,s(e)},n.onTitleChanged=s,n.onSyncExportSuccess=s,n.onSyncRemoved=s,n.onNewPublishSuccess=s,n.onPublishRemoved=s,n}),define("extensions/manage-publication",["jquery","underscore"],function(e,t){var n={extensionId:"managePublication",extensionName:"Manage publication",settingsBloc:'

    Populates the "Manage publication" dialog box.

    '},r=undefined;n.onFileMgrCreated=function(e){r=e};var i=undefined,s=['
    ',' ',' '," ",' ',"
    "].join(""),o='
    ',u=function(n){if(n!==undefined&&n!==i)return;var u=t.values(i.publishLocations);e(".msg-no-publish, .msg-publish-list").addClass("hide");var a=e("#manage-publish-list").empty();u.length>0?e(".msg-publish-list").removeClass("hide"):e(".msg-no-publish").removeClass("hide"),t.each(u,function(n){formattedAttributes=t.omit(n,"provider","publishIndex","sharingLink"),formattedAttributes.password&&(formattedAttributes.password="********");var i=JSON.stringify(formattedAttributes).replace(/{|}|"/g,"").replace(/,/g,", "),u=e(t.template(s,{provider:n.provider,publishDesc:i}));u.append(e(o).click(function(){r.removePublish(n)})),a.append(u)})};return n.onFileSelected=function(e){i=e,u(e)},n.onNewPublishSuccess=u,n.onPublishRemoved=u,n}),define("extensions/manage-synchronization",["jquery","underscore"],function(e,t){var n={extensionId:"manageSynchronization",extensionName:"Manage synchronization",settingsBloc:'

    Populates the "Manage synchronization" dialog box.

    '},r=undefined;n.onFileMgrCreated=function(e){r=e};var i=undefined,s=['
    ',' ',' '," ",' ',"
    "].join(""),o='',u=function(n){if(n!==undefined&&n!==i)return;var u=t.values(i.syncLocations);e(".msg-no-sync, .msg-sync-list").addClass("hide");var a=e("#manage-sync-list").empty();u.length>0?e(".msg-sync-list").removeClass("hide"):e(".msg-no-sync").removeClass("hide"),t.each(u,function(n){var i=n.id||n.path,u=e(t.template(s,{provider:n.provider,syncDesc:i}));u.append(e(o).click(function(){r.removeSync(n)})),a.append(u)})};return n.onFileSelected=function(e){i=e,u(e)},n.onSyncExportSuccess=u,n.onSyncRemoved=u,n.onReady=function(){e(".sync-manual").each(function(){var t=e(this);t.find("input").keyup(function(e){e.which==13&&(t.find("a").click(),e.stopPropagation())})})},n}),define("extensions/working-indicator",["jquery","underscore"],function(e,t){var n={extensionId:"workingIndicator",extensionName:"Working indicator",settingsBloc:"

    Displays an animated image when a network operation is running.

    "};return n.onAsyncRunning=function(t){t===!1?(e(".working-indicator").removeClass("show"),e("body").removeClass("working")):(e(".working-indicator").addClass("show"),e("body").addClass("working"))},n}),function(e){var t=function(){return!1===e.support.boxModel&&e.support.objectAll&&e.support.leadingWhitespace}();e.jGrowl=function(t,n){e("#jGrowl").size()==0&&e('
    ').addClass(n&&n.position?n.position:e.jGrowl.defaults.position).appendTo("body"),e("#jGrowl").jGrowl(t,n)},e.fn.jGrowl=function(t,n){if(e.isFunction(this.each)){var r=arguments;return this.each(function(){var i=this;e(this).data("jGrowl.instance")==undefined&&(e(this).data("jGrowl.instance",e.extend(new e.fn.jGrowl,{notifications:[],element:null,interval:null})),e(this).data("jGrowl.instance").startup(this)),e.isFunction(e(this).data("jGrowl.instance")[t])?e(this).data("jGrowl.instance")[t].apply(e(this).data("jGrowl.instance"),e.makeArray(r).slice(1)):e(this).data("jGrowl.instance").create(t,n)})}},e.extend(e.fn.jGrowl.prototype,{defaults:{pool:0,header:"",group:"",sticky:!1,position:"top-right",glue:"after",theme:"default",themeState:"highlight",corners:"10px",check:250,life:3e3,closeDuration:"normal",openDuration:"normal",easing:"swing",closer:!0,closeTemplate:"×",closerTemplate:"
    [ close all ]
    ",log:function(e,t,n){},beforeOpen:function(e,t,n){},afterOpen:function(e,t,n){},open:function(e,t,n){},beforeClose:function(e,t,n){},close:function(e,t,n){},animateOpen:{opacity:"show"},animateClose:{opacity:"hide"}},notifications:[],element:null,interval:null,create:function(t,n){var n=e.extend({},this.defaults,n);typeof n.speed!="undefined"&&(n.openDuration=n.speed,n.closeDuration=n.speed),this.notifications.push({message:t,options:n}),n.log.apply(this.element,[this.element,t,n])},render:function(t){var n=this,r=t.message,i=t.options;i.themeState=i.themeState==""?"":"ui-state-"+i.themeState;var t=e("
    ").addClass("jGrowl-notification "+i.themeState+" ui-corner-all"+(i.group!=undefined&&i.group!=""?" "+i.group:"")).append(e("
    ").addClass("jGrowl-close").html(i.closeTemplate)).append(e("
    ").addClass("jGrowl-header").html(i.header)).append(e("
    ").addClass("jGrowl-message").html(r)).data("jGrowl",i).addClass(i.theme).children("div.jGrowl-close").bind("click.jGrowl",function(){e(this).parent().trigger("jGrowl.beforeClose")}).parent();e(t).bind("mouseover.jGrowl",function(){e("div.jGrowl-notification",n.element).data("jGrowl.pause",!0)}).bind("mouseout.jGrowl",function(){e("div.jGrowl-notification",n.element).data("jGrowl.pause",!1)}).bind("jGrowl.beforeOpen",function(){i.beforeOpen.apply(t,[t,r,i,n.element])!=0&&e(this).trigger("jGrowl.open")}).bind("jGrowl.open",function(){i.open.apply(t,[t,r,i,n.element])!=0&&(i.glue=="after"?e("div.jGrowl-notification:last",n.element).after(t):e("div.jGrowl-notification:first",n.element).before(t),e(this).animate(i.animateOpen,i.openDuration,i.easing,function(){e.support.opacity===!1&&this.style.removeAttribute("filter"),e(this).data("jGrowl")!=null&&(e(this).data("jGrowl").created=new Date),e(this).trigger("jGrowl.afterOpen")}))}).bind("jGrowl.afterOpen",function(){i.afterOpen.apply(t,[t,r,i,n.element])}).bind("jGrowl.beforeClose",function(){i.beforeClose.apply(t,[t,r,i,n.element])!=0&&e(this).trigger("jGrowl.close")}).bind("jGrowl.close",function(){e(this).data("jGrowl.pause",!0),e(this).animate(i.animateClose,i.closeDuration,i.easing,function(){e.isFunction(i.close)?i.close.apply(t,[t,r,i,n.element])!==!1&&e(this).remove():e(this).remove()})}).trigger("jGrowl.beforeOpen"),i.corners!=""&&e.fn.corner!=undefined&&e(t).corner(i.corners),e("div.jGrowl-notification:parent",n.element).size()>1&&e("div.jGrowl-closer",n.element).size()==0&&this.defaults.closer!=0&&e(this.defaults.closerTemplate).addClass("jGrowl-closer "+this.defaults.themeState+" ui-corner-all").addClass(this.defaults.theme).appendTo(n.element).animate(this.defaults.animateOpen,this.defaults.speed,this.defaults.easing).bind("click.jGrowl",function(){e(this).siblings().trigger("jGrowl.beforeClose"),e.isFunction(n.defaults.closer)&&n.defaults.closer.apply(e(this).parent()[0],[e(this).parent()[0]])})},update:function(){e(this.element).find("div.jGrowl-notification:parent").each(function(){e(this).data("jGrowl")!=undefined&&e(this).data("jGrowl").created!=undefined&&e(this).data("jGrowl").created.getTime()+parseInt(e(this).data("jGrowl").life)<(new Date).getTime()&&e(this).data("jGrowl").sticky!=1&&(e(this).data("jGrowl.pause")==undefined||e(this).data("jGrowl.pause")!=1)&&e(this).trigger("jGrowl.beforeClose")}),this.notifications.length>0&&(this.defaults.pool==0||e(this.element).find("div.jGrowl-notification:parent").size()
    '),this.interval=setInterval(function(){e(n).data("jGrowl.instance").update()},parseInt(this.defaults.check)),t&&e(this.element).addClass("ie6")},shutdown:function(){e(this.element).removeClass("jGrowl").find("div.jGrowl-notification").trigger("jGrowl.close").parent().empty()},close:function(){e(this.element).find("div.jGrowl-notification").each(function(){e(this).trigger("jGrowl.beforeClose")})}}),e.jGrowl.defaults=e.fn.jGrowl.prototype.defaults}(jQuery),define("jgrowl",["jquery"],function(e){return function(){var t,n;return t||e.jQuery.jGrowl}}(this)),define("extensions/notifications",["jquery","underscore","utils","jgrowl"],function(e,t,n,r){function s(e,n,i){logger.log(e);if(!e)return;var s=e.indexOf("|");if(s!==-1){e=e.substring(0,s);if(!e)return}i=i||{},n=n||"icon-info-sign",r(" "+t.escape(e),i)}var i={extensionId:"notifications",extensionName:"Notifications",defaultConfig:{timeout:8e3},settingsBloc:["

    Shows notification messages in the bottom-right corner of the screen.

    ",'
    ','
    ',' ','
    ',' ',' ms',"
    ","
    ","
    "].join("")};return i.onLoadSettings=function(){n.setInputValue("#input-notifications-timeout",i.config.timeout)},i.onSaveSettings=function(e,t){e.timeout=n.getInputIntValue("#input-notifications-timeout",t,1,6e4)},i.onReady=function(){r.defaults.life=i.config.timeout,r.defaults.closer=!1,r.defaults.closeTemplate="",r.defaults.position="bottom-right"},i.onMessage=function(e){s(e)},i.onError=function(e){logger.error(e),t.isString(e)?s(e,"icon-warning-sign"):t.isObject(e)&&s(e.message,"icon-warning-sign")},i.onOfflineChanged=function(t){t===!0?s("You are offline.","icon-exclamation-sign msg-offline",{sticky:!0,close:function(){s("You are back online!","icon-signal")}}):e(".msg-offline").parents(".jGrowl-notification").trigger("jGrowl.beforeClose")},i.onSyncImportSuccess=function(e,n){var r=t.map(e,function(e){return e.title}).join(", ");s(r+" imported successfully from "+n.providerName+".")},i.onSyncExportSuccess=function(e,t){s('"'+e.title+'" will now be synchronized on '+t.provider.providerName+".")},i.onSyncRemoved=function(e,t){s(t.provider.providerName+" synchronized location has been removed.")},i.onPublishSuccess=function(e){s('"'+e.title+'" successfully published.')},i.onNewPublishSuccess=function(e,t){s('"'+e.title+'" is now published on '+t.provider.providerName+".")},i.onPublishRemoved=function(e,t){s(t.provider.providerName+" publish location has been removed.")},i});var Markdown;typeof exports=="object"&&typeof require=="function"?Markdown=exports:Markdown={},function(){function e(e){return e}function t(e){return!1}function n(){}function r(){}n.prototype={chain:function(t,n){var r=this[t];if(!r)throw new Error("unknown hook "+t);r===e?this[t]=n:this[t]=function(e){var t=Array.prototype.slice.call(arguments,0);return t[0]=r.apply(null,t),n.apply(null,t)}},set:function(e,t){if(!this[e])throw new Error("unknown hook "+e);this[e]=t},addNoop:function(t){this[t]=e},addFalse:function(e){this[e]=t}},Markdown.HookCollection=n,r.prototype={set:function(e,t){this["s_"+e]=t},get:function(e){return this["s_"+e]}},Markdown.Converter=function(){function u(e){return e=e.replace(/^[ ]{0,3}\[(.+)\]:[ \t]*\n?[ \t]*?(?=\s|$)[ \t]*\n?[ \t]*((\n*)["(](.+?)[")][ \t]*)?(?:\n+)/gm,function(e,n,r,s,o,u){return n=n.toLowerCase(),t.set(n,O(r)),o?s:(u&&i.set(n,u.replace(/"/g,""")),"")}),e}function a(e){var t="p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math|ins|del",n="p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math";return e=e.replace(/^(<(p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math|ins|del)\b[^\r]*?\n<\/\2>[ \t]*(?=\n+))/gm,f),e=e.replace(/^(<(p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math)\b[^\r]*?.*<\/\2>[ \t]*(?=\n+)\n)/gm,f),e=e.replace(/\n[ ]{0,3}((<(hr)\b([^<>])*?\/?>)[ \t]*(?=\n{2,}))/g,f),e=e.replace(/\n\n[ ]{0,3}(-]|-[^>])(?:[^-]|-[^-])*)--)>[ \t]*(?=\n{2,}))/g,f),e=e.replace(/(?:\n\n)([ ]{0,3}(?:<([?%])[^\r]*?\2>)[ \t]*(?=\n{2,}))/g,f),e}function f(e,t){var n=t;return n=n.replace(/^\n+/,""),n=n.replace(/\n+$/g,""),n="\n\n~K"+(s.push(n)-1)+"K\n\n",n}function c(t,n){t=e.preBlockGamut(t,l),t=b(t);var r="
    \n";return t=t.replace(/^[ ]{0,2}([ ]?\*[ ]?){3,}[ \t]*$/gm,r),t=t.replace(/^[ ]{0,2}([ ]?-[ ]?){3,}[ \t]*$/gm,r),t=t.replace(/^[ ]{0,2}([ ]?_[ ]?){3,}[ \t]*$/gm,r),t=w(t),t=x(t),t=L(t),t=e.postBlockGamut(t,l),t=a(t),t=A(t,n),t}function h(t){return t=e.preSpanGamut(t),t=N(t),t=p(t),t=M(t),t=m(t),t=d(t),t=j(t),t=t.replace(/~P/g,"://"),t=O(t),t=k(t),t=t.replace(/ +\n/g,"
    \n"),t=e.postSpanGamut(t),t}function p(e){var t=/(<[a-z\/!$]("[^"]*"|'[^']*'|[^'">])*>|-]|-[^>])(?:[^-]|-[^-])*)--)>)/gi;return e=e.replace(t,function(e){var t=e.replace(/(.)<\/?code>(?=.)/g,"$1`");return t=z(t,e.charAt(1)=="!"?"\\`*_/":"\\`*_"),t}),e}function d(e){return e=e.replace(/(\[((?:\[[^\]]*\]|[^\[\]])*)\][ ]?(?:\n[ ]*)?\[(.*?)\])()()()()/g,v),e=e.replace(/(\[((?:\[[^\]]*\]|[^\[\]])*)\]\([ \t]*()?[ \t]*((['"])(.*?)\6[ \t]*)?\))/g,v),e=e.replace(/(\[([^\[\]]+)\])()()()()()/g,v),e}function v(e,n,r,s,o,u,a,f){f==undefined&&(f="");var l=n,c=r.replace(/:\/\//g,"~P"),h=s.toLowerCase(),p=o,d=f;if(p==""){h==""&&(h=c.toLowerCase().replace(/ ?\n/g," ")),p="#"+h;if(t.get(h)!=undefined)p=t.get(h),i.get(h)!=undefined&&(d=i.get(h));else{if(!(l.search(/\(\s*\)$/m)>-1))return l;p=""}}p=U(p),p=z(p,"*_");var v='",v}function m(e){return e=e.replace(/(!\[(.*?)\][ ]?(?:\n[ ]*)?\[(.*?)\])()()()()/g,y),e=e.replace(/(!\[(.*?)\]\s?\([ \t]*()?[ \t]*((['"])(.*?)\6[ \t]*)?\))/g,y),e}function g(e){return e.replace(/>/g,">").replace(/"+h(t)+"\n\n"}),e=e.replace(/^(.+)[ \t]*\n-+[ \t]*\n+/gm,function(e,t){return"

    "+h(t)+"

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

    ",r.push(a))}if(!t){o=r.length;for(var u=0;u#+-.!])/g,W),e}function B(e,t,n,r){if(t)return e;if(r.charAt(r.length-1)!==")")return"<"+n+r+">";var i=r.match(/[()]/g),s=0;for(var o=0;o"+u}function j(t){t=t.replace(P,B);var n=function(t,n){return'
    '+e.plainLinkText(n)+""};return t=t.replace(/<((https?|ftp):[^'">\s]+)>/gi,n),t}function F(e){return e=e.replace(/~E(\d+)E/g,function(e,t){var n=parseInt(t);return String.fromCharCode(n)}),e}function I(e){return e=e.replace(/^(\t|[ ]{1,4})/gm,"~0"),e=e.replace(/~0/g,""),e}function q(e){if(!/\t/.test(e))return e;var t=[" "," "," "," "],n=0,r;return e.replace(/[\n\t]/g,function(e,i){return e==="\n"?(n=i+1,e):(r=(i-n)%4,n=i+1,t[r])})}function U(e){if(!e)return"";var t=e.length;return e.replace(R,function(n,r){if(n=="~D")return"%24";if(n==":")if(r==t-1||/[0-9\/]/.test(e.charAt(r+1)))return":";return"%"+n.charCodeAt(0).toString(16)})}function z(e,t,n){var r="(["+t.replace(/([\[\]\\])/g,"\\$1")+"])";n&&(r="\\\\"+r);var i=new RegExp(r,"g");return e=e.replace(i,W),e}function W(e,t){var n=t.charCodeAt(0);return"~E"+n+"E"}var e=this.hooks=new n;e.addNoop("plainLinkText"),e.addNoop("preConversion"),e.addNoop("postNormalization"),e.addNoop("preBlockGamut"),e.addNoop("postBlockGamut"),e.addNoop("preSpanGamut"),e.addNoop("postSpanGamut"),e.addNoop("postConversion");var t,i,s,o;this.makeHtml=function(n){if(t)throw new Error("Recursive call to converter.makeHtml");return t=new r,i=new r,s=[],o=0,n=e.preConversion(n),n=n.replace(/~/g,"~T"),n=n.replace(/\$/g,"~D"),n=n.replace(/\r\n/g,"\n"),n=n.replace(/\r/g,"\n"),n="\n\n"+n+"\n\n",n=q(n),n=n.replace(/^[ \t]+$/mg,""),n=e.postNormalization(n),n=a(n),n=u(n),n=c(n),n=F(n),n=n.replace(/~D/g,"$$"),n=n.replace(/~T/g,"~"),n=e.postConversion(n),s=i=t=null,n};var l=function(e){return c(e)},E={ol:"\\d+[.]",ul:"[*+-]"},_="[-A-Z0-9+&@#/%?=~_|[\\]()!:,.;]",D="[-A-Z0-9+&@#/%=~_|[\\])]",P=new RegExp('(="|<)?\\b(https?|ftp)(://'+_+"*"+D+")(?=$|\\W)","gi"),H=new RegExp(D,"i"),R=/(?:["'*()[\]:]|~D)/g}}(),define("libs/Markdown.Converter",function(){});var IN_GLOBAL_SCOPE=!0;window.PR_SHOULD_USE_CONTINUATION=!0;var prettyPrintOne,prettyPrint;(function(){function O(e){function a(e){var t=e.charCodeAt(0);if(t!==92)return t;var n=e.charAt(1);return t=u[n],t?t:"0"<=n&&n<="7"?parseInt(e.substring(1),8):n==="u"||n==="x"?parseInt(e.substring(2),16):e.charCodeAt(1)}function f(e){if(e<32)return(e<16?"\\x0":"\\x")+e.toString(16);var t=String.fromCharCode(e);return t==="\\"||t==="-"||t==="]"||t==="^"?"\\"+t:t}function l(e){var t=e.substring(1,e.length-1).match(new RegExp("\\\\u[0-9A-Fa-f]{4}|\\\\x[0-9A-Fa-f]{2}|\\\\[0-3][0-7]{0,2}|\\\\[0-7]{1,2}|\\\\[\\s\\S]|-|[^-\\\\]","g")),n=[],r=t[0]==="^",i=["["];r&&i.push("^");for(var s=r?1:0,o=t.length;s122||(c<65||l>90||n.push([Math.max(65,l)|32,Math.min(c,90)|32]),c<97||l>122||n.push([Math.max(97,l)&-33,Math.min(c,122)&-33]))}}n.sort(function(e,t){return e[0]-t[0]||t[1]-e[1]});var h=[],p=[];for(var s=0;sd[0]&&(d[1]+1>d[0]&&i.push("-"),i.push(f(d[1])))}return i.push("]"),i.join("")}function c(e){var r=e.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g")),i=r.length,s=[];for(var o=0,u=0;o=2&&h==="["?r[o]=l(a):h!=="\\"&&(r[o]=a.replace(/[a-zA-Z]/g,function(e){var t=e.charCodeAt(0);return"["+String.fromCharCode(t&-33,t|32)+"]"}))}return r.join("")}var t=0,n=!1,r=!1;for(var i=0,s=e.length;i=0;)n[l.charAt(c)]=f;var h=f[1],p=""+h;o.hasOwnProperty(p)||(s.push(h),o[p]=null)}s.push(/[\0-\uffff]/),r=O(s)})();var i=t.length,s=function(e){var o=e.sourceCode,u=e.basePos,a=[u,S],f=0,l=o.match(r)||[],c={};for(var h=0,p=l.length;h=5&&"lang-"===v.substring(0,5),g&&(!m||typeof m[1]!="string")&&(g=!1,v=N),g||(c[d]=v)}var w=f;f+=d.length;if(!g)a.push(u+w,v);else{var E=m[1],x=d.indexOf(E),T=x+E.length;m[2]&&(T=d.length-m[2].length,x=T-E.length);var C=v.substring(5);_(u+w,d.substring(0,x),s,a),_(u+w+x,E,U(C,E),a),_(u+w+T,d.substring(T),s,a)}}e.decorations=a};return s}function B(e){var t=[],n=[];e.tripleQuotedStrings?t.push([m,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""]):e.multiLineStrings?t.push([m,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):t.push([m,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"]),e.verbatimStrings&&n.push([m,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var r=e.hashComments;r&&(e.cStyleComments?(r>1?t.push([y,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):t.push([y,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),n.push([m,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):t.push([y,/^#[^\r\n]*/,null,"#"])),e.cStyleComments&&(n.push([y,/^\/\/[^\r\n]*/,null]),n.push([y,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var i=e.regexLiterals;if(i){var s=i>1?"":"\n\r",o=s?".":"[\\S\\s]",u="/(?=[^/*"+s+"])"+"(?:[^/\\x5B\\x5C"+s+"]"+"|\\x5C"+o+"|\\x5B(?:[^\\x5C\\x5D"+s+"]"+"|\\x5C"+o+")*(?:\\x5D|$))+"+"/";n.push(["lang-regex",RegExp("^"+A+"("+u+")")])}var a=e.types;a&&n.push([b,a]);var f=(""+e.keywords).replace(/^ | $/g,"");f.length&&n.push([g,new RegExp("^(?:"+f.replace(/[\s,]+/g,"|")+")\\b"),null]),t.push([S,/^\s+/,null," \r\n  "]);var l="^.[^\\s\\w.$@'\"`/\\\\]*";return e.regexLiterals&&(l+="(?!s*/)"),n.push([w,/^@[a-z_$][a-z_$@0-9]*/i,null],[b,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[S,/^[a-z_$][a-z_$@0-9]*/i,null],[w,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[S,/^\\[\s\S]?/,null],[E,new RegExp(l),null]),H(t,n)}function F(e,t,n){function a(e){var t=e.nodeType;if(t==1&&!r.test(e.className))if("br"===e.nodeName)f(e),e.parentNode&&e.parentNode.removeChild(e);else for(var o=e.firstChild;o;o=o.nextSibling)a(o);else if((t==3||t==4)&&n){var u=e.nodeValue,l=u.match(i);if(l){var c=u.substring(0,l.index);e.nodeValue=c;var h=u.substring(l.index+l[0].length);if(h){var p=e.parentNode;p.insertBefore(s.createTextNode(h),e.nextSibling)}f(e),c||e.parentNode.removeChild(e)}}}function f(e){function t(e,n){var r=n?e.cloneNode(!1):e,i=e.parentNode;if(i){var s=t(i,1),o=e.nextSibling;s.appendChild(r);for(var u=o;u;u=o)o=u.nextSibling,s.appendChild(u)}return r}while(!e.nextSibling){e=e.parentNode;if(!e)return}var n=t(e.nextSibling,0);for(var r;(r=n.parentNode)&&r.nodeType===1;)n=r;u.push(n)}var r=/(?:^|\s)nocode(?:\s|$)/,i=/\r\n?|\n/,s=e.ownerDocument,o=s.createElement("li");while(e.firstChild)o.appendChild(e.firstChild);var u=[o];for(var l=0;l=E&&(a+=2),s>=S&&(c+=2)}}finally{g&&(g.style.display=y)}}function R(t,n){for(var r=n.length;--r>=0;){var i=n[r];q.hasOwnProperty(i)?e.console&&console.warn("cannot override language handler %s",i):q[i]=t}}function U(e,t){if(!e||!q.hasOwnProperty(e))e=/^\s*"+e+"
    ",r=r.firstChild,n&&F(r,n,!0);var i={langExtension:t,numberLines:n,sourceNode:r,pre:1};return z(i),r.innerHTML}function X(t,n){function s(e){return r.getElementsByTagName(e)}function E(){var n=e.PR_SHOULD_USE_CONTINUATION?c.now()+250:Infinity;for(;h|\\/=?|::?|<>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*",D=/\S/,j=B({keywords:d,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0}),q={};R(j,["default-code"]),R(H([],[[S,/^[^]*(?:>|$)/],[y,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[E,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]),R(H([[S,/^[\s]+/,null," \r\n"],[k,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[[x,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[C,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[E,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]),R(H([],[[k,/^[\s\S]+/]]),["uq.val"]),R(B({keywords:i,hashComments:!0,cStyleComments:!0,types:v}),["c","cc","cpp","cxx","cyc","m"]),R(B({keywords:"null,true,false"}),["json"]),R(B({keywords:o,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:v}),["cs"]),R(B({keywords:s,cStyleComments:!0}),["java"]),R(B({keywords:p,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),R(B({keywords:l,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),R(B({keywords:f,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),R(B({keywords:c,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),R(B({keywords:a,cStyleComments:!0,regexLiterals:!0}),["javascript","js"]),R(B({keywords:u,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),R(B({keywords:h,cStyleComments:!0,multilineStrings:!0}),["rc","rs","rust"]),R(H([],[[m,/^[\s\S]+/]]),["regex"]);var V=e.PR={createSimpleLexer:H,registerLangHandler:R,sourceDecorator:B,PR_ATTRIB_NAME:C,PR_ATTRIB_VALUE:k,PR_COMMENT:y,PR_DECLARATION:T,PR_KEYWORD:g,PR_LITERAL:w,PR_NOCODE:L,PR_PLAIN:S,PR_PUNCTUATION:E,PR_SOURCE:N,PR_STRING:m,PR_TAG:x,PR_TYPE:b,prettyPrintOne:IN_GLOBAL_SCOPE?e.prettyPrintOne=W:prettyPrintOne=W,prettyPrint:prettyPrint=IN_GLOBAL_SCOPE?e.prettyPrint=X:prettyPrint=X};typeof define=="function"&&define.amd&&define("google-code-prettify",[],function(){return V})})(),define("libs/prettify",function(){}),function(){function t(e){return e.replace(/^\s+|\s+$/g,"")}function n(e){return e.replace(/\s+$/g,"")}function r(e){return e.replace(new RegExp("^(\\t|[ ]{1,4})","gm"),"")}function i(e,t){return e.indexOf(t)!=-1}function s(e,t){return e.replace(/<[^>]*>?/gi,function(e){return e.match(t)?e:""})}function o(e,t){var n={};for(var r=0;r]*>|","<(br)\\s?\\/?>)$"].join(""),"i");Array.indexOf||(Array.prototype.indexOf=function(e){for(var t=0;t~X"+(this.hashBlocks.push(e)-1)+"X

    \n"},Markdown.Extra.prototype.unHashExtraBlocks=function(e){function n(){var r=!1;e=e.replace(/

    ~X(\d+)X<\/p>/g,function(e,n){r=!0;var i=parseInt(n,10),s=t.hashBlocks[i];return s=s.replace(/~D/g,"$$").replace(/~T/g,"~"),s}),r===!0&&n()}var t=this;return n(),e},Markdown.Extra.prototype.hashHeaderAttributeBlocks=function(e){function s(e,t,n){return"

    ~XX"+(i.hashBlocks.push(n)-1)+"XX

    \n"+t+"\n"}var t="\\{\\s*[.|#][^}]+\\}",n=new RegExp("^(#{1,6}.*#{0,6})\\s+("+t+")[ \\t]*(\\n|0x03)","gm"),r=new RegExp("^(.*)\\s+("+t+")[ \\t]*\\n"+"(?=[\\-|=]+\\s*(\\n|0x03))","gm"),i=this;return e=e.replace(n,s),e=e.replace(r,s),e},Markdown.Extra.prototype.hashFcbAttributeBlocks=function(e){function i(e,t,n){return"

    ~XX"+(r.hashBlocks.push(n)-1)+"XX

    \n"+t+"\n"}var t="\\{\\s*[.|#][^}]+\\}",n=new RegExp("^(```[^{]*)\\s+("+t+")[ \\t]*\\n"+"(?=([\\s\\S]*?)\\n```\\s*(\\n|0x03))","gm"),r=this;return e.replace(n,i)},Markdown.Extra.prototype.applyAttributeBlocks=function(e){var t=this,n=new RegExp('

    ~XX(\\d+)XX

    [\\s]*(?:<(h[1-6]|pre)(?: +class="(\\S+)")?(>[\\s\\S]*?))',"gm");return e=e.replace(n,function(e,n,r,i,s){if(!r)return"";var u=parseInt(n,10),a=t.hashBlocks[u],f=a.match(/#[^\s{}]+/g)||[],l=f[0]?' id="'+f[0].substr(1,f[0].length-1)+'"':"",c=a.match(/\.[^\s{}]+/g)||[];for(var h=0;h0&&(p=' class="'+c.join(" ")+'"'),"<"+r+l+p+s}),e},Markdown.Extra.prototype.tables=function(e){function s(e,r,i,s,o,u){r=r.replace(/^ *[|]/m,""),i=i.replace(/^ *[|]/m,""),s=s.replace(/^ *[|]/gm,""),r=r.replace(/[|] *$/m,""),i=i.replace(/[|] *$/m,""),s=s.replace(/[|] *$/gm,""),alignspecs=i.split(/ *[|] */),align=[];for(var a=0;a\n","
    \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)+"\n"):(o=n(o),o=f(r(o),i)),"\n
    "+o+"
    \n"}),a(e)}}(),define("libs/Markdown.Extra",function(){}),define("extensions/markdown-extra",["utils","libs/Markdown.Extra"],function(e){var t={extensionId:"markdownExtra",extensionName:"Markdown Extra",optional:!0,defaultConfig:{prettify:!0},settingsBloc:["

    Adds extra features to the original Markdown syntax.

    ",'
    ','
    ',' ','
    ',' ',"
    ","
    ","
    "].join("")};return t.onLoadSettings=function(){e.setInputChecked("#input-markdownextra-prettify",t.config.prettify)},t.onSaveSettings=function(t,n){t.prettify=e.getInputChecked("#input-markdownextra-prettify")},t.onEditorConfigure=function(e){var n=e.getConverter(),r={};t.config.prettify===!0&&(r.highlighter="prettify",e.hooks.chain("onPreviewRefresh",prettyPrint)),Markdown.Extra.init(n,r)},t}),define("extensions/toc",["jquery","underscore","utils"],function(e,t,n){function i(e,t,n){this.tagName=e,this.anchor=t,this.text=n,this.children=[]}function s(e,n){function a(){u!==undefined&&(u.children.length>0&&(u.children=s(u.children,n+1)),o.push(u))}n=n||1;var r="H"+n,o=[],u=undefined;return t.each(e,function(e,t){e.tagName!=r?(u===undefined&&(u=new i),u.children.push(e)):(a(),u=e)}),a(),o}function o(){function o(e){var i=e.prop("id")||n.slugify(e.text()),s=i,o=0;while(t.has(r,s))s=i+"-"+ ++o;return r[s]=!0,e.prop("id",s),s}var r={},u=[];return e("#wmd-preview > h1,#wmd-preview > h2,#wmd-preview > h3,#wmd-preview > h4,#wmd-preview > h5,#wmd-preview > h6").each(function(){u.push(new i(e(this).prop("tagName"),o(e(this)),e(this).text()))}),u=s(u),'
      '+u.toString()+"
    "}var r={extensionId:"toc",extensionName:"Table of content",optional:!0,defaultConfig:{marker:"\\[(TOC|toc)\\]"},settingsBloc:["

    Generates a table of content when a [TOC] marker is found.

    ",'
    ','
    ',' ','
    ',' ',"
    ","
    ","
    "].join("")};return r.onLoadSettings=function(){n.setInputValue("#input-toc-marker",r.config.marker)},r.onSaveSettings=function(e,t){e.marker=n.getInputRegExpValue("#input-toc-marker",t)},i.prototype.childrenToString=function(){if(this.children.length===0)return"";var e="
      ";return t.each(this.children,function(t){e+=t.toString()}),e+="
    ",e},i.prototype.toString=function(){var e="
  • ";return this.anchor&&this.text&&(e+=''+this.text+""),e+=this.childrenToString()+"
  • ",e},r.onEditorConfigure=function(t){t.hooks.chain("onPreviewRefresh",function(){var t=o(),n=e("#wmd-preview").html();n=n.replace(new RegExp("

    "+r.config.marker+"<\\/p>","g"),t),e("#wmd-preview").html(n)})},r}),define("extensions/math-jax",["libs/MathJax"],function(){function p(e,t){var n=s.slice(e,t+1).join("").replace(/&/g,"&").replace(//g,">");c.Browser.isMSIE&&(n=n.replace(/(%[^\n]*)\n/g,"$1
    \n"));while(t>e)s[t]="",t--;s[e]="@@"+l.length+"@@",l.push(n),o=u=a=null}function d(e){o=u=a=null,l=[],s=e.replace(/\r\n?/g,"\n").split(h);for(var t=1,n=s.length;tAllows StackEdit to interpret LaTex mathematical expressions.

    "};e.onReady=function(){MathJax.Hub.Config({"HTML-CSS":{preferredFont:"TeX",availableFonts:["STIX","TeX"],linebreaks:{automatic:!0},EqnChunk:MathJax.Hub.Browser.isMobile?10:50,imageFont:null},tex2jax:{inlineMath:[["$","$"],["\\\\(","\\\\)"]],displayMath:[["$$","$$"],["\\[","\\]"]],processEscapes:!0,ignoreClass:"tex2jax_ignore|dno"},TeX:{noUndefined:{attributes:{mathcolor:"red",mathbackground:"#FFEEEE",mathsize:"90%"}},Safe:{allow:{URLs:"safe",classes:"safe",cssIDs:"safe",styles:"safe",fontsize:"all"}}},messageStyle:"none"})};var t=!1,n=!1,r=null,i="$",s,o,u,a,f,l,c=MathJax.Hub;c.Queue(function(){t=!0,c.processUpdateTime=50,c.Config({"HTML-CSS":{EqnChunk:10,EqnChunkFactor:1},SVG:{EqnChunk:10,EqnChunkFactor:1}})});var h=/(\$\$?|\\(?:begin|end)\{[a-z]*\*?\}|\\[\\{}$]|[{}]|(?:\n\s*)+|@@\d+@@)/i,m=undefined;e.onEditorConfigure=function(e){r=document.getElementById("wmd-preview");var t=e.getConverter();t.hooks.chain("preConversion",d),t.hooks.chain("postConversion",v)},e.onAsyncPreview=function(e){m=e,y()};if(!c.Cancel){c.cancelTypeset=!1;var b="MathJax Canceled";c.Register.StartupHook("HTML-CSS Jax Config",function(){var e=MathJax.OutputJax["HTML-CSS"],t=e.Translate;e.Augment({Translate:function(n,r){if(c.cancelTypeset||r.cancelled)throw Error(b);return t.call(e,n,r)}})}),c.Register.StartupHook("SVG Jax Config",function(){var e=MathJax.OutputJax.SVG,t=e.Translate;e.Augment({Translate:function(n,r){if(c.cancelTypeset||r.cancelled)throw Error(b);return t.call(e,n,r)}})}),c.Register.StartupHook("TeX Jax Config",function(){var e=MathJax.InputJax.TeX,t=e.Translate;e.Augment({Translate:function(n,r){if(c.cancelTypeset||r.cancelled)throw Error(b);return t.call(e,n,r)}})});var w=c.processError;c.processError=function(e,t,n){return e.message!==b?w.call(c,e,t,n):(MathJax.Message.Clear(0,0),t.jaxIDs=[],t.jax={},t.scripts=[],t.i=t.j=0,t.cancelled=!0,null)},c.Cancel=function(){this.cancelTypeset=!0}}return e}),define("extensions/email-converter",[],function(){var e={extensionId:"emailConverter",extensionName:"Email Converter",optional:!0,settingsBloc:"

    Converts email adresses in the form <email@example.com> into clickable links.

    "};return e.onEditorConfigure=function(e){e.getConverter().hooks.chain("postConversion",function(e){return e.replace(/<(mailto\:)?([^\s>]+@[^\s>]+\.\S+?)>/g,function(e,t,n){return''+n+""})})},e}),showLog=!0,css_browser_selector(navigator.userAgent),define("libs/css_browser_selector",function(){}),define("extensions/scroll-link",["jquery","underscore","libs/css_browser_selector"],function(e,t){function s(e){return parseFloat(e.substring(0,e.length-2))}var n={extensionId:"scrollLink",extensionName:"Scroll Link",optional:!0,settingsBloc:["

    Binds together editor and preview scrollbars.

    ",'
    NOTE:'," 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 accurate.",""].join("")},r=[],i=[],o=t.debounce(function(){function h(e){var t=o;e!==undefined&&(n.val(e),t+=n.prop("scrollHeight"));var i=c+t;r.push({startOffset:c,endOffset:i,height:t}),c=i,o=0}var t=e("#wmd-input");r=[];var n=e("#md-section-helper");n.width(t.width());var o=s(t.css("padding-top")),a=0,c=0,p=t.val()+"\n\n";p.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>a&&(r=p.substring(a,n-1)),h(r),a=n}return""}),o+=s(t.css("padding-bottom")),h(p.substring(a,p.length-2));var d=e(".preview-container");i=[];var v=0,m=d.scrollTop();e("#wmd-preview").children("h1,h2,h3,h4,h5,h6").each(function(){var t=e(this).position().top+m+s(e(this).css("margin-top"));i.push({startOffset:v,endOffset:t,height:t-v}),v=t});var g=d.prop("scrollHeight");i.push({startOffset:v,endOffset:g,height:g-v}),u=-10,f=!1,l()},500),u=-10,a=-10,f=!1,l=t.debounce(function(){function c(e,n,r,i,s,o){var u=undefined,a=t.find(n,function(t,n){return u=n,e9?(u=s,c(s,r,o,i,a,function(e){a=e})):Math.abs(l-a)>9&&(a=l,c(l,i,n,r,u,function(e){u=e}))},600);return n.onLayoutConfigure=function(e){e.onresize=o},n.onLayoutCreated=function(){e(".preview-container").scroll(function(){f=!0,l()}),e("#wmd-input").scroll(function(){f=!1,l()})},n.onEditorConfigure=function(t){a=0,t.getConverter().hooks.chain("postConversion",function(t){return e("#wmd-preview").height(e("#wmd-preview").height()),t})},n.onPreviewFinished=function(){e("#wmd-preview").height("auto"),t.defer(function(){u=-10,o()})},n}),!function(e){e(function(){e.support.transition=function(){var e=function(){var e=document.createElement("bootstrap"),t={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"},n;for(n in t)if(e.style[n]!==undefined)return t[n]}();return e&&{end:e}}()})}(window.jQuery),!function(e){var t='[data-dismiss="alert"]',n=function(n){e(n).on("click",t,this.close)};n.prototype.close=function(t){function s(){i.trigger("closed").remove()}var n=e(this),r=n.attr("data-target"),i;r||(r=n.attr("href"),r=r&&r.replace(/.*(?=#[^\s]*$)/,"")),i=e(r),t&&t.preventDefault(),i.length||(i=n.hasClass("alert")?n:n.parent()),i.trigger(t=e.Event("close"));if(t.isDefaultPrevented())return;i.removeClass("in"),e.support.transition&&i.hasClass("fade")?i.on(e.support.transition.end,s):s()};var r=e.fn.alert;e.fn.alert=function(t){return this.each(function(){var r=e(this),i=r.data("alert");i||r.data("alert",i=new n(this)),typeof t=="string"&&i[t].call(r)})},e.fn.alert.Constructor=n,e.fn.alert.noConflict=function(){return e.fn.alert=r,this},e(document).on("click.alert.data-api",t,n.prototype.close)}(window.jQuery),!function(e){var t=function(t,n){this.$element=e(t),this.options=e.extend({},e.fn.button.defaults,n)};t.prototype.setState=function(e){var t="disabled",n=this.$element,r=n.data(),i=n.is("input")?"val":"html";e+="Text",r.resetText||n.data("resetText",n[i]()),n[i](r[e]||this.options[e]),setTimeout(function(){e=="loadingText"?n.addClass(t).attr(t,t):n.removeClass(t).removeAttr(t)},0)},t.prototype.toggle=function(){var e=this.$element.closest('[data-toggle="buttons-radio"]');e&&e.find(".active").removeClass("active"),this.$element.toggleClass("active")};var n=e.fn.button;e.fn.button=function(n){return this.each(function(){var r=e(this),i=r.data("button"),s=typeof n=="object"&&n;i||r.data("button",i=new t(this,s)),n=="toggle"?i.toggle():n&&i.setState(n)})},e.fn.button.defaults={loadingText:"loading..."},e.fn.button.Constructor=t,e.fn.button.noConflict=function(){return e.fn.button=n,this},e(document).on("click.button.data-api","[data-toggle^=button]",function(t){var n=e(t.target);n.hasClass("btn")||(n=n.closest(".btn")),n.button("toggle")})}(window.jQuery),!function(e){var t=function(t,n){this.$element=e(t),this.$indicators=this.$element.find(".carousel-indicators"),this.options=n,this.options.pause=="hover"&&this.$element.on("mouseenter",e.proxy(this.pause,this)).on("mouseleave",e.proxy(this.cycle,this))};t.prototype={cycle:function(t){return t||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(e.proxy(this.next,this),this.options.interval)),this},getActiveIndex:function(){return this.$active=this.$element.find(".item.active"),this.$items=this.$active.parent().children(),this.$items.index(this.$active)},to:function(t){var n=this.getActiveIndex(),r=this;if(t>this.$items.length-1||t<0)return;return this.sliding?this.$element.one("slid",function(){r.to(t)}):n==t?this.pause().cycle():this.slide(t>n?"next":"prev",e(this.$items[t]))},pause:function(t){return t||(this.paused=!0),this.$element.find(".next, .prev").length&&e.support.transition.end&&(this.$element.trigger(e.support.transition.end),this.cycle(!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('').appendTo("body"),n={width:t.css("width")-t[0].clientWidth,height:t.height()-t[0].clientHeight};return t.remove(),window.scrollbarWidth=n.width,window.scrollbarHeight=n.height,e.match(/^(width|height)$/)?n[e]:n},showInvisibly:function(e,t){if(e&&e.length&&(t||e.css("display")==="none")){var n=e[0].style,r={display:n.display||"",visibility:n.visibility||""};return e.css({display:"block",visibility:"hidden"}),r}return{}},getElementDimensions:function(e,t){var n={css:{},inset:{}},r=n.css,i={bottom:0},s=$.layout.cssNum,o=e.offset(),u,a,f;return n.offsetLeft=o.left,n.offsetTop=o.top,t||(t={}),$.each("Left,Right,Top,Bottom".split(","),function(s,o){u=r["border"+o]=$.layout.borderWidth(e,o),a=r["padding"+o]=$.layout.cssNum(e,"padding"+o),f=o.toLowerCase(),n.inset[f]=t[f]>=0?t[f]:a,i[f]=n.inset[f]+u}),r.width=e.width(),r.height=e.height(),r.top=s(e,"top",!0),r.bottom=s(e,"bottom",!0),r.left=s(e,"left",!0),r.right=s(e,"right",!0),n.outerWidth=e.outerWidth(),n.outerHeight=e.outerHeight(),n.innerWidth=max(0,n.outerWidth-i.left-i.right),n.innerHeight=max(0,n.outerHeight-i.top-i.bottom),n.layoutWidth=e.innerWidth(),n.layoutHeight=e.innerHeight(),n},getElementStyles:function(e,t){var n={},r=e[0].style,i=t.split(","),s="Top,Bottom,Left,Right".split(","),o="Color,Style,Width".split(","),u,a,f,l,c,h;for(l=0;l=s&&a<=o&&f>=i&&f<=u},msg:function(e,t,n,r){function a(){var e=$.support.fixedPosition?"fixed":"absolute",t=$('
    '+'
    '+'XLayout console.log
    '+'
      '+"
      ").appendTo("body");return t.css("left",$(window).width()-t.outerWidth()-5),$.ui.draggable&&t.draggable({handle:":first-child"}),t}if($.isPlainObject(e)&&window.debugData){typeof t=="string"?(r=n,n=t):typeof n=="object"&&(r=n,n=null);var i=n||"log( )",s=$.extend({sort:!1,returnHTML:!1,display:!1},r);t===!0||s.display?debugData(e,i,s):window.console&&console.log(debugData(e,i,s))}else if(t)alert(e);else if(window.console)console.log(e);else{var o="#layoutLogger",u=$(o);u.length||(u=a()),u.children("ul").append('
    • '+e.replace(/\/g,">")+"
    • ")}}};var u=navigator.userAgent.toLowerCase(),m=/(chrome)[ \/]([\w.]+)/.exec(u)||/(webkit)[ \/]([\w.]+)/.exec(u)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(u)||/(msie) ([\w.]+)/.exec(u)||u.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(u)||[],b=m[1]||"",v=m[2]||0,ie=b==="msie";$.layout.browser={version:v,safari:b==="webkit",webkit:b==="chrome",msie:ie,isIE6:ie&&v==6,boxModel:!ie||$.support.boxModel!==!1},b&&($.layout.browser[b]=!0),ie&&$(function(){$.layout.browser.boxModel=$.support.boxModel}),$.layout.defaults={name:"",containerClass:"ui-layout-container",inset:null,scrollToBookmarkOnLoad:!0,resizeWithWindow:!0,resizeWithWindowDelay:200,resizeWithWindowMaxDelay:0,maskPanesEarly:!1,onresizeall_start:null,onresizeall_end:null,onload_start:null,onload_end:null,onunload_start:null,onunload_end:null,initPanes:!0,showErrorMessages:!0,showDebugMessages:!1,zIndex:null,zIndexes:{pane_normal:0,content_mask:1,resizer_normal:2,pane_sliding:100,pane_animate:1e3,resizer_drag:1e4},errors:{pane:"pane",selector:"selector",addButtonError:"Error Adding Button\nInvalid ",containerMissing:"UI Layout Initialization Error\nThe specified layout-container does not exist.",centerPaneMissing:"UI Layout Initialization Error\nThe center-pane element does not exist.\nThe center-pane is a required element.",noContainerHeight:"UI Layout Initialization Warning\nThe layout-container \"CONTAINER\" has no height.\nTherefore the layout is 0-height and hence 'invisible'!",callbackError:"UI Layout Callback Error\nThe EVENT callback is not a valid function."},panes:{applyDemoStyles:!1,closable:!0,resizable:!0,slidable:!0,initClosed:!1,initHidden:!1,contentSelector:".ui-layout-content",contentIgnoreSelector:".ui-layout-ignore",findNestedContent:!1,paneClass:"ui-layout-pane",resizerClass:"ui-layout-resizer",togglerClass:"ui-layout-toggler",buttonClass:"ui-layout-button",minSize:0,maxSize:0,spacing_open:6,spacing_closed:6,togglerLength_open:50,togglerLength_closed:50,togglerAlign_open:"center",togglerAlign_closed:"center",togglerContent_open:"",togglerContent_closed:"",resizerDblClickToggle:!0,autoResize:!0,autoReopen:!0,resizerDragOpacity:1,maskContents:!1,maskObjects:!1,maskZindex:null,resizingGrid:!1,livePaneResizing:!1,liveContentResizing:!1,liveResizingTolerance:1,sliderCursor:"pointer",slideTrigger_open:"click",slideTrigger_close:"mouseleave",slideDelay_open:300,slideDelay_close:300,hideTogglerOnSlide:!1,preventQuickSlideClose:$.layout.browser.webkit,preventPrematureSlideClose:!1,tips:{Open:"Open",Close:"Close",Resize:"Resize",Slide:"Slide Open",Pin:"Pin",Unpin:"Un-Pin",noRoomToOpen:"Not enough room to show this panel.",minSizeWarning:"Panel has reached its minimum size",maxSizeWarning:"Panel has reached its maximum size"},showOverflowOnHover:!1,enableCursorHotkey:!0,customHotkeyModifier:"SHIFT",fxName:"slide",fxSpeed:null,fxSettings:{},fxOpacityFix:!0,animatePaneSizing:!1,children:null,containerSelector:"",initChildren:!0,destroyChildren:!0,resizeChildren:!0,triggerEventsOnLoad:!1,triggerEventsDuringLiveResize:!0,onshow_start:null,onshow_end:null,onhide_start:null,onhide_end:null,onopen_start:null,onopen_end:null,onclose_start:null,onclose_end:null,onresize_start:null,onresize_end:null,onsizecontent_start:null,onsizecontent_end:null,onswap_start:null,onswap_end:null,ondrag_start:null,ondrag_end:null},north:{paneSelector:".ui-layout-north",size:"auto",resizerCursor:"n-resize",customHotkey:""},south:{paneSelector:".ui-layout-south",size:"auto",resizerCursor:"s-resize",customHotkey:""},east:{paneSelector:".ui-layout-east",size:200,resizerCursor:"e-resize",customHotkey:""},west:{paneSelector:".ui-layout-west",size:200,resizerCursor:"w-resize",customHotkey:""},center:{paneSelector:".ui-layout-center",minWidth:0,minHeight:0}},$.layout.optionsMap={layout:"name,instanceKey,stateManagement,effects,inset,zIndexes,errors,zIndex,scrollToBookmarkOnLoad,showErrorMessages,maskPanesEarly,outset,resizeWithWindow,resizeWithWindowDelay,resizeWithWindowMaxDelay,onresizeall,onresizeall_start,onresizeall_end,onload,onload_start,onload_end,onunload,onunload_start,onunload_end".split(","),center:"paneClass,contentSelector,contentIgnoreSelector,findNestedContent,applyDemoStyles,triggerEventsOnLoad,showOverflowOnHover,maskContents,maskObjects,liveContentResizing,containerSelector,children,initChildren,resizeChildren,destroyChildren,onresize,onresize_start,onresize_end,onsizecontent,onsizecontent_start,onsizecontent_end".split(","),noDefault:"paneSelector,resizerCursor,customHotkey".split(",")},$.layout.transformData=function(e,t){var n=t?{panes:{},center:{}}:{},r,i,s,o,u,a,f;if(typeof e!="object")return n;for(i in e){r=n,u=e[i],s=i.split("__"),f=s.length-1;for(a=0;a<=f;a++)o=s[a],a===f?$.isPlainObject(u)?r[o]=$.layout.transformData(u):r[o]=u:(r[o]||(r[o]={}),r=r[o])}return n},$.layout.backwardCompatibility={map:{applyDefaultStyles:"applyDemoStyles",childOptions:"children",initChildLayout:"initChildren",destroyChildLayout:"destroyChildren",resizeChildLayout:"resizeChildren",resizeNestedLayout:"resizeChildren",resizeWhileDragging:"livePaneResizing",resizeContentWhileDragging:"liveContentResizing",triggerEventsWhileDragging:"triggerEventsDuringLiveResize",maskIframesOnResize:"maskContents",useStateCookie:"stateManagement.enabled","cookie.autoLoad":"stateManagement.autoLoad","cookie.autoSave":"stateManagement.autoSave","cookie.keys":"stateManagement.stateKeys","cookie.name":"stateManagement.cookie.name","cookie.domain":"stateManagement.cookie.domain","cookie.path":"stateManagement.cookie.path","cookie.expires":"stateManagement.cookie.expires","cookie.secure":"stateManagement.cookie.secure",noRoomToOpenTip:"tips.noRoomToOpen",togglerTip_open:"tips.Close",togglerTip_closed:"tips.Open",resizerTip:"tips.Resize",sliderTip:"tips.Slide"},renameOptions:function(e){function o(t,n){var r=t.split("."),i=r.length-1,s={branch:e,key:r[i]},o=0,u,a;for(;o=37&&t<=40,u,a,f,l;return o&&options[n[t]].enableCursorHotkey?l=n[t]:(s||i)&&$.each(_c.borderPanes,function(e,n){u=options[n],a=u.customHotkey,f=u.customHotkeyModifier;if(i&&f=="SHIFT"||s&&f=="CTRL"||s&&i)if(a&&t===(isNaN(a)||a<=9?a.toUpperCase().charCodeAt(0):a))return l=n,!1}),!l||!$Ps[l]||!options[l].closable||state[l].isHidden?!0:(toggle(l),e.stopPropagation(),e.returnValue=!1,!1)}function allowOverflow(e){if(!isInitialized())return;this&&this.tagName&&(e=this);var t;isStr(e)?t=$Ps[e]:$(e).data("layoutRole")?t=$(e):$(e).parents().each(function(){if($(this).data("layoutRole"))return t=$(this),!1});if(!t||!t.length)return;var n=t.data("layoutEdge"),r=state[n];r.cssSaved&&resetOverflow(n);if(r.isSliding||r.isResizing||r.isClosed){r.cssSaved=!1;return}var i={zIndex:options.zIndexes.resizer_normal+1},s={},o=t.css("overflow"),u=t.css("overflowX"),a=t.css("overflowY");o!="visible"&&(s.overflow=o,i.overflow="visible"),u&&!u.match(/(visible|auto)/)&&(s.overflowX=u,i.overflowX="visible"),a&&!a.match(/(visible|auto)/)&&(s.overflowY=u,i.overflowY="visible"),r.cssSaved=s,t.css(i),$.each(_c.allPanes,function(e,t){t!=n&&resetOverflow(t)})}function resetOverflow(e){if(!isInitialized())return;this&&this.tagName&&(e=this);var t;isStr(e)?t=$Ps[e]:$(e).data("layoutRole")?t=$(e):$(e).parents().each(function(){if($(this).data("layoutRole"))return t=$(this),!1});if(!t||!t.length)return;var n=t.data("layoutEdge"),r=state[n],i=r.cssSaved||{};!r.isSliding&&!r.isResizing&&t.css("zIndex",options.zIndexes.pane_normal),t.css(i),r.cssSaved=!1}var browser=$.layout.browser,_c=$.layout.config,cssW=$.layout.cssWidth,cssH=$.layout.cssHeight,elDims=$.layout.getElementDimensions,styles=$.layout.getElementStyles,evtObj=$.layout.getEventObject,evtPane=$.layout.parsePaneName,options=$.extend(!0,{},$.layout.defaults),effects=options.effects=$.extend(!0,{},$.layout.effects),state={id:"layout"+$.now(),initialized:!1,paneResizing:!1,panesSliding:{},container:{innerWidth:0,innerHeight:0,outerWidth:0,outerHeight:0,layoutWidth:0,layoutHeight:0},north:{childIdx:0},south:{childIdx:0},east:{childIdx:0},west:{childIdx:0},center:{childIdx:0}},children={north:null,south:null,east:null,west:null,center:null},timer={data:{},set:function(e,t,n){timer.clear(e),timer.data[e]=setTimeout(t,n)},clear:function(e){var t=timer.data;t[e]&&(clearTimeout(t[e]),delete t[e])}},_log=function(e,t,n){var r=options;return(r.showErrorMessages&&!n||n&&r.showDebugMessages)&&$.layout.msg(r.name+" / "+e,t!==!1),!1},_runCallbacks=function(evtName,pane,skipBoundEvents){function g(e){return e}var hasPane=pane&&isStr(pane),s=hasPane?state[pane]:state,o=hasPane?options[pane]:options,lName=options.name,lng=evtName+(evtName.match(/_/)?"":"_end"),shrt=lng.match(/_end$/)?lng.substr(0,lng.length-4):"",fn=o[lng]||o[shrt],retVal="NC",args=[],$P;!hasPane&&$.type(pane)==="boolean"&&(skipBoundEvents=pane,pane="");if(fn)try{isStr(fn)&&(fn.match(/,/)?(args=fn.split(","),fn=eval(args[0])):fn=eval(fn)),$.isFunction(fn)&&(args.length?retVal=g(fn)(args[1]):hasPane?retVal=g(fn)(pane,$Ps[pane],s,o,lName):retVal=g(fn)(Instance,s,o,lName))}catch(ex){_log(options.errors.callbackError.replace(/EVENT/,$.trim((pane||"")+" "+lng)),!1),$.type(ex)==="string"&&string.length&&_log("Exception: "+ex,!1)}return!skipBoundEvents&&retVal!==!1&&(hasPane?($P=$Ps[pane],o=options[pane],s=state[pane],$P.triggerHandler("layoutpane"+lng,[pane,$P,s,o,lName]),shrt&&$P.triggerHandler("layoutpane"+shrt,[pane,$P,s,o,lName])):($N.triggerHandler("layout"+lng,[Instance,s,o,lName]),shrt&&$N.triggerHandler("layout"+shrt,[Instance,s,o,lName]))),hasPane&&evtName==="onresize_end"&&resizeChildren(pane+"",!0),retVal},_fixIframe=function(e){if(browser.mozilla)return;var t=$Ps[e];state[e].tagName==="IFRAME"?t.css(_c.hidden).css(_c.visible):t.find("IFRAME").css(_c.hidden).css(_c.visible)},cssSize=function(e,t){var n=_c[e].dir=="horz"?cssH:cssW;return n($Ps[e],t)},cssMinDims=function(e){var t=$Ps[e],n=_c[e].dir,r={minWidth:1001-cssW(t,1e3),minHeight:1001-cssH(t,1e3)};return n==="horz"&&(r.minSize=r.minHeight),n==="vert"&&(r.minSize=r.minWidth),r},setOuterWidth=function(e,t,n){var r=e,i;isStr(e)?r=$Ps[e]:e.jquery||(r=$(e)),i=cssW(r,t),r.css({width:i}),i>0?n&&r.data("autoHidden")&&r.innerHeight()>0&&(r.show().data("autoHidden",!1),browser.mozilla||r.css(_c.hidden).css(_c.visible)):n&&!r.data("autoHidden")&&r.hide().data("autoHidden",!0)},setOuterHeight=function(e,t,n){var r=e,i;isStr(e)?r=$Ps[e]:e.jquery||(r=$(e)),i=cssH(r,t),r.css({height:i,visibility:"visible"}),i>0&&r.innerWidth()>0?n&&r.data("autoHidden")&&(r.show().data("autoHidden",!1),browser.mozilla||r.css(_c.hidden).css(_c.visible)):n&&!r.data("autoHidden")&&r.hide().data("autoHidden",!0)},_parseSize=function(e,t,n){n||(n=_c[e].dir),isStr(t)&&t.match(/%/)&&(t=t==="100%"?-1:parseInt(t,10)/100);if(t===0)return 0;if(t>=1)return parseInt(t,10);var r=options,i=0;n=="horz"?i=sC.innerHeight-($Ps.north?r.north.spacing_open:0)-($Ps.south?r.south.spacing_open:0):n=="vert"&&(i=sC.innerWidth-($Ps.west?r.west.spacing_open:0)-($Ps.east?r.east.spacing_open:0));if(t===-1)return i;if(t>0)return round(i*t);if(e=="center")return 0;var s=n==="horz"?"height":"width",o=$Ps[e],u=s==="height"?$Cs[e]:!1,a=$.layout.showInvisibly(o),f=o.css(s),l=u?u.css(s):0;return o.css(s,"auto"),u&&u.css(s,"auto"),t=s==="height"?o.outerHeight():o.outerWidth(),o.css(s,f).css(a),u&&u.css(s,l),t},getPaneSize=function(e,t){var n=$Ps[e],r=options[e],i=state[e],s=t?r.spacing_open:0,o=t?r.spacing_closed:0;return!n||i.isHidden?0:i.isClosed||i.isSliding&&t?o:_c[e].dir==="horz"?n.outerHeight()+s:n.outerWidth()+s},setSizeLimits=function(e,t){if(!isInitialized())return;var n=options[e],r=state[e],i=_c[e],s=i.dir,o=i.sizeType.toLowerCase(),u=t!=undefined?t:r.isSliding,a=$Ps[e],f=n.spacing_open,l=_c.oppositeEdge[e],c=state[l],h=$Ps[l],p=!h||c.isVisible===!1||c.isSliding?0:s=="horz"?h.outerHeight():h.outerWidth(),d=(!h||c.isHidden?0:options[l][c.isClosed!==!1?"spacing_closed":"spacing_open"])||0,v=s=="horz"?sC.innerHeight:sC.innerWidth,m=cssMinDims("center"),g=s=="horz"?max(options.center.minHeight,m.minHeight):max(options.center.minWidth,m.minWidth),y=v-f-(u?0:_parseSize("center",g,s)+p+d),b=r.minSize=max(_parseSize(e,n.minSize),cssMinDims(e).minSize),w=r.maxSize=min(n.maxSize?_parseSize(e,n.maxSize):1e5,y),E=r.resizerPosition={},S=sC.inset.top,x=sC.inset.left,T=sC.innerWidth,N=sC.innerHeight,C=n.spacing_open;switch(e){case"north":E.min=S+b,E.max=S+w;break;case"west":E.min=x+b,E.max=x+w;break;case"south":E.min=S+N-w-C,E.max=S+N-b-C;break;case"east":E.min=x+T-w-C,E.max=x+T-b-C}},calcNewCenterPaneDims=function(){var e={top:getPaneSize("north",!0),bottom:getPaneSize("south",!0),left:getPaneSize("west",!0),right:getPaneSize("east",!0),width:0,height:0};return e.width=sC.innerWidth-e.left-e.right,e.height=sC.innerHeight-e.bottom-e.top,e.top+=sC.inset.top,e.bottom+=sC.inset.bottom,e.left+=sC.inset.left,e.right+=sC.inset.right,e},getHoverClasses=function(e,t){var n=$(e),r=n.data("layoutRole"),i=n.data("layoutEdge"),s=options[i],o=s[r+"Class"],u="-"+i,a="-open",f="-closed",l="-sliding",c="-hover ",h=n.hasClass(o+f)?f:a,p=h===f?a:f,d=o+c+(o+u+c)+(o+h+c)+(o+u+h+c);return t&&(d+=o+p+c+(o+u+p+c)),r=="resizer"&&n.hasClass(o+l)&&(d+=o+l+c+(o+u+l+c)),$.trim(d)},addHover=function(e,t){var n=$(t||this);e&&n.data("layoutRole")==="toggler"&&e.stopPropagation(),n.addClass(getHoverClasses(n))},removeHover=function(e,t){var n=$(t||this);n.removeClass(getHoverClasses(n,!0))},onResizerEnter=function(e){var t=$(this).data("layoutEdge"),n=state[t];if(n.isClosed||n.isResizing||state.paneResizing)return;$.fn.disableSelection&&$("body").disableSelection(),options.maskPanesEarly&&showMasks(t,{resizing:!0})},onResizerLeave=function(e,t){var n=t||this,r=$(n).data("layoutEdge"),i=r+"ResizerLeave";timer.clear(r+"_openSlider"),timer.clear(i),t?state.paneResizing||($.fn.enableSelection&&$("body").enableSelection(),options.maskPanesEarly&&hideMasks()):timer.set(i,function(){onResizerLeave(e,n)},200)},_create=function(){initOptions();var e=options,t=state;return t.creatingLayout=!0,runPluginCallbacks(Instance,$.layout.onCreate),!1===_runCallbacks("onload_start")?"cancel":(_initContainer(),initHotkeys(),$(window).bind("unload."+sID,unload),runPluginCallbacks(Instance,$.layout.onLoad),e.initPanes&&_initLayoutElements(),delete t.creatingLayout,state.initialized)},isInitialized=function(){return state.initialized||state.creatingLayout?!0:_initLayoutElements()},_initLayoutElements=function(e){var t=options;if(!$N.is(":visible"))return!e&&browser.webkit&&$N[0].tagName==="BODY"&&setTimeout(function(){_initLayoutElements(!0)},50),!1;if(!getPane("center").length)return _log(t.errors.centerPaneMissing);state.creatingLayout=!0,$.extend(sC,elDims($N,t.inset)),initPanes();if(t.scrollToBookmarkOnLoad){var n=self.location;n.hash&&n.replace(n.hash)}return Instance.hasParentLayout?t.resizeWithWindow=!1:t.resizeWithWindow&&$(window).bind("resize."+sID,windowResize),delete state.creatingLayout,state.initialized=!0,runPluginCallbacks(Instance,$.layout.onReady),_runCallbacks("onload_end"),!0},createChildren=function(e,t){var n=evtPane.call(this,e),r=$Ps[n];if(!r)return;var i=$Cs[n],s=state[n],o=options[n],u=options.stateManagement||{},a=t?o.children=t:o.children;if($.isPlainObject(a))a=[a];else if(!a||!$.isArray(a))return;$.each(a,function(e,t){if(!$.isPlainObject(t))return;var o=t.containerSelector?r.find(t.containerSelector):i||r;o.each(function(){var e=$(this),r=e.data("layout");if(!r){setInstanceKey({container:e,options:t},s);if(u.includeChildren&&state.stateData[n]){var i=state.stateData[n].children||{},o=i[t.instanceKey],a=t.stateManagement||(t.stateManagement={autoLoad:!0});a.autoLoad===!0&&o&&(a.autoSave=!1,a.includeChildren=!0,a.autoLoad=$.extend(!0,{},o))}r=e.layout(t),r&&refreshChildren(n,r)}})})},setInstanceKey=function(e,t){var n=e.container,r=e.options,i=r.stateManagement,s=r.instanceKey||n.data("layoutInstanceKey");return s||(s=(i&&i.cookie?i.cookie.name:"")||r.name),s?s=s.replace(/[^\w-]/gi,"_").replace(/_{2,}/g,"_"):s="layout"+ ++t.childIdx,r.instanceKey=s,n.data("layoutInstanceKey",s),s},refreshChildren=function(e,t){var n=$Ps[e],r=children[e],i=state[e],s;$.isPlainObject(r)&&($.each(r,function(e,t){t.destroyed&&delete r[e]}),$.isEmptyObject(r)&&(r=children[e]=null)),!t&&!r&&(t=n.data("layout")),t&&(t.hasParentLayout=!0,s=t.options,setInstanceKey(t,i),r||(r=children[e]={}),r[s.instanceKey]=t.container.data("layout")),Instance[e].children=children[e],t||createChildren(e)},windowResize=function(){var e=options,t=Number(e.resizeWithWindowDelay);t<10&&(t=100),timer.clear("winResize"),timer.set("winResize",function(){timer.clear("winResize"),timer.clear("winResizeRepeater");var t=elDims($N,e.inset);(t.innerWidth!==sC.innerWidth||t.innerHeight!==sC.innerHeight)&&resizeAll()},t),timer.data.winResizeRepeater||setWindowResizeRepeater()},setWindowResizeRepeater=function(){var e=Number(options.resizeWithWindowMaxDelay);e>0&&timer.set("winResizeRepeater",function(){setWindowResizeRepeater(),resizeAll()},e)},unload=function(){var e=options;_runCallbacks("onunload_start"),runPluginCallbacks(Instance,$.layout.onUnload),_runCallbacks("onunload_end")},_initContainer=function(){var e=$N[0],t=$("html"),n=sC.tagName=e.tagName,r=sC.id=e.id,i=sC.className=e.className,s=options,o=s.name,u="position,margin,padding,border",a="layoutCSS",f={},l="hidden",c=$N.data("parentLayout"),h=$N.data("layoutEdge"),p=c&&h,d=$.layout.cssNum,v,m;sC.selector=$N.selector.split(".slice")[0],sC.ref=(s.name?s.name+" layout / ":"")+n+(r?"#"+r:i?".["+i+"]":""),sC.isBody=n==="BODY",!p&&!sC.isBody&&(v=$N.closest("."+$.layout.defaults.panes.paneClass),c=v.data("parentLayout"),h=v.data("layoutEdge"),p=c&&h),$N.data({layout:Instance,layoutContainer:sID}).addClass(s.containerClass);var g={destroy:"",initPanes:"",resizeAll:"resizeAll",resize:"resizeAll"};for(o in g)$N.bind("layout"+o.toLowerCase()+"."+sID,Instance[g[o]||o]);p&&(Instance.hasParentLayout=!0,c.refreshChildren(h,Instance)),$N.data(a)||(sC.isBody?($N.data(a,$.extend(styles($N,u),{height:$N.css("height"),overflow:$N.css("overflow"),overflowX:$N.css("overflowX"),overflowY:$N.css("overflowY")})),t.data(a,$.extend(styles(t,"padding"),{height:"auto",overflow:t.css("overflow"),overflowX:t.css("overflowX"),overflowY:t.css("overflowY")}))):$N.data(a,styles($N,u+",top,bottom,left,right,width,height,overflow,overflowX,overflowY")));try{f={overflow:l,overflowX:l,overflowY:l},$N.css(f),s.inset&&!$.isPlainObject(s.inset)&&(m=parseInt(s.inset,10)||0,s.inset={top:m,bottom:m,left:m,right:m});if(sC.isBody)s.outset?$.isPlainObject(s.outset)||(m=parseInt(s.outset,10)||0,s.outset={top:m,bottom:m,left:m,right:m}):s.outset={top:d(t,"paddingTop"),bottom:d(t,"paddingBottom"),left:d(t,"paddingLeft"),right:d(t,"paddingRight")},t.css(f).css({height:"100%",border:"none",padding:0,margin:0}),browser.isIE6?($N.css({width:"100%",height:"100%",border:"none",padding:0,margin:0,position:"relative"}),s.inset||(s.inset=elDims($N).inset)):($N.css({width:"auto",height:"auto",margin:0,position:"absolute"}),$N.css(s.outset)),$.extend(sC,elDims($N,s.inset));else{var y=$N.css("position");(!y||!y.match(/(fixed|absolute|relative)/))&&$N.css("position","relative"),$N.is(":visible")&&($.extend(sC,elDims($N,s.inset)),sC.innerHeight<1&&_log(s.errors.noContainerHeight.replace(/CONTAINER/,sC.ref)))}d($N,"minWidth")&&$N.parent().css("overflowX","auto"),d($N,"minHeight")&&$N.parent().css("overflowY","auto")}catch(b){}},initHotkeys=function(e){e=e?e.split(","):_c.borderPanes,$.each(e,function(e,t){var n=options[t];if(n.enableCursorHotkey||n.customHotkey)return $(document).bind("keydown."+sID,keyDown),!1})},initOptions=function(){function c(e){var t=options[e],n=options.panes;t.fxSettings||(t.fxSettings={}),n.fxSettings||(n.fxSettings={}),$.each(["_open","_close","_size"],function(r,i){var s="fxName"+i,o="fxSpeed"+i,u="fxSettings"+i,a=t[s]=t[s]||n[s]||t.fxName||n.fxName||"none",f=$.effects&&($.effects[a]||$.effects.effect&&$.effects.effect[a]);if(a==="none"||!options.effects[a]||!f)a=t[s]="none";var l=options.effects[a]||{},c=l.all||null,h=l[e]||null;t[o]=t[o]||n[o]||t.fxSpeed||n.fxSpeed||null,t[u]=$.extend(!0,{},c,h,n.fxSettings,t.fxSettings,n[u],t[u])}),delete t.fxName,delete t.fxSpeed,delete t.fxSettings}var e,t,n,r,i,s,o,u;opts=$.layout.transformData(opts,!0),opts=$.layout.backwardCompatibility.renameAllOptions(opts);if(!$.isEmptyObject(opts.panes)){e=$.layout.optionsMap.noDefault;for(s=0,o=e.length;s0&&(l.pane_normal=f,l.content_mask=max(f+1,l.content_mask),l.resizer_normal=max(f+2,l.resizer_normal)),delete options.panes},getPane=function(e){var t=options[e].paneSelector;if(t.substr(0,1)==="#")return $N.find(t).eq(0);var n=$N.children(t).eq(0);return n.length?n:$N.children("form:first").children(t).eq(0)},initPanes=function(e){evtPane(e),$.each(_c.allPanes,function(e,t){addPane(t,!0)}),initHandles(),$.each(_c.borderPanes,function(e,t){$Ps[t]&&state[t].isVisible&&(setSizeLimits(t),makePaneFit(t))}),sizeMidPanes("center"),$.each(_c.allPanes,function(e,t){afterInitPane(t)})},addPane=function(e,t){if(!t&&!isInitialized())return;var n=options[e],r=state[e],i=_c[e],s=i.dir,o=r.fx,u=n.spacing_open||0,a=e==="center",f={},l=$Ps[e],c,h,p,d;l?removePane(e,!1,!0,!1):$Cs[e]=!1,l=$Ps[e]=getPane(e);if(!l.length){$Ps[e]=!1;return}if(!l.data("layoutCSS")){var v="position,top,left,bottom,right,width,height,overflow,zIndex,display,backgroundColor,padding,margin,border";l.data("layoutCSS",styles(l,v))}Instance[e]={name:e,pane:$Ps[e],content:$Cs[e],options:options[e],state:state[e],children:children[e]},l.data({parentLayout:Instance,layoutPane:Instance[e],layoutEdge:e,layoutRole:"pane"}).css(i.cssReq).css("zIndex",options.zIndexes.pane_normal).css(n.applyDemoStyles?i.cssDemo:{}).addClass(n.paneClass+" "+n.paneClass+"-"+e).bind("mouseenter."+sID,addHover).bind("mouseleave."+sID,removeHover);var m={hide:"",show:"",toggle:"",close:"",open:"",slideOpen:"",slideClose:"",slideToggle:"",size:"sizePane",sizePane:"sizePane",sizeContent:"",sizeHandles:"",enableClosable:"",disableClosable:"",enableSlideable:"",disableSlideable:"",enableResizable:"",disableResizable:"",swapPanes:"swapPanes",swap:"swapPanes",move:"swapPanes",removePane:"removePane",remove:"removePane",createChildren:"",resizeChildren:"",resizeAll:"resizeAll",resizeLayout:"resizeAll"},g;for(g in m)l.bind("layoutpane"+g.toLowerCase()+"."+sID,Instance[m[g]||g]);initContent(e,!1),a||(c=r.size=_parseSize(e,n.size),h=_parseSize(e,n.minSize)||1,p=_parseSize(e,n.maxSize)||1e5,c>0&&(c=max(min(c,p),h)),r.autoResize=n.autoResize,r.isClosed=!1,r.isSliding=!1,r.isResizing=!1,r.isHidden=!1,r.pins||(r.pins=[])),r.tagName=l[0].tagName,r.edge=e,r.noRoom=!1,r.isVisible=!0,setPanePosition(e),s==="horz"?f.height=cssH(l,c):s==="vert"&&(f.width=cssW(l,c)),l.css(f),s!="horz"&&sizeMidPanes(e,!0),state.initialized&&(initHandles(e),initHotkeys(e)),n.initClosed&&n.closable&&!n.initHidden?close(e,!0,!0):n.initHidden||n.initClosed?hide(e):r.noRoom||l.css("display","block"),l.css("visibility","visible"),n.showOverflowOnHover&&l.hover(allowOverflow,resetOverflow),state.initialized&&afterInitPane(e)},afterInitPane=function(e){var t=$Ps[e],n=state[e],r=options[e];if(!t)return;t.data("layout")&&refreshChildren(e,t.data("layout")),n.isVisible&&(state.initialized?resizeAll():sizeContent(e),r.triggerEventsOnLoad?_runCallbacks("onresize_end",e):resizeChildren(e,!0)),r.initChildren&&r.children&&createChildren(e)},setPanePosition=function(e){e=e?e.split(","):_c.borderPanes,$.each(e,function(e,t){var n=$Ps[t],r=$Rs[t],i=options[t],s=state[t],o=_c[t].side,u={};if(!n)return;switch(t){case"north":u.top=sC.inset.top,u.left=sC.inset.left,u.right=sC.inset.right;break;case"south":u.bottom=sC.inset.bottom,u.left=sC.inset.left,u.right=sC.inset.right;break;case"west":u.left=sC.inset.left;break;case"east":u.right=sC.inset.right;break;case"center":}n.css(u),r&&s.isClosed?r.css(o,sC.inset[o]):r&&!s.isHidden&&r.css(o,sC.inset[o]+getPaneSize(t))})},initHandles=function(e){e=e?e.split(","):_c.borderPanes,$.each(e,function(e,t){var n=$Ps[t];$Rs[t]=!1,$Ts[t]=!1;if(!n)return;var r=options[t],i=state[t],s=_c[t],o=r.paneSelector.substr(0,1)==="#"?r.paneSelector.substr(1):"",u=r.resizerClass,a=r.togglerClass,f=i.isVisible?r.spacing_open:r.spacing_closed,l="-"+t,c=i.isVisible?"-open":"-closed",h=Instance[t],p=h.resizer=$Rs[t]=$("
      "),d=h.toggler=r.closable?$Ts[t]=$("
      "):!1;!i.isVisible&&r.slidable&&p.attr("title",r.tips.Slide).css("cursor",r.sliderCursor),p.attr("id",o?o+"-resizer":"").data({parentLayout:Instance,layoutPane:Instance[t],layoutEdge:t,layoutRole:"resizer"}).css(_c.resizers.cssReq).css("zIndex",options.zIndexes.resizer_normal).css(r.applyDemoStyles?_c.resizers.cssDemo:{}).addClass(u+" "+u+l).hover(addHover,removeHover).hover(onResizerEnter,onResizerLeave).appendTo($N),r.resizerDblClickToggle&&p.bind("dblclick."+sID,toggle),d&&(d.attr("id",o?o+"-toggler":"").data({parentLayout:Instance,layoutPane:Instance[t],layoutEdge:t,layoutRole:"toggler"}).css(_c.togglers.cssReq).css(r.applyDemoStyles?_c.togglers.cssDemo:{}).addClass(a+" "+a+l).hover(addHover,removeHover).bind("mouseenter",onResizerEnter).appendTo(p),r.togglerContent_open&&$(""+r.togglerContent_open+"").data({layoutEdge:t,layoutRole:"togglerContent"}).data("layoutRole","togglerContent").data("layoutEdge",t).addClass("content content-open").css("display","none").appendTo(d),r.togglerContent_closed&&$(""+r.togglerContent_closed+"").data({layoutEdge:t,layoutRole:"togglerContent"}).addClass("content content-closed").css("display","none").appendTo(d),enableClosable(t)),initResizable(t),i.isVisible?setAsOpen(t):(setAsClosed(t),bindStartSlidingEvents(t,!0))}),sizeHandles()},initContent=function(e,t){if(!isInitialized())return;var n=options[e],r=n.contentSelector,i=Instance[e],s=$Ps[e],o;r&&(o=i.content=$Cs[e]=n.findNestedContent?s.find(r).eq(0):s.children(r).eq(0)),o&&o.length?(o.data("layoutRole","content"),o.data("layoutCSS")||o.data("layoutCSS",styles(o,"height")),o.css(_c.content.cssReq),n.applyDemoStyles&&(o.css(_c.content.cssDemo),s.css(_c.content.cssDemoPane)),s.css("overflowX").match(/(scroll|auto)/)&&s.css("overflow","hidden"),state[e].content={},t!==!1&&sizeContent(e)):i.content=$Cs[e]=!1},initResizable=function(e){var t=$.layout.plugins.draggable,n;e=e?e.split(","):_c.borderPanes,$.each(e,function(e,n){var i=options[n];if(!t||!$Ps[n]||!i.resizable)return i.resizable=!1,!0;var s=state[n],o=options.zIndexes,u=_c[n],a=u.dir=="horz"?"top":"left",f=$Ps[n],l=$Rs[n],c=i.resizerClass,h=0,p,d,v=c+"-drag",m=c+"-"+n+"-drag",g=c+"-dragging",y=c+"-"+n+"-dragging",b=c+"-dragging-limit",w=c+"-"+n+"-dragging-limit",E=!1;s.isClosed||l.attr("title",i.tips.Resize).css("cursor",i.resizerCursor),l.draggable({containment:$N[0],axis:u.dir=="horz"?"y":"x",delay:0,distance:1,grid:i.resizingGrid,helper:"clone",opacity:i.resizerDragOpacity,addClasses:!1,zIndex:o.resizer_drag,start:function(e,t){i=options[n],s=state[n],d=i.livePaneResizing;if(!1===_runCallbacks("ondrag_start",n))return!1;s.isResizing=!0,state.paneResizing=n,timer.clear(n+"_closeSlider"),setSizeLimits(n),p=s.resizerPosition,h=t.position[a],l.addClass(v+" "+m),E=!1,$("body").disableSelection(),showMasks(n,{resizing:!0})},drag:function(e,t){E||(t.helper.addClass(g+" "+y).css({right:"auto",bottom:"auto"}).children().css("visibility","hidden"),E=!0,s.isSliding&&$Ps[n].css("zIndex",o.pane_sliding));var u=0;t.position[a]p.max&&(t.position[a]=p.max,u=1),u?(t.helper.addClass(b+" "+w),window.defaultStatus=u>0&&n.match(/(north|west)/)||u<0&&n.match(/(south|east)/)?i.tips.maxSizeWarning:i.tips.minSizeWarning):(t.helper.removeClass(b+" "+w),window.defaultStatus=""),d&&Math.abs(t.position[a]-h)>=i.liveResizingTolerance&&(h=t.position[a],r(e,t,n))},stop:function(e,t){$("body").enableSelection(),window.defaultStatus="",l.removeClass(v+" "+m),s.isResizing=!1,state.paneResizing=!1,r(e,t,n,!0)}})});var r=function(e,t,n,r){var i=t.position,s=_c[n],o=options[n],u=state[n],a;switch(n){case"north":a=i.top;break;case"west":a=i.left;break;case"south":a=sC.layoutHeight-i.top-o.spacing_open;break;case"east":a=sC.layoutWidth-i.left-o.spacing_open}var f=a-sC.inset[s.side];if(!r){if(Math.abs(f-u.size)=0;t--)r=$Ms.eq(t),n=r.data("layoutMask"),options[n].maskObjects||r.hide()}},getMasks=function(e){var t=$([]),n,r=0,i=$Ms.length;for(;rf.maxSize)return syncPinBtns(i,!1),!r&&a.tips.noRoomToOpen&&alert(a.tips.noRoomToOpen),e();t?bindStopSlidingEvents(i,!0):f.isSliding?bindStopSlidingEvents(i,!1):a.slidable&&bindStartSlidingEvents(i,!1),f.noRoom=!1,makePaneFit(i),h=f.isShowing,delete f.isShowing,c=!n&&f.isClosed&&a.fxName_open!="none",f.isMoving=!0,f.isVisible=!0,f.isClosed=!1,h&&(f.isHidden=!1),c?(lockPaneForFX(i,!0),s.show(a.fxName_open,a.fxSettings_open,a.fxSpeed_open,function(){lockPaneForFX(i,!1),f.isVisible&&p(),e()})):(_showPane(i),p(),e())})},setAsOpen=function(e,t){var n=$Ps[e],r=$Rs[e],i=$Ts[e],s=options[e],o=state[e],u=_c[e].side,a=s.resizerClass,f=s.togglerClass,l="-"+e,c="-open",h="-closed",p="-sliding";r.css(u,sC.inset[u]+getPaneSize(e)).removeClass(a+h+" "+a+l+h).addClass(a+c+" "+a+l+c),o.isSliding?r.addClass(a+p+" "+a+l+p):r.removeClass(a+p+" "+a+l+p),removeHover(0,r),s.resizable&&$.layout.plugins.draggable?r.draggable("enable").css("cursor",s.resizerCursor).attr("title",s.tips.Resize):o.isSliding||r.css("cursor","default"),i&&(i.removeClass(f+h+" "+f+l+h).addClass(f+c+" "+f+l+c).attr("title",s.tips.Close),removeHover(0,i),i.children(".content-closed").hide(),i.children(".content-open").css("display","block")),syncPinBtns(e,!o.isSliding),$.extend(o,elDims(n)),state.initialized&&(sizeHandles(),sizeContent(e,!0)),!t&&(state.initialized||s.triggerEventsOnLoad)&&n.is(":visible")&&(_runCallbacks("onopen_end",e),o.isShowing&&_runCallbacks("onshow_end",e),state.initialized&&_runCallbacks("onresize_end",e))},slideOpen=function(e){function s(){r.isClosed?r.isMoving||open(n,!0):bindStopSlidingEvents(n,!0)}if(!isInitialized())return;var t=evtObj(e),n=evtPane.call(this,e),r=state[n],i=options[n].slideDelay_open;t&&t.stopImmediatePropagation(),r.isClosed&&t&&t.type==="mouseenter"&&i>0?timer.set(n+"_openSlider",s,i):s()},slideClose=function(e){function o(){i.isClosed?bindStopSlidingEvents(n,!1):i.isMoving||close(n)}if(!isInitialized())return;var t=evtObj(e),n=evtPane.call(this,e),r=options[n],i=state[n],s=i.isMoving?1e3:300;if(i.isClosed||i.isResizing)return;if(r.slideTrigger_close==="click")o();else{if(r.preventQuickSlideClose&&i.isMoving)return;if(r.preventPrematureSlideClose&&t&&$.layout.isMouseOverElem(t,$Ps[n]))return;t?timer.set(n+"_closeSlider",o,max(r.slideDelay_close,s)):o()}},slideToggle=function(e){var t=evtPane.call(this,e);toggle(t,!0)},lockPaneForFX=function(e,t){var n=$Ps[e],r=state[e],i=options[e],s=options.zIndexes;t?(showMasks(e,{animation:!0,objectsOnly:!0}),n.css({zIndex:s.pane_animate}),e=="south"?n.css({top:sC.inset.top+sC.innerHeight-n.outerHeight()}):e=="east"&&n.css({left:sC.inset.left+sC.innerWidth-n.outerWidth()})):(hideMasks(),n.css({zIndex:r.isSliding?s.pane_sliding:s.pane_normal}),e=="south"?n.css({top:"auto"}):e=="east"&&!n.css("left").match(/\-99999/)&&n.css({left:"auto"}),browser.msie&&i.fxOpacityFix&&i.fxName_open!="slide"&&n.css("filter")&&n.css("opacity")==1&&n[0].style.removeAttribute("filter"))},bindStartSlidingEvents=function(e,t){var n=options[e],r=$Ps[e],i=$Rs[e],s=n.slideTrigger_open.toLowerCase();if(!i||t&&!n.slidable)return;s.match(/mouseover/)?s=n.slideTrigger_open="mouseenter":s.match(/(click|dblclick|mouseenter)/)||(s=n.slideTrigger_open="click"),n.resizerDblClickToggle&&s.match(/click/)&&i[t?"unbind":"bind"]("dblclick."+sID,toggle),i[t?"bind":"unbind"](s+"."+sID,slideOpen).css("cursor",t?n.sliderCursor:"default").attr("title",t?n.tips.Slide:"")},bindStopSlidingEvents=function(e,t){function l(t){timer.clear(e+"_closeSlider"),t.stopPropagation()}var n=options[e],r=state[e],i=_c[e],s=options.zIndexes,o=n.slideTrigger_close.toLowerCase(),u=t?"bind":"unbind",a=$Ps[e],f=$Rs[e];timer.clear(e+"_closeSlider"),t?(r.isSliding=!0,state.panesSliding[e]=!0,bindStartSlidingEvents(e,!1)):(r.isSliding=!1,delete state.panesSliding[e]),a.css("zIndex",t?s.pane_sliding:s.pane_normal),f.css("zIndex",t?s.pane_sliding+2:s.resizer_normal),o.match(/(click|mouseleave)/)||(o=n.slideTrigger_close="mouseleave"),f[u](o,slideClose),o==="mouseleave"&&(a[u]("mouseleave."+sID,slideClose),f[u]("mouseenter."+sID,l),a[u]("mouseenter."+sID,l)),t?o==="click"&&!n.resizable&&(f.css("cursor",t?n.sliderCursor:"default"),f.attr("title",t?n.tips.Close:"")):timer.clear(e+"_closeSlider")},makePaneFit=function(e,t,n,r){var i=options[e],s=state[e],o=_c[e],u=$Ps[e],a=$Rs[e],f=o.dir==="vert",l=!1;if(e==="center"||f&&s.noVerticalRoom)l=s.maxHeight>=0,l&&s.noRoom?(_showPane(e),a&&a.show(),s.isVisible=!0,s.noRoom=!1,f&&(s.noVerticalRoom=!1),_fixIframe(e)):!l&&!s.noRoom&&(_hidePane(e),a&&a.hide(),s.isVisible=!1,s.noRoom=!0);if(e!=="center")if(s.minSize<=s.maxSize){l=!0;if(s.size>s.maxSize)sizePane(e,s.maxSize,n,!0,r);else if(s.sizet?p.attempt=max(0,o.attempt-(o.actual-t)):p.attempt=max(0,o.attempt+(t-o.actual)),p.cssSize=cssSize(s,p.attempt),a.css(c,p.cssSize),p.actual=c=="width"?a.outerWidth():a.outerHeight(),p.correct=t===p.actual,r.length===1&&(_log(m,!1,!0),_log(o,!1,!0)),_log(p,!1,!0);if(r.length>3)break;r.push(p),o=r[r.length-1]}u.size=t,$.extend(u,elDims(a)),u.isVisible&&a.is(":visible")&&(f&&f.css(l,t+sC.inset[l]),sizeContent(s)),!n&&!h&&state.initialized&&u.isVisible&&_runCallbacks("onresize_end",s),n||(u.isSliding||sizeMidPanes(_c[s].dir=="horz"?"":"center",h,i),sizeHandles());var g=_c.oppositeEdge[s];t1&&_log(m+"\nSee the Error Console for details.",!0,!0)}if(!isInitialized())return;var s=evtPane.call(this,e),o=options[s],u=state[s],a=$Ps[s],f=$Rs[s],l=_c[s].side,c=_c[s].sizeType.toLowerCase(),h=u.isResizing&&!o.triggerEventsDuringLiveResize,p=r!==!0&&o.animatePaneSizing,d,v;$N.queue(function(e){setSizeLimits(s),d=u.size,t=_parseSize(s,t),t=max(t,_parseSize(s,o.minSize)),t=min(t,u.maxSize);if(t=0&&l.height>=0;if(!state.initialized&&i.minWidth>h.width){var p=i.minWidth-s.outerWidth,d=options.east.minSize||0,v=options.west.minSize||0,m=state.east.size,g=state.west.size,y=m,b=g;p>0&&state.east.isVisible&&m>d&&(y=max(m-d,m-p),p-=m-y),p>0&&state.west.isVisible&&g>v&&(b=max(g-v,g-p),p-=g-b);if(p===0){m&&m!=d&&sizePane("east",y,!0,!0,n),g&&g!=v&&sizePane("west",b,!0,!0,n),sizeMidPanes("center",t,n),o.css(c);return}}}else{s.isVisible&&!s.noVerticalRoom&&$.extend(s,elDims(o),cssMinDims(r));if(!n&&!s.noVerticalRoom&&h.height===s.outerHeight)return o.css(c),!0;l.top=h.top,l.bottom=h.bottom,s.newSize=h.height,l.height=cssH(o,h.height),s.maxHeight=l.height,f=s.maxHeight>=0,f||(s.noVerticalRoom=!0)}f?(!t&&state.initialized&&_runCallbacks("onresize_start",r),o.css(l),r!=="center"&&sizeHandles(r),s.noRoom&&!s.isClosed&&!s.isHidden&&makePaneFit(r),s.isVisible&&($.extend(s,elDims(o)),state.initialized&&sizeContent(r))):!s.noRoom&&s.isVisible&&makePaneFit(r),o.css(c),delete s.newSize,delete s.newWidth,delete s.newHeight;if(!s.isVisible)return!0;if(r==="center"){var w=browser.isIE6||!browser.boxModel;$Ps.north&&(w||state.north.tagName=="IFRAME")&&$Ps.north.css("width",cssW($Ps.north,sC.innerWidth)),$Ps.south&&(w||state.south.tagName=="IFRAME")&&$Ps.south.css("width",cssW($Ps.south,sC.innerWidth))}!t&&state.initialized&&_runCallbacks("onresize_end",r)})},resizeAll=function(e){var t=sC.innerWidth,n=sC.innerHeight;evtPane(e);if(!$N.is(":visible"))return;if(!state.initialized){_initLayoutElements();return}e===!0&&$.isPlainObject(options.outset)&&$N.css(options.outset),$.extend(sC,elDims($N,options.inset));if(!sC.outerHeight)return;e===!0&&setPanePosition();if(!1===_runCallbacks("onresizeall_start"))return!1;var r=sC.innerHeight0&&r.css("overflow")==="hidden"&&(r.css("overflow","visible"),l(),r.css("overflow","hidden"));var a=o.innerHeight-(u.spaceAbove-o.css.paddingTop)-(u.spaceBelow-o.css.paddingBottom);if(!i.is(":visible")||u.height!=a)setOuterHeight(i,a,!0),u.height=a;state.initialized&&_runCallbacks("onsizecontent_end",n)})},sizeHandles=function(e){var t=evtPane.call(this,e);t=t?t.split(","):_c.borderPanes,$.each(t,function(e,t){var n=options[t],r=state[t],i=$Ps[t],s=$Rs[t],o=$Ts[t],u;if(!i||!s)return;var a=_c[t].dir,f=r.isClosed?"_closed":"_open",l=n["spacing"+f],c=n["togglerAlign"+f],h=n["togglerLength"+f],p,d,v,m={};if(l===0){s.hide();return}!r.noRoom&&!r.isHidden&&s.show(),a==="horz"?(p=sC.innerWidth,r.resizerLength=p,d=$.layout.cssNum(i,"left"),s.css({width:cssW(s,p),height:cssH(s,l),left:d>-9999?d:sC.inset.left})):(p=i.outerHeight(),r.resizerLength=p,s.css({height:cssH(s,p),width:cssW(s,l),top:sC.inset.top+getPaneSize("north",!0)})),removeHover(n,s);if(o){if(h===0||r.isSliding&&n.hideTogglerOnSlide){o.hide();return}o.show();if(!(h>0)||h==="100%"||h>p)h=p,v=0;else if(isStr(c))switch(c){case"top":case"left":v=0;break;case"bottom":case"right":v=p-h;break;case"middle":case"center":default:v=round((p-h)/2)}else{var g=parseInt(c,10);c>=0?v=g:v=p-h+g}if(a==="horz"){var y=cssW(o,h);o.css({width:y,height:cssH(o,l),left:v,top:0}),o.children(".content").each(function(){u=$(this),u.css("marginLeft",round((y-u.outerWidth())/2))})}else{var b=cssH(o,h);o.css({height:b,width:cssW(o,l),top:v,left:0}),o.children(".content").each(function(){u=$(this),u.css("marginTop",round((b-u.outerHeight())/2))})}removeHover(0,o)}!state.initialized&&(n.initHidden||r.isHidden)&&(s.hide(),o&&o.hide())})},enableClosable=function(e){if(!isInitialized())return;var t=evtPane.call(this,e),n=$Ts[t],r=options[t];if(!n)return;r.closable=!0,n.bind("click."+sID,function(e){e.stopPropagation(),toggle(t)}).css("visibility","visible").css("cursor","pointer").attr("title",state[t].isClosed?r.tips.Open:r.tips.Close).show()},disableClosable=function(e,t){if(!isInitialized())return;var n=evtPane.call(this,e),r=$Ts[n];if(!r)return;options[n].closable=!1,state[n].isClosed&&open(n,!1,!0),r.unbind("."+sID).css("visibility",t?"hidden":"visible").css("cursor","default").attr("title","")},enableSlidable=function(e){if(!isInitialized())return;var t=evtPane.call(this,e),n=$Rs[t];if(!n||!n.data("draggable"))return;options[t].slidable=!0,state[t].isClosed&&bindStartSlidingEvents(t,!0)},disableSlidable=function(e){if(!isInitialized())return;var t=evtPane.call(this,e),n=$Rs[t];if(!n)return;options[t].slidable=!1,state[t].isSliding?close(t,!1,!0):(bindStartSlidingEvents(t,!1),n.css("cursor","default").attr("title",""),removeHover(null,n[0]))},enableResizable=function(e){if(!isInitialized())return;var t=evtPane.call(this,e),n=$Rs[t],r=options[t];if(!n||!n.data("draggable"))return;r.resizable=!0,n.draggable("enable"),state[t].isClosed||n.css("cursor",r.resizerCursor).attr("title",r.tips.Resize)},disableResizable=function(e){if(!isInitialized())return;var t=evtPane.call(this,e),n=$Rs[t];if(!n||!n.data("draggable"))return;options[t].resizable=!1,n.draggable("disable").css("cursor","default").attr("title",""),removeHover(null,n[0])},swapPanes=function(e,t){function o(e){var t=$Ps[e],n=$Cs[e];return t?{pane:e,P:t?t[0]:!1,C:n?n[0]:!1,state:$.extend(!0,{},state[e]),options:$.extend(!0,{},options[e])}:!1}function u(e,t){if(!e)return;var n=e.P,r=e.C,i=e.pane,o=_c[t],u=$.extend(!0,{},state[t]),a=options[t],f={resizerCursor:a.resizerCursor},l,c,h;$.each("fxName,fxSpeed,fxSettings".split(","),function(e,t){f[t+"_open"]=a[t+"_open"],f[t+"_close"]=a[t+"_close"],f[t+"_size"]=a[t+"_size"]}),$Ps[t]=$(n).data({layoutPane:Instance[t],layoutEdge:t}).css(_c.hidden).css(o.cssReq),$Cs[t]=r?$(r):!1,options[t]=$.extend(!0,{},e.options,f),state[t]=$.extend(!0,{},e.state),l=new RegExp(a.paneClass+"-"+i,"g"),n.className=n.className.replace(l,a.paneClass+"-"+t),initHandles(t),o.dir!=_c[i].dir?(c=s[t]||0,setSizeLimits(t),c=max(c,state[t].minSize),manualSizePane(t,c,!0,!0)):$Rs[t].css(o.side,sC.inset[o.side]+(state[t].isVisible?getPaneSize(t):0)),e.state.isVisible&&!u.isVisible?setAsOpen(t,!0):(setAsClosed(t),bindStartSlidingEvents(t,!0)),e=null}if(!isInitialized())return;var n=evtPane.call(this,e);state[n].edge=t,state[t].edge=n;if(!1===_runCallbacks("onswap_start",n)||!1===_runCallbacks("onswap_start",t)){state[n].edge=n,state[t].edge=t;return}var r=o(n),i=o(t),s={};s[n]=r?r.state.size:0,s[t]=i?i.state.size:0,$Ps[n]=!1,$Ps[t]=!1,state[n]={},state[t]={},$Ts[n]&&$Ts[n].remove(),$Ts[t]&&$Ts[t].remove(),$Rs[n]&&$Rs[n].remove(),$Rs[t]&&$Rs[t].remove(),$Rs[n]=$Rs[t]=$Ts[n]=$Ts[t]=!1,u(r,t),u(i,n),r=i=s=null,$Ps[n]&&$Ps[n].css(_c.visible),$Ps[t]&&$Ps[t].css(_c.visible),resizeAll(),_runCallbacks("onswap_end",n),_runCallbacks("onswap_end",t);return},syncPinBtns=function(e,t){$.layout.plugins.buttons&&$.each(state[e].pins,function(n,r){$.layout.buttons.setPinState(Instance,$(r),e,t)})},$N=$(this).eq(0);if(!$N.length)return _log(options.errors.containerMissing);if($N.data("layoutContainer")&&$N.data("layout"))return $N.data("layout");var $Ps={},$Cs={},$Rs={},$Ts={},$Ms=$([]),sC=state.container,sID=state.id,Instance={options:options,state:state,container:$N,panes:$Ps,contents:$Cs,resizers:$Rs,togglers:$Ts,hide:hide,show:show,toggle:toggle,open:open,close:close,slideOpen:slideOpen,slideClose:slideClose,slideToggle:slideToggle,setSizeLimits:setSizeLimits,_sizePane:sizePane,sizePane:manualSizePane,sizeContent:sizeContent,swapPanes:swapPanes,showMasks:showMasks,hideMasks:hideMasks,initContent:initContent,addPane:addPane,removePane:removePane,createChildren:createChildren,refreshChildren:refreshChildren,enableClosable:enableClosable,disableClosable:disableClosable,enableSlidable:enableSlidable,disableSlidable:disableSlidable,enableResizable:enableResizable,disableResizable:disableResizable,allowOverflow:allowOverflow,resetOverflow:resetOverflow,destroy:destroy,initPanes:isInitialized,resizeAll:resizeAll,runCallbacks:_runCallbacks,hasParentLayout:!1,children:children,north:!1,south:!1,west:!1,east:!1,center:!1};return _create()==="cancel"?null:Instance}}(jQuery),function(e){e.ui||(e.ui={}),e.ui.cookie={acceptsCookies:!!navigator.cookieEnabled,read:function(t){var n=document.cookie,r=n?n.split(";"):[],i;for(var s=0,o=r.length;s0&&(a=parseInt(a,10),f="number"),f==="number"&&(s=new Date,a>0?s.setDate(s.getDate()+a):(s.setFullYear(1970),o=!0)),s&&(i+=";expires="+s.toUTCString()),u.path&&(i+=";path="+u.path),u.domain&&(i+=";domain="+u.domain),u.secure&&(i+=";secure"),document.cookie=t+"="+(o?"":encodeURIComponent(n))+i},clear:function(t){e.ui.cookie.write(t,"",{expires:-1})}},e.cookie||(e.cookie=function(t,n,r){var i=e.ui.cookie;if(n===null)i.clear(t);else{if(n===undefined)return i.read(t);i.write(t,n,r)}}),e.layout.plugins.stateManagement=!0,e.layout.config.optionRootKeys.push("stateManagement"),e.layout.defaults.stateManagement={enabled:!1,autoSave:!0,autoLoad:!0,animateLoad:!0,includeChildren:!0,stateKeys:"north.size,south.size,east.size,west.size,north.isClosed,south.isClosed,east.isClosed,west.isClosed,north.isHidden,south.isHidden,east.isHidden,west.isHidden",cookie:{name:"",domain:"",path:"",expires:"",secure:!1}},e.layout.optionsMap.layout.push("stateManagement"),e.layout.state={saveCookie:function(t,n,r){var i=t.options,s=i.stateManagement,o=e.extend(!0,{},s.cookie,r||null),u=t.state.stateData=t.readState(n||s.stateKeys);return e.ui.cookie.write(o.name||i.name||"Layout",e.layout.state.encodeJSON(u),o),e.extend(!0,{},u)},deleteCookie:function(t){var n=t.options;e.ui.cookie.clear(n.stateManagement.cookie.name||n.name||"Layout")},readCookie:function(t){var n=t.options,r=e.ui.cookie.read(n.stateManagement.cookie.name||n.name||"Layout");return r?e.layout.state.decodeJSON(r):{}},loadCookie:function(t){var n=e.layout.state.readCookie(t);return n&&(t.state.stateData=e.extend(!0,{},n),t.loadState(n)),n},loadState:function(t,n,r){if(!e.isPlainObject(n)||e.isEmptyObject(n))return;n=t.state.stateData=e.layout.transformData(n);var i=t.options.stateManagement;r=e.extend({animateLoad:!1,includeChildren:i.includeChildren},r);if(!t.state.initialized){var o=e.extend(!0,{},n);e.each(e.layout.config.allPanes,function(e,t){o[t]&&delete o[t].children}),e.extend(!0,t.options,o)}else{var u=!r.animateLoad,o,a,f,l,c;e.each(e.layout.config.borderPanes,function(r,i){o=n[i];if(!e.isPlainObject(o))return;s=o.size,a=o.initClosed,f=o.initHidden,ar=o.autoResize,l=t.state[i],c=l.isVisible,ar&&(l.autoResize=ar),c||t._sizePane(i,s,!1,!1,!1),f===!0?t.hide(i,u):a===!0?t.close(i,!1,u):a===!1?t.open(i,!1,u):f===!1&&t.show(i,!1,u),c&&t._sizePane(i,s,!1,!1,u)});if(r.includeChildren){var h,p;e.each(t.children,function(t,r){h=n[t]?n[t].children:0,h&&r&&e.each(r,function(e,t){p=h[e],t&&p&&t.loadState(p)})})}}},readState:function(t,n){e.type(n)==="string"&&(n={keys:n}),n||(n={});var r=t.options.stateManagement,i=n.includeChildren,s=i!==undefined?i:r.includeChildren,o=n.stateKeys||r.stateKeys,u={isClosed:"initClosed",isHidden:"initHidden"},a=t.state,f=e.layout.config.allPanes,l={},c,h,p,d,v,m,g,y,b,w;e.isArray(o)&&(o=o.join(",")),o=o.replace(/__/g,".").split(",");for(var E=0,S=o.length;E8||!s.msie?!1:n.deviceXDPI&&n.systemXDPI?l(n.deviceXDPI,n.systemXDPI):s.webkit&&(u=r.body.getBoundingClientRect)?l(u.left-u.right,r.body.offsetWidth):s.webkit&&(a=t.outerWidth)?l(a,t.innerWidth):(a=n.width)&&(f=i.clientWidth)?l(a,f):!1}},e.layout.onReady.push(e.layout.browserZoom._init)}(jQuery),define("libs/layout",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()};this.reinit=function(){i=[],s=0,o="none",a=undefined,f=undefined,l=undefined,h(),l.setInputAreaSelection(),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&&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,f;this.run=function(a){if(u)return;u=new h(t);var l=new g(s,i),c=new v(e,u,function(){s.onPreviewRefresh()},a),d;/\?noundo/.test(r.location.href)||(f=new p(function(){c.refresh(),d&&d.setUndoRedoButtonStates()},u),this.textOperation=function(e){f.setCommandMode(),e(),o.refreshPreview()}),d=new m(t,u,f,c,l,n.helpButton,i),d.setUndoRedoButtonStates();var y=o.refreshPreview=function(){c.refresh(!0)};y()},this.restart=function(){f.reinit(),o.refreshPreview()}},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("libs/Markdown.Editor",function(){}),define("core",["jquery","underscore","utils","settings","extension-manager","storage","config","libs/bootstrap","libs/layout","libs/Markdown.Editor"],function(e,t,n,r,i){function h(){a=!0,f=!0,c=n.currentTime}function p(){return f===!0&&n.currentTime-c>USER_IDLE_THRESHOLD&&(f=!1),f&&l}function v(){if(a===!1||l===!1)return;d===undefined&&(d=n.randomString(),localStorage.frontWindowId=d);var t=localStorage.frontWindowId;t!=d&&(l=!1,o!==undefined&&clearInterval(o),e(".modal").modal("hide"),e("#modal-non-unique").modal({backdrop:"static",keyboard:!1}))}function g(){s.isOffline===!0&&(s.isOffline=!1,i.onOfflineChanged(!1))}function y(){s.isOffline===!0&&navigator.onLine===!0&&m+CHECK_ONLINE_PERIOD'),E=e("body").layout(e.extend(t,{east__resizable:!0,east__size:.5,east__minSize:200}))):r.layoutOrientation=="vertical"&&(e(".ui-layout-east").remove(),e(".preview-container").html('
          '),E=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(){E.allowOverflow("north")}),i.onLayoutCreated(E)};var S=undefined,x=undefined;s.createEditor=function(o){function a(){var t=e("#wmd-input").val();x!==undefined&&x!=t&&o(),x=t}x=undefined,e("#wmd-input, .preview-container").scrollTop(0);if(S!==undefined){S.restart();return}var u=new Markdown.Converter;S=new Markdown.Editor(u),S.hooks.set("insertLinkDialog",function(t){return s.insertLinkCallback=t,n.resetModalInputs(),e("#modal-insert-link").modal(),!0}),S.hooks.set("insertImageDialog",function(t){return s.insertLinkCallback=t,n.resetModalInputs(),e("#modal-insert-image").modal(),!0});var f;r.lazyRendering===!0?f=function(e){var n=t.debounce(e,500);return function(){x===undefined?e():n(),a()}}:f=function(e){return function(){a(),e()}},i.onEditorConfigure(S),S.hooks.chain("onPreviewRefresh",i.onAsyncPreview),S.run(f),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"))};var T=[];s.onReady=function(e){T.push(e),C()};var N=!1;return s.setReady=function(){N=!0,C()},s.onReady(i.onReady),s.onReady(function(){t.each(THEME_LIST,function(t,n){e("#input-settings-theme").append(e('"))}),e(window).on("offline",s.setOffline),e(window).on("online",g),navigator.onLine===!1&&s.setOffline(),e(document).mousemove(h).keypress(h),e(".dropdown-submenu > a").click(function(e){e.stopPropagation()});var i=undefined;e(".modal").on("shown",function(n){var r=e(this).attr("id");i!=r&&(i=r,t.defer(function(e){e.find("input:enabled:visible:first").focus()},e(this)))}).on("hidden",function(){var n=e(this).attr("id");i==n&&e(this).is(":hidden")&&(i=undefined,t.defer(function(){e("#wmd-input").focus()}))}).keyup(function(t){t.which==13&&!e(t.target).is("textarea")&&e(this).find(".modal-footer a:last").click()}),e(".action-insert-link").click(function(t){var r=n.getInputTextValue(e("#input-insert-link"),t);r!==undefined&&(s.insertLinkCallback(r),s.insertLinkCallback=undefined)}),e(".action-insert-image").click(function(t){var r=n.getInputTextValue(e("#input-insert-image"),t);r!==undefined&&(s.insertLinkCallback(r),s.insertLinkCallback=undefined)}),e("#modal-insert-link, #modal-insert-image").on("hidden",function(){s.insertLinkCallback!==undefined&&(s.insertLinkCallback(null),s.insertLinkCallback=undefined)}),e(".action-load-settings").click(function(){b()}),e(".action-apply-settings").click(function(e){w(e),e.isPropagationStopped()||window.location.reload()}),e(".action-default-settings").click(function(){localStorage.removeItem("settings"),localStorage.removeItem("theme"),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"),s.createLayout(),e("#wmd-input, #md-section-helper").css({"font-size":r.editorFontSize+"px","line-height":Math.round(r.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-lazy-rendering").tooltip({container:"#modal-settings",placement:"right",trigger:"hover",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",trigger:"hover",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:
          ",t.escape("<%= documentTitle %>"),"
          ",t.escape("
          <%- documentHTML %>
          "),"
          ",t.escape('<% if(publishAttributes.provider == "github") print(documentMarkdown); %>'),"

          ",'More info'].join("")}).click(function(t){e(this).tooltip("show"),e(document).on("click.tooltip-template",function(t){e(".tooltip-template").tooltip("hide"),e(document).off("click.tooltip-template")}),t.stopPropagation()}),e(".action-reset-input").click(function(){n.resetModalInputs()}),o=window.setInterval(function(){n.updateCurrentTime(),v();if(p()===!0||viewerMode===!0)t.each(u,function(e){e()}),y()},1e3),t.defer(function(){e("#wmd-input").focus()})}),s}),define("libs/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("libs/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### Table of content\r\n\r\nYou can insert a table of content using the marker `[TOC]`:\r\n\r\n[TOC]\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","underscore","core","utils","settings","extension-manager","file-system","libs/text!../WELCOME.md"],function(e,t,n,r,i,s,o,u){function f(e,t,n,r){this.fileIndex=e,this._title=t,this.__defineGetter__("title",function(){return this._title}),this.__defineSetter__("title",function(e){this._title=e,localStorage[this.fileIndex+".title"]=e,s.onTitleChanged(this)}),this.__defineGetter__("content",function(){return localStorage[this.fileIndex+".content"]}),this.__defineSetter__("content",function(e){localStorage[this.fileIndex+".content"]=e,s.onContentChanged(this)}),this.syncLocations=n||{},this.publishLocations=r||{}}var a={};t.chain(localStorage["file.list"].split(";")).compact().each(function(e){o[e]=new f(e,localStorage[e+".title"])});var l=undefined;return a.getCurrentFile=function(){return l},a.isCurrentFile=function(e){return e===l},a.setCurrentFile=function(e){l=e,e===undefined?localStorage.removeItem("file.current"):e.fileIndex!=TEMPORARY_FILE_INDEX&&(localStorage["file.current"]=e.fileIndex)},a.selectFile=function(r){r=r||a.getCurrentFile();if(r===undefined){var i=t.size(o);if(i===0)r=a.createFile(WELCOME_DOCUMENT_TITLE,u);else{var f=localStorage["file.current"];f===undefined&&(f=t.keys(o)[i-1]),r=o[f]}}a.isCurrentFile(r)===!1&&(a.setCurrentFile(r),s.onFileSelected(r),r.fileIndex==TEMPORARY_FILE_INDEX?e(".action-edit-document").removeClass("hide"):e(".action-edit-document").addClass("hide")),e("#wmd-input").val(r.content),n.createEditor(function(){a.saveFile()})},a.createFile=function(e,n,u,a){n=n!==undefined?n:i.defaultContent;if(!e){e=DEFAULT_FILE_TITLE;var l=2;while(t.some(o,function(t){return t.title==e}))e=DEFAULT_FILE_TITLE+l++}var c=TEMPORARY_FILE_INDEX;if(!a)do c="file."+r.randomString();while(t.has(o,c));u=u||{};var h=t.reduce(u,function(e,t,n){return e+n+";"},";");localStorage[c+".title"]=e,localStorage[c+".content"]=n,localStorage[c+".sync"]=h,localStorage[c+".publish"]=";";var p=new f(c,e,u);return a||(localStorage["file.list"]+=c+";",o[c]=p,s.onFileCreated(p)),p},a.deleteFile=function(e){e=e||a.getCurrentFile(),localStorage["file.list"]=localStorage["file.list"].replace(";"+e.fileIndex+";",";"),delete o[e.fileIndex],a.isCurrentFile(e)===!0&&(a.setCurrentFile(),a.selectFile()),t.each(e.syncLocations,function(e){a.removeSync(e,!0)}),t.each(e.publishLocations,function(e){a.removePublish(e,!0)}),localStorage.removeItem(e.fileIndex+".title"),localStorage.removeItem(e.fileIndex+".content"),localStorage.removeItem(e.fileIndex+".sync"),localStorage.removeItem(e.fileIndex+".publish"),s.onFileDeleted(e)},a.saveFile=function(){var t=a.getCurrentFile();t.content=e("#wmd-input").val()},a.addSync=function(e,t){localStorage[e.fileIndex+".sync"]+=t.syncIndex+";",e.syncLocations[t.syncIndex]=t,s.onSyncExportSuccess(e,t)},a.removeSync=function(e,t){var n=a.getFileFromSyncIndex(e.syncIndex);n!==undefined&&(localStorage[n.fileIndex+".sync"]=localStorage[n.fileIndex+".sync"].replace(";"+e.syncIndex+";",";")),localStorage.removeItem(e.syncIndex),delete n.syncLocations[e.syncIndex],t||s.onSyncRemoved(n,e)},a.getFileFromSyncIndex=function(e){return t.find(o,function(n){return t.has(n.syncLocations,e)})},a.getSyncAttributes=function(e){var t=a.getFileFromSyncIndex(e);return t&&t.syncLocations[e]},a.hasSync=function(e){return t.some(o,function(n){return t.some(n.syncLocations,function(t){return t.provider===e})})},a.addPublish=function(e,t){localStorage[e.fileIndex+".publish"]+=t.publishIndex+";",e.publishLocations[t.publishIndex]=t,s.onNewPublishSuccess(e,t)},a.removePublish=function(e,t){var n=a.getFileFromPublishIndex(e.publishIndex);n!==undefined&&(localStorage[n.fileIndex+".publish"]=localStorage[n.fileIndex+".publish"].replace(";"+e.publishIndex+";",";")),localStorage.removeItem(e.publishIndex),delete n.publishLocations[e.publishIndex],t||s.onPublishRemoved(n,e)},a.getFileFromPublishIndex=function(e){return t.find(o,function(n){return t.has(n.publishLocations,e)})},n.onReady(function(){function n(t){t.hide(),e("#file-title").show();var n=e.trim(t.val()),r=a.getCurrentFile();n&&n!=r.title&&(r.title=n),t.val(r.title),e("#wmd-input").focus()}a.selectFile(),e(".action-create-file").click(function(){var t=a.createFile();a.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(){a.deleteFile()}),e("#file-title").click(function(){if(viewerMode===!0)return;e(this).hide();var n=e("#file-title-input").show();t.defer(function(){n.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-stackedit").click(function(){window.location.href="."}),e(".action-edit-document").click(function(){var t=e("#wmd-input").val(),n=a.getCurrentFile().title,r=a.createFile(n,t);a.selectFile(r),window.location.href="."}),e(".action-welcome-file").click(function(){var e=a.createFile(WELCOME_DOCUMENT_TITLE,u);a.selectFile(e)})}),s.onFileMgrCreated(a),a}),define("async-runner",["underscore","core","utils","extension-manager"],function(e,t,n,r){function l(t,n,f){try{e.each(n,function(e){e(f)})}finally{t.finished=!0,u===t&&(u=undefined,a=!1),s.length===0?(o=!1,r.onAsyncRunning(!1)):i.runTask()}}var i={},s=[],o=!1,u=undefined,a=!1,f=0;return i.createTask=function(){var e={};return e.finished=!1,e.timeout=ASYNC_TASK_DEFAULT_TIMEOUT,e.retryCounter=0,e.runCallbacks=[],e.onRun=function(t){e.runCallbacks.push(t)},e.successCallbacks=[],e.onSuccess=function(t){e.successCallbacks.push(t)},e.errorCallbacks=[],e.onError=function(t){e.errorCallbacks.push(t)},e.chain=function(t){if(e.finished===!0)return;e.queue===undefined&&(e.queue=e.runCallbacks.slice());if(t!==undefined){t();return}if(e.queue.length===0){l(e,e.successCallbacks);return}var n=e.queue.shift();n()},e.error=function(t){if(e.finished===!0)return;throw t=t||new Error("Unknown error"),t.message&&r.onError(t),l(e,e.errorCallbacks,t),t},e.retry=function(t,r){if(e.finished===!0)return;r=r||5,e.queue=undefined;if(e.retryCounter>=r){e.error(t);return}var s=Math.pow(2,e.retryCounter++)*1e3;f=n.currentTime+s,a=!1,i.runTask()},e},i.runTask=function(){e.defer(function(){if(a===!0){f+u.timeout:"\|?\*]+$/)?e.indexOf("/")!==0?"/"+e:e:(n.onError('"'+e+'" contains invalid characters.'),undefined)}function a(e){return"sync."+s+"."+encodeURIComponent(e.toLowerCase())}function f(e,n,r){var i={};return i.provider=o,i.path=e,i.version=n,i.contentCRC=t.crc32(r),i.syncIndex=a(e),t.storeAttributes(i),i}function l(t){i.downloadMetadata(t,function(t,s){if(t)return;i.downloadContent(s,function(t,i){if(t)return;var s=[];e.each(i,function(e){var t=f(e.path,e.versionTag,e.content),n={};n[t.syncIndex]=t;var i=r.createFile(e.name,e.content,n);r.selectFile(i),s.push(i)}),s.length!==0&&n.onSyncImportSuccess(s,o)})})}function c(e,t,s,o){e=u(e);if(e===undefined){o(!0);return}var l=a(e),c=r.getFileFromSyncIndex(l);if(c!==undefined){var h=c.title;n.onError('File path is already synchronized with "'+h+'".'),o(!0);return}i.upload(e,s,function(e,t){if(e){o(e);return}var n=f(t.path,t.versionTag,s);o(undefined,n)})}var s="dropbox",o={providerId:s,providerName:"Dropbox",defaultPublishFormat:"template"};return o.importFiles=function(){i.picker(function(t,i){if(t||i.length===0)return;var s=[];e.each(i,function(e){var t=a(e),i=r.getFileFromSyncIndex(t);if(i!==undefined){n.onError('"'+i.title+'" was already imported.');return}s.push(e)}),l(s)})},o.exportFile=function(e,n,r,i){var s=t.getInputTextValue("#input-sync-export-dropbox-path",e);c(s,n,r,i)},o.exportManual=function(e,n,r,i){var s=t.getInputTextValue("#input-sync-manual-dropbox-path",e);c(s,n,r,i)},o.syncUp=function(e,t,n,r,s,o){var u=s.contentCRC;if(t==u){o(undefined,!1);return}i.upload(s.path,e,function(e,n){if(e){o(e,!0);return}s.version=n.versionTag,s.contentCRC=t,o(undefined,!0)})},o.syncDown=function(o){var u=localStorage[s+".lastChangeId"];i.checkChanges(u,function(u,f,l){if(u){o(u);return}var c=[];e.each(f,function(e){var t=a(e.path),n=r.getSyncAttributes(t);if(n===undefined)return;e.syncAttributes=n;if(e.wasRemoved===!0){c.push(e);return}n.version!=e.stat.versionTag&&c.push(e)}),i.downloadContent(c,function(i,u){if(i){o(i);return}e.each(u,function(e){var i=e.syncAttributes,s=i.syncIndex,o=r.getFileFromSyncIndex(s);if(o===undefined)return;var u=o.title;if(e.wasRemoved===!0){n.onError('"'+u+'" has been removed from Dropbox.'),r.removeSync(i);return}var a=o.content,f=i.contentCRC!=t.crc32(a),l=e.stat,c=t.crc32(l.content),h=i.contentCRC!=c,p=a!=l.content;p===!0&&f===!0&&h===!0&&(r.createFile(u+" (backup)",a),n.onMessage('Conflict detected on "'+u+'". A backup has been created locally.')),p&&h===!0&&(o.content=l.content,n.onMessage('"'+u+'" has been updated from Dropbox.'),r.isCurrentFile(o)&&r.selectFile()),i.version=l.versionTag,i.contentCRC=c,t.storeAttributes(i)}),localStorage[s+".lastChangeId"]=l,o()})})},o.publish=function(e,t,n,r){var s=u(e.path);if(s===undefined){r(!0);return}i.upload(s,n,r)},o.newPublishAttributes=function(e){var n={};return n.path=t.getInputTextValue("#input-publish-dropbox-path",e),e.isPropagationStopped()?undefined:n},o}),define("helpers/google-helper",["jquery","core","utils","extension-manager","async-runner"],function(e,t,n,r,i){function a(n){n.onRun(function(){if(t.isOffline===!0){s=!1,n.error(new Error("Operation not available in offline mode.|stopPublish"));return}if(s===!0){n.chain();return}delayedFunction=function(){s=!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};l(t,n)})})}function f(e){e.onRun(function(){function n(){t===!1&&(r.onMessage("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:t},function(r){gapi.client.load("drive","v2",function(){if(!r||r.error){if(s===!0&&t===!0){t=!1,e.chain(n);return}e.error(new Error("Access to Google account is not authorized."));return}o=!0,e.chain()})})}if(o===!0){e.chain();return}var t=!0;e.chain(n)})}function l(e,n){var r=undefined;if(e){logger.error(e);if(typeof e=="string")r=e;else{r="Google error ("+e.code+": "+e.message+").";if(e.code>=500&&e.code<600){n.retry(new Error(r));return}if(e.code===401||e.code===403){o=!1,r="Access to Google account is not authorized.",n.retry(new Error(r),1);return}e.code<=0&&(s=!1,o=!1,t.setOffline(),r="|stopPublish")}}n.error(new Error(r))}function h(t){t.onRun(function(){if(c===!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}),c=!0}).fail(function(e){var n={code:e.status,message:e.statusText};l(n,t)})})}var s=!1,o=!1,u={};u.upload=function(e,t,r,s,o,u){var c=undefined,h=i.createTask();a(h),f(h),h.onRun(function(){var i="-------314159265358979323846",o="\r\n--"+i+"\r\n",u="\r\n--"+i+"--",a="text/x-markdown",f={title:r,mimeType:a};t!==undefined&&(f.parents=[{kind:"drive#fileLink",id:t}]);var p="/upload/drive/v2/files",d="POST";e!==undefined&&(p+="/"+e,d="PUT");var v={"Content-Type":'multipart/mixed; boundary="'+i+'"'},m=n.encodeBase64(s),g=o+"Content-Type: application/json\r\n\r\n"+JSON.stringify(f)+o+"Content-Type: "+a+"\r\n"+"Content-Transfer-Encoding: base64\r\n"+"\r\n"+m+u,y=gapi.client.request({path:p,method:d,params:{uploadType:"multipart"},headers:v,body:g});y.execute(function(t){if(t&&t.id){c=t,c.content=s,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.')),l(n,h)})}),h.onSuccess(function(){u(undefined,c)}),h.onError(function(e){u(e)}),i.addTask(h)},u.checkChanges=function(e,t){var n=[],r=e||0,s=i.createTask();a(s),f(s),s.onRun(function(){function t(){var i=undefined;e===undefined?i=gapi.client.drive.changes.list({startChangeId:r+1}):i=gapi.client.drive.changes.list({pageToken:e}),i.execute(function(i){if(!i||!i.largestChangeId){l(i.error,s);return}r=i.largestChangeId,e=i.nextPageToken,i.items!==undefined&&(n=n.concat(i.items)),e!==undefined?s.chain(t):s.chain()})}var e=undefined;s.chain(t)}),s.onSuccess(function(){t(undefined,n,r)}),s.onError(function(e){t(e)}),i.addTask(s)},u.downloadMetadata=function(t,n,r){var s=[],o=i.createTask();a(o),r||f(o),o.onRun(function(){function n(){if(t.length===0){o.chain();return}var r=t[0],i={},u=gapi.auth.getToken();u&&(i.Authorization="Bearer "+u.access_token),e.ajax({url:"https://www.googleapis.com/drive/v2/files/"+r,headers:i,data:{key:GOOGLE_API_KEY},dataType:"json",timeout:AJAX_TIMEOUT}).done(function(e,r,i){s.push(e),t.shift(),o.chain(n)}).fail(function(e){var t={code:e.status,message:e.statusText};t.code===404&&(t='File ID "'+r+'" not found on Google Drive.'),l(t,o)})}o.chain(n)}),o.onSuccess(function(){n(undefined,s)}),o.onError(function(e){n(e)}),i.addTask(o)},u.downloadContent=function(t,n,r){var s=[],o=i.createTask();o.timeout=ASYNC_TASK_LONG_TIMEOUT,a(o),r||f(o),o.onRun(function(){function n(){if(t.length===0){o.chain();return}var r=t[0];s.push(r);var i=undefined;r.kind=="drive#file"?i=r:r.kind=="drive#change"&&(i=r.file);if(!i){t.shift(),o.chain(n);return}var u={},a=gapi.auth.getToken();a&&(u.Authorization="Bearer "+a.access_token),e.ajax({url:i.downloadUrl,headers:u,data:{key:GOOGLE_API_KEY},dataType:"text",timeout:AJAX_TIMEOUT}).done(function(e,r,s){i.content=e,t.shift(),o.chain(n)}).fail(function(e){var t={code:e.status,message:e.statusText};l(t,o)})}o.chain(n)}),o.onSuccess(function(){n(undefined,s)}),o.onError(function(e){n(e)}),i.addTask(o)};var c=!1;return u.picker=function(t,n){function o(){s!==undefined&&(s.setVisible(!1),e(".modal-backdrop, .picker").remove())}var r=[],s=undefined,u=i.createTask();a(u),h(u),u.onRun(function(){var t=new google.picker.PickerBuilder;t.setAppId(GOOGLE_DRIVE_APP_ID);if(!n){var i=new google.picker.View(google.picker.ViewId.DOCS);i.setMimeTypes("text/x-markdown,text/plain,application/octet-stream"),t.enableFeature(google.picker.Feature.NAV_HIDDEN),t.enableFeature(google.picker.Feature.MULTISELECT_ENABLED),t.addView(i)}else t.addView(google.picker.ViewId.PHOTOS),t.addView(google.picker.ViewId.PHOTO_UPLOAD);t.setCallback(function(e){if(e.action==google.picker.Action.PICKED||e.action==google.picker.Action.CANCEL)e.action==google.picker.Action.PICKED&&(r=e.docs),o(),u.chain()}),s=t.build(),e("body").append(e("
          ").addClass("modal-backdrop").click(function(){o(),u.chain()})),s.setVisible(!0)}),u.onSuccess(function(){t(undefined,r)}),u.onError(function(e){o(),t(e)}),i.addTask(u)},u.uploadBlogger=function(t,n,r,s,o,u,c){var h=i.createTask();a(h),f(h),h.onRun(function(){function f(){var t="https://www.googleapis.com/blogger/v3/blogs/"+n+"/posts/",a={kind:"blogger#post",blog:{id:n},labels:s,title:o,content:u},f="POST";r!==undefined&&(t+=r,a.id=r,f="PUT"),e.ajax({url:t,data:JSON.stringify(a),headers:i,type:f,contentType:"application/json",dataType:"json",timeout:AJAX_TIMEOUT}).done(function(e,t,n){r=e.id,h.chain()}).fail(function(e){var t={code:e.status,message:e.statusText};t.code===404&&r!==undefined&&(t="Post "+r+" not found on Blogger.|removePublish"),l(t,h)})}function c(){if(n!==undefined){h.chain(f);return}e.ajax({url:"https://www.googleapis.com/blogger/v3/blogs/byurl",data:{url:t},headers:i,dataType:"json",timeout:AJAX_TIMEOUT}).done(function(e,t,r){n=e.id,h.chain(f)}).fail(function(e){var n={code:e.status,message:e.statusText};n.code===404&&(n='Blog "'+t+'" not found on Blogger.|removePublish'),l(n,h)})}var i={},a=gapi.auth.getToken();a&&(i.Authorization="Bearer "+a.access_token),h.chain(c)}),h.onSuccess(function(){c(undefined,n,r)}),h.onError(function(e){c(e)}),i.addTask(h)},u}),define("providers/gdrive-provider",["underscore","core","utils","settings","extension-manager","file-manager","helpers/google-helper"],function(e,t,n,r,i,s,o){function f(e){return"sync."+u+"."+e}function l(e,t,r,i){var s={};return s.provider=a,s.id=e,s.etag=t,s.contentCRC=n.crc32(r),s.titleCRC=n.crc32(i),s.syncIndex=f(e),n.storeAttributes(s),s}function c(t){o.downloadMetadata(t,function(t,n){if(t)return;o.downloadContent(n,function(t,n){if(t)return;var r=[];e.each(n,function(e){var t=l(e.id,e.etag,e.content,e.title),n={};n[t.syncIndex]=t;var i=s.createFile(e.title,e.content,n);s.selectFile(i),r.push(i)}),r.length!==0&&i.onSyncImportSuccess(r,a)})})}var u="gdrive",a={providerId:u,providerName:"Google Drive",defaultPublishFormat:"template",exportPreferencesInputIds:["gdrive-parentid"]};return a.importFiles=function(){o.picker(function(t,n){if(t||n.length===0)return;var r=[];e.each(n,function(e){var t=f(e.id),n=s.getFileFromSyncIndex(t);if(n!==undefined){i.onError('"'+n.title+'" was already imported.');return}r.push(e.id)}),c(r)})},a.exportFile=function(e,t,r,i){var s=n.getInputTextValue("#input-sync-export-gdrive-parentid");o.upload(undefined,s,t,r,undefined,function(e,n){if(e){i(e);return}var s=l(n.id,n.etag,r,t);i(undefined,s)})},a.exportManual=function(e,t,r,u){var a=n.getInputTextValue("#input-sync-manual-gdrive-id",e);if(!a)return;var c=f(a),h=s.getFileFromSyncIndex(c);if(h!==undefined){i.onError('File ID is already synchronized with "'+h.title+'".'),u(!0);return}o.upload(a,undefined,t,r,undefined,function(e,n){if(e){u(e);return}var i=l(n.id,n.etag,r,t);u(undefined,i)})},a.syncUp=function(e,t,n,r,i,s){var u=i.contentCRC,a=i.titleCRC;if(t==u&&r==a){s(undefined,!1);return}o.upload(i.id,undefined,n,e,i.etag,function(e,n){if(e){s(e,!0);return}i.etag=n.etag,i.contentCRC=t,i.titleCRC=r,s(undefined,!0)})},a.syncDown=function(t){var r=parseInt(localStorage[u+".lastChangeId"]);o.checkChanges(r,function(r,a,l){if(r){t(r);return}var c=[];e.each(a,function(e){var t=f(e.fileId),n=s.getSyncAttributes(t);if(n===undefined)return;e.syncAttributes=n;if(e.deleted===!0){c.push(e);return}n.etag!=e.file.etag&&c.push(e)}),o.downloadContent(c,function(r,o){if(r){t(r);return}e.each(o,function(e){var t=e.syncAttributes,r=t.syncIndex,o=s.getFileFromSyncIndex(r);if(o===undefined)return;var u=o.title;if(e.deleted===!0){i.onError('"'+u+'" has been removed from Google Drive.'),s.removeSync(t);return}var a=t.titleCRC!=n.crc32(u),f=o.content,l=t.contentCRC!=n.crc32(f),c=e.file,h=n.crc32(c.title),p=t.titleCRC!=h,d=u!=c.title,v=n.crc32(c.content),m=t.contentCRC!=v,g=f!=c.content;if(d===!0&&a===!0&&p===!0||g===!0&&l===!0&&m===!0)s.createFile(u+" (backup)",f),i.onMessage('Conflict detected on "'+u+'". A backup has been created locally.');d&&p===!0&&(o.title=c.title,i.onMessage('"'+u+'" has been renamed to "'+c.title+'" on Google Drive.')),g&&m===!0&&(o.content=c.content,i.onMessage('"'+c.title+'" has been updated from Google Drive.'),s.isCurrentFile(o)&&s.selectFile()),t.etag=c.etag,t.contentCRC=v,t.titleCRC=h,n.storeAttributes(t)}),localStorage[u+".lastChangeId"]=l,t()})})},a.publish=function(e,t,n,r){o.upload(e.id,undefined,e.fileName||t,n,undefined,function(t,n){if(t){r(t);return}e.id=n.id,r()})},a.newPublishAttributes=function(e){var t={};return t.id=n.getInputTextValue("#input-publish-gdrive-fileid"),t.fileName=n.getInputTextValue("#input-publish-gdrive-filename"),e.isPropagationStopped()?undefined:t},t.onReady(function(){var t=localStorage[u+".state"];if(t===undefined)return;localStorage.removeItem(u+".state"),t=JSON.parse(t);if(t.action=="create")o.upload(undefined,t.folderId,GDRIVE_DEFAULT_FILE_TITLE,r.defaultContent,undefined,function(e,t){if(e)return;var n=l(t.id,t.etag,t.content,t.title),r={};r[n.syncIndex]=n;var o=s.createFile(t.title,t.content,n);s.selectFile(o),i.onMessage('"'+t.title+'" created successfully on Google Drive.')});else if(t.action=="open"){var n=[];e.each(t.ids,function(e){var t=f(e),r=s.getFileFromSyncIndex(t);r!==undefined?s.selectFile(r):n.push(e)}),c(n)}}),a}),define("synchronizer",["jquery","underscore","core","utils","extension-manager","file-system","file-manager","providers/dropbox-provider","providers/gdrive-provider"],function(e,t,n,r,i,s,o){function d(e){if(f.length===0){m(e);return}var t=f.pop();t.provider.syncUp(l,c,h,p,t,function(n,i){i===!0&&(g=!0);if(n){e(n);return}i&&r.storeAttributes(t),d(e)})}function m(e){if(v.length===0){y(e);return}var n=v.pop();f=t.values(n.syncLocations);if(f.length===0){m(e);return}l=n.content,c=r.crc32(l),h=n.title,p=r.crc32(h),d(e)}function y(e){g===!0?(g=!1,v=t.values(s),m(e)):e()}function w(e){if(b.length===0){e();return}var t=b.pop();if(!o.hasSync(t)){w(e);return}t.syncDown(function(t){if(t){e(t);return}w(e)})}function E(e){b=t.values(a),w(e)}function T(n){r.resetModalInputs();var i=localStorage[n.providerId+".exportPreferences"];if(i){var s=JSON.parse(i);t.each(n.exportPreferencesInputIds,function(e){r.setInputValue("#input-sync-export-"+e,s[e])})}e("#modal-upload-"+n.providerId).modal()}var u={},a=t.chain(arguments).map(function(e){return e&&e.providerId&&[e.providerId,e]}).compact().object().value();t.each(s,function(e){t.chain(localStorage[e.fileIndex+".sync"].split(";")).compact().each(function(t){var n=JSON.parse(localStorage[t]);n.syncIndex=t,n.provider=a[n.provider],e.syncLocations[t]=n})}),u.forceSync=function(){x=0,u.sync()};var f=[],l=undefined,c=undefined,h=undefined,p=undefined,v=[],g=!1,b=[],S=!1,x=0;return u.sync=function(){function e(e){return e!==undefined?(S=!1,i.onSyncRunning(!1),!0):!1}if(S||x+SYNC_PERIOD>r.currentTime||n.isOffline)return;S=!0,i.onSyncRunning(!0),g=!0,x=r.currentTime,E(function(t){if(e(t))return;y(function(t){if(e(t))return;S=!1,i.onSyncRunning(!1),i.onSyncSuccess()})})},viewerMode===!1&&n.addPeriodicCallback(u.sync),n.onReady(function(){t.each(a,function(n){e(".action-sync-import-"+n.providerId).click(function(e){n.importFiles(e)}),e(".action-sync-export-dialog-"+n.providerId).click(function(){T(n)}),e(".action-sync-export-"+n.providerId).click(function(r){var i=o.getCurrentFile();n.exportFile(r,i.title,i.content,function(e,t){if(e)return;o.addSync(i,t)});var s={};t.each(n.exportPreferencesInputIds,function(t){s[t]=e("#input-sync-export-"+t).val()}),localStorage[n.providerId+".exportPreferences"]=JSON.stringify(s)}),e(".action-sync-manual-"+n.providerId).click(function(e){var t=o.getCurrentFile();n.exportManual(e,t.title,t.content,function(e,n){if(e)return;o.addSync(t,n)})})})}),i.onSynchronizerCreated(u),u}),define("providers/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("helpers/github-helper",["jquery","core","utils","extension-manager","async-runner"],function(e,t,n,r,i){function a(n){n.onRun(function(){if(t.isOffline===!0){s=!1,n.error(new Error("Operation not available in offline mode.|stopPublish"));return}if(s===!0){n.chain();return}e.ajax({url:"lib/github.js",dataType:"script",timeout:AJAX_TIMEOUT}).done(function(){s=!0,n.chain()}).fail(function(e){var t={error:e.status,message:e.statusText};l(t,n)})})}function f(t){var i=undefined,s=undefined;t.onRun(function(){function l(){localStorage.removeItem("githubCode"),i=n.popupWindow("github-oauth-client.html?client_id="+GITHUB_CLIENT_ID,"stackedit-github-oauth",960,600),i.focus(),s=setInterval(function(){if(i.closed===!0){clearInterval(s),i=undefined,s=undefined,f=localStorage.githubCode;if(f===undefined){t.error(new Error(a));return}localStorage.removeItem("githubCode"),t.chain(c)}},500)}function c(){e.getJSON(GATEKEEPER_URL+"authenticate/"+f,function(e){e.token!==undefined?(u=e.token,localStorage.githubToken=u,o=new Github({token:u,auth:"oauth"}),t.chain()):t.error(new Error(a))})}if(o!==undefined){t.chain();return}var u=localStorage.githubToken;if(u!==undefined){o=new Github({token:u,auth:"oauth"}),t.chain();return}r.onMessage("Please make sure the Github authorization popup is not blocked by your browser.");var a="Failed to retrieve a token from GitHub.";t.timeout=ASYNC_TASK_LONG_TIMEOUT;var f=undefined;t.chain(l)}),t.onError(function(){s!==undefined&&clearInterval(s),i!==undefined&&i.close()})}function l(e,n){var r=undefined;if(e){logger.error(e);if(typeof e=="string")r=e;else{r="Could not publish on GitHub.";if(e.error===401||e.error===403){o=undefined,localStorage.removeItem("githubToken"),r="Access to GitHub account is not authorized.",n.retry(new Error(r),1);return}e.error<=0&&(s=!1,o=undefined,t.setOffline(),r="|stopPublish")}}n.error(new Error(r))}var s=undefined,o=undefined,u={};return u.upload=function(e,t,n,r,s,u){var c=i.createTask();a(c),f(c),c.onRun(function(){function u(){var e=o.getUser();e.show(undefined,function(e,t){if(e){l(e,c);return}i=t.login,c.chain(a)})}function a(){var u=o.getRepo(i,e);u.write(t,n,r,s,function(e){if(e){l(e,c);return}c.chain()})}var i=undefined;c.chain(u)}),c.onSuccess(function(){u()}),c.onError(function(e){u(e)}),i.addTask(c)},u.uploadGist=function(e,t,n,r,s,u){var c=i.createTask();a(c),f(c),c.onRun(function(){var i=o.getGist(e),u={};u[t]={content:s},githubFunction=i.update,e===undefined&&(githubFunction=i.create),githubFunction({description:r,"public":n,files:u},function(t,n){if(t){t.error===404&&e!==undefined&&(t="Gist "+e+" not found on GitHub.|removePublish"),l(t,c);return}e=n.id,c.chain()})}),c.onSuccess(function(){u(undefined,e)}),c.onError(function(e){u(e)}),i.addTask(c)},u.downloadGist=function(e,t,n){var r=i.createTask();a(r);var s=undefined,o=undefined;r.onRun(function(){var n=new Github({}),i=n.getGist(e);i.read(function(n,i){if(n){r.error(new Error("Error trying to access Gist "+e+"."));return}s=i.description;var u=i.files[t];if(u===undefined){r.error(new Error("Gist "+e+' does not contain "'+t+'".'));return}o=u.content,r.chain()})}),r.onSuccess(function(){n(undefined,s,o)}),r.onError(function(e){n(e)}),i.addTask(r)},u}),define("providers/gist-provider",["utils","helpers/github-helper"],function(e,t){var n="gist",r={providerId:n,providerName:"Gist",sharingAttributes:["gistId","filename"]};return r.publish=function(e,n,r,i){t.uploadGist(e.gistId,e.filename,e.isPublic,n,r,function(t,n){if(t){i(t);return}e.gistId=n,i()})},r.newPublishAttributes=function(t){var n={};return n.gistId=e.getInputTextValue("#input-publish-gist-id"),n.filename=e.getInputTextValue("#input-publish-filename",t),n.isPublic=e.getInputChecked("#input-publish-gist-public"),t.isPropagationStopped()?undefined:n},r.importPublic=function(e,n){t.downloadGist(e.gistId,e.filename,n)},r}),define("sharing",["jquery","underscore","core","utils","extension-manager","file-manager","async-runner","providers/download-provider","providers/gist-provider"],function(e,t,n,r,i,s,o){var u={},a=t.chain(arguments).map(function(e){return e&&e.providerId&&[e.providerId,e]}).compact().object().value(),f=['
          ',' ',' ',"
          "].join("");return u.refreshDocumentSharing=function(n){var r=e("#link-container .link-list").empty();e("#link-container .no-link").show(),t.each(n,function(n){if(n.sharingLink){var i=e(t.template(f,{link:n.sharingLink}));i.click(function(e){e.stopPropagation()}),r.append(i),e("#link-container .no-link").hide()}})},u.createLink=function(r,s){function c(){s()}var u=a[r.provider.providerId];if(r.sharingLink!==undefined||u===undefined||r.format!="markdown"){s();return}var f=o.createTask(),l=undefined;f.onRun(function(){if(n.isOffline===!0){f.chain();return}var s=[MAIN_URL,"viewer.html?provider=",u.providerId];t.each(u.sharingAttributes,function(e){s.push("&"),s.push(e),s.push("="),s.push(encodeURIComponent(r[e]))}),s=s.join(""),e.getJSON("https://api-ssl.bitly.com/v3/shorten",{access_token:BITLY_ACCESS_TOKEN,longUrl:s},function(e){e.data?(l=e.data.url,r.sharingLink=l):(i.onError("An error occured while creating sharing link."),r.sharingLink=s),f.chain()})}),f.onSuccess(c),f.onError(c),o.addTask(f)},n.onReady(function(){if(viewerMode===!1)return;var n=r.getURLParameter("provider");n===undefined&&(n="download");var i=a[n];if(i===undefined)return;var o={};t.each(i.sharingAttributes,function(e){var t=r.getURLParameter(e);if(!t){o=undefined;return}o[e]=t});if(o===undefined)return;e("#wmd-preview, #file-title").hide(),i.importPublic(o,function(t,n,r){e("#wmd-preview, #file-title").show();if(t)return;var i=s.createFile(n,r,undefined,!0);s.selectFile(i)})}),u}),define("providers/blogger-provider",["underscore","utils","helpers/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.getInputTextValue("#input-publish-blogger-url",n);i!==undefined&&(r.blogUrl=t.checkUrl(i)),r.postId=t.getInputTextValue("#input-publish-postid"),r.labelList=[];var s=t.getInputTextValue("#input-publish-labels");return s!==undefined&&(r.labelList=e.chain(s.split(",")).map(function(e){return t.trim(e)}).compact().value()),n.isPropagationStopped()?undefined:r},i}),define("providers/github-provider",["utils","settings","helpers/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.commitMsg;n.upload(e.repository,e.branch,e.path,i,o,s)},i.newPublishAttributes=function(t){var n={};return n.repository=e.getInputTextValue("#input-publish-github-reponame",t),n.branch=e.getInputTextValue("#input-publish-github-branch",t),n.path=e.getInputTextValue("#input-publish-file-path",t),t.isPropagationStopped()?undefined:n},i}),define("helpers/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&&(logger.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(t,r,o,u,a,f,l,c){var h=n.createTask();i(h),h.onRun(function(){var n=SSH_PROXY_URL+"upload",i={host:t,port:r,username:o,password:u,path:a,title:f,content:l};e.ajax({url:n,data:i,type:"POST",dataType:"json",timeout:AJAX_TIMEOUT}).done(function(e,t,n){if(e.error===undefined){h.chain();return}s(e.error,h)}).fail(function(e){var t={code:e.status,message:e.statusText};s(t,h)})}),h.onSuccess(function(){c()}),h.onError(function(e){c(e)}),n.addTask(h)},r}),define("providers/ssh-provider",["utils","helpers/ssh-helper"],function(e,t){var n="ssh",r={providerId:n,providerName:"SSH server",publishPreferencesInputIds:["ssh-host","ssh-port","ssh-username","ssh-password"]};return r.publish=function(e,n,r,i){t.upload(e.host,e.port,e.username,e.password,e.path,n,r,i)},r.newPublishAttributes=function(t){var n={};return n.host=e.getInputTextValue("#input-publish-ssh-host",t,/^(([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])$/),n.port=e.getInputIntValue("#input-publish-ssh-port",undefined,0),n.username=e.getInputTextValue("#input-publish-ssh-username",t),n.password=e.getInputTextValue("#input-publish-ssh-password",t),n.path=e.getInputTextValue("#input-publish-file-path",t),t.isPropagationStopped()?undefined:n},r}),define("helpers/tumblr-helper",["jquery","core","utils","extension-manager","async-runner"],function(e,t,n,r,i){function u(e){e.onRun(function(){if(t.isOffline===!0){e.error(new Error("Operation not available in offline mode.|stopPublish"));return}e.chain()})}function a(t){var i=undefined,o=undefined;t.onRun(function(){function l(){e.getJSON(TUMBLR_PROXY_URL+"request_token",function(e){e.oauth_token!==undefined?(f=e,t.chain(c)):t.error(new Error(a))})}function c(){localStorage.removeItem("tumblrVerifier"),i=n.popupWindow("tumblr-oauth-client.html?oauth_token="+f.oauth_token,"stackedit-tumblr-oauth",800,600),i.focus(),o=setInterval(function(){if(i.closed===!0){clearInterval(o),i=undefined,o=undefined,f.oauth_verifier=localStorage.tumblrVerifier;if(f.oauth_verifier===undefined){t.error(new Error(a));return}localStorage.removeItem("tumblrVerifier"),t.chain(h)}},500)}function h(){e.getJSON(TUMBLR_PROXY_URL+"access_token",f,function(e){e.access_token!==undefined&&e.access_token_secret!==undefined?(localStorage.tumblrOauthParams=JSON.stringify(e),s=e,t.chain()):t.error(new Error(a))})}if(s!==undefined){t.chain();return}var u=localStorage.tumblrOauthParams;if(u!==undefined){s=JSON.parse(u),t.chain();return}r.onMessage("Please make sure the Tumblr authorization popup is not blocked by your browser.");var a="Failed to retrieve a token from Tumblr.";t.timeout=ASYNC_TASK_LONG_TIMEOUT;var f=undefined;t.chain(l)}),t.onError(function(){o!==undefined&&clearInterval(o),i!==undefined&&i.close()})}function f(e,n){var r=undefined;if(e){logger.error(e);if(typeof e=="string")r=e;else{r="Could not publish on Tumblr.";if(e.code===401||e.code===403){s=undefined,localStorage.removeItem("tumblrOauthParams"),r="Access to Tumblr account is not authorized.",n.retry(new Error(r),1);return}e.code<=0&&(t.setOffline(),r="|stopPublish")}}n.error(new Error(r))}var s=undefined,o={};return o.upload=function(t,n,r,o,l,c,h){var p=i.createTask();u(p),a(p),p.onRun(function(){var i=e.extend({blog_hostname:t,post_id:n,tags:r,format:o,title:l,content:c},s);e.ajax({url:TUMBLR_PROXY_URL+"post",data:i,type:"POST",dataType:"json",timeout:AJAX_TIMEOUT}).done(function(e,t,r){n=e.id,p.chain()}).fail(function(e){var t={code:e.status,message:e.statusText};t.code===404&&n!==undefined&&(t="Post "+n+" not found on Tumblr.|removePublish"),f(t,p)})}),p.onSuccess(function(){h(undefined,n)}),p.onError(function(e){h(e)}),i.addTask(p)},o}),define("providers/tumblr-provider",["utils","helpers/tumblr-helper"],function(e,t){var n="tumblr",r={providerId:n,providerName:"Tumblr",publishPreferencesInputIds:["tumblr-hostname"]};return r.publish=function(e,n,r,i){t.upload(e.blogHostname,e.postId,e.tags,e.format=="markdown"?"markdown":"html",n,r,function(t,n){if(t){i(t);return}e.postId=n,i()})},r.newPublishAttributes=function(t){var n={};return n.blogHostname=e.getInputTextValue("#input-publish-tumblr-hostname",t,/^(([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])$/),n.postId=e.getInputTextValue("#input-publish-postid"),n.tags=e.getInputTextValue("#input-publish-tags"),t.isPropagationStopped()?undefined:n},r}),define("helpers/wordpress-helper",["jquery","core","utils","extension-manager","async-runner"],function(e,t,n,r,i){function u(e){e.onRun(function(){if(t.isOffline===!0){e.error(new Error("Operation not available in offline mode.|stopPublish"));return}e.chain()})}function a(t){var i=undefined,o=undefined;t.onRun(function(){function f(){localStorage.removeItem("wordpressCode"),i=n.popupWindow("wordpress-oauth-client.html?client_id="+WORDPRESS_CLIENT_ID,"stackedit-wordpress-oauth",960,600),i.focus(),o=setInterval(function(){if(i.closed===!0){clearInterval(o),i=undefined,o=undefined,a=localStorage.wordpressCode;if(a===undefined){t.error(new Error(u));return}localStorage.removeItem("wordpressCode"),t.chain(l)}},500)}function l(){e.getJSON(WORDPRESS_PROXY_URL+"authenticate/"+a,function(e){e.token!==undefined?(s=e.token,localStorage.wordpressToken=s,t.chain()):t.error(new Error(u))})}s=localStorage.wordpressToken;if(s!==undefined){t.chain();return}r.onMessage("Please make sure the Wordpress authorization popup is not blocked by your browser.");var u="Failed to retrieve a token from Wordpress.";t.timeout=ASYNC_TASK_LONG_TIMEOUT;var a=undefined;t.chain(f)}),t.onError(function(){o!==undefined&&clearInterval(o),i!==undefined&&i.close()})}function f(e,n){var r=undefined;if(e){logger.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 s=undefined,o={};return o.upload=function(t,n,r,o,l,c){var h=i.createTask();u(h),a(h),h.onRun(function(){var i=WORDPRESS_PROXY_URL+"post",u={token:s,site:t,postId:n,tags:r,title:o,content:l};e.ajax({url:i,data:u,type:"POST",dataType:"json",timeout:AJAX_TIMEOUT}).done(function(e,r,i){if(e.body.ID){n=e.body.ID,h.chain();return}var s={code:e.code,message:e.body.error};s.code===404&&(s.message=="unknown_blog"?s='Site "'+t+'" not found on WordPress.|removePublish':s.message=="unknown_post"&&(s="Post "+n+" not found on WordPress.|removePublish")),f(s,h)}).fail(function(e){var t={code:e.status,message:e.statusText};f(t,h)})}),h.onSuccess(function(){c(undefined,n)}),h.onError(function(e){c(e)}),i.addTask(h)},o}),define("providers/wordpress-provider",["utils","helpers/wordpress-helper"],function(e,t){var n="wordpress",r={providerId:n,providerName:"WordPress",defaultPublishFormat:"html",publishPreferencesInputIds:["wordpress-site"]};return r.publish=function(e,n,r,i){t.upload(e.site,e.postId,e.tags,n,r,function(t,n){if(t){i(t);return}e.postId=n,i()})},r.newPublishAttributes=function(t){var n={};return n.site=e.getInputTextValue("#input-publish-wordpress-site",t,/^(([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])$/),n.postId=e.getInputTextValue("#input-publish-postid"),n.tags=e.getInputTextValue("#input-publish-tags"),t.isPropagationStopped()?undefined:n},r}),define("publisher",["jquery","underscore","core","utils","settings","extension-manager","file-system","file-manager","sharing","providers/blogger-provider","providers/dropbox-provider","providers/gist-provider","providers/github-provider","providers/gdrive-provider","providers/ssh-provider","providers/tumblr-provider","providers/wordpress-provider"],function(e,t,n,r,i,s,o,u,a){function c(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():f.applyTemplate(t)}function d(e,t){if(h.length===0){e(t);return}var n=h.pop(),r=c(n);n.provider.publish(n,p,r,function(r){if(r!==undefined){var i=r.toString();i.indexOf("|removePublish")!==-1&&u.removePublish(n);if(i.indexOf("|stopPublish")!==-1){e(r);return}}d(e,t||r)})}function m(e,n){var i=undefined;do i="publish."+r.randomString();while(t.has(localStorage,i));n.publishIndex=i,r.storeAttributes(n),u.addPublish(e,n)}function y(n){var i=n.defaultPublishFormat||"markdown";g=n,e(".publish-provider-name").text(n.providerName),e('div[class*=" modal-publish-"]').hide().filter(".modal-publish-"+n.providerId).show(),r.resetModalInputs(),e("input:radio[name=radio-publish-format][value="+i+"]").prop("checked",!0);var s=localStorage[n.providerId+".publishPreferences"];if(s){var o=JSON.parse(s);t.each(n.publishPreferencesInputIds,function(e){r.setInputValue("#input-publish-"+e,o[e])}),r.setInputRadio("radio-publish-format",o.format)}e("#modal-publish").modal()}function b(n){var r=g,i=r.newPublishAttributes(n);if(i===undefined)return;var s=u.getCurrentFile(),o=s.title,f=c(i);r.publish(i,o,f,function(e){e===undefined&&(i.provider=r,a.createLink(i,function(){m(s,i)}))});var l={};t.each(r.publishPreferencesInputIds,function(t){l[t]=e("#input-publish-"+t).val()}),l.format=i.format,localStorage[r.providerId+".publishPreferences"]=JSON.stringify(l)}var f={},l=t.chain(arguments).map(function(e){return e&&e.providerId&&[e.providerId,e]}).compact().object().value();t.each(o,function(e){t.chain(localStorage[e.fileIndex+".publish"].split(";")).compact().each(function(t){var n=JSON.parse(localStorage[t]);n.publishIndex=t,n.provider=l[n.provider],e.publishLocations[t]=n})}),f.applyTemplate=function(n){var r=u.getCurrentFile();try{return t.template(i.template,{documentTitle:r.title,documentMarkdown:e("#wmd-input").val(),documentHTML:e("#wmd-preview").html(),publishAttributes:n})}catch(o){throw s.onError(o),o}};var h=[],p=undefined,v=!1;f.publish=function(){if(v===!0||n.isOffline)return;v=!0,s.onPublishRunning(!0);var e=u.getCurrentFile();p=e.title,h=t.values(e.publishLocations),d(function(t){v=!1,s.onPublishRunning(!1),t===undefined&&s.onPublishSuccess(e)})};var g=undefined;return f.populatePublishLocations=function(e){t.chain(localStorage[e.fileIndex+".publish"].split(";")).compact().each(function(t){var n=JSON.parse(localStorage[t]);n.publishIndex=t,n.provider=l[n.provider],e.publishLocations[t]=n})},n.onReady(function(){var n=e("#publish-menu");t.each(l,function(t){n.append(e("
        • ").append(e(' '+t.providerName+"").click(function(){y(t)}))),e(".action-publish-"+t.providerId).click(function(){y(t)})}),e(".action-process-publish").click(b),e(".action-download-md").click(function(){var t=e("#wmd-input").val(),n=u.getCurrentFile().title;r.saveAs(t,n+".md")}),e(".action-download-html").click(function(){var t=e("#wmd-preview").html(),n=u.getCurrentFile().title;r.saveAs(t,n+".html")}),e(".action-download-template").click(function(){var e=f.applyTemplate(),t=u.getCurrentFile().title;r.saveAs(e,t+".txt")})}),s.onPublisherCreated(f),f}),define("providers/gplus-provider",["underscore","core","utils","extension-manager","helpers/google-helper"],function(e,t,n,r,i){function u(t,n){var r=undefined;return e.find(t.thumbnails,function(e){var t=!1;return e.url.replace(/(.*\/s)\d.*?(\/[^\/]+)/,function(e,i,s){r=i+n+s,t=!0}),t}),r}var s="gplus",o={providerId:s,providerName:"Google+"},a=undefined,f=undefined;return o.importImage=function(e){a=e,i.picker(function(t,i){if(t||i.length===0){e(t);return}f=i[0];if(!f.thumbnails){r.onError("Image "+f.title+" is not accessible."),e(!0);return}n.resetModalInputs(),$("#modal-import-image img").prop("src",u(f,128)),n.setInputValue("#input-import-image-title",f.name);var o=localStorage[s+".importImagePreferences"];if(o){var a=JSON.parse(o);n.setInputValue("#input-import-image-size",a.size)}$("#modal-import-image").modal()},!0)},t.onReady(function(){$(".action-import-image").click(function(e){var t=n.getInputIntValue("#input-import-image-size",undefined,0)||0,r=n.getInputTextValue("#input-import-image-title"),i=u(f,t);r&&(i+=' "'+r+'"'),a(undefined,i);var o={};t&&(o.size=t),localStorage[s+".importImagePreferences"]=JSON.stringify(o)})}),o}),define("media-importer",["jquery","underscore","core","providers/gplus-provider"],function(e,t,n){var r={},i=t.chain(arguments).map(function(e){return e&&e.providerId&&[e.providerId,e]}).compact().object().value();return n.onReady(function(){t.each(i,function(t){e(".action-import-image-"+t.providerId).click(function(){var e=n.insertLinkCallback;n.insertLinkCallback=undefined,t.importImage(function(t,n){if(t){e(null);return}e(n||null)})})})}),r}),requirejs.config({waitSeconds:0,paths:{jquery:"libs/jquery",underscore:"libs/underscore",jgrowl:"libs/jgrowl","libs/MathJax":"../lib/MathJax/MathJax.js?config=TeX-AMS_HTML"},shim:{underscore:{exports:"_"},jgrowl:{deps:["jquery"],exports:"jQuery.jGrowl"},"libs/jquery-ui":["jquery"],"libs/bootstrap":["jquery"],"libs/jquery.waitforimages":["jquery"],"libs/layout":["libs/jquery-ui"],"libs/Markdown.Extra":["libs/Markdown.Converter","libs/prettify"],"libs/Markdown.Editor":["libs/Markdown.Converter"]}});var logger={debug:function(){},log:function(){},info:function(){},warn:function(){},error:function(){}};location.search.match(/(\?|&)console/)&&(logger=console),require(["jquery","core","synchronizer","publisher","media-importer"],function(e,t){e(function(){window.applicationCache&&window.applicationCache.addEventListener("updateready",function(e){window.applicationCache.status===window.applicationCache.UPDATEREADY&&(window.applicationCache.swapCache(),window.location.reload())},!1),t.setReady()})}),define("main",function(){});