diff --git a/assets/dist/dashboard.js b/assets/dist/dashboard.js index 0e89998..f257dcd 100644 --- a/assets/dist/dashboard.js +++ b/assets/dist/dashboard.js @@ -1572,7 +1572,7 @@ reMarked = function(opts) { h2_setext: true, // underline h2 headers h_atx_suf: false, // header suffixes (###) // h_compact: true, // compact headers (except h1) - gfm_code: true, // gfm code blocks (```) + gfm_code: ["```","~~~"][0], // gfm code blocks trim_code: true, // trim whitespace within
blocks (full block, not per line)
li_bullet: "*-+"[0], // list item bullet style
// list_indnt: // indent top-level lists
@@ -2100,7 +2100,7 @@ reMarked = function(opts) {
if (cls.indexOf("lang-") === 0) // marked uses "lang-" prefix now
cls = cls.substr(5);
- this.wrapK = ["```" + cls + "\n", "\n```"];
+ this.wrapK = [cfg.gfm_code + cls + "\n", "\n" + cfg.gfm_code];
}
else {
this.wrapK = "";
@@ -9800,199 +9800,7 @@ Editor.prototype.toggleFullScreen = function() {
};
global.Editor = Editor;
-})(this);;!function(){function a(b){var c=a.modules[b];if(!c)throw new Error('failed to require "'+b+'"');return"exports"in c||"function"!=typeof c.definition||(c.client=c.component=!0,c.definition.call(this,c.exports={},c),delete c.definition),c.exports}a.modules={},a.register=function(b,c){a.modules[b]={definition:c}},a.define=function(b,c){a.modules[b]={exports:c}},a.register("component~emitter@1.1.2",function(a,b){function c(a){return a?d(a):void 0}function d(a){for(var b in c.prototype)a[b]=c.prototype[b];return a}b.exports=c,c.prototype.on=c.prototype.addEventListener=function(a,b){return this._callbacks=this._callbacks||{},(this._callbacks[a]=this._callbacks[a]||[]).push(b),this},c.prototype.once=function(a,b){function c(){d.off(a,c),b.apply(this,arguments)}var d=this;return this._callbacks=this._callbacks||{},c.fn=b,this.on(a,c),this},c.prototype.off=c.prototype.removeListener=c.prototype.removeAllListeners=c.prototype.removeEventListener=function(a,b){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var c=this._callbacks[a];if(!c)return this;if(1==arguments.length)return delete this._callbacks[a],this;for(var d,e=0;ed;++d)c[d].apply(this,b)}return this},c.prototype.listeners=function(a){return this._callbacks=this._callbacks||{},this._callbacks[a]||[]},c.prototype.hasListeners=function(a){return!!this.listeners(a).length}}),a.register("dropzone",function(b,c){c.exports=a("dropzone/lib/dropzone.js")}),a.register("dropzone/lib/dropzone.js",function(b,c){(function(){var b,d,e,f,g,h,i,j,k={}.hasOwnProperty,l=function(a,b){function c(){this.constructor=a}for(var d in b)k.call(b,d)&&(a[d]=b[d]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a},m=[].slice;d="undefined"!=typeof Emitter&&null!==Emitter?Emitter:a("component~emitter@1.1.2"),i=function(){},b=function(a){function b(a,d){var e,f,g;if(this.element=a,this.version=b.version,this.defaultOptions.previewTemplate=this.defaultOptions.previewTemplate.replace(/\n*/g,""),this.clickableElements=[],this.listeners=[],this.files=[],"string"==typeof this.element&&(this.element=document.querySelector(this.element)),!this.element||null==this.element.nodeType)throw new Error("Invalid dropzone element.");if(this.element.dropzone)throw new Error("Dropzone already attached.");if(b.instances.push(this),this.element.dropzone=this,e=null!=(g=b.optionsForElement(this.element))?g:{},this.options=c({},this.defaultOptions,e,null!=d?d:{}),this.options.forceFallback||!b.isBrowserSupported())return this.options.fallback.call(this);if(null==this.options.url&&(this.options.url=this.element.getAttribute("action")),!this.options.url)throw new Error("No URL provided.");if(this.options.acceptedFiles&&this.options.acceptedMimeTypes)throw new Error("You can't provide both 'acceptedFiles' and 'acceptedMimeTypes'. 'acceptedMimeTypes' is deprecated.");this.options.acceptedMimeTypes&&(this.options.acceptedFiles=this.options.acceptedMimeTypes,delete this.options.acceptedMimeTypes),this.options.method=this.options.method.toUpperCase(),(f=this.getExistingFallback())&&f.parentNode&&f.parentNode.removeChild(f),this.options.previewsContainer!==!1&&(this.previewsContainer=this.options.previewsContainer?b.getElement(this.options.previewsContainer,"previewsContainer"):this.element),this.options.clickable&&(this.clickableElements=this.options.clickable===!0?[this.element]:b.getElements(this.options.clickable,"clickable")),this.init()}var c;return l(b,a),b.prototype.events=["drop","dragstart","dragend","dragenter","dragover","dragleave","addedfile","removedfile","thumbnail","error","errormultiple","processing","processingmultiple","uploadprogress","totaluploadprogress","sending","sendingmultiple","success","successmultiple","canceled","canceledmultiple","complete","completemultiple","reset","maxfilesexceeded","maxfilesreached"],b.prototype.defaultOptions={url:null,method:"post",withCredentials:!1,parallelUploads:2,uploadMultiple:!1,maxFilesize:256,paramName:"file",createImageThumbnails:!0,maxThumbnailFilesize:10,thumbnailWidth:100,thumbnailHeight:100,maxFiles:null,params:{},clickable:!0,ignoreHiddenFiles:!0,acceptedFiles:null,acceptedMimeTypes:null,autoProcessQueue:!0,autoQueue:!0,addRemoveLinks:!1,previewsContainer:null,dictDefaultMessage:"Drop files here to upload",dictFallbackMessage:"Your browser does not support drag'n'drop file uploads.",dictFallbackText:"Please use the fallback form below to upload your files like in the olden days.",dictFileTooBig:"File is too big ({{filesize}}MiB). Max filesize: {{maxFilesize}}MiB.",dictInvalidFileType:"You can't upload files of this type.",dictResponseError:"Server responded with {{statusCode}} code.",dictCancelUpload:"Cancel upload",dictCancelUploadConfirmation:"Are you sure you want to cancel this upload?",dictRemoveFile:"Remove file",dictRemoveFileConfirmation:null,dictMaxFilesExceeded:"You can not upload any more files.",accept:function(a,b){return b()},init:function(){return i},forceFallback:!1,fallback:function(){var a,c,d,e,f,g;for(this.element.className=""+this.element.className+" dz-browser-not-supported",g=this.element.getElementsByTagName("div"),e=0,f=g.length;f>e;e++)a=g[e],/(^| )dz-message($| )/.test(a.className)&&(c=a,a.className="dz-message");return c||(c=b.createElement('d?(b.srcHeight=a.height,b.srcWidth=b.srcHeight*d):(b.srcWidth=a.width,b.srcHeight=b.srcWidth/d),b.srcX=(a.width-b.srcWidth)/2,b.srcY=(a.height-b.srcHeight)/2,b},drop:function(){return this.element.classList.remove("dz-drag-hover")},dragstart:i,dragend:function(){return this.element.classList.remove("dz-drag-hover")},dragenter:function(){return this.element.classList.add("dz-drag-hover")},dragover:function(){return this.element.classList.add("dz-drag-hover")},dragleave:function(){return this.element.classList.remove("dz-drag-hover")},paste:i,reset:function(){return this.element.classList.remove("dz-started")},addedfile:function(a){var c,d,e,f,g,h,i,j,k,l,m,n,o;if(this.element===this.previewsContainer&&this.element.classList.add("dz-started"),this.previewsContainer){for(a.previewElement=b.createElement(this.options.previewTemplate.trim()),a.previewTemplate=a.previewElement,this.previewsContainer.appendChild(a.previewElement),l=a.previewElement.querySelectorAll("[data-dz-name]"),f=0,i=l.length;i>f;f++)c=l[f],c.textContent=a.name;for(m=a.previewElement.querySelectorAll("[data-dz-size]"),g=0,j=m.length;j>g;g++)c=m[g],c.innerHTML=this.filesize(a.size);for(this.options.addRemoveLinks&&(a._removeLink=b.createElement(''+this.options.dictRemoveFile+""),a.previewElement.appendChild(a._removeLink)),d=function(c){return function(d){return d.preventDefault(),d.stopPropagation(),a.status===b.UPLOADING?b.confirm(c.options.dictCancelUploadConfirmation,function(){return c.removeFile(a)}):c.options.dictRemoveFileConfirmation?b.confirm(c.options.dictRemoveFileConfirmation,function(){return c.removeFile(a)}):c.removeFile(a)}}(this),n=a.previewElement.querySelectorAll("[data-dz-remove]"),o=[],h=0,k=n.length;k>h;h++)e=n[h],o.push(e.addEventListener("click",d));return o}},removedfile:function(a){var b;return a.previewElement&&null!=(b=a.previewElement)&&b.parentNode.removeChild(a.previewElement),this._updateMaxFilesReachedClass()},thumbnail:function(a,b){var c,d,e,f,g;if(a.previewElement){for(a.previewElement.classList.remove("dz-file-preview"),a.previewElement.classList.add("dz-image-preview"),f=a.previewElement.querySelectorAll("[data-dz-thumbnail]"),g=[],d=0,e=f.length;e>d;d++)c=f[d],c.alt=a.name,g.push(c.src=b);return g}},error:function(a,b){var c,d,e,f,g;if(a.previewElement){for(a.previewElement.classList.add("dz-error"),"String"!=typeof b&&b.error&&(b=b.error),f=a.previewElement.querySelectorAll("[data-dz-errormessage]"),g=[],d=0,e=f.length;e>d;d++)c=f[d],g.push(c.textContent=b);return g}},errormultiple:i,processing:function(a){return a.previewElement&&(a.previewElement.classList.add("dz-processing"),a._removeLink)?a._removeLink.textContent=this.options.dictCancelUpload:void 0},processingmultiple:i,uploadprogress:function(a,b){var c,d,e,f,g;if(a.previewElement){for(f=a.previewElement.querySelectorAll("[data-dz-uploadprogress]"),g=[],d=0,e=f.length;e>d;d++)c=f[d],g.push(c.style.width=""+b+"%");return g}},totaluploadprogress:i,sending:i,sendingmultiple:i,success:function(a){return a.previewElement?a.previewElement.classList.add("dz-success"):void 0},successmultiple:i,canceled:function(a){return this.emit("error",a,"Upload canceled.")},canceledmultiple:i,complete:function(a){return a._removeLink?a._removeLink.textContent=this.options.dictRemoveFile:void 0},completemultiple:i,maxfilesexceeded:i,maxfilesreached:i,previewTemplate:'\n \n \n \n \n \n \n ✔\n ✘\n \n'},c=function(){var a,b,c,d,e,f,g;for(d=arguments[0],c=2<=arguments.length?m.call(arguments,1):[],f=0,g=c.length;g>f;f++){b=c[f];for(a in b)e=b[a],d[a]=e}return d},b.prototype.getAcceptedFiles=function(){var a,b,c,d,e;for(d=this.files,e=[],b=0,c=d.length;c>b;b++)a=d[b],a.accepted&&e.push(a);return e},b.prototype.getRejectedFiles=function(){var a,b,c,d,e;for(d=this.files,e=[],b=0,c=d.length;c>b;b++)a=d[b],a.accepted||e.push(a);return e},b.prototype.getFilesWithStatus=function(a){var b,c,d,e,f;for(e=this.files,f=[],c=0,d=e.length;d>c;c++)b=e[c],b.status===a&&f.push(b);return f},b.prototype.getQueuedFiles=function(){return this.getFilesWithStatus(b.QUEUED)},b.prototype.getUploadingFiles=function(){return this.getFilesWithStatus(b.UPLOADING)},b.prototype.getActiveFiles=function(){var a,c,d,e,f;for(e=this.files,f=[],c=0,d=e.length;d>c;c++)a=e[c],(a.status===b.UPLOADING||a.status===b.QUEUED)&&f.push(a);return f},b.prototype.init=function(){var a,c,d,e,f,g,h;for("form"===this.element.tagName&&this.element.setAttribute("enctype","multipart/form-data"),this.element.classList.contains("dropzone")&&!this.element.querySelector(".dz-message")&&this.element.appendChild(b.createElement(' ")),this.clickableElements.length&&(d=function(a){return function(){return a.hiddenFileInput&&document.body.removeChild(a.hiddenFileInput),a.hiddenFileInput=document.createElement("input"),a.hiddenFileInput.setAttribute("type","file"),(null==a.options.maxFiles||a.options.maxFiles>1)&&a.hiddenFileInput.setAttribute("multiple","multiple"),a.hiddenFileInput.className="dz-hidden-input",null!=a.options.acceptedFiles&&a.hiddenFileInput.setAttribute("accept",a.options.acceptedFiles),a.hiddenFileInput.style.visibility="hidden",a.hiddenFileInput.style.position="absolute",a.hiddenFileInput.style.top="0",a.hiddenFileInput.style.left="0",a.hiddenFileInput.style.height="0",a.hiddenFileInput.style.width="0",document.body.appendChild(a.hiddenFileInput),a.hiddenFileInput.addEventListener("change",function(){var b,c,e,f;if(c=a.hiddenFileInput.files,c.length)for(e=0,f=c.length;f>e;e++)b=c[e],a.addFile(b);return d()})}}(this))(),this.URL=null!=(g=window.URL)?g:window.webkitURL,h=this.events,e=0,f=h.length;f>e;e++)a=h[e],this.on(a,this.options[a]);return this.on("uploadprogress",function(a){return function(){return a.updateTotalUploadProgress()}}(this)),this.on("removedfile",function(a){return function(){return a.updateTotalUploadProgress()}}(this)),this.on("canceled",function(a){return function(b){return a.emit("complete",b)}}(this)),this.on("complete",function(a){return function(){return 0===a.getUploadingFiles().length&&0===a.getQueuedFiles().length?setTimeout(function(){return a.emit("queuecomplete")},0):void 0}}(this)),c=function(a){return a.stopPropagation(),a.preventDefault?a.preventDefault():a.returnValue=!1},this.listeners=[{element:this.element,events:{dragstart:function(a){return function(b){return a.emit("dragstart",b)}}(this),dragenter:function(a){return function(b){return c(b),a.emit("dragenter",b)}}(this),dragover:function(a){return function(b){var d;try{d=b.dataTransfer.effectAllowed}catch(e){}return b.dataTransfer.dropEffect="move"===d||"linkMove"===d?"move":"copy",c(b),a.emit("dragover",b)}}(this),dragleave:function(a){return function(b){return a.emit("dragleave",b)}}(this),drop:function(a){return function(b){return c(b),a.drop(b)}}(this),dragend:function(a){return function(b){return a.emit("dragend",b)}}(this)}}],this.clickableElements.forEach(function(a){return function(c){return a.listeners.push({element:c,events:{click:function(d){return c!==a.element||d.target===a.element||b.elementInside(d.target,a.element.querySelector(".dz-message"))?a.hiddenFileInput.click():void 0}}})}}(this)),this.enable(),this.options.init.call(this)},b.prototype.destroy=function(){var a;return this.disable(),this.removeAllFiles(!0),(null!=(a=this.hiddenFileInput)?a.parentNode:void 0)&&(this.hiddenFileInput.parentNode.removeChild(this.hiddenFileInput),this.hiddenFileInput=null),delete this.element.dropzone,b.instances.splice(b.instances.indexOf(this),1)},b.prototype.updateTotalUploadProgress=function(){var a,b,c,d,e,f,g,h;if(d=0,c=0,a=this.getActiveFiles(),a.length){for(h=this.getActiveFiles(),f=0,g=h.length;g>f;f++)b=h[f],d+=b.upload.bytesSent,c+=b.upload.total;e=100*d/c}else e=100;return this.emit("totaluploadprogress",e,c,d)},b.prototype._getParamName=function(a){return"function"==typeof this.options.paramName?this.options.paramName(a):""+this.options.paramName+(this.options.uploadMultiple?"["+a+"]":"")},b.prototype.getFallbackForm=function(){var a,c,d,e;return(a=this.getExistingFallback())?a:(d='',this.options.dictFallbackText&&(d+=""+this.options.dictFallbackText+"
"),d+='',c=b.createElement(d),"FORM"!==this.element.tagName?(e=b.createElement(''),e.appendChild(c)):(this.element.setAttribute("enctype","multipart/form-data"),this.element.setAttribute("method",this.options.method)),null!=e?e:c)},b.prototype.getExistingFallback=function(){var a,b,c,d,e,f;for(b=function(a){var b,c,d;for(c=0,d=a.length;d>c;c++)if(b=a[c],/(^| )fallback($| )/.test(b.className))return b},f=["div","form"],d=0,e=f.length;e>d;d++)if(c=f[d],a=b(this.element.getElementsByTagName(c)))return a},b.prototype.setupEventListeners=function(){var a,b,c,d,e,f,g;for(f=this.listeners,g=[],d=0,e=f.length;e>d;d++)a=f[d],g.push(function(){var d,e;d=a.events,e=[];for(b in d)c=d[b],e.push(a.element.addEventListener(b,c,!1));return e}());return g},b.prototype.removeEventListeners=function(){var a,b,c,d,e,f,g;for(f=this.listeners,g=[],d=0,e=f.length;e>d;d++)a=f[d],g.push(function(){var d,e;d=a.events,e=[];for(b in d)c=d[b],e.push(a.element.removeEventListener(b,c,!1));return e}());return g},b.prototype.disable=function(){var a,b,c,d,e;for(this.clickableElements.forEach(function(a){return a.classList.remove("dz-clickable")}),this.removeEventListeners(),d=this.files,e=[],b=0,c=d.length;c>b;b++)a=d[b],e.push(this.cancelUpload(a));return e},b.prototype.enable=function(){return this.clickableElements.forEach(function(a){return a.classList.add("dz-clickable")}),this.setupEventListeners()},b.prototype.filesize=function(a){var b;return a>=109951162777.6?(a/=109951162777.6,b="TiB"):a>=107374182.4?(a/=107374182.4,b="GiB"):a>=104857.6?(a/=104857.6,b="MiB"):a>=102.4?(a/=102.4,b="KiB"):(a=10*a,b="b"),""+Math.round(a)/10+" "+b},b.prototype._updateMaxFilesReachedClass=function(){return null!=this.options.maxFiles&&this.getAcceptedFiles().length>=this.options.maxFiles?(this.getAcceptedFiles().length===this.options.maxFiles&&this.emit("maxfilesreached",this.files),this.element.classList.add("dz-max-files-reached")):this.element.classList.remove("dz-max-files-reached")},b.prototype.drop=function(a){var b,c;a.dataTransfer&&(this.emit("drop",a),b=a.dataTransfer.files,b.length&&(c=a.dataTransfer.items,c&&c.length&&null!=c[0].webkitGetAsEntry?this._addFilesFromItems(c):this.handleFiles(b)))},b.prototype.paste=function(a){var b,c;if(null!=(null!=a&&null!=(c=a.clipboardData)?c.items:void 0))return this.emit("paste",a),b=a.clipboardData.items,b.length?this._addFilesFromItems(b):void 0},b.prototype.handleFiles=function(a){var b,c,d,e;for(e=[],c=0,d=a.length;d>c;c++)b=a[c],e.push(this.addFile(b));return e},b.prototype._addFilesFromItems=function(a){var b,c,d,e,f;for(f=[],d=0,e=a.length;e>d;d++)c=a[d],f.push(null!=c.webkitGetAsEntry&&(b=c.webkitGetAsEntry())?b.isFile?this.addFile(c.getAsFile()):b.isDirectory?this._addFilesFromDirectory(b,b.name):void 0:null!=c.getAsFile?null==c.kind||"file"===c.kind?this.addFile(c.getAsFile()):void 0:void 0);return f},b.prototype._addFilesFromDirectory=function(a,b){var c,d;return c=a.createReader(),d=function(a){return function(c){var d,e,f;for(e=0,f=c.length;f>e;e++)d=c[e],d.isFile?d.file(function(c){return a.options.ignoreHiddenFiles&&"."===c.name.substring(0,1)?void 0:(c.fullPath=""+b+"/"+c.name,a.addFile(c))}):d.isDirectory&&a._addFilesFromDirectory(d,""+b+"/"+d.name)}}(this),c.readEntries(d,function(a){return"undefined"!=typeof console&&null!==console&&"function"==typeof console.log?console.log(a):void 0})},b.prototype.accept=function(a,c){return a.size>1024*this.options.maxFilesize*1024?c(this.options.dictFileTooBig.replace("{{filesize}}",Math.round(a.size/1024/10.24)/100).replace("{{maxFilesize}}",this.options.maxFilesize)):b.isValidFile(a,this.options.acceptedFiles)?null!=this.options.maxFiles&&this.getAcceptedFiles().length>=this.options.maxFiles?(c(this.options.dictMaxFilesExceeded.replace("{{maxFiles}}",this.options.maxFiles)),this.emit("maxfilesexceeded",a)):this.options.accept.call(this,a,c):c(this.options.dictInvalidFileType)},b.prototype.addFile=function(a){return a.upload={progress:0,total:a.size,bytesSent:0},this.files.push(a),a.status=b.ADDED,this.emit("addedfile",a),this._enqueueThumbnail(a),this.accept(a,function(b){return function(c){return c?(a.accepted=!1,b._errorProcessing([a],c)):(a.accepted=!0,b.options.autoQueue&&b.enqueueFile(a)),b._updateMaxFilesReachedClass()}}(this))},b.prototype.enqueueFiles=function(a){var b,c,d;for(c=0,d=a.length;d>c;c++)b=a[c],this.enqueueFile(b);return null},b.prototype.enqueueFile=function(a){if(a.status!==b.ADDED||a.accepted!==!0)throw new Error("This file can't be queued because it has already been processed or was rejected.");return a.status=b.QUEUED,this.options.autoProcessQueue?setTimeout(function(a){return function(){return a.processQueue()}}(this),0):void 0},b.prototype._thumbnailQueue=[],b.prototype._processingThumbnail=!1,b.prototype._enqueueThumbnail=function(a){return this.options.createImageThumbnails&&a.type.match(/image.*/)&&a.size<=1024*this.options.maxThumbnailFilesize*1024?(this._thumbnailQueue.push(a),setTimeout(function(a){return function(){return a._processThumbnailQueue()}}(this),0)):void 0},b.prototype._processThumbnailQueue=function(){return this._processingThumbnail||0===this._thumbnailQueue.length?void 0:(this._processingThumbnail=!0,this.createThumbnail(this._thumbnailQueue.shift(),function(a){return function(){return a._processingThumbnail=!1,a._processThumbnailQueue()}}(this)))},b.prototype.removeFile=function(a){return a.status===b.UPLOADING&&this.cancelUpload(a),this.files=j(this.files,a),this.emit("removedfile",a),0===this.files.length?this.emit("reset"):void 0},b.prototype.removeAllFiles=function(a){var c,d,e,f;for(null==a&&(a=!1),f=this.files.slice(),d=0,e=f.length;e>d;d++)c=f[d],(c.status!==b.UPLOADING||a)&&this.removeFile(c);return null},b.prototype.createThumbnail=function(a,b){var c;return c=new FileReader,c.onload=function(d){return function(){var e;return e=document.createElement("img"),e.onload=function(){var c,f,g,i,j,k,l,m;return a.width=e.width,a.height=e.height,g=d.options.resize.call(d,a),null==g.trgWidth&&(g.trgWidth=g.optWidth),null==g.trgHeight&&(g.trgHeight=g.optHeight),c=document.createElement("canvas"),f=c.getContext("2d"),c.width=g.trgWidth,c.height=g.trgHeight,h(f,e,null!=(j=g.srcX)?j:0,null!=(k=g.srcY)?k:0,g.srcWidth,g.srcHeight,null!=(l=g.trgX)?l:0,null!=(m=g.trgY)?m:0,g.trgWidth,g.trgHeight),i=c.toDataURL("image/png"),d.emit("thumbnail",a,i),null!=b?b():void 0},e.src=c.result}}(this),c.readAsDataURL(a)},b.prototype.processQueue=function(){var a,b,c,d;if(b=this.options.parallelUploads,c=this.getUploadingFiles().length,a=c,!(c>=b)&&(d=this.getQueuedFiles(),d.length>0)){if(this.options.uploadMultiple)return this.processFiles(d.slice(0,b-c));for(;b>a;){if(!d.length)return;this.processFile(d.shift()),a++}}},b.prototype.processFile=function(a){return this.processFiles([a])},b.prototype.processFiles=function(a){var c,d,e;for(d=0,e=a.length;e>d;d++)c=a[d],c.processing=!0,c.status=b.UPLOADING,this.emit("processing",c);return this.options.uploadMultiple&&this.emit("processingmultiple",a),this.uploadFiles(a)},b.prototype._getFilesWithXhr=function(a){var b,c;return c=function(){var c,d,e,f;for(e=this.files,f=[],c=0,d=e.length;d>c;c++)b=e[c],b.xhr===a&&f.push(b);return f}.call(this)},b.prototype.cancelUpload=function(a){var c,d,e,f,g,h,i;if(a.status===b.UPLOADING){for(d=this._getFilesWithXhr(a.xhr),e=0,g=d.length;g>e;e++)c=d[e],c.status=b.CANCELED;for(a.xhr.abort(),f=0,h=d.length;h>f;f++)c=d[f],this.emit("canceled",c);this.options.uploadMultiple&&this.emit("canceledmultiple",d)}else((i=a.status)===b.ADDED||i===b.QUEUED)&&(a.status=b.CANCELED,this.emit("canceled",a),this.options.uploadMultiple&&this.emit("canceledmultiple",[a]));return this.options.autoProcessQueue?this.processQueue():void 0},b.prototype.uploadFile=function(a){return this.uploadFiles([a])},b.prototype.uploadFiles=function(a){var d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I;for(t=new XMLHttpRequest,u=0,y=a.length;y>u;u++)d=a[u],d.xhr=t;t.open(this.options.method,this.options.url,!0),t.withCredentials=!!this.options.withCredentials,q=null,f=function(b){return function(){var c,e,f;for(f=[],c=0,e=a.length;e>c;c++)d=a[c],f.push(b._errorProcessing(a,q||b.options.dictResponseError.replace("{{statusCode}}",t.status),t));return f}}(this),r=function(b){return function(c){var e,f,g,h,i,j,k,l,m;if(null!=c)for(f=100*c.loaded/c.total,g=0,j=a.length;j>g;g++)d=a[g],d.upload={progress:f,total:c.total,bytesSent:c.loaded};else{for(e=!0,f=100,h=0,k=a.length;k>h;h++)d=a[h],(100!==d.upload.progress||d.upload.bytesSent!==d.upload.total)&&(e=!1),d.upload.progress=f,d.upload.bytesSent=d.upload.total;if(e)return}for(m=[],i=0,l=a.length;l>i;i++)d=a[i],m.push(b.emit("uploadprogress",d,f,d.upload.bytesSent));return m}}(this),t.onload=function(c){return function(d){var e;if(a[0].status!==b.CANCELED&&4===t.readyState){if(q=t.responseText,t.getResponseHeader("content-type")&&~t.getResponseHeader("content-type").indexOf("application/json"))try{q=JSON.parse(q)}catch(g){d=g,q="Invalid JSON response from server."}return r(),200<=(e=t.status)&&300>e?c._finished(a,q,d):f()}}}(this),t.onerror=function(){return function(){return a[0].status!==b.CANCELED?f():void 0}}(this),p=null!=(D=t.upload)?D:t,p.onprogress=r,i={Accept:"application/json","Cache-Control":"no-cache","X-Requested-With":"XMLHttpRequest"},this.options.headers&&c(i,this.options.headers);for(g in i)h=i[g],t.setRequestHeader(g,h);if(e=new FormData,this.options.params){E=this.options.params;for(n in E)s=E[n],e.append(n,s)}for(v=0,z=a.length;z>v;v++)d=a[v],this.emit("sending",d,t,e);if(this.options.uploadMultiple&&this.emit("sendingmultiple",a,t,e),"FORM"===this.element.tagName)for(F=this.element.querySelectorAll("input, textarea, select, button"),w=0,A=F.length;A>w;w++)if(k=F[w],l=k.getAttribute("name"),m=k.getAttribute("type"),"SELECT"===k.tagName&&k.hasAttribute("multiple"))for(G=k.options,x=0,B=G.length;B>x;x++)o=G[x],o.selected&&e.append(l,o.value);else(!m||"checkbox"!==(H=m.toLowerCase())&&"radio"!==H||k.checked)&&e.append(l,k.value);for(j=C=0,I=a.length-1;I>=0?I>=C:C>=I;j=I>=0?++C:--C)e.append(this._getParamName(j),a[j],a[j].name);return t.send(e)},b.prototype._finished=function(a,c,d){var e,f,g;for(f=0,g=a.length;g>f;f++)e=a[f],e.status=b.SUCCESS,this.emit("success",e,c,d),this.emit("complete",e);return this.options.uploadMultiple&&(this.emit("successmultiple",a,c,d),this.emit("completemultiple",a)),this.options.autoProcessQueue?this.processQueue():void 0},b.prototype._errorProcessing=function(a,c,d){var e,f,g;for(f=0,g=a.length;g>f;f++)e=a[f],e.status=b.ERROR,this.emit("error",e,c,d),this.emit("complete",e);return this.options.uploadMultiple&&(this.emit("errormultiple",a,c,d),this.emit("completemultiple",a)),this.options.autoProcessQueue?this.processQueue():void 0},b}(d),b.version="3.10.2",b.options={},b.optionsForElement=function(a){return a.getAttribute("id")?b.options[e(a.getAttribute("id"))]:void 0},b.instances=[],b.forElement=function(a){if("string"==typeof a&&(a=document.querySelector(a)),null==(null!=a?a.dropzone:void 0))throw new Error("No Dropzone found for given element. This is probably because you're trying to access it before Dropzone had the time to initialize. Use the `init` option to setup any additional observers on your Dropzone.");return a.dropzone},b.autoDiscover=!0,b.discover=function(){var a,c,d,e,f,g;for(document.querySelectorAll?d=document.querySelectorAll(".dropzone"):(d=[],a=function(a){var b,c,e,f;for(f=[],c=0,e=a.length;e>c;c++)b=a[c],f.push(/(^| )dropzone($| )/.test(b.className)?d.push(b):void 0);return f},a(document.getElementsByTagName("div")),a(document.getElementsByTagName("form"))),g=[],e=0,f=d.length;f>e;e++)c=d[e],g.push(b.optionsForElement(c)!==!1?new b(c):void 0);return g},b.blacklistedBrowsers=[/opera.*Macintosh.*version\/12/i],b.isBrowserSupported=function(){var a,c,d,e,f;if(a=!0,window.File&&window.FileReader&&window.FileList&&window.Blob&&window.FormData&&document.querySelector)if("classList"in document.createElement("a"))for(f=b.blacklistedBrowsers,d=0,e=f.length;e>d;d++)c=f[d],c.test(navigator.userAgent)&&(a=!1);else a=!1;else a=!1;return a},j=function(a,b){var c,d,e,f;for(f=[],d=0,e=a.length;e>d;d++)c=a[d],c!==b&&f.push(c);return f},e=function(a){return a.replace(/[\-_](\w)/g,function(a){return a.charAt(1).toUpperCase()})},b.createElement=function(a){var b;return b=document.createElement("div"),b.innerHTML=a,b.childNodes[0]},b.elementInside=function(a,b){if(a===b)return!0;for(;a=a.parentNode;)if(a===b)return!0;return!1},b.getElement=function(a,b){var c;if("string"==typeof a?c=document.querySelector(a):null!=a.nodeType&&(c=a),null==c)throw new Error("Invalid `"+b+"` option provided. Please provide a CSS selector or a plain HTML element.");return c},b.getElements=function(a,b){var c,d,e,f,g,h,i,j;if(a instanceof Array){e=[];try{for(f=0,h=a.length;h>f;f++)d=a[f],e.push(this.getElement(d,b))}catch(k){c=k,e=null}}else if("string"==typeof a)for(e=[],j=document.querySelectorAll(a),g=0,i=j.length;i>g;g++)d=j[g],e.push(d);else null!=a.nodeType&&(e=[a]);if(null==e||!e.length)throw new Error("Invalid `"+b+"` option provided. Please provide a CSS selector, a plain HTML element or a list of those.");return e},b.confirm=function(a,b,c){return window.confirm(a)?b():null!=c?c():void 0},b.isValidFile=function(a,b){var c,d,e,f,g;if(!b)return!0;for(b=b.split(","),d=a.type,c=d.replace(/\/.*$/,""),f=0,g=b.length;g>f;f++)if(e=b[f],e=e.trim(),"."===e.charAt(0)){if(-1!==a.name.toLowerCase().indexOf(e.toLowerCase(),a.name.length-e.length))return!0}else if(/\/\*$/.test(e)){if(c===e.replace(/\/.*$/,""))return!0}else if(d===e)return!0;return!1},"undefined"!=typeof jQuery&&null!==jQuery&&(jQuery.fn.dropzone=function(a){return this.each(function(){return new b(this,a)})}),"undefined"!=typeof c&&null!==c?c.exports=b:window.Dropzone=b,b.ADDED="added",b.QUEUED="queued",b.ACCEPTED=b.QUEUED,b.UPLOADING="uploading",b.PROCESSING=b.UPLOADING,b.CANCELED="canceled",b.ERROR="error",b.SUCCESS="success",g=function(a){var b,c,d,e,f,g,h,i,j,k;for(h=a.naturalWidth,g=a.naturalHeight,c=document.createElement("canvas"),c.width=1,c.height=g,d=c.getContext("2d"),d.drawImage(a,0,0),e=d.getImageData(0,0,1,g).data,k=0,f=g,i=g;i>k;)b=e[4*(i-1)+3],0===b?f=i:k=i,i=f+k>>1;return j=i/g,0===j?1:j},h=function(a,b,c,d,e,f,h,i,j,k){var l;return l=g(b),a.drawImage(b,c,d,e,f,h,i,j,k/l)},f=function(a,b){var c,d,e,f,g,h,i,j,k;if(e=!1,k=!0,d=a.document,j=d.documentElement,c=d.addEventListener?"addEventListener":"attachEvent",i=d.addEventListener?"removeEventListener":"detachEvent",h=d.addEventListener?"":"on",f=function(c){return"readystatechange"!==c.type||"complete"===d.readyState?(("load"===c.type?a:d)[i](h+c.type,f,!1),!e&&(e=!0)?b.call(a,c.type||c):void 0):void 0},g=function(){var a;try{j.doScroll("left")}catch(b){return a=b,void setTimeout(g,50)}return f("poll")},"complete"!==d.readyState){if(d.createEventObject&&j.doScroll){try{k=!a.frameElement}catch(l){}k&&g()}return d[c](h+"DOMContentLoaded",f,!1),d[c](h+"readystatechange",f,!1),a[c](h+"load",f,!1)}},b._autoDiscoverFunction=function(){return b.autoDiscover?b.discover():void 0},f(window,b._autoDiscoverFunction)}).call(this)}),"object"==typeof exports?module.exports=a("dropzone"):"function"==typeof define&&define.amd?define([],function(){return a("dropzone")}):this.Dropzone=a("dropzone")}();;/*!
- * Readmore.js jQuery plugin
- * Author: @jed_foster
- * Project home: jedfoster.github.io/Readmore.js
- * Licensed under the MIT license
- */
-
-;(function($) {
-
- var readmore = 'readmore',
- defaults = {
- speed: 100,
- maxHeight: 200,
- heightMargin: 16,
- moreLink: 'Read More',
- lessLink: 'Close',
- embedCSS: true,
- sectionCSS: 'display: block; width: 100%;',
- startOpen: false,
- expandedClass: 'readmore-js-expanded',
- collapsedClass: 'readmore-js-collapsed',
-
- // callbacks
- beforeToggle: function(){},
- afterToggle: function(){}
- },
- cssEmbedded = false;
-
- function Readmore( element, options ) {
- this.element = element;
-
- this.options = $.extend( {}, defaults, options);
-
- $(this.element).data('max-height', this.options.maxHeight);
- $(this.element).data('height-margin', this.options.heightMargin);
-
- delete(this.options.maxHeight);
-
- if(this.options.embedCSS && ! cssEmbedded) {
- var styles = '.readmore-js-toggle, .readmore-js-section { ' + this.options.sectionCSS + ' } .readmore-js-section { overflow: hidden; }';
-
- (function(d,u) {
- var css=d.createElement('style');
- css.type = 'text/css';
- if(css.styleSheet) {
- css.styleSheet.cssText = u;
- }
- else {
- css.appendChild(d.createTextNode(u));
- }
- d.getElementsByTagName('head')[0].appendChild(css);
- }(document, styles));
-
- cssEmbedded = true;
- }
-
- this._defaults = defaults;
- this._name = readmore;
-
- this.init();
- }
-
- Readmore.prototype = {
-
- init: function() {
- var $this = this;
-
- $(this.element).each(function() {
- var current = $(this),
- maxHeight = (current.css('max-height').replace(/[^-\d\.]/g, '') > current.data('max-height')) ? current.css('max-height').replace(/[^-\d\.]/g, '') : current.data('max-height'),
- heightMargin = current.data('height-margin');
-
- if(current.css('max-height') != 'none') {
- current.css('max-height', 'none');
- }
-
- $this.setBoxHeight(current);
-
- if(current.outerHeight(true) <= maxHeight + heightMargin) {
- // The block is shorter than the limit, so there's no need to truncate it.
- return true;
- }
- else {
- current.addClass('readmore-js-section ' + $this.options.collapsedClass).data('collapsedHeight', maxHeight);
-
- var useLink = $this.options.startOpen ? $this.options.lessLink : $this.options.moreLink;
- current.after($(useLink).on('click', function(event) { $this.toggleSlider(this, current, event) }).addClass('readmore-js-toggle'));
-
- if(!$this.options.startOpen) {
- current.css({height: maxHeight});
- }
- }
- });
-
- $(window).on('resize', function(event) {
- $this.resizeBoxes();
- });
- },
-
- toggleSlider: function(trigger, element, event)
- {
- event.preventDefault();
-
- var $this = this,
- newHeight = newLink = sectionClass = '',
- expanded = false,
- collapsedHeight = $(element).data('collapsedHeight');
-
- if ($(element).height() <= collapsedHeight) {
- newHeight = $(element).data('expandedHeight') + 'px';
- newLink = 'lessLink';
- expanded = true;
- sectionClass = $this.options.expandedClass;
- }
-
- else {
- newHeight = collapsedHeight;
- newLink = 'moreLink';
- sectionClass = $this.options.collapsedClass;
- }
-
- // Fire beforeToggle callback
- $this.options.beforeToggle(trigger, element, expanded);
-
- $(element).animate({'height': newHeight}, {duration: $this.options.speed, complete: function() {
- // Fire afterToggle callback
- $this.options.afterToggle(trigger, element, expanded);
-
- $(trigger).replaceWith($($this.options[newLink]).on('click', function(event) { $this.toggleSlider(this, element, event) }).addClass('readmore-js-toggle'));
-
- $(this).removeClass($this.options.collapsedClass + ' ' + $this.options.expandedClass).addClass(sectionClass);
- }
- });
- },
-
- setBoxHeight: function(element) {
- var el = element.clone().css({'height': 'auto', 'width': element.width(), 'overflow': 'hidden'}).insertAfter(element),
- height = el.outerHeight(true);
-
- el.remove();
-
- element.data('expandedHeight', height);
- },
-
- resizeBoxes: function() {
- var $this = this;
-
- $('.readmore-js-section').each(function() {
- var current = $(this);
-
- $this.setBoxHeight(current);
-
- if(current.height() > current.data('expandedHeight') || (current.hasClass($this.options.expandedClass) && current.height() < current.data('expandedHeight')) ) {
- current.css('height', current.data('expandedHeight'));
- }
- });
- },
-
- destroy: function() {
- var $this = this;
-
- $(this.element).each(function() {
- var current = $(this);
-
- current.removeClass('readmore-js-section ' + $this.options.collapsedClass + ' ' + $this.options.expandedClass).css({'max-height': '', 'height': 'auto'}).next('.readmore-js-toggle').remove();
-
- current.removeData();
- });
- }
- };
-
- $.fn[readmore] = function( options ) {
- var args = arguments;
- if (options === undefined || typeof options === 'object') {
- return this.each(function () {
- if ($.data(this, 'plugin_' + readmore)) {
- var instance = $.data(this, 'plugin_' + readmore);
- instance['destroy'].apply(instance);
- }
-
- $.data(this, 'plugin_' + readmore, new Readmore( this, options ));
- });
- } else if (typeof options === 'string' && options[0] !== '_' && options !== 'init') {
- return this.each(function () {
- var instance = $.data(this, 'plugin_' + readmore);
- if (instance instanceof Readmore && typeof instance[options] === 'function') {
- instance[options].apply( instance, Array.prototype.slice.call( args, 1 ) );
- }
- });
- }
- }
-})(jQuery);
-;(function(a){var b=new Array;var c=new Array;a.fn.doAutosize=function(b){var c=a(this).data("minwidth"),d=a(this).data("maxwidth"),e="",f=a(this),g=a("#"+a(this).data("tester_id"));if(e===(e=f.val())){return}var h=e.replace(/&/g,"&").replace(/\s/g," ").replace(//g,">");g.html(h);var i=g.width(),j=i+b.comfortZone>=c?i+b.comfortZone:c,k=f.width(),l=j=c||j>c&&j").css({position:"absolute",top:-9999,left:-9999,width:"auto",fontSize:f.css("fontSize"),fontFamily:f.css("fontFamily"),fontWeight:f.css("fontWeight"),letterSpacing:f.css("letterSpacing"),whiteSpace:"nowrap"}),h=a(this).attr("id")+"_autosize_tester";if(!a("#"+h).length>0){g.attr("id",h);g.appendTo("body")}f.data("minwidth",c);f.data("maxwidth",d);f.data("tester_id",h);f.css("width",c)};a.fn.addTag=function(d,e){e=jQuery.extend({focus:false,callback:true},e);this.each(function(){var f=a(this).attr("id");var g=a(this).val().split(b[f]);if(g[0]==""){g=new Array}d=jQuery.trim(d);if(e.unique){var h=a(g).tagExist(d);if(h==true){a("#"+f+"_tag").addClass("not_valid")}}else{var h=false}if(d!=""&&h!=true){a("").addClass("tag").append(a("").text(d).append(" "),a("",{href:"#",title:"Removing tag",text:"x"}).click(function(){return a("#"+f).removeTag(escape(d))})).insertBefore("#"+f+"_addTag");g.push(d);a("#"+f+"_tag").val("");if(e.focus){a("#"+f+"_tag").focus()}else{a("#"+f+"_tag").blur()}a.fn.tagsInput.updateTagsField(this,g);if(e.callback&&c[f]&&c[f]["onAddTag"]){var i=c[f]["onAddTag"];i.call(this,d)}if(c[f]&&c[f]["onChange"]){var j=g.length;var i=c[f]["onChange"];i.call(this,a(this),g[j-1])}}});return false};a.fn.removeTag=function(d){d=unescape(d);this.each(function(){var e=a(this).attr("id");var f=a(this).val().split(b[e]);a("#"+e+"_tagsinput .tag").remove();str="";for(i=0;i=0};a.fn.importTags=function(b){id=a(this).attr("id");a("#"+id+"_tagsinput .tag").remove();a.fn.tagsInput.importTags(this,b)};a.fn.tagsInput=function(d){var e=jQuery.extend({interactive:true,defaultText:"add a tag",minChars:0,width:"300px",height:"100px",autocomplete:{selectFirst:false},hide:true,delimiter:",",unique:true,removeWithBackspace:true,placeholderColor:"#666666",autosize:true,comfortZone:20,inputPadding:6*2},d);this.each(function(){if(e.hide){a(this).hide()}var d=a(this).attr("id");var f=jQuery.extend({pid:d,real_input:"#"+d,holder:"#"+d+"_tagsinput",input_wrapper:"#"+d+"_addTag",fake_input:"#"+d+"_tag"},e);b[d]=f.delimiter;if(e.onAddTag||e.onRemoveTag||e.onChange){c[d]=new Array;c[d]["onAddTag"]=e.onAddTag;c[d]["onRemoveTag"]=e.onRemoveTag;c[d]["onChange"]=e.onChange}var g='d;++d)c[d].apply(this,b)}return this},c.prototype.listeners=function(a){return this._callbacks=this._callbacks||{},this._callbacks[a]||[]},c.prototype.hasListeners=function(a){return!!this.listeners(a).length}}),a.register("dropzone",function(b,c){c.exports=a("dropzone/lib/dropzone.js")}),a.register("dropzone/lib/dropzone.js",function(b,c){(function(){var b,d,e,f,g,h,i,j,k={}.hasOwnProperty,l=function(a,b){function c(){this.constructor=a}for(var d in b)k.call(b,d)&&(a[d]=b[d]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a},m=[].slice;d="undefined"!=typeof Emitter&&null!==Emitter?Emitter:a("component~emitter@1.1.2"),i=function(){},b=function(a){function b(a,d){var e,f,g;if(this.element=a,this.version=b.version,this.defaultOptions.previewTemplate=this.defaultOptions.previewTemplate.replace(/\n*/g,""),this.clickableElements=[],this.listeners=[],this.files=[],"string"==typeof this.element&&(this.element=document.querySelector(this.element)),!this.element||null==this.element.nodeType)throw new Error("Invalid dropzone element.");if(this.element.dropzone)throw new Error("Dropzone already attached.");if(b.instances.push(this),this.element.dropzone=this,e=null!=(g=b.optionsForElement(this.element))?g:{},this.options=c({},this.defaultOptions,e,null!=d?d:{}),this.options.forceFallback||!b.isBrowserSupported())return this.options.fallback.call(this);if(null==this.options.url&&(this.options.url=this.element.getAttribute("action")),!this.options.url)throw new Error("No URL provided.");if(this.options.acceptedFiles&&this.options.acceptedMimeTypes)throw new Error("You can't provide both 'acceptedFiles' and 'acceptedMimeTypes'. 'acceptedMimeTypes' is deprecated.");this.options.acceptedMimeTypes&&(this.options.acceptedFiles=this.options.acceptedMimeTypes,delete this.options.acceptedMimeTypes),this.options.method=this.options.method.toUpperCase(),(f=this.getExistingFallback())&&f.parentNode&&f.parentNode.removeChild(f),this.options.previewsContainer!==!1&&(this.previewsContainer=this.options.previewsContainer?b.getElement(this.options.previewsContainer,"previewsContainer"):this.element),this.options.clickable&&(this.clickableElements=this.options.clickable===!0?[this.element]:b.getElements(this.options.clickable,"clickable")),this.init()}var c;return l(b,a),b.prototype.events=["drop","dragstart","dragend","dragenter","dragover","dragleave","addedfile","removedfile","thumbnail","error","errormultiple","processing","processingmultiple","uploadprogress","totaluploadprogress","sending","sendingmultiple","success","successmultiple","canceled","canceledmultiple","complete","completemultiple","reset","maxfilesexceeded","maxfilesreached"],b.prototype.defaultOptions={url:null,method:"post",withCredentials:!1,parallelUploads:2,uploadMultiple:!1,maxFilesize:256,paramName:"file",createImageThumbnails:!0,maxThumbnailFilesize:10,thumbnailWidth:100,thumbnailHeight:100,maxFiles:null,params:{},clickable:!0,ignoreHiddenFiles:!0,acceptedFiles:null,acceptedMimeTypes:null,autoProcessQueue:!0,autoQueue:!0,addRemoveLinks:!1,previewsContainer:null,dictDefaultMessage:"Drop files here to upload",dictFallbackMessage:"Your browser does not support drag'n'drop file uploads.",dictFallbackText:"Please use the fallback form below to upload your files like in the olden days.",dictFileTooBig:"File is too big ({{filesize}}MiB). Max filesize: {{maxFilesize}}MiB.",dictInvalidFileType:"You can't upload files of this type.",dictResponseError:"Server responded with {{statusCode}} code.",dictCancelUpload:"Cancel upload",dictCancelUploadConfirmation:"Are you sure you want to cancel this upload?",dictRemoveFile:"Remove file",dictRemoveFileConfirmation:null,dictMaxFilesExceeded:"You can not upload any more files.",accept:function(a,b){return b()},init:function(){return i},forceFallback:!1,fallback:function(){var a,c,d,e,f,g;for(this.element.className=""+this.element.className+" dz-browser-not-supported",g=this.element.getElementsByTagName("div"),e=0,f=g.length;f>e;e++)a=g[e],/(^| )dz-message($| )/.test(a.className)&&(c=a,a.className="dz-message");return c||(c=b.createElement('d?(b.srcHeight=a.height,b.srcWidth=b.srcHeight*d):(b.srcWidth=a.width,b.srcHeight=b.srcWidth/d),b.srcX=(a.width-b.srcWidth)/2,b.srcY=(a.height-b.srcHeight)/2,b},drop:function(){return this.element.classList.remove("dz-drag-hover")},dragstart:i,dragend:function(){return this.element.classList.remove("dz-drag-hover")},dragenter:function(){return this.element.classList.add("dz-drag-hover")},dragover:function(){return this.element.classList.add("dz-drag-hover")},dragleave:function(){return this.element.classList.remove("dz-drag-hover")},paste:i,reset:function(){return this.element.classList.remove("dz-started")},addedfile:function(a){var c,d,e,f,g,h,i,j,k,l,m,n,o;if(this.element===this.previewsContainer&&this.element.classList.add("dz-started"),this.previewsContainer){for(a.previewElement=b.createElement(this.options.previewTemplate.trim()),a.previewTemplate=a.previewElement,this.previewsContainer.appendChild(a.previewElement),l=a.previewElement.querySelectorAll("[data-dz-name]"),f=0,i=l.length;i>f;f++)c=l[f],c.textContent=a.name;for(m=a.previewElement.querySelectorAll("[data-dz-size]"),g=0,j=m.length;j>g;g++)c=m[g],c.innerHTML=this.filesize(a.size);for(this.options.addRemoveLinks&&(a._removeLink=b.createElement(''+this.options.dictRemoveFile+""),a.previewElement.appendChild(a._removeLink)),d=function(c){return function(d){return d.preventDefault(),d.stopPropagation(),a.status===b.UPLOADING?b.confirm(c.options.dictCancelUploadConfirmation,function(){return c.removeFile(a)}):c.options.dictRemoveFileConfirmation?b.confirm(c.options.dictRemoveFileConfirmation,function(){return c.removeFile(a)}):c.removeFile(a)}}(this),n=a.previewElement.querySelectorAll("[data-dz-remove]"),o=[],h=0,k=n.length;k>h;h++)e=n[h],o.push(e.addEventListener("click",d));return o}},removedfile:function(a){var b;return a.previewElement&&null!=(b=a.previewElement)&&b.parentNode.removeChild(a.previewElement),this._updateMaxFilesReachedClass()},thumbnail:function(a,b){var c,d,e,f,g;if(a.previewElement){for(a.previewElement.classList.remove("dz-file-preview"),a.previewElement.classList.add("dz-image-preview"),f=a.previewElement.querySelectorAll("[data-dz-thumbnail]"),g=[],d=0,e=f.length;e>d;d++)c=f[d],c.alt=a.name,g.push(c.src=b);return g}},error:function(a,b){var c,d,e,f,g;if(a.previewElement){for(a.previewElement.classList.add("dz-error"),"String"!=typeof b&&b.error&&(b=b.error),f=a.previewElement.querySelectorAll("[data-dz-errormessage]"),g=[],d=0,e=f.length;e>d;d++)c=f[d],g.push(c.textContent=b);return g}},errormultiple:i,processing:function(a){return a.previewElement&&(a.previewElement.classList.add("dz-processing"),a._removeLink)?a._removeLink.textContent=this.options.dictCancelUpload:void 0},processingmultiple:i,uploadprogress:function(a,b){var c,d,e,f,g;if(a.previewElement){for(f=a.previewElement.querySelectorAll("[data-dz-uploadprogress]"),g=[],d=0,e=f.length;e>d;d++)c=f[d],g.push(c.style.width=""+b+"%");return g}},totaluploadprogress:i,sending:i,sendingmultiple:i,success:function(a){return a.previewElement?a.previewElement.classList.add("dz-success"):void 0},successmultiple:i,canceled:function(a){return this.emit("error",a,"Upload canceled.")},canceledmultiple:i,complete:function(a){return a._removeLink?a._removeLink.textContent=this.options.dictRemoveFile:void 0},completemultiple:i,maxfilesexceeded:i,maxfilesreached:i,previewTemplate:'\n \n \n \n \n \n \n ✔\n ✘\n \n'},c=function(){var a,b,c,d,e,f,g;for(d=arguments[0],c=2<=arguments.length?m.call(arguments,1):[],f=0,g=c.length;g>f;f++){b=c[f];for(a in b)e=b[a],d[a]=e}return d},b.prototype.getAcceptedFiles=function(){var a,b,c,d,e;for(d=this.files,e=[],b=0,c=d.length;c>b;b++)a=d[b],a.accepted&&e.push(a);return e},b.prototype.getRejectedFiles=function(){var a,b,c,d,e;for(d=this.files,e=[],b=0,c=d.length;c>b;b++)a=d[b],a.accepted||e.push(a);return e},b.prototype.getFilesWithStatus=function(a){var b,c,d,e,f;for(e=this.files,f=[],c=0,d=e.length;d>c;c++)b=e[c],b.status===a&&f.push(b);return f},b.prototype.getQueuedFiles=function(){return this.getFilesWithStatus(b.QUEUED)},b.prototype.getUploadingFiles=function(){return this.getFilesWithStatus(b.UPLOADING)},b.prototype.getActiveFiles=function(){var a,c,d,e,f;for(e=this.files,f=[],c=0,d=e.length;d>c;c++)a=e[c],(a.status===b.UPLOADING||a.status===b.QUEUED)&&f.push(a);return f},b.prototype.init=function(){var a,c,d,e,f,g,h;for("form"===this.element.tagName&&this.element.setAttribute("enctype","multipart/form-data"),this.element.classList.contains("dropzone")&&!this.element.querySelector(".dz-message")&&this.element.appendChild(b.createElement(' ")),this.clickableElements.length&&(d=function(a){return function(){return a.hiddenFileInput&&document.body.removeChild(a.hiddenFileInput),a.hiddenFileInput=document.createElement("input"),a.hiddenFileInput.setAttribute("type","file"),(null==a.options.maxFiles||a.options.maxFiles>1)&&a.hiddenFileInput.setAttribute("multiple","multiple"),a.hiddenFileInput.className="dz-hidden-input",null!=a.options.acceptedFiles&&a.hiddenFileInput.setAttribute("accept",a.options.acceptedFiles),a.hiddenFileInput.style.visibility="hidden",a.hiddenFileInput.style.position="absolute",a.hiddenFileInput.style.top="0",a.hiddenFileInput.style.left="0",a.hiddenFileInput.style.height="0",a.hiddenFileInput.style.width="0",document.body.appendChild(a.hiddenFileInput),a.hiddenFileInput.addEventListener("change",function(){var b,c,e,f;if(c=a.hiddenFileInput.files,c.length)for(e=0,f=c.length;f>e;e++)b=c[e],a.addFile(b);return d()})}}(this))(),this.URL=null!=(g=window.URL)?g:window.webkitURL,h=this.events,e=0,f=h.length;f>e;e++)a=h[e],this.on(a,this.options[a]);return this.on("uploadprogress",function(a){return function(){return a.updateTotalUploadProgress()}}(this)),this.on("removedfile",function(a){return function(){return a.updateTotalUploadProgress()}}(this)),this.on("canceled",function(a){return function(b){return a.emit("complete",b)}}(this)),this.on("complete",function(a){return function(){return 0===a.getUploadingFiles().length&&0===a.getQueuedFiles().length?setTimeout(function(){return a.emit("queuecomplete")},0):void 0}}(this)),c=function(a){return a.stopPropagation(),a.preventDefault?a.preventDefault():a.returnValue=!1},this.listeners=[{element:this.element,events:{dragstart:function(a){return function(b){return a.emit("dragstart",b)}}(this),dragenter:function(a){return function(b){return c(b),a.emit("dragenter",b)}}(this),dragover:function(a){return function(b){var d;try{d=b.dataTransfer.effectAllowed}catch(e){}return b.dataTransfer.dropEffect="move"===d||"linkMove"===d?"move":"copy",c(b),a.emit("dragover",b)}}(this),dragleave:function(a){return function(b){return a.emit("dragleave",b)}}(this),drop:function(a){return function(b){return c(b),a.drop(b)}}(this),dragend:function(a){return function(b){return a.emit("dragend",b)}}(this)}}],this.clickableElements.forEach(function(a){return function(c){return a.listeners.push({element:c,events:{click:function(d){return c!==a.element||d.target===a.element||b.elementInside(d.target,a.element.querySelector(".dz-message"))?a.hiddenFileInput.click():void 0}}})}}(this)),this.enable(),this.options.init.call(this)},b.prototype.destroy=function(){var a;return this.disable(),this.removeAllFiles(!0),(null!=(a=this.hiddenFileInput)?a.parentNode:void 0)&&(this.hiddenFileInput.parentNode.removeChild(this.hiddenFileInput),this.hiddenFileInput=null),delete this.element.dropzone,b.instances.splice(b.instances.indexOf(this),1)},b.prototype.updateTotalUploadProgress=function(){var a,b,c,d,e,f,g,h;if(d=0,c=0,a=this.getActiveFiles(),a.length){for(h=this.getActiveFiles(),f=0,g=h.length;g>f;f++)b=h[f],d+=b.upload.bytesSent,c+=b.upload.total;e=100*d/c}else e=100;return this.emit("totaluploadprogress",e,c,d)},b.prototype._getParamName=function(a){return"function"==typeof this.options.paramName?this.options.paramName(a):""+this.options.paramName+(this.options.uploadMultiple?"["+a+"]":"")},b.prototype.getFallbackForm=function(){var a,c,d,e;return(a=this.getExistingFallback())?a:(d='',this.options.dictFallbackText&&(d+=""+this.options.dictFallbackText+"
"),d+='',c=b.createElement(d),"FORM"!==this.element.tagName?(e=b.createElement(''),e.appendChild(c)):(this.element.setAttribute("enctype","multipart/form-data"),this.element.setAttribute("method",this.options.method)),null!=e?e:c)},b.prototype.getExistingFallback=function(){var a,b,c,d,e,f;for(b=function(a){var b,c,d;for(c=0,d=a.length;d>c;c++)if(b=a[c],/(^| )fallback($| )/.test(b.className))return b},f=["div","form"],d=0,e=f.length;e>d;d++)if(c=f[d],a=b(this.element.getElementsByTagName(c)))return a},b.prototype.setupEventListeners=function(){var a,b,c,d,e,f,g;for(f=this.listeners,g=[],d=0,e=f.length;e>d;d++)a=f[d],g.push(function(){var d,e;d=a.events,e=[];for(b in d)c=d[b],e.push(a.element.addEventListener(b,c,!1));return e}());return g},b.prototype.removeEventListeners=function(){var a,b,c,d,e,f,g;for(f=this.listeners,g=[],d=0,e=f.length;e>d;d++)a=f[d],g.push(function(){var d,e;d=a.events,e=[];for(b in d)c=d[b],e.push(a.element.removeEventListener(b,c,!1));return e}());return g},b.prototype.disable=function(){var a,b,c,d,e;for(this.clickableElements.forEach(function(a){return a.classList.remove("dz-clickable")}),this.removeEventListeners(),d=this.files,e=[],b=0,c=d.length;c>b;b++)a=d[b],e.push(this.cancelUpload(a));return e},b.prototype.enable=function(){return this.clickableElements.forEach(function(a){return a.classList.add("dz-clickable")}),this.setupEventListeners()},b.prototype.filesize=function(a){var b;return a>=109951162777.6?(a/=109951162777.6,b="TiB"):a>=107374182.4?(a/=107374182.4,b="GiB"):a>=104857.6?(a/=104857.6,b="MiB"):a>=102.4?(a/=102.4,b="KiB"):(a=10*a,b="b"),""+Math.round(a)/10+" "+b},b.prototype._updateMaxFilesReachedClass=function(){return null!=this.options.maxFiles&&this.getAcceptedFiles().length>=this.options.maxFiles?(this.getAcceptedFiles().length===this.options.maxFiles&&this.emit("maxfilesreached",this.files),this.element.classList.add("dz-max-files-reached")):this.element.classList.remove("dz-max-files-reached")},b.prototype.drop=function(a){var b,c;a.dataTransfer&&(this.emit("drop",a),b=a.dataTransfer.files,b.length&&(c=a.dataTransfer.items,c&&c.length&&null!=c[0].webkitGetAsEntry?this._addFilesFromItems(c):this.handleFiles(b)))},b.prototype.paste=function(a){var b,c;if(null!=(null!=a&&null!=(c=a.clipboardData)?c.items:void 0))return this.emit("paste",a),b=a.clipboardData.items,b.length?this._addFilesFromItems(b):void 0},b.prototype.handleFiles=function(a){var b,c,d,e;for(e=[],c=0,d=a.length;d>c;c++)b=a[c],e.push(this.addFile(b));return e},b.prototype._addFilesFromItems=function(a){var b,c,d,e,f;for(f=[],d=0,e=a.length;e>d;d++)c=a[d],f.push(null!=c.webkitGetAsEntry&&(b=c.webkitGetAsEntry())?b.isFile?this.addFile(c.getAsFile()):b.isDirectory?this._addFilesFromDirectory(b,b.name):void 0:null!=c.getAsFile?null==c.kind||"file"===c.kind?this.addFile(c.getAsFile()):void 0:void 0);return f},b.prototype._addFilesFromDirectory=function(a,b){var c,d;return c=a.createReader(),d=function(a){return function(c){var d,e,f;for(e=0,f=c.length;f>e;e++)d=c[e],d.isFile?d.file(function(c){return a.options.ignoreHiddenFiles&&"."===c.name.substring(0,1)?void 0:(c.fullPath=""+b+"/"+c.name,a.addFile(c))}):d.isDirectory&&a._addFilesFromDirectory(d,""+b+"/"+d.name)}}(this),c.readEntries(d,function(a){return"undefined"!=typeof console&&null!==console&&"function"==typeof console.log?console.log(a):void 0})},b.prototype.accept=function(a,c){return a.size>1024*this.options.maxFilesize*1024?c(this.options.dictFileTooBig.replace("{{filesize}}",Math.round(a.size/1024/10.24)/100).replace("{{maxFilesize}}",this.options.maxFilesize)):b.isValidFile(a,this.options.acceptedFiles)?null!=this.options.maxFiles&&this.getAcceptedFiles().length>=this.options.maxFiles?(c(this.options.dictMaxFilesExceeded.replace("{{maxFiles}}",this.options.maxFiles)),this.emit("maxfilesexceeded",a)):this.options.accept.call(this,a,c):c(this.options.dictInvalidFileType)},b.prototype.addFile=function(a){return a.upload={progress:0,total:a.size,bytesSent:0},this.files.push(a),a.status=b.ADDED,this.emit("addedfile",a),this._enqueueThumbnail(a),this.accept(a,function(b){return function(c){return c?(a.accepted=!1,b._errorProcessing([a],c)):(a.accepted=!0,b.options.autoQueue&&b.enqueueFile(a)),b._updateMaxFilesReachedClass()}}(this))},b.prototype.enqueueFiles=function(a){var b,c,d;for(c=0,d=a.length;d>c;c++)b=a[c],this.enqueueFile(b);return null},b.prototype.enqueueFile=function(a){if(a.status!==b.ADDED||a.accepted!==!0)throw new Error("This file can't be queued because it has already been processed or was rejected.");return a.status=b.QUEUED,this.options.autoProcessQueue?setTimeout(function(a){return function(){return a.processQueue()}}(this),0):void 0},b.prototype._thumbnailQueue=[],b.prototype._processingThumbnail=!1,b.prototype._enqueueThumbnail=function(a){return this.options.createImageThumbnails&&a.type.match(/image.*/)&&a.size<=1024*this.options.maxThumbnailFilesize*1024?(this._thumbnailQueue.push(a),setTimeout(function(a){return function(){return a._processThumbnailQueue()}}(this),0)):void 0},b.prototype._processThumbnailQueue=function(){return this._processingThumbnail||0===this._thumbnailQueue.length?void 0:(this._processingThumbnail=!0,this.createThumbnail(this._thumbnailQueue.shift(),function(a){return function(){return a._processingThumbnail=!1,a._processThumbnailQueue()}}(this)))},b.prototype.removeFile=function(a){return a.status===b.UPLOADING&&this.cancelUpload(a),this.files=j(this.files,a),this.emit("removedfile",a),0===this.files.length?this.emit("reset"):void 0},b.prototype.removeAllFiles=function(a){var c,d,e,f;for(null==a&&(a=!1),f=this.files.slice(),d=0,e=f.length;e>d;d++)c=f[d],(c.status!==b.UPLOADING||a)&&this.removeFile(c);return null},b.prototype.createThumbnail=function(a,b){var c;return c=new FileReader,c.onload=function(d){return function(){var e;return e=document.createElement("img"),e.onload=function(){var c,f,g,i,j,k,l,m;return a.width=e.width,a.height=e.height,g=d.options.resize.call(d,a),null==g.trgWidth&&(g.trgWidth=g.optWidth),null==g.trgHeight&&(g.trgHeight=g.optHeight),c=document.createElement("canvas"),f=c.getContext("2d"),c.width=g.trgWidth,c.height=g.trgHeight,h(f,e,null!=(j=g.srcX)?j:0,null!=(k=g.srcY)?k:0,g.srcWidth,g.srcHeight,null!=(l=g.trgX)?l:0,null!=(m=g.trgY)?m:0,g.trgWidth,g.trgHeight),i=c.toDataURL("image/png"),d.emit("thumbnail",a,i),null!=b?b():void 0},e.src=c.result}}(this),c.readAsDataURL(a)},b.prototype.processQueue=function(){var a,b,c,d;if(b=this.options.parallelUploads,c=this.getUploadingFiles().length,a=c,!(c>=b)&&(d=this.getQueuedFiles(),d.length>0)){if(this.options.uploadMultiple)return this.processFiles(d.slice(0,b-c));for(;b>a;){if(!d.length)return;this.processFile(d.shift()),a++}}},b.prototype.processFile=function(a){return this.processFiles([a])},b.prototype.processFiles=function(a){var c,d,e;for(d=0,e=a.length;e>d;d++)c=a[d],c.processing=!0,c.status=b.UPLOADING,this.emit("processing",c);return this.options.uploadMultiple&&this.emit("processingmultiple",a),this.uploadFiles(a)},b.prototype._getFilesWithXhr=function(a){var b,c;return c=function(){var c,d,e,f;for(e=this.files,f=[],c=0,d=e.length;d>c;c++)b=e[c],b.xhr===a&&f.push(b);return f}.call(this)},b.prototype.cancelUpload=function(a){var c,d,e,f,g,h,i;if(a.status===b.UPLOADING){for(d=this._getFilesWithXhr(a.xhr),e=0,g=d.length;g>e;e++)c=d[e],c.status=b.CANCELED;for(a.xhr.abort(),f=0,h=d.length;h>f;f++)c=d[f],this.emit("canceled",c);this.options.uploadMultiple&&this.emit("canceledmultiple",d)}else((i=a.status)===b.ADDED||i===b.QUEUED)&&(a.status=b.CANCELED,this.emit("canceled",a),this.options.uploadMultiple&&this.emit("canceledmultiple",[a]));return this.options.autoProcessQueue?this.processQueue():void 0},b.prototype.uploadFile=function(a){return this.uploadFiles([a])},b.prototype.uploadFiles=function(a){var d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I;for(t=new XMLHttpRequest,u=0,y=a.length;y>u;u++)d=a[u],d.xhr=t;t.open(this.options.method,this.options.url,!0),t.withCredentials=!!this.options.withCredentials,q=null,f=function(b){return function(){var c,e,f;for(f=[],c=0,e=a.length;e>c;c++)d=a[c],f.push(b._errorProcessing(a,q||b.options.dictResponseError.replace("{{statusCode}}",t.status),t));return f}}(this),r=function(b){return function(c){var e,f,g,h,i,j,k,l,m;if(null!=c)for(f=100*c.loaded/c.total,g=0,j=a.length;j>g;g++)d=a[g],d.upload={progress:f,total:c.total,bytesSent:c.loaded};else{for(e=!0,f=100,h=0,k=a.length;k>h;h++)d=a[h],(100!==d.upload.progress||d.upload.bytesSent!==d.upload.total)&&(e=!1),d.upload.progress=f,d.upload.bytesSent=d.upload.total;if(e)return}for(m=[],i=0,l=a.length;l>i;i++)d=a[i],m.push(b.emit("uploadprogress",d,f,d.upload.bytesSent));return m}}(this),t.onload=function(c){return function(d){var e;if(a[0].status!==b.CANCELED&&4===t.readyState){if(q=t.responseText,t.getResponseHeader("content-type")&&~t.getResponseHeader("content-type").indexOf("application/json"))try{q=JSON.parse(q)}catch(g){d=g,q="Invalid JSON response from server."}return r(),200<=(e=t.status)&&300>e?c._finished(a,q,d):f()}}}(this),t.onerror=function(){return function(){return a[0].status!==b.CANCELED?f():void 0}}(this),p=null!=(D=t.upload)?D:t,p.onprogress=r,i={Accept:"application/json","Cache-Control":"no-cache","X-Requested-With":"XMLHttpRequest"},this.options.headers&&c(i,this.options.headers);for(g in i)h=i[g],t.setRequestHeader(g,h);if(e=new FormData,this.options.params){E=this.options.params;for(n in E)s=E[n],e.append(n,s)}for(v=0,z=a.length;z>v;v++)d=a[v],this.emit("sending",d,t,e);if(this.options.uploadMultiple&&this.emit("sendingmultiple",a,t,e),"FORM"===this.element.tagName)for(F=this.element.querySelectorAll("input, textarea, select, button"),w=0,A=F.length;A>w;w++)if(k=F[w],l=k.getAttribute("name"),m=k.getAttribute("type"),"SELECT"===k.tagName&&k.hasAttribute("multiple"))for(G=k.options,x=0,B=G.length;B>x;x++)o=G[x],o.selected&&e.append(l,o.value);else(!m||"checkbox"!==(H=m.toLowerCase())&&"radio"!==H||k.checked)&&e.append(l,k.value);for(j=C=0,I=a.length-1;I>=0?I>=C:C>=I;j=I>=0?++C:--C)e.append(this._getParamName(j),a[j],a[j].name);return t.send(e)},b.prototype._finished=function(a,c,d){var e,f,g;for(f=0,g=a.length;g>f;f++)e=a[f],e.status=b.SUCCESS,this.emit("success",e,c,d),this.emit("complete",e);return this.options.uploadMultiple&&(this.emit("successmultiple",a,c,d),this.emit("completemultiple",a)),this.options.autoProcessQueue?this.processQueue():void 0},b.prototype._errorProcessing=function(a,c,d){var e,f,g;for(f=0,g=a.length;g>f;f++)e=a[f],e.status=b.ERROR,this.emit("error",e,c,d),this.emit("complete",e);return this.options.uploadMultiple&&(this.emit("errormultiple",a,c,d),this.emit("completemultiple",a)),this.options.autoProcessQueue?this.processQueue():void 0},b}(d),b.version="3.10.2",b.options={},b.optionsForElement=function(a){return a.getAttribute("id")?b.options[e(a.getAttribute("id"))]:void 0},b.instances=[],b.forElement=function(a){if("string"==typeof a&&(a=document.querySelector(a)),null==(null!=a?a.dropzone:void 0))throw new Error("No Dropzone found for given element. This is probably because you're trying to access it before Dropzone had the time to initialize. Use the `init` option to setup any additional observers on your Dropzone.");return a.dropzone},b.autoDiscover=!0,b.discover=function(){var a,c,d,e,f,g;for(document.querySelectorAll?d=document.querySelectorAll(".dropzone"):(d=[],a=function(a){var b,c,e,f;for(f=[],c=0,e=a.length;e>c;c++)b=a[c],f.push(/(^| )dropzone($| )/.test(b.className)?d.push(b):void 0);return f},a(document.getElementsByTagName("div")),a(document.getElementsByTagName("form"))),g=[],e=0,f=d.length;f>e;e++)c=d[e],g.push(b.optionsForElement(c)!==!1?new b(c):void 0);return g},b.blacklistedBrowsers=[/opera.*Macintosh.*version\/12/i],b.isBrowserSupported=function(){var a,c,d,e,f;if(a=!0,window.File&&window.FileReader&&window.FileList&&window.Blob&&window.FormData&&document.querySelector)if("classList"in document.createElement("a"))for(f=b.blacklistedBrowsers,d=0,e=f.length;e>d;d++)c=f[d],c.test(navigator.userAgent)&&(a=!1);else a=!1;else a=!1;return a},j=function(a,b){var c,d,e,f;for(f=[],d=0,e=a.length;e>d;d++)c=a[d],c!==b&&f.push(c);return f},e=function(a){return a.replace(/[\-_](\w)/g,function(a){return a.charAt(1).toUpperCase()})},b.createElement=function(a){var b;return b=document.createElement("div"),b.innerHTML=a,b.childNodes[0]},b.elementInside=function(a,b){if(a===b)return!0;for(;a=a.parentNode;)if(a===b)return!0;return!1},b.getElement=function(a,b){var c;if("string"==typeof a?c=document.querySelector(a):null!=a.nodeType&&(c=a),null==c)throw new Error("Invalid `"+b+"` option provided. Please provide a CSS selector or a plain HTML element.");return c},b.getElements=function(a,b){var c,d,e,f,g,h,i,j;if(a instanceof Array){e=[];try{for(f=0,h=a.length;h>f;f++)d=a[f],e.push(this.getElement(d,b))}catch(k){c=k,e=null}}else if("string"==typeof a)for(e=[],j=document.querySelectorAll(a),g=0,i=j.length;i>g;g++)d=j[g],e.push(d);else null!=a.nodeType&&(e=[a]);if(null==e||!e.length)throw new Error("Invalid `"+b+"` option provided. Please provide a CSS selector, a plain HTML element or a list of those.");return e},b.confirm=function(a,b,c){return window.confirm(a)?b():null!=c?c():void 0},b.isValidFile=function(a,b){var c,d,e,f,g;if(!b)return!0;for(b=b.split(","),d=a.type,c=d.replace(/\/.*$/,""),f=0,g=b.length;g>f;f++)if(e=b[f],e=e.trim(),"."===e.charAt(0)){if(-1!==a.name.toLowerCase().indexOf(e.toLowerCase(),a.name.length-e.length))return!0}else if(/\/\*$/.test(e)){if(c===e.replace(/\/.*$/,""))return!0}else if(d===e)return!0;return!1},"undefined"!=typeof jQuery&&null!==jQuery&&(jQuery.fn.dropzone=function(a){return this.each(function(){return new b(this,a)})}),"undefined"!=typeof c&&null!==c?c.exports=b:window.Dropzone=b,b.ADDED="added",b.QUEUED="queued",b.ACCEPTED=b.QUEUED,b.UPLOADING="uploading",b.PROCESSING=b.UPLOADING,b.CANCELED="canceled",b.ERROR="error",b.SUCCESS="success",g=function(a){var b,c,d,e,f,g,h,i,j,k;for(h=a.naturalWidth,g=a.naturalHeight,c=document.createElement("canvas"),c.width=1,c.height=g,d=c.getContext("2d"),d.drawImage(a,0,0),e=d.getImageData(0,0,1,g).data,k=0,f=g,i=g;i>k;)b=e[4*(i-1)+3],0===b?f=i:k=i,i=f+k>>1;return j=i/g,0===j?1:j},h=function(a,b,c,d,e,f,h,i,j,k){var l;return l=g(b),a.drawImage(b,c,d,e,f,h,i,j,k/l)},f=function(a,b){var c,d,e,f,g,h,i,j,k;if(e=!1,k=!0,d=a.document,j=d.documentElement,c=d.addEventListener?"addEventListener":"attachEvent",i=d.addEventListener?"removeEventListener":"detachEvent",h=d.addEventListener?"":"on",f=function(c){return"readystatechange"!==c.type||"complete"===d.readyState?(("load"===c.type?a:d)[i](h+c.type,f,!1),!e&&(e=!0)?b.call(a,c.type||c):void 0):void 0},g=function(){var a;try{j.doScroll("left")}catch(b){return a=b,void setTimeout(g,50)}return f("poll")},"complete"!==d.readyState){if(d.createEventObject&&j.doScroll){try{k=!a.frameElement}catch(l){}k&&g()}return d[c](h+"DOMContentLoaded",f,!1),d[c](h+"readystatechange",f,!1),a[c](h+"load",f,!1)}},b._autoDiscoverFunction=function(){return b.autoDiscover?b.discover():void 0},f(window,b._autoDiscoverFunction)}).call(this)}),"object"==typeof exports?module.exports=a("dropzone"):"function"==typeof define&&define.amd?define([],function(){return a("dropzone")}):this.Dropzone=a("dropzone")}();;(function(a){var b=new Array;var c=new Array;a.fn.doAutosize=function(b){var c=a(this).data("minwidth"),d=a(this).data("maxwidth"),e="",f=a(this),g=a("#"+a(this).data("tester_id"));if(e===(e=f.val())){return}var h=e.replace(/&/g,"&").replace(/\s/g," ").replace(//g,">");g.html(h);var i=g.width(),j=i+b.comfortZone>=c?i+b.comfortZone:c,k=f.width(),l=j=c||j>c&&j").css({position:"absolute",top:-9999,left:-9999,width:"auto",fontSize:f.css("fontSize"),fontFamily:f.css("fontFamily"),fontWeight:f.css("fontWeight"),letterSpacing:f.css("letterSpacing"),whiteSpace:"nowrap"}),h=a(this).attr("id")+"_autosize_tester";if(!a("#"+h).length>0){g.attr("id",h);g.appendTo("body")}f.data("minwidth",c);f.data("maxwidth",d);f.data("tester_id",h);f.css("width",c)};a.fn.addTag=function(d,e){e=jQuery.extend({focus:false,callback:true},e);this.each(function(){var f=a(this).attr("id");var g=a(this).val().split(b[f]);if(g[0]==""){g=new Array}d=jQuery.trim(d);if(e.unique){var h=a(g).tagExist(d);if(h==true){a("#"+f+"_tag").addClass("not_valid")}}else{var h=false}if(d!=""&&h!=true){a("").addClass("tag").append(a("").text(d).append(" "),a("",{href:"#",title:"Removing tag",text:"x"}).click(function(){return a("#"+f).removeTag(escape(d))})).insertBefore("#"+f+"_addTag");g.push(d);a("#"+f+"_tag").val("");if(e.focus){a("#"+f+"_tag").focus()}else{a("#"+f+"_tag").blur()}a.fn.tagsInput.updateTagsField(this,g);if(e.callback&&c[f]&&c[f]["onAddTag"]){var i=c[f]["onAddTag"];i.call(this,d)}if(c[f]&&c[f]["onChange"]){var j=g.length;var i=c[f]["onChange"];i.call(this,a(this),g[j-1])}}});return false};a.fn.removeTag=function(d){d=unescape(d);this.each(function(){var e=a(this).attr("id");var f=a(this).val().split(b[e]);a("#"+e+"_tagsinput .tag").remove();str="";for(i=0;i=0};a.fn.importTags=function(b){id=a(this).attr("id");a("#"+id+"_tagsinput .tag").remove();a.fn.tagsInput.importTags(this,b)};a.fn.tagsInput=function(d){var e=jQuery.extend({interactive:true,defaultText:"add a tag",minChars:0,width:"300px",height:"100px",autocomplete:{selectFirst:false},hide:true,delimiter:",",unique:true,removeWithBackspace:true,placeholderColor:"#666666",autosize:true,comfortZone:20,inputPadding:6*2},d);this.each(function(){if(e.hide){a(this).hide()}var d=a(this).attr("id");var f=jQuery.extend({pid:d,real_input:"#"+d,holder:"#"+d+"_tagsinput",input_wrapper:"#"+d+"_addTag",fake_input:"#"+d+"_tag"},e);b[d]=f.delimiter;if(e.onAddTag||e.onRemoveTag||e.onChange){c[d]=new Array;c[d]["onAddTag"]=e.onAddTag;c[d]["onRemoveTag"]=e.onRemoveTag;c[d]["onChange"]=e.onChange}var g='t;t++)if(t in this&&this[t]===e)return t;return-1};b={catchupTime:500,initialRate:.03,minTime:500,ghostTime:500,maxProgressPerFrame:10,easeFactor:1.25,startOnPageLoad:!0,restartOnPushState:!0,restartOnRequestAfter:500,target:"body",elements:{checkInterval:100,selectors:["body"]},eventLag:{minSamples:10,sampleCount:3,lagThreshold:3},ajax:{trackMethods:["GET"],trackWebSockets:!1}},_=function(){var e;return null!=(e="undefined"!=typeof performance&&null!==performance?"function"==typeof performance.now?performance.now():void 0:void 0)?e:+new Date},M=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame,v=window.cancelAnimationFrame||window.mozCancelAnimationFrame,null==M&&(M=function(e){return setTimeout(e,50)},v=function(e){return clearTimeout(e)}),N=function(e){var t,n;return t=_(),n=function(){var r;return r=_()-t,r>=33?(t=_(),e(r,function(){return M(n)})):setTimeout(n,33-r)},n()},D=function(){var e,t,n;return n=arguments[0],t=arguments[1],e=arguments.length>=3?W.call(arguments,2):[],"function"==typeof n[t]?n[t].apply(n,e):n[t]},y=function(){var e,t,n,r,i,o,a;for(t=arguments[0],r=arguments.length>=2?W.call(arguments,1):[],o=0,a=r.length;a>o;o++)if(n=r[o])for(e in n)B.call(n,e)&&(i=n[e],null!=t[e]&&"object"==typeof t[e]&&null!=i&&"object"==typeof i?y(t[e],i):t[e]=i);return t},f=function(e){var t,n,r,i,o;for(n=t=0,i=0,o=e.length;o>i;i++)r=e[i],n+=Math.abs(r),t++;return n/t},w=function(e,t){var n,r,i;if(null==e&&(e="options"),null==t&&(t=!0),i=document.querySelector("[data-pace-"+e+"]")){if(n=i.getAttribute("data-pace-"+e),!t)return n;try{return JSON.parse(n)}catch(o){return r=o,"undefined"!=typeof console&&null!==console?console.error("Error parsing inline pace options",r):void 0}}},null==window.Pace&&(window.Pace={}),T=Pace.options=y(b,window.paceOptions,w()),s=function(e){function t(){return j=t.__super__.constructor.apply(this,arguments)}return q(t,e),t}(Error),t=function(){function e(){this.progress=0}return e.prototype.getElement=function(){var e;if(null==this.el){if(e=document.querySelector(T.target),!e)throw new s;this.el=document.createElement("div"),this.el.className="pace pace-active",document.body.className=document.body.className.replace("pace-done",""),document.body.className+=" pace-running",this.el.innerHTML='\n \n\n',null!=e.firstChild?e.insertBefore(this.el,e.firstChild):e.appendChild(this.el)}return this.el},e.prototype.finish=function(){var e;return e=this.getElement(),e.className=e.className.replace("pace-active",""),e.className+=" pace-inactive",document.body.className=document.body.className.replace("pace-running",""),document.body.className+=" pace-done"},e.prototype.update=function(e){return this.progress=e,this.render()},e.prototype.destroy=function(){try{this.getElement().parentNode.removeChild(this.getElement())}catch(e){s=e}return this.el=void 0},e.prototype.render=function(){var e,t;return null==document.querySelector(T.target)?!1:(e=this.getElement(),e.children[0].style.width=""+this.progress+"%",(!this.lastRenderedProgress||0|(this.lastRenderedProgress|0!==this.progress))&&(e.children[0].setAttribute("data-progress-text",""+(0|this.progress)+"%"),this.progress>=100?t="99":(t=10>this.progress?"0":"",t+=0|this.progress),e.children[0].setAttribute("data-progress",""+t)),this.lastRenderedProgress=this.progress)},e.prototype.done=function(){return this.progress>=100},e}(),a=function(){function e(){this.bindings={}}return e.prototype.trigger=function(e,t){var n,r,i,o,a;if(null!=this.bindings[e]){for(o=this.bindings[e],a=[],r=0,i=o.length;i>r;r++)n=o[r],a.push(n.call(this,t));return a}},e.prototype.on=function(e,t){var n;return null==(n=this.bindings)[e]&&(n[e]=[]),this.bindings[e].push(t)},e}(),I=window.XMLHttpRequest,z=window.XDomainRequest,O=window.WebSocket,x=function(e,t){var n,r,i,o;o=[];for(r in t.prototype)try{i=t.prototype[r],null==e[r]&&"function"!=typeof i?o.push(e[r]=i):o.push(void 0)}catch(a){n=a}return o},k=[],Pace.ignore=function(){var e,t,n;return t=arguments[0],e=arguments.length>=2?W.call(arguments,1):[],k.unshift("ignore"),n=t.apply(null,e),k.shift(),n},Pace.track=function(){var e,t,n;return t=arguments[0],e=arguments.length>=2?W.call(arguments,1):[],k.unshift("track"),n=t.apply(null,e),k.shift(),n},E=function(e){var t;if(null==e&&(e="GET"),"track"===k[0])return"force";if(!k.length&&T.ajax){if("socket"===e&&T.ajax.trackWebSockets)return!0;if(t=e.toUpperCase(),U.call(T.ajax.trackMethods,t)>=0)return!0}return!1},l=function(e){function t(){var e,n=this;t.__super__.constructor.apply(this,arguments),e=function(e){var t;return t=e.open,e.open=function(r,i){return E(r)&&n.trigger("request",{type:r,url:i,request:e}),t.apply(e,arguments)}},window.XMLHttpRequest=function(t){var n;return n=new I(t),e(n),n},x(window.XMLHttpRequest,I),null!=z&&(window.XDomainRequest=function(){var t;return t=new z,e(t),t},x(window.XDomainRequest,z)),null!=O&&T.ajax.trackWebSockets&&(window.WebSocket=function(e,t){var r;return r=new O(e,t),E("socket")&&n.trigger("request",{type:"socket",url:e,protocols:t,request:r}),r},x(window.WebSocket,O))}return q(t,e),t}(a),H=null,C=function(){return null==H&&(H=new l),H},C().on("request",function(t){var n,r,i,o;return o=t.type,i=t.request,Pace.running||T.restartOnRequestAfter===!1&&"force"!==E(o)?void 0:(r=arguments,n=T.restartOnRequestAfter||0,"boolean"==typeof n&&(n=0),setTimeout(function(){var t,n,a,s,l,c,u;if(n="socket"===o?2>i.readyState:(l=i.readyState)>0&&4>l){for(Pace.restart(),c=Pace.sources,u=[],a=0,s=c.length;s>a;a++){if(t=c[a],t instanceof e){t.watch.apply(t,r);break}u.push(void 0)}return u}},n))}),e=function(){function e(){var e=this;this.elements=[],C().on("request",function(){return e.watch.apply(e,arguments)})}return e.prototype.watch=function(e){var t,n,r;return r=e.type,t=e.request,n="socket"===r?new d(t):new h(t),this.elements.push(n)},e}(),h=function(){function e(e){var t,n,r,i,o,a,s=this;if(this.progress=0,null!=window.ProgressEvent)for(n=null,e.addEventListener("progress",function(e){return s.progress=e.lengthComputable?100*e.loaded/e.total:s.progress+(100-s.progress)/2}),a=["load","abort","timeout","error"],r=0,i=a.length;i>r;r++)t=a[r],e.addEventListener(t,function(){return s.progress=100});else o=e.onreadystatechange,e.onreadystatechange=function(){var t;return 0===(t=e.readyState)||4===t?s.progress=100:3===e.readyState&&(s.progress=50),"function"==typeof o?o.apply(null,arguments):void 0}}return e}(),d=function(){function e(e){var t,n,r,i,o=this;for(this.progress=0,i=["error","open"],n=0,r=i.length;r>n;n++)t=i[n],e.addEventListener(t,function(){return o.progress=100})}return e}(),r=function(){function e(e){var t,n,r,o;for(null==e&&(e={}),this.elements=[],null==e.selectors&&(e.selectors=[]),o=e.selectors,n=0,r=o.length;r>n;n++)t=o[n],this.elements.push(new i(t))}return e}(),i=function(){function e(e){this.selector=e,this.progress=0,this.check()}return e.prototype.check=function(){var e=this;return document.querySelector(this.selector)?this.done():setTimeout(function(){return e.check()},T.elements.checkInterval)},e.prototype.done=function(){return this.progress=100},e}(),n=function(){function e(){var e,t,n=this;this.progress=null!=(t=this.states[document.readyState])?t:100,e=document.onreadystatechange,document.onreadystatechange=function(){return null!=n.states[document.readyState]&&(n.progress=n.states[document.readyState]),"function"==typeof e?e.apply(null,arguments):void 0}}return e.prototype.states={loading:0,interactive:50,complete:100},e}(),o=function(){function e(){var e,t,n,r,i,o=this;this.progress=0,e=0,i=[],r=0,n=_(),t=setInterval(function(){var a;return a=_()-n-50,n=_(),i.push(a),i.length>T.eventLag.sampleCount&&i.shift(),e=f(i),++r>=T.eventLag.minSamples&&T.eventLag.lagThreshold>e?(o.progress=100,clearInterval(t)):o.progress=100*(3/(e+3))},50)}return e}(),u=function(){function e(e){this.source=e,this.last=this.sinceLastUpdate=0,this.rate=T.initialRate,this.catchup=0,this.progress=this.lastProgress=0,null!=this.source&&(this.progress=D(this.source,"progress"))}return e.prototype.tick=function(e,t){var n;return null==t&&(t=D(this.source,"progress")),t>=100&&(this.done=!0),t===this.last?this.sinceLastUpdate+=e:(this.sinceLastUpdate&&(this.rate=(t-this.last)/this.sinceLastUpdate),this.catchup=(t-this.progress)/T.catchupTime,this.sinceLastUpdate=0,this.last=t),t>this.progress&&(this.progress+=this.catchup*e),n=1-Math.pow(this.progress/100,T.easeFactor),this.progress+=n*this.rate*e,this.progress=Math.min(this.lastProgress+T.maxProgressPerFrame,this.progress),this.progress=Math.max(0,this.progress),this.progress=Math.min(100,this.progress),this.lastProgress=this.progress,this.progress},e}(),A=null,L=null,g=null,F=null,p=null,m=null,Pace.running=!1,S=function(){return T.restartOnPushState?Pace.restart():void 0},null!=window.history.pushState&&(R=window.history.pushState,window.history.pushState=function(){return S(),R.apply(window.history,arguments)}),null!=window.history.replaceState&&(P=window.history.replaceState,window.history.replaceState=function(){return S(),P.apply(window.history,arguments)}),c={ajax:e,elements:r,document:n,eventLag:o},($=function(){var e,n,r,i,o,a,s,l,d;for(Pace.sources=A=[],s=["ajax","elements","document","eventLag"],r=0,o=s.length;o>r;r++)n=s[r],T[n]!==!1&&A.push(new c[n](T[n]));for(d=null!=(l=T.extraSources)?l:[],i=0,a=d.length;a>i;i++)e=d[i],A.push(new e(T));return Pace.bar=g=new t,L=[],F=new u})(),Pace.stop=function(){return Pace.running=!1,g.destroy(),m=!0,null!=p&&("function"==typeof v&&v(p),p=null),$()},Pace.restart=function(){return Pace.stop(),Pace.start()},Pace.go=function(){return Pace.running=!0,g.render(),m=!1,p=N(function(e,t){var n,r,i,o,a,s,l,c,d,h,p,f,v,b,y,x,w,C;for(c=100-g.progress,r=v=0,i=!0,s=b=0,x=A.length;x>b;s=++b)for(p=A[s],h=null!=L[s]?L[s]:L[s]=[],a=null!=(C=p.elements)?C:[p],l=y=0,w=a.length;w>y;l=++y)o=a[l],d=null!=h[l]?h[l]:h[l]=new u(o),i&=d.done,d.done||(r++,v+=d.tick(e));return n=v/r,g.update(F.tick(e,n)),f=_(),g.done()||i||m?(g.update(100),setTimeout(function(){return g.finish(),Pace.running=!1},Math.max(T.ghostTime,Math.min(T.minTime,_()-f)))):t()})},Pace.start=function(e){y(T,e),Pace.running=!0;try{g.render()}catch(t){s=t}return document.querySelector(".pace")?Pace.go():setTimeout(Pace.start,50)},"function"==typeof define&&define.amd?define(function(){return Pace}):"object"==typeof exports?module.exports=Pace:T.startOnPageLoad&&Pace.start()}).call(this),function(){(function(e,t){var n,r,i;return i="shapeshift",r={selector:"*",enableDrag:!0,enableCrossDrop:!0,enableResize:!0,enableTrash:!1,align:"center",colWidth:null,columns:null,minColumns:1,autoHeight:!0,maxHeight:null,minHeight:100,gutterX:10,gutterY:10,paddingX:10,paddingY:10,animated:!0,animateOnInit:!1,animationSpeed:225,animationThreshold:100,dragClone:!1,deleteClone:!0,dragRate:100,dragWhitelist:"*",crossDropWhitelist:"*",cutoffStart:null,cutoffEnd:null,handle:!1,cloneClass:"ss-cloned-child",activeClass:"ss-active-child",draggedClass:"ss-dragged-child",placeholderClass:"ss-placeholder-child",originalContainerClass:"ss-original-container",currentContainerClass:"ss-current-container",previousContainerClass:"ss-previous-container"},n=function(){function n(t,n){this.element=t,this.options=e.extend({},r,n),this.globals={},this.$container=e(t),this.errorCheck()&&this.init()}return n.prototype.errorCheck=function(){var e,t,n,r;return r=this.options,n=!1,t="Shapeshift ERROR:",null===r.colWidth&&(e=this.$container.children(r.selector),0===e.length&&(n=!0,console.error(""+t+" option colWidth must be specified if Shapeshift is initialized with no active children."))),!n},n.prototype.init=function(){return this.createEvents(),this.setGlobals(),this.setIdentifier(),this.setActiveChildren(),this.enableFeatures(),this.gridInit(),this.render(),this.afterInit()},n.prototype.createEvents=function(){var e,t,n=this;return t=this.options,e=this.$container,e.off("ss-arrange").on("ss-arrange",function(e,t){return null==t&&(t=!1),n.render(!1,t)}),e.off("ss-rearrange").on("ss-rearrange",function(){return n.render(!0)}),e.off("ss-setTargetPosition").on("ss-setTargetPosition",function(){return n.setTargetPosition()}),e.off("ss-destroy").on("ss-destroy",function(){return n.destroy()})},n.prototype.setGlobals=function(){return this.globals.animated=this.options.animateOnInit},n.prototype.afterInit=function(){return this.globals.animated=this.options.animated},n.prototype.setIdentifier=function(){return this.identifier="shapeshifted_container_"+Math.random().toString(36).substring(7),this.$container.addClass(this.identifier)},n.prototype.enableFeatures=function(){return this.options.enableResize&&this.enableResize(),this.options.enableDrag||this.options.enableCrossDrop?this.enableDragNDrop():void 0},n.prototype.setActiveChildren=function(){var t,n,r,i,o,a,s,l,c,u,d,h;for(s=this.options,t=this.$container.children(s.selector),n=s.activeClass,l=t.length,o=c=0;l>=0?l>c:c>l;o=l>=0?++c:--c)e(t[o]).addClass(n);for(this.setParsedChildren(),i=s.columns,h=[],o=u=0,d=this.parsedChildren.length;d>=0?d>u:u>d;o=d>=0?++u:--u)r=this.parsedChildren[o].colspan,a=s.minColumns,r>i&&r>a?(s.minColumns=r,h.push(console.error("Shapeshift ERROR: There are child elements that have a larger colspan than the minimum columns set through options.\noptions.minColumns has been set to "+r))):h.push(void 0);return h},n.prototype.setParsedChildren=function(){var t,n,r,i,o,a,s;for(n=this.$container.find("."+this.options.activeClass).filter(":visible"),a=n.length,o=[],i=s=0;a>=0?a>s:s>a;i=a>=0?++s:--s)t=e(n[i]),r={i:i,el:t,colspan:parseInt(t.attr("data-ss-colspan"))||1,height:t.outerHeight()},o.push(r);return this.parsedChildren=o},n.prototype.gridInit=function(){var e,t,n,r,i;return r=this.options.gutterX,this.options.colWidth>=1?this.globals.col_width=this.options.colWidth+r:(n=this.parsedChildren[0],t=n.el.outerWidth(),e=n.colspan,i=(t-(e-1)*r)/e,this.globals.col_width=i+r)},n.prototype.render=function(e,t){return null==e&&(e=!1),this.setGridColumns(),this.arrange(e,t)},n.prototype.setGridColumns=function(){var e,t,n,r,i,o,a,s,l,c;switch(r=this.globals,l=this.options,t=r.col_width,o=l.gutterX,c=l.paddingX,a=this.$container.innerWidth()-2*c,s=l.minColumns,n=l.columns||Math.floor((a+o)/t),s&&s>n&&(n=s),r.columns=n,e=this.parsedChildren.length,n>e&&(n=e),r.child_offset=c,l.align){case"center":return i=n*t-o,r.child_offset+=(a-i)/2;case"right":return i=n*t-o,r.child_offset+=a-i}},n.prototype.arrange=function(e,t){var n,r,i,o,a,s,l,c,u,d,h,p,f,g,m,v,b,y;for(e&&this.setParsedChildren(),u=this.globals,g=this.options,r=this.$container,s=this.getPositions(),m=this.parsedChildren,b=m.length,i=u.animated&&g.animationThreshold>=b,o=g.animationSpeed,c=g.draggedClass,d=y=0;b>=0?b>y:y>b;d=b>=0?++y:--y)n=m[d].el,a=s[d],h=n.hasClass(c),h&&(v=g.placeholderClass,n=n.siblings("."+v)),i&&!h?n.stop(!0,!1).animate(a,o,function(){}):n.css(a);return t&&(i?setTimeout(function(){return r.trigger("ss-drop-complete")},o):r.trigger("ss-drop-complete")),r.trigger("ss-arranged"),g.autoHeight?(l=u.container_height,p=g.maxHeight,f=g.minHeight,f&&f>l?l=f:p&&l>p&&(l=p),r.height(l)):void 0},n.prototype.getPositions=function(e){var t,n,r,i,o,a,s,l,c,u,d,h,p,f,g,m,v,b,y=this;for(null==e&&(e=!0),o=this.globals,c=this.options,s=c.gutterY,u=c.paddingY,i=c.draggedClass,d=this.parsedChildren,m=d.length,t=[],l=v=0,b=o.columns;b>=0?b>v:v>b;l=b>=0?++v:--v)t.push(u);return f=function(e){var n,r,i,a,l,c,u;if(n=e.col,r=e.colspan,a=e.col*o.col_width+o.child_offset,l=t[n],h[e.i]={left:a,top:l},t[n]+=e.height+s,r>=1){for(u=[],i=c=1;r>=1?r>c:c>r;i=r>=1?++c:--c)u.push(t[n+i]=t[n]);return u}},n=function(e){var n,r,i,o,a,s,l,c,u,d,h,p;for(u=t.length-e.colspan+1,c=t.slice(0).splice(0,u),n=void 0,l=h=0;u>=0?u>h:h>u;l=u>=0?++h:--h){for(r=y.lowestCol(c,l),i=e.colspan,o=t[r],a=!0,d=p=1;i>=1?i>p:p>i;d=i>=1?++p:--p)if(s=t[r+d],s>o){a=!1;break}if(a){n=r;break}}return n},g=[],p=function(){var e,t,r,i,o,a,s,l,c,u;for(o=[],i=a=0,l=g.length;l>=0?l>a:a>l;i=l>=0?++a:--a)r=g[i],r.col=n(r),r.col>=0&&(f(r),o.push(i));for(u=[],t=s=c=o.length-1;s>=0;t=s+=-1)e=o[t],u.push(g.splice(e,1));return u},h=[],(r=function(){var r,o,a;for(a=[],l=o=0;m>=0?m>o:o>m;l=m>=0?++o:--o)r=d[l],e||!r.el.hasClass(i)?(r.col=r.colspan>1?n(r):y.lowestCol(t),void 0===r.col?g.push(r):f(r),a.push(p())):a.push(void 0);return a})(),c.autoHeight&&(a=t[this.highestCol(t)]-s,o.container_height=a+u),h},n.prototype.enableDragNDrop=function(){var n,r,i,o,a,s,l,c,u,d,h,p,f,g,m,v,b,y,x=this;return f=this.options,r=this.$container,a=f.activeClass,h=f.draggedClass,m=f.placeholderClass,g=f.originalContainerClass,l=f.currentContainerClass,v=f.previousContainerClass,c=f.deleteClone,d=f.dragRate,u=f.dragClone,s=f.cloneClass,o=i=n=y=b=null,p=!1,f.enableDrag&&r.children("."+a).filter(f.dragWhitelist).draggable({addClasses:!1,containment:"document",handle:f.handle,zIndex:9999,start:function(t){var r;return o=e(t.target),u&&(n=o.clone(!0).insertBefore(o).addClass(s)),o.addClass(h),r=o.prop("tagName"),i=e("<"+r+" class='"+m+"' style='height: "+o.height()+"px; width: "+o.width()+"'>"+r+">"),o.parent().addClass(g).addClass(l),y=o.outerHeight()/2,b=o.outerWidth()/2},drag:function(n,r){return p||u&&c&&e("."+l)[0]===e("."+g)[0]||(i.remove().appendTo("."+l),e("."+l).trigger("ss-setTargetPosition"),p=!0,t.setTimeout(function(){return p=!1},d)),r.position.left=n.pageX-o.parent().offset().left-b,r.position.top=n.pageY-o.parent().offset().top-y},stop:function(){var t,r,a;return r=e("."+g),t=e("."+l),a=e("."+v),o.removeClass(h),e("."+m).remove(),u&&(c&&e("."+l)[0]===e("."+g)[0]?(n.remove(),e("."+l).trigger("ss-rearrange")):n.removeClass(s)),r[0]===t[0]?t.trigger("ss-rearranged",o):(r.trigger("ss-removed",o),t.trigger("ss-added",o)),r.trigger("ss-arrange").removeClass(g),t.trigger("ss-arrange",!0).removeClass(l),a.trigger("ss-arrange").removeClass(v),o=i=null}}),f.enableCrossDrop?r.droppable({accept:f.crossDropWhitelist,tolerance:"intersect",over:function(t){return e("."+v).removeClass(v),e("."+l).removeClass(l).addClass(v),e(t.target).addClass(l)},drop:function(t,n){var r,i,a;return x.options.enableTrash?(i=e("."+g),r=e("."+l),a=e("."+v),o=e(n.helper),r.trigger("ss-trashed",o),o.remove(),i.trigger("ss-rearrange").removeClass(g),r.trigger("ss-rearrange").removeClass(l),a.trigger("ss-arrange").removeClass(v)):void 0}}):void 0},n.prototype.setTargetPosition=function(){var t,n,r,i,o,a,s,l,c,u,d,h,p,f,g,m,v,b,y,x,w,C;if(u=this.options,u.enableTrash)return h=this.options.placeholderClass,e("."+h).remove();if(c=u.draggedClass,t=e("."+c),n=t.parent(),d=this.parsedChildren,o=this.getPositions(!1),y=o.length,g=t.offset().left-n.offset().left+this.globals.col_width/2,m=t.offset().top-n.offset().top+t.height()/2,v=9999999,b=0,y>1){for(s=u.cutoffStart+1||0,a=u.cutoffEnd||y,p=C=s;a>=s?a>C:C>a;p=a>=s?++C:--C)i=o[p],i&&(w=g-i.left,x=m-i.top,w>0&&x>0&&(l=Math.sqrt(x*x+w*w),v>l&&(v=l,b=p,p===y-1&&w>d[p].height/2&&b++)));b===d.length?(r=d[b-1].el,t.insertAfter(r)):(r=d[b].el,t.insertBefore(r))}else 1===y?(i=o[0],g>i.left?this.$container.append(t):this.$container.prepend(t)):this.$container.append(t);return this.arrange(!0),n[0]!==t.parent()[0]?(f=u.previousContainerClass,e("."+f).trigger("ss-rearrange")):void 0},n.prototype.enableResize=function(){var n,r,i,o=this;return n=this.options.animationSpeed,i=!1,r="resize."+this.identifier,e(t).on(r,function(){return i?void 0:(i=!0,setTimeout(function(){return o.render()},n/3),setTimeout(function(){return o.render()},n/3),setTimeout(function(){return i=!1,o.render()},n/3))})},n.prototype.lowestCol=function(e,t){var n;return null==t&&(t=0),n=e.map(function(e,t){return[e,t]}),n.sort(function(e,t){var n;return n=e[0]-t[0],0===n&&(n=e[1]-t[1]),n}),n[t][1]},n.prototype.highestCol=function(n){return e.inArray(Math.max.apply(t,n),n)},n.prototype.destroy=function(){var e,t,n;return t=this.$container,t.off("ss-arrange"),t.off("ss-rearrange"),t.off("ss-setTargetPosition"),t.off("ss-destroy"),n=this.options.activeClass,e=t.find("."+n),this.options.enableDrag&&e.draggable("destroy"),this.options.enableCrossDrop&&t.droppable("destroy"),e.removeClass(n),t.removeClass(this.identifier)},n}(),e.fn[i]=function(r){return this.each(function(){var o,a,s;return a=null!=(s=e(this).attr("class").match(/shapeshifted_container_\w+/))?s[0]:void 0,a&&(o="resize."+a,e(t).off(o),e(this).removeClass(a)),e.data(this,"plugin_"+i,new n(this,r))})}})(jQuery,window,document)}.call(this),function(e,t,n){"use strict";var r,i,o,a,s,l,c,u,d,h,p,f,g,m,v,b,y,x,w,C,S,k,$,_,T,M,D,N,L;S={paneClass:"nano-pane",sliderClass:"nano-slider",contentClass:"nano-content",iOSNativeScrolling:!1,preventPageScrolling:!1,disableResize:!1,alwaysVisible:!1,flashDelay:1500,sliderMinHeight:20,sliderMaxHeight:null,documentContext:null,windowContext:null},b="scrollbar",v="scroll",u="mousedown",d="mousemove",p="mousewheel",h="mouseup",m="resize",s="drag",x="up",g="panedown",o="DOMMouseScroll",a="down",w="wheel",l="keydown",c="keyup",y="touchmove",r="Microsoft Internet Explorer"===t.navigator.appName&&/msie 7./i.test(t.navigator.appVersion)&&t.ActiveXObject,i=null,T=t.requestAnimationFrame,C=t.cancelAnimationFrame,D=n.createElement("div").style,L=function(){var e,t,n,r,i,o;for(r=["t","webkitT","MozT","msT","OT"],e=i=0,o=r.length;o>i;e=++i)if(n=r[e],t=r[e]+"ransform",t in D)return r[e].substr(0,r[e].length-1);return!1}(),N=function(e){return L===!1?!1:""===L?e:L+e.charAt(0).toUpperCase()+e.substr(1)},M=N("transform"),$=M!==!1,k=function(){var e,t,r;return e=n.createElement("div"),t=e.style,t.position="absolute",t.width="100px",t.height="100px",t.overflow=v,t.top="-9999px",n.body.appendChild(e),r=e.offsetWidth-e.clientWidth,n.body.removeChild(e),r},_=function(){var e,n,r;return n=t.navigator.userAgent,(e=/(?=.+Mac OS X)(?=.+Firefox)/.test(n))?(r=/Firefox\/\d{2}\./.exec(n),r&&(r=r[0].replace(/\D+/g,"")),e&&+r>23):!1},f=function(){function l(r,o){this.el=r,this.options=o,i||(i=k()),this.$el=e(this.el),this.doc=e(this.options.documentContext||n),this.win=e(this.options.windowContext||t),this.$content=this.$el.children("."+o.contentClass),this.$content.attr("tabindex",this.options.tabIndex||0),this.content=this.$content[0],this.options.iOSNativeScrolling&&null!=this.el.style.WebkitOverflowScrolling?this.nativeScrolling():this.generate(),this.createEvents(),this.addEvents(),this.reset()}return l.prototype.preventScrolling=function(e,t){if(this.isActive)if(e.type===o)(t===a&&e.originalEvent.detail>0||t===x&&0>e.originalEvent.detail)&&e.preventDefault();else if(e.type===p){if(!e.originalEvent||!e.originalEvent.wheelDelta)return;(t===a&&0>e.originalEvent.wheelDelta||t===x&&e.originalEvent.wheelDelta>0)&&e.preventDefault()}},l.prototype.nativeScrolling=function(){this.$content.css({WebkitOverflowScrolling:"touch"}),this.iOSNativeScrolling=!0,this.isActive=!0},l.prototype.updateScrollValues=function(){var e;e=this.content,this.maxScrollTop=e.scrollHeight-e.clientHeight,this.prevScrollTop=this.contentScrollTop||0,this.contentScrollTop=e.scrollTop,this.iOSNativeScrolling||(this.maxSliderTop=this.paneHeight-this.sliderHeight,this.sliderTop=0===this.maxScrollTop?0:this.contentScrollTop*this.maxSliderTop/this.maxScrollTop)},l.prototype.setOnScrollStyles=function(){var e;$?(e={},e[M]="translate(0, "+this.sliderTop+"px)"):e={top:this.sliderTop},T?this.scrollRAF||(this.scrollRAF=T(function(t){return function(){t.scrollRAF=null,t.slider.css(e)}}(this))):this.slider.css(e)},l.prototype.createEvents=function(){this.events={down:function(e){return function(t){return e.isBeingDragged=!0,e.offsetY=t.pageY-e.slider.offset().top,e.pane.addClass("active"),e.doc.bind(d,e.events[s]).bind(h,e.events[x]),!1}}(this),drag:function(e){return function(t){return e.sliderY=t.pageY-e.$el.offset().top-e.offsetY,e.scroll(),e.contentScrollTop>=e.maxScrollTop&&e.prevScrollTop!==e.maxScrollTop?e.$el.trigger("scrollend"):0===e.contentScrollTop&&0!==e.prevScrollTop&&e.$el.trigger("scrolltop"),!1}}(this),up:function(e){return function(){return e.isBeingDragged=!1,e.pane.removeClass("active"),e.doc.unbind(d,e.events[s]).unbind(h,e.events[x]),!1}}(this),resize:function(e){return function(){e.reset()}}(this),panedown:function(e){return function(t){return e.sliderY=(t.offsetY||t.originalEvent.layerY)-.5*e.sliderHeight,e.scroll(),e.events.down(t),!1}}(this),scroll:function(e){return function(t){e.updateScrollValues(),e.isBeingDragged||(e.iOSNativeScrolling||(e.sliderY=e.sliderTop,e.setOnScrollStyles()),null!=t&&(e.contentScrollTop>=e.maxScrollTop?(e.options.preventPageScrolling&&e.preventScrolling(t,a),e.prevScrollTop!==e.maxScrollTop&&e.$el.trigger("scrollend")):0===e.contentScrollTop&&(e.options.preventPageScrolling&&e.preventScrolling(t,x),0!==e.prevScrollTop&&e.$el.trigger("scrolltop"))))}}(this),wheel:function(e){return function(t){var n;if(null!=t)return n=t.delta||t.wheelDelta||t.originalEvent&&t.originalEvent.wheelDelta||-t.detail||t.originalEvent&&-t.originalEvent.detail,n&&(e.sliderY+=-n/3),e.scroll(),!1}}(this)}},l.prototype.addEvents=function(){var e;this.removeEvents(),e=this.events,this.options.disableResize||this.win.bind(m,e[m]),this.iOSNativeScrolling||(this.slider.bind(u,e[a]),this.pane.bind(u,e[g]).bind(""+p+" "+o,e[w])),this.$content.bind(""+v+" "+p+" "+o+" "+y,e[v])},l.prototype.removeEvents=function(){var e;e=this.events,this.win.unbind(m,e[m]),this.iOSNativeScrolling||(this.slider.unbind(),this.pane.unbind()),this.$content.unbind(""+v+" "+p+" "+o+" "+y,e[v])},l.prototype.generate=function(){var e,n,r,o,a,s;return o=this.options,a=o.paneClass,s=o.sliderClass,e=o.contentClass,this.$el.find("."+a).length||this.$el.find("."+s).length||this.$el.append(''),this.pane=this.$el.children("."+a),this.slider=this.pane.find("."+s),0===i&&_()?(r=t.getComputedStyle(this.content,null).getPropertyValue("padding-right").replace(/\D+/g,""),n={right:-14,paddingRight:+r+14}):i&&(n={right:-i},this.$el.addClass("has-scrollbar")),null!=n&&this.$content.css(n),this},l.prototype.restore=function(){this.stopped=!1,this.iOSNativeScrolling||this.pane.show(),this.addEvents()},l.prototype.reset=function(){var e,t,n,o,a,s,l,c,u,d,h,p;return this.iOSNativeScrolling?(this.contentHeight=this.content.scrollHeight,void 0):(this.$el.find("."+this.options.paneClass).length||this.generate().stop(),this.stopped&&this.restore(),e=this.content,o=e.style,a=o.overflowY,r&&this.$content.css({height:this.$content.height()}),t=e.scrollHeight+i,d=parseInt(this.$el.css("max-height"),10),d>0&&(this.$el.height(""),this.$el.height(e.scrollHeight>d?d:e.scrollHeight)),l=this.pane.outerHeight(!1),u=parseInt(this.pane.css("top"),10),s=parseInt(this.pane.css("bottom"),10),c=l+u+s,p=Math.round(c/t*c),this.options.sliderMinHeight>p?p=this.options.sliderMinHeight:null!=this.options.sliderMaxHeight&&p>this.options.sliderMaxHeight&&(p=this.options.sliderMaxHeight),a===v&&o.overflowX!==v&&(p+=i),this.maxSliderTop=c-p,this.contentHeight=t,this.paneHeight=l,this.paneOuterHeight=c,this.sliderHeight=p,this.slider.height(p),this.events.scroll(),this.pane.show(),this.isActive=!0,e.scrollHeight===e.clientHeight||this.pane.outerHeight(!0)>=e.scrollHeight&&a!==v?(this.pane.hide(),this.isActive=!1):this.el.clientHeight===e.scrollHeight&&a===v?this.slider.hide():this.slider.show(),this.pane.css({opacity:this.options.alwaysVisible?1:"",visibility:this.options.alwaysVisible?"visible":""}),n=this.$content.css("position"),("static"===n||"relative"===n)&&(h=parseInt(this.$content.css("right"),10),h&&this.$content.css({right:"",marginRight:h})),this)},l.prototype.scroll=function(){return this.isActive?(this.sliderY=Math.max(0,this.sliderY),this.sliderY=Math.min(this.maxSliderTop,this.sliderY),this.$content.scrollTop(-1*((this.paneHeight-this.contentHeight+i)*this.sliderY/this.maxSliderTop)),this.iOSNativeScrolling||(this.updateScrollValues(),this.setOnScrollStyles()),this):void 0},l.prototype.scrollBottom=function(e){return this.isActive?(this.$content.scrollTop(this.contentHeight-this.$content.height()-e).trigger(p),this.stop().restore(),this):void 0},l.prototype.scrollTop=function(e){return this.isActive?(this.$content.scrollTop(+e).trigger(p),this.stop().restore(),this):void 0},l.prototype.scrollTo=function(e){return this.isActive?(this.scrollTop(this.$el.find(e).get(0).offsetTop),this):void 0},l.prototype.stop=function(){return C&&this.scrollRAF&&(C(this.scrollRAF),this.scrollRAF=null),this.stopped=!0,this.removeEvents(),this.iOSNativeScrolling||this.pane.hide(),this},l.prototype.destroy=function(){return this.stopped||this.stop(),!this.iOSNativeScrolling&&this.pane.length&&this.pane.remove(),r&&this.$content.height(""),this.$content.removeAttr("tabindex"),this.$el.hasClass("has-scrollbar")&&(this.$el.removeClass("has-scrollbar"),this.$content.css({right:""})),this},l.prototype.flash=function(){return!this.iOSNativeScrolling&&this.isActive?(this.reset(),this.pane.addClass("flashed"),setTimeout(function(e){return function(){e.pane.removeClass("flashed")}}(this),this.options.flashDelay),this):void 0},l}(),e.fn.nanoScroller=function(t){return this.each(function(){var n,r;if((r=this.nanoscroller)||(n=e.extend({},S,t),this.nanoscroller=r=new f(this,n)),t&&"object"==typeof t){if(e.extend(r.options,t),null!=t.scrollBottom)return r.scrollBottom(t.scrollBottom);if(null!=t.scrollTop)return r.scrollTop(t.scrollTop);if(t.scrollTo)return r.scrollTo(t.scrollTo);if("bottom"===t.scroll)return r.scrollBottom(0);if("top"===t.scroll)return r.scrollTop(0);if(t.scroll&&t.scroll instanceof e)return r.scrollTo(t.scroll);if(t.stop)return r.stop();if(t.destroy)return r.destroy();if(t.flash)return r.flash()}return r.reset()})},e.fn.nanoScroller.Constructor=f}(jQuery,window,document),function(e,t){"use strict";var n,r=e.document;n=function(){var n,i,o,a,s,l,c,u,d,h,p,f,g,m={},v={},b=!1,y={ENTER:13,ESC:27,SPACE:32},x=[];return v={buttons:{holder:'',submit:'',ok:'',cancel:''},input:'',message:' ',log:'{{message}} '},g=function(){var e,n,i=!1,o=r.createElement("fakeelement"),a={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"otransitionend",transition:"transitionend"};for(e in a)if(o.style[e]!==t){n=a[e],i=!0;break}return{type:n,supported:i}},n=function(e){return r.getElementById(e)},m={labels:{ok:"OK",cancel:"Cancel"},delay:5e3,buttonReverse:!1,buttonFocus:"ok",transition:t,addListeners:function(e){var n,l,c,u,d,h=o!==t,p=i!==t,g=f!==t,m="",v=this;n=function(n){return n.preventDefault!==t&&n.preventDefault(),c(n),f!==t&&(m=f.value),"function"==typeof e&&(f!==t?e(!0,m):e(!0)),!1},l=function(n){return n.preventDefault!==t&&n.preventDefault(),c(n),"function"==typeof e&&e(!1),!1},c=function(){v.hide(),v.unbind(r.body,"keyup",u),v.unbind(a,"focus",d),h&&v.unbind(o,"click",n),p&&v.unbind(i,"click",l)},u=function(e){var t=e.keyCode;(t===y.SPACE&&!g||g&&t===y.ENTER)&&n(e),t===y.ESC&&p&&l(e)},d=function(){g?f.focus():!p||v.buttonReverse?o.focus():i.focus()},this.bind(a,"focus",d),this.bind(s,"focus",d),h&&this.bind(o,"click",n),p&&this.bind(i,"click",l),this.bind(r.body,"keyup",u),this.transition.supported||this.setFocus()
-},bind:function(e,t,n){"function"==typeof e.addEventListener?e.addEventListener(t,n,!1):e.attachEvent&&e.attachEvent("on"+t,n)},handleErrors:function(){if(e.onerror!==t){var n=this;return e.onerror=function(e,t,r){n.error("["+e+" on line "+r+" of "+t+"]",0)},!0}return!1},appendButtons:function(e,t){return this.buttonReverse?t+e:e+t},build:function(e){var t="",n=e.type,r=e.message,i=e.cssClass||"";switch(t+='',t+='Reset Focus',"none"===m.buttonFocus&&(t+=''),"prompt"===n&&(t+=''),t+='',t+=v.message.replace("{{message}}",r),"prompt"===n&&(t+=v.input),t+=v.buttons.holder,t+=" ","prompt"===n&&(t+=""),t+='Reset Focus',t+="",n){case"confirm":t=t.replace("{{buttons}}",this.appendButtons(v.buttons.cancel,v.buttons.ok)),t=t.replace("{{ok}}",this.labels.ok).replace("{{cancel}}",this.labels.cancel);break;case"prompt":t=t.replace("{{buttons}}",this.appendButtons(v.buttons.cancel,v.buttons.submit)),t=t.replace("{{ok}}",this.labels.ok).replace("{{cancel}}",this.labels.cancel);break;case"alert":t=t.replace("{{buttons}}",v.buttons.ok),t=t.replace("{{ok}}",this.labels.ok);break;default:}return d.className="alertify alertify-"+n+" "+i,u.className="alertify-cover",t},close:function(e,n){var r,i,o=n&&!isNaN(n)?+n:this.delay,a=this;this.bind(e,"click",function(){r(e)}),i=function(e){e.stopPropagation(),a.unbind(this,a.transition.type,i),h.removeChild(this),h.hasChildNodes()||(h.className+=" alertify-logs-hidden")},r=function(e){e!==t&&e.parentNode===h&&(a.transition.supported?(a.bind(e,a.transition.type,i),e.className+=" alertify-log-hide"):(h.removeChild(e),h.hasChildNodes()||(h.className+=" alertify-logs-hidden")))},0!==n&&setTimeout(function(){r(e)},o)},dialog:function(e,n,i,o,a){c=r.activeElement;var s=function(){h&&null!==h.scrollTop&&u&&null!==u.scrollTop||s()};if("string"!=typeof e)throw Error("message must be a string");if("string"!=typeof n)throw Error("type must be a string");if(i!==t&&"function"!=typeof i)throw Error("fn must be a function");return this.init(),s(),x.push({type:n,message:e,callback:i,placeholder:o,cssClass:a}),b||this.setup(),this},extend:function(e){if("string"!=typeof e)throw Error("extend method must have exactly one paramter");return function(t,n){return this.log(t,e,n),this}},hide:function(){var e,t=this;x.splice(0,1),x.length>0?this.setup(!0):(b=!1,e=function(n){n.stopPropagation(),t.unbind(d,t.transition.type,e)},this.transition.supported?(this.bind(d,this.transition.type,e),d.className="alertify alertify-hide alertify-hidden"):d.className="alertify alertify-hide alertify-hidden alertify-isHidden",u.className="alertify-cover alertify-cover-hidden",c.focus())},init:function(){r.createElement("nav"),r.createElement("article"),r.createElement("section"),null==n("alertify-cover")&&(u=r.createElement("div"),u.setAttribute("id","alertify-cover"),u.className="alertify-cover alertify-cover-hidden",r.body.appendChild(u)),null==n("alertify")&&(b=!1,x=[],d=r.createElement("section"),d.setAttribute("id","alertify"),d.className="alertify alertify-hidden",r.body.appendChild(d)),null==n("alertify-logs")&&(h=r.createElement("section"),h.setAttribute("id","alertify-logs"),h.className="alertify-logs alertify-logs-hidden",r.body.appendChild(h)),r.body.setAttribute("tabindex","0"),this.transition=g()},log:function(e,t,n){var r=function(){h&&null!==h.scrollTop||r()};return this.init(),r(),h.className="alertify-logs",this.notify(e,t,n),this},notify:function(e,t,n){var i=r.createElement("article");i.className="alertify-log"+("string"==typeof t&&""!==t?" alertify-log-"+t:""),i.innerHTML=e,h.appendChild(i),setTimeout(function(){i.className=i.className+" alertify-log-show"},50),this.close(i,n)},set:function(e){var t;if("object"!=typeof e&&e instanceof Array)throw Error("args must be an object");for(t in e)e.hasOwnProperty(t)&&(this[t]=e[t])},setFocus:function(){f?(f.focus(),f.select()):l.focus()},setup:function(e){var r,c=x[0],u=this;b=!0,r=function(e){e.stopPropagation(),u.setFocus(),u.unbind(d,u.transition.type,r)},this.transition.supported&&!e&&this.bind(d,this.transition.type,r),d.innerHTML=this.build(c),a=n("alertify-resetFocus"),s=n("alertify-resetFocusBack"),o=n("alertify-ok")||t,i=n("alertify-cancel")||t,l="cancel"===m.buttonFocus?i:"none"===m.buttonFocus?n("alertify-noneFocus"):o,f=n("alertify-text")||t,p=n("alertify-form")||t,"string"==typeof c.placeholder&&""!==c.placeholder&&(f.value=c.placeholder),e&&this.setFocus(),this.addListeners(c.callback)},unbind:function(e,t,n){"function"==typeof e.removeEventListener?e.removeEventListener(t,n,!1):e.detachEvent&&e.detachEvent("on"+t,n)}},{alert:function(e,t,n){return m.dialog(e,"alert",t,"",n),this},confirm:function(e,t,n){return m.dialog(e,"confirm",t,"",n),this},extend:m.extend,init:m.init,log:function(e,t,n){return m.log(e,t,n),this},prompt:function(e,t,n,r){return m.dialog(e,"prompt",t,n,r),this},success:function(e,t){return m.log(e,"success",t),this},error:function(e,t){return m.log(e,"error",t),this},set:function(e){m.set(e)},labels:m.labels,debug:m.handleErrors}},"function"==typeof define?define([],function(){return new n}):e.alertify===t&&(e.alertify=new n)}(this);var hljs=new function(){function e(e){return e.replace(/&/gm,"&").replace(//gm,">")}function t(e){return e.nodeName.toLowerCase()}function n(e,t){var n=e&&e.exec(t);return n&&0==n.index}function r(e){var t=(e.className+" "+(e.parentNode?e.parentNode.className:"")).split(/\s+/);return t=t.map(function(e){return e.replace(/^lang(uage)?-/,"")}),t.filter(function(e){return v(e)||"no-highlight"==e})[0]}function i(e,t){var n={};for(var r in e)n[r]=e[r];if(t)for(var r in t)n[r]=t[r];return n}function o(e){var n=[];return function r(e,i){for(var o=e.firstChild;o;o=o.nextSibling)3==o.nodeType?i+=o.nodeValue.length:"br"==t(o)?i+=1:1==o.nodeType&&(n.push({event:"start",offset:i,node:o}),i=r(o,i),n.push({event:"stop",offset:i,node:o}));return i}(e,0),n}function a(n,r,i){function o(){return n.length&&r.length?n[0].offset!=r[0].offset?n[0].offset"}function s(e){u+=""+t(e)+">"}function l(e){("start"==e.event?a:s)(e.node)}for(var c=0,u="",d=[];n.length||r.length;){var h=o();if(u+=e(i.substr(c,h[0].offset-c)),c=h[0].offset,h==n){d.reverse().forEach(s);do l(h.splice(0,1)[0]),h=o();while(h==n&&h.length&&h[0].offset==c);d.reverse().forEach(a)}else"start"==h[0].event?d.push(h[0].node):d.pop(),l(h.splice(0,1)[0])}return u+e(i.substr(c))}function s(e){function t(e){return e&&e.source||e}function n(n,r){return RegExp(t(n),"m"+(e.cI?"i":"")+(r?"g":""))}function r(o,a){if(!o.compiled){if(o.compiled=!0,o.k=o.k||o.bK,o.k){var s={},l=function(t,n){e.cI&&(n=n.toLowerCase()),n.split(" ").forEach(function(e){var n=e.split("|");s[n[0]]=[t,n[1]?Number(n[1]):1]})};"string"==typeof o.k?l("keyword",o.k):Object.keys(o.k).forEach(function(e){l(e,o.k[e])}),o.k=s}o.lR=n(o.l||/\b[A-Za-z0-9_]+\b/,!0),a&&(o.bK&&(o.b="\\b("+o.bK.split(" ").join("|")+")\\b"),o.b||(o.b=/\B|\b/),o.bR=n(o.b),o.e||o.eW||(o.e=/\B|\b/),o.e&&(o.eR=n(o.e)),o.tE=t(o.e)||"",o.eW&&a.tE&&(o.tE+=(o.e?"|":"")+a.tE)),o.i&&(o.iR=n(o.i)),void 0===o.r&&(o.r=1),o.c||(o.c=[]);var c=[];o.c.forEach(function(e){e.v?e.v.forEach(function(t){c.push(i(e,t))}):c.push("self"==e?o:e)}),o.c=c,o.c.forEach(function(e){r(e,o)}),o.starts&&r(o.starts,a);var u=o.c.map(function(e){return e.bK?"\\.?("+e.b+")\\.?":e.b}).concat([o.tE,o.i]).map(t).filter(Boolean);o.t=u.length?n(u.join("|"),!0):{exec:function(){return null}},o.continuation={}}}r(e)}function l(t,r,i,o){function a(e,t){for(var r=0;t.c.length>r;r++)if(n(t.c[r].bR,e))return t.c[r]}function u(e,t){return n(e.eR,t)?e:e.eW?u(e.parent,t):void 0}function d(e,t){return!i&&n(t.iR,e)}function h(e,t){var n=C.cI?t[0].toLowerCase():t[0];return e.k.hasOwnProperty(n)&&e.k[n]}function p(e,t,n,r){var i=r?"":b.classPrefix,o='";return o+=e+'">',o+t+a}function f(){if(!S.k)return e(_);var t="",n=0;S.lR.lastIndex=0;for(var r=S.lR.exec(_);r;){t+=e(_.substr(n,r.index-n));var i=h(S,r);i?(T+=i[1],t+=p(i[0],e(r[0]))):t+=e(r[0]),n=S.lR.lastIndex,r=S.lR.exec(_)}return t+e(_.substr(n))}function g(){if(S.sL&&!y[S.sL])return e(_);var t=S.sL?l(S.sL,_,!0,S.continuation.top):c(_);return S.r>0&&(T+=t.r),"continuous"==S.subLanguageMode&&(S.continuation.top=t.top),p(t.language,t.value,!1,!0)}function m(){return void 0!==S.sL?g():f()}function x(t,n){var r=t.cN?p(t.cN,"",!0):"";t.rB?(k+=r,_=""):t.eB?(k+=e(n)+r,_=""):(k+=r,_=n),S=Object.create(t,{parent:{value:S}})}function w(t,n){if(_+=t,void 0===n)return k+=m(),0;var r=a(n,S);if(r)return k+=m(),x(r,n),r.rB?0:n.length;var i=u(S,n);if(i){var o=S;o.rE||o.eE||(_+=n),k+=m();do S.cN&&(k+=""),T+=S.r,S=S.parent;while(S!=i.parent);return o.eE&&(k+=e(n)),_="",i.starts&&x(i.starts,""),o.rE?0:n.length}if(d(n,S))throw Error('Illegal lexeme "'+n+'" for mode "'+(S.cN||"")+'"');return _+=n,n.length||1}var C=v(t);if(!C)throw Error('Unknown language: "'+t+'"');s(C);for(var S=o||C,k="",$=S;$!=C;$=$.parent)$.cN&&(k+=p($.cN,k,!0));var _="",T=0;try{for(var M,D,N=0;;){if(S.t.lastIndex=N,M=S.t.exec(r),!M)break;D=w(r.substr(N,M.index-N),M[0]),N=M.index+D}w(r.substr(N));for(var $=S;$.parent;$=$.parent)$.cN&&(k+=" ';a(g).insertAfter(this);a(f.holder).css("width",e.width);a(f.holder).css("height",e.height);if(a(f.real_input).val()!=""){a.fn.tagsInput.importTags(a(f.real_input),a(f.real_input).val())}if(e.interactive){a(f.fake_input).val(a(f.fake_input).attr("data-default"));a(f.fake_input).css("color",e.placeholderColor);a(f.fake_input).resetAutosize(e);a(f.holder).bind("click",f,function(b){a(b.data.fake_input).focus()});a(f.fake_input).bind("focus",f,function(b){if(a(b.data.fake_input).val()==a(b.data.fake_input).attr("data-default")){a(b.data.fake_input).val("")}a(b.data.fake_input).css("color","#000000")});if(e.autocomplete_url!=undefined){autocomplete_options={source:e.autocomplete_url};for(attrname in e.autocomplete){autocomplete_options[attrname]=e.autocomplete[attrname]}if(jQuery.Autocompleter!==undefined){a(f.fake_input).autocomplete(e.autocomplete_url,e.autocomplete);a(f.fake_input).bind("result",f,function(b,c,f){if(c){a("#"+d).addTag(c[0]+"",{focus:true,unique:e.unique})}})}else if(jQuery.ui.autocomplete!==undefined){a(f.fake_input).autocomplete(autocomplete_options);a(f.fake_input).bind("autocompleteselect",f,function(b,c){a(b.data.real_input).addTag(c.item.value,{focus:true,unique:e.unique});return false})}}else{a(f.fake_input).bind("blur",f,function(b){var c=a(this).attr("data-default");if(a(b.data.fake_input).val()!=""&&a(b.data.fake_input).val()!=c){if(b.data.minChars<=a(b.data.fake_input).val().length&&(!b.data.maxChars||b.data.maxChars>=a(b.data.fake_input).val().length))a(b.data.real_input).addTag(a(b.data.fake_input).val(),{focus:true,unique:e.unique})}else{a(b.data.fake_input).val(a(b.data.fake_input).attr("data-default"));a(b.data.fake_input).css("color",e.placeholderColor)}return false})}a(f.fake_input).bind("keypress",f,function(b){if(b.which==b.data.delimiter.charCodeAt(0)||b.which==13){b.preventDefault();if(b.data.minChars<=a(b.data.fake_input).val().length&&(!b.data.maxChars||b.data.maxChars>=a(b.data.fake_input).val().length))a(b.data.real_input).addTag(a(b.data.fake_input).val(),{focus:true,unique:e.unique});a(b.data.fake_input).resetAutosize(e);return false}else if(b.data.autosize){a(b.data.fake_input).doAutosize(e)}});f.removeWithBackspace&&a(f.fake_input).bind("keydown",function(b){if(b.keyCode==8&&a(this).val()==""){b.preventDefault();var c=a(this).closest(".tagsinput").find(".tag:last").text();var d=a(this).attr("id").replace(/_tag$/,"");c=c.replace(/[\s]+x$/,"");a("#"+d).removeTag(escape(c));a(this).trigger("focus")}});a(f.fake_input).blur();if(f.unique){a(f.fake_input).keydown(function(b){if(b.keyCode==8||String.fromCharCode(b.which).match(/\w+|[áéíóúÁÉÍÓÚñÑ,/]+/)){a(this).removeClass("not_valid")}})}}return false});return this};a.fn.tagsInput.updateTagsField=function(c,d){var e=a(c).attr("id");a(c).val(d.join(b[e]))};a.fn.tagsInput.importTags=function(d,e){a(d).val("");var f=a(d).attr("id");var g=e.split(b[f]);for(i=0;i");return{r:T,value:k,language:t,top:S}}catch(L){if(-1!=L.message.indexOf("Illegal"))return{r:0,value:e(r)};throw L}}function c(t,n){n=n||b.languages||Object.keys(y);var r={r:0,value:e(t)},i=r;return n.forEach(function(e){if(v(e)){var n=l(e,t,!1);n.language=e,n.r>i.r&&(i=n),n.r>r.r&&(i=r,r=n)}}),i.language&&(r.second_best=i),r}function u(e){return b.tabReplace&&(e=e.replace(/^((<[^>]+>|\t)+)/gm,function(e,t){return t.replace(/\t/g,b.tabReplace)})),b.useBR&&(e=e.replace(/\n/g,"
")),e}function d(e){var t=b.useBR?e.innerHTML.replace(/\n/g,"").replace(/
|
]*>/g,"\n").replace(/<[^>]*>/g,""):e.textContent,n=r(e);if("no-highlight"!=n){var i=n?l(n,t,!0):c(t),s=o(e);if(s.length){var d=document.createElementNS("http://www.w3.org/1999/xhtml","pre");d.innerHTML=i.value,i.value=a(s,o(d),t)}i.value=u(i.value),e.innerHTML=i.value,e.className+=" hljs "+(!n&&i.language||""),e.result={language:i.language,re:i.r},i.second_best&&(e.second_best={language:i.second_best.language,re:i.second_best.r})}}function h(e){b=i(b,e)}function p(){if(!p.called){p.called=!0;var e=document.querySelectorAll("pre code");Array.prototype.forEach.call(e,d)}}function f(){addEventListener("DOMContentLoaded",p,!1),addEventListener("load",p,!1)}function g(e,t){var n=y[e]=t(this);n.aliases&&n.aliases.forEach(function(t){x[t]=e})}function m(){return Object.keys(y)}function v(e){return y[e]||y[x[e]]}var b={classPrefix:"hljs-",tabReplace:null,useBR:!1,languages:void 0},y={},x={};this.highlight=l,this.highlightAuto=c,this.fixMarkup=u,this.highlightBlock=d,this.configure=h,this.initHighlighting=p,this.initHighlightingOnLoad=f,this.registerLanguage=g,this.listLanguages=m,this.getLanguage=v,this.inherit=i,this.IR="[a-zA-Z][a-zA-Z0-9_]*",this.UIR="[a-zA-Z_][a-zA-Z0-9_]*",this.NR="\\b\\d+(\\.\\d+)?",this.CNR="(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",this.BNR="\\b(0b[01]+)",this.RSR="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",this.BE={b:"\\\\[\\s\\S]",r:0},this.ASM={cN:"string",b:"'",e:"'",i:"\\n",c:[this.BE]},this.QSM={cN:"string",b:'"',e:'"',i:"\\n",c:[this.BE]},this.PWM={b:/\b(a|an|the|are|I|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such)\b/},this.CLCM={cN:"comment",b:"//",e:"$",c:[this.PWM]},this.CBCM={cN:"comment",b:"/\\*",e:"\\*/",c:[this.PWM]},this.HCM={cN:"comment",b:"#",e:"$",c:[this.PWM]},this.NM={cN:"number",b:this.NR,r:0},this.CNM={cN:"number",b:this.CNR,r:0},this.BNM={cN:"number",b:this.BNR,r:0},this.CSSNM={cN:"number",b:this.NR+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",r:0},this.RM={cN:"regexp",b:/\//,e:/\/[gim]*/,i:/\n/,c:[this.BE,{b:/\[/,e:/\]/,r:0,c:[this.BE]}]},this.TM={cN:"title",b:this.IR,r:0},this.UTM={cN:"title",b:this.UIR,r:0}};hljs.registerLanguage("coffeescript",function(e){var t={keyword:"in if for while finally new do return else break catch instanceof throw try this switch continue typeof delete debugger super then unless until loop of by when and or is isnt not",literal:"true false null undefined yes no on off",reserved:"case default function var void with const let enum export import native __hasProp __extends __slice __bind __indexOf",built_in:"npm require console print module global window document"},n="[A-Za-z$_][0-9A-Za-z$_]*",r=e.inherit(e.TM,{b:n}),i={cN:"subst",b:/#\{/,e:/}/,k:t},o=[e.BNM,e.inherit(e.CNM,{starts:{e:"(\\s*/)?",r:0}}),{cN:"string",v:[{b:/'''/,e:/'''/,c:[e.BE]},{b:/'/,e:/'/,c:[e.BE]},{b:/"""/,e:/"""/,c:[e.BE,i]},{b:/"/,e:/"/,c:[e.BE,i]}]},{cN:"regexp",v:[{b:"///",e:"///",c:[i,e.HCM]},{b:"//[gim]*",r:0},{b:"/\\S(\\\\.|[^\\n])*?/[gim]*(?=\\s|\\W|$)"}]},{cN:"property",b:"@"+n},{b:"`",e:"`",eB:!0,eE:!0,sL:"javascript"}];return i.c=o,{aliases:["coffee","cson","iced"],k:t,c:o.concat([{cN:"comment",b:"###",e:"###"},e.HCM,{cN:"function",b:"("+n+"\\s*=\\s*)?(\\(.*\\))?\\s*\\B[-=]>",e:"[-=]>",rB:!0,c:[r,{cN:"params",b:"\\(",rB:!0,c:[{b:/\(/,e:/\)/,k:t,c:["self"].concat(o)}]}]},{cN:"class",bK:"class",e:"$",i:/[:="\[\]]/,c:[{bK:"extends",eW:!0,i:/[:="\[\]]/,c:[r]},r]},{cN:"attribute",b:n+":",e:":",rB:!0,eE:!0,r:0}])}}),hljs.registerLanguage("nginx",function(e){var t={cN:"variable",v:[{b:/\$\d+/},{b:/\$\{/,e:/}/},{b:"[\\$\\@]"+e.UIR}]},n={eW:!0,l:"[a-z/_]+",k:{built_in:"on off yes no true false none blocked debug info notice warn error crit select break last permanent redirect kqueue rtsig epoll poll /dev/poll"},r:0,i:"=>",c:[e.HCM,{cN:"string",c:[e.BE,t],v:[{b:/"/,e:/"/},{b:/'/,e:/'/}]},{cN:"url",b:"([a-z]+):/",e:"\\s",eW:!0,eE:!0},{cN:"regexp",c:[e.BE,t],v:[{b:"\\s\\^",e:"\\s|{|;",rE:!0},{b:"~\\*?\\s+",e:"\\s|{|;",rE:!0},{b:"\\*(\\.[a-z\\-]+)+"},{b:"([a-z\\-]+\\.)+\\*"}]},{cN:"number",b:"\\b\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}(:\\d{1,5})?\\b"},{cN:"number",b:"\\b\\d+[kKmMgGdshdwy]*\\b",r:0},t]};return{aliases:["nginxconf"],c:[e.HCM,{b:e.UIR+"\\s",e:";|{",rB:!0,c:[{cN:"title",b:e.UIR,starts:n}],r:0}],i:"[^\\s\\}]"}}),hljs.registerLanguage("json",function(e){var t={literal:"true false null"},n=[e.QSM,e.CNM],r={cN:"value",e:",",eW:!0,eE:!0,c:n,k:t},i={b:"{",e:"}",c:[{cN:"attribute",b:'\\s*"',e:'"\\s*:\\s*',eB:!0,eE:!0,c:[e.BE],i:"\\n",starts:r}],i:"\\S"},o={b:"\\[",e:"\\]",c:[e.inherit(r,{cN:null})],i:"\\S"};return n.splice(n.length,0,i,o),{c:n,k:t,i:"\\S"}}),hljs.registerLanguage("http",function(){return{i:"\\S",c:[{cN:"status",b:"^HTTP/[0-9\\.]+",e:"$",c:[{cN:"number",b:"\\b\\d{3}\\b"}]},{cN:"request",b:"^[A-Z]+ (.*?) HTTP/[0-9\\.]+$",rB:!0,e:"$",c:[{cN:"string",b:" ",e:" ",eB:!0,eE:!0}]},{cN:"attribute",b:"^\\w",e:": ",eE:!0,i:"\\n|\\s|=",starts:{cN:"string",e:"$"}},{b:"\\n\\n",starts:{sL:"",eW:!0}}]}}),hljs.registerLanguage("javascript",function(e){return{aliases:["js"],k:{keyword:"in if for while finally var new function do return void else break catch instanceof with throw case default try this switch continue typeof delete let yield const class",literal:"true false null undefined NaN Infinity",built_in:"eval isFinite isNaN parseFloat parseInt decodeURI decodeURIComponent encodeURI encodeURIComponent escape unescape Object Function Boolean Error EvalError InternalError RangeError ReferenceError StopIteration SyntaxError TypeError URIError Number Math Date String RegExp Array Float32Array Float64Array Int16Array Int32Array Int8Array Uint16Array Uint32Array Uint8Array Uint8ClampedArray ArrayBuffer DataView JSON Intl arguments require module console window document"},c:[{cN:"pi",b:/^\s*('|")use strict('|")/,r:10},e.ASM,e.QSM,e.CLCM,e.CBCM,e.CNM,{b:"("+e.RSR+"|\\b(case|return|throw)\\b)\\s*",k:"return throw case",c:[e.CLCM,e.CBCM,e.RM,{b:/,e:/>;/,r:0,sL:"xml"}],r:0},{cN:"function",bK:"function",e:/\{/,eE:!0,c:[e.inherit(e.TM,{b:/[A-Za-z$_][0-9A-Za-z$_]*/}),{cN:"params",b:/\(/,e:/\)/,c:[e.CLCM,e.CBCM],i:/["'\(]/}],i:/\[|%/},{b:/\$[(.]/},{b:"\\."+e.IR,r:0}]}}),hljs.registerLanguage("sql",function(e){var t={cN:"comment",b:"--",e:"$"};return{cI:!0,i:/[<>]/,c:[{cN:"operator",bK:"begin end start commit rollback savepoint lock alter create drop rename call delete do handler insert load replace select truncate update set show pragma grant merge describe use explain help declare prepare execute deallocate savepoint release unlock purge reset change stop analyze cache flush optimize repair kill install uninstall checksum restore check backup",e:/;/,eW:!0,k:{keyword:"abs absolute acos action add adddate addtime aes_decrypt aes_encrypt after aggregate all allocate alter analyze and any are as asc ascii asin assertion at atan atan2 atn2 authorization authors avg backup before begin benchmark between bin binlog bit_and bit_count bit_length bit_or bit_xor both by cache call cascade cascaded case cast catalog ceil ceiling chain change changed char_length character_length charindex charset check checksum checksum_agg choose close coalesce coercibility collate collation collationproperty column columns columns_updated commit compress concat concat_ws concurrent connect connection connection_id consistent constraint constraints continue contributors conv convert convert_tz corresponding cos cot count count_big crc32 create cross cume_dist curdate current current_date current_time current_timestamp current_user cursor curtime data database databases datalength date_add date_format date_sub dateadd datediff datefromparts datename datepart datetime2fromparts datetimeoffsetfromparts day dayname dayofmonth dayofweek dayofyear deallocate declare decode default deferrable deferred degrees delayed delete des_decrypt des_encrypt des_key_file desc describe descriptor diagnostics difference disconnect distinct distinctrow div do domain double drop dumpfile each else elt enclosed encode encrypt end end-exec engine engines eomonth errors escape escaped event eventdata events except exception exec execute exists exp explain export_set extended external extract fast fetch field fields find_in_set first first_value floor flush for force foreign format found found_rows from from_base64 from_days from_unixtime full function get get_format get_lock getdate getutcdate global go goto grant grants greatest group group_concat grouping grouping_id gtid_subset gtid_subtract handler having help hex high_priority hosts hour ident_current ident_incr ident_seed identified identity if ifnull ignore iif ilike immediate in index indicator inet6_aton inet6_ntoa inet_aton inet_ntoa infile initially inner innodb input insert install instr intersect into is is_free_lock is_ipv4 is_ipv4_compat is_ipv4_mapped is_not is_not_null is_used_lock isdate isnull isolation join key kill language last last_day last_insert_id last_value lcase lead leading least leaves left len lenght level like limit lines ln load load_file local localtime localtimestamp locate lock log log10 log2 logfile logs low_priority lower lpad ltrim make_set makedate maketime master master_pos_wait match matched max md5 medium merge microsecond mid min minute mod mode module month monthname mutex name_const names national natural nchar next no no_write_to_binlog not now nullif nvarchar oct octet_length of old_password on only open optimize option optionally or ord order outer outfile output pad parse partial partition password patindex percent_rank percentile_cont percentile_disc period_add period_diff pi plugin position pow power pragma precision prepare preserve primary prior privileges procedure procedure_analyze processlist profile profiles public publishingservername purge quarter query quick quote quotename radians rand read references regexp relative relaylog release release_lock rename repair repeat replace replicate reset restore restrict return returns reverse revoke right rlike rollback rollup round row row_count rows rpad rtrim savepoint schema scroll sec_to_time second section select serializable server session session_user set sha sha1 sha2 share show sign sin size slave sleep smalldatetimefromparts snapshot some soname soundex sounds_like space sql sql_big_result sql_buffer_result sql_cache sql_calc_found_rows sql_no_cache sql_small_result sql_variant_property sqlstate sqrt square start starting status std stddev stddev_pop stddev_samp stdev stdevp stop str str_to_date straight_join strcmp string stuff subdate substr substring subtime subtring_index sum switchoffset sysdate sysdatetime sysdatetimeoffset system_user sysutcdatetime table tables tablespace tan temporary terminated tertiary_weights then time time_format time_to_sec timediff timefromparts timestamp timestampadd timestampdiff timezone_hour timezone_minute to to_base64 to_days to_seconds todatetimeoffset trailing transaction translation trigger trigger_nestlevel triggers trim truncate try_cast try_convert try_parse ucase uncompress uncompressed_length unhex unicode uninstall union unique unix_timestamp unknown unlock update upgrade upped upper usage use user user_resources using utc_date utc_time utc_timestamp uuid uuid_short validate_password_strength value values var var_pop var_samp variables variance varp version view warnings week weekday weekofyear weight_string when whenever where with work write xml xor year yearweek zon",literal:"true false null",built_in:"array bigint binary bit blob boolean char character date dec decimal float int integer interval number numeric real serial smallint varchar varying int8 serial8 text"},c:[{cN:"string",b:"'",e:"'",c:[e.BE,{b:"''"}]},{cN:"string",b:'"',e:'"',c:[e.BE,{b:'""'}]},{cN:"string",b:"`",e:"`",c:[e.BE]},e.CNM,e.CBCM,t]},e.CBCM,t]}}),hljs.registerLanguage("php",function(e){var t={cN:"variable",b:"(\\$|->)+[a-zA-Z_-ÿ][a-zA-Z0-9_-ÿ]*"},n={cN:"preprocessor",b:/<\?(php)?|\?>/},r={cN:"string",c:[e.BE,n],v:[{b:'b"',e:'"'},{b:"b'",e:"'"},e.inherit(e.ASM,{i:null}),e.inherit(e.QSM,{i:null})]},i={v:[e.BNM,e.CNM]};return{aliases:["php3","php4","php5","php6"],cI:!0,k:"and include_once list abstract global private echo interface as static endswitch array null if endwhile or const for endforeach self var while isset public protected exit foreach throw elseif include __FILE__ empty require_once do xor return parent clone use __CLASS__ __LINE__ else break print eval new catch __METHOD__ case exception default die require __FUNCTION__ enddeclare final try switch continue endfor endif declare unset true false trait goto instanceof insteadof __DIR__ __NAMESPACE__ yield finally",c:[e.CLCM,e.HCM,{cN:"comment",b:"/\\*",e:"\\*/",c:[{cN:"phpdoc",b:"\\s@[A-Za-z]+"},n]},{cN:"comment",b:"__halt_compiler.+?;",eW:!0,k:"__halt_compiler",l:e.UIR},{cN:"string",b:"<<<['\"]?\\w+['\"]?$",e:"^\\w+;",c:[e.BE]},n,t,{cN:"function",bK:"function",e:/[;{]/,eE:!0,i:"\\$|\\[|%",c:[e.UTM,{cN:"params",b:"\\(",e:"\\)",c:["self",t,e.CBCM,r,i]}]},{cN:"class",bK:"class interface",e:"{",eE:!0,i:/[:\(\$"]/,c:[{bK:"extends implements",r:10},e.UTM]},{bK:"namespace",e:";",i:/[\.']/,c:[e.UTM]},{bK:"use",e:";",c:[e.UTM]},{b:"=>"},r,i]}}),hljs.registerLanguage("makefile",function(e){var t={cN:"variable",b:/\$\(/,e:/\)/,c:[e.BE]};return{aliases:["mk","mak"],c:[e.HCM,{b:/^\w+\s*\W*=/,rB:!0,r:0,starts:{cN:"constant",e:/\s*\W*=/,eE:!0,starts:{e:/$/,r:0,c:[t]}}},{cN:"title",b:/^[\w]+:\s*$/},{cN:"phony",b:/^\.PHONY:/,e:/$/,k:".PHONY",l:/[\.\w]+/},{b:/^\t+/,e:/$/,c:[e.QSM,t]}]}}),hljs.registerLanguage("bash",function(e){var t={cN:"variable",v:[{b:/\$[\w\d#@][\w\d_]*/},{b:/\$\{(.*?)\}/}]},n={cN:"string",b:/"/,e:/"/,c:[e.BE,t,{cN:"variable",b:/\$\(/,e:/\)/,c:[e.BE]}]},r={cN:"string",b:/'/,e:/'/};return{aliases:["sh","zsh"],l:/-?[a-z\.]+/,k:{keyword:"if then else elif fi for break continue while in do done exit return set declare case esac export exec",literal:"true false",built_in:"printf echo read cd pwd pushd popd dirs let eval unset typeset readonly getopts source shopt caller type hash bind help sudo",operator:"-ne -eq -lt -gt -f -d -e -s -l -a"},c:[{cN:"shebang",b:/^#![^\n]+sh\s*$/,r:10},{cN:"function",b:/\w[\w\d_]*\s*\(\s*\)\s*\{/,rB:!0,c:[e.inherit(e.TM,{b:/\w[\w\d_]*/})],r:0},e.HCM,e.NM,n,r,t]}}),hljs.registerLanguage("cpp",function(e){var t={keyword:"false int float while private char catch export virtual operator sizeof dynamic_cast|10 typedef const_cast|10 const struct for static_cast|10 union namespace unsigned long throw volatile static protected bool template mutable if public friend do return goto auto void enum else break new extern using true class asm case typeid short reinterpret_cast|10 default double register explicit signed typename try this switch continue wchar_t inline delete alignof char16_t char32_t constexpr decltype noexcept nullptr static_assert thread_local restrict _Bool complex _Complex _Imaginary",built_in:"std string cin cout cerr clog stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap array shared_ptr abort abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf"};return{aliases:["c","h","c++","h++"],k:t,i:"",c:[e.CLCM,e.CBCM,e.QSM,{cN:"string",b:"'\\\\?.",e:"'",i:"."},{cN:"number",b:"\\b(\\d+(\\.\\d*)?|\\.\\d+)(u|U|l|L|ul|UL|f|F)"},e.CNM,{cN:"preprocessor",b:"#",e:"$",k:"if else elif endif define undef warning error line pragma",c:[{b:'include\\s*[<"]',e:'[>"]',k:"include",i:"\\n"},e.CLCM]},{cN:"stl_container",b:"\\b(deque|list|queue|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array)\\s*<",e:">",k:t,c:["self"]},{b:e.IR+"::"}]}}),hljs.registerLanguage("perl",function(e){var t="getpwent getservent quotemeta msgrcv scalar kill dbmclose undef lc ma syswrite tr send umask sysopen shmwrite vec qx utime local oct semctl localtime readpipe do return format read sprintf dbmopen pop getpgrp not getpwnam rewinddir qqfileno qw endprotoent wait sethostent bless s|0 opendir continue each sleep endgrent shutdown dump chomp connect getsockname die socketpair close flock exists index shmgetsub for endpwent redo lstat msgctl setpgrp abs exit select print ref gethostbyaddr unshift fcntl syscall goto getnetbyaddr join gmtime symlink semget splice x|0 getpeername recv log setsockopt cos last reverse gethostbyname getgrnam study formline endhostent times chop length gethostent getnetent pack getprotoent getservbyname rand mkdir pos chmod y|0 substr endnetent printf next open msgsnd readdir use unlink getsockopt getpriority rindex wantarray hex system getservbyport endservent int chr untie rmdir prototype tell listen fork shmread ucfirst setprotoent else sysseek link getgrgid shmctl waitpid unpack getnetbyname reset chdir grep split require caller lcfirst until warn while values shift telldir getpwuid my getprotobynumber delete and sort uc defined srand accept package seekdir getprotobyname semop our rename seek if q|0 chroot sysread setpwent no crypt getc chown sqrt write setnetent setpriority foreach tie sin msgget map stat getlogin unless elsif truncate exec keys glob tied closedirioctl socket readlink eval xor readline binmode setservent eof ord bind alarm pipe atan2 getgrent exp time push setgrent gt lt or ne m|0 break given say state when",n={cN:"subst",b:"[$@]\\{",e:"\\}",k:t},r={b:"->{",e:"}"},i={cN:"variable",v:[{b:/\$\d/},{b:/[\$\%\@](\^\w\b|#\w+(\:\:\w+)*|{\w+}|\w+(\:\:\w*)*)/},{b:/[\$\%\@][^\s\w{]/,r:0}]},o={cN:"comment",b:"^(__END__|__DATA__)",e:"\\n$",r:5},a=[e.BE,n,i],s=[i,e.HCM,o,{cN:"comment",b:"^\\=\\w",e:"\\=cut",eW:!0},r,{cN:"string",c:a,v:[{b:"q[qwxr]?\\s*\\(",e:"\\)",r:5},{b:"q[qwxr]?\\s*\\[",e:"\\]",r:5},{b:"q[qwxr]?\\s*\\{",e:"\\}",r:5},{b:"q[qwxr]?\\s*\\|",e:"\\|",r:5},{b:"q[qwxr]?\\s*\\<",e:"\\>",r:5},{b:"qw\\s+q",e:"q",r:5},{b:"'",e:"'",c:[e.BE]},{b:'"',e:'"'},{b:"`",e:"`",c:[e.BE]},{b:"{\\w+}",c:[],r:0},{b:"-?\\w+\\s*\\=\\>",c:[],r:0}]},{cN:"number",b:"(\\b0[0-7_]+)|(\\b0x[0-9a-fA-F_]+)|(\\b[1-9][0-9_]*(\\.[0-9_]+)?)|[0_]\\b",r:0},{b:"(\\/\\/|"+e.RSR+"|\\b(split|return|print|reverse|grep)\\b)\\s*",k:"split return print reverse grep",r:0,c:[e.HCM,o,{cN:"regexp",b:"(s|tr|y)/(\\\\.|[^/])*/(\\\\.|[^/])*/[a-z]*",r:10},{cN:"regexp",b:"(m|qr)?/",e:"/[a-z]*",c:[e.BE],r:0}]},{cN:"sub",bK:"sub",e:"(\\s*\\(.*?\\))?[;{]",r:5},{cN:"operator",b:"-\\w\\b",r:0}];return n.c=s,r.c=s,{aliases:["pl"],k:t,c:s}}),hljs.registerLanguage("ini",function(e){return{cI:!0,i:/\S/,c:[{cN:"comment",b:";",e:"$"},{cN:"title",b:"^\\[",e:"\\]"},{cN:"setting",b:"^[a-z0-9\\[\\]_-]+[ \\t]*=[ \\t]*",e:"$",c:[{cN:"value",eW:!0,k:"on off true false yes no",c:[e.QSM,e.NM],r:0}]}]}}),hljs.registerLanguage("apache",function(e){var t={cN:"number",b:"[\\$%]\\d+"};return{aliases:["apacheconf"],cI:!0,c:[e.HCM,{cN:"tag",b:"?",e:">"},{cN:"keyword",b:/\w+/,r:0,k:{common:"order deny allow setenv rewriterule rewriteengine rewritecond documentroot sethandler errordocument loadmodule options header listen serverroot servername"},starts:{e:/$/,r:0,k:{literal:"on off all"},c:[{cN:"sqbracket",b:"\\s\\[",e:"\\]$"},{cN:"cbracket",b:"[\\$%]\\{",e:"\\}",c:["self",t]},t,e.QSM]}}],i:/\S/}}),hljs.registerLanguage("java",function(e){var t="false synchronized int abstract float private char boolean static null if const for true while long throw strictfp finally protected import native final return void enum else break transient new catch instanceof byte super volatile case assert short package default double public try this switch continue throws";return{aliases:["jsp"],k:t,i:/<\//,c:[{cN:"javadoc",b:"/\\*\\*",e:"\\*/",c:[{cN:"javadoctag",b:"(^|\\s)@[A-Za-z]+"}],r:10},e.CLCM,e.CBCM,e.ASM,e.QSM,{bK:"protected public private",e:/[{;=]/,k:t,c:[{cN:"class",bK:"class interface",eW:!0,eE:!0,i:/[:"\[\]]/,c:[{bK:"extends implements",r:10},e.UTM]},{b:e.UIR+"\\s*\\(",rB:!0,c:[e.UTM]}]},e.CNM,{cN:"annotation",b:"@[A-Za-z]+"}]}}),hljs.registerLanguage("xml",function(){var e="[A-Za-z0-9\\._:-]+",t={b:/<\?(php)?(?!\w)/,e:/\?>/,sL:"php",subLanguageMode:"continuous"},n={eW:!0,i:/,r:0,c:[t,{cN:"attribute",b:e,r:0},{b:"=",r:0,c:[{cN:"value",v:[{b:/"/,e:/"/},{b:/'/,e:/'/},{b:/[^\s\/>]+/}]}]}]};return{aliases:["html","xhtml","rss","atom","xsl","plist"],cI:!0,c:[{cN:"doctype",b:"",r:10,c:[{b:"\\[",e:"\\]"}]},{cN:"comment",b:"",r:10},{cN:"cdata",b:"<\\!\\[CDATA\\[",e:"\\]\\]>",r:10},{cN:"tag",b:"",rE:!0,sL:"css"}},{cN:"tag",b:"",rE:!0,sL:"javascript"}},{b:"<%",e:"%>",sL:"vbscript"},t,{cN:"pi",b:/<\?\w+/,e:/\?>/,r:10},{cN:"tag",b:"?",e:"/?>",c:[{cN:"title",b:"[^ /><]+",r:0},n]}]}}),hljs.registerLanguage("markdown",function(){return{aliases:["md","mkdown","mkd"],c:[{cN:"header",v:[{b:"^#{1,6}",e:"$"},{b:"^.+?\\n[=-]{2,}$"}]},{b:"<",e:">",sL:"xml",r:0},{cN:"bullet",b:"^([*+-]|(\\d+\\.))\\s+"},{cN:"strong",b:"[*_]{2}.+?[*_]{2}"},{cN:"emphasis",v:[{b:"\\*.+?\\*"},{b:"_.+?_",r:0}]},{cN:"blockquote",b:"^>\\s+",e:"$"},{cN:"code",v:[{b:"`.+?`"},{b:"^( {4}| )",e:"$",r:0}]},{cN:"horizontal_rule",b:"^[-\\*]{3,}",e:"$"},{b:"\\[.+?\\][\\(\\[].+?[\\)\\]]",rB:!0,c:[{cN:"link_label",b:"\\[",e:"\\]",eB:!0,rE:!0,r:0},{cN:"link_url",b:"\\]\\(",e:"\\)",eB:!0,eE:!0},{cN:"link_reference",b:"\\]\\[",e:"\\]",eB:!0,eE:!0}],r:10},{b:"^\\[.+\\]:",e:"$",rB:!0,c:[{cN:"link_reference",b:"\\[",e:"\\]",eB:!0,eE:!0},{cN:"link_url",b:"\\s",e:"$"}]}]}
-}),hljs.registerLanguage("cs",function(e){var t="abstract as base bool break byte case catch char checked const continue decimal default delegate do double else enum event explicit extern false finally fixed float for foreach goto if implicit in int interface internal is lock long new null object operator out override params private protected public readonly ref return sbyte sealed short sizeof stackalloc static string struct switch this throw true try typeof uint ulong unchecked unsafe ushort using virtual volatile void while async await ascending descending from get group into join let orderby partial select set value var where yield";return{aliases:["csharp"],k:t,i:/::/,c:[{cN:"comment",b:"///",e:"$",rB:!0,c:[{cN:"xmlDocTag",v:[{b:"///",r:0},{b:""},{b:"?",e:">"}]}]},e.CLCM,e.CBCM,{cN:"preprocessor",b:"#",e:"$",k:"if else elif endif define undef warning error line region endregion pragma checksum"},{cN:"string",b:'@"',e:'"',c:[{b:'""'}]},e.ASM,e.QSM,e.CNM,{bK:"protected public private internal",e:/[{;=]/,k:t,c:[{bK:"class namespace interface",starts:{c:[e.TM]}},{b:e.IR+"\\s*\\(",rB:!0,c:[e.TM]}]}]}}),hljs.registerLanguage("ruby",function(e){var t="[a-zA-Z_]\\w*[!?=]?|[-+~]\\@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?",n="and false then defined module in return redo if BEGIN retry end for true self when next until do begin unless END rescue nil else break undef not super class case require yield alias while ensure elsif or include attr_reader attr_writer attr_accessor",r={cN:"yardoctag",b:"@[A-Za-z]+"},i={cN:"value",b:"#<",e:">"},o={cN:"comment",v:[{b:"#",e:"$",c:[r]},{b:"^\\=begin",e:"^\\=end",c:[r],r:10},{b:"^__END__",e:"\\n$"}]},a={cN:"subst",b:"#\\{",e:"}",k:n},s={cN:"string",c:[e.BE,a],v:[{b:/'/,e:/'/},{b:/"/,e:/"/},{b:"%[qw]?\\(",e:"\\)"},{b:"%[qw]?\\[",e:"\\]"},{b:"%[qw]?{",e:"}"},{b:"%[qw]?<",e:">"},{b:"%[qw]?/",e:"/"},{b:"%[qw]?%",e:"%"},{b:"%[qw]?-",e:"-"},{b:"%[qw]?\\|",e:"\\|"},{b:/\B\?(\\\d{1,3}|\\x[A-Fa-f0-9]{1,2}|\\u[A-Fa-f0-9]{4}|\\?\S)\b/}]},l={cN:"params",b:"\\(",e:"\\)",k:n},c=[s,i,o,{cN:"class",bK:"class module",e:"$|;",i:/=/,c:[e.inherit(e.TM,{b:"[A-Za-z_]\\w*(::\\w+)*(\\?|\\!)?"}),{cN:"inheritance",b:"<\\s*",c:[{cN:"parent",b:"("+e.IR+"::)?"+e.IR}]},o]},{cN:"function",bK:"def",e:" |$|;",r:0,c:[e.inherit(e.TM,{b:t}),l,o]},{cN:"constant",b:"(::)?(\\b[A-Z]\\w*(::)?)+",r:0},{cN:"symbol",b:":",c:[s,{b:t}],r:0},{cN:"symbol",b:e.UIR+"(\\!|\\?)?:",r:0},{cN:"number",b:"(\\b0[0-7_]+)|(\\b0x[0-9a-fA-F_]+)|(\\b[1-9][0-9_]*(\\.[0-9_]+)?)|[0_]\\b",r:0},{cN:"variable",b:"(\\$\\W)|((\\$|\\@\\@?)(\\w+))"},{b:"("+e.RSR+")\\s*",c:[i,o,{cN:"regexp",c:[e.BE,a],i:/\n/,v:[{b:"/",e:"/[a-z]*"},{b:"%r{",e:"}[a-z]*"},{b:"%r\\(",e:"\\)[a-z]*"},{b:"%r!",e:"![a-z]*"},{b:"%r\\[",e:"\\][a-z]*"}]}],r:0}];a.c=c,l.c=c;var u=[{r:1,cN:"output",b:"^\\s*=> ",e:"$",rB:!0,c:[{cN:"status",b:"^\\s*=>"},{b:" ",e:"$",c:c}]},{r:1,cN:"input",b:"^[^ ][^=>]*>+ ",e:"$",rB:!0,c:[{cN:"prompt",b:"^[^ ][^=>]*>+"},{b:" ",e:"$",c:c}]}];return{aliases:["rb","gemspec","podspec","thor","irb"],k:n,c:u.concat(c)}}),hljs.registerLanguage("diff",function(){return{aliases:["patch"],c:[{cN:"chunk",r:10,v:[{b:/^\@\@ +\-\d+,\d+ +\+\d+,\d+ +\@\@$/},{b:/^\*\*\* +\d+,\d+ +\*\*\*\*$/},{b:/^\-\-\- +\d+,\d+ +\-\-\-\-$/}]},{cN:"header",v:[{b:/Index: /,e:/$/},{b:/=====/,e:/=====$/},{b:/^\-\-\-/,e:/$/},{b:/^\*{3} /,e:/$/},{b:/^\+\+\+/,e:/$/},{b:/\*{5}/,e:/\*{5}$/}]},{cN:"addition",b:"^\\+",e:"$"},{cN:"deletion",b:"^\\-",e:"$"},{cN:"change",b:"^\\!",e:"$"}]}}),hljs.registerLanguage("objectivec",function(e){var t={keyword:"int float while char export sizeof typedef const struct for union unsigned long volatile static bool mutable if do return goto void enum else break extern asm case short default double register explicit signed typename this switch continue wchar_t inline readonly assign readwrite self @synchronized id typeof nonatomic super unichar IBOutlet IBAction strong weak copy in out inout bycopy byref oneway __strong __weak __block __autoreleasing @private @protected @public @try @property @end @throw @catch @finally @autoreleasepool @synthesize @dynamic @selector @optional @required",literal:"false true FALSE TRUE nil YES NO NULL",built_in:"NSString NSDictionary CGRect CGPoint UIButton UILabel UITextView UIWebView MKMapView NSView NSViewController NSWindow NSWindowController NSSet NSUUID NSIndexSet UISegmentedControl NSObject UITableViewDelegate UITableViewDataSource NSThread UIActivityIndicator UITabbar UIToolBar UIBarButtonItem UIImageView NSAutoreleasePool UITableView BOOL NSInteger CGFloat NSException NSLog NSMutableString NSMutableArray NSMutableDictionary NSURL NSIndexPath CGSize UITableViewCell UIView UIViewController UINavigationBar UINavigationController UITabBarController UIPopoverController UIPopoverControllerDelegate UIImage NSNumber UISearchBar NSFetchedResultsController NSFetchedResultsChangeType UIScrollView UIScrollViewDelegate UIEdgeInsets UIColor UIFont UIApplication NSNotFound NSNotificationCenter NSNotification UILocalNotification NSBundle NSFileManager NSTimeInterval NSDate NSCalendar NSUserDefaults UIWindow NSRange NSArray NSError NSURLRequest NSURLConnection UIInterfaceOrientation MPMoviePlayerController dispatch_once_t dispatch_queue_t dispatch_sync dispatch_async dispatch_once"},n=/[a-zA-Z@][a-zA-Z0-9_]*/,r="@interface @class @protocol @implementation";return{aliases:["m","mm","objc","obj-c"],k:t,l:n,i:"",c:[e.CLCM,e.CBCM,e.CNM,e.QSM,{cN:"string",v:[{b:'@"',e:'"',i:"\\n",c:[e.BE]},{b:"'",e:"[^\\\\]'",i:"[^\\\\][^']"}]},{cN:"preprocessor",b:"#",e:"$",c:[{cN:"title",v:[{b:'"',e:'"'},{b:"<",e:">"}]}]},{cN:"class",b:"("+r.split(" ").join("|")+")\\b",e:"({|$)",eE:!0,k:r,l:n,c:[e.UTM]},{cN:"variable",b:"\\."+e.UIR,r:0}]}}),hljs.registerLanguage("css",function(e){var t="[a-zA-Z-][a-zA-Z0-9_-]*",n={cN:"function",b:t+"\\(",rB:!0,eE:!0,e:"\\("};return{cI:!0,i:"[=/|']",c:[e.CBCM,{cN:"id",b:"\\#[A-Za-z0-9_-]+"},{cN:"class",b:"\\.[A-Za-z0-9_-]+",r:0},{cN:"attr_selector",b:"\\[",e:"\\]",i:"$"},{cN:"pseudo",b:":(:)?[a-zA-Z0-9\\_\\-\\+\\(\\)\\\"\\']+"},{cN:"at_rule",b:"@(font-face|page)",l:"[a-z-]+",k:"font-face page"},{cN:"at_rule",b:"@",e:"[{;]",c:[{cN:"keyword",b:/\S+/},{b:/\s/,eW:!0,eE:!0,r:0,c:[n,e.ASM,e.QSM,e.CSSNM]}]},{cN:"tag",b:t,r:0},{cN:"rules",b:"{",e:"}",i:"[^\\s]",r:0,c:[e.CBCM,{cN:"rule",b:"[^\\s]",rB:!0,e:";",eW:!0,c:[{cN:"attribute",b:"[A-Z\\_\\.\\-]+",e:":",eE:!0,i:"[^\\s]",starts:{cN:"value",eW:!0,eE:!0,c:[n,e.CSSNM,e.QSM,e.ASM,e.CBCM,{cN:"hexcolor",b:"#[0-9A-Fa-f]+"},{cN:"important",b:"!important"}]}}]}]}]}}),hljs.registerLanguage("python",function(e){var t={cN:"prompt",b:/^(>>>|\.\.\.) /},n={cN:"string",c:[e.BE],v:[{b:/(u|b)?r?'''/,e:/'''/,c:[t],r:10},{b:/(u|b)?r?"""/,e:/"""/,c:[t],r:10},{b:/(u|r|ur)'/,e:/'/,r:10},{b:/(u|r|ur)"/,e:/"/,r:10},{b:/(b|br)'/,e:/'/},{b:/(b|br)"/,e:/"/},e.ASM,e.QSM]},r={cN:"number",r:0,v:[{b:e.BNR+"[lLjJ]?"},{b:"\\b(0o[0-7]+)[lLjJ]?"},{b:e.CNR+"[lLjJ]?"}]},i={cN:"params",b:/\(/,e:/\)/,c:["self",t,r,n]},o={e:/:/,i:/[${=;\n]/,c:[e.UTM,i]};return{aliases:["py","gyp"],k:{keyword:"and elif is global as in if from raise for except finally print import pass return exec else break not with class assert yield try while continue del or def lambda nonlocal|10 None True False",built_in:"Ellipsis NotImplemented"},i:/(<\/|->|\?)/,c:[t,r,n,e.HCM,e.inherit(o,{cN:"function",bK:"def",r:10}),e.inherit(o,{cN:"class",bK:"class"}),{cN:"decorator",b:/@/,e:/$/},{b:/\b(print|exec)\(/}]}}),reMarked=function(opts){function extend(e,t){if(!t)return e;for(var n in e)"Object"==typeOf(t[n])?extend(e[n],t[n]):t[n]!==void 0&&(e[n]=t[n])}function typeOf(e){return Object.prototype.toString.call(e).slice(8,-1)}function rep(e,t){for(var n="";t-->0;)n+=e;return n}function trim12(e){for(var e=e.replace(/^\s\s*/,""),t=/\s/,n=e.length;t.test(e.charAt(--n)););return e.slice(0,n+1)}function lpad(e,t,n){return rep(t,n-e.length)+e}function rpad(e,t,n){return e+rep(t,n-e.length)}function otag(e,t){if(!e)return"";for(var n,r="<"+e,i=0;t.attributes.length>i;i++)n=t.attributes.item(i),r+=" "+n.nodeName+'="'+n.nodeValue+'"';return r+">"}function ctag(e){return e?""+e+">":""}function pfxLines(e,t){return e.replace(/^/gm,t)}function nodeName(e){return("#text"==e.nodeName?"txt":e.nodeName).toLowerCase()}function wrap(e,t){var n,r;return t instanceof Array?(n=t[0],r=t[1]):n=r=t,n=n instanceof Function?n.call(this,e):n,r=r instanceof Function?r.call(this,e):r,n+e+r}function outerHTML(e){return e.outerHTML||function(e){var t,n=document.createElement("div");return n.appendChild(e.cloneNode(!0)),t=n.innerHTML,n=null,t}(e)}var links=[],cfg={link_list:!1,h1_setext:!0,h2_setext:!0,h_atx_suf:!1,gfm_code:!0,trim_code:!0,li_bullet:"*-+"[0],hr_char:"-_*"[0],indnt_str:[" "," "," "][0],bold_char:"*_"[0],emph_char:"*_"[1],gfm_del:!0,gfm_tbls:!0,tbl_edges:!1,hash_lnks:!1,br_only:!1,col_pre:"col ",nbsp_spc:!1,span_tags:!0,div_tags:!0,unsup_tags:{ignore:"script style noscript",inline:"span sup sub i u b center big",block2:"div form fieldset dl header footer address article aside figure hgroup section",block1c:"dt dd caption legend figcaption output",block2c:"canvas audio video iframe"},tag_remap:{i:"em",b:"strong"}},isIE=eval("/*@cc_on!@*/!1"),docMode=document.documentMode,ieLt9=isIE&&(!docMode||9>docMode),textContProp="textContent"in Element.prototype||!ieLt9?"textContent":"innerText";extend(cfg,opts),this.render=function(e){links=[];var t=document.createElement("div");t.innerHTML="string"==typeof e?e:outerHTML(e);var n=new lib.tag(t,null,0),r=n.rend().replace(/^[\t ]+[\n\r]+/gm,"\n").replace(/^[\n\r]+|[\n\r]+$/g,"");if(cfg.link_list&&links.length>0){r+="\n\n";for(var i=0,o=0;links.length>o;o++)if(links[o].e.title){var a=links[o].e.href.length;a&&a>i&&(i=a)}for(var s=0;links.length>s;s++){var l=links[s].e.title?rep(" ",i+2-links[s].e.href.length)+'"'+links[s].e.title+'"':"";r+=" ["+(+s+1)+"]: "+("a"==nodeName(links[s].e)?links[s].e.href:links[s].e.src)+l+"\n"}}return r.replace(/^[\t ]+\n/gm,"\n")};var lib={};lib.tag=klass({wrap:"",lnPfx:"",lnInd:0,init:function(e,t,n){this.e=e,this.p=t,this.i=n,this.c=[],this.tag=nodeName(e),this.initK()},initK:function(){var e;if(this.e.hasChildNodes()){var t,n,r=cfg.unsup_tags.inline;if("table"==nodeName(this.e)&&this.e.hasChildNodes()&&!this.e.tHead){var i=document.createElement("thead"),o=this.e.tBodies[0],a=o.rows[0],s=a.cells[0];if("th"==nodeName(s))i.appendChild(a);else for(var l,e=0,c=a.cells.length,u=i.insertRow();c>e++;)l=document.createElement("th"),l[textContProp]=cfg.col_pre+e,u.appendChild(l);this.e.insertBefore(i,o)}for(e in this.e.childNodes)if(/\d+/.test(e)&&(t=this.e.childNodes[e],n=nodeName(t),n in cfg.tag_remap&&(n=cfg.tag_remap[n]),!cfg.unsup_tags.ignore.test(n))){if("txt"==n&&!nodeName(this.e).match(r)&&/^\s+$/.test(t[textContProp])){if(0==e||e==this.e.childNodes.length-1)continue;var d=this.e.childNodes[e-1],h=this.e.childNodes[e+1];if(d&&!nodeName(d).match(r)||h&&!nodeName(h).match(r))continue}var p=null;if(!lib[n]){var f=cfg.unsup_tags;f.inline.test(n)?n="span"!=n||cfg.span_tags?"tinl":"inl":f.block2.test(n)?n="div"!=n||cfg.div_tags?"tblk":"blk":f.block1c.test(n)?n="ctblk":f.block2c.test(n)?(n="ctblk",p=["\n\n",""]):n="rawhtml"}var g=new lib[n](t,this,this.c.length);p&&(g.wrap=p),(g instanceof lib.a&&t.href||g instanceof lib.img)&&(g.lnkid=links.length,links.push(g)),this.c.push(g)}}},rend:function(){return this.rendK().replace(/\n{3,}/gm,"\n\n")},rendK:function(){for(var e,t="",n=0;this.c.length>n;n++)e=this.c[n],t+=(e.bef||"")+e.rend()+(e.aft||"");return t.replace(/^\n+|\n+$/,"")}}),lib.blk=lib.tag.extend({wrap:["\n\n",""],wrapK:null,tagr:!1,lnInd:null,init:function(e,t,n){this.supr(e,t,n),null===this.lnInd&&(this.lnInd=this.p&&this.tagr&&this.c[0]instanceof lib.blk?4:0),null===this.wrapK&&(this.wrapK=this.tagr&&this.c[0]instanceof lib.blk?"\n":"")},rend:function(){return wrap.call(this,(this.tagr?otag(this.tag,this.e):"")+wrap.call(this,pfxLines(pfxLines(this.rendK(),this.lnPfx),rep(" ",this.lnInd)),this.wrapK)+(this.tagr?ctag(this.tag):""),this.wrap)},rendK:function(){var e=this.supr();if(this.p instanceof lib.li){var t=null,n=e.match(/^[\t ]+/gm);if(!n)return e;for(var r=0;n.length>r;r++)(null===t||n[r][0].length":" ";return this.p instanceof lib.h?"
":e+"\n"}]}),lib.strong=lib.inl.extend({wrap:rep(cfg.bold_char,2)}),lib.blockquote=lib.blk.extend({lnPfx:"> ",rend:function(){return this.supr().replace(/>[ \t]$/gm,">")}}),lib.pre=lib.blk.extend({tagr:!0,wrapK:"\n",lnInd:0}),lib.code=lib.blk.extend({tagr:!1,wrap:"",wrapK:function(e){return-1!==e.indexOf("`")?"``":"`"},lnInd:0,init:function(e,t,n){if(this.supr(e,t,n),this.p instanceof lib.pre)if(this.p.tagr=!1,cfg.gfm_code){var r=this.e.getAttribute("class");r=(r||"").split(" ")[0],0===r.indexOf("lang-")&&(r=r.substr(5)),this.wrapK=["```"+r+"\n","\n```"]}else this.wrapK="",this.p.lnInd=4},rendK:function(){if(this.p instanceof lib.pre){var e=this.e[textContProp];return cfg.trim_code?e.trim():e}return this.supr()}}),lib.table=cfg.gfm_tbls?lib.blk.extend({cols:[],init:function(e,t,n){this.supr(e,t,n),this.cols=[]},rend:function(){for(var e=0;this.c.length>e;e++)for(var t=0;this.c[e].c.length>t;t++)for(var n=0;this.c[e].c[t].c.length>n;n++)this.c[e].c[t].c[n].prep();return this.supr()}}):lib.tblk.extend(),lib.thead=cfg.gfm_tbls?lib.cblk.extend({wrap:["\n",function(){for(var e="",t=0;this.p.cols.length>t;t++){var n=this.p.cols[t],r="c"==n.a[0]?":":" ",i="r"==n.a[0]||"c"==n.a[0]?":":" ";e+=(0==t&&cfg.tbl_edges?"|":"")+r+rep("-",n.w)+i+(this.p.cols.length-1>t||cfg.tbl_edges?"|":"")}return"\n"+trim12(e)}]}):lib.ctblk.extend(),lib.tbody=cfg.gfm_tbls?lib.cblk.extend():lib.ctblk.extend(),lib.tfoot=cfg.gfm_tbls?lib.cblk.extend():lib.ctblk.extend(),lib.tr=cfg.gfm_tbls?lib.cblk.extend({wrapK:[cfg.tbl_edges?"| ":"",cfg.tbl_edges?" |":""]}):lib.ctblk.extend(),lib.th=cfg.gfm_tbls?lib.inl.extend({guts:null,wrap:[function(){var e,t=this.p.p.p.cols[this.i],n=0==this.i?"":" ",r=t.w-this.guts.length;switch(t.a[0]){case"r":e=rep(" ",r);break;case"c":e=rep(" ",Math.floor(r/2));break;default:e=""}return n+e},function(){var e,t=this.p.p.p.cols[this.i],n=this.i==this.p.c.length-1?"":" |",r=t.w-this.guts.length;switch(t.a[0]){case"r":e="";break;case"c":e=rep(" ",Math.ceil(r/2));break;default:e=rep(" ",r)}return e+n}],prep:function(){this.guts=this.rendK(),this.rendK=function(){return this.guts};var e=this.p.p.p.cols;e[this.i]||(e[this.i]={w:null,a:""});var t=e[this.i];t.w=Math.max(t.w||0,this.guts.length);var n=this.e.align||this.e.style.textAlign;n&&(t.a=n)}}):lib.ctblk.extend(),lib.td=lib.th.extend(),lib.txt=lib.inl.extend({initK:function(){this.c=this.e[textContProp].split(/^/gm)},rendK:function(){var e=this.c.join("").replace(/\r/gm,"");return this.p instanceof lib.code||this.p instanceof lib.pre||(e=e.replace(/^\s*([#*])/gm,function(e,t){return e.replace(t,"\\"+t)})),0==this.i&&(e=e.replace(/^\n+/,"")),this.i==this.p.c.length-1&&(e=e.replace(/\n+$/,"")),e.replace(/\u00a0/gm,cfg.nbsp_spc?" ":" ")}}),lib.rawhtml=lib.blk.extend({initK:function(){this.guts=outerHTML(this.e)},rendK:function(){return this.guts}});for(var i in cfg.unsup_tags)cfg.unsup_tags[i]=RegExp("^(?:"+("inline"==i?"a|em|strong|img|code|del|":"")+cfg.unsup_tags[i].replace(/\s/g,"|")+")$")},!function(e,t,n){"function"==typeof define?define(n):"undefined"!=typeof module?module.exports=n():t[e]=n()}("klass",this,function(){function e(e){return i.call(t(e)?e:function(){},e,1)}function t(e){return typeof e===o}function n(e,t,n){return function(){var r=this.supr;this.supr=n[s][e];var i={}.fabricatedUndefined,o=i;try{o=t.apply(this,arguments)}finally{this.supr=r}return o}}function r(e,r,i){for(var o in r)r.hasOwnProperty(o)&&(e[o]=t(r[o])&&t(i[s][o])&&a.test(r[o])?n(o,r[o],i):r[o])}function i(e,n){function i(){}function o(){this.init?this.init.apply(this,arguments):(n||c&&a.apply(this,arguments),u.apply(this,arguments))}i[s]=this[s];var a=this,l=new i,c=t(e),u=c?e:this,d=c?{}:e;return o.methods=function(e){return r(l,e,a),o[s]=l,this},o.methods.call(o,d).prototype.constructor=o,o.extend=arguments.callee,o[s].implement=o.statics=function(e,t){return e="string"==typeof e?function(){var n={};return n[e]=t,n}():e,r(this,e,a),this},o}var o="function",a=/xyz/.test(function(){})?/\bsupr\b/:/.*/,s="prototype";return e}),function(e){"function"==typeof define&&define.amd?define(["jquery"],e):e(jQuery)}(function(e){function t(){var t=n(this),a=o.settings;return isNaN(t.datetime)||(0==a.cutoff||Math.abs(i(t.datetime))0)||o.isTime(t)&&t.attr("title")||t.attr("title",n)}return t.data("timeago")}function r(e){return o.inWords(i(e))}function i(e){return(new Date).getTime()-e.getTime()}e.timeago=function(t){return t instanceof Date?r(t):"string"==typeof t?r(e.timeago.parse(t)):"number"==typeof t?r(new Date(t)):r(e.timeago.datetime(t))};var o=e.timeago;e.extend(e.timeago,{settings:{refreshMillis:6e4,allowPast:!0,allowFuture:!1,localeTitle:!1,cutoff:0,strings:{prefixAgo:null,prefixFromNow:null,suffixAgo:"ago",suffixFromNow:"from now",inPast:"any moment now",seconds:"less than a minute",minute:"about a minute",minutes:"%d minutes",hour:"about an hour",hours:"about %d hours",day:"a day",days:"%d days",month:"about a month",months:"%d months",year:"about a year",years:"%d years",wordSeparator:" ",numbers:[]}},inWords:function(t){function n(n,i){var o=e.isFunction(n)?n(i,t):n,a=r.numbers&&r.numbers[i]||i;return o.replace(/%d/i,a)}if(!this.settings.allowPast&&!this.settings.allowFuture)throw"timeago allowPast and allowFuture settings can not both be set to false.";var r=this.settings.strings,i=r.prefixAgo,o=r.suffixAgo;if(this.settings.allowFuture&&0>t&&(i=r.prefixFromNow,o=r.suffixFromNow),!this.settings.allowPast&&t>=0)return this.settings.strings.inPast;var a=Math.abs(t)/1e3,s=a/60,l=s/60,c=l/24,u=c/365,d=45>a&&n(r.seconds,Math.round(a))||90>a&&n(r.minute,1)||45>s&&n(r.minutes,Math.round(s))||90>s&&n(r.hour,1)||24>l&&n(r.hours,Math.round(l))||42>l&&n(r.day,1)||30>c&&n(r.days,Math.round(c))||45>c&&n(r.month,1)||365>c&&n(r.months,Math.round(c/30))||1.5>u&&n(r.year,1)||n(r.years,Math.round(u)),h=r.wordSeparator||"";return void 0===r.wordSeparator&&(h=" "),e.trim([i,d,o].join(h))},parse:function(t){var n=e.trim(t);return n=n.replace(/\.\d+/,""),n=n.replace(/-/,"/").replace(/-/,"/"),n=n.replace(/T/," ").replace(/Z/," UTC"),n=n.replace(/([\+\-]\d\d)\:?(\d\d)/," $1$2"),n=n.replace(/([\+\-]\d\d)$/," $100"),new Date(n)},datetime:function(t){var n=o.isTime(t)?e(t).attr("datetime"):e(t).attr("title");return o.parse(n)},isTime:function(t){return"time"===e(t).get(0).tagName.toLowerCase()}});var a={init:function(){var n=e.proxy(t,this);n();var r=o.settings;r.refreshMillis>0&&(this._timeagoInterval=setInterval(n,r.refreshMillis))},update:function(n){var r=o.parse(n);e(this).data("timeago",{datetime:r}),o.settings.localeTitle&&e(this).attr("title",r.toLocaleString()),t.apply(this)},updateFromDOM:function(){e(this).data("timeago",{datetime:o.parse(o.isTime(this)?e(this).attr("datetime"):e(this).attr("title"))}),t.apply(this)},dispose:function(){this._timeagoInterval&&(window.clearInterval(this._timeagoInterval),this._timeagoInterval=null)}};e.fn.timeago=function(e,t){var n=e?a[e]:a.init;if(!n)throw Error("Unknown function name '"+e+"' for timeago");return this.each(function(){n.call(this,t)}),this},document.createElement("abbr"),document.createElement("time")}),function(e){function t(e){return e=w?e.replace("Ctrl","Cmd"):e.replace("Cmd","Ctrl")}function n(e,n){n=n||{};var r=document.createElement("a"),i=n.shortcut||C[e];return i&&(i=t(i),r.title=i,r.title=r.title.replace("Cmd","⌘"),w&&(r.title=r.title.replace("Alt","⌥"))),r.className=n.className||"icon-"+e,r}function r(){return el=document.createElement("i"),el.className="separator",el.innerHTML="|",el}function i(e,t){t=t||e.getCursor("start");var n=e.getTokenAt(t);if(!n.type)return{};for(var r,i,o=n.type.split(" "),a={},s=0;o.length>s;s++)r=o[s],"strong"===r?a.bold=!0:"variable-2"===r?(i=e.getLine(t.line),/^\s*\d+\.\s/.test(i)?a["ordered-list"]=!0:a["unordered-list"]=!0):"atom"===r?a.quote=!0:"em"===r&&(a.italic=!0);return a}function o(e){var t=e.codemirror.getWrapperElement(),n=document,r=n.fullScreen||n.mozFullScreen||n.webkitFullScreen,i=function(){t.requestFullScreen?t.requestFullScreen():t.mozRequestFullScreen?t.mozRequestFullScreen():t.webkitRequestFullScreen&&t.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT)},o=function(){n.cancelFullScreen?n.cancelFullScreen():n.mozCancelFullScreen?n.mozCancelFullScreen():n.webkitCancelFullScreen&&n.webkitCancelFullScreen()};r?o&&o():i()}function a(e){var t,n=e.codemirror,r=i(n),o="**",a="**",s=n.getCursor("start"),l=n.getCursor("end");r.bold?(t=n.getLine(s.line),o=t.slice(0,s.ch),a=t.slice(s.ch),o=o.replace(/^(.*)?(\*|\_){2}(\S+.*)?$/,"$1$3"),a=a.replace(/^(.*\S+)?(\*|\_){2}(\s+.*)?$/,"$1$3"),s.ch-=2,l.ch-=2,n.setLine(s.line,o+a)):(t=n.getSelection(),n.replaceSelection(o+t+a),s.ch+=2,l.ch+=2),n.setSelection(s,l),n.focus()}function s(e){var t,n=e.codemirror,r=i(n),o="*",a="*",s=n.getCursor("start"),l=n.getCursor("end");r.italic?(t=n.getLine(s.line),o=t.slice(0,s.ch),a=t.slice(s.ch),o=o.replace(/^(.*)?(\*|\_)(\S+.*)?$/,"$1$3"),a=a.replace(/^(.*\S+)?(\*|\_)(\s+.*)?$/,"$1$3"),s.ch-=1,l.ch-=1,n.setLine(s.line,o+a)):(t=n.getSelection(),n.replaceSelection(o+t+a),s.ch+=1,l.ch+=1),n.setSelection(s,l),n.focus()}function l(e){var t=e.codemirror;v(t,"quote")}function c(e){var t=e.codemirror;v(t,"unordered-list")}function u(e){var t=e.codemirror;v(t,"ordered-list")}function d(e){var t=e.codemirror,n=i(t);m(t,n.link,"[","](http://)")}function h(e){var t=e.codemirror,n=i(t);m(t,n.image,"![","](http://)")}function p(e){var t=e.codemirror;t.undo(),t.focus()}function f(e){var t=e.codemirror;t.redo(),t.focus()}function g(e){var t=e.toolbar.preview,n=e.constructor.markdown,r=e.codemirror,i=r.getWrapperElement(),o=i.lastChild;/editor-preview/.test(o.className)||(o=document.createElement("div"),o.className="editor-preview",i.appendChild(o)),/editor-preview-active/.test(o.className)?(o.className=o.className.replace(/\s*editor-preview-active\s*/g,""),t.className=t.className.replace(/\s*active\s*/g,"")):(setTimeout(function(){o.className+=" editor-preview-active"},1),t.className+=" active");var a=r.getValue();o.innerHTML=n(a)}function m(e,t,n,r){var i,o=e.getCursor("start"),a=e.getCursor("end");t?(i=e.getLine(o.line),n=i.slice(0,o.ch),r=i.slice(o.ch),e.setLine(o.line,n+r)):(i=e.getSelection(),e.replaceSelection(n+i+r),o.ch+=n.length,a.ch+=n.length),e.setSelection(o,a),e.focus()}function v(e,t){for(var n=i(e),r=e.getCursor("start"),o=e.getCursor("end"),a={quote:/^(\s*)\>\s+/,"unordered-list":/^(\s*)(\*|\-|\+)\s+/,"ordered-list":/^(\s*)\d+\.\s+/},s={quote:"> ","unordered-list":"* ","ordered-list":"1. "},l=r.line;o.line>=l;l++)(function(r){var i=e.getLine(r);i=n[t]?i.replace(a[t],"$1"):s[t]+i,e.setLine(r,i)})(l);e.focus()}function b(e){var t=/[a-zA-Z0-9_\u0392-\u03c9]+|[\u4E00-\u9FFF\u3400-\u4dbf\uf900-\ufaff\u3040-\u309f\uac00-\ud7af]+/g,n=e.match(t),r=0;if(null===n)return r;for(var i=0;n.length>i;i++)r+=n[i].charCodeAt(0)>=19968?n[i].length:1;return r}function y(e){e=e||{},e.element&&(this.element=e.element),e.toolbar=e.toolbar||y.toolbar,e.hasOwnProperty("status")||(e.status=["lines","words","cursor"]),this.options=e,this.element&&this.render()}var x=function(){"use strict";function e(n,r){if(!(this instanceof e))return new e(n,r);this.options=r=r||{};for(var i in ro)!r.hasOwnProperty(i)&&ro.hasOwnProperty(i)&&(r[i]=ro[i]);h(r);var o="string"==typeof r.value?0:r.value.first,a=this.display=t(n,o);a.wrapper.CodeMirror=this,c(this),r.autofocus&&!Ii&&pt(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,focused:!1,suppressEdits:!1,pasteIncoming:!1,draggingText:!1,highlight:new Ur},s(this),r.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap");var l=r.value;"string"==typeof l&&(l=new bo(r.value,r.mode)),ot(this,ur)(this,l),ki&&setTimeout(ei(ht,this,!0),20),gt(this);var u;try{u=document.activeElement==a.input}catch(d){}u||r.autofocus&&!Ii?setTimeout(ei(Lt,this),20):Et(this),ot(this,function(){for(var e in no)no.propertyIsEnumerable(e)&&no[e](this,r[e],io);for(var t=0;lo.length>t;++t)lo[t](this)})()}function t(e,t){var n={},r=n.input=ri("textarea",null,null,"position: absolute; padding: 0; width: 1px; height: 1em; outline: none; font-size: 4px;");return Ti?r.style.width="1000px":r.setAttribute("wrap","off"),zi&&(r.style.border="1px solid black"),r.setAttribute("autocorrect","off"),r.setAttribute("autocapitalize","off"),r.setAttribute("spellcheck","false"),n.inputDiv=ri("div",[r],null,"overflow: hidden; position: relative; width: 3px; height: 0px;"),n.scrollbarH=ri("div",[ri("div",null,null,"height: 1px")],"CodeMirror-hscrollbar"),n.scrollbarV=ri("div",[ri("div",null,null,"width: 1px")],"CodeMirror-vscrollbar"),n.scrollbarFiller=ri("div",null,"CodeMirror-scrollbar-filler"),n.gutterFiller=ri("div",null,"CodeMirror-gutter-filler"),n.lineDiv=ri("div",null,"CodeMirror-code"),n.selectionDiv=ri("div",null,null,"position: relative; z-index: 1"),n.cursor=ri("div"," ","CodeMirror-cursor"),n.otherCursor=ri("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"),n.measure=ri("div",null,"CodeMirror-measure"),n.lineSpace=ri("div",[n.measure,n.selectionDiv,n.lineDiv,n.cursor,n.otherCursor],null,"position: relative; outline: none"),n.mover=ri("div",[ri("div",[n.lineSpace],"CodeMirror-lines")],null,"position: relative"),n.sizer=ri("div",[n.mover],"CodeMirror-sizer"),n.heightForcer=ri("div",null,null,"position: absolute; height: "+So+"px; width: 1px;"),n.gutters=ri("div",null,"CodeMirror-gutters"),n.lineGutter=null,n.scroller=ri("div",[n.sizer,n.heightForcer,n.gutters],"CodeMirror-scroll"),n.scroller.setAttribute("tabIndex","-1"),n.wrapper=ri("div",[n.inputDiv,n.scrollbarH,n.scrollbarV,n.scrollbarFiller,n.gutterFiller,n.scroller],"CodeMirror"),$i&&(n.gutters.style.zIndex=-1,n.scroller.style.paddingRight=0),e.appendChild?e.appendChild(n.wrapper):e(n.wrapper),zi&&(r.style.width="0px"),Ti||(n.scroller.draggable=!0),Ei?(n.inputDiv.style.height="1px",n.inputDiv.style.position="absolute"):$i&&(n.scrollbarH.style.minWidth=n.scrollbarV.style.minWidth="18px"),n.viewOffset=n.lastSizeC=0,n.showingFrom=n.showingTo=t,n.lineNumWidth=n.lineNumInnerWidth=n.lineNumChars=null,n.prevInput="",n.alignWidgets=!1,n.pollingFast=!1,n.poll=new Ur,n.cachedCharWidth=n.cachedTextHeight=null,n.measureLineCache=[],n.measureLineCachePos=0,n.inaccurateSelection=!1,n.maxLine=null,n.maxLineLength=0,n.maxLineChanged=!1,n.wheelDX=n.wheelDY=n.wheelStartX=n.wheelStartY=null,n}function n(t){t.doc.mode=e.getMode(t.options,t.doc.modeOption),t.doc.iter(function(e){e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null)}),t.doc.frontier=t.doc.first,E(t,100),t.state.modeGen++,t.curOp&<(t)}function r(e){e.options.lineWrapping?(e.display.wrapper.className+=" CodeMirror-wrap",e.display.sizer.style.minWidth=""):(e.display.wrapper.className=e.display.wrapper.className.replace(" CodeMirror-wrap",""),d(e)),o(e),lt(e),U(e),setTimeout(function(){p(e)},100)}function i(e){var t=tt(e.display),n=e.options.lineWrapping,r=n&&Math.max(5,e.display.scroller.clientWidth/nt(e.display)-3);return function(i){return jn(e.doc,i)?0:n?(Math.ceil(i.text.length/r)||1)*t:t}}function o(e){var t=e.doc,n=i(e);t.iter(function(e){var t=n(e);t!=e.height&&fr(e,t)})}function a(e){var t=ho[e.options.keyMap],n=t.style;e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-keymap-\S+/g,"")+(n?" cm-keymap-"+n:""),e.state.disableInput=t.disableInput}function s(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),U(e)}function l(e){c(e),lt(e),setTimeout(function(){g(e)},20)}function c(e){var t=e.display.gutters,n=e.options.gutters;ii(t);for(var r=0;n.length>r;++r){var i=n[r],o=t.appendChild(ri("div",null,"CodeMirror-gutter "+i));"CodeMirror-linenumbers"==i&&(e.display.lineGutter=o,o.style.width=(e.display.lineNumWidth||1)+"px")}t.style.display=r?"":"none"}function u(e,t){if(0==t.height)return 0;for(var n,r=t.text.length,i=t;n=In(i);){var o=n.find();i=dr(e,o.from.line),r+=o.from.ch-o.to.ch}for(i=t;n=Hn(i);){var o=n.find();r-=i.text.length-o.from.ch,i=dr(e,o.to.line),r+=i.text.length-o.to.ch}return r}function d(e){var t=e.display,n=e.doc;t.maxLine=dr(n,n.first),t.maxLineLength=u(n,t.maxLine),t.maxLineChanged=!0,n.iter(function(e){var r=u(n,e);r>t.maxLineLength&&(t.maxLineLength=r,t.maxLine=e)})}function h(e){for(var t=!1,n=0;e.gutters.length>n;++n)"CodeMirror-linenumbers"==e.gutters[n]&&(e.lineNumbers?t=!0:e.gutters.splice(n--,1));!t&&e.lineNumbers&&e.gutters.push("CodeMirror-linenumbers")}function p(e){var t=e.display,n=e.doc.height,r=n+I(t);t.sizer.style.minHeight=t.heightForcer.style.top=r+"px",t.gutters.style.height=Math.max(r,t.scroller.clientHeight-So)+"px";var i=Math.max(r,t.scroller.scrollHeight),o=t.scroller.scrollWidth>t.scroller.clientWidth+1,a=i>t.scroller.clientHeight+1;a?(t.scrollbarV.style.display="block",t.scrollbarV.style.bottom=o?ci(t.measure)+"px":"0",t.scrollbarV.firstChild.style.height=i-t.scroller.clientHeight+t.scrollbarV.clientHeight+"px"):t.scrollbarV.style.display="",o?(t.scrollbarH.style.display="block",t.scrollbarH.style.right=a?ci(t.measure)+"px":"0",t.scrollbarH.firstChild.style.width=t.scroller.scrollWidth-t.scroller.clientWidth+t.scrollbarH.clientWidth+"px"):t.scrollbarH.style.display="",o&&a?(t.scrollbarFiller.style.display="block",t.scrollbarFiller.style.height=t.scrollbarFiller.style.width=ci(t.measure)+"px"):t.scrollbarFiller.style.display="",o&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(t.gutterFiller.style.display="block",t.gutterFiller.style.height=ci(t.measure)+"px",t.gutterFiller.style.width=t.gutters.offsetWidth+"px"):t.gutterFiller.style.display="",Ai&&0===ci(t.measure)&&(t.scrollbarV.style.minWidth=t.scrollbarH.style.minHeight=Fi?"18px":"12px")
-}function f(e,t,n){var r=e.scroller.scrollTop,i=e.wrapper.clientHeight;"number"==typeof n?r=n:n&&(r=n.top,i=n.bottom-n.top),r=Math.floor(r-z(e));var o=Math.ceil(r+i);return{from:mr(t,r),to:mr(t,o)}}function g(e){var t=e.display;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var n=b(t)-t.scroller.scrollLeft+e.doc.scrollLeft,r=t.gutters.offsetWidth,i=n+"px",o=t.lineDiv.firstChild;o;o=o.nextSibling)if(o.alignable)for(var a=0,s=o.alignable;s.length>a;++a)s[a].style.left=i;e.options.fixedGutter&&(t.gutters.style.left=n+r+"px")}}function m(e){if(!e.options.lineNumbers)return!1;var t=e.doc,n=v(e.options,t.first+t.size-1),r=e.display;if(n.length!=r.lineNumChars){var i=r.measure.appendChild(ri("div",[ri("div",n)],"CodeMirror-linenumber CodeMirror-gutter-elt")),o=i.firstChild.offsetWidth,a=i.offsetWidth-o;return r.lineGutter.style.width="",r.lineNumInnerWidth=Math.max(o,r.lineGutter.offsetWidth-a),r.lineNumWidth=r.lineNumInnerWidth+a,r.lineNumChars=r.lineNumInnerWidth?n.length:-1,r.lineGutter.style.width=r.lineNumWidth+"px",!0}return!1}function v(e,t){return e.lineNumberFormatter(t+e.firstLineNumber)+""}function b(e){return si(e.scroller).left-si(e.sizer).left}function y(e,t,n,r){for(var i,o=e.display.showingFrom,a=e.display.showingTo,s=f(e.display,e.doc,n);x(e,t,s,r)&&(r=!1,i=!0,M(e),p(e),n&&(n=Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,"number"==typeof n?n:n.top)),s=f(e.display,e.doc,n),!(s.from>=e.display.showingFrom&&s.to<=e.display.showingTo));)t=[];return i&&(jr(e,"update",e),(e.display.showingFrom!=o||e.display.showingTo!=a)&&jr(e,"viewportChange",e,e.display.showingFrom,e.display.showingTo)),i}function x(e,t,n,r){var i=e.display,o=e.doc;if(!i.wrapper.clientWidth)return i.showingFrom=i.showingTo=o.first,i.viewOffset=0,void 0;if(!(!r&&0==t.length&&n.from>i.showingFrom&&n.tol;++l)if(t[l].diff){s=t[l].from;break}var c=o.first+o.size,u=Math.max(n.from-e.options.viewportMargin,o.first),d=Math.min(c,n.to+e.options.viewportMargin);if(u>i.showingFrom&&20>u-i.showingFrom&&(u=Math.max(o.first,i.showingFrom)),i.showingTo>d&&20>i.showingTo-d&&(d=Math.min(c,i.showingTo)),Gi)for(u=gr(Rn(o,dr(o,u)));c>d&&jn(o,dr(o,d));)++d;var h=[{from:Math.max(i.showingFrom,o.first),to:Math.min(i.showingTo,c)}];if(h=h[0].from>=h[0].to?[]:S(h,t),Gi)for(var l=0;h.length>l;++l)for(var p,f=h[l];p=Hn(dr(o,f.to-1));){var g=p.find().from.line;if(!(g>f.from)){h.splice(l--,1);break}f.to=g}for(var v=0,l=0;h.length>l;++l){var f=h[l];u>f.from&&(f.from=u),f.to>d&&(f.to=d),f.from>=f.to?h.splice(l--,1):v+=f.to-f.from}if(!r&&v==d-u&&u==i.showingFrom&&d==i.showingTo)return C(e),void 0;h.sort(function(e,t){return e.from-t.from});try{var b=document.activeElement}catch(y){}.7*(d-u)>v&&(i.lineDiv.style.display="none"),$(e,u,d,h,s),i.lineDiv.style.display="",b&&document.activeElement!=b&&b.offsetHeight&&b.focus();var x=u!=i.showingFrom||d!=i.showingTo||i.lastSizeC!=i.wrapper.clientHeight;return x&&(i.lastSizeC=i.wrapper.clientHeight,E(e,400)),i.showingFrom=u,i.showingTo=d,w(e),C(e),!0}}function w(e){for(var t,n=e.display,r=n.lineDiv.offsetTop,i=n.lineDiv.firstChild;i;i=i.nextSibling)if(i.lineObj){if($i){var o=i.offsetTop+i.offsetHeight;t=o-r,r=o}else{var a=si(i);t=a.bottom-a.top}var s=i.lineObj.height-t;if(2>t&&(t=tt(n)),s>.001||-.001>s){fr(i.lineObj,t);var l=i.lineObj.widgets;if(l)for(var c=0;l.length>c;++c)l[c].height=l[c].node.offsetHeight}}}function C(e){var t=e.display.viewOffset=vr(e,dr(e.doc,e.display.showingFrom));e.display.mover.style.top=t+"px"}function S(e,t){for(var n=0,r=t.length||0;r>n;++n){for(var i=t[n],o=[],a=i.diff||0,s=0,l=e.length;l>s;++s){var c=e[s];i.to<=c.from&&i.diff?o.push({from:c.from+a,to:c.to+a}):i.to<=c.from||i.from>=c.to?o.push(c):(i.from>c.from&&o.push({from:c.from,to:i.from}),i.ton;++n){var s=t.widgets[n];if(s.showIfHidden){var p=u.previousSibling;if(/pre/i.test(p.nodeName)){var f=ri("div",null,null,"position: relative");p.parentNode.replaceChild(f,p),f.appendChild(p),p=f}var g=p.appendChild(ri("div",[s.node],"CodeMirror-linewidget"));s.handleMouseEvents||(g.ignoreEvents=!0),T(s,g,p,a)}}}else if(d&&h>=d.from&&d.to>h){for(;u.lineObj!=t;)u=o(u);l&&h>=i&&u.lineNumber&&ai(u.lineNumber,v(e.options,h)),u=u.nextSibling}else{if(t.widgets)for(var m,b=0,y=u;y&&20>b;++b,y=y.nextSibling)if(y.lineObj==t&&/div/i.test(y.nodeName)){m=y;break}var x=_(e,t,h,a,m);if(x!=m)c.insertBefore(x,u);else{for(;u!=m;)u=o(u);u=u.nextSibling}x.lineObj=t}++h});u;)u=o(u)}function _(e,t,n,r,i){var o,a=er(e,t),s=t.gutterMarkers,l=e.display;if(!(e.options.lineNumbers||s||t.bgClass||t.wrapClass||t.widgets))return a;if(i){i.alignable=null;for(var c,u=!0,d=0,h=null,p=i.firstChild;p;p=c)if(c=p.nextSibling,/\bCodeMirror-linewidget\b/.test(p.className)){for(var f=0;t.widgets.length>f;++f){var g=t.widgets[f];if(g.node==p.firstChild){g.above||h||(h=p),T(g,p,i,r),++d;break}}if(f==t.widgets.length){u=!1;break}}else i.removeChild(p);i.insertBefore(a,h),u&&d==t.widgets.length&&(o=i,i.className=t.wrapClass||"")}if(o||(o=ri("div",null,t.wrapClass,"position: relative"),o.appendChild(a)),t.bgClass&&o.insertBefore(ri("div",null,t.bgClass+" CodeMirror-linebackground"),o.firstChild),e.options.lineNumbers||s){var m=o.insertBefore(ri("div",null,null,"position: absolute; left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px"),o.firstChild);if(e.options.fixedGutter&&(o.alignable||(o.alignable=[])).push(m),!e.options.lineNumbers||s&&s["CodeMirror-linenumbers"]||(o.lineNumber=m.appendChild(ri("div",v(e.options,n),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+r.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+l.lineNumInnerWidth+"px"))),s)for(var b=0;e.options.gutters.length>b;++b){var y=e.options.gutters[b],x=s.hasOwnProperty(y)&&s[y];x&&m.appendChild(ri("div",[x],"CodeMirror-gutter-elt","left: "+r.gutterLeft[y]+"px; width: "+r.gutterWidth[y]+"px"))}}if($i&&(o.style.zIndex=2),t.widgets&&o!=i)for(var f=0,w=t.widgets;w.length>f;++f){var g=w[f],C=ri("div",[g.node],"CodeMirror-linewidget");g.handleMouseEvents||(C.ignoreEvents=!0),T(g,C,o,r),g.above?o.insertBefore(C,e.options.lineNumbers&&0!=t.height?m:a):o.appendChild(C),jr(g,"redraw")}return o}function T(e,t,n,r){if(e.noHScroll){(n.alignable||(n.alignable=[])).push(t);var i=r.wrapperWidth;t.style.left=r.fixedPos+"px",e.coverGutter||(i-=r.gutterTotalWidth,t.style.paddingLeft=r.gutterTotalWidth+"px"),t.style.width=i+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-r.gutterTotalWidth+"px"))}function M(e){var t=e.display,n=Ut(e.doc.sel.from,e.doc.sel.to);if(n||e.options.showCursorWhenSelecting?D(e):t.cursor.style.display=t.otherCursor.style.display="none",n?t.selectionDiv.style.display="none":N(e),e.options.moveInputWithCursor){var r=Q(e,e.doc.sel.head,"div"),i=si(t.wrapper),o=si(t.lineDiv);t.inputDiv.style.top=Math.max(0,Math.min(t.wrapper.clientHeight-10,r.top+o.top-i.top))+"px",t.inputDiv.style.left=Math.max(0,Math.min(t.wrapper.clientWidth-10,r.left+o.left-i.left))+"px"}}function D(e){var t=e.display,n=Q(e,e.doc.sel.head,"div");t.cursor.style.left=n.left+"px",t.cursor.style.top=n.top+"px",t.cursor.style.height=Math.max(0,n.bottom-n.top)*e.options.cursorHeight+"px",t.cursor.style.display="",n.other?(t.otherCursor.style.display="",t.otherCursor.style.left=n.other.left+"px",t.otherCursor.style.top=n.other.top+"px",t.otherCursor.style.height=.85*(n.other.bottom-n.other.top)+"px"):t.otherCursor.style.display="none"}function N(e){function t(e,t,n,r){0>t&&(t=0),a.appendChild(ri("div",null,"CodeMirror-selected","position: absolute; left: "+e+"px; top: "+t+"px; width: "+(null==n?s-e:n)+"px; height: "+(r-t)+"px"))}function n(n,r,o){function a(t,r){return J(e,qt(n,t),"div",d,r)}var c,u,d=dr(i,n),h=d.text.length;return di(br(d),r||0,null==o?h:o,function(e,n,i){var d,p,f,g=a(e,"left");if(e==n)d=g,p=f=g.left;else{if(d=a(n-1,"right"),"rtl"==i){var m=g;g=d,d=m}p=g.left,f=d.right}null==r&&0==e&&(p=l),d.top-g.top>3&&(t(p,g.top,null,g.bottom),p=l,g.bottomu.bottom||d.bottom==u.bottom&&d.right>u.right)&&(u=d),l+1>p&&(p=l),t(p,d.top,f-p,d.bottom)}),{start:c,end:u}}var r=e.display,i=e.doc,o=e.doc.sel,a=document.createDocumentFragment(),s=r.lineSpace.offsetWidth,l=H(e.display);if(o.from.line==o.to.line)n(o.from.line,o.from.ch,o.to.ch);else{var c=dr(i,o.from.line),u=dr(i,o.to.line),d=Rn(i,c)==Rn(i,u),h=n(o.from.line,o.from.ch,d?c.text.length:null).end,p=n(o.to.line,d?0:null,o.to.ch).start;d&&(h.top=e.display.showingTo)){var n,r=+new Date+e.options.workTime,i=vn(t.mode,O(e,t.frontier)),o=[];t.iter(t.frontier,Math.min(t.first+t.size,e.display.showingTo+500),function(a){if(t.frontier>=e.display.showingFrom){var s=a.styles;a.styles=Jn(e,a,i);for(var l=!s||s.length!=a.styles.length,c=0;!l&&s.length>c;++c)l=s[c]!=a.styles[c];l&&(n&&n.end==t.frontier?n.end++:o.push(n={start:t.frontier,end:t.frontier+1})),a.stateAfter=vn(t.mode,i)}else Xn(e,a,i),a.stateAfter=0==t.frontier%5?vn(t.mode,i):null;return++t.frontier,+new Date>r?(E(e,e.options.workDelay),!0):void 0}),o.length&&ot(e,function(){for(var e=0;o.length>e;++e)lt(this,o[e].start,o[e].end)})()}}function F(e,t,n){for(var r,i,o=e.doc,a=t,s=t-100;a>s;--a){if(o.first>=a)return o.first;var l=dr(o,a-1);if(l.stateAfter&&(!n||o.frontier>=a))return a;var c=Yr(l.text,null,e.options.tabSize);(null==i||r>c)&&(i=a-1,r=c)}return i}function O(e,t,n){var r=e.doc,i=e.display;if(!r.mode.startState)return!0;var o=F(e,t,n),a=o>r.first&&dr(r,o-1).stateAfter;return a=a?vn(r.mode,a):bn(r.mode),r.iter(o,t,function(n){Xn(e,n,a);var s=o==t-1||0==o%5||o>=i.showingFrom&&i.showingTo>o;n.stateAfter=s?vn(r.mode,a):null,++o}),a}function z(e){return e.lineSpace.offsetTop}function I(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function H(e){var t=oi(e.measure,ri("pre",null,null,"text-align: left")).appendChild(ri("span","x"));return t.offsetLeft}function R(e,t,n,r,i){var o=-1;r=r||W(e,t);for(var a=n;;a+=o){var s=r[a];if(s)break;0>o&&0==a&&(o=1)}return i=a>n?"left":n>a?"right":i,"left"==i&&s.leftSide?s=s.leftSide:"right"==i&&s.rightSide&&(s=s.rightSide),{left:n>a?s.right:s.left,right:a>n?s.left:s.right,top:s.top,bottom:s.bottom}}function j(e,t){for(var n=e.display.measureLineCache,r=0;n.length>r;++r){var i=n[r];if(i.text==t.text&&i.markedSpans==t.markedSpans&&e.display.scroller.clientWidth==i.width&&i.classes==t.textClass+"|"+t.bgClass+"|"+t.wrapClass)return i}}function P(e,t){var n=j(e,t);n&&(n.text=n.measure=n.markedSpans=null)}function W(e,t){var n=j(e,t);if(n)return n.measure;var r=B(e,t),i=e.display.measureLineCache,o={text:t.text,width:e.display.scroller.clientWidth,markedSpans:t.markedSpans,measure:r,classes:t.textClass+"|"+t.bgClass+"|"+t.wrapClass};return 16==i.length?i[++e.display.measureLineCachePos%16]=o:i.push(o),r}function B(e,t){function n(e){var t=e.top-f.top,n=e.bottom-f.top;n>v&&(n=v),0>t&&(t=0);for(var r=g.length-2;r>=0;r-=2){var i=g[r],o=g[r+1];if(!(i>n||t>o)&&(t>=i&&o>=n||i>=t&&n>=o||Math.min(n,o)-Math.max(t,i)>=n-t>>1)){g[r]=Math.min(t,i),g[r+1]=Math.max(n,o);break}}return 0>r&&(r=g.length,g.push(t,n)),{left:e.left-f.left,right:e.right-f.left,top:r,bottom:null}}function r(e){e.bottom=g[e.top+1],e.top=g[e.top]}var i=e.display,o=Zr(t.text.length),a=er(e,t,o,!0);if(ki&&!$i&&!e.options.lineWrapping&&a.childNodes.length>100){for(var s=document.createDocumentFragment(),l=10,c=a.childNodes.length,u=0,d=Math.ceil(c/l);d>u;++u){for(var h=ri("div",null,null,"display: inline-block"),p=0;l>p&&c;++p)h.appendChild(a.firstChild),--c;s.appendChild(h)}a.appendChild(s)}oi(i.measure,a);var f=si(i.lineDiv),g=[],m=Zr(t.text.length),v=a.offsetHeight;_i&&i.measure.first!=a&&oi(i.measure,a);for(var b,u=0;o.length>u;++u)if(b=o[u]){var y=b,x=null;if(/\bCodeMirror-widget\b/.test(b.className)&&b.getClientRects){1==b.firstChild.nodeType&&(y=b.firstChild);var w=y.getClientRects();w.length>1&&(x=m[u]=n(w[0]),x.rightSide=n(w[w.length-1]))}x||(x=m[u]=n(si(y))),b.measureRight&&(x.right=si(b.measureRight).left),b.leftSide&&(x.leftSide=n(si(b.leftSide)))}for(var b,u=0;m.length>u;++u)(b=m[u])&&(r(b),b.leftSide&&r(b.leftSide),b.rightSide&&r(b.rightSide));return m}function q(e,t){var n=!1;if(t.markedSpans)for(var r=0;t.markedSpans>r;++r){var i=t.markedSpans[r];!i.collapsed||null!=i.to&&i.to!=t.text.length||(n=!0)}var o=!n&&j(e,t);if(o)return R(e,t,t.text.length,o.measure,"right").right;var a=er(e,t,null,!0),s=a.appendChild(ui(e.display.measure));return oi(e.display.measure,a),si(s).right-si(e.display.lineDiv).left}function U(e){e.display.measureLineCache.length=e.display.measureLineCachePos=0,e.display.cachedCharWidth=e.display.cachedTextHeight=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function Y(){return window.pageXOffset||(document.documentElement||document.body).scrollLeft}function G(){return window.pageYOffset||(document.documentElement||document.body).scrollTop}function V(e,t,n,r){if(t.widgets)for(var i=0;t.widgets.length>i;++i)if(t.widgets[i].above){var o=Un(t.widgets[i]);n.top+=o,n.bottom+=o}if("line"==r)return n;r||(r="local");var a=vr(e,t);if("local"==r?a+=z(e.display):a-=e.display.viewOffset,"page"==r||"window"==r){var s=si(e.display.lineSpace);a+=s.top+("window"==r?0:G());var l=s.left+("window"==r?0:Y());n.left+=l,n.right+=l}return n.top+=a,n.bottom+=a,n}function K(e,t,n){if("div"==n)return t;var r=t.left,i=t.top;if("page"==n)r-=Y(),i-=G();else if("local"==n||!n){var o=si(e.display.sizer);r+=o.left,i+=o.top}var a=si(e.display.lineSpace);return{left:r-a.left,top:i-a.top}}function J(e,t,n,r,i){return r||(r=dr(e.doc,t.line)),V(e,r,R(e,r,t.ch,null,i),n)}function Q(e,t,n,r,i){function o(t,o){var a=R(e,r,t,i,o?"right":"left");return o?a.left=a.right:a.right=a.left,V(e,r,a,n)}function a(e,t){var n=s[t],r=n.level%2;return e==hi(n)&&t&&n.levelt&&n.leveln.from?o(e-1):o(e,r)}r=r||dr(e.doc,t.line),i||(i=W(e,r));var s=br(r),l=t.ch;if(!s)return o(l);var c=yi(s,l),u=a(l,c);return null!=Oo&&(u.other=a(l,Oo)),u}function X(e,t,n,r){var i=new qt(e,t);return i.xRel=r,n&&(i.outside=!0),i}function Z(e,t,n){var r=e.doc;if(n+=e.display.viewOffset,0>n)return X(r.first,0,!0,-1);var i=mr(r,n),o=r.first+r.size-1;if(i>o)return X(r.first+r.size-1,dr(r,o).text.length,!0,1);for(0>t&&(t=0);;){var a=dr(r,i),s=et(e,a,i,t,n),l=Hn(a),c=l&&l.find();if(!l||!(s.ch>c.from.ch||s.ch==c.from.ch&&s.xRel>0))return s;i=c.to.line}}function et(e,t,n,r,i){function o(r){var i=Q(e,qt(n,r),"line",t,c);return s=!0,a>i.bottom?i.left-l:i.top>a?i.left+l:(s=!1,i.left)}var a=i-vr(e,t),s=!1,l=2*e.display.wrapper.clientWidth,c=W(e,t),u=br(t),d=t.text.length,h=fi(t),p=gi(t),f=o(h),g=s,m=o(p),v=s;if(r>m)return X(n,p,v,1);for(;;){if(u?p==h||p==wi(t,h,1):1>=p-h){for(var b=f>r||m-r>=r-f?h:p,y=r-(b==h?f:m);To.test(t.text.charAt(b));)++b;var x=X(n,b,b==h?g:v,0>y?-1:y?1:0);return x}var w=Math.ceil(d/2),C=h+w;if(u){C=h;for(var S=0;w>S;++S)C=wi(t,C,1)}var k=o(C);k>r?(p=C,m=k,(v=s)&&(m+=1e3),d=w):(h=C,f=k,g=s,d-=w)}}function tt(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==Pi){Pi=ri("pre");for(var t=0;49>t;++t)Pi.appendChild(document.createTextNode("x")),Pi.appendChild(ri("br"));Pi.appendChild(document.createTextNode("x"))}oi(e.measure,Pi);var n=Pi.offsetHeight/50;return n>3&&(e.cachedTextHeight=n),ii(e.measure),n||1}function nt(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=ri("span","x"),n=ri("pre",[t]);oi(e.measure,n);var r=t.offsetWidth;return r>2&&(e.cachedCharWidth=r),r||10}function rt(e){e.curOp={changes:[],forceUpdate:!1,updateInput:null,userSelChange:null,textChanged:null,selectionChanged:!1,cursorActivity:!1,updateMaxLine:!1,updateScrollPos:!1,id:++Vi},Co++||(wo=[])}function it(e){var t=e.curOp,n=e.doc,r=e.display;if(e.curOp=null,t.updateMaxLine&&d(e),r.maxLineChanged&&!e.options.lineWrapping&&r.maxLine){var i=q(e,r.maxLine);r.sizer.style.minWidth=Math.max(0,i+3+So)+"px",r.maxLineChanged=!1;var o=Math.max(0,r.sizer.offsetLeft+r.sizer.offsetWidth-r.scroller.clientWidth);n.scrollLeft>o&&!t.updateScrollPos&&St(e,Math.min(r.scroller.scrollLeft,o),!0)}var a,s;if(t.updateScrollPos)a=t.updateScrollPos;else if(t.selectionChanged&&r.scroller.clientHeight){var l=Q(e,n.sel.head);a=sn(e,l.left,l.top,l.left,l.bottom)}(t.changes.length||t.forceUpdate||a&&null!=a.scrollTop)&&(s=y(e,t.changes,a&&a.scrollTop,t.forceUpdate),e.display.scroller.offsetHeight&&(e.doc.scrollTop=e.display.scroller.scrollTop)),!s&&t.selectionChanged&&M(e),t.updateScrollPos?(r.scroller.scrollTop=r.scrollbarV.scrollTop=n.scrollTop=a.scrollTop,r.scroller.scrollLeft=r.scrollbarH.scrollLeft=n.scrollLeft=a.scrollLeft,g(e),t.scrollToPos&&on(e,Kt(e.doc,t.scrollToPos),t.scrollToPosMargin)):a&&rn(e),t.selectionChanged&&L(e),e.state.focused&&t.updateInput&&ht(e,t.userSelChange);var c=t.maybeHiddenMarkers,u=t.maybeUnhiddenMarkers;if(c)for(var h=0;c.length>h;++h)c[h].lines.length||Rr(c[h],"hide");if(u)for(var h=0;u.length>h;++h)u[h].lines.length&&Rr(u[h],"unhide");var p;if(--Co||(p=wo,wo=null),t.textChanged&&Rr(e,"change",e,t.textChanged),t.cursorActivity&&Rr(e,"cursorActivity",e),p)for(var h=0;p.length>h;++h)p[h]()}function ot(e,t){return function(){var n=e||this,r=!n.curOp;r&&rt(n);try{var i=t.apply(n,arguments)}finally{r&&it(n)}return i}}function at(e){return function(){var t,n=this.cm&&!this.cm.curOp;n&&rt(this.cm);try{t=e.apply(this,arguments)}finally{n&&it(this.cm)}return t}}function st(e,t){var n,r=!e.curOp;r&&rt(e);try{n=t()}finally{r&&it(e)}return n}function lt(e,t,n,r){null==t&&(t=e.doc.first),null==n&&(n=e.doc.first+e.doc.size),e.curOp.changes.push({from:t,to:n,diff:r})}function ct(e){e.display.pollingFast||e.display.poll.set(e.options.pollInterval,function(){dt(e),e.state.focused&&ct(e)})}function ut(e){function t(){var r=dt(e);r||n?(e.display.pollingFast=!1,ct(e)):(n=!0,e.display.poll.set(60,t))}var n=!1;e.display.pollingFast=!0,e.display.poll.set(20,t)}function dt(e){var t=e.display.input,n=e.display.prevInput,r=e.doc,i=r.sel;if(!e.state.focused||Eo(t)||ft(e)||e.state.disableInput)return!1;var o=t.value;if(o==n&&Ut(i.from,i.to))return!1;if(ki&&!_i&&e.display.inputHasSelection===o)return ht(e,!0),!1;var a=!e.curOp;a&&rt(e),i.shift=!1;for(var s=0,l=Math.min(n.length,o.length);l>s&&n.charCodeAt(s)==o.charCodeAt(s);)++s;var c=i.from,u=i.to;n.length>s?c=qt(c.line,c.ch-(n.length-s)):e.state.overwrite&&Ut(c,u)&&!e.state.pasteIncoming&&(u=qt(u.line,Math.min(dr(r,u.line).text.length,u.ch+(o.length-s))));var d=e.curOp.updateInput,h={from:c,to:u,text:Lo(o.slice(s)),origin:e.state.pasteIncoming?"paste":"+input"};return It(e.doc,h,"end"),e.curOp.updateInput=d,jr(e,"inputRead",e,h),o.length>1e3||o.indexOf("\n")>-1?t.value=e.display.prevInput="":e.display.prevInput=o,a&&it(e),e.state.pasteIncoming=!1,!0}function ht(e,t){var n,r,i=e.doc;if(Ut(i.sel.from,i.sel.to))t&&(e.display.prevInput=e.display.input.value="",ki&&!_i&&(e.display.inputHasSelection=null));else{e.display.prevInput="",n=Ao&&(i.sel.to.line-i.sel.from.line>100||(r=e.getSelection()).length>1e3);var o=n?"-":r||e.getSelection();e.display.input.value=o,e.state.focused&&Kr(e.display.input),ki&&!_i&&(e.display.inputHasSelection=o)}e.display.inaccurateSelection=n}function pt(e){"nocursor"==e.options.readOnly||Ii&&document.activeElement==e.display.input||e.display.input.focus()}function ft(e){return e.options.readOnly||e.doc.cantEdit}function gt(e){function t(){e.state.focused&&setTimeout(ei(pt,e),0)}function n(){null==s&&(s=setTimeout(function(){s=null,a.cachedCharWidth=a.cachedTextHeight=Do=null,U(e),st(e,ei(lt,e))},100))}function r(){for(var e=a.wrapper.parentNode;e&&e!=document.body;e=e.parentNode);e?setTimeout(r,5e3):Hr(window,"resize",n)}function i(t){Pr(e,t)||e.options.onDragEvent&&e.options.onDragEvent(e,Nr(t))||Fr(t)}function o(){a.inaccurateSelection&&(a.prevInput="",a.inaccurateSelection=!1,a.input.value=e.getSelection(),Kr(a.input))}var a=e.display;Ir(a.scroller,"mousedown",ot(e,bt)),ki?Ir(a.scroller,"dblclick",ot(e,function(t){if(!Pr(e,t)){var n=vt(e,t);if(n&&!yt(e,t)&&!mt(e.display,t)){Lr(t);var r=fn(dr(e.doc,n.line).text,n);Xt(e.doc,r.from,r.to)}}})):Ir(a.scroller,"dblclick",function(t){Pr(e,t)||Lr(t)}),Ir(a.lineSpace,"selectstart",function(e){mt(a,e)||Lr(e)}),Ui||Ir(a.scroller,"contextmenu",function(t){At(e,t)}),Ir(a.scroller,"scroll",function(){a.scroller.clientHeight&&(Ct(e,a.scroller.scrollTop),St(e,a.scroller.scrollLeft,!0),Rr(e,"scroll",e))}),Ir(a.scrollbarV,"scroll",function(){a.scroller.clientHeight&&Ct(e,a.scrollbarV.scrollTop)}),Ir(a.scrollbarH,"scroll",function(){a.scroller.clientHeight&&St(e,a.scrollbarH.scrollLeft)}),Ir(a.scroller,"mousewheel",function(t){kt(e,t)}),Ir(a.scroller,"DOMMouseScroll",function(t){kt(e,t)}),Ir(a.scrollbarH,"mousedown",t),Ir(a.scrollbarV,"mousedown",t),Ir(a.wrapper,"scroll",function(){a.wrapper.scrollTop=a.wrapper.scrollLeft=0});var s;Ir(window,"resize",n),setTimeout(r,5e3),Ir(a.input,"keyup",ot(e,function(t){Pr(e,t)||e.options.onKeyEvent&&e.options.onKeyEvent(e,Nr(t))||16==t.keyCode&&(e.doc.sel.shift=!1)})),Ir(a.input,"input",ei(ut,e)),Ir(a.input,"keydown",ot(e,Dt)),Ir(a.input,"keypress",ot(e,Nt)),Ir(a.input,"focus",ei(Lt,e)),Ir(a.input,"blur",ei(Et,e)),e.options.dragDrop&&(Ir(a.scroller,"dragstart",function(t){wt(e,t)}),Ir(a.scroller,"dragenter",i),Ir(a.scroller,"dragover",i),Ir(a.scroller,"drop",ot(e,xt))),Ir(a.scroller,"paste",function(t){mt(a,t)||(pt(e),ut(e))}),Ir(a.input,"paste",function(){e.state.pasteIncoming=!0,ut(e)}),Ir(a.input,"cut",o),Ir(a.input,"copy",o),Ei&&Ir(a.sizer,"mouseup",function(){document.activeElement==a.input&&a.input.blur(),pt(e)})}function mt(e,t){for(var n=Or(t);n!=e.wrapper;n=n.parentNode)if(!n||n.ignoreEvents||n.parentNode==e.sizer&&n!=e.mover)return!0}function vt(e,t,n){var r=e.display;if(!n){var i=Or(t);if(i==r.scrollbarH||i==r.scrollbarH.firstChild||i==r.scrollbarV||i==r.scrollbarV.firstChild||i==r.scrollbarFiller||i==r.gutterFiller)return null}var o,a,s=si(r.lineSpace);try{o=t.clientX,a=t.clientY}catch(t){return null}return Z(e,o-s.left,a-s.top)}function bt(e){function t(e){if(!Ut(v,e)){if(v=e,"single"==u)return Xt(i.doc,Kt(a,l),e),void 0;if(g=Kt(a,g),m=Kt(a,m),"double"==u){var t=fn(dr(a,e.line).text,e);Yt(e,g)?Xt(i.doc,t.from,m):Xt(i.doc,g,t.to)}else"triple"==u&&(Yt(e,g)?Xt(i.doc,m,Kt(a,qt(e.line,0))):Xt(i.doc,g,Kt(a,qt(e.line+1,0))))}}function n(e){var r=++y,s=vt(i,e,!0);if(s)if(Ut(s,h)){var l=e.clientYb.bottom?20:0;l&&setTimeout(ot(i,function(){y==r&&(o.scroller.scrollTop+=l,n(e))}),50)}else{i.state.focused||Lt(i),h=s,t(s);var c=f(o,a);(s.line>=c.to||s.linec-400&&Ut(Bi.pos,l))u="triple",Lr(e),setTimeout(ei(pt,i),20),gn(i,l.line);else if(Wi&&Wi.time>c-400&&Ut(Wi.pos,l)){u="double",Bi={time:c,pos:l},Lr(e);var d=fn(dr(a,l.line).text,l);Xt(i.doc,d.from,d.to)}else Wi={time:c,pos:l};var h=l;if(i.options.dragDrop&&Mo&&!ft(i)&&!Ut(s.from,s.to)&&!Yt(l,s.from)&&!Yt(s.to,l)&&"single"==u){var p=ot(i,function(t){Ti&&(o.scroller.draggable=!1),i.state.draggingText=!1,Hr(document,"mouseup",p),Hr(o.scroller,"drop",p),10>Math.abs(e.clientX-t.clientX)+Math.abs(e.clientY-t.clientY)&&(Lr(t),Xt(i.doc,l),pt(i))});return Ti&&(o.scroller.draggable=!0),i.state.draggingText=p,o.scroller.dragDrop&&o.scroller.dragDrop(),Ir(document,"mouseup",p),Ir(o.scroller,"drop",p),void 0}Lr(e),"single"==u&&Xt(i.doc,Kt(a,l));var g=s.from,m=s.to,v=l,b=si(o.wrapper),y=0,x=ot(i,function(e){ki||zr(e)?n(e):r(e)}),w=ot(i,r);Ir(document,"mousemove",x),Ir(document,"mouseup",w)}}}function yt(e,t){var n=e.display;try{var r=t.clientX,i=t.clientY}catch(t){return!1}if(r>=Math.floor(si(n.gutters).right))return!1;if(Lr(t),!Br(e,"gutterClick"))return!0;var o=si(n.lineDiv);if(i>o.bottom)return!0;i-=o.top-n.viewOffset;for(var a=0;e.options.gutters.length>a;++a){var s=n.gutters.childNodes[a];if(s&&si(s).right>=r){var l=mr(e.doc,i),c=e.options.gutters[a];jr(e,"gutterClick",e,l,c,t);break}}return!0}function xt(e){var t=this;if(!(Pr(t,e)||mt(t.display,e)||t.options.onDragEvent&&t.options.onDragEvent(t,Nr(e)))){Lr(e),ki&&(Ki=+new Date);var n=vt(t,e,!0),r=e.dataTransfer.files;if(n&&!ft(t))if(r&&r.length&&window.FileReader&&window.File)for(var i=r.length,o=Array(i),a=0,s=function(e,r){var s=new FileReader;s.onload=function(){o[r]=s.result,++a==i&&(n=Kt(t.doc,n),It(t.doc,{from:n,to:n,text:Lo(o.join("\n")),origin:"paste"},"around"))},s.readAsText(e)},l=0;i>l;++l)s(r[l],l);else{if(t.state.draggingText&&!Yt(n,t.doc.sel.from)&&!Yt(t.doc.sel.to,n))return t.state.draggingText(e),setTimeout(ei(pt,t),20),void 0;try{var o=e.dataTransfer.getData("Text");if(o){var c=t.doc.sel.from,u=t.doc.sel.to;en(t.doc,n,n),t.state.draggingText&&Bt(t.doc,"",c,u,"paste"),t.replaceSelection(o,null,"paste"),pt(t),Lt(t)}}catch(e){}}}}function wt(e,t){if(ki&&(!e.state.draggingText||100>+new Date-Ki))return Fr(t),void 0;if(!Pr(e,t)&&!mt(e.display,t)){var n=e.getSelection();if(t.dataTransfer.setData("Text",n),t.dataTransfer.setDragImage&&!Li){var r=ri("img",null,null,"position: fixed; left: 0; top: 0;");Ni&&(r.width=r.height=1,e.display.wrapper.appendChild(r),r._top=r.offsetTop),t.dataTransfer.setDragImage(r,0,0),Ni&&r.parentNode.removeChild(r)}}}function Ct(e,t){2>Math.abs(e.doc.scrollTop-t)||(e.doc.scrollTop=t,Si||y(e,[],t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t),e.display.scrollbarV.scrollTop!=t&&(e.display.scrollbarV.scrollTop=t),Si&&y(e,[]),E(e,100))}function St(e,t,n){(n?t==e.doc.scrollLeft:2>Math.abs(e.doc.scrollLeft-t))||(t=Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth),e.doc.scrollLeft=t,g(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbarH.scrollLeft!=t&&(e.display.scrollbarH.scrollLeft=t))}function kt(e,t){var n=t.wheelDeltaX,r=t.wheelDeltaY;null==n&&t.detail&&t.axis==t.HORIZONTAL_AXIS&&(n=t.detail),null==r&&t.detail&&t.axis==t.VERTICAL_AXIS?r=t.detail:null==r&&(r=t.wheelDelta);var i=e.display,o=i.scroller;if(n&&o.scrollWidth>o.clientWidth||r&&o.scrollHeight>o.clientHeight){if(r&&Hi&&Ti)for(var a=t.target;a!=o;a=a.parentNode)if(a.lineObj){e.display.currentWheelTarget=a;break}if(n&&!Si&&!Ni&&null!=Qi)return r&&Ct(e,Math.max(0,Math.min(o.scrollTop+r*Qi,o.scrollHeight-o.clientHeight))),St(e,Math.max(0,Math.min(o.scrollLeft+n*Qi,o.scrollWidth-o.clientWidth))),Lr(t),i.wheelStartX=null,void 0;if(r&&null!=Qi){var s=r*Qi,l=e.doc.scrollTop,c=l+i.wrapper.clientHeight;0>s?l=Math.max(0,l+s-50):c=Math.min(e.doc.height,c+s+50),y(e,[],{top:l,bottom:c})}20>Ji&&(null==i.wheelStartX?(i.wheelStartX=o.scrollLeft,i.wheelStartY=o.scrollTop,i.wheelDX=n,i.wheelDY=r,setTimeout(function(){if(null!=i.wheelStartX){var e=o.scrollLeft-i.wheelStartX,t=o.scrollTop-i.wheelStartY,n=t&&i.wheelDY&&t/i.wheelDY||e&&i.wheelDX&&e/i.wheelDX;i.wheelStartX=i.wheelStartY=null,n&&(Qi=(Qi*Ji+n)/(Ji+1),++Ji)}},200)):(i.wheelDX+=n,i.wheelDY+=r))}}function $t(e,t,n){if("string"==typeof t&&(t=uo[t],!t))return!1;e.display.pollingFast&&dt(e)&&(e.display.pollingFast=!1);var r=e.doc,i=r.sel.shift,o=!1;try{ft(e)&&(e.state.suppressEdits=!0),n&&(r.sel.shift=!1),o=t(e)!=ko}finally{r.sel.shift=i,e.state.suppressEdits=!1}return o}function _t(e){var t=e.state.keyMaps.slice(0);return e.options.extraKeys&&t.push(e.options.extraKeys),t.push(e.options.keyMap),t}function Tt(e,t){var n=yn(e.options.keyMap),r=n.auto;clearTimeout(Xi),r&&!wn(t)&&(Xi=setTimeout(function(){yn(e.options.keyMap)==n&&(e.options.keyMap=r.call?r.call(null,e):r,a(e))},50));var i=Cn(t,!0),o=!1;if(!i)return!1;var s=_t(e);return o=t.shiftKey?xn("Shift-"+i,s,function(t){return $t(e,t,!0)})||xn(i,s,function(t){return("string"==typeof t?/^go[A-Z]/.test(t):t.motion)?$t(e,t):void 0}):xn(i,s,function(t){return $t(e,t)}),o&&(Lr(t),L(e),_i&&(t.oldKeyCode=t.keyCode,t.keyCode=0),jr(e,"keyHandled",e,i,t)),o}function Mt(e,t,n){var r=xn("'"+n+"'",_t(e),function(t){return $t(e,t,!0)});return r&&(Lr(t),L(e),jr(e,"keyHandled",e,"'"+n+"'",t)),r}function Dt(e){var t=this;if(t.state.focused||Lt(t),ki&&27==e.keyCode&&(e.returnValue=!1),!(Pr(t,e)||t.options.onKeyEvent&&t.options.onKeyEvent(t,Nr(e)))){var n=e.keyCode;t.doc.sel.shift=16==n||e.shiftKey;var r=Tt(t,e);Ni&&(eo=r?n:null,!r&&88==n&&!Ao&&(Hi?e.metaKey:e.ctrlKey)&&t.replaceSelection(""))}}function Nt(e){var t=this;if(!(Pr(t,e)||t.options.onKeyEvent&&t.options.onKeyEvent(t,Nr(e)))){var n=e.keyCode,r=e.charCode;if(Ni&&n==eo)return eo=null,Lr(e),void 0;if(!(Ni&&(!e.which||10>e.which)||Ei)||!Tt(t,e)){var i=String.fromCharCode(null==r?n:r);this.options.electricChars&&this.doc.mode.electricChars&&this.options.smartIndent&&!ft(this)&&this.doc.mode.electricChars.indexOf(i)>-1&&setTimeout(ot(t,function(){un(t,t.doc.sel.to.line,"smart")}),75),Mt(t,e,i)||(ki&&!_i&&(t.display.inputHasSelection=null),ut(t))}}}function Lt(e){"nocursor"!=e.options.readOnly&&(e.state.focused||(Rr(e,"focus",e),e.state.focused=!0,-1==e.display.wrapper.className.search(/\bCodeMirror-focused\b/)&&(e.display.wrapper.className+=" CodeMirror-focused"),ht(e,!0)),ct(e),L(e))}function Et(e){e.state.focused&&(Rr(e,"blur",e),e.state.focused=!1,e.display.wrapper.className=e.display.wrapper.className.replace(" CodeMirror-focused","")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.doc.sel.shift=!1)},150)}function At(e,t){function n(){if(null!=i.input.selectionStart){var e=i.input.value=" "+(Ut(o.from,o.to)?"":i.input.value);i.prevInput=" ",i.input.selectionStart=1,i.input.selectionEnd=e.length}}function r(){if(i.inputDiv.style.position="relative",i.input.style.cssText=l,_i&&(i.scrollbarV.scrollTop=i.scroller.scrollTop=s),ct(e),null!=i.input.selectionStart){(!ki||_i)&&n(),clearTimeout(Zi);var t=0,r=function(){" "==i.prevInput&&0==i.input.selectionStart?ot(e,uo.selectAll)(e):10>t++?Zi=setTimeout(r,500):ht(e)
-};Zi=setTimeout(r,200)}}if(!Pr(e,t,"contextmenu")){var i=e.display,o=e.doc.sel;if(!mt(i,t)){var a=vt(e,t),s=i.scroller.scrollTop;if(a&&!Ni){(Ut(o.from,o.to)||Yt(a,o.from)||!Yt(a,o.to))&&ot(e,en)(e.doc,a,a);var l=i.input.style.cssText;if(i.inputDiv.style.position="absolute",i.input.style.cssText="position: fixed; width: 30px; height: 30px; top: "+(t.clientY-5)+"px; left: "+(t.clientX-5)+"px; z-index: 1000; background: white; outline: none;"+"border-width: 0; outline: none; overflow: hidden; opacity: .05; -ms-opacity: .05; filter: alpha(opacity=5);",pt(e),ht(e,!0),Ut(o.from,o.to)&&(i.input.value=i.prevInput=" "),ki&&!_i&&n(),Ui){Fr(t);var c=function(){Hr(window,"mouseup",c),setTimeout(r,20)};Ir(window,"mouseup",c)}else setTimeout(r,50)}}}}function Ft(e,t,n){if(!Yt(t.from,n))return Kt(e,n);var r=t.text.length-1-(t.to.line-t.from.line);if(n.line>t.to.line+r){var i=n.line-r,o=e.first+e.size-1;return i>o?qt(o,dr(e,o).text.length):Jt(n,dr(e,i).text.length)}if(n.line==t.to.line+r)return Jt(n,Vr(t.text).length+(1==t.text.length?t.from.ch:0)+dr(e,t.to.line).text.length-t.to.ch);var a=n.line-t.from.line;return Jt(n,t.text[a].length+(a?0:t.from.ch))}function Ot(e,t,n){if(n&&"object"==typeof n)return{anchor:Ft(e,t,n.anchor),head:Ft(e,t,n.head)};if("start"==n)return{anchor:t.from,head:t.from};var r=to(t);if("around"==n)return{anchor:t.from,head:r};if("end"==n)return{anchor:r,head:r};var i=function(e){if(Yt(e,t.from))return e;if(!Yt(t.to,e))return r;var n=e.line+t.text.length-(t.to.line-t.from.line)-1,i=e.ch;return e.line==t.to.line&&(i+=r.ch-t.to.ch),qt(n,i)};return{anchor:i(e.sel.anchor),head:i(e.sel.head)}}function zt(e,t,n){var r={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){this.canceled=!0}};return n&&(r.update=function(t,n,r,i){t&&(this.from=Kt(e,t)),n&&(this.to=Kt(e,n)),r&&(this.text=r),void 0!==i&&(this.origin=i)}),Rr(e,"beforeChange",e,r),e.cm&&Rr(e.cm,"beforeChange",e.cm,r),r.canceled?null:{from:r.from,to:r.to,text:r.text,origin:r.origin}}function It(e,t,n,r){if(e.cm){if(!e.cm.curOp)return ot(e.cm,It)(e,t,n,r);if(e.cm.state.suppressEdits)return}if(!(Br(e,"beforeChange")||e.cm&&Br(e.cm,"beforeChange"))||(t=zt(e,t,!0))){var i=Yi&&!r&&On(e,t.from,t.to);if(i){for(var o=i.length-1;o>=1;--o)Ht(e,{from:i[o].from,to:i[o].to,text:[""]});i.length&&Ht(e,{from:i[0].from,to:i[0].to,text:t.text},n)}else Ht(e,t,n)}}function Ht(e,t,n){var r=Ot(e,t,n);Cr(e,t,r,e.cm?e.cm.curOp.id:0/0),Pt(e,t,r,An(e,t));var i=[];cr(e,function(e,n){n||-1!=Jr(i,e.history)||(Mr(e.history,t),i.push(e.history)),Pt(e,t,null,An(e,t))})}function Rt(e,t){if(!e.cm||!e.cm.state.suppressEdits){var n=e.history,r=("undo"==t?n.done:n.undone).pop();if(r){var i={changes:[],anchorBefore:r.anchorAfter,headBefore:r.headAfter,anchorAfter:r.anchorBefore,headAfter:r.headBefore,generation:n.generation};("undo"==t?n.undone:n.done).push(i),n.generation=r.generation||++n.maxGeneration;for(var o=Br(e,"beforeChange")||e.cm&&Br(e.cm,"beforeChange"),a=r.changes.length-1;a>=0;--a){var s=r.changes[a];if(s.origin=t,o&&!zt(e,s,!1))return("undo"==t?n.done:n.undone).length=0,void 0;i.changes.push(wr(e,s));var l=a?Ot(e,s,null):{anchor:r.anchorBefore,head:r.headBefore};Pt(e,s,l,Fn(e,s));var c=[];cr(e,function(e,t){t||-1!=Jr(c,e.history)||(Mr(e.history,s),c.push(e.history)),Pt(e,s,null,Fn(e,s))})}}}}function jt(e,t){function n(e){return qt(e.line+t,e.ch)}e.first+=t,e.cm&<(e.cm,e.first,e.first,t),e.sel.head=n(e.sel.head),e.sel.anchor=n(e.sel.anchor),e.sel.from=n(e.sel.from),e.sel.to=n(e.sel.to)}function Pt(e,t,n,r){if(e.cm&&!e.cm.curOp)return ot(e.cm,Pt)(e,t,n,r);if(t.to.linee.lastLine())){if(t.from.lineo&&(t={from:t.from,to:qt(o,dr(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=hr(e,t.from,t.to),n||(n=Ot(e,t,null)),e.cm?Wt(e.cm,t,r,n):ar(e,t,r,n)}}function Wt(e,t,n,r){var o=e.doc,a=e.display,s=t.from,l=t.to,c=!1,d=s.line;e.options.lineWrapping||(d=gr(Rn(o,dr(o,s.line))),o.iter(d,l.line+1,function(e){return e==a.maxLine?(c=!0,!0):void 0})),Yt(o.sel.head,t.from)||Yt(t.to,o.sel.head)||(e.curOp.cursorActivity=!0),ar(o,t,n,r,i(e)),e.options.lineWrapping||(o.iter(d,s.line+t.text.length,function(e){var t=u(o,e);t>a.maxLineLength&&(a.maxLine=e,a.maxLineLength=t,a.maxLineChanged=!0,c=!1)}),c&&(e.curOp.updateMaxLine=!0)),o.frontier=Math.min(o.frontier,s.line),E(e,400);var h=t.text.length-(l.line-s.line)-1;if(lt(e,s.line,l.line+1,h),Br(e,"change")){var p={from:s,to:l,text:t.text,removed:t.removed,origin:t.origin};if(e.curOp.textChanged){for(var f=e.curOp.textChanged;f.next;f=f.next);f.next=p}else e.curOp.textChanged=p}}function Bt(e,t,n,r,i){if(r||(r=n),Yt(r,n)){var o=r;r=n,n=o}"string"==typeof t&&(t=Lo(t)),It(e,{from:n,to:r,text:t,origin:i},null)}function qt(e,t){return this instanceof qt?(this.line=e,this.ch=t,void 0):new qt(e,t)}function Ut(e,t){return e.line==t.line&&e.ch==t.ch}function Yt(e,t){return e.linen?qt(n,dr(e,n).text.length):Jt(t,dr(e,t.line).text.length)}function Jt(e,t){var n=e.ch;return null==n||n>t?qt(e.line,t):0>n?qt(e.line,0):e}function Qt(e,t){return t>=e.first&&e.first+e.size>t}function Xt(e,t,n,r){if(e.sel.shift||e.sel.extend){var i=e.sel.anchor;if(n){var o=Yt(t,i);o!=Yt(n,i)?(i=t,t=n):o!=Yt(t,n)&&(t=n)}en(e,i,t,r)}else en(e,t,n||t,r);e.cm&&(e.cm.curOp.userSelChange=!0)}function Zt(e,t,n){var r={anchor:t,head:n};return Rr(e,"beforeSelectionChange",e,r),e.cm&&Rr(e.cm,"beforeSelectionChange",e.cm,r),r.anchor=Kt(e,r.anchor),r.head=Kt(e,r.head),r}function en(e,t,n,r,i){if(!i&&Br(e,"beforeSelectionChange")||e.cm&&Br(e.cm,"beforeSelectionChange")){var o=Zt(e,t,n);n=o.head,t=o.anchor}var a=e.sel;if(a.goalColumn=null,(i||!Ut(t,a.anchor))&&(t=nn(e,t,r,"push"!=i)),(i||!Ut(n,a.head))&&(n=nn(e,n,r,"push"!=i)),!Ut(a.anchor,t)||!Ut(a.head,n)){a.anchor=t,a.head=n;var s=Yt(n,t);a.from=s?n:t,a.to=s?t:n,e.cm&&(e.cm.curOp.updateInput=e.cm.curOp.selectionChanged=e.cm.curOp.cursorActivity=!0),jr(e,"cursorActivity",e)}}function tn(e){en(e.doc,e.doc.sel.from,e.doc.sel.to,null,"push")}function nn(e,t,n,r){var i=!1,o=t,a=n||1;e.cantEdit=!1;e:for(;;){var s=dr(e,o.line);if(s.markedSpans)for(var l=0;s.markedSpans.length>l;++l){var c=s.markedSpans[l],u=c.marker;if((null==c.from||(u.inclusiveLeft?c.from<=o.ch:c.from=o.ch:c.to>o.ch))){if(r&&(Rr(u,"beforeCursorEnter"),u.explicitlyCleared)){if(s.markedSpans){--l;continue}break}if(!u.atomic)continue;var d=u.find()[0>a?"from":"to"];if(Ut(d,o)&&(d.ch+=a,0>d.ch?d=d.line>e.first?Kt(e,qt(d.line-1)):null:d.ch>s.text.length&&(d=d.linet.top+r.top?i=!0:t.bottom+r.top>(window.innerHeight||document.documentElement.clientHeight)&&(i=!1),null!=i&&!Oi){var o="none"==n.cursor.style.display;o&&(n.cursor.style.display="",n.cursor.style.left=t.left+"px",n.cursor.style.top=t.top-n.viewOffset+"px"),n.cursor.scrollIntoView(i),o&&(n.cursor.style.display="none")}}}function on(e,t,n){for(null==n&&(n=0);;){var r=!1,i=Q(e,t),o=sn(e,i.left,i.top-n,i.left,i.bottom+n),a=e.doc.scrollTop,s=e.doc.scrollLeft;if(null!=o.scrollTop&&(Ct(e,o.scrollTop),Math.abs(e.doc.scrollTop-a)>1&&(r=!0)),null!=o.scrollLeft&&(St(e,o.scrollLeft),Math.abs(e.doc.scrollLeft-s)>1&&(r=!0)),!r)return i}}function an(e,t,n,r,i){var o=sn(e,t,n,r,i);null!=o.scrollTop&&Ct(e,o.scrollTop),null!=o.scrollLeft&&St(e,o.scrollLeft)}function sn(e,t,n,r,i){var o=e.display,a=tt(e.display);0>n&&(n=0);var s=o.scroller.clientHeight-So,l=o.scroller.scrollTop,c={},u=e.doc.height+I(o),d=a>n,h=i>u-a;if(l>n)c.scrollTop=d?0:n;else if(i>l+s){var p=Math.min(n,(h?u:i)-s);p!=l&&(c.scrollTop=p)}var f=o.scroller.clientWidth-So,g=o.scroller.scrollLeft;t+=o.gutters.offsetWidth,r+=o.gutters.offsetWidth;var m=o.gutters.offsetWidth,v=m+10>t;return g+m>t||v?(v&&(t=0),c.scrollLeft=Math.max(0,t-10-m)):r>f+g-3&&(c.scrollLeft=r+10-f),c}function ln(e,t,n){e.curOp.updateScrollPos={scrollLeft:null==t?e.doc.scrollLeft:t,scrollTop:null==n?e.doc.scrollTop:n}}function cn(e,t,n){var r=e.curOp.updateScrollPos||(e.curOp.updateScrollPos={scrollLeft:e.doc.scrollLeft,scrollTop:e.doc.scrollTop}),i=e.display.scroller;r.scrollTop=Math.max(0,Math.min(i.scrollHeight-i.clientHeight,r.scrollTop+n)),r.scrollLeft=Math.max(0,Math.min(i.scrollWidth-i.clientWidth,r.scrollLeft+t))}function un(e,t,n,r){var i=e.doc;if(null==n&&(n="add"),"smart"==n)if(e.doc.mode.indent)var o=O(e,t);else n="prev";var a,s=e.options.tabSize,l=dr(i,t),c=Yr(l.text,null,s),u=l.text.match(/^\s*/)[0];if("smart"==n&&(a=e.doc.mode.indent(o,l.text.slice(u.length),l.text),a==ko)){if(!r)return;n="prev"}"prev"==n?a=t>i.first?Yr(dr(i,t-1).text,null,s):0:"add"==n?a=c+e.options.indentUnit:"subtract"==n?a=c-e.options.indentUnit:"number"==typeof n&&(a=c+n),a=Math.max(0,a);var d="",h=0;if(e.options.indentWithTabs)for(var p=Math.floor(a/s);p;--p)h+=s,d+=" ";a>h&&(d+=Gr(a-h)),d!=u&&Bt(e.doc,d,qt(t,0),qt(t,u.length),"+input"),l.stateAfter=null}function dn(e,t,n){var r=t,i=t,o=e.doc;return"number"==typeof t?i=dr(o,Vt(o,t)):r=gr(t),null==r?null:n(i,r)?(lt(e,r,r+1),i):null}function hn(e,t,n,r,i){function o(){var t=s+n;return e.first>t||t>=e.first+e.size?d=!1:(s=t,u=dr(e,t))}function a(e){var t=(i?wi:Ci)(u,l,n,!0);if(null==t){if(e||!o())return d=!1;l=i?(0>n?gi:fi)(u):0>n?u.text.length:0}else l=t;return!0}var s=t.line,l=t.ch,c=n,u=dr(e,s),d=!0;if("char"==r)a();else if("column"==r)a(!0);else if("word"==r||"group"==r)for(var h=null,p="group"==r,f=!0;!(0>n)||a(!f);f=!1){var g=u.text.charAt(l)||"\n",m=ti(g)?"w":p?/\s/.test(g)?null:"p":null;if(h&&h!=m){0>n&&(n=1,a());break}if(m&&(h=m),n>0&&!a(!f))break}var v=nn(e,qt(s,l),c,!0);return d||(v.hitSide=!0),v}function pn(e,t,n,r){var i,o=e.doc,a=t.left;if("page"==r){var s=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight);i=t.top+n*(s-(0>n?1.5:.5)*tt(e.display))}else"line"==r&&(i=n>0?t.bottom+3:t.top-3);for(;;){var l=Z(e,a,i);if(!l.outside)break;if(0>n?0>=i:i>=o.height){l.hitSide=!0;break}i+=5*n}return l}function fn(e,t){var n=t.ch,r=t.ch;if(e){(0>t.xRel||r==e.length)&&n?--n:++r;for(var i=e.charAt(n),o=ti(i)?ti:/\s/.test(i)?function(e){return/\s/.test(e)}:function(e){return!/\s/.test(e)&&!ti(e)};n>0&&o(e.charAt(n-1));)--n;for(;e.length>r&&o(e.charAt(r));)++r}return{from:qt(t.line,n),to:qt(t.line,r)}}function gn(e,t){Xt(e.doc,qt(t,0),Kt(e.doc,qt(t+1,0)))}function mn(t,n,r,i){e.defaults[t]=n,r&&(no[t]=i?function(e,t,n){n!=io&&r(e,t,n)}:r)}function vn(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var n={};for(var r in t){var i=t[r];i instanceof Array&&(i=i.concat([])),n[r]=i}return n}function bn(e,t,n){return e.startState?e.startState(t,n):!0}function yn(e){return"string"==typeof e?ho[e]:e}function xn(e,t,n){function r(t){t=yn(t);var i=t[e];if(i===!1)return"stop";if(null!=i&&n(i))return!0;if(t.nofallthrough)return"stop";var o=t.fallthrough;if(null==o)return!1;if("[object Array]"!=Object.prototype.toString.call(o))return r(o);for(var a=0,s=o.length;s>a;++a){var l=r(o[a]);if(l)return l}return!1}for(var i=0;t.length>i;++i){var o=r(t[i]);if(o)return"stop"!=o}}function wn(e){var t=Fo[e.keyCode];return"Ctrl"==t||"Alt"==t||"Shift"==t||"Mod"==t}function Cn(e,t){if(Ni&&34==e.keyCode&&e["char"])return!1;var n=Fo[e.keyCode];return null==n||e.altGraphKey?!1:(e.altKey&&(n="Alt-"+n),(qi?e.metaKey:e.ctrlKey)&&(n="Ctrl-"+n),(qi?e.ctrlKey:e.metaKey)&&(n="Cmd-"+n),!t&&e.shiftKey&&(n="Shift-"+n),n)}function Sn(e,t){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0}function kn(e,t){this.lines=[],this.type=t,this.doc=e}function $n(e,t,n,r,i){if(r&&r.shared)return Tn(e,t,n,r,i);if(e.cm&&!e.cm.curOp)return ot(e.cm,$n)(e,t,n,r,i);var o=new kn(e,i);if("range"==i&&!Yt(t,n))return o;r&&Xr(r,o),o.replacedWith&&(o.collapsed=!0,o.replacedWith=ri("span",[o.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||(o.replacedWith.ignoreEvents=!0)),o.collapsed&&(Gi=!0),o.addToHistory&&Cr(e,{from:t,to:n,origin:"markText"},{head:e.sel.head,anchor:e.sel.anchor},0/0);var a,s,l,c=t.line,u=0,d=e.cm;if(e.iter(c,n.line+1,function(r){d&&o.collapsed&&!d.options.lineWrapping&&Rn(e,r)==d.display.maxLine&&(l=!0);var i={from:null,to:null,marker:o};u+=r.text.length,c==t.line&&(i.from=t.ch,u-=t.ch),c==n.line&&(i.to=n.ch,u-=r.text.length-n.ch),o.collapsed&&(c==n.line&&(s=zn(r,n.ch)),c==t.line?a=zn(r,t.ch):fr(r,0)),Nn(r,i),++c}),o.collapsed&&e.iter(t.line,n.line+1,function(t){jn(e,t)&&fr(t,0)}),o.clearOnEnter&&Ir(o,"beforeCursorEnter",function(){o.clear()}),o.readOnly&&(Yi=!0,(e.history.done.length||e.history.undone.length)&&e.clearHistory()),o.collapsed){if(a!=s)throw Error("Inserting collapsed marker overlapping an existing one");o.size=u,o.atomic=!0}return d&&(l&&(d.curOp.updateMaxLine=!0),(o.className||o.title||o.startStyle||o.endStyle||o.collapsed)&<(d,t.line,n.line+1),o.atomic&&tn(d)),o}function _n(e,t){this.markers=e,this.primary=t;for(var n=0,r=this;e.length>n;++n)e[n].parent=this,Ir(e[n],"clear",function(){r.clear()})}function Tn(e,t,n,r,i){r=Xr(r),r.shared=!1;var o=[$n(e,t,n,r,i)],a=o[0],s=r.replacedWith;return cr(e,function(e){s&&(r.replacedWith=s.cloneNode(!0)),o.push($n(e,Kt(e,t),Kt(e,n),r,i));for(var l=0;e.linked.length>l;++l)if(e.linked[l].isParent)return;a=Vr(o)}),new _n(o,a)}function Mn(e,t){if(e)for(var n=0;e.length>n;++n){var r=e[n];if(r.marker==t)return r}}function Dn(e,t){for(var n,r=0;e.length>r;++r)e[r]!=t&&(n||(n=[])).push(e[r]);return n}function Nn(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}function Ln(e,t,n){if(e)for(var r,i=0;e.length>i;++i){var o=e[i],a=o.marker,s=null==o.from||(a.inclusiveLeft?t>=o.from:t>o.from);if(s||"bookmark"==a.type&&o.from==t&&(!n||!o.marker.insertLeft)){var l=null==o.to||(a.inclusiveRight?o.to>=t:o.to>t);(r||(r=[])).push({from:o.from,to:l?null:o.to,marker:a})}}return r}function En(e,t,n){if(e)for(var r,i=0;e.length>i;++i){var o=e[i],a=o.marker,s=null==o.to||(a.inclusiveRight?o.to>=t:o.to>t);if(s||"bookmark"==a.type&&o.from==t&&(!n||o.marker.insertLeft)){var l=null==o.from||(a.inclusiveLeft?t>=o.from:t>o.from);(r||(r=[])).push({from:l?null:o.from-t,to:null==o.to?null:o.to-t,marker:a})}}return r}function An(e,t){var n=Qt(e,t.from.line)&&dr(e,t.from.line).markedSpans,r=Qt(e,t.to.line)&&dr(e,t.to.line).markedSpans;if(!n&&!r)return null;var i=t.from.ch,o=t.to.ch,a=Ut(t.from,t.to),s=Ln(n,i,a),l=En(r,o,a),c=1==t.text.length,u=Vr(t.text).length+(c?i:0);if(s)for(var d=0;s.length>d;++d){var h=s[d];if(null==h.to){var p=Mn(l,h.marker);p?c&&(h.to=null==p.to?null:p.to+u):h.to=i}}if(l)for(var d=0;l.length>d;++d){var h=l[d];if(null!=h.to&&(h.to+=u),null==h.from){var p=Mn(s,h.marker);p||(h.from=u,c&&(s||(s=[])).push(h))}else h.from+=u,c&&(s||(s=[])).push(h)}if(c&&s){for(var d=0;s.length>d;++d)null!=s[d].from&&s[d].from==s[d].to&&"bookmark"!=s[d].marker.type&&s.splice(d--,1);s.length||(s=null)}var f=[s];if(!c){var g,m=t.text.length-2;if(m>0&&s)for(var d=0;s.length>d;++d)null==s[d].to&&(g||(g=[])).push({from:null,to:null,marker:s[d].marker});for(var d=0;m>d;++d)f.push(g);f.push(l)}return f}function Fn(e,t){var n=kr(e,t),r=An(e,t);if(!n)return r;if(!r)return n;for(var i=0;n.length>i;++i){var o=n[i],a=r[i];if(o&&a)e:for(var s=0;a.length>s;++s){for(var l=a[s],c=0;o.length>c;++c)if(o[c].marker==l.marker)continue e;o.push(l)}else a&&(n[i]=a)}return n}function On(e,t,n){var r=null;if(e.iter(t.line,n.line+1,function(e){if(e.markedSpans)for(var t=0;e.markedSpans.length>t;++t){var n=e.markedSpans[t].marker;!n.readOnly||r&&-1!=Jr(r,n)||(r||(r=[])).push(n)}}),!r)return null;for(var i=[{from:t,to:n}],o=0;r.length>o;++o)for(var a=r[o],s=a.find(),l=0;i.length>l;++l){var c=i[l];if(!Yt(c.to,s.from)&&!Yt(s.to,c.from)){var u=[l,1];(Yt(c.from,s.from)||!a.inclusiveLeft&&Ut(c.from,s.from))&&u.push({from:c.from,to:s.from}),(Yt(s.to,c.to)||!a.inclusiveRight&&Ut(c.to,s.to))&&u.push({from:s.to,to:c.to}),i.splice.apply(i,u),l+=u.length-1}}return i}function zn(e,t){var n,r=Gi&&e.markedSpans;if(r)for(var i,o=0;r.length>o;++o)i=r[o],i.marker.collapsed&&(null==i.from||t>i.from)&&(null==i.to||i.to>t)&&(!n||n.widthi;++i)if(r=n[i],r.marker.collapsed){if(null==r.from)return!0;if(!r.marker.replacedWith&&0==r.from&&r.marker.inclusiveLeft&&Pn(e,t,r))return!0}}function Pn(e,t,n){if(null==n.to){var r=n.marker.find().to,i=dr(e,r.line);return Pn(e,i,Mn(i.markedSpans,n.marker))}if(n.marker.inclusiveRight&&n.to==t.text.length)return!0;for(var o,a=0;t.markedSpans.length>a;++a)if(o=t.markedSpans[a],o.marker.collapsed&&!o.marker.replacedWith&&o.from==n.to&&(o.marker.inclusiveLeft||n.marker.inclusiveRight)&&Pn(e,t,o))return!0}function Wn(e){var t=e.markedSpans;if(t){for(var n=0;t.length>n;++n)t[n].marker.detachLine(e);e.markedSpans=null}}function Bn(e,t){if(t){for(var n=0;t.length>n;++n)t[n].marker.attachLine(e);e.markedSpans=t}}function qn(e){return function(){var t=!this.cm.curOp;t&&rt(this.cm);try{var n=e.apply(this,arguments)}finally{t&&it(this.cm)}return n}}function Un(e){return null!=e.height?e.height:(e.node.parentNode&&1==e.node.parentNode.nodeType||oi(e.cm.display.measure,ri("div",[e.node],null,"position: relative")),e.height=e.node.offsetHeight)}function Yn(e,t,n,r){var i=new po(e,n,r);return i.noHScroll&&(e.display.alignWidgets=!0),dn(e,t,function(t){var n=t.widgets||(t.widgets=[]);if(null==i.insertAt?n.push(i):n.splice(Math.min(n.length-1,Math.max(0,i.insertAt)),0,i),i.line=t,!jn(e.doc,t)||i.showIfHidden){var r=vr(e,t)e.options.maxHighlightLength?(o=!1,c.pos=Math.min(t.length,c.start+5e4),a=null):a=n.token(c,r),o&&l==a||(c.start>s&&i(c.start,l),s=c.start,l=a),c.start=c.pos;c.pos>s&&i(c.pos,l)}function Jn(e,t,n){var r=[e.state.modeGen];Kn(e,t.text,e.doc.mode,n,function(e,t){r.push(e,t)});for(var i=0;e.state.overlays.length>i;++i){var o=e.state.overlays[i],a=1,s=0;Kn(e,t.text,o.mode,!0,function(e,t){for(var n=a;e>s;){var i=r[a];i>e&&r.splice(a,1,e,r[a+1],i),a+=2,s=Math.min(e,i)}if(t)if(o.opaque)r.splice(n,a-n,e,t),a=n+2;else for(;a>n;n+=2){var l=r[n+1];r[n+1]=l?l+" "+t:t}})}return r}function Qn(e,t){return t.styles&&t.styles[0]==e.state.modeGen||(t.styles=Jn(e,t,t.stateAfter=O(e,gr(t)))),t.styles}function Xn(e,t,n){var r=e.doc.mode,i=new Sn(t.text,e.options.tabSize);for(""==t.text&&r.blankLine&&r.blankLine(n);!i.eol()&&i.pos<=e.options.maxHighlightLength;)r.token(i,n),i.start=i.pos}function Zn(e){return e?go[e]||(go[e]="cm-"+e.replace(/ +/g," cm-")):null}function er(e,t,n,r){for(var i,o=t,a=!0;i=In(o);)o=dr(e.doc,i.find().from.line);var s={pre:ri("pre"),col:0,pos:0,measure:null,measuredSomething:!1,cm:e,copyWidgets:r};o.textClass&&(s.pre.className=o.textClass);do{o.text&&(a=!1),s.measure=o==t&&n,s.pos=0,s.addToken=s.measure?nr:tr,(ki||Ti)&&e.getOption("lineWrapping")&&(s.addToken=rr(s.addToken));var l=or(o,s,Qn(e,o));n&&o==t&&!s.measuredSomething&&(n[0]=s.pre.appendChild(ui(e.display.measure)),s.measuredSomething=!0),l&&(o=dr(e.doc,l.to.line))}while(l);!n||s.measuredSomething||n[0]||(n[0]=s.pre.appendChild(a?ri("span"," "):ui(e.display.measure))),s.pre.firstChild||jn(e.doc,t)||s.pre.appendChild(document.createTextNode(" "));var c;if(n&&ki&&(c=br(o))){var u=c.length-1;c[u].from==c[u].to&&--u;var d=c[u],h=c[u-1];if(d.from+1==d.to&&h&&d.levela;++a){var s=t.charAt(a),l=0==a;s>=""&&"">s&&t.length-1>a?(s=t.slice(a,a+2),++a):a&&o&&li(t,a)&&e.pre.appendChild(ri("wbr"));var c=e.measure[e.pos],u=e.measure[e.pos]=tr(e,s,n,l&&r,a==t.length-1&&i);c&&(u.leftSide=c.leftSide||c),ki&&o&&" "==s&&a&&!/\s/.test(t.charAt(a-1))&&t.length-1>a&&!/\s/.test(t.charAt(a+1))&&(u.style.whiteSpace="normal"),e.pos+=s.length}t.length&&(e.measuredSomething=!0)}function rr(e){function t(e){for(var t=" ",n=0;e.length-2>n;++n)t+=n%2?" ":" ";return t+=" "}return function(n,r,i,o,a,s){return e(n,r.replace(/ {3,}/,t),i,o,a,s)}}function ir(e,t,n,r){var i=!r&&n.replacedWith;if(i&&(e.copyWidgets&&(i=i.cloneNode(!0)),e.pre.appendChild(i),e.measure)){if(t)e.measure[e.pos]=i;else{var o=e.measure[e.pos]=ui(e.cm.display.measure);"bookmark"!=n.type||n.insertLeft?e.pre.insertBefore(o,i):e.pre.appendChild(o)}e.measuredSomething=!0}e.pos+=t}function or(e,t,n){var r=e.markedSpans,i=e.text,o=0;if(r)for(var a,s,l,c,u,d,h=i.length,p=0,f=1,g="",m=0;;){if(m==p){s=l=c=u="",d=null,m=1/0;for(var v=null,b=0;r.length>b;++b){var y=r[b],x=y.marker;p>=y.from&&(null==y.to||y.to>p)?(null!=y.to&&m>y.to&&(m=y.to,l=""),x.className&&(s+=" "+x.className),x.startStyle&&y.from==p&&(c+=" "+x.startStyle),x.endStyle&&y.to==m&&(l+=" "+x.endStyle),x.title&&!u&&(u=x.title),x.collapsed&&(!d||d.marker.sizep&&m>y.from&&(m=y.from),"bookmark"==x.type&&y.from==p&&x.replacedWith&&(v=x)}if(d&&(d.from||0)==p&&(ir(t,(null==d.to?h:d.to)-p,d.marker,null==d.from),null==d.to))return d.marker.find();v&&!d&&ir(t,0,v)}if(p>=h)break;for(var w=Math.min(h,m);;){if(g){var C=p+g.length;if(!d){var S=C>w?g.slice(0,w-p):g;t.addToken(t,S,a?a+s:s,c,p+S.length==m?l:"",u)}if(C>=w){g=g.slice(w-p),p=w;break}p=C,c=""}g=i.slice(o,o=n[f++]),a=Zn(n[f++])}}else for(var f=1;n.length>f;f+=2)t.addToken(t,i.slice(o,o=n[f]),Zn(n[f+1]))}function ar(e,t,n,r,i){function o(e){return n?n[e]:null}function a(e,n,r){Gn(e,n,r,i),jr(e,"change",e,t)}var s=t.from,l=t.to,c=t.text,u=dr(e,s.line),d=dr(e,l.line),h=Vr(c),p=o(c.length-1),f=l.line-s.line;if(0==s.ch&&0==l.ch&&""==h){for(var g=0,m=c.length-1,v=[];m>g;++g)v.push(new fo(c[g],o(g),i));a(d,d.text,p),f&&e.remove(s.line,f),v.length&&e.insert(s.line,v)}else if(u==d)if(1==c.length)a(u,u.text.slice(0,s.ch)+h+u.text.slice(l.ch),p);else{for(var v=[],g=1,m=c.length-1;m>g;++g)v.push(new fo(c[g],o(g),i));v.push(new fo(h+u.text.slice(l.ch),p,i)),a(u,u.text.slice(0,s.ch)+c[0],o(0)),e.insert(s.line+1,v)}else if(1==c.length)a(u,u.text.slice(0,s.ch)+c[0]+d.text.slice(l.ch),o(0)),e.remove(s.line+1,f);else{a(u,u.text.slice(0,s.ch)+c[0],o(0)),a(d,h+d.text.slice(l.ch),p);for(var g=1,m=c.length-1,v=[];m>g;++g)v.push(new fo(c[g],o(g),i));f>1&&e.remove(s.line+1,f-1),e.insert(s.line+1,v)}jr(e,"change",e,t),en(e,r.anchor,r.head,null,!0)}function sr(e){this.lines=e,this.parent=null;for(var t=0,n=e.length,r=0;n>t;++t)e[t].parent=this,r+=e[t].height;this.height=r}function lr(e){this.children=e;for(var t=0,n=0,r=0,i=e.length;i>r;++r){var o=e[r];t+=o.chunkSize(),n+=o.height,o.parent=this}this.size=t,this.height=n,this.parent=null}function cr(e,t,n){function r(e,i,o){if(e.linked)for(var a=0;e.linked.length>a;++a){var s=e.linked[a];if(s.doc!=i){var l=o&&s.sharedHist;(!n||l)&&(t(s.doc,l),r(s.doc,e,l))}}}r(e,null,!0)}function ur(e,t){if(t.cm)throw Error("This document is already in use.");e.doc=t,t.cm=e,o(e),n(e),e.options.lineWrapping||d(e),e.options.mode=t.modeOption,lt(e)}function dr(e,t){for(t-=e.first;!e.lines;)for(var n=0;;++n){var r=e.children[n],i=r.chunkSize();if(i>t){e=r;break}t-=i}return e.lines[t]}function hr(e,t,n){var r=[],i=t.line;return e.iter(t.line,n.line+1,function(e){var o=e.text;i==n.line&&(o=o.slice(0,n.ch)),i==t.line&&(o=o.slice(t.ch)),r.push(o),++i}),r}function pr(e,t,n){var r=[];return e.iter(t,n,function(e){r.push(e.text)}),r}function fr(e,t){for(var n=t-e.height,r=e;r;r=r.parent)r.height+=n}function gr(e){if(null==e.parent)return null;for(var t=e.parent,n=Jr(t.lines,e),r=t.parent;r;t=r,r=r.parent)for(var i=0;r.children[i]!=t;++i)n+=r.children[i].chunkSize();return n+t.first}function mr(e,t){var n=e.first;e:do{for(var r=0,i=e.children.length;i>r;++r){var o=e.children[r],a=o.height;if(a>t){e=o;continue e}t-=a,n+=o.chunkSize()}return n}while(!e.lines);for(var r=0,i=e.lines.length;i>r;++r){var s=e.lines[r],l=s.height;if(l>t)break;t-=l}return n+r}function vr(e,t){t=Rn(e.doc,t);for(var n=0,r=t.parent,i=0;r.lines.length>i;++i){var o=r.lines[i];if(o==t)break;n+=o.height}for(var a=r.parent;a;r=a,a=r.parent)for(var i=0;a.children.length>i;++i){var s=a.children[i];if(s==r)break;n+=s.height}return n}function br(e){var t=e.order;return null==t&&(t=e.order=zo(e.text)),t}function yr(e){return{done:[],undone:[],undoDepth:1/0,lastTime:0,lastOp:null,lastOrigin:null,generation:e||1,maxGeneration:e||1}}function xr(e,t,n,r){var i=t["spans_"+e.id],o=0;e.iter(Math.max(e.first,n),Math.min(e.first+e.size,r),function(n){n.markedSpans&&((i||(i=t["spans_"+e.id]={}))[o]=n.markedSpans),++o})}function wr(e,t){var n={line:t.from.line,ch:t.from.ch},r={from:n,to:to(t),text:hr(e,t.from,t.to)};return xr(e,r,t.from.line,t.to.line+1),cr(e,function(e){xr(e,r,t.from.line,t.to.line+1)},!0),r}function Cr(e,t,n,r){var i=e.history;i.undone.length=0;var o=+new Date,a=Vr(i.done);if(a&&(i.lastOp==r||i.lastOrigin==t.origin&&t.origin&&("+"==t.origin.charAt(0)&&e.cm&&i.lastTime>o-e.cm.options.historyEventDelay||"*"==t.origin.charAt(0)))){var s=Vr(a.changes);Ut(t.from,t.to)&&Ut(t.from,s.to)?s.to=to(t):a.changes.push(wr(e,t)),a.anchorAfter=n.anchor,a.headAfter=n.head}else for(a={changes:[wr(e,t)],generation:i.generation,anchorBefore:e.sel.anchor,headBefore:e.sel.head,anchorAfter:n.anchor,headAfter:n.head},i.done.push(a),i.generation=++i.maxGeneration;i.done.length>i.undoDepth;)i.done.shift();i.lastTime=o,i.lastOp=r,i.lastOrigin=t.origin}function Sr(e){if(!e)return null;for(var t,n=0;e.length>n;++n)e[n].marker.explicitlyCleared?t||(t=e.slice(0,n)):t&&t.push(e[n]);return t?t.length?t:null:e}function kr(e,t){var n=t["spans_"+e.id];if(!n)return null;for(var r=0,i=[];t.text.length>r;++r)i.push(Sr(n[r]));return i}function $r(e,t){for(var n=0,r=[];e.length>n;++n){var i=e[n],o=i.changes,a=[];r.push({changes:a,anchorBefore:i.anchorBefore,headBefore:i.headBefore,anchorAfter:i.anchorAfter,headAfter:i.headAfter});for(var s=0;o.length>s;++s){var l,c=o[s];if(a.push({from:c.from,to:c.to,text:c.text}),t)for(var u in c)(l=u.match(/^spans_(\d+)$/))&&Jr(t,Number(l[1]))>-1&&(Vr(a)[u]=c[u],delete c[u])}}return r}function _r(e,t,n,r){e.line>n?e.line+=r:e.line>t&&(e.line=t,e.ch=0)}function Tr(e,t,n,r){for(var i=0;e.length>i;++i){for(var o=e[i],a=!0,s=0;o.changes.length>s;++s){var l=o.changes[s];if(o.copied||(l.from=Gt(l.from),l.to=Gt(l.to)),l.from.line>n)l.from.line+=r,l.to.line+=r;else if(l.to.line>=t){a=!1;break}}o.copied||(o.anchorBefore=Gt(o.anchorBefore),o.headBefore=Gt(o.headBefore),o.anchorAfter=Gt(o.anchorAfter),o.readAfter=Gt(o.headAfter),o.copied=!0),a?(_r(o.anchorBefore),_r(o.headBefore),_r(o.anchorAfter),_r(o.headAfter)):(e.splice(0,i+1),i=0)}}function Mr(e,t){var n=t.from.line,r=t.to.line,i=t.text.length-(r-n)-1;Tr(e.done,n,r,i),Tr(e.undone,n,r,i)}function Dr(){Fr(this)}function Nr(e){return e.stop||(e.stop=Dr),e}function Lr(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function Er(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function Ar(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function Fr(e){Lr(e),Er(e)}function Or(e){return e.target||e.srcElement}function zr(e){var t=e.which;return null==t&&(1&e.button?t=1:2&e.button?t=3:4&e.button&&(t=2)),Hi&&e.ctrlKey&&1==t&&(t=3),t}function Ir(e,t,n){if(e.addEventListener)e.addEventListener(t,n,!1);else if(e.attachEvent)e.attachEvent("on"+t,n);else{var r=e._handlers||(e._handlers={}),i=r[t]||(r[t]=[]);i.push(n)}}function Hr(e,t,n){if(e.removeEventListener)e.removeEventListener(t,n,!1);else if(e.detachEvent)e.detachEvent("on"+t,n);else{var r=e._handlers&&e._handlers[t];if(!r)return;for(var i=0;r.length>i;++i)if(r[i]==n){r.splice(i,1);break}}}function Rr(e,t){var n=e._handlers&&e._handlers[t];if(n)for(var r=Array.prototype.slice.call(arguments,2),i=0;n.length>i;++i)n[i].apply(null,r)}function jr(e,t){function n(e){return function(){e.apply(null,i)}}var r=e._handlers&&e._handlers[t];if(r){var i=Array.prototype.slice.call(arguments,2);wo||(++Co,wo=[],setTimeout(Wr,0));for(var o=0;r.length>o;++o)wo.push(n(r[o]))}}function Pr(e,t,n){return Rr(e,n||t.type,e,t),Ar(t)||t.codemirrorIgnore}function Wr(){--Co;var e=wo;wo=null;for(var t=0;e.length>t;++t)e[t]()}function Br(e,t){var n=e._handlers&&e._handlers[t];return n&&n.length>0}function qr(e){e.prototype.on=function(e,t){Ir(this,e,t)},e.prototype.off=function(e,t){Hr(this,e,t)}}function Ur(){this.id=null}function Yr(e,t,n,r,i){null==t&&(t=e.search(/[^\s\u00a0]/),-1==t&&(t=e.length));for(var o=r||0,a=i||0;t>o;++o)" "==e.charAt(o)?a+=n-a%n:++a;return a}function Gr(e){for(;e>=$o.length;)$o.push(Vr($o)+" ");return $o[e]}function Vr(e){return e[e.length-1]}function Kr(e){if(zi)e.selectionStart=0,e.selectionEnd=e.value.length;else try{e.select()}catch(t){}}function Jr(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0,r=e.length;r>n;++n)if(e[n]==t)return n;return-1}function Qr(e,t){function n(){}n.prototype=e;var r=new n;return t&&Xr(t,r),r}function Xr(e,t){t||(t={});for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t}function Zr(e){for(var t=[],n=0;e>n;++n)t.push(void 0);return t}function ei(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function ti(e){return/\w/.test(e)||e>""&&(e.toUpperCase()!=e.toLowerCase()||_o.test(e))}function ni(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}function ri(e,t,n,r){var i=document.createElement(e);if(n&&(i.className=n),r&&(i.style.cssText=r),"string"==typeof t)ai(i,t);else if(t)for(var o=0;t.length>o;++o)i.appendChild(t[o]);return i}function ii(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function oi(e,t){return ii(e).appendChild(t)}function ai(e,t){_i?(e.innerHTML="",e.appendChild(document.createTextNode(t))):e.textContent=t}function si(e){return e.getBoundingClientRect()}function li(){return!1}function ci(e){if(null!=Do)return Do;var t=ri("div",null,null,"width: 50px; height: 50px; overflow-x: scroll");return oi(e,t),t.offsetWidth&&(Do=t.offsetHeight-t.clientHeight),Do||0}function ui(e){if(null==No){var t=ri("span","");oi(e,ri("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(No=1>=t.offsetWidth&&t.offsetHeight>2&&!$i)}return No?ri("span",""):ri("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px")
-}function di(e,t,n,r){if(!e)return r(t,n,"ltr");for(var i=!1,o=0;e.length>o;++o){var a=e[o];(n>a.from&&a.to>t||t==n&&a.to==t)&&(r(Math.max(a.from,t),Math.min(a.to,n),1==a.level?"rtl":"ltr"),i=!0)}i||r(t,n,"ltr")}function hi(e){return e.level%2?e.to:e.from}function pi(e){return e.level%2?e.from:e.to}function fi(e){var t=br(e);return t?hi(t[0]):0}function gi(e){var t=br(e);return t?pi(Vr(t)):e.text.length}function mi(e,t){var n=dr(e.doc,t),r=Rn(e.doc,n);r!=n&&(t=gr(r));var i=br(r),o=i?i[0].level%2?gi(r):fi(r):0;return qt(t,o)}function vi(e,t){for(var n,r;n=Hn(r=dr(e.doc,t));)t=n.find().to.line;var i=br(r),o=i?i[0].level%2?fi(r):gi(r):r.text.length;return qt(t,o)}function bi(e,t,n){var r=e[0].level;return t==r?!0:n==r?!1:n>t}function yi(e,t){for(var n,r=0;e.length>r;++r){var i=e[r];if(t>i.from&&i.to>t)return Oo=null,r;if(i.from==t||i.to==t){if(null!=n)return bi(e,i.level,e[n].level)?(Oo=n,r):(Oo=r,n);n=r}}return Oo=null,n}function xi(e,t,n,r){if(!r)return t+n;do t+=n;while(t>0&&To.test(e.text.charAt(t)));return t}function wi(e,t,n,r){var i=br(e);if(!i)return Ci(e,t,n,r);for(var o=yi(i,t),a=i[o],s=xi(e,t,a.level%2?-n:n,r);;){if(s>a.from&&a.to>s)return s;if(s==a.from||s==a.to)return yi(i,s)==o?s:(a=i[o+=n],n>0==a.level%2?a.to:a.from);if(a=i[o+=n],!a)return null;s=n>0==a.level%2?xi(e,a.to,-1,r):xi(e,a.from,1,r)}}function Ci(e,t,n,r){var i=t+n;if(r)for(;i>0&&To.test(e.text.charAt(i));)i+=n;return 0>i||i>e.text.length?null:i}var Si=/gecko\/\d/i.test(navigator.userAgent),ki=/MSIE \d/.test(navigator.userAgent),$i=ki&&(null==document.documentMode||8>document.documentMode),_i=ki&&(null==document.documentMode||9>document.documentMode),Ti=/WebKit\//.test(navigator.userAgent),Mi=Ti&&/Qt\/\d+\.\d+/.test(navigator.userAgent),Di=/Chrome\//.test(navigator.userAgent),Ni=/Opera\//.test(navigator.userAgent),Li=/Apple Computer/.test(navigator.vendor),Ei=/KHTML\//.test(navigator.userAgent),Ai=/Mac OS X 1\d\D([7-9]|\d\d)\D/.test(navigator.userAgent),Fi=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(navigator.userAgent),Oi=/PhantomJS/.test(navigator.userAgent),zi=/AppleWebKit/.test(navigator.userAgent)&&/Mobile\/\w+/.test(navigator.userAgent),Ii=zi||/Android|webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(navigator.userAgent),Hi=zi||/Mac/.test(navigator.platform),Ri=/windows/i.test(navigator.platform),ji=Ni&&navigator.userAgent.match(/Version\/(\d*\.\d*)/);ji&&(ji=Number(ji[1])),ji&&ji>=15&&(Ni=!1,Ti=!0);var Pi,Wi,Bi,qi=Hi&&(Mi||Ni&&(null==ji||12.11>ji)),Ui=Si||ki&&!_i,Yi=!1,Gi=!1,Vi=0,Ki=0,Ji=0,Qi=null;ki?Qi=-.53:Si?Qi=15:Di?Qi=-.7:Li&&(Qi=-1/3);var Xi,Zi,eo=null,to=e.changeEnd=function(e){return e.text?qt(e.from.line+e.text.length-1,Vr(e.text).length+(1==e.text.length?e.from.ch:0)):e.to};e.Pos=qt,e.prototype={constructor:e,focus:function(){window.focus(),pt(this),Lt(this),ut(this)},setOption:function(e,t){var n=this.options,r=n[e];(n[e]!=t||"mode"==e)&&(n[e]=t,no.hasOwnProperty(e)&&ot(this,no[e])(this,t,r))},getOption:function(e){return this.options[e]},getDoc:function(){return this.doc},addKeyMap:function(e,t){this.state.keyMaps[t?"push":"unshift"](e)},removeKeyMap:function(e){for(var t=this.state.keyMaps,n=0;t.length>n;++n)if(t[n]==e||"string"!=typeof t[n]&&t[n].name==e)return t.splice(n,1),!0},addOverlay:ot(null,function(t,n){var r=t.token?t:e.getMode(this.options,t);if(r.startState)throw Error("Overlays may not be stateful.");this.state.overlays.push({mode:r,modeSpec:t,opaque:n&&n.opaque}),this.state.modeGen++,lt(this)}),removeOverlay:ot(null,function(e){for(var t=this.state.overlays,n=0;t.length>n;++n){var r=t[n].modeSpec;if(r==e||"string"==typeof e&&r.name==e)return t.splice(n,1),this.state.modeGen++,lt(this),void 0}}),indentLine:ot(null,function(e,t,n){"string"!=typeof t&&"number"!=typeof t&&(t=null==t?this.options.smartIndent?"smart":"prev":t?"add":"subtract"),Qt(this.doc,e)&&un(this,e,t,n)}),indentSelection:ot(null,function(e){var t=this.doc.sel;if(Ut(t.from,t.to))return un(this,t.from.line,e);for(var n=t.to.line-(t.to.ch?0:1),r=t.from.line;n>=r;++r)un(this,r,e)}),getTokenAt:function(e,t){var n=this.doc;e=Kt(n,e);for(var r=O(this,e.line,t),i=this.doc.mode,o=dr(n,e.line),a=new Sn(o.text,this.options.tabSize);a.pos>1;if((o?t[2*o-1]:0)>=i)r=o;else{if(!(i>t[2*o+1]))return t[2*o+2];n=o+1}}},getModeAt:function(t){var n=this.doc.mode;return n.innerMode?e.innerMode(n,this.getTokenAt(t).state).mode:n},getHelper:function(e,t){if(co.hasOwnProperty(t)){var n=co[t],r=this.getModeAt(e);return r[t]&&n[r[t]]||r.helperType&&n[r.helperType]||n[r.name]}},getStateAfter:function(e,t){var n=this.doc;return e=Vt(n,null==e?n.first+n.size-1:e),O(this,e+1,t)},cursorCoords:function(e,t){var n,r=this.doc.sel;return n=null==e?r.head:"object"==typeof e?Kt(this.doc,e):e?r.from:r.to,Q(this,n,t||"page")},charCoords:function(e,t){return J(this,Kt(this.doc,e),t||"page")},coordsChar:function(e,t){return e=K(this,e,t||"page"),Z(this,e.left,e.top)},lineAtHeight:function(e,t){return e=K(this,{top:e,left:0},t||"page").top,mr(this.doc,e+this.display.viewOffset)},heightAtLine:function(e,t){var n=!1,r=this.doc.first+this.doc.size-1;this.doc.first>e?e=this.doc.first:e>r&&(e=r,n=!0);var i=dr(this.doc,e);return V(this,dr(this.doc,e),{top:0,left:0},t||"page").top+(n?i.height:0)},defaultTextHeight:function(){return tt(this.display)},defaultCharWidth:function(){return nt(this.display)},setGutterMarker:ot(null,function(e,t,n){return dn(this,e,function(e){var r=e.gutterMarkers||(e.gutterMarkers={});return r[t]=n,!n&&ni(r)&&(e.gutterMarkers=null),!0})}),clearGutter:ot(null,function(e){var t=this,n=t.doc,r=n.first;n.iter(function(n){n.gutterMarkers&&n.gutterMarkers[e]&&(n.gutterMarkers[e]=null,lt(t,r,r+1),ni(n.gutterMarkers)&&(n.gutterMarkers=null)),++r})}),addLineClass:ot(null,function(e,t,n){return dn(this,e,function(e){var r="text"==t?"textClass":"background"==t?"bgClass":"wrapClass";if(e[r]){if(RegExp("(?:^|\\s)"+n+"(?:$|\\s)").test(e[r]))return!1;e[r]+=" "+n}else e[r]=n;return!0})}),removeLineClass:ot(null,function(e,t,n){return dn(this,e,function(e){var r="text"==t?"textClass":"background"==t?"bgClass":"wrapClass",i=e[r];if(!i)return!1;if(null==n)e[r]=null;else{var o=i.match(RegExp("(?:^|\\s+)"+n+"(?:$|\\s+)"));if(!o)return!1;var a=o.index+o[0].length;e[r]=i.slice(0,o.index)+(o.index&&a!=i.length?" ":"")+i.slice(a)||null}return!0})}),addLineWidget:ot(null,function(e,t,n){return Yn(this,e,t,n)}),removeLineWidget:function(e){e.clear()},lineInfo:function(e){if("number"==typeof e){if(!Qt(this.doc,e))return null;var t=e;if(e=dr(this.doc,e),!e)return null}else{var t=gr(e);if(null==t)return null}return{line:t,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},getViewport:function(){return{from:this.display.showingFrom,to:this.display.showingTo}},addWidget:function(e,t,n,r,i){var o=this.display;e=Q(this,Kt(this.doc,e));var a=e.bottom,s=e.left;if(t.style.position="absolute",o.sizer.appendChild(t),"over"==r)a=e.top;else if("above"==r||"near"==r){var l=Math.max(o.wrapper.clientHeight,this.doc.height),c=Math.max(o.sizer.clientWidth,o.lineSpace.clientWidth);("above"==r||e.bottom+t.offsetHeight>l)&&e.top>t.offsetHeight?a=e.top-t.offsetHeight:l>=e.bottom+t.offsetHeight&&(a=e.bottom),s+t.offsetWidth>c&&(s=c-t.offsetWidth)}t.style.top=a+"px",t.style.left=t.style.right="","right"==i?(s=o.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==i?s=0:"middle"==i&&(s=(o.sizer.clientWidth-t.offsetWidth)/2),t.style.left=s+"px"),n&&an(this,s,a,s+t.offsetWidth,a+t.offsetHeight)},triggerOnKeyDown:ot(null,Dt),execCommand:function(e){return uo[e](this)},findPosH:function(e,t,n,r){var i=1;0>t&&(i=-1,t=-t);for(var o=0,a=Kt(this.doc,e);t>o&&(a=hn(this.doc,a,i,n,r),!a.hitSide);++o);return a},moveH:ot(null,function(e,t){var n,r=this.doc.sel;n=r.shift||r.extend||Ut(r.from,r.to)?hn(this.doc,r.head,e,t,this.options.rtlMoveVisually):0>e?r.from:r.to,Xt(this.doc,n,n,e)}),deleteH:ot(null,function(e,t){var n=this.doc.sel;Ut(n.from,n.to)?Bt(this.doc,"",n.from,hn(this.doc,n.head,e,t,!1),"+delete"):Bt(this.doc,"",n.from,n.to,"+delete"),this.curOp.userSelChange=!0}),findPosV:function(e,t,n,r){var i=1,o=r;0>t&&(i=-1,t=-t);for(var a=0,s=Kt(this.doc,e);t>a;++a){var l=Q(this,s,"div");if(null==o?o=l.left:l.left=o,s=pn(this,l,i,n),s.hitSide)break}return s},moveV:ot(null,function(e,t){var n=this.doc.sel,r=Q(this,n.head,"div");null!=n.goalColumn&&(r.left=n.goalColumn);var i=pn(this,r,e,t);"page"==t&&cn(this,0,J(this,i,"div").top-r.top),Xt(this.doc,i,i,e),n.goalColumn=r.left}),toggleOverwrite:function(e){(null==e||e!=this.state.overwrite)&&((this.state.overwrite=!this.state.overwrite)?this.display.cursor.className+=" CodeMirror-overwrite":this.display.cursor.className=this.display.cursor.className.replace(" CodeMirror-overwrite",""))},hasFocus:function(){return this.state.focused},scrollTo:ot(null,function(e,t){ln(this,e,t)}),getScrollInfo:function(){var e=this.display.scroller,t=So;return{left:e.scrollLeft,top:e.scrollTop,height:e.scrollHeight-t,width:e.scrollWidth-t,clientHeight:e.clientHeight-t,clientWidth:e.clientWidth-t}},scrollIntoView:ot(null,function(e,t){"number"==typeof e&&(e=qt(e,0)),t||(t=0);var n=e;e&&null==e.line||(this.curOp.scrollToPos=e?Kt(this.doc,e):this.doc.sel.head,this.curOp.scrollToPosMargin=t,n=Q(this,this.curOp.scrollToPos));var r=sn(this,n.left,n.top-t,n.right,n.bottom+t);ln(this,r.scrollLeft,r.scrollTop)}),setSize:ot(null,function(e,t){function n(e){return"number"==typeof e||/^\d+$/.test(e+"")?e+"px":e}null!=e&&(this.display.wrapper.style.width=n(e)),null!=t&&(this.display.wrapper.style.height=n(t)),this.options.lineWrapping&&(this.display.measureLineCache.length=this.display.measureLineCachePos=0),this.curOp.forceUpdate=!0}),operation:function(e){return st(this,e)},refresh:ot(null,function(){U(this),ln(this,this.doc.scrollLeft,this.doc.scrollTop),lt(this)}),swapDoc:ot(null,function(e){var t=this.doc;return t.cm=null,ur(this,e),U(this),ht(this,!0),ln(this,e.scrollLeft,e.scrollTop),t}),getInputField:function(){return this.display.input},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},qr(e);var no=e.optionHandlers={},ro=e.defaults={},io=e.Init={toString:function(){return"CodeMirror.Init"}};mn("value","",function(e,t){e.setValue(t)},!0),mn("mode",null,function(e,t){e.doc.modeOption=t,n(e)},!0),mn("indentUnit",2,n,!0),mn("indentWithTabs",!1),mn("smartIndent",!0),mn("tabSize",4,function(e){n(e),U(e),lt(e)},!0),mn("electricChars",!0),mn("rtlMoveVisually",!Ri),mn("theme","default",function(e){s(e),l(e)},!0),mn("keyMap","default",a),mn("extraKeys",null),mn("onKeyEvent",null),mn("onDragEvent",null),mn("lineWrapping",!1,r,!0),mn("gutters",[],function(e){h(e.options),l(e)},!0),mn("fixedGutter",!0,function(e,t){e.display.gutters.style.left=t?b(e.display)+"px":"0",e.refresh()},!0),mn("coverGutterNextToScrollbar",!1,p,!0),mn("lineNumbers",!1,function(e){h(e.options),l(e)},!0),mn("firstLineNumber",1,l,!0),mn("lineNumberFormatter",function(e){return e},l,!0),mn("showCursorWhenSelecting",!1,M,!0),mn("readOnly",!1,function(e,t){"nocursor"==t?(Et(e),e.display.input.blur()):t||ht(e,!0)}),mn("dragDrop",!0),mn("cursorBlinkRate",530),mn("cursorScrollMargin",0),mn("cursorHeight",1),mn("workTime",100),mn("workDelay",100),mn("flattenSpans",!0),mn("pollInterval",100),mn("undoDepth",40,function(e,t){e.doc.history.undoDepth=t}),mn("historyEventDelay",500),mn("viewportMargin",10,function(e){e.refresh()},!0),mn("maxHighlightLength",1e4,function(e){n(e),e.refresh()},!0),mn("moveInputWithCursor",!0,function(e,t){t||(e.display.inputDiv.style.top=e.display.inputDiv.style.left=0)}),mn("tabindex",null,function(e,t){e.display.input.tabIndex=t||""}),mn("autofocus",null);var oo=e.modes={},ao=e.mimeModes={};e.defineMode=function(t,n){if(e.defaults.mode||"null"==t||(e.defaults.mode=t),arguments.length>2){n.dependencies=[];for(var r=2;arguments.length>r;++r)n.dependencies.push(arguments[r])}oo[t]=n},e.defineMIME=function(e,t){ao[e]=t},e.resolveMode=function(t){if("string"==typeof t&&ao.hasOwnProperty(t))t=ao[t];else if(t&&"string"==typeof t.name&&ao.hasOwnProperty(t.name)){var n=ao[t.name];t=Qr(n,t),t.name=n.name}else if("string"==typeof t&&/^[\w\-]+\/[\w\-]+\+xml$/.test(t))return e.resolveMode("application/xml");return"string"==typeof t?{name:t}:t||{name:"null"}},e.getMode=function(t,n){var n=e.resolveMode(n),r=oo[n.name];if(!r)return e.getMode(t,"text/plain");var i=r(t,n);if(so.hasOwnProperty(n.name)){var o=so[n.name];for(var a in o)o.hasOwnProperty(a)&&(i.hasOwnProperty(a)&&(i["_"+a]=i[a]),i[a]=o[a])}return i.name=n.name,i},e.defineMode("null",function(){return{token:function(e){e.skipToEnd()}}}),e.defineMIME("text/plain","null");var so=e.modeExtensions={};e.extendMode=function(e,t){var n=so.hasOwnProperty(e)?so[e]:so[e]={};Xr(t,n)},e.defineExtension=function(t,n){e.prototype[t]=n},e.defineDocExtension=function(e,t){bo.prototype[e]=t},e.defineOption=mn;var lo=[];e.defineInitHook=function(e){lo.push(e)};var co=e.helpers={};e.registerHelper=function(t,n,r){co.hasOwnProperty(t)||(co[t]=e[t]={}),co[t][n]=r},e.isWordChar=ti,e.copyState=vn,e.startState=bn,e.innerMode=function(e,t){for(;e.innerMode;){var n=e.innerMode(t);if(!n||n.mode==e)break;t=n.state,e=n.mode}return n||{mode:e,state:t}};var uo=e.commands={selectAll:function(e){e.setSelection(qt(e.firstLine(),0),qt(e.lastLine()))},killLine:function(e){var t=e.getCursor(!0),n=e.getCursor(!1),r=!Ut(t,n);r||e.getLine(t.line).length!=t.ch?e.replaceRange("",t,r?n:qt(t.line),"+delete"):e.replaceRange("",t,qt(t.line+1,0),"+delete")},deleteLine:function(e){var t=e.getCursor().line;e.replaceRange("",qt(t,0),qt(t),"+delete")},delLineLeft:function(e){var t=e.getCursor();e.replaceRange("",qt(t.line,0),t,"+delete")},undo:function(e){e.undo()},redo:function(e){e.redo()},goDocStart:function(e){e.extendSelection(qt(e.firstLine(),0))},goDocEnd:function(e){e.extendSelection(qt(e.lastLine()))},goLineStart:function(e){e.extendSelection(mi(e,e.getCursor().line))},goLineStartSmart:function(e){var t=e.getCursor(),n=mi(e,t.line),r=e.getLineHandle(n.line),i=br(r);if(i&&0!=i[0].level)e.extendSelection(n);else{var o=Math.max(0,r.text.search(/\S/)),a=t.line==n.line&&o>=t.ch&&t.ch;e.extendSelection(qt(n.line,a?0:o))}},goLineEnd:function(e){e.extendSelection(vi(e,e.getCursor().line))},goLineRight:function(e){var t=e.charCoords(e.getCursor(),"div").top+5;e.extendSelection(e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:t},"div"))},goLineLeft:function(e){var t=e.charCoords(e.getCursor(),"div").top+5;e.extendSelection(e.coordsChar({left:0,top:t},"div"))},goLineUp:function(e){e.moveV(-1,"line")},goLineDown:function(e){e.moveV(1,"line")},goPageUp:function(e){e.moveV(-1,"page")},goPageDown:function(e){e.moveV(1,"page")},goCharLeft:function(e){e.moveH(-1,"char")},goCharRight:function(e){e.moveH(1,"char")},goColumnLeft:function(e){e.moveH(-1,"column")},goColumnRight:function(e){e.moveH(1,"column")},goWordLeft:function(e){e.moveH(-1,"word")},goGroupRight:function(e){e.moveH(1,"group")},goGroupLeft:function(e){e.moveH(-1,"group")},goWordRight:function(e){e.moveH(1,"word")},delCharBefore:function(e){e.deleteH(-1,"char")},delCharAfter:function(e){e.deleteH(1,"char")},delWordBefore:function(e){e.deleteH(-1,"word")},delWordAfter:function(e){e.deleteH(1,"word")},delGroupBefore:function(e){e.deleteH(-1,"group")},delGroupAfter:function(e){e.deleteH(1,"group")},indentAuto:function(e){e.indentSelection("smart")},indentMore:function(e){e.indentSelection("add")},indentLess:function(e){e.indentSelection("subtract")},insertTab:function(e){e.replaceSelection(" ","end","+input")},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.replaceSelection(" ","end","+input")},transposeChars:function(e){var t=e.getCursor(),n=e.getLine(t.line);t.ch>0&&t.ch=this.string.length},sol:function(){return 0==this.pos},peek:function(){return this.string.charAt(this.pos)||void 0},next:function(){return this.post},eatSpace:function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},skipToEnd:function(){this.pos=this.string.length},skipTo:function(e){var t=this.string.indexOf(e,this.pos);return t>-1?(this.pos=t,!0):void 0},backUp:function(e){this.pos-=e},column:function(){return this.lastColumnPos0?null:(r&&t!==!1&&(this.pos+=r[0].length),r)}var i=function(e){return n?e.toLowerCase():e},o=this.string.substr(this.pos,e.length);return i(o)==i(e)?(t!==!1&&(this.pos+=e.length),!0):void 0},current:function(){return this.string.slice(this.start,this.pos)}},e.StringStream=Sn,e.TextMarker=kn,qr(kn),kn.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&rt(e),Br(this,"clear")){var n=this.find();n&&jr(this,"clear",n.from,n.to)}for(var r=null,i=null,o=0;this.lines.length>o;++o){var a=this.lines[o],s=Mn(a.markedSpans,this);null!=s.to&&(i=gr(a)),a.markedSpans=Dn(a.markedSpans,s),null!=s.from?r=gr(a):this.collapsed&&!jn(this.doc,a)&&e&&fr(a,tt(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var o=0;this.lines.length>o;++o){var l=Rn(e.doc,this.lines[o]),c=u(e.doc,l);c>e.display.maxLineLength&&(e.display.maxLine=l,e.display.maxLineLength=c,e.display.maxLineChanged=!0)}null!=r&&e&<(e,r,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&tn(e)),t&&it(e)}},kn.prototype.find=function(){for(var e,t,n=0;this.lines.length>n;++n){var r=this.lines[n],i=Mn(r.markedSpans,this);if(null!=i.from||null!=i.to){var o=gr(r);null!=i.from&&(e=qt(o,i.from)),null!=i.to&&(t=qt(o,i.to))}}return"bookmark"==this.type?e:e&&{from:e,to:t}},kn.prototype.changed=function(){var e=this.find(),t=this.doc.cm;if(e&&t){var n=dr(this.doc,e.from.line);if(P(t,n),e.from.line>=t.display.showingFrom&&e.from.linee;++e)this.markers[e].clear();jr(this,"clear")}},_n.prototype.find=function(){return this.primary.find()};var po=e.LineWidget=function(e,t,n){if(n)for(var r in n)n.hasOwnProperty(r)&&(this[r]=n[r]);this.cm=e,this.node=t};qr(po),po.prototype.clear=qn(function(){var e=this.line.widgets,t=gr(this.line);if(null!=t&&e){for(var n=0;e.length>n;++n)e[n]==this&&e.splice(n--,1);e.length||(this.line.widgets=null);var r=vr(this.cm,this.line)n;++n){var i=this.lines[n];this.height-=i.height,Vn(i),jr(i,"delete")}this.lines.splice(e,t)},collapse:function(e){e.splice.apply(e,[e.length,0].concat(this.lines))},insertInner:function(e,t,n){this.height+=n,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var r=0,i=t.length;i>r;++r)t[r].parent=this},iterN:function(e,t,n){for(var r=e+t;r>e;++e)if(n(this.lines[e]))return!0}},lr.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var n=0;this.children.length>n;++n){var r=this.children[n],i=r.chunkSize();if(i>e){var o=Math.min(t,i-e),a=r.height;if(r.removeInner(e,o),this.height-=a-r.height,i==o&&(this.children.splice(n--,1),r.parent=null),0==(t-=o))break;e=0}else e-=i}if(25>this.size-t){var s=[];this.collapse(s),this.children=[new sr(s)],this.children[0].parent=this}},collapse:function(e){for(var t=0,n=this.children.length;n>t;++t)this.children[t].collapse(e)},insertInner:function(e,t,n){this.size+=t.length,this.height+=n;for(var r=0,i=this.children.length;i>r;++r){var o=this.children[r],a=o.chunkSize();if(a>=e){if(o.insertInner(e,t,n),o.lines&&o.lines.length>50){for(;o.lines.length>50;){var s=o.lines.splice(o.lines.length-25,25),l=new sr(s);o.height-=l.height,this.children.splice(r+1,0,l),l.parent=this}this.maybeSpill()}break}e-=a}},maybeSpill:function(){if(!(10>=this.children.length)){var e=this;do{var t=e.children.splice(e.children.length-5,5),n=new lr(t);if(e.parent){e.size-=n.size,e.height-=n.height;var r=Jr(e.parent.children,e);e.parent.children.splice(r+1,0,n)}else{var i=new lr(e.children);i.parent=e,e.children=[i,n],e=i}n.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()}},iterN:function(e,t,n){for(var r=0,i=this.children.length;i>r;++r){var o=this.children[r],a=o.chunkSize();if(a>e){var s=Math.min(t,a-e);if(o.iterN(e,s,n))return!0;if(0==(t-=s))break;e=0}else e-=a}}};var vo=0,bo=e.Doc=function(e,t,n){if(!(this instanceof bo))return new bo(e,t,n);null==n&&(n=0),lr.call(this,[new sr([new fo("",null)])]),this.first=n,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.history=yr(),this.cleanGeneration=1,this.frontier=n;var r=qt(n,0);this.sel={from:r,to:r,head:r,anchor:r,shift:!1,extend:!1,goalColumn:null},this.id=++vo,this.modeOption=t,"string"==typeof e&&(e=Lo(e)),ar(this,{from:r,to:r,text:e},null,{head:r,anchor:r})};bo.prototype=Qr(lr.prototype,{constructor:bo,iter:function(e,t,n){n?this.iterN(e-this.first,t-e,n):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var n=0,r=0,i=t.length;i>r;++r)n+=t[r].height;this.insertInner(e-this.first,t,n)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=pr(this,this.first,this.first+this.size);return e===!1?t:t.join(e||"\n")},setValue:function(e){var t=qt(this.first,0),n=this.first+this.size-1;It(this,{from:t,to:qt(n,dr(this,n).text.length),text:Lo(e),origin:"setValue"},{head:t,anchor:t},!0)},replaceRange:function(e,t,n,r){t=Kt(this,t),n=n?Kt(this,n):t,Bt(this,e,t,n,r)},getRange:function(e,t,n){var r=hr(this,Kt(this,e),Kt(this,t));return n===!1?r:r.join(n||"\n")},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},setLine:function(e,t){Qt(this,e)&&Bt(this,t,qt(e,0),Kt(this,qt(e)))},removeLine:function(e){e?Bt(this,"",Kt(this,qt(e-1)),Kt(this,qt(e))):Bt(this,"",qt(0,0),Kt(this,qt(1,0)))},getLineHandle:function(e){return Qt(this,e)?dr(this,e):void 0},getLineNumber:function(e){return gr(e)},getLineHandleVisualStart:function(e){return"number"==typeof e&&(e=dr(this,e)),Rn(this,e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return Kt(this,e)},getCursor:function(e){var t,n=this.sel;return t=null==e||"head"==e?n.head:"anchor"==e?n.anchor:"end"==e||e===!1?n.to:n.from,Gt(t)},somethingSelected:function(){return!Ut(this.sel.head,this.sel.anchor)},setCursor:at(function(e,t,n){var r=Kt(this,"number"==typeof e?qt(e,t||0):e);n?Xt(this,r):en(this,r,r)}),setSelection:at(function(e,t){en(this,Kt(this,e),Kt(this,t||e))}),extendSelection:at(function(e,t){Xt(this,Kt(this,e),t&&Kt(this,t))}),getSelection:function(e){return this.getRange(this.sel.from,this.sel.to,e)},replaceSelection:function(e,t,n){It(this,{from:this.sel.from,to:this.sel.to,text:Lo(e),origin:n},t||"around")},undo:at(function(){Rt(this,"undo")}),redo:at(function(){Rt(this,"redo")}),setExtending:function(e){this.sel.extend=e},historySize:function(){var e=this.history;return{undo:e.done.length,redo:e.undone.length}},clearHistory:function(){this.history=yr(this.history.maxGeneration)},markClean:function(){this.cleanGeneration=this.changeGeneration()},changeGeneration:function(){return this.history.lastOp=this.history.lastOrigin=null,this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:$r(this.history.done),undone:$r(this.history.undone)}},setHistory:function(e){var t=this.history=yr(this.history.maxGeneration);t.done=e.done.slice(0),t.undone=e.undone.slice(0)},markText:function(e,t,n){return $n(this,Kt(this,e),Kt(this,t),n,"range")},setBookmark:function(e,t){var n={replacedWith:t&&(null==t.nodeType?t.widget:t),insertLeft:t&&t.insertLeft};return e=Kt(this,e),$n(this,e,e,n,"bookmark")},findMarksAt:function(e){e=Kt(this,e);var t=[],n=dr(this,e.line).markedSpans;if(n)for(var r=0;n.length>r;++r){var i=n[r];(null==i.from||i.from<=e.ch)&&(null==i.to||i.to>=e.ch)&&t.push(i.marker.parent||i.marker)}return t},getAllMarks:function(){var e=[];return this.iter(function(t){var n=t.markedSpans;if(n)for(var r=0;n.length>r;++r)null!=n[r].from&&e.push(n[r].marker)}),e},posFromIndex:function(e){var t,n=this.first;return this.iter(function(r){var i=r.text.length+1;return i>e?(t=e,!0):(e-=i,++n,void 0)}),Kt(this,qt(n,t))},indexFromPos:function(e){e=Kt(this,e);var t=e.ch;return e.linee.ch?0:(this.iter(this.first,e.line,function(e){t+=e.text.length+1}),t)},copy:function(e){var t=new bo(pr(this,this.first,this.first+this.size),this.modeOption,this.first);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel={from:this.sel.from,to:this.sel.to,head:this.sel.head,anchor:this.sel.anchor,shift:this.sel.shift,extend:!1,goalColumn:this.sel.goalColumn},e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e||(e={});var t=this.first,n=this.first+this.size;null!=e.from&&e.from>t&&(t=e.from),null!=e.to&&n>e.to&&(n=e.to);var r=new bo(pr(this,t,n),e.mode||this.modeOption,t);return e.sharedHist&&(r.history=this.history),(this.linked||(this.linked=[])).push({doc:r,sharedHist:e.sharedHist}),r.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],r},unlinkDoc:function(t){if(t instanceof e&&(t=t.doc),this.linked)for(var n=0;this.linked.length>n;++n){var r=this.linked[n];if(r.doc==t){this.linked.splice(n,1),t.unlinkDoc(this);break}}if(t.history==this.history){var i=[t.id];cr(t,function(e){i.push(e.id)},!0),t.history=yr(),t.history.done=$r(this.history.done,i),t.history.undone=$r(this.history.undone,i)}},iterLinkedDocs:function(e){cr(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm}}),bo.prototype.eachLine=bo.prototype.iter;var yo="iter insert remove copy getEditor".split(" ");for(var xo in bo.prototype)bo.prototype.hasOwnProperty(xo)&&0>Jr(yo,xo)&&(e.prototype[xo]=function(e){return function(){return e.apply(this.doc,arguments)}}(bo.prototype[xo]));qr(bo),e.e_stop=Fr,e.e_preventDefault=Lr,e.e_stopPropagation=Er;var wo,Co=0;e.on=Ir,e.off=Hr,e.signal=Rr;var So=30,ko=e.Pass={toString:function(){return"CodeMirror.Pass"}};Ur.prototype={set:function(e,t){clearTimeout(this.id),this.id=setTimeout(t,e)}},e.countColumn=Yr;var $o=[""],_o=/[\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,To=/[\u0300-\u036F\u0483-\u0487\u0488-\u0489\u0591-\u05BD\u05BF\u05C1-\u05C2\u05C4-\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7-\u06E8\u06EA-\u06ED\uA66F\uA670-\uA672\uA674-\uA67D\uA69F\udc00-\udfff]/;e.replaceGetRect=function(e){si=e};var Mo=function(){if(_i)return!1;var e=ri("div");return"draggable"in e||"dragDrop"in e}();Si?li=function(e,t){return 36==e.charCodeAt(t-1)&&39==e.charCodeAt(t)}:Li&&!/Version\/([6-9]|\d\d)\b/.test(navigator.userAgent)?li=function(e,t){return/\-[^ \-?]|\?[^ !\'\"\),.\-\/:;\?\]\}]/.test(e.slice(t-1,t+1))
-}:Ti&&!/Chrome\/(?:29|[3-9]\d|\d\d\d)\./.test(navigator.userAgent)&&(li=function(e,t){if(t>1&&45==e.charCodeAt(t-1)){if(/\w/.test(e.charAt(t-2))&&/[^\-?\.]/.test(e.charAt(t)))return!0;if(t>2&&/[\d\.,]/.test(e.charAt(t-2))&&/[\d\.,]/.test(e.charAt(t)))return!1}return/[~!#%&*)=+}\]|\"\.>,:;][({[<]|-[^\-?\.\u2010-\u201f\u2026]|\?[\w~`@#$%\^&*(_=+{[|><]|…[\w~`@#$%\^&*(_=+{[><]/.test(e.slice(t-1,t+1))});var Do,No,Lo=3!="\n\nb".split(/\n/).length?function(e){for(var t=0,n=[],r=e.length;r>=t;){var i=e.indexOf("\n",t);-1==i&&(i=e.length);var o=e.slice(t,"\r"==e.charAt(i-1)?i-1:i),a=o.indexOf("\r");-1!=a?(n.push(o.slice(0,a)),t+=a+1):(n.push(o),t=i+1)}return n}:function(e){return e.split(/\r\n?|\n/)};e.splitLines=Lo;var Eo=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(t){return!1}}:function(e){try{var t=e.ownerDocument.selection.createRange()}catch(n){}return t&&t.parentElement()==e?0!=t.compareEndPoints("StartToEnd",t):!1},Ao=function(){var e=ri("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),"function"==typeof e.oncopy)}(),Fo={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:";",91:"Mod",92:"Mod",93:"Mod",109:"-",107:"=",127:"Delete",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",63276:"PageUp",63277:"PageDown",63275:"End",63273:"Home",63234:"Left",63232:"Up",63235:"Right",63233:"Down",63302:"Insert",63272:"Delete"};e.keyNames=Fo,function(){for(var e=0;10>e;e++)Fo[e+48]=e+"";for(var e=65;90>=e;e++)Fo[e]=String.fromCharCode(e);for(var e=1;12>=e;e++)Fo[e+111]=Fo[e+63235]="F"+e}();var Oo,zo=function(){function e(e){return 255>=e?t.charAt(e):e>=1424&&1524>=e?"R":e>=1536&&1791>=e?n.charAt(e-1536):e>=1792&&2220>=e?"r":"L"}var t="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLL",n="rrrrrrrrrrrr,rNNmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmrrrrrrrnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmNmmmmrrrrrrrrrrrrrrrrrr",r=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,i=/[stwN]/,o=/[LRr]/,a=/[Lb1n]/,s=/[1n]/,l="L";return function(t){if(!r.test(t))return!1;for(var n,c=t.length,u=[],d=0;c>d;++d)u.push(n=e(t.charCodeAt(d)));for(var d=0,h=l;c>d;++d){var n=u[d];"m"==n?u[d]=h:h=n}for(var d=0,p=l;c>d;++d){var n=u[d];"1"==n&&"r"==p?u[d]="n":o.test(n)&&(p=n,"r"==n&&(u[d]="R"))}for(var d=1,h=u[0];c-1>d;++d){var n=u[d];"+"==n&&"1"==h&&"1"==u[d+1]?u[d]="1":","!=n||h!=u[d+1]||"1"!=h&&"n"!=h||(u[d]=h),h=n}for(var d=0;c>d;++d){var n=u[d];if(","==n)u[d]="N";else if("%"==n){for(var f=d+1;c>f&&"%"==u[f];++f);for(var g=d&&"!"==u[d-1]||c-1>f&&"1"==u[f]?"1":"N",m=d;f>m;++m)u[m]=g;d=f-1}}for(var d=0,p=l;c>d;++d){var n=u[d];"L"==p&&"1"==n?u[d]="L":o.test(n)&&(p=n)}for(var d=0;c>d;++d)if(i.test(u[d])){for(var f=d+1;c>f&&i.test(u[f]);++f);for(var v="L"==(d?u[d-1]:l),b="L"==(c-1>f?u[f]:l),g=v||b?"L":"R",m=d;f>m;++m)u[m]=g;d=f-1}for(var y,x=[],d=0;c>d;)if(a.test(u[d])){var w=d;for(++d;c>d&&a.test(u[d]);++d);x.push({from:w,to:d,level:0})}else{var C=d,S=x.length;for(++d;c>d&&"L"!=u[d];++d);for(var m=C;d>m;)if(s.test(u[m])){m>C&&x.splice(S,0,{from:C,to:m,level:1});var k=m;for(++m;d>m&&s.test(u[m]);++m);x.splice(S,0,{from:k,to:m,level:2}),C=m}else++m;d>C&&x.splice(S,0,{from:C,to:d,level:1})}return 1==x[0].level&&(y=t.match(/^\s+/))&&(x[0].from=y[0].length,x.unshift({from:0,to:y[0].length,level:0})),1==Vr(x).level&&(y=t.match(/\s+$/))&&(Vr(x).to-=y[0].length,x.push({from:c-y[0].length,to:c,level:0})),x[0].level!=Vr(x).level&&x.push({from:c,to:c,level:x[0].level}),x}}();return e.version="3.15.0",e}();(function(){"use strict";var e=/^(\s*)([*+-]|(\d+)\.)(\s*)/,t="*+-";x.commands.newlineAndIndentContinueMarkdownList=function(n){var r,i=n.getCursor(),o=n.getStateAfter(i.line).list;if(!o||!(r=n.getLine(i.line).match(e)))return n.execCommand("newlineAndIndent"),void 0;var a=r[1],s=r[4],l=t.indexOf(r[2])>=0?r[2]:parseInt(r[3],10)+1+".";n.replaceSelection("\n"+a+l+s,"end")}})(),x.defineMode("xml",function(e,t){function n(e,t){function n(n){return t.tokenize=n,n(e,t)}var i=e.next();if("<"==i){if(e.eat("!"))return e.eat("[")?e.match("CDATA[")?n(o("atom","]]>")):null:e.match("--")?n(o("comment","-->")):e.match("DOCTYPE",!0,!0)?(e.eatWhile(/[\w\._\-]/),n(a(1))):null;if(e.eat("?"))return e.eatWhile(/[\w\._\-]/),t.tokenize=o("meta","?>"),"meta";var s=e.eat("/");y="";for(var l;l=e.eat(/[^\s\u00a0=<>\"\'\/?]/);)y+=l;return y?(x=s?"closeTag":"openTag",t.tokenize=r,"tag"):"error"}if("&"==i){var c;return c=e.eat("#")?e.eat("x")?e.eatWhile(/[a-fA-F\d]/)&&e.eat(";"):e.eatWhile(/[\d]/)&&e.eat(";"):e.eatWhile(/[\w\.\-:]/)&&e.eat(";"),c?"atom":"error"}return e.eatWhile(/[^&<]/),null}function r(e,t){var r=e.next();return">"==r||"/"==r&&e.eat(">")?(t.tokenize=n,x=">"==r?"endTag":"selfcloseTag","tag"):"="==r?(x="equals",null):"<"==r?"error":/[\'\"]/.test(r)?(t.tokenize=i(r),t.stringStartCol=e.column(),t.tokenize(e,t)):(e.eatWhile(/[^\s\u00a0=<>\"\']/),"word")}function i(e){var t=function(t,n){for(;!t.eol();)if(t.next()==e){n.tokenize=r;break}return"string"};return t.isInAttribute=!0,t}function o(e,t){return function(r,i){for(;!r.eol();){if(r.match(t)){i.tokenize=n;break}r.next()}return e}}function a(e){return function(t,r){for(var i;null!=(i=t.next());){if("<"==i)return r.tokenize=a(e+1),r.tokenize(t,r);if(">"==i){if(1==e){r.tokenize=n;break}return r.tokenize=a(e-1),r.tokenize(t,r)}}return"meta"}}function s(){for(var e=arguments.length-1;e>=0;e--)w.cc.push(arguments[e])}function l(){return s.apply(null,arguments),!0}function c(e,t){var n=T.doNotIndent.hasOwnProperty(e)||w.context&&w.context.noIndent;w.context={prev:w.context,tagName:e,indent:w.indented,startOfLine:t,noIndent:n}}function u(){w.context&&(w.context=w.context.prev)}function d(e){if("openTag"==e)return w.tagName=y,w.tagStart=C.column(),l(g,h(w.startOfLine));if("closeTag"==e){var t=!1;return w.context?w.context.tagName!=y&&(T.implicitlyClosed.hasOwnProperty(w.context.tagName.toLowerCase())&&u(),t=!w.context||w.context.tagName!=y):t=!0,t&&(S="error"),l(p(t))}return l()}function h(e){return function(t){var n=w.tagName;return w.tagName=w.tagStart=null,"selfcloseTag"==t||"endTag"==t&&T.autoSelfClosers.hasOwnProperty(n.toLowerCase())?(f(n.toLowerCase()),l()):"endTag"==t?(f(n.toLowerCase()),c(n,e),l()):l()}}function p(e){return function(t){return e&&(S="error"),"endTag"==t?(u(),l()):(S="error",l(arguments.callee))}}function f(e){for(var t;;){if(!w.context)return;if(t=w.context.tagName.toLowerCase(),!T.contextGrabbers.hasOwnProperty(t)||!T.contextGrabbers[t].hasOwnProperty(e))return;u()}}function g(e){return"word"==e?(S="attribute",l(m,g)):"endTag"==e||"selfcloseTag"==e?s():(S="error",l(g))}function m(e){return"equals"==e?l(v,g):(T.allowMissing?"word"==e&&(S="attribute"):S="error","endTag"==e||"selfcloseTag"==e?s():l())}function v(e){return"string"==e?l(b):"word"==e&&T.allowUnquoted?(S="string",l()):(S="error","endTag"==e||"selfCloseTag"==e?s():l())}function b(e){return"string"==e?l(b):s()}var y,x,w,C,S,k=e.indentUnit,$=t.multilineTagIndentFactor||1,_=t.multilineTagIndentPastTag||!0,T=t.htmlMode?{autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0}:{autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1},M=t.alignCDATA;return{startState:function(){return{tokenize:n,cc:[],indented:0,startOfLine:!0,tagName:null,tagStart:null,context:null}},token:function(e,t){if(!t.tagName&&e.sol()&&(t.startOfLine=!0,t.indented=e.indentation()),e.eatSpace())return null;S=x=y=null;var n=t.tokenize(e,t);if(t.type=x,(n||x)&&"comment"!=n)for(w=t,C=e;;){var r=t.cc.pop()||d;if(r(x||n))break}return t.startOfLine=!1,S||n},indent:function(e,t,i){var o=e.context;if(e.tokenize.isInAttribute)return e.stringStartCol+1;if(e.tokenize!=r&&e.tokenize!=n||o&&o.noIndent)return i?i.match(/^(\s*)/)[0].length:0;if(e.tagName)return _?e.tagStart+e.tagName.length+2:e.tagStart+k*$;if(M&&/",configuration:t.htmlMode?"html":"xml",helperType:t.htmlMode?"html":"xml"}}),x.defineMIME("text/xml","xml"),x.defineMIME("application/xml","xml"),x.mimeModes.hasOwnProperty("text/html")||x.defineMIME("text/html",{name:"xml",htmlMode:!0}),x.defineMode("markdown",function(e,t){function n(e,t,n){return t.f=t.inline=n,n(e,t)}function r(e,t,n){return t.f=t.block=n,n(e,t)}function i(e){return e.linkTitle=!1,e.em=!1,e.strong=!1,e.quote=0,m||e.f!=a||(e.f=u,e.block=o),e.trailingSpace=0,e.trailingSpaceNewLine=!1,e.thisLineHasContent=!1,null}function o(e,i){var o=i.list!==!1;if(i.list!==!1&&i.indentationDiff>=0?(4>i.indentationDiff&&(i.indentation-=i.indentationDiff),i.list=null):i.list!==!1&&i.indentation>0?(i.list=null,i.listDepth=Math.floor(i.indentation/4)):i.list!==!1&&(i.list=!1,i.listDepth=0),i.indentationDiff>=4)return i.indentation-=4,e.skipToEnd(),S;if(e.eatSpace())return null;if("#"===e.peek()||i.prevLineHasContent&&e.match(P))i.header=!0;else if(e.eat(">"))for(i.indentation++,i.quote=1,e.eatSpace();e.eat(">");)e.eatSpace(),i.quote++;else{if("["===e.peek())return n(e,i,h);if(e.match(I,!0))return D;if(i.prevLineHasContent&&!o||!e.match(H,!0)&&!e.match(R,!0)){if(t.fencedCodeBlocks&&e.match(/^```([\w+#]*)/,!0))return i.localMode=y(RegExp.$1),i.localMode&&(i.localState=i.localMode.startState()),r(e,i,s),S}else i.indentation+=4,i.list=!0,i.listDepth++,t.taskLists&&e.match(j,!1)&&(i.taskList=!0)}return n(e,i,i.inline)}function a(e,t){var n=v.token(e,t.htmlState);return m&&"tag"===n&&"openTag"!==t.htmlState.type&&!t.htmlState.context&&(t.f=u,t.block=o),t.md_inside&&-1!=e.current().indexOf(">")&&(t.f=u,t.block=o,t.htmlState.context=void 0),n}function s(e,t){return e.sol()&&e.match(/^```/,!0)?(t.localMode=t.localState=null,t.f=u,t.block=o,S):t.localMode?t.localMode.token(e,t.localState):(e.skipToEnd(),S)}function l(e){var t=[];if(e.taskOpen)return"meta";if(e.taskClosed)return"property";if(e.strong&&t.push(z),e.em&&t.push(O),e.linkText&&t.push(A),e.code&&t.push(S),e.header&&t.push(C),e.quote&&t.push(e.quote%2?k:$),e.list!==!1){var n=(e.listDepth-1)%3;n?1===n?t.push(T):t.push(M):t.push(_)}return e.trailingSpaceNewLine?t.push("trailing-space-new-line"):e.trailingSpace&&t.push("trailing-space-"+(e.trailingSpace%2?"a":"b")),t.length?t.join(" "):null}function c(e,t){return e.match(W,!0)?l(t):void 0}function u(e,i){var o=i.text(e,i);if(o!==void 0)return o;if(i.list)return i.list=null,l(i);if(i.taskList){var s="x"!==e.match(j,!0)[1];return s?i.taskOpen=!0:i.taskClosed=!0,i.taskList=!1,l(i)}i.taskOpen=!1,i.taskClosed=!1;var c=e.next();if("\\"===c)return e.next(),l(i);if(i.linkTitle){i.linkTitle=!1;var u=c;"("===c&&(u=")"),u=(u+"").replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1");var h="^\\s*(?:[^"+u+"\\\\]+|\\\\\\\\|\\\\.)"+u;if(e.match(RegExp(h),!0))return F}if("`"===c){var p=l(i),f=e.pos;e.eatWhile("`");var m=1+e.pos-f;return i.code?m===w?(i.code=!1,p):l(i):(w=m,i.code=!0,l(i))}if(i.code)return l(i);if("!"===c&&e.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return e.match(/\[[^\]]*\]/),i.inline=i.f=d,N;if("["===c&&e.match(/.*\](\(| ?\[)/,!1))return i.linkText=!0,l(i);if("]"===c&&i.linkText){var v=l(i);return i.linkText=!1,i.inline=i.f=d,v}if("<"===c&&e.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1))return n(e,i,g(L,">"));if("<"===c&&e.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1))return n(e,i,g(E,">"));if("<"===c&&e.match(/^\w/,!1)){if(-1!=e.string.indexOf(">")){var b=e.string.substring(1,e.string.indexOf(">"));/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(b)&&(i.md_inside=!0)}return e.backUp(1),r(e,i,a)}if("<"===c&&e.match(/^\/\w*?>/))return i.md_inside=!1,"tag";var y=!1;if(!t.underscoresBreakWords&&"_"===c&&"_"!==e.peek()&&e.match(/(\w)/,!1)){var x=e.pos-2;if(x>=0){var C=e.string.charAt(x);"_"!==C&&C.match(/(\w)/,!1)&&(y=!0)}}var p=l(i);if("*"===c||"_"===c&&!y){if(i.strong===c&&e.eat(c))return i.strong=!1,p;if(!i.strong&&e.eat(c))return i.strong=c,l(i);if(i.em===c)return i.em=!1,p;if(!i.em)return i.em=c,l(i)}else if(" "===c&&(e.eat("*")||e.eat("_"))){if(" "===e.peek())return l(i);e.backUp(1)}return" "===c&&(e.match(/ +$/,!1)?i.trailingSpace++:i.trailingSpace&&(i.trailingSpaceNewLine=!0)),l(i)}function d(e,t){if(e.eatSpace())return null;var r=e.next();return"("===r||"["===r?n(e,t,g(F,"("===r?")":"]")):"error"}function h(e,t){return e.match(/^[^\]]*\]:/,!0)?(t.f=p,A):n(e,t,u)}function p(e,t){return e.eatSpace()?null:(e.match(/^[^\s]+/,!0),void 0===e.peek()?t.linkTitle=!0:e.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),t.f=t.inline=u,F)}function f(e){return B[e]||(e=(e+"").replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1"),B[e]=RegExp("^(?:[^\\\\]|\\\\.)*?("+e+")")),B[e]}function g(e,t,n){return n=n||u,function(r,i){return r.match(f(t)),i.inline=i.f=n,e}}var m=x.modes.hasOwnProperty("xml"),v=x.getMode(e,m?{name:"xml",htmlMode:!0}:"text/plain"),b={html:"htmlmixed",js:"javascript",json:"application/json",c:"text/x-csrc","c++":"text/x-c++src",java:"text/x-java",csharp:"text/x-csharp","c#":"text/x-csharp",scala:"text/x-scala"},y=function(){var t,n,r={},i={},o=[];for(var a in x.modes)x.modes.propertyIsEnumerable(a)&&o.push(a);for(t=0;o.length>t;t++)r[o[t]]=o[t];var s=[];for(var a in x.mimeModes)x.mimeModes.propertyIsEnumerable(a)&&s.push({mime:a,mode:x.mimeModes[a]});for(t=0;s.length>t;t++)n=s[t].mime,i[n]=s[t].mime;for(var l in b)(b[l]in r||b[l]in i)&&(r[l]=b[l]);return function(t){return r[t]?x.getMode(e,r[t]):null}}();void 0===t.underscoresBreakWords&&(t.underscoresBreakWords=!0),void 0===t.fencedCodeBlocks&&(t.fencedCodeBlocks=!1),void 0===t.taskLists&&(t.taskLists=!1);var w=0,C="header",S="comment",k="atom",$="number",_="variable-2",T="variable-3",M="keyword",D="hr",N="tag",L="link",E="link",A="link",F="string",O="em",z="strong",I=/^([*\-=_])(?:\s*\1){2,}\s*$/,H=/^[*\-+]\s+/,R=/^[0-9]+\.\s+/,j=/^\[(x| )\](?=\s)/,P=/^(?:\={1,}|-{1,})$/,W=/^[^!\[\]*_\\<>` "'(]+/,B=[];return{startState:function(){return{f:o,prevLineHasContent:!1,thisLineHasContent:!1,block:o,htmlState:x.startState(v),indentation:0,inline:u,text:c,linkText:!1,linkTitle:!1,em:!1,strong:!1,header:!1,taskList:!1,list:!1,listDepth:0,quote:0,trailingSpace:0,trailingSpaceNewLine:!1}},copyState:function(e){return{f:e.f,prevLineHasContent:e.prevLineHasContent,thisLineHasContent:e.thisLineHasContent,block:e.block,htmlState:x.copyState(v,e.htmlState),indentation:e.indentation,localMode:e.localMode,localState:e.localMode?x.copyState(e.localMode,e.localState):null,inline:e.inline,text:e.text,linkTitle:e.linkTitle,em:e.em,strong:e.strong,header:e.header,taskList:e.taskList,list:e.list,listDepth:e.listDepth,quote:e.quote,trailingSpace:e.trailingSpace,trailingSpaceNewLine:e.trailingSpaceNewLine,md_inside:e.md_inside}},token:function(e,t){if(e.sol()){if(e.match(/^\s*$/,!0))return t.prevLineHasContent=!1,i(t);t.prevLineHasContent=t.thisLineHasContent,t.thisLineHasContent=!0,t.header=!1,t.taskList=!1,t.code=!1,t.trailingSpace=0,t.trailingSpaceNewLine=!1,t.f=t.block;var n=e.match(/^\s*/,!0)[0].replace(/\t/g," ").length,r=4*Math.floor((n-t.indentation)/4);r>4&&(r=4);var o=t.indentation+r;if(t.indentationDiff=o-t.indentation,t.indentation=o,n>0)return null}return t.f(e,t)},blankLine:i,getType:l}},"xml"),x.defineMIME("text/x-markdown","markdown");var w=/Mac/.test(navigator.platform),C={"Cmd-B":a,"Cmd-I":s,"Cmd-K":d,"Cmd-Alt-I":h,"Cmd-'":l,"Cmd-Alt-L":u,"Cmd-L":c},S=[{name:"bold",action:a},{name:"italic",action:s},"|",{name:"quote",action:l},{name:"unordered-list",action:c},{name:"ordered-list",action:u},"|",{name:"link",action:d},{name:"image",action:h},"|",{name:"info",action:"http://lab.lepture.com/editor/markdown"},{name:"preview",action:g},{name:"fullscreen",action:o}];y.toolbar=S,y.markdown=function(e){return window.marked?marked(e):void 0},y.prototype.render=function(e){if(e||(e=this.element||document.getElementsByTagName("textarea")[0]),!this._rendered||this._rendered!==e){this.element=e;var n=this.options,r=this,i={};for(var o in C)(function(e){i[t(e)]=function(){C[e](r)}})(o);i.Enter="newlineAndIndentContinueMarkdownList",this.codemirror=x.fromTextArea(e,{mode:"markdown",theme:"paper",indentWithTabs:!0,lineNumbers:!1,extraKeys:i}),n.toolbar!==!1&&this.createToolbar(),n.status!==!1&&this.createStatusbar(),this._rendered=this.element}},y.prototype.createToolbar=function(e){if(e=e||this.options.toolbar,e&&0!==e.length){var t=document.createElement("div");t.className="editor-toolbar";var o=this;o.toolbar={};for(var a=0;e.length>a;a++)(function(e){var i;i=e.name?n(e.name,e):"|"===e?r():n(e),e.action&&("function"==typeof e.action?i.onclick=function(){e.action(o)}:"string"==typeof e.action&&(i.href=e.action,i.target="_blank")),o.toolbar[e.name||e]=i,t.appendChild(i)})(e[a]);var s=this.codemirror;s.on("cursorActivity",function(){var e=i(s);for(var t in o.toolbar)(function(t){var n=o.toolbar[t];e[t]?n.className+=" active":n.className=n.className.replace(/\s*active\s*/g,"")})(t)});var l=s.getWrapperElement();return l.parentNode.insertBefore(t,l),t}},y.prototype.createStatusbar=function(e){if(e=e||this.options.status,e&&0!==e.length){var t=document.createElement("div");t.className="editor-statusbar";for(var n,r=this.codemirror,i=0;e.length>i;i++)(function(e){var i=document.createElement("span");i.className=e,"words"===e?(i.innerHTML="0",r.on("update",function(){i.innerHTML=b(r.getValue())})):"lines"===e?(i.innerHTML="0",r.on("update",function(){i.innerHTML=r.lineCount()})):"cursor"===e&&(i.innerHTML="0:0",r.on("cursorActivity",function(){n=r.getCursor(),i.innerHTML=n.line+":"+n.ch})),t.appendChild(i)})(e[i]);var o=this.codemirror.getWrapperElement();return o.parentNode.insertBefore(t,o.nextSibling),t}},y.toggleBold=a,y.toggleItalic=s,y.toggleBlockquote=l,y.toggleUnOrderedList=c,y.toggleOrderedList=u,y.drawLink=d,y.drawImage=h,y.undo=p,y.redo=f,y.toggleFullScreen=o,y.prototype.toggleBold=function(){a(this)},y.prototype.toggleItalic=function(){s(this)},y.prototype.toggleBlockquote=function(){l(this)},y.prototype.toggleUnOrderedList=function(){c(this)},y.prototype.toggleOrderedList=function(){u(this)},y.prototype.drawLink=function(){d(this)},y.prototype.drawImage=function(){h(this)},y.prototype.undo=function(){p(this)},y.prototype.redo=function(){f(this)},y.prototype.toggleFullScreen=function(){o(this)},e.Editor=y}(this),!function(){function e(t){var n=e.modules[t];if(!n)throw Error('failed to require "'+t+'"');return"exports"in n||"function"!=typeof n.definition||(n.client=n.component=!0,n.definition.call(this,n.exports={},n),delete n.definition),n.exports}e.modules={},e.register=function(t,n){e.modules[t]={definition:n}},e.define=function(t,n){e.modules[t]={exports:n}},e.register("component~emitter@1.1.2",function(e,t){function n(e){return e?r(e):void 0}function r(e){for(var t in n.prototype)e[t]=n.prototype[t];return e}t.exports=n,n.prototype.on=n.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks[e]=this._callbacks[e]||[]).push(t),this},n.prototype.once=function(e,t){function n(){r.off(e,n),t.apply(this,arguments)}var r=this;return this._callbacks=this._callbacks||{},n.fn=t,this.on(e,n),this},n.prototype.off=n.prototype.removeListener=n.prototype.removeAllListeners=n.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var n=this._callbacks[e];if(!n)return this;if(1==arguments.length)return delete this._callbacks[e],this;for(var r,i=0;n.length>i;i++)if(r=n[i],r===t||r.fn===t){n.splice(i,1);break}return this},n.prototype.emit=function(e){this._callbacks=this._callbacks||{};var t=[].slice.call(arguments,1),n=this._callbacks[e];if(n){n=n.slice(0);for(var r=0,i=n.length;i>r;++r)n[r].apply(this,t)}return this},n.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks[e]||[]},n.prototype.hasListeners=function(e){return!!this.listeners(e).length}}),e.register("dropzone",function(t,n){n.exports=e("dropzone/lib/dropzone.js")}),e.register("dropzone/lib/dropzone.js",function(t,n){(function(){var t,r,i,o,a,s,l,c,u={}.hasOwnProperty,d=function(e,t){function n(){this.constructor=e}for(var r in t)u.call(t,r)&&(e[r]=t[r]);return n.prototype=t.prototype,e.prototype=new n,e.__super__=t.prototype,e},h=[].slice;r="undefined"!=typeof Emitter&&null!==Emitter?Emitter:e("component~emitter@1.1.2"),l=function(){},t=function(e){function t(e,r){var i,o,a;if(this.element=e,this.version=t.version,this.defaultOptions.previewTemplate=this.defaultOptions.previewTemplate.replace(/\n*/g,""),this.clickableElements=[],this.listeners=[],this.files=[],"string"==typeof this.element&&(this.element=document.querySelector(this.element)),!this.element||null==this.element.nodeType)throw Error("Invalid dropzone element.");if(this.element.dropzone)throw Error("Dropzone already attached.");if(t.instances.push(this),this.element.dropzone=this,i=null!=(a=t.optionsForElement(this.element))?a:{},this.options=n({},this.defaultOptions,i,null!=r?r:{}),this.options.forceFallback||!t.isBrowserSupported())return this.options.fallback.call(this);if(null==this.options.url&&(this.options.url=this.element.getAttribute("action")),!this.options.url)throw Error("No URL provided.");if(this.options.acceptedFiles&&this.options.acceptedMimeTypes)throw Error("You can't provide both 'acceptedFiles' and 'acceptedMimeTypes'. 'acceptedMimeTypes' is deprecated.");this.options.acceptedMimeTypes&&(this.options.acceptedFiles=this.options.acceptedMimeTypes,delete this.options.acceptedMimeTypes),this.options.method=this.options.method.toUpperCase(),(o=this.getExistingFallback())&&o.parentNode&&o.parentNode.removeChild(o),this.options.previewsContainer!==!1&&(this.previewsContainer=this.options.previewsContainer?t.getElement(this.options.previewsContainer,"previewsContainer"):this.element),this.options.clickable&&(this.clickableElements=this.options.clickable===!0?[this.element]:t.getElements(this.options.clickable,"clickable")),this.init()}var n;return d(t,e),t.prototype.events=["drop","dragstart","dragend","dragenter","dragover","dragleave","addedfile","removedfile","thumbnail","error","errormultiple","processing","processingmultiple","uploadprogress","totaluploadprogress","sending","sendingmultiple","success","successmultiple","canceled","canceledmultiple","complete","completemultiple","reset","maxfilesexceeded","maxfilesreached"],t.prototype.defaultOptions={url:null,method:"post",withCredentials:!1,parallelUploads:2,uploadMultiple:!1,maxFilesize:256,paramName:"file",createImageThumbnails:!0,maxThumbnailFilesize:10,thumbnailWidth:100,thumbnailHeight:100,maxFiles:null,params:{},clickable:!0,ignoreHiddenFiles:!0,acceptedFiles:null,acceptedMimeTypes:null,autoProcessQueue:!0,autoQueue:!0,addRemoveLinks:!1,previewsContainer:null,dictDefaultMessage:"Drop files here to upload",dictFallbackMessage:"Your browser does not support drag'n'drop file uploads.",dictFallbackText:"Please use the fallback form below to upload your files like in the olden days.",dictFileTooBig:"File is too big ({{filesize}}MiB). Max filesize: {{maxFilesize}}MiB.",dictInvalidFileType:"You can't upload files of this type.",dictResponseError:"Server responded with {{statusCode}} code.",dictCancelUpload:"Cancel upload",dictCancelUploadConfirmation:"Are you sure you want to cancel this upload?",dictRemoveFile:"Remove file",dictRemoveFileConfirmation:null,dictMaxFilesExceeded:"You can not upload any more files.",accept:function(e,t){return t()},init:function(){return l},forceFallback:!1,fallback:function(){var e,n,r,i,o,a;for(this.element.className=""+this.element.className+" dz-browser-not-supported",a=this.element.getElementsByTagName("div"),i=0,o=a.length;o>i;i++)e=a[i],/(^| )dz-message($| )/.test(e.className)&&(n=e,e.className="dz-message");return n||(n=t.createElement('r?(t.srcHeight=e.height,t.srcWidth=t.srcHeight*r):(t.srcWidth=e.width,t.srcHeight=t.srcWidth/r),t.srcX=(e.width-t.srcWidth)/2,t.srcY=(e.height-t.srcHeight)/2,t},drop:function(){return this.element.classList.remove("dz-drag-hover")},dragstart:l,dragend:function(){return this.element.classList.remove("dz-drag-hover")},dragenter:function(){return this.element.classList.add("dz-drag-hover")},dragover:function(){return this.element.classList.add("dz-drag-hover")},dragleave:function(){return this.element.classList.remove("dz-drag-hover")},paste:l,reset:function(){return this.element.classList.remove("dz-started")},addedfile:function(e){var n,r,i,o,a,s,l,c,u,d,h,p,f;if(this.element===this.previewsContainer&&this.element.classList.add("dz-started"),this.previewsContainer){for(e.previewElement=t.createElement(this.options.previewTemplate.trim()),e.previewTemplate=e.previewElement,this.previewsContainer.appendChild(e.previewElement),d=e.previewElement.querySelectorAll("[data-dz-name]"),o=0,l=d.length;l>o;o++)n=d[o],n.textContent=e.name;for(h=e.previewElement.querySelectorAll("[data-dz-size]"),a=0,c=h.length;c>a;a++)n=h[a],n.innerHTML=this.filesize(e.size);for(this.options.addRemoveLinks&&(e._removeLink=t.createElement(''+this.options.dictRemoveFile+""),e.previewElement.appendChild(e._removeLink)),r=function(n){return function(r){return r.preventDefault(),r.stopPropagation(),e.status===t.UPLOADING?t.confirm(n.options.dictCancelUploadConfirmation,function(){return n.removeFile(e)}):n.options.dictRemoveFileConfirmation?t.confirm(n.options.dictRemoveFileConfirmation,function(){return n.removeFile(e)}):n.removeFile(e)}}(this),p=e.previewElement.querySelectorAll("[data-dz-remove]"),f=[],s=0,u=p.length;u>s;s++)i=p[s],f.push(i.addEventListener("click",r));return f}},removedfile:function(e){var t;return e.previewElement&&null!=(t=e.previewElement)&&t.parentNode.removeChild(e.previewElement),this._updateMaxFilesReachedClass()},thumbnail:function(e,t){var n,r,i,o,a;if(e.previewElement){for(e.previewElement.classList.remove("dz-file-preview"),e.previewElement.classList.add("dz-image-preview"),o=e.previewElement.querySelectorAll("[data-dz-thumbnail]"),a=[],r=0,i=o.length;i>r;r++)n=o[r],n.alt=e.name,a.push(n.src=t);return a}},error:function(e,t){var n,r,i,o,a;if(e.previewElement){for(e.previewElement.classList.add("dz-error"),"String"!=typeof t&&t.error&&(t=t.error),o=e.previewElement.querySelectorAll("[data-dz-errormessage]"),a=[],r=0,i=o.length;i>r;r++)n=o[r],a.push(n.textContent=t);return a}},errormultiple:l,processing:function(e){return e.previewElement&&(e.previewElement.classList.add("dz-processing"),e._removeLink)?e._removeLink.textContent=this.options.dictCancelUpload:void 0},processingmultiple:l,uploadprogress:function(e,t){var n,r,i,o,a;if(e.previewElement){for(o=e.previewElement.querySelectorAll("[data-dz-uploadprogress]"),a=[],r=0,i=o.length;i>r;r++)n=o[r],a.push(n.style.width=""+t+"%");return a}},totaluploadprogress:l,sending:l,sendingmultiple:l,success:function(e){return e.previewElement?e.previewElement.classList.add("dz-success"):void 0},successmultiple:l,canceled:function(e){return this.emit("error",e,"Upload canceled.")},canceledmultiple:l,complete:function(e){return e._removeLink?e._removeLink.textContent=this.options.dictRemoveFile:void 0},completemultiple:l,maxfilesexceeded:l,maxfilesreached:l,previewTemplate:'\n \n \n \n \n \n \n ✔\n ✘\n \n'},n=function(){var e,t,n,r,i,o,a;for(r=arguments[0],n=arguments.length>=2?h.call(arguments,1):[],o=0,a=n.length;a>o;o++){t=n[o];for(e in t)i=t[e],r[e]=i}return r},t.prototype.getAcceptedFiles=function(){var e,t,n,r,i;for(r=this.files,i=[],t=0,n=r.length;n>t;t++)e=r[t],e.accepted&&i.push(e);return i},t.prototype.getRejectedFiles=function(){var e,t,n,r,i;for(r=this.files,i=[],t=0,n=r.length;n>t;t++)e=r[t],e.accepted||i.push(e);return i},t.prototype.getFilesWithStatus=function(e){var t,n,r,i,o;for(i=this.files,o=[],n=0,r=i.length;r>n;n++)t=i[n],t.status===e&&o.push(t);return o},t.prototype.getQueuedFiles=function(){return this.getFilesWithStatus(t.QUEUED)},t.prototype.getUploadingFiles=function(){return this.getFilesWithStatus(t.UPLOADING)},t.prototype.getActiveFiles=function(){var e,n,r,i,o;for(i=this.files,o=[],n=0,r=i.length;r>n;n++)e=i[n],(e.status===t.UPLOADING||e.status===t.QUEUED)&&o.push(e);return o},t.prototype.init=function(){var e,n,r,i,o,a,s;for("form"===this.element.tagName&&this.element.setAttribute("enctype","multipart/form-data"),this.element.classList.contains("dropzone")&&!this.element.querySelector(".dz-message")&&this.element.appendChild(t.createElement(' ")),this.clickableElements.length&&(r=function(e){return function(){return e.hiddenFileInput&&document.body.removeChild(e.hiddenFileInput),e.hiddenFileInput=document.createElement("input"),e.hiddenFileInput.setAttribute("type","file"),(null==e.options.maxFiles||e.options.maxFiles>1)&&e.hiddenFileInput.setAttribute("multiple","multiple"),e.hiddenFileInput.className="dz-hidden-input",null!=e.options.acceptedFiles&&e.hiddenFileInput.setAttribute("accept",e.options.acceptedFiles),e.hiddenFileInput.style.visibility="hidden",e.hiddenFileInput.style.position="absolute",e.hiddenFileInput.style.top="0",e.hiddenFileInput.style.left="0",e.hiddenFileInput.style.height="0",e.hiddenFileInput.style.width="0",document.body.appendChild(e.hiddenFileInput),e.hiddenFileInput.addEventListener("change",function(){var t,n,i,o;if(n=e.hiddenFileInput.files,n.length)for(i=0,o=n.length;o>i;i++)t=n[i],e.addFile(t);return r()})}}(this))(),this.URL=null!=(a=window.URL)?a:window.webkitURL,s=this.events,i=0,o=s.length;o>i;i++)e=s[i],this.on(e,this.options[e]);return this.on("uploadprogress",function(e){return function(){return e.updateTotalUploadProgress()
-}}(this)),this.on("removedfile",function(e){return function(){return e.updateTotalUploadProgress()}}(this)),this.on("canceled",function(e){return function(t){return e.emit("complete",t)}}(this)),this.on("complete",function(e){return function(){return 0===e.getUploadingFiles().length&&0===e.getQueuedFiles().length?setTimeout(function(){return e.emit("queuecomplete")},0):void 0}}(this)),n=function(e){return e.stopPropagation(),e.preventDefault?e.preventDefault():e.returnValue=!1},this.listeners=[{element:this.element,events:{dragstart:function(e){return function(t){return e.emit("dragstart",t)}}(this),dragenter:function(e){return function(t){return n(t),e.emit("dragenter",t)}}(this),dragover:function(e){return function(t){var r;try{r=t.dataTransfer.effectAllowed}catch(i){}return t.dataTransfer.dropEffect="move"===r||"linkMove"===r?"move":"copy",n(t),e.emit("dragover",t)}}(this),dragleave:function(e){return function(t){return e.emit("dragleave",t)}}(this),drop:function(e){return function(t){return n(t),e.drop(t)}}(this),dragend:function(e){return function(t){return e.emit("dragend",t)}}(this)}}],this.clickableElements.forEach(function(e){return function(n){return e.listeners.push({element:n,events:{click:function(r){return n!==e.element||r.target===e.element||t.elementInside(r.target,e.element.querySelector(".dz-message"))?e.hiddenFileInput.click():void 0}}})}}(this)),this.enable(),this.options.init.call(this)},t.prototype.destroy=function(){var e;return this.disable(),this.removeAllFiles(!0),(null!=(e=this.hiddenFileInput)?e.parentNode:void 0)&&(this.hiddenFileInput.parentNode.removeChild(this.hiddenFileInput),this.hiddenFileInput=null),delete this.element.dropzone,t.instances.splice(t.instances.indexOf(this),1)},t.prototype.updateTotalUploadProgress=function(){var e,t,n,r,i,o,a,s;if(r=0,n=0,e=this.getActiveFiles(),e.length){for(s=this.getActiveFiles(),o=0,a=s.length;a>o;o++)t=s[o],r+=t.upload.bytesSent,n+=t.upload.total;i=100*r/n}else i=100;return this.emit("totaluploadprogress",i,n,r)},t.prototype._getParamName=function(e){return"function"==typeof this.options.paramName?this.options.paramName(e):""+this.options.paramName+(this.options.uploadMultiple?"["+e+"]":"")},t.prototype.getFallbackForm=function(){var e,n,r,i;return(e=this.getExistingFallback())?e:(r='',this.options.dictFallbackText&&(r+=""+this.options.dictFallbackText+"
"),r+='',n=t.createElement(r),"FORM"!==this.element.tagName?(i=t.createElement(''),i.appendChild(n)):(this.element.setAttribute("enctype","multipart/form-data"),this.element.setAttribute("method",this.options.method)),null!=i?i:n)},t.prototype.getExistingFallback=function(){var e,t,n,r,i,o;for(t=function(e){var t,n,r;for(n=0,r=e.length;r>n;n++)if(t=e[n],/(^| )fallback($| )/.test(t.className))return t},o=["div","form"],r=0,i=o.length;i>r;r++)if(n=o[r],e=t(this.element.getElementsByTagName(n)))return e},t.prototype.setupEventListeners=function(){var e,t,n,r,i,o,a;for(o=this.listeners,a=[],r=0,i=o.length;i>r;r++)e=o[r],a.push(function(){var r,i;r=e.events,i=[];for(t in r)n=r[t],i.push(e.element.addEventListener(t,n,!1));return i}());return a},t.prototype.removeEventListeners=function(){var e,t,n,r,i,o,a;for(o=this.listeners,a=[],r=0,i=o.length;i>r;r++)e=o[r],a.push(function(){var r,i;r=e.events,i=[];for(t in r)n=r[t],i.push(e.element.removeEventListener(t,n,!1));return i}());return a},t.prototype.disable=function(){var e,t,n,r,i;for(this.clickableElements.forEach(function(e){return e.classList.remove("dz-clickable")}),this.removeEventListeners(),r=this.files,i=[],t=0,n=r.length;n>t;t++)e=r[t],i.push(this.cancelUpload(e));return i},t.prototype.enable=function(){return this.clickableElements.forEach(function(e){return e.classList.add("dz-clickable")}),this.setupEventListeners()},t.prototype.filesize=function(e){var t;return e>=109951162777.6?(e/=109951162777.6,t="TiB"):e>=107374182.4?(e/=107374182.4,t="GiB"):e>=104857.6?(e/=104857.6,t="MiB"):e>=102.4?(e/=102.4,t="KiB"):(e=10*e,t="b"),""+Math.round(e)/10+" "+t},t.prototype._updateMaxFilesReachedClass=function(){return null!=this.options.maxFiles&&this.getAcceptedFiles().length>=this.options.maxFiles?(this.getAcceptedFiles().length===this.options.maxFiles&&this.emit("maxfilesreached",this.files),this.element.classList.add("dz-max-files-reached")):this.element.classList.remove("dz-max-files-reached")},t.prototype.drop=function(e){var t,n;e.dataTransfer&&(this.emit("drop",e),t=e.dataTransfer.files,t.length&&(n=e.dataTransfer.items,n&&n.length&&null!=n[0].webkitGetAsEntry?this._addFilesFromItems(n):this.handleFiles(t)))},t.prototype.paste=function(e){var t,n;return null!=(null!=e&&null!=(n=e.clipboardData)?n.items:void 0)?(this.emit("paste",e),t=e.clipboardData.items,t.length?this._addFilesFromItems(t):void 0):void 0},t.prototype.handleFiles=function(e){var t,n,r,i;for(i=[],n=0,r=e.length;r>n;n++)t=e[n],i.push(this.addFile(t));return i},t.prototype._addFilesFromItems=function(e){var t,n,r,i,o;for(o=[],r=0,i=e.length;i>r;r++)n=e[r],o.push(null!=n.webkitGetAsEntry&&(t=n.webkitGetAsEntry())?t.isFile?this.addFile(n.getAsFile()):t.isDirectory?this._addFilesFromDirectory(t,t.name):void 0:null!=n.getAsFile?null==n.kind||"file"===n.kind?this.addFile(n.getAsFile()):void 0:void 0);return o},t.prototype._addFilesFromDirectory=function(e,t){var n,r;return n=e.createReader(),r=function(e){return function(n){var r,i,o;for(i=0,o=n.length;o>i;i++)r=n[i],r.isFile?r.file(function(n){return e.options.ignoreHiddenFiles&&"."===n.name.substring(0,1)?void 0:(n.fullPath=""+t+"/"+n.name,e.addFile(n))}):r.isDirectory&&e._addFilesFromDirectory(r,""+t+"/"+r.name)}}(this),n.readEntries(r,function(e){return"undefined"!=typeof console&&null!==console&&"function"==typeof console.log?console.log(e):void 0})},t.prototype.accept=function(e,n){return e.size>1024*1024*this.options.maxFilesize?n(this.options.dictFileTooBig.replace("{{filesize}}",Math.round(e.size/1024/10.24)/100).replace("{{maxFilesize}}",this.options.maxFilesize)):t.isValidFile(e,this.options.acceptedFiles)?null!=this.options.maxFiles&&this.getAcceptedFiles().length>=this.options.maxFiles?(n(this.options.dictMaxFilesExceeded.replace("{{maxFiles}}",this.options.maxFiles)),this.emit("maxfilesexceeded",e)):this.options.accept.call(this,e,n):n(this.options.dictInvalidFileType)},t.prototype.addFile=function(e){return e.upload={progress:0,total:e.size,bytesSent:0},this.files.push(e),e.status=t.ADDED,this.emit("addedfile",e),this._enqueueThumbnail(e),this.accept(e,function(t){return function(n){return n?(e.accepted=!1,t._errorProcessing([e],n)):(e.accepted=!0,t.options.autoQueue&&t.enqueueFile(e)),t._updateMaxFilesReachedClass()}}(this))},t.prototype.enqueueFiles=function(e){var t,n,r;for(n=0,r=e.length;r>n;n++)t=e[n],this.enqueueFile(t);return null},t.prototype.enqueueFile=function(e){if(e.status!==t.ADDED||e.accepted!==!0)throw Error("This file can't be queued because it has already been processed or was rejected.");return e.status=t.QUEUED,this.options.autoProcessQueue?setTimeout(function(e){return function(){return e.processQueue()}}(this),0):void 0},t.prototype._thumbnailQueue=[],t.prototype._processingThumbnail=!1,t.prototype._enqueueThumbnail=function(e){return this.options.createImageThumbnails&&e.type.match(/image.*/)&&e.size<=1024*1024*this.options.maxThumbnailFilesize?(this._thumbnailQueue.push(e),setTimeout(function(e){return function(){return e._processThumbnailQueue()}}(this),0)):void 0},t.prototype._processThumbnailQueue=function(){return this._processingThumbnail||0===this._thumbnailQueue.length?void 0:(this._processingThumbnail=!0,this.createThumbnail(this._thumbnailQueue.shift(),function(e){return function(){return e._processingThumbnail=!1,e._processThumbnailQueue()}}(this)))},t.prototype.removeFile=function(e){return e.status===t.UPLOADING&&this.cancelUpload(e),this.files=c(this.files,e),this.emit("removedfile",e),0===this.files.length?this.emit("reset"):void 0},t.prototype.removeAllFiles=function(e){var n,r,i,o;for(null==e&&(e=!1),o=this.files.slice(),r=0,i=o.length;i>r;r++)n=o[r],(n.status!==t.UPLOADING||e)&&this.removeFile(n);return null},t.prototype.createThumbnail=function(e,t){var n;return n=new FileReader,n.onload=function(r){return function(){var i;return i=document.createElement("img"),i.onload=function(){var n,o,a,l,c,u,d,h;return e.width=i.width,e.height=i.height,a=r.options.resize.call(r,e),null==a.trgWidth&&(a.trgWidth=a.optWidth),null==a.trgHeight&&(a.trgHeight=a.optHeight),n=document.createElement("canvas"),o=n.getContext("2d"),n.width=a.trgWidth,n.height=a.trgHeight,s(o,i,null!=(c=a.srcX)?c:0,null!=(u=a.srcY)?u:0,a.srcWidth,a.srcHeight,null!=(d=a.trgX)?d:0,null!=(h=a.trgY)?h:0,a.trgWidth,a.trgHeight),l=n.toDataURL("image/png"),r.emit("thumbnail",e,l),null!=t?t():void 0},i.src=n.result}}(this),n.readAsDataURL(e)},t.prototype.processQueue=function(){var e,t,n,r;if(t=this.options.parallelUploads,n=this.getUploadingFiles().length,e=n,!(n>=t)&&(r=this.getQueuedFiles(),r.length>0)){if(this.options.uploadMultiple)return this.processFiles(r.slice(0,t-n));for(;t>e;){if(!r.length)return;this.processFile(r.shift()),e++}}},t.prototype.processFile=function(e){return this.processFiles([e])},t.prototype.processFiles=function(e){var n,r,i;for(r=0,i=e.length;i>r;r++)n=e[r],n.processing=!0,n.status=t.UPLOADING,this.emit("processing",n);return this.options.uploadMultiple&&this.emit("processingmultiple",e),this.uploadFiles(e)},t.prototype._getFilesWithXhr=function(e){var t,n;return n=function(){var n,r,i,o;for(i=this.files,o=[],n=0,r=i.length;r>n;n++)t=i[n],t.xhr===e&&o.push(t);return o}.call(this)},t.prototype.cancelUpload=function(e){var n,r,i,o,a,s,l;if(e.status===t.UPLOADING){for(r=this._getFilesWithXhr(e.xhr),i=0,a=r.length;a>i;i++)n=r[i],n.status=t.CANCELED;for(e.xhr.abort(),o=0,s=r.length;s>o;o++)n=r[o],this.emit("canceled",n);this.options.uploadMultiple&&this.emit("canceledmultiple",r)}else((l=e.status)===t.ADDED||l===t.QUEUED)&&(e.status=t.CANCELED,this.emit("canceled",e),this.options.uploadMultiple&&this.emit("canceledmultiple",[e]));return this.options.autoProcessQueue?this.processQueue():void 0},t.prototype.uploadFile=function(e){return this.uploadFiles([e])},t.prototype.uploadFiles=function(e){var r,i,o,a,s,l,c,u,d,h,p,f,g,m,v,b,y,x,w,C,S,k,$,_,T,M,D,N,L,E,A,F;for(y=new XMLHttpRequest,x=0,k=e.length;k>x;x++)r=e[x],r.xhr=y;y.open(this.options.method,this.options.url,!0),y.withCredentials=!!this.options.withCredentials,m=null,o=function(t){return function(){var n,i,o;for(o=[],n=0,i=e.length;i>n;n++)r=e[n],o.push(t._errorProcessing(e,m||t.options.dictResponseError.replace("{{statusCode}}",y.status),y));return o}}(this),v=function(t){return function(n){var i,o,a,s,l,c,u,d,h;if(null!=n)for(o=100*n.loaded/n.total,a=0,c=e.length;c>a;a++)r=e[a],r.upload={progress:o,total:n.total,bytesSent:n.loaded};else{for(i=!0,o=100,s=0,u=e.length;u>s;s++)r=e[s],(100!==r.upload.progress||r.upload.bytesSent!==r.upload.total)&&(i=!1),r.upload.progress=o,r.upload.bytesSent=r.upload.total;if(i)return}for(h=[],l=0,d=e.length;d>l;l++)r=e[l],h.push(t.emit("uploadprogress",r,o,r.upload.bytesSent));return h}}(this),y.onload=function(n){return function(r){var i;if(e[0].status!==t.CANCELED&&4===y.readyState){if(m=y.responseText,y.getResponseHeader("content-type")&&~y.getResponseHeader("content-type").indexOf("application/json"))try{m=JSON.parse(m)}catch(a){r=a,m="Invalid JSON response from server."}return v(),(i=y.status)>=200&&300>i?n._finished(e,m,r):o()}}}(this),y.onerror=function(){return function(){return e[0].status!==t.CANCELED?o():void 0}}(this),g=null!=(D=y.upload)?D:y,g.onprogress=v,l={Accept:"application/json","Cache-Control":"no-cache","X-Requested-With":"XMLHttpRequest"},this.options.headers&&n(l,this.options.headers);for(a in l)s=l[a],y.setRequestHeader(a,s);if(i=new FormData,this.options.params){N=this.options.params;for(p in N)b=N[p],i.append(p,b)}for(w=0,$=e.length;$>w;w++)r=e[w],this.emit("sending",r,y,i);if(this.options.uploadMultiple&&this.emit("sendingmultiple",e,y,i),"FORM"===this.element.tagName)for(L=this.element.querySelectorAll("input, textarea, select, button"),C=0,_=L.length;_>C;C++)if(u=L[C],d=u.getAttribute("name"),h=u.getAttribute("type"),"SELECT"===u.tagName&&u.hasAttribute("multiple"))for(E=u.options,S=0,T=E.length;T>S;S++)f=E[S],f.selected&&i.append(d,f.value);else(!h||"checkbox"!==(A=h.toLowerCase())&&"radio"!==A||u.checked)&&i.append(d,u.value);for(c=M=0,F=e.length-1;F>=0?F>=M:M>=F;c=F>=0?++M:--M)i.append(this._getParamName(c),e[c],e[c].name);return y.send(i)},t.prototype._finished=function(e,n,r){var i,o,a;for(o=0,a=e.length;a>o;o++)i=e[o],i.status=t.SUCCESS,this.emit("success",i,n,r),this.emit("complete",i);return this.options.uploadMultiple&&(this.emit("successmultiple",e,n,r),this.emit("completemultiple",e)),this.options.autoProcessQueue?this.processQueue():void 0},t.prototype._errorProcessing=function(e,n,r){var i,o,a;for(o=0,a=e.length;a>o;o++)i=e[o],i.status=t.ERROR,this.emit("error",i,n,r),this.emit("complete",i);return this.options.uploadMultiple&&(this.emit("errormultiple",e,n,r),this.emit("completemultiple",e)),this.options.autoProcessQueue?this.processQueue():void 0},t}(r),t.version="3.10.2",t.options={},t.optionsForElement=function(e){return e.getAttribute("id")?t.options[i(e.getAttribute("id"))]:void 0},t.instances=[],t.forElement=function(e){if("string"==typeof e&&(e=document.querySelector(e)),null==(null!=e?e.dropzone:void 0))throw Error("No Dropzone found for given element. This is probably because you're trying to access it before Dropzone had the time to initialize. Use the `init` option to setup any additional observers on your Dropzone.");return e.dropzone},t.autoDiscover=!0,t.discover=function(){var e,n,r,i,o,a;for(document.querySelectorAll?r=document.querySelectorAll(".dropzone"):(r=[],e=function(e){var t,n,i,o;for(o=[],n=0,i=e.length;i>n;n++)t=e[n],o.push(/(^| )dropzone($| )/.test(t.className)?r.push(t):void 0);return o},e(document.getElementsByTagName("div")),e(document.getElementsByTagName("form"))),a=[],i=0,o=r.length;o>i;i++)n=r[i],a.push(t.optionsForElement(n)!==!1?new t(n):void 0);return a},t.blacklistedBrowsers=[/opera.*Macintosh.*version\/12/i],t.isBrowserSupported=function(){var e,n,r,i,o;if(e=!0,window.File&&window.FileReader&&window.FileList&&window.Blob&&window.FormData&&document.querySelector)if("classList"in document.createElement("a"))for(o=t.blacklistedBrowsers,r=0,i=o.length;i>r;r++)n=o[r],n.test(navigator.userAgent)&&(e=!1);else e=!1;else e=!1;return e},c=function(e,t){var n,r,i,o;for(o=[],r=0,i=e.length;i>r;r++)n=e[r],n!==t&&o.push(n);return o},i=function(e){return e.replace(/[\-_](\w)/g,function(e){return e.charAt(1).toUpperCase()})},t.createElement=function(e){var t;return t=document.createElement("div"),t.innerHTML=e,t.childNodes[0]},t.elementInside=function(e,t){if(e===t)return!0;for(;e=e.parentNode;)if(e===t)return!0;return!1},t.getElement=function(e,t){var n;if("string"==typeof e?n=document.querySelector(e):null!=e.nodeType&&(n=e),null==n)throw Error("Invalid `"+t+"` option provided. Please provide a CSS selector or a plain HTML element.");return n},t.getElements=function(e,t){var n,r,i,o,a,s,l,c;if(e instanceof Array){i=[];try{for(o=0,s=e.length;s>o;o++)r=e[o],i.push(this.getElement(r,t))}catch(u){n=u,i=null}}else if("string"==typeof e)for(i=[],c=document.querySelectorAll(e),a=0,l=c.length;l>a;a++)r=c[a],i.push(r);else null!=e.nodeType&&(i=[e]);if(null==i||!i.length)throw Error("Invalid `"+t+"` option provided. Please provide a CSS selector, a plain HTML element or a list of those.");return i},t.confirm=function(e,t,n){return window.confirm(e)?t():null!=n?n():void 0},t.isValidFile=function(e,t){var n,r,i,o,a;if(!t)return!0;for(t=t.split(","),r=e.type,n=r.replace(/\/.*$/,""),o=0,a=t.length;a>o;o++)if(i=t[o],i=i.trim(),"."===i.charAt(0)){if(-1!==e.name.toLowerCase().indexOf(i.toLowerCase(),e.name.length-i.length))return!0}else if(/\/\*$/.test(i)){if(n===i.replace(/\/.*$/,""))return!0}else if(r===i)return!0;return!1},"undefined"!=typeof jQuery&&null!==jQuery&&(jQuery.fn.dropzone=function(e){return this.each(function(){return new t(this,e)})}),n!==void 0&&null!==n?n.exports=t:window.Dropzone=t,t.ADDED="added",t.QUEUED="queued",t.ACCEPTED=t.QUEUED,t.UPLOADING="uploading",t.PROCESSING=t.UPLOADING,t.CANCELED="canceled",t.ERROR="error",t.SUCCESS="success",a=function(e){var t,n,r,i,o,a,s,l,c,u;for(s=e.naturalWidth,a=e.naturalHeight,n=document.createElement("canvas"),n.width=1,n.height=a,r=n.getContext("2d"),r.drawImage(e,0,0),i=r.getImageData(0,0,1,a).data,u=0,o=a,l=a;l>u;)t=i[4*(l-1)+3],0===t?o=l:u=l,l=o+u>>1;return c=l/a,0===c?1:c},s=function(e,t,n,r,i,o,s,l,c,u){var d;return d=a(t),e.drawImage(t,n,r,i,o,s,l,c,u/d)},o=function(e,t){var n,r,i,o,a,s,l,c,u;if(i=!1,u=!0,r=e.document,c=r.documentElement,n=r.addEventListener?"addEventListener":"attachEvent",l=r.addEventListener?"removeEventListener":"detachEvent",s=r.addEventListener?"":"on",o=function(n){return"readystatechange"!==n.type||"complete"===r.readyState?(("load"===n.type?e:r)[l](s+n.type,o,!1),!i&&(i=!0)?t.call(e,n.type||n):void 0):void 0},a=function(){var e;try{c.doScroll("left")}catch(t){return e=t,void setTimeout(a,50)}return o("poll")},"complete"!==r.readyState){if(r.createEventObject&&c.doScroll){try{u=!e.frameElement}catch(d){}u&&a()}return r[n](s+"DOMContentLoaded",o,!1),r[n](s+"readystatechange",o,!1),e[n](s+"load",o,!1)}},t._autoDiscoverFunction=function(){return t.autoDiscover?t.discover():void 0},o(window,t._autoDiscoverFunction)}).call(this)}),"object"==typeof exports?module.exports=e("dropzone"):"function"==typeof define&&define.amd?define([],function(){return e("dropzone")}):this.Dropzone=e("dropzone")}(),function(e){function t(t,o){if(this.element=t,this.options=e.extend({},r,o),e(this.element).data("max-height",this.options.maxHeight),e(this.element).data("height-margin",this.options.heightMargin),delete this.options.maxHeight,this.options.embedCSS&&!i){var a=".readmore-js-toggle, .readmore-js-section { "+this.options.sectionCSS+" } .readmore-js-section { overflow: hidden; }";(function(e,t){var n=e.createElement("style");n.type="text/css",n.styleSheet?n.styleSheet.cssText=t:n.appendChild(e.createTextNode(t)),e.getElementsByTagName("head")[0].appendChild(n)})(document,a),i=!0}this._defaults=r,this._name=n,this.init()}var n="readmore",r={speed:100,maxHeight:200,heightMargin:16,moreLink:'Read More',lessLink:'Close',embedCSS:!0,sectionCSS:"display: block; width: 100%;",startOpen:!1,expandedClass:"readmore-js-expanded",collapsedClass:"readmore-js-collapsed",beforeToggle:function(){},afterToggle:function(){}},i=!1;t.prototype={init:function(){var t=this;e(this.element).each(function(){var n=e(this),r=n.css("max-height").replace(/[^-\d\.]/g,"")>n.data("max-height")?n.css("max-height").replace(/[^-\d\.]/g,""):n.data("max-height"),i=n.data("height-margin");if("none"!=n.css("max-height")&&n.css("max-height","none"),t.setBoxHeight(n),r+i>=n.outerHeight(!0))return!0;n.addClass("readmore-js-section "+t.options.collapsedClass).data("collapsedHeight",r);var o=t.options.startOpen?t.options.lessLink:t.options.moreLink;n.after(e(o).on("click",function(e){t.toggleSlider(this,n,e)}).addClass("readmore-js-toggle")),t.options.startOpen||n.css({height:r})}),e(window).on("resize",function(){t.resizeBoxes()})},toggleSlider:function(t,n,r){r.preventDefault();var i=this,o=newLink=sectionClass="",a=!1,s=e(n).data("collapsedHeight");s>=e(n).height()?(o=e(n).data("expandedHeight")+"px",newLink="lessLink",a=!0,sectionClass=i.options.expandedClass):(o=s,newLink="moreLink",sectionClass=i.options.collapsedClass),i.options.beforeToggle(t,n,a),e(n).animate({height:o},{duration:i.options.speed,complete:function(){i.options.afterToggle(t,n,a),e(t).replaceWith(e(i.options[newLink]).on("click",function(e){i.toggleSlider(this,n,e)}).addClass("readmore-js-toggle")),e(this).removeClass(i.options.collapsedClass+" "+i.options.expandedClass).addClass(sectionClass)}})},setBoxHeight:function(e){var t=e.clone().css({height:"auto",width:e.width(),overflow:"hidden"}).insertAfter(e),n=t.outerHeight(!0);t.remove(),e.data("expandedHeight",n)},resizeBoxes:function(){var t=this;e(".readmore-js-section").each(function(){var n=e(this);t.setBoxHeight(n),(n.height()>n.data("expandedHeight")||n.hasClass(t.options.expandedClass)&&n.height() /g,">");a.html(s);var l=a.width(),c=l+t.comfortZone>=n?l+t.comfortZone:n,u=o.width(),d=u>c&&c>=n||c>n&&r>c;d&&o.width(c)}},e.fn.resetAutosize=function(t){var n=e(this).data("minwidth")||t.minInputWidth||e(this).width(),r=e(this).data("maxwidth")||t.maxInputWidth||e(this).closest(".tagsinput").width()-t.inputPadding,i=e(this),o=e(" ").css({position:"absolute",top:-9999,left:-9999,width:"auto",fontSize:i.css("fontSize"),fontFamily:i.css("fontFamily"),fontWeight:i.css("fontWeight"),letterSpacing:i.css("letterSpacing"),whiteSpace:"nowrap"}),a=e(this).attr("id")+"_autosize_tester";!e("#"+a).length>0&&(o.attr("id",a),o.appendTo("body")),i.data("minwidth",n),i.data("maxwidth",r),i.data("tester_id",a),i.css("width",n)},e.fn.addTag=function(r,i){return i=jQuery.extend({focus:!1,callback:!0},i),this.each(function(){var o=e(this).attr("id"),a=e(this).val().split(t[o]);if(""==a[0]&&(a=[]),r=jQuery.trim(r),i.unique){var s=e(a).tagExist(r);1==s&&e("#"+o+"_tag").addClass("not_valid")}else var s=!1;if(""!=r&&1!=s){if(e("").addClass("tag").append(e("").text(r).append(" "),e("",{href:"#",title:"Removing tag",text:"x"}).click(function(){return e("#"+o).removeTag(escape(r))})).insertBefore("#"+o+"_addTag"),a.push(r),e("#"+o+"_tag").val(""),i.focus?e("#"+o+"_tag").focus():e("#"+o+"_tag").blur(),e.fn.tagsInput.updateTagsField(this,a),i.callback&&n[o]&&n[o].onAddTag){var l=n[o].onAddTag;l.call(this,r)}if(n[o]&&n[o].onChange){var c=a.length,l=n[o].onChange;l.call(this,e(this),a[c-1])}}}),!1},e.fn.removeTag=function(r){return r=unescape(r),this.each(function(){var o=e(this).attr("id"),a=e(this).val().split(t[o]);for(e("#"+o+"_tagsinput .tag").remove(),str="",i=0;a.length>i;i++)a[i]!=r&&(str=str+t[o]+a[i]);if(e.fn.tagsInput.importTags(this,str),n[o]&&n[o].onRemoveTag){var s=n[o].onRemoveTag;s.call(this,r)}}),!1},e.fn.tagExist=function(t){return jQuery.inArray(t,e(this))>=0},e.fn.importTags=function(t){id=e(this).attr("id"),e("#"+id+"_tagsinput .tag").remove(),e.fn.tagsInput.importTags(this,t)},e.fn.tagsInput=function(r){var i=jQuery.extend({interactive:!0,defaultText:"add a tag",minChars:0,width:"300px",height:"100px",autocomplete:{selectFirst:!1},hide:!0,delimiter:",",unique:!0,removeWithBackspace:!0,placeholderColor:"#666666",autosize:!0,comfortZone:20,inputPadding:12},r);return this.each(function(){i.hide&&e(this).hide();var r=e(this).attr("id"),o=jQuery.extend({pid:r,real_input:"#"+r,holder:"#"+r+"_tagsinput",input_wrapper:"#"+r+"_addTag",fake_input:"#"+r+"_tag"},i);t[r]=o.delimiter,(i.onAddTag||i.onRemoveTag||i.onChange)&&(n[r]=[],n[r].onAddTag=i.onAddTag,n[r].onRemoveTag=i.onRemoveTag,n[r].onChange=i.onChange);var a=''),O=e(''),z=e(''),I=e(''),H=e(''),R=H.find(".xdsoft_time_box").eq(0),j=e(''),P=e(''),W=(e(''),e('')),B=e(''),q=!1,U=0,Y=0;z.find(".xdsoft_month span").after(W),z.find(".xdsoft_year span").after(B),z.find(".xdsoft_month,.xdsoft_year").on("mousedown.xdsoft",function(t){var n,r,i=e(this).find(".xdsoft_select").eq(0),a=0,s=0,l=i.is(":visible");for(z.find(".xdsoft_select").hide(),o.currentTime&&(a=o.currentTime[e(this).hasClass("xdsoft_month")?"getMonth":"getFullYear"]()),i[l?"hide":"show"](),n=i.find("div.xdsoft_option"),r=0;n.length>r&&n.eq(r).data("value")!==a;r+=1)s+=n[0].offsetHeight;return i.xdsoftScroller(s/(i.children()[0].offsetHeight-i[0].clientHeight)),t.stopPropagation(),!1}),z.find(".xdsoft_select").xdsoftScroller().on("mousedown.xdsoft",function(e){e.stopPropagation(),e.preventDefault()}).on("mousedown.xdsoft",".xdsoft_option",function(){var t=o.currentTime.getFullYear();o&&o.currentTime&&o.currentTime[e(this).parent().parent().hasClass("xdsoft_monthselect")?"setMonth":"setFullYear"](e(this).data("value")),e(this).parent().parent().hide(),A.trigger("xchange.xdsoft"),T.onChangeMonth&&e.isFunction(T.onChangeMonth)&&T.onChangeMonth.call(A,o.currentTime,A.data("input")),t!==o.currentTime.getFullYear()&&e.isFunction(T.onChangeYear)&&T.onChangeYear.call(A,o.currentTime,A.data("input"))}),A.setOptions=function(n){if(T=e.extend(!0,{},T,n),n.allowTimes&&e.isArray(n.allowTimes)&&n.allowTimes.length&&(T.allowTimes=e.extend(!0,[],n.allowTimes)),n.weekends&&e.isArray(n.weekends)&&n.weekends.length&&(T.weekends=e.extend(!0,[],n.weekends)),!T.open&&!T.opened||T.inline||t.trigger("open.xdsoft"),T.inline&&(q=!0,A.addClass("xdsoft_inline"),t.after(A).hide()),T.inverseButton&&(T.next="xdsoft_prev",T.prev="xdsoft_next"),T.datepicker?O.addClass("active"):O.removeClass("active"),T.timepicker?H.addClass("active"):H.removeClass("active"),T.value&&(t&&t.val&&t.val(T.value),o.setCurrentTime(T.value)),T.dayOfWeekStart=isNaN(T.dayOfWeekStart)?0:parseInt(T.dayOfWeekStart,10)%7,T.timepickerScrollbar||P.hide(),T.minDate&&/^-(.*)$/.test(T.minDate)&&(T.minDate=o.strToDateTime(T.minDate).dateFormat(T.formatDate)),T.maxDate&&/^\+(.*)$/.test(T.maxDate)&&(T.maxDate=o.strToDateTime(T.maxDate).dateFormat(T.formatDate)),z.find(".xdsoft_today_button").css("visibility",T.todayButton?"visible":"hidden"),T.mask){var r=function(e){try{if(document.selection&&document.selection.createRange){var t=document.selection.createRange();return t.getBookmark().charCodeAt(2)-2}if(e.setSelectionRange)return e.selectionStart}catch(n){return 0}},i=function(e,t){if(e="string"==typeof e||e instanceof String?document.getElementById(e):e,!e)return!1;if(e.createTextRange){var n=e.createTextRange();return n.collapse(!0),n.moveEnd("character",t),n.moveStart("character",t),n.select(),!0}return e.setSelectionRange?(e.setSelectionRange(t,t),!0):!1},M=function(e,t){var n=e.replace(/([\[\]\/\{\}\(\)\-\.\+]{1})/g,"\\$1").replace(/_/g,"{digit+}").replace(/([0-9]{1})/g,"{digit$1}").replace(/\{digit([0-9]{1})\}/g,"[0-$1_]{1}").replace(/\{digit[\+]\}/g,"[0-9_]{1}");return RegExp(n).test(t)};t.off("keydown.xdsoft"),T.mask===!0&&(T.mask=T.format.replace(/Y/g,"9999").replace(/F/g,"9999").replace(/m/g,"19").replace(/d/g,"39").replace(/H/g,"29").replace(/i/g,"59").replace(/s/g,"59")),"string"===e.type(T.mask)&&(M(T.mask,t.val())||t.val(T.mask.replace(/[0-9]/g,"_")),t.on("keydown.xdsoft",function(n){var o,D,N=this.value,L=n.which;if(L>=a&&s>=L||L>=l&&c>=L||L===f||L===d){for(o=r(this),D=L!==f&&L!==d?String.fromCharCode(L>=l&&c>=L?L-a:L):"_",L!==f&&L!==d||!o||(o-=1,D="_");/[^0-9_]/.test(T.mask.substr(o,1))&&T.mask.length>o&&o>0;)o+=L===f||L===d?-1:1;if(N=N.substr(0,o)+D+N.substr(o+1),""===e.trim(N))N=T.mask.replace(/[0-9]/g,"_");else if(o===T.mask.length)return n.preventDefault(),!1;for(o+=L===f||L===d?0:1;/[^0-9_]/.test(T.mask.substr(o,1))&&T.mask.length>o&&o>0;)o+=L===f||L===d?-1:1;M(T.mask,N)?(this.value=N,i(this,o)):""===e.trim(N)?this.value=T.mask.replace(/[0-9]/g,"_"):t.trigger("error_input.xdsoft")}else if(-1!==[w,C,S,k,$].indexOf(L)&&_||-1!==[p,m,b,g,v,x,u,y,h].indexOf(L))return!0;return n.preventDefault(),!1}))}T.validateOnBlur&&t.off("blur.xdsoft").on("blur.xdsoft",function(){T.allowBlank&&!e.trim(e(this).val()).length?(e(this).val(null),A.data("xdsoft_datetime").empty()):Date.parseDate(e(this).val(),T.format)?A.data("xdsoft_datetime").setCurrentTime(e(this).val()):(e(this).val(o.now().dateFormat(T.format)),A.data("xdsoft_datetime").setCurrentTime(e(this).val())),A.trigger("changedatetime.xdsoft")}),T.dayOfWeekStartPrev=0===T.dayOfWeekStart?6:T.dayOfWeekStart-1,A.trigger("xchange.xdsoft").trigger("afterOpen.xdsoft")},A.data("options",T).on("mousedown.xdsoft",function(e){return e.stopPropagation(),e.preventDefault(),B.hide(),W.hide(),!1}),M=H.find(".xdsoft_time_box"),M.append(j),M.xdsoftScroller(),A.on("afterOpen.xdsoft",function(){M.xdsoftScroller()}),A.append(O).append(H),T.withoutCopyright!==!0&&A.append(F),O.append(z).append(I),e(T.parentID).append(A),i=function(){var t=this;t.now=function(e){var n,r,i=new Date;return!e&&T.defaultDate&&(n=t.strToDate(T.defaultDate),i.setFullYear(n.getFullYear()),i.setMonth(n.getMonth()),i.setDate(n.getDate())),T.yearOffset&&i.setFullYear(i.getFullYear()+T.yearOffset),!e&&T.defaultTime&&(r=t.strtotime(T.defaultTime),i.setHours(r.getHours()),i.setMinutes(r.getMinutes())),i},t.isValidDate=function(e){return"[object Date]"!==Object.prototype.toString.call(e)?!1:!isNaN(e.getTime())},t.setCurrentTime=function(e){t.currentTime="string"==typeof e?t.strToDateTime(e):t.isValidDate(e)?e:t.now(),A.trigger("xchange.xdsoft")},t.empty=function(){t.currentTime=null},t.getCurrentTime=function(){return t.currentTime},t.nextMonth=function(){var n,r=t.currentTime.getMonth()+1;return 12===r&&(t.currentTime.setFullYear(t.currentTime.getFullYear()+1),r=0),n=t.currentTime.getFullYear(),t.currentTime.setDate(Math.min(new Date(t.currentTime.getFullYear(),r+1,0).getDate(),t.currentTime.getDate())),t.currentTime.setMonth(r),T.onChangeMonth&&e.isFunction(T.onChangeMonth)&&T.onChangeMonth.call(A,o.currentTime,A.data("input")),n!==t.currentTime.getFullYear()&&e.isFunction(T.onChangeYear)&&T.onChangeYear.call(A,o.currentTime,A.data("input")),A.trigger("xchange.xdsoft"),r},t.prevMonth=function(){var n=t.currentTime.getMonth()-1;return-1===n&&(t.currentTime.setFullYear(t.currentTime.getFullYear()-1),n=11),t.currentTime.setDate(Math.min(new Date(t.currentTime.getFullYear(),n+1,0).getDate(),t.currentTime.getDate())),t.currentTime.setMonth(n),T.onChangeMonth&&e.isFunction(T.onChangeMonth)&&T.onChangeMonth.call(A,o.currentTime,A.data("input")),A.trigger("xchange.xdsoft"),n},t.getWeekOfYear=function(e){var t=new Date(e.getFullYear(),0,1);return Math.ceil(((e-t)/864e5+t.getDay()+1)/7)},t.strToDateTime=function(e){var n,r,i=[];return e&&e instanceof Date&&t.isValidDate(e)?e:(i=/^(\+|\-)(.*)$/.exec(e),i&&(i[2]=Date.parseDate(i[2],T.formatDate)),i&&i[2]?(n=i[2].getTime()-6e4*i[2].getTimezoneOffset(),r=new Date(o.now().getTime()+parseInt(i[1]+"1",10)*n)):r=e?Date.parseDate(e,T.format):t.now(),t.isValidDate(r)||(r=t.now()),r)},t.strToDate=function(e){if(e&&e instanceof Date&&t.isValidDate(e))return e;var n=e?Date.parseDate(e,T.formatDate):t.now(!0);return t.isValidDate(n)||(n=t.now(!0)),n},t.strtotime=function(e){if(e&&e instanceof Date&&t.isValidDate(e))return e;var n=e?Date.parseDate(e,T.formatTime):t.now(!0);return t.isValidDate(n)||(n=t.now(!0)),n},t.str=function(){return t.currentTime.dateFormat(T.format)},t.currentTime=this.now()},o=new i,z.find(".xdsoft_today_button").on("mousedown.xdsoft",function(){A.data("changed",!0),o.setCurrentTime(0),A.trigger("afterOpen.xdsoft")}).on("dblclick.xdsoft",function(){t.val(o.str()),A.trigger("close.xdsoft")}),z.find(".xdsoft_prev,.xdsoft_next").on("mousedown.xdsoft",function(){var t=e(this),n=0,r=!1;(function i(e){o.currentTime.getMonth(),t.hasClass(T.next)?o.nextMonth():t.hasClass(T.prev)&&o.prevMonth(),T.monthChangeSpinner&&(r||(n=setTimeout(i,e||100)))})(500),e([document.body,window]).on("mouseup.xdsoft",function a(){clearTimeout(n),r=!0,e([document.body,window]).off("mouseup.xdsoft",a)})}),H.find(".xdsoft_prev,.xdsoft_next").on("mousedown.xdsoft",function(){var t=e(this),n=0,r=!1,i=110;(function o(e){var a=R[0].clientHeight,s=j[0].offsetHeight,l=Math.abs(parseInt(j.css("marginTop"),10));t.hasClass(T.next)&&s-a-T.timeHeightInTimePicker>=l?j.css("marginTop","-"+(l+T.timeHeightInTimePicker)+"px"):t.hasClass(T.prev)&&l-T.timeHeightInTimePicker>=0&&j.css("marginTop","-"+(l-T.timeHeightInTimePicker)+"px"),R.trigger("scroll_element.xdsoft_scroller",[Math.abs(parseInt(j.css("marginTop"),10)/(s-a))]),i=i>10?10:i-10,r||(n=setTimeout(o,e||i))})(500),e([document.body,window]).on("mouseup.xdsoft",function a(){clearTimeout(n),r=!0,e([document.body,window]).off("mouseup.xdsoft",a)})}),D=0,A.on("xchange.xdsoft",function(t){clearTimeout(D),D=setTimeout(function(){for(var t,r,i,a,s,l,c,u="",d=new Date(o.currentTime.getFullYear(),o.currentTime.getMonth(),1,12,0,0),h=0,p=o.now(),f=!1,g=!1,m=[],v=!0,b="",y="";d.getDay()!==T.dayOfWeekStart;)d.setDate(d.getDate()-1);for(u+="",T.weeks&&(u+=" "),t=0;7>t;t+=1)u+=""+T.i18n[T.lang].dayOfWeek[(t+T.dayOfWeekStart)%7]+" ";for(u+=" ",u+="",T.maxDate!==!1&&(f=o.strToDate(T.maxDate),f=new Date(f.getFullYear(),f.getMonth(),f.getDate(),23,59,59,999)),T.minDate!==!1&&(g=o.strToDate(T.minDate),g=new Date(g.getFullYear(),g.getMonth(),g.getDate()));o.currentTime.countDaysInMonth()>h||d.getDay()!==T.dayOfWeekStart||o.currentTime.getMonth()===d.getMonth();)m=[],h+=1,r=d.getDate(),i=d.getFullYear(),a=d.getMonth(),s=o.getWeekOfYear(d),m.push("xdsoft_date"),l=T.beforeShowDay&&e.isFunction(T.beforeShowDay.call)?T.beforeShowDay.call(A,d):null,(f!==!1&&d>f||g!==!1&&g>d||l&&l[0]===!1)&&m.push("xdsoft_disabled"),l&&""!==l[1]&&m.push(l[1]),o.currentTime.getMonth()!==a&&m.push("xdsoft_other_month"),(T.defaultSelect||A.data("changed"))&&o.currentTime.dateFormat(T.formatDate)===d.dateFormat(T.formatDate)&&m.push("xdsoft_current"),p.dateFormat(T.formatDate)===d.dateFormat(T.formatDate)&&m.push("xdsoft_today"),(0===d.getDay()||6===d.getDay()||-1===T.weekends.indexOf(d.dateFormat(T.formatDate)))&&m.push("xdsoft_weekend"),T.beforeShowDay&&e.isFunction(T.beforeShowDay)&&m.push(T.beforeShowDay(d)),v&&(u+="",v=!1,T.weeks&&(u+=""+s+" ")),u+=''+""+r+""+" ",d.getDay()===T.dayOfWeekStartPrev&&(u+=" ",v=!0),d.setDate(r+1);if(u+="
",I.html(u),z.find(".xdsoft_label span").eq(0).text(T.i18n[T.lang].months[o.currentTime.getMonth()]),z.find(".xdsoft_label span").eq(1).text(o.currentTime.getFullYear()),b="",y="",a="",c=function c(e,t){var n=o.now();n.setHours(e),e=parseInt(n.getHours(),10),n.setMinutes(t),t=parseInt(n.getMinutes(),10),m=[],(T.maxTime!==!1&&o.strtotime(T.maxTime).getTime()n.getTime())&&m.push("xdsoft_disabled"),(T.initTime||T.defaultSelect||A.data("changed"))&&parseInt(o.currentTime.getHours(),10)===parseInt(e,10)&&(T.step>59||Math[T.roundTime](o.currentTime.getMinutes()/T.step)*T.step===parseInt(t,10))&&(T.defaultSelect||A.data("changed")?m.push("xdsoft_current"):T.initTime&&m.push("xdsoft_init_time")),parseInt(p.getHours(),10)===parseInt(e,10)&&parseInt(p.getMinutes(),10)===parseInt(t,10)&&m.push("xdsoft_today"),b+=''+n.dateFormat(T.formatTime)+""},T.allowTimes&&e.isArray(T.allowTimes)&&T.allowTimes.length)for(h=0;T.allowTimes.length>h;h+=1)y=o.strtotime(T.allowTimes[h]).getHours(),a=o.strtotime(T.allowTimes[h]).getMinutes(),c(y,a);else for(h=0,t=0;(T.hours12?12:24)>h;h+=1)for(t=0;60>t;t+=T.step)y=(10>h?"0":"")+h,a=(10>t?"0":"")+t,c(y,a);for(j.html(b),n="",h=0,h=parseInt(T.yearStart,10)+T.yearOffset;parseInt(T.yearEnd,10)+T.yearOffset>=h;h+=1)n+=''+h+"";for(B.children().eq(0).html(n),h=0,n="";11>=h;h+=1)n+=''+T.i18n[T.lang].months[h]+"";W.children().eq(0).html(n),e(A).trigger("generate.xdsoft")},10),t.stopPropagation()}).on("afterOpen.xdsoft",function(){if(T.timepicker){var e,t,n,r;j.find(".xdsoft_current").length?e=".xdsoft_current":j.find(".xdsoft_init_time").length&&(e=".xdsoft_init_time"),e?(t=R[0].clientHeight,n=j[0].offsetHeight,r=j.find(e).index()*T.timeHeightInTimePicker+1,r>n-t&&(r=n-t),R.trigger("scroll_element.xdsoft_scroller",[parseInt(r,10)/(n-t)])):R.trigger("scroll_element.xdsoft_scroller",[0])}}),N=0,I.on("click.xdsoft","td",function(n){n.stopPropagation(),N+=1;var r=e(this),i=o.currentTime;return(void 0===i||null===i)&&(o.currentTime=o.now(),i=o.currentTime),r.hasClass("xdsoft_disabled")?!1:(i.setDate(1),i.setFullYear(r.data("year")),i.setMonth(r.data("month")),i.setDate(r.data("date")),A.trigger("select.xdsoft",[i]),t.val(o.str()),(N>1||T.closeOnDateSelect===!0||0===T.closeOnDateSelect&&!T.timepicker)&&!T.inline&&A.trigger("close.xdsoft"),T.onSelectDate&&e.isFunction(T.onSelectDate)&&T.onSelectDate.call(A,o.currentTime,A.data("input")),A.data("changed",!0),A.trigger("xchange.xdsoft"),A.trigger("changedatetime.xdsoft"),setTimeout(function(){N=0},200),void 0)}),j.on("click.xdsoft","div",function(t){t.stopPropagation();var n=e(this),r=o.currentTime;return(void 0===r||null===r)&&(o.currentTime=o.now(),r=o.currentTime),n.hasClass("xdsoft_disabled")?!1:(r.setHours(n.data("hour")),r.setMinutes(n.data("minute")),A.trigger("select.xdsoft",[r]),A.data("input").val(o.str()),T.inline||A.trigger("close.xdsoft"),T.onSelectTime&&e.isFunction(T.onSelectTime)&&T.onSelectTime.call(A,o.currentTime,A.data("input")),A.data("changed",!0),A.trigger("xchange.xdsoft"),A.trigger("changedatetime.xdsoft"),void 0)}),A.mousewheel&&(O.mousewheel(function(e,t){return T.scrollMonth?(0>t?o.nextMonth():o.prevMonth(),!1):!0}),R.unmousewheel().mousewheel(function(e,t){if(!T.scrollTime)return!0;var n=R[0].clientHeight,r=j[0].offsetHeight,i=Math.abs(parseInt(j.css("marginTop"),10)),o=!0;return 0>t&&r-n-T.timeHeightInTimePicker>=i?(j.css("marginTop","-"+(i+T.timeHeightInTimePicker)+"px"),o=!1):t>0&&i-T.timeHeightInTimePicker>=0&&(j.css("marginTop","-"+(i-T.timeHeightInTimePicker)+"px"),o=!1),R.trigger("scroll_element.xdsoft_scroller",[Math.abs(parseInt(j.css("marginTop"),10)/(r-n))]),e.stopPropagation(),o}),t.mousewheel(function(e,n,r,i){return T.scrollInput?!T.datepicker&&T.timepicker?(L=j.find(".xdsoft_current").length?j.find(".xdsoft_current").eq(0).index():0,L+n>=0&&j.children().length>L+n&&(L+=n),j.children().eq(L).length&&j.children().eq(L).trigger("mousedown"),!1):T.datepicker&&!T.timepicker?(O.trigger(e,[n,r,i]),t.val&&t.val(o.str()),A.trigger("changedatetime.xdsoft"),!1):void 0:!0})),A.on("changedatetime.xdsoft",function(){if(T.onChangeDateTime&&e.isFunction(T.onChangeDateTime)){var t=A.data("input");T.onChangeDateTime.call(A,o.currentTime,t),delete T.value,t.trigger("change")}}).on("generate.xdsoft",function(){T.onGenerate&&e.isFunction(T.onGenerate)&&T.onGenerate.call(A,o.currentTime,A.data("input")),q&&(A.trigger("afterOpen.xdsoft"),q=!1)}).on("click.xdsoft",function(e){e.stopPropagation()}),L=0,E=function(){var t=A.data("input").offset(),n=t.top+A.data("input")[0].offsetHeight-1,r=t.left,i="absolute";T.fixed?(n-=e(window).scrollTop(),r-=e(window).scrollLeft(),i="fixed"):(n+A[0].offsetHeight>e(window).height()+e(window).scrollTop()&&(n=t.top-A[0].offsetHeight+1),0>n&&(n=0),r+A[0].offsetWidth>e(window).width()&&(r=e(window).width()-A[0].offsetWidth)),A.css({left:r,top:n,position:i})},A.on("open.xdsoft",function(){var t=!0;T.onShow&&e.isFunction(T.onShow)&&(t=T.onShow.call(A,o.currentTime,A.data("input"))),t!==!1&&(A.show(),E(),e(window).off("resize.xdsoft",E).on("resize.xdsoft",E),T.closeOnWithoutClick&&e([document.body,window]).on("mousedown.xdsoft",function n(){A.trigger("close.xdsoft"),e([document.body,window]).off("mousedown.xdsoft",n)}))}).on("close.xdsoft",function(t){var n=!0;z.find(".xdsoft_month,.xdsoft_year").find(".xdsoft_select").hide(),T.onClose&&e.isFunction(T.onClose)&&(n=T.onClose.call(A,o.currentTime,A.data("input"))),n===!1||T.opened||T.inline||A.hide(),t.stopPropagation()}).data("input",t),U=0,Y=0,A.data("xdsoft_datetime",o),A.setOptions(T),o.setCurrentTime(r()),t.data("xdsoft_datetimepicker",A).on("open.xdsoft focusin.xdsoft mousedown.xdsoft",function(){t.is(":disabled")||t.is(":hidden")||!t.is(":visible")||t.data("xdsoft_datetimepicker").is(":visible")&&T.closeOnInputClick||(clearTimeout(U),U=setTimeout(function(){t.is(":disabled")||t.is(":hidden")||!t.is(":visible")||(q=!0,o.setCurrentTime(r()),A.trigger("open.xdsoft"))},100))}).on("keydown.xdsoft",function(t){var n,r=(this.value,t.which);return-1!==[h].indexOf(r)?(n=e("input:visible,textarea:visible"),A.trigger("close.xdsoft"),n.eq(n.index(this)+1).focus(),!1):-1!==[y].indexOf(r)?(A.trigger("close.xdsoft"),!0):void 0})},i=function(t){var n=t.data("xdsoft_datetimepicker");n&&(n.data("xdsoft_datetime",null),n.remove(),t.data("xdsoft_datetimepicker",null).off(".xdsoft"),e(window).off("resize.xdsoft"),e([window,document.body]).off("mousedown.xdsoft"),t.unmousewheel&&t.unmousewheel())},e(document).off("keydown.xdsoftctrl keyup.xdsoftctrl").on("keydown.xdsoftctrl",function(e){e.keyCode===u&&(_=!0)}).on("keyup.xdsoftctrl",function(e){e.keyCode===u&&(_=!1)}),this.each(function(){var t=e(this).data("xdsoft_datetimepicker");if(t){if("string"===e.type(n))switch(n){case"show":e(this).select().focus(),t.trigger("open.xdsoft");break;case"hide":t.trigger("close.xdsoft");break;case"destroy":i(e(this));break;case"reset":this.value=this.defaultValue,this.value&&t.data("xdsoft_datetime").isValidDate(Date.parseDate(this.value,T.format))||t.data("changed",!1),t.data("xdsoft_datetime").setCurrentTime(this.value)}else t.setOptions(n);return 0}"string"!==e.type(n)&&(!T.lazyInit||T.open||T.inline?r(e(this)):D(e(this)))})},e.fn.datetimepicker.defaults=t}(jQuery),function(){(function(e){"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof exports?module.exports=e:e(jQuery)})(function(e){function t(t){var i,o=t||window.event,a=[].slice.call(arguments,1),s=0,l=0,c=0,u=0,d=0;return t=e.event.fix(o),t.type="mousewheel",o.wheelDelta&&(s=o.wheelDelta),o.detail&&(s=-1*o.detail),o.deltaY&&(c=-1*o.deltaY,s=c),o.deltaX&&(l=o.deltaX,s=-1*l),void 0!==o.wheelDeltaY&&(c=o.wheelDeltaY),void 0!==o.wheelDeltaX&&(l=-1*o.wheelDeltaX),u=Math.abs(s),(!n||n>u)&&(n=u),d=Math.max(Math.abs(c),Math.abs(l)),(!r||r>d)&&(r=d),i=s>0?"floor":"ceil",s=Math[i](s/n),l=Math[i](l/r),c=Math[i](c/r),a.unshift(t,s,l,c),(e.event.dispatch||e.event.handle).apply(this,a)}var n,r,i=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],o="onwheel"in document||document.documentMode>=9?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"];if(e.event.fixHooks)for(var a=i.length;a;)e.event.fixHooks[i[--a]]=e.event.mouseHooks;e.event.special.mousewheel={setup:function(){if(this.addEventListener)for(var e=o.length;e;)this.addEventListener(o[--e],t,!1);else this.onmousewheel=t},teardown:function(){if(this.removeEventListener)for(var e=o.length;e;)this.removeEventListener(o[--e],t,!1);else this.onmousewheel=null}},e.fn.extend({mousewheel:function(e){return e?this.bind("mousewheel",e):this.trigger("mousewheel")},unmousewheel:function(e){return this.unbind("mousewheel",e)}})}),Date.parseFunctions={count:0},Date.parseRegexes=[],Date.formatFunctions={count:0},Date.prototype.dateFormat=function(e){if("unixtime"==e)return parseInt(this.getTime()/1e3);null==Date.formatFunctions[e]&&Date.createNewFormat(e);var t=Date.formatFunctions[e];return this[t]()},Date.createNewFormat=function(format){var funcName="format"+Date.formatFunctions.count++;Date.formatFunctions[format]=funcName;for(var code="Date.prototype."+funcName+" = function() {return ",special=!1,ch="",i=0;format.length>i;++i)ch=format.charAt(i),special||"\\"!=ch?special?(special=!1,code+="'"+String.escape(ch)+"' + "):code+=Date.getFormatCode(ch):special=!0;eval(code.substring(0,code.length-3)+";}")},Date.getFormatCode=function(e){switch(e){case"d":return"String.leftPad(this.getDate(), 2, '0') + ";case"D":return"Date.dayNames[this.getDay()].substring(0, 3) + ";case"j":return"this.getDate() + ";case"l":return"Date.dayNames[this.getDay()] + ";case"S":return"this.getSuffix() + ";case"w":return"this.getDay() + ";case"z":return"this.getDayOfYear() + ";case"W":return"this.getWeekOfYear() + ";case"F":return"Date.monthNames[this.getMonth()] + ";case"m":return"String.leftPad(this.getMonth() + 1, 2, '0') + ";case"M":return"Date.monthNames[this.getMonth()].substring(0, 3) + ";case"n":return"(this.getMonth() + 1) + ";case"t":return"this.getDaysInMonth() + ";case"L":return"(this.isLeapYear() ? 1 : 0) + ";case"Y":return"this.getFullYear() + ";case"y":return"('' + this.getFullYear()).substring(2, 4) + ";case"a":return"(this.getHours() < 12 ? 'am' : 'pm') + ";case"A":return"(this.getHours() < 12 ? 'AM' : 'PM') + ";case"g":return"((this.getHours() %12) ? this.getHours() % 12 : 12) + ";case"G":return"this.getHours() + ";case"h":return"String.leftPad((this.getHours() %12) ? this.getHours() % 12 : 12, 2, '0') + ";case"H":return"String.leftPad(this.getHours(), 2, '0') + ";case"i":return"String.leftPad(this.getMinutes(), 2, '0') + ";case"s":return"String.leftPad(this.getSeconds(), 2, '0') + ";case"O":return"this.getGMTOffset() + ";case"T":return"this.getTimezone() + ";case"Z":return"(this.getTimezoneOffset() * -60) + ";default:return"'"+String.escape(e)+"' + "}},Date.parseDate=function(e,t){if("unixtime"==t)return new Date(isNaN(parseInt(e))?0:1e3*parseInt(e));null==Date.parseFunctions[t]&&Date.createParser(t);var n=Date.parseFunctions[t];return Date[n](e)},Date.createParser=function(format){var funcName="parse"+Date.parseFunctions.count++,regexNum=Date.parseRegexes.length,currentGroup=1;Date.parseFunctions[format]=funcName;for(var code="Date."+funcName+" = function(input) {\nvar y = -1, m = -1, d = -1, h = -1, i = -1, s = -1, z = -1;\nvar d = new Date();\ny = d.getFullYear();\nm = d.getMonth();\nd = d.getDate();\nvar results = input.match(Date.parseRegexes["+regexNum+"]);\nif (results && results.length > 0) {",regex="",special=!1,ch="",i=0;format.length>i;++i)ch=format.charAt(i),special||"\\"!=ch?special?(special=!1,regex+=String.escape(ch)):(obj=Date.formatCodeToRegex(ch,currentGroup),currentGroup+=obj.g,regex+=obj.s,obj.g&&obj.c&&(code+=obj.c)):special=!0;code+="if (y > 0 && z > 0){\nvar doyDate = new Date(y,0);\ndoyDate.setDate(z);\nm = doyDate.getMonth();\nd = doyDate.getDate();\n}",code+="if (y > 0 && m >= 0 && d > 0 && h >= 0 && i >= 0 && s >= 0)\n{return new Date(y, m, d, h, i, s);}\nelse if (y > 0 && m >= 0 && d > 0 && h >= 0 && i >= 0)\n{return new Date(y, m, d, h, i);}\nelse if (y > 0 && m >= 0 && d > 0 && h >= 0)\n{return new Date(y, m, d, h);}\nelse if (y > 0 && m >= 0 && d > 0)\n{return new Date(y, m, d);}\nelse if (y > 0 && m >= 0)\n{return new Date(y, m);}\nelse if (y > 0)\n{return new Date(y);}\n}return null;}",Date.parseRegexes[regexNum]=RegExp("^"+regex+"$"),eval(code)},Date.formatCodeToRegex=function(e,t){switch(e){case"D":return{g:0,c:null,s:"(?:Sun|Mon|Tue|Wed|Thu|Fri|Sat)"};case"j":case"d":return{g:1,c:"d = parseInt(results["+t+"], 10);\n",s:"(\\d{1,2})"};case"l":return{g:0,c:null,s:"(?:"+Date.dayNames.join("|")+")"};case"S":return{g:0,c:null,s:"(?:st|nd|rd|th)"};case"w":return{g:0,c:null,s:"\\d"};case"z":return{g:1,c:"z = parseInt(results["+t+"], 10);\n",s:"(\\d{1,3})"};case"W":return{g:0,c:null,s:"(?:\\d{2})"};case"F":return{g:1,c:"m = parseInt(Date.monthNumbers[results["+t+"].substring(0, 3)], 10);\n",s:"("+Date.monthNames.join("|")+")"};case"M":return{g:1,c:"m = parseInt(Date.monthNumbers[results["+t+"]], 10);\n",s:"(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)"};case"n":case"m":return{g:1,c:"m = parseInt(results["+t+"], 10) - 1;\n",s:"(\\d{1,2})"};case"t":return{g:0,c:null,s:"\\d{1,2}"};case"L":return{g:0,c:null,s:"(?:1|0)"};case"Y":return{g:1,c:"y = parseInt(results["+t+"], 10);\n",s:"(\\d{4})"};case"y":return{g:1,c:"var ty = parseInt(results["+t+"], 10);\ny = ty > Date.y2kYear ? 1900 + ty : 2000 + ty;\n",s:"(\\d{1,2})"};case"a":return{g:1,c:"if (results["+t+"] == 'am') {\nif (h == 12) { h = 0; }\n} else { if (h < 12) { h += 12; }}",s:"(am|pm)"};case"A":return{g:1,c:"if (results["+t+"] == 'AM') {\nif (h == 12) { h = 0; }\n} else { if (h < 12) { h += 12; }}",s:"(AM|PM)"};case"g":case"G":case"h":case"H":return{g:1,c:"h = parseInt(results["+t+"], 10);\n",s:"(\\d{1,2})"};case"i":return{g:1,c:"i = parseInt(results["+t+"], 10);\n",s:"(\\d{2})"};case"s":return{g:1,c:"s = parseInt(results["+t+"], 10);\n",s:"(\\d{2})"};case"O":return{g:0,c:null,s:"[+-]\\d{4}"};case"T":return{g:0,c:null,s:"[A-Z]{3}"};case"Z":return{g:0,c:null,s:"[+-]\\d{1,5}"};default:return{g:0,c:null,s:String.escape(e)}}},Date.prototype.getTimezone=function(){return(""+this).replace(/^.*? ([A-Z]{3}) [0-9]{4}.*$/,"$1").replace(/^.*?\(([A-Z])[a-z]+ ([A-Z])[a-z]+ ([A-Z])[a-z]+\)$/,"$1$2$3")},Date.prototype.getGMTOffset=function(){return(this.getTimezoneOffset()>0?"-":"+")+String.leftPad(Math.floor(Math.abs(this.getTimezoneOffset())/60),2,"0")+String.leftPad(Math.abs(this.getTimezoneOffset())%60,2,"0")},Date.prototype.getDayOfYear=function(){var e=0;Date.daysInMonth[1]=this.isLeapYear()?29:28;for(var t=0;this.getMonth()>t;++t)e+=Date.daysInMonth[t];return e+this.getDate()},Date.prototype.getWeekOfYear=function(){var e=this.getDayOfYear()+(4-this.getDay()),t=new Date(this.getFullYear(),0,1),n=7-t.getDay()+4;return String.leftPad(Math.ceil((e-n)/7)+1,2,"0")},Date.prototype.isLeapYear=function(){var e=this.getFullYear();return 0==(3&e)&&(e%100||0==e%400&&e)},Date.prototype.getFirstDayOfMonth=function(){var e=(this.getDay()-(this.getDate()-1))%7;return 0>e?e+7:e},Date.prototype.getLastDayOfMonth=function(){var e=(this.getDay()+(Date.daysInMonth[this.getMonth()]-this.getDate()))%7;return 0>e?e+7:e},Date.prototype.getDaysInMonth=function(){return Date.daysInMonth[1]=this.isLeapYear()?29:28,Date.daysInMonth[this.getMonth()]},Date.prototype.getSuffix=function(){switch(this.getDate()){case 1:case 21:case 31:return"st";case 2:case 22:return"nd";case 3:case 23:return"rd";default:return"th"}},String.escape=function(e){return e.replace(/('|\\)/g,"\\$1")},String.leftPad=function(e,t,n){var r=new String(e);for(null==n&&(n=" ");t>r.length;)r=n+r;return r},Date.daysInMonth=[31,28,31,30,31,30,31,31,30,31,30,31],Date.monthNames=["January","February","March","April","May","June","July","August","September","October","November","December"],Date.dayNames=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],Date.y2kYear=50,Date.monthNumbers={Jan:0,Feb:1,Mar:2,Apr:3,May:4,Jun:5,Jul:6,Aug:7,Sep:8,Oct:9,Nov:10,Dec:11},Date.patterns={ISO8601LongPattern:"Y-m-d H:i:s",ISO8601ShortPattern:"Y-m-d",ShortDatePattern:"n/j/Y",LongDatePattern:"l, F d, Y",FullDateTimePattern:"l, F d, Y g:i:s A",MonthDayPattern:"F d",ShortTimePattern:"g:i A",LongTimePattern:"g:i:s A",SortableDateTimePattern:"Y-m-d\\TH:i:s",UniversalSortableDateTimePattern:"Y-m-d H:i:sO",YearMonthPattern:"F, Y"}
-}(),function(){var e=function(e){if("string"==typeof e){var t=e;e={href:t}}e.rel||(e.rel="stylesheet");var n=document.createElement("link");for(var r in e)n.setAttribute(r,e[r]);var i=document.getElementsByTagName("head")[0];i.appendChild(n)};"undefined"==typeof jQuery?window.getCSS=e:jQuery.getCSS=e}(),function(){function e(e){return this.options=e,"undefined"==this.options.name?(console.log("Failed to instantiate new card without name! Aborting!"),void 0):("undefined"!=typeof module&&null!==module?module.exports=this:window[this.options.name]=this,void 0)}var e;e.prototype.options={},e.prototype.init=function(){"function"==typeof this.options.init&&this.options.init()},e.prototype.render=function(){"function"==typeof this.options.render&&this.options.render()},e.prototype.reload=function(){"function"==typeof this.options.reload&&this.options.reload()},"undefined"!=typeof module&&null!==module?module.exports=e:window.CardPrototype=e}(this);var Analytics={ciims:{},changeTimeout:null,init:function(){this.ciims=CiiMSDashboard.getAuthData(),this.nanoscroller(),this.centerAlignImages(),this.providerClickBehavior(),this.changeBehavior()},providerClickBehavior:function(){var e=this;$(".provider").click(function(t){t.preventDefault(),$(".provider").removeClass("active"),$(this).addClass("active");var n=$(this).attr("data-attr-name");$(".options-panel").hide(),$(".options-panel."+n).show(),e.nanoscroller()})},centerAlignImages:function(){setTimeout(function(){$(".providers img").each(function(){var e=$(this).height(),t=50-e/2;$(this).css("padding-top",t)})},500)},ajaxSuccess:function(){var e=this;e.nanoscroller()},changeBehavior:function(){var e=this;$("input").change(function(){clearTimeout(e.changeTimeout),e.changeTimeout=setTimeout(function(){e.submitAjaxChangeRequest()},250)}),$("input").keyup(function(){clearTimeout(e.changeTimeout),e.changeTimeout=setTimeout(function(){e.submitAjaxChangeRequest()},250)})},submitAjaxChangeRequest:function(){var e=this,t=$("form").serialize();$.ajax({url:window.location.origin+"/api/setting/analytics",type:"POST",headers:CiiMSDashboard.getRequestHeaders(),data:t,beforeSend:function(){CiiMSDashboard.ajaxBeforeSend()},success:function(t){e.ajaxSuccess(t.success)},completed:CiiMSDashboard.ajaxCompleted()})},nanoscroller:function(){return $(".nano").nanoScroller({iOSNativeScrolling:!0})}};Array.prototype.remove=function(e,t){var n=this.slice((t||e)+1||this.length);return this.length=0>e?this.length+e:e,this.push.apply(this,n)},function(){function e(e){return this.options=$.extend({},this.defaultOptions,e),this.id=this.options.id,null==this.options.name?(console.log("Card instantiated without name! Card will not be rendered"),void 0):null==this.options.version?(console.log("Card instantiated without version number! Card will not be rendered"),void 0):null==this.id?(console.log("Card initialized without ID! Card will not be rendered."),void 0):1==$(".dashboard-cards #"+this.id).length?(console.log("Card instance already in DOM! Card will not be rendered"),void 0):(null==this.options.size&&(this.options.size=this.options.availableTileSizes[0]),this.registerScript("js","init"),void 0)}var e,t={square:$("").addClass("square"),rectangle:$("").addClass("rectangle").attr("data-ss-colspan","2"),rectangleTall:$("").addClass("rectangleTall"),squareBig:$("").addClass("squareBig").attr("data-ss-colspan","2")};e.prototype.defaultOptions={id:null,name:null,version:null,footerText:"",properties:{},size:null,availableTileSizes:["square"],css:null,js:null,html:null},e.prototype.resize=function(){var e=this,t="#"+this.id,n=this.options.availableTileSizes.length,r=this.options.size,i=this.options.availableTileSizes.indexOf(r),o={};if(-1!=i){i+1>=n&&(i=-1);var a=e.options.availableTileSizes[i+1];$(t).removeClass(r).addClass(a),"square"==a||"rectangleTall"==a?$(t).attr("data-ss-colspan","1"):$(t).attr("data-ss-colspan","2"),e.options.size=a,$.each(e.options.properties,function(e,t){o[e]=t.value}),$.ajax({url:window.location.origin+"/api/card/details/id/"+e.id,type:"POST",headers:CiiMSDashboard.getRequestHeaders(),beforeSend:CiiMSDashboard.ajaxBeforeSend(),data:{size:e.options.size,properties:o},completed:CiiMSDashboard.ajaxCompleted()}),e.rebuild()}},e.prototype.rebuild=function(){$(".dashboard-cards").trigger("ss-destroy").trigger("ss-rearrange").shapeshift({align:"left",minColumns:1,maxColumns:2,gutterX:20,gutterY:20,paddingX:0,paddingY:0,enableResize:!0,enableDrag:!0,animated:!0,animationSpeed:225,animationThreshold:100})},e.prototype.bindEventListeners=function(e,t){var n=this;t.resize&&$("#"+e+" #card-resize-button").click(function(){n.resize()}),t.settings&&$("#"+e+" #card-settings-button").click(function(){$(".shader").addClass("visible"),n.settings()}),$(".shader").click(function(){$(this).removeClass("visible"),$(".settings-sidebar").removeClass("visible")})},e.prototype.settings=function(){var e=this,t=$(".settings-sidebar"),n=$(t).attr("card-id"),r={};if(n==e.options.id)return $(t).toggleClass("visible"),$(t).hasClass("visible")?$(".shader").addClass("visible"):$(".shader").removeClass("visible"),void 0;$(t).removeClass("visible").empty().attr("card-id",e.options.id);var i=$("#settings-text").text();h2=$("").text(i.replace("{cardname}",e.options.name)),form=$("
',e(a).insertAfter(this),e(o.holder).css("width",i.width),e(o.holder).css("height",i.height),""!=e(o.real_input).val()&&e.fn.tagsInput.importTags(e(o.real_input),e(o.real_input).val()),i.interactive){if(e(o.fake_input).val(e(o.fake_input).attr("data-default")),e(o.fake_input).css("color",i.placeholderColor),e(o.fake_input).resetAutosize(i),e(o.holder).bind("click",o,function(t){e(t.data.fake_input).focus()}),e(o.fake_input).bind("focus",o,function(t){e(t.data.fake_input).val()==e(t.data.fake_input).attr("data-default")&&e(t.data.fake_input).val(""),e(t.data.fake_input).css("color","#000000")}),void 0!=i.autocomplete_url){autocomplete_options={source:i.autocomplete_url};for(attrname in i.autocomplete)autocomplete_options[attrname]=i.autocomplete[attrname];void 0!==jQuery.Autocompleter?(e(o.fake_input).autocomplete(i.autocomplete_url,i.autocomplete),e(o.fake_input).bind("result",o,function(t,n){n&&e("#"+r).addTag(n[0]+"",{focus:!0,unique:i.unique})})):void 0!==jQuery.ui.autocomplete&&(e(o.fake_input).autocomplete(autocomplete_options),e(o.fake_input).bind("autocompleteselect",o,function(t,n){return e(t.data.real_input).addTag(n.item.value,{focus:!0,unique:i.unique}),!1}))}else e(o.fake_input).bind("blur",o,function(t){var n=e(this).attr("data-default");return""!=e(t.data.fake_input).val()&&e(t.data.fake_input).val()!=n?t.data.minChars<=e(t.data.fake_input).val().length&&(!t.data.maxChars||t.data.maxChars>=e(t.data.fake_input).val().length)&&e(t.data.real_input).addTag(e(t.data.fake_input).val(),{focus:!0,unique:i.unique}):(e(t.data.fake_input).val(e(t.data.fake_input).attr("data-default")),e(t.data.fake_input).css("color",i.placeholderColor)),!1});e(o.fake_input).bind("keypress",o,function(t){return t.which==t.data.delimiter.charCodeAt(0)||13==t.which?(t.preventDefault(),t.data.minChars<=e(t.data.fake_input).val().length&&(!t.data.maxChars||t.data.maxChars>=e(t.data.fake_input).val().length)&&e(t.data.real_input).addTag(e(t.data.fake_input).val(),{focus:!0,unique:i.unique}),e(t.data.fake_input).resetAutosize(i),!1):(t.data.autosize&&e(t.data.fake_input).doAutosize(i),void 0)}),o.removeWithBackspace&&e(o.fake_input).bind("keydown",function(t){if(8==t.keyCode&&""==e(this).val()){t.preventDefault();var n=e(this).closest(".tagsinput").find(".tag:last").text(),r=e(this).attr("id").replace(/_tag$/,"");n=n.replace(/[\s]+x$/,""),e("#"+r).removeTag(escape(n)),e(this).trigger("focus")}}),e(o.fake_input).blur(),o.unique&&e(o.fake_input).keydown(function(t){(8==t.keyCode||String.fromCharCode(t.which).match(/\w+|[áéíóúÁÉÍÓÚñÑ,/]+/))&&e(this).removeClass("not_valid")})}return!1}),this},e.fn.tagsInput.updateTagsField=function(n,r){var i=e(n).attr("id");e(n).val(r.join(t[i]))},e.fn.tagsInput.importTags=function(r,o){e(r).val("");var a=e(r).attr("id"),s=o.split(t[a]);for(i=0;s.length>i;i++)e(r).addTag(s[i],{focus:!1,callback:!1});if(n[a]&&n[a].onChange){var l=n[a].onChange;l.call(r,r,s[i])}}}(jQuery),function(e){"use strict";var t={i18n:{ar:{months:["كانون الثاني","شباط","آذار","نيسان","مايو","حزيران","تموز","آب","أيلول","تشرين الأول","تشرين الثاني","كانون الأول"],dayOfWeek:["ن","ث","ع","خ","ج","س","ح"]},ro:{months:["ianuarie","februarie","martie","aprilie","mai","iunie","iulie","august","septembrie","octombrie","noiembrie","decembrie"],dayOfWeek:["l","ma","mi","j","v","s","d"]},id:{months:["Januari","Februari","Maret","April","Mei","Juni","Juli","Agustus","September","Oktober","November","Desember"],dayOfWeek:["Sen","Sel","Rab","Kam","Jum","Sab","Min"]},bg:{months:["Януари","Февруари","Март","Април","Май","Юни","Юли","Август","Септември","Октомври","Ноември","Декември"],dayOfWeek:["Нд","Пн","Вт","Ср","Чт","Пт","Сб"]},fa:{months:["فروردین","اردیبهشت","خرداد","تیر","مرداد","شهریور","مهر","آبان","آذر","دی","بهمن","اسفند"],dayOfWeek:["یکشنبه","دوشنبه","سه شنبه","چهارشنبه","پنجشنبه","جمعه","شنبه"]},ru:{months:["Январь","Февраль","Март","Апрель","Май","Июнь","Июль","Август","Сентябрь","Октябрь","Ноябрь","Декабрь"],dayOfWeek:["Вск","Пн","Вт","Ср","Чт","Пт","Сб"]},uk:{months:["Січень","Лютий","Березень","Квітень","Травень","Червень","Липень","Серпень","Вересень","Жовтень","Листопад","Грудень"],dayOfWeek:["Ндл","Пнд","Втр","Срд","Чтв","Птн","Сбт"]},en:{months:["January","February","March","April","May","June","July","August","September","October","November","December"],dayOfWeek:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]},el:{months:["Ιανουάριος","Φεβρουάριος","Μάρτιος","Απρίλιος","Μάιος","Ιούνιος","Ιούλιος","Αύγουστος","Σεπτέμβριος","Οκτώβριος","Νοέμβριος","Δεκέμβριος"],dayOfWeek:["Κυρ","Δευ","Τρι","Τετ","Πεμ","Παρ","Σαβ"]},de:{months:["Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"],dayOfWeek:["So","Mo","Di","Mi","Do","Fr","Sa"]},nl:{months:["januari","februari","maart","april","mei","juni","juli","augustus","september","oktober","november","december"],dayOfWeek:["zo","ma","di","wo","do","vr","za"]},tr:{months:["Ocak","Şubat","Mart","Nisan","Mayıs","Haziran","Temmuz","Ağustos","Eylül","Ekim","Kasım","Aralık"],dayOfWeek:["Paz","Pts","Sal","Çar","Per","Cum","Cts"]},fr:{months:["Janvier","Février","Mars","Avril","Mai","Juin","Juillet","Août","Septembre","Octobre","Novembre","Décembre"],dayOfWeek:["Dim","Lun","Mar","Mer","Jeu","Ven","Sam"]},es:{months:["Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre"],dayOfWeek:["Dom","Lun","Mar","Mié","Jue","Vie","Sáb"]},th:{months:["มกราคม","กุมภาพันธ์","มีนาคม","เมษายน","พฤษภาคม","มิถุนายน","กรกฎาคม","สิงหาคม","กันยายน","ตุลาคม","พฤศจิกายน","ธันวาคม"],dayOfWeek:["อา.","จ.","อ.","พ.","พฤ.","ศ.","ส."]},pl:{months:["styczeń","luty","marzec","kwiecień","maj","czerwiec","lipiec","sierpień","wrzesień","październik","listopad","grudzień"],dayOfWeek:["nd","pn","wt","śr","cz","pt","sb"]},pt:{months:["Janeiro","Fevereiro","Março","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"],dayOfWeek:["Dom","Seg","Ter","Qua","Qui","Sex","Sab"]},ch:{months:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],dayOfWeek:["日","一","二","三","四","五","六"]},se:{months:["Januari","Februari","Mars","April","Maj","Juni","Juli","Augusti","September","Oktober","November","December"],dayOfWeek:["Sön","Mån","Tis","Ons","Tor","Fre","Lör"]},kr:{months:["1월","2월","3월","4월","5월","6월","7월","8월","9월","10월","11월","12월"],dayOfWeek:["일","월","화","수","목","금","토"]},it:{months:["Gennaio","Febbraio","Marzo","Aprile","Maggio","Giugno","Luglio","Agosto","Settembre","Ottobre","Novembre","Dicembre"],dayOfWeek:["Dom","Lun","Mar","Mer","Gio","Ven","Sab"]},da:{months:["January","Februar","Marts","April","Maj","Juni","July","August","September","Oktober","November","December"],dayOfWeek:["Søn","Man","Tir","Ons","Tor","Fre","Lør"]},no:{months:["Januar","Februar","Mars","April","Mai","Juni","Juli","August","September","Oktober","November","Desember"],dayOfWeek:["Søn","Man","Tir","Ons","Tor","Fre","Lør"]},ja:{months:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],dayOfWeek:["日","月","火","水","木","金","土"]},vi:{months:["Tháng 1","Tháng 2","Tháng 3","Tháng 4","Tháng 5","Tháng 6","Tháng 7","Tháng 8","Tháng 9","Tháng 10","Tháng 11","Tháng 12"],dayOfWeek:["CN","T2","T3","T4","T5","T6","T7"]},sl:{months:["Januar","Februar","Marec","April","Maj","Junij","Julij","Avgust","September","Oktober","November","December"],dayOfWeek:["Ned","Pon","Tor","Sre","Čet","Pet","Sob"]},cs:{months:["Leden","Únor","Březen","Duben","Květen","Červen","Červenec","Srpen","Září","Říjen","Listopad","Prosinec"],dayOfWeek:["Ne","Po","Út","St","Čt","Pá","So"]},hu:{months:["Január","Február","Március","Április","Május","Június","Július","Augusztus","Szeptember","Október","November","December"],dayOfWeek:["Va","Hé","Ke","Sze","Cs","Pé","Szo"]}},value:"",lang:"en",format:"Y/m/d H:i",formatTime:"H:i",formatDate:"Y/m/d",startDate:!1,step:60,monthChangeSpinner:!0,closeOnDateSelect:!1,closeOnWithoutClick:!0,closeOnInputClick:!0,timepicker:!0,datepicker:!0,weeks:!1,defaultTime:!1,defaultDate:!1,minDate:!1,maxDate:!1,minTime:!1,maxTime:!1,allowTimes:[],opened:!1,initTime:!0,inline:!1,theme:"",onSelectDate:function(){},onSelectTime:function(){},onChangeMonth:function(){},onChangeYear:function(){},onChangeDateTime:function(){},onShow:function(){},onClose:function(){},onGenerate:function(){},withoutCopyright:!0,inverseButton:!1,hours12:!1,next:"xdsoft_next",prev:"xdsoft_prev",dayOfWeekStart:0,parentID:"body",timeHeightInTimePicker:25,timepickerScrollbar:!0,todayButton:!0,defaultSelect:!0,scrollMonth:!0,scrollTime:!0,scrollInput:!0,lazyInit:!1,mask:!1,validateOnBlur:!0,allowBlank:!0,yearStart:1950,yearEnd:2050,style:"",id:"",fixed:!1,roundTime:"round",className:"",weekends:[],yearOffset:0,beforeShowDay:null};
-Array.prototype.indexOf||(Array.prototype.indexOf=function(e,t){var n,r;for(n=t||0,r=this.length;r>n;n+=1)if(this[n]===e)return n;return-1}),Date.prototype.countDaysInMonth=function(){return new Date(this.getFullYear(),this.getMonth()+1,0).getDate()},e.fn.xdsoftScroller=function(t){return this.each(function(){var n,r,i,o,a,s=e(this),l=function(e){var t,n={x:0,y:0};return"touchstart"===e.type||"touchmove"===e.type||"touchend"===e.type||"touchcancel"===e.type?(t=e.originalEvent.touches[0]||e.originalEvent.changedTouches[0],n.x=t.pageX,n.y=t.pageY):("mousedown"===e.type||"mouseup"===e.type||"mousemove"===e.type||"mouseover"===e.type||"mouseout"===e.type||"mouseenter"===e.type||"mouseleave"===e.type)&&(n.x=e.pageX,n.y=e.pageY),n},c=0,u=100,d=!1;e(this).hasClass("xdsoft_scroller_box")||(n=s.children().eq(0),r=s[0].clientHeight,i=n[0].offsetHeight,o=e(''),a=e(''),o.append(a),s.addClass("xdsoft_scroller_box").append(o),a.on("mousedown.xdsoft_scroller",function(n){r||s.trigger("resize_scroll.xdsoft_scroller",[t]);var i=n.pageY,l=parseInt(a.css("margin-top"),10),d=o[0].offsetHeight;document&&e(document.body).addClass("xdsoft_noselect"),e([document.body,window]).on("mouseup.xdsoft_scroller",function h(){e([document.body,window]).off("mouseup.xdsoft_scroller",h).off("mousemove.xdsoft_scroller",c).removeClass("xdsoft_noselect")}),e(document.body).on("mousemove.xdsoft_scroller",c=function(e){var t=e.pageY-i+l;0>t&&(t=0),t+a[0].offsetHeight>d&&(t=d-a[0].offsetHeight),s.trigger("scroll_element.xdsoft_scroller",[u?t/u:0])})}),s.on("scroll_element.xdsoft_scroller",function(e,t){r||s.trigger("resize_scroll.xdsoft_scroller",[t,!0]),t=t>1?1:0>t||isNaN(t)?0:t,a.css("margin-top",u*t),setTimeout(function(){n.css("marginTop",-parseInt((n[0].offsetHeight-r)*t,10))},10)}).on("resize_scroll.xdsoft_scroller",function(e,t,l){var c,d;r=s[0].clientHeight,i=n[0].offsetHeight,c=r/i,d=c*o[0].offsetHeight,c>1?a.hide():(a.show(),a.css("height",parseInt(d>10?d:10,10)),u=o[0].offsetHeight-a[0].offsetHeight,l!==!0&&s.trigger("scroll_element.xdsoft_scroller",[t||Math.abs(parseInt(n.css("marginTop"),10))/(i-r)]))}),s.mousewheel&&s.mousewheel(function(e,t){var o=Math.abs(parseInt(n.css("marginTop"),10));return s.trigger("scroll_element.xdsoft_scroller",[(o-20*t)/(i-r)]),e.stopPropagation(),!1}),s.on("touchstart",function(e){d=l(e)}),s.on("touchmove",function(e){if(d){var t=l(e),o=Math.abs(parseInt(n.css("marginTop"),10));s.trigger("scroll_element.xdsoft_scroller",[(o-(t.y-d.y))/(i-r)]),e.stopPropagation(),e.preventDefault(),d=l(e)}}),s.on("touchend touchcancel",function(){d=!1})),s.trigger("resize_scroll.xdsoft_scroller",[t])})},e.fn.datetimepicker=function(n){var r,i,o,a=48,s=57,l=96,c=105,u=17,d=46,h=13,p=27,f=8,g=37,m=38,v=39,b=40,y=9,x=116,w=65,C=67,S=86,k=90,$=89,_=!1,T=e.isPlainObject(n)||!n?e.extend(!0,{},t,n):e.extend(!0,{},t),M=0,D=function(e){e.on("open.xdsoft focusin.xdsoft mousedown.xdsoft",function t(){e.is(":disabled")||e.is(":hidden")||!e.is(":visible")||e.data("xdsoft_datetimepicker")||(clearTimeout(M),M=setTimeout(function(){e.data("xdsoft_datetimepicker")||r(e),e.off("open.xdsoft focusin.xdsoft mousedown.xdsoft",t).trigger("open.xdsoft")},100))})};return r=function(t){function r(){var e,n=!1;return T.startDate?n=o.strToDate(T.startDate):(n=T.value||(t&&t.val&&t.val()?t.val():""),n?n=o.strToDateTime(n):T.defaultDate&&(n=o.strToDate(T.defaultDate),T.defaultTime&&(e=o.strtotime(T.defaultTime),n.setHours(e.getHours()),n.setMinutes(e.getMinutes())))),n&&o.isValidDate(n)?A.data("changed",!0):n="",n||0}var i,M,D,N,L,E,A=e("'),F=e(' '),this.element.appendChild(n)),r=n.getElementsByTagName("span")[0],r&&(r.textContent=this.options.dictFallbackMessage),this.element.appendChild(this.getFallbackForm())},resize:function(e){var t,n,r;return t={srcX:0,srcY:0,srcWidth:e.width,srcHeight:e.height},n=e.width/e.height,t.optWidth=this.options.thumbnailWidth,t.optHeight=this.options.thumbnailHeight,null==t.optWidth&&null==t.optHeight?(t.optWidth=t.srcWidth,t.optHeight=t.srcHeight):null==t.optWidth?t.optWidth=n*t.optHeight:null==t.optHeight&&(t.optHeight=1/n*t.optWidth),r=t.optWidth/t.optHeight,e.height '),this.element.appendChild(c)),d=c.getElementsByTagName("span")[0],d&&(d.textContent=this.options.dictFallbackMessage),this.element.appendChild(this.getFallbackForm())},resize:function(a){var b,c,d;return b={srcX:0,srcY:0,srcWidth:a.width,srcHeight:a.height},c=a.width/a.height,b.optWidth=this.options.thumbnailWidth,b.optHeight=this.options.thumbnailHeight,null==b.optWidth&&null==b.optHeight?(b.optWidth=b.srcWidth,b.optHeight=b.srcHeight):null==b.optWidth?b.optWidth=c*b.optHeight:null==b.optHeight&&(b.optHeight=1/c*b.optWidth),d=b.optWidth/b.optHeight,a.height ';a(g).insertAfter(this);a(f.holder).css("width",e.width);a(f.holder).css("height",e.height);if(a(f.real_input).val()!=""){a.fn.tagsInput.importTags(a(f.real_input),a(f.real_input).val())}if(e.interactive){a(f.fake_input).val(a(f.fake_input).attr("data-default"));a(f.fake_input).css("color",e.placeholderColor);a(f.fake_input).resetAutosize(e);a(f.holder).bind("click",f,function(b){a(b.data.fake_input).focus()});a(f.fake_input).bind("focus",f,function(b){if(a(b.data.fake_input).val()==a(b.data.fake_input).attr("data-default")){a(b.data.fake_input).val("")}a(b.data.fake_input).css("color","#000000")});if(e.autocomplete_url!=undefined){autocomplete_options={source:e.autocomplete_url};for(attrname in e.autocomplete){autocomplete_options[attrname]=e.autocomplete[attrname]}if(jQuery.Autocompleter!==undefined){a(f.fake_input).autocomplete(e.autocomplete_url,e.autocomplete);a(f.fake_input).bind("result",f,function(b,c,f){if(c){a("#"+d).addTag(c[0]+"",{focus:true,unique:e.unique})}})}else if(jQuery.ui.autocomplete!==undefined){a(f.fake_input).autocomplete(autocomplete_options);a(f.fake_input).bind("autocompleteselect",f,function(b,c){a(b.data.real_input).addTag(c.item.value,{focus:true,unique:e.unique});return false})}}else{a(f.fake_input).bind("blur",f,function(b){var c=a(this).attr("data-default");if(a(b.data.fake_input).val()!=""&&a(b.data.fake_input).val()!=c){if(b.data.minChars<=a(b.data.fake_input).val().length&&(!b.data.maxChars||b.data.maxChars>=a(b.data.fake_input).val().length))a(b.data.real_input).addTag(a(b.data.fake_input).val(),{focus:true,unique:e.unique})}else{a(b.data.fake_input).val(a(b.data.fake_input).attr("data-default"));a(b.data.fake_input).css("color",e.placeholderColor)}return false})}a(f.fake_input).bind("keypress",f,function(b){if(b.which==b.data.delimiter.charCodeAt(0)||b.which==13){b.preventDefault();if(b.data.minChars<=a(b.data.fake_input).val().length&&(!b.data.maxChars||b.data.maxChars>=a(b.data.fake_input).val().length))a(b.data.real_input).addTag(a(b.data.fake_input).val(),{focus:true,unique:e.unique});a(b.data.fake_input).resetAutosize(e);return false}else if(b.data.autosize){a(b.data.fake_input).doAutosize(e)}});f.removeWithBackspace&&a(f.fake_input).bind("keydown",function(b){if(b.keyCode==8&&a(this).val()==""){b.preventDefault();var c=a(this).closest(".tagsinput").find(".tag:last").text();var d=a(this).attr("id").replace(/_tag$/,"");c=c.replace(/[\s]+x$/,"");a("#"+d).removeTag(escape(c));a(this).trigger("focus")}});a(f.fake_input).blur();if(f.unique){a(f.fake_input).keydown(function(b){if(b.keyCode==8||String.fromCharCode(b.which).match(/\w+|[áéíóúÁÉÍÓÚñÑ,/]+/)){a(this).removeClass("not_valid")}})}}return false});return this};a.fn.tagsInput.updateTagsField=function(c,d){var e=a(c).attr("id");a(c).val(d.join(b[e]))};a.fn.tagsInput.importTags=function(d,e){a(d).val("");var f=a(d).attr("id");var g=e.split(b[f]);for(i=0;i '),this.element.appendChild(c)),d=c.getElementsByTagName("span")[0],d&&(d.textContent=this.options.dictFallbackMessage),this.element.appendChild(this.getFallbackForm())},resize:function(a){var b,c,d;return b={srcX:0,srcY:0,srcWidth:a.width,srcHeight:a.height},c=a.width/a.height,b.optWidth=this.options.thumbnailWidth,b.optHeight=this.options.thumbnailHeight,null==b.optWidth&&null==b.optHeight?(b.optWidth=b.srcWidth,b.optHeight=b.srcHeight):null==b.optWidth?b.optWidth=c*b.optHeight:null==b.optHeight&&(b.optHeight=1/c*b.optWidth),d=b.optWidth/b.optHeight,a.height