Stackedit/res-min/main.js
2013-09-22 23:16:59 +01:00

25699 lines
1.1 MiB
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*!
* 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
*/
// 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.
/*
* Based on code from:
*
* XRegExp 1.5.0
* (c) 2007-2010 Steven Levithan
* MIT License
* <http://xregexp.com>
* Provides an augmented, extensible, cross-browser implementation of regular expressions,
* including support for additional syntax, flags, and methods
*/
// https://github.com/kriskowal/es5-shim
// Copyright 2009-2012 by contributors, MIT License
// vim:set ts=4 sts=4 sw=4 st:
// -- kriskowal Kris Kowal Copyright (C) 2009-2010 MIT License
// -- tlrobinson Tom Robinson Copyright (C) 2009-2010 MIT License (Narwhal Project)
// -- dantman Daniel Friesen Copyright(C) 2010 XXX No License Specified
// -- fschaefer Florian Schäfer Copyright (C) 2010 MIT License
// -- Irakli Gozalishvili Copyright (C) 2010 MIT License
/*!
Copyright (c) 2009, 280 North Inc. http://280north.com/
MIT License. http://github.com/280north/narwhal/blob/master/README.md
*/
/* ***** BEGIN LICENSE BLOCK *****
* Distributed under the BSD license:
*
* Copyright (c) 2010, Ajax.org B.V.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of Ajax.org B.V. nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* ***** END LICENSE BLOCK ***** */
/*! @license
==========================================================================
SproutCore -- JavaScript Application Framework
copyright 2006-2009, Sprout Systems Inc., Apple Inc. and contributors.
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.
SproutCore and the SproutCore logo are trademarks of Sprout Systems, Inc.
For more information about SproutCore, visit http://www.sproutcore.com
==========================================================================
@license */
/* ***** BEGIN LICENSE BLOCK *****
* Distributed under the BSD license:
*
* Copyright (c) 2010, Ajax.org B.V.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of Ajax.org B.V. nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* ***** END LICENSE BLOCK ***** */
/*
* based on code from:
*
* @license RequireJS text 0.25.0 Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved.
* Available via the MIT or new BSD license.
* see: http://github.com/jrburke/requirejs for details
*/
/*
XRegExp Unicode plugin pack: Categories 1.0
(c) 2010 Steven Levithan
MIT License
<http://xregexp.com>
Uses the Unicode 5.2 character database
This package for the XRegExp Unicode plugin enables the following Unicode categories (aka properties):
L - Letter (the top-level Letter category is included in the Unicode plugin base script)
Ll - Lowercase letter
Lu - Uppercase letter
Lt - Titlecase letter
Lm - Modifier letter
Lo - Letter without case
M - Mark
Mn - Non-spacing mark
Mc - Spacing combining mark
Me - Enclosing mark
N - Number
Nd - Decimal digit
Nl - Letter number
No - Other number
P - Punctuation
Pd - Dash punctuation
Ps - Open punctuation
Pe - Close punctuation
Pi - Initial punctuation
Pf - Final punctuation
Pc - Connector punctuation
Po - Other punctuation
S - Symbol
Sm - Math symbol
Sc - Currency symbol
Sk - Modifier symbol
So - Other symbol
Z - Separator
Zs - Space separator
Zl - Line separator
Zp - Paragraph separator
C - Other
Cc - Control
Cf - Format
Co - Private use
Cs - Surrogate
Cn - Unassigned
Example usage:
\p{N}
\p{Cn}
*/
/*! @source http://purl.eligrey.com/github/FileSaver.js/blob/master/FileSaver.js */
/**
* @license RequireJS text 2.0.10 Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved.
* Available via the MIT or new BSD license.
* see: http://github.com/requirejs/text for details
*/
/*
* 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.5
* @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 <stosh1985@gmail.com>
* 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
*/
// 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.
/**
* bootstrap.js v3.0.0 by @fat and @mdo
* Copyright 2013 Twitter Inc.
* http://www.apache.org/licenses/LICENSE-2.0
*/
/* ========================================================================
* Bootstrap: transition.js v3.0.0
* http://twbs.github.com/bootstrap/javascript.html#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.0
* http://twbs.github.com/bootstrap/javascript.html#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.0
* http://twbs.github.com/bootstrap/javascript.html#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.0
* http://twbs.github.com/bootstrap/javascript.html#carousel
* ========================================================================
* Copyright 2012 Twitter, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* ======================================================================== */
/* ========================================================================
* Bootstrap: collapse.js v3.0.0
* http://twbs.github.com/bootstrap/javascript.html#collapse
* ========================================================================
* Copyright 2012 Twitter, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* ======================================================================== */
/* ========================================================================
* Bootstrap: dropdown.js v3.0.0
* http://twbs.github.com/bootstrap/javascript.html#dropdowns
* ========================================================================
* Copyright 2012 Twitter, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* ======================================================================== */
/* ========================================================================
* Bootstrap: modal.js v3.0.0
* http://twbs.github.com/bootstrap/javascript.html#modals
* ========================================================================
* Copyright 2012 Twitter, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* ======================================================================== */
/* ========================================================================
* Bootstrap: tooltip.js v3.0.0
* http://twbs.github.com/bootstrap/javascript.html#tooltip
* Inspired by the original jQuery.tipsy by Jason Frame
* ========================================================================
* Copyright 2012 Twitter, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* ======================================================================== */
/* ========================================================================
* Bootstrap: popover.js v3.0.0
* http://twbs.github.com/bootstrap/javascript.html#popovers
* ========================================================================
* Copyright 2012 Twitter, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* ======================================================================== */
/* ========================================================================
* Bootstrap: scrollspy.js v3.0.0
* http://twbs.github.com/bootstrap/javascript.html#scrollspy
* ========================================================================
* Copyright 2012 Twitter, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* ======================================================================== */
/* ========================================================================
* Bootstrap: tab.js v3.0.0
* http://twbs.github.com/bootstrap/javascript.html#tabs
* ========================================================================
* Copyright 2012 Twitter, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* ======================================================================== */
/* ========================================================================
* Bootstrap: affix.js v3.0.0
* http://twbs.github.com/bootstrap/javascript.html#affix
* ========================================================================
* Copyright 2012 Twitter, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* ======================================================================== */
/* ===========================================================
# bootstrap-tour - v0.6.1
# 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.
*/
/*!
* jQuery UI Core 1.10.3
* http://jqueryui.com
*
* Copyright 2013 jQuery Foundation and other contributors
* Released under the MIT license.
* http://jquery.org/license
*
* http://api.jqueryui.com/category/ui-core/
*/
/*!
* jQuery UI Widget 1.10.3
* http://jqueryui.com
*
* Copyright 2013 jQuery Foundation and other contributors
* Released under the MIT license.
* http://jquery.org/license
*
* http://api.jqueryui.com/jQuery.widget/
*/
/*!
* jQuery UI Mouse 1.10.3
* http://jqueryui.com
*
* Copyright 2013 jQuery Foundation and other contributors
* Released under the MIT license.
* http://jquery.org/license
*
* http://api.jqueryui.com/mouse/
*
* Depends:
* jquery.ui.widget.js
*/
/*!
* jQuery UI Draggable 1.10.3
* http://jqueryui.com
*
* Copyright 2013 jQuery Foundation and other contributors
* Released under the MIT license.
* http://jquery.org/license
*
* http://api.jqueryui.com/draggable/
*
* Depends:
* jquery.ui.core.js
* jquery.ui.mouse.js
* jquery.ui.widget.js
*/
/*!
* jQuery UI Effects 1.10.3
* http://jqueryui.com
*
* Copyright 2013 jQuery Foundation and other contributors
* Released under the MIT license.
* http://jquery.org/license
*
* http://api.jqueryui.com/category/effects-core/
*/
/*!
* jQuery Color Animations v2.1.2
* https://github.com/jquery/jquery-color
*
* Copyright 2013 jQuery Foundation and other contributors
* Released under the MIT license.
* http://jquery.org/license
*
* Date: Wed Jan 16 08:47:09 2013 -0600
*/
/*!
* jQuery UI Effects Slide 1.10.3
* http://jqueryui.com
*
* Copyright 2013 jQuery Foundation and other contributors
* Released under the MIT license.
* http://jquery.org/license
*
* http://api.jqueryui.com/slide-effect/
*
* Depends:
* jquery.ui.effect.js
*/
/**
* @preserve
* jquery.layout 1.3.0 - Release Candidate 30.79
* $Date: 2013-01-12 08:00:00 (Sat, 12 Jan 2013) $
* $Rev: 303007 $
*
* Copyright (c) 2013 Kevin Dalman (http://allpro.net)
* Based on work by Fabrizio Balliano (http://www.fabrizioballiano.net)
*
* Dual licensed under the GPL (http://www.gnu.org/licenses/gpl.html)
* and MIT (http://www.opensource.org/licenses/mit-license.php) licenses.
*
* SEE: http://layout.jquery-dev.net/LICENSE.txt
*
* Changelog: http://layout.jquery-dev.net/changelog.cfm#1.3.0.rc30.79
*
* Docs: http://layout.jquery-dev.net/documentation.html
* Tips: http://layout.jquery-dev.net/tips.html
* Help: http://groups.google.com/group/jquery-ui-layout
*/
/**
* jquery.layout.state 1.0
* $Date: 2011-07-16 08:00:00 (Sat, 16 July 2011) $
*
* Copyright (c) 2012
* Kevin Dalman (http://allpro.net)
*
* Dual licensed under the GPL (http://www.gnu.org/licenses/gpl.html)
* and MIT (http://www.opensource.org/licenses/mit-license.php) licenses.
*
* @requires: UI Layout 1.3.0.rc30.1 or higher
* @requires: $.ui.cookie (above)
*
* @see: http://groups.google.com/group/jquery-ui-layout
*/
/**
* jquery.layout.buttons 1.0
* $Date: 2011-07-16 08:00:00 (Sat, 16 July 2011) $
*
* Copyright (c) 2012
* Kevin Dalman (http://allpro.net)
*
* Dual licensed under the GPL (http://www.gnu.org/licenses/gpl.html)
* and MIT (http://www.opensource.org/licenses/mit-license.php) licenses.
*
* @requires: UI Layout 1.3.0.rc30.1 or higher
*
* @see: http://groups.google.com/group/jquery-ui-layout
*
* Docs: [ to come ]
* Tips: [ to come ]
*/
/**
* jquery.layout.browserZoom 1.0
* $Date: 2011-12-29 08:00:00 (Thu, 29 Dec 2011) $
*
* Copyright (c) 2012
* Kevin Dalman (http://allpro.net)
*
* Dual licensed under the GPL (http://www.gnu.org/licenses/gpl.html)
* and MIT (http://www.opensource.org/licenses/mit-license.php) licenses.
*
* @requires: UI Layout 1.3.0.rc30.1 or higher
*
* @see: http://groups.google.com/group/jquery-ui-layout
*
* TODO: Extend logic to handle other problematic zooming in browsers
* TODO: Add hotkey/mousewheel bindings to _instantly_ respond to these zoom event
*/
function printStackTrace(e) {
e = e || {
guess: !0
};
var t = e.e || null, n = !!e.guess, i = new printStackTrace.implementation(), o = i.run(t);
return n ? i.guessAnonymousFunctions(o) : o;
}
function runDelayedFunction() {
void 0 !== delayedFunction && delayedFunction();
}
(function(e, t) {
function n(e) {
var t = e.length, n = rt.type(e);
return rt.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 = ft[e] = {};
return rt.each(e.match(at) || [], function(e, n) {
t[n] = !0;
}), t;
}
function o() {
Object.defineProperty(this.cache = {}, 0, {
get: function() {
return {};
}
}), this.expando = rt.expando + Math.random();
}
function r(e, n, i) {
var o;
if (i === t && 1 === e.nodeType) if (o = "data-" + n.replace(bt, "-$1").toLowerCase(),
i = e.getAttribute(o), "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 (r) {}
gt.set(e, n, i);
} else i = t;
return i;
}
function s() {
return !0;
}
function a() {
return !1;
}
function l() {
try {
return U.activeElement;
} catch (e) {}
}
function c(e, t) {
for (;(e = e[t]) && 1 !== e.nodeType; ) ;
return e;
}
function u(e, t, n) {
if (rt.isFunction(t)) return rt.grep(e, function(e, i) {
return !!t.call(e, i, e) !== n;
});
if (t.nodeType) return rt.grep(e, function(e) {
return e === t !== n;
});
if ("string" == typeof t) {
if (_t.test(t)) return rt.filter(t, e, n);
t = rt.filter(t, e);
}
return rt.grep(e, function(e) {
return tt.call(t, e) >= 0 !== n;
});
}
function d(e, t) {
return rt.nodeName(e, "table") && rt.nodeName(1 === t.nodeType ? t : t.firstChild, "tr") ? e.getElementsByTagName("tbody")[0] || e.appendChild(e.ownerDocument.createElement("tbody")) : e;
}
function h(e) {
return e.type = (null !== e.getAttribute("type")) + "/" + e.type, e;
}
function p(e) {
var t = Ot.exec(e.type);
return t ? e.type = t[1] : e.removeAttribute("type"), e;
}
function f(e, t) {
for (var n = e.length, i = 0; n > i; i++) mt.set(e[i], "globalEval", !t || mt.get(t[i], "globalEval"));
}
function g(e, t) {
var n, i, o, r, s, a, l, c;
if (1 === t.nodeType) {
if (mt.hasData(e) && (r = mt.access(e), s = mt.set(t, r), c = r.events)) {
delete s.handle, s.events = {};
for (o in c) for (n = 0, i = c[o].length; i > n; n++) rt.event.add(t, o, c[o][n]);
}
gt.hasData(e) && (a = gt.access(e), l = rt.extend({}, a), gt.set(t, l));
}
}
function m(e, n) {
var i = e.getElementsByTagName ? e.getElementsByTagName(n || "*") : e.querySelectorAll ? e.querySelectorAll(n || "*") : [];
return n === t || n && rt.nodeName(e, n) ? rt.merge([ e ], i) : i;
}
function v(e, t) {
var n = t.nodeName.toLowerCase();
"input" === n && It.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, o = Qt.length; o--; ) if (t = Qt[o] + n,
t in e) return t;
return i;
}
function y(e, t) {
return e = t || e, "none" === rt.css(e, "display") || !rt.contains(e.ownerDocument, e);
}
function w(t) {
return e.getComputedStyle(t, null);
}
function C(e, t) {
for (var n, i, o, r = [], s = 0, a = e.length; a > s; s++) i = e[s], i.style && (r[s] = mt.get(i, "olddisplay"),
n = i.style.display, t ? (r[s] || "none" !== n || (i.style.display = ""), "" === i.style.display && y(i) && (r[s] = mt.access(i, "olddisplay", A(i.nodeName)))) : r[s] || (o = y(i),
(n && "none" !== n || !o) && mt.set(i, "olddisplay", o ? n : rt.css(i, "display"))));
for (s = 0; a > s; s++) i = e[s], i.style && (t && "none" !== i.style.display && "" !== i.style.display || (i.style.display = t ? r[s] || "" : "none"));
return e;
}
function x(e, t, n) {
var i = Gt.exec(t);
return i ? Math.max(0, i[1] - (n || 0)) + (i[2] || "px") : t;
}
function E(e, t, n, i, o) {
for (var r = n === (i ? "border" : "content") ? 4 : "width" === t ? 1 : 0, s = 0; 4 > r; r += 2) "margin" === n && (s += rt.css(e, n + Zt[r], !0, o)),
i ? ("content" === n && (s -= rt.css(e, "padding" + Zt[r], !0, o)), "margin" !== n && (s -= rt.css(e, "border" + Zt[r] + "Width", !0, o))) : (s += rt.css(e, "padding" + Zt[r], !0, o),
"padding" !== n && (s += rt.css(e, "border" + Zt[r] + "Width", !0, o)));
return s;
}
function S(e, t, n) {
var i = !0, o = "width" === t ? e.offsetWidth : e.offsetHeight, r = w(e), s = rt.support.boxSizing && "border-box" === rt.css(e, "boxSizing", !1, r);
if (0 >= o || null == o) {
if (o = Ht(e, t, r), (0 > o || null == o) && (o = e.style[t]), Vt.test(o)) return o;
i = s && (rt.support.boxSizingReliable || o === e.style[t]), o = parseFloat(o) || 0;
}
return o + E(e, t, n || (s ? "border" : "content"), i, r) + "px";
}
function A(e) {
var t = U, n = Xt[e];
return n || (n = k(e, t), "none" !== n && n || (qt = (qt || rt("<iframe frameborder='0' width='0' height='0'/>").css("cssText", "display:block !important")).appendTo(t.documentElement),
t = (qt[0].contentWindow || qt[0].contentDocument).document, t.write("<!doctype html><html><body>"),
t.close(), n = k(e, t), qt.detach()), Xt[e] = n), n;
}
function k(e, t) {
var n = rt(t.createElement(e)).appendTo(t.body), i = rt.css(n[0], "display");
return n.remove(), i;
}
function F(e, t, n, i) {
var o;
if (rt.isArray(t)) rt.each(t, function(t, o) {
n || tn.test(e) ? i(e, o) : F(e + "[" + ("object" == typeof o ? t : "") + "]", o, n, i);
}); else if (n || "object" !== rt.type(t)) i(e, t); else for (o in t) F(e + "[" + o + "]", t[o], n, i);
}
function _(e) {
return function(t, n) {
"string" != typeof t && (n = t, t = "*");
var i, o = 0, r = t.toLowerCase().match(at) || [];
if (rt.isFunction(n)) for (;i = r[o++]; ) "+" === i[0] ? (i = i.slice(1) || "*",
(e[i] = e[i] || []).unshift(n)) : (e[i] = e[i] || []).push(n);
};
}
function $(e, t, n, i) {
function o(a) {
var l;
return r[a] = !0, rt.each(e[a] || [], function(e, a) {
var c = a(t, n, i);
return "string" != typeof c || s || r[c] ? s ? !(l = c) : void 0 : (t.dataTypes.unshift(c),
o(c), !1);
}), l;
}
var r = {}, s = e === yn;
return o(t.dataTypes[0]) || !r["*"] && o("*");
}
function T(e, n) {
var i, o, r = rt.ajaxSettings.flatOptions || {};
for (i in n) n[i] !== t && ((r[i] ? e : o || (o = {}))[i] = n[i]);
return o && rt.extend(!0, e, o), e;
}
function D(e, n, i) {
for (var o, r, s, a, l = e.contents, c = e.dataTypes; "*" === c[0]; ) c.shift(),
o === t && (o = e.mimeType || n.getResponseHeader("Content-Type"));
if (o) for (r in l) if (l[r] && l[r].test(o)) {
c.unshift(r);
break;
}
if (c[0] in i) s = c[0]; else {
for (r in i) {
if (!c[0] || e.converters[r + " " + c[0]]) {
s = r;
break;
}
a || (a = r);
}
s = s || a;
}
return s ? (s !== c[0] && c.unshift(s), i[s]) : void 0;
}
function L(e, t, n, i) {
var o, r, s, a, l, c = {}, u = e.dataTypes.slice();
if (u[1]) for (s in e.converters) c[s.toLowerCase()] = e.converters[s];
for (r = u.shift(); r; ) if (e.responseFields[r] && (n[e.responseFields[r]] = t),
!l && i && e.dataFilter && (t = e.dataFilter(t, e.dataType)), l = r, r = u.shift()) if ("*" === r) r = l; else if ("*" !== l && l !== r) {
if (s = c[l + " " + r] || c["* " + r], !s) for (o in c) if (a = o.split(" "), a[1] === r && (s = c[l + " " + a[0]] || c["* " + a[0]])) {
s === !0 ? s = c[o] : c[o] !== !0 && (r = a[0], u.unshift(a[1]));
break;
}
if (s !== !0) if (s && e["throws"]) t = s(t); else try {
t = s(t);
} catch (d) {
return {
state: "parsererror",
error: s ? d : "No conversion from " + l + " to " + r
};
}
}
return {
state: "success",
data: t
};
}
function B() {
return setTimeout(function() {
_n = t;
}), _n = rt.now();
}
function M(e, t, n) {
for (var i, o = (Mn[t] || []).concat(Mn["*"]), r = 0, s = o.length; s > r; r++) if (i = o[r].call(n, t, e)) return i;
}
function R(e, t, n) {
var i, o, r = 0, s = Bn.length, a = rt.Deferred().always(function() {
delete l.elem;
}), l = function() {
if (o) return !1;
for (var t = _n || B(), n = Math.max(0, c.startTime + c.duration - t), i = n / c.duration || 0, r = 1 - i, s = 0, l = c.tweens.length; l > s; s++) c.tweens[s].run(r);
return a.notifyWith(e, [ c, r, n ]), 1 > r && l ? n : (a.resolveWith(e, [ c ]),
!1);
}, c = a.promise({
elem: e,
props: rt.extend({}, t),
opts: rt.extend(!0, {
specialEasing: {}
}, n),
originalProperties: t,
originalOptions: n,
startTime: _n || B(),
duration: n.duration,
tweens: [],
createTween: function(t, n) {
var i = rt.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 (o) return this;
for (o = !0; i > n; n++) c.tweens[n].run(1);
return t ? a.resolveWith(e, [ c, t ]) : a.rejectWith(e, [ c, t ]), this;
}
}), u = c.props;
for (I(u, c.opts.specialEasing); s > r; r++) if (i = Bn[r].call(c, e, u, c.opts)) return i;
return rt.map(u, M, c), rt.isFunction(c.opts.start) && c.opts.start.call(e, c),
rt.fx.timer(rt.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 I(e, t) {
var n, i, o, r, s;
for (n in e) if (i = rt.camelCase(n), o = t[i], r = e[n], rt.isArray(r) && (o = r[1],
r = e[n] = r[0]), n !== i && (e[i] = r, delete e[n]), s = rt.cssHooks[i], s && "expand" in s) {
r = s.expand(r), delete e[i];
for (n in r) n in e || (e[n] = r[n], t[n] = o);
} else t[i] = o;
}
function P(e, n, i) {
var o, r, s, a, l, c, u = this, d = {}, h = e.style, p = e.nodeType && y(e), f = mt.get(e, "fxshow");
i.queue || (l = rt._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--, rt.queue(e, "fx").length || l.empty.fire();
});
})), 1 === e.nodeType && ("height" in n || "width" in n) && (i.overflow = [ h.overflow, h.overflowX, h.overflowY ],
"inline" === rt.css(e, "display") && "none" === rt.css(e, "float") && (h.display = "inline-block")),
i.overflow && (h.overflow = "hidden", u.always(function() {
h.overflow = i.overflow[0], h.overflowX = i.overflow[1], h.overflowY = i.overflow[2];
}));
for (o in n) if (r = n[o], Tn.exec(r)) {
if (delete n[o], s = s || "toggle" === r, r === (p ? "hide" : "show")) {
if ("show" !== r || !f || f[o] === t) continue;
p = !0;
}
d[o] = f && f[o] || rt.style(e, o);
}
if (!rt.isEmptyObject(d)) {
f ? "hidden" in f && (p = f.hidden) : f = mt.access(e, "fxshow", {}), s && (f.hidden = !p),
p ? rt(e).show() : u.done(function() {
rt(e).hide();
}), u.done(function() {
var t;
mt.remove(e, "fxshow");
for (t in d) rt.style(e, t, d[t]);
});
for (o in d) a = M(p ? f[o] : 0, o, u), o in f || (f[o] = a.start, p && (a.end = a.start,
a.start = "width" === o || "height" === o ? 1 : 0));
}
}
function N(e, t, n, i, o) {
return new N.prototype.init(e, t, n, i, o);
}
function O(e, t) {
var n, i = {
height: e
}, o = 0;
for (t = t ? 1 : 0; 4 > o; o += 2 - t) n = Zt[o], i["margin" + n] = i["padding" + n] = e;
return t && (i.opacity = i.width = e), i;
}
function z(e) {
return rt.isWindow(e) ? e : 9 === e.nodeType && e.defaultView;
}
var j, H, q = typeof t, W = e.location, U = e.document, G = U.documentElement, V = e.jQuery, K = e.$, X = {}, Y = [], J = "2.0.3", Z = Y.concat, Q = Y.push, et = Y.slice, tt = Y.indexOf, nt = X.toString, it = X.hasOwnProperty, ot = J.trim, rt = function(e, t) {
return new rt.fn.init(e, t, j);
}, st = /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source, at = /\S+/g, lt = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/, ct = /^<(\w+)\s*\/?>(?:<\/\1>|)$/, ut = /^-ms-/, dt = /-([\da-z])/gi, ht = function(e, t) {
return t.toUpperCase();
}, pt = function() {
U.removeEventListener("DOMContentLoaded", pt, !1), e.removeEventListener("load", pt, !1),
rt.ready();
};
rt.fn = rt.prototype = {
jquery: J,
constructor: rt,
init: function(e, n, i) {
var o, r;
if (!e) return this;
if ("string" == typeof e) {
if (o = "<" === e.charAt(0) && ">" === e.charAt(e.length - 1) && e.length >= 3 ? [ null, e, null ] : lt.exec(e),
!o || !o[1] && n) return !n || n.jquery ? (n || i).find(e) : this.constructor(n).find(e);
if (o[1]) {
if (n = n instanceof rt ? n[0] : n, rt.merge(this, rt.parseHTML(o[1], n && n.nodeType ? n.ownerDocument || n : U, !0)),
ct.test(o[1]) && rt.isPlainObject(n)) for (o in n) rt.isFunction(this[o]) ? this[o](n[o]) : this.attr(o, n[o]);
return this;
}
return r = U.getElementById(o[2]), r && r.parentNode && (this.length = 1, this[0] = r),
this.context = U, this.selector = e, this;
}
return e.nodeType ? (this.context = this[0] = e, this.length = 1, this) : rt.isFunction(e) ? i.ready(e) : (e.selector !== t && (this.selector = e.selector,
this.context = e.context), rt.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 = rt.merge(this.constructor(), e);
return t.prevObject = this, t.context = this.context, t;
},
each: function(e, t) {
return rt.each(this, e, t);
},
ready: function(e) {
return rt.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(rt.map(this, function(t, n) {
return e.call(t, n, t);
}));
},
end: function() {
return this.prevObject || this.constructor(null);
},
push: Q,
sort: [].sort,
splice: [].splice
}, rt.fn.init.prototype = rt.fn, rt.extend = rt.fn.extend = function() {
var e, n, i, o, r, s, a = arguments[0] || {}, l = 1, c = arguments.length, u = !1;
for ("boolean" == typeof a && (u = a, a = arguments[1] || {}, l = 2), "object" == typeof a || rt.isFunction(a) || (a = {}),
c === l && (a = this, --l); c > l; l++) if (null != (e = arguments[l])) for (n in e) i = a[n],
o = e[n], a !== o && (u && o && (rt.isPlainObject(o) || (r = rt.isArray(o))) ? (r ? (r = !1,
s = i && rt.isArray(i) ? i : []) : s = i && rt.isPlainObject(i) ? i : {}, a[n] = rt.extend(u, s, o)) : o !== t && (a[n] = o));
return a;
}, rt.extend({
expando: "jQuery" + (J + Math.random()).replace(/\D/g, ""),
noConflict: function(t) {
return e.$ === rt && (e.$ = K), t && e.jQuery === rt && (e.jQuery = V), rt;
},
isReady: !1,
readyWait: 1,
holdReady: function(e) {
e ? rt.readyWait++ : rt.ready(!0);
},
ready: function(e) {
(e === !0 ? --rt.readyWait : rt.isReady) || (rt.isReady = !0, e !== !0 && --rt.readyWait > 0 || (H.resolveWith(U, [ rt ]),
rt.fn.trigger && rt(U).trigger("ready").off("ready")));
},
isFunction: function(e) {
return "function" === rt.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" !== rt.type(e) || e.nodeType || rt.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 || U;
var i = ct.exec(e), o = !n && [];
return i ? [ t.createElement(i[1]) ] : (i = rt.buildFragment([ e ], t, o), o && rt(o).remove(),
rt.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 (o) {
n = t;
}
return (!n || n.getElementsByTagName("parsererror").length) && rt.error("Invalid XML: " + e),
n;
},
noop: function() {},
globalEval: function(e) {
var t, n = eval;
e = rt.trim(e), e && (1 === e.indexOf("use strict") ? (t = U.createElement("script"),
t.text = e, U.head.appendChild(t).parentNode.removeChild(t)) : n(e));
},
camelCase: function(e) {
return e.replace(ut, "ms-").replace(dt, ht);
},
nodeName: function(e, t) {
return e.nodeName && e.nodeName.toLowerCase() === t.toLowerCase();
},
each: function(e, t, i) {
var o, r = 0, s = e.length, a = n(e);
if (i) {
if (a) for (;s > r && (o = t.apply(e[r], i), o !== !1); r++) ; else for (r in e) if (o = t.apply(e[r], i),
o === !1) break;
} else if (a) for (;s > r && (o = t.call(e[r], r, e[r]), o !== !1); r++) ; else for (r in e) if (o = t.call(e[r], r, e[r]),
o === !1) break;
return e;
},
trim: function(e) {
return null == e ? "" : ot.call(e);
},
makeArray: function(e, t) {
var i = t || [];
return null != e && (n(Object(e)) ? rt.merge(i, "string" == typeof e ? [ e ] : e) : Q.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, o = e.length, r = 0;
if ("number" == typeof i) for (;i > r; r++) e[o++] = n[r]; else for (;n[r] !== t; ) e[o++] = n[r++];
return e.length = o, e;
},
grep: function(e, t, n) {
var i, o = [], r = 0, s = e.length;
for (n = !!n; s > r; r++) i = !!t(e[r], r), n !== i && o.push(e[r]);
return o;
},
map: function(e, t, i) {
var o, r = 0, s = e.length, a = n(e), l = [];
if (a) for (;s > r; r++) o = t(e[r], r, i), null != o && (l[l.length] = o); else for (r in e) o = t(e[r], r, i),
null != o && (l[l.length] = o);
return Z.apply([], l);
},
guid: 1,
proxy: function(e, n) {
var i, o, r;
return "string" == typeof n && (i = e[n], n = e, e = i), rt.isFunction(e) ? (o = et.call(arguments, 2),
r = function() {
return e.apply(n || this, o.concat(et.call(arguments)));
}, r.guid = e.guid = e.guid || rt.guid++, r) : t;
},
access: function(e, n, i, o, r, s, a) {
var l = 0, c = e.length, u = null == i;
if ("object" === rt.type(i)) {
r = !0;
for (l in i) rt.access(e, n, l, i[l], !0, s, a);
} else if (o !== t && (r = !0, rt.isFunction(o) || (a = !0), u && (a ? (n.call(e, o),
n = null) : (u = n, n = function(e, t, n) {
return u.call(rt(e), n);
})), n)) for (;c > l; l++) n(e[l], i, a ? o : o.call(e[l], l, n(e[l], i)));
return r ? e : u ? n.call(e) : c ? n(e[0], i) : s;
},
now: Date.now,
swap: function(e, t, n, i) {
var o, r, s = {};
for (r in t) s[r] = e.style[r], e.style[r] = t[r];
o = n.apply(e, i || []);
for (r in t) e.style[r] = s[r];
return o;
}
}), rt.ready.promise = function(t) {
return H || (H = rt.Deferred(), "complete" === U.readyState ? setTimeout(rt.ready) : (U.addEventListener("DOMContentLoaded", pt, !1),
e.addEventListener("load", pt, !1))), H.promise(t);
}, rt.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function(e, t) {
X["[object " + t + "]"] = t.toLowerCase();
}), j = rt(U), function(e, t) {
function n(e, t, n, i) {
var o, r, s, a, l, c, u, d, f, g;
if ((t ? t.ownerDocument || t : z) !== L && D(t), t = t || L, n = n || [], !e || "string" != typeof e) return n;
if (1 !== (a = t.nodeType) && 9 !== a) return [];
if (M && !i) {
if (o = yt.exec(e)) if (s = o[1]) {
if (9 === a) {
if (r = t.getElementById(s), !r || !r.parentNode) return n;
if (r.id === s) return n.push(r), n;
} else if (t.ownerDocument && (r = t.ownerDocument.getElementById(s)) && N(t, r) && r.id === s) return n.push(r),
n;
} else {
if (o[2]) return et.apply(n, t.getElementsByTagName(e)), n;
if ((s = o[3]) && E.getElementsByClassName && t.getElementsByClassName) return et.apply(n, t.getElementsByClassName(s)),
n;
}
if (E.qsa && (!R || !R.test(e))) {
if (d = u = O, f = t, g = 9 === a && e, 1 === a && "object" !== t.nodeName.toLowerCase()) {
for (c = h(e), (u = t.getAttribute("id")) ? d = u.replace(xt, "\\$&") : t.setAttribute("id", d),
d = "[id='" + d + "'] ", l = c.length; l--; ) c[l] = d + p(c[l]);
f = pt.test(e) && t.parentNode || t, g = c.join(",");
}
if (g) try {
return et.apply(n, f.querySelectorAll(g)), n;
} catch (m) {} finally {
u || t.removeAttribute("id");
}
}
}
return C(e.replace(ut, "$1"), t, n, i);
}
function i() {
function e(n, i) {
return t.push(n += " ") > A.cacheLength && delete e[t.shift()], e[n] = i;
}
var t = [];
return e;
}
function o(e) {
return e[O] = !0, e;
}
function r(e) {
var t = L.createElement("div");
try {
return !!e(t);
} catch (n) {
return !1;
} finally {
t.parentNode && t.parentNode.removeChild(t), t = null;
}
}
function s(e, t) {
for (var n = e.split("|"), i = e.length; i--; ) A.attrHandle[n[i]] = t;
}
function a(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 o(function(t) {
return t = +t, o(function(n, i) {
for (var o, r = e([], n.length, t), s = r.length; s--; ) n[o = r[s]] && (n[o] = !(i[o] = n[o]));
});
});
}
function d() {}
function h(e, t) {
var i, o, r, s, a, l, c, u = W[e + " "];
if (u) return t ? 0 : u.slice(0);
for (a = e, l = [], c = A.preFilter; a; ) {
(!i || (o = dt.exec(a))) && (o && (a = a.slice(o[0].length) || a), l.push(r = [])),
i = !1, (o = ht.exec(a)) && (i = o.shift(), r.push({
value: i,
type: o[0].replace(ut, " ")
}), a = a.slice(i.length));
for (s in A.filter) !(o = vt[s].exec(a)) || c[s] && !(o = c[s](o)) || (i = o.shift(),
r.push({
value: i,
type: s,
matches: o
}), a = a.slice(i.length));
if (!i) break;
}
return t ? a.length : a ? n.error(e) : W(e, l).slice(0);
}
function p(e) {
for (var t = 0, n = e.length, i = ""; n > t; t++) i += e[t].value;
return i;
}
function f(e, t, n) {
var i = t.dir, o = n && "parentNode" === i, r = H++;
return t.first ? function(t, n, r) {
for (;t = t[i]; ) if (1 === t.nodeType || o) return e(t, n, r);
} : function(t, n, s) {
var a, l, c, u = j + " " + r;
if (s) {
for (;t = t[i]; ) if ((1 === t.nodeType || o) && e(t, n, s)) return !0;
} else for (;t = t[i]; ) if (1 === t.nodeType || o) if (c = t[O] || (t[O] = {}),
(l = c[i]) && l[0] === u) {
if ((a = l[1]) === !0 || a === S) return a === !0;
} else if (l = c[i] = [ u ], l[1] = e(t, n, s) || S, l[1] === !0) return !0;
};
}
function g(e) {
return e.length > 1 ? function(t, n, i) {
for (var o = e.length; o--; ) if (!e[o](t, n, i)) return !1;
return !0;
} : e[0];
}
function m(e, t, n, i, o) {
for (var r, s = [], a = 0, l = e.length, c = null != t; l > a; a++) (r = e[a]) && (!n || n(r, i, o)) && (s.push(r),
c && t.push(a));
return s;
}
function v(e, t, n, i, r, s) {
return i && !i[O] && (i = v(i)), r && !r[O] && (r = v(r, s)), o(function(o, s, a, l) {
var c, u, d, h = [], p = [], f = s.length, g = o || w(t || "*", a.nodeType ? [ a ] : a, []), v = !e || !o && t ? g : m(g, h, e, a, l), b = n ? r || (o ? e : f || i) ? [] : s : v;
if (n && n(v, b, a, l), i) for (c = m(b, p), i(c, [], a, l), u = c.length; u--; ) (d = c[u]) && (b[p[u]] = !(v[p[u]] = d));
if (o) {
if (r || e) {
if (r) {
for (c = [], u = b.length; u--; ) (d = b[u]) && c.push(v[u] = d);
r(null, b = [], c, l);
}
for (u = b.length; u--; ) (d = b[u]) && (c = r ? nt.call(o, d) : h[u]) > -1 && (o[c] = !(s[c] = d));
}
} else b = m(b === s ? b.splice(f, b.length) : b), r ? r(null, s, b, l) : et.apply(s, b);
});
}
function b(e) {
for (var t, n, i, o = e.length, r = A.relative[e[0].type], s = r || A.relative[" "], a = r ? 1 : 0, l = f(function(e) {
return e === t;
}, s, !0), c = f(function(e) {
return nt.call(t, e) > -1;
}, s, !0), u = [ function(e, n, i) {
return !r && (i || n !== $) || ((t = n).nodeType ? l(e, n, i) : c(e, n, i));
} ]; o > a; a++) if (n = A.relative[e[a].type]) u = [ f(g(u), n) ]; else {
if (n = A.filter[e[a].type].apply(null, e[a].matches), n[O]) {
for (i = ++a; o > i && !A.relative[e[i].type]; i++) ;
return v(a > 1 && g(u), a > 1 && p(e.slice(0, a - 1).concat({
value: " " === e[a - 2].type ? "*" : ""
})).replace(ut, "$1"), n, i > a && b(e.slice(a, i)), o > i && b(e = e.slice(i)), o > i && p(e));
}
u.push(n);
}
return g(u);
}
function y(e, t) {
var i = 0, r = t.length > 0, s = e.length > 0, a = function(o, a, l, c, u) {
var d, h, p, f = [], g = 0, v = "0", b = o && [], y = null != u, w = $, C = o || s && A.find.TAG("*", u && a.parentNode || a), x = j += null == w ? 1 : Math.random() || .1;
for (y && ($ = a !== L && a, S = i); null != (d = C[v]); v++) {
if (s && d) {
for (h = 0; p = e[h++]; ) if (p(d, a, l)) {
c.push(d);
break;
}
y && (j = x, S = ++i);
}
r && ((d = !p && d) && g--, o && b.push(d));
}
if (g += v, r && v !== g) {
for (h = 0; p = t[h++]; ) p(b, f, a, l);
if (o) {
if (g > 0) for (;v--; ) b[v] || f[v] || (f[v] = Z.call(c));
f = m(f);
}
et.apply(c, f), y && !o && f.length > 0 && g + t.length > 1 && n.uniqueSort(c);
}
return y && (j = x, $ = w), b;
};
return r ? o(a) : a;
}
function w(e, t, i) {
for (var o = 0, r = t.length; r > o; o++) n(e, t[o], i);
return i;
}
function C(e, t, n, i) {
var o, r, s, a, l, c = h(e);
if (!i && 1 === c.length) {
if (r = c[0] = c[0].slice(0), r.length > 2 && "ID" === (s = r[0]).type && E.getById && 9 === t.nodeType && M && A.relative[r[1].type]) {
if (t = (A.find.ID(s.matches[0].replace(Et, St), t) || [])[0], !t) return n;
e = e.slice(r.shift().value.length);
}
for (o = vt.needsContext.test(e) ? 0 : r.length; o-- && (s = r[o], !A.relative[a = s.type]); ) if ((l = A.find[a]) && (i = l(s.matches[0].replace(Et, St), pt.test(r[0].type) && t.parentNode || t))) {
if (r.splice(o, 1), e = i.length && p(r), !e) return et.apply(n, i), n;
break;
}
}
return _(e, c)(i, t, !M, n, pt.test(e)), n;
}
var x, E, S, A, k, F, _, $, T, D, L, B, M, R, I, P, N, O = "sizzle" + -new Date(), z = e.document, j = 0, H = 0, q = i(), W = i(), U = i(), G = !1, V = function(e, t) {
return e === t ? (G = !0, 0) : 0;
}, K = typeof t, X = 1 << 31, Y = {}.hasOwnProperty, J = [], Z = J.pop, Q = 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", ot = "[\\x20\\t\\r\\n\\f]", st = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+", at = st.replace("w", "w#"), lt = "\\[" + ot + "*(" + st + ")" + ot + "*(?:([*^$|!~]?=)" + ot + "*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|(" + at + ")|)|)" + ot + "*\\]", ct = ":(" + st + ")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|" + lt.replace(3, 8) + ")*)|.*)\\)|)", ut = new RegExp("^" + ot + "+|((?:^|[^\\\\])(?:\\\\.)*)" + ot + "+$", "g"), dt = new RegExp("^" + ot + "*," + ot + "*"), ht = new RegExp("^" + ot + "*([>+~]|" + ot + ")" + ot + "*"), pt = new RegExp(ot + "*[+~]"), ft = new RegExp("=" + ot + "*([^\\]'\"]*)" + ot + "*\\]", "g"), gt = new RegExp(ct), mt = new RegExp("^" + at + "$"), vt = {
ID: new RegExp("^#(" + st + ")"),
CLASS: new RegExp("^\\.(" + st + ")"),
TAG: new RegExp("^(" + st.replace("w", "w*") + ")"),
ATTR: new RegExp("^" + lt),
PSEUDO: new RegExp("^" + ct),
CHILD: new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + ot + "*(even|odd|(([+-]|)(\\d*)n|)" + ot + "*(?:([+-]|)" + ot + "*(\\d+)|))" + ot + "*\\)|)", "i"),
bool: new RegExp("^(?:" + it + ")$", "i"),
needsContext: new RegExp("^" + ot + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + ot + "*((?:-\\d)?\\d*)" + ot + "*\\)|)(?=[^-]|$)", "i")
}, bt = /^[^{]+\{\s*\[native \w/, yt = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, wt = /^(?:input|select|textarea|button)$/i, Ct = /^h\d$/i, xt = /'|\\/g, Et = new RegExp("\\\\([\\da-f]{1,6}" + ot + "?|(" + ot + ")|.)", "ig"), St = function(e, t, n) {
var i = "0x" + t - 65536;
return i !== i || n ? t : 0 > i ? String.fromCharCode(i + 65536) : String.fromCharCode(55296 | i >> 10, 56320 | 1023 & i);
};
try {
et.apply(J = tt.call(z.childNodes), z.childNodes), J[z.childNodes.length].nodeType;
} catch (At) {
et = {
apply: J.length ? function(e, t) {
Q.apply(e, tt.call(t));
} : function(e, t) {
for (var n = e.length, i = 0; e[n++] = t[i++]; ) ;
e.length = n - 1;
}
};
}
F = n.isXML = function(e) {
var t = e && (e.ownerDocument || e).documentElement;
return t ? "HTML" !== t.nodeName : !1;
}, E = n.support = {}, D = n.setDocument = function(e) {
var t = e ? e.ownerDocument || e : z, n = t.defaultView;
return t !== L && 9 === t.nodeType && t.documentElement ? (L = t, B = t.documentElement,
M = !F(t), n && n.attachEvent && n !== n.top && n.attachEvent("onbeforeunload", function() {
D();
}), E.attributes = r(function(e) {
return e.className = "i", !e.getAttribute("className");
}), E.getElementsByTagName = r(function(e) {
return e.appendChild(t.createComment("")), !e.getElementsByTagName("*").length;
}), E.getElementsByClassName = r(function(e) {
return e.innerHTML = "<div class='a'></div><div class='a i'></div>", e.firstChild.className = "i",
2 === e.getElementsByClassName("i").length;
}), E.getById = r(function(e) {
return B.appendChild(e).id = O, !t.getElementsByName || !t.getElementsByName(O).length;
}), E.getById ? (A.find.ID = function(e, t) {
if (typeof t.getElementById !== K && M) {
var n = t.getElementById(e);
return n && n.parentNode ? [ n ] : [];
}
}, A.filter.ID = function(e) {
var t = e.replace(Et, St);
return function(e) {
return e.getAttribute("id") === t;
};
}) : (delete A.find.ID, A.filter.ID = function(e) {
var t = e.replace(Et, St);
return function(e) {
var n = typeof e.getAttributeNode !== K && e.getAttributeNode("id");
return n && n.value === t;
};
}), A.find.TAG = E.getElementsByTagName ? function(e, t) {
return typeof t.getElementsByTagName !== K ? t.getElementsByTagName(e) : void 0;
} : function(e, t) {
var n, i = [], o = 0, r = t.getElementsByTagName(e);
if ("*" === e) {
for (;n = r[o++]; ) 1 === n.nodeType && i.push(n);
return i;
}
return r;
}, A.find.CLASS = E.getElementsByClassName && function(e, t) {
return typeof t.getElementsByClassName !== K && M ? t.getElementsByClassName(e) : void 0;
}, I = [], R = [], (E.qsa = bt.test(t.querySelectorAll)) && (r(function(e) {
e.innerHTML = "<select><option selected=''></option></select>", e.querySelectorAll("[selected]").length || R.push("\\[" + ot + "*(?:value|" + it + ")"),
e.querySelectorAll(":checked").length || R.push(":checked");
}), r(function(e) {
var n = t.createElement("input");
n.setAttribute("type", "hidden"), e.appendChild(n).setAttribute("t", ""), e.querySelectorAll("[t^='']").length && R.push("[*^$]=" + ot + "*(?:''|\"\")"),
e.querySelectorAll(":enabled").length || R.push(":enabled", ":disabled"), e.querySelectorAll("*,:x"),
R.push(",.*:");
})), (E.matchesSelector = bt.test(P = B.webkitMatchesSelector || B.mozMatchesSelector || B.oMatchesSelector || B.msMatchesSelector)) && r(function(e) {
E.disconnectedMatch = P.call(e, "div"), P.call(e, "[s!='']:x"), I.push("!=", ct);
}), R = R.length && new RegExp(R.join("|")), I = I.length && new RegExp(I.join("|")),
N = bt.test(B.contains) || B.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;
}, V = B.compareDocumentPosition ? function(e, n) {
if (e === n) return G = !0, 0;
var i = n.compareDocumentPosition && e.compareDocumentPosition && e.compareDocumentPosition(n);
return i ? 1 & i || !E.sortDetached && n.compareDocumentPosition(e) === i ? e === t || N(z, e) ? -1 : n === t || N(z, n) ? 1 : T ? nt.call(T, e) - nt.call(T, n) : 0 : 4 & i ? -1 : 1 : e.compareDocumentPosition ? -1 : 1;
} : function(e, n) {
var i, o = 0, r = e.parentNode, s = n.parentNode, l = [ e ], c = [ n ];
if (e === n) return G = !0, 0;
if (!r || !s) return e === t ? -1 : n === t ? 1 : r ? -1 : s ? 1 : T ? nt.call(T, e) - nt.call(T, n) : 0;
if (r === s) return a(e, n);
for (i = e; i = i.parentNode; ) l.unshift(i);
for (i = n; i = i.parentNode; ) c.unshift(i);
for (;l[o] === c[o]; ) o++;
return o ? a(l[o], c[o]) : l[o] === z ? -1 : c[o] === z ? 1 : 0;
}, t) : L;
}, n.matches = function(e, t) {
return n(e, null, null, t);
}, n.matchesSelector = function(e, t) {
if ((e.ownerDocument || e) !== L && D(e), t = t.replace(ft, "='$1']"), !(!E.matchesSelector || !M || I && I.test(t) || R && R.test(t))) try {
var i = P.call(e, t);
if (i || E.disconnectedMatch || e.document && 11 !== e.document.nodeType) return i;
} catch (o) {}
return n(t, L, null, [ e ]).length > 0;
}, n.contains = function(e, t) {
return (e.ownerDocument || e) !== L && D(e), N(e, t);
}, n.attr = function(e, n) {
(e.ownerDocument || e) !== L && D(e);
var i = A.attrHandle[n.toLowerCase()], o = i && Y.call(A.attrHandle, n.toLowerCase()) ? i(e, n, !M) : t;
return o === t ? E.attributes || !M ? e.getAttribute(n) : (o = e.getAttributeNode(n)) && o.specified ? o.value : null : o;
}, n.error = function(e) {
throw new Error("Syntax error, unrecognized expression: " + e);
}, n.uniqueSort = function(e) {
var t, n = [], i = 0, o = 0;
if (G = !E.detectDuplicates, T = !E.sortStable && e.slice(0), e.sort(V), G) {
for (;t = e[o++]; ) t === e[o] && (i = n.push(o));
for (;i--; ) e.splice(n[i], 1);
}
return e;
}, k = n.getText = function(e) {
var t, n = "", i = 0, o = e.nodeType;
if (o) {
if (1 === o || 9 === o || 11 === o) {
if ("string" == typeof e.textContent) return e.textContent;
for (e = e.firstChild; e; e = e.nextSibling) n += k(e);
} else if (3 === o || 4 === o) return e.nodeValue;
} else for (;t = e[i]; i++) n += k(t);
return n;
}, A = n.selectors = {
cacheLength: 50,
createPseudo: o,
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(Et, St), e[3] = (e[4] || e[5] || "").replace(Et, St),
"~=" === 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 && gt.test(i) && (n = h(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(Et, St).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("(^|" + ot + ")" + e + "(" + ot + "|$)")) && q(e, function(e) {
return t.test("string" == typeof e.className && e.className || typeof e.getAttribute !== K && e.getAttribute("class") || "");
});
},
ATTR: function(e, t, i) {
return function(o) {
var r = n.attr(o, e);
return null == r ? "!=" === t : t ? (r += "", "=" === t ? r === i : "!=" === t ? r !== i : "^=" === t ? i && 0 === r.indexOf(i) : "*=" === t ? i && r.indexOf(i) > -1 : "$=" === t ? i && r.slice(-i.length) === i : "~=" === t ? (" " + r + " ").indexOf(i) > -1 : "|=" === t ? r === i || r.slice(0, i.length + 1) === i + "-" : !1) : !0;
};
},
CHILD: function(e, t, n, i, o) {
var r = "nth" !== e.slice(0, 3), s = "last" !== e.slice(-4), a = "of-type" === t;
return 1 === i && 0 === o ? function(e) {
return !!e.parentNode;
} : function(t, n, l) {
var c, u, d, h, p, f, g = r !== s ? "nextSibling" : "previousSibling", m = t.parentNode, v = a && t.nodeName.toLowerCase(), b = !l && !a;
if (m) {
if (r) {
for (;g; ) {
for (d = t; d = d[g]; ) if (a ? d.nodeName.toLowerCase() === v : 1 === d.nodeType) return !1;
f = g = "only" === e && !f && "nextSibling";
}
return !0;
}
if (f = [ s ? m.firstChild : m.lastChild ], s && b) {
for (u = m[O] || (m[O] = {}), c = u[e] || [], p = c[0] === j && c[1], h = c[0] === j && c[2],
d = p && m.childNodes[p]; d = ++p && d && d[g] || (h = p = 0) || f.pop(); ) if (1 === d.nodeType && ++h && d === t) {
u[e] = [ j, p, h ];
break;
}
} else if (b && (c = (t[O] || (t[O] = {}))[e]) && c[0] === j) h = c[1]; else for (;(d = ++p && d && d[g] || (h = p = 0) || f.pop()) && ((a ? d.nodeName.toLowerCase() !== v : 1 !== d.nodeType) || !++h || (b && ((d[O] || (d[O] = {}))[e] = [ j, h ]),
d !== t)); ) ;
return h -= o, h === i || 0 === h % i && h / i >= 0;
}
};
},
PSEUDO: function(e, t) {
var i, r = A.pseudos[e] || A.setFilters[e.toLowerCase()] || n.error("unsupported pseudo: " + e);
return r[O] ? r(t) : r.length > 1 ? (i = [ e, e, "", t ], A.setFilters.hasOwnProperty(e.toLowerCase()) ? o(function(e, n) {
for (var i, o = r(e, t), s = o.length; s--; ) i = nt.call(e, o[s]), e[i] = !(n[i] = o[s]);
}) : function(e) {
return r(e, 0, i);
}) : r;
}
},
pseudos: {
not: o(function(e) {
var t = [], n = [], i = _(e.replace(ut, "$1"));
return i[O] ? o(function(e, t, n, o) {
for (var r, s = i(e, null, o, []), a = e.length; a--; ) (r = s[a]) && (e[a] = !(t[a] = r));
}) : function(e, o, r) {
return t[0] = e, i(t, null, r, n), !n.pop();
};
}),
has: o(function(e) {
return function(t) {
return n(e, t).length > 0;
};
}),
contains: o(function(e) {
return function(t) {
return (t.textContent || t.innerText || k(t)).indexOf(e) > -1;
};
}),
lang: o(function(e) {
return mt.test(e || "") || n.error("unsupported lang: " + e), e = e.replace(Et, St).toLowerCase(),
function(t) {
var n;
do if (n = M ? 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 === B;
},
focus: function(e) {
return e === L.activeElement && (!L.hasFocus || L.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 !A.pseudos.empty(e);
},
header: function(e) {
return Ct.test(e.nodeName);
},
input: function(e) {
return wt.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;
})
}
}, A.pseudos.nth = A.pseudos.eq;
for (x in {
radio: !0,
checkbox: !0,
file: !0,
password: !0,
image: !0
}) A.pseudos[x] = l(x);
for (x in {
submit: !0,
reset: !0
}) A.pseudos[x] = c(x);
d.prototype = A.filters = A.pseudos, A.setFilters = new d(), _ = n.compile = function(e, t) {
var n, i = [], o = [], r = U[e + " "];
if (!r) {
for (t || (t = h(e)), n = t.length; n--; ) r = b(t[n]), r[O] ? i.push(r) : o.push(r);
r = U(e, y(o, i));
}
return r;
}, E.sortStable = O.split("").sort(V).join("") === O, E.detectDuplicates = G, D(),
E.sortDetached = r(function(e) {
return 1 & e.compareDocumentPosition(L.createElement("div"));
}), r(function(e) {
return e.innerHTML = "<a href='#'></a>", "#" === e.firstChild.getAttribute("href");
}) || s("type|href|height|width", function(e, t, n) {
return n ? void 0 : e.getAttribute(t, "type" === t.toLowerCase() ? 1 : 2);
}), E.attributes && r(function(e) {
return e.innerHTML = "<input/>", e.firstChild.setAttribute("value", ""), "" === e.firstChild.getAttribute("value");
}) || s("value", function(e, t, n) {
return n || "input" !== e.nodeName.toLowerCase() ? void 0 : e.defaultValue;
}), r(function(e) {
return null == e.getAttribute("disabled");
}) || s(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;
}), rt.find = n, rt.expr = n.selectors, rt.expr[":"] = rt.expr.pseudos, rt.unique = n.uniqueSort,
rt.text = n.getText, rt.isXMLDoc = n.isXML, rt.contains = n.contains;
}(e);
var ft = {};
rt.Callbacks = function(e) {
e = "string" == typeof e ? ft[e] || i(e) : rt.extend({}, e);
var n, o, r, s, a, l, c = [], u = !e.once && [], d = function(t) {
for (n = e.memory && t, o = !0, l = s || 0, s = 0, a = c.length, r = !0; c && a > l; l++) if (c[l].apply(t[0], t[1]) === !1 && e.stopOnFalse) {
n = !1;
break;
}
r = !1, c && (u ? u.length && d(u.shift()) : n ? c = [] : h.disable());
}, h = {
add: function() {
if (c) {
var t = c.length;
(function i(t) {
rt.each(t, function(t, n) {
var o = rt.type(n);
"function" === o ? e.unique && h.has(n) || c.push(n) : n && n.length && "string" !== o && i(n);
});
})(arguments), r ? a = c.length : n && (s = t, d(n));
}
return this;
},
remove: function() {
return c && rt.each(arguments, function(e, t) {
for (var n; (n = rt.inArray(t, c, n)) > -1; ) c.splice(n, 1), r && (a >= n && a--,
l >= n && l--);
}), this;
},
has: function(e) {
return e ? rt.inArray(e, c) > -1 : !(!c || !c.length);
},
empty: function() {
return c = [], a = 0, this;
},
disable: function() {
return c = u = n = t, this;
},
disabled: function() {
return !c;
},
lock: function() {
return u = t, n || h.disable(), this;
},
locked: function() {
return !u;
},
fireWith: function(e, t) {
return !c || o && !u || (t = t || [], t = [ e, t.slice ? t.slice() : t ], r ? u.push(t) : d(t)),
this;
},
fire: function() {
return h.fireWith(this, arguments), this;
},
fired: function() {
return !!o;
}
};
return h;
}, rt.extend({
Deferred: function(e) {
var t = [ [ "resolve", "done", rt.Callbacks("once memory"), "resolved" ], [ "reject", "fail", rt.Callbacks("once memory"), "rejected" ], [ "notify", "progress", rt.Callbacks("memory") ] ], n = "pending", i = {
state: function() {
return n;
},
always: function() {
return o.done(arguments).fail(arguments), this;
},
then: function() {
var e = arguments;
return rt.Deferred(function(n) {
rt.each(t, function(t, r) {
var s = r[0], a = rt.isFunction(e[t]) && e[t];
o[r[1]](function() {
var e = a && a.apply(this, arguments);
e && rt.isFunction(e.promise) ? e.promise().done(n.resolve).fail(n.reject).progress(n.notify) : n[s + "With"](this === i ? n.promise() : this, a ? [ e ] : arguments);
});
}), e = null;
}).promise();
},
promise: function(e) {
return null != e ? rt.extend(e, i) : i;
}
}, o = {};
return i.pipe = i.then, rt.each(t, function(e, r) {
var s = r[2], a = r[3];
i[r[1]] = s.add, a && s.add(function() {
n = a;
}, t[1 ^ e][2].disable, t[2][2].lock), o[r[0]] = function() {
return o[r[0] + "With"](this === o ? i : this, arguments), this;
}, o[r[0] + "With"] = s.fireWith;
}), i.promise(o), e && e.call(o, o), o;
},
when: function(e) {
var t, n, i, o = 0, r = et.call(arguments), s = r.length, a = 1 !== s || e && rt.isFunction(e.promise) ? s : 0, l = 1 === a ? e : rt.Deferred(), c = function(e, n, i) {
return function(o) {
n[e] = this, i[e] = arguments.length > 1 ? et.call(arguments) : o, i === t ? l.notifyWith(n, i) : --a || l.resolveWith(n, i);
};
};
if (s > 1) for (t = new Array(s), n = new Array(s), i = new Array(s); s > o; o++) r[o] && rt.isFunction(r[o].promise) ? r[o].promise().done(c(o, i, r)).fail(l.reject).progress(c(o, n, t)) : --a;
return a || l.resolveWith(i, r), l.promise();
}
}), rt.support = function(t) {
var n = U.createElement("input"), i = U.createDocumentFragment(), o = U.createElement("div"), r = U.createElement("select"), s = r.appendChild(U.createElement("option"));
return n.type ? (n.type = "checkbox", t.checkOn = "" !== n.value, t.optSelected = s.selected,
t.reliableMarginRight = !0, t.boxSizingReliable = !0, t.pixelPosition = !1, n.checked = !0,
t.noCloneChecked = n.cloneNode(!0).checked, r.disabled = !0, t.optDisabled = !s.disabled,
n = U.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, o.style.backgroundClip = "content-box", o.cloneNode(!0).style.backgroundClip = "",
t.clearCloneStyle = "content-box" === o.style.backgroundClip, rt(function() {
var n, i, r = "padding:0;margin:0;border:0;display:block;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box", s = U.getElementsByTagName("body")[0];
s && (n = U.createElement("div"), n.style.cssText = "border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px",
s.appendChild(n).appendChild(o), o.innerHTML = "", o.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%",
rt.swap(s, null != s.style.zoom ? {
zoom: 1
} : {}, function() {
t.boxSizing = 4 === o.offsetWidth;
}), e.getComputedStyle && (t.pixelPosition = "1%" !== (e.getComputedStyle(o, null) || {}).top,
t.boxSizingReliable = "4px" === (e.getComputedStyle(o, null) || {
width: "4px"
}).width, i = o.appendChild(U.createElement("div")), i.style.cssText = o.style.cssText = r,
i.style.marginRight = i.style.width = "0", o.style.width = "1px", t.reliableMarginRight = !parseFloat((e.getComputedStyle(i, null) || {}).marginRight)),
s.removeChild(n));
}), t) : t;
}({});
var gt, mt, vt = /(?:\{[\s\S]*\}|\[[\s\S]*\])$/, bt = /([A-Z])/g;
o.uid = 1, o.accepts = function(e) {
return e.nodeType ? 1 === e.nodeType || 9 === e.nodeType : !0;
}, o.prototype = {
key: function(e) {
if (!o.accepts(e)) return 0;
var t = {}, n = e[this.expando];
if (!n) {
n = o.uid++;
try {
t[this.expando] = {
value: n
}, Object.defineProperties(e, t);
} catch (i) {
t[this.expando] = n, rt.extend(e, t);
}
}
return this.cache[n] || (this.cache[n] = {}), n;
},
set: function(e, t, n) {
var i, o = this.key(e), r = this.cache[o];
if ("string" == typeof t) r[t] = n; else if (rt.isEmptyObject(r)) rt.extend(this.cache[o], t); else for (i in t) r[i] = t[i];
return r;
},
get: function(e, n) {
var i = this.cache[this.key(e)];
return n === t ? i : i[n];
},
access: function(e, n, i) {
var o;
return n === t || n && "string" == typeof n && i === t ? (o = this.get(e, n), o !== t ? o : this.get(e, rt.camelCase(n))) : (this.set(e, n, i),
i !== t ? i : n);
},
remove: function(e, n) {
var i, o, r, s = this.key(e), a = this.cache[s];
if (n === t) this.cache[s] = {}; else {
rt.isArray(n) ? o = n.concat(n.map(rt.camelCase)) : (r = rt.camelCase(n), n in a ? o = [ n, r ] : (o = r,
o = o in a ? [ o ] : o.match(at) || [])), i = o.length;
for (;i--; ) delete a[o[i]];
}
},
hasData: function(e) {
return !rt.isEmptyObject(this.cache[e[this.expando]] || {});
},
discard: function(e) {
e[this.expando] && delete this.cache[e[this.expando]];
}
}, gt = new o(), mt = new o(), rt.extend({
acceptData: o.accepts,
hasData: function(e) {
return gt.hasData(e) || mt.hasData(e);
},
data: function(e, t, n) {
return gt.access(e, t, n);
},
removeData: function(e, t) {
gt.remove(e, t);
},
_data: function(e, t, n) {
return mt.access(e, t, n);
},
_removeData: function(e, t) {
mt.remove(e, t);
}
}), rt.fn.extend({
data: function(e, n) {
var i, o, s = this[0], a = 0, l = null;
if (e === t) {
if (this.length && (l = gt.get(s), 1 === s.nodeType && !mt.get(s, "hasDataAttrs"))) {
for (i = s.attributes; a < i.length; a++) o = i[a].name, 0 === o.indexOf("data-") && (o = rt.camelCase(o.slice(5)),
r(s, o, l[o]));
mt.set(s, "hasDataAttrs", !0);
}
return l;
}
return "object" == typeof e ? this.each(function() {
gt.set(this, e);
}) : rt.access(this, function(n) {
var i, o = rt.camelCase(e);
if (s && n === t) {
if (i = gt.get(s, e), i !== t) return i;
if (i = gt.get(s, o), i !== t) return i;
if (i = r(s, o, t), i !== t) return i;
} else this.each(function() {
var i = gt.get(this, o);
gt.set(this, o, n), -1 !== e.indexOf("-") && i !== t && gt.set(this, e, n);
});
}, null, n, arguments.length > 1, null, !0);
},
removeData: function(e) {
return this.each(function() {
gt.remove(this, e);
});
}
}), rt.extend({
queue: function(e, t, n) {
var i;
return e ? (t = (t || "fx") + "queue", i = mt.get(e, t), n && (!i || rt.isArray(n) ? i = mt.access(e, t, rt.makeArray(n)) : i.push(n)),
i || []) : void 0;
},
dequeue: function(e, t) {
t = t || "fx";
var n = rt.queue(e, t), i = n.length, o = n.shift(), r = rt._queueHooks(e, t), s = function() {
rt.dequeue(e, t);
};
"inprogress" === o && (o = n.shift(), i--), o && ("fx" === t && n.unshift("inprogress"),
delete r.stop, o.call(e, s, r)), !i && r && r.empty.fire();
},
_queueHooks: function(e, t) {
var n = t + "queueHooks";
return mt.get(e, n) || mt.access(e, n, {
empty: rt.Callbacks("once memory").add(function() {
mt.remove(e, [ t + "queue", n ]);
})
});
}
}), rt.fn.extend({
queue: function(e, n) {
var i = 2;
return "string" != typeof e && (n = e, e = "fx", i--), arguments.length < i ? rt.queue(this[0], e) : n === t ? this : this.each(function() {
var t = rt.queue(this, e, n);
rt._queueHooks(this, e), "fx" === e && "inprogress" !== t[0] && rt.dequeue(this, e);
});
},
dequeue: function(e) {
return this.each(function() {
rt.dequeue(this, e);
});
},
delay: function(e, t) {
return e = rt.fx ? rt.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, o = 1, r = rt.Deferred(), s = this, a = this.length, l = function() {
--o || r.resolveWith(s, [ s ]);
};
for ("string" != typeof e && (n = e, e = t), e = e || "fx"; a--; ) i = mt.get(s[a], e + "queueHooks"),
i && i.empty && (o++, i.empty.add(l));
return l(), r.promise(n);
}
});
var yt, wt, Ct = /[\t\r\n\f]/g, xt = /\r/g, Et = /^(?:input|select|textarea|button)$/i;
rt.fn.extend({
attr: function(e, t) {
return rt.access(this, rt.attr, e, t, arguments.length > 1);
},
removeAttr: function(e) {
return this.each(function() {
rt.removeAttr(this, e);
});
},
prop: function(e, t) {
return rt.access(this, rt.prop, e, t, arguments.length > 1);
},
removeProp: function(e) {
return this.each(function() {
delete this[rt.propFix[e] || e];
});
},
addClass: function(e) {
var t, n, i, o, r, s = 0, a = this.length, l = "string" == typeof e && e;
if (rt.isFunction(e)) return this.each(function(t) {
rt(this).addClass(e.call(this, t, this.className));
});
if (l) for (t = (e || "").match(at) || []; a > s; s++) if (n = this[s], i = 1 === n.nodeType && (n.className ? (" " + n.className + " ").replace(Ct, " ") : " ")) {
for (r = 0; o = t[r++]; ) i.indexOf(" " + o + " ") < 0 && (i += o + " ");
n.className = rt.trim(i);
}
return this;
},
removeClass: function(e) {
var t, n, i, o, r, s = 0, a = this.length, l = 0 === arguments.length || "string" == typeof e && e;
if (rt.isFunction(e)) return this.each(function(t) {
rt(this).removeClass(e.call(this, t, this.className));
});
if (l) for (t = (e || "").match(at) || []; a > s; s++) if (n = this[s], i = 1 === n.nodeType && (n.className ? (" " + n.className + " ").replace(Ct, " ") : "")) {
for (r = 0; o = t[r++]; ) for (;i.indexOf(" " + o + " ") >= 0; ) i = i.replace(" " + o + " ", " ");
n.className = e ? rt.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) : rt.isFunction(e) ? this.each(function(n) {
rt(this).toggleClass(e.call(this, n, this.className, t), t);
}) : this.each(function() {
if ("string" === n) for (var t, i = 0, o = rt(this), r = e.match(at) || []; t = r[i++]; ) o.hasClass(t) ? o.removeClass(t) : o.addClass(t); else (n === q || "boolean" === n) && (this.className && mt.set(this, "__className__", this.className),
this.className = this.className || e === !1 ? "" : mt.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(Ct, " ").indexOf(t) >= 0) return !0;
return !1;
},
val: function(e) {
var n, i, o, r = this[0];
{
if (arguments.length) return o = rt.isFunction(e), this.each(function(i) {
var r;
1 === this.nodeType && (r = o ? e.call(this, i, rt(this).val()) : e, null == r ? r = "" : "number" == typeof r ? r += "" : rt.isArray(r) && (r = rt.map(r, function(e) {
return null == e ? "" : e + "";
})), n = rt.valHooks[this.type] || rt.valHooks[this.nodeName.toLowerCase()], n && "set" in n && n.set(this, r, "value") !== t || (this.value = r));
});
if (r) return n = rt.valHooks[r.type] || rt.valHooks[r.nodeName.toLowerCase()],
n && "get" in n && (i = n.get(r, "value")) !== t ? i : (i = r.value, "string" == typeof i ? i.replace(xt, "") : null == i ? "" : i);
}
}
}), rt.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, o = e.selectedIndex, r = "select-one" === e.type || 0 > o, s = r ? null : [], a = r ? o + 1 : i.length, l = 0 > o ? a : r ? o : 0; a > l; l++) if (n = i[l],
!(!n.selected && l !== o || (rt.support.optDisabled ? n.disabled : null !== n.getAttribute("disabled")) || n.parentNode.disabled && rt.nodeName(n.parentNode, "optgroup"))) {
if (t = rt(n).val(), r) return t;
s.push(t);
}
return s;
},
set: function(e, t) {
for (var n, i, o = e.options, r = rt.makeArray(t), s = o.length; s--; ) i = o[s],
(i.selected = rt.inArray(rt(i).val(), r) >= 0) && (n = !0);
return n || (e.selectedIndex = -1), r;
}
}
},
attr: function(e, n, i) {
var o, r, s = e.nodeType;
if (e && 3 !== s && 8 !== s && 2 !== s) return typeof e.getAttribute === q ? rt.prop(e, n, i) : (1 === s && rt.isXMLDoc(e) || (n = n.toLowerCase(),
o = rt.attrHooks[n] || (rt.expr.match.bool.test(n) ? wt : yt)), i === t ? o && "get" in o && null !== (r = o.get(e, n)) ? r : (r = rt.find.attr(e, n),
null == r ? t : r) : null !== i ? o && "set" in o && (r = o.set(e, i, n)) !== t ? r : (e.setAttribute(n, i + ""),
i) : (rt.removeAttr(e, n), void 0));
},
removeAttr: function(e, t) {
var n, i, o = 0, r = t && t.match(at);
if (r && 1 === e.nodeType) for (;n = r[o++]; ) i = rt.propFix[n] || n, rt.expr.match.bool.test(n) && (e[i] = !1),
e.removeAttribute(n);
},
attrHooks: {
type: {
set: function(e, t) {
if (!rt.support.radioValue && "radio" === t && rt.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 o, r, s, a = e.nodeType;
if (e && 3 !== a && 8 !== a && 2 !== a) return s = 1 !== a || !rt.isXMLDoc(e), s && (n = rt.propFix[n] || n,
r = rt.propHooks[n]), i !== t ? r && "set" in r && (o = r.set(e, i, n)) !== t ? o : e[n] = i : r && "get" in r && null !== (o = r.get(e, n)) ? o : e[n];
},
propHooks: {
tabIndex: {
get: function(e) {
return e.hasAttribute("tabindex") || Et.test(e.nodeName) || e.href ? e.tabIndex : -1;
}
}
}
}), wt = {
set: function(e, t, n) {
return t === !1 ? rt.removeAttr(e, n) : e.setAttribute(n, n), n;
}
}, rt.each(rt.expr.match.bool.source.match(/\w+/g), function(e, n) {
var i = rt.expr.attrHandle[n] || rt.find.attr;
rt.expr.attrHandle[n] = function(e, n, o) {
var r = rt.expr.attrHandle[n], s = o ? t : (rt.expr.attrHandle[n] = t) != i(e, n, o) ? n.toLowerCase() : null;
return rt.expr.attrHandle[n] = r, s;
};
}), rt.support.optSelected || (rt.propHooks.selected = {
get: function(e) {
var t = e.parentNode;
return t && t.parentNode && t.parentNode.selectedIndex, null;
}
}), rt.each([ "tabIndex", "readOnly", "maxLength", "cellSpacing", "cellPadding", "rowSpan", "colSpan", "useMap", "frameBorder", "contentEditable" ], function() {
rt.propFix[this.toLowerCase()] = this;
}), rt.each([ "radio", "checkbox" ], function() {
rt.valHooks[this] = {
set: function(e, t) {
return rt.isArray(t) ? e.checked = rt.inArray(rt(e).val(), t) >= 0 : void 0;
}
}, rt.support.checkOn || (rt.valHooks[this].get = function(e) {
return null === e.getAttribute("value") ? "on" : e.value;
});
});
var St = /^key/, At = /^(?:mouse|contextmenu)|click/, kt = /^(?:focusinfocus|focusoutblur)$/, Ft = /^([^.]*)(?:\.(.+)|)$/;
rt.event = {
global: {},
add: function(e, n, i, o, r) {
var s, a, l, c, u, d, h, p, f, g, m, v = mt.get(e);
if (v) {
for (i.handler && (s = i, i = s.handler, r = s.selector), i.guid || (i.guid = rt.guid++),
(c = v.events) || (c = v.events = {}), (a = v.handle) || (a = v.handle = function(e) {
return typeof rt === q || e && rt.event.triggered === e.type ? t : rt.event.dispatch.apply(a.elem, arguments);
}, a.elem = e), n = (n || "").match(at) || [ "" ], u = n.length; u--; ) l = Ft.exec(n[u]) || [],
f = m = l[1], g = (l[2] || "").split(".").sort(), f && (h = rt.event.special[f] || {},
f = (r ? h.delegateType : h.bindType) || f, h = rt.event.special[f] || {}, d = rt.extend({
type: f,
origType: m,
data: o,
handler: i,
guid: i.guid,
selector: r,
needsContext: r && rt.expr.match.needsContext.test(r),
namespace: g.join(".")
}, s), (p = c[f]) || (p = c[f] = [], p.delegateCount = 0, h.setup && h.setup.call(e, o, g, a) !== !1 || e.addEventListener && e.addEventListener(f, a, !1)),
h.add && (h.add.call(e, d), d.handler.guid || (d.handler.guid = i.guid)), r ? p.splice(p.delegateCount++, 0, d) : p.push(d),
rt.event.global[f] = !0);
e = null;
}
},
remove: function(e, t, n, i, o) {
var r, s, a, l, c, u, d, h, p, f, g, m = mt.hasData(e) && mt.get(e);
if (m && (l = m.events)) {
for (t = (t || "").match(at) || [ "" ], c = t.length; c--; ) if (a = Ft.exec(t[c]) || [],
p = g = a[1], f = (a[2] || "").split(".").sort(), p) {
for (d = rt.event.special[p] || {}, p = (i ? d.delegateType : d.bindType) || p,
h = l[p] || [], a = a[2] && new RegExp("(^|\\.)" + f.join("\\.(?:.*\\.|)") + "(\\.|$)"),
s = r = h.length; r--; ) u = h[r], !o && g !== u.origType || n && n.guid !== u.guid || a && !a.test(u.namespace) || i && i !== u.selector && ("**" !== i || !u.selector) || (h.splice(r, 1),
u.selector && h.delegateCount--, d.remove && d.remove.call(e, u));
s && !h.length && (d.teardown && d.teardown.call(e, f, m.handle) !== !1 || rt.removeEvent(e, p, m.handle),
delete l[p]);
} else for (p in l) rt.event.remove(e, p + t[c], n, i, !0);
rt.isEmptyObject(l) && (delete m.handle, mt.remove(e, "events"));
}
},
trigger: function(n, i, o, r) {
var s, a, l, c, u, d, h, p = [ o || U ], f = it.call(n, "type") ? n.type : n, g = it.call(n, "namespace") ? n.namespace.split(".") : [];
if (a = l = o = o || U, 3 !== o.nodeType && 8 !== o.nodeType && !kt.test(f + rt.event.triggered) && (f.indexOf(".") >= 0 && (g = f.split("."),
f = g.shift(), g.sort()), u = f.indexOf(":") < 0 && "on" + f, n = n[rt.expando] ? n : new rt.Event(f, "object" == typeof n && n),
n.isTrigger = r ? 2 : 3, n.namespace = g.join("."), n.namespace_re = n.namespace ? new RegExp("(^|\\.)" + g.join("\\.(?:.*\\.|)") + "(\\.|$)") : null,
n.result = t, n.target || (n.target = o), i = null == i ? [ n ] : rt.makeArray(i, [ n ]),
h = rt.event.special[f] || {}, r || !h.trigger || h.trigger.apply(o, i) !== !1)) {
if (!r && !h.noBubble && !rt.isWindow(o)) {
for (c = h.delegateType || f, kt.test(c + f) || (a = a.parentNode); a; a = a.parentNode) p.push(a),
l = a;
l === (o.ownerDocument || U) && p.push(l.defaultView || l.parentWindow || e);
}
for (s = 0; (a = p[s++]) && !n.isPropagationStopped(); ) n.type = s > 1 ? c : h.bindType || f,
d = (mt.get(a, "events") || {})[n.type] && mt.get(a, "handle"), d && d.apply(a, i),
d = u && a[u], d && rt.acceptData(a) && d.apply && d.apply(a, i) === !1 && n.preventDefault();
return n.type = f, r || n.isDefaultPrevented() || h._default && h._default.apply(p.pop(), i) !== !1 || !rt.acceptData(o) || u && rt.isFunction(o[f]) && !rt.isWindow(o) && (l = o[u],
l && (o[u] = null), rt.event.triggered = f, o[f](), rt.event.triggered = t, l && (o[u] = l)),
n.result;
}
},
dispatch: function(e) {
e = rt.event.fix(e);
var n, i, o, r, s, a = [], l = et.call(arguments), c = (mt.get(this, "events") || {})[e.type] || [], u = rt.event.special[e.type] || {};
if (l[0] = e, e.delegateTarget = this, !u.preDispatch || u.preDispatch.call(this, e) !== !1) {
for (a = rt.event.handlers.call(this, e, c), n = 0; (r = a[n++]) && !e.isPropagationStopped(); ) for (e.currentTarget = r.elem,
i = 0; (s = r.handlers[i++]) && !e.isImmediatePropagationStopped(); ) (!e.namespace_re || e.namespace_re.test(s.namespace)) && (e.handleObj = s,
e.data = s.data, o = ((rt.event.special[s.origType] || {}).handle || s.handler).apply(r.elem, l),
o !== t && (e.result = o) === !1 && (e.preventDefault(), e.stopPropagation()));
return u.postDispatch && u.postDispatch.call(this, e), e.result;
}
},
handlers: function(e, n) {
var i, o, r, s, a = [], 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 (o = [], i = 0; l > i; i++) s = n[i], r = s.selector + " ", o[r] === t && (o[r] = s.needsContext ? rt(r, this).index(c) >= 0 : rt.find(r, this, null, [ c ]).length),
o[r] && o.push(s);
o.length && a.push({
elem: c,
handlers: o
});
}
return l < n.length && a.push({
elem: this,
handlers: n.slice(l)
}), a;
},
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, o, r, s = n.button;
return null == e.pageX && null != n.clientX && (i = e.target.ownerDocument || U,
o = i.documentElement, r = i.body, e.pageX = n.clientX + (o && o.scrollLeft || r && r.scrollLeft || 0) - (o && o.clientLeft || r && r.clientLeft || 0),
e.pageY = n.clientY + (o && o.scrollTop || r && r.scrollTop || 0) - (o && o.clientTop || r && r.clientTop || 0)),
e.which || s === t || (e.which = 1 & s ? 1 : 2 & s ? 3 : 4 & s ? 2 : 0), e;
}
},
fix: function(e) {
if (e[rt.expando]) return e;
var t, n, i, o = e.type, r = e, s = this.fixHooks[o];
for (s || (this.fixHooks[o] = s = At.test(o) ? this.mouseHooks : St.test(o) ? this.keyHooks : {}),
i = s.props ? this.props.concat(s.props) : this.props, e = new rt.Event(r), t = i.length; t--; ) n = i[t],
e[n] = r[n];
return e.target || (e.target = U), 3 === e.target.nodeType && (e.target = e.target.parentNode),
s.filter ? s.filter(e, r) : 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 && rt.nodeName(this, "input") ? (this.click(),
!1) : void 0;
},
_default: function(e) {
return rt.nodeName(e.target, "a");
}
},
beforeunload: {
postDispatch: function(e) {
e.result !== t && (e.originalEvent.returnValue = e.result);
}
}
},
simulate: function(e, t, n, i) {
var o = rt.extend(new rt.Event(), n, {
type: e,
isSimulated: !0,
originalEvent: {}
});
i ? rt.event.trigger(o, null, t) : rt.event.dispatch.call(t, o), o.isDefaultPrevented() && n.preventDefault();
}
}, rt.removeEvent = function(e, t, n) {
e.removeEventListener && e.removeEventListener(t, n, !1);
}, rt.Event = function(e, t) {
return this instanceof rt.Event ? (e && e.type ? (this.originalEvent = e, this.type = e.type,
this.isDefaultPrevented = e.defaultPrevented || e.getPreventDefault && e.getPreventDefault() ? s : a) : this.type = e,
t && rt.extend(this, t), this.timeStamp = e && e.timeStamp || rt.now(), this[rt.expando] = !0,
void 0) : new rt.Event(e, t);
}, rt.Event.prototype = {
isDefaultPrevented: a,
isPropagationStopped: a,
isImmediatePropagationStopped: a,
preventDefault: function() {
var e = this.originalEvent;
this.isDefaultPrevented = s, e && e.preventDefault && e.preventDefault();
},
stopPropagation: function() {
var e = this.originalEvent;
this.isPropagationStopped = s, e && e.stopPropagation && e.stopPropagation();
},
stopImmediatePropagation: function() {
this.isImmediatePropagationStopped = s, this.stopPropagation();
}
}, rt.each({
mouseenter: "mouseover",
mouseleave: "mouseout"
}, function(e, t) {
rt.event.special[e] = {
delegateType: t,
bindType: t,
handle: function(e) {
var n, i = this, o = e.relatedTarget, r = e.handleObj;
return (!o || o !== i && !rt.contains(i, o)) && (e.type = r.origType, n = r.handler.apply(this, arguments),
e.type = t), n;
}
};
}), rt.support.focusinBubbles || rt.each({
focus: "focusin",
blur: "focusout"
}, function(e, t) {
var n = 0, i = function(e) {
rt.event.simulate(t, e.target, rt.event.fix(e), !0);
};
rt.event.special[t] = {
setup: function() {
0 === n++ && U.addEventListener(e, i, !0);
},
teardown: function() {
0 === --n && U.removeEventListener(e, i, !0);
}
};
}), rt.fn.extend({
on: function(e, n, i, o, r) {
var s, l;
if ("object" == typeof e) {
"string" != typeof n && (i = i || n, n = t);
for (l in e) this.on(l, n, i, e[l], r);
return this;
}
if (null == i && null == o ? (o = n, i = n = t) : null == o && ("string" == typeof n ? (o = i,
i = t) : (o = i, i = n, n = t)), o === !1) o = a; else if (!o) return this;
return 1 === r && (s = o, o = function(e) {
return rt().off(e), s.apply(this, arguments);
}, o.guid = s.guid || (s.guid = rt.guid++)), this.each(function() {
rt.event.add(this, e, o, i, n);
});
},
one: function(e, t, n, i) {
return this.on(e, t, n, i, 1);
},
off: function(e, n, i) {
var o, r;
if (e && e.preventDefault && e.handleObj) return o = e.handleObj, rt(e.delegateTarget).off(o.namespace ? o.origType + "." + o.namespace : o.origType, o.selector, o.handler),
this;
if ("object" == typeof e) {
for (r in e) this.off(r, n, e[r]);
return this;
}
return (n === !1 || "function" == typeof n) && (i = n, n = t), i === !1 && (i = a),
this.each(function() {
rt.event.remove(this, e, i, n);
});
},
trigger: function(e, t) {
return this.each(function() {
rt.event.trigger(e, t, this);
});
},
triggerHandler: function(e, t) {
var n = this[0];
return n ? rt.event.trigger(e, t, n, !0) : void 0;
}
});
var _t = /^.[^:#\[\.,]*$/, $t = /^(?:parents|prev(?:Until|All))/, Tt = rt.expr.match.needsContext, Dt = {
children: !0,
contents: !0,
next: !0,
prev: !0
};
rt.fn.extend({
find: function(e) {
var t, n = [], i = this, o = i.length;
if ("string" != typeof e) return this.pushStack(rt(e).filter(function() {
for (t = 0; o > t; t++) if (rt.contains(i[t], this)) return !0;
}));
for (t = 0; o > t; t++) rt.find(e, i[t], n);
return n = this.pushStack(o > 1 ? rt.unique(n) : n), n.selector = this.selector ? this.selector + " " + e : e,
n;
},
has: function(e) {
var t = rt(e, this), n = t.length;
return this.filter(function() {
for (var e = 0; n > e; e++) if (rt.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 && Tt.test(e) ? rt(e) : e || [], !1).length;
},
closest: function(e, t) {
for (var n, i = 0, o = this.length, r = [], s = Tt.test(e) || "string" != typeof e ? rt(e, t || this.context) : 0; o > i; i++) for (n = this[i]; n && n !== t; n = n.parentNode) if (n.nodeType < 11 && (s ? s.index(n) > -1 : 1 === n.nodeType && rt.find.matchesSelector(n, e))) {
n = r.push(n);
break;
}
return this.pushStack(r.length > 1 ? rt.unique(r) : r);
},
index: function(e) {
return e ? "string" == typeof e ? tt.call(rt(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 ? rt(e, t) : rt.makeArray(e && e.nodeType ? [ e ] : e), i = rt.merge(this.get(), n);
return this.pushStack(rt.unique(i));
},
addBack: function(e) {
return this.add(null == e ? this.prevObject : this.prevObject.filter(e));
}
}), rt.each({
parent: function(e) {
var t = e.parentNode;
return t && 11 !== t.nodeType ? t : null;
},
parents: function(e) {
return rt.dir(e, "parentNode");
},
parentsUntil: function(e, t, n) {
return rt.dir(e, "parentNode", n);
},
next: function(e) {
return c(e, "nextSibling");
},
prev: function(e) {
return c(e, "previousSibling");
},
nextAll: function(e) {
return rt.dir(e, "nextSibling");
},
prevAll: function(e) {
return rt.dir(e, "previousSibling");
},
nextUntil: function(e, t, n) {
return rt.dir(e, "nextSibling", n);
},
prevUntil: function(e, t, n) {
return rt.dir(e, "previousSibling", n);
},
siblings: function(e) {
return rt.sibling((e.parentNode || {}).firstChild, e);
},
children: function(e) {
return rt.sibling(e.firstChild);
},
contents: function(e) {
return e.contentDocument || rt.merge([], e.childNodes);
}
}, function(e, t) {
rt.fn[e] = function(n, i) {
var o = rt.map(this, t, n);
return "Until" !== e.slice(-5) && (i = n), i && "string" == typeof i && (o = rt.filter(i, o)),
this.length > 1 && (Dt[e] || rt.unique(o), $t.test(e) && o.reverse()), this.pushStack(o);
};
}), rt.extend({
filter: function(e, t, n) {
var i = t[0];
return n && (e = ":not(" + e + ")"), 1 === t.length && 1 === i.nodeType ? rt.find.matchesSelector(i, e) ? [ i ] : [] : rt.find.matches(e, rt.grep(t, function(e) {
return 1 === e.nodeType;
}));
},
dir: function(e, n, i) {
for (var o = [], r = i !== t; (e = e[n]) && 9 !== e.nodeType; ) if (1 === e.nodeType) {
if (r && rt(e).is(i)) break;
o.push(e);
}
return o;
},
sibling: function(e, t) {
for (var n = []; e; e = e.nextSibling) 1 === e.nodeType && e !== t && n.push(e);
return n;
}
});
var Lt = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi, Bt = /<([\w:]+)/, Mt = /<|&#?\w+;/, Rt = /<(?:script|style|link)/i, It = /^(?:checkbox|radio)$/i, Pt = /checked\s*(?:[^=]|=\s*.checked.)/i, Nt = /^$|\/(?:java|ecma)script/i, Ot = /^true\/(.*)/, zt = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g, jt = {
option: [ 1, "<select multiple='multiple'>", "</select>" ],
thead: [ 1, "<table>", "</table>" ],
col: [ 2, "<table><colgroup>", "</colgroup></table>" ],
tr: [ 2, "<table><tbody>", "</tbody></table>" ],
td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],
_default: [ 0, "", "" ]
};
jt.optgroup = jt.option, jt.tbody = jt.tfoot = jt.colgroup = jt.caption = jt.thead,
jt.th = jt.td, rt.fn.extend({
text: function(e) {
return rt.access(this, function(e) {
return e === t ? rt.text(this) : this.empty().append((this[0] && this[0].ownerDocument || U).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 ? rt.filter(e, this) : this, o = 0; null != (n = i[o]); o++) t || 1 !== n.nodeType || rt.cleanData(m(n)),
n.parentNode && (t && rt.contains(n.ownerDocument, n) && f(m(n, "script")), n.parentNode.removeChild(n));
return this;
},
empty: function() {
for (var e, t = 0; null != (e = this[t]); t++) 1 === e.nodeType && (rt.cleanData(m(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 rt.clone(this, e, t);
});
},
html: function(e) {
return rt.access(this, function(e) {
var n = this[0] || {}, i = 0, o = this.length;
if (e === t && 1 === n.nodeType) return n.innerHTML;
if ("string" == typeof e && !Rt.test(e) && !jt[(Bt.exec(e) || [ "", "" ])[1].toLowerCase()]) {
e = e.replace(Lt, "<$1></$2>");
try {
for (;o > i; i++) n = this[i] || {}, 1 === n.nodeType && (rt.cleanData(m(n, !1)),
n.innerHTML = e);
n = 0;
} catch (r) {}
}
n && this.empty().append(e);
}, null, e, arguments.length);
},
replaceWith: function() {
var e = rt.map(this, function(e) {
return [ e.nextSibling, e.parentNode ];
}), t = 0;
return this.domManip(arguments, function(n) {
var i = e[t++], o = e[t++];
o && (i && i.parentNode !== o && (i = this.nextSibling), rt(this).remove(), o.insertBefore(n, i));
}, !0), t ? this : this.remove();
},
detach: function(e) {
return this.remove(e, !0);
},
domManip: function(e, t, n) {
e = Z.apply([], e);
var i, o, r, s, a, l, c = 0, u = this.length, d = this, f = u - 1, g = e[0], v = rt.isFunction(g);
if (v || !(1 >= u || "string" != typeof g || rt.support.checkClone) && Pt.test(g)) return this.each(function(i) {
var o = d.eq(i);
v && (e[0] = g.call(this, i, o.html())), o.domManip(e, t, n);
});
if (u && (i = rt.buildFragment(e, this[0].ownerDocument, !1, !n && this), o = i.firstChild,
1 === i.childNodes.length && (i = o), o)) {
for (r = rt.map(m(i, "script"), h), s = r.length; u > c; c++) a = i, c !== f && (a = rt.clone(a, !0, !0),
s && rt.merge(r, m(a, "script"))), t.call(this[c], a, c);
if (s) for (l = r[r.length - 1].ownerDocument, rt.map(r, p), c = 0; s > c; c++) a = r[c],
Nt.test(a.type || "") && !mt.access(a, "globalEval") && rt.contains(l, a) && (a.src ? rt._evalUrl(a.src) : rt.globalEval(a.textContent.replace(zt, "")));
}
return this;
}
}), rt.each({
appendTo: "append",
prependTo: "prepend",
insertBefore: "before",
insertAfter: "after",
replaceAll: "replaceWith"
}, function(e, t) {
rt.fn[e] = function(e) {
for (var n, i = [], o = rt(e), r = o.length - 1, s = 0; r >= s; s++) n = s === r ? this : this.clone(!0),
rt(o[s])[t](n), Q.apply(i, n.get());
return this.pushStack(i);
};
}), rt.extend({
clone: function(e, t, n) {
var i, o, r, s, a = e.cloneNode(!0), l = rt.contains(e.ownerDocument, e);
if (!(rt.support.noCloneChecked || 1 !== e.nodeType && 11 !== e.nodeType || rt.isXMLDoc(e))) for (s = m(a),
r = m(e), i = 0, o = r.length; o > i; i++) v(r[i], s[i]);
if (t) if (n) for (r = r || m(e), s = s || m(a), i = 0, o = r.length; o > i; i++) g(r[i], s[i]); else g(e, a);
return s = m(a, "script"), s.length > 0 && f(s, !l && m(e, "script")), a;
},
buildFragment: function(e, t, n, i) {
for (var o, r, s, a, l, c, u = 0, d = e.length, h = t.createDocumentFragment(), p = []; d > u; u++) if (o = e[u],
o || 0 === o) if ("object" === rt.type(o)) rt.merge(p, o.nodeType ? [ o ] : o); else if (Mt.test(o)) {
for (r = r || h.appendChild(t.createElement("div")), s = (Bt.exec(o) || [ "", "" ])[1].toLowerCase(),
a = jt[s] || jt._default, r.innerHTML = a[1] + o.replace(Lt, "<$1></$2>") + a[2],
c = a[0]; c--; ) r = r.lastChild;
rt.merge(p, r.childNodes), r = h.firstChild, r.textContent = "";
} else p.push(t.createTextNode(o));
for (h.textContent = "", u = 0; o = p[u++]; ) if ((!i || -1 === rt.inArray(o, i)) && (l = rt.contains(o.ownerDocument, o),
r = m(h.appendChild(o), "script"), l && f(r), n)) for (c = 0; o = r[c++]; ) Nt.test(o.type || "") && n.push(o);
return h;
},
cleanData: function(e) {
for (var n, i, r, s, a, l, c = rt.event.special, u = 0; (i = e[u]) !== t; u++) {
if (o.accepts(i) && (a = i[mt.expando], a && (n = mt.cache[a]))) {
if (r = Object.keys(n.events || {}), r.length) for (l = 0; (s = r[l]) !== t; l++) c[s] ? rt.event.remove(i, s) : rt.removeEvent(i, s, n.handle);
mt.cache[a] && delete mt.cache[a];
}
delete gt.cache[i[gt.expando]];
}
},
_evalUrl: function(e) {
return rt.ajax({
url: e,
type: "GET",
dataType: "script",
async: !1,
global: !1,
"throws": !0
});
}
}), rt.fn.extend({
wrapAll: function(e) {
var t;
return rt.isFunction(e) ? this.each(function(t) {
rt(this).wrapAll(e.call(this, t));
}) : (this[0] && (t = rt(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 rt.isFunction(e) ? this.each(function(t) {
rt(this).wrapInner(e.call(this, t));
}) : this.each(function() {
var t = rt(this), n = t.contents();
n.length ? n.wrapAll(e) : t.append(e);
});
},
wrap: function(e) {
var t = rt.isFunction(e);
return this.each(function(n) {
rt(this).wrapAll(t ? e.call(this, n) : e);
});
},
unwrap: function() {
return this.parent().each(function() {
rt.nodeName(this, "body") || rt(this).replaceWith(this.childNodes);
}).end();
}
});
var Ht, qt, Wt = /^(none|table(?!-c[ea]).+)/, Ut = /^margin/, Gt = new RegExp("^(" + st + ")(.*)$", "i"), Vt = new RegExp("^(" + st + ")(?!px)[a-z%]+$", "i"), Kt = new RegExp("^([+-])=(" + st + ")", "i"), Xt = {
BODY: "block"
}, Yt = {
position: "absolute",
visibility: "hidden",
display: "block"
}, Jt = {
letterSpacing: 0,
fontWeight: 400
}, Zt = [ "Top", "Right", "Bottom", "Left" ], Qt = [ "Webkit", "O", "Moz", "ms" ];
rt.fn.extend({
css: function(e, n) {
return rt.access(this, function(e, n, i) {
var o, r, s = {}, a = 0;
if (rt.isArray(n)) {
for (o = w(e), r = n.length; r > a; a++) s[n[a]] = rt.css(e, n[a], !1, o);
return s;
}
return i !== t ? rt.style(e, n, i) : rt.css(e, n);
}, e, n, arguments.length > 1);
},
show: function() {
return C(this, !0);
},
hide: function() {
return C(this);
},
toggle: function(e) {
return "boolean" == typeof e ? e ? this.show() : this.hide() : this.each(function() {
y(this) ? rt(this).show() : rt(this).hide();
});
}
}), rt.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, o) {
if (e && 3 !== e.nodeType && 8 !== e.nodeType && e.style) {
var r, s, a, l = rt.camelCase(n), c = e.style;
return n = rt.cssProps[l] || (rt.cssProps[l] = b(c, l)), a = rt.cssHooks[n] || rt.cssHooks[l],
i === t ? a && "get" in a && (r = a.get(e, !1, o)) !== t ? r : c[n] : (s = typeof i,
"string" === s && (r = Kt.exec(i)) && (i = (r[1] + 1) * r[2] + parseFloat(rt.css(e, n)),
s = "number"), null == i || "number" === s && isNaN(i) || ("number" !== s || rt.cssNumber[l] || (i += "px"),
rt.support.clearCloneStyle || "" !== i || 0 !== n.indexOf("background") || (c[n] = "inherit"),
a && "set" in a && (i = a.set(e, i, o)) === t || (c[n] = i)), void 0);
}
},
css: function(e, n, i, o) {
var r, s, a, l = rt.camelCase(n);
return n = rt.cssProps[l] || (rt.cssProps[l] = b(e.style, l)), a = rt.cssHooks[n] || rt.cssHooks[l],
a && "get" in a && (r = a.get(e, !0, i)), r === t && (r = Ht(e, n, o)), "normal" === r && n in Jt && (r = Jt[n]),
"" === i || i ? (s = parseFloat(r), i === !0 || rt.isNumeric(s) ? s || 0 : r) : r;
}
}), Ht = function(e, n, i) {
var o, r, s, a = i || w(e), l = a ? a.getPropertyValue(n) || a[n] : t, c = e.style;
return a && ("" !== l || rt.contains(e.ownerDocument, e) || (l = rt.style(e, n)),
Vt.test(l) && Ut.test(n) && (o = c.width, r = c.minWidth, s = c.maxWidth, c.minWidth = c.maxWidth = c.width = l,
l = a.width, c.width = o, c.minWidth = r, c.maxWidth = s)), l;
}, rt.each([ "height", "width" ], function(e, t) {
rt.cssHooks[t] = {
get: function(e, n, i) {
return n ? 0 === e.offsetWidth && Wt.test(rt.css(e, "display")) ? rt.swap(e, Yt, function() {
return S(e, t, i);
}) : S(e, t, i) : void 0;
},
set: function(e, n, i) {
var o = i && w(e);
return x(e, n, i ? E(e, t, i, rt.support.boxSizing && "border-box" === rt.css(e, "boxSizing", !1, o), o) : 0);
}
};
}), rt(function() {
rt.support.reliableMarginRight || (rt.cssHooks.marginRight = {
get: function(e, t) {
return t ? rt.swap(e, {
display: "inline-block"
}, Ht, [ e, "marginRight" ]) : void 0;
}
}), !rt.support.pixelPosition && rt.fn.position && rt.each([ "top", "left" ], function(e, t) {
rt.cssHooks[t] = {
get: function(e, n) {
return n ? (n = Ht(e, t), Vt.test(n) ? rt(e).position()[t] + "px" : n) : void 0;
}
};
});
}), rt.expr && rt.expr.filters && (rt.expr.filters.hidden = function(e) {
return e.offsetWidth <= 0 && e.offsetHeight <= 0;
}, rt.expr.filters.visible = function(e) {
return !rt.expr.filters.hidden(e);
}), rt.each({
margin: "",
padding: "",
border: "Width"
}, function(e, t) {
rt.cssHooks[e + t] = {
expand: function(n) {
for (var i = 0, o = {}, r = "string" == typeof n ? n.split(" ") : [ n ]; 4 > i; i++) o[e + Zt[i] + t] = r[i] || r[i - 2] || r[0];
return o;
}
}, Ut.test(e) || (rt.cssHooks[e + t].set = x);
});
var en = /%20/g, tn = /\[\]$/, nn = /\r?\n/g, on = /^(?:submit|button|image|reset|file)$/i, rn = /^(?:input|select|textarea|keygen)/i;
rt.fn.extend({
serialize: function() {
return rt.param(this.serializeArray());
},
serializeArray: function() {
return this.map(function() {
var e = rt.prop(this, "elements");
return e ? rt.makeArray(e) : this;
}).filter(function() {
var e = this.type;
return this.name && !rt(this).is(":disabled") && rn.test(this.nodeName) && !on.test(e) && (this.checked || !It.test(e));
}).map(function(e, t) {
var n = rt(this).val();
return null == n ? null : rt.isArray(n) ? rt.map(n, function(e) {
return {
name: t.name,
value: e.replace(nn, "\r\n")
};
}) : {
name: t.name,
value: n.replace(nn, "\r\n")
};
}).get();
}
}), rt.param = function(e, n) {
var i, o = [], r = function(e, t) {
t = rt.isFunction(t) ? t() : null == t ? "" : t, o[o.length] = encodeURIComponent(e) + "=" + encodeURIComponent(t);
};
if (n === t && (n = rt.ajaxSettings && rt.ajaxSettings.traditional), rt.isArray(e) || e.jquery && !rt.isPlainObject(e)) rt.each(e, function() {
r(this.name, this.value);
}); else for (i in e) F(i, e[i], n, r);
return o.join("&").replace(en, "+");
}, rt.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) {
rt.fn[t] = function(e, n) {
return arguments.length > 0 ? this.on(t, null, e, n) : this.trigger(t);
};
}), rt.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 sn, an, ln = rt.now(), cn = /\?/, un = /#.*$/, dn = /([?&])_=[^&]*/, hn = /^(.*?):[ \t]*([^\r\n]*)$/gm, pn = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/, fn = /^(?:GET|HEAD)$/, gn = /^\/\//, mn = /^([\w.+-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/, vn = rt.fn.load, bn = {}, yn = {}, wn = "*/".concat("*");
try {
an = W.href;
} catch (Cn) {
an = U.createElement("a"), an.href = "", an = an.href;
}
sn = mn.exec(an.toLowerCase()) || [], rt.fn.load = function(e, n, i) {
if ("string" != typeof e && vn) return vn.apply(this, arguments);
var o, r, s, a = this, l = e.indexOf(" ");
return l >= 0 && (o = e.slice(l), e = e.slice(0, l)), rt.isFunction(n) ? (i = n,
n = t) : n && "object" == typeof n && (r = "POST"), a.length > 0 && rt.ajax({
url: e,
type: r,
dataType: "html",
data: n
}).done(function(e) {
s = arguments, a.html(o ? rt("<div>").append(rt.parseHTML(e)).find(o) : e);
}).complete(i && function(e, t) {
a.each(i, s || [ e.responseText, t, e ]);
}), this;
}, rt.each([ "ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend" ], function(e, t) {
rt.fn[t] = function(e) {
return this.on(t, e);
};
}), rt.extend({
active: 0,
lastModified: {},
etag: {},
ajaxSettings: {
url: an,
type: "GET",
isLocal: pn.test(sn[1]),
global: !0,
processData: !0,
async: !0,
contentType: "application/x-www-form-urlencoded; charset=UTF-8",
accepts: {
"*": wn,
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": rt.parseJSON,
"text xml": rt.parseXML
},
flatOptions: {
url: !0,
context: !0
}
},
ajaxSetup: function(e, t) {
return t ? T(T(e, rt.ajaxSettings), t) : T(rt.ajaxSettings, e);
},
ajaxPrefilter: _(bn),
ajaxTransport: _(yn),
ajax: function(e, n) {
function i(e, n, i, a) {
var c, d, b, y, C, E = n;
2 !== w && (w = 2, l && clearTimeout(l), o = t, s = a || "", x.readyState = e > 0 ? 4 : 0,
c = e >= 200 && 300 > e || 304 === e, i && (y = D(h, x, i)), y = L(h, y, x, c),
c ? (h.ifModified && (C = x.getResponseHeader("Last-Modified"), C && (rt.lastModified[r] = C),
C = x.getResponseHeader("etag"), C && (rt.etag[r] = C)), 204 === e || "HEAD" === h.type ? E = "nocontent" : 304 === e ? E = "notmodified" : (E = y.state,
d = y.data, b = y.error, c = !b)) : (b = E, (e || !E) && (E = "error", 0 > e && (e = 0))),
x.status = e, x.statusText = (n || E) + "", c ? g.resolveWith(p, [ d, E, x ]) : g.rejectWith(p, [ x, E, b ]),
x.statusCode(v), v = t, u && f.trigger(c ? "ajaxSuccess" : "ajaxError", [ x, h, c ? d : b ]),
m.fireWith(p, [ x, E ]), u && (f.trigger("ajaxComplete", [ x, h ]), --rt.active || rt.event.trigger("ajaxStop")));
}
"object" == typeof e && (n = e, e = t), n = n || {};
var o, r, s, a, l, c, u, d, h = rt.ajaxSetup({}, n), p = h.context || h, f = h.context && (p.nodeType || p.jquery) ? rt(p) : rt.event, g = rt.Deferred(), m = rt.Callbacks("once memory"), v = h.statusCode || {}, b = {}, y = {}, w = 0, C = "canceled", x = {
readyState: 0,
getResponseHeader: function(e) {
var t;
if (2 === w) {
if (!a) for (a = {}; t = hn.exec(s); ) a[t[1].toLowerCase()] = t[2];
t = a[e.toLowerCase()];
}
return null == t ? null : t;
},
getAllResponseHeaders: function() {
return 2 === w ? s : null;
},
setRequestHeader: function(e, t) {
var n = e.toLowerCase();
return w || (e = y[n] = y[n] || e, b[e] = t), this;
},
overrideMimeType: function(e) {
return w || (h.mimeType = e), this;
},
statusCode: function(e) {
var t;
if (e) if (2 > w) for (t in e) v[t] = [ v[t], e[t] ]; else x.always(e[x.status]);
return this;
},
abort: function(e) {
var t = e || C;
return o && o.abort(t), i(0, t), this;
}
};
if (g.promise(x).complete = m.add, x.success = x.done, x.error = x.fail, h.url = ((e || h.url || an) + "").replace(un, "").replace(gn, sn[1] + "//"),
h.type = n.method || n.type || h.method || h.type, h.dataTypes = rt.trim(h.dataType || "*").toLowerCase().match(at) || [ "" ],
null == h.crossDomain && (c = mn.exec(h.url.toLowerCase()), h.crossDomain = !(!c || c[1] === sn[1] && c[2] === sn[2] && (c[3] || ("http:" === c[1] ? "80" : "443")) === (sn[3] || ("http:" === sn[1] ? "80" : "443")))),
h.data && h.processData && "string" != typeof h.data && (h.data = rt.param(h.data, h.traditional)),
$(bn, h, n, x), 2 === w) return x;
u = h.global, u && 0 === rt.active++ && rt.event.trigger("ajaxStart"), h.type = h.type.toUpperCase(),
h.hasContent = !fn.test(h.type), r = h.url, h.hasContent || (h.data && (r = h.url += (cn.test(r) ? "&" : "?") + h.data,
delete h.data), h.cache === !1 && (h.url = dn.test(r) ? r.replace(dn, "$1_=" + ln++) : r + (cn.test(r) ? "&" : "?") + "_=" + ln++)),
h.ifModified && (rt.lastModified[r] && x.setRequestHeader("If-Modified-Since", rt.lastModified[r]),
rt.etag[r] && x.setRequestHeader("If-None-Match", rt.etag[r])), (h.data && h.hasContent && h.contentType !== !1 || n.contentType) && x.setRequestHeader("Content-Type", h.contentType),
x.setRequestHeader("Accept", h.dataTypes[0] && h.accepts[h.dataTypes[0]] ? h.accepts[h.dataTypes[0]] + ("*" !== h.dataTypes[0] ? ", " + wn + "; q=0.01" : "") : h.accepts["*"]);
for (d in h.headers) x.setRequestHeader(d, h.headers[d]);
if (h.beforeSend && (h.beforeSend.call(p, x, h) === !1 || 2 === w)) return x.abort();
C = "abort";
for (d in {
success: 1,
error: 1,
complete: 1
}) x[d](h[d]);
if (o = $(yn, h, n, x)) {
x.readyState = 1, u && f.trigger("ajaxSend", [ x, h ]), h.async && h.timeout > 0 && (l = setTimeout(function() {
x.abort("timeout");
}, h.timeout));
try {
w = 1, o.send(b, i);
} catch (E) {
if (!(2 > w)) throw E;
i(-1, E);
}
} else i(-1, "No Transport");
return x;
},
getJSON: function(e, t, n) {
return rt.get(e, t, n, "json");
},
getScript: function(e, n) {
return rt.get(e, t, n, "script");
}
}), rt.each([ "get", "post" ], function(e, n) {
rt[n] = function(e, i, o, r) {
return rt.isFunction(i) && (r = r || o, o = i, i = t), rt.ajax({
url: e,
type: n,
dataType: r,
data: i,
success: o
});
};
}), rt.ajaxSetup({
accepts: {
script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"
},
contents: {
script: /(?:java|ecma)script/
},
converters: {
"text script": function(e) {
return rt.globalEval(e), e;
}
}
}), rt.ajaxPrefilter("script", function(e) {
e.cache === t && (e.cache = !1), e.crossDomain && (e.type = "GET");
}), rt.ajaxTransport("script", function(e) {
if (e.crossDomain) {
var t, n;
return {
send: function(i, o) {
t = rt("<script>").prop({
async: !0,
charset: e.scriptCharset,
src: e.url
}).on("load error", n = function(e) {
t.remove(), n = null, e && o("error" === e.type ? 404 : 200, e.type);
}), U.head.appendChild(t[0]);
},
abort: function() {
n && n();
}
};
}
});
var xn = [], En = /(=)\?(?=&|$)|\?\?/;
rt.ajaxSetup({
jsonp: "callback",
jsonpCallback: function() {
var e = xn.pop() || rt.expando + "_" + ln++;
return this[e] = !0, e;
}
}), rt.ajaxPrefilter("json jsonp", function(n, i, o) {
var r, s, a, l = n.jsonp !== !1 && (En.test(n.url) ? "url" : "string" == typeof n.data && !(n.contentType || "").indexOf("application/x-www-form-urlencoded") && En.test(n.data) && "data");
return l || "jsonp" === n.dataTypes[0] ? (r = n.jsonpCallback = rt.isFunction(n.jsonpCallback) ? n.jsonpCallback() : n.jsonpCallback,
l ? n[l] = n[l].replace(En, "$1" + r) : n.jsonp !== !1 && (n.url += (cn.test(n.url) ? "&" : "?") + n.jsonp + "=" + r),
n.converters["script json"] = function() {
return a || rt.error(r + " was not called"), a[0];
}, n.dataTypes[0] = "json", s = e[r], e[r] = function() {
a = arguments;
}, o.always(function() {
e[r] = s, n[r] && (n.jsonpCallback = i.jsonpCallback, xn.push(r)), a && rt.isFunction(s) && s(a[0]),
a = s = t;
}), "script") : void 0;
}), rt.ajaxSettings.xhr = function() {
try {
return new XMLHttpRequest();
} catch (e) {}
};
var Sn = rt.ajaxSettings.xhr(), An = {
0: 200,
1223: 204
}, kn = 0, Fn = {};
e.ActiveXObject && rt(e).on("unload", function() {
for (var e in Fn) Fn[e]();
Fn = t;
}), rt.support.cors = !!Sn && "withCredentials" in Sn, rt.support.ajax = Sn = !!Sn,
rt.ajaxTransport(function(e) {
var n;
return rt.support.cors || Sn && !e.crossDomain ? {
send: function(i, o) {
var r, s, a = e.xhr();
if (a.open(e.type, e.url, e.async, e.username, e.password), e.xhrFields) for (r in e.xhrFields) a[r] = e.xhrFields[r];
e.mimeType && a.overrideMimeType && a.overrideMimeType(e.mimeType), e.crossDomain || i["X-Requested-With"] || (i["X-Requested-With"] = "XMLHttpRequest");
for (r in i) a.setRequestHeader(r, i[r]);
n = function(e) {
return function() {
n && (delete Fn[s], n = a.onload = a.onerror = null, "abort" === e ? a.abort() : "error" === e ? o(a.status || 404, a.statusText) : o(An[a.status] || a.status, a.statusText, "string" == typeof a.responseText ? {
text: a.responseText
} : t, a.getAllResponseHeaders()));
};
}, a.onload = n(), a.onerror = n("error"), n = Fn[s = kn++] = n("abort"), a.send(e.hasContent && e.data || null);
},
abort: function() {
n && n();
}
} : void 0;
});
var _n, $n, Tn = /^(?:toggle|show|hide)$/, Dn = new RegExp("^(?:([+-])=|)(" + st + ")([a-z%]*)$", "i"), Ln = /queueHooks$/, Bn = [ P ], Mn = {
"*": [ function(e, t) {
var n = this.createTween(e, t), i = n.cur(), o = Dn.exec(t), r = o && o[3] || (rt.cssNumber[e] ? "" : "px"), s = (rt.cssNumber[e] || "px" !== r && +i) && Dn.exec(rt.css(n.elem, e)), a = 1, l = 20;
if (s && s[3] !== r) {
r = r || s[3], o = o || [], s = +i || 1;
do a = a || ".5", s /= a, rt.style(n.elem, e, s + r); while (a !== (a = n.cur() / i) && 1 !== a && --l);
}
return o && (s = n.start = +s || +i || 0, n.unit = r, n.end = o[1] ? s + (o[1] + 1) * o[2] : +o[2]),
n;
} ]
};
rt.Animation = rt.extend(R, {
tweener: function(e, t) {
rt.isFunction(e) ? (t = e, e = [ "*" ]) : e = e.split(" ");
for (var n, i = 0, o = e.length; o > i; i++) n = e[i], Mn[n] = Mn[n] || [], Mn[n].unshift(t);
},
prefilter: function(e, t) {
t ? Bn.unshift(e) : Bn.push(e);
}
}), rt.Tween = N, N.prototype = {
constructor: N,
init: function(e, t, n, i, o, r) {
this.elem = e, this.prop = n, this.easing = o || "swing", this.options = t, this.start = this.now = this.cur(),
this.end = i, this.unit = r || (rt.cssNumber[n] ? "" : "px");
},
cur: function() {
var e = N.propHooks[this.prop];
return e && e.get ? e.get(this) : N.propHooks._default.get(this);
},
run: function(e) {
var t, n = N.propHooks[this.prop];
return this.pos = t = this.options.duration ? rt.easing[this.easing](e, this.options.duration * e, 0, 1, this.options.duration) : e,
this.now = (this.end - this.start) * t + this.start, this.options.step && this.options.step.call(this.elem, this.now, this),
n && n.set ? n.set(this) : N.propHooks._default.set(this), this;
}
}, N.prototype.init.prototype = N.prototype, N.propHooks = {
_default: {
get: function(e) {
var t;
return null == e.elem[e.prop] || e.elem.style && null != e.elem.style[e.prop] ? (t = rt.css(e.elem, e.prop, ""),
t && "auto" !== t ? t : 0) : e.elem[e.prop];
},
set: function(e) {
rt.fx.step[e.prop] ? rt.fx.step[e.prop](e) : e.elem.style && (null != e.elem.style[rt.cssProps[e.prop]] || rt.cssHooks[e.prop]) ? rt.style(e.elem, e.prop, e.now + e.unit) : e.elem[e.prop] = e.now;
}
}
}, N.propHooks.scrollTop = N.propHooks.scrollLeft = {
set: function(e) {
e.elem.nodeType && e.elem.parentNode && (e.elem[e.prop] = e.now);
}
}, rt.each([ "toggle", "show", "hide" ], function(e, t) {
var n = rt.fn[t];
rt.fn[t] = function(e, i, o) {
return null == e || "boolean" == typeof e ? n.apply(this, arguments) : this.animate(O(t, !0), e, i, o);
};
}), rt.fn.extend({
fadeTo: function(e, t, n, i) {
return this.filter(y).css("opacity", 0).show().end().animate({
opacity: t
}, e, n, i);
},
animate: function(e, t, n, i) {
var o = rt.isEmptyObject(e), r = rt.speed(t, n, i), s = function() {
var t = R(this, rt.extend({}, e), r);
(o || mt.get(this, "finish")) && t.stop(!0);
};
return s.finish = s, o || r.queue === !1 ? this.each(s) : this.queue(r.queue, s);
},
stop: function(e, n, i) {
var o = function(e) {
var t = e.stop;
delete e.stop, t(i);
};
return "string" != typeof e && (i = n, n = e, e = t), n && e !== !1 && this.queue(e || "fx", []),
this.each(function() {
var t = !0, n = null != e && e + "queueHooks", r = rt.timers, s = mt.get(this);
if (n) s[n] && s[n].stop && o(s[n]); else for (n in s) s[n] && s[n].stop && Ln.test(n) && o(s[n]);
for (n = r.length; n--; ) r[n].elem !== this || null != e && r[n].queue !== e || (r[n].anim.stop(i),
t = !1, r.splice(n, 1));
(t || !i) && rt.dequeue(this, e);
});
},
finish: function(e) {
return e !== !1 && (e = e || "fx"), this.each(function() {
var t, n = mt.get(this), i = n[e + "queue"], o = n[e + "queueHooks"], r = rt.timers, s = i ? i.length : 0;
for (n.finish = !0, rt.queue(this, e, []), o && o.stop && o.stop.call(this, !0),
t = r.length; t--; ) r[t].elem === this && r[t].queue === e && (r[t].anim.stop(!0),
r.splice(t, 1));
for (t = 0; s > t; t++) i[t] && i[t].finish && i[t].finish.call(this);
delete n.finish;
});
}
}), rt.each({
slideDown: O("show"),
slideUp: O("hide"),
slideToggle: O("toggle"),
fadeIn: {
opacity: "show"
},
fadeOut: {
opacity: "hide"
},
fadeToggle: {
opacity: "toggle"
}
}, function(e, t) {
rt.fn[e] = function(e, n, i) {
return this.animate(t, e, n, i);
};
}), rt.speed = function(e, t, n) {
var i = e && "object" == typeof e ? rt.extend({}, e) : {
complete: n || !n && t || rt.isFunction(e) && e,
duration: e,
easing: n && t || t && !rt.isFunction(t) && t
};
return i.duration = rt.fx.off ? 0 : "number" == typeof i.duration ? i.duration : i.duration in rt.fx.speeds ? rt.fx.speeds[i.duration] : rt.fx.speeds._default,
(null == i.queue || i.queue === !0) && (i.queue = "fx"), i.old = i.complete, i.complete = function() {
rt.isFunction(i.old) && i.old.call(this), i.queue && rt.dequeue(this, i.queue);
}, i;
}, rt.easing = {
linear: function(e) {
return e;
},
swing: function(e) {
return .5 - Math.cos(e * Math.PI) / 2;
}
}, rt.timers = [], rt.fx = N.prototype.init, rt.fx.tick = function() {
var e, n = rt.timers, i = 0;
for (_n = rt.now(); i < n.length; i++) e = n[i], e() || n[i] !== e || n.splice(i--, 1);
n.length || rt.fx.stop(), _n = t;
}, rt.fx.timer = function(e) {
e() && rt.timers.push(e) && rt.fx.start();
}, rt.fx.interval = 13, rt.fx.start = function() {
$n || ($n = setInterval(rt.fx.tick, rt.fx.interval));
}, rt.fx.stop = function() {
clearInterval($n), $n = null;
}, rt.fx.speeds = {
slow: 600,
fast: 200,
_default: 400
}, rt.fx.step = {}, rt.expr && rt.expr.filters && (rt.expr.filters.animated = function(e) {
return rt.grep(rt.timers, function(t) {
return e === t.elem;
}).length;
}), rt.fn.offset = function(e) {
if (arguments.length) return e === t ? this : this.each(function(t) {
rt.offset.setOffset(this, e, t);
});
var n, i, o = this[0], r = {
top: 0,
left: 0
}, s = o && o.ownerDocument;
if (s) return n = s.documentElement, rt.contains(n, o) ? (typeof o.getBoundingClientRect !== q && (r = o.getBoundingClientRect()),
i = z(s), {
top: r.top + i.pageYOffset - n.clientTop,
left: r.left + i.pageXOffset - n.clientLeft
}) : r;
}, rt.offset = {
setOffset: function(e, t, n) {
var i, o, r, s, a, l, c, u = rt.css(e, "position"), d = rt(e), h = {};
"static" === u && (e.style.position = "relative"), a = d.offset(), r = rt.css(e, "top"),
l = rt.css(e, "left"), c = ("absolute" === u || "fixed" === u) && (r + l).indexOf("auto") > -1,
c ? (i = d.position(), s = i.top, o = i.left) : (s = parseFloat(r) || 0, o = parseFloat(l) || 0),
rt.isFunction(t) && (t = t.call(e, n, a)), null != t.top && (h.top = t.top - a.top + s),
null != t.left && (h.left = t.left - a.left + o), "using" in t ? t.using.call(e, h) : d.css(h);
}
}, rt.fn.extend({
position: function() {
if (this[0]) {
var e, t, n = this[0], i = {
top: 0,
left: 0
};
return "fixed" === rt.css(n, "position") ? t = n.getBoundingClientRect() : (e = this.offsetParent(),
t = this.offset(), rt.nodeName(e[0], "html") || (i = e.offset()), i.top += rt.css(e[0], "borderTopWidth", !0),
i.left += rt.css(e[0], "borderLeftWidth", !0)), {
top: t.top - i.top - rt.css(n, "marginTop", !0),
left: t.left - i.left - rt.css(n, "marginLeft", !0)
};
}
},
offsetParent: function() {
return this.map(function() {
for (var e = this.offsetParent || G; e && !rt.nodeName(e, "html") && "static" === rt.css(e, "position"); ) e = e.offsetParent;
return e || G;
});
}
}), rt.each({
scrollLeft: "pageXOffset",
scrollTop: "pageYOffset"
}, function(n, i) {
var o = "pageYOffset" === i;
rt.fn[n] = function(r) {
return rt.access(this, function(n, r, s) {
var a = z(n);
return s === t ? a ? a[i] : n[r] : (a ? a.scrollTo(o ? e.pageXOffset : s, o ? s : e.pageYOffset) : n[r] = s,
void 0);
}, n, r, arguments.length, null);
};
}), rt.each({
Height: "height",
Width: "width"
}, function(e, n) {
rt.each({
padding: "inner" + e,
content: n,
"": "outer" + e
}, function(i, o) {
rt.fn[o] = function(o, r) {
var s = arguments.length && (i || "boolean" != typeof o), a = i || (o === !0 || r === !0 ? "margin" : "border");
return rt.access(this, function(n, i, o) {
var r;
return rt.isWindow(n) ? n.document.documentElement["client" + e] : 9 === n.nodeType ? (r = n.documentElement,
Math.max(n.body["scroll" + e], r["scroll" + e], n.body["offset" + e], r["offset" + e], r["client" + e])) : o === t ? rt.css(n, i, a) : rt.style(n, i, o, a);
}, n, s ? o : t, s, null);
};
});
}), rt.fn.size = function() {
return this.length;
}, rt.fn.andSelf = rt.fn.addBack, "object" == typeof module && module && "object" == typeof module.exports ? module.exports = rt : "function" == typeof define && define.amd && define("jquery", [], function() {
return rt;
}), "object" == typeof e && "object" == typeof e.document && (e.jQuery = e.$ = rt);
})(window), function() {
var e = this, t = e._, n = {}, i = Array.prototype, o = Object.prototype, r = Function.prototype, s = i.push, a = i.slice, l = i.concat, c = o.toString, u = o.hasOwnProperty, d = i.forEach, h = i.map, p = i.reduce, f = i.reduceRight, g = i.filter, m = i.every, v = i.some, b = i.indexOf, y = i.lastIndexOf, w = Array.isArray, C = Object.keys, x = r.bind, E = function(e) {
return e instanceof E ? e : this instanceof E ? (this._wrapped = e, void 0) : new E(e);
};
"undefined" != typeof exports ? ("undefined" != typeof module && module.exports && (exports = module.exports = E),
exports._ = E) : e._ = E, E.VERSION = "1.5.1";
var S = E.each = E.forEach = function(e, t, i) {
if (null != e) if (d && e.forEach === d) e.forEach(t, i); else if (e.length === +e.length) {
for (var o = 0, r = e.length; r > o; o++) if (t.call(i, e[o], o, e) === n) return;
} else for (var s in e) if (E.has(e, s) && t.call(i, e[s], s, e) === n) return;
};
E.map = E.collect = function(e, t, n) {
var i = [];
return null == e ? i : h && e.map === h ? e.map(t, n) : (S(e, function(e, o, r) {
i.push(t.call(n, e, o, r));
}), i);
};
var A = "Reduce of empty array with no initial value";
E.reduce = E.foldl = E.inject = function(e, t, n, i) {
var o = arguments.length > 2;
if (null == e && (e = []), p && e.reduce === p) return i && (t = E.bind(t, i)),
o ? e.reduce(t, n) : e.reduce(t);
if (S(e, function(e, r, s) {
o ? n = t.call(i, n, e, r, s) : (n = e, o = !0);
}), !o) throw new TypeError(A);
return n;
}, E.reduceRight = E.foldr = function(e, t, n, i) {
var o = arguments.length > 2;
if (null == e && (e = []), f && e.reduceRight === f) return i && (t = E.bind(t, i)),
o ? e.reduceRight(t, n) : e.reduceRight(t);
var r = e.length;
if (r !== +r) {
var s = E.keys(e);
r = s.length;
}
if (S(e, function(a, l, c) {
l = s ? s[--r] : --r, o ? n = t.call(i, n, e[l], l, c) : (n = e[l], o = !0);
}), !o) throw new TypeError(A);
return n;
}, E.find = E.detect = function(e, t, n) {
var i;
return k(e, function(e, o, r) {
return t.call(n, e, o, r) ? (i = e, !0) : void 0;
}), i;
}, E.filter = E.select = function(e, t, n) {
var i = [];
return null == e ? i : g && e.filter === g ? e.filter(t, n) : (S(e, function(e, o, r) {
t.call(n, e, o, r) && i.push(e);
}), i);
}, E.reject = function(e, t, n) {
return E.filter(e, function(e, i, o) {
return !t.call(n, e, i, o);
}, n);
}, E.every = E.all = function(e, t, i) {
t || (t = E.identity);
var o = !0;
return null == e ? o : m && e.every === m ? e.every(t, i) : (S(e, function(e, r, s) {
return (o = o && t.call(i, e, r, s)) ? void 0 : n;
}), !!o);
};
var k = E.some = E.any = function(e, t, i) {
t || (t = E.identity);
var o = !1;
return null == e ? o : v && e.some === v ? e.some(t, i) : (S(e, function(e, r, s) {
return o || (o = t.call(i, e, r, s)) ? n : void 0;
}), !!o);
};
E.contains = E.include = function(e, t) {
return null == e ? !1 : b && e.indexOf === b ? -1 != e.indexOf(t) : k(e, function(e) {
return e === t;
});
}, E.invoke = function(e, t) {
var n = a.call(arguments, 2), i = E.isFunction(t);
return E.map(e, function(e) {
return (i ? t : e[t]).apply(e, n);
});
}, E.pluck = function(e, t) {
return E.map(e, function(e) {
return e[t];
});
}, E.where = function(e, t, n) {
return E.isEmpty(t) ? n ? void 0 : [] : E[n ? "find" : "filter"](e, function(e) {
for (var n in t) if (t[n] !== e[n]) return !1;
return !0;
});
}, E.findWhere = function(e, t) {
return E.where(e, t, !0);
}, E.max = function(e, t, n) {
if (!t && E.isArray(e) && e[0] === +e[0] && e.length < 65535) return Math.max.apply(Math, e);
if (!t && E.isEmpty(e)) return -1/0;
var i = {
computed: -1/0,
value: -1/0
};
return S(e, function(e, o, r) {
var s = t ? t.call(n, e, o, r) : e;
s > i.computed && (i = {
value: e,
computed: s
});
}), i.value;
}, E.min = function(e, t, n) {
if (!t && E.isArray(e) && e[0] === +e[0] && e.length < 65535) return Math.min.apply(Math, e);
if (!t && E.isEmpty(e)) return 1/0;
var i = {
computed: 1/0,
value: 1/0
};
return S(e, function(e, o, r) {
var s = t ? t.call(n, e, o, r) : e;
s < i.computed && (i = {
value: e,
computed: s
});
}), i.value;
}, E.shuffle = function(e) {
var t, n = 0, i = [];
return S(e, function(e) {
t = E.random(n++), i[n - 1] = i[t], i[t] = e;
}), i;
};
var F = function(e) {
return E.isFunction(e) ? e : function(t) {
return t[e];
};
};
E.sortBy = function(e, t, n) {
var i = F(t);
return E.pluck(E.map(e, function(e, t, o) {
return {
value: e,
index: t,
criteria: i.call(n, e, t, o)
};
}).sort(function(e, t) {
var n = e.criteria, i = t.criteria;
if (n !== i) {
if (n > i || void 0 === n) return 1;
if (i > n || void 0 === i) return -1;
}
return e.index < t.index ? -1 : 1;
}), "value");
};
var _ = function(e, t, n, i) {
var o = {}, r = F(null == t ? E.identity : t);
return S(e, function(t, s) {
var a = r.call(n, t, s, e);
i(o, a, t);
}), o;
};
E.groupBy = function(e, t, n) {
return _(e, t, n, function(e, t, n) {
(E.has(e, t) ? e[t] : e[t] = []).push(n);
});
}, E.countBy = function(e, t, n) {
return _(e, t, n, function(e, t) {
E.has(e, t) || (e[t] = 0), e[t]++;
});
}, E.sortedIndex = function(e, t, n, i) {
n = null == n ? E.identity : F(n);
for (var o = n.call(i, t), r = 0, s = e.length; s > r; ) {
var a = r + s >>> 1;
n.call(i, e[a]) < o ? r = a + 1 : s = a;
}
return r;
}, E.toArray = function(e) {
return e ? E.isArray(e) ? a.call(e) : e.length === +e.length ? E.map(e, E.identity) : E.values(e) : [];
}, E.size = function(e) {
return null == e ? 0 : e.length === +e.length ? e.length : E.keys(e).length;
}, E.first = E.head = E.take = function(e, t, n) {
return null == e ? void 0 : null == t || n ? e[0] : a.call(e, 0, t);
}, E.initial = function(e, t, n) {
return a.call(e, 0, e.length - (null == t || n ? 1 : t));
}, E.last = function(e, t, n) {
return null == e ? void 0 : null == t || n ? e[e.length - 1] : a.call(e, Math.max(e.length - t, 0));
}, E.rest = E.tail = E.drop = function(e, t, n) {
return a.call(e, null == t || n ? 1 : t);
}, E.compact = function(e) {
return E.filter(e, E.identity);
};
var $ = function(e, t, n) {
return t && E.every(e, E.isArray) ? l.apply(n, e) : (S(e, function(e) {
E.isArray(e) || E.isArguments(e) ? t ? s.apply(n, e) : $(e, t, n) : n.push(e);
}), n);
};
E.flatten = function(e, t) {
return $(e, t, []);
}, E.without = function(e) {
return E.difference(e, a.call(arguments, 1));
}, E.uniq = E.unique = function(e, t, n, i) {
E.isFunction(t) && (i = n, n = t, t = !1);
var o = n ? E.map(e, n, i) : e, r = [], s = [];
return S(o, function(n, i) {
(t ? i && s[s.length - 1] === n : E.contains(s, n)) || (s.push(n), r.push(e[i]));
}), r;
}, E.union = function() {
return E.uniq(E.flatten(arguments, !0));
}, E.intersection = function(e) {
var t = a.call(arguments, 1);
return E.filter(E.uniq(e), function(e) {
return E.every(t, function(t) {
return E.indexOf(t, e) >= 0;
});
});
}, E.difference = function(e) {
var t = l.apply(i, a.call(arguments, 1));
return E.filter(e, function(e) {
return !E.contains(t, e);
});
}, E.zip = function() {
for (var e = E.max(E.pluck(arguments, "length").concat(0)), t = new Array(e), n = 0; e > n; n++) t[n] = E.pluck(arguments, "" + n);
return t;
}, E.object = function(e, t) {
if (null == e) return {};
for (var n = {}, i = 0, o = e.length; o > i; i++) t ? n[e[i]] = t[i] : n[e[i][0]] = e[i][1];
return n;
}, E.indexOf = function(e, t, n) {
if (null == e) return -1;
var i = 0, o = e.length;
if (n) {
if ("number" != typeof n) return i = E.sortedIndex(e, t), e[i] === t ? i : -1;
i = 0 > n ? Math.max(0, o + n) : n;
}
if (b && e.indexOf === b) return e.indexOf(t, n);
for (;o > i; i++) if (e[i] === t) return i;
return -1;
}, E.lastIndexOf = function(e, t, n) {
if (null == e) return -1;
var i = null != n;
if (y && e.lastIndexOf === y) return i ? e.lastIndexOf(t, n) : e.lastIndexOf(t);
for (var o = i ? n : e.length; o--; ) if (e[o] === t) return o;
return -1;
}, E.range = function(e, t, n) {
arguments.length <= 1 && (t = e || 0, e = 0), n = arguments[2] || 1;
for (var i = Math.max(Math.ceil((t - e) / n), 0), o = 0, r = new Array(i); i > o; ) r[o++] = e,
e += n;
return r;
};
var T = function() {};
E.bind = function(e, t) {
var n, i;
if (x && e.bind === x) return x.apply(e, a.call(arguments, 1));
if (!E.isFunction(e)) throw new TypeError();
return n = a.call(arguments, 2), i = function() {
if (!(this instanceof i)) return e.apply(t, n.concat(a.call(arguments)));
T.prototype = e.prototype;
var o = new T();
T.prototype = null;
var r = e.apply(o, n.concat(a.call(arguments)));
return Object(r) === r ? r : o;
};
}, E.partial = function(e) {
var t = a.call(arguments, 1);
return function() {
return e.apply(this, t.concat(a.call(arguments)));
};
}, E.bindAll = function(e) {
var t = a.call(arguments, 1);
if (0 === t.length) throw new Error("bindAll must be passed function names");
return S(t, function(t) {
e[t] = E.bind(e[t], e);
}), e;
}, E.memoize = function(e, t) {
var n = {};
return t || (t = E.identity), function() {
var i = t.apply(this, arguments);
return E.has(n, i) ? n[i] : n[i] = e.apply(this, arguments);
};
}, E.delay = function(e, t) {
var n = a.call(arguments, 2);
return setTimeout(function() {
return e.apply(null, n);
}, t);
}, E.defer = function(e) {
return E.delay.apply(E, [ e, 1 ].concat(a.call(arguments, 1)));
}, E.throttle = function(e, t, n) {
var i, o, r, s = null, a = 0;
n || (n = {});
var l = function() {
a = n.leading === !1 ? 0 : new Date(), s = null, r = e.apply(i, o);
};
return function() {
var c = new Date();
a || n.leading !== !1 || (a = c);
var u = t - (c - a);
return i = this, o = arguments, 0 >= u ? (clearTimeout(s), s = null, a = c, r = e.apply(i, o)) : s || n.trailing === !1 || (s = setTimeout(l, u)),
r;
};
}, E.debounce = function(e, t, n) {
var i, o = null;
return function() {
var r = this, s = arguments, a = function() {
o = null, n || (i = e.apply(r, s));
}, l = n && !o;
return clearTimeout(o), o = setTimeout(a, t), l && (i = e.apply(r, s)), i;
};
}, E.once = function(e) {
var t, n = !1;
return function() {
return n ? t : (n = !0, t = e.apply(this, arguments), e = null, t);
};
}, E.wrap = function(e, t) {
return function() {
var n = [ e ];
return s.apply(n, arguments), t.apply(this, n);
};
}, E.compose = function() {
var e = arguments;
return function() {
for (var t = arguments, n = e.length - 1; n >= 0; n--) t = [ e[n].apply(this, t) ];
return t[0];
};
}, E.after = function(e, t) {
return function() {
return --e < 1 ? t.apply(this, arguments) : void 0;
};
}, E.keys = C || function(e) {
if (e !== Object(e)) throw new TypeError("Invalid object");
var t = [];
for (var n in e) E.has(e, n) && t.push(n);
return t;
}, E.values = function(e) {
var t = [];
for (var n in e) E.has(e, n) && t.push(e[n]);
return t;
}, E.pairs = function(e) {
var t = [];
for (var n in e) E.has(e, n) && t.push([ n, e[n] ]);
return t;
}, E.invert = function(e) {
var t = {};
for (var n in e) E.has(e, n) && (t[e[n]] = n);
return t;
}, E.functions = E.methods = function(e) {
var t = [];
for (var n in e) E.isFunction(e[n]) && t.push(n);
return t.sort();
}, E.extend = function(e) {
return S(a.call(arguments, 1), function(t) {
if (t) for (var n in t) e[n] = t[n];
}), e;
}, E.pick = function(e) {
var t = {}, n = l.apply(i, a.call(arguments, 1));
return S(n, function(n) {
n in e && (t[n] = e[n]);
}), t;
}, E.omit = function(e) {
var t = {}, n = l.apply(i, a.call(arguments, 1));
for (var o in e) E.contains(n, o) || (t[o] = e[o]);
return t;
}, E.defaults = function(e) {
return S(a.call(arguments, 1), function(t) {
if (t) for (var n in t) void 0 === e[n] && (e[n] = t[n]);
}), e;
}, E.clone = function(e) {
return E.isObject(e) ? E.isArray(e) ? e.slice() : E.extend({}, e) : e;
}, E.tap = function(e, t) {
return t(e), e;
};
var D = function(e, t, n, i) {
if (e === t) return 0 !== e || 1 / e == 1 / t;
if (null == e || null == t) return e === t;
e instanceof E && (e = e._wrapped), t instanceof E && (t = t._wrapped);
var o = c.call(e);
if (o != c.call(t)) return !1;
switch (o) {
case "[object String]":
return e == String(t);
case "[object Number]":
return e != +e ? t != +t : 0 == e ? 1 / e == 1 / t : e == +t;
case "[object Date]":
case "[object Boolean]":
return +e == +t;
case "[object RegExp]":
return e.source == t.source && e.global == t.global && e.multiline == t.multiline && e.ignoreCase == t.ignoreCase;
}
if ("object" != typeof e || "object" != typeof t) return !1;
for (var r = n.length; r--; ) if (n[r] == e) return i[r] == t;
var s = e.constructor, a = t.constructor;
if (s !== a && !(E.isFunction(s) && s instanceof s && E.isFunction(a) && a instanceof a)) return !1;
n.push(e), i.push(t);
var l = 0, u = !0;
if ("[object Array]" == o) {
if (l = e.length, u = l == t.length) for (;l-- && (u = D(e[l], t[l], n, i)); ) ;
} else {
for (var d in e) if (E.has(e, d) && (l++, !(u = E.has(t, d) && D(e[d], t[d], n, i)))) break;
if (u) {
for (d in t) if (E.has(t, d) && !l--) break;
u = !l;
}
}
return n.pop(), i.pop(), u;
};
E.isEqual = function(e, t) {
return D(e, t, [], []);
}, E.isEmpty = function(e) {
if (null == e) return !0;
if (E.isArray(e) || E.isString(e)) return 0 === e.length;
for (var t in e) if (E.has(e, t)) return !1;
return !0;
}, E.isElement = function(e) {
return !(!e || 1 !== e.nodeType);
}, E.isArray = w || function(e) {
return "[object Array]" == c.call(e);
}, E.isObject = function(e) {
return e === Object(e);
}, S([ "Arguments", "Function", "String", "Number", "Date", "RegExp" ], function(e) {
E["is" + e] = function(t) {
return c.call(t) == "[object " + e + "]";
};
}), E.isArguments(arguments) || (E.isArguments = function(e) {
return !(!e || !E.has(e, "callee"));
}), "function" != typeof /./ && (E.isFunction = function(e) {
return "function" == typeof e;
}), E.isFinite = function(e) {
return isFinite(e) && !isNaN(parseFloat(e));
}, E.isNaN = function(e) {
return E.isNumber(e) && e != +e;
}, E.isBoolean = function(e) {
return e === !0 || e === !1 || "[object Boolean]" == c.call(e);
}, E.isNull = function(e) {
return null === e;
}, E.isUndefined = function(e) {
return void 0 === e;
}, E.has = function(e, t) {
return u.call(e, t);
}, E.noConflict = function() {
return e._ = t, this;
}, E.identity = function(e) {
return e;
}, E.times = function(e, t, n) {
for (var i = Array(Math.max(0, e)), o = 0; e > o; o++) i[o] = t.call(n, o);
return i;
}, E.random = function(e, t) {
return null == t && (t = e, e = 0), e + Math.floor(Math.random() * (t - e + 1));
};
var L = {
escape: {
"&": "&amp;",
"<": "&lt;",
">": "&gt;",
'"': "&quot;",
"'": "&#x27;",
"/": "&#x2F;"
}
};
L.unescape = E.invert(L.escape);
var B = {
escape: new RegExp("[" + E.keys(L.escape).join("") + "]", "g"),
unescape: new RegExp("(" + E.keys(L.unescape).join("|") + ")", "g")
};
E.each([ "escape", "unescape" ], function(e) {
E[e] = function(t) {
return null == t ? "" : ("" + t).replace(B[e], function(t) {
return L[e][t];
});
};
}), E.result = function(e, t) {
if (null == e) return void 0;
var n = e[t];
return E.isFunction(n) ? n.call(e) : n;
}, E.mixin = function(e) {
S(E.functions(e), function(t) {
var n = E[t] = e[t];
E.prototype[t] = function() {
var e = [ this._wrapped ];
return s.apply(e, arguments), N.call(this, n.apply(E, e));
};
});
};
var M = 0;
E.uniqueId = function(e) {
var t = ++M + "";
return e ? e + t : t;
}, E.templateSettings = {
evaluate: /<%([\s\S]+?)%>/g,
interpolate: /<%=([\s\S]+?)%>/g,
escape: /<%-([\s\S]+?)%>/g
};
var R = /(.)^/, I = {
"'": "'",
"\\": "\\",
"\r": "r",
"\n": "n",
" ": "t",
"\u2028": "u2028",
"\u2029": "u2029"
}, P = /\\|'|\r|\n|\t|\u2028|\u2029/g;
E.template = function(e, t, n) {
var i;
n = E.defaults({}, n, E.templateSettings);
var o = new RegExp([ (n.escape || R).source, (n.interpolate || R).source, (n.evaluate || R).source ].join("|") + "|$", "g"), r = 0, s = "__p+='";
e.replace(o, function(t, n, i, o, a) {
return s += e.slice(r, a).replace(P, function(e) {
return "\\" + I[e];
}), n && (s += "'+\n((__t=(" + n + "))==null?'':_.escape(__t))+\n'"), i && (s += "'+\n((__t=(" + i + "))==null?'':__t)+\n'"),
o && (s += "';\n" + o + "\n__p+='"), r = a + t.length, t;
}), s += "';\n", n.variable || (s = "with(obj||{}){\n" + s + "}\n"), s = "var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n" + s + "return __p;\n";
try {
i = new Function(n.variable || "obj", "_", s);
} catch (a) {
throw a.source = s, a;
}
if (t) return i(t, E);
var l = function(e) {
return i.call(this, e, E);
};
return l.source = "function(" + (n.variable || "obj") + "){\n" + s + "}", l;
}, E.chain = function(e) {
return E(e).chain();
};
var N = function(e) {
return this._chain ? E(e).chain() : e;
};
E.mixin(E), S([ "pop", "push", "reverse", "shift", "sort", "splice", "unshift" ], function(e) {
var t = i[e];
E.prototype[e] = function() {
var n = this._wrapped;
return t.apply(n, arguments), "shift" != e && "splice" != e || 0 !== n.length || delete n[0],
N.call(this, n);
};
}), S([ "concat", "join", "slice" ], function(e) {
var t = i[e];
E.prototype[e] = function() {
return N.call(this, t.apply(this._wrapped, arguments));
};
}), E.extend(E.prototype, {
chain: function() {
return this._chain = !0, this;
},
value: function() {
return this._wrapped;
}
});
}.call(this), define("underscore", function(e) {
return function() {
var t;
return t || e._;
};
}(this)), function(e, t) {
"object" == typeof exports ? module.exports = t() : "function" == typeof define && define.amd ? define("crel", t) : e.crel = t();
}(this, function() {
function e() {
var n, i = window.document, o = arguments, r = i.createElement(o[0]), s = o[1], a = 2, l = o.length, c = e.attrMap;
if (1 === l) return r;
if (("object" != typeof s || t(s)) && (--a, s = null), 1 === l - a && "string" == typeof o[a] && void 0 !== r.textContent) r.textContent = o[a]; else for (;l > a; ++a) n = o[a],
null != n && (t(n) || (n = i.createTextNode(n)), r.appendChild(n));
for (var u in s) if (c[u]) {
var d = e.attrMap[u];
"function" == typeof d ? d(r, s[u]) : r.setAttribute(d, s[u]);
} else r.setAttribute(u, s[u]);
return r;
}
var t = "object" == typeof Node ? function(e) {
return e instanceof Node;
} : function(e) {
return e && "object" == typeof e && "number" == typeof e.nodeType && "string" == typeof e.nodeName;
};
return e.attrMap = {}, e.isNode = t, e;
}), define("ace/lib/regexp", [ "require", "exports", "module" ], function() {
function e(e) {
return (e.global ? "g" : "") + (e.ignoreCase ? "i" : "") + (e.multiline ? "m" : "") + (e.extended ? "x" : "") + (e.sticky ? "y" : "");
}
function t(e, t, n) {
if (Array.prototype.indexOf) return e.indexOf(t, n);
for (var i = n || 0; i < e.length; i++) if (e[i] === t) return i;
return -1;
}
var n = {
exec: RegExp.prototype.exec,
test: RegExp.prototype.test,
match: String.prototype.match,
replace: String.prototype.replace,
split: String.prototype.split
}, i = void 0 === n.exec.call(/()??/, "")[1], o = function() {
var e = /^/g;
return n.test.call(e, ""), !e.lastIndex;
}();
o && i || (RegExp.prototype.exec = function(r) {
var s, a, l = n.exec.apply(this, arguments);
if ("string" == typeof r && l) {
if (!i && l.length > 1 && t(l, "") > -1 && (a = RegExp(this.source, n.replace.call(e(this), "g", "")),
n.replace.call(r.slice(l.index), a, function() {
for (var e = 1; e < arguments.length - 2; e++) void 0 === arguments[e] && (l[e] = void 0);
})), this._xregexp && this._xregexp.captureNames) for (var c = 1; c < l.length; c++) s = this._xregexp.captureNames[c - 1],
s && (l[s] = l[c]);
!o && this.global && !l[0].length && this.lastIndex > l.index && this.lastIndex--;
}
return l;
}, o || (RegExp.prototype.test = function(e) {
var t = n.exec.call(this, e);
return t && this.global && !t[0].length && this.lastIndex > t.index && this.lastIndex--,
!!t;
}));
}), define("ace/lib/es5-shim", [ "require", "exports", "module" ], function() {
function e() {}
function t(e) {
try {
return Object.defineProperty(e, "sentinel", {}), "sentinel" in e;
} catch (t) {}
}
function n(e) {
return e = +e, e !== e ? e = 0 : 0 !== e && e !== 1 / 0 && e !== -(1 / 0) && (e = (e > 0 || -1) * Math.floor(Math.abs(e))),
e;
}
Function.prototype.bind || (Function.prototype.bind = function(t) {
var n = this;
if ("function" != typeof n) throw new TypeError("Function.prototype.bind called on incompatible " + n);
var i = d.call(arguments, 1), o = function() {
if (this instanceof o) {
var e = n.apply(this, i.concat(d.call(arguments)));
return Object(e) === e ? e : this;
}
return n.apply(t, i.concat(d.call(arguments)));
};
return n.prototype && (e.prototype = n.prototype, o.prototype = new e(), e.prototype = null),
o;
});
var i, o, r, s, a, l = Function.prototype.call, c = Array.prototype, u = Object.prototype, d = c.slice, h = l.bind(u.toString), p = l.bind(u.hasOwnProperty);
if ((a = p(u, "__defineGetter__")) && (i = l.bind(u.__defineGetter__), o = l.bind(u.__defineSetter__),
r = l.bind(u.__lookupGetter__), s = l.bind(u.__lookupSetter__)), 2 != [ 1, 2 ].splice(0).length) if (function() {
function e(e) {
var t = new Array(e + 2);
return t[0] = t[1] = 0, t;
}
var t, n = [];
return n.splice.apply(n, e(20)), n.splice.apply(n, e(26)), t = n.length, n.splice(5, 0, "XXX"),
t + 1 == n.length, t + 1 == n.length ? !0 : void 0;
}()) {
var f = Array.prototype.splice;
Array.prototype.splice = function(e, t) {
return arguments.length ? f.apply(this, [ void 0 === e ? 0 : e, void 0 === t ? this.length - e : t ].concat(d.call(arguments, 2))) : [];
};
} else Array.prototype.splice = function(e, t) {
var n = this.length;
e > 0 ? e > n && (e = n) : void 0 == e ? e = 0 : 0 > e && (e = Math.max(n + e, 0)),
n > e + t || (t = n - e);
var i = this.slice(e, e + t), o = d.call(arguments, 2), r = o.length;
if (e === n) r && this.push.apply(this, o); else {
var s = Math.min(t, n - e), a = e + s, l = a + r - s, c = n - a, u = n - s;
if (a > l) for (var h = 0; c > h; ++h) this[l + h] = this[a + h]; else if (l > a) for (h = c; h--; ) this[l + h] = this[a + h];
if (r && e === u) this.length = u, this.push.apply(this, o); else for (this.length = u + r,
h = 0; r > h; ++h) this[e + h] = o[h];
}
return i;
};
Array.isArray || (Array.isArray = function(e) {
return "[object Array]" == h(e);
});
var g = Object("a"), m = "a" != g[0] || !(0 in g);
if (Array.prototype.forEach || (Array.prototype.forEach = function(e) {
var t = B(this), n = m && "[object String]" == h(this) ? this.split("") : t, i = arguments[1], o = -1, r = n.length >>> 0;
if ("[object Function]" != h(e)) throw new TypeError();
for (;++o < r; ) o in n && e.call(i, n[o], o, t);
}), Array.prototype.map || (Array.prototype.map = function(e) {
var t = B(this), n = m && "[object String]" == h(this) ? this.split("") : t, i = n.length >>> 0, o = Array(i), r = arguments[1];
if ("[object Function]" != h(e)) throw new TypeError(e + " is not a function");
for (var s = 0; i > s; s++) s in n && (o[s] = e.call(r, n[s], s, t));
return o;
}), Array.prototype.filter || (Array.prototype.filter = function(e) {
var t, n = B(this), i = m && "[object String]" == h(this) ? this.split("") : n, o = i.length >>> 0, r = [], s = arguments[1];
if ("[object Function]" != h(e)) throw new TypeError(e + " is not a function");
for (var a = 0; o > a; a++) a in i && (t = i[a], e.call(s, t, a, n) && r.push(t));
return r;
}), Array.prototype.every || (Array.prototype.every = function(e) {
var t = B(this), n = m && "[object String]" == h(this) ? this.split("") : t, i = n.length >>> 0, o = arguments[1];
if ("[object Function]" != h(e)) throw new TypeError(e + " is not a function");
for (var r = 0; i > r; r++) if (r in n && !e.call(o, n[r], r, t)) return !1;
return !0;
}), Array.prototype.some || (Array.prototype.some = function(e) {
var t = B(this), n = m && "[object String]" == h(this) ? this.split("") : t, i = n.length >>> 0, o = arguments[1];
if ("[object Function]" != h(e)) throw new TypeError(e + " is not a function");
for (var r = 0; i > r; r++) if (r in n && e.call(o, n[r], r, t)) return !0;
return !1;
}), Array.prototype.reduce || (Array.prototype.reduce = function(e) {
var t = B(this), n = m && "[object String]" == h(this) ? this.split("") : t, i = n.length >>> 0;
if ("[object Function]" != h(e)) throw new TypeError(e + " is not a function");
if (!i && 1 == arguments.length) throw new TypeError("reduce of empty array with no initial value");
var o, r = 0;
if (arguments.length >= 2) o = arguments[1]; else for (;;) {
if (r in n) {
o = n[r++];
break;
}
if (++r >= i) throw new TypeError("reduce of empty array with no initial value");
}
for (;i > r; r++) r in n && (o = e.call(void 0, o, n[r], r, t));
return o;
}), Array.prototype.reduceRight || (Array.prototype.reduceRight = function(e) {
var t = B(this), n = m && "[object String]" == h(this) ? this.split("") : t, i = n.length >>> 0;
if ("[object Function]" != h(e)) throw new TypeError(e + " is not a function");
if (!i && 1 == arguments.length) throw new TypeError("reduceRight of empty array with no initial value");
var o, r = i - 1;
if (arguments.length >= 2) o = arguments[1]; else for (;;) {
if (r in n) {
o = n[r--];
break;
}
if (--r < 0) throw new TypeError("reduceRight of empty array with no initial value");
}
do r in this && (o = e.call(void 0, o, n[r], r, t)); while (r--);
return o;
}), Array.prototype.indexOf && -1 == [ 0, 1 ].indexOf(1, 2) || (Array.prototype.indexOf = function(e) {
var t = m && "[object String]" == h(this) ? this.split("") : B(this), i = t.length >>> 0;
if (!i) return -1;
var o = 0;
for (arguments.length > 1 && (o = n(arguments[1])), o = o >= 0 ? o : Math.max(0, i + o); i > o; o++) if (o in t && t[o] === e) return o;
return -1;
}), Array.prototype.lastIndexOf && -1 == [ 0, 1 ].lastIndexOf(0, -3) || (Array.prototype.lastIndexOf = function(e) {
var t = m && "[object String]" == h(this) ? this.split("") : B(this), i = t.length >>> 0;
if (!i) return -1;
var o = i - 1;
for (arguments.length > 1 && (o = Math.min(o, n(arguments[1]))), o = o >= 0 ? o : i - Math.abs(o); o >= 0; o--) if (o in t && e === t[o]) return o;
return -1;
}), Object.getPrototypeOf || (Object.getPrototypeOf = function(e) {
return e.__proto__ || (e.constructor ? e.constructor.prototype : u);
}), !Object.getOwnPropertyDescriptor) {
var v = "Object.getOwnPropertyDescriptor called on a non-object: ";
Object.getOwnPropertyDescriptor = function(e, t) {
if ("object" != typeof e && "function" != typeof e || null === e) throw new TypeError(v + e);
if (p(e, t)) {
var n, i, o;
if (n = {
enumerable: !0,
configurable: !0
}, a) {
var l = e.__proto__;
e.__proto__ = u;
var i = r(e, t), o = s(e, t);
if (e.__proto__ = l, i || o) return i && (n.get = i), o && (n.set = o), n;
}
return n.value = e[t], n;
}
};
}
if (Object.getOwnPropertyNames || (Object.getOwnPropertyNames = function(e) {
return Object.keys(e);
}), !Object.create) {
var b;
b = null === Object.prototype.__proto__ ? function() {
return {
__proto__: null
};
} : function() {
var e = {};
for (var t in e) e[t] = null;
return e.constructor = e.hasOwnProperty = e.propertyIsEnumerable = e.isPrototypeOf = e.toLocaleString = e.toString = e.valueOf = e.__proto__ = null,
e;
}, Object.create = function(e, t) {
var n;
if (null === e) n = b(); else {
if ("object" != typeof e) throw new TypeError("typeof prototype[" + typeof e + "] != 'object'");
var i = function() {};
i.prototype = e, n = new i(), n.__proto__ = e;
}
return void 0 !== t && Object.defineProperties(n, t), n;
};
}
if (Object.defineProperty) {
var y = t({}), w = "undefined" == typeof document || t(document.createElement("div"));
if (!y || !w) var C = Object.defineProperty;
}
if (!Object.defineProperty || C) {
var x = "Property description must be an object: ", E = "Object.defineProperty called on non-object: ", S = "getters & setters can not be defined on this javascript engine";
Object.defineProperty = function(e, t, n) {
if ("object" != typeof e && "function" != typeof e || null === e) throw new TypeError(E + e);
if ("object" != typeof n && "function" != typeof n || null === n) throw new TypeError(x + n);
if (C) try {
return C.call(Object, e, t, n);
} catch (l) {}
if (p(n, "value")) if (a && (r(e, t) || s(e, t))) {
var c = e.__proto__;
e.__proto__ = u, delete e[t], e[t] = n.value, e.__proto__ = c;
} else e[t] = n.value; else {
if (!a) throw new TypeError(S);
p(n, "get") && i(e, t, n.get), p(n, "set") && o(e, t, n.set);
}
return e;
};
}
Object.defineProperties || (Object.defineProperties = function(e, t) {
for (var n in t) p(t, n) && Object.defineProperty(e, n, t[n]);
return e;
}), Object.seal || (Object.seal = function(e) {
return e;
}), Object.freeze || (Object.freeze = function(e) {
return e;
});
try {
Object.freeze(function() {});
} catch (A) {
Object.freeze = function(e) {
return function(t) {
return "function" == typeof t ? t : e(t);
};
}(Object.freeze);
}
if (Object.preventExtensions || (Object.preventExtensions = function(e) {
return e;
}), Object.isSealed || (Object.isSealed = function() {
return !1;
}), Object.isFrozen || (Object.isFrozen = function() {
return !1;
}), Object.isExtensible || (Object.isExtensible = function(e) {
if (Object(e) === e) throw new TypeError();
for (var t = ""; p(e, t); ) t += "?";
e[t] = !0;
var n = p(e, t);
return delete e[t], n;
}), !Object.keys) {
var k = !0, F = [ "toString", "toLocaleString", "valueOf", "hasOwnProperty", "isPrototypeOf", "propertyIsEnumerable", "constructor" ], _ = F.length;
for (var $ in {
toString: null
}) k = !1;
Object.keys = function M(e) {
if ("object" != typeof e && "function" != typeof e || null === e) throw new TypeError("Object.keys called on a non-object");
var M = [];
for (var t in e) p(e, t) && M.push(t);
if (k) for (var n = 0, i = _; i > n; n++) {
var o = F[n];
p(e, o) && M.push(o);
}
return M;
};
}
Date.now || (Date.now = function() {
return new Date().getTime();
});
var T = " \n \f\r    \u2028\u2029";
if (!String.prototype.trim || T.trim()) {
T = "[" + T + "]";
var D = new RegExp("^" + T + T + "*"), L = new RegExp(T + T + "*$");
String.prototype.trim = function() {
return String(this).replace(D, "").replace(L, "");
};
}
var B = function(e) {
if (null == e) throw new TypeError("can't convert " + e + " to object");
return Object(e);
};
}), define("ace/lib/fixoldbrowsers", [ "require", "exports", "module", "./regexp", "./es5-shim" ], function(e) {
e("./regexp"), e("./es5-shim");
}), define("ace/lib/dom", [ "require", "exports", "module" ], function(e, t) {
if ("undefined" != typeof document) {
var n = "http://www.w3.org/1999/xhtml";
t.getDocumentHead = function(e) {
return e || (e = document), e.head || e.getElementsByTagName("head")[0] || e.documentElement;
}, t.createElement = function(e, t) {
return document.createElementNS ? document.createElementNS(t || n, e) : document.createElement(e);
}, t.hasCssClass = function(e, t) {
var n = e.className.split(/\s+/g);
return -1 !== n.indexOf(t);
}, t.addCssClass = function(e, n) {
t.hasCssClass(e, n) || (e.className += " " + n);
}, t.removeCssClass = function(e, t) {
for (var n = e.className.split(/\s+/g); ;) {
var i = n.indexOf(t);
if (-1 == i) break;
n.splice(i, 1);
}
e.className = n.join(" ");
}, t.toggleCssClass = function(e, t) {
for (var n = e.className.split(/\s+/g), i = !0; ;) {
var o = n.indexOf(t);
if (-1 == o) break;
i = !1, n.splice(o, 1);
}
return i && n.push(t), e.className = n.join(" "), i;
}, t.setCssClass = function(e, n, i) {
i ? t.addCssClass(e, n) : t.removeCssClass(e, n);
}, t.hasCssString = function(e, t) {
var n, i = 0;
if (t = t || document, t.createStyleSheet && (n = t.styleSheets)) {
for (;i < n.length; ) if (n[i++].owningElement.id === e) return !0;
} else if (n = t.getElementsByTagName("style")) for (;i < n.length; ) if (n[i++].id === e) return !0;
return !1;
}, t.importCssString = function(e, i, o) {
if (o = o || document, i && t.hasCssString(i, o)) return null;
var r;
o.createStyleSheet ? (r = o.createStyleSheet(), r.cssText = e, i && (r.owningElement.id = i)) : (r = o.createElementNS ? o.createElementNS(n, "style") : o.createElement("style"),
r.appendChild(o.createTextNode(e)), i && (r.id = i), t.getDocumentHead(o).appendChild(r));
}, t.importCssStylsheet = function(e, n) {
if (n.createStyleSheet) n.createStyleSheet(e); else {
var i = t.createElement("link");
i.rel = "stylesheet", i.href = e, t.getDocumentHead(n).appendChild(i);
}
}, t.getInnerWidth = function(e) {
return parseInt(t.computedStyle(e, "paddingLeft"), 10) + parseInt(t.computedStyle(e, "paddingRight"), 10) + e.clientWidth;
}, t.getInnerHeight = function(e) {
return parseInt(t.computedStyle(e, "paddingTop"), 10) + parseInt(t.computedStyle(e, "paddingBottom"), 10) + e.clientHeight;
}, void 0 !== window.pageYOffset ? (t.getPageScrollTop = function() {
return window.pageYOffset;
}, t.getPageScrollLeft = function() {
return window.pageXOffset;
}) : (t.getPageScrollTop = function() {
return document.body.scrollTop;
}, t.getPageScrollLeft = function() {
return document.body.scrollLeft;
}), t.computedStyle = window.getComputedStyle ? function(e, t) {
return t ? (window.getComputedStyle(e, "") || {})[t] || "" : window.getComputedStyle(e, "") || {};
} : function(e, t) {
return t ? e.currentStyle[t] : e.currentStyle;
}, t.scrollbarWidth = function(e) {
var n = t.createElement("ace_inner");
n.style.width = "100%", n.style.minWidth = "0px", n.style.height = "200px", n.style.display = "block";
var i = t.createElement("ace_outer"), o = i.style;
o.position = "absolute", o.left = "-10000px", o.overflow = "hidden", o.width = "200px",
o.minWidth = "0px", o.height = "150px", o.display = "block", i.appendChild(n);
var r = e.documentElement;
r.appendChild(i);
var s = n.offsetWidth;
o.overflow = "scroll";
var a = n.offsetWidth;
return s == a && (a = i.clientWidth), r.removeChild(i), s - a;
}, t.setInnerHtml = function(e, t) {
var n = e.cloneNode(!1);
return n.innerHTML = t, e.parentNode.replaceChild(n, e), n;
}, "textContent" in document.documentElement ? (t.setInnerText = function(e, t) {
e.textContent = t;
}, t.getInnerText = function(e) {
return e.textContent;
}) : (t.setInnerText = function(e, t) {
e.innerText = t;
}, t.getInnerText = function(e) {
return e.innerText;
}), t.getParentWindow = function(e) {
return e.defaultView || e.parentWindow;
};
}
}), define("ace/lib/oop", [ "require", "exports", "module" ], function(e, t) {
t.inherits = function() {
var e = function() {};
return function(t, n) {
e.prototype = n.prototype, t.super_ = n.prototype, t.prototype = new e(), t.prototype.constructor = t;
};
}(), t.mixin = function(e, t) {
for (var n in t) e[n] = t[n];
return e;
}, t.implement = function(e, n) {
t.mixin(e, n);
};
}), define("ace/lib/keys", [ "require", "exports", "module", "./oop" ], function(e, t) {
var n = e("./oop"), i = function() {
var e = {
MODIFIER_KEYS: {
16: "Shift",
17: "Ctrl",
18: "Alt",
224: "Meta"
},
KEY_MODS: {
ctrl: 1,
alt: 2,
option: 2,
shift: 4,
meta: 8,
command: 8,
cmd: 8
},
FUNCTION_KEYS: {
8: "Backspace",
9: "Tab",
13: "Return",
19: "Pause",
27: "Esc",
32: "Space",
33: "PageUp",
34: "PageDown",
35: "End",
36: "Home",
37: "Left",
38: "Up",
39: "Right",
40: "Down",
44: "Print",
45: "Insert",
46: "Delete",
96: "Numpad0",
97: "Numpad1",
98: "Numpad2",
99: "Numpad3",
100: "Numpad4",
101: "Numpad5",
102: "Numpad6",
103: "Numpad7",
104: "Numpad8",
105: "Numpad9",
"-13": "NumpadEnter",
112: "F1",
113: "F2",
114: "F3",
115: "F4",
116: "F5",
117: "F6",
118: "F7",
119: "F8",
120: "F9",
121: "F10",
122: "F11",
123: "F12",
144: "Numlock",
145: "Scrolllock"
},
PRINTABLE_KEYS: {
32: " ",
48: "0",
49: "1",
50: "2",
51: "3",
52: "4",
53: "5",
54: "6",
55: "7",
56: "8",
57: "9",
59: ";",
61: "=",
65: "a",
66: "b",
67: "c",
68: "d",
69: "e",
70: "f",
71: "g",
72: "h",
73: "i",
74: "j",
75: "k",
76: "l",
77: "m",
78: "n",
79: "o",
80: "p",
81: "q",
82: "r",
83: "s",
84: "t",
85: "u",
86: "v",
87: "w",
88: "x",
89: "y",
90: "z",
107: "+",
109: "-",
110: ".",
188: ",",
190: ".",
191: "/",
192: "`",
219: "[",
220: "\\",
221: "]",
222: "'"
}
};
for (var t in e.FUNCTION_KEYS) {
var i = e.FUNCTION_KEYS[t].toLowerCase();
e[i] = parseInt(t, 10);
}
return n.mixin(e, e.MODIFIER_KEYS), n.mixin(e, e.PRINTABLE_KEYS), n.mixin(e, e.FUNCTION_KEYS),
e.enter = e["return"], e.escape = e.esc, e.del = e["delete"], e[173] = "-", e;
}();
n.mixin(t, i), t.keyCodeToString = function(e) {
return (i[e] || String.fromCharCode(e)).toLowerCase();
};
}), define("ace/lib/useragent", [ "require", "exports", "module" ], function(e, t) {
if (t.OS = {
LINUX: "LINUX",
MAC: "MAC",
WINDOWS: "WINDOWS"
}, t.getOS = function() {
return t.isMac ? t.OS.MAC : t.isLinux ? t.OS.LINUX : t.OS.WINDOWS;
}, "object" == typeof navigator) {
var n = (navigator.platform.match(/mac|win|linux/i) || [ "other" ])[0].toLowerCase(), i = navigator.userAgent;
t.isWin = "win" == n, t.isMac = "mac" == n, t.isLinux = "linux" == n, t.isIE = ("Microsoft Internet Explorer" == navigator.appName || navigator.appName.indexOf("MSAppHost") >= 0) && parseFloat(navigator.userAgent.match(/MSIE ([0-9]+[\.0-9]+)/)[1]),
t.isOldIE = t.isIE && t.isIE < 9, t.isGecko = t.isMozilla = window.controllers && "Gecko" === window.navigator.product,
t.isOldGecko = t.isGecko && parseInt((navigator.userAgent.match(/rv\:(\d+)/) || [])[1], 10) < 4,
t.isOpera = window.opera && "[object Opera]" == Object.prototype.toString.call(window.opera),
t.isWebKit = parseFloat(i.split("WebKit/")[1]) || void 0, t.isChrome = parseFloat(i.split(" Chrome/")[1]) || void 0,
t.isAIR = i.indexOf("AdobeAIR") >= 0, t.isIPad = i.indexOf("iPad") >= 0, t.isTouchPad = i.indexOf("TouchPad") >= 0;
}
}), define("ace/lib/event", [ "require", "exports", "module", "./keys", "./useragent", "./dom" ], function(e, t) {
function n(e, t, n) {
var a = 0;
if (a = !o.isOpera || "KeyboardEvent" in window || !o.isMac ? 0 | (t.ctrlKey ? 1 : 0) | (t.altKey ? 2 : 0) | (t.shiftKey ? 4 : 0) | (t.metaKey ? 8 : 0) : 0 | (t.metaKey ? 1 : 0) | (t.altKey ? 2 : 0) | (t.shiftKey ? 4 : 0) | (t.ctrlKey ? 8 : 0),
!o.isMac && r) {
if ((r[91] || r[92]) && (a |= 8), r.altGr) {
if (3 == (3 & a)) return;
r.altGr = 0;
}
if (18 === n || 17 === n) {
var l = t.location || t.keyLocation;
if (17 === n && 1 === l) s = t.timeStamp; else if (18 === n && 3 === a && 2 === l) {
var c = -s;
s = t.timeStamp, c += s, 3 > c && (r.altGr = !0);
}
}
}
if (n in i.MODIFIER_KEYS) {
switch (i.MODIFIER_KEYS[n]) {
case "Alt":
a = 2;
break;
case "Shift":
a = 4;
break;
case "Ctrl":
a = 1;
break;
default:
a = 8;
}
n = 0;
}
return 8 & a && (91 === n || 93 === n) && (n = 0), a || 13 !== n || !t.location && 3 !== t.keyLocation || (e(t, a, -n),
!t.defaultPrevented) ? a || n in i.FUNCTION_KEYS || n in i.PRINTABLE_KEYS ? e(t, a, n) : !1 : void 0;
}
var i = e("./keys"), o = e("./useragent");
e("./dom"), t.addListener = function(e, t, n) {
if (e.addEventListener) return e.addEventListener(t, n, !1);
if (e.attachEvent) {
var i = function() {
n(window.event);
};
n._wrapper = i, e.attachEvent("on" + t, i);
}
}, t.removeListener = function(e, t, n) {
return e.removeEventListener ? e.removeEventListener(t, n, !1) : (e.detachEvent && e.detachEvent("on" + t, n._wrapper || n),
void 0);
}, t.stopEvent = function(e) {
return t.stopPropagation(e), t.preventDefault(e), !1;
}, t.stopPropagation = function(e) {
e.stopPropagation ? e.stopPropagation() : e.cancelBubble = !0;
}, t.preventDefault = function(e) {
e.preventDefault ? e.preventDefault() : e.returnValue = !1;
}, t.getButton = function(e) {
return "dblclick" == e.type ? 0 : "contextmenu" == e.type || e.ctrlKey && o.isMac ? 2 : e.preventDefault ? e.button : {
1: 0,
2: 2,
4: 1
}[e.button];
}, t.capture = document.documentElement.setCapture ? function(e, n, i) {
function o(s) {
n(s), r || (r = !0, i(s)), t.removeListener(e, "mousemove", n), t.removeListener(e, "mouseup", o),
t.removeListener(e, "losecapture", o), e.releaseCapture();
}
var r = !1;
t.addListener(e, "mousemove", n), t.addListener(e, "mouseup", o), t.addListener(e, "losecapture", o),
e.setCapture();
} : function(e, t, n) {
function i(e) {
t && t(e), n && n(e), document.removeEventListener("mousemove", t, !0), document.removeEventListener("mouseup", i, !0);
}
document.addEventListener("mousemove", t, !0), document.addEventListener("mouseup", i, !0);
}, t.addMouseWheelListener = function(e, n) {
if ("onmousewheel" in e) {
var i = 8;
t.addListener(e, "mousewheel", function(e) {
void 0 !== e.wheelDeltaX ? (e.wheelX = -e.wheelDeltaX / i, e.wheelY = -e.wheelDeltaY / i) : (e.wheelX = 0,
e.wheelY = -e.wheelDelta / i), n(e);
});
} else "onwheel" in e ? t.addListener(e, "wheel", function(e) {
e.wheelX = 5 * (e.deltaX || 0), e.wheelY = 5 * (e.deltaY || 0), n(e);
}) : t.addListener(e, "DOMMouseScroll", function(e) {
e.axis && e.axis == e.HORIZONTAL_AXIS ? (e.wheelX = 5 * (e.detail || 0), e.wheelY = 0) : (e.wheelX = 0,
e.wheelY = 5 * (e.detail || 0)), n(e);
});
}, t.addMultiMouseDownListener = function(e, n, i, r) {
var s, a, l, c = 0, u = {
2: "dblclick",
3: "tripleclick",
4: "quadclick"
};
t.addListener(e, "mousedown", function(e) {
if (0 != t.getButton(e)) c = 0; else {
var o = Math.abs(e.clientX - s) > 5 || Math.abs(e.clientY - a) > 5;
(!l || o) && (c = 0), c += 1, l && clearTimeout(l), l = setTimeout(function() {
l = null;
}, n[c - 1] || 600);
}
if (1 == c && (s = e.clientX, a = e.clientY), i[r]("mousedown", e), c > 4) c = 0; else if (c > 1) return i[r](u[c], e);
}), o.isOldIE && t.addListener(e, "dblclick", function(e) {
c = 2, l && clearTimeout(l), l = setTimeout(function() {
l = null;
}, n[c - 1] || 600), i[r]("mousedown", e), i[r](u[c], e);
});
};
var r = null, s = 0;
if (t.addCommandKeyListener = function(e, i) {
var s = t.addListener;
if (o.isOldGecko || o.isOpera && !("KeyboardEvent" in window)) {
var a = null;
s(e, "keydown", function(e) {
a = e.keyCode;
}), s(e, "keypress", function(e) {
return n(i, e, a);
});
} else {
var l = null;
s(e, "keydown", function(e) {
r[e.keyCode] = !0;
var t = n(i, e, e.keyCode);
return l = e.defaultPrevented, t;
}), s(e, "keypress", function(e) {
l && (e.ctrlKey || e.altKey || e.shiftKey || e.metaKey) && (t.stopEvent(e), l = null);
}), s(e, "keyup", function(e) {
r[e.keyCode] = null;
}), r || (r = Object.create(null), s(window, "focus", function() {
r = Object.create(null);
}));
}
}, window.postMessage && !o.isOldIE) {
var a = 1;
t.nextTick = function(e, n) {
n = n || window;
var i = "zero-timeout-message-" + a;
t.addListener(n, "message", function o(r) {
r.data == i && (t.stopPropagation(r), t.removeListener(n, "message", o), e());
}), n.postMessage(i, "*");
};
}
t.nextFrame = window.requestAnimationFrame || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame || window.msRequestAnimationFrame || window.oRequestAnimationFrame,
t.nextFrame = t.nextFrame ? t.nextFrame.bind(window) : function(e) {
setTimeout(e, 17);
};
}), define("ace/lib/lang", [ "require", "exports", "module" ], function(e, t) {
t.stringReverse = function(e) {
return e.split("").reverse().join("");
}, t.stringRepeat = function(e, t) {
for (var n = ""; t > 0; ) 1 & t && (n += e), (t >>= 1) && (e += e);
return n;
};
var n = /^\s\s*/, i = /\s\s*$/;
t.stringTrimLeft = function(e) {
return e.replace(n, "");
}, t.stringTrimRight = function(e) {
return e.replace(i, "");
}, t.copyObject = function(e) {
var t = {};
for (var n in e) t[n] = e[n];
return t;
}, t.copyArray = function(e) {
for (var t = [], n = 0, i = e.length; i > n; n++) t[n] = e[n] && "object" == typeof e[n] ? this.copyObject(e[n]) : e[n];
return t;
}, t.deepCopy = function(e) {
if ("object" != typeof e) return e;
var t = e.constructor();
for (var n in e) t[n] = "object" == typeof e[n] ? this.deepCopy(e[n]) : e[n];
return t;
}, t.arrayToMap = function(e) {
for (var t = {}, n = 0; n < e.length; n++) t[e[n]] = 1;
return t;
}, t.createMap = function(e) {
var t = Object.create(null);
for (var n in e) t[n] = e[n];
return t;
}, t.arrayRemove = function(e, t) {
for (var n = 0; n <= e.length; n++) t === e[n] && e.splice(n, 1);
}, t.escapeRegExp = function(e) {
return e.replace(/([.*+?^${}()|[\]\/\\])/g, "\\$1");
}, t.escapeHTML = function(e) {
return e.replace(/&/g, "&#38;").replace(/"/g, "&#34;").replace(/'/g, "&#39;").replace(/</g, "&#60;");
}, t.getMatchOffsets = function(e, t) {
var n = [];
return e.replace(t, function(e) {
n.push({
offset: arguments[arguments.length - 2],
length: e.length
});
}), n;
}, t.deferredCall = function(e) {
var t = null, n = function() {
t = null, e();
}, i = function(e) {
return i.cancel(), t = setTimeout(n, e || 0), i;
};
return i.schedule = i, i.call = function() {
return this.cancel(), e(), i;
}, i.cancel = function() {
return clearTimeout(t), t = null, i;
}, i;
}, t.delayedCall = function(e, t) {
var n = null, i = function() {
n = null, e();
}, o = function(e) {
n && clearTimeout(n), n = setTimeout(i, e || t);
};
return o.delay = o, o.schedule = function(e) {
null == n && (n = setTimeout(i, e || 0));
}, o.call = function() {
this.cancel(), e();
}, o.cancel = function() {
n && clearTimeout(n), n = null;
}, o.isPending = function() {
return n;
}, o;
};
}), define("ace/keyboard/textinput", [ "require", "exports", "module", "../lib/event", "../lib/useragent", "../lib/dom", "../lib/lang" ], function(e, t) {
var n = e("../lib/event"), i = e("../lib/useragent"), o = e("../lib/dom"), r = e("../lib/lang"), s = i.isChrome < 18, a = function(e, t) {
function a(e) {
if (!g) {
if (_) t = 0, n = e ? 0 : u.value.length - 1; else var t = e ? 2 : 1, n = 2;
try {
u.setSelectionRange(t, n);
} catch (i) {}
}
}
function l() {
g || (u.value = d, i.isWebKit && C.schedule());
}
function c() {
setTimeout(function() {
m && (u.style.cssText = m, m = ""), null == t.renderer.$keepTextAreaAtCursor && (t.renderer.$keepTextAreaAtCursor = !0,
t.renderer.$moveTextAreaToCursor());
}, 0);
}
var u = o.createElement("textarea");
u.className = "ace_text-input", i.isTouchPad && u.setAttribute("x-palm-disable-auto-cap", !0),
u.wrap = "off", u.autocorrect = "off", u.autocapitalize = "off", u.spellcheck = !1,
u.style.bottom = "2000em", e.insertBefore(u, e.firstChild);
var d = "", h = !1, p = !1, f = !1, g = !1, m = "", v = !0;
try {
var b = document.activeElement === u;
} catch (y) {}
n.addListener(u, "blur", function() {
t.onBlur(), b = !1;
}), n.addListener(u, "focus", function() {
b = !0, t.onFocus(), a();
}), this.focus = function() {
u.focus();
}, this.blur = function() {
u.blur();
}, this.isFocused = function() {
return b;
};
var w = r.delayedCall(function() {
b && a(v);
}), C = r.delayedCall(function() {
g || (u.value = d, b && a());
});
i.isWebKit || t.addEventListener("changeSelection", function() {
t.selection.isEmpty() != v && (v = !v, w.schedule());
}), l(), b && t.onFocus();
var x = function(e) {
return 0 === e.selectionStart && e.selectionEnd === e.value.length;
};
if (!u.setSelectionRange && u.createTextRange && (u.setSelectionRange = function(e, t) {
var n = this.createTextRange();
n.collapse(!0), n.moveStart("character", e), n.moveEnd("character", t), n.select();
}, x = function(e) {
try {
var t = e.ownerDocument.selection.createRange();
} catch (n) {}
return t && t.parentElement() == e ? t.text == e.value : !1;
}), i.isOldIE) {
var E = !1, S = function(e) {
if (!E) {
var t = u.value;
if (!g && t && t != d) {
if (e && t == d[0]) return A.schedule();
T(t), E = !0, l(), E = !1;
}
}
}, A = r.delayedCall(S);
n.addListener(u, "propertychange", S);
var k = {
13: 1,
27: 1
};
n.addListener(u, "keyup", function(e) {
return !g || u.value && !k[e.keyCode] || setTimeout(P, 0), (u.value.charCodeAt(0) || 0) < 129 ? A.call() : (g ? I() : R(),
void 0);
}), n.addListener(u, "keydown", function() {
A.schedule(50);
});
}
var F = function() {
h ? h = !1 : p ? p = !1 : x(u) ? (t.selectAll(), a()) : _ && a(t.selection.isEmpty());
}, _ = null;
this.setInputHandler = function(e) {
_ = e;
}, this.getInputHandler = function() {
return _;
};
var $ = !1, T = function(e) {
_ && (e = _(e), _ = null), f ? (a(), e && t.onPaste(e), f = !1) : e == d.charAt(0) ? $ && t.execCommand("del", {
source: "ace"
}) : (e.substring(0, 2) == d ? e = e.substr(2) : e.charAt(0) == d.charAt(0) ? e = e.substr(1) : e.charAt(e.length - 1) == d.charAt(0) && (e = e.slice(0, -1)),
e.charAt(e.length - 1) == d.charAt(0) && (e = e.slice(0, -1)), e && t.onTextInput(e)),
$ && ($ = !1);
}, D = function() {
if (!g) {
var e = u.value;
T(e), l();
}
}, L = function(e) {
var i = t.getCopyText();
if (!i) return n.preventDefault(e), void 0;
var o = e.clipboardData || window.clipboardData;
if (o && !s) {
var r = o.setData("Text", i);
r && (t.onCut(), n.preventDefault(e));
}
r || (h = !0, u.value = i, u.select(), setTimeout(function() {
h = !1, l(), a(), t.onCut();
}));
}, B = function(e) {
var i = t.getCopyText();
if (!i) return n.preventDefault(e), void 0;
var o = e.clipboardData || window.clipboardData;
if (o && !s) {
var r = o.setData("Text", i);
r && (t.onCopy(), n.preventDefault(e));
}
r || (p = !0, u.value = i, u.select(), setTimeout(function() {
p = !1, l(), a(), t.onCopy();
}));
}, M = function(e) {
var o = e.clipboardData || window.clipboardData;
if (o) {
var r = o.getData("Text");
r && t.onPaste(r), i.isIE && setTimeout(a), n.preventDefault(e);
} else u.value = "", f = !0;
};
n.addCommandKeyListener(u, t.onCommandKey.bind(t)), n.addListener(u, "select", F),
n.addListener(u, "input", D), n.addListener(u, "cut", L), n.addListener(u, "copy", B),
n.addListener(u, "paste", M), "oncut" in u && "oncopy" in u && "onpaste" in u || n.addListener(e, "keydown", function(e) {
if ((!i.isMac || e.metaKey) && e.ctrlKey) switch (e.keyCode) {
case 67:
B(e);
break;
case 86:
M(e);
break;
case 88:
L(e);
}
});
var R = function() {
g || (g = {}, t.onCompositionStart(), setTimeout(I, 0), t.on("mousedown", P), t.selection.isEmpty() || (t.insert(""),
t.session.markUndoGroup(), t.selection.clearSelection()), t.session.markUndoGroup());
}, I = function() {
if (g && (t.onCompositionUpdate(u.value), g.lastValue && t.undo(), g.lastValue = u.value.replace(/\x01/g, ""),
g.lastValue)) {
var e = t.selection.getRange();
t.insert(g.lastValue), t.session.markUndoGroup(), g.range = t.selection.getRange(),
t.selection.setRange(e), t.selection.clearSelection();
}
}, P = function(e) {
var n = g;
g = !1;
var i = setTimeout(function() {
var e = u.value.replace(/\x01/g, "");
g || (e == n.lastValue ? l() : !n.lastValue && e && (l(), T(e)));
});
_ = function(e) {
return clearTimeout(i), e = e.replace(/\x01/g, ""), e == n.lastValue ? "" : (n.lastValue && t.undo(),
e);
}, t.onCompositionEnd(), t.removeListener("mousedown", P), "compositionend" == e.type && n.range && t.selection.setRange(n.range);
}, N = r.delayedCall(I, 50);
n.addListener(u, "compositionstart", R), n.addListener(u, i.isGecko ? "text" : "keyup", function() {
N.schedule();
}), n.addListener(u, "compositionend", P), this.getElement = function() {
return u;
}, this.setReadOnly = function(e) {
u.readOnly = e;
}, this.onContextMenu = function(e) {
$ = !0, m || (m = u.style.cssText), u.style.cssText = "z-index:100000;" + (i.isIE ? "opacity:0.1;" : ""),
a(t.selection.isEmpty()), t._emit("nativecontextmenu", {
target: t,
domEvent: e
});
var r = t.container.getBoundingClientRect(), s = o.computedStyle(t.container), l = r.top + (parseInt(s.borderTopWidth) || 0), d = r.left + (parseInt(r.borderLeftWidth) || 0), h = r.bottom - l - u.clientHeight, p = function(e) {
u.style.left = e.clientX - d - 2 + "px", u.style.top = Math.min(e.clientY - l - 2, h) + "px";
};
p(e), "mousedown" == e.type && (t.renderer.$keepTextAreaAtCursor && (t.renderer.$keepTextAreaAtCursor = null),
i.isWin && n.capture(t.container, p, c));
}, this.onContextMenuClose = c, (!i.isGecko || i.isMac) && n.addListener(u, "contextmenu", function(e) {
t.textInput.onContextMenu(e), c();
});
};
t.TextInput = a;
}), define("ace/mouse/default_handlers", [ "require", "exports", "module", "../lib/dom", "../lib/useragent" ], function(e, t) {
function n(e) {
e.$clickSelection = null;
var t = e.editor;
t.setDefaultHandler("mousedown", this.onMouseDown.bind(e)), t.setDefaultHandler("dblclick", this.onDoubleClick.bind(e)),
t.setDefaultHandler("tripleclick", this.onTripleClick.bind(e)), t.setDefaultHandler("quadclick", this.onQuadClick.bind(e)),
t.setDefaultHandler("mousewheel", this.onMouseWheel.bind(e));
var n = [ "select", "startSelect", "drag", "dragEnd", "dragWait", "dragWaitEnd", "startDrag", "focusWait" ];
n.forEach(function(t) {
e[t] = this[t];
}, this), e.selectByLines = this.extendSelectionBy.bind(e, "getLineRange"), e.selectByWords = this.extendSelectionBy.bind(e, "getWordRange");
}
function i(e, t, n, i) {
return Math.sqrt(Math.pow(n - e, 2) + Math.pow(i - t, 2));
}
function o(e, t) {
if (e.start.row == e.end.row) var n = 2 * t.column - e.start.column - e.end.column; else if (e.start.row != e.end.row - 1 || e.start.column || e.end.column) var n = 2 * t.row - e.start.row - e.end.row; else var n = t.column - 4;
return 0 > n ? {
cursor: e.start,
anchor: e.end
} : {
cursor: e.end,
anchor: e.start
};
}
var r = e("../lib/dom");
e("../lib/useragent");
var s = 0;
(function() {
this.onMouseDown = function(e) {
var t = e.inSelection(), n = e.getDocumentPosition();
this.mousedownEvent = e;
var i = this.editor, o = e.getButton();
if (0 !== o) {
var r = i.getSelectionRange(), s = r.isEmpty();
return s && (i.moveCursorToPosition(n), i.selection.clearSelection()), i.textInput.onContextMenu(e.domEvent),
void 0;
}
return !t || i.isFocused() || (i.focus(), !this.$focusTimout || this.$clickSelection || i.inMultiSelectMode) ? (!t || this.$clickSelection || e.getShiftKey() || i.inMultiSelectMode ? this.startSelect(n) : t && (this.mousedownEvent.time = new Date().getTime(),
this.setState("dragWait")), this.captureMouse(e), e.preventDefault()) : (this.setState("focusWait"),
this.captureMouse(e), e.preventDefault());
}, this.startSelect = function(e) {
e = e || this.editor.renderer.screenToTextCoordinates(this.x, this.y), this.mousedownEvent.getShiftKey() ? this.editor.selection.selectToPosition(e) : this.$clickSelection || (this.editor.moveCursorToPosition(e),
this.editor.selection.clearSelection()), this.setState("select");
}, this.select = function() {
var e, t = this.editor, n = t.renderer.screenToTextCoordinates(this.x, this.y);
if (this.$clickSelection) {
var i = this.$clickSelection.comparePoint(n);
if (-1 == i) e = this.$clickSelection.end; else if (1 == i) e = this.$clickSelection.start; else {
var r = o(this.$clickSelection, n);
n = r.cursor, e = r.anchor;
}
t.selection.setSelectionAnchor(e.row, e.column);
}
t.selection.selectToPosition(n), t.renderer.scrollCursorIntoView();
}, this.extendSelectionBy = function(e) {
var t, n = this.editor, i = n.renderer.screenToTextCoordinates(this.x, this.y), r = n.selection[e](i.row, i.column);
if (this.$clickSelection) {
var s = this.$clickSelection.comparePoint(r.start), a = this.$clickSelection.comparePoint(r.end);
if (-1 == s && 0 >= a) t = this.$clickSelection.end, (r.end.row != i.row || r.end.column != i.column) && (i = r.start); else if (1 == a && s >= 0) t = this.$clickSelection.start,
(r.start.row != i.row || r.start.column != i.column) && (i = r.end); else if (-1 == s && 1 == a) i = r.end,
t = r.start; else {
var l = o(this.$clickSelection, i);
i = l.cursor, t = l.anchor;
}
n.selection.setSelectionAnchor(t.row, t.column);
}
n.selection.selectToPosition(i), n.renderer.scrollCursorIntoView();
}, this.startDrag = function() {
var e = this.editor;
this.setState("drag"), this.dragRange = e.getSelectionRange();
var t = e.getSelectionStyle();
this.dragSelectionMarker = e.session.addMarker(this.dragRange, "ace_selection", t),
e.clearSelection(), r.addCssClass(e.container, "ace_dragging"), this.$dragKeybinding || (this.$dragKeybinding = {
handleKeyboard: function(e, t, n) {
return "esc" == n ? {
command: this.command
} : void 0;
},
command: {
exec: function(e) {
var t = e.$mouseHandler;
t.dragCursor = null, t.dragEnd(), t.startSelect();
}
}
}), e.keyBinding.addKeyboardHandler(this.$dragKeybinding);
}, this.focusWait = function() {
var e = i(this.mousedownEvent.x, this.mousedownEvent.y, this.x, this.y), t = new Date().getTime();
(e > s || t - this.mousedownEvent.time > this.$focusTimout) && this.startSelect(this.mousedownEvent.getDocumentPosition());
}, this.dragWait = function() {
var e = i(this.mousedownEvent.x, this.mousedownEvent.y, this.x, this.y), t = new Date().getTime(), n = this.editor;
e > s ? this.startSelect(this.mousedownEvent.getDocumentPosition()) : t - this.mousedownEvent.time > n.$mouseHandler.$dragDelay && this.startDrag();
}, this.dragWaitEnd = function(e) {
this.mousedownEvent.domEvent = e, this.startSelect();
}, this.drag = function() {
var e = this.editor;
this.dragCursor = e.renderer.screenToTextCoordinates(this.x, this.y), e.moveCursorToPosition(this.dragCursor),
e.renderer.scrollCursorIntoView();
}, this.dragEnd = function(e) {
var t = this.editor, n = this.dragCursor, i = this.dragRange;
if (r.removeCssClass(t.container, "ace_dragging"), t.session.removeMarker(this.dragSelectionMarker),
t.keyBinding.removeKeyboardHandler(this.$dragKeybinding), n) {
if (t.clearSelection(), e && (e.ctrlKey || e.altKey)) {
var o = t.session, s = i;
s.end = o.insert(n, o.getTextRange(i)), s.start = n;
} else {
if (i.contains(n.row, n.column)) return;
var s = t.moveText(i, n);
}
s && t.selection.setSelectionRange(s);
}
}, this.onDoubleClick = function(e) {
var t = e.getDocumentPosition(), n = this.editor, i = n.session, o = i.getBracketRange(t);
return o ? (o.isEmpty() && (o.start.column--, o.end.column++), this.$clickSelection = o,
this.setState("select"), void 0) : (this.$clickSelection = n.selection.getWordRange(t.row, t.column),
this.setState("selectByWords"), void 0);
}, this.onTripleClick = function(e) {
var t = e.getDocumentPosition(), n = this.editor;
this.setState("selectByLines"), this.$clickSelection = n.selection.getLineRange(t.row);
}, this.onQuadClick = function() {
var e = this.editor;
e.selectAll(), this.$clickSelection = e.getSelectionRange(), this.setState("null");
}, this.onMouseWheel = function(e) {
if (!e.getShiftKey() && !e.getAccelKey()) {
var t = e.domEvent.timeStamp, n = t - (this.$lastScrollTime || 0), i = this.editor, o = i.renderer.isScrollableBy(e.wheelX * e.speed, e.wheelY * e.speed);
return o || 200 > n ? (this.$lastScrollTime = t, i.renderer.scrollBy(e.wheelX * e.speed, e.wheelY * e.speed),
e.stop()) : void 0;
}
};
}).call(n.prototype), t.DefaultHandlers = n;
}), define("ace/mouse/default_gutter_handler", [ "require", "exports", "module", "../lib/dom", "../lib/event" ], function(e, t) {
function n(e) {
function t() {
d = i.createElement("div"), d.className = "ace_gutter-tooltip", d.style.display = "none",
a.container.appendChild(d);
}
function n() {
d || t();
var e = u.getDocumentPosition().row, n = l.$annotations[e];
if (!n) return r();
var i = a.session.getLength();
if (e == i) {
var o = a.renderer.pixelToScreenCoordinates(0, u.y).row, c = u.$pos;
if (o > a.session.documentToScreenRow(c.row, c.column)) return r();
}
h != n && (h = n.text.join("<br/>"), d.style.display = "block", d.innerHTML = h,
a.on("mousewheel", r), s(u));
}
function r() {
c && (c = clearTimeout(c)), h && (d.style.display = "none", h = null, a.removeEventListener("mousewheel", r));
}
function s(e) {
var t = a.renderer.$gutter.getBoundingClientRect();
d.style.left = e.x + 15 + "px", e.y + 3 * a.renderer.lineHeight + 15 < t.bottom ? (d.style.bottom = "",
d.style.top = e.y + 15 + "px") : (d.style.top = "", d.style.bottom = t.bottom - e.y + 5 + "px");
}
var a = e.editor, l = a.renderer.$gutterLayer;
e.editor.setDefaultHandler("guttermousedown", function(t) {
if (a.isFocused() && 0 == t.getButton()) {
var n = l.getRegion(t);
if ("foldWidgets" != n) {
var i = t.getDocumentPosition().row, o = a.session.selection;
if (t.getShiftKey()) o.selectTo(i, 0); else {
if (2 == t.domEvent.detail) return a.selectAll(), t.preventDefault();
e.$clickSelection = a.selection.getLineRange(i);
}
return e.captureMouse(t, "selectByLines"), t.preventDefault();
}
}
});
var c, u, d, h;
e.editor.setDefaultHandler("guttermousemove", function(t) {
var o = t.domEvent.target || t.domEvent.srcElement;
return i.hasCssClass(o, "ace_fold-widget") ? r() : (h && s(t), u = t, c || (c = setTimeout(function() {
c = null, u && !e.isMousePressed ? n() : r();
}, 50)), void 0);
}), o.addListener(a.renderer.$gutter, "mouseout", function() {
u = null, h && !c && (c = setTimeout(function() {
c = null, r();
}, 50));
}), a.on("changeSession", r);
}
var i = e("../lib/dom"), o = e("../lib/event");
t.GutterHandler = n;
}), define("ace/mouse/mouse_event", [ "require", "exports", "module", "../lib/event", "../lib/useragent" ], function(e, t) {
var n = e("../lib/event"), i = e("../lib/useragent"), o = t.MouseEvent = function(e, t) {
this.domEvent = e, this.editor = t, this.x = this.clientX = e.clientX, this.y = this.clientY = e.clientY,
this.$pos = null, this.$inSelection = null, this.propagationStopped = !1, this.defaultPrevented = !1;
};
(function() {
this.stopPropagation = function() {
n.stopPropagation(this.domEvent), this.propagationStopped = !0;
}, this.preventDefault = function() {
n.preventDefault(this.domEvent), this.defaultPrevented = !0;
}, this.stop = function() {
this.stopPropagation(), this.preventDefault();
}, this.getDocumentPosition = function() {
return this.$pos ? this.$pos : (this.$pos = this.editor.renderer.screenToTextCoordinates(this.clientX, this.clientY),
this.$pos);
}, this.inSelection = function() {
if (null !== this.$inSelection) return this.$inSelection;
var e = this.editor;
if (e.getReadOnly()) this.$inSelection = !1; else {
var t = e.getSelectionRange();
if (t.isEmpty()) this.$inSelection = !1; else {
var n = this.getDocumentPosition();
this.$inSelection = t.contains(n.row, n.column);
}
}
return this.$inSelection;
}, this.getButton = function() {
return n.getButton(this.domEvent);
}, this.getShiftKey = function() {
return this.domEvent.shiftKey;
}, this.getAccelKey = i.isMac ? function() {
return this.domEvent.metaKey;
} : function() {
return this.domEvent.ctrlKey;
};
}).call(o.prototype);
}), define("ace/mouse/dragdrop", [ "require", "exports", "module", "../lib/event" ], function(e, t) {
var n = e("../lib/event"), i = function(e) {
function t() {
c = d.selection.toOrientedRange(), r = d.session.addMarker(c, "ace_selection", d.getSelectionStyle()),
d.clearSelection(), clearInterval(l), l = setInterval(f, 20), h = 0, n.addListener(document, "mousemove", o);
}
function i() {
clearInterval(l), d.session.removeMarker(r), r = null, d.selection.fromOrientedRange(c),
h = 0, n.removeListener(document, "mousemove", o);
}
function o() {
null == g && (g = setTimeout(function() {
null != g && r && i();
}, 20));
}
var r, s, a, l, c, u, d = e.editor, h = 0, p = d.container;
n.addListener(p, "dragenter", function(e) {
if (!d.getReadOnly()) {
var i = e.dataTransfer.types;
if (!i || -1 !== Array.prototype.indexOf.call(i, "text/plain")) return r || t(),
h++, n.preventDefault(e);
}
}), n.addListener(p, "dragover", function(e) {
if (!d.getReadOnly()) {
var t = e.dataTransfer.types;
if (!t || -1 !== Array.prototype.indexOf.call(t, "text/plain")) return null !== g && (g = null),
s = e.clientX, a = e.clientY, n.preventDefault(e);
}
});
var f = function() {
u = d.renderer.screenToTextCoordinates(s, a), d.moveCursorToPosition(u), d.renderer.scrollCursorIntoView();
};
n.addListener(p, "dragleave", function(e) {
return h--, 0 >= h && r ? (i(), n.preventDefault(e)) : void 0;
}), n.addListener(p, "drop", function(e) {
return r ? (c.end = d.session.insert(u, e.dataTransfer.getData("Text")), c.start = u,
i(), d.focus(), n.preventDefault(e)) : void 0;
});
var g = null;
};
t.DragdropHandler = i;
}), define("ace/lib/net", [ "require", "exports", "module", "./dom" ], function(e, t) {
var n = e("./dom");
t.get = function(e, t) {
var n = new XMLHttpRequest();
n.open("GET", e, !0), n.onreadystatechange = function() {
4 === n.readyState && t(n.responseText);
}, n.send(null);
}, t.loadScript = function(e, t) {
var i = n.getDocumentHead(), o = document.createElement("script");
o.src = e, i.appendChild(o), o.onload = o.onreadystatechange = function(e, n) {
(n || !o.readyState || "loaded" == o.readyState || "complete" == o.readyState) && (o = o.onload = o.onreadystatechange = null,
n || t());
};
};
}), define("ace/lib/event_emitter", [ "require", "exports", "module" ], function(e, t) {
var n = {}, i = function() {
this.propagationStopped = !0;
}, o = function() {
this.defaultPrevented = !0;
};
n._emit = n._dispatchEvent = function(e, t) {
this._eventRegistry || (this._eventRegistry = {}), this._defaultHandlers || (this._defaultHandlers = {});
var n = this._eventRegistry[e] || [], r = this._defaultHandlers[e];
if (n.length || r) {
"object" == typeof t && t || (t = {}), t.type || (t.type = e), t.stopPropagation || (t.stopPropagation = i),
t.preventDefault || (t.preventDefault = o), n = n.slice();
for (var s = 0; s < n.length && (n[s](t, this), !t.propagationStopped); s++) ;
return r && !t.defaultPrevented ? r(t, this) : void 0;
}
}, n._signal = function(e, t) {
var n = (this._eventRegistry || {})[e];
if (n) {
n = n.slice();
for (var i = 0; i < n.length; i++) n[i](t, this);
}
}, n.once = function(e, t) {
var n = this;
t && this.addEventListener(e, function i() {
n.removeEventListener(e, i), t.apply(null, arguments);
});
}, n.setDefaultHandler = function(e, t) {
var n = this._defaultHandlers;
if (n || (n = this._defaultHandlers = {
_disabled_: {}
}), n[e]) {
var i = n[e], o = n._disabled_[e];
o || (n._disabled_[e] = o = []), o.push(i);
var r = o.indexOf(t);
-1 != r && o.splice(r, 1);
}
n[e] = t;
}, n.removeDefaultHandler = function(e, t) {
var n = this._defaultHandlers;
if (n) {
var i = n._disabled_[e];
if (n[e] == t) n[e], i && this.setDefaultHandler(e, i.pop()); else if (i) {
var o = i.indexOf(t);
-1 != o && i.splice(o, 1);
}
}
}, n.on = n.addEventListener = function(e, t, n) {
this._eventRegistry = this._eventRegistry || {};
var i = this._eventRegistry[e];
return i || (i = this._eventRegistry[e] = []), -1 == i.indexOf(t) && i[n ? "unshift" : "push"](t),
t;
}, n.off = n.removeListener = n.removeEventListener = function(e, t) {
this._eventRegistry = this._eventRegistry || {};
var n = this._eventRegistry[e];
if (n) {
var i = n.indexOf(t);
-1 !== i && n.splice(i, 1);
}
}, n.removeAllListeners = function(e) {
this._eventRegistry && (this._eventRegistry[e] = []);
}, t.EventEmitter = n;
}), define("ace/config", [ "require", "exports", "module", "./lib/lang", "./lib/oop", "./lib/net", "./lib/event_emitter" ], function(e, t, n) {
"no use strict";
function i(e) {
return e.replace(/-(.)/g, function(e, t) {
return t.toUpperCase();
});
}
var o = e("./lib/lang"), r = e("./lib/oop"), s = e("./lib/net"), a = e("./lib/event_emitter").EventEmitter, l = function() {
return this;
}(), c = {
packaged: !1,
workerPath: null,
modePath: null,
themePath: null,
basePath: "",
suffix: ".js",
$moduleUrls: {}
};
t.get = function(e) {
if (!c.hasOwnProperty(e)) throw new Error("Unknown config key: " + e);
return c[e];
}, t.set = function(e, t) {
if (!c.hasOwnProperty(e)) throw new Error("Unknown config key: " + e);
c[e] = t;
}, t.all = function() {
return o.copyObject(c);
}, r.implement(t, a), t.moduleUrl = function(e, t) {
if (c.$moduleUrls[e]) return c.$moduleUrls[e];
var n = e.split("/");
t = t || n[n.length - 2] || "";
var i = "snippets" == t ? "/" : "-", o = n[n.length - 1];
if ("-" == i) {
var r = new RegExp("^" + t + "[-_]|[-_]" + t + "$", "g");
o = o.replace(r, "");
}
(!o || o == t) && n.length > 1 && (o = n[n.length - 2]);
var s = c[t + "Path"];
return null == s ? s = c.basePath : "/" == i && (t = i = ""), s && "/" != s.slice(-1) && (s += "/"),
s + t + i + o + this.get("suffix");
}, t.setModuleUrl = function(e, t) {
return c.$moduleUrls[e] = t;
}, t.$loading = {}, t.loadModule = function(n, i) {
var o, r;
Array.isArray(n) && (r = n[0], n = n[1]);
try {
o = e(n);
} catch (a) {}
if (o && !t.$loading[n]) return i && i(o);
if (t.$loading[n] || (t.$loading[n] = []), t.$loading[n].push(i), !(t.$loading[n].length > 1)) {
var l = function() {
e([ n ], function(e) {
t._emit("load.module", {
name: n,
module: e
});
var i = t.$loading[n];
t.$loading[n] = null, i.forEach(function(t) {
t && t(e);
});
});
};
return t.get("packaged") ? (s.loadScript(t.moduleUrl(n, r), l), void 0) : l();
}
}, t.init = function() {
if (c.packaged = e.packaged || n.packaged || l.define && define.packaged, !l.document) return "";
for (var o = {}, r = "", s = document.getElementsByTagName("script"), a = 0; a < s.length; a++) {
var u = s[a], d = u.src || u.getAttribute("src");
if (d) {
for (var h = u.attributes, p = 0, f = h.length; f > p; p++) {
var g = h[p];
0 === g.name.indexOf("data-ace-") && (o[i(g.name.replace(/^data-ace-/, ""))] = g.value);
}
var m = d.match(/^(.*)\/ace(\-\w+)?\.js(\?|$)/);
m && (r = m[1]);
}
}
r && (o.base = o.base || r, o.packaged = !0), o.basePath = o.base, o.workerPath = o.workerPath || o.base,
o.modePath = o.modePath || o.base, o.themePath = o.themePath || o.base, delete o.base;
for (var v in o) "undefined" != typeof o[v] && t.set(v, o[v]);
};
var u = {
setOptions: function(e) {
Object.keys(e).forEach(function(t) {
this.setOption(t, e[t]);
}, this);
},
getOptions: function(e) {
var t = {};
return e ? Array.isArray(e) || (t = e, e = Object.keys(t)) : e = Object.keys(this.$options),
e.forEach(function(e) {
t[e] = this.getOption(e);
}, this), t;
},
setOption: function(e, t) {
if (this["$" + e] !== t) {
var n = this.$options[e];
if (!n) return void 0;
if (n.forwardTo) return this[n.forwardTo] && this[n.forwardTo].setOption(e, t);
n.handlesSet || (this["$" + e] = t), n && n.set && n.set.call(this, t);
}
},
getOption: function(e) {
var t = this.$options[e];
return t ? t.forwardTo ? this[t.forwardTo] && this[t.forwardTo].getOption(e) : t && t.get ? t.get.call(this) : this["$" + e] : void 0;
}
}, d = {};
t.defineOptions = function(e, t, n) {
return e.$options || (d[t] = e.$options = {}), Object.keys(n).forEach(function(t) {
var i = n[t];
"string" == typeof i && (i = {
forwardTo: i
}), i.name || (i.name = t), e.$options[i.name] = i, "initialValue" in i && (e["$" + i.name] = i.initialValue);
}), r.implement(e, u), this;
}, t.resetOptions = function(e) {
Object.keys(e.$options).forEach(function(t) {
var n = e.$options[t];
"value" in n && e.setOption(t, n.value);
});
}, t.setDefaultValue = function(e, n, i) {
var o = d[e] || (d[e] = {});
o[n] && (o.forwardTo ? t.setDefaultValue(o.forwardTo, n, i) : o[n].value = i);
}, t.setDefaultValues = function(e, n) {
Object.keys(n).forEach(function(i) {
t.setDefaultValue(e, i, n[i]);
});
};
}), define("ace/mouse/mouse_handler", [ "require", "exports", "module", "../lib/event", "../lib/useragent", "./default_handlers", "./default_gutter_handler", "./mouse_event", "./dragdrop", "../config" ], function(e, t) {
var n = e("../lib/event"), i = e("../lib/useragent"), o = e("./default_handlers").DefaultHandlers, r = e("./default_gutter_handler").GutterHandler, s = e("./mouse_event").MouseEvent, a = e("./dragdrop").DragdropHandler, l = e("../config"), c = function(e) {
this.editor = e, new o(this), new r(this), new a(this);
var t = e.renderer.getMouseEventTarget();
n.addListener(t, "click", this.onMouseEvent.bind(this, "click")), n.addListener(t, "mousemove", this.onMouseMove.bind(this, "mousemove")),
n.addMultiMouseDownListener(t, [ 300, 300, 250 ], this, "onMouseEvent"), e.renderer.scrollBarV && (n.addMultiMouseDownListener(e.renderer.scrollBarV.inner, [ 300, 300, 250 ], this, "onMouseEvent"),
n.addMultiMouseDownListener(e.renderer.scrollBarH.inner, [ 300, 300, 250 ], this, "onMouseEvent")),
n.addMouseWheelListener(e.container, this.onMouseWheel.bind(this, "mousewheel"));
var i = e.renderer.$gutter;
n.addListener(i, "mousedown", this.onMouseEvent.bind(this, "guttermousedown")),
n.addListener(i, "click", this.onMouseEvent.bind(this, "gutterclick")), n.addListener(i, "dblclick", this.onMouseEvent.bind(this, "gutterdblclick")),
n.addListener(i, "mousemove", this.onMouseEvent.bind(this, "guttermousemove")),
n.addListener(t, "mousedown", function(t) {
return e.focus(), n.preventDefault(t);
}), n.addListener(i, "mousedown", function(t) {
return e.focus(), n.preventDefault(t);
});
};
(function() {
this.onMouseEvent = function(e, t) {
this.editor._emit(e, new s(t, this.editor));
}, this.onMouseMove = function(e, t) {
var n = this.editor._eventRegistry && this.editor._eventRegistry.mousemove;
n && n.length && this.editor._emit(e, new s(t, this.editor));
}, this.onMouseWheel = function(e, t) {
var n = new s(t, this.editor);
n.speed = 2 * this.$scrollSpeed, n.wheelX = t.wheelX, n.wheelY = t.wheelY, this.editor._emit(e, n);
}, this.setState = function(e) {
this.state = e;
}, this.captureMouse = function(e, t) {
t && this.setState(t), this.x = e.x, this.y = e.y, this.isMousePressed = !0;
var o = this.editor.renderer;
o.$keepTextAreaAtCursor && (o.$keepTextAreaAtCursor = null);
var r = this, s = function(e) {
r.x = e.clientX, r.y = e.clientY;
}, a = function(e) {
clearInterval(c), l(), r[r.state + "End"] && r[r.state + "End"](e), r.$clickSelection = null,
null == o.$keepTextAreaAtCursor && (o.$keepTextAreaAtCursor = !0, o.$moveTextAreaToCursor()),
r.isMousePressed = !1, r.onMouseEvent("mouseup", e);
}, l = function() {
r[r.state] && r[r.state]();
};
if (i.isOldIE && "dblclick" == e.domEvent.type) return setTimeout(function() {
a(e);
});
n.capture(this.editor.container, s, a);
var c = setInterval(l, 20);
};
}).call(c.prototype), l.defineOptions(c.prototype, "mouseHandler", {
scrollSpeed: {
initialValue: 2
},
dragDelay: {
initialValue: 150
},
focusTimout: {
initialValue: 0
}
}), t.MouseHandler = c;
}), define("ace/mouse/fold_handler", [ "require", "exports", "module" ], function(e, t) {
function n(e) {
e.on("click", function(t) {
var n = t.getDocumentPosition(), i = e.session, o = i.getFoldAt(n.row, n.column, 1);
o && (t.getAccelKey() ? i.removeFold(o) : i.expandFold(o), t.stop());
}), e.on("gutterclick", function(t) {
var n = e.renderer.$gutterLayer.getRegion(t);
if ("foldWidgets" == n) {
var i = t.getDocumentPosition().row, o = e.session;
o.foldWidgets && o.foldWidgets[i] && e.session.onFoldWidgetClick(i, t), e.isFocused() || e.focus(),
t.stop();
}
}), e.on("gutterdblclick", function(t) {
var n = e.renderer.$gutterLayer.getRegion(t);
if ("foldWidgets" == n) {
var i = t.getDocumentPosition().row, o = e.session, r = o.getParentFoldRangeData(i, !0), s = r.range || r.firstRange;
if (s) {
var i = s.start.row, a = o.getFoldAt(i, o.getLine(i).length, 1);
a ? o.removeFold(a) : (o.addFold("...", s), e.renderer.scrollCursorIntoView({
row: s.start.row,
column: 0
}));
}
t.stop();
}
});
}
t.FoldHandler = n;
}), define("ace/keyboard/keybinding", [ "require", "exports", "module", "../lib/keys", "../lib/event" ], function(e, t) {
var n = e("../lib/keys"), i = e("../lib/event"), o = function(e) {
this.$editor = e, this.$data = {}, this.$handlers = [], this.setDefaultHandler(e.commands);
};
(function() {
this.setDefaultHandler = function(e) {
this.removeKeyboardHandler(this.$defaultHandler), this.$defaultHandler = e, this.addKeyboardHandler(e, 0),
this.$data = {
editor: this.$editor
};
}, this.setKeyboardHandler = function(e) {
var t = this.$handlers;
if (t[t.length - 1] != e) {
for (;t[t.length - 1] && t[t.length - 1] != this.$defaultHandler; ) this.removeKeyboardHandler(t[t.length - 1]);
this.addKeyboardHandler(e, 1);
}
}, this.addKeyboardHandler = function(e, t) {
if (e) {
var n = this.$handlers.indexOf(e);
-1 != n && this.$handlers.splice(n, 1), void 0 == t ? this.$handlers.push(e) : this.$handlers.splice(t, 0, e),
-1 == n && e.attach && e.attach(this.$editor);
}
}, this.removeKeyboardHandler = function(e) {
var t = this.$handlers.indexOf(e);
return -1 == t ? !1 : (this.$handlers.splice(t, 1), e.detach && e.detach(this.$editor),
!0);
}, this.getKeyboardHandler = function() {
return this.$handlers[this.$handlers.length - 1];
}, this.$callKeyboardHandlers = function(e, t, n, o) {
for (var r, s = !1, a = this.$editor.commands, l = this.$handlers.length; l-- && (r = this.$handlers[l].handleKeyboard(this.$data, e, t, n, o),
!(r && r.command && (s = "null" == r.command ? !0 : a.exec(r.command, this.$editor, r.args, o),
s && o && -1 != e && 1 != r.passEvent && 1 != r.command.passEvent && i.stopEvent(o),
s))); ) ;
return s;
}, this.onCommandKey = function(e, t, i) {
var o = n.keyCodeToString(i);
this.$callKeyboardHandlers(t, o, i, e);
}, this.onTextInput = function(e) {
var t = this.$callKeyboardHandlers(-1, e);
t || this.$editor.commands.exec("insertstring", this.$editor, e);
};
}).call(o.prototype), t.KeyBinding = o;
}), define("ace/range", [ "require", "exports", "module" ], function(e, t) {
var n = function(e, t) {
return e.row - t.row || e.column - t.column;
}, i = function(e, t, n, i) {
this.start = {
row: e,
column: t
}, this.end = {
row: n,
column: i
};
};
(function() {
this.isEqual = function(e) {
return this.start.row === e.start.row && this.end.row === e.end.row && this.start.column === e.start.column && this.end.column === e.end.column;
}, this.toString = function() {
return "Range: [" + this.start.row + "/" + this.start.column + "] -> [" + this.end.row + "/" + this.end.column + "]";
}, this.contains = function(e, t) {
return 0 == this.compare(e, t);
}, this.compareRange = function(e) {
var t, n = e.end, i = e.start;
return t = this.compare(n.row, n.column), 1 == t ? (t = this.compare(i.row, i.column),
1 == t ? 2 : 0 == t ? 1 : 0) : -1 == t ? -2 : (t = this.compare(i.row, i.column),
-1 == t ? -1 : 1 == t ? 42 : 0);
}, this.comparePoint = function(e) {
return this.compare(e.row, e.column);
}, this.containsRange = function(e) {
return 0 == this.comparePoint(e.start) && 0 == this.comparePoint(e.end);
}, this.intersects = function(e) {
var t = this.compareRange(e);
return -1 == t || 0 == t || 1 == t;
}, this.isEnd = function(e, t) {
return this.end.row == e && this.end.column == t;
}, this.isStart = function(e, t) {
return this.start.row == e && this.start.column == t;
}, this.setStart = function(e, t) {
"object" == typeof e ? (this.start.column = e.column, this.start.row = e.row) : (this.start.row = e,
this.start.column = t);
}, this.setEnd = function(e, t) {
"object" == typeof e ? (this.end.column = e.column, this.end.row = e.row) : (this.end.row = e,
this.end.column = t);
}, this.inside = function(e, t) {
return 0 == this.compare(e, t) ? this.isEnd(e, t) || this.isStart(e, t) ? !1 : !0 : !1;
}, this.insideStart = function(e, t) {
return 0 == this.compare(e, t) ? this.isEnd(e, t) ? !1 : !0 : !1;
}, this.insideEnd = function(e, t) {
return 0 == this.compare(e, t) ? this.isStart(e, t) ? !1 : !0 : !1;
}, this.compare = function(e, t) {
return this.isMultiLine() || e !== this.start.row ? e < this.start.row ? -1 : e > this.end.row ? 1 : this.start.row === e ? t >= this.start.column ? 0 : -1 : this.end.row === e ? t <= this.end.column ? 0 : 1 : 0 : t < this.start.column ? -1 : t > this.end.column ? 1 : 0;
}, this.compareStart = function(e, t) {
return this.start.row == e && this.start.column == t ? -1 : this.compare(e, t);
}, this.compareEnd = function(e, t) {
return this.end.row == e && this.end.column == t ? 1 : this.compare(e, t);
}, this.compareInside = function(e, t) {
return this.end.row == e && this.end.column == t ? 1 : this.start.row == e && this.start.column == t ? -1 : this.compare(e, t);
}, this.clipRows = function(e, t) {
if (this.end.row > t) var n = {
row: t + 1,
column: 0
}; else if (this.end.row < e) var n = {
row: e,
column: 0
};
if (this.start.row > t) var o = {
row: t + 1,
column: 0
}; else if (this.start.row < e) var o = {
row: e,
column: 0
};
return i.fromPoints(o || this.start, n || this.end);
}, this.extend = function(e, t) {
var n = this.compare(e, t);
if (0 == n) return this;
if (-1 == n) var o = {
row: e,
column: t
}; else var r = {
row: e,
column: t
};
return i.fromPoints(o || this.start, r || this.end);
}, this.isEmpty = function() {
return this.start.row === this.end.row && this.start.column === this.end.column;
}, this.isMultiLine = function() {
return this.start.row !== this.end.row;
}, this.clone = function() {
return i.fromPoints(this.start, this.end);
}, this.collapseRows = function() {
return 0 == this.end.column ? new i(this.start.row, 0, Math.max(this.start.row, this.end.row - 1), 0) : new i(this.start.row, 0, this.end.row, 0);
}, this.toScreenRange = function(e) {
var t = e.documentToScreenPosition(this.start), n = e.documentToScreenPosition(this.end);
return new i(t.row, t.column, n.row, n.column);
}, this.moveBy = function(e, t) {
this.start.row += e, this.start.column += t, this.end.row += e, this.end.column += t;
};
}).call(i.prototype), i.fromPoints = function(e, t) {
return new i(e.row, e.column, t.row, t.column);
}, i.comparePoints = n, i.comparePoints = function(e, t) {
return e.row - t.row || e.column - t.column;
}, t.Range = i;
}), define("ace/selection", [ "require", "exports", "module", "./lib/oop", "./lib/lang", "./lib/event_emitter", "./range" ], function(e, t) {
var n = e("./lib/oop"), i = e("./lib/lang"), o = e("./lib/event_emitter").EventEmitter, r = e("./range").Range, s = function(e) {
this.session = e, this.doc = e.getDocument(), this.clearSelection(), this.lead = this.selectionLead = this.doc.createAnchor(0, 0),
this.anchor = this.selectionAnchor = this.doc.createAnchor(0, 0);
var t = this;
this.lead.on("change", function(e) {
t._emit("changeCursor"), t.$isEmpty || t._emit("changeSelection"), t.$keepDesiredColumnOnChange || e.old.column == e.value.column || (t.$desiredColumn = null);
}), this.selectionAnchor.on("change", function() {
t.$isEmpty || t._emit("changeSelection");
});
};
(function() {
n.implement(this, o), this.isEmpty = function() {
return this.$isEmpty || this.anchor.row == this.lead.row && this.anchor.column == this.lead.column;
}, this.isMultiLine = function() {
return this.isEmpty() ? !1 : this.getRange().isMultiLine();
}, this.getCursor = function() {
return this.lead.getPosition();
}, this.setSelectionAnchor = function(e, t) {
this.anchor.setPosition(e, t), this.$isEmpty && (this.$isEmpty = !1, this._emit("changeSelection"));
}, this.getSelectionAnchor = function() {
return this.$isEmpty ? this.getSelectionLead() : this.anchor.getPosition();
}, this.getSelectionLead = function() {
return this.lead.getPosition();
}, this.shiftSelection = function(e) {
if (this.$isEmpty) return this.moveCursorTo(this.lead.row, this.lead.column + e),
void 0;
var t = this.getSelectionAnchor(), n = this.getSelectionLead(), i = this.isBackwards();
i && 0 === t.column || this.setSelectionAnchor(t.row, t.column + e), (i || 0 !== n.column) && this.$moveSelection(function() {
this.moveCursorTo(n.row, n.column + e);
});
}, this.isBackwards = function() {
var e = this.anchor, t = this.lead;
return e.row > t.row || e.row == t.row && e.column > t.column;
}, this.getRange = function() {
var e = this.anchor, t = this.lead;
return this.isEmpty() ? r.fromPoints(t, t) : this.isBackwards() ? r.fromPoints(t, e) : r.fromPoints(e, t);
}, this.clearSelection = function() {
this.$isEmpty || (this.$isEmpty = !0, this._emit("changeSelection"));
}, this.selectAll = function() {
var e = this.doc.getLength() - 1;
this.setSelectionAnchor(0, 0), this.moveCursorTo(e, this.doc.getLine(e).length);
}, this.setRange = this.setSelectionRange = function(e, t) {
t ? (this.setSelectionAnchor(e.end.row, e.end.column), this.selectTo(e.start.row, e.start.column)) : (this.setSelectionAnchor(e.start.row, e.start.column),
this.selectTo(e.end.row, e.end.column)), this.getRange().isEmpty() && (this.$isEmpty = !0),
this.$desiredColumn = null;
}, this.$moveSelection = function(e) {
var t = this.lead;
this.$isEmpty && this.setSelectionAnchor(t.row, t.column), e.call(this);
}, this.selectTo = function(e, t) {
this.$moveSelection(function() {
this.moveCursorTo(e, t);
});
}, this.selectToPosition = function(e) {
this.$moveSelection(function() {
this.moveCursorToPosition(e);
});
}, this.selectUp = function() {
this.$moveSelection(this.moveCursorUp);
}, this.selectDown = function() {
this.$moveSelection(this.moveCursorDown);
}, this.selectRight = function() {
this.$moveSelection(this.moveCursorRight);
}, this.selectLeft = function() {
this.$moveSelection(this.moveCursorLeft);
}, this.selectLineStart = function() {
this.$moveSelection(this.moveCursorLineStart);
}, this.selectLineEnd = function() {
this.$moveSelection(this.moveCursorLineEnd);
}, this.selectFileEnd = function() {
this.$moveSelection(this.moveCursorFileEnd);
}, this.selectFileStart = function() {
this.$moveSelection(this.moveCursorFileStart);
}, this.selectWordRight = function() {
this.$moveSelection(this.moveCursorWordRight);
}, this.selectWordLeft = function() {
this.$moveSelection(this.moveCursorWordLeft);
}, this.getWordRange = function(e, t) {
if ("undefined" == typeof t) {
var n = e || this.lead;
e = n.row, t = n.column;
}
return this.session.getWordRange(e, t);
}, this.selectWord = function() {
this.setSelectionRange(this.getWordRange());
}, this.selectAWord = function() {
var e = this.getCursor(), t = this.session.getAWordRange(e.row, e.column);
this.setSelectionRange(t);
}, this.getLineRange = function(e, t) {
var n, i = "number" == typeof e ? e : this.lead.row, o = this.session.getFoldLine(i);
return o ? (i = o.start.row, n = o.end.row) : n = i, t === !0 ? new r(i, 0, n, this.session.getLine(n).length) : new r(i, 0, n + 1, 0);
}, this.selectLine = function() {
this.setSelectionRange(this.getLineRange());
}, this.moveCursorUp = function() {
this.moveCursorBy(-1, 0);
}, this.moveCursorDown = function() {
this.moveCursorBy(1, 0);
}, this.moveCursorLeft = function() {
var e, t = this.lead.getPosition();
if (e = this.session.getFoldAt(t.row, t.column, -1)) this.moveCursorTo(e.start.row, e.start.column); else if (0 == t.column) t.row > 0 && this.moveCursorTo(t.row - 1, this.doc.getLine(t.row - 1).length); else {
var n = this.session.getTabSize();
this.session.isTabStop(t) && this.doc.getLine(t.row).slice(t.column - n, t.column).split(" ").length - 1 == n ? this.moveCursorBy(0, -n) : this.moveCursorBy(0, -1);
}
}, this.moveCursorRight = function() {
var e, t = this.lead.getPosition();
if (e = this.session.getFoldAt(t.row, t.column, 1)) this.moveCursorTo(e.end.row, e.end.column); else if (this.lead.column == this.doc.getLine(this.lead.row).length) this.lead.row < this.doc.getLength() - 1 && this.moveCursorTo(this.lead.row + 1, 0); else {
var n = this.session.getTabSize(), t = this.lead;
this.session.isTabStop(t) && this.doc.getLine(t.row).slice(t.column, t.column + n).split(" ").length - 1 == n ? this.moveCursorBy(0, n) : this.moveCursorBy(0, 1);
}
}, this.moveCursorLineStart = function() {
var e = this.lead.row, t = this.lead.column, n = this.session.documentToScreenRow(e, t), i = this.session.screenToDocumentPosition(n, 0), o = this.session.getDisplayLine(e, null, i.row, i.column), r = o.match(/^\s*/);
r[0].length == t || this.session.$useEmacsStyleLineStart || (i.column += r[0].length),
this.moveCursorToPosition(i);
}, this.moveCursorLineEnd = function() {
var e = this.lead, t = this.session.getDocumentLastRowColumnPosition(e.row, e.column);
if (this.lead.column == t.column) {
var n = this.session.getLine(t.row);
if (t.column == n.length) {
var i = n.search(/\s+$/);
i > 0 && (t.column = i);
}
}
this.moveCursorTo(t.row, t.column);
}, this.moveCursorFileEnd = function() {
var e = this.doc.getLength() - 1, t = this.doc.getLine(e).length;
this.moveCursorTo(e, t);
}, this.moveCursorFileStart = function() {
this.moveCursorTo(0, 0);
}, this.moveCursorLongWordRight = function() {
var e, t = this.lead.row, n = this.lead.column, i = this.doc.getLine(t), o = i.substring(n);
this.session.nonTokenRe.lastIndex = 0, this.session.tokenRe.lastIndex = 0;
var r = this.session.getFoldAt(t, n, 1);
return r ? (this.moveCursorTo(r.end.row, r.end.column), void 0) : ((e = this.session.nonTokenRe.exec(o)) && (n += this.session.nonTokenRe.lastIndex,
this.session.nonTokenRe.lastIndex = 0, o = i.substring(n)), n >= i.length ? (this.moveCursorTo(t, i.length),
this.moveCursorRight(), t < this.doc.getLength() - 1 && this.moveCursorWordRight(),
void 0) : ((e = this.session.tokenRe.exec(o)) && (n += this.session.tokenRe.lastIndex,
this.session.tokenRe.lastIndex = 0), this.moveCursorTo(t, n), void 0));
}, this.moveCursorLongWordLeft = function() {
var e, t = this.lead.row, n = this.lead.column;
if (e = this.session.getFoldAt(t, n, -1)) return this.moveCursorTo(e.start.row, e.start.column),
void 0;
var o = this.session.getFoldStringAt(t, n, -1);
null == o && (o = this.doc.getLine(t).substring(0, n));
var r, s = i.stringReverse(o);
return this.session.nonTokenRe.lastIndex = 0, this.session.tokenRe.lastIndex = 0,
(r = this.session.nonTokenRe.exec(s)) && (n -= this.session.nonTokenRe.lastIndex,
s = s.slice(this.session.nonTokenRe.lastIndex), this.session.nonTokenRe.lastIndex = 0),
0 >= n ? (this.moveCursorTo(t, 0), this.moveCursorLeft(), t > 0 && this.moveCursorWordLeft(),
void 0) : ((r = this.session.tokenRe.exec(s)) && (n -= this.session.tokenRe.lastIndex,
this.session.tokenRe.lastIndex = 0), this.moveCursorTo(t, n), void 0);
}, this.$shortWordEndIndex = function(e) {
var t, n, i = 0, o = /\s/, r = this.session.tokenRe;
if (r.lastIndex = 0, t = this.session.tokenRe.exec(e)) i = this.session.tokenRe.lastIndex; else {
for (;(n = e[i]) && o.test(n); ) i++;
if (1 > i) for (r.lastIndex = 0; (n = e[i]) && !r.test(n); ) if (r.lastIndex = 0,
i++, o.test(n)) {
if (i > 2) {
i--;
break;
}
for (;(n = e[i]) && o.test(n); ) i++;
if (i > 2) break;
}
}
return r.lastIndex = 0, i;
}, this.moveCursorShortWordRight = function() {
var e = this.lead.row, t = this.lead.column, n = this.doc.getLine(e), i = n.substring(t), o = this.session.getFoldAt(e, t, 1);
if (o) return this.moveCursorTo(o.end.row, o.end.column);
if (t == n.length) {
var r = this.doc.getLength();
do e++, i = this.doc.getLine(e); while (r > e && /^\s*$/.test(i));
/^\s+/.test(i) || (i = ""), t = 0;
}
var s = this.$shortWordEndIndex(i);
this.moveCursorTo(e, t + s);
}, this.moveCursorShortWordLeft = function() {
var e, t = this.lead.row, n = this.lead.column;
if (e = this.session.getFoldAt(t, n, -1)) return this.moveCursorTo(e.start.row, e.start.column);
var o = this.session.getLine(t).substring(0, n);
if (0 == n) {
do t--, o = this.doc.getLine(t); while (t > 0 && /^\s*$/.test(o));
n = o.length, /\s+$/.test(o) || (o = "");
}
var r = i.stringReverse(o), s = this.$shortWordEndIndex(r);
return this.moveCursorTo(t, n - s);
}, this.moveCursorWordRight = function() {
this.session.$selectLongWords ? this.moveCursorLongWordRight() : this.moveCursorShortWordRight();
}, this.moveCursorWordLeft = function() {
this.session.$selectLongWords ? this.moveCursorLongWordLeft() : this.moveCursorShortWordLeft();
}, this.moveCursorBy = function(e, t) {
var n = this.session.documentToScreenPosition(this.lead.row, this.lead.column);
0 === t && (this.$desiredColumn ? n.column = this.$desiredColumn : this.$desiredColumn = n.column);
var i = this.session.screenToDocumentPosition(n.row + e, n.column);
this.moveCursorTo(i.row, i.column + t, 0 === t);
}, this.moveCursorToPosition = function(e) {
this.moveCursorTo(e.row, e.column);
}, this.moveCursorTo = function(e, t, n) {
var i = this.session.getFoldAt(e, t, 1);
i && (e = i.start.row, t = i.start.column), this.$keepDesiredColumnOnChange = !0,
this.lead.setPosition(e, t), this.$keepDesiredColumnOnChange = !1, n || (this.$desiredColumn = null);
}, this.moveCursorToScreen = function(e, t, n) {
var i = this.session.screenToDocumentPosition(e, t);
this.moveCursorTo(i.row, i.column, n);
}, this.detach = function() {
this.lead.detach(), this.anchor.detach(), this.session = this.doc = null;
}, this.fromOrientedRange = function(e) {
this.setSelectionRange(e, e.cursor == e.start), this.$desiredColumn = e.desiredColumn || this.$desiredColumn;
}, this.toOrientedRange = function(e) {
var t = this.getRange();
return e ? (e.start.column = t.start.column, e.start.row = t.start.row, e.end.column = t.end.column,
e.end.row = t.end.row) : e = t, e.cursor = this.isBackwards() ? e.start : e.end,
e.desiredColumn = this.$desiredColumn, e;
}, this.toJSON = function() {
if (this.rangeCount) var e = this.ranges.map(function(e) {
var t = e.clone();
return t.isBackwards = e.cursor == e.start, t;
}); else {
var e = this.getRange();
e.isBackwards = this.isBackwards();
}
return e;
}, this.fromJSON = function(e) {
if (void 0 == e.start) {
if (this.rangeList) {
this.toSingleRange(e[0]);
for (var t = e.length; t--; ) {
var n = r.fromPoints(e[t].start, e[t].end);
e.isBackwards && (n.cursor = n.start), this.addRange(n, !0);
}
return;
}
e = e[0];
}
this.rangeList && this.toSingleRange(e), this.setSelectionRange(e, e.isBackwards);
}, this.isEqual = function(e) {
if ((e.length || this.rangeCount) && e.length != this.rangeCount) return !1;
if (!e.length || !this.ranges) return this.getRange().isEqual(e);
for (var t = this.ranges.length; t--; ) if (!this.ranges[t].isEqual(e[t])) return !1;
return !0;
};
}).call(s.prototype), t.Selection = s;
}), define("ace/tokenizer", [ "require", "exports", "module" ], function(e, t) {
var n = 1e3, i = function(e) {
this.states = e, this.regExps = {}, this.matchMappings = {};
for (var t in this.states) {
for (var n = this.states[t], i = [], o = 0, r = this.matchMappings[t] = {
defaultToken: "text"
}, s = "g", a = [], l = 0; l < n.length; l++) {
var c = n[l];
if (c.defaultToken && (r.defaultToken = c.defaultToken), c.caseInsensitive && (s = "gi"),
null != c.regex) {
c.regex instanceof RegExp && (c.regex = c.regex.toString().slice(1, -1));
var u = c.regex, d = new RegExp("(?:(" + u + ")|(.))").exec("a").length - 2;
if (Array.isArray(c.token)) if (1 == c.token.length || 1 == d) c.token = c.token[0]; else {
if (d - 1 != c.token.length) throw new Error("number of classes and regexp groups in '" + c.token + "'\n'" + c.regex + "' doesn't match\n" + (d - 1) + "!=" + c.token.length);
c.tokenArray = c.token, c.token = null, c.onMatch = this.$arrayTokens;
} else "function" != typeof c.token || c.onMatch || (c.onMatch = d > 1 ? this.$applyToken : c.token);
d > 1 && (/\\\d/.test(c.regex) ? u = c.regex.replace(/\\([0-9]+)/g, function(e, t) {
return "\\" + (parseInt(t, 10) + o + 1);
}) : (d = 1, u = this.removeCapturingGroups(c.regex)), c.splitRegex || "string" == typeof c.token || a.push(c)),
r[o] = l, o += d, i.push(u), c.onMatch || (c.onMatch = null), c.__proto__ = null;
}
}
a.forEach(function(e) {
e.splitRegex = this.createSplitterRegexp(e.regex, s);
}, this), this.regExps[t] = new RegExp("(" + i.join(")|(") + ")|($)", s);
}
};
(function() {
this.$applyToken = function(e) {
var t = this.splitRegex.exec(e).slice(1), n = this.token.apply(this, t);
if ("string" == typeof n) return [ {
type: n,
value: e
} ];
for (var i = [], o = 0, r = n.length; r > o; o++) t[o] && (i[i.length] = {
type: n[o],
value: t[o]
});
return i;
}, this.$arrayTokens = function(e) {
if (!e) return [];
var t = this.splitRegex.exec(e);
if (!t) return "text";
for (var n = [], i = this.tokenArray, o = 0, r = i.length; r > o; o++) t[o + 1] && (n[n.length] = {
type: i[o],
value: t[o + 1]
});
return n;
}, this.removeCapturingGroups = function(e) {
var t = e.replace(/\[(?:\\.|[^\]])*?\]|\\.|\(\?[:=!]|(\()/g, function(e, t) {
return t ? "(?:" : e;
});
return t;
}, this.createSplitterRegexp = function(e, t) {
if (-1 != e.indexOf("(?=")) {
var n = 0, i = !1, o = {};
e.replace(/(\\.)|(\((?:\?[=!])?)|(\))|([\[\]])/g, function(e, t, r, s, a, l) {
return i ? i = "]" != a : a ? i = !0 : s ? (n == o.stack && (o.end = l + 1, o.stack = -1),
n--) : r && (n++, 1 != r.length && (o.stack = n, o.start = l)), e;
}), null != o.end && /^\)*$/.test(e.substr(o.end)) && (e = e.substring(0, o.start) + e.substr(o.end));
}
return new RegExp(e, (t || "").replace("g", ""));
}, this.getLineTokens = function(e, t) {
if (t && "string" != typeof t) {
var i = t.slice(0);
t = i[0];
} else var i = [];
var o = t || "start", r = this.states[o], s = this.matchMappings[o], a = this.regExps[o];
a.lastIndex = 0;
for (var l, c = [], u = 0, d = {
type: null,
value: ""
}; l = a.exec(e); ) {
var h = s.defaultToken, p = null, f = l[0], g = a.lastIndex;
if (g - f.length > u) {
var m = e.substring(u, g - f.length);
d.type == h ? d.value += m : (d.type && c.push(d), d = {
type: h,
value: m
});
}
for (var v = 0; v < l.length - 2; v++) if (void 0 !== l[v + 1]) {
p = r[s[v]], h = p.onMatch ? p.onMatch(f, o, i) : p.token, p.next && (o = "string" == typeof p.next ? p.next : p.next(o, i),
r = this.states[o], r || (window.console && console.error && console.error(o, "doesn't exist"),
o = "start", r = this.states[o]), s = this.matchMappings[o], u = g, a = this.regExps[o],
a.lastIndex = g);
break;
}
if (f) if ("string" == typeof h) p && p.merge === !1 || d.type !== h ? (d.type && c.push(d),
d = {
type: h,
value: f
}) : d.value += f; else if (h) {
d.type && c.push(d), d = {
type: null,
value: ""
};
for (var v = 0; v < h.length; v++) c.push(h[v]);
}
if (u == e.length) break;
if (u = g, c.length > n) {
for (;u < e.length; ) d.type && c.push(d), d = {
value: e.substring(u, u += 2e3),
type: "overflow"
};
o = "start", i = [];
break;
}
}
return d.type && c.push(d), {
tokens: c,
state: i.length ? i : o
};
};
}).call(i.prototype), t.Tokenizer = i;
}), define("ace/mode/text_highlight_rules", [ "require", "exports", "module", "../lib/lang" ], function(e, t) {
var n = e("../lib/lang"), i = function() {
this.$rules = {
start: [ {
token: "empty_line",
regex: "^$"
}, {
defaultToken: "text"
} ]
};
};
(function() {
this.addRules = function(e, t) {
if (t) for (var n in e) {
for (var i = e[n], o = 0; o < i.length; o++) {
var r = i[o];
r.next && ("string" != typeof r.next ? r.nextState && 0 !== r.nextState.indexOf(t) && (r.nextState = t + r.nextState) : 0 !== r.next.indexOf(t) && (r.next = t + r.next));
}
this.$rules[t + n] = i;
} else for (var n in e) this.$rules[n] = e[n];
}, this.getRules = function() {
return this.$rules;
}, this.embedRules = function(e, t, i, o, r) {
var s = new e().getRules();
if (o) for (var a = 0; a < o.length; a++) o[a] = t + o[a]; else {
o = [];
for (var l in s) o.push(t + l);
}
if (this.addRules(s, t), i) for (var c = Array.prototype[r ? "push" : "unshift"], a = 0; a < o.length; a++) c.apply(this.$rules[o[a]], n.deepCopy(i));
this.$embeds || (this.$embeds = []), this.$embeds.push(t);
}, this.getEmbeds = function() {
return this.$embeds;
};
var e = function(e, t) {
return "start" != e && t.unshift(this.nextState, e), this.nextState;
}, t = function(e, t) {
return t[0] !== e ? "start" : (t.shift(), t.shift());
};
this.normalizeRules = function() {
function n(r) {
var s = o[r];
s.processed = !0;
for (var a = 0; a < s.length; a++) {
var l = s[a];
!l.regex && l.start && (l.regex = l.start, l.next || (l.next = []), l.next.push({
defaultToken: l.token
}, {
token: l.token + ".end",
regex: l.end || l.start,
next: "pop"
}), l.token = l.token + ".start", l.push = !0);
var c = l.next || l.push;
if (c && Array.isArray(c)) {
var u = l.stateName;
u || (u = l.token, "string" != typeof u && (u = u[0] || ""), o[u] && (u += i++)),
o[u] = c, l.next = u, n(u);
} else "pop" == c && (l.next = t);
if (l.push && (l.nextState = l.next || l.push, l.next = e, delete l.push), l.rules) for (var d in l.rules) o[d] ? o[d].push && o[d].push.apply(o[d], l.rules[d]) : o[d] = l.rules[d];
if (l.include || "string" == typeof l) var h = l.include || l, p = o[h]; else Array.isArray(l) && (p = l);
if (p) {
var f = [ a, 1 ].concat(p);
l.noEscape && (f = f.filter(function(e) {
return !e.next;
})), s.splice.apply(s, f), a--, p = null;
}
l.keywordMap && (l.token = this.createKeywordMapper(l.keywordMap, l.defaultToken || "text", l.caseInsensitive),
delete l.defaultToken);
}
}
var i = 0, o = this.$rules;
Object.keys(o).forEach(n, this);
}, this.createKeywordMapper = function(e, t, n, i) {
var o = Object.create(null);
return Object.keys(e).forEach(function(t) {
var r = e[t];
n && (r = r.toLowerCase());
for (var s = r.split(i || "|"), a = s.length; a--; ) o[s[a]] = t;
}), this.$keywordList = Object.keys(o), e = null, n ? function(e) {
return o[e.toLowerCase()] || t;
} : function(e) {
return o[e] || t;
};
}, this.getKeywords = function() {
return this.$keywords;
};
}).call(i.prototype), t.TextHighlightRules = i;
}), define("ace/mode/behaviour", [ "require", "exports", "module" ], function(e, t) {
var n = function() {
this.$behaviours = {};
};
(function() {
this.add = function(e, t, n) {
switch (void 0) {
case this.$behaviours:
this.$behaviours = {};
case this.$behaviours[e]:
this.$behaviours[e] = {};
}
this.$behaviours[e][t] = n;
}, this.addBehaviours = function(e) {
for (var t in e) for (var n in e[t]) this.add(t, n, e[t][n]);
}, this.remove = function(e) {
this.$behaviours && this.$behaviours[e] && delete this.$behaviours[e];
}, this.inherit = function(e, t) {
if ("function" == typeof e) var n = new e().getBehaviours(t); else var n = e.getBehaviours(t);
this.addBehaviours(n);
}, this.getBehaviours = function(e) {
if (e) {
for (var t = {}, n = 0; n < e.length; n++) this.$behaviours[e[n]] && (t[e[n]] = this.$behaviours[e[n]]);
return t;
}
return this.$behaviours;
};
}).call(n.prototype), t.Behaviour = n;
}), define("ace/unicode", [ "require", "exports", "module" ], function(e, t) {
function n(e) {
var n = /\w{4}/g;
for (var i in e) t.packages[i] = e[i].replace(n, "\\u$&");
}
t.packages = {}, n({
L: "0041-005A0061-007A00AA00B500BA00C0-00D600D8-00F600F8-02C102C6-02D102E0-02E402EC02EE0370-037403760377037A-037D03860388-038A038C038E-03A103A3-03F503F7-0481048A-05250531-055605590561-058705D0-05EA05F0-05F20621-064A066E066F0671-06D306D506E506E606EE06EF06FA-06FC06FF07100712-072F074D-07A507B107CA-07EA07F407F507FA0800-0815081A082408280904-0939093D09500958-0961097109720979-097F0985-098C098F09900993-09A809AA-09B009B209B6-09B909BD09CE09DC09DD09DF-09E109F009F10A05-0A0A0A0F0A100A13-0A280A2A-0A300A320A330A350A360A380A390A59-0A5C0A5E0A72-0A740A85-0A8D0A8F-0A910A93-0AA80AAA-0AB00AB20AB30AB5-0AB90ABD0AD00AE00AE10B05-0B0C0B0F0B100B13-0B280B2A-0B300B320B330B35-0B390B3D0B5C0B5D0B5F-0B610B710B830B85-0B8A0B8E-0B900B92-0B950B990B9A0B9C0B9E0B9F0BA30BA40BA8-0BAA0BAE-0BB90BD00C05-0C0C0C0E-0C100C12-0C280C2A-0C330C35-0C390C3D0C580C590C600C610C85-0C8C0C8E-0C900C92-0CA80CAA-0CB30CB5-0CB90CBD0CDE0CE00CE10D05-0D0C0D0E-0D100D12-0D280D2A-0D390D3D0D600D610D7A-0D7F0D85-0D960D9A-0DB10DB3-0DBB0DBD0DC0-0DC60E01-0E300E320E330E40-0E460E810E820E840E870E880E8A0E8D0E94-0E970E99-0E9F0EA1-0EA30EA50EA70EAA0EAB0EAD-0EB00EB20EB30EBD0EC0-0EC40EC60EDC0EDD0F000F40-0F470F49-0F6C0F88-0F8B1000-102A103F1050-1055105A-105D106110651066106E-10701075-1081108E10A0-10C510D0-10FA10FC1100-1248124A-124D1250-12561258125A-125D1260-1288128A-128D1290-12B012B2-12B512B8-12BE12C012C2-12C512C8-12D612D8-13101312-13151318-135A1380-138F13A0-13F41401-166C166F-167F1681-169A16A0-16EA1700-170C170E-17111720-17311740-17511760-176C176E-17701780-17B317D717DC1820-18771880-18A818AA18B0-18F51900-191C1950-196D1970-19741980-19AB19C1-19C71A00-1A161A20-1A541AA71B05-1B331B45-1B4B1B83-1BA01BAE1BAF1C00-1C231C4D-1C4F1C5A-1C7D1CE9-1CEC1CEE-1CF11D00-1DBF1E00-1F151F18-1F1D1F20-1F451F48-1F4D1F50-1F571F591F5B1F5D1F5F-1F7D1F80-1FB41FB6-1FBC1FBE1FC2-1FC41FC6-1FCC1FD0-1FD31FD6-1FDB1FE0-1FEC1FF2-1FF41FF6-1FFC2071207F2090-209421022107210A-211321152119-211D212421262128212A-212D212F-2139213C-213F2145-2149214E218321842C00-2C2E2C30-2C5E2C60-2CE42CEB-2CEE2D00-2D252D30-2D652D6F2D80-2D962DA0-2DA62DA8-2DAE2DB0-2DB62DB8-2DBE2DC0-2DC62DC8-2DCE2DD0-2DD62DD8-2DDE2E2F300530063031-3035303B303C3041-3096309D-309F30A1-30FA30FC-30FF3105-312D3131-318E31A0-31B731F0-31FF3400-4DB54E00-9FCBA000-A48CA4D0-A4FDA500-A60CA610-A61FA62AA62BA640-A65FA662-A66EA67F-A697A6A0-A6E5A717-A71FA722-A788A78BA78CA7FB-A801A803-A805A807-A80AA80C-A822A840-A873A882-A8B3A8F2-A8F7A8FBA90A-A925A930-A946A960-A97CA984-A9B2A9CFAA00-AA28AA40-AA42AA44-AA4BAA60-AA76AA7AAA80-AAAFAAB1AAB5AAB6AAB9-AABDAAC0AAC2AADB-AADDABC0-ABE2AC00-D7A3D7B0-D7C6D7CB-D7FBF900-FA2DFA30-FA6DFA70-FAD9FB00-FB06FB13-FB17FB1DFB1F-FB28FB2A-FB36FB38-FB3CFB3EFB40FB41FB43FB44FB46-FBB1FBD3-FD3DFD50-FD8FFD92-FDC7FDF0-FDFBFE70-FE74FE76-FEFCFF21-FF3AFF41-FF5AFF66-FFBEFFC2-FFC7FFCA-FFCFFFD2-FFD7FFDA-FFDC",
Ll: "0061-007A00AA00B500BA00DF-00F600F8-00FF01010103010501070109010B010D010F01110113011501170119011B011D011F01210123012501270129012B012D012F01310133013501370138013A013C013E014001420144014601480149014B014D014F01510153015501570159015B015D015F01610163016501670169016B016D016F0171017301750177017A017C017E-0180018301850188018C018D019201950199-019B019E01A101A301A501A801AA01AB01AD01B001B401B601B901BA01BD-01BF01C601C901CC01CE01D001D201D401D601D801DA01DC01DD01DF01E101E301E501E701E901EB01ED01EF01F001F301F501F901FB01FD01FF02010203020502070209020B020D020F02110213021502170219021B021D021F02210223022502270229022B022D022F02310233-0239023C023F0240024202470249024B024D024F-02930295-02AF037103730377037B-037D039003AC-03CE03D003D103D5-03D703D903DB03DD03DF03E103E303E503E703E903EB03ED03EF-03F303F503F803FB03FC0430-045F04610463046504670469046B046D046F04710473047504770479047B047D047F0481048B048D048F04910493049504970499049B049D049F04A104A304A504A704A904AB04AD04AF04B104B304B504B704B904BB04BD04BF04C204C404C604C804CA04CC04CE04CF04D104D304D504D704D904DB04DD04DF04E104E304E504E704E904EB04ED04EF04F104F304F504F704F904FB04FD04FF05010503050505070509050B050D050F05110513051505170519051B051D051F0521052305250561-05871D00-1D2B1D62-1D771D79-1D9A1E011E031E051E071E091E0B1E0D1E0F1E111E131E151E171E191E1B1E1D1E1F1E211E231E251E271E291E2B1E2D1E2F1E311E331E351E371E391E3B1E3D1E3F1E411E431E451E471E491E4B1E4D1E4F1E511E531E551E571E591E5B1E5D1E5F1E611E631E651E671E691E6B1E6D1E6F1E711E731E751E771E791E7B1E7D1E7F1E811E831E851E871E891E8B1E8D1E8F1E911E931E95-1E9D1E9F1EA11EA31EA51EA71EA91EAB1EAD1EAF1EB11EB31EB51EB71EB91EBB1EBD1EBF1EC11EC31EC51EC71EC91ECB1ECD1ECF1ED11ED31ED51ED71ED91EDB1EDD1EDF1EE11EE31EE51EE71EE91EEB1EED1EEF1EF11EF31EF51EF71EF91EFB1EFD1EFF-1F071F10-1F151F20-1F271F30-1F371F40-1F451F50-1F571F60-1F671F70-1F7D1F80-1F871F90-1F971FA0-1FA71FB0-1FB41FB61FB71FBE1FC2-1FC41FC61FC71FD0-1FD31FD61FD71FE0-1FE71FF2-1FF41FF61FF7210A210E210F2113212F21342139213C213D2146-2149214E21842C30-2C5E2C612C652C662C682C6A2C6C2C712C732C742C76-2C7C2C812C832C852C872C892C8B2C8D2C8F2C912C932C952C972C992C9B2C9D2C9F2CA12CA32CA52CA72CA92CAB2CAD2CAF2CB12CB32CB52CB72CB92CBB2CBD2CBF2CC12CC32CC52CC72CC92CCB2CCD2CCF2CD12CD32CD52CD72CD92CDB2CDD2CDF2CE12CE32CE42CEC2CEE2D00-2D25A641A643A645A647A649A64BA64DA64FA651A653A655A657A659A65BA65DA65FA663A665A667A669A66BA66DA681A683A685A687A689A68BA68DA68FA691A693A695A697A723A725A727A729A72BA72DA72F-A731A733A735A737A739A73BA73DA73FA741A743A745A747A749A74BA74DA74FA751A753A755A757A759A75BA75DA75FA761A763A765A767A769A76BA76DA76FA771-A778A77AA77CA77FA781A783A785A787A78CFB00-FB06FB13-FB17FF41-FF5A",
Lu: "0041-005A00C0-00D600D8-00DE01000102010401060108010A010C010E01100112011401160118011A011C011E01200122012401260128012A012C012E01300132013401360139013B013D013F0141014301450147014A014C014E01500152015401560158015A015C015E01600162016401660168016A016C016E017001720174017601780179017B017D018101820184018601870189-018B018E-0191019301940196-0198019C019D019F01A001A201A401A601A701A901AC01AE01AF01B1-01B301B501B701B801BC01C401C701CA01CD01CF01D101D301D501D701D901DB01DE01E001E201E401E601E801EA01EC01EE01F101F401F6-01F801FA01FC01FE02000202020402060208020A020C020E02100212021402160218021A021C021E02200222022402260228022A022C022E02300232023A023B023D023E02410243-02460248024A024C024E03700372037603860388-038A038C038E038F0391-03A103A3-03AB03CF03D2-03D403D803DA03DC03DE03E003E203E403E603E803EA03EC03EE03F403F703F903FA03FD-042F04600462046404660468046A046C046E04700472047404760478047A047C047E0480048A048C048E04900492049404960498049A049C049E04A004A204A404A604A804AA04AC04AE04B004B204B404B604B804BA04BC04BE04C004C104C304C504C704C904CB04CD04D004D204D404D604D804DA04DC04DE04E004E204E404E604E804EA04EC04EE04F004F204F404F604F804FA04FC04FE05000502050405060508050A050C050E05100512051405160518051A051C051E0520052205240531-055610A0-10C51E001E021E041E061E081E0A1E0C1E0E1E101E121E141E161E181E1A1E1C1E1E1E201E221E241E261E281E2A1E2C1E2E1E301E321E341E361E381E3A1E3C1E3E1E401E421E441E461E481E4A1E4C1E4E1E501E521E541E561E581E5A1E5C1E5E1E601E621E641E661E681E6A1E6C1E6E1E701E721E741E761E781E7A1E7C1E7E1E801E821E841E861E881E8A1E8C1E8E1E901E921E941E9E1EA01EA21EA41EA61EA81EAA1EAC1EAE1EB01EB21EB41EB61EB81EBA1EBC1EBE1EC01EC21EC41EC61EC81ECA1ECC1ECE1ED01ED21ED41ED61ED81EDA1EDC1EDE1EE01EE21EE41EE61EE81EEA1EEC1EEE1EF01EF21EF41EF61EF81EFA1EFC1EFE1F08-1F0F1F18-1F1D1F28-1F2F1F38-1F3F1F48-1F4D1F591F5B1F5D1F5F1F68-1F6F1FB8-1FBB1FC8-1FCB1FD8-1FDB1FE8-1FEC1FF8-1FFB21022107210B-210D2110-211221152119-211D212421262128212A-212D2130-2133213E213F214521832C00-2C2E2C602C62-2C642C672C692C6B2C6D-2C702C722C752C7E-2C802C822C842C862C882C8A2C8C2C8E2C902C922C942C962C982C9A2C9C2C9E2CA02CA22CA42CA62CA82CAA2CAC2CAE2CB02CB22CB42CB62CB82CBA2CBC2CBE2CC02CC22CC42CC62CC82CCA2CCC2CCE2CD02CD22CD42CD62CD82CDA2CDC2CDE2CE02CE22CEB2CEDA640A642A644A646A648A64AA64CA64EA650A652A654A656A658A65AA65CA65EA662A664A666A668A66AA66CA680A682A684A686A688A68AA68CA68EA690A692A694A696A722A724A726A728A72AA72CA72EA732A734A736A738A73AA73CA73EA740A742A744A746A748A74AA74CA74EA750A752A754A756A758A75AA75CA75EA760A762A764A766A768A76AA76CA76EA779A77BA77DA77EA780A782A784A786A78BFF21-FF3A",
Lt: "01C501C801CB01F21F88-1F8F1F98-1F9F1FA8-1FAF1FBC1FCC1FFC",
Lm: "02B0-02C102C6-02D102E0-02E402EC02EE0374037A0559064006E506E607F407F507FA081A0824082809710E460EC610FC17D718431AA71C78-1C7D1D2C-1D611D781D9B-1DBF2071207F2090-20942C7D2D6F2E2F30053031-3035303B309D309E30FC-30FEA015A4F8-A4FDA60CA67FA717-A71FA770A788A9CFAA70AADDFF70FF9EFF9F",
Lo: "01BB01C0-01C3029405D0-05EA05F0-05F20621-063F0641-064A066E066F0671-06D306D506EE06EF06FA-06FC06FF07100712-072F074D-07A507B107CA-07EA0800-08150904-0939093D09500958-096109720979-097F0985-098C098F09900993-09A809AA-09B009B209B6-09B909BD09CE09DC09DD09DF-09E109F009F10A05-0A0A0A0F0A100A13-0A280A2A-0A300A320A330A350A360A380A390A59-0A5C0A5E0A72-0A740A85-0A8D0A8F-0A910A93-0AA80AAA-0AB00AB20AB30AB5-0AB90ABD0AD00AE00AE10B05-0B0C0B0F0B100B13-0B280B2A-0B300B320B330B35-0B390B3D0B5C0B5D0B5F-0B610B710B830B85-0B8A0B8E-0B900B92-0B950B990B9A0B9C0B9E0B9F0BA30BA40BA8-0BAA0BAE-0BB90BD00C05-0C0C0C0E-0C100C12-0C280C2A-0C330C35-0C390C3D0C580C590C600C610C85-0C8C0C8E-0C900C92-0CA80CAA-0CB30CB5-0CB90CBD0CDE0CE00CE10D05-0D0C0D0E-0D100D12-0D280D2A-0D390D3D0D600D610D7A-0D7F0D85-0D960D9A-0DB10DB3-0DBB0DBD0DC0-0DC60E01-0E300E320E330E40-0E450E810E820E840E870E880E8A0E8D0E94-0E970E99-0E9F0EA1-0EA30EA50EA70EAA0EAB0EAD-0EB00EB20EB30EBD0EC0-0EC40EDC0EDD0F000F40-0F470F49-0F6C0F88-0F8B1000-102A103F1050-1055105A-105D106110651066106E-10701075-1081108E10D0-10FA1100-1248124A-124D1250-12561258125A-125D1260-1288128A-128D1290-12B012B2-12B512B8-12BE12C012C2-12C512C8-12D612D8-13101312-13151318-135A1380-138F13A0-13F41401-166C166F-167F1681-169A16A0-16EA1700-170C170E-17111720-17311740-17511760-176C176E-17701780-17B317DC1820-18421844-18771880-18A818AA18B0-18F51900-191C1950-196D1970-19741980-19AB19C1-19C71A00-1A161A20-1A541B05-1B331B45-1B4B1B83-1BA01BAE1BAF1C00-1C231C4D-1C4F1C5A-1C771CE9-1CEC1CEE-1CF12135-21382D30-2D652D80-2D962DA0-2DA62DA8-2DAE2DB0-2DB62DB8-2DBE2DC0-2DC62DC8-2DCE2DD0-2DD62DD8-2DDE3006303C3041-3096309F30A1-30FA30FF3105-312D3131-318E31A0-31B731F0-31FF3400-4DB54E00-9FCBA000-A014A016-A48CA4D0-A4F7A500-A60BA610-A61FA62AA62BA66EA6A0-A6E5A7FB-A801A803-A805A807-A80AA80C-A822A840-A873A882-A8B3A8F2-A8F7A8FBA90A-A925A930-A946A960-A97CA984-A9B2AA00-AA28AA40-AA42AA44-AA4BAA60-AA6FAA71-AA76AA7AAA80-AAAFAAB1AAB5AAB6AAB9-AABDAAC0AAC2AADBAADCABC0-ABE2AC00-D7A3D7B0-D7C6D7CB-D7FBF900-FA2DFA30-FA6DFA70-FAD9FB1DFB1F-FB28FB2A-FB36FB38-FB3CFB3EFB40FB41FB43FB44FB46-FBB1FBD3-FD3DFD50-FD8FFD92-FDC7FDF0-FDFBFE70-FE74FE76-FEFCFF66-FF6FFF71-FF9DFFA0-FFBEFFC2-FFC7FFCA-FFCFFFD2-FFD7FFDA-FFDC",
M: "0300-036F0483-04890591-05BD05BF05C105C205C405C505C70610-061A064B-065E067006D6-06DC06DE-06E406E706E806EA-06ED07110730-074A07A6-07B007EB-07F30816-0819081B-08230825-08270829-082D0900-0903093C093E-094E0951-0955096209630981-098309BC09BE-09C409C709C809CB-09CD09D709E209E30A01-0A030A3C0A3E-0A420A470A480A4B-0A4D0A510A700A710A750A81-0A830ABC0ABE-0AC50AC7-0AC90ACB-0ACD0AE20AE30B01-0B030B3C0B3E-0B440B470B480B4B-0B4D0B560B570B620B630B820BBE-0BC20BC6-0BC80BCA-0BCD0BD70C01-0C030C3E-0C440C46-0C480C4A-0C4D0C550C560C620C630C820C830CBC0CBE-0CC40CC6-0CC80CCA-0CCD0CD50CD60CE20CE30D020D030D3E-0D440D46-0D480D4A-0D4D0D570D620D630D820D830DCA0DCF-0DD40DD60DD8-0DDF0DF20DF30E310E34-0E3A0E47-0E4E0EB10EB4-0EB90EBB0EBC0EC8-0ECD0F180F190F350F370F390F3E0F3F0F71-0F840F860F870F90-0F970F99-0FBC0FC6102B-103E1056-1059105E-10601062-10641067-106D1071-10741082-108D108F109A-109D135F1712-17141732-1734175217531772177317B6-17D317DD180B-180D18A91920-192B1930-193B19B0-19C019C819C91A17-1A1B1A55-1A5E1A60-1A7C1A7F1B00-1B041B34-1B441B6B-1B731B80-1B821BA1-1BAA1C24-1C371CD0-1CD21CD4-1CE81CED1CF21DC0-1DE61DFD-1DFF20D0-20F02CEF-2CF12DE0-2DFF302A-302F3099309AA66F-A672A67CA67DA6F0A6F1A802A806A80BA823-A827A880A881A8B4-A8C4A8E0-A8F1A926-A92DA947-A953A980-A983A9B3-A9C0AA29-AA36AA43AA4CAA4DAA7BAAB0AAB2-AAB4AAB7AAB8AABEAABFAAC1ABE3-ABEAABECABEDFB1EFE00-FE0FFE20-FE26",
Mn: "0300-036F0483-04870591-05BD05BF05C105C205C405C505C70610-061A064B-065E067006D6-06DC06DF-06E406E706E806EA-06ED07110730-074A07A6-07B007EB-07F30816-0819081B-08230825-08270829-082D0900-0902093C0941-0948094D0951-095509620963098109BC09C1-09C409CD09E209E30A010A020A3C0A410A420A470A480A4B-0A4D0A510A700A710A750A810A820ABC0AC1-0AC50AC70AC80ACD0AE20AE30B010B3C0B3F0B41-0B440B4D0B560B620B630B820BC00BCD0C3E-0C400C46-0C480C4A-0C4D0C550C560C620C630CBC0CBF0CC60CCC0CCD0CE20CE30D41-0D440D4D0D620D630DCA0DD2-0DD40DD60E310E34-0E3A0E47-0E4E0EB10EB4-0EB90EBB0EBC0EC8-0ECD0F180F190F350F370F390F71-0F7E0F80-0F840F860F870F90-0F970F99-0FBC0FC6102D-10301032-10371039103A103D103E10581059105E-10601071-1074108210851086108D109D135F1712-17141732-1734175217531772177317B7-17BD17C617C9-17D317DD180B-180D18A91920-19221927192819321939-193B1A171A181A561A58-1A5E1A601A621A65-1A6C1A73-1A7C1A7F1B00-1B031B341B36-1B3A1B3C1B421B6B-1B731B801B811BA2-1BA51BA81BA91C2C-1C331C361C371CD0-1CD21CD4-1CE01CE2-1CE81CED1DC0-1DE61DFD-1DFF20D0-20DC20E120E5-20F02CEF-2CF12DE0-2DFF302A-302F3099309AA66FA67CA67DA6F0A6F1A802A806A80BA825A826A8C4A8E0-A8F1A926-A92DA947-A951A980-A982A9B3A9B6-A9B9A9BCAA29-AA2EAA31AA32AA35AA36AA43AA4CAAB0AAB2-AAB4AAB7AAB8AABEAABFAAC1ABE5ABE8ABEDFB1EFE00-FE0FFE20-FE26",
Mc: "0903093E-09400949-094C094E0982098309BE-09C009C709C809CB09CC09D70A030A3E-0A400A830ABE-0AC00AC90ACB0ACC0B020B030B3E0B400B470B480B4B0B4C0B570BBE0BBF0BC10BC20BC6-0BC80BCA-0BCC0BD70C01-0C030C41-0C440C820C830CBE0CC0-0CC40CC70CC80CCA0CCB0CD50CD60D020D030D3E-0D400D46-0D480D4A-0D4C0D570D820D830DCF-0DD10DD8-0DDF0DF20DF30F3E0F3F0F7F102B102C10311038103B103C105610571062-10641067-106D108310841087-108C108F109A-109C17B617BE-17C517C717C81923-19261929-192B193019311933-193819B0-19C019C819C91A19-1A1B1A551A571A611A631A641A6D-1A721B041B351B3B1B3D-1B411B431B441B821BA11BA61BA71BAA1C24-1C2B1C341C351CE11CF2A823A824A827A880A881A8B4-A8C3A952A953A983A9B4A9B5A9BAA9BBA9BD-A9C0AA2FAA30AA33AA34AA4DAA7BABE3ABE4ABE6ABE7ABE9ABEAABEC",
Me: "0488048906DE20DD-20E020E2-20E4A670-A672",
N: "0030-003900B200B300B900BC-00BE0660-066906F0-06F907C0-07C90966-096F09E6-09EF09F4-09F90A66-0A6F0AE6-0AEF0B66-0B6F0BE6-0BF20C66-0C6F0C78-0C7E0CE6-0CEF0D66-0D750E50-0E590ED0-0ED90F20-0F331040-10491090-10991369-137C16EE-16F017E0-17E917F0-17F91810-18191946-194F19D0-19DA1A80-1A891A90-1A991B50-1B591BB0-1BB91C40-1C491C50-1C5920702074-20792080-20892150-21822185-21892460-249B24EA-24FF2776-27932CFD30073021-30293038-303A3192-31953220-32293251-325F3280-328932B1-32BFA620-A629A6E6-A6EFA830-A835A8D0-A8D9A900-A909A9D0-A9D9AA50-AA59ABF0-ABF9FF10-FF19",
Nd: "0030-00390660-066906F0-06F907C0-07C90966-096F09E6-09EF0A66-0A6F0AE6-0AEF0B66-0B6F0BE6-0BEF0C66-0C6F0CE6-0CEF0D66-0D6F0E50-0E590ED0-0ED90F20-0F291040-10491090-109917E0-17E91810-18191946-194F19D0-19DA1A80-1A891A90-1A991B50-1B591BB0-1BB91C40-1C491C50-1C59A620-A629A8D0-A8D9A900-A909A9D0-A9D9AA50-AA59ABF0-ABF9FF10-FF19",
Nl: "16EE-16F02160-21822185-218830073021-30293038-303AA6E6-A6EF",
No: "00B200B300B900BC-00BE09F4-09F90BF0-0BF20C78-0C7E0D70-0D750F2A-0F331369-137C17F0-17F920702074-20792080-20892150-215F21892460-249B24EA-24FF2776-27932CFD3192-31953220-32293251-325F3280-328932B1-32BFA830-A835",
P: "0021-00230025-002A002C-002F003A003B003F0040005B-005D005F007B007D00A100AB00B700BB00BF037E0387055A-055F0589058A05BE05C005C305C605F305F40609060A060C060D061B061E061F066A-066D06D40700-070D07F7-07F90830-083E0964096509700DF40E4F0E5A0E5B0F04-0F120F3A-0F3D0F850FD0-0FD4104A-104F10FB1361-13681400166D166E169B169C16EB-16ED1735173617D4-17D617D8-17DA1800-180A1944194519DE19DF1A1E1A1F1AA0-1AA61AA8-1AAD1B5A-1B601C3B-1C3F1C7E1C7F1CD32010-20272030-20432045-20512053-205E207D207E208D208E2329232A2768-277527C527C627E6-27EF2983-299829D8-29DB29FC29FD2CF9-2CFC2CFE2CFF2E00-2E2E2E302E313001-30033008-30113014-301F3030303D30A030FBA4FEA4FFA60D-A60FA673A67EA6F2-A6F7A874-A877A8CEA8CFA8F8-A8FAA92EA92FA95FA9C1-A9CDA9DEA9DFAA5C-AA5FAADEAADFABEBFD3EFD3FFE10-FE19FE30-FE52FE54-FE61FE63FE68FE6AFE6BFF01-FF03FF05-FF0AFF0C-FF0FFF1AFF1BFF1FFF20FF3B-FF3DFF3FFF5BFF5DFF5F-FF65",
Pd: "002D058A05BE140018062010-20152E172E1A301C303030A0FE31FE32FE58FE63FF0D",
Ps: "0028005B007B0F3A0F3C169B201A201E2045207D208D23292768276A276C276E27702772277427C527E627E827EA27EC27EE2983298529872989298B298D298F299129932995299729D829DA29FC2E222E242E262E283008300A300C300E3010301430163018301A301DFD3EFE17FE35FE37FE39FE3BFE3DFE3FFE41FE43FE47FE59FE5BFE5DFF08FF3BFF5BFF5FFF62",
Pe: "0029005D007D0F3B0F3D169C2046207E208E232A2769276B276D276F27712773277527C627E727E927EB27ED27EF298429862988298A298C298E2990299229942996299829D929DB29FD2E232E252E272E293009300B300D300F3011301530173019301B301E301FFD3FFE18FE36FE38FE3AFE3CFE3EFE40FE42FE44FE48FE5AFE5CFE5EFF09FF3DFF5DFF60FF63",
Pi: "00AB2018201B201C201F20392E022E042E092E0C2E1C2E20",
Pf: "00BB2019201D203A2E032E052E0A2E0D2E1D2E21",
Pc: "005F203F20402054FE33FE34FE4D-FE4FFF3F",
Po: "0021-00230025-0027002A002C002E002F003A003B003F0040005C00A100B700BF037E0387055A-055F058905C005C305C605F305F40609060A060C060D061B061E061F066A-066D06D40700-070D07F7-07F90830-083E0964096509700DF40E4F0E5A0E5B0F04-0F120F850FD0-0FD4104A-104F10FB1361-1368166D166E16EB-16ED1735173617D4-17D617D8-17DA1800-18051807-180A1944194519DE19DF1A1E1A1F1AA0-1AA61AA8-1AAD1B5A-1B601C3B-1C3F1C7E1C7F1CD3201620172020-20272030-2038203B-203E2041-20432047-205120532055-205E2CF9-2CFC2CFE2CFF2E002E012E06-2E082E0B2E0E-2E162E182E192E1B2E1E2E1F2E2A-2E2E2E302E313001-3003303D30FBA4FEA4FFA60D-A60FA673A67EA6F2-A6F7A874-A877A8CEA8CFA8F8-A8FAA92EA92FA95FA9C1-A9CDA9DEA9DFAA5C-AA5FAADEAADFABEBFE10-FE16FE19FE30FE45FE46FE49-FE4CFE50-FE52FE54-FE57FE5F-FE61FE68FE6AFE6BFF01-FF03FF05-FF07FF0AFF0CFF0EFF0FFF1AFF1BFF1FFF20FF3CFF61FF64FF65",
S: "0024002B003C-003E005E0060007C007E00A2-00A900AC00AE-00B100B400B600B800D700F702C2-02C502D2-02DF02E5-02EB02ED02EF-02FF03750384038503F604820606-0608060B060E060F06E906FD06FE07F609F209F309FA09FB0AF10B700BF3-0BFA0C7F0CF10CF20D790E3F0F01-0F030F13-0F170F1A-0F1F0F340F360F380FBE-0FC50FC7-0FCC0FCE0FCF0FD5-0FD8109E109F13601390-139917DB194019E0-19FF1B61-1B6A1B74-1B7C1FBD1FBF-1FC11FCD-1FCF1FDD-1FDF1FED-1FEF1FFD1FFE20442052207A-207C208A-208C20A0-20B8210021012103-21062108210921142116-2118211E-2123212521272129212E213A213B2140-2144214A-214D214F2190-2328232B-23E82400-24262440-244A249C-24E92500-26CD26CF-26E126E326E8-26FF2701-27042706-2709270C-27272729-274B274D274F-27522756-275E2761-276727942798-27AF27B1-27BE27C0-27C427C7-27CA27CC27D0-27E527F0-29822999-29D729DC-29FB29FE-2B4C2B50-2B592CE5-2CEA2E80-2E992E9B-2EF32F00-2FD52FF0-2FFB300430123013302030363037303E303F309B309C319031913196-319F31C0-31E33200-321E322A-32503260-327F328A-32B032C0-32FE3300-33FF4DC0-4DFFA490-A4C6A700-A716A720A721A789A78AA828-A82BA836-A839AA77-AA79FB29FDFCFDFDFE62FE64-FE66FE69FF04FF0BFF1C-FF1EFF3EFF40FF5CFF5EFFE0-FFE6FFE8-FFEEFFFCFFFD",
Sm: "002B003C-003E007C007E00AC00B100D700F703F60606-060820442052207A-207C208A-208C2140-2144214B2190-2194219A219B21A021A321A621AE21CE21CF21D221D421F4-22FF2308-230B23202321237C239B-23B323DC-23E125B725C125F8-25FF266F27C0-27C427C7-27CA27CC27D0-27E527F0-27FF2900-29822999-29D729DC-29FB29FE-2AFF2B30-2B442B47-2B4CFB29FE62FE64-FE66FF0BFF1C-FF1EFF5CFF5EFFE2FFE9-FFEC",
Sc: "002400A2-00A5060B09F209F309FB0AF10BF90E3F17DB20A0-20B8A838FDFCFE69FF04FFE0FFE1FFE5FFE6",
Sk: "005E006000A800AF00B400B802C2-02C502D2-02DF02E5-02EB02ED02EF-02FF0375038403851FBD1FBF-1FC11FCD-1FCF1FDD-1FDF1FED-1FEF1FFD1FFE309B309CA700-A716A720A721A789A78AFF3EFF40FFE3",
So: "00A600A700A900AE00B000B60482060E060F06E906FD06FE07F609FA0B700BF3-0BF80BFA0C7F0CF10CF20D790F01-0F030F13-0F170F1A-0F1F0F340F360F380FBE-0FC50FC7-0FCC0FCE0FCF0FD5-0FD8109E109F13601390-1399194019E0-19FF1B61-1B6A1B74-1B7C210021012103-21062108210921142116-2118211E-2123212521272129212E213A213B214A214C214D214F2195-2199219C-219F21A121A221A421A521A7-21AD21AF-21CD21D021D121D321D5-21F32300-2307230C-231F2322-2328232B-237B237D-239A23B4-23DB23E2-23E82400-24262440-244A249C-24E92500-25B625B8-25C025C2-25F72600-266E2670-26CD26CF-26E126E326E8-26FF2701-27042706-2709270C-27272729-274B274D274F-27522756-275E2761-276727942798-27AF27B1-27BE2800-28FF2B00-2B2F2B452B462B50-2B592CE5-2CEA2E80-2E992E9B-2EF32F00-2FD52FF0-2FFB300430123013302030363037303E303F319031913196-319F31C0-31E33200-321E322A-32503260-327F328A-32B032C0-32FE3300-33FF4DC0-4DFFA490-A4C6A828-A82BA836A837A839AA77-AA79FDFDFFE4FFE8FFEDFFEEFFFCFFFD",
Z: "002000A01680180E2000-200A20282029202F205F3000",
Zs: "002000A01680180E2000-200A202F205F3000",
Zl: "2028",
Zp: "2029",
C: "0000-001F007F-009F00AD03780379037F-0383038B038D03A20526-05300557055805600588058B-059005C8-05CF05EB-05EF05F5-0605061C061D0620065F06DD070E070F074B074C07B2-07BF07FB-07FF082E082F083F-08FF093A093B094F095609570973-097809800984098D098E0991099209A909B109B3-09B509BA09BB09C509C609C909CA09CF-09D609D8-09DB09DE09E409E509FC-0A000A040A0B-0A0E0A110A120A290A310A340A370A3A0A3B0A3D0A43-0A460A490A4A0A4E-0A500A52-0A580A5D0A5F-0A650A76-0A800A840A8E0A920AA90AB10AB40ABA0ABB0AC60ACA0ACE0ACF0AD1-0ADF0AE40AE50AF00AF2-0B000B040B0D0B0E0B110B120B290B310B340B3A0B3B0B450B460B490B4A0B4E-0B550B58-0B5B0B5E0B640B650B72-0B810B840B8B-0B8D0B910B96-0B980B9B0B9D0BA0-0BA20BA5-0BA70BAB-0BAD0BBA-0BBD0BC3-0BC50BC90BCE0BCF0BD1-0BD60BD8-0BE50BFB-0C000C040C0D0C110C290C340C3A-0C3C0C450C490C4E-0C540C570C5A-0C5F0C640C650C70-0C770C800C810C840C8D0C910CA90CB40CBA0CBB0CC50CC90CCE-0CD40CD7-0CDD0CDF0CE40CE50CF00CF3-0D010D040D0D0D110D290D3A-0D3C0D450D490D4E-0D560D58-0D5F0D640D650D76-0D780D800D810D840D97-0D990DB20DBC0DBE0DBF0DC7-0DC90DCB-0DCE0DD50DD70DE0-0DF10DF5-0E000E3B-0E3E0E5C-0E800E830E850E860E890E8B0E8C0E8E-0E930E980EA00EA40EA60EA80EA90EAC0EBA0EBE0EBF0EC50EC70ECE0ECF0EDA0EDB0EDE-0EFF0F480F6D-0F700F8C-0F8F0F980FBD0FCD0FD9-0FFF10C6-10CF10FD-10FF1249124E124F12571259125E125F1289128E128F12B112B612B712BF12C112C612C712D7131113161317135B-135E137D-137F139A-139F13F5-13FF169D-169F16F1-16FF170D1715-171F1737-173F1754-175F176D17711774-177F17B417B517DE17DF17EA-17EF17FA-17FF180F181A-181F1878-187F18AB-18AF18F6-18FF191D-191F192C-192F193C-193F1941-1943196E196F1975-197F19AC-19AF19CA-19CF19DB-19DD1A1C1A1D1A5F1A7D1A7E1A8A-1A8F1A9A-1A9F1AAE-1AFF1B4C-1B4F1B7D-1B7F1BAB-1BAD1BBA-1BFF1C38-1C3A1C4A-1C4C1C80-1CCF1CF3-1CFF1DE7-1DFC1F161F171F1E1F1F1F461F471F4E1F4F1F581F5A1F5C1F5E1F7E1F7F1FB51FC51FD41FD51FDC1FF01FF11FF51FFF200B-200F202A-202E2060-206F20722073208F2095-209F20B9-20CF20F1-20FF218A-218F23E9-23FF2427-243F244B-245F26CE26E226E4-26E727002705270A270B2728274C274E2753-2755275F27602795-279727B027BF27CB27CD-27CF2B4D-2B4F2B5A-2BFF2C2F2C5F2CF2-2CF82D26-2D2F2D66-2D6E2D70-2D7F2D97-2D9F2DA72DAF2DB72DBF2DC72DCF2DD72DDF2E32-2E7F2E9A2EF4-2EFF2FD6-2FEF2FFC-2FFF3040309730983100-3104312E-3130318F31B8-31BF31E4-31EF321F32FF4DB6-4DBF9FCC-9FFFA48D-A48FA4C7-A4CFA62C-A63FA660A661A674-A67BA698-A69FA6F8-A6FFA78D-A7FAA82C-A82FA83A-A83FA878-A87FA8C5-A8CDA8DA-A8DFA8FC-A8FFA954-A95EA97D-A97FA9CEA9DA-A9DDA9E0-A9FFAA37-AA3FAA4EAA4FAA5AAA5BAA7C-AA7FAAC3-AADAAAE0-ABBFABEEABEFABFA-ABFFD7A4-D7AFD7C7-D7CAD7FC-F8FFFA2EFA2FFA6EFA6FFADA-FAFFFB07-FB12FB18-FB1CFB37FB3DFB3FFB42FB45FBB2-FBD2FD40-FD4FFD90FD91FDC8-FDEFFDFEFDFFFE1A-FE1FFE27-FE2FFE53FE67FE6C-FE6FFE75FEFD-FF00FFBF-FFC1FFC8FFC9FFD0FFD1FFD8FFD9FFDD-FFDFFFE7FFEF-FFFBFFFEFFFF",
Cc: "0000-001F007F-009F",
Cf: "00AD0600-060306DD070F17B417B5200B-200F202A-202E2060-2064206A-206FFEFFFFF9-FFFB",
Co: "E000-F8FF",
Cs: "D800-DFFF",
Cn: "03780379037F-0383038B038D03A20526-05300557055805600588058B-059005C8-05CF05EB-05EF05F5-05FF06040605061C061D0620065F070E074B074C07B2-07BF07FB-07FF082E082F083F-08FF093A093B094F095609570973-097809800984098D098E0991099209A909B109B3-09B509BA09BB09C509C609C909CA09CF-09D609D8-09DB09DE09E409E509FC-0A000A040A0B-0A0E0A110A120A290A310A340A370A3A0A3B0A3D0A43-0A460A490A4A0A4E-0A500A52-0A580A5D0A5F-0A650A76-0A800A840A8E0A920AA90AB10AB40ABA0ABB0AC60ACA0ACE0ACF0AD1-0ADF0AE40AE50AF00AF2-0B000B040B0D0B0E0B110B120B290B310B340B3A0B3B0B450B460B490B4A0B4E-0B550B58-0B5B0B5E0B640B650B72-0B810B840B8B-0B8D0B910B96-0B980B9B0B9D0BA0-0BA20BA5-0BA70BAB-0BAD0BBA-0BBD0BC3-0BC50BC90BCE0BCF0BD1-0BD60BD8-0BE50BFB-0C000C040C0D0C110C290C340C3A-0C3C0C450C490C4E-0C540C570C5A-0C5F0C640C650C70-0C770C800C810C840C8D0C910CA90CB40CBA0CBB0CC50CC90CCE-0CD40CD7-0CDD0CDF0CE40CE50CF00CF3-0D010D040D0D0D110D290D3A-0D3C0D450D490D4E-0D560D58-0D5F0D640D650D76-0D780D800D810D840D97-0D990DB20DBC0DBE0DBF0DC7-0DC90DCB-0DCE0DD50DD70DE0-0DF10DF5-0E000E3B-0E3E0E5C-0E800E830E850E860E890E8B0E8C0E8E-0E930E980EA00EA40EA60EA80EA90EAC0EBA0EBE0EBF0EC50EC70ECE0ECF0EDA0EDB0EDE-0EFF0F480F6D-0F700F8C-0F8F0F980FBD0FCD0FD9-0FFF10C6-10CF10FD-10FF1249124E124F12571259125E125F1289128E128F12B112B612B712BF12C112C612C712D7131113161317135B-135E137D-137F139A-139F13F5-13FF169D-169F16F1-16FF170D1715-171F1737-173F1754-175F176D17711774-177F17DE17DF17EA-17EF17FA-17FF180F181A-181F1878-187F18AB-18AF18F6-18FF191D-191F192C-192F193C-193F1941-1943196E196F1975-197F19AC-19AF19CA-19CF19DB-19DD1A1C1A1D1A5F1A7D1A7E1A8A-1A8F1A9A-1A9F1AAE-1AFF1B4C-1B4F1B7D-1B7F1BAB-1BAD1BBA-1BFF1C38-1C3A1C4A-1C4C1C80-1CCF1CF3-1CFF1DE7-1DFC1F161F171F1E1F1F1F461F471F4E1F4F1F581F5A1F5C1F5E1F7E1F7F1FB51FC51FD41FD51FDC1FF01FF11FF51FFF2065-206920722073208F2095-209F20B9-20CF20F1-20FF218A-218F23E9-23FF2427-243F244B-245F26CE26E226E4-26E727002705270A270B2728274C274E2753-2755275F27602795-279727B027BF27CB27CD-27CF2B4D-2B4F2B5A-2BFF2C2F2C5F2CF2-2CF82D26-2D2F2D66-2D6E2D70-2D7F2D97-2D9F2DA72DAF2DB72DBF2DC72DCF2DD72DDF2E32-2E7F2E9A2EF4-2EFF2FD6-2FEF2FFC-2FFF3040309730983100-3104312E-3130318F31B8-31BF31E4-31EF321F32FF4DB6-4DBF9FCC-9FFFA48D-A48FA4C7-A4CFA62C-A63FA660A661A674-A67BA698-A69FA6F8-A6FFA78D-A7FAA82C-A82FA83A-A83FA878-A87FA8C5-A8CDA8DA-A8DFA8FC-A8FFA954-A95EA97D-A97FA9CEA9DA-A9DDA9E0-A9FFAA37-AA3FAA4EAA4FAA5AAA5BAA7C-AA7FAAC3-AADAAAE0-ABBFABEEABEFABFA-ABFFD7A4-D7AFD7C7-D7CAD7FC-D7FFFA2EFA2FFA6EFA6FFADA-FAFFFB07-FB12FB18-FB1CFB37FB3DFB3FFB42FB45FBB2-FBD2FD40-FD4FFD90FD91FDC8-FDEFFDFEFDFFFE1A-FE1FFE27-FE2FFE53FE67FE6C-FE6FFE75FEFDFEFEFF00FFBF-FFC1FFC8FFC9FFD0FFD1FFD8FFD9FFDD-FFDFFFE7FFEF-FFF8FFFEFFFF"
});
}), define("ace/token_iterator", [ "require", "exports", "module" ], function(e, t) {
var n = function(e, t, n) {
this.$session = e, this.$row = t, this.$rowTokens = e.getTokens(t);
var i = e.getTokenAt(t, n);
this.$tokenIndex = i ? i.index : -1;
};
(function() {
this.stepBackward = function() {
for (this.$tokenIndex -= 1; this.$tokenIndex < 0; ) {
if (this.$row -= 1, this.$row < 0) return this.$row = 0, null;
this.$rowTokens = this.$session.getTokens(this.$row), this.$tokenIndex = this.$rowTokens.length - 1;
}
return this.$rowTokens[this.$tokenIndex];
}, this.stepForward = function() {
this.$tokenIndex += 1;
for (var e; this.$tokenIndex >= this.$rowTokens.length; ) {
if (this.$row += 1, e || (e = this.$session.getLength()), this.$row >= e) return this.$row = e - 1,
null;
this.$rowTokens = this.$session.getTokens(this.$row), this.$tokenIndex = 0;
}
return this.$rowTokens[this.$tokenIndex];
}, this.getCurrentToken = function() {
return this.$rowTokens[this.$tokenIndex];
}, this.getCurrentTokenRow = function() {
return this.$row;
}, this.getCurrentTokenColumn = function() {
var e = this.$rowTokens, t = this.$tokenIndex, n = e[t].start;
if (void 0 !== n) return n;
for (n = 0; t > 0; ) t -= 1, n += e[t].value.length;
return n;
};
}).call(n.prototype), t.TokenIterator = n;
}), define("ace/mode/text", [ "require", "exports", "module", "../tokenizer", "./text_highlight_rules", "./behaviour", "../unicode", "../lib/lang", "../token_iterator", "../range" ], function(e, t) {
var n = e("../tokenizer").Tokenizer, i = e("./text_highlight_rules").TextHighlightRules, o = e("./behaviour").Behaviour, r = e("../unicode"), s = e("../lib/lang"), a = e("../token_iterator").TokenIterator, l = e("../range").Range, c = function() {
this.$tokenizer = new n(new i().getRules()), this.$behaviour = new o();
};
(function() {
this.tokenRe = new RegExp("^[" + r.packages.L + r.packages.Mn + r.packages.Mc + r.packages.Nd + r.packages.Pc + "\\$_]+", "g"),
this.nonTokenRe = new RegExp("^(?:[^" + r.packages.L + r.packages.Mn + r.packages.Mc + r.packages.Nd + r.packages.Pc + "\\$_]|s])+", "g"),
this.getTokenizer = function() {
return this.$tokenizer;
}, this.lineCommentStart = "", this.blockComment = "", this.toggleCommentLines = function(e, t, n, i) {
function o(e) {
for (var t = n; i >= t; t++) e(r.getLine(t), t);
}
var r = t.doc, a = !0, l = !0, c = 1/0, u = t.getTabSize(), d = !1;
if (this.lineCommentStart) {
if (Array.isArray(this.lineCommentStart)) var h = this.lineCommentStart.map(s.escapeRegExp).join("|"), p = this.lineCommentStart[0]; else var h = s.escapeRegExp(this.lineCommentStart), p = this.lineCommentStart;
h = new RegExp("^(\\s*)(?:" + h + ") ?"), d = t.getUseSoftTabs();
var f = function(e, t) {
var n = e.match(h);
if (n) {
var i = n[1].length, o = n[0].length;
b(e, i, o) || " " != n[0][o - 1] || o--, r.removeInLine(t, i, o);
}
}, g = p + " ", m = function(e, t) {
(!a || /\S/.test(e)) && (b(e, c, c) ? r.insertInLine({
row: t,
column: c
}, g) : r.insertInLine({
row: t,
column: c
}, p));
}, v = function(e) {
return h.test(e);
}, b = function(e, t, n) {
for (var i = 0; t-- && " " == e.charAt(t); ) i++;
if (0 != i % u) return !1;
for (var i = 0; " " == e.charAt(n++); ) i++;
return u > 2 ? i % u != u - 1 : 0 == i % u;
};
} else {
if (!this.blockComment) return !1;
var p = this.blockComment.start, y = this.blockComment.end, h = new RegExp("^(\\s*)(?:" + s.escapeRegExp(p) + ")"), w = new RegExp("(?:" + s.escapeRegExp(y) + ")\\s*$"), m = function(e, t) {
v(e, t) || (!a || /\S/.test(e)) && (r.insertInLine({
row: t,
column: e.length
}, y), r.insertInLine({
row: t,
column: c
}, p));
}, f = function(e, t) {
var n;
(n = e.match(w)) && r.removeInLine(t, e.length - n[0].length, e.length), (n = e.match(h)) && r.removeInLine(t, n[1].length, n[0].length);
}, v = function(e, n) {
if (h.test(e)) return !0;
for (var i = t.getTokens(n), o = 0; o < i.length; o++) if ("comment" === i[o].type) return !0;
};
}
var C = 1/0;
o(function(e, t) {
var n = e.search(/\S/);
-1 !== n ? (c > n && (c = n), l && !v(e, t) && (l = !1)) : C > e.length && (C = e.length);
}), 1/0 == c && (c = C, a = !1, l = !1), d && 0 != c % u && (c = Math.floor(c / u) * u),
o(l ? f : m);
}, this.toggleBlockComment = function(e, t, n, i) {
var o = this.blockComment;
if (o) {
!o.start && o[0] && (o = o[0]);
var r = new a(t, i.row, i.column), s = r.getCurrentToken();
t.selection;
var c, u, d = t.selection.toOrientedRange();
if (s && /comment/.test(s.type)) {
for (var h, p; s && /comment/.test(s.type); ) {
var f = s.value.indexOf(o.start);
if (-1 != f) {
var g = r.getCurrentTokenRow(), m = r.getCurrentTokenColumn() + f;
h = new l(g, m, g, m + o.start.length);
break;
}
s = r.stepBackward();
}
for (var r = new a(t, i.row, i.column), s = r.getCurrentToken(); s && /comment/.test(s.type); ) {
var f = s.value.indexOf(o.end);
if (-1 != f) {
var g = r.getCurrentTokenRow(), m = r.getCurrentTokenColumn() + f;
p = new l(g, m, g, m + o.end.length);
break;
}
s = r.stepForward();
}
p && t.remove(p), h && (t.remove(h), c = h.start.row, u = -o.start.length);
} else u = o.start.length, c = n.start.row, t.insert(n.end, o.end), t.insert(n.start, o.start);
d.start.row == c && (d.start.column += u), d.end.row == c && (d.end.column += u),
t.selection.fromOrientedRange(d);
}
}, this.getNextLineIndent = function(e, t) {
return this.$getIndent(t);
}, this.checkOutdent = function() {
return !1;
}, this.autoOutdent = function() {}, this.$getIndent = function(e) {
return e.match(/^\s*/)[0];
}, this.createWorker = function() {
return null;
}, this.createModeDelegates = function(e) {
if (this.$embeds) {
this.$modes = {};
for (var t = 0; t < this.$embeds.length; t++) e[this.$embeds[t]] && (this.$modes[this.$embeds[t]] = new e[this.$embeds[t]]());
for (var n = [ "toggleCommentLines", "getNextLineIndent", "checkOutdent", "autoOutdent", "transformAction", "getCompletions" ], t = 0; t < n.length; t++) (function(e) {
var i = n[t], o = e[i];
e[n[t]] = function() {
return this.$delegator(i, arguments, o);
};
})(this);
}
}, this.$delegator = function(e, t, n) {
var i = t[0];
"string" != typeof i && (i = i[0]);
for (var o = 0; o < this.$embeds.length; o++) if (this.$modes[this.$embeds[o]]) {
var r = i.split(this.$embeds[o]);
if (!r[0] && r[1]) {
t[0] = r[1];
var s = this.$modes[this.$embeds[o]];
return s[e].apply(s, t);
}
}
var a = n.apply(this, t);
return n ? a : void 0;
}, this.transformAction = function(e, t) {
if (this.$behaviour) {
var n = this.$behaviour.getBehaviours();
for (var i in n) if (n[i][t]) {
var o = n[i][t].apply(this, arguments);
if (o) return o;
}
}
}, this.getKeywords = function(e) {
if (!this.completionKeywords) {
var t = this.$tokenizer.rules, n = [];
for (var i in t) for (var o = t[i], r = 0, s = o.length; s > r; r++) if ("string" == typeof o[r].token) /keyword|support|storage/.test(o[r].token) && n.push(o[r].regex); else if ("object" == typeof o[r].token) for (var a = 0, l = o[r].token.length; l > a; a++) if (/keyword|support|storage/.test(o[r].token[a])) {
var i = o[r].regex.match(/\(.+?\)/g)[a];
n.push(i.substr(1, i.length - 2));
}
this.completionKeywords = n;
}
return e ? n.concat(this.$keywordList || []) : this.$keywordList;
}, this.getCompletions = function() {
var e = this.$keywordList || [];
return e.map(function(e) {
return {
name: e,
value: e,
score: 0,
meta: "keyword"
};
});
};
}).call(c.prototype), t.Mode = c;
}), define("ace/anchor", [ "require", "exports", "module", "./lib/oop", "./lib/event_emitter" ], function(e, t) {
var n = e("./lib/oop"), i = e("./lib/event_emitter").EventEmitter, o = t.Anchor = function(e, t, n) {
this.$onChange = this.onChange.bind(this), this.attach(e), "undefined" == typeof n ? this.setPosition(t.row, t.column) : this.setPosition(t, n);
};
(function() {
n.implement(this, i), this.getPosition = function() {
return this.$clipPositionToDocument(this.row, this.column);
}, this.getDocument = function() {
return this.document;
}, this.$insertRight = !1, this.onChange = function(e) {
var t = e.data, n = t.range;
if (!(n.start.row == n.end.row && n.start.row != this.row || n.start.row > this.row || n.start.row == this.row && n.start.column > this.column)) {
var i = this.row, o = this.column, r = n.start, s = n.end;
"insertText" === t.action ? r.row === i && r.column <= o ? r.column === o && this.$insertRight || (r.row === s.row ? o += s.column - r.column : (o -= r.column,
i += s.row - r.row)) : r.row !== s.row && r.row < i && (i += s.row - r.row) : "insertLines" === t.action ? r.row <= i && (i += s.row - r.row) : "removeText" === t.action ? r.row === i && r.column < o ? o = s.column >= o ? r.column : Math.max(0, o - (s.column - r.column)) : r.row !== s.row && r.row < i ? (s.row === i && (o = Math.max(0, o - s.column) + r.column),
i -= s.row - r.row) : s.row === i && (i -= s.row - r.row, o = Math.max(0, o - s.column) + r.column) : "removeLines" == t.action && r.row <= i && (s.row <= i ? i -= s.row - r.row : (i = r.row,
o = 0)), this.setPosition(i, o, !0);
}
}, this.setPosition = function(e, t, n) {
var i;
if (i = n ? {
row: e,
column: t
} : this.$clipPositionToDocument(e, t), this.row != i.row || this.column != i.column) {
var o = {
row: this.row,
column: this.column
};
this.row = i.row, this.column = i.column, this._emit("change", {
old: o,
value: i
});
}
}, this.detach = function() {
this.document.removeEventListener("change", this.$onChange);
}, this.attach = function(e) {
this.document = e || this.document, this.document.on("change", this.$onChange);
}, this.$clipPositionToDocument = function(e, t) {
var n = {};
return e >= this.document.getLength() ? (n.row = Math.max(0, this.document.getLength() - 1),
n.column = this.document.getLine(n.row).length) : 0 > e ? (n.row = 0, n.column = 0) : (n.row = e,
n.column = Math.min(this.document.getLine(n.row).length, Math.max(0, t))), 0 > t && (n.column = 0),
n;
};
}).call(o.prototype);
}), define("ace/document", [ "require", "exports", "module", "./lib/oop", "./lib/event_emitter", "./range", "./anchor" ], function(e, t) {
var n = e("./lib/oop"), i = e("./lib/event_emitter").EventEmitter, o = e("./range").Range, r = e("./anchor").Anchor, s = function(e) {
this.$lines = [], 0 == e.length ? this.$lines = [ "" ] : Array.isArray(e) ? this._insertLines(0, e) : this.insert({
row: 0,
column: 0
}, e);
};
(function() {
n.implement(this, i), this.setValue = function(e) {
var t = this.getLength();
this.remove(new o(0, 0, t, this.getLine(t - 1).length)), this.insert({
row: 0,
column: 0
}, e);
}, this.getValue = function() {
return this.getAllLines().join(this.getNewLineCharacter());
}, this.createAnchor = function(e, t) {
return new r(this, e, t);
}, this.$split = 0 == "aaa".split(/a/).length ? function(e) {
return e.replace(/\r\n|\r/g, "\n").split("\n");
} : function(e) {
return e.split(/\r\n|\r|\n/);
}, this.$detectNewLine = function(e) {
var t = e.match(/^.*?(\r\n|\r|\n)/m);
this.$autoNewLine = t ? t[1] : "\n";
}, this.getNewLineCharacter = function() {
switch (this.$newLineMode) {
case "windows":
return "\r\n";
case "unix":
return "\n";
default:
return this.$autoNewLine;
}
}, this.$autoNewLine = "\n", this.$newLineMode = "auto", this.setNewLineMode = function(e) {
this.$newLineMode !== e && (this.$newLineMode = e);
}, this.getNewLineMode = function() {
return this.$newLineMode;
}, this.isNewLine = function(e) {
return "\r\n" == e || "\r" == e || "\n" == e;
}, this.getLine = function(e) {
return this.$lines[e] || "";
}, this.getLines = function(e, t) {
return this.$lines.slice(e, t + 1);
}, this.getAllLines = function() {
return this.getLines(0, this.getLength());
}, this.getLength = function() {
return this.$lines.length;
}, this.getTextRange = function(e) {
if (e.start.row == e.end.row) return this.getLine(e.start.row).substring(e.start.column, e.end.column);
var t = this.getLines(e.start.row, e.end.row);
t[0] = (t[0] || "").substring(e.start.column);
var n = t.length - 1;
return e.end.row - e.start.row == n && (t[n] = t[n].substring(0, e.end.column)),
t.join(this.getNewLineCharacter());
}, this.$clipPosition = function(e) {
var t = this.getLength();
return e.row >= t ? (e.row = Math.max(0, t - 1), e.column = this.getLine(t - 1).length) : e.row < 0 && (e.row = 0),
e;
}, this.insert = function(e, t) {
if (!t || 0 === t.length) return e;
e = this.$clipPosition(e), this.getLength() <= 1 && this.$detectNewLine(t);
var n = this.$split(t), i = n.splice(0, 1)[0], o = 0 == n.length ? null : n.splice(n.length - 1, 1)[0];
return e = this.insertInLine(e, i), null !== o && (e = this.insertNewLine(e), e = this._insertLines(e.row, n),
e = this.insertInLine(e, o || "")), e;
}, this.insertLines = function(e, t) {
return e >= this.getLength() ? this.insert({
row: e,
column: 0
}, "\n" + t.join("\n")) : this._insertLines(Math.max(e, 0), t);
}, this._insertLines = function(e, t) {
if (0 == t.length) return {
row: e,
column: 0
};
if (t.length > 65535) {
var n = this._insertLines(e, t.slice(65535));
t = t.slice(0, 65535);
}
var i = [ e, 0 ];
i.push.apply(i, t), this.$lines.splice.apply(this.$lines, i);
var r = new o(e, 0, e + t.length, 0), s = {
action: "insertLines",
range: r,
lines: t
};
return this._emit("change", {
data: s
}), n || r.end;
}, this.insertNewLine = function(e) {
e = this.$clipPosition(e);
var t = this.$lines[e.row] || "";
this.$lines[e.row] = t.substring(0, e.column), this.$lines.splice(e.row + 1, 0, t.substring(e.column, t.length));
var n = {
row: e.row + 1,
column: 0
}, i = {
action: "insertText",
range: o.fromPoints(e, n),
text: this.getNewLineCharacter()
};
return this._emit("change", {
data: i
}), n;
}, this.insertInLine = function(e, t) {
if (0 == t.length) return e;
var n = this.$lines[e.row] || "";
this.$lines[e.row] = n.substring(0, e.column) + t + n.substring(e.column);
var i = {
row: e.row,
column: e.column + t.length
}, r = {
action: "insertText",
range: o.fromPoints(e, i),
text: t
};
return this._emit("change", {
data: r
}), i;
}, this.remove = function(e) {
if (!e instanceof o && (e = o.fromPoints(e.start, e.end)), e.start = this.$clipPosition(e.start),
e.end = this.$clipPosition(e.end), e.isEmpty()) return e.start;
var t = e.start.row, n = e.end.row;
if (e.isMultiLine()) {
var i = 0 == e.start.column ? t : t + 1, r = n - 1;
e.end.column > 0 && this.removeInLine(n, 0, e.end.column), r >= i && this._removeLines(i, r),
i != t && (this.removeInLine(t, e.start.column, this.getLine(t).length), this.removeNewLine(e.start.row));
} else this.removeInLine(t, e.start.column, e.end.column);
return e.start;
}, this.removeInLine = function(e, t, n) {
if (t != n) {
var i = new o(e, t, e, n), r = this.getLine(e), s = r.substring(t, n), a = r.substring(0, t) + r.substring(n, r.length);
this.$lines.splice(e, 1, a);
var l = {
action: "removeText",
range: i,
text: s
};
return this._emit("change", {
data: l
}), i.start;
}
}, this.removeLines = function(e, t) {
return 0 > e || t >= this.getLength() ? this.remove(new o(e, 0, t + 1, 0)) : this._removeLines(e, t);
}, this._removeLines = function(e, t) {
var n = new o(e, 0, t + 1, 0), i = this.$lines.splice(e, t - e + 1), r = {
action: "removeLines",
range: n,
nl: this.getNewLineCharacter(),
lines: i
};
return this._emit("change", {
data: r
}), i;
}, this.removeNewLine = function(e) {
var t = this.getLine(e), n = this.getLine(e + 1), i = new o(e, t.length, e + 1, 0), r = t + n;
this.$lines.splice(e, 2, r);
var s = {
action: "removeText",
range: i,
text: this.getNewLineCharacter()
};
this._emit("change", {
data: s
});
}, this.replace = function(e, t) {
if (!e instanceof o && (e = o.fromPoints(e.start, e.end)), 0 == t.length && e.isEmpty()) return e.start;
if (t == this.getTextRange(e)) return e.end;
if (this.remove(e), t) var n = this.insert(e.start, t); else n = e.start;
return n;
}, this.applyDeltas = function(e) {
for (var t = 0; t < e.length; t++) {
var n = e[t], i = o.fromPoints(n.range.start, n.range.end);
"insertLines" == n.action ? this.insertLines(i.start.row, n.lines) : "insertText" == n.action ? this.insert(i.start, n.text) : "removeLines" == n.action ? this._removeLines(i.start.row, i.end.row - 1) : "removeText" == n.action && this.remove(i);
}
}, this.revertDeltas = function(e) {
for (var t = e.length - 1; t >= 0; t--) {
var n = e[t], i = o.fromPoints(n.range.start, n.range.end);
"insertLines" == n.action ? this._removeLines(i.start.row, i.end.row - 1) : "insertText" == n.action ? this.remove(i) : "removeLines" == n.action ? this._insertLines(i.start.row, n.lines) : "removeText" == n.action && this.insert(i.start, n.text);
}
}, this.indexToPosition = function(e, t) {
for (var n = this.$lines || this.getAllLines(), i = this.getNewLineCharacter().length, o = t || 0, r = n.length; r > o; o++) if (e -= n[o].length + i,
0 > e) return {
row: o,
column: e + n[o].length + i
};
return {
row: r - 1,
column: n[r - 1].length
};
}, this.positionToIndex = function(e, t) {
for (var n = this.$lines || this.getAllLines(), i = this.getNewLineCharacter().length, o = 0, r = Math.min(e.row, n.length), s = t || 0; r > s; ++s) o += n[s].length + i;
return o + e.column;
};
}).call(s.prototype), t.Document = s;
}), define("ace/background_tokenizer", [ "require", "exports", "module", "./lib/oop", "./lib/event_emitter" ], function(e, t) {
var n = e("./lib/oop"), i = e("./lib/event_emitter").EventEmitter, o = function(e) {
this.running = !1, this.lines = [], this.states = [], this.currentLine = 0, this.tokenizer = e;
var t = this;
this.$worker = function() {
if (t.running) {
for (var e = new Date(), n = t.currentLine, i = -1, o = t.doc; t.lines[n]; ) n++;
var r = n, s = o.getLength(), a = 0;
for (t.running = !1; s > n; ) {
t.$tokenizeRow(n), i = n;
do n++; while (t.lines[n]);
if (a++, 0 == a % 5 && new Date() - e > 20) return t.running = setTimeout(t.$worker, 20),
t.currentLine = n, void 0;
}
t.currentLine = n, i >= r && t.fireUpdateEvent(r, i);
}
};
};
(function() {
n.implement(this, i), this.setTokenizer = function(e) {
this.tokenizer = e, this.lines = [], this.states = [], this.start(0);
}, this.setDocument = function(e) {
this.doc = e, this.lines = [], this.states = [], this.stop();
}, this.fireUpdateEvent = function(e, t) {
var n = {
first: e,
last: t
};
this._emit("update", {
data: n
});
}, this.start = function(e) {
this.currentLine = Math.min(e || 0, this.currentLine, this.doc.getLength()), this.lines.splice(this.currentLine, this.lines.length),
this.states.splice(this.currentLine, this.states.length), this.stop(), this.running = setTimeout(this.$worker, 700);
}, this.scheduleStart = function() {
this.running = setTimeout(this.$worker, 700);
}, this.$updateOnChange = function(e) {
var t = e.range, n = t.start.row, i = t.end.row - n;
if (0 === i) this.lines[n] = null; else if ("removeText" == e.action || "removeLines" == e.action) this.lines.splice(n, i + 1, null),
this.states.splice(n, i + 1, null); else {
var o = Array(i + 1);
o.unshift(n, 1), this.lines.splice.apply(this.lines, o), this.states.splice.apply(this.states, o);
}
this.currentLine = Math.min(n, this.currentLine, this.doc.getLength()), this.stop();
}, this.stop = function() {
this.running && clearTimeout(this.running), this.running = !1;
}, this.getTokens = function(e) {
return this.lines[e] || this.$tokenizeRow(e);
}, this.getState = function(e) {
return this.currentLine == e && this.$tokenizeRow(e), this.states[e] || "start";
}, this.$tokenizeRow = function(e) {
var t = this.doc.getLine(e), n = this.states[e - 1], i = this.tokenizer.getLineTokens(t, n, e);
return this.states[e] + "" != i.state + "" ? (this.states[e] = i.state, this.lines[e + 1] = null,
this.currentLine > e + 1 && (this.currentLine = e + 1)) : this.currentLine == e && (this.currentLine = e + 1),
this.lines[e] = i.tokens;
};
}).call(o.prototype), t.BackgroundTokenizer = o;
}), define("ace/search_highlight", [ "require", "exports", "module", "./lib/lang", "./lib/oop", "./range" ], function(e, t) {
var n = e("./lib/lang");
e("./lib/oop");
var i = e("./range").Range, o = function(e, t, n) {
this.setRegexp(e), this.clazz = t, this.type = n || "text";
};
(function() {
this.MAX_RANGES = 500, this.setRegexp = function(e) {
this.regExp + "" != e + "" && (this.regExp = e, this.cache = []);
}, this.update = function(e, t, o, r) {
if (this.regExp) for (var s = r.firstRow, a = r.lastRow, l = s; a >= l; l++) {
var c = this.cache[l];
null == c && (c = n.getMatchOffsets(o.getLine(l), this.regExp), c.length > this.MAX_RANGES && (c = c.slice(0, this.MAX_RANGES)),
c = c.map(function(e) {
return new i(l, e.offset, l, e.offset + e.length);
}), this.cache[l] = c.length ? c : "");
for (var u = c.length; u--; ) t.drawSingleLineMarker(e, c[u].toScreenRange(o), this.clazz, r);
}
};
}).call(o.prototype), t.SearchHighlight = o;
}), define("ace/edit_session/fold_line", [ "require", "exports", "module", "../range" ], function(e, t) {
function n(e, t) {
this.foldData = e, Array.isArray(t) ? this.folds = t : t = this.folds = [ t ];
var n = t[t.length - 1];
this.range = new i(t[0].start.row, t[0].start.column, n.end.row, n.end.column),
this.start = this.range.start, this.end = this.range.end, this.folds.forEach(function(e) {
e.setFoldLine(this);
}, this);
}
var i = e("../range").Range;
(function() {
this.shiftRow = function(e) {
this.start.row += e, this.end.row += e, this.folds.forEach(function(t) {
t.start.row += e, t.end.row += e;
});
}, this.addFold = function(e) {
if (e.sameRow) {
if (e.start.row < this.startRow || e.endRow > this.endRow) throw "Can't add a fold to this FoldLine as it has no connection";
this.folds.push(e), this.folds.sort(function(e, t) {
return -e.range.compareEnd(t.start.row, t.start.column);
}), this.range.compareEnd(e.start.row, e.start.column) > 0 ? (this.end.row = e.end.row,
this.end.column = e.end.column) : this.range.compareStart(e.end.row, e.end.column) < 0 && (this.start.row = e.start.row,
this.start.column = e.start.column);
} else if (e.start.row == this.end.row) this.folds.push(e), this.end.row = e.end.row,
this.end.column = e.end.column; else {
if (e.end.row != this.start.row) throw "Trying to add fold to FoldRow that doesn't have a matching row";
this.folds.unshift(e), this.start.row = e.start.row, this.start.column = e.start.column;
}
e.foldLine = this;
}, this.containsRow = function(e) {
return e >= this.start.row && e <= this.end.row;
}, this.walk = function(e, t, n) {
var i, o, r, s = 0, a = this.folds, l = !0;
null == t && (t = this.end.row, n = this.end.column);
for (var c = 0; c < a.length; c++) {
if (i = a[c], o = i.range.compareStart(t, n), -1 == o) return e(null, t, n, s, l),
void 0;
if (r = e(null, i.start.row, i.start.column, s, l), r = !r && e(i.placeholder, i.start.row, i.start.column, s),
r || 0 == o) return;
l = !i.sameRow, s = i.end.column;
}
e(null, t, n, s, l);
}, this.getNextFoldTo = function(e, t) {
for (var n, i, o = 0; o < this.folds.length; o++) {
if (n = this.folds[o], i = n.range.compareEnd(e, t), -1 == i) return {
fold: n,
kind: "after"
};
if (0 == i) return {
fold: n,
kind: "inside"
};
}
return null;
}, this.addRemoveChars = function(e, t, n) {
var i, o, r = this.getNextFoldTo(e, t);
if (r) if (i = r.fold, "inside" == r.kind && i.start.column != t && i.start.row != e) window.console && window.console.log(e, t, i); else if (i.start.row == e) {
o = this.folds;
var s = o.indexOf(i);
for (0 == s && (this.start.column += n), s; s < o.length; s++) {
if (i = o[s], i.start.column += n, !i.sameRow) return;
i.end.column += n;
}
this.end.column += n;
}
}, this.split = function(e, t) {
var i = this.getNextFoldTo(e, t).fold, o = this.folds, r = this.foldData;
if (!i) return null;
var s = o.indexOf(i), a = o[s - 1];
this.end.row = a.end.row, this.end.column = a.end.column, o = o.splice(s, o.length - s);
var l = new n(r, o);
return r.splice(r.indexOf(this) + 1, 0, l), l;
}, this.merge = function(e) {
for (var t = e.folds, n = 0; n < t.length; n++) this.addFold(t[n]);
var i = this.foldData;
i.splice(i.indexOf(e), 1);
}, this.toString = function() {
var e = [ this.range.toString() + ": [" ];
return this.folds.forEach(function(t) {
e.push(" " + t.toString());
}), e.push("]"), e.join("\n");
}, this.idxToPosition = function(e) {
for (var t, n = 0, i = 0; i < this.folds.length; i++) {
var t = this.folds[i];
if (e -= t.start.column - n, 0 > e) return {
row: t.start.row,
column: t.start.column + e
};
if (e -= t.placeholder.length, 0 > e) return t.start;
n = t.end.column;
}
return {
row: this.end.row,
column: this.end.column + e
};
};
}).call(n.prototype), t.FoldLine = n;
}), define("ace/range_list", [ "require", "exports", "module", "./range" ], function(e, t) {
var n = e("./range").Range, i = n.comparePoints, o = function() {
this.ranges = [];
};
(function() {
this.comparePoints = i, this.pointIndex = function(e, t, n) {
for (var o = this.ranges, r = n || 0; r < o.length; r++) {
var s = o[r], a = i(e, s.end);
if (!(a > 0)) {
var l = i(e, s.start);
return 0 === a ? t && 0 !== l ? -r - 2 : r : l > 0 || 0 === l && !t ? r : -r - 1;
}
}
return -r - 1;
}, this.add = function(e) {
var t = !e.isEmpty(), n = this.pointIndex(e.start, t);
0 > n && (n = -n - 1);
var i = this.pointIndex(e.end, t, n);
return 0 > i ? i = -i - 1 : i++, this.ranges.splice(n, i - n, e);
}, this.addList = function(e) {
for (var t = [], n = e.length; n--; ) t.push.call(t, this.add(e[n]));
return t;
}, this.substractPoint = function(e) {
var t = this.pointIndex(e);
return t >= 0 ? this.ranges.splice(t, 1) : void 0;
}, this.merge = function() {
var e = [], t = this.ranges;
t = t.sort(function(e, t) {
return i(e.start, t.start);
});
for (var n, o = t[0], r = 1; r < t.length; r++) {
n = o, o = t[r];
var s = i(n.end, o.start);
0 > s || (0 != s || n.isEmpty() || o.isEmpty()) && (i(n.end, o.end) < 0 && (n.end.row = o.end.row,
n.end.column = o.end.column), t.splice(r, 1), e.push(o), o = n, r--);
}
return this.ranges = t, e;
}, this.contains = function(e, t) {
return this.pointIndex({
row: e,
column: t
}) >= 0;
}, this.containsPoint = function(e) {
return this.pointIndex(e) >= 0;
}, this.rangeAtPoint = function(e) {
var t = this.pointIndex(e);
return t >= 0 ? this.ranges[t] : void 0;
}, this.clipRows = function(e, t) {
var n = this.ranges;
if (n[0].start.row > t || n[n.length - 1].start.row < e) return [];
var i = this.pointIndex({
row: e,
column: 0
});
0 > i && (i = -i - 1);
var o = this.pointIndex({
row: t,
column: 0
}, i);
0 > o && (o = -o - 1);
for (var r = [], s = i; o > s; s++) r.push(n[s]);
return r;
}, this.removeAll = function() {
return this.ranges.splice(0, this.ranges.length);
}, this.attach = function(e) {
this.session && this.detach(), this.session = e, this.onChange = this.$onChange.bind(this),
this.session.on("change", this.onChange);
}, this.detach = function() {
this.session && (this.session.removeListener("change", this.onChange), this.session = null);
}, this.$onChange = function(e) {
var t = e.data.range;
if ("i" == e.data.action[0]) var n = t.start, i = t.end; else var i = t.start, n = t.end;
for (var o = n.row, r = i.row, s = r - o, a = -n.column + i.column, l = this.ranges, c = 0, u = l.length; u > c; c++) {
var d = l[c];
if (!(d.end.row < o)) {
if (d.start.row > o) break;
if (d.start.row == o && d.start.column >= n.column && (d.start.column == n.column && this.$insertRight || (d.start.column += a,
d.start.row += s)), d.end.row == o && d.end.column >= n.column) {
if (d.end.column == n.column && this.$insertRight) continue;
d.end.column == n.column && a > 0 && u - 1 > c && d.end.column > d.start.column && d.end.column == l[c + 1].start.column && (d.end.column -= a),
d.end.column += a, d.end.row += s;
}
}
}
if (0 != s && u > c) for (;u > c; c++) {
var d = l[c];
d.start.row += s, d.end.row += s;
}
};
}).call(o.prototype), t.RangeList = o;
}), define("ace/edit_session/fold", [ "require", "exports", "module", "../range", "../range_list", "../lib/oop" ], function(e, t) {
function n(e, t) {
e.row -= t.row, 0 == e.row && (e.column -= t.column);
}
function i(e, t) {
n(e.start, t), n(e.end, t);
}
function o(e, t) {
0 == e.row && (e.column += t.column), e.row += t.row;
}
function r(e, t) {
o(e.start, t), o(e.end, t);
}
e("../range").Range;
var s = e("../range_list").RangeList, a = e("../lib/oop"), l = t.Fold = function(e, t) {
this.foldLine = null, this.placeholder = t, this.range = e, this.start = e.start,
this.end = e.end, this.sameRow = e.start.row == e.end.row, this.subFolds = this.ranges = [];
};
a.inherits(l, s), function() {
this.toString = function() {
return '"' + this.placeholder + '" ' + this.range.toString();
}, this.setFoldLine = function(e) {
this.foldLine = e, this.subFolds.forEach(function(t) {
t.setFoldLine(e);
});
}, this.clone = function() {
var e = this.range.clone(), t = new l(e, this.placeholder);
return this.subFolds.forEach(function(e) {
t.subFolds.push(e.clone());
}), t.collapseChildren = this.collapseChildren, t;
}, this.addSubFold = function(e) {
if (!this.range.isEqual(e)) {
if (!this.range.containsRange(e)) throw "A fold can't intersect already existing fold" + e.range + this.range;
i(e, this.start);
for (var t = e.start.row, n = e.start.column, o = 0, r = -1; o < this.subFolds.length && (r = this.subFolds[o].range.compare(t, n),
1 == r); o++) ;
var s = this.subFolds[o];
if (0 == r) return s.addSubFold(e);
for (var t = e.range.end.row, n = e.range.end.column, a = o, r = -1; a < this.subFolds.length && (r = this.subFolds[a].range.compare(t, n),
1 == r); a++) ;
if (this.subFolds[a], 0 == r) throw "A fold can't intersect already existing fold" + e.range + this.range;
return this.subFolds.splice(o, a - o, e), e.setFoldLine(this.foldLine), e;
}
}, this.restoreRange = function(e) {
return r(e, this.start);
};
}.call(l.prototype);
}), define("ace/edit_session/folding", [ "require", "exports", "module", "../range", "./fold_line", "./fold", "../token_iterator" ], function(e, t) {
function n() {
this.getFoldAt = function(e, t, n) {
var i = this.getFoldLine(e);
if (!i) return null;
for (var o = i.folds, r = 0; r < o.length; r++) {
var s = o[r];
if (s.range.contains(e, t)) {
if (1 == n && s.range.isEnd(e, t)) continue;
if (-1 == n && s.range.isStart(e, t)) continue;
return s;
}
}
}, this.getFoldsInRange = function(e) {
var t = e.start, n = e.end, i = this.$foldData, o = [];
t.column += 1, n.column -= 1;
for (var r = 0; r < i.length; r++) {
var s = i[r].range.compareRange(e);
if (2 != s) {
if (-2 == s) break;
for (var a = i[r].folds, l = 0; l < a.length; l++) {
var c = a[l];
if (s = c.range.compareRange(e), -2 == s) break;
if (2 != s) {
if (42 == s) break;
o.push(c);
}
}
}
}
return t.column -= 1, n.column += 1, o;
}, this.getAllFolds = function() {
function e(e) {
t.push(e);
}
for (var t = [], n = this.$foldData, i = 0; i < n.length; i++) for (var o = 0; o < n[i].folds.length; o++) e(n[i].folds[o]);
return t;
}, this.getFoldStringAt = function(e, t, n, i) {
if (i = i || this.getFoldLine(e), !i) return null;
for (var o, r, s = {
end: {
column: 0
}
}, a = 0; a < i.folds.length; a++) {
r = i.folds[a];
var l = r.range.compareEnd(e, t);
if (-1 == l) {
o = this.getLine(r.start.row).substring(s.end.column, r.start.column);
break;
}
if (0 === l) return null;
s = r;
}
return o || (o = this.getLine(r.start.row).substring(s.end.column)), -1 == n ? o.substring(0, t - s.end.column) : 1 == n ? o.substring(t - s.end.column) : o;
}, this.getFoldLine = function(e, t) {
var n = this.$foldData, i = 0;
for (t && (i = n.indexOf(t)), -1 == i && (i = 0), i; i < n.length; i++) {
var o = n[i];
if (o.start.row <= e && o.end.row >= e) return o;
if (o.end.row > e) return null;
}
return null;
}, this.getNextFoldLine = function(e, t) {
var n = this.$foldData, i = 0;
for (t && (i = n.indexOf(t)), -1 == i && (i = 0), i; i < n.length; i++) {
var o = n[i];
if (o.end.row >= e) return o;
}
return null;
}, this.getFoldedRowCount = function(e, t) {
for (var n = this.$foldData, i = t - e + 1, o = 0; o < n.length; o++) {
var r = n[o], s = r.end.row, a = r.start.row;
if (s >= t) {
t > a && (a >= e ? i -= t - a : i = 0);
break;
}
s >= e && (i -= a >= e ? s - a : s - e + 1);
}
return i;
}, this.$addFoldLine = function(e) {
return this.$foldData.push(e), this.$foldData.sort(function(e, t) {
return e.start.row - t.start.row;
}), e;
}, this.addFold = function(e, t) {
var n, i = this.$foldData, s = !1;
e instanceof r ? n = e : (n = new r(t, e), n.collapseChildren = t.collapseChildren),
this.$clipRangeToDocument(n.range);
var a = n.start.row, l = n.start.column, c = n.end.row, u = n.end.column;
if (!(c > a || a == c && u - 2 >= l)) throw "The range has to be at least 2 characters width";
var d = this.getFoldAt(a, l, 1), h = this.getFoldAt(c, u, -1);
if (d && h == d) return d.addSubFold(n);
if (d && !d.range.isStart(a, l) || h && !h.range.isEnd(c, u)) throw "A fold can't intersect already existing fold" + n.range + d.range;
var p = this.getFoldsInRange(n.range);
p.length > 0 && (this.removeFolds(p), p.forEach(function(e) {
n.addSubFold(e);
}));
for (var f = 0; f < i.length; f++) {
var g = i[f];
if (c == g.start.row) {
g.addFold(n), s = !0;
break;
}
if (a == g.end.row) {
if (g.addFold(n), s = !0, !n.sameRow) {
var m = i[f + 1];
if (m && m.start.row == c) {
g.merge(m);
break;
}
}
break;
}
if (c <= g.start.row) break;
}
return s || (g = this.$addFoldLine(new o(this.$foldData, n))), this.$useWrapMode ? this.$updateWrapData(g.start.row, g.start.row) : this.$updateRowLengthCache(g.start.row, g.start.row),
this.$modified = !0, this._emit("changeFold", {
data: n,
action: "add"
}), n;
}, this.addFolds = function(e) {
e.forEach(function(e) {
this.addFold(e);
}, this);
}, this.removeFold = function(e) {
var t = e.foldLine, n = t.start.row, i = t.end.row, o = this.$foldData, r = t.folds;
if (1 == r.length) o.splice(o.indexOf(t), 1); else if (t.range.isEnd(e.end.row, e.end.column)) r.pop(),
t.end.row = r[r.length - 1].end.row, t.end.column = r[r.length - 1].end.column; else if (t.range.isStart(e.start.row, e.start.column)) r.shift(),
t.start.row = r[0].start.row, t.start.column = r[0].start.column; else if (e.sameRow) r.splice(r.indexOf(e), 1); else {
var s = t.split(e.start.row, e.start.column);
r = s.folds, r.shift(), s.start.row = r[0].start.row, s.start.column = r[0].start.column;
}
this.$updating || (this.$useWrapMode ? this.$updateWrapData(n, i) : this.$updateRowLengthCache(n, i)),
this.$modified = !0, this._emit("changeFold", {
data: e,
action: "remove"
});
}, this.removeFolds = function(e) {
for (var t = [], n = 0; n < e.length; n++) t.push(e[n]);
t.forEach(function(e) {
this.removeFold(e);
}, this), this.$modified = !0;
}, this.expandFold = function(e) {
this.removeFold(e), e.subFolds.forEach(function(t) {
e.restoreRange(t), this.addFold(t);
}, this), e.collapseChildren > 0 && this.foldAll(e.start.row + 1, e.end.row, e.collapseChildren - 1),
e.subFolds = [];
}, this.expandFolds = function(e) {
e.forEach(function(e) {
this.expandFold(e);
}, this);
}, this.unfold = function(e, t) {
var n, o;
if (null == e ? (n = new i(0, 0, this.getLength(), 0), t = !0) : n = "number" == typeof e ? new i(e, 0, e, this.getLine(e).length) : "row" in e ? i.fromPoints(e, e) : e,
o = this.getFoldsInRange(n), t) this.removeFolds(o); else for (;o.length; ) this.expandFolds(o),
o = this.getFoldsInRange(n);
}, this.isRowFolded = function(e, t) {
return !!this.getFoldLine(e, t);
}, this.getRowFoldEnd = function(e, t) {
var n = this.getFoldLine(e, t);
return n ? n.end.row : e;
}, this.getRowFoldStart = function(e, t) {
var n = this.getFoldLine(e, t);
return n ? n.start.row : e;
}, this.getFoldDisplayLine = function(e, t, n, i, o) {
null == i && (i = e.start.row, o = 0), null == t && (t = e.end.row, n = this.getLine(t).length);
var r = this.doc, s = "";
return e.walk(function(e, t, n, a) {
if (!(i > t)) {
if (t == i) {
if (o > n) return;
a = Math.max(o, a);
}
s += null != e ? e : r.getLine(t).substring(a, n);
}
}, t, n), s;
}, this.getDisplayLine = function(e, t, n, i) {
var o = this.getFoldLine(e);
if (o) return this.getFoldDisplayLine(o, e, t, n, i);
var r;
return r = this.doc.getLine(e), r.substring(i || 0, t || r.length);
}, this.$cloneFoldData = function() {
var e = [];
return e = this.$foldData.map(function(t) {
var n = t.folds.map(function(e) {
return e.clone();
});
return new o(e, n);
});
}, this.toggleFold = function(e) {
var t, n, i = this.selection, o = i.getRange();
if (o.isEmpty()) {
var r = o.start;
if (t = this.getFoldAt(r.row, r.column)) return this.expandFold(t), void 0;
(n = this.findMatchingBracket(r)) ? 1 == o.comparePoint(n) ? o.end = n : (o.start = n,
o.start.column++, o.end.column--) : (n = this.findMatchingBracket({
row: r.row,
column: r.column + 1
})) ? (1 == o.comparePoint(n) ? o.end = n : o.start = n, o.start.column++) : o = this.getCommentFoldRange(r.row, r.column) || o;
} else {
var s = this.getFoldsInRange(o);
if (e && s.length) return this.expandFolds(s), void 0;
1 == s.length && (t = s[0]);
}
if (t || (t = this.getFoldAt(o.start.row, o.start.column)), t && t.range.toString() == o.toString()) return this.expandFold(t),
void 0;
var a = "...";
if (!o.isMultiLine()) {
if (a = this.getTextRange(o), a.length < 4) return;
a = a.trim().substring(0, 2) + "..";
}
this.addFold(a, o);
}, this.getCommentFoldRange = function(e, t, n) {
var o = new s(this, e, t), r = o.getCurrentToken();
if (r && /^comment|string/.test(r.type)) {
var a = new i(), l = new RegExp(r.type.replace(/\..*/, "\\."));
if (1 != n) {
do r = o.stepBackward(); while (r && l.test(r.type));
o.stepForward();
}
if (a.start.row = o.getCurrentTokenRow(), a.start.column = o.getCurrentTokenColumn() + 2,
o = new s(this, e, t), -1 != n) {
do r = o.stepForward(); while (r && l.test(r.type));
r = o.stepBackward();
} else r = o.getCurrentToken();
return a.end.row = o.getCurrentTokenRow(), a.end.column = o.getCurrentTokenColumn() + r.value.length - 2,
a;
}
}, this.foldAll = function(e, t, n) {
void 0 == n && (n = 1e5);
var i = this.foldWidgets;
t = t || this.getLength(), e = e || 0;
for (var o = e; t > o; o++) if (null == i[o] && (i[o] = this.getFoldWidget(o)),
"start" == i[o]) {
var r = this.getFoldWidgetRange(o), s = r.end.row;
if (r && r.isMultiLine() && t >= s && r.start.row >= e) try {
var a = this.addFold("...", r);
a.collapseChildren = n, o = s;
} catch (l) {}
}
}, this.$foldStyles = {
manual: 1,
markbegin: 1,
markbeginend: 1
}, this.$foldStyle = "markbegin", this.setFoldStyle = function(e) {
if (!this.$foldStyles[e]) throw new Error("invalid fold style: " + e + "[" + Object.keys(this.$foldStyles).join(", ") + "]");
if (this.$foldStyle != e) {
this.$foldStyle = e, "manual" == e && this.unfold();
var t = this.$foldMode;
this.$setFolding(null), this.$setFolding(t);
}
}, this.$setFolding = function(e) {
if (this.$foldMode != e) {
if (this.$foldMode = e, this.removeListener("change", this.$updateFoldWidgets),
this._emit("changeAnnotation"), !e || "manual" == this.$foldStyle) return this.foldWidgets = null,
void 0;
this.foldWidgets = [], this.getFoldWidget = e.getFoldWidget.bind(e, this, this.$foldStyle),
this.getFoldWidgetRange = e.getFoldWidgetRange.bind(e, this, this.$foldStyle), this.$updateFoldWidgets = this.updateFoldWidgets.bind(this),
this.on("change", this.$updateFoldWidgets);
}
}, this.getParentFoldRangeData = function(e, t) {
var n = this.foldWidgets;
if (!n || t && n[e]) return {};
for (var i, o = e - 1; o >= 0; ) {
var r = n[o];
if (null == r && (r = n[o] = this.getFoldWidget(o)), "start" == r) {
var s = this.getFoldWidgetRange(o);
if (i || (i = s), s && s.end.row >= e) break;
}
o--;
}
return {
range: -1 !== o && s,
firstRange: i
};
}, this.onFoldWidgetClick = function(e, t) {
var n = this.getFoldWidget(e), i = this.getLine(e);
t = t.domEvent;
var o = t.shiftKey, r = t.ctrlKey || t.metaKey, s = t.altKey, a = "end" === n ? -1 : 1, l = this.getFoldAt(e, -1 === a ? 0 : i.length, a);
if (l) return o || r ? this.removeFold(l) : this.expandFold(l), void 0;
var c = this.getFoldWidgetRange(e);
if (c && !c.isMultiLine() && (l = this.getFoldAt(c.start.row, c.start.column, 1),
l && c.isEqual(l.range))) return this.removeFold(l), void 0;
if (s) {
var u = this.getParentFoldRangeData(e);
if (u.range) var d = u.range.start.row + 1, h = u.range.end.row;
this.foldAll(d, h, r ? 1e4 : 0);
} else if (o) {
var h = c ? c.end.row : this.getLength();
this.foldAll(e + 1, c.end.row, r ? 1e4 : 0);
} else c && (r && (c.collapseChildren = 1e4), this.addFold("...", c));
c || ((t.target || t.srcElement).className += " ace_invalid");
}, this.updateFoldWidgets = function(e) {
var t = e.data, n = t.range, i = n.start.row, o = n.end.row - i;
if (0 === o) this.foldWidgets[i] = null; else if ("removeText" == t.action || "removeLines" == t.action) this.foldWidgets.splice(i, o + 1, null); else {
var r = Array(o + 1);
r.unshift(i, 1), this.foldWidgets.splice.apply(this.foldWidgets, r);
}
};
}
var i = e("../range").Range, o = e("./fold_line").FoldLine, r = e("./fold").Fold, s = e("../token_iterator").TokenIterator;
t.Folding = n;
}), define("ace/edit_session/bracket_match", [ "require", "exports", "module", "../token_iterator", "../range" ], function(e, t) {
function n() {
this.findMatchingBracket = function(e, t) {
if (0 == e.column) return null;
var n = t || this.getLine(e.row).charAt(e.column - 1);
if ("" == n) return null;
var i = n.match(/([\(\[\{])|([\)\]\}])/);
return i ? i[1] ? this.$findClosingBracket(i[1], e) : this.$findOpeningBracket(i[2], e) : null;
}, this.getBracketRange = function(e) {
var t, n = this.getLine(e.row), i = !0, r = n.charAt(e.column - 1), s = r && r.match(/([\(\[\{])|([\)\]\}])/);
if (s || (r = n.charAt(e.column), e = {
row: e.row,
column: e.column + 1
}, s = r && r.match(/([\(\[\{])|([\)\]\}])/), i = !1), !s) return null;
if (s[1]) {
var a = this.$findClosingBracket(s[1], e);
if (!a) return null;
t = o.fromPoints(e, a), i || (t.end.column++, t.start.column--), t.cursor = t.end;
} else {
var a = this.$findOpeningBracket(s[2], e);
if (!a) return null;
t = o.fromPoints(a, e), i || (t.start.column++, t.end.column--), t.cursor = t.start;
}
return t;
}, this.$brackets = {
")": "(",
"(": ")",
"]": "[",
"[": "]",
"{": "}",
"}": "{"
}, this.$findOpeningBracket = function(e, t, n) {
var o = this.$brackets[e], r = 1, s = new i(this, t.row, t.column), a = s.getCurrentToken();
if (a || (a = s.stepForward()), a) {
n || (n = new RegExp("(\\.?" + a.type.replace(".", "\\.").replace("rparen", ".paren") + ")+"));
for (var l = t.column - s.getCurrentTokenColumn() - 2, c = a.value; ;) {
for (;l >= 0; ) {
var u = c.charAt(l);
if (u == o) {
if (r -= 1, 0 == r) return {
row: s.getCurrentTokenRow(),
column: l + s.getCurrentTokenColumn()
};
} else u == e && (r += 1);
l -= 1;
}
do a = s.stepBackward(); while (a && !n.test(a.type));
if (null == a) break;
c = a.value, l = c.length - 1;
}
return null;
}
}, this.$findClosingBracket = function(e, t, n) {
var o = this.$brackets[e], r = 1, s = new i(this, t.row, t.column), a = s.getCurrentToken();
if (a || (a = s.stepForward()), a) {
n || (n = new RegExp("(\\.?" + a.type.replace(".", "\\.").replace("lparen", ".paren") + ")+"));
for (var l = t.column - s.getCurrentTokenColumn(); ;) {
for (var c = a.value, u = c.length; u > l; ) {
var d = c.charAt(l);
if (d == o) {
if (r -= 1, 0 == r) return {
row: s.getCurrentTokenRow(),
column: l + s.getCurrentTokenColumn()
};
} else d == e && (r += 1);
l += 1;
}
do a = s.stepForward(); while (a && !n.test(a.type));
if (null == a) break;
l = 0;
}
return null;
}
};
}
var i = e("../token_iterator").TokenIterator, o = e("../range").Range;
t.BracketMatch = n;
}), define("ace/edit_session", [ "require", "exports", "module", "./lib/oop", "./lib/lang", "./config", "./lib/event_emitter", "./selection", "./mode/text", "./range", "./document", "./background_tokenizer", "./search_highlight", "./edit_session/folding", "./edit_session/bracket_match" ], function(e, t) {
var n = e("./lib/oop"), i = e("./lib/lang"), o = e("./config"), r = e("./lib/event_emitter").EventEmitter, s = e("./selection").Selection, a = e("./mode/text").Mode, l = e("./range").Range, c = e("./document").Document, u = e("./background_tokenizer").BackgroundTokenizer, d = e("./search_highlight").SearchHighlight, h = function(e, t) {
this.$breakpoints = [], this.$decorations = [], this.$frontMarkers = {}, this.$backMarkers = {},
this.$markerId = 1, this.$undoSelect = !0, this.$foldData = [], this.$foldData.toString = function() {
return this.join("\n");
}, this.on("changeFold", this.onChangeFold.bind(this)), this.$onChange = this.onChange.bind(this),
"object" == typeof e && e.getLine || (e = new c(e)), this.setDocument(e), this.selection = new s(this),
o.resetOptions(this), this.setMode(t), o._emit("session", this);
};
(function() {
function t(e) {
return 4352 > e ? !1 : e >= 4352 && 4447 >= e || e >= 4515 && 4519 >= e || e >= 4602 && 4607 >= e || e >= 9001 && 9002 >= e || e >= 11904 && 11929 >= e || e >= 11931 && 12019 >= e || e >= 12032 && 12245 >= e || e >= 12272 && 12283 >= e || e >= 12288 && 12350 >= e || e >= 12353 && 12438 >= e || e >= 12441 && 12543 >= e || e >= 12549 && 12589 >= e || e >= 12593 && 12686 >= e || e >= 12688 && 12730 >= e || e >= 12736 && 12771 >= e || e >= 12784 && 12830 >= e || e >= 12832 && 12871 >= e || e >= 12880 && 13054 >= e || e >= 13056 && 19903 >= e || e >= 19968 && 42124 >= e || e >= 42128 && 42182 >= e || e >= 43360 && 43388 >= e || e >= 44032 && 55203 >= e || e >= 55216 && 55238 >= e || e >= 55243 && 55291 >= e || e >= 63744 && 64255 >= e || e >= 65040 && 65049 >= e || e >= 65072 && 65106 >= e || e >= 65108 && 65126 >= e || e >= 65128 && 65131 >= e || e >= 65281 && 65376 >= e || e >= 65504 && 65510 >= e;
}
n.implement(this, r), this.setDocument = function(e) {
this.doc && this.doc.removeListener("change", this.$onChange), this.doc = e, e.on("change", this.$onChange),
this.bgTokenizer && this.bgTokenizer.setDocument(this.getDocument()), this.resetCaches();
}, this.getDocument = function() {
return this.doc;
}, this.$resetRowCache = function(e) {
if (!e) return this.$docRowCache = [], this.$screenRowCache = [], void 0;
var t = this.$docRowCache.length, n = this.$getRowCacheIndex(this.$docRowCache, e) + 1;
t > n && (this.$docRowCache.splice(n, t), this.$screenRowCache.splice(n, t));
}, this.$getRowCacheIndex = function(e, t) {
for (var n = 0, i = e.length - 1; i >= n; ) {
var o = n + i >> 1, r = e[o];
if (t > r) n = o + 1; else {
if (!(r > t)) return o;
i = o - 1;
}
}
return n - 1;
}, this.resetCaches = function() {
this.$modified = !0, this.$wrapData = [], this.$rowLengthCache = [], this.$resetRowCache(0),
this.bgTokenizer && this.bgTokenizer.start(0);
}, this.onChangeFold = function(e) {
var t = e.data;
this.$resetRowCache(t.start.row);
}, this.onChange = function(e) {
var t = e.data;
this.$modified = !0, this.$resetRowCache(t.range.start.row);
var n = this.$updateInternalDataOnChange(e);
this.$fromUndo || !this.$undoManager || t.ignore || (this.$deltasDoc.push(t), n && 0 != n.length && this.$deltasFold.push({
action: "removeFolds",
folds: n
}), this.$informUndoManager.schedule()), this.bgTokenizer.$updateOnChange(t), this._emit("change", e);
}, this.setValue = function(e) {
this.doc.setValue(e), this.selection.moveCursorTo(0, 0), this.selection.clearSelection(),
this.$resetRowCache(0), this.$deltas = [], this.$deltasDoc = [], this.$deltasFold = [],
this.getUndoManager().reset();
}, this.getValue = this.toString = function() {
return this.doc.getValue();
}, this.getSelection = function() {
return this.selection;
}, this.getState = function(e) {
return this.bgTokenizer.getState(e);
}, this.getTokens = function(e) {
return this.bgTokenizer.getTokens(e);
}, this.getTokenAt = function(e, t) {
var n, i = this.bgTokenizer.getTokens(e), o = 0;
if (null == t) r = i.length - 1, o = this.getLine(e).length; else for (var r = 0; r < i.length && (o += i[r].value.length,
!(o >= t)); r++) ;
return (n = i[r]) ? (n.index = r, n.start = o - n.value.length, n) : null;
}, this.setUndoManager = function(e) {
if (this.$undoManager = e, this.$deltas = [], this.$deltasDoc = [], this.$deltasFold = [],
this.$informUndoManager && this.$informUndoManager.cancel(), e) {
var t = this;
this.$syncInformUndoManager = function() {
t.$informUndoManager.cancel(), t.$deltasFold.length && (t.$deltas.push({
group: "fold",
deltas: t.$deltasFold
}), t.$deltasFold = []), t.$deltasDoc.length && (t.$deltas.push({
group: "doc",
deltas: t.$deltasDoc
}), t.$deltasDoc = []), t.$deltas.length > 0 && e.execute({
action: "aceupdate",
args: [ t.$deltas, t ],
merge: t.mergeUndoDeltas
}), t.mergeUndoDeltas = !1, t.$deltas = [];
}, this.$informUndoManager = i.delayedCall(this.$syncInformUndoManager);
}
}, this.markUndoGroup = function() {
this.$syncInformUndoManager && this.$syncInformUndoManager();
}, this.$defaultUndoManager = {
undo: function() {},
redo: function() {},
reset: function() {}
}, this.getUndoManager = function() {
return this.$undoManager || this.$defaultUndoManager;
}, this.getTabString = function() {
return this.getUseSoftTabs() ? i.stringRepeat(" ", this.getTabSize()) : " ";
}, this.setUseSoftTabs = function(e) {
this.setOption("useSoftTabs", e);
}, this.getUseSoftTabs = function() {
return this.$useSoftTabs && !this.$mode.$indentWithTabs;
}, this.setTabSize = function(e) {
this.setOption("tabSize", e);
}, this.getTabSize = function() {
return this.$tabSize;
}, this.isTabStop = function(e) {
return this.$useSoftTabs && 0 == e.column % this.$tabSize;
}, this.$overwrite = !1, this.setOverwrite = function(e) {
this.setOption("overwrite", e);
}, this.getOverwrite = function() {
return this.$overwrite;
}, this.toggleOverwrite = function() {
this.setOverwrite(!this.$overwrite);
}, this.addGutterDecoration = function(e, t) {
this.$decorations[e] || (this.$decorations[e] = ""), this.$decorations[e] += " " + t,
this._emit("changeBreakpoint", {});
}, this.removeGutterDecoration = function(e, t) {
this.$decorations[e] = (this.$decorations[e] || "").replace(" " + t, ""), this._emit("changeBreakpoint", {});
}, this.getBreakpoints = function() {
return this.$breakpoints;
}, this.setBreakpoints = function(e) {
this.$breakpoints = [];
for (var t = 0; t < e.length; t++) this.$breakpoints[e[t]] = "ace_breakpoint";
this._emit("changeBreakpoint", {});
}, this.clearBreakpoints = function() {
this.$breakpoints = [], this._emit("changeBreakpoint", {});
}, this.setBreakpoint = function(e, t) {
void 0 === t && (t = "ace_breakpoint"), t ? this.$breakpoints[e] = t : delete this.$breakpoints[e],
this._emit("changeBreakpoint", {});
}, this.clearBreakpoint = function(e) {
delete this.$breakpoints[e], this._emit("changeBreakpoint", {});
}, this.addMarker = function(e, t, n, i) {
var o = this.$markerId++, r = {
range: e,
type: n || "line",
renderer: "function" == typeof n ? n : null,
clazz: t,
inFront: !!i,
id: o
};
return i ? (this.$frontMarkers[o] = r, this._emit("changeFrontMarker")) : (this.$backMarkers[o] = r,
this._emit("changeBackMarker")), o;
}, this.addDynamicMarker = function(e, t) {
if (e.update) {
var n = this.$markerId++;
return e.id = n, e.inFront = !!t, t ? (this.$frontMarkers[n] = e, this._emit("changeFrontMarker")) : (this.$backMarkers[n] = e,
this._emit("changeBackMarker")), e;
}
}, this.removeMarker = function(e) {
var t = this.$frontMarkers[e] || this.$backMarkers[e];
if (t) {
var n = t.inFront ? this.$frontMarkers : this.$backMarkers;
t && (delete n[e], this._emit(t.inFront ? "changeFrontMarker" : "changeBackMarker"));
}
}, this.getMarkers = function(e) {
return e ? this.$frontMarkers : this.$backMarkers;
}, this.highlight = function(e) {
if (!this.$searchHighlight) {
var t = new d(null, "ace_selected-word", "text");
this.$searchHighlight = this.addDynamicMarker(t);
}
this.$searchHighlight.setRegexp(e);
}, this.highlightLines = function(e, t, n, i) {
"number" != typeof t && (n = t, t = e), n || (n = "ace_step");
var o = new l(e, 0, t, 1/0);
return o.id = this.addMarker(o, n, "fullLine", i), o;
}, this.setAnnotations = function(e) {
this.$annotations = e, this._emit("changeAnnotation", {});
}, this.getAnnotations = function() {
return this.$annotations || [];
}, this.clearAnnotations = function() {
this.setAnnotations([]);
}, this.$detectNewLine = function(e) {
var t = e.match(/^.*?(\r?\n)/m);
this.$autoNewLine = t ? t[1] : "\n";
}, this.getWordRange = function(e, t) {
var n = this.getLine(e), i = !1;
if (t > 0 && (i = !!n.charAt(t - 1).match(this.tokenRe)), i || (i = !!n.charAt(t).match(this.tokenRe)),
i) var o = this.tokenRe; else if (/^\s+$/.test(n.slice(t - 1, t + 1))) var o = /\s/; else var o = this.nonTokenRe;
var r = t;
if (r > 0) {
do r--; while (r >= 0 && n.charAt(r).match(o));
r++;
}
for (var s = t; s < n.length && n.charAt(s).match(o); ) s++;
return new l(e, r, e, s);
}, this.getAWordRange = function(e, t) {
for (var n = this.getWordRange(e, t), i = this.getLine(n.end.row); i.charAt(n.end.column).match(/[ \t]/); ) n.end.column += 1;
return n;
}, this.setNewLineMode = function(e) {
this.doc.setNewLineMode(e);
}, this.getNewLineMode = function() {
return this.doc.getNewLineMode();
}, this.setUseWorker = function(e) {
this.setOption("useWorker", e);
}, this.getUseWorker = function() {
return this.$useWorker;
}, this.onReloadTokenizer = function(e) {
var t = e.data;
this.bgTokenizer.start(t.first), this._emit("tokenizerUpdate", e);
}, this.$modes = {}, this.$mode = null, this.$modeId = null, this.setMode = function(e, t) {
if (e && "object" == typeof e) {
if (e.getTokenizer) return this.$onChangeMode(e);
var n = e, i = n.path;
} else i = e || "ace/mode/text";
return this.$modes["ace/mode/text"] || (this.$modes["ace/mode/text"] = new a()),
this.$modes[i] && !n ? this.$onChangeMode(this.$modes[i]) : (this.$modeId = i, o.loadModule([ "mode", i ], function(e) {
return this.$modeId !== i ? t && t() : this.$modes[i] && !n ? this.$onChangeMode(this.$modes[i]) : (e && e.Mode && (e = new e.Mode(n),
n || (this.$modes[i] = e, e.$id = i), this.$onChangeMode(e), t && t(this.mode)),
void 0);
}.bind(this)), this.$mode || this.$onChangeMode(this.$modes["ace/mode/text"], !0),
void 0);
}, this.$onChangeMode = function(e, t) {
if (t || (this.$modeId = e.$id), this.$mode !== e) {
this.$mode = e, this.$stopWorker(), this.$useWorker && this.$startWorker();
var n = e.getTokenizer();
if (void 0 !== n.addEventListener) {
var i = this.onReloadTokenizer.bind(this);
n.addEventListener("update", i);
}
if (this.bgTokenizer) this.bgTokenizer.setTokenizer(n); else {
this.bgTokenizer = new u(n);
var o = this;
this.bgTokenizer.addEventListener("update", function(e) {
o._emit("tokenizerUpdate", e);
});
}
this.bgTokenizer.setDocument(this.getDocument()), this.tokenRe = e.tokenRe, this.nonTokenRe = e.nonTokenRe,
this.$options.wrapMethod.set.call(this, this.$wrapMethod), t || (this.$setFolding(e.foldingRules),
this._emit("changeMode"), this.bgTokenizer.start(0));
}
}, this.$stopWorker = function() {
this.$worker && this.$worker.terminate(), this.$worker = null;
}, this.$startWorker = function() {
if ("undefined" == typeof Worker || e.noWorker) this.$worker = null; else try {
this.$worker = this.$mode.createWorker(this);
} catch (t) {
console.log("Could not load worker"), console.log(t), this.$worker = null;
}
}, this.getMode = function() {
return this.$mode;
}, this.$scrollTop = 0, this.setScrollTop = function(e) {
this.$scrollTop === e || isNaN(e) || (this.$scrollTop = e, this._signal("changeScrollTop", e));
}, this.getScrollTop = function() {
return this.$scrollTop;
}, this.$scrollLeft = 0, this.setScrollLeft = function(e) {
this.$scrollLeft === e || isNaN(e) || (this.$scrollLeft = e, this._signal("changeScrollLeft", e));
}, this.getScrollLeft = function() {
return this.$scrollLeft;
}, this.getScreenWidth = function() {
return this.$computeWidth(), this.screenWidth;
}, this.$computeWidth = function(e) {
if (this.$modified || e) {
if (this.$modified = !1, this.$useWrapMode) return this.screenWidth = this.$wrapLimit;
for (var t = this.doc.getAllLines(), n = this.$rowLengthCache, i = 0, o = 0, r = this.$foldData[o], s = r ? r.start.row : 1/0, a = t.length, l = 0; a > l; l++) {
if (l > s) {
if (l = r.end.row + 1, l >= a) break;
r = this.$foldData[o++], s = r ? r.start.row : 1/0;
}
null == n[l] && (n[l] = this.$getStringScreenWidth(t[l])[0]), n[l] > i && (i = n[l]);
}
this.screenWidth = i;
}
}, this.getLine = function(e) {
return this.doc.getLine(e);
}, this.getLines = function(e, t) {
return this.doc.getLines(e, t);
}, this.getLength = function() {
return this.doc.getLength();
}, this.getTextRange = function(e) {
return this.doc.getTextRange(e || this.selection.getRange());
}, this.insert = function(e, t) {
return this.doc.insert(e, t);
}, this.remove = function(e) {
return this.doc.remove(e);
}, this.undoChanges = function(e, t) {
if (e.length) {
this.$fromUndo = !0;
for (var n = null, i = e.length - 1; -1 != i; i--) {
var o = e[i];
"doc" == o.group ? (this.doc.revertDeltas(o.deltas), n = this.$getUndoSelection(o.deltas, !0, n)) : o.deltas.forEach(function(e) {
this.addFolds(e.folds);
}, this);
}
return this.$fromUndo = !1, n && this.$undoSelect && !t && this.selection.setSelectionRange(n),
n;
}
}, this.redoChanges = function(e, t) {
if (e.length) {
this.$fromUndo = !0;
for (var n = null, i = 0; i < e.length; i++) {
var o = e[i];
"doc" == o.group && (this.doc.applyDeltas(o.deltas), n = this.$getUndoSelection(o.deltas, !1, n));
}
return this.$fromUndo = !1, n && this.$undoSelect && !t && this.selection.setSelectionRange(n),
n;
}
}, this.setUndoSelect = function(e) {
this.$undoSelect = e;
}, this.$getUndoSelection = function(e, t, n) {
function i(e) {
var n = "insertText" === e.action || "insertLines" === e.action;
return t ? !n : n;
}
var o, r, s = e[0], a = !1;
i(s) ? (o = l.fromPoints(s.range.start, s.range.end), a = !0) : (o = l.fromPoints(s.range.start, s.range.start),
a = !1);
for (var c = 1; c < e.length; c++) s = e[c], i(s) ? (r = s.range.start, -1 == o.compare(r.row, r.column) && o.setStart(s.range.start),
r = s.range.end, 1 == o.compare(r.row, r.column) && o.setEnd(s.range.end), a = !0) : (r = s.range.start,
-1 == o.compare(r.row, r.column) && (o = l.fromPoints(s.range.start, s.range.start)),
a = !1);
if (null != n) {
0 == l.comparePoints(n.start, o.start) && (n.start.column += o.end.column - o.start.column,
n.end.column += o.end.column - o.start.column);
var u = n.compareRange(o);
1 == u ? o.setStart(n.start) : -1 == u && o.setEnd(n.end);
}
return o;
}, this.replace = function(e, t) {
return this.doc.replace(e, t);
}, this.moveText = function(e, t, n) {
var i = this.getTextRange(e), o = this.getFoldsInRange(e), r = l.fromPoints(t, t);
if (!n) {
this.remove(e);
var s = e.start.row - e.end.row, a = s ? -e.end.column : e.start.column - e.end.column;
a && (r.start.row == e.end.row && r.start.column > e.end.column && (r.start.column += a),
r.end.row == e.end.row && r.end.column > e.end.column && (r.end.column += a)), s && r.start.row >= e.end.row && (r.start.row += s,
r.end.row += s);
}
if (this.insert(r.start, i), o.length) {
var c = e.start, u = r.start, s = u.row - c.row, a = u.column - c.column;
this.addFolds(o.map(function(e) {
return e = e.clone(), e.start.row == c.row && (e.start.column += a), e.end.row == c.row && (e.end.column += a),
e.start.row += s, e.end.row += s, e;
}));
}
return r;
}, this.indentRows = function(e, t, n) {
n = n.replace(/\t/g, this.getTabString());
for (var i = e; t >= i; i++) this.insert({
row: i,
column: 0
}, n);
}, this.outdentRows = function(e) {
for (var t = e.collapseRows(), n = new l(0, 0, 0, 0), i = this.getTabSize(), o = t.start.row; o <= t.end.row; ++o) {
var r = this.getLine(o);
n.start.row = o, n.end.row = o;
for (var s = 0; i > s && " " == r.charAt(s); ++s) ;
i > s && " " == r.charAt(s) ? (n.start.column = s, n.end.column = s + 1) : (n.start.column = 0,
n.end.column = s), this.remove(n);
}
}, this.$moveLines = function(e, t, n) {
if (e = this.getRowFoldStart(e), t = this.getRowFoldEnd(t), 0 > n) {
var i = this.getRowFoldStart(e + n);
if (0 > i) return 0;
var o = i - e;
} else if (n > 0) {
var i = this.getRowFoldEnd(t + n);
if (i > this.doc.getLength() - 1) return 0;
var o = i - t;
} else {
e = this.$clipRowToDocument(e), t = this.$clipRowToDocument(t);
var o = t - e + 1;
}
var r = new l(e, 0, t, Number.MAX_VALUE), s = this.getFoldsInRange(r).map(function(e) {
return e = e.clone(), e.start.row += o, e.end.row += o, e;
}), a = 0 == n ? this.doc.getLines(e, t) : this.doc.removeLines(e, t);
return this.doc.insertLines(e + o, a), s.length && this.addFolds(s), o;
}, this.moveLinesUp = function(e, t) {
return this.$moveLines(e, t, -1);
}, this.moveLinesDown = function(e, t) {
return this.$moveLines(e, t, 1);
}, this.duplicateLines = function(e, t) {
return this.$moveLines(e, t, 0);
}, this.$clipRowToDocument = function(e) {
return Math.max(0, Math.min(e, this.doc.getLength() - 1));
}, this.$clipColumnToRow = function(e, t) {
return 0 > t ? 0 : Math.min(this.doc.getLine(e).length, t);
}, this.$clipPositionToDocument = function(e, t) {
if (t = Math.max(0, t), 0 > e) e = 0, t = 0; else {
var n = this.doc.getLength();
e >= n ? (e = n - 1, t = this.doc.getLine(n - 1).length) : t = Math.min(this.doc.getLine(e).length, t);
}
return {
row: e,
column: t
};
}, this.$clipRangeToDocument = function(e) {
e.start.row < 0 ? (e.start.row = 0, e.start.column = 0) : e.start.column = this.$clipColumnToRow(e.start.row, e.start.column);
var t = this.doc.getLength() - 1;
return e.end.row > t ? (e.end.row = t, e.end.column = this.doc.getLine(t).length) : e.end.column = this.$clipColumnToRow(e.end.row, e.end.column),
e;
}, this.$wrapLimit = 80, this.$useWrapMode = !1, this.$wrapLimitRange = {
min: null,
max: null
}, this.setUseWrapMode = function(e) {
if (e != this.$useWrapMode) {
if (this.$useWrapMode = e, this.$modified = !0, this.$resetRowCache(0), e) {
var t = this.getLength();
this.$wrapData = [];
for (var n = 0; t > n; n++) this.$wrapData.push([]);
this.$updateWrapData(0, t - 1);
}
this._emit("changeWrapMode");
}
}, this.getUseWrapMode = function() {
return this.$useWrapMode;
}, this.setWrapLimitRange = function(e, t) {
(this.$wrapLimitRange.min !== e || this.$wrapLimitRange.max !== t) && (this.$wrapLimitRange = {
min: e,
max: t
}, this.$modified = !0, this._emit("changeWrapMode"));
}, this.adjustWrapLimit = function(e, t) {
var n = this.$wrapLimitRange;
n.max < 0 && (n = {
min: t,
max: t
});
var i = this.$constrainWrapLimit(e, n.min, n.max);
return i != this.$wrapLimit && i > 1 ? (this.$wrapLimit = i, this.$modified = !0,
this.$useWrapMode && (this.$updateWrapData(0, this.getLength() - 1), this.$resetRowCache(0),
this._emit("changeWrapLimit")), !0) : !1;
}, this.$constrainWrapLimit = function(e, t, n) {
return t && (e = Math.max(t, e)), n && (e = Math.min(n, e)), e;
}, this.getWrapLimit = function() {
return this.$wrapLimit;
}, this.setWrapLimit = function(e) {
this.setWrapLimitRange(e, e);
}, this.getWrapLimitRange = function() {
return {
min: this.$wrapLimitRange.min,
max: this.$wrapLimitRange.max
};
}, this.$updateInternalDataOnChange = function(e) {
var t, n = this.$useWrapMode, i = e.data.action, o = e.data.range.start.row, r = e.data.range.end.row, s = e.data.range.start, a = e.data.range.end, l = null;
if (-1 != i.indexOf("Lines") ? (r = "insertLines" == i ? o + e.data.lines.length : o,
t = e.data.lines ? e.data.lines.length : r - o) : t = r - o, this.$updating = !0,
0 != t) if (-1 != i.indexOf("remove")) {
this[n ? "$wrapData" : "$rowLengthCache"].splice(o, t);
var c = this.$foldData;
l = this.getFoldsInRange(e.data.range), this.removeFolds(l);
var u = this.getFoldLine(a.row), d = 0;
if (u) {
u.addRemoveChars(a.row, a.column, s.column - a.column), u.shiftRow(-t);
var h = this.getFoldLine(o);
h && h !== u && (h.merge(u), u = h), d = c.indexOf(u) + 1;
}
for (d; d < c.length; d++) {
var u = c[d];
u.start.row >= a.row && u.shiftRow(-t);
}
r = o;
} else {
var p;
if (n) {
p = [ o, 0 ];
for (var f = 0; t > f; f++) p.push([]);
this.$wrapData.splice.apply(this.$wrapData, p);
} else p = Array(t), p.unshift(o, 0), this.$rowLengthCache.splice.apply(this.$rowLengthCache, p);
var c = this.$foldData, u = this.getFoldLine(o), d = 0;
if (u) {
var g = u.range.compareInside(s.row, s.column);
0 == g ? (u = u.split(s.row, s.column), u.shiftRow(t), u.addRemoveChars(r, 0, a.column - s.column)) : -1 == g && (u.addRemoveChars(o, 0, a.column - s.column),
u.shiftRow(t)), d = c.indexOf(u) + 1;
}
for (d; d < c.length; d++) {
var u = c[d];
u.start.row >= o && u.shiftRow(t);
}
} else {
t = Math.abs(e.data.range.start.column - e.data.range.end.column), -1 != i.indexOf("remove") && (l = this.getFoldsInRange(e.data.range),
this.removeFolds(l), t = -t);
var u = this.getFoldLine(o);
u && u.addRemoveChars(o, s.column, t);
}
return n && this.$wrapData.length != this.doc.getLength() && console.error("doc.getLength() and $wrapData.length have to be the same!"),
this.$updating = !1, n ? this.$updateWrapData(o, r) : this.$updateRowLengthCache(o, r),
l;
}, this.$updateRowLengthCache = function(e, t) {
this.$rowLengthCache[e] = null, this.$rowLengthCache[t] = null;
}, this.$updateWrapData = function(e, t) {
var n, i, o = this.doc.getAllLines(), r = this.getTabSize(), s = this.$wrapData, a = this.$wrapLimit, l = e;
for (t = Math.min(t, o.length - 1); t >= l; ) i = this.getFoldLine(l, i), i ? (n = [],
i.walk(function(e, t, i, r) {
var s;
if (null != e) {
s = this.$getDisplayTokens(e, n.length), s[0] = h;
for (var a = 1; a < s.length; a++) s[a] = p;
} else s = this.$getDisplayTokens(o[t].substring(r, i), n.length);
n = n.concat(s);
}.bind(this), i.end.row, o[i.end.row].length + 1), s[i.start.row] = this.$computeWrapSplits(n, a, r),
l = i.end.row + 1) : (n = this.$getDisplayTokens(o[l]), s[l] = this.$computeWrapSplits(n, a, r),
l++);
};
var s = 1, c = 2, h = 3, p = 4, f = 9, g = 10, m = 11, v = 12;
this.$computeWrapSplits = function(e, t) {
function n(t) {
var n = e.slice(r, t), o = n.length;
n.join("").replace(/12/g, function() {
o -= 1;
}).replace(/2/g, function() {
o -= 1;
}), s += o, i.push(s), r = t;
}
if (0 == e.length) return [];
for (var i = [], o = e.length, r = 0, s = 0, a = this.$wrapAsCode; o - r > t; ) {
var l = r + t;
if (e[l - 1] >= g && e[l] >= g) n(l); else if (e[l] != h && e[l] != p) {
for (var c = Math.max(l - (a ? 10 : t - (t >> 2)), r - 1); l > c && e[l] < h; ) l--;
if (a) {
for (;l > c && e[l] < h; ) l--;
for (;l > c && e[l] == f; ) l--;
} else for (;l > c && e[l] < g; ) l--;
l > c ? n(++l) : (l = r + t, n(l));
} else {
for (l; l != r - 1 && e[l] != h; l--) ;
if (l > r) {
n(l);
continue;
}
for (l = r + t; l < e.length && e[l] == p; l++) ;
if (l == e.length) break;
n(l);
}
}
return i;
}, this.$getDisplayTokens = function(e, n) {
var i, o = [];
n = n || 0;
for (var r = 0; r < e.length; r++) {
var a = e.charCodeAt(r);
if (9 == a) {
i = this.getScreenTabSize(o.length + n), o.push(m);
for (var l = 1; i > l; l++) o.push(v);
} else 32 == a ? o.push(g) : a > 39 && 48 > a || a > 57 && 64 > a ? o.push(f) : a >= 4352 && t(a) ? o.push(s, c) : o.push(s);
}
return o;
}, this.$getStringScreenWidth = function(e, n, i) {
if (0 == n) return [ 0, 0 ];
null == n && (n = 1/0), i = i || 0;
var o, r;
for (r = 0; r < e.length && (o = e.charCodeAt(r), i += 9 == o ? this.getScreenTabSize(i) : o >= 4352 && t(o) ? 2 : 1,
!(i > n)); r++) ;
return [ i, r ];
}, this.getRowLength = function(e) {
return this.$useWrapMode && this.$wrapData[e] ? this.$wrapData[e].length + 1 : 1;
}, this.getScreenLastRowColumn = function(e) {
var t = this.screenToDocumentPosition(e, Number.MAX_VALUE);
return this.documentToScreenColumn(t.row, t.column);
}, this.getDocumentLastRowColumn = function(e, t) {
var n = this.documentToScreenRow(e, t);
return this.getScreenLastRowColumn(n);
}, this.getDocumentLastRowColumnPosition = function(e, t) {
var n = this.documentToScreenRow(e, t);
return this.screenToDocumentPosition(n, Number.MAX_VALUE / 10);
}, this.getRowSplitData = function(e) {
return this.$useWrapMode ? this.$wrapData[e] : void 0;
}, this.getScreenTabSize = function(e) {
return this.$tabSize - e % this.$tabSize;
}, this.screenToDocumentRow = function(e, t) {
return this.screenToDocumentPosition(e, t).row;
}, this.screenToDocumentColumn = function(e, t) {
return this.screenToDocumentPosition(e, t).column;
}, this.screenToDocumentPosition = function(e, t) {
if (0 > e) return {
row: 0,
column: 0
};
var n, i, o = 0, r = 0, s = 0, a = 0, l = this.$screenRowCache, c = this.$getRowCacheIndex(l, e), u = l.length;
if (u && c >= 0) var s = l[c], o = this.$docRowCache[c], d = e > l[u - 1]; else var d = !u;
for (var h = this.getLength() - 1, p = this.getNextFoldLine(o), f = p ? p.start.row : 1/0; e >= s && (a = this.getRowLength(o),
!(s + a - 1 >= e || o >= h)); ) s += a, o++, o > f && (o = p.end.row + 1, p = this.getNextFoldLine(o, p),
f = p ? p.start.row : 1/0), d && (this.$docRowCache.push(o), this.$screenRowCache.push(s));
if (p && p.start.row <= o) n = this.getFoldDisplayLine(p), o = p.start.row; else {
if (e >= s + a || o > h) return {
row: h,
column: this.getLine(h).length
};
n = this.getLine(o), p = null;
}
if (this.$useWrapMode) {
var g = this.$wrapData[o];
g && (i = g[e - s], e > s && g.length && (r = g[e - s - 1] || g[g.length - 1], n = n.substring(r)));
}
return r += this.$getStringScreenWidth(n, t)[1], this.$useWrapMode && r >= i && (r = i - 1),
p ? p.idxToPosition(r) : {
row: o,
column: r
};
}, this.documentToScreenPosition = function(e, t) {
if ("undefined" == typeof t) var n = this.$clipPositionToDocument(e.row, e.column); else n = this.$clipPositionToDocument(e, t);
e = n.row, t = n.column;
var i = 0, o = null, r = null;
r = this.getFoldAt(e, t, 1), r && (e = r.start.row, t = r.start.column);
var s, a = 0, l = this.$docRowCache, c = this.$getRowCacheIndex(l, e), u = l.length;
if (u && c >= 0) var a = l[c], i = this.$screenRowCache[c], d = e > l[u - 1]; else var d = !u;
for (var h = this.getNextFoldLine(a), p = h ? h.start.row : 1/0; e > a; ) {
if (a >= p) {
if (s = h.end.row + 1, s > e) break;
h = this.getNextFoldLine(s, h), p = h ? h.start.row : 1/0;
} else s = a + 1;
i += this.getRowLength(a), a = s, d && (this.$docRowCache.push(a), this.$screenRowCache.push(i));
}
var f = "";
if (h && a >= p ? (f = this.getFoldDisplayLine(h, e, t), o = h.start.row) : (f = this.getLine(e).substring(0, t),
o = e), this.$useWrapMode) {
for (var g = this.$wrapData[o], m = 0; f.length >= g[m]; ) i++, m++;
f = f.substring(g[m - 1] || 0, f.length);
}
return {
row: i,
column: this.$getStringScreenWidth(f)[0]
};
}, this.documentToScreenColumn = function(e, t) {
return this.documentToScreenPosition(e, t).column;
}, this.documentToScreenRow = function(e, t) {
return this.documentToScreenPosition(e, t).row;
}, this.getScreenLength = function() {
var e = 0, t = null;
if (this.$useWrapMode) for (var n = this.$wrapData.length, i = 0, o = 0, t = this.$foldData[o++], r = t ? t.start.row : 1/0; n > i; ) e += this.$wrapData[i].length + 1,
i++, i > r && (i = t.end.row + 1, t = this.$foldData[o++], r = t ? t.start.row : 1/0); else {
e = this.getLength();
for (var s = this.$foldData, o = 0; o < s.length; o++) t = s[o], e -= t.end.row - t.start.row;
}
return e;
};
}).call(h.prototype), e("./edit_session/folding").Folding.call(h.prototype), e("./edit_session/bracket_match").BracketMatch.call(h.prototype),
o.defineOptions(h.prototype, "session", {
wrap: {
set: function(e) {
if (e && "off" != e ? "free" == e ? e = !0 : "printMargin" == e ? e = -1 : "string" == typeof e && (e = parseInt(e, 10) || !1) : e = !1,
this.$wrap != e) {
if (e) {
var t = "number" == typeof e ? e : null;
this.setWrapLimitRange(t, t), this.setUseWrapMode(!0);
} else this.setUseWrapMode(!1);
this.$wrap = e;
}
},
get: function() {
return this.getUseWrapMode() ? this.getWrapLimitRange().min || "free" : "off";
},
handlesSet: !0
},
wrapMethod: {
set: function(e) {
this.$wrapAsCode = "auto" == e ? "text" != this.$mode.type : "text" != e;
},
initialValue: "auto"
},
firstLineNumber: {
set: function() {
this._emit("changeBreakpoint");
},
initialValue: 1
},
useWorker: {
set: function(e) {
this.$useWorker = e, this.$stopWorker(), e && this.$startWorker();
},
initialValue: !0
},
useSoftTabs: {
initialValue: !0
},
tabSize: {
set: function(e) {
isNaN(e) || this.$tabSize === e || (this.$modified = !0, this.$rowLengthCache = [],
this.$tabSize = e, this._emit("changeTabSize"));
},
initialValue: 4,
handlesSet: !0
},
overwrite: {
set: function() {
this._emit("changeOverwrite");
},
initialValue: !1
},
newLineMode: {
set: function(e) {
this.doc.setNewLineMode(e);
},
get: function() {
return this.doc.getNewLineMode();
},
handlesSet: !0
}
}), t.EditSession = h;
}), define("ace/search", [ "require", "exports", "module", "./lib/lang", "./lib/oop", "./range" ], function(e, t) {
var n = e("./lib/lang"), i = e("./lib/oop"), o = e("./range").Range, r = function() {
this.$options = {};
};
(function() {
this.set = function(e) {
return i.mixin(this.$options, e), this;
}, this.getOptions = function() {
return n.copyObject(this.$options);
}, this.setOptions = function(e) {
this.$options = e;
}, this.find = function(e) {
var t = this.$matchIterator(e, this.$options);
if (!t) return !1;
var n = null;
return t.forEach(function(e, t, i) {
if (e.start) n = e; else {
var r = e.offset + (i || 0);
n = new o(t, r, t, r + e.length);
}
return !0;
}), n;
}, this.findAll = function(e) {
var t = this.$options;
if (!t.needle) return [];
this.$assembleRegExp(t);
var i = t.range, r = i ? e.getLines(i.start.row, i.end.row) : e.doc.getAllLines(), s = [], a = t.re;
if (t.$isMultiLine) for (var l = a.length, c = r.length - l, u = a.offset || 0; c >= u; u++) {
for (var d = 0; l > d && -1 != r[u + d].search(a[d]); d++) ;
var h = r[u], p = r[u + l - 1], f = h.match(a[0])[0].length, g = p.match(a[l - 1])[0].length;
s.push(new o(u, h.length - f, u + l - 1, g));
} else for (var m = 0; m < r.length; m++) for (var v = n.getMatchOffsets(r[m], a), d = 0; d < v.length; d++) {
var b = v[d];
s.push(new o(m, b.offset, m, b.offset + b.length));
}
if (i) {
for (var y = i.start.column, w = i.start.column, m = 0, d = s.length - 1; d > m && s[m].start.column < y && s[m].start.row == i.start.row; ) m++;
for (;d > m && s[d].end.column > w && s[d].end.row == i.end.row; ) d--;
for (s = s.slice(m, d + 1), m = 0, d = s.length; d > m; m++) s[m].start.row += i.start.row,
s[m].end.row += i.start.row;
}
return s;
}, this.replace = function(e, t) {
var n = this.$options, i = this.$assembleRegExp(n);
if (n.$isMultiLine) return t;
if (i) {
var o = i.exec(e);
if (!o || o[0].length != e.length) return null;
if (t = e.replace(i, t), n.preserveCase) {
t = t.split("");
for (var r = Math.min(e.length, e.length); r--; ) {
var s = e[r];
t[r] = s && s.toLowerCase() != s ? t[r].toUpperCase() : t[r].toLowerCase();
}
t = t.join("");
}
return t;
}
}, this.$matchIterator = function(e, t) {
var i = this.$assembleRegExp(t);
if (!i) return !1;
var r, s = this, a = t.backwards;
if (t.$isMultiLine) var l = i.length, c = function(t, n, s) {
var a = t.search(i[0]);
if (-1 != a) {
for (var c = 1; l > c; c++) if (t = e.getLine(n + c), -1 == t.search(i[c])) return;
var u = t.match(i[l - 1])[0].length, d = new o(n, a, n + l - 1, u);
return 1 == i.offset ? (d.start.row--, d.start.column = Number.MAX_VALUE) : s && (d.start.column += s),
r(d) ? !0 : void 0;
}
}; else if (a) var c = function(e, t, o) {
for (var s = n.getMatchOffsets(e, i), a = s.length - 1; a >= 0; a--) if (r(s[a], t, o)) return !0;
}; else var c = function(e, t, o) {
for (var s = n.getMatchOffsets(e, i), a = 0; a < s.length; a++) if (r(s[a], t, o)) return !0;
};
return {
forEach: function(n) {
r = n, s.$lineIterator(e, t).forEach(c);
}
};
}, this.$assembleRegExp = function(e, t) {
if (e.needle instanceof RegExp) return e.re = e.needle;
var i = e.needle;
if (!e.needle) return e.re = !1;
e.regExp || (i = n.escapeRegExp(i)), e.wholeWord && (i = "\\b" + i + "\\b");
var o = e.caseSensitive ? "g" : "gi";
if (e.$isMultiLine = !t && /[\n\r]/.test(i), e.$isMultiLine) return e.re = this.$assembleMultilineRegExp(i, o);
try {
var r = new RegExp(i, o);
} catch (s) {
r = !1;
}
return e.re = r;
}, this.$assembleMultilineRegExp = function(e, t) {
for (var n = e.replace(/\r\n|\r|\n/g, "$\n^").split("\n"), i = [], o = 0; o < n.length; o++) try {
i.push(new RegExp(n[o], t));
} catch (r) {
return !1;
}
return "" == n[0] ? (i.shift(), i.offset = 1) : i.offset = 0, i;
}, this.$lineIterator = function(e, t) {
var n = 1 == t.backwards, i = 0 != t.skipCurrent, o = t.range, r = t.start;
r || (r = o ? o[n ? "end" : "start"] : e.selection.getRange()), r.start && (r = r[i != n ? "end" : "start"]);
var s = o ? o.start.row : 0, a = o ? o.end.row : e.getLength() - 1, l = n ? function(n) {
var i = r.row, o = e.getLine(i).substring(0, r.column);
if (!n(o, i)) {
for (i--; i >= s; i--) if (n(e.getLine(i), i)) return;
if (0 != t.wrap) for (i = a, s = r.row; i >= s; i--) if (n(e.getLine(i), i)) return;
}
} : function(n) {
var i = r.row, o = e.getLine(i).substr(r.column);
if (!n(o, i, r.column)) {
for (i += 1; a >= i; i++) if (n(e.getLine(i), i)) return;
if (0 != t.wrap) for (i = s, a = r.row; a >= i; i++) if (n(e.getLine(i), i)) return;
}
};
return {
forEach: l
};
};
}).call(r.prototype), t.Search = r;
}), define("ace/keyboard/hash_handler", [ "require", "exports", "module", "../lib/keys", "../lib/useragent" ], function(e, t) {
function n(e, t) {
this.platform = t || (o.isMac ? "mac" : "win"), this.commands = {}, this.commmandKeyBinding = {},
this.addCommands(e);
}
var i = e("../lib/keys"), o = e("../lib/useragent");
(function() {
this.addCommand = function(e) {
this.commands[e.name] && this.removeCommand(e), this.commands[e.name] = e, e.bindKey && this._buildKeyHash(e);
}, this.removeCommand = function(e) {
var t = "string" == typeof e ? e : e.name;
e = this.commands[t], delete this.commands[t];
var n = this.commmandKeyBinding;
for (var i in n) for (var o in n[i]) n[i][o] == e && delete n[i][o];
}, this.bindKey = function(e, t) {
if (e) {
if ("function" == typeof t) return this.addCommand({
exec: t,
bindKey: e,
name: t.name || e
}), void 0;
var n = this.commmandKeyBinding;
e.split("|").forEach(function(e) {
var i = this.parseKeys(e, t), o = i.hashId;
(n[o] || (n[o] = {}))[i.key] = t;
}, this);
}
}, this.addCommands = function(e) {
e && Object.keys(e).forEach(function(t) {
var n = e[t];
if (n) {
if ("string" == typeof n) return this.bindKey(n, t);
"function" == typeof n && (n = {
exec: n
}), n.name || (n.name = t), this.addCommand(n);
}
}, this);
}, this.removeCommands = function(e) {
Object.keys(e).forEach(function(t) {
this.removeCommand(e[t]);
}, this);
}, this.bindKeys = function(e) {
Object.keys(e).forEach(function(t) {
this.bindKey(t, e[t]);
}, this);
}, this._buildKeyHash = function(e) {
var t = e.bindKey;
if (t) {
var n = "string" == typeof t ? t : t[this.platform];
this.bindKey(n, e);
}
}, this.parseKeys = function(e) {
-1 != e.indexOf(" ") && (e = e.split(/\s+/).pop());
var t = e.toLowerCase().split(/[\-\+]([\-\+])?/).filter(function(e) {
return e;
}), n = t.pop(), o = i[n];
if (i.FUNCTION_KEYS[o]) n = i.FUNCTION_KEYS[o].toLowerCase(); else {
if (!t.length) return {
key: n,
hashId: -1
};
if (1 == t.length && "shift" == t[0]) return {
key: n.toUpperCase(),
hashId: -1
};
}
for (var r = 0, s = t.length; s--; ) {
var a = i.KEY_MODS[t[s]];
if (null == a) return "undefined" != typeof console && console.error("invalid modifier " + t[s] + " in " + e),
!1;
r |= a;
}
return {
key: n,
hashId: r
};
}, this.findKeyCommand = function(e, t) {
var n = this.commmandKeyBinding;
return n[e] && n[e][t];
}, this.handleKeyboard = function(e, t, n) {
return {
command: this.findKeyCommand(t, n)
};
};
}).call(n.prototype), t.HashHandler = n;
}), define("ace/commands/command_manager", [ "require", "exports", "module", "../lib/oop", "../keyboard/hash_handler", "../lib/event_emitter" ], function(e, t) {
var n = e("../lib/oop"), i = e("../keyboard/hash_handler").HashHandler, o = e("../lib/event_emitter").EventEmitter, r = function(e, t) {
this.platform = e, this.commands = this.byName = {}, this.commmandKeyBinding = {},
this.addCommands(t), this.setDefaultHandler("exec", function(e) {
return e.command.exec(e.editor, e.args || {});
});
};
n.inherits(r, i), function() {
n.implement(this, o), this.exec = function(e, t, n) {
if ("string" == typeof e && (e = this.commands[e]), !e) return !1;
if (t && t.$readOnly && !e.readOnly) return !1;
var i = {
editor: t,
command: e,
args: n
}, o = this._emit("exec", i);
return this._signal("afterExec", i), o === !1 ? !1 : !0;
}, this.toggleRecording = function(e) {
return this.$inReplay ? void 0 : (e && e._emit("changeStatus"), this.recording ? (this.macro.pop(),
this.removeEventListener("exec", this.$addCommandToMacro), this.macro.length || (this.macro = this.oldMacro),
this.recording = !1) : (this.$addCommandToMacro || (this.$addCommandToMacro = function(e) {
this.macro.push([ e.command, e.args ]);
}.bind(this)), this.oldMacro = this.macro, this.macro = [], this.on("exec", this.$addCommandToMacro),
this.recording = !0));
}, this.replay = function(e) {
if (!this.$inReplay && this.macro) {
if (this.recording) return this.toggleRecording(e);
try {
this.$inReplay = !0, this.macro.forEach(function(t) {
"string" == typeof t ? this.exec(t, e) : this.exec(t[0], e, t[1]);
}, this);
} finally {
this.$inReplay = !1;
}
}
}, this.trimMacro = function(e) {
return e.map(function(e) {
return "string" != typeof e[0] && (e[0] = e[0].name), e[1] || (e = e[0]), e;
});
};
}.call(r.prototype), t.CommandManager = r;
}), define("ace/commands/default_commands", [ "require", "exports", "module", "ace/lib/lang", "ace/config" ], function(e, t) {
function n(e, t) {
return {
win: e,
mac: t
};
}
var i = e("ace/lib/lang"), o = e("ace/config");
t.commands = [ {
name: "selectall",
bindKey: n("Ctrl-A", "Command-A"),
exec: function(e) {
e.selectAll();
},
readOnly: !0
}, {
name: "find",
bindKey: n("Ctrl-F", "Command-F"),
exec: function(e) {
o.loadModule("ace/ext/searchbox", function(t) {
t.Search(e);
});
},
readOnly: !0
}, {
name: "overwrite",
bindKey: "Insert",
exec: function(e) {
e.toggleOverwrite();
},
readOnly: !0
}, {
name: "selecttostart",
bindKey: n("Ctrl-Shift-Home", "Command-Shift-Up"),
exec: function(e) {
e.getSelection().selectFileStart();
},
multiSelectAction: "forEach",
readOnly: !0
}, {
name: "gotostart",
bindKey: n("Ctrl-Home", "Command-Home|Command-Up"),
exec: function(e) {
e.navigateFileStart();
},
multiSelectAction: "forEach",
readOnly: !0
}, {
name: "selectup",
bindKey: n("Shift-Up", "Shift-Up"),
exec: function(e) {
e.getSelection().selectUp();
},
multiSelectAction: "forEach",
readOnly: !0
}, {
name: "golineup",
bindKey: n("Up", "Up|Ctrl-P"),
exec: function(e, t) {
e.navigateUp(t.times);
},
multiSelectAction: "forEach",
readOnly: !0
}, {
name: "selecttoend",
bindKey: n("Ctrl-Shift-End", "Command-Shift-Down"),
exec: function(e) {
e.getSelection().selectFileEnd();
},
multiSelectAction: "forEach",
readOnly: !0
}, {
name: "gotoend",
bindKey: n("Ctrl-End", "Command-End|Command-Down"),
exec: function(e) {
e.navigateFileEnd();
},
multiSelectAction: "forEach",
readOnly: !0
}, {
name: "selectdown",
bindKey: n("Shift-Down", "Shift-Down"),
exec: function(e) {
e.getSelection().selectDown();
},
multiSelectAction: "forEach",
readOnly: !0
}, {
name: "golinedown",
bindKey: n("Down", "Down|Ctrl-N"),
exec: function(e, t) {
e.navigateDown(t.times);
},
multiSelectAction: "forEach",
readOnly: !0
}, {
name: "selectwordleft",
bindKey: n("Ctrl-Shift-Left", "Option-Shift-Left"),
exec: function(e) {
e.getSelection().selectWordLeft();
},
multiSelectAction: "forEach",
readOnly: !0
}, {
name: "gotowordleft",
bindKey: n("Ctrl-Left", "Option-Left"),
exec: function(e) {
e.navigateWordLeft();
},
multiSelectAction: "forEach",
readOnly: !0
}, {
name: "selecttolinestart",
bindKey: n("Alt-Shift-Left", "Command-Shift-Left"),
exec: function(e) {
e.getSelection().selectLineStart();
},
multiSelectAction: "forEach",
readOnly: !0
}, {
name: "gotolinestart",
bindKey: n("Alt-Left|Home", "Command-Left|Home|Ctrl-A"),
exec: function(e) {
e.navigateLineStart();
},
multiSelectAction: "forEach",
readOnly: !0
}, {
name: "selectleft",
bindKey: n("Shift-Left", "Shift-Left"),
exec: function(e) {
e.getSelection().selectLeft();
},
multiSelectAction: "forEach",
readOnly: !0
}, {
name: "gotoleft",
bindKey: n("Left", "Left|Ctrl-B"),
exec: function(e, t) {
e.navigateLeft(t.times);
},
multiSelectAction: "forEach",
readOnly: !0
}, {
name: "selectwordright",
bindKey: n("Ctrl-Shift-Right", "Option-Shift-Right"),
exec: function(e) {
e.getSelection().selectWordRight();
},
multiSelectAction: "forEach",
readOnly: !0
}, {
name: "gotowordright",
bindKey: n("Ctrl-Right", "Option-Right"),
exec: function(e) {
e.navigateWordRight();
},
multiSelectAction: "forEach",
readOnly: !0
}, {
name: "selecttolineend",
bindKey: n("Alt-Shift-Right", "Command-Shift-Right"),
exec: function(e) {
e.getSelection().selectLineEnd();
},
multiSelectAction: "forEach",
readOnly: !0
}, {
name: "gotolineend",
bindKey: n("Alt-Right|End", "Command-Right|End|Ctrl-E"),
exec: function(e) {
e.navigateLineEnd();
},
multiSelectAction: "forEach",
readOnly: !0
}, {
name: "selectright",
bindKey: n("Shift-Right", "Shift-Right"),
exec: function(e) {
e.getSelection().selectRight();
},
multiSelectAction: "forEach",
readOnly: !0
}, {
name: "gotoright",
bindKey: n("Right", "Right|Ctrl-F"),
exec: function(e, t) {
e.navigateRight(t.times);
},
multiSelectAction: "forEach",
readOnly: !0
}, {
name: "selectpagedown",
bindKey: "Shift-PageDown",
exec: function(e) {
e.selectPageDown();
},
readOnly: !0
}, {
name: "pagedown",
bindKey: n(null, "Option-PageDown"),
exec: function(e) {
e.scrollPageDown();
},
readOnly: !0
}, {
name: "gotopagedown",
bindKey: n("PageDown", "PageDown|Ctrl-V"),
exec: function(e) {
e.gotoPageDown();
},
readOnly: !0
}, {
name: "selectpageup",
bindKey: "Shift-PageUp",
exec: function(e) {
e.selectPageUp();
},
readOnly: !0
}, {
name: "pageup",
bindKey: n(null, "Option-PageUp"),
exec: function(e) {
e.scrollPageUp();
},
readOnly: !0
}, {
name: "gotopageup",
bindKey: "PageUp",
exec: function(e) {
e.gotoPageUp();
},
readOnly: !0
}, {
name: "scrollup",
bindKey: n("Ctrl-Up", null),
exec: function(e) {
e.renderer.scrollBy(0, -2 * e.renderer.layerConfig.lineHeight);
},
readOnly: !0
}, {
name: "scrolldown",
bindKey: n("Ctrl-Down", null),
exec: function(e) {
e.renderer.scrollBy(0, 2 * e.renderer.layerConfig.lineHeight);
},
readOnly: !0
}, {
name: "selectlinestart",
bindKey: "Shift-Home",
exec: function(e) {
e.getSelection().selectLineStart();
},
multiSelectAction: "forEach",
readOnly: !0
}, {
name: "selectlineend",
bindKey: "Shift-End",
exec: function(e) {
e.getSelection().selectLineEnd();
},
multiSelectAction: "forEach",
readOnly: !0
}, {
name: "togglerecording",
bindKey: n("Ctrl-Alt-E", "Command-Option-E"),
exec: function(e) {
e.commands.toggleRecording(e);
},
readOnly: !0
}, {
name: "replaymacro",
bindKey: n("Ctrl-Shift-E", "Command-Shift-E"),
exec: function(e) {
e.commands.replay(e);
},
readOnly: !0
}, {
name: "jumptomatching",
bindKey: n("Ctrl-P", "Ctrl-Shift-P"),
exec: function(e) {
e.jumpToMatching();
},
multiSelectAction: "forEach",
readOnly: !0
}, {
name: "selecttomatching",
bindKey: n("Ctrl-Shift-P", null),
exec: function(e) {
e.jumpToMatching(!0);
},
multiSelectAction: "forEach",
readOnly: !0
}, {
name: "cut",
exec: function(e) {
var t = e.getSelectionRange();
e._emit("cut", t), e.selection.isEmpty() || (e.session.remove(t), e.clearSelection());
},
multiSelectAction: "forEach"
}, {
name: "removeline",
bindKey: n("Ctrl-D", "Command-D"),
exec: function(e) {
e.removeLines();
},
multiSelectAction: "forEachLine"
}, {
name: "duplicateSelection",
bindKey: n("Ctrl-Shift-D", "Command-Shift-D"),
exec: function(e) {
e.duplicateSelection();
},
multiSelectAction: "forEach"
}, {
name: "sortlines",
bindKey: n("Ctrl-Alt-S", "Command-Alt-S"),
exec: function(e) {
e.sortLines();
},
multiSelectAction: "forEachLine"
}, {
name: "togglecomment",
bindKey: n("Ctrl-/", "Command-/"),
exec: function(e) {
e.toggleCommentLines();
},
multiSelectAction: "forEachLine"
}, {
name: "toggleBlockComment",
bindKey: n("Ctrl-Shift-/", "Command-Shift-/"),
exec: function(e) {
e.toggleBlockComment();
},
multiSelectAction: "forEach"
}, {
name: "modifyNumberUp",
bindKey: n("Ctrl-Shift-Up", "Alt-Shift-Up"),
exec: function(e) {
e.modifyNumber(1);
},
multiSelectAction: "forEach"
}, {
name: "modifyNumberDown",
bindKey: n("Ctrl-Shift-Down", "Alt-Shift-Down"),
exec: function(e) {
e.modifyNumber(-1);
},
multiSelectAction: "forEach"
}, {
name: "replace",
bindKey: n("Ctrl-H", "Command-Option-F"),
exec: function(e) {
o.loadModule("ace/ext/searchbox", function(t) {
t.Search(e, !0);
});
}
}, {
name: "undo",
bindKey: n("Ctrl-Z", "Command-Z"),
exec: function(e) {
e.undo();
}
}, {
name: "redo",
bindKey: n("Ctrl-Shift-Z|Ctrl-Y", "Command-Shift-Z|Command-Y"),
exec: function(e) {
e.redo();
}
}, {
name: "copylinesup",
bindKey: n("Alt-Shift-Up", "Command-Option-Up"),
exec: function(e) {
e.copyLinesUp();
}
}, {
name: "movelinesup",
bindKey: n("Alt-Up", "Option-Up"),
exec: function(e) {
e.moveLinesUp();
}
}, {
name: "copylinesdown",
bindKey: n("Alt-Shift-Down", "Command-Option-Down"),
exec: function(e) {
e.copyLinesDown();
}
}, {
name: "movelinesdown",
bindKey: n("Alt-Down", "Option-Down"),
exec: function(e) {
e.moveLinesDown();
}
}, {
name: "del",
bindKey: n("Delete", "Delete|Ctrl-D"),
exec: function(e) {
e.remove("right");
},
multiSelectAction: "forEach"
}, {
name: "backspace",
bindKey: n("Command-Backspace|Option-Backspace|Shift-Backspace|Backspace", "Ctrl-Backspace|Command-Backspace|Shift-Backspace|Backspace|Ctrl-H"),
exec: function(e) {
e.remove("left");
},
multiSelectAction: "forEach"
}, {
name: "removetolinestart",
bindKey: n("Alt-Backspace", "Command-Backspace"),
exec: function(e) {
e.removeToLineStart();
},
multiSelectAction: "forEach"
}, {
name: "removetolineend",
bindKey: n("Alt-Delete", "Ctrl-K"),
exec: function(e) {
e.removeToLineEnd();
},
multiSelectAction: "forEach"
}, {
name: "removewordleft",
bindKey: n("Ctrl-Backspace", "Alt-Backspace|Ctrl-Alt-Backspace"),
exec: function(e) {
e.removeWordLeft();
},
multiSelectAction: "forEach"
}, {
name: "removewordright",
bindKey: n("Ctrl-Delete", "Alt-Delete"),
exec: function(e) {
e.removeWordRight();
},
multiSelectAction: "forEach"
}, {
name: "outdent",
bindKey: n("Shift-Tab", "Shift-Tab"),
exec: function(e) {
e.blockOutdent();
},
multiSelectAction: "forEach"
}, {
name: "indent",
bindKey: n("Tab", "Tab"),
exec: function(e) {
e.indent();
},
multiSelectAction: "forEach"
}, {
name: "insertstring",
exec: function(e, t) {
e.insert(t);
},
multiSelectAction: "forEach"
}, {
name: "inserttext",
exec: function(e, t) {
e.insert(i.stringRepeat(t.text || "", t.times || 1));
},
multiSelectAction: "forEach"
}, {
name: "splitline",
bindKey: n(null, "Ctrl-O"),
exec: function(e) {
e.splitLine();
},
multiSelectAction: "forEach"
}, {
name: "transposeletters",
bindKey: n("Ctrl-T", "Ctrl-T"),
exec: function(e) {
e.transposeLetters();
},
multiSelectAction: function(e) {
e.transposeSelections(1);
}
}, {
name: "touppercase",
bindKey: n("Ctrl-U", "Ctrl-U"),
exec: function(e) {
e.toUpperCase();
},
multiSelectAction: "forEach"
}, {
name: "tolowercase",
bindKey: n("Ctrl-Shift-U", "Ctrl-Shift-U"),
exec: function(e) {
e.toLowerCase();
},
multiSelectAction: "forEach"
} ];
}), define("ace/editor", [ "require", "exports", "module", "./lib/fixoldbrowsers", "./lib/oop", "./lib/dom", "./lib/lang", "./lib/useragent", "./keyboard/textinput", "./mouse/mouse_handler", "./mouse/fold_handler", "./keyboard/keybinding", "./edit_session", "./search", "./range", "./lib/event_emitter", "./commands/command_manager", "./commands/default_commands", "./config" ], function(e, t) {
e("./lib/fixoldbrowsers");
var n = e("./lib/oop"), i = e("./lib/dom"), o = e("./lib/lang"), r = e("./lib/useragent"), s = e("./keyboard/textinput").TextInput, a = e("./mouse/mouse_handler").MouseHandler, l = e("./mouse/fold_handler").FoldHandler, c = e("./keyboard/keybinding").KeyBinding, u = e("./edit_session").EditSession, d = e("./search").Search, h = e("./range").Range, p = e("./lib/event_emitter").EventEmitter, f = e("./commands/command_manager").CommandManager, g = e("./commands/default_commands").commands, m = e("./config"), v = function(e, t) {
var n = e.getContainerElement();
this.container = n, this.renderer = e, this.commands = new f(r.isMac ? "mac" : "win", g),
this.textInput = new s(e.getTextAreaContainer(), this), this.renderer.textarea = this.textInput.getElement(),
this.keyBinding = new c(this), this.$mouseHandler = new a(this), new l(this), this.$blockScrolling = 0,
this.$search = new d().set({
wrap: !0
}), this.$historyTracker = this.$historyTracker.bind(this), this.commands.on("exec", this.$historyTracker),
this.$initOperationListeners(), this._$emitInputEvent = o.delayedCall(function() {
this._signal("input", {}), this.session.bgTokenizer && this.session.bgTokenizer.scheduleStart();
}.bind(this)), this.on("change", function(e, t) {
t._$emitInputEvent.schedule(31);
}), this.setSession(t || new u("")), m.resetOptions(this), m._emit("editor", this);
};
(function() {
n.implement(this, p), this.$initOperationListeners = function() {
function e(e) {
return e[e.length - 1];
}
this.selections = [], this.commands.on("exec", function(t) {
this.startOperation(t);
var n = t.command;
if ("fileJump" == n.group) {
var i = this.prevOp;
i && "fileJump" == i.command.group || (this.lastFileJumpPos = e(this.selections));
} else this.lastFileJumpPos = null;
}.bind(this), !0), this.commands.on("afterExec", function(e) {
var t = e.command;
return "fileJump" == t.group && this.lastFileJumpPos && !this.curOp.selectionChanged ? (this.selection.fromJSON(this.lastFileJumpPos),
void 0) : (this.endOperation(e), void 0);
}.bind(this), !0), this.$opResetTimer = o.delayedCall(this.endOperation.bind(this)),
this.on("change", function() {
this.curOp || this.startOperation(), this.curOp.docChanged = !0;
}.bind(this), !0), this.on("changeSelection", function() {
this.curOp || this.startOperation(), this.curOp.selectionChanged = !0;
}.bind(this), !0);
}, this.curOp = null, this.prevOp = {}, this.startOperation = function(e) {
if (this.curOp) {
if (!e || this.curOp.command) return;
this.prevOp = this.curOp;
}
e || (this.previousCommand = null, e = {}), this.$opResetTimer.schedule(), this.curOp = {
command: e.command || {},
args: e.args
}, this.selections.push(this.selection.toJSON());
}, this.endOperation = function() {
this.curOp && (this.prevOp = this.curOp, this.curOp = null);
}, this.$historyTracker = function(e) {
if (this.$mergeUndoDeltas) {
var t = this.prevOp, n = [ "backspace", "del", "insertstring" ], i = t.command && e.command.name == t.command.name;
if ("insertstring" == e.command.name) {
var o = e.args;
void 0 === this.mergeNextCommand && (this.mergeNextCommand = !0), i = i && this.mergeNextCommand && (!/\s/.test(o) || /\s/.test(t.args)),
this.mergeNextCommand = !0;
} else i = i && -1 !== n.indexOf(e.command.name);
"always" != this.$mergeUndoDeltas && Date.now() - this.sequenceStartTime > 2e3 && (i = !1),
i ? this.session.mergeUndoDeltas = !0 : -1 !== n.indexOf(e.command.name) && (this.sequenceStartTime = Date.now());
}
}, this.setKeyboardHandler = function(e) {
if (e) if ("string" == typeof e) {
this.$keybindingId = e;
var t = this;
m.loadModule([ "keybinding", e ], function(n) {
t.$keybindingId == e && t.keyBinding.setKeyboardHandler(n && n.handler);
});
} else this.$keybindingId = null, this.keyBinding.setKeyboardHandler(e); else this.keyBinding.setKeyboardHandler(null);
}, this.getKeyboardHandler = function() {
return this.keyBinding.getKeyboardHandler();
}, this.setSession = function(e) {
if (this.session != e) {
if (this.session) {
var t = this.session;
this.session.removeEventListener("change", this.$onDocumentChange), this.session.removeEventListener("changeMode", this.$onChangeMode),
this.session.removeEventListener("tokenizerUpdate", this.$onTokenizerUpdate), this.session.removeEventListener("changeTabSize", this.$onChangeTabSize),
this.session.removeEventListener("changeWrapLimit", this.$onChangeWrapLimit), this.session.removeEventListener("changeWrapMode", this.$onChangeWrapMode),
this.session.removeEventListener("onChangeFold", this.$onChangeFold), this.session.removeEventListener("changeFrontMarker", this.$onChangeFrontMarker),
this.session.removeEventListener("changeBackMarker", this.$onChangeBackMarker),
this.session.removeEventListener("changeBreakpoint", this.$onChangeBreakpoint),
this.session.removeEventListener("changeAnnotation", this.$onChangeAnnotation),
this.session.removeEventListener("changeOverwrite", this.$onCursorChange), this.session.removeEventListener("changeScrollTop", this.$onScrollTopChange),
this.session.removeEventListener("changeScrollLeft", this.$onScrollLeftChange);
var n = this.session.getSelection();
n.removeEventListener("changeCursor", this.$onCursorChange), n.removeEventListener("changeSelection", this.$onSelectionChange);
}
this.session = e, this.$onDocumentChange = this.onDocumentChange.bind(this), e.addEventListener("change", this.$onDocumentChange),
this.renderer.setSession(e), this.$onChangeMode = this.onChangeMode.bind(this),
e.addEventListener("changeMode", this.$onChangeMode), this.$onTokenizerUpdate = this.onTokenizerUpdate.bind(this),
e.addEventListener("tokenizerUpdate", this.$onTokenizerUpdate), this.$onChangeTabSize = this.renderer.onChangeTabSize.bind(this.renderer),
e.addEventListener("changeTabSize", this.$onChangeTabSize), this.$onChangeWrapLimit = this.onChangeWrapLimit.bind(this),
e.addEventListener("changeWrapLimit", this.$onChangeWrapLimit), this.$onChangeWrapMode = this.onChangeWrapMode.bind(this),
e.addEventListener("changeWrapMode", this.$onChangeWrapMode), this.$onChangeFold = this.onChangeFold.bind(this),
e.addEventListener("changeFold", this.$onChangeFold), this.$onChangeFrontMarker = this.onChangeFrontMarker.bind(this),
this.session.addEventListener("changeFrontMarker", this.$onChangeFrontMarker), this.$onChangeBackMarker = this.onChangeBackMarker.bind(this),
this.session.addEventListener("changeBackMarker", this.$onChangeBackMarker), this.$onChangeBreakpoint = this.onChangeBreakpoint.bind(this),
this.session.addEventListener("changeBreakpoint", this.$onChangeBreakpoint), this.$onChangeAnnotation = this.onChangeAnnotation.bind(this),
this.session.addEventListener("changeAnnotation", this.$onChangeAnnotation), this.$onCursorChange = this.onCursorChange.bind(this),
this.session.addEventListener("changeOverwrite", this.$onCursorChange), this.$onScrollTopChange = this.onScrollTopChange.bind(this),
this.session.addEventListener("changeScrollTop", this.$onScrollTopChange), this.$onScrollLeftChange = this.onScrollLeftChange.bind(this),
this.session.addEventListener("changeScrollLeft", this.$onScrollLeftChange), this.selection = e.getSelection(),
this.selection.addEventListener("changeCursor", this.$onCursorChange), this.$onSelectionChange = this.onSelectionChange.bind(this),
this.selection.addEventListener("changeSelection", this.$onSelectionChange), this.onChangeMode(),
this.$blockScrolling += 1, this.onCursorChange(), this.$blockScrolling -= 1, this.onScrollTopChange(),
this.onScrollLeftChange(), this.onSelectionChange(), this.onChangeFrontMarker(),
this.onChangeBackMarker(), this.onChangeBreakpoint(), this.onChangeAnnotation(),
this.session.getUseWrapMode() && this.renderer.adjustWrapLimit(), this.renderer.updateFull(),
this._emit("changeSession", {
session: e,
oldSession: t
});
}
}, this.getSession = function() {
return this.session;
}, this.setValue = function(e, t) {
return this.session.doc.setValue(e), t ? 1 == t ? this.navigateFileEnd() : -1 == t && this.navigateFileStart() : this.selectAll(),
e;
}, this.getValue = function() {
return this.session.getValue();
}, this.getSelection = function() {
return this.selection;
}, this.resize = function(e) {
this.renderer.onResize(e);
}, this.setTheme = function(e) {
this.renderer.setTheme(e);
}, this.getTheme = function() {
return this.renderer.getTheme();
}, this.setStyle = function(e) {
this.renderer.setStyle(e);
}, this.unsetStyle = function(e) {
this.renderer.unsetStyle(e);
}, this.getFontSize = function() {
return this.getOption("fontSize") || i.computedStyle(this.container, "fontSize");
}, this.setFontSize = function(e) {
this.setOption("fontSize", e);
}, this.$highlightBrackets = function() {
if (this.session.$bracketHighlight && (this.session.removeMarker(this.session.$bracketHighlight),
this.session.$bracketHighlight = null), !this.$highlightPending) {
var e = this;
this.$highlightPending = !0, setTimeout(function() {
e.$highlightPending = !1;
var t = e.session.findMatchingBracket(e.getCursorPosition());
if (t) var n = new h(t.row, t.column, t.row, t.column + 1); else if (e.session.$mode.getMatching) var n = e.session.$mode.getMatching(e.session);
n && (e.session.$bracketHighlight = e.session.addMarker(n, "ace_bracket", "text"));
}, 50);
}
}, this.focus = function() {
var e = this;
setTimeout(function() {
e.textInput.focus();
}), this.textInput.focus();
}, this.isFocused = function() {
return this.textInput.isFocused();
}, this.blur = function() {
this.textInput.blur();
}, this.onFocus = function() {
this.$isFocused || (this.$isFocused = !0, this.renderer.showCursor(), this.renderer.visualizeFocus(),
this._emit("focus"));
}, this.onBlur = function() {
this.$isFocused && (this.$isFocused = !1, this.renderer.hideCursor(), this.renderer.visualizeBlur(),
this._emit("blur"));
}, this.$cursorChange = function() {
this.renderer.updateCursor();
}, this.onDocumentChange = function(e) {
var t, n = e.data, i = n.range;
t = i.start.row == i.end.row && "insertLines" != n.action && "removeLines" != n.action ? i.end.row : 1/0,
this.renderer.updateLines(i.start.row, t), this._emit("change", e), this.$cursorChange();
}, this.onTokenizerUpdate = function(e) {
var t = e.data;
this.renderer.updateLines(t.first, t.last);
}, this.onScrollTopChange = function() {
this.renderer.scrollToY(this.session.getScrollTop());
}, this.onScrollLeftChange = function() {
this.renderer.scrollToX(this.session.getScrollLeft());
}, this.onCursorChange = function() {
this.$cursorChange(), this.$blockScrolling || this.renderer.scrollCursorIntoView(),
this.$highlightBrackets(), this.$updateHighlightActiveLine(), this._emit("changeSelection");
}, this.$updateHighlightActiveLine = function() {
var e, t = this.getSession();
if (this.$highlightActiveLine && ("line" == this.$selectionStyle && this.selection.isMultiLine() || (e = this.getCursorPosition()),
this.renderer.$maxLines && 1 === this.session.getLength() && (e = !1)), t.$highlightLineMarker && !e) t.removeMarker(t.$highlightLineMarker.id),
t.$highlightLineMarker = null; else if (!t.$highlightLineMarker && e) {
var n = new h(e.row, e.column, e.row, 1/0);
n.id = t.addMarker(n, "ace_active-line", "screenLine"), t.$highlightLineMarker = n;
} else e && (t.$highlightLineMarker.start.row = e.row, t.$highlightLineMarker.end.row = e.row,
t.$highlightLineMarker.start.column = e.column, t._emit("changeBackMarker"));
}, this.onSelectionChange = function() {
var e = this.session;
if (e.$selectionMarker && e.removeMarker(e.$selectionMarker), e.$selectionMarker = null,
this.selection.isEmpty()) this.$updateHighlightActiveLine(); else {
var t = this.selection.getRange(), n = this.getSelectionStyle();
e.$selectionMarker = e.addMarker(t, "ace_selection", n);
}
var i = this.$highlightSelectedWord && this.$getSelectionHighLightRegexp();
this.session.highlight(i), this._emit("changeSelection");
}, this.$getSelectionHighLightRegexp = function() {
var e = this.session, t = this.getSelectionRange();
if (!t.isEmpty() && !t.isMultiLine()) {
var n = t.start.column - 1, i = t.end.column + 1, o = e.getLine(t.start.row), r = o.length, s = o.substring(Math.max(n, 0), Math.min(i, r));
if (!(n >= 0 && /^[\w\d]/.test(s) || r >= i && /[\w\d]$/.test(s)) && (s = o.substring(t.start.column, t.end.column),
/^[\w\d]+$/.test(s))) {
var a = this.$search.$assembleRegExp({
wholeWord: !0,
caseSensitive: !0,
needle: s
});
return a;
}
}
}, this.onChangeFrontMarker = function() {
this.renderer.updateFrontMarkers();
}, this.onChangeBackMarker = function() {
this.renderer.updateBackMarkers();
}, this.onChangeBreakpoint = function() {
this.renderer.updateBreakpoints();
}, this.onChangeAnnotation = function() {
this.renderer.setAnnotations(this.session.getAnnotations());
}, this.onChangeMode = function(e) {
this.renderer.updateText(), this._emit("changeMode", e);
}, this.onChangeWrapLimit = function() {
this.renderer.updateFull();
}, this.onChangeWrapMode = function() {
this.renderer.onResize(!0);
}, this.onChangeFold = function() {
this.$updateHighlightActiveLine(), this.renderer.updateFull();
}, this.getSelectedText = function() {
return this.session.getTextRange(this.getSelectionRange());
}, this.getCopyText = function() {
var e = this.getSelectedText();
return this._signal("copy", e), e;
}, this.onCopy = function() {
this.commands.exec("copy", this);
}, this.onCut = function() {
this.commands.exec("cut", this);
}, this.onPaste = function(e) {
this.$readOnly || (this._emit("paste", e), this.insert(e));
}, this.execCommand = function(e, t) {
this.commands.exec(e, this, t);
}, this.insert = function(e) {
var t = this.session, n = t.getMode(), i = this.getCursorPosition();
if (this.getBehavioursEnabled()) {
var o = n.transformAction(t.getState(i.row), "insertion", this, t, e);
o && (e !== o.text && (this.session.mergeUndoDeltas = !1, this.$mergeNextCommand = !1),
e = o.text);
}
if (" " == e && (e = this.session.getTabString()), this.selection.isEmpty()) {
if (this.session.getOverwrite()) {
var r = new h.fromPoints(i, i);
r.end.column += e.length, this.session.remove(r);
}
} else {
var r = this.getSelectionRange();
i = this.session.remove(r), this.clearSelection();
}
if ("\n" == e || "\r\n" == e) {
var s = t.getLine(i.row);
if (i.column > s.search(/\S|$/)) {
var a = s.substr(i.column).search(/\S|$/);
t.doc.removeInLine(i.row, i.column, i.column + a);
}
}
this.clearSelection();
var l = i.column, c = t.getState(i.row), s = t.getLine(i.row), u = n.checkOutdent(c, s, e);
if (t.insert(i, e), o && o.selection && (2 == o.selection.length ? this.selection.setSelectionRange(new h(i.row, l + o.selection[0], i.row, l + o.selection[1])) : this.selection.setSelectionRange(new h(i.row + o.selection[0], o.selection[1], i.row + o.selection[2], o.selection[3]))),
t.getDocument().isNewLine(e)) {
var d = n.getNextLineIndent(c, s.slice(0, i.column), t.getTabString());
t.insert({
row: i.row + 1,
column: 0
}, d);
}
u && n.autoOutdent(c, t, i.row);
}, this.onTextInput = function(e) {
this.keyBinding.onTextInput(e);
}, this.onCommandKey = function(e, t, n) {
this.keyBinding.onCommandKey(e, t, n);
}, this.setOverwrite = function(e) {
this.session.setOverwrite(e);
}, this.getOverwrite = function() {
return this.session.getOverwrite();
}, this.toggleOverwrite = function() {
this.session.toggleOverwrite();
}, this.setScrollSpeed = function(e) {
this.setOption("scrollSpeed", e);
}, this.getScrollSpeed = function() {
return this.getOption("scrollSpeed");
}, this.setDragDelay = function(e) {
this.setOption("dragDelay", e);
}, this.getDragDelay = function() {
return this.getOption("dragDelay");
}, this.setSelectionStyle = function(e) {
this.setOption("selectionStyle", e);
}, this.getSelectionStyle = function() {
return this.getOption("selectionStyle");
}, this.setHighlightActiveLine = function(e) {
this.setOption("highlightActiveLine", e);
}, this.getHighlightActiveLine = function() {
return this.getOption("highlightActiveLine");
}, this.setHighlightGutterLine = function(e) {
this.setOption("highlightGutterLine", e);
}, this.getHighlightGutterLine = function() {
return this.getOption("highlightGutterLine");
}, this.setHighlightSelectedWord = function(e) {
this.setOption("highlightSelectedWord", e);
}, this.getHighlightSelectedWord = function() {
return this.$highlightSelectedWord;
}, this.setAnimatedScroll = function(e) {
this.renderer.setAnimatedScroll(e);
}, this.getAnimatedScroll = function() {
return this.renderer.getAnimatedScroll();
}, this.setShowInvisibles = function(e) {
this.renderer.setShowInvisibles(e);
}, this.getShowInvisibles = function() {
return this.renderer.getShowInvisibles();
}, this.setDisplayIndentGuides = function(e) {
this.renderer.setDisplayIndentGuides(e);
}, this.getDisplayIndentGuides = function() {
return this.renderer.getDisplayIndentGuides();
}, this.setShowPrintMargin = function(e) {
this.renderer.setShowPrintMargin(e);
}, this.getShowPrintMargin = function() {
return this.renderer.getShowPrintMargin();
}, this.setPrintMarginColumn = function(e) {
this.renderer.setPrintMarginColumn(e);
}, this.getPrintMarginColumn = function() {
return this.renderer.getPrintMarginColumn();
}, this.setReadOnly = function(e) {
this.setOption("readOnly", e);
}, this.getReadOnly = function() {
return this.getOption("readOnly");
}, this.setBehavioursEnabled = function(e) {
this.setOption("behavioursEnabled", e);
}, this.getBehavioursEnabled = function() {
return this.getOption("behavioursEnabled");
}, this.setWrapBehavioursEnabled = function(e) {
this.setOption("wrapBehavioursEnabled", e);
}, this.getWrapBehavioursEnabled = function() {
return this.getOption("wrapBehavioursEnabled");
}, this.setShowFoldWidgets = function(e) {
this.setOption("showFoldWidgets", e);
}, this.getShowFoldWidgets = function() {
return this.getOption("showFoldWidgets");
}, this.setFadeFoldWidgets = function(e) {
this.setOption("fadeFoldWidgets", e);
}, this.getFadeFoldWidgets = function() {
return this.getOption("fadeFoldWidgets");
}, this.remove = function(e) {
this.selection.isEmpty() && ("left" == e ? this.selection.selectLeft() : this.selection.selectRight());
var t = this.getSelectionRange();
if (this.getBehavioursEnabled()) {
var n = this.session, i = n.getState(t.start.row), o = n.getMode().transformAction(i, "deletion", this, n, t);
if (0 == t.end.column) {
var r = n.getTextRange(t);
if ("\n" == r[r.length - 1]) {
var s = n.getLine(t.end.row);
/^\s+$/.test(s) && (t.end.column = s.length);
}
}
o && (t = o);
}
this.session.remove(t), this.clearSelection();
}, this.removeWordRight = function() {
this.selection.isEmpty() && this.selection.selectWordRight(), this.session.remove(this.getSelectionRange()),
this.clearSelection();
}, this.removeWordLeft = function() {
this.selection.isEmpty() && this.selection.selectWordLeft(), this.session.remove(this.getSelectionRange()),
this.clearSelection();
}, this.removeToLineStart = function() {
this.selection.isEmpty() && this.selection.selectLineStart(), this.session.remove(this.getSelectionRange()),
this.clearSelection();
}, this.removeToLineEnd = function() {
this.selection.isEmpty() && this.selection.selectLineEnd();
var e = this.getSelectionRange();
e.start.column == e.end.column && e.start.row == e.end.row && (e.end.column = 0,
e.end.row++), this.session.remove(e), this.clearSelection();
}, this.splitLine = function() {
this.selection.isEmpty() || (this.session.remove(this.getSelectionRange()), this.clearSelection());
var e = this.getCursorPosition();
this.insert("\n"), this.moveCursorToPosition(e);
}, this.transposeLetters = function() {
if (this.selection.isEmpty()) {
var e = this.getCursorPosition(), t = e.column;
if (0 !== t) {
var n, i, o = this.session.getLine(e.row);
t < o.length ? (n = o.charAt(t) + o.charAt(t - 1), i = new h(e.row, t - 1, e.row, t + 1)) : (n = o.charAt(t - 1) + o.charAt(t - 2),
i = new h(e.row, t - 2, e.row, t)), this.session.replace(i, n);
}
}
}, this.toLowerCase = function() {
var e = this.getSelectionRange();
this.selection.isEmpty() && this.selection.selectWord();
var t = this.getSelectionRange(), n = this.session.getTextRange(t);
this.session.replace(t, n.toLowerCase()), this.selection.setSelectionRange(e);
}, this.toUpperCase = function() {
var e = this.getSelectionRange();
this.selection.isEmpty() && this.selection.selectWord();
var t = this.getSelectionRange(), n = this.session.getTextRange(t);
this.session.replace(t, n.toUpperCase()), this.selection.setSelectionRange(e);
}, this.indent = function() {
var e = this.session, t = this.getSelectionRange();
if (t.start.row < t.end.row) {
var n = this.$getSelectedRows();
return e.indentRows(n.first, n.last, " "), void 0;
}
if (t.start.column < t.end.column) {
var i = e.getTextRange(t);
if (!/^\s+$/.test(i)) {
var n = this.$getSelectedRows();
return e.indentRows(n.first, n.last, " "), void 0;
}
}
var r = e.getLine(t.start.row), s = t.start, a = e.getTabSize(), l = e.documentToScreenColumn(s.row, s.column);
if (this.session.getUseSoftTabs()) var c = a - l % a, u = o.stringRepeat(" ", c); else {
for (var c = l % a; " " == r[t.start.column] && c; ) t.start.column--, c--;
this.selection.setSelectionRange(t), u = " ";
}
return this.insert(u);
}, this.blockIndent = function() {
var e = this.$getSelectedRows();
this.session.indentRows(e.first, e.last, " ");
}, this.blockOutdent = function() {
var e = this.session.getSelection();
this.session.outdentRows(e.getRange());
}, this.sortLines = function() {
var e = this.$getSelectedRows(), t = this.session, n = [];
for (o = e.first; o <= e.last; o++) n.push(t.getLine(o));
n.sort(function(e, t) {
return e.toLowerCase() < t.toLowerCase() ? -1 : e.toLowerCase() > t.toLowerCase() ? 1 : 0;
});
for (var i = new h(0, 0, 0, 0), o = e.first; o <= e.last; o++) {
var r = t.getLine(o);
i.start.row = o, i.end.row = o, i.end.column = r.length, t.replace(i, n[o - e.first]);
}
}, this.toggleCommentLines = function() {
var e = this.session.getState(this.getCursorPosition().row), t = this.$getSelectedRows();
this.session.getMode().toggleCommentLines(e, this.session, t.first, t.last);
}, this.toggleBlockComment = function() {
var e = this.getCursorPosition(), t = this.session.getState(e.row), n = this.getSelectionRange();
this.session.getMode().toggleBlockComment(t, this.session, n, e);
}, this.getNumberAt = function(e, t) {
var n = /[\-]?[0-9]+(?:\.[0-9]+)?/g;
n.lastIndex = 0;
for (var i = this.session.getLine(e); n.lastIndex < t; ) {
var o = n.exec(i);
if (o.index <= t && o.index + o[0].length >= t) {
var r = {
value: o[0],
start: o.index,
end: o.index + o[0].length
};
return r;
}
}
return null;
}, this.modifyNumber = function(e) {
var t = this.selection.getCursor().row, n = this.selection.getCursor().column, i = new h(t, n - 1, t, n), o = this.session.getTextRange(i);
if (!isNaN(parseFloat(o)) && isFinite(o)) {
var r = this.getNumberAt(t, n);
if (r) {
var s = r.value.indexOf(".") >= 0 ? r.start + r.value.indexOf(".") + 1 : r.end, a = r.start + r.value.length - s, l = parseFloat(r.value);
l *= Math.pow(10, a), e *= s !== r.end && s > n ? Math.pow(10, r.end - n - 1) : Math.pow(10, r.end - n),
l += e, l /= Math.pow(10, a);
var c = l.toFixed(a), u = new h(t, r.start, t, r.end);
this.session.replace(u, c), this.moveCursorTo(t, Math.max(r.start + 1, n + c.length - r.value.length));
}
}
}, this.removeLines = function() {
var e, t = this.$getSelectedRows();
e = 0 === t.first || t.last + 1 < this.session.getLength() ? new h(t.first, 0, t.last + 1, 0) : new h(t.first - 1, this.session.getLine(t.first - 1).length, t.last, this.session.getLine(t.last).length),
this.session.remove(e), this.clearSelection();
}, this.duplicateSelection = function() {
var e = this.selection, t = this.session, n = e.getRange(), i = e.isBackwards();
if (n.isEmpty()) {
var o = n.start.row;
t.duplicateLines(o, o);
} else {
var r = i ? n.start : n.end, s = t.insert(r, t.getTextRange(n), !1);
n.start = r, n.end = s, e.setSelectionRange(n, i);
}
}, this.moveLinesDown = function() {
this.$moveLines(function(e, t) {
return this.session.moveLinesDown(e, t);
});
}, this.moveLinesUp = function() {
this.$moveLines(function(e, t) {
return this.session.moveLinesUp(e, t);
});
}, this.moveText = function(e, t) {
return this.session.moveText(e, t);
}, this.copyLinesUp = function() {
this.$moveLines(function(e, t) {
return this.session.duplicateLines(e, t), 0;
});
}, this.copyLinesDown = function() {
this.$moveLines(function(e, t) {
return this.session.duplicateLines(e, t);
});
}, this.$moveLines = function(e) {
var t = this.selection;
if (!t.inMultiSelectMode || this.inVirtualSelectionMode) {
var n = t.toOrientedRange(), i = this.$getSelectedRows(n), o = e.call(this, i.first, i.last);
n.moveBy(o, 0), t.fromOrientedRange(n);
} else {
var r = t.rangeList.ranges;
t.rangeList.detach(this.session);
for (var s = r.length; s--; ) {
for (var a = s, i = r[s].collapseRows(), l = i.end.row, c = i.start.row; s--; ) {
var i = r[s].collapseRows();
if (!(c - i.end.row <= 1)) break;
c = i.end.row;
}
s++;
for (var o = e.call(this, c, l); a >= s; ) r[a].moveBy(o, 0), a--;
}
t.fromOrientedRange(t.ranges[0]), t.rangeList.attach(this.session);
}
}, this.$getSelectedRows = function() {
var e = this.getSelectionRange().collapseRows();
return {
first: e.start.row,
last: e.end.row
};
}, this.onCompositionStart = function() {
this.renderer.showComposition(this.getCursorPosition());
}, this.onCompositionUpdate = function(e) {
this.renderer.setCompositionText(e);
}, this.onCompositionEnd = function() {
this.renderer.hideComposition();
}, this.getFirstVisibleRow = function() {
return this.renderer.getFirstVisibleRow();
}, this.getLastVisibleRow = function() {
return this.renderer.getLastVisibleRow();
}, this.isRowVisible = function(e) {
return e >= this.getFirstVisibleRow() && e <= this.getLastVisibleRow();
}, this.isRowFullyVisible = function(e) {
return e >= this.renderer.getFirstFullyVisibleRow() && e <= this.renderer.getLastFullyVisibleRow();
}, this.$getVisibleRowCount = function() {
return this.renderer.getScrollBottomRow() - this.renderer.getScrollTopRow() + 1;
}, this.$moveByPage = function(e, t) {
var n = this.renderer, i = this.renderer.layerConfig, o = e * Math.floor(i.height / i.lineHeight);
this.$blockScrolling++, 1 == t ? this.selection.$moveSelection(function() {
this.moveCursorBy(o, 0);
}) : 0 == t && (this.selection.moveCursorBy(o, 0), this.selection.clearSelection()),
this.$blockScrolling--;
var r = n.scrollTop;
n.scrollBy(0, o * i.lineHeight), null != t && n.scrollCursorIntoView(null, .5),
n.animateScrolling(r);
}, this.selectPageDown = function() {
this.$moveByPage(1, !0);
}, this.selectPageUp = function() {
this.$moveByPage(-1, !0);
}, this.gotoPageDown = function() {
this.$moveByPage(1, !1);
}, this.gotoPageUp = function() {
this.$moveByPage(-1, !1);
}, this.scrollPageDown = function() {
this.$moveByPage(1);
}, this.scrollPageUp = function() {
this.$moveByPage(-1);
}, this.scrollToRow = function(e) {
this.renderer.scrollToRow(e);
}, this.scrollToLine = function(e, t, n, i) {
this.renderer.scrollToLine(e, t, n, i);
}, this.centerSelection = function() {
var e = this.getSelectionRange(), t = {
row: Math.floor(e.start.row + (e.end.row - e.start.row) / 2),
column: Math.floor(e.start.column + (e.end.column - e.start.column) / 2)
};
this.renderer.alignCursor(t, .5);
}, this.getCursorPosition = function() {
return this.selection.getCursor();
}, this.getCursorPositionScreen = function() {
return this.session.documentToScreenPosition(this.getCursorPosition());
}, this.getSelectionRange = function() {
return this.selection.getRange();
}, this.selectAll = function() {
this.$blockScrolling += 1, this.selection.selectAll(), this.$blockScrolling -= 1;
}, this.clearSelection = function() {
this.selection.clearSelection();
}, this.moveCursorTo = function(e, t) {
this.selection.moveCursorTo(e, t);
}, this.moveCursorToPosition = function(e) {
this.selection.moveCursorToPosition(e);
}, this.jumpToMatching = function(e) {
var t = this.getCursorPosition(), n = this.session.getBracketRange(t);
if (!n) {
if (n = this.find({
needle: /[{}()\[\]]/g,
preventScroll: !0,
start: {
row: t.row,
column: t.column - 1
}
}), !n) return;
var i = n.start;
i.row == t.row && Math.abs(i.column - t.column) < 2 && (n = this.session.getBracketRange(i));
}
i = n && n.cursor || i, i && (e ? n && n.isEqual(this.getSelectionRange()) ? this.clearSelection() : this.selection.selectTo(i.row, i.column) : (this.clearSelection(),
this.moveCursorTo(i.row, i.column)));
}, this.gotoLine = function(e, t, n) {
this.selection.clearSelection(), this.session.unfold({
row: e - 1,
column: t || 0
}), this.$blockScrolling += 1, this.exitMultiSelectMode && this.exitMultiSelectMode(),
this.moveCursorTo(e - 1, t || 0), this.$blockScrolling -= 1, this.isRowFullyVisible(e - 1) || this.scrollToLine(e - 1, !0, n);
}, this.navigateTo = function(e, t) {
this.clearSelection(), this.moveCursorTo(e, t);
}, this.navigateUp = function(e) {
if (this.selection.isMultiLine() && !this.selection.isBackwards()) {
var t = this.selection.anchor.getPosition();
return this.moveCursorToPosition(t);
}
this.selection.clearSelection(), e = e || 1, this.selection.moveCursorBy(-e, 0);
}, this.navigateDown = function(e) {
if (this.selection.isMultiLine() && this.selection.isBackwards()) {
var t = this.selection.anchor.getPosition();
return this.moveCursorToPosition(t);
}
this.selection.clearSelection(), e = e || 1, this.selection.moveCursorBy(e, 0);
}, this.navigateLeft = function(e) {
if (this.selection.isEmpty()) for (e = e || 1; e--; ) this.selection.moveCursorLeft(); else {
var t = this.getSelectionRange().start;
this.moveCursorToPosition(t);
}
this.clearSelection();
}, this.navigateRight = function(e) {
if (this.selection.isEmpty()) for (e = e || 1; e--; ) this.selection.moveCursorRight(); else {
var t = this.getSelectionRange().end;
this.moveCursorToPosition(t);
}
this.clearSelection();
}, this.navigateLineStart = function() {
this.selection.moveCursorLineStart(), this.clearSelection();
}, this.navigateLineEnd = function() {
this.selection.moveCursorLineEnd(), this.clearSelection();
}, this.navigateFileEnd = function() {
var e = this.renderer.scrollTop;
this.selection.moveCursorFileEnd(), this.clearSelection(), this.renderer.animateScrolling(e);
}, this.navigateFileStart = function() {
var e = this.renderer.scrollTop;
this.selection.moveCursorFileStart(), this.clearSelection(), this.renderer.animateScrolling(e);
}, this.navigateWordRight = function() {
this.selection.moveCursorWordRight(), this.clearSelection();
}, this.navigateWordLeft = function() {
this.selection.moveCursorWordLeft(), this.clearSelection();
}, this.replace = function(e, t) {
t && this.$search.set(t);
var n = this.$search.find(this.session), i = 0;
return n ? (this.$tryReplace(n, e) && (i = 1), null !== n && (this.selection.setSelectionRange(n),
this.renderer.scrollSelectionIntoView(n.start, n.end)), i) : i;
}, this.replaceAll = function(e, t) {
t && this.$search.set(t);
var n = this.$search.findAll(this.session), i = 0;
if (!n.length) return i;
this.$blockScrolling += 1;
var o = this.getSelectionRange();
this.clearSelection(), this.selection.moveCursorTo(0, 0);
for (var r = n.length - 1; r >= 0; --r) this.$tryReplace(n[r], e) && i++;
return this.selection.setSelectionRange(o), this.$blockScrolling -= 1, i;
}, this.$tryReplace = function(e, t) {
var n = this.session.getTextRange(e);
return t = this.$search.replace(n, t), null !== t ? (e.end = this.session.replace(e, t),
e) : null;
}, this.getLastSearchOptions = function() {
return this.$search.getOptions();
}, this.find = function(e, t, i) {
t || (t = {}), "string" == typeof e || e instanceof RegExp ? t.needle = e : "object" == typeof e && n.mixin(t, e);
var o = this.selection.getRange();
null == t.needle && (e = this.session.getTextRange(o) || this.$search.$options.needle,
e || (o = this.session.getWordRange(o.start.row, o.start.column), e = this.session.getTextRange(o)),
this.$search.set({
needle: e
})), this.$search.set(t), t.start || this.$search.set({
start: o
});
var r = this.$search.find(this.session);
return t.preventScroll ? r : r ? (this.revealRange(r, i), r) : (t.backwards ? o.start = o.end : o.end = o.start,
this.selection.setRange(o), void 0);
}, this.findNext = function(e, t) {
this.find({
skipCurrent: !0,
backwards: !1
}, e, t);
}, this.findPrevious = function(e, t) {
this.find(e, {
skipCurrent: !0,
backwards: !0
}, t);
}, this.revealRange = function(e, t) {
this.$blockScrolling += 1, this.session.unfold(e), this.selection.setSelectionRange(e),
this.$blockScrolling -= 1;
var n = this.renderer.scrollTop;
this.renderer.scrollSelectionIntoView(e.start, e.end, .5), 0 != t && this.renderer.animateScrolling(n);
}, this.undo = function() {
this.$blockScrolling++, this.session.getUndoManager().undo(), this.$blockScrolling--,
this.renderer.scrollCursorIntoView(null, .5);
}, this.redo = function() {
this.$blockScrolling++, this.session.getUndoManager().redo(), this.$blockScrolling--,
this.renderer.scrollCursorIntoView(null, .5);
}, this.destroy = function() {
this.renderer.destroy(), this._emit("destroy", this);
}, this.setAutoScrollEditorIntoView = function(e) {
if (e !== !1) {
var t, n = this, i = !1;
this.$scrollAnchor || (this.$scrollAnchor = document.createElement("div"));
var o = this.$scrollAnchor;
o.style.cssText = "position:absolute", this.container.insertBefore(o, this.container.firstChild);
var r = this.on("changeSelection", function() {
i = !0;
}), s = this.renderer.on("beforeRender", function() {
i && (t = n.renderer.container.getBoundingClientRect());
}), a = this.renderer.on("afterRender", function() {
if (i && t && n.isFocused()) {
var e = n.renderer, r = e.$cursorLayer.$pixelPos, s = e.layerConfig, a = r.top - s.offset;
i = r.top >= 0 && a + t.top < 0 ? !0 : r.top < s.height && r.top + t.top + s.lineHeight > window.innerHeight ? !1 : null,
null != i && (o.style.top = a + "px", o.style.left = r.left + "px", o.style.height = s.lineHeight + "px",
o.scrollIntoView(i)), i = t = null;
}
});
this.setAutoScrollEditorIntoView = function(e) {
e !== !0 && (delete this.setAutoScrollEditorIntoView, this.removeEventListener("changeSelection", r),
this.renderer.removeEventListener("afterRender", a), this.renderer.removeEventListener("beforeRender", s));
};
}
}, this.$resetCursorStyle = function() {
var e = this.$cursorStyle || "ace", t = this.renderer.$cursorLayer;
t && (t.setSmoothBlinking("smooth" == e), t.isBlinking = !this.$readOnly && "wide" != e);
};
}).call(v.prototype), m.defineOptions(v.prototype, "editor", {
selectionStyle: {
set: function(e) {
this.onSelectionChange(), this._emit("changeSelectionStyle", {
data: e
});
},
initialValue: "line"
},
highlightActiveLine: {
set: function() {
this.$updateHighlightActiveLine();
},
initialValue: !0
},
highlightSelectedWord: {
set: function() {
this.$onSelectionChange();
},
initialValue: !0
},
readOnly: {
set: function() {
this.$resetCursorStyle();
},
initialValue: !1
},
cursorStyle: {
set: function() {
this.$resetCursorStyle();
},
values: [ "ace", "slim", "smooth", "wide" ],
initialValue: "ace"
},
mergeUndoDeltas: {
values: [ !1, !0, "always" ],
initialValue: !0
},
behavioursEnabled: {
initialValue: !0
},
wrapBehavioursEnabled: {
initialValue: !0
},
hScrollBarAlwaysVisible: "renderer",
vScrollBarAlwaysVisible: "renderer",
highlightGutterLine: "renderer",
animatedScroll: "renderer",
showInvisibles: "renderer",
showPrintMargin: "renderer",
printMarginColumn: "renderer",
printMargin: "renderer",
fadeFoldWidgets: "renderer",
showFoldWidgets: "renderer",
showGutter: "renderer",
displayIndentGuides: "renderer",
fontSize: "renderer",
fontFamily: "renderer",
maxLines: "renderer",
minLines: "renderer",
scrollPastEnd: "renderer",
fixedWidthGutter: "renderer",
scrollSpeed: "$mouseHandler",
dragDelay: "$mouseHandler",
focusTimout: "$mouseHandler",
firstLineNumber: "session",
overwrite: "session",
newLineMode: "session",
useWorker: "session",
useSoftTabs: "session",
tabSize: "session",
wrap: "session",
foldStyle: "session"
}), t.Editor = v;
}), define("ace/undomanager", [ "require", "exports", "module" ], function(e, t) {
var n = function() {
this.reset();
};
(function() {
this.execute = function(e) {
var t = e.args[0];
this.$doc = e.args[1], e.merge && this.hasUndo() && (t = this.$undoStack.pop().concat(t)),
this.$undoStack.push(t), this.$redoStack = [], this.dirtyCounter < 0 && (this.dirtyCounter = 0/0),
this.dirtyCounter++;
}, this.undo = function(e) {
var t = this.$undoStack.pop(), n = null;
return t && (n = this.$doc.undoChanges(t, e), this.$redoStack.push(t), this.dirtyCounter--),
n;
}, this.redo = function(e) {
var t = this.$redoStack.pop(), n = null;
return t && (n = this.$doc.redoChanges(t, e), this.$undoStack.push(t), this.dirtyCounter++),
n;
}, this.reset = function() {
this.$undoStack = [], this.$redoStack = [], this.dirtyCounter = 0;
}, this.hasUndo = function() {
return this.$undoStack.length > 0;
}, this.hasRedo = function() {
return this.$redoStack.length > 0;
}, this.markClean = function() {
this.dirtyCounter = 0;
}, this.isClean = function() {
return 0 === this.dirtyCounter;
};
}).call(n.prototype), t.UndoManager = n;
}), define("ace/layer/gutter", [ "require", "exports", "module", "../lib/dom", "../lib/oop", "../lib/lang", "../lib/event_emitter" ], function(e, t) {
var n = e("../lib/dom"), i = e("../lib/oop"), o = e("../lib/lang"), r = e("../lib/event_emitter").EventEmitter, s = function(e) {
this.element = n.createElement("div"), this.element.className = "ace_layer ace_gutter-layer",
e.appendChild(this.element), this.setShowFoldWidgets(this.$showFoldWidgets), this.gutterWidth = 0,
this.$annotations = [], this.$updateAnnotations = this.$updateAnnotations.bind(this),
this.$cells = [];
};
(function() {
i.implement(this, r), this.setSession = function(e) {
this.session && this.session.removeEventListener("change", this.$updateAnnotations),
this.session = e, e.on("change", this.$updateAnnotations);
}, this.addGutterDecoration = function(e, t) {
window.console && console.warn && console.warn("deprecated use session.addGutterDecoration"),
this.session.addGutterDecoration(e, t);
}, this.removeGutterDecoration = function(e, t) {
window.console && console.warn && console.warn("deprecated use session.removeGutterDecoration"),
this.session.removeGutterDecoration(e, t);
}, this.setAnnotations = function(e) {
this.$annotations = [];
for (var t, n, i = 0; i < e.length; i++) {
var r = e[i], n = r.row, t = this.$annotations[n];
t || (t = this.$annotations[n] = {
text: []
});
var s = r.text;
s = s ? o.escapeHTML(s) : r.html || "", -1 === t.text.indexOf(s) && t.text.push(s);
var a = r.type;
"error" == a ? t.className = " ace_error" : "warning" == a && " ace_error" != t.className ? t.className = " ace_warning" : "info" != a || t.className || (t.className = " ace_info");
}
}, this.$updateAnnotations = function(e) {
if (this.$annotations.length) {
var t = e.data, n = t.range, i = n.start.row, o = n.end.row - i;
if (0 === o) ; else if ("removeText" == t.action || "removeLines" == t.action) this.$annotations.splice(i, o + 1, null); else {
var r = Array(o + 1);
r.unshift(i, 1), this.$annotations.splice.apply(this.$annotations, r);
}
}
}, this.update = function(e) {
for (var t = e.firstRow, i = e.lastRow, o = this.session.getNextFoldLine(t), r = o ? o.start.row : 1/0, s = this.$showFoldWidgets && this.session.foldWidgets, a = this.session.$breakpoints, l = this.session.$decorations, c = this.session.$firstLineNumber, u = 0, d = null, h = -1, p = t; ;) {
if (p > r && (p = o.end.row + 1, o = this.session.getNextFoldLine(p, o), r = o ? o.start.row : 1/0),
p > i) {
for (;this.$cells.length > h + 1; ) d = this.$cells.pop(), this.element.removeChild(d.element);
break;
}
d = this.$cells[++h], d || (d = {
element: null,
textNode: null,
foldWidget: null
}, d.element = n.createElement("div"), d.textNode = document.createTextNode(""),
d.element.appendChild(d.textNode), this.element.appendChild(d.element), this.$cells[h] = d);
var f = "ace_gutter-cell";
a[p] && (f += a[p]), l[p] && (f += l[p]), this.$annotations[p] && (f += this.$annotations[p].className),
d.element.className != f && (d.element.className = f);
var g = this.session.getRowLength(p) * e.lineHeight + "px";
g != d.element.style.height && (d.element.style.height = g);
var m = u = p + c;
if (m != d.textNode.data && (d.textNode.data = m), s) {
var v = s[p];
null == v && (v = s[p] = this.session.getFoldWidget(p));
}
if (v) {
d.foldWidget || (d.foldWidget = n.createElement("span"), d.element.appendChild(d.foldWidget));
var f = "ace_fold-widget ace_" + v;
f += "start" == v && p == r && p < o.end.row ? " ace_closed" : " ace_open", d.foldWidget.className != f && (d.foldWidget.className = f);
var g = e.lineHeight + "px";
d.foldWidget.style.height != g && (d.foldWidget.style.height = g);
} else null != d.foldWidget && (d.element.removeChild(d.foldWidget), d.foldWidget = null);
p++;
}
this.element.style.height = e.minHeight + "px", (this.$fixedWidth || this.session.$useWrapMode) && (u = this.session.getLength());
var b = u.toString().length * e.characterWidth, y = this.$padding || this.$computePadding();
b += y.left + y.right, b === this.gutterWidth || isNaN(b) || (this.gutterWidth = b,
this.element.style.width = Math.ceil(this.gutterWidth) + "px", this._emit("changeGutterWidth", b));
}, this.$fixedWidth = !1, this.$showFoldWidgets = !0, this.setShowFoldWidgets = function(e) {
e ? n.addCssClass(this.element, "ace_folding-enabled") : n.removeCssClass(this.element, "ace_folding-enabled"),
this.$showFoldWidgets = e, this.$padding = null;
}, this.getShowFoldWidgets = function() {
return this.$showFoldWidgets;
}, this.$computePadding = function() {
if (!this.element.firstChild) return {
left: 0,
right: 0
};
var e = n.computedStyle(this.element.firstChild);
return this.$padding = {}, this.$padding.left = parseInt(e.paddingLeft) + 1 || 0,
this.$padding.right = parseInt(e.paddingRight) || 0, this.$padding;
}, this.getRegion = function(e) {
var t = this.$padding || this.$computePadding(), n = this.element.getBoundingClientRect();
return e.x < t.left + n.left ? "markers" : this.$showFoldWidgets && e.x > n.right - t.right ? "foldWidgets" : void 0;
};
}).call(s.prototype), t.Gutter = s;
}), define("ace/layer/marker", [ "require", "exports", "module", "../range", "../lib/dom" ], function(e, t) {
var n = e("../range").Range, i = e("../lib/dom"), o = function(e) {
this.element = i.createElement("div"), this.element.className = "ace_layer ace_marker-layer",
e.appendChild(this.element);
};
(function() {
this.$padding = 0, this.setPadding = function(e) {
this.$padding = e;
}, this.setSession = function(e) {
this.session = e;
}, this.setMarkers = function(e) {
this.markers = e;
}, this.update = function(e) {
var e = e || this.config;
if (e) {
this.config = e;
var t = [];
for (var n in this.markers) {
var o = this.markers[n];
if (o.range) {
var r = o.range.clipRows(e.firstRow, e.lastRow);
if (!r.isEmpty()) if (r = r.toScreenRange(this.session), o.renderer) {
var s = this.$getTop(r.start.row, e), a = this.$padding + r.start.column * e.characterWidth;
o.renderer(t, r, a, s, e);
} else "fullLine" == o.type ? this.drawFullLineMarker(t, r, o.clazz, e) : "screenLine" == o.type ? this.drawScreenLineMarker(t, r, o.clazz, e) : r.isMultiLine() ? "text" == o.type ? this.drawTextMarker(t, r, o.clazz, e) : this.drawMultiLineMarker(t, r, o.clazz, e) : this.drawSingleLineMarker(t, r, o.clazz + " ace_start", e);
} else o.update(t, this, this.session, e);
}
this.element = i.setInnerHtml(this.element, t.join(""));
}
}, this.$getTop = function(e, t) {
return (e - t.firstRowScreen) * t.lineHeight;
}, this.drawTextMarker = function(e, t, i, o, r) {
var s = t.start.row, a = new n(s, t.start.column, s, this.session.getScreenLastRowColumn(s));
for (this.drawSingleLineMarker(e, a, i + " ace_start", o, 1, r), s = t.end.row,
a = new n(s, 0, s, t.end.column), this.drawSingleLineMarker(e, a, i, o, 0, r), s = t.start.row + 1; s < t.end.row; s++) a.start.row = s,
a.end.row = s, a.end.column = this.session.getScreenLastRowColumn(s), this.drawSingleLineMarker(e, a, i, o, 1, r);
}, this.drawMultiLineMarker = function(e, t, n, i, o) {
var r = this.$padding, s = i.lineHeight, a = this.$getTop(t.start.row, i), l = r + t.start.column * i.characterWidth;
o = o || "", e.push("<div class='", n, " ace_start' style='", "height:", s, "px;", "right:0;", "top:", a, "px;", "left:", l, "px;", o, "'></div>"),
a = this.$getTop(t.end.row, i);
var c = t.end.column * i.characterWidth;
e.push("<div class='", n, "' style='", "height:", s, "px;", "width:", c, "px;", "top:", a, "px;", "left:", r, "px;", o, "'></div>"),
s = (t.end.row - t.start.row - 1) * i.lineHeight, 0 > s || (a = this.$getTop(t.start.row + 1, i),
e.push("<div class='", n, "' style='", "height:", s, "px;", "right:0;", "top:", a, "px;", "left:", r, "px;", o, "'></div>"));
}, this.drawSingleLineMarker = function(e, t, n, i, o, r) {
var s = i.lineHeight, a = (t.end.column + (o || 0) - t.start.column) * i.characterWidth, l = this.$getTop(t.start.row, i), c = this.$padding + t.start.column * i.characterWidth;
e.push("<div class='", n, "' style='", "height:", s, "px;", "width:", a, "px;", "top:", l, "px;", "left:", c, "px;", r || "", "'></div>");
}, this.drawFullLineMarker = function(e, t, n, i, o) {
var r = this.$getTop(t.start.row, i), s = i.lineHeight;
t.start.row != t.end.row && (s += this.$getTop(t.end.row, i) - r), e.push("<div class='", n, "' style='", "height:", s, "px;", "top:", r, "px;", "left:0;right:0;", o || "", "'></div>");
}, this.drawScreenLineMarker = function(e, t, n, i, o) {
var r = this.$getTop(t.start.row, i), s = i.lineHeight;
e.push("<div class='", n, "' style='", "height:", s, "px;", "top:", r, "px;", "left:0;right:0;", o || "", "'></div>");
};
}).call(o.prototype), t.Marker = o;
}), define("ace/layer/text", [ "require", "exports", "module", "../lib/oop", "../lib/dom", "../lib/lang", "../lib/useragent", "../lib/event_emitter" ], function(e, t) {
var n = e("../lib/oop"), i = e("../lib/dom"), o = e("../lib/lang"), r = e("../lib/useragent"), s = e("../lib/event_emitter").EventEmitter, a = function(e) {
this.element = i.createElement("div"), this.element.className = "ace_layer ace_text-layer",
e.appendChild(this.element), this.$characterSize = {
width: 0,
height: 0
}, this.checkForSizeChanges(), this.$pollSizeChanges();
};
(function() {
n.implement(this, s), this.EOF_CHAR = "¶", this.EOL_CHAR = "¬", this.TAB_CHAR = "→",
this.SPACE_CHAR = "·", this.$padding = 0, this.setPadding = function(e) {
this.$padding = e, this.element.style.padding = "0 " + e + "px";
}, this.getLineHeight = function() {
return this.$characterSize.height || 1;
}, this.getCharacterWidth = function() {
return this.$characterSize.width || 1;
}, this.checkForSizeChanges = function() {
var e = this.$measureSizes();
if (e && (this.$characterSize.width !== e.width || this.$characterSize.height !== e.height)) {
this.$measureNode.style.fontWeight = "bold";
var t = this.$measureSizes();
this.$measureNode.style.fontWeight = "", this.$characterSize = e, this.allowBoldFonts = t && t.width === e.width && t.height === e.height,
this._emit("changeCharacterSize", {
data: e
});
}
}, this.$pollSizeChanges = function() {
var e = this;
this.$pollSizeChangesTimer = setInterval(function() {
e.checkForSizeChanges();
}, 500);
}, this.$fontStyles = {
fontFamily: 1,
fontSize: 1,
fontWeight: 1,
fontStyle: 1,
lineHeight: 1
}, this.$measureSizes = r.isIE || r.isOldGecko ? function() {
var e = 1e3;
if (!this.$measureNode) {
var t = this.$measureNode = i.createElement("div"), n = t.style;
if (n.width = n.height = "auto", n.left = n.top = 40 * -e + "px", n.visibility = "hidden",
n.position = "fixed", n.overflow = "visible", n.whiteSpace = "nowrap", t.innerHTML = o.stringRepeat("Xy", e),
this.element.ownerDocument.body) this.element.ownerDocument.body.appendChild(t); else {
for (var r = this.element.parentNode; !i.hasCssClass(r, "ace_editor"); ) r = r.parentNode;
r.appendChild(t);
}
}
if (!this.element.offsetWidth) return null;
var n = this.$measureNode.style, s = i.computedStyle(this.element);
for (var a in this.$fontStyles) n[a] = s[a];
var l = {
height: this.$measureNode.offsetHeight,
width: this.$measureNode.offsetWidth / (2 * e)
};
return 0 == l.width || 0 == l.height ? null : l;
} : function() {
if (!this.$measureNode) {
var e = this.$measureNode = i.createElement("div"), t = e.style;
t.width = t.height = "auto", t.left = t.top = "-100px", t.visibility = "hidden",
t.position = "fixed", t.overflow = "visible", t.whiteSpace = "nowrap", e.innerHTML = o.stringRepeat("X", 100);
for (var n = this.element.parentNode; n && !i.hasCssClass(n, "ace_editor"); ) n = n.parentNode;
if (!n) return this.$measureNode = null;
n.appendChild(e);
}
var r = this.$measureNode.getBoundingClientRect(), s = {
height: r.height,
width: r.width / 100
};
return 0 == s.width || 0 == s.height ? null : s;
}, this.setSession = function(e) {
this.session = e, this.$computeTabString();
}, this.showInvisibles = !1, this.setShowInvisibles = function(e) {
return this.showInvisibles == e ? !1 : (this.showInvisibles = e, this.$computeTabString(),
!0);
}, this.displayIndentGuides = !0, this.setDisplayIndentGuides = function(e) {
return this.displayIndentGuides == e ? !1 : (this.displayIndentGuides = e, this.$computeTabString(),
!0);
}, this.$tabStrings = [], this.onChangeTabSize = this.$computeTabString = function() {
var e = this.session.getTabSize();
this.tabSize = e;
for (var t = this.$tabStrings = [ 0 ], n = 1; e + 1 > n; n++) this.showInvisibles ? t.push("<span class='ace_invisible'>" + this.TAB_CHAR + o.stringRepeat(" ", n - 1) + "</span>") : t.push(o.stringRepeat(" ", n));
if (this.displayIndentGuides) {
this.$indentGuideRe = /\s\S| \t|\t |\s$/;
var i = "ace_indent-guide";
if (this.showInvisibles) {
i += " ace_invisible";
var r = o.stringRepeat(this.SPACE_CHAR, this.tabSize), s = this.TAB_CHAR + o.stringRepeat(" ", this.tabSize - 1);
} else var r = o.stringRepeat(" ", this.tabSize), s = r;
this.$tabStrings[" "] = "<span class='" + i + "'>" + r + "</span>", this.$tabStrings[" "] = "<span class='" + i + "'>" + s + "</span>";
}
}, this.updateLines = function(e, t, n) {
(this.config.lastRow != e.lastRow || this.config.firstRow != e.firstRow) && this.scrollLines(e),
this.config = e;
for (var o = Math.max(t, e.firstRow), r = Math.min(n, e.lastRow), s = this.element.childNodes, a = 0, l = e.firstRow; o > l; l++) {
var c = this.session.getFoldLine(l);
if (c) {
if (c.containsRow(o)) {
o = c.start.row;
break;
}
l = c.end.row;
}
a++;
}
for (var l = o, c = this.session.getNextFoldLine(l), u = c ? c.start.row : 1/0; ;) {
if (l > u && (l = c.end.row + 1, c = this.session.getNextFoldLine(l, c), u = c ? c.start.row : 1/0),
l > r) break;
var d = s[a++];
if (d) {
var h = [];
this.$renderLine(h, l, !this.$useLineGroups(), l == u ? c : !1), i.setInnerHtml(d, h.join(""));
}
l++;
}
}, this.scrollLines = function(e) {
var t = this.config;
if (this.config = e, !t || t.lastRow < e.firstRow) return this.update(e);
if (e.lastRow < t.firstRow) return this.update(e);
var n = this.element;
if (t.firstRow < e.firstRow) for (var i = this.session.getFoldedRowCount(t.firstRow, e.firstRow - 1); i > 0; i--) n.removeChild(n.firstChild);
if (t.lastRow > e.lastRow) for (var i = this.session.getFoldedRowCount(e.lastRow + 1, t.lastRow); i > 0; i--) n.removeChild(n.lastChild);
if (e.firstRow < t.firstRow) {
var o = this.$renderLinesFragment(e, e.firstRow, t.firstRow - 1);
n.firstChild ? n.insertBefore(o, n.firstChild) : n.appendChild(o);
}
if (e.lastRow > t.lastRow) {
var o = this.$renderLinesFragment(e, t.lastRow + 1, e.lastRow);
n.appendChild(o);
}
}, this.$renderLinesFragment = function(e, t, n) {
for (var o = this.element.ownerDocument.createDocumentFragment(), r = t, s = this.session.getNextFoldLine(r), a = s ? s.start.row : 1/0; ;) {
if (r > a && (r = s.end.row + 1, s = this.session.getNextFoldLine(r, s), a = s ? s.start.row : 1/0),
r > n) break;
var l = i.createElement("div"), c = [];
if (this.$renderLine(c, r, !1, r == a ? s : !1), l.innerHTML = c.join(""), this.$useLineGroups()) l.className = "ace_line_group",
o.appendChild(l); else for (var u = l.childNodes; u.length; ) o.appendChild(u[0]);
r++;
}
return o;
}, this.update = function(e) {
this.config = e;
for (var t = [], n = e.firstRow, o = e.lastRow, r = n, s = this.session.getNextFoldLine(r), a = s ? s.start.row : 1/0; ;) {
if (r > a && (r = s.end.row + 1, s = this.session.getNextFoldLine(r, s), a = s ? s.start.row : 1/0),
r > o) break;
this.$useLineGroups() && t.push("<div class='ace_line_group'>"), this.$renderLine(t, r, !1, r == a ? s : !1),
this.$useLineGroups() && t.push("</div>"), r++;
}
this.element = i.setInnerHtml(this.element, t.join(""));
}, this.$textToken = {
text: !0,
rparen: !0,
lparen: !0
}, this.$renderToken = function(e, t, n, i) {
var r = this, s = /\t|&|<|( +)|([\x00-\x1f\x80-\xa0\u1680\u180E\u2000-\u200f\u2028\u2029\u202F\u205F\u3000\uFEFF])|[\u1100-\u115F\u11A3-\u11A7\u11FA-\u11FF\u2329-\u232A\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3000-\u303E\u3041-\u3096\u3099-\u30FF\u3105-\u312D\u3131-\u318E\u3190-\u31BA\u31C0-\u31E3\u31F0-\u321E\u3220-\u3247\u3250-\u32FE\u3300-\u4DBF\u4E00-\uA48C\uA490-\uA4C6\uA960-\uA97C\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFAFF\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFF01-\uFF60\uFFE0-\uFFE6]/g, a = function(e, n, i, s) {
if (n) return r.showInvisibles ? "<span class='ace_invisible'>" + o.stringRepeat(r.SPACE_CHAR, e.length) + "</span>" : o.stringRepeat(" ", e.length);
if ("&" == e) return "&#38;";
if ("<" == e) return "&#60;";
if (" " == e) {
var a = r.session.getScreenTabSize(t + s);
return t += a - 1, r.$tabStrings[a];
}
if (" " == e) {
var l = r.showInvisibles ? "ace_cjk ace_invisible" : "ace_cjk", c = r.showInvisibles ? r.SPACE_CHAR : "";
return t += 1, "<span class='" + l + "' style='width:" + 2 * r.config.characterWidth + "px'>" + c + "</span>";
}
return i ? "<span class='ace_invisible ace_invalid'>" + r.SPACE_CHAR + "</span>" : (t += 1,
"<span class='ace_cjk' style='width:" + 2 * r.config.characterWidth + "px'>" + e + "</span>");
}, l = i.replace(s, a);
if (this.$textToken[n.type]) e.push(l); else {
var c = "ace_" + n.type.replace(/\./g, " ace_"), u = "";
"fold" == n.type && (u = " style='width:" + n.value.length * this.config.characterWidth + "px;' "),
e.push("<span class='", c, "'", u, ">", l, "</span>");
}
return t + i.length;
}, this.renderIndentGuide = function(e, t, n) {
var i = t.search(this.$indentGuideRe);
return 0 >= i || i >= n ? t : " " == t[0] ? (i -= i % this.tabSize, e.push(o.stringRepeat(this.$tabStrings[" "], i / this.tabSize)),
t.substr(i)) : " " == t[0] ? (e.push(o.stringRepeat(this.$tabStrings[" "], i)),
t.substr(i)) : t;
}, this.$renderWrappedLine = function(e, t, n, i) {
for (var o = 0, r = 0, s = n[0], a = 0, l = 0; l < t.length; l++) {
var c = t[l], u = c.value;
if (0 == l && this.displayIndentGuides) {
if (o = u.length, u = this.renderIndentGuide(e, u, s), !u) continue;
o -= u.length;
}
if (o + u.length < s) a = this.$renderToken(e, a, c, u), o += u.length; else {
for (;o + u.length >= s; ) a = this.$renderToken(e, a, c, u.substring(0, s - o)),
u = u.substring(s - o), o = s, i || e.push("</div>", "<div class='ace_line' style='height:", this.config.lineHeight, "px'>"),
r++, a = 0, s = n[r] || Number.MAX_VALUE;
0 != u.length && (o += u.length, a = this.$renderToken(e, a, c, u));
}
}
}, this.$renderSimpleLine = function(e, t) {
var n = 0, i = t[0], o = i.value;
this.displayIndentGuides && (o = this.renderIndentGuide(e, o)), o && (n = this.$renderToken(e, n, i, o));
for (var r = 1; r < t.length; r++) i = t[r], o = i.value, n = this.$renderToken(e, n, i, o);
}, this.$renderLine = function(e, t, n, i) {
if (i || 0 == i || (i = this.session.getFoldLine(t)), i) var o = this.$getFoldLineTokens(t, i); else var o = this.session.getTokens(t);
if (n || e.push("<div class='ace_line' style='height:", this.config.lineHeight, "px'>"),
o.length) {
var r = this.session.getRowSplitData(t);
r && r.length ? this.$renderWrappedLine(e, o, r, n) : this.$renderSimpleLine(e, o);
}
this.showInvisibles && (i && (t = i.end.row), e.push("<span class='ace_invisible'>", t == this.session.getLength() - 1 ? this.EOF_CHAR : this.EOL_CHAR, "</span>")),
n || e.push("</div>");
}, this.$getFoldLineTokens = function(e, t) {
function n(e, t, n) {
for (var i = 0, r = 0; r + e[i].value.length < t; ) if (r += e[i].value.length,
i++, i == e.length) return;
if (r != t) {
var s = e[i].value.substring(t - r);
s.length > n - t && (s = s.substring(0, n - t)), o.push({
type: e[i].type,
value: s
}), r = t + s.length, i += 1;
}
for (;n > r && i < e.length; ) {
var s = e[i].value;
s.length + r > n ? o.push({
type: e[i].type,
value: s.substring(0, n - r)
}) : o.push(e[i]), r += s.length, i += 1;
}
}
var i = this.session, o = [], r = i.getTokens(e);
return t.walk(function(e, t, s, a, l) {
null != e ? o.push({
type: "fold",
value: e
}) : (l && (r = i.getTokens(t)), r.length && n(r, a, s));
}, t.end.row, this.session.getLine(t.end.row).length), o;
}, this.$useLineGroups = function() {
return this.session.getUseWrapMode();
}, this.destroy = function() {
clearInterval(this.$pollSizeChangesTimer), this.$measureNode && this.$measureNode.parentNode.removeChild(this.$measureNode),
delete this.$measureNode;
};
}).call(a.prototype), t.Text = a;
}), define("ace/layer/cursor", [ "require", "exports", "module", "../lib/dom" ], function(e, t) {
var n = e("../lib/dom"), i = function(e) {
this.element = n.createElement("div"), this.element.className = "ace_layer ace_cursor-layer",
e.appendChild(this.element), this.isVisible = !1, this.isBlinking = !0, this.blinkInterval = 1e3,
this.smoothBlinking = !1, this.cursors = [], this.cursor = this.addCursor(), n.addCssClass(this.element, "ace_hidden-cursors");
};
(function() {
this.$padding = 0, this.setPadding = function(e) {
this.$padding = e;
}, this.setSession = function(e) {
this.session = e;
}, this.setBlinking = function(e) {
e != this.isBlinking && (this.isBlinking = e, this.restartTimer());
}, this.setBlinkInterval = function(e) {
e != this.blinkInterval && (this.blinkInterval = e, this.restartTimer());
}, this.setSmoothBlinking = function(e) {
e != this.smoothBlinking && (this.smoothBlinking = e, e ? n.addCssClass(this.element, "ace_smooth-blinking") : n.removeCssClass(this.element, "ace_smooth-blinking"),
this.restartTimer());
}, this.addCursor = function() {
var e = n.createElement("div");
return e.className = "ace_cursor", this.element.appendChild(e), this.cursors.push(e),
e;
}, this.removeCursor = function() {
if (this.cursors.length > 1) {
var e = this.cursors.pop();
return e.parentNode.removeChild(e), e;
}
}, this.hideCursor = function() {
this.isVisible = !1, n.addCssClass(this.element, "ace_hidden-cursors"), this.restartTimer();
}, this.showCursor = function() {
this.isVisible = !0, n.removeCssClass(this.element, "ace_hidden-cursors"), this.restartTimer();
}, this.restartTimer = function() {
clearInterval(this.intervalId), clearTimeout(this.timeoutId), this.smoothBlinking && n.removeCssClass(this.element, "ace_smooth-blinking");
for (var e = this.cursors.length; e--; ) this.cursors[e].style.opacity = "";
if (this.isBlinking && this.blinkInterval && this.isVisible) {
this.smoothBlinking && setTimeout(function() {
n.addCssClass(this.element, "ace_smooth-blinking");
}.bind(this));
var t = function() {
this.timeoutId = setTimeout(function() {
for (var e = this.cursors.length; e--; ) this.cursors[e].style.opacity = 0;
}.bind(this), .6 * this.blinkInterval);
}.bind(this);
this.intervalId = setInterval(function() {
for (var e = this.cursors.length; e--; ) this.cursors[e].style.opacity = "";
t();
}.bind(this), this.blinkInterval), t();
}
}, this.getPixelPosition = function(e, t) {
if (!this.config || !this.session) return {
left: 0,
top: 0
};
e || (e = this.session.selection.getCursor());
var n = this.session.documentToScreenPosition(e), i = this.$padding + n.column * this.config.characterWidth, o = (n.row - (t ? this.config.firstRowScreen : 0)) * this.config.lineHeight;
return {
left: i,
top: o
};
}, this.update = function(e) {
this.config = e;
var t = this.session.$selectionMarkers, n = 0, i = 0;
(void 0 === t || 0 === t.length) && (t = [ {
cursor: null
} ]);
for (var n = 0, o = t.length; o > n; n++) {
var r = this.getPixelPosition(t[n].cursor, !0);
if (!((r.top > e.height + e.offset || r.top < -e.offset) && n > 1)) {
var s = (this.cursors[i++] || this.addCursor()).style;
s.left = r.left + "px", s.top = r.top + "px", s.width = e.characterWidth + "px",
s.height = e.lineHeight + "px";
}
}
for (;this.cursors.length > i; ) this.removeCursor();
var a = this.session.getOverwrite();
this.$setOverwrite(a), this.$pixelPos = r, this.restartTimer();
}, this.$setOverwrite = function(e) {
e != this.overwrite && (this.overwrite = e, e ? n.addCssClass(this.element, "ace_overwrite-cursors") : n.removeCssClass(this.element, "ace_overwrite-cursors"));
}, this.destroy = function() {
clearInterval(this.intervalId), clearTimeout(this.timeoutId);
};
}).call(i.prototype), t.Cursor = i;
}), define("ace/scrollbar", [ "require", "exports", "module", "./lib/oop", "./lib/dom", "./lib/event", "./lib/event_emitter" ], function(e, t) {
var n = e("./lib/oop"), i = e("./lib/dom"), o = e("./lib/event"), r = e("./lib/event_emitter").EventEmitter, s = function(e, t) {
this.element = i.createElement("div"), this.element.className = "ace_scrollbar",
this.inner = i.createElement("div"), this.inner.className = "ace_scrollbar-inner",
this.element.appendChild(this.inner), e.appendChild(this.element), t.$scrollbarWidth = this.width = i.scrollbarWidth(e.ownerDocument),
t.$scrollbarWidth = this.width = i.scrollbarWidth(e.ownerDocument), this.fullWidth = this.width,
this.inner.style.width = this.element.style.width = (this.width || 15) + 5 + "px",
this.setVisible(!1), this.element.style.overflowY = "scroll", o.addListener(this.element, "scroll", this.onScrollV.bind(this));
}, a = function(e, t) {
this.element = i.createElement("div"), this.element.className = "ace_scrollbar-h",
this.inner = i.createElement("div"), this.inner.className = "ace_scrollbar-inner",
this.element.appendChild(this.inner), e.appendChild(this.element), this.height = t.$scrollbarWidth,
this.fullHeight = this.height, this.inner.style.height = this.element.style.height = (this.height || 15) + 5 + "px",
this.setVisible(!1), this.element.style.overflowX = "scroll", o.addListener(this.element, "scroll", this.onScrollH.bind(this));
};
(function() {
n.implement(this, r), this.setVisible = function(e) {
e ? (this.element.style.display = "", this.fullWidth && (this.width = this.fullWidth),
this.fullHeight && (this.height = this.fullHeight)) : (this.element.style.display = "none",
this.height = this.width = 0);
}, this.onScrollV = function() {
this.skipEvent || (this.scrollTop = this.element.scrollTop, this._emit("scroll", {
data: this.scrollTop
})), this.skipEvent = !1;
}, this.onScrollH = function() {
this.skipEvent || (this.scrollLeft = this.element.scrollLeft, this._emit("scroll", {
data: this.scrollLeft
})), this.skipEvent = !1;
}, this.getWidth = function() {
return this.width;
}, this.getHeight = function() {
return this.height;
}, this.setHeight = function(e) {
this.element.style.height = e + "px";
}, this.setWidth = function(e) {
this.element.style.width = e + "px";
}, this.setInnerHeight = function(e) {
this.inner.style.height = e + "px";
}, this.setInnerWidth = function(e) {
this.inner.style.width = e + "px";
}, this.setScrollTop = function(e) {
this.scrollTop != e && (this.skipEvent = !0, this.scrollTop = this.element.scrollTop = e);
}, this.setScrollLeft = function(e) {
this.scrollLeft != e && (this.skipEvent = !0, this.scrollLeft = this.element.scrollLeft = e);
};
}).call(s.prototype), a.prototype = s.prototype, t.ScrollBar = s, t.ScrollBarV = s,
t.ScrollBarH = a;
}), define("ace/renderloop", [ "require", "exports", "module", "./lib/event" ], function(e, t) {
var n = e("./lib/event"), i = function(e, t) {
this.onRender = e, this.pending = !1, this.changes = 0, this.window = t || window;
};
(function() {
this.schedule = function(e) {
if (this.changes = this.changes | e, !this.pending) {
this.pending = !0;
var t = this;
n.nextFrame(function() {
t.pending = !1;
for (var e; e = t.changes; ) t.changes = 0, t.onRender(e);
}, this.window);
}
};
}).call(i.prototype), t.RenderLoop = i;
}), function() {
define("ace/requirejs/text", [ "require", "exports", "module" ], function(e, t) {
t.load = function(e, t, n) {
n("", "utf8");
};
});
}(), define("ace/virtual_renderer", [ "require", "exports", "module", "./lib/oop", "./lib/dom", "./lib/useragent", "./config", "./layer/gutter", "./layer/marker", "./layer/text", "./layer/cursor", "./scrollbar", "./scrollbar", "./renderloop", "./lib/event_emitter", "./requirejs/text!./css/editor.css" ], function(e, t) {
var n = e("./lib/oop"), i = e("./lib/dom"), o = e("./lib/useragent"), r = e("./config"), s = e("./layer/gutter").Gutter, a = e("./layer/marker").Marker, l = e("./layer/text").Text, c = e("./layer/cursor").Cursor, u = e("./scrollbar").ScrollBarH, d = e("./scrollbar").ScrollBarV, h = e("./renderloop").RenderLoop, p = e("./lib/event_emitter").EventEmitter, f = e("./requirejs/text!./css/editor.css");
i.importCssString(f, "ace_editor");
var g = function(e, t) {
var n = this;
this.container = e || i.createElement("div"), this.$keepTextAreaAtCursor = !o.isIE,
i.addCssClass(this.container, "ace_editor"), this.setTheme(t), this.$gutter = i.createElement("div"),
this.$gutter.className = "ace_gutter", this.container.appendChild(this.$gutter),
this.scroller = i.createElement("div"), this.scroller.className = "ace_scroller",
this.container.appendChild(this.scroller), this.content = i.createElement("div"),
this.content.className = "ace_content", this.scroller.appendChild(this.content),
this.$gutterLayer = new s(this.$gutter), this.$gutterLayer.on("changeGutterWidth", this.onGutterResize.bind(this)),
this.$markerBack = new a(this.content);
var p = this.$textLayer = new l(this.content);
this.canvas = p.element, this.$markerFront = new a(this.content), this.$cursorLayer = new c(this.content),
this.$horizScroll = !1, this.$vScroll = !1, this.scrollBar = this.scrollBarV = new d(this.container, this),
this.scrollBarH = new u(this.container, this), this.scrollBarV.addEventListener("scroll", function(e) {
n.$scrollAnimation || n.session.setScrollTop(e.data - n.scrollMargin.top);
}), this.scrollBarH.addEventListener("scroll", function(e) {
n.$scrollAnimation || n.session.setScrollLeft(e.data - n.scrollMargin.left);
}), this.scrollTop = 0, this.scrollLeft = 0, this.cursorPos = {
row: 0,
column: 0
}, this.$textLayer.addEventListener("changeCharacterSize", function() {
n.updateCharacterSize(), n.onResize(!0), n._signal("changeCharacterSize");
}), this.$size = {
width: 0,
height: 0,
scrollerHeight: 0,
scrollerWidth: 0
}, this.layerConfig = {
width: 1,
padding: 0,
firstRow: 0,
firstRowScreen: 0,
lastRow: 0,
lineHeight: 1,
characterWidth: 1,
minHeight: 1,
maxHeight: 1,
offset: 0,
height: 1
}, this.scrollMargin = {
left: 0,
right: 0,
top: 0,
bottom: 0,
v: 0,
h: 0
}, this.$loop = new h(this.$renderChanges.bind(this), this.container.ownerDocument.defaultView),
this.$loop.schedule(this.CHANGE_FULL), this.updateCharacterSize(), this.setPadding(4),
r.resetOptions(this), r._emit("renderer", this);
};
(function() {
this.CHANGE_CURSOR = 1, this.CHANGE_MARKER = 2, this.CHANGE_GUTTER = 4, this.CHANGE_SCROLL = 8,
this.CHANGE_LINES = 16, this.CHANGE_TEXT = 32, this.CHANGE_SIZE = 64, this.CHANGE_MARKER_BACK = 128,
this.CHANGE_MARKER_FRONT = 256, this.CHANGE_FULL = 512, this.CHANGE_H_SCROLL = 1024,
n.implement(this, p), this.updateCharacterSize = function() {
this.$textLayer.allowBoldFonts != this.$allowBoldFonts && (this.$allowBoldFonts = this.$textLayer.allowBoldFonts,
this.setStyle("ace_nobold", !this.$allowBoldFonts)), this.layerConfig.characterWidth = this.characterWidth = this.$textLayer.getCharacterWidth(),
this.layerConfig.lineHeight = this.lineHeight = this.$textLayer.getLineHeight(),
this.$updatePrintMargin();
}, this.setSession = function(e) {
this.session = e, this.scroller.className = "ace_scroller", this.$cursorLayer.setSession(e),
this.$markerBack.setSession(e), this.$markerFront.setSession(e), this.$gutterLayer.setSession(e),
this.$textLayer.setSession(e), this.$loop.schedule(this.CHANGE_FULL);
}, this.updateLines = function(e, t) {
void 0 === t && (t = 1/0), this.$changedLines ? (this.$changedLines.firstRow > e && (this.$changedLines.firstRow = e),
this.$changedLines.lastRow < t && (this.$changedLines.lastRow = t)) : this.$changedLines = {
firstRow: e,
lastRow: t
}, this.$changedLines.firstRow > this.layerConfig.lastRow || this.$changedLines.lastRow < this.layerConfig.firstRow || this.$loop.schedule(this.CHANGE_LINES);
}, this.onChangeTabSize = function() {
this.$loop.schedule(this.CHANGE_TEXT | this.CHANGE_MARKER), this.$textLayer.onChangeTabSize();
}, this.updateText = function() {
this.$loop.schedule(this.CHANGE_TEXT);
}, this.updateFull = function(e) {
e ? this.$renderChanges(this.CHANGE_FULL, !0) : this.$loop.schedule(this.CHANGE_FULL);
}, this.updateFontSize = function() {
this.$textLayer.checkForSizeChanges();
}, this.$changes = 0, this.onResize = function(e, t, n, i) {
if (!(this.resizing > 2)) {
this.resizing > 0 ? this.resizing++ : this.resizing = e ? 1 : 0;
var o = this.container;
i || (i = o.clientHeight || o.scrollHeight), n || (n = o.clientWidth || o.scrollWidth);
var r = this.$updateCachedSize(e, t, n, i);
if (!this.$size.scrollerHeight || !n && !i) return this.resizing = 0;
e && (this.$gutterLayer.$padding = null), e ? this.$renderChanges(r, !0) : this.$loop.schedule(r | this.$changes),
this.resizing && (this.resizing = 0);
}
}, this.$updateCachedSize = function(e, t, n, i) {
var o = 0, r = this.$size, s = {
width: r.width,
height: r.height,
scrollerHeight: r.scrollerHeight,
scrollerWidth: r.scrollerWidth
};
return i && (e || r.height != i) && (r.height = i, o = this.CHANGE_SIZE, r.scrollerHeight = r.height,
this.$horizScroll && (r.scrollerHeight -= this.scrollBarH.getHeight()), this.scrollBarV.element.style.bottom = this.scrollBarH.getHeight() + "px",
this.session && (this.session.setScrollTop(this.getScrollTop()), o |= this.CHANGE_SCROLL)),
n && (e || r.width != n) && (o = this.CHANGE_SIZE, r.width = n, null == t && (t = this.$showGutter ? this.$gutter.offsetWidth : 0),
this.gutterWidth = t, this.scrollBarH.element.style.left = this.scroller.style.left = t + "px",
r.scrollerWidth = Math.max(0, n - t - this.scrollBarV.getWidth()), this.scrollBarH.element.style.right = this.scroller.style.right = this.scrollBarV.getWidth() + "px",
this.scroller.style.bottom = this.scrollBarH.getHeight() + "px", (this.session && this.session.getUseWrapMode() && this.adjustWrapLimit() || e) && (o |= this.CHANGE_FULL)),
o && this._signal("resize", s), o;
}, this.onGutterResize = function() {
var e = this.$showGutter ? this.$gutter.offsetWidth : 0;
e != this.gutterWidth && (this.$changes |= this.$updateCachedSize(!0, e, this.$size.width, this.$size.height)),
this.session.getUseWrapMode() && this.adjustWrapLimit() ? this.$loop.schedule(this.CHANGE_FULL) : (this.$computeLayerConfig(),
this.$loop.schedule(this.CHANGE_MARKER));
}, this.adjustWrapLimit = function() {
var e = this.$size.scrollerWidth - 2 * this.$padding, t = Math.floor(e / this.characterWidth);
return this.session.adjustWrapLimit(t, this.$showPrintMargin && this.$printMarginColumn);
}, this.setAnimatedScroll = function(e) {
this.setOption("animatedScroll", e);
}, this.getAnimatedScroll = function() {
return this.$animatedScroll;
}, this.setShowInvisibles = function(e) {
this.setOption("showInvisibles", e);
}, this.getShowInvisibles = function() {
return this.getOption("showInvisibles");
}, this.getDisplayIndentGuides = function() {
return this.getOption("displayIndentGuides");
}, this.setDisplayIndentGuides = function(e) {
this.setOption("displayIndentGuides", e);
}, this.setShowPrintMargin = function(e) {
this.setOption("showPrintMargin", e);
}, this.getShowPrintMargin = function() {
return this.getOption("showPrintMargin");
}, this.setPrintMarginColumn = function(e) {
this.setOption("printMarginColumn", e);
}, this.getPrintMarginColumn = function() {
return this.getOption("printMarginColumn");
}, this.getShowGutter = function() {
return this.getOption("showGutter");
}, this.setShowGutter = function(e) {
return this.setOption("showGutter", e);
}, this.getFadeFoldWidgets = function() {
return this.getOption("fadeFoldWidgets");
}, this.setFadeFoldWidgets = function(e) {
this.setOption("fadeFoldWidgets", e);
}, this.setHighlightGutterLine = function(e) {
this.setOption("highlightGutterLine", e);
}, this.getHighlightGutterLine = function() {
return this.getOption("highlightGutterLine");
}, this.$updateGutterLineHighlight = function() {
var e = this.$cursorLayer.$pixelPos, t = this.layerConfig.lineHeight;
if (this.session.getUseWrapMode()) {
var n = this.session.selection.getCursor();
n.column = 0, e = this.$cursorLayer.getPixelPosition(n, !0), t *= this.session.getRowLength(n.row);
}
this.$gutterLineHighlight.style.top = e.top - this.layerConfig.offset + "px", this.$gutterLineHighlight.style.height = t + "px";
}, this.$updatePrintMargin = function() {
if (this.$showPrintMargin || this.$printMarginEl) {
if (!this.$printMarginEl) {
var e = i.createElement("div");
e.className = "ace_layer ace_print-margin-layer", this.$printMarginEl = i.createElement("div"),
this.$printMarginEl.className = "ace_print-margin", e.appendChild(this.$printMarginEl),
this.content.insertBefore(e, this.content.firstChild);
}
var t = this.$printMarginEl.style;
t.left = this.characterWidth * this.$printMarginColumn + this.$padding + "px", t.visibility = this.$showPrintMargin ? "visible" : "hidden",
this.session && -1 == this.session.$wrap && this.adjustWrapLimit();
}
}, this.getContainerElement = function() {
return this.container;
}, this.getMouseEventTarget = function() {
return this.content;
}, this.getTextAreaContainer = function() {
return this.container;
}, this.$moveTextAreaToCursor = function() {
if (this.$keepTextAreaAtCursor) {
var e = this.layerConfig, t = this.$cursorLayer.$pixelPos.top, n = this.$cursorLayer.$pixelPos.left;
t -= e.offset;
var i = this.lineHeight;
if (!(0 > t || t > e.height - i)) {
var o = this.characterWidth;
if (this.$composition) {
var r = this.textarea.value.replace(/^\x01+/, "");
o *= this.session.$getStringScreenWidth(r)[0] + 2, i += 2, t -= 1;
}
n -= this.scrollLeft, n > this.$size.scrollerWidth - o && (n = this.$size.scrollerWidth - o),
n -= this.scrollBar.width, this.textarea.style.height = i + "px", this.textarea.style.width = o + "px",
this.textarea.style.right = Math.max(0, this.$size.scrollerWidth - n - o) + "px",
this.textarea.style.bottom = Math.max(0, this.$size.height - t - i) + "px";
}
}
}, this.getFirstVisibleRow = function() {
return this.layerConfig.firstRow;
}, this.getFirstFullyVisibleRow = function() {
return this.layerConfig.firstRow + (0 === this.layerConfig.offset ? 0 : 1);
}, this.getLastFullyVisibleRow = function() {
var e = Math.floor((this.layerConfig.height + this.layerConfig.offset) / this.layerConfig.lineHeight);
return this.layerConfig.firstRow - 1 + e;
}, this.getLastVisibleRow = function() {
return this.layerConfig.lastRow;
}, this.$padding = null, this.setPadding = function(e) {
this.$padding = e, this.$textLayer.setPadding(e), this.$cursorLayer.setPadding(e),
this.$markerFront.setPadding(e), this.$markerBack.setPadding(e), this.$loop.schedule(this.CHANGE_FULL),
this.$updatePrintMargin();
}, this.setScrollMargin = function(e, t, n, i) {
var o = this.scrollMargin;
o.top = 0 | e, o.bottom = 0 | t, o.right = 0 | i, o.left = 0 | n, o.v = o.top + o.bottom,
o.h = o.left + o.right, this.updateFull();
}, this.getHScrollBarAlwaysVisible = function() {
return this.$hScrollBarAlwaysVisible;
}, this.setHScrollBarAlwaysVisible = function(e) {
this.setOption("hScrollBarAlwaysVisible", e);
}, this.getVScrollBarAlwaysVisible = function() {
return this.$hScrollBarAlwaysVisible;
}, this.setVScrollBarAlwaysVisible = function(e) {
this.setOption("vScrollBarAlwaysVisible", e);
}, this.$updateScrollBarV = function() {
this.scrollBarV.setInnerHeight(this.layerConfig.maxHeight + this.scrollMargin.v),
this.scrollBarV.setScrollTop(this.scrollTop + this.scrollMargin.top);
}, this.$updateScrollBarH = function() {
this.scrollBarH.setInnerWidth(this.layerConfig.width + 2 * this.$padding + this.scrollMargin.h),
this.scrollBarH.setScrollLeft(this.scrollLeft + this.scrollMargin.left);
}, this.$renderChanges = function(e, t) {
return this.$changes && (e |= this.$changes, this.$changes = 0), this.session && this.container.offsetWidth && (e || t) ? this.$size.width ? (this._signal("beforeRender"),
(e & this.CHANGE_FULL || e & this.CHANGE_SIZE || e & this.CHANGE_TEXT || e & this.CHANGE_LINES || e & this.CHANGE_SCROLL || e & this.CHANGE_H_SCROLL) && (e |= this.$computeLayerConfig()),
e & this.CHANGE_H_SCROLL && (this.$updateScrollBarH(), this.content.style.marginLeft = -this.scrollLeft + "px",
this.scroller.className = this.scrollLeft <= 0 ? "ace_scroller" : "ace_scroller ace_scroll-left"),
e & this.CHANGE_FULL ? (this.$textLayer.checkForSizeChanges(), this.$updateScrollBarV(),
this.$updateScrollBarH(), this.$textLayer.update(this.layerConfig), this.$showGutter && this.$gutterLayer.update(this.layerConfig),
this.$markerBack.update(this.layerConfig), this.$markerFront.update(this.layerConfig),
this.$cursorLayer.update(this.layerConfig), this.$moveTextAreaToCursor(), this.$highlightGutterLine && this.$updateGutterLineHighlight(),
this._signal("afterRender"), void 0) : e & this.CHANGE_SCROLL ? (this.$updateScrollBarV(),
e & this.CHANGE_TEXT || e & this.CHANGE_LINES ? this.$textLayer.update(this.layerConfig) : this.$textLayer.scrollLines(this.layerConfig),
this.$showGutter && this.$gutterLayer.update(this.layerConfig), this.$markerBack.update(this.layerConfig),
this.$markerFront.update(this.layerConfig), this.$cursorLayer.update(this.layerConfig),
this.$highlightGutterLine && this.$updateGutterLineHighlight(), this.$moveTextAreaToCursor(),
this._signal("afterRender"), void 0) : (e & this.CHANGE_TEXT ? (this.$textLayer.update(this.layerConfig),
this.$showGutter && this.$gutterLayer.update(this.layerConfig)) : e & this.CHANGE_LINES ? (this.$updateLines() || e & this.CHANGE_GUTTER && this.$showGutter) && this.$gutterLayer.update(this.layerConfig) : (e & this.CHANGE_TEXT || e & this.CHANGE_GUTTER) && this.$showGutter && this.$gutterLayer.update(this.layerConfig),
e & this.CHANGE_CURSOR && (this.$cursorLayer.update(this.layerConfig), this.$moveTextAreaToCursor(),
this.$highlightGutterLine && this.$updateGutterLineHighlight()), e & (this.CHANGE_MARKER | this.CHANGE_MARKER_FRONT) && this.$markerFront.update(this.layerConfig),
e & (this.CHANGE_MARKER | this.CHANGE_MARKER_BACK) && this.$markerBack.update(this.layerConfig),
(e & this.CHANGE_SIZE || e & this.CHANGE_LINES) && (this.$updateScrollBarV(), this.$updateScrollBarH()),
this._signal("afterRender"), void 0)) : (this.$changes |= e, this.onResize(!0)) : (this.$changes |= e,
void 0);
}, this.$autosize = function(e) {
var e = this.session.getScreenLength() * this.lineHeight, t = this.$maxLines * this.lineHeight, n = Math.max((this.$minLines || 1) * this.lineHeight, Math.min(t, e)), i = e > t;
if (n != this.desiredHeight || this.$size.height != this.desiredHeight || i != this.$vScroll) {
i != this.$vScroll && (this.$vScroll = i, this.scrollBarV.setVisible(i));
var o = this.container.clientWidth;
this.container.style.height = n + "px", this.$updateCachedSize(!0, this.$gutterWidth, o, n),
this.desiredHeight = n;
}
}, this.$computeLayerConfig = function() {
this.$maxLines && this.lineHeight > 1 && this.$autosize();
var e = this.session, t = this.$size.height <= 2 * this.lineHeight, n = this.session.getScreenLength(), i = n * this.lineHeight, o = this.scrollTop % this.lineHeight, r = this.$size.scrollerHeight + this.lineHeight, s = this.$getLongestLine(), a = !t && (this.$hScrollBarAlwaysVisible || this.$size.scrollerWidth - s - 2 * this.$padding < 0), l = this.$horizScroll !== a;
l && (this.$horizScroll = a, this.scrollBarH.setVisible(a)), !this.$maxLines && this.$scrollPastEnd && this.scrollTop > i - this.$size.scrollerHeight && (i += Math.min((this.$size.scrollerHeight - this.lineHeight) * this.$scrollPastEnd, this.scrollTop - i + this.$size.scrollerHeight));
var c = !t && (this.$vScrollBarAlwaysVisible || this.$size.scrollerHeight - i < 0), u = this.$vScroll !== c;
u && (this.$vScroll = c, this.scrollBarV.setVisible(c)), this.session.setScrollTop(Math.max(-this.scrollMargin.top, Math.min(this.scrollTop, i - this.$size.scrollerHeight + this.scrollMargin.v))),
this.session.setScrollLeft(Math.max(-this.scrollMargin.left, Math.min(this.scrollLeft, s + 2 * this.$padding - this.$size.scrollerWidth + this.scrollMargin.h)));
var d, h, p = Math.ceil(r / this.lineHeight) - 1, f = Math.max(0, Math.round((this.scrollTop - o) / this.lineHeight)), g = f + p, m = this.lineHeight;
f = e.screenToDocumentRow(f, 0);
var v = e.getFoldLine(f);
v && (f = v.start.row), d = e.documentToScreenRow(f, 0), h = e.getRowLength(f) * m,
g = Math.min(e.screenToDocumentRow(g, 0), e.getLength() - 1), r = this.$size.scrollerHeight + e.getRowLength(g) * m + h,
o = this.scrollTop - d * m;
var b = 0;
return (l || u) && (b = this.$updateCachedSize(!0, this.gutterWidth, this.$size.width, this.$size.height),
this._signal("scrollbarVisibilityChanged"), u && (s = this.$getLongestLine())),
this.layerConfig = {
width: s,
padding: this.$padding,
firstRow: f,
firstRowScreen: d,
lastRow: g,
lineHeight: m,
characterWidth: this.characterWidth,
minHeight: r,
maxHeight: i,
offset: o,
height: this.$size.scrollerHeight
}, this.$gutterLayer.element.style.marginTop = -o + "px", this.content.style.marginTop = -o + "px",
this.content.style.width = s + 2 * this.$padding + "px", this.content.style.height = r + "px",
b;
}, this.$updateLines = function() {
var e = this.$changedLines.firstRow, t = this.$changedLines.lastRow;
this.$changedLines = null;
var n = this.layerConfig;
return e > n.lastRow + 1 || t < n.firstRow ? void 0 : 1/0 === t ? (this.$showGutter && this.$gutterLayer.update(n),
this.$textLayer.update(n), void 0) : (this.$textLayer.updateLines(n, e, t), !0);
}, this.$getLongestLine = function() {
var e = this.session.getScreenWidth();
return this.showInvisibles && !this.session.$useWrapMode && (e += 1), Math.max(this.$size.scrollerWidth - 2 * this.$padding, Math.round(e * this.characterWidth));
}, this.updateFrontMarkers = function() {
this.$markerFront.setMarkers(this.session.getMarkers(!0)), this.$loop.schedule(this.CHANGE_MARKER_FRONT);
}, this.updateBackMarkers = function() {
this.$markerBack.setMarkers(this.session.getMarkers()), this.$loop.schedule(this.CHANGE_MARKER_BACK);
}, this.addGutterDecoration = function(e, t) {
this.$gutterLayer.addGutterDecoration(e, t);
}, this.removeGutterDecoration = function(e, t) {
this.$gutterLayer.removeGutterDecoration(e, t);
}, this.updateBreakpoints = function() {
this.$loop.schedule(this.CHANGE_GUTTER);
}, this.setAnnotations = function(e) {
this.$gutterLayer.setAnnotations(e), this.$loop.schedule(this.CHANGE_GUTTER);
}, this.updateCursor = function() {
this.$loop.schedule(this.CHANGE_CURSOR);
}, this.hideCursor = function() {
this.$cursorLayer.hideCursor();
}, this.showCursor = function() {
this.$cursorLayer.showCursor();
}, this.scrollSelectionIntoView = function(e, t, n) {
this.scrollCursorIntoView(e, n), this.scrollCursorIntoView(t, n);
}, this.scrollCursorIntoView = function(e, t) {
if (0 !== this.$size.scrollerHeight) {
var n = this.$cursorLayer.getPixelPosition(e), i = n.left, o = n.top, r = this.$scrollAnimation ? this.session.getScrollTop() : this.scrollTop;
r > o ? (t && (o -= t * this.$size.scrollerHeight), 0 == o ? o = -this.scrollMargin.top : 0 == o && (o = +this.scrollMargin.bottom),
this.session.setScrollTop(o)) : r + this.$size.scrollerHeight < o + this.lineHeight && (t && (o += t * this.$size.scrollerHeight),
this.session.setScrollTop(o + this.lineHeight - this.$size.scrollerHeight));
var s = this.scrollLeft;
s > i ? (i < this.$padding + 2 * this.layerConfig.characterWidth && (i = -this.scrollMargin.left),
this.session.setScrollLeft(i)) : s + this.$size.scrollerWidth < i + this.characterWidth ? this.session.setScrollLeft(Math.round(i + this.characterWidth - this.$size.scrollerWidth)) : s <= this.$padding && i - s < this.characterWidth && this.session.setScrollLeft(0);
}
}, this.getScrollTop = function() {
return this.session.getScrollTop();
}, this.getScrollLeft = function() {
return this.session.getScrollLeft();
}, this.getScrollTopRow = function() {
return this.scrollTop / this.lineHeight;
}, this.getScrollBottomRow = function() {
return Math.max(0, Math.floor((this.scrollTop + this.$size.scrollerHeight) / this.lineHeight) - 1);
}, this.scrollToRow = function(e) {
this.session.setScrollTop(e * this.lineHeight);
}, this.alignCursor = function(e, t) {
"number" == typeof e && (e = {
row: e,
column: 0
});
var n = this.$cursorLayer.getPixelPosition(e), i = this.$size.scrollerHeight - this.lineHeight, o = n.top - i * (t || 0);
return this.session.setScrollTop(o), o;
}, this.STEPS = 8, this.$calcSteps = function(e, t) {
var n = 0, i = this.STEPS, o = [], r = function(e, t, n) {
return n * (Math.pow(e - 1, 3) + 1) + t;
};
for (n = 0; i > n; ++n) o.push(r(n / this.STEPS, e, t - e));
return o;
}, this.scrollToLine = function(e, t, n, i) {
var o = this.$cursorLayer.getPixelPosition({
row: e,
column: 0
}), r = o.top;
t && (r -= this.$size.scrollerHeight / 2);
var s = this.scrollTop;
this.session.setScrollTop(r), n !== !1 && this.animateScrolling(s, i);
}, this.animateScrolling = function(e, t) {
var n = this.scrollTop;
if (this.$animatedScroll) {
var i = this;
if (e != n) {
if (this.$scrollAnimation) {
var o = this.$scrollAnimation.steps;
if (o.length && (e = o[0], e == n)) return;
}
var r = i.$calcSteps(e, n);
this.$scrollAnimation = {
from: e,
to: n,
steps: r
}, clearInterval(this.$timer), i.session.setScrollTop(r.shift()), this.$timer = setInterval(function() {
r.length ? (i.session.setScrollTop(r.shift()), i.session.$scrollTop = n) : null != n ? (i.session.$scrollTop = -1,
i.session.setScrollTop(n), n = null) : (i.$timer = clearInterval(i.$timer), i.$scrollAnimation = null,
t && t());
}, 10);
}
}
}, this.scrollToY = function(e) {
this.scrollTop !== e && (this.$loop.schedule(this.CHANGE_SCROLL), this.scrollTop = e);
}, this.scrollToX = function(e) {
this.scrollLeft !== e && (this.scrollLeft = e), this.$loop.schedule(this.CHANGE_H_SCROLL);
}, this.scrollTo = function(e, t) {
this.session.setScrollTop(t), this.session.setScrollLeft(t);
}, this.scrollBy = function(e, t) {
t && this.session.setScrollTop(this.session.getScrollTop() + t), e && this.session.setScrollLeft(this.session.getScrollLeft() + e);
}, this.isScrollableBy = function(e, t) {
return 0 > t && this.session.getScrollTop() >= 1 - this.scrollMargin.top ? !0 : t > 0 && this.session.getScrollTop() + this.$size.scrollerHeight - this.layerConfig.maxHeight - (this.$size.scrollerHeight - this.lineHeight) * this.$scrollPastEnd < -1 + this.scrollMargin.bottom ? !0 : e ? !0 : void 0;
}, this.pixelToScreenCoordinates = function(e, t) {
var n = this.scroller.getBoundingClientRect(), i = (e + this.scrollLeft - n.left - this.$padding) / this.characterWidth, o = Math.floor((t + this.scrollTop - n.top) / this.lineHeight), r = Math.round(i);
return {
row: o,
column: r,
side: i - r > 0 ? 1 : -1
};
}, this.screenToTextCoordinates = function(e, t) {
var n = this.scroller.getBoundingClientRect(), i = Math.round((e + this.scrollLeft - n.left - this.$padding) / this.characterWidth), o = Math.floor((t + this.scrollTop - n.top) / this.lineHeight);
return this.session.screenToDocumentPosition(o, Math.max(i, 0));
}, this.textToScreenCoordinates = function(e, t) {
var n = this.scroller.getBoundingClientRect(), i = this.session.documentToScreenPosition(e, t), o = this.$padding + Math.round(i.column * this.characterWidth), r = i.row * this.lineHeight;
return {
pageX: n.left + o - this.scrollLeft,
pageY: n.top + r - this.scrollTop
};
}, this.visualizeFocus = function() {
i.addCssClass(this.container, "ace_focus");
}, this.visualizeBlur = function() {
i.removeCssClass(this.container, "ace_focus");
}, this.showComposition = function() {
this.$composition || (this.$composition = {
keepTextAreaAtCursor: this.$keepTextAreaAtCursor,
cssText: this.textarea.style.cssText
}), this.$keepTextAreaAtCursor = !0, i.addCssClass(this.textarea, "ace_composition"),
this.textarea.style.cssText = "", this.$moveTextAreaToCursor();
}, this.setCompositionText = function() {
this.$moveTextAreaToCursor();
}, this.hideComposition = function() {
this.$composition && (i.removeCssClass(this.textarea, "ace_composition"), this.$keepTextAreaAtCursor = this.$composition.keepTextAreaAtCursor,
this.textarea.style.cssText = this.$composition.cssText, this.$composition = null);
}, this.setTheme = function(e, t) {
function n(n) {
if (o.$themeValue != e) return t && t();
if (n.cssClass) {
i.importCssString(n.cssText, n.cssClass, o.container.ownerDocument), o.theme && i.removeCssClass(o.container, o.theme.cssClass),
o.$theme = n.cssClass, o.theme = n, i.addCssClass(o.container, n.cssClass), i.setCssClass(o.container, "ace_dark", n.isDark);
var r = n.padding || 4;
o.$padding && r != o.$padding && o.setPadding(r), o.$size && (o.$size.width = 0,
o.onResize()), o._dispatchEvent("themeLoaded", {
theme: n
}), t && t();
}
}
var o = this;
if (this.$themeValue = e, o._dispatchEvent("themeChange", {
theme: e
}), e && "string" != typeof e) n(e); else {
var s = e || "ace/theme/textmate";
r.loadModule([ "theme", s ], n);
}
}, this.getTheme = function() {
return this.$themeValue;
}, this.setStyle = function(e, t) {
i.setCssClass(this.container, e, 0 != t);
}, this.unsetStyle = function(e) {
i.removeCssClass(this.container, e);
}, this.setMouseCursor = function(e) {
this.content.style.cursor = e;
}, this.destroy = function() {
this.$textLayer.destroy(), this.$cursorLayer.destroy();
};
}).call(g.prototype), r.defineOptions(g.prototype, "renderer", {
animatedScroll: {
initialValue: !1
},
showInvisibles: {
set: function(e) {
this.$textLayer.setShowInvisibles(e) && this.$loop.schedule(this.CHANGE_TEXT);
},
initialValue: !1
},
showPrintMargin: {
set: function() {
this.$updatePrintMargin();
},
initialValue: !0
},
printMarginColumn: {
set: function() {
this.$updatePrintMargin();
},
initialValue: 80
},
printMargin: {
set: function(e) {
"number" == typeof e && (this.$printMarginColumn = e), this.$showPrintMargin = !!e,
this.$updatePrintMargin();
},
get: function() {
return this.$showPrintMargin && this.$printMarginColumn;
}
},
showGutter: {
set: function(e) {
this.$gutter.style.display = e ? "block" : "none", this.onGutterResize();
},
initialValue: !0
},
fadeFoldWidgets: {
set: function(e) {
i.setCssClass(this.$gutter, "ace_fade-fold-widgets", e);
},
initialValue: !1
},
showFoldWidgets: {
set: function(e) {
this.$gutterLayer.setShowFoldWidgets(e);
},
initialValue: !0
},
displayIndentGuides: {
set: function(e) {
this.$textLayer.setDisplayIndentGuides(e) && this.$loop.schedule(this.CHANGE_TEXT);
},
initialValue: !0
},
highlightGutterLine: {
set: function(e) {
return this.$gutterLineHighlight ? (this.$gutterLineHighlight.style.display = e ? "" : "none",
this.$cursorLayer.$pixelPos && this.$updateGutterLineHighlight(), void 0) : (this.$gutterLineHighlight = i.createElement("div"),
this.$gutterLineHighlight.className = "ace_gutter-active-line", this.$gutter.appendChild(this.$gutterLineHighlight),
void 0);
},
initialValue: !1,
value: !0
},
hScrollBarAlwaysVisible: {
set: function() {
this.$hScrollBarAlwaysVisible && this.$horizScroll || this.$loop.schedule(this.CHANGE_SCROLL);
},
initialValue: !1
},
vScrollBarAlwaysVisible: {
set: function() {
this.$vScrollBarAlwaysVisible && this.$vScroll || this.$loop.schedule(this.CHANGE_SCROLL);
},
initialValue: !1
},
fontSize: {
set: function(e) {
"number" == typeof e && (e += "px"), this.container.style.fontSize = e, this.updateFontSize();
},
initialValue: 12
},
fontFamily: {
set: function(e) {
this.container.style.fontFamily = e, this.updateFontSize();
}
},
maxLines: {
set: function() {
this.updateFull();
}
},
minLines: {
set: function() {
this.updateFull();
}
},
scrollPastEnd: {
set: function(e) {
e = +e || 0, this.$scrollPastEnd != e && (this.$scrollPastEnd = e, this.$loop.schedule(this.CHANGE_SCROLL));
},
initialValue: 0,
handlesSet: !0
},
fixedWidthGutter: {
set: function(e) {
this.$gutterLayer.$fixedWidth = !!e, this.$loop.schedule(this.CHANGE_GUTTER);
}
}
}), t.VirtualRenderer = g;
}), define("ace/mouse/multi_select_handler", [ "require", "exports", "module", "../lib/event" ], function(e, t) {
function n(e, t) {
return e.row == t.row && e.column == t.column;
}
function i(e) {
var t = e.domEvent, i = t.altKey, r = t.shiftKey, s = e.getAccelKey(), a = e.getButton();
if (e.editor.inMultiSelectMode && 2 == a) return e.editor.textInput.onContextMenu(e.domEvent),
void 0;
if (!s && !i) return 0 == a && e.editor.inMultiSelectMode && e.editor.exitMultiSelectMode(),
void 0;
var l = e.editor, c = l.selection, u = l.inMultiSelectMode, d = e.getDocumentPosition(), h = c.getCursor(), p = e.inSelection() || c.isEmpty() && n(d, h), f = e.x, g = e.y, m = function(e) {
f = e.clientX, g = e.clientY;
}, v = function() {
var e = l.renderer.pixelToScreenCoordinates(f, g), t = b.screenToDocumentPosition(e.row, e.column);
n(w, e) && n(t, c.selectionLead) || (w = e, l.selection.moveCursorToPosition(t),
l.selection.clearSelection(), l.renderer.scrollCursorIntoView(), l.removeSelectionMarkers(C),
C = c.rectangularRangeBlock(w, y), C.forEach(l.addSelectionMarker, l), l.updateSelectionMarkers());
}, b = l.session, y = l.renderer.pixelToScreenCoordinates(f, g), w = y;
if (!s || r || i || 0 != a) {
if (i && 0 == a) {
e.stop(), u && !s ? c.toSingleRange() : !u && s && c.addRange();
var C = [];
r ? (y = b.documentToScreenPosition(c.lead), v()) : (c.moveCursorToPosition(d),
c.clearSelection());
var x = function() {
clearInterval(S), l.removeSelectionMarkers(C);
for (var e = 0; e < C.length; e++) c.addRange(C[e]);
}, E = v;
o.capture(l.container, m, x);
var S = setInterval(function() {
E();
}, 20);
return e.preventDefault();
}
} else {
if (!u && p) return;
if (!u) {
var A = c.toOrientedRange();
l.addSelectionMarker(A);
}
var k = c.rangeList.rangeAtPoint(d);
l.once("mouseup", function() {
var e = c.toOrientedRange();
k && e.isEmpty() && n(k.cursor, e.cursor) ? c.substractPoint(e.cursor) : (A && (l.removeSelectionMarker(A),
c.addRange(A)), c.addRange(e));
});
}
}
var o = e("../lib/event");
t.onMouseDown = i;
}), define("ace/commands/multi_select_commands", [ "require", "exports", "module", "../keyboard/hash_handler" ], function(e, t) {
t.defaultCommands = [ {
name: "addCursorAbove",
exec: function(e) {
e.selectMoreLines(-1);
},
bindKey: {
win: "Ctrl-Alt-Up",
mac: "Ctrl-Alt-Up"
},
readonly: !0
}, {
name: "addCursorBelow",
exec: function(e) {
e.selectMoreLines(1);
},
bindKey: {
win: "Ctrl-Alt-Down",
mac: "Ctrl-Alt-Down"
},
readonly: !0
}, {
name: "addCursorAboveSkipCurrent",
exec: function(e) {
e.selectMoreLines(-1, !0);
},
bindKey: {
win: "Ctrl-Alt-Shift-Up",
mac: "Ctrl-Alt-Shift-Up"
},
readonly: !0
}, {
name: "addCursorBelowSkipCurrent",
exec: function(e) {
e.selectMoreLines(1, !0);
},
bindKey: {
win: "Ctrl-Alt-Shift-Down",
mac: "Ctrl-Alt-Shift-Down"
},
readonly: !0
}, {
name: "selectMoreBefore",
exec: function(e) {
e.selectMore(-1);
},
bindKey: {
win: "Ctrl-Alt-Left",
mac: "Ctrl-Alt-Left"
},
readonly: !0
}, {
name: "selectMoreAfter",
exec: function(e) {
e.selectMore(1);
},
bindKey: {
win: "Ctrl-Alt-Right",
mac: "Ctrl-Alt-Right"
},
readonly: !0
}, {
name: "selectNextBefore",
exec: function(e) {
e.selectMore(-1, !0);
},
bindKey: {
win: "Ctrl-Alt-Shift-Left",
mac: "Ctrl-Alt-Shift-Left"
},
readonly: !0
}, {
name: "selectNextAfter",
exec: function(e) {
e.selectMore(1, !0);
},
bindKey: {
win: "Ctrl-Alt-Shift-Right",
mac: "Ctrl-Alt-Shift-Right"
},
readonly: !0
}, {
name: "splitIntoLines",
exec: function(e) {
e.multiSelect.splitIntoLines();
},
bindKey: {
win: "Ctrl-Alt-L",
mac: "Ctrl-Alt-L"
},
readonly: !0
}, {
name: "alignCursors",
exec: function(e) {
e.alignCursors();
},
bindKey: {
win: "Ctrl-Alt-A",
mac: "Ctrl-Alt-A"
}
} ], t.multiSelectCommands = [ {
name: "singleSelection",
bindKey: "esc",
exec: function(e) {
e.exitMultiSelectMode();
},
readonly: !0,
isAvailable: function(e) {
return e && e.inMultiSelectMode;
}
} ];
var n = e("../keyboard/hash_handler").HashHandler;
t.keyboardHandler = new n(t.multiSelectCommands);
}), define("ace/multi_select", [ "require", "exports", "module", "./range_list", "./range", "./selection", "./mouse/multi_select_handler", "./lib/event", "./lib/lang", "./commands/multi_select_commands", "./search", "./edit_session", "./editor", "./config" ], function(e, t) {
function n(e, t, n) {
return f.$options.wrap = !0, f.$options.needle = t, f.$options.backwards = -1 == n,
f.find(e);
}
function i(e, t) {
return e.row == t.row && e.column == t.column;
}
function o(e) {
e.$multiselectOnSessionChange || (e.$onAddRange = e.$onAddRange.bind(e), e.$onRemoveRange = e.$onRemoveRange.bind(e),
e.$onMultiSelect = e.$onMultiSelect.bind(e), e.$onSingleSelect = e.$onSingleSelect.bind(e),
e.$multiselectOnSessionChange = t.onSessionChange.bind(e), e.$multiselectOnSessionChange(e),
e.on("changeSession", e.$multiselectOnSessionChange), e.on("mousedown", c), e.commands.addCommands(h.defaultCommands),
r(e));
}
function r(e) {
function t() {
i && (e.renderer.setMouseCursor(""), i = !1);
}
var n = e.textInput.getElement(), i = !1;
u.addListener(n, "keydown", function(n) {
18 != n.keyCode || n.ctrlKey || n.shiftKey || n.metaKey ? i && t() : i || (e.renderer.setMouseCursor("crosshair"),
i = !0);
}), u.addListener(n, "keyup", t), u.addListener(n, "blur", t);
}
var s = e("./range_list").RangeList, a = e("./range").Range, l = e("./selection").Selection, c = e("./mouse/multi_select_handler").onMouseDown, u = e("./lib/event"), d = e("./lib/lang"), h = e("./commands/multi_select_commands");
t.commands = h.defaultCommands.concat(h.multiSelectCommands);
var p = e("./search").Search, f = new p(), g = e("./edit_session").EditSession;
(function() {
this.getSelectionMarkers = function() {
return this.$selectionMarkers;
};
}).call(g.prototype), function() {
this.ranges = null, this.rangeList = null, this.addRange = function(e, t) {
if (e) {
if (!this.inMultiSelectMode && 0 == this.rangeCount) {
var n = this.toOrientedRange();
if (this.rangeList.add(n), this.rangeList.add(e), 2 != this.rangeList.ranges.length) return this.rangeList.removeAll(),
t || this.fromOrientedRange(e);
this.rangeList.removeAll(), this.rangeList.add(n), this.$onAddRange(n);
}
e.cursor || (e.cursor = e.end);
var i = this.rangeList.add(e);
return this.$onAddRange(e), i.length && this.$onRemoveRange(i), this.rangeCount > 1 && !this.inMultiSelectMode && (this._emit("multiSelect"),
this.inMultiSelectMode = !0, this.session.$undoSelect = !1, this.rangeList.attach(this.session)),
t || this.fromOrientedRange(e);
}
}, this.toSingleRange = function(e) {
e = e || this.ranges[0];
var t = this.rangeList.removeAll();
t.length && this.$onRemoveRange(t), e && this.fromOrientedRange(e);
}, this.substractPoint = function(e) {
var t = this.rangeList.substractPoint(e);
return t ? (this.$onRemoveRange(t), t[0]) : void 0;
}, this.mergeOverlappingRanges = function() {
var e = this.rangeList.merge();
e.length ? this.$onRemoveRange(e) : this.ranges[0] && this.fromOrientedRange(this.ranges[0]);
}, this.$onAddRange = function(e) {
this.rangeCount = this.rangeList.ranges.length, this.ranges.unshift(e), this._emit("addRange", {
range: e
});
}, this.$onRemoveRange = function(e) {
if (this.rangeCount = this.rangeList.ranges.length, 1 == this.rangeCount && this.inMultiSelectMode) {
var t = this.rangeList.ranges.pop();
e.push(t), this.rangeCount = 0;
}
for (var n = e.length; n--; ) {
var i = this.ranges.indexOf(e[n]);
this.ranges.splice(i, 1);
}
this._emit("removeRange", {
ranges: e
}), 0 == this.rangeCount && this.inMultiSelectMode && (this.inMultiSelectMode = !1,
this._emit("singleSelect"), this.session.$undoSelect = !0, this.rangeList.detach(this.session)),
t = t || this.ranges[0], t && !t.isEqual(this.getRange()) && this.fromOrientedRange(t);
}, this.$initRangeList = function() {
this.rangeList || (this.rangeList = new s(), this.ranges = [], this.rangeCount = 0);
}, this.getAllRanges = function() {
return this.rangeCount ? this.rangeList.ranges.concat() : [ this.getRange() ];
}, this.splitIntoLines = function() {
if (this.rangeCount > 1) {
var e = this.rangeList.ranges, t = e[e.length - 1], n = a.fromPoints(e[0].start, t.end);
this.toSingleRange(), this.setSelectionRange(n, t.cursor == t.start);
} else {
var n = this.getRange(), i = this.isBackwards(), o = n.start.row, r = n.end.row;
if (o == r) {
if (i) var s = n.end, l = n.start; else var s = n.start, l = n.end;
return this.addRange(a.fromPoints(l, l)), this.addRange(a.fromPoints(s, s)), void 0;
}
var c = [], u = this.getLineRange(o, !0);
u.start.column = n.start.column, c.push(u);
for (var d = o + 1; r > d; d++) c.push(this.getLineRange(d, !0));
u = this.getLineRange(r, !0), u.end.column = n.end.column, c.push(u), c.forEach(this.addRange, this);
}
}, this.toggleBlockSelection = function() {
if (this.rangeCount > 1) {
var e = this.rangeList.ranges, t = e[e.length - 1], n = a.fromPoints(e[0].start, t.end);
this.toSingleRange(), this.setSelectionRange(n, t.cursor == t.start);
} else {
var i = this.session.documentToScreenPosition(this.selectionLead), o = this.session.documentToScreenPosition(this.selectionAnchor), r = this.rectangularRangeBlock(i, o);
r.forEach(this.addRange, this);
}
}, this.rectangularRangeBlock = function(e, t, n) {
var o = [], r = e.column < t.column;
if (r) var s = e.column, l = t.column; else var s = t.column, l = e.column;
var c = e.row < t.row;
if (c) var u = e.row, d = t.row; else var u = t.row, d = e.row;
0 > s && (s = 0), 0 > u && (u = 0), u == d && (n = !0);
for (var h = u; d >= h; h++) {
var p = a.fromPoints(this.session.screenToDocumentPosition(h, s), this.session.screenToDocumentPosition(h, l));
if (p.isEmpty()) {
if (f && i(p.end, f)) break;
var f = p.end;
}
p.cursor = r ? p.start : p.end, o.push(p);
}
if (c && o.reverse(), !n) {
for (var g = o.length - 1; o[g].isEmpty() && g > 0; ) g--;
if (g > 0) for (var m = 0; o[m].isEmpty(); ) m++;
for (var v = g; v >= m; v--) o[v].isEmpty() && o.splice(v, 1);
}
return o;
};
}.call(l.prototype);
var m = e("./editor").Editor;
(function() {
this.updateSelectionMarkers = function() {
this.renderer.updateCursor(), this.renderer.updateBackMarkers();
}, this.addSelectionMarker = function(e) {
e.cursor || (e.cursor = e.end);
var t = this.getSelectionStyle();
return e.marker = this.session.addMarker(e, "ace_selection", t), this.session.$selectionMarkers.push(e),
this.session.selectionMarkerCount = this.session.$selectionMarkers.length, e;
}, this.removeSelectionMarker = function(e) {
if (e.marker) {
this.session.removeMarker(e.marker);
var t = this.session.$selectionMarkers.indexOf(e);
-1 != t && this.session.$selectionMarkers.splice(t, 1), this.session.selectionMarkerCount = this.session.$selectionMarkers.length;
}
}, this.removeSelectionMarkers = function(e) {
for (var t = this.session.$selectionMarkers, n = e.length; n--; ) {
var i = e[n];
if (i.marker) {
this.session.removeMarker(i.marker);
var o = t.indexOf(i);
-1 != o && t.splice(o, 1);
}
}
this.session.selectionMarkerCount = t.length;
}, this.$onAddRange = function(e) {
this.addSelectionMarker(e.range), this.renderer.updateCursor(), this.renderer.updateBackMarkers();
}, this.$onRemoveRange = function(e) {
this.removeSelectionMarkers(e.ranges), this.renderer.updateCursor(), this.renderer.updateBackMarkers();
}, this.$onMultiSelect = function() {
this.inMultiSelectMode || (this.inMultiSelectMode = !0, this.setStyle("ace_multiselect"),
this.keyBinding.addKeyboardHandler(h.keyboardHandler), this.commands.setDefaultHandler("exec", this.$onMultiSelectExec),
this.renderer.updateCursor(), this.renderer.updateBackMarkers());
}, this.$onSingleSelect = function() {
this.session.multiSelect.inVirtualMode || (this.inMultiSelectMode = !1, this.unsetStyle("ace_multiselect"),
this.keyBinding.removeKeyboardHandler(h.keyboardHandler), this.commands.removeDefaultHandler("exec", this.$onMultiSelectExec),
this.renderer.updateCursor(), this.renderer.updateBackMarkers());
}, this.$onMultiSelectExec = function(e) {
var t = e.command, n = e.editor;
if (n.multiSelect) {
if (t.multiSelectAction) "forEach" == t.multiSelectAction ? i = n.forEachSelection(t, e.args) : "forEachLine" == t.multiSelectAction ? i = n.forEachSelection(t, e.args, !0) : "single" == t.multiSelectAction ? (n.exitMultiSelectMode(),
i = t.exec(n, e.args || {})) : i = t.multiSelectAction(n, e.args || {}); else {
var i = t.exec(n, e.args || {});
n.multiSelect.addRange(n.multiSelect.toOrientedRange()), n.multiSelect.mergeOverlappingRanges();
}
return i;
}
}, this.forEachSelection = function(e, t, n) {
if (!this.inVirtualSelectionMode) {
var i, o = this.session, r = this.selection, s = r.rangeList, a = r._eventRegistry;
r._eventRegistry = {};
var c = new l(o);
this.inVirtualSelectionMode = !0;
for (var u = s.ranges.length; u--; ) {
if (n) for (;u > 0 && s.ranges[u].start.row == s.ranges[u - 1].end.row; ) u--;
c.fromOrientedRange(s.ranges[u]), this.selection = o.selection = c;
var d = e.exec(this, t || {});
void 0 == !i && (i = d), c.toOrientedRange(s.ranges[u]);
}
c.detach(), this.selection = o.selection = r, this.inVirtualSelectionMode = !1,
r._eventRegistry = a, r.mergeOverlappingRanges();
var h = this.renderer.$scrollAnimation;
return this.onCursorChange(), this.onSelectionChange(), h && h.from == h.to && this.renderer.animateScrolling(h.from),
i;
}
}, this.exitMultiSelectMode = function() {
this.inMultiSelectMode && !this.inVirtualSelectionMode && this.multiSelect.toSingleRange();
}, this.getSelectedText = function() {
var e = "";
if (this.inMultiSelectMode && !this.inVirtualSelectionMode) {
for (var t = this.multiSelect.rangeList.ranges, n = [], i = 0; i < t.length; i++) n.push(this.session.getTextRange(t[i]));
var o = this.session.getDocument().getNewLineCharacter();
e = n.join(o), e.length == (n.length - 1) * o.length && (e = "");
} else this.selection.isEmpty() || (e = this.session.getTextRange(this.getSelectionRange()));
return e;
}, this.onPaste = function(e) {
if (!this.$readOnly) {
if (this._signal("paste", e), !this.inMultiSelectMode || this.inVirtualSelectionMode) return this.insert(e);
var t = e.split(/\r\n|\r|\n/), n = this.selection.rangeList.ranges;
if (t.length > n.length || t.length < 2 || !t[1]) return this.commands.exec("insertstring", this, e);
for (var i = n.length; i--; ) {
var o = n[i];
o.isEmpty() || this.session.remove(o), this.session.insert(o.start, t[i]);
}
}
}, this.findAll = function(e, t, n) {
t = t || {}, t.needle = e || t.needle, this.$search.set(t);
var i = this.$search.findAll(this.session);
if (!i.length) return 0;
this.$blockScrolling += 1;
var o = this.multiSelect;
n || o.toSingleRange(i[0]);
for (var r = i.length; r--; ) o.addRange(i[r], !0);
return this.$blockScrolling -= 1, i.length;
}, this.selectMoreLines = function(e, t) {
var n = this.selection.toOrientedRange(), i = n.cursor == n.end, o = this.session.documentToScreenPosition(n.cursor);
this.selection.$desiredColumn && (o.column = this.selection.$desiredColumn);
var r = this.session.screenToDocumentPosition(o.row + e, o.column);
if (n.isEmpty()) var s = r; else var l = this.session.documentToScreenPosition(i ? n.end : n.start), s = this.session.screenToDocumentPosition(l.row + e, l.column);
if (i) {
var c = a.fromPoints(r, s);
c.cursor = c.start;
} else {
var c = a.fromPoints(s, r);
c.cursor = c.end;
}
if (c.desiredColumn = o.column, this.selection.inMultiSelectMode) {
if (t) var u = n.cursor;
} else this.selection.addRange(n);
this.selection.addRange(c), u && this.selection.substractPoint(u);
}, this.transposeSelections = function(e) {
for (var t = this.session, n = t.multiSelect, i = n.ranges, o = i.length; o--; ) {
var r = i[o];
if (r.isEmpty()) {
var s = t.getWordRange(r.start.row, r.start.column);
r.start.row = s.start.row, r.start.column = s.start.column, r.end.row = s.end.row,
r.end.column = s.end.column;
}
}
n.mergeOverlappingRanges();
for (var a = [], o = i.length; o--; ) {
var r = i[o];
a.unshift(t.getTextRange(r));
}
0 > e ? a.unshift(a.pop()) : a.push(a.shift());
for (var o = i.length; o--; ) {
var r = i[o], s = r.clone();
t.replace(r, a[o]), r.start.row = s.start.row, r.start.column = s.start.column;
}
}, this.selectMore = function(e, t) {
var i = this.session, o = i.multiSelect, r = o.toOrientedRange();
if (r.isEmpty()) {
var r = i.getWordRange(r.start.row, r.start.column);
r.cursor = r.end, this.multiSelect.addRange(r);
}
var s = i.getTextRange(r), a = n(i, s, e);
a && (a.cursor = -1 == e ? a.start : a.end, this.multiSelect.addRange(a)), t && this.multiSelect.substractPoint(r.cursor);
}, this.alignCursors = function() {
var e = this.session, t = e.multiSelect, n = t.ranges;
if (n.length) {
var i = -1, o = n.filter(function(e) {
return e.cursor.row == i ? !0 : (i = e.cursor.row, void 0);
});
t.$onRemoveRange(o);
var r = 0, s = 1/0, l = n.map(function(t) {
var n = t.cursor, i = e.getLine(n.row), o = i.substr(n.column).search(/\S/g);
return -1 == o && (o = 0), n.column > r && (r = n.column), s > o && (s = o), o;
});
n.forEach(function(t, n) {
var i = t.cursor, o = r - i.column, c = l[n] - s;
o > c ? e.insert(i, d.stringRepeat(" ", o - c)) : e.remove(new a(i.row, i.column, i.row, i.column - o + c)),
t.start.column = t.end.column = r, t.start.row = t.end.row = i.row, t.cursor = t.end;
}), t.fromOrientedRange(n[0]), this.renderer.updateCursor(), this.renderer.updateBackMarkers();
} else {
var c = this.selection.getRange(), u = c.start.row, h = c.end.row, p = this.session.doc.removeLines(u, h);
p = this.$reAlignText(p), this.session.doc.insertLines(u, p), c.start.column = 0,
c.end.column = p[p.length - 1].length, this.selection.setRange(c);
}
}, this.$reAlignText = function(e) {
function t(e) {
return d.stringRepeat(" ", e);
}
function n(e) {
return e[2] ? t(r) + e[2] + t(s - e[2].length + a) + e[4].replace(/^([=:])\s+/, "$1 ") : e[0];
}
function i(e) {
return e[2] ? t(r + s - e[2].length) + e[2] + t(a, " ") + e[4].replace(/^([=:])\s+/, "$1 ") : e[0];
}
function o(e) {
return e[2] ? t(r) + e[2] + t(a) + e[4].replace(/^([=:])\s+/, "$1 ") : e[0];
}
var r, s, a, l = !0, c = !0;
return e.map(function(e) {
var t = e.match(/(\s*)(.*?)(\s*)([=:].*)/);
return t ? null == r ? (r = t[1].length, s = t[2].length, a = t[3].length, t) : (r + s + a != t[1].length + t[2].length + t[3].length && (c = !1),
r != t[1].length && (l = !1), r > t[1].length && (r = t[1].length), s < t[2].length && (s = t[2].length),
a > t[3].length && (a = t[3].length), t) : [ e ];
}).map(l ? c ? i : n : o);
};
}).call(m.prototype), t.onSessionChange = function(e) {
var t = e.session;
t.multiSelect || (t.$selectionMarkers = [], t.selection.$initRangeList(), t.multiSelect = t.selection),
this.multiSelect = t.multiSelect;
var n = e.oldSession;
n && (n.multiSelect.removeEventListener("addRange", this.$onAddRange), n.multiSelect.removeEventListener("removeRange", this.$onRemoveRange),
n.multiSelect.removeEventListener("multiSelect", this.$onMultiSelect), n.multiSelect.removeEventListener("singleSelect", this.$onSingleSelect)),
t.multiSelect.on("addRange", this.$onAddRange), t.multiSelect.on("removeRange", this.$onRemoveRange),
t.multiSelect.on("multiSelect", this.$onMultiSelect), t.multiSelect.on("singleSelect", this.$onSingleSelect),
this.inMultiSelectMode != t.selection.inMultiSelectMode && (t.selection.inMultiSelectMode ? this.$onMultiSelect() : this.$onSingleSelect());
}, t.MultiSelect = o, e("./config").defineOptions(m.prototype, "editor", {
enableMultiselect: {
set: function(e) {
o(this), e ? (this.on("changeSession", this.$multiselectOnSessionChange), this.on("mousedown", c)) : (this.off("changeSession", this.$multiselectOnSessionChange),
this.off("mousedown", c));
},
value: !0
}
});
}), define("ace/worker/worker_client", [ "require", "exports", "module", "../lib/oop", "../lib/event_emitter", "../config" ], function(e, t) {
var n = e("../lib/oop"), i = e("../lib/event_emitter").EventEmitter, o = e("../config"), r = function(t, n, i) {
this.$sendDeltaQueue = this.$sendDeltaQueue.bind(this), this.changeListener = this.changeListener.bind(this),
this.onMessage = this.onMessage.bind(this), this.onError = this.onError.bind(this),
e.nameToUrl && !e.toUrl && (e.toUrl = e.nameToUrl);
var r;
if (o.get("packaged") || !e.toUrl) r = o.moduleUrl(n, "worker"); else {
var s = this.$normalizePath;
r = s(e.toUrl("ace/worker/worker.js", null, "_"));
var a = {};
t.forEach(function(t) {
a[t] = s(e.toUrl(t, null, "_").replace(/(\.js)?(\?.*)?$/, ""));
});
}
this.$worker = new Worker(r), this.$worker.postMessage({
init: !0,
tlns: a,
module: n,
classname: i
}), this.callbackId = 1, this.callbacks = {}, this.$worker.onerror = this.onError,
this.$worker.onmessage = this.onMessage;
};
(function() {
n.implement(this, i), this.onError = function(e) {
throw window.console && console.log && console.log(e), e;
}, this.onMessage = function(e) {
var t = e.data;
switch (t.type) {
case "log":
window.console && console.log && console.log.apply(console, t.data);
break;
case "event":
this._emit(t.name, {
data: t.data
});
break;
case "call":
var n = this.callbacks[t.id];
n && (n(t.data), delete this.callbacks[t.id]);
}
}, this.$normalizePath = function(e) {
return location.host ? (e = e.replace(/^[a-z]+:\/\/[^\/]+/, ""), e = location.protocol + "//" + location.host + ("/" == e.charAt(0) ? "" : location.pathname.replace(/\/[^\/]*$/, "")) + "/" + e.replace(/^[\/]+/, "")) : e;
}, this.terminate = function() {
this._emit("terminate", {}), this.deltaQueue = null, this.$worker.terminate(), this.$worker = null,
this.$doc.removeEventListener("change", this.changeListener), this.$doc = null;
}, this.send = function(e, t) {
this.$worker.postMessage({
command: e,
args: t
});
}, this.call = function(e, t, n) {
if (n) {
var i = this.callbackId++;
this.callbacks[i] = n, t.push(i);
}
this.send(e, t);
}, this.emit = function(e, t) {
try {
this.$worker.postMessage({
event: e,
data: {
data: t.data
}
});
} catch (n) {}
}, this.attachToDocument = function(e) {
this.$doc && this.terminate(), this.$doc = e, this.call("setValue", [ e.getValue() ]),
e.on("change", this.changeListener);
}, this.changeListener = function(e) {
this.deltaQueue ? this.deltaQueue.push(e.data) : (this.deltaQueue = [ e.data ],
setTimeout(this.$sendDeltaQueue, 1));
}, this.$sendDeltaQueue = function() {
var e = this.deltaQueue;
e && (this.deltaQueue = null, e.length > 20 && e.length > this.$doc.getLength() >> 1 ? this.call("setValue", [ this.$doc.getValue() ]) : this.emit("change", {
data: e
}));
};
}).call(r.prototype);
var s = function(e, t, n) {
this.$sendDeltaQueue = this.$sendDeltaQueue.bind(this), this.changeListener = this.changeListener.bind(this),
this.callbackId = 1, this.callbacks = {}, this.messageBuffer = [];
var r = null, s = Object.create(i), a = this;
this.$worker = {}, this.$worker.terminate = function() {}, this.$worker.postMessage = function(e) {
a.messageBuffer.push(e), r && setTimeout(l);
};
var l = function() {
var e = a.messageBuffer.shift();
e.command ? r[e.command].apply(r, e.args) : e.event && s._emit(e.event, e.data);
};
s.postMessage = function(e) {
a.onMessage({
data: e
});
}, s.callback = function(e, t) {
this.postMessage({
type: "call",
id: t,
data: e
});
}, s.emit = function(e, t) {
this.postMessage({
type: "event",
name: e,
data: t
});
}, o.loadModule([ "worker", t ], function(e) {
for (r = new e[n](s); a.messageBuffer.length; ) l();
});
};
s.prototype = r.prototype, t.UIWorkerClient = s, t.WorkerClient = r;
}), define("ace/placeholder", [ "require", "exports", "module", "./range", "./lib/event_emitter", "./lib/oop" ], function(e, t) {
var n = e("./range").Range, i = e("./lib/event_emitter").EventEmitter, o = e("./lib/oop"), r = function(e, t, n, i, o, r) {
var s = this;
this.length = t, this.session = e, this.doc = e.getDocument(), this.mainClass = o,
this.othersClass = r, this.$onUpdate = this.onUpdate.bind(this), this.doc.on("change", this.$onUpdate),
this.$others = i, this.$onCursorChange = function() {
setTimeout(function() {
s.onCursorChange();
});
}, this.$pos = n;
var a = e.getUndoManager().$undoStack || e.getUndoManager().$undostack || {
length: -1
};
this.$undoStackDepth = a.length, this.setup(), e.selection.on("changeCursor", this.$onCursorChange);
};
(function() {
o.implement(this, i), this.setup = function() {
var e = this, t = this.doc, i = this.session, o = this.$pos;
this.pos = t.createAnchor(o.row, o.column), this.markerId = i.addMarker(new n(o.row, o.column, o.row, o.column + this.length), this.mainClass, null, !1),
this.pos.on("change", function(t) {
i.removeMarker(e.markerId), e.markerId = i.addMarker(new n(t.value.row, t.value.column, t.value.row, t.value.column + e.length), e.mainClass, null, !1);
}), this.others = [], this.$others.forEach(function(n) {
var i = t.createAnchor(n.row, n.column);
e.others.push(i);
}), i.setUndoSelect(!1);
}, this.showOtherMarkers = function() {
if (!this.othersActive) {
var e = this.session, t = this;
this.othersActive = !0, this.others.forEach(function(i) {
i.markerId = e.addMarker(new n(i.row, i.column, i.row, i.column + t.length), t.othersClass, null, !1),
i.on("change", function(o) {
e.removeMarker(i.markerId), i.markerId = e.addMarker(new n(o.value.row, o.value.column, o.value.row, o.value.column + t.length), t.othersClass, null, !1);
});
});
}
}, this.hideOtherMarkers = function() {
if (this.othersActive) {
this.othersActive = !1;
for (var e = 0; e < this.others.length; e++) this.session.removeMarker(this.others[e].markerId);
}
}, this.onUpdate = function(e) {
var t = e.data, i = t.range;
if (i.start.row === i.end.row && i.start.row === this.pos.row && !this.$updating) {
this.$updating = !0;
var o = "insertText" === t.action ? i.end.column - i.start.column : i.start.column - i.end.column;
if (i.start.column >= this.pos.column && i.start.column <= this.pos.column + this.length + 1) {
var r = i.start.column - this.pos.column;
if (this.length += o, !this.session.$fromUndo) {
if ("insertText" === t.action) for (var s = this.others.length - 1; s >= 0; s--) {
var a = this.others[s], l = {
row: a.row,
column: a.column + r
};
a.row === i.start.row && i.start.column < a.column && (l.column += o), this.doc.insert(l, t.text);
} else if ("removeText" === t.action) for (var s = this.others.length - 1; s >= 0; s--) {
var a = this.others[s], l = {
row: a.row,
column: a.column + r
};
a.row === i.start.row && i.start.column < a.column && (l.column += o), this.doc.remove(new n(l.row, l.column, l.row, l.column - o));
}
i.start.column === this.pos.column && "insertText" === t.action ? setTimeout(function() {
this.pos.setPosition(this.pos.row, this.pos.column - o);
for (var e = 0; e < this.others.length; e++) {
var t = this.others[e], n = {
row: t.row,
column: t.column - o
};
t.row === i.start.row && i.start.column < t.column && (n.column += o), t.setPosition(n.row, n.column);
}
}.bind(this), 0) : i.start.column === this.pos.column && "removeText" === t.action && setTimeout(function() {
for (var e = 0; e < this.others.length; e++) {
var t = this.others[e];
t.row === i.start.row && i.start.column < t.column && t.setPosition(t.row, t.column - o);
}
}.bind(this), 0);
}
this.pos._emit("change", {
value: this.pos
});
for (var s = 0; s < this.others.length; s++) this.others[s]._emit("change", {
value: this.others[s]
});
}
this.$updating = !1;
}
}, this.onCursorChange = function(e) {
if (!this.$updating) {
var t = this.session.selection.getCursor();
t.row === this.pos.row && t.column >= this.pos.column && t.column <= this.pos.column + this.length ? (this.showOtherMarkers(),
this._emit("cursorEnter", e)) : (this.hideOtherMarkers(), this._emit("cursorLeave", e));
}
}, this.detach = function() {
this.session.removeMarker(this.markerId), this.hideOtherMarkers(), this.doc.removeEventListener("change", this.$onUpdate),
this.session.selection.removeEventListener("changeCursor", this.$onCursorChange),
this.pos.detach();
for (var e = 0; e < this.others.length; e++) this.others[e].detach();
this.session.setUndoSelect(!0);
}, this.cancel = function() {
if (-1 === this.$undoStackDepth) throw Error("Canceling placeholders only supported with undo manager attached to session.");
for (var e = this.session.getUndoManager(), t = (e.$undoStack || e.$undostack).length - this.$undoStackDepth, n = 0; t > n; n++) e.undo(!0);
};
}).call(r.prototype), t.PlaceHolder = r;
}), define("ace/mode/folding/fold_mode", [ "require", "exports", "module", "../../range" ], function(e, t) {
var n = e("../../range").Range, i = t.FoldMode = function() {};
(function() {
this.foldingStartMarker = null, this.foldingStopMarker = null, this.getFoldWidget = function(e, t, n) {
var i = e.getLine(n);
return this.foldingStartMarker.test(i) ? "start" : "markbeginend" == t && this.foldingStopMarker && this.foldingStopMarker.test(i) ? "end" : "";
}, this.getFoldWidgetRange = function() {
return null;
}, this.indentationBlock = function(e, t, i) {
var o = /\S/, r = e.getLine(t), s = r.search(o);
if (-1 != s) {
for (var a = i || r.length, l = e.getLength(), c = t, u = t; ++t < l; ) {
var d = e.getLine(t).search(o);
if (-1 != d) {
if (s >= d) break;
u = t;
}
}
if (u > c) {
var h = e.getLine(u).length;
return new n(c, a, u, h);
}
}
}, this.openingBracketBlock = function(e, t, i, o, r) {
var s = {
row: i,
column: o + 1
}, a = e.$findClosingBracket(t, s, r);
if (a) {
var l = e.foldWidgets[a.row];
return null == l && (l = this.getFoldWidget(e, a.row)), "start" == l && a.row > s.row && (a.row--,
a.column = e.getLine(a.row).length), n.fromPoints(s, a);
}
}, this.closingBracketBlock = function(e, t, i, o) {
var r = {
row: i,
column: o
}, s = e.$findOpeningBracket(t, r);
return s ? (s.column++, r.column--, n.fromPoints(s, r)) : void 0;
};
}).call(i.prototype);
}), define("ace/theme/textmate", [ "require", "exports", "module", "../requirejs/text!./textmate.css", "../lib/dom" ], function(e, t) {
t.isDark = !1, t.cssClass = "ace-tm", t.cssText = e("../requirejs/text!./textmate.css");
var n = e("../lib/dom");
n.importCssString(t.cssText, t.cssClass);
}), define("ace/ace", [ "require", "exports", "module", "./lib/fixoldbrowsers", "./lib/dom", "./lib/event", "./editor", "./edit_session", "./undomanager", "./virtual_renderer", "./multi_select", "./worker/worker_client", "./keyboard/hash_handler", "./placeholder", "./mode/folding/fold_mode", "./theme/textmate", "./config" ], function(e, t) {
e("./lib/fixoldbrowsers");
var n = e("./lib/dom"), i = e("./lib/event"), o = e("./editor").Editor, r = e("./edit_session").EditSession, s = e("./undomanager").UndoManager, a = e("./virtual_renderer").VirtualRenderer, l = e("./multi_select").MultiSelect;
e("./worker/worker_client"), e("./keyboard/hash_handler"), e("./placeholder"), e("./mode/folding/fold_mode"),
e("./theme/textmate"), t.config = e("./config"), t.require = e, t.edit = function(e) {
if ("string" == typeof e) {
var r = e, e = document.getElementById(r);
if (!e) throw "ace.edit can't find div #" + r;
}
if (e.env && e.env.editor instanceof o) return e.env.editor;
var s = t.createEditSession(n.getInnerText(e));
e.innerHTML = "";
var c = new o(new a(e));
new l(c), c.setSession(s);
var u = {
document: s,
editor: c,
onResize: c.resize.bind(c, null)
};
return i.addListener(window, "resize", u.onResize), c.on("destroy", function() {
i.removeListener(window, "resize", u.onResize);
}), e.env = c.env = u, c;
}, t.createEditSession = function(e, t) {
var n = new r(e, t);
return n.setUndoManager(new s()), n;
}, t.EditSession = r, t.UndoManager = s;
}), define("ace", [ "ace/ace" ], function(e) {
return e;
});
var saveAs = saveAs || navigator.msSaveOrOpenBlob && navigator.msSaveOrOpenBlob.bind(navigator) || function(e) {
var t = e.document, n = function() {
return e.URL || e.webkitURL || e;
}, i = e.URL || e.webkitURL || e, o = t.createElementNS("http://www.w3.org/1999/xhtml", "a"), r = !e.externalHost && "download" in o, s = function(n) {
var i = t.createEvent("MouseEvents");
i.initMouseEvent("click", !0, !1, e, 0, 0, 0, 0, 0, !1, !1, !1, !1, 0, null), n.dispatchEvent(i);
}, a = e.webkitRequestFileSystem, l = e.requestFileSystem || a || e.mozRequestFileSystem, c = function(t) {
(e.setImmediate || e.setTimeout)(function() {
throw t;
}, 0);
}, u = "application/octet-stream", d = 0, h = [], p = function() {
for (var e = h.length; e--; ) {
var t = h[e];
"string" == typeof t ? i.revokeObjectURL(t) : t.remove();
}
h.length = 0;
}, f = function(e, t, n) {
t = [].concat(t);
for (var i = t.length; i--; ) {
var o = e["on" + t[i]];
if ("function" == typeof o) try {
o.call(e, n || e);
} catch (r) {
c(r);
}
}
}, g = function(t, i) {
var c, p, g, m = this, v = t.type, b = !1, y = function() {
var e = n().createObjectURL(t);
return h.push(e), e;
}, w = function() {
f(m, "writestart progress write writeend".split(" "));
}, C = function() {
(b || !c) && (c = y(t)), p ? p.location.href = c : window.open(c, "_blank"), m.readyState = m.DONE,
w();
}, x = function(e) {
return function() {
return m.readyState !== m.DONE ? e.apply(this, arguments) : void 0;
};
}, E = {
create: !0,
exclusive: !1
};
return m.readyState = m.INIT, i || (i = "download"), r ? (c = y(t), o.href = c,
o.download = i, s(o), m.readyState = m.DONE, w(), void 0) : (e.chrome && v && v !== u && (g = t.slice || t.webkitSlice,
t = g.call(t, 0, t.size, u), b = !0), a && "download" !== i && (i += ".download"),
(v === u || a) && (p = e), l ? (d += t.size, l(e.TEMPORARY, d, x(function(e) {
e.root.getDirectory("saved", E, x(function(e) {
var n = function() {
e.getFile(i, E, x(function(e) {
e.createWriter(x(function(n) {
n.onwriteend = function(t) {
p.location.href = e.toURL(), h.push(e), m.readyState = m.DONE, f(m, "writeend", t);
}, n.onerror = function() {
var e = n.error;
e.code !== e.ABORT_ERR && C();
}, "writestart progress write abort".split(" ").forEach(function(e) {
n["on" + e] = m["on" + e];
}), n.write(t), m.abort = function() {
n.abort(), m.readyState = m.DONE;
}, m.readyState = m.WRITING;
}), C);
}), C);
};
e.getFile(i, {
create: !1
}, x(function(e) {
e.remove(), n();
}), x(function(e) {
e.code === e.NOT_FOUND_ERR ? n() : C();
}));
}), C);
}), C), void 0) : (C(), void 0));
}, m = g.prototype, v = function(e, t) {
return new g(e, t);
};
return m.abort = function() {
var e = this;
e.readyState = e.DONE, f(e, "abort");
}, m.readyState = m.INIT = 0, m.WRITING = 1, m.DONE = 2, m.error = m.onwritestart = m.onprogress = m.onwrite = m.onabort = m.onerror = m.onwriteend = null,
e.addEventListener("unload", p, !1), v;
}(self);
"undefined" != typeof module && (module.exports = saveAs), define("FileSaver", function() {}),
"undefined" != typeof module && module.exports && (module.exports = printStackTrace),
printStackTrace.implementation = function() {}, printStackTrace.implementation.prototype = {
run: function(e, t) {
return e = e || this.createException(), t = t || this.mode(e), "other" === t ? this.other(arguments.callee) : this[t](e);
},
createException: function() {
try {
this.undef();
} catch (e) {
return e;
}
},
mode: function(e) {
return e.arguments && e.stack ? "chrome" : e.stack && e.sourceURL ? "safari" : e.stack && e.number ? "ie" : "string" == typeof e.message && "undefined" != typeof window && window.opera ? e.stacktrace ? e.message.indexOf("\n") > -1 && e.message.split("\n").length > e.stacktrace.split("\n").length ? "opera9" : e.stack ? e.stacktrace.indexOf("called from line") < 0 ? "opera10b" : "opera11" : "opera10a" : "opera9" : e.stack && !e.fileName ? "chrome" : e.stack ? "firefox" : "other";
},
instrumentFunction: function(e, t, n) {
e = e || window;
var i = e[t];
e[t] = function() {
return n.call(this, printStackTrace().slice(4)), e[t]._instrumented.apply(this, arguments);
}, e[t]._instrumented = i;
},
deinstrumentFunction: function(e, t) {
e[t].constructor === Function && e[t]._instrumented && e[t]._instrumented.constructor === Function && (e[t] = e[t]._instrumented);
},
chrome: function(e) {
var t = (e.stack + "\n").replace(/^\S[^\(]+?[\n$]/gm, "").replace(/^\s+(at eval )?at\s+/gm, "").replace(/^([^\(]+?)([\n$])/gm, "{anonymous}()@$1$2").replace(/^Object.<anonymous>\s*\(([^\)]+)\)/gm, "{anonymous}()@$1").split("\n");
return t.pop(), t;
},
safari: function(e) {
return e.stack.replace(/\[native code\]\n/m, "").replace(/^(?=\w+Error\:).*$\n/m, "").replace(/^@/gm, "{anonymous}()@").split("\n");
},
ie: function(e) {
var t = /^.*at (\w+) \(([^\)]+)\)$/gm;
return e.stack.replace(/at Anonymous function /gm, "{anonymous}()@").replace(/^(?=\w+Error\:).*$\n/m, "").replace(t, "$1@$2").split("\n");
},
firefox: function(e) {
return e.stack.replace(/(?:\n@:0)?\s+$/m, "").replace(/^[\(@]/gm, "{anonymous}()@").split("\n");
},
opera11: function(e) {
for (var t = "{anonymous}", n = /^.*line (\d+), column (\d+)(?: in (.+))? in (\S+):$/, i = e.stacktrace.split("\n"), o = [], r = 0, s = i.length; s > r; r += 2) {
var a = n.exec(i[r]);
if (a) {
var l = a[4] + ":" + a[1] + ":" + a[2], c = a[3] || "global code";
c = c.replace(/<anonymous function: (\S+)>/, "$1").replace(/<anonymous function>/, t),
o.push(c + "@" + l + " -- " + i[r + 1].replace(/^\s+/, ""));
}
}
return o;
},
opera10b: function(e) {
for (var t = /^(.*)@(.+):(\d+)$/, n = e.stacktrace.split("\n"), i = [], o = 0, r = n.length; r > o; o++) {
var s = t.exec(n[o]);
if (s) {
var a = s[1] ? s[1] + "()" : "global code";
i.push(a + "@" + s[2] + ":" + s[3]);
}
}
return i;
},
opera10a: function(e) {
for (var t = "{anonymous}", n = /Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i, i = e.stacktrace.split("\n"), o = [], r = 0, s = i.length; s > r; r += 2) {
var a = n.exec(i[r]);
if (a) {
var l = a[3] || t;
o.push(l + "()@" + a[2] + ":" + a[1] + " -- " + i[r + 1].replace(/^\s+/, ""));
}
}
return o;
},
opera9: function(e) {
for (var t = "{anonymous}", n = /Line (\d+).*script (?:in )?(\S+)/i, i = e.message.split("\n"), o = [], r = 2, s = i.length; s > r; r += 2) {
var a = n.exec(i[r]);
a && o.push(t + "()@" + a[2] + ":" + a[1] + " -- " + i[r + 1].replace(/^\s+/, ""));
}
return o;
},
other: function(e) {
for (var t, n, i = "{anonymous}", o = /function\s*([\w\-$]+)?\s*\(/i, r = [], s = 10; e && e.arguments && r.length < s; ) t = o.test(e.toString()) ? RegExp.$1 || i : i,
n = Array.prototype.slice.call(e.arguments || []), r[r.length] = t + "(" + this.stringifyArguments(n) + ")",
e = e.caller;
return r;
},
stringifyArguments: function(e) {
for (var t = [], n = Array.prototype.slice, i = 0; i < e.length; ++i) {
var o = e[i];
void 0 === o ? t[i] = "undefined" : null === o ? t[i] = "null" : o.constructor && (o.constructor === Array ? t[i] = o.length < 3 ? "[" + this.stringifyArguments(o) + "]" : "[" + this.stringifyArguments(n.call(o, 0, 1)) + "..." + this.stringifyArguments(n.call(o, -1)) + "]" : o.constructor === Object ? t[i] = "#object" : o.constructor === Function ? t[i] = "#function" : o.constructor === String ? t[i] = '"' + o + '"' : o.constructor === Number && (t[i] = o));
}
return t.join(",");
},
sourceCache: {},
ajax: function(e) {
var t = this.createXMLHTTPObject();
if (t) try {
return t.open("GET", e, !1), t.send(null), t.responseText;
} catch (n) {}
return "";
},
createXMLHTTPObject: function() {
for (var e, t = [ function() {
return new XMLHttpRequest();
}, function() {
return new ActiveXObject("Msxml2.XMLHTTP");
}, function() {
return new ActiveXObject("Msxml3.XMLHTTP");
}, function() {
return new ActiveXObject("Microsoft.XMLHTTP");
} ], n = 0; n < t.length; n++) try {
return e = t[n](), this.createXMLHTTPObject = t[n], e;
} catch (i) {}
},
isSameDomain: function(e) {
return "undefined" != typeof location && -1 !== e.indexOf(location.hostname);
},
getSource: function(e) {
return e in this.sourceCache || (this.sourceCache[e] = this.ajax(e).split("\n")),
this.sourceCache[e];
},
guessAnonymousFunctions: function(e) {
for (var t = 0; t < e.length; ++t) {
var n = /\{anonymous\}\(.*\)@(.*)/, i = /^(.*?)(?::(\d+))(?::(\d+))?(?: -- .+)?$/, o = e[t], r = n.exec(o);
if (r) {
var s = i.exec(r[1]);
if (s) {
var a = s[1], l = s[2], c = s[3] || 0;
if (a && this.isSameDomain(a) && l) {
var u = this.guessAnonymousFunction(a, l, c);
e[t] = o.replace("{anonymous}", u);
}
}
}
}
return e;
},
guessAnonymousFunction: function(e, t) {
var n;
try {
n = this.findFunctionName(this.getSource(e), t);
} catch (i) {
n = "getSource failed with url: " + e + ", exception: " + i.toString();
}
return n;
},
findFunctionName: function(e, t) {
for (var n, i, o, r = /function\s+([^(]*?)\s*\(([^)]*)\)/, s = /['"]?([$_A-Za-z][$_A-Za-z0-9]*)['"]?\s*[:=]\s*function\b/, a = /['"]?([$_A-Za-z][$_A-Za-z0-9]*)['"]?\s*[:=]\s*(?:eval|new Function)\b/, l = "", c = Math.min(t, 20), u = 0; c > u; ++u) if (n = e[t - u - 1],
o = n.indexOf("//"), o >= 0 && (n = n.substr(0, o)), n) {
if (l = n + l, i = s.exec(l), i && i[1]) return i[1];
if (i = r.exec(l), i && i[1]) return i[1];
if (i = a.exec(l), i && i[1]) return i[1];
}
return "(?)";
}
}, define("stacktrace", function() {}), define("utils", [ "jquery", "underscore", "crel", "FileSaver", "stacktrace" ], function($, _, crel) {
function jqElt(e) {
return _.isString(e) ? $(e) : e;
}
function inputError(e, t) {
void 0 !== t && (e.stop(!0, !0).addClass("error").delay(1e3).switchClass("error"),
t.stopPropagation());
}
var utils = {};
utils.getURLParameter = function(e) {
var t = new RegExp(e + "=(.+?)(&|$)");
try {
return decodeURIComponent(t.exec(location.search)[1]);
} catch (n) {
return void 0;
}
}, utils.getInputValue = function(e) {
return e = jqElt(e), e.val();
}, utils.setInputValue = function(e, t) {
e = jqElt(e), e.val(t);
}, utils.getInputTextValue = function(e, t, n) {
e = jqElt(e);
var i = e.val();
return void 0 === i ? (inputError(e, t), void 0) : (i = utils.trim(i), 0 === i.length || void 0 !== n && !i.match(n) ? (inputError(e, t),
void 0) : i);
}, utils.getInputIntValue = function(e, t, n, i) {
e = jqElt(e);
var o = utils.getInputTextValue(e, t);
return void 0 === o ? void 0 : (o = parseInt(o), isNaN(o) || void 0 !== n && n > o || void 0 !== i && o > i ? (inputError(e, t),
void 0) : o);
}, utils.getInputRegExpValue = function(e, t) {
e = jqElt(e);
var n = utils.getInputTextValue(e, t);
if (void 0 === n) return void 0;
try {
new RegExp(n);
} catch (i) {
return inputError(e, t), void 0;
}
return n;
}, utils.getInputJsValue = function(element, event) {
element = jqElt(element);
var value = utils.getInputTextValue(element, event);
if (void 0 === value) return void 0;
try {
eval("var test=" + value);
} catch (e) {
return inputError(element, event), void 0;
}
return value;
}, utils.getInputChecked = function(e) {
return e = jqElt(e), e.prop("checked");
}, utils.setInputChecked = function(e, t) {
e = jqElt(e), e.prop("checked", t).change();
}, utils.getInputRadio = function(e) {
return $("input:radio[name=" + e + "]:checked").prop("value");
}, utils.setInputRadio = function(e, t) {
$("input:radio[name=" + e + "][value=" + t + "]").prop("checked", !0).change();
}, utils.resetModalInputs = function() {
$(".modal input[type=text]:not([disabled]), .modal input[type=password], .modal textarea").val(""),
$(".modal input[type=checkbox]").prop("checked", !1).change();
}, utils.trim = function(e) {
return $.trim(e);
}, utils.slugify = function(e) {
return e.toLowerCase().replace(/\s/g, "-").replace(/![\p{Ll}\p{Lu}\p{Lt}\p{Lo}\p{Nd}\p{Pc}]/g, "").replace(/\-\-+/g, "-").replace(/^-+/, "").replace(/-+$/, "");
}, utils.checkUrl = function(e, t) {
return e ? (0 !== e.indexOf("http") && (e = "http://" + e), t && -1 === e.indexOf("/", e.length - 1) && (e += "/"),
e) : e;
}, utils.addModal = function(e, t) {
var n = crel("div", {
"class": "modal " + e
});
n.innerHTML = t, document.body.appendChild(n);
}, utils.createBackdrop = function(e, t) {
var n = crel("div", {
"class": "modal-backdrop in",
"data-toggle": e,
"data-target": t
});
return document.body.appendChild(n), n;
}, utils.popupWindow = function(e, t, n, i) {
var o = screen.width / 2 - n / 2, r = screen.height / 2 - i / 2;
return window.open(e, t, [ "toolbar=no, ", "location=no, ", "directories=no, ", "status=no, ", "menubar=no, ", "scrollbars=no, ", "resizable=no, ", "copyhistory=no, ", "width=" + n + ", ", "height=" + i + ", ", "top=" + r + ", ", "left=" + o ].join(""));
}, utils.saveAs = function(e, t) {
if (void 0 !== saveAs) _.isString(e) && (e = new Blob([ e ], {
type: "text/plain;charset=utf-8"
})), saveAs(e, t); else {
var n = "data:application/octet-stream;base64," + utils.encodeBase64(e);
window.open(n, "file");
}
}, utils.randomString = function() {
return _.random(4294967296).toString(36);
}, utils.updateCurrentTime = function() {
utils.currentTime = new Date().getTime();
}, utils.updateCurrentTime(), utils.storeAttributes = function(e) {
var t = e.syncIndex || e.publishIndex, n = _.omit(e, "syncIndex", "publishIndex", "provider");
n.provider = e.provider.providerId, localStorage[t] = JSON.stringify(n);
}, utils.retrieveIndexArray = function(e) {
try {
return _.compact(localStorage[e].split(";"));
} catch (t) {
return localStorage[e] = ";", [];
}
}, utils.appendIndexToArray = function(e, t) {
localStorage[e] += t + ";";
}, utils.removeIndexFromArray = function(e, t) {
localStorage[e] = localStorage[e].replace(";" + t + ";", ";");
}, utils.retrieveIgnoreError = function(e) {
try {
return JSON.parse(localStorage[e]);
} catch (t) {
return void 0;
}
};
var eventList = [];
utils.logValue = function(e) {
eventList.unshift(e), eventList.length > 5 && eventList.pop();
}, utils.logStackTrace = function() {
eventList.unshift(printStackTrace()), eventList.length > 5 && eventList.pop();
}, utils.formatEventList = function() {
var e = [];
return _.each(eventList, function(t) {
e.push("\n"), _.isString(t) ? e.push(t) : _.isArray(t) && (e.push(t[5] || ""), e.push(t[6] || ""));
}), e.join("");
}, utils.encodeBase64 = function(e) {
if (0 === e.length) return "";
var t, n, i = [], o = 0;
for (e = encodeURI(e), t = e.length; t > o; ) n = e[o], o += 1, "%" !== n ? i.push(n.charCodeAt(0)) : (n = e[o] + e[o + 1],
i.push(parseInt(n, 16)), o += 2);
var r, s, a = "=", l = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", c = [], u = i.length - i.length % 3;
for (r = 0; u > r; r += 3) s = i[r] << 16 | i[r + 1] << 8 | i[r + 2], c.push(l.charAt(s >> 18)),
c.push(l.charAt(63 & s >> 12)), c.push(l.charAt(63 & s >> 6)), c.push(l.charAt(63 & s));
switch (i.length - u) {
case 1:
s = i[r] << 16, c.push(l.charAt(s >> 18) + l.charAt(63 & s >> 12) + a + a);
break;
case 2:
s = i[r] << 16 | i[r + 1] << 8, c.push(l.charAt(s >> 18) + l.charAt(63 & s >> 12) + l.charAt(63 & s >> 6) + a);
}
return c.join("");
};
var mHash = [ 0, 1996959894, 3993919788, 2567524794, 124634137, 1886057615, 3915621685, 2657392035, 249268274, 2044508324, 3772115230, 2547177864, 162941995, 2125561021, 3887607047, 2428444049, 498536548, 1789927666, 4089016648, 2227061214, 450548861, 1843258603, 4107580753, 2211677639, 325883990, 1684777152, 4251122042, 2321926636, 335633487, 1661365465, 4195302755, 2366115317, 997073096, 1281953886, 3579855332, 2724688242, 1006888145, 1258607687, 3524101629, 2768942443, 901097722, 1119000684, 3686517206, 2898065728, 853044451, 1172266101, 3705015759, 2882616665, 651767980, 1373503546, 3369554304, 3218104598, 565507253, 1454621731, 3485111705, 3099436303, 671266974, 1594198024, 3322730930, 2970347812, 795835527, 1483230225, 3244367275, 3060149565, 1994146192, 31158534, 2563907772, 4023717930, 1907459465, 112637215, 2680153253, 3904427059, 2013776290, 251722036, 2517215374, 3775830040, 2137656763, 141376813, 2439277719, 3865271297, 1802195444, 476864866, 2238001368, 4066508878, 1812370925, 453092731, 2181625025, 4111451223, 1706088902, 314042704, 2344532202, 4240017532, 1658658271, 366619977, 2362670323, 4224994405, 1303535960, 984961486, 2747007092, 3569037538, 1256170817, 1037604311, 2765210733, 3554079995, 1131014506, 879679996, 2909243462, 3663771856, 1141124467, 855842277, 2852801631, 3708648649, 1342533948, 654459306, 3188396048, 3373015174, 1466479909, 544179635, 3110523913, 3462522015, 1591671054, 702138776, 2966460450, 3352799412, 1504918807, 783551873, 3082640443, 3233442989, 3988292384, 2596254646, 62317068, 1957810842, 3939845945, 2647816111, 81470997, 1943803523, 3814918930, 2489596804, 225274430, 2053790376, 3826175755, 2466906013, 167816743, 2097651377, 4027552580, 2265490386, 503444072, 1762050814, 4150417245, 2154129355, 426522225, 1852507879, 4275313526, 2312317920, 282753626, 1742555852, 4189708143, 2394877945, 397917763, 1622183637, 3604390888, 2714866558, 953729732, 1340076626, 3518719985, 2797360999, 1068828381, 1219638859, 3624741850, 2936675148, 906185462, 1090812512, 3747672003, 2825379669, 829329135, 1181335161, 3412177804, 3160834842, 628085408, 1382605366, 3423369109, 3138078467, 570562233, 1426400815, 3317316542, 2998733608, 733239954, 1555261956, 3268935591, 3050360625, 752459403, 1541320221, 2607071920, 3965973030, 1969922972, 40735498, 2617837225, 3943577151, 1913087877, 83908371, 2512341634, 3803740692, 2075208622, 213261112, 2463272603, 3855990285, 2094854071, 198958881, 2262029012, 4057260610, 1759359992, 534414190, 2176718541, 4139329115, 1873836001, 414664567, 2282248934, 4279200368, 1711684554, 285281116, 2405801727, 4167216745, 1634467795, 376229701, 2685067896, 3608007406, 1308918612, 956543938, 2808555105, 3495958263, 1231636301, 1047427035, 2932959818, 3654703836, 1088359270, 936918e3, 2847714899, 3736837829, 1202900863, 817233897, 3183342108, 3401237130, 1404277552, 615818150, 3134207493, 3453421203, 1423857449, 601450431, 3009837614, 3294710456, 1567103746, 711928724, 3020668471, 3272380065, 1510334235, 755167117 ];
return utils.crc32 = function(e) {
for (var t = 0, n = -1, i = 0; i < e.length; i++) t = 255 & (n ^ e.charCodeAt(i)),
n = n >>> 8 ^ mHash[t];
return n = -1 ^ n, 0 > n && (n = 4294967295 + n + 1), n.toString(16);
}, utils;
});
var VERSION = "2.1.6", MAIN_URL = "http://benweet.github.io/stackedit/", GOOGLE_ANALYTICS_ACCOUNT_ID = "UA-39556145-1", GOOGLE_API_KEY = "AIzaSyAeCU8CGcSkn0z9js6iocHuPBX4f_mMWkw", GOOGLE_SCOPES = [ "https://www.googleapis.com/auth/drive.install", "https://www.googleapis.com/auth/drive", "https://www.googleapis.com/auth/blogger", "https://picasaweb.google.com/data/" ], GOOGLE_DRIVE_APP_ID = "241271498917", DROPBOX_APP_KEY = "lq6mwopab8wskas", DROPBOX_APP_SECRET = "851fgnucpezy84t", BITLY_ACCESS_TOKEN = "317e033bfd48cf31155a68a536b1860013b09c4c", DEFAULT_FILE_TITLE = "Title", DEFAULT_FOLDER_NAME = "New folder", GDRIVE_DEFAULT_FILE_TITLE = "New Markdown document", EDITOR_DEFAULT_PADDING = 15, CHECK_ONLINE_PERIOD = 12e4, AJAX_TIMEOUT = 3e4, ASYNC_TASK_DEFAULT_TIMEOUT = 6e4, ASYNC_TASK_LONG_TIMEOUT = 18e4, SYNC_PERIOD = 18e4, USER_IDLE_THRESHOLD = 3e5, IMPORT_FILE_MAX_CONTENT_SIZE = 1e5, IMPORT_IMG_MAX_CONTENT_SIZE = 1e7, TEMPORARY_FILE_INDEX = "file.tempIndex", WELCOME_DOCUMENT_TITLE = "Welcome document", DOWNLOAD_PROXY_URL = "http://stackedit-download-proxy.herokuapp.com/", PICASA_PROXY_URL = "http://stackedit-picasa-proxy.herokuapp.com/", WORDPRESS_CLIENT_ID = "3185", WORDPRESS_PROXY_URL = "http://stackedit-wordpress-proxy.herokuapp.com/", SSH_PROXY_URL = "http://stackedit-ssh-proxy.herokuapp.com/", HTMLTOPDF_URL = "http://benweet.insomnia247.nl/stackedit-htmltopdf/", delayedFunction = void 0, BASE_URL = "http://localhost/stackedit/", GOOGLE_CLIENT_ID = "241271498917-lev37kef013q85avc91am1gccg5g8lrb.apps.googleusercontent.com", GITHUB_CLIENT_ID = "e47fef6055344579799d", GATEKEEPER_URL = "http://stackedit-gatekeeper-localhost.herokuapp.com/", TUMBLR_PROXY_URL = "http://stackedit-tumblr-proxy-local.herokuapp.com/";
0 === location.hostname.indexOf("benweet.github.io") && (BASE_URL = MAIN_URL, GOOGLE_CLIENT_ID = "241271498917-jpto9lls9fqnem1e4h6ppds9uob8rpvu.apps.googleusercontent.com",
GITHUB_CLIENT_ID = "fa0d09514da8377ee32e", GATEKEEPER_URL = "http://stackedit-gatekeeper.herokuapp.com/",
TUMBLR_PROXY_URL = "http://stackedit-tumblr-proxy.herokuapp.com/"), 0 === location.hostname.indexOf("benweet.insomnia247.nl") && (BASE_URL = "http://benweet.insomnia247.nl/stackedit/",
GOOGLE_CLIENT_ID = "241271498917-52hae7a08hv7ltenv7km8h7lghno9sk3.apps.googleusercontent.com",
GITHUB_CLIENT_ID = "d2943d6074b2d9c4a830", GATEKEEPER_URL = "http://stackedit-gatekeeper-insomnia.herokuapp.com/",
TUMBLR_PROXY_URL = "http://stackedit-tumblr-proxy-beta.herokuapp.com/");
var THEME_LIST = {
"default": "Default",
"blue-gray": "Blue-Gray",
night: "Night",
school: "School"
};
define("config", function() {}), define("storage", [ "underscore", "utils" ], function(e, t) {
var n = t.retrieveIndexArray("file.list"), i = localStorage.version;
if (void 0 === i && (localStorage.removeItem("sync.queue"), localStorage.removeItem("sync.current"),
localStorage.removeItem("file.counter"), e.each(n, function(n) {
localStorage[n + ".publish"] = ";";
var i = t.retrieveIndexArray(n + ".sync");
e.each(i, function(e) {
localStorage[e + ".contentCRC"] = "0", void 0 !== localStorage[e + ".etag"] && (localStorage[e + ".titleCRC"] = "0");
});
}), i = "v1"), "v1" == i) {
var o = localStorage["sync.gdrive.lastChangeId"];
o && (localStorage["gdrive.lastChangeId"] = o, localStorage.removeItem("sync.gdrive.lastChangeId"));
var r = localStorage["sync.dropbox.lastChangeId"];
r && (localStorage["dropbox.lastChangeId"] = r, localStorage.removeItem("sync.dropbox.lastChangeId"));
var s = "gdrive", a = "dropbox", l = "sync." + s + ".", c = "sync." + a + ".";
e.each(n, function(n) {
var i = t.retrieveIndexArray(n + ".sync");
e.each(i, function(e) {
var t = {};
0 === e.indexOf(l) ? (t.provider = s, t.id = e.substring(l.length), t.etag = localStorage[e + ".etag"],
t.contentCRC = localStorage[e + ".contentCRC"], t.titleCRC = localStorage[e + ".titleCRC"]) : 0 === e.indexOf(c) && (t.provider = a,
t.path = decodeURIComponent(e.substring(c.length)), t.version = localStorage[e + ".version"],
t.contentCRC = localStorage[e + ".contentCRC"]), localStorage[e] = JSON.stringify(t),
localStorage.removeItem(e + ".etag"), localStorage.removeItem(e + ".version"), localStorage.removeItem(e + ".contentCRC"),
localStorage.removeItem(e + ".titleCRC");
});
}), i = "v2";
}
if ("v2" == i && (e.each(n, function(n) {
e.has(localStorage, n + ".sync") || (localStorage.removeItem(n + ".title"), localStorage.removeItem(n + ".publish"),
localStorage.removeItem(n + ".content"), t.removeIndexFromArray("file.list", n));
}), i = "v3"), "v3" == i) {
var u = localStorage["file.current"];
void 0 !== u && -1 === localStorage["file.list"].indexOf(";" + u + ";") && localStorage.removeItem("file.current"),
i = "v4";
}
if ("v4" == i && (localStorage.removeItem("githubToken"), i = "v5"), "v5" == i && (e.each(n, function(n) {
var i = t.retrieveIndexArray(n + ".publish");
e.each(i, function(e) {
var t = JSON.parse(localStorage[e]);
"gdrive" == t.provider && (t.id = t.fileId, t.fileId = void 0, localStorage[e] = JSON.stringify(t));
});
}), i = "v6"), "v6" == i) {
var u = localStorage["file.current"];
void 0 !== u && (localStorage[u + ".selectTime"] = new Date().getTime(), localStorage.removeItem("file.current")),
i = "v7";
}
"v7" == i && (e.each(e.keys(localStorage), function(t) {
var n = t.match(/(file\.\S+\.)\S+/);
n && (e.has(localStorage, n[1] + "title") || localStorage.removeItem(t));
}), i = "v8"), "v8" == i && (e.each(e.keys(localStorage), function(e) {
var t = e.match(/file\.\S+\.(editorEnd|editorStart)/);
t && localStorage.removeItem(e);
}), i = "v9"), "v9" == i && (e.has(localStorage, "settings") && (settings = JSON.parse(localStorage.settings),
delete settings.editorFontFamily, delete settings.editorFontSize, settings.template && (settings.template = settings.template.replace("http://benweet.github.io/stackedit/css/main-min.css", "http://benweet.github.io/stackedit/res-min/themes/default.css")),
localStorage.settings = JSON.stringify(settings)), i = "v10"), localStorage.version = i;
}), define("settings", [ "underscore", "config", "storage" ], function(e) {
var t = {
layoutOrientation: "horizontal",
lazyRendering: !0,
editorFontFamily: 'Menlo, Consolas, "Courier New", Courier, monospace',
editorFontSize: 12,
maxWidth: 960,
defaultContent: "\n\n\n> Written with [StackEdit](" + MAIN_URL + ").",
commitMsg: "Published with " + MAIN_URL,
template: [ "<!DOCTYPE html>\n", "<html>\n", "<head>\n", '<meta charset="utf-8">\n', "<title><%= documentTitle %></title>\n", '<link rel="stylesheet" href="', MAIN_URL, 'res-min/themes/default.css" />\n', '<script type="text/javascript" src="', MAIN_URL, 'lib/MathJax/MathJax.js?config=TeX-AMS_HTML"></script>\n', "</head>\n", '<body><div class="container"><%= documentHTML %></div></body>\n', "</html>" ].join(""),
pdfTemplate: [ "<!DOCTYPE html>\n", "<html>\n", "<head>\n", '<meta charset="utf-8">\n', "<title><%= documentTitle %></title>\n", '<link rel="stylesheet" href="', MAIN_URL, 'res-min/themes/default.css" />\n', '<style type="text/css">\n', "@font-face {font-family: MathJax_Main; src: url('", MAIN_URL, "lib/MathJax/fonts/HTML-CSS/TeX/woff/MathJax_Main-Regular.woff') format('woff'), url('http://cdn.mathjax.org/mathjax/latest/fonts/HTML-CSS/TeX/otf/MathJax_Main-Regular.otf') format('opentype')}\n", "@font-face {font-family: MathJax_Main; src: url('", MAIN_URL, "lib/MathJax/fonts/HTML-CSS/TeX/woff/MathJax_Main-Bold.woff') format('woff'), url('http://cdn.mathjax.org/mathjax/latest/fonts/HTML-CSS/TeX/otf/MathJax_Main-Bold.otf') format('opentype'); font-weight: bold}\n", "@font-face {font-family: MathJax_Main; src: url('", MAIN_URL, "lib/MathJax/fonts/HTML-CSS/TeX/woff/MathJax_Main-Italic.woff') format('woff'), url('http://cdn.mathjax.org/mathjax/latest/fonts/HTML-CSS/TeX/otf/MathJax_Main-Italic.otf') format('opentype'); font-style: italic}\n", "@font-face {font-family: MathJax_Math; src: url('", MAIN_URL, "lib/MathJax/fonts/HTML-CSS/TeX/woff/MathJax_Math-Italic.woff') format('woff'), url('http://cdn.mathjax.org/mathjax/latest/fonts/HTML-CSS/TeX/otf/MathJax_Math-Italic.otf') format('opentype'); font-style: italic}\n", "@font-face {font-family: MathJax_Caligraphic; src: url('", MAIN_URL, "lib/MathJax/fonts/HTML-CSS/TeX/woff/MathJax_Caligraphic-Regular.woff') format('woff'), url('http://cdn.mathjax.org/mathjax/latest/fonts/HTML-CSS/TeX/otf/MathJax_Caligraphic-Regular.otf') format('opentype')}\n", "@font-face {font-family: MathJax_Size1; src: url('", MAIN_URL, "lib/MathJax/fonts/HTML-CSS/TeX/woff/MathJax_Size1-Regular.woff') format('woff'), url('http://cdn.mathjax.org/mathjax/latest/fonts/HTML-CSS/TeX/otf/MathJax_Size1-Regular.otf') format('opentype')}\n", "@font-face {font-family: MathJax_Size2; src: url('", MAIN_URL, "lib/MathJax/fonts/HTML-CSS/TeX/woff/MathJax_Size2-Regular.woff') format('woff'), url('http://cdn.mathjax.org/mathjax/latest/fonts/HTML-CSS/TeX/otf/MathJax_Size2-Regular.otf') format('opentype')}\n", "@font-face {font-family: MathJax_Size3; src: url('", MAIN_URL, "lib/MathJax/fonts/HTML-CSS/TeX/woff/MathJax_Size3-Regular.woff') format('woff'), url('http://cdn.mathjax.org/mathjax/latest/fonts/HTML-CSS/TeX/otf/MathJax_Size3-Regular.otf') format('opentype')}\n", "@font-face {font-family: MathJax_Size4; src: url('", MAIN_URL, "lib/MathJax/fonts/HTML-CSS/TeX/woff/MathJax_Size4-Regular.woff') format('woff'), url('http://cdn.mathjax.org/mathjax/latest/fonts/HTML-CSS/TeX/otf/MathJax_Size4-Regular.otf') format('opentype')}\n", "</style>\n", "</head>\n", '<body class="pdf"><%= documentHTML %></body>\n', "</html>" ].join(""),
sshProxy: SSH_PROXY_URL,
extensionSettings: {}
};
try {
e.extend(t, JSON.parse(localStorage.settings));
} catch (n) {}
return t;
}), define("classes/Extension", [], function() {
function e(e, t, n, i, o) {
this.extensionId = e, this.extensionName = t, this.isOptional = n, this.disableInViewer = i,
this.disableInLight = o;
}
return e;
}), define("text", [ "module" ], function(e) {
var t, n, i, o, r, s = [ "Msxml2.XMLHTTP", "Microsoft.XMLHTTP", "Msxml2.XMLHTTP.4.0" ], a = /^\s*<\?xml(\s)+version=[\'\"](\d)*.(\d)*[\'\"](\s)*\?>/im, l = /<body[^>]*>\s*([\s\S]+)\s*<\/body>/im, c = "undefined" != typeof location && location.href, u = c && location.protocol && location.protocol.replace(/\:/, ""), d = c && location.hostname, h = c && (location.port || void 0), p = {}, f = e.config && e.config() || {};
return t = {
version: "2.0.10",
strip: function(e) {
if (e) {
e = e.replace(a, "");
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: f.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 = s[t];
try {
e = new ActiveXObject(n);
} catch (i) {}
if (e) {
s = [ n ];
break;
}
}
return e;
},
parseName: function(e) {
var t, n, i, o = !1, r = e.indexOf("."), s = 0 === e.indexOf("./") || 0 === e.indexOf("../");
return -1 !== r && (!s || r > 1) ? (t = e.substring(0, r), n = e.substring(r + 1, e.length)) : t = e,
i = n || t, r = i.indexOf("!"), -1 !== r && (o = "strip" === i.substring(r + 1),
i = i.substring(0, r), n ? n = i : t = i), {
moduleName: t,
ext: n,
strip: o
};
},
xdRegExp: /^((\w+)\:)?\/\/([^\/\\]+)/,
useXhr: function(e, n, i, o) {
var r, s, a, l = t.xdRegExp.exec(e);
return l ? (r = l[2], s = l[3], s = s.split(":"), a = s[1], s = s[0], !(r && r !== n || s && s.toLowerCase() !== i.toLowerCase() || (a || s) && a !== o)) : !0;
},
finishLoad: function(e, n, i, o) {
i = n ? t.strip(i) : i, f.isBuild && (p[e] = i), o(i);
},
load: function(e, n, i, o) {
if (o.isBuild && !o.inlineText) return i(), void 0;
f.isBuild = o.isBuild;
var r = t.parseName(e), s = r.moduleName + (r.ext ? "." + r.ext : ""), a = n.toUrl(s), l = f.useXhr || t.useXhr;
return 0 === a.indexOf("empty:") ? (i(), void 0) : (!c || l(a, u, d, h) ? t.get(a, function(n) {
t.finishLoad(e, r.strip, n, i);
}, function(e) {
i.error && i.error(e);
}) : n([ s ], function(e) {
t.finishLoad(r.moduleName + "." + r.ext, r.strip, e, i);
}), void 0);
},
write: function(e, n, i) {
if (p.hasOwnProperty(n)) {
var o = t.jsEscape(p[n]);
i.asModule(e + "!" + n, "define(function () { return '" + o + "';});\n");
}
},
writeFile: function(e, n, i, o, r) {
var s = t.parseName(n), a = s.ext ? "." + s.ext : "", l = s.moduleName + a, c = i.toUrl(s.moduleName + a) + ".js";
t.load(l, i, function() {
var n = function(e) {
return o(c, e);
};
n.asModule = function(e, t) {
return o.asModule(e, c, t);
}, t.write(e, l, n, r);
}, r);
}
}, "node" === f.env || !f.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 o = n.readFileSync(e, "utf8");
0 === o.indexOf("") && (o = o.substring(1)), t(o);
} catch (r) {
i(r);
}
}) : "xhr" === f.env || !f.env && t.createXhr() ? t.get = function(e, n, i, o) {
var r, s = t.createXhr();
if (s.open("GET", e, !0), o) for (r in o) o.hasOwnProperty(r) && s.setRequestHeader(r.toLowerCase(), o[r]);
f.onXhr && f.onXhr(s, e), s.onreadystatechange = function() {
var t, o;
4 === s.readyState && (t = s.status, t > 399 && 600 > t ? (o = new Error(e + " HTTP status: " + t),
o.xhr = s, i(o)) : n(s.responseText), f.onXhrComplete && f.onXhrComplete(s, e));
}, s.send(null);
} : "rhino" === f.env || !f.env && "undefined" != typeof Packages && "undefined" != typeof java ? t.get = function(e, t) {
var n, i, o = "utf-8", r = new java.io.File(e), s = java.lang.System.getProperty("line.separator"), a = new java.io.BufferedReader(new java.io.InputStreamReader(new java.io.FileInputStream(r), o)), l = "";
try {
for (n = new java.lang.StringBuffer(), i = a.readLine(), i && i.length() && 65279 === i.charAt(0) && (i = i.substring(1)),
null !== i && n.append(i); null !== (i = a.readLine()); ) n.append(s), n.append(i);
l = String(n.toString());
} finally {
a.close();
}
t(l);
} : ("xpconnect" === f.env || !f.env && "undefined" != typeof Components && Components.classes && Components.interfaces) && (i = Components.classes,
o = Components.interfaces, Components.utils["import"]("resource://gre/modules/FileUtils.jsm"),
r = "@mozilla.org/windows-registry-key;1" in i, t.get = function(e, t) {
var n, s, a, l = {};
r && (e = e.replace(/\//g, "\\")), a = new FileUtils.File(e);
try {
n = i["@mozilla.org/network/file-input-stream;1"].createInstance(o.nsIFileInputStream),
n.init(a, 1, 0, !1), s = i["@mozilla.org/intl/converter-input-stream;1"].createInstance(o.nsIConverterInputStream),
s.init(n, "utf-8", n.available(), o.nsIConverterInputStream.DEFAULT_REPLACEMENT_CHARACTER),
s.readString(n.available(), l), s.close(), n.close(), t(l.value);
} catch (c) {
throw new Error((a && a.path || "") + ": " + c);
}
}), t;
}), define("text!html/settingsExtensionsAccordion.html", [], function() {
return '<div class="panel">\n <div class="accordion-heading">\n <div class="checkbox pull-right">\n <label> <input id="input-enable-extension-<%= extensionId %>"\n type="checkbox"<% if(!isOptional) print(\'disabled\') %>>\n enabled\n </label>\n </div>\n <span data-toggle="collapse" data-parent=".accordion-extensions"\n class="accordion-toggle" href="#accordion-extensions-collapse-<%= extensionId %>">\n <%= extensionName %> </span>\n </div>\n <div id="accordion-extensions-collapse-<%= extensionId %>" class="collapse">\n <div class="accordion-inner clearfix"><%= settingsBlock %></div>\n </div>\n</div>\n';
}), define("extensions/markdownSectionParser", [ "classes/Extension" ], function(e) {
var t = new e("markdownSectionParser", "Markdown section parser"), n = void 0;
return t.onEventMgrCreated = function(e) {
n = e;
}, t.onPagedownConfigure = function(e) {
var t = e.getConverter();
t.hooks.chain("preConversion", function(e) {
n.previewStartTime = new Date();
var t = e + "\n\n", i = [], o = 0;
return t.replace(/^```.*\n[\s\S]*?\n```|(^.+[ \t]*\n=+[ \t]*\n+|^.+[ \t]*\n-+[ \t]*\n+|^\#{1,6}[ \t]*.+?[ \t]*\#*\n+)/gm, function(e, n, r) {
return n && (i.push(t.substring(o, r)), o = r), "";
}), i.push(t.substring(o, e.length)), n.onSectionsCreated(i), e;
});
}, t;
}), define("text!html/partialRenderingSettingsBlock.html", [], function() {
return "<p>Renders modified sections only.</p>\n<blockquote>\n <b>NOTE:</b> 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</blockquote>";
}), define("extensions/partialRendering", [ "underscore", "crel", "classes/Extension", "text!html/partialRenderingSettingsBlock.html" ], function(e, t, n, i) {
function o(t, n) {
if (h = [], d = [], p = void 0, f === !0 || u != n) return f = !1, u = n, d = c,
c = t, h = t, void 0;
var i = c.length;
e.some(c, function(e, n) {
return n >= t.length || e.text != t[n].text ? (i = n, !0) : void 0;
});
var o = -c.length;
e.some(c.slice().reverse(), function(e, n) {
return n >= t.length || e.text != t[t.length - n - 1].text ? (o = -n, !0) : void 0;
}), i - o > c.length && (o = i - c.length);
var r = c.slice(0, i);
h = t.slice(i, t.length + o);
var s = c.slice(c.length + o, c.length);
p = e.first(s), d = c.slice(i, c.length + o), c = r.concat(h).concat(s);
}
function r() {
e.each(d, function(e) {
var t = document.getElementById("wmd-preview-section-" + e.id);
b.removeChild(t);
});
var n = document.getElementById("wmd-preview"), i = n.firstChild, o = document.createDocumentFragment();
e.each(h, function(n) {
for (var r = t("div", {
id: "wmd-preview-section-" + n.id,
"class": "wmd-preview-section preview-content"
}), s = !0; i; ) {
var a = i.nextSibling;
if (s === !1 && /(^| )wmd-title($| )/.test(i.className)) break;
s = !1, "DIV" == i.tagName && "footnotes" == i.className ? e.each(i.querySelectorAll("ol > li"), function(e) {
var t = e.id.substring(3);
y[t] = e;
}) : r.appendChild(i), i = a;
}
o.appendChild(r);
}), n.innerHTML = "";
var r = v;
void 0 !== p && (r = document.getElementById("wmd-preview-section-" + p.id)), b.insertBefore(o, r),
v.innerHTML = "";
var s = [];
if (m === !0) {
var a = t("ol");
e.each(b.querySelectorAll("a.footnote"), function(e, t) {
e.textContent = t + 1;
var n = e.id.substring(6);
s.push(n), a.appendChild(y[n].cloneNode(!0));
}), s.length > 0 && v.appendChild(t("div", {
"class": "footnotes"
}, t("hr"), a)), y = e.pick(y, s);
}
}
var s = new n("partialRendering", "Partial Rendering", !0);
s.settingsBlock = i;
var a = void 0, l = 0, c = [], u = void 0, d = [], h = [], p = void 0, f = !1, g = !1, m = !1;
s.onSectionsCreated = function(t) {
var n = [], i = "\n";
m = !1, e.each(t, function(e) {
e += "\n\n", g && (e = e.replace(/^```.*\n[\s\S]*?\n```|\n[ ]{0,3}\[\^(.+?)\]\:[ \t]*\n?([\s\S]*?)\n{1,2}((?=\n[ ]{0,3}\S)|$)/g, function(e, t) {
return t ? (m = !0, i += e.replace(/^\s*\n/gm, "") + "\n", "") : e;
})), e = e.replace(/^```.*\n[\s\S]*?\n```|^[ ]{0,3}\[(.+)\]:[ \t]*\n?[ \t]*<?(\S+?)>?(?=\s|$)[ \t]*\n?[ \t]*((\n*)["(](.+?)[")][ \t]*)?(?:\n+)/gm, function(e, t) {
return t ? (i += e.replace(/^\s*\n/gm, "") + "\n", "") : e;
}), /\S/.test(e) && n.push({
id: ++l,
text: e + "\n"
});
}), o(n, i);
};
var v = void 0, b = void 0, y = {};
return s.onPagedownConfigure = function(t) {
a = t.getConverter(), a.hooks.chain("preConversion", function() {
var t = e.map(h, function(e) {
return e.text;
});
return t.push(u + "\n\n"), t.join("");
}), t.hooks.chain("onPreviewRefresh", function() {
r();
});
}, s.onExtraExtensions = function(t) {
g = e.some(t, function(e) {
return "footnotes" == e;
});
}, s.onReady = function() {
v = t("div", {
id: "wmd-preview-section-footnotes",
"class": "preview-content"
}), b = document.getElementById("preview-contents"), b.appendChild(v);
}, s.onFileSelected = function() {
f = !0;
}, s;
}), define("text!html/buttonMarkdownSyntax.html", [], function() {
return '<button class="btn btn-default dropdown-toggle" title="Markdown syntax" data-toggle="dropdown">\n <i class="icon-help-circled"></i>\n</button>\n<div class="dropdown-menu pull-right">\n <h3>Markdown syntax</h3>\n <div class="markdown-syntax">\n<h4>Phrase Emphasis</h4>\n\n<pre><code>*italic* **bold**\n_italic_ __bold__\n</code></pre>\n\n<h4>Links</h4>\n\n<p>Inline:</p>\n\n<pre><code>An [example](http://url.com/ "Title")\n</code></pre>\n\n<p>Reference-style labels (titles are optional):</p>\n\n<pre><code>An [example][id]. Then, anywhere\nelse in the doc, define the link:\n\n [id]: http://example.com/ "Title"\n</code></pre>\n\n<h4>Images</h4>\n\n<p>Inline (titles are optional):</p>\n\n<pre><code>![alt text](/path/img.jpg "Title")\n</code></pre>\n\n<p>Reference-style:</p>\n\n<pre><code>![alt text][id]\n\n[id]: /url/to/img.jpg "Title"\n</code></pre>\n\n<h4>Headers</h4>\n\n<p>Setext-style:</p>\n\n<pre><code>Header 1\n========\n\nHeader 2\n--------\n</code></pre>\n\n<p>atx-style (closing #\'s are optional):</p>\n\n<pre><code># Header 1 #\n\n## Header 2 ##\n\n###### Header 6\n</code></pre>\n\n<h4>Lists</h4>\n\n<p>Ordered, without paragraphs:</p>\n\n<pre><code>1. Foo\n2. Bar\n</code></pre>\n\n<p>Unordered, with paragraphs:</p>\n\n<pre><code>* A list item.\n\n With multiple paragraphs.\n\n* Bar\n</code></pre>\n\n<p>You can nest them:</p>\n\n<pre><code>* Abacus\n * answer\n* Bubbles\n 1. bunk\n 2. bupkis\n * BELITTLER\n 3. burper\n* Cunning\n</code></pre>\n\n<h4>Blockquotes</h4>\n\n<pre><code>&gt; Email-style angle brackets\n&gt; are used for blockquotes.\n\n&gt; &gt; And, they can be nested.\n\n&gt; #### Headers in blockquotes\n&gt; \n&gt; * You can quote a list.\n&gt; * Etc.\n</code></pre>\n\n<h4>Code Spans</h4>\n\n<pre><code>`&lt;code&gt;` spans are delimited\nby backticks.\n\nYou can include literal backticks\nlike `` `this` ``.\n</code></pre>\n\n<h4>Preformatted Code Blocks</h4>\n\n<p>Indent every line of a code block by at least 4 spaces or 1 tab.</p>\n\n<pre><code>This is a normal paragraph.\n\n This is a preformatted\n code block.\n</code></pre>\n\n<h4>Horizontal Rules</h4>\n\n<p>Three or more dashes or asterisks:</p>\n\n<pre><code>---\n\n* * *\n\n- - - - \n</code></pre>\n\n<h4>Manual Line Breaks</h4>\n\n<p>End a line with two or more spaces:</p>\n\n<pre><code>Roses are red, \nViolets are blue.\n</code></pre>\n\n<blockquote>Based on the <a target="_blank" href="https://github.com/fletcher/MultiMarkdown/blob/master/Documentation/Markdown%20Syntax.md">Markdown syntax guide</a>, by Fletcher T. Penney.</blockquote>\n </div>\n</div>\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 = '<p>Adds a "Markdown syntax" button over the preview.</p>',
i.onCreatePreviewButton = function() {
return n;
}, i;
}), define("extensions/googleAnalytics", [ "jquery", "underscore", "utils", "classes/Extension", "settings", "config" ], function(e, t, n, i, o) {
function r() {
n.currentTime - u > 18e4 && (_gaq.push([ "_trackPageview" ]), u = n.currentTime);
}
var s = new i("googleAnalytics", "Google Analytics", !0);
s.settingsBlock = "<p>Sends anonymous statistics about usage and errors to help improve StackEdit.</p>";
var a = !1, l = !1;
window._gaq = [];
var c = function() {
if (a === !1 && l === !1) {
var t = "/ga.js";
location.search.match(/(\?|&)console/) && (t = "/u/ga_debug.js"), e.ajax({
url: "http://www.google-analytics.com" + t,
dataType: "script"
}).done(function() {
a = !0;
});
}
}, u = 0;
s.onPeriodicRun = function() {
r();
}, s.onReady = function() {
_gaq.push([ "_setAccount", GOOGLE_ANALYTICS_ACCOUNT_ID ]), r(), _gaq.push([ "_trackEvent", "Settings", "layoutOrientation", "" + o.layoutOrientation ]),
_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(MAIN_URL)) ]),
_gaq.push([ "_trackEvent", "Settings", "commitMsg backlink", "" + (-1 !== o.commitMsg.indexOf(MAIN_URL)) ]),
_gaq.push([ "_trackEvent", "Settings", "sshProxy unchanged", "" + (o.sshProxy == SSH_PROXY_URL) ]),
t.each(o.extensionSettings, function(e, t) {
_gaq.push([ "_trackEvent", "Extensions", t + " enabled", "" + (e.enabled === !0) ]);
}), window.onerror = function(e, t, i) {
_gaq.push([ "_trackEvent", "Error", e, t + ":" + i + n.formatEventList() ]);
}, c();
}, s.onOfflineChanged = function(e) {
l = e, c();
};
var d = 0;
return s.onSyncRunning = function(e) {
e === !0 && (d = new Date().getTime());
}, s.onPublishRunning = function(e) {
e === !0 && (d = new Date().getTime());
}, s.onSyncSuccess = function() {
var e = new Date().getTime();
_gaq.push([ "_trackTiming", "Sync", "SyncTime", e - d ]);
}, 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 - d ]), 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 + n.formatEventList() ]);
}, s;
}), define("text!html/dialogAbout.html", [], function() {
return '\n<div class="modal-dialog">\n <div class="modal-content">\n\n <div class="modal-header">\n <button type="button" class="close" data-dismiss="modal"\n aria-hidden="true">&times;</button>\n <img data-stackedit-src="stackedit-promo.png" width="240" height="60" />\n </div>\n <div class="modal-body">\n <dl>\n <dt>About:</dt>\n <dd>\n <a target="_blank" href="https://github.com/benweet/stackedit/">GitHub\n project</a> / <a target="_blank"\n href="https://github.com/benweet/stackedit/issues">issue\n tracker</a><br /> <a target="_blank"\n href="https://chrome.google.com/webstore/detail/stackedit/iiooodelglhkcpgbajoejffhijaclcdg">Chrome\n app</a> (thanks for your review!)<br /> <a target="_blank"\n href="https://twitter.com/stackedit/">Follow on Twitter</a><br />\n <a target="_blank" href="https://www.facebook.com/stackedit/">Follow\n on Facebook</a><br /> <a target="_blank"\n href="https://plus.google.com/110816046787593496375"\n rel="publisher">Follow on Google+</a><br />\n </dd>\n </dl>\n <dl>\n <dt>Developers:</dt>\n <dd>\n <a target="_blank" href="http://www.benoitschweblin.com">Benoit\n Schweblin</a><br /> Pete Eigel (contributor)\n </dd>\n </dl>\n <dl>\n <dt>Credit:</dt>\n <dd>\n <% _.each(libraries, function(url, name) { %> <a target="_blank"\n href="<%= url %>"><%= name %></a><br /> <% }); %>\n </dd>\n </dl>\n <dl>\n <dt>Related projects:</dt>\n <dd>\n <% _.each(projects, function(url, name) { %> <a target="_blank"\n href="<%= url %>"><%= name %></a><br /> <% }); %>\n </dd>\n </dl>\n <p>\n StackEdit <%= version %><br /> Copyright 2013 <a\n target="_blank" href="http://www.benoitschweblin.com">Benoit\n Schweblin</a><br /> Licensed under an <a target="_blank"\n href="http://www.apache.org/licenses/LICENSE-2.0">Apache\n License</a>\n </p>\n </div>\n <div class="modal-footer">\n <a href="#" class="btn btn-primary" data-dismiss="modal">Close</a>\n </div>\n </div>\n</div>\n';
}), define("extensions/dialogAbout", [ "underscore", "utils", "classes/Extension", "text!html/dialogAbout.html", "config" ], function(e, t, n, i) {
var o = new n("dialogAbout", 'Dialog "About"'), r = {
ACE: "http://ace.c9.io/",
Bootstrap: "http://getbootstrap.com/",
"Bootstrap Tour": "http://bootstraptour.com/",
crel: "https://github.com/KoryNunn/crel",
"Dropbox-js": "https://github.com/dropbox/dropbox-js",
"FileSaver.js": "https://github.com/eligrey/FileSaver.js/",
Fontello: "http://fontello.com/",
"Font Awesome and others...": "res/libs/fontello/LICENSE.txt",
Gatekeeper: "https://github.com/prose/gatekeeper",
"Github.js": "https://github.com/michael/github",
"Highlight.js": "http://softwaremaniacs.org/soft/highlight/en/",
jGrowl: "https://github.com/stanlemon/jGrowl/",
jQuery: "http://jquery.com/",
LESS: "http://lesscss.org/",
MathJax: "http://www.mathjax.org/",
Mousetrap: "http://craig.is/killing/mice",
"PageDown ACE": "https://github.com/benweet/pagedown-ace",
"PageDown Extra": "https://github.com/jmcmanus/pagedown-extra/",
Prettify: "https://code.google.com/p/google-code-prettify/",
RequireJS: "http://requirejs.org/",
"RequireJS LESS plugin": "https://github.com/guybedford/require-less",
"stacktrace.js": "http://stacktracejs.com/",
"to-markdown": "https://github.com/domchristie/to-markdown",
"UI Layout": "http://layout.jquery-dev.net/",
"Underscore.js": "http://underscorejs.org/",
waitForImages: "https://github.com/alexanderdickson/waitForImages"
}, s = {
"StackEdit Download Proxy": "https://github.com/benweet/stackedit-download-proxy",
"StackEdit Picasa Proxy": "https://github.com/benweet/stackedit-picasa-proxy",
"StackEdit SSH Proxy": "https://github.com/benweet/stackedit-ssh-proxy",
"StackEdit Tumblr Proxy": "https://github.com/benweet/stackedit-tumblr-proxy",
"StackEdit WordPress Proxy": "https://github.com/benweet/stackedit-wordpress-proxy"
};
return o.onReady = function() {
t.addModal("modal-about", e.template(i, {
libraries: r,
projects: s,
version: VERSION
}));
}, o;
}), define("text!html/dialogManagePublicationLocation.html", [], function() {
return '<div class="input-group">\n <span class="input-group-addon" title="<%= publishAttributes.provider.providerName %>">\n <i class="icon-provider-<%= publishAttributes.provider.providerId %>"></i>\n </span> <input class="form-control" type="text"\n value="<%= publishDesc %>" disabled />\n <div class="input-group-btn">\n <a class="btn btn-link remove-button" title="Remove this location"\n data-publish-index="<%= publishAttributes.publishIndex %>"><i\n class="icon-trash"></i></a>\n </div>\n</div>\n';
}), define("extensions/dialogManagePublication", [ "jquery", "underscore", "classes/Extension", "text!html/dialogManagePublicationLocation.html" ], function(e, t, n, i) {
var o = new n("dialogManagePublication", 'Dialog "Manage publication"', !1, !0), r = void 0;
o.onEventMgrCreated = function(e) {
r = e;
};
var s = void 0, a = void 0, l = void 0, c = void 0, u = function(n) {
if (void 0 === n || n === s) {
t.size(s.publishLocations) > 0 ? (l.removeClass("hide"), c.addClass("hide")) : (l.addClass("hide"),
c.removeClass("hide"));
var o = t.reduce(s.publishLocations, function(e, n) {
var o = t.omit(n, "provider", "publishIndex", "sharingLink");
return o.password && (o.password = "********"), o = JSON.stringify(o).replace(/{|}|"/g, "").replace(/,/g, ", "),
e + t.template(i, {
publishAttributes: n,
publishDesc: o
});
}, "");
a.innerHTML = o, t.each(a.querySelectorAll(".remove-button"), function(t) {
var n = e(t), i = s.publishLocations[n.data("publishIndex")];
n.click(function() {
s.removePublishLocation(i), r.onPublishRemoved(s, i);
});
});
}
};
return o.onFileSelected = function(e) {
s = e, u(e);
}, o.onNewPublishSuccess = u, o.onPublishRemoved = u, o.onReady = function() {
var t = document.querySelector(".modal-manage-publish");
a = t.querySelector(".publish-list"), l = e(t.querySelectorAll(".msg-publish-list")),
c = e(t.querySelectorAll(".msg-no-publish"));
}, o;
}), define("text!html/dialogManageSynchronizationLocation.html", [], function() {
return '<div class="input-group">\n <span class="input-group-addon"\n title="<%= syncAttributes.provider.providerName %><%= syncAttributes.isRealtime ? \' (real time)\' : \'\' %>">\n <i\n class="icon-provider-<%= syncAttributes.provider.providerId %><%= syncAttributes.isRealtime ? \' realtime\' : \'\' %>"></i>\n </span> <input class="form-control" type="text"\n value="<%= syncDesc %>" disabled />\n <div class="input-group-btn">\n <a class="btn btn-link remove-button" title="Remove this location"\n data-sync-index="<%= syncAttributes.syncIndex %>"><i class="icon-trash"></i></a>\n </div>\n</div>\n';
}), define("extensions/dialogManageSynchronization", [ "jquery", "underscore", "classes/Extension", "text!html/dialogManageSynchronizationLocation.html" ], function(e, t, n, i) {
var o = new n("dialogManageSynchronization", 'Dialog "Manage synchronization"', !1, !0), r = void 0;
o.onEventMgrCreated = function(e) {
r = e;
};
var s = void 0;
o.onSynchronizerCreated = function(e) {
s = e;
};
var a = void 0, l = void 0, c = void 0, u = void 0, d = function(n) {
if (void 0 === n || n === a) {
t.size(a.syncLocations) > 0 ? (c.removeClass("hide"), u.addClass("hide")) : (c.addClass("hide"),
u.removeClass("hide"));
var o = t.reduce(a.syncLocations, function(e, n) {
return e + t.template(i, {
syncAttributes: n,
syncDesc: n.id || n.path
});
}, "");
l.innerHTML = o, t.each(l.querySelectorAll(".remove-button"), function(t) {
var n = e(t), i = a.syncLocations[n.data("syncIndex")];
n.click(function() {
s.tryStopRealtimeSync(), a.removeSyncLocation(i), r.onSyncRemoved(a, i);
});
});
}
};
return o.onFileSelected = function(e) {
a = e, d(e);
}, o.onSyncExportSuccess = d, o.onSyncRemoved = d, o.onReady = function() {
var t = document.querySelector(".modal-manage-sync");
l = t.querySelector(".sync-list"), c = e(t.querySelectorAll(".msg-sync-list")),
u = e(t.querySelectorAll(".msg-no-sync"));
}, 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 o;
if (n) {
var r = require("jsdom");
r.env({
html: e,
scripts: [ "http://code.jquery.com/jquery-1.6.4.min.js" ],
done: function(n, o) {
"function" == typeof t && t(i(e, o.$));
}
});
} else o = i(e, $);
return o;
};
};
var i = function(e, t) {
e = e.replace(/(\d+)\. /g, "$1\\. ");
var n = t("<div/>"), i = n.html(e);
i.find("*:not(pre, code)").contents().filter(function() {
return 3 === this.nodeType && /^\s+$/.test(this.nodeValue);
}).remove();
for (var o = [], r = 0, a = c.length; a > r; r++) o.push(c[r].selector);
for (o = o.join(","); i.find(o).length; ) for (var r = 0, a = c.length; a > r; r++) $matches = i.find(c[r].selector + ':not(:has("' + o + '"))'),
$matches.each(function(e, n) {
var i = t(n);
i.before(c[r].replacement(i.html(), i)).remove();
});
return s(i.html());
}, o = function(e) {
return e.replace(/^[\n\r\f]+|[\n\r\f]+$/g, "");
}, r = function(e) {
return String(e).replace(/&amp;/g, "&").replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&quot;/g, '"');
}, s = 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 = r(e);
}, a = function(e) {
return e = o(e), e ? "**" + e + "**" : "";
}, l = function(e) {
return e = o(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 = "", o = 0; n > o; o++) 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 = o(e);
var n = t.attr("href"), i = t.attr("title") || "";
return "[" + e + "]" + "(" + n + (i ? ' "' + i + '"' : "") + ")";
}
return !1;
}
}, {
selector: "b",
replacement: a
}, {
selector: "strong",
replacement: a
}, {
selector: "i",
replacement: l
}, {
selector: "em",
replacement: l
}, {
selector: "code",
replacement: function(e) {
return e = o(e), e ? "`" + e + "`" : "";
}
}, {
selector: "img",
replacement: function(e, t) {
var n = t.attr("alt") || "", i = t.attr("src") || "", o = t.attr("title") || "";
return "![" + n + "]" + "(" + i + (o ? ' "' + o + '"' : "") + ")";
}
}, {
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 = "", o = t.parent(), r = o.contents().filter(function() {
return 1 === this.nodeType && "LI" === this.nodeName || 3 === this.nodeType;
}), s = r.index(t) + 1;
return n = o.is("ol") ? s + ". " : "* ", s == r.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&gt; "),
"&gt; " + e;
}
} ];
}(), define("toMarkdown", [ "jquery" ], function(e) {
return function() {
var t;
return t || e.toMarkdown;
};
}(this)), define("extensions/dialogOpenHarddrive", [ "jquery", "underscore", "utils", "classes/Extension", "toMarkdown", "config" ], function(e, t, n, i, o) {
function r(n) {
n.stopPropagation(), n.preventDefault();
var i = (n.dataTransfer || n.target).files;
e(".modal-import-harddrive-markdown, .modal-import-harddrive-html").modal("hide"),
t.each(i, function(t) {
if (!e(n.target).is("#wmd-input *") || !t.name.match(/.(jpe?g|png|gif)$/)) {
var i = new FileReader();
i.onload = function(e) {
return function(t) {
var n = t.target.result;
if (n.match(/\uFFFD/)) return d.onError(e.name + " is a binary file."), void 0;
if (n = h ? h(n) : n, void 0 === n) return d.onError(e.name + " is not a valid HTML file."),
void 0;
var i = e.name, o = i.lastIndexOf(".");
i = -1 !== o ? i.substring(0, o) : i;
var r = u.createFile(i, n);
u.selectFile(r);
};
}(t);
var o = t.slice(0, IMPORT_FILE_MAX_CONTENT_SIZE);
i.readAsText(o);
}
});
}
function s(e) {
h = void 0, r(e);
}
function a(e) {
h = f, r(e);
}
function l(e) {
e.stopPropagation(), e.preventDefault(), e.dataTransfer.dropEffect = "copy";
}
var c = new i("dialogOpenHarddrive", 'Dialog "Open from"'), u = void 0;
c.onFileMgrCreated = function(e) {
u = e;
};
var d = void 0;
c.onEventMgrCreated = function(e) {
d = e;
};
var h = void 0, p = void 0, f = function(e) {
return p.makeMd(e);
};
return c.onReady = function() {
p = new o.converter(), e("#input-file-import-harddrive-markdown").change(s), e("#dropzone-import-harddrive-markdown, #wmd-input").each(function() {
this.addEventListener("dragover", l, !1), this.addEventListener("drop", s, !1);
}), e("#input-file-import-harddrive-html").change(a), e("#dropzone-import-harddrive-html").each(function() {
this.addEventListener("dragover", l, !1), this.addEventListener("drop", a, !1);
}), e(".action-convert-html").click(function(e) {
var t = n.getInputTextValue("#input-convert-html", e);
if (void 0 !== t) {
if (t = p.makeMd(t), void 0 === t) return d.onError("Invalid HTML code."), void 0;
var i = u.createFile(void 0, t);
u.selectFile(i);
}
});
}, c;
}), define("extensions/documentTitle", [ "jquery", "underscore", "classes/Extension" ], function(e, t, n) {
var i = new n("documentTitle", "Document Title"), o = void 0;
i.onLayoutCreated = function(e) {
o = e;
};
var r = void 0, s = function(n) {
if (n === r) {
var i = r.title;
document.title = "StackEdit - " + i, e(".file-title-navbar").html(r.composeTitle()),
e(".file-title").text(i), e(".input-file-title").val(i), void 0 !== o && t.defer(o.resizeAll);
}
};
return i.onFileSelected = function(e) {
r = e, s(e);
}, i.onTitleChanged = s, i.onSyncExportSuccess = s, i.onSyncRemoved = s, i.onNewPublishSuccess = s,
i.onPublishRemoved = s, i;
}), function(e, t) {
function n(e, t, n) {
return e.addEventListener ? (e.addEventListener(t, n, !1), void 0) : (e.attachEvent("on" + t, n),
void 0);
}
function i(e) {
if ("keypress" == e.type) {
var t = String.fromCharCode(e.which);
return e.shiftKey || (t = t.toLowerCase()), t;
}
return x[e.which] ? x[e.which] : E[e.which] ? E[e.which] : String.fromCharCode(e.which).toLowerCase();
}
function o(e, t) {
return e.sort().join(",") === t.sort().join(",");
}
function r(e) {
e = e || {};
var t, n = !1;
for (t in _) e[t] ? n = !0 : _[t] = 0;
n || (D = !1);
}
function s(e, t, n, i, r, s) {
var a, l, c = [], u = n.type;
if (!k[e]) return [];
for ("keyup" == u && d(e) && (t = [ e ]), a = 0; a < k[e].length; ++a) if (l = k[e][a],
(i || !l.seq || _[l.seq] == l.level) && u == l.action && ("keypress" == u && !n.metaKey && !n.ctrlKey || o(t, l.modifiers))) {
var h = !i && l.combo == r, p = i && l.seq == i && l.level == s;
(h || p) && k[e].splice(a, 1), c.push(l);
}
return c;
}
function a(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, t, n) {
B.stopCallback(t, t.target || t.srcElement, n) || e(t, n) === !1 && (t.preventDefault && t.preventDefault(),
t.stopPropagation && t.stopPropagation(), t.returnValue = !1, t.cancelBubble = !0);
}
function c(e, t, n) {
var i, o = s(e, t, n), a = {}, c = 0, u = !1;
for (i = 0; i < o.length; ++i) o[i].seq && (c = Math.max(c, o[i].level));
for (i = 0; i < o.length; ++i) if (o[i].seq) {
if (o[i].level != c) continue;
u = !0, a[o[i].seq] = 1, l(o[i].callback, n, o[i].combo);
} else u || l(o[i].callback, n, o[i].combo);
var h = "keypress" == n.type && T;
n.type != D || d(e) || h || r(a), T = u && "keydown" == n.type;
}
function u(e) {
"number" != typeof e.which && (e.which = e.keyCode);
var t = i(e);
if (t) return "keyup" == e.type && $ === t ? ($ = !1, void 0) : (B.handleKey(t, a(e), e),
void 0);
}
function d(e) {
return "shift" == e || "ctrl" == e || "alt" == e || "meta" == e;
}
function h() {
clearTimeout(C), C = setTimeout(r, 1e3);
}
function p() {
if (!w) {
w = {};
for (var e in x) e > 95 && 112 > e || x.hasOwnProperty(e) && (w[x[e]] = e);
}
return w;
}
function f(e, t, n) {
return n || (n = p()[e] ? "keydown" : "keypress"), "keypress" == n && t.length && (n = "keydown"),
n;
}
function g(e, t, n, o) {
function s(t) {
return function() {
D = t, ++_[e], h();
};
}
function a(t) {
l(n, t, e), "keyup" !== o && ($ = i(t)), setTimeout(r, 10);
}
_[e] = 0;
for (var c = 0; c < t.length; ++c) {
var u = c + 1 === t.length, d = u ? a : s(o || v(t[c + 1]).action);
b(t[c], d, o, e, c);
}
}
function m(e) {
return "+" === e ? [ "+" ] : e.split("+");
}
function v(e, t) {
var n, i, o, r = [];
for (n = m(e), o = 0; o < n.length; ++o) i = n[o], A[i] && (i = A[i]), t && "keypress" != t && S[i] && (i = S[i],
r.push("shift")), d(i) && r.push(i);
return t = f(i, r, t), {
key: i,
modifiers: r,
action: t
};
}
function b(e, t, n, i, o) {
F[e + ":" + n] = t, e = e.replace(/\s+/g, " ");
var r, a = e.split(" ");
return a.length > 1 ? (g(e, a, t, n), void 0) : (r = v(e, n), k[r.key] = k[r.key] || [],
s(r.key, r.modifiers, {
type: r.action
}, i, e, o), k[r.key][i ? "unshift" : "push"]({
callback: t,
modifiers: r.modifiers,
action: r.action,
seq: i,
level: o,
combo: e
}), void 0);
}
function y(e, t, n) {
for (var i = 0; i < e.length; ++i) b(e[i], t, n);
}
for (var w, C, x = {
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: "'"
}, S = {
"~": "`",
"!": "1",
"@": "2",
"#": "3",
$: "4",
"%": "5",
"^": "6",
"&": "7",
"*": "8",
"(": "9",
")": "0",
_: "-",
"+": "=",
":": ";",
'"': "'",
"<": ",",
">": ".",
"?": "/",
"|": "\\"
}, A = {
option: "alt",
command: "meta",
"return": "enter",
escape: "esc",
mod: /Mac|iPod|iPhone|iPad/.test(navigator.platform) ? "meta" : "ctrl"
}, k = {}, F = {}, _ = {}, $ = !1, T = !1, D = !1, L = 1; 20 > L; ++L) x[111 + L] = "f" + L;
for (L = 0; 9 >= L; ++L) x[L + 96] = L;
n(t, "keypress", u), n(t, "keydown", u), n(t, "keyup", u);
var B = {
bind: function(e, t, n) {
return e = e instanceof Array ? e : [ e ], y(e, t, n), this;
},
unbind: function(e, t) {
return B.bind(e, function() {}, t);
},
trigger: function(e, t) {
return F[e + ":" + t] && F[e + ":" + t]({}, e), this;
},
reset: function() {
return k = {}, F = {}, this;
},
stopCallback: function(e, t) {
return (" " + t.className + " ").indexOf(" mousetrap ") > -1 ? !1 : "INPUT" == t.tagName || "SELECT" == t.tagName || "TEXTAREA" == t.tagName || t.isContentEditable;
},
handleKey: c
};
e.Mousetrap = B, "function" == typeof define && define.amd && define("mousetrap", B);
}(window, document), define("classes/FileDescriptor", [ "underscore", "utils", "ace/range" ], function(e, t, n) {
function i(t, n, i, r) {
this.fileIndex = t, this._title = n || localStorage[t + ".title"], this._editorScrollTop = parseInt(localStorage[t + ".editorScrollTop"]) || 0,
this._editorSelectRange = function() {
try {
var n = localStorage[t + ".editorSelectRange"].split(";");
return n = e.map(n, function(e) {
return parseInt(e);
}), new o(n[0], n[1], n[2], n[3]);
} catch (i) {
return new o(0, 0, 0, 0);
}
}(), this._editorEnd = parseInt(localStorage[t + ".editorEnd"]) || 0, this._previewScrollTop = parseInt(localStorage[t + ".previewScrollTop"]) || 0,
this._selectTime = parseInt(localStorage[t + ".selectTime"]) || 0, this.syncLocations = i || {},
this.publishLocations = r || {}, Object.defineProperty(this, "title", {
get: function() {
return this._title;
},
set: function(e) {
this._title = e, localStorage[this.fileIndex + ".title"] = e;
}
}), Object.defineProperty(this, "content", {
get: function() {
return localStorage[this.fileIndex + ".content"];
},
set: function(e) {
localStorage[this.fileIndex + ".content"] = e;
}
}), Object.defineProperty(this, "editorScrollTop", {
get: function() {
return this._editorScrollTop;
},
set: function(e) {
this._editorScrollTop = e, localStorage[this.fileIndex + ".editorScrollTop"] = e;
}
}), Object.defineProperty(this, "editorSelectRange", {
get: function() {
return this._editorSelectRange;
},
set: function(e) {
this._editorSelectRange = e, localStorage[this.fileIndex + ".editorSelectRange"] = [ e.start.row, e.start.column, e.end.row, e.end.column ].join(";");
}
}), Object.defineProperty(this, "previewScrollTop", {
get: function() {
return this._previewScrollTop;
},
set: function(e) {
this._previewScrollTop = e, localStorage[this.fileIndex + ".previewScrollTop"] = e;
}
}), Object.defineProperty(this, "selectTime", {
get: function() {
return this._selectTime;
},
set: function(e) {
this._selectTime = e, localStorage[this.fileIndex + ".selectTime"] = e;
}
});
}
var o = n.Range;
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],
localStorage.removeItem(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],
localStorage.removeItem(e.publishIndex);
}, i.prototype.composeTitle = function() {
var t = [], n = e.values(this.syncLocations), i = e.values(this.publishLocations), o = n.concat(i);
return e.chain(o).sortBy(function(e) {
return e.provider.providerId;
}).each(function(e) {
var n = "icon-provider-" + e.provider.providerId;
e.isRealtime === !0 && (n += " realtime"), t.push('<i class="' + n + '"></i>');
}), t.push(" "), t.push(this.title), t.join("");
}, i;
}), define("fileSystem", [ "underscore", "utils", "classes/FileDescriptor", "storage" ], function(e, t, n) {
var i = {};
return e.each(t.retrieveIndexArray("file.list"), function(e) {
i[e] = new n(e);
}), i;
}), define("text!html/documentSelectorSettingsBlock.html", [], function() {
return '<p>Allows toggling document with keyboard shortcuts.</p>\n<div class="form-horizontal">\n <div class="form-group">\n <label class="col-lg-5 control-label" for="select-document-selector-orderby">Order\n by</label>\n <div class="col-lg-6">\n <select id="select-document-selector-orderby" class="form-control">\n <option value="title">Document title</option>\n <option value="mru">Most recently used</option>\n </select>\n </div>\n </div>\n <div class="form-group">\n <label class="col-lg-5 control-label"\n for="input-document-selector-shortcut-previous">"Previous"\n shortcut <a href="http://craig.is/killing/mice#keys" target="_blank">(?)</a></label>\n <div class="col-lg-6">\n <input type="text" id="input-document-selector-shortcut-previous"\n class="form-control">\n </div>\n </div>\n <div class="form-group">\n <label class="col-lg-5 control-label"\n for="input-document-selector-shortcut-next">"Next"\n shortcut <a href="http://craig.is/killing/mice#keys" target="_blank">(?)</a></label>\n <div class="col-lg-6">\n <input type="text" id="input-document-selector-shortcut-next"\n class="form-control">\n </div>\n </div>\n</div>';
}), define("extensions/documentSelector", [ "jquery", "underscore", "crel", "utils", "classes/Extension", "mousetrap", "fileSystem", "text!html/documentSelectorSettingsBlock.html" ], function(e, t, n, i, o, r, s, a) {
var l = new o("documentSelector", "Document Selector", !0, !0);
l.settingsBlock = a, 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 = void 0;
l.onAceCreated = function(e) {
c = e;
};
var u = void 0;
l.onFileMgrCreated = function(e) {
u = e;
};
var d = [ '<li class="<%= isCurrent ? "disabled" : "" %>" data-file-index="<%= fileDesc.fileIndex %>">', ' <a href="#">', " <%= fileDesc.composeTitle() %>", " </a>", "</li>" ].join(""), h = void 0, p = void 0, f = void 0, g = void 0, m = void 0, v = void 0, b = void 0, y = function() {
var n = t.chain(s).sortBy(g).reduce(function(e, n) {
return e + t.template(d, {
fileDesc: n,
isCurrent: n === m
});
}, "").value();
h.innerHTML = n, f = [], p = {}, t.each(h.querySelectorAll("li"), function(t) {
var n = e(t);
f.push(n);
var i = s[n.data("fileIndex")];
p[i.fileIndex] = n, n.find("a").click(function() {
v = void 0, n.hasClass("disabled") ? void 0 !== c ? c.focus() : b.focus() : u.selectFile(i);
});
});
};
return l.onFileSelected = function(e) {
m = e, y();
}, l.onFileCreated = y, l.onFileDeleted = y, l.onTitleChanged = y, l.onSyncExportSuccess = y,
l.onSyncRemoved = y, l.onNewPublishSuccess = y, l.onPublishRemoved = y, l.onReady = function() {
b = e("#wmd-input"), "title" == l.config.orderBy ? g = function(e) {
return e.title.toLowerCase();
} : "mru" == l.config.orderBy && (g = function(e) {
return -e.selectTime;
}), h = n("ul", {
"class": "dropdown-menu dropdown-file-selector"
}), document.querySelector(".ui-layout-resizer-north").appendChild(n("div", n("div", {
"data-toggle": "dropdown"
}), h));
var i = e(h).dropdown(), o = e(".document-panel .collapse-button");
o.prop("title", t.template("<%= title %> <%= shortcutPrevious %> <%= shortcutNext %>", {
title: o.prop("title"),
shortcutPrevious: l.config.shortcutPrevious,
shortcutNext: l.config.shortcutNext
}));
var s = l.config.shortcutPrevious.toLowerCase();
r.bind(s, function() {
void 0 === v && (i.dropdown("toggle"), v = p[m.fileIndex]);
var e = t.indexOf(f, v) - 1;
return -2 === e && (e = -1), v = f[(e + f.length) % f.length], t.defer(function() {
v.find("a").focus();
}), !1;
});
var a = l.config.shortcutNext.toLowerCase();
r.bind(l.config.shortcutNext.toLowerCase(), function() {
void 0 === v && (i.dropdown("toggle"), v = p[m.fileIndex]);
var e = t.indexOf(f, v) + 1;
return v = f[e % f.length], t.defer(function() {
v.find("a").focus();
}), !1;
});
var c = s.indexOf("+"), u = -1 === c ? s : s.substring(0, c), d = a.indexOf("+"), y = -1 === d ? a : a.substring(0, d);
r.bind([ u, y ], function() {
void 0 !== v && v.find("a").click();
}, "keyup");
}, l;
}), define("classes/FolderDescriptor", [ "underscore", "utils", "fileSystem" ], function(e, t, n) {
function i(i, o) {
this.folderIndex = i, this._name = o || localStorage[i + ".name"], this.fileList = {},
e.each(t.retrieveIndexArray(i + ".files"), function(e) {
try {
var o = n[e];
o.folder = this, this.fileList[e] = o;
} catch (r) {
t.removeIndexFromArray(i + ".files", e);
}
}, this), Object.defineProperty(this, "name", {
get: function() {
return this._name;
},
set: function(e) {
this._name = e, localStorage[this.folderIndex + ".name"] = e;
}
});
}
return i.prototype.addFile = function(e) {
e.folder = this, t.appendIndexToArray(this.folderIndex + ".files", e.fileIndex),
this.fileList[e.fileIndex] = e;
}, i.prototype.removeFile = function(e) {
e.folder = void 0, t.removeIndexFromArray(this.folderIndex + ".files", e.fileIndex),
delete this.fileList[e.fileIndex];
}, i;
}), define("folderList", [ "underscore", "utils", "classes/FolderDescriptor", "storage" ], function(e, t, n) {
var i = {};
return e.each(t.retrieveIndexArray("folder.list"), function(e) {
i[e] = new n(e);
}), i;
}), define("extensions/documentPanel", [ "jquery", "underscore", "utils", "classes/Extension", "folderList", "fileSystem" ], function(e, t, n, i, o, r) {
function s(n) {
if (n != y) {
if (y = n, b.scrollTop = 0, !n) return g.addClass("hide"), p.removeClass("hide"),
void 0;
var i = n.toLowerCase().split(/\s+/);
t.each(f.querySelectorAll(".file"), function(n) {
var o = e(n), r = o.text().toLowerCase();
o.toggle(!t.some(i, function(e) {
return -1 === r.indexOf(e);
}));
}), g.removeClass("hide"), p.addClass("hide");
}
}
var a = new i("documentPanel", "Document Panel"), l = void 0;
a.onFileMgrCreated = function(e) {
l = e;
};
var c = [ '<a href="#"', ' class="list-group-item folder clearfix"', ' data-folder-index="<%= folderDesc.folderIndex %>"', ' data-toggle="collapse"', ' data-target=".document-panel .file-list.<%= id %>">', ' <div class="pull-right file-count">', " <%= _.size(folderDesc.fileList) %>", " </div>", ' <i class="icon-folder"></i> <%= folderDesc.name %>', "</a>", '<div class="file-list collapse <%= id %> clearfix">', " <%= fileListHtml %>", "</div>" ].join(""), u = [ '<a href="#"', ' class="list-group-item file<%= fileDesc === selectedFileDesc ? " active" : "" %>"', ' data-file-index="<%= fileDesc.fileIndex %>"', ' data-toggle="collapse"', ' data-target=".document-panel">', " <%= fileDesc.composeTitle() %>", "</a>" ].join(""), d = void 0, h = void 0, p = void 0, f = void 0, g = void 0, m = void 0, v = function() {
var n = t.filter(r, function(e) {
return void 0 === e.folder;
}), i = t.chain(n).sortBy(function(e) {
return e.title.toLowerCase();
}).reduce(function(e, n) {
return e + "<li>" + t.template(u, {
fileDesc: n,
selectedFileDesc: m
}) + "</li>";
}, "").value();
i = i && '<ul class="nav">' + i + "</ul>", t.chain(o).sortBy(function(e) {
return e.name.toLowerCase();
}).each(function(e) {
var n = t.chain(e.fileList).sortBy(function(e) {
return e.title.toLowerCase();
}).reduce(function(e, n) {
return e + "<li>" + t.template(u, {
fileDesc: n,
selectedFileDesc: m
}) + "</li>";
}, "").value();
n = n && '<ul class="nav">' + n + "</ul>", i += t.template(c, {
folderDesc: e,
fileListHtml: n,
id: e.folderIndex.replace(".", "")
});
}), h.innerHTML = i;
var s = t.chain(r).sortBy(function(e) {
return e.title.toLowerCase();
}).reduce(function(e, n) {
return e + "<li>" + t.template(u, {
fileDesc: n,
selectedFileDesc: m
}) + "</li>";
}, "").value();
s = '<ul class="nav">' + s + "</ul>", f.innerHTML = s, t.each(h.querySelectorAll(".file"), function(t) {
var n = e(t);
n.click(function() {
var e = r[n.data("fileIndex")];
e && e !== m && l.selectFile(e);
});
});
};
a.onFileSelected = function(e) {
m = e, v();
}, a.onFileCreated = v, a.onFileDeleted = v, a.onTitleChanged = v, a.onSyncExportSuccess = v,
a.onSyncRemoved = v, a.onNewPublishSuccess = v, a.onPublishRemoved = v, a.onFoldersChanged = v;
var b = void 0, y = "";
return a.onReady = function() {
d = document.querySelector(".document-panel"), b = d.querySelector(".panel-content"),
h = d.querySelector(".document-list"), p = e(h), f = d.querySelector(".document-list-filtered"),
g = e(f), e(d).on("show.bs.collapse", function(t) {
if (t.target === d) {
var n = m.folder;
void 0 !== n && e(d.querySelector(".file-list." + n.folderIndex.replace(".", ""))).collapse("show");
}
}).on("shown.bs.collapse", function(e) {
e.target === d && (t.val(""), s(""), b.scrollTop += h.querySelector(".file.active").getBoundingClientRect().top - 120);
});
var t = e(d.querySelector(".search-bar .form-control"));
t.bind("propertychange keyup input paste", function() {
s(t.val());
}), e(d.querySelector(".search-bar .close")).click(function() {
t.val(""), s(""), t.focus();
});
}, a;
}), define("extensions/documentManager", [ "jquery", "underscore", "utils", "classes/Extension", "classes/FolderDescriptor", "folderList", "fileSystem", "config" ], function(e, t, n, i, o, r, s) {
function a() {
x = [], C = [], t.each(w.querySelectorAll('input[type="checkbox"]:checked'), function(t) {
var n = e(t.parentNode.parentNode), i = r[n.data("folderIndex")], o = s[n.data("fileIndex")];
void 0 !== i ? x.push(i) : void 0 !== o && C.push(o);
});
}
function l() {
if (0 === t.size(C)) return c(), void 0;
var n = t.chain(C).sortBy(function(e) {
return e.title.toLowerCase();
}).reduce(function(e, n) {
return e + t.template(v, {
fileDesc: n
});
}, "").value();
E.innerHTML = '<ul class="file-list nav">' + n + "</ul>", e(y.querySelectorAll(".document-list")).addClass("hide"),
e(y.querySelectorAll(".confirm-delete, .selected-document-list")).removeClass("hide");
}
function c() {
t.each(C, function(e) {
e.folder && e.folder.removeFile(e), h.deleteFile(e);
}), t.each(x, function(e) {
n.removeIndexFromArray("folder.list", e.folderIndex), localStorage.removeItem(e.folderIndex + ".name"),
localStorage.removeItem(e.folderIndex + ".files"), delete r[e.folderIndex];
}), p.onFoldersChanged();
}
function u() {
a(), S.toggleClass("disabled", 0 === t.size(r) || 0 === t.size(C)), A.toggleClass("disabled", 0 === t.size(x) && 0 === t.size(C));
}
var d = new i("documentManager", "Document Manager", !1, !0), h = void 0;
d.onFileMgrCreated = function(e) {
h = e;
};
var p = void 0;
d.onEventMgrCreated = function(e) {
p = e;
};
var f = [ '<a href="#" class="list-group-item folder clearfix" data-folder-index="<%= folderDesc.folderIndex %>" data-toggle="collapse" data-target=".modal-document-manager .file-list.<%= id %>">', '<label class="checkbox" title="Select"><input type="checkbox"></label>', '<button class="btn btn-default button-delete" title="Delete"><i class="icon-trash"></i></button>', '<button class="btn btn-default button-rename" title="Rename"><i class="icon-pencil"></i></button>', '<div class="pull-right file-count"><%= _.size(folderDesc.fileList) %></div>', '<div class="name"><i class="icon-folder"></i> ', "<%= folderDesc.name %></div>", '<input type="text" class="input-rename form-control hide"></a>', '<div class="file-list collapse <%= id %> clearfix"><%= fileListHtml %></div>' ].join(""), g = [ '<li class="list-group-item file clearfix" data-file-index="<%= fileDesc.fileIndex %>">', '<label class="checkbox" title="Select"><input type="checkbox"></label>', '<button class="btn btn-default button-delete" title="Delete"><i class="icon-trash"></i></button>', '<button class="btn btn-default button-rename" title="Rename"><i class="icon-pencil"></i></button>', '<div class="name"><%= fileDesc.composeTitle() %></div>', '<input type="text" class="input-rename form-control hide"></li>' ].join(""), m = [ '<a href="#" class="list-group-item folder clearfix" data-folder-index="<%= folderDesc.folderIndex %>">', '<div class="pull-right file-count"><%= _.size(folderDesc.fileList) %></div>', '<div class="name"><i class="icon-forward"></i> ', "<%= folderDesc.name %></div></a>" ].join(""), v = [ '<li class="list-group-item file clearfix">', '<div class="name"><%= fileDesc.composeTitle() %></div></li>' ].join(""), b = !1, y = void 0, w = void 0, C = [], x = [], E = void 0, S = void 0, A = void 0, k = void 0, F = void 0, _ = void 0, $ = function() {
if (b !== !1) {
u(), F.text(t.size(s)), _.text(t.size(r) + 1), k = t.filter(s, function(e) {
return void 0 === e.folder;
});
var n = [ '<a href="#" class="list-group-item folder clearfix" data-toggle="collapse" data-target=".modal-document-manager .file-list.root-folder">', '<label class="checkbox" title="Select"><input type="checkbox"></label>', '<div class="pull-right file-count">', t.size(k), "</div>", '<div class="name"><i class="icon-folder"></i> ', "ROOT folder</div></a>" ].join(""), i = t.chain(k).sortBy(function(e) {
return e.title.toLowerCase();
}).reduce(function(e, n) {
return e + t.template(g, {
fileDesc: n
});
}, "").value();
i = i && '<ul class="nav">' + i + "</ul>", n += '<div class="file-list collapse root-folder clearfix">' + i + "</div>",
t.chain(r).sortBy(function(e) {
return e.name.toLowerCase();
}).each(function(e) {
var i = t.chain(e.fileList).sortBy(function(e) {
return e.title.toLowerCase();
}).reduce(function(e, n) {
return e + t.template(g, {
fileDesc: n
});
}, "").value();
i = i && '<ul class="nav">' + i + "</ul>", n += t.template(f, {
folderDesc: e,
fileListHtml: i,
id: e.folderIndex.replace(".", "")
});
}), w.innerHTML = n, t.each(w.querySelectorAll(".button-delete"), function(t) {
var n = e(t);
n.click(function(e) {
e.stopPropagation();
var t = n.parent(), i = r[t.data("folderIndex")], o = s[t.data("fileIndex")];
C = [], x = [], i ? (x.push(i), C = i.fileList) : o && C.push(o), l();
});
}), t.each(w.querySelectorAll(".button-rename"), function(t) {
var n = e(t);
n.click(function(e) {
e.stopPropagation();
var t = n.parent(), i = void 0, o = r[t.data("folderIndex")], a = s[t.data("fileIndex")];
o ? i = o.name : a && (i = a.title), t.find(".name").addClass("hide"), t.find(".input-rename").removeClass("hide").val(i)[0].select();
});
}), t.each(w.querySelectorAll(".input-rename"), function(t) {
function n() {
var t = i.parent(), n = e.trim(i.val()), o = r[t.data("folderIndex")], a = s[t.data("fileIndex")];
n && o && n != o.name ? (o.name = n, p.onFoldersChanged()) : n && a && n != a.title ? (a.title = n,
p.onTitleChanged(a)) : (i.addClass("hide"), t.find(".name").removeClass("hide"));
}
var i = e(t);
i.blur(function() {
n();
}).keyup(function(e) {
13 == e.keyCode && (n(), e.stopPropagation()), 27 == e.keyCode && (i.val(""), n(),
e.stopPropagation());
});
}), t.each(w.querySelectorAll(".folder .checkbox"), function(t) {
var n = e(t);
n.click(function(e) {
e.stopPropagation();
}).find("[type=checkbox]").change(function() {
var e = n.parent().next().find("[type=checkbox]");
this.checked ? e.prop("checked", !0).prop("disabled", !0) : e.prop("checked", !1).prop("disabled", !1);
});
}), e(w.querySelectorAll("[type=checkbox]")).change(u);
}
};
return d.onFileCreated = $, d.onFileDeleted = $, d.onTitleChanged = $, d.onSyncExportSuccess = $,
d.onSyncRemoved = $, d.onNewPublishSuccess = $, d.onPublishRemoved = $, d.onFoldersChanged = $,
d.onReady = function() {
y = document.querySelector(".modal-document-manager"), w = y.querySelector(".list-group.document-list"),
F = e(y.querySelectorAll(".document-count")), _ = e(y.querySelectorAll(".folder-count")),
E = y.querySelector(".list-group.selected-document-list");
var i = y.querySelector(".list-group.select-folder-list");
e(y).on("show.bs.modal", function() {
b = !0, $();
}).on("hide.bs.modal", function() {
b = !1;
}), e(y.querySelectorAll(".action-create-folder")).click(function() {
var i = void 0;
do i = "folder." + n.randomString(); while (t.has(r, i));
localStorage[i + ".name"] = DEFAULT_FOLDER_NAME;
var s = new o(i, DEFAULT_FOLDER_NAME);
n.appendIndexToArray("folder.list", i), r[i] = s, p.onFoldersChanged();
var a = e(y.querySelector('[data-folder-index="' + i + '"] .button-rename')).click();
y.scrollTop += a.offset().top - 50;
}), e(y.querySelectorAll(".action-select-all")).click(function() {
e(w.querySelectorAll('input[type="checkbox"]')).prop("checked", !0).change();
}), e(y.querySelectorAll(".action-unselect-all")).click(function() {
e(w.querySelectorAll('input[type="checkbox"]')).prop("checked", !1).change();
});
var s = e(y.querySelectorAll(".action-delete-items")).click(function() {
A.hasClass("disabled") || (a(), l());
});
A = s.parent(), e(y.querySelectorAll(".action-delete-items-confirm")).click(function() {
c(), e(y.querySelectorAll(".document-list")).removeClass("hide"), e(y.querySelectorAll(".confirm-delete, .selected-document-list")).addClass("hide");
});
var u = e(y.querySelectorAll(".action-move-items")).click(function() {
if (!S.hasClass("disabled")) {
a();
var n = [ '<a href="#" class="list-group-item folder clearfix">', '<div class="pull-right file-count">', t.size(k), "</div>", '<div class="name"><i class="icon-forward"></i> ', "ROOT folder</div></a>" ].join("");
n += t.chain(r).sortBy(function(e) {
return e.name.toLowerCase();
}).reduce(function(e, n) {
return e + t.template(m, {
folderDesc: n
});
}, "").value(), i.innerHTML = n, t.each(i.querySelectorAll(".folder"), function(n) {
n = e(n), n.click(function() {
var i = r[n.data("folderIndex")];
t.each(C, function(e) {
e.folder && e.folder.removeFile(e), i && i.addFile(e);
}), p.onFoldersChanged(), e(y.querySelectorAll(".document-list")).removeClass("hide"),
e(y.querySelectorAll(".choose-folder, .select-folder-list")).addClass("hide");
});
}), e(y.querySelectorAll(".document-list")).addClass("hide"), e(y.querySelectorAll(".choose-folder, .select-folder-list")).removeClass("hide");
}
});
S = u.parent(), e(y.querySelectorAll(".action-cancel")).click(function() {
e(y.querySelectorAll(".document-list")).removeClass("hide"), e(y.querySelectorAll(".confirm-delete, .choose-folder, .selected-document-list, .select-folder-list")).addClass("hide");
});
}, d;
}), define("extensions/workingIndicator", [ "jquery", "underscore", "classes/Extension" ], function(e, t, n) {
var i = new n("workingIndicator", "Working Indicator"), o = void 0, r = void 0;
return i.onAsyncRunning = function(e) {
o.toggleClass("working", e), r.toggleClass("show", e);
}, i.onReady = function() {
o = e(document.body), r = e(".working-indicator");
}, i;
}), function(e) {
var t = function() {
return !1 === e.support.boxModel && e.support.objectAll && $support.leadingWhitespace;
}();
e.jGrowl = function(t, n) {
0 == e("#jGrowl").size() && e('<div id="jGrowl"></div>').addClass(n && n.position ? n.position : e.jGrowl.defaults.position).appendTo("body"),
e("#jGrowl").jGrowl(t, n);
}, e.fn.jGrowl = function(t, n) {
if (e.isFunction(this.each)) {
var i = arguments;
return this.each(function() {
void 0 == e(this).data("jGrowl.instance") && (e(this).data("jGrowl.instance", e.extend(new e.fn.jGrowl(), {
notifications: [],
element: null,
interval: null
})), e(this).data("jGrowl.instance").startup(this)), e.isFunction(e(this).data("jGrowl.instance")[t]) ? e(this).data("jGrowl.instance")[t].apply(e(this).data("jGrowl.instance"), e.makeArray(i).slice(1)) : e(this).data("jGrowl.instance").create(t, n);
});
}
}, e.extend(e.fn.jGrowl.prototype, {
defaults: {
pool: 0,
header: "",
group: "",
sticky: !1,
position: "top-right",
glue: "after",
theme: "default",
themeState: "highlight",
corners: "10px",
check: 250,
life: 3e3,
closeDuration: "normal",
openDuration: "normal",
easing: "swing",
closer: !0,
closeTemplate: "&times;",
closerTemplate: "<div>[ close all ]</div>",
log: function() {},
beforeOpen: function() {},
afterOpen: function() {},
open: function() {},
beforeClose: function() {},
close: function() {},
animateOpen: {
opacity: "show"
},
animateClose: {
opacity: "hide"
}
},
notifications: [],
element: null,
interval: null,
create: function(t, n) {
var n = e.extend({}, this.defaults, n);
"undefined" != typeof n.speed && (n.openDuration = n.speed, n.closeDuration = n.speed),
this.notifications.push({
message: t,
options: n
}), n.log.apply(this.element, [ this.element, t, n ]);
},
render: function(t) {
var n = this, i = t.message, o = t.options;
o.themeState = "" == o.themeState ? "" : "ui-state-" + o.themeState;
var t = e('<div class="jGrowl-notification ' + o.themeState + " ui-corner-all" + (void 0 != o.group && "" != o.group ? " " + o.group : "") + '">' + '<div class="jGrowl-close">' + o.closeTemplate + "</div>" + '<div class="jGrowl-header">' + o.header + "</div>" + '<div class="jGrowl-message">' + i + "</div></div>").data("jGrowl", o).addClass(o.theme).children("div.jGrowl-close").bind("click.jGrowl", function() {
e(this).parent().trigger("jGrowl.beforeClose");
}).parent();
e(t).bind("mouseover.jGrowl", function() {
e("div.jGrowl-notification", n.element).data("jGrowl.pause", !0);
}).bind("mouseout.jGrowl", function() {
e("div.jGrowl-notification", n.element).data("jGrowl.pause", !1);
}).bind("jGrowl.beforeOpen", function() {
0 != o.beforeOpen.apply(t, [ t, i, o, n.element ]) && e(this).trigger("jGrowl.open");
}).bind("jGrowl.open", function() {
0 != o.open.apply(t, [ t, i, o, n.element ]) && ("after" == o.glue ? e("div.jGrowl-notification:last", n.element).after(t) : e("div.jGrowl-notification:first", n.element).before(t),
e(this).animate(o.animateOpen, o.openDuration, o.easing, function() {
e.support.opacity === !1 && this.style.removeAttribute("filter"), null != e(this).data("jGrowl") && (e(this).data("jGrowl").created = new Date()),
e(this).trigger("jGrowl.afterOpen");
}));
}).bind("jGrowl.afterOpen", function() {
o.afterOpen.apply(t, [ t, i, o, n.element ]);
}).bind("jGrowl.beforeClose", function() {
0 != o.beforeClose.apply(t, [ t, i, o, n.element ]) && e(this).trigger("jGrowl.close");
}).bind("jGrowl.close", function() {
e(this).data("jGrowl.pause", !0), e(this).animate(o.animateClose, o.closeDuration, o.easing, function() {
e.isFunction(o.close) ? o.close.apply(t, [ t, i, o, n.element ]) !== !1 && e(this).remove() : e(this).remove();
});
}).trigger("jGrowl.beforeOpen"), "" != o.corners && void 0 != e.fn.corner && e(t).corner(o.corners),
e("div.jGrowl-notification:parent", n.element).size() > 1 && 0 == e("div.jGrowl-closer", n.element).size() && 0 != this.defaults.closer && e(this.defaults.closerTemplate).addClass("jGrowl-closer " + this.defaults.themeState + " ui-corner-all").addClass(this.defaults.theme).appendTo(n.element).animate(this.defaults.animateOpen, this.defaults.speed, this.defaults.easing).bind("click.jGrowl", function() {
e(this).siblings().trigger("jGrowl.beforeClose"), e.isFunction(n.defaults.closer) && n.defaults.closer.apply(e(this).parent()[0], [ e(this).parent()[0] ]);
});
},
update: function() {
e(this.element).find("div.jGrowl-notification:parent").each(function() {
void 0 != e(this).data("jGrowl") && void 0 != e(this).data("jGrowl").created && e(this).data("jGrowl").created.getTime() + parseInt(e(this).data("jGrowl").life) < new Date().getTime() && 1 != e(this).data("jGrowl").sticky && (void 0 == e(this).data("jGrowl.pause") || 1 != e(this).data("jGrowl.pause")) && e(this).trigger("jGrowl.beforeClose");
}), this.notifications.length > 0 && (0 == this.defaults.pool || e(this.element).find("div.jGrowl-notification:parent").size() < this.defaults.pool) && this.render(this.notifications.shift()),
e(this.element).find("div.jGrowl-notification:parent").size() < 2 && e(this.element).find("div.jGrowl-closer").animate(this.defaults.animateClose, this.defaults.speed, this.defaults.easing, function() {
e(this).remove();
});
},
startup: function(n) {
this.element = e(n).addClass("jGrowl").append('<div class="jGrowl-notification"></div>'),
this.interval = setInterval(function() {
e(n).data("jGrowl.instance").update();
}, parseInt(this.defaults.check)), t && e(this.element).addClass("ie6");
},
shutdown: function() {
e(this.element).removeClass("jGrowl").find("div.jGrowl-notification").remove(),
clearInterval(this.interval);
},
close: function() {
e(this.element).find("div.jGrowl-notification").each(function() {
e(this).trigger("jGrowl.beforeClose");
});
}
}), e.jGrowl.defaults = e.fn.jGrowl.prototype.defaults;
}(jQuery), define("jgrowl", [ "jquery" ], function(e) {
return function() {
var t;
return t || e.jQuery.jGrowl;
};
}(this)), define("text!html/notificationsSettingsBlock.html", [], function() {
return '<p>Shows notification messages in the bottom-right corner of the\n screen.</p>\n<div class="form-horizontal">\n <div class="form-group">\n <label class="col-lg-4 control-label" for="input-notifications-timeout">Timeout</label>\n <div class="col-lg-7 form-inline">\n <input type="text" id="input-notifications-timeout"\n class="col-lg-5 form-control"> <span class="help-inline">ms</span>\n </div>\n </div>\n</div>';
}), define("extensions/notifications", [ "jquery", "underscore", "utils", "classes/Extension", "jgrowl", "text!html/notificationsSettingsBlock.html" ], function(e, t, n, i, o, r) {
function s() {
c === !1 && (o.defaults.life = l.config.timeout, o.defaults.closer = !1, o.defaults.closeTemplate = "",
o.defaults.position = "bottom-right", c = !0);
}
function a(e, n, i) {
if (logger.info(e), s(), e) {
var r = e.indexOf("|");
(-1 === r || (e = e.substring(0, r))) && (i = i || {}, n = n || "icon-info-circled",
o("<i class='icon-white " + n + "'></i> " + t.escape(e).replace(/\n/g, "<br/>"), i));
}
}
var l = new i("notifications", "Notifications");
l.settingsBlock = r, l.defaultConfig = {
timeout: 8e3
}, l.onLoadSettings = function() {
n.setInputValue("#input-notifications-timeout", l.config.timeout);
}, l.onSaveSettings = function(e, t) {
e.timeout = n.getInputIntValue("#input-notifications-timeout", t, 1, 6e4);
};
var c = !1;
return l.onMessage = function(e) {
a(e);
}, l.onError = function(e) {
logger.error(e), t.isString(e) ? a(e, "icon-attention") : t.isObject(e) && a(e.message, "icon-attention");
}, l.onOfflineChanged = function(t) {
t === !0 ? a("You are offline.", "icon-attention-circled msg-offline", {
sticky: !0,
close: function() {
a("You are back online!", "icon-signal");
}
}) : e(".msg-offline").parents(".jGrowl-notification").trigger("jGrowl.beforeClose");
}, l.onSyncImportSuccess = function(e, n) {
var i = t.map(e, function(e) {
return e.title;
}).join(", ");
a(i + " imported successfully from " + n.providerName + ".");
}, l.onSyncExportSuccess = function(e, t) {
a('"' + e.title + '" will now be synchronized on ' + t.provider.providerName + ".");
}, l.onSyncRemoved = function(e, t) {
a(t.provider.providerName + " synchronized location has been removed.");
}, l.onPublishSuccess = function(e) {
a('"' + e.title + '" successfully published.');
}, l.onNewPublishSuccess = function(e, t) {
a('"' + e.title + '" is now published on ' + t.provider.providerName + ".");
}, l.onPublishRemoved = function(e, t) {
a(t.provider.providerName + " publish location has been removed.");
}, l;
}), define("text!html/markdownExtraSettingsBlock.html", [], function() {
return '<p>Adds extra features to the original Markdown syntax.</p>\n<div class="form-horizontal">\n <div class="form-group">\n <label class="col-lg-4 control-label"\n for="input-markdownextra-fencedcodegfm">GFM fenced code\n blocks</label>\n <div class="col-lg-7">\n <div class="checkbox">\n <input type="checkbox" id="input-markdownextra-fencedcodegfm">\n </div>\n </div>\n </div>\n <div class="form-group">\n <label class="col-lg-4 control-label" for="input-markdownextra-tables">Tables</label>\n <div class="col-lg-7">\n <div class="checkbox">\n <input type="checkbox" id="input-markdownextra-tables">\n </div>\n </div>\n </div>\n <div class="form-group">\n <label class="col-lg-4 control-label"\n for="input-markdownextra-deflist">Definition lists</label>\n <div class="col-lg-7">\n <div class="checkbox">\n <input type="checkbox" id="input-markdownextra-deflist">\n </div>\n </div>\n </div>\n <div class="form-group">\n <label class="col-lg-4 control-label"\n for="input-markdownextra-attrlist">Special attributes</label>\n <div class="col-lg-7">\n <div class="checkbox">\n <input type="checkbox" id="input-markdownextra-attrlist">\n </div>\n </div>\n </div>\n <div class="form-group">\n <label class="col-lg-4 control-label"\n for="input-markdownextra-footnotes">Footnotes</label>\n <div class="col-lg-7">\n <div class="checkbox">\n <input type="checkbox" id="input-markdownextra-footnotes">\n </div>\n </div>\n </div>\n <div class="form-group">\n <label class="col-lg-4 control-label"\n for="input-markdownextra-highlighter">Syntax highlighter</label>\n <div class="col-lg-7">\n <select id="input-markdownextra-highlighter" class="form-control"><option>None</option>\n <option value="prettify">Prettify</option>\n <option value="highlight">Highlight.js</option>\n </select>\n </div>\n </div>\n</div>\n<span class="help-block pull-right"><a target="_blank"\n href="https://github.com/jmcmanus/pagedown-extra">More info</a></span>';
});
var Markdown;
Markdown = "object" == typeof exports && "function" == typeof require ? exports : {},
function() {
function e(e) {
return e;
}
function t() {
return !1;
}
function n() {}
function i() {}
n.prototype = {
chain: function(t, n) {
var i = this[t];
if (!i) throw new Error("unknown hook " + t);
this[t] = i === e ? n : function() {
var e = Array.prototype.slice.call(arguments, 0);
return e[0] = i.apply(null, e), n.apply(null, e);
};
},
set: function(e, t) {
if (!this[e]) throw new Error("unknown hook " + e);
this[e] = t;
},
addNoop: function(t) {
this[t] = e;
},
addFalse: function(e) {
this[e] = t;
}
}, Markdown.HookCollection = n, i.prototype = {
set: function(e, t) {
this["s_" + e] = t;
},
get: function(e) {
return this["s_" + e];
}
}, Markdown.Converter = function() {
function e(e) {
return e = e.replace(/^[ ]{0,3}\[(.+)\]:[ \t]*\n?[ \t]*<?(\S+?)>?(?=\s|$)[ \t]*\n?[ \t]*((\n*)["(](.+?)[")][ \t]*)?(?:\n+)/gm, function(e, t, n, i, o, r) {
return t = t.toLowerCase(), M.set(t, E(n)), o ? i : (r && R.set(t, r.replace(/"/g, "&quot;")),
"");
});
}
function t(e) {
return e = e.replace(/^(<(p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math|ins|del)\b[^\r]*?\n<\/\2>[ \t]*(?=\n+))/gm, o),
e = e.replace(/^(<(p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math)\b[^\r]*?.*<\/\2>[ \t]*(?=\n+)\n)/gm, o),
e = e.replace(/\n[ ]{0,3}((<(hr)\b([^<>])*?\/?>)[ \t]*(?=\n{2,}))/g, o), e = e.replace(/\n\n[ ]{0,3}(<!(--(?:|(?:[^>-]|-[^>])(?:[^-]|-[^-])*)--)>[ \t]*(?=\n{2,}))/g, o),
e = e.replace(/(?:\n\n)([ ]{0,3}(?:<([?%])[^\r]*?\2>)[ \t]*(?=\n{2,}))/g, o);
}
function o(e, t) {
var n = t;
return n = n.replace(/^\n+/, ""), n = n.replace(/\n+$/g, ""), n = "\n\n~K" + (I.push(n) - 1) + "K\n\n";
}
function r(e, n) {
e = B.preBlockGamut(e, N), e = p(e);
var i = "<hr />\n";
return e = e.replace(/^[ ]{0,2}([ ]?\*[ ]?){3,}[ \t]*$/gm, i), e = e.replace(/^[ ]{0,2}([ ]?-[ ]?){3,}[ \t]*$/gm, i),
e = e.replace(/^[ ]{0,2}([ ]?_[ ]?){3,}[ \t]*$/gm, i), e = f(e), e = m(e), e = C(e),
e = B.postBlockGamut(e, N), e = t(e), e = x(e, n);
}
function s(e) {
return e = B.preSpanGamut(e), e = b(e), e = a(e), e = S(e), e = u(e), e = l(e),
e = k(e), e = e.replace(/~P/g, "://"), e = E(e), e = w(e), e = e.replace(/ +\n/g, " <br>\n"),
e = B.postSpanGamut(e);
}
function a(e) {
var t = /(<[a-z\/!$]("[^"]*"|'[^']*'|[^'">])*>|<!(--(?:|(?:[^>-]|-[^>])(?:[^-]|-[^-])*)--)>)/gi;
return e = e.replace(t, function(e) {
var t = e.replace(/(.)<\/?code>(?=.)/g, "$1`");
return t = D(t, "!" == e.charAt(1) ? "\\`*_/" : "\\`*_");
});
}
function l(e) {
return e = e.replace(/(\[((?:\[[^\]]*\]|[^\[\]])*)\][ ]?(?:\n[ ]*)?\[(.*?)\])()()()()/g, c),
e = e.replace(/(\[((?:\[[^\]]*\]|[^\[\]])*)\]\([ \t]*()<?((?:\([^)]*\)|[^()\s])*?)>?[ \t]*((['"])(.*?)\6[ \t]*)?\))/g, c),
e = e.replace(/(\[([^\[\]]+)\])()()()()()/g, c);
}
function c(e, t, n, i, o, r, s, a) {
void 0 == a && (a = "");
var l = t, c = n.replace(/:\/\//g, "~P"), u = i.toLowerCase(), h = o, p = a;
if ("" == h) if ("" == u && (u = c.toLowerCase().replace(/ ?\n/g, " ")), h = "#" + u,
void 0 != M.get(u)) h = M.get(u), void 0 != R.get(u) && (p = R.get(u)); else {
if (!(l.search(/\(\s*\)$/m) > -1)) return l;
h = "";
}
h = T(h), h = D(h, "*_");
var f = '<a href="' + h + '"';
return "" != p && (p = d(p), p = D(p, "*_"), f += ' title="' + p + '"'), f += ">" + c + "</a>";
}
function u(e) {
return e = e.replace(/(!\[(.*?)\][ ]?(?:\n[ ]*)?\[(.*?)\])()()()()/g, h), e = e.replace(/(!\[(.*?)\]\s?\([ \t]*()<?(\S+?)>?[ \t]*((['"])(.*?)\6[ \t]*)?\))/g, h);
}
function d(e) {
return e.replace(/>/g, "&gt;").replace(/</g, "&lt;").replace(/"/g, "&quot;");
}
function h(e, t, n, i, o, r, s, a) {
var l = t, c = n, u = i.toLowerCase(), h = o, p = a;
if (p || (p = ""), "" == h) {
if ("" == u && (u = c.toLowerCase().replace(/ ?\n/g, " ")), h = "#" + u, void 0 == M.get(u)) return l;
h = M.get(u), void 0 != R.get(u) && (p = R.get(u));
}
c = D(d(c), "*_[]()"), h = D(h, "*_");
var f = '<img src="' + h + '" alt="' + c + '"';
return p = d(p), p = D(p, "*_"), f += ' title="' + p + '"', f += " />";
}
function p(e) {
return e = e.replace(/^(.+)[ \t]*\n=+[ \t]*\n+/gm, function(e, t) {
return '<h1 class="wmd-title">' + s(t) + "</h1>\n\n";
}), e = e.replace(/^(.+)[ \t]*\n-+[ \t]*\n+/gm, function(e, t) {
return '<h2 class="wmd-title">' + s(t) + "</h2>\n\n";
}), e = e.replace(/^(\#{1,6})[ \t]*(.+?)[ \t]*\#*\n+/gm, function(e, t, n) {
var i = t.length;
return "<h" + i + ' class="wmd-title">' + s(n) + "</h" + i + ">\n\n";
});
}
function f(e, t) {
e += "~0";
var n = /^(([ ]{0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(~0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/gm;
return P ? e = e.replace(n, function(e, n, i) {
var o = n, r = i.search(/[*+-]/g) > -1 ? "ul" : "ol", s = g(o, r, t);
return s = s.replace(/\s+$/, ""), s = "<" + r + ">" + s + "</" + r + ">\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 o = t, r = n, s = i.search(/[*+-]/g) > -1 ? "ul" : "ol", a = g(r, s);
return a = o + "<" + s + ">\n" + a + "</" + s + ">\n";
})), e = e.replace(/~0/, "");
}
function g(e, t, n) {
P++, e = e.replace(/\n{2,}$/, "\n"), e += "~0";
var i = O[t], o = new RegExp("(^[ \\t]*)(" + i + ")[ \\t]+([^\\r]+?(\\n+))(?=(~0|\\1(" + i + ")[ \\t]+))", "gm"), a = !1;
return e = e.replace(o, function(e, t, i, o) {
var l = o, c = /\n\n$/.test(l), u = c || l.search(/\n{2,}/) > -1;
return u || a ? l = r(_(l), !0) : (l = f(_(l), !0), l = l.replace(/\n$/, ""), n || (l = s(l))),
a = c, "<li>" + l + "</li>\n";
}), e = e.replace(/~0/g, ""), P--, e;
}
function m(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, o = n;
return i = y(_(i)), i = $(i), i = i.replace(/^\n+/g, ""), i = i.replace(/\n+$/g, ""),
i = "<pre><code>" + i + "\n</code></pre>", "\n\n" + i + "\n\n" + o;
}), e = e.replace(/~0/, "");
}
function v(e) {
return e = e.replace(/(^\n+|\n+$)/g, ""), "\n\n~K" + (I.push(e) - 1) + "K\n\n";
}
function b(e) {
return e = e.replace(/(^|[^\\])(`+)([^\r]*?[^`])\2(?!`)/gm, function(e, t, n, i) {
var o = i;
return o = o.replace(/^([ \t]*)/g, ""), o = o.replace(/[ \t]*$/g, ""), o = y(o),
o = o.replace(/:\/\//g, "~P"), t + "<code>" + o + "</code>";
});
}
function y(e) {
return e = e.replace(/&/g, "&amp;"), e = e.replace(/</g, "&lt;"), e = e.replace(/>/g, "&gt;"),
e = D(e, "*_{}[]\\", !1);
}
function w(e) {
return e = e.replace(/([\W_]|^)(\*\*|__)(?=\S)([^\r]*?\S[\*_]*)\2([\W_]|$)/g, "$1<strong>$3</strong>$4"),
e = e.replace(/([\W_]|^)(\*|_)(?=\S)([^\r\*_]*?\S)\2([\W_]|$)/g, "$1<em>$3</em>$4");
}
function C(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 = r(n), n = n.replace(/(^|\n)/g, "$1 "), n = n.replace(/(\s*<pre>[^\r]+?<\/pre>)/gm, function(e, t) {
var n = t;
return n = n.replace(/^ /gm, "~0"), n = n.replace(/~0/g, "");
}), v("<blockquote>\n" + n + "\n</blockquote>");
});
}
function x(e, t) {
e = e.replace(/^\n+/g, ""), e = e.replace(/\n+$/g, "");
for (var n = e.split(/\n{2,}/g), i = [], o = /~K(\d+)K/, r = n.length, a = 0; r > a; a++) {
var l = n[a];
o.test(l) ? i.push(l) : /\S/.test(l) && (l = s(l), l = l.replace(/^([ \t]*)/g, "<p>"),
l += "</p>", i.push(l));
}
if (!t) {
r = i.length;
for (var a = 0; r > a; a++) for (var c = !0; c; ) c = !1, i[a] = i[a].replace(/~K(\d+)K/g, function(e, t) {
return c = !0, I[t];
});
}
return i.join("\n\n");
}
function E(e) {
return e = e.replace(/&(?!#?[xX]?(?:[0-9a-fA-F]+|\w+);)/g, "&amp;"), e = e.replace(/<(?![a-z\/?!]|~D)/gi, "&lt;");
}
function S(e) {
return e = e.replace(/\\(\\)/g, L), e = e.replace(/\\([`*_{}\[\]()>#+-.!])/g, L);
}
function A(e, t, n, i) {
if (t) return e;
if (")" !== i.charAt(i.length - 1)) return "<" + n + i + ">";
for (var o = i.match(/[()]/g), r = 0, s = 0; s < o.length; s++) "(" === o[s] ? 0 >= r ? r = 1 : r++ : r--;
var a = "";
if (0 > r) {
var l = new RegExp("\\){1," + -r + "}$");
i = i.replace(l, function(e) {
return a = e, "";
});
}
if (a) {
var c = i.charAt(i.length - 1);
q.test(c) || (a = c + a, i = i.substr(0, i.length - 1));
}
return "<" + n + i + ">" + a;
}
function k(e) {
e = e.replace(H, A);
var t = function(e, t) {
return '<a href="' + t + '">' + B.plainLinkText(t) + "</a>";
};
return e = e.replace(/<((https?|ftp):[^'">\s]+)>/gi, t);
}
function F(e) {
return e = e.replace(/~E(\d+)E/g, function(e, t) {
var n = parseInt(t);
return String.fromCharCode(n);
});
}
function _(e) {
return e = e.replace(/^(\t|[ ]{1,4})/gm, "~0"), e = e.replace(/~0/g, "");
}
function $(e) {
if (!/\t/.test(e)) return e;
var t, n = [ " ", " ", " ", " " ], i = 0;
return e.replace(/[\n\t]/g, function(e, o) {
return "\n" === e ? (i = o + 1, e) : (t = (o - i) % 4, i = o + 1, n[t]);
});
}
function T(e) {
return e ? (e.length, e.replace(W, function(e) {
return "~D" == e ? "%24" : ":" == e ? ":" : "%" + e.charCodeAt(0).toString(16);
})) : "";
}
function D(e, t, n) {
var i = "([" + t.replace(/([\[\]\\])/g, "\\$1") + "])";
n && (i = "\\\\" + i);
var o = new RegExp(i, "g");
return e = e.replace(o, L);
}
function L(e, t) {
var n = t.charCodeAt(0);
return "~E" + n + "E";
}
var B = this.hooks = new n();
B.addNoop("plainLinkText"), B.addNoop("preConversion"), B.addNoop("postNormalization"),
B.addNoop("preBlockGamut"), B.addNoop("postBlockGamut"), B.addNoop("preSpanGamut"),
B.addNoop("postSpanGamut"), B.addNoop("postConversion");
var M, R, I, P;
this.makeHtml = function(n) {
if (M) throw new Error("Recursive call to converter.makeHtml");
return M = new i(), R = new i(), I = [], P = 0, n = B.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 = $(n), n = n.replace(/^[ \t]+$/gm, ""), n = B.postNormalization(n),
n = t(n), n = e(n), n = r(n), n = F(n), n = n.replace(/~D/g, "$$"), n = n.replace(/~T/g, "~"),
n = B.postConversion(n), I = R = M = null, n;
};
var N = function(e) {
return r(e);
}, O = {
ol: "\\d+[.]",
ul: "[*+-]"
}, z = "[-A-Z0-9+&@#/%?=~_|[\\]()!:,.;]", j = "[-A-Z0-9+&@#/%=~_|[\\])]", H = new RegExp('(="|<)?\\b(https?|ftp)(://' + z + "*" + j + ")(?=$|\\W)", "gi"), q = new RegExp(j, "i"), W = /(?:["'*()[\]:]|~D)/g;
};
}(), define("bower-libs/pagedown-ace/Markdown.Converter", function() {}), function() {
function e() {}
function t(e, t) {
this.buttonBar = u.getElementById("wmd-button-bar" + e), this.preview = u.getElementById("wmd-preview" + e),
this.input = t;
}
function n(t) {
var n = this, i = t.input;
this.init = function() {
var e = "undefined" != typeof require ? require("ace/range").Range : ace.require("ace/range").Range;
(function(t) {
n.before = i.session.getTextRange(new e(0, 0, t.start.row, t.start.column)), n.selection = i.session.getTextRange(),
n.after = i.session.getTextRange(new e(t.end.row, t.end.column, Number.MAX_VALUE, Number.MAX_VALUE));
})(i.selection.getRange()), this.text = [ this.before, this.selection, this.after ].join(""),
this.length = this.text.length, this.setInputAreaSelectionStartEnd(), this.scrollTop = i.renderer.getScrollTop();
}, this.setInputAreaSelection = function() {
var e = "undefined" != typeof require ? require("ace/range").Range : ace.require("ace/range").Range;
i.selection.setSelectionRange(function(t, n) {
return new e(t.row, t.column, n.row, n.column);
}(i.session.doc.indexToPosition(n.start), i.session.doc.indexToPosition(n.end))),
i.renderer.scrollToY(n.scrollTop), i.focus();
}, this.setInputAreaSelectionStartEnd = function() {
n.start = n.before.length, n.end = n.after.length;
}, this.restore = function() {
for (var e = 0, t = n.before.length; t > e && n.before.charCodeAt(e) === n.text.charCodeAt(e); ) e++;
for (var o = 0, r = n.after.length, s = n.after.length - 1, a = n.text.length - 1; r > o && n.after.charCodeAt(s - o) === n.text.charCodeAt(a - o); ) o++;
var l = "undefined" != typeof require ? require("ace/range").Range : ace.require("ace/range").Range, c = function(e, t) {
return new l(e.row, e.column, t.row, t.column);
}(i.session.doc.indexToPosition(e), i.session.doc.indexToPosition(n.length - o));
i.session.replace(c, n.text.substring(e, a - o + 1)), this.setInputAreaSelection();
}, this.getChunks = function() {
var t = new e();
return t.before = n.before, t.startTag = "", t.selection = n.selection, t.endTag = "",
t.after = n.after, t.scrollTop = n.scrollTop, t;
}, this.setChunks = function(e) {
e.before = e.before + e.startTag, e.after = e.endTag + e.after, this.start = e.before.length,
this.end = e.before.length + e.selection.length, this.text = e.before + e.selection + e.after,
this.scrollTop = e.scrollTop;
}, this.init();
}
function i(e, t, n, i) {
var o, r, s, a = 3e3, c = "delayed", d = function() {
var e = 0;
return window.innerHeight ? e = window.pageYOffset : u.documentElement && u.documentElement.scrollTop ? e = u.documentElement.scrollTop : u.body && (e = u.body.scrollTop),
e;
}, h = function() {
if (t.preview) {
var n = t.input.getValue();
if (!n || n != s) {
s = n;
var i = new Date().getTime();
n = e.makeHtml(n);
var o = new Date().getTime();
r = o - i, x(n);
}
}
};
void 0 !== i && (h = i(h));
var p = function() {
if (o && (clearTimeout(o), o = void 0), "manual" !== c) {
var e = 0;
"delayed" === c && (e = r), e > a && (e = a), o = setTimeout(h, e);
}
}, g = function(e) {
return e.scrollHeight <= e.clientHeight ? 1 : e.scrollTop / (e.scrollHeight - e.clientHeight);
}, m = function() {
t.preview && (t.preview.scrollTop = (t.preview.scrollHeight - t.preview.clientHeight) * g(t.preview));
};
this.refresh = function(e) {
e ? (s = "", h()) : p();
}, this.processingTime = function() {
return r;
};
var v, b = !0, y = function(e) {
var n = t.preview, i = n.parentNode, o = n.nextSibling;
i.removeChild(n), n.innerHTML = e, o ? i.insertBefore(n, o) : i.appendChild(n);
}, w = function(e) {
t.preview.innerHTML = e;
}, C = function(e) {
if (v) return v(e);
try {
w(e), v = w;
} catch (t) {
v = y, v(e);
}
}, x = function(e) {
var i = l.getTop(t.input) - d();
if (t.preview && (C(e), n()), m(), b) return b = !1, void 0;
var o = l.getTop(t.input) - d();
f.isIE ? setTimeout(function() {
window.scrollBy(0, o - i);
}, 0) : window.scrollBy(0, o - i);
}, E = function() {
t.input.session.on("change", p), t.preview && (t.preview.scrollTop = 0);
};
E();
}
function o(e, t, i, o, r, s, a, l) {
function c(e) {
if (0 !== e.length) {
var t = e.pop();
b.commands.addCommand({
name: a(t),
bindKey: {
win: "Ctrl-" + m[t],
mac: "Command-" + m[t]
},
exec: function() {
d(y[t]);
}
}), c(e);
}
}
function d(e) {
b.focus();
var r = "wmd-link-button" == e.id || "wmd-image-button" == e.id;
if (e.textOp) {
i && !r && i.setCommandMode();
var s = new n(t);
if (!s) return;
var a = s.getChunks(), l = function() {
b.focus(), a && s.setChunks(a), s.restore(), o.refresh();
}, c = e.textOp(a, l);
c || l();
}
e.execute && e.execute(i);
}
function h(e, n) {
var i = "0px", o = "-20px", r = "-40px", s = e.getElementsByTagName("span")[0];
n ? (s.style.backgroundPosition = e.XShift + " " + i, e.onmouseover = function() {
s.style.backgroundPosition = this.XShift + " " + r;
}, e.onmouseout = function() {
s.style.backgroundPosition = this.XShift + " " + i;
}, f.isIE && (e.onmousedown = function() {
u.activeElement && u.activeElement !== t.input || (t.ieCachedRange = document.selection.createRange(),
t.ieCachedScrollTop = t.input.renderer.getScrollTop());
}), e.isHelp || (e.onclick = function() {
return this.onmouseout && this.onmouseout(), d(this), !1;
}), e.className = e.className.replace(/ disabled/g, "")) : (s.style.backgroundPosition = e.XShift + " " + o,
e.onmouseover = e.onmouseout = e.onclick = function() {}, e.className += " disabled");
}
function p(e) {
return "string" == typeof e && (e = r[e]), function() {
e.apply(r, arguments);
};
}
function g() {
var n = t.buttonBar, i = document.createElement("ul");
i.id = "wmd-button-row" + e, i.className = "wmd-button-row", i = n.appendChild(i);
var o = 0, r = function(t, n, r, s) {
var a = document.createElement("li");
a.className = "wmd-button", a.style.left = o + "px", o += 25;
var l = document.createElement("span");
return a.id = t + e, a.appendChild(l), a.title = n, a.XShift = r, s && (a.textOp = s),
h(a, !0), i.appendChild(a), a;
}, l = function(t) {
var n = document.createElement("li");
n.className = "wmd-spacer wmd-spacer" + t, n.id = "wmd-spacer" + t + e, i.appendChild(n),
o += 25;
};
if (y.bold = r("wmd-bold-button", v("bold"), "0px", p("doBold")), y.italic = r("wmd-italic-button", v("italic"), "-20px", p("doItalic")),
l(1), y.link = r("wmd-link-button", v("link"), "-40px", p(function(e, t) {
return this.doLinkOrImage(e, t, !1);
})), y.quote = r("wmd-quote-button", v("quote"), "-60px", p("doBlockquote")), y.code = r("wmd-code-button", v("code"), "-80px", p("doCode")),
y.image = r("wmd-image-button", v("image"), "-100px", p(function(e, t) {
return this.doLinkOrImage(e, t, !0);
})), l(2), y.olist = r("wmd-olist-button", v("olist"), "-120px", p(function(e, t) {
this.doList(e, t, !0);
})), y.ulist = r("wmd-ulist-button", v("ulist"), "-140px", p(function(e, t) {
this.doList(e, t, !1);
})), y.heading = r("wmd-heading-button", v("heading"), "-160px", p("doHeading")),
y.hr = r("wmd-hr-button", v("hr"), "-180px", p("doHorizontalRule")), l(3), y.undo = r("wmd-undo-button", v("undo"), "-200px", null),
y.undo.execute = function() {
b.session.getUndoManager().undo();
}, y.redo = r("wmd-redo-button", v("redo"), "-220px", null), y.redo.execute = function() {
b.session.getUndoManager().redo();
}, s) {
var c = document.createElement("li"), u = document.createElement("span");
c.appendChild(u), c.className = "wmd-button wmd-help-button", c.id = "wmd-help-button" + e,
c.XShift = "-240px", c.isHelp = !0, c.style.right = "0px", c.title = a("help"),
c.onclick = s.handler, h(c, !0), i.appendChild(c), y.help = c;
}
w.setUndoRedoButtonStates(), b.session.on("change", function() {
w.setUndoRedoButtonStates();
});
}
var v = function(e) {
return a(e) + " " + l(e);
}, b = t.input, y = {};
this.setUndoRedoButtonStates = function() {
setTimeout(function() {
h(y.undo, b.session.getUndoManager().hasUndo()), h(y.redo, b.session.getUndoManager().hasRedo());
}, 50);
};
var w = this;
g();
var C = "keydown";
f.isOpera && (C = "keypress"), c([ "bold", "italic", "link", "quote", "code", "image", "olist", "ulist", "heading", "hr" ]),
this.buttons = y, this.setButtonState = h;
}
function r(e, t) {
this.hooks = e, this.getString = t;
}
function s(e) {
return e.replace(/^\s*(.*?)(?:\s+"(.+)")?\s*$/, function(e, t, n) {
return t = t.replace(/\?.*$/, function(e) {
return e.replace(/\+/g, " ");
}), t = decodeURIComponent(t), t = encodeURI(t).replace(/'/g, "%27").replace(/\(/g, "%28").replace(/\)/g, "%29"),
t = t.replace(/\?.*$/, function(e) {
return e.replace(/\+/g, "%2b");
}), n && (n = n.trim ? n.trim() : n.replace(/^\s*/, "").replace(/\s*$/, ""), n = n.replace(/"/g, "quot;").replace(/\(/g, "&#40;").replace(/\)/g, "&#41;").replace(/</g, "&lt;").replace(/>/g, "&gt;")),
n ? t + ' "' + n + '"' : t;
});
}
var a = {}, l = {}, c = {}, u = window.document, d = window.RegExp, h = window.navigator, p = {
lineLength: 72
}, f = {
isIE: /msie/.test(h.userAgent.toLowerCase()),
isIE_5or6: /msie 6/.test(h.userAgent.toLowerCase()) || /msie 5/.test(h.userAgent.toLowerCase()),
isOpera: /opera/.test(h.userAgent.toLowerCase())
}, g = {
bold: "Strong <strong>",
boldexample: "strong text",
italic: "Emphasis <em>",
italicexample: "emphasized text",
link: "Hyperlink <a>",
linkdescription: "enter link description here",
linkdialog: '<p><b>Insert Hyperlink</b></p><p>http://example.com/ "optional title"</p>',
quote: "Blockquote <blockquote>",
quoteexample: "Blockquote",
code: "Code Sample <pre><code>",
codeexample: "enter code here",
image: "Image <img>",
imagedescription: "enter image description here",
imagedialog: "<p><b>Insert Image</b></p><p>http://example.com/images/diagram.jpg \"optional title\"<br><br>Need <a href='http://www.google.com/search?q=free+image+hosting' target='_blank'>free image hosting?</a></p>",
olist: "Numbered List <ol>",
ulist: "Bulleted List <ul>",
litem: "List item",
heading: "Heading <h1>/<h2>",
headingexample: "Heading",
hr: "Horizontal Rule <hr>",
undo: "Undo -",
redo: "Redo -",
help: "Markdown Editing Help"
}, m = {
bold: "B",
italic: "I",
link: "L",
quote: "Q",
code: "K",
image: "G",
olist: "O",
ulist: "U",
heading: "H",
hr: "R",
undo: "Z",
redo: "Y"
}, v = "http://", b = "http://";
Markdown.Editor = function(e, n, 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 a = function(e) {
return s.strings[e] || g[e];
}, l = function(e) {
return (/win/.test(h.platform.toLowerCase()) ? "Ctrl+" : "Command+") + m[e];
};
n = n || "";
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, d, p = this;
this.run = function(h, f) {
if (!u) {
u = new t(n, h);
var g, m = new r(c, a), v = new i(e, u, function() {
c.onPreviewRefresh();
}, f);
g = new o(n, u, d, v, m, s.helpButton, a, l), g.setUndoRedoButtonStates();
var b = p.refreshPreview = function() {
v.refresh(!0);
};
b(), p.uiManager = g;
}
};
}, e.prototype.findTags = function(e, t) {
var n, i = this;
e && (n = a.extendRegExp(e, "", "$"), this.before = this.before.replace(n, function(e) {
return i.startTag = i.startTag + e, "";
}), n = a.extendRegExp(e, "^", ""), this.selection = this.selection.replace(n, function(e) {
return i.startTag = i.startTag + e, "";
})), t && (n = a.extendRegExp(t, "", "$"), this.selection = this.selection.replace(n, function(e) {
return i.endTag = e + i.endTag, "";
}), n = a.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, o;
if (navigator.userAgent.match(/Chrome/) && "X".match(/()./), this.selection = this.selection.replace(/(^\n*)/, ""),
this.startTag = this.startTag + d.$1, this.selection = this.selection.replace(/(\n*$)/, ""),
this.endTag = this.endTag + d.$1, this.startTag = this.startTag.replace(/(^\n*)/, ""),
this.before = this.before + d.$1, this.endTag = this.endTag.replace(/(\n*$)/, ""),
this.after = this.after + d.$1, this.before) {
for (i = o = ""; e--; ) i += "\\n?", o += "\n";
n && (i = "\\n*"), this.before = this.before.replace(new d(i + "$", ""), o);
}
if (this.after) {
for (i = o = ""; t--; ) i += "\\n?", o += "\n";
n && (i = "\\n*"), this.after = this.after.replace(new d(i, ""), o);
}
}, a.isVisible = function(e) {
return window.getComputedStyle ? "none" !== window.getComputedStyle(e, null).getPropertyValue("display") : e.currentStyle ? "none" !== e.currentStyle.display : void 0;
}, a.addEvent = function(e, t, n) {
e.attachEvent ? e.attachEvent("on" + t, n) : e.addEventListener(t, n, !1);
}, a.removeEvent = function(e, t, n) {
e.detachEvent ? e.detachEvent("on" + t, n) : e.removeEventListener(t, n, !1);
}, a.fixEolChars = function(e) {
return e = e.replace(/\r\n/g, "\n"), e = e.replace(/\r/g, "\n");
}, a.extendRegExp = function(e, t, n) {
(null === t || void 0 === t) && (t = ""), (null === n || void 0 === n) && (n = "");
var i, o = e.toString();
return o = o.replace(/\/([gim]*)$/, function(e, t) {
return i = t, "";
}), o = o.replace(/(^\/|\/$)/g, ""), o = t + o + n, new d(o, i);
}, l.getTop = function(e, t) {
var n = e.offsetTop;
if (!t) for (;e = e.offsetParent; ) n += e.offsetTop;
return n;
}, l.getHeight = function(e) {
return e.offsetHeight || e.scrollHeight;
}, l.getWidth = function(e) {
return e.offsetWidth || e.scrollWidth;
}, l.getPageSize = function() {
var e, t, n, i;
self.innerHeight && self.scrollMaxY ? (e = u.body.scrollWidth, t = self.innerHeight + self.scrollMaxY) : u.body.scrollHeight > u.body.offsetHeight ? (e = u.body.scrollWidth,
t = u.body.scrollHeight) : (e = u.body.offsetWidth, t = u.body.offsetHeight), self.innerHeight ? (n = self.innerWidth,
i = self.innerHeight) : u.documentElement && u.documentElement.clientHeight ? (n = u.documentElement.clientWidth,
i = u.documentElement.clientHeight) : u.body && (n = u.body.clientWidth, i = u.body.clientHeight);
var o = Math.max(e, n), r = Math.max(t, i);
return [ o, r, n, i ];
}, c.createBackground = function() {
var e = u.createElement("div"), t = e.style;
e.className = "wmd-prompt-background", t.position = "absolute", t.top = "0", t.zIndex = "1000",
f.isIE ? t.filter = "alpha(opacity=50)" : t.opacity = "0.5";
var n = l.getPageSize();
return t.height = n[1] + "px", f.isIE ? (t.left = u.documentElement.scrollLeft,
t.width = u.documentElement.clientWidth) : (t.left = "0", t.width = "100%"), u.body.appendChild(e),
e;
}, c.prompt = function(e, t, n) {
var i, o;
void 0 === t && (t = "");
var r = function(e) {
var t = e.charCode || e.keyCode;
27 === t && s(!0);
}, s = function(e) {
a.removeEvent(u.body, "keydown", r);
var t = o.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;
}, c = function() {
i = u.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 = u.createElement("div");
n.innerHTML = e, n.style.padding = "5px", i.appendChild(n);
var c = u.createElement("form"), d = c.style;
c.onsubmit = function() {
return s(!1);
}, d.padding = "0", d.margin = "0", d.cssFloat = "left", d.width = "100%", d.textAlign = "center",
d.position = "relative", i.appendChild(c), o = u.createElement("input"), o.type = "text",
o.value = t, d = o.style, d.display = "block", d.width = "80%", d.marginLeft = d.marginRight = "auto",
c.appendChild(o);
var h = u.createElement("input");
h.type = "button", h.onclick = function() {
return s(!1);
}, h.value = "OK", d = h.style, d.margin = "10px", d.display = "inline", d.width = "7em";
var p = u.createElement("input");
p.type = "button", p.onclick = function() {
return s(!0);
}, p.value = "Cancel", d = p.style, d.margin = "10px", d.display = "inline", d.width = "7em",
c.appendChild(h), c.appendChild(p), a.addEvent(u.body, "keydown", r), i.style.top = "50%",
i.style.left = "50%", i.style.display = "block", f.isIE_5or6 && (i.style.position = "absolute",
i.style.top = u.documentElement.scrollTop + 200 + "px", i.style.left = "50%"), u.body.appendChild(i),
i.style.marginTop = -(l.getHeight(i) / 2) + "px", i.style.marginLeft = -(l.getWidth(i) / 2) + "px";
};
setTimeout(function() {
c();
var e = t.length;
if (void 0 !== o.selectionStart) o.selectionStart = 0, o.selectionEnd = e; else if (o.createTextRange) {
var n = o.createTextRange();
n.collapse(!1), n.moveStart("character", -e), n.moveEnd("character", e), n.select();
}
o.focus();
}, 0);
};
var y = r.prototype;
y.prefixes = "(?:\\s{4,}|\\s*>|\\s*-\\s+|\\s*\\d+\\.|=|\\+|-|_|\\*|#|\\s*\\[[^\n]]+\\]:)",
y.unwrap = function(e) {
var t = new d("([^\\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 d("(.{1," + t + "})( +|$\\n?)", "gm"), i = this;
e.selection = e.selection.replace(n, function(e, t) {
return new d("^" + 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 o = /(\**$)/.exec(e.before)[0], r = /(^\**)/.exec(e.after)[0], s = Math.min(o.length, r.length);
if (s >= n && (2 != s || 1 != n)) e.before = e.before.replace(d("[*]{" + n + "}$", ""), ""),
e.after = e.after.replace(d("^[*]{" + n + "}", ""), ""); else if (!e.selection && r) {
e.after = e.after.replace(/^([*_]*)/, ""), e.before = e.before.replace(/(\s?)$/, "");
var a = d.$1;
e.before = e.before + r + a;
} else {
e.selection || r || (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, o, r) {
return t[n] = e.replace(/\s*$/, ""), o ? (t[n] = e.replace(/["(](.+?)[")]$/, ""),
o + r) : "";
});
}, 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 o = "", r = /(\[)((?:\[[^\]]*\]|[^\[\]])*)(\][ ]?(?:\n[ ]*)?\[)(\d+)(\])/g, s = function(e) {
n++, e = e.replace(/^[ ]{0,3}\[(\d+)\]:/, " [" + n + "]:"), o += "\n" + e;
}, a = function(e, t, o, l, c, u) {
return o = o.replace(r, a), i[c] ? (s(i[c]), t + o + l + n + u) : e;
};
e.before = e.before.replace(r, a), t ? s(t) : e.selection = e.selection.replace(r, a);
var l = n;
return e.after = e.after.replace(r, a), e.after && (e.after = e.after.replace(/\n*$/, "")),
e.after || (e.selection = e.selection.replace(/\n*$/, "")), e.after += "\n\n" + o,
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 this.addLinkDef(e, null), void 0;
var o = this, r = function(r) {
if (i.parentNode.removeChild(i), null !== r) {
e.selection = (" " + e.selection).replace(/([^\\](?:\\\\)*)(?=[[\]])/g, "$1\\").substr(1);
var a = " [999]: " + s(r), l = o.addLinkDef(e, a);
e.startTag = n ? "![" : "[", e.endTag = "][" + l + "]", e.selection || (e.selection = n ? o.getString("imagedescription") : o.getString("linkdescription"));
}
t();
};
return i = c.createBackground(), n ? this.hooks.insertImageDialog(r) || c.prompt(this.getString("imagedialog"), v, r) : this.hooks.insertLinkDialog(r) || c.prompt(this.getString("linkdialog"), b, r),
!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, o) {
return e.before += n, e.after = o + 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 o = e.before.replace(/\n$/, "").split("\n"), r = !1, s = 0; s < o.length; s++) {
var a = !1;
t = o[s], r = r && t.length > 0, /^>/.test(t) ? (a = !0, !r && t.length > 1 && (r = !0)) : a = /^[ \t]*$/.test(t) ? !0 : r,
a ? 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, p.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, o = 1;
/(\n|^)(\t|[ ]{4,}).*\n$/.test(e.before) && (i = 0), /^\n(\t|[ ]{4,})/.test(e.after) && (o = 0),
e.skipLines(i, o), 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*$/, o = /^\n*(([ ]{0,3}([*+-]|\d+[.])[ \t]+.*)(\n.+|\n{2,}([*+-].*|\d+[.])[ \t]+.*|\n{2,}[ \t]+\S.*)*)\n*/, r = "-", s = 1, a = function() {
var e;
return n ? (e = " " + s + ". ", s++) : e = " " + r + " ", e;
}, l = function(e) {
return void 0 === n && (n = /^\s*\d/.test(e)), e = e.replace(/^[ ]{0,3}([*+-]|\d+[.])\s/gm, function() {
return a();
});
};
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(o, l)), n == c) return;
}
var u = 1;
e.before = e.before.replace(i, function(e) {
return /^\s*([*+-])/.test(e) && (r = d.$1), u = /[^\n]\n\n[^\n]/.test(e) ? 1 : 0,
l(e);
}), e.selection || (e.selection = this.getString("litem"));
var h = a(), f = 1;
e.after = e.after.replace(o, function(e) {
return f = /[^\n]\n\n[^\n]/.test(e) ? 1 : 0, l(e);
}), e.trimWhitespace(!0), e.skipLines(u, f, !0), e.startTag = h;
var g = h.replace(/./g, " ");
this.wrap(e, p.lineLength - g.length), e.selection = e.selection.replace(/\n/g, "\n" + g);
}, 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"),
e.endTag = " ##", void 0;
var t = 0;
e.findTags(/#+[ ]*/, /[ ]*#+/), /#+/.test(e.startTag) && (t = d.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 ? "-" : "=", o = e.selection.length;
for (o > p.lineLength && (o = p.lineLength), e.endTag = "\n"; o--; ) e.endTag += i;
}
}, y.doHorizontalRule = function(e) {
e.startTag = "----------\n", e.selection = "", e.skipLines(2, 1, !0);
};
}(), define("pagedown-ace", function() {}), window.PR_SHOULD_USE_CONTINUATION = !0;
var prettyPrintOne, prettyPrint;
(function() {
function e(e) {
function t(e) {
var t = e.charCodeAt(0);
if (92 !== t) return t;
var n = e.charAt(1);
return t = d[n], t ? t : n >= "0" && "7" >= n ? parseInt(e.substring(1), 8) : "u" === n || "x" === n ? parseInt(e.substring(2), 16) : e.charCodeAt(1);
}
function n(e) {
if (32 > e) return (16 > e ? "\\x0" : "\\x") + e.toString(16);
var t = String.fromCharCode(e);
return "\\" === t || "-" === t || "]" === t || "^" === t ? "\\" + t : t;
}
function i(e) {
var i = e.substring(1, e.length - 1).match(new RegExp("\\\\u[0-9A-Fa-f]{4}|\\\\x[0-9A-Fa-f]{2}|\\\\[0-3][0-7]{0,2}|\\\\[0-7]{1,2}|\\\\[\\s\\S]|-|[^-\\\\]", "g")), o = [], r = "^" === i[0], s = [ "[" ];
r && s.push("^");
for (var a = r ? 1 : 0, l = i.length; l > a; ++a) {
var c = i[a];
if (/\\[bdsw]/i.test(c)) s.push(c); else {
var u, d = t(c);
l > a + 2 && "-" === i[a + 1] ? (u = t(i[a + 2]), a += 2) : u = d, o.push([ d, u ]),
65 > u || d > 122 || (65 > u || d > 90 || o.push([ 32 | Math.max(65, d), 32 | Math.min(u, 90) ]),
97 > u || d > 122 || o.push([ -33 & Math.max(97, d), -33 & Math.min(u, 122) ]));
}
}
o.sort(function(e, t) {
return e[0] - t[0] || t[1] - e[1];
});
for (var h = [], p = [], a = 0; a < o.length; ++a) {
var f = o[a];
f[0] <= p[1] + 1 ? p[1] = Math.max(p[1], f[1]) : h.push(p = f);
}
for (var a = 0; a < h.length; ++a) {
var f = h[a];
s.push(n(f[0])), f[1] > f[0] && (f[1] + 1 > f[0] && s.push("-"), s.push(n(f[1])));
}
return s.push("]"), s.join("");
}
function o(e) {
for (var t = e.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)", "g")), o = t.length, a = [], l = 0, c = 0; o > l; ++l) {
var u = t[l];
if ("(" === u) ++c; else if ("\\" === u.charAt(0)) {
var d = +u.substring(1);
d && (c >= d ? a[d] = -1 : t[l] = n(d));
}
}
for (var l = 1; l < a.length; ++l) -1 === a[l] && (a[l] = ++r);
for (var l = 0, c = 0; o > l; ++l) {
var u = t[l];
if ("(" === u) ++c, a[c] || (t[l] = "(?:"); else if ("\\" === u.charAt(0)) {
var d = +u.substring(1);
d && c >= d && (t[l] = "\\" + a[d]);
}
}
for (var l = 0; o > l; ++l) "^" === t[l] && "^" !== t[l + 1] && (t[l] = "");
if (e.ignoreCase && s) for (var l = 0; o > l; ++l) {
var u = t[l], h = u.charAt(0);
u.length >= 2 && "[" === h ? t[l] = i(u) : "\\" !== h && (t[l] = u.replace(/[a-zA-Z]/g, function(e) {
var t = e.charCodeAt(0);
return "[" + String.fromCharCode(-33 & t, 32 | t) + "]";
}));
}
return t.join("");
}
for (var r = 0, s = !1, a = !1, l = 0, c = e.length; c > l; ++l) {
var u = e[l];
if (u.ignoreCase) a = !0; else if (/[a-z]/i.test(u.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi, ""))) {
s = !0, a = !1;
break;
}
}
for (var d = {
b: 8,
t: 9,
n: 10,
v: 11,
f: 12,
r: 13
}, h = [], l = 0, c = e.length; c > l; ++l) {
var u = e[l];
if (u.global || u.multiline) throw new Error("" + u);
h.push("(?:" + o(u) + ")");
}
return new RegExp(h.join("|"), a ? "gi" : "g");
}
function t(e, t) {
function n(e) {
switch (e.nodeType) {
case 1:
if (i.test(e.className)) return;
for (var l = e.firstChild; l; l = l.nextSibling) n(l);
var c = e.nodeName.toLowerCase();
("br" === c || "li" === c) && (o[a] = "\n", s[a << 1] = r++, s[1 | a++ << 1] = e);
break;
case 3:
case 4:
var u = e.nodeValue;
u.length && (u = t ? u.replace(/\r\n?/g, "\n") : u.replace(/[ \t\r\n]+/g, " "),
o[a] = u, s[a << 1] = r, r += u.length, s[1 | a++ << 1] = e);
}
}
var i = /(?:^|\s)nocode(?:\s|$)/, o = [], r = 0, s = [], a = 0;
return n(e), {
sourceCode: o.join("").replace(/\n$/, ""),
spans: s
};
}
function n(e, t, n, i) {
if (t) {
var o = {
sourceCode: t,
basePos: e
};
n(o), i.push.apply(i, o.decorations);
}
}
function i(e) {
for (var t = void 0, n = e.firstChild; n; n = n.nextSibling) {
var i = n.nodeType;
t = 1 === i ? t ? e : n : 3 === i ? H.test(n.nodeValue) ? e : t : t;
}
return t === e ? void 0 : t;
}
function o(t, i) {
var o, r = {};
(function() {
for (var n = t.concat(i), s = [], a = {}, l = 0, c = n.length; c > l; ++l) {
var u = n[l], d = u[3];
if (d) for (var h = d.length; --h >= 0; ) r[d.charAt(h)] = u;
var p = u[1], f = "" + p;
a.hasOwnProperty(f) || (s.push(p), a[f] = null);
}
s.push(/[\0-\uffff]/), o = e(s);
})();
var s = i.length, a = function(e) {
for (var t = e.sourceCode, l = e.basePos, u = [ l, M ], d = 0, h = t.match(o) || [], p = {}, f = 0, g = h.length; g > f; ++f) {
var m, v = h[f], b = p[v], y = void 0;
if ("string" == typeof b) m = !1; else {
var w = r[v.charAt(0)];
if (w) y = v.match(w[1]), b = w[0]; else {
for (var C = 0; s > C; ++C) if (w = i[C], y = v.match(w[1])) {
b = w[0];
break;
}
y || (b = M);
}
m = b.length >= 5 && "lang-" === b.substring(0, 5), !m || y && "string" == typeof y[1] || (m = !1,
b = P), m || (p[v] = b);
}
var x = d;
if (d += v.length, m) {
var E = y[1], S = v.indexOf(E), A = S + E.length;
y[2] && (A = v.length - y[2].length, S = A - E.length);
var k = b.substring(5);
n(l + x, v.substring(0, S), a, u), n(l + x + S, E, c(k, E), u), n(l + x + A, v.substring(A), a, u);
} else u.push(l + x, b);
}
e.decorations = u;
};
return a;
}
function r(e) {
var t = [], n = [];
e.tripleQuotedStrings ? t.push([ _, /^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/, null, "'\"" ]) : e.multiLineStrings ? t.push([ _, /^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/, null, "'\"`" ]) : t.push([ _, /^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/, null, "\"'" ]),
e.verbatimStrings && n.push([ _, /^@\"(?:[^\"]|\"\")*(?:\"|$)/, null ]);
var i = e.hashComments;
if (i && (e.cStyleComments ? (i > 1 ? t.push([ T, /^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/, null, "#" ]) : t.push([ T, /^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/, null, "#" ]),
n.push([ _, /^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/, null ])) : t.push([ T, /^#[^\r\n]*/, null, "#" ])),
e.cStyleComments && (n.push([ T, /^\/\/[^\r\n]*/, null ]), n.push([ T, /^\/\*[\s\S]*?(?:\*\/|$)/, null ])),
e.regexLiterals) {
var r = "/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/";
n.push([ "lang-regex", new RegExp("^" + j + "(" + r + ")") ]);
}
var s = e.types;
s && n.push([ D, s ]);
var a = ("" + e.keywords).replace(/^ | $/g, "");
a.length && n.push([ $, new RegExp("^(?:" + a.replace(/[\s,]+/g, "|") + ")\\b"), null ]),
t.push([ M, /^\s+/, null, " \r\n  " ]);
var l = /^.[^\s\w\.$@\'\"\`\/\\]*/;
return n.push([ L, /^@[a-z_$][a-z_$@0-9]*/i, null ], [ D, /^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/, null ], [ M, /^[a-z_$][a-z_$@0-9]*/i, null ], [ L, new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*", "i"), null, "0123456789" ], [ M, /^\\[\s\S]?/, null ], [ B, l, null ]),
o(t, n);
}
function s(e, t, n) {
function i(e) {
switch (e.nodeType) {
case 1:
if (r.test(e.className)) break;
if ("br" === e.nodeName) o(e), e.parentNode && e.parentNode.removeChild(e); else for (var t = e.firstChild; t; t = t.nextSibling) i(t);
break;
case 3:
case 4:
if (n) {
var l = e.nodeValue, c = l.match(s);
if (c) {
var u = l.substring(0, c.index);
e.nodeValue = u;
var d = l.substring(c.index + c[0].length);
if (d) {
var h = e.parentNode;
h.insertBefore(a.createTextNode(d), e.nextSibling);
}
o(e), u || e.parentNode.removeChild(e);
}
}
}
}
function o(e) {
function t(e, n) {
var i = n ? e.cloneNode(!1) : e, o = e.parentNode;
if (o) {
var r = t(o, 1), s = e.nextSibling;
r.appendChild(i);
for (var a = s; a; a = s) s = a.nextSibling, r.appendChild(a);
}
return i;
}
for (;!e.nextSibling; ) if (e = e.parentNode, !e) return;
for (var n, i = t(e.nextSibling, 0); (n = i.parentNode) && 1 === n.nodeType; ) i = n;
c.push(i);
}
for (var r = /(?:^|\s)nocode(?:\s|$)/, s = /\r\n?|\n/, a = e.ownerDocument, l = a.createElement("li"); e.firstChild; ) l.appendChild(e.firstChild);
for (var c = [ l ], u = 0; u < c.length; ++u) i(c[u]);
t === (0 | t) && c[0].setAttribute("value", t);
var d = a.createElement("ol");
d.className = "linenums";
for (var h = Math.max(0, 0 | t - 1) || 0, u = 0, p = c.length; p > u; ++u) l = c[u],
l.className = "L" + (u + h) % 10, l.firstChild || l.appendChild(a.createTextNode(" ")),
d.appendChild(l);
e.appendChild(d);
}
function a(e) {
var t = /\bMSIE\s(\d+)/.exec(navigator.userAgent);
t = t && +t[1] <= 8;
var n = /\n/g, i = e.sourceCode, o = i.length, r = 0, s = e.spans, a = s.length, l = 0, c = e.decorations, u = c.length, d = 0;
c[u] = o;
var h, p;
for (p = h = 0; u > p; ) c[p] !== c[p + 2] ? (c[h++] = c[p++], c[h++] = c[p++]) : p += 2;
for (u = h, p = h = 0; u > p; ) {
for (var f = c[p], g = c[p + 1], m = p + 2; u >= m + 2 && c[m + 1] === g; ) m += 2;
c[h++] = f, c[h++] = g, p = m;
}
u = c.length = h;
var v, b = e.sourceNode;
b && (v = b.style.display, b.style.display = "none");
try {
for (;a > l; ) {
s[l];
var y, w = s[l + 2] || o, C = c[d + 2] || o, m = Math.min(w, C), x = s[l + 1];
if (1 !== x.nodeType && (y = i.substring(r, m))) {
t && (y = y.replace(n, "\r")), x.nodeValue = y;
var E = x.ownerDocument, S = E.createElement("span");
S.className = c[d + 1];
var A = x.parentNode;
A.replaceChild(S, x), S.appendChild(x), w > r && (s[l + 1] = x = E.createTextNode(i.substring(m, w)),
A.insertBefore(x, S.nextSibling));
}
r = m, r >= w && (l += 2), r >= C && (d += 2);
}
} finally {
b && (b.style.display = v);
}
}
function l(e, t) {
for (var n = t.length; --n >= 0; ) {
var i = t[n];
W.hasOwnProperty(i) ? p.console && console.warn("cannot override language handler %s", i) : W[i] = e;
}
}
function c(e, t) {
return e && W.hasOwnProperty(e) || (e = /^\s*</.test(t) ? "default-markup" : "default-code"),
W[e];
}
function u(e) {
var n = e.langExtension;
try {
var i = t(e.sourceNode, e.pre), o = i.sourceCode;
e.sourceCode = o, e.spans = i.spans, e.basePos = 0, c(n, o)(e), a(e);
} catch (r) {
p.console && console.log(r && r.stack ? r.stack : r);
}
}
function d(e, t, n) {
var i = document.createElement("pre");
i.innerHTML = e, n && s(i, n, !0);
var o = {
langExtension: t,
numberLines: n,
sourceNode: i,
pre: 1
};
return u(o), i.innerHTML;
}
function h(e) {
function t(e) {
return document.getElementsByTagName(e);
}
function n() {
for (var t = p.PR_SHOULD_USE_CONTINUATION ? d.now() + 250 : 1/0; f < r.length && d.now() < t; f++) {
var o = r[f], a = o.className;
if (m.test(a) && !v.test(a)) {
for (var l = !1, c = o.parentNode; c; c = c.parentNode) {
var C = c.tagName;
if (w.test(C) && c.className && m.test(c.className)) {
l = !0;
break;
}
}
if (!l) {
o.className += " prettyprinted";
var x, E = a.match(g);
!E && (x = i(o)) && y.test(x.tagName) && (E = x.className.match(g)), E && (E = E[1]);
var S;
if (b.test(o.tagName)) S = 1; else {
var A = o.currentStyle, k = A ? A.whiteSpace : document.defaultView && document.defaultView.getComputedStyle ? document.defaultView.getComputedStyle(o, null).getPropertyValue("white-space") : 0;
S = k && "pre" === k.substring(0, 3);
}
var F = o.className.match(/\blinenums\b(?::(\d+))?/);
F = F ? F[1] && F[1].length ? +F[1] : !0 : !1, F && s(o, F, S), h = {
langExtension: E,
sourceNode: o,
numberLines: F,
pre: S
}, u(h);
}
}
}
f < r.length ? setTimeout(n, 250) : e && e();
}
for (var o = [ t("pre"), t("code"), t("xmp") ], r = [], a = 0; a < o.length; ++a) for (var l = 0, c = o[a].length; c > l; ++l) r.push(o[a][l]);
o = null;
var d = Date;
d.now || (d = {
now: function() {
return +new Date();
}
});
var h, f = 0, g = /\blang(?:uage)?-([\w.]+)(?!\S)/, m = /\bprettyprint\b/, v = /\bprettyprinted\b/, b = /pre|xmp/i, y = /^code$/i, w = /^(?:pre|code|xmp)$/i;
n();
}
var p = window, f = [ "break,continue,do,else,for,if,return,while" ], g = [ f, "auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile" ], m = [ g, "catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof" ], v = [ m, "alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where" ], b = [ m, "abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient" ], y = [ b, "as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,let,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var,virtual,where" ], w = "all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes", C = [ m, "debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN" ], x = "caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END", E = [ f, "and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None" ], S = [ f, "alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END" ], A = [ f, "case,done,elif,esac,eval,fi,function,in,local,set,then,until" ], k = [ v, y, C, x + E, S, A ], F = /^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)\b/, _ = "str", $ = "kwd", T = "com", D = "typ", L = "lit", B = "pun", M = "pln", R = "tag", I = "dec", P = "src", N = "atn", O = "atv", z = "nocode", j = "(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*", H = /\S/, q = r({
keywords: k,
hashComments: !0,
cStyleComments: !0,
multiLineStrings: !0,
regexLiterals: !0
}), W = {};
l(q, [ "default-code" ]), l(o([], [ [ M, /^[^<?]+/ ], [ I, /^<!\w[^>]*(?:>|$)/ ], [ T, /^<\!--[\s\S]*?(?:-\->|$)/ ], [ "lang-", /^<\?([\s\S]+?)(?:\?>|$)/ ], [ "lang-", /^<%([\s\S]+?)(?:%>|$)/ ], [ B, /^(?:<[%?]|[%?]>)/ ], [ "lang-", /^<xmp\b[^>]*>([\s\S]+?)<\/xmp\b[^>]*>/i ], [ "lang-js", /^<script\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i ], [ "lang-css", /^<style\b[^>]*>([\s\S]*?)(<\/style\b[^>]*>)/i ], [ "lang-in.tag", /^(<\/?[a-z][^<>]*>)/i ] ]), [ "default-markup", "htm", "html", "mxml", "xhtml", "xml", "xsl" ]),
l(o([ [ M, /^[\s]+/, null, " \r\n" ], [ O, /^(?:\"[^\"]*\"?|\'[^\']*\'?)/, null, "\"'" ] ], [ [ R, /^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i ], [ N, /^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i ], [ "lang-uq.val", /^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/ ], [ B, /^[=<>\/]+/ ], [ "lang-js", /^on\w+\s*=\s*\"([^\"]+)\"/i ], [ "lang-js", /^on\w+\s*=\s*\'([^\']+)\'/i ], [ "lang-js", /^on\w+\s*=\s*([^\"\'>\s]+)/i ], [ "lang-css", /^style\s*=\s*\"([^\"]+)\"/i ], [ "lang-css", /^style\s*=\s*\'([^\']+)\'/i ], [ "lang-css", /^style\s*=\s*([^\"\'>\s]+)/i ] ]), [ "in.tag" ]),
l(o([], [ [ O, /^[\s\S]+/ ] ]), [ "uq.val" ]), l(r({
keywords: v,
hashComments: !0,
cStyleComments: !0,
types: F
}), [ "c", "cc", "cpp", "cxx", "cyc", "m" ]), l(r({
keywords: "null,true,false"
}), [ "json" ]), l(r({
keywords: y,
hashComments: !0,
cStyleComments: !0,
verbatimStrings: !0,
types: F
}), [ "cs" ]), l(r({
keywords: b,
cStyleComments: !0
}), [ "java" ]), l(r({
keywords: A,
hashComments: !0,
multiLineStrings: !0
}), [ "bsh", "csh", "sh" ]), l(r({
keywords: E,
hashComments: !0,
multiLineStrings: !0,
tripleQuotedStrings: !0
}), [ "cv", "py" ]), l(r({
keywords: x,
hashComments: !0,
multiLineStrings: !0,
regexLiterals: !0
}), [ "perl", "pl", "pm" ]), l(r({
keywords: S,
hashComments: !0,
multiLineStrings: !0,
regexLiterals: !0
}), [ "rb" ]), l(r({
keywords: C,
cStyleComments: !0,
regexLiterals: !0
}), [ "js" ]), l(r({
keywords: w,
hashComments: 3,
cStyleComments: !0,
multilineStrings: !0,
tripleQuotedStrings: !0,
regexLiterals: !0
}), [ "coffee" ]), l(o([], [ [ _, /^[\s\S]+/ ] ]), [ "regex" ]);
var U = p.PR = {
createSimpleLexer: o,
registerLangHandler: l,
sourceDecorator: r,
PR_ATTRIB_NAME: N,
PR_ATTRIB_VALUE: O,
PR_COMMENT: T,
PR_DECLARATION: I,
PR_KEYWORD: $,
PR_LITERAL: L,
PR_NOCODE: z,
PR_PLAIN: M,
PR_PUNCTUATION: B,
PR_SOURCE: P,
PR_STRING: _,
PR_TAG: R,
PR_TYPE: D,
prettyPrintOne: p.prettyPrintOne = d,
prettyPrint: p.prettyPrint = h
};
"function" == typeof define && define.amd && define("google-code-prettify", [], function() {
return U;
});
})();
var hljs = new function() {
function e(e) {
return e.replace(/&/gm, "&amp;").replace(/</gm, "&lt;").replace(/>/gm, "&gt;");
}
function t(e) {
for (var t = e.firstChild; t; t = t.nextSibling) {
if ("CODE" == t.nodeName) return t;
if (3 != t.nodeType || !t.nodeValue.match(/\s+/)) break;
}
}
function n(e, t) {
return Array.prototype.map.call(e.childNodes, function(e) {
return 3 == e.nodeType ? t ? e.nodeValue.replace(/\n/g, "") : e.nodeValue : "BR" == e.nodeName ? "\n" : n(e, t);
}).join("");
}
function i(e) {
var t = (e.className + " " + e.parentNode.className).split(/\s+/);
t = t.map(function(e) {
return e.replace(/^language-/, "");
});
for (var n = 0; n < t.length; n++) if (p[t[n]] || "no-highlight" == t[n]) return t[n];
}
function o(e) {
var t = [];
return function n(e, i) {
for (var o = e.firstChild; o; o = o.nextSibling) 3 == o.nodeType ? i += o.nodeValue.length : "BR" == o.nodeName ? i += 1 : 1 == o.nodeType && (t.push({
event: "start",
offset: i,
node: o
}), i = n(o, i), t.push({
event: "stop",
offset: i,
node: o
}));
return i;
}(e, 0), t;
}
function r(t, n, i) {
function o() {
return t.length && n.length ? t[0].offset != n[0].offset ? t[0].offset < n[0].offset ? t : n : "start" == n[0].event ? t : n : t.length ? t : n;
}
function r(t) {
function n(t) {
return " " + t.nodeName + '="' + e(t.value) + '"';
}
return "<" + t.nodeName + Array.prototype.map.call(t.attributes, n).join("") + ">";
}
for (var s = 0, a = "", l = []; t.length || n.length; ) {
var c = o().splice(0, 1)[0];
if (a += e(i.substr(s, c.offset - s)), s = c.offset, "start" == c.event) a += r(c.node),
l.push(c.node); else if ("stop" == c.event) {
var u, d = l.length;
do d--, u = l[d], a += "</" + u.nodeName.toLowerCase() + ">"; while (u != c.node);
for (l.splice(d, 1); d < l.length; ) a += r(l[d]), d++;
}
}
return a + e(i.substr(s));
}
function s(e) {
function t(t, n) {
return RegExp(t, "m" + (e.cI ? "i" : "") + (n ? "g" : ""));
}
function n(e, i) {
function o(e, t) {
t.split(" ").forEach(function(t) {
var n = t.split("|");
s[n[0]] = [ e, n[1] ? Number(n[1]) : 1 ], r.push(n[0]);
});
}
if (!e.compiled) {
e.compiled = !0;
var r = [];
if (e.k) {
var s = {};
if (e.lR = t(e.l || hljs.IR, !0), "string" == typeof e.k) o("keyword", e.k); else for (var a in e.k) e.k.hasOwnProperty(a) && o(a, e.k[a]);
e.k = s;
}
i && (e.bWK && (e.b = "\\b(" + r.join("|") + ")\\s"), e.bR = t(e.b ? e.b : "\\B|\\b"),
e.e || e.eW || (e.e = "\\B|\\b"), e.e && (e.eR = t(e.e)), e.tE = e.e || "", e.eW && i.tE && (e.tE += (e.e ? "|" : "") + i.tE)),
e.i && (e.iR = t(e.i)), void 0 === e.r && (e.r = 1), e.c || (e.c = []);
for (var l = 0; l < e.c.length; l++) "self" == e.c[l] && (e.c[l] = e), n(e.c[l], e);
e.starts && n(e.starts, i);
for (var c = [], l = 0; l < e.c.length; l++) c.push(e.c[l].b);
e.tE && c.push(e.tE), e.i && c.push(e.i), e.t = c.length ? t(c.join("|"), !0) : {
exec: function() {
return null;
}
};
}
}
n(e);
}
function a(t, n) {
function i(e, t) {
for (var n = 0; n < t.c.length; n++) {
var i = t.c[n].bR.exec(e);
if (i && 0 == i.index) return t.c[n];
}
}
function o(e, t) {
return e.e && e.eR.test(t) ? e : e.eW ? o(e.parent, t) : void 0;
}
function r(e, t) {
return t.i && t.iR.test(e);
}
function c(e, t) {
var n = m.cI ? t[0].toLowerCase() : t[0];
return e.k.hasOwnProperty(n) && e.k[n];
}
function u() {
var t = e(b);
if (!v.k) return t;
var n = "", i = 0;
v.lR.lastIndex = 0;
for (var o = v.lR.exec(t); o; ) {
n += t.substr(i, o.index - i);
var r = c(v, o);
r ? (w += r[1], n += '<span class="' + r[0] + '">' + o[0] + "</span>") : n += o[0],
i = v.lR.lastIndex, o = v.lR.exec(t);
}
return n + t.substr(i);
}
function d() {
if (v.sL && !p[v.sL]) return e(b);
var t = v.sL ? a(v.sL, b) : l(b);
return v.r > 0 && (w += t.keyword_count, y += t.r), '<span class="' + t.language + '">' + t.value + "</span>";
}
function h() {
return void 0 !== v.sL ? d() : u();
}
function f(t, n) {
var i = t.cN ? '<span class="' + t.cN + '">' : "";
t.rB ? (C += i, b = "") : t.eB ? (C += e(n) + i, b = "") : (C += i, b = n), v = Object.create(t, {
parent: {
value: v
}
}), y += t.r;
}
function g(t, n) {
if (b += t, void 0 === n) return C += h(), 0;
var s = i(n, v);
if (s) return C += h(), f(s, n), s.rB ? 0 : n.length;
var a = o(v, n);
if (a) {
a.rE || a.eE || (b += n), C += h();
do v.cN && (C += "</span>"), v = v.parent; while (v != a.parent);
return a.eE && (C += e(n)), b = "", a.starts && f(a.starts, ""), a.rE ? 0 : n.length;
}
if (r(n, v)) throw "Illegal";
return b += n, n.length || 1;
}
var m = p[t];
s(m);
var v = m, b = "", y = 0, w = 0, C = "";
try {
for (var x, E, S = 0; ;) {
if (v.t.lastIndex = S, x = v.t.exec(n), !x) break;
E = g(n.substr(S, x.index - S), x[0]), S = x.index + E;
}
return g(n.substr(S)), {
r: y,
keyword_count: w,
value: C,
language: t
};
} catch (A) {
if ("Illegal" == A) return {
r: 0,
keyword_count: 0,
value: e(n)
};
throw A;
}
}
function l(t) {
var n = {
keyword_count: 0,
r: 0,
value: e(t)
}, i = n;
for (var o in p) if (p.hasOwnProperty(o)) {
var r = a(o, t);
r.language = o, r.keyword_count + r.r > i.keyword_count + i.r && (i = r), r.keyword_count + r.r > n.keyword_count + n.r && (i = n,
n = r);
}
return i.language && (n.second_best = i), n;
}
function c(e, t, n) {
return t && (e = e.replace(/^((<[^>]+>|\t)+)/gm, function(e, n) {
return n.replace(/\t/g, t);
})), n && (e = e.replace(/\n/g, "<br>")), e;
}
function u(e, t, s) {
var u = n(e, s), d = i(e);
if ("no-highlight" != d) {
var h = d ? a(d, u) : l(u);
d = h.language;
var p = o(e);
if (p.length) {
var f = document.createElement("pre");
f.innerHTML = h.value, h.value = r(p, o(f), u);
}
h.value = c(h.value, t, s);
var g = e.className;
g.match("(\\s|^)(language-)?" + d + "(\\s|$)") || (g = g ? g + " " + d : d), e.innerHTML = h.value,
e.className = g, e.result = {
language: d,
kw: h.keyword_count,
re: h.r
}, h.second_best && (e.second_best = {
language: h.second_best.language,
kw: h.second_best.keyword_count,
re: h.second_best.r
});
}
}
function d() {
d.called || (d.called = !0, Array.prototype.map.call(document.getElementsByTagName("pre"), t).filter(Boolean).forEach(function(e) {
u(e, hljs.tabReplace);
}));
}
function h() {
window.addEventListener("DOMContentLoaded", d, !1), window.addEventListener("load", d, !1);
}
var p = {};
this.LANGUAGES = p, this.highlight = a, this.highlightAuto = l, this.fixMarkup = c,
this.highlightBlock = u, this.initHighlighting = d, this.initHighlightingOnLoad = h,
this.IR = "[a-zA-Z][a-zA-Z0-9_]*", this.UIR = "[a-zA-Z_][a-zA-Z0-9_]*", this.NR = "\\b\\d+(\\.\\d+)?",
this.CNR = "(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",
this.BNR = "\\b(0b[01]+)", this.RSR = "!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|\\.|-|-=|/|/=|:|;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",
this.BE = {
b: "\\\\[\\s\\S]",
r: 0
}, this.ASM = {
cN: "string",
b: "'",
e: "'",
i: "\\n",
c: [ this.BE ],
r: 0
}, this.QSM = {
cN: "string",
b: '"',
e: '"',
i: "\\n",
c: [ this.BE ],
r: 0
}, this.CLCM = {
cN: "comment",
b: "//",
e: "$"
}, this.CBLCLM = {
cN: "comment",
b: "/\\*",
e: "\\*/"
}, this.HCM = {
cN: "comment",
b: "#",
e: "$"
}, this.NM = {
cN: "number",
b: this.NR,
r: 0
}, this.CNM = {
cN: "number",
b: this.CNR,
r: 0
}, this.BNM = {
cN: "number",
b: this.BNR,
r: 0
}, this.inherit = function(e, t) {
var n = {};
for (var i in e) n[i] = e[i];
if (t) for (var i in t) n[i] = t[i];
return n;
};
}();
if (hljs.LANGUAGES.glsl = function(e) {
return {
k: {
keyword: "atomic_uint attribute bool break bvec2 bvec3 bvec4 case centroid coherent const continue default discard dmat2 dmat2x2 dmat2x3 dmat2x4 dmat3 dmat3x2 dmat3x3 dmat3x4 dmat4 dmat4x2 dmat4x3 dmat4x4 do double dvec2 dvec3 dvec4 else flat float for highp if iimage1D iimage1DArray iimage2D iimage2DArray iimage2DMS iimage2DMSArray iimage2DRect iimage3D iimageBuffer iimageCube iimageCubeArray image1D image1DArray image2D image2DArray image2DMS image2DMSArray image2DRect image3D imageBuffer imageCube imageCubeArray in inout int invariant isampler1D isampler1DArray isampler2D isampler2DArray isampler2DMS isampler2DMSArray isampler2DRect isampler3D isamplerBuffer isamplerCube isamplerCubeArray ivec2 ivec3 ivec4 layout lowp mat2 mat2x2 mat2x3 mat2x4 mat3 mat3x2 mat3x3 mat3x4 mat4 mat4x2 mat4x3 mat4x4 mediump noperspective out patch precision readonly restrict return sample sampler1D sampler1DArray sampler1DArrayShadow sampler1DShadow sampler2D sampler2DArray sampler2DArrayShadow sampler2DMS sampler2DMSArray sampler2DRect sampler2DRectShadow sampler2DShadow sampler3D samplerBuffer samplerCube samplerCubeArray samplerCubeArrayShadow samplerCubeShadow smooth struct subroutine switch uimage1D uimage1DArray uimage2D uimage2DArray uimage2DMS uimage2DMSArray uimage2DRect uimage3D uimageBuffer uimageCube uimageCubeArray uint uniform usampler1D usampler1DArray usampler2D usampler2DArray usampler2DMS usampler2DMSArray usampler2DRect usampler3D usamplerBuffer usamplerCube usamplerCubeArray uvec2 uvec3 uvec4 varying vec2 vec3 vec4 void volatile while writeonly",
built_in: "gl_BackColor gl_BackLightModelProduct gl_BackLightProduct gl_BackMaterial gl_BackSecondaryColor gl_ClipDistance gl_ClipPlane gl_ClipVertex gl_Color gl_DepthRange gl_EyePlaneQ gl_EyePlaneR gl_EyePlaneS gl_EyePlaneT gl_Fog gl_FogCoord gl_FogFragCoord gl_FragColor gl_FragCoord gl_FragData gl_FragDepth gl_FrontColor gl_FrontFacing gl_FrontLightModelProduct gl_FrontLightProduct gl_FrontMaterial gl_FrontSecondaryColor gl_InstanceID gl_InvocationID gl_Layer gl_LightModel gl_LightSource gl_MaxAtomicCounterBindings gl_MaxAtomicCounterBufferSize gl_MaxClipDistances gl_MaxClipPlanes gl_MaxCombinedAtomicCounterBuffers gl_MaxCombinedAtomicCounters gl_MaxCombinedImageUniforms gl_MaxCombinedImageUnitsAndFragmentOutputs gl_MaxCombinedTextureImageUnits gl_MaxDrawBuffers gl_MaxFragmentAtomicCounterBuffers gl_MaxFragmentAtomicCounters gl_MaxFragmentImageUniforms gl_MaxFragmentInputComponents gl_MaxFragmentUniformComponents gl_MaxFragmentUniformVectors gl_MaxGeometryAtomicCounterBuffers gl_MaxGeometryAtomicCounters gl_MaxGeometryImageUniforms gl_MaxGeometryInputComponents gl_MaxGeometryOutputComponents gl_MaxGeometryOutputVertices gl_MaxGeometryTextureImageUnits gl_MaxGeometryTotalOutputComponents gl_MaxGeometryUniformComponents gl_MaxGeometryVaryingComponents gl_MaxImageSamples gl_MaxImageUnits gl_MaxLights gl_MaxPatchVertices gl_MaxProgramTexelOffset gl_MaxTessControlAtomicCounterBuffers gl_MaxTessControlAtomicCounters gl_MaxTessControlImageUniforms gl_MaxTessControlInputComponents gl_MaxTessControlOutputComponents gl_MaxTessControlTextureImageUnits gl_MaxTessControlTotalOutputComponents gl_MaxTessControlUniformComponents gl_MaxTessEvaluationAtomicCounterBuffers gl_MaxTessEvaluationAtomicCounters gl_MaxTessEvaluationImageUniforms gl_MaxTessEvaluationInputComponents gl_MaxTessEvaluationOutputComponents gl_MaxTessEvaluationTextureImageUnits gl_MaxTessEvaluationUniformComponents gl_MaxTessGenLevel gl_MaxTessPatchComponents gl_MaxTextureCoords gl_MaxTextureImageUnits gl_MaxTextureUnits gl_MaxVaryingComponents gl_MaxVaryingFloats gl_MaxVaryingVectors gl_MaxVertexAtomicCounterBuffers gl_MaxVertexAtomicCounters gl_MaxVertexAttribs gl_MaxVertexImageUniforms gl_MaxVertexOutputComponents gl_MaxVertexTextureImageUnits gl_MaxVertexUniformComponents gl_MaxVertexUniformVectors gl_MaxViewports gl_MinProgramTexelOffsetgl_ModelViewMatrix gl_ModelViewMatrixInverse gl_ModelViewMatrixInverseTranspose gl_ModelViewMatrixTranspose gl_ModelViewProjectionMatrix gl_ModelViewProjectionMatrixInverse gl_ModelViewProjectionMatrixInverseTranspose gl_ModelViewProjectionMatrixTranspose gl_MultiTexCoord0 gl_MultiTexCoord1 gl_MultiTexCoord2 gl_MultiTexCoord3 gl_MultiTexCoord4 gl_MultiTexCoord5 gl_MultiTexCoord6 gl_MultiTexCoord7 gl_Normal gl_NormalMatrix gl_NormalScale gl_ObjectPlaneQ gl_ObjectPlaneR gl_ObjectPlaneS gl_ObjectPlaneT gl_PatchVerticesIn gl_PerVertex gl_Point gl_PointCoord gl_PointSize gl_Position gl_PrimitiveID gl_PrimitiveIDIn gl_ProjectionMatrix gl_ProjectionMatrixInverse gl_ProjectionMatrixInverseTranspose gl_ProjectionMatrixTranspose gl_SampleID gl_SampleMask gl_SampleMaskIn gl_SamplePosition gl_SecondaryColor gl_TessCoord gl_TessLevelInner gl_TessLevelOuter gl_TexCoord gl_TextureEnvColor gl_TextureMatrixInverseTranspose gl_TextureMatrixTranspose gl_Vertex gl_VertexID gl_ViewportIndex gl_in gl_out EmitStreamVertex EmitVertex EndPrimitive EndStreamPrimitive abs acos acosh all any asin asinh atan atanh atomicCounter atomicCounterDecrement atomicCounterIncrement barrier bitCount bitfieldExtract bitfieldInsert bitfieldReverse ceil clamp cos cosh cross dFdx dFdy degrees determinant distance dot equal exp exp2 faceforward findLSB findMSB floatBitsToInt floatBitsToUint floor fma fract frexp ftransform fwidth greaterThan greaterThanEqual imageAtomicAdd imageAtomicAnd imageAtomicCompSwap imageAtomicExchange imageAtomicMax imageAtomicMin imageAtomicOr imageAtomicXor imageLoad imageStore imulExtended intBitsToFloat interpolateAtCentroid interpolateAtOffset interpolateAtSample inverse inversesqrt isinf isnan ldexp length lessThan lessThanEqual log log2 matrixCompMult max memoryBarrier min mix mod modf noise1 noise2 noise3 noise4 normalize not notEqual outerProduct packDouble2x32 packHalf2x16 packSnorm2x16 packSnorm4x8 packUnorm2x16 packUnorm4x8 pow radians reflect refract round roundEven shadow1D shadow1DLod shadow1DProj shadow1DProjLod shadow2D shadow2DLod shadow2DProj shadow2DProjLod sign sin sinh smoothstep sqrt step tan tanh texelFetch texelFetchOffset texture texture1D texture1DLod texture1DProj texture1DProjLod texture2D texture2DLod texture2DProj texture2DProjLod texture3D texture3DLod texture3DProj texture3DProjLod textureCube textureCubeLod textureGather textureGatherOffset textureGatherOffsets textureGrad textureGradOffset textureLod textureLodOffset textureOffset textureProj textureProjGrad textureProjGradOffset textureProjLod textureProjLodOffset textureProjOffset textureQueryLod textureSize transpose trunc uaddCarry uintBitsToFloat umulExtended unpackDouble2x32 unpackHalf2x16 unpackSnorm2x16 unpackSnorm4x8 unpackUnorm2x16 unpackUnorm4x8 usubBorrow gl_TextureMatrix gl_TextureMatrixInverse",
literal: "true false"
},
i: '"',
c: [ e.CLCM, e.CBLCLM, e.CNM, {
cN: "preprocessor",
b: "#",
e: "$"
} ]
};
}(hljs), hljs.LANGUAGES.cs = function(e) {
return {
k: "abstract as base bool break byte case catch char checked class const continue decimal default delegate do double else enum event explicit extern false finally fixed float for foreach goto if implicit in int interface internal is lock long namespace new null object operator out override params private protected public readonly ref return sbyte sealed short sizeof stackalloc static string struct switch this throw true try typeof uint ulong unchecked unsafe ushort using virtual volatile void while ascending descending from get group into join let orderby partial select set value var where yield",
c: [ {
cN: "comment",
b: "///",
e: "$",
rB: !0,
c: [ {
cN: "xmlDocTag",
b: "///|<!--|-->"
}, {
cN: "xmlDocTag",
b: "</?",
e: ">"
} ]
}, e.CLCM, e.CBLCLM, {
cN: "preprocessor",
b: "#",
e: "$",
k: "if else elif endif define undef warning error line region endregion pragma checksum"
}, {
cN: "string",
b: '@"',
e: '"',
c: [ {
b: '""'
} ]
}, e.ASM, e.QSM, e.CNM ]
};
}(hljs), hljs.LANGUAGES.rsl = function(e) {
return {
k: {
keyword: "float color point normal vector matrix while for if do return else break extern continue",
built_in: "abs acos ambient area asin atan atmosphere attribute calculatenormal ceil cellnoise clamp comp concat cos degrees depth Deriv diffuse distance Du Dv environment exp faceforward filterstep floor format fresnel incident length lightsource log match max min mod noise normalize ntransform opposite option phong pnoise pow printf ptlined radians random reflect refract renderinfo round setcomp setxcomp setycomp setzcomp shadow sign sin smoothstep specular specularbrdf spline sqrt step tan texture textureinfo trace transform vtransform xcomp ycomp zcomp"
},
i: "</",
c: [ e.CLCM, e.CBLCLM, e.QSM, e.ASM, e.CNM, {
cN: "preprocessor",
b: "#",
e: "$"
}, {
cN: "shader",
bWK: !0,
e: "\\(",
k: "surface displacement light volume imager"
}, {
cN: "shading",
bWK: !0,
e: "\\(",
k: "illuminate illuminance gather"
} ]
};
}(hljs), hljs.LANGUAGES["erlang-repl"] = function(e) {
return {
k: {
special_functions: "spawn spawn_link self",
reserved: "after and andalso|10 band begin bnot bor bsl bsr bxor case catch cond div end fun if let not of or orelse|10 query receive rem try when xor"
},
c: [ {
cN: "prompt",
b: "^[0-9]+> ",
r: 10
}, {
cN: "comment",
b: "%",
e: "$"
}, {
cN: "number",
b: "\\b(\\d+#[a-fA-F0-9]+|\\d+(\\.\\d+)?([eE][-+]?\\d+)?)",
r: 0
}, e.ASM, e.QSM, {
cN: "constant",
b: "\\?(::)?([A-Z]\\w*(::)?)+"
}, {
cN: "arrow",
b: "->"
}, {
cN: "ok",
b: "ok"
}, {
cN: "exclamation_mark",
b: "!"
}, {
cN: "function_or_atom",
b: "(\\b[a-z'][a-zA-Z0-9_']*:[a-z'][a-zA-Z0-9_']*)|(\\b[a-z'][a-zA-Z0-9_']*)",
r: 0
}, {
cN: "variable",
b: "[A-Z][a-zA-Z0-9_']*",
r: 0
} ]
};
}(hljs), hljs.LANGUAGES["1c"] = function(e) {
var t = "[a-zA-Zа-яА-Я][a-zA-Z0-9_а-яА-Я]*", n = "возврат дата для если и или иначе иначеесли исключение конецесли конецпопытки конецпроцедуры конецфункции конеццикла константа не перейти перем перечисление по пока попытка прервать продолжить процедура строка тогда фс функция цикл число экспорт", i = "ansitooem oemtoansi ввестивидсубконто ввестидату ввестизначение ввестиперечисление ввестипериод ввестиплансчетов ввестистроку ввестичисло вопрос восстановитьзначение врег выбранныйплансчетов вызватьисключение датагод датамесяц датачисло добавитьмесяц завершитьработусистемы заголовоксистемы записьжурналарегистрации запуститьприложение зафиксироватьтранзакцию значениевстроку значениевстрокувнутр значениевфайл значениеизстроки значениеизстрокивнутр значениеизфайла имякомпьютера имяпользователя каталогвременныхфайлов каталогиб каталогпользователя каталогпрограммы кодсимв командасистемы конгода конецпериодаби конецрассчитанногопериодаби конецстандартногоинтервала конквартала конмесяца коннедели лев лог лог10 макс максимальноеколичествосубконто мин монопольныйрежим названиеинтерфейса названиенабораправ назначитьвид назначитьсчет найти найтипомеченныенаудаление найтиссылки началопериодаби началостандартногоинтервала начатьтранзакцию начгода начквартала начмесяца начнедели номерднягода номерднянедели номернеделигода нрег обработкаожидания окр описаниеошибки основнойжурналрасчетов основнойплансчетов основнойязык открытьформу открытьформумодально отменитьтранзакцию очиститьокносообщений периодстр полноеимяпользователя получитьвремята получитьдатута получитьдокументта получитьзначенияотбора получитьпозициюта получитьпустоезначение получитьта прав праводоступа предупреждение префиксавтонумерации пустаястрока пустоезначение рабочаядаттьпустоезначение рабочаядата разделительстраниц разделительстрок разм разобратьпозициюдокумента рассчитатьрегистрына рассчитатьрегистрыпо сигнал симв символтабуляции создатьобъект сокрл сокрлп сокрп сообщить состояние сохранитьзначение сред статусвозврата стрдлина стрзаменить стрколичествострок стрполучитьстроку стрчисловхождений сформироватьпозициюдокумента счетпокоду текущаядата текущеевремя типзначения типзначениястр удалитьобъекты установитьтана установитьтапо фиксшаблон формат цел шаблон", o = {
cN: "dquote",
b: '""'
}, r = {
cN: "string",
b: '"',
e: '"|$',
c: [ o ],
r: 0
}, s = {
cN: "string",
b: "\\|",
e: '"|$',
c: [ o ]
};
return {
cI: !0,
l: t,
k: {
keyword: n,
built_in: i
},
c: [ e.CLCM, e.NM, r, s, {
cN: "function",
b: "(процедура|функция)",
e: "$",
l: t,
k: "процедура функция",
c: [ {
cN: "title",
b: t
}, {
cN: "tail",
eW: !0,
c: [ {
cN: "params",
b: "\\(",
e: "\\)",
l: t,
k: "знач",
c: [ r, s ]
}, {
cN: "export",
b: "экспорт",
eW: !0,
l: t,
k: "экспорт",
c: [ e.CLCM ]
} ]
}, e.CLCM ]
}, {
cN: "preprocessor",
b: "#",
e: "$"
}, {
cN: "date",
b: "'\\d{2}\\.\\d{2}\\.(\\d{2}|\\d{4})'"
} ]
};
}(hljs), hljs.LANGUAGES.objectivec = function(e) {
var t = {
keyword: "int float while private char catch export sizeof typedef const struct for union unsigned long volatile static protected bool mutable if public do return goto void enum else break extern class asm case short default double throw register explicit signed typename try this switch continue wchar_t inline readonly assign property protocol self synchronized end synthesize id optional required implementation nonatomic interface super unichar finally dynamic IBOutlet IBAction selector strong weak readonly",
literal: "false true FALSE TRUE nil YES NO NULL",
built_in: "NSString NSDictionary CGRect CGPoint UIButton UILabel UITextView UIWebView MKMapView UISegmentedControl NSObject UITableViewDelegate UITableViewDataSource NSThread UIActivityIndicator UITabbar UIToolBar UIBarButtonItem UIImageView NSAutoreleasePool UITableView BOOL NSInteger CGFloat NSException NSLog NSMutableString NSMutableArray NSMutableDictionary NSURL NSIndexPath CGSize UITableViewCell UIView UIViewController UINavigationBar UINavigationController UITabBarController UIPopoverController UIPopoverControllerDelegate UIImage NSNumber UISearchBar NSFetchedResultsController NSFetchedResultsChangeType UIScrollView UIScrollViewDelegate UIEdgeInsets UIColor UIFont UIApplication NSNotFound NSNotificationCenter NSNotification UILocalNotification NSBundle NSFileManager NSTimeInterval NSDate NSCalendar NSUserDefaults UIWindow NSRange NSArray NSError NSURLRequest NSURLConnection class UIInterfaceOrientation MPMoviePlayerController dispatch_once_t dispatch_queue_t dispatch_sync dispatch_async dispatch_once"
};
return {
k: t,
i: "</",
c: [ e.CLCM, e.CBLCLM, e.CNM, e.QSM, {
cN: "string",
b: "'",
e: "[^\\\\]'",
i: "[^\\\\][^']"
}, {
cN: "preprocessor",
b: "#import",
e: "$",
c: [ {
cN: "title",
b: '"',
e: '"'
}, {
cN: "title",
b: "<",
e: ">"
} ]
}, {
cN: "preprocessor",
b: "#",
e: "$"
}, {
cN: "class",
bWK: !0,
e: "({|$)",
k: "interface class protocol implementation",
c: [ {
cN: "id",
b: e.UIR
} ]
}, {
cN: "variable",
b: "\\." + e.UIR
} ]
};
}(hljs), hljs.LANGUAGES.scala = function(e) {
var t = {
cN: "annotation",
b: "@[A-Za-z]+"
}, n = {
cN: "string",
b: 'u?r?"""',
e: '"""',
r: 10
};
return {
k: "type yield lazy override def with val var false true sealed abstract private trait object null if for while throw finally protected extends import final return else break new catch super class case package default try this match continue throws",
c: [ {
cN: "javadoc",
b: "/\\*\\*",
e: "\\*/",
c: [ {
cN: "javadoctag",
b: "@[A-Za-z]+"
} ],
r: 10
}, e.CLCM, e.CBLCLM, e.ASM, e.QSM, n, {
cN: "class",
b: "((case )?class |object |trait )",
e: "({|$)",
i: ":",
k: "case class trait object",
c: [ {
bWK: !0,
k: "extends with",
r: 10
}, {
cN: "title",
b: e.UIR
}, {
cN: "params",
b: "\\(",
e: "\\)",
c: [ e.ASM, e.QSM, n, t ]
} ]
}, e.CNM, t ]
};
}(hljs), hljs.LANGUAGES.clojure = function(e) {
var t = {
built_in: "def cond apply if-not if-let if not not= = &lt; < > &lt;= <= >= == + / * - rem quot neg? pos? delay? symbol? keyword? true? false? integer? empty? coll? list? set? ifn? fn? associative? sequential? sorted? counted? reversible? number? decimal? class? distinct? isa? float? rational? reduced? ratio? odd? even? char? seq? vector? string? map? nil? contains? zero? instance? not-every? not-any? libspec? -> ->> .. . inc compare do dotimes mapcat take remove take-while drop letfn drop-last take-last drop-while while intern condp case reduced cycle split-at split-with repeat replicate iterate range merge zipmap declare line-seq sort comparator sort-by dorun doall nthnext nthrest partition eval doseq await await-for let agent atom send send-off release-pending-sends add-watch mapv filterv remove-watch agent-error restart-agent set-error-handler error-handler set-error-mode! error-mode shutdown-agents quote var fn loop recur throw try monitor-enter monitor-exit defmacro defn defn- macroexpand macroexpand-1 for doseq dosync dotimes and or when when-not when-let comp juxt partial sequence memoize constantly complement identity assert peek pop doto proxy defstruct first rest cons defprotocol cast coll deftype defrecord last butlast sigs reify second ffirst fnext nfirst nnext defmulti defmethod meta with-meta ns in-ns create-ns import intern refer keys select-keys vals key val rseq name namespace promise into transient persistent! conj! assoc! dissoc! pop! disj! import use class type num float double short byte boolean bigint biginteger bigdec print-method print-dup throw-if throw printf format load compile get-in update-in pr pr-on newline flush read slurp read-line subvec with-open memfn time ns assert re-find re-groups rand-int rand mod locking assert-valid-fdecl alias namespace resolve ref deref refset swap! reset! set-validator! compare-and-set! alter-meta! reset-meta! commute get-validator alter ref-set ref-history-count ref-min-history ref-max-history ensure sync io! new next conj set! memfn to-array future future-call into-array aset gen-class reduce merge map filter find empty hash-map hash-set sorted-map sorted-map-by sorted-set sorted-set-by vec vector seq flatten reverse assoc dissoc list disj get union difference intersection extend extend-type extend-protocol int nth delay count concat chunk chunk-buffer chunk-append chunk-first chunk-rest max min dec unchecked-inc-int unchecked-inc unchecked-dec-inc unchecked-dec unchecked-negate unchecked-add-int unchecked-add unchecked-subtract-int unchecked-subtract chunk-next chunk-cons chunked-seq? prn vary-meta lazy-seq spread list* str find-keyword keyword symbol gensym force rationalize"
}, n = "[a-zA-Z_0-9\\!\\.\\?\\-\\+\\*\\/\\<\\=\\>\\&\\#\\$';]+", i = "[\\s:\\(\\{]+\\d+(\\.\\d+)?", o = {
cN: "number",
b: i,
r: 0
}, r = {
cN: "string",
b: '"',
e: '"',
c: [ e.BE ],
r: 0
}, s = {
cN: "comment",
b: ";",
e: "$",
r: 0
}, a = {
cN: "collection",
b: "[\\[\\{]",
e: "[\\]\\}]"
}, l = {
cN: "comment",
b: "\\^" + n
}, c = {
cN: "comment",
b: "\\^\\{",
e: "\\}"
}, u = {
cN: "attribute",
b: "[:]" + n
}, d = {
cN: "list",
b: "\\(",
e: "\\)",
r: 0
}, h = {
eW: !0,
eE: !0,
k: {
literal: "true false nil"
},
r: 0
}, p = {
k: t,
l: n,
cN: "title",
b: n,
starts: h
};
return d.c = [ {
cN: "comment",
b: "comment"
}, p ], h.c = [ d, r, l, c, s, u, a, o ], a.c = [ d, r, l, s, u, a, o ], {
i: "\\S",
c: [ s, d ]
};
}(hljs), hljs.LANGUAGES.perl = function(e) {
var t = "getpwent getservent quotemeta msgrcv scalar kill dbmclose undef lc ma syswrite tr send umask sysopen shmwrite vec qx utime local oct semctl localtime readpipe do return format read sprintf dbmopen pop getpgrp not getpwnam rewinddir qqfileno qw endprotoent wait sethostent bless s|0 opendir continue each sleep endgrent shutdown dump chomp connect getsockname die socketpair close flock exists index shmgetsub for endpwent redo lstat msgctl setpgrp abs exit select print ref gethostbyaddr unshift fcntl syscall goto getnetbyaddr join gmtime symlink semget splice x|0 getpeername recv log setsockopt cos last reverse gethostbyname getgrnam study formline endhostent times chop length gethostent getnetent pack getprotoent getservbyname rand mkdir pos chmod y|0 substr endnetent printf next open msgsnd readdir use unlink getsockopt getpriority rindex wantarray hex system getservbyport endservent int chr untie rmdir prototype tell listen fork shmread ucfirst setprotoent else sysseek link getgrgid shmctl waitpid unpack getnetbyname reset chdir grep split require caller lcfirst until warn while values shift telldir getpwuid my getprotobynumber delete and sort uc defined srand accept package seekdir getprotobyname semop our rename seek if q|0 chroot sysread setpwent no crypt getc chown sqrt write setnetent setpriority foreach tie sin msgget map stat getlogin unless elsif truncate exec keys glob tied closedirioctl socket readlink eval xor readline binmode setservent eof ord bind alarm pipe atan2 getgrent exp time push setgrent gt lt or ne m|0 break given say state when", n = {
cN: "subst",
b: "[$@]\\{",
e: "\\}",
k: t,
r: 10
}, i = {
cN: "variable",
b: "\\$\\d"
}, o = {
cN: "variable",
b: "[\\$\\%\\@\\*](\\^\\w\\b|#\\w+(\\:\\:\\w+)*|[^\\s\\w{]|{\\w+}|\\w+(\\:\\:\\w*)*)"
}, r = [ e.BE, n, i, o ], s = {
b: "->",
c: [ {
b: e.IR
}, {
b: "{",
e: "}"
} ]
}, a = {
cN: "comment",
b: "^(__END__|__DATA__)",
e: "\\n$",
r: 5
}, l = [ i, o, e.HCM, a, {
cN: "comment",
b: "^\\=\\w",
e: "\\=cut",
eW: !0
}, s, {
cN: "string",
b: "q[qwxr]?\\s*\\(",
e: "\\)",
c: r,
r: 5
}, {
cN: "string",
b: "q[qwxr]?\\s*\\[",
e: "\\]",
c: r,
r: 5
}, {
cN: "string",
b: "q[qwxr]?\\s*\\{",
e: "\\}",
c: r,
r: 5
}, {
cN: "string",
b: "q[qwxr]?\\s*\\|",
e: "\\|",
c: r,
r: 5
}, {
cN: "string",
b: "q[qwxr]?\\s*\\<",
e: "\\>",
c: r,
r: 5
}, {
cN: "string",
b: "qw\\s+q",
e: "q",
c: r,
r: 5
}, {
cN: "string",
b: "'",
e: "'",
c: [ e.BE ],
r: 0
}, {
cN: "string",
b: '"',
e: '"',
c: r,
r: 0
}, {
cN: "string",
b: "`",
e: "`",
c: [ e.BE ]
}, {
cN: "string",
b: "{\\w+}",
r: 0
}, {
cN: "string",
b: "-?\\w+\\s*\\=\\>",
r: 0
}, {
cN: "number",
b: "(\\b0[0-7_]+)|(\\b0x[0-9a-fA-F_]+)|(\\b[1-9][0-9_]*(\\.[0-9_]+)?)|[0_]\\b",
r: 0
}, {
b: "(" + e.RSR + "|\\b(split|return|print|reverse|grep)\\b)\\s*",
k: "split return print reverse grep",
r: 0,
c: [ e.HCM, a, {
cN: "regexp",
b: "(s|tr|y)/(\\\\.|[^/])*/(\\\\.|[^/])*/[a-z]*",
r: 10
}, {
cN: "regexp",
b: "(m|qr)?/",
e: "/[a-z]*",
c: [ e.BE ],
r: 0
} ]
}, {
cN: "sub",
bWK: !0,
e: "(\\s*\\(.*?\\))?[;{]",
k: "sub",
r: 5
}, {
cN: "operator",
b: "-\\w\\b",
r: 0
} ];
return n.c = l, s.c[1].c = l, {
k: t,
c: l
};
}(hljs), hljs.LANGUAGES.applescript = function(e) {
var t = e.inherit(e.QSM, {
i: ""
}), n = {
cN: "title",
b: e.UIR
}, i = {
cN: "params",
b: "\\(",
e: "\\)",
c: [ "self", e.CNM, t ]
}, o = [ {
cN: "comment",
b: "--",
e: "$"
}, {
cN: "comment",
b: "\\(\\*",
e: "\\*\\)",
c: [ "self", {
b: "--",
e: "$"
} ]
}, e.HCM ];
return {
k: {
keyword: "about above after against and around as at back before beginning behind below beneath beside between but by considering contain contains continue copy div does eighth else end equal equals error every exit fifth first for fourth from front get given global if ignoring in into is it its last local me middle mod my ninth not of on onto or over prop property put ref reference repeat returning script second set seventh since sixth some tell tenth that the then third through thru timeout times to transaction try until where while whose with without",
constant: "AppleScript false linefeed return pi quote result space tab true",
type: "alias application boolean class constant date file integer list number real record string text",
command: "activate beep count delay launch log offset read round run say summarize write",
property: "character characters contents day frontmost id item length month name paragraph paragraphs rest reverse running time version weekday word words year"
},
c: [ t, e.CNM, {
cN: "type",
b: "\\bPOSIX file\\b"
}, {
cN: "command",
b: "\\b(clipboard info|the clipboard|info for|list (disks|folder)|mount volume|path to|(close|open for) access|(get|set) eof|current date|do shell script|get volume settings|random number|set volume|system attribute|system info|time to GMT|(load|run|store) script|scripting components|ASCII (character|number)|localized string|choose (application|color|file|file name|folder|from list|remote application|URL)|display (alert|dialog))\\b|^\\s*return\\b"
}, {
cN: "constant",
b: "\\b(text item delimiters|current application|missing value)\\b"
}, {
cN: "keyword",
b: "\\b(apart from|aside from|instead of|out of|greater than|isn't|(doesn't|does not) (equal|come before|come after|contain)|(greater|less) than( or equal)?|(starts?|ends|begins?) with|contained by|comes (before|after)|a (ref|reference))\\b"
}, {
cN: "property",
b: "\\b(POSIX path|(date|time) string|quoted form)\\b"
}, {
cN: "function_start",
bWK: !0,
k: "on",
i: "[${=;\\n]",
c: [ n, i ]
} ].concat(o)
};
}(hljs), hljs.LANGUAGES.java = function(e) {
return {
k: "false synchronized int abstract float private char boolean static null if const for true while long throw strictfp finally protected import native final return void enum else break transient new catch instanceof byte super volatile case assert short package default double public try this switch continue throws",
c: [ {
cN: "javadoc",
b: "/\\*\\*",
e: "\\*/",
c: [ {
cN: "javadoctag",
b: "@[A-Za-z]+"
} ],
r: 10
}, e.CLCM, e.CBLCLM, e.ASM, e.QSM, {
cN: "class",
bWK: !0,
e: "{",
k: "class interface",
i: ":",
c: [ {
bWK: !0,
k: "extends implements",
r: 10
}, {
cN: "title",
b: e.UIR
} ]
}, e.CNM, {
cN: "annotation",
b: "@[A-Za-z]+"
} ]
};
}(hljs), hljs.LANGUAGES.vhdl = function(e) {
return {
cI: !0,
k: {
keyword: "abs access after alias all and architecture array assert attribute begin block body buffer bus case component configuration constant context cover disconnect downto default else elsif end entity exit fairness file for force function generate generic group guarded if impure in inertial inout is label library linkage literal loop map mod nand new next nor not null of on open or others out package port postponed procedure process property protected pure range record register reject release rem report restrict restrict_guarantee return rol ror select sequence severity shared signal sla sll sra srl strong subtype then to transport type unaffected units until use variable vmode vprop vunit wait when while with xnor xor",
typename: "boolean bit character severity_level integer time delay_length natural positive string bit_vector file_open_kind file_open_status std_ulogic std_ulogic_vector std_logic std_logic_vector unsigned signed boolean_vector integer_vector real_vector time_vector"
},
i: "{",
c: [ e.CBLCLM, {
cN: "comment",
b: "--",
e: "$"
}, e.QSM, e.CNM, {
cN: "literal",
b: "'(U|X|0|1|Z|W|L|H|-)'",
c: [ e.BE ]
}, {
cN: "attribute",
b: "'[A-Za-z](_?[A-Za-z0-9])*",
c: [ e.BE ]
} ]
};
}(hljs), hljs.LANGUAGES.brainfuck = function() {
return {
c: [ {
cN: "comment",
b: "[^\\[\\]\\.,\\+\\-<> \r\n]",
eE: !0,
e: "[\\[\\]\\.,\\+\\-<> \r\n]",
r: 0
}, {
cN: "title",
b: "[\\[\\]]",
r: 0
}, {
cN: "string",
b: "[\\.,]"
}, {
cN: "literal",
b: "[\\+\\-]"
} ]
};
}(hljs), hljs.LANGUAGES.go = function(e) {
var t = {
keyword: "break default func interface select case map struct chan else goto package switch const fallthrough if range type continue for import return var go defer",
constant: "true false iota nil",
typename: "bool byte complex64 complex128 float32 float64 int8 int16 int32 int64 string uint8 uint16 uint32 uint64 int uint uintptr rune",
built_in: "append cap close complex copy imag len make new panic print println real recover delete"
};
return {
k: t,
i: "</",
c: [ e.CLCM, e.CBLCLM, e.QSM, {
cN: "string",
b: "'",
e: "[^\\\\]'",
r: 0
}, {
cN: "string",
b: "`",
e: "`"
}, {
cN: "number",
b: "[^a-zA-Z_0-9](\\-|\\+)?\\d+(\\.\\d+|\\/\\d+)?((d|e|f|l|s)(\\+|\\-)?\\d+)?",
r: 0
}, e.CNM ]
};
}(hljs), hljs.LANGUAGES.delphi = function(e) {
var t = "and safecall cdecl then string exports library not pascal set virtual file in array label packed end. index while const raise for to implementation with except overload destructor downto finally program exit unit inherited override if type until function do begin repeat goto nil far initialization object else var uses external resourcestring interface end finalization class asm mod case on shr shl of register xorwrite threadvar try record near stored constructor stdcall inline div out or procedure", n = "safecall stdcall pascal stored const implementation finalization except to finally program inherited override then exports string read not mod shr try div shl set library message packed index for near overload label downto exit public goto interface asm on of constructor or private array unit raise destructor var type until function else external with case default record while protected property procedure published and cdecl do threadvar file in if end virtual write far out begin repeat nil initialization object uses resourcestring class register xorwrite inline static", i = {
cN: "comment",
b: "{",
e: "}",
r: 0
}, o = {
cN: "comment",
b: "\\(\\*",
e: "\\*\\)",
r: 10
}, r = {
cN: "string",
b: "'",
e: "'",
c: [ {
b: "''"
} ],
r: 0
}, s = {
cN: "string",
b: "(#\\d+)+"
}, a = {
cN: "function",
bWK: !0,
e: "[:;]",
k: "function constructor|10 destructor|10 procedure|10",
c: [ {
cN: "title",
b: e.IR
}, {
cN: "params",
b: "\\(",
e: "\\)",
k: t,
c: [ r, s ]
}, i, o ]
};
return {
cI: !0,
k: t,
i: '("|\\$[G-Zg-z]|\\/\\*|</)',
c: [ i, o, e.CLCM, r, s, e.NM, a, {
cN: "class",
b: "=\\bclass\\b",
e: "end;",
k: n,
c: [ r, s, i, o, e.CLCM, a ]
} ]
};
}(hljs), hljs.LANGUAGES.vala = function(e) {
return {
k: {
keyword: "char uchar unichar int uint long ulong short ushort int8 int16 int32 int64 uint8 uint16 uint32 uint64 float double bool struct enum string void weak unowned owned async signal static abstract interface override while do for foreach else switch case break default return try catch public private protected internal using new this get set const stdout stdin stderr var",
built_in: "DBus GLib CCode Gee Object",
literal: "false true null"
},
c: [ {
cN: "class",
bWK: !0,
e: "{",
k: "class interface delegate namespace",
c: [ {
bWK: !0,
k: "extends implements"
}, {
cN: "title",
b: e.UIR
} ]
}, e.CLCM, e.CBLCLM, {
cN: "string",
b: '"""',
e: '"""',
r: 5
}, e.ASM, e.QSM, e.CNM, {
cN: "preprocessor",
b: "^#",
e: "$",
r: 2
}, {
cN: "constant",
b: " [A-Z_]+ ",
r: 0
} ]
};
}(hljs), hljs.LANGUAGES.rib = function(e) {
return {
k: "ArchiveRecord AreaLightSource Atmosphere Attribute AttributeBegin AttributeEnd Basis Begin Blobby Bound Clipping ClippingPlane Color ColorSamples ConcatTransform Cone CoordinateSystem CoordSysTransform CropWindow Curves Cylinder DepthOfField Detail DetailRange Disk Displacement Display End ErrorHandler Exposure Exterior Format FrameAspectRatio FrameBegin FrameEnd GeneralPolygon GeometricApproximation Geometry Hider Hyperboloid Identity Illuminate Imager Interior LightSource MakeCubeFaceEnvironment MakeLatLongEnvironment MakeShadow MakeTexture Matte MotionBegin MotionEnd NuPatch ObjectBegin ObjectEnd ObjectInstance Opacity Option Orientation Paraboloid Patch PatchMesh Perspective PixelFilter PixelSamples PixelVariance Points PointsGeneralPolygons PointsPolygons Polygon Procedural Projection Quantize ReadArchive RelativeDetail ReverseOrientation Rotate Scale ScreenWindow ShadingInterpolation ShadingRate Shutter Sides Skew SolidBegin SolidEnd Sphere SubdivisionMesh Surface TextureCoordinates Torus Transform TransformBegin TransformEnd TransformPoints Translate TrimCurve WorldBegin WorldEnd",
i: "</",
c: [ e.HCM, e.CNM, e.ASM, e.QSM ]
};
}(hljs), hljs.LANGUAGES.ruby = function(e) {
var t = "[a-zA-Z_][a-zA-Z0-9_]*(\\!|\\?)?", n = "[a-zA-Z_]\\w*[!?=]?|[-+~]\\@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?", i = {
keyword: "and false then defined module in return redo if BEGIN retry end for true self when next until do begin unless END rescue nil else break undef not super class case require yield alias while ensure elsif or include"
}, o = {
cN: "yardoctag",
b: "@[A-Za-z]+"
}, r = [ {
cN: "comment",
b: "#",
e: "$",
c: [ o ]
}, {
cN: "comment",
b: "^\\=begin",
e: "^\\=end",
c: [ o ],
r: 10
}, {
cN: "comment",
b: "^__END__",
e: "\\n$"
} ], s = {
cN: "subst",
b: "#\\{",
e: "}",
l: t,
k: i
}, a = [ e.BE, s ], l = [ {
cN: "string",
b: "'",
e: "'",
c: a,
r: 0
}, {
cN: "string",
b: '"',
e: '"',
c: a,
r: 0
}, {
cN: "string",
b: "%[qw]?\\(",
e: "\\)",
c: a
}, {
cN: "string",
b: "%[qw]?\\[",
e: "\\]",
c: a
}, {
cN: "string",
b: "%[qw]?{",
e: "}",
c: a
}, {
cN: "string",
b: "%[qw]?<",
e: ">",
c: a,
r: 10
}, {
cN: "string",
b: "%[qw]?/",
e: "/",
c: a,
r: 10
}, {
cN: "string",
b: "%[qw]?%",
e: "%",
c: a,
r: 10
}, {
cN: "string",
b: "%[qw]?-",
e: "-",
c: a,
r: 10
}, {
cN: "string",
b: "%[qw]?\\|",
e: "\\|",
c: a,
r: 10
} ], c = {
cN: "function",
bWK: !0,
e: " |$|;",
k: "def",
c: [ {
cN: "title",
b: n,
l: t,
k: i
}, {
cN: "params",
b: "\\(",
e: "\\)",
l: t,
k: i
} ].concat(r)
}, u = r.concat(l.concat([ {
cN: "class",
bWK: !0,
e: "$|;",
k: "class module",
c: [ {
cN: "title",
b: "[A-Za-z_]\\w*(::\\w+)*(\\?|\\!)?",
r: 0
}, {
cN: "inheritance",
b: "<\\s*",
c: [ {
cN: "parent",
b: "(" + e.IR + "::)?" + e.IR
} ]
} ].concat(r)
}, c, {
cN: "constant",
b: "(::)?(\\b[A-Z]\\w*(::)?)+",
r: 0
}, {
cN: "symbol",
b: ":",
c: l.concat([ {
b: n
} ]),
r: 0
}, {
cN: "symbol",
b: t + ":",
r: 0
}, {
cN: "number",
b: "(\\b0[0-7_]+)|(\\b0x[0-9a-fA-F_]+)|(\\b[1-9][0-9_]*(\\.[0-9_]+)?)|[0_]\\b",
r: 0
}, {
cN: "number",
b: "\\?\\w"
}, {
cN: "variable",
b: "(\\$\\W)|((\\$|\\@\\@?)(\\w+))"
}, {
b: "(" + e.RSR + ")\\s*",
c: r.concat([ {
cN: "regexp",
b: "/",
e: "/[a-z]*",
i: "\\n",
c: [ e.BE, s ]
} ]),
r: 0
} ]));
return s.c = u, c.c[1].c = u, {
l: t,
k: i,
c: u
};
}(hljs), hljs.LANGUAGES.dos = function() {
return {
cI: !0,
k: {
flow: "if else goto for in do call exit not exist errorlevel defined equ neq lss leq gtr geq",
keyword: "shift cd dir echo setlocal endlocal set pause copy",
stream: "prn nul lpt3 lpt2 lpt1 con com4 com3 com2 com1 aux",
winutils: "ping net ipconfig taskkill xcopy ren del"
},
c: [ {
cN: "envvar",
b: "%%[^ ]"
}, {
cN: "envvar",
b: "%[^ ]+?%"
}, {
cN: "envvar",
b: "![^ ]+?!"
}, {
cN: "number",
b: "\\b\\d+",
r: 0
}, {
cN: "comment",
b: "@?rem",
e: "$"
} ]
};
}(hljs), hljs.LANGUAGES.lisp = function(e) {
var t = "[a-zA-Z_\\-\\+\\*\\/\\<\\=\\>\\&\\#][a-zA-Z0-9_\\-\\+\\*\\/\\<\\=\\>\\&\\#]*", n = "(\\-|\\+)?\\d+(\\.\\d+|\\/\\d+)?((d|e|f|l|s)(\\+|\\-)?\\d+)?", i = {
cN: "literal",
b: "\\b(t{1}|nil)\\b"
}, o = [ {
cN: "number",
b: n
}, {
cN: "number",
b: "#b[0-1]+(/[0-1]+)?"
}, {
cN: "number",
b: "#o[0-7]+(/[0-7]+)?"
}, {
cN: "number",
b: "#x[0-9a-f]+(/[0-9a-f]+)?"
}, {
cN: "number",
b: "#c\\(" + n + " +" + n,
e: "\\)"
} ], r = {
cN: "string",
b: '"',
e: '"',
c: [ e.BE ],
r: 0
}, s = {
cN: "comment",
b: ";",
e: "$"
}, a = {
cN: "variable",
b: "\\*",
e: "\\*"
}, l = {
cN: "keyword",
b: "[:&]" + t
}, c = {
b: "\\(",
e: "\\)",
c: [ "self", i, r ].concat(o)
}, u = {
cN: "quoted",
b: "['`]\\(",
e: "\\)",
c: o.concat([ r, a, l, c ])
}, d = {
cN: "quoted",
b: "\\(quote ",
e: "\\)",
k: {
title: "quote"
},
c: o.concat([ r, a, l, c ])
}, h = {
cN: "list",
b: "\\(",
e: "\\)"
}, p = {
cN: "body",
eW: !0,
eE: !0
};
return h.c = [ {
cN: "title",
b: t
}, p ], p.c = [ u, d, h, i ].concat(o).concat([ r, s, a, l ]), {
i: "[^\\s]",
c: o.concat([ i, r, s, u, d, h ])
};
}(hljs), hljs.LANGUAGES.apache = function(e) {
var t = {
cN: "number",
b: "[\\$%]\\d+"
};
return {
cI: !0,
k: {
keyword: "acceptfilter acceptmutex acceptpathinfo accessfilename action addalt addaltbyencoding addaltbytype addcharset adddefaultcharset adddescription addencoding addhandler addicon addiconbyencoding addiconbytype addinputfilter addlanguage addmoduleinfo addoutputfilter addoutputfilterbytype addtype alias aliasmatch allow allowconnect allowencodedslashes allowoverride anonymous anonymous_logemail anonymous_mustgiveemail anonymous_nouserid anonymous_verifyemail authbasicauthoritative authbasicprovider authdbduserpwquery authdbduserrealmquery authdbmgroupfile authdbmtype authdbmuserfile authdefaultauthoritative authdigestalgorithm authdigestdomain authdigestnccheck authdigestnonceformat authdigestnoncelifetime authdigestprovider authdigestqop authdigestshmemsize authgroupfile authldapbinddn authldapbindpassword authldapcharsetconfig authldapcomparednonserver authldapdereferencealiases authldapgroupattribute authldapgroupattributeisdn authldapremoteuserattribute authldapremoteuserisdn authldapurl authname authnprovideralias authtype authuserfile authzdbmauthoritative authzdbmtype authzdefaultauthoritative authzgroupfileauthoritative authzldapauthoritative authzownerauthoritative authzuserauthoritative balancermember browsermatch browsermatchnocase bufferedlogs cachedefaultexpire cachedirlength cachedirlevels cachedisable cacheenable cachefile cacheignorecachecontrol cacheignoreheaders cacheignorenolastmod cacheignorequerystring cachelastmodifiedfactor cachemaxexpire cachemaxfilesize cacheminfilesize cachenegotiateddocs cacheroot cachestorenostore cachestoreprivate cgimapextension charsetdefault charsetoptions charsetsourceenc checkcaseonly checkspelling chrootdir contentdigest cookiedomain cookieexpires cookielog cookiename cookiestyle cookietracking coredumpdirectory customlog dav davdepthinfinity davgenericlockdb davlockdb davmintimeout dbdexptime dbdkeep dbdmax dbdmin dbdparams dbdpersist dbdpreparesql dbdriver defaulticon defaultlanguage defaulttype deflatebuffersize deflatecompressionlevel deflatefilternote deflatememlevel deflatewindowsize deny directoryindex directorymatch directoryslash documentroot dumpioinput dumpiologlevel dumpiooutput enableexceptionhook enablemmap enablesendfile errordocument errorlog example expiresactive expiresbytype expiresdefault extendedstatus extfilterdefine extfilteroptions fileetag filterchain filterdeclare filterprotocol filterprovider filtertrace forcelanguagepriority forcetype forensiclog gracefulshutdowntimeout group header headername hostnamelookups identitycheck identitychecktimeout imapbase imapdefault imapmenu include indexheadinsert indexignore indexoptions indexorderdefault indexstylesheet isapiappendlogtoerrors isapiappendlogtoquery isapicachefile isapifakeasync isapilognotsupported isapireadaheadbuffer keepalive keepalivetimeout languagepriority ldapcacheentries ldapcachettl ldapconnectiontimeout ldapopcacheentries ldapopcachettl ldapsharedcachefile ldapsharedcachesize ldaptrustedclientcert ldaptrustedglobalcert ldaptrustedmode ldapverifyservercert limitinternalrecursion limitrequestbody limitrequestfields limitrequestfieldsize limitrequestline limitxmlrequestbody listen listenbacklog loadfile loadmodule lockfile logformat loglevel maxclients maxkeepaliverequests maxmemfree maxrequestsperchild maxrequestsperthread maxspareservers maxsparethreads maxthreads mcachemaxobjectcount mcachemaxobjectsize mcachemaxstreamingbuffer mcacheminobjectsize mcacheremovalalgorithm mcachesize metadir metafiles metasuffix mimemagicfile minspareservers minsparethreads mmapfile mod_gzip_on mod_gzip_add_header_count mod_gzip_keep_workfiles mod_gzip_dechunk mod_gzip_min_http mod_gzip_minimum_file_size mod_gzip_maximum_file_size mod_gzip_maximum_inmem_size mod_gzip_temp_dir mod_gzip_item_include mod_gzip_item_exclude mod_gzip_command_version mod_gzip_can_negotiate mod_gzip_handle_methods mod_gzip_static_suffix mod_gzip_send_vary mod_gzip_update_static modmimeusepathinfo multiviewsmatch namevirtualhost noproxy nwssltrustedcerts nwsslupgradeable options order passenv pidfile protocolecho proxybadheader proxyblock proxydomain proxyerroroverride proxyftpdircharset proxyiobuffersize proxymaxforwards proxypass proxypassinterpolateenv proxypassmatch proxypassreverse proxypassreversecookiedomain proxypassreversecookiepath proxypreservehost proxyreceivebuffersize proxyremote proxyremotematch proxyrequests proxyset proxystatus proxytimeout proxyvia readmename receivebuffersize redirect redirectmatch redirectpermanent redirecttemp removecharset removeencoding removehandler removeinputfilter removelanguage removeoutputfilter removetype requestheader require rewritebase rewritecond rewriteengine rewritelock rewritelog rewriteloglevel rewritemap rewriteoptions rewriterule rlimitcpu rlimitmem rlimitnproc satisfy scoreboardfile script scriptalias scriptaliasmatch scriptinterpretersource scriptlog scriptlogbuffer scriptloglength scriptsock securelisten seerequesttail sendbuffersize serveradmin serveralias serverlimit servername serverpath serverroot serversignature servertokens setenv setenvif setenvifnocase sethandler setinputfilter setoutputfilter ssienableaccess ssiendtag ssierrormsg ssistarttag ssitimeformat ssiundefinedecho sslcacertificatefile sslcacertificatepath sslcadnrequestfile sslcadnrequestpath sslcarevocationfile sslcarevocationpath sslcertificatechainfile sslcertificatefile sslcertificatekeyfile sslciphersuite sslcryptodevice sslengine sslhonorciperorder sslmutex ssloptions sslpassphrasedialog sslprotocol sslproxycacertificatefile sslproxycacertificatepath sslproxycarevocationfile sslproxycarevocationpath sslproxyciphersuite sslproxyengine sslproxymachinecertificatefile sslproxymachinecertificatepath sslproxyprotocol sslproxyverify sslproxyverifydepth sslrandomseed sslrequire sslrequiressl sslsessioncache sslsessioncachetimeout sslusername sslverifyclient sslverifydepth startservers startthreads substitute suexecusergroup threadlimit threadsperchild threadstacksize timeout traceenable transferlog typesconfig unsetenv usecanonicalname usecanonicalphysicalport user userdir virtualdocumentroot virtualdocumentrootip virtualscriptalias virtualscriptaliasip win32disableacceptex xbithack",
literal: "on off"
},
c: [ e.HCM, {
cN: "sqbracket",
b: "\\s\\[",
e: "\\]$"
}, {
cN: "cbracket",
b: "[\\$%]\\{",
e: "\\}",
c: [ "self", t ]
}, t, {
cN: "tag",
b: "</?",
e: ">"
}, e.QSM ]
};
}(hljs), hljs.LANGUAGES.actionscript = function(e) {
var t = "[a-zA-Z_$][a-zA-Z0-9_$]*", n = "([*]|[a-zA-Z_$][a-zA-Z0-9_$]*)", i = {
cN: "rest_arg",
b: "[.]{3}",
e: t,
r: 10
}, o = {
cN: "title",
b: t
};
return {
k: {
keyword: "as break case catch class const continue default delete do dynamic each else extends final finally for function get if implements import in include instanceof interface internal is namespace native new override package private protected public return set static super switch this throw try typeof use var void while with",
literal: "true false null undefined"
},
c: [ e.ASM, e.QSM, e.CLCM, e.CBLCLM, e.CNM, {
cN: "package",
bWK: !0,
e: "{",
k: "package",
c: [ o ]
}, {
cN: "class",
bWK: !0,
e: "{",
k: "class interface",
c: [ {
bWK: !0,
k: "extends implements"
}, o ]
}, {
cN: "preprocessor",
bWK: !0,
e: ";",
k: "import include"
}, {
cN: "function",
bWK: !0,
e: "[{;]",
k: "function",
i: "\\S",
c: [ o, {
cN: "params",
b: "\\(",
e: "\\)",
c: [ e.ASM, e.QSM, e.CLCM, e.CBLCLM, i ]
}, {
cN: "type",
b: ":",
e: n,
r: 10
} ]
} ]
};
}(hljs), hljs.LANGUAGES.erlang = function(e) {
var t = "[a-z'][a-zA-Z0-9_']*", n = "(" + t + ":" + t + "|" + t + ")", i = {
keyword: "after and andalso|10 band begin bnot bor bsl bzr bxor case catch cond div end fun let not of orelse|10 query receive rem try when xor",
literal: "false true"
}, o = {
cN: "comment",
b: "%",
e: "$",
r: 0
}, r = {
cN: "number",
b: "\\b(\\d+#[a-fA-F0-9]+|\\d+(\\.\\d+)?([eE][-+]?\\d+)?)",
r: 0
}, s = {
b: "fun\\s+" + t + "/\\d+"
}, a = {
b: n + "\\(",
e: "\\)",
rB: !0,
r: 0,
c: [ {
cN: "function_name",
b: n,
r: 0
}, {
b: "\\(",
e: "\\)",
eW: !0,
rE: !0,
r: 0
} ]
}, l = {
cN: "tuple",
b: "{",
e: "}",
r: 0
}, c = {
cN: "variable",
b: "\\b_([A-Z][A-Za-z0-9_]*)?",
r: 0
}, u = {
cN: "variable",
b: "[A-Z][a-zA-Z0-9_]*",
r: 0
}, d = {
b: "#",
e: "}",
i: ".",
r: 0,
rB: !0,
c: [ {
cN: "record_name",
b: "#" + e.UIR,
r: 0
}, {
b: "{",
eW: !0,
r: 0
} ]
}, h = {
k: i,
b: "(fun|receive|if|try|case)",
e: "end"
};
h.c = [ o, s, e.inherit(e.ASM, {
cN: ""
}), h, a, e.QSM, r, l, c, u, d ];
var p = [ o, s, h, a, e.QSM, r, l, c, u, d ];
a.c[1].c = p, l.c = p, d.c[1].c = p;
var f = {
cN: "params",
b: "\\(",
e: "\\)",
c: p
};
return {
k: i,
i: "(</|\\*=|\\+=|-=|/=|/\\*|\\*/|\\(\\*|\\*\\))",
c: [ {
cN: "function",
b: "^" + t + "\\s*\\(",
e: "->",
rB: !0,
i: "\\(|#|//|/\\*|\\\\|:",
c: [ f, {
cN: "title",
b: t
} ],
starts: {
e: ";|\\.",
k: i,
c: p
}
}, o, {
cN: "pp",
b: "^-",
e: "\\.",
r: 0,
eE: !0,
rB: !0,
l: "-" + e.IR,
k: "-module -record -undef -export -ifdef -ifndef -author -copyright -doc -vsn -import -include -include_lib -compile -define -else -endif -file -behaviour -behavior",
c: [ f ]
}, r, e.QSM, d, c, u, l ]
};
}(hljs), hljs.LANGUAGES.rust = function(e) {
var t = {
cN: "title",
b: e.UIR
}, n = {
cN: "number",
b: "\\b(0[xb][A-Za-z0-9_]+|[0-9_]+(\\.[0-9_]+)?([uif](8|16|32|64)?)?)",
r: 0
}, i = "alt any as assert be bind block bool break char check claim const cont dir do else enum export f32 f64 fail false float fn for i16 i32 i64 i8 if iface impl import in int let log mod mutable native note of prove pure resource ret self str syntax true type u16 u32 u64 u8 uint unchecked unsafe use vec while";
return {
k: i,
i: "</",
c: [ e.CLCM, e.CBLCLM, e.inherit(e.QSM, {
i: null
}), e.ASM, n, {
cN: "function",
bWK: !0,
e: "(\\(|<)",
k: "fn",
c: [ t ]
}, {
cN: "preprocessor",
b: "#\\[",
e: "\\]"
}, {
bWK: !0,
e: "(=|<)",
k: "type",
c: [ t ],
i: "\\S"
}, {
bWK: !0,
e: "({|<)",
k: "iface enum",
c: [ t ],
i: "\\S"
} ]
};
}(hljs), hljs.LANGUAGES.avrasm = function(e) {
return {
cI: !0,
k: {
keyword: "adc add adiw and andi asr bclr bld brbc brbs brcc brcs break breq brge brhc brhs brid brie brlo brlt brmi brne brpl brsh brtc brts brvc brvs bset bst call cbi cbr clc clh cli cln clr cls clt clv clz com cp cpc cpi cpse dec eicall eijmp elpm eor fmul fmuls fmulsu icall ijmp in inc jmp ld ldd ldi lds lpm lsl lsr mov movw mul muls mulsu neg nop or ori out pop push rcall ret reti rjmp rol ror sbc sbr sbrc sbrs sec seh sbi sbci sbic sbis sbiw sei sen ser ses set sev sez sleep spm st std sts sub subi swap tst wdr",
built_in: "r0 r1 r2 r3 r4 r5 r6 r7 r8 r9 r10 r11 r12 r13 r14 r15 r16 r17 r18 r19 r20 r21 r22 r23 r24 r25 r26 r27 r28 r29 r30 r31 x|0 xh xl y|0 yh yl z|0 zh zl ucsr1c udr1 ucsr1a ucsr1b ubrr1l ubrr1h ucsr0c ubrr0h tccr3c tccr3a tccr3b tcnt3h tcnt3l ocr3ah ocr3al ocr3bh ocr3bl ocr3ch ocr3cl icr3h icr3l etimsk etifr tccr1c ocr1ch ocr1cl twcr twdr twar twsr twbr osccal xmcra xmcrb eicra spmcsr spmcr portg ddrg ping portf ddrf sreg sph spl xdiv rampz eicrb eimsk gimsk gicr eifr gifr timsk tifr mcucr mcucsr tccr0 tcnt0 ocr0 assr tccr1a tccr1b tcnt1h tcnt1l ocr1ah ocr1al ocr1bh ocr1bl icr1h icr1l tccr2 tcnt2 ocr2 ocdr wdtcr sfior eearh eearl eedr eecr porta ddra pina portb ddrb pinb portc ddrc pinc portd ddrd pind spdr spsr spcr udr0 ucsr0a ucsr0b ubrr0l acsr admux adcsr adch adcl porte ddre pine pinf"
},
c: [ e.CBLCLM, {
cN: "comment",
b: ";",
e: "$"
}, e.CNM, e.BNM, {
cN: "number",
b: "\\b(\\$[a-zA-Z0-9]+|0o[0-7]+)"
}, e.QSM, {
cN: "string",
b: "'",
e: "[^\\\\]'",
i: "[^\\\\][^']"
}, {
cN: "label",
b: "^[A-Za-z0-9_.$]+:"
}, {
cN: "preprocessor",
b: "#",
e: "$"
}, {
cN: "preprocessor",
b: "\\.[a-zA-Z]+"
}, {
cN: "localvars",
b: "@[0-9]+"
} ]
};
}(hljs), hljs.LANGUAGES.tex = function() {
var e = {
cN: "command",
b: "\\\\[a-zA-Zа-яА-я]+[\\*]?"
}, t = {
cN: "command",
b: "\\\\[^a-zA-Zа-яА-я0-9]"
}, n = {
cN: "special",
b: "[{}\\[\\]\\&#~]",
r: 0
};
return {
c: [ {
b: "\\\\[a-zA-Zа-яА-я]+[\\*]? *= *-?\\d*\\.?\\d+(pt|pc|mm|cm|in|dd|cc|ex|em)?",
rB: !0,
c: [ e, t, {
cN: "number",
b: " *=",
e: "-?\\d*\\.?\\d+(pt|pc|mm|cm|in|dd|cc|ex|em)?",
eB: !0
} ],
r: 10
}, e, t, n, {
cN: "formula",
b: "\\$\\$",
e: "\\$\\$",
c: [ e, t, n ],
r: 0
}, {
cN: "formula",
b: "\\$",
e: "\\$",
c: [ e, t, n ],
r: 0
}, {
cN: "comment",
b: "%",
e: "$",
r: 0
} ]
};
}(hljs), hljs.LANGUAGES.sql = function(e) {
return {
cI: !0,
c: [ {
cN: "operator",
b: "(begin|start|commit|rollback|savepoint|lock|alter|create|drop|rename|call|delete|do|handler|insert|load|replace|select|truncate|update|set|show|pragma|grant)\\b(?!:)",
e: ";",
eW: !0,
k: {
keyword: "all partial global month current_timestamp using go revoke smallint indicator end-exec disconnect zone with character assertion to add current_user usage input local alter match collate real then rollback get read timestamp session_user not integer bit unique day minute desc insert execute like ilike|2 level decimal drop continue isolation found where constraints domain right national some module transaction relative second connect escape close system_user for deferred section cast current sqlstate allocate intersect deallocate numeric public preserve full goto initially asc no key output collation group by union session both last language constraint column of space foreign deferrable prior connection unknown action commit view or first into float year primary cascaded except restrict set references names table outer open select size are rows from prepare distinct leading create only next inner authorization schema corresponding option declare precision immediate else timezone_minute external varying translation true case exception join hour default double scroll value cursor descriptor values dec fetch procedure delete and false int is describe char as at in varchar null trailing any absolute current_time end grant privileges when cross check write current_date pad begin temporary exec time update catalog user sql date on identity timezone_hour natural whenever interval work order cascade diagnostics nchar having left call do handler load replace truncate start lock show pragma exists number",
aggregate: "count sum min max avg"
},
c: [ {
cN: "string",
b: "'",
e: "'",
c: [ e.BE, {
b: "''"
} ],
r: 0
}, {
cN: "string",
b: '"',
e: '"',
c: [ e.BE, {
b: '""'
} ],
r: 0
}, {
cN: "string",
b: "`",
e: "`",
c: [ e.BE ]
}, e.CNM ]
}, e.CBLCLM, {
cN: "comment",
b: "--",
e: "$"
} ]
};
}(hljs), hljs.LANGUAGES.nginx = function(e) {
var t = [ {
cN: "variable",
b: "\\$\\d+"
}, {
cN: "variable",
b: "\\${",
e: "}"
}, {
cN: "variable",
b: "[\\$\\@]" + e.UIR
} ], n = {
eW: !0,
l: "[a-z/_]+",
k: {
built_in: "on off yes no true false none blocked debug info notice warn error crit select break last permanent redirect kqueue rtsig epoll poll /dev/poll"
},
r: 0,
i: "=>",
c: [ e.HCM, {
cN: "string",
b: '"',
e: '"',
c: [ e.BE ].concat(t),
r: 0
}, {
cN: "string",
b: "'",
e: "'",
c: [ e.BE ].concat(t),
r: 0
}, {
cN: "url",
b: "([a-z]+):/",
e: "\\s",
eW: !0,
eE: !0
}, {
cN: "regexp",
b: "\\s\\^",
e: "\\s|{|;",
rE: !0,
c: [ e.BE ].concat(t)
}, {
cN: "regexp",
b: "~\\*?\\s+",
e: "\\s|{|;",
rE: !0,
c: [ e.BE ].concat(t)
}, {
cN: "regexp",
b: "\\*(\\.[a-z\\-]+)+",
c: [ e.BE ].concat(t)
}, {
cN: "regexp",
b: "([a-z\\-]+\\.)+\\*",
c: [ e.BE ].concat(t)
}, {
cN: "number",
b: "\\b\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}(:\\d{1,5})?\\b"
}, {
cN: "number",
b: "\\b\\d+[kKmMgGdshdwy]*\\b",
r: 0
} ].concat(t)
};
return {
c: [ e.HCM, {
b: e.UIR + "\\s",
e: ";|{",
rB: !0,
c: [ {
cN: "title",
b: e.UIR,
starts: n
} ]
} ],
i: "[^\\s\\}]"
};
}(hljs), hljs.LANGUAGES.php = function(e) {
var t = {
cN: "variable",
b: "\\$+[a-zA-Z_-ÿ][a-zA-Z0-9_-ÿ]*"
}, n = [ e.inherit(e.ASM, {
i: null
}), e.inherit(e.QSM, {
i: null
}), {
cN: "string",
b: 'b"',
e: '"',
c: [ e.BE ]
}, {
cN: "string",
b: "b'",
e: "'",
c: [ e.BE ]
} ], i = [ e.BNM, e.CNM ], o = {
cN: "title",
b: e.UIR
};
return {
cI: !0,
k: "and include_once list abstract global private echo interface as static endswitch array null if endwhile or const for endforeach self var while isset public protected exit foreach throw elseif include __FILE__ empty require_once do xor return implements parent clone use __CLASS__ __LINE__ else break print eval new catch __METHOD__ case exception php_user_filter default die require __FUNCTION__ enddeclare final try this switch continue endfor endif declare unset true false namespace trait goto instanceof insteadof __DIR__ __NAMESPACE__ __halt_compiler",
c: [ e.CLCM, e.HCM, {
cN: "comment",
b: "/\\*",
e: "\\*/",
c: [ {
cN: "phpdoc",
b: "\\s@[A-Za-z]+"
} ]
}, {
cN: "comment",
eB: !0,
b: "__halt_compiler.+?;",
eW: !0
}, {
cN: "string",
b: "<<<['\"]?\\w+['\"]?$",
e: "^\\w+;",
c: [ e.BE ]
}, {
cN: "preprocessor",
b: "<\\?php",
r: 10
}, {
cN: "preprocessor",
b: "\\?>"
}, t, {
cN: "function",
bWK: !0,
e: "{",
k: "function",
i: "\\$|\\[|%",
c: [ o, {
cN: "params",
b: "\\(",
e: "\\)",
c: [ "self", t, e.CBLCLM ].concat(n).concat(i)
} ]
}, {
cN: "class",
bWK: !0,
e: "{",
k: "class",
i: "[:\\(\\$]",
c: [ {
bWK: !0,
eW: !0,
k: "extends",
c: [ o ]
}, o ]
}, {
b: "=>"
} ].concat(n).concat(i)
};
}(hljs), hljs.LANGUAGES.cpp = function(e) {
var t = {
keyword: "false int float while private char catch export virtual operator sizeof dynamic_cast|10 typedef const_cast|10 const struct for static_cast|10 union namespace unsigned long throw volatile static protected bool template mutable if public friend do return goto auto void enum else break new extern using true class asm case typeid short reinterpret_cast|10 default double register explicit signed typename try this switch continue wchar_t inline delete alignof char16_t char32_t constexpr decltype noexcept nullptr static_assert thread_local restrict _Bool complex",
built_in: "std string cin cout cerr clog stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap array shared_ptr"
};
return {
k: t,
i: "</",
c: [ e.CLCM, e.CBLCLM, e.QSM, {
cN: "string",
b: "'\\\\?.",
e: "'",
i: "."
}, {
cN: "number",
b: "\\b(\\d+(\\.\\d*)?|\\.\\d+)(u|U|l|L|ul|UL|f|F)"
}, e.CNM, {
cN: "preprocessor",
b: "#",
e: "$"
}, {
cN: "stl_container",
b: "\\b(deque|list|queue|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array)\\s*<",
e: ">",
k: t,
r: 10,
c: [ "self" ]
} ]
};
}(hljs), hljs.LANGUAGES.xml = function() {
var e = "[A-Za-z0-9\\._:-]+", t = {
eW: !0,
c: [ {
cN: "attribute",
b: e,
r: 0
}, {
b: '="',
rB: !0,
e: '"',
c: [ {
cN: "value",
b: '"',
eW: !0
} ]
}, {
b: "='",
rB: !0,
e: "'",
c: [ {
cN: "value",
b: "'",
eW: !0
} ]
}, {
b: "=",
c: [ {
cN: "value",
b: "[^\\s/>]+"
} ]
} ]
};
return {
cI: !0,
c: [ {
cN: "pi",
b: "<\\?",
e: "\\?>",
r: 10
}, {
cN: "doctype",
b: "<!DOCTYPE",
e: ">",
r: 10,
c: [ {
b: "\\[",
e: "\\]"
} ]
}, {
cN: "comment",
b: "<!--",
e: "-->",
r: 10
}, {
cN: "cdata",
b: "<\\!\\[CDATA\\[",
e: "\\]\\]>",
r: 10
}, {
cN: "tag",
b: "<style(?=\\s|>|$)",
e: ">",
k: {
title: "style"
},
c: [ t ],
starts: {
e: "</style>",
rE: !0,
sL: "css"
}
}, {
cN: "tag",
b: "<script(?=\\s|>|$)",
e: ">",
k: {
title: "script"
},
c: [ t ],
starts: {
e: "</script>",
rE: !0,
sL: "javascript"
}
}, {
b: "<%",
e: "%>",
sL: "vbscript"
}, {
cN: "tag",
b: "</?",
e: "/?>",
c: [ {
cN: "title",
b: "[^ />]+"
}, t ]
} ]
};
}(hljs), hljs.LANGUAGES.parser3 = function(e) {
return {
sL: "xml",
c: [ {
cN: "comment",
b: "^#",
e: "$"
}, {
cN: "comment",
b: "\\^rem{",
e: "}",
r: 10,
c: [ {
b: "{",
e: "}",
c: [ "self" ]
} ]
}, {
cN: "preprocessor",
b: "^@(?:BASE|USE|CLASS|OPTIONS)$",
r: 10
}, {
cN: "title",
b: "@[\\w\\-]+\\[[\\w^;\\-]*\\](?:\\[[\\w^;\\-]*\\])?(?:.*)$"
}, {
cN: "variable",
b: "\\$\\{?[\\w\\-\\.\\:]+\\}?"
}, {
cN: "keyword",
b: "\\^[\\w\\-\\.\\:]+"
}, {
cN: "number",
b: "\\^#[0-9a-fA-F]+"
}, e.CNM ]
};
}(hljs), hljs.LANGUAGES.css = function(e) {
var t = {
cN: "function",
b: e.IR + "\\(",
e: "\\)",
c: [ e.NM, e.ASM, e.QSM ]
};
return {
cI: !0,
i: "[=/|']",
c: [ e.CBLCLM, {
cN: "id",
b: "\\#[A-Za-z0-9_-]+"
}, {
cN: "class",
b: "\\.[A-Za-z0-9_-]+",
r: 0
}, {
cN: "attr_selector",
b: "\\[",
e: "\\]",
i: "$"
}, {
cN: "pseudo",
b: ":(:)?[a-zA-Z0-9\\_\\-\\+\\(\\)\\\"\\']+"
}, {
cN: "at_rule",
b: "@(font-face|page)",
l: "[a-z-]+",
k: "font-face page"
}, {
cN: "at_rule",
b: "@",
e: "[{;]",
eE: !0,
k: "import page media charset",
c: [ t, e.ASM, e.QSM, e.NM ]
}, {
cN: "tag",
b: e.IR,
r: 0
}, {
cN: "rules",
b: "{",
e: "}",
i: "[^\\s]",
r: 0,
c: [ e.CBLCLM, {
cN: "rule",
b: "[^\\s]",
rB: !0,
e: ";",
eW: !0,
c: [ {
cN: "attribute",
b: "[A-Z\\_\\.\\-]+",
e: ":",
eE: !0,
i: "[^\\s]",
starts: {
cN: "value",
eW: !0,
eE: !0,
c: [ t, e.NM, e.QSM, e.ASM, e.CBLCLM, {
cN: "hexcolor",
b: "\\#[0-9A-F]+"
}, {
cN: "important",
b: "!important"
} ]
}
} ]
} ]
} ]
};
}(hljs), hljs.LANGUAGES.axapta = function(e) {
return {
k: "false int abstract private char interface boolean static null if for true while long throw finally protected extends final implements return void enum else break new catch byte super class case short default double public try this switch continue reverse firstfast firstonly forupdate nofetch sum avg minof maxof count order group by asc desc index hint like dispaly edit client server ttsbegin ttscommit str real date container anytype common div mod",
c: [ e.CLCM, e.CBLCLM, e.ASM, e.QSM, e.CNM, {
cN: "preprocessor",
b: "#",
e: "$"
}, {
cN: "class",
bWK: !0,
e: "{",
i: ":",
k: "class interface",
c: [ {
cN: "inheritance",
bWK: !0,
k: "extends implements",
r: 10
}, {
cN: "title",
b: e.UIR
} ]
} ]
};
}(hljs), hljs.LANGUAGES.ini = function(e) {
return {
cI: !0,
i: "[^\\s]",
c: [ {
cN: "comment",
b: ";",
e: "$"
}, {
cN: "title",
b: "^\\[",
e: "\\]"
}, {
cN: "setting",
b: "^[a-z0-9\\[\\]_-]+[ \\t]*=[ \\t]*",
e: "$",
c: [ {
cN: "value",
eW: !0,
k: "on off true false yes no",
c: [ e.QSM, e.NM ]
} ]
} ]
};
}(hljs), hljs.LANGUAGES.matlab = function(e) {
var t = [ e.CNM, {
cN: "string",
b: "'",
e: "'",
c: [ e.BE, {
b: "''"
} ],
r: 0
} ];
return {
k: {
keyword: "break case catch classdef continue else elseif end enumerated events for function global if methods otherwise parfor persistent properties return spmd switch try while",
built_in: "sin sind sinh asin asind asinh cos cosd cosh acos acosd acosh tan tand tanh atan atand atan2 atanh sec secd sech asec asecd asech csc cscd csch acsc acscd acsch cot cotd coth acot acotd acoth hypot exp expm1 log log1p log10 log2 pow2 realpow reallog realsqrt sqrt nthroot nextpow2 abs angle complex conj imag real unwrap isreal cplxpair fix floor ceil round mod rem sign airy besselj bessely besselh besseli besselk beta betainc betaln ellipj ellipke erf erfc erfcx erfinv expint gamma gammainc gammaln psi legendre cross dot factor isprime primes gcd lcm rat rats perms nchoosek factorial cart2sph cart2pol pol2cart sph2cart hsv2rgb rgb2hsv zeros ones eye repmat rand randn linspace logspace freqspace meshgrid accumarray size length ndims numel disp isempty isequal isequalwithequalnans cat reshape diag blkdiag tril triu fliplr flipud flipdim rot90 find sub2ind ind2sub bsxfun ndgrid permute ipermute shiftdim circshift squeeze isscalar isvector ans eps realmax realmin pi i inf nan isnan isinf isfinite j why compan gallery hadamard hankel hilb invhilb magic pascal rosser toeplitz vander wilkinson"
},
i: '(//|"|#|/\\*|\\s+/\\w+)',
c: [ {
cN: "function",
bWK: !0,
e: "$",
k: "function",
c: [ {
cN: "title",
b: e.UIR
}, {
cN: "params",
b: "\\(",
e: "\\)"
}, {
cN: "params",
b: "\\[",
e: "\\]"
} ]
}, {
cN: "transposed_variable",
b: "[a-zA-Z_][a-zA-Z_0-9]*('+[\\.']*|[\\.']+)",
e: ""
}, {
cN: "matrix",
b: "\\[",
e: "\\]'*[\\.']*",
c: t
}, {
cN: "cell",
b: "\\{",
e: "\\}'*[\\.']*",
c: t
}, {
cN: "comment",
b: "\\%",
e: "$"
} ].concat(t)
};
}(hljs), hljs.LANGUAGES.d = function(e) {
var t = {
keyword: "abstract alias align asm assert auto body break byte case cast catch class const continue debug default delete deprecated do else enum export extern final finally for foreach foreach_reverse|10 goto if immutable import in inout int interface invariant is lazy macro mixin module new nothrow out override package pragma private protected public pure ref return scope shared static struct super switch synchronized template this throw try typedef typeid typeof union unittest version void volatile while with __FILE__ __LINE__ __gshared|10 __thread __traits __DATE__ __EOF__ __TIME__ __TIMESTAMP__ __VENDOR__ __VERSION__",
built_in: "bool cdouble cent cfloat char creal dchar delegate double dstring float function idouble ifloat ireal long real short string ubyte ucent uint ulong ushort wchar wstring",
literal: "false null true"
}, n = "(0|[1-9][\\d_]*)", i = "(0|[1-9][\\d_]*|\\d[\\d_]*|[\\d_]+?\\d)", o = "0[bB][01_]+", r = "([\\da-fA-F][\\da-fA-F_]*|_[\\da-fA-F][\\da-fA-F_]*)", s = "0[xX]" + r, a = "([eE][+-]?" + i + ")", l = "(" + i + "(\\.\\d*|" + a + ")|\\d+\\." + i + i + "|\\." + n + a + "?)", c = "(0[xX](" + r + "\\." + r + "|\\.?" + r + ")[pP][+-]?" + i + ")", u = "(" + n + "|" + o + "|" + s + ")", d = "(" + c + "|" + l + ")", h = "\\\\(['\"\\?\\\\abfnrtv]|u[\\dA-Fa-f]{4}|[0-7]{1,3}|x[\\dA-Fa-f]{2}|U[\\dA-Fa-f]{8})|&[a-zA-Z\\d]{2,};", p = {
cN: "number",
b: "\\b" + u + "(L|u|U|Lu|LU|uL|UL)?",
r: 0
}, f = {
cN: "number",
b: "\\b(" + d + "([fF]|L|i|[fF]i|Li)?|" + u + "(i|[fF]i|Li))",
r: 0
}, g = {
cN: "string",
b: "'(" + h + "|.)",
e: "'",
i: "."
}, m = {
b: h,
r: 0
}, v = {
cN: "string",
b: '"',
c: [ m ],
e: '"[cwd]?',
r: 0
}, b = {
cN: "string",
b: '[rq]"',
e: '"[cwd]?',
r: 5
}, y = {
cN: "string",
b: "`",
e: "`[cwd]?"
}, w = {
cN: "string",
b: 'x"[\\da-fA-F\\s\\n\\r]*"[cwd]?',
r: 10
}, C = {
cN: "string",
b: 'q"\\{',
e: '\\}"'
}, x = {
cN: "shebang",
b: "^#!",
e: "$",
r: 5
}, E = {
cN: "preprocessor",
b: "#(line)",
e: "$",
r: 5
}, S = {
cN: "keyword",
b: "@[a-zA-Z_][a-zA-Z_\\d]*"
}, A = {
cN: "comment",
b: "\\/\\+",
c: [ "self" ],
e: "\\+\\/",
r: 10
};
return {
l: e.UIR,
k: t,
c: [ e.CLCM, e.CBLCLM, A, w, v, b, y, C, f, p, g, x, E, S ]
};
}(hljs), hljs.LANGUAGES.profile = function(e) {
return {
c: [ e.CNM, {
cN: "builtin",
b: "{",
e: "}$",
eB: !0,
eE: !0,
c: [ e.ASM, e.QSM ],
r: 0
}, {
cN: "filename",
b: "[a-zA-Z_][\\da-zA-Z_]+\\.[\\da-zA-Z_]{1,3}",
e: ":",
eE: !0
}, {
cN: "header",
b: "(ncalls|tottime|cumtime)",
e: "$",
k: "ncalls tottime|10 cumtime|10 filename",
r: 10
}, {
cN: "summary",
b: "function calls",
e: "$",
c: [ e.CNM ],
r: 10
}, e.ASM, e.QSM, {
cN: "function",
b: "\\(",
e: "\\)$",
c: [ {
cN: "title",
b: e.UIR,
r: 0
} ],
r: 0
} ]
};
}(hljs), hljs.LANGUAGES.javascript = function(e) {
return {
k: {
keyword: "in if for while finally var new function do return void else break catch instanceof with throw case default try this switch continue typeof delete let yield const",
literal: "true false null undefined NaN Infinity"
},
c: [ e.ASM, e.QSM, e.CLCM, e.CBLCLM, e.CNM, {
b: "(" + e.RSR + "|\\b(case|return|throw)\\b)\\s*",
k: "return throw case",
c: [ e.CLCM, e.CBLCLM, {
cN: "regexp",
b: "/",
e: "/[gim]*",
i: "\\n",
c: [ {
b: "\\\\/"
} ]
}, {
b: "<",
e: ">;",
sL: "xml"
} ],
r: 0
}, {
cN: "function",
bWK: !0,
e: "{",
k: "function",
c: [ {
cN: "title",
b: "[A-Za-z$_][0-9A-Za-z$_]*"
}, {
cN: "params",
b: "\\(",
e: "\\)",
c: [ e.CLCM, e.CBLCLM ],
i: "[\"'\\(]"
} ],
i: "\\[|%"
} ]
};
}(hljs), hljs.LANGUAGES.bash = function(e) {
var t = "true false", n = "if then else elif fi for break continue while in do done echo exit return set declare", i = {
cN: "variable",
b: "\\$[a-zA-Z0-9_#]+"
}, o = {
cN: "variable",
b: "\\${([^}]|\\\\})+}"
}, r = {
cN: "string",
b: '"',
e: '"',
i: "\\n",
c: [ e.BE, i, o ],
r: 0
}, s = {
cN: "string",
b: "'",
e: "'",
c: [ {
b: "''"
} ],
r: 0
}, a = {
cN: "test_condition",
b: "",
e: "",
c: [ r, s, i, o ],
k: {
literal: t
},
r: 0
};
return {
k: {
keyword: n,
literal: t
},
c: [ {
cN: "shebang",
b: "(#!\\/bin\\/bash)|(#!\\/bin\\/sh)",
r: 10
}, i, o, e.HCM, r, s, e.inherit(a, {
b: "\\[ ",
e: " \\]",
r: 0
}), e.inherit(a, {
b: "\\[\\[ ",
e: " \\]\\]"
}) ]
};
}(hljs), hljs.LANGUAGES.django = function(e) {
function t(e, t) {
return void 0 == t || !e.cN && "tag" == t.cN || "value" == e.cN;
}
function n(e, i) {
var r = {};
for (var s in e) {
"contains" != s && (r[s] = e[s]);
for (var a = [], l = 0; e.c && l < e.c.length; l++) a.push(n(e.c[l], e));
t(e, i) && (a = o.concat(a)), a.length && (r.c = a);
}
return r;
}
var i = {
cN: "filter",
b: "\\|[A-Za-z]+\\:?",
eE: !0,
k: "truncatewords removetags linebreaksbr yesno get_digit timesince random striptags filesizeformat escape linebreaks length_is ljust rjust cut urlize fix_ampersands title floatformat capfirst pprint divisibleby add make_list unordered_list urlencode timeuntil urlizetrunc wordcount stringformat linenumbers slice date dictsort dictsortreversed default_if_none pluralize lower join center default truncatewords_html upper length phone2numeric wordwrap time addslashes slugify first escapejs force_escape iriencode last safe safeseq truncatechars localize unlocalize localtime utc timezone",
c: [ {
cN: "argument",
b: '"',
e: '"'
} ]
}, o = [ {
cN: "template_comment",
b: "{%\\s*comment\\s*%}",
e: "{%\\s*endcomment\\s*%}"
}, {
cN: "template_comment",
b: "{#",
e: "#}"
}, {
cN: "template_tag",
b: "{%",
e: "%}",
k: "comment endcomment load templatetag ifchanged endifchanged if endif firstof for endfor in ifnotequal endifnotequal widthratio extends include spaceless endspaceless regroup by as ifequal endifequal ssi now with cycle url filter endfilter debug block endblock else autoescape endautoescape csrf_token empty elif endwith static trans blocktrans endblocktrans get_static_prefix get_media_prefix plural get_current_language language get_available_languages get_current_language_bidi get_language_info get_language_info_list localize endlocalize localtime endlocaltime timezone endtimezone get_current_timezone",
c: [ i ]
}, {
cN: "variable",
b: "{{",
e: "}}",
c: [ i ]
} ], r = n(e.LANGUAGES.xml);
return r.cI = !0, r;
}(hljs), hljs.LANGUAGES.smalltalk = function(e) {
var t = "[a-z][a-zA-Z0-9_]*", n = {
cN: "char",
b: "\\$.{1}"
}, i = {
cN: "symbol",
b: "#" + e.UIR
};
return {
k: "self super nil true false thisContext",
c: [ {
cN: "comment",
b: '"',
e: '"',
r: 0
}, e.ASM, {
cN: "class",
b: "\\b[A-Z][A-Za-z0-9_]*",
r: 0
}, {
cN: "method",
b: t + ":"
}, e.CNM, i, n, {
cN: "localvars",
b: "\\|\\s*((" + t + ")\\s*)+\\|"
}, {
cN: "array",
b: "\\#\\(",
e: "\\)",
c: [ e.ASM, n, e.CNM, i ]
} ]
};
}(hljs), hljs.LANGUAGES.markdown = function() {
return {
c: [ {
cN: "header",
b: "^#{1,3}",
e: "$"
}, {
cN: "header",
b: "^.+?\\n[=-]{2,}$"
}, {
b: "<",
e: ">",
sL: "xml",
r: 0
}, {
cN: "bullet",
b: "^([*+-]|(\\d+\\.))\\s+"
}, {
cN: "strong",
b: "[*_]{2}.+?[*_]{2}"
}, {
cN: "emphasis",
b: "\\*.+?\\*"
}, {
cN: "emphasis",
b: "_.+?_",
r: 0
}, {
cN: "blockquote",
b: "^>\\s+",
e: "$"
}, {
cN: "code",
b: "`.+?`"
}, {
cN: "code",
b: "^ ",
e: "$",
r: 0
}, {
cN: "horizontal_rule",
b: "^-{3,}",
e: "$"
}, {
b: "\\[.+?\\]\\(.+?\\)",
rB: !0,
c: [ {
cN: "link_label",
b: "\\[.+\\]"
}, {
cN: "link_url",
b: "\\(",
e: "\\)",
eB: !0,
eE: !0
} ]
} ]
};
}(hljs), hljs.LANGUAGES.diff = function() {
return {
c: [ {
cN: "chunk",
b: "^\\@\\@ +\\-\\d+,\\d+ +\\+\\d+,\\d+ +\\@\\@$",
r: 10
}, {
cN: "chunk",
b: "^\\*\\*\\* +\\d+,\\d+ +\\*\\*\\*\\*$",
r: 10
}, {
cN: "chunk",
b: "^\\-\\-\\- +\\d+,\\d+ +\\-\\-\\-\\-$",
r: 10
}, {
cN: "header",
b: "Index: ",
e: "$"
}, {
cN: "header",
b: "=====",
e: "=====$"
}, {
cN: "header",
b: "^\\-\\-\\-",
e: "$"
}, {
cN: "header",
b: "^\\*{3} ",
e: "$"
}, {
cN: "header",
b: "^\\+\\+\\+",
e: "$"
}, {
cN: "header",
b: "\\*{5}",
e: "\\*{5}$"
}, {
cN: "addition",
b: "^\\+",
e: "$"
}, {
cN: "deletion",
b: "^\\-",
e: "$"
}, {
cN: "change",
b: "^\\!",
e: "$"
} ]
};
}(hljs), hljs.LANGUAGES.json = function(e) {
var t = {
literal: "true false null"
}, n = [ e.QSM, e.CNM ], i = {
cN: "value",
e: ",",
eW: !0,
eE: !0,
c: n,
k: t
}, o = {
b: "{",
e: "}",
c: [ {
cN: "attribute",
b: '\\s*"',
e: '"\\s*:\\s*',
eB: !0,
eE: !0,
c: [ e.BE ],
i: "\\n",
starts: i
} ],
i: "\\S"
}, r = {
b: "\\[",
e: "\\]",
c: [ e.inherit(i, {
cN: null
}) ],
i: "\\S"
};
return n.splice(n.length, 0, o, r), {
c: n,
k: t,
i: "\\S"
};
}(hljs), hljs.LANGUAGES.vbscript = function(e) {
return {
cI: !0,
k: {
keyword: "call class const dim do loop erase execute executeglobal exit for each next function if then else on error option explicit new private property let get public randomize redim rem select case set stop sub while wend with end to elseif is or xor and not class_initialize class_terminate default preserve in me byval byref step resume goto",
built_in: "lcase month vartype instrrev ubound setlocale getobject rgb getref string weekdayname rnd dateadd monthname now day minute isarray cbool round formatcurrency conversions csng timevalue second year space abs clng timeserial fixs len asc isempty maths dateserial atn timer isobject filter weekday datevalue ccur isdate instr datediff formatdatetime replace isnull right sgn array snumeric log cdbl hex chr lbound msgbox ucase getlocale cos cdate cbyte rtrim join hour oct typename trim strcomp int createobject loadpicture tan formatnumber mid scriptenginebuildversion scriptengine split scriptengineminorversion cint sin datepart ltrim sqr scriptenginemajorversion time derived eval date formatpercent exp inputbox left ascw chrw regexp server response request cstr err",
literal: "true false null nothing empty"
},
i: "//",
c: [ e.inherit(e.QSM, {
c: [ {
b: '""'
} ]
}), {
cN: "comment",
b: "'",
e: "$"
}, e.CNM ]
};
}(hljs), hljs.LANGUAGES.haskell = function(e) {
var t = {
cN: "type",
b: "\\b[A-Z][\\w']*",
r: 0
}, n = {
cN: "container",
b: "\\(",
e: "\\)",
c: [ {
cN: "type",
b: "\\b[A-Z][\\w]*(\\((\\.\\.|,|\\w+)\\))?"
}, {
cN: "title",
b: "[_a-z][\\w']*"
} ]
}, i = {
cN: "container",
b: "{",
e: "}",
c: n.c
};
return {
k: "let in if then else case of where do module import hiding qualified type data newtype deriving class instance not as foreign ccall safe unsafe",
c: [ {
cN: "comment",
b: "--",
e: "$"
}, {
cN: "preprocessor",
b: "{-#",
e: "#-}"
}, {
cN: "comment",
c: [ "self" ],
b: "{-",
e: "-}"
}, {
cN: "string",
b: "\\s+'",
e: "'",
c: [ e.BE ],
r: 0
}, e.QSM, {
cN: "import",
b: "\\bimport",
e: "$",
k: "import qualified as hiding",
c: [ n ],
i: "\\W\\.|;"
}, {
cN: "module",
b: "\\bmodule",
e: "where",
k: "module where",
c: [ n ],
i: "\\W\\.|;"
}, {
cN: "class",
b: "\\b(class|instance)",
e: "where",
k: "class where instance",
c: [ t ]
}, {
cN: "typedef",
b: "\\b(data|(new)?type)",
e: "$",
k: "data type newtype deriving",
c: [ t, n, i ]
}, e.CNM, {
cN: "shebang",
b: "#!\\/usr\\/bin\\/env runhaskell",
e: "$"
}, t, {
cN: "title",
b: "^[_a-z][\\w']*"
} ]
};
}(hljs), hljs.LANGUAGES.coffeescript = function(e) {
var t = {
keyword: "in if for while finally new do return else break catch instanceof throw try this switch continue typeof delete debugger super then unless until loop of by when and or is isnt not",
literal: "true false null undefined yes no on off ",
reserved: "case default function var void with const let enum export import native __hasProp __extends __slice __bind __indexOf"
}, n = "[A-Za-z$_][0-9A-Za-z$_]*", i = {
cN: "title",
b: n
}, o = {
cN: "subst",
b: "#\\{",
e: "}",
k: t,
c: [ e.BNM, e.CNM ]
};
return {
k: t,
c: [ e.BNM, e.CNM, e.ASM, {
cN: "string",
b: '"""',
e: '"""',
c: [ e.BE, o ]
}, {
cN: "string",
b: '"',
e: '"',
c: [ e.BE, o ],
r: 0
}, {
cN: "comment",
b: "###",
e: "###"
}, e.HCM, {
cN: "regexp",
b: "///",
e: "///",
c: [ e.HCM ]
}, {
cN: "regexp",
b: "//[gim]*"
}, {
cN: "regexp",
b: "/\\S(\\\\.|[^\\n])*/[gim]*"
}, {
b: "`",
e: "`",
eB: !0,
eE: !0,
sL: "javascript"
}, {
cN: "function",
b: n + "\\s*=\\s*(\\(.+\\))?\\s*[-=]>",
rB: !0,
c: [ i, {
cN: "params",
b: "\\(",
e: "\\)"
} ]
}, {
cN: "class",
bWK: !0,
k: "class",
e: "$",
i: ":",
c: [ {
bWK: !0,
k: "extends",
eW: !0,
i: ":",
c: [ i ]
}, i ]
}, {
cN: "property",
b: "@" + n
} ]
};
}(hljs), hljs.LANGUAGES.python = function(e) {
var t = {
cN: "prompt",
b: "^(>>>|\\.\\.\\.) "
}, n = [ {
cN: "string",
b: "(u|b)?r?'''",
e: "'''",
c: [ t ],
r: 10
}, {
cN: "string",
b: '(u|b)?r?"""',
e: '"""',
c: [ t ],
r: 10
}, {
cN: "string",
b: "(u|r|ur)'",
e: "'",
c: [ e.BE ],
r: 10
}, {
cN: "string",
b: '(u|r|ur)"',
e: '"',
c: [ e.BE ],
r: 10
}, {
cN: "string",
b: "(b|br)'",
e: "'",
c: [ e.BE ]
}, {
cN: "string",
b: '(b|br)"',
e: '"',
c: [ e.BE ]
} ].concat([ e.ASM, e.QSM ]), i = {
cN: "title",
b: e.UIR
}, o = {
cN: "params",
b: "\\(",
e: "\\)",
c: [ "self", e.CNM, t ].concat(n)
}, r = {
bWK: !0,
e: ":",
i: "[${=;\\n]",
c: [ i, o ],
r: 10
};
return {
k: {
keyword: "and elif is global as in if from raise for except finally print import pass return exec else break not with class assert yield try while continue del or def lambda nonlocal|10",
built_in: "None True False Ellipsis NotImplemented"
},
i: "(</|->|\\?)",
c: n.concat([ t, e.HCM, e.inherit(r, {
cN: "function",
k: "def"
}), e.inherit(r, {
cN: "class",
k: "class"
}), e.CNM, {
cN: "decorator",
b: "@",
e: "$"
}, {
b: "\\b(print|exec)\\("
} ])
};
}(hljs), hljs.LANGUAGES.cmake = function(e) {
return {
cI: !0,
k: "add_custom_command add_custom_target add_definitions add_dependencies add_executable add_library add_subdirectory add_test aux_source_directory break build_command cmake_minimum_required cmake_policy configure_file create_test_sourcelist define_property else elseif enable_language enable_testing endforeach endfunction endif endmacro endwhile execute_process export find_file find_library find_package find_path find_program fltk_wrap_ui foreach function get_cmake_property get_directory_property get_filename_component get_property get_source_file_property get_target_property get_test_property if include include_directories include_external_msproject include_regular_expression install link_directories load_cache load_command macro mark_as_advanced message option output_required_files project qt_wrap_cpp qt_wrap_ui remove_definitions return separate_arguments set set_directory_properties set_property set_source_files_properties set_target_properties set_tests_properties site_name source_group string target_link_libraries try_compile try_run unset variable_watch while build_name exec_program export_library_dependencies install_files install_programs install_targets link_libraries make_directory remove subdir_depends subdirs use_mangled_mesa utility_source variable_requires write_file",
c: [ {
cN: "envvar",
b: "\\${",
e: "}"
}, e.HCM, e.QSM, e.NM ]
};
}(hljs), hljs.LANGUAGES.lua = function(e) {
var t = "\\[=*\\[", n = "\\]=*\\]", i = {
b: t,
e: n,
c: [ "self" ]
}, o = [ {
cN: "comment",
b: "--(?!" + t + ")",
e: "$"
}, {
cN: "comment",
b: "--" + t,
e: n,
c: [ i ],
r: 10
} ];
return {
l: e.UIR,
k: {
keyword: "and break do else elseif end false for if in local nil not or repeat return then true until while",
built_in: "_G _VERSION assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall coroutine debug io math os package string table"
},
c: o.concat([ {
cN: "function",
bWK: !0,
e: "\\)",
k: "function",
c: [ {
cN: "title",
b: "([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"
}, {
cN: "params",
b: "\\(",
eW: !0,
c: o
} ].concat(o)
}, e.CNM, e.ASM, e.QSM, {
cN: "string",
b: t,
e: n,
c: [ i ],
r: 10
} ])
};
}(hljs), hljs.LANGUAGES.r = function(e) {
var t = "([a-zA-Z]|\\.[a-zA-Z.])[a-zA-Z0-9._]*";
return {
c: [ e.HCM, {
b: t,
l: t,
k: {
keyword: "function if in break next repeat else for return switch while try tryCatch|10 stop warning require library attach detach source setMethod setGeneric setGroupGeneric setClass ...|10",
literal: "NULL NA TRUE FALSE T F Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10"
},
r: 0
}, {
cN: "number",
b: "0[xX][0-9a-fA-F]+[Li]?\\b",
r: 0
}, {
cN: "number",
b: "\\d+(?:[eE][+\\-]?\\d*)?L\\b",
r: 0
}, {
cN: "number",
b: "\\d+\\.(?!\\d)(?:i\\b)?",
r: 0
}, {
cN: "number",
b: "\\d+(?:\\.\\d*)?(?:[eE][+\\-]?\\d*)?i?\\b",
r: 0
}, {
cN: "number",
b: "\\.\\d+(?:[eE][+\\-]?\\d*)?i?\\b",
r: 0
}, {
b: "`",
e: "`",
r: 0
}, {
cN: "string",
b: '"',
e: '"',
c: [ e.BE ],
r: 0
}, {
cN: "string",
b: "'",
e: "'",
c: [ e.BE ],
r: 0
} ]
};
}(hljs), hljs.LANGUAGES.http = function() {
return {
i: "\\S",
c: [ {
cN: "status",
b: "^HTTP/[0-9\\.]+",
e: "$",
c: [ {
cN: "number",
b: "\\b\\d{3}\\b"
} ]
}, {
cN: "request",
b: "^[A-Z]+ (.*?) HTTP/[0-9\\.]+$",
rB: !0,
e: "$",
c: [ {
cN: "string",
b: " ",
e: " ",
eB: !0,
eE: !0
} ]
}, {
cN: "attribute",
b: "^\\w",
e: ": ",
eE: !0,
i: "\\n|\\s|=",
starts: {
cN: "string",
e: "$"
}
}, {
b: "\\n\\n",
starts: {
sL: "",
eW: !0
}
} ]
};
}(hljs), hljs.LANGUAGES.mel = function(e) {
return {
k: "int float string vector matrix if else switch case default while do for in break continue global proc return about abs addAttr addAttributeEditorNodeHelp addDynamic addNewShelfTab addPP addPanelCategory addPrefixToName advanceToNextDrivenKey affectedNet affects aimConstraint air alias aliasAttr align alignCtx alignCurve alignSurface allViewFit ambientLight angle angleBetween animCone animCurveEditor animDisplay animView annotate appendStringArray applicationName applyAttrPreset applyTake arcLenDimContext arcLengthDimension arclen arrayMapper art3dPaintCtx artAttrCtx artAttrPaintVertexCtx artAttrSkinPaintCtx artAttrTool artBuildPaintMenu artFluidAttrCtx artPuttyCtx artSelectCtx artSetPaintCtx artUserPaintCtx assignCommand assignInputDevice assignViewportFactories attachCurve attachDeviceAttr attachSurface attrColorSliderGrp attrCompatibility attrControlGrp attrEnumOptionMenu attrEnumOptionMenuGrp attrFieldGrp attrFieldSliderGrp attrNavigationControlGrp attrPresetEditWin attributeExists attributeInfo attributeMenu attributeQuery autoKeyframe autoPlace bakeClip bakeFluidShading bakePartialHistory bakeResults bakeSimulation basename basenameEx batchRender bessel bevel bevelPlus binMembership bindSkin blend2 blendShape blendShapeEditor blendShapePanel blendTwoAttr blindDataType boneLattice boundary boxDollyCtx boxZoomCtx bufferCurve buildBookmarkMenu buildKeyframeMenu button buttonManip CBG cacheFile cacheFileCombine cacheFileMerge cacheFileTrack camera cameraView canCreateManip canvas capitalizeString catch catchQuiet ceil changeSubdivComponentDisplayLevel changeSubdivRegion channelBox character characterMap characterOutlineEditor characterize chdir checkBox checkBoxGrp checkDefaultRenderGlobals choice circle circularFillet clamp clear clearCache clip clipEditor clipEditorCurrentTimeCtx clipSchedule clipSchedulerOutliner clipTrimBefore closeCurve closeSurface cluster cmdFileOutput cmdScrollFieldExecuter cmdScrollFieldReporter cmdShell coarsenSubdivSelectionList collision color colorAtPoint colorEditor colorIndex colorIndexSliderGrp colorSliderButtonGrp colorSliderGrp columnLayout commandEcho commandLine commandPort compactHairSystem componentEditor compositingInterop computePolysetVolume condition cone confirmDialog connectAttr connectControl connectDynamic connectJoint connectionInfo constrain constrainValue constructionHistory container containsMultibyte contextInfo control convertFromOldLayers convertIffToPsd convertLightmap convertSolidTx convertTessellation convertUnit copyArray copyFlexor copyKey copySkinWeights cos cpButton cpCache cpClothSet cpCollision cpConstraint cpConvClothToMesh cpForces cpGetSolverAttr cpPanel cpProperty cpRigidCollisionFilter cpSeam cpSetEdit cpSetSolverAttr cpSolver cpSolverTypes cpTool cpUpdateClothUVs createDisplayLayer createDrawCtx createEditor createLayeredPsdFile createMotionField createNewShelf createNode createRenderLayer createSubdivRegion cross crossProduct ctxAbort ctxCompletion ctxEditMode ctxTraverse currentCtx currentTime currentTimeCtx currentUnit currentUnit curve curveAddPtCtx curveCVCtx curveEPCtx curveEditorCtx curveIntersect curveMoveEPCtx curveOnSurface curveSketchCtx cutKey cycleCheck cylinder dagPose date defaultLightListCheckBox defaultNavigation defineDataServer defineVirtualDevice deformer deg_to_rad delete deleteAttr deleteShadingGroupsAndMaterials deleteShelfTab deleteUI deleteUnusedBrushes delrandstr detachCurve detachDeviceAttr detachSurface deviceEditor devicePanel dgInfo dgdirty dgeval dgtimer dimWhen directKeyCtx directionalLight dirmap dirname disable disconnectAttr disconnectJoint diskCache displacementToPoly displayAffected displayColor displayCull displayLevelOfDetail displayPref displayRGBColor displaySmoothness displayStats displayString displaySurface distanceDimContext distanceDimension doBlur dolly dollyCtx dopeSheetEditor dot dotProduct doubleProfileBirailSurface drag dragAttrContext draggerContext dropoffLocator duplicate duplicateCurve duplicateSurface dynCache dynControl dynExport dynExpression dynGlobals dynPaintEditor dynParticleCtx dynPref dynRelEdPanel dynRelEditor dynamicLoad editAttrLimits editDisplayLayerGlobals editDisplayLayerMembers editRenderLayerAdjustment editRenderLayerGlobals editRenderLayerMembers editor editorTemplate effector emit emitter enableDevice encodeString endString endsWith env equivalent equivalentTol erf error eval eval evalDeferred evalEcho event exactWorldBoundingBox exclusiveLightCheckBox exec executeForEachObject exists exp expression expressionEditorListen extendCurve extendSurface extrude fcheck fclose feof fflush fgetline fgetword file fileBrowserDialog fileDialog fileExtension fileInfo filetest filletCurve filter filterCurve filterExpand filterStudioImport findAllIntersections findAnimCurves findKeyframe findMenuItem findRelatedSkinCluster finder firstParentOf fitBspline flexor floatEq floatField floatFieldGrp floatScrollBar floatSlider floatSlider2 floatSliderButtonGrp floatSliderGrp floor flow fluidCacheInfo fluidEmitter fluidVoxelInfo flushUndo fmod fontDialog fopen formLayout format fprint frameLayout fread freeFormFillet frewind fromNativePath fwrite gamma gauss geometryConstraint getApplicationVersionAsFloat getAttr getClassification getDefaultBrush getFileList getFluidAttr getInputDeviceRange getMayaPanelTypes getModifiers getPanel getParticleAttr getPluginResource getenv getpid glRender glRenderEditor globalStitch gmatch goal gotoBindPose grabColor gradientControl gradientControlNoAttr graphDollyCtx graphSelectContext graphTrackCtx gravity grid gridLayout group groupObjectsByName HfAddAttractorToAS HfAssignAS HfBuildEqualMap HfBuildFurFiles HfBuildFurImages HfCancelAFR HfConnectASToHF HfCreateAttractor HfDeleteAS HfEditAS HfPerformCreateAS HfRemoveAttractorFromAS HfSelectAttached HfSelectAttractors HfUnAssignAS hardenPointCurve hardware hardwareRenderPanel headsUpDisplay headsUpMessage help helpLine hermite hide hilite hitTest hotBox hotkey hotkeyCheck hsv_to_rgb hudButton hudSlider hudSliderButton hwReflectionMap hwRender hwRenderLoad hyperGraph hyperPanel hyperShade hypot iconTextButton iconTextCheckBox iconTextRadioButton iconTextRadioCollection iconTextScrollList iconTextStaticLabel ikHandle ikHandleCtx ikHandleDisplayScale ikSolver ikSplineHandleCtx ikSystem ikSystemInfo ikfkDisplayMethod illustratorCurves image imfPlugins inheritTransform insertJoint insertJointCtx insertKeyCtx insertKnotCurve insertKnotSurface instance instanceable instancer intField intFieldGrp intScrollBar intSlider intSliderGrp interToUI internalVar intersect iprEngine isAnimCurve isConnected isDirty isParentOf isSameObject isTrue isValidObjectName isValidString isValidUiName isolateSelect itemFilter itemFilterAttr itemFilterRender itemFilterType joint jointCluster jointCtx jointDisplayScale jointLattice keyTangent keyframe keyframeOutliner keyframeRegionCurrentTimeCtx keyframeRegionDirectKeyCtx keyframeRegionDollyCtx keyframeRegionInsertKeyCtx keyframeRegionMoveKeyCtx keyframeRegionScaleKeyCtx keyframeRegionSelectKeyCtx keyframeRegionSetKeyCtx keyframeRegionTrackCtx keyframeStats lassoContext lattice latticeDeformKeyCtx launch launchImageEditor layerButton layeredShaderPort layeredTexturePort layout layoutDialog lightList lightListEditor lightListPanel lightlink lineIntersection linearPrecision linstep listAnimatable listAttr listCameras listConnections listDeviceAttachments listHistory listInputDeviceAxes listInputDeviceButtons listInputDevices listMenuAnnotation listNodeTypes listPanelCategories listRelatives listSets listTransforms listUnselected listerEditor loadFluid loadNewShelf loadPlugin loadPluginLanguageResources loadPrefObjects localizedPanelLabel lockNode loft log longNameOf lookThru ls lsThroughFilter lsType lsUI Mayatomr mag makeIdentity makeLive makePaintable makeRoll makeSingleSurface makeTubeOn makebot manipMoveContext manipMoveLimitsCtx manipOptions manipRotateContext manipRotateLimitsCtx manipScaleContext manipScaleLimitsCtx marker match max memory menu menuBarLayout menuEditor menuItem menuItemToShelf menuSet menuSetPref messageLine min minimizeApp mirrorJoint modelCurrentTimeCtx modelEditor modelPanel mouse movIn movOut move moveIKtoFK moveKeyCtx moveVertexAlongDirection multiProfileBirailSurface mute nParticle nameCommand nameField namespace namespaceInfo newPanelItems newton nodeCast nodeIconButton nodeOutliner nodePreset nodeType noise nonLinear normalConstraint normalize nurbsBoolean nurbsCopyUVSet nurbsCube nurbsEditUV nurbsPlane nurbsSelect nurbsSquare nurbsToPoly nurbsToPolygonsPref nurbsToSubdiv nurbsToSubdivPref nurbsUVSet nurbsViewDirectionVector objExists objectCenter objectLayer objectType objectTypeUI obsoleteProc oceanNurbsPreviewPlane offsetCurve offsetCurveOnSurface offsetSurface openGLExtension openMayaPref optionMenu optionMenuGrp optionVar orbit orbitCtx orientConstraint outlinerEditor outlinerPanel overrideModifier paintEffectsDisplay pairBlend palettePort paneLayout panel panelConfiguration panelHistory paramDimContext paramDimension paramLocator parent parentConstraint particle particleExists particleInstancer particleRenderInfo partition pasteKey pathAnimation pause pclose percent performanceOptions pfxstrokes pickWalk picture pixelMove planarSrf plane play playbackOptions playblast plugAttr plugNode pluginInfo pluginResourceUtil pointConstraint pointCurveConstraint pointLight pointMatrixMult pointOnCurve pointOnSurface pointPosition poleVectorConstraint polyAppend polyAppendFacetCtx polyAppendVertex polyAutoProjection polyAverageNormal polyAverageVertex polyBevel polyBlendColor polyBlindData polyBoolOp polyBridgeEdge polyCacheMonitor polyCheck polyChipOff polyClipboard polyCloseBorder polyCollapseEdge polyCollapseFacet polyColorBlindData polyColorDel polyColorPerVertex polyColorSet polyCompare polyCone polyCopyUV polyCrease polyCreaseCtx polyCreateFacet polyCreateFacetCtx polyCube polyCut polyCutCtx polyCylinder polyCylindricalProjection polyDelEdge polyDelFacet polyDelVertex polyDuplicateAndConnect polyDuplicateEdge polyEditUV polyEditUVShell polyEvaluate polyExtrudeEdge polyExtrudeFacet polyExtrudeVertex polyFlipEdge polyFlipUV polyForceUV polyGeoSampler polyHelix polyInfo polyInstallAction polyLayoutUV polyListComponentConversion polyMapCut polyMapDel polyMapSew polyMapSewMove polyMergeEdge polyMergeEdgeCtx polyMergeFacet polyMergeFacetCtx polyMergeUV polyMergeVertex polyMirrorFace polyMoveEdge polyMoveFacet polyMoveFacetUV polyMoveUV polyMoveVertex polyNormal polyNormalPerVertex polyNormalizeUV polyOptUvs polyOptions polyOutput polyPipe polyPlanarProjection polyPlane polyPlatonicSolid polyPoke polyPrimitive polyPrism polyProjection polyPyramid polyQuad polyQueryBlindData polyReduce polySelect polySelectConstraint polySelectConstraintMonitor polySelectCtx polySelectEditCtx polySeparate polySetToFaceNormal polySewEdge polyShortestPathCtx polySmooth polySoftEdge polySphere polySphericalProjection polySplit polySplitCtx polySplitEdge polySplitRing polySplitVertex polyStraightenUVBorder polySubdivideEdge polySubdivideFacet polyToSubdiv polyTorus polyTransfer polyTriangulate polyUVSet polyUnite polyWedgeFace popen popupMenu pose pow preloadRefEd print progressBar progressWindow projFileViewer projectCurve projectTangent projectionContext projectionManip promptDialog propModCtx propMove psdChannelOutliner psdEditTextureFile psdExport psdTextureFile putenv pwd python querySubdiv quit rad_to_deg radial radioButton radioButtonGrp radioCollection radioMenuItemCollection rampColorPort rand randomizeFollicles randstate rangeControl readTake rebuildCurve rebuildSurface recordAttr recordDevice redo reference referenceEdit referenceQuery refineSubdivSelectionList refresh refreshAE registerPluginResource rehash reloadImage removeJoint removeMultiInstance removePanelCategory rename renameAttr renameSelectionList renameUI render renderGlobalsNode renderInfo renderLayerButton renderLayerParent renderLayerPostProcess renderLayerUnparent renderManip renderPartition renderQualityNode renderSettings renderThumbnailUpdate renderWindowEditor renderWindowSelectContext renderer reorder reorderDeformers requires reroot resampleFluid resetAE resetPfxToPolyCamera resetTool resolutionNode retarget reverseCurve reverseSurface revolve rgb_to_hsv rigidBody rigidSolver roll rollCtx rootOf rot rotate rotationInterpolation roundConstantRadius rowColumnLayout rowLayout runTimeCommand runup sampleImage saveAllShelves saveAttrPreset saveFluid saveImage saveInitialState saveMenu savePrefObjects savePrefs saveShelf saveToolSettings scale scaleBrushBrightness scaleComponents scaleConstraint scaleKey scaleKeyCtx sceneEditor sceneUIReplacement scmh scriptCtx scriptEditorInfo scriptJob scriptNode scriptTable scriptToShelf scriptedPanel scriptedPanelType scrollField scrollLayout sculpt searchPathArray seed selLoadSettings select selectContext selectCurveCV selectKey selectKeyCtx selectKeyframeRegionCtx selectMode selectPref selectPriority selectType selectedNodes selectionConnection separator setAttr setAttrEnumResource setAttrMapping setAttrNiceNameResource setConstraintRestPosition setDefaultShadingGroup setDrivenKeyframe setDynamic setEditCtx setEditor setFluidAttr setFocus setInfinity setInputDeviceMapping setKeyCtx setKeyPath setKeyframe setKeyframeBlendshapeTargetWts setMenuMode setNodeNiceNameResource setNodeTypeFlag setParent setParticleAttr setPfxToPolyCamera setPluginResource setProject setStampDensity setStartupMessage setState setToolTo setUITemplate setXformManip sets shadingConnection shadingGeometryRelCtx shadingLightRelCtx shadingNetworkCompare shadingNode shapeCompare shelfButton shelfLayout shelfTabLayout shellField shortNameOf showHelp showHidden showManipCtx showSelectionInTitle showShadingGroupAttrEditor showWindow sign simplify sin singleProfileBirailSurface size sizeBytes skinCluster skinPercent smoothCurve smoothTangentSurface smoothstep snap2to2 snapKey snapMode snapTogetherCtx snapshot soft softMod softModCtx sort sound soundControl source spaceLocator sphere sphrand spotLight spotLightPreviewPort spreadSheetEditor spring sqrt squareSurface srtContext stackTrace startString startsWith stitchAndExplodeShell stitchSurface stitchSurfacePoints strcmp stringArrayCatenate stringArrayContains stringArrayCount stringArrayInsertAtIndex stringArrayIntersector stringArrayRemove stringArrayRemoveAtIndex stringArrayRemoveDuplicates stringArrayRemoveExact stringArrayToString stringToStringArray strip stripPrefixFromName stroke subdAutoProjection subdCleanTopology subdCollapse subdDuplicateAndConnect subdEditUV subdListComponentConversion subdMapCut subdMapSewMove subdMatchTopology subdMirror subdToBlind subdToPoly subdTransferUVsToCache subdiv subdivCrease subdivDisplaySmoothness substitute substituteAllString substituteGeometry substring surface surfaceSampler surfaceShaderList swatchDisplayPort switchTable symbolButton symbolCheckBox sysFile system tabLayout tan tangentConstraint texLatticeDeformContext texManipContext texMoveContext texMoveUVShellContext texRotateContext texScaleContext texSelectContext texSelectShortestPathCtx texSmudgeUVContext texWinToolCtx text textCurves textField textFieldButtonGrp textFieldGrp textManip textScrollList textToShelf textureDisplacePlane textureHairColor texturePlacementContext textureWindow threadCount threePointArcCtx timeControl timePort timerX toNativePath toggle toggleAxis toggleWindowVisibility tokenize tokenizeList tolerance tolower toolButton toolCollection toolDropped toolHasOptions toolPropertyWindow torus toupper trace track trackCtx transferAttributes transformCompare transformLimits translator trim trunc truncateFluidCache truncateHairCache tumble tumbleCtx turbulence twoPointArcCtx uiRes uiTemplate unassignInputDevice undo undoInfo ungroup uniform unit unloadPlugin untangleUV untitledFileName untrim upAxis updateAE userCtx uvLink uvSnapshot validateShelfName vectorize view2dToolCtx viewCamera viewClipPlane viewFit viewHeadOn viewLookAt viewManip viewPlace viewSet visor volumeAxis vortex waitCursor warning webBrowser webBrowserPrefs whatIs window windowPref wire wireContext workspace wrinkle wrinkleContext writeTake xbmLangPathList xform",
i: "</",
c: [ e.CNM, e.ASM, e.QSM, {
cN: "string",
b: "`",
e: "`",
c: [ e.BE ]
}, {
cN: "variable",
b: "\\$\\d",
r: 5
}, {
cN: "variable",
b: "[\\$\\%\\@\\*](\\^\\w\\b|#\\w+|[^\\s\\w{]|{\\w+}|\\w+)"
}, e.CLCM, e.CBLCLM ]
};
}(hljs), define("highlightjs", 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 o(e, t) {
return e.replace(/<[^>]*>?/gi, function(e) {
return e.match(t) ? e : "";
});
}
function r(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 o = [];
for (var r in n) n.hasOwnProperty(r) && o.push(n[r]);
return o;
}
function s(e) {
return "" != e.charAt(0) && (e = "" + e), "" != e.charAt(e.length - 1) && (e += ""),
e;
}
function a(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 o(c(e, t), p);
}
function c(e, t) {
var n = t.blockGamutHookCallback(e);
return n = d(n), n = n.replace(/~D/g, "$$").replace(/~T/g, "~"), n = t.previousPostConversion(n);
}
function u(e) {
return e.replace(/\\\|/g, "&#124;").replace(/\\:/g, "&#58;");
}
function d(e) {
return e = e.replace(/~E(\d+)E/g, function(e, t) {
var n = parseInt(t);
return String.fromCharCode(n);
});
}
function h(e) {
return e.toLowerCase().replace(/\s+/g, "-").replace(/[^\w\-]+/g, "").replace(/\-\-+/g, "-").replace(/^-+/, "").replace(/-+$/, "");
}
var p = 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(), o = [], r = [], 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" ]),
r.push("wrapHeaders"), i(t.extensions, "attr_list") && (o.push("hashFcbAttributeBlocks"),
r.push("hashHeaderAttributeBlocks"), s.push("applyAttributeBlocks"), n.attributeBlocks = !0),
i(t.extensions, "fenced_code_gfm") && o.push("fencedCodeBlocks"), i(t.extensions, "tables") && r.push("tables"),
i(t.extensions, "def_list") && r.push("definitionLists"), i(t.extensions, "footnotes") && (o.push("stripFootnoteDefinitions"),
r.push("doFootnotes"), s.push("printFootnotes")), e.hooks.chain("postNormalization", function(e) {
return n.doTransform(o, e) + "\n";
}), e.hooks.chain("preBlockGamut", function(e, t) {
return n.blockGamutHookCallback = t, e = u(e), n.doTransform(r, e) + "\n";
}), 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<p>~X" + (this.hashBlocks.push(e) - 1) + "X</p>\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(/(?:<p>)?~X(\d+)X(?:<\/p>)?/g, function(e, t) {
i = !0;
var o = parseInt(t, 10);
return n.hashBlocks[o];
}), 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);
}, Markdown.Extra.prototype.hashHeaderAttributeBlocks = function(e) {
function t(e, t, n) {
return "<p>~XX" + (r.hashBlocks.push(n) - 1) + "XX</p>\n" + t + "\n";
}
var n = "\\{\\s*[.|#][^}]+\\}", i = new RegExp("^(#{1,6}.*#{0,6})\\s+(" + n + ")[ \\t]*(\\n|0x03)", "gm"), o = new RegExp("^(.*)\\s+(" + n + ")[ \\t]*\\n" + "(?=[\\-|=]+\\s*(\\n|0x03))", "gm"), r = this;
return e = e.replace(i, t), e = e.replace(o, t);
}, Markdown.Extra.prototype.hashFcbAttributeBlocks = function(e) {
function t(e, t, n) {
return "<p>~XX" + (o.hashBlocks.push(n) - 1) + "XX</p>\n" + t + "\n";
}
var n = "\\{\\s*[.|#][^}]+\\}", i = new RegExp("^(```[^{\\n]*)\\s+(" + n + ")[ \\t]*\\n" + "(?=([\\s\\S]*?)\\n```\\s*(\\n|0x03))", "gm"), o = this;
return e.replace(i, t);
}, Markdown.Extra.prototype.applyAttributeBlocks = function(e) {
var t = this, n = new RegExp('<p>~XX(\\d+)XX</p>[\\s]*(?:<(h[1-6]|pre)(?: +class="(\\S+)")?(>[\\s\\S]*?</\\2>))', "gm");
return e = e.replace(n, function(e, n, i, o, s) {
if (!i) return "";
for (var a = parseInt(n, 10), l = t.hashBlocks[a], c = l.match(/#[^\s{}]+/g) || [], u = c[0] ? ' id="' + c[0].substr(1, c[0].length - 1) + '"' : "", d = l.match(/\.[^\s{}]+/g) || [], h = 0; h < d.length; h++) d[h] = d[h].substr(1, d[h].length - 1);
var p = "";
return o && (d = r(d, [ o ])), d.length > 0 && (p = ' class="' + d.join(" ") + '"'),
"<" + i + u + p + s;
});
}, Markdown.Extra.prototype.tables = function(t) {
function n(t, n, o, r) {
n = n.replace(/^ *[|]/m, ""), o = o.replace(/^ *[|]/m, ""), r = r.replace(/^ *[|]/gm, ""),
n = n.replace(/[|] *$/m, ""), o = o.replace(/[|] *$/m, ""), r = r.replace(/[|] *$/gm, ""),
alignspecs = o.split(/ *[|] */), align = [];
for (var s = 0; s < alignspecs.length; s++) {
var a = alignspecs[s];
align[s] = a.match(/^ *-+: *$/m) ? ' style="text-align:right;"' : a.match(/^ *:-+: *$/m) ? ' style="text-align:center;"' : a.match(/^ *:-+ *$/m) ? ' style="text-align:left;"' : "";
}
var c = n.split(/ *[|] */), u = c.length, d = i.tableClass ? ' class="' + i.tableClass + '"' : "", h = [ "<table", d, ">\n", "<thead>\n", "<tr>\n" ].join("");
for (s = 0; u > s; s++) {
var p = l(e(c[s]), i);
h += [ " <th", align[s], ">", p, "</th>\n" ].join("");
}
h += "</tr>\n</thead>\n";
var f = r.split("\n");
for (s = 0; s < f.length; s++) if (!f[s].match(/^\s*$/)) {
for (var g = f[s].split(/ *[|] */), m = u - g.length, v = 0; m > v; v++) g.push("");
for (h += "<tr>\n", v = 0; u > v; v++) {
var b = l(e(g[v]), i);
h += [ " <td", align[v], ">", b, "</td>\n" ].join("");
}
h += "</tr>\n";
}
return h += "</table>\n", i.hashExtraBlock(h);
}
var i = this, o = new RegExp([ "^", "[ ]{0,3}", "[|]", "(.+)\\n", "[ ]{0,3}", "[|]([ ]*[-:]+[-| :]*)\\n", "(", "(?:[ ]*[|].*\\n?)*", ")", "(?:\\n|$)" ].join(""), "gm"), r = new RegExp([ "^", "[ ]{0,3}", "(\\S.*[|].*)\\n", "[ ]{0,3}", "([-:]+[ ]*[|][-| :]*)\\n", "(", "(?:.*[|].*\\n?)*", ")", "(?:\\n|$)" ].join(""), "gm");
return t = t.replace(o, n), t = t.replace(r, 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 = h(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 o = h(i), r = t.footnotes[o];
if (void 0 === r) return e;
n++, t.usedFootnotes.push(o);
var s = '<a href="#fn:' + o + '" id="fnref:' + o + '" title="See footnote" class="footnote">' + n + "</a>";
return t.hashExtraInline(s);
});
}, Markdown.Extra.prototype.printFootnotes = function(e) {
var t = this;
if (0 === t.usedFootnotes.length) return e;
e += '\n\n<div class="footnotes">\n<hr>\n<ol>\n\n';
for (var n = 0; n < t.usedFootnotes.length; n++) {
var i = t.usedFootnotes[n], o = t.footnotes[i];
t.isConvertingFootnote = !0;
var r = l(o, t);
delete t.isConvertingFootnote, e += '<li id="fn:' + i + '">' + r + ' <a href="#fnref:' + i + '" title="Return to article" class="reversefootnote">&#8617;</a></li>\n\n';
}
return e += "</ol>\n</div>";
}, Markdown.Extra.prototype.fencedCodeBlocks = function(e) {
function t(e) {
return e = e.replace(/&/g, "&amp;"), e = e.replace(/</g, "&lt;"), e = e.replace(/>/g, "&gt;"),
e = e.replace(/~D/g, "$$"), e = e.replace(/~T/g, "~");
}
var n = this;
return e = e.replace(/(?:^|\n)```(.*)\n([\s\S]*?)\n```/g, function(e, i, o) {
var r = i, s = o, a = n.googleCodePrettify ? ' class="prettyprint"' : "", l = "";
r && (l = n.googleCodePrettify || n.highlightJs ? ' class="language-' + r + '"' : ' class="' + r + '"');
var c = [ "<pre", a, "><code", l, ">", t(s), "</code></pre>" ].join("");
return n.hashExtraBlock(c);
});
}, 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 = s(t), t = t.replace(n, function(t, n, o) {
var r = e(i.processDefListItems(o));
return r = "<dl>\n" + r + "\n</dl>", n + i.hashExtraBlock(r) + "\n\n";
}), a(t);
}, Markdown.Extra.prototype.processDefListItems = function(i) {
var o = this, r = 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}[:][ ]|", "<dt>|\\x03", ")", ")" ].join(""), "gm");
return i = s(i), i = i.replace(/\n{2,}(?=\\x03)/, "\n"), i = i.replace(r, function(t, n, i) {
for (var r = e(i).split("\n"), s = "", a = 0; a < r.length; a++) {
var c = r[a];
c = l(e(c), o), s += "\n<dt>" + c + "</dt>";
}
return s + "\n";
}), i = i.replace(u, function(e, i, r, s) {
return i || s.match(/\n{2,}/) ? (s = Array(r.length + 1).join(" ") + s, s = n(s) + "\n\n",
s = "\n" + c(s, o) + "\n") : (s = t(s), s = l(n(s), o)), "\n<dd>" + s + "</dd>\n";
}), a(i);
};
}(), define("pagedown-extra", function() {}), define("extensions/markdownExtra", [ "jquery", "underscore", "utils", "classes/Extension", "text!html/markdownExtraSettingsBlock.html", "pagedown-extra" ], function(e, t, n, i, o) {
var r = new i("markdownExtra", "Markdown Extra", !0);
r.settingsBlock = o, r.defaultConfig = {
extensions: [ "fenced_code_gfm", "tables", "def_list", "attr_list", "footnotes" ],
highlighter: "prettify"
}, r.onLoadSettings = function() {
function e(e) {
return t.some(r.config.extensions, function(t) {
return t == e;
});
}
n.setInputChecked("#input-markdownextra-fencedcodegfm", e("fenced_code_gfm")), n.setInputChecked("#input-markdownextra-tables", e("tables")),
n.setInputChecked("#input-markdownextra-deflist", e("def_list")), n.setInputChecked("#input-markdownextra-attrlist", e("attr_list")),
n.setInputChecked("#input-markdownextra-footnotes", e("footnotes")), n.setInputValue("#input-markdownextra-highlighter", r.config.highlighter);
}, r.onSaveSettings = function(e) {
e.extensions = [], n.getInputChecked("#input-markdownextra-fencedcodegfm") && e.extensions.push("fenced_code_gfm"),
n.getInputChecked("#input-markdownextra-tables") && e.extensions.push("tables"),
n.getInputChecked("#input-markdownextra-deflist") && e.extensions.push("def_list"),
n.getInputChecked("#input-markdownextra-attrlist") && e.extensions.push("attr_list"),
n.getInputChecked("#input-markdownextra-footnotes") && e.extensions.push("footnotes"),
e.highlighter = n.getInputValue("#input-markdownextra-highlighter");
};
var s = void 0;
return r.onEventMgrCreated = function(e) {
s = e;
}, r.onPagedownConfigure = function(e) {
var n = e.getConverter(), i = {
extensions: r.config.extensions
};
if ("highlight" == r.config.highlighter) {
i.highlighter = "prettify";
var o = document.getElementById("preview-contents");
e.hooks.chain("onPreviewRefresh", function() {
t.each(o.querySelectorAll(".prettyprint"), function(e) {
hljs.highlightBlock(e);
});
});
} else "prettify" == r.config.highlighter && (i.highlighter = "prettify", e.hooks.chain("onPreviewRefresh", prettyPrint));
Markdown.Extra.init(n, i), s.onExtraExtensions(r.config.extensions);
}, r;
}), define("text!html/buttonToc.html", [], function() {
return '<button class="btn btn-default dropdown-toggle" title="Table of contents" data-toggle="dropdown">\n <i class="icon-list"></i>\n</button>\n<div class="dropdown-menu pull-right">\n <h3>Table of contents</h3>\n <div class="table-of-contents">\n </div>\n</div>\n';
}), define("text!html/tocSettingsBlock.html", [], function() {
return '<p>Generates a table of contents when a [TOC] marker is found.</p>\n<div class="form-horizontal">\n <div class="form-group">\n <label class="col-lg-4 control-label" for="input-toc-marker">Marker\n RegExp</label>\n <div class="col-lg-7">\n \n <input type="text" id="input-toc-marker" class="col-lg-4 form-control">\n </div>\n </div>\n <div class="form-group">\n <label class="col-lg-4 control-label" for="input-toc-button">Button over preview</label>\n <div class="col-lg-7">\n <div class="checkbox">\n <input type="checkbox" id="input-toc-button">\n </div>\n </div>\n </div>\n \n</div>';
}), define("extensions/toc", [ "jquery", "underscore", "utils", "classes/Extension", "text!html/buttonToc.html", "text!html/tocSettingsBlock.html" ], function(e, t, n, i, o, r) {
function s(e, t, n) {
this.tagName = e, this.anchor = t, this.text = n, this.children = [];
}
function a(e, n) {
function i() {
void 0 !== l && (l.children.length > 0 && (l.children = a(l.children, n + 1)), r.push(l));
}
n = n || 1;
var o = "H" + n, r = [], l = void 0;
return t.each(e, function(e) {
e.tagName != o ? (void 0 === l && (l = new s()), l.children.push(e)) : (i(), l = e);
}), i(), r;
}
function l() {
function e(e) {
for (var o = e.id || n.slugify(e.textContent) || "title", r = o, s = 0; t.has(i, r); ) r = o + "-" + ++s;
return i[r] = !0, e.id = r, r;
}
var i = {}, o = [];
return t.each(u.querySelectorAll(".preview-content > .wmd-title"), function(t) {
o.push(new s(t.tagName, e(t), t.textContent));
}), o = a(o), '<div class="toc">\n<ul>\n' + o.join("") + "</ul>\n</div>\n";
}
var c = new i("toc", "Table of Contents", !0);
c.settingsBlock = r, c.defaultConfig = {
marker: "\\[(TOC|toc)\\]",
button: !0
}, c.onLoadSettings = function() {
n.setInputValue("#input-toc-marker", c.config.marker), n.setInputChecked("#input-toc-button", c.config.button);
}, c.onSaveSettings = function(e, t) {
e.marker = n.getInputRegExpValue("#input-toc-marker", t), e.button = n.getInputChecked("#input-toc-button");
}, c.onCreatePreviewButton = function() {
return c.config.button ? o : void 0;
}, s.prototype.childrenToString = function() {
if (0 === this.children.length) return "";
var e = "<ul>\n";
return t.each(this.children, function(t) {
e += t.toString();
}), e += "</ul>\n";
}, s.prototype.toString = function() {
var e = "<li>";
return this.anchor && this.text && (e += '<a href="#' + this.anchor + '">' + this.text + "</a>"),
e += this.childrenToString() + "</li>\n";
};
var u = void 0;
return c.onPagedownConfigure = function(e) {
u = document.getElementById("preview-contents");
var n = document.querySelectorAll(".table-of-contents"), i = new RegExp("^" + c.config.marker + "$", "g");
e.hooks.chain("onPreviewRefresh", function() {
var e = l();
t.each(u.getElementsByTagName("p"), function(t) {
i.test(t.innerHTML) && (t.innerHTML = e);
}), t.each(n, function(t) {
t.innerHTML = e;
});
});
}, c;
}), define("text!html/mathJaxSettingsBlock.html", [], function() {
return '<p>Allows StackEdit to interpret LaTeX mathematical expressions.</p>\n<div class="form-horizontal">\n <div class="form-group">\n <label class="col-lg-4 control-label"\n for="input-mathjax-config-tex">TeX configuration</label>\n <div class="col-lg-7">\n <input type="text" id="input-mathjax-config-tex" class="form-control">\n </div>\n </div>\n <div class="form-group">\n <label class="col-lg-4 control-label"\n for="input-mathjax-config-tex2jax">tex2jax configuration</label>\n <div class="col-lg-7">\n <input type="text" id="input-mathjax-config-tex2jax" class="form-control">\n </div>\n </div>\n</div>\n<span class="help-block pull-right"><a target="_blank" href="http://docs.mathjax.org/en/latest/options/index.html">More info</a></span>';
}), 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';
}), require([ "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("libs/mathjax_init", function() {}), define("extensions/mathJax", [ "utils", "classes/Extension", "text!html/mathJaxSettingsBlock.html", "text!libs/mathjax_config.js", "mathjax" ], function(e, t, n) {
function i(e, t, n) {
var i = u.slice(e, t + 1).join("").replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
for (w.Browser.isMSIE && (i = i.replace(/(%[^\n]*)\n/g, "$1<br/>\n")); t > e; ) u[t] = "",
t--;
u[e] = "@@" + g.length + "@@", n && (i = n(i)), g.push(i), d = h = p = null;
}
function o(e) {
d = h = p = null, g = [];
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 = C(e.replace(/\r\n?/g, "\n"), x);
for (var e = 1, n = u.length; n > e; e += 2) {
var o = u[e];
"@" === o.charAt(0) ? (u[e] = "@@" + g.length + "@@", g.push(o)) : d ? o === h ? f ? p = e : i(d, e, t) : o.match(/\n.*\n/) ? (p && (e = p,
i(d, e, t)), d = h = p = null, f = 0) : "{" === o ? f++ : "}" === o && f && f-- : o === y || "$$" === o ? (d = e,
h = o, f = 0) : "begin" === o.substr(1, 5) && (d = e, h = "\\end" + o.substr(6),
f = 0);
}
return p && i(d, p, t), t(u.join(""));
}
function r(e) {
return e = e.replace(/@@(\d+)@@/g, function(e, t) {
return g[t];
}), g = null, e;
}
function s() {
v = !1, w.cancelTypeset = !1, w.Queue([ "Typeset", w, b ]), w.Queue(c);
}
function a() {
!v && m && (v = !0, w.Cancel(), w.Queue(s));
}
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", o), t.hooks.chain("postConversion", r);
};
var c = void 0;
l.onAsyncPreview = function(e) {
c = e, a();
};
var u, d, h, p, f, g, m = !1, v = !1, b = null, y = "$", w = MathJax.Hub;
w.Queue(function() {
m = !0, w.processUpdateTime = 50, w.Config({
"HTML-CSS": {
EqnChunk: 10,
EqnChunkFactor: 1
},
SVG: {
EqnChunk: 10,
EqnChunkFactor: 1
}
});
});
var C, x = /(\$\$?|\\(?:begin|end)\{[a-z]*\*?\}|\\[\\{}$]|[{}]|(?:\n\s*)+|@@\d+@@)/i;
return C = 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 o = "";
n = n.replace(/^\/(.*)\/([im]*)$/, function(e, t, n) {
return o = n, t;
}), t = RegExp(n, o + "g");
}
for (var r = t.lastIndex = 0; n = t.exec(e); ) i.push(e.substring(r, n.index)),
i.push.apply(i, n.slice(1)), r = n.index + n[0].length;
return i.push(e.substring(r)), 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, o) {
if (e.cancelTypeset || o.cancelled) throw Error("MathJax Canceled");
return n.call(t, i, o);
}
});
}), e.Register.StartupHook("SVG Jax Config", function() {
var t = MathJax.OutputJax.SVG, n = t.Translate;
t.Augment({
Translate: function(i, o) {
if (e.cancelTypeset || o.cancelled) throw Error("MathJax Canceled");
return n.call(t, i, o);
}
});
}), e.Register.StartupHook("TeX Jax Config", function() {
var t = MathJax.InputJax.TeX, n = t.Translate;
t.Augment({
Translate: function(i, o) {
if (e.cancelTypeset || o.cancelled) throw Error("MathJax Canceled");
return n.call(t, i, o);
}
});
});
var t = e.processError;
e.processError = function(n, i, o) {
return "MathJax Canceled" !== n.message ? t.call(e, n, i, o) : (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("extensions/emailConverter", [ "classes/Extension" ], function(e) {
var t = new e("emailConverter", "Markdown Email", !0);
return t.settingsBlock = "<p>Converts email adresses in the form &lt;email@example.com&gt; into clickable links.</p>",
t.onPagedownConfigure = function(e) {
e.getConverter().hooks.chain("postConversion", function(e) {
return e.replace(/<(mailto\:)?([^\s>]+@[^\s>]+\.\S+?)>/g, function(e, t, n) {
return '<a href="mailto:' + n + '">' + n + "</a>";
});
});
}, t;
}), define("text!html/scrollLinkSettingsBlock.html", [], function() {
return "<p>Binds together editor and preview scrollbars.</p>\n<blockquote>\n <b>NOTE:</b> 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</blockquote>";
}), define("extensions/scrollLink", [ "jquery", "underscore", "classes/Extension", "text!html/scrollLinkSettingsBlock.html" ], function(e, t, n, i) {
function o(e) {
return parseFloat(e.substring(0, e.length - 2));
}
var r = new n("scrollLink", "Scroll Link", !0, !0, !0);
r.settingsBlock = i;
var s = void 0;
r.onAceCreated = function(e) {
s = e;
};
var a = void 0;
r.onSectionsCreated = function(e) {
a = e;
};
var l = 0;
r.onMarkdownTrim = function(e) {
l = e;
};
var c = void 0, u = [], d = [], h = void 0, p = void 0, f = t.debounce(function() {
u = [];
var n = 0, i = 0, r = l;
t.each(a, function(e) {
n += e.length + r, r = 0;
var t = s.session.doc.indexToPosition(n), o = s.session.documentToScreenPosition(t.row, t.column), a = o.row * s.renderer.lineHeight, l = a - i;
u.push({
startOffset: i,
endOffset: a,
height: l
}), i = a;
}), d = [];
var f = 0, g = c.scrollTop();
c.find(".preview-content > .wmd-title").each(function() {
var t = e(this), n = t.position().top + g + o(t.css("margin-top"));
d.push({
startOffset: f,
endOffset: n,
height: n - f
}), f = n;
});
var m = c.prop("scrollHeight");
d.push({
startOffset: f,
endOffset: m,
height: m - f
}), h = -10, p = -10, y();
}, 500), g = !1, m = !1, v = !1, b = !1, y = t.debounce(function() {
function n(e, n, i) {
var o = void 0, r = t.find(n, function(t, n) {
return o = n, e < t.endOffset;
});
if (void 0 !== r) {
var s = (e - r.startOffset) / r.height, a = i[o];
return a.startOffset + a.height * s;
}
}
if (0 === u.length || u.length !== d.length) return y(), void 0;
var i = s.renderer.getScrollTop(), o = c.scrollTop();
if (g === !0 && Math.abs(i - h) > 9) {
g = !1, h = i;
var r = n(i, u, d);
r = t.min([ r, c.prop("scrollHeight") - c.outerHeight() ]), Math.abs(r - o) <= 9 ? p = o : (b = !0,
c.animate({
scrollTop: r
}, {
easing: "easeOutSine",
complete: function() {
p = r;
},
always: function() {
t.defer(function() {
b = !1;
});
}
}));
} else if (m === !0 && Math.abs(o - p) > 9) {
m = !1, p = o;
var r = n(o, d, u);
r = t.min([ r, s.session.getScreenLength() * s.renderer.lineHeight - s.renderer.$size.scrollerHeight ]),
Math.abs(r - i) <= 9 ? h = i : (v = !0, e("<div>").animate({
value: r - i
}, {
easing: "easeOutSine",
step: function(e) {
s.session.setScrollTop(i + e);
},
complete: function() {
h = r;
},
always: function() {
t.defer(function() {
v = !1;
});
}
}));
}
}, 500);
r.onLayoutResize = function() {
g = !0, f();
}, r.onFileClosed = function() {
u = [];
};
var w = !1;
r.onReady = function() {
c = e(".preview-container"), c.scroll(function() {
b === !1 && w === !1 && (m = !0, g = !1, y()), w = !1;
}), s.session.on("changeScrollTop", function() {
v === !1 && (g = !0, m = !1, y());
});
};
var C = void 0;
return r.onPagedownConfigure = function(t) {
C = e("#preview-contents"), t.getConverter().hooks.chain("postConversion", function(e) {
return C.height(C.height()), e;
});
}, r.onPreviewFinished = function() {
var e = C.height();
C.height("auto");
var t = C.height();
g = !0, e > t && (w = !0), f();
}, r;
}), define("extensions/buttonFocusMode", [ "jquery", "underscore", "crel", "classes/Extension" ], function(e, t, n, i) {
function o() {
if (a !== !1 && l !== !0) {
var e = s.selection.getCursor(), t = s.session.documentToScreenPosition(e.row, e.column);
s.session.setScrollTop((t.row + .5) * s.renderer.lineHeight - s.renderer.$size.scrollerHeight / 2);
}
}
var r = new i("buttonFocusMode", 'Button "Focus Mode"', !0, !0, !0);
r.settingsBlock = "When typing, scrolls automatically the editor to always have the caret centered verticaly.";
var s = void 0;
r.onAceCreated = function(e) {
s = e;
};
var a = !1, l = !1, c = void 0;
return r.onReady = function() {
s.getSession().selection.on("changeCursor", o), s.container.addEventListener("keydown", function() {
l = !1;
}, !0), s.container.addEventListener("mousedown", function() {
l = !0;
}, !0), "on" == localStorage.focusMode && c.click();
}, r.onCreateEditorButton = function() {
return c = e([ '<button class="btn btn-info" title="Focus Mode" data-toggle="button">', ' <i class="icon-target"></i>', "</button>" ].join("")),
c.click(function() {
t.defer(function() {
a = c.is(".active"), localStorage.focusMode = a ? "on" : "off", l = !1, s.focus(),
o();
});
}), c[0];
}, r;
}), define("text!html/buttonSyncSettingsBlock.html", [], function() {
return '<p>Adds a "Synchronize documents" button in the navigation bar.</p>\n<div class="form-horizontal">\n <div class="form-group">\n <label class="col-lg-5 control-label" for="input-sync-period">Sync\n period (0: manual)</label>\n <div class="col-lg-6 form-inline">\n <input type="text" id="input-sync-period"\n class="col-lg-5 form-control" placeholder="180000"> ms\n </div>\n </div>\n</div>';
}), define("extensions/buttonSync", [ "jquery", "underscore", "crel", "utils", "classes/Extension", "text!html/buttonSyncSettingsBlock.html" ], function(e, t, n, i, o, r) {
var s = new o("buttonSync", 'Button "Synchronize"');
s.settingsBlock = r, s.defaultConfig = {
syncPeriod: 18e4
}, s.onLoadSettings = function() {
i.setInputValue("#input-sync-period", s.config.syncPeriod);
}, s.onSaveSettings = function(e, t) {
e.syncPeriod = i.getInputIntValue("#input-sync-period", t, 0);
};
var a = void 0;
s.onSynchronizerCreated = function(e) {
a = e;
};
var l = void 0, c = !1, u = !1, d = function() {
void 0 !== l && (c === !0 || a.hasSync() === !1 || u ? l.addClass("disabled") : l.removeClass("disabled"));
}, h = 0;
return s.onPeriodicRun = function() {
viewerMode === !0 || !s.config.syncPeriod || h + s.config.syncPeriod > i.currentTime || a.sync() === !0 && (h = i.currentTime);
}, s.onCreateButton = function() {
var t = n("button", {
"class": "btn btn-success",
title: "Synchronize all"
}, n("i", {
"class": "icon-refresh"
}));
return l = e(t).click(function() {
e(this).hasClass("disabled") || a.sync();
}), t;
}, s.onReady = d, s.onFileCreated = d, s.onFileDeleted = d, s.onSyncImportSuccess = d,
s.onSyncExportSuccess = d, s.onSyncRemoved = d, s.onSyncRunning = function(e) {
c = e, d();
}, s.onOfflineChanged = function(e) {
u = e, d();
}, s;
}), define("text!html/buttonPublish.html", [], function() {
return '<button class="btn btn-success" title="Publish this document">\n <i class="icon-share"></i>\n</button>';
}), define("extensions/buttonPublish", [ "jquery", "underscore", "classes/Extension", "text!html/buttonPublish.html" ], function(e, t, n, i) {
function o() {
void 0 !== s && (l === !0 || c === !1 || u === !0 ? s.addClass("disabled") : s.removeClass("disabled"));
}
var r = new n("buttonPublish", 'Button "Publish"'), s = void 0, a = void 0, l = !1, c = !1, u = !1, d = void 0;
r.onPublisherCreated = function(e) {
d = e;
}, r.onCreateButton = function() {
var t = e(i);
return s = t.click(function() {
t.hasClass("disabled") || d.publish();
}), s[0];
}, r.onPublishRunning = function(e) {
l = e, o();
}, r.onOfflineChanged = function(e) {
u = e, o();
};
var h = function() {
c = 0 === t.size(a.publishLocations) ? !1 : !0, o();
};
return r.onFileSelected = function(e) {
a = e, h();
}, r.onPublishRemoved = h, r.onNewPublishSuccess = h, r;
}), define("text!html/buttonShare.html", [], function() {
return '<button class="btn btn-success dropdown-toggle" data-toggle="dropdown"\n title="Share this document">\n <i class="icon-link"></i>\n</button>\n<div class="dropdown-menu pull-right link-container">\n <h3>Sharing</h3>\n <div class="link-list"></div>\n <p class="no-link">To share this document you need first to <a\n href="#" class="action-publish-gist">publish it as a Gist</a> in\n Markdown format.\n </p>\n <blockquote>\n <b>NOTE:</b> You can open any URL within StackEdit using <a\n href="viewer.html?url=https://raw.github.com/benweet/stackedit/master/README.md"\n title="Sharing example">viewer.html?url=...</a>\n </blockquote>\n</div>\n';
}), define("text!html/buttonShareLocation.html", [], function() {
return '<div class="input-group">\n <a href="<%= link %>" class="input-group-addon" title="Sharing location"><i\n class="icon-link"></i></a> <input class="col-lg-5 form-control" type="text"\n value="<%= link %>" readonly />\n</div>\n';
}), define("extensions/buttonShare", [ "jquery", "underscore", "classes/Extension", "text!html/buttonShare.html", "text!html/buttonShareLocation.html" ], function(e, t, n, i, o) {
var r = new n("buttonShare", 'Button "Share"', !0, !0);
r.settingsBlock = '<p>Adds a "Share document" button in the navigation bar.</p>',
r.onCreateButton = function() {
return i;
};
var s = void 0, a = void 0, l = void 0, c = function(e) {
if (void 0 === e || e === s) {
var n = t.reduce(s.publishLocations, function(e, n) {
return n.sharingLink && (e += t.template(o, {
link: n.sharingLink
})), e;
}, "");
a.innerHTML = n, l.toggleClass("hide", 0 !== n.length);
}
};
return r.onFileSelected = function(e) {
s = e, c(e);
}, r.onNewPublishSuccess = c, r.onPublishRemoved = c, r.onReady = function() {
var t = document.querySelector(".link-container");
a = t.querySelector(".link-list"), l = e(t.querySelector(".no-link"));
}, r;
}), define("text!html/buttonStat.html", [], function() {
return '<button class="btn btn-default dropdown-toggle" title="Document statistics" data-toggle="dropdown">\n <i class="icon-chart-bar"></i>\n</button>\n<div class="dropdown-menu pull-right">\n <h3>Statistics</h3>\n <div class="stat">\n <div>\n <%= name1 %>: <span id="span-stat-value1"></span>\n </div>\n <div>\n <%= name2 %>: <span id="span-stat-value2"></span>\n </div>\n <div>\n <%= name3 %>: <span id="span-stat-value3"></span>\n </div>\n </div>\n</div>\n';
}), define("text!html/buttonStatSettingsBlock.html", [], function() {
return '<p>Adds a "Document statistics" button over the preview.</p>\n<div class="form-horizontal">\n <div class="form-group form-inline">\n <label class="label-text" for="input-stat-name1">Title</label> <input\n id="input-stat-name1" type="text" class="form-control col-lg-3"> <label\n class="label-text" for="input-stat-value1">RegExp</label> <input\n id="input-stat-value1" type="text" class="form-control col-lg-4">\n </div>\n <div class="form-group form-inline">\n <label class="label-text" for="input-stat-name2">Title</label> <input\n id="input-stat-name2" type="text" class="form-control col-lg-3"> <label\n class="label-text" for="input-stat-value2">RegExp</label> <input\n id="input-stat-value2" type="text" class="form-control col-lg-4">\n </div>\n <div class="form-group form-inline">\n <label class="label-text" for="input-stat-name3">Title</label> <input\n id="input-stat-name3" type="text" class="form-control col-lg-3"> <label\n class="label-text" for="input-stat-value3">RegExp</label> <input\n id="input-stat-value3" type="text" class="form-control col-lg-4">\n </div>\n</div>\n';
}), define("extensions/buttonStat", [ "jquery", "underscore", "utils", "classes/Extension", "text!html/buttonStat.html", "text!html/buttonStatSettingsBlock.html" ], function(e, t, n, i, o, r) {
var s = new i("buttonStat", 'Button "Statistics"', !0, !0);
s.settingsBlock = r, s.defaultConfig = {
name1: "Characters",
value1: "\\S",
name2: "Words",
value2: "\\S+",
name3: "Paragraphs",
value3: "\\S.*"
}, s.onLoadSettings = function() {
t.each([ 1, 2, 3 ], function(e) {
n.setInputValue("#input-stat-name" + e, s.config["name" + e]), n.setInputValue("#input-stat-value" + e, s.config["value" + e]);
});
}, s.onSaveSettings = function(e, i) {
t.each([ 1, 2, 3 ], function(t) {
e["name" + t] = n.getInputTextValue("#input-stat-name" + t, i), e["value" + t] = n.getInputRegExpValue("#input-stat-value" + t, i);
});
}, s.onCreatePreviewButton = function() {
return t.template(o, s.config);
};
var a = void 0, l = void 0, c = void 0, u = void 0;
return s.onReady = function() {
a = document.getElementById("preview-contents"), l = document.getElementById("span-stat-value1"),
c = document.getElementById("span-stat-value2"), u = document.getElementById("span-stat-value3");
}, s.onPreviewFinished = function() {
for (var e = a.cloneNode(!0), t = e.getElementsByTagName("script"), n = t.length - 1; n >= 0; n--) {
var i = t[n];
i.parentNode.removeChild(i);
}
var o = e.textContent;
l.textContent = (o.match(new RegExp(s.config.value1, "g")) || []).length, c.textContent = (o.match(new RegExp(s.config.value2, "g")) || []).length,
u.textContent = (o.match(new RegExp(s.config.value3, "g")) || []).length;
}, s;
}), define("text!html/buttonHtmlCode.html", [], function() {
return '<button class="btn btn-default dropdown-toggle action-html-code" title="HTML code" data-toggle="dropdown">\n <i class="icon-code"></i>\n</button>\n<div class="dropdown-menu pull-right">\n <h3>HTML code</h3>\n <textarea id="input-html-code" class="form-control"></textarea>\n</div>\n';
}), define("text!html/buttonHtmlCodeSettingsBlock.html", [], function() {
return '<p>Adds a "HTML code" button over the preview.</p>\n<div class="form-horizontal">\n <div class="form-group">\n <label class="col-lg-4 control-label" for="textarea-html-code-template">Template\n <a href="#" class="tooltip-template">(?)</a>\n </label>\n <div class="col-lg-7">\n <textarea id="textarea-html-code-template" class="form-control"></textarea>\n </div>\n </div>\n</div>';
}), define("extensions/buttonHtmlCode", [ "jquery", "underscore", "utils", "classes/Extension", "text!html/buttonHtmlCode.html", "text!html/buttonHtmlCodeSettingsBlock.html" ], function(e, t, n, i, o, r) {
var s = new i("buttonHtmlCode", 'Button "HTML code"', !0, !0);
s.settingsBlock = r, s.defaultConfig = {
template: "<%= documentHTML %>"
}, s.onLoadSettings = function() {
n.setInputValue("#textarea-html-code-template", s.config.template);
}, s.onSaveSettings = function(e) {
e.template = n.getInputValue("#textarea-html-code-template");
};
var a = void 0;
s.onEventMgrCreated = function(e) {
a = e;
}, s.onCreatePreviewButton = function() {
return o;
};
var l = void 0;
s.onFileSelected = function(e) {
l = e;
};
var c = void 0;
return s.onPreviewFinished = function(e) {
try {
var n = t.template(s.config.template, {
documentTitle: l.title,
documentMarkdown: l.content,
documentHTML: e
});
c.value = n;
} catch (i) {
return a.onError(i), i.message;
}
}, s.onReady = function() {
c = document.getElementById("input-html-code"), e(".action-html-code").click(function() {
t.defer(function() {
e("#input-html-code").each(function() {
e(this).is(":hidden") || this.select();
});
});
});
}, s;
}), define("text!html/buttonViewer.html", [], function() {
return '<a href="viewer.html" class="btn btn-default dropdown-toggle"\n title="Open in viewer">\n <i class="icon-resize-full"></i>\n</a>\n';
}), define("extensions/buttonViewer", [ "jquery", "classes/Extension", "text!html/buttonViewer.html" ], function(e, t, n) {
var i = new t("buttonViewer", 'Button "Viewer"', !0, !0);
return i.settingsBlock = '<p>Adds a "Viewer" button over the preview.</p>', i.onCreatePreviewButton = function() {
return n;
}, i;
}), !jQuery) throw new Error("Bootstrap requires jQuery");
+function(e) {
function t() {
var e = document.createElement("bootstrap"), t = {
WebkitTransition: "webkitTransitionEnd",
MozTransition: "transitionend",
OTransition: "oTransitionEnd otransitionend",
transition: "transitionend"
};
for (var n in t) if (void 0 !== e.style[n]) return {
end: t[n]
};
}
e.fn.emulateTransitionEnd = function(t) {
var n = !1, i = this;
e(this).one(e.support.transition.end, function() {
n = !0;
});
var o = function() {
n || e(i).trigger(e.support.transition.end);
};
return setTimeout(o, t), this;
}, e(function() {
e.support.transition = t();
});
}(window.jQuery), +function(e) {
var t = '[data-dismiss="alert"]', n = function(n) {
e(n).on("click", t, this.close);
};
n.prototype.close = function(t) {
function n() {
r.trigger("closed.bs.alert").remove();
}
var i = e(this), o = i.attr("data-target");
o || (o = i.attr("href"), o = o && o.replace(/.*(?=#[^\s]*$)/, ""));
var r = e(o);
t && t.preventDefault(), r.length || (r = i.hasClass("alert") ? i : i.parent()),
r.trigger(t = e.Event("close.bs.alert")), t.isDefaultPrevented() || (r.removeClass("in"),
e.support.transition && r.hasClass("fade") ? r.one(e.support.transition.end, n).emulateTransitionEnd(150) : n());
};
var i = e.fn.alert;
e.fn.alert = function(t) {
return this.each(function() {
var i = e(this), o = i.data("bs.alert");
o || i.data("bs.alert", o = new n(this)), "string" == typeof t && o[t].call(i);
});
}, e.fn.alert.Constructor = n, e.fn.alert.noConflict = function() {
return e.fn.alert = i, this;
}, e(document).on("click.bs.alert.data-api", t, n.prototype.close);
}(window.jQuery), +function(e) {
var t = function(n, i) {
this.$element = e(n), this.options = e.extend({}, t.DEFAULTS, i);
};
t.DEFAULTS = {
loadingText: "loading..."
}, t.prototype.setState = function(e) {
var t = "disabled", n = this.$element, i = n.is("input") ? "val" : "html", o = n.data();
e += "Text", o.resetText || n.data("resetText", n[i]()), n[i](o[e] || this.options[e]),
setTimeout(function() {
"loadingText" == e ? n.addClass(t).attr(t, t) : n.removeClass(t).removeAttr(t);
}, 0);
}, t.prototype.toggle = function() {
var e = this.$element.closest('[data-toggle="buttons"]');
if (e.length) {
var t = this.$element.find("input").prop("checked", !this.$element.hasClass("active")).trigger("change");
"radio" === t.prop("type") && e.find(".active").removeClass("active");
}
this.$element.toggleClass("active");
};
var n = e.fn.button;
e.fn.button = function(n) {
return this.each(function() {
var i = e(this), o = i.data("bs.button"), r = "object" == typeof n && n;
o || i.data("bs.button", o = new t(this, r)), "toggle" == n ? o.toggle() : n && o.setState(n);
});
}, e.fn.button.Constructor = t, e.fn.button.noConflict = function() {
return e.fn.button = n, this;
}, e(document).on("click.bs.button.data-api", "[data-toggle^=button]", function(t) {
var n = e(t.target);
n.hasClass("btn") || (n = n.closest(".btn")), n.button("toggle"), t.preventDefault();
});
}(window.jQuery), +function(e) {
var t = function(t, n) {
this.$element = e(t), this.$indicators = this.$element.find(".carousel-indicators"),
this.options = n, this.paused = this.sliding = this.interval = this.$active = this.$items = null,
"hover" == this.options.pause && this.$element.on("mouseenter", e.proxy(this.pause, this)).on("mouseleave", e.proxy(this.cycle, this));
};
t.DEFAULTS = {
interval: 5e3,
pause: "hover",
wrap: !0
}, t.prototype.cycle = function(t) {
return t || (this.paused = !1), this.interval && clearInterval(this.interval), this.options.interval && !this.paused && (this.interval = setInterval(e.proxy(this.next, this), this.options.interval)),
this;
}, t.prototype.getActiveIndex = function() {
return this.$active = this.$element.find(".item.active"), this.$items = this.$active.parent().children(),
this.$items.index(this.$active);
}, t.prototype.to = function(t) {
var n = this, i = this.getActiveIndex();
return t > this.$items.length - 1 || 0 > t ? void 0 : this.sliding ? this.$element.one("slid", function() {
n.to(t);
}) : i == t ? this.pause().cycle() : this.slide(t > i ? "next" : "prev", e(this.$items[t]));
}, t.prototype.pause = function(t) {
return t || (this.paused = !0), this.$element.find(".next, .prev").length && e.support.transition.end && (this.$element.trigger(e.support.transition.end),
this.cycle(!0)), this.interval = clearInterval(this.interval), this;
}, t.prototype.next = function() {
return this.sliding ? void 0 : this.slide("next");
}, t.prototype.prev = function() {
return this.sliding ? void 0 : this.slide("prev");
}, t.prototype.slide = function(t, n) {
var i = this.$element.find(".item.active"), o = n || i[t](), r = this.interval, s = "next" == t ? "left" : "right", a = "next" == t ? "first" : "last", l = this;
if (!o.length) {
if (!this.options.wrap) return;
o = this.$element.find(".item")[a]();
}
this.sliding = !0, r && this.pause();
var c = e.Event("slide.bs.carousel", {
relatedTarget: o[0],
direction: s
});
if (!o.hasClass("active")) {
if (this.$indicators.length && (this.$indicators.find(".active").removeClass("active"),
this.$element.one("slid", function() {
var t = e(l.$indicators.children()[l.getActiveIndex()]);
t && t.addClass("active");
})), e.support.transition && this.$element.hasClass("slide")) {
if (this.$element.trigger(c), c.isDefaultPrevented()) return;
o.addClass(t), o[0].offsetWidth, i.addClass(s), o.addClass(s), i.one(e.support.transition.end, function() {
o.removeClass([ t, s ].join(" ")).addClass("active"), i.removeClass([ "active", s ].join(" ")),
l.sliding = !1, setTimeout(function() {
l.$element.trigger("slid");
}, 0);
}).emulateTransitionEnd(600);
} else {
if (this.$element.trigger(c), c.isDefaultPrevented()) return;
i.removeClass("active"), o.addClass("active"), this.sliding = !1, this.$element.trigger("slid");
}
return r && this.cycle(), this;
}
};
var n = e.fn.carousel;
e.fn.carousel = function(n) {
return this.each(function() {
var i = e(this), o = i.data("bs.carousel"), r = e.extend({}, t.DEFAULTS, i.data(), "object" == typeof n && n), s = "string" == typeof n ? n : r.slide;
o || i.data("bs.carousel", o = new t(this, r)), "number" == typeof n ? o.to(n) : s ? o[s]() : r.interval && o.pause().cycle();
});
}, e.fn.carousel.Constructor = t, e.fn.carousel.noConflict = function() {
return e.fn.carousel = n, this;
}, e(document).on("click.bs.carousel.data-api", "[data-slide], [data-slide-to]", function(t) {
var n, i = e(this), o = e(i.attr("data-target") || (n = i.attr("href")) && n.replace(/.*(?=#[^\s]+$)/, "")), r = e.extend({}, o.data(), i.data()), s = i.attr("data-slide-to");
s && (r.interval = !1), o.carousel(r), (s = i.attr("data-slide-to")) && o.data("bs.carousel").to(s),
t.preventDefault();
}), e(window).on("load", function() {
e('[data-ride="carousel"]').each(function() {
var t = e(this);
t.carousel(t.data());
});
});
}(window.jQuery), +function(e) {
var t = function(n, i) {
this.$element = e(n), this.options = e.extend({}, t.DEFAULTS, i), this.transitioning = null,
this.options.parent && (this.$parent = e(this.options.parent)), this.options.toggle && this.toggle();
};
t.DEFAULTS = {
toggle: !0
}, t.prototype.dimension = function() {
var e = this.$element.hasClass("width");
return e ? "width" : "height";
}, t.prototype.show = function() {
if (!this.transitioning && !this.$element.hasClass("in")) {
var t = e.Event("show.bs.collapse");
if (this.$element.trigger(t), !t.isDefaultPrevented()) {
var n = this.$parent && this.$parent.find("> .panel > .in");
if (n && n.length) {
var i = n.data("bs.collapse");
if (i && i.transitioning) return;
n.collapse("hide"), i || n.data("bs.collapse", null);
}
var o = this.dimension();
this.$element.removeClass("collapse").addClass("collapsing")[o](0), this.transitioning = 1;
var r = function() {
this.$element.removeClass("collapsing").addClass("in")[o]("auto"), this.transitioning = 0,
this.$element.trigger("shown.bs.collapse");
};
if (!e.support.transition) return r.call(this);
var s = e.camelCase([ "scroll", o ].join("-"));
this.$element.one(e.support.transition.end, e.proxy(r, this)).emulateTransitionEnd(350)[o](this.$element[0][s]);
}
}
}, t.prototype.hide = function() {
if (!this.transitioning && this.$element.hasClass("in")) {
var t = e.Event("hide.bs.collapse");
if (this.$element.trigger(t), !t.isDefaultPrevented()) {
var n = this.dimension();
this.$element[n](this.$element[n]())[0].offsetHeight, this.$element.addClass("collapsing").removeClass("collapse").removeClass("in"),
this.transitioning = 1;
var i = function() {
this.transitioning = 0, this.$element.trigger("hidden.bs.collapse").removeClass("collapsing").addClass("collapse");
};
return e.support.transition ? (this.$element[n](0).one(e.support.transition.end, e.proxy(i, this)).emulateTransitionEnd(350),
void 0) : i.call(this);
}
}
}, t.prototype.toggle = function() {
this[this.$element.hasClass("in") ? "hide" : "show"]();
};
var n = e.fn.collapse;
e.fn.collapse = function(n) {
return this.each(function() {
var i = e(this), o = i.data("bs.collapse"), r = e.extend({}, t.DEFAULTS, i.data(), "object" == typeof n && n);
o || i.data("bs.collapse", o = new t(this, r)), "string" == typeof n && o[n]();
});
}, e.fn.collapse.Constructor = t, e.fn.collapse.noConflict = function() {
return e.fn.collapse = n, this;
}, e(document).on("click.bs.collapse.data-api", "[data-toggle=collapse]", function(t) {
var n, i = e(this), o = i.attr("data-target") || t.preventDefault() || (n = i.attr("href")) && n.replace(/.*(?=#[^\s]+$)/, ""), r = e(o), s = r.data("bs.collapse"), a = s ? "toggle" : i.data(), l = i.attr("data-parent"), c = l && e(l);
s && s.transitioning || (c && c.find('[data-toggle=collapse][data-parent="' + l + '"]').not(i).addClass("collapsed"),
i[r.hasClass("in") ? "addClass" : "removeClass"]("collapsed")), r.collapse(a);
});
}(window.jQuery), +function(e) {
function t() {
e(i).remove(), e(o).each(function(t) {
var i = n(e(this));
i.hasClass("open") && (i.trigger(t = e.Event("hide.bs.dropdown")), t.isDefaultPrevented() || i.removeClass("open").trigger("hidden.bs.dropdown"));
});
}
function n(t) {
var n = t.attr("data-target");
n || (n = t.attr("href"), n = n && /#/.test(n) && n.replace(/.*(?=#[^\s]*$)/, ""));
var i = n && e(n);
return i && i.length ? i : t.parent();
}
var i = ".dropdown-backdrop", o = "[data-toggle=dropdown]", r = function(t) {
e(t).on("click.bs.dropdown", this.toggle);
};
r.prototype.toggle = function(i) {
var o = e(this);
if (!o.is(".disabled, :disabled")) {
var r = n(o), s = r.hasClass("open");
if (t(), !s) {
if ("ontouchstart" in document.documentElement && !r.closest(".navbar-nav").length && e('<div class="dropdown-backdrop"/>').insertAfter(e(this)).on("click", t),
r.trigger(i = e.Event("show.bs.dropdown")), i.isDefaultPrevented()) return;
r.toggleClass("open").trigger("shown.bs.dropdown"), o.focus();
}
return !1;
}
}, r.prototype.keydown = function(t) {
if (/(38|40|27)/.test(t.keyCode)) {
var i = e(this);
if (t.preventDefault(), t.stopPropagation(), !i.is(".disabled, :disabled")) {
var r = n(i), s = r.hasClass("open");
if (!s || s && 27 == t.keyCode) return 27 == t.which && r.find(o).focus(), i.click();
var a = e("[role=menu] li:not(.divider):visible a", r);
if (a.length) {
var l = a.index(a.filter(":focus"));
38 == t.keyCode && l > 0 && l--, 40 == t.keyCode && l < a.length - 1 && l++, ~l || (l = 0),
a.eq(l).focus();
}
}
}
};
var s = e.fn.dropdown;
e.fn.dropdown = function(t) {
return this.each(function() {
var n = e(this), i = n.data("dropdown");
i || n.data("dropdown", i = new r(this)), "string" == typeof t && i[t].call(n);
});
}, e.fn.dropdown.Constructor = r, e.fn.dropdown.noConflict = function() {
return e.fn.dropdown = s, this;
}, e(document).on("click.bs.dropdown.data-api", t).on("click.bs.dropdown.data-api", ".dropdown form", function(e) {
e.stopPropagation();
}).on("click.bs.dropdown.data-api", o, r.prototype.toggle).on("keydown.bs.dropdown.data-api", o + ", [role=menu]", r.prototype.keydown);
}(window.jQuery), +function(e) {
var t = function(t, n) {
this.options = n, this.$element = e(t), this.$backdrop = this.isShown = null, this.options.remote && this.$element.load(this.options.remote);
};
t.DEFAULTS = {
backdrop: !0,
keyboard: !0,
show: !0
}, t.prototype.toggle = function(e) {
return this[this.isShown ? "hide" : "show"](e);
}, t.prototype.show = function(t) {
var n = this, i = e.Event("show.bs.modal", {
relatedTarget: t
});
this.$element.trigger(i), this.isShown || i.isDefaultPrevented() || (this.isShown = !0,
this.escape(), this.$element.on("click.dismiss.modal", '[data-dismiss="modal"]', e.proxy(this.hide, this)),
this.backdrop(function() {
var i = e.support.transition && n.$element.hasClass("fade");
n.$element.parent().length || n.$element.appendTo(document.body), n.$element.show(),
i && n.$element[0].offsetWidth, n.$element.addClass("in").attr("aria-hidden", !1),
n.enforceFocus();
var o = e.Event("shown.bs.modal", {
relatedTarget: t
});
i ? n.$element.find(".modal-dialog").one(e.support.transition.end, function() {
n.$element.focus().trigger(o);
}).emulateTransitionEnd(300) : n.$element.focus().trigger(o);
}));
}, t.prototype.hide = function(t) {
t && t.preventDefault(), t = e.Event("hide.bs.modal"), this.$element.trigger(t),
this.isShown && !t.isDefaultPrevented() && (this.isShown = !1, this.escape(), e(document).off("focusin.bs.modal"),
this.$element.removeClass("in").attr("aria-hidden", !0).off("click.dismiss.modal"),
e.support.transition && this.$element.hasClass("fade") ? this.$element.one(e.support.transition.end, e.proxy(this.hideModal, this)).emulateTransitionEnd(300) : this.hideModal());
}, t.prototype.enforceFocus = function() {
e(document).off("focusin.bs.modal").on("focusin.bs.modal", e.proxy(function(e) {
this.$element[0] === e.target || this.$element.has(e.target).length || this.$element.focus();
}, this));
}, t.prototype.escape = function() {
this.isShown && this.options.keyboard ? this.$element.on("keyup.dismiss.bs.modal", e.proxy(function(e) {
27 == e.which && this.hide();
}, this)) : this.isShown || this.$element.off("keyup.dismiss.bs.modal");
}, t.prototype.hideModal = function() {
var e = this;
this.$element.hide(), this.backdrop(function() {
e.removeBackdrop(), e.$element.trigger("hidden.bs.modal");
});
}, t.prototype.removeBackdrop = function() {
this.$backdrop && this.$backdrop.remove(), this.$backdrop = null;
}, t.prototype.backdrop = function(t) {
var n = this.$element.hasClass("fade") ? "fade" : "";
if (this.isShown && this.options.backdrop) {
var i = e.support.transition && n;
if (this.$backdrop = e('<div class="modal-backdrop ' + n + '" />').appendTo(document.body),
this.$element.on("click.dismiss.modal", e.proxy(function(e) {
e.target === e.currentTarget && ("static" == this.options.backdrop ? this.$element[0].focus.call(this.$element[0]) : this.hide.call(this));
}, this)), i && this.$backdrop[0].offsetWidth, this.$backdrop.addClass("in"), !t) return;
i ? this.$backdrop.one(e.support.transition.end, t).emulateTransitionEnd(150) : t();
} else !this.isShown && this.$backdrop ? (this.$backdrop.removeClass("in"), e.support.transition && this.$element.hasClass("fade") ? this.$backdrop.one(e.support.transition.end, t).emulateTransitionEnd(150) : t()) : t && t();
};
var n = e.fn.modal;
e.fn.modal = function(n, i) {
return this.each(function() {
var o = e(this), r = o.data("bs.modal"), s = e.extend({}, t.DEFAULTS, o.data(), "object" == typeof n && n);
r || o.data("bs.modal", r = new t(this, s)), "string" == typeof n ? r[n](i) : s.show && r.show(i);
});
}, e.fn.modal.Constructor = t, e.fn.modal.noConflict = function() {
return e.fn.modal = n, this;
}, e(document).on("click.bs.modal.data-api", '[data-toggle="modal"]', function(t) {
var n = e(this), i = n.attr("href"), o = e(n.attr("data-target") || i && i.replace(/.*(?=#[^\s]+$)/, "")), r = o.data("modal") ? "toggle" : e.extend({
remote: !/#/.test(i) && i
}, o.data(), n.data());
t.preventDefault(), o.modal(r, this).one("hide", function() {
n.is(":visible") && n.focus();
});
}), e(document).on("show.bs.modal", ".modal", function() {
e(document.body).addClass("modal-open");
}).on("hidden.bs.modal", ".modal", function() {
e(document.body).removeClass("modal-open");
});
}(window.jQuery), +function(e) {
var t = function(e, t) {
this.type = this.options = this.enabled = this.timeout = this.hoverState = this.$element = null,
this.init("tooltip", e, t);
};
t.DEFAULTS = {
animation: !0,
placement: "top",
selector: !1,
template: '<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',
trigger: "hover focus",
title: "",
delay: 0,
html: !1,
container: !1
}, t.prototype.init = function(t, n, i) {
this.enabled = !0, this.type = t, this.$element = e(n), this.options = this.getOptions(i);
for (var o = this.options.trigger.split(" "), r = o.length; r--; ) {
var s = o[r];
if ("click" == s) this.$element.on("click." + this.type, this.options.selector, e.proxy(this.toggle, this)); else if ("manual" != s) {
var a = "hover" == s ? "mouseenter" : "focus", l = "hover" == s ? "mouseleave" : "blur";
this.$element.on(a + "." + this.type, this.options.selector, e.proxy(this.enter, this)),
this.$element.on(l + "." + this.type, this.options.selector, e.proxy(this.leave, this));
}
}
this.options.selector ? this._options = e.extend({}, this.options, {
trigger: "manual",
selector: ""
}) : this.fixTitle();
}, t.prototype.getDefaults = function() {
return t.DEFAULTS;
}, t.prototype.getOptions = function(t) {
return t = e.extend({}, this.getDefaults(), this.$element.data(), t), t.delay && "number" == typeof t.delay && (t.delay = {
show: t.delay,
hide: t.delay
}), t;
}, t.prototype.getDelegateOptions = function() {
var t = {}, n = this.getDefaults();
return this._options && e.each(this._options, function(e, i) {
n[e] != i && (t[e] = i);
}), t;
}, t.prototype.enter = function(t) {
var n = t instanceof this.constructor ? t : e(t.currentTarget)[this.type](this.getDelegateOptions()).data("bs." + this.type);
return clearTimeout(n.timeout), n.hoverState = "in", n.options.delay && n.options.delay.show ? (n.timeout = setTimeout(function() {
"in" == n.hoverState && n.show();
}, n.options.delay.show), void 0) : n.show();
}, t.prototype.leave = function(t) {
var n = t instanceof this.constructor ? t : e(t.currentTarget)[this.type](this.getDelegateOptions()).data("bs." + this.type);
return clearTimeout(n.timeout), n.hoverState = "out", n.options.delay && n.options.delay.hide ? (n.timeout = setTimeout(function() {
"out" == n.hoverState && n.hide();
}, n.options.delay.hide), void 0) : n.hide();
}, t.prototype.show = function() {
var t = e.Event("show.bs." + this.type);
if (this.hasContent() && this.enabled) {
if (this.$element.trigger(t), t.isDefaultPrevented()) return;
var n = this.tip();
this.setContent(), this.options.animation && n.addClass("fade");
var i = "function" == typeof this.options.placement ? this.options.placement.call(this, n[0], this.$element[0]) : this.options.placement, o = /\s?auto?\s?/i, r = o.test(i);
r && (i = i.replace(o, "") || "top"), n.detach().css({
top: 0,
left: 0,
display: "block"
}).addClass(i), this.options.container ? n.appendTo(this.options.container) : n.insertAfter(this.$element);
var s = this.getPosition(), a = n[0].offsetWidth, l = n[0].offsetHeight;
if (r) {
var c = this.$element.parent(), u = i, d = document.documentElement.scrollTop || document.body.scrollTop, h = "body" == this.options.container ? window.innerWidth : c.outerWidth(), p = "body" == this.options.container ? window.innerHeight : c.outerHeight(), f = "body" == this.options.container ? 0 : c.offset().left;
i = "bottom" == i && s.top + s.height + l - d > p ? "top" : "top" == i && s.top - d - l < 0 ? "bottom" : "right" == i && s.right + a > h ? "left" : "left" == i && s.left - a < f ? "right" : i,
n.removeClass(u).addClass(i);
}
var g = this.getCalculatedOffset(i, s, a, l);
this.applyPlacement(g, i), this.$element.trigger("shown.bs." + this.type);
}
}, t.prototype.applyPlacement = function(e, t) {
var n, i = this.tip(), o = i[0].offsetWidth, r = i[0].offsetHeight, s = parseInt(i.css("margin-top"), 10), a = parseInt(i.css("margin-left"), 10);
isNaN(s) && (s = 0), isNaN(a) && (a = 0), e.top = e.top + s, e.left = e.left + a,
i.offset(e).addClass("in");
var l = i[0].offsetWidth, c = i[0].offsetHeight;
if ("top" == t && c != r && (n = !0, e.top = e.top + r - c), /bottom|top/.test(t)) {
var u = 0;
e.left < 0 && (u = -2 * e.left, e.left = 0, i.offset(e), l = i[0].offsetWidth, c = i[0].offsetHeight),
this.replaceArrow(u - o + l, l, "left");
} else this.replaceArrow(c - r, c, "top");
n && i.offset(e);
}, t.prototype.replaceArrow = function(e, t, n) {
this.arrow().css(n, e ? 50 * (1 - e / t) + "%" : "");
}, t.prototype.setContent = function() {
var e = this.tip(), t = this.getTitle();
e.find(".tooltip-inner")[this.options.html ? "html" : "text"](t), e.removeClass("fade in top bottom left right");
}, t.prototype.hide = function() {
function t() {
"in" != n.hoverState && i.detach();
}
var n = this, i = this.tip(), o = e.Event("hide.bs." + this.type);
return this.$element.trigger(o), o.isDefaultPrevented() ? void 0 : (i.removeClass("in"),
e.support.transition && this.$tip.hasClass("fade") ? i.one(e.support.transition.end, t).emulateTransitionEnd(150) : t(),
this.$element.trigger("hidden.bs." + this.type), this);
}, t.prototype.fixTitle = function() {
var e = this.$element;
(e.attr("title") || "string" != typeof e.attr("data-original-title")) && e.attr("data-original-title", e.attr("title") || "").attr("title", "");
}, t.prototype.hasContent = function() {
return this.getTitle();
}, t.prototype.getPosition = function() {
var t = this.$element[0];
return e.extend({}, "function" == typeof t.getBoundingClientRect ? t.getBoundingClientRect() : {
width: t.offsetWidth,
height: t.offsetHeight
}, this.$element.offset());
}, t.prototype.getCalculatedOffset = function(e, t, n, i) {
return "bottom" == e ? {
top: t.top + t.height,
left: t.left + t.width / 2 - n / 2
} : "top" == e ? {
top: t.top - i,
left: t.left + t.width / 2 - n / 2
} : "left" == e ? {
top: t.top + t.height / 2 - i / 2,
left: t.left - n
} : {
top: t.top + t.height / 2 - i / 2,
left: t.left + t.width
};
}, t.prototype.getTitle = function() {
var e, t = this.$element, n = this.options;
return e = t.attr("data-original-title") || ("function" == typeof n.title ? n.title.call(t[0]) : n.title);
}, t.prototype.tip = function() {
return this.$tip = this.$tip || e(this.options.template);
}, t.prototype.arrow = function() {
return this.$arrow = this.$arrow || this.tip().find(".tooltip-arrow");
}, t.prototype.validate = function() {
this.$element[0].parentNode || (this.hide(), this.$element = null, this.options = null);
}, t.prototype.enable = function() {
this.enabled = !0;
}, t.prototype.disable = function() {
this.enabled = !1;
}, t.prototype.toggleEnabled = function() {
this.enabled = !this.enabled;
}, t.prototype.toggle = function(t) {
var n = t ? e(t.currentTarget)[this.type](this.getDelegateOptions()).data("bs." + this.type) : this;
n.tip().hasClass("in") ? n.leave(n) : n.enter(n);
}, t.prototype.destroy = function() {
this.hide().$element.off("." + this.type).removeData("bs." + this.type);
};
var n = e.fn.tooltip;
e.fn.tooltip = function(n) {
return this.each(function() {
var i = e(this), o = i.data("bs.tooltip"), r = "object" == typeof n && n;
o || i.data("bs.tooltip", o = new t(this, r)), "string" == typeof n && o[n]();
});
}, e.fn.tooltip.Constructor = t, e.fn.tooltip.noConflict = function() {
return e.fn.tooltip = n, this;
};
}(window.jQuery), +function(e) {
var t = function(e, t) {
this.init("popover", e, t);
};
if (!e.fn.tooltip) throw new Error("Popover requires tooltip.js");
t.DEFAULTS = e.extend({}, e.fn.tooltip.Constructor.DEFAULTS, {
placement: "right",
trigger: "click",
content: "",
template: '<div class="popover"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'
}), t.prototype = e.extend({}, e.fn.tooltip.Constructor.prototype), t.prototype.constructor = t,
t.prototype.getDefaults = function() {
return t.DEFAULTS;
}, t.prototype.setContent = function() {
var e = this.tip(), t = this.getTitle(), n = this.getContent();
e.find(".popover-title")[this.options.html ? "html" : "text"](t), e.find(".popover-content")[this.options.html ? "html" : "text"](n),
e.removeClass("fade top bottom left right in"), e.find(".popover-title").html() || e.find(".popover-title").hide();
}, t.prototype.hasContent = function() {
return this.getTitle() || this.getContent();
}, t.prototype.getContent = function() {
var e = this.$element, t = this.options;
return e.attr("data-content") || ("function" == typeof t.content ? t.content.call(e[0]) : t.content);
}, t.prototype.arrow = function() {
return this.$arrow = this.$arrow || this.tip().find(".arrow");
}, t.prototype.tip = function() {
return this.$tip || (this.$tip = e(this.options.template)), this.$tip;
};
var n = e.fn.popover;
e.fn.popover = function(n) {
return this.each(function() {
var i = e(this), o = i.data("bs.popover"), r = "object" == typeof n && n;
o || i.data("bs.popover", o = new t(this, r)), "string" == typeof n && o[n]();
});
}, e.fn.popover.Constructor = t, e.fn.popover.noConflict = function() {
return e.fn.popover = n, this;
};
}(window.jQuery), +function(e) {
function t(n, i) {
var o, r = e.proxy(this.process, this);
this.$element = e(n).is("body") ? e(window) : e(n), this.$body = e("body"), this.$scrollElement = this.$element.on("scroll.bs.scroll-spy.data-api", r),
this.options = e.extend({}, t.DEFAULTS, i), this.selector = (this.options.target || (o = e(n).attr("href")) && o.replace(/.*(?=#[^\s]+$)/, "") || "") + " .nav li > a",
this.offsets = e([]), this.targets = e([]), this.activeTarget = null, this.refresh(),
this.process();
}
t.DEFAULTS = {
offset: 10
}, t.prototype.refresh = function() {
var t = this.$element[0] == window ? "offset" : "position";
this.offsets = e([]), this.targets = e([]);
var n = this;
this.$body.find(this.selector).map(function() {
var i = e(this), o = i.data("target") || i.attr("href"), r = /^#\w/.test(o) && e(o);
return r && r.length && [ [ r[t]().top + (!e.isWindow(n.$scrollElement.get(0)) && n.$scrollElement.scrollTop()), o ] ] || null;
}).sort(function(e, t) {
return e[0] - t[0];
}).each(function() {
n.offsets.push(this[0]), n.targets.push(this[1]);
});
}, t.prototype.process = function() {
var e, t = this.$scrollElement.scrollTop() + this.options.offset, n = this.$scrollElement[0].scrollHeight || this.$body[0].scrollHeight, i = n - this.$scrollElement.height(), o = this.offsets, r = this.targets, s = this.activeTarget;
if (t >= i) return s != (e = r.last()[0]) && this.activate(e);
for (e = o.length; e--; ) s != r[e] && t >= o[e] && (!o[e + 1] || t <= o[e + 1]) && this.activate(r[e]);
}, t.prototype.activate = function(t) {
this.activeTarget = t, e(this.selector).parents(".active").removeClass("active");
var n = this.selector + '[data-target="' + t + '"],' + this.selector + '[href="' + t + '"]', i = e(n).parents("li").addClass("active");
i.parent(".dropdown-menu").length && (i = i.closest("li.dropdown").addClass("active")),
i.trigger("activate");
};
var n = e.fn.scrollspy;
e.fn.scrollspy = function(n) {
return this.each(function() {
var i = e(this), o = i.data("bs.scrollspy"), r = "object" == typeof n && n;
o || i.data("bs.scrollspy", o = new t(this, r)), "string" == typeof n && o[n]();
});
}, e.fn.scrollspy.Constructor = t, e.fn.scrollspy.noConflict = function() {
return e.fn.scrollspy = n, this;
}, e(window).on("load", function() {
e('[data-spy="scroll"]').each(function() {
var t = e(this);
t.scrollspy(t.data());
});
});
}(window.jQuery), +function(e) {
var t = function(t) {
this.element = e(t);
};
t.prototype.show = function() {
var t = this.element, n = t.closest("ul:not(.dropdown-menu)"), i = t.attr("data-target");
if (i || (i = t.attr("href"), i = i && i.replace(/.*(?=#[^\s]*$)/, "")), !t.parent("li").hasClass("active")) {
var o = n.find(".active:last a")[0], r = e.Event("show.bs.tab", {
relatedTarget: o
});
if (t.trigger(r), !r.isDefaultPrevented()) {
var s = e(i);
this.activate(t.parent("li"), n), this.activate(s, s.parent(), function() {
t.trigger({
type: "shown.bs.tab",
relatedTarget: o
});
});
}
}
}, t.prototype.activate = function(t, n, i) {
function o() {
r.removeClass("active").find("> .dropdown-menu > .active").removeClass("active"),
t.addClass("active"), s ? (t[0].offsetWidth, t.addClass("in")) : t.removeClass("fade"),
t.parent(".dropdown-menu") && t.closest("li.dropdown").addClass("active"), i && i();
}
var r = n.find("> .active"), s = i && e.support.transition && r.hasClass("fade");
s ? r.one(e.support.transition.end, o).emulateTransitionEnd(150) : o(), r.removeClass("in");
};
var n = e.fn.tab;
e.fn.tab = function(n) {
return this.each(function() {
var i = e(this), o = i.data("bs.tab");
o || i.data("bs.tab", o = new t(this)), "string" == typeof n && o[n]();
});
}, e.fn.tab.Constructor = t, e.fn.tab.noConflict = function() {
return e.fn.tab = n, this;
}, e(document).on("click.bs.tab.data-api", '[data-toggle="tab"], [data-toggle="pill"]', function(t) {
t.preventDefault(), e(this).tab("show");
});
}(window.jQuery), +function(e) {
var t = function(n, i) {
this.options = e.extend({}, t.DEFAULTS, i), this.$window = e(window).on("scroll.bs.affix.data-api", e.proxy(this.checkPosition, this)).on("click.bs.affix.data-api", e.proxy(this.checkPositionWithEventLoop, this)),
this.$element = e(n), this.affixed = this.unpin = null, this.checkPosition();
};
t.RESET = "affix affix-top affix-bottom", t.DEFAULTS = {
offset: 0
}, t.prototype.checkPositionWithEventLoop = function() {
setTimeout(e.proxy(this.checkPosition, this), 1);
}, t.prototype.checkPosition = function() {
if (this.$element.is(":visible")) {
var n = e(document).height(), i = this.$window.scrollTop(), o = this.$element.offset(), r = this.options.offset, s = r.top, a = r.bottom;
"object" != typeof r && (a = s = r), "function" == typeof s && (s = r.top()), "function" == typeof a && (a = r.bottom());
var l = null != this.unpin && i + this.unpin <= o.top ? !1 : null != a && o.top + this.$element.height() >= n - a ? "bottom" : null != s && s >= i ? "top" : !1;
this.affixed !== l && (this.unpin && this.$element.css("top", ""), this.affixed = l,
this.unpin = "bottom" == l ? o.top - i : null, this.$element.removeClass(t.RESET).addClass("affix" + (l ? "-" + l : "")),
"bottom" == l && this.$element.offset({
top: document.body.offsetHeight - a - this.$element.height()
}));
}
};
var n = e.fn.affix;
e.fn.affix = function(n) {
return this.each(function() {
var i = e(this), o = i.data("bs.affix"), r = "object" == typeof n && n;
o || i.data("bs.affix", o = new t(this, r)), "string" == typeof n && o[n]();
});
}, e.fn.affix.Constructor = t, e.fn.affix.noConflict = function() {
return e.fn.affix = n, this;
}, e(window).on("load", function() {
e('[data-spy="affix"]').each(function() {
var t = e(this), n = t.data();
n.offset = n.offset || {}, n.offsetBottom && (n.offset.bottom = n.offsetBottom),
n.offsetTop && (n.offset.top = n.offsetTop), t.affix(n);
});
});
}(window.jQuery), define("bootstrap", function() {}), function() {
(function(e, t) {
var n, i;
return i = t.document, n = function() {
function n(n) {
this._options = e.extend({
name: "tour",
container: "body",
keyboard: !0,
storage: t.localStorage,
debug: !1,
backdrop: !1,
redirect: !0,
orphan: !1,
basePath: "",
template: "<div class='popover'> <div class='arrow'></div> <h3 class='popover-title'></h3> <div class='popover-content'></div> <nav class='popover-navigation'> <div class='btn-group'> <button class='btn btn-sm btn-default' data-role='prev'>&laquo; Prev</button> <button class='btn btn-sm btn-default' data-role='next'>Next &raquo;</button> </div> <button class='btn btn-sm btn-default' data-role='end'>End tour</button> </nav> </div>",
afterSetState: function() {},
afterGetState: function() {},
afterRemoveState: function() {},
onStart: function() {},
onEnd: function() {},
onShow: function() {},
onShown: function() {},
onHide: function() {},
onHidden: function() {},
onNext: function() {},
onPrev: function() {}
}, n), this._steps = [], this.setCurrentStep(), this.backdrop = {
overlay: null,
$element: null,
$background: null
};
}
return n.prototype.setState = function(e, t) {
var n;
return this._options.storage ? (n = "" + this._options.name + "_" + e, this._options.storage.setItem(n, t),
this._options.afterSetState(n, t)) : (null == this._state && (this._state = {}),
this._state[e] = t);
}, n.prototype.removeState = function(e) {
var t;
return this._options.storage ? (t = "" + this._options.name + "_" + e, this._options.storage.removeItem(t),
this._options.afterRemoveState(t)) : null != this._state ? delete this._state[e] : void 0;
}, n.prototype.getState = function(e) {
var t, n;
return this._options.storage ? (t = "" + this._options.name + "_" + e, n = this._options.storage.getItem(t)) : null != this._state && (n = this._state[e]),
(void 0 === n || "null" === n) && (n = null), this._options.afterGetState(e, n),
n;
}, n.prototype.addSteps = function(e) {
var t, n, i, o;
for (o = [], n = 0, i = e.length; i > n; n++) t = e[n], o.push(this.addStep(t));
return o;
}, n.prototype.addStep = function(e) {
return this._steps.push(e);
}, n.prototype.getStep = function(t) {
return null != this._steps[t] ? e.extend({
id: "step-" + t,
path: "",
placement: "right",
title: "",
content: "<p></p>",
next: t === this._steps.length - 1 ? -1 : t + 1,
prev: t - 1,
animation: !0,
container: this._options.container,
backdrop: this._options.backdrop,
redirect: this._options.redirect,
orphan: this._options.orphan,
template: this._options.template,
onShow: this._options.onShow,
onShown: this._options.onShown,
onHide: this._options.onHide,
onHidden: this._options.onHidden,
onNext: this._options.onNext,
onPrev: this._options.onPrev
}, this._steps[t]) : void 0;
}, n.prototype.start = function(t) {
var n, o = this;
return null == t && (t = !1), this.ended() && !t ? this._debug("Tour ended, start prevented.") : (e(i).off("click.tour-" + this._options.name, ".popover.tour-" + this._options.name + " *[data-role=next]").on("click.tour-" + this._options.name, ".popover.tour-" + this._options.name + " *[data-role=next]:not(.disabled)", function(e) {
return e.preventDefault(), o.next();
}), e(i).off("click.tour-" + this._options.name, ".popover.tour-" + this._options.name + " *[data-role=prev]").on("click.tour-" + this._options.name, ".popover.tour-" + this._options.name + " *[data-role=prev]:not(.disabled)", function(e) {
return e.preventDefault(), o.prev();
}), e(i).off("click.tour-" + this._options.name, ".popover.tour-" + this._options.name + " *[data-role=end]").on("click.tour-" + this._options.name, ".popover.tour-" + this._options.name + " *[data-role=end]", function(e) {
return e.preventDefault(), o.end();
}), this._onResize(function() {
return o.showStep(o._current);
}), this._setupKeyboardNavigation(), n = this._makePromise(null != this._options.onStart ? this._options.onStart(this) : void 0),
this._callOnPromiseDone(n, this.showStep, this._current));
}, n.prototype.next = function() {
var e;
return this.ended() ? this._debug("Tour ended, next prevented.") : (e = this.hideStep(this._current),
this._callOnPromiseDone(e, this._showNextStep));
}, n.prototype.prev = function() {
var e;
return this.ended() ? this._debug("Tour ended, prev prevented.") : (e = this.hideStep(this._current),
this._callOnPromiseDone(e, this._showPrevStep));
}, n.prototype.goto = function(e) {
var t;
return this.ended() ? this._debug("Tour ended, goto prevented.") : (t = this.hideStep(this._current),
this._callOnPromiseDone(t, this.showStep, e));
}, n.prototype.end = function() {
var n, o, r = this;
return n = function() {
return e(i).off("click.tour-" + r._options.name), e(i).off("keyup.tour-" + r._options.name),
e(t).off("resize.tour-" + r._options.name), r.setState("end", "yes"), null != r._options.onEnd ? r._options.onEnd(r) : void 0;
}, o = this.hideStep(this._current), this._callOnPromiseDone(o, n);
}, n.prototype.ended = function() {
return !!this.getState("end");
}, n.prototype.restart = function() {
return this.removeState("current_step"), this.removeState("end"), this.setCurrentStep(0),
this.start();
}, n.prototype.hideStep = function(t) {
var n, i, o, r = this;
return o = this.getStep(t), i = this._makePromise(null != o.onHide ? o.onHide(this, t) : void 0),
n = function() {
var t;
return t = r._isOrphan(o) ? e("body") : e(o.element), t.popover("destroy"), o.reflex && t.css("cursor", "").off("click.tour-" + r._options.name),
o.backdrop && r._hideBackdrop(), null != o.onHidden ? o.onHidden(r) : void 0;
}, this._callOnPromiseDone(i, n), i;
}, n.prototype.showStep = function(t) {
var n, o, r, s, a = this;
return (s = this.getStep(t)) ? (r = t < this._current, n = this._makePromise(null != s.onShow ? s.onShow(this, t) : void 0),
o = function() {
var n, o;
if (a.setCurrentStep(t), o = e.isFunction(s.path) ? s.path.call() : a._options.basePath + s.path,
n = [ i.location.pathname, i.location.hash ].join(""), a._isRedirect(o, n)) return a._redirect(s, o),
void 0;
if (a._isOrphan(s)) {
if (!s.orphan) return a._debug("Skip the orphan step " + (a._current + 1) + ". Orphan option is false and the element doesn't exist or is hidden."),
r ? a._showPrevStep() : a._showNextStep(), void 0;
a._debug("Show the orphan step " + (a._current + 1) + ". Orphans option is true.");
}
return s.backdrop && a._showBackdrop(a._isOrphan(s) ? void 0 : s.element), a._showPopover(s, t),
null != s.onShown && s.onShown(a), a._debug("Step " + (a._current + 1) + " of " + a._steps.length);
}, this._callOnPromiseDone(n, o)) : void 0;
}, n.prototype.setCurrentStep = function(e) {
return null != e ? (this._current = e, this.setState("current_step", e)) : (this._current = this.getState("current_step"),
this._current = null === this._current ? 0 : parseInt(this._current, 10));
}, n.prototype._showNextStep = function() {
var e, t, n, i = this;
return n = this.getStep(this._current), t = function() {
return i.showStep(n.next);
}, e = this._makePromise(null != n.onNext ? n.onNext(this) : void 0), this._callOnPromiseDone(e, t);
}, n.prototype._showPrevStep = function() {
var e, t, n, i = this;
return n = this.getStep(this._current), t = function() {
return i.showStep(n.prev);
}, e = this._makePromise(null != n.onPrev ? n.onPrev(this) : void 0), this._callOnPromiseDone(e, t);
}, n.prototype._debug = function(e) {
return this._options.debug ? t.console.log("Bootstrap Tour '" + this._options.name + "' | " + e) : void 0;
}, n.prototype._isRedirect = function(e, t) {
return null != e && "" !== e && e.replace(/\?.*$/, "").replace(/\/?$/, "") !== t.replace(/\/?$/, "");
}, n.prototype._redirect = function(t, n) {
return e.isFunction(t.redirect) ? t.redirect.call(this, n) : t.redirect === !0 ? (this._debug("Redirect to " + n),
i.location.href = n) : void 0;
}, n.prototype._isOrphan = function(t) {
return null == t.element || !e(t.element).length || e(t.element).is(":hidden");
}, n.prototype._showPopover = function(t, n) {
var i, o, r, s, a, l, c = this;
return l = e.extend({}, this._options), r = e.isFunction(t.template) ? e(t.template(n, t)) : e(t.template),
o = r.find(".popover-navigation"), a = this._isOrphan(t), a && (t.element = "body",
t.placement = "top", r = r.addClass("orphan")), i = e(t.element), r.addClass("tour-" + this._options.name),
t.options && e.extend(l, t.options), t.reflex && i.css("cursor", "pointer").on("click.tour-" + this._options.name, function() {
return c._current < c._steps.length - 1 ? c.next() : c.end();
}), t.prev < 0 && o.find("*[data-role=prev]").addClass("disabled"), t.next < 0 && o.find("*[data-role=next]").addClass("disabled"),
t.template = r.clone().wrap("<div>").parent().html(), i.popover({
placement: t.placement,
trigger: "manual",
title: t.title,
content: t.content,
html: !0,
animation: t.animation,
container: t.container,
template: t.template,
selector: t.element
}).popover("show"), s = i.data("bs.popover") ? i.data("bs.popover").tip() : i.data("popover").tip(),
s.attr("id", t.id), this._scrollIntoView(s), this._reposition(s, t), a ? this._center(s) : void 0;
}, n.prototype._reposition = function(t, n) {
var o, r, s, a, l, c, u;
if (a = t[0].offsetWidth, r = t[0].offsetHeight, u = t.offset(), l = u.left, c = u.top,
o = e(i).outerHeight() - u.top - t.outerHeight(), 0 > o && (u.top = u.top + o),
s = e("html").outerWidth() - u.left - t.outerWidth(), 0 > s && (u.left = u.left + s),
u.top < 0 && (u.top = 0), u.left < 0 && (u.left = 0), t.offset(u), "bottom" === n.placement || "top" === n.placement) {
if (l !== u.left) return this._replaceArrow(t, 2 * (u.left - l), a, "left");
} else if (c !== u.top) return this._replaceArrow(t, 2 * (u.top - c), r, "top");
}, n.prototype._center = function(n) {
return n.css("top", e(t).outerHeight() / 2 - n.outerHeight() / 2);
}, n.prototype._replaceArrow = function(e, t, n, i) {
return e.find(".arrow").css(i, t ? 50 * (1 - t / n) + "%" : "");
}, n.prototype._scrollIntoView = function(n) {
return e("html, body").stop().animate({
scrollTop: Math.ceil(n.offset().top - e(t).height() / 2)
});
}, n.prototype._onResize = function(n, i) {
return e(t).on("resize.tour-" + this._options.name, function() {
return clearTimeout(i), i = setTimeout(n, 100);
});
}, n.prototype._setupKeyboardNavigation = function() {
var t = this;
return this._options.keyboard ? e(i).on("keyup.tour-" + this._options.name, function(e) {
if (e.which) switch (e.which) {
case 39:
return e.preventDefault(), t._current < t._steps.length - 1 ? t.next() : t.end();
case 37:
if (e.preventDefault(), t._current > 0) return t.prev();
break;
case 27:
return e.preventDefault(), t.end();
}
}) : void 0;
}, n.prototype._makePromise = function(t) {
return t && e.isFunction(t.then) ? t : null;
}, n.prototype._callOnPromiseDone = function(e, t, n) {
var i = this;
return e ? e.then(function() {
return t.call(i, n);
}) : t.call(this, n);
}, n.prototype._showBackdrop = function(e) {
return null === this.backdrop.overlay ? (this._showOverlay(), null != e ? this._showOverlayElement(e) : void 0) : void 0;
}, n.prototype._hideBackdrop = function() {
return null !== this.backdrop.overlay ? (this.backdrop.$element && this._hideOverlayElement(),
this._hideOverlay()) : void 0;
}, n.prototype._showOverlay = function() {
return this.backdrop = e("<div/>", {
"class": "tour-backdrop"
}), e("body").append(this.backdrop);
}, n.prototype._hideOverlay = function() {
return this.backdrop.remove(), this.backdrop.overlay = null;
}, n.prototype._showOverlayElement = function(t) {
var n, i, o;
return i = e(t), n = e("<div/>"), o = i.offset(), o.top = o.top, o.left = o.left,
n.width(i.innerWidth()).height(i.innerHeight()).addClass("tour-step-background").offset(o),
i.addClass("tour-step-backdrop"), e("body").append(n), this.backdrop.$element = i,
this.backdrop.$background = n;
}, n.prototype._hideOverlayElement = function() {
return this.backdrop.$element.removeClass("tour-step-backdrop"), this.backdrop.$background.remove(),
this.backdrop.$element = null, this.backdrop.$background = null;
}, n;
}(), t.Tour = n;
})(jQuery, window);
}.call(this), define("bootstrap-tour", function() {}), define("extensions/welcomeTour", [ "jquery", "classes/Extension", "bootstrap-tour" ], function(e, t) {
var n = new t("welcomeTour", "Welcome tour", !1, !0);
return n.onReady = function() {
var t = new Tour({
storage: {
getItem: function() {},
setItem: function() {},
removeItem: function() {}
},
onEnd: function() {
localStorage.welcomeTour = "done";
},
template: [ "<div class='popover tour'>", " <div class='arrow'></div>", " <h3 class='popover-title'></h3>", " <div class='popover-content'></div>", " <nav class='popover-navigation'>", " <button class='btn btn-primary' data-role='next'>Next</button>", " <button class='btn btn-default' data-role='end'>Got it!</button>", " </nav>", "</div>" ].join("")
});
t.addSteps([ {
element: ".navbar-inner",
title: "Welcome to StackEdit",
content: "Please click <code>Next</code> to take a quick tour.",
placement: "bottom"
}, {
element: ".navbar .action-create-file",
title: "New document",
content: "Click the <i class='icon-file'></i> <code>New document</code> button to create a new document.",
placement: "left",
reflex: !0
}, {
element: ".document-panel .collapse-button",
title: "Toggle document",
content: [ "<p>Click the <i class='icon-folder-open'></i> <code>Select document</code> button to switch to another document.</p>", "<b>NOTE: </b>Use <code>Ctrl+[</code> and <code>Ctrl+]</code> shortcuts to toggle quickly." ].join(""),
placement: "left",
reflex: !0
}, {
element: ".menu-panel .collapse-button",
title: "Menu",
content: [ "<p>Use the <i class='icon-provider-stackedit'></i> menu to synchronize your document on <i class='icon-provider-gdrive'></i> <code>Google Drive</code> or <i class='icon-provider-dropbox'></i> <code>Dropbox</code>.</p>", "Use also this menu to publish your document on <i class='icon-provider-github'></i> <code>GitHub</code>, <i class='icon-provider-blogger'></i> <code>Blogger</code>..." ].join(""),
placement: "right",
reflex: !0
}, {
element: "#extension-buttons button:first",
title: "Synchronize/publish",
content: [ "<p>Once imported/exported, use the <i class='icon-refresh'></i> <code>Synchronize</code> button to force the synchronization (this is done automatically every 3 minutes).</p>", "Use also the <i class='icon-share'></i> <code>Publish</code> button to update your publications." ].join(""),
placement: "bottom",
reflex: !0
} ]), _.has(localStorage, "welcomeTour") || t.start(), e(".action-welcome-tour").click(function() {
t.restart();
});
}, n;
}), define("text!html/userCustomSettingsBlock.html", [], function() {
return '<p>Allows users to implement their own extension.</p>\n<div class="form-horizontal">\n <div class="form-group">\n <label class="col-lg-4 control-label" for="textarea-usercustom-code">JavaScript code\n <a href="#" class="tooltip-usercustom-extension">(?)</a>\n </label>\n <div class="col-lg-7">\n <textarea id="textarea-usercustom-code" class="form-control"></textarea>\n </div>\n </div>\n</div>\n<span class="help-block pull-right"><a target="_blank" href="https://github.com/benweet/stackedit/blob/master/doc/developer-guide.md#architecture">More info</a></span>';
}), define("extensions/userCustom", [ "jquery", "underscore", "utils", "classes/Extension", "fileSystem", "settings", "text!html/userCustomSettingsBlock.html" ], function($, _, utils, Extension, fileSystem, settings, userCustomSettingsBlockHTML) {
var userCustom = new Extension("userCustom", "UserCustom extension", !0);
userCustom.settingsBlock = userCustomSettingsBlockHTML, userCustom.defaultConfig = {
code: ""
};
var fileMgr = void 0;
userCustom.onFileMgrCreated = function(e) {
fileMgr = e;
};
var synchronizer = void 0;
userCustom.onSynchronizerCreated = function(e) {
synchronizer = e;
};
var publisher = void 0;
userCustom.onPublisherCreated = function(e) {
publisher = e;
};
var eventMgr = void 0;
return userCustom.onEventMgrCreated = function(e) {
eventMgr = e;
}, userCustom.onLoadSettings = function() {
utils.setInputValue("#textarea-usercustom-code", userCustom.config.code);
}, userCustom.onSaveSettings = function(newConfig, event) {
newConfig.code = utils.getInputValue("#textarea-usercustom-code");
try {
eval(newConfig.code);
} catch (e) {
eventMgr.onError(e), utils.getInputTextValue("#textarea-usercustom-code", event, /^$/);
}
}, userCustom.onInit = function() {
try {
eval(userCustom.config.code);
} catch (e) {
console.error(e);
}
}, userCustom;
}), function(e) {
var t = "waitForImages";
e.waitForImages = {
hasImageProperties: [ "backgroundImage", "listStyleImage", "borderImage", "borderCornerImage" ]
}, e.expr[":"].uncached = function(t) {
if (!e(t).is('img[src!=""]')) return !1;
var n = new Image();
return n.src = t.src, !n.complete;
}, e.fn.waitForImages = function(n, i, o) {
var r = 0, s = 0;
if (e.isPlainObject(arguments[0]) && (o = arguments[0].waitForAll, i = arguments[0].each,
n = arguments[0].finished), n = n || e.noop, i = i || e.noop, o = !!o, !e.isFunction(n) || !e.isFunction(i)) throw new TypeError("An invalid callback was supplied.");
return this.each(function() {
var a = e(this), l = [], c = e.waitForImages.hasImageProperties || [], u = /url\(\s*(['"]?)(.*?)\1\s*\)/g;
o ? a.find("*").andSelf().each(function() {
var t = e(this);
t.is("img:uncached") && l.push({
src: t.attr("src"),
element: t[0]
}), e.each(c, function(e, n) {
var i, o = t.css(n);
if (!o) return !0;
for (;i = u.exec(o); ) l.push({
src: i[2],
element: t[0]
});
});
}) : a.find("img:uncached").each(function() {
l.push({
src: this.src,
element: this
});
}), r = l.length, s = 0, 0 === r && n.call(a[0]), e.each(l, function(o, l) {
var c = new Image();
e(c).bind("load." + t + " error." + t, function(e) {
return s++, i.call(l.element, s, r, "load" == e.type), s == r ? (n.call(a[0]), !1) : void 0;
}), c.src = l.src;
});
});
};
}(jQuery), define("jquery-waitforimages", function() {}), define("eventMgr", [ "jquery", "underscore", "crel", "utils", "classes/Extension", "settings", "text!html/settingsExtensionsAccordion.html", "extensions/markdownSectionParser", "extensions/partialRendering", "extensions/buttonMarkdownSyntax", "extensions/googleAnalytics", "extensions/dialogAbout", "extensions/dialogManagePublication", "extensions/dialogManageSynchronization", "extensions/dialogOpenHarddrive", "extensions/documentTitle", "extensions/documentSelector", "extensions/documentPanel", "extensions/documentManager", "extensions/workingIndicator", "extensions/notifications", "extensions/markdownExtra", "extensions/toc", "extensions/mathJax", "extensions/emailConverter", "extensions/scrollLink", "extensions/buttonFocusMode", "extensions/buttonSync", "extensions/buttonPublish", "extensions/buttonShare", "extensions/buttonStat", "extensions/buttonHtmlCode", "extensions/buttonViewer", "extensions/welcomeTour", "extensions/userCustom", "bootstrap", "jquery-waitforimages" ], function(e, t, n, i, o, r, s) {
function a(e) {
return t.chain(d).map(function(t) {
return t.enabled && t[e];
}).compact().value();
}
function l(e) {
return h[e] = a(e), function() {
logger.log(e, arguments);
var n = arguments;
t.each(h[e], function(e) {
try {
e.apply(null, n);
} catch (i) {
console.error(t.isObject(i) ? i.stack : i);
}
});
};
}
function c(e) {
u[e] = l(e);
}
var u = {}, d = t.chain(arguments).map(function(e) {
return e instanceof o && e;
}).compact().value();
extensionSettings = r.extensionSettings || {}, t.each(d, function(e) {
e.config = t.extend({}, e.defaultConfig, extensionSettings[e.extensionId]), e.enabled = viewerMode === !0 && e.disableInViewer === !0 ? !1 : lightMode === !0 && e.disableInLight === !0 ? !1 : !e.isOptional || void 0 === e.config.enabled || e.config.enabled === !0;
});
var h = {};
u.addListener = function(e, t) {
try {
h[e].push(t);
} catch (n) {
console.error("No event listener called " + e);
}
}, l("onInit")(), u.onLoadSettings = function() {
logger.log("onLoadSettings"), t.each(d, function(e) {
i.setInputChecked("#input-enable-extension-" + e.extensionId, e.enabled === !0);
var t = e.onLoadSettings;
t && t();
});
}, u.onSaveSettings = function(e, n) {
logger.log("onSaveSettings"), t.each(d, function(o) {
var r = t.extend({}, o.defaultConfig);
r.enabled = i.getInputChecked("#input-enable-extension-" + o.extensionId);
var s = o.onSaveSettings;
s && s(r, n), e[o.extensionId] = r;
});
}, c("onMessage"), c("onError"), c("onOfflineChanged"), c("onUserActive"), c("onAsyncRunning"),
c("onPeriodicRun"), c("onFileMgrCreated"), c("onSynchronizerCreated"), c("onPublisherCreated"),
c("onEventMgrCreated"), c("onFileCreated"), c("onFileDeleted"), c("onFileSelected"),
c("onFileOpen"), c("onFileClosed"), c("onContentChanged"), c("onTitleChanged"),
c("onFoldersChanged"), c("onSyncRunning"), c("onSyncSuccess"), c("onSyncImportSuccess"),
c("onSyncExportSuccess"), c("onSyncRemoved"), c("onPublishRunning"), c("onPublishSuccess"),
c("onNewPublishSuccess"), c("onPublishRemoved"), c("onLayoutConfigure"), c("onLayoutCreated"),
c("onLayoutResize"), c("onPagedownConfigure"), c("onSectionsCreated"), c("onMarkdownTrim"),
c("onExtraExtensions"), c("onAceCreated");
var p = l("onPreviewFinished"), f = a("onAsyncPreview"), g = void 0, m = void 0;
u.onAsyncPreview = function() {
function e(n) {
var o = n.length ? n.shift() : function() {
logger.log("Preview time: " + (new Date() - u.previewStartTime)), t.defer(function() {
var e = "";
t.each(g.children, function(t) {
e += t.innerHTML;
}), p(i.trim(e));
});
};
o(function() {
e(n);
});
}
logger.log("onAsyncPreview"), logger.log("Conversion time: " + (new Date() - u.previewStartTime)),
e(f.concat([ function(e) {
m.waitForImages(e);
} ]));
};
var v = l("onReady");
return u.onReady = function() {
function i(e) {
var i = n("div", {
"class": "btn-group"
}), o = e();
return t.isString(o) ? i.innerHTML = o : t.isElement(o) && i.appendChild(o), i;
}
if (g = document.getElementById("preview-contents"), m = e(g), viewerMode === !1) {
var o = t.chain(d).sortBy(function(e) {
return e.extensionName.toLowerCase();
}).reduce(function(e, n) {
return e + (n.settingsBlock ? t.template(s, {
extensionId: n.extensionId,
extensionName: n.extensionName,
isOptional: n.isOptional,
settingsBlock: n.settingsBlock
}) : "");
}, "").value();
document.querySelector(".accordion-extensions").innerHTML = o, logger.log("onCreateButton");
var r = a("onCreateButton"), l = document.createDocumentFragment();
t.each(r, function(e) {
l.appendChild(i(e));
}), document.getElementById("extension-buttons").appendChild(l), logger.log("onCreateEditorButton");
var c = a("onCreateEditorButton"), u = document.createDocumentFragment();
t.each(c, function(e) {
u.appendChild(i(e));
});
var h = document.querySelector(".extension-editor-buttons");
h.appendChild(u);
}
logger.log("onCreatePreviewButton");
var p = a("onCreatePreviewButton"), f = document.createDocumentFragment();
t.each(p, function(e) {
f.appendChild(i(e));
});
var b = document.querySelector(".extension-preview-buttons");
b.appendChild(f);
var y = e(b), w = y.width();
y.find(".btn-group").each(function() {
var t = e(this);
t.find(".dropdown-menu").css({
right: -w + t.width() + t.position().left
});
}), v();
}, u.onEventMgrCreated(u), u;
}), define("text!html/bodyIndex.html", [], function() {
return '<div class="navbar navbar-default ui-layout-north">\n <div class="navbar-inner">\n <div class="nav left-space"></div>\n <div class="nav right-space pull-right"></div>\n <ul class="nav">\n <li class="wmd-button-group1 btn-group"></li>\n </ul>\n <ul class="nav">\n <li class="wmd-button-group2 btn-group"></li>\n </ul>\n <ul class="nav">\n <li class="wmd-button-group3 btn-group"></li>\n </ul>\n <ul class="nav">\n <li class="wmd-button-group4 btn-group"></li>\n </ul>\n <ul class="nav pull-right">\n <li class="btn-group"><button\n class="btn btn-success action-create-file" title="New document">\n <i class="icon-file"></i>\n </button>\n <button class="btn btn-success" title="Delete current document"\n data-toggle="modal" data-target=".modal-remove-file-confirm">\n <i class="icon-trash"></i>\n </button></li>\n </ul>\n <ul class="nav pull-right">\n <li id="extension-buttons"></li>\n </ul>\n <ul class="nav pull-right">\n <li><a class="btn btn-success file-title-navbar" href="#"\n title="Rename current document"> </a></li>\n <li><input type="text"\n class="col-lg-4 form-control hide input-file-title"\n placeholder="Document title" /></li>\n </ul>\n <ul class="nav pull-right">\n <li><i class="working-indicator icon-none"></i></li>\n </ul>\n </div>\n</div>\n<div id="wmd-input" class="ui-layout-center"></div>\n<div class="ui-layout-east preview-container"></div>\n<div class="ui-layout-south preview-container"></div>\n<div id="wmd-button-bar" class="hide"></div>\n\n<div class="menu-panel collapse width">\n <button class="btn btn-success collapse-button" data-toggle="collapse"\n data-target=".menu-panel" title="Menu">\n <i class="icon-left-open"></i> <img\n data-stackedit-src="stackedit-64.png" width="32" height="32" />\n </button>\n <div class="panel-content">\n <div class="list-group">\n <a href="viewer.html" title="StackEdit Viewer"\n class="list-group-item"><i class="icon-resize-full"></i>\n StackEdit Viewer</a> <a href="#" data-toggle="collapse"\n data-target=".collapse-open-from" class="list-group-item"><i\n class="icon-hdd"></i> Open from...</a>\n <div class="sub-menu collapse collapse-open-from clearfix">\n <ul class="nav">\n <li><a data-toggle="modal" data-target=".modal-import-url"\n class="action-reset-input" href="#">Open from URL</a></li>\n <li><a data-toggle="modal"\n data-target=".modal-import-harddrive-markdown"\n class="action-reset-input" href="#">Import from hard drive</a></li>\n <li><a data-toggle="modal"\n data-target=".modal-import-harddrive-html"\n class="action-reset-input" href="#">Convert HTML to Markdown</a></li>\n </ul>\n </div>\n\n <a href="#" data-toggle="collapse" data-target=".collapse-save-as"\n class="list-group-item"><i class="icon-hdd"></i> Save as...</a>\n <div class="sub-menu collapse collapse-save-as clearfix">\n <ul class="nav">\n <li><a class="action-download-md" href="#">Save as\n Markdown</a></li>\n <li><a class="action-download-html" href="#">Save as HTML</a></li>\n <li><a class="action-download-template" href="#">Save\n using template</a></li>\n <li><a class="action-download-pdf" href="#">Save as PDF</a></li>\n </ul>\n </div>\n </div>\n <div class=dropdown-header>SYNCHRONIZE</div>\n <div class="list-group">\n <a href="#" data-toggle="collapse"\n data-target=".collapse-sync-gdrive" class="list-group-item"><i\n class="icon-provider-gdrive"></i> Google Drive</a>\n <div class="sub-menu collapse collapse-sync-gdrive clearfix">\n <ul class="nav">\n <li><a href="#" class="action-sync-import-gdrive"\n data-toggle="collapse" data-target=".menu-panel">Import from\n Google Drive</a></li>\n <li><a href="#" class="action-sync-export-dialog-gdrive">Export\n to Google Drive</a></li>\n </ul>\n </div>\n <a href="#" data-toggle="collapse"\n data-target=".collapse-sync-dropbox" class="list-group-item"><i\n class="icon-provider-dropbox"></i> Dropbox</a>\n <div class="sub-menu collapse collapse-sync-dropbox clearfix">\n <ul class="nav">\n <li><a class="action-sync-import-dropbox" href="#"\n data-toggle="collapse" data-target=".menu-panel">Import from\n Dropbox</a></li>\n <li><a href="#" class="action-sync-export-dialog-dropbox">Export\n to Dropbox</a></li>\n </ul>\n </div>\n <a href="#" data-toggle="modal" data-target=".modal-manage-sync"\n class="action-reset-input list-group-item"><i\n class="icon-refresh"></i> Manage synchronization</a>\n </div>\n <div class=dropdown-header>PUBLISH</div>\n <div class="list-group">\n <a href="#" data-toggle="collapse" data-target=".collapse-publish-on"\n class="list-group-item"><i class="icon-share"></i> Publish on...</a>\n <div class="sub-menu collapse collapse-publish-on clearfix">\n <ul class="nav">\n </ul>\n </div>\n <a href="#" data-toggle="modal" data-target=".modal-manage-publish"\n class="action-reset-input list-group-item"><i class="icon-share"></i>\n Manage publication</a>\n </div>\n <ul class="nav">\n <li><a href="#" data-toggle="modal"\n data-target=".modal-settings" class="action-load-settings"><i\n class="icon-cog"></i> Settings</a></li>\n <li><a href="#" data-toggle="modal" data-target=".modal-about"><i\n class="icon-help-circled"></i> About</a></li>\n </ul>\n\n </div>\n</div>\n\n\n<div class="document-panel collapse width">\n <button class="btn btn-success collapse-button" data-toggle="collapse"\n data-target=".document-panel" title="Select document">\n <i class="icon-folder-open"></i> <i class="icon-right-open"></i>\n </button>\n <div class="search-bar clearfix">\n <div class="input-group">\n <span class="input-group-addon"><i class="icon-search"></i></span><input\n type="text" class="form-control"></input>\n <button type="button" class="close" title="clear">&times;</button>\n <div class="input-group-btn">\n <a data-toggle="modal" data-target=".modal-document-manager"\n class="btn btn-link" title="Manage documents"><i\n class="icon-layers"></i></a>\n </div>\n </div>\n </div>\n <div class="panel-content">\n <div class="list-group document-list"></div>\n <div class="list-group document-list-filtered hide"></div>\n </div>\n</div>\n\n\n<div class="modal modal-document-manager">\n <div class="modal-dialog">\n <div class="modal-content">\n\n <div class="modal-header">\n <button type="button" class="close" data-dismiss="modal"\n aria-hidden="true">&times;</button>\n <h3 class="modal-title">Manage documents</h3>\n </div>\n <div class="modal-body">\n <div></div>\n <ul class="nav nav-pills document-list">\n <li class="pull-right dropdown"><a href="#"\n data-toggle="dropdown"><i class="icon-check"></i> Selection <b\n class="caret"></b></a>\n <ul class="dropdown-menu">\n <li><a href="#" class="action-select-all"><i\n class="icon-check"></i> Select all</a></li>\n <li><a href="#" class="action-unselect-all"><i\n class="icon-check-empty"></i> Unselect all</a></li>\n <li class="divider"></li>\n <li><a href="#" class="action-move-items"><i\n class="icon-forward"></i> Move to folder</a></li>\n <li><a href="#" class="action-delete-items"><i\n class="icon-trash"></i> Delete</a></li>\n </ul></li>\n <li class="pull-right"><a href="#"\n class="action-create-folder"> <i class="icon-folder"></i>\n Create folder\n </a></li>\n <li class="disabled"><a><i class="icon-file"></i> <span\n class="document-count"></span></a></li>\n <li class="disabled"><a><i class="icon-folder"></i> <span\n class="folder-count"></span></a></li>\n </ul>\n <div class="list-group document-list"></div>\n <p class="confirm-delete hide">The following documents will be\n deleted locally:</p>\n <p class="choose-folder hide">Please choose a destination\n folder:</p>\n <div class="list-group selected-document-list hide"></div>\n <div class="list-group select-folder-list hide"></div>\n </div>\n <div class="modal-footer">\n <a href="#"\n class="btn btn-default confirm-delete choose-folder action-cancel hide">Cancel</a>\n <a href="#"\n class="btn btn-primary confirm-delete action-delete-items-confirm hide">OK</a>\n <a href="#" class="btn btn-primary document-list"\n data-dismiss="modal">Close</a>\n </div>\n </div>\n </div>\n</div>\n\n\n<div class="modal modal-insert-link">\n <div class="modal-dialog">\n <div class="modal-content">\n\n <div class="modal-header">\n <button type="button" class="close" data-dismiss="modal"\n aria-hidden="true">&times;</button>\n <h3 class="modal-title">Hyperlink</h3>\n </div>\n <div class="modal-body">\n <p>Please provide the link URL and an optional title:</p>\n <div class="input-group">\n <span class="input-group-addon"><i class="icon-globe"></i></span><input\n id="input-insert-link" type="text" class="col-lg-5 form-control"\n placeholder=\'http://example.com/ "optional title"\'></input>\n </div>\n </div>\n <div class="modal-footer">\n <a href="#" class="btn btn-default" data-dismiss="modal">Cancel</a>\n <a href="#" class="btn btn-primary action-insert-link"\n data-dismiss="modal">OK</a>\n </div>\n </div>\n </div>\n</div>\n\n\n<div class="modal modal-insert-image">\n <div class="modal-dialog">\n <div class="modal-content">\n\n <div class="modal-header">\n <button type="button" class="close" data-dismiss="modal"\n aria-hidden="true">&times;</button>\n <h3 class="modal-title">Image</h3>\n </div>\n <div class="modal-body">\n <p>Please provide the image URL and an optional title:</p>\n <div class="input-group">\n <span class="input-group-addon"><i class="icon-picture"></i></span><input\n id="input-insert-image" type="text" class="col-lg-5 form-control"\n placeholder=\'http://example.com/image.jpg "optional title"\'></input>\n </div>\n </div>\n <div class="modal-footer">\n <a href="#" class="btn btn-default action-import-image-gplus"\n data-dismiss="modal"><i class="icon-provider-gplus"></i> Import\n from Google+</a> <a href="#" class="btn btn-default"\n data-dismiss="modal">Cancel</a> <a href="#"\n class="btn btn-primary action-insert-image" data-dismiss="modal">OK</a>\n </div>\n </div>\n </div>\n</div>\n\n\n<div class="modal modal-import-image">\n <div class="modal-dialog">\n <div class="modal-content">\n\n <div class="modal-header">\n <button type="button" class="close" data-dismiss="modal"\n aria-hidden="true">&times;</button>\n <h3 class="modal-title">Google+ image import</h3>\n </div>\n <div class="modal-body">\n <div class="form-horizontal">\n <div class="form-group">\n <div class="col-lg-7">\n <img>\n </div>\n </div>\n <div class="form-group">\n <label class="col-lg-4 control-label"\n for="input-import-image-title">Title (optional)</label>\n <div class="col-lg-7">\n <input type="text" id="input-import-image-title"\n placeholder="Image title" class="form-control">\n </div>\n </div>\n <div class="form-group">\n <label class="col-lg-4 control-label"\n for="input-import-image-size">Size limit (optional)</label>\n <div class="col-lg-7 form-inline">\n <input type="text" id="input-import-image-size" placeholder="123"\n class="col-lg-3 form-control"> px\n </div>\n </div>\n </div>\n </div>\n <div class="modal-footer">\n <a href="#" class="btn btn-default" data-dismiss="modal">Cancel</a>\n <a href="#" class="btn btn-primary action-import-image"\n data-dismiss="modal">OK</a>\n </div>\n </div>\n </div>\n</div>\n\n\n<div class="modal modal-remove-file-confirm">\n <div class="modal-dialog">\n <div class="modal-content">\n\n <div class="modal-header">\n <button type="button" class="close" data-dismiss="modal"\n aria-hidden="true">&times;</button>\n <h3 class="modal-title">Delete</h3>\n </div>\n <div class="modal-body">\n <p>\n Are you sure you want to delete "<span class="file-title"></span>"?\n </p>\n <blockquote>\n <b>NOTE:</b> This will not delete the file on synchronized\n locations.\n </blockquote>\n </div>\n <div class="modal-footer">\n <a href="#" class="btn btn-default" data-dismiss="modal">Cancel</a>\n <a href="#" class="btn btn-primary action-remove-file"\n data-dismiss="modal">Delete</a>\n </div>\n </div>\n </div>\n</div>\n\n\n<div class="modal modal-import-url">\n <div class="modal-dialog">\n <div class="modal-content">\n\n <div class="modal-header">\n <button type="button" class="close" data-dismiss="modal"\n aria-hidden="true">&times;</button>\n <h3 class="modal-title">Open from URL</h3>\n </div>\n <div class="modal-body">\n <p>Please provide a link to a Markdown document.</p>\n <div class="form-horizontal">\n <div class="form-group">\n <label class="col-lg-3 control-label" for="input-import-url">URL</label>\n <div class="col-lg-8">\n <input type="text" id="input-import-url"\n placeholder="http://www.abc.com/xyz.md" class="form-control">\n </div>\n </div>\n </div>\n </div>\n <div class="modal-footer">\n <a href="#" class="btn btn-default" data-dismiss="modal">Cancel</a>\n <a href="#" data-dismiss="modal"\n class="btn btn-primary action-import-url">OK</a>\n </div>\n </div>\n </div>\n</div>\n\n\n<div class="modal modal-import-harddrive-markdown">\n <div class="modal-dialog">\n <div class="modal-content">\n\n <div class="modal-header">\n <button type="button" class="close" data-dismiss="modal"\n aria-hidden="true">&times;</button>\n <h3 class="modal-title">Import from hard drive</h3>\n </div>\n <div class="modal-body">\n <p>Please select your Markdown files here:</p>\n <p>\n <input type="file" id="input-file-import-harddrive-markdown"\n multiple class="form-control" />\n </p>\n <p>Or drag and drop your Markdown files here:</p>\n <p id="dropzone-import-harddrive-markdown" class="drop-zone">Drop\n files here</p>\n </div>\n <div class="modal-footer">\n <a href="#" class="btn btn-primary" data-dismiss="modal">Close</a>\n </div>\n </div>\n </div>\n</div>\n\n\n<div class="modal modal-import-harddrive-html">\n <div class="modal-dialog">\n <div class="modal-content">\n\n <div class="modal-header">\n <button type="button" class="close" data-dismiss="modal"\n aria-hidden="true">&times;</button>\n <h3 class="modal-title">Convert HTML to Markdown</h3>\n </div>\n <div class="modal-body">\n <p>Please select your HTML files here:</p>\n <p>\n <input type="file" id="input-file-import-harddrive-html" multiple\n class="form-control" />\n </p>\n <p>Or drag and drop your HTML files here:</p>\n <p id="dropzone-import-harddrive-html" class="drop-zone">Drop\n files here</p>\n <p>Or insert your HTML code here:</p>\n <textarea id="input-convert-html" class="form-control"></textarea>\n </div>\n <div class="modal-footer">\n <a href="#" class="btn btn-default" data-dismiss="modal">Close</a> <a\n href="#" class="btn btn-primary action-convert-html"\n data-dismiss="modal">OK</a>\n </div>\n </div>\n </div>\n</div>\n\n\n<div class="modal modal-upload-gdrive">\n <div class="modal-dialog">\n <div class="modal-content">\n\n <div class="modal-header">\n <button type="button" class="close" data-dismiss="modal"\n aria-hidden="true">&times;</button>\n <h3 class="modal-title">Export to Google Drive</h3>\n </div>\n <div class="modal-body">\n <p>\n This will save "<span class="file-title"></span>" to your <i\n class="icon-provider-gdrive"></i>\n <code>Google Drive</code>\n account and keep it synchronized.\n </p>\n <div class="form-horizontal">\n <div class="form-group">\n <label class="col-lg-3 control-label"\n for="input-sync-export-gdrive-parentid">Folder ID\n (optional)</label>\n <div class="col-lg-8">\n <div class="input-group">\n <input type="text" id="input-sync-export-gdrive-parentid"\n placeholder="FolderID" class="form-control">\n <div class="input-group-btn">\n <a class="btn btn-link export-gdrive-choose-folder"\n title="Choose folder" data-dismiss="modal"><i\n class="icon-folder-open"></i></a>\n </div>\n </div>\n <span class="help-block"> If no folder ID is supplied, the\n file will be created in your root folder. </span>\n </div>\n </div>\n <div class="form-group">\n <div class="col-lg-3 control-label"></div>\n <div class="col-lg-8">\n <label> <input id="input-sync-export-gdrive-realtime"\n type="checkbox"> Create a real time collaborative\n document\n </label>\n </div>\n </div>\n <div class="form-group">\n <label class="col-lg-3 control-label"\n for="input-sync-export-gdrive-fileid">Existing file ID\n (optional)</label>\n <div class="col-lg-8">\n <input type="text" id="input-sync-export-gdrive-fileid"\n placeholder="FileID" class="form-control"> <span\n class="help-block"> This will overwrite the existing file\n on the server. </span>\n </div>\n </div>\n </div>\n <blockquote>\n <b>NOTE:</b>\n <ul>\n <li>You can move or rename the file afterwards within Google\n Drive.</li>\n <li>Real time collaborative documents can\'t be open outside\n StackEdit.</li>\n <li>Real time collaborative documents can\'t have multiple\n synchronized locations.</li>\n </ul>\n </blockquote>\n </div>\n <div class="modal-footer">\n <a href="#" class="btn btn-default" data-dismiss="modal">Cancel</a>\n <a href="#" data-dismiss="modal"\n class="btn btn-primary action-sync-export-gdrive">OK</a>\n </div>\n </div>\n </div>\n</div>\n\n\n<div class="modal modal-upload-dropbox">\n <div class="modal-dialog">\n <div class="modal-content">\n\n <div class="modal-header">\n <button type="button" class="close" data-dismiss="modal"\n aria-hidden="true">&times;</button>\n <h3 class="modal-title">Export to Dropbox</h3>\n </div>\n <div class="modal-body">\n <p>\n This will save "<span class="file-title"></span>" to your <i\n class="icon-provider-dropbox"></i>\n <code>Dropbox</code>\n account and keep it synchronized.\n </p>\n <div class="form-horizontal">\n <div class="form-group">\n <label class="col-lg-3 control-label"\n for="input-sync-export-dropbox-path">File path</label>\n <div class="col-lg-8">\n <input type="text" id="input-sync-export-dropbox-path"\n placeholder="/path/to/My Document.md" class="form-control">\n <span class="help-block"> File path is composed of both\n folder and filename. </span>\n </div>\n </div>\n </div>\n <blockquote>\n <b>NOTE:</b>\n <ul>\n <li>Dropbox file path does not depend on document title.</li>\n <li>The title of your document will not be synchronized.</li>\n <li>Destination folder must exist.</li>\n <li>Any existing file at this location will be overwritten.</li>\n </ul>\n </blockquote>\n </div>\n <div class="modal-footer">\n <a href="#" class="btn btn-default" data-dismiss="modal">Cancel</a>\n <a href="#" data-dismiss="modal"\n class="btn btn-primary action-sync-export-dropbox">OK</a>\n </div>\n </div>\n </div>\n</div>\n\n\n<div class="modal modal-manage-sync">\n <div class="modal-dialog">\n <div class="modal-content">\n\n <div class="modal-header">\n <button type="button" class="close" data-dismiss="modal"\n aria-hidden="true">&times;</button>\n <h3 class="modal-title">Synchronization</h3>\n </div>\n <div class="modal-body">\n <p class="msg-sync-list hide">\n "<span class="file-title"></span>" is synchronized with the\n following location(s):\n </p>\n <div class="msg-sync-list sync-list hide"></div>\n <blockquote class="msg-sync-list hide">\n <b>NOTE:</b> Removing a synchronized location will not delete any\n file.\n </blockquote>\n <blockquote class="msg-no-sync hide">\n "<span class="file-title"></span>" is not synchronized yet. <br />\n <br /> <b>NOTE:</b> You can add synchronized locations by\n exporting your document using <i class="icon-provider-gdrive"></i>\n <code>Google Drive</code>\n or <i class="icon-provider-dropbox"></i>\n <code>Dropbox</code>\n sub-menu.\n </blockquote>\n </div>\n <div class="modal-footer">\n <a href="#" class="btn btn-primary" data-dismiss="modal">Close</a>\n </div>\n </div>\n </div>\n</div>\n\n\n<div class="modal modal-publish">\n <div class="modal-dialog">\n <div class="modal-content">\n\n <div class="modal-header">\n <button type="button" class="close" data-dismiss="modal"\n aria-hidden="true">&times;</button>\n <h3 class="modal-title">\n Publish on <span class="publish-provider-name"></span>\n </h3>\n </div>\n <div class="modal-body">\n <div class="form-horizontal">\n <div class="form-group modal-publish-ssh">\n <label class="col-lg-4 control-label" for="input-publish-ssh-host">Host</label>\n <div class="col-lg-7">\n <input type="text" id="input-publish-ssh-host"\n placeholder="host.name.or.ip" class="form-control"> <span\n class="help-block"> Host must be accessible publicly,\n unless you are hosting your own <a target="_blank"\n href="https://github.com/benweet/stackedit-ssh-proxy">SSH\n proxy</a>.\n </span>\n </div>\n </div>\n <div class="form-group modal-publish-ssh">\n <label class="col-lg-4 control-label" for="input-publish-ssh-port">Port\n (optional)</label>\n <div class="col-lg-2">\n <input type="text" id="input-publish-ssh-port" placeholder="22"\n class="form-control">\n </div>\n </div>\n <div class="form-group modal-publish-ssh">\n <label class="col-lg-4 control-label"\n for="input-publish-ssh-username">Username</label>\n <div class="col-lg-7">\n <input type="text" id="input-publish-ssh-username"\n placeholder="username" class="form-control">\n </div>\n </div>\n <div class="form-group modal-publish-ssh">\n <label class="col-lg-4 control-label"\n for="input-publish-ssh-password">Password</label>\n <div class="col-lg-7">\n <input type="password" id="input-publish-ssh-password"\n placeholder="password" class="form-control"> <span\n class="help-block"> Passwords are transmitted in clear,\n unless you are hosting your own <a target="_blank"\n href="https://github.com/benweet/stackedit-ssh-proxy">SSH\n proxy</a>.\n </span>\n </div>\n </div>\n <div class="form-group modal-publish-github">\n <label class="col-lg-4 control-label"\n for="input-publish-github-reponame">Repository</label>\n <div class="col-lg-7">\n <input type="text" id="input-publish-github-reponame"\n placeholder="repository-name" class="form-control">\n </div>\n </div>\n <div class="form-group modal-publish-github">\n <label class="col-lg-4 control-label"\n for="input-publish-github-username">Username (optional)</label>\n <div class="col-lg-7">\n <input type="text" id="input-publish-github-username"\n placeholder="username" class="form-control">\n </div>\n </div>\n <div class="form-group modal-publish-github">\n <label class="col-lg-4 control-label"\n for="input-publish-github-branch">Branch</label>\n <div class="col-lg-7">\n <input type="text" id="input-publish-github-branch"\n placeholder="branch-name" class="form-control">\n </div>\n </div>\n <div class="form-group modal-publish-ssh modal-publish-github">\n <label class="col-lg-4 control-label"\n for="input-publish-file-path">File path</label>\n <div class="col-lg-7">\n <input type="text" id="input-publish-file-path"\n placeholder="path/to/file.md" class="form-control">\n </div>\n </div>\n <div class="form-group modal-publish-gist">\n <label class="col-lg-4 control-label" for="input-publish-filename">Filename</label>\n <div class="col-lg-7">\n <input type="text" id="input-publish-filename"\n placeholder="filename" class="form-control">\n </div>\n </div>\n <div class="form-group modal-publish-gist">\n <label class="col-lg-4 control-label" for="input-publish-gist-id">Existing\n ID (optional)</label>\n <div class="col-lg-7">\n <input type="text" id="input-publish-gist-id"\n placeholder="GistID" class="form-control">\n </div>\n </div>\n <div class="form-group modal-publish-gist">\n <label class="col-lg-4 control-label"\n for="input-publish-gist-public">Public</label>\n <div class="col-lg-7">\n <div class="checkbox">\n <input type="checkbox" id="input-publish-gist-public"\n checked="checked" />\n </div>\n </div>\n </div>\n <div class="form-group modal-publish-blogger">\n <label class="col-lg-4 control-label"\n for="input-publish-blogger-url">Blog URL</label>\n <div class="col-lg-7">\n <input type="text" id="input-publish-blogger-url"\n placeholder="http://exemple.blogger.com/" class="form-control">\n </div>\n </div>\n <div class="form-group modal-publish-tumblr">\n <label class="col-lg-4 control-label"\n for="input-publish-tumblr-hostname">Blog hostname</label>\n <div class="col-lg-7">\n <input type="text" id="input-publish-tumblr-hostname"\n placeholder="exemple.tumblr.com" class="form-control">\n </div>\n </div>\n <div class="form-group modal-publish-wordpress">\n <label class="col-lg-4 control-label"\n for="input-publish-tumblr-hostname">WordPress site</label>\n <div class="col-lg-7">\n <input type="text" id="input-publish-wordpress-site"\n placeholder="exemple.wordpress.com" class="form-control">\n <span class="help-block"> <a target="_blank"\n href="http://jetpack.me/">Jetpack plugin</a> is required for\n self-hosted sites.\n </span>\n </div>\n </div>\n <div\n class="form-group modal-publish-blogger modal-publish-tumblr modal-publish-wordpress">\n <label class="col-lg-4 control-label" for="input-publish-postid">Update\n existing post ID (optional)</label>\n <div class="col-lg-7">\n <input type="text" id="input-publish-postid" placeholder="PostID"\n class="form-control">\n </div>\n </div>\n <div class="form-group modal-publish-blogger">\n <label class="col-lg-4 control-label" for="input-publish-labels">Labels\n (comma separated)</label>\n <div class="col-lg-7">\n <input type="text" id="input-publish-labels"\n placeholder="Label1, Label2" class="form-control">\n </div>\n </div>\n <div\n class="form-group modal-publish-tumblr modal-publish-wordpress">\n <label class="col-lg-4 control-label" for="input-publish-tags">Tags\n (comma separated)</label>\n <div class="col-lg-7">\n <input type="text" id="input-publish-tags"\n placeholder="Tag1, Tag2" class="form-control">\n </div>\n </div>\n <div class="form-group modal-publish-dropbox">\n <label class="col-lg-4 control-label"\n for="input-publish-dropbox-path">File path</label>\n <div class="col-lg-7">\n <input type="text" id="input-publish-dropbox-path"\n placeholder="/path/to/My Document.html" class="form-control">\n </div>\n </div>\n <div class="form-group modal-publish-gdrive">\n <label class="col-lg-4 control-label"\n for="input-publish-gdrive-fileid">File ID (optional)</label>\n <div class="col-lg-7">\n <input type="text" id="input-publish-gdrive-fileid"\n placeholder="FileID" class="form-control"> <span\n class="help-block">If no file ID is supplied, a new file\n will be created in your Google Drive root folder. You can move\n the file afterwards within Google Drive.</span>\n </div>\n </div>\n <div class="form-group modal-publish-gdrive">\n <label class="col-lg-4 control-label"\n for="input-publish-gdrive-filename">Force filename\n (optional)</label>\n <div class="col-lg-7">\n <input type="text" id="input-publish-gdrive-filename"\n placeholder="Filename" class="form-control"> <span\n class="help-block">If no file name is supplied, the\n document title will be used.</span>\n </div>\n </div>\n\n <div class="form-group">\n <label class="col-lg-4 control-label">Format</label>\n <div class="col-lg-7">\n <div class="radio">\n <label> <input type="radio" name="radio-publish-format"\n value="markdown"> Markdown\n </label>\n </div>\n <div class="radio">\n <label> <input type="radio" name="radio-publish-format"\n value="html"> HTML\n </label>\n </div>\n <div class="radio">\n <label> <input type="radio" name="radio-publish-format"\n value="template"> Template\n </label>\n </div>\n </div>\n </div>\n <div class="collapse publish-custom-template-collapse">\n <div class="form-group">\n <div class="col-lg-4"></div>\n <div class="col-lg-7">\n <div class="checkbox">\n <label> <input type="checkbox"\n id="checkbox-publish-custom-template"> Custom template\n </label> <a href="#" class="tooltip-template">(?)</a>\n </div>\n </div>\n </div>\n <div class="form-group">\n <div class="col-lg-4"></div>\n <div class="col-lg-7">\n <textarea class="form-control"\n id="textarea-publish-custom-template"></textarea>\n </div>\n </div>\n </div>\n </div>\n </div>\n <div class="modal-footer">\n <a href="#" class="btn btn-default" data-dismiss="modal">Cancel</a>\n <a href="#" data-dismiss="modal"\n class="btn btn-primary action-process-publish">OK</a>\n </div>\n </div>\n </div>\n</div>\n\n\n<div class="modal modal-manage-publish">\n <div class="modal-dialog">\n <div class="modal-content">\n\n <div class="modal-header">\n <button type="button" class="close" data-dismiss="modal"\n aria-hidden="true">&times;</button>\n <h3 class="modal-title">Publication</h3>\n </div>\n <div class="modal-body">\n <p class="msg-publish-list hide">\n "<span class="file-title"></span>" is published on the following\n location(s):\n </p>\n <div class="msg-publish-list publish-list hide"></div>\n <blockquote>\n <div class="msg-no-publish hide">\n "<span class="file-title"></span>" is not published yet. <br /> <br />\n </div>\n <b>NOTE:</b> You can add publications using "Publish on" sub-menu.\n </blockquote>\n </div>\n <div class="modal-footer">\n <a href="#" class="btn btn-primary" data-dismiss="modal">Close</a>\n </div>\n </div>\n </div>\n</div>\n\n\n<div class="modal modal-settings">\n <div class="modal-dialog">\n <div class="modal-content">\n\n <div class="modal-header">\n <button type="button" class="close" data-dismiss="modal"\n aria-hidden="true">&times;</button>\n <h3 class="modal-title">Settings</h3>\n <ul class="nav nav-tabs">\n <li class="active"><a class="action-load-settings"\n href="#tabpane-settings-editor" data-toggle="tab">Editor</a></li>\n <li><a class="action-load-settings"\n href="#tabpane-settings-publish" data-toggle="tab">Publish</a></li>\n <li><a class="action-load-settings"\n href="#tabpane-settings-extensions" data-toggle="tab">Extensions</a></li>\n <li><a class="action-load-settings"\n href="#tabpane-settings-utils" data-toggle="tab">Utils</a></li>\n </ul>\n </div>\n <div class="modal-body">\n\n <div class="tab-content clearfix">\n <div class="tab-pane active" id="tabpane-settings-editor">\n <div class="form-horizontal">\n <div class="form-group">\n <label class="col-lg-4 control-label">Layout orientation</label>\n <div class="col-lg-7">\n <div class="radio">\n <label> <input type="radio"\n name="radio-layout-orientation" value="horizontal">\n Horizontal\n </label>\n </div>\n <div class="radio">\n <label> <input type="radio"\n name="radio-layout-orientation" value="vertical">\n Vertical\n </label>\n </div>\n </div>\n </div>\n <div class="form-group">\n <label class="col-lg-4 control-label" for="input-settings-theme">Theme</label>\n <div class="col-lg-7">\n <select id="input-settings-theme" class="form-control">\n </select> <span class="help-block"><a target="_blank"\n href="https://github.com/benweet/stackedit/blob/master/doc/theming.md#stackedit-theming-guide">Create\n your own theme...</a></span>\n </div>\n </div>\n <div class="form-group">\n <label class="col-lg-4 control-label"\n for="input-settings-lazy-rendering">Lazy rendering <a\n href="#" class="tooltip-lazy-rendering">(?)</a>\n </label>\n <div class="col-lg-7">\n <div class="checkbox">\n <input type="checkbox" id="input-settings-lazy-rendering" />\n </div>\n </div>\n </div>\n <div class="form-group">\n <label class="col-lg-4 control-label"\n for="input-settings-editor-font-family">Editor font</label>\n <div class="col-lg-8 form-inline">\n <input type="text" id="input-settings-editor-font-family"\n class="form-control col-lg-7"> <input type="text"\n id="input-settings-editor-font-size"\n class="form-control col-lg-2"> px <span\n class="help-block"> Only monospaced fonts are\n supported.</span>\n </div>\n </div>\n <div class="form-group">\n <label class="col-lg-4 control-label"\n for="input-settings-max-width">Max width</label>\n <div class="col-lg-8 form-inline">\n <input type="text" id="input-settings-max-width"\n class="form-control col-lg-3"> px\n </div>\n </div>\n <div class="form-group">\n <label class="col-lg-4 control-label"\n for="textarea-settings-default-content">Default content\n <a href="#" class="tooltip-default-content">(?)</a>\n </label>\n <div class="col-lg-7">\n <textarea id="textarea-settings-default-content"\n class="form-control"></textarea>\n </div>\n </div>\n </div>\n </div>\n <div class="tab-pane" id="tabpane-settings-publish">\n <div class="form-horizontal">\n <div class="form-group">\n <label class="col-lg-4 control-label"\n for="input-settings-publish-commit-msg">Commit message</label>\n <div class="col-lg-7">\n <input type="text" id="input-settings-publish-commit-msg"\n class="form-control">\n </div>\n </div>\n <div class="form-group">\n <label class="col-lg-4 control-label"\n for="textarea-settings-publish-template">Default\n template <a href="#" class="tooltip-template">(?)</a>\n </label>\n <div class="col-lg-7">\n <textarea id="textarea-settings-publish-template"\n class="form-control"></textarea>\n </div>\n </div>\n <div class="form-group">\n <label class="col-lg-4 control-label"\n for="input-settings-ssh-proxy">SSH proxy</label>\n <div class="col-lg-7">\n <input type="text" id="input-settings-ssh-proxy"\n class="form-control">\n </div>\n </div>\n </div>\n </div>\n <div class="tab-pane" id="tabpane-settings-extensions">\n <div class="panel-group accordion-extensions"></div>\n <span class="help-block pull-right"><a target="_blank"\n href="https://github.com/benweet/stackedit/blob/master/doc/developer-guide.md#architecture">Create\n your own extension...</a></span>\n </div>\n <div class="tab-pane" id="tabpane-settings-utils">\n <div class="tab-pane-button-container">\n <a href="#"\n class="btn btn-block btn-primary action-import-settings"><i\n class="icon-wrench icon-white"></i> Import settings</a> <a href="#"\n class="btn btn-block btn-primary action-export-settings"\n data-dismiss="modal"><i class="icon-wrench icon-white"></i>\n Export settings</a> <a href="#"\n class="btn btn-block btn-primary action-default-settings"\n data-dismiss="modal"><i class="icon-wrench icon-white"></i>\n Load default settings</a> <input type="file"\n id="input-file-import-settings" class="hide">\n </div>\n <div class="tab-pane-button-container">\n <a href="#" class="btn btn-block btn-primary action-welcome-file"\n data-dismiss="modal"><i class="icon-help-circled icon-white"></i>\n Welcome document</a> <a href="#"\n class="btn btn-block btn-primary action-welcome-tour"\n data-dismiss="modal" data-dismiss="modal"><i\n class="icon-help-circled icon-white"></i> Welcome tour</a>\n </div>\n <div class="tab-pane-button-container">\n <a href="#" class="btn btn-block btn-primary"\n data-dismiss="modal" data-toggle="modal"\n data-target=".modal-app-reset"><i\n class="icon-fire icon-white"></i> Reset application</a>\n </div>\n </div>\n </div>\n\n </div>\n <div class="modal-footer">\n <a href="#" class="btn btn-default" data-dismiss="modal">Cancel</a>\n <a href="#" class="btn btn-primary action-apply-settings"\n data-dismiss="modal">OK</a>\n </div>\n </div>\n </div>\n</div>\n\n\n<div class="modal modal-non-unique">\n <div class="modal-dialog">\n <div class="modal-content">\n\n <div class="modal-header">\n <h3 class="modal-title">Ooops...</h3>\n </div>\n <div class="modal-body">\n <p>StackEdit has stopped because another instance was running in\n the same browser.</p>\n <blockquote>If you want to reopen StackEdit, click on\n "Reload".</blockquote>\n </div>\n <div class="modal-footer">\n <a href="javascript:window.location.reload();"\n class="btn btn-primary">Reload</a>\n </div>\n </div>\n </div>\n</div>\n\n\n<div class="modal modal-app-reset">\n <div class="modal-dialog">\n <div class="modal-content">\n\n <div class="modal-header">\n <h3 class="modal-title">Reset application</h3>\n </div>\n <div class="modal-body">\n <p>This will delete all your local documents.</p>\n <blockquote>Are you sure?</blockquote>\n </div>\n <div class="modal-footer">\n <a href="#" class="btn btn-default" data-dismiss="modal">Cancel</a>\n <a href="#" class="btn btn-primary action-app-reset"\n data-dismiss="modal">OK</a>\n </div>\n </div>\n </div>\n</div>\n\n\n<div class="lock-ui hide"></div>\n<div id="dropboxjs" data-app-key="x0k2l8puemfvg0o"></div>';
}), define("text!html/bodyViewer.html", [], function() {
return '\n<div class="navbar navbar-default ui-layout-north">\n <div class="navbar-inner">\n <div class="nav right-space pull-right"></div>\n\n <ul class="nav pull-right">\n <li class="btn-group">\n <button class="btn btn-success action-edit-document hide"\n title="Edit this document">\n <i class="icon-pencil"></i>\n </button>\n </li>\n <li class="btn-group">\n <button class="btn btn-success dropdown-toggle"\n data-toggle="dropdown" title="Save this document">\n <i class="icon-download"></i>\n </button>\n <ul class="dropdown-menu">\n <li><a class="action-download-md" href="#">Save as\n Markdown</a></li>\n <li><a class="action-download-html" href="#">Save as HTML</a></li>\n <li><a class="action-download-template" href="#">Save\n using template</a></li>\n <li><a class="action-download-pdf" href="#">Save as PDF</a></li>\n </ul>\n </li>\n </ul>\n <ul class="nav pull-right">\n <li><span class="file-title-navbar"></span></li>\n </ul>\n <ul class="nav pull-right">\n <li><i class="working-indicator icon-none"></i></li>\n </ul>\n\n </div>\n</div>\n<div id="wmd-button-bar" class="hide"></div>\n<div id="wmd-input" class="hide"></div>\n<div class="ui-layout-center preview-container"></div>\n\n<div class="menu-panel collapse width">\n <button class="btn btn-success collapse-button action-open-stackedit"\n title="Open StackEdit">\n <i class="icon-left-dir"></i> <img\n data-stackedit-src="stackedit-64.png" width="32" height="32" />\n </button>\n</div>\n\n<div class="document-panel collapse width">\n <button class="btn btn-success collapse-button" data-toggle="collapse"\n data-target=".document-panel" title="Select document">\n <i class="icon-folder-open"></i> <i class="icon-right-open"></i>\n </button>\n <div class="search-bar clearfix">\n <div class="input-group">\n <span class="input-group-addon"><i class="icon-search"></i></span><input\n type="text" class="form-control"></input>\n <button type="button" class="close" title="clear">&times;</button>\n <div class="input-group-btn">\n <a data-toggle="modal" data-target=".modal-document-manager"\n class="btn btn-link" title="Manage documents"><i\n class="icon-layers"></i></a>\n </div>\n </div>\n </div>\n <div class="panel-content">\n <div class="list-group document-list"></div>\n <div class="list-group document-list-filtered hide"></div>\n </div>\n</div>\n\n<div class="modal modal-non-unique">\n <div class="modal-dialog">\n <div class="modal-content">\n\n <div class="modal-header">\n <h3 class="modal-title">Ooops...</h3>\n </div>\n <div class="modal-body">\n <p>StackEdit has stopped because another instance was running in\n the same browser.</p>\n <blockquote>If you want to reopen StackEdit, click on\n "Reload".</blockquote>\n </div>\n <div class="modal-footer">\n <a href="javascript:window.location.reload();"\n class="btn btn-primary">Reload</a>\n </div>\n </div>\n </div>\n</div>\n';
}), define("text!html/settingsTemplateTooltip.html", [], function() {
return 'Available variables:\n<br>\n<ul>\n <li><b>documentTitle</b>: document title</li>\n <li><b>documentMarkdown</b>: document in Markdown format</li>\n <li><b>documentHTML</b>: document in HTML format</li>\n <li><b>publishAttributes</b>: attributes of the publish location\n (undefined if not publishing)</li>\n</ul>\n<b>Examples:</b>\n<br />\n&lt;title&gt;&lt;%= documentTitle %&gt;&lt;&#x2F;title&gt;\n<br />\n&lt;div&gt;&lt;%- documentHTML %&gt;&lt;&#x2F;div&gt;\n<br />\n&lt;%<br />\nif(publishAttributes.provider.providerId == &quot;github&quot;)\nprint(documentMarkdown);<br />\n%&gt;\n<br />\n<br />\n<a target="_blank" href="http://underscorejs.org/#template">More\n info</a>\n<br />\n<br />\n<b class="text-danger"><i class="icon-attention"></i> Careful! Template is subject to malicious code. Don\'t copy/paste untrusted content.</b>';
}), define("text!html/settingsUserCustomExtensionTooltip.html", [], function() {
return 'Extension variable name:\n<b>userCustom</b>\n<br>\n<br>\n<b>Example:</b>\n<br />\nuserCustom.onPreviewFinished = function() {\n<br />\n&nbsp;&nbsp;eventMgr.onMessage(&quot;Finished!&quot;);\n<br />\n};\n<br />\n<br />\n<a target="_blank"\n href="https://github.com/benweet/stackedit/blob/master/doc/developer-guide.md#architecture">More\n info</a>\n<br />\n<br />\n<b class="text-danger"><i class="icon-attention"></i> Careful! This is subject to malicious code. Don\'t copy/paste untrusted content.</b>';
}), function(e, t) {
function n(t, n) {
var o, r, s, a = t.nodeName.toLowerCase();
return "area" === a ? (o = t.parentNode, r = o.name, t.href && r && "map" === o.nodeName.toLowerCase() ? (s = e("img[usemap=#" + r + "]")[0],
!!s && i(s)) : !1) : (/input|select|textarea|button|object/.test(a) ? !t.disabled : "a" === a ? t.href || n : n) && i(t);
}
function i(t) {
return e.expr.filters.visible(t) && !e(t).parents().addBack().filter(function() {
return "hidden" === e.css(this, "visibility");
}).length;
}
var o = 0, r = /^ui-id-\d+$/;
e.ui = e.ui || {}, e.extend(e.ui, {
version: "1.10.3",
keyCode: {
BACKSPACE: 8,
COMMA: 188,
DELETE: 46,
DOWN: 40,
END: 35,
ENTER: 13,
ESCAPE: 27,
HOME: 36,
LEFT: 37,
NUMPAD_ADD: 107,
NUMPAD_DECIMAL: 110,
NUMPAD_DIVIDE: 111,
NUMPAD_ENTER: 108,
NUMPAD_MULTIPLY: 106,
NUMPAD_SUBTRACT: 109,
PAGE_DOWN: 34,
PAGE_UP: 33,
PERIOD: 190,
RIGHT: 39,
SPACE: 32,
TAB: 9,
UP: 38
}
}), e.fn.extend({
focus: function(t) {
return function(n, i) {
return "number" == typeof n ? this.each(function() {
var t = this;
setTimeout(function() {
e(t).focus(), i && i.call(t);
}, n);
}) : t.apply(this, arguments);
};
}(e.fn.focus),
scrollParent: function() {
var t;
return t = e.ui.ie && /(static|relative)/.test(this.css("position")) || /absolute/.test(this.css("position")) ? this.parents().filter(function() {
return /(relative|absolute|fixed)/.test(e.css(this, "position")) && /(auto|scroll)/.test(e.css(this, "overflow") + e.css(this, "overflow-y") + e.css(this, "overflow-x"));
}).eq(0) : this.parents().filter(function() {
return /(auto|scroll)/.test(e.css(this, "overflow") + e.css(this, "overflow-y") + e.css(this, "overflow-x"));
}).eq(0), /fixed/.test(this.css("position")) || !t.length ? e(document) : t;
},
zIndex: function(n) {
if (n !== t) return this.css("zIndex", n);
if (this.length) for (var i, o, r = e(this[0]); r.length && r[0] !== document; ) {
if (i = r.css("position"), ("absolute" === i || "relative" === i || "fixed" === i) && (o = parseInt(r.css("zIndex"), 10),
!isNaN(o) && 0 !== o)) return o;
r = r.parent();
}
return 0;
},
uniqueId: function() {
return this.each(function() {
this.id || (this.id = "ui-id-" + ++o);
});
},
removeUniqueId: function() {
return this.each(function() {
r.test(this.id) && e(this).removeAttr("id");
});
}
}), e.extend(e.expr[":"], {
data: e.expr.createPseudo ? e.expr.createPseudo(function(t) {
return function(n) {
return !!e.data(n, t);
};
}) : function(t, n, i) {
return !!e.data(t, i[3]);
},
focusable: function(t) {
return n(t, !isNaN(e.attr(t, "tabindex")));
},
tabbable: function(t) {
var i = e.attr(t, "tabindex"), o = isNaN(i);
return (o || i >= 0) && n(t, !o);
}
}), e("<a>").outerWidth(1).jquery || e.each([ "Width", "Height" ], function(n, i) {
function o(t, n, i, o) {
return e.each(r, function() {
n -= parseFloat(e.css(t, "padding" + this)) || 0, i && (n -= parseFloat(e.css(t, "border" + this + "Width")) || 0),
o && (n -= parseFloat(e.css(t, "margin" + this)) || 0);
}), n;
}
var r = "Width" === i ? [ "Left", "Right" ] : [ "Top", "Bottom" ], s = i.toLowerCase(), a = {
innerWidth: e.fn.innerWidth,
innerHeight: e.fn.innerHeight,
outerWidth: e.fn.outerWidth,
outerHeight: e.fn.outerHeight
};
e.fn["inner" + i] = function(n) {
return n === t ? a["inner" + i].call(this) : this.each(function() {
e(this).css(s, o(this, n) + "px");
});
}, e.fn["outer" + i] = function(t, n) {
return "number" != typeof t ? a["outer" + i].call(this, t) : this.each(function() {
e(this).css(s, o(this, t, !0, n) + "px");
});
};
}), e.fn.addBack || (e.fn.addBack = function(e) {
return this.add(null == e ? this.prevObject : this.prevObject.filter(e));
}), e("<a>").data("a-b", "a").removeData("a-b").data("a-b") && (e.fn.removeData = function(t) {
return function(n) {
return arguments.length ? t.call(this, e.camelCase(n)) : t.call(this);
};
}(e.fn.removeData)), e.ui.ie = !!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase()),
e.support.selectstart = "onselectstart" in document.createElement("div"), e.fn.extend({
disableSelection: function() {
return this.bind((e.support.selectstart ? "selectstart" : "mousedown") + ".ui-disableSelection", function(e) {
e.preventDefault();
});
},
enableSelection: function() {
return this.unbind(".ui-disableSelection");
}
}), e.extend(e.ui, {
plugin: {
add: function(t, n, i) {
var o, r = e.ui[t].prototype;
for (o in i) r.plugins[o] = r.plugins[o] || [], r.plugins[o].push([ n, i[o] ]);
},
call: function(e, t, n) {
var i, o = e.plugins[t];
if (o && e.element[0].parentNode && 11 !== e.element[0].parentNode.nodeType) for (i = 0; i < o.length; i++) e.options[o[i][0]] && o[i][1].apply(e.element, n);
}
},
hasScroll: function(t, n) {
if ("hidden" === e(t).css("overflow")) return !1;
var i = n && "left" === n ? "scrollLeft" : "scrollTop", o = !1;
return t[i] > 0 ? !0 : (t[i] = 1, o = t[i] > 0, t[i] = 0, o);
}
});
}(jQuery), define("jquery-ui-core", function() {}), function(e, t) {
var n = 0, i = Array.prototype.slice, o = e.cleanData;
e.cleanData = function(t) {
for (var n, i = 0; null != (n = t[i]); i++) try {
e(n).triggerHandler("remove");
} catch (r) {}
o(t);
}, e.widget = function(t, n, i) {
var o, r, s, a, l = {}, c = t.split(".")[0];
t = t.split(".")[1], o = c + "-" + t, i || (i = n, n = e.Widget), e.expr[":"][o.toLowerCase()] = function(t) {
return !!e.data(t, o);
}, e[c] = e[c] || {}, r = e[c][t], s = e[c][t] = function(e, t) {
return this._createWidget ? (arguments.length && this._createWidget(e, t), void 0) : new s(e, t);
}, e.extend(s, r, {
version: i.version,
_proto: e.extend({}, i),
_childConstructors: []
}), a = new n(), a.options = e.widget.extend({}, a.options), e.each(i, function(t, i) {
return e.isFunction(i) ? (l[t] = function() {
var e = function() {
return n.prototype[t].apply(this, arguments);
}, o = function(e) {
return n.prototype[t].apply(this, e);
};
return function() {
var t, n = this._super, r = this._superApply;
return this._super = e, this._superApply = o, t = i.apply(this, arguments), this._super = n,
this._superApply = r, t;
};
}(), void 0) : (l[t] = i, void 0);
}), s.prototype = e.widget.extend(a, {
widgetEventPrefix: r ? a.widgetEventPrefix : t
}, l, {
constructor: s,
namespace: c,
widgetName: t,
widgetFullName: o
}), r ? (e.each(r._childConstructors, function(t, n) {
var i = n.prototype;
e.widget(i.namespace + "." + i.widgetName, s, n._proto);
}), delete r._childConstructors) : n._childConstructors.push(s), e.widget.bridge(t, s);
}, e.widget.extend = function(n) {
for (var o, r, s = i.call(arguments, 1), a = 0, l = s.length; l > a; a++) for (o in s[a]) r = s[a][o],
s[a].hasOwnProperty(o) && r !== t && (n[o] = e.isPlainObject(r) ? e.isPlainObject(n[o]) ? e.widget.extend({}, n[o], r) : e.widget.extend({}, r) : r);
return n;
}, e.widget.bridge = function(n, o) {
var r = o.prototype.widgetFullName || n;
e.fn[n] = function(s) {
var a = "string" == typeof s, l = i.call(arguments, 1), c = this;
return s = !a && l.length ? e.widget.extend.apply(null, [ s ].concat(l)) : s, a ? this.each(function() {
var i, o = e.data(this, r);
return o ? e.isFunction(o[s]) && "_" !== s.charAt(0) ? (i = o[s].apply(o, l), i !== o && i !== t ? (c = i && i.jquery ? c.pushStack(i.get()) : i,
!1) : void 0) : e.error("no such method '" + s + "' for " + n + " widget instance") : e.error("cannot call methods on " + n + " prior to initialization; " + "attempted to call method '" + s + "'");
}) : this.each(function() {
var t = e.data(this, r);
t ? t.option(s || {})._init() : e.data(this, r, new o(s, this));
}), c;
};
}, e.Widget = function() {}, e.Widget._childConstructors = [], e.Widget.prototype = {
widgetName: "widget",
widgetEventPrefix: "",
defaultElement: "<div>",
options: {
disabled: !1,
create: null
},
_createWidget: function(t, i) {
i = e(i || this.defaultElement || this)[0], this.element = e(i), this.uuid = n++,
this.eventNamespace = "." + this.widgetName + this.uuid, this.options = e.widget.extend({}, this.options, this._getCreateOptions(), t),
this.bindings = e(), this.hoverable = e(), this.focusable = e(), i !== this && (e.data(i, this.widgetFullName, this),
this._on(!0, this.element, {
remove: function(e) {
e.target === i && this.destroy();
}
}), this.document = e(i.style ? i.ownerDocument : i.document || i), this.window = e(this.document[0].defaultView || this.document[0].parentWindow)),
this._create(), this._trigger("create", null, this._getCreateEventData()), this._init();
},
_getCreateOptions: e.noop,
_getCreateEventData: e.noop,
_create: e.noop,
_init: e.noop,
destroy: function() {
this._destroy(), this.element.unbind(this.eventNamespace).removeData(this.widgetName).removeData(this.widgetFullName).removeData(e.camelCase(this.widgetFullName)),
this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName + "-disabled " + "ui-state-disabled"),
this.bindings.unbind(this.eventNamespace), this.hoverable.removeClass("ui-state-hover"),
this.focusable.removeClass("ui-state-focus");
},
_destroy: e.noop,
widget: function() {
return this.element;
},
option: function(n, i) {
var o, r, s, a = n;
if (0 === arguments.length) return e.widget.extend({}, this.options);
if ("string" == typeof n) if (a = {}, o = n.split("."), n = o.shift(), o.length) {
for (r = a[n] = e.widget.extend({}, this.options[n]), s = 0; s < o.length - 1; s++) r[o[s]] = r[o[s]] || {},
r = r[o[s]];
if (n = o.pop(), i === t) return r[n] === t ? null : r[n];
r[n] = i;
} else {
if (i === t) return this.options[n] === t ? null : this.options[n];
a[n] = i;
}
return this._setOptions(a), this;
},
_setOptions: function(e) {
var t;
for (t in e) this._setOption(t, e[t]);
return this;
},
_setOption: function(e, t) {
return this.options[e] = t, "disabled" === e && (this.widget().toggleClass(this.widgetFullName + "-disabled ui-state-disabled", !!t).attr("aria-disabled", t),
this.hoverable.removeClass("ui-state-hover"), this.focusable.removeClass("ui-state-focus")),
this;
},
enable: function() {
return this._setOption("disabled", !1);
},
disable: function() {
return this._setOption("disabled", !0);
},
_on: function(t, n, i) {
var o, r = this;
"boolean" != typeof t && (i = n, n = t, t = !1), i ? (n = o = e(n), this.bindings = this.bindings.add(n)) : (i = n,
n = this.element, o = this.widget()), e.each(i, function(i, s) {
function a() {
return t || r.options.disabled !== !0 && !e(this).hasClass("ui-state-disabled") ? ("string" == typeof s ? r[s] : s).apply(r, arguments) : void 0;
}
"string" != typeof s && (a.guid = s.guid = s.guid || a.guid || e.guid++);
var l = i.match(/^(\w+)\s*(.*)$/), c = l[1] + r.eventNamespace, u = l[2];
u ? o.delegate(u, c, a) : n.bind(c, a);
});
},
_off: function(e, t) {
t = (t || "").split(" ").join(this.eventNamespace + " ") + this.eventNamespace,
e.unbind(t).undelegate(t);
},
_delay: function(e, t) {
function n() {
return ("string" == typeof e ? i[e] : e).apply(i, arguments);
}
var i = this;
return setTimeout(n, t || 0);
},
_hoverable: function(t) {
this.hoverable = this.hoverable.add(t), this._on(t, {
mouseenter: function(t) {
e(t.currentTarget).addClass("ui-state-hover");
},
mouseleave: function(t) {
e(t.currentTarget).removeClass("ui-state-hover");
}
});
},
_focusable: function(t) {
this.focusable = this.focusable.add(t), this._on(t, {
focusin: function(t) {
e(t.currentTarget).addClass("ui-state-focus");
},
focusout: function(t) {
e(t.currentTarget).removeClass("ui-state-focus");
}
});
},
_trigger: function(t, n, i) {
var o, r, s = this.options[t];
if (i = i || {}, n = e.Event(n), n.type = (t === this.widgetEventPrefix ? t : this.widgetEventPrefix + t).toLowerCase(),
n.target = this.element[0], r = n.originalEvent) for (o in r) o in n || (n[o] = r[o]);
return this.element.trigger(n, i), !(e.isFunction(s) && s.apply(this.element[0], [ n ].concat(i)) === !1 || n.isDefaultPrevented());
}
}, e.each({
show: "fadeIn",
hide: "fadeOut"
}, function(t, n) {
e.Widget.prototype["_" + t] = function(i, o, r) {
"string" == typeof o && (o = {
effect: o
});
var s, a = o ? o === !0 || "number" == typeof o ? n : o.effect || n : t;
o = o || {}, "number" == typeof o && (o = {
duration: o
}), s = !e.isEmptyObject(o), o.complete = r, o.delay && i.delay(o.delay), s && e.effects && e.effects.effect[a] ? i[t](o) : a !== t && i[a] ? i[a](o.duration, o.easing, r) : i.queue(function(n) {
e(this)[t](), r && r.call(i[0]), n();
});
};
});
}(jQuery), define("jquery-ui-widget", function() {}), function(e) {
var t = !1;
e(document).mouseup(function() {
t = !1;
}), e.widget("ui.mouse", {
version: "1.10.3",
options: {
cancel: "input,textarea,button,select,option",
distance: 1,
delay: 0
},
_mouseInit: function() {
var t = this;
this.element.bind("mousedown." + this.widgetName, function(e) {
return t._mouseDown(e);
}).bind("click." + this.widgetName, function(n) {
return !0 === e.data(n.target, t.widgetName + ".preventClickEvent") ? (e.removeData(n.target, t.widgetName + ".preventClickEvent"),
n.stopImmediatePropagation(), !1) : void 0;
}), this.started = !1;
},
_mouseDestroy: function() {
this.element.unbind("." + this.widgetName), this._mouseMoveDelegate && e(document).unbind("mousemove." + this.widgetName, this._mouseMoveDelegate).unbind("mouseup." + this.widgetName, this._mouseUpDelegate);
},
_mouseDown: function(n) {
if (!t) {
this._mouseStarted && this._mouseUp(n), this._mouseDownEvent = n;
var i = this, o = 1 === n.which, r = "string" == typeof this.options.cancel && n.target.nodeName ? e(n.target).closest(this.options.cancel).length : !1;
return o && !r && this._mouseCapture(n) ? (this.mouseDelayMet = !this.options.delay,
this.mouseDelayMet || (this._mouseDelayTimer = setTimeout(function() {
i.mouseDelayMet = !0;
}, this.options.delay)), this._mouseDistanceMet(n) && this._mouseDelayMet(n) && (this._mouseStarted = this._mouseStart(n) !== !1,
!this._mouseStarted) ? (n.preventDefault(), !0) : (!0 === e.data(n.target, this.widgetName + ".preventClickEvent") && e.removeData(n.target, this.widgetName + ".preventClickEvent"),
this._mouseMoveDelegate = function(e) {
return i._mouseMove(e);
}, this._mouseUpDelegate = function(e) {
return i._mouseUp(e);
}, e(document).bind("mousemove." + this.widgetName, this._mouseMoveDelegate).bind("mouseup." + this.widgetName, this._mouseUpDelegate),
n.preventDefault(), t = !0, !0)) : !0;
}
},
_mouseMove: function(t) {
return e.ui.ie && (!document.documentMode || document.documentMode < 9) && !t.button ? this._mouseUp(t) : this._mouseStarted ? (this._mouseDrag(t),
t.preventDefault()) : (this._mouseDistanceMet(t) && this._mouseDelayMet(t) && (this._mouseStarted = this._mouseStart(this._mouseDownEvent, t) !== !1,
this._mouseStarted ? this._mouseDrag(t) : this._mouseUp(t)), !this._mouseStarted);
},
_mouseUp: function(t) {
return e(document).unbind("mousemove." + this.widgetName, this._mouseMoveDelegate).unbind("mouseup." + this.widgetName, this._mouseUpDelegate),
this._mouseStarted && (this._mouseStarted = !1, t.target === this._mouseDownEvent.target && e.data(t.target, this.widgetName + ".preventClickEvent", !0),
this._mouseStop(t)), !1;
},
_mouseDistanceMet: function(e) {
return Math.max(Math.abs(this._mouseDownEvent.pageX - e.pageX), Math.abs(this._mouseDownEvent.pageY - e.pageY)) >= this.options.distance;
},
_mouseDelayMet: function() {
return this.mouseDelayMet;
},
_mouseStart: function() {},
_mouseDrag: function() {},
_mouseStop: function() {},
_mouseCapture: function() {
return !0;
}
});
}(jQuery), define("jquery-ui-mouse", function() {}), function(e) {
e.widget("ui.draggable", e.ui.mouse, {
version: "1.10.3",
widgetEventPrefix: "drag",
options: {
addClasses: !0,
appendTo: "parent",
axis: !1,
connectToSortable: !1,
containment: !1,
cursor: "auto",
cursorAt: !1,
grid: !1,
handle: !1,
helper: "original",
iframeFix: !1,
opacity: !1,
refreshPositions: !1,
revert: !1,
revertDuration: 500,
scope: "default",
scroll: !0,
scrollSensitivity: 20,
scrollSpeed: 20,
snap: !1,
snapMode: "both",
snapTolerance: 20,
stack: !1,
zIndex: !1,
drag: null,
start: null,
stop: null
},
_create: function() {
"original" !== this.options.helper || /^(?:r|a|f)/.test(this.element.css("position")) || (this.element[0].style.position = "relative"),
this.options.addClasses && this.element.addClass("ui-draggable"), this.options.disabled && this.element.addClass("ui-draggable-disabled"),
this._mouseInit();
},
_destroy: function() {
this.element.removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled"),
this._mouseDestroy();
},
_mouseCapture: function(t) {
var n = this.options;
return this.helper || n.disabled || e(t.target).closest(".ui-resizable-handle").length > 0 ? !1 : (this.handle = this._getHandle(t),
this.handle ? (e(n.iframeFix === !0 ? "iframe" : n.iframeFix).each(function() {
e("<div class='ui-draggable-iframeFix' style='background: #fff;'></div>").css({
width: this.offsetWidth + "px",
height: this.offsetHeight + "px",
position: "absolute",
opacity: "0.001",
zIndex: 1e3
}).css(e(this).offset()).appendTo("body");
}), !0) : !1);
},
_mouseStart: function(t) {
var n = this.options;
return this.helper = this._createHelper(t), this.helper.addClass("ui-draggable-dragging"),
this._cacheHelperProportions(), e.ui.ddmanager && (e.ui.ddmanager.current = this),
this._cacheMargins(), this.cssPosition = this.helper.css("position"), this.scrollParent = this.helper.scrollParent(),
this.offsetParent = this.helper.offsetParent(), this.offsetParentCssPosition = this.offsetParent.css("position"),
this.offset = this.positionAbs = this.element.offset(), this.offset = {
top: this.offset.top - this.margins.top,
left: this.offset.left - this.margins.left
}, this.offset.scroll = !1, e.extend(this.offset, {
click: {
left: t.pageX - this.offset.left,
top: t.pageY - this.offset.top
},
parent: this._getParentOffset(),
relative: this._getRelativeOffset()
}), this.originalPosition = this.position = this._generatePosition(t), this.originalPageX = t.pageX,
this.originalPageY = t.pageY, n.cursorAt && this._adjustOffsetFromHelper(n.cursorAt),
this._setContainment(), this._trigger("start", t) === !1 ? (this._clear(), !1) : (this._cacheHelperProportions(),
e.ui.ddmanager && !n.dropBehaviour && e.ui.ddmanager.prepareOffsets(this, t), this._mouseDrag(t, !0),
e.ui.ddmanager && e.ui.ddmanager.dragStart(this, t), !0);
},
_mouseDrag: function(t, n) {
if ("fixed" === this.offsetParentCssPosition && (this.offset.parent = this._getParentOffset()),
this.position = this._generatePosition(t), this.positionAbs = this._convertPositionTo("absolute"),
!n) {
var i = this._uiHash();
if (this._trigger("drag", t, i) === !1) return this._mouseUp({}), !1;
this.position = i.position;
}
return this.options.axis && "y" === this.options.axis || (this.helper[0].style.left = this.position.left + "px"),
this.options.axis && "x" === this.options.axis || (this.helper[0].style.top = this.position.top + "px"),
e.ui.ddmanager && e.ui.ddmanager.drag(this, t), !1;
},
_mouseStop: function(t) {
var n = this, i = !1;
return e.ui.ddmanager && !this.options.dropBehaviour && (i = e.ui.ddmanager.drop(this, t)),
this.dropped && (i = this.dropped, this.dropped = !1), "original" !== this.options.helper || e.contains(this.element[0].ownerDocument, this.element[0]) ? ("invalid" === this.options.revert && !i || "valid" === this.options.revert && i || this.options.revert === !0 || e.isFunction(this.options.revert) && this.options.revert.call(this.element, i) ? e(this.helper).animate(this.originalPosition, parseInt(this.options.revertDuration, 10), function() {
n._trigger("stop", t) !== !1 && n._clear();
}) : this._trigger("stop", t) !== !1 && this._clear(), !1) : !1;
},
_mouseUp: function(t) {
return e("div.ui-draggable-iframeFix").each(function() {
this.parentNode.removeChild(this);
}), e.ui.ddmanager && e.ui.ddmanager.dragStop(this, t), e.ui.mouse.prototype._mouseUp.call(this, t);
},
cancel: function() {
return this.helper.is(".ui-draggable-dragging") ? this._mouseUp({}) : this._clear(),
this;
},
_getHandle: function(t) {
return this.options.handle ? !!e(t.target).closest(this.element.find(this.options.handle)).length : !0;
},
_createHelper: function(t) {
var n = this.options, i = e.isFunction(n.helper) ? e(n.helper.apply(this.element[0], [ t ])) : "clone" === n.helper ? this.element.clone().removeAttr("id") : this.element;
return i.parents("body").length || i.appendTo("parent" === n.appendTo ? this.element[0].parentNode : n.appendTo),
i[0] === this.element[0] || /(fixed|absolute)/.test(i.css("position")) || i.css("position", "absolute"),
i;
},
_adjustOffsetFromHelper: function(t) {
"string" == typeof t && (t = t.split(" ")), e.isArray(t) && (t = {
left: +t[0],
top: +t[1] || 0
}), "left" in t && (this.offset.click.left = t.left + this.margins.left), "right" in t && (this.offset.click.left = this.helperProportions.width - t.right + this.margins.left),
"top" in t && (this.offset.click.top = t.top + this.margins.top), "bottom" in t && (this.offset.click.top = this.helperProportions.height - t.bottom + this.margins.top);
},
_getParentOffset: function() {
var t = this.offsetParent.offset();
return "absolute" === this.cssPosition && this.scrollParent[0] !== document && e.contains(this.scrollParent[0], this.offsetParent[0]) && (t.left += this.scrollParent.scrollLeft(),
t.top += this.scrollParent.scrollTop()), (this.offsetParent[0] === document.body || this.offsetParent[0].tagName && "html" === this.offsetParent[0].tagName.toLowerCase() && e.ui.ie) && (t = {
top: 0,
left: 0
}), {
top: t.top + (parseInt(this.offsetParent.css("borderTopWidth"), 10) || 0),
left: t.left + (parseInt(this.offsetParent.css("borderLeftWidth"), 10) || 0)
};
},
_getRelativeOffset: function() {
if ("relative" === this.cssPosition) {
var e = this.element.position();
return {
top: e.top - (parseInt(this.helper.css("top"), 10) || 0) + this.scrollParent.scrollTop(),
left: e.left - (parseInt(this.helper.css("left"), 10) || 0) + this.scrollParent.scrollLeft()
};
}
return {
top: 0,
left: 0
};
},
_cacheMargins: function() {
this.margins = {
left: parseInt(this.element.css("marginLeft"), 10) || 0,
top: parseInt(this.element.css("marginTop"), 10) || 0,
right: parseInt(this.element.css("marginRight"), 10) || 0,
bottom: parseInt(this.element.css("marginBottom"), 10) || 0
};
},
_cacheHelperProportions: function() {
this.helperProportions = {
width: this.helper.outerWidth(),
height: this.helper.outerHeight()
};
},
_setContainment: function() {
var t, n, i, o = this.options;
return o.containment ? "window" === o.containment ? (this.containment = [ e(window).scrollLeft() - this.offset.relative.left - this.offset.parent.left, e(window).scrollTop() - this.offset.relative.top - this.offset.parent.top, e(window).scrollLeft() + e(window).width() - this.helperProportions.width - this.margins.left, e(window).scrollTop() + (e(window).height() || document.body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top ],
void 0) : "document" === o.containment ? (this.containment = [ 0, 0, e(document).width() - this.helperProportions.width - this.margins.left, (e(document).height() || document.body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top ],
void 0) : o.containment.constructor === Array ? (this.containment = o.containment,
void 0) : ("parent" === o.containment && (o.containment = this.helper[0].parentNode),
n = e(o.containment), i = n[0], i && (t = "hidden" !== n.css("overflow"), this.containment = [ (parseInt(n.css("borderLeftWidth"), 10) || 0) + (parseInt(n.css("paddingLeft"), 10) || 0), (parseInt(n.css("borderTopWidth"), 10) || 0) + (parseInt(n.css("paddingTop"), 10) || 0), (t ? Math.max(i.scrollWidth, i.offsetWidth) : i.offsetWidth) - (parseInt(n.css("borderRightWidth"), 10) || 0) - (parseInt(n.css("paddingRight"), 10) || 0) - this.helperProportions.width - this.margins.left - this.margins.right, (t ? Math.max(i.scrollHeight, i.offsetHeight) : i.offsetHeight) - (parseInt(n.css("borderBottomWidth"), 10) || 0) - (parseInt(n.css("paddingBottom"), 10) || 0) - this.helperProportions.height - this.margins.top - this.margins.bottom ],
this.relative_container = n), void 0) : (this.containment = null, void 0);
},
_convertPositionTo: function(t, n) {
n || (n = this.position);
var i = "absolute" === t ? 1 : -1, o = "absolute" !== this.cssPosition || this.scrollParent[0] !== document && e.contains(this.scrollParent[0], this.offsetParent[0]) ? this.scrollParent : this.offsetParent;
return this.offset.scroll || (this.offset.scroll = {
top: o.scrollTop(),
left: o.scrollLeft()
}), {
top: n.top + this.offset.relative.top * i + this.offset.parent.top * i - ("fixed" === this.cssPosition ? -this.scrollParent.scrollTop() : this.offset.scroll.top) * i,
left: n.left + this.offset.relative.left * i + this.offset.parent.left * i - ("fixed" === this.cssPosition ? -this.scrollParent.scrollLeft() : this.offset.scroll.left) * i
};
},
_generatePosition: function(t) {
var n, i, o, r, s = this.options, a = "absolute" !== this.cssPosition || this.scrollParent[0] !== document && e.contains(this.scrollParent[0], this.offsetParent[0]) ? this.scrollParent : this.offsetParent, l = t.pageX, c = t.pageY;
return this.offset.scroll || (this.offset.scroll = {
top: a.scrollTop(),
left: a.scrollLeft()
}), this.originalPosition && (this.containment && (this.relative_container ? (i = this.relative_container.offset(),
n = [ this.containment[0] + i.left, this.containment[1] + i.top, this.containment[2] + i.left, this.containment[3] + i.top ]) : n = this.containment,
t.pageX - this.offset.click.left < n[0] && (l = n[0] + this.offset.click.left),
t.pageY - this.offset.click.top < n[1] && (c = n[1] + this.offset.click.top), t.pageX - this.offset.click.left > n[2] && (l = n[2] + this.offset.click.left),
t.pageY - this.offset.click.top > n[3] && (c = n[3] + this.offset.click.top)), s.grid && (o = s.grid[1] ? this.originalPageY + Math.round((c - this.originalPageY) / s.grid[1]) * s.grid[1] : this.originalPageY,
c = n ? o - this.offset.click.top >= n[1] || o - this.offset.click.top > n[3] ? o : o - this.offset.click.top >= n[1] ? o - s.grid[1] : o + s.grid[1] : o,
r = s.grid[0] ? this.originalPageX + Math.round((l - this.originalPageX) / s.grid[0]) * s.grid[0] : this.originalPageX,
l = n ? r - this.offset.click.left >= n[0] || r - this.offset.click.left > n[2] ? r : r - this.offset.click.left >= n[0] ? r - s.grid[0] : r + s.grid[0] : r)),
{
top: c - this.offset.click.top - this.offset.relative.top - this.offset.parent.top + ("fixed" === this.cssPosition ? -this.scrollParent.scrollTop() : this.offset.scroll.top),
left: l - this.offset.click.left - this.offset.relative.left - this.offset.parent.left + ("fixed" === this.cssPosition ? -this.scrollParent.scrollLeft() : this.offset.scroll.left)
};
},
_clear: function() {
this.helper.removeClass("ui-draggable-dragging"), this.helper[0] === this.element[0] || this.cancelHelperRemoval || this.helper.remove(),
this.helper = null, this.cancelHelperRemoval = !1;
},
_trigger: function(t, n, i) {
return i = i || this._uiHash(), e.ui.plugin.call(this, t, [ n, i ]), "drag" === t && (this.positionAbs = this._convertPositionTo("absolute")),
e.Widget.prototype._trigger.call(this, t, n, i);
},
plugins: {},
_uiHash: function() {
return {
helper: this.helper,
position: this.position,
originalPosition: this.originalPosition,
offset: this.positionAbs
};
}
}), e.ui.plugin.add("draggable", "connectToSortable", {
start: function(t, n) {
var i = e(this).data("ui-draggable"), o = i.options, r = e.extend({}, n, {
item: i.element
});
i.sortables = [], e(o.connectToSortable).each(function() {
var n = e.data(this, "ui-sortable");
n && !n.options.disabled && (i.sortables.push({
instance: n,
shouldRevert: n.options.revert
}), n.refreshPositions(), n._trigger("activate", t, r));
});
},
stop: function(t, n) {
var i = e(this).data("ui-draggable"), o = e.extend({}, n, {
item: i.element
});
e.each(i.sortables, function() {
this.instance.isOver ? (this.instance.isOver = 0, i.cancelHelperRemoval = !0, this.instance.cancelHelperRemoval = !1,
this.shouldRevert && (this.instance.options.revert = this.shouldRevert), this.instance._mouseStop(t),
this.instance.options.helper = this.instance.options._helper, "original" === i.options.helper && this.instance.currentItem.css({
top: "auto",
left: "auto"
})) : (this.instance.cancelHelperRemoval = !1, this.instance._trigger("deactivate", t, o));
});
},
drag: function(t, n) {
var i = e(this).data("ui-draggable"), o = this;
e.each(i.sortables, function() {
var r = !1, s = this;
this.instance.positionAbs = i.positionAbs, this.instance.helperProportions = i.helperProportions,
this.instance.offset.click = i.offset.click, this.instance._intersectsWith(this.instance.containerCache) && (r = !0,
e.each(i.sortables, function() {
return this.instance.positionAbs = i.positionAbs, this.instance.helperProportions = i.helperProportions,
this.instance.offset.click = i.offset.click, this !== s && this.instance._intersectsWith(this.instance.containerCache) && e.contains(s.instance.element[0], this.instance.element[0]) && (r = !1),
r;
})), r ? (this.instance.isOver || (this.instance.isOver = 1, this.instance.currentItem = e(o).clone().removeAttr("id").appendTo(this.instance.element).data("ui-sortable-item", !0),
this.instance.options._helper = this.instance.options.helper, this.instance.options.helper = function() {
return n.helper[0];
}, t.target = this.instance.currentItem[0], this.instance._mouseCapture(t, !0),
this.instance._mouseStart(t, !0, !0), this.instance.offset.click.top = i.offset.click.top,
this.instance.offset.click.left = i.offset.click.left, this.instance.offset.parent.left -= i.offset.parent.left - this.instance.offset.parent.left,
this.instance.offset.parent.top -= i.offset.parent.top - this.instance.offset.parent.top,
i._trigger("toSortable", t), i.dropped = this.instance.element, i.currentItem = i.element,
this.instance.fromOutside = i), this.instance.currentItem && this.instance._mouseDrag(t)) : this.instance.isOver && (this.instance.isOver = 0,
this.instance.cancelHelperRemoval = !0, this.instance.options.revert = !1, this.instance._trigger("out", t, this.instance._uiHash(this.instance)),
this.instance._mouseStop(t, !0), this.instance.options.helper = this.instance.options._helper,
this.instance.currentItem.remove(), this.instance.placeholder && this.instance.placeholder.remove(),
i._trigger("fromSortable", t), i.dropped = !1);
});
}
}), e.ui.plugin.add("draggable", "cursor", {
start: function() {
var t = e("body"), n = e(this).data("ui-draggable").options;
t.css("cursor") && (n._cursor = t.css("cursor")), t.css("cursor", n.cursor);
},
stop: function() {
var t = e(this).data("ui-draggable").options;
t._cursor && e("body").css("cursor", t._cursor);
}
}), e.ui.plugin.add("draggable", "opacity", {
start: function(t, n) {
var i = e(n.helper), o = e(this).data("ui-draggable").options;
i.css("opacity") && (o._opacity = i.css("opacity")), i.css("opacity", o.opacity);
},
stop: function(t, n) {
var i = e(this).data("ui-draggable").options;
i._opacity && e(n.helper).css("opacity", i._opacity);
}
}), e.ui.plugin.add("draggable", "scroll", {
start: function() {
var t = e(this).data("ui-draggable");
t.scrollParent[0] !== document && "HTML" !== t.scrollParent[0].tagName && (t.overflowOffset = t.scrollParent.offset());
},
drag: function(t) {
var n = e(this).data("ui-draggable"), i = n.options, o = !1;
n.scrollParent[0] !== document && "HTML" !== n.scrollParent[0].tagName ? (i.axis && "x" === i.axis || (n.overflowOffset.top + n.scrollParent[0].offsetHeight - t.pageY < i.scrollSensitivity ? n.scrollParent[0].scrollTop = o = n.scrollParent[0].scrollTop + i.scrollSpeed : t.pageY - n.overflowOffset.top < i.scrollSensitivity && (n.scrollParent[0].scrollTop = o = n.scrollParent[0].scrollTop - i.scrollSpeed)),
i.axis && "y" === i.axis || (n.overflowOffset.left + n.scrollParent[0].offsetWidth - t.pageX < i.scrollSensitivity ? n.scrollParent[0].scrollLeft = o = n.scrollParent[0].scrollLeft + i.scrollSpeed : t.pageX - n.overflowOffset.left < i.scrollSensitivity && (n.scrollParent[0].scrollLeft = o = n.scrollParent[0].scrollLeft - i.scrollSpeed))) : (i.axis && "x" === i.axis || (t.pageY - e(document).scrollTop() < i.scrollSensitivity ? o = e(document).scrollTop(e(document).scrollTop() - i.scrollSpeed) : e(window).height() - (t.pageY - e(document).scrollTop()) < i.scrollSensitivity && (o = e(document).scrollTop(e(document).scrollTop() + i.scrollSpeed))),
i.axis && "y" === i.axis || (t.pageX - e(document).scrollLeft() < i.scrollSensitivity ? o = e(document).scrollLeft(e(document).scrollLeft() - i.scrollSpeed) : e(window).width() - (t.pageX - e(document).scrollLeft()) < i.scrollSensitivity && (o = e(document).scrollLeft(e(document).scrollLeft() + i.scrollSpeed)))),
o !== !1 && e.ui.ddmanager && !i.dropBehaviour && e.ui.ddmanager.prepareOffsets(n, t);
}
}), e.ui.plugin.add("draggable", "snap", {
start: function() {
var t = e(this).data("ui-draggable"), n = t.options;
t.snapElements = [], e(n.snap.constructor !== String ? n.snap.items || ":data(ui-draggable)" : n.snap).each(function() {
var n = e(this), i = n.offset();
this !== t.element[0] && t.snapElements.push({
item: this,
width: n.outerWidth(),
height: n.outerHeight(),
top: i.top,
left: i.left
});
});
},
drag: function(t, n) {
var i, o, r, s, a, l, c, u, d, h, p = e(this).data("ui-draggable"), f = p.options, g = f.snapTolerance, m = n.offset.left, v = m + p.helperProportions.width, b = n.offset.top, y = b + p.helperProportions.height;
for (d = p.snapElements.length - 1; d >= 0; d--) a = p.snapElements[d].left, l = a + p.snapElements[d].width,
c = p.snapElements[d].top, u = c + p.snapElements[d].height, a - g > v || m > l + g || c - g > y || b > u + g || !e.contains(p.snapElements[d].item.ownerDocument, p.snapElements[d].item) ? (p.snapElements[d].snapping && p.options.snap.release && p.options.snap.release.call(p.element, t, e.extend(p._uiHash(), {
snapItem: p.snapElements[d].item
})), p.snapElements[d].snapping = !1) : ("inner" !== f.snapMode && (i = Math.abs(c - y) <= g,
o = Math.abs(u - b) <= g, r = Math.abs(a - v) <= g, s = Math.abs(l - m) <= g, i && (n.position.top = p._convertPositionTo("relative", {
top: c - p.helperProportions.height,
left: 0
}).top - p.margins.top), o && (n.position.top = p._convertPositionTo("relative", {
top: u,
left: 0
}).top - p.margins.top), r && (n.position.left = p._convertPositionTo("relative", {
top: 0,
left: a - p.helperProportions.width
}).left - p.margins.left), s && (n.position.left = p._convertPositionTo("relative", {
top: 0,
left: l
}).left - p.margins.left)), h = i || o || r || s, "outer" !== f.snapMode && (i = Math.abs(c - b) <= g,
o = Math.abs(u - y) <= g, r = Math.abs(a - m) <= g, s = Math.abs(l - v) <= g, i && (n.position.top = p._convertPositionTo("relative", {
top: c,
left: 0
}).top - p.margins.top), o && (n.position.top = p._convertPositionTo("relative", {
top: u - p.helperProportions.height,
left: 0
}).top - p.margins.top), r && (n.position.left = p._convertPositionTo("relative", {
top: 0,
left: a
}).left - p.margins.left), s && (n.position.left = p._convertPositionTo("relative", {
top: 0,
left: l - p.helperProportions.width
}).left - p.margins.left)), !p.snapElements[d].snapping && (i || o || r || s || h) && p.options.snap.snap && p.options.snap.snap.call(p.element, t, e.extend(p._uiHash(), {
snapItem: p.snapElements[d].item
})), p.snapElements[d].snapping = i || o || r || s || h);
}
}), e.ui.plugin.add("draggable", "stack", {
start: function() {
var t, n = this.data("ui-draggable").options, i = e.makeArray(e(n.stack)).sort(function(t, n) {
return (parseInt(e(t).css("zIndex"), 10) || 0) - (parseInt(e(n).css("zIndex"), 10) || 0);
});
i.length && (t = parseInt(e(i[0]).css("zIndex"), 10) || 0, e(i).each(function(n) {
e(this).css("zIndex", t + n);
}), this.css("zIndex", t + i.length));
}
}), e.ui.plugin.add("draggable", "zIndex", {
start: function(t, n) {
var i = e(n.helper), o = e(this).data("ui-draggable").options;
i.css("zIndex") && (o._zIndex = i.css("zIndex")), i.css("zIndex", o.zIndex);
},
stop: function(t, n) {
var i = e(this).data("ui-draggable").options;
i._zIndex && e(n.helper).css("zIndex", i._zIndex);
}
});
}(jQuery), define("jquery-ui-draggable", function() {}), function(e, t) {
var n = "ui-effects-";
e.effects = {
effect: {}
}, function(e, t) {
function n(e, t, n) {
var i = d[t.type] || {};
return null == e ? n || !t.def ? null : t.def : (e = i.floor ? ~~e : parseFloat(e),
isNaN(e) ? t.def : i.mod ? (e + i.mod) % i.mod : 0 > e ? 0 : i.max < e ? i.max : e);
}
function i(t) {
var n = c(), i = n._rgba = [];
return t = t.toLowerCase(), f(l, function(e, o) {
var r, s = o.re.exec(t), a = s && o.parse(s), l = o.space || "rgba";
return a ? (r = n[l](a), n[u[l].cache] = r[u[l].cache], i = n._rgba = r._rgba, !1) : void 0;
}), i.length ? ("0,0,0,0" === i.join() && e.extend(i, r.transparent), n) : r[t];
}
function o(e, t, n) {
return n = (n + 1) % 1, 1 > 6 * n ? e + 6 * (t - e) * n : 1 > 2 * n ? t : 2 > 3 * n ? e + 6 * (t - e) * (2 / 3 - n) : e;
}
var r, s = "backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor", a = /^([\-+])=\s*(\d+\.?\d*)/, l = [ {
re: /rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,
parse: function(e) {
return [ e[1], e[2], e[3], e[4] ];
}
}, {
re: /rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,
parse: function(e) {
return [ 2.55 * e[1], 2.55 * e[2], 2.55 * e[3], e[4] ];
}
}, {
re: /#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/,
parse: function(e) {
return [ parseInt(e[1], 16), parseInt(e[2], 16), parseInt(e[3], 16) ];
}
}, {
re: /#([a-f0-9])([a-f0-9])([a-f0-9])/,
parse: function(e) {
return [ parseInt(e[1] + e[1], 16), parseInt(e[2] + e[2], 16), parseInt(e[3] + e[3], 16) ];
}
}, {
re: /hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,
space: "hsla",
parse: function(e) {
return [ e[1], e[2] / 100, e[3] / 100, e[4] ];
}
} ], c = e.Color = function(t, n, i, o) {
return new e.Color.fn.parse(t, n, i, o);
}, u = {
rgba: {
props: {
red: {
idx: 0,
type: "byte"
},
green: {
idx: 1,
type: "byte"
},
blue: {
idx: 2,
type: "byte"
}
}
},
hsla: {
props: {
hue: {
idx: 0,
type: "degrees"
},
saturation: {
idx: 1,
type: "percent"
},
lightness: {
idx: 2,
type: "percent"
}
}
}
}, d = {
"byte": {
floor: !0,
max: 255
},
percent: {
max: 1
},
degrees: {
mod: 360,
floor: !0
}
}, h = c.support = {}, p = e("<p>")[0], f = e.each;
p.style.cssText = "background-color:rgba(1,1,1,.5)", h.rgba = p.style.backgroundColor.indexOf("rgba") > -1,
f(u, function(e, t) {
t.cache = "_" + e, t.props.alpha = {
idx: 3,
type: "percent",
def: 1
};
}), c.fn = e.extend(c.prototype, {
parse: function(o, s, a, l) {
if (o === t) return this._rgba = [ null, null, null, null ], this;
(o.jquery || o.nodeType) && (o = e(o).css(s), s = t);
var d = this, h = e.type(o), p = this._rgba = [];
return s !== t && (o = [ o, s, a, l ], h = "array"), "string" === h ? this.parse(i(o) || r._default) : "array" === h ? (f(u.rgba.props, function(e, t) {
p[t.idx] = n(o[t.idx], t);
}), this) : "object" === h ? (o instanceof c ? f(u, function(e, t) {
o[t.cache] && (d[t.cache] = o[t.cache].slice());
}) : f(u, function(t, i) {
var r = i.cache;
f(i.props, function(e, t) {
if (!d[r] && i.to) {
if ("alpha" === e || null == o[e]) return;
d[r] = i.to(d._rgba);
}
d[r][t.idx] = n(o[e], t, !0);
}), d[r] && e.inArray(null, d[r].slice(0, 3)) < 0 && (d[r][3] = 1, i.from && (d._rgba = i.from(d[r])));
}), this) : void 0;
},
is: function(e) {
var t = c(e), n = !0, i = this;
return f(u, function(e, o) {
var r, s = t[o.cache];
return s && (r = i[o.cache] || o.to && o.to(i._rgba) || [], f(o.props, function(e, t) {
return null != s[t.idx] ? n = s[t.idx] === r[t.idx] : void 0;
})), n;
}), n;
},
_space: function() {
var e = [], t = this;
return f(u, function(n, i) {
t[i.cache] && e.push(n);
}), e.pop();
},
transition: function(e, t) {
var i = c(e), o = i._space(), r = u[o], s = 0 === this.alpha() ? c("transparent") : this, a = s[r.cache] || r.to(s._rgba), l = a.slice();
return i = i[r.cache], f(r.props, function(e, o) {
var r = o.idx, s = a[r], c = i[r], u = d[o.type] || {};
null !== c && (null === s ? l[r] = c : (u.mod && (c - s > u.mod / 2 ? s += u.mod : s - c > u.mod / 2 && (s -= u.mod)),
l[r] = n((c - s) * t + s, o)));
}), this[o](l);
},
blend: function(t) {
if (1 === this._rgba[3]) return this;
var n = this._rgba.slice(), i = n.pop(), o = c(t)._rgba;
return c(e.map(n, function(e, t) {
return (1 - i) * o[t] + i * e;
}));
},
toRgbaString: function() {
var t = "rgba(", n = e.map(this._rgba, function(e, t) {
return null == e ? t > 2 ? 1 : 0 : e;
});
return 1 === n[3] && (n.pop(), t = "rgb("), t + n.join() + ")";
},
toHslaString: function() {
var t = "hsla(", n = e.map(this.hsla(), function(e, t) {
return null == e && (e = t > 2 ? 1 : 0), t && 3 > t && (e = Math.round(100 * e) + "%"),
e;
});
return 1 === n[3] && (n.pop(), t = "hsl("), t + n.join() + ")";
},
toHexString: function(t) {
var n = this._rgba.slice(), i = n.pop();
return t && n.push(~~(255 * i)), "#" + e.map(n, function(e) {
return e = (e || 0).toString(16), 1 === e.length ? "0" + e : e;
}).join("");
},
toString: function() {
return 0 === this._rgba[3] ? "transparent" : this.toRgbaString();
}
}), c.fn.parse.prototype = c.fn, u.hsla.to = function(e) {
if (null == e[0] || null == e[1] || null == e[2]) return [ null, null, null, e[3] ];
var t, n, i = e[0] / 255, o = e[1] / 255, r = e[2] / 255, s = e[3], a = Math.max(i, o, r), l = Math.min(i, o, r), c = a - l, u = a + l, d = .5 * u;
return t = l === a ? 0 : i === a ? 60 * (o - r) / c + 360 : o === a ? 60 * (r - i) / c + 120 : 60 * (i - o) / c + 240,
n = 0 === c ? 0 : .5 >= d ? c / u : c / (2 - u), [ Math.round(t) % 360, n, d, null == s ? 1 : s ];
}, u.hsla.from = function(e) {
if (null == e[0] || null == e[1] || null == e[2]) return [ null, null, null, e[3] ];
var t = e[0] / 360, n = e[1], i = e[2], r = e[3], s = .5 >= i ? i * (1 + n) : i + n - i * n, a = 2 * i - s;
return [ Math.round(255 * o(a, s, t + 1 / 3)), Math.round(255 * o(a, s, t)), Math.round(255 * o(a, s, t - 1 / 3)), r ];
}, f(u, function(i, o) {
var r = o.props, s = o.cache, l = o.to, u = o.from;
c.fn[i] = function(i) {
if (l && !this[s] && (this[s] = l(this._rgba)), i === t) return this[s].slice();
var o, a = e.type(i), d = "array" === a || "object" === a ? i : arguments, h = this[s].slice();
return f(r, function(e, t) {
var i = d["object" === a ? e : t.idx];
null == i && (i = h[t.idx]), h[t.idx] = n(i, t);
}), u ? (o = c(u(h)), o[s] = h, o) : c(h);
}, f(r, function(t, n) {
c.fn[t] || (c.fn[t] = function(o) {
var r, s = e.type(o), l = "alpha" === t ? this._hsla ? "hsla" : "rgba" : i, c = this[l](), u = c[n.idx];
return "undefined" === s ? u : ("function" === s && (o = o.call(this, u), s = e.type(o)),
null == o && n.empty ? this : ("string" === s && (r = a.exec(o), r && (o = u + parseFloat(r[2]) * ("+" === r[1] ? 1 : -1))),
c[n.idx] = o, this[l](c)));
});
});
}), c.hook = function(t) {
var n = t.split(" ");
f(n, function(t, n) {
e.cssHooks[n] = {
set: function(t, o) {
var r, s, a = "";
if ("transparent" !== o && ("string" !== e.type(o) || (r = i(o)))) {
if (o = c(r || o), !h.rgba && 1 !== o._rgba[3]) {
for (s = "backgroundColor" === n ? t.parentNode : t; ("" === a || "transparent" === a) && s && s.style; ) try {
a = e.css(s, "backgroundColor"), s = s.parentNode;
} catch (l) {}
o = o.blend(a && "transparent" !== a ? a : "_default");
}
o = o.toRgbaString();
}
try {
t.style[n] = o;
} catch (l) {}
}
}, e.fx.step[n] = function(t) {
t.colorInit || (t.start = c(t.elem, n), t.end = c(t.end), t.colorInit = !0), e.cssHooks[n].set(t.elem, t.start.transition(t.end, t.pos));
};
});
}, c.hook(s), e.cssHooks.borderColor = {
expand: function(e) {
var t = {};
return f([ "Top", "Right", "Bottom", "Left" ], function(n, i) {
t["border" + i + "Color"] = e;
}), t;
}
}, r = e.Color.names = {
aqua: "#00ffff",
black: "#000000",
blue: "#0000ff",
fuchsia: "#ff00ff",
gray: "#808080",
green: "#008000",
lime: "#00ff00",
maroon: "#800000",
navy: "#000080",
olive: "#808000",
purple: "#800080",
red: "#ff0000",
silver: "#c0c0c0",
teal: "#008080",
white: "#ffffff",
yellow: "#ffff00",
transparent: [ null, null, null, 0 ],
_default: "#ffffff"
};
}(jQuery), function() {
function n(t) {
var n, i, o = t.ownerDocument.defaultView ? t.ownerDocument.defaultView.getComputedStyle(t, null) : t.currentStyle, r = {};
if (o && o.length && o[0] && o[o[0]]) for (i = o.length; i--; ) n = o[i], "string" == typeof o[n] && (r[e.camelCase(n)] = o[n]); else for (n in o) "string" == typeof o[n] && (r[n] = o[n]);
return r;
}
function i(t, n) {
var i, o, s = {};
for (i in n) o = n[i], t[i] !== o && (r[i] || (e.fx.step[i] || !isNaN(parseFloat(o))) && (s[i] = o));
return s;
}
var o = [ "add", "remove", "toggle" ], r = {
border: 1,
borderBottom: 1,
borderColor: 1,
borderLeft: 1,
borderRight: 1,
borderTop: 1,
borderWidth: 1,
margin: 1,
padding: 1
};
e.each([ "borderLeftStyle", "borderRightStyle", "borderBottomStyle", "borderTopStyle" ], function(t, n) {
e.fx.step[n] = function(e) {
("none" !== e.end && !e.setAttr || 1 === e.pos && !e.setAttr) && (jQuery.style(e.elem, n, e.end),
e.setAttr = !0);
};
}), e.fn.addBack || (e.fn.addBack = function(e) {
return this.add(null == e ? this.prevObject : this.prevObject.filter(e));
}), e.effects.animateClass = function(t, r, s, a) {
var l = e.speed(r, s, a);
return this.queue(function() {
var r, s = e(this), a = s.attr("class") || "", c = l.children ? s.find("*").addBack() : s;
c = c.map(function() {
var t = e(this);
return {
el: t,
start: n(this)
};
}), r = function() {
e.each(o, function(e, n) {
t[n] && s[n + "Class"](t[n]);
});
}, r(), c = c.map(function() {
return this.end = n(this.el[0]), this.diff = i(this.start, this.end), this;
}), s.attr("class", a), c = c.map(function() {
var t = this, n = e.Deferred(), i = e.extend({}, l, {
queue: !1,
complete: function() {
n.resolve(t);
}
});
return this.el.animate(this.diff, i), n.promise();
}), e.when.apply(e, c.get()).done(function() {
r(), e.each(arguments, function() {
var t = this.el;
e.each(this.diff, function(e) {
t.css(e, "");
});
}), l.complete.call(s[0]);
});
});
}, e.fn.extend({
addClass: function(t) {
return function(n, i, o, r) {
return i ? e.effects.animateClass.call(this, {
add: n
}, i, o, r) : t.apply(this, arguments);
};
}(e.fn.addClass),
removeClass: function(t) {
return function(n, i, o, r) {
return arguments.length > 1 ? e.effects.animateClass.call(this, {
remove: n
}, i, o, r) : t.apply(this, arguments);
};
}(e.fn.removeClass),
toggleClass: function(n) {
return function(i, o, r, s, a) {
return "boolean" == typeof o || o === t ? r ? e.effects.animateClass.call(this, o ? {
add: i
} : {
remove: i
}, r, s, a) : n.apply(this, arguments) : e.effects.animateClass.call(this, {
toggle: i
}, o, r, s);
};
}(e.fn.toggleClass),
switchClass: function(t, n, i, o, r) {
return e.effects.animateClass.call(this, {
add: n,
remove: t
}, i, o, r);
}
});
}(), function() {
function i(t, n, i, o) {
return e.isPlainObject(t) && (n = t, t = t.effect), t = {
effect: t
}, null == n && (n = {}), e.isFunction(n) && (o = n, i = null, n = {}), ("number" == typeof n || e.fx.speeds[n]) && (o = i,
i = n, n = {}), e.isFunction(i) && (o = i, i = null), n && e.extend(t, n), i = i || n.duration,
t.duration = e.fx.off ? 0 : "number" == typeof i ? i : i in e.fx.speeds ? e.fx.speeds[i] : e.fx.speeds._default,
t.complete = o || n.complete, t;
}
function o(t) {
return !t || "number" == typeof t || e.fx.speeds[t] ? !0 : "string" != typeof t || e.effects.effect[t] ? e.isFunction(t) ? !0 : "object" != typeof t || t.effect ? !1 : !0 : !0;
}
e.extend(e.effects, {
version: "1.10.3",
save: function(e, t) {
for (var i = 0; i < t.length; i++) null !== t[i] && e.data(n + t[i], e[0].style[t[i]]);
},
restore: function(e, i) {
var o, r;
for (r = 0; r < i.length; r++) null !== i[r] && (o = e.data(n + i[r]), o === t && (o = ""),
e.css(i[r], o));
},
setMode: function(e, t) {
return "toggle" === t && (t = e.is(":hidden") ? "show" : "hide"), t;
},
getBaseline: function(e, t) {
var n, i;
switch (e[0]) {
case "top":
n = 0;
break;
case "middle":
n = .5;
break;
case "bottom":
n = 1;
break;
default:
n = e[0] / t.height;
}
switch (e[1]) {
case "left":
i = 0;
break;
case "center":
i = .5;
break;
case "right":
i = 1;
break;
default:
i = e[1] / t.width;
}
return {
x: i,
y: n
};
},
createWrapper: function(t) {
if (t.parent().is(".ui-effects-wrapper")) return t.parent();
var n = {
width: t.outerWidth(!0),
height: t.outerHeight(!0),
"float": t.css("float")
}, i = e("<div></div>").addClass("ui-effects-wrapper").css({
fontSize: "100%",
background: "transparent",
border: "none",
margin: 0,
padding: 0
}), o = {
width: t.width(),
height: t.height()
}, r = document.activeElement;
try {
r.id;
} catch (s) {
r = document.body;
}
return t.wrap(i), (t[0] === r || e.contains(t[0], r)) && e(r).focus(), i = t.parent(),
"static" === t.css("position") ? (i.css({
position: "relative"
}), t.css({
position: "relative"
})) : (e.extend(n, {
position: t.css("position"),
zIndex: t.css("z-index")
}), e.each([ "top", "left", "bottom", "right" ], function(e, i) {
n[i] = t.css(i), isNaN(parseInt(n[i], 10)) && (n[i] = "auto");
}), t.css({
position: "relative",
top: 0,
left: 0,
right: "auto",
bottom: "auto"
})), t.css(o), i.css(n).show();
},
removeWrapper: function(t) {
var n = document.activeElement;
return t.parent().is(".ui-effects-wrapper") && (t.parent().replaceWith(t), (t[0] === n || e.contains(t[0], n)) && e(n).focus()),
t;
},
setTransition: function(t, n, i, o) {
return o = o || {}, e.each(n, function(e, n) {
var r = t.cssUnit(n);
r[0] > 0 && (o[n] = r[0] * i + r[1]);
}), o;
}
}), e.fn.extend({
effect: function() {
function t(t) {
function i() {
e.isFunction(r) && r.call(o[0]), e.isFunction(t) && t();
}
var o = e(this), r = n.complete, a = n.mode;
(o.is(":hidden") ? "hide" === a : "show" === a) ? (o[a](), i()) : s.call(o[0], n, i);
}
var n = i.apply(this, arguments), o = n.mode, r = n.queue, s = e.effects.effect[n.effect];
return e.fx.off || !s ? o ? this[o](n.duration, n.complete) : this.each(function() {
n.complete && n.complete.call(this);
}) : r === !1 ? this.each(t) : this.queue(r || "fx", t);
},
show: function(e) {
return function(t) {
if (o(t)) return e.apply(this, arguments);
var n = i.apply(this, arguments);
return n.mode = "show", this.effect.call(this, n);
};
}(e.fn.show),
hide: function(e) {
return function(t) {
if (o(t)) return e.apply(this, arguments);
var n = i.apply(this, arguments);
return n.mode = "hide", this.effect.call(this, n);
};
}(e.fn.hide),
toggle: function(e) {
return function(t) {
if (o(t) || "boolean" == typeof t) return e.apply(this, arguments);
var n = i.apply(this, arguments);
return n.mode = "toggle", this.effect.call(this, n);
};
}(e.fn.toggle),
cssUnit: function(t) {
var n = this.css(t), i = [];
return e.each([ "em", "px", "%", "pt" ], function(e, t) {
n.indexOf(t) > 0 && (i = [ parseFloat(n), t ]);
}), i;
}
});
}(), function() {
var t = {};
e.each([ "Quad", "Cubic", "Quart", "Quint", "Expo" ], function(e, n) {
t[n] = function(t) {
return Math.pow(t, e + 2);
};
}), e.extend(t, {
Sine: function(e) {
return 1 - Math.cos(e * Math.PI / 2);
},
Circ: function(e) {
return 1 - Math.sqrt(1 - e * e);
},
Elastic: function(e) {
return 0 === e || 1 === e ? e : -Math.pow(2, 8 * (e - 1)) * Math.sin((80 * (e - 1) - 7.5) * Math.PI / 15);
},
Back: function(e) {
return e * e * (3 * e - 2);
},
Bounce: function(e) {
for (var t, n = 4; e < ((t = Math.pow(2, --n)) - 1) / 11; ) ;
return 1 / Math.pow(4, 3 - n) - 7.5625 * Math.pow((3 * t - 2) / 22 - e, 2);
}
}), e.each(t, function(t, n) {
e.easing["easeIn" + t] = n, e.easing["easeOut" + t] = function(e) {
return 1 - n(1 - e);
}, e.easing["easeInOut" + t] = function(e) {
return .5 > e ? n(2 * e) / 2 : 1 - n(-2 * e + 2) / 2;
};
});
}();
}(jQuery), define("jquery-ui-effect", function() {}), function(e) {
e.effects.effect.slide = function(t, n) {
var i, o = e(this), r = [ "position", "top", "bottom", "left", "right", "width", "height" ], s = e.effects.setMode(o, t.mode || "show"), a = "show" === s, l = t.direction || "left", c = "up" === l || "down" === l ? "top" : "left", u = "up" === l || "left" === l, d = {};
e.effects.save(o, r), o.show(), i = t.distance || o["top" === c ? "outerHeight" : "outerWidth"](!0),
e.effects.createWrapper(o).css({
overflow: "hidden"
}), a && o.css(c, u ? isNaN(i) ? "-" + i : -i : i), d[c] = (a ? u ? "+=" : "-=" : u ? "-=" : "+=") + i,
o.animate(d, {
queue: !1,
duration: t.duration,
easing: t.easing,
complete: function() {
"hide" === s && o.hide(), e.effects.restore(o, r), e.effects.removeWrapper(o), n();
}
});
};
}(jQuery), define("jquery-ui-effect-slide", function() {}), function($) {
var min = Math.min, max = Math.max, round = Math.floor, isStr = function(e) {
return "string" === $.type(e);
}, runPluginCallbacks = function(Instance, a_fn) {
function g(e) {
return e;
}
if ($.isArray(a_fn)) for (var i = 0, c = a_fn.length; c > i; i++) {
var fn = a_fn[i];
try {
isStr(fn) && (fn = eval(fn)), $.isFunction(fn) && g(fn)(Instance);
} catch (ex) {}
}
};
$.layout = {
version: "1.3.rc30.79",
revision: .033007,
browser: {},
effects: {
slide: {
all: {
duration: "fast"
},
north: {
direction: "up"
},
south: {
direction: "down"
},
east: {
direction: "right"
},
west: {
direction: "left"
}
},
drop: {
all: {
duration: "slow"
},
north: {
direction: "up"
},
south: {
direction: "down"
},
east: {
direction: "right"
},
west: {
direction: "left"
}
},
scale: {
all: {
duration: "fast"
}
},
blind: {},
clip: {},
explode: {},
fade: {},
fold: {},
puff: {},
size: {
all: {
easing: "swing"
}
}
},
config: {
optionRootKeys: "effects,panes,north,south,west,east,center".split(","),
allPanes: "north,south,west,east,center".split(","),
borderPanes: "north,south,west,east".split(","),
oppositeEdge: {
north: "south",
south: "north",
east: "west",
west: "east"
},
offscreenCSS: {
left: "-99999px",
right: "auto"
},
offscreenReset: "offscreenReset",
hidden: {
visibility: "hidden"
},
visible: {
visibility: "visible"
},
resizers: {
cssReq: {
position: "absolute",
padding: 0,
margin: 0,
fontSize: "1px",
textAlign: "left",
overflow: "hidden"
},
cssDemo: {
background: "#DDD",
border: "none"
}
},
togglers: {
cssReq: {
position: "absolute",
display: "block",
padding: 0,
margin: 0,
overflow: "hidden",
textAlign: "center",
fontSize: "1px",
cursor: "pointer",
zIndex: 1
},
cssDemo: {
background: "#AAA"
}
},
content: {
cssReq: {
position: "relative"
},
cssDemo: {
overflow: "auto",
padding: "10px"
},
cssDemoPane: {
overflow: "hidden",
padding: 0
}
},
panes: {
cssReq: {
position: "absolute",
margin: 0
},
cssDemo: {
padding: "10px",
background: "#FFF",
border: "1px solid #BBB",
overflow: "auto"
}
},
north: {
side: "top",
sizeType: "Height",
dir: "horz",
cssReq: {
top: 0,
bottom: "auto",
left: 0,
right: 0,
width: "auto"
}
},
south: {
side: "bottom",
sizeType: "Height",
dir: "horz",
cssReq: {
top: "auto",
bottom: 0,
left: 0,
right: 0,
width: "auto"
}
},
east: {
side: "right",
sizeType: "Width",
dir: "vert",
cssReq: {
left: "auto",
right: 0,
top: "auto",
bottom: "auto",
height: "auto"
}
},
west: {
side: "left",
sizeType: "Width",
dir: "vert",
cssReq: {
left: 0,
right: "auto",
top: "auto",
bottom: "auto",
height: "auto"
}
},
center: {
dir: "center",
cssReq: {
left: "auto",
right: "auto",
top: "auto",
bottom: "auto",
height: "auto",
width: "auto"
}
}
},
callbacks: {},
getParentPaneElem: function(e) {
var t = $(e), n = t.data("layout") || t.data("parentLayout");
if (n) {
var i = n.container;
if (i.data("layoutPane")) return i;
var o = i.closest("." + $.layout.defaults.panes.paneClass);
if (o.data("layoutPane")) return o;
}
return null;
},
getParentPaneInstance: function(e) {
var t = $.layout.getParentPaneElem(e);
return t ? t.data("layoutPane") : null;
},
getParentLayoutInstance: function(e) {
var t = $.layout.getParentPaneElem(e);
return t ? t.data("parentLayout") : null;
},
getEventObject: function(e) {
return "object" == typeof e && e.stopPropagation ? e : null;
},
parsePaneName: function(e) {
var t = $.layout.getEventObject(e), n = e;
return t && (t.stopPropagation(), n = $(this).data("layoutEdge")), n && !/^(west|east|north|south|center)$/.test(n) && ($.layout.msg('LAYOUT ERROR - Invalid pane-name: "' + n + '"'),
n = "error"), n;
},
plugins: {
draggable: !!$.fn.draggable,
effects: {
core: !!$.effects,
slide: $.effects && ($.effects.slide || $.effects.effect && $.effects.effect.slide)
}
},
onCreate: [],
onLoad: [],
onReady: [],
onDestroy: [],
onUnload: [],
afterOpen: [],
afterClose: [],
scrollbarWidth: function() {
return window.scrollbarWidth || $.layout.getScrollbarSize("width");
},
scrollbarHeight: function() {
return window.scrollbarHeight || $.layout.getScrollbarSize("height");
},
getScrollbarSize: function(e) {
var t = $('<div style="position: absolute; top: -10000px; left: -10000px; width: 100px; height: 100px; overflow: scroll;"></div>').appendTo("body"), n = {
width: t.css("width") - t[0].clientWidth,
height: t.height() - t[0].clientHeight
};
return t.remove(), window.scrollbarWidth = n.width, window.scrollbarHeight = n.height,
e.match(/^(width|height)$/) ? n[e] : n;
},
showInvisibly: function(e, t) {
if (e && e.length && (t || "none" === e.css("display"))) {
var n = e[0].style, i = {
display: n.display || "",
visibility: n.visibility || ""
};
return e.css({
display: "block",
visibility: "hidden"
}), i;
}
return {};
},
getElementDimensions: function(e, t) {
var n, i, o, r = {
css: {},
inset: {}
}, s = r.css, a = {
bottom: 0
}, l = $.layout.cssNum, c = e.offset();
return r.offsetLeft = c.left, r.offsetTop = c.top, t || (t = {}), $.each("Left,Right,Top,Bottom".split(","), function(l, c) {
n = s["border" + c] = $.layout.borderWidth(e, c), i = s["padding" + c] = $.layout.cssNum(e, "padding" + c),
o = c.toLowerCase(), r.inset[o] = t[o] >= 0 ? t[o] : i, a[o] = r.inset[o] + n;
}), s.width = e.width(), s.height = e.height(), s.top = l(e, "top", !0), s.bottom = l(e, "bottom", !0),
s.left = l(e, "left", !0), s.right = l(e, "right", !0), r.outerWidth = e.outerWidth(),
r.outerHeight = e.outerHeight(), r.innerWidth = max(0, r.outerWidth - a.left - a.right),
r.innerHeight = max(0, r.outerHeight - a.top - a.bottom), r.layoutWidth = e.innerWidth(),
r.layoutHeight = e.innerHeight(), r;
},
getElementStyles: function(e, t) {
var n, i, o, r, s, a, l = {}, c = e[0].style, u = t.split(","), d = "Top,Bottom,Left,Right".split(","), h = "Color,Style,Width".split(",");
for (r = 0; r < u.length; r++) if (n = u[r], n.match(/(border|padding|margin)$/)) for (s = 0; 4 > s; s++) if (i = d[s],
"border" === n) for (a = 0; 3 > a; a++) o = h[a], l[n + i + o] = c[n + i + o]; else l[n + i] = c[n + i]; else l[n] = c[n];
return l;
},
cssWidth: function(e, t) {
if (0 >= t) return 0;
var n = $.layout.browser.boxModel ? $.support.boxSizing ? e.css("boxSizing") : "content-box" : "border-box", i = $.layout.borderWidth, o = $.layout.cssNum, r = t;
return "border-box" !== n && (r -= i(e, "Left") + i(e, "Right")), "content-box" === n && (r -= o(e, "paddingLeft") + o(e, "paddingRight")),
max(0, r);
},
cssHeight: function(e, t) {
if (0 >= t) return 0;
var n = $.layout.browser.boxModel ? $.support.boxSizing ? e.css("boxSizing") : "content-box" : "border-box", i = $.layout.borderWidth, o = $.layout.cssNum, r = t;
return "border-box" !== n && (r -= i(e, "Top") + i(e, "Bottom")), "content-box" === n && (r -= o(e, "paddingTop") + o(e, "paddingBottom")),
max(0, r);
},
cssNum: function(e, t, n) {
e.jquery || (e = $(e));
var i = $.layout.showInvisibly(e), o = $.css(e[0], t, !0), r = n && "auto" == o ? o : Math.round(parseFloat(o) || 0);
return e.css(i), r;
},
borderWidth: function(e, t) {
e.jquery && (e = e[0]);
var n = "border" + t.substr(0, 1).toUpperCase() + t.substr(1);
return "none" === $.css(e, n + "Style", !0) ? 0 : Math.round(parseFloat($.css(e, n + "Width", !0)) || 0);
},
isMouseOverElem: function(e, t) {
var n = $(t || this), i = n.offset(), o = i.top, r = i.left, s = r + n.outerWidth(), a = o + n.outerHeight(), l = e.pageX, c = e.pageY;
return $.layout.browser.msie && 0 > l && 0 > c || l >= r && s >= l && c >= o && a >= c;
},
msg: function(e, t, n, i) {
function o() {
var e = $.support.fixedPosition ? "fixed" : "absolute", t = $('<div id="layoutLogger" style="position: ' + e + '; top: 5px; z-index: 999999; max-width: 25%; overflow: hidden; border: 1px solid #000; border-radius: 5px; background: #FBFBFB; box-shadow: 0 2px 10px rgba(0,0,0,0.3);">' + '<div style="font-size: 13px; font-weight: bold; padding: 5px 10px; background: #F6F6F6; border-radius: 5px 5px 0 0; cursor: move;">' + '<span style="float: right; padding-left: 7px; cursor: pointer;" title="Remove Console" onclick="$(this).closest(\'#layoutLogger\').remove()">X</span>Layout console.log</div>' + '<ul style="font-size: 13px; font-weight: none; list-style: none; margin: 0; padding: 0 0 2px;"></ul>' + "</div>").appendTo("body");
return t.css("left", $(window).width() - t.outerWidth() - 5), $.ui.draggable && t.draggable({
handle: ":first-child"
}), t;
}
if ($.isPlainObject(e) && window.debugData) {
"string" == typeof t ? (i = n, n = t) : "object" == typeof n && (i = n, n = null);
var r = n || "log( <object> )", s = $.extend({
sort: !1,
returnHTML: !1,
display: !1
}, i);
t === !0 || s.display ? debugData(e, r, s) : window.console && console.log(debugData(e, r, s));
} else if (t) alert(e); else if (window.console) console.log(e); else {
var a = "#layoutLogger", l = $(a);
l.length || (l = o()), l.children("ul").append('<li style="padding: 4px 10px; margin: 0; border-top: 1px solid #CCC;">' + e.replace(/\</g, "&lt;").replace(/\>/g, "&gt;") + "</li>");
}
}
};
var u = navigator.userAgent.toLowerCase(), m = /(chrome)[ \/]([\w.]+)/.exec(u) || /(webkit)[ \/]([\w.]+)/.exec(u) || /(opera)(?:.*version|)[ \/]([\w.]+)/.exec(u) || /(msie) ([\w.]+)/.exec(u) || u.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec(u) || [], b = m[1] || "", v = m[2] || 0, ie = "msie" === b;
$.layout.browser = {
version: v,
safari: "webkit" === b,
webkit: "chrome" === b,
msie: ie,
isIE6: ie && 6 == v,
boxModel: !ie || $.support.boxModel !== !1
}, b && ($.layout.browser[b] = !0), ie && $(function() {
$.layout.browser.boxModel = $.support.boxModel;
}), $.layout.defaults = {
name: "",
containerClass: "ui-layout-container",
inset: null,
scrollToBookmarkOnLoad: !0,
resizeWithWindow: !0,
resizeWithWindowDelay: 200,
resizeWithWindowMaxDelay: 0,
maskPanesEarly: !1,
onresizeall_start: null,
onresizeall_end: null,
onload_start: null,
onload_end: null,
onunload_start: null,
onunload_end: null,
initPanes: !0,
showErrorMessages: !0,
showDebugMessages: !1,
zIndex: null,
zIndexes: {
pane_normal: 0,
content_mask: 1,
resizer_normal: 2,
pane_sliding: 100,
pane_animate: 1e3,
resizer_drag: 1e4
},
errors: {
pane: "pane",
selector: "selector",
addButtonError: "Error Adding Button\nInvalid ",
containerMissing: "UI Layout Initialization Error\nThe specified layout-container does not exist.",
centerPaneMissing: "UI Layout Initialization Error\nThe center-pane element does not exist.\nThe center-pane is a required element.",
noContainerHeight: "UI Layout Initialization Warning\nThe layout-container \"CONTAINER\" has no height.\nTherefore the layout is 0-height and hence 'invisible'!",
callbackError: "UI Layout Callback Error\nThe EVENT callback is not a valid function."
},
panes: {
applyDemoStyles: !1,
closable: !0,
resizable: !0,
slidable: !0,
initClosed: !1,
initHidden: !1,
contentSelector: ".ui-layout-content",
contentIgnoreSelector: ".ui-layout-ignore",
findNestedContent: !1,
paneClass: "ui-layout-pane",
resizerClass: "ui-layout-resizer",
togglerClass: "ui-layout-toggler",
buttonClass: "ui-layout-button",
minSize: 0,
maxSize: 0,
spacing_open: 6,
spacing_closed: 6,
togglerLength_open: 50,
togglerLength_closed: 50,
togglerAlign_open: "center",
togglerAlign_closed: "center",
togglerContent_open: "",
togglerContent_closed: "",
resizerDblClickToggle: !0,
autoResize: !0,
autoReopen: !0,
resizerDragOpacity: 1,
maskContents: !1,
maskObjects: !1,
maskZindex: null,
resizingGrid: !1,
livePaneResizing: !1,
liveContentResizing: !1,
liveResizingTolerance: 1,
sliderCursor: "pointer",
slideTrigger_open: "click",
slideTrigger_close: "mouseleave",
slideDelay_open: 300,
slideDelay_close: 300,
hideTogglerOnSlide: !1,
preventQuickSlideClose: $.layout.browser.webkit,
preventPrematureSlideClose: !1,
tips: {
Open: "Open",
Close: "Close",
Resize: "Resize",
Slide: "Slide Open",
Pin: "Pin",
Unpin: "Un-Pin",
noRoomToOpen: "Not enough room to show this panel.",
minSizeWarning: "Panel has reached its minimum size",
maxSizeWarning: "Panel has reached its maximum size"
},
showOverflowOnHover: !1,
enableCursorHotkey: !0,
customHotkeyModifier: "SHIFT",
fxName: "slide",
fxSpeed: null,
fxSettings: {},
fxOpacityFix: !0,
animatePaneSizing: !1,
children: null,
containerSelector: "",
initChildren: !0,
destroyChildren: !0,
resizeChildren: !0,
triggerEventsOnLoad: !1,
triggerEventsDuringLiveResize: !0,
onshow_start: null,
onshow_end: null,
onhide_start: null,
onhide_end: null,
onopen_start: null,
onopen_end: null,
onclose_start: null,
onclose_end: null,
onresize_start: null,
onresize_end: null,
onsizecontent_start: null,
onsizecontent_end: null,
onswap_start: null,
onswap_end: null,
ondrag_start: null,
ondrag_end: null
},
north: {
paneSelector: ".ui-layout-north",
size: "auto",
resizerCursor: "n-resize",
customHotkey: ""
},
south: {
paneSelector: ".ui-layout-south",
size: "auto",
resizerCursor: "s-resize",
customHotkey: ""
},
east: {
paneSelector: ".ui-layout-east",
size: 200,
resizerCursor: "e-resize",
customHotkey: ""
},
west: {
paneSelector: ".ui-layout-west",
size: 200,
resizerCursor: "w-resize",
customHotkey: ""
},
center: {
paneSelector: ".ui-layout-center",
minWidth: 0,
minHeight: 0
}
}, $.layout.optionsMap = {
layout: "name,instanceKey,stateManagement,effects,inset,zIndexes,errors,zIndex,scrollToBookmarkOnLoad,showErrorMessages,maskPanesEarly,outset,resizeWithWindow,resizeWithWindowDelay,resizeWithWindowMaxDelay,onresizeall,onresizeall_start,onresizeall_end,onload,onload_start,onload_end,onunload,onunload_start,onunload_end".split(","),
center: "paneClass,contentSelector,contentIgnoreSelector,findNestedContent,applyDemoStyles,triggerEventsOnLoad,showOverflowOnHover,maskContents,maskObjects,liveContentResizing,containerSelector,children,initChildren,resizeChildren,destroyChildren,onresize,onresize_start,onresize_end,onsizecontent,onsizecontent_start,onsizecontent_end".split(","),
noDefault: "paneSelector,resizerCursor,customHotkey".split(",")
}, $.layout.transformData = function(e, t) {
var n, i, o, r, s, a, l, c = t ? {
panes: {},
center: {}
} : {};
if ("object" != typeof e) return c;
for (i in e) for (n = c, s = e[i], o = i.split("__"), l = o.length - 1, a = 0; l >= a; a++) r = o[a],
a === l ? n[r] = $.isPlainObject(s) ? $.layout.transformData(s) : s : (n[r] || (n[r] = {}),
n = n[r]);
return c;
}, $.layout.backwardCompatibility = {
map: {
applyDefaultStyles: "applyDemoStyles",
childOptions: "children",
initChildLayout: "initChildren",
destroyChildLayout: "destroyChildren",
resizeChildLayout: "resizeChildren",
resizeNestedLayout: "resizeChildren",
resizeWhileDragging: "livePaneResizing",
resizeContentWhileDragging: "liveContentResizing",
triggerEventsWhileDragging: "triggerEventsDuringLiveResize",
maskIframesOnResize: "maskContents",
useStateCookie: "stateManagement.enabled",
"cookie.autoLoad": "stateManagement.autoLoad",
"cookie.autoSave": "stateManagement.autoSave",
"cookie.keys": "stateManagement.stateKeys",
"cookie.name": "stateManagement.cookie.name",
"cookie.domain": "stateManagement.cookie.domain",
"cookie.path": "stateManagement.cookie.path",
"cookie.expires": "stateManagement.cookie.expires",
"cookie.secure": "stateManagement.cookie.secure",
noRoomToOpenTip: "tips.noRoomToOpen",
togglerTip_open: "tips.Close",
togglerTip_closed: "tips.Open",
resizerTip: "tips.Resize",
sliderTip: "tips.Slide"
},
renameOptions: function(e) {
function t(t, n) {
for (var i, o = t.split("."), r = o.length - 1, s = {
branch: e,
key: o[r]
}, a = 0; r > a; a++) i = o[a], s.branch = void 0 == s.branch[i] ? n ? s.branch[i] = {} : {} : s.branch[i];
return s;
}
var n, i, o, r = $.layout.backwardCompatibility.map;
for (var s in r) n = t(s), o = n.branch[n.key], void 0 !== o && (i = t(r[s], !0),
i.branch[i.key] = o, delete n.branch[n.key]);
},
renameAllOptions: function(e) {
var t = $.layout.backwardCompatibility.renameOptions;
return t(e), e.defaults && ("object" != typeof e.panes && (e.panes = {}), $.extend(!0, e.panes, e.defaults),
delete e.defaults), e.panes && t(e.panes), $.each($.layout.config.allPanes, function(n, i) {
e[i] && t(e[i]);
}), e;
}
}, $.fn.layout = function(opts) {
function keyDown(e) {
if (!e) return !0;
var t = e.keyCode;
if (33 > t) return !0;
var n, i, o, r, s = {
38: "north",
40: "south",
37: "west",
39: "east"
}, a = (e.altKey, e.shiftKey), l = e.ctrlKey, c = l && t >= 37 && 40 >= t;
return c && options[s[t]].enableCursorHotkey ? r = s[t] : (l || a) && $.each(_c.borderPanes, function(e, s) {
return n = options[s], i = n.customHotkey, o = n.customHotkeyModifier, (a && "SHIFT" == o || l && "CTRL" == o || l && a) && i && t === (isNaN(i) || 9 >= i ? i.toUpperCase().charCodeAt(0) : i) ? (r = s,
!1) : void 0;
}), r && $Ps[r] && options[r].closable && !state[r].isHidden ? (toggle(r), e.stopPropagation(),
e.returnValue = !1, !1) : !0;
}
function allowOverflow(e) {
if (isInitialized()) {
this && this.tagName && (e = this);
var t;
if (isStr(e) ? t = $Ps[e] : $(e).data("layoutRole") ? t = $(e) : $(e).parents().each(function() {
return $(this).data("layoutRole") ? (t = $(this), !1) : void 0;
}), t && t.length) {
var n = t.data("layoutEdge"), i = state[n];
if (i.cssSaved && resetOverflow(n), i.isSliding || i.isResizing || i.isClosed) return i.cssSaved = !1,
void 0;
var o = {
zIndex: options.zIndexes.resizer_normal + 1
}, r = {}, s = t.css("overflow"), a = t.css("overflowX"), l = t.css("overflowY");
"visible" != s && (r.overflow = s, o.overflow = "visible"), a && !a.match(/(visible|auto)/) && (r.overflowX = a,
o.overflowX = "visible"), l && !l.match(/(visible|auto)/) && (r.overflowY = a, o.overflowY = "visible"),
i.cssSaved = r, t.css(o), $.each(_c.allPanes, function(e, t) {
t != n && resetOverflow(t);
});
}
}
}
function resetOverflow(e) {
if (isInitialized()) {
this && this.tagName && (e = this);
var t;
if (isStr(e) ? t = $Ps[e] : $(e).data("layoutRole") ? t = $(e) : $(e).parents().each(function() {
return $(this).data("layoutRole") ? (t = $(this), !1) : void 0;
}), t && t.length) {
var n = t.data("layoutEdge"), i = state[n], o = i.cssSaved || {};
i.isSliding || i.isResizing || t.css("zIndex", options.zIndexes.pane_normal), t.css(o),
i.cssSaved = !1;
}
}
}
var browser = $.layout.browser, _c = $.layout.config, cssW = $.layout.cssWidth, cssH = $.layout.cssHeight, elDims = $.layout.getElementDimensions, styles = $.layout.getElementStyles, evtObj = $.layout.getEventObject, evtPane = $.layout.parsePaneName, options = $.extend(!0, {}, $.layout.defaults), effects = options.effects = $.extend(!0, {}, $.layout.effects), state = {
id: "layout" + $.now(),
initialized: !1,
paneResizing: !1,
panesSliding: {},
container: {
innerWidth: 0,
innerHeight: 0,
outerWidth: 0,
outerHeight: 0,
layoutWidth: 0,
layoutHeight: 0
},
north: {
childIdx: 0
},
south: {
childIdx: 0
},
east: {
childIdx: 0
},
west: {
childIdx: 0
},
center: {
childIdx: 0
}
}, children = {
north: null,
south: null,
east: null,
west: null,
center: null
}, timer = {
data: {},
set: function(e, t, n) {
timer.clear(e), timer.data[e] = setTimeout(t, n);
},
clear: function(e) {
var t = timer.data;
t[e] && (clearTimeout(t[e]), delete t[e]);
}
}, _log = function(e, t, n) {
var i = options;
return (i.showErrorMessages && !n || n && i.showDebugMessages) && $.layout.msg(i.name + " / " + e, t !== !1),
!1;
}, _runCallbacks = function(evtName, pane, skipBoundEvents) {
function g(e) {
return e;
}
var hasPane = pane && isStr(pane), s = hasPane ? state[pane] : state, o = hasPane ? options[pane] : options, lName = options.name, lng = evtName + (evtName.match(/_/) ? "" : "_end"), shrt = lng.match(/_end$/) ? lng.substr(0, lng.length - 4) : "", fn = o[lng] || o[shrt], retVal = "NC", args = [], $P;
if (hasPane || "boolean" !== $.type(pane) || (skipBoundEvents = pane, pane = ""),
fn) try {
isStr(fn) && (fn.match(/,/) ? (args = fn.split(","), fn = eval(args[0])) : fn = eval(fn)),
$.isFunction(fn) && (retVal = args.length ? g(fn)(args[1]) : hasPane ? g(fn)(pane, $Ps[pane], s, o, lName) : g(fn)(Instance, s, o, lName));
} catch (ex) {
_log(options.errors.callbackError.replace(/EVENT/, $.trim((pane || "") + " " + lng)), !1),
"string" === $.type(ex) && string.length && _log("Exception: " + ex, !1);
}
return skipBoundEvents || retVal === !1 || (hasPane ? ($P = $Ps[pane], o = options[pane],
s = state[pane], $P.triggerHandler("layoutpane" + lng, [ pane, $P, s, o, lName ]),
shrt && $P.triggerHandler("layoutpane" + shrt, [ pane, $P, s, o, lName ])) : ($N.triggerHandler("layout" + lng, [ Instance, s, o, lName ]),
shrt && $N.triggerHandler("layout" + shrt, [ Instance, s, o, lName ]))), hasPane && "onresize_end" === evtName && resizeChildren(pane + "", !0),
retVal;
}, _fixIframe = function(e) {
if (!browser.mozilla) {
var t = $Ps[e];
"IFRAME" === state[e].tagName ? t.css(_c.hidden).css(_c.visible) : t.find("IFRAME").css(_c.hidden).css(_c.visible);
}
}, cssSize = function(e, t) {
var n = "horz" == _c[e].dir ? cssH : cssW;
return n($Ps[e], t);
}, cssMinDims = function(e) {
var t = $Ps[e], n = _c[e].dir, i = {
minWidth: 1001 - cssW(t, 1e3),
minHeight: 1001 - cssH(t, 1e3)
};
return "horz" === n && (i.minSize = i.minHeight), "vert" === n && (i.minSize = i.minWidth),
i;
}, setOuterWidth = function(e, t, n) {
var i, o = e;
isStr(e) ? o = $Ps[e] : e.jquery || (o = $(e)), i = cssW(o, t), o.css({
width: i
}), i > 0 ? n && o.data("autoHidden") && o.innerHeight() > 0 && (o.show().data("autoHidden", !1),
browser.mozilla || o.css(_c.hidden).css(_c.visible)) : n && !o.data("autoHidden") && o.hide().data("autoHidden", !0);
}, setOuterHeight = function(e, t, n) {
var i, o = e;
isStr(e) ? o = $Ps[e] : e.jquery || (o = $(e)), i = cssH(o, t), o.css({
height: i,
visibility: "visible"
}), i > 0 && o.innerWidth() > 0 ? n && o.data("autoHidden") && (o.show().data("autoHidden", !1),
browser.mozilla || o.css(_c.hidden).css(_c.visible)) : n && !o.data("autoHidden") && o.hide().data("autoHidden", !0);
}, _parseSize = function(e, t, n) {
if (n || (n = _c[e].dir), isStr(t) && t.match(/%/) && (t = "100%" === t ? -1 : parseInt(t, 10) / 100),
0 === t) return 0;
if (t >= 1) return parseInt(t, 10);
var i = options, o = 0;
if ("horz" == n ? o = sC.innerHeight - ($Ps.north ? i.north.spacing_open : 0) - ($Ps.south ? i.south.spacing_open : 0) : "vert" == n && (o = sC.innerWidth - ($Ps.west ? i.west.spacing_open : 0) - ($Ps.east ? i.east.spacing_open : 0)),
-1 === t) return o;
if (t > 0) return round(o * t);
if ("center" == e) return 0;
var r = "horz" === n ? "height" : "width", s = $Ps[e], a = "height" === r ? $Cs[e] : !1, l = $.layout.showInvisibly(s), c = s.css(r), u = a ? a.css(r) : 0;
return s.css(r, "auto"), a && a.css(r, "auto"), t = "height" === r ? s.outerHeight() : s.outerWidth(),
s.css(r, c).css(l), a && a.css(r, u), t;
}, getPaneSize = function(e, t) {
var n = $Ps[e], i = options[e], o = state[e], r = t ? i.spacing_open : 0, s = t ? i.spacing_closed : 0;
return !n || o.isHidden ? 0 : o.isClosed || o.isSliding && t ? s : "horz" === _c[e].dir ? n.outerHeight() + r : n.outerWidth() + r;
}, setSizeLimits = function(e, t) {
if (isInitialized()) {
var n = options[e], i = state[e], o = _c[e], r = o.dir, s = (o.sizeType.toLowerCase(),
void 0 != t ? t : i.isSliding), a = ($Ps[e], n.spacing_open), l = _c.oppositeEdge[e], c = state[l], u = $Ps[l], d = !u || c.isVisible === !1 || c.isSliding ? 0 : "horz" == r ? u.outerHeight() : u.outerWidth(), h = (!u || c.isHidden ? 0 : options[l][c.isClosed !== !1 ? "spacing_closed" : "spacing_open"]) || 0, p = "horz" == r ? sC.innerHeight : sC.innerWidth, f = cssMinDims("center"), g = "horz" == r ? max(options.center.minHeight, f.minHeight) : max(options.center.minWidth, f.minWidth), m = p - a - (s ? 0 : _parseSize("center", g, r) + d + h), v = i.minSize = max(_parseSize(e, n.minSize), cssMinDims(e).minSize), b = i.maxSize = min(n.maxSize ? _parseSize(e, n.maxSize) : 1e5, m), y = i.resizerPosition = {}, w = sC.inset.top, C = sC.inset.left, x = sC.innerWidth, E = sC.innerHeight, S = n.spacing_open;
switch (e) {
case "north":
y.min = w + v, y.max = w + b;
break;
case "west":
y.min = C + v, y.max = C + b;
break;
case "south":
y.min = w + E - b - S, y.max = w + E - v - S;
break;
case "east":
y.min = C + x - b - S, y.max = C + x - v - S;
}
}
}, calcNewCenterPaneDims = function() {
var e = {
top: getPaneSize("north", !0),
bottom: getPaneSize("south", !0),
left: getPaneSize("west", !0),
right: getPaneSize("east", !0),
width: 0,
height: 0
};
return e.width = sC.innerWidth - e.left - e.right, e.height = sC.innerHeight - e.bottom - e.top,
e.top += sC.inset.top, e.bottom += sC.inset.bottom, e.left += sC.inset.left, e.right += sC.inset.right,
e;
}, getHoverClasses = function(e, t) {
var n = $(e), i = n.data("layoutRole"), o = n.data("layoutEdge"), r = options[o], s = r[i + "Class"], a = "-" + o, l = "-open", c = "-closed", u = "-sliding", d = "-hover ", h = n.hasClass(s + c) ? c : l, p = h === c ? l : c, f = s + d + (s + a + d) + (s + h + d) + (s + a + h + d);
return t && (f += s + p + d + (s + a + p + d)), "resizer" == i && n.hasClass(s + u) && (f += s + u + d + (s + a + u + d)),
$.trim(f);
}, addHover = function(e, t) {
var n = $(t || this);
e && "toggler" === n.data("layoutRole") && e.stopPropagation(), n.addClass(getHoverClasses(n));
}, removeHover = function(e, t) {
var n = $(t || this);
n.removeClass(getHoverClasses(n, !0));
}, onResizerEnter = function() {
var e = $(this).data("layoutEdge"), t = state[e];
t.isClosed || t.isResizing || state.paneResizing || ($.fn.disableSelection && $("body").disableSelection(),
options.maskPanesEarly && showMasks(e, {
resizing: !0
}));
}, onResizerLeave = function(e, t) {
var n = t || this, i = $(n).data("layoutEdge"), o = i + "ResizerLeave";
timer.clear(i + "_openSlider"), timer.clear(o), t ? state.paneResizing || ($.fn.enableSelection && $("body").enableSelection(),
options.maskPanesEarly && hideMasks()) : timer.set(o, function() {
onResizerLeave(e, n);
}, 200);
}, _create = function() {
initOptions();
var e = options, t = state;
return t.creatingLayout = !0, runPluginCallbacks(Instance, $.layout.onCreate), !1 === _runCallbacks("onload_start") ? "cancel" : (_initContainer(),
initHotkeys(), $(window).bind("unload." + sID, unload), runPluginCallbacks(Instance, $.layout.onLoad),
e.initPanes && _initLayoutElements(), delete t.creatingLayout, state.initialized);
}, isInitialized = function() {
return state.initialized || state.creatingLayout ? !0 : _initLayoutElements();
}, _initLayoutElements = function(e) {
var t = options;
if (!$N.is(":visible")) return !e && browser.webkit && "BODY" === $N[0].tagName && setTimeout(function() {
_initLayoutElements(!0);
}, 50), !1;
if (!getPane("center").length) return _log(t.errors.centerPaneMissing);
if (state.creatingLayout = !0, $.extend(sC, elDims($N, t.inset)), initPanes(), t.scrollToBookmarkOnLoad) {
var n = self.location;
n.hash && n.replace(n.hash);
}
return Instance.hasParentLayout ? t.resizeWithWindow = !1 : t.resizeWithWindow && $(window).bind("resize." + sID, windowResize),
delete state.creatingLayout, state.initialized = !0, runPluginCallbacks(Instance, $.layout.onReady),
_runCallbacks("onload_end"), !0;
}, createChildren = function(e, t) {
var n = evtPane.call(this, e), i = $Ps[n];
if (i) {
var o = $Cs[n], r = state[n], s = options[n], a = options.stateManagement || {}, l = t ? s.children = t : s.children;
if ($.isPlainObject(l)) l = [ l ]; else if (!l || !$.isArray(l)) return;
$.each(l, function(e, t) {
if ($.isPlainObject(t)) {
var s = t.containerSelector ? i.find(t.containerSelector) : o || i;
s.each(function() {
var e = $(this), i = e.data("layout");
if (!i) {
if (setInstanceKey({
container: e,
options: t
}, r), a.includeChildren && state.stateData[n]) {
var o = state.stateData[n].children || {}, s = o[t.instanceKey], l = t.stateManagement || (t.stateManagement = {
autoLoad: !0
});
l.autoLoad === !0 && s && (l.autoSave = !1, l.includeChildren = !0, l.autoLoad = $.extend(!0, {}, s));
}
i = e.layout(t), i && refreshChildren(n, i);
}
});
}
});
}
}, setInstanceKey = function(e, t) {
var n = e.container, i = e.options, o = i.stateManagement, r = i.instanceKey || n.data("layoutInstanceKey");
return r || (r = (o && o.cookie ? o.cookie.name : "") || i.name), r = r ? r.replace(/[^\w-]/gi, "_").replace(/_{2,}/g, "_") : "layout" + ++t.childIdx,
i.instanceKey = r, n.data("layoutInstanceKey", r), r;
}, refreshChildren = function(e, t) {
var n, i = $Ps[e], o = children[e], r = state[e];
$.isPlainObject(o) && ($.each(o, function(e, t) {
t.destroyed && delete o[e];
}), $.isEmptyObject(o) && (o = children[e] = null)), t || o || (t = i.data("layout")),
t && (t.hasParentLayout = !0, n = t.options, setInstanceKey(t, r), o || (o = children[e] = {}),
o[n.instanceKey] = t.container.data("layout")), Instance[e].children = children[e],
t || createChildren(e);
}, windowResize = function() {
var e = options, t = Number(e.resizeWithWindowDelay);
10 > t && (t = 100), timer.clear("winResize"), timer.set("winResize", function() {
timer.clear("winResize"), timer.clear("winResizeRepeater");
var t = elDims($N, e.inset);
(t.innerWidth !== sC.innerWidth || t.innerHeight !== sC.innerHeight) && resizeAll();
}, t), timer.data.winResizeRepeater || setWindowResizeRepeater();
}, setWindowResizeRepeater = function() {
var e = Number(options.resizeWithWindowMaxDelay);
e > 0 && timer.set("winResizeRepeater", function() {
setWindowResizeRepeater(), resizeAll();
}, e);
}, unload = function() {
_runCallbacks("onunload_start"), runPluginCallbacks(Instance, $.layout.onUnload),
_runCallbacks("onunload_end");
}, _initContainer = function() {
var e, t, n = $N[0], i = $("html"), o = sC.tagName = n.tagName, r = sC.id = n.id, s = sC.className = n.className, a = options, l = a.name, c = "position,margin,padding,border", u = "layoutCSS", d = {}, h = "hidden", p = $N.data("parentLayout"), f = $N.data("layoutEdge"), g = p && f, m = $.layout.cssNum;
sC.selector = $N.selector.split(".slice")[0], sC.ref = (a.name ? a.name + " layout / " : "") + o + (r ? "#" + r : s ? ".[" + s + "]" : ""),
sC.isBody = "BODY" === o, g || sC.isBody || (e = $N.closest("." + $.layout.defaults.panes.paneClass),
p = e.data("parentLayout"), f = e.data("layoutEdge"), g = p && f), $N.data({
layout: Instance,
layoutContainer: sID
}).addClass(a.containerClass);
var v = {
destroy: "",
initPanes: "",
resizeAll: "resizeAll",
resize: "resizeAll"
};
for (l in v) $N.bind("layout" + l.toLowerCase() + "." + sID, Instance[v[l] || l]);
g && (Instance.hasParentLayout = !0, p.refreshChildren(f, Instance)), $N.data(u) || (sC.isBody ? ($N.data(u, $.extend(styles($N, c), {
height: $N.css("height"),
overflow: $N.css("overflow"),
overflowX: $N.css("overflowX"),
overflowY: $N.css("overflowY")
})), i.data(u, $.extend(styles(i, "padding"), {
height: "auto",
overflow: i.css("overflow"),
overflowX: i.css("overflowX"),
overflowY: i.css("overflowY")
}))) : $N.data(u, styles($N, c + ",top,bottom,left,right,width,height,overflow,overflowX,overflowY")));
try {
if (d = {
overflow: h,
overflowX: h,
overflowY: h
}, $N.css(d), a.inset && !$.isPlainObject(a.inset) && (t = parseInt(a.inset, 10) || 0,
a.inset = {
top: t,
bottom: t,
left: t,
right: t
}), sC.isBody) a.outset ? $.isPlainObject(a.outset) || (t = parseInt(a.outset, 10) || 0,
a.outset = {
top: t,
bottom: t,
left: t,
right: t
}) : a.outset = {
top: m(i, "paddingTop"),
bottom: m(i, "paddingBottom"),
left: m(i, "paddingLeft"),
right: m(i, "paddingRight")
}, i.css(d).css({
height: "100%",
border: "none",
padding: 0,
margin: 0
}), browser.isIE6 ? ($N.css({
width: "100%",
height: "100%",
border: "none",
padding: 0,
margin: 0,
position: "relative"
}), a.inset || (a.inset = elDims($N).inset)) : ($N.css({
width: "auto",
height: "auto",
margin: 0,
position: "absolute"
}), $N.css(a.outset)), $.extend(sC, elDims($N, a.inset)); else {
var b = $N.css("position");
b && b.match(/(fixed|absolute|relative)/) || $N.css("position", "relative"), $N.is(":visible") && ($.extend(sC, elDims($N, a.inset)),
sC.innerHeight < 1 && _log(a.errors.noContainerHeight.replace(/CONTAINER/, sC.ref)));
}
m($N, "minWidth") && $N.parent().css("overflowX", "auto"), m($N, "minHeight") && $N.parent().css("overflowY", "auto");
} catch (y) {}
}, initHotkeys = function(e) {
e = e ? e.split(",") : _c.borderPanes, $.each(e, function(e, t) {
var n = options[t];
return n.enableCursorHotkey || n.customHotkey ? ($(document).bind("keydown." + sID, keyDown),
!1) : void 0;
});
}, initOptions = function() {
function e(e) {
var t = options[e], n = options.panes;
t.fxSettings || (t.fxSettings = {}), n.fxSettings || (n.fxSettings = {}), $.each([ "_open", "_close", "_size" ], function(i, o) {
var r = "fxName" + o, s = "fxSpeed" + o, a = "fxSettings" + o, l = t[r] = t[r] || n[r] || t.fxName || n.fxName || "none", c = $.effects && ($.effects[l] || $.effects.effect && $.effects.effect[l]);
"none" !== l && options.effects[l] && c || (l = t[r] = "none");
var u = options.effects[l] || {}, d = u.all || null, h = u[e] || null;
t[s] = t[s] || n[s] || t.fxSpeed || n.fxSpeed || null, t[a] = $.extend(!0, {}, d, h, n.fxSettings, t.fxSettings, n[a], t[a]);
}), delete t.fxName, delete t.fxSpeed, delete t.fxSettings;
}
var t, n, i, o, r, s, a;
if (opts = $.layout.transformData(opts, !0), opts = $.layout.backwardCompatibility.renameAllOptions(opts),
!$.isEmptyObject(opts.panes)) {
for (t = $.layout.optionsMap.noDefault, r = 0, s = t.length; s > r; r++) i = t[r],
delete opts.panes[i];
for (t = $.layout.optionsMap.layout, r = 0, s = t.length; s > r; r++) i = t[r],
delete opts.panes[i];
}
t = $.layout.optionsMap.layout;
var l = $.layout.config.optionRootKeys;
for (i in opts) o = opts[i], $.inArray(i, l) < 0 && $.inArray(i, t) < 0 && (opts.panes[i] || (opts.panes[i] = $.isPlainObject(o) ? $.extend(!0, {}, o) : o),
delete opts[i]);
$.extend(!0, options, opts), $.each(_c.allPanes, function(o, r) {
if (_c[r] = $.extend(!0, {}, _c.panes, _c[r]), n = options.panes, a = options[r],
"center" === r) for (t = $.layout.optionsMap.center, o = 0, s = t.length; s > o; o++) i = t[o],
opts.center[i] || !opts.panes[i] && a[i] || (a[i] = n[i]); else a = options[r] = $.extend(!0, {}, n, a),
e(r), a.resizerClass || (a.resizerClass = "ui-layout-resizer"), a.togglerClass || (a.togglerClass = "ui-layout-toggler");
a.paneClass || (a.paneClass = "ui-layout-pane");
});
var c = opts.zIndex, u = options.zIndexes;
c > 0 && (u.pane_normal = c, u.content_mask = max(c + 1, u.content_mask), u.resizer_normal = max(c + 2, u.resizer_normal)),
delete options.panes;
}, getPane = function(e) {
var t = options[e].paneSelector;
if ("#" === t.substr(0, 1)) return $N.find(t).eq(0);
var n = $N.children(t).eq(0);
return n.length ? n : $N.children("form:first").children(t).eq(0);
}, initPanes = function(e) {
evtPane(e), $.each(_c.allPanes, function(e, t) {
addPane(t, !0);
}), initHandles(), $.each(_c.borderPanes, function(e, t) {
$Ps[t] && state[t].isVisible && (setSizeLimits(t), makePaneFit(t));
}), sizeMidPanes("center"), $.each(_c.allPanes, function(e, t) {
afterInitPane(t);
});
}, addPane = function(e, t) {
if (t || isInitialized()) {
var n, i, o, r = options[e], s = state[e], a = _c[e], l = a.dir, c = (s.fx, r.spacing_open || 0,
"center" === e), u = {}, d = $Ps[e];
if (d ? removePane(e, !1, !0, !1) : $Cs[e] = !1, d = $Ps[e] = getPane(e), !d.length) return $Ps[e] = !1,
void 0;
if (!d.data("layoutCSS")) {
var h = "position,top,left,bottom,right,width,height,overflow,zIndex,display,backgroundColor,padding,margin,border";
d.data("layoutCSS", styles(d, h));
}
Instance[e] = {
name: e,
pane: $Ps[e],
content: $Cs[e],
options: options[e],
state: state[e],
children: children[e]
}, d.data({
parentLayout: Instance,
layoutPane: Instance[e],
layoutEdge: e,
layoutRole: "pane"
}).css(a.cssReq).css("zIndex", options.zIndexes.pane_normal).css(r.applyDemoStyles ? a.cssDemo : {}).addClass(r.paneClass + " " + r.paneClass + "-" + e).bind("mouseenter." + sID, addHover).bind("mouseleave." + sID, removeHover);
var p, f = {
hide: "",
show: "",
toggle: "",
close: "",
open: "",
slideOpen: "",
slideClose: "",
slideToggle: "",
size: "sizePane",
sizePane: "sizePane",
sizeContent: "",
sizeHandles: "",
enableClosable: "",
disableClosable: "",
enableSlideable: "",
disableSlideable: "",
enableResizable: "",
disableResizable: "",
swapPanes: "swapPanes",
swap: "swapPanes",
move: "swapPanes",
removePane: "removePane",
remove: "removePane",
createChildren: "",
resizeChildren: "",
resizeAll: "resizeAll",
resizeLayout: "resizeAll"
};
for (p in f) d.bind("layoutpane" + p.toLowerCase() + "." + sID, Instance[f[p] || p]);
initContent(e, !1), c || (n = s.size = _parseSize(e, r.size), i = _parseSize(e, r.minSize) || 1,
o = _parseSize(e, r.maxSize) || 1e5, n > 0 && (n = max(min(n, o), i)), s.autoResize = r.autoResize,
s.isClosed = !1, s.isSliding = !1, s.isResizing = !1, s.isHidden = !1, s.pins || (s.pins = [])),
s.tagName = d[0].tagName, s.edge = e, s.noRoom = !1, s.isVisible = !0, setPanePosition(e),
"horz" === l ? u.height = cssH(d, n) : "vert" === l && (u.width = cssW(d, n)), d.css(u),
"horz" != l && sizeMidPanes(e, !0), state.initialized && (initHandles(e), initHotkeys(e)),
r.initClosed && r.closable && !r.initHidden ? close(e, !0, !0) : r.initHidden || r.initClosed ? hide(e) : s.noRoom || d.css("display", "block"),
d.css("visibility", "visible"), r.showOverflowOnHover && d.hover(allowOverflow, resetOverflow),
state.initialized && afterInitPane(e);
}
}, afterInitPane = function(e) {
var t = $Ps[e], n = state[e], i = options[e];
t && (t.data("layout") && refreshChildren(e, t.data("layout")), n.isVisible && (state.initialized ? resizeAll() : sizeContent(e),
i.triggerEventsOnLoad ? _runCallbacks("onresize_end", e) : resizeChildren(e, !0)),
i.initChildren && i.children && createChildren(e));
}, setPanePosition = function(e) {
e = e ? e.split(",") : _c.borderPanes, $.each(e, function(e, t) {
var n = $Ps[t], i = $Rs[t], o = (options[t], state[t]), r = _c[t].side, s = {};
if (n) {
switch (t) {
case "north":
s.top = sC.inset.top, s.left = sC.inset.left, s.right = sC.inset.right;
break;
case "south":
s.bottom = sC.inset.bottom, s.left = sC.inset.left, s.right = sC.inset.right;
break;
case "west":
s.left = sC.inset.left;
break;
case "east":
s.right = sC.inset.right;
break;
case "center": }
n.css(s), i && o.isClosed ? i.css(r, sC.inset[r]) : i && !o.isHidden && i.css(r, sC.inset[r] + getPaneSize(t));
}
});
}, initHandles = function(e) {
e = e ? e.split(",") : _c.borderPanes, $.each(e, function(e, t) {
var n = $Ps[t];
if ($Rs[t] = !1, $Ts[t] = !1, n) {
var i = options[t], o = state[t], r = (_c[t], "#" === i.paneSelector.substr(0, 1) ? i.paneSelector.substr(1) : ""), s = i.resizerClass, a = i.togglerClass, l = (o.isVisible ? i.spacing_open : i.spacing_closed,
"-" + t), c = (o.isVisible ? "-open" : "-closed", Instance[t]), u = c.resizer = $Rs[t] = $("<div></div>"), d = c.toggler = i.closable ? $Ts[t] = $("<div></div>") : !1;
!o.isVisible && i.slidable && u.attr("title", i.tips.Slide).css("cursor", i.sliderCursor),
u.attr("id", r ? r + "-resizer" : "").data({
parentLayout: Instance,
layoutPane: Instance[t],
layoutEdge: t,
layoutRole: "resizer"
}).css(_c.resizers.cssReq).css("zIndex", options.zIndexes.resizer_normal).css(i.applyDemoStyles ? _c.resizers.cssDemo : {}).addClass(s + " " + s + l).hover(addHover, removeHover).hover(onResizerEnter, onResizerLeave).appendTo($N),
i.resizerDblClickToggle && u.bind("dblclick." + sID, toggle), d && (d.attr("id", r ? r + "-toggler" : "").data({
parentLayout: Instance,
layoutPane: Instance[t],
layoutEdge: t,
layoutRole: "toggler"
}).css(_c.togglers.cssReq).css(i.applyDemoStyles ? _c.togglers.cssDemo : {}).addClass(a + " " + a + l).hover(addHover, removeHover).bind("mouseenter", onResizerEnter).appendTo(u),
i.togglerContent_open && $("<span>" + i.togglerContent_open + "</span>").data({
layoutEdge: t,
layoutRole: "togglerContent"
}).data("layoutRole", "togglerContent").data("layoutEdge", t).addClass("content content-open").css("display", "none").appendTo(d),
i.togglerContent_closed && $("<span>" + i.togglerContent_closed + "</span>").data({
layoutEdge: t,
layoutRole: "togglerContent"
}).addClass("content content-closed").css("display", "none").appendTo(d), enableClosable(t)),
initResizable(t), o.isVisible ? setAsOpen(t) : (setAsClosed(t), bindStartSlidingEvents(t, !0));
}
}), sizeHandles();
}, initContent = function(e, t) {
if (isInitialized()) {
var n, i = options[e], o = i.contentSelector, r = Instance[e], s = $Ps[e];
o && (n = r.content = $Cs[e] = i.findNestedContent ? s.find(o).eq(0) : s.children(o).eq(0)),
n && n.length ? (n.data("layoutRole", "content"), n.data("layoutCSS") || n.data("layoutCSS", styles(n, "height")),
n.css(_c.content.cssReq), i.applyDemoStyles && (n.css(_c.content.cssDemo), s.css(_c.content.cssDemoPane)),
s.css("overflowX").match(/(scroll|auto)/) && s.css("overflow", "hidden"), state[e].content = {},
t !== !1 && sizeContent(e)) : r.content = $Cs[e] = !1;
}
}, initResizable = function(e) {
var t = $.layout.plugins.draggable;
e = e ? e.split(",") : _c.borderPanes, $.each(e, function(e, i) {
var o = options[i];
if (!t || !$Ps[i] || !o.resizable) return o.resizable = !1, !0;
var r, s, a = state[i], l = options.zIndexes, c = _c[i], u = "horz" == c.dir ? "top" : "left", d = ($Ps[i],
$Rs[i]), h = o.resizerClass, p = 0, f = h + "-drag", g = h + "-" + i + "-drag", m = h + "-dragging", v = h + "-" + i + "-dragging", b = h + "-dragging-limit", y = h + "-" + i + "-dragging-limit", w = !1;
a.isClosed || d.attr("title", o.tips.Resize).css("cursor", o.resizerCursor), d.draggable({
containment: $N[0],
axis: "horz" == c.dir ? "y" : "x",
delay: 0,
distance: 1,
grid: o.resizingGrid,
helper: "clone",
opacity: o.resizerDragOpacity,
addClasses: !1,
zIndex: l.resizer_drag,
start: function(e, t) {
return o = options[i], a = state[i], s = o.livePaneResizing, !1 === _runCallbacks("ondrag_start", i) ? !1 : (a.isResizing = !0,
state.paneResizing = i, timer.clear(i + "_closeSlider"), setSizeLimits(i), r = a.resizerPosition,
p = t.position[u], d.addClass(f + " " + g), w = !1, $("body").disableSelection(),
showMasks(i, {
resizing: !0
}), void 0);
},
drag: function(e, t) {
w || (t.helper.addClass(m + " " + v).css({
right: "auto",
bottom: "auto"
}).children().css("visibility", "hidden"), w = !0, a.isSliding && $Ps[i].css("zIndex", l.pane_sliding));
var c = 0;
t.position[u] < r.min ? (t.position[u] = r.min, c = -1) : t.position[u] > r.max && (t.position[u] = r.max,
c = 1), c ? (t.helper.addClass(b + " " + y), window.defaultStatus = c > 0 && i.match(/(north|west)/) || 0 > c && i.match(/(south|east)/) ? o.tips.maxSizeWarning : o.tips.minSizeWarning) : (t.helper.removeClass(b + " " + y),
window.defaultStatus = ""), s && Math.abs(t.position[u] - p) >= o.liveResizingTolerance && (p = t.position[u],
n(e, t, i));
},
stop: function(e, t) {
$("body").enableSelection(), window.defaultStatus = "", d.removeClass(f + " " + g),
a.isResizing = !1, state.paneResizing = !1, n(e, t, i, !0);
}
});
});
var n = function(e, t, n, i) {
var o, r = t.position, s = _c[n], a = options[n], l = state[n];
switch (n) {
case "north":
o = r.top;
break;
case "west":
o = r.left;
break;
case "south":
o = sC.layoutHeight - r.top - a.spacing_open;
break;
case "east":
o = sC.layoutWidth - r.left - a.spacing_open;
}
var c = o - sC.inset[s.side];
if (i) !1 !== _runCallbacks("ondrag_end", n) && manualSizePane(n, c, !1, !0), hideMasks(!0),
l.isSliding && showMasks(n, {
resizing: !0
}); else {
if (Math.abs(c - l.size) < a.liveResizingTolerance) return;
manualSizePane(n, c, !1, !0), sizeMasks();
}
};
}, sizeMask = function() {
var e = $(this), t = e.data("layoutMask"), n = state[t];
"IFRAME" == n.tagName && n.isVisible && e.css({
top: n.offsetTop,
left: n.offsetLeft,
width: n.outerWidth,
height: n.outerHeight
});
}, sizeMasks = function() {
$Ms.each(sizeMask);
}, showMasks = function(e, t) {
var n, i, o = _c[e], r = [ "center" ], s = options.zIndexes, a = $.extend({
objectsOnly: !1,
animation: !1,
resizing: !0,
sliding: state[e].isSliding
}, t);
a.resizing && r.push(e), a.sliding && r.push(_c.oppositeEdge[e]), "horz" === o.dir && (r.push("west"),
r.push("east")), $.each(r, function(e, t) {
i = state[t], n = options[t], i.isVisible && (n.maskObjects || !a.objectsOnly && n.maskContents) && getMasks(t).each(function() {
sizeMask.call(this), this.style.zIndex = i.isSliding ? s.pane_sliding + 1 : s.pane_normal + 1,
this.style.display = "block";
});
});
}, hideMasks = function(e) {
if (e || !state.paneResizing) $Ms.hide(); else if (!e && !$.isEmptyObject(state.panesSliding)) for (var t, n, i = $Ms.length - 1; i >= 0; i--) n = $Ms.eq(i),
t = n.data("layoutMask"), options[t].maskObjects || n.hide();
}, getMasks = function(e) {
for (var t, n = $([]), i = 0, o = $Ms.length; o > i; i++) t = $Ms.eq(i), t.data("layoutMask") === e && (n = n.add(t));
return n.length ? n : createMasks(e);
}, createMasks = function(e) {
var t, n, i, o, r, s = $Ps[e], a = state[e], l = options[e], c = options.zIndexes, u = $([]);
if (!l.maskContents && !l.maskObjects) return u;
for (r = 0; r < (l.maskObjects ? 2 : 1); r++) t = l.maskObjects && 0 == r, n = document.createElement(t ? "iframe" : "div"),
i = $(n).data("layoutMask", e), n.className = "ui-layout-mask ui-layout-mask-" + e,
o = n.style, o.display = "block", o.position = "absolute", o.background = "#FFF",
t && (n.frameborder = 0, n.src = "about:blank", o.opacity = 0, o.filter = "Alpha(Opacity='0')",
o.border = 0), "IFRAME" == a.tagName ? (o.zIndex = c.pane_normal + 1, $N.append(n)) : (i.addClass("ui-layout-mask-inside-pane"),
o.zIndex = l.maskZindex || c.content_mask, o.top = 0, o.left = 0, o.width = "100%",
o.height = "100%", s.append(n)), u = u.add(n), $Ms = $Ms.add(n);
return u;
}, destroy = function(e, t) {
$(window).unbind("." + sID), $(document).unbind("." + sID), "object" == typeof e ? evtPane(e) : t = e,
$N.clearQueue().removeData("layout").removeData("layoutContainer").removeClass(options.containerClass).unbind("." + sID),
$Ms.remove(), $.each(_c.allPanes, function(e, n) {
removePane(n, !1, !0, t);
});
var n = "layoutCSS";
$N.data(n) && !$N.data("layoutRole") && $N.css($N.data(n)).removeData(n), "BODY" === sC.tagName && ($N = $("html")).data(n) && $N.css($N.data(n)).removeData(n),
runPluginCallbacks(Instance, $.layout.onDestroy), unload();
for (var i in Instance) i.match(/^(container|options)$/) || delete Instance[i];
return Instance.destroyed = !0, Instance;
}, removePane = function(e, t, n, i) {
if (isInitialized()) {
var o = evtPane.call(this, e), r = $Ps[o], s = $Cs[o], a = $Rs[o], l = $Ts[o];
r && $.isEmptyObject(r.data()) && (r = !1), s && $.isEmptyObject(s.data()) && (s = !1),
a && $.isEmptyObject(a.data()) && (a = !1), l && $.isEmptyObject(l.data()) && (l = !1),
r && r.stop(!0, !0);
var c = options[o], u = state[o], d = "layout", h = "layoutCSS", p = children[o], f = $.isPlainObject(p) && !$.isEmptyObject(p), g = void 0 !== i ? i : c.destroyChildren;
if (f && g && ($.each(p, function(e, t) {
t.destroyed || t.destroy(!0), t.destroyed && delete p[e];
}), $.isEmptyObject(p) && (p = children[o] = null, f = !1)), r && t && !f) r.remove(); else if (r && r[0]) {
var m = c.paneClass, v = m + "-" + o, b = "-open", y = "-sliding", w = "-closed", C = [ m, m + b, m + w, m + y, v, v + b, v + w, v + y ];
$.merge(C, getHoverClasses(r, !0)), r.removeClass(C.join(" ")).removeData("parentLayout").removeData("layoutPane").removeData("layoutRole").removeData("layoutEdge").removeData("autoHidden").unbind("." + sID),
f && s ? (s.width(s.width()), $.each(p, function(e, t) {
t.resizeAll();
})) : s && s.css(s.data(h)).removeData(h).removeData("layoutRole"), r.data(d) || r.css(r.data(h)).removeData(h);
}
l && l.remove(), a && a.remove(), Instance[o] = $Ps[o] = $Cs[o] = $Rs[o] = $Ts[o] = !1,
u = {
removed: !0
}, n || resizeAll();
}
}, _hidePane = function(e) {
var t = $Ps[e], n = options[e], i = t[0].style;
n.useOffscreenClose ? (t.data(_c.offscreenReset) || t.data(_c.offscreenReset, {
left: i.left,
right: i.right
}), t.css(_c.offscreenCSS)) : t.hide().removeData(_c.offscreenReset);
}, _showPane = function(e) {
var t = $Ps[e], n = options[e], i = _c.offscreenCSS, o = t.data(_c.offscreenReset), r = t[0].style;
t.show().removeData(_c.offscreenReset), n.useOffscreenClose && o && (r.left == i.left && (r.left = o.left),
r.right == i.right && (r.right = o.right));
}, hide = function(e, t) {
if (isInitialized()) {
var n = evtPane.call(this, e), i = options[n], o = state[n], r = $Ps[n], s = $Rs[n];
r && !o.isHidden && (state.initialized && !1 === _runCallbacks("onhide_start", n) || (o.isSliding = !1,
delete state.panesSliding[n], s && s.hide(), !state.initialized || o.isClosed ? (o.isClosed = !0,
o.isHidden = !0, o.isVisible = !1, state.initialized || _hidePane(n), sizeMidPanes("horz" === _c[n].dir ? "" : "center"),
(state.initialized || i.triggerEventsOnLoad) && _runCallbacks("onhide_end", n)) : (o.isHiding = !0,
close(n, !1, t))));
}
}, show = function(e, t, n, i) {
if (isInitialized()) {
var o = evtPane.call(this, e), r = (options[o], state[o]), s = $Ps[o];
$Rs[o], s && r.isHidden && !1 !== _runCallbacks("onshow_start", o) && (r.isShowing = !0,
r.isSliding = !1, delete state.panesSliding[o], t === !1 ? close(o, !0) : open(o, !1, n, i));
}
}, toggle = function(e, t) {
if (isInitialized()) {
var n = evtObj(e), i = evtPane.call(this, e), o = state[i];
n && n.stopImmediatePropagation(), o.isHidden ? show(i) : o.isClosed ? open(i, !!t) : close(i);
}
}, _closePane = function(e, t) {
var n = ($Ps[e], state[e]);
_hidePane(e), n.isClosed = !0, n.isVisible = !1, t && setAsClosed(e);
}, close = function(e, t, n, i) {
function o() {
h.isMoving = !1, bindStartSlidingEvents(r, !0);
var e = _c.oppositeEdge[r];
state[e].noRoom && (setSizeLimits(e), makePaneFit(e)), i || !state.initialized && !d.triggerEventsOnLoad || (a || _runCallbacks("onclose_end", r),
a && _runCallbacks("onshow_end", r), l && _runCallbacks("onhide_end", r));
}
var r = evtPane.call(this, e);
if (!state.initialized && $Ps[r]) return _closePane(r, !0), void 0;
if (isInitialized()) {
var s, a, l, c, u = $Ps[r], d = ($Rs[r], $Ts[r], options[r]), h = state[r];
_c[r], $N.queue(function(e) {
if (!u || !d.closable && !h.isShowing && !h.isHiding || !t && h.isClosed && !h.isShowing) return e();
var i = !h.isShowing && !1 === _runCallbacks("onclose_start", r);
return a = h.isShowing, l = h.isHiding, c = h.isSliding, delete h.isShowing, delete h.isHiding,
i ? e() : (s = !n && !h.isClosed && "none" != d.fxName_close, h.isMoving = !0, h.isClosed = !0,
h.isVisible = !1, l ? h.isHidden = !0 : a && (h.isHidden = !1), h.isSliding ? bindStopSlidingEvents(r, !1) : sizeMidPanes("horz" === _c[r].dir ? "" : "center", !1),
setAsClosed(r), s ? (lockPaneForFX(r, !0), u.hide(d.fxName_close, d.fxSettings_close, d.fxSpeed_close, function() {
lockPaneForFX(r, !1), h.isClosed && o(), e();
})) : (_hidePane(r), o(), e()), void 0);
});
}
}, setAsClosed = function(e) {
if ($Rs[e]) {
var t = ($Ps[e], $Rs[e]), n = $Ts[e], i = options[e], o = (state[e], _c[e].side), r = i.resizerClass, s = i.togglerClass, a = "-" + e, l = "-open", c = "-sliding", u = "-closed";
t.css(o, sC.inset[o]).removeClass(r + l + " " + r + a + l).removeClass(r + c + " " + r + a + c).addClass(r + u + " " + r + a + u),
i.resizable && $.layout.plugins.draggable && t.draggable("disable").removeClass("ui-state-disabled").css("cursor", "default").attr("title", ""),
n && (n.removeClass(s + l + " " + s + a + l).addClass(s + u + " " + s + a + u).attr("title", i.tips.Open),
n.children(".content-open").hide(), n.children(".content-closed").css("display", "block")),
syncPinBtns(e, !1), state.initialized && sizeHandles();
}
}, open = function(e, t, n, i) {
function o() {
u.isMoving = !1, _fixIframe(a), u.isSliding || sizeMidPanes("vert" == _c[a].dir ? "center" : "", !1),
setAsOpen(a);
}
if (isInitialized()) {
var r, s, a = evtPane.call(this, e), l = $Ps[a], c = ($Rs[a], $Ts[a], options[a]), u = state[a];
_c[a], $N.queue(function(e) {
if (!l || !c.resizable && !c.closable && !u.isShowing || u.isVisible && !u.isSliding) return e();
if (u.isHidden && !u.isShowing) return e(), show(a, !0), void 0;
u.autoResize && u.size != c.size ? sizePane(a, c.size, !0, !0, !0) : setSizeLimits(a, t);
var d = _runCallbacks("onopen_start", a);
return "abort" === d ? e() : ("NC" !== d && setSizeLimits(a, t), u.minSize > u.maxSize ? (syncPinBtns(a, !1),
!i && c.tips.noRoomToOpen && alert(c.tips.noRoomToOpen), e()) : (t ? bindStopSlidingEvents(a, !0) : u.isSliding ? bindStopSlidingEvents(a, !1) : c.slidable && bindStartSlidingEvents(a, !1),
u.noRoom = !1, makePaneFit(a), s = u.isShowing, delete u.isShowing, r = !n && u.isClosed && "none" != c.fxName_open,
u.isMoving = !0, u.isVisible = !0, u.isClosed = !1, s && (u.isHidden = !1), r ? (lockPaneForFX(a, !0),
l.show(c.fxName_open, c.fxSettings_open, c.fxSpeed_open, function() {
lockPaneForFX(a, !1), u.isVisible && o(), e();
})) : (_showPane(a), o(), e()), void 0));
});
}
}, setAsOpen = function(e, t) {
var n = $Ps[e], i = $Rs[e], o = $Ts[e], r = options[e], s = state[e], a = _c[e].side, l = r.resizerClass, c = r.togglerClass, u = "-" + e, d = "-open", h = "-closed", p = "-sliding";
i.css(a, sC.inset[a] + getPaneSize(e)).removeClass(l + h + " " + l + u + h).addClass(l + d + " " + l + u + d),
s.isSliding ? i.addClass(l + p + " " + l + u + p) : i.removeClass(l + p + " " + l + u + p),
removeHover(0, i), r.resizable && $.layout.plugins.draggable ? i.draggable("enable").css("cursor", r.resizerCursor).attr("title", r.tips.Resize) : s.isSliding || i.css("cursor", "default"),
o && (o.removeClass(c + h + " " + c + u + h).addClass(c + d + " " + c + u + d).attr("title", r.tips.Close),
removeHover(0, o), o.children(".content-closed").hide(), o.children(".content-open").css("display", "block")),
syncPinBtns(e, !s.isSliding), $.extend(s, elDims(n)), state.initialized && (sizeHandles(),
sizeContent(e, !0)), !t && (state.initialized || r.triggerEventsOnLoad) && n.is(":visible") && (_runCallbacks("onopen_end", e),
s.isShowing && _runCallbacks("onshow_end", e), state.initialized && _runCallbacks("onresize_end", e));
}, slideOpen = function(e) {
function t() {
o.isClosed ? o.isMoving || open(i, !0) : bindStopSlidingEvents(i, !0);
}
if (isInitialized()) {
var n = evtObj(e), i = evtPane.call(this, e), o = state[i], r = options[i].slideDelay_open;
n && n.stopImmediatePropagation(), o.isClosed && n && "mouseenter" === n.type && r > 0 ? timer.set(i + "_openSlider", t, r) : t();
}
}, slideClose = function(e) {
function t() {
r.isClosed ? bindStopSlidingEvents(i, !1) : r.isMoving || close(i);
}
if (isInitialized()) {
var n = evtObj(e), i = evtPane.call(this, e), o = options[i], r = state[i], s = r.isMoving ? 1e3 : 300;
if (!r.isClosed && !r.isResizing) if ("click" === o.slideTrigger_close) t(); else {
if (o.preventQuickSlideClose && r.isMoving) return;
if (o.preventPrematureSlideClose && n && $.layout.isMouseOverElem(n, $Ps[i])) return;
n ? timer.set(i + "_closeSlider", t, max(o.slideDelay_close, s)) : t();
}
}
}, slideToggle = function(e) {
var t = evtPane.call(this, e);
toggle(t, !0);
}, lockPaneForFX = function(e, t) {
var n = $Ps[e], i = state[e], o = options[e], r = options.zIndexes;
t ? (showMasks(e, {
animation: !0,
objectsOnly: !0
}), n.css({
zIndex: r.pane_animate
}), "south" == e ? n.css({
top: sC.inset.top + sC.innerHeight - n.outerHeight()
}) : "east" == e && n.css({
left: sC.inset.left + sC.innerWidth - n.outerWidth()
})) : (hideMasks(), n.css({
zIndex: i.isSliding ? r.pane_sliding : r.pane_normal
}), "south" == e ? n.css({
top: "auto"
}) : "east" != e || n.css("left").match(/\-99999/) || n.css({
left: "auto"
}), browser.msie && o.fxOpacityFix && "slide" != o.fxName_open && n.css("filter") && 1 == n.css("opacity") && n[0].style.removeAttribute("filter"));
}, bindStartSlidingEvents = function(e, t) {
var n = options[e], i = ($Ps[e], $Rs[e]), o = n.slideTrigger_open.toLowerCase();
!i || t && !n.slidable || (o.match(/mouseover/) ? o = n.slideTrigger_open = "mouseenter" : o.match(/(click|dblclick|mouseenter)/) || (o = n.slideTrigger_open = "click"),
n.resizerDblClickToggle && o.match(/click/) && i[t ? "unbind" : "bind"]("dblclick." + sID, toggle),
i[t ? "bind" : "unbind"](o + "." + sID, slideOpen).css("cursor", t ? n.sliderCursor : "default").attr("title", t ? n.tips.Slide : ""));
}, bindStopSlidingEvents = function(e, t) {
function n(t) {
timer.clear(e + "_closeSlider"), t.stopPropagation();
}
var i = options[e], o = state[e], r = (_c[e], options.zIndexes), s = i.slideTrigger_close.toLowerCase(), a = t ? "bind" : "unbind", l = $Ps[e], c = $Rs[e];
timer.clear(e + "_closeSlider"), t ? (o.isSliding = !0, state.panesSliding[e] = !0,
bindStartSlidingEvents(e, !1)) : (o.isSliding = !1, delete state.panesSliding[e]),
l.css("zIndex", t ? r.pane_sliding : r.pane_normal), c.css("zIndex", t ? r.pane_sliding + 2 : r.resizer_normal),
s.match(/(click|mouseleave)/) || (s = i.slideTrigger_close = "mouseleave"), c[a](s, slideClose),
"mouseleave" === s && (l[a]("mouseleave." + sID, slideClose), c[a]("mouseenter." + sID, n),
l[a]("mouseenter." + sID, n)), t ? "click" !== s || i.resizable || (c.css("cursor", t ? i.sliderCursor : "default"),
c.attr("title", t ? i.tips.Close : "")) : timer.clear(e + "_closeSlider");
}, makePaneFit = function(e, t, n, i) {
var o = options[e], r = state[e], s = _c[e], a = $Ps[e], l = $Rs[e], c = "vert" === s.dir, u = !1;
if (("center" === e || c && r.noVerticalRoom) && (u = r.maxHeight >= 0, u && r.noRoom ? (_showPane(e),
l && l.show(), r.isVisible = !0, r.noRoom = !1, c && (r.noVerticalRoom = !1), _fixIframe(e)) : u || r.noRoom || (_hidePane(e),
l && l.hide(), r.isVisible = !1, r.noRoom = !0)), "center" === e) ; else if (r.minSize <= r.maxSize) {
if (u = !0, r.size > r.maxSize) sizePane(e, r.maxSize, n, !0, i); else if (r.size < r.minSize) sizePane(e, r.minSize, n, !0, i); else if (l && r.isVisible && a.is(":visible")) {
var d = r.size + sC.inset[s.side];
$.layout.cssNum(l, s.side) != d && l.css(s.side, d);
}
r.noRoom && (r.wasOpen && o.closable ? o.autoReopen ? open(e, !1, !0, !0) : r.noRoom = !1 : show(e, r.wasOpen, !0, !0));
} else r.noRoom || (r.noRoom = !0, r.wasOpen = !r.isClosed && !r.isSliding, r.isClosed || (o.closable ? close(e, !0, !0) : hide(e, !0)));
}, manualSizePane = function(e, t, n, i, o) {
if (isInitialized()) {
var r = evtPane.call(this, e), s = options[r], a = state[r], l = o || s.livePaneResizing && !a.isResizing;
a.autoResize = !1, sizePane(r, t, n, i, l);
}
}, sizePane = function(e, t, n, i, o) {
function r() {
for (var e = "width" === f ? d.outerWidth() : d.outerHeight(), i = [ {
pane: l,
count: 1,
target: t,
actual: e,
correct: t === e,
attempt: t,
cssSize: a
} ], r = i[0], c = {}, m = "Inaccurate size after resizing the " + l + "-pane."; !(r.correct || (c = {
pane: l,
count: r.count + 1,
target: t
}, c.attempt = r.actual > t ? max(0, r.attempt - (r.actual - t)) : max(0, r.attempt + (t - r.actual)),
c.cssSize = cssSize(l, c.attempt), d.css(f, c.cssSize), c.actual = "width" == f ? d.outerWidth() : d.outerHeight(),
c.correct = t === c.actual, 1 === i.length && (_log(m, !1, !0), _log(r, !1, !0)),
_log(c, !1, !0), i.length > 3)); ) i.push(c), r = i[i.length - 1];
u.size = t, $.extend(u, elDims(d)), u.isVisible && d.is(":visible") && (h && h.css(p, t + sC.inset[p]),
sizeContent(l)), !n && !g && state.initialized && u.isVisible && _runCallbacks("onresize_end", l),
n || (u.isSliding || sizeMidPanes("horz" == _c[l].dir ? "" : "center", g, o), sizeHandles());
var v = _c.oppositeEdge[l];
s > t && state[v].noRoom && (setSizeLimits(v), makePaneFit(v, !1, n)), i.length > 1 && _log(m + "\nSee the Error Console for details.", !0, !0);
}
if (isInitialized()) {
var s, a, l = evtPane.call(this, e), c = options[l], u = state[l], d = $Ps[l], h = $Rs[l], p = _c[l].side, f = _c[l].sizeType.toLowerCase(), g = u.isResizing && !c.triggerEventsDuringLiveResize, m = i !== !0 && c.animatePaneSizing;
$N.queue(function(e) {
if (setSizeLimits(l), s = u.size, t = _parseSize(l, t), t = max(t, _parseSize(l, c.minSize)),
t = min(t, u.maxSize), t < u.minSize) return e(), makePaneFit(l, !1, n), void 0;
if (!o && t === s) return e();
if (u.newSize = t, !n && state.initialized && u.isVisible && _runCallbacks("onresize_start", l),
a = cssSize(l, t), m && d.is(":visible")) {
var i = $.layout.effects.size[l] || $.layout.effects.size.all, h = c.fxSettings_size.easing || i.easing, p = options.zIndexes, g = {};
g[f] = a + "px", u.isMoving = !0, d.css({
zIndex: p.pane_animate
}).show().animate(g, c.fxSpeed_size, h, function() {
d.css({
zIndex: u.isSliding ? p.pane_sliding : p.pane_normal
}), u.isMoving = !1, delete u.newSize, r(), e();
});
} else d.css(f, a), delete u.newSize, d.is(":visible") ? r() : (u.size = t, $.extend(u, elDims(d))),
e();
});
}
}, sizeMidPanes = function(e, t, n) {
e = (e ? e : "east,west,center").split(","), $.each(e, function(e, i) {
if ($Ps[i]) {
var o = options[i], r = state[i], s = $Ps[i], a = ($Rs[i], !0), l = {}, c = $.layout.showInvisibly(s), u = calcNewCenterPaneDims();
if ($.extend(r, elDims(s)), "center" === i) {
if (!n && r.isVisible && u.width === r.outerWidth && u.height === r.outerHeight) return s.css(c),
!0;
if ($.extend(r, cssMinDims(i), {
maxWidth: u.width,
maxHeight: u.height
}), l = u, r.newWidth = l.width, r.newHeight = l.height, l.width = cssW(s, l.width),
l.height = cssH(s, l.height), a = l.width >= 0 && l.height >= 0, !state.initialized && o.minWidth > u.width) {
var d = o.minWidth - r.outerWidth, h = options.east.minSize || 0, p = options.west.minSize || 0, f = state.east.size, g = state.west.size, m = f, v = g;
if (d > 0 && state.east.isVisible && f > h && (m = max(f - h, f - d), d -= f - m),
d > 0 && state.west.isVisible && g > p && (v = max(g - p, g - d), d -= g - v), 0 === d) return f && f != h && sizePane("east", m, !0, !0, n),
g && g != p && sizePane("west", v, !0, !0, n), sizeMidPanes("center", t, n), s.css(c),
void 0;
}
} else {
if (r.isVisible && !r.noVerticalRoom && $.extend(r, elDims(s), cssMinDims(i)), !n && !r.noVerticalRoom && u.height === r.outerHeight) return s.css(c),
!0;
l.top = u.top, l.bottom = u.bottom, r.newSize = u.height, l.height = cssH(s, u.height),
r.maxHeight = l.height, a = r.maxHeight >= 0, a || (r.noVerticalRoom = !0);
}
if (a ? (!t && state.initialized && _runCallbacks("onresize_start", i), s.css(l),
"center" !== i && sizeHandles(i), !r.noRoom || r.isClosed || r.isHidden || makePaneFit(i),
r.isVisible && ($.extend(r, elDims(s)), state.initialized && sizeContent(i))) : !r.noRoom && r.isVisible && makePaneFit(i),
s.css(c), delete r.newSize, delete r.newWidth, delete r.newHeight, !r.isVisible) return !0;
if ("center" === i) {
var b = browser.isIE6 || !browser.boxModel;
$Ps.north && (b || "IFRAME" == state.north.tagName) && $Ps.north.css("width", cssW($Ps.north, sC.innerWidth)),
$Ps.south && (b || "IFRAME" == state.south.tagName) && $Ps.south.css("width", cssW($Ps.south, sC.innerWidth));
}
!t && state.initialized && _runCallbacks("onresize_end", i);
}
});
}, resizeAll = function(e) {
var t = sC.innerWidth, n = sC.innerHeight;
if (evtPane(e), $N.is(":visible")) {
if (!state.initialized) return _initLayoutElements(), void 0;
if (e === !0 && $.isPlainObject(options.outset) && $N.css(options.outset), $.extend(sC, elDims($N, options.inset)),
sC.outerHeight) {
if (e === !0 && setPanePosition(), !1 === _runCallbacks("onresizeall_start")) return !1;
var i, o, r;
sC.innerHeight < n, sC.innerWidth < t, $.each([ "south", "north", "east", "west" ], function(e, t) {
$Ps[t] && (o = options[t], r = state[t], r.autoResize && r.size != o.size ? sizePane(t, o.size, !0, !0, !0) : (setSizeLimits(t),
makePaneFit(t, !1, !0, !0)));
}), sizeMidPanes("", !0, !0), sizeHandles(), $.each(_c.allPanes, function(e, t) {
i = $Ps[t], i && state[t].isVisible && _runCallbacks("onresize_end", t);
}), _runCallbacks("onresizeall_end");
}
}
}, resizeChildren = function(e, t) {
var n = evtPane.call(this, e);
if (options[n].resizeChildren) {
t || refreshChildren(n);
var i = children[n];
$.isPlainObject(i) && $.each(i, function(e, t) {
t.destroyed || t.resizeAll();
});
}
}, sizeContent = function(e, t) {
if (isInitialized()) {
var n = evtPane.call(this, e);
n = n ? n.split(",") : _c.allPanes, $.each(n, function(e, n) {
function i(e) {
return max(l.css.paddingBottom, parseInt(e.css("marginBottom"), 10) || 0);
}
function o() {
var e = options[n].contentIgnoreSelector, t = s.nextAll().not(".ui-layout-mask").not(e || ":lt(0)"), o = t.filter(":visible"), r = o.filter(":last");
c = {
top: s[0].offsetTop,
height: s.outerHeight(),
numFooters: t.length,
hiddenFooters: t.length - o.length,
spaceBelow: 0
}, c.spaceAbove = c.top, c.bottom = c.top + c.height, c.spaceBelow = r.length ? r[0].offsetTop + r.outerHeight() - c.bottom + i(r) : i(s);
}
var r = $Ps[n], s = $Cs[n], a = options[n], l = state[n], c = l.content;
if (!r || !s || !r.is(":visible")) return !0;
if ((s.length || (initContent(n, !1), s)) && !1 !== _runCallbacks("onsizecontent_start", n)) {
(!l.isMoving && !l.isResizing || a.liveContentResizing || t || void 0 == c.top) && (o(),
c.hiddenFooters > 0 && "hidden" === r.css("overflow") && (r.css("overflow", "visible"),
o(), r.css("overflow", "hidden")));
var u = l.innerHeight - (c.spaceAbove - l.css.paddingTop) - (c.spaceBelow - l.css.paddingBottom);
s.is(":visible") && c.height == u || (setOuterHeight(s, u, !0), c.height = u), state.initialized && _runCallbacks("onsizecontent_end", n);
}
});
}
}, sizeHandles = function(e) {
var t = evtPane.call(this, e);
t = t ? t.split(",") : _c.borderPanes, $.each(t, function(e, t) {
var n, i = options[t], o = state[t], r = $Ps[t], s = $Rs[t], a = $Ts[t];
if (r && s) {
var l, c, u, d = _c[t].dir, h = o.isClosed ? "_closed" : "_open", p = i["spacing" + h], f = i["togglerAlign" + h], g = i["togglerLength" + h];
if (0 === p) return s.hide(), void 0;
if (o.noRoom || o.isHidden || s.show(), "horz" === d ? (l = sC.innerWidth, o.resizerLength = l,
c = $.layout.cssNum(r, "left"), s.css({
width: cssW(s, l),
height: cssH(s, p),
left: c > -9999 ? c : sC.inset.left
})) : (l = r.outerHeight(), o.resizerLength = l, s.css({
height: cssH(s, l),
width: cssW(s, p),
top: sC.inset.top + getPaneSize("north", !0)
})), removeHover(i, s), a) {
if (0 === g || o.isSliding && i.hideTogglerOnSlide) return a.hide(), void 0;
if (a.show(), !(g > 0) || "100%" === g || g > l) g = l, u = 0; else if (isStr(f)) switch (f) {
case "top":
case "left":
u = 0;
break;
case "bottom":
case "right":
u = l - g;
break;
case "middle":
case "center":
default:
u = round((l - g) / 2);
} else {
var m = parseInt(f, 10);
u = f >= 0 ? m : l - g + m;
}
if ("horz" === d) {
var v = cssW(a, g);
a.css({
width: v,
height: cssH(a, p),
left: u,
top: 0
}), a.children(".content").each(function() {
n = $(this), n.css("marginLeft", round((v - n.outerWidth()) / 2));
});
} else {
var b = cssH(a, g);
a.css({
height: b,
width: cssW(a, p),
top: u,
left: 0
}), a.children(".content").each(function() {
n = $(this), n.css("marginTop", round((b - n.outerHeight()) / 2));
});
}
removeHover(0, a);
}
state.initialized || !i.initHidden && !o.isHidden || (s.hide(), a && a.hide());
}
});
}, enableClosable = function(e) {
if (isInitialized()) {
var t = evtPane.call(this, e), n = $Ts[t], i = options[t];
n && (i.closable = !0, n.bind("click." + sID, function(e) {
e.stopPropagation(), toggle(t);
}).css("visibility", "visible").css("cursor", "pointer").attr("title", state[t].isClosed ? i.tips.Open : i.tips.Close).show());
}
}, disableClosable = function(e, t) {
if (isInitialized()) {
var n = evtPane.call(this, e), i = $Ts[n];
i && (options[n].closable = !1, state[n].isClosed && open(n, !1, !0), i.unbind("." + sID).css("visibility", t ? "hidden" : "visible").css("cursor", "default").attr("title", ""));
}
}, enableSlidable = function(e) {
if (isInitialized()) {
var t = evtPane.call(this, e), n = $Rs[t];
n && n.data("draggable") && (options[t].slidable = !0, state[t].isClosed && bindStartSlidingEvents(t, !0));
}
}, disableSlidable = function(e) {
if (isInitialized()) {
var t = evtPane.call(this, e), n = $Rs[t];
n && (options[t].slidable = !1, state[t].isSliding ? close(t, !1, !0) : (bindStartSlidingEvents(t, !1),
n.css("cursor", "default").attr("title", ""), removeHover(null, n[0])));
}
}, enableResizable = function(e) {
if (isInitialized()) {
var t = evtPane.call(this, e), n = $Rs[t], i = options[t];
n && n.data("draggable") && (i.resizable = !0, n.draggable("enable"), state[t].isClosed || n.css("cursor", i.resizerCursor).attr("title", i.tips.Resize));
}
}, disableResizable = function(e) {
if (isInitialized()) {
var t = evtPane.call(this, e), n = $Rs[t];
n && n.data("draggable") && (options[t].resizable = !1, n.draggable("disable").css("cursor", "default").attr("title", ""),
removeHover(null, n[0]));
}
}, swapPanes = function(e, t) {
function n(e) {
var t = $Ps[e], n = $Cs[e];
return t ? {
pane: e,
P: t ? t[0] : !1,
C: n ? n[0] : !1,
state: $.extend(!0, {}, state[e]),
options: $.extend(!0, {}, options[e])
} : !1;
}
function i(e, t) {
if (e) {
var n, i, o = e.P, r = e.C, s = e.pane, l = _c[t], c = $.extend(!0, {}, state[t]), u = options[t], d = {
resizerCursor: u.resizerCursor
};
$.each("fxName,fxSpeed,fxSettings".split(","), function(e, t) {
d[t + "_open"] = u[t + "_open"], d[t + "_close"] = u[t + "_close"], d[t + "_size"] = u[t + "_size"];
}), $Ps[t] = $(o).data({
layoutPane: Instance[t],
layoutEdge: t
}).css(_c.hidden).css(l.cssReq), $Cs[t] = r ? $(r) : !1, options[t] = $.extend(!0, {}, e.options, d),
state[t] = $.extend(!0, {}, e.state), n = new RegExp(u.paneClass + "-" + s, "g"),
o.className = o.className.replace(n, u.paneClass + "-" + t), initHandles(t), l.dir != _c[s].dir ? (i = a[t] || 0,
setSizeLimits(t), i = max(i, state[t].minSize), manualSizePane(t, i, !0, !0)) : $Rs[t].css(l.side, sC.inset[l.side] + (state[t].isVisible ? getPaneSize(t) : 0)),
e.state.isVisible && !c.isVisible ? setAsOpen(t, !0) : (setAsClosed(t), bindStartSlidingEvents(t, !0)),
e = null;
}
}
if (isInitialized()) {
var o = evtPane.call(this, e);
if (state[o].edge = t, state[t].edge = o, !1 === _runCallbacks("onswap_start", o) || !1 === _runCallbacks("onswap_start", t)) return state[o].edge = o,
state[t].edge = t, void 0;
var r = n(o), s = n(t), a = {};
a[o] = r ? r.state.size : 0, a[t] = s ? s.state.size : 0, $Ps[o] = !1, $Ps[t] = !1,
state[o] = {}, state[t] = {}, $Ts[o] && $Ts[o].remove(), $Ts[t] && $Ts[t].remove(),
$Rs[o] && $Rs[o].remove(), $Rs[t] && $Rs[t].remove(), $Rs[o] = $Rs[t] = $Ts[o] = $Ts[t] = !1,
i(r, t), i(s, o), r = s = a = null, $Ps[o] && $Ps[o].css(_c.visible), $Ps[t] && $Ps[t].css(_c.visible),
resizeAll(), _runCallbacks("onswap_end", o), _runCallbacks("onswap_end", t);
}
}, syncPinBtns = function(e, t) {
$.layout.plugins.buttons && $.each(state[e].pins, function(n, i) {
$.layout.buttons.setPinState(Instance, $(i), e, t);
});
}, $N = $(this).eq(0);
if (!$N.length) return _log(options.errors.containerMissing);
if ($N.data("layoutContainer") && $N.data("layout")) return $N.data("layout");
var $Ps = {}, $Cs = {}, $Rs = {}, $Ts = {}, $Ms = $([]), sC = state.container, sID = state.id, Instance = {
options: options,
state: state,
container: $N,
panes: $Ps,
contents: $Cs,
resizers: $Rs,
togglers: $Ts,
hide: hide,
show: show,
toggle: toggle,
open: open,
close: close,
slideOpen: slideOpen,
slideClose: slideClose,
slideToggle: slideToggle,
setSizeLimits: setSizeLimits,
_sizePane: sizePane,
sizePane: manualSizePane,
sizeContent: sizeContent,
swapPanes: swapPanes,
showMasks: showMasks,
hideMasks: hideMasks,
initContent: initContent,
addPane: addPane,
removePane: removePane,
createChildren: createChildren,
refreshChildren: refreshChildren,
enableClosable: enableClosable,
disableClosable: disableClosable,
enableSlidable: enableSlidable,
disableSlidable: disableSlidable,
enableResizable: enableResizable,
disableResizable: disableResizable,
allowOverflow: allowOverflow,
resetOverflow: resetOverflow,
destroy: destroy,
initPanes: isInitialized,
resizeAll: resizeAll,
runCallbacks: _runCallbacks,
hasParentLayout: !1,
children: children,
north: !1,
south: !1,
west: !1,
east: !1,
center: !1
};
return "cancel" === _create() ? null : Instance;
};
}(jQuery), function(e) {
e.ui || (e.ui = {}), e.ui.cookie = {
acceptsCookies: !!navigator.cookieEnabled,
read: function(t) {
for (var n, i = document.cookie, o = i ? i.split(";") : [], r = 0, s = o.length; s > r; r++) if (n = e.trim(o[r]).split("="),
n[0] == t) return decodeURIComponent(n[1]);
return null;
},
write: function(t, n, i) {
var o = "", r = "", s = !1, a = i || {}, l = a.expires || null, c = e.type(l);
"date" === c ? r = l : "string" === c && l > 0 && (l = parseInt(l, 10), c = "number"),
"number" === c && (r = new Date(), l > 0 ? r.setDate(r.getDate() + l) : (r.setFullYear(1970),
s = !0)), r && (o += ";expires=" + r.toUTCString()), a.path && (o += ";path=" + a.path),
a.domain && (o += ";domain=" + a.domain), a.secure && (o += ";secure"), document.cookie = t + "=" + (s ? "" : encodeURIComponent(n)) + o;
},
clear: function(t) {
e.ui.cookie.write(t, "", {
expires: -1
});
}
}, e.cookie || (e.cookie = function(t, n, i) {
var o = e.ui.cookie;
if (null === n) o.clear(t); else {
if (void 0 === n) return o.read(t);
o.write(t, n, i);
}
}), e.layout.plugins.stateManagement = !0, e.layout.config.optionRootKeys.push("stateManagement"),
e.layout.defaults.stateManagement = {
enabled: !1,
autoSave: !0,
autoLoad: !0,
animateLoad: !0,
includeChildren: !0,
stateKeys: "north.size,south.size,east.size,west.size,north.isClosed,south.isClosed,east.isClosed,west.isClosed,north.isHidden,south.isHidden,east.isHidden,west.isHidden",
cookie: {
name: "",
domain: "",
path: "",
expires: "",
secure: !1
}
}, e.layout.optionsMap.layout.push("stateManagement"), e.layout.state = {
saveCookie: function(t, n, i) {
var o = t.options, r = o.stateManagement, s = e.extend(!0, {}, r.cookie, i || null), a = t.state.stateData = t.readState(n || r.stateKeys);
return e.ui.cookie.write(s.name || o.name || "Layout", e.layout.state.encodeJSON(a), s),
e.extend(!0, {}, a);
},
deleteCookie: function(t) {
var n = t.options;
e.ui.cookie.clear(n.stateManagement.cookie.name || n.name || "Layout");
},
readCookie: function(t) {
var n = t.options, i = e.ui.cookie.read(n.stateManagement.cookie.name || n.name || "Layout");
return i ? e.layout.state.decodeJSON(i) : {};
},
loadCookie: function(t) {
var n = e.layout.state.readCookie(t);
return n && (t.state.stateData = e.extend(!0, {}, n), t.loadState(n)), n;
},
loadState: function(t, n, i) {
if (e.isPlainObject(n) && !e.isEmptyObject(n)) {
n = t.state.stateData = e.layout.transformData(n);
var o = t.options.stateManagement;
if (i = e.extend({
animateLoad: !1,
includeChildren: o.includeChildren
}, i), t.state.initialized) {
var r, a, l, c, u, d = !i.animateLoad;
if (e.each(e.layout.config.borderPanes, function(i, o) {
r = n[o], e.isPlainObject(r) && (s = r.size, a = r.initClosed, l = r.initHidden,
ar = r.autoResize, c = t.state[o], u = c.isVisible, ar && (c.autoResize = ar), u || t._sizePane(o, s, !1, !1, !1),
l === !0 ? t.hide(o, d) : a === !0 ? t.close(o, !1, d) : a === !1 ? t.open(o, !1, d) : l === !1 && t.show(o, !1, d),
u && t._sizePane(o, s, !1, !1, d));
}), i.includeChildren) {
var h, p;
e.each(t.children, function(t, i) {
h = n[t] ? n[t].children : 0, h && i && e.each(i, function(e, t) {
p = h[e], t && p && t.loadState(p);
});
});
}
} else {
var r = e.extend(!0, {}, n);
e.each(e.layout.config.allPanes, function(e, t) {
r[t] && delete r[t].children;
}), e.extend(!0, t.options, r);
}
}
},
readState: function(t, n) {
"string" === e.type(n) && (n = {
keys: n
}), n || (n = {});
var i, o, r, s, a, l, c, u = t.options.stateManagement, d = n.includeChildren, h = void 0 !== d ? d : u.includeChildren, p = n.stateKeys || u.stateKeys, f = {
isClosed: "initClosed",
isHidden: "initHidden"
}, g = t.state, m = e.layout.config.allPanes, v = {};
e.isArray(p) && (p = p.join(",")), p = p.replace(/__/g, ".").split(",");
for (var b = 0, y = p.length; y > b; b++) i = p[b].split("."), o = i[0], r = i[1],
e.inArray(o, m) < 0 || (s = g[o][r], void 0 != s && ("isClosed" == r && g[o].isSliding && (s = !0),
(v[o] || (v[o] = {}))[f[r] ? f[r] : r] = s));
return h && e.each(m, function(n, i) {
l = t.children[i], a = g.stateData[i], e.isPlainObject(l) && !e.isEmptyObject(l) && (c = v[i] || (v[i] = {}),
c.children || (c.children = {}), e.each(l, function(t, n) {
n.state.initialized ? c.children[t] = e.layout.state.readState(n) : a && a.children && a.children[t] && (c.children[t] = e.extend(!0, {}, a.children[t]));
}));
}), v;
},
encodeJSON: function(t) {
function n(t) {
var i, o, r, s = [], a = 0, l = e.isArray(t);
for (i in t) o = t[i], r = typeof o, "string" == r ? o = '"' + o + '"' : "object" == r && (o = n(o)),
s[a++] = (l ? "" : '"' + i + '":') + o;
return (l ? "[" : "{") + s.join(",") + (l ? "]" : "}");
}
return n(t);
},
decodeJSON: function(t) {
try {
return e.parseJSON ? e.parseJSON(t) : window.eval("(" + t + ")") || {};
} catch (n) {
return {};
}
},
_create: function(t) {
var n = e.layout.state, i = t.options, o = i.stateManagement;
if (e.extend(t, {
readCookie: function() {
return n.readCookie(t);
},
deleteCookie: function() {
n.deleteCookie(t);
},
saveCookie: function(e, i) {
return n.saveCookie(t, e, i);
},
loadCookie: function() {
return n.loadCookie(t);
},
loadState: function(e, i) {
n.loadState(t, e, i);
},
readState: function(e) {
return n.readState(t, e);
},
encodeJSON: n.encodeJSON,
decodeJSON: n.decodeJSON
}), t.state.stateData = {}, o.autoLoad) if (e.isPlainObject(o.autoLoad)) e.isEmptyObject(o.autoLoad) || t.loadState(o.autoLoad); else if (o.enabled) if (e.isFunction(o.autoLoad)) {
var r = {};
try {
r = o.autoLoad(t, t.state, t.options, t.options.name || "");
} catch (s) {}
r && e.isPlainObject(r) && !e.isEmptyObject(r) && t.loadState(r);
} else t.loadCookie();
},
_unload: function(t) {
var n = t.options.stateManagement;
if (n.enabled && n.autoSave) if (e.isFunction(n.autoSave)) try {
n.autoSave(t, t.state, t.options, t.options.name || "");
} catch (i) {} else t.saveCookie();
}
}, e.layout.onCreate.push(e.layout.state._create), e.layout.onUnload.push(e.layout.state._unload),
e.layout.plugins.buttons = !0, e.layout.defaults.autoBindCustomButtons = !1, e.layout.optionsMap.layout.push("autoBindCustomButtons"),
e.layout.buttons = {
init: function(t) {
var n, i = "ui-layout-button-", o = t.options.name || "";
e.each("toggle,open,close,pin,toggle-slide,open-slide".split(","), function(r, s) {
e.each(e.layout.config.borderPanes, function(r, a) {
e("." + i + s + "-" + a).each(function() {
n = e(this).data("layoutName") || e(this).attr("layoutName"), (void 0 == n || n === o) && t.bindButton(this, s, a);
});
});
});
},
get: function(t, n, i, o) {
var r = e(n), s = t.options, a = s.errors.addButtonError;
if (r.length) if (e.inArray(i, e.layout.config.borderPanes) < 0) e.layout.msg(a + " " + s.errors.pane + ": " + i, !0),
r = e(""); else {
var l = s[i].buttonClass + "-" + o;
r.addClass(l + " " + l + "-" + i).data("layoutName", s.name);
} else e.layout.msg(a + " " + s.errors.selector + ": " + n, !0);
return r;
},
bind: function(t, n, i, o) {
var r = e.layout.buttons;
switch (i.toLowerCase()) {
case "toggle":
r.addToggle(t, n, o);
break;
case "open":
r.addOpen(t, n, o);
break;
case "close":
r.addClose(t, n, o);
break;
case "pin":
r.addPin(t, n, o);
break;
case "toggle-slide":
r.addToggle(t, n, o, !0);
break;
case "open-slide":
r.addOpen(t, n, o, !0);
}
return t;
},
addToggle: function(t, n, i, o) {
return e.layout.buttons.get(t, n, i, "toggle").click(function(e) {
t.toggle(i, !!o), e.stopPropagation();
}), t;
},
addOpen: function(t, n, i, o) {
return e.layout.buttons.get(t, n, i, "open").attr("title", t.options[i].tips.Open).click(function(e) {
t.open(i, !!o), e.stopPropagation();
}), t;
},
addClose: function(t, n, i) {
return e.layout.buttons.get(t, n, i, "close").attr("title", t.options[i].tips.Close).click(function(e) {
t.close(i), e.stopPropagation();
}), t;
},
addPin: function(t, n, i) {
var o = e.layout.buttons, r = o.get(t, n, i, "pin");
if (r.length) {
var s = t.state[i];
r.click(function(n) {
o.setPinState(t, e(this), i, s.isSliding || s.isClosed), s.isSliding || s.isClosed ? t.open(i) : t.close(i),
n.stopPropagation();
}), o.setPinState(t, r, i, !s.isClosed && !s.isSliding), s.pins.push(n);
}
return t;
},
setPinState: function(e, t, n, i) {
var o = t.attr("pin");
if (!o || i !== ("down" == o)) {
var r = e.options[n], s = r.buttonClass + "-pin", a = s + "-" + n, l = s + "-up " + a + "-up", c = s + "-down " + a + "-down";
t.attr("pin", i ? "down" : "up").attr("title", i ? r.tips.Unpin : r.tips.Pin).removeClass(i ? l : c).addClass(i ? c : l);
}
},
syncPinBtns: function(t, n, i) {
e.each(t.state[n].pins, function(o, r) {
e.layout.buttons.setPinState(t, e(r), n, i);
});
},
_load: function(t) {
var n = e.layout.buttons;
e.extend(t, {
bindButton: function(e, i, o) {
return n.bind(t, e, i, o);
},
addToggleBtn: function(e, i, o) {
return n.addToggle(t, e, i, o);
},
addOpenBtn: function(e, i, o) {
return n.addOpen(t, e, i, o);
},
addCloseBtn: function(e, i) {
return n.addClose(t, e, i);
},
addPinBtn: function(e, i) {
return n.addPin(t, e, i);
}
});
for (var i = 0; 4 > i; i++) {
var o = e.layout.config.borderPanes[i];
t.state[o].pins = [];
}
t.options.autoBindCustomButtons && n.init(t);
},
_unload: function() {}
}, e.layout.onLoad.push(e.layout.buttons._load), e.layout.plugins.browserZoom = !0,
e.layout.defaults.browserZoomCheckInterval = 1e3, e.layout.optionsMap.layout.push("browserZoomCheckInterval"),
e.layout.browserZoom = {
_init: function(t) {
e.layout.browserZoom.ratio() !== !1 && e.layout.browserZoom._setTimer(t);
},
_setTimer: function(t) {
if (!t.destroyed) {
var n = t.options, i = t.state, o = t.hasParentLayout ? 5e3 : Math.max(n.browserZoomCheckInterval, 100);
setTimeout(function() {
if (!t.destroyed && n.resizeWithWindow) {
var o = e.layout.browserZoom.ratio();
o !== i.browserZoom && (i.browserZoom = o, t.resizeAll()), e.layout.browserZoom._setTimer(t);
}
}, o);
}
},
ratio: function() {
function t(e, t) {
return (100 * (parseInt(e, 10) / parseInt(t, 10))).toFixed();
}
var n, i, o, r = window, s = screen, a = document, l = a.documentElement || a.body, c = e.layout.browser, u = c.version;
return c.msie && u > 8 || !c.msie ? !1 : s.deviceXDPI && s.systemXDPI ? t(s.deviceXDPI, s.systemXDPI) : c.webkit && (n = a.body.getBoundingClientRect) ? t(n.left - n.right, a.body.offsetWidth) : c.webkit && (i = r.outerWidth) ? t(i, r.innerWidth) : (i = s.width) && (o = l.clientWidth) ? t(i, o) : !1;
}
}, e.layout.onReady.push(e.layout.browserZoom._init);
}(jQuery), define("uilayout", function() {}), define("libs/ace_mode_highlight_rules", [ "require", "exports", "module", "ace/lib/oop", "ace/mode/text_highlight_rules" ], function(e, t) {
var n = e("ace/lib/oop"), i = e("ace/mode/text_highlight_rules").TextHighlightRules, o = function() {
this.$rules = {
basic: [ {
token: "constant.language.escape",
regex: /\\[\\`*_{}\[\]()#+\-.!]/
}, {
token: "code",
regex: "(`+)(.*?[^`])(\\1)"
}, {
token: [ "text", "reference", "text", "markup.underline", "description", "text" ],
regex: '^([ ]{0,3}\\[)([^\\]]+)(\\]:\\s*)([^ ]+)(\\s*(?:["][^"]+["])?(\\s*))$'
}, {
token: [ "text", "description", "text", "markup.underline", "text" ],
regex: "(\\[)((?:[[^\\]]*\\]|[^\\[\\]])*)(\\][ ]?(?:\\n[ ]*)?\\[)(.*?)(\\])"
}, {
token: [ "text", "description", "text", "markup.underline", "string", "text" ],
regex: '(\\[)(\\[[^\\]]*\\]|[^\\[\\]]*)(\\]\\([ \\t]*)(<?(?:(?:[^\\(]*?\\([^\\)]*?\\)\\S*?)|(?:.*?))>?)((?:[ ]*"(?:.*?)"[ \\t]*)?)(\\))'
}, {
token: "strong",
regex: "([*]{2}|[_]{2}(?=\\S))(.*?\\S[*_]*)(\\1)"
}, {
token: "emphasis",
regex: "([*]|[_](?=\\S))(.*?\\S[*_]*)(\\1)"
}, {
token: [ "text", "url", "text" ],
regex: "(<)((?:https?|ftp|dict):[^'\">\\s]+|(?:mailto:)?[-.\\w]+\\@[-a-z0-9]+(?:\\.[-a-z0-9]+)*\\.[a-z]+)(>)"
} ],
allowBlock: [ {
token: [ "text", "code_block" ],
regex: "^( {4}|\\t)(.+)",
next: "allowBlock"
}, {
token: "empty",
regex: "",
next: "start"
} ],
start: [ {
token: "empty_line",
regex: "^$",
next: "allowBlock"
}, {
token: "markup.heading.multi.1",
regex: "^=+(?=\\s*$)"
}, {
token: "markup.heading.multi.2",
regex: "^\\-+(?=\\s*$)"
}, {
token: function(e) {
return "markup.heading." + e.length;
},
regex: /^#{1,6}(?=\s*[^ #]|\s+#.)/,
next: "header"
}, {
token: "code_block",
regex: "^```\\s*[a-zA-Z]*(?:{.*?\\})?\\s*$",
next: "githubblock"
}, {
token: "blockquote",
regex: "^\\s*>[ ].+$",
next: "blockquote"
}, {
token: "constant",
regex: "^ {0,2}(?:(?: ?\\* ?){3,}|(?: ?\\- ?){3,}|(?: ?\\_ ?){3,})\\s*$",
next: "allowBlock"
}, {
token: "markup.list",
regex: "^\\s{0,3}(?:[*+-]|\\d+\\.)\\s+",
next: "listblock-start"
}, {
include: "basic"
} ],
header: [ {
regex: "$",
next: "start"
}, {
include: "basic"
}, {
defaultToken: "markup.heading"
} ],
"listblock-start": [ {
token: "checkbox",
regex: /(?:\[[ x]\])?/,
next: "listblock"
} ],
listblock: [ {
token: "empty_line",
regex: "^$",
next: "start"
}, {
token: "markup.list",
regex: "^\\s{0,3}(?:[*+-]|\\d+\\.)\\s+",
next: "listblock-start"
}, {
include: "basic",
noEscape: !0
}, {
defaultToken: "markup.list"
} ],
blockquote: [ {
token: "empty_line",
regex: "^\\s*$",
next: "start"
}, {
token: "blockquote",
regex: ".+"
} ],
githubblock: [ {
token: "code_block",
regex: "^```",
next: "start"
}, {
token: "code_block",
regex: ".+"
} ]
}, this.normalizeRules();
};
n.inherits(o, i), t.MarkdownHighlightRules = o;
}), define("ace/mode/folding/markdown", [ "require", "exports", "module", "../../lib/oop", "./fold_mode", "../../range" ], function(e, t) {
var n = e("../../lib/oop"), i = e("./fold_mode").FoldMode, o = e("../../range").Range, r = t.FoldMode = function() {};
n.inherits(r, i), function() {
this.foldingStartMarker = /^(?:[=-]+\s*$|#{1,6} |`{3})/, this.getFoldWidget = function(e, t, n) {
var i = e.getLine(n);
return this.foldingStartMarker.test(i) ? "`" == i[0] ? "start" == e.bgTokenizer.getState(n) ? "end" : "start" : "start" : "";
}, this.getFoldWidgetRange = function(e, t, n) {
function i(t) {
return d = e.getTokens(t)[0], d && 0 === d.type.lastIndexOf(h, 0);
}
function r() {
var e = d.value[0];
return "=" == e ? 6 : "-" == e ? 5 : 7 - d.value.search(/[^#]/);
}
var s = e.getLine(n), a = s.length, l = e.getLength(), c = n, u = n;
if (s.match(this.foldingStartMarker)) {
if ("`" == s[0]) {
if ("start" !== e.bgTokenizer.getState(n)) {
for (;++n < l && (s = e.getLine(n), !("`" == s[0] & "```" == s.substring(0, 3))); ) ;
return new o(c, a, n, 0);
}
for (;n-- > 0 && (s = e.getLine(n), !("`" == s[0] & "```" == s.substring(0, 3))); ) ;
return new o(n, s.length, c, 0);
}
var d, h = "markup.heading";
if (i(n)) {
for (var p = r(); ++n < l; ) if (i(n)) {
var f = r();
if (f >= p) break;
}
if (u = n - (d && -1 != [ "=", "-" ].indexOf(d.value[0]) ? 2 : 1), u > c) for (;u > c && /^\s*$/.test(e.getLine(u)); ) u--;
if (u > c) {
var g = e.getLine(u).length;
return new o(c, a, u, g);
}
}
}
};
}.call(r.prototype);
}), define("libs/ace_mode", [ "require", "exports", "module", "ace/lib/oop", "ace/mode/text", "ace/tokenizer", "./ace_mode_highlight_rules", "ace/mode/folding/markdown" ], function(e, t) {
var n = e("ace/lib/oop"), i = e("ace/mode/text").Mode, o = e("ace/tokenizer").Tokenizer, r = e("./ace_mode_highlight_rules").MarkdownHighlightRules, s = e("ace/mode/folding/markdown").FoldMode, a = function() {
var e = new r();
this.$tokenizer = new o(e.getRules()), this.$embeds = e.getEmbeds(), this.foldingRules = new s();
};
n.inherits(a, i), function() {
this.type = "text", this.lineCommentStart = ">", this.getNextLineIndent = function(e, t) {
if ("listblock" == e) {
var n = /^(\s*)(?:([-+*])|(\d+)\.)(\s+)/.exec(t);
if (!n) return "";
var i = n[2];
return i || (i = parseInt(n[3], 10) + 1 + "."), n[1] + i + n[4];
}
return this.$getIndent(t);
};
}.call(a.prototype), t.Mode = a;
}), define("ace/ext/spellcheck", [ "require", "exports", "module", "../lib/event", "../editor", "../config" ], function(e, t) {
var n = e("../lib/event");
t.contextMenuHandler = function(e) {
var t = e.target, i = t.textInput.getElement();
if (t.selection.isEmpty()) {
var o = t.getCursorPosition(), r = t.session.getWordRange(o.row, o.column), s = t.session.getTextRange(r);
if (t.session.tokenRe.lastIndex = 0, t.session.tokenRe.test(s)) {
var a = "", l = s + " " + a;
i.value = l, i.setSelectionRange(s.length + 1, s.length + 1), i.setSelectionRange(0, 0);
var c = !1;
n.addListener(i, "keydown", function u() {
n.removeListener(i, "keydown", u), c = !0;
}), t.textInput.setInputHandler(function(e) {
if (console.log(e, l, i.selectionStart, i.selectionEnd), e == l) return "";
if (0 === e.lastIndexOf(l, 0)) return e.slice(l.length);
if (e.substr(i.selectionEnd) == l) return e.slice(0, -l.length);
if (e.slice(-2) == a) {
var n = e.slice(0, -2);
if (" " == n.slice(-1)) return c ? n.substring(0, i.selectionEnd) : (n = n.slice(0, -1),
t.session.replace(r, n), "");
}
return e;
});
}
}
};
var i = e("../editor").Editor;
e("../config").defineOptions(i.prototype, "editor", {
spellcheck: {
set: function(e) {
var n = this.textInput.getElement();
n.spellcheck = !!e, e ? this.on("nativecontextmenu", t.contextMenuHandler) : this.removeListener("nativecontextmenu", t.contextMenuHandler);
},
value: !0
}
});
}), define("ace/ext/searchbox", [ "require", "exports", "module", "../lib/dom", "../lib/lang", "../lib/event", "../requirejs/text!./searchbox.css", "../keyboard/hash_handler", "../lib/keys" ], function(e, t) {
var n = e("../lib/dom"), i = e("../lib/lang"), o = e("../lib/event"), r = e("../requirejs/text!./searchbox.css"), s = e("../keyboard/hash_handler").HashHandler, a = e("../lib/keys");
n.importCssString(r, "ace_searchbox");
var l = '<div class="ace_search right"> <button type="button" action="hide" class="ace_searchbtn_close"></button> <div class="ace_search_form"> <input class="ace_search_field" placeholder="Search for" spellcheck="false"></input> <button type="button" action="findNext" class="ace_searchbtn next"></button> <button type="button" action="findPrev" class="ace_searchbtn prev"></button> </div> <div class="ace_replace_form"> <input class="ace_search_field" placeholder="Replace with" spellcheck="false"></input> <button type="button" action="replaceAndFindNext" class="ace_replacebtn">Replace</button> <button type="button" action="replaceAll" class="ace_replacebtn">All</button> </div> <div class="ace_search_options"> <span action="toggleRegexpMode" class="ace_button" title="RegExp Search">.*</span> <span action="toggleCaseSensitive" class="ace_button" title="CaseSensitive Search">Aa</span> <span action="toggleWholeWords" class="ace_button" title="Whole Word Search">\\b</span> </div></div>'.replace(/>\s+/g, ">"), c = function(e) {
var t = n.createElement("div");
t.innerHTML = l, this.element = t.firstChild, this.$init(), this.setEditor(e);
};
(function() {
this.setEditor = function(e) {
e.searchBox = this, e.container.appendChild(this.element), this.editor = e;
}, this.$initElements = function(e) {
this.searchBox = e.querySelector(".ace_search_form"), this.replaceBox = e.querySelector(".ace_replace_form"),
this.searchOptions = e.querySelector(".ace_search_options"), this.regExpOption = e.querySelector("[action=toggleRegexpMode]"),
this.caseSensitiveOption = e.querySelector("[action=toggleCaseSensitive]"), this.wholeWordOption = e.querySelector("[action=toggleWholeWords]"),
this.searchInput = this.searchBox.querySelector(".ace_search_field"), this.replaceInput = this.replaceBox.querySelector(".ace_search_field");
}, this.$init = function() {
var e = this.element;
this.$initElements(e);
var t = this;
o.addListener(e, "mousedown", function(e) {
setTimeout(function() {
t.activeInput.focus();
}, 0), o.stopPropagation(e);
}), o.addListener(e, "click", function(e) {
var n = e.target || e.srcElement, i = n.getAttribute("action");
i && t[i] ? t[i]() : t.$searchBarKb.commands[i] && t.$searchBarKb.commands[i].exec(t),
o.stopPropagation(e);
}), o.addCommandKeyListener(e, function(e, n, i) {
var r = a.keyCodeToString(i), s = t.$searchBarKb.findKeyCommand(n, r);
s && s.exec && (s.exec(t), o.stopEvent(e));
}), this.$onChange = i.delayedCall(function() {
t.find(!1, !1);
}), o.addListener(this.searchInput, "input", function() {
t.$onChange.schedule(20);
}), o.addListener(this.searchInput, "focus", function() {
t.activeInput = t.searchInput, t.searchInput.value && t.highlight();
}), o.addListener(this.replaceInput, "focus", function() {
t.activeInput = t.replaceInput, t.searchInput.value && t.highlight();
});
}, this.$closeSearchBarKb = new s([ {
bindKey: "Esc",
name: "closeSearchBar",
exec: function(e) {
e.searchBox.hide();
}
} ]), this.$searchBarKb = new s(), this.$searchBarKb.bindKeys({
"Ctrl-f|Command-f|Ctrl-H|Command-Option-F": function(e) {
var t = e.isReplace = !e.isReplace;
e.replaceBox.style.display = t ? "" : "none", e[t ? "replaceInput" : "searchInput"].focus();
},
"Ctrl-G|Command-G": function(e) {
e.findNext();
},
"Ctrl-Shift-G|Command-Shift-G": function(e) {
e.findPrev();
},
esc: function(e) {
setTimeout(function() {
e.hide();
});
},
Return: function(e) {
e.activeInput == e.replaceInput && e.replace(), e.findNext();
},
"Shift-Return": function(e) {
e.activeInput == e.replaceInput && e.replace(), e.findPrev();
},
Tab: function(e) {
(e.activeInput == e.replaceInput ? e.searchInput : e.replaceInput).focus();
}
}), this.$searchBarKb.addCommands([ {
name: "toggleRegexpMode",
bindKey: {
win: "Alt-R|Alt-/",
mac: "Ctrl-Alt-R|Ctrl-Alt-/"
},
exec: function(e) {
e.regExpOption.checked = !e.regExpOption.checked, e.$syncOptions();
}
}, {
name: "toggleCaseSensitive",
bindKey: {
win: "Alt-C|Alt-I",
mac: "Ctrl-Alt-R|Ctrl-Alt-I"
},
exec: function(e) {
e.caseSensitiveOption.checked = !e.caseSensitiveOption.checked, e.$syncOptions();
}
}, {
name: "toggleWholeWords",
bindKey: {
win: "Alt-B|Alt-W",
mac: "Ctrl-Alt-B|Ctrl-Alt-W"
},
exec: function(e) {
e.wholeWordOption.checked = !e.wholeWordOption.checked, e.$syncOptions();
}
} ]), this.$syncOptions = function() {
n.setCssClass(this.regExpOption, "checked", this.regExpOption.checked), n.setCssClass(this.wholeWordOption, "checked", this.wholeWordOption.checked),
n.setCssClass(this.caseSensitiveOption, "checked", this.caseSensitiveOption.checked),
this.find(!1, !1);
}, this.highlight = function(e) {
this.editor.session.highlight(e || this.editor.$search.$options.re), this.editor.renderer.updateBackMarkers();
}, this.find = function(e, t) {
var i = this.editor.find(this.searchInput.value, {
skipCurrent: e,
backwards: t,
wrap: !0,
regExp: this.regExpOption.checked,
caseSensitive: this.caseSensitiveOption.checked,
wholeWord: this.wholeWordOption.checked
}), o = !i && this.searchInput.value;
n.setCssClass(this.searchBox, "ace_nomatch", o), this.editor._emit("findSearchBox", {
match: !o
}), this.highlight();
}, this.findNext = function() {
this.find(!0, !1);
}, this.findPrev = function() {
this.find(!0, !0);
}, this.replace = function() {
this.editor.getReadOnly() || this.editor.replace(this.replaceInput.value);
}, this.replaceAndFindNext = function() {
this.editor.getReadOnly() || (this.editor.replace(this.replaceInput.value), this.findNext());
}, this.replaceAll = function() {
this.editor.getReadOnly() || this.editor.replaceAll(this.replaceInput.value);
}, this.hide = function() {
this.element.style.display = "none", this.editor.keyBinding.removeKeyboardHandler(this.$closeSearchBarKb),
this.editor.focus();
}, this.show = function(e, t) {
this.element.style.display = "", this.replaceBox.style.display = t ? "" : "none",
this.isReplace = t, e && (this.searchInput.value = e), this.searchInput.focus(),
this.searchInput.select(), this.editor.keyBinding.addKeyboardHandler(this.$closeSearchBarKb);
};
}).call(c.prototype), t.SearchBox = c, t.Search = function(e, t) {
var n = e.searchBox || new c(e);
n.show(e.session.getTextRange(), t);
};
}), define("core", [ "jquery", "underscore", "crel", "ace", "utils", "settings", "eventMgr", "mousetrap", "text!html/bodyIndex.html", "text!html/bodyViewer.html", "text!html/settingsTemplateTooltip.html", "text!html/settingsUserCustomExtensionTooltip.html", "storage", "config", "uilayout", "pagedown-ace", "libs/ace_mode", "ace/requirejs/text!ace/css/editor.css", "ace/requirejs/text!ace/theme/textmate.css", "ace/ext/spellcheck", "ace/ext/searchbox" ], function(e, t, n, i, o, r, s, a, l, c, u, d) {
function h() {
A = !0, k = !0;
var e = o.currentTime;
e > _ + 1e3 && (_ = e, s.onUserActive());
}
function p() {
return k === !0 && o.currentTime - _ > USER_IDLE_THRESHOLD && (k = !1), k && F;
}
function f() {
if (A !== !1 && F !== !1) {
void 0 === $ && ($ = o.randomString(), localStorage.frontWindowId = $);
var t = localStorage.frontWindowId;
t != $ && (F = !1, void 0 !== S && clearInterval(S), e(".modal").modal("hide"),
e(".modal-non-unique").modal("show"));
}
}
function g() {
T === !0 && (T = !1, s.onOfflineChanged(!1));
}
function m() {
T === !0 && navigator.onLine === !0 && D + CHECK_ONLINE_PERIOD < o.currentTime && (D = o.currentTime,
e.ajax({
url: "//www.google.com/jsapi",
timeout: AJAX_TIMEOUT,
dataType: "script"
}).done(function() {
g();
}));
}
function v() {
o.setInputRadio("radio-layout-orientation", r.layoutOrientation), o.setInputValue(L, theme),
L.change(), o.setInputChecked("#input-settings-lazy-rendering", r.lazyRendering),
o.setInputValue("#input-settings-editor-font-family", r.editorFontFamily), o.setInputValue("#input-settings-editor-font-size", r.editorFontSize),
o.setInputValue("#input-settings-max-width", r.maxWidth), o.setInputValue("#textarea-settings-default-content", r.defaultContent),
o.setInputValue("#input-settings-publish-commit-msg", r.commitMsg), o.setInputValue("#textarea-settings-publish-template", r.template),
o.setInputValue("#input-settings-ssh-proxy", r.sshProxy), s.onLoadSettings();
}
function b(t) {
var n = {};
n.layoutOrientation = o.getInputRadio("radio-layout-orientation");
var i = o.getInputValue(L);
n.lazyRendering = o.getInputChecked("#input-settings-lazy-rendering"), n.editorFontFamily = o.getInputTextValue("#input-settings-editor-font-family", t),
n.editorFontSize = o.getInputIntValue("#input-settings-editor-font-size", t, 1, 99),
n.maxWidth = o.getInputIntValue("#input-settings-max-width", t, 1), n.defaultContent = o.getInputValue("#textarea-settings-default-content"),
n.commitMsg = o.getInputTextValue("#input-settings-publish-commit-msg", t), n.template = o.getInputTextValue("#textarea-settings-publish-template", t),
n.sshProxy = o.checkUrl(o.getInputTextValue("#input-settings-ssh-proxy", t), !0),
n.extensionSettings = {}, s.onSaveSettings(n.extensionSettings, t), t.isPropagationStopped() || (e.extend(r, n),
localStorage.settings = JSON.stringify(r), localStorage.theme = i);
}
function y(e) {
e === !0 || B.state.north.isClosed ? (M.hide(), R.hide()) : (M.show(), R.show());
}
function w(e) {
e === !0 || B.state.east.isClosed ? I.hide() : I.show();
}
function C() {
return lightMode ? (e("#wmd-input").replaceWith(function() {
return e('<textarea id="wmd-input">').addClass(this.className).addClass("form-control");
}), void 0) : (P = i.edit("wmd-input"), require("ace/ext/spellcheck"), P.setOption("spellcheck", !0),
P.renderer.setShowGutter(!1), P.renderer.setPrintMarginColumn(!1), P.renderer.setPadding(EDITOR_DEFAULT_PADDING),
P.session.setUseWrapMode(!0), P.session.setNewLineMode("unix"), P.session.setMode("libs/ace_mode"),
function(e) {
function n(n) {
var i = e.lines[n];
0 !== i.length && 0 === i[0].type.indexOf("markup.heading.multi") && t.each(e.lines[n - 1], function(e) {
e.type = "markup.heading.prev.multi";
});
}
function i() {
if (e.running) {
for (var t = new Date(), o = e.currentLine, r = -1, s = e.doc; e.lines[o]; ) o++;
var a = o, l = s.getLength(), c = 0;
for (e.running = !1; l > o; ) {
e.$tokenizeRow(o), r = o;
do n(o), o++; while (e.lines[o]);
if (c++, 0 == c % 5 && new Date() - t > 20) return e.running = setTimeout(i, 20),
e.currentLine = o, void 0;
}
e.currentLine = o, r >= a && e.fireUpdateEvent(a, r);
}
}
e.$worker = function() {
e.lines.splice(0, e.lines.length), e.states.splice(0, e.states.length), e.currentLine = 0,
i();
};
}(P.session.bgTokenizer), s.onAceCreated(P), void 0);
}
function x() {
var t = {
closable: !0,
resizable: !1,
slidable: !1,
livePaneResizing: !0,
enableCursorHotkey: !1,
resizerDblClickToggle: !1,
north__spacing_open: 6,
north__spacing_closed: 6,
spacing_open: 35,
spacing_closed: 35,
togglerLength_open: 60,
togglerLength_closed: 60,
stateManagement__enabled: !1,
center__minWidth: 200,
center__minHeight: 200,
onopen: function() {
y(), w();
},
onclose_start: function(e) {
"north" == e ? y(!0) : "east" == e && w(!0);
},
onresize_end: function(e) {
if (void 0 !== P && "center" == e) {
P.resize();
var t = (P.renderer.$size.scrollerHeight - P.renderer.lineHeight) / 2;
0 > t && (t = 0), P.renderer.setScrollMargin(0, t, 0, 0), setTimeout(function() {
var e = (P.renderer.$size.scrollerWidth - r.maxWidth) / 2;
EDITOR_DEFAULT_PADDING > e && (e = EDITOR_DEFAULT_PADDING), e !== P.renderer.$padding && (P.renderer.setPadding(e),
P.resize(!0));
}, 5);
}
s.onLayoutResize(e);
}
};
s.onLayoutConfigure(t), "horizontal" == r.layoutOrientation ? (e(".ui-layout-south").remove(),
e(".preview-container").html('<div id="preview-contents"><div id="wmd-preview" class="preview-content"></div></div>'),
B = e("body").layout(e.extend(t, {
east__resizable: !0,
east__size: .5,
east__minSize: 260
}))) : "vertical" == r.layoutOrientation && (e(".ui-layout-east").remove(), e(".preview-container").html('<div id="preview-contents"><div id="wmd-preview" class="preview-content"></div></div>'),
B = e("body").layout(e.extend(t, {
south__resizable: !0,
south__size: .5,
south__minSize: 200
}))), r.maxWidth && e("#preview-contents").css("max-width", r.maxWidth + 30 + "px"),
e(".navbar").click(function() {
B.allowOverflow("north");
}), e(".ui-layout-toggler-south").addClass("btn btn-info").html('<i class="icon-none"></i>'),
e(".ui-layout-toggler-east").addClass("btn btn-info").html('<i class="icon-none"></i>');
var n = e(".ui-layout-toggler-north").addClass("btn btn-info").html('<i class="icon-none"></i>');
$resizerDecorator = e('<div class="resizer-decorator">'), I = e('<div class="extension-preview-buttons">'),
$editorButtonsElt = e('<div class="extension-editor-buttons">'), viewerMode || "horizontal" == r.layoutOrientation ? (e(".ui-layout-resizer-north").append($resizerDecorator).append(I),
e(".ui-layout-resizer-east").append(n).append($editorButtonsElt)) : (e(".ui-layout-resizer-north").append($resizerDecorator),
e(".ui-layout-resizer-south").append(I).append($editorButtonsElt).append(n)), y(),
w(), s.onLayoutCreated(B);
}
var E = {}, S = void 0, A = !1, k = !1, F = !0, _ = 0, $ = void 0, T = !1, D = o.currentTime;
E.setOffline = function() {
D = o.currentTime, T === !1 && (T = !0, s.onOfflineChanged(!0));
};
var L = void 0, B = void 0, M = void 0, R = void 0, I = void 0, P = void 0, N = void 0, O = void 0, z = void 0, j = void 0, H = require("ace/undomanager").UndoManager;
E.initEditor = function(n) {
function i() {
var e = O.val();
void 0 !== P && (e = P.getValue()), void 0 !== j && j != e && (z.content = e, s.onContentChanged(z)),
j = e;
}
function a() {
var e = O.val();
e = h.makeHtml(e), p.html(e), f.onPreviewRefresh();
}
void 0 !== z && s.onFileClosed(z), z = n, j = void 0;
var l = z.content;
if (void 0 !== P ? (P.setValue(l, -1), P.getSession().setUndoManager(new H())) : O.val(l),
void 0 !== N) return P && P.selection.setSelectionRange(z.editorSelectRange), P && P.focus() || O.focus(),
N.refreshPreview(), void 0;
var c = e(".preview-container");
if (!lightMode) {
var u = t.debounce(function() {
void 0 !== j && (z.editorScrollTop = P.renderer.getScrollTop());
}, 100);
P.session.on("changeScrollTop", u);
var d = t.debounce(function() {
void 0 !== j && (z.editorSelectRange = P.getSelectionRange());
}, 100);
P.session.selection.on("changeSelection", d), P.session.selection.on("changeCursor", d),
c.scroll(function() {
void 0 !== j && (z.previewScrollTop = c.scrollTop());
});
}
var h = new Markdown.Converter();
if (lightMode) {
var p = e("#wmd-preview"), f = new Markdown.HookCollection();
f.addNoop("onPreviewRefresh");
var g = t.debounce(a, 1e3), m = function() {
void 0 === j ? (a(), s.onFileOpen(z)) : g(), i();
};
O.on("input propertychange", m), N = {
hooks: f,
getConverter: function() {
return h;
},
run: m,
refreshPreview: m
};
} else N = new Markdown.Editor(h), N.hooks.set("insertLinkDialog", function(t) {
return E.insertLinkCallback = t, o.resetModalInputs(), e(".modal-insert-link").modal(),
!0;
}), N.hooks.set("insertImageDialog", function(t) {
return E.insertLinkCallback = t, E.catchModal ? !0 : (o.resetModalInputs(), e(".modal-insert-image").modal(),
!0);
});
var m;
m = r.lazyRendering === !0 ? function(e) {
var n = t.debounce(e, 500);
return function() {
void 0 === j ? (e(), s.onFileOpen(z), c.scrollTop(z.previewScrollTop), t.defer(function() {
P.renderer.scrollToY(z.editorScrollTop);
})) : n(), i();
};
} : function(e) {
return function() {
e(), void 0 === j && (s.onFileOpen(z), c.scrollTop(z.previewScrollTop), t.defer(function() {
P.renderer.scrollToY(z.editorScrollTop);
})), i();
};
}, s.onPagedownConfigure(N), N.hooks.chain("onPreviewRefresh", s.onAsyncPreview),
N.run(P, m), P && P.selection.setSelectionRange(z.editorSelectRange), P && P.focus() || O.focus(),
e(".wmd-button-row li").addClass("btn btn-success").css("left", 0).find("span").hide();
var v = e(".wmd-button-group1");
e("#wmd-bold-button").append(e('<i class="icon-bold">')).appendTo(v), e("#wmd-italic-button").append(e('<i class="icon-italic">')).appendTo(v);
var v = e(".wmd-button-group2");
e("#wmd-link-button").append(e('<i class="icon-globe">')).appendTo(v), e("#wmd-quote-button").append(e('<i class="icon-indent-right">')).appendTo(v),
e("#wmd-code-button").append(e('<i class="icon-code">')).appendTo(v), e("#wmd-image-button").append(e('<i class="icon-picture">')).appendTo(v);
var v = e(".wmd-button-group3");
e("#wmd-olist-button").append(e('<i class="icon-list-numbered">')).appendTo(v),
e("#wmd-ulist-button").append(e('<i class="icon-list-bullet">')).appendTo(v), e("#wmd-heading-button").append(e('<i class="icon-text-height">')).appendTo(v),
e("#wmd-hr-button").append(e('<i class="icon-ellipsis">')).appendTo(v);
var v = e(".wmd-button-group4");
e("#wmd-undo-button").append(e('<i class="icon-reply">')).appendTo(v), e("#wmd-redo-button").append(e('<i class="icon-forward">')).appendTo(v);
};
var q = !1, W = !1;
return E.onReady = function() {
document.body.innerHTML = viewerMode === !0 ? c : l, e(window).on("offline", E.setOffline),
e(window).on("online", g), navigator.onLine === !1 && E.setOffline(), e(document).mousemove(h).keypress(h),
e(".dropdown-submenu > a").click(function(e) {
e.stopPropagation();
}), M = e(".menu-panel").collapse({
toggle: !1
});
var t = void 0;
M.on("show.bs.collapse", function(e) {
e.target === M[0] ? (W = !0, t = o.createBackdrop("collapse", ".menu-panel"), M.addClass("move-to-front")) : M.find(".in").collapse("hide");
}).on("hide.bs.collapse", function(e) {
e.target === M[0] && (W = !1, t.parentNode.removeChild(t), M.removeClass("move-to-front"),
P && P.focus() || O.focus());
}).on("hidden.bs.collapse", function(e) {
e.target === M[0] && M.find(".in").collapse("hide");
}), R = e(".document-panel").collapse({
toggle: !1
});
var n = void 0;
R.on("show.bs.collapse", function(e) {
e.target === R[0] ? (q = !0, n = o.createBackdrop("collapse", ".document-panel"),
R.addClass("move-to-front")) : R.find(".in").collapse("hide");
}).on("hide.bs.collapse", function(e) {
e.target === R[0] && (q = !1, n.parentNode.removeChild(n), R.removeClass("move-to-front"),
P && P.focus() || O.focus());
}).on("hidden.bs.collapse", function(e) {
e.target === R[0] && R.find(".in").collapse("hide");
}), C(), O = e("#wmd-input").css({
"font-family": r.editorFontFamily,
"font-size": r.editorFontSize + "px",
"line-height": Math.round(r.editorFontSize * (20 / 12)) + "px"
}), O.find(".ace_content").css({
"background-size": "64px " + Math.round(r.editorFontSize * (20 / 12)) + "px"
}), x(), S = window.setInterval(function() {
o.updateCurrentTime(), f(), (p() === !0 || viewerMode === !0) && (s.onPeriodicRun(),
m());
}, 1e3), s.onReady();
}, s.addListener("onReady", function() {
function n(e) {
if (e = e || "default", l != e) {
var t = "less!themes/" + e;
-1 !== baseDir.indexOf("-min") && (t = "css!themes/" + e), requirejs.undef(t), require([ t ]),
l = e;
}
}
viewerMode || "vertical" != r.layoutOrientation || I.css("right", parseInt(I.css("right")) + $editorButtonsElt.width());
var i = !1;
e(".modal").on("show.bs.modal", function() {
M.collapse("hide"), R.collapse("hide"), i = !0;
}).on("shown.bs.modal", function() {
var t = e(this);
setTimeout(function() {
t.find("input:enabled:visible:first").focus();
}, 50);
}).on("hidden.bs.modal", function() {
i = !1, P && P.focus() || O.focus(), n(localStorage.theme);
}).keyup(function(t) {
13 != t.which || e(t.target).is("textarea") || e(this).find(".modal-footer a:last").click();
}), e(".collapse-save-as a").click(function() {
M.collapse("hide");
}), a.stopCallback = function(t, n) {
return W || q || i || e(n).is("input, select, textarea:not(.ace_text-input)");
}, e(".action-insert-link").click(function(t) {
var n = o.getInputTextValue(e("#input-insert-link"), t);
void 0 !== n && (E.insertLinkCallback(n), E.insertLinkCallback = void 0);
}), e(".action-insert-image").click(function(t) {
var n = o.getInputTextValue(e("#input-insert-image"), t);
void 0 !== n && (E.insertLinkCallback(n), E.insertLinkCallback = void 0);
}), e(".modal-insert-link, .modal-insert-image").on("hidden.bs.modal", function() {
void 0 !== E.insertLinkCallback && (E.insertLinkCallback(null), E.insertLinkCallback = void 0);
}), e(".action-load-settings").click(function() {
v();
}), e(".action-apply-settings").click(function(e) {
b(e), e.isPropagationStopped() || window.location.reload();
});
var l = theme;
if (L = e("#input-settings-theme"), L.on("change", function() {
n(this.value);
}), e(".action-import-settings").click(function() {
e("#input-file-import-settings").click();
}), e("#input-file-import-settings").change(function(n) {
var i = (n.dataTransfer || n.target).files;
e(".modal-settings").modal("hide"), t.each(i, function(e) {
var t = new FileReader();
t.onload = function(e) {
return function(t) {
var n = t.target.result;
try {
JSON.parse(n);
} catch (t) {
return s.onError(e.name + " is not a valid JSON file."), void 0;
}
localStorage.settings = n, window.location.reload();
};
}(e);
var n = e.slice(0, IMPORT_FILE_MAX_CONTENT_SIZE);
t.readAsText(n);
});
}), e(".action-export-settings").click(function() {
o.saveAs(JSON.stringify(r), "StackEdit Settings.json");
}), e(".action-default-settings").click(function() {
localStorage.removeItem("settings"), localStorage.removeItem("theme"), window.location.reload();
}), e(".action-app-reset").click(function() {
localStorage.clear(), window.location.reload();
}), e(".action-reset-input").click(function() {
o.resetModalInputs();
}), e(".tooltip-lazy-rendering").tooltip({
container: ".modal-settings",
placement: "right",
trigger: "hover",
title: "Disable preview rendering while typing in order to offload CPU. Refresh preview after 500 ms of inactivity."
}), e(".tooltip-default-content").tooltip({
html: !0,
container: ".modal-settings",
placement: "right",
trigger: "hover",
title: "Thanks for supporting StackEdit by adding a backlink in your documents!"
}), e(".tooltip-usercustom-extension").tooltip({
html: !0,
container: ".modal-settings",
placement: "right",
trigger: "manual",
title: d
}).click(function(t) {
e(this).tooltip("show"), e(document).on("click.tooltip-usercustom-extension", function() {
e(".tooltip-usercustom-extension").tooltip("hide"), e(document).off("click.tooltip-usercustom-extension");
}), t.stopPropagation();
}), t.each(document.querySelectorAll(".tooltip-template"), function(t) {
var n = e(t);
n.tooltip({
html: !0,
container: n.parents(".modal"),
placement: "right",
trigger: "manual",
title: u
}).click(function(t) {
n.tooltip("show"), e(document).on("click.tooltip-template", function() {
e(".tooltip-template").tooltip("hide"), e(document).off("click.tooltip-template");
}), t.stopPropagation();
});
}), 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", baseDir + "/img/" + i);
}), viewerMode === !1) {
var c = t.reduce(THEME_LIST, function(e, t, n) {
return e + '<option value="' + n + '">' + t + "</option>";
}, "");
document.getElementById("input-settings-theme").innerHTML = c;
}
}), E;
}), define("text!../WELCOME.md", [], function() {
return '\nWelcome 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 <i class="icon-cog"></i> `Settings` dialog.\n\n----------\n\n\nDocuments\n---------\n\n**StackEdit** stores your documents in the browser local storage, which means all your documents are automatically saved locally and are accessible offline.\n\n> **NOTE:** This also means that your documents are not shared between different browsers or computers and that clearing your browser\'s data may **delete all of them!**\n\n#### <i class="icon-file"></i> Create a document\n\nYou can create a new document by clicking the <i class="icon-file"></i> button in the navigation bar. This will switch from the current document to the new one.\n\n#### <i class="icon-folder-open"></i> Switch to another document\n\nYou can list all your local documents and switch from one to another by clicking the <i class="icon-folder-open"></i> button in the navigation bar.\n\n#### <i class="icon-pencil"></i> Rename a document\n\nYou can rename the current document by clicking the document title in the navigation bar.\n\n#### <i class="icon-trash"></i> Delete a document\n\nYou can delete the current document by clicking the <i class="icon-trash"></i> button in the navigation bar.\n\n#### <i class="icon-hdd"></i> Save a document\n\nYou can save the current document to a file using the <i class="icon-hdd"></i> `Save as...` sub-menu.\n\n> **NOTE:** See [<i class="icon-share"></i> Publish a document](#publish-a-document) section for a description of the different outputs.\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:** Full access to **Google Drive** or **Dropbox** is required to be able to import any document in StackEdit. Imported documents are downloaded in your browser and are not transmitted to a server.\n\n#### <i class="icon-download"></i> Import a document\n\nYou can import a document from the *Cloud* by going to the <i class="icon-provider-gdrive"></i> `Google Drive` or the <i class="icon-provider-dropbox"></i> `Dropbox` sub-menu and by clicking `Import from...`. Once imported, your document will be automatically synchronized with the **Google Drive** / **Dropbox** file.\n\n#### <i class="icon-upload"></i> Export a document\n\nYou can export any document by going to the <i class="icon-provider-gdrive"></i> `Google Drive` or the <i class="icon-provider-dropbox"></i> `Dropbox` sub-menu and by clicking `Export to...`. Even if your document is already synchronized with **Google Drive** or **Dropbox**, you can export it to a another location. **StackEdit** can synchronize one document with multiple locations.\n\n#### <i class="icon-refresh"></i> 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 <i class="icon-refresh"></i> button in the navigation bar.\n\n> **NOTE:** The <i class="icon-refresh"></i> button is disabled when:\n> \n> - you are offline,\n> - or the document is not synchronized with any location,\n> - or the document has not been modified since the last synchronization.\n\n#### <i class="icon-refresh"></i> Manage document synchronization\n\nSince one document can be synchronized with multiple locations, you can list and manage synchronized locations by clicking <i class="icon-refresh"></i> `Manage synchronization` in the <i class="icon-stackedit"></i> menu. This will open a dialog box allowing you to add or remove synchronization links 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#### <i class="icon-share"></i> Publish a document\n\nYou can publish your document by going to the <i class="icon-share"></i> `Publish on` 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 instance),\n- HTML, to publish the document converted into HTML (on a blog for instance),\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 `Publish` tab of the <i class="icon-cog"></i> `Settings` dialog.\n\n#### <i class="icon-share"></i> Update a publication\n\nAfter publishing, **StackEdit** will keep your document linked to that publish location so that you can update it easily. Once you have modified your document and you want to update your publication, click on the <i class="icon-share"></i> button in the navigation bar.\n\n> **NOTE:** The <i class="icon-share"></i> button is disabled when:\n> \n> - you are offline,\n> - or the document has not been published anywhere.\n\n#### <i class="icon-share"></i> Manage document publication\n\nSince one document can be published on multiple locations, you can list and manage publish locations by clicking <i class="icon-share"></i> `Manage publication` in the <i class="icon-stackedit"></i> menu. This will open a dialog box allowing you to remove publication links that are associated to your document.\n\n> **NOTE:** In some cases, if you remove the file from the website or the post from the blog, the document will no longer be published on that location.\n\n----------\n\n\nMarkdown Extra\n--------------\n\n**StackEdit** supports **Markdown Extra**, which extends **Markdown** syntax with some nice features.\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\n**GitHub**\'s fenced code blocks are also supported with **Prettify** syntax highlighting:\n\n```\n// Foo\nvar bar = 0;\n```\n\n> **NOTE:** To use **Highlight.js** instead of **Prettify**, just configure the `Markdown Extra` extension in the <i class="icon-cog"></i> `Settings` dialog.\n\n\n### Special Attributes\n\nWith **Markdown Extra**, you can specify `class` and `id` attributes on headers and fenced code blocks just like this:\n\n##### Header example {#my-header}\n\n``` {#my-id .my-class}\nvar foo = bar;\n```\n\nThen you can create cross-references like this: [beginning of the document](#welcome).\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### 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\nn\\in\\mathbb N$ is via through the Euler integral\n\n$$\n\\Gamma(z) = \\int_0^\\infty t^{z-1}e^{-t}dt\\,.\n$$\n\n> **NOTE:** When exporting, make sure you include MathJax to render mathematical expression correctly. Your page/template should include something like: \n\n```\n<script type="text/javascript" src="http://benweet.github.io/stackedit/lib/MathJax/MathJax.js?config=TeX-AMS_HTML"></script>\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 **Prettify** syntax highlighting [here][4].\n> - about **Highlight.js** syntax highlighting [here][5].\n\n [^stackedit]: StackEdit is a free, open-source Markdown editor based on PageDown, the Markdown library used by Stack Overflow and the other Stack Exchange sites.\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]: https://code.google.com/p/google-code-prettify/\n [5]: http://softwaremaniacs.org/soft/highlight/en/';
}), define("fileMgr", [ "jquery", "underscore", "core", "utils", "settings", "eventMgr", "fileSystem", "classes/FileDescriptor", "text!../WELCOME.md" ], function(e, t, n, i, o, r, s, a, l) {
var c = {};
c.currentFile = void 0, c.selectFile = function(i) {
if (i = i || c.currentFile, void 0 === i) {
var o = t.size(s);
i = 0 === o ? c.createFile(WELCOME_DOCUMENT_TITLE, l) : t.max(s, function(e) {
return e.selectTime || 0;
});
}
c.currentFile !== i && (c.currentFile = i, i.selectTime = new Date().getTime(),
r.onFileSelected(i), e(".action-edit-document").toggleClass("hide", i.fileIndex != TEMPORARY_FILE_INDEX)),
n.initEditor(i);
}, c.createFile = function(e, n, l, c) {
if (n = void 0 !== n ? n : o.defaultContent, !e) {
e = DEFAULT_FILE_TITLE;
for (var u = 2; t.some(s, function(t) {
return t.title == e;
}); ) e = DEFAULT_FILE_TITLE + u++;
}
var d = TEMPORARY_FILE_INDEX;
if (!c) do d = "file." + i.randomString(); while (t.has(s, d));
l = l || {};
var h = t.reduce(l, function(e, t) {
return i.storeAttributes(t), e + t.syncIndex + ";";
}, ";");
localStorage[d + ".title"] = e, localStorage[d + ".content"] = n, localStorage[d + ".sync"] = h,
localStorage[d + ".publish"] = ";";
var p = new a(d, e, l);
return c || (i.appendIndexToArray("file.list", d), s[d] = p, r.onFileCreated(p)),
p;
}, c.deleteFile = function(e) {
e = e || c.currentFile, i.removeIndexFromArray("file.list", e.fileIndex), delete s[e.fileIndex],
c.currentFile === e && (c.currentFile = void 0, c.selectFile()), t.each(e.syncLocations, function(e) {
localStorage.removeItem(e.syncIndex);
}), t.each(e.publishLocations, function(e) {
localStorage.removeItem(e.publishIndex);
}), localStorage.removeItem(e.fileIndex + ".title"), localStorage.removeItem(e.fileIndex + ".content"),
localStorage.removeItem(e.fileIndex + ".sync"), localStorage.removeItem(e.fileIndex + ".publish"),
localStorage.removeItem(e.fileIndex + ".selectTime"), localStorage.removeItem(e.fileIndex + ".editorStart"),
localStorage.removeItem(e.fileIndex + ".editorEnd"), localStorage.removeItem(e.fileIndex + ".editorScrollTop"),
localStorage.removeItem(e.fileIndex + ".previewScrollTop"), r.onFileDeleted(e);
}, c.getFileFromSyncIndex = function(e) {
return t.find(s, function(n) {
return t.has(n.syncLocations, e);
});
}, c.getSyncAttributes = function(e) {
var t = c.getFileFromSyncIndex(e);
return t && t.syncLocations[e];
}, c.getFileFromPublishIndex = function(e) {
return t.find(s, function(n) {
return t.has(n.publishLocations, e);
});
};
var u = void 0;
return r.addListener("onAceCreated", function(e) {
u = e;
}), r.addListener("onReady", function() {
function n() {
o.addClass("hide"), i.removeClass("hide");
var t = e.trim(o.val()), n = c.currentFile;
t && t != n.title && (n.title = t, r.onTitleChanged(n)), o.val(n.title), u && u.focus() || $editorElt.focus();
}
$editorElt = e("#wmd-input"), c.selectFile();
var i = e(".file-title-navbar"), o = e(".input-file-title");
e(".action-create-file").click(function() {
var e = c.createFile();
c.selectFile(e), i.click();
}), e(".action-remove-file").click(function() {
c.deleteFile();
}), i.click(function() {
if (viewerMode !== !0) {
i.addClass("hide");
var e = o.removeClass("hide");
t.defer(function() {
e.focus().get(0).select();
});
}
}), o.blur(function() {
n();
}).keyup(function(e) {
13 == e.keyCode && n(), 27 == e.keyCode && (o.val(""), n());
}), e(".action-open-stackedit").click(function() {
window.location.href = ".";
}), e(".action-edit-document").click(function() {
var e = $editorElt.val();
void 0 !== u && (e = u.getValue());
var t = c.currentFile.title, n = c.createFile(t, e);
c.selectFile(n), window.location.href = ".";
}), e(".action-welcome-file").click(function() {
var e = c.createFile(WELCOME_DOCUMENT_TITLE, l);
c.selectFile(e);
});
}), r.onFileMgrCreated(c), c;
}), define("classes/Provider", [], function() {
function e(e, t) {
this.providerId = e, this.providerName = t;
}
return e;
}), define("classes/AsyncTask", [ "underscore", "utils", "eventMgr", "config" ], function(e, t, n) {
function i() {
this.finished = !1, this.timeout = ASYNC_TASK_DEFAULT_TIMEOUT, this.retryCounter = 0,
this.runCallbacks = [], this.successCallbacks = [], this.errorCallbacks = [];
}
function o() {
if (d !== !1) {
if (l === !0) return a + u.timeout < t.currentTime && u.error(new Error("A timeout occurred.")),
void 0;
if (void 0 === u) {
if (0 === s.length) return;
u = s.shift(), a = t.currentTime, c === !1 && (c = !0, n.onAsyncRunning(!0));
}
a <= t.currentTime && (l = !0, u.chain());
}
}
function r(t, i, r) {
try {
e.each(i, function(e) {
e(r);
});
} finally {
t.finished = !0, u === t && (u = void 0, l = !1), 0 === s.length ? (c = !1, n.onAsyncRunning(!1)) : o();
}
}
var s = [];
i.prototype.onRun = function(e) {
this.runCallbacks.push(e);
}, i.prototype.onSuccess = function(e) {
this.successCallbacks.push(e);
}, i.prototype.onError = function(e) {
this.errorCallbacks.push(e);
};
var a = 0;
i.prototype.chain = function(e) {
if (a = t.currentTime, t.logStackTrace(), this.finished !== !0) {
if (void 0 === this.queue && (this.queue = this.runCallbacks.slice()), void 0 !== e) return e(),
void 0;
if (0 === this.queue.length) return r(this, this.successCallbacks), void 0;
var n = this.queue.shift();
n();
}
}, i.prototype.error = function(e) {
if (t.logStackTrace(), this.finished !== !0) throw e = e || new Error("Unknown error"),
e.message && n.onError(e), r(this, this.errorCallbacks, e), e;
};
var l = !1;
i.prototype.retry = function(e, n) {
if (this.finished !== !0) {
if (n = n || 5, this.queue = void 0, this.retryCounter >= n) return this.error(e),
void 0;
var i = 1e3 * Math.pow(2, this.retryCounter++);
a = t.currentTime + i, l = !1, o();
}
}, i.prototype.enqueue = function() {
s.push(this), o();
};
var c = !1, u = void 0, d = !1;
return n.addListener("onUserActive", function() {
d = !0;
}), n.addListener("onPeriodicRun", o), i;
}), define("helpers/dropboxHelper", [ "jquery", "underscore", "core", "eventMgr", "classes/AsyncTask" ], function(e, t, n, i, o) {
function r(t) {
t.onRun(function() {
return h === !0 ? (c = void 0, t.error(new Error("Operation not available in offline mode.|stopPublish")),
void 0) : void 0 !== c ? (t.chain(), void 0) : (e.ajax({
url: "lib/dropbox.min.js",
dataType: "script",
timeout: AJAX_TIMEOUT
}).done(function() {
c = new Dropbox.Client({
key: DROPBOX_APP_KEY,
secret: DROPBOX_APP_SECRET
}), c.authDriver(new Dropbox.Drivers.Popup({
receiverUrl: BASE_URL + "dropbox-oauth-receiver.html",
rememberUser: !0
})), t.chain();
}).fail(function(e) {
var n = {
status: e.status,
responseText: e.statusText
};
a(n, t);
}), void 0);
});
}
function s(e) {
e.onRun(function() {
function t() {
n === !1 && (i.onMessage("Please make sure the Dropbox authorization popup is not blocked by your browser."),
e.timeout = ASYNC_TASK_LONG_TIMEOUT), c.reset(), c.authenticate({
interactive: !n
}, function(i, o) {
return o.authState === Dropbox.Client.DONE ? (u = !0, e.chain(), void 0) : n === !0 ? (n = !1,
e.chain(t), void 0) : (e.error(new Error("Access to Dropbox account is not authorized.")),
void 0);
});
}
if (u === !0) return e.chain(), void 0;
var n = !0;
e.chain(t);
});
}
function a(e, i) {
var o = !0;
if (e) if (logger.error(e), "string" == typeof e) o = e; else {
if (o = "Dropbox error (" + e.status + ": " + e.responseText + ").", 401 === e.status || 403 === e.status) return u = !1,
o = "Access to Dropbox account is not authorized.", i.retry(new Error(o), 1), void 0;
if (400 === e.status && -1 !== e.responseText.indexOf("oauth_nonce")) return t.each(t.keys(localStorage), function(e) {
0 === e.indexOf("dropbox-auth") && localStorage.removeItem(e);
}), u = !1, i.retry(new Error(o), 1), void 0;
e.status <= 0 && (c = void 0, u = !1, n.setOffline(), o = "|stopPublish");
}
i.error(new Error(o));
}
function l(t) {
t.onRun(function() {
return p === !0 ? (t.chain(), void 0) : (e.ajax({
url: "https://www.dropbox.com/static/api/1/dropbox.js",
dataType: "script",
timeout: AJAX_TIMEOUT
}).done(function() {
p = !0, t.chain();
}).fail(function(e) {
var n = {
status: e.status,
responseText: e.statusText
};
a(n, t);
}), void 0);
});
}
var c = void 0, u = !1, d = {}, h = !1;
i.addListener("onOfflineChanged", function(e) {
h = e;
}), d.upload = function(e, t, n) {
var i = void 0, l = new o();
r(l), s(l), l.onRun(function() {
c.writeFile(e, t, function(t, n) {
return t ? (400 === t.status && (t = 'Could not upload document into path "' + e + '".'),
a(t, l), void 0) : (i = n, l.chain(), void 0);
});
}), l.onSuccess(function() {
n(void 0, i);
}), l.onError(function(e) {
n(e);
}), l.enqueue();
}, d.checkChanges = function(e, t) {
var n = [], i = e || 0, l = new o();
r(l), s(l), l.onRun(function() {
function e() {
c.pullChanges(i, function(t, o) {
return t ? (a(t, l), void 0) : (i = o.cursor(), void 0 !== o.changes && (n = n.concat(o.changes)),
o.shouldPullAgain ? l.chain(e) : l.chain(), void 0);
});
}
l.chain(e);
}), l.onSuccess(function() {
t(void 0, n, i);
}), l.onError(function(e) {
t(e);
}), l.enqueue();
}, d.downloadMetadata = function(e, t) {
var n = [], i = new o();
r(i), s(i), i.onRun(function() {
function t() {
if (0 === e.length) return i.chain(), void 0;
var o = e[0];
c.stat(o, function(o, r) {
return r ? (n.push(r), e.shift(), i.chain(t), void 0) : (a(o, i), void 0);
});
}
i.chain(t);
}), i.onSuccess(function() {
t(void 0, n);
}), i.onError(function(e) {
t(e);
}), i.enqueue();
}, d.downloadContent = function(e, t) {
var n = [], i = new o();
r(i), s(i), i.onRun(function() {
function t() {
if (0 === e.length) return i.chain(), void 0;
var o = e[0];
n.push(o);
var r = void 0;
return o.isFile === !0 ? r = o : void 0 !== o.wasRemoved && (r = o.stat), r ? (c.readFile(r.path, function(n, o) {
return o ? (r.content = o, e.shift(), i.chain(t), void 0) : (a(n, i), void 0);
}), void 0) : (e.shift(), i.chain(t), void 0);
}
i.chain(t);
}), i.onSuccess(function() {
t(void 0, n);
}), i.onError(function(e) {
t(e);
}), i.enqueue();
};
var p = !1;
return d.picker = function(e) {
var t = [], n = new o();
n.timeout = ASYNC_TASK_LONG_TIMEOUT, r(n), l(n), n.onRun(function() {
var e = {};
e.multiselect = !0, e.linkType = "direct", e.success = function(e) {
for (var i = 0; i < e.length; i++) {
var o = e[i].link;
o = o.replace(/.*\/view\/[^\/]*/, ""), t.push(decodeURI(o));
}
n.chain();
}, e.cancel = function() {
n.chain();
}, Dropbox.choose(e), i.onMessage("Please make sure the Dropbox chooser popup is not blocked by your browser.");
}), n.onSuccess(function() {
e(void 0, t);
}), n.onError(function(t) {
e(t);
}), n.enqueue();
}, d;
}), define("providers/dropboxProvider", [ "underscore", "utils", "classes/Provider", "eventMgr", "fileMgr", "helpers/dropboxHelper" ], function(e, t, n, i, o, r) {
function s(e) {
return void 0 === e ? void 0 : e.match(/^[^\\<>:"\|?\*]+$/) ? 0 !== e.indexOf("/") ? "/" + e : e : (i.onError('"' + e + '" contains invalid characters.'),
void 0);
}
function a(e) {
return "sync." + u + "." + encodeURIComponent(e.toLowerCase());
}
function l(e, n, i) {
var o = {};
return o.provider = d, o.path = e, o.version = n, o.contentCRC = t.crc32(i), o.syncIndex = a(e),
o;
}
function c(t) {
r.downloadMetadata(t, function(t, n) {
t || r.downloadContent(n, function(t, n) {
if (!t) {
var r = [];
e.each(n, function(e) {
var t = l(e.path, e.versionTag, e.content), n = {};
n[t.syncIndex] = t;
var i = o.createFile(e.name, e.content, n);
o.selectFile(i), r.push(i);
}), 0 !== r.length && i.onSyncImportSuccess(r, d);
}
});
});
}
var u = "dropbox", d = new n(u, "Dropbox");
return d.defaultPublishFormat = "template", d.importFiles = function() {
r.picker(function(t, n) {
if (!t && 0 !== n.length) {
var r = [];
e.each(n, function(e) {
var t = a(e), n = o.getFileFromSyncIndex(t);
return void 0 !== n ? (i.onError('"' + n.title + '" was already imported.'), void 0) : (r.push(e),
void 0);
}), c(r);
}
});
}, d.exportFile = function(e, n, c, u) {
var d = t.getInputTextValue("#input-sync-export-dropbox-path", e);
if (d = s(d), void 0 === d) return u(!0), void 0;
var h = a(d), p = o.getFileFromSyncIndex(h);
if (void 0 !== p) {
var f = p.title;
return i.onError('File path is already synchronized with "' + f + '".'), u(!0),
void 0;
}
r.upload(d, c, function(e, t) {
if (e) return u(e), void 0;
var n = l(t.path, t.versionTag, c);
u(void 0, n);
});
}, d.syncUp = function(e, t, n, i, o, s) {
var a = o.contentCRC;
return t == a ? (s(void 0, !1), void 0) : (r.upload(o.path, e, function(e, n) {
return e ? (s(e, !0), void 0) : (o.version = n.versionTag, o.contentCRC = t, s(void 0, !0),
void 0);
}), void 0);
}, d.syncDown = function(n) {
var s = localStorage[u + ".lastChangeId"];
r.checkChanges(s, function(s, l, c) {
if (s) return n(s), void 0;
var d = [];
e.each(l, function(e) {
var t = a(e.path), n = o.getSyncAttributes(t);
return void 0 !== n ? (e.syncAttributes = n, e.wasRemoved === !0 ? (d.push(e), void 0) : (n.version != e.stat.versionTag && d.push(e),
void 0)) : void 0;
}), r.downloadContent(d, function(r, s) {
return r ? (n(r), void 0) : (e.each(s, function(e) {
var n = e.syncAttributes, r = n.syncIndex, s = o.getFileFromSyncIndex(r);
if (void 0 !== s) {
var a = s.title;
if (e.wasRemoved === !0) return i.onError('"' + a + '" has been removed from Dropbox.'),
s.removeSyncLocation(n), i.onSyncRemoved(s, n), void 0;
var l = s.content, c = n.contentCRC != t.crc32(l), u = e.stat, d = t.crc32(u.content), h = n.contentCRC != d, p = l != u.content;
p === !0 && c === !0 && h === !0 && (o.createFile(a + " (backup)", l), i.onMessage('Conflict detected on "' + a + '". A backup has been created locally.')),
p && h === !0 && (s.content = u.content, i.onContentChanged(s), i.onMessage('"' + a + '" has been updated from Dropbox.'),
o.currentFile === s && o.selectFile()), n.version = u.versionTag, n.contentCRC = d,
t.storeAttributes(n);
}
}), localStorage[u + ".lastChangeId"] = c, n(), void 0);
});
});
}, d.publish = function(e, t, n, i) {
var o = s(e.path);
return void 0 === o ? (i(!0), void 0) : (r.upload(o, n, i), void 0);
}, d.newPublishAttributes = function(e) {
var n = {};
return n.path = t.getInputTextValue("#input-publish-dropbox-path", e), e.isPropagationStopped() ? void 0 : n;
}, d;
}), define("helpers/googleHelper", [ "jquery", "core", "utils", "eventMgr", "classes/AsyncTask" ], function(e, t, n, i, o) {
function r(t) {
t.onRun(function() {
return h === !0 ? (c = !1, t.error(new Error("Operation not available in offline mode.|stopPublish")),
void 0) : c === !0 ? (t.chain(), void 0) : (delayedFunction = function() {
gapi.load("client,drive-realtime", function() {
c = !0, t.chain();
});
}, e.ajax({
url: "https://apis.google.com/js/api.js?onload=runDelayedFunction",
dataType: "script",
timeout: AJAX_TIMEOUT
}).fail(function(e) {
var n = {
code: e.status,
message: e.statusText
};
a(n, t);
}), void 0);
});
}
function s(e) {
e.onRun(function() {
function t() {
n === !1 && (i.onMessage("Please make sure the Google authorization popup is not blocked by your browser."),
e.timeout = ASYNC_TASK_LONG_TIMEOUT), gapi.auth.authorize({
client_id: GOOGLE_CLIENT_ID,
scope: GOOGLE_SCOPES,
immediate: n
}, function(i) {
gapi.client.load("drive", "v2", function() {
return !i || i.error ? c === !0 && n === !0 ? (n = !1, e.chain(t), void 0) : (e.error(new Error("Access to Google account is not authorized.")),
void 0) : (u = !0, e.chain(), void 0);
});
});
}
if (u === !0) return e.chain(), void 0;
var n = !0;
e.chain(t);
});
}
function a(e, n) {
var i = void 0;
if (e) if (logger.error(e), "string" == typeof e) i = e; else {
if (i = "Google error (" + e.code + ": " + e.message + ").", e.code >= 500 && e.code < 600) return n.retry(new Error(i)),
void 0;
if (401 === e.code || 403 === e.code || "token_refresh_required" == e.code) return u = !1,
i = "Access to Google account is not authorized.", n.retry(new Error(i), 1), void 0;
(0 === e.code || -1 === e.code) && (c = !1, u = !1, t.setOffline(), i = "|stopPublish");
}
n.error(new Error(i));
}
function l(t) {
t.onRun(function() {
return p === !0 ? (t.chain(), void 0) : (e.ajax({
url: "//www.google.com/jsapi",
data: {
key: GOOGLE_API_KEY
},
dataType: "script",
timeout: AJAX_TIMEOUT
}).done(function() {
google.load("picker", "1", {
callback: function() {
t.chain();
}
}), p = !0;
}).fail(function(e) {
var n = {
code: e.status,
message: e.statusText
};
a(n, t);
}), void 0);
});
}
var c = !1, u = !1, d = {}, h = !1;
i.addListener("onOfflineChanged", function(e) {
h = e;
}), d.forceAuthenticate = function() {
u = !1;
var e = new o();
r(e), s(e), e.enqueue();
}, d.upload = function(e, t, i, l, c, u, d) {
var h = void 0, p = new o();
r(p), s(p), p.onRun(function() {
var o = "-------314159265358979323846", r = "\r\n--" + o + "\r\n", s = "\r\n--" + o + "--";
c = c || "text/x-markdown";
var u = {
title: i,
mimeType: c
};
t && (u.parents = [ {
kind: "drive#fileLink",
id: t
} ]);
var d = "/upload/drive/v2/files", f = "POST";
e && (d += "/" + e, f = "PUT");
var g = {
"Content-Type": 'multipart/mixed; boundary="' + o + '"'
}, m = n.encodeBase64(l), v = [ r, "Content-Type: application/json\r\n\r\n", JSON.stringify(u), r, "Content-Type: ", c, "\r\n", "Content-Transfer-Encoding: base64\r\n", "\r\n", m, s ].join(""), b = gapi.client.request({
path: d,
method: f,
params: {
uploadType: "multipart"
},
headers: g,
body: v
});
b.execute(function(t) {
if (t && t.id) return h = t, h.content = l, p.chain(), void 0;
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 && (localStorage.removeItem("gdrive.lastChangeId"),
n = 'Conflict on file ID "' + e + '". Please restart the synchronization.')), a(n, p);
});
}), p.onSuccess(function() {
d(void 0, h);
}), p.onError(function(e) {
d(e);
}), p.enqueue();
}, d.rename = function(e, t, n) {
var i = void 0, l = new o();
r(l), s(l), l.onRun(function() {
var n = {
title: t
}, o = gapi.client.drive.files.patch({
fileId: e,
resource: n
});
o.execute(function(t) {
if (t && t.id) return i = t, l.chain(), void 0;
var n = t.error;
void 0 !== n && void 0 !== e && 404 === n.code && (n = 'File ID "' + e + '" not found on Google Drive.|removePublish'),
a(n, l);
});
}), l.onSuccess(function() {
n(void 0, i);
}), l.onError(function(e) {
n(e);
}), l.enqueue();
}, d.createRealtimeFile = function(e, t, n) {
var i = void 0, l = new o();
r(l), s(l), l.onRun(function() {
var n = {
title: t,
mimeType: "application/vnd.google-apps.drive-sdk"
};
void 0 !== e && (n.parents = [ {
kind: "drive#fileLink",
id: e
} ]);
var o = gapi.client.drive.files.insert({
resource: n
});
o.execute(function(e) {
return e && e.id ? (i = e, l.chain(), void 0) : (a(e.error, l), void 0);
});
}), l.onSuccess(function() {
n(void 0, i);
}), l.onError(function(e) {
n(e);
}), l.enqueue();
}, d.uploadImg = function(t, n, i, l) {
var c = void 0, u = new o();
r(u), s(u), u.onRun(function() {
var o = {
Slug: t
};
t.match(/.jpe?g$/) ? o["Content-Type"] = "image/jpeg" : t.match(/.png$/) ? o["Content-Type"] = "image/png" : t.match(/.gif$/) && (o["Content-Type"] = "image/gif");
var r = gapi.auth.getToken();
r && (o.Authorization = "Bearer " + r.access_token), e.ajax({
url: PICASA_PROXY_URL + "upload/" + i,
headers: o,
data: n,
processData: !1,
dataType: "xml",
timeout: AJAX_TIMEOUT,
type: "POST"
}).done(function(e) {
c = e, u.chain();
}).fail(function(e) {
var t = {
code: e.status,
message: e.statusText
};
200 == t.code && (t.message = e.responseText), a(t, u);
});
}), u.onSuccess(function() {
l(void 0, c);
}), u.onError(function(e) {
l(e);
}), u.enqueue();
}, d.checkChanges = function(e, t) {
var n = [], i = e || 0, l = new o();
r(l), s(l), l.onRun(function() {
function e() {
var o = void 0;
o = void 0 === t ? gapi.client.drive.changes.list({
startChangeId: i + 1
}) : gapi.client.drive.changes.list({
pageToken: t
}), o.execute(function(o) {
return o && o.largestChangeId ? (i = o.largestChangeId, t = o.nextPageToken, void 0 !== o.items && (n = n.concat(o.items)),
void 0 !== t ? l.chain(e) : l.chain(), void 0) : (a(o.error, l), void 0);
});
}
var t = void 0;
l.chain(e);
}), l.onSuccess(function() {
t(void 0, n, i);
}), l.onError(function(e) {
t(e);
}), l.enqueue();
}, d.downloadMetadata = function(t, n, i) {
var l = [], c = new o();
r(c), i || s(c), c.onRun(function() {
function n() {
if (0 === t.length) return c.chain(), void 0;
var i = t[0], o = {}, r = gapi.auth.getToken();
r && (o.Authorization = "Bearer " + r.access_token), e.ajax({
url: "https://www.googleapis.com/drive/v2/files/" + i,
headers: o,
data: {
key: GOOGLE_API_KEY
},
dataType: "json",
timeout: AJAX_TIMEOUT
}).done(function(e) {
l.push(e), t.shift(), c.chain(n);
}).fail(function(e) {
var t = {
code: e.status,
message: e.statusText
};
404 === t.code && (t = 'File ID "' + i + '" not found on Google Drive.'), a(t, c);
});
}
c.chain(n);
}), c.onSuccess(function() {
n(void 0, l);
}), c.onError(function(e) {
n(e);
}), c.enqueue();
}, d.downloadContent = function(t, n, i) {
var l = [], c = new o();
c.timeout = ASYNC_TASK_LONG_TIMEOUT, r(c), i || s(c), c.onRun(function() {
function n() {
if (0 === t.length) return c.chain(), void 0;
var i = t[0];
l.push(i);
var o = void 0;
if ("drive#file" == i.kind ? o = i : "drive#change" == i.kind && (o = i.file), !o) return t.shift(),
c.chain(n), void 0;
if (0 === o.mimeType.indexOf("application/vnd.google-apps.drive-sdk")) return o.content = "",
o.isRealtime = !0, t.shift(), c.chain(n), void 0;
var r = {}, s = gapi.auth.getToken();
s && (r.Authorization = "Bearer " + s.access_token), e.ajax({
url: o.downloadUrl,
headers: r,
data: {
key: GOOGLE_API_KEY
},
dataType: "text",
timeout: AJAX_TIMEOUT
}).done(function(e) {
o.content = e, t.shift(), c.chain(n);
}).fail(function(e) {
var t = {
code: e.status,
message: e.statusText
};
a(t, c);
});
}
c.chain(n);
}), c.onSuccess(function() {
n(void 0, l);
}), c.onError(function(e) {
n(e);
}), c.enqueue();
}, d.loadRealtime = function(e, t, n, i) {
var a = void 0, l = new o();
r(l), s(l), l.onRun(function() {
gapi.drive.realtime.load(e, function(e) {
a = e, l.chain();
}, function(e) {
var n = e.createString(t);
e.getRoot().set("content", n);
}, function(e) {
i(e), l.error(new Error(e.message));
});
}), l.onSuccess(function() {
n(void 0, a);
}), l.onError(function(e) {
n(e);
}), l.enqueue();
};
var p = !1;
return d.picker = function(t, i) {
function s() {
void 0 !== c && (c.setVisible(!1), e(".modal-backdrop, .picker").remove());
}
var a = [], c = void 0, u = new o();
u.timeout = ASYNC_TASK_LONG_TIMEOUT, r(u), l(u), u.onRun(function() {
var t = new google.picker.PickerBuilder();
if (t.setAppId(GOOGLE_DRIVE_APP_ID), "doc" == i) {
var o = new google.picker.DocsView(google.picker.ViewId.DOCS);
o.setIncludeFolders(!0), o.setMimeTypes([ "text/x-markdown", "text/plain", "application/octet-stream", "application/vnd.google-apps.drive-sdk." + GOOGLE_DRIVE_APP_ID ].join(",")),
t.enableFeature(google.picker.Feature.NAV_HIDDEN), t.enableFeature(google.picker.Feature.MULTISELECT_ENABLED),
t.addView(o);
} else if ("folder" == i) {
var o = new google.picker.DocsView(google.picker.ViewId.FOLDERS);
o.setIncludeFolders(!0), o.setSelectFolderEnabled(!0), o.setMimeTypes("application/vnd.google-apps.folder"),
t.enableFeature(google.picker.Feature.NAV_HIDDEN), t.addView(o);
} else "img" == i && (t.addView(google.picker.ViewId.PHOTOS), t.addView(google.picker.ViewId.PHOTO_UPLOAD));
t.setCallback(function(e) {
(e.action == google.picker.Action.PICKED || e.action == google.picker.Action.CANCEL) && (e.action == google.picker.Action.PICKED && (a = e.docs),
s(), u.chain());
}), c = t.build(), e(n.createBackdrop()).click(function() {
s(), u.chain();
}), c.setVisible(!0);
}), u.onSuccess(function() {
t(void 0, a);
}), u.onError(function(e) {
s(), t(e);
}), u.enqueue();
}, d.uploadBlogger = function(t, n, i, l, c, u, d) {
var h = new o();
r(h), s(h), h.onRun(function() {
function o() {
var t = "https://www.googleapis.com/blogger/v3/blogs/" + n + "/posts/", o = {
kind: "blogger#post",
blog: {
id: n
},
labels: l,
title: c,
content: u
}, r = "POST";
void 0 !== i && (t += i, o.id = i, r = "PUT"), e.ajax({
url: t,
data: JSON.stringify(o),
headers: s,
type: r,
contentType: "application/json",
dataType: "json",
timeout: AJAX_TIMEOUT
}).done(function(e) {
i = e.id, h.chain();
}).fail(function(e) {
var t = {
code: e.status,
message: e.statusText
};
404 === t.code && void 0 !== i && (t = "Post " + i + " not found on Blogger.|removePublish"),
a(t, h);
});
}
function r() {
return void 0 !== n ? (h.chain(o), void 0) : (e.ajax({
url: "https://www.googleapis.com/blogger/v3/blogs/byurl",
data: {
url: t
},
headers: s,
dataType: "json",
timeout: AJAX_TIMEOUT
}).done(function(e) {
n = e.id, h.chain(o);
}).fail(function(e) {
var n = {
code: e.status,
message: e.statusText
};
404 === n.code && (n = 'Blog "' + t + '" not found on Blogger.|removePublish'),
a(n, h);
}), void 0);
}
var s = {}, d = gapi.auth.getToken();
d && (s.Authorization = "Bearer " + d.access_token), h.chain(r);
}), h.onSuccess(function() {
d(void 0, n, i);
}), h.onError(function(e) {
d(e);
}), h.enqueue();
}, d;
}), define("providers/gdriveProvider", [ "underscore", "utils", "classes/Provider", "settings", "eventMgr", "fileMgr", "helpers/googleHelper" ], function(e, t, n, i, o, r, s) {
function a(e) {
return "sync." + u + "." + e;
}
function l(e, n, i, o) {
var r = {};
return r.provider = d, r.id = e, r.etag = n, r.contentCRC = t.crc32(i), r.titleCRC = t.crc32(o),
r.syncIndex = a(e), r;
}
function c(t) {
s.downloadMetadata(t, function(t, n) {
t || s.downloadContent(n, function(t, n) {
if (!t) {
var i = [], s = void 0;
e.each(n, function(e) {
var t = l(e.id, e.etag, e.content, e.title);
t.isRealtime = e.isRealtime;
var n = {};
n[t.syncIndex] = t, s = r.createFile(e.title, e.content, n), i.push(s);
}), void 0 !== s && (o.onSyncImportSuccess(i, d), r.selectFile(s));
}
});
});
}
var u = "gdrive", d = new n(u, "Google Drive");
d.defaultPublishFormat = "template", d.exportPreferencesInputIds = [ "gdrive-parentid", "gdrive-realtime" ],
d.importFiles = function() {
s.picker(function(t, n) {
if (!t && 0 !== n.length) {
var i = [];
e.each(n, function(e) {
var t = a(e.id), n = r.getFileFromSyncIndex(t);
return void 0 !== n ? (o.onError('"' + n.title + '" was already imported.'), void 0) : (i.push(e.id),
void 0);
}), c(i);
}
}, "doc");
}, d.exportFile = function(e, n, i, c) {
var u = t.getInputTextValue("#input-sync-export-gdrive-fileid");
if (u) {
var d = a(u), h = r.getFileFromSyncIndex(d);
if (void 0 !== h) return o.onError('File ID is already synchronized with "' + h.title + '".'),
c(!0), void 0;
}
var p = t.getInputTextValue("#input-sync-export-gdrive-parentid");
s.upload(u, p, n, i, void 0, void 0, function(e, t) {
if (e) return c(e), void 0;
var o = l(t.id, t.etag, i, n);
c(void 0, o);
});
}, d.exportRealtimeFile = function(e, n, i, o) {
var r = t.getInputTextValue("#input-sync-export-gdrive-parentid");
s.createRealtimeFile(r, n, function(e, t) {
if (e) return o(e), void 0;
var r = l(t.id, t.etag, i, n);
o(void 0, r);
});
}, d.syncUp = function(e, t, n, i, o, r) {
return t == o.contentCRC && i == o.titleCRC ? (r(void 0, !1), void 0) : (s.upload(o.id, void 0, n, e, void 0, o.etag, function(e, n) {
return e ? (r(e, !0), void 0) : (o.etag = n.etag, o.contentCRC = t, o.titleCRC = i,
r(void 0, !0), void 0);
}), void 0);
}, d.syncUpRealtime = function(e, t, n, i, o, r) {
return i == o.titleCRC ? (r(void 0, !1), void 0) : (s.rename(o.id, n, function(e, t) {
return e ? (r(e, !0), void 0) : (o.etag = t.etag, o.titleCRC = i, r(void 0, !0),
void 0);
}), void 0);
}, d.syncDown = function(n) {
var i = parseInt(localStorage[u + ".lastChangeId"]);
s.checkChanges(i, function(i, l, c) {
if (i) return n(i), void 0;
var h = [];
e.each(l, function(e) {
var t = a(e.fileId), n = r.getSyncAttributes(t);
return void 0 !== n ? (e.syncAttributes = n, e.deleted === !0 ? (h.push(e), void 0) : (n.etag != e.file.etag && h.push(e),
void 0)) : void 0;
}), s.downloadContent(h, function(i, s) {
return i ? (n(i), void 0) : (e.each(s, function(e) {
var n = e.syncAttributes, i = n.syncIndex, s = r.getFileFromSyncIndex(i);
if (void 0 !== s) {
var a = s.title;
if (e.deleted === !0) return o.onError('"' + a + '" has been removed from Google Drive.'),
s.removeSyncLocation(n), o.onSyncRemoved(s, n), n.isRealtime === !0 && r.currentFile === s && d.stopRealtimeSync(),
void 0;
var l = n.titleCRC != t.crc32(a), c = s.content, u = n.contentCRC != t.crc32(c), h = e.file, p = t.crc32(h.title), f = n.titleCRC != p, g = a != h.title, m = t.crc32(h.content), v = n.contentCRC != m, b = c != h.content;
(g === !0 && l === !0 && f === !0 || !n.isRealtime && b === !0 && u === !0 && v === !0) && (r.createFile(a + " (backup)", c),
o.onMessage('Conflict detected on "' + a + '". A backup has been created locally.')),
g && f === !0 && (s.title = h.title, o.onTitleChanged(s), o.onMessage('"' + a + '" has been renamed to "' + h.title + '" on Google Drive.')),
!n.isRealtime && b && v === !0 && (s.content = h.content, o.onContentChanged(s),
o.onMessage('"' + h.title + '" has been updated from Google Drive.'), r.currentFile === s && r.selectFile()),
n.etag = h.etag, n.isRealtime || (n.contentCRC = m), n.titleCRC = p, t.storeAttributes(n);
}
}), localStorage[u + ".lastChangeId"] = c, n(), void 0);
});
});
}, d.publish = function(e, t, n, i) {
var o = "markdown" != e.format ? "text/html" : void 0;
s.upload(e.id, void 0, e.fileName || t, n, o, void 0, function(t, n) {
return t ? (i(t), void 0) : (e.id = n.id, i(), void 0);
});
}, d.newPublishAttributes = function(e) {
var n = {};
return n.id = t.getInputTextValue("#input-publish-gdrive-fileid"), n.fileName = t.getInputTextValue("#input-publish-gdrive-filename"),
e.isPropagationStopped() ? void 0 : n;
};
var h = void 0, p = void 0, f = void 0, g = void 0;
o.addListener("onPagedownConfigure", function(e) {
h = e;
});
var m = void 0, v = void 0, b = !0;
o.addListener("onAceCreated", function(e) {
v = e, v.session.on("change", function() {
m && m.string && m.string.setText(v.getValue());
});
});
var y = require("ace/range").Range;
return d.startRealtimeSync = function(n, i) {
var a = {};
m = a, s.loadRealtime(i.id, n.content, function(s, l) {
function c() {
i.contentCRC = t.crc32(d.getText()), t.storeAttributes(i);
}
if (!s && l) {
if (a.isStopped === !0) return l.close(), void 0;
logger.log("Starting Google Drive realtime synchronization"), a.document = l;
var u = l.getModel(), d = u.getRoot().get("content"), m = e.debounce(h.refreshPreview, 100);
d.addEventListener(gapi.drive.realtime.EventType.TEXT_INSERTED, function(e) {
if (void 0 !== v && (b === !1 || e.isLocal === !1)) {
var t = v.session.doc.indexToPosition(e.index);
v.session.insert(t, e.text), b = !0;
}
e.isLocal === !1 && (logger.log("Google Drive realtime document updated from server"),
c(), void 0 === v && m());
}), d.addEventListener(gapi.drive.realtime.EventType.TEXT_DELETED, function(e) {
if (void 0 !== v && (b === !1 || e.isLocal === !1)) {
var t = function(e, t) {
return new y(e.row, e.column, t.row, t.column);
}(v.session.doc.indexToPosition(e.index), v.session.doc.indexToPosition(e.index + e.text.length));
v.session.remove(t), b = !0;
}
e.isLocal === !1 && (logger.log("Google Drive realtime document updated from server"),
c(), void 0 === v && m());
}), l.addEventListener(gapi.drive.realtime.EventType.DOCUMENT_SAVE_STATE_CHANGED, function(e) {
e.isPending === !1 && e.isSaving === !1 && (logger.log("Google Drive realtime document successfully saved on server"),
c());
});
var w = n.content, C = i.contentCRC != t.crc32(w), x = d.getText(), E = t.crc32(x), S = i.contentCRC != E, A = w != x;
A === !0 && C === !0 && (S === !0 ? (r.createFile(n.title + " (backup)", w), o.onMessage('Conflict detected on "' + n.title + '". A backup has been created locally.')) : d.setText(w)),
void 0 === v && (a.binding = gapi.drive.realtime.databinding.bindString(d, document.getElementById("wmd-input"))),
S === !0 && (logger.log("Google Drive realtime document updated from server"), void 0 !== v && v.setValue(x, -1),
c(), void 0 === v && m()), void 0 !== v && (a.string = d, p = h.uiManager.buttons.undo.execute,
f = h.uiManager.buttons.redo.execute, g = h.uiManager.setUndoRedoButtonStates, h.uiManager.buttons.undo.execute = function() {
u.canUndo && (b = !1, u.undo());
}, h.uiManager.buttons.redo.execute = function() {
u.canRedo && (b = !1, u.redo());
}, h.uiManager.setUndoRedoButtonStates = function() {
setTimeout(function() {
h.uiManager.setButtonState(h.uiManager.buttons.undo, u.canUndo), h.uiManager.setButtonState(h.uiManager.buttons.redo, u.canRedo);
}, 50);
}, h.uiManager.setUndoRedoButtonStates(), u.addEventListener(gapi.drive.realtime.EventType.UNDO_REDO_STATE_CHANGED, function() {
h.uiManager.setUndoRedoButtonStates();
}));
}
}, function(e) {
console.error(e), "token_refresh_required" == e.type ? s.forceAuthenticate() : "not_found" == e.type ? (o.onError('"' + n.title + '" has been removed from Google Drive.'),
n.removeSyncLocation(i), o.onSyncRemoved(n, i), d.stopRealtimeSync()) : e.isFatal && (o.onError("An error has forced real time synchronization to stop."),
d.stopRealtimeSync());
});
}, d.stopRealtimeSync = function() {
logger.log("Stopping Google Drive realtime synchronization"), void 0 !== m && (m.isStopped = !0,
m.binding && m.binding.unbind(), m.document && m.document.close(), m = void 0),
void 0 !== g && (h.uiManager.buttons.undo.execute = p, h.uiManager.buttons.redo.execute = f,
h.uiManager.setUndoRedoButtonStates = g, h.uiManager.setUndoRedoButtonStates());
}, o.addListener("onReady", function() {
$(".export-gdrive-choose-folder").click(function() {
s.picker(function(e, n) {
e || 0 === n.length || ($(".modal-upload-gdrive").modal(), t.setInputValue("#input-sync-export-gdrive-parentid", n[0].id));
}, "folder");
});
var n = $("#input-sync-export-gdrive-realtime"), d = $("#input-sync-export-gdrive-fileid");
$("#input-sync-export-gdrive-realtime").change(function() {
d.prop("disabled", n.prop("checked"));
});
var h = t.retrieveIgnoreError(u + ".state");
if (void 0 !== h) if (localStorage.removeItem(u + ".state"), "create" == h.action) s.upload(void 0, h.folderId, GDRIVE_DEFAULT_FILE_TITLE, i.defaultContent, void 0, void 0, function(e, t) {
if (!e) {
var n = l(t.id, t.etag, t.content, t.title), i = {};
i[n.syncIndex] = n;
var s = r.createFile(t.title, t.content, i);
r.selectFile(s), o.onMessage('"' + t.title + '" created successfully on Google Drive.');
}
}); else if ("open" == h.action) {
var p = [];
e.each(h.ids, function(e) {
var t = a(e), n = r.getFileFromSyncIndex(t);
void 0 !== n ? n !== r.currentFile && r.selectFile(n) : p.push(e);
}), c(p);
}
}), d;
}), define("synchronizer", [ "jquery", "underscore", "utils", "eventMgr", "fileSystem", "fileMgr", "classes/Provider", "providers/dropboxProvider", "providers/gdriveProvider" ], function(e, t, n, i, o, r, s) {
function a(e) {
if (0 === b.length) return l(e), void 0;
var t = b.pop(), i = t.provider.syncUp;
t.isRealtime === !0 && (i = t.provider.syncUpRealtime), i(y, w, C, x, t, function(i, o) {
return o === !0 && (S = !0), i ? (e(i), void 0) : (o && n.storeAttributes(t), a(e),
void 0);
});
}
function l(e) {
if (0 === E.length) return c(e), void 0;
var i = E.pop();
return b = t.values(i.syncLocations), 0 === b.length ? (l(e), void 0) : (y = i.content,
w = n.crc32(y), C = i.title, x = n.crc32(C), a(e), void 0);
}
function c(e) {
S === !0 ? (S = !1, E = t.values(o), l(e)) : e();
}
function u(e) {
if (0 === A.length) return e(), void 0;
var t = A.pop();
return m.hasSync(t) ? (t.syncDown(function(t) {
return t ? (e(t), void 0) : (u(e), void 0);
}), void 0) : (u(e), void 0);
}
function d(e) {
A = t.values(v), u(e);
}
function h(e) {
_ = t.some(e.syncLocations, function(e) {
return $ = e, e.isRealtime;
}) ? e : void 0, f();
}
function p(e) {
e === !1 ? (T = !0, f()) : (m.tryStopRealtimeSync(), T = !1);
}
function f() {
void 0 !== _ && T === !0 && $.provider.startRealtimeSync(_, $);
}
function g(i) {
n.resetModalInputs();
var o = n.retrieveIgnoreError(i.providerId + ".exportPreferences");
o && t.each(i.exportPreferencesInputIds, function(e) {
var i = o[e];
t.isBoolean(i) ? n.setInputChecked("#input-sync-export-" + e, i) : n.setInputValue("#input-sync-export-" + e, i);
}), e(".modal-upload-" + i.providerId).modal();
}
var m = {}, v = t.chain(arguments).map(function(e) {
return e instanceof s && [ e.providerId, e ];
}).compact().object().value();
t.each(o, function(e) {
t.each(n.retrieveIndexArray(e.fileIndex + ".sync"), function(t) {
try {
var o = JSON.parse(localStorage[t]);
o.syncIndex = t;
var r = v[o.provider];
if (!r) throw new Error("Invalid provider ID: " + o.provider);
o.provider = r, e.syncLocations[t] = o;
} catch (s) {
i.onError(s), n.removeIndexFromArray(e.fileIndex + ".sync", t), localStorage.removeItem(t);
}
});
}), m.hasSync = function(e) {
return t.some(o, function(n) {
return t.some(n.syncLocations, function(t) {
return void 0 === e || t.provider === e;
});
});
};
var b = [], y = void 0, w = void 0, C = void 0, x = void 0, E = [], S = !1, A = [], k = !1;
i.addListener("onOfflineChanged", function(e) {
k = e;
});
var F = !1;
m.sync = function() {
function e(e) {
return void 0 !== e ? (F = !1, i.onSyncRunning(!1), !0) : !1;
}
return F === !0 || k === !0 ? !1 : (F = !0, i.onSyncRunning(!0), S = !0, d(function(t) {
e(t) || c(function(t) {
e(t) || (F = !1, i.onSyncRunning(!1), i.onSyncSuccess());
});
}), !0);
};
var _ = void 0, $ = void 0, T = !0;
return m.tryStopRealtimeSync = function() {
void 0 !== _ && T === !0 && $.provider.stopRealtimeSync();
}, viewerMode === !1 && (i.addListener("onFileOpen", h), i.addListener("onFileClosed", m.tryStopRealtimeSync),
i.addListener("onOfflineChanged", p)), i.addListener("onReady", function() {
t.each(v, function(o) {
e(".action-sync-import-" + o.providerId).click(function(e) {
o.importFiles(e);
}), e(".action-sync-export-dialog-" + o.providerId).click(function() {
g(o);
}), e(".action-sync-export-" + o.providerId).click(function(e) {
var s = n.getInputChecked("#input-sync-export-" + o.providerId + "-realtime"), a = r.currentFile;
if (s) {
if (t.size(a.syncLocations) > 0) return i.onError("Real time collaborative document can't be synchronized with multiple locations"),
void 0;
o.exportRealtimeFile(e, a.title, a.content, function(e, t) {
e || (t.isRealtime = !0, a.addSyncLocation(t), i.onSyncExportSuccess(a, t), _ = a,
$ = t, f());
});
} else {
if (t.size(a.syncLocations) > 0 && t.first(t.values(a.syncLocations)).isRealtime) return i.onError("Real time collaborative document can't be synchronized with multiple locations"),
void 0;
o.exportFile(e, a.title, a.content, function(e, t) {
e || (a.addSyncLocation(t), i.onSyncExportSuccess(a, t));
});
}
var l = {};
t.each(o.exportPreferencesInputIds, function(e) {
var t = document.getElementById("input-sync-export-" + e);
l[e] = "checkbox" == t.type ? t.checked : t.value;
}), localStorage[o.providerId + ".exportPreferences"] = JSON.stringify(l);
});
});
}), i.onSynchronizerCreated(m), m;
}), define("providers/downloadProvider", [ "jquery", "eventMgr", "utils", "fileMgr", "classes/Provider", "classes/AsyncTask" ], function(e, t, n, i, o, r) {
var s = new o("download");
return s.sharingAttributes = [ "url" ], s.importPublic = function(t, n) {
var i = void 0, o = void 0, s = new r();
s.onRun(function() {
var n = t.url, r = n.lastIndexOf("/");
return -1 === r ? (s.error(new Error("Invalid URL parameter.")), void 0) : (i = n.substring(r + 1),
e.ajax({
url: DOWNLOAD_PROXY_URL + "download?url=" + n,
type: "GET",
dataType: "text",
timeout: AJAX_TIMEOUT
}).done(function(e) {
o = e, s.chain();
}).fail(function() {
s.error(new Error("Unable to access URL " + n));
}), void 0);
}), s.onSuccess(function() {
n(void 0, i, o);
}), s.onError(function(e) {
n(e);
}), s.enqueue();
}, t.addListener("onReady", function() {
e(".action-import-url").click(function(e) {
var t = n.getInputTextValue("#input-import-url", e);
t && s.importPublic({
url: t
}, function(e, t, n) {
if (!e) {
var o = i.createFile(t, n);
i.selectFile(o);
}
});
});
}), s;
}), define("helpers/githubHelper", [ "jquery", "core", "utils", "eventMgr", "classes/AsyncTask" ], function(e, t, n, i, o) {
function r(t) {
t.onRun(function() {
return d === !0 ? (l = !1, t.error(new Error("Operation not available in offline mode.|stopPublish")),
void 0) : l === !0 ? (t.chain(), void 0) : (e.ajax({
url: "lib/github.js",
dataType: "script",
timeout: AJAX_TIMEOUT
}).done(function() {
l = !0, t.chain();
}).fail(function(e) {
var n = {
error: e.status,
message: e.statusText
};
a(n, t);
}), void 0);
});
}
function s(t) {
var o = void 0, r = void 0;
t.onRun(function() {
function s() {
localStorage.removeItem("githubCode"), o = n.popupWindow("github-oauth-client.html?client_id=" + GITHUB_CLIENT_ID, "stackedit-github-oauth", 960, 600),
o.focus(), r = setInterval(function() {
if (o.closed === !0) {
if (clearInterval(r), o = void 0, r = void 0, d = localStorage.githubCode, void 0 === d) return t.error(new Error(u)),
void 0;
localStorage.removeItem("githubCode"), t.chain(a);
}
}, 500);
}
function a() {
e.getJSON(GATEKEEPER_URL + "authenticate/" + d, function(e) {
void 0 !== e.token ? (l = e.token, localStorage.githubToken = l, c = new Github({
token: l,
auth: "oauth"
}), t.chain()) : t.error(new Error(u));
});
}
if (void 0 !== c) return t.chain(), void 0;
var l = localStorage.githubToken;
if (void 0 !== l) return c = new Github({
token: l,
auth: "oauth"
}), t.chain(), void 0;
i.onMessage("Please make sure the Github authorization popup is not blocked by your browser.");
var u = "Failed to retrieve a token from GitHub.";
t.timeout = ASYNC_TASK_LONG_TIMEOUT;
var d = void 0;
t.chain(s);
}), t.onError(function() {
void 0 !== r && clearInterval(r), void 0 !== o && o.close();
});
}
function a(e, n) {
var i = void 0;
if (e) if (logger.error(e), "string" == typeof e) i = e; else {
if (i = "Could not publish on GitHub.", 401 === e.error || 403 === e.error) return c = void 0,
localStorage.removeItem("githubToken"), i = "Access to GitHub account is not authorized.",
n.retry(new Error(i), 1), void 0;
e.error <= 0 && (l = !1, c = void 0, t.setOffline(), i = "|stopPublish");
}
n.error(new Error(i));
}
var l = void 0, c = void 0, u = {}, d = !1;
return i.addListener("onOfflineChanged", function(e) {
d = e;
}), u.upload = function(e, t, n, i, l, u, d) {
var h = new o();
r(h), s(h), h.onRun(function() {
function o() {
var e = c.getUser();
e.show(void 0, function(e, n) {
return e ? (a(e, h), void 0) : (t = n.login, h.chain(r), void 0);
});
}
function r() {
var o = c.getRepo(t, e);
o.write(n, i, l, u, function(e) {
return e ? (a(e, h), void 0) : (h.chain(), void 0);
});
}
t ? h.chain(r) : h.chain(o);
}), h.onSuccess(function() {
d();
}), h.onError(function(e) {
d(e);
}), h.enqueue();
}, u.uploadGist = function(e, t, n, i, l, u) {
var d = new o();
r(d), s(d), d.onRun(function() {
var o = c.getGist(e), r = {};
r[t] = {
content: l
}, githubFunction = o.update, void 0 === e && (githubFunction = o.create), githubFunction({
description: i,
"public": n,
files: r
}, function(t, n) {
return t ? (404 === t.error && void 0 !== e && (t = "Gist " + e + " not found on GitHub.|removePublish"),
a(t, d), void 0) : (e = n.id, d.chain(), void 0);
});
}), d.onSuccess(function() {
u(void 0, e);
}), d.onError(function(e) {
u(e);
}), d.enqueue();
}, u.downloadGist = function(e, t, n) {
var i = new o();
r(i);
var s = void 0, a = void 0;
i.onRun(function() {
var n = new Github({}), o = n.getGist(e);
o.read(function(n, o) {
if (n) return i.error(new Error("Error trying to access Gist " + e + ".")), void 0;
s = o.description;
var r = o.files[t];
return void 0 === r ? (i.error(new Error("Gist " + e + ' does not contain "' + t + '".')),
void 0) : (a = r.content, i.chain(), void 0);
});
}), i.onSuccess(function() {
n(void 0, s, a);
}), i.onError(function(e) {
n(e);
}), i.enqueue();
}, u;
}), define("providers/gistProvider", [ "utils", "classes/Provider", "helpers/githubHelper" ], function(e, t, n) {
var i = new t("gist", "Gist");
return i.publishPreferencesInputIds = [ "gist-public" ], i.sharingAttributes = [ "gistId", "filename" ],
i.publish = function(e, t, i, o) {
n.uploadGist(e.gistId, e.filename, e.isPublic, t, i, function(t, n) {
return t ? (o(t), void 0) : (e.gistId = n, o(), void 0);
});
}, i.newPublishAttributes = function(t) {
var n = {};
return n.gistId = e.getInputTextValue("#input-publish-gist-id"), n.filename = e.getInputTextValue("#input-publish-filename", t),
n.isPublic = e.getInputChecked("#input-publish-gist-public"), t.isPropagationStopped() ? void 0 : n;
}, i.importPublic = function(e, t) {
n.downloadGist(e.gistId, e.filename, t);
}, i;
}), define("sharing", [ "jquery", "underscore", "utils", "eventMgr", "fileMgr", "classes/AsyncTask", "classes/Provider", "providers/downloadProvider", "providers/gistProvider" ], function(e, t, n, i, o, r, s) {
var a = {}, l = t.chain(arguments).map(function(e) {
return e instanceof s && [ e.providerId, e ];
}).compact().object().value(), c = !1;
return i.addListener("onOfflineChanged", function(e) {
c = e;
}), a.createLink = function(n, o) {
function s() {
o();
}
var a = l[n.provider.providerId];
if (void 0 !== n.sharingLink || void 0 === a || "markdown" != n.format) return o(),
void 0;
var u = new r(), d = void 0;
u.onRun(function() {
if (c === !0) return u.chain(), void 0;
var o = [ MAIN_URL, "viewer.html?provider=", a.providerId ];
t.each(a.sharingAttributes, function(e) {
o.push("&"), o.push(e), o.push("="), o.push(encodeURIComponent(n[e]));
}), o = o.join(""), e.getJSON("https://api-ssl.bitly.com/v3/shorten", {
access_token: BITLY_ACCESS_TOKEN,
longUrl: o
}, function(e) {
e.data ? (d = e.data.url, n.sharingLink = d) : (i.onError("An error occured while creating sharing link."),
n.sharingLink = o), u.chain();
});
}), u.onSuccess(s), u.onError(s), u.enqueue();
}, i.addListener("onReady", function() {
if (viewerMode !== !1) {
var i = n.getURLParameter("provider");
void 0 === i && (i = "download");
var r = l[i];
if (void 0 !== r) {
var s = {};
t.each(r.sharingAttributes, function(e) {
var t = n.getURLParameter(e);
return t ? (s[e] = t, void 0) : (s = void 0, void 0);
}), void 0 !== s && (e("#preview-contents, .navbar .file-title-navbar").hide(),
r.importPublic(s, function(t, n, i) {
if (e("#preview-contents, .navbar .file-title-navbar").show(), !t) {
var r = o.createFile(n, i, void 0, !0);
o.selectFile(r);
}
}));
}
}
}), a;
}), define("providers/bloggerProvider", [ "underscore", "utils", "classes/Provider", "helpers/googleHelper" ], function(e, t, n, i) {
var o = new n("blogger", "Blogger");
return o.defaultPublishFormat = "html", o.publishPreferencesInputIds = [ "blogger-url" ],
o.publish = function(e, t, n, o) {
i.uploadBlogger(e.blogUrl, e.blogId, e.postId, e.labelList, t, n, function(t, n, i) {
return t ? (o(t), void 0) : (e.blogId = n, e.postId = i, o(), void 0);
});
}, o.newPublishAttributes = function(n) {
var i = {}, o = t.getInputTextValue("#input-publish-blogger-url", n);
void 0 !== o && (i.blogUrl = t.checkUrl(o)), i.postId = t.getInputTextValue("#input-publish-postid"),
i.labelList = [];
var r = t.getInputTextValue("#input-publish-labels");
return void 0 !== r && (i.labelList = e.chain(r.split(",")).map(function(e) {
return t.trim(e);
}).compact().value()), n.isPropagationStopped() ? void 0 : i;
}, o;
}), define("providers/githubProvider", [ "utils", "classes/Provider", "settings", "helpers/githubHelper" ], function(e, t, n, i) {
var o = new t("github", "GitHub");
return o.publishPreferencesInputIds = [ "github-reponame", "github-username", "github-branch" ],
o.publish = function(e, t, o, r) {
var s = n.commitMsg;
i.upload(e.repository, e.username, e.branch, e.path, o, s, r);
}, o.newPublishAttributes = function(t) {
var n = {};
return n.repository = e.getInputTextValue("#input-publish-github-reponame", t),
n.username = e.getInputTextValue("#input-publish-github-username"), n.branch = e.getInputTextValue("#input-publish-github-branch", t),
n.path = e.getInputTextValue("#input-publish-file-path", t), t.isPropagationStopped() ? void 0 : n;
}, o;
}), define("helpers/sshHelper", [ "jquery", "core", "eventMgr", "settings", "classes/AsyncTask" ], function(e, t, n, i, o) {
function r(e) {
e.onRun(function() {
return l === !0 ? (e.error(new Error("Operation not available in offline mode.|stopPublish")),
void 0) : (e.chain(), void 0);
});
}
function s(e, n) {
var i = void 0;
e && (logger.error(e), "string" == typeof e ? i = "SSH error: " + e + "." : (i = "Could not publish on SSH server.",
e.code <= 0 && (t.setOffline(), i = "|stopPublish"))), n.error(new Error(i));
}
var a = {}, l = !1;
return n.addListener("onOfflineChanged", function(e) {
l = e;
}), a.upload = function(t, n, a, l, c, u, d, h) {
var p = new o();
r(p), p.onRun(function() {
var o = i.sshProxy + "upload", r = {
host: t,
port: n,
username: a,
password: l,
path: c,
title: u,
content: d
};
e.ajax({
url: o,
data: r,
type: "POST",
dataType: "json",
timeout: AJAX_TIMEOUT
}).done(function(e) {
return void 0 === e.error ? (p.chain(), void 0) : (s(e.error, p), void 0);
}).fail(function(e) {
var t = {
code: e.status,
message: e.statusText
};
s(t, p);
});
}), p.onSuccess(function() {
h();
}), p.onError(function(e) {
h(e);
}), p.enqueue();
}, a;
}), define("providers/sshProvider", [ "utils", "classes/Provider", "helpers/sshHelper" ], function(e, t, n) {
var i = new t("ssh", "SSH server");
return i.publishPreferencesInputIds = [ "ssh-host", "ssh-port", "ssh-username", "ssh-password" ],
i.publish = function(e, t, i, o) {
n.upload(e.host, e.port, e.username, e.password, e.path, t, i, o);
}, i.newPublishAttributes = function(t) {
var n = {};
return n.host = e.getInputTextValue("#input-publish-ssh-host", t, /^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-]*[A-Za-z0-9])$/),
n.port = e.getInputIntValue("#input-publish-ssh-port", void 0, 0), n.username = e.getInputTextValue("#input-publish-ssh-username", t),
n.password = e.getInputTextValue("#input-publish-ssh-password", t), n.path = e.getInputTextValue("#input-publish-file-path", t),
t.isPropagationStopped() ? void 0 : n;
}, i;
}), define("helpers/tumblrHelper", [ "jquery", "core", "utils", "eventMgr", "classes/AsyncTask" ], function(e, t, n, i, o) {
function r(e) {
e.onRun(function() {
return u === !0 ? (e.error(new Error("Operation not available in offline mode.|stopPublish")),
void 0) : (e.chain(), void 0);
});
}
function s(t) {
var o = void 0, r = void 0;
t.onRun(function() {
function s() {
e.getJSON(TUMBLR_PROXY_URL + "request_token", function(e) {
void 0 !== e.oauth_token ? (h = e, t.chain(a)) : t.error(new Error(d));
});
}
function a() {
localStorage.removeItem("tumblrVerifier"), o = n.popupWindow("tumblr-oauth-client.html?oauth_token=" + h.oauth_token, "stackedit-tumblr-oauth", 800, 600),
o.focus(), r = setInterval(function() {
if (o.closed === !0) {
if (clearInterval(r), o = void 0, r = void 0, h.oauth_verifier = localStorage.tumblrVerifier,
void 0 === h.oauth_verifier) return t.error(new Error(d)), void 0;
localStorage.removeItem("tumblrVerifier"), t.chain(c);
}
}, 500);
}
function c() {
e.getJSON(TUMBLR_PROXY_URL + "access_token", h, function(e) {
void 0 !== e.access_token && void 0 !== e.access_token_secret ? (localStorage.tumblrOauthParams = JSON.stringify(e),
l = e, t.chain()) : t.error(new Error(d));
});
}
if (void 0 !== l) return t.chain(), void 0;
var u = localStorage.tumblrOauthParams;
if (void 0 !== u) return l = JSON.parse(u), t.chain(), void 0;
i.onMessage("Please make sure the Tumblr authorization popup is not blocked by your browser.");
var d = "Failed to retrieve a token from Tumblr.";
t.timeout = ASYNC_TASK_LONG_TIMEOUT;
var h = void 0;
t.chain(s);
}), t.onError(function() {
void 0 !== r && clearInterval(r), void 0 !== o && o.close();
});
}
function a(e, n) {
var i = void 0;
if (e) if (logger.error(e), "string" == typeof e) i = e; else {
if (i = "Could not publish on Tumblr.", 401 === e.code || 403 === e.code) return l = void 0,
localStorage.removeItem("tumblrOauthParams"), i = "Access to Tumblr account is not authorized.",
n.retry(new Error(i), 1), void 0;
e.code <= 0 && (t.setOffline(), i = "|stopPublish");
}
n.error(new Error(i));
}
var l = void 0, c = {}, u = !1;
return i.addListener("onOfflineChanged", function(e) {
u = e;
}), c.upload = function(t, n, i, c, u, d, h) {
var p = new o();
r(p), s(p), p.onRun(function() {
var o = e.extend({
blog_hostname: t,
post_id: n,
tags: i,
format: c,
title: u,
content: d
}, l);
e.ajax({
url: TUMBLR_PROXY_URL + "post",
data: o,
type: "POST",
dataType: "json",
timeout: AJAX_TIMEOUT
}).done(function(e) {
n = e.id, p.chain();
}).fail(function(e) {
var t = {
code: e.status,
message: e.statusText
};
404 === t.code && void 0 !== n && (t = "Post " + n + " not found on Tumblr.|removePublish"),
a(t, p);
});
}), p.onSuccess(function() {
h(void 0, n);
}), p.onError(function(e) {
h(e);
}), p.enqueue();
}, c;
}), define("providers/tumblrProvider", [ "utils", "classes/Provider", "helpers/tumblrHelper" ], function(e, t, n) {
var i = new t("tumblr", "Tumblr");
return i.publishPreferencesInputIds = [ "tumblr-hostname" ], i.publish = function(e, t, i, o) {
n.upload(e.blogHostname, e.postId, e.tags, "markdown" == e.format ? "markdown" : "html", t, i, function(t, n) {
return t ? (o(t), void 0) : (e.postId = n, o(), void 0);
});
}, i.newPublishAttributes = function(t) {
var n = {};
return n.blogHostname = e.getInputTextValue("#input-publish-tumblr-hostname", t, /^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-]*[A-Za-z0-9])$/),
n.postId = e.getInputTextValue("#input-publish-postid"), n.tags = e.getInputTextValue("#input-publish-tags"),
t.isPropagationStopped() ? void 0 : n;
}, i;
}), define("helpers/wordpressHelper", [ "jquery", "core", "utils", "eventMgr", "classes/AsyncTask" ], function(e, t, n, i, o) {
function r(e) {
e.onRun(function() {
return u === !0 ? (e.error(new Error("Operation not available in offline mode.|stopPublish")),
void 0) : (e.chain(), void 0);
});
}
function s(t) {
var o = void 0, r = void 0;
t.onRun(function() {
function s() {
localStorage.removeItem("wordpressCode"), o = n.popupWindow("wordpress-oauth-client.html?client_id=" + WORDPRESS_CLIENT_ID, "stackedit-wordpress-oauth", 960, 600),
o.focus(), r = setInterval(function() {
if (o.closed === !0) {
if (clearInterval(r), o = void 0, r = void 0, u = localStorage.wordpressCode, void 0 === u) return t.error(new Error(c)),
void 0;
localStorage.removeItem("wordpressCode"), t.chain(a);
}
}, 500);
}
function a() {
e.getJSON(WORDPRESS_PROXY_URL + "authenticate/" + u, function(e) {
void 0 !== e.token ? (l = e.token, localStorage.wordpressToken = l, t.chain()) : t.error(new Error(c));
});
}
if (l = localStorage.wordpressToken, void 0 !== l) return t.chain(), void 0;
i.onMessage("Please make sure the Wordpress authorization popup is not blocked by your browser.");
var c = "Failed to retrieve a token from Wordpress.";
t.timeout = ASYNC_TASK_LONG_TIMEOUT;
var u = void 0;
t.chain(s);
}), t.onError(function() {
void 0 !== r && clearInterval(r), void 0 !== o && o.close();
});
}
function a(e, n) {
var i = void 0;
if (e) if (logger.error(e), "string" == typeof e) i = e; else {
if (i = "Could not publish on WordPress.", 400 === e.code && "invalid_token" == e.message || 401 === e.code || 403 === e.code) return localStorage.removeItem("wordpressToken"),
i = "Access to WordPress account is not authorized.", n.retry(new Error(i), 1),
void 0;
e.code <= 0 && (t.setOffline(), i = "|stopPublish");
}
n.error(new Error(i));
}
var l = void 0, c = {}, u = !1;
return i.addListener("onOfflineChanged", function(e) {
u = e;
}), c.upload = function(t, n, i, c, u, d) {
var h = new o();
r(h), s(h), h.onRun(function() {
var o = WORDPRESS_PROXY_URL + "post", r = {
token: l,
site: t,
postId: n,
tags: i,
title: c,
content: u
};
e.ajax({
url: o,
data: r,
type: "POST",
dataType: "json",
timeout: AJAX_TIMEOUT
}).done(function(e) {
if (e.body.ID) return n = e.body.ID, h.chain(), void 0;
var i = {
code: e.code,
message: e.body.error
};
404 === i.code && ("unknown_blog" == i.message ? i = 'Site "' + t + '" not found on WordPress.|removePublish' : "unknown_post" == i.message && (i = "Post " + n + " not found on WordPress.|removePublish")),
a(i, h);
}).fail(function(e) {
var t = {
code: e.status,
message: e.statusText
};
a(t, h);
});
}), h.onSuccess(function() {
d(void 0, n);
}), h.onError(function(e) {
d(e);
}), h.enqueue();
}, c;
}), define("providers/wordpressProvider", [ "utils", "classes/Provider", "helpers/wordpressHelper" ], function(e, t, n) {
var i = new t("wordpress", "WordPress");
return i.defaultPublishFormat = "html", i.publishPreferencesInputIds = [ "wordpress-site" ],
i.publish = function(e, t, i, o) {
n.upload(e.site, e.postId, e.tags, t, i, function(t, n) {
return t ? (o(t), void 0) : (e.postId = n, o(), void 0);
});
}, i.newPublishAttributes = function(t) {
var n = {};
return n.site = e.getInputTextValue("#input-publish-wordpress-site", t, /^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-]*[A-Za-z0-9])$/),
n.postId = e.getInputTextValue("#input-publish-postid"), n.tags = e.getInputTextValue("#input-publish-tags"),
t.isPropagationStopped() ? void 0 : n;
}, i;
}), define("publisher", [ "jquery", "underscore", "utils", "settings", "eventMgr", "fileSystem", "fileMgr", "sharing", "classes/Provider", "classes/AsyncTask", "config", "providers/bloggerProvider", "providers/dropboxProvider", "providers/gistProvider", "providers/githubProvider", "providers/gdriveProvider", "providers/sshProvider", "providers/tumblrProvider", "providers/wordpressProvider" ], function(e, t, n, i, o, r, s, a, l, c) {
function u(e, t, i) {
return void 0 === t.format && (t.format = n.getInputRadio("radio-publish-format"),
"template" == t.format && n.getInputChecked("#checkbox-publish-custom-template") && (t.customTmpl = n.getInputValue("#textarea-publish-custom-template"))),
"markdown" == t.format ? e.content : "html" == t.format ? i : g.applyTemplate(e, t, i);
}
function d(e, t) {
if (0 === v.length) return e(t), void 0;
var n = v.pop(), i = u(b, n, y);
n.provider.publish(n, b.title, i, function(i) {
if (void 0 !== i) {
var r = i.toString();
if (-1 !== r.indexOf("|removePublish") && (b.removePublishLocation(n), o.onPublishRemoved(b, n)),
-1 !== r.indexOf("|stopPublish")) return e(i), void 0;
}
d(e, t || i);
});
}
function h(e, i) {
var r = void 0;
do r = "publish." + n.randomString(); while (t.has(localStorage, r));
i.publishIndex = r, e.addPublishLocation(i), o.onNewPublishSuccess(e, i);
}
function p(o) {
var r = o.defaultPublishFormat || "markdown";
E = o, e(".publish-provider-name").text(o.providerName), e('div[class*=" modal-publish-"]').hide().filter(".modal-publish-" + o.providerId).show(),
n.resetModalInputs(), n.setInputRadio("radio-publish-format", r), n.setInputChecked("#checkbox-publish-custom-template", !1),
n.setInputValue("#textarea-publish-custom-template", i.template);
var s = n.retrieveIgnoreError(o.providerId + ".publishPreferences");
s && (t.each(o.publishPreferencesInputIds, function(e) {
var i = s[e];
t.isBoolean(i) ? n.setInputChecked("#input-publish-" + e, i) : n.setInputValue("#input-publish-" + e, i);
}), n.setInputRadio("radio-publish-format", s.format), n.setInputChecked("#checkbox-publish-custom-template", void 0 !== s.customTmpl),
n.setInputValue("#textarea-publish-custom-template", s.customTmpl || i.template)),
e(".modal-publish").modal();
}
function f(e) {
var n = E, i = n.newPublishAttributes(e);
if (void 0 !== i) {
var o = s.currentFile, r = w, l = u(o, i, r);
n.publish(i, o.title, l, function(e) {
void 0 === e && (i.provider = n, a.createLink(i, function() {
h(o, i);
}));
});
var c = {};
t.each(n.publishPreferencesInputIds, function(e) {
var t = document.getElementById("input-publish-" + e);
c[e] = "checkbox" == t.type ? t.checked : t.value;
}), c.format = i.format, c.customTmpl = i.customTmpl, localStorage[n.providerId + ".publishPreferences"] = JSON.stringify(c);
}
}
var g = {}, m = t.chain(arguments).map(function(e) {
return e instanceof l && [ e.providerId, e ];
}).compact().object().value();
t.each(r, function(e) {
t.each(n.retrieveIndexArray(e.fileIndex + ".publish"), function(t) {
try {
var i = JSON.parse(localStorage[t]);
i.publishIndex = t;
var r = m[i.provider];
if (!r) throw new Error("Invalid provider ID: " + i.provider);
i.provider = r, e.publishLocations[t] = i;
} catch (s) {
o.onError(s), n.removeIndexFromArray(e.fileIndex + ".publish", t), localStorage.removeItem(t);
}
});
}), g.applyTemplate = function(e, n, r) {
try {
var s = n && n.customTmpl || i.template;
return t.template(s, {
documentTitle: e.title,
documentMarkdown: e.content,
documentHTML: r,
publishAttributes: n
});
} catch (a) {
return o.onError(a), a.message;
}
};
var v = [], b = void 0, y = void 0, w = void 0;
o.addListener("onPreviewFinished", function(e) {
w = e;
});
var C = !1;
o.addListener("onOfflineChanged", function(e) {
C = e;
});
var x = !1;
g.publish = function() {
x !== !0 && C !== !0 && (x = !0, o.onPublishRunning(!0), b = s.currentFile, y = w,
v = t.values(b.publishLocations), d(function(e) {
x = !1, o.onPublishRunning(!1), void 0 === e && o.onPublishSuccess(b);
}));
};
var E = void 0, C = !1;
o.addListener("onOfflineChanged", function(e) {
C = e;
});
var S = [ "<li>", ' <a href="#"', ' class="action-init-publish-<%= provider.providerId %>">', ' <i class="icon-provider-<%= provider.providerId %>"></i> <%= provider.providerName %>', " </a>", "</li>" ].join("");
return o.addListener("onReady", function() {
if (viewerMode === !1) {
var r = document.querySelector(".menu-panel .collapse-publish-on .nav"), a = t.reduce(m, function(e, n) {
return e + t.template(S, {
provider: n
});
}, "");
r.innerHTML = a, t.each(m, function(t) {
e(r.querySelector(".action-init-publish-" + t.providerId)).click(function() {
p(t);
}), e(".action-publish-" + t.providerId).click(function() {
p(t);
});
});
}
e(".action-process-publish").click(f);
var l = e(".publish-custom-template-collapse").collapse({
toggle: !1
}), u = e("#textarea-publish-custom-template"), d = t.debounce(function() {
l.collapse("template" == n.getInputRadio("radio-publish-format") ? "show" : "hide");
}, 100);
e("#checkbox-publish-custom-template").change(function() {
u.prop("disabled", !this.checked);
}), e("input:radio[name=radio-publish-format]").change(function() {
d();
}), e(".modal-publish").on("hidden.bs.modal", function() {
l.collapse("hide");
}), e(".action-download-md").click(function() {
var e = s.currentFile.content, t = s.currentFile.title;
n.saveAs(e, t + ".md");
}), e(".action-download-html").click(function() {
var e = s.currentFile.title;
n.saveAs(w, e + ".html");
}), e(".action-download-template").click(function() {
var e = s.currentFile, t = g.applyTemplate(e, void 0, w);
n.saveAs(t, e.title + (-1 === i.template.indexOf("documentHTML") ? ".md" : ".html"));
}), e(".action-download-pdf").click(function() {
var e = s.currentFile, t = g.applyTemplate(e, {
customTmpl: i.pdfTemplate
}, w), r = new c(), a = void 0;
r.onRun(function() {
if (C === !0) return o.onError("Operation not available in offline mode."), r.chain(),
void 0;
var e = new XMLHttpRequest();
e.open("POST", HTMLTOPDF_URL, !0), e.setRequestHeader("Content-type", "application/x-www-form-urlencoded"),
e.responseType = "blob", e.onreadystatechange = function() {
4 == this.readyState && (200 == this.status ? a = this.response : o.onError("Error when trying to generate PDF: " + this.status),
r.chain());
}, e.send(t);
}), r.onSuccess(function() {
void 0 !== a && n.saveAs(a, s.currentFile.title + ".pdf");
}), r.enqueue();
});
}), o.onPublisherCreated(g), g;
}), define("providers/gplusProvider", [ "underscore", "utils", "classes/Provider", "eventMgr", "helpers/googleHelper" ], function(e, t, n, i, o) {
function r(t, n) {
var i = void 0;
return e.find(t.thumbnails, function(e) {
var t = !1;
return e.url.replace(/(.*\/s)\d.*?(\/[^\/]+)/, function(e, o, r) {
i = o + n + r, t = !0;
}), t;
}), i;
}
function s() {
return c.thumbnails ? (t.resetModalInputs(), $(".modal-import-image img").prop("src", r(c, 128)),
t.setInputValue("#input-import-image-title", c.name), u && t.setInputValue("#input-import-image-size", u.size),
$(".modal-import-image").modal(), void 0) : (i.onError("Image " + c.name + " is not accessible."),
callback(!0), void 0);
}
var a = "gplus", l = new n(a, "Google+"), c = void 0, u = t.retrieveIgnoreError(a + ".importImagePreferences"), d = void 0;
return l.importImage = function(e) {
d = e, o.picker(function(t, n) {
return t || 0 === n.length ? (e(t), void 0) : (c = n[0], s(), void 0);
}, "img");
}, l.uploadImage = function(e, t, n) {
d = n, o.uploadImg(e, t, "default", function(t, i) {
return t || !i ? (n(t), void 0) : (c = {
name: e,
thumbnails: []
}, $(i).find("thumbnail").each(function() {
c.thumbnails.push({
url: $(this).attr("url")
});
}), s(), void 0);
});
}, i.addListener("onReady", function() {
$(".action-import-image").click(function() {
var e = t.getInputIntValue("#input-import-image-size", void 0, 0) || 0, n = t.getInputTextValue("#input-import-image-title"), i = r(c, e);
n && (i += ' "' + n + '"'), d(void 0, i), u = {}, e && (u.size = e), localStorage[a + ".importImagePreferences"] = JSON.stringify(u);
});
}), l;
}), define("mediaImporter", [ "jquery", "underscore", "classes/Provider", "core", "eventMgr", "providers/gplusProvider" ], function(e, t, n, i, o) {
var r = {}, s = t.chain(arguments).map(function(e) {
return e instanceof n && [ e.providerId, e ];
}).compact().object().value();
return o.addListener("onReady", function() {
function n(n) {
var o = (n.dataTransfer || n.target).files, r = t.first(o);
if (r.name.match(/.(jpe?g|png|gif)$/)) {
n.stopPropagation(), n.preventDefault();
var a = new FileReader();
a.onload = function() {
return function(t) {
var n = new Uint8Array(t.target.result);
s.gplus.uploadImage(r.name, n, function(t, n) {
if (!t) {
i.catchModal = !0, e("#wmd-image-button").click(), i.catchModal = !1;
var o = i.insertLinkCallback;
i.insertLinkCallback = void 0, o(n || null);
}
});
};
}(r);
var l = r.slice(0, IMPORT_IMG_MAX_CONTENT_SIZE);
a.readAsArrayBuffer(l);
}
}
function o(e) {
e.stopPropagation(), e.preventDefault(), e.dataTransfer.dropEffect = "copy";
}
t.each(s, function(t) {
e(".action-import-image-" + t.providerId).click(function() {
var e = i.insertLinkCallback;
i.insertLinkCallback = void 0, t.importImage(function(t, n) {
return t ? (e(null), void 0) : (e(n || null), void 0);
});
});
}), e("#wmd-input").each(function() {
this.addEventListener("dragover", o, !1), this.addEventListener("drop", n, !1);
});
}), r;
}), define("css/normalize", [ "require", "module" ], function() {
function e(e, i, o) {
if (0 === e.indexOf("data:")) return e;
if (e = r(e), e.match(/^\//) || e.match(s)) return e;
var a = o.match(s), l = i.match(s);
return !l || a && a[1] == l[1] && a[2] == l[2] ? n(t(e, i), o) : t(e, i);
}
function t(e, t) {
"./" == e.substr(0, 2) && (e = e.substr(2));
var n = t.split("/"), i = e.split("/");
for (n.pop(); curPart = i.shift(); ) ".." == curPart ? n.pop() : n.push(curPart);
return n.join("/");
}
function n(e, t) {
var n = t.split("/");
for (n.pop(), t = n.join("/") + "/", i = 0; t.substr(i, 1) == e.substr(i, 1); ) i++;
for (;"/" != t.substr(i, 1); ) i--;
t = t.substr(i + 1), e = e.substr(i + 1), n = t.split("/");
var o = e.split("/");
for (out = ""; n.shift(); ) out += "../";
for (;curPart = o.shift(); ) out += curPart + "/";
return out.substr(0, out.length - 1);
}
var o = /([^:])\/+/g, r = function(e) {
return e.replace(o, "$1/");
}, s = /[^\:\/]*:\/\/([^\/])*/, a = function(t, n, i, o) {
n = r(n), i = r(i);
for (var s, a, t, l = /@import\s*("([^"]*)"|'([^']*)')|url\s*\(\s*(\s*"([^"]*)"|'([^']*)'|[^\)]*\s*)\s*\)/gi; s = l.exec(t); ) {
a = s[3] || s[2] || s[5] || s[6] || s[4];
var c;
c = o && "/" == a.substr(0, 1) ? o + a : e(a, n, i);
var u = s[5] || s[6] ? 1 : 0;
t = t.substr(0, l.lastIndex - a.length - u - 1) + c + t.substr(l.lastIndex - u - 1),
l.lastIndex = l.lastIndex + (c.length - a.length);
}
return t;
};
return a.convertURIBase = e, a;
}), define("css/css", [ "./normalize" ], function(e) {
function t(e, t) {
for (var n = 0, i = e.length; i > n; n++) if (e[n] === t) return n;
return -1;
}
if ("undefined" == typeof window) return {
load: function(e, t, n) {
n();
}
};
var n = !1, i = document.getElementsByTagName("head")[0], o = window.navigator.userAgent.match(/Trident\/([^ ;]*)|AppleWebKit\/([^ ;]*)|Opera\/([^ ;]*)|rv\:([^ ;]*)(.*?)Gecko\/([^ ;]*)|MSIE\s([^ ;]*)/), r = !1;
o && (o[1] || o[7] ? (r = parseInt(o[1]) < 6 || parseInt(o[7]) <= 9, o = "trident") : o[2] ? (r = !0,
o = "webkit") : o[3] || (o[4] ? (r = parseInt(o[4]) < 18, o = "gecko") : n && alert("Engine detection failed")));
var s = {}, a = /^\/|([^\:\/]*:)/;
s.pluginBuilder = "./css-builder";
var l = [], c = {}, u = [];
s.addBuffer = function(e) {
-1 == t(l, e) && -1 == t(u, e) && (l.push(e), u.push(e));
}, s.setBuffer = function(t, n) {
var i = window.location.pathname.split("/");
i.pop(), i = i.join("/") + "/";
var o = require.toUrl("base_url").split("/");
o.pop();
var r = o.join("/") + "/";
r = e.convertURIBase(r, i, "/"), r.match(a) || (r = "/" + r), "/" != r.substr(r.length - 1, 1) && (r += "/"),
s.inject(e(t, r, i));
for (var u = 0; u < l.length; u++) (n && ".less" == l[u].substr(l[u].length - 5, 5) || !n && ".css" == l[u].substr(l[u].length - 4, 4)) && (function(e) {
c[e] = c[e] || !0, setTimeout(function() {
"function" == typeof c[e] && c[e](), delete c[e];
}, 7);
}(l[u]), l.splice(u--, 1));
}, s.attachBuffer = function(e, n) {
for (var i = 0; i < l.length; i++) if (l[i] == e) return c[e] = n, !0;
return c[e] === !0 ? (c[e] = n, !0) : -1 != t(u, e) ? (n(), !0) : void 0;
};
var d = function(e, t) {
setTimeout(function() {
for (var n = 0; n < document.styleSheets.length; n++) {
var i = document.styleSheets[n];
if (i.href == e.href) return t();
}
d(e, t);
}, 10);
}, h = function(e, t) {
setTimeout(function() {
try {
return e.sheet.cssRules, t();
} catch (n) {}
h(e, t);
}, 10);
};
if ("trident" == o && r) var p = [], f = [], g = 0, m = function(e, t) {
var n;
f.push({
url: e,
cb: t
}), n = p.shift(), !n && g++ < 31 && (n = document.createElement("style"), i.appendChild(n)),
n && v(n);
}, v = function(e) {
var t = f.shift();
if (!t) return e.onload = y, p.push(e), void 0;
e.onload = function() {
t.cb(t.ss), v(e);
};
var n = e.styleSheet;
t.ss = n.imports[n.addImport(t.url)];
};
var b = function(e) {
var t = document.createElement("link");
return t.type = "text/css", t.rel = "stylesheet", t.href = e, t;
}, y = function() {};
s.linkLoad = function(e, t) {
var s = setTimeout(function() {
n && alert("timeout"), t();
}, 1e3 * _ - 100), a = function() {
clearTimeout(s), l && (l.onload = y), setTimeout(t, 7);
};
if (r) if ("webkit" == o) {
var l = b(e);
d(l, a), i.appendChild(l);
} else if ("gecko" == o) {
var c = document.createElement("style");
c.textContent = '@import "' + e + '"', h(c, a), i.appendChild(c);
} else "trident" == o && m(e, a); else {
var l = b(e);
l.onload = a, i.appendChild(l);
}
};
var w, C = [ "Msxml2.XMLHTTP", "Microsoft.XMLHTTP", "Msxml2.XMLHTTP.4.0" ], x = {}, E = function(e, t, n) {
if (x[e]) return t(x[e]), void 0;
var i, o, r;
if ("undefined" != typeof XMLHttpRequest) i = new XMLHttpRequest(); else if ("undefined" != typeof ActiveXObject) for (o = 0; 3 > o; o += 1) {
r = C[o];
try {
i = new ActiveXObject(r);
} catch (s) {}
if (i) {
C = [ r ];
break;
}
}
i.open("GET", e, requirejs.inlineRequire ? !1 : !0), i.onreadystatechange = function() {
var o, r;
4 === i.readyState && (o = i.status, o > 399 && 600 > o ? (r = new Error(e + " HTTP status: " + o),
r.xhr = i, n(r)) : (x[e] = i.responseText, t(i.responseText)));
}, i.send(null);
}, S = 0;
s.inject = function(e) {
31 > S && (w = document.createElement("style"), w.type = "text/css", i.appendChild(w),
S++), w.styleSheet ? w.styleSheet.cssText += e : w.appendChild(document.createTextNode(e));
};
var A = /@import\s*(url)?\s*(('([^']*)'|"([^"]*)")|\(('([^']*)'|"([^"]*)"|([^\)]*))\))\s*;?/g, k = window.location.pathname.split("/");
k.pop(), k = k.join("/") + "/";
var F = function(t, n, i) {
t.match(a) || (t = "/" + e.convertURIBase(t, k, "/")), E(t, function(o) {
o = e(o, t, k);
for (var r, s = [], a = [], l = []; r = A.exec(o); ) {
var c = r[4] || r[5] || r[7] || r[8] || r[9];
s.push(c), a.push(A.lastIndex - r[0].length), l.push(r[0].length);
}
for (var u = 0, d = 0; d < s.length; d++) (function(e) {
F(s[e], function(t) {
o = o.substr(0, a[e]) + t + o.substr(a[e] + l[e]);
for (var i = t.length - l[e], r = e + 1; r < s.length; r++) a[r] += i;
u++, u == s.length && n(o);
}, i);
})(d);
0 == s.length && n(o);
}, i);
};
s.normalize = function(e, t) {
return ".css" == e.substr(e.length - 4, 4) && (e = e.substr(0, e.length - 4)), t(e);
};
var _, $ = !1;
return s.load = function(e, t, i, o, a) {
_ = _ || o.waitSeconds || 7;
var l = e + (a ? ".less" : ".css");
if (!s.attachBuffer(l, i)) {
var c = t.toUrl(l);
!$ && n && (alert(r ? "hacking links" : "not hacking"), $ = !0), a ? F(c, function(e) {
a && (e = a(e, function(e) {
s.inject(e), setTimeout(i, 7);
}));
}) : s.linkLoad(c, i);
}
}, n && (s.inspect = function() {
return stylesheet.styleSheet ? stylesheet.styleSheet.cssText : stylesheet.innerHTML ? stylesheet.innerHTML : void 0;
}), s;
}), define("css", [ "css/css" ], function(e) {
return e;
}), requirejs.config({
waitSeconds: 0,
packages: [ {
name: "ace",
location: "bower-libs/ace/lib/ace",
main: "ace"
}, {
name: "css",
location: "bower-libs/require-css",
main: "css"
}, {
name: "less",
location: "bower-libs/require-less",
main: "less"
} ],
paths: {
jquery: "bower-libs/jquery/jquery",
underscore: "bower-libs/underscore/underscore",
crel: "bower-libs/crel/crel",
jgrowl: "bower-libs/jgrowl/jquery.jgrowl",
mousetrap: "bower-libs/mousetrap/mousetrap",
toMarkdown: "bower-libs/to-markdown/src/to-markdown",
text: "bower-libs/requirejs-text/text",
mathjax: "../lib/MathJax/MathJax.js?config=TeX-AMS_HTML",
bootstrap: "bower-libs/bootstrap/dist/js/bootstrap",
requirejs: "bower-libs/requirejs/require",
"google-code-prettify": "bower-libs/google-code-prettify/src/prettify",
highlightjs: "bower-libs/highlightjs/highlight.pack",
"jquery-waitforimages": "bower-libs/waitForImages/src/jquery.waitforimages",
"jquery-ui": "bower-libs/jquery-ui/ui/jquery-ui",
"jquery-ui-core": "bower-libs/jquery-ui/ui/jquery.ui.core",
"jquery-ui-widget": "bower-libs/jquery-ui/ui/jquery.ui.widget",
"jquery-ui-mouse": "bower-libs/jquery-ui/ui/jquery.ui.mouse",
"jquery-ui-draggable": "bower-libs/jquery-ui/ui/jquery.ui.draggable",
"jquery-ui-effect": "bower-libs/jquery-ui/ui/jquery.ui.effect",
"jquery-ui-effect-slide": "bower-libs/jquery-ui/ui/jquery.ui.effect-slide",
uilayout: "libs/layout",
FileSaver: "bower-libs/FileSaver/FileSaver",
stacktrace: "bower-libs/stacktrace/stacktrace",
"requirejs-text": "bower-libs/requirejs-text/text",
"bootstrap-tour": "bower-libs/bootstrap-tour/build/js/bootstrap-tour",
css_browser_selector: "bower-libs/css_browser_selector/css_browser_selector",
"jquery-mousewheel": "bower-libs/jquery-mousewheel/jquery.mousewheel",
"pagedown-ace": "bower-libs/pagedown-ace/Markdown.Editor",
"pagedown-extra": "bower-libs/pagedown-extra/Markdown.Extra",
"ace/requirejs/text": "libs/ace_text",
"ace/commands/default_commands": "libs/ace_commands",
"js-yaml": "bower-libs/js-yaml/js-yaml"
},
shim: {
underscore: {
exports: "_"
},
mathjax: [ "libs/mathjax_init" ],
jgrowl: {
deps: [ "jquery" ],
exports: "jQuery.jGrowl"
},
mousetrap: {
exports: "Mousetrap"
},
toMarkdown: {
deps: [ "jquery" ],
exports: "toMarkdown"
},
"bootstrap-tour": [ "bootstrap" ],
bootstrap: [ "jquery" ],
"jquery-waitforimages": [ "jquery" ],
"jquery-mousewheel": [ "jquery" ],
uilayout: [ "jquery-ui-effect-slide" ],
"jquery-ui-effect-slide": [ "jquery-ui-effect" ],
"jquery-ui-effect": [ "jquery-ui-draggable" ],
"jquery-ui-draggable": [ "jquery-ui-mouse" ],
"jquery-ui-mouse": [ "jquery-ui-widget" ],
"jquery-ui-widget": [ "jquery-ui-core" ],
"jquery-ui-core": [ "jquery" ],
"pagedown-extra": [ "pagedown-ace", "google-code-prettify", "highlightjs" ],
"pagedown-ace": [ "bower-libs/pagedown-ace/Markdown.Converter" ]
}
});
var logger = {
log: function() {},
info: function() {},
warn: function() {},
error: function() {}
};
/(\?|&)console($|&)/.test(location.search) && (logger = console);
var viewerMode = /(^| )viewer($| )/.test(document.body.className), lightMode = viewerMode || /(\?|&)light($|&)/.test(location.search) || function(e) {
return /(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(e) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(e.substr(0, 4)) ? !0 : void 0;
}(navigator.userAgent || navigator.vendor || window.opera), theme = localStorage.theme || "default", themeModule = "less!themes/" + theme;
-1 !== baseDir.indexOf("-min") && (themeModule = "css!themes/" + theme), require([ "jquery", "core", "eventMgr", "synchronizer", "publisher", "mediaImporter", "css", themeModule ], function(e, t, n) {
e(function() {
t.onReady(), window.applicationCache && window.applicationCache.addEventListener("updateready", function() {
window.applicationCache.status === window.applicationCache.UPDATEREADY && (window.applicationCache.swapCache(),
n.onMessage("New version available!\nJust refresh the page to upgrade."));
}, !1);
});
}), define("main", function() {});