/*!
* jQuery JavaScript Library v2.0.3
* http://jquery.com/
*
* Includes Sizzle.js
* http://sizzlejs.com/
*
* Copyright 2005, 2013 jQuery Foundation, Inc. and other contributors
* Released under the MIT license
* http://jquery.org/license
*
* Date: 2013-07-03T13:30Z
*/
/*!
* Sizzle CSS Selector Engine v1.9.4-pre
* http://sizzlejs.com/
*
* Copyright 2013 jQuery Foundation, Inc. and other contributors
* Released under the MIT license
* http://jquery.org/license
*
* Date: 2013-06-03
*/
/**
* @license Rangy, a cross-browser JavaScript range and selection library
* http://code.google.com/p/rangy/
*
* Copyright 2012, Tim Down
* Licensed under the MIT license.
* Version: 1.2.3
* Build date: 26 February 2012
*/
// Underscore.js 1.5.1
// http://underscorejs.org
// (c) 2009-2013 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
// Underscore may be freely distributed under the MIT license.
//Copyright (C) 2012 Kory Nunn
//Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
//The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
/*!
* XRegExp-All 3.0.0-pre
*
* Steven Levithan � 2012 MIT License
*/
/*!
* XRegExp 3.0.0-pre
*
* Steven Levithan � 2007-2012 MIT License
*/
/*!
* XRegExp.build 3.0.0-pre
*
* Steven Levithan � 2012 MIT License
* Inspired by Lea Verou's RegExp.create
*/
/*!
* XRegExp.matchRecursive 3.0.0-pre
*
* Steven Levithan � 2009-2012 MIT License
*/
/*!
* XRegExp Unicode Base 3.0.0-pre
*
* Steven Levithan � 2008-2012 MIT License
* Uses Unicode 6.2.0
* Unicode data generated by Mathias Bynens
*/
/*!
* XRegExp Unicode Blocks 3.0.0-pre
*
* Steven Levithan � 2010-2012 MIT License
* Uses Unicode 6.2.0
* Unicode data generated by Mathias Bynens
*/
/*!
* XRegExp Unicode Categories 3.0.0-pre
*
* Steven Levithan � 2010-2012 MIT License
* Uses Unicode 6.2.0
* Unicode data generated by Mathias Bynens
*/
/*!
* XRegExp Unicode Properties 3.0.0-pre
*
* Steven Levithan � 2012 MIT License
* Uses Unicode 6.2.0
* Unicode data generated by Mathias Bynens
*/
/*!
* XRegExp Unicode Scripts 3.0.0-pre
*
* Steven Levithan � 2010-2012 MIT License
* Uses Unicode 6.2.0
* Unicode data generated by Mathias Bynens
*/
/*! FileSaver.js
* A saveAs() FileSaver implementation.
* 2014-01-24
*
* By Eli Grey, http://eligrey.com
* License: X11/MIT
* See LICENSE.md
*/
/*! @source http://purl.eligrey.com/github/FileSaver.js/blob/master/FileSaver.js */
/**
* @license RequireJS text 2.0.12 Copyright (c) 2010-2014, The Dojo Foundation All Rights Reserved.
* Available via the MIT or new BSD license.
* see: http://github.com/requirejs/text for details
*/
/*
Copyright (c) 2010 Jeremy Faivre
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is furnished
to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
// Copyright (C) 2006 Google 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.
/*
* to-markdown - an HTML to Markdown converter
*
* Copyright 2011-2012, Dom Christie
* Licenced under the MIT licence
*
*/
/**
* Copyright 2013 Craig Campbell
*
* 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.
*
* Mousetrap is a simple keyboard shortcut library for Javascript with
* no external dependencies
*
* @version 1.4.6
* @url craig.is/killing/mice
*/
/**
* jGrowl 1.2.10
*
* 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.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
*/
/*!
* Bootstrap v3.0.3 (http://getbootstrap.com)
* Copyright 2013 Twitter, Inc.
* Licensed under http://www.apache.org/licenses/LICENSE-2.0
*/
/* ========================================================================
* Bootstrap: transition.js v3.0.3
* http://getbootstrap.com/javascript/#transitions
* ========================================================================
* Copyright 2013 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 v3.0.3
* http://getbootstrap.com/javascript/#alerts
* ========================================================================
* Copyright 2013 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 v3.0.3
* http://getbootstrap.com/javascript/#buttons
* ========================================================================
* Copyright 2013 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 v3.0.3
* http://getbootstrap.com/javascript/#carousel
* ========================================================================
* Copyright 2013 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 v3.0.3
* http://getbootstrap.com/javascript/#collapse
* ========================================================================
* Copyright 2013 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 v3.0.3
* http://getbootstrap.com/javascript/#dropdowns
* ========================================================================
* Copyright 2013 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 v3.0.3
* http://getbootstrap.com/javascript/#modals
* ========================================================================
* Copyright 2013 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 v3.0.3
* http://getbootstrap.com/javascript/#tooltip
* Inspired by the original jQuery.tipsy by Jason Frame
* ========================================================================
* Copyright 2013 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 v3.0.3
* http://getbootstrap.com/javascript/#popovers
* ========================================================================
* Copyright 2013 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 v3.0.3
* http://getbootstrap.com/javascript/#scrollspy
* ========================================================================
* Copyright 2013 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 v3.0.3
* http://getbootstrap.com/javascript/#tabs
* ========================================================================
* Copyright 2013 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 v3.0.3
* http://getbootstrap.com/javascript/#affix
* ========================================================================
* Copyright 2013 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-tour - v0.7.3
# http://bootstraptour.com
# ==============================================================
# Copyright 2012-2013 Ulrich Sossou
#
# 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.
*/
/**
* Prism: Lightweight, robust, elegant syntax highlighting
* MIT license http://www.opensource.org/licenses/mit-license.php/
* @author Lea Verou http://lea.verou.me
*/
/**
* Diff Match and Patch
*
* Copyright 2006 Google Inc.
* http://code.google.com/p/google-diff-match-patch/
*
* 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.
*/
/*
* Copyright 2012 The Polymer Authors. All rights reserved.
* Use of this source code is governed by a BSD-style
* license that can be found in the LICENSE file.
*/
/*
* Copyright 2012 The Polymer Authors. All rights reserved.
* Use of this source code is goverened by a BSD-style
* license that can be found in the LICENSE file.
*/
/*! Hammer.JS - v1.0.10 - 2014-03-28
* http://eightmedia.github.io/hammer.js
*
* Copyright (c) 2014 Jorik Tangelder ;
* Licensed under the MIT license */
/**
* @license CSS Class Applier module for Rangy.
* Adds, removes and toggles CSS classes on Ranges and Selections
*
* Part of Rangy, a cross-browser JavaScript range and selection library
* http://code.google.com/p/rangy/
*
* Depends on Rangy core.
*
* Copyright 2012, Tim Down
* Licensed under the MIT license.
* Version: 1.2.3
* Build date: 26 February 2012
*/
function printStackTrace(e) {
e = e || {
guess: !0
};
var t = e.e || null,
n = !! e.guess,
i = new printStackTrace.implementation,
r = i.run(t);
return n ? i.guessAnonymousFunctions(r) : r
}
function diff_match_patch() {
this.Diff_Timeout = 1, this.Diff_EditCost = 4, this.Match_Threshold = .5, this.Match_Distance = 1e3, this.Patch_DeleteThreshold = .5, this.Patch_Margin = 4, this.Match_MaxBits = 32
}! function(e, t) {
function n(e) {
var t = e.length,
n = ot.type(e);
return ot.isWindow(e) ? !1 : 1 === e.nodeType && t ? !0 : "array" === n || "function" !== n && (0 === t || "number" == typeof t && t > 0 && t - 1 in e)
}
function i(e) {
var t = ht[e] = {};
return ot.each(e.match(st) || [], function(e, n) {
t[n] = !0
}), t
}
function r() {
Object.defineProperty(this.cache = {}, 0, {
get: function() {
return {}
}
}), this.expando = ot.expando + Math.random()
}
function o(e, n, i) {
var r;
if(i === t && 1 === e.nodeType)
if(r = "data-" + n.replace(bt, "-$1").toLowerCase(), i = e.getAttribute(r), "string" == typeof i) {
try {
i = "true" === i ? !0 : "false" === i ? !1 : "null" === i ? null : +i + "" === i ? +i : vt.test(i) ? JSON.parse(i) : i
} catch(o) {}
mt.set(e, n, i)
} else i = t;
return i
}
function a() {
return !0
}
function s() {
return !1
}
function l() {
try {
return z.activeElement
} catch(e) {}
}
function c(e, t) {
for(;
(e = e[t]) && 1 !== e.nodeType;);
return e
}
function u(e, t, n) {
if(ot.isFunction(t)) return ot.grep(e, function(e, i) {
return !!t.call(e, i, e) !== n
});
if(t.nodeType) return ot.grep(e, function(e) {
return e === t !== n
});
if("string" == typeof t) {
if(It.test(t)) return ot.filter(t, e, n);
t = ot.filter(t, e)
}
return ot.grep(e, function(e) {
return tt.call(t, e) >= 0 !== n
})
}
function d(e, t) {
return ot.nodeName(e, "table") && ot.nodeName(1 === t.nodeType ? t : t.firstChild, "tr") ? e.getElementsByTagName("tbody")[0] || e.appendChild(e.ownerDocument.createElement("tbody")) : e
}
function p(e) {
return e.type = (null !== e.getAttribute("type")) + "/" + e.type, e
}
function f(e) {
var t = jt.exec(e.type);
return t ? e.type = t[1] : e.removeAttribute("type"), e
}
function h(e, t) {
for(var n = e.length, i = 0; n > i; i++) gt.set(e[i], "globalEval", !t || gt.get(t[i], "globalEval"))
}
function m(e, t) {
var n, i, r, o, a, s, l, c;
if(1 === t.nodeType) {
if(gt.hasData(e) && (o = gt.access(e), a = gt.set(t, o), c = o.events)) {
delete a.handle, a.events = {};
for(r in c)
for(n = 0, i = c[r].length; i > n; n++) ot.event.add(t, r, c[r][n])
}
mt.hasData(e) && (s = mt.access(e), l = ot.extend({}, s), mt.set(t, l))
}
}
function g(e, n) {
var i = e.getElementsByTagName ? e.getElementsByTagName(n || "*") : e.querySelectorAll ? e.querySelectorAll(n || "*") : [];
return n === t || n && ot.nodeName(e, n) ? ot.merge([e], i) : i
}
function v(e, t) {
var n = t.nodeName.toLowerCase();
"input" === n && Ft.test(e.type) ? t.checked = e.checked : ("input" === n || "textarea" === n) && (t.defaultValue = e.defaultValue)
}
function b(e, t) {
if(t in e) return t;
for(var n = t.charAt(0).toUpperCase() + t.slice(1), i = t, r = Zt.length; r--;)
if(t = Zt[r] + n, t in e) return t;
return i
}
function y(e, t) {
return e = t || e, "none" === ot.css(e, "display") || !ot.contains(e.ownerDocument, e)
}
function x(t) {
return e.getComputedStyle(t, null)
}
function w(e, t) {
for(var n, i, r, o = [], a = 0, s = e.length; s > a; a++) i = e[a], i.style && (o[a] = gt.get(i, "olddisplay"), n = i.style.display, t ? (o[a] || "none" !== n || (i.style.display = ""), "" === i.style.display && y(i) && (o[a] = gt.access(i, "olddisplay", E(i.nodeName)))) : o[a] || (r = y(i), (n && "none" !== n || !r) && gt.set(i, "olddisplay", r ? n : ot.css(i, "display"))));
for(a = 0; s > a; a++) i = e[a], i.style && (t && "none" !== i.style.display && "" !== i.style.display || (i.style.display = t ? o[a] || "" : "none"));
return e
}
function S(e, t, n) {
var i = Vt.exec(t);
return i ? Math.max(0, i[1] - (n || 0)) + (i[2] || "px") : t
}
function C(e, t, n, i, r) {
for(var o = n === (i ? "border" : "content") ? 4 : "width" === t ? 1 : 0, a = 0; 4 > o; o += 2) "margin" === n && (a += ot.css(e, n + Yt[o], !0, r)), i ? ("content" === n && (a -= ot.css(e, "padding" + Yt[o], !0, r)), "margin" !== n && (a -= ot.css(e, "border" + Yt[o] + "Width", !0, r))) : (a += ot.css(e, "padding" + Yt[o], !0, r), "padding" !== n && (a += ot.css(e, "border" + Yt[o] + "Width", !0, r)));
return a
}
function T(e, t, n) {
var i = !0,
r = "width" === t ? e.offsetWidth : e.offsetHeight,
o = x(e),
a = ot.support.boxSizing && "border-box" === ot.css(e, "boxSizing", !1, o);
if(0 >= r || null == r) {
if(r = Ht(e, t, o), (0 > r || null == r) && (r = e.style[t]), Wt.test(r)) return r;
i = a && (ot.support.boxSizingReliable || r === e.style[t]), r = parseFloat(r) || 0
}
return r + C(e, t, n || (a ? "border" : "content"), i, o) + "px"
}
function E(e) {
var t = z,
n = Xt[e];
return n || (n = k(e, t), "none" !== n && n || (qt = (qt || ot("").css("cssText", "display:block !important")).appendTo(t.documentElement), t = (qt[0].contentWindow || qt[0].contentDocument).document, t.write(""), t.close(), n = k(e, t), qt.detach()), Xt[e] = n), n
}
function k(e, t) {
var n = ot(t.createElement(e)).appendTo(t.body),
i = ot.css(n[0], "display");
return n.remove(), i
}
function _(e, t, n, i) {
var r;
if(ot.isArray(t)) ot.each(t, function(t, r) {
n || tn.test(e) ? i(e, r) : _(e + "[" + ("object" == typeof r ? t : "") + "]", r, n, i)
});
else if(n || "object" !== ot.type(t)) i(e, t);
else
for(r in t) _(e + "[" + r + "]", t[r], n, i)
}
function I(e) {
return function(t, n) {
"string" != typeof t && (n = t, t = "*");
var i, r = 0,
o = t.toLowerCase().match(st) || [];
if(ot.isFunction(n))
for(; i = o[r++];) "+" === i[0] ? (i = i.slice(1) || "*", (e[i] = e[i] || []).unshift(n)) : (e[i] = e[i] || []).push(n)
}
}
function D(e, t, n, i) {
function r(s) {
var l;
return o[s] = !0, ot.each(e[s] || [], function(e, s) {
var c = s(t, n, i);
return "string" != typeof c || a || o[c] ? a ? !(l = c) : void 0 : (t.dataTypes.unshift(c), r(c), !1)
}), l
}
var o = {}, a = e === yn;
return r(t.dataTypes[0]) || !o["*"] && r("*")
}
function N(e, n) {
var i, r, o = ot.ajaxSettings.flatOptions || {};
for(i in n) n[i] !== t && ((o[i] ? e : r || (r = {}))[i] = n[i]);
return r && ot.extend(!0, e, r), e
}
function L(e, n, i) {
for(var r, o, a, s, l = e.contents, c = e.dataTypes;
"*" === c[0];) c.shift(), r === t && (r = e.mimeType || n.getResponseHeader("Content-Type"));
if(r)
for(o in l)
if(l[o] && l[o].test(r)) {
c.unshift(o);
break
}
if(c[0] in i) a = c[0];
else {
for(o in i) {
if(!c[0] || e.converters[o + " " + c[0]]) {
a = o;
break
}
s || (s = o)
}
a = a || s
}
return a ? (a !== c[0] && c.unshift(a), i[a]) : void 0
}
function M(e, t, n, i) {
var r, o, a, s, l, c = {}, u = e.dataTypes.slice();
if(u[1])
for(a in e.converters) c[a.toLowerCase()] = e.converters[a];
for(o = u.shift(); o;)
if(e.responseFields[o] && (n[e.responseFields[o]] = t), !l && i && e.dataFilter && (t = e.dataFilter(t, e.dataType)), l = o, o = u.shift())
if("*" === o) o = l;
else if("*" !== l && l !== o) {
if(a = c[l + " " + o] || c["* " + o], !a)
for(r in c)
if(s = r.split(" "), s[1] === o && (a = c[l + " " + s[0]] || c["* " + s[0]])) {
a === !0 ? a = c[r] : c[r] !== !0 && (o = s[0], u.unshift(s[1]));
break
}
if(a !== !0)
if(a && e["throws"]) t = a(t);
else try {
t = a(t)
} catch(d) {
return {
state: "parsererror",
error: a ? d : "No conversion from " + l + " to " + o
}
}
}
return {
state: "success",
data: t
}
}
function A() {
return setTimeout(function() {
In = t
}), In = ot.now()
}
function R(e, t, n) {
for(var i, r = (Rn[t] || []).concat(Rn["*"]), o = 0, a = r.length; a > o; o++)
if(i = r[o].call(n, t, e)) return i
}
function P(e, t, n) {
var i, r, o = 0,
a = An.length,
s = ot.Deferred().always(function() {
delete l.elem
}),
l = function() {
if(r) return !1;
for(var t = In || A(), n = Math.max(0, c.startTime + c.duration - t), i = n / c.duration || 0, o = 1 - i, a = 0, l = c.tweens.length; l > a; a++) c.tweens[a].run(o);
return s.notifyWith(e, [c, o, n]), 1 > o && l ? n : (s.resolveWith(e, [c]), !1)
}, c = s.promise({
elem: e,
props: ot.extend({}, t),
opts: ot.extend(!0, {
specialEasing: {}
}, n),
originalProperties: t,
originalOptions: n,
startTime: In || A(),
duration: n.duration,
tweens: [],
createTween: function(t, n) {
var i = ot.Tween(e, c.opts, t, n, c.opts.specialEasing[t] || c.opts.easing);
return c.tweens.push(i), i
},
stop: function(t) {
var n = 0,
i = t ? c.tweens.length : 0;
if(r) return this;
for(r = !0; i > n; n++) c.tweens[n].run(1);
return t ? s.resolveWith(e, [c, t]) : s.rejectWith(e, [c, t]), this
}
}),
u = c.props;
for(F(u, c.opts.specialEasing); a > o; o++)
if(i = An[o].call(c, e, u, c.opts)) return i;
return ot.map(u, R, c), ot.isFunction(c.opts.start) && c.opts.start.call(e, c), ot.fx.timer(ot.extend(l, {
elem: e,
anim: c,
queue: c.opts.queue
})), c.progress(c.opts.progress).done(c.opts.done, c.opts.complete).fail(c.opts.fail).always(c.opts.always)
}
function F(e, t) {
var n, i, r, o, a;
for(n in e)
if(i = ot.camelCase(n), r = t[i], o = e[n], ot.isArray(o) && (r = o[1], o = e[n] = o[0]), n !== i && (e[i] = o, delete e[n]), a = ot.cssHooks[i], a && "expand" in a) {
o = a.expand(o), delete e[i];
for(n in o) n in e || (e[n] = o[n], t[n] = r)
} else t[i] = r
}
function O(e, n, i) {
var r, o, a, s, l, c, u = this,
d = {}, p = e.style,
f = e.nodeType && y(e),
h = gt.get(e, "fxshow");
i.queue || (l = ot._queueHooks(e, "fx"), null == l.unqueued && (l.unqueued = 0, c = l.empty.fire, l.empty.fire = function() {
l.unqueued || c()
}), l.unqueued++, u.always(function() {
u.always(function() {
l.unqueued--, ot.queue(e, "fx").length || l.empty.fire()
})
})), 1 === e.nodeType && ("height" in n || "width" in n) && (i.overflow = [p.overflow, p.overflowX, p.overflowY], "inline" === ot.css(e, "display") && "none" === ot.css(e, "float") && (p.display = "inline-block")), i.overflow && (p.overflow = "hidden", u.always(function() {
p.overflow = i.overflow[0], p.overflowX = i.overflow[1], p.overflowY = i.overflow[2]
}));
for(r in n)
if(o = n[r], Nn.exec(o)) {
if(delete n[r], a = a || "toggle" === o, o === (f ? "hide" : "show")) {
if("show" !== o || !h || h[r] === t) continue;
f = !0
}
d[r] = h && h[r] || ot.style(e, r)
}
if(!ot.isEmptyObject(d)) {
h ? "hidden" in h && (f = h.hidden) : h = gt.access(e, "fxshow", {}), a && (h.hidden = !f), f ? ot(e).show() : u.done(function() {
ot(e).hide()
}), u.done(function() {
var t;
gt.remove(e, "fxshow");
for(t in d) ot.style(e, t, d[t])
});
for(r in d) s = R(f ? h[r] : 0, r, u), r in h || (h[r] = s.start, f && (s.end = s.start, s.start = "width" === r || "height" === r ? 1 : 0))
}
}
function B(e, t, n, i, r) {
return new B.prototype.init(e, t, n, i, r)
}
function j(e, t) {
var n, i = {
height: e
}, r = 0;
for(t = t ? 1 : 0; 4 > r; r += 2 - t) n = Yt[r], i["margin" + n] = i["padding" + n] = e;
return t && (i.opacity = i.width = e), i
}
function $(e) {
return ot.isWindow(e) ? e : 9 === e.nodeType && e.defaultView
}
var G, H, q = typeof t,
U = e.location,
z = e.document,
V = z.documentElement,
W = e.jQuery,
Q = e.$,
X = {}, K = [],
J = "2.0.3",
Y = K.concat,
Z = K.push,
et = K.slice,
tt = K.indexOf,
nt = X.toString,
it = X.hasOwnProperty,
rt = J.trim,
ot = function(e, t) {
return new ot.fn.init(e, t, G)
}, at = /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,
st = /\S+/g,
lt = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,
ct = /^<(\w+)\s*\/?>(?:<\/\1>|)$/,
ut = /^-ms-/,
dt = /-([\da-z])/gi,
pt = function(e, t) {
return t.toUpperCase()
}, ft = function() {
z.removeEventListener("DOMContentLoaded", ft, !1), e.removeEventListener("load", ft, !1), ot.ready()
};
ot.fn = ot.prototype = {
jquery: J,
constructor: ot,
init: function(e, n, i) {
var r, o;
if(!e) return this;
if("string" == typeof e) {
if(r = "<" === e.charAt(0) && ">" === e.charAt(e.length - 1) && e.length >= 3 ? [null, e, null] : lt.exec(e), !r || !r[1] && n) return !n || n.jquery ? (n || i).find(e) : this.constructor(n).find(e);
if(r[1]) {
if(n = n instanceof ot ? n[0] : n, ot.merge(this, ot.parseHTML(r[1], n && n.nodeType ? n.ownerDocument || n : z, !0)), ct.test(r[1]) && ot.isPlainObject(n))
for(r in n) ot.isFunction(this[r]) ? this[r](n[r]) : this.attr(r, n[r]);
return this
}
return o = z.getElementById(r[2]), o && o.parentNode && (this.length = 1, this[0] = o), this.context = z, this.selector = e, this
}
return e.nodeType ? (this.context = this[0] = e, this.length = 1, this) : ot.isFunction(e) ? i.ready(e) : (e.selector !== t && (this.selector = e.selector, this.context = e.context), ot.makeArray(e, this))
},
selector: "",
length: 0,
toArray: function() {
return et.call(this)
},
get: function(e) {
return null == e ? this.toArray() : 0 > e ? this[this.length + e] : this[e]
},
pushStack: function(e) {
var t = ot.merge(this.constructor(), e);
return t.prevObject = this, t.context = this.context, t
},
each: function(e, t) {
return ot.each(this, e, t)
},
ready: function(e) {
return ot.ready.promise().done(e), this
},
slice: function() {
return this.pushStack(et.apply(this, arguments))
},
first: function() {
return this.eq(0)
},
last: function() {
return this.eq(-1)
},
eq: function(e) {
var t = this.length,
n = +e + (0 > e ? t : 0);
return this.pushStack(n >= 0 && t > n ? [this[n]] : [])
},
map: function(e) {
return this.pushStack(ot.map(this, function(t, n) {
return e.call(t, n, t)
}))
},
end: function() {
return this.prevObject || this.constructor(null)
},
push: Z,
sort: [].sort,
splice: [].splice
}, ot.fn.init.prototype = ot.fn, ot.extend = ot.fn.extend = function() {
var e, n, i, r, o, a, s = arguments[0] || {}, l = 1,
c = arguments.length,
u = !1;
for("boolean" == typeof s && (u = s, s = arguments[1] || {}, l = 2), "object" == typeof s || ot.isFunction(s) || (s = {}), c === l && (s = this, --l); c > l; l++)
if(null != (e = arguments[l]))
for(n in e) i = s[n], r = e[n], s !== r && (u && r && (ot.isPlainObject(r) || (o = ot.isArray(r))) ? (o ? (o = !1, a = i && ot.isArray(i) ? i : []) : a = i && ot.isPlainObject(i) ? i : {}, s[n] = ot.extend(u, a, r)) : r !== t && (s[n] = r));
return s
}, ot.extend({
expando: "jQuery" + (J + Math.random()).replace(/\D/g, ""),
noConflict: function(t) {
return e.$ === ot && (e.$ = Q), t && e.jQuery === ot && (e.jQuery = W), ot
},
isReady: !1,
readyWait: 1,
holdReady: function(e) {
e ? ot.readyWait++ : ot.ready(!0)
},
ready: function(e) {
(e === !0 ? --ot.readyWait : ot.isReady) || (ot.isReady = !0, e !== !0 && --ot.readyWait > 0 || (H.resolveWith(z, [ot]), ot.fn.trigger && ot(z).trigger("ready").off("ready")))
},
isFunction: function(e) {
return "function" === ot.type(e)
},
isArray: Array.isArray,
isWindow: function(e) {
return null != e && e === e.window
},
isNumeric: function(e) {
return !isNaN(parseFloat(e)) && isFinite(e)
},
type: function(e) {
return null == e ? String(e) : "object" == typeof e || "function" == typeof e ? X[nt.call(e)] || "object" : typeof e
},
isPlainObject: function(e) {
if("object" !== ot.type(e) || e.nodeType || ot.isWindow(e)) return !1;
try {
if(e.constructor && !it.call(e.constructor.prototype, "isPrototypeOf")) return !1
} catch(t) {
return !1
}
return !0
},
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 || "string" != typeof e) return null;
"boolean" == typeof t && (n = t, t = !1), t = t || z;
var i = ct.exec(e),
r = !n && [];
return i ? [t.createElement(i[1])] : (i = ot.buildFragment([e], t, r), r && ot(r).remove(), ot.merge([], i.childNodes))
},
parseJSON: JSON.parse,
parseXML: function(e) {
var n, i;
if(!e || "string" != typeof e) return null;
try {
i = new DOMParser, n = i.parseFromString(e, "text/xml")
} catch(r) {
n = t
}
return(!n || n.getElementsByTagName("parsererror").length) && ot.error("Invalid XML: " + e), n
},
noop: function() {},
globalEval: function(e) {
var t, n = eval;
e = ot.trim(e), e && (1 === e.indexOf("use strict") ? (t = z.createElement("script"), t.text = e, z.head.appendChild(t).parentNode.removeChild(t)) : n(e))
},
camelCase: function(e) {
return e.replace(ut, "ms-").replace(dt, pt)
},
nodeName: function(e, t) {
return e.nodeName && e.nodeName.toLowerCase() === t.toLowerCase()
},
each: function(e, t, i) {
var r, o = 0,
a = e.length,
s = n(e);
if(i) {
if(s)
for(; a > o && (r = t.apply(e[o], i), r !== !1); o++);
else
for(o in e)
if(r = t.apply(e[o], i), r === !1) break
} else if(s)
for(; a > o && (r = t.call(e[o], o, e[o]), r !== !1); o++);
else
for(o in e)
if(r = t.call(e[o], o, e[o]), r === !1) break; return e
},
trim: function(e) {
return null == e ? "" : rt.call(e)
},
makeArray: function(e, t) {
var i = t || [];
return null != e && (n(Object(e)) ? ot.merge(i, "string" == typeof e ? [e] : e) : Z.call(i, e)), i
},
inArray: function(e, t, n) {
return null == t ? -1 : tt.call(t, e, n)
},
merge: function(e, n) {
var i = n.length,
r = e.length,
o = 0;
if("number" == typeof i)
for(; i > o; o++) e[r++] = n[o];
else
for(; n[o] !== t;) e[r++] = n[o++];
return e.length = r, e
},
grep: function(e, t, n) {
var i, r = [],
o = 0,
a = e.length;
for(n = !! n; a > o; o++) i = !! t(e[o], o), n !== i && r.push(e[o]);
return r
},
map: function(e, t, i) {
var r, o = 0,
a = e.length,
s = n(e),
l = [];
if(s)
for(; a > o; o++) r = t(e[o], o, i), null != r && (l[l.length] = r);
else
for(o in e) r = t(e[o], o, i), null != r && (l[l.length] = r);
return Y.apply([], l)
},
guid: 1,
proxy: function(e, n) {
var i, r, o;
return "string" == typeof n && (i = e[n], n = e, e = i), ot.isFunction(e) ? (r = et.call(arguments, 2), o = function() {
return e.apply(n || this, r.concat(et.call(arguments)))
}, o.guid = e.guid = e.guid || ot.guid++, o) : t
},
access: function(e, n, i, r, o, a, s) {
var l = 0,
c = e.length,
u = null == i;
if("object" === ot.type(i)) {
o = !0;
for(l in i) ot.access(e, n, l, i[l], !0, a, s)
} else if(r !== t && (o = !0, ot.isFunction(r) || (s = !0), u && (s ? (n.call(e, r), n = null) : (u = n, n = function(e, t, n) {
return u.call(ot(e), n)
})), n))
for(; c > l; l++) n(e[l], i, s ? r : r.call(e[l], l, n(e[l], i)));
return o ? e : u ? n.call(e) : c ? n(e[0], i) : a
},
now: Date.now,
swap: function(e, t, n, i) {
var r, o, a = {};
for(o in t) a[o] = e.style[o], e.style[o] = t[o];
r = n.apply(e, i || []);
for(o in t) e.style[o] = a[o];
return r
}
}), ot.ready.promise = function(t) {
return H || (H = ot.Deferred(), "complete" === z.readyState ? setTimeout(ot.ready) : (z.addEventListener("DOMContentLoaded", ft, !1), e.addEventListener("load", ft, !1))), H.promise(t)
}, ot.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function(e, t) {
X["[object " + t + "]"] = t.toLowerCase()
}), G = ot(z),
function(e, t) {
function n(e, t, n, i) {
var r, o, a, s, l, c, u, d, h, m;
if((t ? t.ownerDocument || t : $) !== M && L(t), t = t || M, n = n || [], !e || "string" != typeof e) return n;
if(1 !== (s = t.nodeType) && 9 !== s) return [];
if(R && !i) {
if(r = yt.exec(e))
if(a = r[1]) {
if(9 === s) {
if(o = t.getElementById(a), !o || !o.parentNode) return n;
if(o.id === a) return n.push(o), n
} else if(t.ownerDocument && (o = t.ownerDocument.getElementById(a)) && B(t, o) && o.id === a) return n.push(o), n
} else {
if(r[2]) return et.apply(n, t.getElementsByTagName(e)), n;
if((a = r[3]) && C.getElementsByClassName && t.getElementsByClassName) return et.apply(n, t.getElementsByClassName(a)), n
}
if(C.qsa && (!P || !P.test(e))) {
if(d = u = j, h = t, m = 9 === s && e, 1 === s && "object" !== t.nodeName.toLowerCase()) {
for(c = p(e), (u = t.getAttribute("id")) ? d = u.replace(St, "\\$&") : t.setAttribute("id", d), d = "[id='" + d + "'] ", l = c.length; l--;) c[l] = d + f(c[l]);
h = ft.test(e) && t.parentNode || t, m = c.join(",")
}
if(m) try {
return et.apply(n, h.querySelectorAll(m)), n
} catch(g) {} finally {
u || t.removeAttribute("id")
}
}
}
return w(e.replace(ut, "$1"), t, n, i)
}
function i() {
function e(n, i) {
return t.push(n += " ") > E.cacheLength && delete e[t.shift()], e[n] = i
}
var t = [];
return e
}
function r(e) {
return e[j] = !0, e
}
function o(e) {
var t = M.createElement("div");
try {
return !!e(t)
} catch(n) {
return !1
} finally {
t.parentNode && t.parentNode.removeChild(t), t = null
}
}
function a(e, t) {
for(var n = e.split("|"), i = e.length; i--;) E.attrHandle[n[i]] = t
}
function s(e, t) {
var n = t && e,
i = n && 1 === e.nodeType && 1 === t.nodeType && (~t.sourceIndex || X) - (~e.sourceIndex || X);
if(i) return i;
if(n)
for(; n = n.nextSibling;)
if(n === t) return -1;
return e ? 1 : -1
}
function l(e) {
return function(t) {
var n = t.nodeName.toLowerCase();
return "input" === n && t.type === e
}
}
function c(e) {
return function(t) {
var n = t.nodeName.toLowerCase();
return("input" === n || "button" === n) && t.type === e
}
}
function u(e) {
return r(function(t) {
return t = +t, r(function(n, i) {
for(var r, o = e([], n.length, t), a = o.length; a--;) n[r = o[a]] && (n[r] = !(i[r] = n[r]))
})
})
}
function d() {}
function p(e, t) {
var i, r, o, a, s, l, c, u = U[e + " "];
if(u) return t ? 0 : u.slice(0);
for(s = e, l = [], c = E.preFilter; s;) {
(!i || (r = dt.exec(s))) && (r && (s = s.slice(r[0].length) || s), l.push(o = [])), i = !1, (r = pt.exec(s)) && (i = r.shift(), o.push({
value: i,
type: r[0].replace(ut, " ")
}), s = s.slice(i.length));
for(a in E.filter)!(r = vt[a].exec(s)) || c[a] && !(r = c[a](r)) || (i = r.shift(), o.push({
value: i,
type: a,
matches: r
}), s = s.slice(i.length));
if(!i) break
}
return t ? s.length : s ? n.error(e) : U(e, l).slice(0)
}
function f(e) {
for(var t = 0, n = e.length, i = ""; n > t; t++) i += e[t].value;
return i
}
function h(e, t, n) {
var i = t.dir,
r = n && "parentNode" === i,
o = H++;
return t.first ? function(t, n, o) {
for(; t = t[i];)
if(1 === t.nodeType || r) return e(t, n, o)
} : function(t, n, a) {
var s, l, c, u = G + " " + o;
if(a) {
for(; t = t[i];)
if((1 === t.nodeType || r) && e(t, n, a)) return !0
} else
for(; t = t[i];)
if(1 === t.nodeType || r)
if(c = t[j] || (t[j] = {}), (l = c[i]) && l[0] === u) {
if((s = l[1]) === !0 || s === T) return s === !0
} else if(l = c[i] = [u], l[1] = e(t, n, a) || T, l[1] === !0) return !0
}
}
function m(e) {
return e.length > 1 ? function(t, n, i) {
for(var r = e.length; r--;)
if(!e[r](t, n, i)) return !1;
return !0
} : e[0]
}
function g(e, t, n, i, r) {
for(var o, a = [], s = 0, l = e.length, c = null != t; l > s; s++)(o = e[s]) && (!n || n(o, i, r)) && (a.push(o), c && t.push(s));
return a
}
function v(e, t, n, i, o, a) {
return i && !i[j] && (i = v(i)), o && !o[j] && (o = v(o, a)), r(function(r, a, s, l) {
var c, u, d, p = [],
f = [],
h = a.length,
m = r || x(t || "*", s.nodeType ? [s] : s, []),
v = !e || !r && t ? m : g(m, p, e, s, l),
b = n ? o || (r ? e : h || i) ? [] : a : v;
if(n && n(v, b, s, l), i)
for(c = g(b, f), i(c, [], s, l), u = c.length; u--;)(d = c[u]) && (b[f[u]] = !(v[f[u]] = d));
if(r) {
if(o || e) {
if(o) {
for(c = [], u = b.length; u--;)(d = b[u]) && c.push(v[u] = d);
o(null, b = [], c, l)
}
for(u = b.length; u--;)(d = b[u]) && (c = o ? nt.call(r, d) : p[u]) > -1 && (r[c] = !(a[c] = d))
}
} else b = g(b === a ? b.splice(h, b.length) : b), o ? o(null, a, b, l) : et.apply(a, b)
})
}
function b(e) {
for(var t, n, i, r = e.length, o = E.relative[e[0].type], a = o || E.relative[" "], s = o ? 1 : 0, l = h(function(e) {
return e === t
}, a, !0), c = h(function(e) {
return nt.call(t, e) > -1
}, a, !0), u = [
function(e, n, i) {
return !o && (i || n !== D) || ((t = n).nodeType ? l(e, n, i) : c(e, n, i))
}]; r > s; s++)
if(n = E.relative[e[s].type]) u = [h(m(u), n)];
else {
if(n = E.filter[e[s].type].apply(null, e[s].matches), n[j]) {
for(i = ++s; r > i && !E.relative[e[i].type]; i++);
return v(s > 1 && m(u), s > 1 && f(e.slice(0, s - 1).concat({
value: " " === e[s - 2].type ? "*" : ""
})).replace(ut, "$1"), n, i > s && b(e.slice(s, i)), r > i && b(e = e.slice(i)), r > i && f(e))
}
u.push(n)
}
return m(u)
}
function y(e, t) {
var i = 0,
o = t.length > 0,
a = e.length > 0,
s = function(r, s, l, c, u) {
var d, p, f, h = [],
m = 0,
v = "0",
b = r && [],
y = null != u,
x = D,
w = r || a && E.find.TAG("*", u && s.parentNode || s),
S = G += null == x ? 1 : Math.random() || .1;
for(y && (D = s !== M && s, T = i); null != (d = w[v]); v++) {
if(a && d) {
for(p = 0; f = e[p++];)
if(f(d, s, l)) {
c.push(d);
break
}
y && (G = S, T = ++i)
}
o && ((d = !f && d) && m--, r && b.push(d))
}
if(m += v, o && v !== m) {
for(p = 0; f = t[p++];) f(b, h, s, l);
if(r) {
if(m > 0)
for(; v--;) b[v] || h[v] || (h[v] = Y.call(c));
h = g(h)
}
et.apply(c, h), y && !r && h.length > 0 && m + t.length > 1 && n.uniqueSort(c)
}
return y && (G = S, D = x), b
};
return o ? r(s) : s
}
function x(e, t, i) {
for(var r = 0, o = t.length; o > r; r++) n(e, t[r], i);
return i
}
function w(e, t, n, i) {
var r, o, a, s, l, c = p(e);
if(!i && 1 === c.length) {
if(o = c[0] = c[0].slice(0), o.length > 2 && "ID" === (a = o[0]).type && C.getById && 9 === t.nodeType && R && E.relative[o[1].type]) {
if(t = (E.find.ID(a.matches[0].replace(Ct, Tt), t) || [])[0], !t) return n;
e = e.slice(o.shift().value.length)
}
for(r = vt.needsContext.test(e) ? 0 : o.length; r-- && (a = o[r], !E.relative[s = a.type]);)
if((l = E.find[s]) && (i = l(a.matches[0].replace(Ct, Tt), ft.test(o[0].type) && t.parentNode || t))) {
if(o.splice(r, 1), e = i.length && f(o), !e) return et.apply(n, i), n;
break
}
}
return I(e, c)(i, t, !R, n, ft.test(e)), n
}
var S, C, T, E, k, _, I, D, N, L, M, A, R, P, F, O, B, j = "sizzle" + -new Date,
$ = e.document,
G = 0,
H = 0,
q = i(),
U = i(),
z = i(),
V = !1,
W = function(e, t) {
return e === t ? (V = !0, 0) : 0
}, Q = typeof t,
X = 1 << 31,
K = {}.hasOwnProperty,
J = [],
Y = J.pop,
Z = J.push,
et = J.push,
tt = J.slice,
nt = J.indexOf || function(e) {
for(var t = 0, n = this.length; n > t; t++)
if(this[t] === e) return t;
return -1
}, it = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",
rt = "[\\x20\\t\\r\\n\\f]",
at = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",
st = at.replace("w", "w#"),
lt = "\\[" + rt + "*(" + at + ")" + rt + "*(?:([*^$|!~]?=)" + rt + "*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|(" + st + ")|)|)" + rt + "*\\]",
ct = ":(" + at + ")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|" + lt.replace(3, 8) + ")*)|.*)\\)|)",
ut = new RegExp("^" + rt + "+|((?:^|[^\\\\])(?:\\\\.)*)" + rt + "+$", "g"),
dt = new RegExp("^" + rt + "*," + rt + "*"),
pt = new RegExp("^" + rt + "*([>+~]|" + rt + ")" + rt + "*"),
ft = new RegExp(rt + "*[+~]"),
ht = new RegExp("=" + rt + "*([^\\]'\"]*)" + rt + "*\\]", "g"),
mt = new RegExp(ct),
gt = new RegExp("^" + st + "$"),
vt = {
ID: new RegExp("^#(" + at + ")"),
CLASS: new RegExp("^\\.(" + at + ")"),
TAG: new RegExp("^(" + at.replace("w", "w*") + ")"),
ATTR: new RegExp("^" + lt),
PSEUDO: new RegExp("^" + ct),
CHILD: new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + rt + "*(even|odd|(([+-]|)(\\d*)n|)" + rt + "*(?:([+-]|)" + rt + "*(\\d+)|))" + rt + "*\\)|)", "i"),
bool: new RegExp("^(?:" + it + ")$", "i"),
needsContext: new RegExp("^" + rt + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + rt + "*((?:-\\d)?\\d*)" + rt + "*\\)|)(?=[^-]|$)", "i")
}, bt = /^[^{]+\{\s*\[native \w/,
yt = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,
xt = /^(?:input|select|textarea|button)$/i,
wt = /^h\d$/i,
St = /'|\\/g,
Ct = new RegExp("\\\\([\\da-f]{1,6}" + rt + "?|(" + rt + ")|.)", "ig"),
Tt = function(e, t, n) {
var i = "0x" + t - 65536;
return i !== i || n ? t : 0 > i ? String.fromCharCode(i + 65536) : String.fromCharCode(i >> 10 | 55296, 1023 & i | 56320)
};
try {
et.apply(J = tt.call($.childNodes), $.childNodes), J[$.childNodes.length].nodeType
} catch(Et) {
et = {
apply: J.length ? function(e, t) {
Z.apply(e, tt.call(t))
} : function(e, t) {
for(var n = e.length, i = 0; e[n++] = t[i++];);
e.length = n - 1
}
}
}
_ = n.isXML = function(e) {
var t = e && (e.ownerDocument || e).documentElement;
return t ? "HTML" !== t.nodeName : !1
}, C = n.support = {}, L = n.setDocument = function(e) {
var t = e ? e.ownerDocument || e : $,
n = t.defaultView;
return t !== M && 9 === t.nodeType && t.documentElement ? (M = t, A = t.documentElement, R = !_(t), n && n.attachEvent && n !== n.top && n.attachEvent("onbeforeunload", function() {
L()
}), C.attributes = o(function(e) {
return e.className = "i", !e.getAttribute("className")
}), C.getElementsByTagName = o(function(e) {
return e.appendChild(t.createComment("")), !e.getElementsByTagName("*").length
}), C.getElementsByClassName = o(function(e) {
return e.innerHTML = "", e.firstChild.className = "i", 2 === e.getElementsByClassName("i").length
}), C.getById = o(function(e) {
return A.appendChild(e).id = j, !t.getElementsByName || !t.getElementsByName(j).length
}), C.getById ? (E.find.ID = function(e, t) {
if(typeof t.getElementById !== Q && R) {
var n = t.getElementById(e);
return n && n.parentNode ? [n] : []
}
}, E.filter.ID = function(e) {
var t = e.replace(Ct, Tt);
return function(e) {
return e.getAttribute("id") === t
}
}) : (delete E.find.ID, E.filter.ID = function(e) {
var t = e.replace(Ct, Tt);
return function(e) {
var n = typeof e.getAttributeNode !== Q && e.getAttributeNode("id");
return n && n.value === t
}
}), E.find.TAG = C.getElementsByTagName ? function(e, t) {
return typeof t.getElementsByTagName !== Q ? t.getElementsByTagName(e) : void 0
} : function(e, t) {
var n, i = [],
r = 0,
o = t.getElementsByTagName(e);
if("*" === e) {
for(; n = o[r++];) 1 === n.nodeType && i.push(n);
return i
}
return o
}, E.find.CLASS = C.getElementsByClassName && function(e, t) {
return typeof t.getElementsByClassName !== Q && R ? t.getElementsByClassName(e) : void 0
}, F = [], P = [], (C.qsa = bt.test(t.querySelectorAll)) && (o(function(e) {
e.innerHTML = "", e.querySelectorAll("[selected]").length || P.push("\\[" + rt + "*(?:value|" + it + ")"), e.querySelectorAll(":checked").length || P.push(":checked")
}), o(function(e) {
var n = t.createElement("input");
n.setAttribute("type", "hidden"), e.appendChild(n).setAttribute("t", ""), e.querySelectorAll("[t^='']").length && P.push("[*^$]=" + rt + "*(?:''|\"\")"), e.querySelectorAll(":enabled").length || P.push(":enabled", ":disabled"), e.querySelectorAll("*,:x"), P.push(",.*:")
})), (C.matchesSelector = bt.test(O = A.webkitMatchesSelector || A.mozMatchesSelector || A.oMatchesSelector || A.msMatchesSelector)) && o(function(e) {
C.disconnectedMatch = O.call(e, "div"), O.call(e, "[s!='']:x"), F.push("!=", ct)
}), P = P.length && new RegExp(P.join("|")), F = F.length && new RegExp(F.join("|")), B = bt.test(A.contains) || A.compareDocumentPosition ? function(e, t) {
var n = 9 === e.nodeType ? e.documentElement : e,
i = t && t.parentNode;
return e === i || !(!i || 1 !== i.nodeType || !(n.contains ? n.contains(i) : e.compareDocumentPosition && 16 & e.compareDocumentPosition(i)))
} : function(e, t) {
if(t)
for(; t = t.parentNode;)
if(t === e) return !0;
return !1
}, W = A.compareDocumentPosition ? function(e, n) {
if(e === n) return V = !0, 0;
var i = n.compareDocumentPosition && e.compareDocumentPosition && e.compareDocumentPosition(n);
return i ? 1 & i || !C.sortDetached && n.compareDocumentPosition(e) === i ? e === t || B($, e) ? -1 : n === t || B($, n) ? 1 : N ? nt.call(N, e) - nt.call(N, n) : 0 : 4 & i ? -1 : 1 : e.compareDocumentPosition ? -1 : 1
} : function(e, n) {
var i, r = 0,
o = e.parentNode,
a = n.parentNode,
l = [e],
c = [n];
if(e === n) return V = !0, 0;
if(!o || !a) return e === t ? -1 : n === t ? 1 : o ? -1 : a ? 1 : N ? nt.call(N, e) - nt.call(N, n) : 0;
if(o === a) return s(e, n);
for(i = e; i = i.parentNode;) l.unshift(i);
for(i = n; i = i.parentNode;) c.unshift(i);
for(; l[r] === c[r];) r++;
return r ? s(l[r], c[r]) : l[r] === $ ? -1 : c[r] === $ ? 1 : 0
}, t) : M
}, n.matches = function(e, t) {
return n(e, null, null, t)
}, n.matchesSelector = function(e, t) {
if((e.ownerDocument || e) !== M && L(e), t = t.replace(ht, "='$1']"), !(!C.matchesSelector || !R || F && F.test(t) || P && P.test(t))) try {
var i = O.call(e, t);
if(i || C.disconnectedMatch || e.document && 11 !== e.document.nodeType) return i
} catch(r) {}
return n(t, M, null, [e]).length > 0
}, n.contains = function(e, t) {
return(e.ownerDocument || e) !== M && L(e), B(e, t)
}, n.attr = function(e, n) {
(e.ownerDocument || e) !== M && L(e);
var i = E.attrHandle[n.toLowerCase()],
r = i && K.call(E.attrHandle, n.toLowerCase()) ? i(e, n, !R) : t;
return r === t ? C.attributes || !R ? e.getAttribute(n) : (r = e.getAttributeNode(n)) && r.specified ? r.value : null : r
}, n.error = function(e) {
throw new Error("Syntax error, unrecognized expression: " + e)
}, n.uniqueSort = function(e) {
var t, n = [],
i = 0,
r = 0;
if(V = !C.detectDuplicates, N = !C.sortStable && e.slice(0), e.sort(W), V) {
for(; t = e[r++];) t === e[r] && (i = n.push(r));
for(; i--;) e.splice(n[i], 1)
}
return e
}, k = n.getText = function(e) {
var t, n = "",
i = 0,
r = e.nodeType;
if(r) {
if(1 === r || 9 === r || 11 === r) {
if("string" == typeof e.textContent) return e.textContent;
for(e = e.firstChild; e; e = e.nextSibling) n += k(e)
} else if(3 === r || 4 === r) return e.nodeValue
} else
for(; t = e[i]; i++) n += k(t);
return n
}, E = n.selectors = {
cacheLength: 50,
createPseudo: r,
match: vt,
attrHandle: {},
find: {},
relative: {
">": {
dir: "parentNode",
first: !0
},
" ": {
dir: "parentNode"
},
"+": {
dir: "previousSibling",
first: !0
},
"~": {
dir: "previousSibling"
}
},
preFilter: {
ATTR: function(e) {
return e[1] = e[1].replace(Ct, Tt), e[3] = (e[4] || e[5] || "").replace(Ct, Tt), "~=" === e[2] && (e[3] = " " + e[3] + " "), e.slice(0, 4)
},
CHILD: function(e) {
return e[1] = e[1].toLowerCase(), "nth" === e[1].slice(0, 3) ? (e[3] || n.error(e[0]), e[4] = +(e[4] ? e[5] + (e[6] || 1) : 2 * ("even" === e[3] || "odd" === e[3])), e[5] = +(e[7] + e[8] || "odd" === e[3])) : e[3] && n.error(e[0]), e
},
PSEUDO: function(e) {
var n, i = !e[5] && e[2];
return vt.CHILD.test(e[0]) ? null : (e[3] && e[4] !== t ? e[2] = e[4] : i && mt.test(i) && (n = p(i, !0)) && (n = i.indexOf(")", i.length - n) - i.length) && (e[0] = e[0].slice(0, n), e[2] = i.slice(0, n)), e.slice(0, 3))
}
},
filter: {
TAG: function(e) {
var t = e.replace(Ct, Tt).toLowerCase();
return "*" === e ? function() {
return !0
} : function(e) {
return e.nodeName && e.nodeName.toLowerCase() === t
}
},
CLASS: function(e) {
var t = q[e + " "];
return t || (t = new RegExp("(^|" + rt + ")" + e + "(" + rt + "|$)")) && q(e, function(e) {
return t.test("string" == typeof e.className && e.className || typeof e.getAttribute !== Q && e.getAttribute("class") || "")
})
},
ATTR: function(e, t, i) {
return function(r) {
var o = n.attr(r, e);
return null == o ? "!=" === t : t ? (o += "", "=" === t ? o === i : "!=" === t ? o !== i : "^=" === t ? i && 0 === o.indexOf(i) : "*=" === t ? i && o.indexOf(i) > -1 : "$=" === t ? i && o.slice(-i.length) === i : "~=" === t ? (" " + o + " ").indexOf(i) > -1 : "|=" === t ? o === i || o.slice(0, i.length + 1) === i + "-" : !1) : !0
}
},
CHILD: function(e, t, n, i, r) {
var o = "nth" !== e.slice(0, 3),
a = "last" !== e.slice(-4),
s = "of-type" === t;
return 1 === i && 0 === r ? function(e) {
return !!e.parentNode
} : function(t, n, l) {
var c, u, d, p, f, h, m = o !== a ? "nextSibling" : "previousSibling",
g = t.parentNode,
v = s && t.nodeName.toLowerCase(),
b = !l && !s;
if(g) {
if(o) {
for(; m;) {
for(d = t; d = d[m];)
if(s ? d.nodeName.toLowerCase() === v : 1 === d.nodeType) return !1;
h = m = "only" === e && !h && "nextSibling"
}
return !0
}
if(h = [a ? g.firstChild : g.lastChild], a && b) {
for(u = g[j] || (g[j] = {}), c = u[e] || [], f = c[0] === G && c[1], p = c[0] === G && c[2], d = f && g.childNodes[f]; d = ++f && d && d[m] || (p = f = 0) || h.pop();)
if(1 === d.nodeType && ++p && d === t) {
u[e] = [G, f, p];
break
}
} else if(b && (c = (t[j] || (t[j] = {}))[e]) && c[0] === G) p = c[1];
else
for(;
(d = ++f && d && d[m] || (p = f = 0) || h.pop()) && ((s ? d.nodeName.toLowerCase() !== v : 1 !== d.nodeType) || !++p || (b && ((d[j] || (d[j] = {}))[e] = [G, p]), d !== t)););
return p -= r, p === i || p % i === 0 && p / i >= 0
}
}
},
PSEUDO: function(e, t) {
var i, o = E.pseudos[e] || E.setFilters[e.toLowerCase()] || n.error("unsupported pseudo: " + e);
return o[j] ? o(t) : o.length > 1 ? (i = [e, e, "", t], E.setFilters.hasOwnProperty(e.toLowerCase()) ? r(function(e, n) {
for(var i, r = o(e, t), a = r.length; a--;) i = nt.call(e, r[a]), e[i] = !(n[i] = r[a])
}) : function(e) {
return o(e, 0, i)
}) : o
}
},
pseudos: {
not: r(function(e) {
var t = [],
n = [],
i = I(e.replace(ut, "$1"));
return i[j] ? r(function(e, t, n, r) {
for(var o, a = i(e, null, r, []), s = e.length; s--;)(o = a[s]) && (e[s] = !(t[s] = o))
}) : function(e, r, o) {
return t[0] = e, i(t, null, o, n), !n.pop()
}
}),
has: r(function(e) {
return function(t) {
return n(e, t).length > 0
}
}),
contains: r(function(e) {
return function(t) {
return(t.textContent || t.innerText || k(t)).indexOf(e) > -1
}
}),
lang: r(function(e) {
return gt.test(e || "") || n.error("unsupported lang: " + e), e = e.replace(Ct, Tt).toLowerCase(),
function(t) {
var n;
do
if(n = R ? t.lang : t.getAttribute("xml:lang") || t.getAttribute("lang")) return n = n.toLowerCase(), n === e || 0 === n.indexOf(e + "-"); while((t = t.parentNode) && 1 === t.nodeType);
return !1
}
}),
target: function(t) {
var n = e.location && e.location.hash;
return n && n.slice(1) === t.id
},
root: function(e) {
return e === A
},
focus: function(e) {
return e === M.activeElement && (!M.hasFocus || M.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 "input" === t && !! e.checked || "option" === t && !! 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 > "@" || 3 === e.nodeType || 4 === e.nodeType) return !1;
return !0
},
parent: function(e) {
return !E.pseudos.empty(e)
},
header: function(e) {
return wt.test(e.nodeName)
},
input: function(e) {
return xt.test(e.nodeName)
},
button: function(e) {
var t = e.nodeName.toLowerCase();
return "input" === t && "button" === e.type || "button" === t
},
text: function(e) {
var t;
return "input" === e.nodeName.toLowerCase() && "text" === e.type && (null == (t = e.getAttribute("type")) || t.toLowerCase() === e.type)
},
first: u(function() {
return [0]
}),
last: u(function(e, t) {
return [t - 1]
}),
eq: u(function(e, t, n) {
return [0 > n ? n + t : n]
}),
even: u(function(e, t) {
for(var n = 0; t > n; n += 2) e.push(n);
return e
}),
odd: u(function(e, t) {
for(var n = 1; t > n; n += 2) e.push(n);
return e
}),
lt: u(function(e, t, n) {
for(var i = 0 > n ? n + t : n; --i >= 0;) e.push(i);
return e
}),
gt: u(function(e, t, n) {
for(var i = 0 > n ? n + t : n; ++i < t;) e.push(i);
return e
})
}
}, E.pseudos.nth = E.pseudos.eq;
for(S in {
radio: !0,
checkbox: !0,
file: !0,
password: !0,
image: !0
}) E.pseudos[S] = l(S);
for(S in {
submit: !0,
reset: !0
}) E.pseudos[S] = c(S);
d.prototype = E.filters = E.pseudos, E.setFilters = new d, I = n.compile = function(e, t) {
var n, i = [],
r = [],
o = z[e + " "];
if(!o) {
for(t || (t = p(e)), n = t.length; n--;) o = b(t[n]), o[j] ? i.push(o) : r.push(o);
o = z(e, y(r, i))
}
return o
}, C.sortStable = j.split("").sort(W).join("") === j, C.detectDuplicates = V, L(), C.sortDetached = o(function(e) {
return 1 & e.compareDocumentPosition(M.createElement("div"))
}), o(function(e) {
return e.innerHTML = "", "#" === e.firstChild.getAttribute("href")
}) || a("type|href|height|width", function(e, t, n) {
return n ? void 0 : e.getAttribute(t, "type" === t.toLowerCase() ? 1 : 2)
}), C.attributes && o(function(e) {
return e.innerHTML = "", e.firstChild.setAttribute("value", ""), "" === e.firstChild.getAttribute("value")
}) || a("value", function(e, t, n) {
return n || "input" !== e.nodeName.toLowerCase() ? void 0 : e.defaultValue
}), o(function(e) {
return null == e.getAttribute("disabled")
}) || a(it, function(e, t, n) {
var i;
return n ? void 0 : (i = e.getAttributeNode(t)) && i.specified ? i.value : e[t] === !0 ? t.toLowerCase() : null
}), ot.find = n, ot.expr = n.selectors, ot.expr[":"] = ot.expr.pseudos, ot.unique = n.uniqueSort, ot.text = n.getText, ot.isXMLDoc = n.isXML, ot.contains = n.contains
}(e);
var ht = {};
ot.Callbacks = function(e) {
e = "string" == typeof e ? ht[e] || i(e) : ot.extend({}, e);
var n, r, o, a, s, l, c = [],
u = !e.once && [],
d = function(t) {
for(n = e.memory && t, r = !0, l = a || 0, a = 0, s = c.length, o = !0; c && s > l; l++)
if(c[l].apply(t[0], t[1]) === !1 && e.stopOnFalse) {
n = !1;
break
}
o = !1, c && (u ? u.length && d(u.shift()) : n ? c = [] : p.disable())
}, p = {
add: function() {
if(c) {
var t = c.length;
! function i(t) {
ot.each(t, function(t, n) {
var r = ot.type(n);
"function" === r ? e.unique && p.has(n) || c.push(n) : n && n.length && "string" !== r && i(n)
})
}(arguments), o ? s = c.length : n && (a = t, d(n))
}
return this
},
remove: function() {
return c && ot.each(arguments, function(e, t) {
for(var n;
(n = ot.inArray(t, c, n)) > -1;) c.splice(n, 1), o && (s >= n && s--, l >= n && l--)
}), this
},
has: function(e) {
return e ? ot.inArray(e, c) > -1 : !(!c || !c.length)
},
empty: function() {
return c = [], s = 0, this
},
disable: function() {
return c = u = n = t, this
},
disabled: function() {
return !c
},
lock: function() {
return u = t, n || p.disable(), this
},
locked: function() {
return !u
},
fireWith: function(e, t) {
return !c || r && !u || (t = t || [], t = [e, t.slice ? t.slice() : t], o ? u.push(t) : d(t)), this
},
fire: function() {
return p.fireWith(this, arguments), this
},
fired: function() {
return !!r
}
};
return p
}, ot.extend({
Deferred: function(e) {
var t = [["resolve", "done", ot.Callbacks("once memory"), "resolved"], ["reject", "fail", ot.Callbacks("once memory"), "rejected"], ["notify", "progress", ot.Callbacks("memory")]],
n = "pending",
i = {
state: function() {
return n
},
always: function() {
return r.done(arguments).fail(arguments), this
},
then: function() {
var e = arguments;
return ot.Deferred(function(n) {
ot.each(t, function(t, o) {
var a = o[0],
s = ot.isFunction(e[t]) && e[t];
r[o[1]](function() {
var e = s && s.apply(this, arguments);
e && ot.isFunction(e.promise) ? e.promise().done(n.resolve).fail(n.reject).progress(n.notify) : n[a + "With"](this === i ? n.promise() : this, s ? [e] : arguments)
})
}), e = null
}).promise()
},
promise: function(e) {
return null != e ? ot.extend(e, i) : i
}
}, r = {};
return i.pipe = i.then, ot.each(t, function(e, o) {
var a = o[2],
s = o[3];
i[o[1]] = a.add, s && a.add(function() {
n = s
}, t[1 ^ e][2].disable, t[2][2].lock), r[o[0]] = function() {
return r[o[0] + "With"](this === r ? i : this, arguments), this
}, r[o[0] + "With"] = a.fireWith
}), i.promise(r), e && e.call(r, r), r
},
when: function(e) {
var t, n, i, r = 0,
o = et.call(arguments),
a = o.length,
s = 1 !== a || e && ot.isFunction(e.promise) ? a : 0,
l = 1 === s ? e : ot.Deferred(),
c = function(e, n, i) {
return function(r) {
n[e] = this, i[e] = arguments.length > 1 ? et.call(arguments) : r, i === t ? l.notifyWith(n, i) : --s || l.resolveWith(n, i)
}
};
if(a > 1)
for(t = new Array(a), n = new Array(a), i = new Array(a); a > r; r++) o[r] && ot.isFunction(o[r].promise) ? o[r].promise().done(c(r, i, o)).fail(l.reject).progress(c(r, n, t)) : --s;
return s || l.resolveWith(i, o), l.promise()
}
}), ot.support = function(t) {
var n = z.createElement("input"),
i = z.createDocumentFragment(),
r = z.createElement("div"),
o = z.createElement("select"),
a = o.appendChild(z.createElement("option"));
return n.type ? (n.type = "checkbox", t.checkOn = "" !== n.value, t.optSelected = a.selected, t.reliableMarginRight = !0, t.boxSizingReliable = !0, t.pixelPosition = !1, n.checked = !0, t.noCloneChecked = n.cloneNode(!0).checked, o.disabled = !0, t.optDisabled = !a.disabled, n = z.createElement("input"), n.value = "t", n.type = "radio", t.radioValue = "t" === n.value, n.setAttribute("checked", "t"), n.setAttribute("name", "t"), i.appendChild(n), t.checkClone = i.cloneNode(!0).cloneNode(!0).lastChild.checked, t.focusinBubbles = "onfocusin" in e, r.style.backgroundClip = "content-box", r.cloneNode(!0).style.backgroundClip = "", t.clearCloneStyle = "content-box" === r.style.backgroundClip, ot(function() {
var n, i, o = "padding:0;margin:0;border:0;display:block;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box",
a = z.getElementsByTagName("body")[0];
a && (n = z.createElement("div"), n.style.cssText = "border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px", a.appendChild(n).appendChild(r), r.innerHTML = "", r.style.cssText = "-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%", ot.swap(a, null != a.style.zoom ? {
zoom: 1
} : {}, function() {
t.boxSizing = 4 === r.offsetWidth
}), e.getComputedStyle && (t.pixelPosition = "1%" !== (e.getComputedStyle(r, null) || {}).top, t.boxSizingReliable = "4px" === (e.getComputedStyle(r, null) || {
width: "4px"
}).width, i = r.appendChild(z.createElement("div")), i.style.cssText = r.style.cssText = o, i.style.marginRight = i.style.width = "0", r.style.width = "1px", t.reliableMarginRight = !parseFloat((e.getComputedStyle(i, null) || {}).marginRight)), a.removeChild(n))
}), t) : t
}({});
var mt, gt, vt = /(?:\{[\s\S]*\}|\[[\s\S]*\])$/,
bt = /([A-Z])/g;
r.uid = 1, r.accepts = function(e) {
return e.nodeType ? 1 === e.nodeType || 9 === e.nodeType : !0
}, r.prototype = {
key: function(e) {
if(!r.accepts(e)) return 0;
var t = {}, n = e[this.expando];
if(!n) {
n = r.uid++;
try {
t[this.expando] = {
value: n
}, Object.defineProperties(e, t)
} catch(i) {
t[this.expando] = n, ot.extend(e, t)
}
}
return this.cache[n] || (this.cache[n] = {}), n
},
set: function(e, t, n) {
var i, r = this.key(e),
o = this.cache[r];
if("string" == typeof t) o[t] = n;
else if(ot.isEmptyObject(o)) ot.extend(this.cache[r], t);
else
for(i in t) o[i] = t[i];
return o
},
get: function(e, n) {
var i = this.cache[this.key(e)];
return n === t ? i : i[n]
},
access: function(e, n, i) {
var r;
return n === t || n && "string" == typeof n && i === t ? (r = this.get(e, n), r !== t ? r : this.get(e, ot.camelCase(n))) : (this.set(e, n, i), i !== t ? i : n)
},
remove: function(e, n) {
var i, r, o, a = this.key(e),
s = this.cache[a];
if(n === t) this.cache[a] = {};
else {
ot.isArray(n) ? r = n.concat(n.map(ot.camelCase)) : (o = ot.camelCase(n), n in s ? r = [n, o] : (r = o, r = r in s ? [r] : r.match(st) || [])), i = r.length;
for(; i--;) delete s[r[i]]
}
},
hasData: function(e) {
return !ot.isEmptyObject(this.cache[e[this.expando]] || {})
},
discard: function(e) {
e[this.expando] && delete this.cache[e[this.expando]]
}
}, mt = new r, gt = new r, ot.extend({
acceptData: r.accepts,
hasData: function(e) {
return mt.hasData(e) || gt.hasData(e)
},
data: function(e, t, n) {
return mt.access(e, t, n)
},
removeData: function(e, t) {
mt.remove(e, t)
},
_data: function(e, t, n) {
return gt.access(e, t, n)
},
_removeData: function(e, t) {
gt.remove(e, t)
}
}), ot.fn.extend({
data: function(e, n) {
var i, r, a = this[0],
s = 0,
l = null;
if(e === t) {
if(this.length && (l = mt.get(a), 1 === a.nodeType && !gt.get(a, "hasDataAttrs"))) {
for(i = a.attributes; s < i.length; s++) r = i[s].name, 0 === r.indexOf("data-") && (r = ot.camelCase(r.slice(5)), o(a, r, l[r]));
gt.set(a, "hasDataAttrs", !0)
}
return l
}
return "object" == typeof e ? this.each(function() {
mt.set(this, e)
}) : ot.access(this, function(n) {
var i, r = ot.camelCase(e);
if(a && n === t) {
if(i = mt.get(a, e), i !== t) return i;
if(i = mt.get(a, r), i !== t) return i;
if(i = o(a, r, t), i !== t) return i
} else this.each(function() {
var i = mt.get(this, r);
mt.set(this, r, n), -1 !== e.indexOf("-") && i !== t && mt.set(this, e, n)
})
}, null, n, arguments.length > 1, null, !0)
},
removeData: function(e) {
return this.each(function() {
mt.remove(this, e)
})
}
}), ot.extend({
queue: function(e, t, n) {
var i;
return e ? (t = (t || "fx") + "queue", i = gt.get(e, t), n && (!i || ot.isArray(n) ? i = gt.access(e, t, ot.makeArray(n)) : i.push(n)), i || []) : void 0
},
dequeue: function(e, t) {
t = t || "fx";
var n = ot.queue(e, t),
i = n.length,
r = n.shift(),
o = ot._queueHooks(e, t),
a = function() {
ot.dequeue(e, t)
};
"inprogress" === r && (r = n.shift(), i--), r && ("fx" === t && n.unshift("inprogress"), delete o.stop, r.call(e, a, o)), !i && o && o.empty.fire()
},
_queueHooks: function(e, t) {
var n = t + "queueHooks";
return gt.get(e, n) || gt.access(e, n, {
empty: ot.Callbacks("once memory").add(function() {
gt.remove(e, [t + "queue", n])
})
})
}
}), ot.fn.extend({
queue: function(e, n) {
var i = 2;
return "string" != typeof e && (n = e, e = "fx", i--), arguments.length < i ? ot.queue(this[0], e) : n === t ? this : this.each(function() {
var t = ot.queue(this, e, n);
ot._queueHooks(this, e), "fx" === e && "inprogress" !== t[0] && ot.dequeue(this, e)
})
},
dequeue: function(e) {
return this.each(function() {
ot.dequeue(this, e)
})
},
delay: function(e, t) {
return e = ot.fx ? ot.fx.speeds[e] || e : e, t = t || "fx", this.queue(t, function(t, n) {
var i = setTimeout(t, e);
n.stop = function() {
clearTimeout(i)
}
})
},
clearQueue: function(e) {
return this.queue(e || "fx", [])
},
promise: function(e, n) {
var i, r = 1,
o = ot.Deferred(),
a = this,
s = this.length,
l = function() {
--r || o.resolveWith(a, [a])
};
for("string" != typeof e && (n = e, e = t), e = e || "fx"; s--;) i = gt.get(a[s], e + "queueHooks"), i && i.empty && (r++, i.empty.add(l));
return l(), o.promise(n)
}
});
var yt, xt, wt = /[\t\r\n\f]/g,
St = /\r/g,
Ct = /^(?:input|select|textarea|button)$/i;
ot.fn.extend({
attr: function(e, t) {
return ot.access(this, ot.attr, e, t, arguments.length > 1)
},
removeAttr: function(e) {
return this.each(function() {
ot.removeAttr(this, e)
})
},
prop: function(e, t) {
return ot.access(this, ot.prop, e, t, arguments.length > 1)
},
removeProp: function(e) {
return this.each(function() {
delete this[ot.propFix[e] || e]
})
},
addClass: function(e) {
var t, n, i, r, o, a = 0,
s = this.length,
l = "string" == typeof e && e;
if(ot.isFunction(e)) return this.each(function(t) {
ot(this).addClass(e.call(this, t, this.className))
});
if(l)
for(t = (e || "").match(st) || []; s > a; a++)
if(n = this[a], i = 1 === n.nodeType && (n.className ? (" " + n.className + " ").replace(wt, " ") : " ")) {
for(o = 0; r = t[o++];) i.indexOf(" " + r + " ") < 0 && (i += r + " ");
n.className = ot.trim(i)
}
return this
},
removeClass: function(e) {
var t, n, i, r, o, a = 0,
s = this.length,
l = 0 === arguments.length || "string" == typeof e && e;
if(ot.isFunction(e)) return this.each(function(t) {
ot(this).removeClass(e.call(this, t, this.className))
});
if(l)
for(t = (e || "").match(st) || []; s > a; a++)
if(n = this[a], i = 1 === n.nodeType && (n.className ? (" " + n.className + " ").replace(wt, " ") : "")) {
for(o = 0; r = t[o++];)
for(; i.indexOf(" " + r + " ") >= 0;) i = i.replace(" " + r + " ", " ");
n.className = e ? ot.trim(i) : ""
}
return this
},
toggleClass: function(e, t) {
var n = typeof e;
return "boolean" == typeof t && "string" === n ? t ? this.addClass(e) : this.removeClass(e) : this.each(ot.isFunction(e) ? function(n) {
ot(this).toggleClass(e.call(this, n, this.className, t), t)
} : function() {
if("string" === n)
for(var t, i = 0, r = ot(this), o = e.match(st) || []; t = o[i++];) r.hasClass(t) ? r.removeClass(t) : r.addClass(t);
else(n === q || "boolean" === n) && (this.className && gt.set(this, "__className__", this.className), this.className = this.className || e === !1 ? "" : gt.get(this, "__className__") || "")
})
},
hasClass: function(e) {
for(var t = " " + e + " ", n = 0, i = this.length; i > n; n++)
if(1 === this[n].nodeType && (" " + this[n].className + " ").replace(wt, " ").indexOf(t) >= 0) return !0;
return !1
},
val: function(e) {
var n, i, r, o = this[0]; {
if(arguments.length) return r = ot.isFunction(e), this.each(function(i) {
var o;
1 === this.nodeType && (o = r ? e.call(this, i, ot(this).val()) : e, null == o ? o = "" : "number" == typeof o ? o += "" : ot.isArray(o) && (o = ot.map(o, function(e) {
return null == e ? "" : e + ""
})), n = ot.valHooks[this.type] || ot.valHooks[this.nodeName.toLowerCase()], n && "set" in n && n.set(this, o, "value") !== t || (this.value = o))
});
if(o) return n = ot.valHooks[o.type] || ot.valHooks[o.nodeName.toLowerCase()], n && "get" in n && (i = n.get(o, "value")) !== t ? i : (i = o.value, "string" == typeof i ? i.replace(St, "") : null == i ? "" : i)
}
}
}), ot.extend({
valHooks: {
option: {
get: function(e) {
var t = e.attributes.value;
return !t || t.specified ? e.value : e.text
}
},
select: {
get: function(e) {
for(var t, n, i = e.options, r = e.selectedIndex, o = "select-one" === e.type || 0 > r, a = o ? null : [], s = o ? r + 1 : i.length, l = 0 > r ? s : o ? r : 0; s > l; l++)
if(n = i[l], !(!n.selected && l !== r || (ot.support.optDisabled ? n.disabled : null !== n.getAttribute("disabled")) || n.parentNode.disabled && ot.nodeName(n.parentNode, "optgroup"))) {
if(t = ot(n).val(), o) return t;
a.push(t)
}
return a
},
set: function(e, t) {
for(var n, i, r = e.options, o = ot.makeArray(t), a = r.length; a--;) i = r[a], (i.selected = ot.inArray(ot(i).val(), o) >= 0) && (n = !0);
return n || (e.selectedIndex = -1), o
}
}
},
attr: function(e, n, i) {
var r, o, a = e.nodeType;
if(e && 3 !== a && 8 !== a && 2 !== a) return typeof e.getAttribute === q ? ot.prop(e, n, i) : (1 === a && ot.isXMLDoc(e) || (n = n.toLowerCase(), r = ot.attrHooks[n] || (ot.expr.match.bool.test(n) ? xt : yt)), i === t ? r && "get" in r && null !== (o = r.get(e, n)) ? o : (o = ot.find.attr(e, n), null == o ? t : o) : null !== i ? r && "set" in r && (o = r.set(e, i, n)) !== t ? o : (e.setAttribute(n, i + ""), i) : void ot.removeAttr(e, n))
},
removeAttr: function(e, t) {
var n, i, r = 0,
o = t && t.match(st);
if(o && 1 === e.nodeType)
for(; n = o[r++];) i = ot.propFix[n] || n, ot.expr.match.bool.test(n) && (e[i] = !1), e.removeAttribute(n)
},
attrHooks: {
type: {
set: function(e, t) {
if(!ot.support.radioValue && "radio" === t && ot.nodeName(e, "input")) {
var n = e.value;
return e.setAttribute("type", t), n && (e.value = n), t
}
}
}
},
propFix: {
"for": "htmlFor",
"class": "className"
},
prop: function(e, n, i) {
var r, o, a, s = e.nodeType;
if(e && 3 !== s && 8 !== s && 2 !== s) return a = 1 !== s || !ot.isXMLDoc(e), a && (n = ot.propFix[n] || n, o = ot.propHooks[n]), i !== t ? o && "set" in o && (r = o.set(e, i, n)) !== t ? r : e[n] = i : o && "get" in o && null !== (r = o.get(e, n)) ? r : e[n]
},
propHooks: {
tabIndex: {
get: function(e) {
return e.hasAttribute("tabindex") || Ct.test(e.nodeName) || e.href ? e.tabIndex : -1
}
}
}
}), xt = {
set: function(e, t, n) {
return t === !1 ? ot.removeAttr(e, n) : e.setAttribute(n, n), n
}
}, ot.each(ot.expr.match.bool.source.match(/\w+/g), function(e, n) {
var i = ot.expr.attrHandle[n] || ot.find.attr;
ot.expr.attrHandle[n] = function(e, n, r) {
var o = ot.expr.attrHandle[n],
a = r ? t : (ot.expr.attrHandle[n] = t) != i(e, n, r) ? n.toLowerCase() : null;
return ot.expr.attrHandle[n] = o, a
}
}), ot.support.optSelected || (ot.propHooks.selected = {
get: function(e) {
var t = e.parentNode;
return t && t.parentNode && t.parentNode.selectedIndex, null
}
}), ot.each(["tabIndex", "readOnly", "maxLength", "cellSpacing", "cellPadding", "rowSpan", "colSpan", "useMap", "frameBorder", "contentEditable"], function() {
ot.propFix[this.toLowerCase()] = this
}), ot.each(["radio", "checkbox"], function() {
ot.valHooks[this] = {
set: function(e, t) {
return ot.isArray(t) ? e.checked = ot.inArray(ot(e).val(), t) >= 0 : void 0
}
}, ot.support.checkOn || (ot.valHooks[this].get = function(e) {
return null === e.getAttribute("value") ? "on" : e.value
})
});
var Tt = /^key/,
Et = /^(?:mouse|contextmenu)|click/,
kt = /^(?:focusinfocus|focusoutblur)$/,
_t = /^([^.]*)(?:\.(.+)|)$/;
ot.event = {
global: {},
add: function(e, n, i, r, o) {
var a, s, l, c, u, d, p, f, h, m, g, v = gt.get(e);
if(v) {
for(i.handler && (a = i, i = a.handler, o = a.selector), i.guid || (i.guid = ot.guid++), (c = v.events) || (c = v.events = {}), (s = v.handle) || (s = v.handle = function(e) {
return typeof ot === q || e && ot.event.triggered === e.type ? t : ot.event.dispatch.apply(s.elem, arguments)
}, s.elem = e), n = (n || "").match(st) || [""], u = n.length; u--;) l = _t.exec(n[u]) || [], h = g = l[1], m = (l[2] || "").split(".").sort(), h && (p = ot.event.special[h] || {}, h = (o ? p.delegateType : p.bindType) || h, p = ot.event.special[h] || {}, d = ot.extend({
type: h,
origType: g,
data: r,
handler: i,
guid: i.guid,
selector: o,
needsContext: o && ot.expr.match.needsContext.test(o),
namespace: m.join(".")
}, a), (f = c[h]) || (f = c[h] = [], f.delegateCount = 0, p.setup && p.setup.call(e, r, m, s) !== !1 || e.addEventListener && e.addEventListener(h, s, !1)), p.add && (p.add.call(e, d), d.handler.guid || (d.handler.guid = i.guid)), o ? f.splice(f.delegateCount++, 0, d) : f.push(d), ot.event.global[h] = !0);
e = null
}
},
remove: function(e, t, n, i, r) {
var o, a, s, l, c, u, d, p, f, h, m, g = gt.hasData(e) && gt.get(e);
if(g && (l = g.events)) {
for(t = (t || "").match(st) || [""], c = t.length; c--;)
if(s = _t.exec(t[c]) || [], f = m = s[1], h = (s[2] || "").split(".").sort(), f) {
for(d = ot.event.special[f] || {}, f = (i ? d.delegateType : d.bindType) || f, p = l[f] || [], s = s[2] && new RegExp("(^|\\.)" + h.join("\\.(?:.*\\.|)") + "(\\.|$)"), a = o = p.length; o--;) u = p[o], !r && m !== u.origType || n && n.guid !== u.guid || s && !s.test(u.namespace) || i && i !== u.selector && ("**" !== i || !u.selector) || (p.splice(o, 1), u.selector && p.delegateCount--, d.remove && d.remove.call(e, u));
a && !p.length && (d.teardown && d.teardown.call(e, h, g.handle) !== !1 || ot.removeEvent(e, f, g.handle), delete l[f])
} else
for(f in l) ot.event.remove(e, f + t[c], n, i, !0);
ot.isEmptyObject(l) && (delete g.handle, gt.remove(e, "events"))
}
},
trigger: function(n, i, r, o) {
var a, s, l, c, u, d, p, f = [r || z],
h = it.call(n, "type") ? n.type : n,
m = it.call(n, "namespace") ? n.namespace.split(".") : [];
if(s = l = r = r || z, 3 !== r.nodeType && 8 !== r.nodeType && !kt.test(h + ot.event.triggered) && (h.indexOf(".") >= 0 && (m = h.split("."), h = m.shift(), m.sort()), u = h.indexOf(":") < 0 && "on" + h, n = n[ot.expando] ? n : new ot.Event(h, "object" == typeof n && n), n.isTrigger = o ? 2 : 3, n.namespace = m.join("."), n.namespace_re = n.namespace ? new RegExp("(^|\\.)" + m.join("\\.(?:.*\\.|)") + "(\\.|$)") : null, n.result = t, n.target || (n.target = r), i = null == i ? [n] : ot.makeArray(i, [n]), p = ot.event.special[h] || {}, o || !p.trigger || p.trigger.apply(r, i) !== !1)) {
if(!o && !p.noBubble && !ot.isWindow(r)) {
for(c = p.delegateType || h, kt.test(c + h) || (s = s.parentNode); s; s = s.parentNode) f.push(s), l = s;
l === (r.ownerDocument || z) && f.push(l.defaultView || l.parentWindow || e)
}
for(a = 0;
(s = f[a++]) && !n.isPropagationStopped();) n.type = a > 1 ? c : p.bindType || h, d = (gt.get(s, "events") || {})[n.type] && gt.get(s, "handle"), d && d.apply(s, i), d = u && s[u], d && ot.acceptData(s) && d.apply && d.apply(s, i) === !1 && n.preventDefault();
return n.type = h, o || n.isDefaultPrevented() || p._default && p._default.apply(f.pop(), i) !== !1 || !ot.acceptData(r) || u && ot.isFunction(r[h]) && !ot.isWindow(r) && (l = r[u], l && (r[u] = null), ot.event.triggered = h, r[h](), ot.event.triggered = t, l && (r[u] = l)), n.result
}
},
dispatch: function(e) {
e = ot.event.fix(e);
var n, i, r, o, a, s = [],
l = et.call(arguments),
c = (gt.get(this, "events") || {})[e.type] || [],
u = ot.event.special[e.type] || {};
if(l[0] = e, e.delegateTarget = this, !u.preDispatch || u.preDispatch.call(this, e) !== !1) {
for(s = ot.event.handlers.call(this, e, c), n = 0;
(o = s[n++]) && !e.isPropagationStopped();)
for(e.currentTarget = o.elem, i = 0;
(a = o.handlers[i++]) && !e.isImmediatePropagationStopped();)(!e.namespace_re || e.namespace_re.test(a.namespace)) && (e.handleObj = a, e.data = a.data, r = ((ot.event.special[a.origType] || {}).handle || a.handler).apply(o.elem, l), r !== t && (e.result = r) === !1 && (e.preventDefault(), e.stopPropagation()));
return u.postDispatch && u.postDispatch.call(this, e), e.result
}
},
handlers: function(e, n) {
var i, r, o, a, s = [],
l = n.delegateCount,
c = e.target;
if(l && c.nodeType && (!e.button || "click" !== e.type))
for(; c !== this; c = c.parentNode || this)
if(c.disabled !== !0 || "click" !== e.type) {
for(r = [], i = 0; l > i; i++) a = n[i], o = a.selector + " ", r[o] === t && (r[o] = a.needsContext ? ot(o, this).index(c) >= 0 : ot.find(o, this, null, [c]).length), r[o] && r.push(a);
r.length && s.push({
elem: c,
handlers: r
})
}
return l < n.length && s.push({
elem: this,
handlers: n.slice(l)
}), s
},
props: "altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),
fixHooks: {},
keyHooks: {
props: "char charCode key keyCode".split(" "),
filter: function(e, t) {
return null == e.which && (e.which = null != t.charCode ? t.charCode : t.keyCode), e
}
},
mouseHooks: {
props: "button buttons clientX clientY offsetX offsetY pageX pageY screenX screenY toElement".split(" "),
filter: function(e, n) {
var i, r, o, a = n.button;
return null == e.pageX && null != n.clientX && (i = e.target.ownerDocument || z, r = i.documentElement, o = i.body, e.pageX = n.clientX + (r && r.scrollLeft || o && o.scrollLeft || 0) - (r && r.clientLeft || o && o.clientLeft || 0), e.pageY = n.clientY + (r && r.scrollTop || o && o.scrollTop || 0) - (r && r.clientTop || o && o.clientTop || 0)), e.which || a === t || (e.which = 1 & a ? 1 : 2 & a ? 3 : 4 & a ? 2 : 0), e
}
},
fix: function(e) {
if(e[ot.expando]) return e;
var t, n, i, r = e.type,
o = e,
a = this.fixHooks[r];
for(a || (this.fixHooks[r] = a = Et.test(r) ? this.mouseHooks : Tt.test(r) ? this.keyHooks : {}), i = a.props ? this.props.concat(a.props) : this.props, e = new ot.Event(o), t = i.length; t--;) n = i[t], e[n] = o[n];
return e.target || (e.target = z), 3 === e.target.nodeType && (e.target = e.target.parentNode), a.filter ? a.filter(e, o) : e
},
special: {
load: {
noBubble: !0
},
focus: {
trigger: function() {
return this !== l() && this.focus ? (this.focus(), !1) : void 0
},
delegateType: "focusin"
},
blur: {
trigger: function() {
return this === l() && this.blur ? (this.blur(), !1) : void 0
},
delegateType: "focusout"
},
click: {
trigger: function() {
return "checkbox" === this.type && this.click && ot.nodeName(this, "input") ? (this.click(), !1) : void 0
},
_default: function(e) {
return ot.nodeName(e.target, "a")
}
},
beforeunload: {
postDispatch: function(e) {
e.result !== t && (e.originalEvent.returnValue = e.result)
}
}
},
simulate: function(e, t, n, i) {
var r = ot.extend(new ot.Event, n, {
type: e,
isSimulated: !0,
originalEvent: {}
});
i ? ot.event.trigger(r, null, t) : ot.event.dispatch.call(t, r), r.isDefaultPrevented() && n.preventDefault()
}
}, ot.removeEvent = function(e, t, n) {
e.removeEventListener && e.removeEventListener(t, n, !1)
}, ot.Event = function(e, t) {
return this instanceof ot.Event ? (e && e.type ? (this.originalEvent = e, this.type = e.type, this.isDefaultPrevented = e.defaultPrevented || e.getPreventDefault && e.getPreventDefault() ? a : s) : this.type = e, t && ot.extend(this, t), this.timeStamp = e && e.timeStamp || ot.now(), void(this[ot.expando] = !0)) : new ot.Event(e, t)
}, ot.Event.prototype = {
isDefaultPrevented: s,
isPropagationStopped: s,
isImmediatePropagationStopped: s,
preventDefault: function() {
var e = this.originalEvent;
this.isDefaultPrevented = a, e && e.preventDefault && e.preventDefault()
},
stopPropagation: function() {
var e = this.originalEvent;
this.isPropagationStopped = a, e && e.stopPropagation && e.stopPropagation()
},
stopImmediatePropagation: function() {
this.isImmediatePropagationStopped = a, this.stopPropagation()
}
}, ot.each({
mouseenter: "mouseover",
mouseleave: "mouseout"
}, function(e, t) {
ot.event.special[e] = {
delegateType: t,
bindType: t,
handle: function(e) {
var n, i = this,
r = e.relatedTarget,
o = e.handleObj;
return(!r || r !== i && !ot.contains(i, r)) && (e.type = o.origType, n = o.handler.apply(this, arguments), e.type = t), n
}
}
}), ot.support.focusinBubbles || ot.each({
focus: "focusin",
blur: "focusout"
}, function(e, t) {
var n = 0,
i = function(e) {
ot.event.simulate(t, e.target, ot.event.fix(e), !0)
};
ot.event.special[t] = {
setup: function() {
0 === n++ && z.addEventListener(e, i, !0)
},
teardown: function() {
0 === --n && z.removeEventListener(e, i, !0)
}
}
}), ot.fn.extend({
on: function(e, n, i, r, o) {
var a, l;
if("object" == typeof e) {
"string" != typeof n && (i = i || n, n = t);
for(l in e) this.on(l, n, i, e[l], o);
return this
}
if(null == i && null == r ? (r = n, i = n = t) : null == r && ("string" == typeof n ? (r = i, i = t) : (r = i, i = n, n = t)), r === !1) r = s;
else if(!r) return this;
return 1 === o && (a = r, r = function(e) {
return ot().off(e), a.apply(this, arguments)
}, r.guid = a.guid || (a.guid = ot.guid++)), this.each(function() {
ot.event.add(this, e, r, i, n)
})
},
one: function(e, t, n, i) {
return this.on(e, t, n, i, 1)
},
off: function(e, n, i) {
var r, o;
if(e && e.preventDefault && e.handleObj) return r = e.handleObj, ot(e.delegateTarget).off(r.namespace ? r.origType + "." + r.namespace : r.origType, r.selector, r.handler), this;
if("object" == typeof e) {
for(o in e) this.off(o, n, e[o]);
return this
}
return(n === !1 || "function" == typeof n) && (i = n, n = t), i === !1 && (i = s), this.each(function() {
ot.event.remove(this, e, i, n)
})
},
trigger: function(e, t) {
return this.each(function() {
ot.event.trigger(e, t, this)
})
},
triggerHandler: function(e, t) {
var n = this[0];
return n ? ot.event.trigger(e, t, n, !0) : void 0
}
});
var It = /^.[^:#\[\.,]*$/,
Dt = /^(?:parents|prev(?:Until|All))/,
Nt = ot.expr.match.needsContext,
Lt = {
children: !0,
contents: !0,
next: !0,
prev: !0
};
ot.fn.extend({
find: function(e) {
var t, n = [],
i = this,
r = i.length;
if("string" != typeof e) return this.pushStack(ot(e).filter(function() {
for(t = 0; r > t; t++)
if(ot.contains(i[t], this)) return !0
}));
for(t = 0; r > t; t++) ot.find(e, i[t], n);
return n = this.pushStack(r > 1 ? ot.unique(n) : n), n.selector = this.selector ? this.selector + " " + e : e, n
},
has: function(e) {
var t = ot(e, this),
n = t.length;
return this.filter(function() {
for(var e = 0; n > e; e++)
if(ot.contains(this, t[e])) return !0
})
},
not: function(e) {
return this.pushStack(u(this, e || [], !0))
},
filter: function(e) {
return this.pushStack(u(this, e || [], !1))
},
is: function(e) {
return !!u(this, "string" == typeof e && Nt.test(e) ? ot(e) : e || [], !1).length
},
closest: function(e, t) {
for(var n, i = 0, r = this.length, o = [], a = Nt.test(e) || "string" != typeof e ? ot(e, t || this.context) : 0; r > i; i++)
for(n = this[i]; n && n !== t; n = n.parentNode)
if(n.nodeType < 11 && (a ? a.index(n) > -1 : 1 === n.nodeType && ot.find.matchesSelector(n, e))) {
n = o.push(n);
break
}
return this.pushStack(o.length > 1 ? ot.unique(o) : o)
},
index: function(e) {
return e ? "string" == typeof e ? tt.call(ot(e), this[0]) : tt.call(this, e.jquery ? e[0] : e) : this[0] && this[0].parentNode ? this.first().prevAll().length : -1
},
add: function(e, t) {
var n = "string" == typeof e ? ot(e, t) : ot.makeArray(e && e.nodeType ? [e] : e),
i = ot.merge(this.get(), n);
return this.pushStack(ot.unique(i))
},
addBack: function(e) {
return this.add(null == e ? this.prevObject : this.prevObject.filter(e))
}
}), ot.each({
parent: function(e) {
var t = e.parentNode;
return t && 11 !== t.nodeType ? t : null
},
parents: function(e) {
return ot.dir(e, "parentNode")
},
parentsUntil: function(e, t, n) {
return ot.dir(e, "parentNode", n)
},
next: function(e) {
return c(e, "nextSibling")
},
prev: function(e) {
return c(e, "previousSibling")
},
nextAll: function(e) {
return ot.dir(e, "nextSibling")
},
prevAll: function(e) {
return ot.dir(e, "previousSibling")
},
nextUntil: function(e, t, n) {
return ot.dir(e, "nextSibling", n)
},
prevUntil: function(e, t, n) {
return ot.dir(e, "previousSibling", n)
},
siblings: function(e) {
return ot.sibling((e.parentNode || {}).firstChild, e)
},
children: function(e) {
return ot.sibling(e.firstChild)
},
contents: function(e) {
return e.contentDocument || ot.merge([], e.childNodes)
}
}, function(e, t) {
ot.fn[e] = function(n, i) {
var r = ot.map(this, t, n);
return "Until" !== e.slice(-5) && (i = n), i && "string" == typeof i && (r = ot.filter(i, r)), this.length > 1 && (Lt[e] || ot.unique(r), Dt.test(e) && r.reverse()), this.pushStack(r)
}
}), ot.extend({
filter: function(e, t, n) {
var i = t[0];
return n && (e = ":not(" + e + ")"), 1 === t.length && 1 === i.nodeType ? ot.find.matchesSelector(i, e) ? [i] : [] : ot.find.matches(e, ot.grep(t, function(e) {
return 1 === e.nodeType
}))
},
dir: function(e, n, i) {
for(var r = [], o = i !== t;
(e = e[n]) && 9 !== e.nodeType;)
if(1 === e.nodeType) {
if(o && ot(e).is(i)) break;
r.push(e)
}
return r
},
sibling: function(e, t) {
for(var n = []; e; e = e.nextSibling) 1 === e.nodeType && e !== t && n.push(e);
return n
}
});
var Mt = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,
At = /<([\w:]+)/,
Rt = /<|?\w+;/,
Pt = /<(?:script|style|link)/i,
Ft = /^(?:checkbox|radio)$/i,
Ot = /checked\s*(?:[^=]|=\s*.checked.)/i,
Bt = /^$|\/(?:java|ecma)script/i,
jt = /^true\/(.*)/,
$t = /^\s*\s*$/g,
Gt = {
option: [1, ""],
thead: [1, "
", "
"],
col: [2, "
", "
"],
tr: [2, "
", "
"],
td: [3, "
", "
"],
_default: [0, "", ""]
};
Gt.optgroup = Gt.option, Gt.tbody = Gt.tfoot = Gt.colgroup = Gt.caption = Gt.thead, Gt.th = Gt.td, ot.fn.extend({
text: function(e) {
return ot.access(this, function(e) {
return e === t ? ot.text(this) : this.empty().append((this[0] && this[0].ownerDocument || z).createTextNode(e))
}, null, e, arguments.length)
},
append: function() {
return this.domManip(arguments, function(e) {
if(1 === this.nodeType || 11 === this.nodeType || 9 === this.nodeType) {
var t = d(this, e);
t.appendChild(e)
}
})
},
prepend: function() {
return this.domManip(arguments, function(e) {
if(1 === this.nodeType || 11 === this.nodeType || 9 === this.nodeType) {
var t = d(this, e);
t.insertBefore(e, t.firstChild)
}
})
},
before: function() {
return this.domManip(arguments, function(e) {
this.parentNode && this.parentNode.insertBefore(e, this)
})
},
after: function() {
return this.domManip(arguments, function(e) {
this.parentNode && this.parentNode.insertBefore(e, this.nextSibling)
})
},
remove: function(e, t) {
for(var n, i = e ? ot.filter(e, this) : this, r = 0; null != (n = i[r]); r++) t || 1 !== n.nodeType || ot.cleanData(g(n)), n.parentNode && (t && ot.contains(n.ownerDocument, n) && h(g(n, "script")), n.parentNode.removeChild(n));
return this
},
empty: function() {
for(var e, t = 0; null != (e = this[t]); t++) 1 === e.nodeType && (ot.cleanData(g(e, !1)), e.textContent = "");
return this
},
clone: function(e, t) {
return e = null == e ? !1 : e, t = null == t ? e : t, this.map(function() {
return ot.clone(this, e, t)
})
},
html: function(e) {
return ot.access(this, function(e) {
var n = this[0] || {}, i = 0,
r = this.length;
if(e === t && 1 === n.nodeType) return n.innerHTML;
if("string" == typeof e && !Pt.test(e) && !Gt[(At.exec(e) || ["", ""])[1].toLowerCase()]) {
e = e.replace(Mt, "<$1>$2>");
try {
for(; r > i; i++) n = this[i] || {}, 1 === n.nodeType && (ot.cleanData(g(n, !1)), n.innerHTML = e);
n = 0
} catch(o) {}
}
n && this.empty().append(e)
}, null, e, arguments.length)
},
replaceWith: function() {
var e = ot.map(this, function(e) {
return [e.nextSibling, e.parentNode]
}),
t = 0;
return this.domManip(arguments, function(n) {
var i = e[t++],
r = e[t++];
r && (i && i.parentNode !== r && (i = this.nextSibling), ot(this).remove(), r.insertBefore(n, i))
}, !0), t ? this : this.remove()
},
detach: function(e) {
return this.remove(e, !0)
},
domManip: function(e, t, n) {
e = Y.apply([], e);
var i, r, o, a, s, l, c = 0,
u = this.length,
d = this,
h = u - 1,
m = e[0],
v = ot.isFunction(m);
if(v || !(1 >= u || "string" != typeof m || ot.support.checkClone) && Ot.test(m)) return this.each(function(i) {
var r = d.eq(i);
v && (e[0] = m.call(this, i, r.html())), r.domManip(e, t, n)
});
if(u && (i = ot.buildFragment(e, this[0].ownerDocument, !1, !n && this), r = i.firstChild, 1 === i.childNodes.length && (i = r), r)) {
for(o = ot.map(g(i, "script"), p), a = o.length; u > c; c++) s = i, c !== h && (s = ot.clone(s, !0, !0), a && ot.merge(o, g(s, "script"))), t.call(this[c], s, c);
if(a)
for(l = o[o.length - 1].ownerDocument, ot.map(o, f), c = 0; a > c; c++) s = o[c], Bt.test(s.type || "") && !gt.access(s, "globalEval") && ot.contains(l, s) && (s.src ? ot._evalUrl(s.src) : ot.globalEval(s.textContent.replace($t, "")))
}
return this
}
}), ot.each({
appendTo: "append",
prependTo: "prepend",
insertBefore: "before",
insertAfter: "after",
replaceAll: "replaceWith"
}, function(e, t) {
ot.fn[e] = function(e) {
for(var n, i = [], r = ot(e), o = r.length - 1, a = 0; o >= a; a++) n = a === o ? this : this.clone(!0), ot(r[a])[t](n), Z.apply(i, n.get());
return this.pushStack(i)
}
}), ot.extend({
clone: function(e, t, n) {
var i, r, o, a, s = e.cloneNode(!0),
l = ot.contains(e.ownerDocument, e);
if(!(ot.support.noCloneChecked || 1 !== e.nodeType && 11 !== e.nodeType || ot.isXMLDoc(e)))
for(a = g(s), o = g(e), i = 0, r = o.length; r > i; i++) v(o[i], a[i]);
if(t)
if(n)
for(o = o || g(e), a = a || g(s), i = 0, r = o.length; r > i; i++) m(o[i], a[i]);
else m(e, s);
return a = g(s, "script"), a.length > 0 && h(a, !l && g(e, "script")), s
},
buildFragment: function(e, t, n, i) {
for(var r, o, a, s, l, c, u = 0, d = e.length, p = t.createDocumentFragment(), f = []; d > u; u++)
if(r = e[u], r || 0 === r)
if("object" === ot.type(r)) ot.merge(f, r.nodeType ? [r] : r);
else if(Rt.test(r)) {
for(o = o || p.appendChild(t.createElement("div")), a = (At.exec(r) || ["", ""])[1].toLowerCase(), s = Gt[a] || Gt._default, o.innerHTML = s[1] + r.replace(Mt, "<$1>$2>") + s[2], c = s[0]; c--;) o = o.lastChild;
ot.merge(f, o.childNodes), o = p.firstChild, o.textContent = ""
} else f.push(t.createTextNode(r));
for(p.textContent = "", u = 0; r = f[u++];)
if((!i || -1 === ot.inArray(r, i)) && (l = ot.contains(r.ownerDocument, r), o = g(p.appendChild(r), "script"), l && h(o), n))
for(c = 0; r = o[c++];) Bt.test(r.type || "") && n.push(r);
return p
},
cleanData: function(e) {
for(var n, i, o, a, s, l, c = ot.event.special, u = 0;
(i = e[u]) !== t; u++) {
if(r.accepts(i) && (s = i[gt.expando], s && (n = gt.cache[s]))) {
if(o = Object.keys(n.events || {}), o.length)
for(l = 0;
(a = o[l]) !== t; l++) c[a] ? ot.event.remove(i, a) : ot.removeEvent(i, a, n.handle);
gt.cache[s] && delete gt.cache[s]
}
delete mt.cache[i[mt.expando]]
}
},
_evalUrl: function(e) {
return ot.ajax({
url: e,
type: "GET",
dataType: "script",
async: !1,
global: !1,
"throws": !0
})
}
}), ot.fn.extend({
wrapAll: function(e) {
var t;
return ot.isFunction(e) ? this.each(function(t) {
ot(this).wrapAll(e.call(this, t))
}) : (this[0] && (t = ot(e, this[0].ownerDocument).eq(0).clone(!0), this[0].parentNode && t.insertBefore(this[0]), t.map(function() {
for(var e = this; e.firstElementChild;) e = e.firstElementChild;
return e
}).append(this)), this)
},
wrapInner: function(e) {
return this.each(ot.isFunction(e) ? function(t) {
ot(this).wrapInner(e.call(this, t))
} : function() {
var t = ot(this),
n = t.contents();
n.length ? n.wrapAll(e) : t.append(e)
})
},
wrap: function(e) {
var t = ot.isFunction(e);
return this.each(function(n) {
ot(this).wrapAll(t ? e.call(this, n) : e)
})
},
unwrap: function() {
return this.parent().each(function() {
ot.nodeName(this, "body") || ot(this).replaceWith(this.childNodes)
}).end()
}
});
var Ht, qt, Ut = /^(none|table(?!-c[ea]).+)/,
zt = /^margin/,
Vt = new RegExp("^(" + at + ")(.*)$", "i"),
Wt = new RegExp("^(" + at + ")(?!px)[a-z%]+$", "i"),
Qt = new RegExp("^([+-])=(" + at + ")", "i"),
Xt = {
BODY: "block"
}, Kt = {
position: "absolute",
visibility: "hidden",
display: "block"
}, Jt = {
letterSpacing: 0,
fontWeight: 400
}, Yt = ["Top", "Right", "Bottom", "Left"],
Zt = ["Webkit", "O", "Moz", "ms"];
ot.fn.extend({
css: function(e, n) {
return ot.access(this, function(e, n, i) {
var r, o, a = {}, s = 0;
if(ot.isArray(n)) {
for(r = x(e), o = n.length; o > s; s++) a[n[s]] = ot.css(e, n[s], !1, r);
return a
}
return i !== t ? ot.style(e, n, i) : ot.css(e, n)
}, e, n, arguments.length > 1)
},
show: function() {
return w(this, !0)
},
hide: function() {
return w(this)
},
toggle: function(e) {
return "boolean" == typeof e ? e ? this.show() : this.hide() : this.each(function() {
y(this) ? ot(this).show() : ot(this).hide()
})
}
}), ot.extend({
cssHooks: {
opacity: {
get: function(e, t) {
if(t) {
var n = Ht(e, "opacity");
return "" === n ? "1" : n
}
}
}
},
cssNumber: {
columnCount: !0,
fillOpacity: !0,
fontWeight: !0,
lineHeight: !0,
opacity: !0,
order: !0,
orphans: !0,
widows: !0,
zIndex: !0,
zoom: !0
},
cssProps: {
"float": "cssFloat"
},
style: function(e, n, i, r) {
if(e && 3 !== e.nodeType && 8 !== e.nodeType && e.style) {
var o, a, s, l = ot.camelCase(n),
c = e.style;
return n = ot.cssProps[l] || (ot.cssProps[l] = b(c, l)), s = ot.cssHooks[n] || ot.cssHooks[l], i === t ? s && "get" in s && (o = s.get(e, !1, r)) !== t ? o : c[n] : (a = typeof i, "string" === a && (o = Qt.exec(i)) && (i = (o[1] + 1) * o[2] + parseFloat(ot.css(e, n)), a = "number"), null == i || "number" === a && isNaN(i) || ("number" !== a || ot.cssNumber[l] || (i += "px"), ot.support.clearCloneStyle || "" !== i || 0 !== n.indexOf("background") || (c[n] = "inherit"), s && "set" in s && (i = s.set(e, i, r)) === t || (c[n] = i)), void 0)
}
},
css: function(e, n, i, r) {
var o, a, s, l = ot.camelCase(n);
return n = ot.cssProps[l] || (ot.cssProps[l] = b(e.style, l)), s = ot.cssHooks[n] || ot.cssHooks[l], s && "get" in s && (o = s.get(e, !0, i)), o === t && (o = Ht(e, n, r)), "normal" === o && n in Jt && (o = Jt[n]), "" === i || i ? (a = parseFloat(o), i === !0 || ot.isNumeric(a) ? a || 0 : o) : o
}
}), Ht = function(e, n, i) {
var r, o, a, s = i || x(e),
l = s ? s.getPropertyValue(n) || s[n] : t,
c = e.style;
return s && ("" !== l || ot.contains(e.ownerDocument, e) || (l = ot.style(e, n)), Wt.test(l) && zt.test(n) && (r = c.width, o = c.minWidth, a = c.maxWidth, c.minWidth = c.maxWidth = c.width = l, l = s.width, c.width = r, c.minWidth = o, c.maxWidth = a)), l
}, ot.each(["height", "width"], function(e, t) {
ot.cssHooks[t] = {
get: function(e, n, i) {
return n ? 0 === e.offsetWidth && Ut.test(ot.css(e, "display")) ? ot.swap(e, Kt, function() {
return T(e, t, i)
}) : T(e, t, i) : void 0
},
set: function(e, n, i) {
var r = i && x(e);
return S(e, n, i ? C(e, t, i, ot.support.boxSizing && "border-box" === ot.css(e, "boxSizing", !1, r), r) : 0)
}
}
}), ot(function() {
ot.support.reliableMarginRight || (ot.cssHooks.marginRight = {
get: function(e, t) {
return t ? ot.swap(e, {
display: "inline-block"
}, Ht, [e, "marginRight"]) : void 0
}
}), !ot.support.pixelPosition && ot.fn.position && ot.each(["top", "left"], function(e, t) {
ot.cssHooks[t] = {
get: function(e, n) {
return n ? (n = Ht(e, t), Wt.test(n) ? ot(e).position()[t] + "px" : n) : void 0
}
}
})
}), ot.expr && ot.expr.filters && (ot.expr.filters.hidden = function(e) {
return e.offsetWidth <= 0 && e.offsetHeight <= 0
}, ot.expr.filters.visible = function(e) {
return !ot.expr.filters.hidden(e)
}), ot.each({
margin: "",
padding: "",
border: "Width"
}, function(e, t) {
ot.cssHooks[e + t] = {
expand: function(n) {
for(var i = 0, r = {}, o = "string" == typeof n ? n.split(" ") : [n]; 4 > i; i++) r[e + Yt[i] + t] = o[i] || o[i - 2] || o[0];
return r
}
}, zt.test(e) || (ot.cssHooks[e + t].set = S)
});
var en = /%20/g,
tn = /\[\]$/,
nn = /\r?\n/g,
rn = /^(?:submit|button|image|reset|file)$/i,
on = /^(?:input|select|textarea|keygen)/i;
ot.fn.extend({
serialize: function() {
return ot.param(this.serializeArray())
},
serializeArray: function() {
return this.map(function() {
var e = ot.prop(this, "elements");
return e ? ot.makeArray(e) : this
}).filter(function() {
var e = this.type;
return this.name && !ot(this).is(":disabled") && on.test(this.nodeName) && !rn.test(e) && (this.checked || !Ft.test(e))
}).map(function(e, t) {
var n = ot(this).val();
return null == n ? null : ot.isArray(n) ? ot.map(n, function(e) {
return {
name: t.name,
value: e.replace(nn, "\r\n")
}
}) : {
name: t.name,
value: n.replace(nn, "\r\n")
}
}).get()
}
}), ot.param = function(e, n) {
var i, r = [],
o = function(e, t) {
t = ot.isFunction(t) ? t() : null == t ? "" : t, r[r.length] = encodeURIComponent(e) + "=" + encodeURIComponent(t)
};
if(n === t && (n = ot.ajaxSettings && ot.ajaxSettings.traditional), ot.isArray(e) || e.jquery && !ot.isPlainObject(e)) ot.each(e, function() {
o(this.name, this.value)
});
else
for(i in e) _(i, e[i], n, o);
return r.join("&").replace(en, "+")
}, ot.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) {
ot.fn[t] = function(e, n) {
return arguments.length > 0 ? this.on(t, null, e, n) : this.trigger(t)
}
}), ot.fn.extend({
hover: function(e, t) {
return this.mouseenter(e).mouseleave(t || e)
},
bind: function(e, t, n) {
return this.on(e, null, t, n)
},
unbind: function(e, t) {
return this.off(e, null, t)
},
delegate: function(e, t, n, i) {
return this.on(t, e, n, i)
},
undelegate: function(e, t, n) {
return 1 === arguments.length ? this.off(e, "**") : this.off(t, e || "**", n)
}
});
var an, sn, ln = ot.now(),
cn = /\?/,
un = /#.*$/,
dn = /([?&])_=[^&]*/,
pn = /^(.*?):[ \t]*([^\r\n]*)$/gm,
fn = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/,
hn = /^(?:GET|HEAD)$/,
mn = /^\/\//,
gn = /^([\w.+-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,
vn = ot.fn.load,
bn = {}, yn = {}, xn = "*/".concat("*");
try {
sn = U.href
} catch(wn) {
sn = z.createElement("a"), sn.href = "", sn = sn.href
}
an = gn.exec(sn.toLowerCase()) || [], ot.fn.load = function(e, n, i) {
if("string" != typeof e && vn) return vn.apply(this, arguments);
var r, o, a, s = this,
l = e.indexOf(" ");
return l >= 0 && (r = e.slice(l), e = e.slice(0, l)), ot.isFunction(n) ? (i = n, n = t) : n && "object" == typeof n && (o = "POST"), s.length > 0 && ot.ajax({
url: e,
type: o,
dataType: "html",
data: n
}).done(function(e) {
a = arguments, s.html(r ? ot("
").append(ot.parseHTML(e)).find(r) : e)
}).complete(i && function(e, t) {
s.each(i, a || [e.responseText, t, e])
}), this
}, ot.each(["ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend"], function(e, t) {
ot.fn[t] = function(e) {
return this.on(t, e)
}
}), ot.extend({
active: 0,
lastModified: {},
etag: {},
ajaxSettings: {
url: sn,
type: "GET",
isLocal: fn.test(an[1]),
global: !0,
processData: !0,
async: !0,
contentType: "application/x-www-form-urlencoded; charset=UTF-8",
accepts: {
"*": xn,
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",
json: "responseJSON"
},
converters: {
"* text": String,
"text html": !0,
"text json": ot.parseJSON,
"text xml": ot.parseXML
},
flatOptions: {
url: !0,
context: !0
}
},
ajaxSetup: function(e, t) {
return t ? N(N(e, ot.ajaxSettings), t) : N(ot.ajaxSettings, e)
},
ajaxPrefilter: I(bn),
ajaxTransport: I(yn),
ajax: function(e, n) {
function i(e, n, i, s) {
var c, d, b, y, w, C = n;
2 !== x && (x = 2, l && clearTimeout(l), r = t, a = s || "", S.readyState = e > 0 ? 4 : 0, c = e >= 200 && 300 > e || 304 === e, i && (y = L(p, S, i)), y = M(p, y, S, c), c ? (p.ifModified && (w = S.getResponseHeader("Last-Modified"), w && (ot.lastModified[o] = w), w = S.getResponseHeader("etag"), w && (ot.etag[o] = w)), 204 === e || "HEAD" === p.type ? C = "nocontent" : 304 === e ? C = "notmodified" : (C = y.state, d = y.data, b = y.error, c = !b)) : (b = C, (e || !C) && (C = "error", 0 > e && (e = 0))), S.status = e, S.statusText = (n || C) + "", c ? m.resolveWith(f, [d, C, S]) : m.rejectWith(f, [S, C, b]), S.statusCode(v), v = t, u && h.trigger(c ? "ajaxSuccess" : "ajaxError", [S, p, c ? d : b]), g.fireWith(f, [S, C]), u && (h.trigger("ajaxComplete", [S, p]), --ot.active || ot.event.trigger("ajaxStop")))
}
"object" == typeof e && (n = e, e = t), n = n || {};
var r, o, a, s, l, c, u, d, p = ot.ajaxSetup({}, n),
f = p.context || p,
h = p.context && (f.nodeType || f.jquery) ? ot(f) : ot.event,
m = ot.Deferred(),
g = ot.Callbacks("once memory"),
v = p.statusCode || {}, b = {}, y = {}, x = 0,
w = "canceled",
S = {
readyState: 0,
getResponseHeader: function(e) {
var t;
if(2 === x) {
if(!s)
for(s = {}; t = pn.exec(a);) s[t[1].toLowerCase()] = t[2];
t = s[e.toLowerCase()]
}
return null == t ? null : t
},
getAllResponseHeaders: function() {
return 2 === x ? a : null
},
setRequestHeader: function(e, t) {
var n = e.toLowerCase();
return x || (e = y[n] = y[n] || e, b[e] = t), this
},
overrideMimeType: function(e) {
return x || (p.mimeType = e), this
},
statusCode: function(e) {
var t;
if(e)
if(2 > x)
for(t in e) v[t] = [v[t], e[t]];
else S.always(e[S.status]);
return this
},
abort: function(e) {
var t = e || w;
return r && r.abort(t), i(0, t), this
}
};
if(m.promise(S).complete = g.add, S.success = S.done, S.error = S.fail, p.url = ((e || p.url || sn) + "").replace(un, "").replace(mn, an[1] + "//"), p.type = n.method || n.type || p.method || p.type, p.dataTypes = ot.trim(p.dataType || "*").toLowerCase().match(st) || [""], null == p.crossDomain && (c = gn.exec(p.url.toLowerCase()), p.crossDomain = !(!c || c[1] === an[1] && c[2] === an[2] && (c[3] || ("http:" === c[1] ? "80" : "443")) === (an[3] || ("http:" === an[1] ? "80" : "443")))), p.data && p.processData && "string" != typeof p.data && (p.data = ot.param(p.data, p.traditional)), D(bn, p, n, S), 2 === x) return S;
u = p.global, u && 0 === ot.active++ && ot.event.trigger("ajaxStart"), p.type = p.type.toUpperCase(), p.hasContent = !hn.test(p.type), o = p.url, p.hasContent || (p.data && (o = p.url += (cn.test(o) ? "&" : "?") + p.data, delete p.data), p.cache === !1 && (p.url = dn.test(o) ? o.replace(dn, "$1_=" + ln++) : o + (cn.test(o) ? "&" : "?") + "_=" + ln++)), p.ifModified && (ot.lastModified[o] && S.setRequestHeader("If-Modified-Since", ot.lastModified[o]), ot.etag[o] && S.setRequestHeader("If-None-Match", ot.etag[o])), (p.data && p.hasContent && p.contentType !== !1 || n.contentType) && S.setRequestHeader("Content-Type", p.contentType), S.setRequestHeader("Accept", p.dataTypes[0] && p.accepts[p.dataTypes[0]] ? p.accepts[p.dataTypes[0]] + ("*" !== p.dataTypes[0] ? ", " + xn + "; q=0.01" : "") : p.accepts["*"]);
for(d in p.headers) S.setRequestHeader(d, p.headers[d]);
if(p.beforeSend && (p.beforeSend.call(f, S, p) === !1 || 2 === x)) return S.abort();
w = "abort";
for(d in {
success: 1,
error: 1,
complete: 1
}) S[d](p[d]);
if(r = D(yn, p, n, S)) {
S.readyState = 1, u && h.trigger("ajaxSend", [S, p]), p.async && p.timeout > 0 && (l = setTimeout(function() {
S.abort("timeout")
}, p.timeout));
try {
x = 1, r.send(b, i)
} catch(C) {
if(!(2 > x)) throw C;
i(-1, C)
}
} else i(-1, "No Transport");
return S
},
getJSON: function(e, t, n) {
return ot.get(e, t, n, "json")
},
getScript: function(e, n) {
return ot.get(e, t, n, "script")
}
}), ot.each(["get", "post"], function(e, n) {
ot[n] = function(e, i, r, o) {
return ot.isFunction(i) && (o = o || r, r = i, i = t), ot.ajax({
url: e,
type: n,
dataType: o,
data: i,
success: r
})
}
}), ot.ajaxSetup({
accepts: {
script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"
},
contents: {
script: /(?:java|ecma)script/
},
converters: {
"text script": function(e) {
return ot.globalEval(e), e
}
}
}), ot.ajaxPrefilter("script", function(e) {
e.cache === t && (e.cache = !1), e.crossDomain && (e.type = "GET")
}), ot.ajaxTransport("script", function(e) {
if(e.crossDomain) {
var t, n;
return {
send: function(i, r) {
t = ot("\n', "\n", '
<%= documentHTML %>
\n', ""].join(""),
pdfTemplate: ["\n", "\n", "\n", '\n', "<%= documentTitle %>\n", '\n', '\n", '\n', "\n", '<%= documentHTML %>\n', ""].join(""),
pdfPageSize: "A4",
sshProxy: t.SSH_PROXY_URL,
extensionSettings: {}
};
try {
e.extend(i, JSON.parse(n.settings))
} catch(r) {}
return i
}), define("logger", [], function() {
var e = {
log: function() {},
info: function() {},
warn: function() {},
error: function() {}
};
return /(\?|&)console($|&)/.test(location.search) ? console : e
}), define("classes/Extension", [], function() {
function e(e, t, n, i) {
this.extensionId = e, this.extensionName = t, this.isOptional = n, this.disableInViewer = i
}
return e
}), define("text", ["module"], function(e) {
var t, n, i, r, o, a = ["Msxml2.XMLHTTP", "Microsoft.XMLHTTP", "Msxml2.XMLHTTP.4.0"],
s = /^\s*<\?xml(\s)+version=[\'\"](\d)*.(\d)*[\'\"](\s)*\?>/im,
l = /]*>\s*([\s\S]+)\s*<\/body>/im,
c = "undefined" != typeof location && location.href,
u = c && location.protocol && location.protocol.replace(/\:/, ""),
d = c && location.hostname,
p = c && (location.port || void 0),
f = {}, h = e.config && e.config() || {};
return t = {
version: "2.0.12",
strip: function(e) {
if(e) {
e = e.replace(s, "");
var t = e.match(l);
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: h.createXhr || function() {
var e, t, n;
if("undefined" != typeof XMLHttpRequest) return new XMLHttpRequest;
if("undefined" != typeof ActiveXObject)
for(t = 0; 3 > t; t += 1) {
n = a[t];
try {
e = new ActiveXObject(n)
} catch(i) {}
if(e) {
a = [n];
break
}
}
return e
},
parseName: function(e) {
var t, n, i, r = !1,
o = e.indexOf("."),
a = 0 === e.indexOf("./") || 0 === e.indexOf("../");
return -1 !== o && (!a || o > 1) ? (t = e.substring(0, o), n = e.substring(o + 1, e.length)) : t = e, i = n || t, o = i.indexOf("!"), -1 !== o && (r = "strip" === i.substring(o + 1), i = i.substring(0, o), n ? n = i : t = i), {
moduleName: t,
ext: n,
strip: r
}
},
xdRegExp: /^((\w+)\:)?\/\/([^\/\\]+)/,
useXhr: function(e, n, i, r) {
var o, a, s, l = t.xdRegExp.exec(e);
return l ? (o = l[2], a = l[3], a = a.split(":"), s = a[1], a = a[0], !(o && o !== n || a && a.toLowerCase() !== i.toLowerCase() || (s || a) && s !== r)) : !0
},
finishLoad: function(e, n, i, r) {
i = n ? t.strip(i) : i, h.isBuild && (f[e] = i), r(i)
},
load: function(e, n, i, r) {
if(r && r.isBuild && !r.inlineText) return void i();
h.isBuild = r && r.isBuild;
var o = t.parseName(e),
a = o.moduleName + (o.ext ? "." + o.ext : ""),
s = n.toUrl(a),
l = h.useXhr || t.useXhr;
return 0 === s.indexOf("empty:") ? void i() : void(!c || l(s, u, d, p) ? t.get(s, function(n) {
t.finishLoad(e, o.strip, n, i)
}, function(e) {
i.error && i.error(e)
}) : n([a], function(e) {
t.finishLoad(o.moduleName + "." + o.ext, o.strip, e, i)
}))
},
write: function(e, n, i) {
if(f.hasOwnProperty(n)) {
var r = t.jsEscape(f[n]);
i.asModule(e + "!" + n, "define(function () { return '" + r + "';});\n")
}
},
writeFile: function(e, n, i, r, o) {
var a = t.parseName(n),
s = a.ext ? "." + a.ext : "",
l = a.moduleName + s,
c = i.toUrl(a.moduleName + s) + ".js";
t.load(l, i, function() {
var n = function(e) {
return r(c, e)
};
n.asModule = function(e, t) {
return r.asModule(e, c, t)
}, t.write(e, l, n, o)
}, o)
}
}, "node" === h.env || !h.env && "undefined" != typeof process && process.versions && process.versions.node && !process.versions["node-webkit"] ? (n = require.nodeRequire("fs"), t.get = function(e, t, i) {
try {
var r = n.readFileSync(e, "utf8");
0 === r.indexOf("") && (r = r.substring(1)), t(r)
} catch(o) {
i && i(o)
}
}) : "xhr" === h.env || !h.env && t.createXhr() ? t.get = function(e, n, i, r) {
var o, a = t.createXhr();
if(a.open("GET", e, !0), r)
for(o in r) r.hasOwnProperty(o) && a.setRequestHeader(o.toLowerCase(), r[o]);
h.onXhr && h.onXhr(a, e), a.onreadystatechange = function() {
var t, r;
4 === a.readyState && (t = a.status || 0, t > 399 && 600 > t ? (r = new Error(e + " HTTP status: " + t), r.xhr = a, i && i(r)) : n(a.responseText), h.onXhrComplete && h.onXhrComplete(a, e))
}, a.send(null)
} : "rhino" === h.env || !h.env && "undefined" != typeof Packages && "undefined" != typeof java ? t.get = function(e, t) {
var n, i, r = "utf-8",
o = new java.io.File(e),
a = java.lang.System.getProperty("line.separator"),
s = new java.io.BufferedReader(new java.io.InputStreamReader(new java.io.FileInputStream(o), r)),
l = "";
try {
for(n = new java.lang.StringBuffer, i = s.readLine(), i && i.length() && 65279 === i.charAt(0) && (i = i.substring(1)), null !== i && n.append(i); null !== (i = s.readLine());) n.append(a), n.append(i);
l = String(n.toString())
} finally {
s.close()
}
t(l)
} : ("xpconnect" === h.env || !h.env && "undefined" != typeof Components && Components.classes && Components.interfaces) && (i = Components.classes, r = Components.interfaces, Components.utils["import"]("resource://gre/modules/FileUtils.jsm"), o = "@mozilla.org/windows-registry-key;1" in i, t.get = function(e, t) {
var n, a, s, l = {};
o && (e = e.replace(/\//g, "\\")), s = new FileUtils.File(e);
try {
n = i["@mozilla.org/network/file-input-stream;1"].createInstance(r.nsIFileInputStream), n.init(s, 1, 0, !1), a = i["@mozilla.org/intl/converter-input-stream;1"].createInstance(r.nsIConverterInputStream), a.init(n, "utf-8", n.available(), r.nsIConverterInputStream.DEFAULT_REPLACEMENT_CHARACTER), a.readString(n.available(), l), a.close(), n.close(), t(l.value)
} catch(c) {
throw new Error((s && s.path || "") + ": " + c)
}
}), t
}), define("text!html/settingsExtensionsAccordion.html", [], function() {
return '
\n\n"
}), e = e.replace(/^(\#{1,6})[ \t]*(.+?)[ \t]*\#*\n+/gm, function(e, t, n) {
var i = t.length;
return "" + a(n) + "\n\n"
})
}
function h(e, t) {
e += "~0";
var n = /^(([ ]{0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(~0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/gm;
return B ? e = e.replace(n, function(e, n, i) {
var r = n,
o = i.search(/[*+-]/g) > -1 ? "ul" : "ol",
a = m(r, o, t);
return a = a.replace(/\s+$/, ""), a = "<" + o + ">" + a + "" + o + ">\n"
}) : (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, i) {
var r = t,
o = n,
a = i.search(/[*+-]/g) > -1 ? "ul" : "ol",
s = m(o, a);
return s = r + "<" + a + ">\n" + s + "" + a + ">\n"
})), e = e.replace(/~0/, "")
}
function m(e, t, n) {
B++, e = e.replace(/\n{2,}$/, "\n"), e += "~0";
var i = $[t],
r = new RegExp("(^[ \\t]*)(" + i + ")[ \\t]+([^\\r]+?(\\n+))(?=(~0|\\1(" + i + ")[ \\t]+))", "gm"),
s = !1;
return e = e.replace(r, function(e, t, i, r) {
var l = r,
c = /\n\n$/.test(l),
u = c || l.search(/\n{2,}/) > -1;
return u || s ? l = o(I(l), !0) : (l = h(I(l), !0), l = l.replace(/\n$/, ""), n || (l = a(l))), s = c, "
" + l + "
\n"
}), e = e.replace(/~0/g, ""), B--, e
}
function g(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 i = t,
r = n;
return i = y(I(i)), i = D(i), i = i.replace(/^\n+/g, ""), i = i.replace(/\n+$/g, ""), i = "
" + i + "\n
", "\n\n" + i + "\n\n" + r
}), e = e.replace(/~0/, "")
}
function v(e) {
return e = e.replace(/(^\n+|\n+$)/g, ""), "\n\n~K" + (O.push(e) - 1) + "K\n\n"
}
function b(e) {
return e = e.replace(/(^|[^\\])(`+)([^\r]*?[^`])\2(?!`)/gm, function(e, t, n, i) {
var r = i;
return r = r.replace(/^([ \t]*)/g, ""), r = r.replace(/[ \t]*$/g, ""), r = y(r), r = r.replace(/:\/\//g, "~P"), t + "" + r + ""
})
}
function y(e) {
return e = e.replace(/&/g, "&"), e = e.replace(//g, ">"), e = L(e, "*_{}[]\\", !1)
}
function x(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")
}
function w(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 = o(n), n = n.replace(/(^|\n)/g, "$1 "), n = n.replace(/(\s*
[^\r]+?<\/pre>)/gm, function(e, t) {
var n = t;
return n = n.replace(/^ /gm, "~0"), n = n.replace(/~0/g, "")
}), v("
\n" + n + "\n
")
})
}
function S(e, t) {
e = e.replace(/^\n+/g, ""), e = e.replace(/\n+$/g, "");
for(var n = e.split(/\n{2,}/g), i = [], r = /~K(\d+)K/, o = n.length, s = 0; o > s; s++) {
var l = n[s];
r.test(l) ? i.push(l) : /\S/.test(l) && (l = a(l), l = l.replace(/^([ \t]*)/g, "
"), l += "
", i.push(l))
}
if(!t) {
o = i.length;
for(var s = 0; o > s; s++)
for(var c = !0; c;) c = !1, i[s] = i[s].replace(/~K(\d+)K/g, function(e, t) {
return c = !0, O[t]
})
}
return i.join("\n\n")
}
function C(e) {
return e = e.replace(/&(?!#?[xX]?(?:[0-9a-fA-F]+|\w+);)/g, "&"), e = e.replace(/<(?![a-z\/?!]|~D)/gi, "<")
}
function T(e) {
return e = e.replace(/\\(\\)/g, M), e = e.replace(/\\([`*_{}\[\]()>#+-.!])/g, M)
}
function E(e, t, n, i) {
if(t) return e;
if(")" !== i.charAt(i.length - 1)) return "<" + n + i + ">";
for(var r = i.match(/[()]/g), o = 0, a = 0; a < r.length; a++) "(" === r[a] ? 0 >= o ? o = 1 : o++ : o--;
var s = "";
if(0 > o) {
var l = new RegExp("\\){1," + -o + "}$");
i = i.replace(l, function(e) {
return s = e, ""
})
}
if(s) {
var c = i.charAt(i.length - 1);
U.test(c) || (s = c + s, i = i.substr(0, i.length - 1))
}
return "<" + n + i + ">" + s
}
function k(e) {
e = e.replace(q, E);
var t = function(e, t) {
return '' + R.plainLinkText(t) + ""
};
return e = e.replace(/<((https?|ftp):[^'">\s]+)>/gi, t)
}
function _(e) {
return e = e.replace(/~E(\d+)E/g, function(e, t) {
var n = parseInt(t);
return String.fromCharCode(n)
})
}
function I(e) {
return e = e.replace(/^(\t|[ ]{1,4})/gm, "~0"), e = e.replace(/~0/g, "")
}
function D(e) {
if(!/\t/.test(e)) return e;
var t, n = [" ", " ", " ", " "],
i = 0;
return e.replace(/[\n\t]/g, function(e, r) {
return "\n" === e ? (i = r + 1, e) : (t = (r - i) % 4, i = r + 1, n[t])
})
}
function N(e) {
if(!e) return "";
e.length;
return e.replace(z, function(e) {
return "~D" == e ? "%24" : ":" == e ? ":" : "%" + e.charCodeAt(0).toString(16)
})
}
function L(e, t, n) {
var i = "([" + t.replace(/([\[\]\\])/g, "\\$1") + "])";
n && (i = "\\\\" + i);
var r = new RegExp(i, "g");
return e = e.replace(r, M)
}
function M(e, t) {
var n = t.charCodeAt(0);
return "~E" + n + "E"
}
var A = {};
this.setOptions = function(e) {
A = e
};
var R = this.hooks = new n;
R.addNoop("plainLinkText"), R.addNoop("preConversion"), R.addNoop("postNormalization"), R.addNoop("preBlockGamut"), R.addNoop("postBlockGamut"), R.addNoop("preSpanGamut"), R.addNoop("postSpanGamut"), R.addNoop("postConversion");
var P, F, O, B;
this.makeHtml = function(n) {
if(P) throw new Error("Recursive call to converter.makeHtml");
return P = new i, F = new i, O = [], B = 0, n = R.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 = D(n), n = n.replace(/^[ \t]+$/gm, ""), n = R.postNormalization(n), n = t(n), n = e(n), n = o(n), n = _(n), n = n.replace(/~D/g, "$$"), n = n.replace(/~T/g, "~"), n = R.postConversion(n), O = F = P = null, n
};
var j = function(e) {
return o(e)
}, $ = {
ol: "\\d+[.]",
ul: "[*+-]"
}, G = "[-A-Z0-9+&@#/%?=~_|[\\]()!:,.;]",
H = "[-A-Z0-9+&@#/%=~_|[\\])]",
q = new RegExp('(="|<)?\\b(https?|ftp)(://' + G + "*" + H + ")(?=$|\\W)", "gi"),
U = new RegExp(H, "i"),
z = /(?:["'*()[\]:]|~D)/g
}
}(), define("libs/Markdown.Converter", function() {}), function() {
function e(e) {
return e.replace(/^\s+|\s+$/g, "")
}
function t(e) {
return e.replace(/\s+$/g, "")
}
function n(e) {
return e.replace(new RegExp("^(\\t|[ ]{1,4})", "gm"), "")
}
function i(e, t) {
return -1 != e.indexOf(t)
}
function r(e, t) {
return e.replace(/<[^>]*>?/gi, function(e) {
return e.match(t) ? e : ""
})
}
function o(e, t) {
for(var n = {}, i = 0; i < e.length; i++) n[e[i]] = e[i];
for(i = 0; i < t.length; i++) n[t[i]] = t[i];
var r = [];
for(var o in n) n.hasOwnProperty(o) && r.push(n[o]);
return r
}
function a(e) {
return "" != e.charAt(0) && (e = "" + e), "" != e.charAt(e.length - 1) && (e += ""), e
}
function s(e) {
return "" == e.charAt(0) && (e = e.substr(1)), "" == e.charAt(e.length - 1) && (e = e.substr(0, e.length - 1)), e
}
function l(e, t) {
return r(c(e, t), m)
}
function c(e, t) {
var n = t.blockGamutHookCallback(e);
return n = p(n), n = n.replace(/~D/g, "$$").replace(/~T/g, "~"), n = t.previousPostConversion(n)
}
function u(e) {
return e.replace(/\\\|/g, "~I").replace(/\\:/g, "~i")
}
function d(e) {
return e.replace(/~I/g, "|").replace(/~i/g, ":")
}
function p(e) {
return e = e.replace(/~E(\d+)E/g, function(e, t) {
var n = parseInt(t);
return String.fromCharCode(n)
})
}
function f(e) {
return e.toLowerCase().replace(/\s+/g, "-").replace(/[^\w\-]+/g, "").replace(/\-\-+/g, "-").replace(/^-+/, "").replace(/-+$/, "")
}
function h(e, t) {
var n = t;
return n = n.replace(/&\#8220;/g, '"'), n = n.replace(/&\#8221;/g, '"'), n = n.replace(/&\#8216;/g, "'"), n = n.replace(/&\#8217;/g, "'"), n = n.replace(/&\#8212;/g, "---"), n = n.replace(/&\#8211;/g, "--"), n = n.replace(/&\#8230;/g, "...")
}
var m = new RegExp(["^(<\\/?(a|abbr|acronym|applet|area|b|basefont|", "bdo|big|button|cite|code|del|dfn|em|figcaption|", "font|i|iframe|img|input|ins|kbd|label|map|", "mark|meter|object|param|progress|q|ruby|rp|rt|s|", "samp|script|select|small|span|strike|strong|", "sub|sup|textarea|time|tt|u|var|wbr)[^>]*>|", "<(br)\\s?\\/?>)$"].join(""), "i");
Array.indexOf || (Array.prototype.indexOf = function(e) {
for(var t = 0; t < this.length; t++)
if(this[t] == e) return t;
return -1
}), Markdown.Extra = function() {
this.converter = null, this.hashBlocks = [], this.footnotes = {}, this.usedFootnotes = [], this.attributeBlocks = !1, this.googleCodePrettify = !1, this.highlightJs = !1, this.tableClass = "", this.tabWidth = 4
}, Markdown.Extra.init = function(e, t) {
var n = new Markdown.Extra,
r = [],
o = [],
a = [],
s = ["unHashExtraBlocks"];
return t = t || {}, t.extensions = t.extensions || ["all"], i(t.extensions, "all") && (t.extensions = ["tables", "fenced_code_gfm", "def_list", "attr_list", "footnotes", "smartypants", "strikethrough", "newlines"]), o.push("wrapHeaders"), i(t.extensions, "attr_list") && (r.push("hashFcbAttributeBlocks"), o.push("hashHeaderAttributeBlocks"), s.push("applyAttributeBlocks"), n.attributeBlocks = !0), i(t.extensions, "fenced_code_gfm") && (o.push("fencedCodeBlocks"), r.push("fencedCodeBlocks")), i(t.extensions, "tables") && o.push("tables"), i(t.extensions, "def_list") && o.push("definitionLists"), i(t.extensions, "footnotes") && (r.push("stripFootnoteDefinitions"), o.push("doFootnotes"), s.push("printFootnotes")), i(t.extensions, "smartypants") && s.push("runSmartyPants"), i(t.extensions, "strikethrough") && a.push("strikethrough"), i(t.extensions, "newlines") && a.push("newlines"), e.hooks.chain("postNormalization", function(e) {
return n.doTransform(r, e) + "\n"
}), e.hooks.chain("preBlockGamut", function(e, t) {
return n.blockGamutHookCallback = t, e = u(e), e = n.doTransform(o, e) + "\n", e = d(e)
}), e.hooks.chain("postSpanGamut", function(e) {
return n.doTransform(a, e)
}), n.previousPostConversion = e.hooks.postConversion, e.hooks.chain("postConversion", function(e) {
return e = n.doTransform(s, e), n.hashBlocks = [], n.footnotes = {}, n.usedFootnotes = [], e
}), "highlighter" in t && (n.googleCodePrettify = "prettify" === t.highlighter, n.highlightJs = "highlight" === t.highlighter), "table_class" in t && (n.tableClass = t.table_class), n.converter = e, n
}, Markdown.Extra.prototype.doTransform = function(e, t) {
for(var n = 0; n < e.length; n++) t = this[e[n]](t);
return t
}, Markdown.Extra.prototype.hashExtraBlock = function(e) {
return "\n
~X" + (this.hashBlocks.push(e) - 1) + "X
\n"
}, Markdown.Extra.prototype.hashExtraInline = function(e) {
return "~X" + (this.hashBlocks.push(e) - 1) + "X"
}, Markdown.Extra.prototype.unHashExtraBlocks = function(e) {
function t() {
var i = !1;
e = e.replace(/(?:
)?~X(\d+)X(?:<\/p>)?/g, function(e, t) {
i = !0;
var r = parseInt(t, 10);
return n.hashBlocks[r]
}), i === !0 && t()
}
var n = this;
return t(), e
}, Markdown.Extra.prototype.wrapHeaders = function(e) {
function t(e) {
return "\n" + e + "\n"
}
return e = e.replace(/^.+[ \t]*\n=+[ \t]*\n+/gm, t), e = e.replace(/^.+[ \t]*\n-+[ \t]*\n+/gm, t), e = e.replace(/^\#{1,6}[ \t]*.+?[ \t]*\#*\n+/gm, t)
};
var g = "\\{[ \\t]*((?:[#.][-_:a-zA-Z0-9]+[ \\t]*)+)\\}",
v = new RegExp("^(#{1,6}.*#{0,6})[ \\t]+" + g + "[ \\t]*(?:\\n|0x03)", "gm"),
b = new RegExp("^(.*)[ \\t]+" + g + "[ \\t]*\\n(?=[\\-|=]+\\s*(?:\\n|0x03))", "gm"),
y = new RegExp("^(```[ \\t]*[^{\\s]*)[ \\t]+" + g + "[ \\t]*\\n(?=([\\s\\S]*?)\\n```[ \\t]*(\\n|0x03))", "gm");
Markdown.Extra.prototype.hashHeaderAttributeBlocks = function(e) {
function t(e, t, i) {
return "
~XX" + (n.hashBlocks.push(i) - 1) + "XX
\n" + t + "\n"
}
var n = this;
return e = e.replace(v, t), e = e.replace(b, t)
}, Markdown.Extra.prototype.hashFcbAttributeBlocks = function(e) {
function t(e, t, i) {
return "
~XX" + (n.hashBlocks.push(i) - 1) + "XX
\n" + t + "\n"
}
var n = this;
return e.replace(y, t)
}, Markdown.Extra.prototype.applyAttributeBlocks = function(e) {
var t = this,
n = new RegExp('
~XX(\\d+)XX
[\\s]*(?:<(h[1-6]|pre)(?: +class="(\\S+)")?(>[\\s\\S]*?\\2>))', "gm");
return e = e.replace(n, function(e, n, i, r, a) {
if(!i) return "";
for(var s = parseInt(n, 10), l = t.hashBlocks[s], c = l.match(/#[^\s#.]+/g) || [], u = c[0] ? ' id="' + c[0].substr(1, c[0].length - 1) + '"' : "", d = l.match(/\.[^\s#.]+/g) || [], p = 0; p < d.length; p++) d[p] = d[p].substr(1, d[p].length - 1);
var f = "";
return r && (d = o(d, [r])), d.length > 0 && (f = ' class="' + d.join(" ") + '"'), "<" + i + u + f + a
})
}, Markdown.Extra.prototype.tables = function(t) {
function n(t, n, r, o) {
n = n.replace(/^ *[|]/m, ""), r = r.replace(/^ *[|]/m, ""), o = o.replace(/^ *[|]/gm, ""), n = n.replace(/[|] *$/m, ""), r = r.replace(/[|] *$/m, ""), o = o.replace(/[|] *$/gm, ""), alignspecs = r.split(/ *[|] */), align = [];
for(var a = 0; a < alignspecs.length; a++) {
var s = alignspecs[a];
align[a] = s.match(/^ *-+: *$/m) ? ' style="text-align:right;"' : s.match(/^ *:-+: *$/m) ? ' style="text-align:center;"' : s.match(/^ *:-+ *$/m) ? ' style="text-align:left;"' : ""
}
var c = n.split(/ *[|] */),
u = c.length,
d = i.tableClass ? ' class="' + i.tableClass + '"' : "",
p = ["
\n", "\n", "
\n"].join("");
for(a = 0; u > a; a++) {
var f = l(e(c[a]), i);
p += ["
", f, "
\n"].join("")
}
p += "
\n\n";
var h = o.split("\n");
for(a = 0; a < h.length; a++)
if(!h[a].match(/^\s*$/)) {
for(var m = h[a].split(/ *[|] */), g = u - m.length, v = 0; g > v; v++) m.push("");
for(p += "
\n", v = 0; u > v; v++) {
var b = l(e(m[v]), i);
p += ["
", b, "
\n"].join("")
}
p += "
\n"
}
return p += "
\n", i.hashExtraBlock(p)
}
var i = this,
r = new RegExp(["^", "[ ]{0,3}", "[|]", "(.+)\\n", "[ ]{0,3}", "[|]([ ]*[-:]+[-| :]*)\\n", "(", "(?:[ ]*[|].*\\n?)*", ")", "(?:\\n|$)"].join(""), "gm"),
o = new RegExp(["^", "[ ]{0,3}", "(\\S.*[|].*)\\n", "[ ]{0,3}", "([-:]+[ ]*[|][-| :]*)\\n", "(", "(?:.*[|].*\\n?)*", ")", "(?:\\n|$)"].join(""), "gm");
return t = t.replace(r, n), t = t.replace(o, n)
}, Markdown.Extra.prototype.stripFootnoteDefinitions = function(e) {
var t = this;
return e = e.replace(/\n[ ]{0,3}\[\^(.+?)\]\:[ \t]*\n?([\s\S]*?)\n{1,2}((?=\n[ ]{0,3}\S)|$)/g, function(e, n, i) {
return n = f(n), i += "\n", i = i.replace(/^[ ]{0,3}/g, ""), t.footnotes[n] = i, "\n"
})
}, Markdown.Extra.prototype.doFootnotes = function(e) {
var t = this;
if(t.isConvertingFootnote === !0) return e;
var n = 0;
return e = e.replace(/\[\^(.+?)\]/g, function(e, i) {
var r = f(i),
o = t.footnotes[r];
if(void 0 === o) return e;
n++, t.usedFootnotes.push(r);
var a = '' + n + "";
return t.hashExtraInline(a)
})
}, Markdown.Extra.prototype.printFootnotes = function(e) {
var t = this;
if(0 === t.usedFootnotes.length) return e;
e += '\n\n
\n\n\n\n';
for(var n = 0; n < t.usedFootnotes.length; n++) {
var i = t.usedFootnotes[n],
r = t.footnotes[i];
t.isConvertingFootnote = !0;
var o = l(r, t);
delete t.isConvertingFootnote, e += '
"
}, Markdown.Extra.prototype.fencedCodeBlocks = function(e) {
function t(e) {
return e = e.replace(/&/g, "&"), e = e.replace(//g, ">"), e = e.replace(/~D/g, "$$"), e = e.replace(/~T/g, "~")
}
var n = this;
return e = e.replace(/(?:^|\n)```[ \t]*(\S*)[ \t]*\n([\s\S]*?)\n```[ \t]*(?=\n)/g, function(e, i, r) {
var o = i,
a = r,
s = n.googleCodePrettify ? ' class="prettyprint"' : "",
l = "";
o && (l = n.googleCodePrettify || n.highlightJs ? ' class="language-' + o + '"' : ' class="' + o + '"');
var c = ["
", t(a), "
"].join("");
return n.hashExtraBlock(c)
})
}, Markdown.Extra.prototype.educatePants = function(e) {
var t = this,
n = "",
i = 0;
e.replace(/(?:)|(<)([a-zA-Z1-6]+)([^\n]*?>)([\s\S]*?)(<\/\2>)/g, function(r, o, a, s, l, c, u) {
var d = e.substring(i, u);
return n += t.applyPants(d), t.smartyPantsLastChar = n.substring(n.length - 1), i = u + r.length, o ? (/code|kbd|pre|script|noscript|iframe|math|ins|del|pre/i.test(a) ? t.smartyPantsLastChar = l.substring(l.length - 1) : l = t.educatePants(l), void(n += o + a + s + l + c)) : void(n += r)
});
var r = e.substring(i);
return n += t.applyPants(r), t.smartyPantsLastChar = n.substring(n.length - 1), n
}, Markdown.Extra.prototype.applyPants = function(e) {
return e = e.replace(/---/g, "—").replace(/--/g, "–"), e = e.replace(/\.\.\./g, "…").replace(/\.\s\.\s\./g, "…"), e = e.replace(/``/g, "“").replace(/''/g, "”"), /^'$/.test(e) ? /\S/.test(this.smartyPantsLastChar) ? "’" : "‘" : /^"$/.test(e) ? /\S/.test(this.smartyPantsLastChar) ? "”" : "“" : (e = e.replace(/^'(?=[!"#\$\%'()*+,\-.\/:;<=>?\@\[\\]\^_`{|}~]\B)/, "’"), e = e.replace(/^"(?=[!"#\$\%'()*+,\-.\/:;<=>?\@\[\\]\^_`{|}~]\B)/, "”"), e = e.replace(/"'(?=\w)/g, "“‘"), e = e.replace(/'"(?=\w)/g, "‘“"), e = e.replace(/'(?=\d{2}s)/g, "’"), e = e.replace(/(\s| |--|&[mn]dash;|&\#8211;|&\#8212;|&\#x201[34];)'(?=\w)/g, "$1‘"), e = e.replace(/([^\s\[\{\(\-])'/g, "$1’"), e = e.replace(/'(?=\s|s\b)/g, "’"), e = e.replace(/'/g, "‘"), e = e.replace(/(\s| |--|&[mn]dash;|&\#8211;|&\#8212;|&\#x201[34];)"(?=\w)/g, "$1“"), e = e.replace(/([^\s\[\{\(\-])"/g, "$1”"), e = e.replace(/"(?=\s)/g, "”"), e = e.replace(/"/gi, "“"))
}, Markdown.Extra.prototype.runSmartyPants = function(e) {
return this.smartyPantsLastChar = "", e = this.educatePants(e), e = e.replace(/(<([a-zA-Z1-6]+)\b([^\n>]*?)(\/)?>)/g, h)
}, Markdown.Extra.prototype.definitionLists = function(t) {
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"),
i = this;
return t = a(t), t = t.replace(n, function(t, n, r) {
var o = e(i.processDefListItems(r));
return o = "
\n" + o + "\n
", n + i.hashExtraBlock(o) + "\n\n"
}), s(t)
}, Markdown.Extra.prototype.processDefListItems = function(i) {
var r = this,
o = new RegExp(["(\\x02\\n?|\\n\\n+)", "(", "[ ]{0,3}", "(?![:][ ]|[ ])", "(?:\\S.*\\n)+?", ")", "(?=\\n?[ ]{0,3}:[ ])"].join(""), "gm"),
u = new RegExp(["\\n(\\n+)?", "(", "[ ]{0,3}", "[:][ ]+", ")", "([\\s\\S]+?)", "(?=\\n*", "(?:", "\\n[ ]{0,3}[:][ ]|", "
|\\x03", ")", ")"].join(""), "gm");
return i = a(i), i = i.replace(/\n{2,}(?=\\x03)/, "\n"), i = i.replace(o, function(t, n, i) {
for(var o = e(i).split("\n"), a = "", s = 0; s < o.length; s++) {
var c = o[s];
c = l(e(c), r), a += "\n
" + c + "
"
}
return a + "\n"
}), i = i.replace(u, function(e, i, o, a) {
return i || a.match(/\n{2,}/) ? (a = Array(o.length + 1).join(" ") + a, a = n(a) + "\n\n", a = "\n" + c(a, r) + "\n") : (a = t(a), a = l(n(a), r)), "\n
Allows StackEdit to interpret LaTeX mathematical expressions.
\n
\n
\n \n
\n \n
\n
\n
\n \n
\n \n
\n
\n
\nMore info'
}), define("text!libs/mathjax_config.js", [], function() {
return 'MathJax.Hub.Config({\n "HTML-CSS": {\n preferredFont: "TeX",\n availableFonts: [\n "STIX",\n "TeX"\n ],\n linebreaks: {\n automatic: true\n },\n EqnChunk: 10,\n imageFont: null\n },\n tex2jax: <%= tex2jax || \'{ inlineMath: [["$","$"],["\\\\\\\\\\\\\\\\(","\\\\\\\\\\\\\\\\)"]], displayMath: [["$$","$$"],["\\\\\\\\[","\\\\\\\\]"]], processEscapes: true }\' %>,\n TeX: $.extend({\n noUndefined: {\n attributes: {\n mathcolor: "red",\n mathbackground: "#FFEEEE",\n mathsize: "90%"\n }\n },\n Safe: {\n allow: {\n URLs: "safe",\n classes: "safe",\n cssIDs: "safe",\n styles: "safe",\n fontsize: "all"\n }\n }\n }, <%= tex %>),\n messageStyle: "none"\n});\n'
}), define("libs/mathjax_init", ["settings", "text!libs/mathjax_config.js"], function(e, t) {
var n = document.createElement("script");
n.type = "text/x-mathjax-config", n.innerHTML = _.template(t, {
tex: e.extensionSettings.mathJax ? e.extensionSettings.mathJax.tex : "undefined",
tex2jax: e.extensionSettings.mathJax ? e.extensionSettings.mathJax.tex2jax : void 0
}), document.getElementsByTagName("head")[0].appendChild(n)
}), define("extensions/mathJax", ["utils", "classes/Extension", "text!html/mathJaxSettingsBlock.html", "mathjax"], function(e, t, n) {
function i(e, t, n) {
var i = u.slice(e, t + 1).join("").replace(/&/g, "&").replace(//g, ">");
for(x.Browser.isMSIE && (i = i.replace(/(%[^\n]*)\n/g, "$1 \n")); t > e;) u[t] = "", t--;
u[e] = "@@" + m.length + "@@", n && (i = n(i)), m.push(i), d = p = f = null
}
function r(e) {
d = p = f = null, m = [];
var t;
/`/.test(e) ? (e = e.replace(/~/g, "~T").replace(/(^|[^\\])(`+)([^\n]*?[^`\n])\2(?!`)/gm, function(e) {
return e.replace(/\$/g, "~D")
}), t = function(e) {
return e.replace(/~([TD])/g, function(e, t) {
return {
T: "~",
D: "$"
}[t]
})
}) : t = function(e) {
return e
}, u = w(e.replace(/\r\n?/g, "\n"), S);
for(var e = 1, n = u.length; n > e; e += 2) {
var r = u[e];
"@" === r.charAt(0) ? (u[e] = "@@" + m.length + "@@", m.push(r)) : d ? r === p ? h ? f = e : i(d, e, t) : r.match(/\n.*\n/) ? (f && (e = f, i(d, e, t)), d = p = f = null, h = 0) : "{" === r ? h++ : "}" === r && h && h-- : r === y || "$$" === r ? (d = e, p = r, h = 0) : "begin" === r.substr(1, 5) && (d = e, p = "\\end" + r.substr(6), h = 0)
}
return f && i(d, f, t), t(u.join(""))
}
function o(e) {
return e = e.replace(/@@(\d+)@@/g, function(e, t) {
return m[t]
}), m = null, e
}
function a() {
v = !1, x.cancelTypeset = !1, x.Queue(["Typeset", x, b]), x.Queue(c)
}
function s() {
!v && (v = !0, x.Cancel(), x.Queue(a))
}
var l = new t("mathJax", "MathJax", !0);
l.settingsBlock = n, l.defaultConfig = {
tex: "{}",
tex2jax: '{ inlineMath: [["$","$"],["\\\\\\\\(","\\\\\\\\)"]], displayMath: [["$$","$$"],["\\\\[","\\\\]"]], processEscapes: true }'
}, l.onLoadSettings = function() {
e.setInputValue("#input-mathjax-config-tex", l.config.tex), e.setInputValue("#input-mathjax-config-tex2jax", l.config.tex2jax)
}, l.onSaveSettings = function(t, n) {
t.tex = e.getInputJsValue("#input-mathjax-config-tex", n), t.tex2jax = e.getInputJsValue("#input-mathjax-config-tex2jax", n)
}, l.onPagedownConfigure = function(e) {
b = document.getElementById("preview-contents");
var t = e.getConverter();
t.hooks.chain("preConversion", r), t.hooks.chain("postConversion", o)
};
var c;
l.onAsyncPreview = function(e) {
c = e, s()
};
var u, d, p, f, h, m, g = !1,
v = !1,
b = null,
y = "$",
x = MathJax.Hub;
x.Queue(function() {
g = !0, x.processUpdateTime = 50, x.Config({
"HTML-CSS": {
EqnChunk: 10,
EqnChunkFactor: 1
},
SVG: {
EqnChunk: 10,
EqnChunkFactor: 1
}
})
});
var w, S = /(\$\$|\\(?:begin|end)\{[a-z]*\*?\}|\\[\\{}$]|[{}]|(?:\n\s*)+|@@\d+@@)/i;
return w = 3 === "aba".split(/(b)/).length ? function(e, t) {
return e.split(t)
} : function(e, t) {
var n, i = [];
if(!t.global) {
n = t.toString();
var r = "";
n = n.replace(/^\/(.*)\/([im]*)$/, function(e, t, n) {
return r = n, t
}), t = RegExp(n, r + "g")
}
for(var o = t.lastIndex = 0; n = t.exec(e);) i.push(e.substring(o, n.index)), i.push.apply(i, n.slice(1)), o = n.index + n[0].length;
return i.push(e.substring(o)), i
},
function() {
var e = MathJax.Hub;
if(!e.Cancel) {
e.cancelTypeset = !1, e.Register.StartupHook("HTML-CSS Jax Config", function() {
var t = MathJax.OutputJax["HTML-CSS"],
n = t.Translate;
t.Augment({
Translate: function(i, r) {
if(e.cancelTypeset || r.cancelled) throw Error("MathJax Canceled");
return n.call(t, i, r)
}
})
}), e.Register.StartupHook("SVG Jax Config", function() {
var t = MathJax.OutputJax.SVG,
n = t.Translate;
t.Augment({
Translate: function(i, r) {
if(e.cancelTypeset || r.cancelled) throw Error("MathJax Canceled");
return n.call(t, i, r)
}
})
}), e.Register.StartupHook("TeX Jax Config", function() {
var t = MathJax.InputJax.TeX,
n = t.Translate;
t.Augment({
Translate: function(i, r) {
if(e.cancelTypeset || r.cancelled) throw Error("MathJax Canceled");
return n.call(t, i, r)
}
})
});
var t = e.processError;
e.processError = function(n, i, r) {
return "MathJax Canceled" !== n.message ? t.call(e, n, i, r) : (MathJax.Message.Clear(0, 0), i.jaxIDs = [], i.jax = {}, i.scripts = [], i.i = i.j = 0, i.cancelled = !0, null)
}, e.Cancel = function() {
this.cancelTypeset = !0
}
}
}(), l
}), define("text!html/partialRenderingSettingsBlock.html", [], function() {
return "
Renders modified sections only.
\n
\n Note: Document sections are based on title elements (h1, h2...). Therefore if\n your document does not contain any title, performance will not be increased.\n
"
}), define("extensions/partialRendering", ["underscore", "crel", "extensions/markdownExtra", "classes/Extension", "text!html/partialRenderingSettingsBlock.html"], function(e, t, n, i, r) {
function o() {
var t = [],
n = "\n";
if(m = !1, e.each(g, function(e) {
var i = '\n\n\n' + e.text + "\n\n";
h && (i = i.replace(/^```.*\n[\s\S]*?\n```|\n[ ]{0,3}\[\^(.+?)\]\:[ \t]*\n?([\s\S]*?)\n{1,2}((?=\n[ ]{0,3}\S)|$)/gm, function(e, t) {
return t ? (m = !0, n += e.replace(/^\s*\n/gm, "") + "\n", "") : e
})), i = i.replace(/^```.*\n[\s\S]*?\n```|^[ ]{0,3}\[(.+)\]:[ \t]*\n?[ \t]*(\S+?)>?(?=\s|$)[ \t]*\n?[ \t]*((\n*)["(](.+?)[")][ \t]*)?(?:\n+)/gm, function(e, t) {
return t ? (n += e.replace(/^\s*\n/gm, "") + "\n", "") : e
}), t.push({
id: e.id,
text: i + "\n"
})
}), y = [], b = [], d = void 0, x === !0 || u != n) return x = !1, u = n, b = v, v = t, void(y = t);
var i = v.length;
e.some(v, function(e, n) {
return n >= t.length || e.text != t[n].text ? (i = n, !0) : void 0
});
var r = -v.length;
e.some(v.slice().reverse(), function(e, n) {
return n >= t.length || e.text != t[t.length - n - 1].text ? (r = -n, !0) : void 0
}), i - r > v.length && (r = i - v.length);
var o = v.slice(0, i);
y = t.slice(i, t.length + r);
var a = v.slice(v.length + r, v.length);
d = e.first(a), b = v.slice(i, v.length + r), v = o.concat(y).concat(a)
}
function a(e) {
var t = e.id.substring(3);
w[t] = e
}
function s() {
function n(n) {
for(var i = t("div", {
id: "wmd-preview-section-" + n.id,
"class": "wmd-preview-section preview-content"
}), o = !1; r;) {
var s = r.nextSibling,
l = "se-preview-section-delimiter" == r.className;
if(o === !0 && "DIV" == r.tagName && l) break;
o = !0, "DIV" == r.tagName && "footnotes" == r.className ? e.each(r.querySelectorAll("ol > li"), a) : l || i.appendChild(r), r = s
}
return i
}
e.each(b, function(e) {
var t = document.getElementById("wmd-preview-section-" + e.id);
f.removeChild(t)
});
var i = document.getElementById("wmd-preview"),
r = i.firstChild,
o = document.createDocumentFragment();
e.each(y, function(e) {
o.appendChild(n(e))
}), i.innerHTML = "";
var s = p;
void 0 !== d && (s = document.getElementById("wmd-preview-section-" + d.id)), f.insertBefore(o, s), p.innerHTML = "";
var l = [];
if(m === !0) {
var c = t("ol");
e.each(f.querySelectorAll("a.footnote"), function(e, t) {
e.textContent = t + 1;
var n = e.id.substring(6);
l.push(n), c.appendChild(w[n].cloneNode(!0))
}), l.length > 0 && p.appendChild(t("div", {
"class": "footnotes"
}, t("hr"), c)), w = e.pick(w, l)
}
}
var l = new i("partialRendering", "Partial Rendering", !0);
l.settingsBlock = r;
var c, u, d, p, f, h = !1,
m = !1,
g = [],
v = [],
b = [],
y = [],
x = !1,
w = {};
return l.onSectionsCreated = function(e) {
g = e
}, l.onPagedownConfigure = function(t) {
c = t.getConverter(), c.hooks.chain("preConversion", function() {
o();
var t = e.map(y, function(e) {
return e.text
});
return t.push(u + "\n\n"), t.join("")
}), t.hooks.chain("onPreviewRefresh", function() {
s()
})
}, l.onInit = function() {
n.enabled && e.some(n.config.extensions, function(e) {
return "footnotes" == e
}) && (h = !0)
}, l.onReady = function() {
p = t("div", {
id: "wmd-preview-section-footnotes",
"class": "preview-content"
}), f = document.getElementById("preview-contents"), f.appendChild(p)
}, l.onFileSelected = function() {
x = !0
}, l
}), define("extensions/markdownSectionParser", ["underscore", "extensions/markdownExtra", "extensions/mathJax", "extensions/partialRendering", "classes/Extension", "crel"], function(e, t, n, i, r, o) {
function a(e, t) {
function n(e, t) {
var n = o.substring(a, t);
u.push({
id: ++f,
text: n,
textWithFrontMatter: i + n
}), i = ""
}
if(e === p) {
var i = (p.frontMatter || {})._frontMatter || "",
r = t.substring(i.length),
o = r + "\n\n";
u = [];
var a = 0;
o.replace(d, function(e, t) {
n(a, t), a = t
}), n(a, r.length), s.onSectionsCreated(u)
}
}
var s, l = new r("markdownSectionParser", "Markdown section parser");
l.onEventMgrCreated = function(e) {
s = e
};
var c, u = [],
d = "^.+[ \\t]*\\n=+[ \\t]*\\n+|^.+[ \\t]*\\n-+[ \\t]*\\n+|^\\#{1,6}[ \\t]*.+?[ \\t]*\\#*\\n+";
l.onPagedownConfigure = function(r) {
t.enabled && e.some(t.config.extensions, function(e) {
return "fenced_code_gfm" == e
}) && (d = "^```.*\\n[\\s\\S]*?\\n```|" + d), n.enabled && (d = "^[ \\t]*\\n\\$\\$[\\s\\S]*?\\$\\$|" + d, d = "^[ \\t]*\\n\\\\\\\\[[\\s\\S]*?\\\\\\\\]|" + d, d = "^[ \\t]*\\n\\\\?\\\\begin\\{[a-z]*\\*?\\}[\\s\\S]*?\\\\end\\{[a-z]*\\*?\\}|" + d), d = new RegExp(d, "gm");
var a = r.getConverter();
i.enabled || (a.hooks.chain("preConversion", function() {
return e.reduce(u, function(e, t) {
return e + '\n\n\n' + t.text + "\n\n"
}, "")
}), r.hooks.chain("onPreviewRefresh", function() {
function e() {
for(var e = o("div", {
"class": "wmd-preview-section preview-content"
}), t = !1; n;) {
var i = n.nextSibling,
r = "se-preview-section-delimiter" == n.className;
if(t === !0 && "DIV" == n.tagName && r) break;
t = !0, r || e.appendChild(n), n = i
}
return e
}
var t = document.getElementById("wmd-preview"),
n = t.firstChild,
i = document.createDocumentFragment();
u.forEach(function(t) {
i.appendChild(e(t))
}), c.innerHTML = "", c.appendChild(t), c.appendChild(i)
}))
}, l.onReady = function() {
c = document.getElementById("preview-contents")
};
var p;
l.onFileSelected = function(e) {
p = e
};
var f = 0;
return l.onFileOpen = a, l.onContentChanged = a, l
}), define("text!html/buttonMarkdownSyntax.html", [], function() {
return '\n
\n
Markdown syntax
\n \n
\n
Phrase Emphasis
\n\n
*italic* **bold**\n_italic_ __bold__\n
\n\n
Links
\n\n
Inline:
\n\n
An [example](http://url.com/ "Title")\n
\n\n
Reference-style labels (titles are optional):
\n\n
An [example][id]. Then, anywhere\nelse in the doc, define the link:\n\n [id]: http://example.com/ "Title"\n
> Email-style angle brackets\n> are used for blockquotes.\n\n> > And, they can be nested.\n\n> #### Headers in blockquotes\n>\n> * You can quote a list.\n> * Etc.\n
\n\n
Code Spans
\n\n
`<code>` spans are delimited\nby backticks.\n\nYou can include literal backticks\nlike `` `this` ``.\n
\n\n
Preformatted Code Blocks
\n\n
Indent every line of a code block by at least 4 spaces or 1 tab.
\n\n
This is a normal paragraph.\n\n This is a preformatted\n code block.\n
\n'
}), define("extensions/buttonMarkdownSyntax", ["jquery", "classes/Extension", "text!html/buttonMarkdownSyntax.html"], function(e, t, n) {
var i = new t("buttonMarkdownSyntax", 'Button "Markdown syntax', !0, !0);
return i.settingsBlock = '
Adds a "Markdown syntax" button over the preview.
', i.onCreatePreviewButton = function() {
return n
}, i
}), define("extensions/googleAnalytics", ["jquery", "underscore", "constants", "utils", "classes/Extension", "settings"], function(e, t, n, i, r, o) {
function a() {
i.currentTime - d > 18e4 && (_gaq.push(["_trackPageview"]), d = i.currentTime)
}
var s = new r("googleAnalytics", "Google Analytics", !0);
s.settingsBlock = "
Sends anonymous statistics about usage and errors to help improve StackEdit.
";
var l = !1,
c = !1;
window._gaq = [];
var u = function() {
if(l === !1 && c === !1) {
var t = "/ga.js";
location.search.match(/(\?|&)console/) && (t = "/u/ga_debug.js"), e.ajax({
url: "https://ssl.google-analytics.com" + t,
dataType: "script"
}).done(function() {
l = !0
})
}
}, d = 0;
s.onPeriodicRun = function() {
a()
}, s.onReady = function() {
_gaq.push(["_setAccount", n.GOOGLE_ANALYTICS_ACCOUNT_ID]), a(), _gaq.push(["_trackEvent", "About", "version", n.VERSION]), _gaq.push(["_trackEvent", "Settings", "layoutOrientation", "" + o.layoutOrientation]), _gaq.push(["_trackEvent", "Settings", "theme", "" + window.theme]), _gaq.push(["_trackEvent", "Settings", "lazyRendering", "" + o.lazyRendering]), _gaq.push(["_trackEvent", "Settings", "editorFontFamily", "" + o.editorFontFamily]), _gaq.push(["_trackEvent", "Settings", "editorFontSize", "" + o.editorFontSize]), _gaq.push(["_trackEvent", "Settings", "defaultContent backlink", "" + (-1 !== o.defaultContent.indexOf(n.MAIN_URL))]), _gaq.push(["_trackEvent", "Settings", "commitMsg backlink", "" + (-1 !== o.commitMsg.indexOf(n.MAIN_URL))]), _gaq.push(["_trackEvent", "Settings", "sshProxy unchanged", "" + (o.sshProxy == n.SSH_PROXY_URL)]), t.each(o.extensionSettings, function(e, t) {
_gaq.push(["_trackEvent", "Extensions", t + " enabled", "" + (e.enabled === !0)])
}), window.onerror = function(e, t, n) {
_gaq.push(["_trackEvent", "Error", e, t + ":" + n + i.formatEventList()])
}, u()
}, s.onOfflineChanged = function(e) {
c = e, u()
};
var p = 0;
return s.onSyncRunning = function(e) {
e === !0 && (p = (new Date).getTime())
}, s.onPublishRunning = function(e) {
e === !0 && (p = (new Date).getTime())
}, s.onSyncSuccess = function() {
var e = (new Date).getTime();
_gaq.push(["_trackTiming", "Sync", "SyncTime", e - p])
}, s.onSyncImportSuccess = function(e, t) {
_gaq.push(["_trackEvent", "Sync", "SyncImport"]), _gaq.push(["_trackEvent", "Sync", "SyncImport provider", t.providerId])
}, s.onSyncExportSuccess = function(e, t) {
_gaq.push(["_trackEvent", "Sync", "SyncExport"]), _gaq.push(["_trackEvent", "Sync", "SyncExport provider", t.provider.providerId])
}, s.onPublishSuccess = function(e) {
var n = (new Date).getTime();
_gaq.push(["_trackTiming", "Publish", "PublishSuccess", n - p]), t.each(e.publishLocations, function(e) {
_gaq.push(["_trackEvent", "Publish", "PublishSuccess provider", e.provider.providerId])
})
}, s.onNewPublishSuccess = function(e, t) {
_gaq.push(["_trackEvent", "Publish", "NewPublish provider", t.provider.providerId])
}, s.onError = function(e) {
!t.isString(e) && e.message && _gaq.push(["_trackEvent", "Error", "message", e.message + i.formatEventList()])
}, s
}), define("extensions/twitter", ["jquery", "underscore", "constants", "utils", "classes/Extension"], function(e, t, n, i, r) {
var o = new r("twitter", "Twitter", !1, !0),
a = !1,
s = !1,
l = function() {
a === !1 && s === !1 && e.ajax({
url: "https://platform.twitter.com/widgets.js",
dataType: "script"
}).done(function() {
a = !0
})
};
return o.onReady = function() {
l()
}, o.onOfflineChanged = function(e) {
s = e, l()
}, o.onTweet = function() {
a && window.twttr.widgets.load()
}, o
}), define("text!html/dialogAbout.html", [], function() {
return '
\n'
}), define("extensions/dialogManagePublication", ["jquery", "underscore", "classes/Extension", "text!html/dialogManagePublicationLocation.html"], function(e, t, n, i) {
var r, o = new n("dialogManagePublication", 'Dialog "Manage publication"', !1, !0);
o.onEventMgrCreated = function(e) {
r = e
};
var a, s, l, c = function(e) {
if(void 0 === e || e === a) {
l.toggleClass("hide", 0 === t.size(a.publishLocations));
var n = t.reduce(a.publishLocations, function(e, n) {
var r = t.omit(n, "provider", "publishIndex", "sharingLink");
return r.password && (r.password = "********"), r = JSON.stringify(r).replace(/{|}|"/g, "").replace(/,/g, ", "), e + t.template(i, {
publishAttributes: n,
publishDesc: r
})
}, "");
s.innerHTML = n
}
};
return o.onFileSelected = function(e) {
a = e, c(e)
}, o.onNewPublishSuccess = c, o.onPublishRemoved = c, o.onReady = function() {
var t = document.querySelector(".modal-manage-publish");
s = t.querySelector(".publish-list"), l = e(document.querySelectorAll(".show-already-published")), e(s).on("click", ".remove-button", function() {
var t = e(this),
n = a.publishLocations[t.data("publishIndex")];
a.removePublishLocation(n), r.onPublishRemoved(a, n)
})
}, o
}), define("text!html/dialogManageSynchronizationLocation.html", [], function() {
return '
\n \n \n \n
\n \n
\n
\n'
}), define("extensions/dialogManageSynchronization", ["jquery", "underscore", "classes/Extension", "text!html/dialogManageSynchronizationLocation.html"], function(e, t, n, i) {
var r, o = new n("dialogManageSynchronization", 'Dialog "Manage synchronization"', !1, !0);
o.onEventMgrCreated = function(e) {
r = e
};
var a;
o.onSynchronizerCreated = function(e) {
a = e
};
var s, l, c, u = function(e) {
if(void 0 === e || e === s) {
c.toggleClass("hide", 0 === t.size(s.syncLocations));
var n = t.reduce(s.syncLocations, function(e, n) {
return e + t.template(i, {
syncAttributes: n,
syncDesc: n.id || n.path
})
}, "");
l.innerHTML = n
}
};
return o.onFileSelected = function(e) {
s = e, u(e)
}, o.onSyncExportSuccess = u, o.onSyncRemoved = u, o.onReady = function() {
var t = document.querySelector(".modal-manage-sync");
l = t.querySelector(".sync-list"), c = e(document.querySelectorAll(".show-already-synchronized")), e(l).on("click", ".remove-button", function() {
var t = e(this),
n = s.syncLocations[t.data("syncIndex")];
s.removeSyncLocation(n), r.onSyncRemoved(s, n)
})
}, o
}), define("text!html/dialogManageSharingLocation.html", [], function() {
return '
\n \n
\n
\n \n
\n'
}), define("extensions/dialogManageSharing", ["jquery", "underscore", "classes/Extension", "text!html/dialogManageSharingLocation.html"], function(e, t, n, i) {
var r, o = new n("dialogManageSharing", 'Button "Share"', !1, !0);
o.onEventMgrCreated = function(e) {
r = e
};
var a, s, l, c, u = function(e) {
if(void 0 === e || e === a) {
var n = t.reduce(a.publishLocations, function(e, n) {
return n.sharingLink && (e += t.template(i, {
link: n.sharingLink,
title: a.title
})), e
}, "");
s.innerHTML = n, r.onTweet(), l.toggleClass("hide", 0 === n.length), c.toggleClass("hide", 0 !== n.length)
}
};
return o.onFileSelected = function(e) {
a = e, u(e)
}, o.onNewPublishSuccess = function(t, n) {
u(t), n.sharingLink && (e(".modal").modal("hide"), e(".modal-manage-sharing").modal("show"))
}, o.onPublishRemoved = u, o.onReady = function() {
var t = document.querySelector(".modal-manage-sharing");
s = t.querySelector(".share-list"), l = e(t.querySelectorAll(".msg-share-list")), c = e(t.querySelectorAll(".msg-no-share"))
}, o
}), function() {
var e = this,
t = {}, n = !1;
"undefined" != typeof module && module.exports ? (module.exports = t, e.toMarkdown = t, n = !0) : e.toMarkdown = t, t.converter = function(e) {
e && e.elements && $.isArray(e.elements) && (c = c.concat(e.elements)), this.makeMd = function(e, t) {
var r;
if(n) {
var o = require("jsdom");
o.env({
html: e,
scripts: ["http://code.jquery.com/jquery-1.6.4.min.js"],
done: function(n, r) {
"function" == typeof t && t(i(e, r.$))
}
})
} else r = i(e, $);
return r
}
};
var i = function(e, t) {
e = e.replace(/(\d+)\. /g, "$1\\. ");
var n = t(""),
i = n.html(e);
i.find("*:not(pre, code)").contents().filter(function() {
return 3 === this.nodeType && /^\s+$/.test(this.nodeValue)
}).remove();
for(var r = [], o = 0, s = c.length; s > o; o++) r.push(c[o].selector);
for(r = r.join(","); i.find(r).length;)
for(var o = 0, s = c.length; s > o; o++) $matches = i.find(c[o].selector + ':not(:has("' + r + '"))'), $matches.each(function(e, n) {
var i = t(n);
i.before(c[o].replacement(i.html(), i)).remove()
});
return a(i.html())
}, r = function(e) {
return e.replace(/^[\n\r\f]+|[\n\r\f]+$/g, "")
}, o = function(e) {
return String(e).replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, '"')
}, a = function(e) {
return e = e.replace(/^[\t\r\n]+|[\t\r\n]+$/g, ""), e = e.replace(/\n\s+\n/g, "\n\n"), e = e.replace(/\n{3,}/g, "\n\n"), e = o(e)
}, s = function(e) {
return e = r(e), e ? "**" + e + "**" : ""
}, l = function(e) {
return e = r(e), e ? "_" + e + "_" : ""
}, c = [{
selector: "p",
replacement: function(e) {
return e = $.trim(e), e ? "\n\n" + e + "\n\n" : ""
}
}, {
selector: "br",
replacement: function() {
return "\n"
}
}, {
selector: "h1,h2,h3,h4,h5,h6",
replacement: function(e, t) {
e = $.trim(e);
for(var n = t.prop("nodeName").charAt(1), i = "", r = 0; n > r; r++) i += "#";
return e ? "\n\n" + i + " " + e + "\n\n" : ""
}
}, {
selector: "hr",
replacement: function() {
return "\n\n* * *\n\n"
}
}, {
selector: "a[href]",
replacement: function(e, t) {
if(e) {
e = r(e);
var n = t.attr("href"),
i = t.attr("title") || "";
return "[" + e + "](" + n + (i ? ' "' + i + '"' : "") + ")"
}
return !1
}
}, {
selector: "b",
replacement: s
}, {
selector: "strong",
replacement: s
}, {
selector: "i",
replacement: l
}, {
selector: "em",
replacement: l
}, {
selector: "code",
replacement: function(e) {
return e = r(e), e ? "`" + e + "`" : ""
}
}, {
selector: "img",
replacement: function(e, t) {
var n = t.attr("alt") || "",
i = t.attr("src") || "",
r = t.attr("title") || "";
return "![" + n + "](" + i + (r ? ' "' + r + '"' : "") + ")"
}
}, {
selector: "pre",
replacement: function(e) {
return /^\s*\`/.test(e) ? (e = e.replace(/\`/g, ""), " " + e.replace(/\n/g, "\n ")) : ""
}
}, {
selector: "li",
replacement: function(e, t) {
e = e.replace(/^\s+|\s+$/, "").replace(/\n/gm, "\n ");
var n = "* ",
i = "",
r = t.parent(),
o = r.contents().filter(function() {
return 1 === this.nodeType && "LI" === this.nodeName || 3 === this.nodeType
}),
a = o.index(t) + 1;
return n = r.is("ol") ? a + ". " : "* ", a == o.length && (t.parents("li").length || (i = "\n"), e = e.replace(/\s+$/, ""), t.unwrap()), n + e + i + "\n"
}
}, {
selector: "blockquote",
replacement: function(e) {
return e = e = $.trim(e).replace(/\n{3,}/g, "\n\n"), e = e.replace(/\n/g, "\n> "), "> " + e
}
}]
}(), define("toMarkdown", ["jquery"], function(e) {
return function() {
var t;
return t || e.toMarkdown
}
}(this)), define("extensions/dialogOpenHarddrive", ["jquery", "underscore", "constants", "utils", "classes/Extension", "toMarkdown"], function(e, t, n, i, r, o) {
function a(i) {
i.stopPropagation(), i.preventDefault();
var r = (i.dataTransfer || i.target).files;
e(".modal-import-harddrive-markdown, .modal-import-harddrive-html").modal("hide"), t.each(r, function(t) {
if(!e(i.target).is("#wmd-input *") || !t.name.match(/.(jpe?g|png|gif)$/i)) {
var r = new FileReader;
r.onload = function(e) {
return function(t) {
var n = t.target.result;
if(n.match(/\uFFFD/)) return void p.onError(e.name + " is a binary file.");
if(n = f ? f(n) : n, void 0 === n) return void p.onError(e.name + " is not a valid HTML file.");
var i = e.name,
r = i.lastIndexOf(".");
i = -1 !== r ? i.substring(0, r) : i;
var o = u.createFile(i, n);
u.selectFile(o)
}
}(t);
var o = t.slice(0, n.IMPORT_FILE_MAX_CONTENT_SIZE);
r.readAsText(o)
}
})
}
function s(e) {
f = void 0, a(e)
}
function l(e) {
f = m, a(e)
}
function c(e) {
e.stopPropagation(), e.preventDefault(), e.dataTransfer.dropEffect = "copy"
}
var u, d = new r("dialogOpenHarddrive", 'Dialog "Open from"');
d.onFileMgrCreated = function(e) {
u = e
};
var p;
d.onEventMgrCreated = function(e) {
p = e
};
var f, h, m = function(e) {
return h.makeMd(e)
};
return d.onReady = function() {
h = new o.converter, e("#input-file-import-harddrive-markdown").change(s), e("#dropzone-import-harddrive-markdown, #wmd-input").each(function() {
this.addEventListener("dragover", c, !1), this.addEventListener("drop", s, !1)
}), e("#input-file-import-harddrive-html").change(l), e("#dropzone-import-harddrive-html").each(function() {
this.addEventListener("dragover", c, !1), this.addEventListener("drop", l, !1)
}), e(".action-convert-html").click(function(e) {
var t = i.getInputTextValue("#input-convert-html", e);
if(void 0 !== t) {
if(t = h.makeMd(t), void 0 === t) return void p.onError("Invalid HTML code.");
var n = u.createFile(void 0, t);
u.selectFile(n)
}
})
}, d
}), define("extensions/documentTitle", ["jquery", "underscore", "classes/Extension"], function(e, t, n) {
var i, r, o = new n("documentTitle", "Document Title"),
a = t.debounce(function(t) {
if(t === i) {
var n = i.title;
document.title = "StackEdit – " + n, r.html(i.composeTitle()), e(".file-title").text(n), e(".input-file-title").val(n)
}
}, 50);
return o.onFileSelected = function(e) {
i = e, a(e)
}, o.onTitleChanged = a, o.onSyncExportSuccess = a, o.onSyncRemoved = a, o.onNewPublishSuccess = a, o.onPublishRemoved = a, o.onReady = a, o.onReady = function() {
r = e(".file-title-navbar"), r.hover(function() {
var e = r[0].scrollWidth - r.outerWidth();
r.stop(!0, !0).animate({
scrollLeft: e
}, 15 * e, "linear")
}, function() {
r.stop(!0, !0).scrollLeft(0)
}).click(function() {
r.stop(!0, !0).scrollLeft(0)
})
}, o
}), function(e, t) {
function n(e, t, n) {
return e.addEventListener ? void e.addEventListener(t, n, !1) : void e.attachEvent("on" + t, n)
}
function i(e) {
if("keypress" == e.type) {
var t = String.fromCharCode(e.which);
return e.shiftKey || (t = t.toLowerCase()), t
}
return T[e.which] ? T[e.which] : E[e.which] ? E[e.which] : String.fromCharCode(e.which).toLowerCase()
}
function r(e, t) {
return e.sort().join(",") === t.sort().join(",")
}
function o(e) {
e = e || {};
var t, n = !1;
for(t in N) e[t] ? n = !0 : N[t] = 0;
n || (A = !1)
}
function a(e, t, n, i, o, a) {
var s, l, c = [],
u = n.type;
if(!I[e]) return [];
for("keyup" == u && f(e) && (t = [e]), s = 0; s < I[e].length; ++s)
if(l = I[e][s], (i || !l.seq || N[l.seq] == l.level) && u == l.action && ("keypress" == u && !n.metaKey && !n.ctrlKey || r(t, l.modifiers))) {
var d = !i && l.combo == o,
p = i && l.seq == i && l.level == a;
(d || p) && I[e].splice(s, 1), c.push(l)
}
return c
}
function s(e) {
var t = [];
return e.shiftKey && t.push("shift"), e.altKey && t.push("alt"), e.ctrlKey && t.push("ctrl"), e.metaKey && t.push("meta"), t
}
function l(e) {
return e.preventDefault ? void e.preventDefault() : void(e.returnValue = !1)
}
function c(e) {
return e.stopPropagation ? void e.stopPropagation() : void(e.cancelBubble = !0)
}
function u(e, t, n, i) {
P.stopCallback(t, t.target || t.srcElement, n, i) || e(t, n) === !1 && (l(t), c(t))
}
function d(e, t, n) {
var i, r = a(e, t, n),
s = {}, l = 0,
c = !1;
for(i = 0; i < r.length; ++i) r[i].seq && (l = Math.max(l, r[i].level));
for(i = 0; i < r.length; ++i)
if(r[i].seq) {
if(r[i].level != l) continue;
c = !0, s[r[i].seq] = 1, u(r[i].callback, n, r[i].combo, r[i].seq)
} else c || u(r[i].callback, n, r[i].combo);
var d = "keypress" == n.type && M;
n.type != A || f(e) || d || o(s), M = c && "keydown" == n.type
}
function p(e) {
"number" != typeof e.which && (e.which = e.keyCode);
var t = i(e);
if(t) return "keyup" == e.type && L === t ? void(L = !1) : void P.handleKey(t, s(e), e)
}
function f(e) {
return "shift" == e || "ctrl" == e || "alt" == e || "meta" == e
}
function h() {
clearTimeout(C), C = setTimeout(o, 1e3)
}
function m() {
if(!S) {
S = {};
for(var e in T) e > 95 && 112 > e || T.hasOwnProperty(e) && (S[T[e]] = e)
}
return S
}
function g(e, t, n) {
return n || (n = m()[e] ? "keydown" : "keypress"), "keypress" == n && t.length && (n = "keydown"), n
}
function v(e, t, n, r) {
function a(t) {
return function() {
A = t, ++N[e], h()
}
}
function s(t) {
u(n, t, e), "keyup" !== r && (L = i(t)), setTimeout(o, 10)
}
N[e] = 0;
for(var l = 0; l < t.length; ++l) {
var c = l + 1 === t.length,
d = c ? s : a(r || y(t[l + 1]).action);
x(t[l], d, r, e, l)
}
}
function b(e) {
return "+" === e ? ["+"] : e.split("+")
}
function y(e, t) {
var n, i, r, o = [];
for(n = b(e), r = 0; r < n.length; ++r) i = n[r], _[i] && (i = _[i]), t && "keypress" != t && k[i] && (i = k[i], o.push("shift")), f(i) && o.push(i);
return t = g(i, o, t), {
key: i,
modifiers: o,
action: t
}
}
function x(e, t, n, i, r) {
D[e + ":" + n] = t, e = e.replace(/\s+/g, " ");
var o, s = e.split(" ");
return s.length > 1 ? void v(e, s, t, n) : (o = y(e, n), I[o.key] = I[o.key] || [], a(o.key, o.modifiers, {
type: o.action
}, i, e, r), void I[o.key][i ? "unshift" : "push"]({
callback: t,
modifiers: o.modifiers,
action: o.action,
seq: i,
level: r,
combo: e
}))
}
function w(e, t, n) {
for(var i = 0; i < e.length; ++i) x(e[i], t, n)
}
for(var S, C, T = {
8: "backspace",
9: "tab",
13: "enter",
16: "shift",
17: "ctrl",
18: "alt",
20: "capslock",
27: "esc",
32: "space",
33: "pageup",
34: "pagedown",
35: "end",
36: "home",
37: "left",
38: "up",
39: "right",
40: "down",
45: "ins",
46: "del",
91: "meta",
93: "meta",
224: "meta"
}, E = {
106: "*",
107: "+",
109: "-",
110: ".",
111: "/",
186: ";",
187: "=",
188: ",",
189: "-",
190: ".",
191: "/",
192: "`",
219: "[",
220: "\\",
221: "]",
222: "'"
}, k = {
"~": "`",
"!": "1",
"@": "2",
"#": "3",
$: "4",
"%": "5",
"^": "6",
"&": "7",
"*": "8",
"(": "9",
")": "0",
_: "-",
"+": "=",
":": ";",
'"': "'",
"<": ",",
">": ".",
"?": "/",
"|": "\\"
}, _ = {
option: "alt",
command: "meta",
"return": "enter",
escape: "esc",
mod: /Mac|iPod|iPhone|iPad/.test(navigator.platform) ? "meta" : "ctrl"
}, I = {}, D = {}, N = {}, L = !1, M = !1, A = !1, R = 1; 20 > R; ++R) T[111 + R] = "f" + R;
for(R = 0; 9 >= R; ++R) T[R + 96] = R;
n(t, "keypress", p), n(t, "keydown", p), n(t, "keyup", p);
var P = {
bind: function(e, t, n) {
return e = e instanceof Array ? e : [e], w(e, t, n), this
},
unbind: function(e, t) {
return P.bind(e, function() {}, t)
},
trigger: function(e, t) {
return D[e + ":" + t] && D[e + ":" + t]({}, e), this
},
reset: function() {
return I = {}, D = {}, this
},
stopCallback: function(e, t) {
return(" " + t.className + " ").indexOf(" mousetrap ") > -1 ? !1 : "INPUT" == t.tagName || "SELECT" == t.tagName || "TEXTAREA" == t.tagName || t.isContentEditable
},
handleKey: d
};
e.Mousetrap = P, "function" == typeof define && define.amd && define("mousetrap", P)
}(window, document), define("classes/FileDescriptor", ["underscore", "utils", "storage"], function(e, t, n) {
function i(e, t, i, r) {
this.fileIndex = e, this._title = t || n[e + ".title"], this._editorScrollTop = parseInt(n[e + ".editorScrollTop"]) || 0, this._editorStart = parseInt(n[e + ".editorEnd"]) || 0, this._editorEnd = parseInt(n[e + ".editorEnd"]) || 0, this._previewScrollTop = parseInt(n[e + ".previewScrollTop"]) || 0, this._selectTime = parseInt(n[e + ".selectTime"]) || 0, this._discussionList = JSON.parse(n[e + ".discussionList"] || "{}"), this.syncLocations = i || {}, this.publishLocations = r || {}, Object.defineProperty(this, "title", {
get: function() {
return this._title
},
set: function(e) {
this._title = e, n[this.fileIndex + ".title"] = e
}
}), Object.defineProperty(this, "content", {
get: function() {
return n[this.fileIndex + ".content"]
},
set: function(e) {
n[this.fileIndex + ".content"] = e
}
}), Object.defineProperty(this, "editorScrollTop", {
get: function() {
return this._editorScrollTop
},
set: function(e) {
this._editorScrollTop = e, n[this.fileIndex + ".editorScrollTop"] = e
}
}), Object.defineProperty(this, "editorStart", {
get: function() {
return this._editorStart
},
set: function(e) {
this._editorStart = e, n[this.fileIndex + ".editorStart"] = e
}
}), Object.defineProperty(this, "editorEnd", {
get: function() {
return this._editorEnd
},
set: function(e) {
this._editorEnd = e, n[this.fileIndex + ".editorEnd"] = e
}
}), Object.defineProperty(this, "previewScrollTop", {
get: function() {
return this._previewScrollTop
},
set: function(e) {
this._previewScrollTop = e, n[this.fileIndex + ".previewScrollTop"] = e
}
}), Object.defineProperty(this, "selectTime", {
get: function() {
return this._selectTime
},
set: function(e) {
this._selectTime = e, n[this.fileIndex + ".selectTime"] = e
}
}), Object.defineProperty(this, "discussionList", {
get: function() {
return this._discussionList
},
set: function(e) {
this._discussionList = e, n[this.fileIndex + ".discussionList"] = JSON.stringify(e)
}
}), Object.defineProperty(this, "discussionListJSON", {
get: function() {
return n[this.fileIndex + ".discussionList"] || "{}"
},
set: function(e) {
this._discussionList = JSON.parse(e), n[this.fileIndex + ".discussionList"] = e
}
})
}
return i.prototype.addSyncLocation = function(e) {
t.storeAttributes(e), t.appendIndexToArray(this.fileIndex + ".sync", e.syncIndex), this.syncLocations[e.syncIndex] = e
}, i.prototype.removeSyncLocation = function(e) {
t.removeIndexFromArray(this.fileIndex + ".sync", e.syncIndex), delete this.syncLocations[e.syncIndex]
}, i.prototype.addPublishLocation = function(e) {
t.storeAttributes(e), t.appendIndexToArray(this.fileIndex + ".publish", e.publishIndex), this.publishLocations[e.publishIndex] = e
}, i.prototype.removePublishLocation = function(e) {
t.removeIndexFromArray(this.fileIndex + ".publish", e.publishIndex), delete this.publishLocations[e.publishIndex]
}, i.prototype.composeTitle = function() {
var t = [];
return e.chain(this.syncLocations).sortBy(function(e) {
return e.provider.providerId
}).each(function(e) {
t.push('')
}), 0 !== e.size(this.syncLocations) && t.push(''), e.chain(this.publishLocations).sortBy(function(e) {
return e.provider.providerId
}).each(function(e) {
t.push('')
}), 0 !== e.size(this.publishLocations) && t.push(''), t.push(e.escape(this.title)), t.join("")
}, i
}), define("fileSystem", ["underscore", "utils", "classes/FileDescriptor", "storage"], function(e, t, n, i) {
var r = {};
return t.retrieveIndexArray("file.list").forEach(function(e) {
r[e] = new n(e)
}), Object.keys(i).forEach(function(e) {
var t = e.match(/(file\.\S+?)\.\S+/);
t && !r.hasOwnProperty(t[1]) && i.removeItem(e)
}), r
}), define("text!html/documentSelectorSettingsBlock.html", [], function() {
return '
Allows toggling document with keyboard shortcuts.
\n
\n
\n \n
\n \n
\n
\n
\n \n
\n \n
\n
\n
\n \n
\n \n
\n
\n
'
}), define("extensions/documentSelector", ["jquery", "underscore", "crel", "utils", "classes/Extension", "mousetrap", "fileSystem", "text!html/documentSelectorSettingsBlock.html"], function(e, t, n, i, r, o, a, s) {
var l = new r("documentSelector", "Document Selector", !0);
l.settingsBlock = s, l.defaultConfig = {
orderBy: "mru",
shortcutPrevious: "Ctrl+[",
shortcutNext: "Ctrl+]"
}, l.onLoadSettings = function() {
i.setInputValue("#select-document-selector-orderby", l.config.orderBy), i.setInputValue("#input-document-selector-shortcut-previous", l.config.shortcutPrevious), i.setInputValue("#input-document-selector-shortcut-next", l.config.shortcutNext)
}, l.onSaveSettings = function(e, t) {
e.orderBy = i.getInputValue("#select-document-selector-orderby"), e.shortcutPrevious = i.getInputTextValue("#input-document-selector-shortcut-previous", t), e.shortcutNext = i.getInputTextValue("#input-document-selector-shortcut-next", t)
};
var c;
l.onFileMgrCreated = function(e) {
c = e
};
var u, d, p, f, h, m, g, v = ['
"].join(""),
n = t.chain(w).sortBy(function(e) {
return e.title.toLowerCase()
}).reduce(function(e, n) {
return e + t.template(E, {
fileDesc: n
})
}, "").value();
n = n && '
' + n + "
", e += '
' + n + "
", t.chain(s).sortBy(function(e) {
return e.name.toLowerCase()
}).each(function(n) {
var i = t.chain(n.fileList).sortBy(function(e) {
return e.title.toLowerCase()
}).reduce(function(e, n) {
return e + t.template(E, {
fileDesc: n
})
}, "").value();
i = i && '
' + i + "
", e += t.template(T, {
folderDesc: n,
fileListHtml: i,
id: n.folderIndex.replace(".", "")
})
}), v.innerHTML = e
}
}, 50);
return f.onFileCreated = L, f.onFileDeleted = L, f.onSyncExportSuccess = L, f.onSyncRemoved = L, f.onNewPublishSuccess = L, f.onPublishRemoved = L, f.onFoldersChanged = L, f.onTitleChanged = function(t) {
m !== !1 && (e(v).find('[data-file-index="' + t.fileIndex + '"] .name').html(t.composeTitle()).removeClass("hide"), e(v.querySelectorAll(".input-rename")).addClass("hide"))
}, f.onReady = function() {
g = document.querySelector(".modal-document-manager"), v = g.querySelector(".list-group.document-list"), S = e(g.querySelectorAll(".document-count")), C = e(g.querySelectorAll(".folder-count")), b = g.querySelector(".list-group.selected-document-list");
var o = g.querySelector(".list-group.select-folder-list");
e(g).on("show.bs.modal", function() {
m = !0, L(), setTimeout(function() {
e(v.querySelectorAll(".root-folder")).click()
}, 250)
}).on("hide.bs.modal", function() {
m = !1, v.innerHTML = ""
}), e(g.querySelectorAll(".action-create-folder")).click(function() {
var o;
do o = "folder." + i.randomString(); while (t.has(s, o));
r[o + ".name"] = n.DEFAULT_FOLDER_NAME;
var l = new a(o, n.DEFAULT_FOLDER_NAME);
i.appendIndexToArray("folder.list", o), s[o] = l, h.onFoldersChanged(), setTimeout(function() {
var t = e(g.querySelector('[data-folder-index="' + o + '"] .button-rename')).click();
g.scrollTop += t.offset().top - 50
}, 60)
}), e(g.querySelectorAll(".action-select-all")).click(function() {
e(v.querySelectorAll('input[type="checkbox"]')).prop("checked", !0).change()
}), e(g.querySelectorAll(".action-unselect-all")).click(function() {
e(v.querySelectorAll('input[type="checkbox"]')).prop("checked", !1).change()
});
var p = e(g.querySelectorAll(".action-delete-items")).click(function() {
x.hasClass("disabled") || (c(), u())
});
x = p.parent(), e(g.querySelectorAll(".action-delete-items-confirm")).click(function() {
d(), e(g.querySelectorAll(".document-list")).removeClass("hide"), e(g.querySelectorAll(".confirm-delete, .selected-document-list")).addClass("hide")
});
var f = e(g.querySelectorAll(".action-move-items")).click(function() {
if(!y.hasClass("disabled")) {
c();
var n = ['', '
Generates a table of contents when a [TOC] marker is found.
\n
\n
\n \n
\n \n \n
\n
\n
\n \n
\n \n
\n
\n
\n \n
\n
\n \n
\n
\n
\n \n
'
}), define("extensions/toc", ["jquery", "underscore", "utils", "classes/Extension", "text!html/buttonToc.html", "text!html/tocSettingsBlock.html"], function(e, t, n, i, r, o) {
function a(e, t, n) {
this.tagName = e, this.anchor = t, this.text = n, this.children = []
}
function s(e, n) {
function i() {
void 0 !== r && (r.children.length > 0 && (r.children = s(r.children, n + 1)), l.push(r))
}
n = n || 1;
var r, o = "H" + n,
l = [];
return t.each(e, function(e) {
e.tagName != o ? n !== c.config.maxDepth && (void 0 === r && (r = new a), r.children.push(e)) : (i(), r = e)
}), i(), l
}
function l() {
function e(e) {
for(var r = e.id || n.slugify(e.textContent) || "title", o = r, a = 0; t.has(i, o);) o = r + "-" + ++a;
return i[o] = !0, e.id = o, o
}
var i = {}, r = [];
return t.each(u.querySelectorAll("h1, h2, h3, h4, h5, h6"), function(t) {
r.push(new a(t.tagName, e(t), t.textContent))
}), r = s(r), '
\n
\n' + r.join("") + "
\n
\n"
}
var c = new i("toc", "Table of Contents", !0);
c.settingsBlock = o, c.defaultConfig = {
marker: "\\[(TOC|toc)\\]",
maxDepth: 6,
button: !0
}, c.onLoadSettings = function() {
n.setInputValue("#input-toc-marker", c.config.marker), n.setInputValue("#input-toc-maxdepth", c.config.maxDepth), n.setInputChecked("#input-toc-button", c.config.button)
}, c.onSaveSettings = function(e, t) {
e.marker = n.getInputRegExpValue("#input-toc-marker", t), e.maxDepth = n.getInputIntValue("#input-toc-maxdepth"), e.button = n.getInputChecked("#input-toc-button")
}, c.onCreatePreviewButton = function() {
return c.config.button ? r : void 0
}, a.prototype.childrenToString = function() {
if(0 === this.children.length) return "";
var e = "
\n";
return t.each(this.children, function(t) {
e += t.toString()
}), e += "
\n"
}, a.prototype.toString = function() {
var e = "
";
return this.anchor && this.text && (e += '' + this.text + ""), e += this.childrenToString() + "
\n"
};
var u;
return c.onPagedownConfigure = function(e) {
u = document.getElementById("preview-contents");
var n = new RegExp("^\\s*" + c.config.marker + "\\s*$");
e.hooks.chain("onPreviewRefresh", function() {
var e = document.querySelectorAll(".table-of-contents, .toc"),
i = l();
t.each(u.getElementsByTagName("p"), function(e) {
n.test(e.innerHTML) && (e.innerHTML = i)
}), t.each(e, function(e) {
e.innerHTML = i
})
})
}, c.onReady = function() {
var t = !0;
e(".preview-panel").on("hide.layout.toggle", function() {
t = !1
}).on("shown.layout.toggle", function() {
t = !0
}), e(".extension-preview-buttons .table-of-contents").on("click", "a", function(e) {
!t && e.preventDefault()
})
}, c
}), define("extensions/emailConverter", ["classes/Extension"], function(e) {
var t = new e("emailConverter", "Markdown Email", !0);
return t.settingsBlock = "
Converts email adresses in the form <email@example.com> into clickable links.
\n Note: The mapping between Markdown and HTML is based on the\n position of the title elements (h1, h2...) in the page. Therefore if\n your document does not contain any title, the mapping will be linear and\n consequently less accurate.\n
"
}), define("extensions/scrollSync", ["jquery", "underscore", "classes/Extension", "text!html/scrollSyncSettingsBlock.html"], function(e, t, n, i) {
function r(e, n, i) {
var r, o = t.find(n, function(t, n) {
return r = n, e < t.endOffset
});
if(void 0 !== o) {
var a = (e - o.startOffset) / (o.height || 1),
s = i[r];
return s.startOffset + s.height * a
}
}
var o = new n("scrollSync", "Scroll Sync", !0, !0);
o.settingsBlock = i, e.easing.easeOutSine = function(e) {
return Math.cos((1 - e) * Math.PI / 2)
};
var a;
o.onSectionsCreated = function(e) {
a = e
};
var s, l, c, u, d = [],
p = [],
f = t.debounce(function() {
d = [];
var t, n, i = s.scrollTop();
s.find(".wmd-input-section").each(function() {
if(void 0 === t) return void(t = 0);
var n = e(this.firstChild),
r = n.position().top + i;
d.push({
startOffset: t,
endOffset: r,
height: r - t
}), t = r
}), n = s.prop("scrollHeight"), d.push({
startOffset: t,
endOffset: n,
height: n - t
}), p = [];
var r, o = l.scrollTop();
l.find(".wmd-preview-section").each(function() {
if(void 0 === r) return void(r = 0);
var t = e(this),
n = t.position().top + o;
p.push({
startOffset: r,
endOffset: n,
height: n - r
}), r = n
}), n = l.prop("scrollHeight"), p.push({
startOffset: r,
endOffset: n,
height: n - r
}), c = -10, u = -10, x()
}, 500),
h = !0,
m = !1,
g = !1,
v = !1,
b = !1,
y = e("
"),
x = t.throttle(function() {
if(h && 0 !== d.length && d.length === p.length) {
var e = s.scrollTop();
0 > e && (e = 0);
var n, i = l.scrollTop();
if(m === !0) {
if(Math.abs(e - c) <= 9) return;
if(m = !1, c = e, n = r(e, d, p), n = t.min([n, l.prop("scrollHeight") - l.outerHeight()]), Math.abs(n - i) <= 9) return void(u = i);
y.stop("scrollSyncFx", !0).css("value", 0).animate({
value: n - i
}, {
easing: "easeOutSine",
duration: 200,
queue: "scrollSyncFx",
step: function(e) {
b = !0, u = i + e, l.scrollTop(u)
},
done: function() {
setTimeout(function() {
b = !1
}, 10)
}
}).dequeue("scrollSyncFx")
} else if(g === !0) {
if(Math.abs(i - u) <= 9) return;
if(g = !1, u = i, n = r(i, p, d), n = t.min([n, s.prop("scrollHeight") - s.outerHeight()]), Math.abs(n - e) <= 9) return void(c = e);
y.stop("scrollSyncFx", !0).css("value", 0).animate({
value: n - e
}, {
easing: "easeOutSine",
duration: 200,
queue: "scrollSyncFx",
step: function(t) {
v = !0, c = e + t, s.scrollTop(c)
},
done: function() {
setTimeout(function() {
v = !1
}, 10)
}
}).dequeue("scrollSyncFx")
}
}
}, 100);
o.onLayoutResize = function() {
m = !0, f()
}, o.onFileClosed = function() {
d = []
};
var w = !1;
o.onReady = function() {
l = e(".preview-container"), s = e("#wmd-input"), l.scroll(function() {
b === !1 && w === !1 && (g = !0, m = !1, x()), w = !1
}), s.scroll(function() {
v === !1 && (m = !0, g = !1, x())
}), e(".preview-panel").on("hide.layout.toggle", function() {
h = !1
}).on("shown.layout.toggle", function() {
h = !0
}), e(".extension-preview-buttons .table-of-contents").on("click", "a", function(e) {
e.preventDefault();
var t = this.hash,
n = l.find(t);
if(n.length) {
var i = n.offset().top - l.offset().top + l.scrollTop();
l.scrollTop(i);
var o = r(i, p, d);
s.scrollTop(o)
}
})
};
var S;
return o.onPagedownConfigure = function(t) {
S = e("#preview-contents"), t.getConverter().hooks.chain("postConversion", function(e) {
return S.height(S.height()), e
})
}, o.onPreviewFinished = function() {
var e = S.height();
S.height("auto");
var t = S.height();
m = !0, e > t && (w = !0), f()
}, o
}), define("text!html/buttonSyncSettingsBlock.html", [], function() {
return '
Adds a "Synchronize documents" button in the navigation bar.
\n
\n
\n \n
\n ms\n
\n
\n
\n \n
\n \n
\n
\n
'
}), define("extensions/buttonSync", ["jquery", "underscore", "crel", "utils", "classes/Extension", "mousetrap", "text!html/buttonSyncSettingsBlock.html"], function(e, t, n, i, r, o, a) {
var s = new r("buttonSync", 'Button "Synchronize"', !1, !0);
s.settingsBlock = a, s.defaultConfig = {
syncPeriod: 18e4,
syncShortcut: "mod+s"
}, s.onLoadSettings = function() {
i.setInputValue("#input-sync-period", s.config.syncPeriod), i.setInputValue("#input-sync-shortcut", s.config.syncShortcut)
}, s.onSaveSettings = function(e, t) {
e.syncPeriod = i.getInputIntValue("#input-sync-period", t, 0), e.syncShortcut = i.getInputTextValue("#input-sync-shortcut", t)
};
var l;
s.onSynchronizerCreated = function(e) {
l = e
};
var c, u = !1,
d = !1,
p = function() {
void 0 !== c && (u === !0 || l.hasSync() === !1 || d ? c.addClass("disabled") : c.removeClass("disabled"))
}, f = 0;
return s.onPeriodicRun = function() {
!s.config.syncPeriod || f + s.config.syncPeriod > i.currentTime || l.sync() && (f = i.currentTime)
}, s.onCreateButton = function() {
var t = n("a", {
"class": "btn btn-success button-synchronize",
title: "Force synchronization Ctrl/Cmd+S"
}, n("i", {
"class": "icon-refresh"
}));
return c = e(t), c.click(function() {
c.hasClass("disabled") || l.sync() && (f = i.currentTime)
}), t
}, s.onReady = p, s.onFileCreated = p, s.onFileDeleted = p, s.onSyncImportSuccess = p, s.onSyncExportSuccess = p, s.onSyncRemoved = p, s.onSyncRunning = function(e) {
u = e, p()
}, s.onOfflineChanged = function(e) {
d = e, p()
}, s.onReady = function() {
o.bind(s.config.syncShortcut, function(e) {
l.sync() && (f = i.currentTime), e.preventDefault()
}), e(".action-force-synchronization").click(function() {
l.sync() && (f = i.currentTime)
})
}, s
}), define("extensions/buttonPublish", ["jquery", "underscore", "crel", "classes/Extension"], function(e, t, n, i) {
function r() {
void 0 !== o && (c === !0 || u === !1 || d === !0 ? o.addClass("disabled") : o.removeClass("disabled"))
}
var o, a, s, l = new i("buttonPublish", 'Button "Publish"'),
c = !1,
u = !1,
d = !1;
l.onPublisherCreated = function(e) {
s = e
}, l.onCreateButton = function() {
var t = n("a", {
"class": "btn btn-success button-publish",
title: "Update document publication"
}, n("i", {
"class": "icon-upload"
}));
return o = e(t).click(function() {
o.hasClass("disabled") || s.publish()
}), t
}, l.onPublishRunning = function(e) {
c = e, r()
}, l.onOfflineChanged = function(e) {
d = e, r()
};
var p = function() {
u = 0 === t.size(a.publishLocations) ? !1 : !0, r()
};
return l.onFileSelected = function(e) {
a = e, p()
}, l.onReady = function() {
e(".action-update-publication").click(s.publish)
}, l.onPublishRemoved = p, l.onNewPublishSuccess = p, l
}), define("text!html/buttonStat.html", [], function() {
return '\n
Tip: You can use a\n YAML front matter to specify the title of your page.
\n
Interpreted variables:title.
\n
\n
\n
About URL: For newly created page , Blogger API will append a generated number to the url like about-me-1234.html, if you deeply care about your URL naming, you should first create the page on Blogger and then update them with StackEdit specifying the pageId when publishing.\n
\n
About page visibility: Blogger API does not respect published status for pages.When publishing the page to Blogger, the page will be live but not added to the page listing. You should arrange the page listing from Blogger dashboard.\n
\n
\n
\n \n
\n
\n
\n\n\n
\n
\n
\n\n
\n \n
Publication
\n
\n
\n
\n "" is published on the following\n location(s):\n
\n \n
\n Note: Removing a publish location will not delete the actual publication.\n
\n
\n \n
\n
\n
\n\n\n
\n
\n
\n\n
\n \n
Sharing
\n
\n
\n
\n "" can be shared using the following link(s):\n
\n \n
To collaborate on this document, use Google Drive\n or Dropbox synchronization from the menu.\n
\n
To share a frozen version of this document within StackEdit, just publish it as a Gist in\n Markdown format from the menu.\n
\n
\n Tip: You can open any URL within StackEdit using viewer#!url=.\n
Ctrl/Cmd+H",
headingexample: "Heading",
hr: "Horizontal Rule Ctrl/Cmd+R",
undo: "Undo - Ctrl/Cmd+Z",
redo: "Redo - Ctrl/Cmd+Y",
help: "Markdown Editing Help"
}, v = "http://",
b = "http://";
Markdown.Editor = function(e, i, s) {
s = s || {}, "function" == typeof s.handler && (s = {
helpButton: s
}), s.strings = s.strings || {}, s.helpButton && (s.strings.help = s.strings.help || s.helpButton.title);
var l = function(e) {
return s.strings[e] || g[e]
};
i = i || "";
var c = this.hooks = new Markdown.HookCollection;
c.addNoop("onPreviewRefresh"), c.addNoop("postBlockquoteCreation"), c.addFalse("insertImageDialog"), c.addFalse("insertLinkDialog"), this.getConverter = function() {
return e
};
var u, p, f = this;
this.run = function() {
if(!u) {
u = new t(i);
var h, m = new a(c, l),
g = new r(e, u, function() {
c.onPreviewRefresh()
});
s.undoManager ? (p = s.undoManager, p.onButtonStateChange = function() {
h.setUndoRedoButtonStates()
}, h && h.setUndoRedoButtonStates()) : /\?noundo/.test(d.location.href) || (p = new n(function() {
g.refresh(), h && h.setUndoRedoButtonStates()
}, u), this.textOperation = function(e) {
p.setCommandMode(), e(), f.refreshPreview()
}), h = new o(i, u, p, g, m, s.helpButton, l), h.setUndoRedoButtonStates(); {
f.refreshPreview = function() {
g.refresh(!0)
}
}
f.undoManager = p, f.uiManager = h
}
}
}, e.prototype.findTags = function(e, t) {
var n, i = this;
e && (n = l.extendRegExp(e, "", "$"), this.before = this.before.replace(n, function(e) {
return i.startTag = i.startTag + e, ""
}), n = l.extendRegExp(e, "^", ""), this.selection = this.selection.replace(n, function(e) {
return i.startTag = i.startTag + e, ""
})), t && (n = l.extendRegExp(t, "", "$"), this.selection = this.selection.replace(n, function(e) {
return i.endTag = e + i.endTag, ""
}), n = l.extendRegExp(t, "^", ""), this.after = this.after.replace(n, function(e) {
return i.endTag = e + i.endTag, ""
}))
}, e.prototype.trimWhitespace = function(e) {
var t, n, i = this;
e ? t = n = "" : (t = function(e) {
return i.before += e, ""
}, n = function(e) {
return i.after = e + i.after, ""
}), this.selection = this.selection.replace(/^(\s*)/, t).replace(/(\s*)$/, n)
}, e.prototype.skipLines = function(e, t, n) {
void 0 === e && (e = 1), void 0 === t && (t = 1), e++, t++;
var i, r;
if(navigator.userAgent.match(/Chrome/) && "X".match(/()./), this.selection = this.selection.replace(/(^\n*)/, ""), this.startTag = this.startTag + p.$1, this.selection = this.selection.replace(/(\n*$)/, ""), this.endTag = this.endTag + p.$1, this.startTag = this.startTag.replace(/(^\n*)/, ""), this.before = this.before + p.$1, this.endTag = this.endTag.replace(/(\n*$)/, ""), this.after = this.after + p.$1, this.before) {
for(i = r = ""; e--;) i += "\\n?", r += "\n";
n && (i = "\\n*"), this.before = this.before.replace(new p(i + "$", ""), r)
}
if(this.after) {
for(i = r = ""; t--;) i += "\\n?", r += "\n";
n && (i = "\\n*"), this.after = this.after.replace(new p(i, ""), r)
}
}, l.isVisible = function(e) {
return window.getComputedStyle ? "none" !== window.getComputedStyle(e, null).getPropertyValue("display") : e.currentStyle ? "none" !== e.currentStyle.display : void 0
}, l.addEvent = function(e, t, n) {
e.attachEvent ? e.attachEvent("on" + t, n) : e.addEventListener(t, n, !1)
}, l.removeEvent = function(e, t, n) {
e.detachEvent ? e.detachEvent("on" + t, n) : e.removeEventListener(t, n, !1)
}, l.fixEolChars = function(e) {
return e = e.replace(/\r\n/g, "\n"), e = e.replace(/\r/g, "\n")
}, l.extendRegExp = function(e, t, n) {
(null === t || void 0 === t) && (t = ""), (null === n || void 0 === n) && (n = "");
var i, r = e.toString();
return r = r.replace(/\/([gim]*)$/, function(e, t) {
return i = t, ""
}), r = r.replace(/(^\/|\/$)/g, ""), r = t + r + n, new p(r, i)
}, c.getTop = function(e, t) {
var n = e.offsetTop;
if(!t)
for(; e = e.offsetParent;) n += e.offsetTop;
return n
}, c.getHeight = function(e) {
return e.offsetHeight || e.scrollHeight
}, c.getWidth = function(e) {
return e.offsetWidth || e.scrollWidth
}, c.getPageSize = function() {
var e, t, n, i;
self.innerHeight && self.scrollMaxY ? (e = d.body.scrollWidth, t = self.innerHeight + self.scrollMaxY) : d.body.scrollHeight > d.body.offsetHeight ? (e = d.body.scrollWidth, t = d.body.scrollHeight) : (e = d.body.offsetWidth, t = d.body.offsetHeight), self.innerHeight ? (n = self.innerWidth, i = self.innerHeight) : d.documentElement && d.documentElement.clientHeight ? (n = d.documentElement.clientWidth, i = d.documentElement.clientHeight) : d.body && (n = d.body.clientWidth, i = d.body.clientHeight);
var r = Math.max(e, n),
o = Math.max(t, i);
return [r, o, n, i]
}, u.createBackground = function() {
var e = d.createElement("div"),
t = e.style;
e.className = "wmd-prompt-background", t.position = "absolute", t.top = "0", t.zIndex = "1000", m.isIE ? t.filter = "alpha(opacity=50)" : t.opacity = "0.5";
var n = c.getPageSize();
return t.height = n[1] + "px", m.isIE ? (t.left = d.documentElement.scrollLeft, t.width = d.documentElement.clientWidth) : (t.left = "0", t.width = "100%"), d.body.appendChild(e), e
}, u.prompt = function(e, t, n) {
var i, r;
void 0 === t && (t = "");
var o = function(e) {
var t = e.charCode || e.keyCode;
27 === t && a(!0)
}, a = function(e) {
l.removeEvent(d.body, "keydown", o);
var t = r.value;
return e ? t = null : (t = t.replace(/^http:\/\/(https?|ftp):\/\//, "$1://"), /^(?:https?|ftp):\/\//.test(t) || (t = "http://" + t)), i.parentNode.removeChild(i), n(t), !1
}, s = function() {
i = d.createElement("div"), i.className = "wmd-prompt-dialog", i.style.padding = "10px;", i.style.position = "fixed", i.style.width = "400px", i.style.zIndex = "1001";
var n = d.createElement("div");
n.innerHTML = e, n.style.padding = "5px", i.appendChild(n);
var s = d.createElement("form"),
u = s.style;
s.onsubmit = function() {
return a(!1)
}, u.padding = "0", u.margin = "0", u.cssFloat = "left", u.width = "100%", u.textAlign = "center", u.position = "relative", i.appendChild(s), r = d.createElement("input"), r.type = "text", r.value = t, u = r.style, u.display = "block", u.width = "80%", u.marginLeft = u.marginRight = "auto", s.appendChild(r);
var p = d.createElement("input");
p.type = "button", p.onclick = function() {
return a(!1)
}, p.value = "OK", u = p.style, u.margin = "10px", u.display = "inline", u.width = "7em";
var f = d.createElement("input");
f.type = "button", f.onclick = function() {
return a(!0)
}, f.value = "Cancel", u = f.style, u.margin = "10px", u.display = "inline", u.width = "7em", s.appendChild(p), s.appendChild(f), l.addEvent(d.body, "keydown", o), i.style.top = "50%", i.style.left = "50%", i.style.display = "block", m.isIE_5or6 && (i.style.position = "absolute", i.style.top = d.documentElement.scrollTop + 200 + "px", i.style.left = "50%"), d.body.appendChild(i), i.style.marginTop = -(c.getHeight(i) / 2) + "px", i.style.marginLeft = -(c.getWidth(i) / 2) + "px"
};
setTimeout(function() {
s();
var e = t.length;
if(void 0 !== r.selectionStart) r.selectionStart = 0, r.selectionEnd = e;
else if(r.createTextRange) {
var n = r.createTextRange();
n.collapse(!1), n.moveStart("character", -e), n.moveEnd("character", e), n.select()
}
r.focus()
}, 0)
};
var y = a.prototype;
y.prefixes = "(?:\\s{4,}|\\s*>|\\s*-\\s+|\\s*\\d+\\.|=|\\+|-|_|\\*|#|\\s*\\[[^\n]]+\\]:)", y.unwrap = function(e) {
var t = new p("([^\\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 p("(.{1," + t + "})( +|$\\n?)", "gm"),
i = this;
e.selection = e.selection.replace(n, function(e, t) {
return new p("^" + i.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, i) {
e.trimWhitespace(), e.selection = e.selection.replace(/\n{2,}/g, "\n");
var r = /(\**$)/.exec(e.before)[0],
o = /(^\**)/.exec(e.after)[0],
a = Math.min(r.length, o.length);
if(a >= n && (2 != a || 1 != n)) e.before = e.before.replace(p("[*]{" + n + "}$", ""), ""), e.after = e.after.replace(p("^[*]{" + n + "}", ""), "");
else if(!e.selection && o) {
e.after = e.after.replace(/^([*_]*)/, ""), e.before = e.before.replace(/(\s?)$/, "");
var s = p.$1;
e.before = e.before + o + s
} else {
e.selection || o || (e.selection = i);
var l = 1 >= n ? "*" : "**";
e.before = e.before + l, e.after = l + e.after
}
}, y.stripLinkDefs = function(e, t) {
return e = e.replace(/^[ ]{0,3}\[(\d+)\]:[ \t]*\n?[ \t]*(\S+?)>?[ \t]*\n?[ \t]*(?:(\n*)["(](.+?)[")][ \t]*)?(?:\n+|$)/gm, function(e, n, i, r, o) {
return t[n] = e.replace(/\s*$/, ""), r ? (t[n] = e.replace(/["(](.+?)[")]$/, ""), r + o) : ""
})
}, y.addLinkDef = function(e, t) {
var n = 0,
i = {};
e.before = this.stripLinkDefs(e.before, i), e.selection = this.stripLinkDefs(e.selection, i), e.after = this.stripLinkDefs(e.after, i);
var r = "",
o = /(\[)((?:\[[^\]]*\]|[^\[\]])*)(\][ ]?(?:\n[ ]*)?\[)(\d+)(\])/g,
a = function(e) {
n++, e = e.replace(/^[ ]{0,3}\[(\d+)\]:/, " [" + n + "]:"), r += "\n" + e
}, s = function(e, t, r, l, c, u) {
return r = r.replace(o, s), i[c] ? (a(i[c]), t + r + l + n + u) : e
};
e.before = e.before.replace(o, s), t ? a(t) : e.selection = e.selection.replace(o, s);
var l = n;
return e.after = e.after.replace(o, s), e.after && (e.after = e.after.replace(/\n*$/, "")), e.after || (e.selection = e.selection.replace(/\n*$/, "")), e.after += "\n\n" + r, l
}, y.doLinkOrImage = function(e, t, n) {
e.trimWhitespace(), e.findTags(/\s*!?\[/, /\][ ]?(?:\n[ ]*)?(\(.*?\))?/);
var i;
if(!(e.endTag.length > 1 && e.startTag.length > 0)) {
if(e.selection = e.startTag + e.selection + e.endTag, e.startTag = e.endTag = "", /\n\n/.test(e.selection)) return void this.addLinkDef(e, null);
var r = this,
o = function(o) {
i.parentNode.removeChild(i), null !== o && (e.selection = (" " + e.selection).replace(/([^\\](?:\\\\)*)(?=[[\]])/g, "$1\\").substr(1), e.startTag = n ? "![" : "[", e.endTag = "](" + s(o) + ")", e.selection || (e.selection = r.getString(n ? "imagedescription" : "linkdescription"))), t()
};
return i = u.createBackground(), n ? this.hooks.insertImageDialog(o) || u.prompt(this.getString("imagedialog"), v, o) : this.hooks.insertLinkDialog(o) || u.prompt(this.getString("linkdialog"), b, o), !0
}
e.startTag = e.startTag.replace(/!?\[/, ""), e.endTag = "", this.addLinkDef(e, null)
}, y.doAutoindent = function(e) {
var t = this,
n = !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, ""
}), n = !0), /(\n|^)[ ]{0,3}([*+-]|\d+[.])[ \t]+.*\n$/.test(e.before) && t.doList && t.doList(e), /(\n|^)[ ]{0,3}>[ \t]+.*\n$/.test(e.before) && t.doBlockquote && t.doBlockquote(e), /(\n|^)(\t|[ ]{4,}).*\n$/.test(e.before) && t.doCode && t.doCode(e), n && (e.after = e.selection + e.after, e.selection = "")
}, y.doBlockquote = function(e) {
e.selection = e.selection.replace(/^(\n*)([^\r]+?)(\n*)$/, function(t, n, i, r) {
return e.before += n, e.after = r + e.after, i
}), 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 t, n = "",
i = "";
if(e.before) {
for(var r = e.before.replace(/\n$/, "").split("\n"), o = !1, a = 0; a < r.length; a++) {
var s = !1;
t = r[a], o = o && t.length > 0, /^>/.test(t) ? (s = !0, !o && t.length > 1 && (o = !0)) : s = /^[ \t]*$/.test(t) ? !0 : o, s ? n += t + "\n" : (i += n + t, n = "\n")
}
/(^|\n)>/.test(n) || (i += n, n = "")
}
e.startTag = n, e.before = i, 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, h.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) {
var t = /\S[ ]*$/.test(e.before),
n = /^[ ]*\S/.test(e.after);
if(!n && !t || /\n/.test(e.selection)) {
e.before = e.before.replace(/[ ]{4}$/, function(t) {
return e.selection = t + e.selection, ""
});
var i = 1,
r = 1;
/(\n|^)(\t|[ ]{4,}).*\n$/.test(e.before) && (i = 0), /^\n(\t|[ ]{4,})/.test(e.after) && (r = 0), e.skipLines(i, r), 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.endTag && !e.startTag ? (e.before += e.endTag, e.endTag = "") : e.startTag = e.endTag = "" : (e.startTag = e.endTag = "`", e.selection || (e.selection = this.getString("codeexample")))
}, y.doList = function(e, t, n) {
var i = /(\n|^)(([ ]{0,3}([*+-]|\d+[.])[ \t]+.*)(\n.+|\n{2,}([*+-].*|\d+[.])[ \t]+.*|\n{2,}[ \t]+\S.*)*)\n*$/,
r = /^\n*(([ ]{0,3}([*+-]|\d+[.])[ \t]+.*)(\n.+|\n{2,}([*+-].*|\d+[.])[ \t]+.*|\n{2,}[ \t]+\S.*)*)\n*/,
o = "-",
a = 1,
s = function() {
var e;
return n ? (e = " " + a + ". ", a++) : e = " " + o + " ", e
}, l = function(e) {
return void 0 === n && (n = /^\s*\d/.test(e)), e = e.replace(/^[ ]{0,3}([*+-]|\d+[.])\s/gm, function() {
return s()
})
};
if(e.findTags(/(\n|^)*[ ]{0,3}([*+-]|\d+[.])\s+/, null), !e.before || /\n$/.test(e.before) || /^\n/.test(e.startTag) || (e.before += e.startTag, e.startTag = ""), e.startTag) {
var c = /\d+[.]/.test(e.startTag);
if(e.startTag = "", e.selection = e.selection.replace(/\n[ ]{4}/g, "\n"), this.unwrap(e), e.skipLines(), c && (e.after = e.after.replace(r, l)), n == c) return
}
var u = 1;
e.before = e.before.replace(i, function(e) {
return /^\s*([*+-])/.test(e) && (o = p.$1), u = /[^\n]\n\n[^\n]/.test(e) ? 1 : 0, l(e)
}), e.selection || (e.selection = this.getString("litem"));
var d = s(),
f = 1;
e.after = e.after.replace(r, function(e) {
return f = /[^\n]\n\n[^\n]/.test(e) ? 1 : 0, l(e)
}), e.trimWhitespace(!0), e.skipLines(u, f, !0), e.startTag = d;
var m = d.replace(/./g, " ");
this.wrap(e, h.lineLength - m.length), e.selection = e.selection.replace(/\n/g, "\n" + m)
}, y.doHeading = function(e) {
if(e.selection = e.selection.replace(/\s+/g, " "), e.selection = e.selection.replace(/(^\s+|\s+$)/g, ""), !e.selection) return e.startTag = "## ", e.selection = this.getString("headingexample"), void(e.endTag = " ##");
var t = 0;
e.findTags(/#+[ ]*/, /[ ]*#+/), /#+/.test(e.startTag) && (t = p.lastMatch.length), e.startTag = e.endTag = "", e.findTags(null, /\s?(-+|=+)/), /=+/.test(e.endTag) && (t = 1), /-+/.test(e.endTag) && (t = 2), e.startTag = e.endTag = "", e.skipLines(1, 1);
var n = 0 == t ? 2 : t - 1;
if(n > 0) {
var i = n >= 2 ? "-" : "=",
r = e.selection.length;
for(r > h.lineLength && (r = h.lineLength), e.endTag = "\n"; r--;) e.endTag += i
}
}, y.doHorizontalRule = function(e) {
e.startTag = "----------\n", e.selection = "", e.skipLines(2, 1, !0)
}
}(), define("pagedown", function() {}), define("core", ["jquery", "underscore", "crel", "editor", "layout", "constants", "utils", "storage", "settings", "eventMgr", "text!html/bodyIndex.html", "text!html/bodyViewer.html", "text!html/settingsTemplateTooltip.html", "text!html/settingsShortcutsExtensionTooltip.html", "text!html/settingsUserCustomExtensionTooltip.html", "storage", "pagedown"], function(e, t, n, i, r, o, a, s, l, c, u, d, p, f, h) {
function m() {
E = !0, k = !0;
var e = a.currentTime;
e > I + 1e3 && (I = e, c.onUserActive())
}
function g() {
return a.currentTime - I > o.USER_IDLE_THRESHOLD && (k = !1), k && _
}
function v() {
if(E !== !1 && _ !== !1) {
void 0 === C && (C = a.randomString(), s.frontWindowId = C);
var t = s.frontWindowId;
t != C && (_ = !1, void 0 !== S && clearInterval(S), e(".modal").modal("hide"), e(".modal-non-unique").modal("show"), window.close())
}
}
function b() {
D === !0 && (D = !1, c.onOfflineChanged(!1))
}
function y() {
D === !0 && navigator.onLine === !0 && N + o.CHECK_ONLINE_PERIOD < a.currentTime && (N = a.currentTime, e.ajax({
url: "//www.google.com/jsapi",
timeout: o.AJAX_TIMEOUT,
dataType: "script"
}).done(function() {
b()
}))
}
function x() {
a.setInputRadio("radio-layout-orientation", l.layoutOrientation), a.setInputValue(L, window.theme), L.change(), a.setInputChecked("#input-settings-lazy-rendering", l.lazyRendering), a.setInputRadio("radio-settings-editor-font-class", l.editorFontClass), a.setInputValue("#input-settings-font-size", l.fontSizeRatio), a.setInputValue("#input-settings-max-width", l.maxWidthRatio), a.setInputValue("#textarea-settings-default-content", l.defaultContent), a.setInputRadio("radio-settings-edit-mode", l.editMode), a.setInputValue("#input-settings-publish-commit-msg", l.commitMsg), a.setInputValue("#input-settings-markdown-mime-type", l.markdownMimeType), a.setInputValue("#input-settings-gdrive-multiaccount", l.gdriveMultiAccount), a.setInputChecked("#input-settings-gdrive-full-access", l.gdriveFullAccess), a.setInputChecked("#input-settings-dropbox-full-access", l.dropboxFullAccess), a.setInputChecked("#input-settings-github-full-access", l.githubFullAccess), a.setInputValue("#textarea-settings-publish-template", l.template), a.setInputValue("#textarea-settings-pdf-template", l.pdfTemplate), a.setInputValue("#input-settings-pdf-page-size", l.pdfPageSize), a.setInputValue("#input-settings-ssh-proxy", l.sshProxy), c.onLoadSettings()
}
function w(t) {
var n = {};
n.layoutOrientation = a.getInputRadio("radio-layout-orientation");
var i = a.getInputValue(L);
n.lazyRendering = a.getInputChecked("#input-settings-lazy-rendering"), n.editorFontClass = a.getInputRadio("radio-settings-editor-font-class"), n.fontSizeRatio = a.getInputFloatValue("#input-settings-font-size", t, .1, 10), n.maxWidthRatio = a.getInputFloatValue("#input-settings-max-width", t, .1, 10), n.defaultContent = a.getInputValue("#textarea-settings-default-content"), n.editMode = a.getInputRadio("radio-settings-edit-mode"), n.commitMsg = a.getInputTextValue("#input-settings-publish-commit-msg", t), n.gdriveMultiAccount = a.getInputIntValue("#input-settings-gdrive-multiaccount"), n.markdownMimeType = a.getInputValue("#input-settings-markdown-mime-type"), n.gdriveFullAccess = a.getInputChecked("#input-settings-gdrive-full-access"), n.dropboxFullAccess = a.getInputChecked("#input-settings-dropbox-full-access"), n.githubFullAccess = a.getInputChecked("#input-settings-github-full-access"), n.template = a.getInputTextValue("#textarea-settings-publish-template", t), n.pdfTemplate = a.getInputTextValue("#textarea-settings-pdf-template", t), n.pdfPageSize = a.getInputValue("#input-settings-pdf-page-size"), n.sshProxy = a.checkUrl(a.getInputTextValue("#input-settings-ssh-proxy", t), !0), n.extensionSettings = {}, c.onSaveSettings(n.extensionSettings, t), t.isPropagationStopped() || (l.dropboxFullAccess !== n.dropboxFullAccess && s.removeItem("dropbox.lastChangeId"), e.extend(l, n), s.settings = JSON.stringify(l), s.themeV3 = i)
}
var S, C, T = {}, E = !1,
k = !1,
_ = !0,
I = 0,
D = !1,
N = a.currentTime;
T.setOffline = function() {
N = a.currentTime, D === !1 && (D = !0, c.onOfflineChanged(!0))
};
var L, M, A;
return T.initEditor = function(t) {
if(void 0 !== A && c.onFileClosed(A), A = t, void 0 !== M) return i.undoMgr.init(), M.uiManager.setUndoRedoButtonStates();
var n = new Markdown.Converter,
r = {
_DoItalicsAndBold: function(e) {
return e = e.replace(/(\*\*|__)(?=\S)(.+?[*_]*)(?=\S)\1/g, "$2"), e = e.replace(/(\*|_)(?=\S)(.+?)(?=\S)\1/g, "$2")
}
};
n.setOptions(r), M = new Markdown.Editor(n, void 0, {
undoManager: i.undoMgr
}), M.hooks.set("insertLinkDialog", function(t) {
return T.insertLinkCallback = t, a.resetModalInputs(), e(".modal-insert-link").modal(), !0
}), M.hooks.set("insertImageDialog", function(t) {
return T.insertLinkCallback = t, T.catchModal ? !0 : (a.resetModalInputs(), e(".modal-insert-image").modal(), !0)
}), c.onPagedownConfigure(M), M.hooks.chain("onPreviewRefresh", c.onAsyncPreview), M.run(), i.undoMgr.init(), e(".wmd-button-row li").addClass("btn btn-success").css("left", 0).find("span").hide();
var o = e(".wmd-button-group1");
e("#wmd-bold-button").append(e('')).appendTo(o), e("#wmd-italic-button").append(e('')).appendTo(o), o = e(".wmd-button-group2"), e("#wmd-link-button").append(e('')).appendTo(o), e("#wmd-quote-button").append(e('')).appendTo(o), e("#wmd-code-button").append(e('')).appendTo(o), e("#wmd-image-button").append(e('')).appendTo(o), o = e(".wmd-button-group3"), e("#wmd-olist-button").append(e('')).appendTo(o), e("#wmd-ulist-button").append(e('')).appendTo(o), e("#wmd-heading-button").append(e('')).appendTo(o), e("#wmd-hr-button").append(e('')).appendTo(o), o = e(".wmd-button-group5"), e("#wmd-undo-button").append(e('')).appendTo(o), e("#wmd-redo-button").append(e('')).appendTo(o)
}, T.onReady = function() {
document.body.className += " " + l.editMode, document.body.innerHTML = window.viewerMode === !0 ? d : u, a.init(), e(window).on("offline", T.setOffline), e(window).on("online", b), navigator.onLine === !1 && T.setOffline(), e(document).mousemove(m).keypress(m), r.init(), i.init(), S = window.setInterval(function() {
a.updateCurrentTime(), v(), (g() === !0 || window.viewerMode === !0) && (c.onPeriodicRun(), y())
}, 1e3), c.onReady()
}, c.addListener("onReady", function() {
function n(e) {
if(e = e || "default", u != e) {
var t = "less!themes/" + e; - 1 !== window.baseDir.indexOf("-min") && (t = "css!themes/" + e), requirejs.undef(t), require([t]), u = e
}
}
function r(n, i) {
t.each(document.querySelectorAll(n), function(t) {
var n = e(t);
n.tooltip({
html: !0,
container: n.parents(".modal-content"),
placement: "right",
trigger: "manual",
title: i
}).click(function() {
var t = this;
m && m[0] === t || a.defer(function() {
e(document).on("click.close-tooltip", function() {
m && m.tooltip("hide"), m = void 0, e(document).off("click.close-tooltip")
}), m = e(t).tooltip("show")
})
})
})
}
e(".modal").on("shown.bs.modal", function() {
var t = e(this);
setTimeout(function() {
t.find(".btn:first").focus(), t.find("button:first").focus(), t.find("input:enabled:visible:first").focus()
}, 50)
}).on("hidden.bs.modal", function() {
i.focus(), n(window.theme)
}).keyup(function(t) {
13 != t.which || e(t.target).is("textarea") || e(this).find(".modal-footer a:last").click()
}), e(".action-insert-link").click(function(t) {
var n = a.getInputTextValue(e("#input-insert-link"), t);
void 0 !== n && (T.insertLinkCallback(n), T.insertLinkCallback = void 0)
}), e(".action-insert-image").click(function(t) {
var n = a.getInputTextValue(e("#input-insert-image"), t);
void 0 !== n && (T.insertLinkCallback(n), T.insertLinkCallback = void 0)
}), e(".modal-insert-link, .modal-insert-image").on("hidden.bs.modal", function() {
void 0 !== T.insertLinkCallback && (T.insertLinkCallback(null), T.insertLinkCallback = void 0)
}), e(".action-load-settings").click(function() {
x()
}), e(".action-apply-settings").click(function(e) {
w(e), e.isPropagationStopped() || window.location.reload()
}), e(".action-add-google-drive-account").click(function() {
3 !== l.gdriveMultiAccount && (l.gdriveMultiAccount++, s.settings = JSON.stringify(l), window.location.reload())
});
var u = window.theme;
L = e("#input-settings-theme"), L.on("change", function() {
n(this.value)
}), e(".action-import-docs-settings").click(function() {
e("#input-file-import-docs-settings").click()
});
var d;
e("#input-file-import-docs-settings").change(function(n) {
var i = (n.dataTransfer || n.target).files;
e(".modal-settings").modal("hide"), t.each(i, function(t) {
var n = new FileReader;
n.onload = function(t) {
return function(n) {
try {
d = JSON.parse(n.target.result);
var i = parseInt(d.version.match(/^v(\d+)$/)[1], 10),
r = parseInt(s.version.match(/^v(\d+)$/)[1], 10);
i > r ? c.onError("Incompatible version. Please upgrade StackEdit.") : e(".modal-import-docs-settings").modal("show")
} catch(o) {
c.onError("Wrong format: " + t.name)
}
e("#input-file-import-docs-settings").val("")
}
}(t), n.readAsText(t)
})
}), e(".action-import-docs-settings-confirm").click(function() {
s.clear();
var e = /^file\.|^folder\.|^publish\.|^settings$|^sync\.|^google\.|^author\.|^themeV3$|^version$/;
t.each(d, function(t, n) {
e.test(n) && (s[n] = t)
}), window.location.reload()
}), e(".action-export-docs-settings").click(function() {
a.saveAs(JSON.stringify(s), "StackEdit local storage.json")
}), e(".action-default-settings").click(function() {
s.removeItem("settings"), s.removeItem("theme"), l.dropboxFullAccess || s.removeItem("dropbox.lastChangeId"), window.location.reload()
}), e(".action-app-reset").click(function() {
s.clear(), window.location.reload()
}), e(".action-reset-input").click(function() {
a.resetModalInputs()
});
var m;
if(r(".tooltip-lazy-rendering", "Disable preview rendering while typing in order to offload CPU. Refresh preview after 500 ms of inactivity."), r(".tooltip-default-content", ["Thanks for supporting StackEdit by adding a backlink in your documents!
", 'NOTE: Backlinks in Stack Exchange Q/A are not welcome.'].join("")), r(".tooltip-shortcuts-extension", f), r(".tooltip-usercustom-extension", h), r(".tooltip-template", p), e("div.dropdown-menu").click(function(e) {
e.stopPropagation()
}), e(".modal-non-unique").modal({
backdrop: "static",
keyboard: !1,
show: !1
}), t.each(document.querySelectorAll("img"), function(t) {
var n = e(t),
i = n.data("stackeditSrc");
i && n.attr("src", window.baseDir + "/img/" + i)
}), window.viewerMode === !1) {
var g = t.reduce(o.THEME_LIST, function(e, t, n) {
return e + '"
}, "");
document.getElementById("input-settings-theme").innerHTML = g
}
e(".modal-header").append('Give your feedback ')
}), T
}), define("text!WELCOME.md", [], function() {
return 'Welcome to StackEdit! {#welcome}\n====================\n\n\nHello, I am your first Markdown document within **StackEdit**[^stackedit]. Don\'t delete me, I can be helpful. I can be recovered anyway in the `Utils` tab of the `Settings` dialog.\n\n----------\n\n\nDocuments\n--------------\n\n**StackEdit** stores your documents in your browser, which means all your documents are automatically saved locally and are accessible **offline!**\n\n> **Note:**\n\n> - StackEdit is accessible offline after the application has been loaded for the first time.\n> - Your local documents are not shared between different browsers or computers.\n> - Clearing your browser\'s data may **delete all your local documents!** Make sure your documents are backed up using **Google Drive** or **Dropbox** synchronization (see [ Synchronization](#synchronization) section).\n\n#### Create a document\n\nThe document panel is accessible using button in the navigation bar. You can create a new document by clicking the `New document` sub-menu in the document panel.\n\n#### Switch to another document\n\nAll your local documents are listed in the document panel. You can switch from one to another by clicking a document in the document panel or you can also use Ctrl+[ and Ctrl+] to toggle documents by most recently used.\n\n#### Rename a document\n\nYou can rename the current document by clicking the document title in the navigation bar.\n\n#### Delete a document\n\nYou can delete the current document by clicking the `Delete document` sub-menu in the document panel.\n\n#### Export a document\n\nYou can save the current document to a file using the `Export to disk` sub-menu from the menu panel.\n\n> **Tip:** See [ Publish a document](#publish-a-document) section for a description of the different output formats.\n\n\n----------\n\n\nSynchronization\n--------------------\n\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.\n\n> **Note:**\n\n> - Full access to **Google Drive** or **Dropbox** is required to be able to import any document in StackEdit. Permission restrictions can be configured in the settings.\n> - Imported documents are downloaded in your browser and are not transmitted to a server.\n> - If you experience problems saving your documents on Google Drive, check and optionally disable browser extensions, such as Disconnect.\n\n#### Open a document\n\nYou can open a document from **Google Drive** or the **Dropbox** by opening the `Synchronize` sub-menu and by clicking `Open from...`. Once opened, any modification in your document will be automatically synchronized with the **Google Drive** / **Dropbox** file.\n\n#### Save a document\n\nYou can save any document by opening the `Synchronize` sub-menu and by clicking `Save on...`. 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.\n\n#### Synchronize a document\n\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.\n\nIf you just have modified your document and you want to force the synchronization, click the button in the navigation bar.\n\n> **Note:** The button is disabled when you have no document to synchronize.\n\n#### Manage document synchronization\n\nSince one document can be synchronized with multiple locations, you can list and manage synchronized locations by clicking `Manage synchronization` in the `Synchronize` sub-menu. This will let you remove synchronization locations that are associated to your document.\n\n> **Note:** If you delete the file from **Google Drive** or from **Dropbox**, the document will no longer be synchronized with that location.\n\n----------\n\n\nPublication\n--------------\n\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.\n\n#### Publish a document\n\nYou can publish your document by opening the `Publish` sub-menu and by choosing a website. In the dialog box, you can choose the publication format:\n\n- Markdown, to publish the Markdown text on a website that can interpret it (**GitHub** for example),\n- HTML, to publish the document converted into HTML (on a blog for example),\n- Template, to have a full control of the output.\n\n> **Note:** The default template is a simple webpage wrapping your document in HTML format. You can customize it in the `Advanced` tab of the `Settings` dialog.\n\n#### Update a publication\n\nAfter publishing, **StackEdit** will keep your document linked to that publication which makes it easy for you to update it. Once you have modified your document and you want to update your publication, click on the button in the navigation bar.\n\n> **Note:** The button is disabled when your document has not been published yet.\n\n#### Manage document publication\n\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 let you remove publication locations that are associated to your document.\n\n> **Note:** In some cases, if the file has been removed from the website or the blog, the document will no longer be published on that location.\n\n----------\n\n\nMarkdown Extra\n--------------------\n\n**StackEdit** supports **Markdown Extra**, which extends **Markdown** syntax with some nice features.\n\n> **Tip:** You can disable any **Markdown Extra** feature in the `Extensions` tab of the `Settings` dialog.\n\n\n### Tables\n\n**Markdown Extra** has a special syntax for tables:\n\nItem | Value\n--- | ---\nComputer | $1600\nPhone | $12\nPipe | $1\n\nYou can specify column alignment with one or two colons:\n\n| Item | Value | Qty |\n| :--- | ---: | :---: |\n| Computer | $1600 | 5 |\n| Phone | $12 | 12 |\n| Pipe | $1 | 234 |\n\n\n### Definition Lists\n\n**Markdown Extra** has a special syntax for definition lists too:\n\nTerm 1\nTerm 2\n: Definition A\n: Definition B\n\nTerm 3\n\n: Definition C\n\n: Definition D\n\n > part of definition D\n\n\n### Fenced code blocks\n\nGitHub\'s fenced code blocks[^gfm] are also supported with **Prettify** syntax highlighting:\n\n```\n// Foo\nvar bar = 0;\n```\n\n> **Tip:** To use **Highlight.js** instead of **Prettify**, just configure the `Markdown Extra` extension in the `Settings` dialog.\n\n\n### Footnotes\n\nYou can create footnotes like this[^footnote].\n\n [^footnote]: Here is the *text* of the **footnote**.\n\n\n### SmartyPants\n\nSmartyPants converts ASCII punctuation characters into "smart" typographic punctuation HTML entities. For example:\n\n| | ASCII | HTML |\n---|---|---\n| Single backticks | `\'Isn\'t this fun?\'` | \'Isn\'t this fun?\' |\n| Quotes | `"Isn\'t this fun?"` | "Isn\'t this fun?" |\n| Dashes | `-- is en-dash, --- is em-dash` | -- is en-dash, --- is em-dash |\n\n\n### Table of contents\n\nYou can insert a table of contents using the marker `[TOC]`:\n\n[TOC]\n\n\n### MathJax\n\nYou can render *LaTeX* mathematical expressions using **MathJax**, as on [math.stackexchange.com][1]:\n\nThe *Gamma function* satisfying $\\Gamma(n) = (n-1)!\\quad\\forall n\\in\\mathbb N$ is via the Euler integral\n\n$$\n\\Gamma(z) = \\int_0^\\infty t^{z-1}e^{-t}dt\\,.\n$$\n\n> **Tip:** Make sure you include **MathJax** into your publications to render mathematical expression correctly. Your page/template should include something like:\n\n```\n\n```\n\n> **NOTE:** You can find more information:\n\n> - about **Markdown** syntax [here][2],\n> - about **Markdown Extra** extension [here][3],\n> - about **LaTeX** mathematical expressions [here][4],\n> - about **Prettify** syntax highlighting [here][5],\n> - about **Highlight.js** syntax highlighting [here][6].\n\n [^stackedit]: [StackEdit](https://stackedit.io/) is a full-featured, open-source Markdown editor based on PageDown, the Markdown library used by Stack Overflow and the other Stack Exchange sites.\n\n [^gfm]: **GitHub Flavored Markdown** (GFM) is supported by StackEdit.\n\n\n [1]: http://math.stackexchange.com/\n [2]: http://daringfireball.net/projects/markdown/syntax "Markdown"\n [3]: https://github.com/jmcmanus/pagedown-extra "Pagedown Extra"\n [4]: http://meta.math.stackexchange.com/questions/5020/mathjax-basic-tutorial-and-quick-reference\n [5]: https://code.google.com/p/google-code-prettify/\n [6]: http://highlightjs.org/\n'
}), define("fileMgr", ["jquery", "underscore", "constants", "core", "utils", "storage", "settings", "eventMgr", "fileSystem", "classes/FileDescriptor", "text!WELCOME.md"], function(e, t, n, i, r, o, a, s, l, c, u) {
var d = {};
return d.currentFile = void 0, d.selectFile = function(r) {
if(r = r || d.currentFile, void 0 === r) {
var o = t.size(l);
r = 0 === o ? d.createFile(n.WELCOME_DOCUMENT_TITLE, u) : t.max(l, function(e) {
return e.selectTime || 0
})
}
d.currentFile !== r && (d.currentFile = r, r.selectTime = (new Date).getTime(), s.onFileSelected(r), e(".action-edit-document").toggleClass("hide", r.fileIndex != n.TEMPORARY_FILE_INDEX)), i.initEditor(r)
}, d.createFile = function(e, i, u, d, p) {
if(i = void 0 !== i ? i : a.defaultContent, !e) {
e = n.DEFAULT_FILE_TITLE;
for(var f = 2, h = function(t) {
return t.title == e
}; t.some(l, h);) e = n.DEFAULT_FILE_TITLE + f++
}
var m = n.TEMPORARY_FILE_INDEX;
if(!p)
do m = "file." + r.randomString(); while (t.has(l, m));
d = d || {};
var g = t.reduce(d, function(e, t) {
return r.storeAttributes(t), e + t.syncIndex + ";"
}, ";");
o[m + ".title"] = e, o[m + ".content"] = i, o[m + ".sync"] = g, o[m + ".publish"] = ";";
var v = new c(m, e, d);
return u && (v.discussionListJSON = u), p || (r.appendIndexToArray("file.list", m), l[m] = v, s.onFileCreated(v)), v
}, d.deleteFile = function(e) {
e = e || d.currentFile, e.folder && (e.folder.removeFile(e), s.onFoldersChanged()), r.removeIndexFromArray("file.list", e.fileIndex), delete l[e.fileIndex], d.currentFile === e && (d.currentFile = void 0, d.selectFile()), s.onFileDeleted(e)
}, d.getFileFromSyncIndex = function(e) {
return t.find(l, function(n) {
return t.has(n.syncLocations, e)
})
}, d.getFileFromPublishIndex = function(e) {
return t.find(l, function(n) {
return t.has(n.publishLocations, e)
})
}, s.addListener("onReady", function() {
function t() {
o.addClass("hide"), r.removeClass("hide");
var t = e.trim(o.val()),
n = d.currentFile;
t && t != n.title && (n.title = t, s.onTitleChanged(n)), o.val(n.title), i.focus()
}
var i = e("#wmd-input");
d.selectFile();
var r = e(".file-title-navbar"),
o = e(".input-file-title");
e(".action-create-file").click(function() {
setTimeout(function() {
var e = d.createFile();
d.selectFile(e), r.click()
}, 400)
}), e(".action-remove-file-confirm").click(function() {
e(".modal-remove-file-confirm").modal("show")
}), e(".action-remove-file").click(function() {
d.deleteFile()
}), r.click(function() {
if(window.viewerMode !== !0) {
r.addClass("hide");
var e = o.removeClass("hide");
setTimeout(function() {
e.focus().get(0).select()
}, 10)
}
}), o.blur(function() {
t()
}).keyup(function(e) {
13 == e.keyCode && t(), 27 == e.keyCode && (o.val(""), t())
}), e(".action-open-stackedit").click(function() {
window.location.href = "."
}), e(".action-edit-document").click(function() {
var e = i.val(),
t = d.currentFile.title,
n = d.createFile(t, e);
d.selectFile(n), window.location.href = "."
}), e(".action-welcome-file").click(function() {
var e = d.createFile(n.WELCOME_DOCUMENT_TITLE, u);
d.selectFile(e)
})
}), s.onFileMgrCreated(d), d
}), define("classes/Provider", ["underscore", "utils", "settings", "eventMgr", "fileMgr", "editor", "diff_match_patch_uncompressed", "jsondiffpatch"], function(e, t, n, i, r, o, a, s) {
function l(e, t) {
this.providerId = e, this.providerName = t, this.isPublishEnabled = !0
}
l.prototype.parseDiscussionList = function(t) {
try {
var n = JSON.parse(t);
return e.each(n, function(t, n) {
if(t.discussionIndex != n || !e.isNumber(t.selectionStart) || !e.isNumber(t.selectionEnd)) throw "invalid";
t.commentList && t.commentList.forEach(function(t) {
if(t.author && !e.isString(t.author) || !e.isString(t.content)) throw "invalid"
})
}), n
} catch(i) {}
}, l.prototype.serializeContent = function(e, t) {
return t.length > 2 ? e + "" : e
}, l.prototype.parseContent = function(e) {
var t, n = "{}",
i = /$/.exec(e);
return i && (t = this.parseDiscussionList(i[1])) && (e = e.substring(0, i.index), n = i[1]), {
content: e,
discussionList: t || {},
discussionListJSON: n
}
};
var c = new a;
c.Match_Threshold = 0, c.Patch_DeleteThreshold = 0;
var u = s.create({
objectHash: function(e) {
return JSON.stringify(e)
},
textDiff: {
minLength: 9999999
}
}),
d = "merge" == n.conflictMode;
return l.prototype.syncMerge = function(n, a, s, l, p, f) {
function h(e) {
function t() {
(i[1] || r[1]) && (i[1] && r[1] ? (i[1] = "⧸⧸" + i[1] + "⧸⧸", r[1] += "⧸⧸", n.push(i), n.push(r)) : n.push([0, i[1] + r[1]]), i = [-1, ""], r = [1, ""])
}
var n = [],
i = [-1, ""],
r = [1, ""],
o = 20;
return e.forEach(function(a, s) {
function l() {
return 0 === s || s === e.length - 1
}
var c = a[0],
u = a[1];
if(0 === c)
if(l() || u.length > o) {
if(i[1] || r[1]) {
var d = /\s/.exec(u);
if(d) {
var p = d.index,
f = u.substring(0, p);
u = u.substring(p), i[1] += f, r[1] += f
}
}
if(u) {
for(var h = u.length; h && /\S/.test(u[h - 1]);) h--;
var m = u.substring(h);
u = u.substring(0, h), l() || u.length > o ? (t(), n.push([0, u])) : (i[1] += u, r[1] += u), i[1] += m, r[1] += m
}
} else i[1] += u, r[1] += u;
else -1 === c ? i[1] += u : 1 === c && (r[1] += u)
}), i[1] == r[1] ? n.push([0, r[1]]) : t(), n
}
var m = n.content,
g = n.title,
v = n.discussionListJSON,
b = n.discussionList,
y = t.crc32(m),
x = t.crc32(g),
w = t.crc32(v),
S = t.crc32(s),
C = t.crc32(l),
T = t.crc32(f),
E = a.contentCRC != y,
k = a.contentCRC != S,
_ = m != s && k,
I = _ && E;
a.titleCRC = a.titleCRC || x;
var D, N, L = a.titleCRC != x,
M = a.titleCRC != C,
A = g != l && M,
R = A && L,
P = a.discussionListCRC != w,
F = a.discussionListCRC != T,
O = v != f && F,
B = O && P,
j = [],
$ = s,
G = l,
H = p,
q = !1,
U = !1,
z = !1;
if(!d && (I || R || B) || I && void 0 === a.content || R && void 0 === a.title || B && void 0 === a.discussionList) r.createFile(g + " (backup)", m, v), i.onMessage('Conflict detected on "' + g + '". A backup has been created locally.');
else {
if(I) {
var V = a.content;
D = c.diff_main(V, m), c.diff_cleanupSemantic(D), N = c.patch_make(V, D);
var W = c.patch_apply(N, s);
if($ = W[0], !W[1].every(e.identity)) {
D = c.diff_main(m, $), D = h(D), $ = "";
var Q;
D.forEach(function(e) {
var t = e[0],
n = e[1];
0 === t || Q ? 0 === t && Q && (Q.selectionEnd = $.length, j.push(Q), Q = void 0) : Q = {
selectionStart: $.length,
type: "conflict"
}, $ += n
}), Q && (Q.selectionEnd = $.length, j.push(Q))
}
}
_ && (P && (q = !0), F ? U = !0 : (q = !0, H = b)), B && (z = !0), R && (N = c.patch_make(a.title, g), G = c.patch_apply(N, l)[0])
}
var X;
if(_) {
var K = [];
r.currentFile === n && (X = {
selectionStart: o.selectionMgr.selectionStart,
selectionEnd: o.selectionMgr.selectionEnd
}, K.push(X), n.newDiscussion && K.push(n.newDiscussion)), q && (K = K.concat(e.values(b))), O |= o.adjustCommentOffsets(m, $, K)
}
if(U) {
var J = e.values(p);
o.adjustCommentOffsets(s, $, J)
}
if(z) {
var Y = JSON.parse(a.discussionList);
D = u.diff(Y, b), u.patch(p, D), e.each(p, function(e, t) {
e || delete p[t]
})
}
return j.length && (O = !0, j.forEach(function(n) {
var i;
do i = t.randomString() + t.randomString(); while (e.has(H, i));
n.discussionIndex = i, H[i] = n
})), A && (n.title = G, i.onTitleChanged(n), i.onMessage('"' + g + '" has been renamed to "' + G + '" on ' + this.providerName + ".")), (_ || O) && o.watcher.noWatch(e.bind(function() {
if(_ && (r.currentFile === n && (o.setValueNoWatch($), X && o.selectionMgr.setSelectionStartEnd(X.selectionStart, X.selectionEnd)), n.content = $, i.onContentChanged(n, $)), O) {
n.discussionList = H;
var t = u.diff(b, H),
a = !1;
e.each(t, function(t, r) {
e.isArray(t) ? 1 === t.length ? i.onDiscussionCreated(n, H[r]) : i.onDiscussionRemoved(n, b[r]) : a = !0
}), a && i.onCommentsChanged(n)
}
o.undoMgr.currentMode = "sync", o.undoMgr.saveState(), i.onMessage('"' + l + '" has been updated from ' + this.providerName + "."), j.length && i.onMessage('"' + l + '" has conflicts that you have to review.')
}, this)), {
contentCRC: S,
titleCRC: C,
discussionListCRC: T
}
}, l
}), define("classes/AsyncTask", ["underscore", "constants", "utils", "eventMgr"], function(e, t, n, i) {
function r(e) {
this.finished = !1, this.timeout = t.ASYNC_TASK_DEFAULT_TIMEOUT, this.retryCounter = 0, this.runCallbacks = [], this.successCallbacks = [], this.errorCallbacks = [], this.force = e
}
function o() {
if(c === !0) return void(l + u.timeout < n.currentTime && u.error(new Error("A timeout occurred.")));
if(void 0 === u) {
if(0 === s.length || !s[0].force && p === !1) return;
u = s.shift(), l = n.currentTime, d === !1 && (d = !0, i.onAsyncRunning(!0))
}
l <= n.currentTime && (c = !0, u.chain())
}
function a(t, n, r) {
try {
e.each(n, function(e) {
e(r)
})
} finally {
t.finished = !0, u === t && (u = void 0, c = !1), 0 === s.length ? (d = !1, i.onAsyncRunning(!1)) : o()
}
}
var s = [];
r.prototype.onRun = function(e) {
this.runCallbacks.push(e)
}, r.prototype.onSuccess = function(e) {
this.successCallbacks.push(e)
}, r.prototype.onError = function(e) {
this.errorCallbacks.push(e)
};
var l = 0;
r.prototype.chain = function(e) {
if(l = n.currentTime, n.logStackTrace(), this.finished !== !0) {
if(void 0 === this.queue && (this.queue = this.runCallbacks.slice()), void 0 !== e) return void e();
if(0 === this.queue.length) return void a(this, this.successCallbacks);
var t = this.queue.shift();
t()
}
}, r.prototype.error = function(e) {
if(n.logStackTrace(), this.finished !== !0) throw e = e || new Error("Unknown error"), e.message && i.onError(e), a(this, this.errorCallbacks, e), e
};
var c = !1;
r.prototype.retry = function(e, t) {
if(this.finished !== !0) {
if(t = t || 5, this.queue = void 0, this.retryCounter >= t) return void this.error(e);
var i = 1e3 * Math.pow(2, this.retryCounter++);
l = n.currentTime + i, c = !1, o()
}
}, r.prototype.enqueue = function() {
s.push(this), o()
};
var u, d = !1,
p = !1;
return i.addListener("onUserActive", function() {
p = !0
}), i.addListener("onPeriodicRun", o), r
}), define("helpers/dropboxHelper", ["jquery", "underscore", "constants", "core", "utils", "storage", "logger", "settings", "eventMgr", "classes/AsyncTask"], function(e, t, n, i, r, o, a, s, l, c) {
function u(t) {
t.onRun(function() {
return v === !0 ? (h = void 0, void t.error(new Error("Operation not available in offline mode.|stopPublish"))) : void 0 !== h ? void t.chain() : void e.ajax({
url: "libs/dropbox.min.js",
dataType: "script",
timeout: n.AJAX_TIMEOUT
}).done(function() {
h = new Dropbox.Client({
key: s.dropboxFullAccess === !0 ? n.DROPBOX_APP_KEY : n.DROPBOX_RESTRICTED_APP_KEY,
secret: s.dropboxFullAccess === !0 ? n.DROPBOX_APP_SECRET : n.DROPBOX_RESTRICTED_APP_SECRET
}), h.authDriver(new Dropbox.AuthDriver.Popup({
receiverUrl: n.BASE_URL + "html/dropbox-oauth-receiver.html",
rememberUser: !0
})), t.chain()
}).fail(function(e) {
var n = {
status: e.status,
responseText: e.statusText
};
p(n, t)
})
})
}
function d(e) {
e.onRun(function() {
function t() {
r.redirectConfirm("You are being redirected to Dropbox authorization page.", function() {
e.chain(i)
}, function() {
e.error(new Error("Operation canceled."))
})
}
function i() {
o === !1 ? e.timeout = n.ASYNC_TASK_LONG_TIMEOUT : h.reset(), h.authenticate({
interactive: !o
}, function(n, i) {
return i.isAuthenticated() === !0 ? (m = !0, void e.chain()) : o === !0 ? (o = !1, void e.chain(t)) : void e.error(new Error("Access to Dropbox account is not authorized."))
})
}
if(m === !0) return void e.chain();
var o = !0;
e.chain(i)
})
}
function p(e, n) {
var r = !0;
if(e)
if(a.error(e), "string" == typeof e) r = e;
else {
if(r = "Dropbox error (" + e.status + ": " + e.responseText + ").", 401 === e.status || 403 === e.status) return m = !1, r = "Access to Dropbox account is not authorized.", void n.retry(new Error(r), 1);
if(400 === e.status && -1 !== e.responseText.indexOf("oauth_nonce")) return t.each(t.keys(o), function(e) {
0 === e.indexOf("dropbox-auth") && o.removeItem(e)
}), m = !1, void n.retry(new Error(r), 1);
e.status <= 0 && (h = void 0, m = !1, i.setOffline(), r = "|stopPublish")
}
n.error(new Error(r))
}
function f(t) {
t.onRun(function() {
function i() {
r.redirectConfirm("You are being redirected to Dropbox Chooser page.", function() {
t.chain()
}, function() {
t.error(new Error("Operation canceled."))
})
}
return b === !0 ? void t.chain() : void e.ajax({
url: "https://www.dropbox.com/static/api/1/dropbox.js",
dataType: "script",
timeout: n.AJAX_TIMEOUT
}).done(function() {
b = !0, t.chain(i)
}).fail(function(e) {
var n = {
status: e.status,
responseText: e.statusText
};
p(n, t)
})
})
}
var h, m = !1,
g = {}, v = !1;
l.addListener("onOfflineChanged", function(e) {
v = e
}), g.upload = function(e, t, n) {
var i, r = new c;
u(r), d(r), r.onRun(function() {
h.writeFile(e, t, function(t, n) {
return t ? (400 === t.status && (t = 'Could not upload document into path "' + e + '".'), void p(t, r)) : (i = n, void r.chain())
})
}), r.onSuccess(function() {
n(void 0, i)
}), r.onError(function(e) {
n(e)
}), r.enqueue()
}, g.checkChanges = function(e, t) {
var n = [],
i = e || 0,
r = new c;
u(r), d(r), r.onRun(function() {
function e() {
h.pullChanges(i, function(t, o) {
return t ? void p(t, r) : (i = o.cursor(), void 0 !== o.changes && (n = n.concat(o.changes)), void(o.shouldPullAgain ? r.chain(e) : r.chain()))
})
}
r.chain(e)
}), r.onSuccess(function() {
t(void 0, n, i)
}), r.onError(function(e) {
t(e)
}), r.enqueue()
}, g.downloadMetadata = function(e, t) {
var n = [],
i = new c;
u(i), d(i), i.onRun(function() {
function t() {
if(0 === e.length) return void i.chain();
var r = e[0];
h.stat(r, function(r, o) {
return o ? (n.push(o), e.shift(), void i.chain(t)) : void p(r, i)
})
}
i.chain(t)
}), i.onSuccess(function() {
t(void 0, n)
}), i.onError(function(e) {
t(e)
}), i.enqueue()
}, g.downloadContent = function(e, n) {
var i = [],
r = new c;
u(r), d(r), r.onRun(function() {
function n() {
if(0 === e.length) return void r.chain();
var o = e[0];
i.push(o);
var a;
return o.isFile === !0 ? a = o : void 0 !== o.wasRemoved && (a = o.stat), a ? void h.readFile(a.path, function(i, o) {
return t.isString(o) ? (a.content = o, e.shift(), void r.chain(n)) : void p(i, r)
}) : (e.shift(), void r.chain(n))
}
r.chain(n)
}), r.onSuccess(function() {
n(void 0, i)
}), r.onError(function(e) {
n(e)
}), r.enqueue()
};
var b = !1;
return g.picker = function(e) {
var t = [],
i = new c;
i.timeout = n.ASYNC_TASK_LONG_TIMEOUT, u(i), f(i), i.onRun(function() {
var e = {};
e.multiselect = !0, e.linkType = "direct", e.success = function(e) {
for(var n = 0; n < e.length; n++) {
var r = e[n].link;
r = r.replace(/.*\/view\/[^\/]*/, ""), t.push(decodeURI(r))
}
i.chain()
}, e.cancel = function() {
i.chain()
}, Dropbox.choose(e)
}), i.onSuccess(function() {
e(void 0, t)
}), i.onError(function(t) {
e(t)
}), i.enqueue()
}, g
}), define("providers/dropboxProvider", ["underscore", "utils", "storage", "settings", "classes/Provider", "eventMgr", "fileMgr", "helpers/dropboxHelper"], function(e, t, n, i, r, o, a, s) {
function l(e) {
return void 0 === e ? void 0 : e.match(/^[^\\<>:"\|?\*]+$/) ? 0 !== e.indexOf("/") ? "/" + e : e : void o.onError('"' + e + '" contains invalid characters.')
}
function c(e) {
return "sync." + p + "." + encodeURIComponent(e.toLowerCase())
}
function u(e, n, i, r) {
r = r || "{}";
var o = {};
return o.provider = f, o.path = e, o.version = n, o.contentCRC = t.crc32(i), o.discussionListCRC = t.crc32(r), o.syncIndex = c(e), h === !0 && (o.content = i, o.discussionList = r), o
}
function d(t) {
s.downloadMetadata(t, function(t, n) {
t || s.downloadContent(n, function(t, n) {
if(!t) {
var i = [];
e.each(n, function(e) {
var t = f.parseContent(e.content),
n = u(e.path, e.versionTag, t.content, t.discussionListJSON),
r = {};
r[n.syncIndex] = n;
var o = a.createFile(e.name, t.content, t.discussionListJSON, r);
a.selectFile(o), i.push(o)
}), 0 !== i.length && o.onSyncImportSuccess(i, f)
}
})
})
}
var p = "dropbox",
f = new r(p, "Dropbox");
f.defaultPublishFormat = "template";
var h = "merge" == i.conflictMode;
return f.importFiles = function() {
s.picker(function(t, n) {
if(!t && 0 !== n.length) {
var i = [];
e.each(n, function(e) {
var t = c(e),
n = a.getFileFromSyncIndex(t);
return void 0 !== n ? o.onError('"' + n.title + '" was already imported.') : void i.push(e)
}), d(i)
}
})
}, f.exportFile = function(e, n, i, r, d) {
var p = t.getInputTextValue("#input-sync-export-dropbox-path", e);
if(p = l(p), void 0 === p) return d(!0);
var h = c(p),
m = a.getFileFromSyncIndex(h);
if(void 0 !== m) {
var g = m.title;
return o.onError('File path is already synchronized with "' + g + '".'), d(!0)
}
var v = f.serializeContent(i, r);
s.upload(p, v, function(e, t) {
if(e) return d(e);
var n = u(t.path, t.versionTag, i, r);
d(void 0, n)
})
}, f.syncUp = function(e, t, n, i, r, o, a, l) {
if(a.contentCRC == t && a.discussionListCRC == o) return l(void 0, !1);
var c = f.serializeContent(e, r);
s.upload(a.path, c, function(n, s) {
return n ? l(n, !0) : (a.version = s.versionTag, h === !0 && (a.content = e, a.discussionList = r), a.contentCRC = t, a.titleCRC = i, a.discussionListCRC = o, void l(void 0, !0))
})
}, f.syncDown = function(i) {
var r = n[p + ".lastChangeId"];
s.checkChanges(r, function(r, l, u) {
if(r) return i(r);
var d = [];
e.each(l, function(e) {
var t = c(e.path),
n = a.getFileFromSyncIndex(t),
i = n && n.syncLocations[t];
return i ? (e.fileDesc = n, e.syncAttributes = i, e.wasRemoved === !0 ? void d.push(e) : void(i.version != e.stat.versionTag && d.push(e))) : void 0
}), s.downloadContent(d, function(e, r) {
function a() {
if(0 === r.length) return n[p + ".lastChangeId"] = u, i();
var e = r.pop(),
s = e.fileDesc,
l = e.syncAttributes;
if(e.wasRemoved === !0) return o.onError('"' + s.title + '" has been removed from Dropbox.'), s.removeSyncLocation(l), o.onSyncRemoved(s, l);
var c = e.stat,
d = f.parseContent(c.content),
m = d.content,
g = d.discussionListJSON,
v = d.discussionList,
b = f.syncMerge(s, l, m, s.title, v, g);
l.version = c.versionTag, h === !0 && (l.content = m, l.discussionList = v), l.contentCRC = b.contentCRC, l.discussionListCRC = b.discussionListCRC, t.storeAttributes(l), setTimeout(a, 5)
}
return e ? void i(e) : void setTimeout(a, 5)
})
})
}, f.publish = function(e, t, n, i, r) {
var o = l(e.path);
return void 0 === o ? r(!0) : void s.upload(o, i, r)
}, f.newPublishAttributes = function(e) {
var n = {};
return n.path = t.getInputTextValue("#input-publish-dropbox-path", e), e.isPropagationStopped() ? void 0 : n
}, f
}), define("helpers/googleHelper", ["underscore", "jquery", "constants", "core", "utils", "storage", "logger", "settings", "eventMgr", "classes/AsyncTask"], function(e, t, n, i, r, o, a, s, l, c) {
function u(t) {
var n = {
profile: !0
}, i = !0;
e.each((o[t + ".permissions"] || "").split(";"), function(e) {
e && (n[e] = !0)
}), this.setRefreshFlag = function() {
i = !0
}, this.isAuthorized = function(t) {
return i === !1 && e.has(n, t)
}, this.add = function(r) {
n[r] = !0, o[t + ".permissions"] = e.keys(n).join(";"), i = !1
}, this.getListWithNew = function(t) {
var i = e.keys(n);
return e.has(n, t) || i.push(t), i
};
var r = o[t + ".userId"];
this.setUserId = function(e) {
r = e, o[t + ".userId"] = r
}, this.getUserId = function() {
return r
}
}
function d(e) {
e.onRun(function() {
return y === !0 ? (g = !1, void e.error(new Error("Operation not available in offline mode.|stopPublish"))) : g === !0 ? void e.chain() : (window.delayedFunction = function() {
gapi.load("client", function() {
gapi.client.load("drive", "v2", function() {
g = !0, e.chain()
})
})
}, void t.ajax({
url: "https://apis.google.com/js/api.js?onload=runDelayedFunction",
dataType: "script",
timeout: n.AJAX_TIMEOUT
}).fail(function(t) {
var n = {
code: t.status,
message: t.statusText
};
h(n, e)
}))
})
}
function p(i, o, a) {
var s = v[a];
s || (s = new u(a), v[a] = s), i.onRun(function() {
function a() {
t.ajax({
url: "https://www.googleapis.com/oauth2/v1/tokeninfo",
data: {
access_token: d.access_token
},
timeout: n.AJAX_TIMEOUT,
type: "GET"
}).done(function(e) {
s.getUserId() && s.getUserId() != e.user_id ? u() : (s.setUserId(e.user_id), s.add(o), s.token = d, i.chain())
}).fail(function(e) {
var t = {
code: e.status,
message: e.statusText
};
h(t, i)
})
}
function l() {
if(m > 5) return void i.error(new Error("Unable to authenticate user " + s.getUserId() + ", please sign in with Google."));
p === !1 && (i.timeout = n.ASYNC_TASK_LONG_TIMEOUT);
var t = e.chain(x).pick(s.getListWithNew(o)).flatten().value();
gapi.auth.authorize({
client_id: n.GOOGLE_CLIENT_ID,
scope: t,
immediate: p,
authuser: p === !1 ? "" : m
}, function(e) {
d = gapi.auth.getToken(), gapi.auth.setToken(f), !e || e.error ? g === !0 && p === !0 ? (p = !1, i.chain(c)) : i.error(new Error("Access to Google account is not authorized.")) : (p === !0 && m++, i.chain(a))
})
}
function c() {
return p === !0 ? void i.chain(l) : void r.redirectConfirm("You are being redirected to Google authorization page.", function() {
i.chain(l)
}, function() {
i.error(new Error("Operation canceled."))
})
}
function u() {
return p = !0, s.token && s.isAuthorized(o) ? void i.chain() : (s.getUserId() || (p = !1), void i.chain(c))
}
var d, p, f = gapi.auth.getToken(),
m = 0;
u()
})
}
function f(e, t) {
var n = gapi.auth.getToken(),
i = v[e];
gapi.auth.setToken(i.token), t(), gapi.auth.setToken(n)
}
function h(t, n) {
var r;
if(t)
if(a.error(t), "string" == typeof t) r = t;
else {
if(r = "Google error (" + t.code + ": " + t.message + ").", t.code >= 500 && t.code < 600) return void n.retry(new Error(r));
if(401 === t.code || 403 === t.code || "token_refresh_required" == t.code) return e.each(v, function(e) {
e.setRefreshFlag()
}), r = "Access to Google account is not authorized.", void n.retry(new Error(r), 1);
(0 === t.code || -1 === t.code) && (g = !1, e.each(v, function(e) {
e.setRefreshFlag()
}), i.setOffline(), r = "|stopPublish")
}
n.error(new Error(r))
}
function m(e) {
e.onRun(function() {
return w === !0 ? void e.chain() : void t.ajax({
url: "//www.google.com/jsapi",
data: {
key: n.GOOGLE_API_KEY
},
dataType: "script",
timeout: n.AJAX_TIMEOUT
}).done(function() {
google.load("picker", "1", {
callback: function() {
e.chain()
}
}), w = !0
}).fail(function(t) {
var n = {
code: t.status,
message: t.statusText
};
h(n, e)
})
})
}
var g = !1,
v = {}, b = {}, y = !1;
l.addListener("onOfflineChanged", function(e) {
y = e
});
var x = {
profile: ["https://www.googleapis.com/auth/userinfo.profile"],
gdrive: ["https://www.googleapis.com/auth/drive.install", s.gdriveFullAccess === !0 ? "https://www.googleapis.com/auth/drive" : "https://www.googleapis.com/auth/drive.file"],
blogger: ["https://www.googleapis.com/auth/blogger"],
picasa: ["https://www.googleapis.com/auth/photos"]
};
b.refreshGdriveToken = function(e) {
var t = new c;
d(t);
var n = v[e];
n && n.setRefreshFlag(), p(t, "gdrive", e), t.enqueue()
}, b.upload = function(e, t, n, i, a, l, u, m) {
var g, v = new c;
d(v), p(v, "gdrive", u), v.onRun(function() {
var l = "-------314159265358979323846",
c = "\r\n--" + l + "\r\n",
d = "\r\n--" + l + "--";
a = a || s.markdownMimeType;
var p = {
title: n,
mimeType: a
};
t && (p.parents = [{
kind: "drive#fileLink",
id: t
}]);
var m = "/upload/drive/v2/files",
b = "POST";
e && (m += "/" + e, b = "PUT");
var y = {
"Content-Type": 'multipart/mixed; boundary="' + l + '"'
}, x = r.encodeBase64(i),
w = [c, "Content-Type: application/json\r\n\r\n", JSON.stringify(p), c, "Content-Type: ", a, "\r\n", "Content-Transfer-Encoding: base64\r\n", "\r\n", x, d].join("");
f(u, function() {
var t = gapi.client.request({
path: m,
method: b,
params: {
uploadType: "multipart"
},
headers: y,
body: w
});
t.execute(function(t) {
if(t && t.id) return g = t, g.content = i, void v.chain();
var n = t.error;
void 0 !== n && void 0 !== e && (404 === n.code ? n = 'File ID "' + e + '" not found on Google Drive.|removePublish' : 412 === n.code && (o.removeItem(u + ".gdrive.lastChangeId"), n = 'Conflict on file ID "' + e + '". Please restart the synchronization.')), h(n, v)
})
})
}), v.onSuccess(function() {
m(void 0, g)
}), v.onError(function(e) {
m(e)
}), v.enqueue()
}, b.rename = function(e, t, n, i) {
var r, o = new c;
d(o), p(o, "gdrive", n), o.onRun(function() {
var i = {
title: t
};
f(n, function() {
var t = gapi.client.drive.files.patch({
fileId: e,
resource: i
});
t.execute(function(t) {
if(t && t.id) return r = t, void o.chain();
var n = t.error;
void 0 !== n && void 0 !== e && 404 === n.code && (n = 'File ID "' + e + '" not found on Google Drive.|removePublish'), h(n, o)
})
})
}), o.onSuccess(function() {
i(void 0, r)
}), o.onError(function(e) {
i(e)
}), o.enqueue()
}, b.checkChanges = function(e, t, n) {
var i = [],
r = e || 0,
o = new c;
d(o), p(o, "gdrive", t), o.onRun(function() {
function e() {
f(t, function() {
var t;
t = gapi.client.drive.changes.list(void 0 === n ? {
startChangeId: r + 1
} : {
pageToken: n
}), t.execute(function(t) {
return t && t.largestChangeId ? (r = t.largestChangeId, n = t.nextPageToken, void 0 !== t.items && (i = i.concat(t.items)), void(void 0 !== n ? o.chain(e) : o.chain())) : void h(t.error, o)
})
})
}
var n;
o.chain(e)
}), o.onSuccess(function() {
n(void 0, i, r)
}), o.onError(function(e) {
n(e)
}), o.enqueue()
}, b.downloadMetadata = function(e, i, r, o) {
var a = [],
s = new c;
d(s), o || p(s, "gdrive", i), s.onRun(function() {
function r() {
if(0 === e.length) return void s.chain();
var o = e[0],
l = {}, c = v[i];
c && c.token && (l.Authorization = "Bearer " + c.token.access_token), t.ajax({
url: "https://www.googleapis.com/drive/v2/files/" + o,
headers: l,
data: {
key: n.GOOGLE_API_KEY
},
dataType: "json",
timeout: n.AJAX_TIMEOUT
}).done(function(t) {
a.push(t), e.shift(), s.chain(r)
}).fail(function(e) {
var t = {
code: e.status,
message: e.statusText
};
404 === t.code && (t = 'File ID "' + o + '" not found on Google Drive.'), h(t, s)
})
}
s.chain(r)
}), s.onSuccess(function() {
r(void 0, a)
}), s.onError(function(e) {
r(e)
}), s.enqueue()
}, b.downloadContent = function(e, i, r, o) {
var a = [],
s = new c;
s.timeout = n.ASYNC_TASK_LONG_TIMEOUT, d(s), o || p(s, "gdrive", i), s.onRun(function() {
function r() {
if(0 === e.length) return void s.chain();
var o = e[0];
a.push(o);
var l;
if("drive#file" == o.kind ? l = o : "drive#change" == o.kind && (l = o.file), !l) return e.shift(), void s.chain(r);
var c = l.downloadUrl;
0 === l.mimeType.indexOf("application/vnd.google-apps.drive-sdk") && (l.isRealtime = !0, c = "https://www.googleapis.com/drive/v2/files/" + l.id + "/realtime");
var u = {}, d = v[i];
d && d.token && (u.Authorization = "Bearer " + d.token.access_token), t.ajax({
url: c,
headers: u,
data: {
key: n.GOOGLE_API_KEY
},
dataType: l.isRealtime ? "json" : "text",
timeout: n.AJAX_TIMEOUT
}).done(function(t) {
l.content = l.isRealtime ? t.data.value.content.value : t, e.shift(), s.chain(r)
}).fail(function(e) {
var t = {
code: e.status,
message: e.statusText
};
h(t, s)
})
}
s.chain(r)
}), s.onSuccess(function() {
r(void 0, a)
}), s.onError(function(e) {
r(e)
}), s.enqueue()
}, b.uploadImg = function(e, i, r, o) {
var a, s = "google.picasa0",
l = new c;
d(l), p(l, "picasa", s), l.onRun(function() {
var o = {
Slug: e
};
e.match(/.jpe?g$/i) ? o["Content-Type"] = "image/jpeg" : e.match(/.png$/i) ? o["Content-Type"] = "image/png" : e.match(/.gif$/i) && (o["Content-Type"] = "image/gif");
var c = v[s];
c && c.token && (o.Authorization = "Bearer " + c.token.access_token), t.ajax({
url: n.PICASA_PROXY_URL + "upload/" + r,
headers: o,
data: i,
processData: !1,
dataType: "xml",
timeout: n.AJAX_TIMEOUT,
type: "POST"
}).done(function(e) {
a = e, l.chain()
}).fail(function(e) {
var t = {
code: e.status,
message: e.statusText
};
200 == t.code && (t.message = e.responseText), h(t, l)
})
}), l.onSuccess(function() {
o(void 0, a)
}), l.onError(function(e) {
o(e)
}), l.enqueue()
};
var w = !1;
return b.picker = function(e, i, o) {
function a() {
void 0 !== s && (s.setVisible(!1), t(".modal-backdrop, .picker").remove())
}
var s, l = [],
u = new c;
u.timeout = n.ASYNC_TASK_LONG_TIMEOUT, d(u), "doc" == i || "folder" == i ? p(u, "gdrive", o) : (o = "google.picasa0", p(u, "picasa", o)), m(u), u.onRun(function() {
var e = v[o],
c = new google.picker.PickerBuilder;
c.setAppId(n.GOOGLE_DRIVE_APP_ID);
var d;
"doc" == i ? (d = new google.picker.DocsView(google.picker.ViewId.DOCS), d.setParent("root"), d.setIncludeFolders(!0), d.setMimeTypes(["text/x-markdown", "text/plain", "application/octet-stream", "application/vnd.google-apps.drive-sdk." + n.GOOGLE_DRIVE_APP_ID].join(",")), c.enableFeature(google.picker.Feature.NAV_HIDDEN), c.enableFeature(google.picker.Feature.MULTISELECT_ENABLED), c.addView(d), e && e.token && c.setOAuthToken(e.token.access_token)) : "folder" == i ? (d = new google.picker.DocsView(google.picker.ViewId.FOLDERS), d.setParent("root"), d.setIncludeFolders(!0), d.setSelectFolderEnabled(!0), d.setMimeTypes("application/vnd.google-apps.folder"), c.enableFeature(google.picker.Feature.NAV_HIDDEN), c.addView(d), e && e.token && c.setOAuthToken(e.token.access_token)) : "img" == i && (d = new google.picker.PhotosView, d.setType("flat"), c.addView(d), d = new google.picker.PhotosView, d.setType("ofuser"), c.addView(d), c.addView(google.picker.ViewId.PHOTO_UPLOAD), e && e.token && c.setOAuthToken(e.token.access_token)), c.setCallback(function(e) {
(e.action == google.picker.Action.PICKED || e.action == google.picker.Action.CANCEL) && (e.action == google.picker.Action.PICKED && (l = e.docs), a(), u.chain())
}), s = c.build(), t(r.createBackdrop()).click(function() {
a(), u.chain()
}), s.setVisible(!0)
}), u.onSuccess(function() {
e(void 0, l)
}), u.onError(function(t) {
a(), e(t)
}), u.enqueue()
}, b.uploadBlogger = function(e, i, r, o, a, s, l, u, f) {
var m = "google.blogger0",
g = new c;
d(g), p(g, "blogger", m), g.onRun(function() {
function c() {
var e = "https://www.googleapis.com/blogger/v3/blogs/" + i + "/posts/",
a = {
kind: "blogger#post",
blog: {
id: i
},
labels: o,
title: l,
content: u
};
s && (a.published = s.toISOString());
var c = "POST";
void 0 !== r && (e += r, a.id = r, c = "PUT"), t.ajax({
url: e,
data: JSON.stringify(a),
headers: f,
type: c,
contentType: "application/json",
dataType: "json",
timeout: n.AJAX_TIMEOUT
}).done(function(e) {
r = e.id, g.chain(d)
}).fail(function(e) {
var t = {
code: e.status,
message: e.statusText
};
404 === t.code && void 0 !== r && (t = "Post " + r + " not found on Blogger.|removePublish"), h(t, g)
})
}
function d() {
var e = "https://www.googleapis.com/blogger/v3/blogs/" + i + "/posts/" + r;
a ? e += "/revert" : (e += "/publish", s && (e += "?publishDate=" + s.toISOString())), t.ajax({
url: e,
headers: f,
type: "POST",
dataType: "json",
timeout: n.AJAX_TIMEOUT
}).done(function() {
g.chain()
}).fail(function(e) {
var t = {
code: e.status,
message: e.statusText
};
404 === t.code && (t = "Post " + r + " not found on Blogger.|removePublish"), h(t, g)
})
}
function p() {
return void 0 !== i ? void g.chain(c) : void t.ajax({
url: "https://www.googleapis.com/blogger/v3/blogs/byurl",
data: {
url: e
},
headers: f,
dataType: "json",
timeout: n.AJAX_TIMEOUT
}).done(function(e) {
i = e.id, g.chain(c)
}).fail(function(t) {
var n = {
code: t.status,
message: t.statusText
};
404 === n.code && (n = 'Blog "' + e + '" not found on Blogger.|removePublish'), h(n, g)
})
}
var f = {}, b = v[m];
b && b.token && (f.Authorization = "Bearer " + b.token.access_token), g.chain(p)
}), g.onSuccess(function() {
f(void 0, i, r)
}), g.onError(function(e) {
f(e)
}), g.enqueue()
}, b.uploadBloggerPage = function(e, i, r, o, a, s, l, u) {
var f = "google.blogger0",
m = new c;
d(m), p(m, "blogger", f), m.onRun(function() {
function o() {
var e = "https://www.googleapis.com/blogger/v3/blogs/" + i + "/pages/",
o = {
kind: "blogger#page",
blog: {
id: i
},
title: s,
content: l
}, a = "POST";
void 0 !== r && (e += r, o.id = r, a = "PUT"), t.ajax({
url: e,
data: JSON.stringify(o),
headers: c,
type: a,
contentType: "application/json",
dataType: "json",
timeout: n.AJAX_TIMEOUT
}).done(function(e) {
r = e.id, m.chain()
}).fail(function(e) {
var t = {
code: e.status,
message: e.statusText
};
404 === t.code && void 0 !== r && (t = "Page " + r + " not found on Blogger.|removePublish"), h(t, m)
})
}
function a() {
return void 0 !== i ? void m.chain(o) : void t.ajax({
url: "https://www.googleapis.com/blogger/v3/blogs/byurl",
data: {
url: e
},
headers: c,
dataType: "json",
timeout: n.AJAX_TIMEOUT
}).done(function(e) {
i = e.id, m.chain(o)
}).fail(function(t) {
var n = {
code: t.status,
message: t.statusText
};
404 === n.code && (n = 'Blog "' + e + '" not found on Blogger.|removePublish'), h(n, m)
})
}
var c = {}, u = v[f];
u && u.token && (c.Authorization = "Bearer " + u.token.access_token), m.chain(a)
}), m.onSuccess(function() {
u(void 0, i, r)
}), m.onError(function(e) {
u(e)
}), m.enqueue()
}, window.delayedFunction = void 0, window.runDelayedFunction = function() {
void 0 !== window.delayedFunction && window.delayedFunction()
}, b
}), define("text!html/dialogExportGdrive.html", [], function() {
return '
\n
\n\n
\n \n
Save on <%= providerName %>
\n
\n
\n
\n This will save "" to your \n Google Drive\n account and keep it synchronized.\n
\n
\n
\n \n
\n
\n \n
\n \n
\n
\n If no folder ID is supplied, the\n file will be created in your root folder. \n
\n
\n
\n \n
\n This will overwrite the existing file\n on the server. \n