diff --git a/inginious/frontend/static/js/all-minified-rtl.js b/inginious/frontend/static/js/all-minified-rtl.js index f361c5d58..ec47a6e6a 100644 --- a/inginious/frontend/static/js/all-minified-rtl.js +++ b/inginious/frontend/static/js/all-minified-rtl.js @@ -1 +1 @@ -if(!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(e.document)return t(e);throw new Error("jQuery requires a window with a document")}:t(e)}("undefined"!=typeof window?window:this,function(x,I){"use strict";function y(e){return"function"==typeof e&&"number"!=typeof e.nodeType}function m(e){return null!=e&&e===e.window}var e=[],w=x.document,j=Object.getPrototypeOf,a=e.slice,F=e.concat,H=e.push,W=e.indexOf,R={},Y=R.toString,B=R.hasOwnProperty,q=B.toString,z=q.call(Object),g={},V={type:!0,src:!0,noModule:!0};function U(e,t,n){var i,o=(t=t||w).createElement("script");if(o.text=e,n)for(i in V)n[i]&&(o[i]=n[i]);t.head.appendChild(o).parentNode.removeChild(o)}function p(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?R[Y.call(e)]||"object":typeof e}var C=function(e,t){return new C.fn.init(e,t)},G=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;function K(e){var t=!!e&&"length"in e&&e.length,n=p(e);return!y(e)&&!m(e)&&("array"===n||0===t||"number"==typeof t&&0>10|55296,1023&i|56320)}function I(e,t){return t?"\0"===e?"�":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e}function j(){w()}var e,f,_,r,F,p,H,W,x,l,u,w,C,i,k,m,o,s,g,S="sizzle"+ +new Date,v=n.document,T=0,R=0,Y=ce(),B=ce(),y=ce(),q=function(e,t){return e===t&&(u=!0),0},z={}.hasOwnProperty,t=[],V=t.pop,U=t.push,D=t.push,G=t.slice,b=function(e,t){for(var n=0,i=e.length;n+~]|"+a+")"+a+"*"),te=new RegExp("="+a+"*([^\\]'\"]*?)"+a+"*\\]","g"),ne=new RegExp(X),ie=new RegExp("^"+c+"$"),h={ID:new RegExp("^#("+c+")"),CLASS:new RegExp("^\\.("+c+")"),TAG:new RegExp("^("+c+"|[*])"),ATTR:new RegExp("^"+Q),PSEUDO:new RegExp("^"+X),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+a+"*(even|odd|(([+-]|)(\\d*)n|)"+a+"*(?:([+-]|)"+a+"*(\\d+)|))"+a+"*\\)|)","i"),bool:new RegExp("^(?:"+K+")$","i"),needsContext:new RegExp("^"+a+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+a+"*((?:-\\d)?\\d*)"+a+"*\\)|)(?=[^-]|$)","i")},oe=/^(?:input|select|textarea|button)$/i,re=/^h\d$/i,M=/^[^{]+\{\s*\[native \w/,se=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ae=/[+~]/,O=new RegExp("\\\\([\\da-f]{1,6}"+a+"?|("+a+")|.)","ig"),le=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ue=ge(function(e){return!0===e.disabled&&("form"in e||"label"in e)},{dir:"parentNode",next:"legend"});try{D.apply(t=G.call(v.childNodes),v.childNodes),t[v.childNodes.length].nodeType}catch(n){D={apply:t.length?function(e,t){U.apply(e,G.call(t))}:function(e,t){for(var n=e.length,i=0;e[n++]=t[i++];);e.length=n-1}}}function L(e,t,n,i){var o,r,s,a,l,u,c,d=t&&t.ownerDocument,h=t?t.nodeType:9;if(n=n||[],"string"!=typeof e||!e||1!==h&&9!==h&&11!==h)return n;if(!i&&((t?t.ownerDocument||t:v)!==C&&w(t),t=t||C,k)){if(11!==h&&(l=se.exec(e)))if(o=l[1]){if(9===h){if(!(s=t.getElementById(o)))return n;if(s.id===o)return n.push(s),n}else if(d&&(s=d.getElementById(o))&&g(t,s)&&s.id===o)return n.push(s),n}else{if(l[2])return D.apply(n,t.getElementsByTagName(e)),n;if((o=l[3])&&f.getElementsByClassName&&t.getElementsByClassName)return D.apply(n,t.getElementsByClassName(o)),n}if(f.qsa&&!y[e+" "]&&(!m||!m.test(e))){if(1!==h)d=t,c=e;else if("object"!==t.nodeName.toLowerCase()){for((a=t.getAttribute("id"))?a=a.replace(le,I):t.setAttribute("id",a=S),r=(u=p(e)).length;r--;)u[r]="#"+a+" "+$(u[r]);c=u.join(","),d=ae.test(e)&&pe(t.parentNode)||t}if(c)try{return D.apply(n,d.querySelectorAll(c)),n}catch(e){}finally{a===S&&t.removeAttribute("id")}}}return W(e.replace(E,"$1"),t,n,i)}function ce(){var n=[];function i(e,t){return n.push(e+" ")>_.cacheLength&&delete i[n.shift()],i[e+" "]=t}return i}function A(e){return e[S]=!0,e}function N(e){var t=C.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t)}}function de(e,t){for(var n=e.split("|"),i=n.length;i--;)_.attrHandle[n[i]]=t}function he(e,t){var n=t&&e,i=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(i)return i;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function fe(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&ue(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function P(s){return A(function(r){return r=+r,A(function(e,t){for(var n,i=s([],e.length,r),o=i.length;o--;)e[n=i[o]]&&(e[n]=!(t[n]=e[n]))})})}function pe(e){return e&&void 0!==e.getElementsByTagName&&e}for(e in f=L.support={},F=L.isXML=function(e){e=e&&(e.ownerDocument||e).documentElement;return!!e&&"HTML"!==e.nodeName},w=L.setDocument=function(e){var e=e?e.ownerDocument||e:v;return e!==C&&9===e.nodeType&&e.documentElement&&(i=(C=e).documentElement,k=!F(C),v!==C&&(e=C.defaultView)&&e.top!==e&&(e.addEventListener?e.addEventListener("unload",j,!1):e.attachEvent&&e.attachEvent("onunload",j)),f.attributes=N(function(e){return e.className="i",!e.getAttribute("className")}),f.getElementsByTagName=N(function(e){return e.appendChild(C.createComment("")),!e.getElementsByTagName("*").length}),f.getElementsByClassName=M.test(C.getElementsByClassName),f.getById=N(function(e){return i.appendChild(e).id=S,!C.getElementsByName||!C.getElementsByName(S).length}),f.getById?(_.filter.ID=function(e){var t=e.replace(O,d);return function(e){return e.getAttribute("id")===t}},_.find.ID=function(e,t){if(void 0!==t.getElementById&&k)return(t=t.getElementById(e))?[t]:[]}):(_.filter.ID=function(e){var t=e.replace(O,d);return function(e){e=void 0!==e.getAttributeNode&&e.getAttributeNode("id");return e&&e.value===t}},_.find.ID=function(e,t){if(void 0!==t.getElementById&&k){var n,i,o,r=t.getElementById(e);if(r){if((n=r.getAttributeNode("id"))&&n.value===e)return[r];for(o=t.getElementsByName(e),i=0;r=o[i++];)if((n=r.getAttributeNode("id"))&&n.value===e)return[r]}return[]}}),_.find.TAG=f.getElementsByTagName?function(e,t){return void 0!==t.getElementsByTagName?t.getElementsByTagName(e):f.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,i=[],o=0,r=t.getElementsByTagName(e);if("*"!==e)return r;for(;n=r[o++];)1===n.nodeType&&i.push(n);return i},_.find.CLASS=f.getElementsByClassName&&function(e,t){if(void 0!==t.getElementsByClassName&&k)return t.getElementsByClassName(e)},o=[],m=[],(f.qsa=M.test(C.querySelectorAll))&&(N(function(e){i.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&m.push("[*^$]="+a+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||m.push("\\["+a+"*(?:value|"+K+")"),e.querySelectorAll("[id~="+S+"-]").length||m.push("~="),e.querySelectorAll(":checked").length||m.push(":checked"),e.querySelectorAll("a#"+S+"+*").length||m.push(".#.+[+~]")}),N(function(e){e.innerHTML="";var t=C.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&m.push("name"+a+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&m.push(":enabled",":disabled"),i.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&m.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),m.push(",.*:")})),(f.matchesSelector=M.test(s=i.matches||i.webkitMatchesSelector||i.mozMatchesSelector||i.oMatchesSelector||i.msMatchesSelector))&&N(function(e){f.disconnectedMatch=s.call(e,"*"),s.call(e,"[s!='']:x"),o.push("!=",X)}),m=m.length&&new RegExp(m.join("|")),o=o.length&&new RegExp(o.join("|")),e=M.test(i.compareDocumentPosition),g=e||M.test(i.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,t=t&&t.parentNode;return e===t||!(!t||1!==t.nodeType||!(n.contains?n.contains(t):e.compareDocumentPosition&&16&e.compareDocumentPosition(t)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},q=e?function(e,t){var n;return e===t?(u=!0,0):!e.compareDocumentPosition-!t.compareDocumentPosition||(1&(n=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!f.sortDetached&&t.compareDocumentPosition(e)===n?e===C||e.ownerDocument===v&&g(v,e)?-1:t===C||t.ownerDocument===v&&g(v,t)?1:l?b(l,e)-b(l,t):0:4&n?-1:1)}:function(e,t){if(e===t)return u=!0,0;var n,i=0,o=e.parentNode,r=t.parentNode,s=[e],a=[t];if(!o||!r)return e===C?-1:t===C?1:o?-1:r?1:l?b(l,e)-b(l,t):0;if(o===r)return he(e,t);for(n=e;n=n.parentNode;)s.unshift(n);for(n=t;n=n.parentNode;)a.unshift(n);for(;s[i]===a[i];)i++;return i?he(s[i],a[i]):s[i]===v?-1:a[i]===v?1:0}),C},L.matches=function(e,t){return L(e,null,null,t)},L.matchesSelector=function(e,t){if((e.ownerDocument||e)!==C&&w(e),t=t.replace(te,"='$1']"),f.matchesSelector&&k&&!y[t+" "]&&(!o||!o.test(t))&&(!m||!m.test(t)))try{var n=s.call(e,t);if(n||f.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){}return 0":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(O,d),e[3]=(e[3]||e[4]||e[5]||"").replace(O,d),"~="===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]||L.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]&&L.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return h.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&ne.test(n)&&(t=(t=p(n,!0))&&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(O,d).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=Y[e+" "];return t||(t=new RegExp("(^|"+a+")"+e+"("+a+"|$)"))&&Y(e,function(e){return t.test("string"==typeof e.className&&e.className||void 0!==e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(t,n,i){return function(e){e=L.attr(e,t);return null==e?"!="===n:!n||(e+="","="===n?e===i:"!="===n?e!==i:"^="===n?i&&0===e.indexOf(i):"*="===n?i&&-1:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function J(e,n,i){return y(n)?C.grep(e,function(e,t){return!!n.call(e,t,e)!==i}):n.nodeType?C.grep(e,function(e){return e===n!==i}):"string"!=typeof n?C.grep(e,function(e){return-1)[^>]*|#([\w-]+))$/,ne=((C.fn.init=function(e,t,n){if(e){if(n=n||ee,"string"!=typeof e)return e.nodeType?(this[0]=e,this.length=1,this):y(e)?void 0!==n.ready?n.ready(e):e(C):C.makeArray(e,this);if(!(i="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:te.exec(e))||!i[1]&&t)return(!t||t.jquery?t||n:this.constructor(t)).find(e);if(i[1]){if(t=t instanceof C?t[0]:t,C.merge(this,C.parseHTML(i[1],t&&t.nodeType?t.ownerDocument||t:w,!0)),Z.test(i[1])&&C.isPlainObject(t))for(var i in t)y(this[i])?this[i](t[i]):this.attr(i,t[i])}else(n=w.getElementById(i[2]))&&(this[0]=n,this.length=1)}return this}).prototype=C.fn,ee=C(w),/^(?:parents|prev(?:Until|All))/),ie={children:!0,contents:!0,next:!0,prev:!0};function oe(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}C.fn.extend({has:function(e){var t=C(e,this),n=t.length;return this.filter(function(){for(var e=0;e\x20\t\r\n\f]+)/i,Ce=/^$|^module$|\/(?:java|ecma)script/i,S={option:[1,""],thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};function T(e,t){var n=void 0!==e.getElementsByTagName?e.getElementsByTagName(t||"*"):void 0!==e.querySelectorAll?e.querySelectorAll(t||"*"):[];return void 0===t||t&&l(e,t)?C.merge([e],n):n}function ke(e,t){for(var n=0,i=e.length;nx",g.noCloneChecked=!!L.cloneNode(!0).lastChild.defaultValue;var De=w.documentElement,Ee=/^key/,Me=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Oe=/^([^.]*)(?:\.(.+)|)/;function Le(){return!0}function D(){return!1}function Ae(){try{return w.activeElement}catch(e){}}function Ne(e,t,n,i,o,r){var s,a;if("object"==typeof t){for(a in"string"!=typeof n&&(i=i||n,n=void 0),t)Ne(e,a,n,i,t[a],r);return e}if(null==i&&null==o?(o=n,i=n=void 0):null==o&&("string"==typeof n?(o=i,i=void 0):(o=i,i=n,n=void 0)),!1===o)o=D;else if(!o)return e;return 1===r&&(s=o,(o=function(e){return C().off(e),s.apply(this,arguments)}).guid=s.guid||(s.guid=C.guid++)),e.each(function(){C.event.add(this,t,o,i,n)})}C.event={global:{},add:function(t,e,n,i,o){var r,s,a,l,u,c,d,h,f,p=v.get(t);if(p)for(n.handler&&(n=(r=n).handler,o=r.selector),o&&C.find.matchesSelector(De,o),n.guid||(n.guid=C.guid++),a=(a=p.events)||(p.events={}),s=(s=p.handle)||(p.handle=function(e){return void 0!==C&&C.event.triggered!==e.type?C.event.dispatch.apply(t,arguments):void 0}),l=(e=(e||"").match(k)||[""]).length;l--;)d=f=(h=Oe.exec(e[l])||[])[1],h=(h[2]||"").split(".").sort(),d&&(u=C.event.special[d]||{},d=(o?u.delegateType:u.bindType)||d,u=C.event.special[d]||{},f=C.extend({type:d,origType:f,data:i,handler:n,guid:n.guid,selector:o,needsContext:o&&C.expr.match.needsContext.test(o),namespace:h.join(".")},r),(c=a[d])||((c=a[d]=[]).delegateCount=0,u.setup&&!1!==u.setup.call(t,i,h,s))||t.addEventListener&&t.addEventListener(d,s),u.add&&(u.add.call(t,f),f.handler.guid||(f.handler.guid=n.guid)),o?c.splice(c.delegateCount++,0,f):c.push(f),C.event.global[d]=!0)},remove:function(e,t,n,i,o){var r,s,a,l,u,c,d,h,f,p,m,g=v.hasData(e)&&v.get(e);if(g&&(l=g.events)){for(u=(t=(t||"").match(k)||[""]).length;u--;)if(f=m=(a=Oe.exec(t[u])||[])[1],p=(a[2]||"").split(".").sort(),f){for(d=C.event.special[f]||{},h=l[f=(i?d.delegateType:d.bindType)||f]||[],a=a[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),s=r=h.length;r--;)c=h[r],!o&&m!==c.origType||n&&n.guid!==c.guid||a&&!a.test(c.namespace)||i&&i!==c.selector&&("**"!==i||!c.selector)||(h.splice(r,1),c.selector&&h.delegateCount--,d.remove&&d.remove.call(e,c));s&&!h.length&&(d.teardown&&!1!==d.teardown.call(e,p,g.handle)||C.removeEvent(e,f,g.handle),delete l[f])}else for(f in l)C.event.remove(e,f+t[u],n,i,!0);C.isEmptyObject(l)&&v.remove(e,"handle events")}},dispatch:function(e){var t,n,i,o,r,s=C.event.fix(e),a=new Array(arguments.length),e=(v.get(this,"events")||{})[s.type]||[],l=C.event.special[s.type]||{};for(a[0]=s,t=1;t\x20\t\r\n\f]*)[^>]*)\/>/gi,$e=/\s*$/g;function Fe(e,t){return l(e,"table")&&l(11!==t.nodeType?t:t.firstChild,"tr")&&C(e).children("tbody")[0]||e}function He(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function We(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Re(e,t){var n,i,o,r,s,a;if(1===t.nodeType){if(v.hasData(e)&&(r=v.access(e),s=v.set(t,r),a=r.events))for(o in delete s.handle,s.events={},a)for(n=0,i=a[o].length;n")},clone:function(e,t,n){var i,o,r,s,a,l,u,c=e.cloneNode(!0),d=C.contains(e.ownerDocument,e);if(!(g.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||C.isXMLDoc(e)))for(s=T(c),i=0,o=(r=T(e)).length;i").prop({charset:n.scriptCharset,src:n.url}).on("load error",o=function(e){i.remove(),o=null,e&&t("error"===e.type?404:200,e.type)}),w.head.appendChild(i[0])},abort:function(){o&&o()}}}),[]),Ut=/(=)\?(?=&|$)|\?\?/,Gt=(C.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Vt.pop()||C.expando+"_"+St++;return this[e]=!0,e}}),C.ajaxPrefilter("json jsonp",function(e,t,n){var i,o,r,s=!1!==e.jsonp&&(Ut.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Ut.test(e.data)&&"data");if(s||"jsonp"===e.dataTypes[0])return i=e.jsonpCallback=y(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,s?e[s]=e[s].replace(Ut,"$1"+i):!1!==e.jsonp&&(e.url+=(Tt.test(e.url)?"&":"?")+e.jsonp+"="+i),e.converters["script json"]=function(){return r||C.error(i+" was not called"),r[0]},e.dataTypes[0]="json",o=x[i],x[i]=function(){r=arguments},n.always(function(){void 0===o?C(x).removeProp(i):x[i]=o,e[i]&&(e.jsonpCallback=t.jsonpCallback,Vt.push(i)),r&&y(o)&&o(r[0]),r=o=void 0}),"script"}),g.createHTMLDocument=((e=w.implementation.createHTMLDocument("").body).innerHTML="
",2===e.childNodes.length),C.parseHTML=function(e,t,n){var i;return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(g.createHTMLDocument?((i=(t=w.implementation.createHTMLDocument("")).createElement("base")).href=w.location.href,t.head.appendChild(i)):t=w),i=!n&&[],(n=Z.exec(e))?[t.createElement(n[1])]:(n=Te([e],t,i),i&&i.length&&C(i).remove(),C.merge([],n.childNodes)))},C.fn.load=function(e,t,n){var i,o,r,s=this,a=e.indexOf(" ");return-1").append(C.parseHTML(e)).find(i):e)}).always(n&&function(e,t){s.each(function(){n.apply(this,r||[e.responseText,t,e])})}),this},C.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){C.fn[t]=function(e){return this.on(t,e)}}),C.expr.pseudos.animated=function(t){return C.grep(C.timers,function(e){return t===e.elem}).length},C.offset={setOffset:function(e,t,n){var i,o,r,s,a=C.css(e,"position"),l=C(e),u={};"static"===a&&(e.style.position="relative"),r=l.offset(),i=C.css(e,"top"),s=C.css(e,"left"),a=("absolute"===a||"fixed"===a)&&-1<(i+s).indexOf("auto")?(o=(a=l.position()).top,a.left):(o=parseFloat(i)||0,parseFloat(s)||0),null!=(t=y(t)?t.call(e,n,C.extend({},r)):t).top&&(u.top=t.top-r.top+o),null!=t.left&&(u.left=t.left-r.left+a),"using"in t?t.using.call(e,u):l.css(u)}},C.fn.extend({offset:function(t){var e,n;return arguments.length?void 0===t?this:this.each(function(e){C.offset.setOffset(this,t,e)}):(n=this[0])?n.getClientRects().length?(e=n.getBoundingClientRect(),n=n.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,i=this[0],o={top:0,left:0};if("fixed"===C.css(i,"position"))t=i.getBoundingClientRect();else{for(t=this.offset(),n=i.ownerDocument,e=i.offsetParent||n.documentElement;e&&(e===n.body||e===n.documentElement)&&"static"===C.css(e,"position");)e=e.parentNode;e&&e!==i&&1===e.nodeType&&((o=C(e).offset()).top+=C.css(e,"borderTopWidth",!0),o.left+=C.css(e,"borderLeftWidth",!0))}return{top:t.top-o.top-C.css(i,"marginTop",!0),left:t.left-o.left-C.css(i,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var e=this.offsetParent;e&&"static"===C.css(e,"position");)e=e.offsetParent;return e||De})}}),C.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,o){var r="pageYOffset"===o;C.fn[t]=function(e){return d(this,function(e,t,n){var i;if(m(e)?i=e:9===e.nodeType&&(i=e.defaultView),void 0===n)return i?i[o]:e[t];i?i.scrollTo(r?i.pageXOffset:n,r?n:i.pageYOffset):e[t]=n},t,e,arguments.length)}}),C.each(["top","left"],function(e,n){C.cssHooks[n]=Je(g.pixelPosition,function(e,t){if(t)return t=M(e,n),Qe.test(t)?C(e).position()[n]+"px":t})}),C.each({Height:"height",Width:"width"},function(s,a){C.each({padding:"inner"+s,content:a,"":"outer"+s},function(i,r){C.fn[r]=function(e,t){var n=arguments.length&&(i||"boolean"!=typeof e),o=i||(!0===e||!0===t?"margin":"border");return d(this,function(e,t,n){var i;return m(e)?0===r.indexOf("outer")?e["inner"+s]:e.document.documentElement["client"+s]:9===e.nodeType?(i=e.documentElement,Math.max(e.body["scroll"+s],i["scroll"+s],e.body["offset"+s],i["offset"+s],i["client"+s])):void 0===n?C.css(e,t,o):C.style(e,t,n,o)},a,n?e:void 0,n)}})}),C.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){C.fn[n]=function(e,t){return 0").get(0).files,m.formdata=void 0!==window.FormData,!!O.fn.prop);O.fn.attr2=function(){var e;return A&&((e=this.prop.apply(this,arguments))&&e.jquery||"string"==typeof e)?e:this.attr.apply(this,arguments)},O.fn.ajaxSubmit=function(l){function e(e){function u(t){var n=null;try{t.contentWindow&&(n=t.contentWindow.document)}catch(e){L("cannot get iframe.contentWindow document: "+e)}if(!n)try{n=t.contentDocument||t.document}catch(e){L("cannot get iframe.contentDocument: "+e),n=t.document}return n}function t(){var e=E.attr2("target"),t=E.attr2("action"),n=E.attr("enctype")||E.attr("encoding")||"multipart/form-data",i=(a.setAttribute("target",r),D&&!/post/i.test(D)||a.setAttribute("method","POST"),t!=d.url&&a.setAttribute("action",d.url),d.skipEncodingOverride||D&&!/post/i.test(D)||E.attr({encoding:"multipart/form-data",enctype:"multipart/form-data"}),d.timeout&&(v=setTimeout(function(){g=!0,c(y)},d.timeout)),[]);try{if(d.extraData)for(var o in d.extraData)d.extraData.hasOwnProperty(o)&&i.push((O.isPlainObject(d.extraData[o])&&d.extraData[o].hasOwnProperty("name")&&d.extraData[o].hasOwnProperty("value")?O('').val(d.extraData[o].value):O('').val(d.extraData[o])).appendTo(a)[0]);d.iframeTarget||f.appendTo("body"),p.attachEvent?p.attachEvent("onload",c):p.addEventListener("load",c,!1),setTimeout(function e(){try{var t=u(p).readyState;L("state = "+t),t&&"uninitialized"==t.toLowerCase()&&setTimeout(e,50)}catch(e){L("Server abort: ",e," (",e.name,")"),c(b),v&&clearTimeout(v),v=void 0}},15);try{a.submit()}catch(e){document.createElement("form").submit.apply(a)}}finally{a.setAttribute("action",t),a.setAttribute("enctype",n),e?a.setAttribute("target",e):E.removeAttr("target"),O(i).remove()}}function c(t){if(!m.aborted&&!w)if((x=u(p))||(L("cannot access response document"),t=b),t===y&&m)m.abort("timeout"),T.reject(m,"timeout");else if(t==b&&m)m.abort("server abort"),T.reject(m,"error","server abort");else if(x&&x.location.href!=d.iframeSrc||g){p.detachEvent?p.detachEvent("onload",c):p.removeEventListener("load",c,!1);var n,t="success";try{if(g)throw"timeout";var e="xml"==d.dataType||x.XMLDocument||O.isXMLDoc(x);if(L("isXml="+e),!e&&window.opera&&(null===x.body||!x.body.innerHTML)&&--C)return L("requeing onLoad callback, DOM not available"),void setTimeout(c,250);var i,o,r,s=x.body||x.documentElement,a=(m.responseText=s?s.innerHTML:null,m.responseXML=x.XMLDocument||x,e&&(d.dataType="xml"),m.getResponseHeader=function(e){return{"content-type":d.dataType}[e.toLowerCase()]},s&&(m.status=Number(s.getAttribute("status"))||m.status,m.statusText=s.getAttribute("statusText")||m.statusText),(d.dataType||"").toLowerCase()),l=/(json|script|text)/.test(a);l||d.textarea?(i=x.getElementsByTagName("textarea")[0])?(m.responseText=i.value,m.status=Number(i.getAttribute("status"))||m.status,m.statusText=i.getAttribute("statusText")||m.statusText):l&&(o=x.getElementsByTagName("pre")[0],r=x.getElementsByTagName("body")[0],o?m.responseText=o.textContent||o.innerText:r&&(m.responseText=r.textContent||r.innerText)):"xml"==a&&!m.responseXML&&m.responseText&&(m.responseXML=k(m.responseText));try{_=S(m,a,d)}catch(e){t="parsererror",m.error=n=e||t}}catch(e){L("error caught: ",e),t="error",m.error=n=e||t}m.aborted&&(L("upload aborted"),t=null),"success"===(t=m.status?200<=m.status&&m.status<300||304===m.status?"success":"error":t)?(d.success&&d.success.call(d.context,_,"success",m),T.resolve(m.responseText,"success",m),h&&O.event.trigger("ajaxSuccess",[m,d])):t&&(void 0===n&&(n=m.statusText),d.error&&d.error.call(d.context,m,t,n),T.reject(m,"error",n),h)&&O.event.trigger("ajaxError",[m,d,n]),h&&O.event.trigger("ajaxComplete",[m,d]),h&&!--O.active&&O.event.trigger("ajaxStop"),d.complete&&d.complete.call(d.context,m,t),w=!0,d.timeout&&clearTimeout(v),setTimeout(function(){d.iframeTarget?f.attr("src",d.iframeSrc):f.remove(),m.responseXML=null},100)}}var n,i,d,h,r,f,p,m,g,v,y,b,o,_,x,w,C,k,s,S,a=E[0],T=O.Deferred();if(T.abort=function(e){m.abort(e)},e)for(i=0;i')).css({position:"absolute",top:"-1000px",left:"-1000px"}),p=f[0],m={aborted:0,responseText:null,responseXML:null,status:0,statusText:"n/a",getAllResponseHeaders:function(){},getResponseHeader:function(){},setRequestHeader:function(){},abort:function(e){var t="timeout"===e?"timeout":"aborted";L("aborting upload... "+t),this.aborted=1;try{p.contentWindow.document.execCommand&&p.contentWindow.document.execCommand("Stop")}catch(e){}f.attr("src",d.iframeSrc),m.error=t,d.error&&d.error.call(d.context,m,t,e),h&&O.event.trigger("ajaxError",[m,d,t]),d.complete&&d.complete.call(d.context,m,t)}},(h=d.global)&&0==O.active++&&O.event.trigger("ajaxStart"),h&&O.event.trigger("ajaxSend",[m,d]),d.beforeSend&&!1===d.beforeSend.call(d.context,m,d))?(d.global&&O.active--,T.reject()):m.aborted?T.reject():((e=a.clk)&&(o=e.name)&&!e.disabled&&(d.extraData=d.extraData||{},d.extraData[o]=e.value,"image"==e.type)&&(d.extraData[o+".x"]=a.clk_x,d.extraData[o+".y"]=a.clk_y),y=1,b=2,e=O("meta[name=csrf-token]").attr("content"),(o=O("meta[name=csrf-param]").attr("content"))&&e&&(d.extraData=d.extraData||{},d.extraData[o]=e),d.forceSync?t():setTimeout(t,10),C=50,k=O.parseXML||function(e,t){return window.ActiveXObject?((t=new ActiveXObject("Microsoft.XMLDOM")).async="false",t.loadXML(e)):t=(new DOMParser).parseFromString(e,"text/xml"),t&&t.documentElement&&"parsererror"!=t.documentElement.nodeName?t:null},s=O.parseJSON||function(e){return window.eval("("+e+")")},S=function(e,t,n){var i=e.getResponseHeader("content-type")||"",o="xml"===t||!t&&0<=i.indexOf("xml"),e=o?e.responseXML:e.responseText;return o&&"parsererror"===e.documentElement.nodeName&&O.error&&O.error("parsererror"),"string"==typeof(e=n&&n.dataFilter?n.dataFilter(e,t):e)&&("json"===t||!t&&0<=i.indexOf("json")?e=s(e):("script"===t||!t&&0<=i.indexOf("javascript"))&&O.globalEval(e)),e}),T}if(this.length){var D,E=this,t=("function"==typeof l?l={success:l}:void 0===l&&(l={}),D=l.type||this.attr2("method"),t=(t=(t="string"==typeof(t=l.url||this.attr2("action"))?O.trim(t):"")||window.location.href||"")&&(t.match(/^([^#]+)/)||[])[1],l=O.extend(!0,{url:t,success:O.ajaxSettings.success,type:D||O.ajaxSettings.type,iframeSrc:/^https/i.test(window.location.href||"")?"javascript:false":"about:blank"},l),{});if(this.trigger("form-pre-serialize",[this,l,t]),t.veto)L("ajaxSubmit: submit vetoed via form-pre-serialize trigger");else if(l.beforeSerialize&&!1===l.beforeSerialize(this,l))L("ajaxSubmit: submit aborted via beforeSerialize callback");else{var n=l.traditional;void 0===n&&(n=O.ajaxSettings.traditional);var M=[],i=this.formToArray(l.semantic,M);if(l.data&&(l.extraData=l.data,c=O.param(l.data,n)),l.beforeSubmit&&!1===l.beforeSubmit(i,this,l))L("ajaxSubmit: submit aborted via beforeSubmit callback");else if(this.trigger("form-submit-validate",[i,this,l,t]),t.veto)L("ajaxSubmit: submit vetoed via form-submit-validate trigger");else{var o,r,s,t=O.param(i,n),a=(c&&(t=t?t+"&"+c:c),"GET"==l.type.toUpperCase()?(l.url+=(0<=l.url.indexOf("?")?"&":"?")+t,l.data=null):l.data=t,[]);l.resetForm&&a.push(function(){E.resetForm()}),l.clearForm&&a.push(function(){E.clearForm(l.includeHidden)}),!l.dataType&&l.target?(o=l.success||function(){},a.push(function(e){var t=l.replaceTarget?"replaceWith":"html";O(l.target)[t](e).each(o,arguments)})):l.success&&a.push(l.success),l.success=function(e,t,n){for(var i=l.context||this,o=0,r=a.length;o=n.clientWidth&&e>=n.clientHeight})).length?o:r)[0].key+((t=e.split("-")[1])?"-"+t:""))}function x(e,t,n,i){i=3l[e]&&!i.escapeWithReference&&(n=q(u[t],l[e]-("right"===e?u.width:u.height))),A({},t,n)}};return t.forEach(function(e){var t=-1===["left","top"].indexOf(e)?"secondary":"primary";u=N({},u,c[t](e))}),e.offsets.popper=u,e},priority:["left","right","top","bottom"],padding:5,boundariesElement:"scrollParent"},keepTogether:{order:400,enabled:!0,fn:function(e){var t=e.offsets,n=t.popper,t=t.reference,i=e.placement.split("-")[0],o=O,i=-1!==["top","bottom"].indexOf(i),r=i?"right":"bottom",s=i?"left":"top",i=i?"width":"height";return n[r]o(t[r])&&(e.offsets.popper[s]=o(t[r])),e}},arrow:{order:500,enabled:!0,fn:function(e,t){if(R(e.instance.modifiers,"arrow","keepTogether")){t=t.element;if("string"==typeof t){if(!(t=e.instance.popper.querySelector(t)))return e}else if(!e.instance.popper.contains(t))return console.warn("WARNING: `arrow.element` must be child of its popper element!"),e;var n=e.placement.split("-")[0],i=e.offsets,o=i.popper,i=i.reference,n=-1!==["left","right"].indexOf(n),r=n?"height":"width",s=n?"Top":"Left",a=s.toLowerCase(),l=n?"left":"top",n=n?"bottom":"right",u=w(t)[r],n=(i[n]-uo[n]&&(e.offsets.popper[a]+=i[a]+u-o[n]),e.offsets.popper=g(e.offsets.popper),i[a]+i[r]/2-u/2),i=d(e.instance.popper),c=parseFloat(i["margin"+s],10),i=parseFloat(i["border"+s+"Width"],10),s=n-e.offsets.popper[a]-c-i,s=L(q(o[r]-u,s),0);e.arrowElement=t,e.offsets.arrow=(A(n={},a,M(s)),A(n,l,""),n)}return e},element:"[x-arrow]"},flip:{order:600,enabled:!0,fn:function(l,u){if(!(j(l.instance.modifiers,"inner")||l.flipped&&l.placement===l.originalPlacement)){var c=_(l.instance.popper,l.instance.reference,u.padding,u.boundariesElement,l.positionFixed),d=l.placement.split("-")[0],h=C(d),f=l.placement.split("-")[1]||"",p=[];switch(u.behavior){case X:p=[d,h];break;case Z:p=Y(d);break;case J:p=Y(d,!0);break;default:p=u.behavior}p.forEach(function(e,t){if(d!==e||p.length===t+1)return l;d=l.placement.split("-")[0],h=C(d);var e=l.offsets.popper,n=l.offsets.reference,i=O,n="left"===d&&i(e.right)>i(n.left)||"right"===d&&i(e.left)i(n.top)||"bottom"===d&&i(e.top)i(c.right),s=i(e.top)i(c.bottom),i="left"===d&&o||"right"===d&&r||"top"===d&&s||"bottom"===d&&e,a=-1!==["top","bottom"].indexOf(d),o=!!u.flipVariations&&(a&&"start"===f&&o||a&&"end"===f&&r||!a&&"start"===f&&s||!a&&"end"===f&&e);(n||i||o)&&(l.flipped=!0,(n||i)&&(d=p[t+1]),o&&(f="end"===(r=f)?"start":"start"===r?"end":r),l.placement=d+(f?"-"+f:""),l.offsets.popper=N({},l.offsets.popper,k(l.instance.popper,l.offsets.reference,l.placement)),l=I(l.instance.modifiers,l,"flip"))})}return l},behavior:"flip",padding:5,boundariesElement:"viewport"},inner:{order:700,enabled:!1,fn:function(e){var t=e.placement,n=t.split("-")[0],i=e.offsets,o=i.popper,i=i.reference,r=-1!==["left","right"].indexOf(n),s=-1===["top","left"].indexOf(n);return o[r?"left":"top"]=i[n]-(s?o[r?"width":"height"]:0),e.placement=C(t),e.offsets.popper=g(o),e}},hide:{order:800,enabled:!0,fn:function(e){if(R(e.instance.modifiers,"hide","preventOverflow")){var t=e.offsets.reference,n=S(e.instance.modifiers,function(e){return"preventOverflow"===e.name}).boundaries;if(t.bottomn.right||t.top>n.bottom||t.rightthis._items.length-1||e<0||(this._isSliding?c.default(this._element).one("slid.bs.carousel",function(){return t.to(e)}):n===e?(this.pause(),this.cycle()):this._slide(n=n.clientWidth&&e>=n.clientHeight})).length?o:r)[0].key+((t=e.split("-")[1])?"-"+t:""))}function me(e,t,n,i){i=3l[e]&&!i.escapeWithReference&&(n=Math.min(u[t],l[e]-("right"===e?u.width:u.height))),x({},t,n)}};return t.forEach(function(e){var t=-1!==["left","top"].indexOf(e)?"primary":"secondary";u=w({},u,c[t](e))}),e.offsets.popper=u,e},priority:["left","right","top","bottom"],padding:5,boundariesElement:"scrollParent"},keepTogether:{order:400,enabled:!0,fn:function(e){var t=e.offsets,n=t.popper,t=t.reference,i=e.placement.split("-")[0],o=Math.floor,i=-1!==["top","bottom"].indexOf(i),r=i?"right":"bottom",s=i?"left":"top",i=i?"width":"height";return n[r]o(t[r])&&(e.offsets.popper[s]=o(t[r])),e}},arrow:{order:500,enabled:!0,fn:function(e,t){if(Ee(e.instance.modifiers,"arrow","keepTogether")){t=t.element;if("string"==typeof t){if(!(t=e.instance.popper.querySelector(t)))return e}else if(!e.instance.popper.contains(t))return console.warn("WARNING: `arrow.element` must be child of its popper element!"),e;var n=e.placement.split("-")[0],i=e.offsets,o=i.popper,i=i.reference,n=-1!==["left","right"].indexOf(n),r=n?"height":"width",s=n?"Top":"Left",a=s.toLowerCase(),l=n?"left":"top",n=n?"bottom":"right",u=ge(t)[r],n=(i[n]-uo[n]&&(e.offsets.popper[a]+=i[a]+u-o[n]),e.offsets.popper=C(e.offsets.popper),i[a]+i[r]/2-u/2),i=v(e.instance.popper),c=parseFloat(i["margin"+s]),i=parseFloat(i["border"+s+"Width"]),s=n-e.offsets.popper[a]-c-i,s=Math.max(Math.min(o[r]-u,s),0);e.arrowElement=t,e.offsets.arrow=(x(n={},a,Math.round(s)),x(n,l,""),n)}return e},element:"[x-arrow]"},flip:{order:600,enabled:!0,fn:function(u,c){if(!(xe(u.instance.modifiers,"inner")||u.flipped&&u.placement===u.originalPlacement)){var d=fe(u.instance.popper,u.instance.reference,c.padding,c.boundariesElement,u.positionFixed),h=u.placement.split("-")[0],f=ve(h),p=u.placement.split("-")[1]||"",m=[];switch(c.behavior){case"flip":m=[h,f];break;case"clockwise":m=Oe(h);break;case"counterclockwise":m=Oe(h,!0);break;default:m=c.behavior}m.forEach(function(e,t){if(h!==e||m.length===t+1)return u;h=u.placement.split("-")[0],f=ve(h);var e=u.offsets.popper,n=u.offsets.reference,i=Math.floor,n="left"===h&&i(e.right)>i(n.left)||"right"===h&&i(e.left)i(n.top)||"bottom"===h&&i(e.top)i(d.right),s=i(e.top)i(d.bottom),i="left"===h&&o||"right"===h&&r||"top"===h&&s||"bottom"===h&&e,a=-1!==["top","bottom"].indexOf(h),l=!!c.flipVariations&&(a&&"start"===p&&o||a&&"end"===p&&r||!a&&"start"===p&&s||!a&&"end"===p&&e),r=!!c.flipVariationsByContent&&(a&&"start"===p&&r||a&&"end"===p&&o||!a&&"start"===p&&e||!a&&"end"===p&&s),o=l||r;(n||i||o)&&(u.flipped=!0,(n||i)&&(h=m[t+1]),o&&(p="end"===p?"start":"start"===p?"end":p),u.placement=h+(p?"-"+p:""),u.offsets.popper=w({},u.offsets.popper,ye(u.instance.popper,u.offsets.reference,u.placement)),u=_e(u.instance.modifiers,u,"flip"))})}return u},behavior:"flip",padding:5,boundariesElement:"viewport",flipVariations:!1,flipVariationsByContent:!1},inner:{order:700,enabled:!1,fn:function(e){var t=e.placement,n=t.split("-")[0],i=e.offsets,o=i.popper,i=i.reference,r=-1!==["left","right"].indexOf(n),s=-1===["top","left"].indexOf(n);return o[r?"left":"top"]=i[n]-(s?o[r?"width":"height"]:0),e.placement=ve(t),e.offsets.popper=C(o),e}},hide:{order:800,enabled:!0,fn:function(e){if(Ee(e.instance.modifiers,"hide","preventOverflow")){var t=e.offsets.reference,n=be(e.instance.modifiers,function(e){return"preventOverflow"===e.name}).boundaries;if(t.bottomn.right||t.top>n.bottom||t.rightdocument.documentElement.clientHeight)||(this._element.style.overflowY="hidden"),this._element.classList.add("modal-static"),n=d.getTransitionDurationFromElement(this._dialog),c.default(this._element).off(d.TRANSITION_END),c.default(this._element).one(d.TRANSITION_END,function(){i._element.classList.remove("modal-static"),t||c.default(i._element).one(d.TRANSITION_END,function(){i._element.style.overflowY=""}).emulateTransitionEnd(i._element,n)}).emulateTransitionEnd(n),this._element.focus())):this.hide()},S._showElement=function(e){function t(){n._config.focus&&n._element.focus(),n._isTransitioning=!1,c.default(n._element).trigger(r)}var n=this,i=c.default(this._element).hasClass("fade"),o=this._dialog?this._dialog.querySelector(".modal-body"):null,r=(this._element.parentNode&&this._element.parentNode.nodeType===Node.ELEMENT_NODE||document.body.appendChild(this._element),this._element.style.display="block",this._element.removeAttribute("aria-hidden"),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),c.default(this._dialog).hasClass("modal-dialog-scrollable")&&o?o.scrollTop=0:this._element.scrollTop=0,i&&d.reflow(this._element),c.default(this._element).addClass("show"),this._config.focus&&this._enforceFocus(),c.default.Event("shown.bs.modal",{relatedTarget:e}));i?(o=d.getTransitionDurationFromElement(this._dialog),c.default(this._dialog).one(d.TRANSITION_END,t).emulateTransitionEnd(o)):t()},S._enforceFocus=function(){var t=this;c.default(document).off("focusin.bs.modal").on("focusin.bs.modal",function(e){document!==e.target&&t._element!==e.target&&0===c.default(t._element).has(e.target).length&&t._element.focus()})},S._setEscapeEvent=function(){var t=this;this._isShown?c.default(this._element).on("keydown.dismiss.bs.modal",function(e){t._config.keyboard&&27===e.which?(e.preventDefault(),t.hide()):t._config.keyboard||27!==e.which||t._triggerBackdropTransition()}):this._isShown||c.default(this._element).off("keydown.dismiss.bs.modal")},S._setResizeEvent=function(){var t=this;this._isShown?c.default(window).on("resize.bs.modal",function(e){return t.handleUpdate(e)}):c.default(window).off("resize.bs.modal")},S._hideModal=function(){var e=this;this._element.style.display="none",this._element.setAttribute("aria-hidden",!0),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._isTransitioning=!1,this._showBackdrop(function(){c.default(document.body).removeClass("modal-open"),e._resetAdjustments(),e._resetScrollbar(),c.default(e._element).trigger("hidden.bs.modal")})},S._removeBackdrop=function(){this._backdrop&&(c.default(this._backdrop).remove(),this._backdrop=null)},S._showBackdrop=function(e){var t,n=this,i=c.default(this._element).hasClass("fade")?"fade":"";this._isShown&&this._config.backdrop?(this._backdrop=document.createElement("div"),this._backdrop.className="modal-backdrop",i&&this._backdrop.classList.add(i),c.default(this._backdrop).appendTo(document.body),c.default(this._element).on("click.dismiss.bs.modal",function(e){n._ignoreBackdropClick?n._ignoreBackdropClick=!1:e.target===e.currentTarget&&n._triggerBackdropTransition()}),i&&d.reflow(this._backdrop),c.default(this._backdrop).addClass("show"),e&&(i?(i=d.getTransitionDurationFromElement(this._backdrop),c.default(this._backdrop).one(d.TRANSITION_END,e).emulateTransitionEnd(i)):e())):!this._isShown&&this._backdrop?(c.default(this._backdrop).removeClass("show"),i=function(){n._removeBackdrop(),e&&e()},c.default(this._element).hasClass("fade")?(t=d.getTransitionDurationFromElement(this._backdrop),c.default(this._backdrop).one(d.TRANSITION_END,i).emulateTransitionEnd(t)):i()):e&&e()},S._adjustDialog=function(){var e=this._element.scrollHeight>document.documentElement.clientHeight;!this._isBodyOverflowing&&e&&(this._element.style.paddingLeft=this._scrollbarWidth+"px"),this._isBodyOverflowing&&!e&&(this._element.style.paddingRight=this._scrollbarWidth+"px")},S._resetAdjustments=function(){this._element.style.paddingLeft="",this._element.style.paddingRight=""},S._checkScrollbar=function(){var e=document.body.getBoundingClientRect();this._isBodyOverflowing=Math.round(e.left+e.right)
',trigger:"hover focus",title:"",delay:0,html:!1,selector:!1,placement:"top",offset:0,container:!1,fallbackPlacement:"flip",boundary:"scrollParent",sanitize:!0,sanitizeFn:null,whiteList:{"*":["class","dir","id","lang","role",/^aria-[\w-]*$/i],a:["target","href","title","rel"],area:[],b:[],br:[],col:[],code:[],div:[],em:[],hr:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],i:[],img:["src","srcset","alt","title","width","height"],li:[],ol:[],p:[],pre:[],s:[],small:[],span:[],sub:[],sup:[],strong:[],u:[],ul:[]},popperConfig:null},it={HIDE:"hide.bs.tooltip",HIDDEN:"hidden.bs.tooltip",SHOW:"show.bs.tooltip",SHOWN:"shown.bs.tooltip",INSERTED:"inserted.bs.tooltip",CLICK:"click.bs.tooltip",FOCUSIN:"focusin.bs.tooltip",FOCUSOUT:"focusout.bs.tooltip",MOUSEENTER:"mouseenter.bs.tooltip",MOUSELEAVE:"mouseleave.bs.tooltip"},A=((S=ot.prototype).enable=function(){this._isEnabled=!0},S.disable=function(){this._isEnabled=!1},S.toggleEnabled=function(){this._isEnabled=!this._isEnabled},S.toggle=function(e){var t,n;this._isEnabled&&(e?(t=this.constructor.DATA_KEY,(n=c.default(e.currentTarget).data(t))||(n=new this.constructor(e.currentTarget,this._getDelegateConfig()),c.default(e.currentTarget).data(t,n)),n._activeTrigger.click=!n._activeTrigger.click,n._isWithActiveTrigger()?n._enter(null,n):n._leave(null,n)):c.default(this.getTipElement()).hasClass("show")?this._leave(null,this):this._enter(null,this))},S.dispose=function(){clearTimeout(this._timeout),c.default.removeData(this.element,this.constructor.DATA_KEY),c.default(this.element).off(this.constructor.EVENT_KEY),c.default(this.element).closest(".modal").off("hide.bs.modal",this._hideModalHandler),this.tip&&c.default(this.tip).remove(),this._isEnabled=null,this._timeout=null,this._hoverState=null,this._activeTrigger=null,this._popper&&this._popper.destroy(),this._popper=null,this.element=null,this.config=null,this.tip=null},S.show=function(){var t=this;if("none"===c.default(this.element).css("display"))throw new Error("Please use show on visible elements");var e,n,i=c.default.Event(this.constructor.Event.SHOW);this.isWithContent()&&this._isEnabled&&(c.default(this.element).trigger(i),n=d.findShadowRoot(this.element),n=c.default.contains(null!==n?n:this.element.ownerDocument.documentElement,this.element),!i.isDefaultPrevented())&&n&&(i=this.getTipElement(),n=d.getUID(this.constructor.NAME),i.setAttribute("id",n),this.element.setAttribute("aria-describedby",n),this.setContent(),this.config.animation&&c.default(i).addClass("fade"),n="function"==typeof this.config.placement?this.config.placement.call(this,i,this.element):this.config.placement,n=this._getAttachment(n),this.addAttachmentClass(n),e=this._getContainer(),c.default(i).data(this.constructor.DATA_KEY,this),c.default.contains(this.element.ownerDocument.documentElement,this.tip)||c.default(i).appendTo(e),c.default(this.element).trigger(this.constructor.Event.INSERTED),this._popper=new T(this.element,i,this._getPopperConfig(n)),c.default(i).addClass("show"),"ontouchstart"in document.documentElement&&c.default(document.body).children().on("mouseover",null,c.default.noop),e=function(){t.config.animation&&t._fixTransition();var e=t._hoverState;t._hoverState=null,c.default(t.element).trigger(t.constructor.Event.SHOWN),"out"===e&&t._leave(null,t)},c.default(this.tip).hasClass("fade")?(n=d.getTransitionDurationFromElement(this.tip),c.default(this.tip).one(d.TRANSITION_END,e).emulateTransitionEnd(n)):e())},S.hide=function(e){function t(){"show"!==n._hoverState&&i.parentNode&&i.parentNode.removeChild(i),n._cleanTipClass(),n.element.removeAttribute("aria-describedby"),c.default(n.element).trigger(n.constructor.Event.HIDDEN),null!==n._popper&&n._popper.destroy(),e&&e()}var n=this,i=this.getTipElement(),o=c.default.Event(this.constructor.Event.HIDE);c.default(this.element).trigger(o),o.isDefaultPrevented()||(c.default(i).removeClass("show"),"ontouchstart"in document.documentElement&&c.default(document.body).children().off("mouseover",null,c.default.noop),this._activeTrigger.click=!1,this._activeTrigger.focus=!1,this._activeTrigger.hover=!1,c.default(this.tip).hasClass("fade")?(o=d.getTransitionDurationFromElement(i),c.default(i).one(d.TRANSITION_END,t).emulateTransitionEnd(o)):t(),this._hoverState="")},S.update=function(){null!==this._popper&&this._popper.scheduleUpdate()},S.isWithContent=function(){return Boolean(this.getTitle())},S.addAttachmentClass=function(e){c.default(this.getTipElement()).addClass("bs-tooltip-"+e)},S.getTipElement=function(){return this.tip=this.tip||c.default(this.config.template)[0],this.tip},S.setContent=function(){var e=this.getTipElement();this.setElementContent(c.default(e.querySelectorAll(".tooltip-inner")),this.getTitle()),c.default(e).removeClass("fade show")},S.setElementContent=function(e,t){"object"!=typeof t||!t.nodeType&&!t.jquery?this.config.html?(this.config.sanitize&&(t=Qe(t,this.config.whiteList,this.config.sanitizeFn)),e.html(t)):e.text(t):this.config.html?c.default(t).parent().is(e)||e.empty().append(t):e.text(c.default(t).text())},S.getTitle=function(){return this.element.getAttribute("data-original-title")||("function"==typeof this.config.title?this.config.title.call(this.element):this.config.title)},S._getPopperConfig=function(e){var t=this;return r({},{placement:e,modifiers:{offset:this._getOffset(),flip:{behavior:this.config.fallbackPlacement},arrow:{element:".arrow"},preventOverflow:{boundariesElement:this.config.boundary}},onCreate:function(e){e.originalPlacement!==e.placement&&t._handlePopperPlacementChange(e)},onUpdate:function(e){return t._handlePopperPlacementChange(e)}},this.config.popperConfig)},S._getOffset=function(){var t=this,e={};return"function"==typeof this.config.offset?e.fn=function(e){return e.offsets=r({},e.offsets,t.config.offset(e.offsets,t.element)||{}),e}:e.offset=this.config.offset,e},S._getContainer=function(){return!1===this.config.container?document.body:d.isElement(this.config.container)?c.default(this.config.container):c.default(document).find(this.config.container)},S._getAttachment=function(e){return tt[e.toUpperCase()]},S._setListeners=function(){var n=this;this.config.trigger.split(" ").forEach(function(e){var t;"click"===e?c.default(n.element).on(n.constructor.Event.CLICK,n.config.selector,function(e){return n.toggle(e)}):"manual"!==e&&(t="hover"===e?n.constructor.Event.MOUSEENTER:n.constructor.Event.FOCUSIN,e="hover"===e?n.constructor.Event.MOUSELEAVE:n.constructor.Event.FOCUSOUT,c.default(n.element).on(t,n.config.selector,function(e){return n._enter(e)}).on(e,n.config.selector,function(e){return n._leave(e)}))}),this._hideModalHandler=function(){n.element&&n.hide()},c.default(this.element).closest(".modal").on("hide.bs.modal",this._hideModalHandler),this.config.selector?this.config=r({},this.config,{trigger:"manual",selector:""}):this._fixTitle()},S._fixTitle=function(){var e=typeof this.element.getAttribute("data-original-title");!this.element.getAttribute("title")&&"string"==e||(this.element.setAttribute("data-original-title",this.element.getAttribute("title")||""),this.element.setAttribute("title",""))},S._enter=function(e,t){var n=this.constructor.DATA_KEY;(t=t||c.default(e.currentTarget).data(n))||(t=new this.constructor(e.currentTarget,this._getDelegateConfig()),c.default(e.currentTarget).data(n,t)),e&&(t._activeTrigger["focusin"===e.type?"focus":"hover"]=!0),c.default(t.getTipElement()).hasClass("show")||"show"===t._hoverState?t._hoverState="show":(clearTimeout(t._timeout),t._hoverState="show",t.config.delay&&t.config.delay.show?t._timeout=setTimeout(function(){"show"===t._hoverState&&t.show()},t.config.delay.show):t.show())},S._leave=function(e,t){var n=this.constructor.DATA_KEY;(t=t||c.default(e.currentTarget).data(n))||(t=new this.constructor(e.currentTarget,this._getDelegateConfig()),c.default(e.currentTarget).data(n,t)),e&&(t._activeTrigger["focusout"===e.type?"focus":"hover"]=!1),t._isWithActiveTrigger()||(clearTimeout(t._timeout),t._hoverState="out",t.config.delay&&t.config.delay.hide?t._timeout=setTimeout(function(){"out"===t._hoverState&&t.hide()},t.config.delay.hide):t.hide())},S._isWithActiveTrigger=function(){for(var e in this._activeTrigger)if(this._activeTrigger[e])return!0;return!1},S._getConfig=function(e){var t=c.default(this.element).data();return Object.keys(t).forEach(function(e){-1!==Je.indexOf(e)&&delete t[e]}),"number"==typeof(e=r({},this.constructor.Default,t,"object"==typeof e&&e?e:{})).delay&&(e.delay={show:e.delay,hide:e.delay}),"number"==typeof e.title&&(e.title=e.title.toString()),"number"==typeof e.content&&(e.content=e.content.toString()),d.typeCheckConfig(L,e,this.constructor.DefaultType),e.sanitize&&(e.template=Qe(e.template,e.whiteList,e.sanitizeFn)),e},S._getDelegateConfig=function(){var e={};if(this.config)for(var t in this.config)this.constructor.Default[t]!==this.config[t]&&(e[t]=this.config[t]);return e},S._cleanTipClass=function(){var e=c.default(this.getTipElement()),t=e.attr("class").match(Ze);null!==t&&t.length&&e.removeClass(t.join(""))},S._handlePopperPlacementChange=function(e){this.tip=e.instance.popper,this._cleanTipClass(),this.addAttachmentClass(this._getAttachment(tt[e.placement.toUpperCase()]))},S._fixTransition=function(){var e=this.getTipElement(),t=this.config.animation;null===e.getAttribute("x-placement")&&(c.default(e).removeClass("fade"),this.config.animation=!1,this.hide(),this.show(),this.config.animation=t)},ot._jQueryInterface=function(i){return this.each(function(){var e=c.default(this),t=e.data("bs.tooltip"),n="object"==typeof i&&i;if((t||!/dispose|hide/.test(i))&&(t||(t=new ot(this,n),e.data("bs.tooltip",t)),"string"==typeof i)){if(void 0===t[i])throw new TypeError('No method named "'+i+'"');t[i]()}})},n(ot,null,[{key:"VERSION",get:function(){return"4.5.3"}},{key:"Default",get:function(){return nt}},{key:"NAME",get:function(){return L}},{key:"DATA_KEY",get:function(){return"bs.tooltip"}},{key:"Event",get:function(){return it}},{key:"EVENT_KEY",get:function(){return".bs.tooltip"}},{key:"DefaultType",get:function(){return et}}]),ot);function ot(e,t){if(void 0===T)throw new TypeError("Bootstrap's tooltips require Popper.js (https://popper.js.org/)");this._isEnabled=!0,this._timeout=0,this._hoverState="",this._activeTrigger={},this._popper=null,this.element=e,this.config=this._getConfig(t),this.tip=null,this._setListeners()}c.default.fn[L]=A._jQueryInterface,c.default.fn[L].Constructor=A,c.default.fn[L].noConflict=function(){return c.default.fn[L]=Xe,A._jQueryInterface};var rt,N="popover",st=c.default.fn[N],at=new RegExp("(^|\\s)bs-popover\\S+","g"),lt=r({},A.Default,{placement:"right",trigger:"click",content:"",template:''}),ut=r({},A.DefaultType,{content:"(string|element|function)"}),ct={HIDE:"hide.bs.popover",HIDDEN:"hidden.bs.popover",SHOW:"show.bs.popover",SHOWN:"shown.bs.popover",INSERTED:"inserted.bs.popover",CLICK:"click.bs.popover",FOCUSIN:"focusin.bs.popover",FOCUSOUT:"focusout.bs.popover",MOUSEENTER:"mouseenter.bs.popover",MOUSELEAVE:"mouseleave.bs.popover"},dt=(t=rt=A,(k=P).prototype=Object.create(t.prototype),(k.prototype.constructor=k).__proto__=t,(k=P.prototype).isWithContent=function(){return this.getTitle()||this._getContent()},k.addAttachmentClass=function(e){c.default(this.getTipElement()).addClass("bs-popover-"+e)},k.getTipElement=function(){return this.tip=this.tip||c.default(this.config.template)[0],this.tip},k.setContent=function(){var e=c.default(this.getTipElement()),t=(this.setElementContent(e.find(".popover-header"),this.getTitle()),this._getContent());"function"==typeof t&&(t=t.call(this.element)),this.setElementContent(e.find(".popover-body"),t),e.removeClass("fade show")},k._getContent=function(){return this.element.getAttribute("data-content")||this.config.content},k._cleanTipClass=function(){var e=c.default(this.getTipElement()),t=e.attr("class").match(at);null!==t&&0=this._offsets[i]&&(void 0===this._offsets[i+1]||e li > .active":".active",i=(i=c.default.makeArray(c.default(t).find(o)))[i.length-1]),o=c.default.Event("hide.bs.tab",{relatedTarget:this._element}),r=c.default.Event("show.bs.tab",{relatedTarget:i}),i&&c.default(i).trigger(o),c.default(this._element).trigger(r),r.isDefaultPrevented())||o.isDefaultPrevented()||(n&&(e=document.querySelector(n)),this._activate(this._element,t),r=function(){var e=c.default.Event("hidden.bs.tab",{relatedTarget:s._element}),t=c.default.Event("shown.bs.tab",{relatedTarget:i});c.default(i).trigger(e),c.default(s._element).trigger(t)},e?this._activate(e,e.parentNode,r):r())},t.dispose=function(){c.default.removeData(this._element,"bs.tab"),this._element=null},t._activate=function(e,t,n){function i(){return o._transitionComplete(e,r,n)}var o=this,r=(!t||"UL"!==t.nodeName&&"OL"!==t.nodeName?c.default(t).children(".active"):c.default(t).find("> li > .active"))[0],t=n&&r&&c.default(r).hasClass("fade");r&&t?(t=d.getTransitionDurationFromElement(r),c.default(r).removeClass("show").one(d.TRANSITION_END,i).emulateTransitionEnd(t)):i()},t._transitionComplete=function(e,t,n){var i;t&&(c.default(t).removeClass("active"),(i=c.default(t.parentNode).find("> .dropdown-menu .active")[0])&&c.default(i).removeClass("active"),"tab"===t.getAttribute("role"))&&t.setAttribute("aria-selected",!1),c.default(e).addClass("active"),"tab"===e.getAttribute("role")&&e.setAttribute("aria-selected",!0),d.reflow(e),e.classList.contains("fade")&&e.classList.add("show"),e.parentNode&&c.default(e.parentNode).hasClass("dropdown-menu")&&((i=c.default(e).closest(".dropdown")[0])&&(t=[].slice.call(i.querySelectorAll(".dropdown-toggle")),c.default(t).addClass("active")),e.setAttribute("aria-expanded",!0)),n&&n()},bt._jQueryInterface=function(n){return this.each(function(){var e=c.default(this),t=e.data("bs.tab");if(t||(t=new bt(this),e.data("bs.tab",t)),"string"==typeof n){if(void 0===t[n])throw new TypeError('No method named "'+n+'"');t[n]()}})},n(bt,null,[{key:"VERSION",get:function(){return"4.5.3"}}]),bt);function bt(e){this._element=e}c.default(document).on("click.bs.tab.data-api",'[data-toggle="tab"], [data-toggle="pill"], [data-toggle="list"]',function(e){e.preventDefault(),yt._jQueryInterface.call(c.default(this),"show")}),c.default.fn.tab=yt._jQueryInterface,c.default.fn.tab.Constructor=yt,c.default.fn.tab.noConflict=function(){return c.default.fn.tab=vt,yt._jQueryInterface};var _t=c.default.fn.toast,xt={animation:"boolean",autohide:"boolean",delay:"number"},wt={animation:!0,autohide:!0,delay:500},Ct=((k=kt.prototype).show=function(){var e,t=this,n=c.default.Event("show.bs.toast");c.default(this._element).trigger(n),n.isDefaultPrevented()||(this._clearTimeout(),this._config.animation&&this._element.classList.add("fade"),n=function(){t._element.classList.remove("showing"),t._element.classList.add("show"),c.default(t._element).trigger("shown.bs.toast"),t._config.autohide&&(t._timeout=setTimeout(function(){t.hide()},t._config.delay))},this._element.classList.remove("hide"),d.reflow(this._element),this._element.classList.add("showing"),this._config.animation?(e=d.getTransitionDurationFromElement(this._element),c.default(this._element).one(d.TRANSITION_END,n).emulateTransitionEnd(e)):n())},k.hide=function(){var e;this._element.classList.contains("show")&&(e=c.default.Event("hide.bs.toast"),c.default(this._element).trigger(e),e.isDefaultPrevented()||this._close())},k.dispose=function(){this._clearTimeout(),this._element.classList.contains("show")&&this._element.classList.remove("show"),c.default(this._element).off("click.dismiss.bs.toast"),c.default.removeData(this._element,"bs.toast"),this._element=null,this._config=null},k._getConfig=function(e){return e=r({},wt,c.default(this._element).data(),"object"==typeof e&&e?e:{}),d.typeCheckConfig("toast",e,this.constructor.DefaultType),e},k._setListeners=function(){var e=this;c.default(this._element).on("click.dismiss.bs.toast",'[data-dismiss="toast"]',function(){return e.hide()})},k._close=function(){function e(){n._element.classList.add("hide"),c.default(n._element).trigger("hidden.bs.toast")}var t,n=this;this._element.classList.remove("show"),this._config.animation?(t=d.getTransitionDurationFromElement(this._element),c.default(this._element).one(d.TRANSITION_END,e).emulateTransitionEnd(t)):e()},k._clearTimeout=function(){clearTimeout(this._timeout),this._timeout=null},kt._jQueryInterface=function(n){return this.each(function(){var e=c.default(this),t=e.data("bs.toast");if(t||(t=new kt(this,"object"==typeof n&&n),e.data("bs.toast",t)),"string"==typeof n){if(void 0===t[n])throw new TypeError('No method named "'+n+'"');t[n](this)}})},n(kt,null,[{key:"VERSION",get:function(){return"4.5.3"}},{key:"DefaultType",get:function(){return xt}},{key:"Default",get:function(){return wt}}]),kt);function kt(e,t){this._element=e,this._config=this._getConfig(t),this._timeout=null,this._setListeners()}c.default.fn.toast=Ct._jQueryInterface,c.default.fn.toast.Constructor=Ct,c.default.fn.toast.noConflict=function(){return c.default.fn.toast=_t,Ct._jQueryInterface},e.Alert=o,e.Button=a,e.Carousel=h,e.Collapse=m,e.Dropdown=M,e.Modal=ze,e.Popover=dt,e.Scrollspy=mt,e.Tab=yt,e.Toast=Ct,e.Tooltip=A,e.Util=d,Object.defineProperty(e,"__esModule",{value:!0})}),!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";var I;function f(){return I.apply(null,arguments)}function l(e){return e instanceof Array||"[object Array]"===Object.prototype.toString.call(e)}function j(e){return null!=e&&"[object Object]"===Object.prototype.toString.call(e)}function r(e){return void 0===e}function F(e){return"number"==typeof e||"[object Number]"===Object.prototype.toString.call(e)}function H(e){return e instanceof Date||"[object Date]"===Object.prototype.toString.call(e)}function W(e,t){for(var n=[],i=0;i>>0,i=0;iMe(e)?(r=e+1,t-Me(e)):(r=e,t);return{year:r,dayOfYear:n}}function Ue(e,t,n){var i,o,r=ze(e.year(),t,n),r=Math.floor((e.dayOfYear()-r-1)/7)+1;return r<1?i=r+Ge(o=e.year()-1,t,n):r>Ge(e.year(),t,n)?(i=r-Ge(e.year(),t,n),o=e.year()+1):(o=e.year(),i=r),{week:i,year:o}}function Ge(e,t,n){var i=ze(e,t,n),t=ze(e+1,t,n);return(Me(e)-i+t)/7}i("w",["ww",2],"wo","week"),i("W",["WW",2],"Wo","isoWeek"),t("week","w"),t("isoWeek","W"),n("week",5),n("isoWeek",5),x("w",b),x("ww",b,y),x("W",b),x("WW",b,y),Se(["w","ww","W","WW"],function(e,t,n,i){t[i.substr(0,1)]=d(e)}),i("d",0,"do","day"),i("dd",0,0,function(e){return this.localeData().weekdaysMin(this,e)}),i("ddd",0,0,function(e){return this.localeData().weekdaysShort(this,e)}),i("dddd",0,0,function(e){return this.localeData().weekdays(this,e)}),i("e",0,0,"weekday"),i("E",0,0,"isoWeekday"),t("day","d"),t("weekday","e"),t("isoWeekday","E"),n("day",11),n("weekday",11),n("isoWeekday",11),x("d",b),x("e",b),x("E",b),x("dd",function(e,t){return t.weekdaysMinRegex(e)}),x("ddd",function(e,t){return t.weekdaysShortRegex(e)}),x("dddd",function(e,t){return t.weekdaysRegex(e)}),Se(["dd","ddd","dddd"],function(e,t,n,i){i=n._locale.weekdaysParse(e,i,n._strict);null!=i?t.d=i:m(n).invalidWeekday=e}),Se(["d","e","E"],function(e,t,n,i){t[i]=d(e)});var Ke="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Qe="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Xe="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),Ze=_,Je=_,et=_;function tt(){function e(e,t){return t.length-e.length}for(var t,n,i,o=[],r=[],s=[],a=[],l=0;l<7;l++)i=u([2e3,1]).day(l),t=this.weekdaysMin(i,""),n=this.weekdaysShort(i,""),i=this.weekdays(i,""),o.push(t),r.push(n),s.push(i),a.push(t),a.push(n),a.push(i);for(o.sort(e),r.sort(e),s.sort(e),a.sort(e),l=0;l<7;l++)r[l]=Ce(r[l]),s[l]=Ce(s[l]),a[l]=Ce(a[l]);this._weekdaysRegex=new RegExp("^("+a.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+s.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+r.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+o.join("|")+")","i")}function nt(){return this.hours()%12||12}function it(e,t){i(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}function ot(e,t){return t._meridiemParse}i("H",["HH",2],0,"hour"),i("h",["hh",2],0,nt),i("k",["kk",2],0,function(){return this.hours()||24}),i("hmm",0,0,function(){return""+nt.apply(this)+v(this.minutes(),2)}),i("hmmss",0,0,function(){return""+nt.apply(this)+v(this.minutes(),2)+v(this.seconds(),2)}),i("Hmm",0,0,function(){return""+this.hours()+v(this.minutes(),2)}),i("Hmmss",0,0,function(){return""+this.hours()+v(this.minutes(),2)+v(this.seconds(),2)}),it("a",!0),it("A",!1),t("hour","h"),n("hour",13),x("a",ot),x("A",ot),x("H",b),x("h",b),x("k",b),x("HH",b,y),x("hh",b,y),x("kk",b,y),x("hmm",fe),x("hmmss",pe),x("Hmm",fe),x("Hmmss",pe),w(["H","HH"],T),w(["k","kk"],function(e,t,n){e=d(e);t[T]=24===e?0:e}),w(["a","A"],function(e,t,n){n._isPm=n._locale.isPM(e),n._meridiem=e}),w(["h","hh"],function(e,t,n){t[T]=d(e),m(n).bigHour=!0}),w("hmm",function(e,t,n){var i=e.length-2;t[T]=d(e.substr(0,i)),t[D]=d(e.substr(i)),m(n).bigHour=!0}),w("hmmss",function(e,t,n){var i=e.length-4,o=e.length-2;t[T]=d(e.substr(0,i)),t[D]=d(e.substr(i,2)),t[E]=d(e.substr(o)),m(n).bigHour=!0}),w("Hmm",function(e,t,n){var i=e.length-2;t[T]=d(e.substr(0,i)),t[D]=d(e.substr(i))}),w("Hmmss",function(e,t,n){var i=e.length-4,o=e.length-2;t[T]=d(e.substr(0,i)),t[D]=d(e.substr(i,2)),t[E]=d(e.substr(o))});var rt,_=Ae("Hours",!0),st={calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},longDateFormat:{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"},invalidDate:"Invalid date",ordinal:"%d",dayOfMonthOrdinalParse:/\d{1,2}/,relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d 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"},months:je,monthsShort:Fe,week:{dow:0,doy:6},weekdays:Ke,weekdaysMin:Xe,weekdaysShort:Qe,meridiemParse:/[ap]\.?m?\.?/i},O={},at={};function lt(e){return e&&e.toLowerCase().replace("_","-")}function ut(e){var t;if(!O[e]&&"undefined"!=typeof module&&module&&module.exports)try{t=rt._abbr,require("./locale/"+e),ct(t)}catch(e){}return O[e]}function ct(e,t){return e&&((t=r(t)?ht(e):dt(e,t))?rt=t:"undefined"!=typeof console&&console.warn&&console.warn("Locale "+e+" not found. Did you forget to load it?")),rt._abbr}function dt(e,t){if(null===t)return delete O[e],null;var n,i=st;if(t.abbr=e,null!=O[e])X("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),i=O[e]._config;else if(null!=t.parentLocale)if(null!=O[t.parentLocale])i=O[t.parentLocale]._config;else{if(null==(n=ut(t.parentLocale)))return at[t.parentLocale]||(at[t.parentLocale]=[]),at[t.parentLocale].push({name:e,config:t}),null;i=n._config}return O[e]=new J(Z(i,t)),at[e]&&at[e].forEach(function(e){dt(e.name,e.config)}),ct(e),O[e]}function ht(e){var t;if(e=e&&e._locale&&e._locale._abbr?e._locale._abbr:e){if(!l(e)){if(t=ut(e))return t;e=[e]}for(var n,i,o,r,s=e,a=0;a=n&&G(r,i,!0)>=n-1)break;n--}a++}}return rt}function ft(e){var t=e._a;return t&&-2===m(e).overflow&&(t=t[k]<0||11$e(t[C],t[k])?S:t[T]<0||24Ge(a,o,r)?m(c)._overflowWeeks=!0:null!=i?m(c)._overflowWeekday=!0:(s=Ve(a,l,n,o,r),c._a[C]=s.year,c._dayOfYear=s.dayOfYear)),null!=e._dayOfYear&&(d=pt(e._a[C],h[C]),(e._dayOfYear>Me(d)||0===e._dayOfYear)&&(m(e)._overflowDayOfYear=!0),i=qe(d,0,e._dayOfYear),e._a[k]=i.getUTCMonth(),e._a[S]=i.getUTCDate()),t=0;t<3&&null==e._a[t];++t)e._a[t]=u[t]=h[t];for(;t<7;t++)e._a[t]=u[t]=null==e._a[t]?2===t?1:0:e._a[t];24===e._a[T]&&0===e._a[D]&&0===e._a[E]&&0===e._a[Te]&&(e._nextDay=!0,e._a[T]=0),e._d=(e._useUTC?qe:function(e,t,n,i,o,r,s){t=new Date(e,t,n,i,o,r,s);return e<100&&0<=e&&isFinite(t.getFullYear())&&t.setFullYear(e),t}).apply(null,u),a=e._useUTC?e._d.getUTCDay():e._d.getDay(),null!=e._tzm&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[T]=24),e._w&&void 0!==e._w.d&&e._w.d!==a&&(m(e).weekdayMismatch=!0)}}var gt=/^\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)?)?$/,vt=/^\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)?)?$/,yt=/Z|[+-]\d\d(?::?\d\d)?/,bt=[["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}/]],_t=[["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/]],xt=/^\/?Date\((\-?\d+)/i;function wt(e){var t,n,i,o,r,s,a=e._i,l=gt.exec(a)||vt.exec(a);if(l){for(m(e).iso=!0,t=0,n=bt.length;te.valueOf():e.valueOf()this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()},o.isLocal=function(){return!!this.isValid()&&!this._isUTC},o.isUtcOffset=function(){return!!this.isValid()&&this._isUTC},o.isUtc=Ht,o.isUTC=Ht,o.zoneAbbr=function(){return this._isUTC?"UTC":""},o.zoneName=function(){return this._isUTC?"Coordinated Universal Time":""},o.dates=e("dates accessor is deprecated. Use date instead.",ge),o.months=e("months accessor is deprecated. Use month instead",We),o.years=e("years accessor is deprecated. Use year instead",Le),o.zone=e("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",function(e,t){return null!=e?(this.utcOffset(e="string"!=typeof e?-e:e,t),this):-this.utcOffset()}),o.isDSTShifted=e("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",function(){var e,t;return r(this._isDSTShifted)&&(z(e={},this),(e=Dt(e))._a?(t=(e._isUTC?u:L)(e._a),this._isDSTShifted=this.isValid()&&0 div").hide().filter(".datepicker-"+u[this.currentViewMode].CLASS_NAME).show())},S.prototype._isInDisabledDates=function(e){return!0===this._options.disabledDates[e.format("YYYY-MM-DD")]},S.prototype._isInEnabledDates=function(e){return!0===this._options.enabledDates[e.format("YYYY-MM-DD")]},S.prototype._isInDisabledHours=function(e){return!0===this._options.disabledHours[e.format("H")]},S.prototype._isInEnabledHours=function(e){return!0===this._options.enabledHours[e.format("H")]},S.prototype._isValid=function(e,t){if(!e.isValid())return!1;if(this._options.disabledDates&&"d"===t&&this._isInDisabledDates(e))return!1;if(this._options.enabledDates&&"d"===t&&!this._isInEnabledDates(e))return!1;if(this._options.minDate&&e.isBefore(this._options.minDate,t))return!1;if(this._options.maxDate&&e.isAfter(this._options.maxDate,t))return!1;if(this._options.daysOfWeekDisabled&&"d"===t&&-1!==this._options.daysOfWeekDisabled.indexOf(e.day()))return!1;if(this._options.disabledHours&&("h"===t||"m"===t||"s"===t)&&this._isInDisabledHours(e))return!1;if(this._options.enabledHours&&("h"===t||"m"===t||"s"===t)&&!this._isInEnabledHours(e))return!1;if(this._options.disabledTimeIntervals&&("h"===t||"m"===t||"s"===t)){var n=!1;if(o.each(this._options.disabledTimeIntervals,function(){if(e.isBetween(this[0],this[1]))return!(n=!0)}),n)return!1}return!0},S.prototype._parseInputDate=function(e){return void 0===this._options.parseInputDate?n.isMoment(e)||(e=this.getMoment(e)):e=this._options.parseInputDate(e),e},S.prototype._keydown=function(e){var t=null,n=void 0,i=void 0,o=void 0,r=void 0,s=[],a={},l=e.which;for(n in h[l]="p",h)h.hasOwnProperty(n)&&"p"===h[n]&&(s.push(n),parseInt(n,10)!==l)&&(a[n]=!0);for(n in this._options.keyBinds)if(this._options.keyBinds.hasOwnProperty(n)&&"function"==typeof this._options.keyBinds[n]&&(o=n.split(" "),o.length===s.length)&&c[l]===o[o.length-1]){for(r=!0,i=o.length-2;0<=i;i--)if(!(c[o[i]]in a)){r=!1;break}if(r){t=this._options.keyBinds[n];break}}t&&t.call(this)&&(e.stopPropagation(),e.preventDefault())},S.prototype._keyup=function(e){h[e.which]="r",f[e.which]&&(f[e.which]=!1,e.stopPropagation(),e.preventDefault())},S.prototype._indexGivenDates=function(e){var t={},n=this;return o.each(e,function(){var e=n._parseInputDate(this);e.isValid()&&(t[e.format("YYYY-MM-DD")]=!0)}),!!Object.keys(t).length&&t},S.prototype._indexGivenHours=function(e){var t={};return o.each(e,function(){t[this]=!0}),!!Object.keys(t).length&&t},S.prototype._initFormatting=function(){var e=this._options.format||"L LT",t=this;this.actualFormat=e.replace(/(\[[^\[]*])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,function(e){return t._dates[0].localeData().longDateFormat(e)||e}),this.parseFormats=this._options.extraFormats?this._options.extraFormats.slice():[],this.parseFormats.indexOf(e)<0&&this.parseFormats.indexOf(this.actualFormat)<0&&this.parseFormats.push(this.actualFormat),this.use24Hours=this.actualFormat.toLowerCase().indexOf("a")<1&&this.actualFormat.replace(/\[.*?]/g,"").indexOf("h")<1,this._isEnabled("y")&&(p=2),this._isEnabled("M")&&(p=1),this._isEnabled("d")&&(p=0),this.currentViewMode=Math.max(p,this.currentViewMode),this.unset||this._setValue(this._dates[0],0)},S.prototype._getLastPickedDate=function(){return this._dates[this._getLastPickedDateIndex()]},S.prototype._getLastPickedDateIndex=function(){return this._dates.length-1},S.prototype.getMoment=function(e){var t=void 0,t=null==e?n():this._hasTimeZone()?n.tz(e,this.parseFormats,this._options.locale,this._options.useStrict,this._options.timeZone):n(e,this.parseFormats,this._options.locale,this._options.useStrict);return this._hasTimeZone()&&t.tz(this._options.timeZone),t},S.prototype.toggle=function(){return this.widget?this.hide():this.show()},S.prototype.ignoreReadonly=function(e){if(0===arguments.length)return this._options.ignoreReadonly;if("boolean"!=typeof e)throw new TypeError("ignoreReadonly () expects a boolean parameter");this._options.ignoreReadonly=e},S.prototype.options=function(e){if(0===arguments.length)return o.extend(!0,{},this._options);if(!(e instanceof Object))throw new TypeError("options() this.options parameter should be an object");o.extend(!0,this._options,e);var n=this;o.each(this._options,function(e,t){void 0!==n[e]&&n[e](t)})},S.prototype.date=function(e,t){if(t=t||0,0===arguments.length)return this.unset?null:this._options.allowMultidate?this._dates.join(this._options.multidateSeparator):this._dates[t].clone();if(!(null===e||"string"==typeof e||n.isMoment(e)||e instanceof Date))throw new TypeError("date() parameter must be one of [null, string, moment or Date]");this._setValue(null===e?null:this._parseInputDate(e),t)},S.prototype.format=function(e){if(0===arguments.length)return this._options.format;if("string"!=typeof e&&("boolean"!=typeof e||!1!==e))throw new TypeError("format() expects a string or boolean:false parameter "+e);this._options.format=e,this.actualFormat&&this._initFormatting()},S.prototype.timeZone=function(e){if(0===arguments.length)return this._options.timeZone;if("string"!=typeof e)throw new TypeError("newZone() expects a string parameter");this._options.timeZone=e},S.prototype.dayViewHeaderFormat=function(e){if(0===arguments.length)return this._options.dayViewHeaderFormat;if("string"!=typeof e)throw new TypeError("dayViewHeaderFormat() expects a string parameter");this._options.dayViewHeaderFormat=e},S.prototype.extraFormats=function(e){if(0===arguments.length)return this._options.extraFormats;if(!1!==e&&!(e instanceof Array))throw new TypeError("extraFormats() expects an array or false parameter");this._options.extraFormats=e,this.parseFormats&&this._initFormatting()},S.prototype.disabledDates=function(e){if(0===arguments.length)return this._options.disabledDates&&o.extend({},this._options.disabledDates);if(!e)return this._options.disabledDates=!1,this._update(),!0;if(!(e instanceof Array))throw new TypeError("disabledDates() expects an array parameter");this._options.disabledDates=this._indexGivenDates(e),this._options.enabledDates=!1,this._update()},S.prototype.enabledDates=function(e){if(0===arguments.length)return this._options.enabledDates&&o.extend({},this._options.enabledDates);if(!e)return this._options.enabledDates=!1,this._update(),!0;if(!(e instanceof Array))throw new TypeError("enabledDates() expects an array parameter");this._options.enabledDates=this._indexGivenDates(e),this._options.disabledDates=!1,this._update()},S.prototype.daysOfWeekDisabled=function(e){if(0===arguments.length)return this._options.daysOfWeekDisabled.splice(0);if("boolean"==typeof e&&!e)return this._options.daysOfWeekDisabled=!1,this._update(),!0;if(!(e instanceof Array))throw new TypeError("daysOfWeekDisabled() expects an array parameter");if(this._options.daysOfWeekDisabled=e.reduce(function(e,t){return 6<(t=parseInt(t,10))||t<0||isNaN(t)||-1===e.indexOf(t)&&e.push(t),e},[]).sort(),this._options.useCurrent&&!this._options.keepInvalid)for(var t=0;t").append(g("").append(g("").addClass("prev").attr("data-action","previous").append(g("").addClass(this._options.icons.previous))).append(g("").addClass("picker-switch").attr("data-action","pickerSwitch").attr("colspan",this._options.calendarWeeks?"6":"5")).append(g("").addClass("next").attr("data-action","next").append(g("").addClass(this._options.icons.next)))),t=g("").append(g("").append(g("").attr("colspan",this._options.calendarWeeks?"8":"7")));return[g("
").addClass("datepicker-days").append(g("").addClass("table table-sm").append(e).append(g(""))),g("
").addClass("datepicker-months").append(g("
").addClass("table-condensed").append(e.clone()).append(t.clone())),g("
").addClass("datepicker-years").append(g("
").addClass("table-condensed").append(e.clone()).append(t.clone())),g("
").addClass("datepicker-decades").append(g("
").addClass("table-condensed").append(e.clone()).append(t.clone()))]},o.prototype._getTimePickerMainTemplate=function(){var e=g(""),t=g(""),n=g("");return this._isEnabled("h")&&(e.append(g("
").append(g("").attr({href:"#",tabindex:"-1",title:this._options.tooltips.incrementHour}).addClass("btn").attr("data-action","incrementHours").append(g("").addClass(this._options.icons.up)))),t.append(g("").append(g("").addClass("timepicker-hour").attr({"data-time-component":"hours",title:this._options.tooltips.pickHour}).attr("data-action","showHours"))),n.append(g("").append(g("").attr({href:"#",tabindex:"-1",title:this._options.tooltips.decrementHour}).addClass("btn").attr("data-action","decrementHours").append(g("").addClass(this._options.icons.down))))),this._isEnabled("m")&&(this._isEnabled("h")&&(e.append(g("").addClass("separator")),t.append(g("").addClass("separator").html(":")),n.append(g("").addClass("separator"))),e.append(g("").append(g("").attr({href:"#",tabindex:"-1",title:this._options.tooltips.incrementMinute}).addClass("btn").attr("data-action","incrementMinutes").append(g("").addClass(this._options.icons.up)))),t.append(g("").append(g("").addClass("timepicker-minute").attr({"data-time-component":"minutes",title:this._options.tooltips.pickMinute}).attr("data-action","showMinutes"))),n.append(g("").append(g("").attr({href:"#",tabindex:"-1",title:this._options.tooltips.decrementMinute}).addClass("btn").attr("data-action","decrementMinutes").append(g("").addClass(this._options.icons.down))))),this._isEnabled("s")&&(this._isEnabled("m")&&(e.append(g("").addClass("separator")),t.append(g("").addClass("separator").html(":")),n.append(g("").addClass("separator"))),e.append(g("").append(g("").attr({href:"#",tabindex:"-1",title:this._options.tooltips.incrementSecond}).addClass("btn").attr("data-action","incrementSeconds").append(g("").addClass(this._options.icons.up)))),t.append(g("").append(g("").addClass("timepicker-second").attr({"data-time-component":"seconds",title:this._options.tooltips.pickSecond}).attr("data-action","showSeconds"))),n.append(g("").append(g("").attr({href:"#",tabindex:"-1",title:this._options.tooltips.decrementSecond}).addClass("btn").attr("data-action","decrementSeconds").append(g("").addClass(this._options.icons.down))))),this.use24Hours||(e.append(g("").addClass("separator")),t.append(g("").append(g("").addClass("separator"))),g("
").addClass("timepicker-picker").append(g("").addClass("table-condensed").append([e,t,n]))},o.prototype._getTimePickerTemplate=function(){var e=g("
").addClass("timepicker-hours").append(g("
").addClass("table-condensed")),t=g("
").addClass("timepicker-minutes").append(g("
").addClass("table-condensed")),n=g("
").addClass("timepicker-seconds").append(g("
").addClass("table-condensed")),i=[this._getTimePickerMainTemplate()];return this._isEnabled("h")&&i.push(e),this._isEnabled("m")&&i.push(t),this._isEnabled("s")&&i.push(n),i},o.prototype._getToolbar=function(){var e,t,n=[];return this._options.buttons.showToday&&n.push(g("
").append(g("").attr({href:"#",tabindex:"-1","data-action":"today",title:this._options.tooltips.today}).append(g("").addClass(this._options.icons.today)))),!this._options.sideBySide&&this._hasDate()&&this._hasTime()&&(t=e=void 0,t="times"===this._options.viewMode?(e=this._options.tooltips.selectDate,this._options.icons.date):(e=this._options.tooltips.selectTime,this._options.icons.time),n.push(g("").append(g("").attr({href:"#",tabindex:"-1","data-action":"togglePicker",title:e}).append(g("").addClass(t))))),this._options.buttons.showClear&&n.push(g("").append(g("").attr({href:"#",tabindex:"-1","data-action":"clear",title:this._options.tooltips.clear}).append(g("").addClass(this._options.icons.clear)))),this._options.buttons.showClose&&n.push(g("").append(g("").attr({href:"#",tabindex:"-1","data-action":"close",title:this._options.tooltips.close}).append(g("").addClass(this._options.icons.close)))),0===n.length?"":g("").addClass("table-condensed").append(g("").append(g("").append(n)))},o.prototype._getTemplate=function(){var e=g("
").addClass("bootstrap-datetimepicker-widget dropdown-menu"),t=g("
").addClass("datepicker").append(this._getDatePickerTemplate()),n=g("
").addClass("timepicker").append(this._getTimePickerTemplate()),i=g("
    ").addClass("list-unstyled"),o=g("
  • ").addClass("picker-switch"+(this._options.collapse?" accordion-toggle":"")).append(this._getToolbar());return this._options.inline&&e.removeClass("dropdown-menu"),this.use24Hours&&e.addClass("usetwentyfour"),this._isEnabled("s")&&!this.use24Hours&&e.addClass("wider"),this._options.sideBySide&&this._hasDate()&&this._hasTime()?(e.addClass("timepicker-sbs"),"top"===this._options.toolbarPlacement&&e.append(o),e.append(g("
    ").addClass("row").append(t.addClass("col-md-6")).append(n.addClass("col-md-6"))),"bottom"!==this._options.toolbarPlacement&&"default"!==this._options.toolbarPlacement||e.append(o),e):("top"===this._options.toolbarPlacement&&i.append(o),this._hasDate()&&i.append(g("
  • ").addClass(this._options.collapse&&this._hasTime()?"collapse":"").addClass(this._options.collapse&&this._hasTime()&&"times"===this._options.viewMode?"":"show").append(t)),"default"===this._options.toolbarPlacement&&i.append(o),this._hasTime()&&i.append(g("
  • ").addClass(this._options.collapse&&this._hasDate()?"collapse":"").addClass(this._options.collapse&&this._hasDate()&&"times"===this._options.viewMode?"show":"").append(n)),"bottom"===this._options.toolbarPlacement&&i.append(o),e.append(i))},o.prototype._place=function(e){var e=e&&e.data&&e.data.picker||this,t=e._options.widgetPositioning.vertical,n=e._options.widgetPositioning.horizontal,i=void 0,o=(e.component&&e.component.length?e.component:e._element).position(),r=(e.component&&e.component.length?e.component:e._element).offset();if(e._options.widgetParent)i=e._options.widgetParent.append(e.widget);else if(e._element.is("input"))i=e._element.after(e.widget).parent();else{if(e._options.inline)return void e._element.append(e.widget);i=e._element,e._element.children().first().after(e.widget)}if("auto"===t&&(t=r.top+1.5*e.widget.height()>=g(window).height()+g(window).scrollTop()&&e.widget.height()+e._element.outerHeight()g(window).width()?"right":"left"),"top"===t?e.widget.addClass("top").removeClass("bottom"):e.widget.addClass("bottom").removeClass("top"),"right"===n?e.widget.addClass("float-right"):e.widget.removeClass("float-right"),0===(i="relative"!==i.css("position")?i.parents().filter(function(){return"relative"===g(this).css("position")}).first():i).length)throw new Error("datetimepicker component should be placed within a relative positioned container");e.widget.css({top:"top"===t?"auto":o.top+e._element.outerHeight()+"px",bottom:"top"===t?i.outerHeight()-(i===e._element?0:o.top)+"px":"auto",left:"left"===n?(i===e._element?0:o.left)+"px":"auto",right:"left"===n?"auto":i.outerWidth()-e._element.outerWidth()-(i===e._element?0:o.left)+"px"})},o.prototype._fillDow=function(){var e=g("
"),t=this._viewDate.clone().startOf("w").startOf("d");for(!0===this._options.calendarWeeks&&e.append(g(""),this._options.calendarWeeks&&r.append('"),i.push(r)),s="",o.isBefore(this._viewDate,"M")&&(s+=" old"),o.isAfter(this._viewDate,"M")&&(s+=" new"),this._options.allowMultidate?-1!==(e=this._datesFormatted.indexOf(o.format("YYYY-MM-DD")))&&o.isSame(this._datesFormatted[e],"d")&&!this.unset&&(s+=" active"):o.isSame(this._getLastPickedDate(),"d")&&!this.unset&&(s+=" active"),this._isValid(o,"d")||(s+=" disabled"),o.isSame(this.getMoment(),"d")&&(s+=" today"),0!==o.day()&&6!==o.day()||(s+=" weekend"),r.append('"),o.add(1,"d");t.find("tbody").empty().append(i),this._updateMonths(),this._updateYears(),this._updateDecades()}},o.prototype._fillHours=function(){var e=this.widget.find(".timepicker-hours table"),t=this._viewDate.clone().startOf("d"),n=[],i=g("");for(11"),n.push(i)),i.append('"),t.add(1,"h");e.empty().append(n)},o.prototype._fillMinutes=function(){for(var e=this.widget.find(".timepicker-minutes table"),t=this._viewDate.clone().startOf("h"),n=[],i=1===this._options.stepping?5:this._options.stepping,o=g("");this._viewDate.isSame(t,"h");)t.minute()%(4*i)==0&&(o=g(""),n.push(o)),o.append('"),t.add(i,"m");e.empty().append(n)},o.prototype._fillSeconds=function(){for(var e=this.widget.find(".timepicker-seconds table"),t=this._viewDate.clone().startOf("m"),n=[],i=g("");this._viewDate.isSame(t,"m");)t.second()%20==0&&(i=g(""),n.push(i)),i.append('"),t.add(5,"s");e.empty().append(n)},o.prototype._fillTime=function(){var e,t=void 0,n=this.widget.find(".timepicker span[data-time-component]");this.use24Hours||(t=this.widget.find(".timepicker [data-action=togglePeriod]"),e=this._getLastPickedDate().clone().add(12<=this._getLastPickedDate().hours()?-12:12,"h"),t.text(this._getLastPickedDate().format("A")),this._isValid(e,"h")?t.removeClass("disabled"):t.addClass("disabled")),n.filter("[data-time-component=hours]").text(this._getLastPickedDate().format(this.use24Hours?"HH":"hh")),n.filter("[data-time-component=minutes]").text(this._getLastPickedDate().format("mm")),n.filter("[data-time-component=seconds]").text(this._getLastPickedDate().format("ss")),this._fillHours(),this._fillMinutes(),this._fillSeconds()},o.prototype._doAction=function(e,t){var n=this._getLastPickedDate();if(!g(e.currentTarget).is(".disabled"))switch(t=t||g(e.currentTarget).data("action")){case"next":var i=k.DatePickerModes[this.currentViewMode].NAV_FUNCTION;this._viewDate.add(k.DatePickerModes[this.currentViewMode].NAV_STEP,i),this._fillDate(),this._viewUpdate(i);break;case"previous":i=k.DatePickerModes[this.currentViewMode].NAV_FUNCTION;this._viewDate.subtract(k.DatePickerModes[this.currentViewMode].NAV_STEP,i),this._fillDate(),this._viewUpdate(i);break;case"pickerSwitch":this._showMode(1);break;case"selectMonth":i=g(e.target).closest("tbody").find("span").index(g(e.target));this._viewDate.month(i),this.currentViewMode===k.MinViewModeNumber?(this._setValue(n.clone().year(this._viewDate.year()).month(this._viewDate.month()),this._getLastPickedDateIndex()),this._options.inline||this.hide()):(this._showMode(-1),this._fillDate()),this._viewUpdate("M");break;case"selectYear":i=parseInt(g(e.target).text(),10)||0;this._viewDate.year(i),this.currentViewMode===k.MinViewModeNumber?(this._setValue(n.clone().year(this._viewDate.year()),this._getLastPickedDateIndex()),this._options.inline||this.hide()):(this._showMode(-1),this._fillDate()),this._viewUpdate("YYYY");break;case"selectDecade":i=parseInt(g(e.target).data("selection"),10)||0;this._viewDate.year(i),this.currentViewMode===k.MinViewModeNumber?(this._setValue(n.clone().year(this._viewDate.year()),this._getLastPickedDateIndex()),this._options.inline||this.hide()):(this._showMode(-1),this._fillDate()),this._viewUpdate("YYYY");break;case"selectDay":i=this._viewDate.clone();g(e.target).is(".old")&&i.subtract(1,"M"),g(e.target).is(".new")&&i.add(1,"M"),this._setValue(i.date(parseInt(g(e.target).text(),10)),this._getLastPickedDateIndex()),this._hasTime()||this._options.keepOpen||this._options.inline||this.hide();break;case"incrementHours":i=n.clone().add(1,"h");this._isValid(i,"h")&&this._setValue(i,this._getLastPickedDateIndex());break;case"incrementMinutes":i=n.clone().add(this._options.stepping,"m");this._isValid(i,"m")&&this._setValue(i,this._getLastPickedDateIndex());break;case"incrementSeconds":i=n.clone().add(1,"s");this._isValid(i,"s")&&this._setValue(i,this._getLastPickedDateIndex());break;case"decrementHours":i=n.clone().subtract(1,"h");this._isValid(i,"h")&&this._setValue(i,this._getLastPickedDateIndex());break;case"decrementMinutes":i=n.clone().subtract(this._options.stepping,"m");this._isValid(i,"m")&&this._setValue(i,this._getLastPickedDateIndex());break;case"decrementSeconds":i=n.clone().subtract(1,"s");this._isValid(i,"s")&&this._setValue(i,this._getLastPickedDateIndex());break;case"togglePeriod":this._setValue(n.clone().add(12<=n.hours()?-12:12,"h"),this._getLastPickedDateIndex());break;case"togglePicker":var i=g(e.target),o=i.closest("a"),r=i.closest("ul"),s=r.find(".show"),r=r.find(".collapse:not(.show)"),i=i.is("span")?i:i.find("span");if(s&&s.length){if((a=s.data("collapse"))&&a.transitioning)return!0;s.collapse?(s.collapse("hide"),r.collapse("show")):(s.removeClass("show"),r.addClass("show")),i.toggleClass(this._options.icons.time+" "+this._options.icons.date),i.hasClass(this._options.icons.date)?o.attr("title",this._options.tooltips.selectDate):o.attr("title",this._options.tooltips.selectTime)}break;case"showPicker":this.widget.find(".timepicker > div:not(.timepicker-picker)").hide(),this.widget.find(".timepicker .timepicker-picker").show();break;case"showHours":this.widget.find(".timepicker .timepicker-picker").hide(),this.widget.find(".timepicker .timepicker-hours").show();break;case"showMinutes":this.widget.find(".timepicker .timepicker-picker").hide(),this.widget.find(".timepicker .timepicker-minutes").show();break;case"showSeconds":this.widget.find(".timepicker .timepicker-picker").hide(),this.widget.find(".timepicker .timepicker-seconds").show();break;case"selectHour":var a=parseInt(g(e.target).text(),10);this.use24Hours||(12<=n.hours()?12!==a&&(a+=12):12===a&&(a=0)),this._setValue(n.clone().hours(a),this._getLastPickedDateIndex()),this._isEnabled("a")||this._isEnabled("m")||this._options.keepOpen||this._options.inline?this._doAction(e,"showPicker"):this.hide();break;case"selectMinute":this._setValue(n.clone().minutes(parseInt(g(e.target).text(),10)),this._getLastPickedDateIndex()),this._isEnabled("a")||this._isEnabled("s")||this._options.keepOpen||this._options.inline?this._doAction(e,"showPicker"):this.hide();break;case"selectSecond":this._setValue(n.clone().seconds(parseInt(g(e.target).text(),10)),this._getLastPickedDateIndex()),this._isEnabled("a")||this._options.keepOpen||this._options.inline?this._doAction(e,"showPicker"):this.hide();break;case"clear":this.clear();break;case"close":this.hide();break;case"today":s=this.getMoment();this._isValid(s,"d")&&this._setValue(s,this._getLastPickedDateIndex())}return!1},o.prototype.hide=function(){var t=!1;this.widget&&(this.widget.find(".collapse").each(function(){var e=g(this).data("collapse");return!e||!e.transitioning||!(t=!0)}),t||(this.component&&this.component.hasClass("btn")&&this.component.toggleClass("active"),this.widget.hide(),g(window).off("resize",this._place()),this.widget.off("click","[data-action]"),this.widget.off("mousedown",!1),this.widget.remove(),this.widget=!1,this._notifyEvent({type:k.Event.HIDE,date:this._getLastPickedDate().clone()}),void 0!==this.input&&this.input.blur(),this._viewDate=this._getLastPickedDate().clone()))},o.prototype.show=function(){var e=void 0,t={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)}};if(void 0!==this.input){if(this.input.prop("disabled")||!this._options.ignoreReadonly&&this.input.prop("readonly")||this.widget)return;void 0!==this.input.val()&&0!==this.input.val().trim().length?this._setValue(this._parseInputDate(this.input.val().trim()),0):this.unset&&this._options.useCurrent&&(e=this.getMoment(),"string"==typeof this._options.useCurrent&&(e=t[this._options.useCurrent](e)),this._setValue(e,0))}else this.unset&&this._options.useCurrent&&(e=this.getMoment(),"string"==typeof this._options.useCurrent&&(e=t[this._options.useCurrent](e)),this._setValue(e,0));this.widget=this._getTemplate(),this._fillDow(),this._fillMonths(),this.widget.find(".timepicker-hours").hide(),this.widget.find(".timepicker-minutes").hide(),this.widget.find(".timepicker-seconds").hide(),this._update(),this._showMode(),g(window).on("resize",{picker:this},this._place),this.widget.on("click","[data-action]",g.proxy(this._doAction,this)),this.widget.on("mousedown",!1),this.component&&this.component.hasClass("btn")&&this.component.toggleClass("active"),this._place(),this.widget.show(),void 0!==this.input&&this._options.focusOnShow&&!this.input.is(":focus")&&this.input.focus(),this._notifyEvent({type:k.Event.SHOW})},o.prototype.destroy=function(){this.hide(),this._element.removeData(k.DATA_KEY),this._element.removeData("date")},o.prototype.disable=function(){this.hide(),this.component&&this.component.hasClass("btn")&&this.component.addClass("disabled"),void 0!==this.input&&this.input.prop("disabled",!0)},o.prototype.enable=function(){this.component&&this.component.hasClass("btn")&&this.component.removeClass("disabled"),void 0!==this.input&&this.input.prop("disabled",!1)},o.prototype.toolbarPlacement=function(e){if(0===arguments.length)return this._options.toolbarPlacement;if("string"!=typeof e)throw new TypeError("toolbarPlacement() expects a string parameter");if(-1===_.indexOf(e))throw new TypeError("toolbarPlacement() parameter must be one of ("+_.join(", ")+") value");this._options.toolbarPlacement=e,this.widget&&(this.hide(),this.show())},o.prototype.widgetPositioning=function(e){if(0===arguments.length)return g.extend({},this._options.widgetPositioning);if("[object Object]"!=={}.toString.call(e))throw new TypeError("widgetPositioning() expects an object variable");if(e.horizontal){if("string"!=typeof e.horizontal)throw new TypeError("widgetPositioning() horizontal variable must be a string");if(e.horizontal=e.horizontal.toLowerCase(),-1===b.indexOf(e.horizontal))throw new TypeError("widgetPositioning() expects horizontal parameter to be one of ("+b.join(", ")+")");this._options.widgetPositioning.horizontal=e.horizontal}if(e.vertical){if("string"!=typeof e.vertical)throw new TypeError("widgetPositioning() vertical variable must be a string");if(e.vertical=e.vertical.toLowerCase(),-1===y.indexOf(e.vertical))throw new TypeError("widgetPositioning() expects vertical parameter to be one of ("+y.join(", ")+")");this._options.widgetPositioning.vertical=e.vertical}this._update()},o.prototype.widgetParent=function(e){if(0===arguments.length)return this._options.widgetParent;if(null!==(e="string"==typeof e?g(e):e)&&"string"!=typeof e&&!(e instanceof g))throw new TypeError("widgetParent() expects a string or a jQuery object parameter");this._options.widgetParent=e,this.widget&&(this.hide(),this.show())},o._jQueryHandleThis=function(e,t,n){var i=g(e).data(k.DATA_KEY);if("object"===(void 0===t?"undefined":w(t))&&g.extend({},k.Default,t),i||(i=new o(g(e),t),g(e).data(k.DATA_KEY,i)),"string"==typeof t){if(void 0===i[t])throw new Error('No method named "'+t+'"');return void 0===n?i[t]():i[t](n)}},o._jQueryInterface=function(e,t){return 1===this.length?o._jQueryHandleThis(this[0],e,t):this.each(function(){o._jQueryHandleThis(this,e,t)})},o}(k),g(document).on(k.Event.CLICK_DATA_API,k.Selector.DATA_TOGGLE,function(){var e=D(g(this));0!==e.length&&x._jQueryInterface.call(e,"toggle")}).on(k.Event.CHANGE,"."+k.ClassName.INPUT,function(e){var t=D(g(this));0!==t.length&&x._jQueryInterface.call(t,"_change",e)}).on(k.Event.BLUR,"."+k.ClassName.INPUT,function(e){var t=D(g(this)),n=t.data(k.DATA_KEY);0===t.length||n._options.debug||window.debug||x._jQueryInterface.call(t,"hide",e)}).on(k.Event.KEYDOWN,"."+k.ClassName.INPUT,function(e){var t=D(g(this));0!==t.length&&x._jQueryInterface.call(t,"_keydown",e)}).on(k.Event.KEYUP,"."+k.ClassName.INPUT,function(e){var t=D(g(this));0!==t.length&&x._jQueryInterface.call(t,"_keyup",e)}).on(k.Event.FOCUS,"."+k.ClassName.INPUT,function(e){var t=D(g(this)),n=t.data(k.DATA_KEY);0!==t.length&&n._options.allowInputToggle&&x._jQueryInterface.call(t,"show",e)}),g.fn[k.NAME]=x._jQueryInterface,g.fn[k.NAME].Constructor=x,g.fn[k.NAME].noConflict=function(){return g.fn[k.NAME]=v,x._jQueryInterface}}(),!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).Sortable=t()}(this,function(){"use strict";function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function s(){return(s=Object.assign||function(e){for(var t=1;t"===t[0]&&(t=t.substring(1)),e))try{if(e.matches)return e.matches(t);if(e.msMatchesSelector)return e.msMatchesSelector(t);if(e.webkitMatchesSelector)return e.webkitMatchesSelector(t)}catch(e){return}}function L(e,t,n,i){if(e){n=n||document;do{if(null!=t&&(">"!==t[0]||e.parentNode===n)&&g(e,t)||i&&e===n)return e}while(e!==n&&(e=(o=e).host&&o!==document&&o.host.nodeType?o.host:o.parentNode))}var o;return null}var k,S=/\s+/g;function A(e,t,n){var i;e&&t&&(e.classList?e.classList[n?"add":"remove"](t):(i=(" "+e.className+" ").replace(S," ").replace(" "+t+" "," "),e.className=(i+(n?" "+t:"")).replace(S," ")))}function N(e,t,n){var i=e&&e.style;if(i){if(void 0===n)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(e,""):e.currentStyle&&(n=e.currentStyle),void 0===t?n:n[t];i[t=t in i||-1!==t.indexOf("webkit")?t:"-webkit-"+t]=n+("string"==typeof n?"":"px")}}function f(e,t){var n="";if("string"==typeof e)n=e;else do{var i=N(e,"transform")}while(i&&"none"!==i&&(n=i+" "+n),!t&&(e=e.parentNode));var o=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return o&&new o(n)}function T(e,t,n){if(e){var i=e.getElementsByTagName(t),o=0,r=i.length;if(n)for(;o=i.left-t&&o<=i.right+t,i=r>=i.top-t&&r<=i.bottom+t,t&&n&&i?s=e:void 0});var t=s;if(t){var n,i={};for(n in e)e.hasOwnProperty(n)&&(i[n]=e[n]);i.target=i.rootEl=t,i.preventDefault=void 0,i.stopPropagation=void 0,t[I]._onDragOver(i)}}var o,r,s}function We(e){H&&H.parentNode[I]._isOutsideThisEl(e.target)}function V(e,t){if(!e||!e.nodeType||1!==e.nodeType)throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(e));this.el=e,this.options=t=s({},t),e[I]=this;var n,i,o={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(e.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return le(e,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(e,t){e.setData("Text",t.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:!1!==V.supportPointer&&"PointerEvent"in window,emptyInsertThreshold:5};for(n in se.initializePlugins(this,e,o),o)n in t||(t[n]=o[n]);for(i in ue(t),this)"_"===i.charAt(0)&&"function"==typeof this[i]&&(this[i]=this[i].bind(this));this.nativeDraggable=!t.forceFallback&&je,this.nativeDraggable&&(this.options.touchStartThreshold=1),t.supportPointer?l(e,"pointerdown",this._onTapStart):(l(e,"mousedown",this._onTapStart),l(e,"touchstart",this._onTapStart)),this.nativeDraggable&&(l(e,"dragover",this),l(e,"dragenter",this)),Ee.push(this.el),t.store&&t.store.get&&this.sort(t.store.get(this)||[]),s(this,ie())}function Re(e,t,n,i,o,r,s,a){var l,u,c=e[I],d=c.options.onMove;return!window.CustomEvent||b||C?(l=document.createEvent("Event")).initEvent("move",!0,!0):l=new CustomEvent("move",{bubbles:!0,cancelable:!0}),l.to=t,l.from=e,l.dragged=n,l.draggedRect=i,l.related=o||t,l.relatedRect=r||P(t),l.willInsertAfter=a,l.originalEvent=s,e.dispatchEvent(l),u=d?d.call(c,l,s):u}function Ye(e){e.draggable=!1}function Be(){Ae=!1}function qe(e){return setTimeout(e,0)}function ze(e){return clearTimeout(e)}Pe&&document.addEventListener("click",function(e){if(De)return e.preventDefault(),e.stopPropagation&&e.stopPropagation(),e.stopImmediatePropagation&&e.stopImmediatePropagation(),De=!1},!0),V.prototype={constructor:V,_isOutsideThisEl:function(e){this.el.contains(e)||e===this.el||(Ce=null)},_getDirection:function(e,t){return"function"==typeof this.options.direction?this.options.direction.call(this,e,t,H):this.options.direction},_onTapStart:function(t){if(t.cancelable){var n=this,i=this.el,e=this.options,o=e.preventOnFilter,r=t.type,s=t.touches&&t.touches[0]||t.pointerType&&"touch"===t.pointerType&&t,a=(s||t).target,l=t.target.shadowRoot&&(t.path&&t.path[0]||t.composedPath&&t.composedPath()[0])||a,u=e.filter,c=i;Ne.length=0;for(var d=c.getElementsByTagName("input"),h=d.length;h--;){var f=d[h];f.checked&&Ne.push(f)}if(!H&&!(/mousedown|pointerdown/.test(r)&&0!==t.button||e.disabled||l.isContentEditable||(a=L(a,e.draggable,i,!1))&&a.animated||fe===a)){if(pe=$(a),me=$(a,e.draggable),"function"==typeof u){if(u.call(this,t,a,this))return F({sortable:n,rootEl:l,name:"filter",targetEl:a,toEl:i,fromEl:i}),j("filter",n,{evt:t}),void(o&&t.cancelable&&t.preventDefault())}else if(u=u&&u.split(",").some(function(e){if(e=L(l,e.trim(),i,!1))return F({sortable:n,rootEl:e,name:"filter",targetEl:a,fromEl:i,toEl:i}),j("filter",n,{evt:t}),!0}))return void(o&&t.cancelable&&t.preventDefault());e.handle&&!L(l,e.handle,i,!1)||this._prepareDragStart(t,s,a)}}},_prepareDragStart:function(e,t,n){var i,o=this,r=o.el,s=o.options,a=r.ownerDocument;n&&!H&&n.parentNode===r&&(i=P(n),Y=r,W=(H=n).parentNode,he=H.nextSibling,fe=n,ge=s.group,ve={target:V.dragged=H,clientX:(t||e).clientX,clientY:(t||e).clientY},_e=ve.clientX-i.left,xe=ve.clientY-i.top,this._lastX=(t||e).clientX,this._lastY=(t||e).clientY,H.style["will-change"]="all",r=function(){j("delayEnded",o,{evt:e}),V.eventCanceled?o._onDrop():(o._disableDelayedDragEvents(),!h&&o.nativeDraggable&&(H.draggable=!0),o._triggerDragStart(e,t),F({sortable:o,name:"choose",originalEvent:e}),A(H,s.chosenClass,!0))},s.ignore.split(",").forEach(function(e){T(H,e.trim(),Ye)}),l(a,"dragover",He),l(a,"mousemove",He),l(a,"touchmove",He),l(a,"mouseup",o._onDrop),l(a,"touchend",o._onDrop),l(a,"touchcancel",o._onDrop),h&&this.nativeDraggable&&(this.options.touchStartThreshold=4,H.draggable=!0),j("delayStart",this,{evt:e}),!s.delay||s.delayOnTouchOnly&&!t||this.nativeDraggable&&(C||b)?r():V.eventCanceled?this._onDrop():(l(a,"mouseup",o._disableDelayedDrag),l(a,"touchend",o._disableDelayedDrag),l(a,"touchcancel",o._disableDelayedDrag),l(a,"mousemove",o._delayedDragTouchMoveHandler),l(a,"touchmove",o._delayedDragTouchMoveHandler),s.supportPointer&&l(a,"pointermove",o._delayedDragTouchMoveHandler),o._dragStartTimer=setTimeout(r,s.delay)))},_delayedDragTouchMoveHandler:function(e){e=e.touches?e.touches[0]:e;Math.max(Math.abs(e.clientX-this._lastX),Math.abs(e.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){H&&Ye(H),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var e=this.el.ownerDocument;r(e,"mouseup",this._disableDelayedDrag),r(e,"touchend",this._disableDelayedDrag),r(e,"touchcancel",this._disableDelayedDrag),r(e,"mousemove",this._delayedDragTouchMoveHandler),r(e,"touchmove",this._delayedDragTouchMoveHandler),r(e,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(e,t){t=t||"touch"==e.pointerType&&e,!this.nativeDraggable||t?this.options.supportPointer?l(document,"pointermove",this._onTouchMove):l(document,t?"touchmove":"mousemove",this._onTouchMove):(l(H,"dragend",this),l(Y,"dragstart",this._onDragStart));try{document.selection?qe(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch(e){}},_dragStarted:function(e,t){var n;Te=!1,Y&&H?(j("dragStarted",this,{evt:t}),this.nativeDraggable&&l(document,"dragover",We),n=this.options,e||A(H,n.dragClass,!1),A(H,n.ghostClass,!0),V.active=this,e&&this._appendGhost(),F({sortable:this,name:"start",originalEvent:t})):this._nulling()},_emulateDragOver:function(){if(u){this._lastX=u.clientX,this._lastY=u.clientY,ce();for(var e=document.elementFromPoint(u.clientX,u.clientY),t=e;e&&e.shadowRoot&&(e=e.shadowRoot.elementFromPoint(u.clientX,u.clientY))!==t;)t=e;if(H.parentNode[I]._isOutsideThisEl(e),t)for(;(!t[I]||!t[I]._onDragOver({clientX:u.clientX,clientY:u.clientY,target:e,rootEl:t})||this.options.dragoverBubble)&&(t=(e=t).parentNode););de()}},_onTouchMove:function(e){if(ve){var t=this.options,n=t.fallbackTolerance,t=t.fallbackOffset,i=e.touches?e.touches[0]:e,o=R&&f(R,!0),r=R&&o&&o.a,s=R&&o&&o.d,a=$e&&c&&Q(c),r=(i.clientX-ve.clientX+t.x)/(r||1)+(a?a[0]-Le[0]:0)/(r||1),t=(i.clientY-ve.clientY+t.y)/(s||1)+(a?a[1]-Le[1]:0)/(s||1);if(!V.active&&!Te){if(n&&Math.max(Math.abs(i.clientX-this._lastX),Math.abs(i.clientY-this._lastY))n.right+10||e.clientX<=n.right&&e.clientY>n.bottom&&e.clientX>=n.left:e.clientX>n.right&&e.clientY>n.top||e.clientX<=n.right&&e.clientY>n.bottom+10}(c,o,this)&&!e.animated){if(e===H)return E(!1);if((s=e&&r===c.target?e:s)&&(v=P(s)),!1!==Re(Y,r,H,n,s,v,c,!!s))return D(),r.appendChild(H),W=r,M(),E(!0)}else if(s.parentNode===r){var p,m,g,v=P(s),e=H.parentNode!==r,y=(C=H.animated&&H.toRect||n,y=s.animated&&s.toRect||v,x=(S=o)?C.left:C.top,b=S?C.right:C.bottom,C=S?C.width:C.height,k=S?y.left:y.top,_=S?y.right:y.bottom,S=S?y.width:y.height,!(x===k||b===_||x+C/2===k+S/2)),b=o?"top":"left",_=U(s,"top","top")||U(H,"top","top"),x=_?_.scrollTop:void 0;if(Ce!==s&&(m=v[b],Me=!1,Oe=!y&&t.invertSwap||e),0!==(p=function(e,t,n,i,o,r,s){var a=n?c.clientY:c.clientX,l=n?t.height:t.width,u=n?t.top:t.left,n=n?t.bottom:t.right,t=!1;if(!r)if(s&&Sethis.options.totalPages)throw new Error("Start page option is incorrect");if(this.options.totalPages=parseInt(this.options.totalPages),isNaN(this.options.totalPages))throw new Error("Total pages option is not correct!");if(this.options.visiblePages=parseInt(this.options.visiblePages),isNaN(this.options.visiblePages))throw new Error("Visible pages option is not correct!");var n;return(this.options.beforePageClick instanceof Function&&this.$element.first().on("beforePage",this.options.beforePageClick),this.options.onPageClick instanceof Function&&this.$element.first().on("page",this.options.onPageClick),this.options.hideOnlyOnePage&&1==this.options.totalPages)?this.options.initiateStartPageClick&&this.$element.trigger("page",1):(this.options.href&&(this.options.startPage=this.getPageFromQueryString(),this.options.startPage||(this.options.startPage=1)),"UL"===("function"==typeof this.$element.prop?this.$element.prop("tagName"):this.$element.attr("tagName"))?this.$listContainer=this.$element:(e=this.$element,n=r([]),e.each(function(e){var t=r("
    ");r(this).append(t),n.push(t[0])}),this.$listContainer=n,this.$element=n),this.$listContainer.addClass(this.options.paginationClass),this.options.initiateStartPageClick?this.show(this.options.startPage):(this.currentPage=this.options.startPage,this.render(this.getPages(this.options.startPage)),this.setupEvents())),this}var e=r.fn.twbsPagination;s.prototype={constructor:s,destroy:function(){return this.$element.empty(),this.$element.removeData("twbs-pagination"),this.$element.off("page"),this},show:function(e){if(e<1||e>this.options.totalPages)throw new Error("Page is incorrect.");this.currentPage=e,this.$element.trigger("beforePage",e);var t=this.getPages(e);return this.render(t),this.setupEvents(),this.$element.trigger("page",e),t},enable:function(){this.show(this.currentPage)},disable:function(){var e=this;this.$listContainer.off("click").on("click","li",function(e){e.preventDefault()}),this.$listContainer.children().each(function(){r(this).hasClass(e.options.activeClass)||r(this).addClass(e.options.disabledClass)})},buildListItems:function(e){var t=[];this.options.first&&t.push(this.buildItem("first",1)),this.options.prev&&(n=1"),i=r(""),o=this.options[e]?this.makeText(this.options[e],t):t;return n.addClass(this.options[e+"Class"]),n.data("page",t),n.data("page-type",e),n.append(i.attr("href",this.makeHref(t)).addClass(this.options.anchorClass).html(o)),n},getPages:function(e){var t=[],n=Math.floor(this.options.visiblePages/2),i=e-n+1-this.options.visiblePages%2,o=e+n,n=this.options.visiblePages;n>this.options.totalPages&&(n=this.options.totalPages),i<=0&&(i=1,o=n),o>this.options.totalPages&&(i=this.options.totalPages-n+1,o=this.options.totalPages);for(var r=i;r<=o;)t.push(r),r++;return{currentPage:e,numeric:t}},render:function(t){var n=this,e=(this.$listContainer.children().remove(),this.buildListItems(t));r.each(e,function(e,t){n.$listContainer.append(t)}),this.$listContainer.children().each(function(){var e=r(this);switch(e.data("page-type")){case"page":e.data("page")===t.currentPage&&e.addClass(n.options.activeClass);break;case"first":e.toggleClass(n.options.disabledClass,1===t.currentPage);break;case"last":e.toggleClass(n.options.disabledClass,t.currentPage===n.options.totalPages);break;case"prev":e.toggleClass(n.options.disabledClass,!n.options.loop&&1===t.currentPage);break;case"next":e.toggleClass(n.options.disabledClass,!n.options.loop&&t.currentPage===n.options.totalPages)}})},setupEvents:function(){var n=this;this.$listContainer.off("click").on("click","li",function(e){var t=r(this);if(t.hasClass(n.options.disabledClass)||t.hasClass(n.options.activeClass))return!1;n.options.href||e.preventDefault(),n.show(parseInt(t.data("page")))})},changeTotalPages:function(e,t){return this.options.totalPages=e,this.show(t)},makeHref:function(e){return this.options.href?this.generateQueryString(e):"#"},makeText:function(e,t){return e.replace(this.options.pageVariable,t).replace(this.options.totalPagesVariable,this.options.totalPages)},getPageFromQueryString:function(e){e=this.getSearchString(e),e=new RegExp(this.options.pageVariable+"(=([^&#]*)|&|#|$)").exec(e);return!e||!e[2]||(e=decodeURIComponent(e[2]),e=parseInt(e),isNaN(e))?null:e},generateQueryString:function(e,t){var t=this.getSearchString(t),n=new RegExp(this.options.pageVariable+"=*[^&#]*");return t?"?"+t.replace(n,this.options.pageVariable+"="+e):""},getSearchString:function(e){e=e||t.location.search;return""===e?null:e=0===e.indexOf("?")?e.substr(1):e},getCurrentPage:function(){return this.currentPage},getTotalPages:function(){return this.options.totalPages}},r.fn.twbsPagination=function(e){var t,n=Array.prototype.slice.call(arguments,1),i=r(this),o=i.data("twbs-pagination");return o||i.data("twbs-pagination",o=new s(this,"object"==typeof e?e:{})),void 0===(t="string"==typeof e?o[e].apply(o,n):t)?i:t},r.fn.twbsPagination.defaults={totalPages:1,startPage:1,visiblePages:5,initiateStartPageClick:!0,hideOnlyOnePage:!1,href:!1,pageVariable:"{{page}}",totalPagesVariable:"{{total_pages}}",page:null,first:"First",prev:"Previous",next:"Next",last:"Last",loop:!1,beforePageClick:null,onPageClick:null,paginationClass:"pagination",nextClass:"page-item next",prevClass:"page-item prev",lastClass:"page-item last",firstClass:"page-item first",pageClass:"page-item",activeClass:"active",disabledClass:"disabled",anchorClass:"page-link"},r.fn.twbsPagination.Constructor=s,r.fn.twbsPagination.noConflict=function(){return r.fn.twbsPagination=e,this},r.fn.twbsPagination.version="1.4.2"}(window.jQuery,window,document),!function(e,t){"function"==typeof define&&define.amd?define("sifter",t):"object"==typeof exports?module.exports=t():e.Sifter=t()}(this,function(){function e(e,t){this.items=e,this.settings=t||{diacritics:!0}}e.prototype.tokenize=function(e){if(!(e=a(String(e||"").toLowerCase()))||!e.length)return[];for(var t,n,i=[],o=e.split(/ +/),r=0,s=o.length;r/g,">").replace(/"/g,""")},escape_replace=function(e){return(e+"").replace(/\$/g,"$$$$")},hook={before:function(e,t,n){var i=e[t];e[t]=function(){return n.apply(e,arguments),i.apply(e,arguments)}},after:function(t,e,n){var i=t[e];t[e]=function(){var e=i.apply(t,arguments);return n.apply(t,arguments),e}}},once=function(e){var t=!1;return function(){t||(t=!0,e.apply(this,arguments))}},debounce=function(n,i){var o;return function(){var e=this,t=arguments;window.clearTimeout(o),o=window.setTimeout(function(){n.apply(e,t)},i)}},debounce_events=function(t,n,e){var i,o=t.trigger,r={};for(i in t.trigger=function(){var e=arguments[0];if(-1===n.indexOf(e))return o.apply(t,arguments);r[e]=arguments},e.apply(t,[]),t.trigger=o,r)r.hasOwnProperty(i)&&o.apply(t,r[i])},watchChildEvent=function(n,e,t,i){n.on(e,t,function(e){for(var t=e.target;t&&t.parentNode!==n[0];)t=t.parentNode;return e.currentTarget=t,i.apply(this,[e])})},getSelection=function(e){var t,n,i={};return"selectionStart"in e?(i.start=e.selectionStart,i.length=e.selectionEnd-i.start):document.selection&&(e.focus(),t=document.selection.createRange(),n=document.selection.createRange().text.length,t.moveStart("character",-e.value.length),i.start=t.text.length-n,i.length=n),i},transferStyles=function(e,t,n){var i,o,r={};if(n)for(i=0,o=n.length;i").css({position:"absolute",top:-99999,left:-99999,width:"auto",padding:0,whiteSpace:"pre"}).appendTo("body")),Selectize.$testInput.text(e),transferStyles(t,Selectize.$testInput,["letterSpacing","fontSize","fontFamily","fontWeight","textTransform"]),Selectize.$testInput.width()):0},autoGrow=function(s){function e(e,t){var n,i,o,r;t=t||{},(e=e||window.event||{}).metaKey||e.altKey||!t.force&&!1===s.data("grow")||(i=s.val(),e.type&&"keydown"===e.type.toLowerCase()&&(o=48<=(n=e.keyCode)&&n<=57||65<=n&&n<=90||96<=n&&n<=111||186<=n&&n<=222||32===n,n===KEY_DELETE||n===KEY_BACKSPACE?(t=getSelection(s[0])).length?i=i.substring(0,t.start)+i.substring(t.start+t.length):n===KEY_BACKSPACE&&t.start?i=i.substring(0,t.start-1)+i.substring(t.start+1):n===KEY_DELETE&&void 0!==t.start&&(i=i.substring(0,t.start)+i.substring(t.start+1)):o&&(o=e.shiftKey,r=String.fromCharCode(e.keyCode),i+=r=o?r.toUpperCase():r.toLowerCase())),r=s.attr("placeholder"),(i=measureString(i=!i&&r?r:i,s)+4)!==a&&(a=i,s.width(i),s.triggerHandler("resize")))}var a=null;s.on("keydown keyup update blur",e),e()},domToString=function(e){var t=document.createElement("div");return t.appendChild(e.cloneNode(!0)),t.innerHTML},logError=function(e,t){t=t||{},console.error("Selectize: "+e),t.explanation&&(console.group&&console.group(),console.error(t.explanation),console.group)&&console.groupEnd()},Selectize=function(e,t){var n,i,o=this,r=e[0];r.selectize=o;var s=(s=(s=window.getComputedStyle&&window.getComputedStyle(r,null))?s.getPropertyValue("direction"):r.currentStyle&&r.currentStyle.direction)||e.parents("[dir]:first").attr("dir")||"";if($.extend(o,{order:0,settings:t,$input:e,tabIndex:e.attr("tabindex")||"",tagType:"select"===r.tagName.toLowerCase()?TAG_SELECT:TAG_INPUT,rtl:/rtl/i.test(s),eventNS:".selectize"+ ++Selectize.count,highlightedValue:null,isBlurring:!1,isOpen:!1,isDisabled:!1,isRequired:e.is("[required]"),isInvalid:!1,isLocked:!1,isFocused:!1,isInputHidden:!1,isSetup:!1,isShiftDown:!1,isCmdDown:!1,isCtrlDown:!1,ignoreFocus:!1,ignoreBlur:!1,ignoreHover:!1,hasOptions:!1,currentResults:null,lastValue:"",caretPos:0,loading:0,loadedSearches:{},$activeOption:null,$activeItems:[],optgroups:{},options:{},userOptions:{},items:[],renderCache:{},onSearchChange:null===t.loadThrottle?o.onSearchChange:debounce(o.onSearchChange,t.loadThrottle)}),o.sifter=new Sifter(this.options,{diacritics:t.diacritics}),o.settings.options){for(n=0,i=o.settings.options.length;n").addClass(n.wrapperClass).addClass(l).addClass(a),c=$("
    ").addClass(n.inputClass).addClass("items").appendTo(u),d=$('').appendTo(c).attr("tabindex",s.is(":disabled")?"-1":t.tabIndex),h=$(n.dropdownParent||u),f=$("
    ").addClass(n.dropdownClass).addClass(a).hide().appendTo(h),a=$("
    ").addClass(n.dropdownContentClass).appendTo(f);(h=s.attr("id"))&&(d.attr("id",h+"-selectized"),$("label[for='"+h+"']").attr("for",h+"-selectized")),t.settings.copyClassesToDropdown&&f.addClass(l),u.css({width:s[0].style.width}),t.plugins.names.length&&(e="plugin-"+t.plugins.names.join(" plugin-"),u.addClass(e),f.addClass(e)),(null===n.maxItems||1[data-selectable]",function(e){e.stopImmediatePropagation()}),f.on("mouseenter","[data-selectable]",function(){return t.onOptionHover.apply(t,arguments)}),f.on("mousedown click","[data-selectable]",function(){return t.onOptionSelect.apply(t,arguments)}),watchChildEvent(c,"mousedown","*:not(input)",function(){return t.onItemSelect.apply(t,arguments)}),autoGrow(d),c.on({mousedown:function(){return t.onMouseDown.apply(t,arguments)},click:function(){return t.onClick.apply(t,arguments)}}),d.on({mousedown:function(e){e.stopPropagation()},keydown:function(){return t.onKeyDown.apply(t,arguments)},keyup:function(){return t.onKeyUp.apply(t,arguments)},keypress:function(){return t.onKeyPress.apply(t,arguments)},resize:function(){t.positionDropdown.apply(t,[])},blur:function(){return t.onBlur.apply(t,arguments)},focus:function(){return t.ignoreBlur=!1,t.onFocus.apply(t,arguments)},paste:function(){return t.onPaste.apply(t,arguments)}}),r.on("keydown"+i,function(e){t.isCmdDown=e[IS_MAC?"metaKey":"ctrlKey"],t.isCtrlDown=e[IS_MAC?"altKey":"ctrlKey"],t.isShiftDown=e.shiftKey}),r.on("keyup"+i,function(e){e.keyCode===KEY_CTRL&&(t.isCtrlDown=!1),e.keyCode===KEY_SHIFT&&(t.isShiftDown=!1),e.keyCode===KEY_CMD&&(t.isCmdDown=!1)}),r.on("mousedown"+i,function(e){if(t.isFocused){if(e.target===t.$dropdown[0]||e.target.parentNode===t.$dropdown[0])return!1;t.$control.has(e.target).length||e.target===t.$control[0]||t.blur(e.target)}}),o.on(["scroll"+i,"resize"+i].join(" "),function(){t.isOpen&&t.positionDropdown.apply(t,arguments)}),o.on("mousemove"+i,function(){t.ignoreHover=!1}),this.revertSettings={$children:s.children().detach(),tabindex:s.attr("tabindex")},s.attr("tabindex",-1).hide().after(t.$wrapper),$.isArray(n.items)&&(t.setValue(n.items),delete n.items),SUPPORTS_VALIDITY_API&&s.on("invalid"+i,function(e){e.preventDefault(),t.isInvalid=!0,t.refreshState()}),t.updateOriginalInput(),t.refreshItems(),t.refreshState(),t.updatePlaceholder(),t.isSetup=!0,s.is(":disabled")&&t.disable(),t.on("change",this.onChange),s.data("selectize",t),s.addClass("selectized"),t.trigger("initialize"),!0===n.preload&&t.onSearchChange("")},setupTemplates:function(){var n=this.settings.labelField,i=this.settings.optgroupLabelField;this.settings.render=$.extend({},{optgroup:function(e){return'
    '+e.html+"
    "},optgroup_header:function(e,t){return'
    '+t(e[i])+"
    "},option:function(e,t){return'
    '+t(e[n])+"
    "},item:function(e,t){return'
    '+t(e[n])+"
    "},option_create:function(e,t){return'
    Add '+t(e.input)+"
    "}},this.settings.render)},setupCallbacks:function(){var e,t,n={initialize:"onInitialize",change:"onChange",item_add:"onItemAdd",item_remove:"onItemRemove",clear:"onClear",option_add:"onOptionAdd",option_remove:"onOptionRemove",option_clear:"onOptionClear",optgroup_add:"onOptionGroupAdd",optgroup_remove:"onOptionGroupRemove",optgroup_clear:"onOptionGroupClear",dropdown_open:"onDropdownOpen",dropdown_close:"onDropdownClose",type:"onType",load:"onLoad",focus:"onFocus",blur:"onBlur"};for(e in n)n.hasOwnProperty(e)&&(t=this.settings[n[e]])&&this.on(e,t)},onClick:function(e){this.isFocused&&this.isOpen||(this.focus(),e.preventDefault())},onMouseDown:function(e){var t=this,n=e.isDefaultPrevented();if($(e.target),t.isFocused){if(e.target!==t.$control_input[0])return"single"===t.settings.mode?t.isOpen?t.close():t.open():n||t.setActiveItem(null),!1}else n||window.setTimeout(function(){t.focus()},0)},onChange:function(){this.$input.trigger("change")},onPaste:function(e){var o=this;o.isFull()||o.isInputHidden||o.isLocked?e.preventDefault():o.settings.splitOn&&setTimeout(function(){var e=o.$control_input.val();if(e.match(o.settings.splitOn))for(var t=$.trim(e).split(o.settings.splitOn),n=0,i=t.length;n=this.settings.maxItems},updateOriginalInput:function(e){var t,n,i,o,r=this;if(e=e||{},r.tagType===TAG_SELECT){for(i=[],t=0,n=r.items.length;t'+escape_html(o)+"");i.length||this.$input.attr("multiple")||i.push(''),r.$input.html(i.join(""))}else r.$input.val(r.getValue()),r.$input.attr("value",r.$input.val());r.isSetup&&!e.silent&&r.trigger("change",r.$input.val())},updatePlaceholder:function(){var e;this.settings.placeholder&&(e=this.$control_input,this.items.length?e.removeAttr("placeholder"):e.attr("placeholder",this.settings.placeholder),e.triggerHandler("update",{force:!0}))},open:function(){var e=this;e.isLocked||e.isOpen||"multi"===e.settings.mode&&e.isFull()||(e.focus(),e.isOpen=!0,e.refreshState(),e.$dropdown.css({visibility:"hidden",display:"block"}),e.positionDropdown(),e.$dropdown.css({visibility:"visible"}),e.trigger("dropdown_open",e.$dropdown))},close:function(){var e=this,t=e.isOpen;"single"===e.settings.mode&&e.items.length&&(e.hideInput(),e.isBlurring||e.$control_input.blur()),e.isOpen=!1,e.$dropdown.hide(),e.setActiveOption(null),e.refreshState(),t&&e.trigger("dropdown_close",e.$dropdown)},positionDropdown:function(){var e=this.$control,t="body"===this.settings.dropdownParent?e.offset():e.position();t.top+=e.outerHeight(!0),this.$dropdown.css({width:e[0].getBoundingClientRect().width,top:t.top,left:t.left})},clear:function(e){var t=this;t.items.length&&(t.$control.children(":not(input)").remove(),t.items=[],t.lastQuery=null,t.setCaret(0),t.setActiveItem(null),t.updatePlaceholder(),t.updateOriginalInput({silent:e}),t.refreshState(),t.showInput(),t.trigger("clear"))},insertAtCaret:function(e){var t=Math.min(this.caretPos,this.items.length),n=e[0],e=this.buffer||this.$control[0];0===t?e.insertBefore(n,e.firstChild):e.insertBefore(n,e.childNodes[t]),this.setCaret(t+1)},deleteSelection:function(e){var t,n,i,o,r,s=this,a=e&&e.keyCode===KEY_BACKSPACE?-1:1,l=getSelection(s.$control_input[0]);if(s.$activeOption&&!s.settings.hideSelected&&(o=s.getAdjacentOption(s.$activeOption,-1).attr("data-value")),i=[],s.$activeItems.length){for(r=s.$control.children(".active:"+(0=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 o=n.children[i],r=o.chunkSize();if(t=e.first&&tn?H(n,F(e,n).text.length):(e=F(e,(n=t).line).text.length,null==(t=n.ch)||e=t:s.to>t),(i=i||[]).push(new me(a,s.from,r?null:s.to)))}return i}(n,i,r),a=function(e,t,n){var i;if(e)for(var o=0;o=t:s.to>t)&&(s.from!=t||"bookmark"!=a.type||n&&!s.marker.insertLeft)||(r=null==s.from||(a.inclusiveLeft?s.from<=t:s.frome.lastLine())return t;var n,i=F(e,t);if(!Le(e,i))return t;for(;n=Te(i);)i=n.find(1,!0).line;return x(i)+1}function Le(e,t){var n=xr&&t.markedSpans;if(n)for(var i,o=0;on.maxLineLength&&(n.maxLineLength=t,n.maxLine=e)})}function $e(e,t,n){var i;wr=null;for(var o=0;ot)return o;r.to==t&&(r.from!=r.to&&"before"==n?i=o:wr=o),r.from==t&&(r.from!=r.to&&"before"!=n?i=o:wr=o)}return null!=i?i:wr}function Ie(e,t){var n=e.order;return n=null==n?e.order=Cr(e.text,t):n}function je(e,t,n){t=P(e.text,t+n,n);return t<0||t>e.text.length?null:t}function Fe(e,t,n){e=je(e,t.ch,n);return null==e?null:new H(t.line,e,n<0?"after":"before")}function He(e,t,n,i,o){if(e){var r,s,a,l,e=Ie(n,t.doc.direction);if(e)return r=o<0==(1==(e=o<0?j(e):e[0]).level)?"after":"before",0=n.text.length?(a.ch=n.text.length,a.sticky="before"):a.ch<=0&&(a.ch=0,a.sticky="after");var i=$e(l,a.ch,a.sticky),o=l[i];if("ltr"==t.doc.direction&&o.level%2==0&&(0a.ch:o.from=o.from&&h>=c.begin))return new H(a.line,h,d?"before":"after")}function f(e,t,n){for(var i=function(e,t){return t?new H(a.line,u(e,1),"before"):new H(a.line,e,"after")};0<=e&&ee.options.maxHighlightLength?Je(e.doc.mode,i):i),t.stateAfter=i,t.styles=o.styles,o.classes?t.styleClasses=o.classes:t.styleClasses&&(t.styleClasses=null),n===e.doc.frontier&&e.doc.frontier++),t.styles}function ot(n,i,e){var o,r,s=n.doc,a=n.display;return!s.mode.startState||(o=function(e,t,n){for(var i,o,r=e.doc,s=n?-1:t-(e.doc.mode.innerMode?1e3:100),a=t;ss.first&&F(s,o-1).stateAfter)?Je(s.mode,r):tt(s.mode),s.iter(o,i,function(e){rt(n,e.text,r);var t=o==i-1||o%5==0||o>=a.viewFrom&&ot.start)return r}throw new Error("Mode "+e.name+" failed to advance stream.")}function lt(e,t,n,i){function o(e){return{start:d.start,end:d.pos,string:d.current(),type:r||null,state:e?Je(s.mode,c):c}}var r,s=e.doc,a=s.mode;t=R(s,t);var l,u=F(s,t.line),c=ot(e,t.line,n),d=new m(u.text,e.options.tabSize);for(i&&(l=[]);(i||d.pose.options.maxHighlightLength?(a=!1,s&&rt(e,t,i,c.pos),c.pos=t.length,null):ut(at(n,c,i,d),r);if(d&&(h=d[0].name)&&(f="m-"+(f?h+" "+f:h)),!a||u!=f){for(;la&&u.from<=a);c++);if(u.to>=l)return d(e,t,n,i,o,r,s);d(e,t.slice(0,u.to-a),n,i,null,r,s),i=null,t=t.slice(u.to-a),a=u.to}}}(i.addToken,u)),i.map=[],function(e,t,n){var i=e.markedSpans,o=e.text,r=0;if(i)for(var s,a,l,u,c,d,h,f=o.length,p=0,m=1,g="",v=0;;){if(v==p){l=u=c=d=a="",h=null,v=1/0;for(var y=[],b=void 0,_=0;_p||w.collapsed&&x.to==p&&x.from==p)?(null!=x.to&&x.to!=p&&v>x.to&&(v=x.to,u=""),w.className&&(l+=" "+w.className),w.css&&(a=(a?a+";":"")+w.css),w.startStyle&&x.from==p&&(c+=" "+w.startStyle),w.endStyle&&x.to==v&&(b=b||[]).push(w.endStyle,x.to),w.title&&!d&&(d=w.title),w.collapsed&&(!h||Ce(h.marker,w)<0)&&(h=x)):x.from>p&&v>x.from&&(v=x.from)}if(b)for(var C=0;Cn)return{map:e.measure.maps[o],cache:e.measure.caches[o],before:!0}}function $t(e,t,n,i){return Ft(e,jt(e,t),n,i)}function It(e,t){return t>=e.display.viewFrom&&t=e.lineN&&tt)&&(o=(r=l-a)-1,l<=t)&&(s="right"),null!=o){if(i=e[u+2],a==l&&n==(i.insertLeft?"left":"right")&&(s=n),"left"==n&&0==o)for(;u&&e[u-2]==e[u-3]&&e[u-1].insertLeft;)i=e[2+(u-=3)],s="left";if("right"==n&&o==l-a)for(;u=o.text.length?(d=o.text.length,e="before"):d<=0&&(d=0,e="after"),c?(u=$e(c,d,e),l=wr,u=t(d,u,"before"==e),null!=l&&(u.other=t(d,l,"before"!=e)),u):a("before"==e?d-1:d,"before"==e)}function Kt(e,t){var n=0,t=(t=R(e.doc,t),e.options.lineWrapping||(n=en(e.display)*t.ch),F(e.doc,t.line)),e=Ae(t)+Et(e.display);return{left:n,right:n,top:e,bottom:e+t.height}}function Qt(e,t,n,i,o){e=H(e,t,n);return e.xRel=o,i&&(e.outside=!0),e}function Xt(e,t,n){var i=e.doc;if((n+=e.display.viewOffset)<0)return Qt(i.first,0,null,!0,-1);var o=se(i,n),r=i.first+i.size-1;if(rMath.abs(u)){if(f<0==u<0)throw new Error("Broke out of infinite loop in coordsCharInner");t=c}}else{d=$(function(e){var t=zt(n,i,Ft(n,l,e),"line");return t.top>r?(a=Math.min(e,a),1):!(t.bottom<=r)&&(t.left>o||!(t.righte.right?1:0,t}(e,s,o,t,n),l=Te(s),u=l&&l.find(0,!0);if(!l||!(a.ch>u.from.ch||a.ch==u.from.ch&&0o},s,e)}}function Jt(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==Rr){Rr=T("pre");for(var t=0;t<49;++t)Rr.appendChild(document.createTextNode("x")),Rr.appendChild(T("br"));Rr.appendChild(document.createTextNode("x"))}v(e.measure,Rr);var n=Rr.offsetHeight/50;return 3=e.display.viewTo)return null;if((t-=e.display.viewFrom)<0)return null;for(var n=e.display.view,i=0;i=e.display.viewTo||n.to().linet||t==n&&s.to==t)&&(i(Math.max(s.from,t),Math.min(s.to,n),1==s.level?"rtl":"ltr"),o=!0)}o||i(t,n,"ltr")}(Ie(i,r.direction),a||0,null==l?h:l,function(e,t,n){var i,o,r,s=u(e,"left");e==t?i=o=(r=s).left:(r=u(t-1,"right"),"rtl"==n&&(n=s,s=r,r=n),i=s.left,o=r.right),null==a&&0==e&&(i=p),3d.bottom||r.bottom==d.bottom&&r.right>d.right)&&(d=r),f(i=i=r&&(o=se(t,Ae(F(t,n))-e.wrapper.clientHeight),r=n)),{from:o,to:Math.max(r,o+1)}}function bn(e){var t=e.display,n=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var i=nn(t)-t.scroller.scrollLeft+e.doc.scrollLeft,o=t.gutters.offsetWidth,r=i+"px",s=0;sr&&(t.bottom=t.top+r),e.doc.height+Mt(n)),l=t.topa-i,i=(t.topo+r&&(l=Math.min(t.top,(i?a:t.bottom)-r))!=o&&(s.scrollTop=l),(e.curOp&&null!=e.curOp.scrollLeft?e.curOp:n.scroller).scrollLeft),a=At(e)-(e.options.fixedGutter?n.gutters.offsetWidth:0),r=t.right-t.left>a;return r&&(t.right=t.left+a),t.left<10?s.scrollLeft=0:t.lefta+i-3&&(s.scrollLeft=t.right+(r?0:10)-a),s}function wn(e,t){null!=t&&(Sn(e),e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc:e.curOp).scrollTop+t)}function Cn(e){Sn(e);var t=e.getCursor(),n=t,i=t;e.options.lineWrapping||(n=t.ch?H(t.line,t.ch-1):t,i=H(t.line,t.ch+1)),e.curOp.scrollToPos={from:n,to:i,margin:e.options.cursorScrollMargin}}function kn(e,t,n){null==t&&null==n||Sn(e),null!=t&&(e.curOp.scrollLeft=t),null!=n&&(e.curOp.scrollTop=n)}function Sn(e){var t=e.curOp.scrollToPos;t&&(e.curOp.scrollToPos=null,Tn(e,Kt(e,t.from),Kt(e,t.to),t.margin))}function Tn(e,t,n,i){t=xn(e,{left:Math.min(t.left,n.left),top:Math.min(t.top,n.top)-i,right:Math.max(t.right,n.right),bottom:Math.max(t.bottom,n.bottom)+i});kn(e,t.scrollLeft,t.scrollTop)}function Dn(e,t){Math.abs(e.doc.scrollTop-t)<2||(Wo||qn(e,{top:t}),En(e,t,!0),Wo&&qn(e),Wn(e,100))}function En(e,t,n){t=Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t),e.display.scroller.scrollTop==t&&!n||(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop==t)||(e.display.scroller.scrollTop=t)}function Mn(e,t,n,i){t=Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth),(n?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!i||(e.doc.scrollLeft=t,bn(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function On(e){var t=e.display,n=t.gutters.offsetWidth,i=Math.round(e.doc.height+Mt(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+Lt(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}function Ln(e,t){t=t||On(e);var n=e.display.barWidth,i=e.display.barHeight;An(e,t);for(var o=0;o<4&&n!=e.display.barWidth||i!=e.display.barHeight;o++)n!=e.display.barWidth&&e.options.lineWrapping&&gn(e),An(e,On(e)),n=e.display.barWidth,i=e.display.barHeight}function An(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 Nn(n){n.display.scrollbars&&(n.display.scrollbars.clear(),n.display.scrollbars.addClass)&&ur(n.display.wrapper,n.display.scrollbars.addClass),n.display.scrollbars=new Ur[n.options.scrollbarStyle](function(e){n.display.wrapper.insertBefore(e,n.display.scrollbarFiller),Q(e,"mousedown",function(){n.state.focused&&setTimeout(function(){return n.display.input.focus()},0)}),e.setAttribute("cm-not-content","true")},function(e,t){("horizontal"==t?Mn:Dn)(n,e)},n),n.display.scrollbars.addClass&&l(n.display.wrapper,n.display.scrollbars.addClass)}function Pn(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:++Gr},e=e.curOp,qr?qr.ops.push(e):e.ownsGroup=qr={ops:[e],delayedCallbacks:[]}}function $n(e){var e=e.curOp,t=function(e){for(var t=0;t=s.viewTo)||s.maxLineChanged&&r.options.lineWrapping,o.update=o.mustUpdate&&new Kr(r,o.mustUpdate&&{top:o.scrollTop,ensure:o.scrollToPos},o.forceUpdate)}for(var a=0;a(window.innerHeight||document.documentElement.clientHeight)&&(i=!1),null==i)||Uo||(o=T("div","​",null,"position: absolute;\n top: "+(t.top-n.viewOffset-Et(e.display))+"px;\n height: "+(t.bottom-t.top+Lt(e)+n.barHeight)+"px;\n left: "+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;"),e.display.lineSpace.appendChild(o),o.scrollIntoView(i),e.display.lineSpace.removeChild(o))}(b,function(e,t,n,i){null==i&&(i=0);for(var o,r=0;r<5;r++){var s=!1,a=Gt(e,t),l=n&&n!=t?Gt(e,n):a,a=xn(e,o={left:Math.min(a.left,l.left),top:Math.min(a.top,l.top)-i,right:Math.max(a.left,l.left),bottom:Math.max(a.bottom,l.bottom)+i}),l=e.doc.scrollTop,u=e.doc.scrollLeft;if(null!=a.scrollTop&&(Dn(e,a.scrollTop),1t)&&(r.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=r.viewTo?xr&&Me(e.doc,t)r.viewFrom?jn(e):(r.viewFrom+=i,r.viewTo+=i):t<=r.viewFrom&&n>=r.viewTo?jn(e):t<=r.viewFrom?(s=Fn(e,n,n+i,1))?(r.view=r.view.slice(s.index),r.viewFrom=s.lineN,r.viewTo+=i):jn(e):n>=r.viewTo?(s=Fn(e,t,t,-1))?(r.view=r.view.slice(0,s.index),r.viewTo=s.lineN):jn(e):(s=Fn(e,t,t,-1),o=Fn(e,n,n+i,1),s&&o?(r.view=r.view.slice(0,s.index).concat(vt(e,s.lineN,o.lineN)).concat(r.view.slice(o.index)),r.viewTo+=i):jn(e)),r.externalMeasured);s&&(n=o.lineN&&t=i.viewTo||null!=(o=i.view[an(e,t)]).node&&-1==_(i=o.changes||(o.changes=[]),n)&&i.push(n)}function jn(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Fn(e,t,n,i){var o,r=an(e,t),s=e.display.view;if(xr&&n!=e.doc.first+e.doc.size){for(var a=e.display.viewFrom,l=0;l=a.display.viewTo||(l=+new Date+a.options.workTime,u=Je(d.mode,ot(a,d.frontier)),c=[],d.iter(d.frontier,Math.min(d.first+d.size,a.display.viewTo+500),function(e){if(d.frontier>=a.display.viewFrom){var t=e.styles,n=e.text.length>a.options.maxHighlightLength,i=nt(a,e,n?Je(d.mode,u):u,!0),o=(e.styles=i.styles,e.styleClasses),i=i.classes;i?e.styleClasses=i:o&&(e.styleClasses=null);for(var r=!t||t.length!=e.styles.length||o!=i&&(!o||!i||o.bgClass!=i.bgClass||o.textClass!=i.textClass),s=0;!r&&sl)return Wn(a,a.options.workDelay),!0}),c.length&&h(a,function(){for(var e=0;e=n.viewFrom&&t.visible.to<=n.viewTo&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&0==Hn(e))){_n(e)&&(jn(e),t.dims=tn(e));var o=i.first+i.size,r=Math.max(t.visible.from-e.options.viewportMargin,i.first),s=Math.min(o,t.visible.to+e.options.viewportMargin),i=(n.viewFroms&&n.viewTo-s<20&&(s=Math.min(o,n.viewTo)),xr&&(r=Me(e.doc,r),s=Oe(e.doc,s)),r!=n.viewFrom||s!=n.viewTo||n.lastWrapHeight!=t.wrapperHeight||n.lastWrapWidth!=t.wrapperWidth),o=(o=r,r=s,0==(a=(s=e).display).view.length||o>=a.viewTo||r<=a.viewFrom?(a.view=vt(s,o,r),a.viewFrom=o):(a.viewFrom>o?a.view=vt(s,o,a.viewFrom).concat(a.view):a.viewFromr&&(a.view=a.view.slice(0,an(s,r)))),a.viewTo=r,n.viewOffset=Ae(F(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+"px",Hn(e));if(i||0!=o||t.force||n.renderedView!=n.view||!(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo)){var a,s=!(s=e).hasFocus()&&(a=J())&&k(s.display.lineDiv,a)?(a={activeElt:a},window.getSelection&&(r=window.getSelection()).anchorNode&&r.extend&&k(s.display.lineDiv,r.anchorNode)&&(a.anchorNode=r.anchorNode,a.anchorOffset=r.anchorOffset,a.focusNode=r.focusNode,a.focusOffset=r.focusOffset),a):null,l=(4=e.display.viewFrom&&t.visible.to<=e.display.viewTo)))&&Yn(e,t);i=!1){gn(e);var o=On(e);ln(e),Ln(e,o),Vn(e,o)}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 qn(e,t){var n,t=new Kr(e,t);Yn(e,t)&&(gn(e),Bn(e,t),n=On(e),ln(e),Ln(e,n),Vn(e,n),t.finish())}function zn(e){var t=e.display.gutters.offsetWidth;e.display.sizer.style.marginLeft=t+"px"}function Vn(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+Lt(e)+"px"}function Un(e){var t=e.display.gutters,n=e.options.gutters;w(t);for(var i=0;ia.clientWidth,u=a.scrollHeight>a.clientHeight;if(r&&l||o&&u){if(o&&Xo&&K)e:for(var c=t.target,d=s.view;c!=a;c=c.parentNode)for(var h=0;ha-e.cm.options.historyEventDelay||"*"==t.origin.charAt(0)))&&(s=(s=o).lastOp==i?(fi(s.done),j(s.done)):s.done.length&&!j(s.done).ranges?j(s.done):1o.undoDepth;)o.done.shift(),o.done[0].ranges||o.done.shift()}o.done.push(n),o.generation=++o.maxGeneration,o.lastModTime=o.lastSelTime=a,o.lastOp=o.lastSelOp=i,o.lastOrigin=o.lastSelOrigin=t.origin,r||D(e,"historyAdded")}function mi(e,t,n,i){var o,r,s,a=e.history,l=i&&i.origin;n==a.lastSelOp||l&&a.lastSelOrigin==l&&(a.lastModTime==a.lastSelTime&&a.lastOrigin==l||(e=e,o=l,r=j(a.done),s=t,"*"==(o=o.charAt(0)))||"+"==o&&r.ranges.length==s.ranges.length&&r.somethingSelected()==s.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500))?a.done[a.done.length-1]=t:gi(t,a.done),a.lastSelTime=+new Date,a.lastSelOrigin=l,a.lastSelOp=n,i&&!1!==i.clearRedo&&fi(a.undone)}function gi(e,t){var n=j(t);n&&n.ranges&&n.equals(e)||t.push(e)}function vi(t,n,e,i){var o=n["spans_"+t.id],r=0;t.iter(Math.max(t.first,e),Math.min(t.first+t.size,i),function(e){e.markedSpans&&((o=o||(n["spans_"+t.id]={}))[r]=e.markedSpans),++r})}function yi(e,t){var n=t["spans_"+e.id];if(!n)return null;for(var i=[],o=0;o=t.ch:a.to>t.ch))){if(o&&(D(l,"beforeCursorEnter"),l.explicitlyCleared)){if(r.markedSpans){--s;continue}break}if(l.atomic){if(n){var a=l.find(i<0?1:-1),u=void 0;if((a=(i<0?l.inclusiveRight:l.inclusiveLeft)?Ni(e,a,-i,a&&a.line==t.line?r:null):a)&&a.line==t.line&&(u=W(a,n))&&(i<0?u<0:0e.first?R(e,H(t.line-1)):null:0e.lastLine())){t.from.lineo?{from:t.from,to:H(o,F(e,o).text.length),text:[t.text[0]],origin:t.origin}:t).removed=ie(e,t.from,t.to),n=n||ni(e,t),e.cm){o=e.cm;var r=t;var s=i;var a=o.doc,l=o.display,u=r.from,c=r.to,d=!1,h=u.line,s=(o.options.lineWrapping||(h=x(Ee(F(a,u.line))),a.iter(h,c.line+1,function(e){if(e==l.maxLine)return d=!0})),-1l.maxLineLength&&(l.maxLine=e,l.maxLineLength=t,l.maxLineChanged=!0,d=!1)}),d&&(o.curOp.updateMaxLine=!0)),a.frontier=Math.min(a.frontier,u.line),Wn(o,400),r.text.length-(c.line-u.line)-1),h=(r.full?b(o):u.line!=c.line||1!=r.text.length||si(o.doc,r)?b(o,u.line,c.line+1,s):In(o,u.line,"text"),Be(o,"changes")),a=Be(o,"change");(a||h)&&(s={from:u,to:c,text:r.text,removed:r.removed,origin:r.origin},a&&y(o,"change",o,s),h)&&(o.curOp.changeObjs||(o.curOp.changeObjs=[])).push(s);o.display.selForContextMenu=null}else ai(e,t,i);Di(e,n,pr)}}function Ri(e,t,n,i,o){var r;W(i=i||n,n)<0&&(r=i,i=n,n=r),"string"==typeof t&&(t=e.splitLines(t)),Ii(e,{from:n,to:i,text:t,origin:o})}function Yi(e,t,n,i){nb-400&&0==W(ls.pos,n)?i="triple":as&&as.time>b-400&&0==W(as.pos,n)?(i="double",ls={time:b,pos:n}):(i="single",as={time:b,pos:n}),b=O.doc.sel,o=Xo?t.metaKey:t.ctrlKey;if(O.options.dragDrop&&Sr&&!O.isReadOnly()&&"single"==i&&-1<(w=b.contains(n))&&(W((w=b.ranges[w]).from(),n)<0||0f&&o.push(new Z(H(c,f),H(c,te(h,u,r))))}o.length||o.push(new Z(_,_)),V(T,Zn(M.ranges.slice(0,E).concat(o),E),{origin:"*mouse",scroll:!1}),y.scrollIntoView(i)}else{var s=D,a=s.anchor,p=i,s=("single"!=x&&(a=0=i.to||n.lineA.bottom?20:0;m&&setTimeout(z(y,function(){N==t&&(S.scroller.scrollTop+=m,C(e))}),50)}}function k(e){y.state.selectingText=!1,N=1/0,q(e),S.input.focus(),Y(document,"mousemove",P),Y(document,"mouseup",$),T.history.lastSelOrigin=null}var S=y.display,T=y.doc;q(b);var D,E,M=T.sel,O=M.ranges;w&&!b.shiftKey?(E=T.sel.contains(_),D=-1=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;i&&q(t);var s=e.display,i=s.lineDiv.getBoundingClientRect();if(r>i.bottom||!Be(e,n))return Ve(t);r-=i.top-s.viewOffset;for(var a=0;a=o)return D(e,n,e,se(e.doc,r),e.options.gutters[a],t),Ve(t)}}function bo(e,t){return yo(e,t,"gutterClick",!0)}function _o(e,t){var n,i;Dt(e.display,t)||(i=t,Be(n=e,"gutterContextMenu")&&yo(n,i,"gutterContextMenu",!1))||B(e,t,"contextmenu")||e.display.input.onContextMenu(t)}function xo(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),Yt(e)}function wo(e){Un(e),b(e),bn(e)}function Co(e,t,n){!t!=!(n&&n!=vs)&&(n=e.display.dragFunctions,(t=t?Q:Y)(e.display.scroller,"dragstart",n.start),t(e.display.scroller,"dragenter",n.enter),t(e.display.scroller,"dragover",n.over),t(e.display.scroller,"dragleave",n.leave),t(e.display.scroller,"drop",n.drop))}function ko(e){e.options.lineWrapping?(l(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(ur(e.display.wrapper,"CodeMirror-wrap"),Pe(e)),rn(e),b(e),Yt(e),setTimeout(function(){return Ln(e)},100)}function f(e,t){var n=this;if(!(this instanceof f))return new f(e,t);this.options=t=t?S(t):{},S(ys,t,!1),Gn(t);var i,o,r,s,a,l=t.value,u=("string"==typeof l&&(l=new p(l,t.mode,null,t.lineSeparator,t.direction)),this.doc=l,new f.inputStyles[t.inputStyle](this)),e=this.display=new ne(e,l,u);function c(){o.activeTouch&&(r=setTimeout(function(){return o.activeTouch=null},1e3),(s=o.activeTouch).end=+new Date)}function d(e,t){var n;return null==t.left||400<(n=t.left-e.left)*n+(n=t.top-e.top)*n}for(a in Un(e.wrapper.CodeMirror=this),xo(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Nn(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 Jo,keySeq:null,specialChars:null},t.autofocus&&!Qo&&e.input.focus(),U&&G<11&&setTimeout(function(){return n.display.input.reset(!0)},20),o=(i=this).display,Q(o.scroller,"mousedown",z(i,vo)),Q(o.scroller,"dblclick",U&&G<11?z(i,function(e){var t;B(i,e)||!(t=sn(i,e))||bo(i,e)||Dt(i.display,e)||(q(e),e=i.findWordAt(t),wi(i.doc,e.anchor,e.head))}):function(e){return B(i,e)||q(e)}),lr||Q(o.scroller,"contextmenu",function(e){return _o(i,e)}),s={end:0},Q(o.scroller,"touchstart",function(e){var t;B(i,e)||function(e){if(1==e.touches.length)return(e=e.touches[0]).radiusX<=1&&e.radiusY<=1}(e)||(o.input.ensurePolled(),clearTimeout(r),t=+new Date,o.activeTouch={start:t,moved:!1,prev:t-s.end<=300?s:null},1==e.touches.length&&(o.activeTouch.left=e.touches[0].pageX,o.activeTouch.top=e.touches[0].pageY))}),Q(o.scroller,"touchmove",function(){o.activeTouch&&(o.activeTouch.moved=!0)}),Q(o.scroller,"touchend",function(e){var t,n=o.activeTouch;n&&!Dt(o,e)&&null!=n.left&&!n.moved&&new Date-n.start<300&&(t=i.coordsChar(o.activeTouch,"page"),n=!n.prev||d(n,n.prev)?new Z(t,t):!n.prev.prev||d(n,n.prev.prev)?i.findWordAt(t):new Z(H(t.line,0),R(i.doc,H(t.line+1,0))),i.setSelection(n.anchor,n.head),i.focus(),q(e)),c()}),Q(o.scroller,"touchcancel",c),Q(o.scroller,"scroll",function(){o.scroller.clientHeight&&(Dn(i,o.scroller.scrollTop),Mn(i,o.scroller.scrollLeft,!0),D(i,"scroll",i))}),Q(o.scroller,"mousewheel",function(e){return Xn(i,e)}),Q(o.scroller,"DOMMouseScroll",function(e){return Xn(i,e)}),Q(o.wrapper,"scroll",function(){return o.wrapper.scrollTop=o.wrapper.scrollLeft=0}),o.dragFunctions={enter:function(e){B(i,e)||Ue(e)},over:function(e){var t,n;B(i,e)||((n=sn(t=i,n=e))&&(cn(t,n,n=document.createDocumentFragment()),t.display.dragCursor||(t.display.dragCursor=T("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),t.display.lineSpace.insertBefore(t.display.dragCursor,t.display.cursorDiv)),v(t.display.dragCursor,n)),Ue(e))},start:function(e){var t,n;t=i,e=e,U&&(!t.state.draggingText||+new Date-es<100)?Ue(e):B(t,e)||Dt(t.display,e)||(e.dataTransfer.setData("Text",t.getSelection()),e.dataTransfer.effectAllowed="copyMove",!e.dataTransfer.setDragImage)||zo||((n=T("img",null,null,"position: fixed; left: 0; top: 0;")).src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",qo&&(n.width=n.height=1,t.display.wrapper.appendChild(n),n._top=n.offsetTop),e.dataTransfer.setDragImage(n,0,0),qo&&n.parentNode.removeChild(n))},drop:z(i,Ki),leave:function(e){B(i,e)||Qi(i)}},u=o.input.getField(),Q(u,"keyup",function(e){return mo.call(i,e)}),Q(u,"keydown",z(i,po)),Q(u,"keypress",z(i,go)),Q(u,"focus",function(e){return pn(i,e)}),Q(u,"blur",function(e){return mn(i,e)}),Zi(),Pn(this),this.curOp.forceUpdate=!0,ui(this,l),t.autofocus&&!Qo||this.hasFocus()?setTimeout(ee(pn,this),20):mn(this),bs)bs.hasOwnProperty(a)&&bs[a](n,t[a],vs);_n(this),t.finishInit&&t.finishInit(this);for(var h=0;h<_s.length;++h)_s[h](n);$n(this),K&&t.lineWrapping&&"optimizelegibility"==getComputedStyle(e.lineDiv).textRendering&&(e.lineDiv.style.textRendering="auto")}function So(e,t,n,i){var o,r=e.doc,s=("smart"==(n=null==n?"add":n)&&(r.mode.indent?o=ot(e,t):n="prev"),e.options.tabSize),a=F(r,t),l=I(a.text,null,s);a.stateAfter&&(a.stateAfter=null);var u=a.text.match(/^\s*/)[0];if(i||/\S/.test(a.text)){if("smart"==n&&((c=r.mode.indent(o,a.text.slice(u.length),a.text))==fr||150r.first?I(F(r,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);var c=Math.max(0,c),d="",h=0;if(e.options.indentWithTabs)for(var f=Math.floor(c/s);f;--f)h+=s,d+="\t";if(h=n.first+n.size||(i=new H(e,i.ch,i.sticky),!(l=F(n,e))))return;i=He(r,n.cm,l,i.line,o)}else i=t;return 1}var s=i,a=o,l=F(n,i.line);if("char"==e)t();else if("column"==e)t(!0);else if("word"==e||"group"==e)for(var u=null,c="group"==e,d=n.cm&&n.cm.getHelper(i,"wordChars"),h=!0;!(o<0)||t(!h);h=!1){var f=l.text.charAt(i.ch)||"\n",f=L(f,d)?"w":c&&"\n"==f?"n":!c||/\s/.test(f)?null:"p";if(c&&!h&&(f=f||"s"),u&&u!=f){o<0&&(o=1,t(),i.sticky="after");break}if(f&&(u=f),0=a.height){s.hitSide=!0;break}r+=5*n}return s}function $o(e,t){var n,i,o=It(e,t.line);return!o||o.hidden?null:(n=Pt(o,o=F(e.doc,t.line),t.line),i="left",(o=Ie(o,e.doc.direction))&&(i=$e(o,t.ch)%2?"right":"left"),(e=Ht(n.map,t.ch,i)).offset="right"==e.collapse?e.end:e.start,e)}function Io(e,t){return t&&(e.bad=!0),e}function jo(r,e,t,s,a){function l(){c&&(n+=d,c=!1)}function u(e){e&&(l(),n+=e)}for(var n="",c=!1,d=r.doc.lineSeparator();function e(t){if(1==t.nodeType){var n=t.getAttribute("cm-text");if(null!=n)return u(n||t.textContent.replace(/\u200b/g,""));if(n=t.getAttribute("cm-marker"))return(n=r.findMarks(H(s,0),H(a+1,0),(o=+n,function(e){return e.id==o}))).length&&(n=n[0].find())&&u(ie(r.doc,n.from,n.to).join(d));if("false"!=t.getAttribute("contenteditable")){(n=/^(pre|div|p)$/i.test(t.nodeName))&&l();for(var i=0;i=this.string.length},m.prototype.sol=function(){return this.pos==this.lineStart},m.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},m.prototype.next=function(){if(this.post},m.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},m.prototype.skipToEnd=function(){this.pos=this.string.length},m.prototype.skipTo=function(e){e=this.string.indexOf(e,this.pos);if(-1e.clientWidth+1,i=e.scrollHeight>e.clientHeight+1,o=e.nativeBarWidth;return i?(this.vert.style.display="block",this.vert.style.bottom=n?o+"px":"0",t=e.viewHeight-(n?o:0),this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+t)+"px"):(this.vert.style.display="",this.vert.firstChild.style.height="0"),n?(this.horiz.style.display="block",this.horiz.style.right=i?o+"px":"0",this.horiz.style.left=e.barLeft+"px",t=e.viewWidth-e.barLeft-(i?o:0),this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+t)+"px"):(this.horiz.style.display="",this.horiz.firstChild.style.width="0"),!this.checkedZeroWidth&&0t.display.maxLineLength&&(t.display.maxLine=u,t.display.maxLineLength=c,t.display.maxLineChanged=!0)}null!=i&&t&&this.collapsed&&b(t,i,o+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,t)&&Mi(t.doc),t&&y(t,"markerCleared",t,this,i,o),n&&$n(t),this.parent&&this.parent.clear()}},Wr.prototype.find=function(e,t){null==e&&"bookmark"==this.type&&(e=1);for(var n,i,o=0;o=e.ch)&&t.push(o.marker.parent||o.marker)}return t},findMarks:function(o,r,s){o=R(this,o),r=R(this,r);var a=[],l=o.line;return this.iter(o.line,r.line+1,function(e){var t=e.markedSpans;if(t)for(var n=0;n=i.to||null==i.from&&l!=o.line||null!=i.from&&l==r.line&&i.from>=r.ch||s&&!s(i.marker)||a.push(i.marker.parent||i.marker)}++l}),a},getAllMarks:function(){var i=[];return this.iter(function(e){var t=e.markedSpans;if(t)for(var n=0;nt&&(t=e.from),null!=e.to&&e.tos.doc.first&&(n=F(s.doc,e.line-1).text)&&(e=new H(e.line,1),s.replaceRange(t.charAt(0)+s.doc.lineSeparator()+n.charAt(n.length-1),H(e.line-1,n.length-1),e,"+transpose"))),o.push(new Z(e,e)));s.setSelections(o)})},newlineAndIndent:function(i){return h(i,function(){for(var e=(t=i.listSelections()).length-1;0<=e;e--)i.replaceRange(i.doc.lineSeparator(),t[e].anchor,t[e].head,"+input");for(var t=i.listSelections(),n=0;n=t.display.viewTo||n.line=t.display.viewFrom&&$o(t,i)||{node:o[0].measure.map[2],offset:0},i=n.linet.firstLine()&&(o=H(o.line-1,F(t.doc,o.line-1).length)),i.ch==F(t.doc,i.line).text.length&&i.linen.viewTo-1)return!1;var r,s=o.line==n.viewFrom||0==(s=an(t,o.line))?(e=x(n.view[0].line),n.view[0].node):(e=x(n.view[s].line),n.view[s-1].node.nextSibling),i=an(t,i.line),n=i==n.view.length-1?(r=n.viewTo-1,n.lineDiv.lastChild):(r=x(n.view[i+1].line)-1,n.view[i+1].node.previousSibling);if(!s)return!1;for(var a=t.doc.splitLines(jo(t,s,n,e,r)),l=ie(t.doc,H(e,0),H(r,F(t.doc,r).text.length));1o.ch&&p.charCodeAt(p.length-c-1)==m.charCodeAt(m.length-c-1);)u--,c++;a[a.length-1]=p.slice(0,p.length-c).replace(/^\u200b+/,""),a[0]=a[0].slice(u).replace(/\u200b+$/,"");i=H(e,u),s=H(r,l.length?j(l).length-c:0);return 1n&&(So(this,o.head.line,e,!0),n=o.head.line,i==this.doc.sel.primIndex)&&Cn(this);else{for(var r=o.from(),o=o.to(),s=Math.max(n,r.line),n=Math.min(this.lastLine(),o.line-(o.ch?0:1))+1,a=s;a>1;if((s?n[2*s-1]:0)>=r)o=s;else{if(!(n[2*s+1]s)&&e.top>t.offsetHeight?l=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=s&&(l=e.bottom),u+t.offsetWidth>r&&(u=r-t.offsetWidth)),t.style.top=l+"px",t.style.left=t.style.right="","right"==o?(u=a.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==o?u=0:"middle"==o&&(u=(a.sizer.clientWidth-t.offsetWidth)/2),t.style.left=u+"px"),n&&(i=this,s={left:u,top:l,right:u+t.offsetWidth,bottom:l+t.offsetHeight},null!=(s=xn(i,s)).scrollTop&&Dn(i,s.scrollTop),null!=s.scrollLeft)&&Mn(i,s.scrollLeft)},triggerOnKeyDown:e(po),triggerOnKeyPress:e(go),triggerOnKeyUp:mo,execCommand:function(e){if(ps.hasOwnProperty(e))return ps[e].call(null,this)},triggerElectric:e(function(e){Mo(this,e)}),findPosH:function(e,t,n,i){var o=1;t<0&&(o=-1,t=-t);for(var r=R(this.doc,e),s=0;s=t.ch+1)return/\bstring2?\b/.test(s);r.start=r.pos}}(o,f,e))return v.Pass}else if(!u||o.getLine(f.line).length!=f.ch&&!function(e,t){t=t.lastIndexOf(e);return-1"==r.charAt(1)?1:-1,n&&0r))for(c==t.line&&(h=t.ch-(n<0?1:0));h!=f;h+=n){var p=d.charAt(h);if(l.test(p)&&(void 0===i||e.getTokenTypeAt(m(c,h+1))==i))if(">"==g[p].charAt(1)==0",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<"},r=null;i.defineOption("matchBrackets",!1,function(e,t,n){n&&n!=i.Init&&(e.off("cursorActivity",o),r)&&(r(),r=null),t&&(e.state.matchBrackets="object"==typeof t?t:{},e.on("cursorActivity",o))}),i.defineExtension("matchBrackets",function(){t(this,!0)}),i.defineExtension("findMatchingBracket",function(e,t,n){return c(this,e,t,n)}),i.defineExtension("scanForBracket",function(e,t,n,i){return a(this,e,t,n,i)})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(y){"use strict";y.registerHelper("fold","brace",function(o,r){function e(e){for(var t=r.ch,n=0;;){var i=t<=0?-1:l.lastIndexOf(e,t-1);if(-1!=i){if(1==n&&ir.lastLine())return null;var t=r.getTokenAt(y.Pos(e,1));if("keyword"!=(t=/\S/.test(t.string)?t:r.getTokenAt(y.Pos(e,t.end+1))).type||"import"!=t.string)return null;for(var n=e,i=Math.min(r.lastLine(),e+10);n<=i;++n){var o=r.getLine(n).indexOf(";");if(-1!=o)return{startCh:t.end,end:y.Pos(n,o)}}}var n,e=e.line,i=t(e);if(!i||t(e-1)||(n=t(e-2))&&n.end.line==e-1)return null;for(var o=i.end;;){var s=t(o.line+1);if(null==s)break;o=s.end}return{from:r.clipPos(y.Pos(e,i.startCh+1)),to:o}}),y.registerHelper("fold","include",function(n,e){function t(e){var t;return en.lastLine()?null:(t=n.getTokenAt(y.Pos(e,1)),"meta"==(t=/\S/.test(t.string)?t:n.getTokenAt(y.Pos(e,t.end+1))).type&&"#include"==t.string.slice(0,8)?t.start+8:void 0)}var e=e.line,i=t(e);if(null==i||null!=t(e-1))return null;for(var o=e;null!=t(o+1);)++o;return{from:y.Pos(e,i+1),to:n.clipPos(y.Pos(o))}})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(_){"use strict";_.registerGlobalHelper("fold","comment",function(e){return e.blockCommentStart&&e.blockCommentEnd},function(e,t){var n=e.getModeAt(t),i=n.blockCommentStart,o=n.blockCommentEnd;if(i&&o){for(var r,s=t.line,a=e.getLine(s),l=t.ch,u=0;;){var c=l<=0?-1:a.lastIndexOf(i,l-1);if(-1!=c){if(1==u&&co.firstLine();)r=c.Pos(r.line-1,0),u=t(!1);u&&!u.cleared&&"unfold"!==s&&(n=function(e,t){e=d(e,t,"widget");"string"==typeof e&&(t=document.createTextNode(e),(e=document.createElement("span")).appendChild(t),e.className="CodeMirror-foldmarker");return e}(o,e),c.on(n,"mousedown",function(e){i.clear(),c.e_preventDefault(e)}),(i=o.markText(u.from,u.to,{replacedWith:n,clearOnEnter:d(o,e,"clearOnEnter"),__isFold:!0})).on("clear",function(e,t){c.signal(o,"unfold",o,e,t)}),c.signal(o,"fold",o,u.from,u.to))}function d(e,t,n){return(t&&void 0!==t[n]||(t=e.options.foldOptions)&&void 0!==t[n]?t:i)[n]}c.newFoldFunction=function(n,i){return function(e,t){o(e,t,{rangeFinder:n,widget:i})}},c.defineExtension("foldCode",function(e,t,n){o(this,e,t,n)}),c.defineExtension("isFolded",function(e){for(var t=this.findMarksAt(e),n=0;n=s&&(n=u(o.indicatorOpen))),i.setGutterMarker(e,o.gutter,n),++r})}function s(e){var t=e.getViewport(),n=e.state.foldGutter;n&&(e.operation(function(){r(e,t.from,t.to)}),n.from=t.from,n.to=t.to)}function a(e,t,n){var i=e.state.foldGutter;i&&n==(n=i.options).gutter&&((i=l(e,t))?i.clear():e.foldCode(f(t,0),n.rangeFinder))}function c(e){var t,n=e.state.foldGutter;n&&(t=n.options,n.from=n.to=0,clearTimeout(n.changeUpdate),n.changeUpdate=setTimeout(function(){s(e)},t.foldOnChangeTimeSpan||600))}function d(t){var e,n=t.state.foldGutter;n&&(e=n.options,clearTimeout(n.changeUpdate),n.changeUpdate=setTimeout(function(){var e=t.getViewport();n.from==n.to||20n.to&&(r(t,n.to,e.to),n.to=e.to)})},e.updateViewportTimeSpan||400))}function h(e,t){var n=e.state.foldGutter;n&&(t=t.line)>=n.from&&t=e.max)&&(e.ch=0,e.text=e.cm.getLine(++e.line),1)}function u(e){return!(e.line<=e.min)&&(e.text=e.cm.getLine(--e.line),e.ch=e.text.length,1)}function c(e){for(;;){var t,n=e.text.indexOf(">",e.ch);if(-1==n){if(i(e))continue;return}if(a(e,n+1))return t=-1<(t=e.text.lastIndexOf("/",n))&&!/\S/.test(e.text.slice(t+1,n)),e.ch=n+1,t?"selfClose":"regular";e.ch=n+1}}function d(e){for(;;){var t=e.ch?e.text.lastIndexOf("<",e.ch-1):-1;if(-1==t){if(u(e))continue;return}if(a(e,t+1)){o.lastIndex=t,e.ch=t;var n=o.exec(e.text);if(n&&n.index==t)return n}else e.ch=t}}function h(e){for(;;){o.lastIndex=e.ch;var t=o.exec(e.text);if(!t){if(i(e))continue;return}if(a(e,t.index+1))return e.ch=t.index+t[0].length,t;e.ch=t.index+1}}function f(e,t){for(var n=[];;){var i,o=h(e),r=e.line,s=e.ch-(o?o[0].length:0);if(!o||!(i=c(e)))return;if("selfClose"!=i)if(o[1]){for(var a=n.length-1;0<=a;--a)if(n[a]==o[2]){n.length=a;break}if(a<0&&(!t||t==o[2]))return{tag:o[2],from:m(r,s),to:m(e.line,e.ch)}}else n.push(o[2])}}function p(e,t){for(var n=[];;){var i=function(e){for(;;){var t,n=e.ch?e.text.lastIndexOf(">",e.ch-1):-1;if(-1==n){if(u(e))continue;return}if(a(e,n+1))return t=-1<(t=e.text.lastIndexOf("/",n))&&!/\S/.test(e.text.slice(t+1,n)),e.ch=n+1,t?"selfClose":"regular";e.ch=n}}(e);if(!i)return;if("selfClose"!=i){var i=e.line,o=e.ch,r=d(e);if(!r)return;if(r[1])n.push(r[2]);else{for(var s=n.length-1;0<=s;--s)if(n[s]==r[2]){n.length=s;break}if(s<0&&(!t||t==r[2]))return{tag:r[2],from:m(e.line,e.ch),to:m(i,o)}}}else d(e)}}var m=e.Pos,o=new RegExp("<(/?)([A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*)","g");e.registerHelper("fold","xml",function(e,t){for(var n=new l(e,t.line,0);;){var i,o,r=h(n);if(!r||n.line!=t.line||!(i=c(n)))return;if(!r[1]&&"selfClose"!=i)return o=m(n.line,n.ch),(r=f(n,r[2]))&&{from:o,to:r.from}}}),e.findMatchingTag=function(e,t,n){var i=new l(e,t.line,t.ch,n);if(-1!=i.text.indexOf(">")||-1!=i.text.indexOf("<")){var o,r=c(i),s=r&&m(i.line,i.ch),a=r&&d(i);if(r&&a&&(t=t,!(0<((o=i).line-t.line||o.ch-t.ch))))return o={from:m(i.line,i.ch),to:s,tag:a[2]},"selfClose"==r?{open:o,close:null,at:"open"}:a[1]?{open:p(i,a[2]),close:o,at:"close"}:{open:o,close:f(i=new l(e,s.line,s.ch,n),a[2]),at:"open"}}},e.findEnclosingTag=function(e,t,n,i){for(var o=new l(e,t.line,t.ch,n);;){var r=p(o,i);if(!r)break;var s=f(new l(e,t.line,t.ch,n),r.tag);if(s)return{open:r,close:s}}},e.scanForClosingTag=function(e,t,n,i){return f(new l(e,t.line,t.ch,i?{from:0,to:i}:null),n)}}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(p){"use strict";function l(e){e.parentNode&&e.parentNode.removeChild(e)}function m(e,t,n){function i(){var e;p.off(n,"mouseout",i),r&&((e=r).parentNode&&(null==e.style.opacity&&l(e),e.style.opacity=0,setTimeout(function(){l(e)},600)),r=null)}e=e,t=t,(o=document.createElement("div")).className="CodeMirror-lint-tooltip",o.appendChild(t.cloneNode(!0)),document.body.appendChild(o),p.on(document,"mousemove",a),a(e),null!=o.style.opacity&&(o.style.opacity=1);var o,r=o,s=setInterval(function(){if(r)for(var e=n;;e=e.parentNode){if((e=e&&11==e.nodeType?e.host:e)==document.body)return;if(!e){i();break}}if(!r)return clearInterval(s)},400);function a(e){if(!o.parentNode)return p.off(document,"mousemove",a);o.style.top=Math.max(0,e.clientY-o.offsetHeight-5)+"px",o.style.left=e.clientX+5+"px"}p.on(n,"mouseout",i)}function s(l,e,t){this.marked=[],this.options=e,this.timeout=null,this.hasGutter=t,this.onMouseOver=function(e){var t=l,n=e.target||e.srcElement;if(/\bCodeMirror-lint-mark-/.test(n.className)){for(var n=n.getBoundingClientRect(),i=(n.left+n.right)/2,n=(n.top+n.bottom)/2,o=t.findMarksAt(t.coordsChar({left:i,top:n},"client")),r=[],s=0;se?t.setSize(null,"auto"):t.setSize(null,e+"px")}function download_page_select(e,t){for(t=$(t);!t.hasClass("card");)t=t.parent();$('input[type="checkbox"]',t).prop("checked",e),$('input[type="checkbox"]',t).trigger("change")}function download_page_select_active(e,t){t=$(t).closest(".card").find(".tab-content .active"),$('input[type="checkbox"]',t).prop("checked",e).change()}function download_page_select_tutor(e,t,n){e=$(e).closest(".card").find(".tab-content .active"),$('input[name="audiences"]',e).each(function(){$(this).prop("checked",-1!=$.inArray($(this).val(),n))}).trigger("change"),$('input[name="users"]',e).each(function(){$(this).prop("checked",-1!=$.inArray($(this).val(),t))}).trigger("change")}function dropdown(e){var t=$(e).closest(".section").children(".content"),e=$(e).children(".dropdown_button");$(e).hasClass("fa-caret-down")?($(e).removeClass("fa-caret-down").addClass("fa-caret-left"),t.slideUp("fast")):($(e).removeClass("fa-caret-left").addClass("fa-caret-down"),t.slideDown("fast"))}function init_task_page(e){evaluatedSubmission=e;e=$("form#task");if(e.on("submit",function(){return submitTask(!1),!1}),$("form#task #task-submit-debug").on("click",function(){submitTask(!0)}),e.attr("data-wait-submission"))loadOldSubmissionInput(e.attr("data-wait-submission"),!1),waitForSubmission(e.attr("data-wait-submission"));else try{var t=new URLSearchParams(document.location.search.substring(1)).get("load");null!==t&&loadOldSubmissionInput(t,!0)}catch(e){console.error(e)}$(".submission").each(function(){$(this).on("click",clickOnSubmission)}),$(document).on("click",'[data-dismiss="card"]',function(e){e.target.closest(".card").remove()})}jQuery.fn.extend({rparent:function(e){return 1==e?$(this).parent():$(this).parent().rparent(e-1)}});var evaluatedSubmission="best",loadingSomething=!1;function blurTaskForm(){$.each(codeEditors,function(e,t){t.setOption("readOnly",!0)});var e=$("form#task");$("input, button",e).attr("disabled","disabled").addClass("form-blur"),loadingSomething=!0}function unblurTaskForm(){$.each(codeEditors,function(e,t){t.setOption("readOnly",!1)});var e=$("form#task");$("input, button",e).removeAttr("disabled").removeClass("form-blur"),loadingSomething=!1}function resetAlerts(){$("#task_alert").html(""),$(".task_alert_problem").html("")}function incrementTries(){var e=$("#task_tries");e.text(parseInt(e.text())+1)}function updateTaskStatus(e,t){var n=$("#task_status"),i=$("#task_grade");n.html(e),i.text(t)}function displayNewSubmission(e){var t=$("#submissions"),e=(t.find(".submission-empty").remove(),jQuery("
  • ",{class:"submission list-group-item list-group-item-warning","data-submission-id":e}).on("click",clickOnSubmission));jQuery('',{}).text(getDateTime()).appendTo(e),0<$("span",$("#main_tag_group")).length&&e.append('0'),t.prepend(e),$("body").tooltip({selector:'[data-toggle="tooltip"]'})}function removeSubmission(e){var t;$("#submissions").find(".submission").each(function(){$(this).attr("data-submission-id").trim()==e&&(t=$(this))}),t.remove()}function updateSubmission(t,e,n,i){n=n||"0.0";var o="",o="success"==e?"list-group-item-success":"save"==e?"list-group-item-save":"list-group-item-danger";$("#submissions").find(".submission").each(function(){var e;$(this).attr("data-submission-id").trim()==t&&($(this).removeClass("list-group-item-warning").addClass(o),(e=$(this).find("span[id='txt']")).text(e.text()+" - "+n+"%"),updateTagsToNewSubmission($(this),i))})}function displayEvaluatedSubmission(e,t){var n,i,o;$("#submissions").find(".submission").each(function(){$(this).attr("data-submission-id").trim()==e&&(n=$(this))}),$("#my_submission").length&&(i=n.find("span[id='txt']").html(),o=jQuery("",{href:"#",id:"my_submission",class:"submission list-group-item list-group-item-action list-group-item-info","data-submission-id":e}).on("click",clickOnSubmission),jQuery("",{class:"fa fa-chevron-right fa-fw"}).appendTo(o).after(" "),o.append(i),t?$("#my_submission").fadeOut(function(){$(this).replaceWith(o.fadeIn().removeAttr("style"))}):$("#my_submission").replaceWith(o)),updateTaskStatus(n.hasClass("list-group-item-success")?"Succeeded":"Failed",parseFloat(n.text().split("-")[1]))}function clickOnSubmission(){loadingSomething||(loadOldSubmissionInput($(this).attr("data-submission-id"),!0),$("body").removeClass("sidebar-active"))}function getDateTime(){var e=new Date;return("0"+e.getDate()).slice(-2)+"/"+("0"+(e.getMonth()+1)).slice(-2)+"/"+e.getFullYear()+" "+("0"+e.getHours()).slice(-2)+":"+("0"+e.getMinutes()).slice(-2)+":"+("0"+e.getSeconds()).slice(-2)}function taskFormValid(){var e,n,i,o=!0,r=[],t=$("#task");return t.find('textarea,input[type="text"]').each(function(){null!=$(this).attr("name")&&""==$(this).val()&&"True"!=$(this).attr("data-optional")&&(o=!1)}),t.find('input[type="checkbox"],input[type="radio"]').each(function(){0==t.find("input[name='"+$(this).attr("name")+"']:checked").length&&(o=!1)}),t.find('input[type="file"]').each(function(){var n=$(this).val().split(/(\\|\/)/g).pop();if(""==n)o=!1;else{var e=$.parseJSON($(this).attr("data-allowed-exts")),i=!1,e=($.each(e,function(e,t){i=i||0<(n.lastIndexOf(t)===n.length-t.length)}),i||r.push($("#invalidext").text().replace("{}",n)),-1);try{e=$(this)[0].files[0].size}catch(e){}if(-1==e)try{e=$(this)[0].files[0].fileSize}catch(e){}var t=parseInt($(this).attr("data-max-size"));-1!=e&&t
  • "),i=!0,$.each(r,function(e,t){i||n.append($("
    ")),i=!1,n.append($("").text(t))}),e.html(getAlertCode("Error",n.html(),"danger",!1)),$("html, body").animate({scrollTop:e.offset().top-100},200),!1)}function submitTask(e){loadingSomething||taskFormValid()&&($("#task-debug-mode").val(e?"ssh":""),$("form#task").ajaxSubmit({dataType:"json",success:function(e){"status"in e&&"ok"==e.status&&"submissionid"in e?(displayTaskLoadingAlert(e,e.submissionid),incrementTries(),displayNewSubmission(e.submissionid),waitForSubmission(e.submissionid)):"status"in e&&"error"==e.status&&"text"in e&&(displayTaskStudentAlertWithProblems(e,"danger",!1),updateTaskStatus(e.text,0),unblurTaskForm()),"remove"in e&&e.remove.forEach(function(e,t,n){removeSubmission(e)})},error:function(){displayTaskStudentAlertWithProblems($("#internalerror").text(),"danger",!1),updateTaskStatus($("#internalerror").text(),0),unblurTaskForm()}}),blurTaskForm(),resetAlerts(),displayTaskLoadingAlert(null,null),updateTaskStatus('',0),$("html, body").animate({scrollTop:$("#task_alert").offset().top-100},200))}function waitForSubmission(submissionid){setTimeout(function(){var url=$("form#task").attr("action");jQuery.post(url,{"@action":"check",submissionid:submissionid},null,"json").done(function(data){"status"in data&&"waiting"===data.status?(waitForSubmission(submissionid),"ssh_host"in data&&"ssh_port"in data&&"ssh_user"in data&&"ssh_password"in data?displayRemoteDebug(submissionid,data):displayTaskLoadingAlert(data,submissionid)):"status"in data&&"result"in data&&"grade"in data?(updateMainTags(data),"debug"in data&&displayDebugInfo(data.debug),"failed"==data.result?displayTaskStudentAlertWithProblems(data,"danger",!1):"success"==data.result?displayTaskStudentAlertWithProblems(data,"success",!1):"timeout"==data.result||"overflow"==data.result||"killed"==data.result?displayTaskStudentAlertWithProblems(data,"warning",!1):displayTaskStudentAlertWithProblems(data,"danger",!1),"tests"in data?updateSubmission(submissionid,data.result,data.grade,data.tests):updateSubmission(submissionid,data.result,data.grade,[]),unblurTaskForm(),"replace"in data&&data.replace&&$("#my_submission").length?displayEvaluatedSubmission(submissionid,!0):$("#my_submission").length&&displayEvaluatedSubmission($("#my_submission").attr("data-submission-id"),!1),"feedback_script"in data&&eval(data.feedback_script)):(displayTaskStudentAlertWithProblems(data,"danger",!1),updateSubmission(submissionid,"error","0.0",[]),updateTaskStatus("Failed",0),unblurTaskForm())}).fail(function(){displayTaskStudentAlertWithProblems(data,"danger",!1),updateSubmission(submissionid,"error","0.0",[]),updateTaskStatus("Failed",0),unblurTaskForm()})},1e3)}function killSubmission(e){$(".kill-submission-btn").attr("disabled","disabled");var t=$("form#task").attr("action");jQuery.post(t,{"@action":"kill",submissionid:e},null,"json").done(function(){$(".kill-submission-btn").removeAttr("disabled")}).fail(function(){$(".kill-submission-btn").removeAttr("disabled")})}function displayDebugInfo(e){displayDebugInfoRecur(e,$("#task_debug"))}function displayDebugInfoRecur(e,t){var o=$(document.createElement("dl"));o.text(" "),t.html(o),jQuery.each(e,function(e,t){var n=$(document.createElement("dt")),i=$(document.createElement("dd"));o.append(n),o.append(i),n.text(e),jQuery.isPlainObject(t)?displayDebugInfoRecur(t,i):i.text(t)})}function getLoadingAlertCode(e,t,n){return getAlertCode(e,t,"info",!1,null!=n?"":void 0)}function displayTaskLoadingAlert(e,t){var n=$("#task_alert"),i="";null!=e&&(i+=e.text),n.html(getLoadingAlertCode(' ',i,t))}function displayRemoteDebug(e,t){var n,i=t.ssh_host,o=t.ssh_port,r=t.ssh_user,s=t.ssh_password,r="ssh "+r+"@"+i+" -p "+o+" -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o PreferredAuthentications=password",a=$("#task_alert");t.text;$("pre#commandssh",a).text()!==r&&(t=$("#ssh_template").clone(),$("#commandssh",t).text(r),r=$("#webterm",t),void 0!==(n=$("#webterm_link",t).val())&&$("
    ").addClass("cw").text("#"));t.isBefore(this._viewDate.clone().endOf("w"));)e.append(g("").addClass("dow").text(t.format("dd"))),t.add(1,"d");this.widget.find(".datepicker-days thead").append(e)},o.prototype._fillMonths=function(){for(var e=[],t=this._viewDate.clone().startOf("y").startOf("d");t.isSame(this._viewDate,"y");)e.push(g("").attr("data-action","selectMonth").addClass("month").text(t.format("MMM"))),t.add(1,"M");this.widget.find(".datepicker-months td").empty().append(e)},o.prototype._updateMonths=function(){var e=this.widget.find(".datepicker-months"),t=e.find("th"),n=e.find("tbody").find("span"),i=this;t.eq(0).find("span").attr("title",this._options.tooltips.prevYear),t.eq(1).attr("title",this._options.tooltips.selectYear),t.eq(2).find("span").attr("title",this._options.tooltips.nextYear),e.find(".disabled").removeClass("disabled"),this._isValid(this._viewDate.clone().subtract(1,"y"),"y")||t.eq(0).addClass("disabled"),t.eq(1).text(this._viewDate.year()),this._isValid(this._viewDate.clone().add(1,"y"),"y")||t.eq(2).addClass("disabled"),n.removeClass("active"),this._getLastPickedDate().isSame(this._viewDate,"y")&&!this.unset&&n.eq(this._getLastPickedDate().month()).addClass("active"),n.each(function(e){i._isValid(i._viewDate.clone().month(e),"M")||g(this).addClass("disabled")})},o.prototype._getStartEndYear=function(e,t){var n=e/10,e=Math.floor(t/e)*e;return[e,e+9*n,Math.floor(t/n)*n]},o.prototype._updateYears=function(){var e=this.widget.find(".datepicker-years"),t=e.find("th"),n=this._getStartEndYear(10,this._viewDate.year()),i=this._viewDate.clone().year(n[0]),o=this._viewDate.clone().year(n[1]),r="";for(t.eq(0).find("span").attr("title",this._options.tooltips.prevDecade),t.eq(1).attr("title",this._options.tooltips.selectDecade),t.eq(2).find("span").attr("title",this._options.tooltips.nextDecade),e.find(".disabled").removeClass("disabled"),this._options.minDate&&this._options.minDate.isAfter(i,"y")&&t.eq(0).addClass("disabled"),t.eq(1).text(i.year()+"-"+o.year()),this._options.maxDate&&this._options.maxDate.isBefore(o,"y")&&t.eq(2).addClass("disabled"),r+=''+(i.year()-1)+"";!i.isAfter(o,"y");)r+=''+i.year()+"",i.add(1,"y");r+=''+i.year()+"",e.find("td").html(r)},o.prototype._updateDecades=function(){var e,t,n,i=this.widget.find(".datepicker-decades"),o=i.find("th"),r=this._getStartEndYear(100,this._viewDate.year()),s=this._viewDate.clone().year(r[0]),a=this._viewDate.clone().year(r[1]),l="";for(o.eq(0).find("span").attr("title",this._options.tooltips.prevCentury),o.eq(2).find("span").attr("title",this._options.tooltips.nextCentury),i.find(".disabled").removeClass("disabled"),(0===s.year()||this._options.minDate&&this._options.minDate.isAfter(s,"y"))&&o.eq(0).addClass("disabled"),o.eq(1).text(s.year()+"-"+a.year()),this._options.maxDate&&this._options.maxDate.isBefore(a,"y")&&o.eq(2).addClass("disabled"),l+=s.year()-10<0?" ":''+(s.year()-10)+"";!s.isAfter(a,"y");)n=s.year()+11,e=this._options.minDate&&this._options.minDate.isAfter(s,"y")&&this._options.minDate.year()<=n,t=this._options.maxDate&&this._options.maxDate.isAfter(s,"y")&&this._options.maxDate.year()<=n,l+=''+s.year()+"",s.add(10,"y");l+=''+s.year()+"",i.find("td").html(l)},o.prototype._fillDate=function(){var e,t=this.widget.find(".datepicker-days"),n=t.find("th"),i=[],o=void 0,r=void 0,s=void 0,a=void 0;if(this._hasDate()){for(n.eq(0).find("span").attr("title",this._options.tooltips.prevMonth),n.eq(1).attr("title",this._options.tooltips.selectMonth),n.eq(2).find("span").attr("title",this._options.tooltips.nextMonth),t.find(".disabled").removeClass("disabled"),n.eq(1).text(this._viewDate.format(this._options.dayViewHeaderFormat)),this._isValid(this._viewDate.clone().subtract(1,"M"),"M")||n.eq(0).addClass("disabled"),this._isValid(this._viewDate.clone().add(1,"M"),"M")||n.eq(2).addClass("disabled"),o=this._viewDate.clone().startOf("M").startOf("w").startOf("d"),a=0;a<42;a++)0===o.weekday()&&(r=g("
    '+o.week()+"'+o.date()+"
    '+t.format(this.use24Hours?"HH":"hh")+"
    '+t.format("mm")+"
    '+t.format("ss")+"