diff --git a/code/modules/nano/nanoui.dm b/code/modules/nano/nanoui.dm index 8b749a67903..f7aee8f2875 100644 --- a/code/modules/nano/nanoui.dm +++ b/code/modules/nano/nanoui.dm @@ -111,8 +111,6 @@ nanoui is used to open and update nano browser uis // CodeMirror add_script("codemirror-compressed.js") // A custom minified JavaScript file of CodeMirror, with the following plugins: CSS Mode, NTSL Mode, CSS-hint addon, Search addon, Sublime Keymap. - add_stylesheet("codemirror.css") // A CSS sheet containing the basic stylings and formatting information for CodeMirror. - add_stylesheet("cm_lesser-dark.css") // A theme for CodeMirror to use, which closely resembles the rest of the NanoUI style. /** * Set the current status (also known as visibility) of this ui. diff --git a/nano/Gulpfile.coffee b/nano/Gulpfile.coffee deleted file mode 100644 index a8c604a2280..00000000000 --- a/nano/Gulpfile.coffee +++ /dev/null @@ -1,108 +0,0 @@ -### Settings ### -util = require("gulp-util") -s = - min: util.env.min - -# Project Paths -input = - fonts: "**/*.{eot,woff2}" - images: "images" - layouts: "layouts/" - scripts: - lib: "scripts/libraries" - main: "scripts/nano" - styles: "styles" - templates: "templates/" - -output = - dir: "assets" - scripts: - lib: "libraries.min.js" - main: "nano.js" - css: "nanoui.css" - -### Pacakages ### -bower = require "main-bower-files" -child_process = require "child_process" -del = require "del" -gulp = require "gulp" -merge = require "merge-stream" - -### Plugins ### -g = require("gulp-load-plugins")({replaceString: /^gulp(-|\.)|-/g}) -p = - autoprefixer: require "autoprefixer" - gradient: require "postcss-filter-gradient" - opacity: require "postcss-opacity" - rgba: require "postcss-color-rgba-fallback" - plsfilters: require "pleeease-filters" - - -### Helpers ### - -glob = (path) -> - "#{path}/*" - -### Tasks ### -gulp.task "default", ["fonts", "scripts", "styles"] - -gulp.task "clean", -> - del glob output.dir - -gulp.task "watch", -> - gulp.watch [glob input.images], ["reload"] - gulp.watch [glob input.layouts], ["reload"] - gulp.watch [glob input.scripts.lib], ["reload"] - gulp.watch [glob input.scripts.main], ["reload"] - gulp.watch [glob input.styles], ["reload"] - gulp.watch [glob input.templates], ["reload"] - -gulp.task "reload", ["default"], -> - child_process.exec "reload.bat", (err, stdout, stderr) -> - return console.log err if err - - -gulp.task "fonts", ["clean"], -> - gulp.src bower input.fonts - .pipe gulp.dest output.dir - -gulp.task "scripts", ["clean"], -> - lib = gulp.src glob input.scripts.lib - etc = gulp.src bower "**/*.js" - - merged = merge lib, etc - .pipe g.order(["jquery.js", - "jquery*.js", - "*.js"]) - .pipe g.concat(output.scripts.lib) - .pipe g.if(s.min, g.uglify().on('error', util.log)) - .pipe gulp.dest output.dir - - main = gulp.src glob input.scripts.main - .pipe g.order(["nano_utility.js", - "nano_state_manager.js" - "*.js"]) - .pipe g.concat(output.scripts.main) - .pipe g.if(s.min, g.uglify().on('error', util.log)) - .pipe gulp.dest output.dir - -gulp.task "styles", ["clean"], -> - lib = gulp.src bower "**/*.css" - .pipe g.replace("../fonts/", "") - - main = gulp.src glob input.styles - .pipe g.filter(["*.less", "!_*.less"]) - .pipe g.less({paths: [input.images]}) - .pipe g.postcss([ - p.autoprefixer({browsers: ["last 2 versions", "ie >= 8"]}), - p.gradient, - p.opacity, - p.rgba({oldie: true}), - p.plsfilters({oldIE: true}) - ]) - - combined = merge lib, main - combined - .pipe g.if(s.min, g.cssnano({discardComments: {removeAll: true}}), g.csscomb()) - .pipe g.concat(output.css) - .pipe gulp.dest output.dir \ No newline at end of file diff --git a/nano/Gulpfile.js b/nano/Gulpfile.js index 203c68bf5c2..d0683ca2b4b 100644 --- a/nano/Gulpfile.js +++ b/nano/Gulpfile.js @@ -1,2 +1,168 @@ -require('coffee-script/register'); -require('./Gulpfile.coffee'); +/* + * NanoUI Buildscript v1.0 + * JS Edition + */ + +/* Configuration */ +const input = { + cmirror: "codemirror", + fonts: "**/*.{eot,woff2}", + images: "images", + layouts: "layouts/", + scripts: { + lib: "scripts/libraries", + main: "scripts/nano" + }, + styles: "styles", + templates: "templates/" +}; + +const output = { + _dir: "assets", + css: "nanoui.css", + scripts: { + "cmirror": "codemirror-compressed.js", + "lib": "libraries.min.js", + "main": "nano.js" + } +}; + +/* Dependencies */ +var bower = require("main-bower-files"); +var child_process = require("child_process"); +var del = require("del"); +var gulp = require("gulp"); +var merge = require("merge-stream"); +var util = require("gulp-util"); + +/* Gulp Plugins */ +var $PLUG = require("gulp-load-plugins")({replaceString: /^gulp(-|\.)|-/g}); +var postCSSFilters = { + autoprefixer: require("autoprefixer"), + gradient: require("postcss-filter-gradient"), + opacity: require("postcss-opacity"), + rgba: require("postcss-color-rgba-fallback"), + plsfilters: require("pleeease-filters") +}; + +/* Helpers */ +const glob = function (path) { + return `${path}/*`; +}; + +var minify = util.env["min"]; + +/*------Task Section------*/ + +/* Task: Default + * Type: Default/Main + * Just runs the rest of the compilation tasks. + */ +gulp.task("default", ["fonts", "scripts", "styles"]); + +/* Task: Clean + * Type: Dependency. + * Deletes everything inside the output directory to avoid conflicts when building new versions. + */ +gulp.task("clean", function () { + del(glob(output._dir)); +}); + +/* Task: Watch + * Type: Main + * Run when someone uses `gulp watch`. Binds listeners to file events on any of the input files, recompiles on demand. + */ +gulp.task("watch", function () { + // Watch main scripts. + gulp.watch([glob(input.scripts.lib)], ["reload"]); + gulp.watch([glob(input.scripts.main)], ["reload"]); + + // Watch images and CSS. + gulp.watch([glob(input.images)], ["reload"]); + gulp.watch([glob(input.styles)], ["reload"]); + + // Watch for template files being changed. + gulp.watch([glob(input.layouts)], ["reload"]); + gulp.watch([glob(input.templates)], ["reload"]); +}); + +/* Task: Reload + * Type: Dependency + * Run whenever a file is changed. Recompiles and pushes all changes directly to the local BYOND client cache. + */ +gulp.task("reload", ["default"], function () { + child_process.exec("reload.bat", function (err, stdout, stderr) { + if(err) + return console.log(err); + }); +}); + +/*---Buildtasks---*/ + +/* Task: Fonts + * Type: Build-dep + * Pipes fonts from bower into the nano cache directory. + */ +gulp.task("fonts", function () { + gulp.src(bower(input.fonts)) + .pipe(gulp.dest(output._dir)); +}); + +/* Task: Scripts + * Type: Build-dep + * Compiles all of the library and nano scripts, minifies them if necessary, and puts them in assets + */ +gulp.task("scripts", ["clean"], function () { + var lib = gulp.src(glob(input.scripts.lib)); + var etc = gulp.src(bower("**/*.js")); + + // Combine libraries and other js into one file + merge(lib, etc) + .pipe($PLUG.order(["jquery.js", "jquery*.js", "*.js"])) // Ensure jQuery is always loaded first + .pipe($PLUG.concat(output.scripts.lib)) // Concatenate all scripts into one file + .pipe($PLUG.if(minify, $PLUG.uglify().on("error", util.log))) // Minify if set in command line arguments + .pipe(gulp.dest(output._dir)); // Write the file + + // Combine all of the nano scripts into one + gulp.src(glob(input.scripts.main)) + .pipe($PLUG.order(["nano_utility.js", "nano_state_manager.js", "*.js"])) // Ensure Nano Util and state manager are always loaded first + .pipe($PLUG.concat(output.scripts.main)) // Concatenate all scripts into one file + .pipe($PLUG.if(minify, $PLUG.uglify().on("error", util.log))) // Minify if set in command line arguments + .pipe(gulp.dest(output._dir)); // Write the file + + // Copy codemirror to the assets + gulp.src(glob(input.cmirror) + ".js") + .pipe($PLUG.concat(output.scripts.cmirror)) + .pipe(gulp.dest(output._dir)); +}); + + +/* Task: Styles + * Type: Build-dep + * Concatenates all CSS in the project and compiles our Nano LESS templates + */ +gulp.task("styles", ["clean"], function () { + // Get all of the random bower CSS files into `lib` + var lib = gulp.src(bower("**/*.css")) + .pipe($PLUG.replace("../fonts/", "")); + + // Gather all of our actual nanoUI styles, compile the LESS, apply postCSS filters + var main = gulp.src(glob(input.styles)) + .pipe($PLUG.filter(["*.less", "!_*.less"])) + .pipe($PLUG.less({paths: [input.images]})) + .pipe($PLUG.postcss([ + postCSSFilters.autoprefixer({browsers: ["last 2 versions", "ie >= 8"]}), + postCSSFilters.gradient, + postCSSFilters.opacity, + postCSSFilters.rgba({oldie: true}), + postCSSFilters.plsfilters({oldIE: true}) + ])); + + var codemirror = gulp.src(glob(input.cmirror) + ".css"); + + // Merge the lib and main nano styles into one file + merge(codemirror, lib, main) + .pipe($PLUG.if(minify, $PLUG.cssnano({discardComments: {removeAll: true}}), $PLUG.csscomb())) // Minify if necessary + .pipe($PLUG.concat(output.css)) // Concatenate all CSS into one file + .pipe(gulp.dest(output._dir)); // Write the file +}); \ No newline at end of file diff --git a/nano/README.md b/nano/README.md index b83661fbac7..1c009de80a4 100644 --- a/nano/README.md +++ b/nano/README.md @@ -23,8 +23,6 @@ This section is for listing the contributors to NanoUI. - NanoUI's JavaScript controlling the "fancy" borderless window mode. - The NanoTrasen.svg logo (Licensed under CC 3.0 BY-SA). - - The Gulp buildscript concept, as well as a large amount of the actual - Gulpfile.coffee. - The packages in bower.json and packages.json files were hand-picked by Neersighted for usage in compiling NanoUI. - A considerable amount of this README is adapated from Neersighted's documentation. diff --git a/nano/assets/codemirror-compressed.js b/nano/assets/codemirror-compressed.js new file mode 100644 index 00000000000..411717c8cb7 --- /dev/null +++ b/nano/assets/codemirror-compressed.js @@ -0,0 +1,23 @@ +/* CodeMirror - Minified & Bundled + Generated on 10/27/2015 with http://codemirror.net/doc/compress.html + Version: HEAD + + CodeMirror Library: + - codemirror.js + Modes: + - css.js + - NTSL.js + Add-ons: + - css-hint.js + - search.js + Keymaps: + - sublime.js + */ + +!function(a){if("object"==typeof exports&&"object"==typeof module)module.exports=a();else{if("function"==typeof define&&define.amd)return define([],a);this.CodeMirror=a()}}(function(){"use strict";function a(c,d){if(!(this instanceof a))return new a(c,d);this.options=d=d?Je(d):{},Je(Zf,d,!1),n(d);var e=d.value;"string"==typeof e&&(e=new vg(e,d.mode,null,d.lineSeparator)),this.doc=e;var f=new a.inputStyles[d.inputStyle](this),g=this.display=new b(c,e,f);g.wrapper.CodeMirror=this,j(this),h(this),d.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),d.autofocus&&!Bf&&g.input.focus(),r(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:!1,cutIncoming:!1,selectingText:!1,draggingText:!1,highlight:new Ce,keySeq:null,specialChars:null};var i=this;rf&&11>sf&&setTimeout(function(){i.display.input.reset(!0)},20),Pb(this),Ve(),tb(this),this.curOp.forceUpdate=!0,Wd(this,e),d.autofocus&&!Bf||i.hasFocus()?setTimeout(Ke(pc,this),20):qc(this);for(var k in $f)$f.hasOwnProperty(k)&&$f[k](this,d[k],_f);w(this),d.finishInit&&d.finishInit(this);for(var l=0;lsf&&(d.gutters.style.zIndex=-1,d.scroller.style.paddingRight=0),tf||of&&Bf||(d.scroller.draggable=!0),a&&(a.appendChild?a.appendChild(d.wrapper):a(d.wrapper)),d.viewFrom=d.viewTo=b.first,d.reportedViewFrom=d.reportedViewTo=b.first,d.view=[],d.renderedView=null,d.externalMeasured=null,d.viewOffset=0,d.lastWrapHeight=d.lastWrapWidth=0,d.updateLineNumbers=null,d.nativeBarWidth=d.barHeight=d.barWidth=0,d.scrollbarsClipped=!1,d.lineNumWidth=d.lineNumInnerWidth=d.lineNumChars=null,d.alignWidgets=!1,d.cachedCharWidth=d.cachedTextHeight=d.cachedPaddingH=null,d.maxLine=null,d.maxLineLength=0,d.maxLineChanged=!1,d.wheelDX=d.wheelDY=d.wheelStartX=d.wheelStartY=null,d.shift=!1,d.selForContextMenu=null,d.activeTouch=null,c.init(d)}function c(b){b.doc.mode=a.getMode(b.options,b.doc.modeOption),d(b)}function d(a){a.doc.iter(function(a){a.stateAfter&&(a.stateAfter=null),a.styles&&(a.styles=null)}),a.doc.frontier=a.doc.first,Ma(a,100),a.state.modeGen++,a.curOp&&Ib(a)}function e(a){a.options.lineWrapping?(Xg(a.display.wrapper,"CodeMirror-wrap"),a.display.sizer.style.minWidth="",a.display.sizerWidth=null):(Wg(a.display.wrapper,"CodeMirror-wrap"),m(a)),g(a),Ib(a),gb(a),setTimeout(function(){s(a)},100)}function f(a){var b=rb(a.display),c=a.options.lineWrapping,d=c&&Math.max(5,a.display.scroller.clientWidth/sb(a.display)-3);return function(e){if(ud(a.doc,e))return 0;var f=0;if(e.widgets)for(var g=0;gb.maxLineLength&&(b.maxLineLength=c,b.maxLine=a)})}function n(a){var b=Fe(a.gutters,"CodeMirror-linenumbers");-1==b&&a.lineNumbers?a.gutters=a.gutters.concat(["CodeMirror-linenumbers"]):b>-1&&!a.lineNumbers&&(a.gutters=a.gutters.slice(0),a.gutters.splice(b,1))}function o(a){var b=a.display,c=b.gutters.offsetWidth,d=Math.round(a.doc.height+Ra(a.display));return{clientHeight:b.scroller.clientHeight,viewHeight:b.wrapper.clientHeight,scrollWidth:b.scroller.scrollWidth,clientWidth:b.scroller.clientWidth,viewWidth:b.wrapper.clientWidth,barLeft:a.options.fixedGutter?c:0,docHeight:d,scrollHeight:d+Ta(a)+b.barHeight,nativeBarWidth:b.nativeBarWidth,gutterWidth:c}}function p(a,b,c){this.cm=c;var d=this.vert=Oe("div",[Oe("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),e=this.horiz=Oe("div",[Oe("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");a(d),a(e),Bg(d,"scroll",function(){d.clientHeight&&b(d.scrollTop,"vertical")}),Bg(e,"scroll",function(){e.clientWidth&&b(e.scrollLeft,"horizontal")}),this.checkedOverlay=!1,rf&&8>sf&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")}function q(){}function r(b){b.display.scrollbars&&(b.display.scrollbars.clear(),b.display.scrollbars.addClass&&Wg(b.display.wrapper,b.display.scrollbars.addClass)),b.display.scrollbars=new a.scrollbarModel[b.options.scrollbarStyle](function(a){b.display.wrapper.insertBefore(a,b.display.scrollbarFiller),Bg(a,"mousedown",function(){b.state.focused&&setTimeout(function(){b.display.input.focus()},0)}),a.setAttribute("cm-not-content","true")},function(a,c){"horizontal"==c?dc(b,a):cc(b,a)},b),b.display.scrollbars.addClass&&Xg(b.display.wrapper,b.display.scrollbars.addClass)}function s(a,b){b||(b=o(a));var c=a.display.barWidth,d=a.display.barHeight;t(a,b);for(var e=0;4>e&&c!=a.display.barWidth||d!=a.display.barHeight;e++)c!=a.display.barWidth&&a.options.lineWrapping&&F(a),t(a,o(a)),c=a.display.barWidth,d=a.display.barHeight}function t(a,b){var c=a.display,d=c.scrollbars.update(b);c.sizer.style.paddingRight=(c.barWidth=d.right)+"px",c.sizer.style.paddingBottom=(c.barHeight=d.bottom)+"px",d.right&&d.bottom?(c.scrollbarFiller.style.display="block",c.scrollbarFiller.style.height=d.bottom+"px",c.scrollbarFiller.style.width=d.right+"px"):c.scrollbarFiller.style.display="",d.bottom&&a.options.coverGutterNextToScrollbar&&a.options.fixedGutter?(c.gutterFiller.style.display="block",c.gutterFiller.style.height=d.bottom+"px",c.gutterFiller.style.width=b.gutterWidth+"px"):c.gutterFiller.style.display=""}function u(a,b,c){var d=c&&null!=c.top?Math.max(0,c.top):a.scroller.scrollTop;d=Math.floor(d-Qa(a));var e=c&&null!=c.bottom?c.bottom:d+a.wrapper.clientHeight,f=ae(b,d),g=ae(b,e);if(c&&c.ensure){var h=c.ensure.from.line,i=c.ensure.to.line;f>h?(f=h,g=ae(b,be(Xd(b,h))+a.wrapper.clientHeight)):Math.min(i,b.lastLine())>=g&&(f=ae(b,be(Xd(b,i))-a.wrapper.clientHeight),g=i)}return{from:f,to:Math.max(g,f+1)}}function v(a){var b=a.display,c=b.view;if(b.alignWidgets||b.gutters.firstChild&&a.options.fixedGutter){for(var d=y(b)-b.scroller.scrollLeft+a.doc.scrollLeft,e=b.gutters.offsetWidth,f=d+"px",g=0;g=c.viewFrom&&b.visible.to<=c.viewTo&&(null==c.updateLineNumbers||c.updateLineNumbers>=c.viewTo)&&c.renderedView==c.view&&0==Ob(a))return!1;w(a)&&(Kb(a),b.dims=H(a));var e=d.first+d.size,f=Math.max(b.visible.from-a.options.viewportMargin,d.first),g=Math.min(e,b.visible.to+a.options.viewportMargin);c.viewFromg&&c.viewTo-g<20&&(g=Math.min(e,c.viewTo)),If&&(f=sd(a.doc,f),g=td(a.doc,g));var h=f!=c.viewFrom||g!=c.viewTo||c.lastWrapHeight!=b.wrapperHeight||c.lastWrapWidth!=b.wrapperWidth;Nb(a,f,g),c.viewOffset=be(Xd(a.doc,c.viewFrom)),a.display.mover.style.top=c.viewOffset+"px";var i=Ob(a);if(!h&&0==i&&!b.force&&c.renderedView==c.view&&(null==c.updateLineNumbers||c.updateLineNumbers>=c.viewTo))return!1;var j=Re();return i>4&&(c.lineDiv.style.display="none"),I(a,c.updateLineNumbers,b.dims),i>4&&(c.lineDiv.style.display=""),c.renderedView=c.view,j&&Re()!=j&&j.offsetHeight&&j.focus(),Pe(c.cursorDiv),Pe(c.selectionDiv),c.gutters.style.height=c.sizer.style.minHeight=0,h&&(c.lastWrapHeight=b.wrapperHeight,c.lastWrapWidth=b.wrapperWidth,Ma(a,400)),c.updateLineNumbers=null,!0}function C(a,b){for(var c=b.viewport,d=!0;(d&&a.options.lineWrapping&&b.oldDisplayWidth!=Ua(a)||(c&&null!=c.top&&(c={top:Math.min(a.doc.height+Ra(a.display)-Va(a),c.top)}),b.visible=u(a.display,a.doc,c),!(b.visible.from>=a.display.viewFrom&&b.visible.to<=a.display.viewTo)))&&B(a,b);d=!1){F(a);var e=o(a);Ha(a),E(a,e),s(a,e)}b.signal(a,"update",a),(a.display.viewFrom!=a.display.reportedViewFrom||a.display.viewTo!=a.display.reportedViewTo)&&(b.signal(a,"viewportChange",a,a.display.viewFrom,a.display.viewTo),a.display.reportedViewFrom=a.display.viewFrom,a.display.reportedViewTo=a.display.viewTo)}function D(a,b){var c=new z(a,b);if(B(a,c)){F(a),C(a,c);var d=o(a);Ha(a),E(a,d),s(a,d),c.finish()}}function E(a,b){a.display.sizer.style.minHeight=b.docHeight+"px";var c=b.docHeight+a.display.barHeight;a.display.heightForcer.style.top=c+"px",a.display.gutters.style.height=Math.max(c+Ta(a),b.clientHeight)+"px"}function F(a){for(var b=a.display,c=b.lineDiv.offsetTop,d=0;dsf){var g=f.node.offsetTop+f.node.offsetHeight;e=g-c,c=g}else{var h=f.node.getBoundingClientRect();e=h.bottom-h.top}var i=f.line.height-e;if(2>e&&(e=rb(b)),(i>.001||-.001>i)&&($d(f.line,e),G(f.line),f.rest))for(var j=0;j=b&&l.lineNumber;l.changes&&(Fe(l.changes,"gutter")>-1&&(m=!1),J(a,l,j,c)),m&&(Pe(l.lineNumber),l.lineNumber.appendChild(document.createTextNode(x(a.options,j)))),h=l.node.nextSibling}else{var n=R(a,l,j,c);g.insertBefore(n,h)}j+=l.size}for(;h;)h=d(h)}function J(a,b,c,d){for(var e=0;esf&&(a.node.style.zIndex=2)),a.node}function L(a){var b=a.bgClass?a.bgClass+" "+(a.line.bgClass||""):a.line.bgClass;if(b&&(b+=" CodeMirror-linebackground"),a.background)b?a.background.className=b:(a.background.parentNode.removeChild(a.background),a.background=null);else if(b){var c=K(a);a.background=c.insertBefore(Oe("div",null,b),c.firstChild)}}function M(a,b){var c=a.display.externalMeasured;return c&&c.line==b.line?(a.display.externalMeasured=null,b.measure=c.measure,c.built):Kd(a,b)}function N(a,b){var c=b.text.className,d=M(a,b);b.text==b.node&&(b.node=d.pre),b.text.parentNode.replaceChild(d.pre,b.text),b.text=d.pre,d.bgClass!=b.bgClass||d.textClass!=b.textClass?(b.bgClass=d.bgClass,b.textClass=d.textClass,O(b)):c&&(b.text.className=c)}function O(a){L(a),a.line.wrapClass?K(a).className=a.line.wrapClass:a.node!=a.text&&(a.node.className="");var b=a.textClass?a.textClass+" "+(a.line.textClass||""):a.line.textClass;a.text.className=b||""}function P(a,b,c,d){if(b.gutter&&(b.node.removeChild(b.gutter),b.gutter=null),b.gutterBackground&&(b.node.removeChild(b.gutterBackground),b.gutterBackground=null),b.line.gutterClass){var e=K(b);b.gutterBackground=Oe("div",null,"CodeMirror-gutter-background "+b.line.gutterClass,"left: "+(a.options.fixedGutter?d.fixedPos:-d.gutterTotalWidth)+"px; width: "+d.gutterTotalWidth+"px"),e.insertBefore(b.gutterBackground,b.text)}var f=b.line.gutterMarkers;if(a.options.lineNumbers||f){var e=K(b),g=b.gutter=Oe("div",null,"CodeMirror-gutter-wrapper","left: "+(a.options.fixedGutter?d.fixedPos:-d.gutterTotalWidth)+"px");if(a.display.input.setUneditable(g),e.insertBefore(g,b.text),b.line.gutterClass&&(g.className+=" "+b.line.gutterClass),!a.options.lineNumbers||f&&f["CodeMirror-linenumbers"]||(b.lineNumber=g.appendChild(Oe("div",x(a.options,c),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+d.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+a.display.lineNumInnerWidth+"px"))),f)for(var h=0;h1)if(Lf&&Lf.join("\n")==b){if(d.ranges.length%Lf.length==0){i=[];for(var j=0;j=0;j--){var k=d.ranges[j],l=k.from(),m=k.to();k.empty()&&(c&&c>0?l=Jf(l.line,l.ch-c):a.state.overwrite&&!g&&(m=Jf(m.line,Math.min(Xd(f,m.line).text.length,m.ch+Ee(h).length))));var n=a.curOp.updateInput,o={from:l,to:m,text:i?i[j%i.length]:h,origin:e||(g?"paste":a.state.cutIncoming?"cut":"+input")};yc(a.doc,o),we(a,"inputRead",a,o)}b&&!g&&aa(a,b),Kc(a),a.curOp.updateInput=n,a.curOp.typing=!0,a.state.pasteIncoming=a.state.cutIncoming=!1}function _(a,b){var c=a.clipboardData&&a.clipboardData.getData("text/plain");return c?(a.preventDefault(),Z(b)||b.options.disableInput||Cb(b,function(){$(b,c,0,null,"paste")}),!0):void 0}function aa(a,b){if(a.options.electricChars&&a.options.smartIndent)for(var c=a.doc.sel,d=c.ranges.length-1;d>=0;d--){var e=c.ranges[d];if(!(e.head.ch>100||d&&c.ranges[d-1].head.line==e.head.line)){var f=a.getModeAt(e.head),g=!1;if(f.electricChars){for(var h=0;h-1){g=Mc(a,e.head.line,"smart");break}}else f.electricInput&&f.electricInput.test(Xd(a.doc,e.head.line).text.slice(0,e.head.ch))&&(g=Mc(a,e.head.line,"smart"));g&&we(a,"electricInput",a,e.head.line)}}}function ba(a){for(var b=[],c=[],d=0;de?j.map:k[e],g=0;ge?a.line:a.rest[e]),l=f[g]+d;return(0>d||h!=b)&&(l=f[g+(d?1:0)]),Jf(i,l)}}}var e=a.text.firstChild,f=!1;if(!b||!Tg(e,b))return ha(Jf(_d(a.line),0),!0);if(b==e&&(f=!0,b=e.childNodes[c],c=0,!b)){var g=a.rest?Ee(a.rest):a.line;return ha(Jf(_d(g),g.text.length),f)}var h=3==b.nodeType?b:null,i=b;for(h||1!=b.childNodes.length||3!=b.firstChild.nodeType||(h=b.firstChild,c&&(c=h.nodeValue.length));i.parentNode!=e;)i=i.parentNode;var j=a.measure,k=j.maps,l=d(h,i,c);if(l)return ha(l,f);for(var m=i.nextSibling,n=h?h.nodeValue.length-c:0;m;m=m.nextSibling){if(l=d(m,m.firstChild,0))return ha(Jf(l.line,l.ch-n),f);n+=m.textContent.length}for(var o=i.previousSibling,n=c;o;o=o.previousSibling){if(l=d(o,o.firstChild,-1))return ha(Jf(l.line,l.ch+n),f);n+=m.textContent.length}}function ka(a,b,c,d,e){function f(a){return function(b){return b.id==a}}function g(b){if(1==b.nodeType){var c=b.getAttribute("cm-text");if(null!=c)return""==c&&(c=b.textContent.replace(/\u200b/g,"")),void(h+=c);var k,l=b.getAttribute("cm-marker");if(l){var m=a.findMarks(Jf(d,0),Jf(e+1,0),f(+l));return void(m.length&&(k=m[0].find())&&(h+=Yd(a.doc,k.from,k.to).join(j)))}if("false"==b.getAttribute("contenteditable"))return;for(var n=0;n=0){var g=X(f.from(),e.from()),h=W(f.to(),e.to()),i=f.empty()?e.from()==e.head:f.from()==f.head;b>=d&&--b,a.splice(--d,2,new ma(i?h:g,i?g:h))}}return new la(a,b)}function oa(a,b){return new la([new ma(a,b||a)],0)}function pa(a,b){return Math.max(a.first,Math.min(b,a.first+a.size-1))}function qa(a,b){if(b.linec?Jf(c,Xd(a,c).text.length):ra(b,Xd(a,b.line).text.length)}function ra(a,b){var c=a.ch;return null==c||c>b?Jf(a.line,b):0>c?Jf(a.line,0):a}function sa(a,b){return b>=a.first&&b=f.ch:j.to>f.ch))){if(d&&(Eg(k,"beforeCursorEnter"),k.explicitlyCleared)){if(h.markedSpans){--i;continue}break}if(!k.atomic)continue;var l=k.find(0>g?-1:1);if(0==Kf(l,f)&&(l.ch+=g,l.ch<0?l=l.line>a.first?qa(a,Jf(l.line-1)):null:l.ch>h.text.length&&(l=l.lineb&&(b=0),b=Math.round(b),d=Math.round(d),h.appendChild(Oe("div",null,"CodeMirror-selected","position: absolute; left: "+a+"px; top: "+b+"px; width: "+(null==c?k-a:c)+"px; height: "+(d-b)+"px"))}function e(b,c,e){function f(c,d){return lb(a,Jf(b,c),"div",l,d)}var h,i,l=Xd(g,b),m=l.text.length;return $e(ce(l),c||0,null==e?m:e,function(a,b,g){var l,n,o,p=f(a,"left");if(a==b)l=p,n=o=p.left;else{if(l=f(b-1,"right"),"rtl"==g){var q=p;p=l,l=q}n=p.left,o=l.right}null==c&&0==a&&(n=j),l.top-p.top>3&&(d(n,p.top,null,p.bottom),n=j,p.bottomi.bottom||l.bottom==i.bottom&&l.right>i.right)&&(i=l),j+1>n&&(n=j),d(n,l.top,o-n,l.bottom)}),{start:h,end:i}}var f=a.display,g=a.doc,h=document.createDocumentFragment(),i=Sa(a.display),j=i.left,k=Math.max(f.sizerWidth,Ua(a)-f.sizer.offsetLeft)-i.right,l=b.from(),m=b.to();if(l.line==m.line)e(l.line,l.ch,m.ch);else{var n=Xd(g,l.line),o=Xd(g,m.line),p=qd(n)==qd(o),q=e(l.line,l.ch,p?n.text.length+1:null).end,r=e(m.line,p?0:null,m.ch).start;p&&(q.top0?b.blinker=setInterval(function(){b.cursorDiv.style.visibility=(c=!c)?"":"hidden"},a.options.cursorBlinkRate):a.options.cursorBlinkRate<0&&(b.cursorDiv.style.visibility="hidden")}}function Ma(a,b){a.doc.mode.startState&&a.doc.frontier=a.display.viewTo)){var c=+new Date+a.options.workTime,d=fg(b.mode,Pa(a,b.frontier)),e=[];b.iter(b.frontier,Math.min(b.first+b.size,a.display.viewTo+500),function(f){if(b.frontier>=a.display.viewFrom){var g=f.styles,h=f.text.length>a.options.maxHighlightLength,i=Gd(a,f,h?fg(b.mode,d):d,!0);f.styles=i.styles;var j=f.styleClasses,k=i.classes;k?f.styleClasses=k:j&&(f.styleClasses=null);for(var l=!g||g.length!=f.styles.length||j!=k&&(!j||!k||j.bgClass!=k.bgClass||j.textClass!=k.textClass),m=0;!l&&mc?(Ma(a,a.options.workDelay),!0):void 0}),e.length&&Cb(a,function(){for(var b=0;bg;--h){if(h<=f.first)return f.first;var i=Xd(f,h-1);if(i.stateAfter&&(!c||h<=f.frontier))return h;var j=Lg(i.text,null,a.options.tabSize);(null==e||d>j)&&(e=h-1,d=j)}return e}function Pa(a,b,c){var d=a.doc,e=a.display;if(!d.mode.startState)return!0;var f=Oa(a,b,c),g=f>d.first&&Xd(d,f-1).stateAfter;return g=g?fg(d.mode,g):gg(d.mode),d.iter(f,b,function(c){Id(a,c.text,g);var h=f==b-1||f%5==0||f>=e.viewFrom&&f2&&f.push((i.bottom+j.top)/2-c.top)}}f.push(c.bottom-c.top)}}function Xa(a,b,c){if(a.line==b)return{map:a.measure.map,cache:a.measure.cache};for(var d=0;dc)return{map:a.measure.maps[d],cache:a.measure.caches[d],before:!0}}function Ya(a,b){b=qd(b);var c=_d(b),d=a.display.externalMeasured=new Gb(a.doc,b,c);d.lineN=c;var e=d.built=Kd(a,d);return d.text=e.pre,Qe(a.display.lineMeasure,e.pre),d}function Za(a,b,c,d){return ab(a,_a(a,b),c,d)}function $a(a,b){if(b>=a.display.viewFrom&&b=c.lineN&&bb?(e=0,f=1,g="left"):j>b?(e=b-i,f=e+1):(h==a.length-3||b==j&&a[h+3]>b)&&(f=j-i,e=f-1,b>=j&&(g="right")),null!=e){if(d=a[h+2],i==j&&c==(d.insertLeft?"left":"right")&&(g=c),"left"==c&&0==e)for(;h&&a[h-2]==a[h-3]&&a[h-1].insertLeft;)d=a[(h-=3)+2],g="left";if("right"==c&&e==j-i)for(;hk;k++){for(;h&&Ne(b.line.text.charAt(f.coverStart+h));)--h;for(;f.coverStart+isf&&0==h&&i==f.coverEnd-f.coverStart)e=g.parentNode.getBoundingClientRect();else if(rf&&a.options.lineWrapping){var l=Pg(g,h,i).getClientRects();e=l.length?l["right"==d?l.length-1:0]:Pf}else e=Pg(g,h,i).getBoundingClientRect()||Pf;if(e.left||e.right||0==h)break;i=h,h-=1,j="right"}rf&&11>sf&&(e=db(a.display.measure,e))}else{h>0&&(j=d="right");var l;e=a.options.lineWrapping&&(l=g.getClientRects()).length>1?l["right"==d?l.length-1:0]:g.getBoundingClientRect()}if(rf&&9>sf&&!h&&(!e||!e.left&&!e.right)){var m=g.parentNode.getClientRects()[0];e=m?{left:m.left,right:m.left+sb(a.display),top:m.top,bottom:m.bottom}:Pf}for(var n=e.top-b.rect.top,o=e.bottom-b.rect.top,p=(n+o)/2,q=b.view.measure.heights,k=0;kc.from?g(a-1):g(a,d)}d=d||Xd(a.doc,b.line),e||(e=_a(a,d));var i=ce(d),j=b.ch;if(!i)return g(j);var k=hf(i,j),l=h(j,k);return null!=dh&&(l.other=h(j,dh)),l}function nb(a,b){var c=0,b=qa(a.doc,b);a.options.lineWrapping||(c=sb(a.display)*b.ch);var d=Xd(a.doc,b.line),e=be(d)+Qa(a.display);return{left:c,right:c,top:e,bottom:e+d.height}}function ob(a,b,c,d){var e=Jf(a,b);return e.xRel=d,c&&(e.outside=!0),e}function pb(a,b,c){var d=a.doc;if(c+=a.display.viewOffset,0>c)return ob(d.first,0,!0,-1);var e=ae(d,c),f=d.first+d.size-1;if(e>f)return ob(d.first+d.size-1,Xd(d,f).text.length,!0,1);0>b&&(b=0);for(var g=Xd(d,e);;){var h=qb(a,g,e,b,c),i=od(g),j=i&&i.find(0,!0);if(!i||!(h.ch>j.from.ch||h.ch==j.from.ch&&h.xRel>0))return h;e=_d(g=j.to.line)}}function qb(a,b,c,d,e){function f(d){var e=mb(a,Jf(c,d),"line",b,j);return h=!0,g>e.bottom?e.left-i:gq)return ob(c,n,r,1);for(;;){if(k?n==m||n==kf(b,m,1):1>=n-m){for(var s=o>d||q-d>=d-o?m:n,t=d-(s==m?o:q);Ne(b.text.charAt(s));)++s;var u=ob(c,s,s==m?p:r,-1>t?-1:t>1?1:0);return u}var v=Math.ceil(l/2),w=m+v;if(k){w=m;for(var x=0;v>x;++x)w=kf(b,w,1)}var y=f(w);y>d?(n=w,q=y,(r=h)&&(q+=1e3),l=v):(m=w,o=y,p=h,l-=v)}}function rb(a){if(null!=a.cachedTextHeight)return a.cachedTextHeight;if(null==Mf){Mf=Oe("pre");for(var b=0;49>b;++b)Mf.appendChild(document.createTextNode("x")),Mf.appendChild(Oe("br"));Mf.appendChild(document.createTextNode("x"))}Qe(a.measure,Mf);var c=Mf.offsetHeight/50;return c>3&&(a.cachedTextHeight=c),Pe(a.measure),c||1}function sb(a){if(null!=a.cachedCharWidth)return a.cachedCharWidth;var b=Oe("span","xxxxxxxxxx"),c=Oe("pre",[b]);Qe(a.measure,c);var d=b.getBoundingClientRect(),e=(d.right-d.left)/10;return e>2&&(a.cachedCharWidth=e),e||10}function tb(a){a.curOp={cm:a,viewChanged:!1,startHeight:a.doc.height,forceUpdate:!1,updateInput:null,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Rf},Qf?Qf.ops.push(a.curOp):a.curOp.ownsGroup=Qf={ops:[a.curOp],delayedCallbacks:[]}}function ub(a){var b=a.delayedCallbacks,c=0;do{for(;c=c.viewTo)||c.maxLineChanged&&b.options.lineWrapping,a.update=a.mustUpdate&&new z(b,a.mustUpdate&&{top:a.scrollTop,ensure:a.scrollToPos},a.forceUpdate)}function yb(a){a.updatedDisplay=a.mustUpdate&&B(a.cm,a.update)}function zb(a){var b=a.cm,c=b.display;a.updatedDisplay&&F(b),a.barMeasure=o(b),c.maxLineChanged&&!b.options.lineWrapping&&(a.adjustWidthTo=Za(b,c.maxLine,c.maxLine.text.length).left+3,b.display.sizerWidth=a.adjustWidthTo,a.barMeasure.scrollWidth=Math.max(c.scroller.clientWidth,c.sizer.offsetLeft+a.adjustWidthTo+Ta(b)+b.display.barWidth),a.maxScrollLeft=Math.max(0,c.sizer.offsetLeft+a.adjustWidthTo-Ua(b))),(a.updatedDisplay||a.selectionChanged)&&(a.preparedSelection=c.input.prepareSelection())}function Ab(a){var b=a.cm;null!=a.adjustWidthTo&&(b.display.sizer.style.minWidth=a.adjustWidthTo+"px",a.maxScrollLeftf;f=d){var g=new Gb(a.doc,Xd(a.doc,f),f);d=f+g.size,e.push(g)}return e}function Ib(a,b,c,d){null==b&&(b=a.doc.first),null==c&&(c=a.doc.first+a.doc.size),d||(d=0);var e=a.display;if(d&&cb)&&(e.updateLineNumbers=b),a.curOp.viewChanged=!0,b>=e.viewTo)If&&sd(a.doc,b)e.viewFrom?Kb(a):(e.viewFrom+=d,e.viewTo+=d);else if(b<=e.viewFrom&&c>=e.viewTo)Kb(a);else if(b<=e.viewFrom){var f=Mb(a,c,c+d,1);f?(e.view=e.view.slice(f.index),e.viewFrom=f.lineN,e.viewTo+=d):Kb(a)}else if(c>=e.viewTo){var f=Mb(a,b,b,-1);f?(e.view=e.view.slice(0,f.index),e.viewTo=f.lineN):Kb(a)}else{var g=Mb(a,b,b,-1),h=Mb(a,c,c+d,1);g&&h?(e.view=e.view.slice(0,g.index).concat(Hb(a,g.lineN,h.lineN)).concat(e.view.slice(h.index)),e.viewTo+=d):Kb(a)}var i=e.externalMeasured;i&&(c=e.lineN&&b=d.viewTo)){var f=d.view[Lb(a,b)];if(null!=f.node){var g=f.changes||(f.changes=[]);-1==Fe(g,c)&&g.push(c)}}}function Kb(a){a.display.viewFrom=a.display.viewTo=a.doc.first,a.display.view=[],a.display.viewOffset=0}function Lb(a,b){if(b>=a.display.viewTo)return null;if(b-=a.display.viewFrom,0>b)return null;for(var c=a.display.view,d=0;db)return d}function Mb(a,b,c,d){var e,f=Lb(a,b),g=a.display.view;if(!If||c==a.doc.first+a.doc.size)return{index:f,lineN:c};for(var h=0,i=a.display.viewFrom;f>h;h++)i+=g[h].size;if(i!=b){if(d>0){if(f==g.length-1)return null;e=i+g[f].size-b,f++}else e=i-b;b+=e,c+=e}for(;sd(a.doc,c)!=c;){if(f==(0>d?0:g.length-1))return null;c+=d*g[f-(0>d?1:0)].size,f+=d}return{index:f,lineN:c}}function Nb(a,b,c){var d=a.display,e=d.view;0==e.length||b>=d.viewTo||c<=d.viewFrom?(d.view=Hb(a,b,c),d.viewFrom=b):(d.viewFrom>b?d.view=Hb(a,b,d.viewFrom).concat(d.view):d.viewFromc&&(d.view=d.view.slice(0,Lb(a,c)))),d.viewTo=c}function Ob(a){for(var b=a.display.view,c=0,d=0;d400}var e=a.display;Bg(e.scroller,"mousedown",Db(a,Ub)),rf&&11>sf?Bg(e.scroller,"dblclick",Db(a,function(b){if(!ye(a,b)){var c=Tb(a,b);if(c&&!Zb(a,b)&&!Sb(a.display,b)){yg(b);var d=a.findWordAt(c);va(a.doc,d.anchor,d.head)}}})):Bg(e.scroller,"dblclick",function(b){ye(a,b)||yg(b)}),Gf||Bg(e.scroller,"contextmenu",function(b){rc(a,b)});var f,g={end:0};Bg(e.scroller,"touchstart",function(a){if(!c(a)){clearTimeout(f);var b=+new Date;e.activeTouch={start:b,moved:!1,prev:b-g.end<=300?g:null},1==a.touches.length&&(e.activeTouch.left=a.touches[0].pageX,e.activeTouch.top=a.touches[0].pageY)}}),Bg(e.scroller,"touchmove",function(){e.activeTouch&&(e.activeTouch.moved=!0)}),Bg(e.scroller,"touchend",function(c){var f=e.activeTouch;if(f&&!Sb(e,c)&&null!=f.left&&!f.moved&&new Date-f.start<300){var g,h=a.coordsChar(e.activeTouch,"page");g=!f.prev||d(f,f.prev)?new ma(h,h):!f.prev.prev||d(f,f.prev.prev)?a.findWordAt(h):new ma(Jf(h.line,0),qa(a.doc,Jf(h.line+1,0))),a.setSelection(g.anchor,g.head),a.focus(),yg(c)}b()}),Bg(e.scroller,"touchcancel",b),Bg(e.scroller,"scroll",function(){e.scroller.clientHeight&&(cc(a,e.scroller.scrollTop),dc(a,e.scroller.scrollLeft,!0),Eg(a,"scroll",a))}),Bg(e.scroller,"mousewheel",function(b){ec(a,b)}),Bg(e.scroller,"DOMMouseScroll",function(b){ec(a,b)}),Bg(e.wrapper,"scroll",function(){e.wrapper.scrollTop=e.wrapper.scrollLeft=0}),e.dragFunctions={enter:function(b){ye(a,b)||Ag(b)},over:function(b){ye(a,b)||(ac(a,b),Ag(b))},start:function(b){_b(a,b)},drop:Db(a,$b),leave:function(){bc(a)}};var h=e.input.getField();Bg(h,"keyup",function(b){mc.call(a,b)}),Bg(h,"keydown",Db(a,kc)),Bg(h,"keypress",Db(a,nc)),Bg(h,"focus",Ke(pc,a)),Bg(h,"blur",Ke(qc,a))}function Qb(b,c,d){var e=d&&d!=a.Init;if(!c!=!e){var f=b.display.dragFunctions,g=c?Bg:Dg;g(b.display.scroller,"dragstart",f.start),g(b.display.scroller,"dragenter",f.enter),g(b.display.scroller,"dragover",f.over),g(b.display.scroller,"dragleave",f.leave),g(b.display.scroller,"drop",f.drop)}}function Rb(a){var b=a.display;(b.lastWrapHeight!=b.wrapper.clientHeight||b.lastWrapWidth!=b.wrapper.clientWidth)&&(b.cachedCharWidth=b.cachedTextHeight=b.cachedPaddingH=null,b.scrollbarsClipped=!1,a.setSize())}function Sb(a,b){for(var c=te(b);c!=a.wrapper;c=c.parentNode)if(!c||1==c.nodeType&&"true"==c.getAttribute("cm-ignore-events")||c.parentNode==a.sizer&&c!=a.mover)return!0}function Tb(a,b,c,d){var e=a.display;if(!c&&"true"==te(b).getAttribute("cm-not-content"))return null;var f,g,h=e.lineSpace.getBoundingClientRect();try{f=b.clientX-h.left,g=b.clientY-h.top}catch(b){return null}var i,j=pb(a,f,g);if(d&&1==j.xRel&&(i=Xd(a.doc,j.line).text).length==j.ch){var k=Lg(i,i.length,a.options.tabSize)-i.length;j=Jf(j.line,Math.max(0,Math.round((f-Sa(a.display).left)/sb(a.display))-k))}return j}function Ub(a){var b=this,c=b.display;if(!(c.activeTouch&&c.input.supportsTouch()||ye(b,a))){if(c.shift=a.shiftKey,Sb(c,a))return void(tf||(c.scroller.draggable=!1,setTimeout(function(){c.scroller.draggable=!0},100)));if(!Zb(b,a)){var d=Tb(b,a);switch(window.focus(),ue(a)){case 1:b.state.selectingText?b.state.selectingText(a):d?Vb(b,a,d):te(a)==c.scroller&&yg(a);break;case 2:tf&&(b.state.lastMiddleDown=+new Date),d&&va(b.doc,d),setTimeout(function(){c.input.focus()},20),yg(a);break;case 3:Gf?rc(b,a):oc(b)}}}}function Vb(a,b,c){rf?setTimeout(Ke(Y,a),0):a.curOp.focus=Re();var d,e=+new Date;Of&&Of.time>e-400&&0==Kf(Of.pos,c)?d="triple":Nf&&Nf.time>e-400&&0==Kf(Nf.pos,c)?(d="double",Of={time:e,pos:c}):(d="single",Nf={time:e,pos:c});var f,g=a.doc.sel,h=Cf?b.metaKey:b.ctrlKey;a.options.dragDrop&&Zg&&!Z(a)&&"single"==d&&(f=g.contains(c))>-1&&(Kf((f=g.ranges[f]).from(),c)<0||c.xRel>0)&&(Kf(f.to(),c)>0||c.xRel<0)?Wb(a,b,c,h):Xb(a,b,c,d,h)}function Wb(a,b,c,d){var e=a.display,f=+new Date,g=Db(a,function(h){tf&&(e.scroller.draggable=!1),a.state.draggingText=!1,Dg(document,"mouseup",g),Dg(e.scroller,"drop",g),Math.abs(b.clientX-h.clientX)+Math.abs(b.clientY-h.clientY)<10&&(yg(h),!d&&+new Date-200=o;o++){var r=Xd(j,o).text,s=Mg(r,i,f);i==n?e.push(new ma(Jf(o,s),Jf(o,s))):r.length>s&&e.push(new ma(Jf(o,s),Jf(o,Mg(r,n,f))))}e.length||e.push(new ma(c,c)),Ba(j,na(m.ranges.slice(0,l).concat(e),l),{origin:"*mouse",scroll:!1}),a.scrollIntoView(b)}else{var t=k,u=t.anchor,v=b;if("single"!=d){if("double"==d)var w=a.findWordAt(b);else var w=new ma(Jf(b.line,0),qa(j,Jf(b.line+1,0)));Kf(w.anchor,u)>0?(v=w.head,u=X(t.from(),w.anchor)):(v=w.anchor,u=W(t.to(),w.head))}var e=m.ranges.slice(0);e[l]=new ma(qa(j,u),v),Ba(j,na(e,l),Jg)}}function g(b){var c=++s,e=Tb(a,b,!0,"rect"==d);if(e)if(0!=Kf(e,q)){a.curOp.focus=Re(),f(e);var h=u(i,j);(e.line>=h.to||e.liner.bottom?20:0;k&&setTimeout(Db(a,function(){s==c&&(i.scroller.scrollTop+=k,g(b))}),50)}}function h(b){a.state.selectingText=!1,s=1/0,yg(b),i.input.focus(),Dg(document,"mousemove",t),Dg(document,"mouseup",v),j.history.lastSelOrigin=null}var i=a.display,j=a.doc;yg(b);var k,l,m=j.sel,n=m.ranges;if(e&&!b.shiftKey?(l=j.sel.contains(c),k=l>-1?n[l]:new ma(c,c)):(k=j.sel.primary(),l=j.sel.primIndex),b.altKey)d="rect",e||(k=new ma(c,c)),c=Tb(a,b,!0,!0),l=-1;else if("double"==d){var o=a.findWordAt(c);k=a.display.shift||j.extend?ua(j,k,o.anchor,o.head):o}else if("triple"==d){var p=new ma(Jf(c.line,0),qa(j,Jf(c.line+1,0)));k=a.display.shift||j.extend?ua(j,k,p.anchor,p.head):p}else k=ua(j,k,c);e?-1==l?(l=n.length,Ba(j,na(n.concat([k]),l),{scroll:!1,origin:"*mouse"})):n.length>1&&n[l].empty()&&"single"==d&&!b.shiftKey?(Ba(j,na(n.slice(0,l).concat(n.slice(l+1)),0),{scroll:!1,origin:"*mouse"}),m=j.sel):xa(j,l,k,Jg):(l=0,Ba(j,new la([k],0),Jg),m=j.sel);var q=c,r=i.wrapper.getBoundingClientRect(),s=0,t=Db(a,function(a){ue(a)?g(a):h(a)}),v=Db(a,h);a.state.selectingText=v,Bg(document,"mousemove",t),Bg(document,"mouseup",v)}function Yb(a,b,c,d){try{var e=b.clientX,f=b.clientY}catch(b){return!1}if(e>=Math.floor(a.display.gutters.getBoundingClientRect().right))return!1;d&&yg(b);var g=a.display,h=g.lineDiv.getBoundingClientRect();if(f>h.bottom||!Ae(a,c))return se(b);f-=h.top-g.viewOffset;for(var i=0;i=e){var k=ae(a.doc,f),l=a.options.gutters[i];return Eg(a,c,a,k,l,b),se(b)}}}function Zb(a,b){return Yb(a,b,"gutterClick",!0)}function $b(a){var b=this;if(bc(b),!ye(b,a)&&!Sb(b.display,a)){yg(a),rf&&(Sf=+new Date);var c=Tb(b,a,!0),d=a.dataTransfer.files;if(c&&!Z(b))if(d&&d.length&&window.FileReader&&window.File)for(var e=d.length,f=Array(e),g=0,h=function(a,d){if(!b.options.allowDropFileTypes||-1!=Fe(b.options.allowDropFileTypes,a.type)){var h=new FileReader;h.onload=Db(b,function(){var a=h.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(a)&&(a=""),f[d]=a,++g==e){c=qa(b.doc,c);var i={from:c,to:c,text:b.doc.splitLines(f.join(b.doc.lineSeparator())),origin:"paste"};yc(b.doc,i),Aa(b.doc,oa(c,Yf(i)))}}),h.readAsText(a)}},i=0;e>i;++i)h(d[i],i);else{if(b.state.draggingText&&b.doc.sel.contains(c)>-1)return b.state.draggingText(a),void setTimeout(function(){b.display.input.focus()},20);try{var f=a.dataTransfer.getData("Text");if(f){if(b.state.draggingText&&!(Cf?a.altKey:a.ctrlKey))var j=b.listSelections();if(Ca(b.doc,oa(c,c)),j)for(var i=0;ig.clientWidth,i=g.scrollHeight>g.clientHeight;if(d&&h||e&&i){if(e&&Cf&&tf)a:for(var j=b.target,k=f.view;j!=g;j=j.parentNode)for(var l=0;lm?n=Math.max(0,n+m-50):o=Math.min(a.doc.height,o+m+50),D(a,{top:n,bottom:o})}20>Tf&&(null==f.wheelStartX?(f.wheelStartX=g.scrollLeft,f.wheelStartY=g.scrollTop,f.wheelDX=d,f.wheelDY=e,setTimeout(function(){if(null!=f.wheelStartX){var a=g.scrollLeft-f.wheelStartX,b=g.scrollTop-f.wheelStartY,c=b&&f.wheelDY&&b/f.wheelDY||a&&f.wheelDX&&a/f.wheelDX;f.wheelStartX=f.wheelStartY=null,c&&(Uf=(Uf*Tf+c)/(Tf+1),++Tf)}},200)):(f.wheelDX+=d,f.wheelDY+=e))}}function fc(a,b,c){if("string"==typeof b&&(b=hg[b],!b))return!1;a.display.input.ensurePolled();var d=a.display.shift,e=!1;try{Z(a)&&(a.state.suppressEdits=!0),c&&(a.display.shift=!1),e=b(a)!=Hg}finally{a.display.shift=d,a.state.suppressEdits=!1}return e}function gc(a,b,c){for(var d=0;dsf&&27==a.keyCode&&(a.returnValue=!1);var c=a.keyCode;b.display.shift=16==c||a.shiftKey;var d=ic(b,a);wf&&(Xf=d?c:null,!d&&88==c&&!ah&&(Cf?a.metaKey:a.ctrlKey)&&b.replaceSelection("",null,"cut")),18!=c||/\bCodeMirror-crosshair\b/.test(b.display.lineDiv.className)||lc(b)}}function lc(a){function b(a){18!=a.keyCode&&a.altKey||(Wg(c,"CodeMirror-crosshair"),Dg(document,"keyup",b),Dg(document,"mouseover",b))}var c=a.display.lineDiv;Xg(c,"CodeMirror-crosshair"),Bg(document,"keyup",b),Bg(document,"mouseover",b)}function mc(a){16==a.keyCode&&(this.doc.sel.shift=!1),ye(this,a)}function nc(a){var b=this;if(!(Sb(b.display,a)||ye(b,a)||a.ctrlKey&&!a.altKey||Cf&&a.metaKey)){var c=a.keyCode,d=a.charCode;if(wf&&c==Xf)return Xf=null,void yg(a);if(!wf||a.which&&!(a.which<10)||!ic(b,a)){var e=String.fromCharCode(null==d?c:d);jc(b,a,e)||b.display.input.onKeyPress(a)}}}function oc(a){a.state.delayingBlurEvent=!0,setTimeout(function(){a.state.delayingBlurEvent&&(a.state.delayingBlurEvent=!1,qc(a))},100)}function pc(a){a.state.delayingBlurEvent&&(a.state.delayingBlurEvent=!1),"nocursor"!=a.options.readOnly&&(a.state.focused||(Eg(a,"focus",a),a.state.focused=!0,Xg(a.display.wrapper,"CodeMirror-focused"),a.curOp||a.display.selForContextMenu==a.doc.sel||(a.display.input.reset(),tf&&setTimeout(function(){a.display.input.reset(!0)},20)),a.display.input.receivedFocus()),La(a))}function qc(a){a.state.delayingBlurEvent||(a.state.focused&&(Eg(a,"blur",a),a.state.focused=!1,Wg(a.display.wrapper,"CodeMirror-focused")),clearInterval(a.display.blinker),setTimeout(function(){a.state.focused||(a.display.shift=!1)},150))}function rc(a,b){Sb(a.display,b)||sc(a,b)||ye(a,b,"contextmenu")||a.display.input.onContextMenu(b)}function sc(a,b){return Ae(a,"gutterContextMenu")?Yb(a,b,"gutterContextMenu",!1):!1}function tc(a,b){if(Kf(a,b.from)<0)return a;if(Kf(a,b.to)<=0)return Yf(b);var c=a.line+b.text.length-(b.to.line-b.from.line)-1,d=a.ch;return a.line==b.to.line&&(d+=Yf(b).ch-b.to.ch),Jf(c,d)}function uc(a,b){for(var c=[],d=0;d=0;--e)zc(a,{from:d[e].from,to:d[e].to,text:e?[""]:b.text});else zc(a,b)}}function zc(a,b){if(1!=b.text.length||""!=b.text[0]||0!=Kf(b.from,b.to)){var c=uc(a,b);he(a,b,c,a.cm?a.cm.curOp.id:NaN),Cc(a,b,c,dd(a,b));var d=[];Vd(a,function(a,c){c||-1!=Fe(d,a.history)||(re(a.history,b),d.push(a.history)),Cc(a,b,null,dd(a,b))})}}function Ac(a,b,c){if(!a.cm||!a.cm.state.suppressEdits){for(var d,e=a.history,f=a.sel,g="undo"==b?e.done:e.undone,h="undo"==b?e.undone:e.done,i=0;i=0;--i){var l=d.changes[i];if(l.origin=b,k&&!xc(a,l,!1))return void(g.length=0);j.push(ee(a,l));var m=i?uc(a,l):Ee(g);Cc(a,l,m,fd(a,l)),!i&&a.cm&&a.cm.scrollIntoView({from:l.from,to:Yf(l)});var n=[];Vd(a,function(a,b){b||-1!=Fe(n,a.history)||(re(a.history,l),n.push(a.history)),Cc(a,l,null,fd(a,l))})}}}}function Bc(a,b){if(0!=b&&(a.first+=b,a.sel=new la(Ge(a.sel.ranges,function(a){return new ma(Jf(a.anchor.line+b,a.anchor.ch),Jf(a.head.line+b,a.head.ch))}),a.sel.primIndex),a.cm)){Ib(a.cm,a.first,a.first-b,b);for(var c=a.cm.display,d=c.viewFrom;da.lastLine())){if(b.from.linef&&(b={from:b.from,to:Jf(f,Xd(a,f).text.length),text:[b.text[0]],origin:b.origin}),b.removed=Yd(a,b.from,b.to),c||(c=uc(a,b)),a.cm?Dc(a.cm,b,d):Sd(a,b,d),Ca(a,c,Ig)}}function Dc(a,b,c){var d=a.doc,e=a.display,g=b.from,h=b.to,i=!1,j=g.line;a.options.lineWrapping||(j=_d(qd(Xd(d,g.line))),d.iter(j,h.line+1,function(a){return a==e.maxLine?(i=!0,!0):void 0})),d.sel.contains(b.from,b.to)>-1&&ze(a),Sd(d,b,c,f(a)),a.options.lineWrapping||(d.iter(j,g.line+b.text.length,function(a){var b=l(a);b>e.maxLineLength&&(e.maxLine=a,e.maxLineLength=b,e.maxLineChanged=!0,i=!1)}),i&&(a.curOp.updateMaxLine=!0)),d.frontier=Math.min(d.frontier,g.line),Ma(a,400);var k=b.text.length-(h.line-g.line)-1;b.full?Ib(a):g.line!=h.line||1!=b.text.length||Rd(a.doc,b)?Ib(a,g.line,h.line+1,k):Jb(a,g.line,"text");var m=Ae(a,"changes"),n=Ae(a,"change");if(n||m){var o={from:g,to:h,text:b.text,removed:b.removed,origin:b.origin};n&&we(a,"change",a,o),m&&(a.curOp.changeObjs||(a.curOp.changeObjs=[])).push(o)}a.display.selForContextMenu=null}function Ec(a,b,c,d,e){if(d||(d=c),Kf(d,c)<0){var f=d;d=c,c=f}"string"==typeof b&&(b=a.splitLines(b)),yc(a,{from:c,to:d,text:b,origin:e})}function Fc(a,b){if(!ye(a,"scrollCursorIntoView")){var c=a.display,d=c.sizer.getBoundingClientRect(),e=null;if(b.top+d.top<0?e=!0:b.bottom+d.top>(window.innerHeight||document.documentElement.clientHeight)&&(e=!1),null!=e&&!zf){var f=Oe("div","\u200b",null,"position: absolute; top: "+(b.top-c.viewOffset-Qa(a.display))+"px; height: "+(b.bottom-b.top+Ta(a)+c.barHeight)+"px; left: "+b.left+"px; width: 2px;");a.display.lineSpace.appendChild(f),f.scrollIntoView(e),a.display.lineSpace.removeChild(f)}}}function Gc(a,b,c,d){null==d&&(d=0);for(var e=0;5>e;e++){var f=!1,g=mb(a,b),h=c&&c!=b?mb(a,c):g,i=Ic(a,Math.min(g.left,h.left),Math.min(g.top,h.top)-d,Math.max(g.left,h.left),Math.max(g.bottom,h.bottom)+d),j=a.doc.scrollTop,k=a.doc.scrollLeft;if(null!=i.scrollTop&&(cc(a,i.scrollTop),Math.abs(a.doc.scrollTop-j)>1&&(f=!0)),null!=i.scrollLeft&&(dc(a,i.scrollLeft),Math.abs(a.doc.scrollLeft-k)>1&&(f=!0)),!f)break}return g}function Hc(a,b,c,d,e){var f=Ic(a,b,c,d,e);null!=f.scrollTop&&cc(a,f.scrollTop),null!=f.scrollLeft&&dc(a,f.scrollLeft)}function Ic(a,b,c,d,e){var f=a.display,g=rb(a.display);0>c&&(c=0);var h=a.curOp&&null!=a.curOp.scrollTop?a.curOp.scrollTop:f.scroller.scrollTop,i=Va(a),j={};e-c>i&&(e=c+i);var k=a.doc.height+Ra(f),l=g>c,m=e>k-g;if(h>c)j.scrollTop=l?0:c;else if(e>h+i){var n=Math.min(c,(m?k:e)-i);n!=h&&(j.scrollTop=n)}var o=a.curOp&&null!=a.curOp.scrollLeft?a.curOp.scrollLeft:f.scroller.scrollLeft,p=Ua(a)-(a.options.fixedGutter?f.gutters.offsetWidth:0),q=d-b>p;return q&&(d=b+p),10>b?j.scrollLeft=0:o>b?j.scrollLeft=Math.max(0,b-(q?0:10)):d>p+o-3&&(j.scrollLeft=d+(q?0:10)-p),j}function Jc(a,b,c){(null!=b||null!=c)&&Lc(a),null!=b&&(a.curOp.scrollLeft=(null==a.curOp.scrollLeft?a.doc.scrollLeft:a.curOp.scrollLeft)+b),null!=c&&(a.curOp.scrollTop=(null==a.curOp.scrollTop?a.doc.scrollTop:a.curOp.scrollTop)+c)}function Kc(a){Lc(a);var b=a.getCursor(),c=b,d=b;a.options.lineWrapping||(c=b.ch?Jf(b.line,b.ch-1):b,d=Jf(b.line,b.ch+1)),a.curOp.scrollToPos={from:c,to:d,margin:a.options.cursorScrollMargin,isCursor:!0}}function Lc(a){var b=a.curOp.scrollToPos;if(b){a.curOp.scrollToPos=null;var c=nb(a,b.from),d=nb(a,b.to),e=Ic(a,Math.min(c.left,d.left),Math.min(c.top,d.top)-b.margin,Math.max(c.right,d.right),Math.max(c.bottom,d.bottom)+b.margin);a.scrollTo(e.scrollLeft,e.scrollTop)}}function Mc(a,b,c,d){var e,f=a.doc;null==c&&(c="add"),"smart"==c&&(f.mode.indent?e=Pa(a,b):c="prev");var g=a.options.tabSize,h=Xd(f,b),i=Lg(h.text,null,g);h.stateAfter&&(h.stateAfter=null);var j,k=h.text.match(/^\s*/)[0];if(d||/\S/.test(h.text)){if("smart"==c&&(j=f.mode.indent(e,h.text.slice(k.length),h.text), +j==Hg||j>150)){if(!d)return;c="prev"}}else j=0,c="not";"prev"==c?j=b>f.first?Lg(Xd(f,b-1).text,null,g):0:"add"==c?j=i+a.options.indentUnit:"subtract"==c?j=i-a.options.indentUnit:"number"==typeof c&&(j=i+c),j=Math.max(0,j);var l="",m=0;if(a.options.indentWithTabs)for(var n=Math.floor(j/g);n;--n)m+=g,l+=" ";if(j>m&&(l+=De(j-m)),l!=k)return Ec(f,l,Jf(b,0),Jf(b,k.length),"+input"),h.stateAfter=null,!0;for(var n=0;n=0;b--)Ec(a.doc,"",d[b].from,d[b].to,"+delete");Kc(a)})}function Pc(a,b,c,d,e){function f(){var b=h+c;return b=a.first+a.size?l=!1:(h=b,k=Xd(a,b))}function g(a){var b=(e?kf:lf)(k,i,c,!0);if(null==b){if(a||!f())return l=!1;i=e?(0>c?cf:bf)(k):0>c?k.text.length:0}else i=b;return!0}var h=b.line,i=b.ch,j=c,k=Xd(a,h),l=!0;if("char"==d)g();else if("column"==d)g(!0);else if("word"==d||"group"==d)for(var m=null,n="group"==d,o=a.cm&&a.cm.getHelper(b,"wordChars"),p=!0;!(0>c)||g(!p);p=!1){var q=k.text.charAt(i)||"\n",r=Le(q,o)?"w":n&&"\n"==q?"n":!n||/\s/.test(q)?null:"p";if(!n||p||r||(r="s"),m&&m!=r){0>c&&(c=1,g());break}if(r&&(m=r),c>0&&!g(!p))break}var s=Ga(a,Jf(h,i),j,!0);return l||(s.hitSide=!0),s}function Qc(a,b,c,d){var e,f=a.doc,g=b.left;if("page"==d){var h=Math.min(a.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight);e=b.top+c*(h-(0>c?1.5:.5)*rb(a.display))}else"line"==d&&(e=c>0?b.bottom+3:b.top-3);for(;;){var i=pb(a,g,e);if(!i.outside)break;if(0>c?0>=e:e>=f.height){i.hitSide=!0;break}e+=5*c}return i}function Rc(b,c,d,e){a.defaults[b]=c,d&&($f[b]=e?function(a,b,c){c!=_f&&d(a,b,c)}:d)}function Sc(a){for(var b,c,d,e,f=a.split(/-(?!$)/),a=f[f.length-1],g=0;g0||0==g&&f.clearWhenEmpty!==!1)return f;if(f.replacedWith&&(f.collapsed=!0,f.widgetNode=Oe("span",[f.replacedWith],"CodeMirror-widget"),d.handleMouseEvents||f.widgetNode.setAttribute("cm-ignore-events","true"),d.insertLeft&&(f.widgetNode.insertLeft=!0)),f.collapsed){if(pd(a,b.line,b,c,f)||b.line!=c.line&&pd(a,c.line,b,c,f))throw new Error("Inserting collapsed marker partially overlapping an existing one");If=!0}f.addToHistory&&he(a,{from:b,to:c,origin:"markText"},a.sel,NaN);var h,i=b.line,j=a.cm;if(a.iter(i,c.line+1,function(a){j&&f.collapsed&&!j.options.lineWrapping&&qd(a)==j.display.maxLine&&(h=!0),f.collapsed&&i!=b.line&&$d(a,0),ad(a,new Zc(f,i==b.line?b.ch:null,i==c.line?c.ch:null)),++i}),f.collapsed&&a.iter(b.line,c.line+1,function(b){ud(a,b)&&$d(b,0)}),f.clearOnEnter&&Bg(f,"beforeCursorEnter",function(){f.clear()}),f.readOnly&&(Hf=!0,(a.history.done.length||a.history.undone.length)&&a.clearHistory()),f.collapsed&&(f.id=++ng,f.atomic=!0),j){if(h&&(j.curOp.updateMaxLine=!0),f.collapsed)Ib(j,b.line,c.line+1);else if(f.className||f.title||f.startStyle||f.endStyle||f.css)for(var k=b.line;k<=c.line;k++)Jb(j,k,"text");f.atomic&&Ea(j.doc),we(j,"markerAdded",j,f)}return f}function Vc(a,b,c,d,e){d=Je(d),d.shared=!1;var f=[Uc(a,b,c,d,e)],g=f[0],h=d.widgetNode;return Vd(a,function(a){h&&(d.widgetNode=h.cloneNode(!0)),f.push(Uc(a,qa(a,b),qa(a,c),d,e));for(var i=0;i=b:f.to>b);(d||(d=[])).push(new Zc(g,f.from,i?null:f.to))}}return d}function cd(a,b,c){if(a)for(var d,e=0;e=b:f.to>b);if(h||f.from==b&&"bookmark"==g.type&&(!c||f.marker.insertLeft)){var i=null==f.from||(g.inclusiveLeft?f.from<=b:f.from0&&h)for(var l=0;ll;++l)o.push(p);o.push(i)}return o}function ed(a){for(var b=0;b0)){var k=[i,1],l=Kf(j.from,h.from),m=Kf(j.to,h.to);(0>l||!g.inclusiveLeft&&!l)&&k.push({from:j.from,to:h.from}),(m>0||!g.inclusiveRight&&!m)&&k.push({from:h.to,to:j.to}),e.splice.apply(e,k),i+=k.length-1}}return e}function hd(a){var b=a.markedSpans;if(b){for(var c=0;c=0&&0>=l||0>=k&&l>=0)&&(0>=k&&(Kf(j.to,c)>0||i.marker.inclusiveRight&&e.inclusiveLeft)||k>=0&&(Kf(j.from,d)<0||i.marker.inclusiveLeft&&e.inclusiveRight)))return!0}}}function qd(a){for(var b;b=nd(a);)a=b.find(-1,!0).line;return a}function rd(a){for(var b,c;b=od(a);)a=b.find(1,!0).line,(c||(c=[])).push(a);return c}function sd(a,b){var c=Xd(a,b),d=qd(c);return c==d?b:_d(d)}function td(a,b){if(b>a.lastLine())return b;var c,d=Xd(a,b);if(!ud(a,d))return b;for(;c=od(d);)d=c.find(1,!0).line;return _d(d)+1}function ud(a,b){var c=If&&b.markedSpans;if(c)for(var d,e=0;ef;f++){e&&(e[0]=a.innerMode(b,d).mode);var g=b.token(c,d);if(c.pos>c.start)return g}throw new Error("Mode "+b.name+" failed to advance stream.")}function Ed(a,b,c,d){function e(a){return{start:l.start,end:l.pos,string:l.current(),type:f||null,state:a?fg(g.mode,k):k}}var f,g=a.doc,h=g.mode;b=qa(g,b);var i,j=Xd(g,b.line),k=Pa(a,b.line,c),l=new mg(j.text,a.options.tabSize);for(d&&(i=[]);(d||l.posa.options.maxHighlightLength?(h=!1,g&&Id(a,b,d,l.pos),l.pos=b.length,i=null):i=Bd(Dd(c,l,d,m),f),m){var n=m[0].name;n&&(i="m-"+(i?n+" "+i:n))}if(!h||k!=i){for(;jj;){var d=e[i];d>a&&e.splice(i,1,a,e[i+1],d),i+=2,j=Math.min(a,d)}if(b)if(h.opaque)e.splice(c,i-c,a,"cm-overlay "+b),i=c+2;else for(;i>c;c+=2){var f=e[c+1];e[c+1]=(f?f+" ":"")+"cm-overlay "+b}},f)}return{styles:e,classes:f.bgClass||f.textClass?f:null}}function Hd(a,b,c){if(!b.styles||b.styles[0]!=a.state.modeGen){var d=Pa(a,_d(b)),e=Gd(a,b,b.text.length>a.options.maxHighlightLength?fg(a.doc.mode,d):d);b.stateAfter=d,b.styles=e.styles,e.classes?b.styleClasses=e.classes:b.styleClasses&&(b.styleClasses=null),c===a.doc.frontier&&a.doc.frontier++}return b.styles}function Id(a,b,c,d){var e=a.doc.mode,f=new mg(b,a.options.tabSize);for(f.start=f.pos=d||0,""==b&&Cd(e,c);!f.eol();)Dd(e,f,c),f.start=f.pos}function Jd(a,b){if(!a||/^\s*$/.test(a))return null;var c=b.addModeClass?tg:sg;return c[a]||(c[a]=a.replace(/\S+/g,"cm-$&"))}function Kd(a,b){var c=Oe("span",null,null,tf?"padding-right: .1px":null),d={pre:Oe("pre",[c],"CodeMirror-line"),content:c,col:0,pos:0,cm:a,splitSpaces:(rf||tf)&&a.getOption("lineWrapping")};b.measure={};for(var e=0;e<=(b.rest?b.rest.length:0);e++){var f,g=e?b.rest[e-1]:b.line;d.pos=0,d.addToken=Md,Ye(a.display.measure)&&(f=ce(g))&&(d.addToken=Od(d.addToken,f)),d.map=[];var h=b!=a.display.externalMeasured&&_d(g);Qd(g,d,Hd(a,g,h)),g.styleClasses&&(g.styleClasses.bgClass&&(d.bgClass=Te(g.styleClasses.bgClass,d.bgClass||"")),g.styleClasses.textClass&&(d.textClass=Te(g.styleClasses.textClass,d.textClass||""))),0==d.map.length&&d.map.push(0,0,d.content.appendChild(Xe(a.display.measure))),0==e?(b.measure.map=d.map,b.measure.cache={}):((b.measure.maps||(b.measure.maps=[])).push(d.map),(b.measure.caches||(b.measure.caches=[])).push({}))}return tf&&/\bcm-tab\b/.test(d.content.lastChild.className)&&(d.content.className="cm-tab-wrap-hack"),Eg(a,"renderLine",a,b.line,d.pre),d.pre.className&&(d.textClass=Te(d.pre.className,d.textClass||"")),d}function Ld(a){var b=Oe("span","\u2022","cm-invalidchar");return b.title="\\u"+a.charCodeAt(0).toString(16),b.setAttribute("aria-label",b.title),b}function Md(a,b,c,d,e,f,g){if(b){var h=a.splitSpaces?b.replace(/ {3,}/g,Nd):b,i=a.cm.state.specialChars,j=!1;if(i.test(b))for(var k=document.createDocumentFragment(),l=0;;){i.lastIndex=l;var m=i.exec(b),n=m?m.index-l:b.length-l;if(n){var o=document.createTextNode(h.slice(l,l+n));rf&&9>sf?k.appendChild(Oe("span",[o])):k.appendChild(o),a.map.push(a.pos,a.pos+n,o),a.col+=n,a.pos+=n}if(!m)break;if(l+=n+1," "==m[0]){var p=a.cm.options.tabSize,q=p-a.col%p,o=k.appendChild(Oe("span",De(q),"cm-tab"));o.setAttribute("role","presentation"),o.setAttribute("cm-text"," "),a.col+=q}else if("\r"==m[0]||"\n"==m[0]){var o=k.appendChild(Oe("span","\r"==m[0]?"\u240d":"\u2424","cm-invalidchar"));o.setAttribute("cm-text",m[0]),a.col+=1}else{var o=a.cm.options.specialCharPlaceholder(m[0]);o.setAttribute("cm-text",m[0]),rf&&9>sf?k.appendChild(Oe("span",[o])):k.appendChild(o),a.col+=1}a.map.push(a.pos,a.pos+1,o),a.pos++}else{a.col+=b.length;var k=document.createTextNode(h);a.map.push(a.pos,a.pos+b.length,k),rf&&9>sf&&(j=!0),a.pos+=b.length}if(c||d||e||j||g){var r=c||"";d&&(r+=d),e&&(r+=e);var s=Oe("span",[k],r,g);return f&&(s.title=f),a.content.appendChild(s)}a.content.appendChild(k)}}function Nd(a){for(var b=" ",c=0;cj&&m.from<=j)break}if(m.to>=k)return a(c,d,e,f,g,h,i);a(c,d.slice(0,m.to-j),e,f,null,h,i),f=null,d=d.slice(m.to-j),j=m.to}}}function Pd(a,b,c,d){var e=!d&&c.widgetNode;e&&a.map.push(a.pos,a.pos+b,e),!d&&a.cm.display.input.needsContentAttribute&&(e||(e=a.content.appendChild(document.createElement("span"))),e.setAttribute("cm-marker",c.id)),e&&(a.cm.display.input.setUneditable(e),a.content.appendChild(e)),a.pos+=b}function Qd(a,b,c){var d=a.markedSpans,e=a.text,f=0;if(d)for(var g,h,i,j,k,l,m,n=e.length,o=0,p=1,q="",r=0;;){if(r==o){i=j=k=l=h="",m=null,r=1/0;for(var s=[],t=0;to||v.collapsed&&u.to==o&&u.from==o)?(null!=u.to&&u.to!=o&&r>u.to&&(r=u.to,j=""),v.className&&(i+=" "+v.className),v.css&&(h=v.css),v.startStyle&&u.from==o&&(k+=" "+v.startStyle),v.endStyle&&u.to==r&&(j+=" "+v.endStyle),v.title&&!l&&(l=v.title),v.collapsed&&(!m||ld(m.marker,v)<0)&&(m=u)):u.from>o&&r>u.from&&(r=u.from)}if(m&&(m.from||0)==o){if(Pd(b,(null==m.to?n+1:m.to)-o,m.marker,null==m.from),null==m.to)return;m.to==o&&(m=!1)}if(!m&&s.length)for(var t=0;t=n)break;for(var w=Math.min(n,r);;){if(q){var x=o+q.length;if(!m){var y=x>w?q.slice(0,w-o):q;b.addToken(b,y,g?g+i:i,k,o+y.length==r?j:"",l,h)}if(x>=w){q=q.slice(w-o),o=w;break}o=x,k=""}q=e.slice(f,f=c[p++]),g=Jd(c[p++],b.cm.options)}}else for(var p=1;pc;++c)f.push(new rg(j[c],e(c),d));return f}var h=b.from,i=b.to,j=b.text,k=Xd(a,h.line),l=Xd(a,i.line),m=Ee(j),n=e(j.length-1),o=i.line-h.line;if(b.full)a.insert(0,g(0,j.length)),a.remove(j.length,a.size-j.length);else if(Rd(a,b)){var p=g(0,j.length-1);f(l,l.text,n),o&&a.remove(h.line,o),p.length&&a.insert(h.line,p)}else if(k==l)if(1==j.length)f(k,k.text.slice(0,h.ch)+m+k.text.slice(i.ch),n);else{var p=g(1,j.length-1);p.push(new rg(m+k.text.slice(i.ch),n,d)),f(k,k.text.slice(0,h.ch)+j[0],e(0)),a.insert(h.line+1,p)}else if(1==j.length)f(k,k.text.slice(0,h.ch)+j[0]+l.text.slice(i.ch),e(0)),a.remove(h.line+1,o);else{f(k,k.text.slice(0,h.ch)+j[0],e(0)),f(l,m+l.text.slice(i.ch),n);var p=g(1,j.length-1);o>1&&a.remove(h.line+1,o-1),a.insert(h.line+1,p)}we(a,"change",a,b)}function Td(a){this.lines=a,this.parent=null;for(var b=0,c=0;bb||b>=a.size)throw new Error("There is no line "+(b+a.first)+" in the document.");for(var c=a;!c.lines;)for(var d=0;;++d){var e=c.children[d],f=e.chunkSize();if(f>b){c=e;break}b-=f}return c.lines[b]}function Yd(a,b,c){var d=[],e=b.line;return a.iter(b.line,c.line+1,function(a){var f=a.text;e==c.line&&(f=f.slice(0,c.ch)),e==b.line&&(f=f.slice(b.ch)),d.push(f),++e}),d}function Zd(a,b,c){var d=[];return a.iter(b,c,function(a){d.push(a.text)}),d}function $d(a,b){var c=b-a.height;if(c)for(var d=a;d;d=d.parent)d.height+=c}function _d(a){if(null==a.parent)return null;for(var b=a.parent,c=Fe(b.lines,a),d=b.parent;d;b=d,d=d.parent)for(var e=0;d.children[e]!=b;++e)c+=d.children[e].chunkSize();return c+b.first}function ae(a,b){var c=a.first;a:do{for(var d=0;db){a=e;continue a}b-=f,c+=e.chunkSize()}return c}while(!a.lines);for(var d=0;db)break;b-=h}return c+d}function be(a){a=qd(a);for(var b=0,c=a.parent,d=0;d1&&!a.done[a.done.length-2].ranges?(a.done.pop(),Ee(a.done)):void 0}function he(a,b,c,d){var e=a.history;e.undone.length=0;var f,g=+new Date;if((e.lastOp==d||e.lastOrigin==b.origin&&b.origin&&("+"==b.origin.charAt(0)&&a.cm&&e.lastModTime>g-a.cm.options.historyEventDelay||"*"==b.origin.charAt(0)))&&(f=ge(e,e.lastOp==d))){var h=Ee(f.changes);0==Kf(b.from,b.to)&&0==Kf(b.from,h.to)?h.to=Yf(b):f.changes.push(ee(a,b))}else{var i=Ee(e.done);for(i&&i.ranges||ke(a.sel,e.done),f={changes:[ee(a,b)],generation:e.generation},e.done.push(f);e.done.length>e.undoDepth;)e.done.shift(),e.done[0].ranges||e.done.shift()}e.done.push(c),e.generation=++e.maxGeneration,e.lastModTime=e.lastSelTime=g,e.lastOp=e.lastSelOp=d,e.lastOrigin=e.lastSelOrigin=b.origin,h||Eg(a,"historyAdded")}function ie(a,b,c,d){var e=b.charAt(0);return"*"==e||"+"==e&&c.ranges.length==d.ranges.length&&c.somethingSelected()==d.somethingSelected()&&new Date-a.history.lastSelTime<=(a.cm?a.cm.options.historyEventDelay:500)}function je(a,b,c,d){var e=a.history,f=d&&d.origin;c==e.lastSelOp||f&&e.lastSelOrigin==f&&(e.lastModTime==e.lastSelTime&&e.lastOrigin==f||ie(a,f,Ee(e.done),b))?e.done[e.done.length-1]=b:ke(b,e.done),e.lastSelTime=+new Date,e.lastSelOrigin=f,e.lastSelOp=c,d&&d.clearRedo!==!1&&fe(e.undone)}function ke(a,b){var c=Ee(b);c&&c.ranges&&c.equals(a)||b.push(a)}function le(a,b,c,d){var e=b["spans_"+a.id],f=0;a.iter(Math.max(a.first,c),Math.min(a.first+a.size,d),function(c){c.markedSpans&&((e||(e=b["spans_"+a.id]={}))[f]=c.markedSpans),++f})}function me(a){if(!a)return null;for(var b,c=0;c-1&&(Ee(h)[l]=k[l],delete k[l])}}}return e}function pe(a,b,c,d){c0?d.slice():Cg:d||Cg}function we(a,b){function c(a){return function(){a.apply(null,f)}}var d=ve(a,b,!1);if(d.length){var e,f=Array.prototype.slice.call(arguments,2);Qf?e=Qf.delayedCallbacks:Fg?e=Fg:(e=Fg=[],setTimeout(xe,0));for(var g=0;g0}function Be(a){a.prototype.on=function(a,b){Bg(this,a,b)},a.prototype.off=function(a,b){Dg(this,a,b)}}function Ce(){this.id=null}function De(a){for(;Ng.length<=a;)Ng.push(Ee(Ng)+" ");return Ng[a]}function Ee(a){return a[a.length-1]}function Fe(a,b){for(var c=0;c-1&&Rg(a)?!0:b.test(a):Rg(a)}function Me(a){for(var b in a)if(a.hasOwnProperty(b)&&a[b])return!1;return!0}function Ne(a){return a.charCodeAt(0)>=768&&Sg.test(a)}function Oe(a,b,c,d){var e=document.createElement(a);if(c&&(e.className=c),d&&(e.style.cssText=d),"string"==typeof b)e.appendChild(document.createTextNode(b));else if(b)for(var f=0;f0;--b)a.removeChild(a.firstChild);return a}function Qe(a,b){return Pe(a).appendChild(b)}function Re(){for(var a=document.activeElement;a&&a.root&&a.root.activeElement;)a=a.root.activeElement;return a}function Se(a){return new RegExp("(^|\\s)"+a+"(?:$|\\s)\\s*")}function Te(a,b){for(var c=a.split(" "),d=0;d2&&!(rf&&8>sf))}var c=Ug?Oe("span","\u200b"):Oe("span","\xa0",null,"display: inline-block; width: 1px; margin-right: -1px");return c.setAttribute("cm-text",""),c}function Ye(a){if(null!=Vg)return Vg;var b=Qe(a,document.createTextNode("A\u062eA")),c=Pg(b,0,1).getBoundingClientRect();if(!c||c.left==c.right)return!1;var d=Pg(b,1,2).getBoundingClientRect();return Vg=d.right-c.right<3}function Ze(a){if(null!=bh)return bh;var b=Qe(a,Oe("span","x")),c=b.getBoundingClientRect(),d=Pg(b,0,1).getBoundingClientRect();return bh=Math.abs(c.left-d.left)>1}function $e(a,b,c,d){if(!a)return d(b,c,"ltr");for(var e=!1,f=0;fb||b==c&&g.to==b)&&(d(Math.max(g.from,b),Math.min(g.to,c),1==g.level?"rtl":"ltr"),e=!0)}e||d(b,c,"ltr")}function _e(a){return a.level%2?a.to:a.from}function af(a){return a.level%2?a.from:a.to}function bf(a){var b=ce(a);return b?_e(b[0]):0}function cf(a){var b=ce(a);return b?af(Ee(b)):a.text.length}function df(a,b){var c=Xd(a.doc,b),d=qd(c);d!=c&&(b=_d(d));var e=ce(d),f=e?e[0].level%2?cf(d):bf(d):0;return Jf(b,f)}function ef(a,b){for(var c,d=Xd(a.doc,b);c=od(d);)d=c.find(1,!0).line,b=null;var e=ce(d),f=e?e[0].level%2?bf(d):cf(d):d.text.length;return Jf(null==b?_d(d):b,f)}function ff(a,b){var c=df(a,b.line),d=Xd(a.doc,c.line),e=ce(d);if(!e||0==e[0].level){var f=Math.max(0,d.text.search(/\S/)),g=b.line==c.line&&b.ch<=f&&b.ch;return Jf(c.line,g?0:f)}return c}function gf(a,b,c){var d=a[0].level;return b==d?!0:c==d?!1:c>b}function hf(a,b){dh=null;for(var c,d=0;db)return d;if(e.from==b||e.to==b){if(null!=c)return gf(a,e.level,a[c].level)?(e.from!=e.to&&(dh=c),d):(e.from!=e.to&&(dh=d),c);c=d}}return c}function jf(a,b,c,d){if(!d)return b+c;do b+=c;while(b>0&&Ne(a.text.charAt(b)));return b}function kf(a,b,c,d){var e=ce(a);if(!e)return lf(a,b,c,d);for(var f=hf(e,b),g=e[f],h=jf(a,b,g.level%2?-c:c,d);;){if(h>g.from&&h0==g.level%2?g.to:g.from);if(g=e[f+=c],!g)return null;h=c>0==g.level%2?jf(a,g.to,-1,d):jf(a,g.from,1,d)}}function lf(a,b,c,d){var e=b+c;if(d)for(;e>0&&Ne(a.text.charAt(e));)e+=c;return 0>e||e>a.text.length?null:e}var mf=navigator.userAgent,nf=navigator.platform,of=/gecko\/\d/i.test(mf),pf=/MSIE \d/.test(mf),qf=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(mf),rf=pf||qf,sf=rf&&(pf?document.documentMode||6:qf[1]),tf=/WebKit\//.test(mf),uf=tf&&/Qt\/\d+\.\d+/.test(mf),vf=/Chrome\//.test(mf),wf=/Opera\//.test(mf),xf=/Apple Computer/.test(navigator.vendor),yf=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(mf),zf=/PhantomJS/.test(mf),Af=/AppleWebKit/.test(mf)&&/Mobile\/\w+/.test(mf),Bf=Af||/Android|webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(mf),Cf=Af||/Mac/.test(nf),Df=/win/i.test(nf),Ef=wf&&mf.match(/Version\/(\d*\.\d*)/);Ef&&(Ef=Number(Ef[1])),Ef&&Ef>=15&&(wf=!1,tf=!0);var Ff=Cf&&(uf||wf&&(null==Ef||12.11>Ef)),Gf=of||rf&&sf>=9,Hf=!1,If=!1;p.prototype=Je({update:function(a){var b=a.scrollWidth>a.clientWidth+1,c=a.scrollHeight>a.clientHeight+1,d=a.nativeBarWidth;if(c){this.vert.style.display="block",this.vert.style.bottom=b?d+"px":"0";var e=a.viewHeight-(b?d:0);this.vert.firstChild.style.height=Math.max(0,a.scrollHeight-a.clientHeight+e)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(b){this.horiz.style.display="block",this.horiz.style.right=c?d+"px":"0",this.horiz.style.left=a.barLeft+"px";var f=a.viewWidth-a.barLeft-(c?d:0);this.horiz.firstChild.style.width=a.scrollWidth-a.clientWidth+f+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedOverlay&&a.clientHeight>0&&(0==d&&this.overlayHack(),this.checkedOverlay=!0),{right:c?d:0,bottom:b?d:0}},setScrollLeft:function(a){this.horiz.scrollLeft!=a&&(this.horiz.scrollLeft=a)},setScrollTop:function(a){this.vert.scrollTop!=a&&(this.vert.scrollTop=a)},overlayHack:function(){var a=Cf&&!yf?"12px":"18px";this.horiz.style.minHeight=this.vert.style.minWidth=a;var b=this,c=function(a){te(a)!=b.vert&&te(a)!=b.horiz&&Db(b.cm,Ub)(a)};Bg(this.vert,"mousedown",c),Bg(this.horiz,"mousedown",c)},clear:function(){var a=this.horiz.parentNode;a.removeChild(this.horiz),a.removeChild(this.vert)}},p.prototype),q.prototype=Je({update:function(){return{bottom:0,right:0}},setScrollLeft:function(){},setScrollTop:function(){},clear:function(){}},q.prototype),a.scrollbarModel={"native":p,"null":q},z.prototype.signal=function(a,b){Ae(a,b)&&this.events.push(arguments)},z.prototype.finish=function(){for(var a=0;a=9&&c.hasSelection&&(c.hasSelection=null),c.poll()}),Bg(f,"paste",function(a){return _(a,d)?!0:(d.state.pasteIncoming=!0,void c.fastPoll())}),Bg(f,"cut",b),Bg(f,"copy",b),Bg(a.scroller,"paste",function(b){Sb(a,b)||(d.state.pasteIncoming=!0,c.focus()); +}),Bg(a.lineSpace,"selectstart",function(b){Sb(a,b)||yg(b)}),Bg(f,"compositionstart",function(){var a=d.getCursor("from");c.composing&&c.composing.range.clear(),c.composing={start:a,range:d.markText(a,d.getCursor("to"),{className:"CodeMirror-composing"})}}),Bg(f,"compositionend",function(){c.composing&&(c.poll(),c.composing.range.clear(),c.composing=null)})},prepareSelection:function(){var a=this.cm,b=a.display,c=a.doc,d=Ia(a);if(a.options.moveInputWithCursor){var e=mb(a,c.sel.primary().head,"div"),f=b.wrapper.getBoundingClientRect(),g=b.lineDiv.getBoundingClientRect();d.teTop=Math.max(0,Math.min(b.wrapper.clientHeight-10,e.top+g.top-f.top)),d.teLeft=Math.max(0,Math.min(b.wrapper.clientWidth-10,e.left+g.left-f.left))}return d},showSelection:function(a){var b=this.cm,c=b.display;Qe(c.cursorDiv,a.cursors),Qe(c.selectionDiv,a.selection),null!=a.teTop&&(this.wrapper.style.top=a.teTop+"px",this.wrapper.style.left=a.teLeft+"px")},reset:function(a){if(!this.contextMenuPending){var b,c,d=this.cm,e=d.doc;if(d.somethingSelected()){this.prevInput="";var f=e.sel.primary();b=ah&&(f.to().line-f.from().line>100||(c=d.getSelection()).length>1e3);var g=b?"-":c||d.getSelection();this.textarea.value=g,d.state.focused&&Og(this.textarea),rf&&sf>=9&&(this.hasSelection=g)}else a||(this.prevInput=this.textarea.value="",rf&&sf>=9&&(this.hasSelection=null));this.inaccurateSelection=b}},getField:function(){return this.textarea},supportsTouch:function(){return!1},focus:function(){if("nocursor"!=this.cm.options.readOnly&&(!Bf||Re()!=this.textarea))try{this.textarea.focus()}catch(a){}},blur:function(){this.textarea.blur()},resetPosition:function(){this.wrapper.style.top=this.wrapper.style.left=0},receivedFocus:function(){this.slowPoll()},slowPoll:function(){var a=this;a.pollingFast||a.polling.set(this.cm.options.pollInterval,function(){a.poll(),a.cm.state.focused&&a.slowPoll()})},fastPoll:function(){function a(){var d=c.poll();d||b?(c.pollingFast=!1,c.slowPoll()):(b=!0,c.polling.set(60,a))}var b=!1,c=this;c.pollingFast=!0,c.polling.set(20,a)},poll:function(){var a=this.cm,b=this.textarea,c=this.prevInput;if(this.contextMenuPending||!a.state.focused||_g(b)&&!c&&!this.composing||Z(a)||a.options.disableInput||a.state.keySeq)return!1;var d=b.value;if(d==c&&!a.somethingSelected())return!1;if(rf&&sf>=9&&this.hasSelection===d||Cf&&/[\uf700-\uf7ff]/.test(d))return a.display.input.reset(),!1;if(a.doc.sel==a.display.selForContextMenu){var e=d.charCodeAt(0);if(8203!=e||c||(c="\u200b"),8666==e)return this.reset(),this.cm.execCommand("undo")}for(var f=0,g=Math.min(c.length,d.length);g>f&&c.charCodeAt(f)==d.charCodeAt(f);)++f;var h=this;return Cb(a,function(){$(a,d.slice(f),c.length-f,null,h.composing?"*compose":null),d.length>1e3||d.indexOf("\n")>-1?b.value=h.prevInput="":h.prevInput=d,h.composing&&(h.composing.range.clear(),h.composing.range=a.markText(h.composing.start,a.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},ensurePolled:function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},onKeyPress:function(){rf&&sf>=9&&(this.hasSelection=null),this.fastPoll()},onContextMenu:function(a){function b(){if(null!=g.selectionStart){var a=e.somethingSelected(),b="\u200b"+(a?g.value:"");g.value="\u21da",g.value=b,d.prevInput=a?"":"\u200b",g.selectionStart=1,g.selectionEnd=b.length,f.selForContextMenu=e.doc.sel}}function c(){if(d.contextMenuPending=!1,d.wrapper.style.position="relative",g.style.cssText=k,rf&&9>sf&&f.scrollbars.setScrollTop(f.scroller.scrollTop=i),null!=g.selectionStart){(!rf||rf&&9>sf)&&b();var a=0,c=function(){f.selForContextMenu==e.doc.sel&&0==g.selectionStart&&g.selectionEnd>0&&"\u200b"==d.prevInput?Db(e,hg.selectAll)(e):a++<10?f.detectingSelectAll=setTimeout(c,500):f.input.reset()};f.detectingSelectAll=setTimeout(c,200)}}var d=this,e=d.cm,f=e.display,g=d.textarea,h=Tb(e,a),i=f.scroller.scrollTop;if(h&&!wf){var j=e.options.resetSelectionOnContextMenu;j&&-1==e.doc.sel.contains(h)&&Db(e,Ba)(e.doc,oa(h),Ig);var k=g.style.cssText;if(d.wrapper.style.position="absolute",g.style.cssText="position: fixed; width: 30px; height: 30px; top: "+(a.clientY-5)+"px; left: "+(a.clientX-5)+"px; z-index: 1000; background: "+(rf?"rgba(255, 255, 255, .05)":"transparent")+"; outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",tf)var l=window.scrollY;if(f.input.focus(),tf&&window.scrollTo(null,l),f.input.reset(),e.somethingSelected()||(g.value=d.prevInput=" "),d.contextMenuPending=!0,f.selForContextMenu=e.doc.sel,clearTimeout(f.detectingSelectAll),rf&&sf>=9&&b(),Gf){Ag(a);var m=function(){Dg(window,"mouseup",m),setTimeout(c,20)};Bg(window,"mouseup",m)}else setTimeout(c,50)}},readOnlyChanged:function(a){a||this.reset()},setUneditable:He,needsContentAttribute:!1},da.prototype),fa.prototype=Je({init:function(a){function b(a){if(d.somethingSelected())Lf=d.getSelections(),"cut"==a.type&&d.replaceSelection("",null,"cut");else{if(!d.options.lineWiseCopyCut)return;var b=ba(d);Lf=b.text,"cut"==a.type&&d.operation(function(){d.setSelections(b.ranges,0,Ig),d.replaceSelection("",null,"cut")})}if(a.clipboardData&&!Af)a.preventDefault(),a.clipboardData.clearData(),a.clipboardData.setData("text/plain",Lf.join("\n"));else{var c=ea(),e=c.firstChild;d.display.lineSpace.insertBefore(c,d.display.lineSpace.firstChild),e.value=Lf.join("\n");var f=document.activeElement;Og(e),setTimeout(function(){d.display.lineSpace.removeChild(c),f.focus()},50)}}var c=this,d=c.cm,e=c.div=a.lineDiv;ca(e),Bg(e,"paste",function(a){_(a,d)}),Bg(e,"compositionstart",function(a){var b=a.data;if(c.composing={sel:d.doc.sel,data:b,startData:b},b){var e=d.doc.sel.primary(),f=d.getLine(e.head.line),g=f.indexOf(b,Math.max(0,e.head.ch-b.length));g>-1&&g<=e.head.ch&&(c.composing.sel=oa(Jf(e.head.line,g),Jf(e.head.line,g+b.length)))}}),Bg(e,"compositionupdate",function(a){c.composing.data=a.data}),Bg(e,"compositionend",function(a){var b=c.composing;b&&(a.data==b.startData||/\u200b/.test(a.data)||(b.data=a.data),setTimeout(function(){b.handled||c.applyComposition(b),c.composing==b&&(c.composing=null)},50))}),Bg(e,"touchstart",function(){c.forceCompositionEnd()}),Bg(e,"input",function(){c.composing||(Z(d)||!c.pollContent())&&Cb(c.cm,function(){Ib(d)})}),Bg(e,"copy",b),Bg(e,"cut",b)},prepareSelection:function(){var a=Ia(this.cm,!1);return a.focus=this.cm.state.focused,a},showSelection:function(a){a&&this.cm.display.view.length&&(a.focus&&this.showPrimarySelection(),this.showMultipleSelections(a))},showPrimarySelection:function(){var a=window.getSelection(),b=this.cm.doc.sel.primary(),c=ia(this.cm,a.anchorNode,a.anchorOffset),d=ia(this.cm,a.focusNode,a.focusOffset);if(!c||c.bad||!d||d.bad||0!=Kf(X(c,d),b.from())||0!=Kf(W(c,d),b.to())){var e=ga(this.cm,b.from()),f=ga(this.cm,b.to());if(e||f){var g=this.cm.display.view,h=a.rangeCount&&a.getRangeAt(0);if(e){if(!f){var i=g[g.length-1].measure,j=i.maps?i.maps[i.maps.length-1]:i.map;f={node:j[j.length-1],offset:j[j.length-2]-j[j.length-3]}}}else e={node:g[0].measure.map[2],offset:0};try{var k=Pg(e.node,e.offset,f.offset,f.node)}catch(l){}k&&(a.removeAllRanges(),a.addRange(k),h&&null==a.anchorNode?a.addRange(h):of&&this.startGracePeriod()),this.rememberSelection()}}},startGracePeriod:function(){var a=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout(function(){a.gracePeriod=!1,a.selectionChanged()&&a.cm.operation(function(){a.cm.curOp.selectionChanged=!0})},20)},showMultipleSelections:function(a){Qe(this.cm.display.cursorDiv,a.cursors),Qe(this.cm.display.selectionDiv,a.selection)},rememberSelection:function(){var a=window.getSelection();this.lastAnchorNode=a.anchorNode,this.lastAnchorOffset=a.anchorOffset,this.lastFocusNode=a.focusNode,this.lastFocusOffset=a.focusOffset},selectionInEditor:function(){var a=window.getSelection();if(!a.rangeCount)return!1;var b=a.getRangeAt(0).commonAncestorContainer;return Tg(this.div,b)},focus:function(){"nocursor"!=this.cm.options.readOnly&&this.div.focus()},blur:function(){this.div.blur()},getField:function(){return this.div},supportsTouch:function(){return!0},receivedFocus:function(){function a(){b.cm.state.focused&&(b.pollSelection(),b.polling.set(b.cm.options.pollInterval,a))}var b=this;this.selectionInEditor()?this.pollSelection():Cb(this.cm,function(){b.cm.curOp.selectionChanged=!0}),this.polling.set(this.cm.options.pollInterval,a)},selectionChanged:function(){var a=window.getSelection();return a.anchorNode!=this.lastAnchorNode||a.anchorOffset!=this.lastAnchorOffset||a.focusNode!=this.lastFocusNode||a.focusOffset!=this.lastFocusOffset},pollSelection:function(){if(!this.composing&&!this.gracePeriod&&this.selectionChanged()){var a=window.getSelection(),b=this.cm;this.rememberSelection();var c=ia(b,a.anchorNode,a.anchorOffset),d=ia(b,a.focusNode,a.focusOffset);c&&d&&Cb(b,function(){Ba(b.doc,oa(c,d),Ig),(c.bad||d.bad)&&(b.curOp.selectionChanged=!0)})}},pollContent:function(){var a=this.cm,b=a.display,c=a.doc.sel.primary(),d=c.from(),e=c.to();if(d.lineb.viewTo-1)return!1;var f;if(d.line==b.viewFrom||0==(f=Lb(a,d.line)))var g=_d(b.view[0].line),h=b.view[0].node;else var g=_d(b.view[f].line),h=b.view[f-1].node.nextSibling;var i=Lb(a,e.line);if(i==b.view.length-1)var j=b.viewTo-1,k=b.lineDiv.lastChild;else var j=_d(b.view[i+1].line)-1,k=b.view[i+1].node.previousSibling;for(var l=a.doc.splitLines(ka(a,h,k,g,j)),m=Yd(a.doc,Jf(g,0),Jf(j,Xd(a.doc,j).text.length));l.length>1&&m.length>1;)if(Ee(l)==Ee(m))l.pop(),m.pop(),j--;else{if(l[0]!=m[0])break;l.shift(),m.shift(),g++}for(var n=0,o=0,p=l[0],q=m[0],r=Math.min(p.length,q.length);r>n&&p.charCodeAt(n)==q.charCodeAt(n);)++n;for(var s=Ee(l),t=Ee(m),u=Math.min(s.length-(1==l.length?n:0),t.length-(1==m.length?n:0));u>o&&s.charCodeAt(s.length-o-1)==t.charCodeAt(t.length-o-1);)++o;l[l.length-1]=s.slice(0,s.length-o),l[0]=l[0].slice(n);var v=Jf(g,n),w=Jf(j,m.length?Ee(m).length-o:0);return l.length>1||l[0]||Kf(v,w)?(Ec(a.doc,l,v,w,"+input"),!0):void 0},ensurePolled:function(){this.forceCompositionEnd()},reset:function(){this.forceCompositionEnd()},forceCompositionEnd:function(){this.composing&&!this.composing.handled&&(this.applyComposition(this.composing),this.composing.handled=!0,this.div.blur(),this.div.focus())},applyComposition:function(a){Z(this.cm)?Db(this.cm,Ib)(this.cm):a.data&&a.data!=a.startData&&Db(this.cm,$)(this.cm,a.data,0,a.sel)},setUneditable:function(a){a.contentEditable="false"},onKeyPress:function(a){a.preventDefault(),Z(this.cm)||Db(this.cm,$)(this.cm,String.fromCharCode(null==a.charCode?a.keyCode:a.charCode),0)},readOnlyChanged:function(a){this.div.contentEditable=String("nocursor"!=a)},onContextMenu:He,resetPosition:He,needsContentAttribute:!0},fa.prototype),a.inputStyles={textarea:da,contenteditable:fa},la.prototype={primary:function(){return this.ranges[this.primIndex]},equals:function(a){if(a==this)return!0;if(a.primIndex!=this.primIndex||a.ranges.length!=this.ranges.length)return!1;for(var b=0;b=0&&Kf(a,d.to())<=0)return c}return-1}},ma.prototype={from:function(){return X(this.anchor,this.head)},to:function(){return W(this.anchor,this.head)},empty:function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch}};var Mf,Nf,Of,Pf={left:0,right:0,top:0,bottom:0},Qf=null,Rf=0,Sf=0,Tf=0,Uf=null;rf?Uf=-.53:of?Uf=15:vf?Uf=-.7:xf&&(Uf=-1/3);var Vf=function(a){var b=a.wheelDeltaX,c=a.wheelDeltaY;return null==b&&a.detail&&a.axis==a.HORIZONTAL_AXIS&&(b=a.detail),null==c&&a.detail&&a.axis==a.VERTICAL_AXIS?c=a.detail:null==c&&(c=a.wheelDelta),{x:b,y:c}};a.wheelEventPixels=function(a){var b=Vf(a);return b.x*=Uf,b.y*=Uf,b};var Wf=new Ce,Xf=null,Yf=a.changeEnd=function(a){return a.text?Jf(a.from.line+a.text.length-1,Ee(a.text).length+(1==a.text.length?a.from.ch:0)):a.to};a.prototype={constructor:a,focus:function(){window.focus(),this.display.input.focus()},setOption:function(a,b){var c=this.options,d=c[a];(c[a]!=b||"mode"==a)&&(c[a]=b,$f.hasOwnProperty(a)&&Db(this,$f[a])(this,b,d))},getOption:function(a){return this.options[a]},getDoc:function(){return this.doc},addKeyMap:function(a,b){this.state.keyMaps[b?"push":"unshift"](Tc(a))},removeKeyMap:function(a){for(var b=this.state.keyMaps,c=0;cc&&(Mc(this,e.head.line,a,!0),c=e.head.line,d==this.doc.sel.primIndex&&Kc(this));else{var f=e.from(),g=e.to(),h=Math.max(c,f.line);c=Math.min(this.lastLine(),g.line-(g.ch?0:1))+1;for(var i=h;c>i;++i)Mc(this,i,a);var j=this.doc.sel.ranges;0==f.ch&&b.length==j.length&&j[d].from().ch>0&&xa(this.doc,d,new ma(f,j[d].to()),Ig)}}}),getTokenAt:function(a,b){return Ed(this,a,b)},getLineTokens:function(a,b){return Ed(this,Jf(a),b,!0)},getTokenTypeAt:function(a){a=qa(this.doc,a);var b,c=Hd(this,Xd(this.doc,a.line)),d=0,e=(c.length-1)/2,f=a.ch;if(0==f)b=c[2];else for(;;){var g=d+e>>1;if((g?c[2*g-1]:0)>=f)e=g;else{if(!(c[2*g+1]h?b:0==h?null:b.slice(0,h-1)},getModeAt:function(b){var c=this.doc.mode;return c.innerMode?a.innerMode(c,this.getTokenAt(b).state).mode:c},getHelper:function(a,b){return this.getHelpers(a,b)[0]},getHelpers:function(a,b){var c=[];if(!eg.hasOwnProperty(b))return c;var d=eg[b],e=this.getModeAt(a);if("string"==typeof e[b])d[e[b]]&&c.push(d[e[b]]);else if(e[b])for(var f=0;fe&&(a=e,d=!0),c=Xd(this.doc,a)}else c=a;return jb(this,c,{top:0,left:0},b||"page").top+(d?this.doc.height-be(c):0)},defaultTextHeight:function(){return rb(this.display)},defaultCharWidth:function(){return sb(this.display)},setGutterMarker:Eb(function(a,b,c){return Nc(this.doc,a,"gutter",function(a){var d=a.gutterMarkers||(a.gutterMarkers={});return d[b]=c,!c&&Me(d)&&(a.gutterMarkers=null),!0})}),clearGutter:Eb(function(a){var b=this,c=b.doc,d=c.first;c.iter(function(c){c.gutterMarkers&&c.gutterMarkers[a]&&(c.gutterMarkers[a]=null,Jb(b,d,"gutter"),Me(c.gutterMarkers)&&(c.gutterMarkers=null)),++d})}),lineInfo:function(a){if("number"==typeof a){if(!sa(this.doc,a))return null;var b=a;if(a=Xd(this.doc,a),!a)return null}else{var b=_d(a);if(null==b)return null}return{line:b,handle:a,text:a.text,gutterMarkers:a.gutterMarkers,textClass:a.textClass,bgClass:a.bgClass,wrapClass:a.wrapClass,widgets:a.widgets}},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(a,b,c,d,e){var f=this.display;a=mb(this,qa(this.doc,a));var g=a.bottom,h=a.left;if(b.style.position="absolute",b.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(b),f.sizer.appendChild(b),"over"==d)g=a.top;else if("above"==d||"near"==d){var i=Math.max(f.wrapper.clientHeight,this.doc.height),j=Math.max(f.sizer.clientWidth,f.lineSpace.clientWidth);("above"==d||a.bottom+b.offsetHeight>i)&&a.top>b.offsetHeight?g=a.top-b.offsetHeight:a.bottom+b.offsetHeight<=i&&(g=a.bottom),h+b.offsetWidth>j&&(h=j-b.offsetWidth)}b.style.top=g+"px",b.style.left=b.style.right="","right"==e?(h=f.sizer.clientWidth-b.offsetWidth,b.style.right="0px"):("left"==e?h=0:"middle"==e&&(h=(f.sizer.clientWidth-b.offsetWidth)/2),b.style.left=h+"px"),c&&Hc(this,h,g,h+b.offsetWidth,g+b.offsetHeight)},triggerOnKeyDown:Eb(kc),triggerOnKeyPress:Eb(nc),triggerOnKeyUp:mc,execCommand:function(a){return hg.hasOwnProperty(a)?hg[a].call(null,this):void 0},triggerElectric:Eb(function(a){aa(this,a)}),findPosH:function(a,b,c,d){var e=1;0>b&&(e=-1,b=-b);for(var f=0,g=qa(this.doc,a);b>f&&(g=Pc(this.doc,g,e,c,d),!g.hitSide);++f);return g},moveH:Eb(function(a,b){var c=this;c.extendSelectionsBy(function(d){return c.display.shift||c.doc.extend||d.empty()?Pc(c.doc,d.head,a,b,c.options.rtlMoveVisually):0>a?d.from():d.to()},Kg)}),deleteH:Eb(function(a,b){var c=this.doc.sel,d=this.doc;c.somethingSelected()?d.replaceSelection("",null,"+delete"):Oc(this,function(c){var e=Pc(d,c.head,a,b,!1);return 0>a?{from:e,to:c.head}:{from:c.head,to:e}})}),findPosV:function(a,b,c,d){var e=1,f=d;0>b&&(e=-1,b=-b);for(var g=0,h=qa(this.doc,a);b>g;++g){var i=mb(this,h,"div");if(null==f?f=i.left:i.left=f,h=Qc(this,i,e,c),h.hitSide)break}return h},moveV:Eb(function(a,b){var c=this,d=this.doc,e=[],f=!c.display.shift&&!d.extend&&d.sel.somethingSelected();if(d.extendSelectionsBy(function(g){if(f)return 0>a?g.from():g.to();var h=mb(c,g.head,"div");null!=g.goalColumn&&(h.left=g.goalColumn),e.push(h.left);var i=Qc(c,h,a,b);return"page"==b&&g==d.sel.primary()&&Jc(c,null,lb(c,i,"div").top-h.top),i},Kg),e.length)for(var g=0;g0&&h(c.charAt(d-1));)--d;for(;e.5)&&g(this),Eg(this,"refresh",this)}),swapDoc:Eb(function(a){var b=this.doc;return b.cm=null,Wd(this,a),gb(this),this.display.input.reset(),this.scrollTo(a.scrollLeft,a.scrollTop),this.curOp.forceScroll=!0,we(this,"swapDoc",this,b),b}),getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},Be(a);var Zf=a.defaults={},$f=a.optionHandlers={},_f=a.Init={toString:function(){return"CodeMirror.Init"}};Rc("value","",function(a,b){a.setValue(b)},!0),Rc("mode",null,function(a,b){a.doc.modeOption=b,c(a)},!0),Rc("indentUnit",2,c,!0),Rc("indentWithTabs",!1),Rc("smartIndent",!0),Rc("tabSize",4,function(a){d(a),gb(a),Ib(a)},!0),Rc("lineSeparator",null,function(a,b){if(a.doc.lineSep=b,b){var c=[],d=a.doc.first;a.doc.iter(function(a){for(var e=0;;){var f=a.text.indexOf(b,e);if(-1==f)break;e=f+b.length,c.push(Jf(d,f))}d++});for(var e=c.length-1;e>=0;e--)Ec(a.doc,b,c[e],Jf(c[e].line,c[e].ch+b.length))}}),Rc("specialChars",/[\t\u0000-\u0019\u00ad\u200b-\u200f\u2028\u2029\ufeff]/g,function(b,c,d){b.state.specialChars=new RegExp(c.source+(c.test(" ")?"":"| "),"g"),d!=a.Init&&b.refresh()}),Rc("specialCharPlaceholder",Ld,function(a){a.refresh()},!0),Rc("electricChars",!0),Rc("inputStyle",Bf?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),Rc("rtlMoveVisually",!Df),Rc("wholeLineUpdateBefore",!0),Rc("theme","default",function(a){h(a),i(a)},!0),Rc("keyMap","default",function(b,c,d){var e=Tc(c),f=d!=a.Init&&Tc(d);f&&f.detach&&f.detach(b,e),e.attach&&e.attach(b,f||null)}),Rc("extraKeys",null),Rc("lineWrapping",!1,e,!0),Rc("gutters",[],function(a){n(a.options),i(a)},!0),Rc("fixedGutter",!0,function(a,b){a.display.gutters.style.left=b?y(a.display)+"px":"0",a.refresh()},!0),Rc("coverGutterNextToScrollbar",!1,function(a){s(a)},!0),Rc("scrollbarStyle","native",function(a){r(a),s(a),a.display.scrollbars.setScrollTop(a.doc.scrollTop),a.display.scrollbars.setScrollLeft(a.doc.scrollLeft)},!0),Rc("lineNumbers",!1,function(a){n(a.options),i(a)},!0),Rc("firstLineNumber",1,i,!0),Rc("lineNumberFormatter",function(a){return a},i,!0),Rc("showCursorWhenSelecting",!1,Ha,!0),Rc("resetSelectionOnContextMenu",!0),Rc("lineWiseCopyCut",!0),Rc("readOnly",!1,function(a,b){"nocursor"==b?(qc(a),a.display.input.blur(),a.display.disabled=!0):a.display.disabled=!1,a.display.input.readOnlyChanged(b)}),Rc("disableInput",!1,function(a,b){b||a.display.input.reset()},!0),Rc("dragDrop",!0,Qb),Rc("allowDropFileTypes",null),Rc("cursorBlinkRate",530),Rc("cursorScrollMargin",0),Rc("cursorHeight",1,Ha,!0),Rc("singleCursorHeightPerLine",!0,Ha,!0),Rc("workTime",100),Rc("workDelay",100),Rc("flattenSpans",!0,d,!0),Rc("addModeClass",!1,d,!0),Rc("pollInterval",100),Rc("undoDepth",200,function(a,b){a.doc.history.undoDepth=b}),Rc("historyEventDelay",1250),Rc("viewportMargin",10,function(a){a.refresh()},!0),Rc("maxHighlightLength",1e4,d,!0),Rc("moveInputWithCursor",!0,function(a,b){b||a.display.input.resetPosition()}),Rc("tabindex",null,function(a,b){a.display.input.getField().tabIndex=b||""}),Rc("autofocus",null);var ag=a.modes={},bg=a.mimeModes={};a.defineMode=function(b,c){a.defaults.mode||"null"==b||(a.defaults.mode=b),arguments.length>2&&(c.dependencies=Array.prototype.slice.call(arguments,2)),ag[b]=c},a.defineMIME=function(a,b){bg[a]=b},a.resolveMode=function(b){if("string"==typeof b&&bg.hasOwnProperty(b))b=bg[b];else if(b&&"string"==typeof b.name&&bg.hasOwnProperty(b.name)){var c=bg[b.name];"string"==typeof c&&(c={name:c}),b=Ie(c,b),b.name=c.name}else if("string"==typeof b&&/^[\w\-]+\/[\w\-]+\+xml$/.test(b))return a.resolveMode("application/xml");return"string"==typeof b?{name:b}:b||{name:"null"}},a.getMode=function(b,c){var c=a.resolveMode(c),d=ag[c.name];if(!d)return a.getMode(b,"text/plain");var e=d(b,c);if(cg.hasOwnProperty(c.name)){var f=cg[c.name];for(var g in f)f.hasOwnProperty(g)&&(e.hasOwnProperty(g)&&(e["_"+g]=e[g]),e[g]=f[g])}if(e.name=c.name,c.helperType&&(e.helperType=c.helperType),c.modeProps)for(var g in c.modeProps)e[g]=c.modeProps[g];return e},a.defineMode("null",function(){return{token:function(a){a.skipToEnd()}}}),a.defineMIME("text/plain","null");var cg=a.modeExtensions={};a.extendMode=function(a,b){var c=cg.hasOwnProperty(a)?cg[a]:cg[a]={};Je(b,c)},a.defineExtension=function(b,c){a.prototype[b]=c},a.defineDocExtension=function(a,b){vg.prototype[a]=b},a.defineOption=Rc;var dg=[];a.defineInitHook=function(a){dg.push(a)};var eg=a.helpers={};a.registerHelper=function(b,c,d){eg.hasOwnProperty(b)||(eg[b]=a[b]={_global:[]}),eg[b][c]=d},a.registerGlobalHelper=function(b,c,d,e){a.registerHelper(b,c,e),eg[b]._global.push({pred:d,val:e})};var fg=a.copyState=function(a,b){if(b===!0)return b;if(a.copyState)return a.copyState(b);var c={};for(var d in b){var e=b[d];e instanceof Array&&(e=e.concat([])),c[d]=e}return c},gg=a.startState=function(a,b,c){return a.startState?a.startState(b,c):!0};a.innerMode=function(a,b){for(;a.innerMode;){var c=a.innerMode(b);if(!c||c.mode==a)break;b=c.state,a=c.mode}return c||{mode:a,state:b}};var hg=a.commands={selectAll:function(a){a.setSelection(Jf(a.firstLine(),0),Jf(a.lastLine()),Ig)},singleSelection:function(a){a.setSelection(a.getCursor("anchor"),a.getCursor("head"),Ig)},killLine:function(a){Oc(a,function(b){if(b.empty()){var c=Xd(a.doc,b.head.line).text.length;return b.head.ch==c&&b.head.line0)e=new Jf(e.line,e.ch+1),a.replaceRange(f.charAt(e.ch-1)+f.charAt(e.ch-2),Jf(e.line,e.ch-2),e,"+transpose");else if(e.line>a.doc.first){var g=Xd(a.doc,e.line-1).text;g&&a.replaceRange(f.charAt(0)+a.doc.lineSeparator()+g.charAt(g.length-1),Jf(e.line-1,g.length-1),Jf(e.line,1),"+transpose")}c.push(new ma(e,e))}a.setSelections(c)})},newlineAndIndent:function(a){Cb(a,function(){for(var b=a.listSelections().length,c=0;b>c;c++){var d=a.listSelections()[c];a.replaceRange(a.doc.lineSeparator(),d.anchor,d.head,"+input"),a.indentLine(d.from().line+1,null,!0)}Kc(a)})},toggleOverwrite:function(a){a.toggleOverwrite()}},ig=a.keyMap={};ig.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},ig.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},ig.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars"},ig.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight", +"Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},ig["default"]=Cf?ig.macDefault:ig.pcDefault,a.normalizeKeyMap=function(a){var b={};for(var c in a)if(a.hasOwnProperty(c)){var d=a[c];if(/^(name|fallthrough|(de|at)tach)$/.test(c))continue;if("..."==d){delete a[c];continue}for(var e=Ge(c.split(" "),Sc),f=0;f=this.string.length},sol:function(){return this.pos==this.lineStart},peek:function(){return this.string.charAt(this.pos)||void 0},next:function(){return this.posb},eatSpace:function(){for(var a=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>a},skipToEnd:function(){this.pos=this.string.length},skipTo:function(a){var b=this.string.indexOf(a,this.pos);return b>-1?(this.pos=b,!0):void 0},backUp:function(a){this.pos-=a},column:function(){return this.lastColumnPos0?null:(d&&b!==!1&&(this.pos+=d[0].length),d)}var e=function(a){return c?a.toLowerCase():a},f=this.string.substr(this.pos,a.length);return e(f)==e(a)?(b!==!1&&(this.pos+=a.length),!0):void 0},current:function(){return this.string.slice(this.start,this.pos)},hideFirstChars:function(a,b){this.lineStart+=a;try{return b()}finally{this.lineStart-=a}}};var ng=0,og=a.TextMarker=function(a,b){this.lines=[],this.type=b,this.doc=a,this.id=++ng};Be(og),og.prototype.clear=function(){if(!this.explicitlyCleared){var a=this.doc.cm,b=a&&!a.curOp;if(b&&tb(a),Ae(this,"clear")){var c=this.find();c&&we(this,"clear",c.from,c.to)}for(var d=null,e=null,f=0;fa.display.maxLineLength&&(a.display.maxLine=i,a.display.maxLineLength=j,a.display.maxLineChanged=!0)}null!=d&&a&&this.collapsed&&Ib(a,d,e+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,a&&Ea(a.doc)),a&&we(a,"markerCleared",a,this),b&&vb(a),this.parent&&this.parent.clear()}},og.prototype.find=function(a,b){null==a&&"bookmark"==this.type&&(a=1);for(var c,d,e=0;ec;++c){var e=this.lines[c];this.height-=e.height,Ad(e),we(e,"delete")}this.lines.splice(a,b)},collapse:function(a){a.push.apply(a,this.lines)},insertInner:function(a,b,c){this.height+=c,this.lines=this.lines.slice(0,a).concat(b).concat(this.lines.slice(a));for(var d=0;da;++a)if(c(this.lines[a]))return!0}},Ud.prototype={chunkSize:function(){return this.size},removeInner:function(a,b){this.size-=b;for(var c=0;ca){var f=Math.min(b,e-a),g=d.height;if(d.removeInner(a,f),this.height-=g-d.height,e==f&&(this.children.splice(c--,1),d.parent=null),0==(b-=f))break;a=0}else a-=e}if(this.size-b<25&&(this.children.length>1||!(this.children[0]instanceof Td))){var h=[];this.collapse(h),this.children=[new Td(h)],this.children[0].parent=this}},collapse:function(a){for(var b=0;b=a){if(e.insertInner(a,b,c),e.lines&&e.lines.length>50){for(;e.lines.length>50;){var g=e.lines.splice(e.lines.length-25,25),h=new Td(g);e.height-=h.height,this.children.splice(d+1,0,h),h.parent=this}this.maybeSpill()}break}a-=f}},maybeSpill:function(){if(!(this.children.length<=10)){var a=this;do{var b=a.children.splice(a.children.length-5,5),c=new Ud(b);if(a.parent){a.size-=c.size,a.height-=c.height;var d=Fe(a.parent.children,a);a.parent.children.splice(d+1,0,c)}else{var e=new Ud(a.children);e.parent=a,a.children=[e,c],a=e}c.parent=a.parent}while(a.children.length>10);a.parent.maybeSpill()}},iterN:function(a,b,c){for(var d=0;da){var g=Math.min(b,f-a);if(e.iterN(a,g,c))return!0;if(0==(b-=g))break;a=0}else a-=f}}};var ug=0,vg=a.Doc=function(a,b,c,d){if(!(this instanceof vg))return new vg(a,b,c,d);null==c&&(c=0),Ud.call(this,[new Td([new rg("",null)])]),this.first=c,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.frontier=c;var e=Jf(c,0);this.sel=oa(e),this.history=new de(null),this.id=++ug,this.modeOption=b,this.lineSep=d,"string"==typeof a&&(a=this.splitLines(a)),Sd(this,{from:e,to:e,text:a}),Ba(this,oa(e),Ig)};vg.prototype=Ie(Ud.prototype,{constructor:vg,iter:function(a,b,c){c?this.iterN(a-this.first,b-a,c):this.iterN(this.first,this.first+this.size,a)},insert:function(a,b){for(var c=0,d=0;d=0;f--)yc(this,d[f]);h?Aa(this,h):this.cm&&Kc(this.cm)}),undo:Fb(function(){Ac(this,"undo")}),redo:Fb(function(){Ac(this,"redo")}),undoSelection:Fb(function(){Ac(this,"undo",!0)}),redoSelection:Fb(function(){Ac(this,"redo",!0)}),setExtending:function(a){this.extend=a},getExtending:function(){return this.extend},historySize:function(){for(var a=this.history,b=0,c=0,d=0;d=a.ch)&&b.push(e.marker.parent||e.marker)}return b},findMarks:function(a,b,c){a=qa(this,a),b=qa(this,b);var d=[],e=a.line;return this.iter(a.line,b.line+1,function(f){var g=f.markedSpans;if(g)for(var h=0;hi.to||null==i.from&&e!=a.line||e==b.line&&i.from>b.ch||c&&!c(i.marker)||d.push(i.marker.parent||i.marker)}++e}),d},getAllMarks:function(){var a=[];return this.iter(function(b){var c=b.markedSpans;if(c)for(var d=0;da?(b=a,!0):(a-=e,void++c)}),qa(this,Jf(c,b))},indexFromPos:function(a){a=qa(this,a);var b=a.ch;return a.lineb&&(b=a.from),null!=a.to&&a.toh||h>=b)return g+(b-f);g+=h-f,g+=c-g%c,f=h+1}},Mg=a.findColumn=function(a,b,c){for(var d=0,e=0;;){var f=a.indexOf(" ",d);-1==f&&(f=a.length);var g=f-d;if(f==a.length||e+g>=b)return d+Math.min(g,b-e);if(e+=f-d,e+=c-e%c,d=f+1,e>=b)return d}},Ng=[""],Og=function(a){a.select()};Af?Og=function(a){a.selectionStart=0,a.selectionEnd=a.value.length}:rf&&(Og=function(a){try{a.select()}catch(b){}});var Pg,Qg=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,Rg=a.isWordChar=function(a){return/\w/.test(a)||a>"\x80"&&(a.toUpperCase()!=a.toLowerCase()||Qg.test(a))},Sg=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;Pg=document.createRange?function(a,b,c,d){var e=document.createRange();return e.setEnd(d||a,c),e.setStart(a,b),e}:function(a,b,c){var d=document.body.createTextRange();try{d.moveToElementText(a.parentNode)}catch(e){return d}return d.collapse(!0),d.moveEnd("character",c),d.moveStart("character",b),d};var Tg=a.contains=function(a,b){if(3==b.nodeType&&(b=b.parentNode),a.contains)return a.contains(b);do if(11==b.nodeType&&(b=b.host),b==a)return!0;while(b=b.parentNode)};rf&&11>sf&&(Re=function(){try{return document.activeElement}catch(a){return document.body}});var Ug,Vg,Wg=a.rmClass=function(a,b){var c=a.className,d=Se(b).exec(c);if(d){var e=c.slice(d.index+d[0].length);a.className=c.slice(0,d.index)+(e?d[1]+e:"")}},Xg=a.addClass=function(a,b){var c=a.className;Se(b).test(c)||(a.className+=(c?" ":"")+b)},Yg=!1,Zg=function(){if(rf&&9>sf)return!1;var a=Oe("div");return"draggable"in a||"dragDrop"in a}(),$g=a.splitLines=3!="\n\nb".split(/\n/).length?function(a){for(var b=0,c=[],d=a.length;d>=b;){var e=a.indexOf("\n",b);-1==e&&(e=a.length);var f=a.slice(b,"\r"==a.charAt(e-1)?e-1:e),g=f.indexOf("\r");-1!=g?(c.push(f.slice(0,g)),b+=g+1):(c.push(f),b=e+1)}return c}:function(a){return a.split(/\r\n?|\n/)},_g=window.getSelection?function(a){try{return a.selectionStart!=a.selectionEnd}catch(b){return!1}}:function(a){try{var b=a.ownerDocument.selection.createRange()}catch(c){}return b&&b.parentElement()==a?0!=b.compareEndPoints("StartToEnd",b):!1},ah=function(){var a=Oe("div");return"oncopy"in a?!0:(a.setAttribute("oncopy","return;"),"function"==typeof a.oncopy)}(),bh=null,ch=a.keyNames={3:"Enter",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",127:"Delete",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"};!function(){for(var a=0;10>a;a++)ch[a+48]=ch[a+96]=String(a);for(var a=65;90>=a;a++)ch[a]=String.fromCharCode(a);for(var a=1;12>=a;a++)ch[a+111]=ch[a+63235]="F"+a}();var dh,eh=function(){function a(a){return 247>=a?c.charAt(a):a>=1424&&1524>=a?"R":a>=1536&&1773>=a?d.charAt(a-1536):a>=1774&&2220>=a?"r":a>=8192&&8203>=a?"w":8204==a?"b":"L"}function b(a,b,c){this.level=a,this.from=b,this.to=c}var c="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",d="rrrrrrrrrrrr,rNNmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmrrrrrrrnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmNmmmm",e=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,f=/[stwN]/,g=/[LRr]/,h=/[Lb1n]/,i=/[1n]/,j="L";return function(c){if(!e.test(c))return!1;for(var d,k=c.length,l=[],m=0;k>m;++m)l.push(d=a(c.charCodeAt(m)));for(var m=0,n=j;k>m;++m){var d=l[m];"m"==d?l[m]=n:n=d}for(var m=0,o=j;k>m;++m){var d=l[m];"1"==d&&"r"==o?l[m]="n":g.test(d)&&(o=d,"r"==d&&(l[m]="R"))}for(var m=1,n=l[0];k-1>m;++m){var d=l[m];"+"==d&&"1"==n&&"1"==l[m+1]?l[m]="1":","!=d||n!=l[m+1]||"1"!=n&&"n"!=n||(l[m]=n),n=d}for(var m=0;k>m;++m){var d=l[m];if(","==d)l[m]="N";else if("%"==d){for(var p=m+1;k>p&&"%"==l[p];++p);for(var q=m&&"!"==l[m-1]||k>p&&"1"==l[p]?"1":"N",r=m;p>r;++r)l[r]=q;m=p-1}}for(var m=0,o=j;k>m;++m){var d=l[m];"L"==o&&"1"==d?l[m]="L":g.test(d)&&(o=d)}for(var m=0;k>m;++m)if(f.test(l[m])){for(var p=m+1;k>p&&f.test(l[p]);++p);for(var s="L"==(m?l[m-1]:j),t="L"==(k>p?l[p]:j),q=s||t?"L":"R",r=m;p>r;++r)l[r]=q;m=p-1}for(var u,v=[],m=0;k>m;)if(h.test(l[m])){var w=m;for(++m;k>m&&h.test(l[m]);++m);v.push(new b(0,w,m))}else{var x=m,y=v.length;for(++m;k>m&&"L"!=l[m];++m);for(var r=x;m>r;)if(i.test(l[r])){r>x&&v.splice(y,0,new b(1,x,r));var z=r;for(++r;m>r&&i.test(l[r]);++r);v.splice(y,0,new b(2,z,r)),x=r}else++r;m>x&&v.splice(y,0,new b(1,x,m))}return 1==v[0].level&&(u=c.match(/^\s+/))&&(v[0].from=u[0].length,v.unshift(new b(0,0,u[0].length))),1==Ee(v).level&&(u=c.match(/\s+$/))&&(Ee(v).to-=u[0].length,v.push(new b(0,k-u[0].length,k))),2==v[0].level&&v.unshift(new b(1,v[0].to,v[0].to)),v[0].level!=Ee(v).level&&v.push(new b(v[0].level,k,k)),v}}();return a.version="5.8.1",a}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)}(function(a){"use strict";function b(a){for(var b={},c=0;c*\/]/.test(c)?d(null,"select-op"):"."==c&&a.match(/^-?[_a-z][_a-z0-9-]*/i)?d("qualifier","qualifier"):/[:;{}\[\]\(\)]/.test(c)?d(null,c):"u"==c&&a.match(/rl(-prefix)?\(/)||"d"==c&&a.match("omain(")||"r"==c&&a.match("egexp(")?(a.backUp(1),b.tokenize=g,d("property","word")):/[\w\\\-]/.test(c)?(a.eatWhile(/[\w\\\-]/),d("property","word")):d(null,null):/[\d.]/.test(a.peek())?(a.eatWhile(/[\w.%]/),d("number","unit")):a.match(/^-[\w\\\-]+/)?(a.eatWhile(/[\w\\\-]/),a.match(/^\s*:/,!1)?d("variable-2","variable-definition"):d("variable-2","variable")):a.match(/^\w+-/)?d("meta","meta"):void 0}function f(a){return function(b,c){for(var e,f=!1;null!=(e=b.next());){if(e==a&&!f){")"==a&&b.backUp(1);break}f=!f&&"\\"==e}return(e==a||!f&&")"!=a)&&(c.tokenize=null),d("string","string")}}function g(a,b){return a.next(),a.match(/\s*[\"\')]/,!1)?b.tokenize=null:b.tokenize=f(")"),d(null,"(")}function h(a,b,c){this.type=a,this.indent=b,this.prev=c}function i(a,b,c,d){return a.context=new h(c,b.indentation()+(d===!1?0:q),a.context),c}function j(a){return a.context.prev&&(a.context=a.context.prev),a.context.type}function k(a,b,c){return E[c.context.type](a,b,c)}function l(a,b,c,d){for(var e=d||1;e>0;e--)c.context=c.context.prev;return k(a,b,c)}function m(a){var b=a.current().toLowerCase();p=B.hasOwnProperty(b)?"atom":A.hasOwnProperty(b)?"keyword":"variable"}var n=c;c.propertyKeywords||(c=a.resolveMode("text/css")),c.inline=n.inline;var o,p,q=b.indentUnit,r=c.tokenHooks,s=c.documentTypes||{},t=c.mediaTypes||{},u=c.mediaFeatures||{},v=c.mediaValueKeywords||{},w=c.propertyKeywords||{},x=c.nonStandardPropertyKeywords||{},y=c.fontProperties||{},z=c.counterDescriptors||{},A=c.colorKeywords||{},B=c.valueKeywords||{},C=c.allowNested,D=c.supportsAtComponent===!0,E={};return E.top=function(a,b,c){if("{"==a)return i(c,b,"block");if("}"==a&&c.context.prev)return j(c);if(D&&/@component/.test(a))return i(c,b,"atComponentBlock");if(/^@(-moz-)?document$/.test(a))return i(c,b,"documentTypes");if(/^@(media|supports|(-moz-)?document|import)$/.test(a))return i(c,b,"atBlock");if(/^@(font-face|counter-style)/.test(a))return c.stateArg=a,"restricted_atBlock_before";if(/^@(-(moz|ms|o|webkit)-)?keyframes$/.test(a))return"keyframes";if(a&&"@"==a.charAt(0))return i(c,b,"at");if("hash"==a)p="builtin";else if("word"==a)p="tag";else{if("variable-definition"==a)return"maybeprop";if("interpolation"==a)return i(c,b,"interpolation");if(":"==a)return"pseudo";if(C&&"("==a)return i(c,b,"parens")}return c.context.type},E.block=function(a,b,c){if("word"==a){var d=b.current().toLowerCase();return w.hasOwnProperty(d)?(p="property","maybeprop"):x.hasOwnProperty(d)?(p="string-2","maybeprop"):C?(p=b.match(/^\s*:(?:\s|$)/,!1)?"property":"tag","block"):(p+=" error","maybeprop")}return"meta"==a?"block":C||"hash"!=a&&"qualifier"!=a?E.top(a,b,c):(p="error","block")},E.maybeprop=function(a,b,c){return":"==a?i(c,b,"prop"):k(a,b,c)},E.prop=function(a,b,c){if(";"==a)return j(c);if("{"==a&&C)return i(c,b,"propBlock");if("}"==a||"{"==a)return l(a,b,c);if("("==a)return i(c,b,"parens");if("hash"!=a||/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/.test(b.current())){if("word"==a)m(b);else if("interpolation"==a)return i(c,b,"interpolation")}else p+=" error";return"prop"},E.propBlock=function(a,b,c){return"}"==a?j(c):"word"==a?(p="property","maybeprop"):c.context.type},E.parens=function(a,b,c){return"{"==a||"}"==a?l(a,b,c):")"==a?j(c):"("==a?i(c,b,"parens"):"interpolation"==a?i(c,b,"interpolation"):("word"==a&&m(b),"parens")},E.pseudo=function(a,b,c){return"word"==a?(p="variable-3",c.context.type):k(a,b,c)},E.documentTypes=function(a,b,c){return"word"==a&&s.hasOwnProperty(b.current())?(p="tag",c.context.type):E.atBlock(a,b,c)},E.atBlock=function(a,b,c){if("("==a)return i(c,b,"atBlock_parens");if("}"==a||";"==a)return l(a,b,c);if("{"==a)return j(c)&&i(c,b,C?"block":"top");if("interpolation"==a)return i(c,b,"interpolation");if("word"==a){var d=b.current().toLowerCase();p="only"==d||"not"==d||"and"==d||"or"==d?"keyword":t.hasOwnProperty(d)?"attribute":u.hasOwnProperty(d)?"property":v.hasOwnProperty(d)?"keyword":w.hasOwnProperty(d)?"property":x.hasOwnProperty(d)?"string-2":B.hasOwnProperty(d)?"atom":A.hasOwnProperty(d)?"keyword":"error"}return c.context.type},E.atComponentBlock=function(a,b,c){return"}"==a?l(a,b,c):"{"==a?j(c)&&i(c,b,C?"block":"top",!1):("word"==a&&(p="error"),c.context.type)},E.atBlock_parens=function(a,b,c){return")"==a?j(c):"{"==a||"}"==a?l(a,b,c,2):E.atBlock(a,b,c)},E.restricted_atBlock_before=function(a,b,c){return"{"==a?i(c,b,"restricted_atBlock"):"word"==a&&"@counter-style"==c.stateArg?(p="variable","restricted_atBlock_before"):k(a,b,c)},E.restricted_atBlock=function(a,b,c){return"}"==a?(c.stateArg=null,j(c)):"word"==a?(p="@font-face"==c.stateArg&&!y.hasOwnProperty(b.current().toLowerCase())||"@counter-style"==c.stateArg&&!z.hasOwnProperty(b.current().toLowerCase())?"error":"property","maybeprop"):"restricted_atBlock"},E.keyframes=function(a,b,c){return"word"==a?(p="variable","keyframes"):"{"==a?i(c,b,"top"):k(a,b,c)},E.at=function(a,b,c){return";"==a?j(c):"{"==a||"}"==a?l(a,b,c):("word"==a?p="tag":"hash"==a&&(p="builtin"),"at")},E.interpolation=function(a,b,c){return"}"==a?j(c):"{"==a||";"==a?l(a,b,c):("word"==a?p="variable":"variable"!=a&&"("!=a&&")"!=a&&(p="error"), +"interpolation")},{startState:function(a){return{tokenize:null,state:c.inline?"block":"top",stateArg:null,context:new h(c.inline?"block":"top",a||0,null)}},token:function(a,b){if(!b.tokenize&&a.eatSpace())return null;var c=(b.tokenize||e)(a,b);return c&&"object"==typeof c&&(o=c[1],c=c[0]),p=c,b.state=E[b.state](o,a,b),p},indent:function(a,b){var c=a.context,d=b&&b.charAt(0),e=c.indent;return"prop"!=c.type||"}"!=d&&")"!=d||(c=c.prev),c.prev&&("}"!=d||"block"!=c.type&&"top"!=c.type&&"interpolation"!=c.type&&"restricted_atBlock"!=c.type?(")"==d&&("parens"==c.type||"atBlock_parens"==c.type)||"{"==d&&("at"==c.type||"atBlock"==c.type))&&(e=Math.max(0,c.indent-q),c=c.prev):(c=c.prev,e=c.indent)),e},electricChars:"}",blockCommentStart:"/*",blockCommentEnd:"*/",fold:"brace"}});var d=["domain","regexp","url","url-prefix"],e=b(d),f=["all","aural","braille","handheld","print","projection","screen","tty","tv","embossed"],g=b(f),h=["width","min-width","max-width","height","min-height","max-height","device-width","min-device-width","max-device-width","device-height","min-device-height","max-device-height","aspect-ratio","min-aspect-ratio","max-aspect-ratio","device-aspect-ratio","min-device-aspect-ratio","max-device-aspect-ratio","color","min-color","max-color","color-index","min-color-index","max-color-index","monochrome","min-monochrome","max-monochrome","resolution","min-resolution","max-resolution","scan","grid","orientation","device-pixel-ratio","min-device-pixel-ratio","max-device-pixel-ratio","pointer","any-pointer","hover","any-hover"],i=b(h),j=["landscape","portrait","none","coarse","fine","on-demand","hover","interlace","progressive"],k=b(j),l=["align-content","align-items","align-self","alignment-adjust","alignment-baseline","anchor-point","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","appearance","azimuth","backface-visibility","background","background-attachment","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","baseline-shift","binding","bleed","bookmark-label","bookmark-level","bookmark-state","bookmark-target","border","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","clear","clip","color","color-profile","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","content","counter-increment","counter-reset","crop","cue","cue-after","cue-before","cursor","direction","display","dominant-baseline","drop-initial-after-adjust","drop-initial-after-align","drop-initial-before-adjust","drop-initial-before-align","drop-initial-size","drop-initial-value","elevation","empty-cells","fit","fit-position","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","float-offset","flow-from","flow-into","font","font-feature-settings","font-family","font-kerning","font-language-override","font-size","font-size-adjust","font-stretch","font-style","font-synthesis","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-weight","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-position","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","inline-box-align","justify-content","left","letter-spacing","line-break","line-height","line-stacking","line-stacking-ruby","line-stacking-shift","line-stacking-strategy","list-style","list-style-image","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","marker-offset","marks","marquee-direction","marquee-loop","marquee-play-count","marquee-speed","marquee-style","max-height","max-width","min-height","min-width","move-to","nav-down","nav-index","nav-left","nav-right","nav-up","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-style","overflow-wrap","overflow-x","overflow-y","padding","padding-bottom","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","page-policy","pause","pause-after","pause-before","perspective","perspective-origin","pitch","pitch-range","play-during","position","presentation-level","punctuation-trim","quotes","region-break-after","region-break-before","region-break-inside","region-fragment","rendering-intent","resize","rest","rest-after","rest-before","richness","right","rotation","rotation-point","ruby-align","ruby-overhang","ruby-position","ruby-span","shape-image-threshold","shape-inside","shape-margin","shape-outside","size","speak","speak-as","speak-header","speak-numeral","speak-punctuation","speech-rate","stress","string-set","tab-size","table-layout","target","target-name","target-new","target-position","text-align","text-align-last","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-height","text-indent","text-justify","text-outline","text-overflow","text-shadow","text-size-adjust","text-space-collapse","text-transform","text-underline-position","text-wrap","top","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","volume","white-space","widows","width","word-break","word-spacing","word-wrap","z-index","clip-path","clip-rule","mask","enable-background","filter","flood-color","flood-opacity","lighting-color","stop-color","stop-opacity","pointer-events","color-interpolation","color-interpolation-filters","color-rendering","fill","fill-opacity","fill-rule","image-rendering","marker","marker-end","marker-mid","marker-start","shape-rendering","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-rendering","baseline-shift","dominant-baseline","glyph-orientation-horizontal","glyph-orientation-vertical","text-anchor","writing-mode"],m=b(l),n=["scrollbar-arrow-color","scrollbar-base-color","scrollbar-dark-shadow-color","scrollbar-face-color","scrollbar-highlight-color","scrollbar-shadow-color","scrollbar-3d-light-color","scrollbar-track-color","shape-inside","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","zoom"],o=b(n),p=["font-family","src","unicode-range","font-variant","font-feature-settings","font-stretch","font-weight","font-style"],q=b(p),r=["additive-symbols","fallback","negative","pad","prefix","range","speak-as","suffix","symbols","system"],s=b(r),t=["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"],u=b(t),v=["above","absolute","activeborder","additive","activecaption","afar","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","amharic","amharic-abegede","antialiased","appworkspace","arabic-indic","armenian","asterisks","attr","auto","avoid","avoid-column","avoid-page","avoid-region","background","backwards","baseline","below","bidi-override","binary","bengali","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","cambodian","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","cjk-earthly-branch","cjk-heavenly-stem","cjk-ideographic","clear","clip","close-quote","col-resize","collapse","column","column-reverse","compact","condensed","contain","content","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","dashed","decimal","decimal-leading-zero","default","default-button","destination-atop","destination-in","destination-out","destination-over","devanagari","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic","ethiopic-abegede","ethiopic-abegede-am-et","ethiopic-abegede-gez","ethiopic-abegede-ti-er","ethiopic-abegede-ti-et","ethiopic-halehame-aa-er","ethiopic-halehame-aa-et","ethiopic-halehame-am-et","ethiopic-halehame-gez","ethiopic-halehame-om-et","ethiopic-halehame-sid-et","ethiopic-halehame-so-et","ethiopic-halehame-ti-er","ethiopic-halehame-ti-et","ethiopic-halehame-tig","ethiopic-numeric","ew-resize","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","georgian","graytext","groove","gujarati","gurmukhi","hand","hangul","hangul-consonant","hebrew","help","hidden","hide","higher","highlight","highlighttext","hiragana","hiragana-iroha","horizontal","hsl","hsla","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-table","inset","inside","intrinsic","invert","italic","japanese-formal","japanese-informal","justify","kannada","katakana","katakana-iroha","keep-all","khmer","korean-hangul-formal","korean-hanja-formal","korean-hanja-informal","landscape","lao","large","larger","left","level","lighter","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-alpha","lower-armenian","lower-greek","lower-hexadecimal","lower-latin","lower-norwegian","lower-roman","lowercase","ltr","malayalam","match","matrix","matrix3d","media-controls-background","media-current-time-display","media-fullscreen-button","media-mute-button","media-play-button","media-return-to-realtime-button","media-rewind-button","media-seek-back-button","media-seek-forward-button","media-slider","media-sliderthumb","media-time-remaining-display","media-volume-slider","media-volume-slider-container","media-volume-sliderthumb","medium","menu","menulist","menulist-button","menulist-text","menulist-textfield","menutext","message-box","middle","min-intrinsic","mix","mongolian","monospace","move","multiple","myanmar","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","octal","open-quote","optimizeLegibility","optimizeSpeed","oriya","oromo","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","persian","perspective","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","scale","scale3d","scaleX","scaleY","scaleZ","scroll","scrollbar","se-resize","searchfield","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","semi-condensed","semi-expanded","separate","serif","show","sidama","simp-chinese-formal","simp-chinese-informal","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","solid","somali","source-atop","source-in","source-out","source-over","space","space-around","space-between","spell-out","square","square-button","start","static","status-bar","stretch","stroke","sub","subpixel-antialiased","super","sw-resize","symbolic","symbols","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","tamil","telugu","text","text-bottom","text-top","textarea","textfield","thai","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","tibetan","tigre","tigrinya-er","tigrinya-er-abegede","tigrinya-et","tigrinya-et-abegede","to","top","trad-chinese-formal","trad-chinese-informal","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","up","upper-alpha","upper-armenian","upper-greek","upper-hexadecimal","upper-latin","upper-norwegian","upper-roman","uppercase","urdu","url","var","vertical","vertical-text","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"],w=b(v),x=d.concat(f).concat(h).concat(j).concat(l).concat(n).concat(t).concat(v);a.registerHelper("hintWords","css",x),a.defineMIME("text/css",{documentTypes:e,mediaTypes:g,mediaFeatures:i,mediaValueKeywords:k,propertyKeywords:m,nonStandardPropertyKeywords:o,fontProperties:q,counterDescriptors:s,colorKeywords:u,valueKeywords:w,tokenHooks:{"/":function(a,b){return a.eat("*")?(b.tokenize=c,c(a,b)):!1}},name:"css"}),a.defineMIME("text/x-scss",{mediaTypes:g,mediaFeatures:i,mediaValueKeywords:k,propertyKeywords:m,nonStandardPropertyKeywords:o,colorKeywords:u,valueKeywords:w,fontProperties:q,allowNested:!0,tokenHooks:{"/":function(a,b){return a.eat("/")?(a.skipToEnd(),["comment","comment"]):a.eat("*")?(b.tokenize=c,c(a,b)):["operator","operator"]},":":function(a){return a.match(/\s*\{/)?[null,"{"]:!1},$:function(a){return a.match(/^[\w-]+/),a.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"]},"#":function(a){return a.eat("{")?[null,"interpolation"]:!1}},name:"css",helperType:"scss"}),a.defineMIME("text/x-less",{mediaTypes:g,mediaFeatures:i,mediaValueKeywords:k,propertyKeywords:m,nonStandardPropertyKeywords:o,colorKeywords:u,valueKeywords:w,fontProperties:q,allowNested:!0,tokenHooks:{"/":function(a,b){return a.eat("/")?(a.skipToEnd(),["comment","comment"]):a.eat("*")?(b.tokenize=c,c(a,b)):["operator","operator"]},"@":function(a){return a.eat("{")?[null,"interpolation"]:a.match(/^(charset|document|font-face|import|(-(moz|ms|o|webkit)-)?keyframes|media|namespace|page|supports)\b/,!1)?!1:(a.eatWhile(/[\w\\\-]/),a.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"])},"&":function(){return["atom","atom"]}},name:"css",helperType:"less"}),a.defineMIME("text/x-gss",{documentTypes:e,mediaTypes:g,mediaFeatures:i,propertyKeywords:m,nonStandardPropertyKeywords:o,fontProperties:q,counterDescriptors:s,colorKeywords:u,valueKeywords:w,supportsAtComponent:!0,tokenHooks:{"/":function(a,b){return a.eat("*")?(b.tokenize=c,c(a,b)):!1}},name:"css",helperType:"gss"})}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror"),require("../../mode/css/css")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../../mode/css/css"],a):a(CodeMirror)}(function(a){"use strict";var b={link:1,visited:1,active:1,hover:1,focus:1,"first-letter":1,"first-line":1,"first-child":1,before:1,after:1,lang:1};a.registerHelper("hint","css",function(c){function d(a){for(var b in a)j&&0!=b.lastIndexOf(j,0)||l.push(b)}var e=c.getCursor(),f=c.getTokenAt(e),g=a.innerMode(c.getMode(),f.state);if("css"==g.mode.name){if("keyword"==f.type&&0=="!important".indexOf(f.string))return{list:["!important"],from:a.Pos(e.line,f.start),to:a.Pos(e.line,f.end)};var h=f.start,i=e.ch,j=f.string.slice(0,i-h);/[^\w$_-]/.test(j)&&(j="",h=i=e.ch);var k=a.resolveMode("text/css"),l=[],m=g.state.state;return"pseudo"==m||"variable-3"==f.type?d(b):"block"==m||"maybeprop"==m?d(k.propertyKeywords):"prop"==m||"parens"==m||"at"==m||"params"==m?(d(k.valueKeywords),d(k.colorKeywords)):("media"==m||"media_parens"==m)&&(d(k.mediaTypes),d(k.mediaFeatures)),l.length?{list:l,from:a.Pos(e.line,h),to:a.Pos(e.line,i)}:void 0}})}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror"),require("./searchcursor"),require("../dialog/dialog")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","./searchcursor","../dialog/dialog"],a):a(CodeMirror)}(function(a){"use strict";function b(a,b){return"string"==typeof a?a=new RegExp(a.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),b?"gi":"g"):a.global||(a=new RegExp(a.source,a.ignoreCase?"gi":"g")),{token:function(b){a.lastIndex=b.pos;var c=a.exec(b.string);return c&&c.index==b.pos?(b.pos+=c[0].length,"searching"):void(c?b.pos=c.index:b.skipToEnd())}}}function c(){this.posFrom=this.posTo=this.lastQuery=this.query=null,this.overlay=null}function d(a){return a.state.search||(a.state.search=new c)}function e(a){return"string"==typeof a&&a==a.toLowerCase()}function f(a,b,c){return a.getSearchCursor(b,c,e(b))}function g(a,b,c,d){a.openDialog(b,d,{value:c,selectValueOnOpen:!0,closeOnEnter:!1,onClose:function(){o(a)}})}function h(a,b,c,d,e){a.openDialog?a.openDialog(b,e,{value:d,selectValueOnOpen:!0}):e(prompt(c,d))}function i(a,b,c,d){a.openConfirm?a.openConfirm(b,d):confirm(c)&&d[0]()}function j(a){return a.replace(/\\(.)/g,function(a,b){return"n"==b?"\n":"r"==b?"\r":b})}function k(a){var b=a.match(/^\/(.*)\/([a-z]*)$/);if(b)try{a=new RegExp(b[1],-1==b[2].indexOf("i")?"":"i")}catch(c){}else a=j(a);return("string"==typeof a?""==a:a.test(""))&&(a=/x^/),a}function l(a,c,d){c.queryText=d,c.query=k(d),a.removeOverlay(c.overlay,e(c.query)),c.overlay=b(c.query,e(c.query)),a.addOverlay(c.overlay),a.showMatchesOnScrollbar&&(c.annotate&&(c.annotate.clear(),c.annotate=null),c.annotate=a.showMatchesOnScrollbar(c.query,e(c.query)))}function m(b,c,e){var f=d(b);if(f.query)return n(b,c);var i=b.getSelection()||f.lastQuery;if(e&&b.openDialog){var j=null;g(b,r,i,function(c,d){a.e_stop(d),c&&(c!=f.queryText&&l(b,f,c),j&&(j.style.opacity=1),n(b,d.shiftKey,function(a,c){var d;c.line<3&&document.querySelector&&(d=b.display.wrapper.querySelector(".CodeMirror-dialog"))&&d.getBoundingClientRect().bottom-4>b.cursorCoords(c,"window").top&&((j=d).style.opacity=.4)}))})}else h(b,r,"Search for:",i,function(a){a&&!f.query&&b.operation(function(){l(b,f,a),f.posFrom=f.posTo=b.getCursor(),n(b,c)})})}function n(b,c,e){b.operation(function(){var g=d(b),h=f(b,g.query,c?g.posFrom:g.posTo);(h.find(c)||(h=f(b,g.query,c?a.Pos(b.lastLine()):a.Pos(b.firstLine(),0)),h.find(c)))&&(b.setSelection(h.from(),h.to()),b.scrollIntoView({from:h.from(),to:h.to()},20),g.posFrom=h.from(),g.posTo=h.to(),e&&e(h.from(),h.to()))})}function o(a){a.operation(function(){var b=d(a);b.lastQuery=b.query,b.query&&(b.query=b.queryText=null,a.removeOverlay(b.overlay),b.annotate&&(b.annotate.clear(),b.annotate=null))})}function p(a,b,c){a.operation(function(){for(var d=f(a,b);d.findNext();)if("string"!=typeof b){var e=a.getRange(d.from(),d.to()).match(b);d.replace(c.replace(/\$(\d)/g,function(a,b){return e[b]}))}else d.replace(c)})}function q(a,b){if(!a.getOption("readOnly")){var c=a.getSelection()||d(a).lastQuery,e=b?"Replace all:":"Replace:";h(a,e+s,e,c,function(c){c&&(c=k(c),h(a,t,"Replace with:","",function(d){if(d=j(d),b)p(a,c,d);else{o(a);var e=f(a,c,a.getCursor()),g=function(){var b,j=e.from();!(b=e.findNext())&&(e=f(a,c),!(b=e.findNext())||j&&e.from().line==j.line&&e.from().ch==j.ch)||(a.setSelection(e.from(),e.to()),a.scrollIntoView({from:e.from(),to:e.to()}),i(a,u,"Replace?",[function(){h(b)},g,function(){p(a,c,d)}]))},h=function(a){e.replace("string"==typeof c?d:d.replace(/\$(\d)/g,function(b,c){return a[c]})),g()};g()}}))})}}var r='Search: (Use /re/ syntax for regexp search)',s=' (Use /re/ syntax for regexp search)',t='With: ',u="Replace? ";a.commands.find=function(a){o(a),m(a)},a.commands.findPersistent=function(a){o(a),m(a,!1,!0)},a.commands.findNext=m,a.commands.findPrev=function(a){m(a,!0)},a.commands.clearSearch=o,a.commands.replace=q,a.commands.replaceAll=function(a){q(a,!0)}}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../lib/codemirror"),require("../addon/search/searchcursor"),require("../addon/edit/matchbrackets")):"function"==typeof define&&define.amd?define(["../lib/codemirror","../addon/search/searchcursor","../addon/edit/matchbrackets"],a):a(CodeMirror)}(function(a){"use strict";function b(b,c,d){if(0>d&&0==c.ch)return b.clipPos(m(c.line-1));var e=b.getLine(c.line);if(d>0&&c.ch>=e.length)return b.clipPos(m(c.line+1,0));for(var f,g="start",h=c.ch,i=0>d?0:e.length,j=0;h!=i;h+=d,j++){var k=e.charAt(0>d?h-1:h),l="_"!=k&&a.isWordChar(k)?"w":"o";if("w"==l&&k.toUpperCase()==k&&(l="W"),"start"==g)"o"!=l&&(g="in",f=l);else if("in"==g&&f!=l){if("w"==f&&"W"==l&&0>d&&h--,"W"==f&&"w"==l&&d>0){f="w";continue}break}}return m(c.line,h)}function c(a,c){a.extendSelectionsBy(function(d){return a.display.shift||a.doc.extend||d.empty()?b(a.doc,d.head,c):0>c?d.from():d.to()})}function d(a,b){a.operation(function(){for(var c=a.listSelections().length,d=[],e=-1,f=0;c>f;f++){var g=a.listSelections()[f].head;if(!(g.line<=e)){var h=m(g.line+(b?0:1),0);a.replaceRange("\n",h,null,"+insertLine"),a.indentLine(h.line,null,!0),d.push({head:h,anchor:h}),e=g.line+1}}a.setSelections(d)})}function e(b,c){for(var d=c.ch,e=d,f=b.getLine(c.line);d&&a.isWordChar(f.charAt(d-1));)--d;for(;ea?-1:a==b?0:1}),a.replaceRange(k,i,j),c&&d.push({anchor:i,head:j})}c&&a.setSelections(d,0)})}function h(b,c){b.operation(function(){for(var d=b.listSelections(),f=[],g=[],h=0;h=0;h--){var i=d[f[h]];if(!(j&&a.cmpPos(i.head,j)>0)){var k=e(b,i.head);j=k.from,b.replaceRange(c(k.word),k.from,k.to)}}})}function i(b){var c=b.getCursor("from"),d=b.getCursor("to");if(0==a.cmpPos(c,d)){var f=e(b,c);if(!f.word)return;c=f.from,d=f.to}return{from:c,to:d,query:b.getRange(c,d),word:f}}function j(a,b){var c=i(a);if(c){var d=c.query,e=a.getSearchCursor(d,b?c.to:c.from);(b?e.findNext():e.findPrevious())?a.setSelection(e.from(),e.to()):(e=a.getSearchCursor(d,b?m(a.firstLine(),0):a.clipPos(m(a.lastLine()))),(b?e.findNext():e.findPrevious())?a.setSelection(e.from(),e.to()):c.word&&a.setSelection(c.from,c.to))}}var k=a.keyMap.sublime={fallthrough:"default"},l=a.commands,m=a.Pos,n=a.keyMap["default"]==a.keyMap.macDefault,o=n?"Cmd-":"Ctrl-";l[k["Alt-Left"]="goSubwordLeft"]=function(a){c(a,-1)},l[k["Alt-Right"]="goSubwordRight"]=function(a){c(a,1)};var p=n?"Ctrl-Alt-":"Ctrl-";l[k[p+"Up"]="scrollLineUp"]=function(a){var b=a.getScrollInfo();if(!a.somethingSelected()){var c=a.lineAtHeight(b.top+b.clientHeight,"local");a.getCursor().line>=c&&a.execCommand("goLineUp")}a.scrollTo(null,b.top-a.defaultTextHeight())},l[k[p+"Down"]="scrollLineDown"]=function(a){var b=a.getScrollInfo();if(!a.somethingSelected()){var c=a.lineAtHeight(b.top,"local")+1;a.getCursor().line<=c&&a.execCommand("goLineDown")}a.scrollTo(null,b.top+a.defaultTextHeight())},l[k["Shift-"+o+"L"]="splitSelectionByLine"]=function(a){for(var b=a.listSelections(),c=[],d=0;de.line&&g==f.line&&0==f.ch||c.push({anchor:g==e.line?e:m(g,0),head:g==f.line?f:m(g)});a.setSelections(c,0)},k["Shift-Tab"]="indentLess",l[k.Esc="singleSelectionTop"]=function(a){var b=a.listSelections()[0];a.setSelection(b.anchor,b.head,{scroll:!1})},l[k[o+"L"]="selectLine"]=function(a){for(var b=a.listSelections(),c=[],d=0;dd?c.push(h,i):c.length&&(c[c.length-1]=i),d=i}a.operation(function(){for(var b=0;ba.lastLine()?a.replaceRange("\n"+g,m(a.lastLine()),null,"+swapLine"):a.replaceRange(g+"\n",m(f,0),null,"+swapLine")}a.setSelections(e),a.scrollIntoView()})},l[k[r+"Down"]="swapLineDown"]=function(a){for(var b=a.listSelections(),c=[],d=a.lastLine()+1,e=b.length-1;e>=0;e--){var f=b[e],g=f.to().line+1,h=f.from().line;0!=f.to().ch||f.empty()||g--,d>g?c.push(g,h):c.length&&(c[c.length-1]=h),d=h}a.operation(function(){for(var b=c.length-2;b>=0;b-=2){var d=c[b],e=c[b+1],f=a.getLine(d);d==a.lastLine()?a.replaceRange("",m(d-1),m(d),"+swapLine"):a.replaceRange("",m(d,0),m(d+1,0),"+swapLine"),a.replaceRange(f+"\n",m(e,0),null,"+swapLine")}a.scrollIntoView()})},k[o+"/"]=function(a){a.toggleComment({indent:!0})},l[k[o+"J"]="joinLines"]=function(a){for(var b=a.listSelections(),c=[],d=0;dc;c++){var d=a.listSelections()[c];d.empty()?a.replaceRange(a.getLine(d.head.line)+"\n",m(d.head.line,0)):a.replaceRange(a.getRange(d.from(),d.to()),d.from())}a.scrollIntoView()})},k[o+"T"]="transposeChars",l[k.F9="sortLines"]=function(a){g(a,!0)},l[k[o+"F9"]="sortLinesInsensitive"]=function(a){g(a,!1)},l[k.F2="nextBookmark"]=function(a){var b=a.state.sublimeBookmarks;if(b)for(;b.length;){var c=b.shift(),d=c.find();if(d)return b.push(c),a.setSelection(d.from,d.to)}},l[k["Shift-F2"]="prevBookmark"]=function(a){var b=a.state.sublimeBookmarks;if(b)for(;b.length;){b.unshift(b.pop());var c=b[b.length-1].find();if(c)return a.setSelection(c.from,c.to);b.pop()}},l[k[o+"F2"]="toggleBookmark"]=function(a){for(var b=a.listSelections(),c=a.state.sublimeBookmarks||(a.state.sublimeBookmarks=[]),d=0;d=0;c--)a.replaceRange("",b[c].anchor,m(b[c].to().line),"+delete");a.scrollIntoView()})},l[k[s+o+"U"]="upcaseAtCursor"]=function(a){h(a,function(a){return a.toUpperCase()})},l[k[s+o+"L"]="downcaseAtCursor"]=function(a){h(a,function(a){return a.toLowerCase()})},l[k[s+o+"Space"]="setSublimeMark"]=function(a){a.state.sublimeMark&&a.state.sublimeMark.clear(),a.state.sublimeMark=a.setBookmark(a.getCursor())},l[k[s+o+"A"]="selectToSublimeMark"]=function(a){var b=a.state.sublimeMark&&a.state.sublimeMark.find();b&&a.setSelection(a.getCursor(),b)},l[k[s+o+"W"]="deleteToSublimeMark"]=function(b){var c=b.state.sublimeMark&&b.state.sublimeMark.find();if(c){var d=b.getCursor(),e=c;if(a.cmpPos(d,e)>0){var f=e;e=d,d=f}b.state.sublimeKilled=b.getRange(d,e),b.replaceRange("",d,e)}},l[k[s+o+"X"]="swapWithSublimeMark"]=function(a){var b=a.state.sublimeMark&&a.state.sublimeMark.find();b&&(a.state.sublimeMark.clear(),a.state.sublimeMark=a.setBookmark(a.getCursor()),a.setCursor(b))},l[k[s+o+"Y"]="sublimeYank"]=function(a){null!=a.state.sublimeKilled&&a.replaceSelection(a.state.sublimeKilled,null,"paste")},k[s+o+"G"]="clearBookmarks",l[k[s+o+"C"]="showInCenter"]=function(a){var b=a.cursorCoords(null,"local");a.scrollTo(null,(b.top+b.bottom)/2-a.getScrollInfo().clientHeight/2)},l[k["Shift-Alt-Up"]="selectLinesUpward"]=function(a){a.operation(function(){for(var b=a.listSelections(),c=0;ca.firstLine()&&a.addSelection(m(d.head.line-1,d.head.ch))}})},l[k["Shift-Alt-Down"]="selectLinesDownward"]=function(a){a.operation(function(){for(var b=a.listSelections(),c=0;c"]);return{startState:function(){return{comment:!1,escaped:!1,string:!1}},token:function(a,b){if(a.eatSpace())return null;var c=a.next();if("\\"==c)return b.escaped=!0,"escaped";if(b.escaped)return b.escaped=!1,"escaped";if('"'==c)return!b.string&&a.eol()?"string":(b.string=!b.string,"string");if(b.string)return a.eol()&&(b.string=!1),"string";if(b.comment)return"*"==c&&a.eat("/")&&(b.comment=!1),"comment";if("/"==c){if(a.eat("/"))return a.skipToEnd(),"comment";if(a.eat("*"))return b.comment=!0,"comment"}if(/\d/.test(c))return a.eatWhile(/[\d.]/),"number";if(/[\w_\$]/.test(c)){if(a.eatWhile(/[\w_\$]/),e.test(a.current()))return"keyword";if(f.test(a.current()))return"variable"}else if(g.test(c))return"operator";return null}}}); \ No newline at end of file diff --git a/nano/assets/fontawesome-webfont.eot b/nano/assets/fontawesome-webfont.eot index 9b6afaedc0f..e9f60ca953f 100644 Binary files a/nano/assets/fontawesome-webfont.eot and b/nano/assets/fontawesome-webfont.eot differ diff --git a/nano/assets/fontawesome-webfont.woff2 b/nano/assets/fontawesome-webfont.woff2 index 500e5172534..4d13fc60404 100644 Binary files a/nano/assets/fontawesome-webfont.woff2 and b/nano/assets/fontawesome-webfont.woff2 differ diff --git a/nano/assets/libraries.min.js b/nano/assets/libraries.min.js index 9cb2d2f24f6..bdd52655aba 100644 --- a/nano/assets/libraries.min.js +++ b/nano/assets/libraries.min.js @@ -1,5 +1 @@ -!function(e,t){"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(e,t){function n(e){var t="length"in e&&e.length,n=oe.type(e);return"function"!==n&&!oe.isWindow(e)&&(!(1!==e.nodeType||!t)||("array"===n||0===t||"number"==typeof t&&t>0&&t-1 in e))}function i(e,t,n){if(oe.isFunction(t))return oe.grep(e,function(e,i){return!!t.call(e,i,e)!==n});if(t.nodeType)return oe.grep(e,function(e){return e===t!==n});if("string"==typeof t){if(pe.test(t))return oe.filter(t,e,n);t=oe.filter(t,e)}return oe.grep(e,function(e){return oe.inArray(e,t)>=0!==n})}function o(e,t){do e=e[t];while(e&&1!==e.nodeType);return e}function r(e){var t=xe[e]={};return oe.each(e.match(be)||[],function(e,n){t[n]=!0}),t}function s(){he.addEventListener?(he.removeEventListener("DOMContentLoaded",a,!1),e.removeEventListener("load",a,!1)):(he.detachEvent("onreadystatechange",a),e.detachEvent("onload",a))}function a(){(he.addEventListener||"load"===event.type||"complete"===he.readyState)&&(s(),oe.ready())}function l(e,t,n){if(void 0===n&&1===e.nodeType){var i="data-"+t.replace(Ne,"-$1").toLowerCase();if(n=e.getAttribute(i),"string"==typeof n){try{n="true"===n||"false"!==n&&("null"===n?null:+n+""===n?+n:_e.test(n)?oe.parseJSON(n):n)}catch(o){}oe.data(e,t,n)}else n=void 0}return n}function u(e){var t;for(t in e)if(("data"!==t||!oe.isEmptyObject(e[t]))&&"toJSON"!==t)return!1;return!0}function c(e,t,n,i){if(oe.acceptData(e)){var o,r,s=oe.expando,a=e.nodeType,l=a?oe.cache:e,u=a?e[s]:e[s]&&s;if(u&&l[u]&&(i||l[u].data)||void 0!==n||"string"!=typeof t)return u||(u=a?e[s]=Y.pop()||oe.guid++:s),l[u]||(l[u]=a?{}:{toJSON:oe.noop}),"object"!=typeof t&&"function"!=typeof t||(i?l[u]=oe.extend(l[u],t):l[u].data=oe.extend(l[u].data,t)),r=l[u],i||(r.data||(r.data={}),r=r.data),void 0!==n&&(r[oe.camelCase(t)]=n),"string"==typeof t?(o=r[t],null==o&&(o=r[oe.camelCase(t)])):o=r,o}}function f(e,t,n){if(oe.acceptData(e)){var i,o,r=e.nodeType,s=r?oe.cache:e,a=r?e[oe.expando]:oe.expando;if(s[a]){if(t&&(i=n?s[a]:s[a].data)){oe.isArray(t)?t=t.concat(oe.map(t,oe.camelCase)):t in i?t=[t]:(t=oe.camelCase(t),t=t in i?[t]:t.split(" ")),o=t.length;for(;o--;)delete i[t[o]];if(n?!u(i):!oe.isEmptyObject(i))return}(n||(delete s[a].data,u(s[a])))&&(r?oe.cleanData([e],!0):ne.deleteExpando||s!=s.window?delete s[a]:s[a]=null)}}}function p(){return!0}function d(){return!1}function h(){try{return he.activeElement}catch(e){}}function g(e){var t=We.split("|"),n=e.createDocumentFragment();if(n.createElement)for(;t.length;)n.createElement(t.pop());return n}function m(e,t){var n,i,o=0,r=typeof e.getElementsByTagName!==Ce?e.getElementsByTagName(t||"*"):typeof e.querySelectorAll!==Ce?e.querySelectorAll(t||"*"):void 0;if(!r)for(r=[],n=e.childNodes||e;null!=(i=n[o]);o++)!t||oe.nodeName(i,t)?r.push(i):oe.merge(r,m(i,t));return void 0===t||t&&oe.nodeName(e,t)?oe.merge([e],r):r}function v(e){Ae.test(e.type)&&(e.defaultChecked=e.checked)}function y(e,t){return oe.nodeName(e,"table")&&oe.nodeName(11!==t.nodeType?t:t.firstChild,"tr")?e.getElementsByTagName("tbody")[0]||e.appendChild(e.ownerDocument.createElement("tbody")):e}function b(e){return e.type=(null!==oe.find.attr(e,"type"))+"/"+e.type,e}function x(e){var t=Qe.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function w(e,t){for(var n,i=0;null!=(n=e[i]);i++)oe._data(n,"globalEval",!t||oe._data(t[i],"globalEval"))}function T(e,t){if(1===t.nodeType&&oe.hasData(e)){var n,i,o,r=oe._data(e),s=oe._data(t,r),a=r.events;if(a){delete s.handle,s.events={};for(n in a)for(i=0,o=a[n].length;i")).appendTo(t.documentElement),t=(Je[0].contentWindow||Je[0].contentDocument).document,t.write(),t.close(),n=_(e,t),Je.detach()),Ze[e]=n),n}function E(e,t){return{get:function(){var n=e();if(null!=n)return n?void delete this.get:(this.get=t).apply(this,arguments)}}}function k(e,t){if(t in e)return t;for(var n=t.charAt(0).toUpperCase()+t.slice(1),i=t,o=pt.length;o--;)if(t=pt[o]+n,t in e)return t;return i}function S(e,t){for(var n,i,o,r=[],s=0,a=e.length;s=0&&n=0},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},isPlainObject:function(e){var t;if(!e||"object"!==oe.type(e)||e.nodeType||oe.isWindow(e))return!1;try{if(e.constructor&&!te.call(e,"constructor")&&!te.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(n){return!1}if(ne.ownLast)for(t in e)return te.call(e,t);for(t in e);return void 0===t||te.call(e,t)},type:function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?Z[ee.call(e)]||"object":typeof e},globalEval:function(t){t&&oe.trim(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(se,"ms-").replace(ae,le)},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(;rT.cacheLength&&delete e[t.shift()],e[n+" "]=i}var t=[];return e}function i(e){return e[F]=!0,e}function o(e){var t=P.createElement("div");try{return!!e(t)}catch(n){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function r(e,t){for(var n=e.split("|"),i=e.length;i--;)T.attrHandle[n[i]]=t}function s(e,t){var n=t&&e,i=n&&1===e.nodeType&&1===t.nodeType&&(~t.sourceIndex||Q)-(~e.sourceIndex||Q);if(i)return i;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function a(e){return function(t){var n=t.nodeName.toLowerCase();return"input"===n&&t.type===e}}function l(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function u(e){return i(function(t){return t=+t,i(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 c(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}function f(){}function p(e){for(var t=0,n=e.length,i="";t1?function(t,n,i){for(var o=e.length;o--;)if(!e[o](t,n,i))return!1;return!0}:e[0]}function g(e,n,i){for(var o=0,r=n.length;o-1&&(i[u]=!(s[u]=f))}}else b=m(b===s?b.splice(h,b.length):b),r?r(null,s,b,l):J.apply(s,b)})}function y(e){for(var t,n,i,o=e.length,r=T.relative[e[0].type],s=r||T.relative[" "],a=r?1:0,l=d(function(e){return e===t},s,!0),u=d(function(e){return ee(t,e)>-1},s,!0),c=[function(e,n,i){var o=!r&&(i||n!==S)||((t=n).nodeType?l(e,n,i):u(e,n,i));return t=null,o}];a1&&h(c),a>1&&p(e.slice(0,a-1).concat({value:" "===e[a-2].type?"*":""})).replace(le,"$1"),n,a0,r=e.length>0,s=function(i,s,a,l,u){var c,f,p,d=0,h="0",g=i&&[],v=[],y=S,b=i||r&&T.find.TAG("*",u),x=R+=null==y?1:Math.random()||.1,w=b.length;for(u&&(S=s!==P&&s);h!==w&&null!=(c=b[h]);h++){if(r&&c){for(f=0;p=e[f++];)if(p(c,s,a)){l.push(c);break}u&&(R=x)}o&&((c=!p&&c)&&d--,i&&g.push(c))}if(d+=h,o&&h!==d){for(f=0;p=n[f++];)p(g,v,s,a);if(i){if(d>0)for(;h--;)g[h]||v[h]||(v[h]=G.call(l));v=m(v)}J.apply(l,v),u&&!i&&v.length>0&&d+n.length>1&&t.uniqueSort(l)}return u&&(R=x,S=y),g};return o?i(s):s}var x,w,T,C,_,N,E,k,S,D,A,H,P,j,L,M,W,I,O,F="sizzle"+1*new Date,q=e.document,R=0,B=0,z=n(),$=n(),X=n(),U=function(e,t){return e===t&&(A=!0),0},Q=1<<31,Y={}.hasOwnProperty,V=[],G=V.pop,K=V.push,J=V.push,Z=V.slice,ee=function(e,t){for(var n=0,i=e.length;n+~]|"+ne+")"+ne+"*"),fe=new RegExp("="+ne+"*([^\\]'\"]*?)"+ne+"*\\]","g"),pe=new RegExp(se),de=new RegExp("^"+oe+"$"),he={ID:new RegExp("^#("+ie+")"),CLASS:new RegExp("^\\.("+ie+")"),TAG:new RegExp("^("+ie.replace("w","w*")+")"),ATTR:new RegExp("^"+re),PSEUDO:new RegExp("^"+se),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+ne+"*(even|odd|(([+-]|)(\\d*)n|)"+ne+"*(?:([+-]|)"+ne+"*(\\d+)|))"+ne+"*\\)|)","i"),bool:new RegExp("^(?:"+te+")$","i"),needsContext:new RegExp("^"+ne+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+ne+"*((?:-\\d)?\\d*)"+ne+"*\\)|)(?=[^-]|$)","i")},ge=/^(?:input|select|textarea|button)$/i,me=/^h\d$/i,ve=/^[^{]+\{\s*\[native \w/,ye=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,be=/[+~]/,xe=/'|\\/g,we=new RegExp("\\\\([\\da-f]{1,6}"+ne+"?|("+ne+")|.)","ig"),Te=function(e,t,n){var i="0x"+t-65536;return i!==i||n?t:i<0?String.fromCharCode(i+65536):String.fromCharCode(i>>10|55296,1023&i|56320)},Ce=function(){H()};try{J.apply(V=Z.call(q.childNodes),q.childNodes),V[q.childNodes.length].nodeType}catch(_e){J={apply:V.length?function(e,t){K.apply(e,Z.call(t))}:function(e,t){for(var n=e.length,i=0;e[n++]=t[i++];);e.length=n-1}}}w=t.support={},_=t.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return!!t&&"HTML"!==t.nodeName},H=t.setDocument=function(e){var t,n,i=e?e.ownerDocument||e:q;return i!==P&&9===i.nodeType&&i.documentElement?(P=i,j=i.documentElement,n=i.defaultView,n&&n!==n.top&&(n.addEventListener?n.addEventListener("unload",Ce,!1):n.attachEvent&&n.attachEvent("onunload",Ce)),L=!_(i),w.attributes=o(function(e){return e.className="i",!e.getAttribute("className")}),w.getElementsByTagName=o(function(e){return e.appendChild(i.createComment("")),!e.getElementsByTagName("*").length}),w.getElementsByClassName=ve.test(i.getElementsByClassName),w.getById=o(function(e){return j.appendChild(e).id=F,!i.getElementsByName||!i.getElementsByName(F).length}),w.getById?(T.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&L){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},T.filter.ID=function(e){var t=e.replace(we,Te);return function(e){return e.getAttribute("id")===t}}):(delete T.find.ID,T.filter.ID=function(e){var t=e.replace(we,Te);return function(e){var n="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}}),T.find.TAG=w.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):w.qsa?t.querySelectorAll(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},T.find.CLASS=w.getElementsByClassName&&function(e,t){if(L)return t.getElementsByClassName(e)},W=[],M=[],(w.qsa=ve.test(i.querySelectorAll))&&(o(function(e){j.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&M.push("[*^$]="+ne+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||M.push("\\["+ne+"*(?:value|"+te+")"),e.querySelectorAll("[id~="+F+"-]").length||M.push("~="),e.querySelectorAll(":checked").length||M.push(":checked"),e.querySelectorAll("a#"+F+"+*").length||M.push(".#.+[+~]")}),o(function(e){var t=i.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&M.push("name"+ne+"*[*^$|!~]?="),e.querySelectorAll(":enabled").length||M.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),M.push(",.*:")})),(w.matchesSelector=ve.test(I=j.matches||j.webkitMatchesSelector||j.mozMatchesSelector||j.oMatchesSelector||j.msMatchesSelector))&&o(function(e){w.disconnectedMatch=I.call(e,"div"),I.call(e,"[s!='']:x"),W.push("!=",se)}),M=M.length&&new RegExp(M.join("|")),W=W.length&&new RegExp(W.join("|")),t=ve.test(j.compareDocumentPosition),O=t||ve.test(j.contains)?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},U=t?function(e,t){if(e===t)return A=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n?n:(n=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1,1&n||!w.sortDetached&&t.compareDocumentPosition(e)===n?e===i||e.ownerDocument===q&&O(q,e)?-1:t===i||t.ownerDocument===q&&O(q,t)?1:D?ee(D,e)-ee(D,t):0:4&n?-1:1)}:function(e,t){if(e===t)return A=!0,0;var n,o=0,r=e.parentNode,a=t.parentNode,l=[e],u=[t];if(!r||!a)return e===i?-1:t===i?1:r?-1:a?1:D?ee(D,e)-ee(D,t):0;if(r===a)return s(e,t);for(n=e;n=n.parentNode;)l.unshift(n);for(n=t;n=n.parentNode;)u.unshift(n);for(;l[o]===u[o];)o++;return o?s(l[o],u[o]):l[o]===q?-1:u[o]===q?1:0},i):P},t.matches=function(e,n){return t(e,null,null,n)},t.matchesSelector=function(e,n){if((e.ownerDocument||e)!==P&&H(e),n=n.replace(fe,"='$1']"),w.matchesSelector&&L&&(!W||!W.test(n))&&(!M||!M.test(n)))try{var i=I.call(e,n);if(i||w.disconnectedMatch||e.document&&11!==e.document.nodeType)return i}catch(o){}return t(n,P,null,[e]).length>0},t.contains=function(e,t){return(e.ownerDocument||e)!==P&&H(e),O(e,t)},t.attr=function(e,t){(e.ownerDocument||e)!==P&&H(e);var n=T.attrHandle[t.toLowerCase()],i=n&&Y.call(T.attrHandle,t.toLowerCase())?n(e,t,!L):void 0;return void 0!==i?i:w.attributes||!L?e.getAttribute(t):(i=e.getAttributeNode(t))&&i.specified?i.value:null},t.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},t.uniqueSort=function(e){var t,n=[],i=0,o=0;if(A=!w.detectDuplicates,D=!w.sortStable&&e.slice(0),e.sort(U),A){for(;t=e[o++];)t===e[o]&&(i=n.push(o));for(;i--;)e.splice(n[i],1)}return D=null,e},C=t.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+=C(e)}else if(3===o||4===o)return e.nodeValue}else for(;t=e[i++];)n+=C(t);return n},T=t.selectors={cacheLength:50,createPseudo:i,match:he,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(we,Te),e[3]=(e[3]||e[4]||e[5]||"").replace(we,Te),"~="===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]||t.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]&&t.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return he.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&pe.test(n)&&(t=N(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(we,Te).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=z[e+" "];return t||(t=new RegExp("(^|"+ne+")"+e+"("+ne+"|$)"))&&z(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(e,n,i){return function(o){var r=t.attr(o,e);return null==r?"!="===n:!n||(r+="","="===n?r===i:"!="===n?r!==i:"^="===n?i&&0===r.indexOf(i):"*="===n?i&&r.indexOf(i)>-1:"$="===n?i&&r.slice(-i.length)===i:"~="===n?(" "+r.replace(ae," ")+" ").indexOf(i)>-1:"|="===n&&(r===i||r.slice(0,i.length+1)===i+"-"))}},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 u,c,f,p,d,h,g=r!==s?"nextSibling":"previousSibling",m=t.parentNode,v=a&&t.nodeName.toLowerCase(),y=!l&&!a;if(m){if(r){for(;g;){for(f=t;f=f[g];)if(a?f.nodeName.toLowerCase()===v:1===f.nodeType)return!1;h=g="only"===e&&!h&&"nextSibling"}return!0}if(h=[s?m.firstChild:m.lastChild],s&&y){for(c=m[F]||(m[F]={}),u=c[e]||[],d=u[0]===R&&u[1],p=u[0]===R&&u[2],f=d&&m.childNodes[d];f=++d&&f&&f[g]||(p=d=0)||h.pop();)if(1===f.nodeType&&++p&&f===t){c[e]=[R,d,p];break}}else if(y&&(u=(t[F]||(t[F]={}))[e])&&u[0]===R)p=u[1];else for(;(f=++d&&f&&f[g]||(p=d=0)||h.pop())&&((a?f.nodeName.toLowerCase()!==v:1!==f.nodeType)||!++p||(y&&((f[F]||(f[F]={}))[e]=[R,p]),f!==t)););return p-=o,p===i||p%i===0&&p/i>=0}}},PSEUDO:function(e,n){var o,r=T.pseudos[e]||T.setFilters[e.toLowerCase()]||t.error("unsupported pseudo: "+e);return r[F]?r(n):r.length>1?(o=[e,e,"",n],T.setFilters.hasOwnProperty(e.toLowerCase())?i(function(e,t){for(var i,o=r(e,n),s=o.length;s--;)i=ee(e,o[s]),e[i]=!(t[i]=o[s])}):function(e){return r(e,0,o)}):r}},pseudos:{not:i(function(e){var t=[],n=[],o=E(e.replace(le,"$1"));return o[F]?i(function(e,t,n,i){for(var r,s=o(e,null,i,[]),a=e.length;a--;)(r=s[a])&&(e[a]=!(t[a]=r))}):function(e,i,r){return t[0]=e,o(t,null,r,n),t[0]=null,!n.pop()}}),has:i(function(e){return function(n){return t(e,n).length>0}}),contains:i(function(e){return e=e.replace(we,Te),function(t){return(t.textContent||t.innerText||C(t)).indexOf(e)>-1}}),lang:i(function(e){return de.test(e||"")||t.error("unsupported lang: "+e),e=e.replace(we,Te).toLowerCase(),function(t){var n;do if(n=L?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===j},focus:function(e){return e===P.activeElement&&(!P.hasFocus||P.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.nodeType<6)return!1;return!0},parent:function(e){return!T.pseudos.empty(e)},header:function(e){return me.test(e.nodeName)},input:function(e){return ge.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"))||"text"===t.toLowerCase())},first:u(function(){return[0]}),last:u(function(e,t){return[t-1]}),eq:u(function(e,t,n){return[n<0?n+t:n]}),even:u(function(e,t){for(var n=0;n=0;)e.push(i);return e}),gt:u(function(e,t,n){for(var i=n<0?n+t:n;++i2&&"ID"===(s=r[0]).type&&w.getById&&9===t.nodeType&&L&&T.relative[r[1].type]){if(t=(T.find.ID(s.matches[0].replace(we,Te),t)||[])[0],!t)return n;u&&(t=t.parentNode),e=e.slice(r.shift().value.length)}for(o=he.needsContext.test(e)?0:r.length;o--&&(s=r[o],!T.relative[a=s.type]);)if((l=T.find[a])&&(i=l(s.matches[0].replace(we,Te),be.test(r[0].type)&&c(t.parentNode)||t))){if(r.splice(o,1),e=i.length&&p(r),!e)return J.apply(n,i),n;break}}return(u||E(e,f))(i,t,!L,n,be.test(e)&&c(t.parentNode)||t),n},w.sortStable=F.split("").sort(U).join("")===F,w.detectDuplicates=!!A,H(),w.sortDetached=o(function(e){return 1&e.compareDocumentPosition(P.createElement("div"))}),o(function(e){return e.innerHTML="","#"===e.firstChild.getAttribute("href")})||r("type|href|height|width",function(e,t,n){if(!n)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),w.attributes&&o(function(e){return e.innerHTML="",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||r("value",function(e,t,n){if(!n&&"input"===e.nodeName.toLowerCase())return e.defaultValue}),o(function(e){return null==e.getAttribute("disabled")})||r(te,function(e,t,n){var i;if(!n)return e[t]===!0?t.toLowerCase():(i=e.getAttributeNode(t))&&i.specified?i.value:null}),t}(e);oe.find=ue,oe.expr=ue.selectors,oe.expr[":"]=oe.expr.pseudos,oe.unique=ue.uniqueSort,oe.text=ue.getText,oe.isXMLDoc=ue.isXML,oe.contains=ue.contains;var ce=oe.expr.match.needsContext,fe=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,pe=/^.[^:#\[\.,]*$/;oe.filter=function(e,t,n){var i=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===i.nodeType?oe.find.matchesSelector(i,e)?[i]:[]:oe.find.matches(e,oe.grep(t,function(e){return 1===e.nodeType}))},oe.fn.extend({find:function(e){var t,n=[],i=this,o=i.length;if("string"!=typeof e)return this.pushStack(oe(e).filter(function(){for(t=0;t1?oe.unique(n):n),n.selector=this.selector?this.selector+" "+e:e,n},filter:function(e){return this.pushStack(i(this,e||[],!1))},not:function(e){return this.pushStack(i(this,e||[],!0))},is:function(e){return!!i(this,"string"==typeof e&&ce.test(e)?oe(e):e||[],!1).length}});var de,he=e.document,ge=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,me=oe.fn.init=function(e,t){var n,i;if(!e)return this;if("string"==typeof e){if(n="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&e.length>=3?[null,e,null]:ge.exec(e),!n||!n[1]&&t)return!t||t.jquery?(t||de).find(e):this.constructor(t).find(e);if(n[1]){if(t=t instanceof oe?t[0]:t,oe.merge(this,oe.parseHTML(n[1],t&&t.nodeType?t.ownerDocument||t:he,!0)),fe.test(n[1])&&oe.isPlainObject(t))for(n in t)oe.isFunction(this[n])?this[n](t[n]):this.attr(n,t[n]);return this}if(i=he.getElementById(n[2]),i&&i.parentNode){if(i.id!==n[2])return de.find(e);this.length=1,this[0]=i}return this.context=he,this.selector=e,this}return e.nodeType?(this.context=this[0]=e,this.length=1,this):oe.isFunction(e)?"undefined"!=typeof de.ready?de.ready(e):e(oe):(void 0!==e.selector&&(this.selector=e.selector,this.context=e.context),oe.makeArray(e,this))};me.prototype=oe.fn,de=oe(he);var ve=/^(?:parents|prev(?:Until|All))/,ye={children:!0,contents:!0,next:!0,prev:!0};oe.extend({dir:function(e,t,n){for(var i=[],o=e[t];o&&9!==o.nodeType&&(void 0===n||1!==o.nodeType||!oe(o).is(n));)1===o.nodeType&&i.push(o),o=o[t];return i},sibling:function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n}}),oe.fn.extend({has:function(e){var t,n=oe(e,this),i=n.length;return this.filter(function(){for(t=0;t-1:1===n.nodeType&&oe.find.matchesSelector(n,e))){r.push(n);break}return this.pushStack(r.length>1?oe.unique(r):r)},index:function(e){return e?"string"==typeof e?oe.inArray(this[0],oe(e)):oe.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(oe.unique(oe.merge(this.get(),oe(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),oe.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return oe.dir(e,"parentNode")},parentsUntil:function(e,t,n){return oe.dir(e,"parentNode",n)},next:function(e){return o(e,"nextSibling")},prev:function(e){return o(e,"previousSibling")},nextAll:function(e){return oe.dir(e,"nextSibling")},prevAll:function(e){return oe.dir(e,"previousSibling")},nextUntil:function(e,t,n){return oe.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return oe.dir(e,"previousSibling",n)},siblings:function(e){return oe.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return oe.sibling(e.firstChild)},contents:function(e){return oe.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:oe.merge([],e.childNodes)}},function(e,t){oe.fn[e]=function(n,i){var o=oe.map(this,t,n);return"Until"!==e.slice(-5)&&(i=n),i&&"string"==typeof i&&(o=oe.filter(i,o)),this.length>1&&(ye[e]||(o=oe.unique(o)),ve.test(e)&&(o=o.reverse())),this.pushStack(o)}});var be=/\S+/g,xe={};oe.Callbacks=function(e){e="string"==typeof e?xe[e]||r(e):oe.extend({},e);var t,n,i,o,s,a,l=[],u=!e.once&&[],c=function(r){for(n=e.memory&&r,i=!0,s=a||0,a=0,o=l.length,t=!0;l&&s-1;)l.splice(i,1),t&&(i<=o&&o--,i<=s&&s--)}),this},has:function(e){return e?oe.inArray(e,l)>-1:!(!l||!l.length)},empty:function(){return l=[],o=0,this},disable:function(){return l=u=n=void 0,this},disabled:function(){return!l},lock:function(){return u=void 0,n||f.disable(),this},locked:function(){return!u},fireWith:function(e,n){return!l||i&&!u||(n=n||[],n=[e,n.slice?n.slice():n],t?u.push(n):c(n)),this},fire:function(){return f.fireWith(this,arguments),this},fired:function(){return!!i}};return f},oe.extend({Deferred:function(e){var t=[["resolve","done",oe.Callbacks("once memory"),"resolved"],["reject","fail",oe.Callbacks("once memory"),"rejected"],["notify","progress",oe.Callbacks("memory")]],n="pending",i={state:function(){return n},always:function(){return o.done(arguments).fail(arguments),this},then:function(){var e=arguments;return oe.Deferred(function(n){oe.each(t,function(t,r){var s=oe.isFunction(e[t])&&e[t];o[r[1]](function(){var e=s&&s.apply(this,arguments);e&&oe.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[r[0]+"With"](this===i?n.promise():this,s?[e]:arguments)})}),e=null}).promise()},promise:function(e){return null!=e?oe.extend(e,i):i}},o={};return i.pipe=i.then,oe.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=V.call(arguments),s=r.length,a=1!==s||e&&oe.isFunction(e.promise)?s:0,l=1===a?e:oe.Deferred(),u=function(e,n,i){return function(o){n[e]=this,i[e]=arguments.length>1?V.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);o0||(we.resolveWith(he,[oe]),oe.fn.triggerHandler&&(oe(he).triggerHandler("ready"),oe(he).off("ready")))}}}),oe.ready.promise=function(t){if(!we)if(we=oe.Deferred(),"complete"===he.readyState)setTimeout(oe.ready);else if(he.addEventListener)he.addEventListener("DOMContentLoaded",a,!1),e.addEventListener("load",a,!1);else{he.attachEvent("onreadystatechange",a),e.attachEvent("onload",a);var n=!1;try{n=null==e.frameElement&&he.documentElement}catch(i){}n&&n.doScroll&&!function o(){if(!oe.isReady){try{n.doScroll("left")}catch(e){return setTimeout(o,50)}s(),oe.ready()}}()}return we.promise(t)};var Te,Ce="undefined";for(Te in oe(ne))break;ne.ownLast="0"!==Te,ne.inlineBlockNeedsLayout=!1,oe(function(){var e,t,n,i;n=he.getElementsByTagName("body")[0],n&&n.style&&(t=he.createElement("div"),i=he.createElement("div"),i.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",n.appendChild(i).appendChild(t),typeof t.style.zoom!==Ce&&(t.style.cssText="display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1",ne.inlineBlockNeedsLayout=e=3===t.offsetWidth,e&&(n.style.zoom=1)),n.removeChild(i))}),function(){var e=he.createElement("div");if(null==ne.deleteExpando){ne.deleteExpando=!0;try{delete e.test}catch(t){ne.deleteExpando=!1}}e=null}(),oe.acceptData=function(e){var t=oe.noData[(e.nodeName+" ").toLowerCase()],n=+e.nodeType||1;return(1===n||9===n)&&(!t||t!==!0&&e.getAttribute("classid")===t)};var _e=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,Ne=/([A-Z])/g;oe.extend({cache:{},noData:{"applet ":!0,"embed ":!0,"object ":"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(e){return e=e.nodeType?oe.cache[e[oe.expando]]:e[oe.expando],!!e&&!u(e)},data:function(e,t,n){return c(e,t,n)},removeData:function(e,t){return f(e,t)},_data:function(e,t,n){return c(e,t,n,!0)},_removeData:function(e,t){return f(e,t,!0)}}),oe.fn.extend({data:function(e,t){var n,i,o,r=this[0],s=r&&r.attributes;if(void 0===e){if(this.length&&(o=oe.data(r),1===r.nodeType&&!oe._data(r,"parsedAttrs"))){for(n=s.length;n--;)s[n]&&(i=s[n].name,0===i.indexOf("data-")&&(i=oe.camelCase(i.slice(5)),l(r,i,o[i])));oe._data(r,"parsedAttrs",!0)}return o}return"object"==typeof e?this.each(function(){oe.data(this,e)}):arguments.length>1?this.each(function(){oe.data(this,e,t)}):r?l(r,e,oe.data(r,e)):void 0},removeData:function(e){return this.each(function(){oe.removeData(this,e)})}}),oe.extend({queue:function(e,t,n){var i;if(e)return t=(t||"fx")+"queue",i=oe._data(e,t),n&&(!i||oe.isArray(n)?i=oe._data(e,t,oe.makeArray(n)):i.push(n)),i||[]},dequeue:function(e,t){t=t||"fx";var n=oe.queue(e,t),i=n.length,o=n.shift(),r=oe._queueHooks(e,t),s=function(){oe.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 oe._data(e,n)||oe._data(e,n,{empty:oe.Callbacks("once memory").add(function(){oe._removeData(e,t+"queue"),oe._removeData(e,n)})})}}),oe.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&&(t=e,e="fx",n--),arguments.length
a",ne.leadingWhitespace=3===t.firstChild.nodeType,ne.tbody=!t.getElementsByTagName("tbody").length,ne.htmlSerialize=!!t.getElementsByTagName("link").length,ne.html5Clone="<:nav>"!==he.createElement("nav").cloneNode(!0).outerHTML,e.type="checkbox",e.checked=!0,n.appendChild(e),ne.appendChecked=e.checked,t.innerHTML="",ne.noCloneChecked=!!t.cloneNode(!0).lastChild.defaultValue,n.appendChild(t),t.innerHTML="",ne.checkClone=t.cloneNode(!0).cloneNode(!0).lastChild.checked,ne.noCloneEvent=!0,t.attachEvent&&(t.attachEvent("onclick",function(){ne.noCloneEvent=!1}),t.cloneNode(!0).click()),null==ne.deleteExpando){ne.deleteExpando=!0;try{delete t.test}catch(i){ne.deleteExpando=!1}}}(),function(){var t,n,i=he.createElement("div");for(t in{submit:!0,change:!0,focusin:!0})n="on"+t,(ne[t+"Bubbles"]=n in e)||(i.setAttribute(n,"t"),ne[t+"Bubbles"]=i.attributes[n].expando===!1);i=null}();var He=/^(?:input|select|textarea)$/i,Pe=/^key/,je=/^(?:mouse|pointer|contextmenu)|click/,Le=/^(?:focusinfocus|focusoutblur)$/,Me=/^([^.]*)(?:\.(.+)|)$/;oe.event={global:{},add:function(e,t,n,i,o){var r,s,a,l,u,c,f,p,d,h,g,m=oe._data(e);if(m){for(n.handler&&(l=n,n=l.handler,o=l.selector),n.guid||(n.guid=oe.guid++),(s=m.events)||(s=m.events={}),(c=m.handle)||(c=m.handle=function(e){return typeof oe===Ce||e&&oe.event.triggered===e.type?void 0:oe.event.dispatch.apply(c.elem,arguments)},c.elem=e),t=(t||"").match(be)||[""],a=t.length;a--;)r=Me.exec(t[a])||[],d=g=r[1],h=(r[2]||"").split(".").sort(),d&&(u=oe.event.special[d]||{},d=(o?u.delegateType:u.bindType)||d,u=oe.event.special[d]||{},f=oe.extend({type:d,origType:g,data:i,handler:n,guid:n.guid,selector:o,needsContext:o&&oe.expr.match.needsContext.test(o),namespace:h.join(".")},l),(p=s[d])||(p=s[d]=[],p.delegateCount=0,u.setup&&u.setup.call(e,i,h,c)!==!1||(e.addEventListener?e.addEventListener(d,c,!1):e.attachEvent&&e.attachEvent("on"+d,c))),u.add&&(u.add.call(e,f),f.handler.guid||(f.handler.guid=n.guid)),o?p.splice(p.delegateCount++,0,f):p.push(f),oe.event.global[d]=!0);e=null}},remove:function(e,t,n,i,o){var r,s,a,l,u,c,f,p,d,h,g,m=oe.hasData(e)&&oe._data(e);if(m&&(c=m.events)){for(t=(t||"").match(be)||[""],u=t.length;u--;)if(a=Me.exec(t[u])||[],d=g=a[1],h=(a[2]||"").split(".").sort(),d){for(f=oe.event.special[d]||{},d=(i?f.delegateType:f.bindType)||d,p=c[d]||[],a=a[2]&&new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),l=r=p.length;r--;)s=p[r],!o&&g!==s.origType||n&&n.guid!==s.guid||a&&!a.test(s.namespace)||i&&i!==s.selector&&("**"!==i||!s.selector)||(p.splice(r,1),s.selector&&p.delegateCount--,f.remove&&f.remove.call(e,s));l&&!p.length&&(f.teardown&&f.teardown.call(e,h,m.handle)!==!1||oe.removeEvent(e,d,m.handle),delete c[d])}else for(d in c)oe.event.remove(e,d+t[u],n,i,!0);oe.isEmptyObject(c)&&(delete m.handle,oe._removeData(e,"events"))}},trigger:function(t,n,i,o){var r,s,a,l,u,c,f,p=[i||he],d=te.call(t,"type")?t.type:t,h=te.call(t,"namespace")?t.namespace.split("."):[];if(a=c=i=i||he,3!==i.nodeType&&8!==i.nodeType&&!Le.test(d+oe.event.triggered)&&(d.indexOf(".")>=0&&(h=d.split("."),d=h.shift(),h.sort()),s=d.indexOf(":")<0&&"on"+d,t=t[oe.expando]?t:new oe.Event(d,"object"==typeof t&&t),t.isTrigger=o?2:3,t.namespace=h.join("."),t.namespace_re=t.namespace?new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=i),n=null==n?[t]:oe.makeArray(n,[t]),u=oe.event.special[d]||{},o||!u.trigger||u.trigger.apply(i,n)!==!1)){if(!o&&!u.noBubble&&!oe.isWindow(i)){for(l=u.delegateType||d,Le.test(l+d)||(a=a.parentNode);a;a=a.parentNode)p.push(a),c=a;c===(i.ownerDocument||he)&&p.push(c.defaultView||c.parentWindow||e)}for(f=0;(a=p[f++])&&!t.isPropagationStopped();)t.type=f>1?l:u.bindType||d,r=(oe._data(a,"events")||{})[t.type]&&oe._data(a,"handle"),r&&r.apply(a,n),r=s&&a[s],r&&r.apply&&oe.acceptData(a)&&(t.result=r.apply(a,n),t.result===!1&&t.preventDefault());if(t.type=d,!o&&!t.isDefaultPrevented()&&(!u._default||u._default.apply(p.pop(),n)===!1)&&oe.acceptData(i)&&s&&i[d]&&!oe.isWindow(i)){c=i[s],c&&(i[s]=null),oe.event.triggered=d;try{i[d]()}catch(g){}oe.event.triggered=void 0,c&&(i[s]=c)}return t.result}},dispatch:function(e){e=oe.event.fix(e);var t,n,i,o,r,s=[],a=V.call(arguments),l=(oe._data(this,"events")||{})[e.type]||[],u=oe.event.special[e.type]||{};if(a[0]=e,e.delegateTarget=this,!u.preDispatch||u.preDispatch.call(this,e)!==!1){for(s=oe.event.handlers.call(this,e,l),t=0;(o=s[t++])&&!e.isPropagationStopped();)for(e.currentTarget=o.elem,r=0;(i=o.handlers[r++])&&!e.isImmediatePropagationStopped();)e.namespace_re&&!e.namespace_re.test(i.namespace)||(e.handleObj=i,e.data=i.data,n=((oe.event.special[i.origType]||{}).handle||i.handler).apply(o.elem,a),void 0!==n&&(e.result=n)===!1&&(e.preventDefault(),e.stopPropagation()));return u.postDispatch&&u.postDispatch.call(this,e),e.result}},handlers:function(e,t){var n,i,o,r,s=[],a=t.delegateCount,l=e.target;if(a&&l.nodeType&&(!e.button||"click"!==e.type))for(;l!=this;l=l.parentNode||this)if(1===l.nodeType&&(l.disabled!==!0||"click"!==e.type)){for(o=[],r=0;r=0:oe.find(n,this,null,[l]).length),o[n]&&o.push(i);o.length&&s.push({elem:l,handlers:o})}return a]","i"),Fe=/^\s+/,qe=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,Re=/<([\w:]+)/,Be=/\s*$/g,Ve={option:[1,""],legend:[1,"
","
"],area:[1,"",""],param:[1,"",""],thead:[1,"","
"],tr:[2,"","
"],col:[2,"","
"],td:[3,"","
"],_default:ne.htmlSerialize?[0,"",""]:[1,"X
","
"]},Ge=g(he),Ke=Ge.appendChild(he.createElement("div"));Ve.optgroup=Ve.option,Ve.tbody=Ve.tfoot=Ve.colgroup=Ve.caption=Ve.thead,Ve.th=Ve.td,oe.extend({clone:function(e,t,n){var i,o,r,s,a,l=oe.contains(e.ownerDocument,e);if(ne.html5Clone||oe.isXMLDoc(e)||!Oe.test("<"+e.nodeName+">")?r=e.cloneNode(!0):(Ke.innerHTML=e.outerHTML,Ke.removeChild(r=Ke.firstChild)),!(ne.noCloneEvent&&ne.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||oe.isXMLDoc(e)))for(i=m(r),a=m(e),s=0;null!=(o=a[s]);++s)i[s]&&C(o,i[s]);if(t)if(n)for(a=a||m(e),i=i||m(r),s=0;null!=(o=a[s]);s++)T(o,i[s]);else T(e,r);return i=m(r,"script"),i.length>0&&w(i,!l&&m(e,"script")),i=a=o=null,r},buildFragment:function(e,t,n,i){for(var o,r,s,a,l,u,c,f=e.length,p=g(t),d=[],h=0;h")+c[2],o=c[0];o--;)a=a.lastChild;if(!ne.leadingWhitespace&&Fe.test(r)&&d.push(t.createTextNode(Fe.exec(r)[0])),!ne.tbody)for(r="table"!==l||Be.test(r)?""!==c[1]||Be.test(r)?0:a:a.firstChild,o=r&&r.childNodes.length;o--;)oe.nodeName(u=r.childNodes[o],"tbody")&&!u.childNodes.length&&r.removeChild(u);for(oe.merge(d,a.childNodes),a.textContent="";a.firstChild;)a.removeChild(a.firstChild);a=p.lastChild}else d.push(t.createTextNode(r));for(a&&p.removeChild(a),ne.appendChecked||oe.grep(m(d,"input"),v),h=0;r=d[h++];)if((!i||oe.inArray(r,i)===-1)&&(s=oe.contains(r.ownerDocument,r),a=m(p.appendChild(r),"script"),s&&w(a),n))for(o=0;r=a[o++];)Ue.test(r.type||"")&&n.push(r);return a=null,p},cleanData:function(e,t){for(var n,i,o,r,s=0,a=oe.expando,l=oe.cache,u=ne.deleteExpando,c=oe.event.special;null!=(n=e[s]);s++)if((t||oe.acceptData(n))&&(o=n[a],r=o&&l[o])){if(r.events)for(i in r.events)c[i]?oe.event.remove(n,i):oe.removeEvent(n,i,r.handle);l[o]&&(delete l[o],u?delete n[a]:typeof n.removeAttribute!==Ce?n.removeAttribute(a):n[a]=null,Y.push(o))}}}),oe.fn.extend({text:function(e){return De(this,function(e){return void 0===e?oe.text(this):this.empty().append((this[0]&&this[0].ownerDocument||he).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=y(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=y(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?oe.filter(e,this):this,o=0;null!=(n=i[o]);o++)t||1!==n.nodeType||oe.cleanData(m(n)),n.parentNode&&(t&&oe.contains(n.ownerDocument,n)&&w(m(n,"script")),n.parentNode.removeChild(n));return this},empty:function(){for(var e,t=0;null!=(e=this[t]);t++){for(1===e.nodeType&&oe.cleanData(m(e,!1));e.firstChild;)e.removeChild(e.firstChild);e.options&&oe.nodeName(e,"select")&&(e.options.length=0)}return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map(function(){return oe.clone(this,e,t)})},html:function(e){return De(this,function(e){var t=this[0]||{},n=0,i=this.length;if(void 0===e)return 1===t.nodeType?t.innerHTML.replace(Ie,""):void 0;if("string"==typeof e&&!$e.test(e)&&(ne.htmlSerialize||!Oe.test(e))&&(ne.leadingWhitespace||!Fe.test(e))&&!Ve[(Re.exec(e)||["",""])[1].toLowerCase()]){e=e.replace(qe,"<$1>");try{for(;n1&&"string"==typeof p&&!ne.checkClone&&Xe.test(p))return this.each(function(n){var i=c.eq(n);d&&(e[0]=p.call(this,n,i.html())),i.domManip(e,t)});if(u&&(a=oe.buildFragment(e,this[0].ownerDocument,!1,this),n=a.firstChild,1===a.childNodes.length&&(a=n),n)){for(r=oe.map(m(a,"script"),b),o=r.length;l
t
",o=t.getElementsByTagName("td"),o[0].style.cssText="margin:0;border:0;padding:0;display:none",a=0===o[0].offsetHeight,a&&(o[0].style.display="",o[1].style.display="none",a=0===o[0].offsetHeight),n.removeChild(i))}var n,i,o,r,s,a,l;n=he.createElement("div"),n.innerHTML="
a",o=n.getElementsByTagName("a")[0],i=o&&o.style,i&&(i.cssText="float:left;opacity:.5",ne.opacity="0.5"===i.opacity,ne.cssFloat=!!i.cssFloat,n.style.backgroundClip="content-box",n.cloneNode(!0).style.backgroundClip="",ne.clearCloneStyle="content-box"===n.style.backgroundClip,ne.boxSizing=""===i.boxSizing||""===i.MozBoxSizing||""===i.WebkitBoxSizing,oe.extend(ne,{reliableHiddenOffsets:function(){return null==a&&t(),a},boxSizingReliable:function(){return null==s&&t(),s},pixelPosition:function(){return null==r&&t(),r},reliableMarginRight:function(){return null==l&&t(),l}}))}(),oe.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};var rt=/alpha\([^)]*\)/i,st=/opacity\s*=\s*([^)]*)/,at=/^(none|table(?!-c[ea]).+)/,lt=new RegExp("^("+Ee+")(.*)$","i"),ut=new RegExp("^([+-])=("+Ee+")","i"),ct={position:"absolute",visibility:"hidden",display:"block"},ft={letterSpacing:"0",fontWeight:"400"},pt=["Webkit","O","Moz","ms"];oe.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=tt(e,"opacity");return""===n?"1":n}}}},cssNumber:{columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":ne.cssFloat?"cssFloat":"styleFloat"},style:function(e,t,n,i){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var o,r,s,a=oe.camelCase(t),l=e.style;if(t=oe.cssProps[a]||(oe.cssProps[a]=k(l,a)),s=oe.cssHooks[t]||oe.cssHooks[a],void 0===n)return s&&"get"in s&&void 0!==(o=s.get(e,!1,i))?o:l[t];if(r=typeof n,"string"===r&&(o=ut.exec(n))&&(n=(o[1]+1)*o[2]+parseFloat(oe.css(e,t)),r="number"),null!=n&&n===n&&("number"!==r||oe.cssNumber[a]||(n+="px"),ne.clearCloneStyle||""!==n||0!==t.indexOf("background")||(l[t]="inherit"),!(s&&"set"in s&&void 0===(n=s.set(e,n,i)))))try{l[t]=n}catch(u){}}},css:function(e,t,n,i){var o,r,s,a=oe.camelCase(t);return t=oe.cssProps[a]||(oe.cssProps[a]=k(e.style,a)),s=oe.cssHooks[t]||oe.cssHooks[a],s&&"get"in s&&(r=s.get(e,!0,n)),void 0===r&&(r=tt(e,t,i)),"normal"===r&&t in ft&&(r=ft[t]),""===n||n?(o=parseFloat(r),n===!0||oe.isNumeric(o)?o||0:r):r}}),oe.each(["height","width"],function(e,t){oe.cssHooks[t]={get:function(e,n,i){if(n)return at.test(oe.css(e,"display"))&&0===e.offsetWidth?oe.swap(e,ct,function(){return H(e,t,i)}):H(e,t,i)},set:function(e,n,i){var o=i&&et(e);return D(e,n,i?A(e,t,i,ne.boxSizing&&"border-box"===oe.css(e,"boxSizing",!1,o),o):0)}}}),ne.opacity||(oe.cssHooks.opacity={get:function(e,t){return st.test((t&&e.currentStyle?e.currentStyle.filter:e.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":t?"1":""},set:function(e,t){var n=e.style,i=e.currentStyle,o=oe.isNumeric(t)?"alpha(opacity="+100*t+")":"",r=i&&i.filter||n.filter||"";n.zoom=1,(t>=1||""===t)&&""===oe.trim(r.replace(rt,""))&&n.removeAttribute&&(n.removeAttribute("filter"),""===t||i&&!i.filter)||(n.filter=rt.test(r)?r.replace(rt,o):r+" "+o)}}),oe.cssHooks.marginRight=E(ne.reliableMarginRight,function(e,t){if(t)return oe.swap(e,{display:"inline-block"},tt,[e,"marginRight"])}),oe.each({margin:"",padding:"",border:"Width"},function(e,t){oe.cssHooks[e+t]={expand:function(n){for(var i=0,o={},r="string"==typeof n?n.split(" "):[n];i<4;i++)o[e+ke[i]+t]=r[i]||r[i-2]||r[0];return o}},nt.test(e)||(oe.cssHooks[e+t].set=D)}),oe.fn.extend({css:function(e,t){return De(this,function(e,t,n){var i,o,r={},s=0;if(oe.isArray(t)){for(i=et(e),o=t.length;s1)},show:function(){return S(this,!0)},hide:function(){return S(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){Se(this)?oe(this).show():oe(this).hide()})}}),oe.Tween=P,P.prototype={constructor:P,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||(oe.cssNumber[n]?"":"px")},cur:function(){var e=P.propHooks[this.prop];return e&&e.get?e.get(this):P.propHooks._default.get(this)},run:function(e){var t,n=P.propHooks[this.prop];return this.options.duration?this.pos=t=oe.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=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):P.propHooks._default.set(this),this}},P.prototype.init.prototype=P.prototype,P.propHooks={_default:{get:function(e){var t;return null==e.elem[e.prop]||e.elem.style&&null!=e.elem.style[e.prop]?(t=oe.css(e.elem,e.prop,""),t&&"auto"!==t?t:0):e.elem[e.prop]},set:function(e){oe.fx.step[e.prop]?oe.fx.step[e.prop](e):e.elem.style&&(null!=e.elem.style[oe.cssProps[e.prop]]||oe.cssHooks[e.prop])?oe.style(e.elem,e.prop,e.now+e.unit):e.elem[e.prop]=e.now}}},P.propHooks.scrollTop=P.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},oe.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2}},oe.fx=P.prototype.init,oe.fx.step={};var dt,ht,gt=/^(?:toggle|show|hide)$/,mt=new RegExp("^(?:([+-])=|)("+Ee+")([a-z%]*)$","i"),vt=/queueHooks$/,yt=[W],bt={"*":[function(e,t){var n=this.createTween(e,t),i=n.cur(),o=mt.exec(t),r=o&&o[3]||(oe.cssNumber[e]?"":"px"),s=(oe.cssNumber[e]||"px"!==r&&+i)&&mt.exec(oe.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,oe.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}]};oe.Animation=oe.extend(O,{tweener:function(e,t){oe.isFunction(e)?(t=e,e=["*"]):e=e.split(" ");for(var n,i=0,o=e.length;i
a",i=t.getElementsByTagName("a")[0],n=he.createElement("select"),o=n.appendChild(he.createElement("option")),e=t.getElementsByTagName("input")[0],i.style.cssText="top:1px",ne.getSetAttribute="t"!==t.className,ne.style=/top/.test(i.getAttribute("style")),ne.hrefNormalized="/a"===i.getAttribute("href"),ne.checkOn=!!e.value,ne.optSelected=o.selected,ne.enctype=!!he.createElement("form").enctype,n.disabled=!0,ne.optDisabled=!o.disabled,e=he.createElement("input"),e.setAttribute("value",""),ne.input=""===e.getAttribute("value"),e.value="t",e.setAttribute("type","radio"),ne.radioValue="t"===e.value}();var xt=/\r/g;oe.fn.extend({val:function(e){var t,n,i,o=this[0];{if(arguments.length)return i=oe.isFunction(e),this.each(function(n){var o;1===this.nodeType&&(o=i?e.call(this,n,oe(this).val()):e,null==o?o="":"number"==typeof o?o+="":oe.isArray(o)&&(o=oe.map(o,function(e){return null==e?"":e+""})),t=oe.valHooks[this.type]||oe.valHooks[this.nodeName.toLowerCase()],t&&"set"in t&&void 0!==t.set(this,o,"value")||(this.value=o))});if(o)return t=oe.valHooks[o.type]||oe.valHooks[o.nodeName.toLowerCase()],t&&"get"in t&&void 0!==(n=t.get(o,"value"))?n:(n=o.value,"string"==typeof n?n.replace(xt,""):null==n?"":n)}}}),oe.extend({valHooks:{option:{get:function(e){var t=oe.find.attr(e,"value");return null!=t?t:oe.trim(oe.text(e))}},select:{get:function(e){for(var t,n,i=e.options,o=e.selectedIndex,r="select-one"===e.type||o<0,s=r?null:[],a=r?o+1:i.length,l=o<0?a:r?o:0;l=0)try{i.selected=n=!0}catch(a){i.scrollHeight}else i.selected=!1;return n||(e.selectedIndex=-1),o}}}}),oe.each(["radio","checkbox"],function(){oe.valHooks[this]={set:function(e,t){if(oe.isArray(t))return e.checked=oe.inArray(oe(e).val(),t)>=0}},ne.checkOn||(oe.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})});var wt,Tt,Ct=oe.expr.attrHandle,_t=/^(?:checked|selected)$/i,Nt=ne.getSetAttribute,Et=ne.input;oe.fn.extend({attr:function(e,t){return De(this,oe.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){oe.removeAttr(this,e)})}}),oe.extend({attr:function(e,t,n){var i,o,r=e.nodeType;if(e&&3!==r&&8!==r&&2!==r)return typeof e.getAttribute===Ce?oe.prop(e,t,n):(1===r&&oe.isXMLDoc(e)||(t=t.toLowerCase(),i=oe.attrHooks[t]||(oe.expr.match.bool.test(t)?Tt:wt)),void 0===n?i&&"get"in i&&null!==(o=i.get(e,t))?o:(o=oe.find.attr(e,t),null==o?void 0:o):null!==n?i&&"set"in i&&void 0!==(o=i.set(e,n,t))?o:(e.setAttribute(t,n+""),n):void oe.removeAttr(e,t))},removeAttr:function(e,t){var n,i,o=0,r=t&&t.match(be);if(r&&1===e.nodeType)for(;n=r[o++];)i=oe.propFix[n]||n,oe.expr.match.bool.test(n)?Et&&Nt||!_t.test(n)?e[i]=!1:e[oe.camelCase("default-"+n)]=e[i]=!1:oe.attr(e,n,""),e.removeAttribute(Nt?n:i)},attrHooks:{type:{set:function(e,t){if(!ne.radioValue&&"radio"===t&&oe.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}}}),Tt={set:function(e,t,n){return t===!1?oe.removeAttr(e,n):Et&&Nt||!_t.test(n)?e.setAttribute(!Nt&&oe.propFix[n]||n,n):e[oe.camelCase("default-"+n)]=e[n]=!0,n}},oe.each(oe.expr.match.bool.source.match(/\w+/g),function(e,t){var n=Ct[t]||oe.find.attr;Ct[t]=Et&&Nt||!_t.test(t)?function(e,t,i){var o,r;return i||(r=Ct[t],Ct[t]=o,o=null!=n(e,t,i)?t.toLowerCase():null,Ct[t]=r),o}:function(e,t,n){if(!n)return e[oe.camelCase("default-"+t)]?t.toLowerCase():null}}),Et&&Nt||(oe.attrHooks.value={set:function(e,t,n){return oe.nodeName(e,"input")?void(e.defaultValue=t):wt&&wt.set(e,t,n)}}),Nt||(wt={set:function(e,t,n){var i=e.getAttributeNode(n);if(i||e.setAttributeNode(i=e.ownerDocument.createAttribute(n)),i.value=t+="","value"===n||t===e.getAttribute(n))return t}},Ct.id=Ct.name=Ct.coords=function(e,t,n){var i;if(!n)return(i=e.getAttributeNode(t))&&""!==i.value?i.value:null},oe.valHooks.button={get:function(e,t){var n=e.getAttributeNode(t);if(n&&n.specified)return n.value},set:wt.set},oe.attrHooks.contenteditable={set:function(e,t,n){wt.set(e,""!==t&&t,n)}},oe.each(["width","height"],function(e,t){oe.attrHooks[t]={set:function(e,n){if(""===n)return e.setAttribute(t,"auto"),n}}})),ne.style||(oe.attrHooks.style={get:function(e){return e.style.cssText||void 0},set:function(e,t){return e.style.cssText=t+""}});var kt=/^(?:input|select|textarea|button|object)$/i,St=/^(?:a|area)$/i;oe.fn.extend({prop:function(e,t){return De(this,oe.prop,e,t,arguments.length>1)},removeProp:function(e){return e=oe.propFix[e]||e,this.each(function(){try{this[e]=void 0,delete this[e]}catch(t){}})}}),oe.extend({propFix:{"for":"htmlFor","class":"className"},prop:function(e,t,n){var i,o,r,s=e.nodeType;if(e&&3!==s&&8!==s&&2!==s)return r=1!==s||!oe.isXMLDoc(e),r&&(t=oe.propFix[t]||t,o=oe.propHooks[t]),void 0!==n?o&&"set"in o&&void 0!==(i=o.set(e,n,t))?i:e[t]=n:o&&"get"in o&&null!==(i=o.get(e,t))?i:e[t]},propHooks:{tabIndex:{get:function(e){var t=oe.find.attr(e,"tabindex");return t?parseInt(t,10):kt.test(e.nodeName)||St.test(e.nodeName)&&e.href?0:-1}}}}),ne.hrefNormalized||oe.each(["href","src"],function(e,t){oe.propHooks[t]={get:function(e){return e.getAttribute(t,4)}}}),ne.optSelected||(oe.propHooks.selected={get:function(e){var t=e.parentNode;return t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex),null}}),oe.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){oe.propFix[this.toLowerCase()]=this}),ne.enctype||(oe.propFix.enctype="encoding");var Dt=/[\t\r\n\f]/g;oe.fn.extend({addClass:function(e){var t,n,i,o,r,s,a=0,l=this.length,u="string"==typeof e&&e;if(oe.isFunction(e))return this.each(function(t){oe(this).addClass(e.call(this,t,this.className))});if(u)for(t=(e||"").match(be)||[];a=0;)i=i.replace(" "+o+" "," ");s=e?oe.trim(i):"",n.className!==s&&(n.className=s)}return this},toggleClass:function(e,t){var n=typeof e;return"boolean"==typeof t&&"string"===n?t?this.addClass(e):this.removeClass(e):oe.isFunction(e)?this.each(function(n){oe(this).toggleClass(e.call(this,n,this.className,t),t)}):this.each(function(){if("string"===n)for(var t,i=0,o=oe(this),r=e.match(be)||[];t=r[i++];)o.hasClass(t)?o.removeClass(t):o.addClass(t);else n!==Ce&&"boolean"!==n||(this.className&&oe._data(this,"__className__",this.className),this.className=this.className||e===!1?"":oe._data(this,"__className__")||"")})},hasClass:function(e){for(var t=" "+e+" ",n=0,i=this.length;n=0)return!0;return!1}}),oe.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){oe.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}}),oe.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 At=oe.now(),Ht=/\?/,Pt=/^[\],:{}\s]*$/,jt=/(?:^|:|,)(?:\s*\[)+/g,Lt=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,Mt=/"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g;oe.parseJSON=function(t){return e.JSON&&e.JSON.parse?e.JSON.parse(t):null===t?t:"string"==typeof t&&(t=oe.trim(t),t&&Pt.test(t.replace(Lt,"@").replace(Mt,"]").replace(jt,"")))?new Function("return "+t)():void oe.error("Invalid JSON: "+t)},oe.parseXML=function(t){var n,i;if(!t||"string"!=typeof t)return null;try{e.DOMParser?(i=new DOMParser,n=i.parseFromString(t,"text/xml")):(n=new ActiveXObject("Microsoft.XMLDOM"),n.async="false",n.loadXML(t))}catch(o){n=void 0}return n&&n.documentElement&&!n.getElementsByTagName("parsererror").length||oe.error("Invalid XML: "+t),n};var Wt,It,Ot=/#.*$/,Ft=/([?&])_=[^&]*/,qt=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Rt=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Bt=/^(?:GET|HEAD)$/,zt=/^\/\//,$t=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,Xt={},Ut={},Qt="*/".concat("*");try{It=location.href}catch(Yt){It=he.createElement("a"),It.href="",It=It.href}Wt=$t.exec(It.toLowerCase())||[],oe.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:It,type:"GET",isLocal:Rt.test(Wt[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Qt,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":oe.parseJSON,"text xml":oe.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?R(R(e,oe.ajaxSettings),t):R(oe.ajaxSettings,e)},ajaxPrefilter:F(Xt),ajaxTransport:F(Ut),ajax:function(e,t){function n(e,t,n,i){var o,c,v,y,x,T=t;2!==b&&(b=2,a&&clearTimeout(a),u=void 0,s=i||"",w.readyState=e>0?4:0,o=e>=200&&e<300||304===e,n&&(y=B(f,w,n)),y=z(f,y,w,o),o?(f.ifModified&&(x=w.getResponseHeader("Last-Modified"),x&&(oe.lastModified[r]=x),x=w.getResponseHeader("etag"),x&&(oe.etag[r]=x)),204===e||"HEAD"===f.type?T="nocontent":304===e?T="notmodified":(T=y.state,c=y.data,v=y.error,o=!v)):(v=T,!e&&T||(T="error",e<0&&(e=0))),w.status=e,w.statusText=(t||T)+"",o?h.resolveWith(p,[c,T,w]):h.rejectWith(p,[w,T,v]),w.statusCode(m),m=void 0,l&&d.trigger(o?"ajaxSuccess":"ajaxError",[w,f,o?c:v]),g.fireWith(p,[w,T]),l&&(d.trigger("ajaxComplete",[w,f]),--oe.active||oe.event.trigger("ajaxStop")))}"object"==typeof e&&(t=e,e=void 0),t=t||{};var i,o,r,s,a,l,u,c,f=oe.ajaxSetup({},t),p=f.context||f,d=f.context&&(p.nodeType||p.jquery)?oe(p):oe.event,h=oe.Deferred(),g=oe.Callbacks("once memory"),m=f.statusCode||{},v={},y={},b=0,x="canceled",w={readyState:0,getResponseHeader:function(e){var t;if(2===b){if(!c)for(c={};t=qt.exec(s);)c[t[1].toLowerCase()]=t[2];t=c[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return 2===b?s:null},setRequestHeader:function(e,t){var n=e.toLowerCase();return b||(e=y[n]=y[n]||e,v[e]=t),this},overrideMimeType:function(e){return b||(f.mimeType=e),this},statusCode:function(e){var t;if(e)if(b<2)for(t in e)m[t]=[m[t],e[t]];else w.always(e[w.status]);return this},abort:function(e){var t=e||x;return u&&u.abort(t),n(0,t),this}};if(h.promise(w).complete=g.add,w.success=w.done,w.error=w.fail,f.url=((e||f.url||It)+"").replace(Ot,"").replace(zt,Wt[1]+"//"),f.type=t.method||t.type||f.method||f.type,f.dataTypes=oe.trim(f.dataType||"*").toLowerCase().match(be)||[""],null==f.crossDomain&&(i=$t.exec(f.url.toLowerCase()),f.crossDomain=!(!i||i[1]===Wt[1]&&i[2]===Wt[2]&&(i[3]||("http:"===i[1]?"80":"443"))===(Wt[3]||("http:"===Wt[1]?"80":"443")))),f.data&&f.processData&&"string"!=typeof f.data&&(f.data=oe.param(f.data,f.traditional)),q(Xt,f,t,w),2===b)return w;l=oe.event&&f.global,l&&0===oe.active++&&oe.event.trigger("ajaxStart"),f.type=f.type.toUpperCase(),f.hasContent=!Bt.test(f.type),r=f.url,f.hasContent||(f.data&&(r=f.url+=(Ht.test(r)?"&":"?")+f.data,delete f.data),f.cache===!1&&(f.url=Ft.test(r)?r.replace(Ft,"$1_="+At++):r+(Ht.test(r)?"&":"?")+"_="+At++)),f.ifModified&&(oe.lastModified[r]&&w.setRequestHeader("If-Modified-Since",oe.lastModified[r]),oe.etag[r]&&w.setRequestHeader("If-None-Match",oe.etag[r])),(f.data&&f.hasContent&&f.contentType!==!1||t.contentType)&&w.setRequestHeader("Content-Type",f.contentType),w.setRequestHeader("Accept",f.dataTypes[0]&&f.accepts[f.dataTypes[0]]?f.accepts[f.dataTypes[0]]+("*"!==f.dataTypes[0]?", "+Qt+"; q=0.01":""):f.accepts["*"]);for(o in f.headers)w.setRequestHeader(o,f.headers[o]);if(f.beforeSend&&(f.beforeSend.call(p,w,f)===!1||2===b))return w.abort();x="abort";for(o in{success:1,error:1,complete:1})w[o](f[o]);if(u=q(Ut,f,t,w)){w.readyState=1,l&&d.trigger("ajaxSend",[w,f]),f.async&&f.timeout>0&&(a=setTimeout(function(){w.abort("timeout")},f.timeout));try{b=1,u.send(v,n)}catch(T){if(!(b<2))throw T;n(-1,T)}}else n(-1,"No Transport");return w},getJSON:function(e,t,n){return oe.get(e,t,n,"json")},getScript:function(e,t){return oe.get(e,void 0,t,"script")}}),oe.each(["get","post"],function(e,t){oe[t]=function(e,n,i,o){return oe.isFunction(n)&&(o=o||i,i=n,n=void 0),oe.ajax({url:e,type:t,dataType:o,data:n,success:i})}}),oe._evalUrl=function(e){return oe.ajax({url:e,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})},oe.fn.extend({wrapAll:function(e){if(oe.isFunction(e))return this.each(function(t){oe(this).wrapAll(e.call(this,t))});if(this[0]){var t=oe(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){for(var e=this;e.firstChild&&1===e.firstChild.nodeType;)e=e.firstChild;return e}).append(this)}return this},wrapInner:function(e){return oe.isFunction(e)?this.each(function(t){oe(this).wrapInner(e.call(this,t))}):this.each(function(){var t=oe(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=oe.isFunction(e);return this.each(function(n){oe(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){oe.nodeName(this,"body")||oe(this).replaceWith(this.childNodes)}).end()}}),oe.expr.filters.hidden=function(e){return e.offsetWidth<=0&&e.offsetHeight<=0||!ne.reliableHiddenOffsets()&&"none"===(e.style&&e.style.display||oe.css(e,"display"))},oe.expr.filters.visible=function(e){return!oe.expr.filters.hidden(e)};var Vt=/%20/g,Gt=/\[\]$/,Kt=/\r?\n/g,Jt=/^(?:submit|button|image|reset|file)$/i,Zt=/^(?:input|select|textarea|keygen)/i;oe.param=function(e,t){var n,i=[],o=function(e,t){t=oe.isFunction(t)?t():null==t?"":t,i[i.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};if(void 0===t&&(t=oe.ajaxSettings&&oe.ajaxSettings.traditional),oe.isArray(e)||e.jquery&&!oe.isPlainObject(e))oe.each(e,function(){o(this.name,this.value)});else for(n in e)$(n,e[n],t,o);return i.join("&").replace(Vt,"+")},oe.fn.extend({serialize:function(){return oe.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=oe.prop(this,"elements");return e?oe.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!oe(this).is(":disabled")&&Zt.test(this.nodeName)&&!Jt.test(e)&&(this.checked||!Ae.test(e))}).map(function(e,t){var n=oe(this).val();return null==n?null:oe.isArray(n)?oe.map(n,function(e){return{name:t.name,value:e.replace(Kt,"\r\n")}}):{name:t.name,value:n.replace(Kt,"\r\n")}}).get()}}),oe.ajaxSettings.xhr=void 0!==e.ActiveXObject?function(){return!this.isLocal&&/^(get|post|head|put|delete|options)$/i.test(this.type)&&X()||U()}:X;var en=0,tn={},nn=oe.ajaxSettings.xhr();e.attachEvent&&e.attachEvent("onunload",function(){for(var e in tn)tn[e](void 0,!0)}),ne.cors=!!nn&&"withCredentials"in nn,nn=ne.ajax=!!nn,nn&&oe.ajaxTransport(function(e){if(!e.crossDomain||ne.cors){var t;return{send:function(n,i){var o,r=e.xhr(),s=++en;if(r.open(e.type,e.url,e.async,e.username,e.password),e.xhrFields)for(o in e.xhrFields)r[o]=e.xhrFields[o];e.mimeType&&r.overrideMimeType&&r.overrideMimeType(e.mimeType),e.crossDomain||n["X-Requested-With"]||(n["X-Requested-With"]="XMLHttpRequest");for(o in n)void 0!==n[o]&&r.setRequestHeader(o,n[o]+"");r.send(e.hasContent&&e.data||null),t=function(n,o){var a,l,u;if(t&&(o||4===r.readyState))if(delete tn[s],t=void 0,r.onreadystatechange=oe.noop,o)4!==r.readyState&&r.abort();else{u={},a=r.status,"string"==typeof r.responseText&&(u.text=r.responseText);try{l=r.statusText}catch(c){l=""}a||!e.isLocal||e.crossDomain?1223===a&&(a=204):a=u.text?200:404}u&&i(a,l,u,r.getAllResponseHeaders())},e.async?4===r.readyState?setTimeout(t):r.onreadystatechange=tn[s]=t:t()},abort:function(){t&&t(void 0,!0)}}}}),oe.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(e){return oe.globalEval(e),e}}}),oe.ajaxPrefilter("script",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET",e.global=!1)}),oe.ajaxTransport("script",function(e){if(e.crossDomain){var t,n=he.head||oe("head")[0]||he.documentElement;return{send:function(i,o){t=he.createElement("script"),t.async=!0,e.scriptCharset&&(t.charset=e.scriptCharset),t.src=e.url,t.onload=t.onreadystatechange=function(e,n){(n||!t.readyState||/loaded|complete/.test(t.readyState))&&(t.onload=t.onreadystatechange=null,t.parentNode&&t.parentNode.removeChild(t),t=null,n||o(200,"success"))},n.insertBefore(t,n.firstChild)},abort:function(){t&&t.onload(void 0,!0)}}}});var on=[],rn=/(=)\?(?=&|$)|\?\?/;oe.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=on.pop()||oe.expando+"_"+At++;return this[e]=!0,e}}),oe.ajaxPrefilter("json jsonp",function(t,n,i){var o,r,s,a=t.jsonp!==!1&&(rn.test(t.url)?"url":"string"==typeof t.data&&!(t.contentType||"").indexOf("application/x-www-form-urlencoded")&&rn.test(t.data)&&"data");if(a||"jsonp"===t.dataTypes[0])return o=t.jsonpCallback=oe.isFunction(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,a?t[a]=t[a].replace(rn,"$1"+o):t.jsonp!==!1&&(t.url+=(Ht.test(t.url)?"&":"?")+t.jsonp+"="+o),t.converters["script json"]=function(){return s||oe.error(o+" was not called"),s[0]},t.dataTypes[0]="json",r=e[o],e[o]=function(){s=arguments},i.always(function(){e[o]=r,t[o]&&(t.jsonpCallback=n.jsonpCallback,on.push(o)),s&&oe.isFunction(r)&&r(s[0]),s=r=void 0}),"script"}),oe.parseHTML=function(e,t,n){if(!e||"string"!=typeof e)return null;"boolean"==typeof t&&(n=t,t=!1),t=t||he;var i=fe.exec(e),o=!n&&[];return i?[t.createElement(i[1])]:(i=oe.buildFragment([e],t,o),o&&o.length&&oe(o).remove(),oe.merge([],i.childNodes))};var sn=oe.fn.load;oe.fn.load=function(e,t,n){if("string"!=typeof e&&sn)return sn.apply(this,arguments);var i,o,r,s=this,a=e.indexOf(" ");return a>=0&&(i=oe.trim(e.slice(a,e.length)),e=e.slice(0,a)),oe.isFunction(t)?(n=t,t=void 0):t&&"object"==typeof t&&(r="POST"),s.length>0&&oe.ajax({url:e,type:r,dataType:"html",data:t}).done(function(e){o=arguments,s.html(i?oe("
").append(oe.parseHTML(e)).find(i):e)}).complete(n&&function(e,t){s.each(n,o||[e.responseText,t,e])}),this},oe.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){oe.fn[t]=function(e){return this.on(t,e)}}),oe.expr.filters.animated=function(e){return oe.grep(oe.timers,function(t){return e===t.elem}).length};var an=e.document.documentElement;oe.offset={setOffset:function(e,t,n){var i,o,r,s,a,l,u,c=oe.css(e,"position"),f=oe(e),p={};"static"===c&&(e.style.position="relative"),a=f.offset(),r=oe.css(e,"top"),l=oe.css(e,"left"),u=("absolute"===c||"fixed"===c)&&oe.inArray("auto",[r,l])>-1,u?(i=f.position(),s=i.top,o=i.left):(s=parseFloat(r)||0,o=parseFloat(l)||0),oe.isFunction(t)&&(t=t.call(e,n,a)),null!=t.top&&(p.top=t.top-a.top+s),null!=t.left&&(p.left=t.left-a.left+o),"using"in t?t.using.call(e,p):f.css(p)}},oe.fn.extend({offset:function(e){if(arguments.length)return void 0===e?this:this.each(function(t){oe.offset.setOffset(this,e,t)});var t,n,i={top:0,left:0},o=this[0],r=o&&o.ownerDocument;if(r)return t=r.documentElement,oe.contains(t,o)?(typeof o.getBoundingClientRect!==Ce&&(i=o.getBoundingClientRect()),n=Q(r),{top:i.top+(n.pageYOffset||t.scrollTop)-(t.clientTop||0),left:i.left+(n.pageXOffset||t.scrollLeft)-(t.clientLeft||0)}):i},position:function(){if(this[0]){var e,t,n={top:0,left:0},i=this[0];return"fixed"===oe.css(i,"position")?t=i.getBoundingClientRect():(e=this.offsetParent(),t=this.offset(),oe.nodeName(e[0],"html")||(n=e.offset()),n.top+=oe.css(e[0],"borderTopWidth",!0),n.left+=oe.css(e[0],"borderLeftWidth",!0)),{top:t.top-n.top-oe.css(i,"marginTop",!0),left:t.left-n.left-oe.css(i,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var e=this.offsetParent||an;e&&!oe.nodeName(e,"html")&&"static"===oe.css(e,"position");)e=e.offsetParent;return e||an})}}),oe.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,t){var n=/Y/.test(t);oe.fn[e]=function(i){return De(this,function(e,i,o){var r=Q(e);return void 0===o?r?t in r?r[t]:r.document.documentElement[i]:e[i]:void(r?r.scrollTo(n?oe(r).scrollLeft():o,n?o:oe(r).scrollTop()):e[i]=o)},e,i,arguments.length,null)}}),oe.each(["top","left"],function(e,t){oe.cssHooks[t]=E(ne.pixelPosition,function(e,n){if(n)return n=tt(e,t),it.test(n)?oe(e).position()[t]+"px":n})}),oe.each({Height:"height",Width:"width"},function(e,t){oe.each({padding:"inner"+e,content:t,"":"outer"+e},function(n,i){oe.fn[i]=function(i,o){var r=arguments.length&&(n||"boolean"!=typeof i),s=n||(i===!0||o===!0?"margin":"border");return De(this,function(t,n,i){var o;return oe.isWindow(t)?t.document.documentElement["client"+e]:9===t.nodeType?(o=t.documentElement, -Math.max(t.body["scroll"+e],o["scroll"+e],t.body["offset"+e],o["offset"+e],o["client"+e])):void 0===i?oe.css(t,n,s):oe.style(t,n,i,s)},t,r?i:void 0,r,null)}})}),oe.fn.size=function(){return this.length},oe.fn.andSelf=oe.fn.addBack,"function"==typeof define&&define.amd&&define("jquery",[],function(){return oe});var ln=e.jQuery,un=e.$;return oe.noConflict=function(t){return e.$===oe&&(e.$=un),t&&e.jQuery===oe&&(e.jQuery=ln),oe},typeof t===Ce&&(e.jQuery=e.$=oe),oe}),function(e){"function"==typeof define&&define.amd?define(["jquery"],e):e(jQuery)}(function(e){function t(t,i){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&&n(s))):(/^(input|select|textarea|button|object)$/.test(a)?!t.disabled:"a"===a?t.href||i:i)&&n(t)}function n(t){return e.expr.filters.visible(t)&&!e(t).parents().addBack().filter(function(){return"hidden"===e.css(this,"visibility")}).length}e.ui=e.ui||{},e.extend(e.ui,{version:"1.11.4",keyCode:{BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38}}),e.fn.extend({scrollParent:function(t){var n=this.css("position"),i="absolute"===n,o=t?/(auto|scroll|hidden)/:/(auto|scroll)/,r=this.parents().filter(function(){var t=e(this);return(!i||"static"!==t.css("position"))&&o.test(t.css("overflow")+t.css("overflow-y")+t.css("overflow-x"))}).eq(0);return"fixed"!==n&&r.length?r:e(this[0].ownerDocument||document)},uniqueId:function(){var e=0;return function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++e)})}}(),removeUniqueId:function(){return this.each(function(){/^ui-id-\d+$/.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(n){return t(n,!isNaN(e.attr(n,"tabindex")))},tabbable:function(n){var i=e.attr(n,"tabindex"),o=isNaN(i);return(o||i>=0)&&t(n,!o)}}),e("").outerWidth(1).jquery||e.each(["Width","Height"],function(t,n){function i(t,n,i,r){return e.each(o,function(){n-=parseFloat(e.css(t,"padding"+this))||0,i&&(n-=parseFloat(e.css(t,"border"+this+"Width"))||0),r&&(n-=parseFloat(e.css(t,"margin"+this))||0)}),n}var o="Width"===n?["Left","Right"]:["Top","Bottom"],r=n.toLowerCase(),s={innerWidth:e.fn.innerWidth,innerHeight:e.fn.innerHeight,outerWidth:e.fn.outerWidth,outerHeight:e.fn.outerHeight};e.fn["inner"+n]=function(t){return void 0===t?s["inner"+n].call(this):this.each(function(){e(this).css(r,i(this,t)+"px")})},e.fn["outer"+n]=function(t,o){return"number"!=typeof t?s["outer"+n].call(this,t):this.each(function(){e(this).css(r,i(this,t,!0,o)+"px")})}}),e.fn.addBack||(e.fn.addBack=function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}),e("").data("a-b","a").removeData("a-b").data("a-b")&&(e.fn.removeData=function(t){return function(n){return arguments.length?t.call(this,e.camelCase(n)):t.call(this)}}(e.fn.removeData)),e.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase()),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),disableSelection:function(){var e="onselectstart"in document.createElement("div")?"selectstart":"mousedown";return function(){return this.bind(e+".ui-disableSelection",function(e){e.preventDefault()})}}(),enableSelection:function(){return this.unbind(".ui-disableSelection")},zIndex:function(t){if(void 0!==t)return this.css("zIndex",t);if(this.length)for(var n,i,o=e(this[0]);o.length&&o[0]!==document;){if(n=o.css("position"),("absolute"===n||"relative"===n||"fixed"===n)&&(i=parseInt(o.css("zIndex"),10),!isNaN(i)&&0!==i))return i;o=o.parent()}return 0}}),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,i){var o,r=e.plugins[t];if(r&&(i||e.element[0].parentNode&&11!==e.element[0].parentNode.nodeType))for(o=0;o",options:{disabled:!1,create:null},_createWidget:function(t,n){n=e(n||this.defaultElement||this)[0],this.element=e(n),this.uuid=i++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=e(),this.hoverable=e(),this.focusable=e(),n!==this&&(e.data(n,this.widgetFullName,this),this._on(!0,this.element,{remove:function(e){e.target===n&&this.destroy()}}),this.document=e(n.style?n.ownerDocument:n.document||n),this.window=e(this.document[0].defaultView||this.document[0].parentWindow)),this.options=e.widget.extend({},this.options,this._getCreateOptions(),t),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.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(t,n){var i,o,r,s=t;if(0===arguments.length)return e.widget.extend({},this.options);if("string"==typeof t)if(s={},i=t.split("."),t=i.shift(),i.length){for(o=s[t]=e.widget.extend({},this.options[t]),r=0;r=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}});!function(){function t(e,t,n){return[parseFloat(e[0])*(d.test(e[0])?t/100:1),parseFloat(e[1])*(d.test(e[1])?n/100:1)]}function n(t,n){return parseInt(e.css(t,n),10)||0}function i(t){var n=t[0];return 9===n.nodeType?{width:t.width(),height:t.height(),offset:{top:0,left:0}}:e.isWindow(n)?{width:t.width(),height:t.height(),offset:{top:t.scrollTop(),left:t.scrollLeft()}}:n.preventDefault?{width:0,height:0,offset:{top:n.pageY,left:n.pageX}}:{width:t.outerWidth(),height:t.outerHeight(),offset:t.offset()}}e.ui=e.ui||{};var o,r,s=Math.max,a=Math.abs,l=Math.round,u=/left|center|right/,c=/top|center|bottom/,f=/[\+\-]\d+(\.[\d]+)?%?/,p=/^\w+/,d=/%$/,h=e.fn.position;e.position={scrollbarWidth:function(){if(void 0!==o)return o;var t,n,i=e("
"),r=i.children()[0];return e("body").append(i),t=r.offsetWidth,i.css("overflow","scroll"),n=r.offsetWidth,t===n&&(n=i[0].clientWidth),i.remove(),o=t-n},getScrollInfo:function(t){var n=t.isWindow||t.isDocument?"":t.element.css("overflow-x"),i=t.isWindow||t.isDocument?"":t.element.css("overflow-y"),o="scroll"===n||"auto"===n&&t.width0?"right":"center",vertical:r<0?"top":i>0?"bottom":"middle"};gs(a(i),a(r))?l.important="horizontal":l.important="vertical",o.using.call(this,e,l)}),c.offset(e.extend(k,{using:u}))})},e.ui.position={fit:{left:function(e,t){var n,i=t.within,o=i.isWindow?i.scrollLeft:i.offset.left,r=i.width,a=e.left-t.collisionPosition.marginLeft,l=o-a,u=a+t.collisionWidth-r-o;t.collisionWidth>r?l>0&&u<=0?(n=e.left+l+t.collisionWidth-r-o,e.left+=l-n):u>0&&l<=0?e.left=o:l>u?e.left=o+r-t.collisionWidth:e.left=o:l>0?e.left+=l:u>0?e.left-=u:e.left=s(e.left-a,e.left)},top:function(e,t){var n,i=t.within,o=i.isWindow?i.scrollTop:i.offset.top,r=t.within.height,a=e.top-t.collisionPosition.marginTop,l=o-a,u=a+t.collisionHeight-r-o;t.collisionHeight>r?l>0&&u<=0?(n=e.top+l+t.collisionHeight-r-o,e.top+=l-n):u>0&&l<=0?e.top=o:l>u?e.top=o+r-t.collisionHeight:e.top=o:l>0?e.top+=l:u>0?e.top-=u:e.top=s(e.top-a,e.top)}},flip:{left:function(e,t){var n,i,o=t.within,r=o.offset.left+o.scrollLeft,s=o.width,l=o.isWindow?o.scrollLeft:o.offset.left,u=e.left-t.collisionPosition.marginLeft,c=u-l,f=u+t.collisionWidth-s-l,p="left"===t.my[0]?-t.elemWidth:"right"===t.my[0]?t.elemWidth:0,d="left"===t.at[0]?t.targetWidth:"right"===t.at[0]?-t.targetWidth:0,h=-2*t.offset[0];c<0?(n=e.left+p+d+h+t.collisionWidth-s-r,(n<0||n0&&(i=e.left-t.collisionPosition.marginLeft+p+d+h-l,(i>0||a(i)0&&(n=e.top-t.collisionPosition.marginTop+d+h+g-l,(n>0||a(n)10&&o<11,t.innerHTML="",n.removeChild(t)}()}();e.ui.position;e.widget("ui.draggable",e.ui.mouse,{version:"1.11.4",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&&this._setPositionRelative(),this.options.addClasses&&this.element.addClass("ui-draggable"),this.options.disabled&&this.element.addClass("ui-draggable-disabled"),this._setHandleClassName(),this._mouseInit()},_setOption:function(e,t){this._super(e,t),"handle"===e&&(this._removeHandleClassName(),this._setHandleClassName())},_destroy:function(){return(this.helper||this.element).is(".ui-draggable-dragging")?void(this.destroyOnClear=!0):(this.element.removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled"),this._removeHandleClassName(),void this._mouseDestroy())},_mouseCapture:function(t){var n=this.options;return this._blurActiveElement(t),!(this.helper||n.disabled||e(t.target).closest(".ui-resizable-handle").length>0)&&(this.handle=this._getHandle(t),!!this.handle&&(this._blockFrames(n.iframeFix===!0?"iframe":n.iframeFix),!0))},_blockFrames:function(t){this.iframeBlocks=this.document.find(t).map(function(){var t=e(this);return e("
").css("position","absolute").appendTo(t.parent()).outerWidth(t.outerWidth()).outerHeight(t.outerHeight()).offset(t.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_blurActiveElement:function(t){var n=this.document[0];if(this.handleElement.is(t.target))try{n.activeElement&&"body"!==n.activeElement.nodeName.toLowerCase()&&e(n.activeElement).blur()}catch(i){}},_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(!0),this.offsetParent=this.helper.offsetParent(),this.hasFixedAncestor=this.helper.parents().filter(function(){return"fixed"===e(this).css("position")}).length>0,this.positionAbs=this.element.offset(),this._refreshOffsets(t),this.originalPosition=this.position=this._generatePosition(t,!1),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._normalizeRightBottom(),this._mouseDrag(t,!0),e.ui.ddmanager&&e.ui.ddmanager.dragStart(this,t),!0)},_refreshOffsets:function(e){this.offset={top:this.positionAbs.top-this.margins.top,left:this.positionAbs.left-this.margins.left,scroll:!1,parent:this._getParentOffset(),relative:this._getRelativeOffset()},this.offset.click={left:e.pageX-this.offset.left,top:e.pageY-this.offset.top}},_mouseDrag:function(t,n){if(this.hasFixedAncestor&&(this.offset.parent=this._getParentOffset()),this.position=this._generatePosition(t,!0),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.helper[0].style.left=this.position.left+"px",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),"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},_mouseUp:function(t){return this._unblockFrames(),e.ui.ddmanager&&e.ui.ddmanager.dragStop(this,t),this.handleElement.is(t.target)&&this.element.focus(),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},_setHandleClassName:function(){this.handleElement=this.options.handle?this.element.find(this.options.handle):this.element,this.handleElement.addClass("ui-draggable-handle")},_removeHandleClassName:function(){this.handleElement.removeClass("ui-draggable-handle")},_createHelper:function(t){var n=this.options,i=e.isFunction(n.helper),o=i?e(n.helper.apply(this.element[0],[t])):"clone"===n.helper?this.element.clone().removeAttr("id"):this.element;return o.parents("body").length||o.appendTo("parent"===n.appendTo?this.element[0].parentNode:n.appendTo),i&&o[0]===this.element[0]&&this._setPositionRelative(),o[0]===this.element[0]||/(fixed|absolute)/.test(o.css("position"))||o.css("position","absolute"),o},_setPositionRelative:function(){/^(?:r|a|f)/.test(this.element.css("position"))||(this.element[0].style.position="relative")},_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)},_isRootNode:function(e){return/(html|body)/i.test(e.tagName)||e===this.document[0]},_getParentOffset:function(){var t=this.offsetParent.offset(),n=this.document[0];return"absolute"===this.cssPosition&&this.scrollParent[0]!==n&&e.contains(this.scrollParent[0],this.offsetParent[0])&&(t.left+=this.scrollParent.scrollLeft(),t.top+=this.scrollParent.scrollTop()),this._isRootNode(this.offsetParent[0])&&(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)return{top:0,left:0};var e=this.element.position(),t=this._isRootNode(this.scrollParent[0]);return{top:e.top-(parseInt(this.helper.css("top"),10)||0)+(t?0:this.scrollParent.scrollTop()),left:e.left-(parseInt(this.helper.css("left"),10)||0)+(t?0:this.scrollParent.scrollLeft())}},_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,r=this.document[0];return this.relativeContainer=null,o.containment?"window"===o.containment?void(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()||r.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]):"document"===o.containment?void(this.containment=[0,0,e(r).width()-this.helperProportions.width-this.margins.left,(e(r).height()||r.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]):o.containment.constructor===Array?void(this.containment=o.containment):("parent"===o.containment&&(o.containment=this.helper[0].parentNode),n=e(o.containment),i=n[0],void(i&&(t=/(scroll|auto)/.test(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.relativeContainer=n))):void(this.containment=null)},_convertPositionTo:function(e,t){t||(t=this.position);var n="absolute"===e?1:-1,i=this._isRootNode(this.scrollParent[0]);return{top:t.top+this.offset.relative.top*n+this.offset.parent.top*n-("fixed"===this.cssPosition?-this.offset.scroll.top:i?0:this.offset.scroll.top)*n,left:t.left+this.offset.relative.left*n+this.offset.parent.left*n-("fixed"===this.cssPosition?-this.offset.scroll.left:i?0:this.offset.scroll.left)*n}},_generatePosition:function(e,t){var n,i,o,r,s=this.options,a=this._isRootNode(this.scrollParent[0]),l=e.pageX,u=e.pageY;return a&&this.offset.scroll||(this.offset.scroll={top:this.scrollParent.scrollTop(),left:this.scrollParent.scrollLeft()}),t&&(this.containment&&(this.relativeContainer?(i=this.relativeContainer.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,e.pageX-this.offset.click.leftn[2]&&(l=n[2]+this.offset.click.left),e.pageY-this.offset.click.top>n[3]&&(u=n[3]+this.offset.click.top)),s.grid&&(o=s.grid[1]?this.originalPageY+Math.round((u-this.originalPageY)/s.grid[1])*s.grid[1]:this.originalPageY,u=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),"y"===s.axis&&(l=this.originalPageX),"x"===s.axis&&(u=this.originalPageY)),{top:u-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.offset.scroll.top:a?0:this.offset.scroll.top),left:l-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.offset.scroll.left:a?0: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,this.destroyOnClear&&this.destroy()},_normalizeRightBottom:function(){"y"!==this.options.axis&&"auto"!==this.helper.css("right")&&(this.helper.width(this.helper.width()),this.helper.css("right","auto")),"x"!==this.options.axis&&"auto"!==this.helper.css("bottom")&&(this.helper.height(this.helper.height()),this.helper.css("bottom","auto"))},_trigger:function(t,n,i){return i=i||this._uiHash(),e.ui.plugin.call(this,t,[n,i,this],!0),/^(drag|start|stop)/.test(t)&&(this.positionAbs=this._convertPositionTo("absolute"),i.offset=this.positionAbs),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,i){var o=e.extend({},n,{item:i.element});i.sortables=[],e(i.options.connectToSortable).each(function(){var n=e(this).sortable("instance");n&&!n.options.disabled&&(i.sortables.push(n),n.refreshPositions(),n._trigger("activate",t,o))})},stop:function(t,n,i){var o=e.extend({},n,{item:i.element});i.cancelHelperRemoval=!1,e.each(i.sortables,function(){var e=this;e.isOver?(e.isOver=0,i.cancelHelperRemoval=!0,e.cancelHelperRemoval=!1, -e._storedCSS={position:e.placeholder.css("position"),top:e.placeholder.css("top"),left:e.placeholder.css("left")},e._mouseStop(t),e.options.helper=e.options._helper):(e.cancelHelperRemoval=!0,e._trigger("deactivate",t,o))})},drag:function(t,n,i){e.each(i.sortables,function(){var o=!1,r=this;r.positionAbs=i.positionAbs,r.helperProportions=i.helperProportions,r.offset.click=i.offset.click,r._intersectsWith(r.containerCache)&&(o=!0,e.each(i.sortables,function(){return this.positionAbs=i.positionAbs,this.helperProportions=i.helperProportions,this.offset.click=i.offset.click,this!==r&&this._intersectsWith(this.containerCache)&&e.contains(r.element[0],this.element[0])&&(o=!1),o})),o?(r.isOver||(r.isOver=1,i._parent=n.helper.parent(),r.currentItem=n.helper.appendTo(r.element).data("ui-sortable-item",!0),r.options._helper=r.options.helper,r.options.helper=function(){return n.helper[0]},t.target=r.currentItem[0],r._mouseCapture(t,!0),r._mouseStart(t,!0,!0),r.offset.click.top=i.offset.click.top,r.offset.click.left=i.offset.click.left,r.offset.parent.left-=i.offset.parent.left-r.offset.parent.left,r.offset.parent.top-=i.offset.parent.top-r.offset.parent.top,i._trigger("toSortable",t),i.dropped=r.element,e.each(i.sortables,function(){this.refreshPositions()}),i.currentItem=i.element,r.fromOutside=i),r.currentItem&&(r._mouseDrag(t),n.position=r.position)):r.isOver&&(r.isOver=0,r.cancelHelperRemoval=!0,r.options._revert=r.options.revert,r.options.revert=!1,r._trigger("out",t,r._uiHash(r)),r._mouseStop(t,!0),r.options.revert=r.options._revert,r.options.helper=r.options._helper,r.placeholder&&r.placeholder.remove(),n.helper.appendTo(i._parent),i._refreshOffsets(t),n.position=i._generatePosition(t,!0),i._trigger("fromSortable",t),i.dropped=!1,e.each(i.sortables,function(){this.refreshPositions()}))})}}),e.ui.plugin.add("draggable","cursor",{start:function(t,n,i){var o=e("body"),r=i.options;o.css("cursor")&&(r._cursor=o.css("cursor")),o.css("cursor",r.cursor)},stop:function(t,n,i){var o=i.options;o._cursor&&e("body").css("cursor",o._cursor)}}),e.ui.plugin.add("draggable","opacity",{start:function(t,n,i){var o=e(n.helper),r=i.options;o.css("opacity")&&(r._opacity=o.css("opacity")),o.css("opacity",r.opacity)},stop:function(t,n,i){var o=i.options;o._opacity&&e(n.helper).css("opacity",o._opacity)}}),e.ui.plugin.add("draggable","scroll",{start:function(e,t,n){n.scrollParentNotHidden||(n.scrollParentNotHidden=n.helper.scrollParent(!1)),n.scrollParentNotHidden[0]!==n.document[0]&&"HTML"!==n.scrollParentNotHidden[0].tagName&&(n.overflowOffset=n.scrollParentNotHidden.offset())},drag:function(t,n,i){var o=i.options,r=!1,s=i.scrollParentNotHidden[0],a=i.document[0];s!==a&&"HTML"!==s.tagName?(o.axis&&"x"===o.axis||(i.overflowOffset.top+s.offsetHeight-t.pageY=0;p--)l=i.snapElements[p].left-i.margins.left,u=l+i.snapElements[p].width,c=i.snapElements[p].top-i.margins.top,f=c+i.snapElements[p].height,vu+g||bf+g||!e.contains(i.snapElements[p].item.ownerDocument,i.snapElements[p].item)?(i.snapElements[p].snapping&&i.options.snap.release&&i.options.snap.release.call(i.element,t,e.extend(i._uiHash(),{snapItem:i.snapElements[p].item})),i.snapElements[p].snapping=!1):("inner"!==h.snapMode&&(o=Math.abs(c-b)<=g,r=Math.abs(f-y)<=g,s=Math.abs(l-v)<=g,a=Math.abs(u-m)<=g,o&&(n.position.top=i._convertPositionTo("relative",{top:c-i.helperProportions.height,left:0}).top),r&&(n.position.top=i._convertPositionTo("relative",{top:f,left:0}).top),s&&(n.position.left=i._convertPositionTo("relative",{top:0,left:l-i.helperProportions.width}).left),a&&(n.position.left=i._convertPositionTo("relative",{top:0,left:u}).left)),d=o||r||s||a,"outer"!==h.snapMode&&(o=Math.abs(c-y)<=g,r=Math.abs(f-b)<=g,s=Math.abs(l-m)<=g,a=Math.abs(u-v)<=g,o&&(n.position.top=i._convertPositionTo("relative",{top:c,left:0}).top),r&&(n.position.top=i._convertPositionTo("relative",{top:f-i.helperProportions.height,left:0}).top),s&&(n.position.left=i._convertPositionTo("relative",{top:0,left:l}).left),a&&(n.position.left=i._convertPositionTo("relative",{top:0,left:u-i.helperProportions.width}).left)),!i.snapElements[p].snapping&&(o||r||s||a||d)&&i.options.snap.snap&&i.options.snap.snap.call(i.element,t,e.extend(i._uiHash(),{snapItem:i.snapElements[p].item})),i.snapElements[p].snapping=o||r||s||a||d)}}),e.ui.plugin.add("draggable","stack",{start:function(t,n,i){var o,r=i.options,s=e.makeArray(e(r.stack)).sort(function(t,n){return(parseInt(e(t).css("zIndex"),10)||0)-(parseInt(e(n).css("zIndex"),10)||0)});s.length&&(o=parseInt(e(s[0]).css("zIndex"),10)||0,e(s).each(function(t){e(this).css("zIndex",o+t)}),this.css("zIndex",o+s.length))}}),e.ui.plugin.add("draggable","zIndex",{start:function(t,n,i){var o=e(n.helper),r=i.options;o.css("zIndex")&&(r._zIndex=o.css("zIndex")),o.css("zIndex",r.zIndex)},stop:function(t,n,i){var o=i.options;o._zIndex&&e(n.helper).css("zIndex",o._zIndex)}});var s=(e.ui.draggable,"ui-effects-"),a=e;e.effects={effect:{}},function(e,t){function n(e,t,n){var i=f[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")[0],h=e.each;d.style.cssText="background-color:rgba(1,1,1,.5)",p.rgba=d.style.backgroundColor.indexOf("rgba")>-1,h(c,function(e,t){t.cache="_"+e,t.props.alpha={idx:3,type:"percent",def:1}}),u.fn=e.extend(u.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 f=this,p=e.type(o),d=this._rgba=[];return s!==t&&(o=[o,s,a,l],p="array"),"string"===p?this.parse(i(o)||r._default):"array"===p?(h(c.rgba.props,function(e,t){d[t.idx]=n(o[t.idx],t)}),this):"object"===p?(o instanceof u?h(c,function(e,t){o[t.cache]&&(f[t.cache]=o[t.cache].slice())}):h(c,function(t,i){var r=i.cache;h(i.props,function(e,t){if(!f[r]&&i.to){if("alpha"===e||null==o[e])return;f[r]=i.to(f._rgba)}f[r][t.idx]=n(o[e],t,!0)}),f[r]&&e.inArray(null,f[r].slice(0,3))<0&&(f[r][3]=1,i.from&&(f._rgba=i.from(f[r])))}),this):void 0},is:function(e){var t=u(e),n=!0,i=this;return h(c,function(e,o){var r,s=t[o.cache];return s&&(r=i[o.cache]||o.to&&o.to(i._rgba)||[],h(o.props,function(e,t){if(null!=s[t.idx])return n=s[t.idx]===r[t.idx]})),n}),n},_space:function(){var e=[],t=this;return h(c,function(n,i){t[i.cache]&&e.push(n)}),e.pop()},transition:function(e,t){var i=u(e),o=i._space(),r=c[o],s=0===this.alpha()?u("transparent"):this,a=s[r.cache]||r.to(s._rgba),l=a.slice();return i=i[r.cache],h(r.props,function(e,o){var r=o.idx,s=a[r],u=i[r],c=f[o.type]||{};null!==u&&(null===s?l[r]=u:(c.mod&&(u-s>c.mod/2?s+=c.mod:s-u>c.mod/2&&(s-=c.mod)),l[r]=n((u-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=u(t)._rgba;return u(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&&t<3&&(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()}}),u.fn.parse.prototype=u.fn,c.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),u=a-l,c=a+l,f=.5*c;return t=l===a?0:i===a?60*(o-r)/u+360:o===a?60*(r-i)/u+120:60*(i-o)/u+240,n=0===u?0:f<=.5?u/c:u/(2-c),[Math.round(t)%360,n,f,null==s?1:s]},c.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=i<=.5?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]},h(c,function(i,o){var r=o.props,s=o.cache,l=o.to,c=o.from;u.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),f="array"===a||"object"===a?i:arguments,p=this[s].slice();return h(r,function(e,t){var i=f["object"===a?e:t.idx];null==i&&(i=p[t.idx]),p[t.idx]=n(i,t)}),c?(o=u(c(p)),o[s]=p,o):u(p)},h(r,function(t,n){u.fn[t]||(u.fn[t]=function(o){var r,s=e.type(o),l="alpha"===t?this._hsla?"hsla":"rgba":i,u=this[l](),c=u[n.idx];return"undefined"===s?c:("function"===s&&(o=o.call(this,c),s=e.type(o)),null==o&&n.empty?this:("string"===s&&(r=a.exec(o),r&&(o=c+parseFloat(r[2])*("+"===r[1]?1:-1))),u[n.idx]=o,this[l](u)))})})}),u.hook=function(t){var n=t.split(" ");h(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=u(r||o),!p.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=u(t.elem,n),t.end=u(t.end),t.colorInit=!0),e.cssHooks[n].set(t.elem,t.start.transition(t.end,t.pos))}})},u.hook(s),e.cssHooks.borderColor={expand:function(e){var t={};return h(["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"}}(a),function(){function t(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 n(t,n){var i,r,s={};for(i in n)r=n[i],t[i]!==r&&(o[i]||!e.fx.step[i]&&isNaN(parseFloat(r))||(s[i]=r));return s}var i=["add","remove","toggle"],o={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)&&(a.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(o,r,s,a){var l=e.speed(r,s,a);return this.queue(function(){var r,s=e(this),a=s.attr("class")||"",u=l.children?s.find("*").addBack():s;u=u.map(function(){var n=e(this);return{el:n,start:t(this)}}),r=function(){e.each(i,function(e,t){o[t]&&s[t+"Class"](o[t])})},r(),u=u.map(function(){return this.end=t(this.el[0]),this.diff=n(this.start,this.end),this}),s.attr("class",a),u=u.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,u.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(t){return function(n,i,o,r,s){return"boolean"==typeof i||void 0===i?o?e.effects.animateClass.call(this,i?{add:n}:{remove:n},o,r,s):t.apply(this,arguments):e.effects.animateClass.call(this,{toggle:n},i,o,r)}}(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 t(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 n(t){return!(t&&"number"!=typeof t&&!e.fx.speeds[t])||("string"==typeof t&&!e.effects.effect[t]||(!!e.isFunction(t)||"object"==typeof t&&!t.effect))}e.extend(e.effects,{version:"1.11.4",save:function(e,t){for(var n=0;n
").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 n(t){function n(){e.isFunction(r)&&r.call(o[0]),e.isFunction(t)&&t()}var o=e(this),r=i.complete,a=i.mode;(o.is(":hidden")?"hide"===a:"show"===a)?(o[a](),n()):s.call(o[0],i,n)}var i=t.apply(this,arguments),o=i.mode,r=i.queue,s=e.effects.effect[i.effect];return e.fx.off||!s?o?this[o](i.duration,i.complete):this.each(function(){i.complete&&i.complete.call(this)}):r===!1?this.each(n):this.queue(r||"fx",n)},show:function(e){return function(i){if(n(i))return e.apply(this,arguments);var o=t.apply(this,arguments);return o.mode="show",this.effect.call(this,o)}}(e.fn.show),hide:function(e){return function(i){if(n(i))return e.apply(this,arguments);var o=t.apply(this,arguments);return o.mode="hide",this.effect.call(this,o)}}(e.fn.hide),toggle:function(e){return function(i){if(n(i)||"boolean"==typeof i)return e.apply(this,arguments);var o=t.apply(this,arguments);return o.mode="toggle",this.effect.call(this,o)}}(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 e<.5?n(2*e)/2:1-n(e*-2+2)/2}})}();e.effects}),jQuery.fn.extend({everyTime:function(e,t,n,i){return this.each(function(){jQuery.timer.add(this,e,t,n,i)})},oneTime:function(e,t,n){return this.each(function(){jQuery.timer.add(this,e,t,n,1)})},stopTime:function(e,t){return this.each(function(){jQuery.timer.remove(this,e,t)})}}),jQuery.extend({timer:{global:[],guid:1,dataKey:"jQuery.timer",regex:/^([0-9]+(?:\.[0-9]*)?)\s*(.*s)?$/,powers:{ms:1,cs:10,ds:100,s:1e3,das:1e4,hs:1e5,ks:1e6},timeParse:function(e){if(void 0==e||null==e)return null;var t=this.regex.exec(jQuery.trim(e.toString()));if(t[2]){var n=parseFloat(t[1]),i=this.powers[t[2]]||1;return n*i}return e},add:function(e,t,n,i,o){var r=0;if(jQuery.isFunction(n)&&(o||(o=i),i=n,n=t),t=jQuery.timer.timeParse(t),!("number"!=typeof t||isNaN(t)||t<0)){("number"!=typeof o||isNaN(o)||o<0)&&(o=0),o=o||0;var s=jQuery.data(e,this.dataKey)||jQuery.data(e,this.dataKey,{});s[n]||(s[n]={}),i.timerID=i.timerID||this.guid++;var a=function(){(++r>o&&0!==o||i.call(e,r)===!1)&&jQuery.timer.remove(e,n,i)};a.timerID=i.timerID,s[n][i.timerID]||(s[n][i.timerID]=window.setInterval(a,t)),this.global.push(e)}},remove:function(e,t,n){var i,o=jQuery.data(e,this.dataKey);if(o){if(t){if(o[t]){if(n)n.timerID&&(window.clearInterval(o[t][n.timerID]),delete o[t][n.timerID]);else for(var n in o[t])window.clearInterval(o[t][n]),delete o[t][n];for(i in o[t])break;i||(i=null,delete o[t])}}else for(t in o)this.remove(e,t,n);for(i in o)break;i||jQuery.removeData(e,this.dataKey)}}}}),jQuery(window).bind("unload",function(){jQuery.each(jQuery.timer.global,function(e,t){jQuery.timer.remove(t)})}),function(){"use strict";function e(){var e={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"},t=/&(?!#?\w+;)|<|>|"|'|\//g;return function(){return this?this.replace(t,function(t){return e[t]||t}):this}}function t(e,n,i){return("string"==typeof n?n:n.toString()).replace(e.define||s,function(t,n,o,r){return 0===n.indexOf("def.")&&(n=n.substring(4)),n in i||(":"===o?(e.defineParams&&r.replace(e.defineParams,function(e,t,o){i[n]={arg:t,text:o}}),n in i||(i[n]=r)):new Function("def","def['"+n+"']="+r)(i)),""}).replace(e.use||s,function(n,o){e.useParams&&(o=o.replace(e.useParams,function(e,t,n,o){if(i[n]&&i[n].arg&&o){var r=(n+":"+o).replace(/'|\\/g,"_");return i.__exp=i.__exp||{},i.__exp[r]=i[n].text.replace(new RegExp("(^|[^\\w$])"+i[n].arg+"([^\\w$])","g"),"$1"+o+"$2"),t+"def.__exp['"+r+"']"}}));var r=new Function("def","return "+o)(i);return r?t(e,r,i):r})}function n(e){return e.replace(/\\('|\\)/g,"$1").replace(/[\r\t\n]/g," ")}var i,o={version:"1.0.1-nanoui",templateSettings:{evaluate:/\{\{([\s\S]+?)\}\}/g,interpolate:/\{\{:([\s\S]+?)\}\}/g,encode:/\{\{>([\s\S]+?)\}\}/g,use:/\{\{#([\s\S]+?)\}\}/g,define:/\{\{##\s*([\w\.$]+)\s*(\:|=)([\s\S]+?)#\}\}/g,conditional:/\{\{\/?if\s*([\s\S]*?)\s*\}\}/g,conditionalElse:/\{\{else\s*([\s\S]*?)\s*\}\}/g,iterate:/\{\{\/?for\s*(?:\}\}|([\s\S]+?)\s*(?:\:\s*([\w$]+))?\s*(?:\:\s*([\w$]+))?\s*\}\})/g,props:/\{\{\/?props\s*(?:\}\}|([\s\S]+?)\s*(?:\:\s*([\w$]+))?\s*(?:\:\s*([\w$]+))?\s*\}\})/g,empty:/\{\{empty\}\}/g,varname:"data, config, helper",strip:!0,append:!0,selfcontained:!1},template:void 0,compile:void 0};"undefined"!=typeof module&&module.exports?module.exports=o:"function"==typeof define&&define.amd?define(function(){return o}):(i=function(){return this||(0,eval)("this")}(),i.doT=o),String.prototype.encodeHTML=e();var r={append:{start:"'+(",end:")+'",endencode:"||'').toString().encodeHTML()+'"},split:{start:"';out+=(",end:");out+='",endencode:"||'').toString().encodeHTML();out+='"}},s=/$^/;o.template=function(i,a,l){a=a||o.templateSettings;var u,c=a.append?r.append:r.split,f=0,p=a.use||a.define?t(a,i,l||{}):i;p=("var out='"+(a.strip?p.replace(/(^|\r|\n)\t* +| +\t*(\r|\n|$)/g," ").replace(/\r|\n|\t|\/\*[\s\S]*?\*\//g,""):p).replace(/'|\\/g,"\\$&").replace(a.interpolate||s,function(e,t){return c.start+n(t)+c.end}).replace(a.encode||s,function(e,t){return u=!0,c.start+n(t)+c.endencode}).replace(a.conditional||s,function(e,t){return t?"';if("+n(t)+"){out+='":"';}out+='"}).replace(a.conditionalElse||s,function(e,t){return t?"';}else if("+n(t)+"){out+='":"';}else{out+='"}).replace(a.iterate||s,function(e,t,i,o){if(!t)return"';} } out+='";f+=1,i=i||"value",o=o||"index",t=n(t);var r="arr"+f;return"';var "+r+"="+t+";if("+r+" && "+r+".length > 0){var "+i+","+o+"=-1,l"+f+"="+r+".length-1;while("+o+" 0){var "+i+";for( var "+o+" in "+r+"){ if (!"+r+".hasOwnProperty("+o+")) continue; "+i+"="+r+"["+o+"];out+='"}).replace(a.empty||s,function(e){return"';}}else{if(true){out+='"}).replace(a.evaluate||s,function(e,t){return"';"+n(t)+"out+='"})+"';return out;").replace(/\n/g,"\\n").replace(/\t/g,"\\t").replace(/\r/g,"\\r").replace(/(\s|;|\}|^|\{)out\+='';/g,"$1").replace(/\+''/g,"").replace(/(\s|;|\}|^|\{)out\+=''\+/g,"$1out+="),u&&a.selfcontained&&(p="String.prototype.encodeHTML=("+e.toString()+"());"+p);try{return new Function(a.varname,p)}catch(d){throw"undefined"!=typeof console&&console.log("Could not create a template function: "+p),d}},o.compile=function(e,t){return o.template(e,null,t)}}(),!function(e){"use strict";function t(e){var t={path:!0,query:!0,hash:!0};return e?(/^[a-z]+:/.test(e)&&(t.protocol=!0,t.host=!0,/[-a-z0-9]+(\.[-a-z0-9])*:\d+/i.test(e)&&(t.port=!0),/\/\/(.*?)(?::(.*?))?@/.test(e)&&(t.user=!0,t.pass=!0)),t):t}function n(e,n,i){var f,p,d,h=a?"file://"+(process.platform.match(/^win/i)?"/":"")+l("fs").realpathSync("."):document.location.href;n||(n=h),a?f=l("url").parse(n):(f=document.createElement("a"),f.href=n);var g=t(n);d=n.match(/\/\/(.*?)(?::(.*?))?@/)||[];for(p in u)e[p]=g[p]?f[u[p]]||"":"";if(e.protocol=e.protocol.replace(/:$/,""),e.query=e.query.replace(/^\?/,""),e.hash=o(e.hash.replace(/^#/,"")),e.user=o(d[1]||""),e.pass=o(d[2]||""),e.port=c[e.protocol]==e.port||0==e.port?"":e.port,!g.protocol&&/[^\/#?]/.test(n.charAt(0))&&(e.path=n.split("?")[0].split("#")[0]),!g.protocol&&i){var m=new s(h.match(/(.*\/)/)[0]),v=m.path.split("/"),y=e.path.split("/"),b=["protocol","user","pass","host","port"],x=b.length;for(v.pop(),p=0;x>p;p++)e[b[p]]=m[b[p]];for(;".."===y[0];)v.pop(),y.shift();e.path=("/"!==n.charAt(0)?v.join("/"):"")+"/"+y.join("/")}e.path=e.path.replace(/^\/{2,}/,"/"),e.paths(("/"===e.path.charAt(0)?e.path.slice(1):e.path).split("/")),e.query=new r(e.query)}function i(e){return encodeURIComponent(e).replace(/'/g,"%27")}function o(e){return e=e.replace(/\+/g," "),e=e.replace(/%([ef][0-9a-f])%([89ab][0-9a-f])%([89ab][0-9a-f])/gi,function(e,t,n,i){var o=parseInt(t,16)-224,r=parseInt(n,16)-128;if(0===o&&32>r)return e;var s=parseInt(i,16)-128,a=(o<<12)+(r<<6)+s;return a>65535?e:String.fromCharCode(a)}),e=e.replace(/%([cd][0-9a-f])%([89ab][0-9a-f])/gi,function(e,t,n){var i=parseInt(t,16)-192;if(2>i)return e;var o=parseInt(n,16)-128;return String.fromCharCode((i<<6)+o)}),e.replace(/%([0-7][0-9a-f])/gi,function(e,t){return String.fromCharCode(parseInt(t,16))})}function r(e){for(var t,n=/([^=&]+)(=([^&]*))?/g;t=n.exec(e);){var i=decodeURIComponent(t[1].replace(/\+/g," ")),r=t[3]?o(t[3]):"";void 0!==this[i]&&null!==this[i]?(this[i]instanceof Array||(this[i]=[this[i]]),this[i].push(r)):this[i]=r}}function s(e,t){n(this,e,!t)}var a="undefined"==typeof window&&"undefined"!=typeof global&&"function"==typeof require,l=a?e.require:null,u={protocol:"protocol",host:"hostname",port:"port",path:"pathname",query:"search",hash:"hash"},c={ftp:21,gopher:70,http:80,https:443,ws:80,wss:443};r.prototype.toString=function(){var e,t,n="",o=i;for(e in this)if(!(this[e]instanceof Function||null===this[e]))if(this[e]instanceof Array){var r=this[e].length;if(r)for(t=0;r>t;t++)n+=n?"&":"",n+=o(e)+"="+o(this[e][t]);else n+=(n?"&":"")+o(e)+"="}else n+=n?"&":"",n+=o(e)+"="+o(this[e]);return n},s.prototype.clearQuery=function(){for(var e in this.query)this.query[e]instanceof Function||delete this.query[e];return this},s.prototype.queryLength=function(){var e,t=0;for(e in this)this[e]instanceof Function||t++;return t},s.prototype.isEmptyQuery=function(){return 0===this.queryLength()},s.prototype.paths=function(e){var t,n="",r=0;if(e&&e.length&&e+""!==e){for(this.isAbsolute()&&(n="/"),t=e.length;t>r;r++)e[r]=!r&&e[r].match(/^\w:$/)?e[r]:i(e[r]);this.path=n+e.join("/")}for(e=("/"===this.path.charAt(0)?this.path.slice(1):this.path).split("/"),r=0,t=e.length;t>r;r++)e[r]=o(e[r]);return e},s.prototype.encode=i,s.prototype.decode=o,s.prototype.isAbsolute=function(){return this.protocol||"/"===this.path.charAt(0)},s.prototype.toString=function(){return(this.protocol&&this.protocol+"://")+(this.user&&i(this.user)+(this.pass&&":"+i(this.pass))+"@")+(this.host&&this.host)+(this.port&&":"+this.port)+(this.path&&this.path)+(this.query.toString()&&"?"+this.query)+(this.hash&&"#"+i(this.hash))},e[e.exports?"exports":"Url"]=s}("undefined"!=typeof module&&module.exports?module:window); \ No newline at end of file +!function(e,t){"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(e,t){function n(e){var t="length"in e&&e.length,n=ne.type(e);return"function"!==n&&!ne.isWindow(e)&&(!(1!==e.nodeType||!t)||("array"===n||0===t||"number"==typeof t&&t>0&&t-1 in e))}function i(e,t,n){if(ne.isFunction(t))return ne.grep(e,function(e,i){return!!t.call(e,i,e)!==n});if(t.nodeType)return ne.grep(e,function(e){return e===t!==n});if("string"==typeof t){if(ce.test(t))return ne.filter(t,e,n);t=ne.filter(t,e)}return ne.grep(e,function(e){return ne.inArray(e,t)>=0!==n})}function o(e,t){do{e=e[t]}while(e&&1!==e.nodeType);return e}function r(e){var t=ve[e]={};return ne.each(e.match(me)||[],function(e,n){t[n]=!0}),t}function s(){pe.addEventListener?(pe.removeEventListener("DOMContentLoaded",a,!1),e.removeEventListener("load",a,!1)):(pe.detachEvent("onreadystatechange",a),e.detachEvent("onload",a))}function a(){(pe.addEventListener||"load"===event.type||"complete"===pe.readyState)&&(s(),ne.ready())}function l(e,t,n){if(void 0===n&&1===e.nodeType){var i="data-"+t.replace(Te,"-$1").toLowerCase();if("string"==typeof(n=e.getAttribute(i))){try{n="true"===n||"false"!==n&&("null"===n?null:+n+""===n?+n:we.test(n)?ne.parseJSON(n):n)}catch(e){}ne.data(e,t,n)}else n=void 0}return n}function u(e){var t;for(t in e)if(("data"!==t||!ne.isEmptyObject(e[t]))&&"toJSON"!==t)return!1;return!0}function c(e,t,n,i){if(ne.acceptData(e)){var o,r,s=ne.expando,a=e.nodeType,l=a?ne.cache:e,u=a?e[s]:e[s]&&s;if(u&&l[u]&&(i||l[u].data)||void 0!==n||"string"!=typeof t)return u||(u=a?e[s]=Q.pop()||ne.guid++:s),l[u]||(l[u]=a?{}:{toJSON:ne.noop}),"object"!=typeof t&&"function"!=typeof t||(i?l[u]=ne.extend(l[u],t):l[u].data=ne.extend(l[u].data,t)),r=l[u],i||(r.data||(r.data={}),r=r.data),void 0!==n&&(r[ne.camelCase(t)]=n),"string"==typeof t?null==(o=r[t])&&(o=r[ne.camelCase(t)]):o=r,o}}function f(e,t,n){if(ne.acceptData(e)){var i,o,r=e.nodeType,s=r?ne.cache:e,a=r?e[ne.expando]:ne.expando;if(s[a]){if(t&&(i=n?s[a]:s[a].data)){o=(t=ne.isArray(t)?t.concat(ne.map(t,ne.camelCase)):t in i?[t]:(t=ne.camelCase(t))in i?[t]:t.split(" ")).length;for(;o--;)delete i[t[o]];if(n?!u(i):!ne.isEmptyObject(i))return}(n||(delete s[a].data,u(s[a])))&&(r?ne.cleanData([e],!0):te.deleteExpando||s!=s.window?delete s[a]:s[a]=null)}}}function p(){return!0}function d(){return!1}function h(){try{return pe.activeElement}catch(e){}}function g(e){var t=je.split("|"),n=e.createDocumentFragment();if(n.createElement)for(;t.length;)n.createElement(t.pop());return n}function m(e,t){var n,i,o=0,r=typeof e.getElementsByTagName!==xe?e.getElementsByTagName(t||"*"):typeof e.querySelectorAll!==xe?e.querySelectorAll(t||"*"):void 0;if(!r)for(r=[],n=e.childNodes||e;null!=(i=n[o]);o++)!t||ne.nodeName(i,t)?r.push(i):ne.merge(r,m(i,t));return void 0===t||t&&ne.nodeName(e,t)?ne.merge([e],r):r}function v(e){ke.test(e.type)&&(e.defaultChecked=e.checked)}function y(e,t){return ne.nodeName(e,"table")&&ne.nodeName(11!==t.nodeType?t:t.firstChild,"tr")?e.getElementsByTagName("tbody")[0]||e.appendChild(e.ownerDocument.createElement("tbody")):e}function b(e){return e.type=(null!==ne.find.attr(e,"type"))+"/"+e.type,e}function x(e){var t=$e.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function w(e,t){for(var n,i=0;null!=(n=e[i]);i++)ne._data(n,"globalEval",!t||ne._data(t[i],"globalEval"))}function T(e,t){if(1===t.nodeType&&ne.hasData(e)){var n,i,o,r=ne._data(e),s=ne._data(t,r),a=r.events;if(a){delete s.handle,s.events={};for(n in a)for(i=0,o=a[n].length;i")).appendTo(t.documentElement))[0].contentWindow||Ye[0].contentDocument).document).write(),t.close(),n=_(e,t),Ye.detach()),Ve[e]=n),n}function E(e,t){return{get:function(){var n=e();if(null!=n){if(!n)return(this.get=t).apply(this,arguments);delete this.get}}}}function k(e,t){if(t in e)return t;for(var n=t.charAt(0).toUpperCase()+t.slice(1),i=t,o=lt.length;o--;)if((t=lt[o]+n)in e)return t;return i}function S(e,t){for(var n,i,o,r=[],s=0,a=e.length;s=0&&n=0},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},isPlainObject:function(e){var t;if(!e||"object"!==ne.type(e)||e.nodeType||ne.isWindow(e))return!1;try{if(e.constructor&&!ee.call(e,"constructor")&&!ee.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(e){return!1}if(te.ownLast)for(t in e)return ee.call(e,t);for(t in e);return void 0===t||ee.call(e,t)},type:function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?J[Z.call(e)]||"object":typeof e},globalEval:function(t){t&&ne.trim(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(oe,"ms-").replace(re,se)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,t,i){var o=0,r=e.length,s=n(e);if(i){if(s)for(;ox.cacheLength&&delete e[t.shift()],e[n+" "]=i}var t=[];return e}function i(e){return e[I]=!0,e}function o(e){var t=A.createElement("div");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function r(e,t){for(var n=e.split("|"),i=e.length;i--;)x.attrHandle[n[i]]=t}function s(e,t){var n=t&&e,i=n&&1===e.nodeType&&1===t.nodeType&&(~t.sourceIndex||X)-(~e.sourceIndex||X);if(i)return i;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function a(e){return i(function(t){return t=+t,i(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 l(e){return e&&void 0!==e.getElementsByTagName&&e}function u(){}function c(e){for(var t=0,n=e.length,i="";t1?function(t,n,i){for(var o=e.length;o--;)if(!e[o](t,n,i))return!1;return!0}:e[0]}function d(e,n,i){for(var o=0,r=n.length;o-1&&(i[u]=!(s[u]=f))}}else b=h(b===s?b.splice(m,b.length):b),r?r(null,s,b,l):G.apply(s,b)})}function m(e){for(var t,n,i,o=e.length,r=x.relative[e[0].type],s=r||x.relative[" "],a=r?1:0,l=f(function(e){return e===t},s,!0),u=f(function(e){return J(t,e)>-1},s,!0),d=[function(e,n,i){var o=!r&&(i||n!==E)||((t=n).nodeType?l(e,n,i):u(e,n,i));return t=null,o}];a1&&p(d),a>1&&c(e.slice(0,a-1).concat({value:" "===e[a-2].type?"*":""})).replace(se,"$1"),n,a0,r=e.length>0,s=function(i,s,a,l,u){var c,f,p,d=0,g="0",m=i&&[],v=[],y=E,b=i||r&&x.find.TAG("*",u),w=F+=null==y?1:Math.random()||.1,T=b.length;for(u&&(E=s!==A&&s);g!==T&&null!=(c=b[g]);g++){if(r&&c){for(f=0;p=e[f++];)if(p(c,s,a)){l.push(c);break}u&&(F=w)}o&&((c=!p&&c)&&d--,i&&m.push(c))}if(d+=g,o&&g!==d){for(f=0;p=n[f++];)p(m,v,s,a);if(i){if(d>0)for(;g--;)m[g]||v[g]||(v[g]=Y.call(l));v=h(v)}G.apply(l,v),u&&!i&&v.length>0&&d+n.length>1&&t.uniqueSort(l)}return u&&(F=w,E=y),m};return o?i(s):s}var y,b,x,w,T,C,_,N,E,k,S,D,A,H,P,j,L,M,W,I="sizzle"+1*new Date,O=e.document,F=0,q=0,R=n(),B=n(),z=n(),$=function(e,t){return e===t&&(S=!0),0},X=1<<31,U={}.hasOwnProperty,Q=[],Y=Q.pop,V=Q.push,G=Q.push,K=Q.slice,J=function(e,t){for(var n=0,i=e.length;n+~]|"+ee+")"+ee+"*"),ue=new RegExp("="+ee+"*([^\\]'\"]*?)"+ee+"*\\]","g"),ce=new RegExp(oe),fe=new RegExp("^"+ne+"$"),pe={ID:new RegExp("^#("+te+")"),CLASS:new RegExp("^\\.("+te+")"),TAG:new RegExp("^("+te.replace("w","w*")+")"),ATTR:new RegExp("^"+ie),PSEUDO:new RegExp("^"+oe),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+ee+"*(even|odd|(([+-]|)(\\d*)n|)"+ee+"*(?:([+-]|)"+ee+"*(\\d+)|))"+ee+"*\\)|)","i"),bool:new RegExp("^(?:"+Z+")$","i"),needsContext:new RegExp("^"+ee+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+ee+"*((?:-\\d)?\\d*)"+ee+"*\\)|)(?=[^-]|$)","i")},de=/^(?:input|select|textarea|button)$/i,he=/^h\d$/i,ge=/^[^{]+\{\s*\[native \w/,me=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ve=/[+~]/,ye=/'|\\/g,be=new RegExp("\\\\([\\da-f]{1,6}"+ee+"?|("+ee+")|.)","ig"),xe=function(e,t,n){var i="0x"+t-65536;return i!==i||n?t:i<0?String.fromCharCode(i+65536):String.fromCharCode(i>>10|55296,1023&i|56320)},we=function(){D()};try{G.apply(Q=K.call(O.childNodes),O.childNodes),Q[O.childNodes.length].nodeType}catch(e){G={apply:Q.length?function(e,t){V.apply(e,K.call(t))}:function(e,t){for(var n=e.length,i=0;e[n++]=t[i++];);e.length=n-1}}}b=t.support={},T=t.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return!!t&&"HTML"!==t.nodeName},D=t.setDocument=function(e){var t,n,i=e?e.ownerDocument||e:O;return i!==A&&9===i.nodeType&&i.documentElement?(A=i,H=i.documentElement,(n=i.defaultView)&&n!==n.top&&(n.addEventListener?n.addEventListener("unload",we,!1):n.attachEvent&&n.attachEvent("onunload",we)),P=!T(i),b.attributes=o(function(e){return e.className="i",!e.getAttribute("className")}),b.getElementsByTagName=o(function(e){return e.appendChild(i.createComment("")),!e.getElementsByTagName("*").length}),b.getElementsByClassName=ge.test(i.getElementsByClassName),b.getById=o(function(e){return H.appendChild(e).id=I,!i.getElementsByName||!i.getElementsByName(I).length}),b.getById?(x.find.ID=function(e,t){if(void 0!==t.getElementById&&P){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},x.filter.ID=function(e){var t=e.replace(be,xe);return function(e){return e.getAttribute("id")===t}}):(delete x.find.ID,x.filter.ID=function(e){var t=e.replace(be,xe);return function(e){var n=void 0!==e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}}),x.find.TAG=b.getElementsByTagName?function(e,t){return void 0!==t.getElementsByTagName?t.getElementsByTagName(e):b.qsa?t.querySelectorAll(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},x.find.CLASS=b.getElementsByClassName&&function(e,t){if(P)return t.getElementsByClassName(e)},L=[],j=[],(b.qsa=ge.test(i.querySelectorAll))&&(o(function(e){H.appendChild(e).innerHTML="
",e.querySelectorAll("[msallowcapture^='']").length&&j.push("[*^$]="+ee+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||j.push("\\["+ee+"*(?:value|"+Z+")"),e.querySelectorAll("[id~="+I+"-]").length||j.push("~="),e.querySelectorAll(":checked").length||j.push(":checked"),e.querySelectorAll("a#"+I+"+*").length||j.push(".#.+[+~]")}),o(function(e){var t=i.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&j.push("name"+ee+"*[*^$|!~]?="),e.querySelectorAll(":enabled").length||j.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),j.push(",.*:")})),(b.matchesSelector=ge.test(M=H.matches||H.webkitMatchesSelector||H.mozMatchesSelector||H.oMatchesSelector||H.msMatchesSelector))&&o(function(e){b.disconnectedMatch=M.call(e,"div"),M.call(e,"[s!='']:x"),L.push("!=",oe)}),j=j.length&&new RegExp(j.join("|")),L=L.length&&new RegExp(L.join("|")),t=ge.test(H.compareDocumentPosition),W=t||ge.test(H.contains)?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},$=t?function(e,t){if(e===t)return S=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!b.sortDetached&&t.compareDocumentPosition(e)===n?e===i||e.ownerDocument===O&&W(O,e)?-1:t===i||t.ownerDocument===O&&W(O,t)?1:k?J(k,e)-J(k,t):0:4&n?-1:1)}:function(e,t){if(e===t)return S=!0,0;var n,o=0,r=e.parentNode,a=t.parentNode,l=[e],u=[t];if(!r||!a)return e===i?-1:t===i?1:r?-1:a?1:k?J(k,e)-J(k,t):0;if(r===a)return s(e,t);for(n=e;n=n.parentNode;)l.unshift(n);for(n=t;n=n.parentNode;)u.unshift(n);for(;l[o]===u[o];)o++;return o?s(l[o],u[o]):l[o]===O?-1:u[o]===O?1:0},i):A},t.matches=function(e,n){return t(e,null,null,n)},t.matchesSelector=function(e,n){if((e.ownerDocument||e)!==A&&D(e),n=n.replace(ue,"='$1']"),b.matchesSelector&&P&&(!L||!L.test(n))&&(!j||!j.test(n)))try{var i=M.call(e,n);if(i||b.disconnectedMatch||e.document&&11!==e.document.nodeType)return i}catch(e){}return t(n,A,null,[e]).length>0},t.contains=function(e,t){return(e.ownerDocument||e)!==A&&D(e),W(e,t)},t.attr=function(e,t){(e.ownerDocument||e)!==A&&D(e);var n=x.attrHandle[t.toLowerCase()],i=n&&U.call(x.attrHandle,t.toLowerCase())?n(e,t,!P):void 0;return void 0!==i?i:b.attributes||!P?e.getAttribute(t):(i=e.getAttributeNode(t))&&i.specified?i.value:null},t.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},t.uniqueSort=function(e){var t,n=[],i=0,o=0;if(S=!b.detectDuplicates,k=!b.sortStable&&e.slice(0),e.sort($),S){for(;t=e[o++];)t===e[o]&&(i=n.push(o));for(;i--;)e.splice(n[i],1)}return k=null,e},w=t.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+=w(e)}else if(3===o||4===o)return e.nodeValue}else for(;t=e[i++];)n+=w(t);return n},(x=t.selectors={cacheLength:50,createPseudo:i,match:pe,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(be,xe),e[3]=(e[3]||e[4]||e[5]||"").replace(be,xe),"~="===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]||t.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]&&t.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return pe.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&ce.test(n)&&(t=C(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(be,xe).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=R[e+" "];return t||(t=new RegExp("(^|"+ee+")"+e+"("+ee+"|$)"))&&R(e,function(e){return t.test("string"==typeof e.className&&e.className||void 0!==e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(e,n,i){return function(o){var r=t.attr(o,e);return null==r?"!="===n:!n||(r+="","="===n?r===i:"!="===n?r!==i:"^="===n?i&&0===r.indexOf(i):"*="===n?i&&r.indexOf(i)>-1:"$="===n?i&&r.slice(-i.length)===i:"~="===n?(" "+r.replace(re," ")+" ").indexOf(i)>-1:"|="===n&&(r===i||r.slice(0,i.length+1)===i+"-"))}},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 u,c,f,p,d,h,g=r!==s?"nextSibling":"previousSibling",m=t.parentNode,v=a&&t.nodeName.toLowerCase(),y=!l&&!a;if(m){if(r){for(;g;){for(f=t;f=f[g];)if(a?f.nodeName.toLowerCase()===v:1===f.nodeType)return!1;h=g="only"===e&&!h&&"nextSibling"}return!0}if(h=[s?m.firstChild:m.lastChild],s&&y){for(d=(u=(c=m[I]||(m[I]={}))[e]||[])[0]===F&&u[1],p=u[0]===F&&u[2],f=d&&m.childNodes[d];f=++d&&f&&f[g]||(p=d=0)||h.pop();)if(1===f.nodeType&&++p&&f===t){c[e]=[F,d,p];break}}else if(y&&(u=(t[I]||(t[I]={}))[e])&&u[0]===F)p=u[1];else for(;(f=++d&&f&&f[g]||(p=d=0)||h.pop())&&((a?f.nodeName.toLowerCase()!==v:1!==f.nodeType)||!++p||(y&&((f[I]||(f[I]={}))[e]=[F,p]),f!==t)););return(p-=o)===i||p%i==0&&p/i>=0}}},PSEUDO:function(e,n){var o,r=x.pseudos[e]||x.setFilters[e.toLowerCase()]||t.error("unsupported pseudo: "+e);return r[I]?r(n):r.length>1?(o=[e,e,"",n],x.setFilters.hasOwnProperty(e.toLowerCase())?i(function(e,t){for(var i,o=r(e,n),s=o.length;s--;)e[i=J(e,o[s])]=!(t[i]=o[s])}):function(e){return r(e,0,o)}):r}},pseudos:{not:i(function(e){var t=[],n=[],o=_(e.replace(se,"$1"));return o[I]?i(function(e,t,n,i){for(var r,s=o(e,null,i,[]),a=e.length;a--;)(r=s[a])&&(e[a]=!(t[a]=r))}):function(e,i,r){return t[0]=e,o(t,null,r,n),t[0]=null,!n.pop()}}),has:i(function(e){return function(n){return t(e,n).length>0}}),contains:i(function(e){return e=e.replace(be,xe),function(t){return(t.textContent||t.innerText||w(t)).indexOf(e)>-1}}),lang:i(function(e){return fe.test(e||"")||t.error("unsupported lang: "+e),e=e.replace(be,xe).toLowerCase(),function(t){var n;do{if(n=P?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return(n=n.toLowerCase())===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===H},focus:function(e){return e===A.activeElement&&(!A.hasFocus||A.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return!1===e.disabled},disabled:function(e){return!0===e.disabled},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,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!x.pseudos.empty(e)},header:function(e){return he.test(e.nodeName)},input:function(e){return de.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"))||"text"===t.toLowerCase())},first:a(function(){return[0]}),last:a(function(e,t){return[t-1]}),eq:a(function(e,t,n){return[n<0?n+t:n]}),even:a(function(e,t){for(var n=0;n=0;)e.push(i);return e}),gt:a(function(e,t,n){for(var i=n<0?n+t:n;++i2&&"ID"===(s=r[0]).type&&b.getById&&9===t.nodeType&&P&&x.relative[r[1].type]){if(!(t=(x.find.ID(s.matches[0].replace(be,xe),t)||[])[0]))return n;f&&(t=t.parentNode),e=e.slice(r.shift().value.length)}for(o=pe.needsContext.test(e)?0:r.length;o--&&(s=r[o],!x.relative[a=s.type]);)if((u=x.find[a])&&(i=u(s.matches[0].replace(be,xe),ve.test(r[0].type)&&l(t.parentNode)||t))){if(r.splice(o,1),!(e=i.length&&c(r)))return G.apply(n,i),n;break}}return(f||_(e,p))(i,t,!P,n,ve.test(e)&&l(t.parentNode)||t),n},b.sortStable=I.split("").sort($).join("")===I,b.detectDuplicates=!!S,D(),b.sortDetached=o(function(e){return 1&e.compareDocumentPosition(A.createElement("div"))}),o(function(e){return e.innerHTML="","#"===e.firstChild.getAttribute("href")})||r("type|href|height|width",function(e,t,n){if(!n)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),b.attributes&&o(function(e){return e.innerHTML="",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||r("value",function(e,t,n){if(!n&&"input"===e.nodeName.toLowerCase())return e.defaultValue}),o(function(e){return null==e.getAttribute("disabled")})||r(Z,function(e,t,n){var i;if(!n)return!0===e[t]?t.toLowerCase():(i=e.getAttributeNode(t))&&i.specified?i.value:null}),t}(e);ne.find=ae,ne.expr=ae.selectors,ne.expr[":"]=ne.expr.pseudos,ne.unique=ae.uniqueSort,ne.text=ae.getText,ne.isXMLDoc=ae.isXML,ne.contains=ae.contains;var le=ne.expr.match.needsContext,ue=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,ce=/^.[^:#\[\.,]*$/;ne.filter=function(e,t,n){var i=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===i.nodeType?ne.find.matchesSelector(i,e)?[i]:[]:ne.find.matches(e,ne.grep(t,function(e){return 1===e.nodeType}))},ne.fn.extend({find:function(e){var t,n=[],i=this,o=i.length;if("string"!=typeof e)return this.pushStack(ne(e).filter(function(){for(t=0;t1?ne.unique(n):n),n.selector=this.selector?this.selector+" "+e:e,n},filter:function(e){return this.pushStack(i(this,e||[],!1))},not:function(e){return this.pushStack(i(this,e||[],!0))},is:function(e){return!!i(this,"string"==typeof e&&le.test(e)?ne(e):e||[],!1).length}});var fe,pe=e.document,de=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/;(ne.fn.init=function(e,t){var n,i;if(!e)return this;if("string"==typeof e){if(!(n="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&e.length>=3?[null,e,null]:de.exec(e))||!n[1]&&t)return!t||t.jquery?(t||fe).find(e):this.constructor(t).find(e);if(n[1]){if(t=t instanceof ne?t[0]:t,ne.merge(this,ne.parseHTML(n[1],t&&t.nodeType?t.ownerDocument||t:pe,!0)),ue.test(n[1])&&ne.isPlainObject(t))for(n in t)ne.isFunction(this[n])?this[n](t[n]):this.attr(n,t[n]);return this}if((i=pe.getElementById(n[2]))&&i.parentNode){if(i.id!==n[2])return fe.find(e);this.length=1,this[0]=i}return this.context=pe,this.selector=e,this}return e.nodeType?(this.context=this[0]=e,this.length=1,this):ne.isFunction(e)?void 0!==fe.ready?fe.ready(e):e(ne):(void 0!==e.selector&&(this.selector=e.selector,this.context=e.context),ne.makeArray(e,this))}).prototype=ne.fn,fe=ne(pe);var he=/^(?:parents|prev(?:Until|All))/,ge={children:!0,contents:!0,next:!0,prev:!0};ne.extend({dir:function(e,t,n){for(var i=[],o=e[t];o&&9!==o.nodeType&&(void 0===n||1!==o.nodeType||!ne(o).is(n));)1===o.nodeType&&i.push(o),o=o[t];return i},sibling:function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n}}),ne.fn.extend({has:function(e){var t,n=ne(e,this),i=n.length;return this.filter(function(){for(t=0;t-1:1===n.nodeType&&ne.find.matchesSelector(n,e))){r.push(n);break}return this.pushStack(r.length>1?ne.unique(r):r)},index:function(e){return e?"string"==typeof e?ne.inArray(this[0],ne(e)):ne.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(ne.unique(ne.merge(this.get(),ne(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),ne.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return ne.dir(e,"parentNode")},parentsUntil:function(e,t,n){return ne.dir(e,"parentNode",n)},next:function(e){return o(e,"nextSibling")},prev:function(e){return o(e,"previousSibling")},nextAll:function(e){return ne.dir(e,"nextSibling")},prevAll:function(e){return ne.dir(e,"previousSibling")},nextUntil:function(e,t,n){return ne.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return ne.dir(e,"previousSibling",n)},siblings:function(e){return ne.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return ne.sibling(e.firstChild)},contents:function(e){return ne.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:ne.merge([],e.childNodes)}},function(e,t){ne.fn[e]=function(n,i){var o=ne.map(this,t,n);return"Until"!==e.slice(-5)&&(i=n),i&&"string"==typeof i&&(o=ne.filter(i,o)),this.length>1&&(ge[e]||(o=ne.unique(o)),he.test(e)&&(o=o.reverse())),this.pushStack(o)}});var me=/\S+/g,ve={};ne.Callbacks=function(e){var t,n,i,o,s,a,l=[],u=!(e="string"==typeof e?ve[e]||r(e):ne.extend({},e)).once&&[],c=function(r){for(n=e.memory&&r,i=!0,s=a||0,a=0,o=l.length,t=!0;l&&s-1;)l.splice(i,1),t&&(i<=o&&o--,i<=s&&s--)}),this},has:function(e){return e?ne.inArray(e,l)>-1:!(!l||!l.length)},empty:function(){return l=[],o=0,this},disable:function(){return l=u=n=void 0,this},disabled:function(){return!l},lock:function(){return u=void 0,n||f.disable(),this},locked:function(){return!u},fireWith:function(e,n){return!l||i&&!u||(n=[e,(n=n||[]).slice?n.slice():n],t?u.push(n):c(n)),this},fire:function(){return f.fireWith(this,arguments),this},fired:function(){return!!i}};return f},ne.extend({Deferred:function(e){var t=[["resolve","done",ne.Callbacks("once memory"),"resolved"],["reject","fail",ne.Callbacks("once memory"),"rejected"],["notify","progress",ne.Callbacks("memory")]],n="pending",i={state:function(){return n},always:function(){return o.done(arguments).fail(arguments),this},then:function(){var e=arguments;return ne.Deferred(function(n){ne.each(t,function(t,r){var s=ne.isFunction(e[t])&&e[t];o[r[1]](function(){var e=s&&s.apply(this,arguments);e&&ne.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[r[0]+"With"](this===i?n.promise():this,s?[e]:arguments)})}),e=null}).promise()},promise:function(e){return null!=e?ne.extend(e,i):i}},o={};return i.pipe=i.then,ne.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=Y.call(arguments),s=r.length,a=1!==s||e&&ne.isFunction(e.promise)?s:0,l=1===a?e:ne.Deferred(),u=function(e,n,i){return function(o){n[e]=this,i[e]=arguments.length>1?Y.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);o0||(ye.resolveWith(pe,[ne]),ne.fn.triggerHandler&&(ne(pe).triggerHandler("ready"),ne(pe).off("ready")))}}}),ne.ready.promise=function(t){if(!ye)if(ye=ne.Deferred(),"complete"===pe.readyState)setTimeout(ne.ready);else if(pe.addEventListener)pe.addEventListener("DOMContentLoaded",a,!1),e.addEventListener("load",a,!1);else{pe.attachEvent("onreadystatechange",a),e.attachEvent("onload",a);var n=!1;try{n=null==e.frameElement&&pe.documentElement}catch(e){}n&&n.doScroll&&function e(){if(!ne.isReady){try{n.doScroll("left")}catch(t){return setTimeout(e,50)}s(),ne.ready()}}()}return ye.promise(t)};var be,xe="undefined";for(be in ne(te))break;te.ownLast="0"!==be,te.inlineBlockNeedsLayout=!1,ne(function(){var e,t,n,i;(n=pe.getElementsByTagName("body")[0])&&n.style&&(t=pe.createElement("div"),(i=pe.createElement("div")).style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",n.appendChild(i).appendChild(t),typeof t.style.zoom!==xe&&(t.style.cssText="display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1",te.inlineBlockNeedsLayout=e=3===t.offsetWidth,e&&(n.style.zoom=1)),n.removeChild(i))}),function(){var e=pe.createElement("div");if(null==te.deleteExpando){te.deleteExpando=!0;try{delete e.test}catch(e){te.deleteExpando=!1}}e=null}(),ne.acceptData=function(e){var t=ne.noData[(e.nodeName+" ").toLowerCase()],n=+e.nodeType||1;return(1===n||9===n)&&(!t||!0!==t&&e.getAttribute("classid")===t)};var we=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,Te=/([A-Z])/g;ne.extend({cache:{},noData:{"applet ":!0,"embed ":!0,"object ":"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(e){return!!(e=e.nodeType?ne.cache[e[ne.expando]]:e[ne.expando])&&!u(e)},data:function(e,t,n){return c(e,t,n)},removeData:function(e,t){return f(e,t)},_data:function(e,t,n){return c(e,t,n,!0)},_removeData:function(e,t){return f(e,t,!0)}}),ne.fn.extend({data:function(e,t){var n,i,o,r=this[0],s=r&&r.attributes;if(void 0===e){if(this.length&&(o=ne.data(r),1===r.nodeType&&!ne._data(r,"parsedAttrs"))){for(n=s.length;n--;)s[n]&&0===(i=s[n].name).indexOf("data-")&&l(r,i=ne.camelCase(i.slice(5)),o[i]);ne._data(r,"parsedAttrs",!0)}return o}return"object"==typeof e?this.each(function(){ne.data(this,e)}):arguments.length>1?this.each(function(){ne.data(this,e,t)}):r?l(r,e,ne.data(r,e)):void 0},removeData:function(e){return this.each(function(){ne.removeData(this,e)})}}),ne.extend({queue:function(e,t,n){var i;if(e)return t=(t||"fx")+"queue",i=ne._data(e,t),n&&(!i||ne.isArray(n)?i=ne._data(e,t,ne.makeArray(n)):i.push(n)),i||[]},dequeue:function(e,t){t=t||"fx";var n=ne.queue(e,t),i=n.length,o=n.shift(),r=ne._queueHooks(e,t);"inprogress"===o&&(o=n.shift(),i--),o&&("fx"===t&&n.unshift("inprogress"),delete r.stop,o.call(e,function(){ne.dequeue(e,t)},r)),!i&&r&&r.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return ne._data(e,n)||ne._data(e,n,{empty:ne.Callbacks("once memory").add(function(){ne._removeData(e,t+"queue"),ne._removeData(e,n)})})}}),ne.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&&(t=e,e="fx",n--),arguments.length
a",te.leadingWhitespace=3===t.firstChild.nodeType,te.tbody=!t.getElementsByTagName("tbody").length,te.htmlSerialize=!!t.getElementsByTagName("link").length,te.html5Clone="<:nav>"!==pe.createElement("nav").cloneNode(!0).outerHTML,e.type="checkbox",e.checked=!0,n.appendChild(e),te.appendChecked=e.checked,t.innerHTML="",te.noCloneChecked=!!t.cloneNode(!0).lastChild.defaultValue,n.appendChild(t),t.innerHTML="",te.checkClone=t.cloneNode(!0).cloneNode(!0).lastChild.checked,te.noCloneEvent=!0,t.attachEvent&&(t.attachEvent("onclick",function(){te.noCloneEvent=!1}),t.cloneNode(!0).click()),null==te.deleteExpando){te.deleteExpando=!0;try{delete t.test}catch(e){te.deleteExpando=!1}}}(),function(){var t,n,i=pe.createElement("div");for(t in{submit:!0,change:!0,focusin:!0})n="on"+t,(te[t+"Bubbles"]=n in e)||(i.setAttribute(n,"t"),te[t+"Bubbles"]=!1===i.attributes[n].expando);i=null}();var Se=/^(?:input|select|textarea)$/i,De=/^key/,Ae=/^(?:mouse|pointer|contextmenu)|click/,He=/^(?:focusinfocus|focusoutblur)$/,Pe=/^([^.]*)(?:\.(.+)|)$/;ne.event={global:{},add:function(e,t,n,i,o){var r,s,a,l,u,c,f,p,d,h,g,m=ne._data(e);if(m){for(n.handler&&(n=(l=n).handler,o=l.selector),n.guid||(n.guid=ne.guid++),(s=m.events)||(s=m.events={}),(c=m.handle)||((c=m.handle=function(e){return typeof ne===xe||e&&ne.event.triggered===e.type?void 0:ne.event.dispatch.apply(c.elem,arguments)}).elem=e),a=(t=(t||"").match(me)||[""]).length;a--;)d=g=(r=Pe.exec(t[a])||[])[1],h=(r[2]||"").split(".").sort(),d&&(u=ne.event.special[d]||{},d=(o?u.delegateType:u.bindType)||d,u=ne.event.special[d]||{},f=ne.extend({type:d,origType:g,data:i,handler:n,guid:n.guid,selector:o,needsContext:o&&ne.expr.match.needsContext.test(o),namespace:h.join(".")},l),(p=s[d])||((p=s[d]=[]).delegateCount=0,u.setup&&!1!==u.setup.call(e,i,h,c)||(e.addEventListener?e.addEventListener(d,c,!1):e.attachEvent&&e.attachEvent("on"+d,c))),u.add&&(u.add.call(e,f),f.handler.guid||(f.handler.guid=n.guid)),o?p.splice(p.delegateCount++,0,f):p.push(f),ne.event.global[d]=!0);e=null}},remove:function(e,t,n,i,o){var r,s,a,l,u,c,f,p,d,h,g,m=ne.hasData(e)&&ne._data(e);if(m&&(c=m.events)){for(u=(t=(t||"").match(me)||[""]).length;u--;)if(a=Pe.exec(t[u])||[],d=g=a[1],h=(a[2]||"").split(".").sort(),d){for(f=ne.event.special[d]||{},p=c[d=(i?f.delegateType:f.bindType)||d]||[],a=a[2]&&new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),l=r=p.length;r--;)s=p[r],!o&&g!==s.origType||n&&n.guid!==s.guid||a&&!a.test(s.namespace)||i&&i!==s.selector&&("**"!==i||!s.selector)||(p.splice(r,1),s.selector&&p.delegateCount--,f.remove&&f.remove.call(e,s));l&&!p.length&&(f.teardown&&!1!==f.teardown.call(e,h,m.handle)||ne.removeEvent(e,d,m.handle),delete c[d])}else for(d in c)ne.event.remove(e,d+t[u],n,i,!0);ne.isEmptyObject(c)&&(delete m.handle,ne._removeData(e,"events"))}},trigger:function(t,n,i,o){var r,s,a,l,u,c,f,p=[i||pe],d=ee.call(t,"type")?t.type:t,h=ee.call(t,"namespace")?t.namespace.split("."):[];if(a=c=i=i||pe,3!==i.nodeType&&8!==i.nodeType&&!He.test(d+ne.event.triggered)&&(d.indexOf(".")>=0&&(d=(h=d.split(".")).shift(),h.sort()),s=d.indexOf(":")<0&&"on"+d,t=t[ne.expando]?t:new ne.Event(d,"object"==typeof t&&t),t.isTrigger=o?2:3,t.namespace=h.join("."),t.namespace_re=t.namespace?new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=i),n=null==n?[t]:ne.makeArray(n,[t]),u=ne.event.special[d]||{},o||!u.trigger||!1!==u.trigger.apply(i,n))){if(!o&&!u.noBubble&&!ne.isWindow(i)){for(l=u.delegateType||d,He.test(l+d)||(a=a.parentNode);a;a=a.parentNode)p.push(a),c=a;c===(i.ownerDocument||pe)&&p.push(c.defaultView||c.parentWindow||e)}for(f=0;(a=p[f++])&&!t.isPropagationStopped();)t.type=f>1?l:u.bindType||d,(r=(ne._data(a,"events")||{})[t.type]&&ne._data(a,"handle"))&&r.apply(a,n),(r=s&&a[s])&&r.apply&&ne.acceptData(a)&&(t.result=r.apply(a,n),!1===t.result&&t.preventDefault());if(t.type=d,!o&&!t.isDefaultPrevented()&&(!u._default||!1===u._default.apply(p.pop(),n))&&ne.acceptData(i)&&s&&i[d]&&!ne.isWindow(i)){(c=i[s])&&(i[s]=null),ne.event.triggered=d;try{i[d]()}catch(e){}ne.event.triggered=void 0,c&&(i[s]=c)}return t.result}},dispatch:function(e){e=ne.event.fix(e);var t,n,i,o,r,s=[],a=Y.call(arguments),l=(ne._data(this,"events")||{})[e.type]||[],u=ne.event.special[e.type]||{};if(a[0]=e,e.delegateTarget=this,!u.preDispatch||!1!==u.preDispatch.call(this,e)){for(s=ne.event.handlers.call(this,e,l),t=0;(o=s[t++])&&!e.isPropagationStopped();)for(e.currentTarget=o.elem,r=0;(i=o.handlers[r++])&&!e.isImmediatePropagationStopped();)e.namespace_re&&!e.namespace_re.test(i.namespace)||(e.handleObj=i,e.data=i.data,void 0!==(n=((ne.event.special[i.origType]||{}).handle||i.handler).apply(o.elem,a))&&!1===(e.result=n)&&(e.preventDefault(),e.stopPropagation()));return u.postDispatch&&u.postDispatch.call(this,e),e.result}},handlers:function(e,t){var n,i,o,r,s=[],a=t.delegateCount,l=e.target;if(a&&l.nodeType&&(!e.button||"click"!==e.type))for(;l!=this;l=l.parentNode||this)if(1===l.nodeType&&(!0!==l.disabled||"click"!==e.type)){for(o=[],r=0;r=0:ne.find(n,this,null,[l]).length),o[n]&&o.push(i);o.length&&s.push({elem:l,handlers:o})}return a]","i"),We=/^\s+/,Ie=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,Oe=/<([\w:]+)/,Fe=/\s*$/g,Ue={option:[1,""],legend:[1,"
","
"],area:[1,"",""],param:[1,"",""],thead:[1,"","
"],tr:[2,"","
"],col:[2,"","
"],td:[3,"","
"],_default:te.htmlSerialize?[0,"",""]:[1,"X
","
"]},Qe=g(pe).appendChild(pe.createElement("div"));Ue.optgroup=Ue.option,Ue.tbody=Ue.tfoot=Ue.colgroup=Ue.caption=Ue.thead,Ue.th=Ue.td,ne.extend({clone:function(e,t,n){var i,o,r,s,a,l=ne.contains(e.ownerDocument,e);if(te.html5Clone||ne.isXMLDoc(e)||!Me.test("<"+e.nodeName+">")?r=e.cloneNode(!0):(Qe.innerHTML=e.outerHTML,Qe.removeChild(r=Qe.firstChild)),!(te.noCloneEvent&&te.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||ne.isXMLDoc(e)))for(i=m(r),a=m(e),s=0;null!=(o=a[s]);++s)i[s]&&C(o,i[s]);if(t)if(n)for(a=a||m(e),i=i||m(r),s=0;null!=(o=a[s]);s++)T(o,i[s]);else T(e,r);return(i=m(r,"script")).length>0&&w(i,!l&&m(e,"script")),i=a=o=null,r},buildFragment:function(e,t,n,i){for(var o,r,s,a,l,u,c,f=e.length,p=g(t),d=[],h=0;h")+c[2],o=c[0];o--;)a=a.lastChild;if(!te.leadingWhitespace&&We.test(r)&&d.push(t.createTextNode(We.exec(r)[0])),!te.tbody)for(o=(r="table"!==l||Fe.test(r)?""!==c[1]||Fe.test(r)?0:a:a.firstChild)&&r.childNodes.length;o--;)ne.nodeName(u=r.childNodes[o],"tbody")&&!u.childNodes.length&&r.removeChild(u);for(ne.merge(d,a.childNodes),a.textContent="";a.firstChild;)a.removeChild(a.firstChild);a=p.lastChild}else d.push(t.createTextNode(r));for(a&&p.removeChild(a),te.appendChecked||ne.grep(m(d,"input"),v),h=0;r=d[h++];)if((!i||-1===ne.inArray(r,i))&&(s=ne.contains(r.ownerDocument,r),a=m(p.appendChild(r),"script"),s&&w(a),n))for(o=0;r=a[o++];)ze.test(r.type||"")&&n.push(r);return a=null,p},cleanData:function(e,t){for(var n,i,o,r,s=0,a=ne.expando,l=ne.cache,u=te.deleteExpando,c=ne.event.special;null!=(n=e[s]);s++)if((t||ne.acceptData(n))&&(o=n[a],r=o&&l[o])){if(r.events)for(i in r.events)c[i]?ne.event.remove(n,i):ne.removeEvent(n,i,r.handle);l[o]&&(delete l[o],u?delete n[a]:typeof n.removeAttribute!==xe?n.removeAttribute(a):n[a]=null,Q.push(o))}}}),ne.fn.extend({text:function(e){return Ee(this,function(e){return void 0===e?ne.text(this):this.empty().append((this[0]&&this[0].ownerDocument||pe).createTextNode(e))},null,e,arguments.length)},append:function(){return this.domManip(arguments,function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||y(this,e).appendChild(e)})},prepend:function(){return this.domManip(arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=y(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?ne.filter(e,this):this,o=0;null!=(n=i[o]);o++)t||1!==n.nodeType||ne.cleanData(m(n)),n.parentNode&&(t&&ne.contains(n.ownerDocument,n)&&w(m(n,"script")),n.parentNode.removeChild(n));return this},empty:function(){for(var e,t=0;null!=(e=this[t]);t++){for(1===e.nodeType&&ne.cleanData(m(e,!1));e.firstChild;)e.removeChild(e.firstChild);e.options&&ne.nodeName(e,"select")&&(e.options.length=0)}return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map(function(){return ne.clone(this,e,t)})},html:function(e){return Ee(this,function(e){var t=this[0]||{},n=0,i=this.length;if(void 0===e)return 1===t.nodeType?t.innerHTML.replace(Le,""):void 0;if("string"==typeof e&&!Re.test(e)&&(te.htmlSerialize||!Me.test(e))&&(te.leadingWhitespace||!We.test(e))&&!Ue[(Oe.exec(e)||["",""])[1].toLowerCase()]){e=e.replace(Ie,"<$1>");try{for(;n1&&"string"==typeof p&&!te.checkClone&&Be.test(p))return this.each(function(n){var i=c.eq(n);d&&(e[0]=p.call(this,n,i.html())),i.domManip(e,t)});if(u&&(a=ne.buildFragment(e,this[0].ownerDocument,!1,this),n=a.firstChild,1===a.childNodes.length&&(a=n),n)){for(o=(r=ne.map(m(a,"script"),b)).length;l
t
",(o=t.getElementsByTagName("td"))[0].style.cssText="margin:0;border:0;padding:0;display:none",(a=0===o[0].offsetHeight)&&(o[0].style.display="",o[1].style.display="none",a=0===o[0].offsetHeight),n.removeChild(i))}var n,i,o,r,s,a,l;(n=pe.createElement("div")).innerHTML="
a",(i=(o=n.getElementsByTagName("a")[0])&&o.style)&&(i.cssText="float:left;opacity:.5",te.opacity="0.5"===i.opacity,te.cssFloat=!!i.cssFloat,n.style.backgroundClip="content-box",n.cloneNode(!0).style.backgroundClip="",te.clearCloneStyle="content-box"===n.style.backgroundClip,te.boxSizing=""===i.boxSizing||""===i.MozBoxSizing||""===i.WebkitBoxSizing,ne.extend(te,{reliableHiddenOffsets:function(){return null==a&&t(),a},boxSizingReliable:function(){return null==s&&t(),s},pixelPosition:function(){return null==r&&t(),r},reliableMarginRight:function(){return null==l&&t(),l}}))}(),ne.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};var tt=/alpha\([^)]*\)/i,nt=/opacity\s*=\s*([^)]*)/,it=/^(none|table(?!-c[ea]).+)/,ot=new RegExp("^("+Ce+")(.*)$","i"),rt=new RegExp("^([+-])=("+Ce+")","i"),st={position:"absolute",visibility:"hidden",display:"block"},at={letterSpacing:"0",fontWeight:"400"},lt=["Webkit","O","Moz","ms"];ne.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Ke(e,"opacity");return""===n?"1":n}}}},cssNumber:{columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{float:te.cssFloat?"cssFloat":"styleFloat"},style:function(e,t,n,i){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var o,r,s,a=ne.camelCase(t),l=e.style;if(t=ne.cssProps[a]||(ne.cssProps[a]=k(l,a)),s=ne.cssHooks[t]||ne.cssHooks[a],void 0===n)return s&&"get"in s&&void 0!==(o=s.get(e,!1,i))?o:l[t];if("string"==(r=typeof n)&&(o=rt.exec(n))&&(n=(o[1]+1)*o[2]+parseFloat(ne.css(e,t)),r="number"),null!=n&&n===n&&("number"!==r||ne.cssNumber[a]||(n+="px"),te.clearCloneStyle||""!==n||0!==t.indexOf("background")||(l[t]="inherit"),!(s&&"set"in s&&void 0===(n=s.set(e,n,i)))))try{l[t]=n}catch(e){}}},css:function(e,t,n,i){var o,r,s,a=ne.camelCase(t);return t=ne.cssProps[a]||(ne.cssProps[a]=k(e.style,a)),(s=ne.cssHooks[t]||ne.cssHooks[a])&&"get"in s&&(r=s.get(e,!0,n)),void 0===r&&(r=Ke(e,t,i)),"normal"===r&&t in at&&(r=at[t]),""===n||n?(o=parseFloat(r),!0===n||ne.isNumeric(o)?o||0:r):r}}),ne.each(["height","width"],function(e,t){ne.cssHooks[t]={get:function(e,n,i){if(n)return it.test(ne.css(e,"display"))&&0===e.offsetWidth?ne.swap(e,st,function(){return H(e,t,i)}):H(e,t,i)},set:function(e,n,i){var o=i&&Ge(e);return D(0,n,i?A(e,t,i,te.boxSizing&&"border-box"===ne.css(e,"boxSizing",!1,o),o):0)}}}),te.opacity||(ne.cssHooks.opacity={get:function(e,t){return nt.test((t&&e.currentStyle?e.currentStyle.filter:e.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":t?"1":""},set:function(e,t){var n=e.style,i=e.currentStyle,o=ne.isNumeric(t)?"alpha(opacity="+100*t+")":"",r=i&&i.filter||n.filter||"";n.zoom=1,(t>=1||""===t)&&""===ne.trim(r.replace(tt,""))&&n.removeAttribute&&(n.removeAttribute("filter"),""===t||i&&!i.filter)||(n.filter=tt.test(r)?r.replace(tt,o):r+" "+o)}}),ne.cssHooks.marginRight=E(te.reliableMarginRight,function(e,t){if(t)return ne.swap(e,{display:"inline-block"},Ke,[e,"marginRight"])}),ne.each({margin:"",padding:"",border:"Width"},function(e,t){ne.cssHooks[e+t]={expand:function(n){for(var i=0,o={},r="string"==typeof n?n.split(" "):[n];i<4;i++)o[e+_e[i]+t]=r[i]||r[i-2]||r[0];return o}},Je.test(e)||(ne.cssHooks[e+t].set=D)}),ne.fn.extend({css:function(e,t){return Ee(this,function(e,t,n){var i,o,r={},s=0;if(ne.isArray(t)){for(i=Ge(e),o=t.length;s1)},show:function(){return S(this,!0)},hide:function(){return S(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){Ne(this)?ne(this).show():ne(this).hide()})}}),ne.Tween=P,P.prototype={constructor:P,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||(ne.cssNumber[n]?"":"px")},cur:function(){var e=P.propHooks[this.prop];return e&&e.get?e.get(this):P.propHooks._default.get(this)},run:function(e){var t,n=P.propHooks[this.prop];return this.options.duration?this.pos=t=ne.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=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):P.propHooks._default.set(this),this}},P.prototype.init.prototype=P.prototype,P.propHooks={_default:{get:function(e){var t;return null==e.elem[e.prop]||e.elem.style&&null!=e.elem.style[e.prop]?(t=ne.css(e.elem,e.prop,""))&&"auto"!==t?t:0:e.elem[e.prop]},set:function(e){ne.fx.step[e.prop]?ne.fx.step[e.prop](e):e.elem.style&&(null!=e.elem.style[ne.cssProps[e.prop]]||ne.cssHooks[e.prop])?ne.style(e.elem,e.prop,e.now+e.unit):e.elem[e.prop]=e.now}}},P.propHooks.scrollTop=P.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},ne.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2}},ne.fx=P.prototype.init,ne.fx.step={};var ut,ct,ft=/^(?:toggle|show|hide)$/,pt=new RegExp("^(?:([+-])=|)("+Ce+")([a-z%]*)$","i"),dt=/queueHooks$/,ht=[function(e,t,n){var i,o,r,s,a,l,u,c=this,f={},p=e.style,d=e.nodeType&&Ne(e),h=ne._data(e,"fxshow");n.queue||(null==(a=ne._queueHooks(e,"fx")).unqueued&&(a.unqueued=0,l=a.empty.fire,a.empty.fire=function(){a.unqueued||l()}),a.unqueued++,c.always(function(){c.always(function(){a.unqueued--,ne.queue(e,"fx").length||a.empty.fire()})})),1===e.nodeType&&("height"in t||"width"in t)&&(n.overflow=[p.overflow,p.overflowX,p.overflowY],"inline"===("none"===(u=ne.css(e,"display"))?ne._data(e,"olddisplay")||N(e.nodeName):u)&&"none"===ne.css(e,"float")&&(te.inlineBlockNeedsLayout&&"inline"!==N(e.nodeName)?p.zoom=1:p.display="inline-block")),n.overflow&&(p.overflow="hidden",te.shrinkWrapBlocks()||c.always(function(){p.overflow=n.overflow[0],p.overflowX=n.overflow[1],p.overflowY=n.overflow[2]}));for(i in t)if(o=t[i],ft.exec(o)){if(delete t[i],r=r||"toggle"===o,o===(d?"hide":"show")){if("show"!==o||!h||void 0===h[i])continue;d=!0}f[i]=h&&h[i]||ne.style(e,i)}else u=void 0;if(ne.isEmptyObject(f))"inline"===("none"===u?N(e.nodeName):u)&&(p.display=u);else{h?"hidden"in h&&(d=h.hidden):h=ne._data(e,"fxshow",{}),r&&(h.hidden=!d),d?ne(e).show():c.done(function(){ne(e).hide()}),c.done(function(){var t;ne._removeData(e,"fxshow");for(t in f)ne.style(e,t,f[t])});for(i in f)s=M(d?h[i]:0,i,c),i in h||(h[i]=s.start,d&&(s.end=s.start,s.start="width"===i||"height"===i?1:0))}}],gt={"*":[function(e,t){var n=this.createTween(e,t),i=n.cur(),o=pt.exec(t),r=o&&o[3]||(ne.cssNumber[e]?"":"px"),s=(ne.cssNumber[e]||"px"!==r&&+i)&&pt.exec(ne.css(n.elem,e)),a=1,l=20;if(s&&s[3]!==r){r=r||s[3],o=o||[],s=+i||1;do{s/=a=a||".5",ne.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}]};ne.Animation=ne.extend(I,{tweener:function(e,t){ne.isFunction(e)?(t=e,e=["*"]):e=e.split(" ");for(var n,i=0,o=e.length;i
a",i=t.getElementsByTagName("a")[0],o=(n=pe.createElement("select")).appendChild(pe.createElement("option")),e=t.getElementsByTagName("input")[0],i.style.cssText="top:1px",te.getSetAttribute="t"!==t.className,te.style=/top/.test(i.getAttribute("style")),te.hrefNormalized="/a"===i.getAttribute("href"),te.checkOn=!!e.value,te.optSelected=o.selected,te.enctype=!!pe.createElement("form").enctype,n.disabled=!0,te.optDisabled=!o.disabled,(e=pe.createElement("input")).setAttribute("value",""),te.input=""===e.getAttribute("value"),e.value="t",e.setAttribute("type","radio"),te.radioValue="t"===e.value}();var mt=/\r/g;ne.fn.extend({val:function(e){var t,n,i,o=this[0];{if(arguments.length)return i=ne.isFunction(e),this.each(function(n){var o;1===this.nodeType&&(null==(o=i?e.call(this,n,ne(this).val()):e)?o="":"number"==typeof o?o+="":ne.isArray(o)&&(o=ne.map(o,function(e){return null==e?"":e+""})),(t=ne.valHooks[this.type]||ne.valHooks[this.nodeName.toLowerCase()])&&"set"in t&&void 0!==t.set(this,o,"value")||(this.value=o))});if(o)return(t=ne.valHooks[o.type]||ne.valHooks[o.nodeName.toLowerCase()])&&"get"in t&&void 0!==(n=t.get(o,"value"))?n:"string"==typeof(n=o.value)?n.replace(mt,""):null==n?"":n}}}),ne.extend({valHooks:{option:{get:function(e){var t=ne.find.attr(e,"value");return null!=t?t:ne.trim(ne.text(e))}},select:{get:function(e){for(var t,n,i=e.options,o=e.selectedIndex,r="select-one"===e.type||o<0,s=r?null:[],a=r?o+1:i.length,l=o<0?a:r?o:0;l=0)try{i.selected=n=!0}catch(e){i.scrollHeight}else i.selected=!1;return n||(e.selectedIndex=-1),o}}}}),ne.each(["radio","checkbox"],function(){ne.valHooks[this]={set:function(e,t){if(ne.isArray(t))return e.checked=ne.inArray(ne(e).val(),t)>=0}},te.checkOn||(ne.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})});var vt,yt,bt=ne.expr.attrHandle,xt=/^(?:checked|selected)$/i,wt=te.getSetAttribute,Tt=te.input;ne.fn.extend({attr:function(e,t){return Ee(this,ne.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){ne.removeAttr(this,e)})}}),ne.extend({attr:function(e,t,n){var i,o,r=e.nodeType;if(e&&3!==r&&8!==r&&2!==r)return typeof e.getAttribute===xe?ne.prop(e,t,n):(1===r&&ne.isXMLDoc(e)||(t=t.toLowerCase(),i=ne.attrHooks[t]||(ne.expr.match.bool.test(t)?yt:vt)),void 0===n?i&&"get"in i&&null!==(o=i.get(e,t))?o:null==(o=ne.find.attr(e,t))?void 0:o:null!==n?i&&"set"in i&&void 0!==(o=i.set(e,n,t))?o:(e.setAttribute(t,n+""),n):void ne.removeAttr(e,t))},removeAttr:function(e,t){var n,i,o=0,r=t&&t.match(me);if(r&&1===e.nodeType)for(;n=r[o++];)i=ne.propFix[n]||n,ne.expr.match.bool.test(n)?Tt&&wt||!xt.test(n)?e[i]=!1:e[ne.camelCase("default-"+n)]=e[i]=!1:ne.attr(e,n,""),e.removeAttribute(wt?n:i)},attrHooks:{type:{set:function(e,t){if(!te.radioValue&&"radio"===t&&ne.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}}}),yt={set:function(e,t,n){return!1===t?ne.removeAttr(e,n):Tt&&wt||!xt.test(n)?e.setAttribute(!wt&&ne.propFix[n]||n,n):e[ne.camelCase("default-"+n)]=e[n]=!0,n}},ne.each(ne.expr.match.bool.source.match(/\w+/g),function(e,t){var n=bt[t]||ne.find.attr;bt[t]=Tt&&wt||!xt.test(t)?function(e,t,i){var o,r;return i||(r=bt[t],bt[t]=o,o=null!=n(e,t,i)?t.toLowerCase():null,bt[t]=r),o}:function(e,t,n){if(!n)return e[ne.camelCase("default-"+t)]?t.toLowerCase():null}}),Tt&&wt||(ne.attrHooks.value={set:function(e,t,n){if(!ne.nodeName(e,"input"))return vt&&vt.set(e,t,n);e.defaultValue=t}}),wt||(vt={set:function(e,t,n){var i=e.getAttributeNode(n);if(i||e.setAttributeNode(i=e.ownerDocument.createAttribute(n)),i.value=t+="","value"===n||t===e.getAttribute(n))return t}},bt.id=bt.name=bt.coords=function(e,t,n){var i;if(!n)return(i=e.getAttributeNode(t))&&""!==i.value?i.value:null},ne.valHooks.button={get:function(e,t){var n=e.getAttributeNode(t);if(n&&n.specified)return n.value},set:vt.set},ne.attrHooks.contenteditable={set:function(e,t,n){vt.set(e,""!==t&&t,n)}},ne.each(["width","height"],function(e,t){ne.attrHooks[t]={set:function(e,n){if(""===n)return e.setAttribute(t,"auto"),n}}})),te.style||(ne.attrHooks.style={get:function(e){return e.style.cssText||void 0},set:function(e,t){return e.style.cssText=t+""}});var Ct=/^(?:input|select|textarea|button|object)$/i,_t=/^(?:a|area)$/i;ne.fn.extend({prop:function(e,t){return Ee(this,ne.prop,e,t,arguments.length>1)},removeProp:function(e){return e=ne.propFix[e]||e,this.each(function(){try{this[e]=void 0,delete this[e]}catch(e){}})}}),ne.extend({propFix:{for:"htmlFor",class:"className"},prop:function(e,t,n){var i,o,r=e.nodeType;if(e&&3!==r&&8!==r&&2!==r)return(1!==r||!ne.isXMLDoc(e))&&(t=ne.propFix[t]||t,o=ne.propHooks[t]),void 0!==n?o&&"set"in o&&void 0!==(i=o.set(e,n,t))?i:e[t]=n:o&&"get"in o&&null!==(i=o.get(e,t))?i:e[t]},propHooks:{tabIndex:{get:function(e){var t=ne.find.attr(e,"tabindex");return t?parseInt(t,10):Ct.test(e.nodeName)||_t.test(e.nodeName)&&e.href?0:-1}}}}),te.hrefNormalized||ne.each(["href","src"],function(e,t){ne.propHooks[t]={get:function(e){return e.getAttribute(t,4)}}}),te.optSelected||(ne.propHooks.selected={get:function(e){var t=e.parentNode;return t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex),null}}),ne.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){ne.propFix[this.toLowerCase()]=this}),te.enctype||(ne.propFix.enctype="encoding");var Nt=/[\t\r\n\f]/g;ne.fn.extend({addClass:function(e){var t,n,i,o,r,s,a=0,l=this.length,u="string"==typeof e&&e;if(ne.isFunction(e))return this.each(function(t){ne(this).addClass(e.call(this,t,this.className))});if(u)for(t=(e||"").match(me)||[];a=0;)i=i.replace(" "+o+" "," ");s=e?ne.trim(i):"",n.className!==s&&(n.className=s)}return this},toggleClass:function(e,t){var n=typeof e;return"boolean"==typeof t&&"string"===n?t?this.addClass(e):this.removeClass(e):ne.isFunction(e)?this.each(function(n){ne(this).toggleClass(e.call(this,n,this.className,t),t)}):this.each(function(){if("string"===n)for(var t,i=0,o=ne(this),r=e.match(me)||[];t=r[i++];)o.hasClass(t)?o.removeClass(t):o.addClass(t);else n!==xe&&"boolean"!==n||(this.className&&ne._data(this,"__className__",this.className),this.className=this.className||!1===e?"":ne._data(this,"__className__")||"")})},hasClass:function(e){for(var t=" "+e+" ",n=0,i=this.length;n=0)return!0;return!1}}),ne.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){ne.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}}),ne.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 Et=ne.now(),kt=/\?/,St=/^[\],:{}\s]*$/,Dt=/(?:^|:|,)(?:\s*\[)+/g,At=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,Ht=/"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g;ne.parseJSON=function(t){return e.JSON&&e.JSON.parse?e.JSON.parse(t):null===t?t:"string"==typeof t&&(t=ne.trim(t))&&St.test(t.replace(At,"@").replace(Ht,"]").replace(Dt,""))?new Function("return "+t)():void ne.error("Invalid JSON: "+t)},ne.parseXML=function(t){var n,i;if(!t||"string"!=typeof t)return null;try{e.DOMParser?(i=new DOMParser,n=i.parseFromString(t,"text/xml")):((n=new ActiveXObject("Microsoft.XMLDOM")).async="false",n.loadXML(t))}catch(e){n=void 0}return n&&n.documentElement&&!n.getElementsByTagName("parsererror").length||ne.error("Invalid XML: "+t),n};var Pt,jt,Lt=/#.*$/,Mt=/([?&])_=[^&]*/,Wt=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,It=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Ot=/^(?:GET|HEAD)$/,Ft=/^\/\//,qt=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,Rt={},Bt={},zt="*/".concat("*");try{jt=location.href}catch(e){(jt=pe.createElement("a")).href="",jt=jt.href}Pt=qt.exec(jt.toLowerCase())||[],ne.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:jt,type:"GET",isLocal:It.test(Pt[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":zt,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":ne.parseJSON,"text xml":ne.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?q(q(e,ne.ajaxSettings),t):q(ne.ajaxSettings,e)},ajaxPrefilter:O(Rt),ajaxTransport:O(Bt),ajax:function(e,t){function n(e,t,n,i){var o,c,v,y,x,T=t;2!==b&&(b=2,a&&clearTimeout(a),u=void 0,s=i||"",w.readyState=e>0?4:0,o=e>=200&&e<300||304===e,n&&(y=R(f,w,n)),y=B(f,y,w,o),o?(f.ifModified&&((x=w.getResponseHeader("Last-Modified"))&&(ne.lastModified[r]=x),(x=w.getResponseHeader("etag"))&&(ne.etag[r]=x)),204===e||"HEAD"===f.type?T="nocontent":304===e?T="notmodified":(T=y.state,c=y.data,o=!(v=y.error))):(v=T,!e&&T||(T="error",e<0&&(e=0))),w.status=e,w.statusText=(t||T)+"",o?h.resolveWith(p,[c,T,w]):h.rejectWith(p,[w,T,v]),w.statusCode(m),m=void 0,l&&d.trigger(o?"ajaxSuccess":"ajaxError",[w,f,o?c:v]),g.fireWith(p,[w,T]),l&&(d.trigger("ajaxComplete",[w,f]),--ne.active||ne.event.trigger("ajaxStop")))}"object"==typeof e&&(t=e,e=void 0),t=t||{};var i,o,r,s,a,l,u,c,f=ne.ajaxSetup({},t),p=f.context||f,d=f.context&&(p.nodeType||p.jquery)?ne(p):ne.event,h=ne.Deferred(),g=ne.Callbacks("once memory"),m=f.statusCode||{},v={},y={},b=0,x="canceled",w={readyState:0,getResponseHeader:function(e){var t;if(2===b){if(!c)for(c={};t=Wt.exec(s);)c[t[1].toLowerCase()]=t[2];t=c[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return 2===b?s:null},setRequestHeader:function(e,t){var n=e.toLowerCase();return b||(e=y[n]=y[n]||e,v[e]=t),this},overrideMimeType:function(e){return b||(f.mimeType=e),this},statusCode:function(e){var t;if(e)if(b<2)for(t in e)m[t]=[m[t],e[t]];else w.always(e[w.status]);return this},abort:function(e){var t=e||x;return u&&u.abort(t),n(0,t),this}};if(h.promise(w).complete=g.add,w.success=w.done,w.error=w.fail,f.url=((e||f.url||jt)+"").replace(Lt,"").replace(Ft,Pt[1]+"//"),f.type=t.method||t.type||f.method||f.type,f.dataTypes=ne.trim(f.dataType||"*").toLowerCase().match(me)||[""],null==f.crossDomain&&(i=qt.exec(f.url.toLowerCase()),f.crossDomain=!(!i||i[1]===Pt[1]&&i[2]===Pt[2]&&(i[3]||("http:"===i[1]?"80":"443"))===(Pt[3]||("http:"===Pt[1]?"80":"443")))),f.data&&f.processData&&"string"!=typeof f.data&&(f.data=ne.param(f.data,f.traditional)),F(Rt,f,t,w),2===b)return w;(l=ne.event&&f.global)&&0==ne.active++&&ne.event.trigger("ajaxStart"),f.type=f.type.toUpperCase(),f.hasContent=!Ot.test(f.type),r=f.url,f.hasContent||(f.data&&(r=f.url+=(kt.test(r)?"&":"?")+f.data,delete f.data),!1===f.cache&&(f.url=Mt.test(r)?r.replace(Mt,"$1_="+Et++):r+(kt.test(r)?"&":"?")+"_="+Et++)),f.ifModified&&(ne.lastModified[r]&&w.setRequestHeader("If-Modified-Since",ne.lastModified[r]),ne.etag[r]&&w.setRequestHeader("If-None-Match",ne.etag[r])),(f.data&&f.hasContent&&!1!==f.contentType||t.contentType)&&w.setRequestHeader("Content-Type",f.contentType),w.setRequestHeader("Accept",f.dataTypes[0]&&f.accepts[f.dataTypes[0]]?f.accepts[f.dataTypes[0]]+("*"!==f.dataTypes[0]?", "+zt+"; q=0.01":""):f.accepts["*"]);for(o in f.headers)w.setRequestHeader(o,f.headers[o]);if(f.beforeSend&&(!1===f.beforeSend.call(p,w,f)||2===b))return w.abort();x="abort";for(o in{success:1,error:1,complete:1})w[o](f[o]);if(u=F(Bt,f,t,w)){w.readyState=1,l&&d.trigger("ajaxSend",[w,f]),f.async&&f.timeout>0&&(a=setTimeout(function(){w.abort("timeout")},f.timeout));try{b=1,u.send(v,n)}catch(e){if(!(b<2))throw e;n(-1,e)}}else n(-1,"No Transport");return w},getJSON:function(e,t,n){return ne.get(e,t,n,"json")},getScript:function(e,t){return ne.get(e,void 0,t,"script")}}),ne.each(["get","post"],function(e,t){ne[t]=function(e,n,i,o){return ne.isFunction(n)&&(o=o||i,i=n,n=void 0),ne.ajax({url:e,type:t,dataType:o,data:n,success:i})}}),ne._evalUrl=function(e){return ne.ajax({url:e,type:"GET",dataType:"script",async:!1,global:!1,throws:!0})},ne.fn.extend({wrapAll:function(e){if(ne.isFunction(e))return this.each(function(t){ne(this).wrapAll(e.call(this,t))});if(this[0]){var t=ne(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){for(var e=this;e.firstChild&&1===e.firstChild.nodeType;)e=e.firstChild;return e}).append(this)}return this},wrapInner:function(e){return ne.isFunction(e)?this.each(function(t){ne(this).wrapInner(e.call(this,t))}):this.each(function(){var t=ne(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=ne.isFunction(e);return this.each(function(n){ne(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){ne.nodeName(this,"body")||ne(this).replaceWith(this.childNodes)}).end()}}),ne.expr.filters.hidden=function(e){return e.offsetWidth<=0&&e.offsetHeight<=0||!te.reliableHiddenOffsets()&&"none"===(e.style&&e.style.display||ne.css(e,"display"))},ne.expr.filters.visible=function(e){return!ne.expr.filters.hidden(e)};var $t=/%20/g,Xt=/\[\]$/,Ut=/\r?\n/g,Qt=/^(?:submit|button|image|reset|file)$/i,Yt=/^(?:input|select|textarea|keygen)/i;ne.param=function(e,t){var n,i=[],o=function(e,t){t=ne.isFunction(t)?t():null==t?"":t,i[i.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};if(void 0===t&&(t=ne.ajaxSettings&&ne.ajaxSettings.traditional),ne.isArray(e)||e.jquery&&!ne.isPlainObject(e))ne.each(e,function(){o(this.name,this.value)});else for(n in e)z(n,e[n],t,o);return i.join("&").replace($t,"+")},ne.fn.extend({serialize:function(){return ne.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=ne.prop(this,"elements");return e?ne.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!ne(this).is(":disabled")&&Yt.test(this.nodeName)&&!Qt.test(e)&&(this.checked||!ke.test(e))}).map(function(e,t){var n=ne(this).val();return null==n?null:ne.isArray(n)?ne.map(n,function(e){return{name:t.name,value:e.replace(Ut,"\r\n")}}):{name:t.name,value:n.replace(Ut,"\r\n")}}).get()}}),ne.ajaxSettings.xhr=void 0!==e.ActiveXObject?function(){return!this.isLocal&&/^(get|post|head|put|delete|options)$/i.test(this.type)&&$()||X()}:$;var Vt=0,Gt={},Kt=ne.ajaxSettings.xhr();e.attachEvent&&e.attachEvent("onunload",function(){for(var e in Gt)Gt[e](void 0,!0)}),te.cors=!!Kt&&"withCredentials"in Kt,(Kt=te.ajax=!!Kt)&&ne.ajaxTransport(function(e){if(!e.crossDomain||te.cors){var t;return{send:function(n,i){var o,r=e.xhr(),s=++Vt;if(r.open(e.type,e.url,e.async,e.username,e.password),e.xhrFields)for(o in e.xhrFields)r[o]=e.xhrFields[o];e.mimeType&&r.overrideMimeType&&r.overrideMimeType(e.mimeType),e.crossDomain||n["X-Requested-With"]||(n["X-Requested-With"]="XMLHttpRequest");for(o in n)void 0!==n[o]&&r.setRequestHeader(o,n[o]+"");r.send(e.hasContent&&e.data||null),t=function(n,o){var a,l,u;if(t&&(o||4===r.readyState))if(delete Gt[s],t=void 0,r.onreadystatechange=ne.noop,o)4!==r.readyState&&r.abort();else{u={},a=r.status,"string"==typeof r.responseText&&(u.text=r.responseText);try{l=r.statusText}catch(e){l=""}a||!e.isLocal||e.crossDomain?1223===a&&(a=204):a=u.text?200:404}u&&i(a,l,u,r.getAllResponseHeaders())},e.async?4===r.readyState?setTimeout(t):r.onreadystatechange=Gt[s]=t:t()},abort:function(){t&&t(void 0,!0)}}}}),ne.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(e){return ne.globalEval(e),e}}}),ne.ajaxPrefilter("script",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET",e.global=!1)}),ne.ajaxTransport("script",function(e){if(e.crossDomain){var t,n=pe.head||ne("head")[0]||pe.documentElement;return{send:function(i,o){(t=pe.createElement("script")).async=!0,e.scriptCharset&&(t.charset=e.scriptCharset),t.src=e.url,t.onload=t.onreadystatechange=function(e,n){(n||!t.readyState||/loaded|complete/.test(t.readyState))&&(t.onload=t.onreadystatechange=null,t.parentNode&&t.parentNode.removeChild(t),t=null,n||o(200,"success"))},n.insertBefore(t,n.firstChild)},abort:function(){t&&t.onload(void 0,!0)}}}});var Jt=[],Zt=/(=)\?(?=&|$)|\?\?/;ne.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Jt.pop()||ne.expando+"_"+Et++;return this[e]=!0,e}}),ne.ajaxPrefilter("json jsonp",function(t,n,i){var o,r,s,a=!1!==t.jsonp&&(Zt.test(t.url)?"url":"string"==typeof t.data&&!(t.contentType||"").indexOf("application/x-www-form-urlencoded")&&Zt.test(t.data)&&"data");if(a||"jsonp"===t.dataTypes[0])return o=t.jsonpCallback=ne.isFunction(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,a?t[a]=t[a].replace(Zt,"$1"+o):!1!==t.jsonp&&(t.url+=(kt.test(t.url)?"&":"?")+t.jsonp+"="+o),t.converters["script json"]=function(){return s||ne.error(o+" was not called"),s[0]},t.dataTypes[0]="json",r=e[o],e[o]=function(){s=arguments},i.always(function(){e[o]=r,t[o]&&(t.jsonpCallback=n.jsonpCallback,Jt.push(o)),s&&ne.isFunction(r)&&r(s[0]),s=r=void 0}),"script"}),ne.parseHTML=function(e,t,n){if(!e||"string"!=typeof e)return null;"boolean"==typeof t&&(n=t,t=!1),t=t||pe;var i=ue.exec(e),o=!n&&[];return i?[t.createElement(i[1])]:(i=ne.buildFragment([e],t,o),o&&o.length&&ne(o).remove(),ne.merge([],i.childNodes))};var en=ne.fn.load;ne.fn.load=function(e,t,n){if("string"!=typeof e&&en)return en.apply(this,arguments);var i,o,r,s=this,a=e.indexOf(" ");return a>=0&&(i=ne.trim(e.slice(a,e.length)),e=e.slice(0,a)),ne.isFunction(t)?(n=t,t=void 0):t&&"object"==typeof t&&(r="POST"),s.length>0&&ne.ajax({url:e,type:r,dataType:"html",data:t}).done(function(e){o=arguments,s.html(i?ne("
").append(ne.parseHTML(e)).find(i):e)}).complete(n&&function(e,t){s.each(n,o||[e.responseText,t,e])}),this},ne.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){ne.fn[t]=function(e){return this.on(t,e)}}),ne.expr.filters.animated=function(e){return ne.grep(ne.timers,function(t){return e===t.elem}).length};var tn=e.document.documentElement;ne.offset={setOffset:function(e,t,n){var i,o,r,s,a,l,u=ne.css(e,"position"),c=ne(e),f={};"static"===u&&(e.style.position="relative"),a=c.offset(),r=ne.css(e,"top"),l=ne.css(e,"left"),("absolute"===u||"fixed"===u)&&ne.inArray("auto",[r,l])>-1?(s=(i=c.position()).top,o=i.left):(s=parseFloat(r)||0,o=parseFloat(l)||0),ne.isFunction(t)&&(t=t.call(e,n,a)),null!=t.top&&(f.top=t.top-a.top+s),null!=t.left&&(f.left=t.left-a.left+o),"using"in t?t.using.call(e,f):c.css(f)}},ne.fn.extend({offset:function(e){if(arguments.length)return void 0===e?this:this.each(function(t){ne.offset.setOffset(this,e,t)});var t,n,i={top:0,left:0},o=this[0],r=o&&o.ownerDocument;if(r)return t=r.documentElement,ne.contains(t,o)?(typeof o.getBoundingClientRect!==xe&&(i=o.getBoundingClientRect()),n=U(r),{top:i.top+(n.pageYOffset||t.scrollTop)-(t.clientTop||0),left:i.left+(n.pageXOffset||t.scrollLeft)-(t.clientLeft||0)}):i},position:function(){if(this[0]){var e,t,n={top:0,left:0},i=this[0];return"fixed"===ne.css(i,"position")?t=i.getBoundingClientRect():(e=this.offsetParent(),t=this.offset(),ne.nodeName(e[0],"html")||(n=e.offset()),n.top+=ne.css(e[0],"borderTopWidth",!0),n.left+=ne.css(e[0],"borderLeftWidth",!0)),{top:t.top-n.top-ne.css(i,"marginTop",!0),left:t.left-n.left-ne.css(i,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var e=this.offsetParent||tn;e&&!ne.nodeName(e,"html")&&"static"===ne.css(e,"position");)e=e.offsetParent;return e||tn})}}),ne.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,t){var n=/Y/.test(t);ne.fn[e]=function(i){return Ee(this,function(e,i,o){var r=U(e);if(void 0===o)return r?t in r?r[t]:r.document.documentElement[i]:e[i];r?r.scrollTo(n?ne(r).scrollLeft():o,n?o:ne(r).scrollTop()):e[i]=o},e,i,arguments.length,null)}}),ne.each(["top","left"],function(e,t){ne.cssHooks[t]=E(te.pixelPosition,function(e,n){if(n)return n=Ke(e,t),Ze.test(n)?ne(e).position()[t]+"px":n})}),ne.each({Height:"height",Width:"width"},function(e,t){ne.each({padding:"inner"+e,content:t,"":"outer"+e},function(n,i){ne.fn[i]=function(i,o){var r=arguments.length&&(n||"boolean"!=typeof i),s=n||(!0===i||!0===o?"margin":"border");return Ee(this,function(t,n,i){var o;return ne.isWindow(t)?t.document.documentElement["client"+e]:9===t.nodeType?(o=t.documentElement,Math.max(t.body["scroll"+e],o["scroll"+e],t.body["offset"+e],o["offset"+e],o["client"+e])):void 0===i?ne.css(t,n,s):ne.style(t,n,i,s)},t,r?i:void 0,r,null)}})}),ne.fn.size=function(){return this.length},ne.fn.andSelf=ne.fn.addBack,"function"==typeof define&&define.amd&&define("jquery",[],function(){return ne});var nn=e.jQuery,on=e.$;return ne.noConflict=function(t){return e.$===ne&&(e.$=on),t&&e.jQuery===ne&&(e.jQuery=nn),ne},typeof t===xe&&(e.jQuery=e.$=ne),ne}),function(e){"function"==typeof define&&define.amd?define(["jquery"],e):e(jQuery)}(function(e){function t(t,i){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])&&n(s))):(/^(input|select|textarea|button|object)$/.test(a)?!t.disabled:"a"===a?t.href||i:i)&&n(t)}function n(t){return e.expr.filters.visible(t)&&!e(t).parents().addBack().filter(function(){return"hidden"===e.css(this,"visibility")}).length}e.ui=e.ui||{},e.extend(e.ui,{version:"1.11.4",keyCode:{BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38}}),e.fn.extend({scrollParent:function(t){var n=this.css("position"),i="absolute"===n,o=t?/(auto|scroll|hidden)/:/(auto|scroll)/,r=this.parents().filter(function(){var t=e(this);return(!i||"static"!==t.css("position"))&&o.test(t.css("overflow")+t.css("overflow-y")+t.css("overflow-x"))}).eq(0);return"fixed"!==n&&r.length?r:e(this[0].ownerDocument||document)},uniqueId:function(){var e=0;return function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++e)})}}(),removeUniqueId:function(){return this.each(function(){/^ui-id-\d+$/.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(n){return t(n,!isNaN(e.attr(n,"tabindex")))},tabbable:function(n){var i=e.attr(n,"tabindex"),o=isNaN(i);return(o||i>=0)&&t(n,!o)}}),e("").outerWidth(1).jquery||e.each(["Width","Height"],function(t,n){function i(t,n,i,r){return e.each(o,function(){n-=parseFloat(e.css(t,"padding"+this))||0,i&&(n-=parseFloat(e.css(t,"border"+this+"Width"))||0),r&&(n-=parseFloat(e.css(t,"margin"+this))||0)}),n}var o="Width"===n?["Left","Right"]:["Top","Bottom"],r=n.toLowerCase(),s={innerWidth:e.fn.innerWidth,innerHeight:e.fn.innerHeight,outerWidth:e.fn.outerWidth,outerHeight:e.fn.outerHeight};e.fn["inner"+n]=function(t){return void 0===t?s["inner"+n].call(this):this.each(function(){e(this).css(r,i(this,t)+"px")})},e.fn["outer"+n]=function(t,o){return"number"!=typeof t?s["outer"+n].call(this,t):this.each(function(){e(this).css(r,i(this,t,!0,o)+"px")})}}),e.fn.addBack||(e.fn.addBack=function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}),e("").data("a-b","a").removeData("a-b").data("a-b")&&(e.fn.removeData=function(t){return function(n){return arguments.length?t.call(this,e.camelCase(n)):t.call(this)}}(e.fn.removeData)),e.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase()),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),disableSelection:function(){var e="onselectstart"in document.createElement("div")?"selectstart":"mousedown";return function(){return this.bind(e+".ui-disableSelection",function(e){e.preventDefault()})}}(),enableSelection:function(){return this.unbind(".ui-disableSelection")},zIndex:function(t){if(void 0!==t)return this.css("zIndex",t);if(this.length)for(var n,i,o=e(this[0]);o.length&&o[0]!==document;){if(("absolute"===(n=o.css("position"))||"relative"===n||"fixed"===n)&&(i=parseInt(o.css("zIndex"),10),!isNaN(i)&&0!==i))return i;o=o.parent()}return 0}}),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,i){var o,r=e.plugins[t];if(r&&(i||e.element[0].parentNode&&11!==e.element[0].parentNode.nodeType))for(o=0;o",options:{disabled:!1,create:null},_createWidget:function(t,n){n=e(n||this.defaultElement||this)[0],this.element=e(n),this.uuid=i++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=e(),this.hoverable=e(),this.focusable=e(),n!==this&&(e.data(n,this.widgetFullName,this),this._on(!0,this.element,{remove:function(e){e.target===n&&this.destroy()}}),this.document=e(n.style?n.ownerDocument:n.document||n),this.window=e(this.document[0].defaultView||this.document[0].parentWindow)),this.options=e.widget.extend({},this.options,this._getCreateOptions(),t),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.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(t,n){var i,o,r,s=t;if(0===arguments.length)return e.widget.extend({},this.options);if("string"==typeof t)if(s={},i=t.split("."),t=i.shift(),i.length){for(o=s[t]=e.widget.extend({},this.options[t]),r=0;r=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}});!function(){function t(e,t,n){return[parseFloat(e[0])*(d.test(e[0])?t/100:1),parseFloat(e[1])*(d.test(e[1])?n/100:1)]}function n(t,n){return parseInt(e.css(t,n),10)||0}function i(t){var n=t[0];return 9===n.nodeType?{width:t.width(),height:t.height(),offset:{top:0,left:0}}:e.isWindow(n)?{width:t.width(),height:t.height(),offset:{top:t.scrollTop(),left:t.scrollLeft()}}:n.preventDefault?{width:0,height:0,offset:{top:n.pageY,left:n.pageX}}:{width:t.outerWidth(),height:t.outerHeight(),offset:t.offset()}}e.ui=e.ui||{};var o,r,s=Math.max,a=Math.abs,l=Math.round,u=/left|center|right/,c=/top|center|bottom/,f=/[\+\-]\d+(\.[\d]+)?%?/,p=/^\w+/,d=/%$/,h=e.fn.position;e.position={scrollbarWidth:function(){if(void 0!==o)return o;var t,n,i=e("
"),r=i.children()[0];return e("body").append(i),t=r.offsetWidth,i.css("overflow","scroll"),n=r.offsetWidth,t===n&&(n=i[0].clientWidth),i.remove(),o=t-n},getScrollInfo:function(t){var n=t.isWindow||t.isDocument?"":t.element.css("overflow-x"),i=t.isWindow||t.isDocument?"":t.element.css("overflow-y"),o="scroll"===n||"auto"===n&&t.width0?"right":"center",vertical:r<0?"top":i>0?"bottom":"middle"};gs(a(i),a(r))?l.important="horizontal":l.important="vertical",o.using.call(this,e,l)}),c.offset(e.extend(k,{using:u}))})},e.ui.position={fit:{left:function(e,t){var n,i=t.within,o=i.isWindow?i.scrollLeft:i.offset.left,r=i.width,a=e.left-t.collisionPosition.marginLeft,l=o-a,u=a+t.collisionWidth-r-o;t.collisionWidth>r?l>0&&u<=0?(n=e.left+l+t.collisionWidth-r-o,e.left+=l-n):e.left=u>0&&l<=0?o:l>u?o+r-t.collisionWidth:o:l>0?e.left+=l:u>0?e.left-=u:e.left=s(e.left-a,e.left)},top:function(e,t){var n,i=t.within,o=i.isWindow?i.scrollTop:i.offset.top,r=t.within.height,a=e.top-t.collisionPosition.marginTop,l=o-a,u=a+t.collisionHeight-r-o;t.collisionHeight>r?l>0&&u<=0?(n=e.top+l+t.collisionHeight-r-o,e.top+=l-n):e.top=u>0&&l<=0?o:l>u?o+r-t.collisionHeight:o:l>0?e.top+=l:u>0?e.top-=u:e.top=s(e.top-a,e.top)}},flip:{left:function(e,t){var n,i,o=t.within,r=o.offset.left+o.scrollLeft,s=o.width,l=o.isWindow?o.scrollLeft:o.offset.left,u=e.left-t.collisionPosition.marginLeft,c=u-l,f=u+t.collisionWidth-s-l,p="left"===t.my[0]?-t.elemWidth:"right"===t.my[0]?t.elemWidth:0,d="left"===t.at[0]?t.targetWidth:"right"===t.at[0]?-t.targetWidth:0,h=-2*t.offset[0];c<0?((n=e.left+p+d+h+t.collisionWidth-s-r)<0||n0&&((i=e.left-t.collisionPosition.marginLeft+p+d+h-l)>0||a(i)0&&((n=e.top-t.collisionPosition.marginTop+p+d+h-l)>0||a(n)10&&o<11,t.innerHTML="",n.removeChild(t)}()}();e.ui.position;e.widget("ui.draggable",e.ui.mouse,{version:"1.11.4",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&&this._setPositionRelative(),this.options.addClasses&&this.element.addClass("ui-draggable"),this.options.disabled&&this.element.addClass("ui-draggable-disabled"),this._setHandleClassName(),this._mouseInit()},_setOption:function(e,t){this._super(e,t),"handle"===e&&(this._removeHandleClassName(),this._setHandleClassName())},_destroy:function(){(this.helper||this.element).is(".ui-draggable-dragging")?this.destroyOnClear=!0:(this.element.removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled"),this._removeHandleClassName(),this._mouseDestroy())},_mouseCapture:function(t){var n=this.options;return this._blurActiveElement(t),!(this.helper||n.disabled||e(t.target).closest(".ui-resizable-handle").length>0)&&(this.handle=this._getHandle(t),!!this.handle&&(this._blockFrames(!0===n.iframeFix?"iframe":n.iframeFix),!0))},_blockFrames:function(t){this.iframeBlocks=this.document.find(t).map(function(){var t=e(this);return e("
").css("position","absolute").appendTo(t.parent()).outerWidth(t.outerWidth()).outerHeight(t.outerHeight()).offset(t.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_blurActiveElement:function(t){var n=this.document[0];if(this.handleElement.is(t.target))try{n.activeElement&&"body"!==n.activeElement.nodeName.toLowerCase()&&e(n.activeElement).blur()}catch(e){}},_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(!0),this.offsetParent=this.helper.offsetParent(),this.hasFixedAncestor=this.helper.parents().filter(function(){return"fixed"===e(this).css("position")}).length>0,this.positionAbs=this.element.offset(),this._refreshOffsets(t),this.originalPosition=this.position=this._generatePosition(t,!1),this.originalPageX=t.pageX,this.originalPageY=t.pageY,n.cursorAt&&this._adjustOffsetFromHelper(n.cursorAt),this._setContainment(),!1===this._trigger("start",t)?(this._clear(),!1):(this._cacheHelperProportions(),e.ui.ddmanager&&!n.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,t),this._normalizeRightBottom(),this._mouseDrag(t,!0),e.ui.ddmanager&&e.ui.ddmanager.dragStart(this,t),!0)},_refreshOffsets:function(e){this.offset={top:this.positionAbs.top-this.margins.top,left:this.positionAbs.left-this.margins.left,scroll:!1,parent:this._getParentOffset(),relative:this._getRelativeOffset()},this.offset.click={left:e.pageX-this.offset.left,top:e.pageY-this.offset.top}},_mouseDrag:function(t,n){if(this.hasFixedAncestor&&(this.offset.parent=this._getParentOffset()),this.position=this._generatePosition(t,!0),this.positionAbs=this._convertPositionTo("absolute"),!n){var i=this._uiHash();if(!1===this._trigger("drag",t,i))return this._mouseUp({}),!1;this.position=i.position}return this.helper[0].style.left=this.position.left+"px",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),"invalid"===this.options.revert&&!i||"valid"===this.options.revert&&i||!0===this.options.revert||e.isFunction(this.options.revert)&&this.options.revert.call(this.element,i)?e(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){!1!==n._trigger("stop",t)&&n._clear()}):!1!==this._trigger("stop",t)&&this._clear(),!1},_mouseUp:function(t){return this._unblockFrames(),e.ui.ddmanager&&e.ui.ddmanager.dragStop(this,t),this.handleElement.is(t.target)&&this.element.focus(),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},_setHandleClassName:function(){this.handleElement=this.options.handle?this.element.find(this.options.handle):this.element,this.handleElement.addClass("ui-draggable-handle")},_removeHandleClassName:function(){this.handleElement.removeClass("ui-draggable-handle")},_createHelper:function(t){var n=this.options,i=e.isFunction(n.helper),o=i?e(n.helper.apply(this.element[0],[t])):"clone"===n.helper?this.element.clone().removeAttr("id"):this.element;return o.parents("body").length||o.appendTo("parent"===n.appendTo?this.element[0].parentNode:n.appendTo),i&&o[0]===this.element[0]&&this._setPositionRelative(),o[0]===this.element[0]||/(fixed|absolute)/.test(o.css("position"))||o.css("position","absolute"),o},_setPositionRelative:function(){/^(?:r|a|f)/.test(this.element.css("position"))||(this.element[0].style.position="relative")},_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)},_isRootNode:function(e){return/(html|body)/i.test(e.tagName)||e===this.document[0]},_getParentOffset:function(){var t=this.offsetParent.offset(),n=this.document[0];return"absolute"===this.cssPosition&&this.scrollParent[0]!==n&&e.contains(this.scrollParent[0],this.offsetParent[0])&&(t.left+=this.scrollParent.scrollLeft(),t.top+=this.scrollParent.scrollTop()),this._isRootNode(this.offsetParent[0])&&(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)return{top:0,left:0};var e=this.element.position(),t=this._isRootNode(this.scrollParent[0]);return{top:e.top-(parseInt(this.helper.css("top"),10)||0)+(t?0:this.scrollParent.scrollTop()),left:e.left-(parseInt(this.helper.css("left"),10)||0)+(t?0:this.scrollParent.scrollLeft())}},_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,r=this.document[0];this.relativeContainer=null,o.containment?"window"!==o.containment?"document"!==o.containment?o.containment.constructor!==Array?("parent"===o.containment&&(o.containment=this.helper[0].parentNode),(i=(n=e(o.containment))[0])&&(t=/(scroll|auto)/.test(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.relativeContainer=n)):this.containment=o.containment:this.containment=[0,0,e(r).width()-this.helperProportions.width-this.margins.left,(e(r).height()||r.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]: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()||r.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]:this.containment=null},_convertPositionTo:function(e,t){t||(t=this.position);var n="absolute"===e?1:-1,i=this._isRootNode(this.scrollParent[0]);return{top:t.top+this.offset.relative.top*n+this.offset.parent.top*n-("fixed"===this.cssPosition?-this.offset.scroll.top:i?0:this.offset.scroll.top)*n,left:t.left+this.offset.relative.left*n+this.offset.parent.left*n-("fixed"===this.cssPosition?-this.offset.scroll.left:i?0:this.offset.scroll.left)*n}},_generatePosition:function(e,t){var n,i,o,r,s=this.options,a=this._isRootNode(this.scrollParent[0]),l=e.pageX,u=e.pageY;return a&&this.offset.scroll||(this.offset.scroll={top:this.scrollParent.scrollTop(),left:this.scrollParent.scrollLeft()}),t&&(this.containment&&(this.relativeContainer?(i=this.relativeContainer.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,e.pageX-this.offset.click.leftn[2]&&(l=n[2]+this.offset.click.left),e.pageY-this.offset.click.top>n[3]&&(u=n[3]+this.offset.click.top)),s.grid&&(o=s.grid[1]?this.originalPageY+Math.round((u-this.originalPageY)/s.grid[1])*s.grid[1]:this.originalPageY,u=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),"y"===s.axis&&(l=this.originalPageX),"x"===s.axis&&(u=this.originalPageY)),{top:u-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.offset.scroll.top:a?0:this.offset.scroll.top),left:l-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.offset.scroll.left:a?0: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,this.destroyOnClear&&this.destroy()},_normalizeRightBottom:function(){"y"!==this.options.axis&&"auto"!==this.helper.css("right")&&(this.helper.width(this.helper.width()),this.helper.css("right","auto")),"x"!==this.options.axis&&"auto"!==this.helper.css("bottom")&&(this.helper.height(this.helper.height()),this.helper.css("bottom","auto"))},_trigger:function(t,n,i){return i=i||this._uiHash(),e.ui.plugin.call(this,t,[n,i,this],!0),/^(drag|start|stop)/.test(t)&&(this.positionAbs=this._convertPositionTo("absolute"),i.offset=this.positionAbs),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,i){var o=e.extend({},n,{item:i.element});i.sortables=[],e(i.options.connectToSortable).each(function(){var n=e(this).sortable("instance");n&&!n.options.disabled&&(i.sortables.push(n),n.refreshPositions(),n._trigger("activate",t,o))})},stop:function(t,n,i){var o=e.extend({},n,{item:i.element});i.cancelHelperRemoval=!1,e.each(i.sortables,function(){var e=this;e.isOver?(e.isOver=0,i.cancelHelperRemoval=!0,e.cancelHelperRemoval=!1,e._storedCSS={position:e.placeholder.css("position"),top:e.placeholder.css("top"),left:e.placeholder.css("left")},e._mouseStop(t),e.options.helper=e.options._helper):(e.cancelHelperRemoval=!0,e._trigger("deactivate",t,o))})},drag:function(t,n,i){e.each(i.sortables,function(){var o=!1,r=this;r.positionAbs=i.positionAbs,r.helperProportions=i.helperProportions,r.offset.click=i.offset.click,r._intersectsWith(r.containerCache)&&(o=!0,e.each(i.sortables,function(){return this.positionAbs=i.positionAbs,this.helperProportions=i.helperProportions,this.offset.click=i.offset.click,this!==r&&this._intersectsWith(this.containerCache)&&e.contains(r.element[0],this.element[0])&&(o=!1),o})),o?(r.isOver||(r.isOver=1,i._parent=n.helper.parent(),r.currentItem=n.helper.appendTo(r.element).data("ui-sortable-item",!0),r.options._helper=r.options.helper,r.options.helper=function(){return n.helper[0]},t.target=r.currentItem[0],r._mouseCapture(t,!0),r._mouseStart(t,!0,!0),r.offset.click.top=i.offset.click.top,r.offset.click.left=i.offset.click.left,r.offset.parent.left-=i.offset.parent.left-r.offset.parent.left,r.offset.parent.top-=i.offset.parent.top-r.offset.parent.top,i._trigger("toSortable",t),i.dropped=r.element,e.each(i.sortables,function(){this.refreshPositions()}),i.currentItem=i.element,r.fromOutside=i),r.currentItem&&(r._mouseDrag(t),n.position=r.position)):r.isOver&&(r.isOver=0,r.cancelHelperRemoval=!0,r.options._revert=r.options.revert,r.options.revert=!1,r._trigger("out",t,r._uiHash(r)),r._mouseStop(t,!0),r.options.revert=r.options._revert,r.options.helper=r.options._helper,r.placeholder&&r.placeholder.remove(),n.helper.appendTo(i._parent),i._refreshOffsets(t),n.position=i._generatePosition(t,!0),i._trigger("fromSortable",t),i.dropped=!1,e.each(i.sortables,function(){this.refreshPositions()}))})}}),e.ui.plugin.add("draggable","cursor",{start:function(t,n,i){var o=e("body"),r=i.options;o.css("cursor")&&(r._cursor=o.css("cursor")),o.css("cursor",r.cursor)},stop:function(t,n,i){var o=i.options;o._cursor&&e("body").css("cursor",o._cursor)}}),e.ui.plugin.add("draggable","opacity",{start:function(t,n,i){var o=e(n.helper),r=i.options;o.css("opacity")&&(r._opacity=o.css("opacity")),o.css("opacity",r.opacity)},stop:function(t,n,i){var o=i.options;o._opacity&&e(n.helper).css("opacity",o._opacity)}}),e.ui.plugin.add("draggable","scroll",{start:function(e,t,n){n.scrollParentNotHidden||(n.scrollParentNotHidden=n.helper.scrollParent(!1)),n.scrollParentNotHidden[0]!==n.document[0]&&"HTML"!==n.scrollParentNotHidden[0].tagName&&(n.overflowOffset=n.scrollParentNotHidden.offset())},drag:function(t,n,i){var o=i.options,r=!1,s=i.scrollParentNotHidden[0],a=i.document[0];s!==a&&"HTML"!==s.tagName?(o.axis&&"x"===o.axis||(i.overflowOffset.top+s.offsetHeight-t.pageY=0;p--)u=(l=i.snapElements[p].left-i.margins.left)+i.snapElements[p].width,f=(c=i.snapElements[p].top-i.margins.top)+i.snapElements[p].height,vu+g||bf+g||!e.contains(i.snapElements[p].item.ownerDocument,i.snapElements[p].item)?(i.snapElements[p].snapping&&i.options.snap.release&&i.options.snap.release.call(i.element,t,e.extend(i._uiHash(),{snapItem:i.snapElements[p].item})),i.snapElements[p].snapping=!1):("inner"!==h.snapMode&&(o=Math.abs(c-b)<=g,r=Math.abs(f-y)<=g,s=Math.abs(l-v)<=g,a=Math.abs(u-m)<=g,o&&(n.position.top=i._convertPositionTo("relative",{top:c-i.helperProportions.height,left:0}).top),r&&(n.position.top=i._convertPositionTo("relative",{top:f,left:0}).top),s&&(n.position.left=i._convertPositionTo("relative",{top:0,left:l-i.helperProportions.width}).left),a&&(n.position.left=i._convertPositionTo("relative",{top:0,left:u}).left)),d=o||r||s||a,"outer"!==h.snapMode&&(o=Math.abs(c-y)<=g,r=Math.abs(f-b)<=g,s=Math.abs(l-m)<=g,a=Math.abs(u-v)<=g,o&&(n.position.top=i._convertPositionTo("relative",{top:c,left:0}).top),r&&(n.position.top=i._convertPositionTo("relative",{top:f-i.helperProportions.height,left:0}).top),s&&(n.position.left=i._convertPositionTo("relative",{top:0,left:l}).left),a&&(n.position.left=i._convertPositionTo("relative",{top:0,left:u-i.helperProportions.width}).left)),!i.snapElements[p].snapping&&(o||r||s||a||d)&&i.options.snap.snap&&i.options.snap.snap.call(i.element,t,e.extend(i._uiHash(),{snapItem:i.snapElements[p].item})),i.snapElements[p].snapping=o||r||s||a||d)}}),e.ui.plugin.add("draggable","stack",{start:function(t,n,i){var o,r=i.options,s=e.makeArray(e(r.stack)).sort(function(t,n){return(parseInt(e(t).css("zIndex"),10)||0)-(parseInt(e(n).css("zIndex"),10)||0)});s.length&&(o=parseInt(e(s[0]).css("zIndex"),10)||0,e(s).each(function(t){e(this).css("zIndex",o+t)}),this.css("zIndex",o+s.length))}}),e.ui.plugin.add("draggable","zIndex",{start:function(t,n,i){var o=e(n.helper),r=i.options;o.css("zIndex")&&(r._zIndex=o.css("zIndex")),o.css("zIndex",r.zIndex)},stop:function(t,n,i){var o=i.options;o._zIndex&&e(n.helper).css("zIndex",o._zIndex)}});e.ui.draggable;var s=e;e.effects={effect:{}},function(e,t){function n(e,t,n){var i=c[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")[0],d=e.each;p.style.cssText="background-color:rgba(1,1,1,.5)",f.rgba=p.style.backgroundColor.indexOf("rgba")>-1,d(u,function(e,t){t.cache="_"+e,t.props.alpha={idx:3,type:"percent",def:1}}),l.fn=e.extend(l.prototype,{parse:function(t,o,s,a){if(void 0===t)return this._rgba=[null,null,null,null],this;(t.jquery||t.nodeType)&&(t=e(t).css(o),o=void 0);var c=this,f=e.type(t),p=this._rgba=[];return void 0!==o&&(t=[t,o,s,a],f="array"),"string"===f?this.parse(i(t)||r._default):"array"===f?(d(u.rgba.props,function(e,i){p[i.idx]=n(t[i.idx],i)}),this):"object"===f?(t instanceof l?d(u,function(e,n){t[n.cache]&&(c[n.cache]=t[n.cache].slice())}):d(u,function(i,o){var r=o.cache;d(o.props,function(e,i){if(!c[r]&&o.to){if("alpha"===e||null==t[e])return;c[r]=o.to(c._rgba)}c[r][i.idx]=n(t[e],i,!0)}),c[r]&&e.inArray(null,c[r].slice(0,3))<0&&(c[r][3]=1,o.from&&(c._rgba=o.from(c[r])))}),this):void 0},is:function(e){var t=l(e),n=!0,i=this;return d(u,function(e,o){var r,s=t[o.cache];return s&&(r=i[o.cache]||o.to&&o.to(i._rgba)||[],d(o.props,function(e,t){if(null!=s[t.idx])return n=s[t.idx]===r[t.idx]})),n}),n},_space:function(){var e=[],t=this;return d(u,function(n,i){t[i.cache]&&e.push(n)}),e.pop()},transition:function(e,t){var i=l(e),o=i._space(),r=u[o],s=0===this.alpha()?l("transparent"):this,a=s[r.cache]||r.to(s._rgba),f=a.slice();return i=i[r.cache],d(r.props,function(e,o){var r=o.idx,s=a[r],l=i[r],u=c[o.type]||{};null!==l&&(null===s?f[r]=l:(u.mod&&(l-s>u.mod/2?s+=u.mod:s-l>u.mod/2&&(s-=u.mod)),f[r]=n((l-s)*t+s,o)))}),this[o](f)},blend:function(t){if(1===this._rgba[3])return this;var n=this._rgba.slice(),i=n.pop(),o=l(t)._rgba;return l(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&&t<3&&(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 1===(e=(e||0).toString(16)).length?"0"+e:e}).join("")},toString:function(){return 0===this._rgba[3]?"transparent":this.toRgbaString()}}),l.fn.parse.prototype=l.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),u=a-l,c=a+l,f=.5*c;return t=l===a?0:i===a?60*(o-r)/u+360:o===a?60*(r-i)/u+120:60*(i-o)/u+240,n=0===u?0:f<=.5?u/c:u/(2-c),[Math.round(t)%360,n,f,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=i<=.5?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]},d(u,function(t,i){var o=i.props,r=i.cache,a=i.to,u=i.from;l.fn[t]=function(t){if(a&&!this[r]&&(this[r]=a(this._rgba)),void 0===t)return this[r].slice();var i,s=e.type(t),c="array"===s||"object"===s?t:arguments,f=this[r].slice();return d(o,function(e,t){var i=c["object"===s?e:t.idx];null==i&&(i=f[t.idx]),f[t.idx]=n(i,t)}),u?(i=l(u(f)),i[r]=f,i):l(f)},d(o,function(n,i){l.fn[n]||(l.fn[n]=function(o){var r,a=e.type(o),l="alpha"===n?this._hsla?"hsla":"rgba":t,u=this[l](),c=u[i.idx];return"undefined"===a?c:("function"===a&&(o=o.call(this,c),a=e.type(o)),null==o&&i.empty?this:("string"===a&&(r=s.exec(o))&&(o=c+parseFloat(r[2])*("+"===r[1]?1:-1)),u[i.idx]=o,this[l](u)))})})}),l.hook=function(t){var n=t.split(" ");d(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=l(r||o),!f.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(e){}o=o.blend(a&&"transparent"!==a?a:"_default")}o=o.toRgbaString()}try{t.style[n]=o}catch(e){}}},e.fx.step[n]=function(t){t.colorInit||(t.start=l(t.elem,n),t.end=l(t.end),t.colorInit=!0),e.cssHooks[n].set(t.elem,t.start.transition(t.end,t.pos))}})},l.hook("backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor"),e.cssHooks.borderColor={expand:function(e){var t={};return d(["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"}}(s),function(){function t(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--;)"string"==typeof o[n=o[i]]&&(r[e.camelCase(n)]=o[n]);else for(n in o)"string"==typeof o[n]&&(r[n]=o[n]);return r}function n(t,n){var i,r,s={};for(i in n)r=n[i],t[i]!==r&&(o[i]||!e.fx.step[i]&&isNaN(parseFloat(r))||(s[i]=r));return s}var i=["add","remove","toggle"],o={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)&&(s.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(o,r,s,a){var l=e.speed(r,s,a);return this.queue(function(){var r,s=e(this),a=s.attr("class")||"",u=l.children?s.find("*").addBack():s;u=u.map(function(){return{el:e(this),start:t(this)}}),(r=function(){e.each(i,function(e,t){o[t]&&s[t+"Class"](o[t])})})(),u=u.map(function(){return this.end=t(this.el[0]),this.diff=n(this.start,this.end),this}),s.attr("class",a),u=u.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,u.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(t){return function(n,i,o,r,s){return"boolean"==typeof i||void 0===i?o?e.effects.animateClass.call(this,i?{add:n}:{remove:n},o,r,s):t.apply(this,arguments):e.effects.animateClass.call(this,{toggle:n},i,o,r)}}(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 t(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 n(t){return!(t&&"number"!=typeof t&&!e.fx.speeds[t])||("string"==typeof t&&!e.effects.effect[t]||(!!e.isFunction(t)||"object"==typeof t&&!t.effect))}e.extend(e.effects,{version:"1.11.4",save:function(e,t){for(var n=0;n
").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(e){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 n(t){function n(){e.isFunction(r)&&r.call(o[0]),e.isFunction(t)&&t()}var o=e(this),r=i.complete,a=i.mode;(o.is(":hidden")?"hide"===a:"show"===a)?(o[a](),n()):s.call(o[0],i,n)}var i=t.apply(this,arguments),o=i.mode,r=i.queue,s=e.effects.effect[i.effect];return e.fx.off||!s?o?this[o](i.duration,i.complete):this.each(function(){i.complete&&i.complete.call(this)}):!1===r?this.each(n):this.queue(r||"fx",n)},show:function(e){return function(i){if(n(i))return e.apply(this,arguments);var o=t.apply(this,arguments);return o.mode="show",this.effect.call(this,o)}}(e.fn.show),hide:function(e){return function(i){if(n(i))return e.apply(this,arguments);var o=t.apply(this,arguments);return o.mode="hide",this.effect.call(this,o)}}(e.fn.hide),toggle:function(e){return function(i){if(n(i)||"boolean"==typeof i)return e.apply(this,arguments);var o=t.apply(this,arguments);return o.mode="toggle",this.effect.call(this,o)}}(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 e<.5?n(2*e)/2:1-n(-2*e+2)/2}})}();e.effects}),jQuery.fn.extend({everyTime:function(e,t,n,i){return this.each(function(){jQuery.timer.add(this,e,t,n,i)})},oneTime:function(e,t,n){return this.each(function(){jQuery.timer.add(this,e,t,n,1)})},stopTime:function(e,t){return this.each(function(){jQuery.timer.remove(this,e,t)})}}),jQuery.extend({timer:{global:[],guid:1,dataKey:"jQuery.timer",regex:/^([0-9]+(?:\.[0-9]*)?)\s*(.*s)?$/,powers:{ms:1,cs:10,ds:100,s:1e3,das:1e4,hs:1e5,ks:1e6},timeParse:function(e){if(void 0==e||null==e)return null;var t=this.regex.exec(jQuery.trim(e.toString()));return t[2]?parseFloat(t[1])*(this.powers[t[2]]||1):e},add:function(e,t,n,i,o){var r=0;if(jQuery.isFunction(n)&&(o||(o=i),i=n,n=t),!("number"!=typeof(t=jQuery.timer.timeParse(t))||isNaN(t)||t<0)){("number"!=typeof o||isNaN(o)||o<0)&&(o=0),o=o||0;var s=jQuery.data(e,this.dataKey)||jQuery.data(e,this.dataKey,{});s[n]||(s[n]={}),i.timerID=i.timerID||this.guid++;var a=function(){(++r>o&&0!==o||!1===i.call(e,r))&&jQuery.timer.remove(e,n,i)};a.timerID=i.timerID,s[n][i.timerID]||(s[n][i.timerID]=window.setInterval(a,t)),this.global.push(e)}},remove:function(e,t,n){var i,o=jQuery.data(e,this.dataKey);if(o){if(t){if(o[t]){if(n)n.timerID&&(window.clearInterval(o[t][n.timerID]),delete o[t][n.timerID]);else for(var n in o[t])window.clearInterval(o[t][n]),delete o[t][n];for(i in o[t])break;i||(i=null,delete o[t])}}else for(t in o)this.remove(e,t,n);for(i in o)break;i||jQuery.removeData(e,this.dataKey)}}}}),jQuery(window).bind("unload",function(){jQuery.each(jQuery.timer.global,function(e,t){jQuery.timer.remove(t)})}),function(){"use strict";function e(){var e={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"},t=/&(?!#?\w+;)|<|>|"|'|\//g;return function(){return this?this.replace(t,function(t){return e[t]||t}):this}}function t(e,n,i){return("string"==typeof n?n:n.toString()).replace(e.define||r,function(t,n,o,r){return 0===n.indexOf("def.")&&(n=n.substring(4)),n in i||(":"===o?(e.defineParams&&r.replace(e.defineParams,function(e,t,o){i[n]={arg:t,text:o}}),n in i||(i[n]=r)):new Function("def","def['"+n+"']="+r)(i)),""}).replace(e.use||r,function(n,o){e.useParams&&(o=o.replace(e.useParams,function(e,t,n,o){if(i[n]&&i[n].arg&&o){var r=(n+":"+o).replace(/'|\\/g,"_");return i.__exp=i.__exp||{},i.__exp[r]=i[n].text.replace(new RegExp("(^|[^\\w$])"+i[n].arg+"([^\\w$])","g"),"$1"+o+"$2"),t+"def.__exp['"+r+"']"}}));var r=new Function("def","return "+o)(i);return r?t(e,r,i):r})}function n(e){return e.replace(/\\('|\\)/g,"$1").replace(/[\r\t\n]/g," ")}var i={version:"1.0.1-nanoui",templateSettings:{evaluate:/\{\{([\s\S]+?)\}\}/g,interpolate:/\{\{:([\s\S]+?)\}\}/g,encode:/\{\{>([\s\S]+?)\}\}/g,use:/\{\{#([\s\S]+?)\}\}/g,define:/\{\{##\s*([\w\.$]+)\s*(\:|=)([\s\S]+?)#\}\}/g,conditional:/\{\{\/?if\s*([\s\S]*?)\s*\}\}/g,conditionalElse:/\{\{else\s*([\s\S]*?)\s*\}\}/g,iterate:/\{\{\/?for\s*(?:\}\}|([\s\S]+?)\s*(?:\:\s*([\w$]+))?\s*(?:\:\s*([\w$]+))?\s*\}\})/g,props:/\{\{\/?props\s*(?:\}\}|([\s\S]+?)\s*(?:\:\s*([\w$]+))?\s*(?:\:\s*([\w$]+))?\s*\}\})/g,empty:/\{\{empty\}\}/g,varname:"data, config, helper",strip:!0,append:!0,selfcontained:!1},template:void 0,compile:void 0};"undefined"!=typeof module&&module.exports?module.exports=i:"function"==typeof define&&define.amd?define(function(){return i}):(function(){return this||(0,eval)("this")}()).doT=i,String.prototype.encodeHTML=e();var o={append:{start:"'+(",end:")+'",endencode:"||'').toString().encodeHTML()+'"},split:{start:"';out+=(",end:");out+='",endencode:"||'').toString().encodeHTML();out+='"}},r=/$^/;i.template=function(s,a,l){var u,c=(a=a||i.templateSettings).append?o.append:o.split,f=0,p=a.use||a.define?t(a,s,l||{}):s;p=("var out='"+(a.strip?p.replace(/(^|\r|\n)\t* +| +\t*(\r|\n|$)/g," ").replace(/\r|\n|\t|\/\*[\s\S]*?\*\//g,""):p).replace(/'|\\/g,"\\$&").replace(a.interpolate||r,function(e,t){return c.start+n(t)+c.end}).replace(a.encode||r,function(e,t){return u=!0,c.start+n(t)+c.endencode}).replace(a.conditional||r,function(e,t){return t?"';if("+n(t)+"){out+='":"';}out+='"}).replace(a.conditionalElse||r,function(e,t){return t?"';}else if("+n(t)+"){out+='":"';}else{out+='"}).replace(a.iterate||r,function(e,t,i,o){if(!t)return"';} } out+='";f+=1,i=i||"value",o=o||"index",t=n(t);var r="arr"+f;return"';var "+r+"="+t+";if("+r+" && "+r+".length > 0){var "+i+","+o+"=-1,l"+f+"="+r+".length-1;while("+o+" 0){var "+i+";for( var "+o+" in "+r+"){ if (!"+r+".hasOwnProperty("+o+")) continue; "+i+"="+r+"["+o+"];out+='"}).replace(a.empty||r,function(e){return"';}}else{if(true){out+='"}).replace(a.evaluate||r,function(e,t){return"';"+n(t)+"out+='"})+"';return out;").replace(/\n/g,"\\n").replace(/\t/g,"\\t").replace(/\r/g,"\\r").replace(/(\s|;|\}|^|\{)out\+='';/g,"$1").replace(/\+''/g,"").replace(/(\s|;|\}|^|\{)out\+=''\+/g,"$1out+="),u&&a.selfcontained&&(p="String.prototype.encodeHTML=("+e.toString()+"());"+p);try{return new Function(a.varname,p)}catch(e){throw"undefined"!=typeof console&&console.log("Could not create a template function: "+p),e}},i.compile=function(e,t){return i.template(e,null,t)}}(),function(e){"use strict";function t(e){var t={path:!0,query:!0,hash:!0};return e?(/^[a-z]+:/.test(e)&&(t.protocol=!0,t.host=!0,/[-a-z0-9]+(\.[-a-z0-9])*:\d+/i.test(e)&&(t.port=!0),/\/\/(.*?)(?::(.*?))?@/.test(e)&&(t.user=!0,t.pass=!0)),t):t}function n(e,n,i){var f,p,d,h=a?"file://"+(process.platform.match(/^win/i)?"/":"")+l("fs").realpathSync("."):document.location.href;n||(n=h),a?f=l("url").parse(n):(f=document.createElement("a"),f.href=n);var g=t(n);d=n.match(/\/\/(.*?)(?::(.*?))?@/)||[];for(p in u)e[p]=g[p]?f[u[p]]||"":"";if(e.protocol=e.protocol.replace(/:$/,""),e.query=e.query.replace(/^\?/,""),e.hash=o(e.hash.replace(/^#/,"")),e.user=o(d[1]||""),e.pass=o(d[2]||""),e.port=c[e.protocol]==e.port||0==e.port?"":e.port,!g.protocol&&/[^\/#?]/.test(n.charAt(0))&&(e.path=n.split("?")[0].split("#")[0]),!g.protocol&&i){var m=new s(h.match(/(.*\/)/)[0]),v=m.path.split("/"),y=e.path.split("/"),b=["protocol","user","pass","host","port"],x=b.length;for(v.pop(),p=0;x>p;p++)e[b[p]]=m[b[p]];for(;".."===y[0];)v.pop(),y.shift();e.path=("/"!==n.charAt(0)?v.join("/"):"")+"/"+y.join("/")}e.path=e.path.replace(/^\/{2,}/,"/"),e.paths(("/"===e.path.charAt(0)?e.path.slice(1):e.path).split("/")),e.query=new r(e.query)}function i(e){return encodeURIComponent(e).replace(/'/g,"%27")}function o(e){return e=e.replace(/\+/g," "),e=e.replace(/%([ef][0-9a-f])%([89ab][0-9a-f])%([89ab][0-9a-f])/gi,function(e,t,n,i){var o=parseInt(t,16)-224,r=parseInt(n,16)-128;if(0===o&&32>r)return e;var s=(o<<12)+(r<<6)+(parseInt(i,16)-128);return s>65535?e:String.fromCharCode(s)}),(e=e.replace(/%([cd][0-9a-f])%([89ab][0-9a-f])/gi,function(e,t,n){var i=parseInt(t,16)-192;if(2>i)return e;var o=parseInt(n,16)-128;return String.fromCharCode((i<<6)+o)})).replace(/%([0-7][0-9a-f])/gi,function(e,t){return String.fromCharCode(parseInt(t,16))})}function r(e){for(var t,n=/([^=&]+)(=([^&]*))?/g;t=n.exec(e);){var i=decodeURIComponent(t[1].replace(/\+/g," ")),r=t[3]?o(t[3]):"";void 0!==this[i]&&null!==this[i]?(this[i]instanceof Array||(this[i]=[this[i]]),this[i].push(r)):this[i]=r}}function s(e,t){n(this,e,!t)}var a="undefined"==typeof window&&"undefined"!=typeof global&&"function"==typeof require,l=a?e.require:null,u={protocol:"protocol",host:"hostname",port:"port",path:"pathname",query:"search",hash:"hash"},c={ftp:21,gopher:70,http:80,https:443,ws:80,wss:443};r.prototype.toString=function(){var e,t,n="",o=i;for(e in this)if(!(this[e]instanceof Function||null===this[e]))if(this[e]instanceof Array){var r=this[e].length;if(r)for(t=0;r>t;t++)n+=n?"&":"",n+=o(e)+"="+o(this[e][t]);else n+=(n?"&":"")+o(e)+"="}else n+=n?"&":"",n+=o(e)+"="+o(this[e]);return n},s.prototype.clearQuery=function(){for(var e in this.query)this.query[e]instanceof Function||delete this.query[e];return this},s.prototype.queryLength=function(){var e,t=0;for(e in this)this[e]instanceof Function||t++;return t},s.prototype.isEmptyQuery=function(){return 0===this.queryLength()},s.prototype.paths=function(e){var t,n="",r=0;if(e&&e.length&&e+""!==e){for(this.isAbsolute()&&(n="/"),t=e.length;t>r;r++)e[r]=!r&&e[r].match(/^\w:$/)?e[r]:i(e[r]);this.path=n+e.join("/")}for(r=0,t=(e=("/"===this.path.charAt(0)?this.path.slice(1):this.path).split("/")).length;t>r;r++)e[r]=o(e[r]);return e},s.prototype.encode=i,s.prototype.decode=o,s.prototype.isAbsolute=function(){return this.protocol||"/"===this.path.charAt(0)},s.prototype.toString=function(){return(this.protocol&&this.protocol+"://")+(this.user&&i(this.user)+(this.pass&&":"+i(this.pass))+"@")+(this.host&&this.host)+(this.port&&":"+this.port)+(this.path&&this.path)+(this.query.toString()&&"?"+this.query)+(this.hash&&"#"+i(this.hash))},e[e.exports?"exports":"Url"]=s}("undefined"!=typeof module&&module.exports?module:window); \ No newline at end of file diff --git a/nano/assets/nano.js b/nano/assets/nano.js index 6cce62efd26..265ea215d38 100644 --- a/nano/assets/nano.js +++ b/nano/assets/nano.js @@ -1 +1 @@ -function NanoStateDefaultClass(){this.key="default",this.key=this.key.toLowerCase(),NanoStateManager.addState(this)}function NanoStatePDAClass(){this.key="pda",this.key=this.key.toLowerCase(),this.current_template="",NanoStateManager.addState(this)}function NanoStateClass(){}var NanoUtility=function(){var e={};return{init:function(){var t=$("body");e=t.data("urlParameters")},generateHref:function(t){var n="?";for(var a in e)e.hasOwnProperty(a)&&("?"!==n&&(n+=";"),n+=a+"="+e[a]);for(var a in t)t.hasOwnProperty(a)&&("?"!==n&&(n+=";"),n+=a+"="+t[a]);return n},winset:function(e,t,n){var a,r;return null==n&&(n=NanoStateManager.getData().config.window.ref),a={},a[n+"."+e]=t,r=a,location.href=NanoUtility.href("winset",r)},extend:function(e,t){return Object.keys(t).forEach(function(n){var a;return a=t[n],a&&"[object Object]"===Object.prototype.toString.call(a)?(e[n]=e[n]||{},NanoUtility.extend(e[n],a)):e[n]=a}),e},href:function(e,t){return null==e&&(e=""),null==t&&(t={}),e=new Url("byond://"+e),NanoUtility.extend(e.query,t),e},close:function(){var t;return t={command:"nanoclose "+e.src},this.winset("is-visible","false"),location.href=NanoUtility.href("winset",t)}}}();"undefined"==typeof jQuery&&reportError("ERROR: Javascript library failed to load!"),"undefined"==typeof doT&&reportError("ERROR: Template engine failed to load!");var reportError=function(e){window.location="byond://?nano_err="+encodeURIComponent(e),alert(e)};$(document).ready(function(){NanoUtility.init(),NanoStateManager.init(),NanoTemplate.init(),NanoWindow.init()}),Array.prototype.indexOf||(Array.prototype.indexOf=function(e){var t=this.length,n=Number(arguments[1])||0;for(n=n<0?Math.ceil(n):Math.floor(n),n<0&&(n+=t);n=0?e[a]:a===-1?"{":a===-2?"}":""})},String.prototype.format.regex=new RegExp("{-?[0-9]+}","g")),Object.size=function(e){var t,n=0;for(var t in e)e.hasOwnProperty(t)&&n++;return n},window.console||(window.console={log:function(e){return!1}}),String.prototype.toTitleCase=function(){var e=/^(a|an|and|as|at|but|by|en|for|if|in|of|on|or|the|to|vs?\.?|via)$/i;return this.replace(/([^\W_]+[^\s-]*) */g,function(t,n,a,r){return a>0&&a+n.length!==r.length&&n.search(e)>-1&&":"!==r.charAt(a-2)&&r.charAt(a-1).search(/[^\s-]/)<0?t.toLowerCase():n.substr(1).search(/[A-Z]|\../)>-1?t:t.charAt(0).toUpperCase()+t.substr(1)})},$.ajaxSetup({cache:!1}),Function.prototype.inheritsFrom=function(e){return this.prototype=new e,this.prototype.constructor=this,this.prototype.parent=e.prototype,this},String.prototype.trim||(String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"")}),String.prototype.ckey||(String.prototype.ckey=function(){return this.replace(/\W/g,"").toLowerCase()}),NanoStateManager=function(){var e=!1,t=null,n={},a={},r={},o=null,i=function(){t=$("body").data("initialData"),null!=t&&t.hasOwnProperty("config")&&t.hasOwnProperty("data")||reportError("Error: Initial data did not load correctly."+JSON.stringify(t));var n="default";t.config.hasOwnProperty("stateKey")&&t.config.stateKey&&(n=t.config.stateKey.toLowerCase()),NanoStateManager.setCurrentState(n),$(document).on("templatesLoaded",function(){s(t),e=!0})},l=function(n){var a;try{a=jQuery.parseJSON(n)}catch(r){return void reportError("recieveUpdateData failed.
Error name: "+r.name+"
Error Message: "+r.message)}a.hasOwnProperty("data")||(t&&t.hasOwnProperty("data")?a.data=t.data:a.data={}),e?s(a):t=a},s=function(e){if(null!=o){if(e=o.onBeforeUpdate(e),e===!1)return void reportError("data is false, return");t=e,o.onUpdate(t),o.onAfterUpdate(t)}},c=function(e,t){for(var n in e)e.hasOwnProperty(n)&&jQuery.isFunction(e[n])&&(t=e[n].call(this,t));return t};return{init:function(){i()},receiveUpdateData:function(e){l(e)},addBeforeUpdateCallback:function(e,t){n[e]=t},addBeforeUpdateCallbacks:function(e){for(var t in e)e.hasOwnProperty(t)&&NanoStateManager.addBeforeUpdateCallback(t,e[t])},removeBeforeUpdateCallback:function(e){n.hasOwnProperty(e)&&delete n[e]},executeBeforeUpdateCallbacks:function(e){return c(n,e)},addAfterUpdateCallback:function(e,t){a[e]=t},addAfterUpdateCallbacks:function(e){for(var t in e)e.hasOwnProperty(t)&&NanoStateManager.addAfterUpdateCallback(t,e[t])},removeAfterUpdateCallback:function(e){a.hasOwnProperty(e)&&delete a[e]},executeAfterUpdateCallbacks:function(e){return c(a,e)},addState:function(e){return e instanceof NanoStateClass?e.key?void(r[e.key]=e):void reportError("ERROR: Attempted to add a state with an invalid stateKey"):void reportError("ERROR: Attempted to add a state which is not instanceof NanoStateClass")},setCurrentState:function(e){if("undefined"==typeof e||!e)return reportError("ERROR: No state key was passed!"),!1;if(!r.hasOwnProperty(e))return reportError("ERROR: Attempted to set a current state which does not exist: "+e),!1;var t=o;return o=r[e],null!=t&&t.onRemove(o),o.onAdd(t),!0},getCurrentState:function(){return o},getData:function(){return t}}}(),NanoBaseCallbacks=function(){var e=!0,t={},n={status:function(t){var n;return 2==t.config.status?(n="good",$(".linkActive").removeClass("inactive")):1==t.config.status?(n="average",$(".linkActive").addClass("inactive")):(n="bad",$(".linkActive").addClass("inactive")),$(".statusicon").removeClass("good bad average").addClass(n),$(".linkActive").stopTime("linkPending"),$(".linkActive").removeClass("linkPending"),$(".linkActive").off("click").on("click",function(n){n.preventDefault();var a=$(this).data("href");null!=a&&e&&(e=!1,$("body").oneTime(300,"enableClick",function(){e=!0}),2==t.config.status&&$(this).oneTime(300,"linkPending",function(){$(this).addClass("linkPending")}),window.location.href=a)}),t},nanomap:function(e){return $(".mapIcon").off("mouseenter mouseleave").on("mouseenter",function(e){$("#uiMapTooltip").html($(this).children(".tooltip").html()).show().stopTime().oneTime(5e3,"hideTooltip",function(){$(this).fadeOut(500)})}),$(".zoomLink").off("click").on("click",function(e){e.preventDefault();var t=$(this).data("zoomLevel"),n=$("#uiMap"),a=n.width()*t,r=n.height()*t;n.css({zoom:t,left:"50%",top:"50%",marginLeft:"-"+Math.floor(a/2)+"px",marginTop:"-"+Math.floor(r/2)+"px"})}),$("#uiMapImage").attr("src",e.config.map+"_nanomap_z"+e.config.mapZLevel+".png"),e}};return{addCallbacks:function(){NanoStateManager.addBeforeUpdateCallbacks(t),NanoStateManager.addAfterUpdateCallbacks(n)},removeCallbacks:function(){for(var e in t)t.hasOwnProperty(e)&&NanoStateManager.removeBeforeUpdateCallback(e);for(var e in n)n.hasOwnProperty(e)&&NanoStateManager.removeAfterUpdateCallback(e)}}}(),NanoBaseHelpers=function(){var e={syndicateMode:function(){return $("body").css("background-color","#8f1414"),$("body").css("background-image","url('uiBackground-Syndicate.png')"),$("body").css("background-position","50% 0"),$("body").css("background-repeat","repeat-x"),$("#uiTitleFluff").css("background-image","url('uiTitleFluff-Syndicate.png')"),$("#uiTitleFluff").css("background-position","50% 50%"),$("#uiTitleFluff").css("background-repeat","no-repeat"),""},combine:function(e,t){return e&&t?e.concat(t):e||t},dump:function(e){return JSON.stringify(e)},link:function(e,t,n,a,r,o){var i="",l="noIcon";"undefined"!=typeof t&&t&&(i='
',l="hasIcon"),"undefined"!=typeof r&&r||(r="link");var s="";"undefined"!=typeof o&&o&&(s='id="'+o+'"');var c=NanoTransition.allocID(s+"_"+e.toString().replace(/[^a-z0-9_]/gi,"_")+"_"+t);return"undefined"!=typeof a&&a?'':'
"+i+e+'
'},xor:function(e,t){return e^t},precisionRound:function(e,t){if(0==t)return Math.round(number);var n=Math.pow(10,t);return Math.round(e*n)/n},round:function(e){return Math.round(e)},fixed:function(e){return Math.round(10*e)/10},floor:function(e){return Math.floor(e)},ceil:function(e){return Math.ceil(e)},string:function(){if(0==arguments.length)return"";if(1==arguments.length)return arguments[0];if(arguments.length>1){stringArgs=[];for(var e=1;en&&(e=n):e>t?e=t:e
'+r+'
'},dangerToClass:function(e){return 0==e?"good":1==e?"average":"bad"},dangerToSpan:function(e){return 0==e?'"Good"':1==e?'"Minor Alert"':'"Major Alert"'},generateHref:function(e){var t=$("body");_urlParameters=t.data("urlParameters");var n="?";for(var a in _urlParameters)_urlParameters.hasOwnProperty(a)&&("?"!==n&&(n+=";"),n+=a+"="+_urlParameters[a]);for(var a in e)e.hasOwnProperty(a)&&("?"!==n&&(n+=";"),n+=a+"="+e[a]);return n},displayDNABlocks:function(e,t,n,a,r){if(!e)return'
Please place a valid subject into the DNA modifier.
';var o=e.split(""),i='
',l=1,s=1;for(var c in o)if(o.hasOwnProperty(c)&&"object"!=typeof o[c]){var u;u="UI"==r.toUpperCase()?{selectUIBlock:l,selectUISubblock:s}:{selectSEBlock:l,selectSESubblock:s};var d="linkActive";l==t&&s==n&&(d="selected"),i+='",c++,c%a==0&&c
"):s++}return i+="
"},cMirror:function(e){CodeMirror.fromTextArea(document.getElementById(e),{lineNumbers:!0,indentUnit:4,indentWithTabs:!0,theme:"lesser-dark"})},smoothNumber:function(e){var t=NanoTransition.allocID("n");return''},smoothRound:function(e,t){var n=NanoTransition.allocID(t);return void 0===t&&(placed=0),''}};return{addHelpers:function(){NanoTemplate.addHelpers(e)},removeHelpers:function(){for(var t in e)e.hasOwnProperty(t)&&NanoTemplate.removeHelper(t)}}}(),NanoStateDefaultClass.inheritsFrom(NanoStateClass);var NanoStateDefault=new NanoStateDefaultClass;NanoStatePDAClass.inheritsFrom(NanoStateClass);var NanoStatePDA=new NanoStatePDAClass;NanoStatePDAClass.prototype.onUpdate=function(e){NanoStateClass.prototype.onUpdate.call(this,e);var t=this;try{if(null!=e.data.app){var n=e.data.app.template;null!=n&&n!=t.current_template?$.when($.ajax({url:n+".tmpl",cache:!1,dataType:"text"})).done(function(a){a+='
';try{NanoTemplate.addTemplate("app",a),NanoTemplate.resetTemplate("app"),$("#uiApp").html(NanoTemplate.parse("app",e)),t.current_template=n,t.onAfterUpdate(e)}catch(r){return void reportError("ERROR: An error occurred while loading the PDA App UI: "+r.message)}}).fail(function(){reportError("ERROR: Loading template app("+n+") failed!")}):NanoTemplate.templateExists("app")&&$("#uiApp").html(NanoTemplate.parse("app",e))}}catch(a){return void reportError("ERROR: An error occurred while rendering the PDA App UI: "+a.message)}},NanoStateClass.prototype.key=null,NanoStateClass.prototype.layoutRendered=!1,NanoStateClass.prototype.contentRendered=!1,NanoStateClass.prototype.mapInitialised=!1,NanoStateClass.prototype.isCurrent=function(){return NanoStateManager.getCurrentState()==this},NanoStateClass.prototype.onAdd=function(e){NanoBaseCallbacks.addCallbacks(),NanoBaseHelpers.addHelpers()},NanoStateClass.prototype.onRemove=function(e){NanoBaseCallbacks.removeCallbacks(),NanoBaseHelpers.removeHelpers()},NanoStateClass.prototype.onBeforeUpdate=function(e){return e=NanoStateManager.executeBeforeUpdateCallbacks(e)},NanoStateClass.prototype.onUpdate=function(e){try{(!this.layoutRendered||e.config.hasOwnProperty("autoUpdateLayout")&&e.config.autoUpdateLayout)&&($("#uiLayout").html(NanoTemplate.parse("layout",e)),this.layoutRendered=!0),(!this.contentRendered||e.config.hasOwnProperty("autoUpdateContent")&&e.config.autoUpdateContent)&&($("#uiContent").html(NanoTemplate.parse("main",e)),this.contentRendered=!0),NanoTemplate.templateExists("mapContent")&&(this.mapInitialised||($("#uiMap").draggable(),$("#uiMapTooltip").off("click").on("click",function(e){e.preventDefault(),$(this).fadeOut(400)}),this.mapInitialised=!0),$("#uiMapContent").html(NanoTemplate.parse("mapContent",e)),e.config.hasOwnProperty("showMap")&&e.config.showMap?($("#uiContent").addClass("hidden"),$("#uiMapWrapper").removeClass("hidden")):($("#uiMapWrapper").addClass("hidden"),$("#uiContent").removeClass("hidden"))),NanoTemplate.templateExists("mapHeader")&&$("#uiMapHeader").html(NanoTemplate.parse("mapHeader",e)),NanoTemplate.templateExists("mapFooter")&&$("#uiMapFooter").html(NanoTemplate.parse("mapFooter",e))}catch(t){return void reportError("ERROR: An error occurred while rendering the UI: "+t.message)}},NanoStateClass.prototype.onAfterUpdate=function(e){NanoStateManager.executeAfterUpdateCallbacks(e)},NanoStateClass.prototype.alertText=function(e){alert(e)};var NanoTemplate=function(){var e={},t={},n={},a={},r=function(){e=$("body").data("templateData"),null==e&&reportError("Error: Template data did not load correctly."),o()},o=function(){var t=Object.size(e);if(!t)return void $(document).trigger("templatesLoaded");for(var n in e)if(e.hasOwnProperty(n))return void $.when($.ajax({url:e[n],cache:!1,dataType:"text"})).done(function(t){t+='
';try{NanoTemplate.addTemplate(n,t)}catch(a){return void reportError("ERROR: An error occurred while loading the UI: "+a.message)}delete e[n],o()}).fail(function(){reportError("ERROR: Loading template "+n+"("+e[n]+") failed!")})},i=function(){for(var e in t)try{n[e]=doT.template(t[e],null,t)}catch(a){reportError(a.message)}};return{init:function(){r()},addTemplate:function(e,n){t[e]=n},templateExists:function(e){return t.hasOwnProperty(e)},resetTemplate:function(e){n[e]=null},parse:function(e,r){if(!n.hasOwnProperty(e)||!n[e]){if(!t.hasOwnProperty(e))return reportError('ERROR: Template "'+e+'" does not exist in _compiledTemplates!'),"

Template error (does not exist)

";i()}return"function"!=typeof n[e]?(reportError(n[e]),reportError('ERROR: Template "'+e+'" failed to compile!'),"

Template error (failed to compile)

"):n[e].call(this,r.data,r.config,a)},addHelper:function(e,t){return jQuery.isFunction(t)?void(a[e]=t):void reportError("NanoTemplate.addHelper failed to add "+e+" as it is not a function.")},addHelpers:function(e){for(var t in e)e.hasOwnProperty(t)&&NanoTemplate.addHelper(t,e[t])},removeHelper:function(e){helpers.hasOwnProperty(e)&&delete a[e]}}}();NanoTransition=function(){var e={},t={},n=0;NanoStateManager.addBeforeUpdateCallback("TransitionReset",function(e){return n=0,e});var a=function(e){return"_Hide_Map_close"==e?"transition__map":(void 0===e&&(e=""),"transition__"+n++ +"_"+e.toString())},r=function(n,a,r){var o,i=e[n];void 0===r&&(r=!1);var l=$("."+n);if(0==l.length)return a;if(l=l[0],i&&i.tagName==l.tagName&&i.tabIndex==l.tabIndex&&i.parent==l.parentNode.tagName&&i.children==l.children.length){if(o=t[n],r){var s={};for(k in o)s[k]=o[k];for(k in a)s[k]=a[k];a=s}}else o=a,e[n]={tagName:l.tagName,tabIndex:l.tabIndex,parent:l.parentNode.tagName,children:l.children.length};return t[n]=a,o},o=function(e,t){var n=$("."+e);return t?$(n).children(t):$(n)},i=function(e,t,n,a,r){var i=o(e,t);void 0===r&&(r=1900),i.css(n).animate(a,{duration:r,queue:!1});var l=n["..class"],s=a["..class"];if(l&&s&&(i.addClass(l),l!=s)){var l=l.split(" "),s=s.split(" "),c=l.filter(function(e){return s.indexOf(e)==-1}),u=s.filter(function(e){return l.indexOf(e)==-1});l=c.join(" "),s=u.join(" "),i.switchClass(l,s,{duration:r,queue:!1})}},l=function(e,t,n,a,r,i){var l=o(e,t);void 0===i&&(i=1900),n==-1?l.text(a.toString()):l.text(a.toFixed(n)),a!=r&&l.animate({i:1},{duration:i,queue:!1,step:function(e,t){n==-1?t.elem.textContent=(a*(1-e)+r*e).toString():t.elem.textContent=(a*(1-e)+r*e).toFixed(n)}})},s=function(e,t,n,a,i){var l=o(e,t);void 0===i&&(i=200),n["..hover"]&&l.addClass("hover"),l.hover(function(){l.stop(1,1).addClass("hover",{duration:i,queue:!1}),r(e,{"..hover":!0},!0)},function(){l.stop(1,1).removeClass("hover",{duration:i,queue:!1}),r(e,{"..hover":!1},!0)})},c=function(e,t,n,a){var o=r(e,n);return i(e,t,o,n,a),o};return{allocID:a,updateElement:r,animateElement:i,animateTextValue:l,animateHover:s,transitionElement:c}}();var NanoWindow=function(){var e,t,n,a,r,o,i=function(e,t){NanoUtility.winset("pos",e+","+t)},l=function(e,t){NanoUtility.winset("size",e+","+t)},s=function(){NanoStateManager.getData().config.user.fancy&&(c(),u(),d())},c=function(){NanoUtility.winset("titlebar",0),NanoUtility.winset("can-resize",0),$(".fancy").show(),$("#uiTitleFluff").css("right","65px")},u=function(){var e=function(){return NanoUtility.close()},t=function(){return NanoUtility.winset("is-minimized","true")};$(".close").on("click",function(t){e()}),$(".minimize").on("click",function(e){t()})},d=function(){$(document).on("mousemove",function(e){p(),f()}),$(document).on("mouseup",function(i){e&&(e=!1,t=null,n=null),a&&(a=!1,r=null,o=null)}),$("#uiTitleWrapper").on("mousedown",function(t){e=!0}),$("#resize").on("mousedown",function(e){a=!0})},p=function(a){var r,o;null==a&&(a=window.event),e&&(null==t&&(t=a.screenX),null==n&&(n=a.screenY),r=a.screenX-t+window.screenLeft,o=a.screenY-n+window.screenTop,i(r,o),t=a.screenX,n=a.screenY)},f=function(){var e,t;null==event&&(event=window.event),a&&(null==r&&(r=event.screenX),null==o&&(o=event.screenY),e=Math.max(150,event.screenX-r+window.innerWidth),t=Math.max(150,event.screenY-o+window.innerHeight),l(e,t),r=event.screenX,o=event.screenY)};return{init:function(){$(document).on("templatesLoaded",function(){s()})}}}(); \ No newline at end of file +function NanoStateDefaultClass(){this.key="default",this.key=this.key.toLowerCase(),NanoStateManager.addState(this)}function NanoStatePDAClass(){this.key="pda",this.key=this.key.toLowerCase(),this.current_template="",NanoStateManager.addState(this)}function NanoStateClass(){}var NanoUtility=function(){var e={};return{init:function(){var t=$("body");e=t.data("urlParameters")},generateHref:function(t){var n="?";for(var a in e)e.hasOwnProperty(a)&&("?"!==n&&(n+=";"),n+=a+"="+e[a]);for(var a in t)t.hasOwnProperty(a)&&("?"!==n&&(n+=";"),n+=a+"="+t[a]);return n},winset:function(e,t,n){var a,r;return null==n&&(n=NanoStateManager.getData().config.window.ref),a={},a[n+"."+e]=t,r=a,location.href=NanoUtility.href("winset",r)},extend:function(e,t){return Object.keys(t).forEach(function(n){var a;return(a=t[n])&&"[object Object]"===Object.prototype.toString.call(a)?(e[n]=e[n]||{},NanoUtility.extend(e[n],a)):e[n]=a}),e},href:function(e,t){return null==e&&(e=""),null==t&&(t={}),e=new Url("byond://"+e),NanoUtility.extend(e.query,t),e},close:function(){var t;return t={command:"nanoclose "+e.src},this.winset("is-visible","false"),location.href=NanoUtility.href("winset",t)}}}();"undefined"==typeof jQuery&&reportError("ERROR: Javascript library failed to load!"),"undefined"==typeof doT&&reportError("ERROR: Template engine failed to load!");var reportError=function(e){window.location="byond://?nano_err="+encodeURIComponent(e),alert(e)};$(document).ready(function(){NanoUtility.init(),NanoStateManager.init(),NanoTemplate.init(),NanoWindow.init()}),Array.prototype.indexOf||(Array.prototype.indexOf=function(e){var t=this.length,n=Number(arguments[1])||0;for((n=n<0?Math.ceil(n):Math.floor(n))<0&&(n+=t);n=0?e[n]:-1===n?"{":-2===n?"}":""})},String.prototype.format.regex=new RegExp("{-?[0-9]+}","g")),Object.size=function(e){var t=0;for(var n in e)e.hasOwnProperty(n)&&t++;return t},window.console||(window.console={log:function(e){return!1}}),String.prototype.toTitleCase=function(){var e=/^(a|an|and|as|at|but|by|en|for|if|in|of|on|or|the|to|vs?\.?|via)$/i;return this.replace(/([^\W_]+[^\s-]*) */g,function(t,n,a,r){return a>0&&a+n.length!==r.length&&n.search(e)>-1&&":"!==r.charAt(a-2)&&r.charAt(a-1).search(/[^\s-]/)<0?t.toLowerCase():n.substr(1).search(/[A-Z]|\../)>-1?t:t.charAt(0).toUpperCase()+t.substr(1)})},$.ajaxSetup({cache:!1}),Function.prototype.inheritsFrom=function(e){return this.prototype=new e,this.prototype.constructor=this,this.prototype.parent=e.prototype,this},String.prototype.trim||(String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"")}),String.prototype.ckey||(String.prototype.ckey=function(){return this.replace(/\W/g,"").toLowerCase()}),NanoStateManager=function(){var e=!1,t=null,n={},a={},r={},o=null,i=function(){null!=(t=$("body").data("initialData"))&&t.hasOwnProperty("config")&&t.hasOwnProperty("data")||reportError("Error: Initial data did not load correctly."+JSON.stringify(t));var n="default";t.config.hasOwnProperty("stateKey")&&t.config.stateKey&&(n=t.config.stateKey.toLowerCase()),NanoStateManager.setCurrentState(n),$(document).on("templatesLoaded",function(){s(t),e=!0})},l=function(n){var a;try{a=jQuery.parseJSON(n)}catch(e){return void reportError("recieveUpdateData failed.
Error name: "+e.name+"
Error Message: "+e.message)}a.hasOwnProperty("data")||(t&&t.hasOwnProperty("data")?a.data=t.data:a.data={}),e?s(a):t=a},s=function(e){null!=o&&(!1!==(e=o.onBeforeUpdate(e))?(t=e,o.onUpdate(t),o.onAfterUpdate(t)):reportError("data is false, return"))},c=function(e,t){for(var n in e)e.hasOwnProperty(n)&&jQuery.isFunction(e[n])&&(t=e[n].call(this,t));return t};return{init:function(){i()},receiveUpdateData:function(e){l(e)},addBeforeUpdateCallback:function(e,t){n[e]=t},addBeforeUpdateCallbacks:function(e){for(var t in e)e.hasOwnProperty(t)&&NanoStateManager.addBeforeUpdateCallback(t,e[t])},removeBeforeUpdateCallback:function(e){n.hasOwnProperty(e)&&delete n[e]},executeBeforeUpdateCallbacks:function(e){return c(n,e)},addAfterUpdateCallback:function(e,t){a[e]=t},addAfterUpdateCallbacks:function(e){for(var t in e)e.hasOwnProperty(t)&&NanoStateManager.addAfterUpdateCallback(t,e[t])},removeAfterUpdateCallback:function(e){a.hasOwnProperty(e)&&delete a[e]},executeAfterUpdateCallbacks:function(e){return c(a,e)},addState:function(e){e instanceof NanoStateClass?e.key?r[e.key]=e:reportError("ERROR: Attempted to add a state with an invalid stateKey"):reportError("ERROR: Attempted to add a state which is not instanceof NanoStateClass")},setCurrentState:function(e){if(void 0===e||!e)return reportError("ERROR: No state key was passed!"),!1;if(!r.hasOwnProperty(e))return reportError("ERROR: Attempted to set a current state which does not exist: "+e),!1;var t=o;return o=r[e],null!=t&&t.onRemove(o),o.onAdd(t),!0},getCurrentState:function(){return o},getData:function(){return t}}}(),NanoBaseCallbacks=function(){var e=!0,t={},n={status:function(t){var n;return 2==t.config.status?(n="good",$(".linkActive").removeClass("inactive")):1==t.config.status?(n="average",$(".linkActive").addClass("inactive")):(n="bad",$(".linkActive").addClass("inactive")),$(".statusicon").removeClass("good bad average").addClass(n),$(".linkActive").stopTime("linkPending"),$(".linkActive").removeClass("linkPending"),$(".linkActive").off("click").on("click",function(n){n.preventDefault();var a=$(this).data("href");null!=a&&e&&(e=!1,$("body").oneTime(300,"enableClick",function(){e=!0}),2==t.config.status&&$(this).oneTime(300,"linkPending",function(){$(this).addClass("linkPending")}),window.location.href=a)}),t},nanomap:function(e){return $(".mapIcon").off("mouseenter mouseleave").on("mouseenter",function(e){$("#uiMapTooltip").html($(this).children(".tooltip").html()).show().stopTime().oneTime(5e3,"hideTooltip",function(){$(this).fadeOut(500)})}),$(".zoomLink").off("click").on("click",function(e){e.preventDefault();var t=$(this).data("zoomLevel"),n=$("#uiMap"),a=n.width()*t,r=n.height()*t;n.css({zoom:t,left:"50%",top:"50%",marginLeft:"-"+Math.floor(a/2)+"px",marginTop:"-"+Math.floor(r/2)+"px"})}),$("#uiMapImage").attr("src",e.config.map+"_nanomap_z"+e.config.mapZLevel+".png"),e}};return{addCallbacks:function(){NanoStateManager.addBeforeUpdateCallbacks(t),NanoStateManager.addAfterUpdateCallbacks(n)},removeCallbacks:function(){for(var e in t)t.hasOwnProperty(e)&&NanoStateManager.removeBeforeUpdateCallback(e);for(var e in n)n.hasOwnProperty(e)&&NanoStateManager.removeAfterUpdateCallback(e)}}}(),NanoBaseHelpers=function(){var e={syndicateMode:function(){return $("body").css("background-color","#8f1414"),$("body").css("background-image","url('uiBackground-Syndicate.png')"),$("body").css("background-position","50% 0"),$("body").css("background-repeat","repeat-x"),$("#uiTitleFluff").css("background-image","url('uiTitleFluff-Syndicate.png')"),$("#uiTitleFluff").css("background-position","50% 50%"),$("#uiTitleFluff").css("background-repeat","no-repeat"),""},combine:function(e,t){return e&&t?e.concat(t):e||t},dump:function(e){return JSON.stringify(e)},link:function(e,t,n,a,r,o){var i="",l="noIcon";void 0!==t&&t&&(i='
',l="hasIcon"),void 0!==r&&r||(r="link");var s="";void 0!==o&&o&&(s='id="'+o+'"');var c=NanoTransition.allocID(s+"_"+e.toString().replace(/[^a-z0-9_]/gi,"_")+"_"+t);return void 0!==a&&a?'