text: function strlen(e){var t=e+"",n=0,i="",r=0;if(!this.php_js||!this.php_js.ini||!this.php_js.ini["unicode.semantics"]||"on"!==this.php_js.ini["unicode.semantics"].local_value.toLowerCase())return e.length;var o=function(e,t){var n=e.charCodeAt(t),i="",r="";if(55296<=n&&n<=56319){if(e.length<=t+1)throw"High surrogate without following low surrogate";if(i=e.charCodeAt(t+1),56320>i||i>57343)throw"High surrogate without following low surrogate";return e.charAt(t)+e.charAt(t+1)}if(56320<=n&&n<=57343){if(0===t)throw"Low surrogate without preceding high surrogate";if(r=e.charCodeAt(t-1),55296>r||r>56319)throw"Low surrogate without preceding high surrogate";return!1}return e.charAt(t)};for(n=0,r=0;n<t.length;n++)(i=o(t,n))!==!1&&r++;return r}function array_diff(e){var t={},n=arguments.length,i="",r=1,o="",s={};e:for(i in e)for(r=1;r<n;r++){s=arguments[r];for(o in s)if(s[o]===e[i])continue e;t[i]=e[i]}return t}function strtotime(e,t){function n(e,t,n){var i,r=c[t];"undefined"!=typeof r&&(i=r-l.getDay(),0===i?i=7*n:i>0&&"last"===e?i-=7:i<0&&"next"===e&&(i+=7),l.setDate(l.getDate()+i))}function i(e){var t=e.split(" "),i=t[0],r=t[1].substring(0,3),o=/\d+/.test(i),s="ago"===t[2],a=("last"===i?-1:1)*(s?-1:1);if(o&&(a*=parseInt(i,10)),u.hasOwnProperty(r)&&!t[1].match(/^mon(day|\.)?$/i))return l["set"+u[r]](l["get"+u[r]]()+a);if("wee"===r)return l.setDate(l.getDate()+7*a);if("next"===i||"last"===i)n(i,r,a);else if(!o)return!1;return!0}var r,o,s,a,l,c,u,d,h,f,p,m=!1;if(!e)return m;if(e=e.replace(/^\s+|\s+$/g,"").replace(/\s{2,}/g," ").replace(/[\t\r\n]/g,"").toLowerCase(),o=e.match(/^(\d{1,4})([\-\.\/\:])(\d{1,2})([\-\.\/\:])(\d{1,4})(?:\s(\d{1,2}):(\d{2})?:?(\d{2})?)?(?:\s([A-Z]+)?)?$/),o&&o[2]===o[4])if(o[1]>1901)switch(o[2]){case"-":return o[3]>12||o[5]>31?m:new Date(o[1],parseInt(o[3],10)-1,o[5],o[6]||0,o[7]||0,o[8]||0,o[9]||0)/1e3;case".":return m;case"/":return o[3]>12||o[5]>31?m:new Date(o[1],parseInt(o[3],10)-1,o[5],o[6]||0,o[7]||0,o[8]||0,o[9]||0)/1e3}else if(o[5]>1901)switch(o[2]){case"-":return o[3]>12||o[1]>31?m:new Date(o[5],parseInt(o[3],10)-1,o[1],o[6]||0,o[7]||0,o[8]||0,o[9]||0)/1e3;case".":return o[3]>12||o[1]>31?m:new Date(o[5],parseInt(o[3],10)-1,o[1],o[6]||0,o[7]||0,o[8]||0,o[9]||0)/1e3;case"/":return o[1]>12||o[3]>31?m:new Date(o[5],parseInt(o[1],10)-1,o[3],o[6]||0,o[7]||0,o[8]||0,o[9]||0)/1e3}else switch(o[2]){case"-":return o[3]>12||o[5]>31||o[1]<70&&o[1]>38?m:(a=o[1]>=0&&o[1]<=38?+o[1]+2e3:o[1],new Date(a,parseInt(o[3],10)-1,o[5],o[6]||0,o[7]||0,o[8]||0,o[9]||0)/1e3);case".":return o[5]>=70?o[3]>12||o[1]>31?m:new Date(o[5],parseInt(o[3],10)-1,o[1],o[6]||0,o[7]||0,o[8]||0,o[9]||0)/1e3:o[5]<60&&!o[6]?o[1]>23||o[3]>59?m:(s=new Date,new Date(s.getFullYear(),s.getMonth(),s.getDate(),o[1]||0,o[3]||0,o[5]||0,o[9]||0)/1e3):m;case"/":return o[1]>12||o[3]>31||o[5]<70&&o[5]>38?m:(a=o[5]>=0&&o[5]<=38?+o[5]+2e3:o[5],new Date(a,parseInt(o[1],10)-1,o[3],o[6]||0,o[7]||0,o[8]||0,o[9]||0)/1e3);case":":return o[1]>23||o[3]>59||o[5]>59?m:(s=new Date,new Date(s.getFullYear(),s.getMonth(),s.getDate(),o[1]||0,o[3]||0,o[5]||0)/1e3)}if("now"===e)return null===t||isNaN(t)?(new Date).getTime()/1e3|0:0|t;if(!isNaN(r=Date.parse(e)))return r/1e3|0;if((o=e.match(/^([0-9]{4}-[0-9]{2}-[0-9]{2})[ t]([0-9]{2}:[0-9]{2}:[0-9]{2}(\.[0-9]+)?)([\+-][0-9]{2}(:[0-9]{2})?|z)/))&&("z"==o[4]?o[4]="Z":o[4].match(/^([\+-][0-9]{2})$/)&&(o[4]=o[4]+":00"),!isNaN(r=Date.parse(o[1]+"T"+o[2]+o[4]))))return r/1e3|0;if(l=t?new Date(1e3*t):new Date,c={sun:0,mon:1,tue:2,wed:3,thu:4,fri:5,sat:6},u={yea:"FullYear",mon:"Month",day:"Date",hou:"Hours",min:"Minutes",sec:"Seconds"},h="(years?|months?|weeks?|days?|hours?|minutes?|min|seconds?|sec|sunday|sun\\.?|monday|mon\\.?|tuesday|tue\\.?|wednesday|wed\\.?|thursday|thu\\.?|friday|fri\\.?|saturday|sat\\.?)",f="([+-]?\\d+\\s"+h+"|(last|next)\\s"+h+")(\\sago)?",o=e.match(new RegExp(f,"gi")),!o)return m;for(p=0,d=o.length;p<d;p++)if(!i(o[p]))return m;return l.getTime()/1e3}function is_numeric(e){var t=" \n\r\t\f\x0B            ​\u2028\u2029　";return("number"==typeof e||"string"==typeof e&&t.indexOf(e.slice(-1))===-1)&&""!==e&&!isNaN(e)}if(!function(e,t){"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(e,t){function n(e){var t=!!e&&"length"in e&&e.length,n=oe.type(e);return"function"!==n&&!oe.isWindow(e)&&("array"===n||0===t||"number"==typeof t&&t>0&&t-1 in e)}function i(e,t,n){if(oe.isFunction(t))return oe.grep(e,function(e,i){return!!t.call(e,i,e)!==n});if(t.nodeType)return oe.grep(e,function(e){return e===t!==n});if("string"==typeof t){if(me.test(t))return oe.filter(t,e,n);t=oe.filter(t,e)}return oe.grep(e,function(e){return J.call(t,e)>-1!==n})}function r(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}function o(e){var t={};return oe.each(e.match(we)||[],function(e,n){t[n]=!0}),t}function s(){X.removeEventListener("DOMContentLoaded",s),e.removeEventListener("load",s),oe.ready()}function a(){this.expando=oe.expando+a.uid++}function l(e,t,n){var i;if(void 0===n&&1===e.nodeType)if(i="data-"+t.replace(Me,"-$&").toLowerCase(),n=e.getAttribute(i),"string"==typeof n){try{n="true"===n||"false"!==n&&("null"===n?null:+n+""===n?+n:De.test(n)?oe.parseJSON(n):n)}catch(r){}Te.set(e,t,n)}else n=void 0;return n}function c(e,t,n,i){var r,o=1,s=20,a=i?function(){return i.cur()}:function(){return oe.css(e,t,"")},l=a(),c=n&&n[3]||(oe.cssNumber[t]?"":"px"),u=(oe.cssNumber[t]||"px"!==c&&+l)&&Le.exec(oe.css(e,t));if(u&&u[3]!==c){c=c||u[3],n=n||[],u=+l||1;do o=o||".5",u/=o,oe.style(e,t,u+c);while(o!==(o=a()/l)&&1!==o&&--s)}return n&&(u=+u||+l||0,r=n[1]?u+(n[1]+1)*n[2]:+n[2],i&&(i.unit=c,i.start=u,i.end=r)),r}function u(e,t){var n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[];return void 0===t||t&&oe.nodeName(e,t)?oe.merge([e],n):n}function d(e,t){for(var n=0,i=e.length;i>n;n++)Se.set(e[n],"globalEval",!t||Se.get(t[n],"globalEval"))}function h(e,t,n,i,r){for(var o,s,a,l,c,h,f=t.createDocumentFragment(),p=[],m=0,g=e.length;g>m;m++)if(o=e[m],o||0===o)if("object"===oe.type(o))oe.merge(p,o.nodeType?[o]:o);else if(Pe.test(o)){for(s=s||f.appendChild(t.createElement("div")),a=(Ne.exec(o)||["",""])[1].toLowerCase(),l=Re[a]||Re._default,s.innerHTML=l[1]+oe.htmlPrefilter(o)+l[2],h=l[0];h--;)s=s.lastChild;oe.merge(p,s.childNodes),s=f.firstChild,s.textContent=""}else p.push(t.createTextNode(o));for(f.textContent="",m=0;o=p[m++];)if(i&&oe.inArray(o,i)>-1)r&&r.push(o);else if(c=oe.contains(o.ownerDocument,o),s=u(f.appendChild(o),"script"),c&&d(s),n)for(h=0;o=s[h++];)Ie.test(o.type||"")&&n.push(o);return f}function f(){return!0}function p(){return!1}function m(){try{return X.activeElement}catch(e){}}function g(e,t,n,i,r,o){var s,a;if("object"==typeof t){"string"!=typeof n&&(i=i||n,n=void 0);for(a in t)g(e,a,n,i,t[a],o);return e}if(null==i&&null==r?(r=n,i=n=void 0):null==r&&("string"==typeof n?(r=i,i=void 0):(r=i,i=n,n=void 0)),r===!1)r=p;else if(!r)return e;return 1===o&&(s=r,r=function(e){return oe().off(e),s.apply(this,arguments)},r.guid=s.guid||(s.guid=oe.guid++)),e.each(function(){oe.event.add(this,t,r,i,n)})}function v(e,t){return oe.nodeName(e,"table")&&oe.nodeName(11!==t.nodeType?t:t.firstChild,"tr")?e.getElementsByTagName("tbody")[0]||e.appendChild(e.ownerDocument.createElement("tbody")):e}function y(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function b(e){var t=ze.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function x(e,t){var n,i,r,o,s,a,l,c;if(1===t.nodeType){if(Se.hasData(e)&&(o=Se.access(e),s=Se.set(t,o),c=o.events)){delete s.handle,s.events={};for(r in c)for(n=0,i=c[r].length;i>n;n++)oe.event.add(t,r,c[r][n])}Te.hasData(e)&&(a=Te.access(e),l=oe.extend({},a),Te.set(t,l))}}function w(e,t){var n=t.nodeName.toLowerCase();"input"===n&&Oe.test(e.type)?t.checked=e.checked:"input"!==n&&"textarea"!==n||(t.defaultValue=e.defaultValue)}function C(e,t,n,i){t=K.apply([],t);var r,o,s,a,l,c,d=0,f=e.length,p=f-1,m=t[0],g=oe.isFunction(m);if(g||f>1&&"string"==typeof m&&!ie.checkClone&&qe.test(m))return e.each(function(r){var o=e.eq(r);g&&(t[0]=m.call(this,r,o.html())),C(o,t,n,i)});if(f&&(r=h(t,e[0].ownerDocument,!1,e,i),o=r.firstChild,1===r.childNodes.length&&(r=o),o||i)){for(s=oe.map(u(r,"script"),y),a=s.length;f>d;d++)l=r,d!==p&&(l=oe.clone(l,!0,!0),a&&oe.merge(s,u(l,"script"))),n.call(e[d],l,d);if(a)for(c=s[s.length-1].ownerDocument,oe.map(s,b),d=0;a>d;d++)l=s[d],Ie.test(l.type||"")&&!Se.access(l,"globalEval")&&oe.contains(c,l)&&(l.src?oe._evalUrl&&oe._evalUrl(l.src):oe.globalEval(l.textContent.replace(Ye,"")))}return e}function k(e,t,n){for(var i,r=t?oe.filter(t,e):e,o=0;null!=(i=r[o]);o++)n||1!==i.nodeType||oe.cleanData(u(i)),i.parentNode&&(n&&oe.contains(i.ownerDocument,i)&&d(u(i,"script")),i.parentNode.removeChild(i));return e}function _(e,t){var n=oe(t.createElement(e)).appendTo(t.body),i=oe.css(n[0],"display");return n.detach(),i}function S(e){var t=X,n=Ve[e];return n||(n=_(e,t),"none"!==n&&n||(Ue=(Ue||oe("<iframe frameborder='0' width='0' height='0'/>")).appendTo(t.documentElement),t=Ue[0].contentDocument,t.write(),t.close(),n=_(e,t),Ue.detach()),Ve[e]=n),n}function T(e,t,n){var i,r,o,s,a=e.style;return n=n||Ze(e),s=n?n.getPropertyValue(t)||n[t]:void 0,""!==s&&void 0!==s||oe.contains(e.ownerDocument,e)||(s=oe.style(e,t)),n&&!ie.pixelMarginRight()&&Xe.test(s)&&Ge.test(t)&&(i=a.width,r=a.minWidth,o=a.maxWidth,a.minWidth=a.maxWidth=a.width=s,s=n.width,a.width=i,a.minWidth=r,a.maxWidth=o),void 0!==s?s+"":s}function D(e,t){return{get:function(){return e()?void delete this.get:(this.get=t).apply(this,arguments)}}}function M(e){if(e in it)return e;for(var t=e[0].toUpperCase()+e.slice(1),n=nt.length;n--;)if(e=nt[n]+t,e in it)return e}function E(e,t,n){var i=Le.exec(t);return i?Math.max(0,i[2]-(n||0))+(i[3]||"px"):t}function L(e,t,n,i,r){for(var o=n===(i?"border":"content")?4:"width"===t?1:0,s=0;4>o;o+=2)"margin"===n&&(s+=oe.css(e,n+Ae[o],!0,r)),i?("content"===n&&(s-=oe.css(e,"padding"+Ae[o],!0,r)),"margin"!==n&&(s-=oe.css(e,"border"+Ae[o]+"Width",!0,r))):(s+=oe.css(e,"padding"+Ae[o],!0,r),"padding"!==n&&(s+=oe.css(e,"border"+Ae[o]+"Width",!0,r)));return s}function A(e,t,n){var i=!0,r="width"===t?e.offsetWidth:e.offsetHeight,o=Ze(e),s="border-box"===oe.css(e,"boxSizing",!1,o);if(0>=r||null==r){if(r=T(e,t,o),(0>r||null==r)&&(r=e.style[t]),Xe.test(r))return r;i=s&&(ie.boxSizingReliable()||r===e.style[t]),r=parseFloat(r)||0}return r+L(e,t,n||(s?"border":"content"),i,o)+"px"}function $(e,t){for(var n,i,r,o=[],s=0,a=e.length;a>s;s++)i=e[s],i.style&&(o[s]=Se.get(i,"olddisplay"),n=i.style.display,t?(o[s]||"none"!==n||(i.style.display=""),""===i.style.display&&$e(i)&&(o[s]=Se.access(i,"olddisplay",S(i.nodeName)))):(r=$e(i),"none"===n&&r||Se.set(i,"olddisplay",r?n:oe.css(i,"display"))));for(s=0;a>s;s++)i=e[s],i.style&&(t&&"none"!==i.style.display&&""!==i.style.display||(i.style.display=t?o[s]||"":"none"));return e}function O(e,t,n,i,r){return new O.prototype.init(e,t,n,i,r)}function N(){return e.setTimeout(function(){rt=void 0}),rt=oe.now()}function I(e,t){var n,i=0,r={height:e};for(t=t?1:0;4>i;i+=2-t)n=Ae[i],r["margin"+n]=r["padding"+n]=e;return t&&(r.opacity=r.width=e),r}function R(e,t,n){for(var i,r=(B.tweeners[t]||[]).concat(B.tweeners["*"]),o=0,s=r.length;s>o;o++)if(i=r[o].call(n,t,e))return i}function P(e,t,n){var i,r,o,s,a,l,c,u,d=this,h={},f=e.style,p=e.nodeType&&$e(e),m=Se.get(e,"fxshow");n.queue||(a=oe._queueHooks(e,"fx"),null==a.unqueued&&(a.unqueued=0,l=a.empty.fire,a.empty.fire=function(){a.unqueued||l()}),a.unqueued++,d.always(function(){d.always(function(){a.unqueued--,oe.queue(e,"fx").length||a.empty.fire()})})),1===e.nodeType&&("height"in t||"width"in t)&&(n.overflow=[f.overflow,f.overflowX,f.overflowY],c=oe.css(e,"display"),u="none"===c?Se.get(e,"olddisplay")||S(e.nodeName):c,"inline"===u&&"none"===oe.css(e,"float")&&(f.display="inline-block")),n.overflow&&(f.overflow="hidden",d.always(function(){f.overflow=n.overflow[0],f.overflowX=n.overflow[1],f.overflowY=n.overflow[2]}));for(i in t)if(r=t[i],st.exec(r)){if(delete t[i],o=o||"toggle"===r,r===(p?"hide":"show")){if("show"!==r||!m||void 0===m[i])continue;p=!0}h[i]=m&&m[i]||oe.style(e,i)}else c=void 0;if(oe.isEmptyObject(h))"inline"===("none"===c?S(e.nodeName):c)&&(f.display=c);else{m?"hidden"in m&&(p=m.hidden):m=Se.access(e,"fxshow",{}),o&&(m.hidden=!p),p?oe(e).show():d.done(function(){oe(e).hide()}),d.done(function(){var t;Se.remove(e,"fxshow");for(t in h)oe.style(e,t,h[t])});for(i in h)s=R(p?m[i]:0,i,d),i in m||(m[i]=s.start,p&&(s.end=s.start,s.start="width"===i||"height"===i?1:0))}}function H(e,t){var n,i,r,o,s;for(n in e)if(i=oe.camelCase(n),r=t[i],o=e[n],oe.isArray(o)&&(r=o[1],o=e[n]=o[0]),n!==i&&(e[i]=o,delete e[n]),s=oe.cssHooks[i],s&&"expand"in s){o=s.expand(o),delete e[i];for(n in o)n in e||(e[n]=o[n],t[n]=r)}else t[i]=r}function B(e,t,n){var i,r,o=0,s=B.prefilters.length,a=oe.Deferred().always(function(){delete l.elem}),l=function(){if(r)return!1;for(var t=rt||N(),n=Math.max(0,c.startTime+c.duration-t),i=n/c.duration||0,o=1-i,s=0,l=c.tweens.length;l>s;s++)c.tweens[s].run(o);return a.notifyWith(e,[c,o,n]),1>o&&l?n:(a.resolveWith(e,[c]),!1)},c=a.promise({elem:e,props:oe.extend({},t),opts:oe.extend(!0,{specialEasing:{},easing:oe.easing._default},n),originalProperties:t,originalOptions:n,startTime:rt||N(),duration:n.duration,tweens:[],createTween:function(t,n){var i=oe.Tween(e,c.opts,t,n,c.opts.specialEasing[t]||c.opts.easing);return c.tweens.push(i),i},stop:function(t){var n=0,i=t?c.tweens.length:0;if(r)return this;for(r=!0;i>n;n++)c.tweens[n].run(1);return t?(a.notifyWith(e,[c,1,0]),a.resolveWith(e,[c,t])):a.rejectWith(e,[c,t]),this}}),u=c.props;for(H(u,c.opts.specialEasing);s>o;o++)if(i=B.prefilters[o].call(c,e,u,c.opts))return oe.isFunction(i.stop)&&(oe._queueHooks(c.elem,c.opts.queue).stop=oe.proxy(i.stop,i)),i;return oe.map(u,R,c),oe.isFunction(c.opts.start)&&c.opts.start.call(e,c),oe.fx.timer(oe.extend(l,{elem:e,anim:c,queue:c.opts.queue})),c.progress(c.opts.progress).done(c.opts.done,c.opts.complete).fail(c.opts.fail).always(c.opts.always)}function j(e){return e.getAttribute&&e.getAttribute("class")||""}function F(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var i,r=0,o=t.toLowerCase().match(we)||[];if(oe.isFunction(n))for(;i=o[r++];)"+"===i[0]?(i=i.slice(1)||"*",(e[i]=e[i]||[]).unshift(n)):(e[i]=e[i]||[]).push(n)}}function W(e,t,n,i){function r(a){var l;return o[a]=!0,oe.each(e[a]||[],function(e,a){var c=a(t,n,i);return"string"!=typeof c||s||o[c]?s?!(l=c):void 0:(t.dataTypes.unshift(c),r(c),!1)}),l}var o={},s=e===Tt;return r(t.dataTypes[0])||!o["*"]&&r("*")}function q(e,t){var n,i,r=oe.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((r[n]?e:i||(i={}))[n]=t[n]);return i&&oe.extend(!0,e,i),e}function z(e,t,n){for(var i,r,o,s,a=e.contents,l=e.dataTypes;"*"===l[0];)l.shift(),void 0===i&&(i=e.mimeType||t.getResponseHeader("Content-Type"));if(i)for(r in a)if(a[r]&&a[r].test(i)){l.unshift(r);break}if(l[0]in n)o=l[0];else{for(r in n){if(!l[0]||e.converters[r+" "+l[0]]){o=r;break}s||(s=r)}o=o||s}return o?(o!==l[0]&&l.unshift(o),n[o]):void 0}function Y(e,t,n,i){var r,o,s,a,l,c={},u=e.dataTypes.slice();if(u[1])for(s in e.converters)c[s.toLowerCase()]=e.converters[s];for(o=u.shift();o;)if(e.responseFields[o]&&(n[e.responseFields[o]]=t),!l&&i&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),l=o,o=u.shift())if("*"===o)o=l;else if("*"!==l&&l!==o){if(s=c[l+" "+o]||c["* "+o],!s)for(r in c)if(a=r.split(" "),a[1]===o&&(s=c[l+" "+a[0]]||c["* "+a[0]])){s===!0?s=c[r]:c[r]!==!0&&(o=a[0],u.unshift(a[1]));break}if(s!==!0)if(s&&e["throws"])t=s(t);else try{t=s(t)}catch(d){return{state:"parsererror",error:s?d:"No conversion from "+l+" to "+o}}}return{state:"success",data:t}}function U(e,t,n,i){var r;if(oe.isArray(t))oe.each(t,function(t,r){n||Lt.test(e)?i(e,r):U(e+"["+("object"==typeof r&&null!=r?t:"")+"]",r,n,i)});else if(n||"object"!==oe.type(t))i(e,t);else for(r in t)U(e+"["+r+"]",t[r],n,i)}function V(e){return oe.isWindow(e)?e:9===e.nodeType&&e.defaultView}var G=[],X=e.document,Z=G.slice,K=G.concat,Q=G.push,J=G.indexOf,ee={},te=ee.toString,ne=ee.hasOwnProperty,ie={},re="2.2.4",oe=function(e,t){return new oe.fn.init(e,t)},se=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,ae=/^-ms-/,le=/-([\da-z])/gi,ce=function(e,t){return t.toUpperCase()};oe.fn=oe.prototype={jquery:re,constructor:oe,selector:"",length:0,toArray:function(){return Z.call(this)},get:function(e){return null!=e?0>e?this[e+this.length]:this[e]:Z.call(this)},pushStack:function(e){var t=oe.merge(this.constructor(),e);return t.prevObject=this,t.context=this.context,t},each:function(e){return oe.each(this,e)},map:function(e){return this.pushStack(oe.map(this,function(t,n){return e.call(t,n,t)}))},slice:function(){return this.pushStack(Z.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(0>e?t:0);return this.pushStack(n>=0&&t>n?[this[n]]:[])},end:function(){return this.prevObject||this.constructor()},push:Q,sort:G.sort,splice:G.splice},oe.extend=oe.fn.extend=function(){var e,t,n,i,r,o,s=arguments[0]||{},a=1,l=arguments.length,c=!1;for("boolean"==typeof s&&(c=s,s=arguments[a]||{},a++),"object"==typeof s||oe.isFunction(s)||(s={}),a===l&&(s=this,a--);l>a;a++)if(null!=(e=arguments[a]))for(t in e)n=s[t],i=e[t],s!==i&&(c&&i&&(oe.isPlainObject(i)||(r=oe.isArray(i)))?(r?(r=!1,o=n&&oe.isArray(n)?n:[]):o=n&&oe.isPlainObject(n)?n:{},s[t]=oe.extend(c,o,i)):void 0!==i&&(s[t]=i));return s},oe.extend({expando:"jQuery"+(re+Math.random()).replace(/\D/g,""),isReady:!0,error:function(e){throw new Error(e)},noop:function(){},isFunction:function(e){return"function"===oe.type(e)},isArray:Array.isArray,isWindow:function(e){return null!=e&&e===e.window},isNumeric:function(e){var t=e&&e.toString();return!oe.isArray(e)&&t-parseFloat(t)+1>=0},isPlainObject:function(e){var t;if("object"!==oe.type(e)||e.nodeType||oe.isWindow(e))return!1;if(e.constructor&&!ne.call(e,"constructor")&&!ne.call(e.constructor.prototype||{},"isPrototypeOf"))return!1;for(t in e);return void 0===t||ne.call(e,t)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},type:function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?ee[te.call(e)]||"object":typeof e},globalEval:function(e){var t,n=eval;e=oe.trim(e),e&&(1===e.indexOf("use strict")?(t=X.createElement("script"),t.text=e,X.head.appendChild(t).parentNode.removeChild(t)):n(e))},camelCase:function(e){return e.replace(ae,"ms-").replace(le,ce)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,t){var i,r=0;if(n(e))for(i=e.length;i>r&&t.call(e[r],r,e[r])!==!1;r++);else for(r in e)if(t.call(e[r],r,e[r])===!1)break;return e},trim:function(e){return null==e?"":(e+"").replace(se,"")},makeArray:function(e,t){var i=t||[];return null!=e&&(n(Object(e))?oe.merge(i,"string"==typeof e?[e]:e):Q.call(i,e)),i},inArray:function(e,t,n){return null==t?-1:J.call(t,e,n)},merge:function(e,t){for(var n=+t.length,i=0,r=e.length;n>i;i++)e[r++]=t[i];return e.length=r,e},grep:function(e,t,n){for(var i,r=[],o=0,s=e.length,a=!n;s>o;o++)i=!t(e[o],o),i!==a&&r.push(e[o]);return r},map:function(e,t,i){var r,o,s=0,a=[];if(n(e))for(r=e.length;r>s;s++)o=t(e[s],s,i),null!=o&&a.push(o);else for(s in e)o=t(e[s],s,i),null!=o&&a.push(o);return K.apply([],a)},guid:1,proxy:function(e,t){var n,i,r;return"string"==typeof t&&(n=e[t],t=e,e=n),oe.isFunction(e)?(i=Z.call(arguments,2),r=function(){return e.apply(t||this,i.concat(Z.call(arguments)))},r.guid=e.guid=e.guid||oe.guid++,r):void 0},now:Date.now,support:ie}),"function"==typeof Symbol&&(oe.fn[Symbol.iterator]=G[Symbol.iterator]),oe.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(e,t){ee["[object "+t+"]"]=t.toLowerCase()});var ue=function(e){function t(e,t,n,i){var r,o,s,a,l,c,d,f,p=t&&t.ownerDocument,m=t?t.nodeType:9;if(n=n||[],"string"!=typeof e||!e||1!==m&&9!==m&&11!==m)return n;if(!i&&((t?t.ownerDocument||t:j)!==$&&A(t),t=t||$,N)){if(11!==m&&(c=ve.exec(e)))if(r=c[1]){if(9===m){if(!(s=t.getElementById(r)))return n;if(s.id===r)return n.push(s),n}else if(p&&(s=p.getElementById(r))&&H(t,s)&&s.id===r)return n.push(s),n}else{if(c[2])return Q.apply(n,t.getElementsByTagName(e)),n;if((r=c[3])&&w.getElementsByClassName&&t.getElementsByClassName)return Q.apply(n,t.getElementsByClassName(r)),n}if(w.qsa&&!Y[e+" "]&&(!I||!I.test(e))){if(1!==m)p=t,f=e;else if("object"!==t.nodeName.toLowerCase()){for((a=t.getAttribute("id"))?a=a.replace(be,"\\$&"):t.setAttribute("id",a=B),d=S(e),o=d.length,l=he.test(a)?"#"+a:"[id='"+a+"']";o--;)d[o]=l+" "+h(d[o]);f=d.join(","),p=ye.test(e)&&u(t.parentNode)||t}if(f)try{return Q.apply(n,p.querySelectorAll(f)),n}catch(g){}finally{a===B&&t.removeAttribute("id")}}}return D(e.replace(ae,"$1"),t,n,i)}function n(){function e(n,i){return t.push(n+" ")>C.cacheLength&&delete e[t.shift()],e[n+" "]=i}var t=[];return e}function i(e){return e[B]=!0,e}function r(e){var t=$.createElement("div");try{return!!e(t)}catch(n){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function o(e,t){for(var n=e.split("|"),i=n.length;i--;)C.attrHandle[n[i]]=t}function s(e,t){var n=t&&e,i=n&&1===e.nodeType&&1===t.nodeType&&(~t.sourceIndex||V)-(~e.sourceIndex||V);if(i)return i;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function a(e){return function(t){var n=t.nodeName.toLowerCase();return"input"===n&&t.type===e}}function l(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function c(e){return i(function(t){return t=+t,i(function(n,i){for(var r,o=e([],n.length,t),s=o.length;s--;)n[r=o[s]]&&(n[r]=!(i[r]=n[r]))})})}function u(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}function d(){}function h(e){for(var t=0,n=e.length,i="";n>t;t++)i+=e[t].value;return i}function f(e,t,n){var i=t.dir,r=n&&"parentNode"===i,o=W++;return t.first?function(t,n,o){for(;t=t[i];)if(1===t.nodeType||r)return e(t,n,o)}:function(t,n,s){var a,l,c,u=[F,o];if(s){for(;t=t[i];)if((1===t.nodeType||r)&&e(t,n,s))return!0}else for(;t=t[i];)if(1===t.nodeType||r){if(c=t[B]||(t[B]={}),l=c[t.uniqueID]||(c[t.uniqueID]={}),(a=l[i])&&a[0]===F&&a[1]===o)return u[2]=a[2];if(l[i]=u,u[2]=e(t,n,s))return!0}}}function p(e){return e.length>1?function(t,n,i){for(var r=e.length;r--;)if(!e[r](t,n,i))return!1;return!0}:e[0]}function m(e,n,i){for(var r=0,o=n.length;o>r;r++)t(e,n[r],i);return i}function g(e,t,n,i,r){for(var o,s=[],a=0,l=e.length,c=null!=t;l>a;a++)(o=e[a])&&(n&&!n(o,i,r)||(s.push(o),c&&t.push(a)));return s}function v(e,t,n,r,o,s){return r&&!r[B]&&(r=v(r)),o&&!o[B]&&(o=v(o,s)),i(function(i,s,a,l){var c,u,d,h=[],f=[],p=s.length,v=i||m(t||"*",a.nodeType?[a]:a,[]),y=!e||!i&&t?v:g(v,h,e,a,l),b=n?o||(i?e:p||r)?[]:s:y;if(n&&n(y,b,a,l),r)for(c=g(b,f),r(c,[],a,l),u=c.length;u--;)(d=c[u])&&(b[f[u]]=!(y[f[u]]=d));if(i){if(o||e){if(o){for(c=[],u=b.length;u--;)(d=b[u])&&c.push(y[u]=d);o(null,b=[],c,l)}for(u=b.length;u--;)(d=b[u])&&(c=o?ee(i,d):h[u])>-1&&(i[c]=!(s[c]=d))}}else b=g(b===s?b.splice(p,b.length):b),o?o(null,s,b,l):Q.apply(s,b)})}function y(e){for(var t,n,i,r=e.length,o=C.relative[e[0].type],s=o||C.relative[" "],a=o?1:0,l=f(function(e){return e===t},s,!0),c=f(function(e){return ee(t,e)>-1},s,!0),u=[function(e,n,i){var r=!o&&(i||n!==M)||((t=n).nodeType?l(e,n,i):c(e,n,i));return t=null,r}];r>a;a++)if(n=C.relative[e[a].type])u=[f(p(u),n)];else{if(n=C.filter[e[a].type].apply(null,e[a].matches),n[B]){for(i=++a;r>i&&!C.relative[e[i].type];i++);return v(a>1&&p(u),a>1&&h(e.slice(0,a-1).concat({value:" "===e[a-2].type?"*":""})).replace(ae,"$1"),n,i>a&&y(e.slice(a,i)),r>i&&y(e=e.slice(i)),r>i&&h(e))}u.push(n)}return p(u)}function b(e,n){var r=n.length>0,o=e.length>0,s=function(i,s,a,l,c){var u,d,h,f=0,p="0",m=i&&[],v=[],y=M,b=i||o&&C.find.TAG("*",c),x=F+=null==y?1:Math.random()||.1,w=b.length;for(c&&(M=s===$||s||c);p!==w&&null!=(u=b[p]);p++){if(o&&u){for(d=0,s||u.ownerDocument===$||(A(u),a=!N);h=e[d++];)if(h(u,s||$,a)){l.push(u);break}c&&(F=x)}r&&((u=!h&&u)&&f--,i&&m.push(u))}if(f+=p,r&&p!==f){for(d=0;h=n[d++];)h(m,v,s,a);if(i){if(f>0)for(;p--;)m[p]||v[p]||(v[p]=Z.call(l));v=g(v)}Q.apply(l,v),c&&!i&&v.length>0&&f+n.length>1&&t.uniqueSort(l)}return c&&(F=x,M=y),m};return r?i(s):s}var x,w,C,k,_,S,T,D,M,E,L,A,$,O,N,I,R,P,H,B="sizzle"+1*new Date,j=e.document,F=0,W=0,q=n(),z=n(),Y=n(),U=function(e,t){return e===t&&(L=!0),0},V=1<<31,G={}.hasOwnProperty,X=[],Z=X.pop,K=X.push,Q=X.push,J=X.slice,ee=function(e,t){for(var n=0,i=e.length;i>n;n++)if(e[n]===t)return n;return-1},te="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",ne="[\\x20\\t\\r\\n\\f]",ie="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",re="\\["+ne+"*("+ie+")(?:"+ne+"*([*^$|!~]?=)"+ne+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+ie+"))|)"+ne+"*\\]",oe=":("+ie+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+re+")*)|.*)\\)|)",se=new RegExp(ne+"+","g"),ae=new RegExp("^"+ne+"+|((?:^|[^\\\\])(?:\\\\.)*)"+ne+"+$","g"),le=new RegExp("^"+ne+"*,"+ne+"*"),ce=new RegExp("^"+ne+"*([>+~]|"+ne+")"+ne+"*"),ue=new RegExp("="+ne+"*([^\\]'\"]*?)"+ne+"*\\]","g"),de=new RegExp(oe),he=new RegExp("^"+ie+"$"),fe={ID:new RegExp("^#("+ie+")"),CLASS:new RegExp("^\\.("+ie+")"),TAG:new RegExp("^("+ie+"|[*])"),ATTR:new RegExp("^"+re),PSEUDO:new RegExp("^"+oe),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+ne+"*(even|odd|(([+-]|)(\\d*)n|)"+ne+"*(?:([+-]|)"+ne+"*(\\d+)|))"+ne+"*\\)|)","i"),bool:new RegExp("^(?:"+te+")$","i"),needsContext:new RegExp("^"+ne+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+ne+"*((?:-\\d)?\\d*)"+ne+"*\\)|)(?=[^-]|$)","i")},pe=/^(?:input|select|textarea|button)$/i,me=/^h\d$/i,ge=/^[^{]+\{\s*\[native \w/,ve=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ye=/[+~]/,be=/'|\\/g,xe=new RegExp("\\\\([\\da-f]{1,6}"+ne+"?|("+ne+")|.)","ig"),we=function(e,t,n){var i="0x"+t-65536;return i!==i||n?t:0>i?String.fromCharCode(i+65536):String.fromCharCode(i>>10|55296,1023&i|56320)},Ce=function(){A()};try{Q.apply(X=J.call(j.childNodes),j.childNodes),X[j.childNodes.length].nodeType}catch(ke){Q={apply:X.length?function(e,t){K.apply(e,J.call(t))}:function(e,t){for(var n=e.length,i=0;e[n++]=t[i++];);e.length=n-1}}}w=t.support={},_=t.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return!!t&&"HTML"!==t.nodeName},A=t.setDocument=function(e){var t,n,i=e?e.ownerDocument||e:j;return i!==$&&9===i.nodeType&&i.documentElement?($=i,O=$.documentElement,N=!_($),(n=$.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",Ce,!1):n.attachEvent&&n.attachEvent("onunload",Ce)),w.attributes=r(function(e){return e.className="i",!e.getAttribute("className")}),w.getElementsByTagName=r(function(e){return e.appendChild($.createComment("")),!e.getElementsByTagName("*").length}),w.getElementsByClassName=ge.test($.getElementsByClassName),w.getById=r(function(e){return O.appendChild(e).id=B,!$.getElementsByName||!$.getElementsByName(B).length}),w.getById?(C.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&N){var n=t.getElementById(e);return n?[n]:[]}},C.filter.ID=function(e){var t=e.replace(xe,we);return function(e){return e.getAttribute("id")===t}}):(delete C.find.ID,C.filter.ID=function(e){var t=e.replace(xe,we);return function(e){var n="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}}),C.find.TAG=w.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):w.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,i=[],r=0,o=t.getElementsByTagName(e);if("*"===e){for(;n=o[r++];)1===n.nodeType&&i.push(n);return i}return o},C.find.CLASS=w.getElementsByClassName&&function(e,t){return"undefined"!=typeof t.getElementsByClassName&&N?t.getElementsByClassName(e):void 0},R=[],I=[],(w.qsa=ge.test($.querySelectorAll))&&(r(function(e){O.appendChild(e).innerHTML="<a id='"+B+"'></a><select id='"+B+"-\r\\' msallowcapture=''><option selected=''></option></select>",e.querySelectorAll("[msallowcapture^='']").length&&I.push("[*^$]="+ne+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||I.push("\\["+ne+"*(?:value|"+te+")"),e.querySelectorAll("[id~="+B+"-]").length||I.push("~="),e.querySelectorAll(":checked").length||I.push(":checked"),e.querySelectorAll("a#"+B+"+*").length||I.push(".#.+[+~]")}),r(function(e){var t=$.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&I.push("name"+ne+"*[*^$|!~]?="),e.querySelectorAll(":enabled").length||I.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),I.push(",.*:")})),(w.matchesSelector=ge.test(P=O.matches||O.webkitMatchesSelector||O.mozMatchesSelector||O.oMatchesSelector||O.msMatchesSelector))&&r(function(e){w.disconnectedMatch=P.call(e,"div"),P.call(e,"[s!='']:x"),R.push("!=",oe)}),I=I.length&&new RegExp(I.join("|")),R=R.length&&new RegExp(R.join("|")),t=ge.test(O.compareDocumentPosition),H=t||ge.test(O.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,i=t&&t.parentNode;return e===i||!(!i||1!==i.nodeType||!(n.contains?n.contains(i):e.compareDocumentPosition&&16&e.compareDocumentPosition(i)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},U=t?function(e,t){if(e===t)return L=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n?n:(n=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1,1&n||!w.sortDetached&&t.compareDocumentPosition(e)===n?e===$||e.ownerDocument===j&&H(j,e)?-1:t===$||t.ownerDocument===j&&H(j,t)?1:E?ee(E,e)-ee(E,t):0:4&n?-1:1)}:function(e,t){if(e===t)return L=!0,0;var n,i=0,r=e.parentNode,o=t.parentNode,a=[e],l=[t];if(!r||!o)return e===$?-1:t===$?1:r?-1:o?1:E?ee(E,e)-ee(E,t):0;if(r===o)return s(e,t);for(n=e;n=n.parentNode;)a.unshift(n);for(n=t;n=n.parentNode;)l.unshift(n);for(;a[i]===l[i];)i++;return i?s(a[i],l[i]):a[i]===j?-1:l[i]===j?1:0},$):$},t.matches=function(e,n){return t(e,null,null,n)},t.matchesSelector=function(e,n){if((e.ownerDocument||e)!==$&&A(e),n=n.replace(ue,"='$1']"),w.matchesSelector&&N&&!Y[n+" "]&&(!R||!R.test(n))&&(!I||!I.test(n)))try{var i=P.call(e,n);if(i||w.disconnectedMatch||e.document&&11!==e.document.nodeType)return i}catch(r){}return t(n,$,null,[e]).length>0},t.contains=function(e,t){return(e.ownerDocument||e)!==$&&A(e),H(e,t)},t.attr=function(e,t){(e.ownerDocument||e)!==$&&A(e);var n=C.attrHandle[t.toLowerCase()],i=n&&G.call(C.attrHandle,t.toLowerCase())?n(e,t,!N):void 0;return void 0!==i?i:w.attributes||!N?e.getAttribute(t):(i=e.getAttributeNode(t))&&i.specified?i.value:null},t.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},t.uniqueSort=function(e){var t,n=[],i=0,r=0;if(L=!w.detectDuplicates,E=!w.sortStable&&e.slice(0),e.sort(U),L){for(;t=e[r++];)t===e[r]&&(i=n.push(r));for(;i--;)e.splice(n[i],1)}return E=null,e},k=t.getText=function(e){var t,n="",i=0,r=e.nodeType;if(r){if(1===r||9===r||11===r){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=k(e)}else if(3===r||4===r)return e.nodeValue}else for(;t=e[i++];)n+=k(t);return n},C=t.selectors={cacheLength:50,createPseudo:i,match:fe,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(xe,we),e[3]=(e[3]||e[4]||e[5]||"").replace(xe,we),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||t.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&t.error(e[0]),e;
  },PSEUDO:function(e){var t,n=!e[6]&&e[2];return fe.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&de.test(n)&&(t=S(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(xe,we).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=q[e+" "];return t||(t=new RegExp("(^|"+ne+")"+e+"("+ne+"|$)"))&&q(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(e,n,i){return function(r){var o=t.attr(r,e);return null==o?"!="===n:!n||(o+="","="===n?o===i:"!="===n?o!==i:"^="===n?i&&0===o.indexOf(i):"*="===n?i&&o.indexOf(i)>-1:"$="===n?i&&o.slice(-i.length)===i:"~="===n?(" "+o.replace(se," ")+" ").indexOf(i)>-1:"|="===n&&(o===i||o.slice(0,i.length+1)===i+"-"))}},CHILD:function(e,t,n,i,r){var o="nth"!==e.slice(0,3),s="last"!==e.slice(-4),a="of-type"===t;return 1===i&&0===r?function(e){return!!e.parentNode}:function(t,n,l){var c,u,d,h,f,p,m=o!==s?"nextSibling":"previousSibling",g=t.parentNode,v=a&&t.nodeName.toLowerCase(),y=!l&&!a,b=!1;if(g){if(o){for(;m;){for(h=t;h=h[m];)if(a?h.nodeName.toLowerCase()===v:1===h.nodeType)return!1;p=m="only"===e&&!p&&"nextSibling"}return!0}if(p=[s?g.firstChild:g.lastChild],s&&y){for(h=g,d=h[B]||(h[B]={}),u=d[h.uniqueID]||(d[h.uniqueID]={}),c=u[e]||[],f=c[0]===F&&c[1],b=f&&c[2],h=f&&g.childNodes[f];h=++f&&h&&h[m]||(b=f=0)||p.pop();)if(1===h.nodeType&&++b&&h===t){u[e]=[F,f,b];break}}else if(y&&(h=t,d=h[B]||(h[B]={}),u=d[h.uniqueID]||(d[h.uniqueID]={}),c=u[e]||[],f=c[0]===F&&c[1],b=f),b===!1)for(;(h=++f&&h&&h[m]||(b=f=0)||p.pop())&&((a?h.nodeName.toLowerCase()!==v:1!==h.nodeType)||!++b||(y&&(d=h[B]||(h[B]={}),u=d[h.uniqueID]||(d[h.uniqueID]={}),u[e]=[F,b]),h!==t)););return b-=r,b===i||b%i===0&&b/i>=0}}},PSEUDO:function(e,n){var r,o=C.pseudos[e]||C.setFilters[e.toLowerCase()]||t.error("unsupported pseudo: "+e);return o[B]?o(n):o.length>1?(r=[e,e,"",n],C.setFilters.hasOwnProperty(e.toLowerCase())?i(function(e,t){for(var i,r=o(e,n),s=r.length;s--;)i=ee(e,r[s]),e[i]=!(t[i]=r[s])}):function(e){return o(e,0,r)}):o}},pseudos:{not:i(function(e){var t=[],n=[],r=T(e.replace(ae,"$1"));return r[B]?i(function(e,t,n,i){for(var o,s=r(e,null,i,[]),a=e.length;a--;)(o=s[a])&&(e[a]=!(t[a]=o))}):function(e,i,o){return t[0]=e,r(t,null,o,n),t[0]=null,!n.pop()}}),has:i(function(e){return function(n){return t(e,n).length>0}}),contains:i(function(e){return e=e.replace(xe,we),function(t){return(t.textContent||t.innerText||k(t)).indexOf(e)>-1}}),lang:i(function(e){return he.test(e||"")||t.error("unsupported lang: "+e),e=e.replace(xe,we).toLowerCase(),function(t){var n;do if(n=N?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return n=n.toLowerCase(),n===e||0===n.indexOf(e+"-");while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===O},focus:function(e){return e===$.activeElement&&(!$.hasFocus||$.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!C.pseudos.empty(e)},header:function(e){return me.test(e.nodeName)},input:function(e){return pe.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:c(function(){return[0]}),last:c(function(e,t){return[t-1]}),eq:c(function(e,t,n){return[0>n?n+t:n]}),even:c(function(e,t){for(var n=0;t>n;n+=2)e.push(n);return e}),odd:c(function(e,t){for(var n=1;t>n;n+=2)e.push(n);return e}),lt:c(function(e,t,n){for(var i=0>n?n+t:n;--i>=0;)e.push(i);return e}),gt:c(function(e,t,n){for(var i=0>n?n+t:n;++i<t;)e.push(i);return e})}},C.pseudos.nth=C.pseudos.eq;for(x in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})C.pseudos[x]=a(x);for(x in{submit:!0,reset:!0})C.pseudos[x]=l(x);return d.prototype=C.filters=C.pseudos,C.setFilters=new d,S=t.tokenize=function(e,n){var i,r,o,s,a,l,c,u=z[e+" "];if(u)return n?0:u.slice(0);for(a=e,l=[],c=C.preFilter;a;){i&&!(r=le.exec(a))||(r&&(a=a.slice(r[0].length)||a),l.push(o=[])),i=!1,(r=ce.exec(a))&&(i=r.shift(),o.push({value:i,type:r[0].replace(ae," ")}),a=a.slice(i.length));for(s in C.filter)!(r=fe[s].exec(a))||c[s]&&!(r=c[s](r))||(i=r.shift(),o.push({value:i,type:s,matches:r}),a=a.slice(i.length));if(!i)break}return n?a.length:a?t.error(e):z(e,l).slice(0)},T=t.compile=function(e,t){var n,i=[],r=[],o=Y[e+" "];if(!o){for(t||(t=S(e)),n=t.length;n--;)o=y(t[n]),o[B]?i.push(o):r.push(o);o=Y(e,b(r,i)),o.selector=e}return o},D=t.select=function(e,t,n,i){var r,o,s,a,l,c="function"==typeof e&&e,d=!i&&S(e=c.selector||e);if(n=n||[],1===d.length){if(o=d[0]=d[0].slice(0),o.length>2&&"ID"===(s=o[0]).type&&w.getById&&9===t.nodeType&&N&&C.relative[o[1].type]){if(t=(C.find.ID(s.matches[0].replace(xe,we),t)||[])[0],!t)return n;c&&(t=t.parentNode),e=e.slice(o.shift().value.length)}for(r=fe.needsContext.test(e)?0:o.length;r--&&(s=o[r],!C.relative[a=s.type]);)if((l=C.find[a])&&(i=l(s.matches[0].replace(xe,we),ye.test(o[0].type)&&u(t.parentNode)||t))){if(o.splice(r,1),e=i.length&&h(o),!e)return Q.apply(n,i),n;break}}return(c||T(e,d))(i,t,!N,n,!t||ye.test(e)&&u(t.parentNode)||t),n},w.sortStable=B.split("").sort(U).join("")===B,w.detectDuplicates=!!L,A(),w.sortDetached=r(function(e){return 1&e.compareDocumentPosition($.createElement("div"))}),r(function(e){return e.innerHTML="<a href='#'></a>","#"===e.firstChild.getAttribute("href")})||o("type|href|height|width",function(e,t,n){return n?void 0:e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),w.attributes&&r(function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||o("value",function(e,t,n){return n||"input"!==e.nodeName.toLowerCase()?void 0:e.defaultValue}),r(function(e){return null==e.getAttribute("disabled")})||o(te,function(e,t,n){var i;return n?void 0:e[t]===!0?t.toLowerCase():(i=e.getAttributeNode(t))&&i.specified?i.value:null}),t}(e);oe.find=ue,oe.expr=ue.selectors,oe.expr[":"]=oe.expr.pseudos,oe.uniqueSort=oe.unique=ue.uniqueSort,oe.text=ue.getText,oe.isXMLDoc=ue.isXML,oe.contains=ue.contains;var de=function(e,t,n){for(var i=[],r=void 0!==n;(e=e[t])&&9!==e.nodeType;)if(1===e.nodeType){if(r&&oe(e).is(n))break;i.push(e)}return i},he=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},fe=oe.expr.match.needsContext,pe=/^<([\w-]+)\s*\/?>(?:<\/\1>|)$/,me=/^.[^:#\[\.,]*$/;oe.filter=function(e,t,n){var i=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===i.nodeType?oe.find.matchesSelector(i,e)?[i]:[]:oe.find.matches(e,oe.grep(t,function(e){return 1===e.nodeType}))},oe.fn.extend({find:function(e){var t,n=this.length,i=[],r=this;if("string"!=typeof e)return this.pushStack(oe(e).filter(function(){for(t=0;n>t;t++)if(oe.contains(r[t],this))return!0}));for(t=0;n>t;t++)oe.find(e,r[t],i);return i=this.pushStack(n>1?oe.unique(i):i),i.selector=this.selector?this.selector+" "+e:e,i},filter:function(e){return this.pushStack(i(this,e||[],!1))},not:function(e){return this.pushStack(i(this,e||[],!0))},is:function(e){return!!i(this,"string"==typeof e&&fe.test(e)?oe(e):e||[],!1).length}});var ge,ve=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,ye=oe.fn.init=function(e,t,n){var i,r;if(!e)return this;if(n=n||ge,"string"==typeof e){if(i="<"===e[0]&&">"===e[e.length-1]&&e.length>=3?[null,e,null]:ve.exec(e),!i||!i[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(i[1]){if(t=t instanceof oe?t[0]:t,oe.merge(this,oe.parseHTML(i[1],t&&t.nodeType?t.ownerDocument||t:X,!0)),pe.test(i[1])&&oe.isPlainObject(t))for(i in t)oe.isFunction(this[i])?this[i](t[i]):this.attr(i,t[i]);return this}return r=X.getElementById(i[2]),r&&r.parentNode&&(this.length=1,this[0]=r),this.context=X,this.selector=e,this}return e.nodeType?(this.context=this[0]=e,this.length=1,this):oe.isFunction(e)?void 0!==n.ready?n.ready(e):e(oe):(void 0!==e.selector&&(this.selector=e.selector,this.context=e.context),oe.makeArray(e,this))};ye.prototype=oe.fn,ge=oe(X);var be=/^(?:parents|prev(?:Until|All))/,xe={children:!0,contents:!0,next:!0,prev:!0};oe.fn.extend({has:function(e){var t=oe(e,this),n=t.length;return this.filter(function(){for(var e=0;n>e;e++)if(oe.contains(this,t[e]))return!0})},closest:function(e,t){for(var n,i=0,r=this.length,o=[],s=fe.test(e)||"string"!=typeof e?oe(e,t||this.context):0;r>i;i++)for(n=this[i];n&&n!==t;n=n.parentNode)if(n.nodeType<11&&(s?s.index(n)>-1:1===n.nodeType&&oe.find.matchesSelector(n,e))){o.push(n);break}return this.pushStack(o.length>1?oe.uniqueSort(o):o)},index:function(e){return e?"string"==typeof e?J.call(oe(e),this[0]):J.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(oe.uniqueSort(oe.merge(this.get(),oe(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),oe.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return de(e,"parentNode")},parentsUntil:function(e,t,n){return de(e,"parentNode",n)},next:function(e){return r(e,"nextSibling")},prev:function(e){return r(e,"previousSibling")},nextAll:function(e){return de(e,"nextSibling")},prevAll:function(e){return de(e,"previousSibling")},nextUntil:function(e,t,n){return de(e,"nextSibling",n)},prevUntil:function(e,t,n){return de(e,"previousSibling",n)},siblings:function(e){return he((e.parentNode||{}).firstChild,e)},children:function(e){return he(e.firstChild)},contents:function(e){return e.contentDocument||oe.merge([],e.childNodes)}},function(e,t){oe.fn[e]=function(n,i){var r=oe.map(this,t,n);return"Until"!==e.slice(-5)&&(i=n),i&&"string"==typeof i&&(r=oe.filter(i,r)),this.length>1&&(xe[e]||oe.uniqueSort(r),be.test(e)&&r.reverse()),this.pushStack(r)}});var we=/\S+/g;oe.Callbacks=function(e){e="string"==typeof e?o(e):oe.extend({},e);var t,n,i,r,s=[],a=[],l=-1,c=function(){for(r=e.once,i=t=!0;a.length;l=-1)for(n=a.shift();++l<s.length;)s[l].apply(n[0],n[1])===!1&&e.stopOnFalse&&(l=s.length,n=!1);e.memory||(n=!1),t=!1,r&&(s=n?[]:"")},u={add:function(){return s&&(n&&!t&&(l=s.length-1,a.push(n)),function i(t){oe.each(t,function(t,n){oe.isFunction(n)?e.unique&&u.has(n)||s.push(n):n&&n.length&&"string"!==oe.type(n)&&i(n)})}(arguments),n&&!t&&c()),this},remove:function(){return oe.each(arguments,function(e,t){for(var n;(n=oe.inArray(t,s,n))>-1;)s.splice(n,1),l>=n&&l--}),this},has:function(e){return e?oe.inArray(e,s)>-1:s.length>0},empty:function(){return s&&(s=[]),this},disable:function(){return r=a=[],s=n="",this},disabled:function(){return!s},lock:function(){return r=a=[],n||(s=n=""),this},locked:function(){return!!r},fireWith:function(e,n){return r||(n=n||[],n=[e,n.slice?n.slice():n],a.push(n),t||c()),this},fire:function(){return u.fireWith(this,arguments),this},fired:function(){return!!i}};return u},oe.extend({Deferred:function(e){var t=[["resolve","done",oe.Callbacks("once memory"),"resolved"],["reject","fail",oe.Callbacks("once memory"),"rejected"],["notify","progress",oe.Callbacks("memory")]],n="pending",i={state:function(){return n},always:function(){return r.done(arguments).fail(arguments),this},then:function(){var e=arguments;return oe.Deferred(function(n){oe.each(t,function(t,o){var s=oe.isFunction(e[t])&&e[t];r[o[1]](function(){var e=s&&s.apply(this,arguments);e&&oe.isFunction(e.promise)?e.promise().progress(n.notify).done(n.resolve).fail(n.reject):n[o[0]+"With"](this===i?n.promise():this,s?[e]:arguments)})}),e=null}).promise()},promise:function(e){return null!=e?oe.extend(e,i):i}},r={};return i.pipe=i.then,oe.each(t,function(e,o){var s=o[2],a=o[3];i[o[1]]=s.add,a&&s.add(function(){n=a},t[1^e][2].disable,t[2][2].lock),r[o[0]]=function(){return r[o[0]+"With"](this===r?i:this,arguments),this},r[o[0]+"With"]=s.fireWith}),i.promise(r),e&&e.call(r,r),r},when:function(e){var t,n,i,r=0,o=Z.call(arguments),s=o.length,a=1!==s||e&&oe.isFunction(e.promise)?s:0,l=1===a?e:oe.Deferred(),c=function(e,n,i){return function(r){n[e]=this,i[e]=arguments.length>1?Z.call(arguments):r,i===t?l.notifyWith(n,i):--a||l.resolveWith(n,i)}};if(s>1)for(t=new Array(s),n=new Array(s),i=new Array(s);s>r;r++)o[r]&&oe.isFunction(o[r].promise)?o[r].promise().progress(c(r,n,t)).done(c(r,i,o)).fail(l.reject):--a;return a||l.resolveWith(i,o),l.promise()}});var Ce;oe.fn.ready=function(e){return oe.ready.promise().done(e),this},oe.extend({isReady:!1,readyWait:1,holdReady:function(e){e?oe.readyWait++:oe.ready(!0)},ready:function(e){(e===!0?--oe.readyWait:oe.isReady)||(oe.isReady=!0,e!==!0&&--oe.readyWait>0||(Ce.resolveWith(X,[oe]),oe.fn.triggerHandler&&(oe(X).triggerHandler("ready"),oe(X).off("ready"))))}}),oe.ready.promise=function(t){return Ce||(Ce=oe.Deferred(),"complete"===X.readyState||"loading"!==X.readyState&&!X.documentElement.doScroll?e.setTimeout(oe.ready):(X.addEventListener("DOMContentLoaded",s),e.addEventListener("load",s))),Ce.promise(t)},oe.ready.promise();var ke=function(e,t,n,i,r,o,s){var a=0,l=e.length,c=null==n;if("object"===oe.type(n)){r=!0;for(a in n)ke(e,t,a,n[a],!0,o,s)}else if(void 0!==i&&(r=!0,oe.isFunction(i)||(s=!0),c&&(s?(t.call(e,i),t=null):(c=t,t=function(e,t,n){return c.call(oe(e),n)})),t))for(;l>a;a++)t(e[a],n,s?i:i.call(e[a],a,t(e[a],n)));return r?e:c?t.call(e):l?t(e[0],n):o},_e=function(e){return 1===e.nodeType||9===e.nodeType||!+e.nodeType};a.uid=1,a.prototype={register:function(e,t){var n=t||{};return e.nodeType?e[this.expando]=n:Object.defineProperty(e,this.expando,{value:n,writable:!0,configurable:!0}),e[this.expando]},cache:function(e){if(!_e(e))return{};var t=e[this.expando];return t||(t={},_e(e)&&(e.nodeType?e[this.expando]=t:Object.defineProperty(e,this.expando,{value:t,configurable:!0}))),t},set:function(e,t,n){var i,r=this.cache(e);if("string"==typeof t)r[t]=n;else for(i in t)r[i]=t[i];return r},get:function(e,t){return void 0===t?this.cache(e):e[this.expando]&&e[this.expando][t]},access:function(e,t,n){var i;return void 0===t||t&&"string"==typeof t&&void 0===n?(i=this.get(e,t),void 0!==i?i:this.get(e,oe.camelCase(t))):(this.set(e,t,n),void 0!==n?n:t)},remove:function(e,t){var n,i,r,o=e[this.expando];if(void 0!==o){if(void 0===t)this.register(e);else{oe.isArray(t)?i=t.concat(t.map(oe.camelCase)):(r=oe.camelCase(t),t in o?i=[t,r]:(i=r,i=i in o?[i]:i.match(we)||[])),n=i.length;for(;n--;)delete o[i[n]]}(void 0===t||oe.isEmptyObject(o))&&(e.nodeType?e[this.expando]=void 0:delete e[this.expando])}},hasData:function(e){var t=e[this.expando];return void 0!==t&&!oe.isEmptyObject(t)}};var Se=new a,Te=new a,De=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,Me=/[A-Z]/g;oe.extend({hasData:function(e){return Te.hasData(e)||Se.hasData(e)},data:function(e,t,n){return Te.access(e,t,n)},removeData:function(e,t){Te.remove(e,t)},_data:function(e,t,n){return Se.access(e,t,n)},_removeData:function(e,t){Se.remove(e,t)}}),oe.fn.extend({data:function(e,t){var n,i,r,o=this[0],s=o&&o.attributes;if(void 0===e){if(this.length&&(r=Te.get(o),1===o.nodeType&&!Se.get(o,"hasDataAttrs"))){for(n=s.length;n--;)s[n]&&(i=s[n].name,0===i.indexOf("data-")&&(i=oe.camelCase(i.slice(5)),l(o,i,r[i])));Se.set(o,"hasDataAttrs",!0)}return r}return"object"==typeof e?this.each(function(){Te.set(this,e)}):ke(this,function(t){var n,i;if(o&&void 0===t){if(n=Te.get(o,e)||Te.get(o,e.replace(Me,"-$&").toLowerCase()),void 0!==n)return n;if(i=oe.camelCase(e),n=Te.get(o,i),void 0!==n)return n;if(n=l(o,i,void 0),void 0!==n)return n}else i=oe.camelCase(e),this.each(function(){var n=Te.get(this,i);Te.set(this,i,t),e.indexOf("-")>-1&&void 0!==n&&Te.set(this,e,t)})},null,t,arguments.length>1,null,!0)},removeData:function(e){return this.each(function(){Te.remove(this,e)})}}),oe.extend({queue:function(e,t,n){var i;return e?(t=(t||"fx")+"queue",i=Se.get(e,t),n&&(!i||oe.isArray(n)?i=Se.access(e,t,oe.makeArray(n)):i.push(n)),i||[]):void 0},dequeue:function(e,t){t=t||"fx";var n=oe.queue(e,t),i=n.length,r=n.shift(),o=oe._queueHooks(e,t),s=function(){oe.dequeue(e,t)};"inprogress"===r&&(r=n.shift(),i--),r&&("fx"===t&&n.unshift("inprogress"),delete o.stop,r.call(e,s,o)),!i&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return Se.get(e,n)||Se.access(e,n,{empty:oe.Callbacks("once memory").add(function(){Se.remove(e,[t+"queue",n])})})}}),oe.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&&(t=e,e="fx",n--),arguments.length<n?oe.queue(this[0],e):void 0===t?this:this.each(function(){var n=oe.queue(this,e,t);oe._queueHooks(this,e),"fx"===e&&"inprogress"!==n[0]&&oe.dequeue(this,e)})},dequeue:function(e){return this.each(function(){oe.dequeue(this,e)})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){var n,i=1,r=oe.Deferred(),o=this,s=this.length,a=function(){--i||r.resolveWith(o,[o])};for("string"!=typeof e&&(t=e,e=void 0),e=e||"fx";s--;)n=Se.get(o[s],e+"queueHooks"),n&&n.empty&&(i++,n.empty.add(a));return a(),r.promise(t)}});var Ee=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,Le=new RegExp("^(?:([+-])=|)("+Ee+")([a-z%]*)$","i"),Ae=["Top","Right","Bottom","Left"],$e=function(e,t){return e=t||e,"none"===oe.css(e,"display")||!oe.contains(e.ownerDocument,e)},Oe=/^(?:checkbox|radio)$/i,Ne=/<([\w:-]+)/,Ie=/^$|\/(?:java|ecma)script/i,Re={option:[1,"<select multiple='multiple'>","</select>"],thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};Re.optgroup=Re.option,Re.tbody=Re.tfoot=Re.colgroup=Re.caption=Re.thead,Re.th=Re.td;var Pe=/<|&#?\w+;/;!function(){var e=X.createDocumentFragment(),t=e.appendChild(X.createElement("div")),n=X.createElement("input");n.setAttribute("type","radio"),n.setAttribute("checked","checked"),n.setAttribute("name","t"),t.appendChild(n),ie.checkClone=t.cloneNode(!0).cloneNode(!0).lastChild.checked,t.innerHTML="<textarea>x</textarea>",ie.noCloneChecked=!!t.cloneNode(!0).lastChild.defaultValue}();var He=/^key/,Be=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,je=/^([^.]*)(?:\.(.+)|)/;oe.event={global:{},add:function(e,t,n,i,r){var o,s,a,l,c,u,d,h,f,p,m,g=Se.get(e);if(g)for(n.handler&&(o=n,n=o.handler,r=o.selector),n.guid||(n.guid=oe.guid++),(l=g.events)||(l=g.events={}),(s=g.handle)||(s=g.handle=function(t){return"undefined"!=typeof oe&&oe.event.triggered!==t.type?oe.event.dispatch.apply(e,arguments):void 0}),t=(t||"").match(we)||[""],c=t.length;c--;)a=je.exec(t[c])||[],f=m=a[1],p=(a[2]||"").split(".").sort(),f&&(d=oe.event.special[f]||{},f=(r?d.delegateType:d.bindType)||f,d=oe.event.special[f]||{},u=oe.extend({type:f,origType:m,data:i,handler:n,guid:n.guid,selector:r,needsContext:r&&oe.expr.match.needsContext.test(r),namespace:p.join(".")},o),(h=l[f])||(h=l[f]=[],h.delegateCount=0,d.setup&&d.setup.call(e,i,p,s)!==!1||e.addEventListener&&e.addEventListener(f,s)),d.add&&(d.add.call(e,u),u.handler.guid||(u.handler.guid=n.guid)),r?h.splice(h.delegateCount++,0,u):h.push(u),oe.event.global[f]=!0)},remove:function(e,t,n,i,r){var o,s,a,l,c,u,d,h,f,p,m,g=Se.hasData(e)&&Se.get(e);if(g&&(l=g.events)){for(t=(t||"").match(we)||[""],c=t.length;c--;)if(a=je.exec(t[c])||[],f=m=a[1],p=(a[2]||"").split(".").sort(),f){for(d=oe.event.special[f]||{},f=(i?d.delegateType:d.bindType)||f,h=l[f]||[],a=a[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),s=o=h.length;o--;)u=h[o],!r&&m!==u.origType||n&&n.guid!==u.guid||a&&!a.test(u.namespace)||i&&i!==u.selector&&("**"!==i||!u.selector)||(h.splice(o,1),u.selector&&h.delegateCount--,d.remove&&d.remove.call(e,u));s&&!h.length&&(d.teardown&&d.teardown.call(e,p,g.handle)!==!1||oe.removeEvent(e,f,g.handle),delete l[f])}else for(f in l)oe.event.remove(e,f+t[c],n,i,!0);oe.isEmptyObject(l)&&Se.remove(e,"handle events")}},dispatch:function(e){e=oe.event.fix(e);var t,n,i,r,o,s=[],a=Z.call(arguments),l=(Se.get(this,"events")||{})[e.type]||[],c=oe.event.special[e.type]||{};if(a[0]=e,e.delegateTarget=this,!c.preDispatch||c.preDispatch.call(this,e)!==!1){for(s=oe.event.handlers.call(this,e,l),t=0;(r=s[t++])&&!e.isPropagationStopped();)for(e.currentTarget=r.elem,n=0;(o=r.handlers[n++])&&!e.isImmediatePropagationStopped();)e.rnamespace&&!e.rnamespace.test(o.namespace)||(e.handleObj=o,e.data=o.data,i=((oe.event.special[o.origType]||{}).handle||o.handler).apply(r.elem,a),void 0!==i&&(e.result=i)===!1&&(e.preventDefault(),e.stopPropagation()));return c.postDispatch&&c.postDispatch.call(this,e),e.result}},handlers:function(e,t){var n,i,r,o,s=[],a=t.delegateCount,l=e.target;if(a&&l.nodeType&&("click"!==e.type||isNaN(e.button)||e.button<1))for(;l!==this;l=l.parentNode||this)if(1===l.nodeType&&(l.disabled!==!0||"click"!==e.type)){for(i=[],n=0;a>n;n++)o=t[n],r=o.selector+" ",void 0===i[r]&&(i[r]=o.needsContext?oe(r,this).index(l)>-1:oe.find(r,this,null,[l]).length),i[r]&&i.push(o);i.length&&s.push({elem:l,handlers:i})}return a<t.length&&s.push({elem:this,handlers:t.slice(a)}),s},props:"altKey bubbles cancelable ctrlKey currentTarget detail eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(e,t){return null==e.which&&(e.which=null!=t.charCode?t.charCode:t.keyCode),e}},mouseHooks:{props:"button buttons clientX clientY offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(e,t){var n,i,r,o=t.button;return null==e.pageX&&null!=t.clientX&&(n=e.target.ownerDocument||X,i=n.documentElement,r=n.body,e.pageX=t.clientX+(i&&i.scrollLeft||r&&r.scrollLeft||0)-(i&&i.clientLeft||r&&r.clientLeft||0),e.pageY=t.clientY+(i&&i.scrollTop||r&&r.scrollTop||0)-(i&&i.clientTop||r&&r.clientTop||0)),e.which||void 0===o||(e.which=1&o?1:2&o?3:4&o?2:0),e}},fix:function(e){if(e[oe.expando])return e;var t,n,i,r=e.type,o=e,s=this.fixHooks[r];for(s||(this.fixHooks[r]=s=Be.test(r)?this.mouseHooks:He.test(r)?this.keyHooks:{}),i=s.props?this.props.concat(s.props):this.props,e=new oe.Event(o),t=i.length;t--;)n=i[t],e[n]=o[n];return e.target||(e.target=X),3===e.target.nodeType&&(e.target=e.target.parentNode),s.filter?s.filter(e,o):e},special:{load:{noBubble:!0},focus:{trigger:function(){return this!==m()&&this.focus?(this.focus(),!1):void 0},delegateType:"focusin"},blur:{trigger:function(){return this===m()&&this.blur?(this.blur(),!1):void 0},delegateType:"focusout"},click:{trigger:function(){return"checkbox"===this.type&&this.click&&oe.nodeName(this,"input")?(this.click(),!1):void 0},_default:function(e){return oe.nodeName(e.target,"a")}},beforeunload:{postDispatch:function(e){void 0!==e.result&&e.originalEvent&&(e.originalEvent.returnValue=e.result)}}}},oe.removeEvent=function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n)},oe.Event=function(e,t){return this instanceof oe.Event?(e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||void 0===e.defaultPrevented&&e.returnValue===!1?f:p):this.type=e,t&&oe.extend(this,t),this.timeStamp=e&&e.timeStamp||oe.now(),void(this[oe.expando]=!0)):new oe.Event(e,t)},oe.Event.prototype={constructor:oe.Event,isDefaultPrevented:p,isPropagationStopped:p,isImmediatePropagationStopped:p,isSimulated:!1,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=f,e&&!this.isSimulated&&e.preventDefault()},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=f,e&&!this.isSimulated&&e.stopPropagation()},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=f,e&&!this.isSimulated&&e.stopImmediatePropagation(),this.stopPropagation()}},oe.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(e,t){oe.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,i=this,r=e.relatedTarget,o=e.handleObj;return r&&(r===i||oe.contains(i,r))||(e.type=o.origType,n=o.handler.apply(this,arguments),e.type=t),n}}}),oe.fn.extend({on:function(e,t,n,i){return g(this,e,t,n,i)},one:function(e,t,n,i){return g(this,e,t,n,i,1)},off:function(e,t,n){var i,r;if(e&&e.preventDefault&&e.handleObj)return i=e.handleObj,oe(e.delegateTarget).off(i.namespace?i.origType+"."+i.namespace:i.origType,i.selector,i.handler),this;if("object"==typeof e){for(r in e)this.off(r,t,e[r]);return this}return t!==!1&&"function"!=typeof t||(n=t,t=void 0),n===!1&&(n=p),this.each(function(){oe.event.remove(this,e,n,t)})}});var Fe=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:-]+)[^>]*)\/>/gi,We=/<script|<style|<link/i,qe=/checked\s*(?:[^=]|=\s*.checked.)/i,ze=/^true\/(.*)/,Ye=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;oe.extend({htmlPrefilter:function(e){return e.replace(Fe,"<$1></$2>")},clone:function(e,t,n){var i,r,o,s,a=e.cloneNode(!0),l=oe.contains(e.ownerDocument,e);if(!(ie.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||oe.isXMLDoc(e)))for(s=u(a),o=u(e),i=0,r=o.length;r>i;i++)w(o[i],s[i]);if(t)if(n)for(o=o||u(e),s=s||u(a),i=0,r=o.length;r>i;i++)x(o[i],s[i]);else x(e,a);return s=u(a,"script"),s.length>0&&d(s,!l&&u(e,"script")),a},cleanData:function(e){for(var t,n,i,r=oe.event.special,o=0;void 0!==(n=e[o]);o++)if(_e(n)){if(t=n[Se.expando]){if(t.events)for(i in t.events)r[i]?oe.event.remove(n,i):oe.removeEvent(n,i,t.handle);n[Se.expando]=void 0}n[Te.expando]&&(n[Te.expando]=void 0)}}}),oe.fn.extend({domManip:C,detach:function(e){return k(this,e,!0)},remove:function(e){return k(this,e)},text:function(e){return ke(this,function(e){return void 0===e?oe.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)})},null,e,arguments.length)},append:function(){return C(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=v(this,e);t.appendChild(e)}})},prepend:function(){return C(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=v(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return C(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return C(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(oe.cleanData(u(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map(function(){return oe.clone(this,e,t)})},html:function(e){return ke(this,function(e){var t=this[0]||{},n=0,i=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!We.test(e)&&!Re[(Ne.exec(e)||["",""])[1].toLowerCase()]){e=oe.htmlPrefilter(e);try{for(;i>n;n++)t=this[n]||{},1===t.nodeType&&(oe.cleanData(u(t,!1)),t.innerHTML=e);t=0}catch(r){}}t&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var e=[];return C(this,arguments,function(t){var n=this.parentNode;oe.inArray(this,e)<0&&(oe.cleanData(u(this)),n&&n.replaceChild(t,this))},e)}}),oe.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){oe.fn[e]=function(e){for(var n,i=[],r=oe(e),o=r.length-1,s=0;o>=s;s++)n=s===o?this:this.clone(!0),oe(r[s])[t](n),Q.apply(i,n.get());return this.pushStack(i)}});var Ue,Ve={HTML:"block",BODY:"block"},Ge=/^margin/,Xe=new RegExp("^("+Ee+")(?!px)[a-z%]+$","i"),Ze=function(t){var n=t.ownerDocument.defaultView;return n&&n.opener||(n=e),n.getComputedStyle(t)},Ke=function(e,t,n,i){var r,o,s={};for(o in t)s[o]=e.style[o],e.style[o]=t[o];r=n.apply(e,i||[]);for(o in t)e.style[o]=s[o];return r},Qe=X.documentElement;!function(){function t(){a.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;position:relative;display:block;margin:auto;border:1px;padding:1px;top:1%;width:50%",a.innerHTML="",Qe.appendChild(s);var t=e.getComputedStyle(a);n="1%"!==t.top,o="2px"===t.marginLeft,i="4px"===t.width,a.style.marginRight="50%",r="4px"===t.marginRight,Qe.removeChild(s)}var n,i,r,o,s=X.createElement("div"),a=X.createElement("div");a.style&&(a.style.backgroundClip="content-box",a.cloneNode(!0).style.backgroundClip="",ie.clearCloneStyle="content-box"===a.style.backgroundClip,s.style.cssText="border:0;width:8px;height:0;top:0;left:-9999px;padding:0;margin-top:1px;position:absolute",s.appendChild(a),oe.extend(ie,{pixelPosition:function(){return t(),n},boxSizingReliable:function(){return null==i&&t(),i},pixelMarginRight:function(){return null==i&&t(),r},reliableMarginLeft:function(){return null==i&&t(),o},reliableMarginRight:function(){var t,n=a.appendChild(X.createElement("div"));return n.style.cssText=a.style.cssText="-webkit-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0",n.style.marginRight=n.style.width="0",a.style.width="1px",Qe.appendChild(s),t=!parseFloat(e.getComputedStyle(n).marginRight),Qe.removeChild(s),a.removeChild(n),t}}))}();var Je=/^(none|table(?!-c[ea]).+)/,et={position:"absolute",visibility:"hidden",display:"block"},tt={letterSpacing:"0",fontWeight:"400"},nt=["Webkit","O","Moz","ms"],it=X.createElement("div").style;oe.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=T(e,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":"cssFloat"},style:function(e,t,n,i){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var r,o,s,a=oe.camelCase(t),l=e.style;return t=oe.cssProps[a]||(oe.cssProps[a]=M(a)||a),s=oe.cssHooks[t]||oe.cssHooks[a],void 0===n?s&&"get"in s&&void 0!==(r=s.get(e,!1,i))?r:l[t]:(o=typeof n,"string"===o&&(r=Le.exec(n))&&r[1]&&(n=c(e,t,r),o="number"),void(null!=n&&n===n&&("number"===o&&(n+=r&&r[3]||(oe.cssNumber[a]?"":"px")),ie.clearCloneStyle||""!==n||0!==t.indexOf("background")||(l[t]="inherit"),s&&"set"in s&&void 0===(n=s.set(e,n,i))||(l[t]=n))))}},css:function(e,t,n,i){var r,o,s,a=oe.camelCase(t);return t=oe.cssProps[a]||(oe.cssProps[a]=M(a)||a),s=oe.cssHooks[t]||oe.cssHooks[a],s&&"get"in s&&(r=s.get(e,!0,n)),void 0===r&&(r=T(e,t,i)),"normal"===r&&t in tt&&(r=tt[t]),""===n||n?(o=parseFloat(r),n===!0||isFinite(o)?o||0:r):r}}),oe.each(["height","width"],function(e,t){oe.cssHooks[t]={get:function(e,n,i){return n?Je.test(oe.css(e,"display"))&&0===e.offsetWidth?Ke(e,et,function(){return A(e,t,i)}):A(e,t,i):void 0},set:function(e,n,i){var r,o=i&&Ze(e),s=i&&L(e,t,i,"border-box"===oe.css(e,"boxSizing",!1,o),o);return s&&(r=Le.exec(n))&&"px"!==(r[3]||"px")&&(e.style[t]=n,n=oe.css(e,t)),E(e,n,s)}}}),oe.cssHooks.marginLeft=D(ie.reliableMarginLeft,function(e,t){return t?(parseFloat(T(e,"marginLeft"))||e.getBoundingClientRect().left-Ke(e,{marginLeft:0},function(){return e.getBoundingClientRect().left}))+"px":void 0}),oe.cssHooks.marginRight=D(ie.reliableMarginRight,function(e,t){return t?Ke(e,{display:"inline-block"},T,[e,"marginRight"]):void 0}),oe.each({margin:"",padding:"",border:"Width"},function(e,t){oe.cssHooks[e+t]={expand:function(n){for(var i=0,r={},o="string"==typeof n?n.split(" "):[n];4>i;i++)r[e+Ae[i]+t]=o[i]||o[i-2]||o[0];return r}},Ge.test(e)||(oe.cssHooks[e+t].set=E)}),oe.fn.extend({css:function(e,t){return ke(this,function(e,t,n){var i,r,o={},s=0;if(oe.isArray(t)){for(i=Ze(e),r=t.length;r>s;s++)o[t[s]]=oe.css(e,t[s],!1,i);return o}return void 0!==n?oe.style(e,t,n):oe.css(e,t)},e,t,arguments.length>1)},show:function(){return $(this,!0);
  },hide:function(){return $(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){$e(this)?oe(this).show():oe(this).hide()})}}),oe.Tween=O,O.prototype={constructor:O,init:function(e,t,n,i,r,o){this.elem=e,this.prop=n,this.easing=r||oe.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=i,this.unit=o||(oe.cssNumber[n]?"":"px")},cur:function(){var e=O.propHooks[this.prop];return e&&e.get?e.get(this):O.propHooks._default.get(this)},run:function(e){var t,n=O.propHooks[this.prop];return this.options.duration?this.pos=t=oe.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):O.propHooks._default.set(this),this}},O.prototype.init.prototype=O.prototype,O.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=oe.css(e.elem,e.prop,""),t&&"auto"!==t?t:0)},set:function(e){oe.fx.step[e.prop]?oe.fx.step[e.prop](e):1!==e.elem.nodeType||null==e.elem.style[oe.cssProps[e.prop]]&&!oe.cssHooks[e.prop]?e.elem[e.prop]=e.now:oe.style(e.elem,e.prop,e.now+e.unit)}}},O.propHooks.scrollTop=O.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},oe.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},oe.fx=O.prototype.init,oe.fx.step={};var rt,ot,st=/^(?:toggle|show|hide)$/,at=/queueHooks$/;oe.Animation=oe.extend(B,{tweeners:{"*":[function(e,t){var n=this.createTween(e,t);return c(n.elem,e,Le.exec(t),n),n}]},tweener:function(e,t){oe.isFunction(e)?(t=e,e=["*"]):e=e.match(we);for(var n,i=0,r=e.length;r>i;i++)n=e[i],B.tweeners[n]=B.tweeners[n]||[],B.tweeners[n].unshift(t)},prefilters:[P],prefilter:function(e,t){t?B.prefilters.unshift(e):B.prefilters.push(e)}}),oe.speed=function(e,t,n){var i=e&&"object"==typeof e?oe.extend({},e):{complete:n||!n&&t||oe.isFunction(e)&&e,duration:e,easing:n&&t||t&&!oe.isFunction(t)&&t};return i.duration=oe.fx.off?0:"number"==typeof i.duration?i.duration:i.duration in oe.fx.speeds?oe.fx.speeds[i.duration]:oe.fx.speeds._default,null!=i.queue&&i.queue!==!0||(i.queue="fx"),i.old=i.complete,i.complete=function(){oe.isFunction(i.old)&&i.old.call(this),i.queue&&oe.dequeue(this,i.queue)},i},oe.fn.extend({fadeTo:function(e,t,n,i){return this.filter($e).css("opacity",0).show().end().animate({opacity:t},e,n,i)},animate:function(e,t,n,i){var r=oe.isEmptyObject(e),o=oe.speed(t,n,i),s=function(){var t=B(this,oe.extend({},e),o);(r||Se.get(this,"finish"))&&t.stop(!0)};return s.finish=s,r||o.queue===!1?this.each(s):this.queue(o.queue,s)},stop:function(e,t,n){var i=function(e){var t=e.stop;delete e.stop,t(n)};return"string"!=typeof e&&(n=t,t=e,e=void 0),t&&e!==!1&&this.queue(e||"fx",[]),this.each(function(){var t=!0,r=null!=e&&e+"queueHooks",o=oe.timers,s=Se.get(this);if(r)s[r]&&s[r].stop&&i(s[r]);else for(r in s)s[r]&&s[r].stop&&at.test(r)&&i(s[r]);for(r=o.length;r--;)o[r].elem!==this||null!=e&&o[r].queue!==e||(o[r].anim.stop(n),t=!1,o.splice(r,1));!t&&n||oe.dequeue(this,e)})},finish:function(e){return e!==!1&&(e=e||"fx"),this.each(function(){var t,n=Se.get(this),i=n[e+"queue"],r=n[e+"queueHooks"],o=oe.timers,s=i?i.length:0;for(n.finish=!0,oe.queue(this,e,[]),r&&r.stop&&r.stop.call(this,!0),t=o.length;t--;)o[t].elem===this&&o[t].queue===e&&(o[t].anim.stop(!0),o.splice(t,1));for(t=0;s>t;t++)i[t]&&i[t].finish&&i[t].finish.call(this);delete n.finish})}}),oe.each(["toggle","show","hide"],function(e,t){var n=oe.fn[t];oe.fn[t]=function(e,i,r){return null==e||"boolean"==typeof e?n.apply(this,arguments):this.animate(I(t,!0),e,i,r)}}),oe.each({slideDown:I("show"),slideUp:I("hide"),slideToggle:I("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){oe.fn[e]=function(e,n,i){return this.animate(t,e,n,i)}}),oe.timers=[],oe.fx.tick=function(){var e,t=0,n=oe.timers;for(rt=oe.now();t<n.length;t++)e=n[t],e()||n[t]!==e||n.splice(t--,1);n.length||oe.fx.stop(),rt=void 0},oe.fx.timer=function(e){oe.timers.push(e),e()?oe.fx.start():oe.timers.pop()},oe.fx.interval=13,oe.fx.start=function(){ot||(ot=e.setInterval(oe.fx.tick,oe.fx.interval))},oe.fx.stop=function(){e.clearInterval(ot),ot=null},oe.fx.speeds={slow:600,fast:200,_default:400},oe.fn.delay=function(t,n){return t=oe.fx?oe.fx.speeds[t]||t:t,n=n||"fx",this.queue(n,function(n,i){var r=e.setTimeout(n,t);i.stop=function(){e.clearTimeout(r)}})},function(){var e=X.createElement("input"),t=X.createElement("select"),n=t.appendChild(X.createElement("option"));e.type="checkbox",ie.checkOn=""!==e.value,ie.optSelected=n.selected,t.disabled=!0,ie.optDisabled=!n.disabled,e=X.createElement("input"),e.value="t",e.type="radio",ie.radioValue="t"===e.value}();var lt,ct=oe.expr.attrHandle;oe.fn.extend({attr:function(e,t){return ke(this,oe.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){oe.removeAttr(this,e)})}}),oe.extend({attr:function(e,t,n){var i,r,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return"undefined"==typeof e.getAttribute?oe.prop(e,t,n):(1===o&&oe.isXMLDoc(e)||(t=t.toLowerCase(),r=oe.attrHooks[t]||(oe.expr.match.bool.test(t)?lt:void 0)),void 0!==n?null===n?void oe.removeAttr(e,t):r&&"set"in r&&void 0!==(i=r.set(e,n,t))?i:(e.setAttribute(t,n+""),n):r&&"get"in r&&null!==(i=r.get(e,t))?i:(i=oe.find.attr(e,t),null==i?void 0:i))},attrHooks:{type:{set:function(e,t){if(!ie.radioValue&&"radio"===t&&oe.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,i,r=0,o=t&&t.match(we);if(o&&1===e.nodeType)for(;n=o[r++];)i=oe.propFix[n]||n,oe.expr.match.bool.test(n)&&(e[i]=!1),e.removeAttribute(n)}}),lt={set:function(e,t,n){return t===!1?oe.removeAttr(e,n):e.setAttribute(n,n),n}},oe.each(oe.expr.match.bool.source.match(/\w+/g),function(e,t){var n=ct[t]||oe.find.attr;ct[t]=function(e,t,i){var r,o;return i||(o=ct[t],ct[t]=r,r=null!=n(e,t,i)?t.toLowerCase():null,ct[t]=o),r}});var ut=/^(?:input|select|textarea|button)$/i,dt=/^(?:a|area)$/i;oe.fn.extend({prop:function(e,t){return ke(this,oe.prop,e,t,arguments.length>1)},removeProp:function(e){return this.each(function(){delete this[oe.propFix[e]||e]})}}),oe.extend({prop:function(e,t,n){var i,r,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&oe.isXMLDoc(e)||(t=oe.propFix[t]||t,r=oe.propHooks[t]),void 0!==n?r&&"set"in r&&void 0!==(i=r.set(e,n,t))?i:e[t]=n:r&&"get"in r&&null!==(i=r.get(e,t))?i:e[t]},propHooks:{tabIndex:{get:function(e){var t=oe.find.attr(e,"tabindex");return t?parseInt(t,10):ut.test(e.nodeName)||dt.test(e.nodeName)&&e.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),ie.optSelected||(oe.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),oe.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){oe.propFix[this.toLowerCase()]=this});var ht=/[\t\r\n\f]/g;oe.fn.extend({addClass:function(e){var t,n,i,r,o,s,a,l=0;if(oe.isFunction(e))return this.each(function(t){oe(this).addClass(e.call(this,t,j(this)))});if("string"==typeof e&&e)for(t=e.match(we)||[];n=this[l++];)if(r=j(n),i=1===n.nodeType&&(" "+r+" ").replace(ht," ")){for(s=0;o=t[s++];)i.indexOf(" "+o+" ")<0&&(i+=o+" ");a=oe.trim(i),r!==a&&n.setAttribute("class",a)}return this},removeClass:function(e){var t,n,i,r,o,s,a,l=0;if(oe.isFunction(e))return this.each(function(t){oe(this).removeClass(e.call(this,t,j(this)))});if(!arguments.length)return this.attr("class","");if("string"==typeof e&&e)for(t=e.match(we)||[];n=this[l++];)if(r=j(n),i=1===n.nodeType&&(" "+r+" ").replace(ht," ")){for(s=0;o=t[s++];)for(;i.indexOf(" "+o+" ")>-1;)i=i.replace(" "+o+" "," ");a=oe.trim(i),r!==a&&n.setAttribute("class",a)}return this},toggleClass:function(e,t){var n=typeof e;return"boolean"==typeof t&&"string"===n?t?this.addClass(e):this.removeClass(e):oe.isFunction(e)?this.each(function(n){oe(this).toggleClass(e.call(this,n,j(this),t),t)}):this.each(function(){var t,i,r,o;if("string"===n)for(i=0,r=oe(this),o=e.match(we)||[];t=o[i++];)r.hasClass(t)?r.removeClass(t):r.addClass(t);else void 0!==e&&"boolean"!==n||(t=j(this),t&&Se.set(this,"__className__",t),this.setAttribute&&this.setAttribute("class",t||e===!1?"":Se.get(this,"__className__")||""))})},hasClass:function(e){var t,n,i=0;for(t=" "+e+" ";n=this[i++];)if(1===n.nodeType&&(" "+j(n)+" ").replace(ht," ").indexOf(t)>-1)return!0;return!1}});var ft=/\r/g,pt=/[\x20\t\r\n\f]+/g;oe.fn.extend({val:function(e){var t,n,i,r=this[0];return arguments.length?(i=oe.isFunction(e),this.each(function(n){var r;1===this.nodeType&&(r=i?e.call(this,n,oe(this).val()):e,null==r?r="":"number"==typeof r?r+="":oe.isArray(r)&&(r=oe.map(r,function(e){return null==e?"":e+""})),t=oe.valHooks[this.type]||oe.valHooks[this.nodeName.toLowerCase()],t&&"set"in t&&void 0!==t.set(this,r,"value")||(this.value=r))})):r?(t=oe.valHooks[r.type]||oe.valHooks[r.nodeName.toLowerCase()],t&&"get"in t&&void 0!==(n=t.get(r,"value"))?n:(n=r.value,"string"==typeof n?n.replace(ft,""):null==n?"":n)):void 0}}),oe.extend({valHooks:{option:{get:function(e){var t=oe.find.attr(e,"value");return null!=t?t:oe.trim(oe.text(e)).replace(pt," ")}},select:{get:function(e){for(var t,n,i=e.options,r=e.selectedIndex,o="select-one"===e.type||0>r,s=o?null:[],a=o?r+1:i.length,l=0>r?a:o?r:0;a>l;l++)if(n=i[l],(n.selected||l===r)&&(ie.optDisabled?!n.disabled:null===n.getAttribute("disabled"))&&(!n.parentNode.disabled||!oe.nodeName(n.parentNode,"optgroup"))){if(t=oe(n).val(),o)return t;s.push(t)}return s},set:function(e,t){for(var n,i,r=e.options,o=oe.makeArray(t),s=r.length;s--;)i=r[s],(i.selected=oe.inArray(oe.valHooks.option.get(i),o)>-1)&&(n=!0);return n||(e.selectedIndex=-1),o}}}}),oe.each(["radio","checkbox"],function(){oe.valHooks[this]={set:function(e,t){return oe.isArray(t)?e.checked=oe.inArray(oe(e).val(),t)>-1:void 0}},ie.checkOn||(oe.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})});var mt=/^(?:focusinfocus|focusoutblur)$/;oe.extend(oe.event,{trigger:function(t,n,i,r){var o,s,a,l,c,u,d,h=[i||X],f=ne.call(t,"type")?t.type:t,p=ne.call(t,"namespace")?t.namespace.split("."):[];if(s=a=i=i||X,3!==i.nodeType&&8!==i.nodeType&&!mt.test(f+oe.event.triggered)&&(f.indexOf(".")>-1&&(p=f.split("."),f=p.shift(),p.sort()),c=f.indexOf(":")<0&&"on"+f,t=t[oe.expando]?t:new oe.Event(f,"object"==typeof t&&t),t.isTrigger=r?2:3,t.namespace=p.join("."),t.rnamespace=t.namespace?new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=i),n=null==n?[t]:oe.makeArray(n,[t]),d=oe.event.special[f]||{},r||!d.trigger||d.trigger.apply(i,n)!==!1)){if(!r&&!d.noBubble&&!oe.isWindow(i)){for(l=d.delegateType||f,mt.test(l+f)||(s=s.parentNode);s;s=s.parentNode)h.push(s),a=s;a===(i.ownerDocument||X)&&h.push(a.defaultView||a.parentWindow||e)}for(o=0;(s=h[o++])&&!t.isPropagationStopped();)t.type=o>1?l:d.bindType||f,u=(Se.get(s,"events")||{})[t.type]&&Se.get(s,"handle"),u&&u.apply(s,n),u=c&&s[c],u&&u.apply&&_e(s)&&(t.result=u.apply(s,n),t.result===!1&&t.preventDefault());return t.type=f,r||t.isDefaultPrevented()||d._default&&d._default.apply(h.pop(),n)!==!1||!_e(i)||c&&oe.isFunction(i[f])&&!oe.isWindow(i)&&(a=i[c],a&&(i[c]=null),oe.event.triggered=f,i[f](),oe.event.triggered=void 0,a&&(i[c]=a)),t.result}},simulate:function(e,t,n){var i=oe.extend(new oe.Event,n,{type:e,isSimulated:!0});oe.event.trigger(i,null,t)}}),oe.fn.extend({trigger:function(e,t){return this.each(function(){oe.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];return n?oe.event.trigger(e,t,n,!0):void 0}}),oe.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(e,t){oe.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}}),oe.fn.extend({hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),ie.focusin="onfocusin"in e,ie.focusin||oe.each({focus:"focusin",blur:"focusout"},function(e,t){var n=function(e){oe.event.simulate(t,e.target,oe.event.fix(e))};oe.event.special[t]={setup:function(){var i=this.ownerDocument||this,r=Se.access(i,t);r||i.addEventListener(e,n,!0),Se.access(i,t,(r||0)+1)},teardown:function(){var i=this.ownerDocument||this,r=Se.access(i,t)-1;r?Se.access(i,t,r):(i.removeEventListener(e,n,!0),Se.remove(i,t))}}});var gt=e.location,vt=oe.now(),yt=/\?/;oe.parseJSON=function(e){return JSON.parse(e+"")},oe.parseXML=function(t){var n;if(!t||"string"!=typeof t)return null;try{n=(new e.DOMParser).parseFromString(t,"text/xml")}catch(i){n=void 0}return n&&!n.getElementsByTagName("parsererror").length||oe.error("Invalid XML: "+t),n};var bt=/#.*$/,xt=/([?&])_=[^&]*/,wt=/^(.*?):[ \t]*([^\r\n]*)$/gm,Ct=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,kt=/^(?:GET|HEAD)$/,_t=/^\/\//,St={},Tt={},Dt="*/".concat("*"),Mt=X.createElement("a");Mt.href=gt.href,oe.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:gt.href,type:"GET",isLocal:Ct.test(gt.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Dt,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":oe.parseJSON,"text xml":oe.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?q(q(e,oe.ajaxSettings),t):q(oe.ajaxSettings,e)},ajaxPrefilter:F(St),ajaxTransport:F(Tt),ajax:function(t,n){function i(t,n,i,a){var c,d,y,b,w,k=n;2!==x&&(x=2,l&&e.clearTimeout(l),r=void 0,s=a||"",C.readyState=t>0?4:0,c=t>=200&&300>t||304===t,i&&(b=z(h,C,i)),b=Y(h,b,C,c),c?(h.ifModified&&(w=C.getResponseHeader("Last-Modified"),w&&(oe.lastModified[o]=w),w=C.getResponseHeader("etag"),w&&(oe.etag[o]=w)),204===t||"HEAD"===h.type?k="nocontent":304===t?k="notmodified":(k=b.state,d=b.data,y=b.error,c=!y)):(y=k,!t&&k||(k="error",0>t&&(t=0))),C.status=t,C.statusText=(n||k)+"",c?m.resolveWith(f,[d,k,C]):m.rejectWith(f,[C,k,y]),C.statusCode(v),v=void 0,u&&p.trigger(c?"ajaxSuccess":"ajaxError",[C,h,c?d:y]),g.fireWith(f,[C,k]),u&&(p.trigger("ajaxComplete",[C,h]),--oe.active||oe.event.trigger("ajaxStop")))}"object"==typeof t&&(n=t,t=void 0),n=n||{};var r,o,s,a,l,c,u,d,h=oe.ajaxSetup({},n),f=h.context||h,p=h.context&&(f.nodeType||f.jquery)?oe(f):oe.event,m=oe.Deferred(),g=oe.Callbacks("once memory"),v=h.statusCode||{},y={},b={},x=0,w="canceled",C={readyState:0,getResponseHeader:function(e){var t;if(2===x){if(!a)for(a={};t=wt.exec(s);)a[t[1].toLowerCase()]=t[2];t=a[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return 2===x?s:null},setRequestHeader:function(e,t){var n=e.toLowerCase();return x||(e=b[n]=b[n]||e,y[e]=t),this},overrideMimeType:function(e){return x||(h.mimeType=e),this},statusCode:function(e){var t;if(e)if(2>x)for(t in e)v[t]=[v[t],e[t]];else C.always(e[C.status]);return this},abort:function(e){var t=e||w;return r&&r.abort(t),i(0,t),this}};if(m.promise(C).complete=g.add,C.success=C.done,C.error=C.fail,h.url=((t||h.url||gt.href)+"").replace(bt,"").replace(_t,gt.protocol+"//"),h.type=n.method||n.type||h.method||h.type,h.dataTypes=oe.trim(h.dataType||"*").toLowerCase().match(we)||[""],null==h.crossDomain){c=X.createElement("a");try{c.href=h.url,c.href=c.href,h.crossDomain=Mt.protocol+"//"+Mt.host!=c.protocol+"//"+c.host}catch(k){h.crossDomain=!0}}if(h.data&&h.processData&&"string"!=typeof h.data&&(h.data=oe.param(h.data,h.traditional)),W(St,h,n,C),2===x)return C;u=oe.event&&h.global,u&&0===oe.active++&&oe.event.trigger("ajaxStart"),h.type=h.type.toUpperCase(),h.hasContent=!kt.test(h.type),o=h.url,h.hasContent||(h.data&&(o=h.url+=(yt.test(o)?"&":"?")+h.data,delete h.data),h.cache===!1&&(h.url=xt.test(o)?o.replace(xt,"$1_="+vt++):o+(yt.test(o)?"&":"?")+"_="+vt++)),h.ifModified&&(oe.lastModified[o]&&C.setRequestHeader("If-Modified-Since",oe.lastModified[o]),oe.etag[o]&&C.setRequestHeader("If-None-Match",oe.etag[o])),(h.data&&h.hasContent&&h.contentType!==!1||n.contentType)&&C.setRequestHeader("Content-Type",h.contentType),C.setRequestHeader("Accept",h.dataTypes[0]&&h.accepts[h.dataTypes[0]]?h.accepts[h.dataTypes[0]]+("*"!==h.dataTypes[0]?", "+Dt+"; q=0.01":""):h.accepts["*"]);for(d in h.headers)C.setRequestHeader(d,h.headers[d]);if(h.beforeSend&&(h.beforeSend.call(f,C,h)===!1||2===x))return C.abort();w="abort";for(d in{success:1,error:1,complete:1})C[d](h[d]);if(r=W(Tt,h,n,C)){if(C.readyState=1,u&&p.trigger("ajaxSend",[C,h]),2===x)return C;h.async&&h.timeout>0&&(l=e.setTimeout(function(){C.abort("timeout")},h.timeout));try{x=1,r.send(y,i)}catch(k){if(!(2>x))throw k;i(-1,k)}}else i(-1,"No Transport");return C},getJSON:function(e,t,n){return oe.get(e,t,n,"json")},getScript:function(e,t){return oe.get(e,void 0,t,"script")}}),oe.each(["get","post"],function(e,t){oe[t]=function(e,n,i,r){return oe.isFunction(n)&&(r=r||i,i=n,n=void 0),oe.ajax(oe.extend({url:e,type:t,dataType:r,data:n,success:i},oe.isPlainObject(e)&&e))}}),oe._evalUrl=function(e){return oe.ajax({url:e,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})},oe.fn.extend({wrapAll:function(e){var t;return oe.isFunction(e)?this.each(function(t){oe(this).wrapAll(e.call(this,t))}):(this[0]&&(t=oe(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){for(var e=this;e.firstElementChild;)e=e.firstElementChild;return e}).append(this)),this)},wrapInner:function(e){return oe.isFunction(e)?this.each(function(t){oe(this).wrapInner(e.call(this,t))}):this.each(function(){var t=oe(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=oe.isFunction(e);return this.each(function(n){oe(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){oe.nodeName(this,"body")||oe(this).replaceWith(this.childNodes)}).end()}}),oe.expr.filters.hidden=function(e){return!oe.expr.filters.visible(e)},oe.expr.filters.visible=function(e){return e.offsetWidth>0||e.offsetHeight>0||e.getClientRects().length>0};var Et=/%20/g,Lt=/\[\]$/,At=/\r?\n/g,$t=/^(?:submit|button|image|reset|file)$/i,Ot=/^(?:input|select|textarea|keygen)/i;oe.param=function(e,t){var n,i=[],r=function(e,t){t=oe.isFunction(t)?t():null==t?"":t,i[i.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};if(void 0===t&&(t=oe.ajaxSettings&&oe.ajaxSettings.traditional),oe.isArray(e)||e.jquery&&!oe.isPlainObject(e))oe.each(e,function(){r(this.name,this.value)});else for(n in e)U(n,e[n],t,r);return i.join("&").replace(Et,"+")},oe.fn.extend({serialize:function(){return oe.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=oe.prop(this,"elements");return e?oe.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!oe(this).is(":disabled")&&Ot.test(this.nodeName)&&!$t.test(e)&&(this.checked||!Oe.test(e))}).map(function(e,t){var n=oe(this).val();return null==n?null:oe.isArray(n)?oe.map(n,function(e){return{name:t.name,value:e.replace(At,"\r\n")}}):{name:t.name,value:n.replace(At,"\r\n")}}).get()}}),oe.ajaxSettings.xhr=function(){try{return new e.XMLHttpRequest}catch(t){}};var Nt={0:200,1223:204},It=oe.ajaxSettings.xhr();ie.cors=!!It&&"withCredentials"in It,ie.ajax=It=!!It,oe.ajaxTransport(function(t){var n,i;return ie.cors||It&&!t.crossDomain?{send:function(r,o){var s,a=t.xhr();if(a.open(t.type,t.url,t.async,t.username,t.password),t.xhrFields)for(s in t.xhrFields)a[s]=t.xhrFields[s];t.mimeType&&a.overrideMimeType&&a.overrideMimeType(t.mimeType),t.crossDomain||r["X-Requested-With"]||(r["X-Requested-With"]="XMLHttpRequest");for(s in r)a.setRequestHeader(s,r[s]);n=function(e){return function(){n&&(n=i=a.onload=a.onerror=a.onabort=a.onreadystatechange=null,"abort"===e?a.abort():"error"===e?"number"!=typeof a.status?o(0,"error"):o(a.status,a.statusText):o(Nt[a.status]||a.status,a.statusText,"text"!==(a.responseType||"text")||"string"!=typeof a.responseText?{binary:a.response}:{text:a.responseText},a.getAllResponseHeaders()))}},a.onload=n(),i=a.onerror=n("error"),void 0!==a.onabort?a.onabort=i:a.onreadystatechange=function(){4===a.readyState&&e.setTimeout(function(){n&&i()})},n=n("abort");try{a.send(t.hasContent&&t.data||null)}catch(l){if(n)throw l}},abort:function(){n&&n()}}:void 0}),oe.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return oe.globalEval(e),e}}}),oe.ajaxPrefilter("script",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")}),oe.ajaxTransport("script",function(e){if(e.crossDomain){var t,n;return{send:function(i,r){t=oe("<script>").prop({charset:e.scriptCharset,src:e.url}).on("load error",n=function(e){t.remove(),n=null,e&&r("error"===e.type?404:200,e.type)}),X.head.appendChild(t[0])},abort:function(){n&&n()}}}});var Rt=[],Pt=/(=)\?(?=&|$)|\?\?/;oe.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Rt.pop()||oe.expando+"_"+vt++;return this[e]=!0,e}}),oe.ajaxPrefilter("json jsonp",function(t,n,i){var r,o,s,a=t.jsonp!==!1&&(Pt.test(t.url)?"url":"string"==typeof t.data&&0===(t.contentType||"").indexOf("application/x-www-form-urlencoded")&&Pt.test(t.data)&&"data");return a||"jsonp"===t.dataTypes[0]?(r=t.jsonpCallback=oe.isFunction(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,a?t[a]=t[a].replace(Pt,"$1"+r):t.jsonp!==!1&&(t.url+=(yt.test(t.url)?"&":"?")+t.jsonp+"="+r),t.converters["script json"]=function(){return s||oe.error(r+" was not called"),s[0]},t.dataTypes[0]="json",o=e[r],e[r]=function(){s=arguments},i.always(function(){void 0===o?oe(e).removeProp(r):e[r]=o,t[r]&&(t.jsonpCallback=n.jsonpCallback,Rt.push(r)),s&&oe.isFunction(o)&&o(s[0]),s=o=void 0}),"script"):void 0}),oe.parseHTML=function(e,t,n){if(!e||"string"!=typeof e)return null;"boolean"==typeof t&&(n=t,t=!1),t=t||X;var i=pe.exec(e),r=!n&&[];return i?[t.createElement(i[1])]:(i=h([e],t,r),r&&r.length&&oe(r).remove(),oe.merge([],i.childNodes))};var Ht=oe.fn.load;oe.fn.load=function(e,t,n){if("string"!=typeof e&&Ht)return Ht.apply(this,arguments);var i,r,o,s=this,a=e.indexOf(" ");return a>-1&&(i=oe.trim(e.slice(a)),e=e.slice(0,a)),oe.isFunction(t)?(n=t,t=void 0):t&&"object"==typeof t&&(r="POST"),s.length>0&&oe.ajax({url:e,type:r||"GET",dataType:"html",data:t}).done(function(e){o=arguments,s.html(i?oe("<div>").append(oe.parseHTML(e)).find(i):e)}).always(n&&function(e,t){s.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},oe.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){oe.fn[t]=function(e){return this.on(t,e)}}),oe.expr.filters.animated=function(e){return oe.grep(oe.timers,function(t){return e===t.elem}).length},oe.offset={setOffset:function(e,t,n){var i,r,o,s,a,l,c,u=oe.css(e,"position"),d=oe(e),h={};"static"===u&&(e.style.position="relative"),a=d.offset(),o=oe.css(e,"top"),l=oe.css(e,"left"),c=("absolute"===u||"fixed"===u)&&(o+l).indexOf("auto")>-1,c?(i=d.position(),s=i.top,r=i.left):(s=parseFloat(o)||0,r=parseFloat(l)||0),oe.isFunction(t)&&(t=t.call(e,n,oe.extend({},a))),null!=t.top&&(h.top=t.top-a.top+s),null!=t.left&&(h.left=t.left-a.left+r),"using"in t?t.using.call(e,h):d.css(h)}},oe.fn.extend({offset:function(e){if(arguments.length)return void 0===e?this:this.each(function(t){oe.offset.setOffset(this,e,t)});var t,n,i=this[0],r={top:0,left:0},o=i&&i.ownerDocument;return o?(t=o.documentElement,oe.contains(t,i)?(r=i.getBoundingClientRect(),n=V(o),{top:r.top+n.pageYOffset-t.clientTop,left:r.left+n.pageXOffset-t.clientLeft}):r):void 0},position:function(){if(this[0]){var e,t,n=this[0],i={top:0,left:0};return"fixed"===oe.css(n,"position")?t=n.getBoundingClientRect():(e=this.offsetParent(),t=this.offset(),oe.nodeName(e[0],"html")||(i=e.offset()),i.top+=oe.css(e[0],"borderTopWidth",!0),i.left+=oe.css(e[0],"borderLeftWidth",!0)),{top:t.top-i.top-oe.css(n,"marginTop",!0),left:t.left-i.left-oe.css(n,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var e=this.offsetParent;e&&"static"===oe.css(e,"position");)e=e.offsetParent;return e||Qe})}}),oe.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,t){var n="pageYOffset"===t;oe.fn[e]=function(i){return ke(this,function(e,i,r){var o=V(e);return void 0===r?o?o[t]:e[i]:void(o?o.scrollTo(n?o.pageXOffset:r,n?r:o.pageYOffset):e[i]=r)},e,i,arguments.length)}}),oe.each(["top","left"],function(e,t){oe.cssHooks[t]=D(ie.pixelPosition,function(e,n){return n?(n=T(e,t),Xe.test(n)?oe(e).position()[t]+"px":n):void 0})}),oe.each({Height:"height",Width:"width"},function(e,t){oe.each({padding:"inner"+e,content:t,"":"outer"+e},function(n,i){oe.fn[i]=function(i,r){var o=arguments.length&&(n||"boolean"!=typeof i),s=n||(i===!0||r===!0?"margin":"border");return ke(this,function(t,n,i){var r;return oe.isWindow(t)?t.document.documentElement["client"+e]:9===t.nodeType?(r=t.documentElement,Math.max(t.body["scroll"+e],r["scroll"+e],t.body["offset"+e],r["offset"+e],r["client"+e])):void 0===i?oe.css(t,n,s):oe.style(t,n,i,s)},t,o?i:void 0,o,null)}})}),oe.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,i){return this.on(t,e,n,i)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},size:function(){return this.length}}),oe.fn.andSelf=oe.fn.addBack,"function"==typeof define&&define.amd&&define("jquery",[],function(){return oe});var Bt=e.jQuery,jt=e.$;return oe.noConflict=function(t){return e.$===oe&&(e.$=jt),t&&e.jQuery===oe&&(e.jQuery=Bt),oe},t||(e.jQuery=e.$=oe),oe}),"undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");+function(e){"use strict";var t=e.fn.jquery.split(" ")[0].split(".");if(t[0]<2&&t[1]<9||1==t[0]&&9==t[1]&&t[2]<1||t[0]>2)throw new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher, but lower than version 3")}(jQuery),+function(e){"use strict";function t(){var e=document.createElement("bootstrap"),t={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var n in t)if(void 0!==e.style[n])return{end:t[n]};return!1}e.fn.emulateTransitionEnd=function(t){var n=!1,i=this;e(this).one("bsTransitionEnd",function(){n=!0});var r=function(){n||e(i).trigger(e.support.transition.end)};return setTimeout(r,t),this},e(function(){e.support.transition=t(),e.support.transition&&(e.event.special.bsTransitionEnd={bindType:e.support.transition.end,delegateType:e.support.transition.end,handle:function(t){return e(t.target).is(this)?t.handleObj.handler.apply(this,arguments):void 0}})})}(jQuery),+function(e){"use strict";function t(t){return this.each(function(){var n=e(this),r=n.data("bs.alert");r||n.data("bs.alert",r=new i(this)),"string"==typeof t&&r[t].call(n)})}var n='[data-dismiss="alert"]',i=function(t){e(t).on("click",n,this.close)};i.VERSION="3.3.6",i.TRANSITION_DURATION=150,i.prototype.close=function(t){function n(){s.detach().trigger("closed.bs.alert").remove()}var r=e(this),o=r.attr("data-target");o||(o=r.attr("href"),o=o&&o.replace(/.*(?=#[^\s]*$)/,""));var s=e(o);t&&t.preventDefault(),s.length||(s=r.closest(".alert")),s.trigger(t=e.Event("close.bs.alert")),t.isDefaultPrevented()||(s.removeClass("in"),e.support.transition&&s.hasClass("fade")?s.one("bsTransitionEnd",n).emulateTransitionEnd(i.TRANSITION_DURATION):n())};var r=e.fn.alert;e.fn.alert=t,e.fn.alert.Constructor=i,e.fn.alert.noConflict=function(){return e.fn.alert=r,this},e(document).on("click.bs.alert.data-api",n,i.prototype.close)}(jQuery),+function(e){"use strict";function t(t){return this.each(function(){var i=e(this),r=i.data("bs.button"),o="object"==typeof t&&t;r||i.data("bs.button",r=new n(this,o)),"toggle"==t?r.toggle():t&&r.setState(t)})}var n=function(t,i){this.$element=e(t),this.options=e.extend({},n.DEFAULTS,i),this.isLoading=!1};n.VERSION="3.3.6",n.DEFAULTS={loadingText:"loading..."},n.prototype.setState=function(t){var n="disabled",i=this.$element,r=i.is("input")?"val":"html",o=i.data();t+="Text",null==o.resetText&&i.data("resetText",i[r]()),setTimeout(e.proxy(function(){i[r](null==o[t]?this.options[t]:o[t]),"loadingText"==t?(this.isLoading=!0,i.addClass(n).attr(n,n)):this.isLoading&&(this.isLoading=!1,i.removeClass(n).removeAttr(n))},this),0)},n.prototype.toggle=function(){var e=!0,t=this.$element.closest('[data-toggle="buttons"]');if(t.length){var n=this.$element.find("input");"radio"==n.prop("type")?(n.prop("checked")&&(e=!1),t.find(".active").removeClass("active"),this.$element.addClass("active")):"checkbox"==n.prop("type")&&(n.prop("checked")!==this.$element.hasClass("active")&&(e=!1),this.$element.toggleClass("active")),n.prop("checked",this.$element.hasClass("active")),e&&n.trigger("change")}else this.$element.attr("aria-pressed",!this.$element.hasClass("active")),this.$element.toggleClass("active")};var i=e.fn.button;e.fn.button=t,e.fn.button.Constructor=n,e.fn.button.noConflict=function(){return e.fn.button=i,this},e(document).on("click.bs.button.data-api",'[data-toggle^="button"]',function(n){var i=e(n.target);i.hasClass("btn")||(i=i.closest(".btn")),t.call(i,"toggle"),e(n.target).is('input[type="radio"]')||e(n.target).is('input[type="checkbox"]')||n.preventDefault()}).on("focus.bs.button.data-api blur.bs.button.data-api",'[data-toggle^="button"]',function(t){e(t.target).closest(".btn").toggleClass("focus",/^focus(in)?$/.test(t.type))})}(jQuery),+function(e){"use strict";function t(t){return this.each(function(){var i=e(this),r=i.data("bs.carousel"),o=e.extend({},n.DEFAULTS,i.data(),"object"==typeof t&&t),s="string"==typeof t?t:o.slide;r||i.data("bs.carousel",r=new n(this,o)),"number"==typeof t?r.to(t):s?r[s]():o.interval&&r.pause().cycle()})}var n=function(t,n){this.$element=e(t),this.$indicators=this.$element.find(".carousel-indicators"),this.options=n,this.paused=null,this.sliding=null,this.interval=null,this.$active=null,this.$items=null,this.options.keyboard&&this.$element.on("keydown.bs.carousel",e.proxy(this.keydown,this)),"hover"==this.options.pause&&!("ontouchstart"in document.documentElement)&&this.$element.on("mouseenter.bs.carousel",e.proxy(this.pause,this)).on("mouseleave.bs.carousel",e.proxy(this.cycle,this))};n.VERSION="3.3.6",n.TRANSITION_DURATION=600,n.DEFAULTS={interval:5e3,pause:"hover",wrap:!0,keyboard:!0},n.prototype.keydown=function(e){if(!/input|textarea/i.test(e.target.tagName)){switch(e.which){case 37:this.prev();break;case 39:this.next();break;default:return}e.preventDefault()}},n.prototype.cycle=function(t){return t||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(e.proxy(this.next,this),this.options.interval)),this},n.prototype.getItemIndex=function(e){return this.$items=e.parent().children(".item"),this.$items.index(e||this.$active)},n.prototype.getItemForDirection=function(e,t){var n=this.getItemIndex(t),i="prev"==e&&0===n||"next"==e&&n==this.$items.length-1;if(i&&!this.options.wrap)return t;var r="prev"==e?-1:1,o=(n+r)%this.$items.length;return this.$items.eq(o)},n.prototype.to=function(e){var t=this,n=this.getItemIndex(this.$active=this.$element.find(".item.active"));return e>this.$items.length-1||0>e?void 0:this.sliding?this.$element.one("slid.bs.carousel",function(){t.to(e)}):n==e?this.pause().cycle():this.slide(e>n?"next":"prev",this.$items.eq(e))},n.prototype.pause=function(t){
  return t||(this.paused=!0),this.$element.find(".next, .prev").length&&e.support.transition&&(this.$element.trigger(e.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},n.prototype.next=function(){return this.sliding?void 0:this.slide("next")},n.prototype.prev=function(){return this.sliding?void 0:this.slide("prev")},n.prototype.slide=function(t,i){var r=this.$element.find(".item.active"),o=i||this.getItemForDirection(t,r),s=this.interval,a="next"==t?"left":"right",l=this;if(o.hasClass("active"))return this.sliding=!1;var c=o[0],u=e.Event("slide.bs.carousel",{relatedTarget:c,direction:a});if(this.$element.trigger(u),!u.isDefaultPrevented()){if(this.sliding=!0,s&&this.pause(),this.$indicators.length){this.$indicators.find(".active").removeClass("active");var d=e(this.$indicators.children()[this.getItemIndex(o)]);d&&d.addClass("active")}var h=e.Event("slid.bs.carousel",{relatedTarget:c,direction:a});return e.support.transition&&this.$element.hasClass("slide")?(o.addClass(t),o[0].offsetWidth,r.addClass(a),o.addClass(a),r.one("bsTransitionEnd",function(){o.removeClass([t,a].join(" ")).addClass("active"),r.removeClass(["active",a].join(" ")),l.sliding=!1,setTimeout(function(){l.$element.trigger(h)},0)}).emulateTransitionEnd(n.TRANSITION_DURATION)):(r.removeClass("active"),o.addClass("active"),this.sliding=!1,this.$element.trigger(h)),s&&this.cycle(),this}};var i=e.fn.carousel;e.fn.carousel=t,e.fn.carousel.Constructor=n,e.fn.carousel.noConflict=function(){return e.fn.carousel=i,this};var r=function(n){var i,r=e(this),o=e(r.attr("data-target")||(i=r.attr("href"))&&i.replace(/.*(?=#[^\s]+$)/,""));if(o.hasClass("carousel")){var s=e.extend({},o.data(),r.data()),a=r.attr("data-slide-to");a&&(s.interval=!1),t.call(o,s),a&&o.data("bs.carousel").to(a),n.preventDefault()}};e(document).on("click.bs.carousel.data-api","[data-slide]",r).on("click.bs.carousel.data-api","[data-slide-to]",r),e(window).on("load",function(){e('[data-ride="carousel"]').each(function(){var n=e(this);t.call(n,n.data())})})}(jQuery),+function(e){"use strict";function t(t){var n,i=t.attr("data-target")||(n=t.attr("href"))&&n.replace(/.*(?=#[^\s]+$)/,"");return e(i)}function n(t){return this.each(function(){var n=e(this),r=n.data("bs.collapse"),o=e.extend({},i.DEFAULTS,n.data(),"object"==typeof t&&t);!r&&o.toggle&&/show|hide/.test(t)&&(o.toggle=!1),r||n.data("bs.collapse",r=new i(this,o)),"string"==typeof t&&r[t]()})}var i=function(t,n){this.$element=e(t),this.options=e.extend({},i.DEFAULTS,n),this.$trigger=e('[data-toggle="collapse"][href="#'+t.id+'"],[data-toggle="collapse"][data-target="#'+t.id+'"]'),this.transitioning=null,this.options.parent?this.$parent=this.getParent():this.addAriaAndCollapsedClass(this.$element,this.$trigger),this.options.toggle&&this.toggle()};i.VERSION="3.3.6",i.TRANSITION_DURATION=350,i.DEFAULTS={toggle:!0},i.prototype.dimension=function(){var e=this.$element.hasClass("width");return e?"width":"height"},i.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var t,r=this.$parent&&this.$parent.children(".panel").children(".in, .collapsing");if(!(r&&r.length&&(t=r.data("bs.collapse"),t&&t.transitioning))){var o=e.Event("show.bs.collapse");if(this.$element.trigger(o),!o.isDefaultPrevented()){r&&r.length&&(n.call(r,"hide"),t||r.data("bs.collapse",null));var s=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[s](0).attr("aria-expanded",!0),this.$trigger.removeClass("collapsed").attr("aria-expanded",!0),this.transitioning=1;var a=function(){this.$element.removeClass("collapsing").addClass("collapse in")[s](""),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!e.support.transition)return a.call(this);var l=e.camelCase(["scroll",s].join("-"));this.$element.one("bsTransitionEnd",e.proxy(a,this)).emulateTransitionEnd(i.TRANSITION_DURATION)[s](this.$element[0][l])}}}},i.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var t=e.Event("hide.bs.collapse");if(this.$element.trigger(t),!t.isDefaultPrevented()){var n=this.dimension();this.$element[n](this.$element[n]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse in").attr("aria-expanded",!1),this.$trigger.addClass("collapsed").attr("aria-expanded",!1),this.transitioning=1;var r=function(){this.transitioning=0,this.$element.removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse")};return e.support.transition?void this.$element[n](0).one("bsTransitionEnd",e.proxy(r,this)).emulateTransitionEnd(i.TRANSITION_DURATION):r.call(this)}}},i.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()},i.prototype.getParent=function(){return e(this.options.parent).find('[data-toggle="collapse"][data-parent="'+this.options.parent+'"]').each(e.proxy(function(n,i){var r=e(i);this.addAriaAndCollapsedClass(t(r),r)},this)).end()},i.prototype.addAriaAndCollapsedClass=function(e,t){var n=e.hasClass("in");e.attr("aria-expanded",n),t.toggleClass("collapsed",!n).attr("aria-expanded",n)};var r=e.fn.collapse;e.fn.collapse=n,e.fn.collapse.Constructor=i,e.fn.collapse.noConflict=function(){return e.fn.collapse=r,this},e(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',function(i){var r=e(this);r.attr("data-target")||i.preventDefault();var o=t(r),s=o.data("bs.collapse"),a=s?"toggle":r.data();n.call(o,a)})}(jQuery),+function(e){"use strict";function t(t){var n=t.attr("data-target");n||(n=t.attr("href"),n=n&&/#[A-Za-z]/.test(n)&&n.replace(/.*(?=#[^\s]*$)/,""));var i=n&&e(n);return i&&i.length?i:t.parent()}function n(n){n&&3===n.which||(e(r).remove(),e(o).each(function(){var i=e(this),r=t(i),o={relatedTarget:this};r.hasClass("open")&&(n&&"click"==n.type&&/input|textarea/i.test(n.target.tagName)&&e.contains(r[0],n.target)||(r.trigger(n=e.Event("hide.bs.dropdown",o)),n.isDefaultPrevented()||(i.attr("aria-expanded","false"),r.removeClass("open").trigger(e.Event("hidden.bs.dropdown",o)))))}))}function i(t){return this.each(function(){var n=e(this),i=n.data("bs.dropdown");i||n.data("bs.dropdown",i=new s(this)),"string"==typeof t&&i[t].call(n)})}var r=".dropdown-backdrop",o='[data-toggle="dropdown"]',s=function(t){e(t).on("click.bs.dropdown",this.toggle)};s.VERSION="3.3.6",s.prototype.toggle=function(i){var r=e(this);if(!r.is(".disabled, :disabled")){var o=t(r),s=o.hasClass("open");if(n(),!s){"ontouchstart"in document.documentElement&&!o.closest(".navbar-nav").length&&e(document.createElement("div")).addClass("dropdown-backdrop").insertAfter(e(this)).on("click",n);var a={relatedTarget:this};if(o.trigger(i=e.Event("show.bs.dropdown",a)),i.isDefaultPrevented())return;r.trigger("focus").attr("aria-expanded","true"),o.toggleClass("open").trigger(e.Event("shown.bs.dropdown",a))}return!1}},s.prototype.keydown=function(n){if(/(38|40|27|32)/.test(n.which)&&!/input|textarea/i.test(n.target.tagName)){var i=e(this);if(n.preventDefault(),n.stopPropagation(),!i.is(".disabled, :disabled")){var r=t(i),s=r.hasClass("open");if(!s&&27!=n.which||s&&27==n.which)return 27==n.which&&r.find(o).trigger("focus"),i.trigger("click");var a=" li:not(.disabled):visible a",l=r.find(".dropdown-menu"+a);if(l.length){var c=l.index(n.target);38==n.which&&c>0&&c--,40==n.which&&c<l.length-1&&c++,~c||(c=0),l.eq(c).trigger("focus")}}}};var a=e.fn.dropdown;e.fn.dropdown=i,e.fn.dropdown.Constructor=s,e.fn.dropdown.noConflict=function(){return e.fn.dropdown=a,this},e(document).on("click.bs.dropdown.data-api",n).on("click.bs.dropdown.data-api",".dropdown form",function(e){e.stopPropagation()}).on("click.bs.dropdown.data-api",o,s.prototype.toggle).on("keydown.bs.dropdown.data-api",o,s.prototype.keydown).on("keydown.bs.dropdown.data-api",".dropdown-menu",s.prototype.keydown)}(jQuery),+function(e){"use strict";function t(t,i){return this.each(function(){var r=e(this),o=r.data("bs.modal"),s=e.extend({},n.DEFAULTS,r.data(),"object"==typeof t&&t);o||r.data("bs.modal",o=new n(this,s)),"string"==typeof t?o[t](i):s.show&&o.show(i)})}var n=function(t,n){this.options=n,this.$body=e(document.body),this.$element=e(t),this.$dialog=this.$element.find(".modal-dialog"),this.$backdrop=null,this.isShown=null,this.originalBodyPad=null,this.scrollbarWidth=0,this.ignoreBackdropClick=!1,this.options.remote&&this.$element.find(".modal-content").load(this.options.remote,e.proxy(function(){this.$element.trigger("loaded.bs.modal")},this))};n.VERSION="3.3.6",n.TRANSITION_DURATION=300,n.BACKDROP_TRANSITION_DURATION=150,n.DEFAULTS={backdrop:!0,keyboard:!0,show:!0},n.prototype.toggle=function(e){return this.isShown?this.hide():this.show(e)},n.prototype.show=function(t){var i=this,r=e.Event("show.bs.modal",{relatedTarget:t});this.$element.trigger(r),this.isShown||r.isDefaultPrevented()||(this.isShown=!0,this.checkScrollbar(),this.setScrollbar(),this.$body.addClass("modal-open"),this.escape(),this.resize(),this.$element.on("click.dismiss.bs.modal",'[data-dismiss="modal"]',e.proxy(this.hide,this)),this.$dialog.on("mousedown.dismiss.bs.modal",function(){i.$element.one("mouseup.dismiss.bs.modal",function(t){e(t.target).is(i.$element)&&(i.ignoreBackdropClick=!0)})}),this.backdrop(function(){var r=e.support.transition&&i.$element.hasClass("fade");i.$element.parent().length||i.$element.appendTo(i.$body),i.$element.show().scrollTop(0),i.adjustDialog(),r&&i.$element[0].offsetWidth,i.$element.addClass("in"),i.enforceFocus();var o=e.Event("shown.bs.modal",{relatedTarget:t});r?i.$dialog.one("bsTransitionEnd",function(){i.$element.trigger("focus").trigger(o)}).emulateTransitionEnd(n.TRANSITION_DURATION):i.$element.trigger("focus").trigger(o)}))},n.prototype.hide=function(t){t&&t.preventDefault(),t=e.Event("hide.bs.modal"),this.$element.trigger(t),this.isShown&&!t.isDefaultPrevented()&&(this.isShown=!1,this.escape(),this.resize(),e(document).off("focusin.bs.modal"),this.$element.removeClass("in").off("click.dismiss.bs.modal").off("mouseup.dismiss.bs.modal"),this.$dialog.off("mousedown.dismiss.bs.modal"),e.support.transition&&this.$element.hasClass("fade")?this.$element.one("bsTransitionEnd",e.proxy(this.hideModal,this)).emulateTransitionEnd(n.TRANSITION_DURATION):this.hideModal())},n.prototype.enforceFocus=function(){e(document).off("focusin.bs.modal").on("focusin.bs.modal",e.proxy(function(e){this.$element[0]===e.target||this.$element.has(e.target).length||this.$element.trigger("focus")},this))},n.prototype.escape=function(){this.isShown&&this.options.keyboard?this.$element.on("keydown.dismiss.bs.modal",e.proxy(function(e){27==e.which&&this.hide()},this)):this.isShown||this.$element.off("keydown.dismiss.bs.modal")},n.prototype.resize=function(){this.isShown?e(window).on("resize.bs.modal",e.proxy(this.handleUpdate,this)):e(window).off("resize.bs.modal")},n.prototype.hideModal=function(){var e=this;this.$element.hide(),this.backdrop(function(){e.$body.removeClass("modal-open"),e.resetAdjustments(),e.resetScrollbar(),e.$element.trigger("hidden.bs.modal")})},n.prototype.removeBackdrop=function(){this.$backdrop&&this.$backdrop.remove(),this.$backdrop=null},n.prototype.backdrop=function(t){var i=this,r=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var o=e.support.transition&&r;if(this.$backdrop=e(document.createElement("div")).addClass("modal-backdrop "+r).appendTo(this.$body),this.$element.on("click.dismiss.bs.modal",e.proxy(function(e){return this.ignoreBackdropClick?void(this.ignoreBackdropClick=!1):void(e.target===e.currentTarget&&("static"==this.options.backdrop?this.$element[0].focus():this.hide()))},this)),o&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in"),!t)return;o?this.$backdrop.one("bsTransitionEnd",t).emulateTransitionEnd(n.BACKDROP_TRANSITION_DURATION):t()}else if(!this.isShown&&this.$backdrop){this.$backdrop.removeClass("in");var s=function(){i.removeBackdrop(),t&&t()};e.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one("bsTransitionEnd",s).emulateTransitionEnd(n.BACKDROP_TRANSITION_DURATION):s()}else t&&t()},n.prototype.handleUpdate=function(){this.adjustDialog()},n.prototype.adjustDialog=function(){var e=this.$element[0].scrollHeight>document.documentElement.clientHeight;this.$element.css({paddingLeft:!this.bodyIsOverflowing&&e?this.scrollbarWidth:"",paddingRight:this.bodyIsOverflowing&&!e?this.scrollbarWidth:""})},n.prototype.resetAdjustments=function(){this.$element.css({paddingLeft:"",paddingRight:""})},n.prototype.checkScrollbar=function(){var e=window.innerWidth;if(!e){var t=document.documentElement.getBoundingClientRect();e=t.right-Math.abs(t.left)}this.bodyIsOverflowing=document.body.clientWidth<e,this.scrollbarWidth=this.measureScrollbar()},n.prototype.setScrollbar=function(){var e=parseInt(this.$body.css("padding-right")||0,10);this.originalBodyPad=document.body.style.paddingRight||"",this.bodyIsOverflowing&&this.$body.css("padding-right",e+this.scrollbarWidth)},n.prototype.resetScrollbar=function(){this.$body.css("padding-right",this.originalBodyPad)},n.prototype.measureScrollbar=function(){var e=document.createElement("div");e.className="modal-scrollbar-measure",this.$body.append(e);var t=e.offsetWidth-e.clientWidth;return this.$body[0].removeChild(e),t};var i=e.fn.modal;e.fn.modal=t,e.fn.modal.Constructor=n,e.fn.modal.noConflict=function(){return e.fn.modal=i,this},e(document).on("click.bs.modal.data-api",'[data-toggle="modal"]',function(n){var i=e(this),r=i.attr("href"),o=e(i.attr("data-target")||r&&r.replace(/.*(?=#[^\s]+$)/,"")),s=o.data("bs.modal")?"toggle":e.extend({remote:!/#/.test(r)&&r},o.data(),i.data());i.is("a")&&n.preventDefault(),o.one("show.bs.modal",function(e){e.isDefaultPrevented()||o.one("hidden.bs.modal",function(){i.is(":visible")&&i.trigger("focus")})}),t.call(o,s,this)})}(jQuery),+function(e){"use strict";function t(t){return this.each(function(){var i=e(this),r=i.data("bs.tooltip"),o="object"==typeof t&&t;(r||!/destroy|hide/.test(t))&&(r||i.data("bs.tooltip",r=new n(this,o)),"string"==typeof t&&r[t]())})}var n=function(e,t){this.type=null,this.options=null,this.enabled=null,this.timeout=null,this.hoverState=null,this.$element=null,this.inState=null,this.init("tooltip",e,t)};n.VERSION="3.3.6",n.TRANSITION_DURATION=150,n.DEFAULTS={animation:!0,placement:"top",selector:!1,template:'<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',trigger:"hover focus",title:"",delay:0,html:!1,container:!1,viewport:{selector:"body",padding:0}},n.prototype.init=function(t,n,i){if(this.enabled=!0,this.type=t,this.$element=e(n),this.options=this.getOptions(i),this.$viewport=this.options.viewport&&e(e.isFunction(this.options.viewport)?this.options.viewport.call(this,this.$element):this.options.viewport.selector||this.options.viewport),this.inState={click:!1,hover:!1,focus:!1},this.$element[0]instanceof document.constructor&&!this.options.selector)throw new Error("`selector` option must be specified when initializing "+this.type+" on the window.document object!");for(var r=this.options.trigger.split(" "),o=r.length;o--;){var s=r[o];if("click"==s)this.$element.on("click."+this.type,this.options.selector,e.proxy(this.toggle,this));else if("manual"!=s){var a="hover"==s?"mouseenter":"focusin",l="hover"==s?"mouseleave":"focusout";this.$element.on(a+"."+this.type,this.options.selector,e.proxy(this.enter,this)),this.$element.on(l+"."+this.type,this.options.selector,e.proxy(this.leave,this))}}this.options.selector?this._options=e.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},n.prototype.getDefaults=function(){return n.DEFAULTS},n.prototype.getOptions=function(t){return t=e.extend({},this.getDefaults(),this.$element.data(),t),t.delay&&"number"==typeof t.delay&&(t.delay={show:t.delay,hide:t.delay}),t},n.prototype.getDelegateOptions=function(){var t={},n=this.getDefaults();return this._options&&e.each(this._options,function(e,i){n[e]!=i&&(t[e]=i)}),t},n.prototype.enter=function(t){var n=t instanceof this.constructor?t:e(t.currentTarget).data("bs."+this.type);return n||(n=new this.constructor(t.currentTarget,this.getDelegateOptions()),e(t.currentTarget).data("bs."+this.type,n)),t instanceof e.Event&&(n.inState["focusin"==t.type?"focus":"hover"]=!0),n.tip().hasClass("in")||"in"==n.hoverState?void(n.hoverState="in"):(clearTimeout(n.timeout),n.hoverState="in",n.options.delay&&n.options.delay.show?void(n.timeout=setTimeout(function(){"in"==n.hoverState&&n.show()},n.options.delay.show)):n.show())},n.prototype.isInStateTrue=function(){for(var e in this.inState)if(this.inState[e])return!0;return!1},n.prototype.leave=function(t){var n=t instanceof this.constructor?t:e(t.currentTarget).data("bs."+this.type);return n||(n=new this.constructor(t.currentTarget,this.getDelegateOptions()),e(t.currentTarget).data("bs."+this.type,n)),t instanceof e.Event&&(n.inState["focusout"==t.type?"focus":"hover"]=!1),n.isInStateTrue()?void 0:(clearTimeout(n.timeout),n.hoverState="out",n.options.delay&&n.options.delay.hide?void(n.timeout=setTimeout(function(){"out"==n.hoverState&&n.hide()},n.options.delay.hide)):n.hide())},n.prototype.show=function(){var t=e.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(t);var i=e.contains(this.$element[0].ownerDocument.documentElement,this.$element[0]);if(t.isDefaultPrevented()||!i)return;var r=this,o=this.tip(),s=this.getUID(this.type);this.setContent(),o.attr("id",s),this.$element.attr("aria-describedby",s),this.options.animation&&o.addClass("fade");var a="function"==typeof this.options.placement?this.options.placement.call(this,o[0],this.$element[0]):this.options.placement,l=/\s?auto?\s?/i,c=l.test(a);c&&(a=a.replace(l,"")||"top"),o.detach().css({top:0,left:0,display:"block"}).addClass(a).data("bs."+this.type,this),this.options.container?o.appendTo(this.options.container):o.insertAfter(this.$element),this.$element.trigger("inserted.bs."+this.type);var u=this.getPosition(),d=o[0].offsetWidth,h=o[0].offsetHeight;if(c){var f=a,p=this.getPosition(this.$viewport);a="bottom"==a&&u.bottom+h>p.bottom?"top":"top"==a&&u.top-h<p.top?"bottom":"right"==a&&u.right+d>p.width?"left":"left"==a&&u.left-d<p.left?"right":a,o.removeClass(f).addClass(a)}var m=this.getCalculatedOffset(a,u,d,h);this.applyPlacement(m,a);var g=function(){var e=r.hoverState;r.$element.trigger("shown.bs."+r.type),r.hoverState=null,"out"==e&&r.leave(r)};e.support.transition&&this.$tip.hasClass("fade")?o.one("bsTransitionEnd",g).emulateTransitionEnd(n.TRANSITION_DURATION):g()}},n.prototype.applyPlacement=function(t,n){var i=this.tip(),r=i[0].offsetWidth,o=i[0].offsetHeight,s=parseInt(i.css("margin-top"),10),a=parseInt(i.css("margin-left"),10);isNaN(s)&&(s=0),isNaN(a)&&(a=0),t.top+=s,t.left+=a,e.offset.setOffset(i[0],e.extend({using:function(e){i.css({top:Math.round(e.top),left:Math.round(e.left)})}},t),0),i.addClass("in");var l=i[0].offsetWidth,c=i[0].offsetHeight;"top"==n&&c!=o&&(t.top=t.top+o-c);var u=this.getViewportAdjustedDelta(n,t,l,c);u.left?t.left+=u.left:t.top+=u.top;var d=/top|bottom/.test(n),h=d?2*u.left-r+l:2*u.top-o+c,f=d?"offsetWidth":"offsetHeight";i.offset(t),this.replaceArrow(h,i[0][f],d)},n.prototype.replaceArrow=function(e,t,n){this.arrow().css(n?"left":"top",50*(1-e/t)+"%").css(n?"top":"left","")},n.prototype.setContent=function(){var e=this.tip(),t=this.getTitle();e.find(".tooltip-inner")[this.options.html?"html":"text"](t),e.removeClass("fade in top bottom left right")},n.prototype.hide=function(t){function i(){"in"!=r.hoverState&&o.detach(),r.$element.removeAttr("aria-describedby").trigger("hidden.bs."+r.type),t&&t()}var r=this,o=e(this.$tip),s=e.Event("hide.bs."+this.type);return this.$element.trigger(s),s.isDefaultPrevented()?void 0:(o.removeClass("in"),e.support.transition&&o.hasClass("fade")?o.one("bsTransitionEnd",i).emulateTransitionEnd(n.TRANSITION_DURATION):i(),this.hoverState=null,this)},n.prototype.fixTitle=function(){var e=this.$element;(e.attr("title")||"string"!=typeof e.attr("data-original-title"))&&e.attr("data-original-title",e.attr("title")||"").attr("title","")},n.prototype.hasContent=function(){return this.getTitle()},n.prototype.getPosition=function(t){t=t||this.$element;var n=t[0],i="BODY"==n.tagName,r=n.getBoundingClientRect();null==r.width&&(r=e.extend({},r,{width:r.right-r.left,height:r.bottom-r.top}));var o=i?{top:0,left:0}:t.offset(),s={scroll:i?document.documentElement.scrollTop||document.body.scrollTop:t.scrollTop()},a=i?{width:e(window).width(),height:e(window).height()}:null;return e.extend({},r,s,a,o)},n.prototype.getCalculatedOffset=function(e,t,n,i){return"bottom"==e?{top:t.top+t.height,left:t.left+t.width/2-n/2}:"top"==e?{top:t.top-i,left:t.left+t.width/2-n/2}:"left"==e?{top:t.top+t.height/2-i/2,left:t.left-n}:{top:t.top+t.height/2-i/2,left:t.left+t.width}},n.prototype.getViewportAdjustedDelta=function(e,t,n,i){var r={top:0,left:0};if(!this.$viewport)return r;var o=this.options.viewport&&this.options.viewport.padding||0,s=this.getPosition(this.$viewport);if(/right|left/.test(e)){var a=t.top-o-s.scroll,l=t.top+o-s.scroll+i;a<s.top?r.top=s.top-a:l>s.top+s.height&&(r.top=s.top+s.height-l)}else{var c=t.left-o,u=t.left+o+n;c<s.left?r.left=s.left-c:u>s.right&&(r.left=s.left+s.width-u)}return r},n.prototype.getTitle=function(){var e,t=this.$element,n=this.options;return e=t.attr("data-original-title")||("function"==typeof n.title?n.title.call(t[0]):n.title)},n.prototype.getUID=function(e){do e+=~~(1e6*Math.random());while(document.getElementById(e));return e},n.prototype.tip=function(){if(!this.$tip&&(this.$tip=e(this.options.template),1!=this.$tip.length))throw new Error(this.type+" `template` option must consist of exactly 1 top-level element!");return this.$tip},n.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},n.prototype.enable=function(){this.enabled=!0},n.prototype.disable=function(){this.enabled=!1},n.prototype.toggleEnabled=function(){this.enabled=!this.enabled},n.prototype.toggle=function(t){var n=this;t&&(n=e(t.currentTarget).data("bs."+this.type),n||(n=new this.constructor(t.currentTarget,this.getDelegateOptions()),e(t.currentTarget).data("bs."+this.type,n))),t?(n.inState.click=!n.inState.click,n.isInStateTrue()?n.enter(n):n.leave(n)):n.tip().hasClass("in")?n.leave(n):n.enter(n)},n.prototype.destroy=function(){var e=this;clearTimeout(this.timeout),this.hide(function(){e.$element.off("."+e.type).removeData("bs."+e.type),e.$tip&&e.$tip.detach(),e.$tip=null,e.$arrow=null,e.$viewport=null})};var i=e.fn.tooltip;e.fn.tooltip=t,e.fn.tooltip.Constructor=n,e.fn.tooltip.noConflict=function(){return e.fn.tooltip=i,this}}(jQuery),+function(e){"use strict";function t(t){return this.each(function(){var i=e(this),r=i.data("bs.popover"),o="object"==typeof t&&t;(r||!/destroy|hide/.test(t))&&(r||i.data("bs.popover",r=new n(this,o)),"string"==typeof t&&r[t]())})}var n=function(e,t){this.init("popover",e,t)};if(!e.fn.tooltip)throw new Error("Popover requires tooltip.js");n.VERSION="3.3.6",n.DEFAULTS=e.extend({},e.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:'<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'}),n.prototype=e.extend({},e.fn.tooltip.Constructor.prototype),n.prototype.constructor=n,n.prototype.getDefaults=function(){return n.DEFAULTS},n.prototype.setContent=function(){var e=this.tip(),t=this.getTitle(),n=this.getContent();e.find(".popover-title")[this.options.html?"html":"text"](t),e.find(".popover-content").children().detach().end()[this.options.html?"string"==typeof n?"html":"append":"text"](n),e.removeClass("fade top bottom left right in"),e.find(".popover-title").html()||e.find(".popover-title").hide()},n.prototype.hasContent=function(){return this.getTitle()||this.getContent()},n.prototype.getContent=function(){var e=this.$element,t=this.options;return e.attr("data-content")||("function"==typeof t.content?t.content.call(e[0]):t.content)},n.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")};var i=e.fn.popover;e.fn.popover=t,e.fn.popover.Constructor=n,e.fn.popover.noConflict=function(){return e.fn.popover=i,this}}(jQuery),+function(e){"use strict";function t(n,i){this.$body=e(document.body),this.$scrollElement=e(e(n).is(document.body)?window:n),this.options=e.extend({},t.DEFAULTS,i),this.selector=(this.options.target||"")+" .nav li > a",this.offsets=[],this.targets=[],this.activeTarget=null,this.scrollHeight=0,this.$scrollElement.on("scroll.bs.scrollspy",e.proxy(this.process,this)),this.refresh(),this.process()}function n(n){return this.each(function(){var i=e(this),r=i.data("bs.scrollspy"),o="object"==typeof n&&n;r||i.data("bs.scrollspy",r=new t(this,o)),"string"==typeof n&&r[n]()})}t.VERSION="3.3.6",t.DEFAULTS={offset:10},t.prototype.getScrollHeight=function(){return this.$scrollElement[0].scrollHeight||Math.max(this.$body[0].scrollHeight,document.documentElement.scrollHeight)},t.prototype.refresh=function(){var t=this,n="offset",i=0;this.offsets=[],this.targets=[],this.scrollHeight=this.getScrollHeight(),e.isWindow(this.$scrollElement[0])||(n="position",i=this.$scrollElement.scrollTop()),this.$body.find(this.selector).map(function(){var t=e(this),r=t.data("target")||t.attr("href"),o=/^#./.test(r)&&e(r);return o&&o.length&&o.is(":visible")&&[[o[n]().top+i,r]]||null}).sort(function(e,t){return e[0]-t[0]}).each(function(){t.offsets.push(this[0]),t.targets.push(this[1])})},t.prototype.process=function(){var e,t=this.$scrollElement.scrollTop()+this.options.offset,n=this.getScrollHeight(),i=this.options.offset+n-this.$scrollElement.height(),r=this.offsets,o=this.targets,s=this.activeTarget;if(this.scrollHeight!=n&&this.refresh(),t>=i)return s!=(e=o[o.length-1])&&this.activate(e);if(s&&t<r[0])return this.activeTarget=null,this.clear();for(e=r.length;e--;)s!=o[e]&&t>=r[e]&&(void 0===r[e+1]||t<r[e+1])&&this.activate(o[e])},t.prototype.activate=function(t){this.activeTarget=t,this.clear();var n=this.selector+'[data-target="'+t+'"],'+this.selector+'[href="'+t+'"]',i=e(n).parents("li").addClass("active");i.parent(".dropdown-menu").length&&(i=i.closest("li.dropdown").addClass("active")),i.trigger("activate.bs.scrollspy")},t.prototype.clear=function(){e(this.selector).parentsUntil(this.options.target,".active").removeClass("active")};var i=e.fn.scrollspy;e.fn.scrollspy=n,e.fn.scrollspy.Constructor=t,e.fn.scrollspy.noConflict=function(){return e.fn.scrollspy=i,this},e(window).on("load.bs.scrollspy.data-api",function(){e('[data-spy="scroll"]').each(function(){var t=e(this);n.call(t,t.data())})})}(jQuery),+function(e){"use strict";function t(t){return this.each(function(){var i=e(this),r=i.data("bs.tab");r||i.data("bs.tab",r=new n(this)),"string"==typeof t&&r[t]()})}var n=function(t){this.element=e(t)};n.VERSION="3.3.6",n.TRANSITION_DURATION=150,n.prototype.show=function(){var t=this.element,n=t.closest("ul:not(.dropdown-menu)"),i=t.data("target");if(i||(i=t.attr("href"),i=i&&i.replace(/.*(?=#[^\s]*$)/,"")),!t.parent("li").hasClass("active")){var r=n.find(".active:last a"),o=e.Event("hide.bs.tab",{relatedTarget:t[0]}),s=e.Event("show.bs.tab",{relatedTarget:r[0]});if(r.trigger(o),t.trigger(s),!s.isDefaultPrevented()&&!o.isDefaultPrevented()){var a=e(i);this.activate(t.closest("li"),n),this.activate(a,a.parent(),function(){r.trigger({type:"hidden.bs.tab",relatedTarget:t[0]}),t.trigger({type:"shown.bs.tab",relatedTarget:r[0]})})}}},n.prototype.activate=function(t,i,r){function o(){s.removeClass("active").find("> .dropdown-menu > .active").removeClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!1),t.addClass("active").find('[data-toggle="tab"]').attr("aria-expanded",!0),a?(t[0].offsetWidth,t.addClass("in")):t.removeClass("fade"),t.parent(".dropdown-menu").length&&t.closest("li.dropdown").addClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!0),r&&r()}var s=i.find("> .active"),a=r&&e.support.transition&&(s.length&&s.hasClass("fade")||!!i.find("> .fade").length);s.length&&a?s.one("bsTransitionEnd",o).emulateTransitionEnd(n.TRANSITION_DURATION):o(),s.removeClass("in")};var i=e.fn.tab;e.fn.tab=t,e.fn.tab.Constructor=n,e.fn.tab.noConflict=function(){return e.fn.tab=i,this};var r=function(n){n.preventDefault(),t.call(e(this),"show")};e(document).on("click.bs.tab.data-api",'[data-toggle="tab"]',r).on("click.bs.tab.data-api",'[data-toggle="pill"]',r)}(jQuery),+function(e){"use strict";function t(t){return this.each(function(){var i=e(this),r=i.data("bs.affix"),o="object"==typeof t&&t;r||i.data("bs.affix",r=new n(this,o)),"string"==typeof t&&r[t]()})}var n=function(t,i){this.options=e.extend({},n.DEFAULTS,i),this.$target=e(this.options.target).on("scroll.bs.affix.data-api",e.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",e.proxy(this.checkPositionWithEventLoop,this)),this.$element=e(t),this.affixed=null,this.unpin=null,this.pinnedOffset=null,this.checkPosition()};n.VERSION="3.3.6",n.RESET="affix affix-top affix-bottom",n.DEFAULTS={offset:0,target:window},n.prototype.getState=function(e,t,n,i){var r=this.$target.scrollTop(),o=this.$element.offset(),s=this.$target.height();if(null!=n&&"top"==this.affixed)return n>r&&"top";if("bottom"==this.affixed)return null!=n?!(r+this.unpin<=o.top)&&"bottom":!(e-i>=r+s)&&"bottom";var a=null==this.affixed,l=a?r:o.top,c=a?s:t;return null!=n&&n>=r?"top":null!=i&&l+c>=e-i&&"bottom"},n.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(n.RESET).addClass("affix");var e=this.$target.scrollTop(),t=this.$element.offset();return this.pinnedOffset=t.top-e},n.prototype.checkPositionWithEventLoop=function(){setTimeout(e.proxy(this.checkPosition,this),1)},n.prototype.checkPosition=function(){if(this.$element.is(":visible")){var t=this.$element.height(),i=this.options.offset,r=i.top,o=i.bottom,s=Math.max(e(document).height(),e(document.body).height());"object"!=typeof i&&(o=r=i),"function"==typeof r&&(r=i.top(this.$element)),"function"==typeof o&&(o=i.bottom(this.$element));var a=this.getState(s,t,r,o);if(this.affixed!=a){null!=this.unpin&&this.$element.css("top","");var l="affix"+(a?"-"+a:""),c=e.Event(l+".bs.affix");if(this.$element.trigger(c),c.isDefaultPrevented())return;this.affixed=a,this.unpin="bottom"==a?this.getPinnedOffset():null,this.$element.removeClass(n.RESET).addClass(l).trigger(l.replace("affix","affixed")+".bs.affix")}"bottom"==a&&this.$element.offset({top:s-t-o})}};var i=e.fn.affix;e.fn.affix=t,e.fn.affix.Constructor=n,e.fn.affix.noConflict=function(){return e.fn.affix=i,this},e(window).on("load",function(){e('[data-spy="affix"]').each(function(){var n=e(this),i=n.data();i.offset=i.offset||{},null!=i.offsetBottom&&(i.offset.bottom=i.offsetBottom),null!=i.offsetTop&&(i.offset.top=i.offsetTop),t.call(n,i)})})}(jQuery),!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.moment=t()}(this,function(){"use strict";function e(){return si.apply(null,arguments)}function t(e){si=e}function n(e){return e instanceof Array||"[object Array]"===Object.prototype.toString.call(e)}function i(e){return e instanceof Date||"[object Date]"===Object.prototype.toString.call(e)}function r(e,t){var n,i=[];for(n=0;n<e.length;++n)i.push(t(e[n],n));return i}function o(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function s(e,t){for(var n in t)o(t,n)&&(e[n]=t[n]);return o(t,"toString")&&(e.toString=t.toString),o(t,"valueOf")&&(e.valueOf=t.valueOf),e}function a(e,t,n,i){return Ie(e,t,n,i,!0).utc()}function l(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],meridiem:null}}function c(e){return null==e._pf&&(e._pf=l()),e._pf}function u(e){if(null==e._isValid){var t=c(e),n=ai.call(t.parsedDateParts,function(e){return null!=e});e._isValid=!isNaN(e._d.getTime())&&t.overflow<0&&!t.empty&&!t.invalidMonth&&!t.invalidWeekday&&!t.nullInput&&!t.invalidFormat&&!t.userInvalidated&&(!t.meridiem||t.meridiem&&n),
  e._strict&&(e._isValid=e._isValid&&0===t.charsLeftOver&&0===t.unusedTokens.length&&void 0===t.bigHour)}return e._isValid}function d(e){var t=a(NaN);return null!=e?s(c(t),e):c(t).userInvalidated=!0,t}function h(e){return void 0===e}function f(e,t){var n,i,r;if(h(t._isAMomentObject)||(e._isAMomentObject=t._isAMomentObject),h(t._i)||(e._i=t._i),h(t._f)||(e._f=t._f),h(t._l)||(e._l=t._l),h(t._strict)||(e._strict=t._strict),h(t._tzm)||(e._tzm=t._tzm),h(t._isUTC)||(e._isUTC=t._isUTC),h(t._offset)||(e._offset=t._offset),h(t._pf)||(e._pf=c(t)),h(t._locale)||(e._locale=t._locale),li.length>0)for(n in li)i=li[n],r=t[i],h(r)||(e[i]=r);return e}function p(t){f(this,t),this._d=new Date(null!=t._d?t._d.getTime():NaN),ci===!1&&(ci=!0,e.updateOffset(this),ci=!1)}function m(e){return e instanceof p||null!=e&&null!=e._isAMomentObject}function g(e){return 0>e?Math.ceil(e):Math.floor(e)}function v(e){var t=+e,n=0;return 0!==t&&isFinite(t)&&(n=g(t)),n}function y(e,t,n){var i,r=Math.min(e.length,t.length),o=Math.abs(e.length-t.length),s=0;for(i=0;r>i;i++)(n&&e[i]!==t[i]||!n&&v(e[i])!==v(t[i]))&&s++;return s+o}function b(t){e.suppressDeprecationWarnings===!1&&"undefined"!=typeof console&&console.warn&&void 0}function x(t,n){var i=!0;return s(function(){return null!=e.deprecationHandler&&e.deprecationHandler(null,t),i&&(b(t+"\nArguments: "+Array.prototype.slice.call(arguments).join(", ")+"\n"+(new Error).stack),i=!1),n.apply(this,arguments)},n)}function w(t,n){null!=e.deprecationHandler&&e.deprecationHandler(t,n),ui[t]||(b(n),ui[t]=!0)}function C(e){return e instanceof Function||"[object Function]"===Object.prototype.toString.call(e)}function k(e){return"[object Object]"===Object.prototype.toString.call(e)}function _(e){var t,n;for(n in e)t=e[n],C(t)?this[n]=t:this["_"+n]=t;this._config=e,this._ordinalParseLenient=new RegExp(this._ordinalParse.source+"|"+/\d{1,2}/.source)}function S(e,t){var n,i=s({},e);for(n in t)o(t,n)&&(k(e[n])&&k(t[n])?(i[n]={},s(i[n],e[n]),s(i[n],t[n])):null!=t[n]?i[n]=t[n]:delete i[n]);return i}function T(e){null!=e&&this.set(e)}function D(e){return e?e.toLowerCase().replace("_","-"):e}function M(e){for(var t,n,i,r,o=0;o<e.length;){for(r=D(e[o]).split("-"),t=r.length,n=D(e[o+1]),n=n?n.split("-"):null;t>0;){if(i=E(r.slice(0,t).join("-")))return i;if(n&&n.length>=t&&y(r,n,!0)>=t-1)break;t--}o++}return null}function E(e){var t=null;if(!pi[e]&&"undefined"!=typeof module&&module&&module.exports)try{t=hi._abbr,require("./locale/"+e),L(t)}catch(n){}return pi[e]}function L(e,t){var n;return e&&(n=h(t)?O(e):A(e,t),n&&(hi=n)),hi._abbr}function A(e,t){return null!==t?(t.abbr=e,null!=pi[e]?(w("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale"),t=S(pi[e]._config,t)):null!=t.parentLocale&&(null!=pi[t.parentLocale]?t=S(pi[t.parentLocale]._config,t):w("parentLocaleUndefined","specified parentLocale is not defined yet")),pi[e]=new T(t),L(e),pi[e]):(delete pi[e],null)}function $(e,t){if(null!=t){var n;null!=pi[e]&&(t=S(pi[e]._config,t)),n=new T(t),n.parentLocale=pi[e],pi[e]=n,L(e)}else null!=pi[e]&&(null!=pi[e].parentLocale?pi[e]=pi[e].parentLocale:null!=pi[e]&&delete pi[e]);return pi[e]}function O(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return hi;if(!n(e)){if(t=E(e))return t;e=[e]}return M(e)}function N(){return di(pi)}function I(e,t){var n=e.toLowerCase();mi[n]=mi[n+"s"]=mi[t]=e}function R(e){return"string"==typeof e?mi[e]||mi[e.toLowerCase()]:void 0}function P(e){var t,n,i={};for(n in e)o(e,n)&&(t=R(n),t&&(i[t]=e[n]));return i}function H(t,n){return function(i){return null!=i?(j(this,t,i),e.updateOffset(this,n),this):B(this,t)}}function B(e,t){return e.isValid()?e._d["get"+(e._isUTC?"UTC":"")+t]():NaN}function j(e,t,n){e.isValid()&&e._d["set"+(e._isUTC?"UTC":"")+t](n)}function F(e,t){var n;if("object"==typeof e)for(n in e)this.set(n,e[n]);else if(e=R(e),C(this[e]))return this[e](t);return this}function W(e,t,n){var i=""+Math.abs(e),r=t-i.length,o=e>=0;return(o?n?"+":"":"-")+Math.pow(10,Math.max(0,r)).toString().substr(1)+i}function q(e,t,n,i){var r=i;"string"==typeof i&&(r=function(){return this[i]()}),e&&(bi[e]=r),t&&(bi[t[0]]=function(){return W(r.apply(this,arguments),t[1],t[2])}),n&&(bi[n]=function(){return this.localeData().ordinal(r.apply(this,arguments),e)})}function z(e){return e.match(/\[[\s\S]/)?e.replace(/^\[|\]$/g,""):e.replace(/\\/g,"")}function Y(e){var t,n,i=e.match(gi);for(t=0,n=i.length;n>t;t++)bi[i[t]]?i[t]=bi[i[t]]:i[t]=z(i[t]);return function(t){var r,o="";for(r=0;n>r;r++)o+=i[r]instanceof Function?i[r].call(t,e):i[r];return o}}function U(e,t){return e.isValid()?(t=V(t,e.localeData()),yi[t]=yi[t]||Y(t),yi[t](e)):e.localeData().invalidDate()}function V(e,t){function n(e){return t.longDateFormat(e)||e}var i=5;for(vi.lastIndex=0;i>=0&&vi.test(e);)e=e.replace(vi,n),vi.lastIndex=0,i-=1;return e}function G(e,t,n){Pi[e]=C(t)?t:function(e,i){return e&&n?n:t}}function X(e,t){return o(Pi,e)?Pi[e](t._strict,t._locale):new RegExp(Z(e))}function Z(e){return K(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(e,t,n,i,r){return t||n||i||r}))}function K(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function Q(e,t){var n,i=t;for("string"==typeof e&&(e=[e]),"number"==typeof t&&(i=function(e,n){n[t]=v(e)}),n=0;n<e.length;n++)Hi[e[n]]=i}function J(e,t){Q(e,function(e,n,i,r){i._w=i._w||{},t(e,i._w,i,r)})}function ee(e,t,n){null!=t&&o(Hi,e)&&Hi[e](t,n._a,n,e)}function te(e,t){return new Date(Date.UTC(e,t+1,0)).getUTCDate()}function ne(e,t){return n(this._months)?this._months[e.month()]:this._months[Gi.test(t)?"format":"standalone"][e.month()]}function ie(e,t){return n(this._monthsShort)?this._monthsShort[e.month()]:this._monthsShort[Gi.test(t)?"format":"standalone"][e.month()]}function re(e,t,n){var i,r,o,s=e.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],i=0;12>i;++i)o=a([2e3,i]),this._shortMonthsParse[i]=this.monthsShort(o,"").toLocaleLowerCase(),this._longMonthsParse[i]=this.months(o,"").toLocaleLowerCase();return n?"MMM"===t?(r=fi.call(this._shortMonthsParse,s),-1!==r?r:null):(r=fi.call(this._longMonthsParse,s),-1!==r?r:null):"MMM"===t?(r=fi.call(this._shortMonthsParse,s),-1!==r?r:(r=fi.call(this._longMonthsParse,s),-1!==r?r:null)):(r=fi.call(this._longMonthsParse,s),-1!==r?r:(r=fi.call(this._shortMonthsParse,s),-1!==r?r:null))}function oe(e,t,n){var i,r,o;if(this._monthsParseExact)return re.call(this,e,t,n);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),i=0;12>i;i++){if(r=a([2e3,i]),n&&!this._longMonthsParse[i]&&(this._longMonthsParse[i]=new RegExp("^"+this.months(r,"").replace(".","")+"$","i"),this._shortMonthsParse[i]=new RegExp("^"+this.monthsShort(r,"").replace(".","")+"$","i")),n||this._monthsParse[i]||(o="^"+this.months(r,"")+"|^"+this.monthsShort(r,""),this._monthsParse[i]=new RegExp(o.replace(".",""),"i")),n&&"MMMM"===t&&this._longMonthsParse[i].test(e))return i;if(n&&"MMM"===t&&this._shortMonthsParse[i].test(e))return i;if(!n&&this._monthsParse[i].test(e))return i}}function se(e,t){var n;if(!e.isValid())return e;if("string"==typeof t)if(/^\d+$/.test(t))t=v(t);else if(t=e.localeData().monthsParse(t),"number"!=typeof t)return e;return n=Math.min(e.date(),te(e.year(),t)),e._d["set"+(e._isUTC?"UTC":"")+"Month"](t,n),e}function ae(t){return null!=t?(se(this,t),e.updateOffset(this,!0),this):B(this,"Month")}function le(){return te(this.year(),this.month())}function ce(e){return this._monthsParseExact?(o(this,"_monthsRegex")||de.call(this),e?this._monthsShortStrictRegex:this._monthsShortRegex):this._monthsShortStrictRegex&&e?this._monthsShortStrictRegex:this._monthsShortRegex}function ue(e){return this._monthsParseExact?(o(this,"_monthsRegex")||de.call(this),e?this._monthsStrictRegex:this._monthsRegex):this._monthsStrictRegex&&e?this._monthsStrictRegex:this._monthsRegex}function de(){function e(e,t){return t.length-e.length}var t,n,i=[],r=[],o=[];for(t=0;12>t;t++)n=a([2e3,t]),i.push(this.monthsShort(n,"")),r.push(this.months(n,"")),o.push(this.months(n,"")),o.push(this.monthsShort(n,""));for(i.sort(e),r.sort(e),o.sort(e),t=0;12>t;t++)i[t]=K(i[t]),r[t]=K(r[t]),o[t]=K(o[t]);this._monthsRegex=new RegExp("^("+o.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+r.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+i.join("|")+")","i")}function he(e){var t,n=e._a;return n&&-2===c(e).overflow&&(t=n[ji]<0||n[ji]>11?ji:n[Fi]<1||n[Fi]>te(n[Bi],n[ji])?Fi:n[Wi]<0||n[Wi]>24||24===n[Wi]&&(0!==n[qi]||0!==n[zi]||0!==n[Yi])?Wi:n[qi]<0||n[qi]>59?qi:n[zi]<0||n[zi]>59?zi:n[Yi]<0||n[Yi]>999?Yi:-1,c(e)._overflowDayOfYear&&(Bi>t||t>Fi)&&(t=Fi),c(e)._overflowWeeks&&-1===t&&(t=Ui),c(e)._overflowWeekday&&-1===t&&(t=Vi),c(e).overflow=t),e}function fe(e){var t,n,i,r,o,s,a=e._i,l=Ji.exec(a)||er.exec(a);if(l){for(c(e).iso=!0,t=0,n=nr.length;n>t;t++)if(nr[t][1].exec(l[1])){r=nr[t][0],i=nr[t][2]!==!1;break}if(null==r)return void(e._isValid=!1);if(l[3]){for(t=0,n=ir.length;n>t;t++)if(ir[t][1].exec(l[3])){o=(l[2]||" ")+ir[t][0];break}if(null==o)return void(e._isValid=!1)}if(!i&&null!=o)return void(e._isValid=!1);if(l[4]){if(!tr.exec(l[4]))return void(e._isValid=!1);s="Z"}e._f=r+(o||"")+(s||""),Me(e)}else e._isValid=!1}function pe(t){var n=rr.exec(t._i);return null!==n?void(t._d=new Date((+n[1]))):(fe(t),void(t._isValid===!1&&(delete t._isValid,e.createFromInputFallback(t))))}function me(e,t,n,i,r,o,s){var a=new Date(e,t,n,i,r,o,s);return 100>e&&e>=0&&isFinite(a.getFullYear())&&a.setFullYear(e),a}function ge(e){var t=new Date(Date.UTC.apply(null,arguments));return 100>e&&e>=0&&isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e),t}function ve(e){return ye(e)?366:365}function ye(e){return e%4===0&&e%100!==0||e%400===0}function be(){return ye(this.year())}function xe(e,t,n){var i=7+t-n,r=(7+ge(e,0,i).getUTCDay()-t)%7;return-r+i-1}function we(e,t,n,i,r){var o,s,a=(7+n-i)%7,l=xe(e,i,r),c=1+7*(t-1)+a+l;return 0>=c?(o=e-1,s=ve(o)+c):c>ve(e)?(o=e+1,s=c-ve(e)):(o=e,s=c),{year:o,dayOfYear:s}}function Ce(e,t,n){var i,r,o=xe(e.year(),t,n),s=Math.floor((e.dayOfYear()-o-1)/7)+1;return 1>s?(r=e.year()-1,i=s+ke(r,t,n)):s>ke(e.year(),t,n)?(i=s-ke(e.year(),t,n),r=e.year()+1):(r=e.year(),i=s),{week:i,year:r}}function ke(e,t,n){var i=xe(e,t,n),r=xe(e+1,t,n);return(ve(e)-i+r)/7}function _e(e,t,n){return null!=e?e:null!=t?t:n}function Se(t){var n=new Date(e.now());return t._useUTC?[n.getUTCFullYear(),n.getUTCMonth(),n.getUTCDate()]:[n.getFullYear(),n.getMonth(),n.getDate()]}function Te(e){var t,n,i,r,o=[];if(!e._d){for(i=Se(e),e._w&&null==e._a[Fi]&&null==e._a[ji]&&De(e),e._dayOfYear&&(r=_e(e._a[Bi],i[Bi]),e._dayOfYear>ve(r)&&(c(e)._overflowDayOfYear=!0),n=ge(r,0,e._dayOfYear),e._a[ji]=n.getUTCMonth(),e._a[Fi]=n.getUTCDate()),t=0;3>t&&null==e._a[t];++t)e._a[t]=o[t]=i[t];for(;7>t;t++)e._a[t]=o[t]=null==e._a[t]?2===t?1:0:e._a[t];24===e._a[Wi]&&0===e._a[qi]&&0===e._a[zi]&&0===e._a[Yi]&&(e._nextDay=!0,e._a[Wi]=0),e._d=(e._useUTC?ge:me).apply(null,o),null!=e._tzm&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[Wi]=24)}}function De(e){var t,n,i,r,o,s,a,l;t=e._w,null!=t.GG||null!=t.W||null!=t.E?(o=1,s=4,n=_e(t.GG,e._a[Bi],Ce(Re(),1,4).year),i=_e(t.W,1),r=_e(t.E,1),(1>r||r>7)&&(l=!0)):(o=e._locale._week.dow,s=e._locale._week.doy,n=_e(t.gg,e._a[Bi],Ce(Re(),o,s).year),i=_e(t.w,1),null!=t.d?(r=t.d,(0>r||r>6)&&(l=!0)):null!=t.e?(r=t.e+o,(t.e<0||t.e>6)&&(l=!0)):r=o),1>i||i>ke(n,o,s)?c(e)._overflowWeeks=!0:null!=l?c(e)._overflowWeekday=!0:(a=we(n,i,r,o,s),e._a[Bi]=a.year,e._dayOfYear=a.dayOfYear)}function Me(t){if(t._f===e.ISO_8601)return void fe(t);t._a=[],c(t).empty=!0;var n,i,r,o,s,a=""+t._i,l=a.length,u=0;for(r=V(t._f,t._locale).match(gi)||[],n=0;n<r.length;n++)o=r[n],i=(a.match(X(o,t))||[])[0],i&&(s=a.substr(0,a.indexOf(i)),s.length>0&&c(t).unusedInput.push(s),a=a.slice(a.indexOf(i)+i.length),u+=i.length),bi[o]?(i?c(t).empty=!1:c(t).unusedTokens.push(o),ee(o,i,t)):t._strict&&!i&&c(t).unusedTokens.push(o);c(t).charsLeftOver=l-u,a.length>0&&c(t).unusedInput.push(a),c(t).bigHour===!0&&t._a[Wi]<=12&&t._a[Wi]>0&&(c(t).bigHour=void 0),c(t).parsedDateParts=t._a.slice(0),c(t).meridiem=t._meridiem,t._a[Wi]=Ee(t._locale,t._a[Wi],t._meridiem),Te(t),he(t)}function Ee(e,t,n){var i;return null==n?t:null!=e.meridiemHour?e.meridiemHour(t,n):null!=e.isPM?(i=e.isPM(n),i&&12>t&&(t+=12),i||12!==t||(t=0),t):t}function Le(e){var t,n,i,r,o;if(0===e._f.length)return c(e).invalidFormat=!0,void(e._d=new Date(NaN));for(r=0;r<e._f.length;r++)o=0,t=f({},e),null!=e._useUTC&&(t._useUTC=e._useUTC),t._f=e._f[r],Me(t),u(t)&&(o+=c(t).charsLeftOver,o+=10*c(t).unusedTokens.length,c(t).score=o,(null==i||i>o)&&(i=o,n=t));s(e,n||t)}function Ae(e){if(!e._d){var t=P(e._i);e._a=r([t.year,t.month,t.day||t.date,t.hour,t.minute,t.second,t.millisecond],function(e){return e&&parseInt(e,10)}),Te(e)}}function $e(e){var t=new p(he(Oe(e)));return t._nextDay&&(t.add(1,"d"),t._nextDay=void 0),t}function Oe(e){var t=e._i,r=e._f;return e._locale=e._locale||O(e._l),null===t||void 0===r&&""===t?d({nullInput:!0}):("string"==typeof t&&(e._i=t=e._locale.preparse(t)),m(t)?new p(he(t)):(n(r)?Le(e):r?Me(e):i(t)?e._d=t:Ne(e),u(e)||(e._d=null),e))}function Ne(t){var o=t._i;void 0===o?t._d=new Date(e.now()):i(o)?t._d=new Date(o.valueOf()):"string"==typeof o?pe(t):n(o)?(t._a=r(o.slice(0),function(e){return parseInt(e,10)}),Te(t)):"object"==typeof o?Ae(t):"number"==typeof o?t._d=new Date(o):e.createFromInputFallback(t)}function Ie(e,t,n,i,r){var o={};return"boolean"==typeof n&&(i=n,n=void 0),o._isAMomentObject=!0,o._useUTC=o._isUTC=r,o._l=n,o._i=e,o._f=t,o._strict=i,$e(o)}function Re(e,t,n,i){return Ie(e,t,n,i,!1)}function Pe(e,t){var i,r;if(1===t.length&&n(t[0])&&(t=t[0]),!t.length)return Re();for(i=t[0],r=1;r<t.length;++r)(!t[r].isValid()||t[r][e](i))&&(i=t[r]);return i}function He(){var e=[].slice.call(arguments,0);return Pe("isBefore",e)}function Be(){var e=[].slice.call(arguments,0);return Pe("isAfter",e)}function je(e){var t=P(e),n=t.year||0,i=t.quarter||0,r=t.month||0,o=t.week||0,s=t.day||0,a=t.hour||0,l=t.minute||0,c=t.second||0,u=t.millisecond||0;this._milliseconds=+u+1e3*c+6e4*l+1e3*a*60*60,this._days=+s+7*o,this._months=+r+3*i+12*n,this._data={},this._locale=O(),this._bubble()}function Fe(e){return e instanceof je}function We(e,t){q(e,0,0,function(){var e=this.utcOffset(),n="+";return 0>e&&(e=-e,n="-"),n+W(~~(e/60),2)+t+W(~~e%60,2)})}function qe(e,t){var n=(t||"").match(e)||[],i=n[n.length-1]||[],r=(i+"").match(cr)||["-",0,0],o=+(60*r[1])+v(r[2]);return"+"===r[0]?o:-o}function ze(t,n){var r,o;return n._isUTC?(r=n.clone(),o=(m(t)||i(t)?t.valueOf():Re(t).valueOf())-r.valueOf(),r._d.setTime(r._d.valueOf()+o),e.updateOffset(r,!1),r):Re(t).local()}function Ye(e){return 15*-Math.round(e._d.getTimezoneOffset()/15)}function Ue(t,n){var i,r=this._offset||0;return this.isValid()?null!=t?("string"==typeof t?t=qe(Ni,t):Math.abs(t)<16&&(t=60*t),!this._isUTC&&n&&(i=Ye(this)),this._offset=t,this._isUTC=!0,null!=i&&this.add(i,"m"),r!==t&&(!n||this._changeInProgress?ct(this,it(t-r,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,e.updateOffset(this,!0),this._changeInProgress=null)),this):this._isUTC?r:Ye(this):null!=t?this:NaN}function Ve(e,t){return null!=e?("string"!=typeof e&&(e=-e),this.utcOffset(e,t),this):-this.utcOffset()}function Ge(e){return this.utcOffset(0,e)}function Xe(e){return this._isUTC&&(this.utcOffset(0,e),this._isUTC=!1,e&&this.subtract(Ye(this),"m")),this}function Ze(){return this._tzm?this.utcOffset(this._tzm):"string"==typeof this._i&&this.utcOffset(qe(Oi,this._i)),this}function Ke(e){return!!this.isValid()&&(e=e?Re(e).utcOffset():0,(this.utcOffset()-e)%60===0)}function Qe(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function Je(){if(!h(this._isDSTShifted))return this._isDSTShifted;var e={};if(f(e,this),e=Oe(e),e._a){var t=e._isUTC?a(e._a):Re(e._a);this._isDSTShifted=this.isValid()&&y(e._a,t.toArray())>0}else this._isDSTShifted=!1;return this._isDSTShifted}function et(){return!!this.isValid()&&!this._isUTC}function tt(){return!!this.isValid()&&this._isUTC}function nt(){return!!this.isValid()&&(this._isUTC&&0===this._offset)}function it(e,t){var n,i,r,s=e,a=null;return Fe(e)?s={ms:e._milliseconds,d:e._days,M:e._months}:"number"==typeof e?(s={},t?s[t]=e:s.milliseconds=e):(a=ur.exec(e))?(n="-"===a[1]?-1:1,s={y:0,d:v(a[Fi])*n,h:v(a[Wi])*n,m:v(a[qi])*n,s:v(a[zi])*n,ms:v(a[Yi])*n}):(a=dr.exec(e))?(n="-"===a[1]?-1:1,s={y:rt(a[2],n),M:rt(a[3],n),w:rt(a[4],n),d:rt(a[5],n),h:rt(a[6],n),m:rt(a[7],n),s:rt(a[8],n)}):null==s?s={}:"object"==typeof s&&("from"in s||"to"in s)&&(r=st(Re(s.from),Re(s.to)),s={},s.ms=r.milliseconds,s.M=r.months),i=new je(s),Fe(e)&&o(e,"_locale")&&(i._locale=e._locale),i}function rt(e,t){var n=e&&parseFloat(e.replace(",","."));return(isNaN(n)?0:n)*t}function ot(e,t){var n={milliseconds:0,months:0};return n.months=t.month()-e.month()+12*(t.year()-e.year()),e.clone().add(n.months,"M").isAfter(t)&&--n.months,n.milliseconds=+t-+e.clone().add(n.months,"M"),n}function st(e,t){var n;return e.isValid()&&t.isValid()?(t=ze(t,e),e.isBefore(t)?n=ot(e,t):(n=ot(t,e),n.milliseconds=-n.milliseconds,n.months=-n.months),n):{milliseconds:0,months:0}}function at(e){return 0>e?-1*Math.round(-1*e):Math.round(e)}function lt(e,t){return function(n,i){var r,o;return null===i||isNaN(+i)||(w(t,"moment()."+t+"(period, number) is deprecated. Please use moment()."+t+"(number, period)."),o=n,n=i,i=o),n="string"==typeof n?+n:n,r=it(n,i),ct(this,r,e),this}}function ct(t,n,i,r){var o=n._milliseconds,s=at(n._days),a=at(n._months);t.isValid()&&(r=null==r||r,o&&t._d.setTime(t._d.valueOf()+o*i),s&&j(t,"Date",B(t,"Date")+s*i),a&&se(t,B(t,"Month")+a*i),r&&e.updateOffset(t,s||a))}function ut(e,t){var n=e||Re(),i=ze(n,this).startOf("day"),r=this.diff(i,"days",!0),o=-6>r?"sameElse":-1>r?"lastWeek":0>r?"lastDay":1>r?"sameDay":2>r?"nextDay":7>r?"nextWeek":"sameElse",s=t&&(C(t[o])?t[o]():t[o]);return this.format(s||this.localeData().calendar(o,this,Re(n)))}function dt(){return new p(this)}function ht(e,t){var n=m(e)?e:Re(e);return!(!this.isValid()||!n.isValid())&&(t=R(h(t)?"millisecond":t),"millisecond"===t?this.valueOf()>n.valueOf():n.valueOf()<this.clone().startOf(t).valueOf())}function ft(e,t){var n=m(e)?e:Re(e);return!(!this.isValid()||!n.isValid())&&(t=R(h(t)?"millisecond":t),"millisecond"===t?this.valueOf()<n.valueOf():this.clone().endOf(t).valueOf()<n.valueOf())}function pt(e,t,n,i){return i=i||"()",("("===i[0]?this.isAfter(e,n):!this.isBefore(e,n))&&(")"===i[1]?this.isBefore(t,n):!this.isAfter(t,n))}function mt(e,t){var n,i=m(e)?e:Re(e);return!(!this.isValid()||!i.isValid())&&(t=R(t||"millisecond"),"millisecond"===t?this.valueOf()===i.valueOf():(n=i.valueOf(),this.clone().startOf(t).valueOf()<=n&&n<=this.clone().endOf(t).valueOf()))}function gt(e,t){return this.isSame(e,t)||this.isAfter(e,t)}function vt(e,t){return this.isSame(e,t)||this.isBefore(e,t)}function yt(e,t,n){var i,r,o,s;return this.isValid()?(i=ze(e,this),i.isValid()?(r=6e4*(i.utcOffset()-this.utcOffset()),t=R(t),"year"===t||"month"===t||"quarter"===t?(s=bt(this,i),"quarter"===t?s/=3:"year"===t&&(s/=12)):(o=this-i,s="second"===t?o/1e3:"minute"===t?o/6e4:"hour"===t?o/36e5:"day"===t?(o-r)/864e5:"week"===t?(o-r)/6048e5:o),n?s:g(s)):NaN):NaN}function bt(e,t){var n,i,r=12*(t.year()-e.year())+(t.month()-e.month()),o=e.clone().add(r,"months");return 0>t-o?(n=e.clone().add(r-1,"months"),i=(t-o)/(o-n)):(n=e.clone().add(r+1,"months"),i=(t-o)/(n-o)),-(r+i)||0}function xt(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function wt(){var e=this.clone().utc();return 0<e.year()&&e.year()<=9999?C(Date.prototype.toISOString)?this.toDate().toISOString():U(e,"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]"):U(e,"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]")}function Ct(t){t||(t=this.isUtc()?e.defaultFormatUtc:e.defaultFormat);var n=U(this,t);return this.localeData().postformat(n)}function kt(e,t){return this.isValid()&&(m(e)&&e.isValid()||Re(e).isValid())?it({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function _t(e){return this.from(Re(),e)}function St(e,t){return this.isValid()&&(m(e)&&e.isValid()||Re(e).isValid())?it({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function Tt(e){return this.to(Re(),e)}function Dt(e){var t;return void 0===e?this._locale._abbr:(t=O(e),null!=t&&(this._locale=t),this)}function Mt(){return this._locale}function Et(e){switch(e=R(e)){case"year":this.month(0);case"quarter":case"month":this.date(1);case"week":case"isoWeek":case"day":case"date":this.hours(0);case"hour":this.minutes(0);case"minute":this.seconds(0);case"second":this.milliseconds(0)}return"week"===e&&this.weekday(0),"isoWeek"===e&&this.isoWeekday(1),"quarter"===e&&this.month(3*Math.floor(this.month()/3)),this}function Lt(e){return e=R(e),void 0===e||"millisecond"===e?this:("date"===e&&(e="day"),this.startOf(e).add(1,"isoWeek"===e?"week":e).subtract(1,"ms"))}function At(){return this._d.valueOf()-6e4*(this._offset||0)}function $t(){return Math.floor(this.valueOf()/1e3)}function Ot(){return this._offset?new Date(this.valueOf()):this._d}function Nt(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]}function It(){var e=this;return{years:e.year(),months:e.month(),date:e.date(),hours:e.hours(),minutes:e.minutes(),seconds:e.seconds(),milliseconds:e.milliseconds()}}function Rt(){return this.isValid()?this.toISOString():null}function Pt(){return u(this)}function Ht(){return s({},c(this))}function Bt(){return c(this).overflow}function jt(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}function Ft(e,t){q(0,[e,e.length],0,t)}function Wt(e){return Ut.call(this,e,this.week(),this.weekday(),this.localeData()._week.dow,this.localeData()._week.doy)}function qt(e){return Ut.call(this,e,this.isoWeek(),this.isoWeekday(),1,4)}function zt(){return ke(this.year(),1,4)}function Yt(){var e=this.localeData()._week;return ke(this.year(),e.dow,e.doy)}function Ut(e,t,n,i,r){var o;return null==e?Ce(this,i,r).year:(o=ke(e,i,r),t>o&&(t=o),Vt.call(this,e,t,n,i,r))}function Vt(e,t,n,i,r){var o=we(e,t,n,i,r),s=ge(o.year,0,o.dayOfYear);return this.year(s.getUTCFullYear()),this.month(s.getUTCMonth()),this.date(s.getUTCDate()),this}function Gt(e){return null==e?Math.ceil((this.month()+1)/3):this.month(3*(e-1)+this.month()%3)}function Xt(e){return Ce(e,this._week.dow,this._week.doy).week}function Zt(){return this._week.dow}function Kt(){return this._week.doy}function Qt(e){var t=this.localeData().week(this);return null==e?t:this.add(7*(e-t),"d")}function Jt(e){var t=Ce(this,1,4).week;return null==e?t:this.add(7*(e-t),"d")}function en(e,t){return"string"!=typeof e?e:isNaN(e)?(e=t.weekdaysParse(e),"number"==typeof e?e:null):parseInt(e,10)}function tn(e,t){return n(this._weekdays)?this._weekdays[e.day()]:this._weekdays[this._weekdays.isFormat.test(t)?"format":"standalone"][e.day()]}function nn(e){return this._weekdaysShort[e.day()]}function rn(e){return this._weekdaysMin[e.day()]}function on(e,t,n){var i,r,o,s=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],i=0;7>i;++i)o=a([2e3,1]).day(i),this._minWeekdaysParse[i]=this.weekdaysMin(o,"").toLocaleLowerCase(),this._shortWeekdaysParse[i]=this.weekdaysShort(o,"").toLocaleLowerCase(),this._weekdaysParse[i]=this.weekdays(o,"").toLocaleLowerCase();return n?"dddd"===t?(r=fi.call(this._weekdaysParse,s),-1!==r?r:null):"ddd"===t?(r=fi.call(this._shortWeekdaysParse,s),-1!==r?r:null):(r=fi.call(this._minWeekdaysParse,s),-1!==r?r:null):"dddd"===t?(r=fi.call(this._weekdaysParse,s),-1!==r?r:(r=fi.call(this._shortWeekdaysParse,s),-1!==r?r:(r=fi.call(this._minWeekdaysParse,s),-1!==r?r:null))):"ddd"===t?(r=fi.call(this._shortWeekdaysParse,s),-1!==r?r:(r=fi.call(this._weekdaysParse,s),-1!==r?r:(r=fi.call(this._minWeekdaysParse,s),-1!==r?r:null))):(r=fi.call(this._minWeekdaysParse,s),-1!==r?r:(r=fi.call(this._weekdaysParse,s),-1!==r?r:(r=fi.call(this._shortWeekdaysParse,s),-1!==r?r:null)))}function sn(e,t,n){var i,r,o;if(this._weekdaysParseExact)return on.call(this,e,t,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),i=0;7>i;i++){if(r=a([2e3,1]).day(i),n&&!this._fullWeekdaysParse[i]&&(this._fullWeekdaysParse[i]=new RegExp("^"+this.weekdays(r,"").replace(".",".?")+"$","i"),this._shortWeekdaysParse[i]=new RegExp("^"+this.weekdaysShort(r,"").replace(".",".?")+"$","i"),this._minWeekdaysParse[i]=new RegExp("^"+this.weekdaysMin(r,"").replace(".",".?")+"$","i")),this._weekdaysParse[i]||(o="^"+this.weekdays(r,"")+"|^"+this.weekdaysShort(r,"")+"|^"+this.weekdaysMin(r,""),this._weekdaysParse[i]=new RegExp(o.replace(".",""),"i")),n&&"dddd"===t&&this._fullWeekdaysParse[i].test(e))return i;if(n&&"ddd"===t&&this._shortWeekdaysParse[i].test(e))return i;if(n&&"dd"===t&&this._minWeekdaysParse[i].test(e))return i;if(!n&&this._weekdaysParse[i].test(e))return i}}function an(e){if(!this.isValid())return null!=e?this:NaN;var t=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=e?(e=en(e,this.localeData()),this.add(e-t,"d")):t}function ln(e){if(!this.isValid())return null!=e?this:NaN;var t=(this.day()+7-this.localeData()._week.dow)%7;return null==e?t:this.add(e-t,"d")}function cn(e){return this.isValid()?null==e?this.day()||7:this.day(this.day()%7?e:e-7):null!=e?this:NaN}function un(e){return this._weekdaysParseExact?(o(this,"_weekdaysRegex")||fn.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex}function dn(e){return this._weekdaysParseExact?(o(this,"_weekdaysRegex")||fn.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex}function hn(e){return this._weekdaysParseExact?(o(this,"_weekdaysRegex")||fn.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex}function fn(){function e(e,t){return t.length-e.length}var t,n,i,r,o,s=[],l=[],c=[],u=[];for(t=0;7>t;t++)n=a([2e3,1]).day(t),i=this.weekdaysMin(n,""),r=this.weekdaysShort(n,""),o=this.weekdays(n,""),s.push(i),l.push(r),c.push(o),u.push(i),u.push(r),u.push(o);for(s.sort(e),l.sort(e),c.sort(e),u.sort(e),t=0;7>t;t++)l[t]=K(l[t]),c[t]=K(c[t]),u[t]=K(u[t]);this._weekdaysRegex=new RegExp("^("+u.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+c.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+l.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+s.join("|")+")","i")}function pn(e){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==e?t:this.add(e-t,"d")}function mn(){return this.hours()%12||12}function gn(){return this.hours()||24}function vn(e,t){q(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}function yn(e,t){return t._meridiemParse}function bn(e){return"p"===(e+"").toLowerCase().charAt(0)}function xn(e,t,n){return e>11?n?"pm":"PM":n?"am":"AM"}function wn(e,t){t[Yi]=v(1e3*("0."+e))}function Cn(){return this._isUTC?"UTC":""}function kn(){return this._isUTC?"Coordinated Universal Time":""}function _n(e){return Re(1e3*e)}function Sn(){return Re.apply(null,arguments).parseZone()}function Tn(e,t,n){var i=this._calendar[e];return C(i)?i.call(t,n):i}function Dn(e){var t=this._longDateFormat[e],n=this._longDateFormat[e.toUpperCase()];return t||!n?t:(this._longDateFormat[e]=n.replace(/MMMM|MM|DD|dddd/g,function(e){return e.slice(1)}),this._longDateFormat[e])}function Mn(){return this._invalidDate}function En(e){return this._ordinal.replace("%d",e)}function Ln(e){return e}function An(e,t,n,i){var r=this._relativeTime[n];return C(r)?r(e,t,n,i):r.replace(/%d/i,e)}function $n(e,t){var n=this._relativeTime[e>0?"future":"past"];return C(n)?n(t):n.replace(/%s/i,t)}function On(e,t,n,i){var r=O(),o=a().set(i,t);return r[n](o,e)}function Nn(e,t,n){if("number"==typeof e&&(t=e,e=void 0),e=e||"",null!=t)return On(e,t,n,"month");var i,r=[];for(i=0;12>i;i++)r[i]=On(e,i,n,"month");return r}function In(e,t,n,i){"boolean"==typeof e?("number"==typeof t&&(n=t,t=void 0),t=t||""):(t=e,n=t,e=!1,"number"==typeof t&&(n=t,t=void 0),t=t||"");var r=O(),o=e?r._week.dow:0;if(null!=n)return On(t,(n+o)%7,i,"day");var s,a=[];for(s=0;7>s;s++)a[s]=On(t,(s+o)%7,i,"day");return a}function Rn(e,t){return Nn(e,t,"months")}function Pn(e,t){return Nn(e,t,"monthsShort")}function Hn(e,t,n){return In(e,t,n,"weekdays")}function Bn(e,t,n){return In(e,t,n,"weekdaysShort")}function jn(e,t,n){return In(e,t,n,"weekdaysMin")}function Fn(){var e=this._data;return this._milliseconds=Hr(this._milliseconds),this._days=Hr(this._days),this._months=Hr(this._months),e.milliseconds=Hr(e.milliseconds),e.seconds=Hr(e.seconds),e.minutes=Hr(e.minutes),e.hours=Hr(e.hours),e.months=Hr(e.months),e.years=Hr(e.years),this}function Wn(e,t,n,i){var r=it(t,n);return e._milliseconds+=i*r._milliseconds,e._days+=i*r._days,e._months+=i*r._months,e._bubble()}function qn(e,t){return Wn(this,e,t,1)}function zn(e,t){return Wn(this,e,t,-1)}function Yn(e){return 0>e?Math.floor(e):Math.ceil(e)}function Un(){var e,t,n,i,r,o=this._milliseconds,s=this._days,a=this._months,l=this._data;return o>=0&&s>=0&&a>=0||0>=o&&0>=s&&0>=a||(o+=864e5*Yn(Gn(a)+s),s=0,a=0),l.milliseconds=o%1e3,e=g(o/1e3),l.seconds=e%60,t=g(e/60),l.minutes=t%60,n=g(t/60),l.hours=n%24,s+=g(n/24),r=g(Vn(s)),a+=r,s-=Yn(Gn(r)),i=g(a/12),a%=12,l.days=s,l.months=a,l.years=i,this}function Vn(e){return 4800*e/146097}function Gn(e){return 146097*e/4800}function Xn(e){var t,n,i=this._milliseconds;if(e=R(e),"month"===e||"year"===e)return t=this._days+i/864e5,n=this._months+Vn(t),"month"===e?n:n/12;switch(t=this._days+Math.round(Gn(this._months)),e){case"week":return t/7+i/6048e5;case"day":return t+i/864e5;case"hour":return 24*t+i/36e5;case"minute":return 1440*t+i/6e4;case"second":return 86400*t+i/1e3;case"millisecond":return Math.floor(864e5*t)+i;default:throw new Error("Unknown unit "+e)}}function Zn(){return this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*v(this._months/12)}function Kn(e){return function(){return this.as(e)}}function Qn(e){return e=R(e),this[e+"s"]()}function Jn(e){return function(){return this._data[e]}}function ei(){return g(this.days()/7)}function ti(e,t,n,i,r){return r.relativeTime(t||1,!!n,e,i)}function ni(e,t,n){var i=it(e).abs(),r=eo(i.as("s")),o=eo(i.as("m")),s=eo(i.as("h")),a=eo(i.as("d")),l=eo(i.as("M")),c=eo(i.as("y")),u=r<to.s&&["s",r]||1>=o&&["m"]||o<to.m&&["mm",o]||1>=s&&["h"]||s<to.h&&["hh",s]||1>=a&&["d"]||a<to.d&&["dd",a]||1>=l&&["M"]||l<to.M&&["MM",l]||1>=c&&["y"]||["yy",c];return u[2]=t,u[3]=+e>0,u[4]=n,ti.apply(null,u)}function ii(e,t){return void 0!==to[e]&&(void 0===t?to[e]:(to[e]=t,!0))}function ri(e){var t=this.localeData(),n=ni(this,!e,t);return e&&(n=t.pastFuture(+this,n)),t.postformat(n)}function oi(){var e,t,n,i=no(this._milliseconds)/1e3,r=no(this._days),o=no(this._months);e=g(i/60),t=g(e/60),i%=60,e%=60,n=g(o/12),o%=12;var s=n,a=o,l=r,c=t,u=e,d=i,h=this.asSeconds();return h?(0>h?"-":"")+"P"+(s?s+"Y":"")+(a?a+"M":"")+(l?l+"D":"")+(c||u||d?"T":"")+(c?c+"H":"")+(u?u+"M":"")+(d?d+"S":""):"P0D"}var si,ai;ai=Array.prototype.some?Array.prototype.some:function(e){for(var t=Object(this),n=t.length>>>0,i=0;n>i;i++)if(i in t&&e.call(this,t[i],i,t))return!0;return!1};var li=e.momentProperties=[],ci=!1,ui={};e.suppressDeprecationWarnings=!1,e.deprecationHandler=null;var di;di=Object.keys?Object.keys:function(e){
  var t,n=[];for(t in e)o(e,t)&&n.push(t);return n};var hi,fi,pi={},mi={},gi=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,vi=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,yi={},bi={},xi=/\d/,wi=/\d\d/,Ci=/\d{3}/,ki=/\d{4}/,_i=/[+-]?\d{6}/,Si=/\d\d?/,Ti=/\d\d\d\d?/,Di=/\d\d\d\d\d\d?/,Mi=/\d{1,3}/,Ei=/\d{1,4}/,Li=/[+-]?\d{1,6}/,Ai=/\d+/,$i=/[+-]?\d+/,Oi=/Z|[+-]\d\d:?\d\d/gi,Ni=/Z|[+-]\d\d(?::?\d\d)?/gi,Ii=/[+-]?\d+(\.\d{1,3})?/,Ri=/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i,Pi={},Hi={},Bi=0,ji=1,Fi=2,Wi=3,qi=4,zi=5,Yi=6,Ui=7,Vi=8;fi=Array.prototype.indexOf?Array.prototype.indexOf:function(e){var t;for(t=0;t<this.length;++t)if(this[t]===e)return t;return-1},q("M",["MM",2],"Mo",function(){return this.month()+1}),q("MMM",0,0,function(e){return this.localeData().monthsShort(this,e)}),q("MMMM",0,0,function(e){return this.localeData().months(this,e)}),I("month","M"),G("M",Si),G("MM",Si,wi),G("MMM",function(e,t){return t.monthsShortRegex(e)}),G("MMMM",function(e,t){return t.monthsRegex(e)}),Q(["M","MM"],function(e,t){t[ji]=v(e)-1}),Q(["MMM","MMMM"],function(e,t,n,i){var r=n._locale.monthsParse(e,i,n._strict);null!=r?t[ji]=r:c(n).invalidMonth=e});var Gi=/D[oD]?(\[[^\[\]]*\]|\s+)+MMMM?/,Xi="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),Zi="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),Ki=Ri,Qi=Ri,Ji=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?/,er=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?/,tr=/Z|[+-]\d\d(?::?\d\d)?/,nr=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/]],ir=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],rr=/^\/?Date\((\-?\d+)/i;e.createFromInputFallback=x("moment construction falls back to js Date. This is discouraged and will be removed in upcoming major release. Please refer to https://github.com/moment/moment/issues/1407 for more info.",function(e){e._d=new Date(e._i+(e._useUTC?" UTC":""))}),q("Y",0,0,function(){var e=this.year();return 9999>=e?""+e:"+"+e}),q(0,["YY",2],0,function(){return this.year()%100}),q(0,["YYYY",4],0,"year"),q(0,["YYYYY",5],0,"year"),q(0,["YYYYYY",6,!0],0,"year"),I("year","y"),G("Y",$i),G("YY",Si,wi),G("YYYY",Ei,ki),G("YYYYY",Li,_i),G("YYYYYY",Li,_i),Q(["YYYYY","YYYYYY"],Bi),Q("YYYY",function(t,n){n[Bi]=2===t.length?e.parseTwoDigitYear(t):v(t)}),Q("YY",function(t,n){n[Bi]=e.parseTwoDigitYear(t)}),Q("Y",function(e,t){t[Bi]=parseInt(e,10)}),e.parseTwoDigitYear=function(e){return v(e)+(v(e)>68?1900:2e3)};var or=H("FullYear",!0);e.ISO_8601=function(){};var sr=x("moment().min is deprecated, use moment.max instead. https://github.com/moment/moment/issues/1548",function(){var e=Re.apply(null,arguments);return this.isValid()&&e.isValid()?this>e?this:e:d()}),ar=x("moment().max is deprecated, use moment.min instead. https://github.com/moment/moment/issues/1548",function(){var e=Re.apply(null,arguments);return this.isValid()&&e.isValid()?e>this?this:e:d()}),lr=function(){return Date.now?Date.now():+new Date};We("Z",":"),We("ZZ",""),G("Z",Ni),G("ZZ",Ni),Q(["Z","ZZ"],function(e,t,n){n._useUTC=!0,n._tzm=qe(Ni,e)});var cr=/([\+\-]|\d\d)/gi;e.updateOffset=function(){};var ur=/^(\-)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?\d*)?$/,dr=/^(-)?P(?:(-?[0-9,.]*)Y)?(?:(-?[0-9,.]*)M)?(?:(-?[0-9,.]*)W)?(?:(-?[0-9,.]*)D)?(?:T(?:(-?[0-9,.]*)H)?(?:(-?[0-9,.]*)M)?(?:(-?[0-9,.]*)S)?)?$/;it.fn=je.prototype;var hr=lt(1,"add"),fr=lt(-1,"subtract");e.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",e.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";var pr=x("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(e){return void 0===e?this.localeData():this.locale(e)});q(0,["gg",2],0,function(){return this.weekYear()%100}),q(0,["GG",2],0,function(){return this.isoWeekYear()%100}),Ft("gggg","weekYear"),Ft("ggggg","weekYear"),Ft("GGGG","isoWeekYear"),Ft("GGGGG","isoWeekYear"),I("weekYear","gg"),I("isoWeekYear","GG"),G("G",$i),G("g",$i),G("GG",Si,wi),G("gg",Si,wi),G("GGGG",Ei,ki),G("gggg",Ei,ki),G("GGGGG",Li,_i),G("ggggg",Li,_i),J(["gggg","ggggg","GGGG","GGGGG"],function(e,t,n,i){t[i.substr(0,2)]=v(e)}),J(["gg","GG"],function(t,n,i,r){n[r]=e.parseTwoDigitYear(t)}),q("Q",0,"Qo","quarter"),I("quarter","Q"),G("Q",xi),Q("Q",function(e,t){t[ji]=3*(v(e)-1)}),q("w",["ww",2],"wo","week"),q("W",["WW",2],"Wo","isoWeek"),I("week","w"),I("isoWeek","W"),G("w",Si),G("ww",Si,wi),G("W",Si),G("WW",Si,wi),J(["w","ww","W","WW"],function(e,t,n,i){t[i.substr(0,1)]=v(e)});var mr={dow:0,doy:6};q("D",["DD",2],"Do","date"),I("date","D"),G("D",Si),G("DD",Si,wi),G("Do",function(e,t){return e?t._ordinalParse:t._ordinalParseLenient}),Q(["D","DD"],Fi),Q("Do",function(e,t){t[Fi]=v(e.match(Si)[0],10)});var gr=H("Date",!0);q("d",0,"do","day"),q("dd",0,0,function(e){return this.localeData().weekdaysMin(this,e)}),q("ddd",0,0,function(e){return this.localeData().weekdaysShort(this,e)}),q("dddd",0,0,function(e){return this.localeData().weekdays(this,e)}),q("e",0,0,"weekday"),q("E",0,0,"isoWeekday"),I("day","d"),I("weekday","e"),I("isoWeekday","E"),G("d",Si),G("e",Si),G("E",Si),G("dd",function(e,t){return t.weekdaysMinRegex(e)}),G("ddd",function(e,t){return t.weekdaysShortRegex(e)}),G("dddd",function(e,t){return t.weekdaysRegex(e)}),J(["dd","ddd","dddd"],function(e,t,n,i){var r=n._locale.weekdaysParse(e,i,n._strict);null!=r?t.d=r:c(n).invalidWeekday=e}),J(["d","e","E"],function(e,t,n,i){t[i]=v(e)});var vr="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),yr="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),br="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),xr=Ri,wr=Ri,Cr=Ri;q("DDD",["DDDD",3],"DDDo","dayOfYear"),I("dayOfYear","DDD"),G("DDD",Mi),G("DDDD",Ci),Q(["DDD","DDDD"],function(e,t,n){n._dayOfYear=v(e)}),q("H",["HH",2],0,"hour"),q("h",["hh",2],0,mn),q("k",["kk",2],0,gn),q("hmm",0,0,function(){return""+mn.apply(this)+W(this.minutes(),2)}),q("hmmss",0,0,function(){return""+mn.apply(this)+W(this.minutes(),2)+W(this.seconds(),2)}),q("Hmm",0,0,function(){return""+this.hours()+W(this.minutes(),2)}),q("Hmmss",0,0,function(){return""+this.hours()+W(this.minutes(),2)+W(this.seconds(),2)}),vn("a",!0),vn("A",!1),I("hour","h"),G("a",yn),G("A",yn),G("H",Si),G("h",Si),G("HH",Si,wi),G("hh",Si,wi),G("hmm",Ti),G("hmmss",Di),G("Hmm",Ti),G("Hmmss",Di),Q(["H","HH"],Wi),Q(["a","A"],function(e,t,n){n._isPm=n._locale.isPM(e),n._meridiem=e}),Q(["h","hh"],function(e,t,n){t[Wi]=v(e),c(n).bigHour=!0}),Q("hmm",function(e,t,n){var i=e.length-2;t[Wi]=v(e.substr(0,i)),t[qi]=v(e.substr(i)),c(n).bigHour=!0}),Q("hmmss",function(e,t,n){var i=e.length-4,r=e.length-2;t[Wi]=v(e.substr(0,i)),t[qi]=v(e.substr(i,2)),t[zi]=v(e.substr(r)),c(n).bigHour=!0}),Q("Hmm",function(e,t,n){var i=e.length-2;t[Wi]=v(e.substr(0,i)),t[qi]=v(e.substr(i))}),Q("Hmmss",function(e,t,n){var i=e.length-4,r=e.length-2;t[Wi]=v(e.substr(0,i)),t[qi]=v(e.substr(i,2)),t[zi]=v(e.substr(r))});var kr=/[ap]\.?m?\.?/i,_r=H("Hours",!0);q("m",["mm",2],0,"minute"),I("minute","m"),G("m",Si),G("mm",Si,wi),Q(["m","mm"],qi);var Sr=H("Minutes",!1);q("s",["ss",2],0,"second"),I("second","s"),G("s",Si),G("ss",Si,wi),Q(["s","ss"],zi);var Tr=H("Seconds",!1);q("S",0,0,function(){return~~(this.millisecond()/100)}),q(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),q(0,["SSS",3],0,"millisecond"),q(0,["SSSS",4],0,function(){return 10*this.millisecond()}),q(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),q(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),q(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),q(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),q(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),I("millisecond","ms"),G("S",Mi,xi),G("SS",Mi,wi),G("SSS",Mi,Ci);var Dr;for(Dr="SSSS";Dr.length<=9;Dr+="S")G(Dr,Ai);for(Dr="S";Dr.length<=9;Dr+="S")Q(Dr,wn);var Mr=H("Milliseconds",!1);q("z",0,0,"zoneAbbr"),q("zz",0,0,"zoneName");var Er=p.prototype;Er.add=hr,Er.calendar=ut,Er.clone=dt,Er.diff=yt,Er.endOf=Lt,Er.format=Ct,Er.from=kt,Er.fromNow=_t,Er.to=St,Er.toNow=Tt,Er.get=F,Er.invalidAt=Bt,Er.isAfter=ht,Er.isBefore=ft,Er.isBetween=pt,Er.isSame=mt,Er.isSameOrAfter=gt,Er.isSameOrBefore=vt,Er.isValid=Pt,Er.lang=pr,Er.locale=Dt,Er.localeData=Mt,Er.max=ar,Er.min=sr,Er.parsingFlags=Ht,Er.set=F,Er.startOf=Et,Er.subtract=fr,Er.toArray=Nt,Er.toObject=It,Er.toDate=Ot,Er.toISOString=wt,Er.toJSON=Rt,Er.toString=xt,Er.unix=$t,Er.valueOf=At,Er.creationData=jt,Er.year=or,Er.isLeapYear=be,Er.weekYear=Wt,Er.isoWeekYear=qt,Er.quarter=Er.quarters=Gt,Er.month=ae,Er.daysInMonth=le,Er.week=Er.weeks=Qt,Er.isoWeek=Er.isoWeeks=Jt,Er.weeksInYear=Yt,Er.isoWeeksInYear=zt,Er.date=gr,Er.day=Er.days=an,Er.weekday=ln,Er.isoWeekday=cn,Er.dayOfYear=pn,Er.hour=Er.hours=_r,Er.minute=Er.minutes=Sr,Er.second=Er.seconds=Tr,Er.millisecond=Er.milliseconds=Mr,Er.utcOffset=Ue,Er.utc=Ge,Er.local=Xe,Er.parseZone=Ze,Er.hasAlignedHourOffset=Ke,Er.isDST=Qe,Er.isDSTShifted=Je,Er.isLocal=et,Er.isUtcOffset=tt,Er.isUtc=nt,Er.isUTC=nt,Er.zoneAbbr=Cn,Er.zoneName=kn,Er.dates=x("dates accessor is deprecated. Use date instead.",gr),Er.months=x("months accessor is deprecated. Use month instead",ae),Er.years=x("years accessor is deprecated. Use year instead",or),Er.zone=x("moment().zone is deprecated, use moment().utcOffset instead. https://github.com/moment/moment/issues/1779",Ve);var Lr=Er,Ar={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},$r={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},Or="Invalid date",Nr="%d",Ir=/\d{1,2}/,Rr={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},Pr=T.prototype;Pr._calendar=Ar,Pr.calendar=Tn,Pr._longDateFormat=$r,Pr.longDateFormat=Dn,Pr._invalidDate=Or,Pr.invalidDate=Mn,Pr._ordinal=Nr,Pr.ordinal=En,Pr._ordinalParse=Ir,Pr.preparse=Ln,Pr.postformat=Ln,Pr._relativeTime=Rr,Pr.relativeTime=An,Pr.pastFuture=$n,Pr.set=_,Pr.months=ne,Pr._months=Xi,Pr.monthsShort=ie,Pr._monthsShort=Zi,Pr.monthsParse=oe,Pr._monthsRegex=Qi,Pr.monthsRegex=ue,Pr._monthsShortRegex=Ki,Pr.monthsShortRegex=ce,Pr.week=Xt,Pr._week=mr,Pr.firstDayOfYear=Kt,Pr.firstDayOfWeek=Zt,Pr.weekdays=tn,Pr._weekdays=vr,Pr.weekdaysMin=rn,Pr._weekdaysMin=br,Pr.weekdaysShort=nn,Pr._weekdaysShort=yr,Pr.weekdaysParse=sn,Pr._weekdaysRegex=xr,Pr.weekdaysRegex=un,Pr._weekdaysShortRegex=wr,Pr.weekdaysShortRegex=dn,Pr._weekdaysMinRegex=Cr,Pr.weekdaysMinRegex=hn,Pr.isPM=bn,Pr._meridiemParse=kr,Pr.meridiem=xn,L("en",{ordinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10,n=1===v(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th";return e+n}}),e.lang=x("moment.lang is deprecated. Use moment.locale instead.",L),e.langData=x("moment.langData is deprecated. Use moment.localeData instead.",O);var Hr=Math.abs,Br=Kn("ms"),jr=Kn("s"),Fr=Kn("m"),Wr=Kn("h"),qr=Kn("d"),zr=Kn("w"),Yr=Kn("M"),Ur=Kn("y"),Vr=Jn("milliseconds"),Gr=Jn("seconds"),Xr=Jn("minutes"),Zr=Jn("hours"),Kr=Jn("days"),Qr=Jn("months"),Jr=Jn("years"),eo=Math.round,to={s:45,m:45,h:22,d:26,M:11},no=Math.abs,io=je.prototype;io.abs=Fn,io.add=qn,io.subtract=zn,io.as=Xn,io.asMilliseconds=Br,io.asSeconds=jr,io.asMinutes=Fr,io.asHours=Wr,io.asDays=qr,io.asWeeks=zr,io.asMonths=Yr,io.asYears=Ur,io.valueOf=Zn,io._bubble=Un,io.get=Qn,io.milliseconds=Vr,io.seconds=Gr,io.minutes=Xr,io.hours=Zr,io.days=Kr,io.weeks=ei,io.months=Qr,io.years=Jr,io.humanize=ri,io.toISOString=oi,io.toString=oi,io.toJSON=oi,io.locale=Dt,io.localeData=Mt,io.toIsoString=x("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",oi),io.lang=pr,q("X",0,0,"unix"),q("x",0,0,"valueOf"),G("x",$i),G("X",Ii),Q("X",function(e,t,n){n._d=new Date(1e3*parseFloat(e,10))}),Q("x",function(e,t,n){n._d=new Date(v(e))}),e.version="2.13.0",t(Re),e.fn=Lr,e.min=He,e.max=Be,e.now=lr,e.utc=a,e.unix=_n,e.months=Rn,e.isDate=i,e.locale=L,e.invalid=d,e.duration=it,e.isMoment=m,e.weekdays=Hn,e.parseZone=Sn,e.localeData=O,e.isDuration=Fe,e.monthsShort=Pn,e.weekdaysMin=jn,e.defineLocale=A,e.updateLocale=$,e.locales=N,e.weekdaysShort=Bn,e.normalizeUnits=R,e.relativeTimeThreshold=ii,e.prototype=Lr;var ro=e;return ro}),!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.SimpleMDE=e()}}(function(){var e;return function t(e,n,i){function r(s,a){if(!n[s]){if(!e[s]){var l="function"==typeof require&&require;if(!a&&l)return l(s,!0);if(o)return o(s,!0);var c=new Error("Cannot find module '"+s+"'");throw c.code="MODULE_NOT_FOUND",c}var u=n[s]={exports:{}};e[s][0].call(u.exports,function(t){var n=e[s][1][t];return r(n?n:t)},u,u.exports,t,e,n,i)}return n[s].exports}for(var o="function"==typeof require&&require,s=0;s<i.length;s++)r(i[s]);return r}({1:[function(e,t,n){"use strict";function i(){for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=0,n=e.length;n>t;++t)l[t]=e[t],c[e.charCodeAt(t)]=t;c["-".charCodeAt(0)]=62,c["_".charCodeAt(0)]=63}function r(e){var t,n,i,r,o,s,a=e.length;if(a%4>0)throw new Error("Invalid string. Length must be a multiple of 4");o="="===e[a-2]?2:"="===e[a-1]?1:0,s=new u(3*a/4-o),i=o>0?a-4:a;var l=0;for(t=0,n=0;i>t;t+=4,n+=3)r=c[e.charCodeAt(t)]<<18|c[e.charCodeAt(t+1)]<<12|c[e.charCodeAt(t+2)]<<6|c[e.charCodeAt(t+3)],s[l++]=r>>16&255,s[l++]=r>>8&255,s[l++]=255&r;return 2===o?(r=c[e.charCodeAt(t)]<<2|c[e.charCodeAt(t+1)]>>4,s[l++]=255&r):1===o&&(r=c[e.charCodeAt(t)]<<10|c[e.charCodeAt(t+1)]<<4|c[e.charCodeAt(t+2)]>>2,s[l++]=r>>8&255,s[l++]=255&r),s}function o(e){return l[e>>18&63]+l[e>>12&63]+l[e>>6&63]+l[63&e]}function s(e,t,n){for(var i,r=[],s=t;n>s;s+=3)i=(e[s]<<16)+(e[s+1]<<8)+e[s+2],r.push(o(i));return r.join("")}function a(e){for(var t,n=e.length,i=n%3,r="",o=[],a=16383,c=0,u=n-i;u>c;c+=a)o.push(s(e,c,c+a>u?u:c+a));return 1===i?(t=e[n-1],r+=l[t>>2],r+=l[t<<4&63],r+="=="):2===i&&(t=(e[n-2]<<8)+e[n-1],r+=l[t>>10],r+=l[t>>4&63],r+=l[t<<2&63],r+="="),o.push(r),o.join("")}n.toByteArray=r,n.fromByteArray=a;var l=[],c=[],u="undefined"!=typeof Uint8Array?Uint8Array:Array;i()},{}],2:[function(e,t,n){},{}],3:[function(e,t,n){(function(t){"use strict";function i(){try{var e=new Uint8Array(1);return e.foo=function(){return 42},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(t){return!1}}function r(){return s.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function o(e,t){if(r()<t)throw new RangeError("Invalid typed array length");return s.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t),e.__proto__=s.prototype):(null===e&&(e=new s(t)),e.length=t),e}function s(e,t,n){if(!(s.TYPED_ARRAY_SUPPORT||this instanceof s))return new s(e,t,n);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return u(this,e)}return a(this,e,t,n)}function a(e,t,n,i){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?f(e,t,n,i):"string"==typeof t?d(e,t,n):p(e,t)}function l(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number')}function c(e,t,n,i){return l(t),0>=t?o(e,t):void 0!==n?"string"==typeof i?o(e,t).fill(n,i):o(e,t).fill(n):o(e,t)}function u(e,t){if(l(t),e=o(e,0>t?0:0|m(t)),!s.TYPED_ARRAY_SUPPORT)for(var n=0;t>n;n++)e[n]=0;return e}function d(e,t,n){if("string"==typeof n&&""!==n||(n="utf8"),!s.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var i=0|v(t,n);return e=o(e,i),e.write(t,n),e}function h(e,t){var n=0|m(t.length);e=o(e,n);for(var i=0;n>i;i+=1)e[i]=255&t[i];return e}function f(e,t,n,i){if(t.byteLength,0>n||t.byteLength<n)throw new RangeError("'offset' is out of bounds");if(t.byteLength<n+(i||0))throw new RangeError("'length' is out of bounds");return t=void 0===i?new Uint8Array(t,n):new Uint8Array(t,n,i),s.TYPED_ARRAY_SUPPORT?(e=t,e.__proto__=s.prototype):e=h(e,t),e}function p(e,t){if(s.isBuffer(t)){var n=0|m(t.length);return e=o(e,n),0===e.length?e:(t.copy(e,0,0,n),e)}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||X(t.length)?o(e,0):h(e,t);if("Buffer"===t.type&&Q(t.data))return h(e,t.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function m(e){if(e>=r())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+r().toString(16)+" bytes");return 0|e}function g(e){return+e!=e&&(e=0),s.alloc(+e)}function v(e,t){if(s.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var i=!1;;)switch(t){case"ascii":case"binary":case"raw":case"raws":return n;case"utf8":case"utf-8":case void 0:return z(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return V(e).length;default:if(i)return z(e).length;t=(""+t).toLowerCase(),i=!0}}function y(e,t,n){var i=!1;if((void 0===t||0>t)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),0>=n)return"";if(n>>>=0,t>>>=0,t>=n)return"";for(e||(e="utf8");;)switch(e){case"hex":return $(this,t,n);case"utf8":case"utf-8":return M(this,t,n);case"ascii":return L(this,t,n);case"binary":return A(this,t,n);case"base64":return D(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O(this,t,n);default:if(i)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),i=!0}}function b(e,t,n){var i=e[t];e[t]=e[n],e[n]=i}function x(e,t,n,i){function r(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}var o=1,s=e.length,a=t.length;if(void 0!==i&&(i=String(i).toLowerCase(),"ucs2"===i||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(e.length<2||t.length<2)return-1;o=2,s/=2,a/=2,n/=2}for(var l=-1,c=0;s>n+c;c++)if(r(e,n+c)===r(t,-1===l?0:c-l)){if(-1===l&&(l=c),c-l+1===a)return(n+l)*o}else-1!==l&&(c-=c-l),l=-1;return-1}function w(e,t,n,i){n=Number(n)||0;var r=e.length-n;i?(i=Number(i),i>r&&(i=r)):i=r;var o=t.length;if(o%2!==0)throw new Error("Invalid hex string");i>o/2&&(i=o/2);for(var s=0;i>s;s++){var a=parseInt(t.substr(2*s,2),16);if(isNaN(a))return s;e[n+s]=a}return s}function C(e,t,n,i){return G(z(t,e.length-n),e,n,i)}function k(e,t,n,i){return G(Y(t),e,n,i)}function _(e,t,n,i){return k(e,t,n,i)}function S(e,t,n,i){return G(V(t),e,n,i)}function T(e,t,n,i){return G(U(t,e.length-n),e,n,i)}function D(e,t,n){return 0===t&&n===e.length?Z.fromByteArray(e):Z.fromByteArray(e.slice(t,n))}function M(e,t,n){n=Math.min(e.length,n);for(var i=[],r=t;n>r;){var o=e[r],s=null,a=o>239?4:o>223?3:o>191?2:1;if(n>=r+a){var l,c,u,d;switch(a){case 1:128>o&&(s=o);break;case 2:l=e[r+1],128===(192&l)&&(d=(31&o)<<6|63&l,d>127&&(s=d));break;case 3:l=e[r+1],c=e[r+2],128===(192&l)&&128===(192&c)&&(d=(15&o)<<12|(63&l)<<6|63&c,d>2047&&(55296>d||d>57343)&&(s=d));break;case 4:l=e[r+1],c=e[r+2],u=e[r+3],128===(192&l)&&128===(192&c)&&128===(192&u)&&(d=(15&o)<<18|(63&l)<<12|(63&c)<<6|63&u,d>65535&&1114112>d&&(s=d))}}null===s?(s=65533,a=1):s>65535&&(s-=65536,i.push(s>>>10&1023|55296),s=56320|1023&s),i.push(s),r+=a}return E(i)}function E(e){var t=e.length;if(J>=t)return String.fromCharCode.apply(String,e);for(var n="",i=0;t>i;)n+=String.fromCharCode.apply(String,e.slice(i,i+=J));return n}function L(e,t,n){var i="";n=Math.min(e.length,n);for(var r=t;n>r;r++)i+=String.fromCharCode(127&e[r]);return i}function A(e,t,n){var i="";n=Math.min(e.length,n);for(var r=t;n>r;r++)i+=String.fromCharCode(e[r]);return i}function $(e,t,n){var i=e.length;(!t||0>t)&&(t=0),(!n||0>n||n>i)&&(n=i);for(var r="",o=t;n>o;o++)r+=q(e[o]);return r}function O(e,t,n){for(var i=e.slice(t,n),r="",o=0;o<i.length;o+=2)r+=String.fromCharCode(i[o]+256*i[o+1]);return r}function N(e,t,n){if(e%1!==0||0>e)throw new RangeError("offset is not uint");if(e+t>n)throw new RangeError("Trying to access beyond buffer length")}function I(e,t,n,i,r,o){if(!s.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>r||o>t)throw new RangeError('"value" argument is out of bounds');if(n+i>e.length)throw new RangeError("Index out of range")}function R(e,t,n,i){0>t&&(t=65535+t+1);for(var r=0,o=Math.min(e.length-n,2);o>r;r++)e[n+r]=(t&255<<8*(i?r:1-r))>>>8*(i?r:1-r)}function P(e,t,n,i){0>t&&(t=4294967295+t+1);for(var r=0,o=Math.min(e.length-n,4);o>r;r++)e[n+r]=t>>>8*(i?r:3-r)&255}function H(e,t,n,i,r,o){if(n+i>e.length)throw new RangeError("Index out of range");if(0>n)throw new RangeError("Index out of range")}function B(e,t,n,i,r){return r||H(e,t,n,4,3.4028234663852886e38,-3.4028234663852886e38),K.write(e,t,n,i,23,4),n+4}function j(e,t,n,i,r){return r||H(e,t,n,8,1.7976931348623157e308,-1.7976931348623157e308),K.write(e,t,n,i,52,8),n+8}function F(e){if(e=W(e).replace(ee,""),e.length<2)return"";for(;e.length%4!==0;)e+="=";return e}function W(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function q(e){return 16>e?"0"+e.toString(16):e.toString(16)}function z(e,t){t=t||1/0;for(var n,i=e.length,r=null,o=[],s=0;i>s;s++){if(n=e.charCodeAt(s),n>55295&&57344>n){if(!r){if(n>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(s+1===i){(t-=3)>-1&&o.push(239,191,189);continue}r=n;continue}if(56320>n){(t-=3)>-1&&o.push(239,191,189),r=n;continue}n=(r-55296<<10|n-56320)+65536}else r&&(t-=3)>-1&&o.push(239,191,189);if(r=null,128>n){if((t-=1)<0)break;o.push(n)}else if(2048>n){if((t-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(65536>n){if((t-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(1114112>n))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function Y(e){for(var t=[],n=0;n<e.length;n++)t.push(255&e.charCodeAt(n));return t}function U(e,t){for(var n,i,r,o=[],s=0;s<e.length&&!((t-=2)<0);s++)n=e.charCodeAt(s),i=n>>8,r=n%256,o.push(r),o.push(i);return o}function V(e){return Z.toByteArray(F(e))}function G(e,t,n,i){for(var r=0;i>r&&!(r+n>=t.length||r>=e.length);r++)t[r+n]=e[r];return r}function X(e){return e!==e}var Z=e("base64-js"),K=e("ieee754"),Q=e("isarray");n.Buffer=s,n.SlowBuffer=g,n.INSPECT_MAX_BYTES=50,s.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:i(),n.kMaxLength=r(),s.poolSize=8192,s._augment=function(e){return e.__proto__=s.prototype,e},s.from=function(e,t,n){return a(null,e,t,n)},s.TYPED_ARRAY_SUPPORT&&(s.prototype.__proto__=Uint8Array.prototype,s.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&s[Symbol.species]===s&&Object.defineProperty(s,Symbol.species,{value:null,configurable:!0})),s.alloc=function(e,t,n){return c(null,e,t,n)},s.allocUnsafe=function(e){return u(null,e)},s.allocUnsafeSlow=function(e){return u(null,e)},s.isBuffer=function(e){return!(null==e||!e._isBuffer)},s.compare=function(e,t){if(!s.isBuffer(e)||!s.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var n=e.length,i=t.length,r=0,o=Math.min(n,i);o>r;++r)if(e[r]!==t[r]){n=e[r],i=t[r];break}return i>n?-1:n>i?1:0},s.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"raw":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},s.concat=function(e,t){if(!Q(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return s.alloc(0);var n;if(void 0===t)for(t=0,n=0;n<e.length;n++)t+=e[n].length;var i=s.allocUnsafe(t),r=0;for(n=0;n<e.length;n++){var o=e[n];if(!s.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(i,r),r+=o.length}return i},s.byteLength=v,s.prototype._isBuffer=!0,s.prototype.swap16=function(){var e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;e>t;t+=2)b(this,t,t+1);return this},s.prototype.swap32=function(){var e=this.length;if(e%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;e>t;t+=4)b(this,t,t+3),b(this,t+1,t+2);return this},s.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?M(this,0,e):y.apply(this,arguments)},s.prototype.equals=function(e){if(!s.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===s.compare(this,e)},s.prototype.inspect=function(){var e="",t=n.INSPECT_MAX_BYTES;return this.length>0&&(e=this.toString("hex",0,t).match(/.{2}/g).join(" "),this.length>t&&(e+=" ... ")),"<Buffer "+e+">"},s.prototype.compare=function(e,t,n,i,r){if(!s.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===i&&(i=0),void 0===r&&(r=this.length),0>t||n>e.length||0>i||r>this.length)throw new RangeError("out of range index");if(i>=r&&t>=n)return 0;if(i>=r)return-1;if(t>=n)return 1;if(t>>>=0,n>>>=0,i>>>=0,r>>>=0,this===e)return 0;for(var o=r-i,a=n-t,l=Math.min(o,a),c=this.slice(i,r),u=e.slice(t,n),d=0;l>d;++d)if(c[d]!==u[d]){o=c[d],a=u[d];break}return a>o?-1:o>a?1:0},s.prototype.indexOf=function(e,t,n){if("string"==typeof t?(n=t,t=0):t>2147483647?t=2147483647:-2147483648>t&&(t=-2147483648),t>>=0,0===this.length)return-1;if(t>=this.length)return-1;if(0>t&&(t=Math.max(this.length+t,0)),"string"==typeof e&&(e=s.from(e,n)),s.isBuffer(e))return 0===e.length?-1:x(this,e,t,n);if("number"==typeof e)return s.TYPED_ARRAY_SUPPORT&&"function"===Uint8Array.prototype.indexOf?Uint8Array.prototype.indexOf.call(this,e,t):x(this,[e],t,n);throw new TypeError("val must be string, number or Buffer")},s.prototype.includes=function(e,t,n){return-1!==this.indexOf(e,t,n)},s.prototype.write=function(e,t,n,i){if(void 0===t)i="utf8",n=this.length,t=0;else if(void 0===n&&"string"==typeof t)i=t,n=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t=0|t,isFinite(n)?(n=0|n,void 0===i&&(i="utf8")):(i=n,n=void 0)}var r=this.length-t;if((void 0===n||n>r)&&(n=r),e.length>0&&(0>n||0>t)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var o=!1;;)switch(i){case"hex":return w(this,e,t,n);case"utf8":case"utf-8":return C(this,e,t,n);case"ascii":return k(this,e,t,n);case"binary":return _(this,e,t,n);case"base64":return S(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,e,t,n);default:if(o)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),o=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var J=4096;s.prototype.slice=function(e,t){var n=this.length;e=~~e,t=void 0===t?n:~~t,0>e?(e+=n,0>e&&(e=0)):e>n&&(e=n),0>t?(t+=n,0>t&&(t=0)):t>n&&(t=n),e>t&&(t=e);var i;if(s.TYPED_ARRAY_SUPPORT)i=this.subarray(e,t),i.__proto__=s.prototype;else{var r=t-e;i=new s(r,(void 0));for(var o=0;r>o;o++)i[o]=this[o+e]}return i},s.prototype.readUIntLE=function(e,t,n){e=0|e,t=0|t,n||N(e,t,this.length);for(var i=this[e],r=1,o=0;++o<t&&(r*=256);)i+=this[e+o]*r;return i},s.prototype.readUIntBE=function(e,t,n){e=0|e,t=0|t,n||N(e,t,this.length);for(var i=this[e+--t],r=1;t>0&&(r*=256);)i+=this[e+--t]*r;return i},s.prototype.readUInt8=function(e,t){return t||N(e,1,this.length),this[e]},s.prototype.readUInt16LE=function(e,t){return t||N(e,2,this.length),this[e]|this[e+1]<<8},s.prototype.readUInt16BE=function(e,t){return t||N(e,2,this.length),this[e]<<8|this[e+1]},s.prototype.readUInt32LE=function(e,t){return t||N(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},s.prototype.readUInt32BE=function(e,t){return t||N(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},s.prototype.readIntLE=function(e,t,n){e=0|e,t=0|t,n||N(e,t,this.length);for(var i=this[e],r=1,o=0;++o<t&&(r*=256);)i+=this[e+o]*r;return r*=128,i>=r&&(i-=Math.pow(2,8*t)),i},s.prototype.readIntBE=function(e,t,n){e=0|e,t=0|t,n||N(e,t,this.length);for(var i=t,r=1,o=this[e+--i];i>0&&(r*=256);)o+=this[e+--i]*r;return r*=128,o>=r&&(o-=Math.pow(2,8*t)),o},s.prototype.readInt8=function(e,t){return t||N(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},s.prototype.readInt16LE=function(e,t){t||N(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},s.prototype.readInt16BE=function(e,t){t||N(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},s.prototype.readInt32LE=function(e,t){return t||N(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},s.prototype.readInt32BE=function(e,t){return t||N(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},s.prototype.readFloatLE=function(e,t){return t||N(e,4,this.length),K.read(this,e,!0,23,4)},s.prototype.readFloatBE=function(e,t){return t||N(e,4,this.length),K.read(this,e,!1,23,4)},s.prototype.readDoubleLE=function(e,t){return t||N(e,8,this.length),K.read(this,e,!0,52,8)},s.prototype.readDoubleBE=function(e,t){return t||N(e,8,this.length),K.read(this,e,!1,52,8)},s.prototype.writeUIntLE=function(e,t,n,i){if(e=+e,t=0|t,n=0|n,!i){var r=Math.pow(2,8*n)-1;I(this,e,t,n,r,0)}var o=1,s=0;for(this[t]=255&e;++s<n&&(o*=256);)this[t+s]=e/o&255;return t+n},s.prototype.writeUIntBE=function(e,t,n,i){if(e=+e,t=0|t,n=0|n,!i){var r=Math.pow(2,8*n)-1;I(this,e,t,n,r,0)}var o=n-1,s=1;for(this[t+o]=255&e;--o>=0&&(s*=256);)this[t+o]=e/s&255;return t+n},s.prototype.writeUInt8=function(e,t,n){return e=+e,t=0|t,n||I(this,e,t,1,255,0),s.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},s.prototype.writeUInt16LE=function(e,t,n){return e=+e,t=0|t,n||I(this,e,t,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):R(this,e,t,!0),t+2},s.prototype.writeUInt16BE=function(e,t,n){return e=+e,t=0|t,n||I(this,e,t,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):R(this,e,t,!1),t+2},s.prototype.writeUInt32LE=function(e,t,n){return e=+e,t=0|t,n||I(this,e,t,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):P(this,e,t,!0),t+4},s.prototype.writeUInt32BE=function(e,t,n){return e=+e,t=0|t,n||I(this,e,t,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):P(this,e,t,!1),t+4},s.prototype.writeIntLE=function(e,t,n,i){if(e=+e,t=0|t,!i){var r=Math.pow(2,8*n-1);I(this,e,t,n,r-1,-r)}var o=0,s=1,a=0;for(this[t]=255&e;++o<n&&(s*=256);)0>e&&0===a&&0!==this[t+o-1]&&(a=1),this[t+o]=(e/s>>0)-a&255;return t+n},s.prototype.writeIntBE=function(e,t,n,i){if(e=+e,t=0|t,!i){var r=Math.pow(2,8*n-1);I(this,e,t,n,r-1,-r)}var o=n-1,s=1,a=0;for(this[t+o]=255&e;--o>=0&&(s*=256);)0>e&&0===a&&0!==this[t+o+1]&&(a=1),this[t+o]=(e/s>>0)-a&255;return t+n},s.prototype.writeInt8=function(e,t,n){return e=+e,t=0|t,n||I(this,e,t,1,127,-128),s.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),0>e&&(e=255+e+1),this[t]=255&e,t+1},s.prototype.writeInt16LE=function(e,t,n){
  return e=+e,t=0|t,n||I(this,e,t,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):R(this,e,t,!0),t+2},s.prototype.writeInt16BE=function(e,t,n){return e=+e,t=0|t,n||I(this,e,t,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):R(this,e,t,!1),t+2},s.prototype.writeInt32LE=function(e,t,n){return e=+e,t=0|t,n||I(this,e,t,4,2147483647,-2147483648),s.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):P(this,e,t,!0),t+4},s.prototype.writeInt32BE=function(e,t,n){return e=+e,t=0|t,n||I(this,e,t,4,2147483647,-2147483648),0>e&&(e=4294967295+e+1),s.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):P(this,e,t,!1),t+4},s.prototype.writeFloatLE=function(e,t,n){return B(this,e,t,!0,n)},s.prototype.writeFloatBE=function(e,t,n){return B(this,e,t,!1,n)},s.prototype.writeDoubleLE=function(e,t,n){return j(this,e,t,!0,n)},s.prototype.writeDoubleBE=function(e,t,n){return j(this,e,t,!1,n)},s.prototype.copy=function(e,t,n,i){if(n||(n=0),i||0===i||(i=this.length),t>=e.length&&(t=e.length),t||(t=0),i>0&&n>i&&(i=n),i===n)return 0;if(0===e.length||0===this.length)return 0;if(0>t)throw new RangeError("targetStart out of bounds");if(0>n||n>=this.length)throw new RangeError("sourceStart out of bounds");if(0>i)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-t<i-n&&(i=e.length-t+n);var r,o=i-n;if(this===e&&t>n&&i>t)for(r=o-1;r>=0;r--)e[r+t]=this[r+n];else if(1e3>o||!s.TYPED_ARRAY_SUPPORT)for(r=0;o>r;r++)e[r+t]=this[r+n];else Uint8Array.prototype.set.call(e,this.subarray(n,n+o),t);return o},s.prototype.fill=function(e,t,n,i){if("string"==typeof e){if("string"==typeof t?(i=t,t=0,n=this.length):"string"==typeof n&&(i=n,n=this.length),1===e.length){var r=e.charCodeAt(0);256>r&&(e=r)}if(void 0!==i&&"string"!=typeof i)throw new TypeError("encoding must be a string");if("string"==typeof i&&!s.isEncoding(i))throw new TypeError("Unknown encoding: "+i)}else"number"==typeof e&&(e=255&e);if(0>t||this.length<t||this.length<n)throw new RangeError("Out of range index");if(t>=n)return this;t>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0);var o;if("number"==typeof e)for(o=t;n>o;o++)this[o]=e;else{var a=s.isBuffer(e)?e:z(new s(e,i).toString()),l=a.length;for(o=0;n-t>o;o++)this[o+t]=a[o%l]}return this};var ee=/[^+\/0-9A-Za-z-_]/g}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"base64-js":1,ieee754:15,isarray:16}],4:[function(e,t,n){"use strict";function i(e){return e=e||{},"function"!=typeof e.codeMirrorInstance||"function"!=typeof e.codeMirrorInstance.defineMode?void 0:(String.prototype.includes||(String.prototype.includes=function(){return-1!==String.prototype.indexOf.apply(this,arguments)}),void e.codeMirrorInstance.defineMode("spell-checker",function(t){if(!i.aff_loading){i.aff_loading=!0;var n=new XMLHttpRequest;n.open("GET","https://cdn.jsdelivr.net/codemirror.spell-checker/latest/en_US.aff",!0),n.onload=function(){4===n.readyState&&200===n.status&&(i.aff_data=n.responseText,i.num_loaded++,2==i.num_loaded&&(i.typo=new r("en_US",i.aff_data,i.dic_data,{platform:"any"})))},n.send(null)}if(!i.dic_loading){i.dic_loading=!0;var o=new XMLHttpRequest;o.open("GET","https://cdn.jsdelivr.net/codemirror.spell-checker/latest/en_US.dic",!0),o.onload=function(){4===o.readyState&&200===o.status&&(i.dic_data=o.responseText,i.num_loaded++,2==i.num_loaded&&(i.typo=new r("en_US",i.aff_data,i.dic_data,{platform:"any"})))},o.send(null)}var s='!"#$%&()*+,-./:;<=>?@[\\]^_`{|}~ ',a={token:function(e){var t=e.peek(),n="";if(s.includes(t))return e.next(),null;for(;null!=(t=e.peek())&&!s.includes(t);)n+=t,e.next();return i.typo&&!i.typo.check(n)?"spell-error":null}},l=e.codeMirrorInstance.getMode(t,t.backdrop||"text/plain");return e.codeMirrorInstance.overlayMode(l,a,!0)}))}var r=e("typo-js");i.num_loaded=0,i.aff_loading=!1,i.dic_loading=!1,i.aff_data="",i.dic_data="",i.typo,t.exports=i},{"typo-js":18}],5:[function(t,n,i){!function(r){"object"==typeof i&&"object"==typeof n?r(t("../../lib/codemirror")):"function"==typeof e&&e.amd?e(["../../lib/codemirror"],r):r(CodeMirror)}(function(e){"use strict";function t(e){var t=e.getWrapperElement();e.state.fullScreenRestore={scrollTop:window.pageYOffset,scrollLeft:window.pageXOffset,width:t.style.width,height:t.style.height},t.style.width="",t.style.height="auto",t.className+=" CodeMirror-fullscreen",document.documentElement.style.overflow="hidden",e.refresh()}function n(e){var t=e.getWrapperElement();t.className=t.className.replace(/\s*CodeMirror-fullscreen\b/,""),document.documentElement.style.overflow="";var n=e.state.fullScreenRestore;t.style.width=n.width,t.style.height=n.height,window.scrollTo(n.scrollLeft,n.scrollTop),e.refresh()}e.defineOption("fullScreen",!1,function(i,r,o){o==e.Init&&(o=!1),!o!=!r&&(r?t(i):n(i))})})},{"../../lib/codemirror":10}],6:[function(t,n,i){!function(r){"object"==typeof i&&"object"==typeof n?r(t("../../lib/codemirror")):"function"==typeof e&&e.amd?e(["../../lib/codemirror"],r):r(CodeMirror)}(function(e){function t(e){e.state.placeholder&&(e.state.placeholder.parentNode.removeChild(e.state.placeholder),e.state.placeholder=null)}function n(e){t(e);var n=e.state.placeholder=document.createElement("pre");n.style.cssText="height: 0; overflow: visible",n.className="CodeMirror-placeholder";var i=e.getOption("placeholder");"string"==typeof i&&(i=document.createTextNode(i)),n.appendChild(i),e.display.lineSpace.insertBefore(n,e.display.lineSpace.firstChild)}function i(e){o(e)&&n(e)}function r(e){var i=e.getWrapperElement(),r=o(e);i.className=i.className.replace(" CodeMirror-empty","")+(r?" CodeMirror-empty":""),r?n(e):t(e)}function o(e){return 1===e.lineCount()&&""===e.getLine(0)}e.defineOption("placeholder","",function(n,o,s){var a=s&&s!=e.Init;if(o&&!a)n.on("blur",i),n.on("change",r),n.on("swapDoc",r),r(n);else if(!o&&a){n.off("blur",i),n.off("change",r),n.off("swapDoc",r),t(n);var l=n.getWrapperElement();l.className=l.className.replace(" CodeMirror-empty","")}o&&!n.hasFocus()&&i(n)})})},{"../../lib/codemirror":10}],7:[function(t,n,i){!function(r){"object"==typeof i&&"object"==typeof n?r(t("../../lib/codemirror")):"function"==typeof e&&e.amd?e(["../../lib/codemirror"],r):r(CodeMirror)}(function(e){"use strict";var t=/^(\s*)(>[> ]*|[*+-]\s|(\d+)([.)]))(\s*)/,n=/^(\s*)(>[> ]*|[*+-]|(\d+)[.)])(\s*)$/,i=/[*+-]\s/;e.commands.newlineAndIndentContinueMarkdownList=function(r){if(r.getOption("disableInput"))return e.Pass;for(var o=r.listSelections(),s=[],a=0;a<o.length;a++){var l=o[a].head,c=r.getStateAfter(l.line),u=c.list!==!1,d=0!==c.quote,h=r.getLine(l.line),f=t.exec(h);if(!o[a].empty()||!u&&!d||!f)return void r.execCommand("newlineAndIndent");if(n.test(h))r.replaceRange("",{line:l.line,ch:0},{line:l.line,ch:l.ch+1}),s[a]="\n";else{var p=f[1],m=f[5],g=i.test(f[2])||f[2].indexOf(">")>=0?f[2]:parseInt(f[3],10)+1+f[4];s[a]="\n"+p+g+m}}r.replaceSelections(s)}})},{"../../lib/codemirror":10}],8:[function(t,n,i){!function(r){"object"==typeof i&&"object"==typeof n?r(t("../../lib/codemirror")):"function"==typeof e&&e.amd?e(["../../lib/codemirror"],r):r(CodeMirror)}(function(e){"use strict";e.overlayMode=function(t,n,i){return{startState:function(){return{base:e.startState(t),overlay:e.startState(n),basePos:0,baseCur:null,overlayPos:0,overlayCur:null,streamSeen:null}},copyState:function(i){return{base:e.copyState(t,i.base),overlay:e.copyState(n,i.overlay),basePos:i.basePos,baseCur:null,overlayPos:i.overlayPos,overlayCur:null}},token:function(e,r){return(e!=r.streamSeen||Math.min(r.basePos,r.overlayPos)<e.start)&&(r.streamSeen=e,r.basePos=r.overlayPos=e.start),e.start==r.basePos&&(r.baseCur=t.token(e,r.base),r.basePos=e.pos),e.start==r.overlayPos&&(e.pos=e.start,r.overlayCur=n.token(e,r.overlay),r.overlayPos=e.pos),e.pos=Math.min(r.basePos,r.overlayPos),null==r.overlayCur?r.baseCur:null!=r.baseCur&&r.overlay.combineTokens||i&&null==r.overlay.combineTokens?r.baseCur+" "+r.overlayCur:r.overlayCur},indent:t.indent&&function(e,n){return t.indent(e.base,n)},electricChars:t.electricChars,innerMode:function(e){return{state:e.base,mode:t}},blankLine:function(e){t.blankLine&&t.blankLine(e.base),n.blankLine&&n.blankLine(e.overlay)}}}})},{"../../lib/codemirror":10}],9:[function(t,n,i){!function(r){"object"==typeof i&&"object"==typeof n?r(t("../../lib/codemirror")):"function"==typeof e&&e.amd?e(["../../lib/codemirror"],r):r(CodeMirror)}(function(e){"use strict";function t(e){e.operation(function(){s(e)})}function n(e){e.state.markedSelection.length&&e.operation(function(){r(e)})}function i(e,t,n,i){if(0!=c(t,n))for(var r=e.state.markedSelection,o=e.state.markedSelectionStyle,s=t.line;;){var u=s==t.line?t:l(s,0),d=s+a,h=d>=n.line,f=h?n:l(d,0),p=e.markText(u,f,{className:o});if(null==i?r.push(p):r.splice(i++,0,p),h)break;s=d}}function r(e){for(var t=e.state.markedSelection,n=0;n<t.length;++n)t[n].clear();t.length=0}function o(e){r(e);for(var t=e.listSelections(),n=0;n<t.length;n++)i(e,t[n].from(),t[n].to())}function s(e){if(!e.somethingSelected())return r(e);if(e.listSelections().length>1)return o(e);var t=e.getCursor("start"),n=e.getCursor("end"),s=e.state.markedSelection;if(!s.length)return i(e,t,n);var l=s[0].find(),u=s[s.length-1].find();if(!l||!u||n.line-t.line<a||c(t,u.to)>=0||c(n,l.from)<=0)return o(e);for(;c(t,l.from)>0;)s.shift().clear(),l=s[0].find();for(c(t,l.from)<0&&(l.to.line-t.line<a?(s.shift().clear(),i(e,t,l.to,0)):i(e,t,l.from,0));c(n,u.to)<0;)s.pop().clear(),u=s[s.length-1].find();c(n,u.to)>0&&(n.line-u.from.line<a?(s.pop().clear(),i(e,u.from,n)):i(e,u.to,n))}e.defineOption("styleSelectedText",!1,function(i,s,a){var l=a&&a!=e.Init;s&&!l?(i.state.markedSelection=[],i.state.markedSelectionStyle="string"==typeof s?s:"CodeMirror-selectedtext",o(i),i.on("cursorActivity",t),i.on("change",n)):!s&&l&&(i.off("cursorActivity",t),i.off("change",n),r(i),i.state.markedSelection=i.state.markedSelectionStyle=null)});var a=8,l=e.Pos,c=e.cmpPos})},{"../../lib/codemirror":10}],10:[function(t,n,i){!function(t){if("object"==typeof i&&"object"==typeof n)n.exports=t();else{if("function"==typeof e&&e.amd)return e([],t);(this||window).CodeMirror=t()}}(function(){"use strict";function e(n,i){if(!(this instanceof e))return new e(n,i);this.options=i=i?Pr(i):{},Pr(es,i,!1),f(i);var r=i.value;"string"==typeof r&&(r=new _s(r,i.mode,null,i.lineSeparator)),this.doc=r;var o=new e.inputStyles[i.inputStyle](this),s=this.display=new t(n,r,o);s.wrapper.CodeMirror=this,c(this),a(this),i.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),i.autofocus&&!Eo&&s.input.focus(),v(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:!1,cutIncoming:!1,selectingText:!1,draggingText:!1,highlight:new Lr,keySeq:null,specialChars:null};var l=this;bo&&11>xo&&setTimeout(function(){l.display.input.reset(!0)},20),Wt(this),Xr(),xt(this),this.curOp.forceUpdate=!0,Zi(this,r),i.autofocus&&!Eo||l.hasFocus()?setTimeout(Hr(vn,this),20):yn(this);for(var u in ts)ts.hasOwnProperty(u)&&ts[u](this,i[u],ns);C(this),i.finishInit&&i.finishInit(this);for(var d=0;d<ss.length;++d)ss[d](this);Ct(this),wo&&i.lineWrapping&&"optimizelegibility"==getComputedStyle(s.lineDiv).textRendering&&(s.lineDiv.style.textRendering="auto")}function t(e,t,n){var i=this;this.input=n,i.scrollbarFiller=Wr("div",null,"CodeMirror-scrollbar-filler"),i.scrollbarFiller.setAttribute("cm-not-content","true"),i.gutterFiller=Wr("div",null,"CodeMirror-gutter-filler"),i.gutterFiller.setAttribute("cm-not-content","true"),i.lineDiv=Wr("div",null,"CodeMirror-code"),i.selectionDiv=Wr("div",null,null,"position: relative; z-index: 1"),i.cursorDiv=Wr("div",null,"CodeMirror-cursors"),i.measure=Wr("div",null,"CodeMirror-measure"),i.lineMeasure=Wr("div",null,"CodeMirror-measure"),i.lineSpace=Wr("div",[i.measure,i.lineMeasure,i.selectionDiv,i.cursorDiv,i.lineDiv],null,"position: relative; outline: none"),i.mover=Wr("div",[Wr("div",[i.lineSpace],"CodeMirror-lines")],null,"position: relative"),i.sizer=Wr("div",[i.mover],"CodeMirror-sizer"),i.sizerWidth=null,i.heightForcer=Wr("div",null,null,"position: absolute; height: "+Is+"px; width: 1px;"),i.gutters=Wr("div",null,"CodeMirror-gutters"),i.lineGutter=null,i.scroller=Wr("div",[i.sizer,i.heightForcer,i.gutters],"CodeMirror-scroll"),i.scroller.setAttribute("tabIndex","-1"),i.wrapper=Wr("div",[i.scrollbarFiller,i.gutterFiller,i.scroller],"CodeMirror"),bo&&8>xo&&(i.gutters.style.zIndex=-1,i.scroller.style.paddingRight=0),wo||go&&Eo||(i.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(i.wrapper):e(i.wrapper)),i.viewFrom=i.viewTo=t.first,i.reportedViewFrom=i.reportedViewTo=t.first,i.view=[],i.renderedView=null,i.externalMeasured=null,i.viewOffset=0,i.lastWrapHeight=i.lastWrapWidth=0,i.updateLineNumbers=null,i.nativeBarWidth=i.barHeight=i.barWidth=0,i.scrollbarsClipped=!1,i.lineNumWidth=i.lineNumInnerWidth=i.lineNumChars=null,i.alignWidgets=!1,i.cachedCharWidth=i.cachedTextHeight=i.cachedPaddingH=null,i.maxLine=null,i.maxLineLength=0,i.maxLineChanged=!1,i.wheelDX=i.wheelDY=i.wheelStartX=i.wheelStartY=null,i.shift=!1,i.selForContextMenu=null,i.activeTouch=null,n.init(i)}function n(t){t.doc.mode=e.getMode(t.options,t.doc.modeOption),i(t)}function i(e){e.doc.iter(function(e){e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null)}),e.doc.frontier=e.doc.first,Be(e,100),e.state.modeGen++,e.curOp&&It(e)}function r(e){e.options.lineWrapping?(Qs(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(Ks(e.display.wrapper,"CodeMirror-wrap"),h(e)),s(e),It(e),at(e),setTimeout(function(){y(e)},100)}function o(e){var t=yt(e.display),n=e.options.lineWrapping,i=n&&Math.max(5,e.display.scroller.clientWidth/bt(e.display)-3);return function(r){if(Ci(e.doc,r))return 0;var o=0;if(r.widgets)for(var s=0;s<r.widgets.length;s++)r.widgets[s].height&&(o+=r.widgets[s].height);return n?o+(Math.ceil(r.text.length/i)||1)*t:o+t}}function s(e){var t=e.doc,n=o(e);t.iter(function(e){var t=n(e);t!=e.height&&er(e,t)})}function a(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),at(e)}function l(e){c(e),It(e),setTimeout(function(){w(e)},20)}function c(e){var t=e.display.gutters,n=e.options.gutters;qr(t);for(var i=0;i<n.length;++i){var r=n[i],o=t.appendChild(Wr("div",null,"CodeMirror-gutter "+r));"CodeMirror-linenumbers"==r&&(e.display.lineGutter=o,o.style.width=(e.display.lineNumWidth||1)+"px")}t.style.display=i?"":"none",u(e)}function u(e){var t=e.display.gutters.offsetWidth;e.display.sizer.style.marginLeft=t+"px"}function d(e){if(0==e.height)return 0;for(var t,n=e.text.length,i=e;t=mi(i);){var r=t.find(0,!0);i=r.from.line,n+=r.from.ch-r.to.ch}for(i=e;t=gi(i);){var r=t.find(0,!0);n-=i.text.length-r.from.ch,i=r.to.line,n+=i.text.length-r.to.ch}return n}function h(e){var t=e.display,n=e.doc;t.maxLine=Ki(n,n.first),t.maxLineLength=d(t.maxLine),t.maxLineChanged=!0,n.iter(function(e){var n=d(e);n>t.maxLineLength&&(t.maxLineLength=n,t.maxLine=e)})}function f(e){var t=Or(e.gutters,"CodeMirror-linenumbers");-1==t&&e.lineNumbers?e.gutters=e.gutters.concat(["CodeMirror-linenumbers"]):t>-1&&!e.lineNumbers&&(e.gutters=e.gutters.slice(0),e.gutters.splice(t,1))}function p(e){var t=e.display,n=t.gutters.offsetWidth,i=Math.round(e.doc.height+ze(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?n:0,docHeight:i,scrollHeight:i+Ue(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}function m(e,t,n){this.cm=n;var i=this.vert=Wr("div",[Wr("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),r=this.horiz=Wr("div",[Wr("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");e(i),e(r),Ls(i,"scroll",function(){i.clientHeight&&t(i.scrollTop,"vertical")}),Ls(r,"scroll",function(){r.clientWidth&&t(r.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,bo&&8>xo&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")}function g(){}function v(t){t.display.scrollbars&&(t.display.scrollbars.clear(),t.display.scrollbars.addClass&&Ks(t.display.wrapper,t.display.scrollbars.addClass)),t.display.scrollbars=new e.scrollbarModel[t.options.scrollbarStyle](function(e){t.display.wrapper.insertBefore(e,t.display.scrollbarFiller),Ls(e,"mousedown",function(){t.state.focused&&setTimeout(function(){t.display.input.focus()},0)}),e.setAttribute("cm-not-content","true")},function(e,n){"horizontal"==n?on(t,e):rn(t,e)},t),t.display.scrollbars.addClass&&Qs(t.display.wrapper,t.display.scrollbars.addClass)}function y(e,t){t||(t=p(e));var n=e.display.barWidth,i=e.display.barHeight;b(e,t);for(var r=0;4>r&&n!=e.display.barWidth||i!=e.display.barHeight;r++)n!=e.display.barWidth&&e.options.lineWrapping&&A(e),b(e,p(e)),n=e.display.barWidth,i=e.display.barHeight}function b(e,t){var n=e.display,i=n.scrollbars.update(t);n.sizer.style.paddingRight=(n.barWidth=i.right)+"px",n.sizer.style.paddingBottom=(n.barHeight=i.bottom)+"px",n.heightForcer.style.borderBottom=i.bottom+"px solid transparent",i.right&&i.bottom?(n.scrollbarFiller.style.display="block",n.scrollbarFiller.style.height=i.bottom+"px",n.scrollbarFiller.style.width=i.right+"px"):n.scrollbarFiller.style.display="",i.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=i.bottom+"px",n.gutterFiller.style.width=t.gutterWidth+"px"):n.gutterFiller.style.display=""}function x(e,t,n){var i=n&&null!=n.top?Math.max(0,n.top):e.scroller.scrollTop;i=Math.floor(i-qe(e));var r=n&&null!=n.bottom?n.bottom:i+e.wrapper.clientHeight,o=nr(t,i),s=nr(t,r);if(n&&n.ensure){var a=n.ensure.from.line,l=n.ensure.to.line;o>a?(o=a,s=nr(t,ir(Ki(t,a))+e.wrapper.clientHeight)):Math.min(l,t.lastLine())>=s&&(o=nr(t,ir(Ki(t,l))-e.wrapper.clientHeight),s=l)}return{from:o,to:Math.max(s,o+1)}}function w(e){var t=e.display,n=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var i=_(t)-t.scroller.scrollLeft+e.doc.scrollLeft,r=t.gutters.offsetWidth,o=i+"px",s=0;s<n.length;s++)if(!n[s].hidden){e.options.fixedGutter&&n[s].gutter&&(n[s].gutter.style.left=o);var a=n[s].alignable;if(a)for(var l=0;l<a.length;l++)a[l].style.left=o}e.options.fixedGutter&&(t.gutters.style.left=i+r+"px")}}function C(e){if(!e.options.lineNumbers)return!1;var t=e.doc,n=k(e.options,t.first+t.size-1),i=e.display;if(n.length!=i.lineNumChars){var r=i.measure.appendChild(Wr("div",[Wr("div",n)],"CodeMirror-linenumber CodeMirror-gutter-elt")),o=r.firstChild.offsetWidth,s=r.offsetWidth-o;return i.lineGutter.style.width="",i.lineNumInnerWidth=Math.max(o,i.lineGutter.offsetWidth-s)+1,i.lineNumWidth=i.lineNumInnerWidth+s,i.lineNumChars=i.lineNumInnerWidth?n.length:-1,i.lineGutter.style.width=i.lineNumWidth+"px",u(e),!0}return!1}function k(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function _(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function S(e,t,n){var i=e.display;this.viewport=t,this.visible=x(i,e.doc,t),this.editorIsHidden=!i.wrapper.offsetWidth,this.wrapperHeight=i.wrapper.clientHeight,this.wrapperWidth=i.wrapper.clientWidth,this.oldDisplayWidth=Ve(e),this.force=n,this.dims=O(e),this.events=[]}function T(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=Ue(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=Ue(e)+"px",t.scrollbarsClipped=!0)}function D(e,t){var n=e.display,i=e.doc;if(t.editorIsHidden)return Pt(e),!1;if(!t.force&&t.visible.from>=n.viewFrom&&t.visible.to<=n.viewTo&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&0==Ft(e))return!1;C(e)&&(Pt(e),t.dims=O(e));var r=i.first+i.size,o=Math.max(t.visible.from-e.options.viewportMargin,i.first),s=Math.min(r,t.visible.to+e.options.viewportMargin);n.viewFrom<o&&o-n.viewFrom<20&&(o=Math.max(i.first,n.viewFrom)),n.viewTo>s&&n.viewTo-s<20&&(s=Math.min(r,n.viewTo)),Po&&(o=xi(e.doc,o),s=wi(e.doc,s));var a=o!=n.viewFrom||s!=n.viewTo||n.lastWrapHeight!=t.wrapperHeight||n.lastWrapWidth!=t.wrapperWidth;jt(e,o,s),n.viewOffset=ir(Ki(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+"px";var l=Ft(e);if(!a&&0==l&&!t.force&&n.renderedView==n.view&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo))return!1;var c=Yr();return l>4&&(n.lineDiv.style.display="none"),N(e,n.updateLineNumbers,t.dims),l>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,c&&Yr()!=c&&c.offsetHeight&&c.focus(),qr(n.cursorDiv),qr(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,a&&(n.lastWrapHeight=t.wrapperHeight,n.lastWrapWidth=t.wrapperWidth,Be(e,400)),n.updateLineNumbers=null,!0}function M(e,t){for(var n=t.viewport,i=!0;(i&&e.options.lineWrapping&&t.oldDisplayWidth!=Ve(e)||(n&&null!=n.top&&(n={top:Math.min(e.doc.height+ze(e.display)-Ge(e),n.top)}),t.visible=x(e.display,e.doc,n),!(t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)))&&D(e,t);i=!1){A(e);var r=p(e);Ne(e),y(e,r),L(e,r)}t.signal(e,"update",e),e.display.viewFrom==e.display.reportedViewFrom&&e.display.viewTo==e.display.reportedViewTo||(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function E(e,t){var n=new S(e,t);if(D(e,n)){A(e),M(e,n);var i=p(e);Ne(e),y(e,i),L(e,i),n.finish()}}function L(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+Ue(e)+"px"}function A(e){for(var t=e.display,n=t.lineDiv.offsetTop,i=0;i<t.view.length;i++){var r,o=t.view[i];if(!o.hidden){if(bo&&8>xo){var s=o.node.offsetTop+o.node.offsetHeight;r=s-n,n=s}else{var a=o.node.getBoundingClientRect();r=a.bottom-a.top}var l=o.line.height-r;if(2>r&&(r=yt(t)),(l>.001||-.001>l)&&(er(o.line,r),$(o.line),o.rest))for(var c=0;c<o.rest.length;c++)$(o.rest[c])}}}function $(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t)e.widgets[t].height=e.widgets[t].node.parentNode.offsetHeight}function O(e){for(var t=e.display,n={},i={},r=t.gutters.clientLeft,o=t.gutters.firstChild,s=0;o;o=o.nextSibling,++s)n[e.options.gutters[s]]=o.offsetLeft+o.clientLeft+r,i[e.options.gutters[s]]=o.clientWidth;return{fixedPos:_(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:n,gutterWidth:i,wrapperWidth:t.wrapper.clientWidth}}function N(e,t,n){function i(t){var n=t.nextSibling;return wo&&Lo&&e.display.currentWheelTarget==t?t.style.display="none":t.parentNode.removeChild(t),n}for(var r=e.display,o=e.options.lineNumbers,s=r.lineDiv,a=s.firstChild,l=r.view,c=r.viewFrom,u=0;u<l.length;u++){var d=l[u];if(d.hidden);else if(d.node&&d.node.parentNode==s){for(;a!=d.node;)a=i(a);var h=o&&null!=t&&c>=t&&d.lineNumber;d.changes&&(Or(d.changes,"gutter")>-1&&(h=!1),I(e,d,c,n)),h&&(qr(d.lineNumber),d.lineNumber.appendChild(document.createTextNode(k(e.options,c)))),a=d.node.nextSibling}else{var f=q(e,d,c,n);s.insertBefore(f,a)}c+=d.size}for(;a;)a=i(a)}function I(e,t,n,i){for(var r=0;r<t.changes.length;r++){var o=t.changes[r];"text"==o?B(e,t):"gutter"==o?F(e,t,n,i):"class"==o?j(t):"widget"==o&&W(e,t,i)}t.changes=null}function R(e){return e.node==e.text&&(e.node=Wr("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),bo&&8>xo&&(e.node.style.zIndex=2)),e.node}function P(e){var t=e.bgClass?e.bgClass+" "+(e.line.bgClass||""):e.line.bgClass;if(t&&(t+=" CodeMirror-linebackground"),e.background)t?e.background.className=t:(e.background.parentNode.removeChild(e.background),e.background=null);else if(t){var n=R(e);e.background=n.insertBefore(Wr("div",null,t),n.firstChild)}}function H(e,t){var n=e.display.externalMeasured;return n&&n.line==t.line?(e.display.externalMeasured=null,t.measure=n.measure,n.built):Hi(e,t)}function B(e,t){var n=t.text.className,i=H(e,t);t.text==t.node&&(t.node=i.pre),t.text.parentNode.replaceChild(i.pre,t.text),t.text=i.pre,i.bgClass!=t.bgClass||i.textClass!=t.textClass?(t.bgClass=i.bgClass,t.textClass=i.textClass,j(t)):n&&(t.text.className=n)}function j(e){P(e),e.line.wrapClass?R(e).className=e.line.wrapClass:e.node!=e.text&&(e.node.className="");var t=e.textClass?e.textClass+" "+(e.line.textClass||""):e.line.textClass;e.text.className=t||""}function F(e,t,n,i){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var r=R(t);t.gutterBackground=Wr("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?i.fixedPos:-i.gutterTotalWidth)+"px; width: "+i.gutterTotalWidth+"px"),r.insertBefore(t.gutterBackground,t.text)}var o=t.line.gutterMarkers;if(e.options.lineNumbers||o){var r=R(t),s=t.gutter=Wr("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?i.fixedPos:-i.gutterTotalWidth)+"px");if(e.display.input.setUneditable(s),r.insertBefore(s,t.text),t.line.gutterClass&&(s.className+=" "+t.line.gutterClass),!e.options.lineNumbers||o&&o["CodeMirror-linenumbers"]||(t.lineNumber=s.appendChild(Wr("div",k(e.options,n),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+i.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),o)for(var a=0;a<e.options.gutters.length;++a){var l=e.options.gutters[a],c=o.hasOwnProperty(l)&&o[l];c&&s.appendChild(Wr("div",[c],"CodeMirror-gutter-elt","left: "+i.gutterLeft[l]+"px; width: "+i.gutterWidth[l]+"px"))}}}function W(e,t,n){t.alignable&&(t.alignable=null);for(var i,r=t.node.firstChild;r;r=i){var i=r.nextSibling;"CodeMirror-linewidget"==r.className&&t.node.removeChild(r)}z(e,t,n)}function q(e,t,n,i){var r=H(e,t);return t.text=t.node=r.pre,r.bgClass&&(t.bgClass=r.bgClass),r.textClass&&(t.textClass=r.textClass),j(t),F(e,t,n,i),z(e,t,i),t.node}function z(e,t,n){if(Y(e,t.line,t,n,!0),t.rest)for(var i=0;i<t.rest.length;i++)Y(e,t.rest[i],t,n,!1)}function Y(e,t,n,i,r){if(t.widgets)for(var o=R(n),s=0,a=t.widgets;s<a.length;++s){var l=a[s],c=Wr("div",[l.node],"CodeMirror-linewidget");l.handleMouseEvents||c.setAttribute("cm-ignore-events","true"),U(l,c,n,i),e.display.input.setUneditable(c),r&&l.above?o.insertBefore(c,n.gutter||n.text):o.appendChild(c),_r(l,"redraw")}}function U(e,t,n,i){if(e.noHScroll){(n.alignable||(n.alignable=[])).push(t);var r=i.wrapperWidth;t.style.left=i.fixedPos+"px",e.coverGutter||(r-=i.gutterTotalWidth,t.style.paddingLeft=i.gutterTotalWidth+"px"),t.style.width=r+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-i.gutterTotalWidth+"px"))}function V(e){return Ho(e.line,e.ch)}function G(e,t){return Bo(e,t)<0?t:e}function X(e,t){return Bo(e,t)<0?e:t}function Z(e){e.state.focused||(e.display.input.focus(),vn(e))}function K(e,t,n,i,r){var o=e.doc;e.display.shift=!1,i||(i=o.sel);var s=e.state.pasteIncoming||"paste"==r,a=o.splitLines(t),l=null;if(s&&i.ranges.length>1)if(jo&&jo.text.join("\n")==t){if(i.ranges.length%jo.text.length==0){l=[];for(var c=0;c<jo.text.length;c++)l.push(o.splitLines(jo.text[c]))}}else a.length==i.ranges.length&&(l=Nr(a,function(e){return[e]}));for(var c=i.ranges.length-1;c>=0;c--){var u=i.ranges[c],d=u.from(),h=u.to();u.empty()&&(n&&n>0?d=Ho(d.line,d.ch-n):e.state.overwrite&&!s?h=Ho(h.line,Math.min(Ki(o,h.line).text.length,h.ch+$r(a).length)):jo&&jo.lineWise&&jo.text.join("\n")==t&&(d=h=Ho(d.line,0)));var f=e.curOp.updateInput,p={from:d,to:h,text:l?l[c%l.length]:a,origin:r||(s?"paste":e.state.cutIncoming?"cut":"+input")};Tn(e.doc,p),_r(e,"inputRead",e,p)}t&&!s&&J(e,t),Hn(e),e.curOp.updateInput=f,e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=!1}function Q(e,t){var n=e.clipboardData&&e.clipboardData.getData("text/plain");return n?(e.preventDefault(),t.isReadOnly()||t.options.disableInput||Et(t,function(){K(t,n,0,null,"paste")}),!0):void 0}function J(e,t){if(e.options.electricChars&&e.options.smartIndent)for(var n=e.doc.sel,i=n.ranges.length-1;i>=0;i--){var r=n.ranges[i];if(!(r.head.ch>100||i&&n.ranges[i-1].head.line==r.head.line)){var o=e.getModeAt(r.head),s=!1;if(o.electricChars){for(var a=0;a<o.electricChars.length;a++)if(t.indexOf(o.electricChars.charAt(a))>-1){s=jn(e,r.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(Ki(e.doc,r.head.line).text.slice(0,r.head.ch))&&(s=jn(e,r.head.line,"smart"));s&&_r(e,"electricInput",e,r.head.line)}}}function ee(e){for(var t=[],n=[],i=0;i<e.doc.sel.ranges.length;i++){var r=e.doc.sel.ranges[i].head.line,o={anchor:Ho(r,0),head:Ho(r+1,0)};n.push(o),t.push(e.getRange(o.anchor,o.head))}return{text:t,ranges:n}}function te(e){e.setAttribute("autocorrect","off"),e.setAttribute("autocapitalize","off"),e.setAttribute("spellcheck","false")}function ne(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new Lr,this.inaccurateSelection=!1,this.hasSelection=!1,this.composing=null}function ie(){var e=Wr("textarea",null,null,"position: absolute; padding: 0; width: 1px; height: 1em; outline: none"),t=Wr("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return wo?e.style.width="1000px":e.setAttribute("wrap","off"),Mo&&(e.style.border="1px solid black"),te(e),t}function re(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new Lr,this.gracePeriod=!1}function oe(e,t){var n=Je(e,t.line);if(!n||n.hidden)return null;var i=Ki(e.doc,t.line),r=Ze(n,i,t.line),o=rr(i),s="left";if(o){var a=co(o,t.ch);s=a%2?"right":"left"}var l=nt(r.map,t.ch,s);return l.offset="right"==l.collapse?l.end:l.start,l}function se(e,t){return t&&(e.bad=!0),e}function ae(e,t,n){var i;if(t==e.display.lineDiv){if(i=e.display.lineDiv.childNodes[n],!i)return se(e.clipPos(Ho(e.display.viewTo-1)),!0);t=null,n=0}else for(i=t;;i=i.parentNode){if(!i||i==e.display.lineDiv)return null;if(i.parentNode&&i.parentNode==e.display.lineDiv)break}for(var r=0;r<e.display.view.length;r++){var o=e.display.view[r];if(o.node==i)return le(o,t,n)}}function le(e,t,n){function i(t,n,i){for(var r=-1;r<(u?u.length:0);r++)for(var o=0>r?c.map:u[r],s=0;s<o.length;s+=3){var a=o[s+2];if(a==t||a==n){var l=tr(0>r?e.line:e.rest[r]),d=o[s]+i;return(0>i||a!=t)&&(d=o[s+(i?1:0)]),Ho(l,d)}}}var r=e.text.firstChild,o=!1;if(!t||!Gs(r,t))return se(Ho(tr(e.line),0),!0);if(t==r&&(o=!0,t=r.childNodes[n],n=0,!t)){var s=e.rest?$r(e.rest):e.line;return se(Ho(tr(s),s.text.length),o)}var a=3==t.nodeType?t:null,l=t;for(a||1!=t.childNodes.length||3!=t.firstChild.nodeType||(a=t.firstChild,n&&(n=a.nodeValue.length));l.parentNode!=r;)l=l.parentNode;var c=e.measure,u=c.maps,d=i(a,l,n);if(d)return se(d,o);for(var h=l.nextSibling,f=a?a.nodeValue.length-n:0;h;h=h.nextSibling){if(d=i(h,h.firstChild,0))return se(Ho(d.line,d.ch-f),o);f+=h.textContent.length}for(var p=l.previousSibling,f=n;p;p=p.previousSibling){if(d=i(p,p.firstChild,-1))return se(Ho(d.line,d.ch+f),o);f+=h.textContent.length}}function ce(e,t,n,i,r){function o(e){return function(t){return t.id==e}}function s(t){if(1==t.nodeType){var n=t.getAttribute("cm-text");if(null!=n)return""==n&&(n=t.textContent.replace(/\u200b/g,"")),void(a+=n);var u,d=t.getAttribute("cm-marker");if(d){var h=e.findMarks(Ho(i,0),Ho(r+1,0),o(+d));return void(h.length&&(u=h[0].find())&&(a+=Qi(e.doc,u.from,u.to).join(c)))}if("false"==t.getAttribute("contenteditable"))return;for(var f=0;f<t.childNodes.length;f++)s(t.childNodes[f]);/^(pre|div|p)$/i.test(t.nodeName)&&(l=!0)}else if(3==t.nodeType){var p=t.nodeValue;if(!p)return;l&&(a+=c,l=!1),a+=p}}for(var a="",l=!1,c=e.doc.lineSeparator();s(t),t!=n;)t=t.nextSibling;return a}function ue(e,t){this.ranges=e,this.primIndex=t;
  }function de(e,t){this.anchor=e,this.head=t}function he(e,t){var n=e[t];e.sort(function(e,t){return Bo(e.from(),t.from())}),t=Or(e,n);for(var i=1;i<e.length;i++){var r=e[i],o=e[i-1];if(Bo(o.to(),r.from())>=0){var s=X(o.from(),r.from()),a=G(o.to(),r.to()),l=o.empty()?r.from()==r.head:o.from()==o.head;t>=i&&--t,e.splice(--i,2,new de(l?a:s,l?s:a))}}return new ue(e,t)}function fe(e,t){return new ue([new de(e,t||e)],0)}function pe(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function me(e,t){if(t.line<e.first)return Ho(e.first,0);var n=e.first+e.size-1;return t.line>n?Ho(n,Ki(e,n).text.length):ge(t,Ki(e,t.line).text.length)}function ge(e,t){var n=e.ch;return null==n||n>t?Ho(e.line,t):0>n?Ho(e.line,0):e}function ve(e,t){return t>=e.first&&t<e.first+e.size}function ye(e,t){for(var n=[],i=0;i<t.length;i++)n[i]=me(e,t[i]);return n}function be(e,t,n,i){if(e.cm&&e.cm.display.shift||e.extend){var r=t.anchor;if(i){var o=Bo(n,r)<0;o!=Bo(i,r)<0?(r=n,n=i):o!=Bo(n,i)<0&&(n=i)}return new de(r,n)}return new de(i||n,n)}function xe(e,t,n,i){Te(e,new ue([be(e,e.sel.primary(),t,n)],0),i)}function we(e,t,n){for(var i=[],r=0;r<e.sel.ranges.length;r++)i[r]=be(e,e.sel.ranges[r],t[r],null);var o=he(i,e.sel.primIndex);Te(e,o,n)}function Ce(e,t,n,i){var r=e.sel.ranges.slice(0);r[t]=n,Te(e,he(r,e.sel.primIndex),i)}function ke(e,t,n,i){Te(e,fe(t,n),i)}function _e(e,t,n){var i={ranges:t.ranges,update:function(t){this.ranges=[];for(var n=0;n<t.length;n++)this.ranges[n]=new de(me(e,t[n].anchor),me(e,t[n].head))},origin:n&&n.origin};return Os(e,"beforeSelectionChange",e,i),e.cm&&Os(e.cm,"beforeSelectionChange",e.cm,i),i.ranges!=t.ranges?he(i.ranges,i.ranges.length-1):t}function Se(e,t,n){var i=e.history.done,r=$r(i);r&&r.ranges?(i[i.length-1]=t,De(e,t,n)):Te(e,t,n)}function Te(e,t,n){De(e,t,n),dr(e,e.sel,e.cm?e.cm.curOp.id:NaN,n)}function De(e,t,n){(Mr(e,"beforeSelectionChange")||e.cm&&Mr(e.cm,"beforeSelectionChange"))&&(t=_e(e,t,n));var i=n&&n.bias||(Bo(t.primary().head,e.sel.primary().head)<0?-1:1);Me(e,Le(e,t,i,!0)),n&&n.scroll===!1||!e.cm||Hn(e.cm)}function Me(e,t){t.equals(e.sel)||(e.sel=t,e.cm&&(e.cm.curOp.updateInput=e.cm.curOp.selectionChanged=!0,Dr(e.cm)),_r(e,"cursorActivity",e))}function Ee(e){Me(e,Le(e,e.sel,null,!1),Ps)}function Le(e,t,n,i){for(var r,o=0;o<t.ranges.length;o++){var s=t.ranges[o],a=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[o],l=$e(e,s.anchor,a&&a.anchor,n,i),c=$e(e,s.head,a&&a.head,n,i);(r||l!=s.anchor||c!=s.head)&&(r||(r=t.ranges.slice(0,o)),r[o]=new de(l,c))}return r?he(r,t.primIndex):t}function Ae(e,t,n,i,r){var o=Ki(e,t.line);if(o.markedSpans)for(var s=0;s<o.markedSpans.length;++s){var a=o.markedSpans[s],l=a.marker;if((null==a.from||(l.inclusiveLeft?a.from<=t.ch:a.from<t.ch))&&(null==a.to||(l.inclusiveRight?a.to>=t.ch:a.to>t.ch))){if(r&&(Os(l,"beforeCursorEnter"),l.explicitlyCleared)){if(o.markedSpans){--s;continue}break}if(!l.atomic)continue;if(n){var c,u=l.find(0>i?1:-1);if((0>i?l.inclusiveRight:l.inclusiveLeft)&&(u=Oe(e,u,-i,u&&u.line==t.line?o:null)),u&&u.line==t.line&&(c=Bo(u,n))&&(0>i?0>c:c>0))return Ae(e,u,t,i,r)}var d=l.find(0>i?-1:1);return(0>i?l.inclusiveLeft:l.inclusiveRight)&&(d=Oe(e,d,i,d.line==t.line?o:null)),d?Ae(e,d,t,i,r):null}}return t}function $e(e,t,n,i,r){var o=i||1,s=Ae(e,t,n,o,r)||!r&&Ae(e,t,n,o,!0)||Ae(e,t,n,-o,r)||!r&&Ae(e,t,n,-o,!0);return s?s:(e.cantEdit=!0,Ho(e.first,0))}function Oe(e,t,n,i){return 0>n&&0==t.ch?t.line>e.first?me(e,Ho(t.line-1)):null:n>0&&t.ch==(i||Ki(e,t.line)).text.length?t.line<e.first+e.size-1?Ho(t.line+1,0):null:new Ho(t.line,t.ch+n)}function Ne(e){e.display.input.showSelection(e.display.input.prepareSelection())}function Ie(e,t){for(var n=e.doc,i={},r=i.cursors=document.createDocumentFragment(),o=i.selection=document.createDocumentFragment(),s=0;s<n.sel.ranges.length;s++)if(t!==!1||s!=n.sel.primIndex){var a=n.sel.ranges[s];if(!(a.from().line>=e.display.viewTo||a.to().line<e.display.viewFrom)){var l=a.empty();(l||e.options.showCursorWhenSelecting)&&Re(e,a.head,r),l||Pe(e,a,o)}}return i}function Re(e,t,n){var i=ft(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),r=n.appendChild(Wr("div"," ","CodeMirror-cursor"));if(r.style.left=i.left+"px",r.style.top=i.top+"px",r.style.height=Math.max(0,i.bottom-i.top)*e.options.cursorHeight+"px",i.other){var o=n.appendChild(Wr("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));o.style.display="",o.style.left=i.other.left+"px",o.style.top=i.other.top+"px",o.style.height=.85*(i.other.bottom-i.other.top)+"px"}}function Pe(e,t,n){function i(e,t,n,i){0>t&&(t=0),t=Math.round(t),i=Math.round(i),a.appendChild(Wr("div",null,"CodeMirror-selected","position: absolute; left: "+e+"px; top: "+t+"px; width: "+(null==n?u-e:n)+"px; height: "+(i-t)+"px"))}function r(t,n,r){function o(n,i){return ht(e,Ho(t,n),"div",d,i)}var a,l,d=Ki(s,t),h=d.text.length;return eo(rr(d),n||0,null==r?h:r,function(e,t,s){var d,f,p,m=o(e,"left");if(e==t)d=m,f=p=m.left;else{if(d=o(t-1,"right"),"rtl"==s){var g=m;m=d,d=g}f=m.left,p=d.right}null==n&&0==e&&(f=c),d.top-m.top>3&&(i(f,m.top,null,m.bottom),f=c,m.bottom<d.top&&i(f,m.bottom,null,d.top)),null==r&&t==h&&(p=u),(!a||m.top<a.top||m.top==a.top&&m.left<a.left)&&(a=m),(!l||d.bottom>l.bottom||d.bottom==l.bottom&&d.right>l.right)&&(l=d),c+1>f&&(f=c),i(f,d.top,p-f,d.bottom)}),{start:a,end:l}}var o=e.display,s=e.doc,a=document.createDocumentFragment(),l=Ye(e.display),c=l.left,u=Math.max(o.sizerWidth,Ve(e)-o.sizer.offsetLeft)-l.right,d=t.from(),h=t.to();if(d.line==h.line)r(d.line,d.ch,h.ch);else{var f=Ki(s,d.line),p=Ki(s,h.line),m=yi(f)==yi(p),g=r(d.line,d.ch,m?f.text.length+1:null).end,v=r(h.line,m?0:null,h.ch).start;m&&(g.top<v.top-2?(i(g.right,g.top,null,g.bottom),i(c,v.top,v.left,v.bottom)):i(g.right,g.top,v.left-g.right,g.bottom)),g.bottom<v.top&&i(c,g.bottom,null,v.top)}n.appendChild(a)}function He(e){if(e.state.focused){var t=e.display;clearInterval(t.blinker);var n=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){t.cursorDiv.style.visibility=(n=!n)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function Be(e,t){e.doc.mode.startState&&e.doc.frontier<e.display.viewTo&&e.state.highlight.set(t,Hr(je,e))}function je(e){var t=e.doc;if(t.frontier<t.first&&(t.frontier=t.first),!(t.frontier>=e.display.viewTo)){var n=+new Date+e.options.workTime,i=ls(t.mode,We(e,t.frontier)),r=[];t.iter(t.frontier,Math.min(t.first+t.size,e.display.viewTo+500),function(o){if(t.frontier>=e.display.viewFrom){var s=o.styles,a=o.text.length>e.options.maxHighlightLength,l=Ni(e,o,a?ls(t.mode,i):i,!0);o.styles=l.styles;var c=o.styleClasses,u=l.classes;u?o.styleClasses=u:c&&(o.styleClasses=null);for(var d=!s||s.length!=o.styles.length||c!=u&&(!c||!u||c.bgClass!=u.bgClass||c.textClass!=u.textClass),h=0;!d&&h<s.length;++h)d=s[h]!=o.styles[h];d&&r.push(t.frontier),o.stateAfter=a?i:ls(t.mode,i)}else o.text.length<=e.options.maxHighlightLength&&Ri(e,o.text,i),o.stateAfter=t.frontier%5==0?ls(t.mode,i):null;return++t.frontier,+new Date>n?(Be(e,e.options.workDelay),!0):void 0}),r.length&&Et(e,function(){for(var t=0;t<r.length;t++)Rt(e,r[t],"text")})}}function Fe(e,t,n){for(var i,r,o=e.doc,s=n?-1:t-(e.doc.mode.innerMode?1e3:100),a=t;a>s;--a){if(a<=o.first)return o.first;var l=Ki(o,a-1);if(l.stateAfter&&(!n||a<=o.frontier))return a;var c=js(l.text,null,e.options.tabSize);(null==r||i>c)&&(r=a-1,i=c)}return r}function We(e,t,n){var i=e.doc,r=e.display;if(!i.mode.startState)return!0;var o=Fe(e,t,n),s=o>i.first&&Ki(i,o-1).stateAfter;return s=s?ls(i.mode,s):cs(i.mode),i.iter(o,t,function(n){Ri(e,n.text,s);var a=o==t-1||o%5==0||o>=r.viewFrom&&o<r.viewTo;n.stateAfter=a?ls(i.mode,s):null,++o}),n&&(i.frontier=o),s}function qe(e){return e.lineSpace.offsetTop}function ze(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function Ye(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=zr(e.measure,Wr("pre","x")),n=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,i={left:parseInt(n.paddingLeft),right:parseInt(n.paddingRight)};return isNaN(i.left)||isNaN(i.right)||(e.cachedPaddingH=i),i}function Ue(e){return Is-e.display.nativeBarWidth}function Ve(e){return e.display.scroller.clientWidth-Ue(e)-e.display.barWidth}function Ge(e){return e.display.scroller.clientHeight-Ue(e)-e.display.barHeight}function Xe(e,t,n){var i=e.options.lineWrapping,r=i&&Ve(e);if(!t.measure.heights||i&&t.measure.width!=r){var o=t.measure.heights=[];if(i){t.measure.width=r;for(var s=t.text.firstChild.getClientRects(),a=0;a<s.length-1;a++){var l=s[a],c=s[a+1];Math.abs(l.bottom-c.bottom)>2&&o.push((l.bottom+c.top)/2-n.top)}}o.push(n.bottom-n.top)}}function Ze(e,t,n){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var i=0;i<e.rest.length;i++)if(e.rest[i]==t)return{map:e.measure.maps[i],cache:e.measure.caches[i]};for(var i=0;i<e.rest.length;i++)if(tr(e.rest[i])>n)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}function Ke(e,t){t=yi(t);var n=tr(t),i=e.display.externalMeasured=new Ot(e.doc,t,n);i.lineN=n;var r=i.built=Hi(e,i);return i.text=r.pre,zr(e.display.lineMeasure,r.pre),i}function Qe(e,t,n,i){return tt(e,et(e,t),n,i)}function Je(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[Ht(e,t)];var n=e.display.externalMeasured;return n&&t>=n.lineN&&t<n.lineN+n.size?n:void 0}function et(e,t){var n=tr(t),i=Je(e,n);i&&!i.text?i=null:i&&i.changes&&(I(e,i,n,O(e)),e.curOp.forceUpdate=!0),i||(i=Ke(e,t));var r=Ze(i,t,n);return{line:t,view:i,rect:null,map:r.map,cache:r.cache,before:r.before,hasHeights:!1}}function tt(e,t,n,i,r){t.before&&(n=-1);var o,s=n+(i||"");return t.cache.hasOwnProperty(s)?o=t.cache[s]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(Xe(e,t.view,t.rect),t.hasHeights=!0),o=it(e,t,n,i),o.bogus||(t.cache[s]=o)),{left:o.left,right:o.right,top:r?o.rtop:o.top,bottom:r?o.rbottom:o.bottom}}function nt(e,t,n){for(var i,r,o,s,a=0;a<e.length;a+=3){var l=e[a],c=e[a+1];if(l>t?(r=0,o=1,s="left"):c>t?(r=t-l,o=r+1):(a==e.length-3||t==c&&e[a+3]>t)&&(o=c-l,r=o-1,t>=c&&(s="right")),null!=r){if(i=e[a+2],l==c&&n==(i.insertLeft?"left":"right")&&(s=n),"left"==n&&0==r)for(;a&&e[a-2]==e[a-3]&&e[a-1].insertLeft;)i=e[(a-=3)+2],s="left";if("right"==n&&r==c-l)for(;a<e.length-3&&e[a+3]==e[a+4]&&!e[a+5].insertLeft;)i=e[(a+=3)+2],s="right";break}}return{node:i,start:r,end:o,collapse:s,coverStart:l,coverEnd:c}}function it(e,t,n,i){var r,o=nt(t.map,n,i),s=o.node,a=o.start,l=o.end,c=o.collapse;if(3==s.nodeType){for(var u=0;4>u;u++){for(;a&&Fr(t.line.text.charAt(o.coverStart+a));)--a;for(;o.coverStart+l<o.coverEnd&&Fr(t.line.text.charAt(o.coverStart+l));)++l;if(bo&&9>xo&&0==a&&l==o.coverEnd-o.coverStart)r=s.parentNode.getBoundingClientRect();else if(bo&&e.options.lineWrapping){var d=zs(s,a,l).getClientRects();r=d.length?d["right"==i?d.length-1:0]:zo}else r=zs(s,a,l).getBoundingClientRect()||zo;if(r.left||r.right||0==a)break;l=a,a-=1,c="right"}bo&&11>xo&&(r=rt(e.display.measure,r))}else{a>0&&(c=i="right");var d;r=e.options.lineWrapping&&(d=s.getClientRects()).length>1?d["right"==i?d.length-1:0]:s.getBoundingClientRect()}if(bo&&9>xo&&!a&&(!r||!r.left&&!r.right)){var h=s.parentNode.getClientRects()[0];r=h?{left:h.left,right:h.left+bt(e.display),top:h.top,bottom:h.bottom}:zo}for(var f=r.top-t.rect.top,p=r.bottom-t.rect.top,m=(f+p)/2,g=t.view.measure.heights,u=0;u<g.length-1&&!(m<g[u]);u++);var v=u?g[u-1]:0,y=g[u],b={left:("right"==c?r.right:r.left)-t.rect.left,right:("left"==c?r.left:r.right)-t.rect.left,top:v,bottom:y};return r.left||r.right||(b.bogus=!0),e.options.singleCursorHeightPerLine||(b.rtop=f,b.rbottom=p),b}function rt(e,t){if(!window.screen||null==screen.logicalXDPI||screen.logicalXDPI==screen.deviceXDPI||!Jr(e))return t;var n=screen.logicalXDPI/screen.deviceXDPI,i=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*n,right:t.right*n,top:t.top*i,bottom:t.bottom*i}}function ot(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t<e.rest.length;t++)e.measure.caches[t]={}}function st(e){e.display.externalMeasure=null,qr(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)ot(e.display.view[t])}function at(e){st(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function lt(){return window.pageXOffset||(document.documentElement||document.body).scrollLeft}function ct(){return window.pageYOffset||(document.documentElement||document.body).scrollTop}function ut(e,t,n,i){if(t.widgets)for(var r=0;r<t.widgets.length;++r)if(t.widgets[r].above){var o=Si(t.widgets[r]);n.top+=o,n.bottom+=o}if("line"==i)return n;i||(i="local");var s=ir(t);if("local"==i?s+=qe(e.display):s-=e.display.viewOffset,"page"==i||"window"==i){var a=e.display.lineSpace.getBoundingClientRect();s+=a.top+("window"==i?0:ct());var l=a.left+("window"==i?0:lt());n.left+=l,n.right+=l}return n.top+=s,n.bottom+=s,n}function dt(e,t,n){if("div"==n)return t;var i=t.left,r=t.top;if("page"==n)i-=lt(),r-=ct();else if("local"==n||!n){var o=e.display.sizer.getBoundingClientRect();i+=o.left,r+=o.top}var s=e.display.lineSpace.getBoundingClientRect();return{left:i-s.left,top:r-s.top}}function ht(e,t,n,i,r){return i||(i=Ki(e.doc,t.line)),ut(e,i,Qe(e,i,t.ch,r),n)}function ft(e,t,n,i,r,o){function s(t,s){var a=tt(e,r,t,s?"right":"left",o);return s?a.left=a.right:a.right=a.left,ut(e,i,a,n)}function a(e,t){var n=l[t],i=n.level%2;return e==to(n)&&t&&n.level<l[t-1].level?(n=l[--t],e=no(n)-(n.level%2?0:1),i=!0):e==no(n)&&t<l.length-1&&n.level<l[t+1].level&&(n=l[++t],e=to(n)-n.level%2,i=!1),i&&e==n.to&&e>n.from?s(e-1):s(e,i)}i=i||Ki(e.doc,t.line),r||(r=et(e,i));var l=rr(i),c=t.ch;if(!l)return s(c);var u=co(l,c),d=a(c,u);return null!=sa&&(d.other=a(c,sa)),d}function pt(e,t){var n=0,t=me(e.doc,t);e.options.lineWrapping||(n=bt(e.display)*t.ch);var i=Ki(e.doc,t.line),r=ir(i)+qe(e.display);return{left:n,right:n,top:r,bottom:r+i.height}}function mt(e,t,n,i){var r=Ho(e,t);return r.xRel=i,n&&(r.outside=!0),r}function gt(e,t,n){var i=e.doc;if(n+=e.display.viewOffset,0>n)return mt(i.first,0,!0,-1);var r=nr(i,n),o=i.first+i.size-1;if(r>o)return mt(i.first+i.size-1,Ki(i,o).text.length,!0,1);0>t&&(t=0);for(var s=Ki(i,r);;){var a=vt(e,s,r,t,n),l=gi(s),c=l&&l.find(0,!0);if(!l||!(a.ch>c.from.ch||a.ch==c.from.ch&&a.xRel>0))return a;r=tr(s=c.to.line)}}function vt(e,t,n,i,r){function o(i){var r=ft(e,Ho(n,i),"line",t,c);return a=!0,s>r.bottom?r.left-l:s<r.top?r.left+l:(a=!1,r.left)}var s=r-ir(t),a=!1,l=2*e.display.wrapper.clientWidth,c=et(e,t),u=rr(t),d=t.text.length,h=io(t),f=ro(t),p=o(h),m=a,g=o(f),v=a;if(i>g)return mt(n,f,v,1);for(;;){if(u?f==h||f==ho(t,h,1):1>=f-h){for(var y=p>i||g-i>=i-p?h:f,b=i-(y==h?p:g);Fr(t.text.charAt(y));)++y;var x=mt(n,y,y==h?m:v,-1>b?-1:b>1?1:0);return x}var w=Math.ceil(d/2),C=h+w;if(u){C=h;for(var k=0;w>k;++k)C=ho(t,C,1)}var _=o(C);_>i?(f=C,g=_,(v=a)&&(g+=1e3),d=w):(h=C,p=_,m=a,d-=w)}}function yt(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==Fo){Fo=Wr("pre");for(var t=0;49>t;++t)Fo.appendChild(document.createTextNode("x")),Fo.appendChild(Wr("br"));Fo.appendChild(document.createTextNode("x"))}zr(e.measure,Fo);var n=Fo.offsetHeight/50;return n>3&&(e.cachedTextHeight=n),qr(e.measure),n||1}function bt(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=Wr("span","xxxxxxxxxx"),n=Wr("pre",[t]);zr(e.measure,n);var i=t.getBoundingClientRect(),r=(i.right-i.left)/10;return r>2&&(e.cachedCharWidth=r),r||10}function xt(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:null,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Uo},Yo?Yo.ops.push(e.curOp):e.curOp.ownsGroup=Yo={ops:[e.curOp],delayedCallbacks:[]}}function wt(e){var t=e.delayedCallbacks,n=0;do{for(;n<t.length;n++)t[n].call(null);for(var i=0;i<e.ops.length;i++){var r=e.ops[i];if(r.cursorActivityHandlers)for(;r.cursorActivityCalled<r.cursorActivityHandlers.length;)r.cursorActivityHandlers[r.cursorActivityCalled++].call(null,r.cm)}}while(n<t.length)}function Ct(e){var t=e.curOp,n=t.ownsGroup;if(n)try{wt(n)}finally{Yo=null;for(var i=0;i<n.ops.length;i++)n.ops[i].cm.curOp=null;kt(n)}}function kt(e){for(var t=e.ops,n=0;n<t.length;n++)_t(t[n]);for(var n=0;n<t.length;n++)St(t[n]);for(var n=0;n<t.length;n++)Tt(t[n]);for(var n=0;n<t.length;n++)Dt(t[n]);for(var n=0;n<t.length;n++)Mt(t[n])}function _t(e){var t=e.cm,n=t.display;T(t),e.updateMaxLine&&h(t),e.mustUpdate=e.viewChanged||e.forceUpdate||null!=e.scrollTop||e.scrollToPos&&(e.scrollToPos.from.line<n.viewFrom||e.scrollToPos.to.line>=n.viewTo)||n.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new S(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function St(e){e.updatedDisplay=e.mustUpdate&&D(e.cm,e.update)}function Tt(e){var t=e.cm,n=t.display;e.updatedDisplay&&A(t),e.barMeasure=p(t),n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Qe(t,n.maxLine,n.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(n.scroller.clientWidth,n.sizer.offsetLeft+e.adjustWidthTo+Ue(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo-Ve(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=n.input.prepareSelection(e.focus))}function Dt(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&on(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var n=e.focus&&e.focus==Yr()&&(!document.hasFocus||document.hasFocus());e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,n),(e.updatedDisplay||e.startHeight!=t.doc.height)&&y(t,e.barMeasure),e.updatedDisplay&&L(t,e.barMeasure),e.selectionChanged&&He(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),n&&Z(e.cm)}function Mt(e){var t=e.cm,n=t.display,i=t.doc;if(e.updatedDisplay&&M(t,e.update),null==n.wheelStartX||null==e.scrollTop&&null==e.scrollLeft&&!e.scrollToPos||(n.wheelStartX=n.wheelStartY=null),null==e.scrollTop||n.scroller.scrollTop==e.scrollTop&&!e.forceScroll||(i.scrollTop=Math.max(0,Math.min(n.scroller.scrollHeight-n.scroller.clientHeight,e.scrollTop)),n.scrollbars.setScrollTop(i.scrollTop),n.scroller.scrollTop=i.scrollTop),null==e.scrollLeft||n.scroller.scrollLeft==e.scrollLeft&&!e.forceScroll||(i.scrollLeft=Math.max(0,Math.min(n.scroller.scrollWidth-n.scroller.clientWidth,e.scrollLeft)),n.scrollbars.setScrollLeft(i.scrollLeft),n.scroller.scrollLeft=i.scrollLeft,w(t)),e.scrollToPos){var r=Nn(t,me(i,e.scrollToPos.from),me(i,e.scrollToPos.to),e.scrollToPos.margin);e.scrollToPos.isCursor&&t.state.focused&&On(t,r)}var o=e.maybeHiddenMarkers,s=e.maybeUnhiddenMarkers;if(o)for(var a=0;a<o.length;++a)o[a].lines.length||Os(o[a],"hide");if(s)for(var a=0;a<s.length;++a)s[a].lines.length&&Os(s[a],"unhide");n.wrapper.offsetHeight&&(i.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&Os(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function Et(e,t){if(e.curOp)return t();xt(e);try{return t()}finally{Ct(e)}}function Lt(e,t){return function(){if(e.curOp)return t.apply(e,arguments);xt(e);try{return t.apply(e,arguments)}finally{Ct(e)}}}function At(e){return function(){if(this.curOp)return e.apply(this,arguments);xt(this);try{return e.apply(this,arguments)}finally{Ct(this)}}}function $t(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);xt(t);try{return e.apply(this,arguments)}finally{Ct(t)}}}function Ot(e,t,n){this.line=t,this.rest=bi(t),this.size=this.rest?tr($r(this.rest))-n+1:1,this.node=this.text=null,this.hidden=Ci(e,t)}function Nt(e,t,n){for(var i,r=[],o=t;n>o;o=i){var s=new Ot(e.doc,Ki(e.doc,o),o);i=o+s.size,r.push(s)}return r}function It(e,t,n,i){null==t&&(t=e.doc.first),null==n&&(n=e.doc.first+e.doc.size),i||(i=0);var r=e.display;if(i&&n<r.viewTo&&(null==r.updateLineNumbers||r.updateLineNumbers>t)&&(r.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=r.viewTo)Po&&xi(e.doc,t)<r.viewTo&&Pt(e);else if(n<=r.viewFrom)Po&&wi(e.doc,n+i)>r.viewFrom?Pt(e):(r.viewFrom+=i,r.viewTo+=i);else if(t<=r.viewFrom&&n>=r.viewTo)Pt(e);else if(t<=r.viewFrom){var o=Bt(e,n,n+i,1);o?(r.view=r.view.slice(o.index),r.viewFrom=o.lineN,r.viewTo+=i):Pt(e)}else if(n>=r.viewTo){var o=Bt(e,t,t,-1);o?(r.view=r.view.slice(0,o.index),r.viewTo=o.lineN):Pt(e)}else{var s=Bt(e,t,t,-1),a=Bt(e,n,n+i,1);s&&a?(r.view=r.view.slice(0,s.index).concat(Nt(e,s.lineN,a.lineN)).concat(r.view.slice(a.index)),r.viewTo+=i):Pt(e)}var l=r.externalMeasured;l&&(n<l.lineN?l.lineN+=i:t<l.lineN+l.size&&(r.externalMeasured=null))}function Rt(e,t,n){e.curOp.viewChanged=!0;var i=e.display,r=e.display.externalMeasured;if(r&&t>=r.lineN&&t<r.lineN+r.size&&(i.externalMeasured=null),!(t<i.viewFrom||t>=i.viewTo)){var o=i.view[Ht(e,t)];if(null!=o.node){var s=o.changes||(o.changes=[]);-1==Or(s,n)&&s.push(n)}}}function Pt(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Ht(e,t){if(t>=e.display.viewTo)return null;if(t-=e.display.viewFrom,0>t)return null;for(var n=e.display.view,i=0;i<n.length;i++)if(t-=n[i].size,0>t)return i}function Bt(e,t,n,i){var r,o=Ht(e,t),s=e.display.view;if(!Po||n==e.doc.first+e.doc.size)return{index:o,lineN:n};for(var a=0,l=e.display.viewFrom;o>a;a++)l+=s[a].size;if(l!=t){if(i>0){if(o==s.length-1)return null;r=l+s[o].size-t,o++}else r=l-t;t+=r,n+=r}for(;xi(e.doc,n)!=n;){if(o==(0>i?0:s.length-1))return null;n+=i*s[o-(0>i?1:0)].size,o+=i}return{index:o,lineN:n}}function jt(e,t,n){var i=e.display,r=i.view;0==r.length||t>=i.viewTo||n<=i.viewFrom?(i.view=Nt(e,t,n),i.viewFrom=t):(i.viewFrom>t?i.view=Nt(e,t,i.viewFrom).concat(i.view):i.viewFrom<t&&(i.view=i.view.slice(Ht(e,t))),i.viewFrom=t,i.viewTo<n?i.view=i.view.concat(Nt(e,i.viewTo,n)):i.viewTo>n&&(i.view=i.view.slice(0,Ht(e,n)))),i.viewTo=n}function Ft(e){for(var t=e.display.view,n=0,i=0;i<t.length;i++){var r=t[i];r.hidden||r.node&&!r.changes||++n}return n}function Wt(e){function t(){r.activeTouch&&(o=setTimeout(function(){r.activeTouch=null},1e3),s=r.activeTouch,s.end=+new Date)}function n(e){if(1!=e.touches.length)return!1;var t=e.touches[0];return t.radiusX<=1&&t.radiusY<=1}function i(e,t){if(null==t.left)return!0;var n=t.left-e.left,i=t.top-e.top;return n*n+i*i>400}var r=e.display;Ls(r.scroller,"mousedown",Lt(e,Vt)),bo&&11>xo?Ls(r.scroller,"dblclick",Lt(e,function(t){if(!Tr(e,t)){var n=Ut(e,t);if(n&&!Qt(e,t)&&!Yt(e.display,t)){Ds(t);var i=e.findWordAt(n);xe(e.doc,i.anchor,i.head)}}})):Ls(r.scroller,"dblclick",function(t){Tr(e,t)||Ds(t)}),Io||Ls(r.scroller,"contextmenu",function(t){bn(e,t)});var o,s={end:0};Ls(r.scroller,"touchstart",function(t){if(!Tr(e,t)&&!n(t)){clearTimeout(o);var i=+new Date;r.activeTouch={start:i,moved:!1,prev:i-s.end<=300?s:null},1==t.touches.length&&(r.activeTouch.left=t.touches[0].pageX,r.activeTouch.top=t.touches[0].pageY)}}),Ls(r.scroller,"touchmove",function(){r.activeTouch&&(r.activeTouch.moved=!0)}),Ls(r.scroller,"touchend",function(n){var o=r.activeTouch;if(o&&!Yt(r,n)&&null!=o.left&&!o.moved&&new Date-o.start<300){var s,a=e.coordsChar(r.activeTouch,"page");s=!o.prev||i(o,o.prev)?new de(a,a):!o.prev.prev||i(o,o.prev.prev)?e.findWordAt(a):new de(Ho(a.line,0),me(e.doc,Ho(a.line+1,0))),e.setSelection(s.anchor,s.head),e.focus(),Ds(n)}t()}),Ls(r.scroller,"touchcancel",t),Ls(r.scroller,"scroll",function(){r.scroller.clientHeight&&(rn(e,r.scroller.scrollTop),on(e,r.scroller.scrollLeft,!0),Os(e,"scroll",e))}),Ls(r.scroller,"mousewheel",function(t){sn(e,t)}),Ls(r.scroller,"DOMMouseScroll",function(t){sn(e,t)}),Ls(r.wrapper,"scroll",function(){r.wrapper.scrollTop=r.wrapper.scrollLeft=0}),r.dragFunctions={enter:function(t){Tr(e,t)||Es(t)},over:function(t){Tr(e,t)||(tn(e,t),Es(t))},start:function(t){en(e,t)},drop:Lt(e,Jt),leave:function(t){Tr(e,t)||nn(e)}};var a=r.input.getField();Ls(a,"keyup",function(t){pn.call(e,t)}),Ls(a,"keydown",Lt(e,hn)),Ls(a,"keypress",Lt(e,mn)),Ls(a,"focus",Hr(vn,e)),Ls(a,"blur",Hr(yn,e))}function qt(t,n,i){var r=i&&i!=e.Init;if(!n!=!r){var o=t.display.dragFunctions,s=n?Ls:$s;s(t.display.scroller,"dragstart",o.start),s(t.display.scroller,"dragenter",o.enter),s(t.display.scroller,"dragover",o.over),s(t.display.scroller,"dragleave",o.leave),s(t.display.scroller,"drop",o.drop)}}function zt(e){var t=e.display;t.lastWrapHeight==t.wrapper.clientHeight&&t.lastWrapWidth==t.wrapper.clientWidth||(t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize())}function Yt(e,t){for(var n=wr(t);n!=e.wrapper;n=n.parentNode)if(!n||1==n.nodeType&&"true"==n.getAttribute("cm-ignore-events")||n.parentNode==e.sizer&&n!=e.mover)return!0}function Ut(e,t,n,i){var r=e.display;if(!n&&"true"==wr(t).getAttribute("cm-not-content"))return null;var o,s,a=r.lineSpace.getBoundingClientRect();try{o=t.clientX-a.left,s=t.clientY-a.top}catch(t){return null}var l,c=gt(e,o,s);if(i&&1==c.xRel&&(l=Ki(e.doc,c.line).text).length==c.ch){var u=js(l,l.length,e.options.tabSize)-l.length;c=Ho(c.line,Math.max(0,Math.round((o-Ye(e.display).left)/bt(e.display))-u))}return c}function Vt(e){var t=this,n=t.display;if(!(Tr(t,e)||n.activeTouch&&n.input.supportsTouch())){if(n.shift=e.shiftKey,Yt(n,e))return void(wo||(n.scroller.draggable=!1,setTimeout(function(){n.scroller.draggable=!0},100)));if(!Qt(t,e)){var i=Ut(t,e);switch(window.focus(),Cr(e)){case 1:t.state.selectingText?t.state.selectingText(e):i?Gt(t,e,i):wr(e)==n.scroller&&Ds(e);break;case 2:wo&&(t.state.lastMiddleDown=+new Date),i&&xe(t.doc,i),setTimeout(function(){n.input.focus()},20),Ds(e);break;case 3:Io?bn(t,e):gn(t)}}}}function Gt(e,t,n){bo?setTimeout(Hr(Z,e),0):e.curOp.focus=Yr();var i,r=+new Date;qo&&qo.time>r-400&&0==Bo(qo.pos,n)?i="triple":Wo&&Wo.time>r-400&&0==Bo(Wo.pos,n)?(i="double",qo={time:r,pos:n}):(i="single",Wo={time:r,pos:n});var o,s=e.doc.sel,a=Lo?t.metaKey:t.ctrlKey;e.options.dragDrop&&ea&&!e.isReadOnly()&&"single"==i&&(o=s.contains(n))>-1&&(Bo((o=s.ranges[o]).from(),n)<0||n.xRel>0)&&(Bo(o.to(),n)>0||n.xRel<0)?Xt(e,t,n,a):Zt(e,t,n,i,a)}function Xt(e,t,n,i){var r=e.display,o=+new Date,s=Lt(e,function(a){wo&&(r.scroller.draggable=!1),e.state.draggingText=!1,$s(document,"mouseup",s),$s(r.scroller,"drop",s),Math.abs(t.clientX-a.clientX)+Math.abs(t.clientY-a.clientY)<10&&(Ds(a),!i&&+new Date-200<o&&xe(e.doc,n),wo||bo&&9==xo?setTimeout(function(){document.body.focus(),r.input.focus()},20):r.input.focus())});wo&&(r.scroller.draggable=!0),e.state.draggingText=s,r.scroller.dragDrop&&r.scroller.dragDrop(),Ls(document,"mouseup",s),Ls(r.scroller,"drop",s)}function Zt(e,t,n,i,r){function o(t){if(0!=Bo(g,t))if(g=t,"rect"==i){for(var r=[],o=e.options.tabSize,s=js(Ki(c,n.line).text,n.ch,o),a=js(Ki(c,t.line).text,t.ch,o),l=Math.min(s,a),f=Math.max(s,a),p=Math.min(n.line,t.line),m=Math.min(e.lastLine(),Math.max(n.line,t.line));m>=p;p++){var v=Ki(c,p).text,y=Fs(v,l,o);l==f?r.push(new de(Ho(p,y),Ho(p,y))):v.length>y&&r.push(new de(Ho(p,y),Ho(p,Fs(v,f,o))))}r.length||r.push(new de(n,n)),Te(c,he(h.ranges.slice(0,d).concat(r),d),{origin:"*mouse",scroll:!1}),e.scrollIntoView(t)}else{var b=u,x=b.anchor,w=t;if("single"!=i){if("double"==i)var C=e.findWordAt(t);else var C=new de(Ho(t.line,0),me(c,Ho(t.line+1,0)));Bo(C.anchor,x)>0?(w=C.head,x=X(b.from(),C.anchor)):(w=C.anchor,x=G(b.to(),C.head))}var r=h.ranges.slice(0);r[d]=new de(me(c,x),w),Te(c,he(r,d),Hs)}}function s(t){var n=++y,r=Ut(e,t,!0,"rect"==i);if(r)if(0!=Bo(r,g)){e.curOp.focus=Yr(),o(r);var a=x(l,c);(r.line>=a.to||r.line<a.from)&&setTimeout(Lt(e,function(){y==n&&s(t)}),150)}else{var u=t.clientY<v.top?-20:t.clientY>v.bottom?20:0;u&&setTimeout(Lt(e,function(){y==n&&(l.scroller.scrollTop+=u,s(t))}),50)}}function a(t){e.state.selectingText=!1,y=1/0,Ds(t),l.input.focus(),$s(document,"mousemove",b),$s(document,"mouseup",w),c.history.lastSelOrigin=null}var l=e.display,c=e.doc;Ds(t);var u,d,h=c.sel,f=h.ranges;if(r&&!t.shiftKey?(d=c.sel.contains(n),u=d>-1?f[d]:new de(n,n)):(u=c.sel.primary(),d=c.sel.primIndex),Ao?t.shiftKey&&t.metaKey:t.altKey)i="rect",r||(u=new de(n,n)),n=Ut(e,t,!0,!0),d=-1;else if("double"==i){var p=e.findWordAt(n);u=e.display.shift||c.extend?be(c,u,p.anchor,p.head):p}else if("triple"==i){var m=new de(Ho(n.line,0),me(c,Ho(n.line+1,0)));u=e.display.shift||c.extend?be(c,u,m.anchor,m.head):m}else u=be(c,u,n);r?-1==d?(d=f.length,Te(c,he(f.concat([u]),d),{scroll:!1,origin:"*mouse"})):f.length>1&&f[d].empty()&&"single"==i&&!t.shiftKey?(Te(c,he(f.slice(0,d).concat(f.slice(d+1)),0),{scroll:!1,origin:"*mouse"}),h=c.sel):Ce(c,d,u,Hs):(d=0,Te(c,new ue([u],0),Hs),h=c.sel);var g=n,v=l.wrapper.getBoundingClientRect(),y=0,b=Lt(e,function(e){Cr(e)?s(e):a(e)}),w=Lt(e,a);e.state.selectingText=w,Ls(document,"mousemove",b),Ls(document,"mouseup",w)}function Kt(e,t,n,i){try{var r=t.clientX,o=t.clientY}catch(t){return!1}if(r>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;i&&Ds(t);var s=e.display,a=s.lineDiv.getBoundingClientRect();if(o>a.bottom||!Mr(e,n))return xr(t);o-=a.top-s.viewOffset;for(var l=0;l<e.options.gutters.length;++l){var c=s.gutters.childNodes[l];if(c&&c.getBoundingClientRect().right>=r){var u=nr(e.doc,o),d=e.options.gutters[l];return Os(e,n,e,u,d,t),xr(t)}}}function Qt(e,t){return Kt(e,t,"gutterClick",!0)}function Jt(e){var t=this;if(nn(t),!Tr(t,e)&&!Yt(t.display,e)){Ds(e),bo&&(Vo=+new Date);var n=Ut(t,e,!0),i=e.dataTransfer.files;if(n&&!t.isReadOnly())if(i&&i.length&&window.FileReader&&window.File)for(var r=i.length,o=Array(r),s=0,a=function(e,i){if(!t.options.allowDropFileTypes||-1!=Or(t.options.allowDropFileTypes,e.type)){var a=new FileReader;a.onload=Lt(t,function(){var e=a.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(e)&&(e=""),o[i]=e,++s==r){n=me(t.doc,n);var l={from:n,to:n,text:t.doc.splitLines(o.join(t.doc.lineSeparator())),origin:"paste"};Tn(t.doc,l),Se(t.doc,fe(n,Jo(l)))}}),a.readAsText(e)}},l=0;r>l;++l)a(i[l],l);else{if(t.state.draggingText&&t.doc.sel.contains(n)>-1)return t.state.draggingText(e),void setTimeout(function(){t.display.input.focus()},20);try{var o=e.dataTransfer.getData("Text");if(o){if(t.state.draggingText&&!(Lo?e.altKey:e.ctrlKey))var c=t.listSelections();if(De(t.doc,fe(n,n)),c)for(var l=0;l<c.length;++l)$n(t.doc,"",c[l].anchor,c[l].head,"drag");t.replaceSelection(o,"around","paste"),t.display.input.focus()}}catch(e){}}}}function en(e,t){if(bo&&(!e.state.draggingText||+new Date-Vo<100))return void Es(t);if(!Tr(e,t)&&!Yt(e.display,t)&&(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!So)){var n=Wr("img",null,null,"position: fixed; left: 0; top: 0;");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",_o&&(n.width=n.height=1,e.display.wrapper.appendChild(n),n._top=n.offsetTop),t.dataTransfer.setDragImage(n,0,0),_o&&n.parentNode.removeChild(n)}}function tn(e,t){var n=Ut(e,t);if(n){var i=document.createDocumentFragment();Re(e,n,i),e.display.dragCursor||(e.display.dragCursor=Wr("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),zr(e.display.dragCursor,i)}}function nn(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function rn(e,t){Math.abs(e.doc.scrollTop-t)<2||(e.doc.scrollTop=t,go||E(e,{top:t}),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t),e.display.scrollbars.setScrollTop(t),go&&E(e),Be(e,100))}function on(e,t,n){(n?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)||(t=Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth),e.doc.scrollLeft=t,w(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function sn(e,t){var n=Zo(t),i=n.x,r=n.y,o=e.display,s=o.scroller,a=s.scrollWidth>s.clientWidth,l=s.scrollHeight>s.clientHeight;
  if(i&&a||r&&l){if(r&&Lo&&wo)e:for(var c=t.target,u=o.view;c!=s;c=c.parentNode)for(var d=0;d<u.length;d++)if(u[d].node==c){e.display.currentWheelTarget=c;break e}if(i&&!go&&!_o&&null!=Xo)return r&&l&&rn(e,Math.max(0,Math.min(s.scrollTop+r*Xo,s.scrollHeight-s.clientHeight))),on(e,Math.max(0,Math.min(s.scrollLeft+i*Xo,s.scrollWidth-s.clientWidth))),(!r||r&&l)&&Ds(t),void(o.wheelStartX=null);if(r&&null!=Xo){var h=r*Xo,f=e.doc.scrollTop,p=f+o.wrapper.clientHeight;0>h?f=Math.max(0,f+h-50):p=Math.min(e.doc.height,p+h+50),E(e,{top:f,bottom:p})}20>Go&&(null==o.wheelStartX?(o.wheelStartX=s.scrollLeft,o.wheelStartY=s.scrollTop,o.wheelDX=i,o.wheelDY=r,setTimeout(function(){if(null!=o.wheelStartX){var e=s.scrollLeft-o.wheelStartX,t=s.scrollTop-o.wheelStartY,n=t&&o.wheelDY&&t/o.wheelDY||e&&o.wheelDX&&e/o.wheelDX;o.wheelStartX=o.wheelStartY=null,n&&(Xo=(Xo*Go+n)/(Go+1),++Go)}},200)):(o.wheelDX+=i,o.wheelDY+=r))}}function an(e,t,n){if("string"==typeof t&&(t=us[t],!t))return!1;e.display.input.ensurePolled();var i=e.display.shift,r=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),n&&(e.display.shift=!1),r=t(e)!=Rs}finally{e.display.shift=i,e.state.suppressEdits=!1}return r}function ln(e,t,n){for(var i=0;i<e.state.keyMaps.length;i++){var r=hs(t,e.state.keyMaps[i],n,e);if(r)return r}return e.options.extraKeys&&hs(t,e.options.extraKeys,n,e)||hs(t,e.options.keyMap,n,e)}function cn(e,t,n,i){var r=e.state.keySeq;if(r){if(fs(t))return"handled";Ko.set(50,function(){e.state.keySeq==r&&(e.state.keySeq=null,e.display.input.reset())}),t=r+" "+t}var o=ln(e,t,i);return"multi"==o&&(e.state.keySeq=t),"handled"==o&&_r(e,"keyHandled",e,t,n),"handled"!=o&&"multi"!=o||(Ds(n),He(e)),r&&!o&&/\'$/.test(t)?(Ds(n),!0):!!o}function un(e,t){var n=ps(t,!0);return!!n&&(t.shiftKey&&!e.state.keySeq?cn(e,"Shift-"+n,t,function(t){return an(e,t,!0)})||cn(e,n,t,function(t){return("string"==typeof t?/^go[A-Z]/.test(t):t.motion)?an(e,t):void 0}):cn(e,n,t,function(t){return an(e,t)}))}function dn(e,t,n){return cn(e,"'"+n+"'",t,function(t){return an(e,t,!0)})}function hn(e){var t=this;if(t.curOp.focus=Yr(),!Tr(t,e)){bo&&11>xo&&27==e.keyCode&&(e.returnValue=!1);var n=e.keyCode;t.display.shift=16==n||e.shiftKey;var i=un(t,e);_o&&(Qo=i?n:null,!i&&88==n&&!ia&&(Lo?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),18!=n||/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)||fn(t)}}function fn(e){function t(e){18!=e.keyCode&&e.altKey||(Ks(n,"CodeMirror-crosshair"),$s(document,"keyup",t),$s(document,"mouseover",t))}var n=e.display.lineDiv;Qs(n,"CodeMirror-crosshair"),Ls(document,"keyup",t),Ls(document,"mouseover",t)}function pn(e){16==e.keyCode&&(this.doc.sel.shift=!1),Tr(this,e)}function mn(e){var t=this;if(!(Yt(t.display,e)||Tr(t,e)||e.ctrlKey&&!e.altKey||Lo&&e.metaKey)){var n=e.keyCode,i=e.charCode;if(_o&&n==Qo)return Qo=null,void Ds(e);if(!_o||e.which&&!(e.which<10)||!un(t,e)){var r=String.fromCharCode(null==i?n:i);dn(t,e,r)||t.display.input.onKeyPress(e)}}}function gn(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,yn(e))},100)}function vn(e){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),"nocursor"!=e.options.readOnly&&(e.state.focused||(Os(e,"focus",e),e.state.focused=!0,Qs(e.display.wrapper,"CodeMirror-focused"),e.curOp||e.display.selForContextMenu==e.doc.sel||(e.display.input.reset(),wo&&setTimeout(function(){e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),He(e))}function yn(e){e.state.delayingBlurEvent||(e.state.focused&&(Os(e,"blur",e),e.state.focused=!1,Ks(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150))}function bn(e,t){Yt(e.display,t)||xn(e,t)||Tr(e,t,"contextmenu")||e.display.input.onContextMenu(t)}function xn(e,t){return!!Mr(e,"gutterContextMenu")&&Kt(e,t,"gutterContextMenu",!1)}function wn(e,t){if(Bo(e,t.from)<0)return e;if(Bo(e,t.to)<=0)return Jo(t);var n=e.line+t.text.length-(t.to.line-t.from.line)-1,i=e.ch;return e.line==t.to.line&&(i+=Jo(t).ch-t.to.ch),Ho(n,i)}function Cn(e,t){for(var n=[],i=0;i<e.sel.ranges.length;i++){var r=e.sel.ranges[i];n.push(new de(wn(r.anchor,t),wn(r.head,t)))}return he(n,e.sel.primIndex)}function kn(e,t,n){return e.line==t.line?Ho(n.line,e.ch-t.ch+n.ch):Ho(n.line+(e.line-t.line),e.ch)}function _n(e,t,n){for(var i=[],r=Ho(e.first,0),o=r,s=0;s<t.length;s++){var a=t[s],l=kn(a.from,r,o),c=kn(Jo(a),r,o);if(r=a.to,o=c,"around"==n){var u=e.sel.ranges[s],d=Bo(u.head,u.anchor)<0;i[s]=new de(d?c:l,d?l:c)}else i[s]=new de(l,l)}return new ue(i,e.sel.primIndex)}function Sn(e,t,n){var i={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){this.canceled=!0}};return n&&(i.update=function(t,n,i,r){t&&(this.from=me(e,t)),n&&(this.to=me(e,n)),i&&(this.text=i),void 0!==r&&(this.origin=r)}),Os(e,"beforeChange",e,i),e.cm&&Os(e.cm,"beforeChange",e.cm,i),i.canceled?null:{from:i.from,to:i.to,text:i.text,origin:i.origin}}function Tn(e,t,n){if(e.cm){if(!e.cm.curOp)return Lt(e.cm,Tn)(e,t,n);if(e.cm.state.suppressEdits)return}if(!(Mr(e,"beforeChange")||e.cm&&Mr(e.cm,"beforeChange"))||(t=Sn(e,t,!0))){var i=Ro&&!n&&li(e,t.from,t.to);if(i)for(var r=i.length-1;r>=0;--r)Dn(e,{from:i[r].from,to:i[r].to,text:r?[""]:t.text});else Dn(e,t)}}function Dn(e,t){if(1!=t.text.length||""!=t.text[0]||0!=Bo(t.from,t.to)){var n=Cn(e,t);cr(e,t,n,e.cm?e.cm.curOp.id:NaN),Ln(e,t,n,oi(e,t));var i=[];Xi(e,function(e,n){n||-1!=Or(i,e.history)||(br(e.history,t),i.push(e.history)),Ln(e,t,null,oi(e,t))})}}function Mn(e,t,n){if(!e.cm||!e.cm.state.suppressEdits){for(var i,r=e.history,o=e.sel,s="undo"==t?r.done:r.undone,a="undo"==t?r.undone:r.done,l=0;l<s.length&&(i=s[l],n?!i.ranges||i.equals(e.sel):i.ranges);l++);if(l!=s.length){for(r.lastOrigin=r.lastSelOrigin=null;i=s.pop(),i.ranges;){if(hr(i,a),n&&!i.equals(e.sel))return void Te(e,i,{clearRedo:!1});o=i}var c=[];hr(o,a),a.push({changes:c,generation:r.generation}),r.generation=i.generation||++r.maxGeneration;for(var u=Mr(e,"beforeChange")||e.cm&&Mr(e.cm,"beforeChange"),l=i.changes.length-1;l>=0;--l){var d=i.changes[l];if(d.origin=t,u&&!Sn(e,d,!1))return void(s.length=0);c.push(sr(e,d));var h=l?Cn(e,d):$r(s);Ln(e,d,h,ai(e,d)),!l&&e.cm&&e.cm.scrollIntoView({from:d.from,to:Jo(d)});var f=[];Xi(e,function(e,t){t||-1!=Or(f,e.history)||(br(e.history,d),f.push(e.history)),Ln(e,d,null,ai(e,d))})}}}}function En(e,t){if(0!=t&&(e.first+=t,e.sel=new ue(Nr(e.sel.ranges,function(e){return new de(Ho(e.anchor.line+t,e.anchor.ch),Ho(e.head.line+t,e.head.ch))}),e.sel.primIndex),e.cm)){It(e.cm,e.first,e.first-t,t);for(var n=e.cm.display,i=n.viewFrom;i<n.viewTo;i++)Rt(e.cm,i,"gutter")}}function Ln(e,t,n,i){if(e.cm&&!e.cm.curOp)return Lt(e.cm,Ln)(e,t,n,i);if(t.to.line<e.first)return void En(e,t.text.length-1-(t.to.line-t.from.line));if(!(t.from.line>e.lastLine())){if(t.from.line<e.first){var r=t.text.length-1-(e.first-t.from.line);En(e,r),t={from:Ho(e.first,0),to:Ho(t.to.line+r,t.to.ch),text:[$r(t.text)],origin:t.origin}}var o=e.lastLine();t.to.line>o&&(t={from:t.from,to:Ho(o,Ki(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Qi(e,t.from,t.to),n||(n=Cn(e,t)),e.cm?An(e.cm,t,i):Ui(e,t,i),De(e,n,Ps)}}function An(e,t,n){var i=e.doc,r=e.display,s=t.from,a=t.to,l=!1,c=s.line;e.options.lineWrapping||(c=tr(yi(Ki(i,s.line))),i.iter(c,a.line+1,function(e){return e==r.maxLine?(l=!0,!0):void 0})),i.sel.contains(t.from,t.to)>-1&&Dr(e),Ui(i,t,n,o(e)),e.options.lineWrapping||(i.iter(c,s.line+t.text.length,function(e){var t=d(e);t>r.maxLineLength&&(r.maxLine=e,r.maxLineLength=t,r.maxLineChanged=!0,l=!1)}),l&&(e.curOp.updateMaxLine=!0)),i.frontier=Math.min(i.frontier,s.line),Be(e,400);var u=t.text.length-(a.line-s.line)-1;t.full?It(e):s.line!=a.line||1!=t.text.length||Yi(e.doc,t)?It(e,s.line,a.line+1,u):Rt(e,s.line,"text");var h=Mr(e,"changes"),f=Mr(e,"change");if(f||h){var p={from:s,to:a,text:t.text,removed:t.removed,origin:t.origin};f&&_r(e,"change",e,p),h&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(p)}e.display.selForContextMenu=null}function $n(e,t,n,i,r){if(i||(i=n),Bo(i,n)<0){var o=i;i=n,n=o}"string"==typeof t&&(t=e.splitLines(t)),Tn(e,{from:n,to:i,text:t,origin:r})}function On(e,t){if(!Tr(e,"scrollCursorIntoView")){var n=e.display,i=n.sizer.getBoundingClientRect(),r=null;if(t.top+i.top<0?r=!0:t.bottom+i.top>(window.innerHeight||document.documentElement.clientHeight)&&(r=!1),null!=r&&!Do){var o=Wr("div","​",null,"position: absolute; top: "+(t.top-n.viewOffset-qe(e.display))+"px; height: "+(t.bottom-t.top+Ue(e)+n.barHeight)+"px; left: "+t.left+"px; width: 2px;");e.display.lineSpace.appendChild(o),o.scrollIntoView(r),e.display.lineSpace.removeChild(o)}}}function Nn(e,t,n,i){null==i&&(i=0);for(var r=0;5>r;r++){var o=!1,s=ft(e,t),a=n&&n!=t?ft(e,n):s,l=Rn(e,Math.min(s.left,a.left),Math.min(s.top,a.top)-i,Math.max(s.left,a.left),Math.max(s.bottom,a.bottom)+i),c=e.doc.scrollTop,u=e.doc.scrollLeft;if(null!=l.scrollTop&&(rn(e,l.scrollTop),Math.abs(e.doc.scrollTop-c)>1&&(o=!0)),null!=l.scrollLeft&&(on(e,l.scrollLeft),Math.abs(e.doc.scrollLeft-u)>1&&(o=!0)),!o)break}return s}function In(e,t,n,i,r){var o=Rn(e,t,n,i,r);null!=o.scrollTop&&rn(e,o.scrollTop),null!=o.scrollLeft&&on(e,o.scrollLeft)}function Rn(e,t,n,i,r){var o=e.display,s=yt(e.display);0>n&&(n=0);var a=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:o.scroller.scrollTop,l=Ge(e),c={};r-n>l&&(r=n+l);var u=e.doc.height+ze(o),d=s>n,h=r>u-s;if(a>n)c.scrollTop=d?0:n;else if(r>a+l){var f=Math.min(n,(h?u:r)-l);f!=a&&(c.scrollTop=f)}var p=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:o.scroller.scrollLeft,m=Ve(e)-(e.options.fixedGutter?o.gutters.offsetWidth:0),g=i-t>m;return g&&(i=t+m),10>t?c.scrollLeft=0:p>t?c.scrollLeft=Math.max(0,t-(g?0:10)):i>m+p-3&&(c.scrollLeft=i+(g?0:10)-m),c}function Pn(e,t,n){null==t&&null==n||Bn(e),null!=t&&(e.curOp.scrollLeft=(null==e.curOp.scrollLeft?e.doc.scrollLeft:e.curOp.scrollLeft)+t),null!=n&&(e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+n)}function Hn(e){Bn(e);var t=e.getCursor(),n=t,i=t;e.options.lineWrapping||(n=t.ch?Ho(t.line,t.ch-1):t,i=Ho(t.line,t.ch+1)),e.curOp.scrollToPos={from:n,to:i,margin:e.options.cursorScrollMargin,isCursor:!0}}function Bn(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var n=pt(e,t.from),i=pt(e,t.to),r=Rn(e,Math.min(n.left,i.left),Math.min(n.top,i.top)-t.margin,Math.max(n.right,i.right),Math.max(n.bottom,i.bottom)+t.margin);e.scrollTo(r.scrollLeft,r.scrollTop)}}function jn(e,t,n,i){var r,o=e.doc;null==n&&(n="add"),"smart"==n&&(o.mode.indent?r=We(e,t):n="prev");var s=e.options.tabSize,a=Ki(o,t),l=js(a.text,null,s);a.stateAfter&&(a.stateAfter=null);var c,u=a.text.match(/^\s*/)[0];if(i||/\S/.test(a.text)){if("smart"==n&&(c=o.mode.indent(r,a.text.slice(u.length),a.text),c==Rs||c>150)){if(!i)return;n="prev"}}else c=0,n="not";"prev"==n?c=t>o.first?js(Ki(o,t-1).text,null,s):0:"add"==n?c=l+e.options.indentUnit:"subtract"==n?c=l-e.options.indentUnit:"number"==typeof n&&(c=l+n),c=Math.max(0,c);var d="",h=0;if(e.options.indentWithTabs)for(var f=Math.floor(c/s);f;--f)h+=s,d+="\t";if(c>h&&(d+=Ar(c-h)),d!=u)return $n(o,d,Ho(t,0),Ho(t,u.length),"+input"),a.stateAfter=null,!0;for(var f=0;f<o.sel.ranges.length;f++){var p=o.sel.ranges[f];if(p.head.line==t&&p.head.ch<u.length){var h=Ho(t,u.length);Ce(o,f,new de(h,h));break}}}function Fn(e,t,n,i){var r=t,o=t;return"number"==typeof t?o=Ki(e,pe(e,t)):r=tr(t),null==r?null:(i(o,r)&&e.cm&&Rt(e.cm,r,n),o)}function Wn(e,t){for(var n=e.doc.sel.ranges,i=[],r=0;r<n.length;r++){for(var o=t(n[r]);i.length&&Bo(o.from,$r(i).to)<=0;){var s=i.pop();if(Bo(s.from,o.from)<0){o.from=s.from;break}}i.push(o)}Et(e,function(){for(var t=i.length-1;t>=0;t--)$n(e.doc,"",i[t].from,i[t].to,"+delete");Hn(e)})}function qn(e,t,n,i,r){function o(){var t=a+n;return!(t<e.first||t>=e.first+e.size)&&(a=t,u=Ki(e,t))}function s(e){var t=(r?ho:fo)(u,l,n,!0);if(null==t){if(e||!o())return!1;l=r?(0>n?ro:io)(u):0>n?u.text.length:0}else l=t;return!0}var a=t.line,l=t.ch,c=n,u=Ki(e,a);if("char"==i)s();else if("column"==i)s(!0);else if("word"==i||"group"==i)for(var d=null,h="group"==i,f=e.cm&&e.cm.getHelper(t,"wordChars"),p=!0;!(0>n)||s(!p);p=!1){var m=u.text.charAt(l)||"\n",g=Br(m,f)?"w":h&&"\n"==m?"n":!h||/\s/.test(m)?null:"p";if(!h||p||g||(g="s"),d&&d!=g){0>n&&(n=1,s());break}if(g&&(d=g),n>0&&!s(!p))break}var v=$e(e,Ho(a,l),t,c,!0);return Bo(t,v)||(v.hitSide=!0),v}function zn(e,t,n,i){var r,o=e.doc,s=t.left;if("page"==i){var a=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight);r=t.top+n*(a-(0>n?1.5:.5)*yt(e.display))}else"line"==i&&(r=n>0?t.bottom+3:t.top-3);for(;;){var l=gt(e,s,r);if(!l.outside)break;if(0>n?0>=r:r>=o.height){l.hitSide=!0;break}r+=5*n}return l}function Yn(t,n,i,r){e.defaults[t]=n,i&&(ts[t]=r?function(e,t,n){n!=ns&&i(e,t,n)}:i)}function Un(e){for(var t,n,i,r,o=e.split(/-(?!$)/),e=o[o.length-1],s=0;s<o.length-1;s++){var a=o[s];if(/^(cmd|meta|m)$/i.test(a))r=!0;else if(/^a(lt)?$/i.test(a))t=!0;else if(/^(c|ctrl|control)$/i.test(a))n=!0;else{if(!/^s(hift)$/i.test(a))throw new Error("Unrecognized modifier name: "+a);i=!0}}return t&&(e="Alt-"+e),n&&(e="Ctrl-"+e),r&&(e="Cmd-"+e),i&&(e="Shift-"+e),e}function Vn(e){return"string"==typeof e?ds[e]:e}function Gn(e,t,n,i,r){if(i&&i.shared)return Xn(e,t,n,i,r);if(e.cm&&!e.cm.curOp)return Lt(e.cm,Gn)(e,t,n,i,r);var o=new vs(e,r),s=Bo(t,n);if(i&&Pr(i,o,!1),s>0||0==s&&o.clearWhenEmpty!==!1)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=Wr("span",[o.replacedWith],"CodeMirror-widget"),i.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),i.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(vi(e,t.line,t,n,o)||t.line!=n.line&&vi(e,n.line,t,n,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");Po=!0}o.addToHistory&&cr(e,{from:t,to:n,origin:"markText"},e.sel,NaN);var a,l=t.line,c=e.cm;if(e.iter(l,n.line+1,function(e){c&&o.collapsed&&!c.options.lineWrapping&&yi(e)==c.display.maxLine&&(a=!0),o.collapsed&&l!=t.line&&er(e,0),ni(e,new Jn(o,l==t.line?t.ch:null,l==n.line?n.ch:null)),++l}),o.collapsed&&e.iter(t.line,n.line+1,function(t){Ci(e,t)&&er(t,0)}),o.clearOnEnter&&Ls(o,"beforeCursorEnter",function(){o.clear()}),o.readOnly&&(Ro=!0,(e.history.done.length||e.history.undone.length)&&e.clearHistory()),o.collapsed&&(o.id=++gs,o.atomic=!0),c){if(a&&(c.curOp.updateMaxLine=!0),o.collapsed)It(c,t.line,n.line+1);else if(o.className||o.title||o.startStyle||o.endStyle||o.css)for(var u=t.line;u<=n.line;u++)Rt(c,u,"text");o.atomic&&Ee(c.doc),_r(c,"markerAdded",c,o)}return o}function Xn(e,t,n,i,r){i=Pr(i),i.shared=!1;var o=[Gn(e,t,n,i,r)],s=o[0],a=i.widgetNode;return Xi(e,function(e){a&&(i.widgetNode=a.cloneNode(!0)),o.push(Gn(e,me(e,t),me(e,n),i,r));for(var l=0;l<e.linked.length;++l)if(e.linked[l].isParent)return;s=$r(o)}),new ys(o,s)}function Zn(e){return e.findMarks(Ho(e.first,0),e.clipPos(Ho(e.lastLine())),function(e){return e.parent})}function Kn(e,t){for(var n=0;n<t.length;n++){var i=t[n],r=i.find(),o=e.clipPos(r.from),s=e.clipPos(r.to);if(Bo(o,s)){var a=Gn(e,o,s,i.primary,i.primary.type);i.markers.push(a),a.parent=i}}}function Qn(e){for(var t=0;t<e.length;t++){var n=e[t],i=[n.primary.doc];Xi(n.primary.doc,function(e){i.push(e)});for(var r=0;r<n.markers.length;r++){var o=n.markers[r];-1==Or(i,o.doc)&&(o.parent=null,n.markers.splice(r--,1))}}}function Jn(e,t,n){this.marker=e,this.from=t,this.to=n}function ei(e,t){if(e)for(var n=0;n<e.length;++n){var i=e[n];if(i.marker==t)return i}}function ti(e,t){for(var n,i=0;i<e.length;++i)e[i]!=t&&(n||(n=[])).push(e[i]);return n}function ni(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}function ii(e,t,n){if(e)for(var i,r=0;r<e.length;++r){var o=e[r],s=o.marker,a=null==o.from||(s.inclusiveLeft?o.from<=t:o.from<t);if(a||o.from==t&&"bookmark"==s.type&&(!n||!o.marker.insertLeft)){var l=null==o.to||(s.inclusiveRight?o.to>=t:o.to>t);(i||(i=[])).push(new Jn(s,o.from,l?null:o.to))}}return i}function ri(e,t,n){if(e)for(var i,r=0;r<e.length;++r){var o=e[r],s=o.marker,a=null==o.to||(s.inclusiveRight?o.to>=t:o.to>t);if(a||o.from==t&&"bookmark"==s.type&&(!n||o.marker.insertLeft)){var l=null==o.from||(s.inclusiveLeft?o.from<=t:o.from<t);(i||(i=[])).push(new Jn(s,l?null:o.from-t,null==o.to?null:o.to-t))}}return i}function oi(e,t){if(t.full)return null;var n=ve(e,t.from.line)&&Ki(e,t.from.line).markedSpans,i=ve(e,t.to.line)&&Ki(e,t.to.line).markedSpans;if(!n&&!i)return null;var r=t.from.ch,o=t.to.ch,s=0==Bo(t.from,t.to),a=ii(n,r,s),l=ri(i,o,s),c=1==t.text.length,u=$r(t.text).length+(c?r:0);if(a)for(var d=0;d<a.length;++d){var h=a[d];if(null==h.to){var f=ei(l,h.marker);f?c&&(h.to=null==f.to?null:f.to+u):h.to=r}}if(l)for(var d=0;d<l.length;++d){var h=l[d];if(null!=h.to&&(h.to+=u),null==h.from){var f=ei(a,h.marker);f||(h.from=u,c&&(a||(a=[])).push(h))}else h.from+=u,c&&(a||(a=[])).push(h)}a&&(a=si(a)),l&&l!=a&&(l=si(l));var p=[a];if(!c){var m,g=t.text.length-2;if(g>0&&a)for(var d=0;d<a.length;++d)null==a[d].to&&(m||(m=[])).push(new Jn(a[d].marker,null,null));for(var d=0;g>d;++d)p.push(m);p.push(l)}return p}function si(e){for(var t=0;t<e.length;++t){var n=e[t];null!=n.from&&n.from==n.to&&n.marker.clearWhenEmpty!==!1&&e.splice(t--,1)}return e.length?e:null}function ai(e,t){var n=mr(e,t),i=oi(e,t);if(!n)return i;if(!i)return n;for(var r=0;r<n.length;++r){var o=n[r],s=i[r];if(o&&s)e:for(var a=0;a<s.length;++a){for(var l=s[a],c=0;c<o.length;++c)if(o[c].marker==l.marker)continue e;o.push(l)}else s&&(n[r]=s)}return n}function li(e,t,n){var i=null;if(e.iter(t.line,n.line+1,function(e){if(e.markedSpans)for(var t=0;t<e.markedSpans.length;++t){var n=e.markedSpans[t].marker;!n.readOnly||i&&-1!=Or(i,n)||(i||(i=[])).push(n)}}),!i)return null;for(var r=[{from:t,to:n}],o=0;o<i.length;++o)for(var s=i[o],a=s.find(0),l=0;l<r.length;++l){var c=r[l];if(!(Bo(c.to,a.from)<0||Bo(c.from,a.to)>0)){var u=[l,1],d=Bo(c.from,a.from),h=Bo(c.to,a.to);(0>d||!s.inclusiveLeft&&!d)&&u.push({from:c.from,to:a.from}),(h>0||!s.inclusiveRight&&!h)&&u.push({from:a.to,to:c.to}),r.splice.apply(r,u),l+=u.length-1}}return r}function ci(e){var t=e.markedSpans;if(t){for(var n=0;n<t.length;++n)t[n].marker.detachLine(e);e.markedSpans=null}}function ui(e,t){if(t){for(var n=0;n<t.length;++n)t[n].marker.attachLine(e);e.markedSpans=t}}function di(e){return e.inclusiveLeft?-1:0}function hi(e){return e.inclusiveRight?1:0}function fi(e,t){var n=e.lines.length-t.lines.length;if(0!=n)return n;var i=e.find(),r=t.find(),o=Bo(i.from,r.from)||di(e)-di(t);if(o)return-o;var s=Bo(i.to,r.to)||hi(e)-hi(t);return s?s:t.id-e.id}function pi(e,t){var n,i=Po&&e.markedSpans;if(i)for(var r,o=0;o<i.length;++o)r=i[o],r.marker.collapsed&&null==(t?r.from:r.to)&&(!n||fi(n,r.marker)<0)&&(n=r.marker);return n}function mi(e){return pi(e,!0)}function gi(e){return pi(e,!1)}function vi(e,t,n,i,r){var o=Ki(e,t),s=Po&&o.markedSpans;if(s)for(var a=0;a<s.length;++a){var l=s[a];if(l.marker.collapsed){var c=l.marker.find(0),u=Bo(c.from,n)||di(l.marker)-di(r),d=Bo(c.to,i)||hi(l.marker)-hi(r);if(!(u>=0&&0>=d||0>=u&&d>=0)&&(0>=u&&(l.marker.inclusiveRight&&r.inclusiveLeft?Bo(c.to,n)>=0:Bo(c.to,n)>0)||u>=0&&(l.marker.inclusiveRight&&r.inclusiveLeft?Bo(c.from,i)<=0:Bo(c.from,i)<0)))return!0}}}function yi(e){for(var t;t=mi(e);)e=t.find(-1,!0).line;return e}function bi(e){for(var t,n;t=gi(e);)e=t.find(1,!0).line,(n||(n=[])).push(e);return n}function xi(e,t){var n=Ki(e,t),i=yi(n);return n==i?t:tr(i)}function wi(e,t){if(t>e.lastLine())return t;var n,i=Ki(e,t);if(!Ci(e,i))return t;for(;n=gi(i);)i=n.find(1,!0).line;return tr(i)+1}function Ci(e,t){var n=Po&&t.markedSpans;if(n)for(var i,r=0;r<n.length;++r)if(i=n[r],i.marker.collapsed){if(null==i.from)return!0;if(!i.marker.widgetNode&&0==i.from&&i.marker.inclusiveLeft&&ki(e,t,i))return!0}}function ki(e,t,n){if(null==n.to){var i=n.marker.find(1,!0);return ki(e,i.line,ei(i.line.markedSpans,n.marker))}if(n.marker.inclusiveRight&&n.to==t.text.length)return!0;for(var r,o=0;o<t.markedSpans.length;++o)if(r=t.markedSpans[o],r.marker.collapsed&&!r.marker.widgetNode&&r.from==n.to&&(null==r.to||r.to!=n.from)&&(r.marker.inclusiveLeft||n.marker.inclusiveRight)&&ki(e,t,r))return!0}function _i(e,t,n){ir(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&Pn(e,null,n)}function Si(e){if(null!=e.height)return e.height;var t=e.doc.cm;if(!t)return 0;if(!Gs(document.body,e.node)){var n="position: relative;";e.coverGutter&&(n+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(n+="width: "+t.display.wrapper.clientWidth+"px;"),zr(t.display.measure,Wr("div",[e.node],null,n))}return e.height=e.node.parentNode.offsetHeight}function Ti(e,t,n,i){var r=new bs(e,n,i),o=e.cm;return o&&r.noHScroll&&(o.display.alignWidgets=!0),Fn(e,t,"widget",function(t){var n=t.widgets||(t.widgets=[]);if(null==r.insertAt?n.push(r):n.splice(Math.min(n.length-1,Math.max(0,r.insertAt)),0,r),r.line=t,o&&!Ci(e,t)){var i=ir(t)<e.scrollTop;er(t,t.height+Si(r)),i&&Pn(o,null,r.height),o.curOp.forceUpdate=!0}return!0}),r}function Di(e,t,n,i){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),null!=e.order&&(e.order=null),ci(e),ui(e,n);var r=i?i(e):1;r!=e.height&&er(e,r)}function Mi(e){e.parent=null,ci(e)}function Ei(e,t){if(e)for(;;){var n=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!n)break;e=e.slice(0,n.index)+e.slice(n.index+n[0].length);var i=n[1]?"bgClass":"textClass";null==t[i]?t[i]=n[2]:new RegExp("(?:^|s)"+n[2]+"(?:$|s)").test(t[i])||(t[i]+=" "+n[2])}return e}function Li(t,n){if(t.blankLine)return t.blankLine(n);if(t.innerMode){var i=e.innerMode(t,n);return i.mode.blankLine?i.mode.blankLine(i.state):void 0}}function Ai(t,n,i,r){for(var o=0;10>o;o++){r&&(r[0]=e.innerMode(t,i).mode);var s=t.token(n,i);if(n.pos>n.start)return s}throw new Error("Mode "+t.name+" failed to advance stream.")}function $i(e,t,n,i){function r(e){return{start:d.start,end:d.pos,string:d.current(),type:o||null,state:e?ls(s.mode,u):u}}var o,s=e.doc,a=s.mode;t=me(s,t);var l,c=Ki(s,t.line),u=We(e,t.line,n),d=new ms(c.text,e.options.tabSize);for(i&&(l=[]);(i||d.pos<t.ch)&&!d.eol();)d.start=d.pos,o=Ai(a,d,u),i&&l.push(r(!0));return i?l:r()}function Oi(e,t,n,i,r,o,s){var a=n.flattenSpans;null==a&&(a=e.options.flattenSpans);var l,c=0,u=null,d=new ms(t,e.options.tabSize),h=e.options.addModeClass&&[null];for(""==t&&Ei(Li(n,i),o);!d.eol();){if(d.pos>e.options.maxHighlightLength?(a=!1,s&&Ri(e,t,i,d.pos),d.pos=t.length,l=null):l=Ei(Ai(n,d,i,h),o),h){var f=h[0].name;f&&(l="m-"+(l?f+" "+l:f))}if(!a||u!=l){for(;c<d.start;)c=Math.min(d.start,c+5e4),r(c,u);u=l}d.start=d.pos}for(;c<d.pos;){var p=Math.min(d.pos,c+5e4);r(p,u),c=p}}function Ni(e,t,n,i){var r=[e.state.modeGen],o={};Oi(e,t.text,e.doc.mode,n,function(e,t){r.push(e,t)},o,i);for(var s=0;s<e.state.overlays.length;++s){var a=e.state.overlays[s],l=1,c=0;Oi(e,t.text,a.mode,!0,function(e,t){for(var n=l;e>c;){var i=r[l];i>e&&r.splice(l,1,e,r[l+1],i),l+=2,c=Math.min(e,i)}if(t)if(a.opaque)r.splice(n,l-n,e,"cm-overlay "+t),l=n+2;else for(;l>n;n+=2){var o=r[n+1];r[n+1]=(o?o+" ":"")+"cm-overlay "+t}},o)}return{styles:r,classes:o.bgClass||o.textClass?o:null}}function Ii(e,t,n){if(!t.styles||t.styles[0]!=e.state.modeGen){var i=We(e,tr(t)),r=Ni(e,t,t.text.length>e.options.maxHighlightLength?ls(e.doc.mode,i):i);t.stateAfter=i,t.styles=r.styles,r.classes?t.styleClasses=r.classes:t.styleClasses&&(t.styleClasses=null),n===e.doc.frontier&&e.doc.frontier++}return t.styles}function Ri(e,t,n,i){var r=e.doc.mode,o=new ms(t,e.options.tabSize);for(o.start=o.pos=i||0,""==t&&Li(r,n);!o.eol();)Ai(r,o,n),o.start=o.pos}function Pi(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?Cs:ws;return n[e]||(n[e]=e.replace(/\S+/g,"cm-$&"))}function Hi(e,t){var n=Wr("span",null,null,wo?"padding-right: .1px":null),i={pre:Wr("pre",[n],"CodeMirror-line"),content:n,col:0,pos:0,cm:e,splitSpaces:(bo||wo)&&e.getOption("lineWrapping")};t.measure={};for(var r=0;r<=(t.rest?t.rest.length:0);r++){var o,s=r?t.rest[r-1]:t.line;i.pos=0,i.addToken=ji,Qr(e.display.measure)&&(o=rr(s))&&(i.addToken=Wi(i.addToken,o)),i.map=[];var a=t!=e.display.externalMeasured&&tr(s);zi(s,i,Ii(e,s,a)),s.styleClasses&&(s.styleClasses.bgClass&&(i.bgClass=Vr(s.styleClasses.bgClass,i.bgClass||"")),s.styleClasses.textClass&&(i.textClass=Vr(s.styleClasses.textClass,i.textClass||""))),0==i.map.length&&i.map.push(0,0,i.content.appendChild(Kr(e.display.measure))),0==r?(t.measure.map=i.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(i.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(wo){var l=i.content.lastChild;(/\bcm-tab\b/.test(l.className)||l.querySelector&&l.querySelector(".cm-tab"))&&(i.content.className="cm-tab-wrap-hack")}return Os(e,"renderLine",e,t.line,i.pre),i.pre.className&&(i.textClass=Vr(i.pre.className,i.textClass||"")),i}function Bi(e){var t=Wr("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function ji(e,t,n,i,r,o,s){if(t){var a=e.splitSpaces?t.replace(/ {3,}/g,Fi):t,l=e.cm.state.specialChars,c=!1;if(l.test(t))for(var u=document.createDocumentFragment(),d=0;;){l.lastIndex=d;var h=l.exec(t),f=h?h.index-d:t.length-d;if(f){var p=document.createTextNode(a.slice(d,d+f));bo&&9>xo?u.appendChild(Wr("span",[p])):u.appendChild(p),e.map.push(e.pos,e.pos+f,p),e.col+=f,e.pos+=f}if(!h)break;if(d+=f+1,"\t"==h[0]){var m=e.cm.options.tabSize,g=m-e.col%m,p=u.appendChild(Wr("span",Ar(g),"cm-tab"));p.setAttribute("role","presentation"),p.setAttribute("cm-text","\t"),e.col+=g}else if("\r"==h[0]||"\n"==h[0]){var p=u.appendChild(Wr("span","\r"==h[0]?"␍":"␤","cm-invalidchar"));p.setAttribute("cm-text",h[0]),e.col+=1}else{var p=e.cm.options.specialCharPlaceholder(h[0]);p.setAttribute("cm-text",h[0]),bo&&9>xo?u.appendChild(Wr("span",[p])):u.appendChild(p),e.col+=1}e.map.push(e.pos,e.pos+1,p),e.pos++}else{e.col+=t.length;var u=document.createTextNode(a);e.map.push(e.pos,e.pos+t.length,u),bo&&9>xo&&(c=!0),e.pos+=t.length}if(n||i||r||c||s){var v=n||"";i&&(v+=i),r&&(v+=r);var y=Wr("span",[u],v,s);return o&&(y.title=o),e.content.appendChild(y)}e.content.appendChild(u)}}function Fi(e){for(var t=" ",n=0;n<e.length-2;++n)t+=n%2?" ":" ";return t+=" "}function Wi(e,t){return function(n,i,r,o,s,a,l){r=r?r+" cm-force-border":"cm-force-border";for(var c=n.pos,u=c+i.length;;){for(var d=0;d<t.length;d++){var h=t[d];if(h.to>c&&h.from<=c)break}if(h.to>=u)return e(n,i,r,o,s,a,l);e(n,i.slice(0,h.to-c),r,o,null,a,l),o=null,i=i.slice(h.to-c),c=h.to}}}function qi(e,t,n,i){var r=!i&&n.widgetNode;r&&e.map.push(e.pos,e.pos+t,r),!i&&e.cm.display.input.needsContentAttribute&&(r||(r=e.content.appendChild(document.createElement("span"))),r.setAttribute("cm-marker",n.id)),r&&(e.cm.display.input.setUneditable(r),e.content.appendChild(r)),e.pos+=t}function zi(e,t,n){var i=e.markedSpans,r=e.text,o=0;if(i)for(var s,a,l,c,u,d,h,f=r.length,p=0,m=1,g="",v=0;;){if(v==p){l=c=u=d=a="",h=null,v=1/0;for(var y,b=[],x=0;x<i.length;++x){var w=i[x],C=w.marker;"bookmark"==C.type&&w.from==p&&C.widgetNode?b.push(C):w.from<=p&&(null==w.to||w.to>p||C.collapsed&&w.to==p&&w.from==p)?(null!=w.to&&w.to!=p&&v>w.to&&(v=w.to,c=""),C.className&&(l+=" "+C.className),C.css&&(a=(a?a+";":"")+C.css),C.startStyle&&w.from==p&&(u+=" "+C.startStyle),C.endStyle&&w.to==v&&(y||(y=[])).push(C.endStyle,w.to),C.title&&!d&&(d=C.title),C.collapsed&&(!h||fi(h.marker,C)<0)&&(h=w)):w.from>p&&v>w.from&&(v=w.from)}if(y)for(var x=0;x<y.length;x+=2)y[x+1]==v&&(c+=" "+y[x]);if(!h||h.from==p)for(var x=0;x<b.length;++x)qi(t,0,b[x]);if(h&&(h.from||0)==p){if(qi(t,(null==h.to?f+1:h.to)-p,h.marker,null==h.from),null==h.to)return;h.to==p&&(h=!1)}}if(p>=f)break;for(var k=Math.min(f,v);;){if(g){var _=p+g.length;if(!h){var S=_>k?g.slice(0,k-p):g;t.addToken(t,S,s?s+l:l,u,p+S.length==v?c:"",d,a)}if(_>=k){g=g.slice(k-p),p=k;break}p=_,u=""}g=r.slice(o,o=n[m++]),s=Pi(n[m++],t.cm.options)}}else for(var m=1;m<n.length;m+=2)t.addToken(t,r.slice(o,o=n[m]),Pi(n[m+1],t.cm.options))}function Yi(e,t){return 0==t.from.ch&&0==t.to.ch&&""==$r(t.text)&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function Ui(e,t,n,i){function r(e){return n?n[e]:null}function o(e,n,r){Di(e,n,r,i),_r(e,"change",e,t)}function s(e,t){for(var n=e,o=[];t>n;++n)o.push(new xs(c[n],r(n),i));return o}var a=t.from,l=t.to,c=t.text,u=Ki(e,a.line),d=Ki(e,l.line),h=$r(c),f=r(c.length-1),p=l.line-a.line;if(t.full)e.insert(0,s(0,c.length)),e.remove(c.length,e.size-c.length);else if(Yi(e,t)){var m=s(0,c.length-1);o(d,d.text,f),p&&e.remove(a.line,p),m.length&&e.insert(a.line,m)}else if(u==d)if(1==c.length)o(u,u.text.slice(0,a.ch)+h+u.text.slice(l.ch),f);else{var m=s(1,c.length-1);m.push(new xs(h+u.text.slice(l.ch),f,i)),o(u,u.text.slice(0,a.ch)+c[0],r(0)),e.insert(a.line+1,m)}else if(1==c.length)o(u,u.text.slice(0,a.ch)+c[0]+d.text.slice(l.ch),r(0)),e.remove(a.line+1,p);else{o(u,u.text.slice(0,a.ch)+c[0],r(0)),o(d,h+d.text.slice(l.ch),f);var m=s(1,c.length-1);p>1&&e.remove(a.line+1,p-1),e.insert(a.line+1,m)}_r(e,"change",e,t)}function Vi(e){this.lines=e,this.parent=null;for(var t=0,n=0;t<e.length;++t)e[t].parent=this,n+=e[t].height;this.height=n}function Gi(e){this.children=e;for(var t=0,n=0,i=0;i<e.length;++i){var r=e[i];t+=r.chunkSize(),n+=r.height,r.parent=this}this.size=t,this.height=n,this.parent=null}function Xi(e,t,n){function i(e,r,o){if(e.linked)for(var s=0;s<e.linked.length;++s){var a=e.linked[s];if(a.doc!=r){var l=o&&a.sharedHist;n&&!l||(t(a.doc,l),i(a.doc,e,l))}}}i(e,null,!0)}function Zi(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,s(e),n(e),e.options.lineWrapping||h(e),e.options.mode=t.modeOption,It(e)}function Ki(e,t){if(t-=e.first,0>t||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var n=e;!n.lines;)for(var i=0;;++i){var r=n.children[i],o=r.chunkSize();if(o>t){n=r;break}t-=o}return n.lines[t]}function Qi(e,t,n){var i=[],r=t.line;return e.iter(t.line,n.line+1,function(e){var o=e.text;r==n.line&&(o=o.slice(0,n.ch)),r==t.line&&(o=o.slice(t.ch)),i.push(o),++r}),i}function Ji(e,t,n){var i=[];return e.iter(t,n,function(e){i.push(e.text)}),i}function er(e,t){var n=t-e.height;if(n)for(var i=e;i;i=i.parent)i.height+=n}function tr(e){if(null==e.parent)return null;for(var t=e.parent,n=Or(t.lines,e),i=t.parent;i;t=i,i=i.parent)for(var r=0;i.children[r]!=t;++r)n+=i.children[r].chunkSize();return n+t.first}function nr(e,t){var n=e.first;e:do{for(var i=0;i<e.children.length;++i){var r=e.children[i],o=r.height;if(o>t){e=r;continue e}t-=o,n+=r.chunkSize()}return n}while(!e.lines);for(var i=0;i<e.lines.length;++i){var s=e.lines[i],a=s.height;if(a>t)break;t-=a}return n+i}function ir(e){e=yi(e);for(var t=0,n=e.parent,i=0;i<n.lines.length;++i){var r=n.lines[i];if(r==e)break;t+=r.height}for(var o=n.parent;o;n=o,o=n.parent)for(var i=0;i<o.children.length;++i){var s=o.children[i];if(s==n)break;t+=s.height}return t}function rr(e){var t=e.order;return null==t&&(t=e.order=aa(e.text)),t}function or(e){this.done=[],this.undone=[],this.undoDepth=1/0,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e||1}function sr(e,t){var n={from:V(t.from),to:Jo(t),text:Qi(e,t.from,t.to)};return fr(e,n,t.from.line,t.to.line+1),Xi(e,function(e){fr(e,n,t.from.line,t.to.line+1)},!0),n}function ar(e){for(;e.length;){var t=$r(e);if(!t.ranges)break;e.pop()}}function lr(e,t){return t?(ar(e.done),$r(e.done)):e.done.length&&!$r(e.done).ranges?$r(e.done):e.done.length>1&&!e.done[e.done.length-2].ranges?(e.done.pop(),$r(e.done)):void 0}function cr(e,t,n,i){var r=e.history;r.undone.length=0;var o,s=+new Date;if((r.lastOp==i||r.lastOrigin==t.origin&&t.origin&&("+"==t.origin.charAt(0)&&e.cm&&r.lastModTime>s-e.cm.options.historyEventDelay||"*"==t.origin.charAt(0)))&&(o=lr(r,r.lastOp==i))){var a=$r(o.changes);0==Bo(t.from,t.to)&&0==Bo(t.from,a.to)?a.to=Jo(t):o.changes.push(sr(e,t))}else{var l=$r(r.done);for(l&&l.ranges||hr(e.sel,r.done),
  o={changes:[sr(e,t)],generation:r.generation},r.done.push(o);r.done.length>r.undoDepth;)r.done.shift(),r.done[0].ranges||r.done.shift()}r.done.push(n),r.generation=++r.maxGeneration,r.lastModTime=r.lastSelTime=s,r.lastOp=r.lastSelOp=i,r.lastOrigin=r.lastSelOrigin=t.origin,a||Os(e,"historyAdded")}function ur(e,t,n,i){var r=t.charAt(0);return"*"==r||"+"==r&&n.ranges.length==i.ranges.length&&n.somethingSelected()==i.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function dr(e,t,n,i){var r=e.history,o=i&&i.origin;n==r.lastSelOp||o&&r.lastSelOrigin==o&&(r.lastModTime==r.lastSelTime&&r.lastOrigin==o||ur(e,o,$r(r.done),t))?r.done[r.done.length-1]=t:hr(t,r.done),r.lastSelTime=+new Date,r.lastSelOrigin=o,r.lastSelOp=n,i&&i.clearRedo!==!1&&ar(r.undone)}function hr(e,t){var n=$r(t);n&&n.ranges&&n.equals(e)||t.push(e)}function fr(e,t,n,i){var r=t["spans_"+e.id],o=0;e.iter(Math.max(e.first,n),Math.min(e.first+e.size,i),function(n){n.markedSpans&&((r||(r=t["spans_"+e.id]={}))[o]=n.markedSpans),++o})}function pr(e){if(!e)return null;for(var t,n=0;n<e.length;++n)e[n].marker.explicitlyCleared?t||(t=e.slice(0,n)):t&&t.push(e[n]);return t?t.length?t:null:e}function mr(e,t){var n=t["spans_"+e.id];if(!n)return null;for(var i=0,r=[];i<t.text.length;++i)r.push(pr(n[i]));return r}function gr(e,t,n){for(var i=0,r=[];i<e.length;++i){var o=e[i];if(o.ranges)r.push(n?ue.prototype.deepCopy.call(o):o);else{var s=o.changes,a=[];r.push({changes:a});for(var l=0;l<s.length;++l){var c,u=s[l];if(a.push({from:u.from,to:u.to,text:u.text}),t)for(var d in u)(c=d.match(/^spans_(\d+)$/))&&Or(t,Number(c[1]))>-1&&($r(a)[d]=u[d],delete u[d])}}}return r}function vr(e,t,n,i){n<e.line?e.line+=i:t<e.line&&(e.line=t,e.ch=0)}function yr(e,t,n,i){for(var r=0;r<e.length;++r){var o=e[r],s=!0;if(o.ranges){o.copied||(o=e[r]=o.deepCopy(),o.copied=!0);for(var a=0;a<o.ranges.length;a++)vr(o.ranges[a].anchor,t,n,i),vr(o.ranges[a].head,t,n,i)}else{for(var a=0;a<o.changes.length;++a){var l=o.changes[a];if(n<l.from.line)l.from=Ho(l.from.line+i,l.from.ch),l.to=Ho(l.to.line+i,l.to.ch);else if(t<=l.to.line){s=!1;break}}s||(e.splice(0,r+1),r=0)}}}function br(e,t){var n=t.from.line,i=t.to.line,r=t.text.length-(i-n)-1;yr(e.done,n,i,r),yr(e.undone,n,i,r)}function xr(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function wr(e){return e.target||e.srcElement}function Cr(e){var t=e.which;return null==t&&(1&e.button?t=1:2&e.button?t=3:4&e.button&&(t=2)),Lo&&e.ctrlKey&&1==t&&(t=3),t}function kr(e,t,n){var i=e._handlers&&e._handlers[t];return n?i&&i.length>0?i.slice():As:i||As}function _r(e,t){function n(e){return function(){e.apply(null,o)}}var i=kr(e,t,!1);if(i.length){var r,o=Array.prototype.slice.call(arguments,2);Yo?r=Yo.delayedCallbacks:Ns?r=Ns:(r=Ns=[],setTimeout(Sr,0));for(var s=0;s<i.length;++s)r.push(n(i[s]))}}function Sr(){var e=Ns;Ns=null;for(var t=0;t<e.length;++t)e[t]()}function Tr(e,t,n){return"string"==typeof t&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),Os(e,n||t.type,e,t),xr(t)||t.codemirrorIgnore}function Dr(e){var t=e._handlers&&e._handlers.cursorActivity;if(t)for(var n=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),i=0;i<t.length;++i)-1==Or(n,t[i])&&n.push(t[i])}function Mr(e,t){return kr(e,t).length>0}function Er(e){e.prototype.on=function(e,t){Ls(this,e,t)},e.prototype.off=function(e,t){$s(this,e,t)}}function Lr(){this.id=null}function Ar(e){for(;Ws.length<=e;)Ws.push($r(Ws)+" ");return Ws[e]}function $r(e){return e[e.length-1]}function Or(e,t){for(var n=0;n<e.length;++n)if(e[n]==t)return n;return-1}function Nr(e,t){for(var n=[],i=0;i<e.length;i++)n[i]=t(e[i],i);return n}function Ir(){}function Rr(e,t){var n;return Object.create?n=Object.create(e):(Ir.prototype=e,n=new Ir),t&&Pr(t,n),n}function Pr(e,t,n){t||(t={});for(var i in e)!e.hasOwnProperty(i)||n===!1&&t.hasOwnProperty(i)||(t[i]=e[i]);return t}function Hr(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function Br(e,t){return t?!!(t.source.indexOf("\\w")>-1&&Us(e))||t.test(e):Us(e)}function jr(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}function Fr(e){return e.charCodeAt(0)>=768&&Vs.test(e)}function Wr(e,t,n,i){var r=document.createElement(e);if(n&&(r.className=n),i&&(r.style.cssText=i),"string"==typeof t)r.appendChild(document.createTextNode(t));else if(t)for(var o=0;o<t.length;++o)r.appendChild(t[o]);return r}function qr(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function zr(e,t){return qr(e).appendChild(t)}function Yr(){for(var e=document.activeElement;e&&e.root&&e.root.activeElement;)e=e.root.activeElement;return e}function Ur(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}function Vr(e,t){for(var n=e.split(" "),i=0;i<n.length;i++)n[i]&&!Ur(n[i]).test(t)&&(t+=" "+n[i]);return t}function Gr(e){if(document.body.getElementsByClassName)for(var t=document.body.getElementsByClassName("CodeMirror"),n=0;n<t.length;n++){var i=t[n].CodeMirror;i&&e(i)}}function Xr(){Js||(Zr(),Js=!0)}function Zr(){var e;Ls(window,"resize",function(){null==e&&(e=setTimeout(function(){e=null,Gr(zt)},100))}),Ls(window,"blur",function(){Gr(yn)})}function Kr(e){if(null==Xs){var t=Wr("span","​");zr(e,Wr("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(Xs=t.offsetWidth<=1&&t.offsetHeight>2&&!(bo&&8>xo))}var n=Xs?Wr("span","​"):Wr("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}function Qr(e){if(null!=Zs)return Zs;var t=zr(e,document.createTextNode("AخA")),n=zs(t,0,1).getBoundingClientRect();if(!n||n.left==n.right)return!1;var i=zs(t,1,2).getBoundingClientRect();return Zs=i.right-n.right<3}function Jr(e){if(null!=ra)return ra;var t=zr(e,Wr("span","x")),n=t.getBoundingClientRect(),i=zs(t,0,1).getBoundingClientRect();return ra=Math.abs(n.left-i.left)>1}function eo(e,t,n,i){if(!e)return i(t,n,"ltr");for(var r=!1,o=0;o<e.length;++o){var s=e[o];(s.from<n&&s.to>t||t==n&&s.to==t)&&(i(Math.max(s.from,t),Math.min(s.to,n),1==s.level?"rtl":"ltr"),r=!0)}r||i(t,n,"ltr")}function to(e){return e.level%2?e.to:e.from}function no(e){return e.level%2?e.from:e.to}function io(e){var t=rr(e);return t?to(t[0]):0}function ro(e){var t=rr(e);return t?no($r(t)):e.text.length}function oo(e,t){var n=Ki(e.doc,t),i=yi(n);i!=n&&(t=tr(i));var r=rr(i),o=r?r[0].level%2?ro(i):io(i):0;return Ho(t,o)}function so(e,t){for(var n,i=Ki(e.doc,t);n=gi(i);)i=n.find(1,!0).line,t=null;var r=rr(i),o=r?r[0].level%2?io(i):ro(i):i.text.length;return Ho(null==t?tr(i):t,o)}function ao(e,t){var n=oo(e,t.line),i=Ki(e.doc,n.line),r=rr(i);if(!r||0==r[0].level){var o=Math.max(0,i.text.search(/\S/)),s=t.line==n.line&&t.ch<=o&&t.ch;return Ho(n.line,s?0:o)}return n}function lo(e,t,n){var i=e[0].level;return t==i||n!=i&&n>t}function co(e,t){sa=null;for(var n,i=0;i<e.length;++i){var r=e[i];if(r.from<t&&r.to>t)return i;if(r.from==t||r.to==t){if(null!=n)return lo(e,r.level,e[n].level)?(r.from!=r.to&&(sa=n),i):(r.from!=r.to&&(sa=i),n);n=i}}return n}function uo(e,t,n,i){if(!i)return t+n;do t+=n;while(t>0&&Fr(e.text.charAt(t)));return t}function ho(e,t,n,i){var r=rr(e);if(!r)return fo(e,t,n,i);for(var o=co(r,t),s=r[o],a=uo(e,t,s.level%2?-n:n,i);;){if(a>s.from&&a<s.to)return a;if(a==s.from||a==s.to)return co(r,a)==o?a:(s=r[o+=n],n>0==s.level%2?s.to:s.from);if(s=r[o+=n],!s)return null;a=n>0==s.level%2?uo(e,s.to,-1,i):uo(e,s.from,1,i)}}function fo(e,t,n,i){var r=t+n;if(i)for(;r>0&&Fr(e.text.charAt(r));)r+=n;return 0>r||r>e.text.length?null:r}var po=navigator.userAgent,mo=navigator.platform,go=/gecko\/\d/i.test(po),vo=/MSIE \d/.test(po),yo=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(po),bo=vo||yo,xo=bo&&(vo?document.documentMode||6:yo[1]),wo=/WebKit\//.test(po),Co=wo&&/Qt\/\d+\.\d+/.test(po),ko=/Chrome\//.test(po),_o=/Opera\//.test(po),So=/Apple Computer/.test(navigator.vendor),To=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(po),Do=/PhantomJS/.test(po),Mo=/AppleWebKit/.test(po)&&/Mobile\/\w+/.test(po),Eo=Mo||/Android|webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(po),Lo=Mo||/Mac/.test(mo),Ao=/\bCrOS\b/.test(po),$o=/win/i.test(mo),Oo=_o&&po.match(/Version\/(\d*\.\d*)/);Oo&&(Oo=Number(Oo[1])),Oo&&Oo>=15&&(_o=!1,wo=!0);var No=Lo&&(Co||_o&&(null==Oo||12.11>Oo)),Io=go||bo&&xo>=9,Ro=!1,Po=!1;m.prototype=Pr({update:function(e){var t=e.scrollWidth>e.clientWidth+1,n=e.scrollHeight>e.clientHeight+1,i=e.nativeBarWidth;if(n){this.vert.style.display="block",this.vert.style.bottom=t?i+"px":"0";var r=e.viewHeight-(t?i:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+r)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=n?i+"px":"0",this.horiz.style.left=e.barLeft+"px";var o=e.viewWidth-e.barLeft-(n?i:0);this.horiz.firstChild.style.width=e.scrollWidth-e.clientWidth+o+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(0==i&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?i:0,bottom:t?i:0}},setScrollLeft:function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz)},setScrollTop:function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert)},zeroWidthHack:function(){var e=Lo&&!To?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new Lr,this.disableVert=new Lr},enableZeroWidthBar:function(e,t){function n(){var i=e.getBoundingClientRect(),r=document.elementFromPoint(i.left+1,i.bottom-1);r!=e?e.style.pointerEvents="none":t.set(1e3,n)}e.style.pointerEvents="auto",t.set(1e3,n)},clear:function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)}},m.prototype),g.prototype=Pr({update:function(){return{bottom:0,right:0}},setScrollLeft:function(){},setScrollTop:function(){},clear:function(){}},g.prototype),e.scrollbarModel={"native":m,"null":g},S.prototype.signal=function(e,t){Mr(e,t)&&this.events.push(arguments)},S.prototype.finish=function(){for(var e=0;e<this.events.length;e++)Os.apply(null,this.events[e])};var Ho=e.Pos=function(e,t){return this instanceof Ho?(this.line=e,void(this.ch=t)):new Ho(e,t)},Bo=e.cmpPos=function(e,t){return e.line-t.line||e.ch-t.ch},jo=null;ne.prototype=Pr({init:function(e){function t(e){if(!Tr(i,e)){if(i.somethingSelected())jo={lineWise:!1,text:i.getSelections()},n.inaccurateSelection&&(n.prevInput="",n.inaccurateSelection=!1,o.value=jo.text.join("\n"),qs(o));else{if(!i.options.lineWiseCopyCut)return;var t=ee(i);jo={lineWise:!0,text:t.text},"cut"==e.type?i.setSelections(t.ranges,null,Ps):(n.prevInput="",o.value=t.text.join("\n"),qs(o))}"cut"==e.type&&(i.state.cutIncoming=!0)}}var n=this,i=this.cm,r=this.wrapper=ie(),o=this.textarea=r.firstChild;e.wrapper.insertBefore(r,e.wrapper.firstChild),Mo&&(o.style.width="0px"),Ls(o,"input",function(){bo&&xo>=9&&n.hasSelection&&(n.hasSelection=null),n.poll()}),Ls(o,"paste",function(e){Tr(i,e)||Q(e,i)||(i.state.pasteIncoming=!0,n.fastPoll())}),Ls(o,"cut",t),Ls(o,"copy",t),Ls(e.scroller,"paste",function(t){Yt(e,t)||Tr(i,t)||(i.state.pasteIncoming=!0,n.focus())}),Ls(e.lineSpace,"selectstart",function(t){Yt(e,t)||Ds(t)}),Ls(o,"compositionstart",function(){var e=i.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:e,range:i.markText(e,i.getCursor("to"),{className:"CodeMirror-composing"})}}),Ls(o,"compositionend",function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)})},prepareSelection:function(){var e=this.cm,t=e.display,n=e.doc,i=Ie(e);if(e.options.moveInputWithCursor){var r=ft(e,n.sel.primary().head,"div"),o=t.wrapper.getBoundingClientRect(),s=t.lineDiv.getBoundingClientRect();i.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,r.top+s.top-o.top)),i.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,r.left+s.left-o.left))}return i},showSelection:function(e){var t=this.cm,n=t.display;zr(n.cursorDiv,e.cursors),zr(n.selectionDiv,e.selection),null!=e.teTop&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},reset:function(e){if(!this.contextMenuPending){var t,n,i=this.cm,r=i.doc;if(i.somethingSelected()){this.prevInput="";var o=r.sel.primary();t=ia&&(o.to().line-o.from().line>100||(n=i.getSelection()).length>1e3);var s=t?"-":n||i.getSelection();this.textarea.value=s,i.state.focused&&qs(this.textarea),bo&&xo>=9&&(this.hasSelection=s)}else e||(this.prevInput=this.textarea.value="",bo&&xo>=9&&(this.hasSelection=null));this.inaccurateSelection=t}},getField:function(){return this.textarea},supportsTouch:function(){return!1},focus:function(){if("nocursor"!=this.cm.options.readOnly&&(!Eo||Yr()!=this.textarea))try{this.textarea.focus()}catch(e){}},blur:function(){this.textarea.blur()},resetPosition:function(){this.wrapper.style.top=this.wrapper.style.left=0},receivedFocus:function(){this.slowPoll()},slowPoll:function(){var e=this;e.pollingFast||e.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},fastPoll:function(){function e(){var i=n.poll();i||t?(n.pollingFast=!1,n.slowPoll()):(t=!0,n.polling.set(60,e))}var t=!1,n=this;n.pollingFast=!0,n.polling.set(20,e)},poll:function(){var e=this.cm,t=this.textarea,n=this.prevInput;if(this.contextMenuPending||!e.state.focused||na(t)&&!n&&!this.composing||e.isReadOnly()||e.options.disableInput||e.state.keySeq)return!1;var i=t.value;if(i==n&&!e.somethingSelected())return!1;if(bo&&xo>=9&&this.hasSelection===i||Lo&&/[\uf700-\uf7ff]/.test(i))return e.display.input.reset(),!1;if(e.doc.sel==e.display.selForContextMenu){var r=i.charCodeAt(0);if(8203!=r||n||(n="​"),8666==r)return this.reset(),this.cm.execCommand("undo")}for(var o=0,s=Math.min(n.length,i.length);s>o&&n.charCodeAt(o)==i.charCodeAt(o);)++o;var a=this;return Et(e,function(){K(e,i.slice(o),n.length-o,null,a.composing?"*compose":null),i.length>1e3||i.indexOf("\n")>-1?t.value=a.prevInput="":a.prevInput=i,a.composing&&(a.composing.range.clear(),a.composing.range=e.markText(a.composing.start,e.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},ensurePolled:function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},onKeyPress:function(){bo&&xo>=9&&(this.hasSelection=null),this.fastPoll()},onContextMenu:function(e){function t(){if(null!=s.selectionStart){var e=r.somethingSelected(),t="​"+(e?s.value:"");s.value="⇚",s.value=t,i.prevInput=e?"":"​",s.selectionStart=1,s.selectionEnd=t.length,o.selForContextMenu=r.doc.sel}}function n(){if(i.contextMenuPending=!1,i.wrapper.style.cssText=d,s.style.cssText=u,bo&&9>xo&&o.scrollbars.setScrollTop(o.scroller.scrollTop=l),null!=s.selectionStart){(!bo||bo&&9>xo)&&t();var e=0,n=function(){o.selForContextMenu==r.doc.sel&&0==s.selectionStart&&s.selectionEnd>0&&"​"==i.prevInput?Lt(r,us.selectAll)(r):e++<10?o.detectingSelectAll=setTimeout(n,500):o.input.reset()};o.detectingSelectAll=setTimeout(n,200)}}var i=this,r=i.cm,o=r.display,s=i.textarea,a=Ut(r,e),l=o.scroller.scrollTop;if(a&&!_o){var c=r.options.resetSelectionOnContextMenu;c&&-1==r.doc.sel.contains(a)&&Lt(r,Te)(r.doc,fe(a),Ps);var u=s.style.cssText,d=i.wrapper.style.cssText;i.wrapper.style.cssText="position: absolute";var h=i.wrapper.getBoundingClientRect();if(s.style.cssText="position: absolute; width: 30px; height: 30px; top: "+(e.clientY-h.top-5)+"px; left: "+(e.clientX-h.left-5)+"px; z-index: 1000; background: "+(bo?"rgba(255, 255, 255, .05)":"transparent")+"; outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",wo)var f=window.scrollY;if(o.input.focus(),wo&&window.scrollTo(null,f),o.input.reset(),r.somethingSelected()||(s.value=i.prevInput=" "),i.contextMenuPending=!0,o.selForContextMenu=r.doc.sel,clearTimeout(o.detectingSelectAll),bo&&xo>=9&&t(),Io){Es(e);var p=function(){$s(window,"mouseup",p),setTimeout(n,20)};Ls(window,"mouseup",p)}else setTimeout(n,50)}},readOnlyChanged:function(e){e||this.reset()},setUneditable:Ir,needsContentAttribute:!1},ne.prototype),re.prototype=Pr({init:function(e){function t(e){if(!Tr(i,e)){if(i.somethingSelected())jo={lineWise:!1,text:i.getSelections()},"cut"==e.type&&i.replaceSelection("",null,"cut");else{if(!i.options.lineWiseCopyCut)return;var t=ee(i);jo={lineWise:!0,text:t.text},"cut"==e.type&&i.operation(function(){i.setSelections(t.ranges,0,Ps),i.replaceSelection("",null,"cut")})}if(e.clipboardData&&!Mo)e.preventDefault(),e.clipboardData.clearData(),e.clipboardData.setData("text/plain",jo.text.join("\n"));else{var n=ie(),r=n.firstChild;i.display.lineSpace.insertBefore(n,i.display.lineSpace.firstChild),r.value=jo.text.join("\n");var o=document.activeElement;qs(r),setTimeout(function(){i.display.lineSpace.removeChild(n),o.focus()},50)}}}var n=this,i=n.cm,r=n.div=e.lineDiv;te(r),Ls(r,"paste",function(e){Tr(i,e)||Q(e,i)}),Ls(r,"compositionstart",function(e){var t=e.data;if(n.composing={sel:i.doc.sel,data:t,startData:t},t){var r=i.doc.sel.primary(),o=i.getLine(r.head.line),s=o.indexOf(t,Math.max(0,r.head.ch-t.length));s>-1&&s<=r.head.ch&&(n.composing.sel=fe(Ho(r.head.line,s),Ho(r.head.line,s+t.length)))}}),Ls(r,"compositionupdate",function(e){n.composing.data=e.data}),Ls(r,"compositionend",function(e){var t=n.composing;t&&(e.data==t.startData||/\u200b/.test(e.data)||(t.data=e.data),setTimeout(function(){t.handled||n.applyComposition(t),n.composing==t&&(n.composing=null)},50))}),Ls(r,"touchstart",function(){n.forceCompositionEnd()}),Ls(r,"input",function(){n.composing||!i.isReadOnly()&&n.pollContent()||Et(n.cm,function(){It(i)})}),Ls(r,"copy",t),Ls(r,"cut",t)},prepareSelection:function(){var e=Ie(this.cm,!1);return e.focus=this.cm.state.focused,e},showSelection:function(e,t){e&&this.cm.display.view.length&&((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},showPrimarySelection:function(){var e=window.getSelection(),t=this.cm.doc.sel.primary(),n=ae(this.cm,e.anchorNode,e.anchorOffset),i=ae(this.cm,e.focusNode,e.focusOffset);if(!n||n.bad||!i||i.bad||0!=Bo(X(n,i),t.from())||0!=Bo(G(n,i),t.to())){var r=oe(this.cm,t.from()),o=oe(this.cm,t.to());if(r||o){var s=this.cm.display.view,a=e.rangeCount&&e.getRangeAt(0);if(r){if(!o){var l=s[s.length-1].measure,c=l.maps?l.maps[l.maps.length-1]:l.map;o={node:c[c.length-1],offset:c[c.length-2]-c[c.length-3]}}}else r={node:s[0].measure.map[2],offset:0};try{var u=zs(r.node,r.offset,o.offset,o.node)}catch(d){}u&&(!go&&this.cm.state.focused?(e.collapse(r.node,r.offset),u.collapsed||e.addRange(u)):(e.removeAllRanges(),e.addRange(u)),a&&null==e.anchorNode?e.addRange(a):go&&this.startGracePeriod()),this.rememberSelection()}}},startGracePeriod:function(){var e=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout(function(){e.gracePeriod=!1,e.selectionChanged()&&e.cm.operation(function(){e.cm.curOp.selectionChanged=!0})},20)},showMultipleSelections:function(e){zr(this.cm.display.cursorDiv,e.cursors),zr(this.cm.display.selectionDiv,e.selection)},rememberSelection:function(){var e=window.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},selectionInEditor:function(){var e=window.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return Gs(this.div,t)},focus:function(){"nocursor"!=this.cm.options.readOnly&&this.div.focus()},blur:function(){this.div.blur()},getField:function(){return this.div},supportsTouch:function(){return!0},receivedFocus:function(){function e(){t.cm.state.focused&&(t.pollSelection(),t.polling.set(t.cm.options.pollInterval,e))}var t=this;this.selectionInEditor()?this.pollSelection():Et(this.cm,function(){t.cm.curOp.selectionChanged=!0}),this.polling.set(this.cm.options.pollInterval,e)},selectionChanged:function(){var e=window.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},pollSelection:function(){if(!this.composing&&!this.gracePeriod&&this.selectionChanged()){var e=window.getSelection(),t=this.cm;this.rememberSelection();var n=ae(t,e.anchorNode,e.anchorOffset),i=ae(t,e.focusNode,e.focusOffset);n&&i&&Et(t,function(){Te(t.doc,fe(n,i),Ps),(n.bad||i.bad)&&(t.curOp.selectionChanged=!0)})}},pollContent:function(){var e=this.cm,t=e.display,n=e.doc.sel.primary(),i=n.from(),r=n.to();if(i.line<t.viewFrom||r.line>t.viewTo-1)return!1;var o;if(i.line==t.viewFrom||0==(o=Ht(e,i.line)))var s=tr(t.view[0].line),a=t.view[0].node;else var s=tr(t.view[o].line),a=t.view[o-1].node.nextSibling;var l=Ht(e,r.line);if(l==t.view.length-1)var c=t.viewTo-1,u=t.lineDiv.lastChild;else var c=tr(t.view[l+1].line)-1,u=t.view[l+1].node.previousSibling;for(var d=e.doc.splitLines(ce(e,a,u,s,c)),h=Qi(e.doc,Ho(s,0),Ho(c,Ki(e.doc,c).text.length));d.length>1&&h.length>1;)if($r(d)==$r(h))d.pop(),h.pop(),c--;else{if(d[0]!=h[0])break;d.shift(),h.shift(),s++}for(var f=0,p=0,m=d[0],g=h[0],v=Math.min(m.length,g.length);v>f&&m.charCodeAt(f)==g.charCodeAt(f);)++f;for(var y=$r(d),b=$r(h),x=Math.min(y.length-(1==d.length?f:0),b.length-(1==h.length?f:0));x>p&&y.charCodeAt(y.length-p-1)==b.charCodeAt(b.length-p-1);)++p;d[d.length-1]=y.slice(0,y.length-p),d[0]=d[0].slice(f);var w=Ho(s,f),C=Ho(c,h.length?$r(h).length-p:0);return d.length>1||d[0]||Bo(w,C)?($n(e.doc,d,w,C,"+input"),!0):void 0},ensurePolled:function(){this.forceCompositionEnd()},reset:function(){this.forceCompositionEnd()},forceCompositionEnd:function(){this.composing&&!this.composing.handled&&(this.applyComposition(this.composing),this.composing.handled=!0,this.div.blur(),this.div.focus())},applyComposition:function(e){this.cm.isReadOnly()?Lt(this.cm,It)(this.cm):e.data&&e.data!=e.startData&&Lt(this.cm,K)(this.cm,e.data,0,e.sel)},setUneditable:function(e){e.contentEditable="false"},onKeyPress:function(e){e.preventDefault(),this.cm.isReadOnly()||Lt(this.cm,K)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0)},readOnlyChanged:function(e){this.div.contentEditable=String("nocursor"!=e)},onContextMenu:Ir,resetPosition:Ir,needsContentAttribute:!0},re.prototype),e.inputStyles={textarea:ne,contenteditable:re},ue.prototype={primary:function(){return this.ranges[this.primIndex]},equals:function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var t=0;t<this.ranges.length;t++){var n=this.ranges[t],i=e.ranges[t];if(0!=Bo(n.anchor,i.anchor)||0!=Bo(n.head,i.head))return!1}return!0},deepCopy:function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new de(V(this.ranges[t].anchor),V(this.ranges[t].head));return new ue(e,this.primIndex)},somethingSelected:function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},contains:function(e,t){t||(t=e);for(var n=0;n<this.ranges.length;n++){var i=this.ranges[n];if(Bo(t,i.from())>=0&&Bo(e,i.to())<=0)return n}return-1}},de.prototype={from:function(){return X(this.anchor,this.head)},to:function(){return G(this.anchor,this.head)},empty:function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch}};var Fo,Wo,qo,zo={left:0,right:0,top:0,bottom:0},Yo=null,Uo=0,Vo=0,Go=0,Xo=null;bo?Xo=-.53:go?Xo=15:ko?Xo=-.7:So&&(Xo=-1/3);var Zo=function(e){var t=e.wheelDeltaX,n=e.wheelDeltaY;return null==t&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),null==n&&e.detail&&e.axis==e.VERTICAL_AXIS?n=e.detail:null==n&&(n=e.wheelDelta),{x:t,y:n}};e.wheelEventPixels=function(e){var t=Zo(e);return t.x*=Xo,t.y*=Xo,t};var Ko=new Lr,Qo=null,Jo=e.changeEnd=function(e){return e.text?Ho(e.from.line+e.text.length-1,$r(e.text).length+(1==e.text.length?e.from.ch:0)):e.to};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(e,t){var n=this.options,i=n[e];n[e]==t&&"mode"!=e||(n[e]=t,ts.hasOwnProperty(e)&&Lt(this,ts[e])(this,t,i))},getOption:function(e){return this.options[e]},getDoc:function(){return this.doc},addKeyMap:function(e,t){this.state.keyMaps[t?"push":"unshift"](Vn(e))},removeKeyMap:function(e){for(var t=this.state.keyMaps,n=0;n<t.length;++n)if(t[n]==e||t[n].name==e)return t.splice(n,1),!0},addOverlay:At(function(t,n){var i=t.token?t:e.getMode(this.options,t);if(i.startState)throw new Error("Overlays may not be stateful.");this.state.overlays.push({mode:i,modeSpec:t,opaque:n&&n.opaque}),this.state.modeGen++,It(this)}),removeOverlay:At(function(e){for(var t=this.state.overlays,n=0;n<t.length;++n){var i=t[n].modeSpec;if(i==e||"string"==typeof e&&i.name==e)return t.splice(n,1),this.state.modeGen++,void It(this)}}),indentLine:At(function(e,t,n){"string"!=typeof t&&"number"!=typeof t&&(t=null==t?this.options.smartIndent?"smart":"prev":t?"add":"subtract"),ve(this.doc,e)&&jn(this,e,t,n)}),indentSelection:At(function(e){for(var t=this.doc.sel.ranges,n=-1,i=0;i<t.length;i++){var r=t[i];if(r.empty())r.head.line>n&&(jn(this,r.head.line,e,!0),n=r.head.line,i==this.doc.sel.primIndex&&Hn(this));else{var o=r.from(),s=r.to(),a=Math.max(n,o.line);n=Math.min(this.lastLine(),s.line-(s.ch?0:1))+1;for(var l=a;n>l;++l)jn(this,l,e);var c=this.doc.sel.ranges;0==o.ch&&t.length==c.length&&c[i].from().ch>0&&Ce(this.doc,i,new de(o,c[i].to()),Ps)}}}),getTokenAt:function(e,t){return $i(this,e,t)},getLineTokens:function(e,t){return $i(this,Ho(e),t,!0)},getTokenTypeAt:function(e){e=me(this.doc,e);var t,n=Ii(this,Ki(this.doc,e.line)),i=0,r=(n.length-1)/2,o=e.ch;if(0==o)t=n[2];else for(;;){var s=i+r>>1;if((s?n[2*s-1]:0)>=o)r=s;else{if(!(n[2*s+1]<o)){t=n[2*s+2];break}i=s+1}}var a=t?t.indexOf("cm-overlay "):-1;return 0>a?t:0==a?null:t.slice(0,a-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){return this.getHelpers(e,t)[0]},getHelpers:function(e,t){var n=[];if(!as.hasOwnProperty(t))return n;var i=as[t],r=this.getModeAt(e);if("string"==typeof r[t])i[r[t]]&&n.push(i[r[t]]);else if(r[t])for(var o=0;o<r[t].length;o++){var s=i[r[t][o]];s&&n.push(s)}else r.helperType&&i[r.helperType]?n.push(i[r.helperType]):i[r.name]&&n.push(i[r.name]);for(var o=0;o<i._global.length;o++){var a=i._global[o];a.pred(r,this)&&-1==Or(n,a.val)&&n.push(a.val)}return n},getStateAfter:function(e,t){var n=this.doc;return e=pe(n,null==e?n.first+n.size-1:e),We(this,e+1,t)},cursorCoords:function(e,t){var n,i=this.doc.sel.primary();return n=null==e?i.head:"object"==typeof e?me(this.doc,e):e?i.from():i.to(),ft(this,n,t||"page")},charCoords:function(e,t){return ht(this,me(this.doc,e),t||"page")},coordsChar:function(e,t){return e=dt(this,e,t||"page"),gt(this,e.left,e.top)},lineAtHeight:function(e,t){return e=dt(this,{top:e,left:0},t||"page").top,nr(this.doc,e+this.display.viewOffset)},heightAtLine:function(e,t){var n,i=!1;if("number"==typeof e){var r=this.doc.first+this.doc.size-1;e<this.doc.first?e=this.doc.first:e>r&&(e=r,i=!0),n=Ki(this.doc,e)}else n=e;return ut(this,n,{top:0,left:0},t||"page").top+(i?this.doc.height-ir(n):0)},defaultTextHeight:function(){return yt(this.display)},defaultCharWidth:function(){return bt(this.display)},setGutterMarker:At(function(e,t,n){return Fn(this.doc,e,"gutter",function(e){var i=e.gutterMarkers||(e.gutterMarkers={});return i[t]=n,!n&&jr(i)&&(e.gutterMarkers=null),!0})}),clearGutter:At(function(e){var t=this,n=t.doc,i=n.first;n.iter(function(n){n.gutterMarkers&&n.gutterMarkers[e]&&(n.gutterMarkers[e]=null,Rt(t,i,"gutter"),jr(n.gutterMarkers)&&(n.gutterMarkers=null)),++i})}),lineInfo:function(e){if("number"==typeof e){if(!ve(this.doc,e))return null;var t=e;if(e=Ki(this.doc,e),!e)return null}else{var t=tr(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.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,n,i,r){var o=this.display;e=ft(this,me(this.doc,e));var s=e.bottom,a=e.left;if(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),o.sizer.appendChild(t),"over"==i)s=e.top;else if("above"==i||"near"==i){var l=Math.max(o.wrapper.clientHeight,this.doc.height),c=Math.max(o.sizer.clientWidth,o.lineSpace.clientWidth);("above"==i||e.bottom+t.offsetHeight>l)&&e.top>t.offsetHeight?s=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=l&&(s=e.bottom),a+t.offsetWidth>c&&(a=c-t.offsetWidth)}t.style.top=s+"px",t.style.left=t.style.right="","right"==r?(a=o.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==r?a=0:"middle"==r&&(a=(o.sizer.clientWidth-t.offsetWidth)/2),t.style.left=a+"px"),n&&In(this,a,s,a+t.offsetWidth,s+t.offsetHeight)},triggerOnKeyDown:At(hn),triggerOnKeyPress:At(mn),triggerOnKeyUp:pn,execCommand:function(e){return us.hasOwnProperty(e)?us[e].call(null,this):void 0},triggerElectric:At(function(e){J(this,e)}),findPosH:function(e,t,n,i){var r=1;0>t&&(r=-1,t=-t);for(var o=0,s=me(this.doc,e);t>o&&(s=qn(this.doc,s,r,n,i),!s.hitSide);++o);return s},moveH:At(function(e,t){var n=this;n.extendSelectionsBy(function(i){return n.display.shift||n.doc.extend||i.empty()?qn(n.doc,i.head,e,t,n.options.rtlMoveVisually):0>e?i.from():i.to()},Bs)}),deleteH:At(function(e,t){var n=this.doc.sel,i=this.doc;n.somethingSelected()?i.replaceSelection("",null,"+delete"):Wn(this,function(n){var r=qn(i,n.head,e,t,!1);return 0>e?{from:r,to:n.head}:{from:n.head,to:r}})}),findPosV:function(e,t,n,i){var r=1,o=i;0>t&&(r=-1,t=-t);for(var s=0,a=me(this.doc,e);t>s;++s){var l=ft(this,a,"div");if(null==o?o=l.left:l.left=o,a=zn(this,l,r,n),a.hitSide)break}return a},moveV:At(function(e,t){var n=this,i=this.doc,r=[],o=!n.display.shift&&!i.extend&&i.sel.somethingSelected();if(i.extendSelectionsBy(function(s){if(o)return 0>e?s.from():s.to();var a=ft(n,s.head,"div");null!=s.goalColumn&&(a.left=s.goalColumn),r.push(a.left);var l=zn(n,a,e,t);return"page"==t&&s==i.sel.primary()&&Pn(n,null,ht(n,l,"div").top-a.top),l},Bs),r.length)for(var s=0;s<i.sel.ranges.length;s++)i.sel.ranges[s].goalColumn=r[s]}),findWordAt:function(e){var t=this.doc,n=Ki(t,e.line).text,i=e.ch,r=e.ch;if(n){var o=this.getHelper(e,"wordChars");(e.xRel<0||r==n.length)&&i?--i:++r;for(var s=n.charAt(i),a=Br(s,o)?function(e){return Br(e,o)}:/\s/.test(s)?function(e){return/\s/.test(e)}:function(e){return!/\s/.test(e)&&!Br(e)};i>0&&a(n.charAt(i-1));)--i;for(;r<n.length&&a(n.charAt(r));)++r}return new de(Ho(e.line,i),Ho(e.line,r))},toggleOverwrite:function(e){null!=e&&e==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?Qs(this.display.cursorDiv,"CodeMirror-overwrite"):Ks(this.display.cursorDiv,"CodeMirror-overwrite"),Os(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==Yr()},isReadOnly:function(){return!(!this.options.readOnly&&!this.doc.cantEdit)},scrollTo:At(function(e,t){null==e&&null==t||Bn(this),null!=e&&(this.curOp.scrollLeft=e),null!=t&&(this.curOp.scrollTop=t)}),getScrollInfo:function(){var e=this.display.scroller;return{left:e.scrollLeft,top:e.scrollTop,height:e.scrollHeight-Ue(this)-this.display.barHeight,width:e.scrollWidth-Ue(this)-this.display.barWidth,clientHeight:Ge(this),clientWidth:Ve(this)}},scrollIntoView:At(function(e,t){if(null==e?(e={from:this.doc.sel.primary().head,to:null},null==t&&(t=this.options.cursorScrollMargin)):"number"==typeof e?e={from:Ho(e,0),to:null}:null==e.from&&(e={from:e,to:null}),e.to||(e.to=e.from),e.margin=t||0,null!=e.from.line)Bn(this),this.curOp.scrollToPos=e;else{var n=Rn(this,Math.min(e.from.left,e.to.left),Math.min(e.from.top,e.to.top)-e.margin,Math.max(e.from.right,e.to.right),Math.max(e.from.bottom,e.to.bottom)+e.margin);this.scrollTo(n.scrollLeft,n.scrollTop)}}),setSize:At(function(e,t){function n(e){return"number"==typeof e||/^\d+$/.test(String(e))?e+"px":e}var i=this;
  null!=e&&(i.display.wrapper.style.width=n(e)),null!=t&&(i.display.wrapper.style.height=n(t)),i.options.lineWrapping&&st(this);var r=i.display.viewFrom;i.doc.iter(r,i.display.viewTo,function(e){if(e.widgets)for(var t=0;t<e.widgets.length;t++)if(e.widgets[t].noHScroll){Rt(i,r,"widget");break}++r}),i.curOp.forceUpdate=!0,Os(i,"refresh",this)}),operation:function(e){return Et(this,e)},refresh:At(function(){var e=this.display.cachedTextHeight;It(this),this.curOp.forceUpdate=!0,at(this),this.scrollTo(this.doc.scrollLeft,this.doc.scrollTop),u(this),(null==e||Math.abs(e-yt(this.display))>.5)&&s(this),Os(this,"refresh",this)}),swapDoc:At(function(e){var t=this.doc;return t.cm=null,Zi(this,e),at(this),this.display.input.reset(),this.scrollTo(e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,_r(this,"swapDoc",this,t),t}),getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},Er(e);var es=e.defaults={},ts=e.optionHandlers={},ns=e.Init={toString:function(){return"CodeMirror.Init"}};Yn("value","",function(e,t){e.setValue(t)},!0),Yn("mode",null,function(e,t){e.doc.modeOption=t,n(e)},!0),Yn("indentUnit",2,n,!0),Yn("indentWithTabs",!1),Yn("smartIndent",!0),Yn("tabSize",4,function(e){i(e),at(e),It(e)},!0),Yn("lineSeparator",null,function(e,t){if(e.doc.lineSep=t,t){var n=[],i=e.doc.first;e.doc.iter(function(e){for(var r=0;;){var o=e.text.indexOf(t,r);if(-1==o)break;r=o+t.length,n.push(Ho(i,o))}i++});for(var r=n.length-1;r>=0;r--)$n(e.doc,t,n[r],Ho(n[r].line,n[r].ch+t.length))}}),Yn("specialChars",/[\u0000-\u001f\u007f\u00ad\u200b-\u200f\u2028\u2029\ufeff]/g,function(t,n,i){t.state.specialChars=new RegExp(n.source+(n.test("\t")?"":"|\t"),"g"),i!=e.Init&&t.refresh()}),Yn("specialCharPlaceholder",Bi,function(e){e.refresh()},!0),Yn("electricChars",!0),Yn("inputStyle",Eo?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),Yn("rtlMoveVisually",!$o),Yn("wholeLineUpdateBefore",!0),Yn("theme","default",function(e){a(e),l(e)},!0),Yn("keyMap","default",function(t,n,i){var r=Vn(n),o=i!=e.Init&&Vn(i);o&&o.detach&&o.detach(t,r),r.attach&&r.attach(t,o||null)}),Yn("extraKeys",null),Yn("lineWrapping",!1,r,!0),Yn("gutters",[],function(e){f(e.options),l(e)},!0),Yn("fixedGutter",!0,function(e,t){e.display.gutters.style.left=t?_(e.display)+"px":"0",e.refresh()},!0),Yn("coverGutterNextToScrollbar",!1,function(e){y(e)},!0),Yn("scrollbarStyle","native",function(e){v(e),y(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)},!0),Yn("lineNumbers",!1,function(e){f(e.options),l(e)},!0),Yn("firstLineNumber",1,l,!0),Yn("lineNumberFormatter",function(e){return e},l,!0),Yn("showCursorWhenSelecting",!1,Ne,!0),Yn("resetSelectionOnContextMenu",!0),Yn("lineWiseCopyCut",!0),Yn("readOnly",!1,function(e,t){"nocursor"==t?(yn(e),e.display.input.blur(),e.display.disabled=!0):e.display.disabled=!1,e.display.input.readOnlyChanged(t)}),Yn("disableInput",!1,function(e,t){t||e.display.input.reset()},!0),Yn("dragDrop",!0,qt),Yn("allowDropFileTypes",null),Yn("cursorBlinkRate",530),Yn("cursorScrollMargin",0),Yn("cursorHeight",1,Ne,!0),Yn("singleCursorHeightPerLine",!0,Ne,!0),Yn("workTime",100),Yn("workDelay",100),Yn("flattenSpans",!0,i,!0),Yn("addModeClass",!1,i,!0),Yn("pollInterval",100),Yn("undoDepth",200,function(e,t){e.doc.history.undoDepth=t}),Yn("historyEventDelay",1250),Yn("viewportMargin",10,function(e){e.refresh()},!0),Yn("maxHighlightLength",1e4,i,!0),Yn("moveInputWithCursor",!0,function(e,t){t||e.display.input.resetPosition()}),Yn("tabindex",null,function(e,t){e.display.input.getField().tabIndex=t||""}),Yn("autofocus",null);var is=e.modes={},rs=e.mimeModes={};e.defineMode=function(t,n){e.defaults.mode||"null"==t||(e.defaults.mode=t),arguments.length>2&&(n.dependencies=Array.prototype.slice.call(arguments,2)),is[t]=n},e.defineMIME=function(e,t){rs[e]=t},e.resolveMode=function(t){if("string"==typeof t&&rs.hasOwnProperty(t))t=rs[t];else if(t&&"string"==typeof t.name&&rs.hasOwnProperty(t.name)){var n=rs[t.name];"string"==typeof n&&(n={name:n}),t=Rr(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),i=is[n.name];if(!i)return e.getMode(t,"text/plain");var r=i(t,n);if(os.hasOwnProperty(n.name)){var o=os[n.name];for(var s in o)o.hasOwnProperty(s)&&(r.hasOwnProperty(s)&&(r["_"+s]=r[s]),r[s]=o[s])}if(r.name=n.name,n.helperType&&(r.helperType=n.helperType),n.modeProps)for(var s in n.modeProps)r[s]=n.modeProps[s];return r},e.defineMode("null",function(){return{token:function(e){e.skipToEnd()}}}),e.defineMIME("text/plain","null");var os=e.modeExtensions={};e.extendMode=function(e,t){var n=os.hasOwnProperty(e)?os[e]:os[e]={};Pr(t,n)},e.defineExtension=function(t,n){e.prototype[t]=n},e.defineDocExtension=function(e,t){_s.prototype[e]=t},e.defineOption=Yn;var ss=[];e.defineInitHook=function(e){ss.push(e)};var as=e.helpers={};e.registerHelper=function(t,n,i){as.hasOwnProperty(t)||(as[t]=e[t]={_global:[]}),as[t][n]=i},e.registerGlobalHelper=function(t,n,i,r){e.registerHelper(t,n,r),as[t]._global.push({pred:i,val:r})};var ls=e.copyState=function(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var n={};for(var i in t){var r=t[i];r instanceof Array&&(r=r.concat([])),n[i]=r}return n},cs=e.startState=function(e,t,n){return!e.startState||e.startState(t,n)};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 us=e.commands={selectAll:function(e){e.setSelection(Ho(e.firstLine(),0),Ho(e.lastLine()),Ps)},singleSelection:function(e){e.setSelection(e.getCursor("anchor"),e.getCursor("head"),Ps)},killLine:function(e){Wn(e,function(t){if(t.empty()){var n=Ki(e.doc,t.head.line).text.length;return t.head.ch==n&&t.head.line<e.lastLine()?{from:t.head,to:Ho(t.head.line+1,0)}:{from:t.head,to:Ho(t.head.line,n)}}return{from:t.from(),to:t.to()}})},deleteLine:function(e){Wn(e,function(t){return{from:Ho(t.from().line,0),to:me(e.doc,Ho(t.to().line+1,0))}})},delLineLeft:function(e){Wn(e,function(e){return{from:Ho(e.from().line,0),to:e.from()}})},delWrappedLineLeft:function(e){Wn(e,function(t){var n=e.charCoords(t.head,"div").top+5,i=e.coordsChar({left:0,top:n},"div");return{from:i,to:t.from()}})},delWrappedLineRight:function(e){Wn(e,function(t){var n=e.charCoords(t.head,"div").top+5,i=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},"div");return{from:t.from(),to:i}})},undo:function(e){e.undo()},redo:function(e){e.redo()},undoSelection:function(e){e.undoSelection()},redoSelection:function(e){e.redoSelection()},goDocStart:function(e){e.extendSelection(Ho(e.firstLine(),0))},goDocEnd:function(e){e.extendSelection(Ho(e.lastLine()))},goLineStart:function(e){e.extendSelectionsBy(function(t){return oo(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){e.extendSelectionsBy(function(t){return ao(e,t.head)},{origin:"+move",bias:1})},goLineEnd:function(e){e.extendSelectionsBy(function(t){return so(e,t.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){e.extendSelectionsBy(function(t){var n=e.charCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},"div")},Bs)},goLineLeft:function(e){e.extendSelectionsBy(function(t){var n=e.charCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:n},"div")},Bs)},goLineLeftSmart:function(e){e.extendSelectionsBy(function(t){var n=e.charCoords(t.head,"div").top+5,i=e.coordsChar({left:0,top:n},"div");return i.ch<e.getLine(i.line).search(/\S/)?ao(e,t.head):i},Bs)},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("\t")},insertSoftTab:function(e){for(var t=[],n=e.listSelections(),i=e.options.tabSize,r=0;r<n.length;r++){var o=n[r].from(),s=js(e.getLine(o.line),o.ch,i);t.push(Ar(i-s%i))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){Et(e,function(){for(var t=e.listSelections(),n=[],i=0;i<t.length;i++){var r=t[i].head,o=Ki(e.doc,r.line).text;if(o)if(r.ch==o.length&&(r=new Ho(r.line,r.ch-1)),r.ch>0)r=new Ho(r.line,r.ch+1),e.replaceRange(o.charAt(r.ch-1)+o.charAt(r.ch-2),Ho(r.line,r.ch-2),r,"+transpose");else if(r.line>e.doc.first){var s=Ki(e.doc,r.line-1).text;s&&e.replaceRange(o.charAt(0)+e.doc.lineSeparator()+s.charAt(s.length-1),Ho(r.line-1,s.length-1),Ho(r.line,1),"+transpose")}n.push(new de(r,r))}e.setSelections(n)})},newlineAndIndent:function(e){Et(e,function(){for(var t=e.listSelections().length,n=0;t>n;n++){var i=e.listSelections()[n];e.replaceRange(e.doc.lineSeparator(),i.anchor,i.head,"+input"),e.indentLine(i.from().line+1,null,!0)}Hn(e)})},openLine:function(e){e.replaceSelection("\n","start")},toggleOverwrite:function(e){e.toggleOverwrite()}},ds=e.keyMap={};ds.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},ds.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},ds.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},ds.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},ds["default"]=Lo?ds.macDefault:ds.pcDefault,e.normalizeKeyMap=function(e){var t={};for(var n in e)if(e.hasOwnProperty(n)){var i=e[n];if(/^(name|fallthrough|(de|at)tach)$/.test(n))continue;if("..."==i){delete e[n];continue}for(var r=Nr(n.split(" "),Un),o=0;o<r.length;o++){var s,a;o==r.length-1?(a=r.join(" "),s=i):(a=r.slice(0,o+1).join(" "),s="...");var l=t[a];if(l){if(l!=s)throw new Error("Inconsistent bindings for "+a)}else t[a]=s}delete e[n]}for(var c in t)e[c]=t[c];return e};var hs=e.lookupKey=function(e,t,n,i){t=Vn(t);var r=t.call?t.call(e,i):t[e];if(r===!1)return"nothing";if("..."===r)return"multi";if(null!=r&&n(r))return"handled";if(t.fallthrough){if("[object Array]"!=Object.prototype.toString.call(t.fallthrough))return hs(e,t.fallthrough,n,i);for(var o=0;o<t.fallthrough.length;o++){var s=hs(e,t.fallthrough[o],n,i);if(s)return s}}},fs=e.isModifierKey=function(e){var t="string"==typeof e?e:oa[e.keyCode];return"Ctrl"==t||"Alt"==t||"Shift"==t||"Mod"==t},ps=e.keyName=function(e,t){if(_o&&34==e.keyCode&&e["char"])return!1;var n=oa[e.keyCode],i=n;return null!=i&&!e.altGraphKey&&(e.altKey&&"Alt"!=n&&(i="Alt-"+i),(No?e.metaKey:e.ctrlKey)&&"Ctrl"!=n&&(i="Ctrl-"+i),(No?e.ctrlKey:e.metaKey)&&"Cmd"!=n&&(i="Cmd-"+i),!t&&e.shiftKey&&"Shift"!=n&&(i="Shift-"+i),i)};e.fromTextArea=function(t,n){function i(){t.value=c.getValue()}if(n=n?Pr(n):{},n.value=t.value,!n.tabindex&&t.tabIndex&&(n.tabindex=t.tabIndex),!n.placeholder&&t.placeholder&&(n.placeholder=t.placeholder),null==n.autofocus){var r=Yr();n.autofocus=r==t||null!=t.getAttribute("autofocus")&&r==document.body}if(t.form&&(Ls(t.form,"submit",i),!n.leaveSubmitMethodAlone)){var o=t.form,s=o.submit;try{var a=o.submit=function(){i(),o.submit=s,o.submit(),o.submit=a}}catch(l){}}n.finishInit=function(e){e.save=i,e.getTextArea=function(){return t},e.toTextArea=function(){e.toTextArea=isNaN,i(),t.parentNode.removeChild(e.getWrapperElement()),t.style.display="",t.form&&($s(t.form,"submit",i),"function"==typeof t.form.submit&&(t.form.submit=s))}},t.style.display="none";var c=e(function(e){t.parentNode.insertBefore(e,t.nextSibling)},n);return c};var ms=e.StringStream=function(e,t){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0};ms.prototype={eol:function(){return this.pos>=this.string.length},sol:function(){return this.pos==this.lineStart},peek:function(){return this.string.charAt(this.pos)||void 0},next:function(){return this.pos<this.string.length?this.string.charAt(this.pos++):void 0},eat:function(e){var t=this.string.charAt(this.pos);if("string"==typeof e)var n=t==e;else var n=t&&(e.test?e.test(t):e(t));return n?(++this.pos,t):void 0},eatWhile:function(e){for(var t=this.pos;this.eat(e););return this.pos>t},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.lastColumnPos<this.start&&(this.lastColumnValue=js(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?js(this.string,this.lineStart,this.tabSize):0)},indentation:function(){return js(this.string,null,this.tabSize)-(this.lineStart?js(this.string,this.lineStart,this.tabSize):0)},match:function(e,t,n){if("string"!=typeof e){var i=this.string.slice(this.pos).match(e);return i&&i.index>0?null:(i&&t!==!1&&(this.pos+=i[0].length),i)}var r=function(e){return n?e.toLowerCase():e},o=this.string.substr(this.pos,e.length);return r(o)==r(e)?(t!==!1&&(this.pos+=e.length),!0):void 0},current:function(){return this.string.slice(this.start,this.pos)},hideFirstChars:function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}}};var gs=0,vs=e.TextMarker=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++gs};Er(vs),vs.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&xt(e),Mr(this,"clear")){var n=this.find();n&&_r(this,"clear",n.from,n.to)}for(var i=null,r=null,o=0;o<this.lines.length;++o){var s=this.lines[o],a=ei(s.markedSpans,this);e&&!this.collapsed?Rt(e,tr(s),"text"):e&&(null!=a.to&&(r=tr(s)),null!=a.from&&(i=tr(s))),s.markedSpans=ti(s.markedSpans,a),null==a.from&&this.collapsed&&!Ci(this.doc,s)&&e&&er(s,yt(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var o=0;o<this.lines.length;++o){var l=yi(this.lines[o]),c=d(l);c>e.display.maxLineLength&&(e.display.maxLine=l,e.display.maxLineLength=c,e.display.maxLineChanged=!0)}null!=i&&e&&this.collapsed&&It(e,i,r+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Ee(e.doc)),e&&_r(e,"markerCleared",e,this),t&&Ct(e),this.parent&&this.parent.clear()}},vs.prototype.find=function(e,t){null==e&&"bookmark"==this.type&&(e=1);for(var n,i,r=0;r<this.lines.length;++r){var o=this.lines[r],s=ei(o.markedSpans,this);if(null!=s.from&&(n=Ho(t?o:tr(o),s.from),-1==e))return n;if(null!=s.to&&(i=Ho(t?o:tr(o),s.to),1==e))return i}return n&&{from:n,to:i}},vs.prototype.changed=function(){var e=this.find(-1,!0),t=this,n=this.doc.cm;e&&n&&Et(n,function(){var i=e.line,r=tr(e.line),o=Je(n,r);if(o&&(ot(o),n.curOp.selectionChanged=n.curOp.forceUpdate=!0),n.curOp.updateMaxLine=!0,!Ci(t.doc,i)&&null!=t.height){var s=t.height;t.height=null;var a=Si(t)-s;a&&er(i,i.height+a)}})},vs.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;t.maybeHiddenMarkers&&-1!=Or(t.maybeHiddenMarkers,this)||(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},vs.prototype.detachLine=function(e){if(this.lines.splice(Or(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}};var gs=0,ys=e.SharedTextMarker=function(e,t){this.markers=e,this.primary=t;for(var n=0;n<e.length;++n)e[n].parent=this};Er(ys),ys.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();_r(this,"clear")}},ys.prototype.find=function(e,t){return this.primary.find(e,t)};var bs=e.LineWidget=function(e,t,n){if(n)for(var i in n)n.hasOwnProperty(i)&&(this[i]=n[i]);this.doc=e,this.node=t};Er(bs),bs.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,n=this.line,i=tr(n);if(null!=i&&t){for(var r=0;r<t.length;++r)t[r]==this&&t.splice(r--,1);t.length||(n.widgets=null);var o=Si(this);er(n,Math.max(0,n.height-o)),e&&Et(e,function(){_i(e,n,-o),Rt(e,i,"widget")})}},bs.prototype.changed=function(){var e=this.height,t=this.doc.cm,n=this.line;this.height=null;var i=Si(this)-e;i&&(er(n,n.height+i),t&&Et(t,function(){t.curOp.forceUpdate=!0,_i(t,n,i)}))};var xs=e.Line=function(e,t,n){this.text=e,ui(this,t),this.height=n?n(this):1};Er(xs),xs.prototype.lineNo=function(){return tr(this)};var ws={},Cs={};Vi.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var n=e,i=e+t;i>n;++n){var r=this.lines[n];this.height-=r.height,Mi(r),_r(r,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,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 i=0;i<t.length;++i)t[i].parent=this},iterN:function(e,t,n){for(var i=e+t;i>e;++e)if(n(this.lines[e]))return!0}},Gi.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var n=0;n<this.children.length;++n){var i=this.children[n],r=i.chunkSize();if(r>e){var o=Math.min(t,r-e),s=i.height;if(i.removeInner(e,o),this.height-=s-i.height,r==o&&(this.children.splice(n--,1),i.parent=null),0==(t-=o))break;e=0}else e-=r}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof Vi))){var a=[];this.collapse(a),this.children=[new Vi(a)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t<this.children.length;++t)this.children[t].collapse(e)},insertInner:function(e,t,n){this.size+=t.length,this.height+=n;for(var i=0;i<this.children.length;++i){var r=this.children[i],o=r.chunkSize();if(o>=e){if(r.insertInner(e,t,n),r.lines&&r.lines.length>50){for(var s=r.lines.length%25+25,a=s;a<r.lines.length;){var l=new Vi(r.lines.slice(a,a+=25));r.height-=l.height,this.children.splice(++i,0,l),l.parent=this}r.lines=r.lines.slice(0,s),this.maybeSpill()}break}e-=o}},maybeSpill:function(){if(!(this.children.length<=10)){var e=this;do{var t=e.children.splice(e.children.length-5,5),n=new Gi(t);if(e.parent){e.size-=n.size,e.height-=n.height;var i=Or(e.parent.children,e);e.parent.children.splice(i+1,0,n)}else{var r=new Gi(e.children);r.parent=e,e.children=[r,n],e=r}n.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()}},iterN:function(e,t,n){for(var i=0;i<this.children.length;++i){var r=this.children[i],o=r.chunkSize();if(o>e){var s=Math.min(t,o-e);if(r.iterN(e,s,n))return!0;if(0==(t-=s))break;e=0}else e-=o}}};var ks=0,_s=e.Doc=function(e,t,n,i){if(!(this instanceof _s))return new _s(e,t,n,i);null==n&&(n=0),Gi.call(this,[new Vi([new xs("",null)])]),this.first=n,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.frontier=n;var r=Ho(n,0);this.sel=fe(r),this.history=new or(null),this.id=++ks,this.modeOption=t,this.lineSep=i,this.extend=!1,"string"==typeof e&&(e=this.splitLines(e)),Ui(this,{from:r,to:r,text:e}),Te(this,fe(r),Ps)};_s.prototype=Rr(Gi.prototype,{constructor:_s,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,i=0;i<t.length;++i)n+=t[i].height;this.insertInner(e-this.first,t,n)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=Ji(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:$t(function(e){var t=Ho(this.first,0),n=this.first+this.size-1;Tn(this,{from:t,to:Ho(n,Ki(this,n).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),Te(this,fe(t))}),replaceRange:function(e,t,n,i){t=me(this,t),n=n?me(this,n):t,$n(this,e,t,n,i)},getRange:function(e,t,n){var i=Qi(this,me(this,e),me(this,t));return n===!1?i:i.join(n||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){return ve(this,e)?Ki(this,e):void 0},getLineNumber:function(e){return tr(e)},getLineHandleVisualStart:function(e){return"number"==typeof e&&(e=Ki(this,e)),yi(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return me(this,e)},getCursor:function(e){var t,n=this.sel.primary();return t=null==e||"head"==e?n.head:"anchor"==e?n.anchor:"end"==e||"to"==e||e===!1?n.to():n.from()},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:$t(function(e,t,n){ke(this,me(this,"number"==typeof e?Ho(e,t||0):e),null,n)}),setSelection:$t(function(e,t,n){ke(this,me(this,e),me(this,t||e),n)}),extendSelection:$t(function(e,t,n){xe(this,me(this,e),t&&me(this,t),n)}),extendSelections:$t(function(e,t){we(this,ye(this,e),t)}),extendSelectionsBy:$t(function(e,t){var n=Nr(this.sel.ranges,e);we(this,ye(this,n),t)}),setSelections:$t(function(e,t,n){if(e.length){for(var i=0,r=[];i<e.length;i++)r[i]=new de(me(this,e[i].anchor),me(this,e[i].head));null==t&&(t=Math.min(e.length-1,this.sel.primIndex)),Te(this,he(r,t),n)}}),addSelection:$t(function(e,t,n){var i=this.sel.ranges.slice(0);i.push(new de(me(this,e),me(this,t||e))),Te(this,he(i,i.length-1),n)}),getSelection:function(e){for(var t,n=this.sel.ranges,i=0;i<n.length;i++){var r=Qi(this,n[i].from(),n[i].to());t=t?t.concat(r):r}return e===!1?t:t.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],n=this.sel.ranges,i=0;i<n.length;i++){var r=Qi(this,n[i].from(),n[i].to());e!==!1&&(r=r.join(e||this.lineSeparator())),t[i]=r}return t},replaceSelection:function(e,t,n){for(var i=[],r=0;r<this.sel.ranges.length;r++)i[r]=e;this.replaceSelections(i,t,n||"+input")},replaceSelections:$t(function(e,t,n){for(var i=[],r=this.sel,o=0;o<r.ranges.length;o++){var s=r.ranges[o];i[o]={from:s.from(),to:s.to(),text:this.splitLines(e[o]),origin:n}}for(var a=t&&"end"!=t&&_n(this,i,t),o=i.length-1;o>=0;o--)Tn(this,i[o]);a?Se(this,a):this.cm&&Hn(this.cm)}),undo:$t(function(){Mn(this,"undo")}),redo:$t(function(){Mn(this,"redo")}),undoSelection:$t(function(){Mn(this,"undo",!0)}),redoSelection:$t(function(){Mn(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,n=0,i=0;i<e.done.length;i++)e.done[i].ranges||++t;for(var i=0;i<e.undone.length;i++)e.undone[i].ranges||++n;return{undo:t,redo:n}},clearHistory:function(){this.history=new or(this.history.maxGeneration)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){return e&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:gr(this.history.done),undone:gr(this.history.undone)}},setHistory:function(e){var t=this.history=new or(this.history.maxGeneration);t.done=gr(e.done.slice(0),null,!0),t.undone=gr(e.undone.slice(0),null,!0)},addLineClass:$t(function(e,t,n){return Fn(this,e,"gutter"==t?"gutter":"class",function(e){var i="text"==t?"textClass":"background"==t?"bgClass":"gutter"==t?"gutterClass":"wrapClass";if(e[i]){if(Ur(n).test(e[i]))return!1;e[i]+=" "+n}else e[i]=n;return!0})}),removeLineClass:$t(function(e,t,n){return Fn(this,e,"gutter"==t?"gutter":"class",function(e){var i="text"==t?"textClass":"background"==t?"bgClass":"gutter"==t?"gutterClass":"wrapClass",r=e[i];if(!r)return!1;if(null==n)e[i]=null;else{var o=r.match(Ur(n));if(!o)return!1;var s=o.index+o[0].length;e[i]=r.slice(0,o.index)+(o.index&&s!=r.length?" ":"")+r.slice(s)||null}return!0})}),addLineWidget:$t(function(e,t,n){return Ti(this,e,t,n)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,n){return Gn(this,me(this,e),me(this,t),n,n&&n.type||"range")},setBookmark:function(e,t){var n={replacedWith:t&&(null==t.nodeType?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return e=me(this,e),Gn(this,e,e,n,"bookmark")},findMarksAt:function(e){e=me(this,e);var t=[],n=Ki(this,e.line).markedSpans;if(n)for(var i=0;i<n.length;++i){var r=n[i];(null==r.from||r.from<=e.ch)&&(null==r.to||r.to>=e.ch)&&t.push(r.marker.parent||r.marker)}return t},findMarks:function(e,t,n){e=me(this,e),t=me(this,t);var i=[],r=e.line;return this.iter(e.line,t.line+1,function(o){var s=o.markedSpans;if(s)for(var a=0;a<s.length;a++){var l=s[a];null!=l.to&&r==e.line&&e.ch>=l.to||null==l.from&&r!=e.line||null!=l.from&&r==t.line&&l.from>=t.ch||n&&!n(l.marker)||i.push(l.marker.parent||l.marker)}++r}),i},getAllMarks:function(){var e=[];return this.iter(function(t){var n=t.markedSpans;if(n)for(var i=0;i<n.length;++i)null!=n[i].from&&e.push(n[i].marker)}),e},posFromIndex:function(e){var t,n=this.first,i=this.lineSeparator().length;return this.iter(function(r){var o=r.text.length+i;return o>e?(t=e,!0):(e-=o,void++n)}),me(this,Ho(n,t))},indexFromPos:function(e){e=me(this,e);var t=e.ch;if(e.line<this.first||e.ch<0)return 0;var n=this.lineSeparator().length;return this.iter(this.first,e.line,function(e){t+=e.text.length+n}),t},copy:function(e){var t=new _s(Ji(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,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&&e.to<n&&(n=e.to);var i=new _s(Ji(this,t,n),e.mode||this.modeOption,t,this.lineSep);return e.sharedHist&&(i.history=this.history),(this.linked||(this.linked=[])).push({doc:i,sharedHist:e.sharedHist}),i.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],Kn(i,Zn(this)),i},unlinkDoc:function(t){if(t instanceof e&&(t=t.doc),this.linked)for(var n=0;n<this.linked.length;++n){var i=this.linked[n];if(i.doc==t){this.linked.splice(n,1),t.unlinkDoc(this),Qn(Zn(this));break}}if(t.history==this.history){var r=[t.id];Xi(t,function(e){r.push(e.id)},!0),t.history=new or(null),t.history.done=gr(this.history.done,r),t.history.undone=gr(this.history.undone,r)}},iterLinkedDocs:function(e){Xi(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):ta(e)},lineSeparator:function(){return this.lineSep||"\n"}}),_s.prototype.eachLine=_s.prototype.iter;var Ss="iter insert remove copy getEditor constructor".split(" ");for(var Ts in _s.prototype)_s.prototype.hasOwnProperty(Ts)&&Or(Ss,Ts)<0&&(e.prototype[Ts]=function(e){return function(){return e.apply(this.doc,arguments)}}(_s.prototype[Ts]));Er(_s);var Ds=e.e_preventDefault=function(e){e.preventDefault?e.preventDefault():e.returnValue=!1},Ms=e.e_stopPropagation=function(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0},Es=e.e_stop=function(e){Ds(e),Ms(e)},Ls=e.on=function(e,t,n){if(e.addEventListener)e.addEventListener(t,n,!1);else if(e.attachEvent)e.attachEvent("on"+t,n);else{var i=e._handlers||(e._handlers={}),r=i[t]||(i[t]=[]);r.push(n)}},As=[],$s=e.off=function(e,t,n){if(e.removeEventListener)e.removeEventListener(t,n,!1);else if(e.detachEvent)e.detachEvent("on"+t,n);else for(var i=kr(e,t,!1),r=0;r<i.length;++r)if(i[r]==n){i.splice(r,1);break}},Os=e.signal=function(e,t){var n=kr(e,t,!0);if(n.length)for(var i=Array.prototype.slice.call(arguments,2),r=0;r<n.length;++r)n[r].apply(null,i)},Ns=null,Is=30,Rs=e.Pass={toString:function(){return"CodeMirror.Pass"}},Ps={scroll:!1},Hs={origin:"*mouse"},Bs={origin:"+move"};Lr.prototype.set=function(e,t){clearTimeout(this.id),this.id=setTimeout(t,e)};var js=e.countColumn=function(e,t,n,i,r){null==t&&(t=e.search(/[^\s\u00a0]/),-1==t&&(t=e.length));for(var o=i||0,s=r||0;;){var a=e.indexOf("\t",o);if(0>a||a>=t)return s+(t-o);s+=a-o,s+=n-s%n,o=a+1}},Fs=e.findColumn=function(e,t,n){for(var i=0,r=0;;){var o=e.indexOf("\t",i);-1==o&&(o=e.length);var s=o-i;if(o==e.length||r+s>=t)return i+Math.min(s,t-r);if(r+=o-i,r+=n-r%n,i=o+1,r>=t)return i}},Ws=[""],qs=function(e){e.select()};Mo?qs=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:bo&&(qs=function(e){try{e.select()}catch(t){}});var zs,Ys=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,Us=e.isWordChar=function(e){return/\w/.test(e)||e>""&&(e.toUpperCase()!=e.toLowerCase()||Ys.test(e))},Vs=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;
  zs=document.createRange?function(e,t,n,i){var r=document.createRange();return r.setEnd(i||e,n),r.setStart(e,t),r}:function(e,t,n){var i=document.body.createTextRange();try{i.moveToElementText(e.parentNode)}catch(r){return i}return i.collapse(!0),i.moveEnd("character",n),i.moveStart("character",t),i};var Gs=e.contains=function(e,t){if(3==t.nodeType&&(t=t.parentNode),e.contains)return e.contains(t);do if(11==t.nodeType&&(t=t.host),t==e)return!0;while(t=t.parentNode)};bo&&11>xo&&(Yr=function(){try{return document.activeElement}catch(e){return document.body}});var Xs,Zs,Ks=e.rmClass=function(e,t){var n=e.className,i=Ur(t).exec(n);if(i){var r=n.slice(i.index+i[0].length);e.className=n.slice(0,i.index)+(r?i[1]+r:"")}},Qs=e.addClass=function(e,t){var n=e.className;Ur(t).test(n)||(e.className+=(n?" ":"")+t)},Js=!1,ea=function(){if(bo&&9>xo)return!1;var e=Wr("div");return"draggable"in e||"dragDrop"in e}(),ta=e.splitLines=3!="\n\nb".split(/\n/).length?function(e){for(var t=0,n=[],i=e.length;i>=t;){var r=e.indexOf("\n",t);-1==r&&(r=e.length);var o=e.slice(t,"\r"==e.charAt(r-1)?r-1:r),s=o.indexOf("\r");-1!=s?(n.push(o.slice(0,s)),t+=s+1):(n.push(o),t=r+1)}return n}:function(e){return e.split(/\r\n?|\n/)},na=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)},ia=function(){var e=Wr("div");return"oncopy"in e||(e.setAttribute("oncopy","return;"),"function"==typeof e.oncopy)}(),ra=null,oa=e.keyNames={3:"Enter",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",127:"Delete",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"};!function(){for(var e=0;10>e;e++)oa[e+48]=oa[e+96]=String(e);for(var e=65;90>=e;e++)oa[e]=String.fromCharCode(e);for(var e=1;12>=e;e++)oa[e+111]=oa[e+63235]="F"+e}();var sa,aa=function(){function e(e){return 247>=e?n.charAt(e):e>=1424&&1524>=e?"R":e>=1536&&1773>=e?i.charAt(e-1536):e>=1774&&2220>=e?"r":e>=8192&&8203>=e?"w":8204==e?"b":"L"}function t(e,t,n){this.level=e,this.from=t,this.to=n}var n="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",i="rrrrrrrrrrrr,rNNmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmrrrrrrrnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmNmmmm",r=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,o=/[stwN]/,s=/[LRr]/,a=/[Lb1n]/,l=/[1n]/,c="L";return function(n){if(!r.test(n))return!1;for(var i,u=n.length,d=[],h=0;u>h;++h)d.push(i=e(n.charCodeAt(h)));for(var h=0,f=c;u>h;++h){var i=d[h];"m"==i?d[h]=f:f=i}for(var h=0,p=c;u>h;++h){var i=d[h];"1"==i&&"r"==p?d[h]="n":s.test(i)&&(p=i,"r"==i&&(d[h]="R"))}for(var h=1,f=d[0];u-1>h;++h){var i=d[h];"+"==i&&"1"==f&&"1"==d[h+1]?d[h]="1":","!=i||f!=d[h+1]||"1"!=f&&"n"!=f||(d[h]=f),f=i}for(var h=0;u>h;++h){var i=d[h];if(","==i)d[h]="N";else if("%"==i){for(var m=h+1;u>m&&"%"==d[m];++m);for(var g=h&&"!"==d[h-1]||u>m&&"1"==d[m]?"1":"N",v=h;m>v;++v)d[v]=g;h=m-1}}for(var h=0,p=c;u>h;++h){var i=d[h];"L"==p&&"1"==i?d[h]="L":s.test(i)&&(p=i)}for(var h=0;u>h;++h)if(o.test(d[h])){for(var m=h+1;u>m&&o.test(d[m]);++m);for(var y="L"==(h?d[h-1]:c),b="L"==(u>m?d[m]:c),g=y||b?"L":"R",v=h;m>v;++v)d[v]=g;h=m-1}for(var x,w=[],h=0;u>h;)if(a.test(d[h])){var C=h;for(++h;u>h&&a.test(d[h]);++h);w.push(new t(0,C,h))}else{var k=h,_=w.length;for(++h;u>h&&"L"!=d[h];++h);for(var v=k;h>v;)if(l.test(d[v])){v>k&&w.splice(_,0,new t(1,k,v));var S=v;for(++v;h>v&&l.test(d[v]);++v);w.splice(_,0,new t(2,S,v)),k=v}else++v;h>k&&w.splice(_,0,new t(1,k,h))}return 1==w[0].level&&(x=n.match(/^\s+/))&&(w[0].from=x[0].length,w.unshift(new t(0,0,x[0].length))),1==$r(w).level&&(x=n.match(/\s+$/))&&($r(w).to-=x[0].length,w.push(new t(0,u-x[0].length,u))),2==w[0].level&&w.unshift(new t(1,w[0].to,w[0].to)),w[0].level!=$r(w).level&&w.push(new t(w[0].level,u,u)),w}}();return e.version="5.15.2",e})},{}],11:[function(t,n,i){!function(r){"object"==typeof i&&"object"==typeof n?r(t("../../lib/codemirror"),t("../markdown/markdown"),t("../../addon/mode/overlay")):"function"==typeof e&&e.amd?e(["../../lib/codemirror","../markdown/markdown","../../addon/mode/overlay"],r):r(CodeMirror)}(function(e){"use strict";var t=/^((?:(?:aaas?|about|acap|adiumxtra|af[ps]|aim|apt|attachment|aw|beshare|bitcoin|bolo|callto|cap|chrome(?:-extension)?|cid|coap|com-eventbrite-attendee|content|crid|cvs|data|dav|dict|dlna-(?:playcontainer|playsingle)|dns|doi|dtn|dvb|ed2k|facetime|feed|file|finger|fish|ftp|geo|gg|git|gizmoproject|go|gopher|gtalk|h323|hcp|https?|iax|icap|icon|im|imap|info|ipn|ipp|irc[6s]?|iris(?:\.beep|\.lwz|\.xpc|\.xpcs)?|itms|jar|javascript|jms|keyparc|lastfm|ldaps?|magnet|mailto|maps|market|message|mid|mms|ms-help|msnim|msrps?|mtqp|mumble|mupdate|mvn|news|nfs|nih?|nntp|notes|oid|opaquelocktoken|palm|paparazzi|platform|pop|pres|proxy|psyc|query|res(?:ource)?|rmi|rsync|rtmp|rtsp|secondlife|service|session|sftp|sgn|shttp|sieve|sips?|skype|sm[bs]|snmp|soap\.beeps?|soldat|spotify|ssh|steam|svn|tag|teamspeak|tel(?:net)?|tftp|things|thismessage|tip|tn3270|tv|udp|unreal|urn|ut2004|vemmi|ventrilo|view-source|webcal|wss?|wtai|wyciwyg|xcon(?:-userid)?|xfire|xmlrpc\.beeps?|xmpp|xri|ymsgr|z39\.50[rs]?):(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]|\([^\s()<>]*\))+(?:\([^\s()<>]*\)|[^\s`*!()\[\]{};:'".,<>?«»“”‘’]))/i;e.defineMode("gfm",function(n,i){function r(e){return e.code=!1,null}var o=0,s={startState:function(){return{code:!1,codeBlock:!1,ateSpace:!1}},copyState:function(e){return{code:e.code,codeBlock:e.codeBlock,ateSpace:e.ateSpace}},token:function(e,n){if(n.combineTokens=null,n.codeBlock)return e.match(/^```+/)?(n.codeBlock=!1,null):(e.skipToEnd(),null);if(e.sol()&&(n.code=!1),e.sol()&&e.match(/^```+/))return e.skipToEnd(),n.codeBlock=!0,null;if("`"===e.peek()){e.next();var r=e.pos;e.eatWhile("`");var s=1+e.pos-r;return n.code?s===o&&(n.code=!1):(o=s,n.code=!0),null}if(n.code)return e.next(),null;if(e.eatSpace())return n.ateSpace=!0,null;if((e.sol()||n.ateSpace)&&(n.ateSpace=!1,i.gitHubSpice!==!1)){if(e.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+@)?(?:[a-f0-9]{7,40}\b)/))return n.combineTokens=!0,"link";if(e.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+)?#[0-9]+\b/))return n.combineTokens=!0,"link"}return e.match(t)&&"]("!=e.string.slice(e.start-2,e.start)&&(0==e.start||/\W/.test(e.string.charAt(e.start-1)))?(n.combineTokens=!0,"link"):(e.next(),null)},blankLine:r},a={underscoresBreakWords:!1,taskLists:!0,fencedCodeBlocks:"```",strikethrough:!0};for(var l in i)a[l]=i[l];return a.name="markdown",e.overlayMode(e.getMode(n,a),s)},"markdown"),e.defineMIME("text/x-gfm","gfm")})},{"../../addon/mode/overlay":8,"../../lib/codemirror":10,"../markdown/markdown":12}],12:[function(t,n,i){!function(r){"object"==typeof i&&"object"==typeof n?r(t("../../lib/codemirror"),t("../xml/xml"),t("../meta")):"function"==typeof e&&e.amd?e(["../../lib/codemirror","../xml/xml","../meta"],r):r(CodeMirror)}(function(e){"use strict";e.defineMode("markdown",function(t,n){function i(n){if(e.findModeByName){var i=e.findModeByName(n);i&&(n=i.mime||i.mimes[0])}var r=e.getMode(t,n);return"null"==r.name?null:r}function r(e,t,n){return t.f=t.inline=n,n(e,t)}function o(e,t,n){return t.f=t.block=n,n(e,t)}function s(e){return!e||!/\S/.test(e.string)}function a(e){return e.linkTitle=!1,e.em=!1,e.strong=!1,e.strikethrough=!1,e.quote=0,e.indentedCode=!1,C&&e.f==c&&(e.f=p,e.block=l),e.trailingSpace=0,e.trailingSpaceNewLine=!1,e.prevLine=e.thisLine,e.thisLine=null,null}function l(t,o){var a=t.sol(),l=o.list!==!1,c=o.indentedCode;o.indentedCode=!1,l&&(o.indentationDiff>=0?(o.indentationDiff<4&&(o.indentation-=o.indentationDiff),o.list=null):o.indentation>0?o.list=null:o.list=!1);var d=null;if(o.indentationDiff>=4)return t.skipToEnd(),c||s(o.prevLine)?(o.indentation-=4,o.indentedCode=!0,k.code):null;if(t.eatSpace())return null;if((d=t.match(E))&&d[1].length<=6)return o.header=d[1].length,n.highlightFormatting&&(o.formatting="header"),o.f=o.inline,h(o);if(!(s(o.prevLine)||o.quote||l||c)&&(d=t.match(L)))return o.header="="==d[0].charAt(0)?1:2,n.highlightFormatting&&(o.formatting="header"),o.f=o.inline,h(o);if(t.eat(">"))return o.quote=a?1:o.quote+1,n.highlightFormatting&&(o.formatting="quote"),t.eatSpace(),h(o);if("["===t.peek())return r(t,o,y);if(t.match(S,!0))return o.hr=!0,k.hr;if((s(o.prevLine)||l)&&(t.match(T,!1)||t.match(D,!1))){var f=null;for(t.match(T,!0)?f="ul":(t.match(D,!0),f="ol"),o.indentation=t.column()+t.current().length,o.list=!0;o.listStack&&t.column()<o.listStack[o.listStack.length-1];)o.listStack.pop();return o.listStack.push(o.indentation),n.taskLists&&t.match(M,!1)&&(o.taskList=!0),o.f=o.inline,n.highlightFormatting&&(o.formatting=["list","list-"+f]),h(o)}return n.fencedCodeBlocks&&(d=t.match($,!0))?(o.fencedChars=d[1],o.localMode=i(d[2]),o.localMode&&(o.localState=e.startState(o.localMode)),o.f=o.block=u,n.highlightFormatting&&(o.formatting="code-block"),o.code=-1,h(o)):r(t,o,o.inline)}function c(t,n){var i=w.token(t,n.htmlState);if(!C){var r=e.innerMode(w,n.htmlState);("xml"==r.mode.name&&null===r.state.tagStart&&!r.state.context&&r.state.tokenize.isInText||n.md_inside&&t.current().indexOf(">")>-1)&&(n.f=p,n.block=l,n.htmlState=null)}return i}function u(e,t){return t.fencedChars&&e.match(t.fencedChars,!1)?(t.localMode=t.localState=null,t.f=t.block=d,null):t.localMode?t.localMode.token(e,t.localState):(e.skipToEnd(),k.code)}function d(e,t){e.match(t.fencedChars),t.block=l,t.f=p,t.fencedChars=null,n.highlightFormatting&&(t.formatting="code-block"),t.code=1;var i=h(t);return t.code=0,i}function h(e){var t=[];if(e.formatting){t.push(k.formatting),"string"==typeof e.formatting&&(e.formatting=[e.formatting]);for(var i=0;i<e.formatting.length;i++)t.push(k.formatting+"-"+e.formatting[i]),"header"===e.formatting[i]&&t.push(k.formatting+"-"+e.formatting[i]+"-"+e.header),"quote"===e.formatting[i]&&(!n.maxBlockquoteDepth||n.maxBlockquoteDepth>=e.quote?t.push(k.formatting+"-"+e.formatting[i]+"-"+e.quote):t.push("error"))}if(e.taskOpen)return t.push("meta"),t.length?t.join(" "):null;if(e.taskClosed)return t.push("property"),t.length?t.join(" "):null;if(e.linkHref?t.push(k.linkHref,"url"):(e.strong&&t.push(k.strong),e.em&&t.push(k.em),e.strikethrough&&t.push(k.strikethrough),e.linkText&&t.push(k.linkText),e.code&&t.push(k.code)),e.header&&t.push(k.header,k.header+"-"+e.header),e.quote&&(t.push(k.quote),!n.maxBlockquoteDepth||n.maxBlockquoteDepth>=e.quote?t.push(k.quote+"-"+e.quote):t.push(k.quote+"-"+n.maxBlockquoteDepth)),e.list!==!1){var r=(e.listStack.length-1)%3;r?1===r?t.push(k.list2):t.push(k.list3):t.push(k.list1)}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 f(e,t){return e.match(A,!0)?h(t):void 0}function p(t,i){var r=i.text(t,i);if("undefined"!=typeof r)return r;if(i.list)return i.list=null,h(i);if(i.taskList){var s="x"!==t.match(M,!0)[1];return s?i.taskOpen=!0:i.taskClosed=!0,n.highlightFormatting&&(i.formatting="task"),i.taskList=!1,h(i)}if(i.taskOpen=!1,i.taskClosed=!1,i.header&&t.match(/^#+$/,!0))return n.highlightFormatting&&(i.formatting="header"),h(i);var a=t.sol(),l=t.next();if(i.linkTitle){i.linkTitle=!1;var u=l;"("===l&&(u=")"),u=(u+"").replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1");var d="^\\s*(?:[^"+u+"\\\\]+|\\\\\\\\|\\\\.)"+u;if(t.match(new RegExp(d),!0))return k.linkHref}if("`"===l){var f=i.formatting;n.highlightFormatting&&(i.formatting="code"),t.eatWhile("`");var p=t.current().length;if(0==i.code)return i.code=p,h(i);if(p==i.code){var v=h(i);return i.code=0,v}return i.formatting=f,h(i)}if(i.code)return h(i);if("\\"===l&&(t.next(),n.highlightFormatting)){var y=h(i),b=k.formatting+"-escape";return y?y+" "+b:b}if("!"===l&&t.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return t.match(/\[[^\]]*\]/),i.inline=i.f=g,k.image;if("["===l&&t.match(/[^\]]*\](\(.*\)| ?\[.*?\])/,!1))return i.linkText=!0,n.highlightFormatting&&(i.formatting="link"),h(i);if("]"===l&&i.linkText&&t.match(/\(.*?\)| ?\[.*?\]/,!1)){n.highlightFormatting&&(i.formatting="link");var y=h(i);return i.linkText=!1,i.inline=i.f=g,y}if("<"===l&&t.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){i.f=i.inline=m,n.highlightFormatting&&(i.formatting="link");var y=h(i);return y?y+=" ":y="",y+k.linkInline}if("<"===l&&t.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){i.f=i.inline=m,n.highlightFormatting&&(i.formatting="link");var y=h(i);return y?y+=" ":y="",y+k.linkEmail}if("<"===l&&t.match(/^(!--|\w)/,!1)){var x=t.string.indexOf(">",t.pos);if(-1!=x){var C=t.string.substring(t.start,x);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(C)&&(i.md_inside=!0)}return t.backUp(1),i.htmlState=e.startState(w),o(t,i,c)}if("<"===l&&t.match(/^\/\w*?>/))return i.md_inside=!1,"tag";var _=!1;if(!n.underscoresBreakWords&&"_"===l&&"_"!==t.peek()&&t.match(/(\w)/,!1)){var S=t.pos-2;if(S>=0){var T=t.string.charAt(S);"_"!==T&&T.match(/(\w)/,!1)&&(_=!0)}}if("*"===l||"_"===l&&!_)if(a&&" "===t.peek());else{if(i.strong===l&&t.eat(l)){n.highlightFormatting&&(i.formatting="strong");var v=h(i);return i.strong=!1,v}if(!i.strong&&t.eat(l))return i.strong=l,n.highlightFormatting&&(i.formatting="strong"),h(i);if(i.em===l){n.highlightFormatting&&(i.formatting="em");var v=h(i);return i.em=!1,v}if(!i.em)return i.em=l,n.highlightFormatting&&(i.formatting="em"),h(i)}else if(" "===l&&(t.eat("*")||t.eat("_"))){if(" "===t.peek())return h(i);t.backUp(1)}if(n.strikethrough)if("~"===l&&t.eatWhile(l)){if(i.strikethrough){n.highlightFormatting&&(i.formatting="strikethrough");var v=h(i);return i.strikethrough=!1,v}if(t.match(/^[^\s]/,!1))return i.strikethrough=!0,n.highlightFormatting&&(i.formatting="strikethrough"),h(i)}else if(" "===l&&t.match(/^~~/,!0)){if(" "===t.peek())return h(i);t.backUp(2)}return" "===l&&(t.match(/ +$/,!1)?i.trailingSpace++:i.trailingSpace&&(i.trailingSpaceNewLine=!0)),h(i)}function m(e,t){var i=e.next();if(">"===i){t.f=t.inline=p,n.highlightFormatting&&(t.formatting="link");var r=h(t);return r?r+=" ":r="",r+k.linkInline}return e.match(/^[^>]+/,!0),k.linkInline}function g(e,t){if(e.eatSpace())return null;var i=e.next();return"("===i||"["===i?(t.f=t.inline=v("("===i?")":"]",0),n.highlightFormatting&&(t.formatting="link-string"),t.linkHref=!0,h(t)):"error"}function v(e){return function(t,i){var r=t.next();if(r===e){i.f=i.inline=p,n.highlightFormatting&&(i.formatting="link-string");var o=h(i);return i.linkHref=!1,o}return t.match(O[e]),i.linkHref=!0,h(i)}}function y(e,t){return e.match(/^([^\]\\]|\\.)*\]:/,!1)?(t.f=b,e.next(),n.highlightFormatting&&(t.formatting="link"),t.linkText=!0,h(t)):r(e,t,p)}function b(e,t){if(e.match(/^\]:/,!0)){t.f=t.inline=x,n.highlightFormatting&&(t.formatting="link");var i=h(t);return t.linkText=!1,i}return e.match(/^([^\]\\]|\\.)+/,!0),k.linkText}function x(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=p,k.linkHref+" url")}var w=e.getMode(t,"text/html"),C="null"==w.name;void 0===n.highlightFormatting&&(n.highlightFormatting=!1),void 0===n.maxBlockquoteDepth&&(n.maxBlockquoteDepth=0),void 0===n.underscoresBreakWords&&(n.underscoresBreakWords=!0),void 0===n.taskLists&&(n.taskLists=!1),void 0===n.strikethrough&&(n.strikethrough=!1),void 0===n.tokenTypeOverrides&&(n.tokenTypeOverrides={});var k={header:"header",code:"comment",quote:"quote",list1:"variable-2",list2:"variable-3",list3:"keyword",hr:"hr",image:"tag",formatting:"formatting",linkInline:"link",linkEmail:"link",linkText:"link",linkHref:"string",em:"em",strong:"strong",strikethrough:"strikethrough"};for(var _ in k)k.hasOwnProperty(_)&&n.tokenTypeOverrides[_]&&(k[_]=n.tokenTypeOverrides[_]);var S=/^([*\-_])(?:\s*\1){2,}\s*$/,T=/^[*\-+]\s+/,D=/^[0-9]+([.)])\s+/,M=/^\[(x| )\](?=\s)/,E=n.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,L=/^ *(?:\={1,}|-{1,})\s*$/,A=/^[^#!\[\]*_\\<>` "'(~]+/,$=new RegExp("^("+(n.fencedCodeBlocks===!0?"~~~+|```+":n.fencedCodeBlocks)+")[ \\t]*([\\w+#-]*)"),O={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\\]]|\\.)*\])*?(?=\])/},N={startState:function(){return{f:l,prevLine:null,thisLine:null,block:l,htmlState:null,indentation:0,inline:p,text:f,formatting:!1,linkText:!1,linkHref:!1,linkTitle:!1,code:0,em:!1,strong:!1,header:0,hr:!1,taskList:!1,list:!1,listStack:[],quote:0,trailingSpace:0,trailingSpaceNewLine:!1,strikethrough:!1,fencedChars:null}},copyState:function(t){return{f:t.f,prevLine:t.prevLine,thisLine:t.thisLine,block:t.block,htmlState:t.htmlState&&e.copyState(w,t.htmlState),indentation:t.indentation,localMode:t.localMode,localState:t.localMode?e.copyState(t.localMode,t.localState):null,inline:t.inline,text:t.text,formatting:!1,linkTitle:t.linkTitle,code:t.code,em:t.em,strong:t.strong,strikethrough:t.strikethrough,header:t.header,hr:t.hr,taskList:t.taskList,list:t.list,listStack:t.listStack.slice(0),quote:t.quote,indentedCode:t.indentedCode,trailingSpace:t.trailingSpace,trailingSpaceNewLine:t.trailingSpaceNewLine,md_inside:t.md_inside,fencedChars:t.fencedChars}},token:function(e,t){if(t.formatting=!1,e!=t.thisLine){var n=t.header||t.hr;if(t.header=0,t.hr=!1,e.match(/^\s*$/,!0)||n){if(a(t),!n)return null;t.prevLine=null}t.prevLine=t.thisLine,t.thisLine=e,t.taskList=!1,t.trailingSpace=0,t.trailingSpaceNewLine=!1,t.f=t.block;var i=e.match(/^\s*/,!0)[0].replace(/\t/g,"    ").length;if(t.indentationDiff=Math.min(i-t.indentation,4),t.indentation=t.indentation+t.indentationDiff,i>0)return null}return t.f(e,t)},innerMode:function(e){return e.block==c?{state:e.htmlState,mode:w}:e.localState?{state:e.localState,mode:e.localMode}:{state:e,mode:N}},blankLine:a,getType:h,fold:"markdown"};return N},"xml"),e.defineMIME("text/x-markdown","markdown")})},{"../../lib/codemirror":10,"../meta":13,"../xml/xml":14}],13:[function(t,n,i){!function(r){"object"==typeof i&&"object"==typeof n?r(t("../lib/codemirror")):"function"==typeof e&&e.amd?e(["../lib/codemirror"],r):r(CodeMirror)}(function(e){"use strict";e.modeInfo=[{name:"APL",mime:"text/apl",mode:"apl",ext:["dyalog","apl"]},{name:"PGP",mimes:["application/pgp","application/pgp-keys","application/pgp-signature"],mode:"asciiarmor",ext:["pgp"]},{name:"ASN.1",mime:"text/x-ttcn-asn",mode:"asn.1",ext:["asn","asn1"]},{name:"Asterisk",mime:"text/x-asterisk",mode:"asterisk",file:/^extensions\.conf$/i},{name:"Brainfuck",mime:"text/x-brainfuck",mode:"brainfuck",ext:["b","bf"]},{name:"C",mime:"text/x-csrc",mode:"clike",ext:["c","h"]},{name:"C++",mime:"text/x-c++src",mode:"clike",ext:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],alias:["cpp"]},{name:"Cobol",mime:"text/x-cobol",mode:"cobol",ext:["cob","cpy"]},{name:"C#",mime:"text/x-csharp",mode:"clike",ext:["cs"],alias:["csharp"]},{name:"Clojure",mime:"text/x-clojure",mode:"clojure",ext:["clj","cljc","cljx"]},{name:"ClojureScript",mime:"text/x-clojurescript",mode:"clojure",ext:["cljs"]},{name:"Closure Stylesheets (GSS)",mime:"text/x-gss",mode:"css",ext:["gss"]},{name:"CMake",mime:"text/x-cmake",mode:"cmake",ext:["cmake","cmake.in"],file:/^CMakeLists.txt$/},{name:"CoffeeScript",mime:"text/x-coffeescript",mode:"coffeescript",ext:["coffee"],alias:["coffee","coffee-script"]},{name:"Common Lisp",mime:"text/x-common-lisp",mode:"commonlisp",ext:["cl","lisp","el"],alias:["lisp"]},{name:"Cypher",mime:"application/x-cypher-query",mode:"cypher",ext:["cyp","cypher"]},{name:"Cython",mime:"text/x-cython",mode:"python",ext:["pyx","pxd","pxi"]},{name:"Crystal",mime:"text/x-crystal",mode:"crystal",ext:["cr"]},{name:"CSS",mime:"text/css",mode:"css",ext:["css"]},{name:"CQL",mime:"text/x-cassandra",mode:"sql",ext:["cql"]},{name:"D",mime:"text/x-d",mode:"d",ext:["d"]},{name:"Dart",mimes:["application/dart","text/x-dart"],mode:"dart",ext:["dart"]},{name:"diff",mime:"text/x-diff",mode:"diff",ext:["diff","patch"]},{name:"Django",mime:"text/x-django",mode:"django"},{name:"Dockerfile",mime:"text/x-dockerfile",mode:"dockerfile",file:/^Dockerfile$/},{name:"DTD",mime:"application/xml-dtd",mode:"dtd",ext:["dtd"]},{name:"Dylan",mime:"text/x-dylan",mode:"dylan",ext:["dylan","dyl","intr"]},{name:"EBNF",mime:"text/x-ebnf",mode:"ebnf"},{name:"ECL",mime:"text/x-ecl",mode:"ecl",ext:["ecl"]},{name:"edn",mime:"application/edn",mode:"clojure",ext:["edn"]},{name:"Eiffel",mime:"text/x-eiffel",mode:"eiffel",ext:["e"]},{name:"Elm",mime:"text/x-elm",mode:"elm",ext:["elm"]},{name:"Embedded Javascript",mime:"application/x-ejs",mode:"htmlembedded",ext:["ejs"]},{name:"Embedded Ruby",mime:"application/x-erb",mode:"htmlembedded",ext:["erb"]},{name:"Erlang",mime:"text/x-erlang",mode:"erlang",ext:["erl"]},{name:"Factor",mime:"text/x-factor",mode:"factor",ext:["factor"]},{name:"FCL",mime:"text/x-fcl",mode:"fcl"},{name:"Forth",mime:"text/x-forth",mode:"forth",ext:["forth","fth","4th"]},{name:"Fortran",mime:"text/x-fortran",mode:"fortran",ext:["f","for","f77","f90"]},{name:"F#",mime:"text/x-fsharp",mode:"mllike",ext:["fs"],alias:["fsharp"]},{name:"Gas",mime:"text/x-gas",mode:"gas",ext:["s"]},{name:"Gherkin",mime:"text/x-feature",mode:"gherkin",ext:["feature"]},{name:"GitHub Flavored Markdown",mime:"text/x-gfm",mode:"gfm",file:/^(readme|contributing|history).md$/i},{name:"Go",mime:"text/x-go",mode:"go",ext:["go"]},{name:"Groovy",mime:"text/x-groovy",mode:"groovy",ext:["groovy","gradle"]},{name:"HAML",mime:"text/x-haml",mode:"haml",ext:["haml"]},{name:"Haskell",mime:"text/x-haskell",mode:"haskell",ext:["hs"]},{name:"Haskell (Literate)",mime:"text/x-literate-haskell",mode:"haskell-literate",ext:["lhs"]},{name:"Haxe",mime:"text/x-haxe",mode:"haxe",ext:["hx"]},{name:"HXML",mime:"text/x-hxml",mode:"haxe",ext:["hxml"]},{name:"ASP.NET",mime:"application/x-aspx",mode:"htmlembedded",ext:["aspx"],alias:["asp","aspx"]},{name:"HTML",mime:"text/html",mode:"htmlmixed",ext:["html","htm"],alias:["xhtml"]},{name:"HTTP",mime:"message/http",mode:"http"},{name:"IDL",mime:"text/x-idl",mode:"idl",ext:["pro"]},{name:"Jade",mime:"text/x-jade",mode:"jade",ext:["jade"]},{name:"Java",mime:"text/x-java",mode:"clike",ext:["java"]},{name:"Java Server Pages",mime:"application/x-jsp",mode:"htmlembedded",ext:["jsp"],alias:["jsp"]},{name:"JavaScript",mimes:["text/javascript","text/ecmascript","application/javascript","application/x-javascript","application/ecmascript"],mode:"javascript",ext:["js"],alias:["ecmascript","js","node"]},{name:"JSON",mimes:["application/json","application/x-json"],mode:"javascript",ext:["json","map"],alias:["json5"]},{name:"JSON-LD",mime:"application/ld+json",mode:"javascript",ext:["jsonld"],alias:["jsonld"]},{name:"JSX",mime:"text/jsx",mode:"jsx",ext:["jsx"]},{name:"Jinja2",mime:"null",mode:"jinja2"},{name:"Julia",mime:"text/x-julia",mode:"julia",ext:["jl"]},{name:"Kotlin",mime:"text/x-kotlin",mode:"clike",ext:["kt"]},{name:"LESS",mime:"text/x-less",mode:"css",ext:["less"]},{name:"LiveScript",mime:"text/x-livescript",mode:"livescript",ext:["ls"],alias:["ls"]},{name:"Lua",mime:"text/x-lua",mode:"lua",ext:["lua"]},{name:"Markdown",mime:"text/x-markdown",mode:"markdown",ext:["markdown","md","mkd"]},{name:"mIRC",mime:"text/mirc",mode:"mirc"},{name:"MariaDB SQL",mime:"text/x-mariadb",mode:"sql"},{name:"Mathematica",mime:"text/x-mathematica",mode:"mathematica",ext:["m","nb"]},{name:"Modelica",mime:"text/x-modelica",mode:"modelica",ext:["mo"]},{name:"MUMPS",mime:"text/x-mumps",mode:"mumps",ext:["mps"]},{name:"MS SQL",mime:"text/x-mssql",mode:"sql"},{name:"mbox",mime:"application/mbox",mode:"mbox",ext:["mbox"]},{name:"MySQL",mime:"text/x-mysql",mode:"sql"},{name:"Nginx",mime:"text/x-nginx-conf",mode:"nginx",file:/nginx.*\.conf$/i},{name:"NSIS",mime:"text/x-nsis",mode:"nsis",ext:["nsh","nsi"]},{name:"NTriples",mime:"text/n-triples",mode:"ntriples",ext:["nt"]},{name:"Objective C",mime:"text/x-objectivec",mode:"clike",ext:["m","mm"],alias:["objective-c","objc"]},{name:"OCaml",mime:"text/x-ocaml",mode:"mllike",ext:["ml","mli","mll","mly"]},{name:"Octave",mime:"text/x-octave",mode:"octave",ext:["m"]},{name:"Oz",mime:"text/x-oz",mode:"oz",ext:["oz"]},{name:"Pascal",mime:"text/x-pascal",mode:"pascal",ext:["p","pas"]},{name:"PEG.js",mime:"null",mode:"pegjs",ext:["jsonld"]},{name:"Perl",mime:"text/x-perl",mode:"perl",ext:["pl","pm"]},{name:"PHP",mime:"application/x-httpd-php",mode:"php",ext:["php","php3","php4","php5","phtml"]},{name:"Pig",mime:"text/x-pig",mode:"pig",ext:["pig"]},{name:"Plain Text",mime:"text/plain",mode:"null",ext:["txt","text","conf","def","list","log"]},{name:"PLSQL",mime:"text/x-plsql",mode:"sql",ext:["pls"]},{name:"PowerShell",mime:"application/x-powershell",mode:"powershell",ext:["ps1","psd1","psm1"]},{name:"Properties files",mime:"text/x-properties",mode:"properties",ext:["properties","ini","in"],alias:["ini","properties"]},{name:"ProtoBuf",mime:"text/x-protobuf",mode:"protobuf",ext:["proto"]},{name:"Python",mime:"text/x-python",mode:"python",ext:["BUILD","bzl","py","pyw"],file:/^(BUCK|BUILD)$/},{name:"Puppet",mime:"text/x-puppet",mode:"puppet",ext:["pp"]},{name:"Q",mime:"text/x-q",mode:"q",ext:["q"]},{name:"R",mime:"text/x-rsrc",mode:"r",ext:["r"],alias:["rscript"]},{name:"reStructuredText",mime:"text/x-rst",mode:"rst",ext:["rst"],alias:["rst"]},{name:"RPM Changes",mime:"text/x-rpm-changes",mode:"rpm"},{name:"RPM Spec",mime:"text/x-rpm-spec",mode:"rpm",ext:["spec"]},{name:"Ruby",mime:"text/x-ruby",mode:"ruby",ext:["rb"],alias:["jruby","macruby","rake","rb","rbx"]},{name:"Rust",mime:"text/x-rustsrc",mode:"rust",ext:["rs"]},{name:"SAS",mime:"text/x-sas",mode:"sas",ext:["sas"]},{name:"Sass",mime:"text/x-sass",mode:"sass",ext:["sass"]},{name:"Scala",mime:"text/x-scala",mode:"clike",ext:["scala"]},{name:"Scheme",mime:"text/x-scheme",mode:"scheme",ext:["scm","ss"]},{name:"SCSS",mime:"text/x-scss",mode:"css",ext:["scss"]},{name:"Shell",mime:"text/x-sh",mode:"shell",ext:["sh","ksh","bash"],alias:["bash","sh","zsh"],file:/^PKGBUILD$/},{name:"Sieve",mime:"application/sieve",mode:"sieve",ext:["siv","sieve"]},{name:"Slim",mimes:["text/x-slim","application/x-slim"],mode:"slim",ext:["slim"]},{name:"Smalltalk",mime:"text/x-stsrc",mode:"smalltalk",ext:["st"]},{name:"Smarty",mime:"text/x-smarty",mode:"smarty",ext:["tpl"]},{name:"Solr",mime:"text/x-solr",mode:"solr"},{name:"Soy",mime:"text/x-soy",mode:"soy",ext:["soy"],alias:["closure template"]},{name:"SPARQL",mime:"application/sparql-query",mode:"sparql",ext:["rq","sparql"],alias:["sparul"]},{name:"Spreadsheet",mime:"text/x-spreadsheet",mode:"spreadsheet",alias:["excel","formula"]},{name:"SQL",mime:"text/x-sql",mode:"sql",ext:["sql"]},{name:"Squirrel",mime:"text/x-squirrel",mode:"clike",ext:["nut"]},{name:"Swift",mime:"text/x-swift",mode:"swift",ext:["swift"]},{name:"sTeX",mime:"text/x-stex",mode:"stex"},{name:"LaTeX",mime:"text/x-latex",mode:"stex",ext:["text","ltx"],alias:["tex"]},{name:"SystemVerilog",mime:"text/x-systemverilog",mode:"verilog",ext:["v"]},{name:"Tcl",mime:"text/x-tcl",mode:"tcl",ext:["tcl"]},{name:"Textile",mime:"text/x-textile",mode:"textile",ext:["textile"]},{name:"TiddlyWiki ",mime:"text/x-tiddlywiki",mode:"tiddlywiki"},{name:"Tiki wiki",mime:"text/tiki",mode:"tiki"},{name:"TOML",mime:"text/x-toml",mode:"toml",ext:["toml"]},{name:"Tornado",mime:"text/x-tornado",mode:"tornado"},{name:"troff",mime:"text/troff",mode:"troff",ext:["1","2","3","4","5","6","7","8","9"]},{name:"TTCN",mime:"text/x-ttcn",mode:"ttcn",ext:["ttcn","ttcn3","ttcnpp"]},{name:"TTCN_CFG",mime:"text/x-ttcn-cfg",mode:"ttcn-cfg",ext:["cfg"]},{name:"Turtle",mime:"text/turtle",mode:"turtle",ext:["ttl"]},{name:"TypeScript",mime:"application/typescript",mode:"javascript",ext:["ts"],alias:["ts"]},{name:"Twig",mime:"text/x-twig",mode:"twig"},{name:"Web IDL",mime:"text/x-webidl",mode:"webidl",ext:["webidl"]},{name:"VB.NET",mime:"text/x-vb",mode:"vb",ext:["vb"]},{name:"VBScript",mime:"text/vbscript",mode:"vbscript",ext:["vbs"]},{name:"Velocity",mime:"text/velocity",mode:"velocity",ext:["vtl"]},{name:"Verilog",mime:"text/x-verilog",mode:"verilog",ext:["v"]},{name:"VHDL",mime:"text/x-vhdl",mode:"vhdl",ext:["vhd","vhdl"]},{name:"XML",mimes:["application/xml","text/xml"],mode:"xml",ext:["xml","xsl","xsd"],alias:["rss","wsdl","xsd"]},{name:"XQuery",mime:"application/xquery",mode:"xquery",ext:["xy","xquery"]},{name:"Yacas",mime:"text/x-yacas",mode:"yacas",ext:["ys"]},{name:"YAML",mime:"text/x-yaml",mode:"yaml",ext:["yaml","yml"],alias:["yml"]},{name:"Z80",mime:"text/x-z80",mode:"z80",ext:["z80"]},{name:"mscgen",mime:"text/x-mscgen",mode:"mscgen",ext:["mscgen","mscin","msc"]},{name:"xu",mime:"text/x-xu",mode:"mscgen",ext:["xu"]},{name:"msgenny",mime:"text/x-msgenny",mode:"mscgen",ext:["msgenny"]}];for(var t=0;t<e.modeInfo.length;t++){var n=e.modeInfo[t];n.mimes&&(n.mime=n.mimes[0])}e.findModeByMIME=function(t){t=t.toLowerCase();for(var n=0;n<e.modeInfo.length;n++){var i=e.modeInfo[n];if(i.mime==t)return i;if(i.mimes)for(var r=0;r<i.mimes.length;r++)if(i.mimes[r]==t)return i}},e.findModeByExtension=function(t){for(var n=0;n<e.modeInfo.length;n++){var i=e.modeInfo[n];if(i.ext)for(var r=0;r<i.ext.length;r++)if(i.ext[r]==t)return i}},e.findModeByFileName=function(t){for(var n=0;n<e.modeInfo.length;n++){var i=e.modeInfo[n];if(i.file&&i.file.test(t))return i}var r=t.lastIndexOf("."),o=r>-1&&t.substring(r+1,t.length);return o?e.findModeByExtension(o):void 0},e.findModeByName=function(t){t=t.toLowerCase();for(var n=0;n<e.modeInfo.length;n++){var i=e.modeInfo[n];if(i.name.toLowerCase()==t)return i;if(i.alias)for(var r=0;r<i.alias.length;r++)if(i.alias[r].toLowerCase()==t)return i}}})},{"../lib/codemirror":10}],14:[function(t,n,i){!function(r){"object"==typeof i&&"object"==typeof n?r(t("../../lib/codemirror")):"function"==typeof e&&e.amd?e(["../../lib/codemirror"],r):r(CodeMirror)}(function(e){"use strict";var t={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,menuitem:!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,caseFold:!0},n={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,caseFold:!1};e.defineMode("xml",function(i,r){function o(e,t){function n(n){return t.tokenize=n,n(e,t)}var i=e.next();if("<"==i)return e.eat("!")?e.eat("[")?e.match("CDATA[")?n(l("atom","]]>")):null:e.match("--")?n(l("comment","-->")):e.match("DOCTYPE",!0,!0)?(e.eatWhile(/[\w\._\-]/),n(c(1))):null:e.eat("?")?(e.eatWhile(/[\w\._\-]/),t.tokenize=l("meta","?>"),"meta"):(T=e.eat("/")?"closeTag":"openTag",t.tokenize=s,"tag bracket");if("&"==i){var r;return r=e.eat("#")?e.eat("x")?e.eatWhile(/[a-fA-F\d]/)&&e.eat(";"):e.eatWhile(/[\d]/)&&e.eat(";"):e.eatWhile(/[\w\.\-:]/)&&e.eat(";"),
  r?"atom":"error"}return e.eatWhile(/[^&<]/),null}function s(e,t){var n=e.next();if(">"==n||"/"==n&&e.eat(">"))return t.tokenize=o,T=">"==n?"endTag":"selfcloseTag","tag bracket";if("="==n)return T="equals",null;if("<"==n){t.tokenize=o,t.state=f,t.tagName=t.tagStart=null;var i=t.tokenize(e,t);return i?i+" tag error":"tag error"}return/[\'\"]/.test(n)?(t.tokenize=a(n),t.stringStartCol=e.column(),t.tokenize(e,t)):(e.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function a(e){var t=function(t,n){for(;!t.eol();)if(t.next()==e){n.tokenize=s;break}return"string"};return t.isInAttribute=!0,t}function l(e,t){return function(n,i){for(;!n.eol();){if(n.match(t)){i.tokenize=o;break}n.next()}return e}}function c(e){return function(t,n){for(var i;null!=(i=t.next());){if("<"==i)return n.tokenize=c(e+1),n.tokenize(t,n);if(">"==i){if(1==e){n.tokenize=o;break}return n.tokenize=c(e-1),n.tokenize(t,n)}}return"meta"}}function u(e,t,n){this.prev=e.context,this.tagName=t,this.indent=e.indented,this.startOfLine=n,(k.doNotIndent.hasOwnProperty(t)||e.context&&e.context.noIndent)&&(this.noIndent=!0)}function d(e){e.context&&(e.context=e.context.prev)}function h(e,t){for(var n;;){if(!e.context)return;if(n=e.context.tagName,!k.contextGrabbers.hasOwnProperty(n)||!k.contextGrabbers[n].hasOwnProperty(t))return;d(e)}}function f(e,t,n){return"openTag"==e?(n.tagStart=t.column(),p):"closeTag"==e?m:f}function p(e,t,n){return"word"==e?(n.tagName=t.current(),D="tag",y):(D="error",p)}function m(e,t,n){if("word"==e){var i=t.current();return n.context&&n.context.tagName!=i&&k.implicitlyClosed.hasOwnProperty(n.context.tagName)&&d(n),n.context&&n.context.tagName==i||k.matchClosing===!1?(D="tag",g):(D="tag error",v)}return D="error",v}function g(e,t,n){return"endTag"!=e?(D="error",g):(d(n),f)}function v(e,t,n){return D="error",g(e,t,n)}function y(e,t,n){if("word"==e)return D="attribute",b;if("endTag"==e||"selfcloseTag"==e){var i=n.tagName,r=n.tagStart;return n.tagName=n.tagStart=null,"selfcloseTag"==e||k.autoSelfClosers.hasOwnProperty(i)?h(n,i):(h(n,i),n.context=new u(n,i,r==n.indented)),f}return D="error",y}function b(e,t,n){return"equals"==e?x:(k.allowMissing||(D="error"),y(e,t,n))}function x(e,t,n){return"string"==e?w:"word"==e&&k.allowUnquoted?(D="string",y):(D="error",y(e,t,n))}function w(e,t,n){return"string"==e?w:y(e,t,n)}var C=i.indentUnit,k={},_=r.htmlMode?t:n;for(var S in _)k[S]=_[S];for(var S in r)k[S]=r[S];var T,D;return o.isInText=!0,{startState:function(e){var t={tokenize:o,state:f,indented:e||0,tagName:null,tagStart:null,context:null};return null!=e&&(t.baseIndent=e),t},token:function(e,t){if(!t.tagName&&e.sol()&&(t.indented=e.indentation()),e.eatSpace())return null;T=null;var n=t.tokenize(e,t);return(n||T)&&"comment"!=n&&(D=null,t.state=t.state(T||n,e,t),D&&(n="error"==D?n+" error":D)),n},indent:function(t,n,i){var r=t.context;if(t.tokenize.isInAttribute)return t.tagStart==t.indented?t.stringStartCol+1:t.indented+C;if(r&&r.noIndent)return e.Pass;if(t.tokenize!=s&&t.tokenize!=o)return i?i.match(/^(\s*)/)[0].length:0;if(t.tagName)return k.multilineTagIndentPastTag!==!1?t.tagStart+t.tagName.length+2:t.tagStart+C*(k.multilineTagIndentFactor||1);if(k.alignCDATA&&/<!\[CDATA\[/.test(n))return 0;var a=n&&/^<(\/)?([\w_:\.-]*)/.exec(n);if(a&&a[1])for(;r;){if(r.tagName==a[2]){r=r.prev;break}if(!k.implicitlyClosed.hasOwnProperty(r.tagName))break;r=r.prev}else if(a)for(;r;){var l=k.contextGrabbers[r.tagName];if(!l||!l.hasOwnProperty(a[2]))break;r=r.prev}for(;r&&r.prev&&!r.startOfLine;)r=r.prev;return r?r.indent+C:t.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:k.htmlMode?"html":"xml",helperType:k.htmlMode?"html":"xml",skipAttribute:function(e){e.state==x&&(e.state=y)}}}),e.defineMIME("text/xml","xml"),e.defineMIME("application/xml","xml"),e.mimeModes.hasOwnProperty("text/html")||e.defineMIME("text/html",{name:"xml",htmlMode:!0})})},{"../../lib/codemirror":10}],15:[function(e,t,n){n.read=function(e,t,n,i,r){var o,s,a=8*r-i-1,l=(1<<a)-1,c=l>>1,u=-7,d=n?r-1:0,h=n?-1:1,f=e[t+d];for(d+=h,o=f&(1<<-u)-1,f>>=-u,u+=a;u>0;o=256*o+e[t+d],d+=h,u-=8);for(s=o&(1<<-u)-1,o>>=-u,u+=i;u>0;s=256*s+e[t+d],d+=h,u-=8);if(0===o)o=1-c;else{if(o===l)return s?NaN:(f?-1:1)*(1/0);s+=Math.pow(2,i),o-=c}return(f?-1:1)*s*Math.pow(2,o-i)},n.write=function(e,t,n,i,r,o){var s,a,l,c=8*o-r-1,u=(1<<c)-1,d=u>>1,h=23===r?Math.pow(2,-24)-Math.pow(2,-77):0,f=i?0:o-1,p=i?1:-1,m=0>t||0===t&&0>1/t?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=u):(s=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-s))<1&&(s--,l*=2),t+=s+d>=1?h/l:h*Math.pow(2,1-d),t*l>=2&&(s++,l/=2),s+d>=u?(a=0,s=u):s+d>=1?(a=(t*l-1)*Math.pow(2,r),s+=d):(a=t*Math.pow(2,d-1)*Math.pow(2,r),s=0));r>=8;e[n+f]=255&a,f+=p,a/=256,r-=8);for(s=s<<r|a,c+=r;c>0;e[n+f]=255&s,f+=p,s/=256,c-=8);e[n+f-p]|=128*m}},{}],16:[function(e,t,n){var i={}.toString;t.exports=Array.isArray||function(e){return"[object Array]"==i.call(e)}},{}],17:[function(t,n,i){(function(t){(function(){function t(e){this.tokens=[],this.tokens.links={},this.options=e||h.defaults,this.rules=f.normal,this.options.gfm&&(this.options.tables?this.rules=f.tables:this.rules=f.gfm)}function r(e,t){if(this.options=t||h.defaults,this.links=e,this.rules=p.normal,this.renderer=this.options.renderer||new o,this.renderer.options=this.options,!this.links)throw new Error("Tokens array requires a `links` property.");this.options.gfm?this.options.breaks?this.rules=p.breaks:this.rules=p.gfm:this.options.pedantic&&(this.rules=p.pedantic)}function o(e){this.options=e||{}}function s(e){this.tokens=[],this.token=null,this.options=e||h.defaults,this.options.renderer=this.options.renderer||new o,this.renderer=this.options.renderer,this.renderer.options=this.options}function a(e,t){return e.replace(t?/&/g:/&(?!#?\w+;)/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function l(e){return e.replace(/&([#\w]+);/g,function(e,t){return t=t.toLowerCase(),"colon"===t?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""})}function c(e,t){return e=e.source,t=t||"",function n(i,r){return i?(r=r.source||r,r=r.replace(/(^|[^\[])\^/g,"$1"),e=e.replace(i,r),n):new RegExp(e,t)}}function u(){}function d(e){for(var t,n,i=1;i<arguments.length;i++){t=arguments[i];for(n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e}function h(e,n,i){if(i||"function"==typeof n){i||(i=n,n=null),n=d({},h.defaults,n||{});var r,o,l=n.highlight,c=0;try{r=t.lex(e,n)}catch(u){return i(u)}o=r.length;var f=function(e){if(e)return n.highlight=l,i(e);var t;try{t=s.parse(r,n)}catch(o){e=o}return n.highlight=l,e?i(e):i(null,t)};if(!l||l.length<3)return f();if(delete n.highlight,!o)return f();for(;c<r.length;c++)!function(e){return"code"!==e.type?--o||f():l(e.text,e.lang,function(t,n){return t?f(t):null==n||n===e.text?--o||f():(e.text=n,e.escaped=!0,void(--o||f()))})}(r[c])}else try{return n&&(n=d({},h.defaults,n)),s.parse(t.lex(e,n),n)}catch(u){if(u.message+="\nPlease report this to https://github.com/chjj/marked.",(n||h.defaults).silent)return"<p>An error occured:</p><pre>"+a(u.message+"",!0)+"</pre>";throw u}}var f={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:u,hr:/^( *[-*_]){3,} *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/,nptable:u,lheading:/^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/,blockquote:/^( *>[^\n]+(\n(?!def)[^\n]+)*\n*)+/,list:/^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:/^ *(?:comment *(?:\n|\s*$)|closed *(?:\n{2,}|\s*$)|closing *(?:\n{2,}|\s*$))/,def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +["(]([^\n]+)[")])? *(?:\n+|$)/,table:u,paragraph:/^((?:[^\n]+\n?(?!hr|heading|lheading|blockquote|tag|def))+)\n*/,text:/^[^\n]+/};f.bullet=/(?:[*+-]|\d+\.)/,f.item=/^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/,f.item=c(f.item,"gm")(/bull/g,f.bullet)(),f.list=c(f.list)(/bull/g,f.bullet)("hr","\\n+(?=\\1?(?:[-*_] *){3,}(?:\\n+|$))")("def","\\n+(?="+f.def.source+")")(),f.blockquote=c(f.blockquote)("def",f.def)(),f._tag="(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:/|[^\\w\\s@]*@)\\b",f.html=c(f.html)("comment",/<!--[\s\S]*?-->/)("closed",/<(tag)[\s\S]+?<\/\1>/)("closing",/<tag(?:"[^"]*"|'[^']*'|[^'">])*?>/)(/tag/g,f._tag)(),f.paragraph=c(f.paragraph)("hr",f.hr)("heading",f.heading)("lheading",f.lheading)("blockquote",f.blockquote)("tag","<"+f._tag)("def",f.def)(),f.normal=d({},f),f.gfm=d({},f.normal,{fences:/^ *(`{3,}|~{3,})[ \.]*(\S+)? *\n([\s\S]*?)\s*\1 *(?:\n+|$)/,paragraph:/^/,heading:/^ *(#{1,6}) +([^\n]+?) *#* *(?:\n+|$)/}),f.gfm.paragraph=c(f.paragraph)("(?!","(?!"+f.gfm.fences.source.replace("\\1","\\2")+"|"+f.list.source.replace("\\1","\\3")+"|")(),f.tables=d({},f.gfm,{nptable:/^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/,table:/^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/}),t.rules=f,t.lex=function(e,n){var i=new t(n);return i.lex(e)},t.prototype.lex=function(e){return e=e.replace(/\r\n|\r/g,"\n").replace(/\t/g,"    ").replace(/\u00a0/g," ").replace(/\u2424/g,"\n"),this.token(e,!0)},t.prototype.token=function(e,t,n){for(var i,r,o,s,a,l,c,u,d,e=e.replace(/^ +$/gm,"");e;)if((o=this.rules.newline.exec(e))&&(e=e.substring(o[0].length),o[0].length>1&&this.tokens.push({type:"space"})),o=this.rules.code.exec(e))e=e.substring(o[0].length),o=o[0].replace(/^ {4}/gm,""),this.tokens.push({type:"code",text:this.options.pedantic?o:o.replace(/\n+$/,"")});else if(o=this.rules.fences.exec(e))e=e.substring(o[0].length),this.tokens.push({type:"code",lang:o[2],text:o[3]||""});else if(o=this.rules.heading.exec(e))e=e.substring(o[0].length),this.tokens.push({type:"heading",depth:o[1].length,text:o[2]});else if(t&&(o=this.rules.nptable.exec(e))){for(e=e.substring(o[0].length),l={type:"table",header:o[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:o[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:o[3].replace(/\n$/,"").split("\n")},u=0;u<l.align.length;u++)/^ *-+: *$/.test(l.align[u])?l.align[u]="right":/^ *:-+: *$/.test(l.align[u])?l.align[u]="center":/^ *:-+ *$/.test(l.align[u])?l.align[u]="left":l.align[u]=null;for(u=0;u<l.cells.length;u++)l.cells[u]=l.cells[u].split(/ *\| */);this.tokens.push(l)}else if(o=this.rules.lheading.exec(e))e=e.substring(o[0].length),this.tokens.push({type:"heading",depth:"="===o[2]?1:2,text:o[1]});else if(o=this.rules.hr.exec(e))e=e.substring(o[0].length),this.tokens.push({type:"hr"});else if(o=this.rules.blockquote.exec(e))e=e.substring(o[0].length),this.tokens.push({type:"blockquote_start"}),o=o[0].replace(/^ *> ?/gm,""),this.token(o,t,!0),this.tokens.push({type:"blockquote_end"});else if(o=this.rules.list.exec(e)){for(e=e.substring(o[0].length),s=o[2],this.tokens.push({type:"list_start",ordered:s.length>1}),o=o[0].match(this.rules.item),i=!1,d=o.length,u=0;d>u;u++)l=o[u],c=l.length,l=l.replace(/^ *([*+-]|\d+\.) +/,""),~l.indexOf("\n ")&&(c-=l.length,l=this.options.pedantic?l.replace(/^ {1,4}/gm,""):l.replace(new RegExp("^ {1,"+c+"}","gm"),"")),this.options.smartLists&&u!==d-1&&(a=f.bullet.exec(o[u+1])[0],s===a||s.length>1&&a.length>1||(e=o.slice(u+1).join("\n")+e,u=d-1)),r=i||/\n\n(?!\s*$)/.test(l),u!==d-1&&(i="\n"===l.charAt(l.length-1),r||(r=i)),this.tokens.push({type:r?"loose_item_start":"list_item_start"}),this.token(l,!1,n),this.tokens.push({type:"list_item_end"});this.tokens.push({type:"list_end"})}else if(o=this.rules.html.exec(e))e=e.substring(o[0].length),this.tokens.push({type:this.options.sanitize?"paragraph":"html",pre:!this.options.sanitizer&&("pre"===o[1]||"script"===o[1]||"style"===o[1]),text:o[0]});else if(!n&&t&&(o=this.rules.def.exec(e)))e=e.substring(o[0].length),this.tokens.links[o[1].toLowerCase()]={href:o[2],title:o[3]};else if(t&&(o=this.rules.table.exec(e))){for(e=e.substring(o[0].length),l={type:"table",header:o[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:o[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:o[3].replace(/(?: *\| *)?\n$/,"").split("\n")},u=0;u<l.align.length;u++)/^ *-+: *$/.test(l.align[u])?l.align[u]="right":/^ *:-+: *$/.test(l.align[u])?l.align[u]="center":/^ *:-+ *$/.test(l.align[u])?l.align[u]="left":l.align[u]=null;for(u=0;u<l.cells.length;u++)l.cells[u]=l.cells[u].replace(/^ *\| *| *\| *$/g,"").split(/ *\| */);this.tokens.push(l)}else if(t&&(o=this.rules.paragraph.exec(e)))e=e.substring(o[0].length),this.tokens.push({type:"paragraph",text:"\n"===o[1].charAt(o[1].length-1)?o[1].slice(0,-1):o[1]});else if(o=this.rules.text.exec(e))e=e.substring(o[0].length),this.tokens.push({type:"text",text:o[0]});else if(e)throw new Error("Infinite loop on byte: "+e.charCodeAt(0));return this.tokens};var p={escape:/^\\([\\`*{}\[\]()#+\-.!_>])/,autolink:/^<([^ >]+(@|:\/)[^ >]+)>/,url:u,tag:/^<!--[\s\S]*?-->|^<\/?\w+(?:"[^"]*"|'[^']*'|[^'">])*?>/,link:/^!?\[(inside)\]\(href\)/,reflink:/^!?\[(inside)\]\s*\[([^\]]*)\]/,nolink:/^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]/,strong:/^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/,em:/^\b_((?:[^_]|__)+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/,code:/^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/,br:/^ {2,}\n(?!\s*$)/,del:u,text:/^[\s\S]+?(?=[\\<!\[_*`]| {2,}\n|$)/};p._inside=/(?:\[[^\]]*\]|[^\[\]]|\](?=[^\[]*\]))*/,p._href=/\s*<?([\s\S]*?)>?(?:\s+['"]([\s\S]*?)['"])?\s*/,p.link=c(p.link)("inside",p._inside)("href",p._href)(),p.reflink=c(p.reflink)("inside",p._inside)(),p.normal=d({},p),p.pedantic=d({},p.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/}),p.gfm=d({},p.normal,{escape:c(p.escape)("])","~|])")(),url:/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,del:/^~~(?=\S)([\s\S]*?\S)~~/,text:c(p.text)("]|","~]|")("|","|https?://|")()}),p.breaks=d({},p.gfm,{br:c(p.br)("{2,}","*")(),text:c(p.gfm.text)("{2,}","*")()}),r.rules=p,r.output=function(e,t,n){var i=new r(t,n);return i.output(e)},r.prototype.output=function(e){for(var t,n,i,r,o="";e;)if(r=this.rules.escape.exec(e))e=e.substring(r[0].length),o+=r[1];else if(r=this.rules.autolink.exec(e))e=e.substring(r[0].length),"@"===r[2]?(n=":"===r[1].charAt(6)?this.mangle(r[1].substring(7)):this.mangle(r[1]),i=this.mangle("mailto:")+n):(n=a(r[1]),i=n),o+=this.renderer.link(i,null,n);else if(this.inLink||!(r=this.rules.url.exec(e))){if(r=this.rules.tag.exec(e))!this.inLink&&/^<a /i.test(r[0])?this.inLink=!0:this.inLink&&/^<\/a>/i.test(r[0])&&(this.inLink=!1),e=e.substring(r[0].length),o+=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(r[0]):a(r[0]):r[0];else if(r=this.rules.link.exec(e))e=e.substring(r[0].length),this.inLink=!0,o+=this.outputLink(r,{href:r[2],title:r[3]}),this.inLink=!1;else if((r=this.rules.reflink.exec(e))||(r=this.rules.nolink.exec(e))){if(e=e.substring(r[0].length),t=(r[2]||r[1]).replace(/\s+/g," "),t=this.links[t.toLowerCase()],!t||!t.href){o+=r[0].charAt(0),e=r[0].substring(1)+e;continue}this.inLink=!0,o+=this.outputLink(r,t),this.inLink=!1}else if(r=this.rules.strong.exec(e))e=e.substring(r[0].length),o+=this.renderer.strong(this.output(r[2]||r[1]));else if(r=this.rules.em.exec(e))e=e.substring(r[0].length),o+=this.renderer.em(this.output(r[2]||r[1]));else if(r=this.rules.code.exec(e))e=e.substring(r[0].length),o+=this.renderer.codespan(a(r[2],!0));else if(r=this.rules.br.exec(e))e=e.substring(r[0].length),o+=this.renderer.br();else if(r=this.rules.del.exec(e))e=e.substring(r[0].length),o+=this.renderer.del(this.output(r[1]));else if(r=this.rules.text.exec(e))e=e.substring(r[0].length),o+=this.renderer.text(a(this.smartypants(r[0])));else if(e)throw new Error("Infinite loop on byte: "+e.charCodeAt(0))}else e=e.substring(r[0].length),n=a(r[1]),i=n,o+=this.renderer.link(i,null,n);return o},r.prototype.outputLink=function(e,t){var n=a(t.href),i=t.title?a(t.title):null;return"!"!==e[0].charAt(0)?this.renderer.link(n,i,this.output(e[1])):this.renderer.image(n,i,a(e[1]))},r.prototype.smartypants=function(e){return this.options.smartypants?e.replace(/---/g,"—").replace(/--/g,"–").replace(/(^|[-\u2014\/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014\/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…"):e},r.prototype.mangle=function(e){if(!this.options.mangle)return e;for(var t,n="",i=e.length,r=0;i>r;r++)t=e.charCodeAt(r),Math.random()>.5&&(t="x"+t.toString(16)),n+="&#"+t+";";return n},o.prototype.code=function(e,t,n){if(this.options.highlight){var i=this.options.highlight(e,t);null!=i&&i!==e&&(n=!0,e=i)}return t?'<pre><code class="'+this.options.langPrefix+a(t,!0)+'">'+(n?e:a(e,!0))+"\n</code></pre>\n":"<pre><code>"+(n?e:a(e,!0))+"\n</code></pre>"},o.prototype.blockquote=function(e){return"<blockquote>\n"+e+"</blockquote>\n"},o.prototype.html=function(e){return e},o.prototype.heading=function(e,t,n){return"<h"+t+' id="'+this.options.headerPrefix+n.toLowerCase().replace(/[^\w]+/g,"-")+'">'+e+"</h"+t+">\n"},o.prototype.hr=function(){return this.options.xhtml?"<hr/>\n":"<hr>\n"},o.prototype.list=function(e,t){var n=t?"ol":"ul";return"<"+n+">\n"+e+"</"+n+">\n"},o.prototype.listitem=function(e){return"<li>"+e+"</li>\n"},o.prototype.paragraph=function(e){return"<p>"+e+"</p>\n"},o.prototype.table=function(e,t){return"<table>\n<thead>\n"+e+"</thead>\n<tbody>\n"+t+"</tbody>\n</table>\n"},o.prototype.tablerow=function(e){return"<tr>\n"+e+"</tr>\n"},o.prototype.tablecell=function(e,t){var n=t.header?"th":"td",i=t.align?"<"+n+' style="text-align:'+t.align+'">':"<"+n+">";return i+e+"</"+n+">\n"},o.prototype.strong=function(e){return"<strong>"+e+"</strong>"},o.prototype.em=function(e){return"<em>"+e+"</em>"},o.prototype.codespan=function(e){return"<code>"+e+"</code>"},o.prototype.br=function(){return this.options.xhtml?"<br/>":"<br>"},o.prototype.del=function(e){return"<del>"+e+"</del>"},o.prototype.link=function(e,t,n){if(this.options.sanitize){try{var i=decodeURIComponent(l(e)).replace(/[^\w:]/g,"").toLowerCase()}catch(r){return""}if(0===i.indexOf("javascript:")||0===i.indexOf("vbscript:"))return""}var o='<a href="'+e+'"';return t&&(o+=' title="'+t+'"'),o+=">"+n+"</a>"},o.prototype.image=function(e,t,n){var i='<img src="'+e+'" alt="'+n+'"';return t&&(i+=' title="'+t+'"'),i+=this.options.xhtml?"/>":">"},o.prototype.text=function(e){return e},s.parse=function(e,t,n){var i=new s(t,n);return i.parse(e)},s.prototype.parse=function(e){this.inline=new r(e.links,this.options,this.renderer),this.tokens=e.reverse();for(var t="";this.next();)t+=this.tok();return t},s.prototype.next=function(){return this.token=this.tokens.pop()},s.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0},s.prototype.parseText=function(){for(var e=this.token.text;"text"===this.peek().type;)e+="\n"+this.next().text;return this.inline.output(e)},s.prototype.tok=function(){switch(this.token.type){case"space":return"";case"hr":return this.renderer.hr();case"heading":return this.renderer.heading(this.inline.output(this.token.text),this.token.depth,this.token.text);case"code":return this.renderer.code(this.token.text,this.token.lang,this.token.escaped);case"table":var e,t,n,i,r,o="",s="";for(n="",e=0;e<this.token.header.length;e++)i={header:!0,align:this.token.align[e]},n+=this.renderer.tablecell(this.inline.output(this.token.header[e]),{header:!0,align:this.token.align[e]});for(o+=this.renderer.tablerow(n),e=0;e<this.token.cells.length;e++){for(t=this.token.cells[e],n="",r=0;r<t.length;r++)n+=this.renderer.tablecell(this.inline.output(t[r]),{header:!1,align:this.token.align[r]});s+=this.renderer.tablerow(n)}return this.renderer.table(o,s);case"blockquote_start":for(var s="";"blockquote_end"!==this.next().type;)s+=this.tok();return this.renderer.blockquote(s);case"list_start":for(var s="",a=this.token.ordered;"list_end"!==this.next().type;)s+=this.tok();return this.renderer.list(s,a);case"list_item_start":for(var s="";"list_item_end"!==this.next().type;)s+="text"===this.token.type?this.parseText():this.tok();return this.renderer.listitem(s);case"loose_item_start":for(var s="";"list_item_end"!==this.next().type;)s+=this.tok();return this.renderer.listitem(s);case"html":var l=this.token.pre||this.options.pedantic?this.token.text:this.inline.output(this.token.text);return this.renderer.html(l);case"paragraph":return this.renderer.paragraph(this.inline.output(this.token.text));case"text":return this.renderer.paragraph(this.parseText())}},u.exec=u,h.options=h.setOptions=function(e){return d(h.defaults,e),h},h.defaults={gfm:!0,tables:!0,breaks:!1,pedantic:!1,sanitize:!1,sanitizer:null,mangle:!0,smartLists:!1,silent:!1,highlight:null,langPrefix:"lang-",smartypants:!1,headerPrefix:"",renderer:new o,xhtml:!1},h.Parser=s,h.parser=s.parse,h.Renderer=o,h.Lexer=t,h.lexer=t.lex,h.InlineLexer=r,h.inlineLexer=r.output,h.parse=h,"undefined"!=typeof n&&"object"==typeof i?n.exports=h:"function"==typeof e&&e.amd?e(function(){return h}):this.marked=h}).call(function(){return this||("undefined"!=typeof window?window:t)}())}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],18:[function(e,t,n){(function(n,i){"use strict";var r=function(e,t,n,r){if(r=r||{},this.dictionary=null,this.rules={},this.dictionaryTable={},this.compoundRules=[],this.compoundRuleCodes={},this.replacementTable=[],this.flags=r.flags||{},e){if(this.dictionary=e,"undefined"!=typeof window&&"chrome"in window&&"extension"in window.chrome&&"getURL"in window.chrome.extension)t||(t=this._readFile(chrome.extension.getURL("lib/typo/dictionaries/"+e+"/"+e+".aff"))),n||(n=this._readFile(chrome.extension.getURL("lib/typo/dictionaries/"+e+"/"+e+".dic")));else{if(r.dictionaryPath)var o=r.dictionaryPath;else if("undefined"!=typeof i)var o=i+"/dictionaries";else var o="./dictionaries";t||(t=this._readFile(o+"/"+e+"/"+e+".aff")),n||(n=this._readFile(o+"/"+e+"/"+e+".dic"))}this.rules=this._parseAFF(t),this.compoundRuleCodes={};for(var s=0,a=this.compoundRules.length;a>s;s++)for(var l=this.compoundRules[s],c=0,u=l.length;u>c;c++)this.compoundRuleCodes[l[c]]=[];"ONLYINCOMPOUND"in this.flags&&(this.compoundRuleCodes[this.flags.ONLYINCOMPOUND]=[]),this.dictionaryTable=this._parseDIC(n);for(var s in this.compoundRuleCodes)0==this.compoundRuleCodes[s].length&&delete this.compoundRuleCodes[s];for(var s=0,a=this.compoundRules.length;a>s;s++){for(var d=this.compoundRules[s],h="",c=0,u=d.length;u>c;c++){var f=d[c];h+=f in this.compoundRuleCodes?"("+this.compoundRuleCodes[f].join("|")+")":f}this.compoundRules[s]=new RegExp(h,"i")}}return this};r.prototype={load:function(e){for(var t in e)this[t]=e[t];return this},_readFile:function(t,i){if(i||(i="utf8"),"undefined"!=typeof XMLHttpRequest){var r=new XMLHttpRequest;return r.open("GET",t,!1),r.overrideMimeType&&r.overrideMimeType("text/plain; charset="+i),r.send(null),r.responseText}if("undefined"!=typeof e){var o=e("fs");try{if(o.existsSync(t)){var s=o.statSync(t),a=o.openSync(t,"r"),l=new n(s.size);return o.readSync(a,l,0,l.length,null),l.toString(i,0,l.length)}}catch(c){return""}}},_parseAFF:function(e){var t={};e=this._removeAffixComments(e);for(var n=e.split("\n"),i=0,r=n.length;r>i;i++){var o=n[i],s=o.split(/\s+/),a=s[0];if("PFX"==a||"SFX"==a){for(var l=s[1],c=s[2],u=parseInt(s[3],10),d=[],h=i+1,f=i+1+u;f>h;h++){var o=n[h],p=o.split(/\s+/),m=p[2],g=p[3].split("/"),v=g[0];"0"===v&&(v="");var y=this.parseRuleCodes(g[1]),b=p[4],x={};x.add=v,y.length>0&&(x.continuationClasses=y),"."!==b&&("SFX"===a?x.match=new RegExp(b+"$"):x.match=new RegExp("^"+b)),"0"!=m&&("SFX"===a?x.remove=new RegExp(m+"$"):x.remove=m),d.push(x)}t[l]={type:a,combineable:"Y"==c,entries:d},i+=u}else if("COMPOUNDRULE"===a){for(var u=parseInt(s[1],10),h=i+1,f=i+1+u;f>h;h++){var o=n[h],p=o.split(/\s+/);this.compoundRules.push(p[1])}i+=u}else if("REP"===a){var p=o.split(/\s+/);3===p.length&&this.replacementTable.push([p[1],p[2]])}else this.flags[a]=s[1]}return t},_removeAffixComments:function(e){return e=e.replace(/#.*$/gm,""),e=e.replace(/^\s\s*/m,"").replace(/\s\s*$/m,""),e=e.replace(/\n{2,}/g,"\n"),e=e.replace(/^\s\s*/,"").replace(/\s\s*$/,"")},_parseDIC:function(e){function t(e,t){e in i&&"object"==typeof i[e]||(i[e]=[]),i[e].push(t)}e=this._removeDicComments(e);for(var n=e.split("\n"),i={},r=1,o=n.length;o>r;r++){var s=n[r],a=s.split("/",2),l=a[0];if(a.length>1){var c=this.parseRuleCodes(a[1]);"NEEDAFFIX"in this.flags&&-1!=c.indexOf(this.flags.NEEDAFFIX)||t(l,c);for(var u=0,d=c.length;d>u;u++){var h=c[u],f=this.rules[h];if(f)for(var p=this._applyRule(l,f),m=0,g=p.length;g>m;m++){var v=p[m];if(t(v,[]),f.combineable)for(var y=u+1;d>y;y++){var b=c[y],x=this.rules[b];if(x&&x.combineable&&f.type!=x.type)for(var w=this._applyRule(v,x),C=0,k=w.length;k>C;C++){var _=w[C];t(_,[])}}}h in this.compoundRuleCodes&&this.compoundRuleCodes[h].push(l)}}else t(l.trim(),[])}return i},_removeDicComments:function(e){return e=e.replace(/^\t.*$/gm,"")},parseRuleCodes:function(e){if(!e)return[];if(!("FLAG"in this.flags))return e.split("");if("long"===this.flags.FLAG){for(var t=[],n=0,i=e.length;i>n;n+=2)t.push(e.substr(n,2));return t}return"num"===this.flags.FLAG?textCode.split(","):void 0},_applyRule:function(e,t){for(var n=t.entries,i=[],r=0,o=n.length;o>r;r++){var s=n[r];if(!s.match||e.match(s.match)){var a=e;if(s.remove&&(a=a.replace(s.remove,"")),"SFX"===t.type?a+=s.add:a=s.add+a,i.push(a),"continuationClasses"in s)for(var l=0,c=s.continuationClasses.length;c>l;l++){var u=this.rules[s.continuationClasses[l]];u&&(i=i.concat(this._applyRule(a,u)))}}}return i},check:function(e){var t=e.replace(/^\s\s*/,"").replace(/\s\s*$/,"");if(this.checkExact(t))return!0;if(t.toUpperCase()===t){var n=t[0]+t.substring(1).toLowerCase();if(this.hasFlag(n,"KEEPCASE"))return!1;if(this.checkExact(n))return!0}var i=t.toLowerCase();if(i!==t){if(this.hasFlag(i,"KEEPCASE"))return!1;if(this.checkExact(i))return!0}return!1},checkExact:function(e){var t=this.dictionaryTable[e];if("undefined"==typeof t){if("COMPOUNDMIN"in this.flags&&e.length>=this.flags.COMPOUNDMIN)for(var n=0,i=this.compoundRules.length;i>n;n++)if(e.match(this.compoundRules[n]))return!0;return!1}if("object"==typeof t){for(var n=0,i=t.length;i>n;n++)if(!this.hasFlag(e,"ONLYINCOMPOUND",t[n]))return!0;return!1}},hasFlag:function(e,t,n){if(t in this.flags){if("undefined"==typeof n)var n=Array.prototype.concat.apply([],this.dictionaryTable[e]);if(n&&-1!==n.indexOf(this.flags[t]))return!0}return!1},alphabet:"",suggest:function(e,t){function n(e){for(var t=[],n=0,i=e.length;i>n;n++){for(var r=e[n],o=[],s=0,a=r.length+1;a>s;s++)o.push([r.substring(0,s),r.substring(s,r.length)]);for(var l=[],s=0,a=o.length;a>s;s++){var u=o[s];u[1]&&l.push(u[0]+u[1].substring(1))}for(var d=[],s=0,a=o.length;a>s;s++){var u=o[s];u[1].length>1&&d.push(u[0]+u[1][1]+u[1][0]+u[1].substring(2))}for(var h=[],s=0,a=o.length;a>s;s++){var u=o[s];if(u[1])for(var f=0,p=c.alphabet.length;p>f;f++)h.push(u[0]+c.alphabet[f]+u[1].substring(1))}for(var m=[],s=0,a=o.length;a>s;s++){var u=o[s];if(u[1])for(var f=0,p=c.alphabet.length;p>f;f++)h.push(u[0]+c.alphabet[f]+u[1])}t=t.concat(l),t=t.concat(d),t=t.concat(h),t=t.concat(m)}return t}function i(e){for(var t=[],n=0;n<e.length;n++)c.check(e[n])&&t.push(e[n]);return t}function r(e){function r(e,t){return e[1]<t[1]?-1:1}for(var o=n([e]),s=n(o),a=i(o).concat(i(s)),l={},u=0,d=a.length;d>u;u++)a[u]in l?l[a[u]]+=1:l[a[u]]=1;var h=[];for(var u in l)h.push([u,l[u]]);h.sort(r).reverse();for(var f=[],u=0,d=Math.min(t,h.length);d>u;u++)c.hasFlag(h[u][0],"NOSUGGEST")||f.push(h[u][0]);return f}if(t||(t=5),this.check(e))return[];for(var o=0,s=this.replacementTable.length;s>o;o++){var a=this.replacementTable[o];if(-1!==e.indexOf(a[0])){var l=e.replace(a[0],a[1]);if(this.check(l))return[l]}}var c=this;return c.alphabet="abcdefghijklmnopqrstuvwxyz",r(e)}},"undefined"!=typeof t&&(t.exports=r)}).call(this,e("buffer").Buffer,"/node_modules/typo-js")},{buffer:3,fs:2}],19:[function(e,t,n){var i=e("codemirror");i.commands.tabAndIndentMarkdownList=function(e){var t=e.listSelections(),n=t[0].head,i=e.getStateAfter(n.line),r=i.list!==!1;if(r)return void e.execCommand("indentMore");if(e.options.indentWithTabs)e.execCommand("insertTab");else{var o=Array(e.options.tabSize+1).join(" ");e.replaceSelection(o)}},i.commands.shiftTabAndUnindentMarkdownList=function(e){var t=e.listSelections(),n=t[0].head,i=e.getStateAfter(n.line),r=i.list!==!1;if(r)return void e.execCommand("indentLess");if(e.options.indentWithTabs)e.execCommand("insertTab");else{var o=Array(e.options.tabSize+1).join(" ");e.replaceSelection(o)}}},{codemirror:10}],20:[function(e,t,n){"use strict";function i(e){return e=q?e.replace("Ctrl","Cmd"):e.replace("Cmd","Ctrl")}function r(e,t,n){e=e||{};var i=document.createElement("a");return t=void 0==t||t,e.title&&t&&(i.title=s(e.title,e.action,n),q&&(i.title=i.title.replace("Ctrl","⌘"),i.title=i.title.replace("Alt","⌥"))),i.tabIndex=-1,i.className=e.className,i}function o(){var e=document.createElement("i");return e.className="separator",e.innerHTML="|",e}function s(e,t,n){var r,o=e;return t&&(r=U(t),n[r]&&(o+=" ("+i(n[r])+")")),o}function a(e,t){t=t||e.getCursor("start");var n=e.getTokenAt(t);if(!n.type)return{};for(var i,r,o=n.type.split(" "),s={},a=0;a<o.length;a++)i=o[a],"strong"===i?s.bold=!0:"variable-2"===i?(r=e.getLine(t.line),/^\s*\d+\.\s/.test(r)?s["ordered-list"]=!0:s["unordered-list"]=!0):"atom"===i?s.quote=!0:"em"===i?s.italic=!0:"quote"===i?s.quote=!0:"strikethrough"===i?s.strikethrough=!0:"comment"===i?s.code=!0:"link"===i?s.link=!0:"tag"===i?s.image=!0:i.match(/^header(\-[1-6])?$/)&&(s[i.replace("header","heading")]=!0);return s}function l(e){var t=e.codemirror;t.setOption("fullScreen",!t.getOption("fullScreen")),t.getOption("fullScreen")?(G=document.body.style.overflow,document.body.style.overflow="hidden"):document.body.style.overflow=G;var n=t.getWrapperElement();/fullscreen/.test(n.previousSibling.className)?n.previousSibling.className=n.previousSibling.className.replace(/\s*fullscreen\b/,""):n.previousSibling.className+=" fullscreen";var i=e.toolbarElements.fullscreen;/active/.test(i.className)?i.className=i.className.replace(/\s*active\s*/g,""):i.className+=" active";var r=t.getWrapperElement().nextSibling;/editor-preview-active-side/.test(r.className)&&M(e)}function c(e){O(e,"bold",e.options.blockStyles.bold)}function u(e){O(e,"italic",e.options.blockStyles.italic)}function d(e){O(e,"strikethrough","~~")}function h(e){function t(e){if("object"!=typeof e)throw"fencing_line() takes a 'line' object (not a line number, or line text).  Got: "+typeof e+": "+e;return e.styles&&e.styles[2]&&-1!==e.styles[2].indexOf("formatting-code-block")}function n(e){return e.state.base.base||e.state.base}function i(e,i,r,o,s){r=r||e.getLineHandle(i),o=o||e.getTokenAt({line:i,ch:1}),s=s||!!r.text&&e.getTokenAt({line:i,ch:r.text.length-1});var a=o.type?o.type.split(" "):[];return s&&n(s).indentedCode?"indented":-1!==a.indexOf("comment")&&(n(o).fencedChars||n(s).fencedChars||t(r)?"fenced":"single")}function r(e,t,n,i){var r=t.line+1,o=n.line+1,s=t.line!==n.line,a=i+"\n",l="\n"+i;s&&o++,s&&0===n.ch&&(l=i+"\n",o--),L(e,!1,[a,l]),e.setSelection({line:r,ch:0},{line:o,ch:0})}var o,s,a,l=e.options.blockStyles.code,c=e.codemirror,u=c.getCursor("start"),d=c.getCursor("end"),h=c.getTokenAt({line:u.line,ch:u.ch||1}),f=c.getLineHandle(u.line),p=i(c,u.line,f,h);if("single"===p){var m=f.text.slice(0,u.ch).replace("`",""),g=f.text.slice(u.ch).replace("`","");c.replaceRange(m+g,{line:u.line,ch:0},{line:u.line,ch:99999999999999}),u.ch--,u!==d&&d.ch--,c.setSelection(u,d),c.focus()}else if("fenced"===p)if(u.line!==d.line||u.ch!==d.ch){for(o=u.line;o>=0&&(f=c.getLineHandle(o),!t(f));o--);var v,y,b,x,w=c.getTokenAt({line:o,ch:1}),C=n(w).fencedChars;t(c.getLineHandle(u.line))?(v="",y=u.line):t(c.getLineHandle(u.line-1))?(v="",y=u.line-1):(v=C+"\n",y=u.line),t(c.getLineHandle(d.line))?(b="",x=d.line,0===d.ch&&(x+=1)):0!==d.ch&&t(c.getLineHandle(d.line+1))?(b="",x=d.line+1):(b=C+"\n",x=d.line+1),0===d.ch&&(x-=1),c.operation(function(){
  c.replaceRange(b,{line:x,ch:0},{line:x+(b?0:1),ch:0}),c.replaceRange(v,{line:y,ch:0},{line:y+(v?0:1),ch:0})}),c.setSelection({line:y+(v?1:0),ch:0},{line:x+(v?1:-1),ch:0}),c.focus()}else{var k=u.line;if(t(c.getLineHandle(u.line))&&("fenced"===i(c,u.line+1)?(o=u.line,k=u.line+1):(s=u.line,k=u.line-1)),void 0===o)for(o=k;o>=0&&(f=c.getLineHandle(o),!t(f));o--);if(void 0===s)for(a=c.lineCount(),s=k;a>s&&(f=c.getLineHandle(s),!t(f));s++);c.operation(function(){c.replaceRange("",{line:o,ch:0},{line:o+1,ch:0}),c.replaceRange("",{line:s-1,ch:0},{line:s,ch:0})}),c.focus()}else if("indented"===p){if(u.line!==d.line||u.ch!==d.ch)o=u.line,s=d.line,0===d.ch&&s--;else{for(o=u.line;o>=0;o--)if(f=c.getLineHandle(o),!f.text.match(/^\s*$/)&&"indented"!==i(c,o,f)){o+=1;break}for(a=c.lineCount(),s=u.line;a>s;s++)if(f=c.getLineHandle(s),!f.text.match(/^\s*$/)&&"indented"!==i(c,s,f)){s-=1;break}}var _=c.getLineHandle(s+1),S=_&&c.getTokenAt({line:s+1,ch:_.text.length-1}),T=S&&n(S).indentedCode;T&&c.replaceRange("\n",{line:s+1,ch:0});for(var D=o;s>=D;D++)c.indentLine(D,"subtract");c.focus()}else{var M=u.line===d.line&&u.ch===d.ch&&0===u.ch,E=u.line!==d.line;M||E?r(c,u,d,l):L(c,!1,["`","`"])}}function f(e){var t=e.codemirror;$(t,"quote")}function p(e){var t=e.codemirror;A(t,"smaller")}function m(e){var t=e.codemirror;A(t,"bigger")}function g(e){var t=e.codemirror;A(t,void 0,1)}function v(e){var t=e.codemirror;A(t,void 0,2)}function y(e){var t=e.codemirror;A(t,void 0,3)}function b(e){var t=e.codemirror;$(t,"unordered-list")}function x(e){var t=e.codemirror;$(t,"ordered-list")}function w(e){var t=e.codemirror;N(t)}function C(e){var t=e.codemirror,n=a(t),i=e.options,r="http://";return!(i.promptURLs&&(r=prompt(i.promptTexts.link),!r))&&void L(t,n.link,i.insertTexts.link,r)}function k(e){var t=e.codemirror,n=a(t),i=e.options,r="http://";return!(i.promptURLs&&(r=prompt(i.promptTexts.image),!r))&&void L(t,n.image,i.insertTexts.image,r)}function _(e){var t=e.codemirror,n=a(t),i=e.options;L(t,n.table,i.insertTexts.table)}function S(e){var t=e.codemirror,n=a(t),i=e.options;L(t,n.image,i.insertTexts.horizontalRule)}function T(e){var t=e.codemirror;t.undo(),t.focus()}function D(e){var t=e.codemirror;t.redo(),t.focus()}function M(e){var t=e.codemirror,n=t.getWrapperElement(),i=n.nextSibling,r=e.toolbarElements["side-by-side"],o=!1;/editor-preview-active-side/.test(i.className)?(i.className=i.className.replace(/\s*editor-preview-active-side\s*/g,""),r.className=r.className.replace(/\s*active\s*/g,""),n.className=n.className.replace(/\s*CodeMirror-sided\s*/g," ")):(setTimeout(function(){t.getOption("fullScreen")||l(e),i.className+=" editor-preview-active-side"},1),r.className+=" active",n.className+=" CodeMirror-sided",o=!0);var s=n.lastChild;if(/editor-preview-active/.test(s.className)){s.className=s.className.replace(/\s*editor-preview-active\s*/g,"");var a=e.toolbarElements.preview,c=n.previousSibling;a.className=a.className.replace(/\s*active\s*/g,""),c.className=c.className.replace(/\s*disabled-for-preview*/g,"")}var u=function(){i.innerHTML=e.options.previewRender(e.value(),i)};t.sideBySideRenderingFunction||(t.sideBySideRenderingFunction=u),o?(i.innerHTML=e.options.previewRender(e.value(),i),t.on("update",t.sideBySideRenderingFunction)):t.off("update",t.sideBySideRenderingFunction),t.refresh()}function E(e){var t=e.codemirror,n=t.getWrapperElement(),i=n.previousSibling,r=!!e.options.toolbar&&e.toolbarElements.preview,o=n.lastChild;o&&/editor-preview/.test(o.className)||(o=document.createElement("div"),o.className="editor-preview",n.appendChild(o)),/editor-preview-active/.test(o.className)?(o.className=o.className.replace(/\s*editor-preview-active\s*/g,""),r&&(r.className=r.className.replace(/\s*active\s*/g,""),i.className=i.className.replace(/\s*disabled-for-preview*/g,""))):(setTimeout(function(){o.className+=" editor-preview-active"},1),r&&(r.className+=" active",i.className+=" disabled-for-preview")),o.innerHTML=e.options.previewRender(e.value(),o);var s=t.getWrapperElement().nextSibling;/editor-preview-active-side/.test(s.className)&&M(e)}function L(e,t,n,i){if(!/editor-preview-active/.test(e.getWrapperElement().lastChild.className)){var r,o=n[0],s=n[1],a=e.getCursor("start"),l=e.getCursor("end");i&&(s=s.replace("#url#",i)),t?(r=e.getLine(a.line),o=r.slice(0,a.ch),s=r.slice(a.ch),e.replaceRange(o+s,{line:a.line,ch:0})):(r=e.getSelection(),e.replaceSelection(o+r+s),a.ch+=o.length,a!==l&&(l.ch+=o.length)),e.setSelection(a,l),e.focus()}}function A(e,t,n){if(!/editor-preview-active/.test(e.getWrapperElement().lastChild.className)){for(var i=e.getCursor("start"),r=e.getCursor("end"),o=i.line;o<=r.line;o++)!function(i){var r=e.getLine(i),o=r.search(/[^#]/);r=void 0!==t?0>=o?"bigger"==t?"###### "+r:"# "+r:6==o&&"smaller"==t?r.substr(7):1==o&&"bigger"==t?r.substr(2):"bigger"==t?r.substr(1):"#"+r:1==n?0>=o?"# "+r:o==n?r.substr(o+1):"# "+r.substr(o+1):2==n?0>=o?"## "+r:o==n?r.substr(o+1):"## "+r.substr(o+1):0>=o?"### "+r:o==n?r.substr(o+1):"### "+r.substr(o+1),e.replaceRange(r,{line:i,ch:0},{line:i,ch:99999999999999})}(o);e.focus()}}function $(e,t){if(!/editor-preview-active/.test(e.getWrapperElement().lastChild.className)){for(var n=a(e),i=e.getCursor("start"),r=e.getCursor("end"),o={quote:/^(\s*)\>\s+/,"unordered-list":/^(\s*)(\*|\-|\+)\s+/,"ordered-list":/^(\s*)\d+\.\s+/},s={quote:"> ","unordered-list":"* ","ordered-list":"1. "},l=i.line;l<=r.line;l++)!function(i){var r=e.getLine(i);r=n[t]?r.replace(o[t],"$1"):s[t]+r,e.replaceRange(r,{line:i,ch:0},{line:i,ch:99999999999999})}(l);e.focus()}}function O(e,t,n,i){if(!/editor-preview-active/.test(e.codemirror.getWrapperElement().lastChild.className)){i="undefined"==typeof i?n:i;var r,o=e.codemirror,s=a(o),l=n,c=i,u=o.getCursor("start"),d=o.getCursor("end");s[t]?(r=o.getLine(u.line),l=r.slice(0,u.ch),c=r.slice(u.ch),"bold"==t?(l=l.replace(/(\*\*|__)(?![\s\S]*(\*\*|__))/,""),c=c.replace(/(\*\*|__)/,"")):"italic"==t?(l=l.replace(/(\*|_)(?![\s\S]*(\*|_))/,""),c=c.replace(/(\*|_)/,"")):"strikethrough"==t&&(l=l.replace(/(\*\*|~~)(?![\s\S]*(\*\*|~~))/,""),c=c.replace(/(\*\*|~~)/,"")),o.replaceRange(l+c,{line:u.line,ch:0},{line:u.line,ch:99999999999999}),"bold"==t||"strikethrough"==t?(u.ch-=2,u!==d&&(d.ch-=2)):"italic"==t&&(u.ch-=1,u!==d&&(d.ch-=1))):(r=o.getSelection(),"bold"==t?(r=r.split("**").join(""),r=r.split("__").join("")):"italic"==t?(r=r.split("*").join(""),r=r.split("_").join("")):"strikethrough"==t&&(r=r.split("~~").join("")),o.replaceSelection(l+r+c),u.ch+=n.length,d.ch=u.ch+r.length),o.setSelection(u,d),o.focus()}}function N(e){if(!/editor-preview-active/.test(e.getWrapperElement().lastChild.className))for(var t,n=e.getCursor("start"),i=e.getCursor("end"),r=n.line;r<=i.line;r++)t=e.getLine(r),t=t.replace(/^[ ]*([# ]+|\*|\-|[> ]+|[0-9]+(.|\)))[ ]*/,""),e.replaceRange(t,{line:r,ch:0},{line:r,ch:99999999999999})}function I(e,t){for(var n in t)t.hasOwnProperty(n)&&(t[n]instanceof Array?e[n]=t[n].concat(e[n]instanceof Array?e[n]:[]):null!==t[n]&&"object"==typeof t[n]&&t[n].constructor===Object?e[n]=I(e[n]||{},t[n]):e[n]=t[n]);return e}function R(e){for(var t=1;t<arguments.length;t++)e=I(e,arguments[t]);return e}function P(e){var t=/[a-zA-Z0-9_\u0392-\u03c9\u0410-\u04F9]+|[\u4E00-\u9FFF\u3400-\u4dbf\uf900-\ufaff\u3040-\u309f\uac00-\ud7af]+/g,n=e.match(t),i=0;if(null===n)return i;for(var r=0;r<n.length;r++)i+=n[r].charCodeAt(0)>=19968?n[r].length:1;return i}function H(e){e=e||{},e.parent=this;var t=!0;if(e.autoDownloadFontAwesome===!1&&(t=!1),e.autoDownloadFontAwesome!==!0)for(var n=document.styleSheets,i=0;i<n.length;i++)n[i].href&&n[i].href.indexOf("//maxcdn.bootstrapcdn.com/font-awesome/")>-1&&(t=!1);if(t){var r=document.createElement("link");r.rel="stylesheet",r.href="https://maxcdn.bootstrapcdn.com/font-awesome/latest/css/font-awesome.min.css",document.getElementsByTagName("head")[0].appendChild(r)}if(e.element)this.element=e.element;else if(null===e.element)return;if(void 0===e.toolbar){e.toolbar=[];for(var o in X)X.hasOwnProperty(o)&&(-1!=o.indexOf("separator-")&&e.toolbar.push("|"),(X[o]["default"]===!0||e.showIcons&&e.showIcons.constructor===Array&&-1!=e.showIcons.indexOf(o))&&e.toolbar.push(o))}e.hasOwnProperty("status")||(e.status=["autosave","lines","words","cursor"]),e.previewRender||(e.previewRender=function(e){return this.parent.markdown(e)}),e.parsingConfig=R({highlightFormatting:!0},e.parsingConfig||{}),e.insertTexts=R({},Z,e.insertTexts||{}),e.promptTexts=K,e.blockStyles=R({},Q,e.blockStyles||{}),e.shortcuts=R({},Y,e.shortcuts||{}),void 0!=e.autosave&&void 0!=e.autosave.unique_id&&""!=e.autosave.unique_id&&(e.autosave.uniqueId=e.autosave.unique_id),this.options=e,this.render(),!e.initialValue||this.options.autosave&&this.options.autosave.foundSavedValue===!0||this.value(e.initialValue)}function B(){if("object"!=typeof localStorage)return!1;try{localStorage.setItem("smde_localStorage",1),localStorage.removeItem("smde_localStorage")}catch(e){return!1}return!0}var j=e("codemirror");e("codemirror/addon/edit/continuelist.js"),e("./codemirror/tablist"),e("codemirror/addon/display/fullscreen.js"),e("codemirror/mode/markdown/markdown.js"),e("codemirror/addon/mode/overlay.js"),e("codemirror/addon/display/placeholder.js"),e("codemirror/addon/selection/mark-selection.js"),e("codemirror/mode/gfm/gfm.js"),e("codemirror/mode/xml/xml.js");var F=e("codemirror-spell-checker"),W=e("marked"),q=/Mac/.test(navigator.platform),z={toggleBold:c,toggleItalic:u,drawLink:C,toggleHeadingSmaller:p,toggleHeadingBigger:m,drawImage:k,toggleBlockquote:f,toggleOrderedList:x,toggleUnorderedList:b,toggleCodeBlock:h,togglePreview:E,toggleStrikethrough:d,toggleHeading1:g,toggleHeading2:v,toggleHeading3:y,cleanBlock:w,drawTable:_,drawHorizontalRule:S,undo:T,redo:D,toggleSideBySide:M,toggleFullScreen:l},Y={toggleBold:"Cmd-B",toggleItalic:"Cmd-I",drawLink:"Cmd-K",toggleHeadingSmaller:"Cmd-H",toggleHeadingBigger:"Shift-Cmd-H",cleanBlock:"Cmd-E",drawImage:"Cmd-Alt-I",toggleBlockquote:"Cmd-'",toggleOrderedList:"Cmd-Alt-L",toggleUnorderedList:"Cmd-L",toggleCodeBlock:"Cmd-Alt-C",togglePreview:"Cmd-P",toggleSideBySide:"F9",toggleFullScreen:"F11"},U=function(e){for(var t in z)if(z[t]===e)return t;return null},V=function(){var e=!1;return function(t){(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(t)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(t.substr(0,4)))&&(e=!0)}(navigator.userAgent||navigator.vendor||window.opera),e},G="",X={bold:{name:"bold",action:c,className:"fa fa-bold",title:"Bold","default":!0},italic:{name:"italic",action:u,className:"fa fa-italic",title:"Italic","default":!0},strikethrough:{name:"strikethrough",action:d,className:"fa fa-strikethrough",title:"Strikethrough"},heading:{name:"heading",action:p,className:"fa fa-header",title:"Heading","default":!0},"heading-smaller":{name:"heading-smaller",action:p,className:"fa fa-header fa-header-x fa-header-smaller",title:"Smaller Heading"},"heading-bigger":{name:"heading-bigger",action:m,className:"fa fa-header fa-header-x fa-header-bigger",title:"Bigger Heading"},"heading-1":{name:"heading-1",action:g,className:"fa fa-header fa-header-x fa-header-1",title:"Big Heading"},"heading-2":{name:"heading-2",action:v,className:"fa fa-header fa-header-x fa-header-2",title:"Medium Heading"},"heading-3":{name:"heading-3",action:y,className:"fa fa-header fa-header-x fa-header-3",title:"Small Heading"},"separator-1":{name:"separator-1"},code:{name:"code",action:h,className:"fa fa-code",title:"Code"},quote:{name:"quote",action:f,className:"fa fa-quote-left",title:"Quote","default":!0},"unordered-list":{name:"unordered-list",action:b,className:"fa fa-list-ul",title:"Generic List","default":!0},"ordered-list":{name:"ordered-list",action:x,className:"fa fa-list-ol",title:"Numbered List","default":!0},"clean-block":{name:"clean-block",action:w,className:"fa fa-eraser fa-clean-block",title:"Clean block"},"separator-2":{name:"separator-2"},link:{name:"link",action:C,className:"fa fa-link",title:"Create Link","default":!0},image:{name:"image",action:k,className:"fa fa-picture-o",title:"Insert Image","default":!0},table:{name:"table",action:_,className:"fa fa-table",title:"Insert Table"},"horizontal-rule":{name:"horizontal-rule",action:S,className:"fa fa-minus",title:"Insert Horizontal Line"},"separator-3":{name:"separator-3"},preview:{name:"preview",action:E,className:"fa fa-eye no-disable",title:"Toggle Preview","default":!0},"side-by-side":{name:"side-by-side",action:M,className:"fa fa-columns no-disable no-mobile",title:"Toggle Side by Side","default":!0},fullscreen:{name:"fullscreen",action:l,className:"fa fa-arrows-alt no-disable no-mobile",title:"Toggle Fullscreen","default":!0},"separator-4":{name:"separator-4"},guide:{name:"guide",action:"https://simplemde.com/markdown-guide",className:"fa fa-question-circle",title:"Markdown Guide","default":!0},"separator-5":{name:"separator-5"},undo:{name:"undo",action:T,className:"fa fa-undo no-disable",title:"Undo"},redo:{name:"redo",action:D,className:"fa fa-repeat no-disable",title:"Redo"}},Z={link:["[","](#url#)"],image:["![](","#url#)"],table:["","\n\n| Column 1 | Column 2 | Column 3 |\n| -------- | -------- | -------- |\n| Text     | Text     | Text     |\n\n"],horizontalRule:["","\n\n-----\n\n"]},K={link:"URL for the link:",image:"URL of the image:"},Q={bold:"**",code:"```",italic:"*"};H.prototype.markdown=function(e){if(W){var t={};return this.options&&this.options.renderingConfig&&this.options.renderingConfig.singleLineBreaks===!1?t.breaks=!1:t.breaks=!0,this.options&&this.options.renderingConfig&&this.options.renderingConfig.codeSyntaxHighlighting===!0&&window.hljs&&(t.highlight=function(e){return window.hljs.highlightAuto(e).value}),W.setOptions(t),W(e)}},H.prototype.render=function(e){if(e||(e=this.element||document.getElementsByTagName("textarea")[0]),!this._rendered||this._rendered!==e){this.element=e;var t=this.options,n=this,r={};for(var o in t.shortcuts)null!==t.shortcuts[o]&&null!==z[o]&&!function(e){r[i(t.shortcuts[e])]=function(){z[e](n)}}(o);r.Enter="newlineAndIndentContinueMarkdownList",r.Tab="tabAndIndentMarkdownList",r["Shift-Tab"]="shiftTabAndUnindentMarkdownList",r.Esc=function(e){e.getOption("fullScreen")&&l(n)},document.addEventListener("keydown",function(e){e=e||window.event,27==e.keyCode&&n.codemirror.getOption("fullScreen")&&l(n)},!1);var s,a;if(t.spellChecker!==!1?(s="spell-checker",a=t.parsingConfig,a.name="gfm",a.gitHubSpice=!1,F({codeMirrorInstance:j})):(s=t.parsingConfig,s.name="gfm",s.gitHubSpice=!1),this.codemirror=j.fromTextArea(e,{mode:s,backdrop:a,theme:"paper",tabSize:void 0!=t.tabSize?t.tabSize:2,indentUnit:void 0!=t.tabSize?t.tabSize:2,indentWithTabs:t.indentWithTabs!==!1,lineNumbers:!1,autofocus:t.autofocus===!0,extraKeys:r,lineWrapping:t.lineWrapping!==!1,allowDropFileTypes:["text/plain"],placeholder:t.placeholder||e.getAttribute("placeholder")||"",styleSelectedText:void 0==t.styleSelectedText||t.styleSelectedText}),t.forceSync===!0){var c=this.codemirror;c.on("change",function(){c.save()})}this.gui={},t.toolbar!==!1&&(this.gui.toolbar=this.createToolbar()),t.status!==!1&&(this.gui.statusbar=this.createStatusbar()),void 0!=t.autosave&&t.autosave.enabled===!0&&this.autosave(),this.gui.sideBySide=this.createSideBySide(),this._rendered=this.element;var u=this.codemirror;setTimeout(function(){u.refresh()}.bind(u),0)}},H.prototype.autosave=function(){if(B()){var e=this;if(void 0==this.options.autosave.uniqueId||""==this.options.autosave.uniqueId)return;null!=e.element.form&&void 0!=e.element.form&&e.element.form.addEventListener("submit",function(){localStorage.removeItem("smde_"+e.options.autosave.uniqueId)}),this.options.autosave.loaded!==!0&&("string"==typeof localStorage.getItem("smde_"+this.options.autosave.uniqueId)&&""!=localStorage.getItem("smde_"+this.options.autosave.uniqueId)&&(this.codemirror.setValue(localStorage.getItem("smde_"+this.options.autosave.uniqueId)),this.options.autosave.foundSavedValue=!0),this.options.autosave.loaded=!0),localStorage.setItem("smde_"+this.options.autosave.uniqueId,e.value());var t=document.getElementById("autosaved");if(null!=t&&void 0!=t&&""!=t){var n=new Date,i=n.getHours(),r=n.getMinutes(),o="am",s=i;s>=12&&(s=i-12,o="pm"),0==s&&(s=12),r=10>r?"0"+r:r,t.innerHTML="Autosaved: "+s+":"+r+" "+o}this.autosaveTimeoutId=setTimeout(function(){e.autosave()},this.options.autosave.delay||1e4)}},H.prototype.clearAutosavedValue=function(){if(B()){if(void 0==this.options.autosave||void 0==this.options.autosave.uniqueId||""==this.options.autosave.uniqueId)return;localStorage.removeItem("smde_"+this.options.autosave.uniqueId)}},H.prototype.createSideBySide=function(){var e=this.codemirror,t=e.getWrapperElement(),n=t.nextSibling;n&&/editor-preview-side/.test(n.className)||(n=document.createElement("div"),n.className="editor-preview-side",t.parentNode.insertBefore(n,t.nextSibling));var i=!1,r=!1;return e.on("scroll",function(e){if(i)return void(i=!1);r=!0;var t=e.getScrollInfo().height-e.getScrollInfo().clientHeight,o=parseFloat(e.getScrollInfo().top)/t,s=(n.scrollHeight-n.clientHeight)*o;n.scrollTop=s}),n.onscroll=function(){if(r)return void(r=!1);i=!0;var t=n.scrollHeight-n.clientHeight,o=parseFloat(n.scrollTop)/t,s=(e.getScrollInfo().height-e.getScrollInfo().clientHeight)*o;e.scrollTo(0,s)},n},H.prototype.createToolbar=function(e){if(e=e||this.options.toolbar,e&&0!==e.length){var t;for(t=0;t<e.length;t++)void 0!=X[e[t]]&&(e[t]=X[e[t]]);var n=document.createElement("div");n.className="editor-toolbar";var i=this,s={};for(i.toolbar=e,t=0;t<e.length;t++)if(("guide"!=e[t].name||i.options.toolbarGuideIcon!==!1)&&!(i.options.hideIcons&&-1!=i.options.hideIcons.indexOf(e[t].name)||("fullscreen"==e[t].name||"side-by-side"==e[t].name)&&V())){if("|"===e[t]){for(var l=!1,c=t+1;c<e.length;c++)"|"===e[c]||i.options.hideIcons&&-1!=i.options.hideIcons.indexOf(e[c].name)||(l=!0);if(!l)continue}!function(e){var t;t="|"===e?o():r(e,i.options.toolbarTips,i.options.shortcuts),e.action&&("function"==typeof e.action?t.onclick=function(t){t.preventDefault(),e.action(i)}:"string"==typeof e.action&&(t.href=e.action,t.target="_blank")),s[e.name||e]=t,n.appendChild(t)}(e[t])}i.toolbarElements=s;var u=this.codemirror;u.on("cursorActivity",function(){var e=a(u);for(var t in s)!function(t){var n=s[t];e[t]?n.className+=" active":"fullscreen"!=t&&"side-by-side"!=t&&(n.className=n.className.replace(/\s*active\s*/g,""))}(t)});var d=u.getWrapperElement();return d.parentNode.insertBefore(n,d),n}},H.prototype.createStatusbar=function(e){e=e||this.options.status;var t=this.options,n=this.codemirror;if(e&&0!==e.length){var i,r,o,s=[];for(i=0;i<e.length;i++)if(r=void 0,o=void 0,"object"==typeof e[i])s.push({className:e[i].className,defaultValue:e[i].defaultValue,onUpdate:e[i].onUpdate});else{var a=e[i];"words"===a?(o=function(e){e.innerHTML=P(n.getValue())},r=function(e){e.innerHTML=P(n.getValue())}):"lines"===a?(o=function(e){e.innerHTML=n.lineCount()},r=function(e){e.innerHTML=n.lineCount()}):"cursor"===a?(o=function(e){e.innerHTML="0:0"},r=function(e){var t=n.getCursor();e.innerHTML=t.line+":"+t.ch}):"autosave"===a&&(o=function(e){void 0!=t.autosave&&t.autosave.enabled===!0&&e.setAttribute("id","autosaved")}),s.push({className:a,defaultValue:o,onUpdate:r})}var l=document.createElement("div");for(l.className="editor-statusbar",i=0;i<s.length;i++){var c=s[i],u=document.createElement("span");u.className=c.className,"function"==typeof c.defaultValue&&c.defaultValue(u),"function"==typeof c.onUpdate&&this.codemirror.on("update",function(e,t){return function(){t.onUpdate(e)}}(u,c)),l.appendChild(u)}var d=this.codemirror.getWrapperElement();return d.parentNode.insertBefore(l,d.nextSibling),l}},H.prototype.value=function(e){return void 0===e?this.codemirror.getValue():(this.codemirror.getDoc().setValue(e),this)},H.toggleBold=c,H.toggleItalic=u,H.toggleStrikethrough=d,H.toggleBlockquote=f,H.toggleHeadingSmaller=p,H.toggleHeadingBigger=m,H.toggleHeading1=g,H.toggleHeading2=v,H.toggleHeading3=y,H.toggleCodeBlock=h,H.toggleUnorderedList=b,H.toggleOrderedList=x,H.cleanBlock=w,H.drawLink=C,H.drawImage=k,H.drawTable=_,H.drawHorizontalRule=S,H.undo=T,H.redo=D,H.togglePreview=E,H.toggleSideBySide=M,H.toggleFullScreen=l,H.prototype.toggleBold=function(){c(this)},H.prototype.toggleItalic=function(){u(this)},H.prototype.toggleStrikethrough=function(){d(this)},H.prototype.toggleBlockquote=function(){f(this)},H.prototype.toggleHeadingSmaller=function(){p(this)},H.prototype.toggleHeadingBigger=function(){m(this)},H.prototype.toggleHeading1=function(){g(this)},H.prototype.toggleHeading2=function(){v(this)},H.prototype.toggleHeading3=function(){y(this)},H.prototype.toggleCodeBlock=function(){h(this)},H.prototype.toggleUnorderedList=function(){b(this)},H.prototype.toggleOrderedList=function(){x(this)},H.prototype.cleanBlock=function(){w(this)},H.prototype.drawLink=function(){C(this)},H.prototype.drawImage=function(){k(this)},H.prototype.drawTable=function(){_(this)},H.prototype.drawHorizontalRule=function(){S(this)},H.prototype.undo=function(){T(this)},H.prototype.redo=function(){D(this)},H.prototype.togglePreview=function(){E(this)},H.prototype.toggleSideBySide=function(){M(this)},H.prototype.toggleFullScreen=function(){l(this)},H.prototype.isPreviewActive=function(){var e=this.codemirror,t=e.getWrapperElement(),n=t.lastChild;return/editor-preview-active/.test(n.className)},H.prototype.isSideBySideActive=function(){var e=this.codemirror,t=e.getWrapperElement(),n=t.nextSibling;return/editor-preview-active-side/.test(n.className)},H.prototype.isFullscreenActive=function(){var e=this.codemirror;return e.getOption("fullScreen")},H.prototype.getState=function(){var e=this.codemirror;return a(e)},H.prototype.toTextArea=function(){var e=this.codemirror,t=e.getWrapperElement();t.parentNode&&(this.gui.toolbar&&t.parentNode.removeChild(this.gui.toolbar),this.gui.statusbar&&t.parentNode.removeChild(this.gui.statusbar),this.gui.sideBySide&&t.parentNode.removeChild(this.gui.sideBySide)),e.toTextArea(),this.autosaveTimeoutId&&(clearTimeout(this.autosaveTimeoutId),this.autosaveTimeoutId=void 0,this.clearAutosavedValue())},t.exports=H},{"./codemirror/tablist":19,codemirror:10,"codemirror-spell-checker":4,"codemirror/addon/display/fullscreen.js":5,"codemirror/addon/display/placeholder.js":6,"codemirror/addon/edit/continuelist.js":7,"codemirror/addon/mode/overlay.js":8,"codemirror/addon/selection/mark-selection.js":9,"codemirror/mode/gfm/gfm.js":11,"codemirror/mode/markdown/markdown.js":12,"codemirror/mode/xml/xml.js":14,marked:17}]},{},[20])(20)}),!function(e,t){if("function"==typeof define&&define.amd)define(["exports","module"],t);else if("undefined"!=typeof exports&&"undefined"!=typeof module)t(exports,module);else{var n={exports:{}};t(n.exports,n),e.autosize=n.exports}}(this,function(e,t){"use strict";function n(e){function t(){var t=window.getComputedStyle(e,null);f=t.overflowY,"vertical"===t.resize?e.style.resize="none":"both"===t.resize&&(e.style.resize="horizontal"),h="content-box"===t.boxSizing?-(parseFloat(t.paddingTop)+parseFloat(t.paddingBottom)):parseFloat(t.borderTopWidth)+parseFloat(t.borderBottomWidth),isNaN(h)&&(h=0),r()}function n(t){var n=e.style.width;e.style.width="0px",e.offsetWidth,e.style.width=n,f=t,d&&(e.style.overflowY=t),i()}function i(){var t=window.pageYOffset,n=document.body.scrollTop,i=e.style.height;e.style.height="auto";var r=e.scrollHeight+h;return 0===e.scrollHeight?void(e.style.height=i):(e.style.height=r+"px",p=e.clientWidth,document.documentElement.scrollTop=t,void(document.body.scrollTop=n))}function r(){var t=e.style.height;i();var r=window.getComputedStyle(e,null);if(r.height!==e.style.height?"visible"!==f&&n("visible"):"hidden"!==f&&n("hidden"),t!==e.style.height){var o=s("autosize:resized");e.dispatchEvent(o)}}var a=void 0===arguments[1]?{}:arguments[1],l=a.setOverflowX,c=void 0===l||l,u=a.setOverflowY,d=void 0===u||u;if(e&&e.nodeName&&"TEXTAREA"===e.nodeName&&!o.has(e)){var h=null,f=null,p=e.clientWidth,m=function(){e.clientWidth!==p&&r()},g=function(t){window.removeEventListener("resize",m,!1),e.removeEventListener("input",r,!1),e.removeEventListener("keyup",r,!1),e.removeEventListener("autosize:destroy",g,!1),e.removeEventListener("autosize:update",r,!1),o["delete"](e),Object.keys(t).forEach(function(n){e.style[n]=t[n]})}.bind(e,{height:e.style.height,resize:e.style.resize,overflowY:e.style.overflowY,overflowX:e.style.overflowX,wordWrap:e.style.wordWrap});e.addEventListener("autosize:destroy",g,!1),"onpropertychange"in e&&"oninput"in e&&e.addEventListener("keyup",r,!1),window.addEventListener("resize",m,!1),e.addEventListener("input",r,!1),e.addEventListener("autosize:update",r,!1),o.add(e),c&&(e.style.overflowX="hidden",e.style.wordWrap="break-word"),t()}}function i(e){if(e&&e.nodeName&&"TEXTAREA"===e.nodeName){var t=s("autosize:destroy");e.dispatchEvent(t)}}function r(e){if(e&&e.nodeName&&"TEXTAREA"===e.nodeName){var t=s("autosize:update");e.dispatchEvent(t)}}var o="function"==typeof Set?new Set:function(){var e=[];return{has:function(t){return Boolean(e.indexOf(t)>-1)},add:function(t){e.push(t)},"delete":function(t){e.splice(e.indexOf(t),1)}}}(),s=function(e){return new Event(e)};try{new Event("test")}catch(a){s=function(e){var t=document.createEvent("Event");return t.initEvent(e,!0,!1),t}}var l=null;"undefined"==typeof window||"function"!=typeof window.getComputedStyle?(l=function(e){return e},l.destroy=function(e){return e},l.update=function(e){return e}):(l=function(e,t){return e&&Array.prototype.forEach.call(e.length?e:[e],function(e){return n(e,t)}),e},l.destroy=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],i),e},l.update=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],r),e}),t.exports=l}),function(e,t){"function"==typeof define&&define.amd?define(["jquery"],function(e){return t(e)}):"object"==typeof exports?module.exports=t(require("jquery")):t(jQuery)}(this,function(e){!function(e){"use strict";function t(t){var n=[{re:/[\xC0-\xC6]/g,ch:"A"},{re:/[\xE0-\xE6]/g,ch:"a"},{re:/[\xC8-\xCB]/g,ch:"E"},{re:/[\xE8-\xEB]/g,ch:"e"},{re:/[\xCC-\xCF]/g,ch:"I"},{re:/[\xEC-\xEF]/g,ch:"i"},{re:/[\xD2-\xD6]/g,ch:"O"},{re:/[\xF2-\xF6]/g,ch:"o"},{re:/[\xD9-\xDC]/g,ch:"U"},{re:/[\xF9-\xFC]/g,ch:"u"},{re:/[\xC7-\xE7]/g,ch:"c"},{re:/[\xD1]/g,ch:"N"},{re:/[\xF1]/g,ch:"n"}];return e.each(n,function(){t=t.replace(this.re,this.ch)}),t}function n(e){var t={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},n="(?:"+Object.keys(t).join("|")+")",i=new RegExp(n),r=new RegExp(n,"g"),o=null==e?"":""+e;return i.test(o)?o.replace(r,function(e){return t[e]}):o}function i(t,n){var i=arguments,o=t,s=n;[].shift.apply(i);var a,l=this.each(function(){var t=e(this);if(t.is("select")){var n=t.data("selectpicker"),l="object"==typeof o&&o;if(n){if(l)for(var c in l)l.hasOwnProperty(c)&&(n.options[c]=l[c])}else{var u=e.extend({},r.DEFAULTS,e.fn.selectpicker.defaults||{},t.data(),l);u.template=e.extend({},r.DEFAULTS.template,e.fn.selectpicker.defaults?e.fn.selectpicker.defaults.template:{},t.data().template,l.template),t.data("selectpicker",n=new r(this,u,s))}"string"==typeof o&&(a=n[o]instanceof Function?n[o].apply(n,i):n.options[o])}});return"undefined"!=typeof a?a:l}String.prototype.includes||!function(){var e={}.toString,t=function(){try{var e={},t=Object.defineProperty,n=t(e,e,e)&&t}catch(i){}return n}(),n="".indexOf,i=function(t){if(null==this)throw new TypeError;var i=String(this);if(t&&"[object RegExp]"==e.call(t))throw new TypeError;var r=i.length,o=String(t),s=o.length,a=arguments.length>1?arguments[1]:void 0,l=a?Number(a):0;l!=l&&(l=0);var c=Math.min(Math.max(l,0),r);return!(s+c>r)&&n.call(i,o,l)!=-1};t?t(String.prototype,"includes",{value:i,configurable:!0,writable:!0}):String.prototype.includes=i}(),String.prototype.startsWith||!function(){var e=function(){try{var e={},t=Object.defineProperty,n=t(e,e,e)&&t}catch(i){}return n}(),t={}.toString,n=function(e){if(null==this)throw new TypeError;var n=String(this);if(e&&"[object RegExp]"==t.call(e))throw new TypeError;var i=n.length,r=String(e),o=r.length,s=arguments.length>1?arguments[1]:void 0,a=s?Number(s):0;a!=a&&(a=0);var l=Math.min(Math.max(a,0),i);if(o+l>i)return!1;for(var c=-1;++c<o;)if(n.charCodeAt(l+c)!=r.charCodeAt(c))return!1;return!0};e?e(String.prototype,"startsWith",{value:n,configurable:!0,writable:!0}):String.prototype.startsWith=n}(),Object.keys||(Object.keys=function(e,t,n){n=[];for(t in e)n.hasOwnProperty.call(e,t)&&n.push(t);return n}),e.fn.triggerNative=function(e){var t,n=this[0];n.dispatchEvent?("function"==typeof Event?t=new Event(e,{bubbles:!0}):(t=document.createEvent("Event"),t.initEvent(e,!0,!1)),n.dispatchEvent(t)):(n.fireEvent&&(t=document.createEventObject(),t.eventType=e,n.fireEvent("on"+e,t)),this.trigger(e))},e.expr[":"].icontains=function(t,n,i){var r=e(t),o=(r.data("tokens")||r.text()).toUpperCase();return o.includes(i[3].toUpperCase())},e.expr[":"].ibegins=function(t,n,i){var r=e(t),o=(r.data("tokens")||r.text()).toUpperCase();return o.startsWith(i[3].toUpperCase())},e.expr[":"].aicontains=function(t,n,i){var r=e(t),o=(r.data("tokens")||r.data("normalizedText")||r.text()).toUpperCase();return o.includes(i[3].toUpperCase())},e.expr[":"].aibegins=function(t,n,i){var r=e(t),o=(r.data("tokens")||r.data("normalizedText")||r.text()).toUpperCase();return o.startsWith(i[3].toUpperCase())};var r=function(t,n,i){i&&(i.stopPropagation(),i.preventDefault()),this.$element=e(t),this.$newElement=null,this.$button=null,this.$menu=null,this.$lis=null,this.options=n,null===this.options.title&&(this.options.title=this.$element.attr("title")),this.val=r.prototype.val,this.render=r.prototype.render,this.refresh=r.prototype.refresh,this.setStyle=r.prototype.setStyle,this.selectAll=r.prototype.selectAll,this.deselectAll=r.prototype.deselectAll,this.destroy=r.prototype.destroy,this.remove=r.prototype.remove,this.show=r.prototype.show,this.hide=r.prototype.hide,this.init()};r.VERSION="1.10.0",r.DEFAULTS={noneSelectedText:"Nothing selected",noneResultsText:"No results matched {0}",countSelectedText:function(e,t){return 1==e?"{0} item selected":"{0} items selected";
  },maxOptionsText:function(e,t){return[1==e?"Limit reached ({n} item max)":"Limit reached ({n} items max)",1==t?"Group limit reached ({n} item max)":"Group limit reached ({n} items max)"]},selectAllText:"Select All",deselectAllText:"Deselect All",doneButton:!1,doneButtonText:"Close",multipleSeparator:", ",styleBase:"btn",style:"btn-default",size:"auto",title:null,selectedTextFormat:"values",width:!1,container:!1,hideDisabled:!1,showSubtext:!1,showIcon:!0,showContent:!0,dropupAuto:!0,header:!1,liveSearch:!1,liveSearchPlaceholder:null,liveSearchNormalize:!1,liveSearchStyle:"contains",actionsBox:!1,iconBase:"glyphicon",tickIcon:"glyphicon-ok",showTick:!1,template:{caret:'<span class="caret"></span>'},maxOptions:!1,mobile:!1,selectOnTab:!1,dropdownAlignRight:!1},r.prototype={constructor:r,init:function(){var t=this,n=this.$element.attr("id");this.$element.addClass("bs-select-hidden"),this.liObj={},this.multiple=this.$element.prop("multiple"),this.autofocus=this.$element.prop("autofocus"),this.$newElement=this.createView(),this.$element.after(this.$newElement).appendTo(this.$newElement),this.$button=this.$newElement.children("button"),this.$menu=this.$newElement.children(".dropdown-menu"),this.$menuInner=this.$menu.children(".inner"),this.$searchbox=this.$menu.find("input"),this.$element.removeClass("bs-select-hidden"),this.options.dropdownAlignRight&&this.$menu.addClass("dropdown-menu-right"),"undefined"!=typeof n&&(this.$button.attr("data-id",n),e('label[for="'+n+'"]').click(function(e){e.preventDefault(),t.$button.focus()})),this.checkDisabled(),this.clickListener(),this.options.liveSearch&&this.liveSearchListener(),this.render(),this.setStyle(),this.setWidth(),this.options.container&&this.selectPosition(),this.$menu.data("this",this),this.$newElement.data("this",this),this.options.mobile&&this.mobile(),this.$newElement.on({"hide.bs.dropdown":function(e){t.$element.trigger("hide.bs.select",e)},"hidden.bs.dropdown":function(e){t.$element.trigger("hidden.bs.select",e)},"show.bs.dropdown":function(e){t.$element.trigger("show.bs.select",e)},"shown.bs.dropdown":function(e){t.$element.trigger("shown.bs.select",e)}}),t.$element[0].hasAttribute("required")&&this.$element.on("invalid",function(){t.$button.addClass("bs-invalid").focus(),t.$element.on({"focus.bs.select":function(){t.$button.focus(),t.$element.off("focus.bs.select")},"shown.bs.select":function(){t.$element.val(t.$element.val()).off("shown.bs.select")},"rendered.bs.select":function(){this.validity.valid&&t.$button.removeClass("bs-invalid"),t.$element.off("rendered.bs.select")}})}),setTimeout(function(){t.$element.trigger("loaded.bs.select")})},createDropdown:function(){var t=this.multiple||this.options.showTick?" show-tick":"",i=this.$element.parent().hasClass("input-group")?" input-group-btn":"",r=this.autofocus?" autofocus":"",o=this.options.header?'<div class="popover-title"><button type="button" class="close" aria-hidden="true">&times;</button>'+this.options.header+"</div>":"",s=this.options.liveSearch?'<div class="bs-searchbox"><input type="text" class="form-control" autocomplete="off"'+(null===this.options.liveSearchPlaceholder?"":' placeholder="'+n(this.options.liveSearchPlaceholder)+'"')+"></div>":"",a=this.multiple&&this.options.actionsBox?'<div class="bs-actionsbox"><div class="btn-group btn-group-sm btn-block"><button type="button" class="actions-btn bs-select-all btn btn-default">'+this.options.selectAllText+'</button><button type="button" class="actions-btn bs-deselect-all btn btn-default">'+this.options.deselectAllText+"</button></div></div>":"",l=this.multiple&&this.options.doneButton?'<div class="bs-donebutton"><div class="btn-group btn-block"><button type="button" class="btn btn-sm btn-default">'+this.options.doneButtonText+"</button></div></div>":"",c='<div class="btn-group bootstrap-select'+t+i+'"><button type="button" class="'+this.options.styleBase+' dropdown-toggle" data-toggle="dropdown"'+r+'><span class="filter-option pull-left"></span>&nbsp;<span class="bs-caret">'+this.options.template.caret+'</span></button><div class="dropdown-menu open">'+o+s+a+'<ul class="dropdown-menu inner" role="menu"></ul>'+l+"</div></div>";return e(c)},createView:function(){var e=this.createDropdown(),t=this.createLi();return e.find("ul")[0].innerHTML=t,e},reloadLi:function(){this.destroyLi();var e=this.createLi();this.$menuInner[0].innerHTML=e},destroyLi:function(){this.$menu.find("li").remove()},createLi:function(){var i=this,r=[],o=0,s=document.createElement("option"),a=-1,l=function(e,t,n,i){return"<li"+("undefined"!=typeof n&""!==n?' class="'+n+'"':"")+("undefined"!=typeof t&null!==t?' data-original-index="'+t+'"':"")+("undefined"!=typeof i&null!==i?'data-optgroup="'+i+'"':"")+">"+e+"</li>"},c=function(e,r,o,s){return'<a tabindex="0"'+("undefined"!=typeof r?' class="'+r+'"':"")+("undefined"!=typeof o?' style="'+o+'"':"")+(i.options.liveSearchNormalize?' data-normalized-text="'+t(n(e))+'"':"")+("undefined"!=typeof s||null!==s?' data-tokens="'+s+'"':"")+">"+e+'<span class="'+i.options.iconBase+" "+i.options.tickIcon+' check-mark"></span></a>'};if(this.options.title&&!this.multiple&&(a--,!this.$element.find(".bs-title-option").length)){var u=this.$element[0];s.className="bs-title-option",s.appendChild(document.createTextNode(this.options.title)),s.value="",u.insertBefore(s,u.firstChild),void 0===e(u.options[u.selectedIndex]).attr("selected")&&(s.selected=!0)}return this.$element.find("option").each(function(t){var n=e(this);if(a++,!n.hasClass("bs-title-option")){var s=this.className||"",u=this.style.cssText,d=n.data("content")?n.data("content"):n.html(),h=n.data("tokens")?n.data("tokens"):null,f="undefined"!=typeof n.data("subtext")?'<small class="text-muted">'+n.data("subtext")+"</small>":"",p="undefined"!=typeof n.data("icon")?'<span class="'+i.options.iconBase+" "+n.data("icon")+'"></span> ':"",m="OPTGROUP"===this.parentNode.tagName,g=this.disabled||m&&this.parentNode.disabled;if(""!==p&&g&&(p="<span>"+p+"</span>"),i.options.hideDisabled&&g&&!m)return void a--;if(n.data("content")||(d=p+'<span class="text">'+d+f+"</span>"),m&&n.data("divider")!==!0){var v=" "+this.parentNode.className||"";if(0===n.index()){o+=1;var y=this.parentNode.label,b="undefined"!=typeof n.parent().data("subtext")?'<small class="text-muted">'+n.parent().data("subtext")+"</small>":"",x=n.parent().data("icon")?'<span class="'+i.options.iconBase+" "+n.parent().data("icon")+'"></span> ':"";y=x+'<span class="text">'+y+b+"</span>",0!==t&&r.length>0&&(a++,r.push(l("",null,"divider",o+"div"))),a++,r.push(l(y,null,"dropdown-header"+v,o))}if(i.options.hideDisabled&&g)return void a--;r.push(l(c(d,"opt "+s+v,u,h),t,"",o))}else n.data("divider")===!0?r.push(l("",t,"divider")):n.data("hidden")===!0?r.push(l(c(d,s,u,h),t,"hidden is-hidden")):(this.previousElementSibling&&"OPTGROUP"===this.previousElementSibling.tagName&&(a++,r.push(l("",null,"divider",o+"div"))),r.push(l(c(d,s,u,h),t)));i.liObj[t]=a}}),this.multiple||0!==this.$element.find("option:selected").length||this.options.title||this.$element.find("option").eq(0).prop("selected",!0).attr("selected","selected"),r.join("")},findLis:function(){return null==this.$lis&&(this.$lis=this.$menu.find("li")),this.$lis},render:function(t){var n,i=this;t!==!1&&this.$element.find("option").each(function(e){var t=i.findLis().eq(i.liObj[e]);i.setDisabled(e,this.disabled||"OPTGROUP"===this.parentNode.tagName&&this.parentNode.disabled,t),i.setSelected(e,this.selected,t)}),this.tabIndex();var r=this.$element.find("option").map(function(){if(this.selected){if(i.options.hideDisabled&&(this.disabled||"OPTGROUP"===this.parentNode.tagName&&this.parentNode.disabled))return;var t,n=e(this),r=n.data("icon")&&i.options.showIcon?'<i class="'+i.options.iconBase+" "+n.data("icon")+'"></i> ':"";return t=i.options.showSubtext&&n.data("subtext")&&!i.multiple?' <small class="text-muted">'+n.data("subtext")+"</small>":"","undefined"!=typeof n.attr("title")?n.attr("title"):n.data("content")&&i.options.showContent?n.data("content"):r+n.html()+t}}).toArray(),o=this.multiple?r.join(this.options.multipleSeparator):r[0];if(this.multiple&&this.options.selectedTextFormat.indexOf("count")>-1){var s=this.options.selectedTextFormat.split(">");if(s.length>1&&r.length>s[1]||1==s.length&&r.length>=2){n=this.options.hideDisabled?", [disabled]":"";var a=this.$element.find("option").not('[data-divider="true"], [data-hidden="true"]'+n).length,l="function"==typeof this.options.countSelectedText?this.options.countSelectedText(r.length,a):this.options.countSelectedText;o=l.replace("{0}",r.length.toString()).replace("{1}",a.toString())}}void 0==this.options.title&&(this.options.title=this.$element.attr("title")),"static"==this.options.selectedTextFormat&&(o=this.options.title),o||(o="undefined"!=typeof this.options.title?this.options.title:this.options.noneSelectedText),this.$button.attr("title",e.trim(o.replace(/<[^>]*>?/g,""))),this.$button.children(".filter-option").html(o),this.$element.trigger("rendered.bs.select")},setStyle:function(e,t){this.$element.attr("class")&&this.$newElement.addClass(this.$element.attr("class").replace(/selectpicker|mobile-device|bs-select-hidden|validate\[.*\]/gi,""));var n=e?e:this.options.style;"add"==t?this.$button.addClass(n):"remove"==t?this.$button.removeClass(n):(this.$button.removeClass(this.options.style),this.$button.addClass(n))},liHeight:function(t){if(t||this.options.size!==!1&&!this.sizeInfo){var n=document.createElement("div"),i=document.createElement("div"),r=document.createElement("ul"),o=document.createElement("li"),s=document.createElement("li"),a=document.createElement("a"),l=document.createElement("span"),c=this.options.header&&this.$menu.find(".popover-title").length>0?this.$menu.find(".popover-title")[0].cloneNode(!0):null,u=this.options.liveSearch?document.createElement("div"):null,d=this.options.actionsBox&&this.multiple&&this.$menu.find(".bs-actionsbox").length>0?this.$menu.find(".bs-actionsbox")[0].cloneNode(!0):null,h=this.options.doneButton&&this.multiple&&this.$menu.find(".bs-donebutton").length>0?this.$menu.find(".bs-donebutton")[0].cloneNode(!0):null;if(l.className="text",n.className=this.$menu[0].parentNode.className+" open",i.className="dropdown-menu open",r.className="dropdown-menu inner",o.className="divider",l.appendChild(document.createTextNode("Inner text")),a.appendChild(l),s.appendChild(a),r.appendChild(s),r.appendChild(o),c&&i.appendChild(c),u){var f=document.createElement("span");u.className="bs-searchbox",f.className="form-control",u.appendChild(f),i.appendChild(u)}d&&i.appendChild(d),i.appendChild(r),h&&i.appendChild(h),n.appendChild(i),document.body.appendChild(n);var p=a.offsetHeight,m=c?c.offsetHeight:0,g=u?u.offsetHeight:0,v=d?d.offsetHeight:0,y=h?h.offsetHeight:0,b=e(o).outerHeight(!0),x="function"==typeof getComputedStyle&&getComputedStyle(i),w=x?null:e(i),C=parseInt(x?x.paddingTop:w.css("paddingTop"))+parseInt(x?x.paddingBottom:w.css("paddingBottom"))+parseInt(x?x.borderTopWidth:w.css("borderTopWidth"))+parseInt(x?x.borderBottomWidth:w.css("borderBottomWidth")),k=C+parseInt(x?x.marginTop:w.css("marginTop"))+parseInt(x?x.marginBottom:w.css("marginBottom"))+2;document.body.removeChild(n),this.sizeInfo={liHeight:p,headerHeight:m,searchHeight:g,actionsHeight:v,doneButtonHeight:y,dividerHeight:b,menuPadding:C,menuExtras:k}}},setSize:function(){if(this.findLis(),this.liHeight(),this.options.header&&this.$menu.css("padding-top",0),this.options.size!==!1){var t,n,i,r,o=this,s=this.$menu,a=this.$menuInner,l=e(window),c=this.$newElement[0].offsetHeight,u=this.sizeInfo.liHeight,d=this.sizeInfo.headerHeight,h=this.sizeInfo.searchHeight,f=this.sizeInfo.actionsHeight,p=this.sizeInfo.doneButtonHeight,m=this.sizeInfo.dividerHeight,g=this.sizeInfo.menuPadding,v=this.sizeInfo.menuExtras,y=this.options.hideDisabled?".disabled":"",b=function(){i=o.$newElement.offset().top-l.scrollTop(),r=l.height()-i-c};if(b(),"auto"===this.options.size){var x=function(){var l,c=function(t,n){return function(i){return n?i.classList?i.classList.contains(t):e(i).hasClass(t):!(i.classList?i.classList.contains(t):e(i).hasClass(t))}},m=o.$menuInner[0].getElementsByTagName("li"),y=Array.prototype.filter?Array.prototype.filter.call(m,c("hidden",!1)):o.$lis.not(".hidden"),x=Array.prototype.filter?Array.prototype.filter.call(y,c("dropdown-header",!0)):y.filter(".dropdown-header");b(),t=r-v,o.options.container?(s.data("height")||s.data("height",s.height()),n=s.data("height")):n=s.height(),o.options.dropupAuto&&o.$newElement.toggleClass("dropup",i>r&&t-v<n),o.$newElement.hasClass("dropup")&&(t=i-v),l=y.length+x.length>3?3*u+v-2:0,s.css({"max-height":t+"px",overflow:"hidden","min-height":l+d+h+f+p+"px"}),a.css({"max-height":t-d-h-f-p-g+"px","overflow-y":"auto","min-height":Math.max(l-g,0)+"px"})};x(),this.$searchbox.off("input.getSize propertychange.getSize").on("input.getSize propertychange.getSize",x),l.off("resize.getSize scroll.getSize").on("resize.getSize scroll.getSize",x)}else if(this.options.size&&"auto"!=this.options.size&&this.$lis.not(y).length>this.options.size){var w=this.$lis.not(".divider").not(y).children().slice(0,this.options.size).last().parent().index(),C=this.$lis.slice(0,w+1).filter(".divider").length;t=u*this.options.size+C*m+g,o.options.container?(s.data("height")||s.data("height",s.height()),n=s.data("height")):n=s.height(),o.options.dropupAuto&&this.$newElement.toggleClass("dropup",i>r&&t-v<n),s.css({"max-height":t+d+h+f+p+"px",overflow:"hidden","min-height":""}),a.css({"max-height":t-g+"px","overflow-y":"auto","min-height":""})}}},setWidth:function(){if("auto"===this.options.width){this.$menu.css("min-width","0");var e=this.$menu.parent().clone().appendTo("body"),t=this.options.container?this.$newElement.clone().appendTo("body"):e,n=e.children(".dropdown-menu").outerWidth(),i=t.css("width","auto").children("button").outerWidth();e.remove(),t.remove(),this.$newElement.css("width",Math.max(n,i)+"px")}else"fit"===this.options.width?(this.$menu.css("min-width",""),this.$newElement.css("width","").addClass("fit-width")):this.options.width?(this.$menu.css("min-width",""),this.$newElement.css("width",this.options.width)):(this.$menu.css("min-width",""),this.$newElement.css("width",""));this.$newElement.hasClass("fit-width")&&"fit"!==this.options.width&&this.$newElement.removeClass("fit-width")},selectPosition:function(){this.$bsContainer=e('<div class="bs-container" />');var t,n,i=this,r=function(e){i.$bsContainer.addClass(e.attr("class").replace(/form-control|fit-width/gi,"")).toggleClass("dropup",e.hasClass("dropup")),t=e.offset(),n=e.hasClass("dropup")?0:e[0].offsetHeight,i.$bsContainer.css({top:t.top+n,left:t.left,width:e[0].offsetWidth})};this.$button.on("click",function(){var t=e(this);i.isDisabled()||(r(i.$newElement),i.$bsContainer.appendTo(i.options.container).toggleClass("open",!t.hasClass("open")).append(i.$menu))}),e(window).on("resize scroll",function(){r(i.$newElement)}),this.$element.on("hide.bs.select",function(){i.$menu.data("height",i.$menu.height()),i.$bsContainer.detach()})},setSelected:function(e,t,n){n||(n=this.findLis().eq(this.liObj[e])),n.toggleClass("selected",t)},setDisabled:function(e,t,n){n||(n=this.findLis().eq(this.liObj[e])),t?n.addClass("disabled").children("a").attr("href","#").attr("tabindex",-1):n.removeClass("disabled").children("a").removeAttr("href").attr("tabindex",0)},isDisabled:function(){return this.$element[0].disabled},checkDisabled:function(){var e=this;this.isDisabled()?(this.$newElement.addClass("disabled"),this.$button.addClass("disabled").attr("tabindex",-1)):(this.$button.hasClass("disabled")&&(this.$newElement.removeClass("disabled"),this.$button.removeClass("disabled")),this.$button.attr("tabindex")!=-1||this.$element.data("tabindex")||this.$button.removeAttr("tabindex")),this.$button.click(function(){return!e.isDisabled()})},tabIndex:function(){this.$element.data("tabindex")!==this.$element.attr("tabindex")&&this.$element.attr("tabindex")!==-98&&"-98"!==this.$element.attr("tabindex")&&(this.$element.data("tabindex",this.$element.attr("tabindex")),this.$button.attr("tabindex",this.$element.data("tabindex"))),this.$element.attr("tabindex",-98)},clickListener:function(){var t=this,n=e(document);this.$newElement.on("touchstart.dropdown",".dropdown-menu",function(e){e.stopPropagation()}),n.data("spaceSelect",!1),this.$button.on("keyup",function(e){/(32)/.test(e.keyCode.toString(10))&&n.data("spaceSelect")&&(e.preventDefault(),n.data("spaceSelect",!1))}),this.$button.on("click",function(){t.setSize()}),this.$element.on("shown.bs.select",function(){if(t.options.liveSearch||t.multiple){if(!t.multiple){var e=t.liObj[t.$element[0].selectedIndex];if("number"!=typeof e||t.options.size===!1)return;var n=t.$lis.eq(e)[0].offsetTop-t.$menuInner[0].offsetTop;n=n-t.$menuInner[0].offsetHeight/2+t.sizeInfo.liHeight/2,t.$menuInner[0].scrollTop=n}}else t.$menuInner.find(".selected a").focus()}),this.$menuInner.on("click","li a",function(n){var i=e(this),r=i.parent().data("originalIndex"),o=t.$element.val(),s=t.$element.prop("selectedIndex");if(t.multiple&&n.stopPropagation(),n.preventDefault(),!t.isDisabled()&&!i.parent().hasClass("disabled")){var a=t.$element.find("option"),l=a.eq(r),c=l.prop("selected"),u=l.parent("optgroup"),d=t.options.maxOptions,h=u.data("maxOptions")||!1;if(t.multiple){if(l.prop("selected",!c),t.setSelected(r,!c),i.blur(),d!==!1||h!==!1){var f=d<a.filter(":selected").length,p=h<u.find("option:selected").length;if(d&&f||h&&p)if(d&&1==d)a.prop("selected",!1),l.prop("selected",!0),t.$menuInner.find(".selected").removeClass("selected"),t.setSelected(r,!0);else if(h&&1==h){u.find("option:selected").prop("selected",!1),l.prop("selected",!0);var m=i.parent().data("optgroup");t.$menuInner.find('[data-optgroup="'+m+'"]').removeClass("selected"),t.setSelected(r,!0)}else{var g="function"==typeof t.options.maxOptionsText?t.options.maxOptionsText(d,h):t.options.maxOptionsText,v=g[0].replace("{n}",d),y=g[1].replace("{n}",h),b=e('<div class="notify"></div>');g[2]&&(v=v.replace("{var}",g[2][d>1?0:1]),y=y.replace("{var}",g[2][h>1?0:1])),l.prop("selected",!1),t.$menu.append(b),d&&f&&(b.append(e("<div>"+v+"</div>")),t.$element.trigger("maxReached.bs.select")),h&&p&&(b.append(e("<div>"+y+"</div>")),t.$element.trigger("maxReachedGrp.bs.select")),setTimeout(function(){t.setSelected(r,!1)},10),b.delay(750).fadeOut(300,function(){e(this).remove()})}}}else a.prop("selected",!1),l.prop("selected",!0),t.$menuInner.find(".selected").removeClass("selected"),t.setSelected(r,!0);t.multiple?t.options.liveSearch&&t.$searchbox.focus():t.$button.focus(),(o!=t.$element.val()&&t.multiple||s!=t.$element.prop("selectedIndex")&&!t.multiple)&&t.$element.trigger("changed.bs.select",[r,l.prop("selected"),c]).triggerNative("change")}}),this.$menu.on("click","li.disabled a, .popover-title, .popover-title :not(.close)",function(n){n.currentTarget==this&&(n.preventDefault(),n.stopPropagation(),t.options.liveSearch&&!e(n.target).hasClass("close")?t.$searchbox.focus():t.$button.focus())}),this.$menuInner.on("click",".divider, .dropdown-header",function(e){e.preventDefault(),e.stopPropagation(),t.options.liveSearch?t.$searchbox.focus():t.$button.focus()}),this.$menu.on("click",".popover-title .close",function(){t.$button.click()}),this.$searchbox.on("click",function(e){e.stopPropagation()}),this.$menu.on("click",".actions-btn",function(n){t.options.liveSearch?t.$searchbox.focus():t.$button.focus(),n.preventDefault(),n.stopPropagation(),e(this).hasClass("bs-select-all")?t.selectAll():t.deselectAll()}),this.$element.change(function(){t.render(!1)})},liveSearchListener:function(){var i=this,r=e('<li class="no-results"></li>');this.$button.on("click.dropdown.data-api touchstart.dropdown.data-api",function(){i.$menuInner.find(".active").removeClass("active"),i.$searchbox.val()&&(i.$searchbox.val(""),i.$lis.not(".is-hidden").removeClass("hidden"),r.parent().length&&r.remove()),i.multiple||i.$menuInner.find(".selected").addClass("active"),setTimeout(function(){i.$searchbox.focus()},10)}),this.$searchbox.on("click.dropdown.data-api focus.dropdown.data-api touchend.dropdown.data-api",function(e){e.stopPropagation()}),this.$searchbox.on("input propertychange",function(){if(i.$searchbox.val()){var o=i.$lis.not(".is-hidden").removeClass("hidden").children("a");o=i.options.liveSearchNormalize?o.not(":a"+i._searchStyle()+'("'+t(i.$searchbox.val())+'")'):o.not(":"+i._searchStyle()+'("'+i.$searchbox.val()+'")'),o.parent().addClass("hidden"),i.$lis.filter(".dropdown-header").each(function(){var t=e(this),n=t.data("optgroup");0===i.$lis.filter("[data-optgroup="+n+"]").not(t).not(".hidden").length&&(t.addClass("hidden"),i.$lis.filter("[data-optgroup="+n+"div]").addClass("hidden"))});var s=i.$lis.not(".hidden");s.each(function(t){var n=e(this);n.hasClass("divider")&&(n.index()===s.first().index()||n.index()===s.last().index()||s.eq(t+1).hasClass("divider"))&&n.addClass("hidden")}),i.$lis.not(".hidden, .no-results").length?r.parent().length&&r.remove():(r.parent().length&&r.remove(),r.html(i.options.noneResultsText.replace("{0}",'"'+n(i.$searchbox.val())+'"')).show(),i.$menuInner.append(r))}else i.$lis.not(".is-hidden").removeClass("hidden"),r.parent().length&&r.remove();i.$lis.filter(".active").removeClass("active"),i.$searchbox.val()&&i.$lis.not(".hidden, .divider, .dropdown-header").eq(0).addClass("active").children("a").focus(),e(this).focus()})},_searchStyle:function(){var e={begins:"ibegins",startsWith:"ibegins"};return e[this.options.liveSearchStyle]||"icontains"},val:function(e){return"undefined"!=typeof e?(this.$element.val(e),this.render(),this.$element):this.$element.val()},changeAll:function(t){"undefined"==typeof t&&(t=!0),this.findLis();for(var n=this.$element.find("option"),i=this.$lis.not(".divider, .dropdown-header, .disabled, .hidden").toggleClass("selected",t),r=i.length,o=[],s=0;s<r;s++){var a=i[s].getAttribute("data-original-index");o[o.length]=n.eq(a)[0]}e(o).prop("selected",t),this.render(!1),this.$element.trigger("changed.bs.select").triggerNative("change")},selectAll:function(){return this.changeAll(!0)},deselectAll:function(){return this.changeAll(!1)},toggle:function(e){e=e||window.event,e&&e.stopPropagation(),this.$button.trigger("click")},keydown:function(n){var i,r,o,s,a,l,c,u,d,h=e(this),f=h.is("input")?h.parent().parent():h.parent(),p=f.data("this"),m=":not(.disabled, .hidden, .dropdown-header, .divider)",g={32:" ",48:"0",49:"1",50:"2",51:"3",52:"4",53:"5",54:"6",55:"7",56:"8",57:"9",59:";",65:"a",66:"b",67:"c",68:"d",69:"e",70:"f",71:"g",72:"h",73:"i",74:"j",75:"k",76:"l",77:"m",78:"n",79:"o",80:"p",81:"q",82:"r",83:"s",84:"t",85:"u",86:"v",87:"w",88:"x",89:"y",90:"z",96:"0",97:"1",98:"2",99:"3",100:"4",101:"5",102:"6",103:"7",104:"8",105:"9"};if(p.options.liveSearch&&(f=h.parent().parent()),p.options.container&&(f=p.$menu),i=e("[role=menu] li",f),d=p.$newElement.hasClass("open"),!d&&(n.keyCode>=48&&n.keyCode<=57||n.keyCode>=96&&n.keyCode<=105||n.keyCode>=65&&n.keyCode<=90)&&(p.options.container?p.$button.trigger("click"):(p.setSize(),p.$menu.parent().addClass("open"),d=!0),p.$searchbox.focus()),p.options.liveSearch&&(/(^9$|27)/.test(n.keyCode.toString(10))&&d&&0===p.$menu.find(".active").length&&(n.preventDefault(),p.$menu.parent().removeClass("open"),p.options.container&&p.$newElement.removeClass("open"),p.$button.focus()),i=e("[role=menu] li"+m,f),h.val()||/(38|40)/.test(n.keyCode.toString(10))||0===i.filter(".active").length&&(i=p.$menuInner.find("li"),i=p.options.liveSearchNormalize?i.filter(":a"+p._searchStyle()+"("+t(g[n.keyCode])+")"):i.filter(":"+p._searchStyle()+"("+g[n.keyCode]+")"))),i.length){if(/(38|40)/.test(n.keyCode.toString(10)))r=i.index(i.find("a").filter(":focus").parent()),s=i.filter(m).first().index(),a=i.filter(m).last().index(),o=i.eq(r).nextAll(m).eq(0).index(),l=i.eq(r).prevAll(m).eq(0).index(),c=i.eq(o).prevAll(m).eq(0).index(),p.options.liveSearch&&(i.each(function(t){e(this).hasClass("disabled")||e(this).data("index",t)}),r=i.index(i.filter(".active")),s=i.first().data("index"),a=i.last().data("index"),o=i.eq(r).nextAll().eq(0).data("index"),l=i.eq(r).prevAll().eq(0).data("index"),c=i.eq(o).prevAll().eq(0).data("index")),u=h.data("prevIndex"),38==n.keyCode?(p.options.liveSearch&&r--,r!=c&&r>l&&(r=l),r<s&&(r=s),r==u&&(r=a)):40==n.keyCode&&(p.options.liveSearch&&r++,r==-1&&(r=0),r!=c&&r<o&&(r=o),r>a&&(r=a),r==u&&(r=s)),h.data("prevIndex",r),p.options.liveSearch?(n.preventDefault(),h.hasClass("dropdown-toggle")||(i.removeClass("active").eq(r).addClass("active").children("a").focus(),h.focus())):i.eq(r).children("a").focus();else if(!h.is("input")){var v,y,b=[];i.each(function(){e(this).hasClass("disabled")||e.trim(e(this).children("a").text().toLowerCase()).substring(0,1)==g[n.keyCode]&&b.push(e(this).index())}),v=e(document).data("keycount"),v++,e(document).data("keycount",v),y=e.trim(e(":focus").text().toLowerCase()).substring(0,1),y!=g[n.keyCode]?(v=1,e(document).data("keycount",v)):v>=b.length&&(e(document).data("keycount",0),v>b.length&&(v=1)),i.eq(b[v-1]).children("a").focus()}if((/(13|32)/.test(n.keyCode.toString(10))||/(^9$)/.test(n.keyCode.toString(10))&&p.options.selectOnTab)&&d){if(/(32)/.test(n.keyCode.toString(10))||n.preventDefault(),p.options.liveSearch)/(32)/.test(n.keyCode.toString(10))||(p.$menuInner.find(".active a").click(),h.focus());else{var x=e(":focus");x.click(),x.focus(),n.preventDefault(),e(document).data("spaceSelect",!0)}e(document).data("keycount",0)}(/(^9$|27)/.test(n.keyCode.toString(10))&&d&&(p.multiple||p.options.liveSearch)||/(27)/.test(n.keyCode.toString(10))&&!d)&&(p.$menu.parent().removeClass("open"),p.options.container&&p.$newElement.removeClass("open"),p.$button.focus())}},mobile:function(){this.$element.addClass("mobile-device")},refresh:function(){this.$lis=null,this.liObj={},this.reloadLi(),this.render(),this.checkDisabled(),this.liHeight(!0),this.setStyle(),this.setWidth(),this.$lis&&this.$searchbox.trigger("propertychange"),this.$element.trigger("refreshed.bs.select")},hide:function(){this.$newElement.hide()},show:function(){this.$newElement.show()},remove:function(){this.$newElement.remove(),this.$element.remove()},destroy:function(){this.$newElement.before(this.$element).remove(),this.$bsContainer?this.$bsContainer.remove():this.$menu.remove(),this.$element.off(".bs.select").removeData("selectpicker").removeClass("bs-select-hidden selectpicker")}};var o=e.fn.selectpicker;e.fn.selectpicker=i,e.fn.selectpicker.Constructor=r,e.fn.selectpicker.noConflict=function(){return e.fn.selectpicker=o,this},e(document).data("keycount",0).on("keydown.bs.select",'.bootstrap-select [data-toggle=dropdown], .bootstrap-select [role="menu"], .bs-searchbox input',r.prototype.keydown).on("focusin.modal",'.bootstrap-select [data-toggle=dropdown], .bootstrap-select [role="menu"], .bs-searchbox input',function(e){e.stopPropagation()}),e(window).on("load.bs.select.data-api",function(){e(".selectpicker").each(function(){var t=e(this);i.call(t,t.data())})})}(e)}),function(e){"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof exports?module.exports=e(require("jquery")):e(jQuery||Zepto)}(function(e){var t=function(t,n,i){var r={invalid:[],getCaret:function(){try{var e,n=0,i=t.get(0),o=document.selection,s=i.selectionStart;return o&&-1===navigator.appVersion.indexOf("MSIE 10")?(e=o.createRange(),e.moveStart("character",-r.val().length),n=e.text.length):(s||"0"===s)&&(n=s),n}catch(a){}},setCaret:function(e){try{if(t.is(":focus")){var n,i=t.get(0);i.setSelectionRange?(i.focus(),i.setSelectionRange(e,e)):(n=i.createTextRange(),n.collapse(!0),n.moveEnd("character",e),n.moveStart("character",e),n.select())}}catch(r){}},events:function(){t.on("keydown.mask",function(e){t.data("mask-keycode",e.keyCode||e.which)}).on(e.jMaskGlobals.useInput?"input.mask":"keyup.mask",r.behaviour).on("paste.mask drop.mask",function(){setTimeout(function(){t.keydown().keyup()},100)}).on("change.mask",function(){t.data("changed",!0)}).on("blur.mask",function(){a===r.val()||t.data("changed")||t.trigger("change"),t.data("changed",!1)}).on("blur.mask",function(){a=r.val()}).on("focus.mask",function(t){!0===i.selectOnFocus&&e(t.target).select()}).on("focusout.mask",function(){i.clearIfNotMatch&&!o.test(r.val())&&r.val("")})},getRegexMask:function(){for(var e,t,i,r,o=[],a=0;a<n.length;a++)(e=s.translation[n.charAt(a)])?(t=e.pattern.toString().replace(/.{1}$|^.{1}/g,""),i=e.optional,(e=e.recursive)?(o.push(n.charAt(a)),r={digit:n.charAt(a),pattern:t}):o.push(i||e?t+"?":t)):o.push(n.charAt(a).replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"));return o=o.join(""),r&&(o=o.replace(new RegExp("("+r.digit+"(.*"+r.digit+")?)"),"($1)?").replace(new RegExp(r.digit,"g"),r.pattern)),new RegExp(o)},destroyEvents:function(){t.off("input keydown keyup paste drop blur focusout ".split(" ").join(".mask "))},val:function(e){var n=t.is("input")?"val":"text";return 0<arguments.length?(t[n]()!==e&&t[n](e),n=t):n=t[n](),n},getMCharsBeforeCount:function(e,t){for(var i=0,r=0,o=n.length;r<o&&r<e;r++)s.translation[n.charAt(r)]||(e=t?e+1:e,i++);return i},caretPos:function(e,t,i,o){return s.translation[n.charAt(Math.min(e-1,n.length-1))]?Math.min(e+i-t-o,i):r.caretPos(e+1,t,i,o)},behaviour:function(n){n=n||window.event,r.invalid=[];var i=t.data("mask-keycode");if(-1===e.inArray(i,s.byPassKeys)){var o=r.getCaret(),a=r.val().length,l=r.getMasked(),c=l.length,u=r.getMCharsBeforeCount(c-1)-r.getMCharsBeforeCount(a-1),d=o<a;return r.val(l),d&&(8!==i&&46!==i&&(o=r.caretPos(o,a,c,u)),r.setCaret(o)),r.callbacks(n)}},getMasked:function(e,t){var o,a,l=[],c=void 0===t?r.val():t+"",u=0,d=n.length,h=0,f=c.length,p=1,m="push",g=-1;for(i.reverse?(m="unshift",p=-1,o=0,u=d-1,h=f-1,a=function(){return-1<u&&-1<h}):(o=d-1,a=function(){return u<d&&h<f});a();){var v=n.charAt(u),y=c.charAt(h),b=s.translation[v];b?(y.match(b.pattern)?(l[m](y),b.recursive&&(-1===g?g=u:u===o&&(u=g-p),o===g&&(u-=p)),u+=p):b.optional?(u+=p,h-=p):b.fallback?(l[m](b.fallback),u+=p,h-=p):r.invalid.push({p:h,v:y,e:b.pattern}),h+=p):(e||l[m](v),y===v&&(h+=p),u+=p)}return c=n.charAt(o),d!==f+1||s.translation[c]||l.push(c),l.join("")},callbacks:function(e){var o=r.val(),s=o!==a,l=[o,e,t,i],c=function(e,t,n){"function"==typeof i[e]&&t&&i[e].apply(this,n)};c("onChange",!0===s,l),c("onKeyPress",!0===s,l),c("onComplete",o.length===n.length,l),c("onInvalid",0<r.invalid.length,[o,e,t,r.invalid,i])}};t=e(t);var o,s=this,a=r.val();n="function"==typeof n?n(r.val(),void 0,t,i):n,s.mask=n,s.options=i,s.remove=function(){var e=r.getCaret();return r.destroyEvents(),r.val(s.getCleanVal()),r.setCaret(e-r.getMCharsBeforeCount(e)),t},s.getCleanVal=function(){return r.getMasked(!0)},s.getMaskedVal=function(e){return r.getMasked(!1,e)},s.init=function(n){n=n||!1,i=i||{},s.clearIfNotMatch=e.jMaskGlobals.clearIfNotMatch,s.byPassKeys=e.jMaskGlobals.byPassKeys,s.translation=e.extend({},e.jMaskGlobals.translation,i.translation),s=e.extend(!0,{},s,i),o=r.getRegexMask(),!1===n?(i.placeholder&&t.attr("placeholder",i.placeholder),t.data("mask")&&t.attr("autocomplete","off"),r.destroyEvents(),r.events(),n=r.getCaret(),r.val(r.getMasked()),r.setCaret(n+r.getMCharsBeforeCount(n,!0))):(r.events(),r.val(r.getMasked()))},s.init(!t.is("input"))};e.maskWatchers={};var n=function(){var n=e(this),r={},o=n.attr("data-mask");if(n.attr("data-mask-reverse")&&(r.reverse=!0),n.attr("data-mask-clearifnotmatch")&&(r.clearIfNotMatch=!0),"true"===n.attr("data-mask-selectonfocus")&&(r.selectOnFocus=!0),i(n,o,r))return n.data("mask",new t(this,o,r))},i=function(t,n,i){i=i||{};var r=e(t).data("mask"),o=JSON.stringify;t=e(t).val()||e(t).text();try{return"function"==typeof n&&(n=n(t)),"object"!=typeof r||o(r.options)!==o(i)||r.mask!==n}catch(s){}};e.fn.mask=function(n,r){r=r||{};var o=this.selector,s=e.jMaskGlobals,a=s.watchInterval,s=r.watchInputs||s.watchInputs,l=function(){if(i(this,n,r))return e(this).data("mask",new t(this,n,r))};return e(this).each(l),o&&""!==o&&s&&(clearInterval(e.maskWatchers[o]),
  e.maskWatchers[o]=setInterval(function(){e(document).find(o).each(l)},a)),this},e.fn.masked=function(e){return this.data("mask").getMaskedVal(e)},e.fn.unmask=function(){return clearInterval(e.maskWatchers[this.selector]),delete e.maskWatchers[this.selector],this.each(function(){var t=e(this).data("mask");t&&t.remove().removeData("mask")})},e.fn.cleanVal=function(){return this.data("mask").getCleanVal()},e.applyDataMask=function(t){t=t||e.jMaskGlobals.maskElements,(t instanceof e?t:e(t)).filter(e.jMaskGlobals.dataMaskAttr).each(n)};var r={maskElements:"input,td,span,div",dataMaskAttr:"*[data-mask]",dataMask:!0,watchInterval:300,watchInputs:!0,useInput:function(e){var t,n=document.createElement("div");return e="on"+e,t=e in n,t||(n.setAttribute(e,"return;"),t="function"==typeof n[e]),t}("input"),watchDataMask:!1,byPassKeys:[9,16,17,18,36,37,38,39,40,91],translation:{0:{pattern:/\d/},9:{pattern:/\d/,optional:!0},"#":{pattern:/\d/,recursive:!0},A:{pattern:/[a-zA-Z0-9]/},S:{pattern:/[a-zA-Z]/}}};e.jMaskGlobals=e.jMaskGlobals||{},r=e.jMaskGlobals=e.extend(!0,{},r,e.jMaskGlobals),r.dataMask&&e.applyDataMask(),setInterval(function(){e.jMaskGlobals.watchDataMask&&e.applyDataMask()},r.watchInterval)}),function(){var e,t,n,i,r,o={}.hasOwnProperty,s=function(e,t){function n(){this.constructor=e}for(var i in t)o.call(t,i)&&(e[i]=t[i]);return n.prototype=t.prototype,e.prototype=new n,e.__super__=t.prototype,e};i=function(){function e(){this.options_index=0,this.parsed=[]}return e.prototype.add_node=function(e){return"OPTGROUP"===e.nodeName.toUpperCase()?this.add_group(e):this.add_option(e)},e.prototype.add_group=function(e){var t,n,i,r,o,s;for(t=this.parsed.length,this.parsed.push({array_index:t,group:!0,label:this.escapeExpression(e.label),title:e.title?e.title:void 0,children:0,disabled:e.disabled,classes:e.className}),o=e.childNodes,s=[],i=0,r=o.length;r>i;i++)n=o[i],s.push(this.add_option(n,t,e.disabled));return s},e.prototype.add_option=function(e,t,n){return"OPTION"===e.nodeName.toUpperCase()?(""!==e.text?(null!=t&&(this.parsed[t].children+=1),this.parsed.push({array_index:this.parsed.length,options_index:this.options_index,value:e.value,text:e.text,html:e.innerHTML,title:e.title?e.title:void 0,selected:e.selected,disabled:n===!0?n:e.disabled,group_array_index:t,group_label:null!=t?this.parsed[t].label:null,classes:e.className,style:e.style.cssText})):this.parsed.push({array_index:this.parsed.length,options_index:this.options_index,empty:!0}),this.options_index+=1):void 0},e.prototype.escapeExpression=function(e){var t,n;return null==e||e===!1?"":/[\&\<\>\"\'\`]/.test(e)?(t={"<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},n=/&(?!\w+;)|[\<\>\"\'\`]/g,e.replace(n,function(e){return t[e]||"&amp;"})):e},e}(),i.select_to_array=function(e){var t,n,r,o,s;for(n=new i,s=e.childNodes,r=0,o=s.length;o>r;r++)t=s[r],n.add_node(t);return n.parsed},t=function(){function e(t,n){this.form_field=t,this.options=null!=n?n:{},e.browser_is_supported()&&(this.is_multiple=this.form_field.multiple,this.set_default_text(),this.set_default_values(),this.setup(),this.set_up_html(),this.register_observers(),this.on_ready())}return e.prototype.set_default_values=function(){var e=this;return this.click_test_action=function(t){return e.test_active_click(t)},this.activate_action=function(t){return e.activate_field(t)},this.active_field=!1,this.mouse_on_container=!1,this.results_showing=!1,this.result_highlighted=null,this.allow_single_deselect=null!=this.options.allow_single_deselect&&null!=this.form_field.options[0]&&""===this.form_field.options[0].text&&this.options.allow_single_deselect,this.disable_search_threshold=this.options.disable_search_threshold||0,this.disable_search=this.options.disable_search||!1,this.enable_split_word_search=null==this.options.enable_split_word_search||this.options.enable_split_word_search,this.group_search=null==this.options.group_search||this.options.group_search,this.search_contains=this.options.search_contains||!1,this.single_backstroke_delete=null==this.options.single_backstroke_delete||this.options.single_backstroke_delete,this.max_selected_options=this.options.max_selected_options||1/0,this.inherit_select_classes=this.options.inherit_select_classes||!1,this.display_selected_options=null==this.options.display_selected_options||this.options.display_selected_options,this.display_disabled_options=null==this.options.display_disabled_options||this.options.display_disabled_options,this.include_group_label_in_selected=this.options.include_group_label_in_selected||!1,this.max_shown_results=this.options.max_shown_results||Number.POSITIVE_INFINITY},e.prototype.set_default_text=function(){return this.form_field.getAttribute("data-placeholder")?this.default_text=this.form_field.getAttribute("data-placeholder"):this.is_multiple?this.default_text=this.options.placeholder_text_multiple||this.options.placeholder_text||e.default_multiple_text:this.default_text=this.options.placeholder_text_single||this.options.placeholder_text||e.default_single_text,this.results_none_found=this.form_field.getAttribute("data-no_results_text")||this.options.no_results_text||e.default_no_result_text},e.prototype.choice_label=function(e){return this.include_group_label_in_selected&&null!=e.group_label?"<b class='group-name'>"+e.group_label+"</b>"+e.html:e.html},e.prototype.mouse_enter=function(){return this.mouse_on_container=!0},e.prototype.mouse_leave=function(){return this.mouse_on_container=!1},e.prototype.input_focus=function(e){var t=this;if(this.is_multiple){if(!this.active_field)return setTimeout(function(){return t.container_mousedown()},50)}else if(!this.active_field)return this.activate_field()},e.prototype.input_blur=function(e){var t=this;return this.mouse_on_container?void 0:(this.active_field=!1,setTimeout(function(){return t.blur_test()},100))},e.prototype.results_option_build=function(e){var t,n,i,r,o,s,a;for(t="",r=0,a=this.results_data,o=0,s=a.length;s>o&&(n=a[o],i="",i=n.group?this.result_add_group(n):this.result_add_option(n),""!==i&&(r++,t+=i),(null!=e?e.first:void 0)&&(n.selected&&this.is_multiple?this.choice_build(n):n.selected&&!this.is_multiple&&this.single_set_selected_text(this.choice_label(n))),!(r>=this.max_shown_results));o++);return t},e.prototype.result_add_option=function(e){var t,n;return e.search_match&&this.include_option_in_results(e)?(t=[],e.disabled||e.selected&&this.is_multiple||t.push("active-result"),!e.disabled||e.selected&&this.is_multiple||t.push("disabled-result"),e.selected&&t.push("result-selected"),null!=e.group_array_index&&t.push("group-option"),""!==e.classes&&t.push(e.classes),n=document.createElement("li"),n.className=t.join(" "),n.style.cssText=e.style,n.setAttribute("data-option-array-index",e.array_index),n.innerHTML=e.search_text,e.title&&(n.title=e.title),this.outerHTML(n)):""},e.prototype.result_add_group=function(e){var t,n;return(e.search_match||e.group_match)&&e.active_options>0?(t=[],t.push("group-result"),e.classes&&t.push(e.classes),n=document.createElement("li"),n.className=t.join(" "),n.innerHTML=e.search_text,e.title&&(n.title=e.title),this.outerHTML(n)):""},e.prototype.results_update_field=function(){return this.set_default_text(),this.is_multiple||this.results_reset_cleanup(),this.result_clear_highlight(),this.results_build(),this.results_showing?this.winnow_results():void 0},e.prototype.reset_single_select_options=function(){var e,t,n,i,r;for(i=this.results_data,r=[],t=0,n=i.length;n>t;t++)e=i[t],e.selected?r.push(e.selected=!1):r.push(void 0);return r},e.prototype.results_toggle=function(){return this.results_showing?this.results_hide():this.results_show()},e.prototype.results_search=function(e){return this.results_showing?this.winnow_results():this.results_show()},e.prototype.winnow_results=function(){var e,t,n,i,r,o,s,a,l,c,u,d;for(this.no_results_clear(),i=0,o=this.get_search_text(),e=o.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),l=new RegExp(e,"i"),n=this.get_search_regex(e),d=this.results_data,c=0,u=d.length;u>c;c++)t=d[c],t.search_match=!1,r=null,this.include_option_in_results(t)&&(t.group&&(t.group_match=!1,t.active_options=0),null!=t.group_array_index&&this.results_data[t.group_array_index]&&(r=this.results_data[t.group_array_index],0===r.active_options&&r.search_match&&(i+=1),r.active_options+=1),t.search_text=t.group?t.label:t.html,(!t.group||this.group_search)&&(t.search_match=this.search_string_match(t.search_text,n),t.search_match&&!t.group&&(i+=1),t.search_match?(o.length&&(s=t.search_text.search(l),a=t.search_text.substr(0,s+o.length)+"</em>"+t.search_text.substr(s+o.length),t.search_text=a.substr(0,s)+"<em>"+a.substr(s)),null!=r&&(r.group_match=!0)):null!=t.group_array_index&&this.results_data[t.group_array_index].search_match&&(t.search_match=!0)));return this.result_clear_highlight(),1>i&&o.length?(this.update_results_content(""),this.no_results(o)):(this.update_results_content(this.results_option_build()),this.winnow_results_set_highlight())},e.prototype.get_search_regex=function(e){var t;return t=this.search_contains?"":"^",new RegExp(t+e,"i")},e.prototype.search_string_match=function(e,t){var n,i,r,o;if(t.test(e))return!0;if(this.enable_split_word_search&&(e.indexOf(" ")>=0||0===e.indexOf("["))&&(i=e.replace(/\[|\]/g,"").split(" "),i.length))for(r=0,o=i.length;o>r;r++)if(n=i[r],t.test(n))return!0},e.prototype.choices_count=function(){var e,t,n,i;if(null!=this.selected_option_count)return this.selected_option_count;for(this.selected_option_count=0,i=this.form_field.options,t=0,n=i.length;n>t;t++)e=i[t],e.selected&&(this.selected_option_count+=1);return this.selected_option_count},e.prototype.choices_click=function(e){return e.preventDefault(),this.results_showing||this.is_disabled?void 0:this.results_show()},e.prototype.keyup_checker=function(e){var t,n;switch(t=null!=(n=e.which)?n:e.keyCode,this.search_field_scale(),t){case 8:if(this.is_multiple&&this.backstroke_length<1&&this.choices_count()>0)return this.keydown_backstroke();if(!this.pending_backstroke)return this.result_clear_highlight(),this.results_search();break;case 13:if(e.preventDefault(),this.results_showing)return this.result_select(e);break;case 27:return this.results_showing&&this.results_hide(),!0;case 9:case 38:case 40:case 16:case 91:case 17:case 18:break;default:return this.results_search()}},e.prototype.clipboard_event_checker=function(e){var t=this;return setTimeout(function(){return t.results_search()},50)},e.prototype.container_width=function(){return null!=this.options.width?this.options.width:""+this.form_field.offsetWidth+"px"},e.prototype.include_option_in_results=function(e){return!(this.is_multiple&&!this.display_selected_options&&e.selected)&&(!(!this.display_disabled_options&&e.disabled)&&!e.empty)},e.prototype.search_results_touchstart=function(e){return this.touch_started=!0,this.search_results_mouseover(e)},e.prototype.search_results_touchmove=function(e){return this.touch_started=!1,this.search_results_mouseout(e)},e.prototype.search_results_touchend=function(e){return this.touch_started?this.search_results_mouseup(e):void 0},e.prototype.outerHTML=function(e){var t;return e.outerHTML?e.outerHTML:(t=document.createElement("div"),t.appendChild(e),t.innerHTML)},e.browser_is_supported=function(){return!/iP(od|hone)/i.test(window.navigator.userAgent)&&((!/Android/i.test(window.navigator.userAgent)||!/Mobile/i.test(window.navigator.userAgent))&&(!/IEMobile/i.test(window.navigator.userAgent)&&(!/Windows Phone/i.test(window.navigator.userAgent)&&(!/BlackBerry/i.test(window.navigator.userAgent)&&(!/BB10/i.test(window.navigator.userAgent)&&("Microsoft Internet Explorer"!==window.navigator.appName||document.documentMode>=8))))))},e.default_multiple_text="Select Some Options",e.default_single_text="Select an Option",e.default_no_result_text="No results match",e}(),e=jQuery,e.fn.extend({chosen:function(i){return t.browser_is_supported()?this.each(function(t){var r,o;return r=e(this),o=r.data("chosen"),"destroy"===i?void(o instanceof n&&o.destroy()):void(o instanceof n||r.data("chosen",new n(this,i)))}):this}}),n=function(t){function n(){return r=n.__super__.constructor.apply(this,arguments)}return s(n,t),n.prototype.setup=function(){return this.form_field_jq=e(this.form_field),this.current_selectedIndex=this.form_field.selectedIndex,this.is_rtl=this.form_field_jq.hasClass("chosen-rtl")},n.prototype.set_up_html=function(){var t,n;return t=["chosen-container"],t.push("chosen-container-"+(this.is_multiple?"multi":"single")),this.inherit_select_classes&&this.form_field.className&&t.push(this.form_field.className),this.is_rtl&&t.push("chosen-rtl"),n={"class":t.join(" "),style:"width: "+this.container_width()+";",title:this.form_field.title},this.form_field.id.length&&(n.id=this.form_field.id.replace(/[^\w]/g,"_")+"_chosen"),this.container=e("<div />",n),this.is_multiple?this.container.html('<ul class="chosen-choices"><li class="search-field"><input type="text" value="'+this.default_text+'" class="default" autocomplete="off" style="width:25px;" /></li></ul><div class="chosen-drop"><ul class="chosen-results"></ul></div>'):this.container.html('<a class="chosen-single chosen-default"><span>'+this.default_text+'</span><div><b></b></div></a><div class="chosen-drop"><div class="chosen-search"><input type="text" autocomplete="off" /></div><ul class="chosen-results"></ul></div>'),this.form_field_jq.hide().after(this.container),this.dropdown=this.container.find("div.chosen-drop").first(),this.search_field=this.container.find("input").first(),this.search_results=this.container.find("ul.chosen-results").first(),this.search_field_scale(),this.search_no_results=this.container.find("li.no-results").first(),this.is_multiple?(this.search_choices=this.container.find("ul.chosen-choices").first(),this.search_container=this.container.find("li.search-field").first()):(this.search_container=this.container.find("div.chosen-search").first(),this.selected_item=this.container.find(".chosen-single").first()),this.results_build(),this.set_tab_index(),this.set_label_behavior()},n.prototype.on_ready=function(){return this.form_field_jq.trigger("chosen:ready",{chosen:this})},n.prototype.register_observers=function(){var e=this;return this.container.bind("touchstart.chosen",function(t){return e.container_mousedown(t),t.preventDefault()}),this.container.bind("touchend.chosen",function(t){return e.container_mouseup(t),t.preventDefault()}),this.container.bind("mousedown.chosen",function(t){e.container_mousedown(t)}),this.container.bind("mouseup.chosen",function(t){e.container_mouseup(t)}),this.container.bind("mouseenter.chosen",function(t){e.mouse_enter(t)}),this.container.bind("mouseleave.chosen",function(t){e.mouse_leave(t)}),this.search_results.bind("mouseup.chosen",function(t){e.search_results_mouseup(t)}),this.search_results.bind("mouseover.chosen",function(t){e.search_results_mouseover(t)}),this.search_results.bind("mouseout.chosen",function(t){e.search_results_mouseout(t)}),this.search_results.bind("mousewheel.chosen DOMMouseScroll.chosen",function(t){e.search_results_mousewheel(t)}),this.search_results.bind("touchstart.chosen",function(t){e.search_results_touchstart(t)}),this.search_results.bind("touchmove.chosen",function(t){e.search_results_touchmove(t)}),this.search_results.bind("touchend.chosen",function(t){e.search_results_touchend(t)}),this.form_field_jq.bind("chosen:updated.chosen",function(t){e.results_update_field(t)}),this.form_field_jq.bind("chosen:activate.chosen",function(t){e.activate_field(t)}),this.form_field_jq.bind("chosen:open.chosen",function(t){e.container_mousedown(t)}),this.form_field_jq.bind("chosen:close.chosen",function(t){e.input_blur(t)}),this.search_field.bind("blur.chosen",function(t){e.input_blur(t)}),this.search_field.bind("keyup.chosen",function(t){e.keyup_checker(t)}),this.search_field.bind("keydown.chosen",function(t){e.keydown_checker(t)}),this.search_field.bind("focus.chosen",function(t){e.input_focus(t)}),this.search_field.bind("cut.chosen",function(t){e.clipboard_event_checker(t)}),this.search_field.bind("paste.chosen",function(t){e.clipboard_event_checker(t)}),this.is_multiple?this.search_choices.bind("click.chosen",function(t){e.choices_click(t)}):this.container.bind("click.chosen",function(e){e.preventDefault()})},n.prototype.destroy=function(){return e(this.container[0].ownerDocument).unbind("click.chosen",this.click_test_action),this.search_field[0].tabIndex&&(this.form_field_jq[0].tabIndex=this.search_field[0].tabIndex),this.container.remove(),this.form_field_jq.removeData("chosen"),this.form_field_jq.show()},n.prototype.search_field_disabled=function(){return this.is_disabled=this.form_field_jq[0].disabled,this.is_disabled?(this.container.addClass("chosen-disabled"),this.search_field[0].disabled=!0,this.is_multiple||this.selected_item.unbind("focus.chosen",this.activate_action),this.close_field()):(this.container.removeClass("chosen-disabled"),this.search_field[0].disabled=!1,this.is_multiple?void 0:this.selected_item.bind("focus.chosen",this.activate_action))},n.prototype.container_mousedown=function(t){return this.is_disabled||(t&&"mousedown"===t.type&&!this.results_showing&&t.preventDefault(),null!=t&&e(t.target).hasClass("search-choice-close"))?void 0:(this.active_field?this.is_multiple||!t||e(t.target)[0]!==this.selected_item[0]&&!e(t.target).parents("a.chosen-single").length||(t.preventDefault(),this.results_toggle()):(this.is_multiple&&this.search_field.val(""),e(this.container[0].ownerDocument).bind("click.chosen",this.click_test_action),this.results_show()),this.activate_field())},n.prototype.container_mouseup=function(e){return"ABBR"!==e.target.nodeName||this.is_disabled?void 0:this.results_reset(e)},n.prototype.search_results_mousewheel=function(e){var t;return e.originalEvent&&(t=e.originalEvent.deltaY||-e.originalEvent.wheelDelta||e.originalEvent.detail),null!=t?(e.preventDefault(),"DOMMouseScroll"===e.type&&(t=40*t),this.search_results.scrollTop(t+this.search_results.scrollTop())):void 0},n.prototype.blur_test=function(e){return!this.active_field&&this.container.hasClass("chosen-container-active")?this.close_field():void 0},n.prototype.close_field=function(){return e(this.container[0].ownerDocument).unbind("click.chosen",this.click_test_action),this.active_field=!1,this.results_hide(),this.container.removeClass("chosen-container-active"),this.clear_backstroke(),this.show_search_field_default(),this.search_field_scale()},n.prototype.activate_field=function(){return this.container.addClass("chosen-container-active"),this.active_field=!0,this.search_field.val(this.search_field.val()),this.search_field.focus()},n.prototype.test_active_click=function(t){var n;return n=e(t.target).closest(".chosen-container"),n.length&&this.container[0]===n[0]?this.active_field=!0:this.close_field()},n.prototype.results_build=function(){return this.parsing=!0,this.selected_option_count=null,this.results_data=i.select_to_array(this.form_field),this.is_multiple?this.search_choices.find("li.search-choice").remove():this.is_multiple||(this.single_set_selected_text(),this.disable_search||this.form_field.options.length<=this.disable_search_threshold?(this.search_field[0].readOnly=!0,this.container.addClass("chosen-container-single-nosearch")):(this.search_field[0].readOnly=!1,this.container.removeClass("chosen-container-single-nosearch"))),this.update_results_content(this.results_option_build({first:!0})),this.search_field_disabled(),this.show_search_field_default(),this.search_field_scale(),this.parsing=!1},n.prototype.result_do_highlight=function(e){var t,n,i,r,o;if(e.length){if(this.result_clear_highlight(),this.result_highlight=e,this.result_highlight.addClass("highlighted"),i=parseInt(this.search_results.css("maxHeight"),10),o=this.search_results.scrollTop(),r=i+o,n=this.result_highlight.position().top+this.search_results.scrollTop(),t=n+this.result_highlight.outerHeight(),t>=r)return this.search_results.scrollTop(t-i>0?t-i:0);if(o>n)return this.search_results.scrollTop(n)}},n.prototype.result_clear_highlight=function(){return this.result_highlight&&this.result_highlight.removeClass("highlighted"),this.result_highlight=null},n.prototype.results_show=function(){return this.is_multiple&&this.max_selected_options<=this.choices_count()?(this.form_field_jq.trigger("chosen:maxselected",{chosen:this}),!1):(this.container.addClass("chosen-with-drop"),this.results_showing=!0,this.search_field.focus(),this.search_field.val(this.search_field.val()),this.winnow_results(),this.form_field_jq.trigger("chosen:showing_dropdown",{chosen:this}))},n.prototype.update_results_content=function(e){return this.search_results.html(e)},n.prototype.results_hide=function(){return this.results_showing&&(this.result_clear_highlight(),this.container.removeClass("chosen-with-drop"),this.form_field_jq.trigger("chosen:hiding_dropdown",{chosen:this})),this.results_showing=!1},n.prototype.set_tab_index=function(e){var t;return this.form_field.tabIndex?(t=this.form_field.tabIndex,this.form_field.tabIndex=-1,this.search_field[0].tabIndex=t):void 0},n.prototype.set_label_behavior=function(){var t=this;return this.form_field_label=this.form_field_jq.parents("label"),!this.form_field_label.length&&this.form_field.id.length&&(this.form_field_label=e("label[for='"+this.form_field.id+"']")),this.form_field_label.length>0?this.form_field_label.bind("click.chosen",function(e){return t.is_multiple?t.container_mousedown(e):t.activate_field()}):void 0},n.prototype.show_search_field_default=function(){return this.is_multiple&&this.choices_count()<1&&!this.active_field?(this.search_field.val(this.default_text),this.search_field.addClass("default")):(this.search_field.val(""),this.search_field.removeClass("default"))},n.prototype.search_results_mouseup=function(t){var n;return n=e(t.target).hasClass("active-result")?e(t.target):e(t.target).parents(".active-result").first(),n.length?(this.result_highlight=n,this.result_select(t),this.search_field.focus()):void 0},n.prototype.search_results_mouseover=function(t){var n;return n=e(t.target).hasClass("active-result")?e(t.target):e(t.target).parents(".active-result").first(),n?this.result_do_highlight(n):void 0},n.prototype.search_results_mouseout=function(t){return e(t.target).hasClass("active-result")?this.result_clear_highlight():void 0},n.prototype.choice_build=function(t){var n,i,r=this;return n=e("<li />",{"class":"search-choice"}).html("<span>"+this.choice_label(t)+"</span>"),t.disabled?n.addClass("search-choice-disabled"):(i=e("<a />",{"class":"search-choice-close","data-option-array-index":t.array_index}),i.bind("click.chosen",function(e){return r.choice_destroy_link_click(e)}),n.append(i)),this.search_container.before(n)},n.prototype.choice_destroy_link_click=function(t){return t.preventDefault(),t.stopPropagation(),this.is_disabled?void 0:this.choice_destroy(e(t.target))},n.prototype.choice_destroy=function(e){return this.result_deselect(e[0].getAttribute("data-option-array-index"))?(this.show_search_field_default(),this.is_multiple&&this.choices_count()>0&&this.search_field.val().length<1&&this.results_hide(),e.parents("li").first().remove(),this.search_field_scale()):void 0},n.prototype.results_reset=function(){return this.reset_single_select_options(),this.form_field.options[0].selected=!0,this.single_set_selected_text(),this.show_search_field_default(),this.results_reset_cleanup(),this.form_field_jq.trigger("change"),this.active_field?this.results_hide():void 0},n.prototype.results_reset_cleanup=function(){return this.current_selectedIndex=this.form_field.selectedIndex,this.selected_item.find("abbr").remove()},n.prototype.result_select=function(e){var t,n;return this.result_highlight?(t=this.result_highlight,this.result_clear_highlight(),this.is_multiple&&this.max_selected_options<=this.choices_count()?(this.form_field_jq.trigger("chosen:maxselected",{chosen:this}),!1):(this.is_multiple?t.removeClass("active-result"):this.reset_single_select_options(),t.addClass("result-selected"),n=this.results_data[t[0].getAttribute("data-option-array-index")],n.selected=!0,this.form_field.options[n.options_index].selected=!0,this.selected_option_count=null,this.is_multiple?this.choice_build(n):this.single_set_selected_text(this.choice_label(n)),(e.metaKey||e.ctrlKey)&&this.is_multiple||this.results_hide(),this.show_search_field_default(),(this.is_multiple||this.form_field.selectedIndex!==this.current_selectedIndex)&&this.form_field_jq.trigger("change",{selected:this.form_field.options[n.options_index].value}),this.current_selectedIndex=this.form_field.selectedIndex,e.preventDefault(),this.search_field_scale())):void 0},n.prototype.single_set_selected_text=function(e){return null==e&&(e=this.default_text),e===this.default_text?this.selected_item.addClass("chosen-default"):(this.single_deselect_control_build(),this.selected_item.removeClass("chosen-default")),this.selected_item.find("span").html(e)},n.prototype.result_deselect=function(e){var t;return t=this.results_data[e],!this.form_field.options[t.options_index].disabled&&(t.selected=!1,this.form_field.options[t.options_index].selected=!1,this.selected_option_count=null,this.result_clear_highlight(),this.results_showing&&this.winnow_results(),this.form_field_jq.trigger("change",{deselected:this.form_field.options[t.options_index].value}),this.search_field_scale(),!0)},n.prototype.single_deselect_control_build=function(){return this.allow_single_deselect?(this.selected_item.find("abbr").length||this.selected_item.find("span").first().after('<abbr class="search-choice-close"></abbr>'),this.selected_item.addClass("chosen-single-with-deselect")):void 0},n.prototype.get_search_text=function(){return e("<div/>").text(e.trim(this.search_field.val())).html()},n.prototype.winnow_results_set_highlight=function(){var e,t;return t=this.is_multiple?[]:this.search_results.find(".result-selected.active-result"),e=t.length?t.first():this.search_results.find(".active-result").first(),null!=e?this.result_do_highlight(e):void 0},n.prototype.no_results=function(t){var n;return n=e('<li class="no-results">'+this.results_none_found+' "<span></span>"</li>'),n.find("span").first().html(t),this.search_results.append(n),this.form_field_jq.trigger("chosen:no_results",{chosen:this})},n.prototype.no_results_clear=function(){return this.search_results.find(".no-results").remove()},n.prototype.keydown_arrow=function(){var e;return this.results_showing&&this.result_highlight?(e=this.result_highlight.nextAll("li.active-result").first())?this.result_do_highlight(e):void 0:this.results_show()},n.prototype.keyup_arrow=function(){var e;return this.results_showing||this.is_multiple?this.result_highlight?(e=this.result_highlight.prevAll("li.active-result"),e.length?this.result_do_highlight(e.first()):(this.choices_count()>0&&this.results_hide(),this.result_clear_highlight())):void 0:this.results_show()},n.prototype.keydown_backstroke=function(){var e;return this.pending_backstroke?(this.choice_destroy(this.pending_backstroke.find("a").first()),this.clear_backstroke()):(e=this.search_container.siblings("li.search-choice").last(),e.length&&!e.hasClass("search-choice-disabled")?(this.pending_backstroke=e,this.single_backstroke_delete?this.keydown_backstroke():this.pending_backstroke.addClass("search-choice-focus")):void 0)},n.prototype.clear_backstroke=function(){return this.pending_backstroke&&this.pending_backstroke.removeClass("search-choice-focus"),this.pending_backstroke=null},n.prototype.keydown_checker=function(e){var t,n;switch(t=null!=(n=e.which)?n:e.keyCode,this.search_field_scale(),8!==t&&this.pending_backstroke&&this.clear_backstroke(),t){case 8:this.backstroke_length=this.search_field.val().length;break;case 9:this.results_showing&&!this.is_multiple&&this.result_select(e),this.mouse_on_container=!1;break;case 13:this.results_showing&&e.preventDefault();break;case 32:this.disable_search&&e.preventDefault();break;case 38:e.preventDefault(),this.keyup_arrow();break;case 40:e.preventDefault(),this.keydown_arrow()}},n.prototype.search_field_scale=function(){var t,n,i,r,o,s,a,l,c;if(this.is_multiple){for(i=0,a=0,o="position:absolute; left: -1000px; top: -1000px; display:none;",s=["font-size","font-style","font-weight","font-family","line-height","text-transform","letter-spacing"],l=0,c=s.length;c>l;l++)r=s[l],o+=r+":"+this.search_field.css(r)+";";return t=e("<div />",{style:o}),t.text(this.search_field.val()),e("body").append(t),a=t.width()+25,t.remove(),n=this.container.outerWidth(),a>n-10&&(a=n-10),this.search_field.css({width:a+"px"})}},n}(t)}.call(this),!function(e,t,n){"use strict";function i(e){function t(t){return n.identifier&&t[n.identifier]===e[n.identifier]}var n=this;return!this.rows.contains(t)&&(this.rows.push(e),!0)}function r(t){var n=this.footer?this.footer.find(t):e(),i=this.header?this.header.find(t):e();return e.merge(n,i)}function o(t){return t?e.extend({},this.cachedParams,{ctx:t}):this.cachedParams}function s(){var t={current:this.current,rowCount:this.rowCount,sort:this.sortDictionary,searchPhrase:this.searchPhrase},n=this.options.post;return n=e.isFunction(n)?n():n,this.options.requestHandler(e.extend(!0,t,n))}function a(t){return"."+e.trim(t).replace(/\s+/gm,".")}function l(){var t=this.options.url;return e.isFunction(t)?t():t}function c(){this.element.trigger("initialize"+O),h.call(this),this.selection=this.options.selection&&null!=this.identifier,p.call(this),g.call(this),M.call(this),T.call(this),v.call(this),f.call(this),this.element.trigger("initialized"+O)}function u(e){this.options.highlightRows}function d(e){return e.visible}function h(){var t=this,n=this.element.find("thead > tr").first(),i=!1;n.children().each(function(){var n=e(this),r=n.data(),o={id:r.columnId,identifier:null==t.identifier&&r.identifier||!1,converter:t.options.converters[r.converter||r.type]||t.options.converters.string,text:n.text(),align:r.align||"left",headerAlign:r.headerAlign||"left",cssClass:r.cssClass||"",headerCssClass:r.headerCssClass||"",formatter:t.options.formatters[r.formatter]||null,order:i||"asc"!==r.order&&"desc"!==r.order?null:r.order,searchable:!(r.searchable===!1),sortable:!(r.sortable===!1),visible:!(r.visible===!1),visibleInSelection:!(r.visibleInSelection===!1),width:e.isNumeric(r.width)?r.width+"px":"string"==typeof r.width?r.width:null};t.columns.push(o),null!=o.order&&(t.sortDictionary[o.id]=o.order),o.identifier&&(t.identifier=o.id,t.converter=o.converter),t.options.multiSort||null===o.order||(i=!0)})}function f(){function n(e){for(var t,n=new RegExp(r.searchPhrase,r.options.caseSensitive?"g":"gi"),i=0;i<r.columns.length;i++)if(t=r.columns[i],t.searchable&&t.visible&&t.converter.to(e[t.id]).search(n)>-1)return!0;return!1}function i(e,t){r.currentRows=e,m.call(r,t),r.options.keepSelection||(r.selectedRows=[]),_.call(r,e),b.call(r),w.call(r),r.element._bgBusyAria(!1).trigger("loaded"+O)}var r=this;if(this.element._bgBusyAria(!0).trigger("load"+O),A.call(this),this.options.ajax){var o=s.call(this),a=l.call(this);if(null==a||"string"!=typeof a||0===a.length)throw new Error("Url setting must be a none empty string or a function that returns one.");this.xqr&&this.xqr.abort();var c={url:a,data:o,success:function(t){r.xqr=null,"string"==typeof t&&(t=e.parseJSON(t)),t=r.options.responseHandler(t),r.current=t.current,i(t.rows,t.total)},error:function(e,t,n){r.xqr=null,"abort"!==t&&(x.call(r),r.element._bgBusyAria(!1).trigger("loaded"+O))}};c=e.extend(this.options.ajaxSettings,c),this.xqr=e.ajax(c)}else{var u=this.searchPhrase.length>0?this.rows.where(n):this.rows,d=u.length;-1!==this.rowCount&&(u=u.page(this.current,this.rowCount)),t.setTimeout(function(){i(u,d)},10)}}function p(){if(!this.options.ajax){var t=this,n=this.element.find("tbody > tr");n.each(function(){var n=e(this),r=n.children("td"),o={};e.each(t.columns,function(e,t){o[t.id]=t.converter.from(r.eq(e).text())}),i.call(t,o)}),m.call(this,this.rows.length),$.call(this)}}function m(e){this.total=e,this.totalPages=-1===this.rowCount?1:Math.ceil(this.total/this.rowCount);
  }function g(){var t=this.options.templates,n=this.element.parent().hasClass(this.options.css.responsiveTable)?this.element.parent():this.element;this.element.addClass(this.options.css.table),0===this.element.children("tbody").length&&this.element.append(t.body),1&this.options.navigation&&(this.header=e(t.header.resolve(o.call(this,{id:this.element._bgId()+"-header"}))),n.before(this.header)),2&this.options.navigation&&(this.footer=e(t.footer.resolve(o.call(this,{id:this.element._bgId()+"-footer"}))),n.after(this.footer))}function v(){if(0!==this.options.navigation){var t=this.options.css,n=a(t.actions),i=r.call(this,n);if(i.length>0){var s=this,l=this.options.templates,c=e(l.actions.resolve(o.call(this)));if(this.options.ajax){var u=l.icon.resolve(o.call(this,{iconCss:t.iconRefresh})),d=e(l.actionButton.resolve(o.call(this,{content:u,text:this.options.labels.refresh}))).on("click"+O,function(e){e.stopPropagation(),s.current=1,f.call(s)});c.append(d)}k.call(this,c),y.call(this,c),L.call(this,i,c)}}}function y(t){if(this.options.columnSelection&&this.columns.length>1){var n=this,i=this.options.css,r=this.options.templates,s=r.icon.resolve(o.call(this,{iconCss:i.iconColumns})),l=e(r.actionDropDown.resolve(o.call(this,{content:s}))),c=a(i.dropDownItem),u=a(i.dropDownItemCheckbox),h=a(i.dropDownMenuItems);e.each(this.columns,function(t,s){if(s.visibleInSelection){var p=e(r.actionDropDownCheckboxItem.resolve(o.call(n,{name:s.id,label:s.text,checked:s.visible}))).on("click"+O,c,function(t){t.stopPropagation();var i=e(this),r=i.find(u);if(!r.prop("disabled")){s.visible=r.prop("checked");var o=n.columns.where(d).length>1;i.parents(h).find(c+":has("+u+":checked)")._bgEnableAria(o).find(u)._bgEnableField(o),n.element.find("tbody").empty(),M.call(n),f.call(n)}});l.find(a(i.dropDownMenuItems)).append(p)}}),t.append(l)}}function b(){if(0!==this.options.navigation){var t=a(this.options.css.infos),n=r.call(this,t);if(n.length>0){var i=this.current*this.rowCount,s=e(this.options.templates.infos.resolve(o.call(this,{end:0===this.total||-1===i||i>this.total?this.total:i,start:0===this.total?0:i-this.rowCount+1,total:this.total})));L.call(this,n,s)}}}function x(){var e=this.element.children("tbody").first(),t=this.options.templates,n=this.columns.where(d).length;this.selection&&(n+=1),e.html(t.noResults.resolve(o.call(this,{columns:n})))}function w(){if(0!==this.options.navigation){var t=a(this.options.css.pagination),n=r.call(this,t)._bgShowAria(-1!==this.rowCount);if(-1!==this.rowCount&&n.length>0){var i=this.options.templates,s=this.current,l=this.totalPages,c=e(i.pagination.resolve(o.call(this))),u=l-s,d=-1*(this.options.padding-s),h=u>=this.options.padding?Math.max(d,1):Math.max(d-this.options.padding+u,1),f=2*this.options.padding+1,p=l>=f?f:l;C.call(this,c,"first","&laquo;","first")._bgEnableAria(s>1),C.call(this,c,"prev","&lt;","prev")._bgEnableAria(s>1);for(var m=0;p>m;m++){var g=m+h;C.call(this,c,g,g,"page-"+g)._bgEnableAria()._bgSelectAria(g===s)}0===p&&C.call(this,c,1,1,"page-1")._bgEnableAria(!1)._bgSelectAria(),C.call(this,c,"next","&gt;","next")._bgEnableAria(l>s),C.call(this,c,"last","&raquo;","last")._bgEnableAria(l>s),L.call(this,n,c)}}}function C(t,n,i,r){var s=this,l=this.options.templates,c=this.options.css,u=o.call(this,{css:r,text:i,page:n}),d=e(l.paginationItem.resolve(u)).on("click"+O,a(c.paginationButton),function(t){t.stopPropagation(),t.preventDefault();var n=e(this),i=n.parent();if(!i.hasClass("active")&&!i.hasClass("disabled")){var r={first:1,prev:s.current-1,next:s.current+1,last:s.totalPages},o=n.data("page");s.current=r[o]||o,f.call(s)}n.trigger("blur")});return t.append(d),d}function k(t){function n(e){return-1===e?i.options.labels.all:e}var i=this,r=this.options.rowCount;if(e.isArray(r)){var s=this.options.css,l=this.options.templates,c=e(l.actionDropDown.resolve(o.call(this,{content:n(this.rowCount)}))),u=a(s.dropDownMenu),d=a(s.dropDownMenuText),h=a(s.dropDownMenuItems),p=a(s.dropDownItemButton);e.each(r,function(t,r){var s=e(l.actionDropDownItem.resolve(o.call(i,{text:n(r),action:r})))._bgSelectAria(r===i.rowCount).on("click"+O,p,function(t){t.preventDefault();var r=e(this),o=r.data("action");o!==i.rowCount&&(i.current=1,i.rowCount=o,r.parents(h).children().each(function(){var t=e(this),n=t.find(p).data("action");t._bgSelectAria(n===o)}),r.parents(u).find(d).text(n(o)),f.call(i))});c.find(h).append(s)}),t.append(c)}}function _(t){if(t.length>0){var n=this,i=this.options.css,r=this.options.templates,s=this.element.children("tbody").first(),l=!0,c="";e.each(t,function(t,s){var a="",u=' data-row-id="'+(null==n.identifier?t:s[n.identifier])+'"',d="";if(n.selection){var h=-1!==e.inArray(s[n.identifier],n.selectedRows),f=r.select.resolve(o.call(n,{type:"checkbox",value:s[n.identifier],checked:h}));a+=r.cell.resolve(o.call(n,{content:f,css:i.selectCell})),l=l&&h,h&&(d+=i.selected,u+=' aria-selected="true"')}var p=null!=s.status&&n.options.statusMapping[s.status];p&&(d+=p),e.each(n.columns,function(t,l){if(l.visible){var c=e.isFunction(l.formatter)?l.formatter.call(n,l,s):l.converter.to(s[l.id]),u=l.cssClass.length>0?" "+l.cssClass:"";a+=r.cell.resolve(o.call(n,{content:null==c||""===c?"&nbsp;":c,css:("right"===l.align?i.right:"center"===l.align?i.center:i.left)+u,style:null==l.width?"":"width:"+l.width+";"}))}}),d.length>0&&(u+=' class="'+d+'"'),c+=r.row.resolve(o.call(n,{attr:u,cells:a}))}),n.element.find("thead "+a(n.options.css.selectBox)).prop("checked",l),s.html(c),S.call(this,s)}else x.call(this)}function S(t){var n=this,i=a(this.options.css.selectBox);this.selection&&t.off("click"+O,i).on("click"+O,i,function(t){t.stopPropagation();var i=e(this),r=n.converter.from(i.val());i.prop("checked")?n.select([r]):n.deselect([r])}),t.off("click"+O,"> tr").on("click"+O,"> tr",function(t){t.stopPropagation();var i=e(this),r=null==n.identifier?i.data("row-id"):n.converter.from(i.data("row-id")+""),o=null==n.identifier?n.currentRows[r]:n.currentRows.first(function(e){return e[n.identifier]===r});n.selection&&n.options.rowSelect&&(i.hasClass(n.options.css.selected)?n.deselect([r]):n.select([r])),n.element.trigger("click"+O,[n.columns,o])})}function T(){if(0!==this.options.navigation){var n=this.options.css,i=a(n.search),s=r.call(this,i);if(s.length>0){var l=this,c=this.options.templates,u=null,d="",h=a(n.searchField),f=e(c.search.resolve(o.call(this))),p=f.is(h)?f:f.find(h);p.on("keyup"+O,function(n){n.stopPropagation();var i=e(this).val();(d!==i||13===n.which&&""!==i)&&(d=i,(13===n.which||0===i.length||i.length>=l.options.searchSettings.characters)&&(t.clearTimeout(u),u=t.setTimeout(function(){D.call(l,i)},l.options.searchSettings.delay)))}),L.call(this,s,f)}}}function D(e){this.searchPhrase!==e&&(this.current=1,this.searchPhrase=e,f.call(this))}function M(){var t=this,n=this.element.find("thead > tr"),i=this.options.css,r=this.options.templates,s="",l=this.options.sorting;if(this.selection){var c=this.options.multiSelect?r.select.resolve(o.call(t,{type:"checkbox",value:"all"})):"";s+=r.rawHeaderCell.resolve(o.call(t,{content:c,css:i.selectCell}))}if(e.each(this.columns,function(e,n){if(n.visible){var a=t.sortDictionary[n.id],c=l&&a&&"asc"===a?i.iconUp:l&&a&&"desc"===a?i.iconDown:"",u=r.icon.resolve(o.call(t,{iconCss:c})),d=n.headerAlign,h=n.headerCssClass.length>0?" "+n.headerCssClass:"";s+=r.headerCell.resolve(o.call(t,{column:n,icon:u,sortable:l&&n.sortable&&i.sortable||"",css:("right"===d?i.right:"center"===d?i.center:i.left)+h,style:null==n.width?"":"width:"+n.width+";"}))}}),n.html(s),l){var u=a(i.sortable);n.off("click"+O,u).on("click"+O,u,function(n){n.preventDefault(),E.call(t,e(this)),$.call(t),f.call(t)})}if(this.selection&&this.options.multiSelect){var d=a(i.selectBox);n.off("click"+O,d).on("click"+O,d,function(n){n.stopPropagation(),e(this).prop("checked")?t.select():t.deselect()})}}function E(e){var t=this.options.css,n=a(t.icon),i=e.data("column-id")||e.parents("th").first().data("column-id"),r=this.sortDictionary[i],o=e.find(n);if(this.options.multiSort||(e.parents("tr").first().find(n).removeClass(t.iconDown+" "+t.iconUp),this.sortDictionary={}),r&&"asc"===r)this.sortDictionary[i]="desc",o.removeClass(t.iconUp).addClass(t.iconDown);else if(r&&"desc"===r)if(this.options.multiSort){var s={};for(var l in this.sortDictionary)l!==i&&(s[l]=this.sortDictionary[l]);this.sortDictionary=s,o.removeClass(t.iconDown)}else this.sortDictionary[i]="asc",o.removeClass(t.iconDown).addClass(t.iconUp);else this.sortDictionary[i]="asc",o.addClass(t.iconUp)}function L(t,n){t.each(function(t,i){e(i).before(n.clone(!0)).remove()})}function A(){var e=this;t.setTimeout(function(){if("true"===e.element._bgAria("busy")){var t=e.options.templates,n=e.element.children("thead").first(),i=e.element.children("tbody").first(),r=i.find("tr > td").first(),s=e.element.height()-n.height()-(r.height()+20),a=e.columns.where(d).length;e.selection&&(a+=1),i.html(t.loading.resolve(o.call(e,{columns:a}))),-1!==e.rowCount&&s>0&&i.find("tr > td").css("padding","20px 0 "+s+"px")}},250)}function $(){function e(n,i,r){function o(e){return"asc"===a.order?e:-1*e}r=r||0;var s=r+1,a=t[r];return n[a.id]>i[a.id]?o(1):n[a.id]<i[a.id]?o(-1):t.length>s?e(n,i,s):0}var t=[];if(!this.options.ajax){for(var n in this.sortDictionary)(this.options.multiSort||0===t.length)&&t.push({id:n,order:this.sortDictionary[n]});t.length>0&&this.rows.sort(e)}}var O=".rs.jquery.bootgrid",N=function(t,n){this.element=e(t),this.origin=this.element.clone(),this.options=e.extend(!0,{},N.defaults,this.element.data(),n);var i=this.options.rowCount=this.element.data().rowCount||n.rowCount||this.options.rowCount;this.columns=[],this.current=1,this.currentRows=[],this.identifier=null,this.selection=!1,this.converter=null,this.rowCount=e.isArray(i)?i[0]:i,this.rows=[],this.searchPhrase="",this.selectedRows=[],this.sortDictionary={},this.total=0,this.totalPages=0,this.cachedParams={lbl:this.options.labels,css:this.options.css,ctx:{}},this.header=null,this.footer=null,this.xqr=null};if(N.defaults={navigation:3,padding:2,columnSelection:!0,rowCount:[10,25,50,-1],selection:!1,multiSelect:!1,rowSelect:!1,keepSelection:!1,highlightRows:!1,sorting:!0,multiSort:!1,searchSettings:{delay:250,characters:1},ajax:!1,ajaxSettings:{method:"POST"},post:{},url:"",caseSensitive:!0,requestHandler:function(e){return e},responseHandler:function(e){return e},converters:{numeric:{from:function(e){return+e},to:function(e){return e+""}},string:{from:function(e){return e},to:function(e){return e}}},css:{actions:"actions btn-group",center:"text-center",columnHeaderAnchor:"column-header-anchor",columnHeaderText:"text",dropDownItem:"dropdown-item",dropDownItemButton:"dropdown-item-button",dropDownItemCheckbox:"dropdown-item-checkbox",dropDownMenu:"dropdown btn-group",dropDownMenuItems:"dropdown-menu pull-right",dropDownMenuText:"dropdown-text",footer:"bootgrid-footer container-fluid",header:"bootgrid-header container-fluid",icon:"icon glyphicon",iconColumns:"glyphicon-th-list",iconDown:"glyphicon-chevron-down",iconRefresh:"glyphicon-refresh",iconSearch:"glyphicon-search",iconUp:"glyphicon-chevron-up",infos:"infos",left:"text-left",pagination:"pagination",paginationButton:"button",responsiveTable:"table-responsive",right:"text-right",search:"search form-group",searchField:"search-field form-control",selectBox:"select-box",selectCell:"select-cell",selected:"active",sortable:"sortable",table:"bootgrid-table table"},formatters:{},labels:{all:"All",infos:"Showing {{ctx.start}} to {{ctx.end}} of {{ctx.total}} entries",loading:"Loading...",noResults:"No results found!",refresh:"Refresh",search:"Search"},statusMapping:{0:"success",1:"info",2:"warning",3:"danger"},templates:{actionButton:'<button class="btn btn-default" type="button" title="{{ctx.text}}">{{ctx.content}}</button>',actionDropDown:'<div class="{{css.dropDownMenu}}"><button class="btn btn-default dropdown-toggle" type="button" data-toggle="dropdown"><span class="{{css.dropDownMenuText}}">{{ctx.content}}</span> <span class="caret"></span></button><ul class="{{css.dropDownMenuItems}}" role="menu"></ul></div>',actionDropDownItem:'<li><a data-action="{{ctx.action}}" class="{{css.dropDownItem}} {{css.dropDownItemButton}}">{{ctx.text}}</a></li>',actionDropDownCheckboxItem:'<li><label class="{{css.dropDownItem}}"><input name="{{ctx.name}}" type="checkbox" value="1" class="{{css.dropDownItemCheckbox}}" {{ctx.checked}} /> {{ctx.label}}</label></li>',actions:'<div class="{{css.actions}}"></div>',body:"<tbody></tbody>",cell:'<td class="{{ctx.css}}" style="{{ctx.style}}">{{ctx.content}}</td>',footer:'<div id="{{ctx.id}}" class="{{css.footer}}"><div class="row"><div class="col-sm-6"><p class="{{css.pagination}}"></p></div><div class="col-sm-6 infoBar"><p class="{{css.infos}}"></p></div></div></div>',header:'<div id="{{ctx.id}}" class="{{css.header}}"><div class="row"><div class="col-sm-12 actionBar"><p class="{{css.search}}"></p><p class="{{css.actions}}"></p></div></div></div>',headerCell:'<th data-column-id="{{ctx.column.id}}" class="{{ctx.css}}" style="{{ctx.style}}"><a href="javascript:void(0);" class="{{css.columnHeaderAnchor}} {{ctx.sortable}}"><span class="{{css.columnHeaderText}}">{{ctx.column.text}}</span>{{ctx.icon}}</a></th>',icon:'<span class="{{css.icon}} {{ctx.iconCss}}"></span>',infos:'<div class="{{css.infos}}">{{lbl.infos}}</div>',loading:'<tr><td colspan="{{ctx.columns}}" class="loading">{{lbl.loading}}</td></tr>',noResults:'<tr><td colspan="{{ctx.columns}}" class="no-results">{{lbl.noResults}}</td></tr>',pagination:'<ul class="{{css.pagination}}"></ul>',paginationItem:'<li class="{{ctx.css}}"><a data-page="{{ctx.page}}" class="{{css.paginationButton}}">{{ctx.text}}</a></li>',rawHeaderCell:'<th class="{{ctx.css}}">{{ctx.content}}</th>',row:"<tr{{ctx.attr}}>{{ctx.cells}}</tr>",search:'<div class="{{css.search}}"><div class="input-group"><span class="{{css.icon}} input-group-addon {{css.iconSearch}}"></span> <input type="text" class="{{css.searchField}}" placeholder="{{lbl.search}}" /></div></div>',select:'<input name="select" type="{{ctx.type}}" class="{{css.selectBox}}" value="{{ctx.value}}" {{ctx.checked}} />'}},N.prototype.append=function(e){if(this.options.ajax);else{for(var t=[],n=0;n<e.length;n++)i.call(this,e[n])&&t.push(e[n]);$.call(this),u.call(this,t),f.call(this),this.element.trigger("appended"+O,[t])}return this},N.prototype.clear=function(){if(this.options.ajax);else{var t=e.extend([],this.rows);this.rows=[],this.current=1,this.total=0,f.call(this),this.element.trigger("cleared"+O,[t])}return this},N.prototype.destroy=function(){return e(t).off(O),1&this.options.navigation&&this.header.remove(),2&this.options.navigation&&this.footer.remove(),this.element.before(this.origin).remove(),this},N.prototype.reload=function(){return this.current=1,f.call(this),this},N.prototype.remove=function(e){if(null!=this.identifier)if(this.options.ajax);else{e=e||this.selectedRows;for(var t,n=[],i=0;i<e.length;i++){t=e[i];for(var r=0;r<this.rows.length;r++)if(this.rows[r][this.identifier]===t){n.push(this.rows[r]),this.rows.splice(r,1);break}}this.current=1,f.call(this),this.element.trigger("removed"+O,[n])}return this},N.prototype.search=function(e){if(e=e||"",this.searchPhrase!==e){var t=a(this.options.css.searchField),n=r.call(this,t);n.val(e)}return D.call(this,e),this},N.prototype.select=function(t){if(this.selection){t=t||this.currentRows.propValues(this.identifier);for(var n,i,r=[];t.length>0&&(this.options.multiSelect||1!==r.length);)if(n=t.pop(),-1===e.inArray(n,this.selectedRows))for(i=0;i<this.currentRows.length;i++)if(this.currentRows[i][this.identifier]===n){r.push(this.currentRows[i]),this.selectedRows.push(n);break}if(r.length>0){var o=a(this.options.css.selectBox),s=this.selectedRows.length>=this.currentRows.length;for(i=0;!this.options.keepSelection&&s&&i<this.currentRows.length;)s=-1!==e.inArray(this.currentRows[i++][this.identifier],this.selectedRows);for(this.element.find("thead "+o).prop("checked",s),this.options.multiSelect||this.element.find("tbody > tr "+o+":checked").trigger("click"+O),i=0;i<this.selectedRows.length;i++)this.element.find('tbody > tr[data-row-id="'+this.selectedRows[i]+'"]').addClass(this.options.css.selected)._bgAria("selected","true").find(o).prop("checked",!0);this.element.trigger("selected"+O,[r])}}return this},N.prototype.deselect=function(t){if(this.selection){t=t||this.currentRows.propValues(this.identifier);for(var n,i,r,o=[];t.length>0;)if(n=t.pop(),r=e.inArray(n,this.selectedRows),-1!==r)for(i=0;i<this.currentRows.length;i++)if(this.currentRows[i][this.identifier]===n){o.push(this.currentRows[i]),this.selectedRows.splice(r,1);break}if(o.length>0){var s=a(this.options.css.selectBox);for(this.element.find("thead "+s).prop("checked",!1),i=0;i<o.length;i++)this.element.find('tbody > tr[data-row-id="'+o[i][this.identifier]+'"]').removeClass(this.options.css.selected)._bgAria("selected","false").find(s).prop("checked",!1);this.element.trigger("deselected"+O,[o])}}return this},N.prototype.sort=function(t){var n=t?e.extend({},t):{};return n===this.sortDictionary?this:(this.sortDictionary=n,M.call(this),$.call(this),f.call(this),this)},N.prototype.getColumnSettings=function(){return e.merge([],this.columns)},N.prototype.getCurrentPage=function(){return this.current},N.prototype.getCurrentRows=function(){return e.merge([],this.currentRows)},N.prototype.getRowCount=function(){return this.rowCount},N.prototype.getSearchPhrase=function(){return this.searchPhrase},N.prototype.getSelectedRows=function(){return e.merge([],this.selectedRows)},N.prototype.getSortDictionary=function(){return e.extend({},this.sortDictionary)},N.prototype.getTotalPageCount=function(){return this.totalPages},N.prototype.getTotalRowCount=function(){return this.total},e.fn.extend({_bgAria:function(e,t){return t?this.attr("aria-"+e,t):this.attr("aria-"+e)},_bgBusyAria:function(e){return null==e||e?this._bgAria("busy","true"):this._bgAria("busy","false")},_bgRemoveAria:function(e){return this.removeAttr("aria-"+e)},_bgEnableAria:function(e){return null==e||e?this.removeClass("disabled")._bgAria("disabled","false"):this.addClass("disabled")._bgAria("disabled","true")},_bgEnableField:function(e){return null==e||e?this.removeAttr("disabled"):this.attr("disabled","disable")},_bgShowAria:function(e){return null==e||e?this.show()._bgAria("hidden","false"):this.hide()._bgAria("hidden","true")},_bgSelectAria:function(e){return null==e||e?this.addClass("active")._bgAria("selected","true"):this.removeClass("active")._bgAria("selected","false")},_bgId:function(e){return e?this.attr("id",e):this.attr("id")}}),!String.prototype.resolve){var I={checked:function(e){return"boolean"==typeof e?e?'checked="checked"':"":e}};String.prototype.resolve=function(t,n){var i=this;return e.each(t,function(t,r){if(null!=r&&"function"!=typeof r)if("object"==typeof r){var o=n?e.extend([],n):[];o.push(t),i=i.resolve(r,o)+""}else{I&&I[t]&&"function"==typeof I[t]&&(r=I[t](r)),t=n?n.join(".")+"."+t:t;var s=new RegExp("\\{\\{"+t+"\\}\\}","gm");i=i.replace(s,r.replace?r.replace(/\$/gi,"&#36;"):r)}}),i}}Array.prototype.first||(Array.prototype.first=function(e){for(var t=0;t<this.length;t++){var n=this[t];if(e(n))return n}return null}),Array.prototype.contains||(Array.prototype.contains=function(e){for(var t=0;t<this.length;t++){var n=this[t];if(e(n))return!0}return!1}),Array.prototype.page||(Array.prototype.page=function(e,t){var n=(e-1)*t,i=n+t;return this.length>n?this.length>i?this.slice(n,i):this.slice(n):[]}),Array.prototype.where||(Array.prototype.where=function(e){for(var t=[],n=0;n<this.length;n++){var i=this[n];e(i)&&t.push(i)}return t}),Array.prototype.propValues||(Array.prototype.propValues=function(e){for(var t=[],n=0;n<this.length;n++)t.push(this[n][e]);return t});var R=e.fn.bootgrid;e.fn.bootgrid=function(t){var n=Array.prototype.slice.call(arguments,1),i=null,r=this.each(function(r){var o=e(this),s=o.data(O),a="object"==typeof t&&t;if((s||"destroy"!==t)&&(s||(o.data(O,s=new N(this,a)),c.call(s)),"string"==typeof t))if(0===t.indexOf("get")&&0===r)i=s[t].apply(s,n);else if(0!==t.indexOf("get"))return s[t].apply(s,n)});return"string"==typeof t&&0===t.indexOf("get")?i:r},e.fn.bootgrid.Constructor=N,e.fn.bootgrid.noConflict=function(){return e.fn.bootgrid=R,this},e('[data-toggle="bootgrid"]').bootgrid()}(jQuery,window),!function(e,t,n,i){"use strict";function r(t,i){if(this.el=t,this.$el=e(t),this.s=e.extend({},o,i),this.s.dynamic&&"undefined"!==this.s.dynamicEl&&this.s.dynamicEl.constructor===Array&&!this.s.dynamicEl.length)throw"When using dynamic mode, you must also define dynamicEl as an Array.";return this.modules={},this.lGalleryOn=!1,this.lgBusy=!1,this.hideBartimeout=!1,this.isTouch="ontouchstart"in n.documentElement,this.s.slideEndAnimatoin&&(this.s.hideControlOnEnd=!1),this.s.dynamic?this.$items=this.s.dynamicEl:"this"===this.s.selector?this.$items=this.$el:""!==this.s.selector?this.s.selectWithin?this.$items=e(this.s.selectWithin).find(this.s.selector):this.$items=this.$el.find(e(this.s.selector)):this.$items=this.$el.children(),this.$slide="",this.$outer="",this.init(),this}var o={mode:"lg-slide",cssEasing:"ease",easing:"linear",speed:600,height:"100%",width:"100%",addClass:"",startClass:"lg-start-zoom",backdropDuration:150,hideBarsDelay:6e3,useLeft:!1,closable:!0,loop:!0,escKey:!0,keyPress:!0,controls:!0,slideEndAnimatoin:!0,hideControlOnEnd:!1,mousewheel:!0,getCaptionFromTitleOrAlt:!0,appendSubHtmlTo:".lg-sub-html",preload:1,showAfterLoad:!0,selector:"",selectWithin:"",nextHtml:"",prevHtml:"",index:!1,iframeMaxWidth:"100%",download:!0,counter:!0,appendCounterTo:".lg-toolbar",swipeThreshold:50,enableSwipe:!0,enableDrag:!0,dynamic:!1,dynamicEl:[],galleryId:1};r.prototype.init=function(){var n=this;n.s.preload>n.$items.length&&(n.s.preload=n.$items.length);var i=t.location.hash;i.indexOf("lg="+this.s.galleryId)>0&&(n.index=parseInt(i.split("&slide=")[1],10),e("body").addClass("lg-from-hash"),e("body").hasClass("lg-on")||setTimeout(function(){n.build(n.index),e("body").addClass("lg-on")})),n.s.dynamic?(n.$el.trigger("onBeforeOpen.lg"),n.index=n.s.index||0,e("body").hasClass("lg-on")||setTimeout(function(){n.build(n.index),e("body").addClass("lg-on")})):n.$items.on("click.lgcustom",function(t){try{t.preventDefault(),t.preventDefault()}catch(i){t.returnValue=!1}n.$el.trigger("onBeforeOpen.lg"),n.index=n.s.index||n.$items.index(this),e("body").hasClass("lg-on")||(n.build(n.index),e("body").addClass("lg-on"))})},r.prototype.build=function(t){var n=this;n.structure(),e.each(e.fn.lightGallery.modules,function(t){n.modules[t]=new e.fn.lightGallery.modules[t](n.el)}),n.slide(t,!1,!1),n.s.keyPress&&n.keyPress(),n.$items.length>1&&(n.arrow(),setTimeout(function(){n.enableDrag(),n.enableSwipe()},50),n.s.mousewheel&&n.mousewheel()),n.counter(),n.closeGallery(),n.$el.trigger("onAfterOpen.lg"),n.$outer.on("mousemove.lg click.lg touchstart.lg",function(){n.$outer.removeClass("lg-hide-items"),clearTimeout(n.hideBartimeout),n.hideBartimeout=setTimeout(function(){n.$outer.addClass("lg-hide-items")},n.s.hideBarsDelay)})},r.prototype.structure=function(){var n,i="",r="",o=0,s="",a=this;for(e("body").append('<div class="lg-backdrop"></div>'),e(".lg-backdrop").css("transition-duration",this.s.backdropDuration+"ms"),o=0;o<this.$items.length;o++)i+='<div class="lg-item"></div>';if(this.s.controls&&this.$items.length>1&&(r='<div class="lg-actions"><div class="lg-prev lg-icon">'+this.s.prevHtml+'</div><div class="lg-next lg-icon">'+this.s.nextHtml+"</div></div>"),".lg-sub-html"===this.s.appendSubHtmlTo&&(s='<div class="lg-sub-html"></div>'),n='<div class="lg-outer '+this.s.addClass+" "+this.s.startClass+'"><div class="lg" style="width:'+this.s.width+"; height:"+this.s.height+'"><div class="lg-inner">'+i+'</div><div class="lg-toolbar group"><span class="lg-close lg-icon"></span></div>'+r+s+"</div></div>",e("body").append(n),this.$outer=e(".lg-outer"),this.$slide=this.$outer.find(".lg-item"),this.s.useLeft?(this.$outer.addClass("lg-use-left"),this.s.mode="lg-slide"):this.$outer.addClass("lg-use-css3"),a.setTop(),e(t).on("resize.lg orientationchange.lg",function(){setTimeout(function(){a.setTop()},100)}),this.$slide.eq(this.index).addClass("lg-current"),this.doCss()?this.$outer.addClass("lg-css3"):(this.$outer.addClass("lg-css"),this.s.speed=0),this.$outer.addClass(this.s.mode),this.s.enableDrag&&this.$items.length>1&&this.$outer.addClass("lg-grab"),this.s.showAfterLoad&&this.$outer.addClass("lg-show-after-load"),this.doCss()){var l=this.$outer.find(".lg-inner");l.css("transition-timing-function",this.s.cssEasing),l.css("transition-duration",this.s.speed+"ms")}e(".lg-backdrop").addClass("in"),setTimeout(function(){a.$outer.addClass("lg-visible")},this.s.backdropDuration),this.s.download&&this.$outer.find(".lg-toolbar").append('<a id="lg-download" target="_blank" download class="lg-download lg-icon"></a>'),this.prevScrollTop=e(t).scrollTop()},r.prototype.setTop=function(){if("100%"!==this.s.height){var n=e(t).height(),i=(n-parseInt(this.s.height,10))/2,r=this.$outer.find(".lg");n>=parseInt(this.s.height,10)?r.css("top",i+"px"):r.css("top","0px")}},r.prototype.doCss=function(){var e=function(){var e=["transition","MozTransition","WebkitTransition","OTransition","msTransition","KhtmlTransition"],t=n.documentElement,i=0;for(i=0;i<e.length;i++)if(e[i]in t.style)return!0};return!!e()},r.prototype.isVideo=function(e,t){var n;if(n=this.s.dynamic?this.s.dynamicEl[t].html:this.$items.eq(t).attr("data-html"),!e&&n)return{html5:!0};var i=e.match(/\/\/(?:www\.)?youtu(?:\.be|be\.com)\/(?:watch\?v=|embed\/)?([a-z0-9\-\_\%]+)/i),r=e.match(/\/\/(?:www\.)?vimeo.com\/([0-9a-z\-_]+)/i),o=e.match(/\/\/(?:www\.)?dai.ly\/([0-9a-z\-_]+)/i),s=e.match(/\/\/(?:www\.)?(?:vk\.com|vkontakte\.ru)\/(?:video_ext\.php\?)(.*)/i);return i?{youtube:i}:r?{vimeo:r}:o?{dailymotion:o}:s?{vk:s}:void 0},r.prototype.counter=function(){this.s.counter&&e(this.s.appendCounterTo).append('<div id="lg-counter"><span id="lg-counter-current">'+(parseInt(this.index,10)+1)+'</span> / <span id="lg-counter-all">'+this.$items.length+"</span></div>")},r.prototype.addHtml=function(t){var n,i=null;if(this.s.dynamic?this.s.dynamicEl[t].subHtmlUrl?n=this.s.dynamicEl[t].subHtmlUrl:i=this.s.dynamicEl[t].subHtml:this.$items.eq(t).attr("data-sub-html-url")?n=this.$items.eq(t).attr("data-sub-html-url"):(i=this.$items.eq(t).attr("data-sub-html"),this.s.getCaptionFromTitleOrAlt&&!i&&(i=this.$items.eq(t).attr("title")||this.$items.eq(t).find("img").first().attr("alt"))),!n)if("undefined"!=typeof i&&null!==i){var r=i.substring(0,1);"."!==r&&"#"!==r||(i=e(i).html())}else i="";".lg-sub-html"===this.s.appendSubHtmlTo?n?this.$outer.find(this.s.appendSubHtmlTo).load(n):this.$outer.find(this.s.appendSubHtmlTo).html(i):n?this.$slide.eq(t).load(n):this.$slide.eq(t).append(i),"undefined"!=typeof i&&null!==i&&(""===i?this.$outer.find(this.s.appendSubHtmlTo).addClass("lg-empty-html"):this.$outer.find(this.s.appendSubHtmlTo).removeClass("lg-empty-html")),this.$el.trigger("onAfterAppendSubHtml.lg",[t])},r.prototype.preload=function(e){var t=1,n=1;for(t=1;t<=this.s.preload&&!(t>=this.$items.length-e);t++)this.loadContent(e+t,!1,0);for(n=1;n<=this.s.preload&&!(0>e-n);n++)this.loadContent(e-n,!1,0)},r.prototype.loadContent=function(n,i,r){var o,s,a,l,c,u,d=this,h=!1,f=function(n){for(var i=[],r=[],o=0;o<n.length;o++){var a=n[o].split(" ");""===a[0]&&a.splice(0,1),r.push(a[0]),i.push(a[1])}for(var l=e(t).width(),c=0;c<i.length;c++)if(parseInt(i[c],10)>l){s=r[c];break}};if(d.s.dynamic){if(d.s.dynamicEl[n].poster&&(h=!0,a=d.s.dynamicEl[n].poster),u=d.s.dynamicEl[n].html,s=d.s.dynamicEl[n].src,d.s.dynamicEl[n].responsive){var p=d.s.dynamicEl[n].responsive.split(",");f(p)}l=d.s.dynamicEl[n].srcset,c=d.s.dynamicEl[n].sizes}else{if(d.$items.eq(n).attr("data-poster")&&(h=!0,a=d.$items.eq(n).attr("data-poster")),u=d.$items.eq(n).attr("data-html"),s=d.$items.eq(n).attr("href")||d.$items.eq(n).attr("data-src"),d.$items.eq(n).attr("data-responsive")){var m=d.$items.eq(n).attr("data-responsive").split(",");f(m)}l=d.$items.eq(n).attr("data-srcset"),c=d.$items.eq(n).attr("data-sizes")}var g=!1;d.s.dynamic?d.s.dynamicEl[n].iframe&&(g=!0):"true"===d.$items.eq(n).attr("data-iframe")&&(g=!0);var v=d.isVideo(s,n);if(!d.$slide.eq(n).hasClass("lg-loaded")){if(g)d.$slide.eq(n).prepend('<div class="lg-video-cont" style="max-width:'+d.s.iframeMaxWidth+'"><div class="lg-video"><iframe class="lg-object" frameborder="0" src="'+s+'"  allowfullscreen="true"></iframe></div></div>');else if(h){var y="";y=v&&v.youtube?"lg-has-youtube":v&&v.vimeo?"lg-has-vimeo":"lg-has-html5",d.$slide.eq(n).prepend('<div class="lg-video-cont '+y+' "><div class="lg-video"><span class="lg-video-play"></span><img class="lg-object lg-has-poster" src="'+a+'" /></div></div>')}else v?(d.$slide.eq(n).prepend('<div class="lg-video-cont "><div class="lg-video"></div></div>'),d.$el.trigger("hasVideo.lg",[n,s,u])):d.$slide.eq(n).prepend('<div class="lg-img-wrap"><img class="lg-object lg-image" src="'+s+'" /></div>');if(d.$el.trigger("onAferAppendSlide.lg",[n]),o=d.$slide.eq(n).find(".lg-object"),c&&o.attr("sizes",c),l){o.attr("srcset",l);try{picturefill({elements:[o[0]]})}catch(b){}}".lg-sub-html"!==this.s.appendSubHtmlTo&&d.addHtml(n),d.$slide.eq(n).addClass("lg-loaded")}d.$slide.eq(n).find(".lg-object").on("load.lg error.lg",function(){var t=0;r&&!e("body").hasClass("lg-from-hash")&&(t=r),setTimeout(function(){d.$slide.eq(n).addClass("lg-complete"),d.$el.trigger("onSlideItemLoad.lg",[n,r||0])},t)}),v&&v.html5&&!h&&d.$slide.eq(n).addClass("lg-complete"),i===!0&&(d.$slide.eq(n).hasClass("lg-complete")?d.preload(n):d.$slide.eq(n).find(".lg-object").on("load.lg error.lg",function(){d.preload(n)}))},r.prototype.slide=function(t,n,i){var r=this.$outer.find(".lg-current").index(),o=this;if(!o.lGalleryOn||r!==t){var s=this.$slide.length,a=o.lGalleryOn?this.s.speed:0,l=!1,c=!1;if(!o.lgBusy){if(this.s.download){var u;u=o.s.dynamic?o.s.dynamicEl[t].downloadUrl!==!1&&(o.s.dynamicEl[t].downloadUrl||o.s.dynamicEl[t].src):"false"!==o.$items.eq(t).attr("data-download-url")&&(o.$items.eq(t).attr("data-download-url")||o.$items.eq(t).attr("href")||o.$items.eq(t).attr("data-src")),u?(e("#lg-download").attr("href",u),o.$outer.removeClass("lg-hide-download")):o.$outer.addClass("lg-hide-download")}if(this.$el.trigger("onBeforeSlide.lg",[r,t,n,i]),o.lgBusy=!0,clearTimeout(o.hideBartimeout),".lg-sub-html"===this.s.appendSubHtmlTo&&setTimeout(function(){o.addHtml(t)},a),this.arrowDisable(t),n){var d=t-1,h=t+1;0===t&&r===s-1?(h=0,d=s-1):t===s-1&&0===r&&(h=0,d=s-1),this.$slide.removeClass("lg-prev-slide lg-current lg-next-slide"),o.$slide.eq(d).addClass("lg-prev-slide"),o.$slide.eq(h).addClass("lg-next-slide"),o.$slide.eq(t).addClass("lg-current")}else o.$outer.addClass("lg-no-trans"),this.$slide.removeClass("lg-prev-slide lg-next-slide"),r>t?(c=!0,0!==t||r!==s-1||i||(c=!1,l=!0)):t>r&&(l=!0,t!==s-1||0!==r||i||(c=!0,l=!1)),c?(this.$slide.eq(t).addClass("lg-prev-slide"),this.$slide.eq(r).addClass("lg-next-slide")):l&&(this.$slide.eq(t).addClass("lg-next-slide"),this.$slide.eq(r).addClass("lg-prev-slide")),setTimeout(function(){o.$slide.removeClass("lg-current"),o.$slide.eq(t).addClass("lg-current"),o.$outer.removeClass("lg-no-trans")},50);o.lGalleryOn?(setTimeout(function(){o.loadContent(t,!0,0)},this.s.speed+50),setTimeout(function(){o.lgBusy=!1,o.$el.trigger("onAfterSlide.lg",[r,t,n,i])},this.s.speed)):(o.loadContent(t,!0,o.s.backdropDuration),o.lgBusy=!1,o.$el.trigger("onAfterSlide.lg",[r,t,n,i])),o.lGalleryOn=!0,this.s.counter&&e("#lg-counter-current").text(t+1)}}},r.prototype.goToNextSlide=function(e){var t=this;t.lgBusy||(t.index+1<t.$slide.length?(t.index++,t.$el.trigger("onBeforeNextSlide.lg",[t.index]),t.slide(t.index,e,!1)):t.s.loop?(t.index=0,t.$el.trigger("onBeforeNextSlide.lg",[t.index]),t.slide(t.index,e,!1)):t.s.slideEndAnimatoin&&(t.$outer.addClass("lg-right-end"),setTimeout(function(){t.$outer.removeClass("lg-right-end");
  },400)))},r.prototype.goToPrevSlide=function(e){var t=this;t.lgBusy||(t.index>0?(t.index--,t.$el.trigger("onBeforePrevSlide.lg",[t.index,e]),t.slide(t.index,e,!1)):t.s.loop?(t.index=t.$items.length-1,t.$el.trigger("onBeforePrevSlide.lg",[t.index,e]),t.slide(t.index,e,!1)):t.s.slideEndAnimatoin&&(t.$outer.addClass("lg-left-end"),setTimeout(function(){t.$outer.removeClass("lg-left-end")},400)))},r.prototype.keyPress=function(){var n=this;this.$items.length>1&&e(t).on("keyup.lg",function(e){n.$items.length>1&&(37===e.keyCode&&(e.preventDefault(),n.goToPrevSlide()),39===e.keyCode&&(e.preventDefault(),n.goToNextSlide()))}),e(t).on("keydown.lg",function(e){n.s.escKey===!0&&27===e.keyCode&&(e.preventDefault(),n.$outer.hasClass("lg-thumb-open")?n.$outer.removeClass("lg-thumb-open"):n.destroy())})},r.prototype.arrow=function(){var e=this;this.$outer.find(".lg-prev").on("click.lg",function(){e.goToPrevSlide()}),this.$outer.find(".lg-next").on("click.lg",function(){e.goToNextSlide()})},r.prototype.arrowDisable=function(e){!this.s.loop&&this.s.hideControlOnEnd&&(e+1<this.$slide.length?this.$outer.find(".lg-next").removeAttr("disabled").removeClass("disabled"):this.$outer.find(".lg-next").attr("disabled","disabled").addClass("disabled"),e>0?this.$outer.find(".lg-prev").removeAttr("disabled").removeClass("disabled"):this.$outer.find(".lg-prev").attr("disabled","disabled").addClass("disabled"))},r.prototype.setTranslate=function(e,t,n){this.s.useLeft?e.css("left",t):e.css({transform:"translate3d("+t+"px, "+n+"px, 0px)"})},r.prototype.touchMove=function(t,n){var i=n-t;Math.abs(i)>15&&(this.$outer.addClass("lg-dragging"),this.setTranslate(this.$slide.eq(this.index),i,0),this.setTranslate(e(".lg-prev-slide"),-this.$slide.eq(this.index).width()+i,0),this.setTranslate(e(".lg-next-slide"),this.$slide.eq(this.index).width()+i,0))},r.prototype.touchEnd=function(e){var t=this;"lg-slide"!==t.s.mode&&t.$outer.addClass("lg-slide"),this.$slide.not(".lg-current, .lg-prev-slide, .lg-next-slide").css("opacity","0"),setTimeout(function(){t.$outer.removeClass("lg-dragging"),0>e&&Math.abs(e)>t.s.swipeThreshold?t.goToNextSlide(!0):e>0&&Math.abs(e)>t.s.swipeThreshold?t.goToPrevSlide(!0):Math.abs(e)<5&&t.$el.trigger("onSlideClick.lg"),t.$slide.removeAttr("style")}),setTimeout(function(){t.$outer.hasClass("lg-dragging")||"lg-slide"===t.s.mode||t.$outer.removeClass("lg-slide")},t.s.speed+100)},r.prototype.enableSwipe=function(){var e=this,t=0,n=0,i=!1;e.s.enableSwipe&&e.isTouch&&e.doCss()&&(e.$slide.on("touchstart.lg",function(n){e.$outer.hasClass("lg-zoomed")||e.lgBusy||(n.preventDefault(),e.manageSwipeClass(),t=n.originalEvent.targetTouches[0].pageX)}),e.$slide.on("touchmove.lg",function(r){e.$outer.hasClass("lg-zoomed")||(r.preventDefault(),n=r.originalEvent.targetTouches[0].pageX,e.touchMove(t,n),i=!0)}),e.$slide.on("touchend.lg",function(){e.$outer.hasClass("lg-zoomed")||(i?(i=!1,e.touchEnd(n-t)):e.$el.trigger("onSlideClick.lg"))}))},r.prototype.enableDrag=function(){var n=this,i=0,r=0,o=!1,s=!1;n.s.enableDrag&&!n.isTouch&&n.doCss()&&(n.$slide.on("mousedown.lg",function(t){n.$outer.hasClass("lg-zoomed")||(e(t.target).hasClass("lg-object")||e(t.target).hasClass("lg-video-play"))&&(t.preventDefault(),n.lgBusy||(n.manageSwipeClass(),i=t.pageX,o=!0,n.$outer.scrollLeft+=1,n.$outer.scrollLeft-=1,n.$outer.removeClass("lg-grab").addClass("lg-grabbing"),n.$el.trigger("onDragstart.lg")))}),e(t).on("mousemove.lg",function(e){o&&(s=!0,r=e.pageX,n.touchMove(i,r),n.$el.trigger("onDragmove.lg"))}),e(t).on("mouseup.lg",function(t){s?(s=!1,n.touchEnd(r-i),n.$el.trigger("onDragend.lg")):(e(t.target).hasClass("lg-object")||e(t.target).hasClass("lg-video-play"))&&n.$el.trigger("onSlideClick.lg"),o&&(o=!1,n.$outer.removeClass("lg-grabbing").addClass("lg-grab"))}))},r.prototype.manageSwipeClass=function(){var e=this.index+1,t=this.index-1,n=this.$slide.length;this.s.loop&&(0===this.index?t=n-1:this.index===n-1&&(e=0)),this.$slide.removeClass("lg-next-slide lg-prev-slide"),t>-1&&this.$slide.eq(t).addClass("lg-prev-slide"),this.$slide.eq(e).addClass("lg-next-slide")},r.prototype.mousewheel=function(){var e=this;e.$outer.on("mousewheel.lg",function(t){t.deltaY&&(t.deltaY>0?e.goToPrevSlide():e.goToNextSlide(),t.preventDefault())})},r.prototype.closeGallery=function(){var t=this,n=!1;this.$outer.find(".lg-close").on("click.lg",function(){t.destroy()}),t.s.closable&&(t.$outer.on("mousedown.lg",function(t){n=!!(e(t.target).is(".lg-outer")||e(t.target).is(".lg-item ")||e(t.target).is(".lg-img-wrap"))}),t.$outer.on("mouseup.lg",function(i){(e(i.target).is(".lg-outer")||e(i.target).is(".lg-item ")||e(i.target).is(".lg-img-wrap")&&n)&&(t.$outer.hasClass("lg-dragging")||t.destroy())}))},r.prototype.destroy=function(n){var i=this;n||i.$el.trigger("onBeforeClose.lg"),e(t).scrollTop(i.prevScrollTop),n&&(i.s.dynamic||this.$items.off("click.lg click.lgcustom"),e.removeData(i.el,"lightGallery")),this.$el.off(".lg.tm"),e.each(e.fn.lightGallery.modules,function(e){i.modules[e]&&i.modules[e].destroy()}),this.lGalleryOn=!1,clearTimeout(i.hideBartimeout),this.hideBartimeout=!1,e(t).off(".lg"),e("body").removeClass("lg-on lg-from-hash"),i.$outer&&i.$outer.removeClass("lg-visible"),e(".lg-backdrop").removeClass("in"),setTimeout(function(){i.$outer&&i.$outer.remove(),e(".lg-backdrop").remove(),n||i.$el.trigger("onCloseAfter.lg")},i.s.backdropDuration+50)},e.fn.lightGallery=function(t){return this.each(function(){if(e.data(this,"lightGallery"))try{e(this).data("lightGallery").init()}catch(n){}else e.data(this,"lightGallery",new r(this,t))})},e.fn.lightGallery.modules={}}(jQuery,window,document),!function(e,t){function n(t){var n=m(),i=n.querySelector("h2"),r=n.querySelector("p"),o=n.querySelector("button.cancel"),s=n.querySelector("button.confirm");if(i.innerHTML=x(t.title).split("\n").join("<br>"),r.innerHTML=x(t.text||"").split("\n").join("<br>"),t.text&&C(r),_(n.querySelectorAll(".icon")),t.type){for(var a=!1,l=0;l<f.length;l++)if(t.type===f[l]){a=!0;break}if(!a)return e.console.error("Unknown alert type: "+t.type),!1;var c=n.querySelector(".icon."+t.type);switch(C(c),t.type){case"success":y(c,"animate"),y(c.querySelector(".tip"),"animateSuccessTip"),y(c.querySelector(".long"),"animateSuccessLong");break;case"error":y(c,"animateErrorIcon"),y(c.querySelector(".x-mark"),"animateXMark");break;case"warning":y(c,"pulseWarning"),y(c.querySelector(".body"),"pulseWarningIns"),y(c.querySelector(".dot"),"pulseWarningIns")}}if(t.imageUrl){var u=n.querySelector(".icon.custom");u.style.backgroundImage="url("+t.imageUrl+")",C(u);var d=80,h=80;if(t.imageSize){var p=t.imageSize.split("x")[0],g=t.imageSize.split("x")[1];p&&g?(d=p,h=g,u.css({width:p+"px",height:g+"px"})):e.console.error("Parameter imageSize expects value with format WIDTHxHEIGHT, got "+t.imageSize)}u.setAttribute("style",u.getAttribute("style")+"width:"+d+"px; height:"+h+"px")}n.setAttribute("data-has-cancel-button",t.showCancelButton),t.showCancelButton?o.style.display="inline-block":_(o),n.setAttribute("data-has-confirm-button",t.showConfirmButton),t.showConfirmButton?s.style.display="inline-block":_(s),t.cancelButtonText&&(o.innerHTML=x(t.cancelButtonText)),t.confirmButtonText&&(s.innerHTML=x(t.confirmButtonText)),s.className="confirm btn btn-lg",y(n,t.containerClass),y(s,t.confirmButtonClass),y(o,t.cancelButtonClass),y(i,t.titleClass),y(r,t.textClass),n.setAttribute("data-allow-ouside-click",t.allowOutsideClick);var v=!!t.doneFunction;n.setAttribute("data-has-done-function",v),n.setAttribute("data-timer",t.timer)}function i(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e}function r(){var e=m();D(g(),10),C(e),y(e,"showSweetAlert"),b(e,"hideSweetAlert"),a=t.activeElement;var n=e.querySelector("button.confirm");n.focus(),setTimeout(function(){y(e,"visible")},500);var i=e.getAttribute("data-timer");"null"!==i&&""!==i&&setTimeout(function(){o()},i)}function o(){var n=m();M(g(),5),M(n,5),b(n,"showSweetAlert"),y(n,"hideSweetAlert"),b(n,"visible");var i=n.querySelector(".icon.success");b(i,"animate"),b(i.querySelector(".tip"),"animateSuccessTip"),b(i.querySelector(".long"),"animateSuccessLong");var r=n.querySelector(".icon.error");b(r,"animateErrorIcon"),b(r.querySelector(".x-mark"),"animateXMark");var o=n.querySelector(".icon.warning");b(o,"pulseWarning"),b(o.querySelector(".body"),"pulseWarningIns"),b(o.querySelector(".dot"),"pulseWarningIns"),e.onkeydown=c,t.onclick=l,a&&a.focus(),u=void 0}function s(){var e=m();e.style.marginTop=T(m())}var a,l,c,u,d=".sweet-alert",h=".sweet-overlay",f=["error","warning","info","success"],p={title:"",text:"",type:null,allowOutsideClick:!1,showCancelButton:!1,showConfirmButton:!0,closeOnConfirm:!0,closeOnCancel:!0,confirmButtonText:"OK",confirmButtonClass:"btn-primary",cancelButtonText:"Cancel",cancelButtonClass:"btn-default",containerClass:"",titleClass:"",textClass:"",imageUrl:null,imageSize:null,timer:null},m=function(){return t.querySelector(d)},g=function(){return t.querySelector(h)},v=function(e,t){return new RegExp(" "+t+" ").test(" "+e.className+" ")},y=function(e,t){t&&!v(e,t)&&(e.className+=" "+t)},b=function(e,t){var n=" "+e.className.replace(/[\t\r\n]/g," ")+" ";if(v(e,t)){for(;n.indexOf(" "+t+" ")>=0;)n=n.replace(" "+t+" "," ");e.className=n.replace(/^\s+|\s+$/g,"")}},x=function(e){var n=t.createElement("div");return n.appendChild(t.createTextNode(e)),n.innerHTML},w=function(e){e.style.opacity="",e.style.display="block"},C=function(e){if(e&&!e.length)return w(e);for(var t=0;t<e.length;++t)w(e[t])},k=function(e){e.style.opacity="",e.style.display="none"},_=function(e){if(e&&!e.length)return k(e);for(var t=0;t<e.length;++t)k(e[t])},S=function(e,t){for(var n=t.parentNode;null!==n;){if(n===e)return!0;n=n.parentNode}return!1},T=function(e){e.style.left="-9999px",e.style.display="block";var t=e.clientHeight,n=parseInt(getComputedStyle(e).getPropertyValue("padding"),10);return e.style.left="",e.style.display="none","-"+parseInt(t/2+n)+"px"},D=function(e,t){if(+e.style.opacity<1){t=t||16,e.style.opacity=0,e.style.display="block";var n=+new Date,i=function(){e.style.opacity=+e.style.opacity+(new Date-n)/100,n=+new Date,+e.style.opacity<1&&setTimeout(i,t)};i()}},M=function(e,t){t=t||16,e.style.opacity=1;var n=+new Date,i=function(){e.style.opacity=+e.style.opacity-(new Date-n)/100,n=+new Date,+e.style.opacity>0?setTimeout(i,t):e.style.display="none"};i()},E=function(n){if(MouseEvent){var i=new MouseEvent("click",{view:e,bubbles:!1,cancelable:!0});n.dispatchEvent(i)}else if(t.createEvent){var r=t.createEvent("MouseEvents");r.initEvent("click",!1,!1),n.dispatchEvent(r)}else t.createEventObject?n.fireEvent("onclick"):"function"==typeof n.onclick&&n.onclick()},L=function(t){"function"==typeof t.stopPropagation?(t.stopPropagation(),t.preventDefault()):e.event&&e.event.hasOwnProperty("cancelBubble")&&(e.event.cancelBubble=!0)};e.sweetAlertInitialize=function(){var e='<div class="sweet-overlay" tabIndex="-1"></div><div class="sweet-alert" tabIndex="-1"><div class="icon error"><span class="x-mark"><span class="line left"></span><span class="line right"></span></span></div><div class="icon warning"> <span class="body"></span> <span class="dot"></span> </div> <div class="icon info"></div> <div class="icon success"> <span class="line tip"></span> <span class="line long"></span> <div class="placeholder"></div> <div class="fix"></div> </div> <div class="icon custom"></div> <h2>Title</h2><p class="lead text-muted">Text</p><p><button class="cancel btn btn-lg" tabIndex="2">Cancel</button> <button class="confirm btn btn-lg" tabIndex="1">OK</button></p></div>',n=t.createElement("div");n.innerHTML=e,t.body.appendChild(n)},e.sweetAlert=e.swal=function(){function a(e){var t=e.keyCode||e.which;if(-1!==[9,13,32,27].indexOf(t)){for(var n=e.target||e.srcElement,i=-1,r=0;r<C.length;r++)if(n===C[r]){i=r;break}9===t?(n=-1===i?x:i===C.length-1?C[0]:C[i+1],L(e),n.focus()):(n=13===t||32===t?-1===i?x:void 0:27!==t||w.hidden||"none"===w.style.display?void 0:w,void 0!==n&&E(n,e))}}function d(e){var t=e.target||e.srcElement,n=e.relatedTarget,i=v(f,"visible");if(i){var r=-1;if(null!==n){for(var o=0;o<C.length;o++)if(n===C[o]){r=o;break}-1===r&&t.focus()}else u=t}}if(void 0===arguments[0])return e.console.error("sweetAlert expects at least 1 attribute!"),!1;var h=i({},p);switch(typeof arguments[0]){case"string":h.title=arguments[0],h.text=arguments[1]||"",h.type=arguments[2]||"";break;case"object":if(void 0===arguments[0].title)return e.console.error('Missing "title" argument!'),!1;h.title=arguments[0].title,h.text=arguments[0].text||p.text,h.type=arguments[0].type||p.type,h.allowOutsideClick=arguments[0].allowOutsideClick||p.allowOutsideClick,h.showCancelButton=void 0!==arguments[0].showCancelButton?arguments[0].showCancelButton:p.showCancelButton,h.showConfirmButton=void 0!==arguments[0].showConfirmButton?arguments[0].showConfirmButton:p.showConfirmButton,h.closeOnConfirm=void 0!==arguments[0].closeOnConfirm?arguments[0].closeOnConfirm:p.closeOnConfirm,h.closeOnCancel=void 0!==arguments[0].closeOnCancel?arguments[0].closeOnCancel:p.closeOnCancel,h.timer=arguments[0].timer||p.timer,h.confirmButtonText=p.showCancelButton?"Confirm":p.confirmButtonText,h.confirmButtonText=arguments[0].confirmButtonText||p.confirmButtonText,h.confirmButtonClass=arguments[0].confirmButtonClass||(arguments[0].type?"btn-"+arguments[0].type:null)||p.confirmButtonClass,h.cancelButtonText=arguments[0].cancelButtonText||p.cancelButtonText,h.cancelButtonClass=arguments[0].cancelButtonClass||p.cancelButtonClass,h.containerClass=arguments[0].containerClass||p.containerClass,h.titleClass=arguments[0].titleClass||p.titleClass,h.textClass=arguments[0].textClass||p.textClass,h.imageUrl=arguments[0].imageUrl||p.imageUrl,h.imageSize=arguments[0].imageSize||p.imageSize,h.doneFunction=arguments[1]||null;break;default:return e.console.error('Unexpected type of argument! Expected "string" or "object", got '+typeof arguments[0]),!1}n(h),s(),r();for(var f=m(),g=function(e){var t=e.target||e.srcElement,n=t.className.indexOf("confirm")>-1,i=v(f,"visible"),r=h.doneFunction&&"true"===f.getAttribute("data-has-done-function");switch(e.type){case"click":if(n&&r&&i)h.doneFunction(!0),h.closeOnConfirm&&o();else if(r&&i){var s=String(h.doneFunction).replace(/\s/g,""),a="function("===s.substring(0,9)&&")"!==s.substring(9,10);a&&h.doneFunction(!1),h.closeOnCancel&&o()}else o()}},y=f.querySelectorAll("button"),b=0;b<y.length;b++)y[b].onclick=g;l=t.onclick,t.onclick=function(e){var t=e.target||e.srcElement,n=f===t,i=S(f,e.target),r=v(f,"visible"),s="true"===f.getAttribute("data-allow-ouside-click");!n&&!i&&r&&s&&o()};var x=f.querySelector("button.confirm"),w=f.querySelector("button.cancel"),C=f.querySelectorAll("button:not([type=hidden])");c=e.onkeydown,e.onkeydown=a,x.onblur=d,w.onblur=d,e.onfocus=function(){e.setTimeout(function(){void 0!==u&&(u.focus(),u=void 0)},0)}},e.swal.setDefaults=function(e){if(!e)throw new Error("userParams is required");if("object"!=typeof e)throw new Error("userParams has to be a object");i(p,e)},e.swal.close=function(){o()},function(){"complete"===t.readyState||"interactive"===t.readyState&&t.body?sweetAlertInitialize():t.addEventListener?t.addEventListener("DOMContentLoaded",function e(){t.removeEventListener("DOMContentLoaded",e,!1),sweetAlertInitialize()},!1):t.attachEvent&&t.attachEvent("onreadystatechange",function n(){"complete"===t.readyState&&(t.detachEvent("onreadystatechange",n),sweetAlertInitialize())})}()}(window,document),function(e,t){"use strict";"function"==typeof define&&define.amd?define([],function(){return t.apply(e)}):"object"==typeof exports?module.exports=t.call(e):e.Waves=t.call(e)}("object"==typeof global?global:this,function(){"use strict";function e(e){return null!==e&&e===e.window}function t(t){return e(t)?t:9===t.nodeType&&t.defaultView}function n(e){var t=typeof e;return"function"===t||"object"===t&&!!e}function i(e){return n(e)&&e.nodeType>0}function r(e){var t=h.call(e);return"[object String]"===t?d(e):n(e)&&/^\[object (Array|HTMLCollection|NodeList|Object)\]$/.test(t)&&e.hasOwnProperty("length")?e:i(e)?[e]:[]}function o(e){var n,i,r={top:0,left:0},o=e&&e.ownerDocument;return n=o.documentElement,"undefined"!=typeof e.getBoundingClientRect&&(r=e.getBoundingClientRect()),i=t(o),{top:r.top+i.pageYOffset-n.clientTop,left:r.left+i.pageXOffset-n.clientLeft}}function s(e){var t="";for(var n in e)e.hasOwnProperty(n)&&(t+=n+":"+e[n]+";");return t}function a(e,t,n){if(n){n.classList.remove("waves-rippling");var i=n.getAttribute("data-x"),r=n.getAttribute("data-y"),o=n.getAttribute("data-scale"),a=n.getAttribute("data-translate"),l=Date.now()-Number(n.getAttribute("data-hold")),c=350-l;c<0&&(c=0),"mousemove"===e.type&&(c=150);var u="mousemove"===e.type?2500:p.duration;setTimeout(function(){var e={top:r+"px",left:i+"px",opacity:"0","-webkit-transition-duration":u+"ms","-moz-transition-duration":u+"ms","-o-transition-duration":u+"ms","transition-duration":u+"ms","-webkit-transform":o+" "+a,"-moz-transform":o+" "+a,"-ms-transform":o+" "+a,"-o-transform":o+" "+a,transform:o+" "+a};n.setAttribute("style",s(e)),setTimeout(function(){try{t.removeChild(n)}catch(e){return!1}},u)},c)}}function l(e){if(g.allowEvent(e)===!1)return null;for(var t=null,n=e.target||e.srcElement;null!==n.parentElement;){if(n.classList.contains("waves-effect")&&!(n instanceof SVGElement)){t=n;break}n=n.parentElement}return t}function c(e){var t=l(e);if(null!==t){if(t.disabled||t.getAttribute("disabled")||t.classList.contains("disabled"))return;if(g.registerEvent(e),"touchstart"===e.type&&p.delay){var n=!1,i=setTimeout(function(){i=null,p.show(e,t)},p.delay),r=function(r){i&&(clearTimeout(i),i=null,p.show(e,t)),n||(n=!0,p.hide(r,t))},o=function(e){i&&(clearTimeout(i),i=null),r(e)};t.addEventListener("touchmove",o,!1),t.addEventListener("touchend",r,!1),t.addEventListener("touchcancel",r,!1)}else p.show(e,t),f&&(t.addEventListener("touchend",p.hide,!1),t.addEventListener("touchcancel",p.hide,!1)),t.addEventListener("mouseup",p.hide,!1),t.addEventListener("mouseleave",p.hide,!1)}}var u=u||{},d=document.querySelectorAll.bind(document),h=Object.prototype.toString,f="ontouchstart"in window,p={duration:750,delay:200,show:function(e,t,n){if(2===e.button)return!1;t=t||this;var i=document.createElement("div");i.className="waves-ripple waves-rippling",t.appendChild(i);var r=o(t),a=0,l=0;"touches"in e&&e.touches.length?(a=e.touches[0].pageY-r.top,l=e.touches[0].pageX-r.left):(a=e.pageY-r.top,l=e.pageX-r.left),l=l>=0?l:0,a=a>=0?a:0;var c="scale("+t.clientWidth/100*3+")",u="translate(0,0)";n&&(u="translate("+n.x+"px, "+n.y+"px)"),i.setAttribute("data-hold",Date.now()),i.setAttribute("data-x",l),i.setAttribute("data-y",a),i.setAttribute("data-scale",c),i.setAttribute("data-translate",u);var d={top:a+"px",left:l+"px"};i.classList.add("waves-notransition"),i.setAttribute("style",s(d)),i.classList.remove("waves-notransition"),d["-webkit-transform"]=c+" "+u,d["-moz-transform"]=c+" "+u,d["-ms-transform"]=c+" "+u,d["-o-transform"]=c+" "+u,d.transform=c+" "+u,d.opacity="1";var h="mousemove"===e.type?2500:p.duration;d["-webkit-transition-duration"]=h+"ms",d["-moz-transition-duration"]=h+"ms",d["-o-transition-duration"]=h+"ms",d["transition-duration"]=h+"ms",i.setAttribute("style",s(d))},hide:function(e,t){t=t||this;for(var n=t.getElementsByClassName("waves-rippling"),i=0,r=n.length;i<r;i++)a(e,t,n[i])}},m={input:function(e){var t=e.parentNode;if("i"!==t.tagName.toLowerCase()||!t.classList.contains("waves-effect")){var n=document.createElement("i");n.className=e.className+" waves-input-wrapper",e.className="waves-button-input",t.replaceChild(n,e),n.appendChild(e);var i=window.getComputedStyle(e,null),r=i.color,o=i.backgroundColor;n.setAttribute("style","color:"+r+";background:"+o),e.setAttribute("style","background-color:rgba(0,0,0,0);")}},img:function(e){var t=e.parentNode;if("i"!==t.tagName.toLowerCase()||!t.classList.contains("waves-effect")){var n=document.createElement("i");t.replaceChild(n,e),n.appendChild(e)}}},g={touches:0,allowEvent:function(e){var t=!0;return/^(mousedown|mousemove)$/.test(e.type)&&g.touches&&(t=!1),t},registerEvent:function(e){var t=e.type;"touchstart"===t?g.touches+=1:/^(touchend|touchcancel)$/.test(t)&&setTimeout(function(){g.touches&&(g.touches-=1)},500)}};return u.init=function(e){var t=document.body;e=e||{},"duration"in e&&(p.duration=e.duration),"delay"in e&&(p.delay=e.delay),f&&(t.addEventListener("touchstart",c,!1),t.addEventListener("touchcancel",g.registerEvent,!1),t.addEventListener("touchend",g.registerEvent,!1)),t.addEventListener("mousedown",c,!1)},u.attach=function(e,t){e=r(e),"[object Array]"===h.call(t)&&(t=t.join(" ")),t=t?" "+t:"";for(var n,i,o=0,s=e.length;o<s;o++)n=e[o],i=n.tagName.toLowerCase(),["input","img"].indexOf(i)!==-1&&(m[i](n),n=n.parentElement),n.className.indexOf("waves-effect")===-1&&(n.className+=" waves-effect"+t)},u.ripple=function(e,t){e=r(e);var n=e.length;if(t=t||{},t.wait=t.wait||0,t.position=t.position||null,n)for(var i,s,a,l={},c=0,u={type:"mousedown",button:1},d=function(e,t){return function(){p.hide(e,t)}};c<n;c++)if(i=e[c],s=t.position||{x:i.clientWidth/2,y:i.clientHeight/2},a=o(i),l.x=a.left+s.x,l.y=a.top+s.y,u.pageX=l.x,u.pageY=l.y,p.show(u,i),t.wait>=0&&null!==t.wait){var h={type:"mouseup",button:1};setTimeout(d(h,i),t.wait)}},u.calm=function(e){e=r(e);for(var t={type:"mouseup",button:1},n=0,i=e.length;n<i;n++)p.hide(t,e[n])},u.displayEffect=function(e){u.init(e)},u}),function(e){"function"==typeof define&&define.amd?define(["jquery"],e):e(jQuery)}(function(e){e.extend(e.fn,{validate:function(t){if(!this.length)return void(t&&t.debug&&window.console);var n=e.data(this[0],"validator");return n?n:(this.attr("novalidate","novalidate"),n=new e.validator(t,this[0]),e.data(this[0],"validator",n),n.settings.onsubmit&&(this.on("click.validate",":submit",function(t){n.settings.submitHandler&&(n.submitButton=t.target),e(this).hasClass("cancel")&&(n.cancelSubmit=!0),void 0!==e(this).attr("formnovalidate")&&(n.cancelSubmit=!0)}),this.on("submit.validate",function(t){function i(){var i,r;return!n.settings.submitHandler||(n.submitButton&&(i=e("<input type='hidden'/>").attr("name",n.submitButton.name).val(e(n.submitButton).val()).appendTo(n.currentForm)),r=n.settings.submitHandler.call(n,n.currentForm,t),n.submitButton&&i.remove(),void 0!==r&&r)}return n.settings.debug&&t.preventDefault(),n.cancelSubmit?(n.cancelSubmit=!1,i()):n.form()?n.pendingRequest?(n.formSubmitted=!0,!1):i():(n.focusInvalid(),!1)})),n)},valid:function(){var t,n,i;return e(this[0]).is("form")?t=this.validate().form():(i=[],t=!0,n=e(this[0].form).validate(),this.each(function(){t=n.element(this)&&t,i=i.concat(n.errorList)}),n.errorList=i),t},rules:function(t,n){var i,r,o,s,a,l,c=this[0];if(t)switch(i=e.data(c.form,"validator").settings,r=i.rules,o=e.validator.staticRules(c),t){case"add":e.extend(o,e.validator.normalizeRule(n)),delete o.messages,r[c.name]=o,n.messages&&(i.messages[c.name]=e.extend(i.messages[c.name],n.messages));break;case"remove":return n?(l={},e.each(n.split(/\s/),function(t,n){l[n]=o[n],delete o[n],"required"===n&&e(c).removeAttr("aria-required")}),l):(delete r[c.name],o)}return s=e.validator.normalizeRules(e.extend({},e.validator.classRules(c),e.validator.attributeRules(c),e.validator.dataRules(c),e.validator.staticRules(c)),c),s.required&&(a=s.required,delete s.required,s=e.extend({required:a},s),e(c).attr("aria-required","true")),s.remote&&(a=s.remote,delete s.remote,s=e.extend(s,{remote:a})),s}}),e.extend(e.expr[":"],{blank:function(t){return!e.trim(""+e(t).val())},filled:function(t){return!!e.trim(""+e(t).val())},unchecked:function(t){return!e(t).prop("checked")}}),e.validator=function(t,n){this.settings=e.extend(!0,{},e.validator.defaults,t),this.currentForm=n,this.init()},e.validator.format=function(t,n){return 1===arguments.length?function(){var n=e.makeArray(arguments);return n.unshift(t),e.validator.format.apply(this,n)}:(arguments.length>2&&n.constructor!==Array&&(n=e.makeArray(arguments).slice(1)),n.constructor!==Array&&(n=[n]),e.each(n,function(e,n){t=t.replace(new RegExp("\\{"+e+"\\}","g"),function(){return n})}),t)},e.extend(e.validator,{defaults:{messages:{},groups:{},rules:{},errorClass:"error",validClass:"valid",errorElement:"label",focusCleanup:!1,focusInvalid:!0,errorContainer:e([]),errorLabelContainer:e([]),onsubmit:!0,ignore:":hidden",ignoreTitle:!1,onfocusin:function(e){this.lastActive=e,this.settings.focusCleanup&&(this.settings.unhighlight&&this.settings.unhighlight.call(this,e,this.settings.errorClass,this.settings.validClass),this.hideThese(this.errorsFor(e)))},onfocusout:function(e){this.checkable(e)||!(e.name in this.submitted)&&this.optional(e)||this.element(e)},onkeyup:function(t,n){var i=[16,17,18,20,35,36,37,38,39,40,45,144,225];9===n.which&&""===this.elementValue(t)||e.inArray(n.keyCode,i)!==-1||(t.name in this.submitted||t===this.lastElement)&&this.element(t)},onclick:function(e){e.name in this.submitted?this.element(e):e.parentNode.name in this.submitted&&this.element(e.parentNode)},highlight:function(t,n,i){"radio"===t.type?this.findByName(t.name).addClass(n).removeClass(i):e(t).addClass(n).removeClass(i)},unhighlight:function(t,n,i){"radio"===t.type?this.findByName(t.name).removeClass(n).addClass(i):e(t).removeClass(n).addClass(i)}},setDefaults:function(t){e.extend(e.validator.defaults,t)},messages:{required:"This field is required.",remote:"Please fix this field.",email:"Please enter a valid email address.",url:"Please enter a valid URL.",date:"Please enter a valid date.",dateISO:"Please enter a valid date ( ISO ).",number:"Please enter a valid number.",digits:"Please enter only digits.",creditcard:"Please enter a valid credit card number.",equalTo:"Please enter the same value again.",maxlength:e.validator.format("Please enter no more than {0} characters."),minlength:e.validator.format("Please enter at least {0} characters."),rangelength:e.validator.format("Please enter a value between {0} and {1} characters long."),range:e.validator.format("Please enter a value between {0} and {1}."),max:e.validator.format("Please enter a value less than or equal to {0}."),min:e.validator.format("Please enter a value greater than or equal to {0}.")},autoCreateRanges:!1,prototype:{init:function(){function t(t){var n=e.data(this.form,"validator"),i="on"+t.type.replace(/^validate/,""),r=n.settings;r[i]&&!e(this).is(r.ignore)&&r[i].call(n,this,t)}this.labelContainer=e(this.settings.errorLabelContainer),this.errorContext=this.labelContainer.length&&this.labelContainer||e(this.currentForm),this.containers=e(this.settings.errorContainer).add(this.settings.errorLabelContainer),this.submitted={},this.valueCache={},this.pendingRequest=0,this.pending={},this.invalid={},this.reset();var n,i=this.groups={};e.each(this.settings.groups,function(t,n){"string"==typeof n&&(n=n.split(/\s/)),e.each(n,function(e,n){i[n]=t})}),n=this.settings.rules,e.each(n,function(t,i){n[t]=e.validator.normalizeRule(i)}),e(this.currentForm).on("focusin.validate focusout.validate keyup.validate",":text, [type='password'], [type='file'], select, textarea, [type='number'], [type='search'], [type='tel'], [type='url'], [type='email'], [type='datetime'], [type='date'], [type='month'], [type='week'], [type='time'], [type='datetime-local'], [type='range'], [type='color'], [type='radio'], [type='checkbox']",t).on("click.validate","select, option, [type='radio'], [type='checkbox']",t),this.settings.invalidHandler&&e(this.currentForm).on("invalid-form.validate",this.settings.invalidHandler),e(this.currentForm).find("[required], [data-rule-required], .required").attr("aria-required","true")},form:function(){return this.checkForm(),e.extend(this.submitted,this.errorMap),this.invalid=e.extend({},this.errorMap),this.valid()||e(this.currentForm).triggerHandler("invalid-form",[this]),this.showErrors(),this.valid()},checkForm:function(){this.prepareForm();for(var e=0,t=this.currentElements=this.elements();t[e];e++)this.check(t[e]);return this.valid()},element:function(t){var n=this.clean(t),i=this.validationTargetFor(n),r=!0;return this.lastElement=i,void 0===i?delete this.invalid[n.name]:(this.prepareElement(i),this.currentElements=e(i),r=this.check(i)!==!1,r?delete this.invalid[i.name]:this.invalid[i.name]=!0),e(t).attr("aria-invalid",!r),this.numberOfInvalids()||(this.toHide=this.toHide.add(this.containers)),this.showErrors(),r},showErrors:function(t){if(t){e.extend(this.errorMap,t),this.errorList=[];for(var n in t)this.errorList.push({message:t[n],element:this.findByName(n)[0]});this.successList=e.grep(this.successList,function(e){return!(e.name in t)})}this.settings.showErrors?this.settings.showErrors.call(this,this.errorMap,this.errorList):this.defaultShowErrors()},resetForm:function(){e.fn.resetForm&&e(this.currentForm).resetForm(),this.submitted={},this.lastElement=null,this.prepareForm(),this.hideErrors();var t,n=this.elements().removeData("previousValue").removeAttr("aria-invalid");if(this.settings.unhighlight)for(t=0;n[t];t++)this.settings.unhighlight.call(this,n[t],this.settings.errorClass,"");else n.removeClass(this.settings.errorClass)},numberOfInvalids:function(){return this.objectLength(this.invalid)},objectLength:function(e){var t,n=0;for(t in e)n++;return n},hideErrors:function(){this.hideThese(this.toHide)},hideThese:function(e){e.not(this.containers).text(""),this.addWrapper(e).hide()},valid:function(){return 0===this.size()},size:function(){return this.errorList.length},focusInvalid:function(){if(this.settings.focusInvalid)try{e(this.findLastActive()||this.errorList.length&&this.errorList[0].element||[]).filter(":visible").focus().trigger("focusin")}catch(t){}},findLastActive:function(){var t=this.lastActive;return t&&1===e.grep(this.errorList,function(e){return e.element.name===t.name}).length&&t},elements:function(){var t=this,n={};return e(this.currentForm).find("input, select, textarea").not(":submit, :reset, :image, :disabled").not(this.settings.ignore).filter(function(){return!this.name&&t.settings.debug&&window.console,!(this.name in n||!t.objectLength(e(this).rules()))&&(n[this.name]=!0,!0)})},clean:function(t){return e(t)[0]},errors:function(){var t=this.settings.errorClass.split(" ").join(".");return e(this.settings.errorElement+"."+t,this.errorContext)},reset:function(){this.successList=[],this.errorList=[],this.errorMap={},this.toShow=e([]),this.toHide=e([]),this.currentElements=e([])},prepareForm:function(){this.reset(),this.toHide=this.errors().add(this.containers)},prepareElement:function(e){this.reset(),this.toHide=this.errorsFor(e)},elementValue:function(t){var n,i=e(t),r=t.type;return"radio"===r||"checkbox"===r?this.findByName(t.name).filter(":checked").val():"number"===r&&"undefined"!=typeof t.validity?!t.validity.badInput&&i.val():(n=i.val(),"string"==typeof n?n.replace(/\r/g,""):n)},check:function(t){t=this.validationTargetFor(this.clean(t));var n,i,r,o=e(t).rules(),s=e.map(o,function(e,t){return t}).length,a=!1,l=this.elementValue(t);for(i in o){r={method:i,parameters:o[i]};try{if(n=e.validator.methods[i].call(this,l,t,r.parameters),"dependency-mismatch"===n&&1===s){a=!0;continue}if(a=!1,"pending"===n)return void(this.toHide=this.toHide.not(this.errorsFor(t)));if(!n)return this.formatAndAdd(t,r),!1}catch(c){throw this.settings.debug&&window.console,c instanceof TypeError&&(c.message+=".  Exception occurred when checking element "+t.id+", check the '"+r.method+"' method."),c}}if(!a)return this.objectLength(o)&&this.successList.push(t),!0},customDataMessage:function(t,n){return e(t).data("msg"+n.charAt(0).toUpperCase()+n.substring(1).toLowerCase())||e(t).data("msg")},customMessage:function(e,t){var n=this.settings.messages[e];return n&&(n.constructor===String?n:n[t])},findDefined:function(){for(var e=0;e<arguments.length;e++)if(void 0!==arguments[e])return arguments[e]},defaultMessage:function(t,n){return this.findDefined(this.customMessage(t.name,n),this.customDataMessage(t,n),!this.settings.ignoreTitle&&t.title||void 0,e.validator.messages[n],"<strong>Warning: No message defined for "+t.name+"</strong>");
  },formatAndAdd:function(t,n){var i=this.defaultMessage(t,n.method),r=/\$?\{(\d+)\}/g;"function"==typeof i?i=i.call(this,n.parameters,t):r.test(i)&&(i=e.validator.format(i.replace(r,"{$1}"),n.parameters)),this.errorList.push({message:i,element:t,method:n.method}),this.errorMap[t.name]=i,this.submitted[t.name]=i},addWrapper:function(e){return this.settings.wrapper&&(e=e.add(e.parent(this.settings.wrapper))),e},defaultShowErrors:function(){var e,t,n;for(e=0;this.errorList[e];e++)n=this.errorList[e],this.settings.highlight&&this.settings.highlight.call(this,n.element,this.settings.errorClass,this.settings.validClass),this.showLabel(n.element,n.message);if(this.errorList.length&&(this.toShow=this.toShow.add(this.containers)),this.settings.success)for(e=0;this.successList[e];e++)this.showLabel(this.successList[e]);if(this.settings.unhighlight)for(e=0,t=this.validElements();t[e];e++)this.settings.unhighlight.call(this,t[e],this.settings.errorClass,this.settings.validClass);this.toHide=this.toHide.not(this.toShow),this.hideErrors(),this.addWrapper(this.toShow).show()},validElements:function(){return this.currentElements.not(this.invalidElements())},invalidElements:function(){return e(this.errorList).map(function(){return this.element})},showLabel:function(t,n){var i,r,o,s=this.errorsFor(t),a=this.idOrName(t),l=e(t).attr("aria-describedby");s.length?(s.removeClass(this.settings.validClass).addClass(this.settings.errorClass),s.html(n)):(s=e("<"+this.settings.errorElement+">").attr("id",a+"-error").addClass(this.settings.errorClass).html(n||""),i=s,this.settings.wrapper&&(i=s.hide().show().wrap("<"+this.settings.wrapper+"/>").parent()),this.labelContainer.length?this.labelContainer.append(i):this.settings.errorPlacement?this.settings.errorPlacement(i,e(t)):i.insertAfter(t),s.is("label")?s.attr("for",a):0===s.parents("label[for='"+a+"']").length&&(o=s.attr("id").replace(/(:|\.|\[|\]|\$)/g,"\\$1"),l?l.match(new RegExp("\\b"+o+"\\b"))||(l+=" "+o):l=o,e(t).attr("aria-describedby",l),r=this.groups[t.name],r&&e.each(this.groups,function(t,n){n===r&&e("[name='"+t+"']",this.currentForm).attr("aria-describedby",s.attr("id"))}))),!n&&this.settings.success&&(s.text(""),"string"==typeof this.settings.success?s.addClass(this.settings.success):this.settings.success(s,t)),this.toShow=this.toShow.add(s)},errorsFor:function(t){var n=this.idOrName(t),i=e(t).attr("aria-describedby"),r="label[for='"+n+"'], label[for='"+n+"'] *";return i&&(r=r+", #"+i.replace(/\s+/g,", #")),this.errors().filter(r)},idOrName:function(e){return this.groups[e.name]||(this.checkable(e)?e.name:e.id||e.name)},validationTargetFor:function(t){return this.checkable(t)&&(t=this.findByName(t.name)),e(t).not(this.settings.ignore)[0]},checkable:function(e){return/radio|checkbox/i.test(e.type)},findByName:function(t){return e(this.currentForm).find("[name='"+t+"']")},getLength:function(t,n){switch(n.nodeName.toLowerCase()){case"select":return e("option:selected",n).length;case"input":if(this.checkable(n))return this.findByName(n.name).filter(":checked").length}return t.length},depend:function(e,t){return!this.dependTypes[typeof e]||this.dependTypes[typeof e](e,t)},dependTypes:{"boolean":function(e){return e},string:function(t,n){return!!e(t,n.form).length},"function":function(e,t){return e(t)}},optional:function(t){var n=this.elementValue(t);return!e.validator.methods.required.call(this,n,t)&&"dependency-mismatch"},startRequest:function(e){this.pending[e.name]||(this.pendingRequest++,this.pending[e.name]=!0)},stopRequest:function(t,n){this.pendingRequest--,this.pendingRequest<0&&(this.pendingRequest=0),delete this.pending[t.name],n&&0===this.pendingRequest&&this.formSubmitted&&this.form()?(e(this.currentForm).submit(),this.formSubmitted=!1):!n&&0===this.pendingRequest&&this.formSubmitted&&(e(this.currentForm).triggerHandler("invalid-form",[this]),this.formSubmitted=!1)},previousValue:function(t){return e.data(t,"previousValue")||e.data(t,"previousValue",{old:null,valid:!0,message:this.defaultMessage(t,"remote")})},destroy:function(){this.resetForm(),e(this.currentForm).off(".validate").removeData("validator")}},classRuleSettings:{required:{required:!0},email:{email:!0},url:{url:!0},date:{date:!0},dateISO:{dateISO:!0},number:{number:!0},digits:{digits:!0},creditcard:{creditcard:!0}},addClassRules:function(t,n){t.constructor===String?this.classRuleSettings[t]=n:e.extend(this.classRuleSettings,t)},classRules:function(t){var n={},i=e(t).attr("class");return i&&e.each(i.split(" "),function(){this in e.validator.classRuleSettings&&e.extend(n,e.validator.classRuleSettings[this])}),n},normalizeAttributeRule:function(e,t,n,i){/min|max/.test(n)&&(null===t||/number|range|text/.test(t))&&(i=Number(i),isNaN(i)&&(i=void 0)),i||0===i?e[n]=i:t===n&&"range"!==t&&(e[n]=!0)},attributeRules:function(t){var n,i,r={},o=e(t),s=t.getAttribute("type");for(n in e.validator.methods)"required"===n?(i=t.getAttribute(n),""===i&&(i=!0),i=!!i):i=o.attr(n),this.normalizeAttributeRule(r,s,n,i);return r.maxlength&&/-1|2147483647|524288/.test(r.maxlength)&&delete r.maxlength,r},dataRules:function(t){var n,i,r={},o=e(t),s=t.getAttribute("type");for(n in e.validator.methods)i=o.data("rule"+n.charAt(0).toUpperCase()+n.substring(1).toLowerCase()),this.normalizeAttributeRule(r,s,n,i);return r},staticRules:function(t){var n={},i=e.data(t.form,"validator");return i.settings.rules&&(n=e.validator.normalizeRule(i.settings.rules[t.name])||{}),n},normalizeRules:function(t,n){return e.each(t,function(i,r){if(r===!1)return void delete t[i];if(r.param||r.depends){var o=!0;switch(typeof r.depends){case"string":o=!!e(r.depends,n.form).length;break;case"function":o=r.depends.call(n,n)}o?t[i]=void 0===r.param||r.param:delete t[i]}}),e.each(t,function(i,r){t[i]=e.isFunction(r)?r(n):r}),e.each(["minlength","maxlength"],function(){t[this]&&(t[this]=Number(t[this]))}),e.each(["rangelength","range"],function(){var n;t[this]&&(e.isArray(t[this])?t[this]=[Number(t[this][0]),Number(t[this][1])]:"string"==typeof t[this]&&(n=t[this].replace(/[\[\]]/g,"").split(/[\s,]+/),t[this]=[Number(n[0]),Number(n[1])]))}),e.validator.autoCreateRanges&&(null!=t.min&&null!=t.max&&(t.range=[t.min,t.max],delete t.min,delete t.max),null!=t.minlength&&null!=t.maxlength&&(t.rangelength=[t.minlength,t.maxlength],delete t.minlength,delete t.maxlength)),t},normalizeRule:function(t){if("string"==typeof t){var n={};e.each(t.split(/\s/),function(){n[this]=!0}),t=n}return t},addMethod:function(t,n,i){e.validator.methods[t]=n,e.validator.messages[t]=void 0!==i?i:e.validator.messages[t],n.length<3&&e.validator.addClassRules(t,e.validator.normalizeRule(t))},methods:{required:function(t,n,i){if(!this.depend(i,n))return"dependency-mismatch";if("select"===n.nodeName.toLowerCase()){var r=e(n).val();return r&&r.length>0}return this.checkable(n)?this.getLength(t,n)>0:t.length>0},email:function(e,t){return this.optional(t)||/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/.test(e)},url:function(e,t){return this.optional(t)||/^(?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})).?)(?::\d{2,5})?(?:[\/?#]\S*)?$/i.test(e)},date:function(e,t){return this.optional(t)||!/Invalid|NaN/.test(new Date(e).toString())},dateISO:function(e,t){return this.optional(t)||/^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$/.test(e)},number:function(e,t){return this.optional(t)||/^(?:-?\d+|-?\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test(e)},digits:function(e,t){return this.optional(t)||/^\d+$/.test(e)},creditcard:function(e,t){if(this.optional(t))return"dependency-mismatch";if(/[^0-9 \-]+/.test(e))return!1;var n,i,r=0,o=0,s=!1;if(e=e.replace(/\D/g,""),e.length<13||e.length>19)return!1;for(n=e.length-1;n>=0;n--)i=e.charAt(n),o=parseInt(i,10),s&&(o*=2)>9&&(o-=9),r+=o,s=!s;return r%10===0},minlength:function(t,n,i){var r=e.isArray(t)?t.length:this.getLength(t,n);return this.optional(n)||r>=i},maxlength:function(t,n,i){var r=e.isArray(t)?t.length:this.getLength(t,n);return this.optional(n)||r<=i},rangelength:function(t,n,i){var r=e.isArray(t)?t.length:this.getLength(t,n);return this.optional(n)||r>=i[0]&&r<=i[1]},min:function(e,t,n){return this.optional(t)||e>=n},max:function(e,t,n){return this.optional(t)||e<=n},range:function(e,t,n){return this.optional(t)||e>=n[0]&&e<=n[1]},equalTo:function(t,n,i){var r=e(i);return this.settings.onfocusout&&r.off(".validate-equalTo").on("blur.validate-equalTo",function(){e(n).valid()}),t===r.val()},remote:function(t,n,i){if(this.optional(n))return"dependency-mismatch";var r,o,s=this.previousValue(n);return this.settings.messages[n.name]||(this.settings.messages[n.name]={}),s.originalMessage=this.settings.messages[n.name].remote,this.settings.messages[n.name].remote=s.message,i="string"==typeof i&&{url:i}||i,s.old===t?s.valid:(s.old=t,r=this,this.startRequest(n),o={},o[n.name]=t,e.ajax(e.extend(!0,{mode:"abort",port:"validate"+n.name,dataType:"json",data:o,context:r.currentForm,success:function(i){var o,a,l,c=i===!0||"true"===i;r.settings.messages[n.name].remote=s.originalMessage,c?(l=r.formSubmitted,r.prepareElement(n),r.formSubmitted=l,r.successList.push(n),delete r.invalid[n.name],r.showErrors()):(o={},a=i||r.defaultMessage(n,"remote"),o[n.name]=s.message=e.isFunction(a)?a(t):a,r.invalid[n.name]=!0,r.showErrors(o)),s.valid=c,r.stopRequest(n,c)}},i)),"pending")}}});var t,n={};e.ajaxPrefilter?e.ajaxPrefilter(function(e,t,i){var r=e.port;"abort"===e.mode&&(n[r]&&n[r].abort(),n[r]=i)}):(t=e.ajax,e.ajax=function(i){var r=("mode"in i?i:e.ajaxSettings).mode,o=("port"in i?i:e.ajaxSettings).port;return"abort"===r?(n[o]&&n[o].abort(),n[o]=t.apply(this,arguments),n[o]):t.apply(this,arguments)})});var defaultConfig={dateSettings:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],daysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],meridiem:["AM","PM"]},separators:/[ \-+\/\.T:@]/g,validParts:/[djDlwSFmMnyYaAgGhHisU]/g},DateFormatter=function(e){var t=$.extend(!0,defaultConfig,e);this.dateSettings=t.dateSettings,this.separators=t.separators,this.validParts=t.validParts};DateFormatter.prototype={constructor:DateFormatter,parseDate:function(e,t){if(e){if(e instanceof Date)return e;if("number"==typeof e)return new Date(e);var n=this,i={date:null,year:null,month:null,day:null,dayOfWeek:null,hour:0,min:0,sec:0};if(e instanceof Date)return e;if("string"==typeof e){var r=t.match(n.validParts);if(!r||0===r.length)throw new Error("Invalid date format definition.");var o,s=e.replace(n.separators,"\0").split("\0"),a=!1,l=!1;for(o=0;o<s.length;o++)switch(r[o]){case"y":case"Y":2==s[o].length?i.year=parseInt((parseInt(s[o])<70?"20":"19")+s[o]):4==s[o].length&&(i.year=parseInt(s[o])),a=!0;break;case"m":case"n":case"M":case"F":var c;isNaN(s[o])?(c=n.dateSettings.monthsShort.indexOf(s[o]),c>-1&&(i.month=c+1),c=n.dateSettings.months.indexOf(s[o]),c>-1&&(i.month=c+1)):parseInt(s[o])>=1&&parseInt(s[o])<=12&&(i.month=parseInt(s[o])),a=!0;break;case"d":case"j":parseInt(s[o])>=1&&parseInt(s[o])<=31&&(i.day=parseInt(s[o])),a=!0;break;case"g":case"h":var u=r.indexOf("a")>-1?r.indexOf("a"):r.indexOf("A")>-1?r.indexOf("A"):-1;if(u>-1){var d=s[u].toLowerCase==n.dateSettings.meridiem[0].toLowerCase?0:s[u].toLowerCase==n.dateSettings.meridiem[1].toLowerCase?12:-1;parseInt(s[o])>=1&&parseInt(s[o])<=12&&d>-1?i.hour=parseInt(s[o])+d-1:parseInt(s[o])>=0&&parseInt(s[o])<=23&&(i.hour=parseInt(s[o]))}else parseInt(s[o])>=0&&parseInt(s[o])<=23&&(i.hour=parseInt(s[o]));l=!0;break;case"G":case"H":parseInt(s[o])>=0&&parseInt(s[o])<=23&&(i.hour=parseInt(s[o])),l=!0;break;case"i":parseInt(s[o])>=0&&parseInt(s[o])<=59&&(i.min=parseInt(s[o])),l=!0;break;case"s":parseInt(s[o])>=0&&parseInt(s[o])<=59&&(i.sec=parseInt(s[o])),l=!0}return a===!0&&i.year&&i.month&&i.day?(i.date=new Date(i.year,i.month-1,i.day,i.hour,i.min,i.sec,0),i.date):l===!0&&(i.date=new Date(0,0,0,i.hour,i.min,i.sec,0),i.date)}}},guessDate:function(e,t){var n=this;if("string"!=typeof e)return e;var i=e.replace(n.separators,"\0").split("\0"),r=t.match(n.validParts),o=/^[djmn]/g;if(o.test(r[0])){var s,a=new Date,l=0;for(s=0;s<i.length;s++){switch(l=2,s){case 0:"m"==r[0]||"n"==r[0]?a.setMonth(parseInt(i[s].substr(0,2))-1):a.setDate(parseInt(i[s].substr(0,2)));break;case 1:"m"==r[0]||"n"==r[0]?a.setDate(parseInt(i[s].substr(0,2))):a.setMonth(parseInt(i[s].substr(0,2))-1);break;case 2:var c=a.getFullYear();i[s].length<4?(a.setFullYear(parseInt(c.toString().substr(0,4-i[s].length)+i[s])),l=i[s].length):(a.setFullYear=parseInt(i[s].substr(0,4)),l=4);break;case 3:a.setHours(parseInt(i[s].substr(0,2)));break;case 4:a.setMinutes(parseInt(i[s].substr(0,2)));break;case 5:a.setSeconds(parseInt(i[s].substr(0,2)))}i[s].substr(l).length>0&&i.splice(s+1,0,i[s].substr(l))}return a}},formatDate:function(e,t){var n=this;if("string"==typeof e&&(e=n.parseDate(e,t),0==e))return!1;if(e instanceof Date){var i,r,o="",n=this,s=/[djDlwSFmMnyYaAgGhHisU]/;for(i=0;i<t.length;i++)if(r=t.charAt(i),1==s.test(r))switch(r){case"j":o+=e.getDate();break;case"d":o+=(e.getDate()<=9?"0":"")+e.getDate();break;case"D":o+=n.dateSettings.daysShort[e.getDay()];break;case"l":o+=n.dateSettings.days[e.getDay()];break;case"w":o+=e.getDay();break;case"S":var a=e.getDay();o+=1==a||21==a||31==a?"st":2==a||22==a?"nd":3==a||23==a?"rd":"th";break;case"n":o+=e.getMonth()+1;break;case"m":o+=(e.getMonth()<=8?"0":"")+(e.getMonth()+1);break;case"F":o+=n.dateSettings.months[e.getMonth()];break;case"M":o+=n.dateSettings.monthsShort[e.getMonth()];break;case"Y":o+=e.getFullYear();break;case"y":o+=e.getFullYear().toString().substr(2);break;case"g":o+=e.getHours()%12+1;break;case"G":o+=e.getHours();break;case"h":o+=(e.getHours()%12<=8?"0":"")+(e.getHours()%12+1);break;case"H":o+=(e.getHours()<=9?"0":"")+e.getHours();break;case"a":case"A":o+=e.getHours<=12?n.dateSettings.meridiem[0]:n.dateSettings.meridiem[1];break;case"i":o+=(e.getMinutes()<=9?"0":"")+e.getMinutes();break;case"s":o+=(e.getSeconds()<=9?"0":"")+e.getSeconds();break;case"U":o+=e.getTime()/1e3}else o+=r;return o}}};var laravelValidation;laravelValidation={implicitRules:["Required","Confirmed"],init:function(){$.validator.classRuleSettings={},$.validator.attributeRules=function(){rules={}},$.validator.dataRules=this.arrayRules,$.validator.prototype.arrayRulesCache={},this.setupValidations()},arrayRules:function(e){var t={},n=$.data(e.form,"validator"),i={};return e.name.indexOf("[")===-1?t:(e.name in i||(i[e.name]={}),$.each(n.settings.rules,function(n,r){if(n in i[e.name])$.extend(t,i[e.name][n]);else{i[e.name][n]={};var o=n.split("[*]"),s=o.map(function(e,t){return t%2===0?e+="[":e="]"+e,laravelValidation.helpers.escapeRegExp(e)}),a=new RegExp("^"+s.join(".*")+"$");if(e.name.match(a)){var l=$.validator.normalizeRule(r)||{};i[e.name][n]=l,$.extend(t,l)}}}),t)},setupValidations:function(){$.validator.addMethod("laravelValidation",function(e,t,n){var i=this,r=!0,o=[];return $.each(n,function(e,t){t[3]||laravelValidation.implicitRules.indexOf(t[0])!==-1?o.unshift(t):o.push(t)}),$.each(o,function(n,o){var s=o[3]||laravelValidation.implicitRules.indexOf(o[0])!==-1,a=o[0],l=o[2];return!s&&i.optional(t)?(r="dependency-mismatch",!1):(r=void 0!==laravelValidation.methods[a]&&laravelValidation.methods[a].call(i,e,t,o[1]),r!==!0?(i.settings.messages[t.name]||(i.settings.messages[t.name]={}),i.settings.messages[t.name].laravelValidation=l,!1):void 0)}),r},""),$.validator.addMethod("laravelValidationRemote",function(e,t,n){var i=!1,r=n[0][1],o=r[0],s=r[1],a=r[2];if($.each(n,function(e,t){i=i||t[3]}),!i&&this.optional(t))return"dependency-mismatch";var l,c,u=this.previousValue(t);this.settings.messages[t.name]||(this.settings.messages[t.name]={}),u.originalMessage=this.settings.messages[t.name].laravelValidationRemote,this.settings.messages[t.name].laravelValidationRemote=u.message;var d="string"==typeof d&&{url:d}||d;if(u.old===e)return u.valid;u.old=e,l=this,this.startRequest(t),c=$(l.currentForm).serializeArray(),c.push({name:"_jsvalidation",value:o}),c.push({name:"_jsvalidation_validate_all",value:a});var h=$(l.currentForm).attr("method");return $(l.currentForm).find('input[name="_method"]').length&&(h=$(l.currentForm).find('input[name="_method"]').val()),$.ajax($.extend(!0,{mode:"abort",port:"validate"+t.name,dataType:"json",data:c,context:l.currentForm,url:$(l.currentForm).attr("action"),type:h,beforeSend:function(e){if("get"!==$(l.currentForm).attr("method").toLowerCase()&&s)return e.setRequestHeader("X-XSRF-TOKEN",s)}},d)).always(function(n,i){var r,o,s,a;if("error"===i)a=!1,n=laravelValidation.helpers.parseErrorResponse(n);else{if("success"!==i)return;a=n===!0||"true"===n}l.settings.messages[t.name].laravelValidationRemote=u.originalMessage,a?(s=l.formSubmitted,l.prepareElement(t),l.formSubmitted=s,l.successList.push(t),delete l.invalid[t.name],l.showErrors()):(r={},o=n||l.defaultMessage(t,"remote"),r[t.name]=u.message=$.isFunction(o)?o(e):o[0],l.invalid[t.name]=!0,l.showErrors(r)),l.showErrors(l.errorMap),u.valid=a,l.stopRequest(t,a)}),"pending"},"")}},$(function(){laravelValidation.init()}),$.extend(!0,laravelValidation,{helpers:{numericRules:["Integer","Numeric"],fileinfo:function(e){var t=e.value;return{file:t,extension:t.substr(t.lastIndexOf(".")+1),size:e.files[0].size/1024}},selector:function(e){var t=[];$.isArray(e)||(e=[e]);for(var n=0;n<e.length;n++)t.push("[name='"+e[n]+"']");return t.join()},hasNumericRules:function(e){return this.hasRules(e,this.numericRules)},hasRules:function(e,t){var n=!1;"string"==typeof t&&(t=[t]);var i=$.data(e.form,"validator"),r=i.settings.rules[e.name];if("laravelValidation"in r)for(var o=r.laravelValidation,s=0;s<o.length;s++)if($.inArray(o[s][0],t)!==-1){n=!0;break}return n},strlen:function(e){return strlen(e)},getSize:function(e,t,n){return this.hasNumericRules(t)&&this.is_numeric(n)?parseFloat(n):$.isArray(n)?parseFloat(n.length):"file"===t.type?parseFloat(Math.ceil(this.fileinfo(t).size)):parseFloat(this.strlen(n))},getLaravelValidation:function(e,t){var n=void 0;return $.each($.validator.staticRules(t),function(t,i){"laravelValidation"===t&&$.each(i,function(t,i){i[0]===e&&(n=i)})}),n},parseTime:function(e,t){var n=!1,i=new DateFormatter;if("object"===$.type(t)){var r=this.getLaravelValidation("DateFormat",t);t=void 0!==r?r[1][0]:null}return null==t?n=this.strtotime(e):(n=i.parseDate(e,t),n&&(n=Math.round(n.getTime()/1e3))),n},gessDate:function(e,t){var n=new DateFormatter;return n.guessDate(e,t)},strtotime:function(e,t){return strtotime(e,t)},is_numeric:function(e){return is_numeric(e)},arrayDiff:function(e,t){return array_diff(e,t)},dependentElement:function(e,t,n){var i=e.findByName(n);if(void 0!==i[0]&&e.settings.onfocusout){var r="blur";"SELECT"!==i[0].tagName&&"OPTION"!==i[0].tagName&&"checkbox"!==i[0].type&&"radio"!==i[0].type||(r="click");var o=".validate-laravelValidation";i.off(o).off(r+o+"-"+t.name).on(r+o+"-"+t.name,function(){$(t).valid()})}return i[0]},parseErrorResponse:function(e){var t=["Whoops, looks like something went wrong."];if("responseText"in e){var n=e.responseText.match(/<h1\s*>(.*)<\/h1\s*>/i);$.isArray(n)&&(t=[n[1]])}return t},escapeRegExp:function(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}}}),$.extend(!0,laravelValidation,{helpers:{isTimezone:function(e){var t={africa:["abidjan","accra","addis_ababa","algiers","asmara","bamako","bangui","banjul","bissau","blantyre","brazzaville","bujumbura","cairo","casablanca","ceuta","conakry","dakar","dar_es_salaam","djibouti","douala","el_aaiun","freetown","gaborone","harare","johannesburg","juba","kampala","khartoum","kigali","kinshasa","lagos","libreville","lome","luanda","lubumbashi","lusaka","malabo","maputo","maseru","mbabane","mogadishu","monrovia","nairobi","ndjamena","niamey","nouakchott","ouagadougou","porto-novo","sao_tome","tripoli","tunis","windhoek"],america:["adak","anchorage","anguilla","antigua","araguaina","argentina/buenos_aires","argentina/catamarca","argentina/cordoba","argentina/jujuy","argentina/la_rioja","argentina/mendoza","argentina/rio_gallegos","argentina/salta","argentina/san_juan","argentina/san_luis","argentina/tucuman","argentina/ushuaia","aruba","asuncion","atikokan","bahia","bahia_banderas","barbados","belem","belize","blanc-sablon","boa_vista","bogota","boise","cambridge_bay","campo_grande","cancun","caracas","cayenne","cayman","chicago","chihuahua","costa_rica","creston","cuiaba","curacao","danmarkshavn","dawson","dawson_creek","denver","detroit","dominica","edmonton","eirunepe","el_salvador","fortaleza","glace_bay","godthab","goose_bay","grand_turk","grenada","guadeloupe","guatemala","guayaquil","guyana","halifax","havana","hermosillo","indiana/indianapolis","indiana/knox","indiana/marengo","indiana/petersburg","indiana/tell_city","indiana/vevay","indiana/vincennes","indiana/winamac","inuvik","iqaluit","jamaica","juneau","kentucky/louisville","kentucky/monticello","kralendijk","la_paz","lima","los_angeles","lower_princes","maceio","managua","manaus","marigot","martinique","matamoros","mazatlan","menominee","merida","metlakatla","mexico_city","miquelon","moncton","monterrey","montevideo","montreal","montserrat","nassau","new_york","nipigon","nome","noronha","north_dakota/beulah","north_dakota/center","north_dakota/new_salem","ojinaga","panama","pangnirtung","paramaribo","phoenix","port-au-prince","port_of_spain","porto_velho","puerto_rico","rainy_river","rankin_inlet","recife","regina","resolute","rio_branco","santa_isabel","santarem","santiago","santo_domingo","sao_paulo","scoresbysund","shiprock","sitka","st_barthelemy","st_johns","st_kitts","st_lucia","st_thomas","st_vincent","swift_current","tegucigalpa","thule","thunder_bay","tijuana","toronto","tortola","vancouver","whitehorse","winnipeg","yakutat","yellowknife"],antarctica:["casey","davis","dumontdurville","macquarie","mawson","mcmurdo","palmer","rothera","south_pole","syowa","vostok"],arctic:["longyearbyen"],asia:["aden","almaty","amman","anadyr","aqtau","aqtobe","ashgabat","baghdad","bahrain","baku","bangkok","beirut","bishkek","brunei","choibalsan","chongqing","colombo","damascus","dhaka","dili","dubai","dushanbe","gaza","harbin","hebron","ho_chi_minh","hong_kong","hovd","irkutsk","jakarta","jayapura","jerusalem","kabul","kamchatka","karachi","kashgar","kathmandu","khandyga","kolkata","krasnoyarsk","kuala_lumpur","kuching","kuwait","macau","magadan","makassar","manila","muscat","nicosia","novokuznetsk","novosibirsk","omsk","oral","phnom_penh","pontianak","pyongyang","qatar","qyzylorda","rangoon","riyadh","sakhalin","samarkand","seoul","shanghai","singapore","taipei","tashkent","tbilisi","tehran","thimphu","tokyo","ulaanbaatar","urumqi","ust-nera","vientiane","vladivostok","yakutsk","yekaterinburg","yerevan"],atlantic:["azores","bermuda","canary","cape_verde","faroe","madeira","reykjavik","south_georgia","st_helena","stanley"],australia:["adelaide","brisbane","broken_hill","currie","darwin","eucla","hobart","lindeman","lord_howe","melbourne","perth","sydney"],europe:["amsterdam","andorra","athens","belgrade","berlin","bratislava","brussels","bucharest","budapest","busingen","chisinau","copenhagen","dublin","gibraltar","guernsey","helsinki","isle_of_man","istanbul","jersey","kaliningrad","kiev","lisbon","ljubljana","london","luxembourg","madrid","malta","mariehamn","minsk","monaco","moscow","oslo","paris","podgorica","prague","riga","rome","samara","san_marino","sarajevo","simferopol","skopje","sofia","stockholm","tallinn","tirane","uzhgorod","vaduz","vatican","vienna","vilnius","volgograd","warsaw","zagreb","zaporozhye","zurich"],indian:["antananarivo","chagos","christmas","cocos","comoro","kerguelen","mahe","maldives","mauritius","mayotte","reunion"],pacific:["apia","auckland","chatham","chuuk","easter","efate","enderbury","fakaofo","fiji","funafuti","galapagos","gambier","guadalcanal","guam","honolulu","johnston","kiritimati","kosrae","kwajalein","majuro","marquesas","midway","nauru","niue","norfolk","noumea","pago_pago","palau","pitcairn","pohnpei","port_moresby","rarotonga","saipan","tahiti","tarawa","tongatapu","wake","wallis"],utc:[""]},n=e.split("/",2),i=n[0].toLowerCase(),r="";return n[1]&&(r=n[1].toLowerCase()),i in t&&(0===t[i].length||t[i].indexOf(r)!==-1)}}}),$.extend(!0,laravelValidation,{methods:{helpers:laravelValidation.helpers,jsRemoteTimer:0,Sometimes:function(){return!0},Filled:function(e,t){return $.validator.methods.required.call(this,e,t,!0)},Required:function(e,t){return $.validator.methods.required.call(this,e,t)},RequiredWith:function(e,t,n){var i=this,r=!1,o=this;return $.each(n,function(e,n){var s=laravelValidation.helpers.dependentElement(o,t,n);r=r||void 0!==s&&$.validator.methods.required.call(i,o.elementValue(s),s,!0)}),!r||$.validator.methods.required.call(this,e,t,!0)},RequiredWithAll:function(e,t,n){var i=this,r=!0,o=this;return $.each(n,function(e,n){var s=laravelValidation.helpers.dependentElement(o,t,n);r=r&&void 0!==s&&$.validator.methods.required.call(i,o.elementValue(s),s,!0)}),!r||$.validator.methods.required.call(this,e,t,!0)},RequiredWithout:function(e,t,n){var i=this,r=!1,o=this;return $.each(n,function(e,n){var s=laravelValidation.helpers.dependentElement(o,t,n);r=r||void 0===s||!$.validator.methods.required.call(i,o.elementValue(s),s,!0)}),!r||$.validator.methods.required.call(this,e,t,!0)},RequiredWithoutAll:function(e,t,n){var i=this,r=!0,o=this;return $.each(n,function(e,n){var s=laravelValidation.helpers.dependentElement(o,t,n);r=r&&(void 0===s||!$.validator.methods.required.call(i,o.elementValue(s),s,!0))}),!r||$.validator.methods.required.call(this,e,t,!0)},RequiredIf:function(e,t,n){var i=laravelValidation.helpers.dependentElement(this,t,n[0]);if(void 0!==i){var r=String(this.elementValue(i));if("undefined"!=typeof r){var o=n.slice(1);if($.inArray(r,o)!==-1)return $.validator.methods.required.call(this,e,t,!0)}}return!0},RequiredUnless:function(e,t,n){var i=laravelValidation.helpers.dependentElement(this,t,n[0]);if(void 0!==i){var r=String(this.elementValue(i));if("undefined"!=typeof r){var o=n.slice(1);if($.inArray(r,o)!==-1)return!0}}return $.validator.methods.required.call(this,e,t,!0)},Confirmed:function(e,t,n){return laravelValidation.methods.Same.call(this,e,t,n)},Same:function(e,t,n){var i=laravelValidation.helpers.dependentElement(this,t,n[0]);return void 0!==i&&String(e)===String(this.elementValue(i))},Different:function(e,t,n){return!laravelValidation.methods.Same.call(this,e,t,n)},Accepted:function(e){var t=new RegExp("^(?:(yes|on|1|true))$","i");return t.test(e)},Array:function(e){return $.isArray(e)},Boolean:function(e){var t=new RegExp("^(?:(true|false|1|0))$","i");return t.test(e)},Integer:function(e){var t=new RegExp("^(?:-?\\d+)$","i");return t.test(e)},Numeric:function(e,t){return $.validator.methods.number.call(this,e,t,!0)},String:function(e){return"string"==typeof e},Digits:function(e,t,n){return $.validator.methods.number.call(this,e,t,!0)&&e.length===parseInt(n,10)},DigitsBetween:function(e,t,n){return $.validator.methods.number.call(this,e,t,!0)&&e.length>=parseFloat(n[0])&&e.length<=parseFloat(n[1])},Size:function(e,t,n){return laravelValidation.helpers.getSize(this,t,e)===parseFloat(n[0])},Between:function(e,t,n){return laravelValidation.helpers.getSize(this,t,e)>=parseFloat(n[0])&&laravelValidation.helpers.getSize(this,t,e)<=parseFloat(n[1])},Min:function(e,t,n){return laravelValidation.helpers.getSize(this,t,e)>=parseFloat(n[0])},Max:function(e,t,n){return laravelValidation.helpers.getSize(this,t,e)<=parseFloat(n[0])},In:function(e,t,n){if($.isArray(e)&&laravelValidation.helpers.hasRules(t,"Array")){var i=laravelValidation.helpers.arrayDiff(e,n);return 0===Object.keys(i).length}return n.indexOf(e.toString())!==-1},NotIn:function(e,t,n){return n.indexOf(e.toString())===-1},Ip:function(e){return/^(25[0-5]|2[0-4]\d|[01]?\d\d?)\.(25[0-5]|2[0-4]\d|[01]?\d\d?)\.(25[0-5]|2[0-4]\d|[01]?\d\d?)\.(25[0-5]|2[0-4]\d|[01]?\d\d?)$/i.test(e)||/^((([0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}:[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){5}:([0-9A-Fa-f]{1,4}:)?[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){4}:([0-9A-Fa-f]{1,4}:){0,2}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){3}:([0-9A-Fa-f]{1,4}:){0,3}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){2}:([0-9A-Fa-f]{1,4}:){0,4}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|(([0-9A-Fa-f]{1,4}:){0,5}:((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|(::([0-9A-Fa-f]{1,4}:){0,5}((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|([0-9A-Fa-f]{1,4}::([0-9A-Fa-f]{1,4}:){0,5}[0-9A-Fa-f]{1,4})|(::([0-9A-Fa-f]{1,4}:){0,6}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){1,7}:))$/i.test(e)},Email:function(e,t){return $.validator.methods.email.call(this,e,t,!0)},Url:function(e,t){return $.validator.methods.url.call(this,e,t,!0)},Mimes:function(e,t,n){var i=$.map(n,function(e){return e.toLowerCase()});return!(window.File&&window.FileReader&&window.FileList&&window.Blob&&i.indexOf(laravelValidation.helpers.fileinfo(t).extension.toLowerCase())===-1)},Image:function(e,t){return laravelValidation.methods.Mimes.call(this,e,t,["jpg","png","gif","bmp","svg"])},Alpha:function(e){if("string"!=typeof e)return!1;var t=new RegExp("^(?:^[a-zà-ü]+$)$","i");return t.test(e)},AlphaNum:function(e){if("string"!=typeof e)return!1;var t=new RegExp("^(?:^[a-z0-9à-ü]+$)$","i");return t.test(e)},AlphaDash:function(e){if("string"!=typeof e)return!1;var t=new RegExp("^(?:^[a-z0-9à-ü_-]+$)$","i");return t.test(e)},Regex:function(e,t,n){var i=["x","s","u","X","U","A"],r=new RegExp("^(?:/)(.*\\/?[^/]*|[^/]*)(?:/)([gmixXsuUAJ]*)?$"),o=n[0].match(r);if(null==o)return!1;var s=[];if(void 0!==o[2]){s=o[2].split("");for(var a=0;a<s.length<a;a++)if(i.indexOf(s[a])!==-1)return!0}var l=new RegExp("^(?:"+o[1]+")$",s.join());return l.test(e)},Date:function(e){return laravelValidation.helpers.strtotime(e)!==!1},DateFormat:function(e,t,n){return laravelValidation.helpers.parseTime(e,n[0])!==!1},Before:function(e,t,n){var i=parseFloat(n);if(isNaN(i)){var r=laravelValidation.helpers.dependentElement(this,t,n);if(void 0===r)return!1;i=laravelValidation.helpers.parseTime(this.elementValue(r),r)}var o=laravelValidation.helpers.parseTime(e,t);return o!==!1&&o<i},After:function(e,t,n){var i=parseFloat(n);if(isNaN(i)){var r=laravelValidation.helpers.dependentElement(this,t,n);if(void 0===r)return!1;i=laravelValidation.helpers.parseTime(this.elementValue(r),r)}var o=laravelValidation.helpers.parseTime(e,t);return o!==!1&&o>i},Timezone:function(e){return laravelValidation.helpers.isTimezone(e)},Json:function(e){var t=!0;try{JSON.parse(e)}catch(n){t=!1}return t}}}),!function(e){"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof exports?module.exports=e:e(jQuery)}(function(e){function t(t){var s=t||window.event,a=l.call(arguments,1),c=0,d=0,h=0,f=0,p=0,m=0;if(t=e.event.fix(s),t.type="mousewheel","detail"in s&&(h=-1*s.detail),"wheelDelta"in s&&(h=s.wheelDelta),"wheelDeltaY"in s&&(h=s.wheelDeltaY),"wheelDeltaX"in s&&(d=-1*s.wheelDeltaX),"axis"in s&&s.axis===s.HORIZONTAL_AXIS&&(d=-1*h,h=0),c=0===h?d:h,"deltaY"in s&&(h=-1*s.deltaY,c=h),"deltaX"in s&&(d=s.deltaX,0===h&&(c=-1*d)),0!==h||0!==d){if(1===s.deltaMode){var g=e.data(this,"mousewheel-line-height");c*=g,h*=g,d*=g}else if(2===s.deltaMode){
  var v=e.data(this,"mousewheel-page-height");c*=v,h*=v,d*=v}if(f=Math.max(Math.abs(h),Math.abs(d)),(!o||o>f)&&(o=f,i(s,f)&&(o/=40)),i(s,f)&&(c/=40,d/=40,h/=40),c=Math[c>=1?"floor":"ceil"](c/o),d=Math[d>=1?"floor":"ceil"](d/o),h=Math[h>=1?"floor":"ceil"](h/o),u.settings.normalizeOffset&&this.getBoundingClientRect){var y=this.getBoundingClientRect();p=t.clientX-y.left,m=t.clientY-y.top}return t.deltaX=d,t.deltaY=h,t.deltaFactor=o,t.offsetX=p,t.offsetY=m,t.deltaMode=0,a.unshift(t,c,d,h),r&&clearTimeout(r),r=setTimeout(n,200),(e.event.dispatch||e.event.handle).apply(this,a)}}function n(){o=null}function i(e,t){return u.settings.adjustOldDeltas&&"mousewheel"===e.type&&t%120===0}var r,o,s=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],a="onwheel"in document||document.documentMode>=9?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],l=Array.prototype.slice;if(e.event.fixHooks)for(var c=s.length;c;)e.event.fixHooks[s[--c]]=e.event.mouseHooks;var u=e.event.special.mousewheel={version:"3.1.12",setup:function(){if(this.addEventListener)for(var n=a.length;n;)this.addEventListener(a[--n],t,!1);else this.onmousewheel=t;e.data(this,"mousewheel-line-height",u.getLineHeight(this)),e.data(this,"mousewheel-page-height",u.getPageHeight(this))},teardown:function(){if(this.removeEventListener)for(var n=a.length;n;)this.removeEventListener(a[--n],t,!1);else this.onmousewheel=null;e.removeData(this,"mousewheel-line-height"),e.removeData(this,"mousewheel-page-height")},getLineHeight:function(t){var n=e(t),i=n["offsetParent"in e.fn?"offsetParent":"parent"]();return i.length||(i=e("body")),parseInt(i.css("fontSize"),10)||parseInt(n.css("fontSize"),10)||16},getPageHeight:function(t){return e(t).height()},settings:{adjustOldDeltas:!0,normalizeOffset:!0}};e.fn.extend({mousewheel:function(e){return e?this.bind("mousewheel",e):this.trigger("mousewheel")},unmousewheel:function(e){return this.unbind("mousewheel",e)}})}),!function(e){"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof exports?module.exports=e:e(jQuery)}(function(e){function t(t){var s=t||window.event,a=l.call(arguments,1),c=0,d=0,h=0,f=0,p=0,m=0;if(t=e.event.fix(s),t.type="mousewheel","detail"in s&&(h=-1*s.detail),"wheelDelta"in s&&(h=s.wheelDelta),"wheelDeltaY"in s&&(h=s.wheelDeltaY),"wheelDeltaX"in s&&(d=-1*s.wheelDeltaX),"axis"in s&&s.axis===s.HORIZONTAL_AXIS&&(d=-1*h,h=0),c=0===h?d:h,"deltaY"in s&&(h=-1*s.deltaY,c=h),"deltaX"in s&&(d=s.deltaX,0===h&&(c=-1*d)),0!==h||0!==d){if(1===s.deltaMode){var g=e.data(this,"mousewheel-line-height");c*=g,h*=g,d*=g}else if(2===s.deltaMode){var v=e.data(this,"mousewheel-page-height");c*=v,h*=v,d*=v}if(f=Math.max(Math.abs(h),Math.abs(d)),(!o||o>f)&&(o=f,i(s,f)&&(o/=40)),i(s,f)&&(c/=40,d/=40,h/=40),c=Math[c>=1?"floor":"ceil"](c/o),d=Math[d>=1?"floor":"ceil"](d/o),h=Math[h>=1?"floor":"ceil"](h/o),u.settings.normalizeOffset&&this.getBoundingClientRect){var y=this.getBoundingClientRect();p=t.clientX-y.left,m=t.clientY-y.top}return t.deltaX=d,t.deltaY=h,t.deltaFactor=o,t.offsetX=p,t.offsetY=m,t.deltaMode=0,a.unshift(t,c,d,h),r&&clearTimeout(r),r=setTimeout(n,200),(e.event.dispatch||e.event.handle).apply(this,a)}}function n(){o=null}function i(e,t){return u.settings.adjustOldDeltas&&"mousewheel"===e.type&&t%120===0}var r,o,s=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],a="onwheel"in document||document.documentMode>=9?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],l=Array.prototype.slice;if(e.event.fixHooks)for(var c=s.length;c;)e.event.fixHooks[s[--c]]=e.event.mouseHooks;var u=e.event.special.mousewheel={version:"3.1.12",setup:function(){if(this.addEventListener)for(var n=a.length;n;)this.addEventListener(a[--n],t,!1);else this.onmousewheel=t;e.data(this,"mousewheel-line-height",u.getLineHeight(this)),e.data(this,"mousewheel-page-height",u.getPageHeight(this))},teardown:function(){if(this.removeEventListener)for(var n=a.length;n;)this.removeEventListener(a[--n],t,!1);else this.onmousewheel=null;e.removeData(this,"mousewheel-line-height"),e.removeData(this,"mousewheel-page-height")},getLineHeight:function(t){var n=e(t),i=n["offsetParent"in e.fn?"offsetParent":"parent"]();return i.length||(i=e("body")),parseInt(i.css("fontSize"),10)||parseInt(n.css("fontSize"),10)||16},getPageHeight:function(t){return e(t).height()},settings:{adjustOldDeltas:!0,normalizeOffset:!0}};e.fn.extend({mousewheel:function(e){return e?this.bind("mousewheel",e):this.trigger("mousewheel")},unmousewheel:function(e){return this.unbind("mousewheel",e)}})}),!function(e){"undefined"!=typeof module&&module.exports?module.exports=e:e(jQuery,window,document)}(function(e){!function(t){var n="function"==typeof define&&define.amd,i="undefined"!=typeof module&&module.exports,r="https:"==document.location.protocol?"https:":"http:",o="cdnjs.cloudflare.com/ajax/libs/jquery-mousewheel/3.1.13/jquery.mousewheel.min.js";n||(i?require("jquery-mousewheel")(e):e.event.special.mousewheel||e("head").append(decodeURI("%3Cscript src="+r+"//"+o+"%3E%3C/script%3E"))),t()}(function(){var t,n="mCustomScrollbar",i="mCS",r=".mCustomScrollbar",o={setTop:0,setLeft:0,axis:"y",scrollbarPosition:"inside",scrollInertia:950,autoDraggerLength:!0,alwaysShowScrollbar:0,snapOffset:0,mouseWheel:{enable:!0,scrollAmount:"auto",axis:"y",deltaFactor:"auto",disableOver:["select","option","keygen","datalist","textarea"]},scrollButtons:{scrollType:"stepless",scrollAmount:"auto"},keyboard:{enable:!0,scrollType:"stepless",scrollAmount:"auto"},contentTouchScroll:25,documentTouchScroll:!0,advanced:{autoScrollOnFocus:"input,textarea,select,button,datalist,keygen,a[tabindex],area,object,[contenteditable='true']",updateOnContentResize:!0,updateOnImageLoad:"auto",autoUpdateTimeout:60},theme:"light",callbacks:{onTotalScrollOffset:0,onTotalScrollBackOffset:0,alwaysTriggerOffsets:!0}},s=0,a={},l=window.attachEvent&&!window.addEventListener?1:0,c=!1,u=["mCSB_dragger_onDrag","mCSB_scrollTools_onDrag","mCS_img_loaded","mCS_disabled","mCS_destroyed","mCS_no_scrollbar","mCS-autoHide","mCS-dir-rtl","mCS_no_scrollbar_y","mCS_no_scrollbar_x","mCS_y_hidden","mCS_x_hidden","mCSB_draggerContainer","mCSB_buttonUp","mCSB_buttonDown","mCSB_buttonLeft","mCSB_buttonRight"],d={init:function(t){var t=e.extend(!0,{},o,t),n=h.call(this);if(t.live){var l=t.liveSelector||this.selector||r,c=e(l);if("off"===t.live)return void p(l);a[l]=setTimeout(function(){c.mCustomScrollbar(t),"once"===t.live&&c.length&&p(l)},500)}else p(l);return t.setWidth=t.set_width?t.set_width:t.setWidth,t.setHeight=t.set_height?t.set_height:t.setHeight,t.axis=t.horizontalScroll?"x":m(t.axis),t.scrollInertia=t.scrollInertia>0&&t.scrollInertia<17?17:t.scrollInertia,"object"!=typeof t.mouseWheel&&1==t.mouseWheel&&(t.mouseWheel={enable:!0,scrollAmount:"auto",axis:"y",preventDefault:!1,deltaFactor:"auto",normalizeDelta:!1,invert:!1}),t.mouseWheel.scrollAmount=t.mouseWheelPixels?t.mouseWheelPixels:t.mouseWheel.scrollAmount,t.mouseWheel.normalizeDelta=t.advanced.normalizeMouseWheelDelta?t.advanced.normalizeMouseWheelDelta:t.mouseWheel.normalizeDelta,t.scrollButtons.scrollType=g(t.scrollButtons.scrollType),f(t),e(n).each(function(){var n=e(this);if(!n.data(i)){n.data(i,{idx:++s,opt:t,scrollRatio:{y:null,x:null},overflowed:null,contentReset:{y:null,x:null},bindEvents:!1,tweenRunning:!1,sequential:{},langDir:n.css("direction"),cbOffsets:null,trigger:null,poll:{size:{o:0,n:0},img:{o:0,n:0},change:{o:0,n:0}}});var r=n.data(i),o=r.opt,a=n.data("mcs-axis"),l=n.data("mcs-scrollbar-position"),c=n.data("mcs-theme");a&&(o.axis=a),l&&(o.scrollbarPosition=l),c&&(o.theme=c,f(o)),v.call(this),r&&o.callbacks.onCreate&&"function"==typeof o.callbacks.onCreate&&o.callbacks.onCreate.call(this),e("#mCSB_"+r.idx+"_container img:not(."+u[2]+")").addClass(u[2]),d.update.call(null,n)}})},update:function(t,n){var r=t||h.call(this);return e(r).each(function(){var t=e(this);if(t.data(i)){var r=t.data(i),o=r.opt,s=e("#mCSB_"+r.idx+"_container"),a=e("#mCSB_"+r.idx),l=[e("#mCSB_"+r.idx+"_dragger_vertical"),e("#mCSB_"+r.idx+"_dragger_horizontal")];if(!s.length)return;r.tweenRunning&&U(t),n&&r&&o.callbacks.onBeforeUpdate&&"function"==typeof o.callbacks.onBeforeUpdate&&o.callbacks.onBeforeUpdate.call(this),t.hasClass(u[3])&&t.removeClass(u[3]),t.hasClass(u[4])&&t.removeClass(u[4]),a.css("max-height","none"),a.height()!==t.height()&&a.css("max-height",t.height()),b.call(this),"y"===o.axis||o.advanced.autoExpandHorizontalScroll||s.css("width",y(s)),r.overflowed=_.call(this),M.call(this),o.autoDraggerLength&&w.call(this),C.call(this),T.call(this);var c=[Math.abs(s[0].offsetTop),Math.abs(s[0].offsetLeft)];"x"!==o.axis&&(r.overflowed[0]?l[0].height()>l[0].parent().height()?S.call(this):(V(t,c[0].toString(),{dir:"y",dur:0,overwrite:"none"}),r.contentReset.y=null):(S.call(this),"y"===o.axis?D.call(this):"yx"===o.axis&&r.overflowed[1]&&V(t,c[1].toString(),{dir:"x",dur:0,overwrite:"none"}))),"y"!==o.axis&&(r.overflowed[1]?l[1].width()>l[1].parent().width()?S.call(this):(V(t,c[1].toString(),{dir:"x",dur:0,overwrite:"none"}),r.contentReset.x=null):(S.call(this),"x"===o.axis?D.call(this):"yx"===o.axis&&r.overflowed[0]&&V(t,c[0].toString(),{dir:"y",dur:0,overwrite:"none"}))),n&&r&&(2===n&&o.callbacks.onImageLoad&&"function"==typeof o.callbacks.onImageLoad?o.callbacks.onImageLoad.call(this):3===n&&o.callbacks.onSelectorChange&&"function"==typeof o.callbacks.onSelectorChange?o.callbacks.onSelectorChange.call(this):o.callbacks.onUpdate&&"function"==typeof o.callbacks.onUpdate&&o.callbacks.onUpdate.call(this)),z.call(this)}})},scrollTo:function(t,n){if("undefined"!=typeof t&&null!=t){var r=h.call(this);return e(r).each(function(){var r=e(this);if(r.data(i)){var o=r.data(i),s=o.opt,a={trigger:"external",scrollInertia:s.scrollInertia,scrollEasing:"mcsEaseInOut",moveDragger:!1,timeout:60,callbacks:!0,onStart:!0,onUpdate:!0,onComplete:!0},l=e.extend(!0,{},a,n),c=W.call(this,t),u=l.scrollInertia>0&&l.scrollInertia<17?17:l.scrollInertia;c[0]=q.call(this,c[0],"y"),c[1]=q.call(this,c[1],"x"),l.moveDragger&&(c[0]*=o.scrollRatio.y,c[1]*=o.scrollRatio.x),l.dur=ne()?0:u,setTimeout(function(){null!==c[0]&&"undefined"!=typeof c[0]&&"x"!==s.axis&&o.overflowed[0]&&(l.dir="y",l.overwrite="all",V(r,c[0].toString(),l)),null!==c[1]&&"undefined"!=typeof c[1]&&"y"!==s.axis&&o.overflowed[1]&&(l.dir="x",l.overwrite="none",V(r,c[1].toString(),l))},l.timeout)}})}},stop:function(){var t=h.call(this);return e(t).each(function(){var t=e(this);t.data(i)&&U(t)})},disable:function(t){var n=h.call(this);return e(n).each(function(){var n=e(this);n.data(i)&&(n.data(i),z.call(this,"remove"),D.call(this),t&&S.call(this),M.call(this,!0),n.addClass(u[3]))})},destroy:function(){var t=h.call(this);return e(t).each(function(){var r=e(this);if(r.data(i)){var o=r.data(i),s=o.opt,a=e("#mCSB_"+o.idx),l=e("#mCSB_"+o.idx+"_container"),c=e(".mCSB_"+o.idx+"_scrollbar");s.live&&p(s.liveSelector||e(t).selector),z.call(this,"remove"),D.call(this),S.call(this),r.removeData(i),K(this,"mcs"),c.remove(),l.find("img."+u[2]).removeClass(u[2]),a.replaceWith(l.contents()),r.removeClass(n+" _"+i+"_"+o.idx+" "+u[6]+" "+u[7]+" "+u[5]+" "+u[3]).addClass(u[4])}})}},h=function(){return"object"!=typeof e(this)||e(this).length<1?r:this},f=function(t){var n=["rounded","rounded-dark","rounded-dots","rounded-dots-dark"],i=["rounded-dots","rounded-dots-dark","3d","3d-dark","3d-thick","3d-thick-dark","inset","inset-dark","inset-2","inset-2-dark","inset-3","inset-3-dark"],r=["minimal","minimal-dark"],o=["minimal","minimal-dark"],s=["minimal","minimal-dark"];t.autoDraggerLength=!(e.inArray(t.theme,n)>-1)&&t.autoDraggerLength,t.autoExpandScrollbar=!(e.inArray(t.theme,i)>-1)&&t.autoExpandScrollbar,t.scrollButtons.enable=!(e.inArray(t.theme,r)>-1)&&t.scrollButtons.enable,t.autoHideScrollbar=e.inArray(t.theme,o)>-1||t.autoHideScrollbar,t.scrollbarPosition=e.inArray(t.theme,s)>-1?"outside":t.scrollbarPosition},p=function(e){a[e]&&(clearTimeout(a[e]),K(a,e))},m=function(e){return"yx"===e||"xy"===e||"auto"===e?"yx":"x"===e||"horizontal"===e?"x":"y"},g=function(e){return"stepped"===e||"pixels"===e||"step"===e||"click"===e?"stepped":"stepless"},v=function(){var t=e(this),r=t.data(i),o=r.opt,s=o.autoExpandScrollbar?" "+u[1]+"_expand":"",a=["<div id='mCSB_"+r.idx+"_scrollbar_vertical' class='mCSB_scrollTools mCSB_"+r.idx+"_scrollbar mCS-"+o.theme+" mCSB_scrollTools_vertical"+s+"'><div class='"+u[12]+"'><div id='mCSB_"+r.idx+"_dragger_vertical' class='mCSB_dragger' style='position:absolute;' oncontextmenu='return false;'><div class='mCSB_dragger_bar' /></div><div class='mCSB_draggerRail' /></div></div>","<div id='mCSB_"+r.idx+"_scrollbar_horizontal' class='mCSB_scrollTools mCSB_"+r.idx+"_scrollbar mCS-"+o.theme+" mCSB_scrollTools_horizontal"+s+"'><div class='"+u[12]+"'><div id='mCSB_"+r.idx+"_dragger_horizontal' class='mCSB_dragger' style='position:absolute;' oncontextmenu='return false;'><div class='mCSB_dragger_bar' /></div><div class='mCSB_draggerRail' /></div></div>"],l="yx"===o.axis?"mCSB_vertical_horizontal":"x"===o.axis?"mCSB_horizontal":"mCSB_vertical",c="yx"===o.axis?a[0]+a[1]:"x"===o.axis?a[1]:a[0],d="yx"===o.axis?"<div id='mCSB_"+r.idx+"_container_wrapper' class='mCSB_container_wrapper' />":"",h=o.autoHideScrollbar?" "+u[6]:"",f="x"!==o.axis&&"rtl"===r.langDir?" "+u[7]:"";o.setWidth&&t.css("width",o.setWidth),o.setHeight&&t.css("height",o.setHeight),o.setLeft="y"!==o.axis&&"rtl"===r.langDir?"989999px":o.setLeft,t.addClass(n+" _"+i+"_"+r.idx+h+f).wrapInner("<div id='mCSB_"+r.idx+"' class='mCustomScrollBox mCS-"+o.theme+" "+l+"'><div id='mCSB_"+r.idx+"_container' class='mCSB_container' style='position:relative; top:"+o.setTop+"; left:"+o.setLeft+";' dir="+r.langDir+" /></div>");var p=e("#mCSB_"+r.idx),m=e("#mCSB_"+r.idx+"_container");"y"===o.axis||o.advanced.autoExpandHorizontalScroll||m.css("width",y(m)),"outside"===o.scrollbarPosition?("static"===t.css("position")&&t.css("position","relative"),t.css("overflow","visible"),p.addClass("mCSB_outside").after(c)):(p.addClass("mCSB_inside").append(c),m.wrap(d)),x.call(this);var g=[e("#mCSB_"+r.idx+"_dragger_vertical"),e("#mCSB_"+r.idx+"_dragger_horizontal")];g[0].css("min-height",g[0].height()),g[1].css("min-width",g[1].width())},y=function(t){var n=[t[0].scrollWidth,Math.max.apply(Math,t.children().map(function(){return e(this).outerWidth(!0)}).get())],i=t.parent().width();return n[0]>i?n[0]:n[1]>i?n[1]:"100%"},b=function(){var t=e(this),n=t.data(i),r=n.opt,o=e("#mCSB_"+n.idx+"_container");if(r.advanced.autoExpandHorizontalScroll&&"y"!==r.axis){o.css({width:"auto","min-width":0,"overflow-x":"scroll"});var s=Math.ceil(o[0].scrollWidth);3===r.advanced.autoExpandHorizontalScroll||2!==r.advanced.autoExpandHorizontalScroll&&s>o.parent().width()?o.css({width:s,"min-width":"100%","overflow-x":"inherit"}):o.css({"overflow-x":"inherit",position:"absolute"}).wrap("<div class='mCSB_h_wrapper' style='position:relative; left:0; width:999999px;' />").css({width:Math.ceil(o[0].getBoundingClientRect().right+.4)-Math.floor(o[0].getBoundingClientRect().left),"min-width":"100%",position:"relative"}).unwrap()}},x=function(){var t=e(this),n=t.data(i),r=n.opt,o=e(".mCSB_"+n.idx+"_scrollbar:first"),s=ee(r.scrollButtons.tabindex)?"tabindex='"+r.scrollButtons.tabindex+"'":"",a=["<a href='#' class='"+u[13]+"' oncontextmenu='return false;' "+s+" />","<a href='#' class='"+u[14]+"' oncontextmenu='return false;' "+s+" />","<a href='#' class='"+u[15]+"' oncontextmenu='return false;' "+s+" />","<a href='#' class='"+u[16]+"' oncontextmenu='return false;' "+s+" />"],l=["x"===r.axis?a[2]:a[0],"x"===r.axis?a[3]:a[1],a[2],a[3]];r.scrollButtons.enable&&o.prepend(l[0]).append(l[1]).next(".mCSB_scrollTools").prepend(l[2]).append(l[3])},w=function(){var t=e(this),n=t.data(i),r=e("#mCSB_"+n.idx),o=e("#mCSB_"+n.idx+"_container"),s=[e("#mCSB_"+n.idx+"_dragger_vertical"),e("#mCSB_"+n.idx+"_dragger_horizontal")],a=[r.height()/o.outerHeight(!1),r.width()/o.outerWidth(!1)],c=[parseInt(s[0].css("min-height")),Math.round(a[0]*s[0].parent().height()),parseInt(s[1].css("min-width")),Math.round(a[1]*s[1].parent().width())],u=l&&c[1]<c[0]?c[0]:c[1],d=l&&c[3]<c[2]?c[2]:c[3];s[0].css({height:u,"max-height":s[0].parent().height()-10}).find(".mCSB_dragger_bar").css({"line-height":c[0]+"px"}),s[1].css({width:d,"max-width":s[1].parent().width()-10})},C=function(){var t=e(this),n=t.data(i),r=e("#mCSB_"+n.idx),o=e("#mCSB_"+n.idx+"_container"),s=[e("#mCSB_"+n.idx+"_dragger_vertical"),e("#mCSB_"+n.idx+"_dragger_horizontal")],a=[o.outerHeight(!1)-r.height(),o.outerWidth(!1)-r.width()],l=[a[0]/(s[0].parent().height()-s[0].height()),a[1]/(s[1].parent().width()-s[1].width())];n.scrollRatio={y:l[0],x:l[1]}},k=function(e,t,n){var i=n?u[0]+"_expanded":"",r=e.closest(".mCSB_scrollTools");"active"===t?(e.toggleClass(u[0]+" "+i),r.toggleClass(u[1]),e[0]._draggable=e[0]._draggable?0:1):e[0]._draggable||("hide"===t?(e.removeClass(u[0]),r.removeClass(u[1])):(e.addClass(u[0]),r.addClass(u[1])))},_=function(){var t=e(this),n=t.data(i),r=e("#mCSB_"+n.idx),o=e("#mCSB_"+n.idx+"_container"),s=null==n.overflowed?o.height():o.outerHeight(!1),a=null==n.overflowed?o.width():o.outerWidth(!1),l=o[0].scrollHeight,c=o[0].scrollWidth;return l>s&&(s=l),c>a&&(a=c),[s>r.height(),a>r.width()]},S=function(){var t=e(this),n=t.data(i),r=n.opt,o=e("#mCSB_"+n.idx),s=e("#mCSB_"+n.idx+"_container"),a=[e("#mCSB_"+n.idx+"_dragger_vertical"),e("#mCSB_"+n.idx+"_dragger_horizontal")];if(U(t),("x"!==r.axis&&!n.overflowed[0]||"y"===r.axis&&n.overflowed[0])&&(a[0].add(s).css("top",0),V(t,"_resetY")),"y"!==r.axis&&!n.overflowed[1]||"x"===r.axis&&n.overflowed[1]){var l=dx=0;"rtl"===n.langDir&&(l=o.width()-s.outerWidth(!1),dx=Math.abs(l/n.scrollRatio.x)),s.css("left",l),a[1].css("left",dx),V(t,"_resetX")}},T=function(){function t(){s=setTimeout(function(){e.event.special.mousewheel?(clearTimeout(s),O.call(n[0])):t()},100)}var n=e(this),r=n.data(i),o=r.opt;if(!r.bindEvents){if(L.call(this),o.contentTouchScroll&&A.call(this),$.call(this),o.mouseWheel.enable){var s;t()}R.call(this),H.call(this),o.advanced.autoScrollOnFocus&&P.call(this),o.scrollButtons.enable&&B.call(this),o.keyboard.enable&&j.call(this),r.bindEvents=!0}},D=function(){var t=e(this),n=t.data(i),r=n.opt,o=i+"_"+n.idx,s=".mCSB_"+n.idx+"_scrollbar",a=e("#mCSB_"+n.idx+",#mCSB_"+n.idx+"_container,#mCSB_"+n.idx+"_container_wrapper,"+s+" ."+u[12]+",#mCSB_"+n.idx+"_dragger_vertical,#mCSB_"+n.idx+"_dragger_horizontal,"+s+">a"),l=e("#mCSB_"+n.idx+"_container");r.advanced.releaseDraggableSelectors&&a.add(e(r.advanced.releaseDraggableSelectors)),r.advanced.extraDraggableSelectors&&a.add(e(r.advanced.extraDraggableSelectors)),n.bindEvents&&(e(document).add(e(!N()||top.document)).unbind("."+o),a.each(function(){e(this).unbind("."+o)}),clearTimeout(t[0]._focusTimeout),K(t[0],"_focusTimeout"),clearTimeout(n.sequential.step),K(n.sequential,"step"),clearTimeout(l[0].onCompleteTimeout),K(l[0],"onCompleteTimeout"),n.bindEvents=!1)},M=function(t){var n=e(this),r=n.data(i),o=r.opt,s=e("#mCSB_"+r.idx+"_container_wrapper"),a=s.length?s:e("#mCSB_"+r.idx+"_container"),l=[e("#mCSB_"+r.idx+"_scrollbar_vertical"),e("#mCSB_"+r.idx+"_scrollbar_horizontal")],c=[l[0].find(".mCSB_dragger"),l[1].find(".mCSB_dragger")];"x"!==o.axis&&(r.overflowed[0]&&!t?(l[0].add(c[0]).add(l[0].children("a")).css("display","block"),a.removeClass(u[8]+" "+u[10])):(o.alwaysShowScrollbar?(2!==o.alwaysShowScrollbar&&c[0].css("display","none"),a.removeClass(u[10])):(l[0].css("display","none"),a.addClass(u[10])),a.addClass(u[8]))),"y"!==o.axis&&(r.overflowed[1]&&!t?(l[1].add(c[1]).add(l[1].children("a")).css("display","block"),a.removeClass(u[9]+" "+u[11])):(o.alwaysShowScrollbar?(2!==o.alwaysShowScrollbar&&c[1].css("display","none"),a.removeClass(u[11])):(l[1].css("display","none"),a.addClass(u[11])),a.addClass(u[9]))),r.overflowed[0]||r.overflowed[1]?n.removeClass(u[5]):n.addClass(u[5])},E=function(t){var n=t.type,i=t.target.ownerDocument!==document?[e(frameElement).offset().top,e(frameElement).offset().left]:null,r=N()&&t.target.ownerDocument!==top.document?[e(t.view.frameElement).offset().top,e(t.view.frameElement).offset().left]:[0,0];switch(n){case"pointerdown":case"MSPointerDown":case"pointermove":case"MSPointerMove":case"pointerup":case"MSPointerUp":return i?[t.originalEvent.pageY-i[0]+r[0],t.originalEvent.pageX-i[1]+r[1],!1]:[t.originalEvent.pageY,t.originalEvent.pageX,!1];case"touchstart":case"touchmove":case"touchend":var o=t.originalEvent.touches[0]||t.originalEvent.changedTouches[0],s=t.originalEvent.touches.length||t.originalEvent.changedTouches.length;return t.target.ownerDocument!==document?[o.screenY,o.screenX,s>1]:[o.pageY,o.pageX,s>1];default:return i?[t.pageY-i[0]+r[0],t.pageX-i[1]+r[1],!1]:[t.pageY,t.pageX,!1]}},L=function(){function t(e){var t=p.find("iframe");if(t.length){var n=e?"auto":"none";t.css("pointer-events",n)}}function n(e,t,n,i){if(p[0].idleTimer=d.scrollInertia<233?250:0,r.attr("id")===f[1])var o="x",s=(r[0].offsetLeft-t+i)*u.scrollRatio.x;else var o="y",s=(r[0].offsetTop-e+n)*u.scrollRatio.y;V(a,s.toString(),{dir:o,drag:!0})}var r,o,s,a=e(this),u=a.data(i),d=u.opt,h=i+"_"+u.idx,f=["mCSB_"+u.idx+"_dragger_vertical","mCSB_"+u.idx+"_dragger_horizontal"],p=e("#mCSB_"+u.idx+"_container"),m=e("#"+f[0]+",#"+f[1]),g=d.advanced.releaseDraggableSelectors?m.add(e(d.advanced.releaseDraggableSelectors)):m,v=d.advanced.extraDraggableSelectors?e(!N()||top.document).add(e(d.advanced.extraDraggableSelectors)):e(!N()||top.document);m.bind("mousedown."+h+" touchstart."+h+" pointerdown."+h+" MSPointerDown."+h,function(n){if(n.stopImmediatePropagation(),n.preventDefault(),Q(n)){c=!0,l&&(document.onselectstart=function(){return!1}),t(!1),U(a),r=e(this);var i=r.offset(),u=E(n)[0]-i.top,h=E(n)[1]-i.left,f=r.height()+i.top,p=r.width()+i.left;f>u&&u>0&&p>h&&h>0&&(o=u,s=h),k(r,"active",d.autoExpandScrollbar)}}).bind("touchmove."+h,function(e){e.stopImmediatePropagation(),e.preventDefault();var t=r.offset(),i=E(e)[0]-t.top,a=E(e)[1]-t.left;n(o,s,i,a)}),e(document).add(v).bind("mousemove."+h+" pointermove."+h+" MSPointerMove."+h,function(e){if(r){var t=r.offset(),i=E(e)[0]-t.top,a=E(e)[1]-t.left;if(o===i&&s===a)return;n(o,s,i,a)}}).add(g).bind("mouseup."+h+" touchend."+h+" pointerup."+h+" MSPointerUp."+h,function(e){r&&(k(r,"active",d.autoExpandScrollbar),r=null),c=!1,l&&(document.onselectstart=null),t(!0)})},A=function(){function n(e){if(!J(e)||c||E(e)[2])return void(t=0);t=1,C=0,k=0,u=1,_.removeClass("mCS_touch_action");var n=L.offset();d=E(e)[0]-n.top,h=E(e)[1]-n.left,P=[E(e)[0],E(e)[1]]}function r(e){if(J(e)&&!c&&!E(e)[2]&&(T.documentTouchScroll||e.preventDefault(),e.stopImmediatePropagation(),(!k||C)&&u)){g=X();var t=M.offset(),n=E(e)[0]-t.top,i=E(e)[1]-t.left,r="mcsLinearOut";if($.push(n),O.push(i),P[2]=Math.abs(E(e)[0]-P[0]),P[3]=Math.abs(E(e)[1]-P[1]),S.overflowed[0])var o=A[0].parent().height()-A[0].height(),s=d-n>0&&n-d>-(o*S.scrollRatio.y)&&(2*P[3]<P[2]||"yx"===T.axis);if(S.overflowed[1])var a=A[1].parent().width()-A[1].width(),f=h-i>0&&i-h>-(a*S.scrollRatio.x)&&(2*P[2]<P[3]||"yx"===T.axis);s||f?(j||e.preventDefault(),C=1):(k=1,_.addClass("mCS_touch_action")),j&&e.preventDefault(),x="yx"===T.axis?[d-n,h-i]:"x"===T.axis?[null,h-i]:[d-n,null],L[0].idleTimer=250,S.overflowed[0]&&l(x[0],I,r,"y","all",!0),S.overflowed[1]&&l(x[1],I,r,"x",R,!0)}}function o(e){if(!J(e)||c||E(e)[2])return void(t=0);t=1,e.stopImmediatePropagation(),U(_),m=X();var n=M.offset();f=E(e)[0]-n.top,p=E(e)[1]-n.left,$=[],O=[]}function s(e){if(J(e)&&!c&&!E(e)[2]){u=0,e.stopImmediatePropagation(),C=0,k=0,v=X();var t=M.offset(),n=E(e)[0]-t.top,i=E(e)[1]-t.left;if(!(v-g>30)){b=1e3/(v-m);var r="mcsEaseOut",o=2.5>b,s=o?[$[$.length-2],O[O.length-2]]:[0,0];y=o?[n-s[0],i-s[1]]:[n-f,i-p];var d=[Math.abs(y[0]),Math.abs(y[1])];b=o?[Math.abs(y[0]/4),Math.abs(y[1]/4)]:[b,b];var h=[Math.abs(L[0].offsetTop)-y[0]*a(d[0]/b[0],b[0]),Math.abs(L[0].offsetLeft)-y[1]*a(d[1]/b[1],b[1])];x="yx"===T.axis?[h[0],h[1]]:"x"===T.axis?[null,h[1]]:[h[0],null],w=[4*d[0]+T.scrollInertia,4*d[1]+T.scrollInertia];var _=parseInt(T.contentTouchScroll)||0;x[0]=d[0]>_?x[0]:0,x[1]=d[1]>_?x[1]:0,S.overflowed[0]&&l(x[0],w[0],r,"y",R,!1),S.overflowed[1]&&l(x[1],w[1],r,"x",R,!1)}}}function a(e,t){var n=[1.5*t,2*t,t/1.5,t/2];return e>90?t>4?n[0]:n[3]:e>60?t>3?n[3]:n[2]:e>30?t>8?n[1]:t>6?n[0]:t>4?t:n[2]:t>8?t:n[3]}function l(e,t,n,i,r,o){e&&V(_,e.toString(),{dur:t,scrollEasing:n,dir:i,overwrite:r,drag:o})}var u,d,h,f,p,m,g,v,y,b,x,w,C,k,_=e(this),S=_.data(i),T=S.opt,D=i+"_"+S.idx,M=e("#mCSB_"+S.idx),L=e("#mCSB_"+S.idx+"_container"),A=[e("#mCSB_"+S.idx+"_dragger_vertical"),e("#mCSB_"+S.idx+"_dragger_horizontal")],$=[],O=[],I=0,R="yx"===T.axis?"none":"all",P=[],H=L.find("iframe"),B=["touchstart."+D+" pointerdown."+D+" MSPointerDown."+D,"touchmove."+D+" pointermove."+D+" MSPointerMove."+D,"touchend."+D+" pointerup."+D+" MSPointerUp."+D],j=void 0!==document.body.style.touchAction;L.bind(B[0],function(e){n(e)}).bind(B[1],function(e){r(e)}),M.bind(B[0],function(e){o(e)}).bind(B[2],function(e){s(e)}),H.length&&H.each(function(){e(this).load(function(){N(this)&&e(this.contentDocument||this.contentWindow.document).bind(B[0],function(e){n(e),o(e)}).bind(B[1],function(e){r(e)}).bind(B[2],function(e){s(e)})})})},$=function(){function n(){return window.getSelection?window.getSelection().toString():document.selection&&"Control"!=document.selection.type?document.selection.createRange().text:0}function r(e,t,n){u.type=n&&o?"stepped":"stepless",u.scrollAmount=10,F(s,e,t,"mcsLinearOut",n?60:null)}var o,s=e(this),a=s.data(i),l=a.opt,u=a.sequential,d=i+"_"+a.idx,h=e("#mCSB_"+a.idx+"_container"),f=h.parent();h.bind("mousedown."+d,function(e){t||o||(o=1,c=!0)}).add(document).bind("mousemove."+d,function(e){if(!t&&o&&n()){var i=h.offset(),s=E(e)[0]-i.top+h[0].offsetTop,c=E(e)[1]-i.left+h[0].offsetLeft;s>0&&s<f.height()&&c>0&&c<f.width()?u.step&&r("off",null,"stepped"):("x"!==l.axis&&a.overflowed[0]&&(0>s?r("on",38):s>f.height()&&r("on",40)),"y"!==l.axis&&a.overflowed[1]&&(0>c?r("on",37):c>f.width()&&r("on",39)))}}).bind("mouseup."+d+" dragend."+d,function(e){t||(o&&(o=0,r("off",null)),c=!1)})},O=function(){function t(t,i){if(U(n),!I(n,t.target)){var s="auto"!==o.mouseWheel.deltaFactor?parseInt(o.mouseWheel.deltaFactor):l&&t.deltaFactor<100?100:t.deltaFactor||100,u=o.scrollInertia;if("x"===o.axis||"x"===o.mouseWheel.axis)var d="x",h=[Math.round(s*r.scrollRatio.x),parseInt(o.mouseWheel.scrollAmount)],f="auto"!==o.mouseWheel.scrollAmount?h[1]:h[0]>=a.width()?.9*a.width():h[0],p=Math.abs(e("#mCSB_"+r.idx+"_container")[0].offsetLeft),m=c[1][0].offsetLeft,g=c[1].parent().width()-c[1].width(),v=t.deltaX||t.deltaY||i;else var d="y",h=[Math.round(s*r.scrollRatio.y),parseInt(o.mouseWheel.scrollAmount)],f="auto"!==o.mouseWheel.scrollAmount?h[1]:h[0]>=a.height()?.9*a.height():h[0],p=Math.abs(e("#mCSB_"+r.idx+"_container")[0].offsetTop),m=c[0][0].offsetTop,g=c[0].parent().height()-c[0].height(),v=t.deltaY||i;"y"===d&&!r.overflowed[0]||"x"===d&&!r.overflowed[1]||((o.mouseWheel.invert||t.webkitDirectionInvertedFromDevice)&&(v=-v),o.mouseWheel.normalizeDelta&&(v=0>v?-1:1),(v>0&&0!==m||0>v&&m!==g||o.mouseWheel.preventDefault)&&(t.stopImmediatePropagation(),t.preventDefault()),t.deltaFactor<2&&!o.mouseWheel.normalizeDelta&&(f=t.deltaFactor,u=17),V(n,(p-v*f).toString(),{dir:d,dur:u}))}}if(e(this).data(i)){var n=e(this),r=n.data(i),o=r.opt,s=i+"_"+r.idx,a=e("#mCSB_"+r.idx),c=[e("#mCSB_"+r.idx+"_dragger_vertical"),e("#mCSB_"+r.idx+"_dragger_horizontal")],u=e("#mCSB_"+r.idx+"_container").find("iframe");u.length&&u.each(function(){e(this).load(function(){N(this)&&e(this.contentDocument||this.contentWindow.document).bind("mousewheel."+s,function(e,n){t(e,n)})})}),a.bind("mousewheel."+s,function(e,n){t(e,n)})}},N=function(e){var t=null;if(e){try{var n=e.contentDocument||e.contentWindow.document;t=n.body.innerHTML}catch(i){}return null!==t}try{var n=top.document;t=n.body.innerHTML}catch(i){}return null!==t},I=function(t,n){var r=n.nodeName.toLowerCase(),o=t.data(i).opt.mouseWheel.disableOver,s=["select","textarea"];return e.inArray(r,o)>-1&&!(e.inArray(r,s)>-1&&!e(n).is(":focus"))},R=function(){var t,n=e(this),r=n.data(i),o=i+"_"+r.idx,s=e("#mCSB_"+r.idx+"_container"),a=s.parent(),l=e(".mCSB_"+r.idx+"_scrollbar ."+u[12]);l.bind("mousedown."+o+" touchstart."+o+" pointerdown."+o+" MSPointerDown."+o,function(n){c=!0,e(n.target).hasClass("mCSB_dragger")||(t=1)}).bind("touchend."+o+" pointerup."+o+" MSPointerUp."+o,function(e){c=!1}).bind("click."+o,function(i){if(t&&(t=0,e(i.target).hasClass(u[12])||e(i.target).hasClass("mCSB_draggerRail"))){U(n);var o=e(this),l=o.find(".mCSB_dragger");if(o.parent(".mCSB_scrollTools_horizontal").length>0){if(!r.overflowed[1])return;var c="x",d=i.pageX>l.offset().left?-1:1,h=Math.abs(s[0].offsetLeft)-.9*d*a.width()}else{if(!r.overflowed[0])return;var c="y",d=i.pageY>l.offset().top?-1:1,h=Math.abs(s[0].offsetTop)-.9*d*a.height()}V(n,h.toString(),{dir:c,scrollEasing:"mcsEaseInOut"})}})},P=function(){var t=e(this),n=t.data(i),r=n.opt,o=i+"_"+n.idx,s=e("#mCSB_"+n.idx+"_container"),a=s.parent();s.bind("focusin."+o,function(n){var i=e(document.activeElement),o=s.find(".mCustomScrollBox").length,l=0;i.is(r.advanced.autoScrollOnFocus)&&(U(t),clearTimeout(t[0]._focusTimeout),t[0]._focusTimer=o?(l+17)*o:0,t[0]._focusTimeout=setTimeout(function(){var e=[te(i)[0],te(i)[1]],n=[s[0].offsetTop,s[0].offsetLeft],o=[n[0]+e[0]>=0&&n[0]+e[0]<a.height()-i.outerHeight(!1),n[1]+e[1]>=0&&n[0]+e[1]<a.width()-i.outerWidth(!1)],c="yx"!==r.axis||o[0]||o[1]?"all":"none";"x"===r.axis||o[0]||V(t,e[0].toString(),{dir:"y",scrollEasing:"mcsEaseInOut",overwrite:c,dur:l}),"y"===r.axis||o[1]||V(t,e[1].toString(),{dir:"x",scrollEasing:"mcsEaseInOut",overwrite:c,dur:l})},t[0]._focusTimer))})},H=function(){var t=e(this),n=t.data(i),r=i+"_"+n.idx,o=e("#mCSB_"+n.idx+"_container").parent();o.bind("scroll."+r,function(t){(0!==o.scrollTop()||0!==o.scrollLeft())&&e(".mCSB_"+n.idx+"_scrollbar").css("visibility","hidden")})},B=function(){var t=e(this),n=t.data(i),r=n.opt,o=n.sequential,s=i+"_"+n.idx,a=".mCSB_"+n.idx+"_scrollbar",l=e(a+">a");l.bind("mousedown."+s+" touchstart."+s+" pointerdown."+s+" MSPointerDown."+s+" mouseup."+s+" touchend."+s+" pointerup."+s+" MSPointerUp."+s+" mouseout."+s+" pointerout."+s+" MSPointerOut."+s+" click."+s,function(i){function s(e,n){o.scrollAmount=r.scrollButtons.scrollAmount,F(t,e,n)}if(i.preventDefault(),Q(i)){var a=e(this).attr("class");switch(o.type=r.scrollButtons.scrollType,i.type){case"mousedown":case"touchstart":case"pointerdown":case"MSPointerDown":if("stepped"===o.type)return;c=!0,n.tweenRunning=!1,s("on",a);break;case"mouseup":case"touchend":case"pointerup":case"MSPointerUp":case"mouseout":case"pointerout":case"MSPointerOut":if("stepped"===o.type)return;c=!1,o.dir&&s("off",a);break;case"click":if("stepped"!==o.type||n.tweenRunning)return;s("on",a)}}})},j=function(){function t(t){function i(e,t){s.type=o.keyboard.scrollType,s.scrollAmount=o.keyboard.scrollAmount,"stepped"===s.type&&r.tweenRunning||F(n,e,t)}switch(t.type){case"blur":r.tweenRunning&&s.dir&&i("off",null);break;case"keydown":case"keyup":var a=t.keyCode?t.keyCode:t.which,l="on";if("x"!==o.axis&&(38===a||40===a)||"y"!==o.axis&&(37===a||39===a)){if((38===a||40===a)&&!r.overflowed[0]||(37===a||39===a)&&!r.overflowed[1])return;"keyup"===t.type&&(l="off"),e(document.activeElement).is(d)||(t.preventDefault(),t.stopImmediatePropagation(),i(l,a))}else if(33===a||34===a){if((r.overflowed[0]||r.overflowed[1])&&(t.preventDefault(),t.stopImmediatePropagation()),"keyup"===t.type){U(n);var h=34===a?-1:1;if("x"===o.axis||"yx"===o.axis&&r.overflowed[1]&&!r.overflowed[0])var f="x",p=Math.abs(c[0].offsetLeft)-.9*h*u.width();else var f="y",p=Math.abs(c[0].offsetTop)-.9*h*u.height();V(n,p.toString(),{dir:f,scrollEasing:"mcsEaseInOut"})}}else if((35===a||36===a)&&!e(document.activeElement).is(d)&&((r.overflowed[0]||r.overflowed[1])&&(t.preventDefault(),t.stopImmediatePropagation()),"keyup"===t.type)){if("x"===o.axis||"yx"===o.axis&&r.overflowed[1]&&!r.overflowed[0])var f="x",p=35===a?Math.abs(u.width()-c.outerWidth(!1)):0;else var f="y",p=35===a?Math.abs(u.height()-c.outerHeight(!1)):0;
  V(n,p.toString(),{dir:f,scrollEasing:"mcsEaseInOut"})}}}var n=e(this),r=n.data(i),o=r.opt,s=r.sequential,a=i+"_"+r.idx,l=e("#mCSB_"+r.idx),c=e("#mCSB_"+r.idx+"_container"),u=c.parent(),d="input,textarea,select,datalist,keygen,[contenteditable='true']",h=c.find("iframe"),f=["blur."+a+" keydown."+a+" keyup."+a];h.length&&h.each(function(){e(this).load(function(){N(this)&&e(this.contentDocument||this.contentWindow.document).bind(f[0],function(e){t(e)})})}),l.attr("tabindex","0").bind(f[0],function(e){t(e)})},F=function(t,n,r,o,s){function a(e){d.snapAmount&&(h.scrollAmount=d.snapAmount instanceof Array?"x"===h.dir[0]?d.snapAmount[1]:d.snapAmount[0]:d.snapAmount);var n="stepped"!==h.type,i=s?s:e?n?m/1.5:g:1e3/60,r=e?n?7.5:40:2.5,l=[Math.abs(f[0].offsetTop),Math.abs(f[0].offsetLeft)],u=[c.scrollRatio.y>10?10:c.scrollRatio.y,c.scrollRatio.x>10?10:c.scrollRatio.x],p="x"===h.dir[0]?l[1]+h.dir[1]*u[1]*r:l[0]+h.dir[1]*u[0]*r,v="x"===h.dir[0]?l[1]+h.dir[1]*parseInt(h.scrollAmount):l[0]+h.dir[1]*parseInt(h.scrollAmount),y="auto"!==h.scrollAmount?v:p,b=o?o:e?n?"mcsLinearOut":"mcsEaseInOut":"mcsLinear",x=!!e;return e&&17>i&&(y="x"===h.dir[0]?l[1]:l[0]),V(t,y.toString(),{dir:h.dir[0],scrollEasing:b,dur:i,onComplete:x}),e?void(h.dir=!1):(clearTimeout(h.step),void(h.step=setTimeout(function(){a()},i)))}function l(){clearTimeout(h.step),K(h,"step"),U(t)}var c=t.data(i),d=c.opt,h=c.sequential,f=e("#mCSB_"+c.idx+"_container"),p="stepped"===h.type,m=d.scrollInertia<26?26:d.scrollInertia,g=d.scrollInertia<1?17:d.scrollInertia;switch(n){case"on":if(h.dir=[r===u[16]||r===u[15]||39===r||37===r?"x":"y",r===u[13]||r===u[15]||38===r||37===r?-1:1],U(t),ee(r)&&"stepped"===h.type)return;a(p);break;case"off":l(),(p||c.tweenRunning&&h.dir)&&a(!0)}},W=function(t){var n=e(this).data(i).opt,r=[];return"function"==typeof t&&(t=t()),t instanceof Array?r=t.length>1?[t[0],t[1]]:"x"===n.axis?[null,t[0]]:[t[0],null]:(r[0]=t.y?t.y:t.x||"x"===n.axis?null:t,r[1]=t.x?t.x:t.y||"y"===n.axis?null:t),"function"==typeof r[0]&&(r[0]=r[0]()),"function"==typeof r[1]&&(r[1]=r[1]()),r},q=function(t,n){if(null!=t&&"undefined"!=typeof t){var r=e(this),o=r.data(i),s=o.opt,a=e("#mCSB_"+o.idx+"_container"),l=a.parent(),c=typeof t;n||(n="x"===s.axis?"x":"y");var u="x"===n?a.outerWidth(!1):a.outerHeight(!1),h="x"===n?a[0].offsetLeft:a[0].offsetTop,f="x"===n?"left":"top";switch(c){case"function":return t();case"object":var p=t.jquery?t:e(t);if(!p.length)return;return"x"===n?te(p)[1]:te(p)[0];case"string":case"number":if(ee(t))return Math.abs(t);if(-1!==t.indexOf("%"))return Math.abs(u*parseInt(t)/100);if(-1!==t.indexOf("-="))return Math.abs(h-parseInt(t.split("-=")[1]));if(-1!==t.indexOf("+=")){var m=h+parseInt(t.split("+=")[1]);return m>=0?0:Math.abs(m)}if(-1!==t.indexOf("px")&&ee(t.split("px")[0]))return Math.abs(t.split("px")[0]);if("top"===t||"left"===t)return 0;if("bottom"===t)return Math.abs(l.height()-a.outerHeight(!1));if("right"===t)return Math.abs(l.width()-a.outerWidth(!1));if("first"===t||"last"===t){var p=a.find(":"+t);return"x"===n?te(p)[1]:te(p)[0]}return e(t).length?"x"===n?te(e(t))[1]:te(e(t))[0]:(a.css(f,t),void d.update.call(null,r[0]))}}},z=function(t){function n(){return clearTimeout(h[0].autoUpdate),0===a.parents("html").length?void(a=null):void(h[0].autoUpdate=setTimeout(function(){return c.advanced.updateOnSelectorChange&&(l.poll.change.n=o(),l.poll.change.n!==l.poll.change.o)?(l.poll.change.o=l.poll.change.n,void s(3)):c.advanced.updateOnContentResize&&(l.poll.size.n=a[0].scrollHeight+a[0].scrollWidth+h[0].offsetHeight+a[0].offsetHeight+a[0].offsetWidth,l.poll.size.n!==l.poll.size.o)?(l.poll.size.o=l.poll.size.n,void s(1)):!c.advanced.updateOnImageLoad||"auto"===c.advanced.updateOnImageLoad&&"y"===c.axis||(l.poll.img.n=h.find("img").length,l.poll.img.n===l.poll.img.o)?void((c.advanced.updateOnSelectorChange||c.advanced.updateOnContentResize||c.advanced.updateOnImageLoad)&&n()):(l.poll.img.o=l.poll.img.n,void h.find("img").each(function(){r(this)}))},c.advanced.autoUpdateTimeout))}function r(t){function n(e,t){return function(){return t.apply(e,arguments)}}function i(){this.onload=null,e(t).addClass(u[2]),s(2)}if(e(t).hasClass(u[2]))return void s();var r=new Image;r.onload=n(r,i),r.src=t.src}function o(){c.advanced.updateOnSelectorChange===!0&&(c.advanced.updateOnSelectorChange="*");var e=0,t=h.find(c.advanced.updateOnSelectorChange);return c.advanced.updateOnSelectorChange&&t.length>0&&t.each(function(){e+=this.offsetHeight+this.offsetWidth}),e}function s(e){clearTimeout(h[0].autoUpdate),d.update.call(null,a[0],e)}var a=e(this),l=a.data(i),c=l.opt,h=e("#mCSB_"+l.idx+"_container");return t?(clearTimeout(h[0].autoUpdate),void K(h[0],"autoUpdate")):void n()},Y=function(e,t,n){return Math.round(e/t)*t-n},U=function(t){var n=t.data(i),r=e("#mCSB_"+n.idx+"_container,#mCSB_"+n.idx+"_container_wrapper,#mCSB_"+n.idx+"_dragger_vertical,#mCSB_"+n.idx+"_dragger_horizontal");r.each(function(){Z.call(this)})},V=function(t,n,r){function o(e){return l&&c.callbacks[e]&&"function"==typeof c.callbacks[e]}function s(){return[c.callbacks.alwaysTriggerOffsets||x>=w[0]+_,c.callbacks.alwaysTriggerOffsets||-S>=x]}function a(){var e=[f[0].offsetTop,f[0].offsetLeft],n=[y[0].offsetTop,y[0].offsetLeft],i=[f.outerHeight(!1),f.outerWidth(!1)],o=[h.height(),h.width()];t[0].mcs={content:f,top:e[0],left:e[1],draggerTop:n[0],draggerLeft:n[1],topPct:Math.round(100*Math.abs(e[0])/(Math.abs(i[0])-o[0])),leftPct:Math.round(100*Math.abs(e[1])/(Math.abs(i[1])-o[1])),direction:r.dir}}var l=t.data(i),c=l.opt,u={trigger:"internal",dir:"y",scrollEasing:"mcsEaseOut",drag:!1,dur:c.scrollInertia,overwrite:"all",callbacks:!0,onStart:!0,onUpdate:!0,onComplete:!0},r=e.extend(u,r),d=[r.dur,r.drag?0:r.dur],h=e("#mCSB_"+l.idx),f=e("#mCSB_"+l.idx+"_container"),p=f.parent(),m=c.callbacks.onTotalScrollOffset?W.call(t,c.callbacks.onTotalScrollOffset):[0,0],g=c.callbacks.onTotalScrollBackOffset?W.call(t,c.callbacks.onTotalScrollBackOffset):[0,0];if(l.trigger=r.trigger,(0!==p.scrollTop()||0!==p.scrollLeft())&&(e(".mCSB_"+l.idx+"_scrollbar").css("visibility","visible"),p.scrollTop(0).scrollLeft(0)),"_resetY"!==n||l.contentReset.y||(o("onOverflowYNone")&&c.callbacks.onOverflowYNone.call(t[0]),l.contentReset.y=1),"_resetX"!==n||l.contentReset.x||(o("onOverflowXNone")&&c.callbacks.onOverflowXNone.call(t[0]),l.contentReset.x=1),"_resetY"!==n&&"_resetX"!==n){if(!l.contentReset.y&&t[0].mcs||!l.overflowed[0]||(o("onOverflowY")&&c.callbacks.onOverflowY.call(t[0]),l.contentReset.x=null),!l.contentReset.x&&t[0].mcs||!l.overflowed[1]||(o("onOverflowX")&&c.callbacks.onOverflowX.call(t[0]),l.contentReset.x=null),c.snapAmount){var v=c.snapAmount instanceof Array?"x"===r.dir?c.snapAmount[1]:c.snapAmount[0]:c.snapAmount;n=Y(n,v,c.snapOffset)}switch(r.dir){case"x":var y=e("#mCSB_"+l.idx+"_dragger_horizontal"),b="left",x=f[0].offsetLeft,w=[h.width()-f.outerWidth(!1),y.parent().width()-y.width()],C=[n,0===n?0:n/l.scrollRatio.x],_=m[1],S=g[1],T=_>0?_/l.scrollRatio.x:0,D=S>0?S/l.scrollRatio.x:0;break;case"y":var y=e("#mCSB_"+l.idx+"_dragger_vertical"),b="top",x=f[0].offsetTop,w=[h.height()-f.outerHeight(!1),y.parent().height()-y.height()],C=[n,0===n?0:n/l.scrollRatio.y],_=m[0],S=g[0],T=_>0?_/l.scrollRatio.y:0,D=S>0?S/l.scrollRatio.y:0}C[1]<0||0===C[0]&&0===C[1]?C=[0,0]:C[1]>=w[1]?C=[w[0],w[1]]:C[0]=-C[0],t[0].mcs||(a(),o("onInit")&&c.callbacks.onInit.call(t[0])),clearTimeout(f[0].onCompleteTimeout),G(y[0],b,Math.round(C[1]),d[1],r.scrollEasing),(l.tweenRunning||!(0===x&&C[0]>=0||x===w[0]&&C[0]<=w[0]))&&G(f[0],b,Math.round(C[0]),d[0],r.scrollEasing,r.overwrite,{onStart:function(){r.callbacks&&r.onStart&&!l.tweenRunning&&(o("onScrollStart")&&(a(),c.callbacks.onScrollStart.call(t[0])),l.tweenRunning=!0,k(y),l.cbOffsets=s())},onUpdate:function(){r.callbacks&&r.onUpdate&&o("whileScrolling")&&(a(),c.callbacks.whileScrolling.call(t[0]))},onComplete:function(){if(r.callbacks&&r.onComplete){"yx"===c.axis&&clearTimeout(f[0].onCompleteTimeout);var e=f[0].idleTimer||0;f[0].onCompleteTimeout=setTimeout(function(){o("onScroll")&&(a(),c.callbacks.onScroll.call(t[0])),o("onTotalScroll")&&C[1]>=w[1]-T&&l.cbOffsets[0]&&(a(),c.callbacks.onTotalScroll.call(t[0])),o("onTotalScrollBack")&&C[1]<=D&&l.cbOffsets[1]&&(a(),c.callbacks.onTotalScrollBack.call(t[0])),l.tweenRunning=!1,f[0].idleTimer=0,k(y,"hide")},e)}}})}},G=function(e,t,n,i,r,o,s){function a(){w.stop||(y||p.call(),y=X()-v,l(),y>=w.time&&(w.time=y>w.time?y+h-(y-w.time):y+h-1,w.time<y+1&&(w.time=y+1)),w.time<i?w.id=f(a):g.call())}function l(){i>0?(w.currVal=d(w.time,b,C,i,r),x[t]=Math.round(w.currVal)+"px"):x[t]=n+"px",m.call()}function c(){h=1e3/60,w.time=y+h,f=window.requestAnimationFrame?window.requestAnimationFrame:function(e){return l(),setTimeout(e,.01)},w.id=f(a)}function u(){null!=w.id&&(window.requestAnimationFrame?window.cancelAnimationFrame(w.id):clearTimeout(w.id),w.id=null)}function d(e,t,n,i,r){switch(r){case"linear":case"mcsLinear":return n*e/i+t;case"mcsLinearOut":return e/=i,e--,n*Math.sqrt(1-e*e)+t;case"easeInOutSmooth":return e/=i/2,1>e?n/2*e*e+t:(e--,-n/2*(e*(e-2)-1)+t);case"easeInOutStrong":return e/=i/2,1>e?n/2*Math.pow(2,10*(e-1))+t:(e--,n/2*(-Math.pow(2,-10*e)+2)+t);case"easeInOut":case"mcsEaseInOut":return e/=i/2,1>e?n/2*e*e*e+t:(e-=2,n/2*(e*e*e+2)+t);case"easeOutSmooth":return e/=i,e--,-n*(e*e*e*e-1)+t;case"easeOutStrong":return n*(-Math.pow(2,-10*e/i)+1)+t;case"easeOut":case"mcsEaseOut":default:var o=(e/=i)*e,s=o*e;return t+n*(.499999999999997*s*o+-2.5*o*o+5.5*s+-6.5*o+4*e)}}e._mTween||(e._mTween={top:{},left:{}});var h,f,s=s||{},p=s.onStart||function(){},m=s.onUpdate||function(){},g=s.onComplete||function(){},v=X(),y=0,b=e.offsetTop,x=e.style,w=e._mTween[t];"left"===t&&(b=e.offsetLeft);var C=n-b;w.stop=0,"none"!==o&&u(),c()},X=function(){return window.performance&&window.performance.now?window.performance.now():window.performance&&window.performance.webkitNow?window.performance.webkitNow():Date.now?Date.now():(new Date).getTime()},Z=function(){var e=this;e._mTween||(e._mTween={top:{},left:{}});for(var t=["top","left"],n=0;n<t.length;n++){var i=t[n];e._mTween[i].id&&(window.requestAnimationFrame?window.cancelAnimationFrame(e._mTween[i].id):clearTimeout(e._mTween[i].id),e._mTween[i].id=null,e._mTween[i].stop=1)}},K=function(e,t){try{delete e[t]}catch(n){e[t]=null}},Q=function(e){return!(e.which&&1!==e.which)},J=function(e){var t=e.originalEvent.pointerType;return!(t&&"touch"!==t&&2!==t)},ee=function(e){return!isNaN(parseFloat(e))&&isFinite(e)},te=function(e){var t=e.parents(".mCSB_container");return[e.offset().top-t.offset().top,e.offset().left-t.offset().left]},ne=function(){function e(){var e=["webkit","moz","ms","o"];if("hidden"in document)return"hidden";for(var t=0;t<e.length;t++)if(e[t]+"Hidden"in document)return e[t]+"Hidden";return null}var t=e();return!!t&&document[t]};e.fn[n]=function(t){return d[t]?d[t].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof t&&t?void e.error("Method "+t+" does not exist"):d.init.apply(this,arguments)},e[n]=function(t){return d[t]?d[t].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof t&&t?void e.error("Method "+t+" does not exist"):d.init.apply(this,arguments)},e[n].defaults=o,window[n]=!0,e(window).load(function(){e(r)[n](),e.extend(e.expr[":"],{mcsInView:e.expr[":"].mcsInView||function(t){var n,i,r=e(t),o=r.parents(".mCSB_container");if(o.length)return n=o.parent(),i=[o[0].offsetTop,o[0].offsetLeft],i[0]+te(r)[0]>=0&&i[0]+te(r)[0]<n.height()-r.outerHeight(!1)&&i[1]+te(r)[1]>=0&&i[1]+te(r)[1]<n.width()-r.outerWidth(!1)},mcsOverflow:e.expr[":"].mcsOverflow||function(t){var n=e(t).data(i);if(n)return n.overflowed[0]||n.overflowed[1]}})})})}),+function(e){"use strict";var t="Microsoft Internet Explorer"==window.navigator.appName,n=function(t,n){if(this.$element=e(t),this.$input=this.$element.find(":file"),0!==this.$input.length){this.name=this.$input.attr("name")||n.name,this.$hidden=this.$element.find('input[type=hidden][name="'+this.name+'"]'),0===this.$hidden.length&&(this.$hidden=e('<input type="hidden">').insertBefore(this.$input)),this.$preview=this.$element.find(".fileinput-preview");var i=this.$preview.css("height");"inline"!==this.$preview.css("display")&&"0px"!==i&&"none"!==i&&this.$preview.css("line-height",i),this.original={exists:this.$element.hasClass("fileinput-exists"),preview:this.$preview.html(),hiddenVal:this.$hidden.val()},this.listen()}};n.prototype.listen=function(){this.$input.on("change.bs.fileinput",e.proxy(this.change,this)),e(this.$input[0].form).on("reset.bs.fileinput",e.proxy(this.reset,this)),this.$element.find('[data-trigger="fileinput"]').on("click.bs.fileinput",e.proxy(this.trigger,this)),this.$element.find('[data-dismiss="fileinput"]').on("click.bs.fileinput",e.proxy(this.clear,this))},n.prototype.change=function(t){var n=void 0===t.target.files?t.target&&t.target.value?[{name:t.target.value.replace(/^.+\\/,"")}]:[]:t.target.files;if(t.stopPropagation(),0===n.length)return void this.clear();this.$hidden.val(""),this.$hidden.attr("name",""),this.$input.attr("name",this.name);var i=n[0];if(this.$preview.length>0&&("undefined"!=typeof i.type?i.type.match(/^image\/(gif|png|jpeg)$/):i.name.match(/\.(gif|png|jpe?g)$/i))&&"undefined"!=typeof FileReader){var r=new FileReader,o=this.$preview,s=this.$element;r.onload=function(t){var r=e("<img>");r[0].src=t.target.result,n[0].result=t.target.result,s.find(".fileinput-filename").text(i.name),"none"!=o.css("max-height")&&r.css("max-height",parseInt(o.css("max-height"),10)-parseInt(o.css("padding-top"),10)-parseInt(o.css("padding-bottom"),10)-parseInt(o.css("border-top"),10)-parseInt(o.css("border-bottom"),10)),o.html(r),s.addClass("fileinput-exists").removeClass("fileinput-new"),s.trigger("change.bs.fileinput",n)},r.readAsDataURL(i)}else this.$element.find(".fileinput-filename").text(i.name),this.$preview.text(i.name),this.$element.addClass("fileinput-exists").removeClass("fileinput-new"),this.$element.trigger("change.bs.fileinput")},n.prototype.clear=function(e){if(e&&e.preventDefault(),this.$hidden.val(""),this.$hidden.attr("name",this.name),this.$input.attr("name",""),t){var n=this.$input.clone(!0);this.$input.after(n),this.$input.remove(),this.$input=n}else this.$input.val("");this.$preview.html(""),this.$element.find(".fileinput-filename").text(""),this.$element.addClass("fileinput-new").removeClass("fileinput-exists"),void 0!==e&&(this.$input.trigger("change"),this.$element.trigger("clear.bs.fileinput"))},n.prototype.reset=function(){this.clear(),this.$hidden.val(this.original.hiddenVal),this.$preview.html(this.original.preview),this.$element.find(".fileinput-filename").text(""),this.original.exists?this.$element.addClass("fileinput-exists").removeClass("fileinput-new"):this.$element.addClass("fileinput-new").removeClass("fileinput-exists"),this.$element.trigger("reset.bs.fileinput")},n.prototype.trigger=function(e){this.$input.trigger("click"),e.preventDefault()};var i=e.fn.fileinput;e.fn.fileinput=function(t){return this.each(function(){var i=e(this),r=i.data("bs.fileinput");r||i.data("bs.fileinput",r=new n(this,t)),"string"==typeof t&&r[t]()})},e.fn.fileinput.Constructor=n,e.fn.fileinput.noConflict=function(){return e.fn.fileinput=i,this},e(document).on("click.fileinput.data-api",'[data-provides="fileinput"]',function(t){var n=e(this);if(!n.data("bs.fileinput")){n.fileinput(n.data());var i=e(t.target).closest('[data-dismiss="fileinput"],[data-trigger="fileinput"]');i.length>0&&(t.preventDefault(),i.trigger("click.bs.fileinput"))}})}(window.jQuery),!function(e){"use strict";if("function"==typeof define&&define.amd)define(["jquery","moment"],e);else if("object"==typeof exports)e(require("jquery"),require("moment"));else{if("undefined"==typeof jQuery)throw"bootstrap-datetimepicker requires jQuery to be loaded first";if("undefined"==typeof moment)throw"bootstrap-datetimepicker requires Moment.js to be loaded first";e(jQuery,moment)}}(function(e,t){"use strict";if(!t)throw new Error("bootstrap-datetimepicker requires Moment.js to be loaded first");var n=function(n,i){var r,o,s,a,l,c,u,d={},h=!0,f=!1,p=!1,m=0,g=[{clsName:"days",navFnc:"M",navStep:1},{clsName:"months",navFnc:"y",navStep:1},{clsName:"years",navFnc:"y",navStep:10},{clsName:"decades",navFnc:"y",navStep:100}],v=["days","months","years","decades"],y=["top","bottom","auto"],b=["left","right","auto"],x=["default","top","bottom"],w={up:38,38:"up",down:40,40:"down",left:37,37:"left",right:39,39:"right",tab:9,9:"tab",escape:27,27:"escape",enter:13,13:"enter",pageUp:33,33:"pageUp",pageDown:34,34:"pageDown",shift:16,16:"shift",control:17,17:"control",space:32,32:"space",t:84,84:"t","delete":46,46:"delete"},C={},k=function(e){var n,r,o,s,a,l=!1;return void 0!==t.tz&&void 0!==i.timeZone&&null!==i.timeZone&&""!==i.timeZone&&(l=!0),void 0===e||null===e?n=l?t().tz(i.timeZone).startOf("d"):t().startOf("d"):l?(r=t().tz(i.timeZone).utcOffset(),o=t(e,c,i.useStrict).utcOffset(),o!==r?(s=t().tz(i.timeZone).format("Z"),a=t(e,c,i.useStrict).format("YYYY-MM-DD[T]HH:mm:ss")+s,n=t(a,c,i.useStrict).tz(i.timeZone)):n=t(e,c,i.useStrict).tz(i.timeZone)):n=t(e,c,i.useStrict),n},_=function(e){if("string"!=typeof e||e.length>1)throw new TypeError("isEnabled expects a single character string parameter");switch(e){case"y":return-1!==l.indexOf("Y");case"M":return-1!==l.indexOf("M");case"d":return-1!==l.toLowerCase().indexOf("d");case"h":case"H":return-1!==l.toLowerCase().indexOf("h");case"m":return-1!==l.indexOf("m");case"s":return-1!==l.indexOf("s");default:return!1}},S=function(){return _("h")||_("m")||_("s")},T=function(){return _("y")||_("M")||_("d")},D=function(){var t=e("<thead>").append(e("<tr>").append(e("<th>").addClass("prev").attr("data-action","previous").append(e("<span>").addClass(i.icons.previous))).append(e("<th>").addClass("picker-switch").attr("data-action","pickerSwitch").attr("colspan",i.calendarWeeks?"6":"5")).append(e("<th>").addClass("next").attr("data-action","next").append(e("<span>").addClass(i.icons.next)))),n=e("<tbody>").append(e("<tr>").append(e("<td>").attr("colspan",i.calendarWeeks?"8":"7")));return[e("<div>").addClass("datepicker-days").append(e("<table>").addClass("table-condensed").append(t).append(e("<tbody>"))),e("<div>").addClass("datepicker-months").append(e("<table>").addClass("table-condensed").append(t.clone()).append(n.clone())),e("<div>").addClass("datepicker-years").append(e("<table>").addClass("table-condensed").append(t.clone()).append(n.clone())),e("<div>").addClass("datepicker-decades").append(e("<table>").addClass("table-condensed").append(t.clone()).append(n.clone()))]},M=function(){var t=e("<tr>"),n=e("<tr>"),r=e("<tr>");return _("h")&&(t.append(e("<td>").append(e("<a>").attr({href:"#",tabindex:"-1",title:i.tooltips.incrementHour}).addClass("btn").attr("data-action","incrementHours").append(e("<span>").addClass(i.icons.up)))),n.append(e("<td>").append(e("<span>").addClass("timepicker-hour").attr({"data-time-component":"hours",title:i.tooltips.pickHour}).attr("data-action","showHours"))),r.append(e("<td>").append(e("<a>").attr({href:"#",tabindex:"-1",title:i.tooltips.decrementHour}).addClass("btn").attr("data-action","decrementHours").append(e("<span>").addClass(i.icons.down))))),_("m")&&(_("h")&&(t.append(e("<td>").addClass("separator")),n.append(e("<td>").addClass("separator").html(":")),r.append(e("<td>").addClass("separator"))),t.append(e("<td>").append(e("<a>").attr({href:"#",tabindex:"-1",title:i.tooltips.incrementMinute}).addClass("btn").attr("data-action","incrementMinutes").append(e("<span>").addClass(i.icons.up)))),n.append(e("<td>").append(e("<span>").addClass("timepicker-minute").attr({"data-time-component":"minutes",title:i.tooltips.pickMinute}).attr("data-action","showMinutes"))),r.append(e("<td>").append(e("<a>").attr({href:"#",tabindex:"-1",title:i.tooltips.decrementMinute}).addClass("btn").attr("data-action","decrementMinutes").append(e("<span>").addClass(i.icons.down))))),_("s")&&(_("m")&&(t.append(e("<td>").addClass("separator")),n.append(e("<td>").addClass("separator").html(":")),r.append(e("<td>").addClass("separator"))),t.append(e("<td>").append(e("<a>").attr({href:"#",tabindex:"-1",title:i.tooltips.incrementSecond}).addClass("btn").attr("data-action","incrementSeconds").append(e("<span>").addClass(i.icons.up)))),n.append(e("<td>").append(e("<span>").addClass("timepicker-second").attr({"data-time-component":"seconds",title:i.tooltips.pickSecond}).attr("data-action","showSeconds"))),r.append(e("<td>").append(e("<a>").attr({href:"#",tabindex:"-1",title:i.tooltips.decrementSecond}).addClass("btn").attr("data-action","decrementSeconds").append(e("<span>").addClass(i.icons.down))))),a||(t.append(e("<td>").addClass("separator")),n.append(e("<td>").append(e("<button>").addClass("btn btn-primary").attr({"data-action":"togglePeriod",tabindex:"-1",title:i.tooltips.togglePeriod}))),r.append(e("<td>").addClass("separator"))),e("<div>").addClass("timepicker-picker").append(e("<table>").addClass("table-condensed").append([t,n,r]))},E=function(){var t=e("<div>").addClass("timepicker-hours").append(e("<table>").addClass("table-condensed")),n=e("<div>").addClass("timepicker-minutes").append(e("<table>").addClass("table-condensed")),i=e("<div>").addClass("timepicker-seconds").append(e("<table>").addClass("table-condensed")),r=[M()];return _("h")&&r.push(t),_("m")&&r.push(n),_("s")&&r.push(i),r},L=function(){var t=[];return i.showTodayButton&&t.push(e("<td>").append(e("<a>").attr({"data-action":"today",title:i.tooltips.today}).append(e("<span>").addClass(i.icons.today)))),!i.sideBySide&&T()&&S()&&t.push(e("<td>").append(e("<a>").attr({"data-action":"togglePicker",title:i.tooltips.selectTime}).append(e("<span>").addClass(i.icons.time)))),i.showClear&&t.push(e("<td>").append(e("<a>").attr({"data-action":"clear",title:i.tooltips.clear}).append(e("<span>").addClass(i.icons.clear)))),i.showClose&&t.push(e("<td>").append(e("<a>").attr({"data-action":"close",title:i.tooltips.close}).append(e("<span>").addClass(i.icons.close)))),e("<table>").addClass("table-condensed").append(e("<tbody>").append(e("<tr>").append(t)))},A=function(){var t=e("<div>").addClass("bootstrap-datetimepicker-widget dropdown-menu"),n=e("<div>").addClass("datepicker").append(D()),r=e("<div>").addClass("timepicker").append(E()),o=e("<ul>").addClass("list-unstyled"),s=e("<li>").addClass("picker-switch"+(i.collapse?" accordion-toggle":"")).append(L());return i.inline&&t.removeClass("dropdown-menu"),a&&t.addClass("usetwentyfour"),_("s")&&!a&&t.addClass("wider"),i.sideBySide&&T()&&S()?(t.addClass("timepicker-sbs"),"top"===i.toolbarPlacement&&t.append(s),t.append(e("<div>").addClass("row").append(n.addClass("col-md-6")).append(r.addClass("col-md-6"))),"bottom"===i.toolbarPlacement&&t.append(s),t):("top"===i.toolbarPlacement&&o.append(s),T()&&o.append(e("<li>").addClass(i.collapse&&S()?"collapse in":"").append(n)),"default"===i.toolbarPlacement&&o.append(s),S()&&o.append(e("<li>").addClass(i.collapse&&T()?"collapse":"").append(r)),"bottom"===i.toolbarPlacement&&o.append(s),t.append(o))},$=function(){var t,r={};return t=n.is("input")||i.inline?n.data():n.find("input").data(),t.dateOptions&&t.dateOptions instanceof Object&&(r=e.extend(!0,r,t.dateOptions)),e.each(i,function(e){var n="date"+e.charAt(0).toUpperCase()+e.slice(1);void 0!==t[n]&&(r[e]=t[n])}),r},O=function(){var t,r=(f||n).position(),o=(f||n).offset(),s=i.widgetPositioning.vertical,a=i.widgetPositioning.horizontal;if(i.widgetParent)t=i.widgetParent.append(p);else if(n.is("input"))t=n.after(p).parent();else{if(i.inline)return void(t=n.append(p));t=n,n.children().first().after(p)}if("auto"===s&&(s=o.top+1.5*p.height()>=e(window).height()+e(window).scrollTop()&&p.height()+n.outerHeight()<o.top?"top":"bottom"),"auto"===a&&(a=t.width()<o.left+p.outerWidth()/2&&o.left+p.outerWidth()>e(window).width()?"right":"left"),"top"===s?p.addClass("top").removeClass("bottom"):p.addClass("bottom").removeClass("top"),"right"===a?p.addClass("pull-right"):p.removeClass("pull-right"),"relative"!==t.css("position")&&(t=t.parents().filter(function(){return"relative"===e(this).css("position")}).first()),0===t.length)throw new Error("datetimepicker component should be placed within a relative positioned container");p.css({top:"top"===s?"auto":r.top+n.outerHeight(),bottom:"top"===s?r.top+n.outerHeight():"auto",left:"left"===a?t===n?0:r.left:"auto",right:"left"===a?"auto":t.outerWidth()-n.outerWidth()-(t===n?0:r.left)})},N=function(e){"dp.change"===e.type&&(e.date&&e.date.isSame(e.oldDate)||!e.date&&!e.oldDate)||n.trigger(e)},I=function(e){"y"===e&&(e="YYYY"),N({type:"dp.update",change:e,viewDate:o.clone()})},R=function(e){p&&(e&&(u=Math.max(m,Math.min(3,u+e))),p.find(".datepicker > div").hide().filter(".datepicker-"+g[u].clsName).show())},P=function(){var t=e("<tr>"),n=o.clone().startOf("w").startOf("d");for(i.calendarWeeks===!0&&t.append(e("<th>").addClass("cw").text("#"));n.isBefore(o.clone().endOf("w"));)t.append(e("<th>").addClass("dow").text(n.format("dd"))),n.add(1,"d");p.find(".datepicker-days thead").append(t)},H=function(e){return i.disabledDates[e.format("YYYY-MM-DD")]===!0},B=function(e){return i.enabledDates[e.format("YYYY-MM-DD")]===!0},j=function(e){return i.disabledHours[e.format("H")]===!0},F=function(e){return i.enabledHours[e.format("H")]===!0},W=function(t,n){if(!t.isValid())return!1;if(i.disabledDates&&"d"===n&&H(t))return!1;if(i.enabledDates&&"d"===n&&!B(t))return!1;if(i.minDate&&t.isBefore(i.minDate,n))return!1;if(i.maxDate&&t.isAfter(i.maxDate,n))return!1;if(i.daysOfWeekDisabled&&"d"===n&&-1!==i.daysOfWeekDisabled.indexOf(t.day()))return!1;if(i.disabledHours&&("h"===n||"m"===n||"s"===n)&&j(t))return!1;if(i.enabledHours&&("h"===n||"m"===n||"s"===n)&&!F(t))return!1;if(i.disabledTimeIntervals&&("h"===n||"m"===n||"s"===n)){var r=!1;if(e.each(i.disabledTimeIntervals,function(){return t.isBetween(this[0],this[1])?(r=!0,!1):void 0}),r)return!1}return!0},q=function(){for(var t=[],n=o.clone().startOf("y").startOf("d");n.isSame(o,"y");)t.push(e("<span>").attr("data-action","selectMonth").addClass("month").text(n.format("MMM"))),n.add(1,"M");p.find(".datepicker-months td").empty().append(t)},z=function(){var t=p.find(".datepicker-months"),n=t.find("th"),s=t.find("tbody").find("span");n.eq(0).find("span").attr("title",i.tooltips.prevYear),n.eq(1).attr("title",i.tooltips.selectYear),n.eq(2).find("span").attr("title",i.tooltips.nextYear),t.find(".disabled").removeClass("disabled"),W(o.clone().subtract(1,"y"),"y")||n.eq(0).addClass("disabled"),n.eq(1).text(o.year()),W(o.clone().add(1,"y"),"y")||n.eq(2).addClass("disabled"),s.removeClass("active"),r.isSame(o,"y")&&!h&&s.eq(r.month()).addClass("active"),s.each(function(t){W(o.clone().month(t),"M")||e(this).addClass("disabled")})},Y=function(){var e=p.find(".datepicker-years"),t=e.find("th"),n=o.clone().subtract(5,"y"),s=o.clone().add(6,"y"),a="";for(t.eq(0).find("span").attr("title",i.tooltips.prevDecade),t.eq(1).attr("title",i.tooltips.selectDecade),t.eq(2).find("span").attr("title",i.tooltips.nextDecade),e.find(".disabled").removeClass("disabled"),i.minDate&&i.minDate.isAfter(n,"y")&&t.eq(0).addClass("disabled"),t.eq(1).text(n.year()+"-"+s.year()),i.maxDate&&i.maxDate.isBefore(s,"y")&&t.eq(2).addClass("disabled");!n.isAfter(s,"y");)a+='<span data-action="selectYear" class="year'+(n.isSame(r,"y")&&!h?" active":"")+(W(n,"y")?"":" disabled")+'">'+n.year()+"</span>",n.add(1,"y");e.find("td").html(a)},U=function(){var e=p.find(".datepicker-decades"),n=e.find("th"),s=t({y:o.year()-o.year()%100-1}),a=s.clone().add(100,"y"),l=s.clone(),c="";for(n.eq(0).find("span").attr("title",i.tooltips.prevCentury),n.eq(2).find("span").attr("title",i.tooltips.nextCentury),e.find(".disabled").removeClass("disabled"),(s.isSame(t({y:1900}))||i.minDate&&i.minDate.isAfter(s,"y"))&&n.eq(0).addClass("disabled"),n.eq(1).text(s.year()+"-"+a.year()),(s.isSame(t({y:2e3}))||i.maxDate&&i.maxDate.isBefore(a,"y"))&&n.eq(2).addClass("disabled");!s.isAfter(a,"y");)c+='<span data-action="selectDecade" class="decade'+(s.isSame(r,"y")?" active":"")+(W(s,"y")?"":" disabled")+'" data-selection="'+(s.year()+6)+'">'+(s.year()+1)+" - "+(s.year()+12)+"</span>",s.add(12,"y");c+="<span></span><span></span><span></span>",e.find("td").html(c),n.eq(1).text(l.year()+1+"-"+s.year())},V=function(){var t,n,s,a,l=p.find(".datepicker-days"),c=l.find("th"),u=[];if(T()){for(c.eq(0).find("span").attr("title",i.tooltips.prevMonth),c.eq(1).attr("title",i.tooltips.selectMonth),c.eq(2).find("span").attr("title",i.tooltips.nextMonth),l.find(".disabled").removeClass("disabled"),c.eq(1).text(o.format(i.dayViewHeaderFormat)),W(o.clone().subtract(1,"M"),"M")||c.eq(0).addClass("disabled"),W(o.clone().add(1,"M"),"M")||c.eq(2).addClass("disabled"),t=o.clone().startOf("M").startOf("w").startOf("d"),a=0;42>a;a++)0===t.weekday()&&(n=e("<tr>"),i.calendarWeeks&&n.append('<td class="cw">'+t.week()+"</td>"),u.push(n)),s="",t.isBefore(o,"M")&&(s+=" old"),t.isAfter(o,"M")&&(s+=" new"),t.isSame(r,"d")&&!h&&(s+=" active"),W(t,"d")||(s+=" disabled"),t.isSame(k(),"d")&&(s+=" today"),(0===t.day()||6===t.day())&&(s+=" weekend"),n.append('<td data-action="selectDay" data-day="'+t.format("L")+'" class="day'+s+'">'+t.date()+"</td>"),t.add(1,"d");l.find("tbody").empty().append(u),z(),Y(),U()}},G=function(){var t=p.find(".timepicker-hours table"),n=o.clone().startOf("d"),i=[],r=e("<tr>");for(o.hour()>11&&!a&&n.hour(12);n.isSame(o,"d")&&(a||o.hour()<12&&n.hour()<12||o.hour()>11);)n.hour()%4===0&&(r=e("<tr>"),i.push(r)),r.append('<td data-action="selectHour" class="hour'+(W(n,"h")?"":" disabled")+'">'+n.format(a?"HH":"hh")+"</td>"),n.add(1,"h");t.empty().append(i)},X=function(){for(var t=p.find(".timepicker-minutes table"),n=o.clone().startOf("h"),r=[],s=e("<tr>"),a=1===i.stepping?5:i.stepping;o.isSame(n,"h");)n.minute()%(4*a)===0&&(s=e("<tr>"),r.push(s)),s.append('<td data-action="selectMinute" class="minute'+(W(n,"m")?"":" disabled")+'">'+n.format("mm")+"</td>"),n.add(a,"m");t.empty().append(r)},Z=function(){for(var t=p.find(".timepicker-seconds table"),n=o.clone().startOf("m"),i=[],r=e("<tr>");o.isSame(n,"m");)n.second()%20===0&&(r=e("<tr>"),i.push(r)),r.append('<td data-action="selectSecond" class="second'+(W(n,"s")?"":" disabled")+'">'+n.format("ss")+"</td>"),n.add(5,"s");t.empty().append(i)},K=function(){var e,t,n=p.find(".timepicker span[data-time-component]");a||(e=p.find(".timepicker [data-action=togglePeriod]"),t=r.clone().add(r.hours()>=12?-12:12,"h"),e.text(r.format("A")),W(t,"h")?e.removeClass("disabled"):e.addClass("disabled")),n.filter("[data-time-component=hours]").text(r.format(a?"HH":"hh")),n.filter("[data-time-component=minutes]").text(r.format("mm")),n.filter("[data-time-component=seconds]").text(r.format("ss")),G(),X(),Z()},Q=function(){p&&(V(),K())},J=function(e){var t=h?null:r;return e?(e=e.clone().locale(i.locale),1!==i.stepping&&e.minutes(Math.round(e.minutes()/i.stepping)*i.stepping%60).seconds(0),void(W(e)?(r=e,o=r.clone(),s.val(r.format(l)),n.data("date",r.format(l)),h=!1,Q(),N({type:"dp.change",date:r.clone(),oldDate:t})):(i.keepInvalid||s.val(h?"":r.format(l)),N({type:"dp.error",date:e})))):(h=!0,s.val(""),n.data("date",""),N({type:"dp.change",date:!1,oldDate:t}),void Q())},ee=function(){var t=!1;return p?(p.find(".collapse").each(function(){var n=e(this).data("collapse");return!n||!n.transitioning||(t=!0,!1)}),t?d:(f&&f.hasClass("btn")&&f.toggleClass("active"),p.hide(),e(window).off("resize",O),p.off("click","[data-action]"),p.off("mousedown",!1),p.remove(),p=!1,N({type:"dp.hide",date:r.clone()}),s.blur(),d)):d},te=function(){J(null)},ne={next:function(){var e=g[u].navFnc;o.add(g[u].navStep,e),V(),I(e)},previous:function(){var e=g[u].navFnc;o.subtract(g[u].navStep,e),V(),I(e)},pickerSwitch:function(){R(1)},selectMonth:function(t){var n=e(t.target).closest("tbody").find("span").index(e(t.target));o.month(n),u===m?(J(r.clone().year(o.year()).month(o.month())),i.inline||ee()):(R(-1),V()),I("M")},selectYear:function(t){var n=parseInt(e(t.target).text(),10)||0;
  o.year(n),u===m?(J(r.clone().year(o.year())),i.inline||ee()):(R(-1),V()),I("YYYY")},selectDecade:function(t){var n=parseInt(e(t.target).data("selection"),10)||0;o.year(n),u===m?(J(r.clone().year(o.year())),i.inline||ee()):(R(-1),V()),I("YYYY")},selectDay:function(t){var n=o.clone();e(t.target).is(".old")&&n.subtract(1,"M"),e(t.target).is(".new")&&n.add(1,"M"),J(n.date(parseInt(e(t.target).text(),10))),S()||i.keepOpen||i.inline||ee()},incrementHours:function(){var e=r.clone().add(1,"h");W(e,"h")&&J(e)},incrementMinutes:function(){var e=r.clone().add(i.stepping,"m");W(e,"m")&&J(e)},incrementSeconds:function(){var e=r.clone().add(1,"s");W(e,"s")&&J(e)},decrementHours:function(){var e=r.clone().subtract(1,"h");W(e,"h")&&J(e)},decrementMinutes:function(){var e=r.clone().subtract(i.stepping,"m");W(e,"m")&&J(e)},decrementSeconds:function(){var e=r.clone().subtract(1,"s");W(e,"s")&&J(e)},togglePeriod:function(){J(r.clone().add(r.hours()>=12?-12:12,"h"))},togglePicker:function(t){var n,r=e(t.target),o=r.closest("ul"),s=o.find(".in"),a=o.find(".collapse:not(.in)");if(s&&s.length){if(n=s.data("collapse"),n&&n.transitioning)return;s.collapse?(s.collapse("hide"),a.collapse("show")):(s.removeClass("in"),a.addClass("in")),r.is("span")?r.toggleClass(i.icons.time+" "+i.icons.date):r.find("span").toggleClass(i.icons.time+" "+i.icons.date)}},showPicker:function(){p.find(".timepicker > div:not(.timepicker-picker)").hide(),p.find(".timepicker .timepicker-picker").show()},showHours:function(){p.find(".timepicker .timepicker-picker").hide(),p.find(".timepicker .timepicker-hours").show()},showMinutes:function(){p.find(".timepicker .timepicker-picker").hide(),p.find(".timepicker .timepicker-minutes").show()},showSeconds:function(){p.find(".timepicker .timepicker-picker").hide(),p.find(".timepicker .timepicker-seconds").show()},selectHour:function(t){var n=parseInt(e(t.target).text(),10);a||(r.hours()>=12?12!==n&&(n+=12):12===n&&(n=0)),J(r.clone().hours(n)),ne.showPicker.call(d)},selectMinute:function(t){J(r.clone().minutes(parseInt(e(t.target).text(),10))),ne.showPicker.call(d)},selectSecond:function(t){J(r.clone().seconds(parseInt(e(t.target).text(),10))),ne.showPicker.call(d)},clear:te,today:function(){var e=k();W(e,"d")&&J(e)},close:ee},ie=function(t){return!e(t.currentTarget).is(".disabled")&&(ne[e(t.currentTarget).data("action")].apply(d,arguments),!1)},re=function(){var t,n={year:function(e){return e.month(0).date(1).hours(0).seconds(0).minutes(0)},month:function(e){return e.date(1).hours(0).seconds(0).minutes(0)},day:function(e){return e.hours(0).seconds(0).minutes(0)},hour:function(e){return e.seconds(0).minutes(0)},minute:function(e){return e.seconds(0)}};return s.prop("disabled")||!i.ignoreReadonly&&s.prop("readonly")||p?d:(void 0!==s.val()&&0!==s.val().trim().length?J(se(s.val().trim())):i.useCurrent&&h&&(s.is("input")&&0===s.val().trim().length||i.inline)&&(t=k(),"string"==typeof i.useCurrent&&(t=n[i.useCurrent](t)),J(t)),p=A(),P(),q(),p.find(".timepicker-hours").hide(),p.find(".timepicker-minutes").hide(),p.find(".timepicker-seconds").hide(),Q(),R(),e(window).on("resize",O),p.on("click","[data-action]",ie),p.on("mousedown",!1),f&&f.hasClass("btn")&&f.toggleClass("active"),p.show(),O(),i.focusOnShow&&!s.is(":focus")&&s.focus(),N({type:"dp.show"}),d)},oe=function(){return p?ee():re()},se=function(e){return e=void 0===i.parseInputDate?t.isMoment(e)||e instanceof Date?t(e):k(e):i.parseInputDate(e),e.locale(i.locale),e},ae=function(e){var t,n,r,o,s=null,a=[],l={},c=e.which,u="p";C[c]=u;for(t in C)C.hasOwnProperty(t)&&C[t]===u&&(a.push(t),parseInt(t,10)!==c&&(l[t]=!0));for(t in i.keyBinds)if(i.keyBinds.hasOwnProperty(t)&&"function"==typeof i.keyBinds[t]&&(r=t.split(" "),r.length===a.length&&w[c]===r[r.length-1])){for(o=!0,n=r.length-2;n>=0;n--)if(!(w[r[n]]in l)){o=!1;break}if(o){s=i.keyBinds[t];break}}s&&(s.call(d,p),e.stopPropagation(),e.preventDefault())},le=function(e){C[e.which]="r",e.stopPropagation(),e.preventDefault()},ce=function(t){var n=e(t.target).val().trim(),i=n?se(n):null;return J(i),t.stopImmediatePropagation(),!1},ue=function(){s.on({change:ce,blur:i.debug?"":ee,keydown:ae,keyup:le,focus:i.allowInputToggle?re:""}),n.is("input")?s.on({focus:re}):f&&(f.on("click",oe),f.on("mousedown",!1))},de=function(){s.off({change:ce,blur:blur,keydown:ae,keyup:le,focus:i.allowInputToggle?ee:""}),n.is("input")?s.off({focus:re}):f&&(f.off("click",oe),f.off("mousedown",!1))},he=function(t){var n={};return e.each(t,function(){var e=se(this);e.isValid()&&(n[e.format("YYYY-MM-DD")]=!0)}),!!Object.keys(n).length&&n},fe=function(t){var n={};return e.each(t,function(){n[this]=!0}),!!Object.keys(n).length&&n},pe=function(){var e=i.format||"L LT";l=e.replace(/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,function(e){var t=r.localeData().longDateFormat(e)||e;return t.replace(/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,function(e){return r.localeData().longDateFormat(e)||e})}),c=i.extraFormats?i.extraFormats.slice():[],c.indexOf(e)<0&&c.indexOf(l)<0&&c.push(l),a=l.toLowerCase().indexOf("a")<1&&l.replace(/\[.*?\]/g,"").indexOf("h")<1,_("y")&&(m=2),_("M")&&(m=1),_("d")&&(m=0),u=Math.max(m,u),h||J(r)};if(d.destroy=function(){ee(),de(),n.removeData("DateTimePicker"),n.removeData("date")},d.toggle=oe,d.show=re,d.hide=ee,d.disable=function(){return ee(),f&&f.hasClass("btn")&&f.addClass("disabled"),s.prop("disabled",!0),d},d.enable=function(){return f&&f.hasClass("btn")&&f.removeClass("disabled"),s.prop("disabled",!1),d},d.ignoreReadonly=function(e){if(0===arguments.length)return i.ignoreReadonly;if("boolean"!=typeof e)throw new TypeError("ignoreReadonly () expects a boolean parameter");return i.ignoreReadonly=e,d},d.options=function(t){if(0===arguments.length)return e.extend(!0,{},i);if(!(t instanceof Object))throw new TypeError("options() options parameter should be an object");return e.extend(!0,i,t),e.each(i,function(e,t){if(void 0===d[e])throw new TypeError("option "+e+" is not recognized!");d[e](t)}),d},d.date=function(e){if(0===arguments.length)return h?null:r.clone();if(!(null===e||"string"==typeof e||t.isMoment(e)||e instanceof Date))throw new TypeError("date() parameter must be one of [null, string, moment or Date]");return J(null===e?null:se(e)),d},d.format=function(e){if(0===arguments.length)return i.format;if("string"!=typeof e&&("boolean"!=typeof e||e!==!1))throw new TypeError("format() expects a sting or boolean:false parameter "+e);return i.format=e,l&&pe(),d},d.timeZone=function(e){return 0===arguments.length?i.timeZone:(i.timeZone=e,d)},d.dayViewHeaderFormat=function(e){if(0===arguments.length)return i.dayViewHeaderFormat;if("string"!=typeof e)throw new TypeError("dayViewHeaderFormat() expects a string parameter");return i.dayViewHeaderFormat=e,d},d.extraFormats=function(e){if(0===arguments.length)return i.extraFormats;if(e!==!1&&!(e instanceof Array))throw new TypeError("extraFormats() expects an array or false parameter");return i.extraFormats=e,c&&pe(),d},d.disabledDates=function(t){if(0===arguments.length)return i.disabledDates?e.extend({},i.disabledDates):i.disabledDates;if(!t)return i.disabledDates=!1,Q(),d;if(!(t instanceof Array))throw new TypeError("disabledDates() expects an array parameter");return i.disabledDates=he(t),i.enabledDates=!1,Q(),d},d.enabledDates=function(t){if(0===arguments.length)return i.enabledDates?e.extend({},i.enabledDates):i.enabledDates;if(!t)return i.enabledDates=!1,Q(),d;if(!(t instanceof Array))throw new TypeError("enabledDates() expects an array parameter");return i.enabledDates=he(t),i.disabledDates=!1,Q(),d},d.daysOfWeekDisabled=function(e){if(0===arguments.length)return i.daysOfWeekDisabled.splice(0);if("boolean"==typeof e&&!e)return i.daysOfWeekDisabled=!1,Q(),d;if(!(e instanceof Array))throw new TypeError("daysOfWeekDisabled() expects an array parameter");if(i.daysOfWeekDisabled=e.reduce(function(e,t){return t=parseInt(t,10),t>6||0>t||isNaN(t)?e:(-1===e.indexOf(t)&&e.push(t),e)},[]).sort(),i.useCurrent&&!i.keepInvalid){for(var t=0;!W(r,"d");){if(r.add(1,"d"),7===t)throw"Tried 7 times to find a valid date";t++}J(r)}return Q(),d},d.maxDate=function(e){if(0===arguments.length)return i.maxDate?i.maxDate.clone():i.maxDate;if("boolean"==typeof e&&e===!1)return i.maxDate=!1,Q(),d;"string"==typeof e&&("now"===e||"moment"===e)&&(e=k());var t=se(e);if(!t.isValid())throw new TypeError("maxDate() Could not parse date parameter: "+e);if(i.minDate&&t.isBefore(i.minDate))throw new TypeError("maxDate() date parameter is before options.minDate: "+t.format(l));return i.maxDate=t,i.useCurrent&&!i.keepInvalid&&r.isAfter(e)&&J(i.maxDate),o.isAfter(t)&&(o=t.clone().subtract(i.stepping,"m")),Q(),d},d.minDate=function(e){if(0===arguments.length)return i.minDate?i.minDate.clone():i.minDate;if("boolean"==typeof e&&e===!1)return i.minDate=!1,Q(),d;"string"==typeof e&&("now"===e||"moment"===e)&&(e=k());var t=se(e);if(!t.isValid())throw new TypeError("minDate() Could not parse date parameter: "+e);if(i.maxDate&&t.isAfter(i.maxDate))throw new TypeError("minDate() date parameter is after options.maxDate: "+t.format(l));return i.minDate=t,i.useCurrent&&!i.keepInvalid&&r.isBefore(e)&&J(i.minDate),o.isBefore(t)&&(o=t.clone().add(i.stepping,"m")),Q(),d},d.defaultDate=function(e){if(0===arguments.length)return i.defaultDate?i.defaultDate.clone():i.defaultDate;if(!e)return i.defaultDate=!1,d;"string"==typeof e&&("now"===e||"moment"===e)&&(e=k());var t=se(e);if(!t.isValid())throw new TypeError("defaultDate() Could not parse date parameter: "+e);if(!W(t))throw new TypeError("defaultDate() date passed is invalid according to component setup validations");return i.defaultDate=t,(i.defaultDate&&i.inline||""===s.val().trim())&&J(i.defaultDate),d},d.locale=function(e){if(0===arguments.length)return i.locale;if(!t.localeData(e))throw new TypeError("locale() locale "+e+" is not loaded from moment locales!");return i.locale=e,r.locale(i.locale),o.locale(i.locale),l&&pe(),p&&(ee(),re()),d},d.stepping=function(e){return 0===arguments.length?i.stepping:(e=parseInt(e,10),(isNaN(e)||1>e)&&(e=1),i.stepping=e,d)},d.useCurrent=function(e){var t=["year","month","day","hour","minute"];if(0===arguments.length)return i.useCurrent;if("boolean"!=typeof e&&"string"!=typeof e)throw new TypeError("useCurrent() expects a boolean or string parameter");if("string"==typeof e&&-1===t.indexOf(e.toLowerCase()))throw new TypeError("useCurrent() expects a string parameter of "+t.join(", "));return i.useCurrent=e,d},d.collapse=function(e){if(0===arguments.length)return i.collapse;if("boolean"!=typeof e)throw new TypeError("collapse() expects a boolean parameter");return i.collapse===e?d:(i.collapse=e,p&&(ee(),re()),d)},d.icons=function(t){if(0===arguments.length)return e.extend({},i.icons);if(!(t instanceof Object))throw new TypeError("icons() expects parameter to be an Object");return e.extend(i.icons,t),p&&(ee(),re()),d},d.tooltips=function(t){if(0===arguments.length)return e.extend({},i.tooltips);if(!(t instanceof Object))throw new TypeError("tooltips() expects parameter to be an Object");return e.extend(i.tooltips,t),p&&(ee(),re()),d},d.useStrict=function(e){if(0===arguments.length)return i.useStrict;if("boolean"!=typeof e)throw new TypeError("useStrict() expects a boolean parameter");return i.useStrict=e,d},d.sideBySide=function(e){if(0===arguments.length)return i.sideBySide;if("boolean"!=typeof e)throw new TypeError("sideBySide() expects a boolean parameter");return i.sideBySide=e,p&&(ee(),re()),d},d.viewMode=function(e){if(0===arguments.length)return i.viewMode;if("string"!=typeof e)throw new TypeError("viewMode() expects a string parameter");if(-1===v.indexOf(e))throw new TypeError("viewMode() parameter must be one of ("+v.join(", ")+") value");return i.viewMode=e,u=Math.max(v.indexOf(e),m),R(),d},d.toolbarPlacement=function(e){if(0===arguments.length)return i.toolbarPlacement;if("string"!=typeof e)throw new TypeError("toolbarPlacement() expects a string parameter");if(-1===x.indexOf(e))throw new TypeError("toolbarPlacement() parameter must be one of ("+x.join(", ")+") value");return i.toolbarPlacement=e,p&&(ee(),re()),d},d.widgetPositioning=function(t){if(0===arguments.length)return e.extend({},i.widgetPositioning);if("[object Object]"!=={}.toString.call(t))throw new TypeError("widgetPositioning() expects an object variable");if(t.horizontal){if("string"!=typeof t.horizontal)throw new TypeError("widgetPositioning() horizontal variable must be a string");if(t.horizontal=t.horizontal.toLowerCase(),-1===b.indexOf(t.horizontal))throw new TypeError("widgetPositioning() expects horizontal parameter to be one of ("+b.join(", ")+")");i.widgetPositioning.horizontal=t.horizontal}if(t.vertical){if("string"!=typeof t.vertical)throw new TypeError("widgetPositioning() vertical variable must be a string");if(t.vertical=t.vertical.toLowerCase(),-1===y.indexOf(t.vertical))throw new TypeError("widgetPositioning() expects vertical parameter to be one of ("+y.join(", ")+")");i.widgetPositioning.vertical=t.vertical}return Q(),d},d.calendarWeeks=function(e){if(0===arguments.length)return i.calendarWeeks;if("boolean"!=typeof e)throw new TypeError("calendarWeeks() expects parameter to be a boolean value");return i.calendarWeeks=e,Q(),d},d.showTodayButton=function(e){if(0===arguments.length)return i.showTodayButton;if("boolean"!=typeof e)throw new TypeError("showTodayButton() expects a boolean parameter");return i.showTodayButton=e,p&&(ee(),re()),d},d.showClear=function(e){if(0===arguments.length)return i.showClear;if("boolean"!=typeof e)throw new TypeError("showClear() expects a boolean parameter");return i.showClear=e,p&&(ee(),re()),d},d.widgetParent=function(t){if(0===arguments.length)return i.widgetParent;if("string"==typeof t&&(t=e(t)),null!==t&&"string"!=typeof t&&!(t instanceof e))throw new TypeError("widgetParent() expects a string or a jQuery object parameter");return i.widgetParent=t,p&&(ee(),re()),d},d.keepOpen=function(e){if(0===arguments.length)return i.keepOpen;if("boolean"!=typeof e)throw new TypeError("keepOpen() expects a boolean parameter");return i.keepOpen=e,d},d.focusOnShow=function(e){if(0===arguments.length)return i.focusOnShow;if("boolean"!=typeof e)throw new TypeError("focusOnShow() expects a boolean parameter");return i.focusOnShow=e,d},d.inline=function(e){if(0===arguments.length)return i.inline;if("boolean"!=typeof e)throw new TypeError("inline() expects a boolean parameter");return i.inline=e,d},d.clear=function(){return te(),d},d.keyBinds=function(e){return i.keyBinds=e,d},d.getMoment=function(e){return k(e)},d.debug=function(e){if("boolean"!=typeof e)throw new TypeError("debug() expects a boolean parameter");return i.debug=e,d},d.allowInputToggle=function(e){if(0===arguments.length)return i.allowInputToggle;if("boolean"!=typeof e)throw new TypeError("allowInputToggle() expects a boolean parameter");return i.allowInputToggle=e,d},d.showClose=function(e){if(0===arguments.length)return i.showClose;if("boolean"!=typeof e)throw new TypeError("showClose() expects a boolean parameter");return i.showClose=e,d},d.keepInvalid=function(e){if(0===arguments.length)return i.keepInvalid;if("boolean"!=typeof e)throw new TypeError("keepInvalid() expects a boolean parameter");return i.keepInvalid=e,d},d.datepickerInput=function(e){if(0===arguments.length)return i.datepickerInput;if("string"!=typeof e)throw new TypeError("datepickerInput() expects a string parameter");return i.datepickerInput=e,d},d.parseInputDate=function(e){if(0===arguments.length)return i.parseInputDate;if("function"!=typeof e)throw new TypeError("parseInputDate() sholud be as function");return i.parseInputDate=e,d},d.disabledTimeIntervals=function(t){if(0===arguments.length)return i.disabledTimeIntervals?e.extend({},i.disabledTimeIntervals):i.disabledTimeIntervals;if(!t)return i.disabledTimeIntervals=!1,Q(),d;if(!(t instanceof Array))throw new TypeError("disabledTimeIntervals() expects an array parameter");return i.disabledTimeIntervals=t,Q(),d},d.disabledHours=function(t){if(0===arguments.length)return i.disabledHours?e.extend({},i.disabledHours):i.disabledHours;if(!t)return i.disabledHours=!1,Q(),d;if(!(t instanceof Array))throw new TypeError("disabledHours() expects an array parameter");if(i.disabledHours=fe(t),i.enabledHours=!1,i.useCurrent&&!i.keepInvalid){for(var n=0;!W(r,"h");){if(r.add(1,"h"),24===n)throw"Tried 24 times to find a valid date";n++}J(r)}return Q(),d},d.enabledHours=function(t){if(0===arguments.length)return i.enabledHours?e.extend({},i.enabledHours):i.enabledHours;if(!t)return i.enabledHours=!1,Q(),d;if(!(t instanceof Array))throw new TypeError("enabledHours() expects an array parameter");if(i.enabledHours=fe(t),i.disabledHours=!1,i.useCurrent&&!i.keepInvalid){for(var n=0;!W(r,"h");){if(r.add(1,"h"),24===n)throw"Tried 24 times to find a valid date";n++}J(r)}return Q(),d},d.viewDate=function(e){if(0===arguments.length)return o.clone();if(!e)return o=r.clone(),d;if(!("string"==typeof e||t.isMoment(e)||e instanceof Date))throw new TypeError("viewDate() parameter must be one of [string, moment or Date]");return o=se(e),I(),d},n.is("input"))s=n;else if(s=n.find(i.datepickerInput),0===s.size())s=n.find("input");else if(!s.is("input"))throw new Error('CSS class "'+i.datepickerInput+'" cannot be applied to non input element');if(n.hasClass("input-group")&&(f=0===n.find(".datepickerbutton").size()?n.find(".input-group-addon"):n.find(".datepickerbutton")),!i.inline&&!s.is("input"))throw new Error("Could not initialize DateTimePicker without an input element");return r=k(),o=r.clone(),e.extend(!0,i,$()),d.options(i),pe(),ue(),s.prop("disabled")&&d.disable(),s.is("input")&&0!==s.val().trim().length?J(se(s.val().trim())):i.defaultDate&&void 0===s.attr("placeholder")&&J(i.defaultDate),i.inline&&re(),d};e.fn.datetimepicker=function(t){return this.each(function(){var i=e(this);i.data("DateTimePicker")||(t=e.extend(!0,{},e.fn.datetimepicker.defaults,t),i.data("DateTimePicker",n(i,t)))})},e.fn.datetimepicker.defaults={timeZone:"Etc/UTC",format:!1,dayViewHeaderFormat:"MMMM YYYY",extraFormats:!1,stepping:1,minDate:!1,maxDate:!1,useCurrent:!0,collapse:!0,locale:t.locale(),defaultDate:!1,disabledDates:!1,enabledDates:!1,icons:{time:"glyphicon glyphicon-time",date:"glyphicon glyphicon-calendar",up:"glyphicon glyphicon-chevron-up",down:"glyphicon glyphicon-chevron-down",previous:"glyphicon glyphicon-chevron-left",next:"glyphicon glyphicon-chevron-right",today:"glyphicon glyphicon-screenshot",clear:"glyphicon glyphicon-trash",close:"glyphicon glyphicon-remove"},tooltips:{today:"Go to today",clear:"Clear selection",close:"Close the picker",selectMonth:"Select Month",prevMonth:"Previous Month",nextMonth:"Next Month",selectYear:"Select Year",prevYear:"Previous Year",nextYear:"Next Year",selectDecade:"Select Decade",prevDecade:"Previous Decade",nextDecade:"Next Decade",prevCentury:"Previous Century",nextCentury:"Next Century",pickHour:"Pick Hour",incrementHour:"Increment Hour",decrementHour:"Decrement Hour",pickMinute:"Pick Minute",incrementMinute:"Increment Minute",decrementMinute:"Decrement Minute",pickSecond:"Pick Second",incrementSecond:"Increment Second",decrementSecond:"Decrement Second",togglePeriod:"Toggle Period",selectTime:"Select Time"},useStrict:!1,sideBySide:!1,daysOfWeekDisabled:!1,calendarWeeks:!1,viewMode:"days",toolbarPlacement:"default",showTodayButton:!1,showClear:!1,showClose:!1,widgetPositioning:{horizontal:"auto",vertical:"auto"},widgetParent:null,ignoreReadonly:!1,keepOpen:!1,focusOnShow:!0,inline:!1,keepInvalid:!1,datepickerInput:".datepickerinput",keyBinds:{up:function(e){if(e){var t=this.date()||this.getMoment();e.find(".datepicker").is(":visible")?this.date(t.clone().subtract(7,"d")):this.date(t.clone().add(this.stepping(),"m"))}},down:function(e){if(!e)return void this.show();var t=this.date()||this.getMoment();e.find(".datepicker").is(":visible")?this.date(t.clone().add(7,"d")):this.date(t.clone().subtract(this.stepping(),"m"))},"control up":function(e){if(e){var t=this.date()||this.getMoment();e.find(".datepicker").is(":visible")?this.date(t.clone().subtract(1,"y")):this.date(t.clone().add(1,"h"))}},"control down":function(e){if(e){var t=this.date()||this.getMoment();e.find(".datepicker").is(":visible")?this.date(t.clone().add(1,"y")):this.date(t.clone().subtract(1,"h"))}},left:function(e){if(e){var t=this.date()||this.getMoment();e.find(".datepicker").is(":visible")&&this.date(t.clone().subtract(1,"d"))}},right:function(e){if(e){var t=this.date()||this.getMoment();e.find(".datepicker").is(":visible")&&this.date(t.clone().add(1,"d"))}},pageUp:function(e){if(e){var t=this.date()||this.getMoment();e.find(".datepicker").is(":visible")&&this.date(t.clone().subtract(1,"M"))}},pageDown:function(e){if(e){var t=this.date()||this.getMoment();e.find(".datepicker").is(":visible")&&this.date(t.clone().add(1,"M"))}},enter:function(){this.hide()},escape:function(){this.hide()},"control space":function(e){e.find(".timepicker").is(":visible")&&e.find('.btn[data-action="togglePeriod"]').click()},t:function(){this.date(this.getMoment())},"delete":function(){this.clear()}},debug:!1,allowInputToggle:!1,disabledTimeIntervals:!1,disabledHours:!1,enabledHours:!1,viewDate:!1}});