!function(e){var t={};function n(i){if(t[i])return t[i].exports;var r=t[i]={i:i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(i,r,function(t){return e[t]}.bind(null,r));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/",n(n.s=181)}({12:function(e,t,n){var i,r,s;
/*!
 * jQuery JavaScript Library v2.2.4
 * http://jquery.com/
 *
 * Includes Sizzle.js
 * http://sizzlejs.com/
 *
 * Copyright jQuery Foundation and other contributors
 * Released under the MIT license
 * http://jquery.org/license
 *
 * Date: 2016-05-20T17:23Z
 */r="undefined"!=typeof window?window:this,s=function(n,r){var s=[],o=n.document,a=s.slice,u=s.concat,l=s.push,c=s.indexOf,d={},h=d.toString,f=d.hasOwnProperty,p={},m=function(e,t){return new m.fn.init(e,t)},v=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,g=/^-ms-/,y=/-([\da-z])/gi,b=function(e,t){return t.toUpperCase()};function _(e){var t=!!e&&"length"in e&&e.length,n=m.type(e);return"function"!==n&&!m.isWindow(e)&&("array"===n||0===t||"number"==typeof t&&t>0&&t-1 in e)}m.fn=m.prototype={jquery:"2.2.4",constructor:m,selector:"",length:0,toArray:function(){return a.call(this)},get:function(e){return null!=e?e<0?this[e+this.length]:this[e]:a.call(this)},pushStack:function(e){var t=m.merge(this.constructor(),e);return t.prevObject=this,t.context=this.context,t},each:function(e){return m.each(this,e)},map:function(e){return this.pushStack(m.map(this,(function(t,n){return e.call(t,n,t)})))},slice:function(){return this.pushStack(a.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(n>=0&&n<t?[this[n]]:[])},end:function(){return this.prevObject||this.constructor()},push:l,sort:s.sort,splice:s.splice},m.extend=m.fn.extend=function(){var e,t,n,i,r,s,o=arguments[0]||{},a=1,u=arguments.length,l=!1;for("boolean"==typeof o&&(l=o,o=arguments[a]||{},a++),"object"==typeof o||m.isFunction(o)||(o={}),a===u&&(o=this,a--);a<u;a++)if(null!=(e=arguments[a]))for(t in e)n=o[t],o!==(i=e[t])&&(l&&i&&(m.isPlainObject(i)||(r=m.isArray(i)))?(r?(r=!1,s=n&&m.isArray(n)?n:[]):s=n&&m.isPlainObject(n)?n:{},o[t]=m.extend(l,s,i)):void 0!==i&&(o[t]=i));return o},m.extend({expando:"jQuery"+("2.2.4"+Math.random()).replace(/\D/g,""),isReady:!0,error:function(e){throw new Error(e)},noop:function(){},isFunction:function(e){return"function"===m.type(e)},isArray:Array.isArray,isWindow:function(e){return null!=e&&e===e.window},isNumeric:function(e){var t=e&&e.toString();return!m.isArray(e)&&t-parseFloat(t)+1>=0},isPlainObject:function(e){var t;if("object"!==m.type(e)||e.nodeType||m.isWindow(e))return!1;if(e.constructor&&!f.call(e,"constructor")&&!f.call(e.constructor.prototype||{},"isPrototypeOf"))return!1;for(t in e);return void 0===t||f.call(e,t)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},type:function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?d[h.call(e)]||"object":typeof e},globalEval:function(e){var t,n=eval;(e=m.trim(e))&&(1===e.indexOf("use strict")?((t=o.createElement("script")).text=e,o.head.appendChild(t).parentNode.removeChild(t)):n(e))},camelCase:function(e){return e.replace(g,"ms-").replace(y,b)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,t){var n,i=0;if(_(e))for(n=e.length;i<n&&!1!==t.call(e[i],i,e[i]);i++);else for(i in e)if(!1===t.call(e[i],i,e[i]))break;return e},trim:function(e){return null==e?"":(e+"").replace(v,"")},makeArray:function(e,t){var n=t||[];return null!=e&&(_(Object(e))?m.merge(n,"string"==typeof e?[e]:e):l.call(n,e)),n},inArray:function(e,t,n){return null==t?-1:c.call(t,e,n)},merge:function(e,t){for(var n=+t.length,i=0,r=e.length;i<n;i++)e[r++]=t[i];return e.length=r,e},grep:function(e,t,n){for(var i=[],r=0,s=e.length,o=!n;r<s;r++)!t(e[r],r)!==o&&i.push(e[r]);return i},map:function(e,t,n){var i,r,s=0,o=[];if(_(e))for(i=e.length;s<i;s++)null!=(r=t(e[s],s,n))&&o.push(r);else for(s in e)null!=(r=t(e[s],s,n))&&o.push(r);return u.apply([],o)},guid:1,proxy:function(e,t){var n,i,r;if("string"==typeof t&&(n=e[t],t=e,e=n),m.isFunction(e))return i=a.call(arguments,2),(r=function(){return e.apply(t||this,i.concat(a.call(arguments)))}).guid=e.guid=e.guid||m.guid++,r},now:Date.now,support:p}),"function"==typeof Symbol&&(m.fn[Symbol.iterator]=s[Symbol.iterator]),m.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),(function(e,t){d["[object "+t+"]"]=t.toLowerCase()}));var x=
/*!
 * Sizzle CSS Selector Engine v2.2.1
 * http://sizzlejs.com/
 *
 * Copyright jQuery Foundation and other contributors
 * Released under the MIT license
 * http://jquery.org/license
 *
 * Date: 2015-10-17
 */
function(e){var t,n,i,r,s,o,a,u,l,c,d,h,f,p,m,v,g,y,b,_="sizzle"+1*new Date,x=e.document,w=0,k=0,E=re(),C=re(),T=re(),$=function(e,t){return e===t&&(d=!0),0},S={}.hasOwnProperty,A=[],N=A.pop,j=A.push,D=A.push,R=A.slice,O=function(e,t){for(var n=0,i=e.length;n<i;n++)if(e[n]===t)return n;return-1},I="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",F="[\\x20\\t\\r\\n\\f]",P="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",H="\\["+F+"*("+P+")(?:"+F+"*([*^$|!~]?=)"+F+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+P+"))|)"+F+"*\\]",L=":("+P+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+H+")*)|.*)\\)|)",M=new RegExp(F+"+","g"),V=new RegExp("^"+F+"+|((?:^|[^\\\\])(?:\\\\.)*)"+F+"+$","g"),W=new RegExp("^"+F+"*,"+F+"*"),B=new RegExp("^"+F+"*([>+~]|"+F+")"+F+"*"),q=new RegExp("="+F+"*([^\\]'\"]*?)"+F+"*\\]","g"),U=new RegExp(L),z=new RegExp("^"+P+"$"),G={ID:new RegExp("^#("+P+")"),CLASS:new RegExp("^\\.("+P+")"),TAG:new RegExp("^("+P+"|[*])"),ATTR:new RegExp("^"+H),PSEUDO:new RegExp("^"+L),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+F+"*(even|odd|(([+-]|)(\\d*)n|)"+F+"*(?:([+-]|)"+F+"*(\\d+)|))"+F+"*\\)|)","i"),bool:new RegExp("^(?:"+I+")$","i"),needsContext:new RegExp("^"+F+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+F+"*((?:-\\d)?\\d*)"+F+"*\\)|)(?=[^-]|$)","i")},J=/^(?:input|select|textarea|button)$/i,X=/^h\d$/i,Y=/^[^{]+\{\s*\[native \w/,K=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,Q=/[+~]/,Z=/'|\\/g,ee=new RegExp("\\\\([\\da-f]{1,6}"+F+"?|("+F+")|.)","ig"),te=function(e,t,n){var i="0x"+t-65536;return i!=i||n?t:i<0?String.fromCharCode(i+65536):String.fromCharCode(i>>10|55296,1023&i|56320)},ne=function(){h()};try{D.apply(A=R.call(x.childNodes),x.childNodes),A[x.childNodes.length].nodeType}catch(e){D={apply:A.length?function(e,t){j.apply(e,R.call(t))}:function(e,t){for(var n=e.length,i=0;e[n++]=t[i++];);e.length=n-1}}}function ie(e,t,i,r){var s,a,l,c,d,p,g,y,w=t&&t.ownerDocument,k=t?t.nodeType:9;if(i=i||[],"string"!=typeof e||!e||1!==k&&9!==k&&11!==k)return i;if(!r&&((t?t.ownerDocument||t:x)!==f&&h(t),t=t||f,m)){if(11!==k&&(p=K.exec(e)))if(s=p[1]){if(9===k){if(!(l=t.getElementById(s)))return i;if(l.id===s)return i.push(l),i}else if(w&&(l=w.getElementById(s))&&b(t,l)&&l.id===s)return i.push(l),i}else{if(p[2])return D.apply(i,t.getElementsByTagName(e)),i;if((s=p[3])&&n.getElementsByClassName&&t.getElementsByClassName)return D.apply(i,t.getElementsByClassName(s)),i}if(n.qsa&&!T[e+" "]&&(!v||!v.test(e))){if(1!==k)w=t,y=e;else if("object"!==t.nodeName.toLowerCase()){for((c=t.getAttribute("id"))?c=c.replace(Z,"\\$&"):t.setAttribute("id",c=_),a=(g=o(e)).length,d=z.test(c)?"#"+c:"[id='"+c+"']";a--;)g[a]=d+" "+pe(g[a]);y=g.join(","),w=Q.test(e)&&he(t.parentNode)||t}if(y)try{return D.apply(i,w.querySelectorAll(y)),i}catch(e){}finally{c===_&&t.removeAttribute("id")}}}return u(e.replace(V,"$1"),t,i,r)}function re(){var e=[];return function t(n,r){return e.push(n+" ")>i.cacheLength&&delete t[e.shift()],t[n+" "]=r}}function se(e){return e[_]=!0,e}function oe(e){var t=f.createElement("div");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function ae(e,t){for(var n=e.split("|"),r=n.length;r--;)i.attrHandle[n[r]]=t}function ue(e,t){var n=t&&e,i=n&&1===e.nodeType&&1===t.nodeType&&(~t.sourceIndex||1<<31)-(~e.sourceIndex||1<<31);if(i)return i;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function le(e){return function(t){return"input"===t.nodeName.toLowerCase()&&t.type===e}}function ce(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function de(e){return se((function(t){return t=+t,se((function(n,i){for(var r,s=e([],n.length,t),o=s.length;o--;)n[r=s[o]]&&(n[r]=!(i[r]=n[r]))}))}))}function he(e){return e&&void 0!==e.getElementsByTagName&&e}for(t in n=ie.support={},s=ie.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return!!t&&"HTML"!==t.nodeName},h=ie.setDocument=function(e){var t,r,o=e?e.ownerDocument||e:x;return o!==f&&9===o.nodeType&&o.documentElement?(p=(f=o).documentElement,m=!s(f),(r=f.defaultView)&&r.top!==r&&(r.addEventListener?r.addEventListener("unload",ne,!1):r.attachEvent&&r.attachEvent("onunload",ne)),n.attributes=oe((function(e){return e.className="i",!e.getAttribute("className")})),n.getElementsByTagName=oe((function(e){return e.appendChild(f.createComment("")),!e.getElementsByTagName("*").length})),n.getElementsByClassName=Y.test(f.getElementsByClassName),n.getById=oe((function(e){return p.appendChild(e).id=_,!f.getElementsByName||!f.getElementsByName(_).length})),n.getById?(i.find.ID=function(e,t){if(void 0!==t.getElementById&&m){var n=t.getElementById(e);return n?[n]:[]}},i.filter.ID=function(e){var t=e.replace(ee,te);return function(e){return e.getAttribute("id")===t}}):(delete i.find.ID,i.filter.ID=function(e){var t=e.replace(ee,te);return function(e){var n=void 0!==e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}}),i.find.TAG=n.getElementsByTagName?function(e,t){return void 0!==t.getElementsByTagName?t.getElementsByTagName(e):n.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,i=[],r=0,s=t.getElementsByTagName(e);if("*"===e){for(;n=s[r++];)1===n.nodeType&&i.push(n);return i}return s},i.find.CLASS=n.getElementsByClassName&&function(e,t){if(void 0!==t.getElementsByClassName&&m)return t.getElementsByClassName(e)},g=[],v=[],(n.qsa=Y.test(f.querySelectorAll))&&(oe((function(e){p.appendChild(e).innerHTML="<a id='"+_+"'></a><select id='"+_+"-\r\\' msallowcapture=''><option selected=''></option></select>",e.querySelectorAll("[msallowcapture^='']").length&&v.push("[*^$]="+F+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||v.push("\\["+F+"*(?:value|"+I+")"),e.querySelectorAll("[id~="+_+"-]").length||v.push("~="),e.querySelectorAll(":checked").length||v.push(":checked"),e.querySelectorAll("a#"+_+"+*").length||v.push(".#.+[+~]")})),oe((function(e){var t=f.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&v.push("name"+F+"*[*^$|!~]?="),e.querySelectorAll(":enabled").length||v.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),v.push(",.*:")}))),(n.matchesSelector=Y.test(y=p.matches||p.webkitMatchesSelector||p.mozMatchesSelector||p.oMatchesSelector||p.msMatchesSelector))&&oe((function(e){n.disconnectedMatch=y.call(e,"div"),y.call(e,"[s!='']:x"),g.push("!=",L)})),v=v.length&&new RegExp(v.join("|")),g=g.length&&new RegExp(g.join("|")),t=Y.test(p.compareDocumentPosition),b=t||Y.test(p.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,i=t&&t.parentNode;return e===i||!(!i||1!==i.nodeType||!(n.contains?n.contains(i):e.compareDocumentPosition&&16&e.compareDocumentPosition(i)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},$=t?function(e,t){if(e===t)return d=!0,0;var i=!e.compareDocumentPosition-!t.compareDocumentPosition;return i||(1&(i=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!n.sortDetached&&t.compareDocumentPosition(e)===i?e===f||e.ownerDocument===x&&b(x,e)?-1:t===f||t.ownerDocument===x&&b(x,t)?1:c?O(c,e)-O(c,t):0:4&i?-1:1)}:function(e,t){if(e===t)return d=!0,0;var n,i=0,r=e.parentNode,s=t.parentNode,o=[e],a=[t];if(!r||!s)return e===f?-1:t===f?1:r?-1:s?1:c?O(c,e)-O(c,t):0;if(r===s)return ue(e,t);for(n=e;n=n.parentNode;)o.unshift(n);for(n=t;n=n.parentNode;)a.unshift(n);for(;o[i]===a[i];)i++;return i?ue(o[i],a[i]):o[i]===x?-1:a[i]===x?1:0},f):f},ie.matches=function(e,t){return ie(e,null,null,t)},ie.matchesSelector=function(e,t){if((e.ownerDocument||e)!==f&&h(e),t=t.replace(q,"='$1']"),n.matchesSelector&&m&&!T[t+" "]&&(!g||!g.test(t))&&(!v||!v.test(t)))try{var i=y.call(e,t);if(i||n.disconnectedMatch||e.document&&11!==e.document.nodeType)return i}catch(e){}return ie(t,f,null,[e]).length>0},ie.contains=function(e,t){return(e.ownerDocument||e)!==f&&h(e),b(e,t)},ie.attr=function(e,t){(e.ownerDocument||e)!==f&&h(e);var r=i.attrHandle[t.toLowerCase()],s=r&&S.call(i.attrHandle,t.toLowerCase())?r(e,t,!m):void 0;return void 0!==s?s:n.attributes||!m?e.getAttribute(t):(s=e.getAttributeNode(t))&&s.specified?s.value:null},ie.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},ie.uniqueSort=function(e){var t,i=[],r=0,s=0;if(d=!n.detectDuplicates,c=!n.sortStable&&e.slice(0),e.sort($),d){for(;t=e[s++];)t===e[s]&&(r=i.push(s));for(;r--;)e.splice(i[r],1)}return c=null,e},r=ie.getText=function(e){var t,n="",i=0,s=e.nodeType;if(s){if(1===s||9===s||11===s){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=r(e)}else if(3===s||4===s)return e.nodeValue}else for(;t=e[i++];)n+=r(t);return n},(i=ie.selectors={cacheLength:50,createPseudo:se,match:G,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(ee,te),e[3]=(e[3]||e[4]||e[5]||"").replace(ee,te),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||ie.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]&&ie.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return G.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&U.test(n)&&(t=o(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(ee,te).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=E[e+" "];return t||(t=new RegExp("(^|"+F+")"+e+"("+F+"|$)"))&&E(e,(function(e){return t.test("string"==typeof e.className&&e.className||void 0!==e.getAttribute&&e.getAttribute("class")||"")}))},ATTR:function(e,t,n){return function(i){var r=ie.attr(i,e);return null==r?"!="===t:!t||(r+="","="===t?r===n:"!="===t?r!==n:"^="===t?n&&0===r.indexOf(n):"*="===t?n&&r.indexOf(n)>-1:"$="===t?n&&r.slice(-n.length)===n:"~="===t?(" "+r.replace(M," ")+" ").indexOf(n)>-1:"|="===t&&(r===n||r.slice(0,n.length+1)===n+"-"))}},CHILD:function(e,t,n,i,r){var s="nth"!==e.slice(0,3),o="last"!==e.slice(-4),a="of-type"===t;return 1===i&&0===r?function(e){return!!e.parentNode}:function(t,n,u){var l,c,d,h,f,p,m=s!==o?"nextSibling":"previousSibling",v=t.parentNode,g=a&&t.nodeName.toLowerCase(),y=!u&&!a,b=!1;if(v){if(s){for(;m;){for(h=t;h=h[m];)if(a?h.nodeName.toLowerCase()===g:1===h.nodeType)return!1;p=m="only"===e&&!p&&"nextSibling"}return!0}if(p=[o?v.firstChild:v.lastChild],o&&y){for(b=(f=(l=(c=(d=(h=v)[_]||(h[_]={}))[h.uniqueID]||(d[h.uniqueID]={}))[e]||[])[0]===w&&l[1])&&l[2],h=f&&v.childNodes[f];h=++f&&h&&h[m]||(b=f=0)||p.pop();)if(1===h.nodeType&&++b&&h===t){c[e]=[w,f,b];break}}else if(y&&(b=f=(l=(c=(d=(h=t)[_]||(h[_]={}))[h.uniqueID]||(d[h.uniqueID]={}))[e]||[])[0]===w&&l[1]),!1===b)for(;(h=++f&&h&&h[m]||(b=f=0)||p.pop())&&((a?h.nodeName.toLowerCase()!==g:1!==h.nodeType)||!++b||(y&&((c=(d=h[_]||(h[_]={}))[h.uniqueID]||(d[h.uniqueID]={}))[e]=[w,b]),h!==t)););return(b-=r)===i||b%i==0&&b/i>=0}}},PSEUDO:function(e,t){var n,r=i.pseudos[e]||i.setFilters[e.toLowerCase()]||ie.error("unsupported pseudo: "+e);return r[_]?r(t):r.length>1?(n=[e,e,"",t],i.setFilters.hasOwnProperty(e.toLowerCase())?se((function(e,n){for(var i,s=r(e,t),o=s.length;o--;)e[i=O(e,s[o])]=!(n[i]=s[o])})):function(e){return r(e,0,n)}):r}},pseudos:{not:se((function(e){var t=[],n=[],i=a(e.replace(V,"$1"));return i[_]?se((function(e,t,n,r){for(var s,o=i(e,null,r,[]),a=e.length;a--;)(s=o[a])&&(e[a]=!(t[a]=s))})):function(e,r,s){return t[0]=e,i(t,null,s,n),t[0]=null,!n.pop()}})),has:se((function(e){return function(t){return ie(e,t).length>0}})),contains:se((function(e){return e=e.replace(ee,te),function(t){return(t.textContent||t.innerText||r(t)).indexOf(e)>-1}})),lang:se((function(e){return z.test(e||"")||ie.error("unsupported lang: "+e),e=e.replace(ee,te).toLowerCase(),function(t){var n;do{if(n=m?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return(n=n.toLowerCase())===e||0===n.indexOf(e+"-")}while((t=t.parentNode)&&1===t.nodeType);return!1}})),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===p},focus:function(e){return e===f.activeElement&&(!f.hasFocus||f.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return!1===e.disabled},disabled:function(e){return!0===e.disabled},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!i.pseudos.empty(e)},header:function(e){return X.test(e.nodeName)},input:function(e){return J.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:de((function(){return[0]})),last:de((function(e,t){return[t-1]})),eq:de((function(e,t,n){return[n<0?n+t:n]})),even:de((function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e})),odd:de((function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e})),lt:de((function(e,t,n){for(var i=n<0?n+t:n;--i>=0;)e.push(i);return e})),gt:de((function(e,t,n){for(var i=n<0?n+t:n;++i<t;)e.push(i);return e}))}}).pseudos.nth=i.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})i.pseudos[t]=le(t);for(t in{submit:!0,reset:!0})i.pseudos[t]=ce(t);function fe(){}function pe(e){for(var t=0,n=e.length,i="";t<n;t++)i+=e[t].value;return i}function me(e,t,n){var i=t.dir,r=n&&"parentNode"===i,s=k++;return t.first?function(t,n,s){for(;t=t[i];)if(1===t.nodeType||r)return e(t,n,s)}:function(t,n,o){var a,u,l,c=[w,s];if(o){for(;t=t[i];)if((1===t.nodeType||r)&&e(t,n,o))return!0}else for(;t=t[i];)if(1===t.nodeType||r){if((a=(u=(l=t[_]||(t[_]={}))[t.uniqueID]||(l[t.uniqueID]={}))[i])&&a[0]===w&&a[1]===s)return c[2]=a[2];if(u[i]=c,c[2]=e(t,n,o))return!0}}}function ve(e){return e.length>1?function(t,n,i){for(var r=e.length;r--;)if(!e[r](t,n,i))return!1;return!0}:e[0]}function ge(e,t,n,i,r){for(var s,o=[],a=0,u=e.length,l=null!=t;a<u;a++)(s=e[a])&&(n&&!n(s,i,r)||(o.push(s),l&&t.push(a)));return o}function ye(e,t,n,i,r,s){return i&&!i[_]&&(i=ye(i)),r&&!r[_]&&(r=ye(r,s)),se((function(s,o,a,u){var l,c,d,h=[],f=[],p=o.length,m=s||function(e,t,n){for(var i=0,r=t.length;i<r;i++)ie(e,t[i],n);return n}(t||"*",a.nodeType?[a]:a,[]),v=!e||!s&&t?m:ge(m,h,e,a,u),g=n?r||(s?e:p||i)?[]:o:v;if(n&&n(v,g,a,u),i)for(l=ge(g,f),i(l,[],a,u),c=l.length;c--;)(d=l[c])&&(g[f[c]]=!(v[f[c]]=d));if(s){if(r||e){if(r){for(l=[],c=g.length;c--;)(d=g[c])&&l.push(v[c]=d);r(null,g=[],l,u)}for(c=g.length;c--;)(d=g[c])&&(l=r?O(s,d):h[c])>-1&&(s[l]=!(o[l]=d))}}else g=ge(g===o?g.splice(p,g.length):g),r?r(null,o,g,u):D.apply(o,g)}))}function be(e){for(var t,n,r,s=e.length,o=i.relative[e[0].type],a=o||i.relative[" "],u=o?1:0,c=me((function(e){return e===t}),a,!0),d=me((function(e){return O(t,e)>-1}),a,!0),h=[function(e,n,i){var r=!o&&(i||n!==l)||((t=n).nodeType?c(e,n,i):d(e,n,i));return t=null,r}];u<s;u++)if(n=i.relative[e[u].type])h=[me(ve(h),n)];else{if((n=i.filter[e[u].type].apply(null,e[u].matches))[_]){for(r=++u;r<s&&!i.relative[e[r].type];r++);return ye(u>1&&ve(h),u>1&&pe(e.slice(0,u-1).concat({value:" "===e[u-2].type?"*":""})).replace(V,"$1"),n,u<r&&be(e.slice(u,r)),r<s&&be(e=e.slice(r)),r<s&&pe(e))}h.push(n)}return ve(h)}return fe.prototype=i.filters=i.pseudos,i.setFilters=new fe,o=ie.tokenize=function(e,t){var n,r,s,o,a,u,l,c=C[e+" "];if(c)return t?0:c.slice(0);for(a=e,u=[],l=i.preFilter;a;){for(o in n&&!(r=W.exec(a))||(r&&(a=a.slice(r[0].length)||a),u.push(s=[])),n=!1,(r=B.exec(a))&&(n=r.shift(),s.push({value:n,type:r[0].replace(V," ")}),a=a.slice(n.length)),i.filter)!(r=G[o].exec(a))||l[o]&&!(r=l[o](r))||(n=r.shift(),s.push({value:n,type:o,matches:r}),a=a.slice(n.length));if(!n)break}return t?a.length:a?ie.error(e):C(e,u).slice(0)},a=ie.compile=function(e,t){var n,r=[],s=[],a=T[e+" "];if(!a){for(t||(t=o(e)),n=t.length;n--;)(a=be(t[n]))[_]?r.push(a):s.push(a);(a=T(e,function(e,t){var n=t.length>0,r=e.length>0,s=function(s,o,a,u,c){var d,p,v,g=0,y="0",b=s&&[],_=[],x=l,k=s||r&&i.find.TAG("*",c),E=w+=null==x?1:Math.random()||.1,C=k.length;for(c&&(l=o===f||o||c);y!==C&&null!=(d=k[y]);y++){if(r&&d){for(p=0,o||d.ownerDocument===f||(h(d),a=!m);v=e[p++];)if(v(d,o||f,a)){u.push(d);break}c&&(w=E)}n&&((d=!v&&d)&&g--,s&&b.push(d))}if(g+=y,n&&y!==g){for(p=0;v=t[p++];)v(b,_,o,a);if(s){if(g>0)for(;y--;)b[y]||_[y]||(_[y]=N.call(u));_=ge(_)}D.apply(u,_),c&&!s&&_.length>0&&g+t.length>1&&ie.uniqueSort(u)}return c&&(w=E,l=x),b};return n?se(s):s}(s,r))).selector=e}return a},u=ie.select=function(e,t,r,s){var u,l,c,d,h,f="function"==typeof e&&e,p=!s&&o(e=f.selector||e);if(r=r||[],1===p.length){if((l=p[0]=p[0].slice(0)).length>2&&"ID"===(c=l[0]).type&&n.getById&&9===t.nodeType&&m&&i.relative[l[1].type]){if(!(t=(i.find.ID(c.matches[0].replace(ee,te),t)||[])[0]))return r;f&&(t=t.parentNode),e=e.slice(l.shift().value.length)}for(u=G.needsContext.test(e)?0:l.length;u--&&(c=l[u],!i.relative[d=c.type]);)if((h=i.find[d])&&(s=h(c.matches[0].replace(ee,te),Q.test(l[0].type)&&he(t.parentNode)||t))){if(l.splice(u,1),!(e=s.length&&pe(l)))return D.apply(r,s),r;break}}return(f||a(e,p))(s,t,!m,r,!t||Q.test(e)&&he(t.parentNode)||t),r},n.sortStable=_.split("").sort($).join("")===_,n.detectDuplicates=!!d,h(),n.sortDetached=oe((function(e){return 1&e.compareDocumentPosition(f.createElement("div"))})),oe((function(e){return e.innerHTML="<a href='#'></a>","#"===e.firstChild.getAttribute("href")}))||ae("type|href|height|width",(function(e,t,n){if(!n)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)})),n.attributes&&oe((function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")}))||ae("value",(function(e,t,n){if(!n&&"input"===e.nodeName.toLowerCase())return e.defaultValue})),oe((function(e){return null==e.getAttribute("disabled")}))||ae(I,(function(e,t,n){var i;if(!n)return!0===e[t]?t.toLowerCase():(i=e.getAttributeNode(t))&&i.specified?i.value:null})),ie}(n);m.find=x,m.expr=x.selectors,m.expr[":"]=m.expr.pseudos,m.uniqueSort=m.unique=x.uniqueSort,m.text=x.getText,m.isXMLDoc=x.isXML,m.contains=x.contains;var w=function(e,t,n){for(var i=[],r=void 0!==n;(e=e[t])&&9!==e.nodeType;)if(1===e.nodeType){if(r&&m(e).is(n))break;i.push(e)}return i},k=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},E=m.expr.match.needsContext,C=/^<([\w-]+)\s*\/?>(?:<\/\1>|)$/,T=/^.[^:#\[\.,]*$/;function $(e,t,n){if(m.isFunction(t))return m.grep(e,(function(e,i){return!!t.call(e,i,e)!==n}));if(t.nodeType)return m.grep(e,(function(e){return e===t!==n}));if("string"==typeof t){if(T.test(t))return m.filter(t,e,n);t=m.filter(t,e)}return m.grep(e,(function(e){return c.call(t,e)>-1!==n}))}m.filter=function(e,t,n){var i=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===i.nodeType?m.find.matchesSelector(i,e)?[i]:[]:m.find.matches(e,m.grep(t,(function(e){return 1===e.nodeType})))},m.fn.extend({find:function(e){var t,n=this.length,i=[],r=this;if("string"!=typeof e)return this.pushStack(m(e).filter((function(){for(t=0;t<n;t++)if(m.contains(r[t],this))return!0})));for(t=0;t<n;t++)m.find(e,r[t],i);return(i=this.pushStack(n>1?m.unique(i):i)).selector=this.selector?this.selector+" "+e:e,i},filter:function(e){return this.pushStack($(this,e||[],!1))},not:function(e){return this.pushStack($(this,e||[],!0))},is:function(e){return!!$(this,"string"==typeof e&&E.test(e)?m(e):e||[],!1).length}});var S,A=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/;(m.fn.init=function(e,t,n){var i,r;if(!e)return this;if(n=n||S,"string"==typeof e){if(!(i="<"===e[0]&&">"===e[e.length-1]&&e.length>=3?[null,e,null]:A.exec(e))||!i[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(i[1]){if(t=t instanceof m?t[0]:t,m.merge(this,m.parseHTML(i[1],t&&t.nodeType?t.ownerDocument||t:o,!0)),C.test(i[1])&&m.isPlainObject(t))for(i in t)m.isFunction(this[i])?this[i](t[i]):this.attr(i,t[i]);return this}return(r=o.getElementById(i[2]))&&r.parentNode&&(this.length=1,this[0]=r),this.context=o,this.selector=e,this}return e.nodeType?(this.context=this[0]=e,this.length=1,this):m.isFunction(e)?void 0!==n.ready?n.ready(e):e(m):(void 0!==e.selector&&(this.selector=e.selector,this.context=e.context),m.makeArray(e,this))}).prototype=m.fn,S=m(o);var N=/^(?:parents|prev(?:Until|All))/,j={children:!0,contents:!0,next:!0,prev:!0};function D(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}m.fn.extend({has:function(e){var t=m(e,this),n=t.length;return this.filter((function(){for(var e=0;e<n;e++)if(m.contains(this,t[e]))return!0}))},closest:function(e,t){for(var n,i=0,r=this.length,s=[],o=E.test(e)||"string"!=typeof e?m(e,t||this.context):0;i<r;i++)for(n=this[i];n&&n!==t;n=n.parentNode)if(n.nodeType<11&&(o?o.index(n)>-1:1===n.nodeType&&m.find.matchesSelector(n,e))){s.push(n);break}return this.pushStack(s.length>1?m.uniqueSort(s):s)},index:function(e){return e?"string"==typeof e?c.call(m(e),this[0]):c.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(m.uniqueSort(m.merge(this.get(),m(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),m.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return w(e,"parentNode")},parentsUntil:function(e,t,n){return w(e,"parentNode",n)},next:function(e){return D(e,"nextSibling")},prev:function(e){return D(e,"previousSibling")},nextAll:function(e){return w(e,"nextSibling")},prevAll:function(e){return w(e,"previousSibling")},nextUntil:function(e,t,n){return w(e,"nextSibling",n)},prevUntil:function(e,t,n){return w(e,"previousSibling",n)},siblings:function(e){return k((e.parentNode||{}).firstChild,e)},children:function(e){return k(e.firstChild)},contents:function(e){return e.contentDocument||m.merge([],e.childNodes)}},(function(e,t){m.fn[e]=function(n,i){var r=m.map(this,t,n);return"Until"!==e.slice(-5)&&(i=n),i&&"string"==typeof i&&(r=m.filter(i,r)),this.length>1&&(j[e]||m.uniqueSort(r),N.test(e)&&r.reverse()),this.pushStack(r)}}));var R,O=/\S+/g;function I(){o.removeEventListener("DOMContentLoaded",I),n.removeEventListener("load",I),m.ready()}m.Callbacks=function(e){e="string"==typeof e?function(e){var t={};return m.each(e.match(O)||[],(function(e,n){t[n]=!0})),t}(e):m.extend({},e);var t,n,i,r,s=[],o=[],a=-1,u=function(){for(r=e.once,i=t=!0;o.length;a=-1)for(n=o.shift();++a<s.length;)!1===s[a].apply(n[0],n[1])&&e.stopOnFalse&&(a=s.length,n=!1);e.memory||(n=!1),t=!1,r&&(s=n?[]:"")},l={add:function(){return s&&(n&&!t&&(a=s.length-1,o.push(n)),function t(n){m.each(n,(function(n,i){m.isFunction(i)?e.unique&&l.has(i)||s.push(i):i&&i.length&&"string"!==m.type(i)&&t(i)}))}(arguments),n&&!t&&u()),this},remove:function(){return m.each(arguments,(function(e,t){for(var n;(n=m.inArray(t,s,n))>-1;)s.splice(n,1),n<=a&&a--})),this},has:function(e){return e?m.inArray(e,s)>-1:s.length>0},empty:function(){return s&&(s=[]),this},disable:function(){return r=o=[],s=n="",this},disabled:function(){return!s},lock:function(){return r=o=[],n||(s=n=""),this},locked:function(){return!!r},fireWith:function(e,n){return r||(n=[e,(n=n||[]).slice?n.slice():n],o.push(n),t||u()),this},fire:function(){return l.fireWith(this,arguments),this},fired:function(){return!!i}};return l},m.extend({Deferred:function(e){var t=[["resolve","done",m.Callbacks("once memory"),"resolved"],["reject","fail",m.Callbacks("once memory"),"rejected"],["notify","progress",m.Callbacks("memory")]],n="pending",i={state:function(){return n},always:function(){return r.done(arguments).fail(arguments),this},then:function(){var e=arguments;return m.Deferred((function(n){m.each(t,(function(t,s){var o=m.isFunction(e[t])&&e[t];r[s[1]]((function(){var e=o&&o.apply(this,arguments);e&&m.isFunction(e.promise)?e.promise().progress(n.notify).done(n.resolve).fail(n.reject):n[s[0]+"With"](this===i?n.promise():this,o?[e]:arguments)}))})),e=null})).promise()},promise:function(e){return null!=e?m.extend(e,i):i}},r={};return i.pipe=i.then,m.each(t,(function(e,s){var o=s[2],a=s[3];i[s[1]]=o.add,a&&o.add((function(){n=a}),t[1^e][2].disable,t[2][2].lock),r[s[0]]=function(){return r[s[0]+"With"](this===r?i:this,arguments),this},r[s[0]+"With"]=o.fireWith})),i.promise(r),e&&e.call(r,r),r},when:function(e){var t,n,i,r=0,s=a.call(arguments),o=s.length,u=1!==o||e&&m.isFunction(e.promise)?o:0,l=1===u?e:m.Deferred(),c=function(e,n,i){return function(r){n[e]=this,i[e]=arguments.length>1?a.call(arguments):r,i===t?l.notifyWith(n,i):--u||l.resolveWith(n,i)}};if(o>1)for(t=new Array(o),n=new Array(o),i=new Array(o);r<o;r++)s[r]&&m.isFunction(s[r].promise)?s[r].promise().progress(c(r,n,t)).done(c(r,i,s)).fail(l.reject):--u;return u||l.resolveWith(i,s),l.promise()}}),m.fn.ready=function(e){return m.ready.promise().done(e),this},m.extend({isReady:!1,readyWait:1,holdReady:function(e){e?m.readyWait++:m.ready(!0)},ready:function(e){(!0===e?--m.readyWait:m.isReady)||(m.isReady=!0,!0!==e&&--m.readyWait>0||(R.resolveWith(o,[m]),m.fn.triggerHandler&&(m(o).triggerHandler("ready"),m(o).off("ready"))))}}),m.ready.promise=function(e){return R||(R=m.Deferred(),"complete"===o.readyState||"loading"!==o.readyState&&!o.documentElement.doScroll?n.setTimeout(m.ready):(o.addEventListener("DOMContentLoaded",I),n.addEventListener("load",I))),R.promise(e)},m.ready.promise();var F=function(e,t,n,i,r,s,o){var a=0,u=e.length,l=null==n;if("object"===m.type(n))for(a in r=!0,n)F(e,t,a,n[a],!0,s,o);else if(void 0!==i&&(r=!0,m.isFunction(i)||(o=!0),l&&(o?(t.call(e,i),t=null):(l=t,t=function(e,t,n){return l.call(m(e),n)})),t))for(;a<u;a++)t(e[a],n,o?i:i.call(e[a],a,t(e[a],n)));return r?e:l?t.call(e):u?t(e[0],n):s},P=function(e){return 1===e.nodeType||9===e.nodeType||!+e.nodeType};function H(){this.expando=m.expando+H.uid++}H.uid=1,H.prototype={register:function(e,t){var n=t||{};return e.nodeType?e[this.expando]=n:Object.defineProperty(e,this.expando,{value:n,writable:!0,configurable:!0}),e[this.expando]},cache:function(e){if(!P(e))return{};var t=e[this.expando];return t||(t={},P(e)&&(e.nodeType?e[this.expando]=t:Object.defineProperty(e,this.expando,{value:t,configurable:!0}))),t},set:function(e,t,n){var i,r=this.cache(e);if("string"==typeof t)r[t]=n;else for(i in t)r[i]=t[i];return r},get:function(e,t){return void 0===t?this.cache(e):e[this.expando]&&e[this.expando][t]},access:function(e,t,n){var i;return void 0===t||t&&"string"==typeof t&&void 0===n?void 0!==(i=this.get(e,t))?i:this.get(e,m.camelCase(t)):(this.set(e,t,n),void 0!==n?n:t)},remove:function(e,t){var n,i,r,s=e[this.expando];if(void 0!==s){if(void 0===t)this.register(e);else{m.isArray(t)?i=t.concat(t.map(m.camelCase)):(r=m.camelCase(t),i=t in s?[t,r]:(i=r)in s?[i]:i.match(O)||[]),n=i.length;for(;n--;)delete s[i[n]]}(void 0===t||m.isEmptyObject(s))&&(e.nodeType?e[this.expando]=void 0:delete e[this.expando])}},hasData:function(e){var t=e[this.expando];return void 0!==t&&!m.isEmptyObject(t)}};var L=new H,M=new H,V=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,W=/[A-Z]/g;function B(e,t,n){var i;if(void 0===n&&1===e.nodeType)if(i="data-"+t.replace(W,"-$&").toLowerCase(),"string"==typeof(n=e.getAttribute(i))){try{n="true"===n||"false"!==n&&("null"===n?null:+n+""===n?+n:V.test(n)?m.parseJSON(n):n)}catch(e){}M.set(e,t,n)}else n=void 0;return n}m.extend({hasData:function(e){return M.hasData(e)||L.hasData(e)},data:function(e,t,n){return M.access(e,t,n)},removeData:function(e,t){M.remove(e,t)},_data:function(e,t,n){return L.access(e,t,n)},_removeData:function(e,t){L.remove(e,t)}}),m.fn.extend({data:function(e,t){var n,i,r,s=this[0],o=s&&s.attributes;if(void 0===e){if(this.length&&(r=M.get(s),1===s.nodeType&&!L.get(s,"hasDataAttrs"))){for(n=o.length;n--;)o[n]&&0===(i=o[n].name).indexOf("data-")&&(i=m.camelCase(i.slice(5)),B(s,i,r[i]));L.set(s,"hasDataAttrs",!0)}return r}return"object"==typeof e?this.each((function(){M.set(this,e)})):F(this,(function(t){var n,i;if(s&&void 0===t)return void 0!==(n=M.get(s,e)||M.get(s,e.replace(W,"-$&").toLowerCase()))?n:(i=m.camelCase(e),void 0!==(n=M.get(s,i))||void 0!==(n=B(s,i,void 0))?n:void 0);i=m.camelCase(e),this.each((function(){var n=M.get(this,i);M.set(this,i,t),e.indexOf("-")>-1&&void 0!==n&&M.set(this,e,t)}))}),null,t,arguments.length>1,null,!0)},removeData:function(e){return this.each((function(){M.remove(this,e)}))}}),m.extend({queue:function(e,t,n){var i;if(e)return t=(t||"fx")+"queue",i=L.get(e,t),n&&(!i||m.isArray(n)?i=L.access(e,t,m.makeArray(n)):i.push(n)),i||[]},dequeue:function(e,t){t=t||"fx";var n=m.queue(e,t),i=n.length,r=n.shift(),s=m._queueHooks(e,t);"inprogress"===r&&(r=n.shift(),i--),r&&("fx"===t&&n.unshift("inprogress"),delete s.stop,r.call(e,(function(){m.dequeue(e,t)}),s)),!i&&s&&s.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return L.get(e,n)||L.access(e,n,{empty:m.Callbacks("once memory").add((function(){L.remove(e,[t+"queue",n])}))})}}),m.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&&(t=e,e="fx",n--),arguments.length<n?m.queue(this[0],e):void 0===t?this:this.each((function(){var n=m.queue(this,e,t);m._queueHooks(this,e),"fx"===e&&"inprogress"!==n[0]&&m.dequeue(this,e)}))},dequeue:function(e){return this.each((function(){m.dequeue(this,e)}))},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){var n,i=1,r=m.Deferred(),s=this,o=this.length,a=function(){--i||r.resolveWith(s,[s])};for("string"!=typeof e&&(t=e,e=void 0),e=e||"fx";o--;)(n=L.get(s[o],e+"queueHooks"))&&n.empty&&(i++,n.empty.add(a));return a(),r.promise(t)}});var q=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,U=new RegExp("^(?:([+-])=|)("+q+")([a-z%]*)$","i"),z=["Top","Right","Bottom","Left"],G=function(e,t){return e=t||e,"none"===m.css(e,"display")||!m.contains(e.ownerDocument,e)};function J(e,t,n,i){var r,s=1,o=20,a=i?function(){return i.cur()}:function(){return m.css(e,t,"")},u=a(),l=n&&n[3]||(m.cssNumber[t]?"":"px"),c=(m.cssNumber[t]||"px"!==l&&+u)&&U.exec(m.css(e,t));if(c&&c[3]!==l){l=l||c[3],n=n||[],c=+u||1;do{c/=s=s||".5",m.style(e,t,c+l)}while(s!==(s=a()/u)&&1!==s&&--o)}return n&&(c=+c||+u||0,r=n[1]?c+(n[1]+1)*n[2]:+n[2],i&&(i.unit=l,i.start=c,i.end=r)),r}var X=/^(?:checkbox|radio)$/i,Y=/<([\w:-]+)/,K=/^$|\/(?:java|ecma)script/i,Q={option:[1,"<select multiple='multiple'>","</select>"],thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};function Z(e,t){var n=void 0!==e.getElementsByTagName?e.getElementsByTagName(t||"*"):void 0!==e.querySelectorAll?e.querySelectorAll(t||"*"):[];return void 0===t||t&&m.nodeName(e,t)?m.merge([e],n):n}function ee(e,t){for(var n=0,i=e.length;n<i;n++)L.set(e[n],"globalEval",!t||L.get(t[n],"globalEval"))}Q.optgroup=Q.option,Q.tbody=Q.tfoot=Q.colgroup=Q.caption=Q.thead,Q.th=Q.td;var te,ne,ie=/<|&#?\w+;/;function re(e,t,n,i,r){for(var s,o,a,u,l,c,d=t.createDocumentFragment(),h=[],f=0,p=e.length;f<p;f++)if((s=e[f])||0===s)if("object"===m.type(s))m.merge(h,s.nodeType?[s]:s);else if(ie.test(s)){for(o=o||d.appendChild(t.createElement("div")),a=(Y.exec(s)||["",""])[1].toLowerCase(),u=Q[a]||Q._default,o.innerHTML=u[1]+m.htmlPrefilter(s)+u[2],c=u[0];c--;)o=o.lastChild;m.merge(h,o.childNodes),(o=d.firstChild).textContent=""}else h.push(t.createTextNode(s));for(d.textContent="",f=0;s=h[f++];)if(i&&m.inArray(s,i)>-1)r&&r.push(s);else if(l=m.contains(s.ownerDocument,s),o=Z(d.appendChild(s),"script"),l&&ee(o),n)for(c=0;s=o[c++];)K.test(s.type||"")&&n.push(s);return d}te=o.createDocumentFragment().appendChild(o.createElement("div")),(ne=o.createElement("input")).setAttribute("type","radio"),ne.setAttribute("checked","checked"),ne.setAttribute("name","t"),te.appendChild(ne),p.checkClone=te.cloneNode(!0).cloneNode(!0).lastChild.checked,te.innerHTML="<textarea>x</textarea>",p.noCloneChecked=!!te.cloneNode(!0).lastChild.defaultValue;var se=/^key/,oe=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,ae=/^([^.]*)(?:\.(.+)|)/;function ue(){return!0}function le(){return!1}function ce(){try{return o.activeElement}catch(e){}}function de(e,t,n,i,r,s){var o,a;if("object"==typeof t){for(a in"string"!=typeof n&&(i=i||n,n=void 0),t)de(e,a,n,i,t[a],s);return e}if(null==i&&null==r?(r=n,i=n=void 0):null==r&&("string"==typeof n?(r=i,i=void 0):(r=i,i=n,n=void 0)),!1===r)r=le;else if(!r)return e;return 1===s&&(o=r,(r=function(e){return m().off(e),o.apply(this,arguments)}).guid=o.guid||(o.guid=m.guid++)),e.each((function(){m.event.add(this,t,r,i,n)}))}m.event={global:{},add:function(e,t,n,i,r){var s,o,a,u,l,c,d,h,f,p,v,g=L.get(e);if(g)for(n.handler&&(n=(s=n).handler,r=s.selector),n.guid||(n.guid=m.guid++),(u=g.events)||(u=g.events={}),(o=g.handle)||(o=g.handle=function(t){return void 0!==m&&m.event.triggered!==t.type?m.event.dispatch.apply(e,arguments):void 0}),l=(t=(t||"").match(O)||[""]).length;l--;)f=v=(a=ae.exec(t[l])||[])[1],p=(a[2]||"").split(".").sort(),f&&(d=m.event.special[f]||{},f=(r?d.delegateType:d.bindType)||f,d=m.event.special[f]||{},c=m.extend({type:f,origType:v,data:i,handler:n,guid:n.guid,selector:r,needsContext:r&&m.expr.match.needsContext.test(r),namespace:p.join(".")},s),(h=u[f])||((h=u[f]=[]).delegateCount=0,d.setup&&!1!==d.setup.call(e,i,p,o)||e.addEventListener&&e.addEventListener(f,o)),d.add&&(d.add.call(e,c),c.handler.guid||(c.handler.guid=n.guid)),r?h.splice(h.delegateCount++,0,c):h.push(c),m.event.global[f]=!0)},remove:function(e,t,n,i,r){var s,o,a,u,l,c,d,h,f,p,v,g=L.hasData(e)&&L.get(e);if(g&&(u=g.events)){for(l=(t=(t||"").match(O)||[""]).length;l--;)if(f=v=(a=ae.exec(t[l])||[])[1],p=(a[2]||"").split(".").sort(),f){for(d=m.event.special[f]||{},h=u[f=(i?d.delegateType:d.bindType)||f]||[],a=a[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),o=s=h.length;s--;)c=h[s],!r&&v!==c.origType||n&&n.guid!==c.guid||a&&!a.test(c.namespace)||i&&i!==c.selector&&("**"!==i||!c.selector)||(h.splice(s,1),c.selector&&h.delegateCount--,d.remove&&d.remove.call(e,c));o&&!h.length&&(d.teardown&&!1!==d.teardown.call(e,p,g.handle)||m.removeEvent(e,f,g.handle),delete u[f])}else for(f in u)m.event.remove(e,f+t[l],n,i,!0);m.isEmptyObject(u)&&L.remove(e,"handle events")}},dispatch:function(e){e=m.event.fix(e);var t,n,i,r,s,o=[],u=a.call(arguments),l=(L.get(this,"events")||{})[e.type]||[],c=m.event.special[e.type]||{};if(u[0]=e,e.delegateTarget=this,!c.preDispatch||!1!==c.preDispatch.call(this,e)){for(o=m.event.handlers.call(this,e,l),t=0;(r=o[t++])&&!e.isPropagationStopped();)for(e.currentTarget=r.elem,n=0;(s=r.handlers[n++])&&!e.isImmediatePropagationStopped();)e.rnamespace&&!e.rnamespace.test(s.namespace)||(e.handleObj=s,e.data=s.data,void 0!==(i=((m.event.special[s.origType]||{}).handle||s.handler).apply(r.elem,u))&&!1===(e.result=i)&&(e.preventDefault(),e.stopPropagation()));return c.postDispatch&&c.postDispatch.call(this,e),e.result}},handlers:function(e,t){var n,i,r,s,o=[],a=t.delegateCount,u=e.target;if(a&&u.nodeType&&("click"!==e.type||isNaN(e.button)||e.button<1))for(;u!==this;u=u.parentNode||this)if(1===u.nodeType&&(!0!==u.disabled||"click"!==e.type)){for(i=[],n=0;n<a;n++)void 0===i[r=(s=t[n]).selector+" "]&&(i[r]=s.needsContext?m(r,this).index(u)>-1:m.find(r,this,null,[u]).length),i[r]&&i.push(s);i.length&&o.push({elem:u,handlers:i})}return a<t.length&&o.push({elem:this,handlers:t.slice(a)}),o},props:"altKey bubbles cancelable ctrlKey currentTarget detail eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(e,t){return null==e.which&&(e.which=null!=t.charCode?t.charCode:t.keyCode),e}},mouseHooks:{props:"button buttons clientX clientY offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(e,t){var n,i,r,s=t.button;return null==e.pageX&&null!=t.clientX&&(i=(n=e.target.ownerDocument||o).documentElement,r=n.body,e.pageX=t.clientX+(i&&i.scrollLeft||r&&r.scrollLeft||0)-(i&&i.clientLeft||r&&r.clientLeft||0),e.pageY=t.clientY+(i&&i.scrollTop||r&&r.scrollTop||0)-(i&&i.clientTop||r&&r.clientTop||0)),e.which||void 0===s||(e.which=1&s?1:2&s?3:4&s?2:0),e}},fix:function(e){if(e[m.expando])return e;var t,n,i,r=e.type,s=e,a=this.fixHooks[r];for(a||(this.fixHooks[r]=a=oe.test(r)?this.mouseHooks:se.test(r)?this.keyHooks:{}),i=a.props?this.props.concat(a.props):this.props,e=new m.Event(s),t=i.length;t--;)e[n=i[t]]=s[n];return e.target||(e.target=o),3===e.target.nodeType&&(e.target=e.target.parentNode),a.filter?a.filter(e,s):e},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==ce()&&this.focus)return this.focus(),!1},delegateType:"focusin"},blur:{trigger:function(){if(this===ce()&&this.blur)return this.blur(),!1},delegateType:"focusout"},click:{trigger:function(){if("checkbox"===this.type&&this.click&&m.nodeName(this,"input"))return this.click(),!1},_default:function(e){return m.nodeName(e.target,"a")}},beforeunload:{postDispatch:function(e){void 0!==e.result&&e.originalEvent&&(e.originalEvent.returnValue=e.result)}}}},m.removeEvent=function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n)},m.Event=function(e,t){if(!(this instanceof m.Event))return new m.Event(e,t);e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||void 0===e.defaultPrevented&&!1===e.returnValue?ue:le):this.type=e,t&&m.extend(this,t),this.timeStamp=e&&e.timeStamp||m.now(),this[m.expando]=!0},m.Event.prototype={constructor:m.Event,isDefaultPrevented:le,isPropagationStopped:le,isImmediatePropagationStopped:le,isSimulated:!1,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=ue,e&&!this.isSimulated&&e.preventDefault()},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=ue,e&&!this.isSimulated&&e.stopPropagation()},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=ue,e&&!this.isSimulated&&e.stopImmediatePropagation(),this.stopPropagation()}},m.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},(function(e,t){m.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,i=this,r=e.relatedTarget,s=e.handleObj;return r&&(r===i||m.contains(i,r))||(e.type=s.origType,n=s.handler.apply(this,arguments),e.type=t),n}}})),m.fn.extend({on:function(e,t,n,i){return de(this,e,t,n,i)},one:function(e,t,n,i){return de(this,e,t,n,i,1)},off:function(e,t,n){var i,r;if(e&&e.preventDefault&&e.handleObj)return i=e.handleObj,m(e.delegateTarget).off(i.namespace?i.origType+"."+i.namespace:i.origType,i.selector,i.handler),this;if("object"==typeof e){for(r in e)this.off(r,t,e[r]);return this}return!1!==t&&"function"!=typeof t||(n=t,t=void 0),!1===n&&(n=le),this.each((function(){m.event.remove(this,e,n,t)}))}});var he=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:-]+)[^>]*)\/>/gi,fe=/<script|<style|<link/i,pe=/checked\s*(?:[^=]|=\s*.checked.)/i,me=/^true\/(.*)/,ve=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;function ge(e,t){return m.nodeName(e,"table")&&m.nodeName(11!==t.nodeType?t:t.firstChild,"tr")?e.getElementsByTagName("tbody")[0]||e.appendChild(e.ownerDocument.createElement("tbody")):e}function ye(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function be(e){var t=me.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function _e(e,t){var n,i,r,s,o,a,u,l;if(1===t.nodeType){if(L.hasData(e)&&(s=L.access(e),o=L.set(t,s),l=s.events))for(r in delete o.handle,o.events={},l)for(n=0,i=l[r].length;n<i;n++)m.event.add(t,r,l[r][n]);M.hasData(e)&&(a=M.access(e),u=m.extend({},a),M.set(t,u))}}function xe(e,t,n,i){t=u.apply([],t);var r,s,o,a,l,c,d=0,h=e.length,f=h-1,v=t[0],g=m.isFunction(v);if(g||h>1&&"string"==typeof v&&!p.checkClone&&pe.test(v))return e.each((function(r){var s=e.eq(r);g&&(t[0]=v.call(this,r,s.html())),xe(s,t,n,i)}));if(h&&(s=(r=re(t,e[0].ownerDocument,!1,e,i)).firstChild,1===r.childNodes.length&&(r=s),s||i)){for(a=(o=m.map(Z(r,"script"),ye)).length;d<h;d++)l=r,d!==f&&(l=m.clone(l,!0,!0),a&&m.merge(o,Z(l,"script"))),n.call(e[d],l,d);if(a)for(c=o[o.length-1].ownerDocument,m.map(o,be),d=0;d<a;d++)l=o[d],K.test(l.type||"")&&!L.access(l,"globalEval")&&m.contains(c,l)&&(l.src?m._evalUrl&&m._evalUrl(l.src):m.globalEval(l.textContent.replace(ve,"")))}return e}function we(e,t,n){for(var i,r=t?m.filter(t,e):e,s=0;null!=(i=r[s]);s++)n||1!==i.nodeType||m.cleanData(Z(i)),i.parentNode&&(n&&m.contains(i.ownerDocument,i)&&ee(Z(i,"script")),i.parentNode.removeChild(i));return e}m.extend({htmlPrefilter:function(e){return e.replace(he,"<$1></$2>")},clone:function(e,t,n){var i,r,s,o,a,u,l,c=e.cloneNode(!0),d=m.contains(e.ownerDocument,e);if(!(p.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||m.isXMLDoc(e)))for(o=Z(c),i=0,r=(s=Z(e)).length;i<r;i++)a=s[i],u=o[i],l=void 0,"input"===(l=u.nodeName.toLowerCase())&&X.test(a.type)?u.checked=a.checked:"input"!==l&&"textarea"!==l||(u.defaultValue=a.defaultValue);if(t)if(n)for(s=s||Z(e),o=o||Z(c),i=0,r=s.length;i<r;i++)_e(s[i],o[i]);else _e(e,c);return(o=Z(c,"script")).length>0&&ee(o,!d&&Z(e,"script")),c},cleanData:function(e){for(var t,n,i,r=m.event.special,s=0;void 0!==(n=e[s]);s++)if(P(n)){if(t=n[L.expando]){if(t.events)for(i in t.events)r[i]?m.event.remove(n,i):m.removeEvent(n,i,t.handle);n[L.expando]=void 0}n[M.expando]&&(n[M.expando]=void 0)}}}),m.fn.extend({domManip:xe,detach:function(e){return we(this,e,!0)},remove:function(e){return we(this,e)},text:function(e){return F(this,(function(e){return void 0===e?m.text(this):this.empty().each((function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)}))}),null,e,arguments.length)},append:function(){return xe(this,arguments,(function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||ge(this,e).appendChild(e)}))},prepend:function(){return xe(this,arguments,(function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=ge(this,e);t.insertBefore(e,t.firstChild)}}))},before:function(){return xe(this,arguments,(function(e){this.parentNode&&this.parentNode.insertBefore(e,this)}))},after:function(){return xe(this,arguments,(function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)}))},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(m.cleanData(Z(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map((function(){return m.clone(this,e,t)}))},html:function(e){return F(this,(function(e){var t=this[0]||{},n=0,i=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!fe.test(e)&&!Q[(Y.exec(e)||["",""])[1].toLowerCase()]){e=m.htmlPrefilter(e);try{for(;n<i;n++)1===(t=this[n]||{}).nodeType&&(m.cleanData(Z(t,!1)),t.innerHTML=e);t=0}catch(e){}}t&&this.empty().append(e)}),null,e,arguments.length)},replaceWith:function(){var e=[];return xe(this,arguments,(function(t){var n=this.parentNode;m.inArray(this,e)<0&&(m.cleanData(Z(this)),n&&n.replaceChild(t,this))}),e)}}),m.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},(function(e,t){m.fn[e]=function(e){for(var n,i=[],r=m(e),s=r.length-1,o=0;o<=s;o++)n=o===s?this:this.clone(!0),m(r[o])[t](n),l.apply(i,n.get());return this.pushStack(i)}}));var ke,Ee={HTML:"block",BODY:"block"};function Ce(e,t){var n=m(t.createElement(e)).appendTo(t.body),i=m.css(n[0],"display");return n.detach(),i}function Te(e){var t=o,n=Ee[e];return n||("none"!==(n=Ce(e,t))&&n||((t=(ke=(ke||m("<iframe frameborder='0' width='0' height='0'/>")).appendTo(t.documentElement))[0].contentDocument).write(),t.close(),n=Ce(e,t),ke.detach()),Ee[e]=n),n}var $e=/^margin/,Se=new RegExp("^("+q+")(?!px)[a-z%]+$","i"),Ae=function(e){var t=e.ownerDocument.defaultView;return t&&t.opener||(t=n),t.getComputedStyle(e)},Ne=function(e,t,n,i){var r,s,o={};for(s in t)o[s]=e.style[s],e.style[s]=t[s];for(s in r=n.apply(e,i||[]),t)e.style[s]=o[s];return r},je=o.documentElement;function De(e,t,n){var i,r,s,o,a=e.style;return""!==(o=(n=n||Ae(e))?n.getPropertyValue(t)||n[t]:void 0)&&void 0!==o||m.contains(e.ownerDocument,e)||(o=m.style(e,t)),n&&!p.pixelMarginRight()&&Se.test(o)&&$e.test(t)&&(i=a.width,r=a.minWidth,s=a.maxWidth,a.minWidth=a.maxWidth=a.width=o,o=n.width,a.width=i,a.minWidth=r,a.maxWidth=s),void 0!==o?o+"":o}function Re(e,t){return{get:function(){if(!e())return(this.get=t).apply(this,arguments);delete this.get}}}!function(){var e,t,i,r,s=o.createElement("div"),a=o.createElement("div");function u(){a.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;position:relative;display:block;margin:auto;border:1px;padding:1px;top:1%;width:50%",a.innerHTML="",je.appendChild(s);var o=n.getComputedStyle(a);e="1%"!==o.top,r="2px"===o.marginLeft,t="4px"===o.width,a.style.marginRight="50%",i="4px"===o.marginRight,je.removeChild(s)}a.style&&(a.style.backgroundClip="content-box",a.cloneNode(!0).style.backgroundClip="",p.clearCloneStyle="content-box"===a.style.backgroundClip,s.style.cssText="border:0;width:8px;height:0;top:0;left:-9999px;padding:0;margin-top:1px;position:absolute",s.appendChild(a),m.extend(p,{pixelPosition:function(){return u(),e},boxSizingReliable:function(){return null==t&&u(),t},pixelMarginRight:function(){return null==t&&u(),i},reliableMarginLeft:function(){return null==t&&u(),r},reliableMarginRight:function(){var e,t=a.appendChild(o.createElement("div"));return t.style.cssText=a.style.cssText="-webkit-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0",t.style.marginRight=t.style.width="0",a.style.width="1px",je.appendChild(s),e=!parseFloat(n.getComputedStyle(t).marginRight),je.removeChild(s),a.removeChild(t),e}}))}();var Oe=/^(none|table(?!-c[ea]).+)/,Ie={position:"absolute",visibility:"hidden",display:"block"},Fe={letterSpacing:"0",fontWeight:"400"},Pe=["Webkit","O","Moz","ms"],He=o.createElement("div").style;function Le(e){if(e in He)return e;for(var t=e[0].toUpperCase()+e.slice(1),n=Pe.length;n--;)if((e=Pe[n]+t)in He)return e}function Me(e,t,n){var i=U.exec(t);return i?Math.max(0,i[2]-(n||0))+(i[3]||"px"):t}function Ve(e,t,n,i,r){for(var s=n===(i?"border":"content")?4:"width"===t?1:0,o=0;s<4;s+=2)"margin"===n&&(o+=m.css(e,n+z[s],!0,r)),i?("content"===n&&(o-=m.css(e,"padding"+z[s],!0,r)),"margin"!==n&&(o-=m.css(e,"border"+z[s]+"Width",!0,r))):(o+=m.css(e,"padding"+z[s],!0,r),"padding"!==n&&(o+=m.css(e,"border"+z[s]+"Width",!0,r)));return o}function We(e,t,n){var i=!0,r="width"===t?e.offsetWidth:e.offsetHeight,s=Ae(e),o="border-box"===m.css(e,"boxSizing",!1,s);if(r<=0||null==r){if(((r=De(e,t,s))<0||null==r)&&(r=e.style[t]),Se.test(r))return r;i=o&&(p.boxSizingReliable()||r===e.style[t]),r=parseFloat(r)||0}return r+Ve(e,t,n||(o?"border":"content"),i,s)+"px"}function Be(e,t){for(var n,i,r,s=[],o=0,a=e.length;o<a;o++)(i=e[o]).style&&(s[o]=L.get(i,"olddisplay"),n=i.style.display,t?(s[o]||"none"!==n||(i.style.display=""),""===i.style.display&&G(i)&&(s[o]=L.access(i,"olddisplay",Te(i.nodeName)))):(r=G(i),"none"===n&&r||L.set(i,"olddisplay",r?n:m.css(i,"display"))));for(o=0;o<a;o++)(i=e[o]).style&&(t&&"none"!==i.style.display&&""!==i.style.display||(i.style.display=t?s[o]||"":"none"));return e}function qe(e,t,n,i,r){return new qe.prototype.init(e,t,n,i,r)}m.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=De(e,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{float:"cssFloat"},style:function(e,t,n,i){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var r,s,o,a=m.camelCase(t),u=e.style;if(t=m.cssProps[a]||(m.cssProps[a]=Le(a)||a),o=m.cssHooks[t]||m.cssHooks[a],void 0===n)return o&&"get"in o&&void 0!==(r=o.get(e,!1,i))?r:u[t];"string"==(s=typeof n)&&(r=U.exec(n))&&r[1]&&(n=J(e,t,r),s="number"),null!=n&&n==n&&("number"===s&&(n+=r&&r[3]||(m.cssNumber[a]?"":"px")),p.clearCloneStyle||""!==n||0!==t.indexOf("background")||(u[t]="inherit"),o&&"set"in o&&void 0===(n=o.set(e,n,i))||(u[t]=n))}},css:function(e,t,n,i){var r,s,o,a=m.camelCase(t);return t=m.cssProps[a]||(m.cssProps[a]=Le(a)||a),(o=m.cssHooks[t]||m.cssHooks[a])&&"get"in o&&(r=o.get(e,!0,n)),void 0===r&&(r=De(e,t,i)),"normal"===r&&t in Fe&&(r=Fe[t]),""===n||n?(s=parseFloat(r),!0===n||isFinite(s)?s||0:r):r}}),m.each(["height","width"],(function(e,t){m.cssHooks[t]={get:function(e,n,i){if(n)return Oe.test(m.css(e,"display"))&&0===e.offsetWidth?Ne(e,Ie,(function(){return We(e,t,i)})):We(e,t,i)},set:function(e,n,i){var r,s=i&&Ae(e),o=i&&Ve(e,t,i,"border-box"===m.css(e,"boxSizing",!1,s),s);return o&&(r=U.exec(n))&&"px"!==(r[3]||"px")&&(e.style[t]=n,n=m.css(e,t)),Me(0,n,o)}}})),m.cssHooks.marginLeft=Re(p.reliableMarginLeft,(function(e,t){if(t)return(parseFloat(De(e,"marginLeft"))||e.getBoundingClientRect().left-Ne(e,{marginLeft:0},(function(){return e.getBoundingClientRect().left})))+"px"})),m.cssHooks.marginRight=Re(p.reliableMarginRight,(function(e,t){if(t)return Ne(e,{display:"inline-block"},De,[e,"marginRight"])})),m.each({margin:"",padding:"",border:"Width"},(function(e,t){m.cssHooks[e+t]={expand:function(n){for(var i=0,r={},s="string"==typeof n?n.split(" "):[n];i<4;i++)r[e+z[i]+t]=s[i]||s[i-2]||s[0];return r}},$e.test(e)||(m.cssHooks[e+t].set=Me)})),m.fn.extend({css:function(e,t){return F(this,(function(e,t,n){var i,r,s={},o=0;if(m.isArray(t)){for(i=Ae(e),r=t.length;o<r;o++)s[t[o]]=m.css(e,t[o],!1,i);return s}return void 0!==n?m.style(e,t,n):m.css(e,t)}),e,t,arguments.length>1)},show:function(){return Be(this,!0)},hide:function(){return Be(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each((function(){G(this)?m(this).show():m(this).hide()}))}}),m.Tween=qe,qe.prototype={constructor:qe,init:function(e,t,n,i,r,s){this.elem=e,this.prop=n,this.easing=r||m.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=i,this.unit=s||(m.cssNumber[n]?"":"px")},cur:function(){var e=qe.propHooks[this.prop];return e&&e.get?e.get(this):qe.propHooks._default.get(this)},run:function(e){var t,n=qe.propHooks[this.prop];return this.options.duration?this.pos=t=m.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):qe.propHooks._default.set(this),this}},qe.prototype.init.prototype=qe.prototype,qe.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=m.css(e.elem,e.prop,""))&&"auto"!==t?t:0},set:function(e){m.fx.step[e.prop]?m.fx.step[e.prop](e):1!==e.elem.nodeType||null==e.elem.style[m.cssProps[e.prop]]&&!m.cssHooks[e.prop]?e.elem[e.prop]=e.now:m.style(e.elem,e.prop,e.now+e.unit)}}},qe.propHooks.scrollTop=qe.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},m.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},m.fx=qe.prototype.init,m.fx.step={};var Ue,ze,Ge=/^(?:toggle|show|hide)$/,Je=/queueHooks$/;function Xe(){return n.setTimeout((function(){Ue=void 0})),Ue=m.now()}function Ye(e,t){var n,i=0,r={height:e};for(t=t?1:0;i<4;i+=2-t)r["margin"+(n=z[i])]=r["padding"+n]=e;return t&&(r.opacity=r.width=e),r}function Ke(e,t,n){for(var i,r=(Qe.tweeners[t]||[]).concat(Qe.tweeners["*"]),s=0,o=r.length;s<o;s++)if(i=r[s].call(n,t,e))return i}function Qe(e,t,n){var i,r,s=0,o=Qe.prefilters.length,a=m.Deferred().always((function(){delete u.elem})),u=function(){if(r)return!1;for(var t=Ue||Xe(),n=Math.max(0,l.startTime+l.duration-t),i=1-(n/l.duration||0),s=0,o=l.tweens.length;s<o;s++)l.tweens[s].run(i);return a.notifyWith(e,[l,i,n]),i<1&&o?n:(a.resolveWith(e,[l]),!1)},l=a.promise({elem:e,props:m.extend({},t),opts:m.extend(!0,{specialEasing:{},easing:m.easing._default},n),originalProperties:t,originalOptions:n,startTime:Ue||Xe(),duration:n.duration,tweens:[],createTween:function(t,n){var i=m.Tween(e,l.opts,t,n,l.opts.specialEasing[t]||l.opts.easing);return l.tweens.push(i),i},stop:function(t){var n=0,i=t?l.tweens.length:0;if(r)return this;for(r=!0;n<i;n++)l.tweens[n].run(1);return t?(a.notifyWith(e,[l,1,0]),a.resolveWith(e,[l,t])):a.rejectWith(e,[l,t]),this}}),c=l.props;for(function(e,t){var n,i,r,s,o;for(n in e)if(r=t[i=m.camelCase(n)],s=e[n],m.isArray(s)&&(r=s[1],s=e[n]=s[0]),n!==i&&(e[i]=s,delete e[n]),(o=m.cssHooks[i])&&"expand"in o)for(n in s=o.expand(s),delete e[i],s)n in e||(e[n]=s[n],t[n]=r);else t[i]=r}(c,l.opts.specialEasing);s<o;s++)if(i=Qe.prefilters[s].call(l,e,c,l.opts))return m.isFunction(i.stop)&&(m._queueHooks(l.elem,l.opts.queue).stop=m.proxy(i.stop,i)),i;return m.map(c,Ke,l),m.isFunction(l.opts.start)&&l.opts.start.call(e,l),m.fx.timer(m.extend(u,{elem:e,anim:l,queue:l.opts.queue})),l.progress(l.opts.progress).done(l.opts.done,l.opts.complete).fail(l.opts.fail).always(l.opts.always)}m.Animation=m.extend(Qe,{tweeners:{"*":[function(e,t){var n=this.createTween(e,t);return J(n.elem,e,U.exec(t),n),n}]},tweener:function(e,t){m.isFunction(e)?(t=e,e=["*"]):e=e.match(O);for(var n,i=0,r=e.length;i<r;i++)n=e[i],Qe.tweeners[n]=Qe.tweeners[n]||[],Qe.tweeners[n].unshift(t)},prefilters:[function(e,t,n){var i,r,s,o,a,u,l,c=this,d={},h=e.style,f=e.nodeType&&G(e),p=L.get(e,"fxshow");for(i in n.queue||(null==(a=m._queueHooks(e,"fx")).unqueued&&(a.unqueued=0,u=a.empty.fire,a.empty.fire=function(){a.unqueued||u()}),a.unqueued++,c.always((function(){c.always((function(){a.unqueued--,m.queue(e,"fx").length||a.empty.fire()}))}))),1===e.nodeType&&("height"in t||"width"in t)&&(n.overflow=[h.overflow,h.overflowX,h.overflowY],"inline"===("none"===(l=m.css(e,"display"))?L.get(e,"olddisplay")||Te(e.nodeName):l)&&"none"===m.css(e,"float")&&(h.display="inline-block")),n.overflow&&(h.overflow="hidden",c.always((function(){h.overflow=n.overflow[0],h.overflowX=n.overflow[1],h.overflowY=n.overflow[2]}))),t)if(r=t[i],Ge.exec(r)){if(delete t[i],s=s||"toggle"===r,r===(f?"hide":"show")){if("show"!==r||!p||void 0===p[i])continue;f=!0}d[i]=p&&p[i]||m.style(e,i)}else l=void 0;if(m.isEmptyObject(d))"inline"===("none"===l?Te(e.nodeName):l)&&(h.display=l);else for(i in p?"hidden"in p&&(f=p.hidden):p=L.access(e,"fxshow",{}),s&&(p.hidden=!f),f?m(e).show():c.done((function(){m(e).hide()})),c.done((function(){var t;for(t in L.remove(e,"fxshow"),d)m.style(e,t,d[t])})),d)o=Ke(f?p[i]:0,i,c),i in p||(p[i]=o.start,f&&(o.end=o.start,o.start="width"===i||"height"===i?1:0))}],prefilter:function(e,t){t?Qe.prefilters.unshift(e):Qe.prefilters.push(e)}}),m.speed=function(e,t,n){var i=e&&"object"==typeof e?m.extend({},e):{complete:n||!n&&t||m.isFunction(e)&&e,duration:e,easing:n&&t||t&&!m.isFunction(t)&&t};return i.duration=m.fx.off?0:"number"==typeof i.duration?i.duration:i.duration in m.fx.speeds?m.fx.speeds[i.duration]:m.fx.speeds._default,null!=i.queue&&!0!==i.queue||(i.queue="fx"),i.old=i.complete,i.complete=function(){m.isFunction(i.old)&&i.old.call(this),i.queue&&m.dequeue(this,i.queue)},i},m.fn.extend({fadeTo:function(e,t,n,i){return this.filter(G).css("opacity",0).show().end().animate({opacity:t},e,n,i)},animate:function(e,t,n,i){var r=m.isEmptyObject(e),s=m.speed(t,n,i),o=function(){var t=Qe(this,m.extend({},e),s);(r||L.get(this,"finish"))&&t.stop(!0)};return o.finish=o,r||!1===s.queue?this.each(o):this.queue(s.queue,o)},stop:function(e,t,n){var i=function(e){var t=e.stop;delete e.stop,t(n)};return"string"!=typeof e&&(n=t,t=e,e=void 0),t&&!1!==e&&this.queue(e||"fx",[]),this.each((function(){var t=!0,r=null!=e&&e+"queueHooks",s=m.timers,o=L.get(this);if(r)o[r]&&o[r].stop&&i(o[r]);else for(r in o)o[r]&&o[r].stop&&Je.test(r)&&i(o[r]);for(r=s.length;r--;)s[r].elem!==this||null!=e&&s[r].queue!==e||(s[r].anim.stop(n),t=!1,s.splice(r,1));!t&&n||m.dequeue(this,e)}))},finish:function(e){return!1!==e&&(e=e||"fx"),this.each((function(){var t,n=L.get(this),i=n[e+"queue"],r=n[e+"queueHooks"],s=m.timers,o=i?i.length:0;for(n.finish=!0,m.queue(this,e,[]),r&&r.stop&&r.stop.call(this,!0),t=s.length;t--;)s[t].elem===this&&s[t].queue===e&&(s[t].anim.stop(!0),s.splice(t,1));for(t=0;t<o;t++)i[t]&&i[t].finish&&i[t].finish.call(this);delete n.finish}))}}),m.each(["toggle","show","hide"],(function(e,t){var n=m.fn[t];m.fn[t]=function(e,i,r){return null==e||"boolean"==typeof e?n.apply(this,arguments):this.animate(Ye(t,!0),e,i,r)}})),m.each({slideDown:Ye("show"),slideUp:Ye("hide"),slideToggle:Ye("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},(function(e,t){m.fn[e]=function(e,n,i){return this.animate(t,e,n,i)}})),m.timers=[],m.fx.tick=function(){var e,t=0,n=m.timers;for(Ue=m.now();t<n.length;t++)(e=n[t])()||n[t]!==e||n.splice(t--,1);n.length||m.fx.stop(),Ue=void 0},m.fx.timer=function(e){m.timers.push(e),e()?m.fx.start():m.timers.pop()},m.fx.interval=13,m.fx.start=function(){ze||(ze=n.setInterval(m.fx.tick,m.fx.interval))},m.fx.stop=function(){n.clearInterval(ze),ze=null},m.fx.speeds={slow:600,fast:200,_default:400},m.fn.delay=function(e,t){return e=m.fx&&m.fx.speeds[e]||e,t=t||"fx",this.queue(t,(function(t,i){var r=n.setTimeout(t,e);i.stop=function(){n.clearTimeout(r)}}))},function(){var e=o.createElement("input"),t=o.createElement("select"),n=t.appendChild(o.createElement("option"));e.type="checkbox",p.checkOn=""!==e.value,p.optSelected=n.selected,t.disabled=!0,p.optDisabled=!n.disabled,(e=o.createElement("input")).value="t",e.type="radio",p.radioValue="t"===e.value}();var Ze,et=m.expr.attrHandle;m.fn.extend({attr:function(e,t){return F(this,m.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each((function(){m.removeAttr(this,e)}))}}),m.extend({attr:function(e,t,n){var i,r,s=e.nodeType;if(3!==s&&8!==s&&2!==s)return void 0===e.getAttribute?m.prop(e,t,n):(1===s&&m.isXMLDoc(e)||(t=t.toLowerCase(),r=m.attrHooks[t]||(m.expr.match.bool.test(t)?Ze:void 0)),void 0!==n?null===n?void m.removeAttr(e,t):r&&"set"in r&&void 0!==(i=r.set(e,n,t))?i:(e.setAttribute(t,n+""),n):r&&"get"in r&&null!==(i=r.get(e,t))?i:null==(i=m.find.attr(e,t))?void 0:i)},attrHooks:{type:{set:function(e,t){if(!p.radioValue&&"radio"===t&&m.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,i,r=0,s=t&&t.match(O);if(s&&1===e.nodeType)for(;n=s[r++];)i=m.propFix[n]||n,m.expr.match.bool.test(n)&&(e[i]=!1),e.removeAttribute(n)}}),Ze={set:function(e,t,n){return!1===t?m.removeAttr(e,n):e.setAttribute(n,n),n}},m.each(m.expr.match.bool.source.match(/\w+/g),(function(e,t){var n=et[t]||m.find.attr;et[t]=function(e,t,i){var r,s;return i||(s=et[t],et[t]=r,r=null!=n(e,t,i)?t.toLowerCase():null,et[t]=s),r}}));var tt=/^(?:input|select|textarea|button)$/i,nt=/^(?:a|area)$/i;m.fn.extend({prop:function(e,t){return F(this,m.prop,e,t,arguments.length>1)},removeProp:function(e){return this.each((function(){delete this[m.propFix[e]||e]}))}}),m.extend({prop:function(e,t,n){var i,r,s=e.nodeType;if(3!==s&&8!==s&&2!==s)return 1===s&&m.isXMLDoc(e)||(t=m.propFix[t]||t,r=m.propHooks[t]),void 0!==n?r&&"set"in r&&void 0!==(i=r.set(e,n,t))?i:e[t]=n:r&&"get"in r&&null!==(i=r.get(e,t))?i:e[t]},propHooks:{tabIndex:{get:function(e){var t=m.find.attr(e,"tabindex");return t?parseInt(t,10):tt.test(e.nodeName)||nt.test(e.nodeName)&&e.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),p.optSelected||(m.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),m.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],(function(){m.propFix[this.toLowerCase()]=this}));var it=/[\t\r\n\f]/g;function rt(e){return e.getAttribute&&e.getAttribute("class")||""}m.fn.extend({addClass:function(e){var t,n,i,r,s,o,a,u=0;if(m.isFunction(e))return this.each((function(t){m(this).addClass(e.call(this,t,rt(this)))}));if("string"==typeof e&&e)for(t=e.match(O)||[];n=this[u++];)if(r=rt(n),i=1===n.nodeType&&(" "+r+" ").replace(it," ")){for(o=0;s=t[o++];)i.indexOf(" "+s+" ")<0&&(i+=s+" ");r!==(a=m.trim(i))&&n.setAttribute("class",a)}return this},removeClass:function(e){var t,n,i,r,s,o,a,u=0;if(m.isFunction(e))return this.each((function(t){m(this).removeClass(e.call(this,t,rt(this)))}));if(!arguments.length)return this.attr("class","");if("string"==typeof e&&e)for(t=e.match(O)||[];n=this[u++];)if(r=rt(n),i=1===n.nodeType&&(" "+r+" ").replace(it," ")){for(o=0;s=t[o++];)for(;i.indexOf(" "+s+" ")>-1;)i=i.replace(" "+s+" "," ");r!==(a=m.trim(i))&&n.setAttribute("class",a)}return this},toggleClass:function(e,t){var n=typeof e;return"boolean"==typeof t&&"string"===n?t?this.addClass(e):this.removeClass(e):m.isFunction(e)?this.each((function(n){m(this).toggleClass(e.call(this,n,rt(this),t),t)})):this.each((function(){var t,i,r,s;if("string"===n)for(i=0,r=m(this),s=e.match(O)||[];t=s[i++];)r.hasClass(t)?r.removeClass(t):r.addClass(t);else void 0!==e&&"boolean"!==n||((t=rt(this))&&L.set(this,"__className__",t),this.setAttribute&&this.setAttribute("class",t||!1===e?"":L.get(this,"__className__")||""))}))},hasClass:function(e){var t,n,i=0;for(t=" "+e+" ";n=this[i++];)if(1===n.nodeType&&(" "+rt(n)+" ").replace(it," ").indexOf(t)>-1)return!0;return!1}});var st=/\r/g,ot=/[\x20\t\r\n\f]+/g;m.fn.extend({val:function(e){var t,n,i,r=this[0];return arguments.length?(i=m.isFunction(e),this.each((function(n){var r;1===this.nodeType&&(null==(r=i?e.call(this,n,m(this).val()):e)?r="":"number"==typeof r?r+="":m.isArray(r)&&(r=m.map(r,(function(e){return null==e?"":e+""}))),(t=m.valHooks[this.type]||m.valHooks[this.nodeName.toLowerCase()])&&"set"in t&&void 0!==t.set(this,r,"value")||(this.value=r))}))):r?(t=m.valHooks[r.type]||m.valHooks[r.nodeName.toLowerCase()])&&"get"in t&&void 0!==(n=t.get(r,"value"))?n:"string"==typeof(n=r.value)?n.replace(st,""):null==n?"":n:void 0}}),m.extend({valHooks:{option:{get:function(e){var t=m.find.attr(e,"value");return null!=t?t:m.trim(m.text(e)).replace(ot," ")}},select:{get:function(e){for(var t,n,i=e.options,r=e.selectedIndex,s="select-one"===e.type||r<0,o=s?null:[],a=s?r+1:i.length,u=r<0?a:s?r:0;u<a;u++)if(((n=i[u]).selected||u===r)&&(p.optDisabled?!n.disabled:null===n.getAttribute("disabled"))&&(!n.parentNode.disabled||!m.nodeName(n.parentNode,"optgroup"))){if(t=m(n).val(),s)return t;o.push(t)}return o},set:function(e,t){for(var n,i,r=e.options,s=m.makeArray(t),o=r.length;o--;)((i=r[o]).selected=m.inArray(m.valHooks.option.get(i),s)>-1)&&(n=!0);return n||(e.selectedIndex=-1),s}}}}),m.each(["radio","checkbox"],(function(){m.valHooks[this]={set:function(e,t){if(m.isArray(t))return e.checked=m.inArray(m(e).val(),t)>-1}},p.checkOn||(m.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})}));var at=/^(?:focusinfocus|focusoutblur)$/;m.extend(m.event,{trigger:function(e,t,i,r){var s,a,u,l,c,d,h,p=[i||o],v=f.call(e,"type")?e.type:e,g=f.call(e,"namespace")?e.namespace.split("."):[];if(a=u=i=i||o,3!==i.nodeType&&8!==i.nodeType&&!at.test(v+m.event.triggered)&&(v.indexOf(".")>-1&&(g=v.split("."),v=g.shift(),g.sort()),c=v.indexOf(":")<0&&"on"+v,(e=e[m.expando]?e:new m.Event(v,"object"==typeof e&&e)).isTrigger=r?2:3,e.namespace=g.join("."),e.rnamespace=e.namespace?new RegExp("(^|\\.)"+g.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,e.result=void 0,e.target||(e.target=i),t=null==t?[e]:m.makeArray(t,[e]),h=m.event.special[v]||{},r||!h.trigger||!1!==h.trigger.apply(i,t))){if(!r&&!h.noBubble&&!m.isWindow(i)){for(l=h.delegateType||v,at.test(l+v)||(a=a.parentNode);a;a=a.parentNode)p.push(a),u=a;u===(i.ownerDocument||o)&&p.push(u.defaultView||u.parentWindow||n)}for(s=0;(a=p[s++])&&!e.isPropagationStopped();)e.type=s>1?l:h.bindType||v,(d=(L.get(a,"events")||{})[e.type]&&L.get(a,"handle"))&&d.apply(a,t),(d=c&&a[c])&&d.apply&&P(a)&&(e.result=d.apply(a,t),!1===e.result&&e.preventDefault());return e.type=v,r||e.isDefaultPrevented()||h._default&&!1!==h._default.apply(p.pop(),t)||!P(i)||c&&m.isFunction(i[v])&&!m.isWindow(i)&&((u=i[c])&&(i[c]=null),m.event.triggered=v,i[v](),m.event.triggered=void 0,u&&(i[c]=u)),e.result}},simulate:function(e,t,n){var i=m.extend(new m.Event,n,{type:e,isSimulated:!0});m.event.trigger(i,null,t)}}),m.fn.extend({trigger:function(e,t){return this.each((function(){m.event.trigger(e,t,this)}))},triggerHandler:function(e,t){var n=this[0];if(n)return m.event.trigger(e,t,n,!0)}}),m.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),(function(e,t){m.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}})),m.fn.extend({hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),p.focusin="onfocusin"in n,p.focusin||m.each({focus:"focusin",blur:"focusout"},(function(e,t){var n=function(e){m.event.simulate(t,e.target,m.event.fix(e))};m.event.special[t]={setup:function(){var i=this.ownerDocument||this,r=L.access(i,t);r||i.addEventListener(e,n,!0),L.access(i,t,(r||0)+1)},teardown:function(){var i=this.ownerDocument||this,r=L.access(i,t)-1;r?L.access(i,t,r):(i.removeEventListener(e,n,!0),L.remove(i,t))}}}));var ut=n.location,lt=m.now(),ct=/\?/;m.parseJSON=function(e){return JSON.parse(e+"")},m.parseXML=function(e){var t;if(!e||"string"!=typeof e)return null;try{t=(new n.DOMParser).parseFromString(e,"text/xml")}catch(e){t=void 0}return t&&!t.getElementsByTagName("parsererror").length||m.error("Invalid XML: "+e),t};var dt=/#.*$/,ht=/([?&])_=[^&]*/,ft=/^(.*?):[ \t]*([^\r\n]*)$/gm,pt=/^(?:GET|HEAD)$/,mt=/^\/\//,vt={},gt={},yt="*/".concat("*"),bt=o.createElement("a");function _t(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var i,r=0,s=t.toLowerCase().match(O)||[];if(m.isFunction(n))for(;i=s[r++];)"+"===i[0]?(i=i.slice(1)||"*",(e[i]=e[i]||[]).unshift(n)):(e[i]=e[i]||[]).push(n)}}function xt(e,t,n,i){var r={},s=e===gt;function o(a){var u;return r[a]=!0,m.each(e[a]||[],(function(e,a){var l=a(t,n,i);return"string"!=typeof l||s||r[l]?s?!(u=l):void 0:(t.dataTypes.unshift(l),o(l),!1)})),u}return o(t.dataTypes[0])||!r["*"]&&o("*")}function wt(e,t){var n,i,r=m.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((r[n]?e:i||(i={}))[n]=t[n]);return i&&m.extend(!0,e,i),e}bt.href=ut.href,m.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:ut.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(ut.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":yt,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":m.parseJSON,"text xml":m.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?wt(wt(e,m.ajaxSettings),t):wt(m.ajaxSettings,e)},ajaxPrefilter:_t(vt),ajaxTransport:_t(gt),ajax:function(e,t){"object"==typeof e&&(t=e,e=void 0),t=t||{};var i,r,s,a,u,l,c,d,h=m.ajaxSetup({},t),f=h.context||h,p=h.context&&(f.nodeType||f.jquery)?m(f):m.event,v=m.Deferred(),g=m.Callbacks("once memory"),y=h.statusCode||{},b={},_={},x=0,w="canceled",k={readyState:0,getResponseHeader:function(e){var t;if(2===x){if(!a)for(a={};t=ft.exec(s);)a[t[1].toLowerCase()]=t[2];t=a[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return 2===x?s:null},setRequestHeader:function(e,t){var n=e.toLowerCase();return x||(e=_[n]=_[n]||e,b[e]=t),this},overrideMimeType:function(e){return x||(h.mimeType=e),this},statusCode:function(e){var t;if(e)if(x<2)for(t in e)y[t]=[y[t],e[t]];else k.always(e[k.status]);return this},abort:function(e){var t=e||w;return i&&i.abort(t),E(0,t),this}};if(v.promise(k).complete=g.add,k.success=k.done,k.error=k.fail,h.url=((e||h.url||ut.href)+"").replace(dt,"").replace(mt,ut.protocol+"//"),h.type=t.method||t.type||h.method||h.type,h.dataTypes=m.trim(h.dataType||"*").toLowerCase().match(O)||[""],null==h.crossDomain){l=o.createElement("a");try{l.href=h.url,l.href=l.href,h.crossDomain=bt.protocol+"//"+bt.host!=l.protocol+"//"+l.host}catch(e){h.crossDomain=!0}}if(h.data&&h.processData&&"string"!=typeof h.data&&(h.data=m.param(h.data,h.traditional)),xt(vt,h,t,k),2===x)return k;for(d in(c=m.event&&h.global)&&0==m.active++&&m.event.trigger("ajaxStart"),h.type=h.type.toUpperCase(),h.hasContent=!pt.test(h.type),r=h.url,h.hasContent||(h.data&&(r=h.url+=(ct.test(r)?"&":"?")+h.data,delete h.data),!1===h.cache&&(h.url=ht.test(r)?r.replace(ht,"$1_="+lt++):r+(ct.test(r)?"&":"?")+"_="+lt++)),h.ifModified&&(m.lastModified[r]&&k.setRequestHeader("If-Modified-Since",m.lastModified[r]),m.etag[r]&&k.setRequestHeader("If-None-Match",m.etag[r])),(h.data&&h.hasContent&&!1!==h.contentType||t.contentType)&&k.setRequestHeader("Content-Type",h.contentType),k.setRequestHeader("Accept",h.dataTypes[0]&&h.accepts[h.dataTypes[0]]?h.accepts[h.dataTypes[0]]+("*"!==h.dataTypes[0]?", "+yt+"; q=0.01":""):h.accepts["*"]),h.headers)k.setRequestHeader(d,h.headers[d]);if(h.beforeSend&&(!1===h.beforeSend.call(f,k,h)||2===x))return k.abort();for(d in w="abort",{success:1,error:1,complete:1})k[d](h[d]);if(i=xt(gt,h,t,k)){if(k.readyState=1,c&&p.trigger("ajaxSend",[k,h]),2===x)return k;h.async&&h.timeout>0&&(u=n.setTimeout((function(){k.abort("timeout")}),h.timeout));try{x=1,i.send(b,E)}catch(e){if(!(x<2))throw e;E(-1,e)}}else E(-1,"No Transport");function E(e,t,o,a){var l,d,b,_,w,E=t;2!==x&&(x=2,u&&n.clearTimeout(u),i=void 0,s=a||"",k.readyState=e>0?4:0,l=e>=200&&e<300||304===e,o&&(_=function(e,t,n){for(var i,r,s,o,a=e.contents,u=e.dataTypes;"*"===u[0];)u.shift(),void 0===i&&(i=e.mimeType||t.getResponseHeader("Content-Type"));if(i)for(r in a)if(a[r]&&a[r].test(i)){u.unshift(r);break}if(u[0]in n)s=u[0];else{for(r in n){if(!u[0]||e.converters[r+" "+u[0]]){s=r;break}o||(o=r)}s=s||o}if(s)return s!==u[0]&&u.unshift(s),n[s]}(h,k,o)),_=function(e,t,n,i){var r,s,o,a,u,l={},c=e.dataTypes.slice();if(c[1])for(o in e.converters)l[o.toLowerCase()]=e.converters[o];for(s=c.shift();s;)if(e.responseFields[s]&&(n[e.responseFields[s]]=t),!u&&i&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),u=s,s=c.shift())if("*"===s)s=u;else if("*"!==u&&u!==s){if(!(o=l[u+" "+s]||l["* "+s]))for(r in l)if((a=r.split(" "))[1]===s&&(o=l[u+" "+a[0]]||l["* "+a[0]])){!0===o?o=l[r]:!0!==l[r]&&(s=a[0],c.unshift(a[1]));break}if(!0!==o)if(o&&e.throws)t=o(t);else try{t=o(t)}catch(e){return{state:"parsererror",error:o?e:"No conversion from "+u+" to "+s}}}return{state:"success",data:t}}(h,_,k,l),l?(h.ifModified&&((w=k.getResponseHeader("Last-Modified"))&&(m.lastModified[r]=w),(w=k.getResponseHeader("etag"))&&(m.etag[r]=w)),204===e||"HEAD"===h.type?E="nocontent":304===e?E="notmodified":(E=_.state,d=_.data,l=!(b=_.error))):(b=E,!e&&E||(E="error",e<0&&(e=0))),k.status=e,k.statusText=(t||E)+"",l?v.resolveWith(f,[d,E,k]):v.rejectWith(f,[k,E,b]),k.statusCode(y),y=void 0,c&&p.trigger(l?"ajaxSuccess":"ajaxError",[k,h,l?d:b]),g.fireWith(f,[k,E]),c&&(p.trigger("ajaxComplete",[k,h]),--m.active||m.event.trigger("ajaxStop")))}return k},getJSON:function(e,t,n){return m.get(e,t,n,"json")},getScript:function(e,t){return m.get(e,void 0,t,"script")}}),m.each(["get","post"],(function(e,t){m[t]=function(e,n,i,r){return m.isFunction(n)&&(r=r||i,i=n,n=void 0),m.ajax(m.extend({url:e,type:t,dataType:r,data:n,success:i},m.isPlainObject(e)&&e))}})),m._evalUrl=function(e){return m.ajax({url:e,type:"GET",dataType:"script",async:!1,global:!1,throws:!0})},m.fn.extend({wrapAll:function(e){var t;return m.isFunction(e)?this.each((function(t){m(this).wrapAll(e.call(this,t))})):(this[0]&&(t=m(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map((function(){for(var e=this;e.firstElementChild;)e=e.firstElementChild;return e})).append(this)),this)},wrapInner:function(e){return m.isFunction(e)?this.each((function(t){m(this).wrapInner(e.call(this,t))})):this.each((function(){var t=m(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)}))},wrap:function(e){var t=m.isFunction(e);return this.each((function(n){m(this).wrapAll(t?e.call(this,n):e)}))},unwrap:function(){return this.parent().each((function(){m.nodeName(this,"body")||m(this).replaceWith(this.childNodes)})).end()}}),m.expr.filters.hidden=function(e){return!m.expr.filters.visible(e)},m.expr.filters.visible=function(e){return e.offsetWidth>0||e.offsetHeight>0||e.getClientRects().length>0};var kt=/%20/g,Et=/\[\]$/,Ct=/\r?\n/g,Tt=/^(?:submit|button|image|reset|file)$/i,$t=/^(?:input|select|textarea|keygen)/i;function St(e,t,n,i){var r;if(m.isArray(t))m.each(t,(function(t,r){n||Et.test(e)?i(e,r):St(e+"["+("object"==typeof r&&null!=r?t:"")+"]",r,n,i)}));else if(n||"object"!==m.type(t))i(e,t);else for(r in t)St(e+"["+r+"]",t[r],n,i)}m.param=function(e,t){var n,i=[],r=function(e,t){t=m.isFunction(t)?t():null==t?"":t,i[i.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};if(void 0===t&&(t=m.ajaxSettings&&m.ajaxSettings.traditional),m.isArray(e)||e.jquery&&!m.isPlainObject(e))m.each(e,(function(){r(this.name,this.value)}));else for(n in e)St(n,e[n],t,r);return i.join("&").replace(kt,"+")},m.fn.extend({serialize:function(){return m.param(this.serializeArray())},serializeArray:function(){return this.map((function(){var e=m.prop(this,"elements");return e?m.makeArray(e):this})).filter((function(){var e=this.type;return this.name&&!m(this).is(":disabled")&&$t.test(this.nodeName)&&!Tt.test(e)&&(this.checked||!X.test(e))})).map((function(e,t){var n=m(this).val();return null==n?null:m.isArray(n)?m.map(n,(function(e){return{name:t.name,value:e.replace(Ct,"\r\n")}})):{name:t.name,value:n.replace(Ct,"\r\n")}})).get()}}),m.ajaxSettings.xhr=function(){try{return new n.XMLHttpRequest}catch(e){}};var At={0:200,1223:204},Nt=m.ajaxSettings.xhr();p.cors=!!Nt&&"withCredentials"in Nt,p.ajax=Nt=!!Nt,m.ajaxTransport((function(e){var t,i;if(p.cors||Nt&&!e.crossDomain)return{send:function(r,s){var o,a=e.xhr();if(a.open(e.type,e.url,e.async,e.username,e.password),e.xhrFields)for(o in e.xhrFields)a[o]=e.xhrFields[o];for(o in e.mimeType&&a.overrideMimeType&&a.overrideMimeType(e.mimeType),e.crossDomain||r["X-Requested-With"]||(r["X-Requested-With"]="XMLHttpRequest"),r)a.setRequestHeader(o,r[o]);t=function(e){return function(){t&&(t=i=a.onload=a.onerror=a.onabort=a.onreadystatechange=null,"abort"===e?a.abort():"error"===e?"number"!=typeof a.status?s(0,"error"):s(a.status,a.statusText):s(At[a.status]||a.status,a.statusText,"text"!==(a.responseType||"text")||"string"!=typeof a.responseText?{binary:a.response}:{text:a.responseText},a.getAllResponseHeaders()))}},a.onload=t(),i=a.onerror=t("error"),void 0!==a.onabort?a.onabort=i:a.onreadystatechange=function(){4===a.readyState&&n.setTimeout((function(){t&&i()}))},t=t("abort");try{a.send(e.hasContent&&e.data||null)}catch(e){if(t)throw e}},abort:function(){t&&t()}}})),m.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return m.globalEval(e),e}}}),m.ajaxPrefilter("script",(function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")})),m.ajaxTransport("script",(function(e){var t,n;if(e.crossDomain)return{send:function(i,r){t=m("<script>").prop({charset:e.scriptCharset,src:e.url}).on("load error",n=function(e){t.remove(),n=null,e&&r("error"===e.type?404:200,e.type)}),o.head.appendChild(t[0])},abort:function(){n&&n()}}}));var jt=[],Dt=/(=)\?(?=&|$)|\?\?/;m.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=jt.pop()||m.expando+"_"+lt++;return this[e]=!0,e}}),m.ajaxPrefilter("json jsonp",(function(e,t,i){var r,s,o,a=!1!==e.jsonp&&(Dt.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Dt.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=m.isFunction(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Dt,"$1"+r):!1!==e.jsonp&&(e.url+=(ct.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||m.error(r+" was not called"),o[0]},e.dataTypes[0]="json",s=n[r],n[r]=function(){o=arguments},i.always((function(){void 0===s?m(n).removeProp(r):n[r]=s,e[r]&&(e.jsonpCallback=t.jsonpCallback,jt.push(r)),o&&m.isFunction(s)&&s(o[0]),o=s=void 0})),"script"})),m.parseHTML=function(e,t,n){if(!e||"string"!=typeof e)return null;"boolean"==typeof t&&(n=t,t=!1),t=t||o;var i=C.exec(e),r=!n&&[];return i?[t.createElement(i[1])]:(i=re([e],t,r),r&&r.length&&m(r).remove(),m.merge([],i.childNodes))};var Rt=m.fn.load;function Ot(e){return m.isWindow(e)?e:9===e.nodeType&&e.defaultView}m.fn.load=function(e,t,n){if("string"!=typeof e&&Rt)return Rt.apply(this,arguments);var i,r,s,o=this,a=e.indexOf(" ");return a>-1&&(i=m.trim(e.slice(a)),e=e.slice(0,a)),m.isFunction(t)?(n=t,t=void 0):t&&"object"==typeof t&&(r="POST"),o.length>0&&m.ajax({url:e,type:r||"GET",dataType:"html",data:t}).done((function(e){s=arguments,o.html(i?m("<div>").append(m.parseHTML(e)).find(i):e)})).always(n&&function(e,t){o.each((function(){n.apply(this,s||[e.responseText,t,e])}))}),this},m.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],(function(e,t){m.fn[t]=function(e){return this.on(t,e)}})),m.expr.filters.animated=function(e){return m.grep(m.timers,(function(t){return e===t.elem})).length},m.offset={setOffset:function(e,t,n){var i,r,s,o,a,u,l=m.css(e,"position"),c=m(e),d={};"static"===l&&(e.style.position="relative"),a=c.offset(),s=m.css(e,"top"),u=m.css(e,"left"),("absolute"===l||"fixed"===l)&&(s+u).indexOf("auto")>-1?(o=(i=c.position()).top,r=i.left):(o=parseFloat(s)||0,r=parseFloat(u)||0),m.isFunction(t)&&(t=t.call(e,n,m.extend({},a))),null!=t.top&&(d.top=t.top-a.top+o),null!=t.left&&(d.left=t.left-a.left+r),"using"in t?t.using.call(e,d):c.css(d)}},m.fn.extend({offset:function(e){if(arguments.length)return void 0===e?this:this.each((function(t){m.offset.setOffset(this,e,t)}));var t,n,i=this[0],r={top:0,left:0},s=i&&i.ownerDocument;return s?(t=s.documentElement,m.contains(t,i)?(r=i.getBoundingClientRect(),n=Ot(s),{top:r.top+n.pageYOffset-t.clientTop,left:r.left+n.pageXOffset-t.clientLeft}):r):void 0},position:function(){if(this[0]){var e,t,n=this[0],i={top:0,left:0};return"fixed"===m.css(n,"position")?t=n.getBoundingClientRect():(e=this.offsetParent(),t=this.offset(),m.nodeName(e[0],"html")||(i=e.offset()),i.top+=m.css(e[0],"borderTopWidth",!0),i.left+=m.css(e[0],"borderLeftWidth",!0)),{top:t.top-i.top-m.css(n,"marginTop",!0),left:t.left-i.left-m.css(n,"marginLeft",!0)}}},offsetParent:function(){return this.map((function(){for(var e=this.offsetParent;e&&"static"===m.css(e,"position");)e=e.offsetParent;return e||je}))}}),m.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},(function(e,t){var n="pageYOffset"===t;m.fn[e]=function(i){return F(this,(function(e,i,r){var s=Ot(e);if(void 0===r)return s?s[t]:e[i];s?s.scrollTo(n?s.pageXOffset:r,n?r:s.pageYOffset):e[i]=r}),e,i,arguments.length)}})),m.each(["top","left"],(function(e,t){m.cssHooks[t]=Re(p.pixelPosition,(function(e,n){if(n)return n=De(e,t),Se.test(n)?m(e).position()[t]+"px":n}))})),m.each({Height:"height",Width:"width"},(function(e,t){m.each({padding:"inner"+e,content:t,"":"outer"+e},(function(n,i){m.fn[i]=function(i,r){var s=arguments.length&&(n||"boolean"!=typeof i),o=n||(!0===i||!0===r?"margin":"border");return F(this,(function(t,n,i){var r;return m.isWindow(t)?t.document.documentElement["client"+e]:9===t.nodeType?(r=t.documentElement,Math.max(t.body["scroll"+e],r["scroll"+e],t.body["offset"+e],r["offset"+e],r["client"+e])):void 0===i?m.css(t,n,o):m.style(t,n,i,o)}),t,s?i:void 0,s,null)}}))})),m.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,i){return this.on(t,e,n,i)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},size:function(){return this.length}}),m.fn.andSelf=m.fn.addBack,void 0===(i=function(){return m}.apply(t,[]))||(e.exports=i);var It=n.jQuery,Ft=n.$;return m.noConflict=function(e){return n.$===m&&(n.$=Ft),e&&n.jQuery===m&&(n.jQuery=It),m},r||(n.jQuery=n.$=m),m},"object"==typeof e.exports?e.exports=r.document?s(r,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return s(e)}:s(r)},15:function(e,t,n){"use strict";n(16);void 0===window.gettext&&(window.gettext=function(e){return e}),void 0===window.ngetgext&&(window.ngettext=function(e,t,n){return n>1?t:e}),void 0===window.Logger&&(window.Logger={log:function(){}}),void 0===window.MathJax&&(window.MathJax={Hub:{Typeset:function(){},Queue:function(){}}})},16:function(e,t,n){var i,r,s;
/*!
  backgrid 0.3.8
  http://github.com/cloudflare/backgrid

  Copyright (c) 2017 Cloudflare, Inc. and contributors <jwong@cloudflare.com>
  Licensed under the MIT license.
*/s=this,i=[n(8),n(17)],void 0===(r=function(e,t){return s.Backgrid=function(e,t){"use strict";var n="\t\n\v\f\r   ᠎             　\u2028\u2029\ufeff";if(!String.prototype.trim||n.trim()){n="["+n+"]";var i=new RegExp("^"+n+n+"*"),r=new RegExp(n+n+"*$");String.prototype.trim=function(){if(null==this)throw new TypeError("can't convert "+this+" to object");return String(this).replace(i,"").replace(r,"")}}function s(e,t,n){var i=t-(e+"").length;i=i<0?0:i;for(var r="",s=0;s<i;s++)r+=n;return r+e}var o=t.$,a={Extension:{},resolveNameToClass:function(t,n){if(e.isString(t)){var i=e.map(t.split("-"),(function(e){return e.slice(0,1).toUpperCase()+e.slice(1)})).join("")+n,r=a[i]||a.Extension[i];if(e.isUndefined(r))throw new ReferenceError("Class '"+i+"' not found");return r}return t},callByNeed:function(){var t=arguments[0];if(!e.isFunction(t))return t;var n=arguments[1],i=[].slice.call(arguments,2);return t.apply(n,i+""?i:[])}};e.extend(a,t.Events);var u=a.Command=function(t){e.extend(this,{altKey:!!t.altKey,char:t.char,charCode:t.charCode,ctrlKey:!!t.ctrlKey,key:t.key,keyCode:t.keyCode,locale:t.locale,location:t.location,metaKey:!!t.metaKey,repeat:!!t.repeat,shiftKey:!!t.shiftKey,which:t.which})};e.extend(u.prototype,{moveUp:function(){return 38==this.keyCode},moveDown:function(){return 40===this.keyCode},moveLeft:function(){return this.shiftKey&&9===this.keyCode},moveRight:function(){return!this.shiftKey&&9===this.keyCode},save:function(){return 13===this.keyCode},cancel:function(){return 27===this.keyCode},passThru:function(){return!(this.moveUp()||this.moveDown()||this.moveLeft()||this.moveRight()||this.save()||this.cancel())}});var l=a.CellFormatter=function(){};e.extend(l.prototype,{fromRaw:function(e,t){return e},toRaw:function(e,t){return e}});var c=a.NumberFormatter=function(t){if(e.extend(this,this.defaults,t||{}),this.decimals<0||this.decimals>20)throw new RangeError("decimals must be between 0 and 20")};c.prototype=new l,e.extend(c.prototype,{defaults:{decimals:2,decimalSeparator:".",orderSeparator:","},HUMANIZED_NUM_RE:/(\d)(?=(?:\d{3})+$)/g,fromRaw:function(t,n){if(e.isNull(t)||e.isUndefined(t))return"";var i=(t=parseFloat(t).toFixed(~~this.decimals)).split("."),r=i[0],s=i[1]?(this.decimalSeparator||".")+i[1]:"";return r.replace(this.HUMANIZED_NUM_RE,"$1"+this.orderSeparator)+s},toRaw:function(t,n){if(""===(t=t.trim()))return null;for(var i="",r=t.split(this.orderSeparator),s=0;s<r.length;s++)i+=r[s];var o=i.split(this.decimalSeparator);for(i="",s=0;s<o.length;s++)i=i+o[s]+".";"."===i[i.length-1]&&(i=i.slice(0,i.length-1));var a=1*(1*i).toFixed(~~this.decimals);return e.isNumber(a)&&!e.isNaN(a)?a:void 0}});var d=a.PercentFormatter=function(){a.NumberFormatter.apply(this,arguments)};d.prototype=new a.NumberFormatter,e.extend(d.prototype,{defaults:e.extend({},c.prototype.defaults,{multiplier:1,symbol:"%"}),fromRaw:function(e,t){var n=[].slice.call(arguments,1);return n.unshift(e*this.multiplier),(c.prototype.fromRaw.apply(this,n)||"0")+this.symbol},toRaw:function(t,n){var i=t.split(this.symbol);if(i&&i[0]&&""===i[1]||null==i[1]){var r=c.prototype.toRaw.call(this,i[0]);return e.isUndefined(r)?r:r/this.multiplier}}});var h=a.DatetimeFormatter=function(t){if(e.extend(this,this.defaults,t||{}),!this.includeDate&&!this.includeTime)throw new Error("Either includeDate or includeTime must be true")};h.prototype=new l,e.extend(h.prototype,{defaults:{includeDate:!0,includeTime:!0,includeMilli:!1},DATE_RE:/^([+\-]?\d{4})-(\d{2})-(\d{2})$/,TIME_RE:/^(\d{2}):(\d{2}):(\d{2})(\.(\d{3}))?$/,ISO_SPLITTER_RE:/T|Z| +/,_convert:function(t,n){if(""===(t+"").trim())return null;var i,r=null;if(e.isNumber(t))i=s((l=new Date(t)).getUTCFullYear(),4,0)+"-"+s(l.getUTCMonth()+1,2,0)+"-"+s(l.getUTCDate(),2,0),r=s(l.getUTCHours(),2,0)+":"+s(l.getUTCMinutes(),2,0)+":"+s(l.getUTCSeconds(),2,0);else{var o=(t=t.trim()).split(this.ISO_SPLITTER_RE)||[];r=(i=this.DATE_RE.test(o[0])?o[0]:"")&&o[1]?o[1]:this.TIME_RE.test(o[0])?o[0]:""}var a=this.DATE_RE.exec(i)||[],u=this.TIME_RE.exec(r)||[];if(n){if(this.includeDate&&e.isUndefined(a[0]))return;if(this.includeTime&&e.isUndefined(u[0]))return;if(!this.includeDate&&i)return;if(!this.includeTime&&r)return}var l=new Date(Date.UTC(1*a[1]||0,1*a[2]-1||0,1*a[3]||0,1*u[1]||null,1*u[2]||null,1*u[3]||null,1*u[5]||null)),c="";return this.includeDate&&(c=s(l.getUTCFullYear(),4,0)+"-"+s(l.getUTCMonth()+1,2,0)+"-"+s(l.getUTCDate(),2,0)),this.includeTime&&(c=c+(this.includeDate?"T":"")+s(l.getUTCHours(),2,0)+":"+s(l.getUTCMinutes(),2,0)+":"+s(l.getUTCSeconds(),2,0),this.includeMilli&&(c=c+"."+s(l.getUTCMilliseconds(),3,0))),this.includeDate&&this.includeTime&&(c+="Z"),c},fromRaw:function(t,n){return e.isNull(t)||e.isUndefined(t)?"":this._convert(t)},toRaw:function(e,t){return this._convert(e,!0)}});var f=a.StringFormatter=function(){};f.prototype=new l,e.extend(f.prototype,{fromRaw:function(t,n){return e.isUndefined(t)||e.isNull(t)?"":t+""}});var p=a.EmailFormatter=function(){};p.prototype=new l,e.extend(p.prototype,{toRaw:function(t,n){var i=t.trim().split("@");if(2===i.length&&e.all(i))return t}});var m=a.SelectFormatter=function(){};m.prototype=new l,e.extend(m.prototype,{fromRaw:function(t,n){return e.isArray(t)?t:null!=t?[t]:[]}});var v=a.CellEditor=t.View.extend({initialize:function(e){this.formatter=e.formatter,this.column=e.column,this.column instanceof $||(this.column=new $(this.column)),this.listenTo(this.model,"backgrid:editing",this.postRender)},postRender:function(e,t){return null!=t&&t.get("name")!=this.column.get("name")||this.$el.focus(),this}}),g=a.InputCellEditor=v.extend({tagName:"input",attributes:{type:"text"},events:{blur:"saveOrCancel",keydown:"saveOrCancel"},initialize:function(e){g.__super__.initialize.apply(this,arguments),e.placeholder&&this.$el.attr("placeholder",e.placeholder)},render:function(){var e=this.model;return this.$el.val(this.formatter.fromRaw(e.get(this.column.get("name")),e)),this},saveOrCancel:function(t){var n=this.formatter,i=this.model,r=this.column,s=new u(t),o="blur"===t.type;if(s.moveUp()||s.moveDown()||s.moveLeft()||s.moveRight()||s.save()||o){t.preventDefault(),t.stopPropagation();var a=this.$el.val(),l=n.toRaw(a,i);e.isUndefined(l)?i.trigger("backgrid:error",i,r,a):(i.set(r.get("name"),l),i.trigger("backgrid:edited",i,r,s))}else s.cancel()&&(t.stopPropagation(),i.trigger("backgrid:edited",i,r,s))},postRender:function(e,t){if(null==t||t.get("name")==this.column.get("name"))if("right"===this.$el.css("text-align")){var n=this.$el.val();this.$el.focus().val(null).val(n)}else this.$el.focus();return this}}),y=a.Cell=t.View.extend({tagName:"td",formatter:l,editor:g,events:{click:"enterEditMode"},initialize:function(t){this.column=t.column,this.column instanceof $||(this.column=new $(this.column));var n=this.column,i=this.model,r=this.$el,s=a.resolveNameToClass(n.get("formatter")||this.formatter,"Formatter");e.isFunction(s.fromRaw)||e.isFunction(s.toRaw)||(s=new s),this.formatter=s,this.editor=a.resolveNameToClass(this.editor,"CellEditor"),this.listenTo(i,"change:"+n.get("name"),(function(){r.hasClass("editor")||this.render()})),this.listenTo(i,"backgrid:error",this.renderError),this.listenTo(n,"change:editable change:sortable change:renderable",(function(e){var t=e.changedAttributes();for(var n in t)t.hasOwnProperty(n)&&r.toggleClass(n,t[n])})),this.updateStateClassesMaybe()},updateStateClassesMaybe:function(){var e=this.model,t=this.column,n=this.$el;n.toggleClass("editable",a.callByNeed(t.editable(),t,e)),n.toggleClass("sortable",a.callByNeed(t.sortable(),t,e)),n.toggleClass("renderable",a.callByNeed(t.renderable(),t,e))},render:function(){var e=this.$el;e.empty();var t=this.model,n=this.column.get("name");return e.text(this.formatter.fromRaw(t.get(n),t)),e.addClass(n),this.updateStateClassesMaybe(),this.delegateEvents(),this},enterEditMode:function(){var e=this.model,t=this.column;a.callByNeed(t.editable(),t,e)&&(this.currentEditor=new this.editor({column:this.column,model:this.model,formatter:this.formatter}),e.trigger("backgrid:edit",e,t,this,this.currentEditor),this.undelegateEvents(),this.$el.empty(),this.$el.append(this.currentEditor.$el),this.currentEditor.render(),this.$el.addClass("editor"),e.trigger("backgrid:editing",e,t,this,this.currentEditor))},renderError:function(e,t){null!=t&&t.get("name")!=this.column.get("name")||this.$el.addClass("error")},exitEditMode:function(){this.$el.removeClass("error"),this.currentEditor.remove(),this.stopListening(this.currentEditor),delete this.currentEditor,this.$el.removeClass("editor"),this.render()},remove:function(){return this.currentEditor&&(this.currentEditor.remove.apply(this.currentEditor,arguments),delete this.currentEditor),y.__super__.remove.apply(this,arguments)}}),b=a.StringCell=y.extend({className:"string-cell",formatter:f}),_=a.UriCell=y.extend({className:"uri-cell",title:null,target:"_blank",initialize:function(e){_.__super__.initialize.apply(this,arguments),this.title=e.title||this.title,this.target=e.target||this.target},render:function(){this.$el.empty();var e=this.model.get(this.column.get("name")),t=this.formatter.fromRaw(e,this.model);return this.$el.append(o("<a>",{tabIndex:-1,href:e,title:this.title||t,target:this.target}).text(t)),this.delegateEvents(),this}}),x=(a.EmailCell=b.extend({className:"email-cell",formatter:p,render:function(){this.$el.empty();var e=this.model,t=this.formatter.fromRaw(e.get(this.column.get("name")),e);return this.$el.append(o("<a>",{tabIndex:-1,href:"mailto:"+t,title:t}).text(t)),this.delegateEvents(),this}}),a.NumberCell=y.extend({className:"number-cell",decimals:c.prototype.defaults.decimals,decimalSeparator:c.prototype.defaults.decimalSeparator,orderSeparator:c.prototype.defaults.orderSeparator,formatter:c,initialize:function(e){x.__super__.initialize.apply(this,arguments);var t=this.formatter;t.decimals=this.decimals,t.decimalSeparator=this.decimalSeparator,t.orderSeparator=this.orderSeparator}})),w=(a.IntegerCell=x.extend({className:"integer-cell",decimals:0}),a.PercentCell=x.extend({className:"percent-cell",multiplier:d.prototype.defaults.multiplier,symbol:d.prototype.defaults.symbol,formatter:d,initialize:function(){w.__super__.initialize.apply(this,arguments);var e=this.formatter;e.multiplier=this.multiplier,e.symbol=this.symbol}})),k=a.DatetimeCell=y.extend({className:"datetime-cell",includeDate:h.prototype.defaults.includeDate,includeTime:h.prototype.defaults.includeTime,includeMilli:h.prototype.defaults.includeMilli,formatter:h,initialize:function(t){k.__super__.initialize.apply(this,arguments);var n=this.formatter;n.includeDate=this.includeDate,n.includeTime=this.includeTime,n.includeMilli=this.includeMilli;var i=this.includeDate?"YYYY-MM-DD":"";i+=this.includeDate&&this.includeTime?"T":"",i+=this.includeTime?"HH:mm:ss":"",i+=this.includeTime&&this.includeMilli?".SSS":"",this.editor=this.editor.extend({attributes:e.extend({},this.editor.prototype.attributes,this.editor.attributes,{placeholder:i})})}}),E=(a.DateCell=k.extend({className:"date-cell",includeTime:!1}),a.TimeCell=k.extend({className:"time-cell",includeDate:!1}),a.BooleanCellEditor=v.extend({tagName:"input",attributes:{tabIndex:-1,type:"checkbox"},events:{mousedown:function(){this.mouseDown=!0},blur:"enterOrExitEditMode",mouseup:function(){this.mouseDown=!1},change:"saveOrCancel",keydown:"saveOrCancel"},render:function(){var e=this.model,t=this.formatter.fromRaw(e.get(this.column.get("name")),e);return this.$el.prop("checked",t),this},enterOrExitEditMode:function(e){if(!this.mouseDown){var t=this.model;t.trigger("backgrid:edited",t,this.column,new u(e))}},saveOrCancel:function(e){var t=this.model,n=this.column,i=this.formatter,r=new u(e);if(r.passThru()&&"change"!=e.type)return!0;r.cancel()&&(e.stopPropagation(),t.trigger("backgrid:edited",t,n,r));var s=this.$el;if(r.save()||r.moveLeft()||r.moveRight()||r.moveUp()||r.moveDown()){e.preventDefault(),e.stopPropagation();var o=i.toRaw(s.prop("checked"),t);t.set(n.get("name"),o),t.trigger("backgrid:edited",t,n,r)}else"change"==e.type&&(o=i.toRaw(s.prop("checked"),t),t.set(n.get("name"),o),s.focus())}})),C=(a.BooleanCell=y.extend({className:"boolean-cell",editor:E,events:{click:"enterEditMode"},render:function(){this.$el.empty();var e=this.model,t=this.column,n=a.callByNeed(t.editable(),t,e);return this.$el.append(o("<input>",{tabIndex:-1,type:"checkbox",checked:this.formatter.fromRaw(e.get(t.get("name")),e),disabled:!n})),this.delegateEvents(),this}}),a.SelectCellEditor=v.extend({tagName:"select",events:{change:"save",blur:"close",keydown:"close"},template:e.template('<option value="<%- value %>" <%= selected ? \'selected="selected"\' : "" %>><%- text %></option>',null,{variable:null,evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g}),setOptionValues:function(t){this.optionValues=t,this.optionValues=e.result(this,"optionValues")},setMultiple:function(e){this.multiple=e,this.$el.prop("multiple",e)},_renderOptions:function(t,n){for(var i="",r=0;r<t.length;r++)i+=this.template({text:t[r][0],value:t[r][1],selected:e.indexOf(n,t[r][1])>-1});return i},render:function(){this.$el.empty();var t=e.result(this,"optionValues"),n=this.model,i=this.formatter.fromRaw(n.get(this.column.get("name")),n);if(!e.isArray(t))throw new TypeError("optionValues must be an array");for(var r=null,s=null,a=(r=null,null),u=null,l=0;l<t.length;l++)if(r=t[l],e.isArray(r))s=r[0],r=r[1],this.$el.append(this.template({text:s,value:r,selected:e.indexOf(i,r)>-1}));else{if(!e.isObject(r))throw new TypeError("optionValues elements must be a name-value pair or an object hash of { name: 'optgroup label', value: [option name-value pairs] }");a=r.name,(u=o("<optgroup></optgroup>",{label:a})).append(this._renderOptions.call(this,r.values,i)),this.$el.append(u)}return this.delegateEvents(),this},save:function(e){var t=this.model,n=this.column;t.set(n.get("name"),this.formatter.toRaw(this.$el.val(),t))},close:function(e){var t=this.model,n=this.column,i=new u(e);i.cancel()?(e.stopPropagation(),t.trigger("backgrid:edited",t,n,new u(e))):(i.save()||i.moveLeft()||i.moveRight()||i.moveUp()||i.moveDown()||"blur"==e.type)&&(e.preventDefault(),e.stopPropagation(),this.save(e),t.trigger("backgrid:edited",t,n,new u(e)))}})),T=a.SelectCell=y.extend({className:"select-cell",editor:C,multiple:!1,formatter:m,optionValues:void 0,delimiter:", ",initialize:function(e){T.__super__.initialize.apply(this,arguments),this.listenTo(this.model,"backgrid:edit",(function(e,t,n,i){t.get("name")==this.column.get("name")&&(i.setOptionValues(this.optionValues),i.setMultiple(this.multiple))}))},render:function(){this.$el.empty();var t=e.result(this,"optionValues"),n=this.model,i=this.formatter.fromRaw(n.get(this.column.get("name")),n),r=[];try{if(!e.isArray(t)||e.isEmpty(t))throw new TypeError;for(var s=0;s<i.length;s++)for(var o=i[s],a=0;a<t.length;a++){var u=t[a];if(e.isArray(u)){var l=u[0];(u=u[1])==o&&r.push(l)}else{if(!e.isObject(u))throw new TypeError;for(var c=u.values,d=0;d<c.length;d++){var h=c[d];h[1]==o&&r.push(h[0])}}}this.$el.append(r.join(this.delimiter))}catch(e){if(e instanceof TypeError)throw new TypeError("'optionValues' must be of type {Array.<Array>|Array.<{name: string, values: Array.<Array>}>}");throw e}return this.delegateEvents(),this}}),$=a.Column=t.Model.extend({defaults:{name:void 0,label:void 0,sortable:!0,editable:!0,renderable:!0,formatter:void 0,sortType:"cycle",sortValue:void 0,direction:null,cell:void 0,headerCell:void 0},initialize:function(){this.has("label")||this.set({label:this.get("name")},{silent:!0});var e=a.resolveNameToClass(this.get("headerCell"),"HeaderCell"),t=a.resolveNameToClass(this.get("cell"),"Cell");this.set({cell:t,headerCell:e},{silent:!0})},sortValue:function(){var t=this.get("sortValue");return e.isString(t)?this[t]:e.isFunction(t)?t:function(e,t){return e.get(t)}}});e.each(["sortable","renderable","editable"],(function(t){$.prototype[t]=function(){var n=this.get(t);return e.isString(n)?this[n]:e.isFunction(n)?n:!!n}}));var S=a.Columns=t.Collection.extend({model:$}),A=a.Row=t.View.extend({tagName:"tr",initialize:function(e){var n=this.columns=e.columns;n instanceof t.Collection||(n=this.columns=new S(n));for(var i=this.cells=[],r=0;r<n.length;r++)i.push(this.makeCell(n.at(r),e));this.listenTo(n,"add",(function(t,n){var r=n.indexOf(t),s=this.makeCell(t,e);i.splice(r,0,s);var o=this.$el;0===r?o.prepend(s.render().$el):r===n.length-1?o.append(s.render().$el):o.children().eq(r).before(s.render().$el)})),this.listenTo(n,"remove",(function(e,t,n){i[n.index].remove(),i.splice(n.index,1)}))},makeCell:function(e){return new(e.get("cell"))({column:e,model:this.model})},render:function(){this.$el.empty();for(var e=document.createDocumentFragment(),t=0;t<this.cells.length;t++)e.appendChild(this.cells[t].render().el);return this.el.appendChild(e),this.delegateEvents(),this},remove:function(){for(var e=0;e<this.cells.length;e++){var n=this.cells[e];n.remove.apply(n,arguments)}return t.View.prototype.remove.apply(this,arguments)}}),N=a.EmptyRow=t.View.extend({tagName:"tr",emptyText:null,initialize:function(e){this.emptyText=e.emptyText,this.columns=e.columns},render:function(){this.$el.empty();var t=document.createElement("td");t.setAttribute("colspan",this.columns.length);var n=document.createElement("span");return n.innerHTML=e.result(this,"emptyText"),t.appendChild(n),this.el.className="empty",this.el.appendChild(t),this}}),j=a.HeaderCell=t.View.extend({tagName:"th",events:{"click button":"onClick"},initialize:function(e){this.column=e.column,this.column instanceof $||(this.column=new $(this.column));var t=this.column,n=this.collection,i=this.$el;this.listenTo(t,"change:editable change:sortable change:renderable",(function(e){var t=e.changedAttributes();for(var n in t)t.hasOwnProperty(n)&&i.toggleClass(n,t[n])})),this.listenTo(t,"change:direction",this.setCellDirection),this.listenTo(t,"change:name change:label",this.render),a.callByNeed(t.editable(),t,n)&&i.addClass("editable"),a.callByNeed(t.sortable(),t,n)&&i.addClass("sortable"),a.callByNeed(t.renderable(),t,n)&&i.addClass("renderable"),this.listenTo(n.fullCollection||n,"backgrid:sorted",this.removeCellDirection)},removeCellDirection:function(){this.$el.removeClass("ascending").removeClass("descending"),this.column.set("direction",null)},setCellDirection:function(e,t){this.$el.removeClass("ascending").removeClass("descending"),e.cid==this.column.cid&&this.$el.addClass(t)},onClick:function(e){e.preventDefault();var t,n=this.column,i=this.collection,r="backgrid:sort";a.callByNeed(n.sortable(),n,this.collection)&&("toggle"===n.get("sortType")?(t=n,"ascending"===n.get("direction")?i.trigger(r,t,"descending"):i.trigger(r,t,"ascending")):function(e,t){"ascending"===n.get("direction")?i.trigger(r,t,"descending"):"descending"===n.get("direction")?i.trigger(r,t,null):i.trigger(r,t,"ascending")}(0,n))},render:function(){this.$el.empty();var e,t=this.column;return e=a.callByNeed(t.sortable(),t,this.collection)?o("<button>").text(t.get("label")).append("<span class='sort-caret' aria-hidden='true'></span>"):document.createTextNode(t.get("label")),this.$el.append(e),this.$el.addClass(t.get("name")),this.$el.addClass(t.get("direction")),this.delegateEvents(),this}}),D=(a.HeaderRow=a.Row.extend({initialize:function(){a.Row.prototype.initialize.apply(this,arguments)},makeCell:function(e,t){var n=e.get("headerCell")||t.headerCell||j;return n=new n({column:e,collection:this.collection})}}),a.Header=t.View.extend({tagName:"thead",initialize:function(e){this.columns=e.columns,this.columns instanceof t.Collection||(this.columns=new S(this.columns)),this.row=new a.HeaderRow({columns:this.columns,collection:this.collection})},render:function(){return this.$el.append(this.row.render().$el),this.delegateEvents(),this},remove:function(){return this.row.remove.apply(this.row,arguments),t.View.prototype.remove.apply(this,arguments)}})),R=a.Body=t.View.extend({tagName:"tbody",initialize:function(e){this.columns=e.columns,this.columns instanceof t.Collection||(this.columns=new S(this.columns)),this.row=e.row||this.row||A,this.rows=this.collection.map((function(e){return new this.row({columns:this.columns,model:e})}),this),this.emptyText=e.emptyText,this._unshiftEmptyRowMayBe();var n=this.collection;this.listenTo(n,"add",this.insertRow),this.listenTo(n,"remove",this.removeRow),this.listenTo(n,"sort",this.refresh),this.listenTo(n,"reset",this.refresh),this.listenTo(n,"backgrid:sort",this.sort),this.listenTo(n,"backgrid:edited",this.moveToNextCell),this.listenTo(this.columns,"add remove",this.updateEmptyRow)},_unshiftEmptyRowMayBe:function(){if(0===this.rows.length&&null!=this.emptyText)return this.emptyRow=new N({emptyText:this.emptyText,columns:this.columns}),this.rows.unshift(this.emptyRow),!0},insertRow:function(e,n,i){if(this.rows[0]instanceof N&&this.rows.pop().remove(),n instanceof t.Collection||i){var r=new this.row({columns:this.columns,model:e}),s=n.indexOf(e);this.rows.splice(s,0,r);var o=this.$el,a=o.children(),u=r.render().$el;return s>=a.length?o.append(u):a.eq(s).before(u),this}this.collection.add(e,i=n)},removeRow:function(t,n,i){return i?((e.isUndefined(i.render)||i.render)&&this.rows[i.index].remove(),this.rows.splice(i.index,1),this._unshiftEmptyRowMayBe()&&this.render(),this):(this.collection.remove(t,i=n),void(this._unshiftEmptyRowMayBe()&&this.render()))},updateEmptyRow:function(){null!=this.emptyRow&&this.emptyRow.render()},refresh:function(){for(var e=0;e<this.rows.length;e++)this.rows[e].remove();return this.rows=this.collection.map((function(e){return new this.row({columns:this.columns,model:e})}),this),this._unshiftEmptyRowMayBe(),this.render(),this.collection.trigger("backgrid:refresh",this),this},render:function(){this.$el.empty();for(var e=document.createDocumentFragment(),t=0;t<this.rows.length;t++){var n=this.rows[t];e.appendChild(n.render().el)}return this.el.appendChild(e),this.delegateEvents(),this},remove:function(){for(var e=0;e<this.rows.length;e++){var n=this.rows[e];n.remove.apply(n,arguments)}return t.View.prototype.remove.apply(this,arguments)},sort:function(n,i){if(!e.contains(["ascending","descending",null],i))throw new RangeError('direction must be one of "ascending", "descending" or `null`');e.isString(n)&&(n=this.columns.findWhere({name:n}));var r,s=this.collection;r="ascending"===i?-1:"descending"===i?1:null;var o=this.makeComparator(n.get("name"),r,r?n.sortValue():function(e){return 1*e.cid.replace("c","")});return t.PageableCollection&&s instanceof t.PageableCollection?(s.setSorting(r&&n.get("name"),r,{sortValue:n.sortValue()}),s.fullCollection?(null==s.fullCollection.comparator&&(s.fullCollection.comparator=o),s.fullCollection.sort(),s.trigger("backgrid:sorted",n,i,s),n.set("direction",i)):s.fetch({reset:!0,success:function(){s.trigger("backgrid:sorted",n,i,s),n.set("direction",i)}})):(s.comparator=o,s.sort(),s.trigger("backgrid:sorted",n,i,s),n.set("direction",i)),this},makeComparator:function(e,t,n){return function(i,r){var s,o=n(i,e),a=n(r,e);return 1===t&&(s=o,o=a,a=s),o===a?0:o<a?-1:1}},moveToNextCell:function(e,t,n){var i,r,s,o,u,l=this.collection.indexOf(e),c=this.columns.indexOf(t);if(-1===c)return this;if(this.rows[l].cells[c].exitEditMode(),n.moveUp()||n.moveDown()||n.moveLeft()||n.moveRight()||n.save()){var d=this.columns.length,h=d*this.collection.length;if(n.moveUp()||n.moveDown()){o=l+(n.moveUp()?-1:1);var f=this.rows[o];f?(i=f.cells[c],a.callByNeed(i.column.editable(),i.column,e)&&(i.enterEditMode(),e.trigger("backgrid:next",o,c,!1))):e.trigger("backgrid:next",o,c,!0)}else if(n.moveLeft()||n.moveRight()){for(var p=n.moveRight(),m=l*d+c+(p?1:-1);m>=0&&m<h;p?m++:m--)if(u=m-(o=~~(m/d))*d,i=this.rows[o].cells[u],r=a.callByNeed(i.column.renderable(),i.column,i.model),s=a.callByNeed(i.column.editable(),i.column,e),r&&s){i.enterEditMode(),e.trigger("backgrid:next",o,u,!1);break}m==h&&e.trigger("backgrid:next",~~(m/d),m-o*d,!0)}}return this}});return a.Footer=t.View.extend({tagName:"tfoot",initialize:function(e){this.columns=e.columns,this.columns instanceof t.Collection||(this.columns=new a.Columns(this.columns))}}),a.Grid=t.View.extend({tagName:"table",className:"backgrid",header:D,body:R,footer:null,initialize:function(n){n.columns instanceof t.Collection||(n.columns=new S(n.columns||this.columns)),this.columns=n.columns,this.caption=n.caption;var i=e.omit(n,["el","id","attributes","className","tagName","events"]);this.body=n.body||this.body,this.body=new this.body(i),this.header=n.header||this.header,this.header&&(this.header=new this.header(i)),this.footer=n.footer||this.footer,this.footer&&(this.footer=new this.footer(i)),this.listenTo(this.columns,"reset",(function(){this.header&&(this.header=new(this.header.remove().constructor)(i)),this.body=new(this.body.remove().constructor)(i),this.footer&&(this.footer=new(this.footer.remove().constructor)(i)),this.render()}))},insertRow:function(){return this.body.insertRow.apply(this.body,arguments),this},removeRow:function(){return this.body.removeRow.apply(this.body,arguments),this},insertColumn:function(){return this.columns.add.apply(this.columns,arguments),this},removeColumn:function(){return this.columns.remove.apply(this.columns,arguments),this},sort:function(){return this.body.sort.apply(this.body,arguments),this},render:function(){return this.$el.empty(),this.caption&&this.$el.append(o("<caption>").text(this.caption)),this.header&&this.$el.append(this.header.render().$el),this.footer&&this.$el.append(this.footer.render().$el),this.$el.append(this.body.render().$el),this.delegateEvents(),this.trigger("backgrid:rendered",this),this},remove:function(){return this.header&&this.header.remove.apply(this.header,arguments),this.body.remove.apply(this.body,arguments),this.footer&&this.footer.remove.apply(this.footer,arguments),t.View.prototype.remove.apply(this,arguments)}}),a}(e,t)}.apply(t,i))||(e.exports=r)},17:function(e,t,n){(function(i){var r,s,o;o="object"==typeof self&&self.self===self&&self||"object"==typeof i&&i.global===i&&i,r=[n(8),n(12),t],void 0===(s=function(e,t,n){o.Backbone=function(e,t,n,i){var r=e.Backbone,s=Array.prototype.slice;t.VERSION="1.3.3",t.$=i,t.noConflict=function(){return e.Backbone=r,this},t.emulateHTTP=!1,t.emulateJSON=!1;var o=function(e,t,i){n.each(t,(function(t,r){n[r]&&(e.prototype[r]=function(e,t,i){switch(e){case 1:return function(){return n[t](this[i])};case 2:return function(e){return n[t](this[i],e)};case 3:return function(e,r){return n[t](this[i],a(e,this),r)};case 4:return function(e,r,s){return n[t](this[i],a(e,this),r,s)};default:return function(){var e=s.call(arguments);return e.unshift(this[i]),n[t].apply(n,e)}}}(t,r,i))}))},a=function(e,t){return n.isFunction(e)?e:n.isObject(e)&&!t._isModel(e)?u(e):n.isString(e)?function(t){return t.get(e)}:e},u=function(e){var t=n.matches(e);return function(e){return t(e.attributes)}},l=t.Events={},c=/\s+/,d=function(e,t,i,r,s){var o,a=0;if(i&&"object"==typeof i){void 0!==r&&"context"in s&&void 0===s.context&&(s.context=r);for(o=n.keys(i);a<o.length;a++)t=d(e,t,o[a],i[o[a]],s)}else if(i&&c.test(i))for(o=i.split(c);a<o.length;a++)t=e(t,o[a],r,s);else t=e(t,i,r,s);return t};l.on=function(e,t,n){return h(this,e,t,n)};var h=function(e,t,n,i,r){return e._events=d(f,e._events||{},t,n,{context:i,ctx:e,listening:r}),r&&((e._listeners||(e._listeners={}))[r.id]=r),e};l.listenTo=function(e,t,i){if(!e)return this;var r=e._listenId||(e._listenId=n.uniqueId("l")),s=this._listeningTo||(this._listeningTo={}),o=s[r];if(!o){var a=this._listenId||(this._listenId=n.uniqueId("l"));o=s[r]={obj:e,objId:r,id:a,listeningTo:s,count:0}}return h(e,t,i,this,o),this};var f=function(e,t,n,i){if(n){var r=e[t]||(e[t]=[]),s=i.context,o=i.ctx,a=i.listening;a&&a.count++,r.push({callback:n,context:s,ctx:s||o,listening:a})}return e};l.off=function(e,t,n){return this._events?(this._events=d(p,this._events,e,t,{context:n,listeners:this._listeners}),this):this},l.stopListening=function(e,t,i){var r=this._listeningTo;if(!r)return this;for(var s=e?[e._listenId]:n.keys(r),o=0;o<s.length;o++){var a=r[s[o]];if(!a)break;a.obj.off(t,i,this)}return this};var p=function(e,t,i,r){if(e){var s,o=0,a=r.context,u=r.listeners;if(t||i||a){for(var l=t?[t]:n.keys(e);o<l.length;o++){var c=e[t=l[o]];if(!c)break;for(var d=[],h=0;h<c.length;h++){var f=c[h];i&&i!==f.callback&&i!==f.callback._callback||a&&a!==f.context?d.push(f):(s=f.listening)&&0==--s.count&&(delete u[s.id],delete s.listeningTo[s.objId])}d.length?e[t]=d:delete e[t]}return e}for(var p=n.keys(u);o<p.length;o++)delete u[(s=u[p[o]]).id],delete s.listeningTo[s.objId]}};l.once=function(e,t,i){var r=d(m,{},e,t,n.bind(this.off,this));return"string"==typeof e&&null==i&&(t=void 0),this.on(r,t,i)},l.listenToOnce=function(e,t,i){var r=d(m,{},t,i,n.bind(this.stopListening,this,e));return this.listenTo(e,r)};var m=function(e,t,i,r){if(i){var s=e[t]=n.once((function(){r(t,s),i.apply(this,arguments)}));s._callback=i}return e};l.trigger=function(e){if(!this._events)return this;for(var t=Math.max(0,arguments.length-1),n=Array(t),i=0;i<t;i++)n[i]=arguments[i+1];return d(v,this._events,e,void 0,n),this};var v=function(e,t,n,i){if(e){var r=e[t],s=e.all;r&&s&&(s=s.slice()),r&&g(r,i),s&&g(s,[t].concat(i))}return e},g=function(e,t){var n,i=-1,r=e.length,s=t[0],o=t[1],a=t[2];switch(t.length){case 0:for(;++i<r;)(n=e[i]).callback.call(n.ctx);return;case 1:for(;++i<r;)(n=e[i]).callback.call(n.ctx,s);return;case 2:for(;++i<r;)(n=e[i]).callback.call(n.ctx,s,o);return;case 3:for(;++i<r;)(n=e[i]).callback.call(n.ctx,s,o,a);return;default:for(;++i<r;)(n=e[i]).callback.apply(n.ctx,t);return}};l.bind=l.on,l.unbind=l.off,n.extend(t,l);var y=t.Model=function(e,t){var i=e||{};t||(t={}),this.cid=n.uniqueId(this.cidPrefix),this.attributes={},t.collection&&(this.collection=t.collection),t.parse&&(i=this.parse(i,t)||{});var r=n.result(this,"defaults");i=n.defaults(n.extend({},r,i),r),this.set(i,t),this.changed={},this.initialize.apply(this,arguments)};n.extend(y.prototype,l,{changed:null,validationError:null,idAttribute:"id",cidPrefix:"c",initialize:function(){},toJSON:function(e){return n.clone(this.attributes)},sync:function(){return t.sync.apply(this,arguments)},get:function(e){return this.attributes[e]},escape:function(e){return n.escape(this.get(e))},has:function(e){return null!=this.get(e)},matches:function(e){return!!n.iteratee(e,this)(this.attributes)},set:function(e,t,i){if(null==e)return this;var r;if("object"==typeof e?(r=e,i=t):(r={})[e]=t,i||(i={}),!this._validate(r,i))return!1;var s=i.unset,o=i.silent,a=[],u=this._changing;this._changing=!0,u||(this._previousAttributes=n.clone(this.attributes),this.changed={});var l=this.attributes,c=this.changed,d=this._previousAttributes;for(var h in r)t=r[h],n.isEqual(l[h],t)||a.push(h),n.isEqual(d[h],t)?delete c[h]:c[h]=t,s?delete l[h]:l[h]=t;if(this.idAttribute in r&&(this.id=this.get(this.idAttribute)),!o){a.length&&(this._pending=i);for(var f=0;f<a.length;f++)this.trigger("change:"+a[f],this,l[a[f]],i)}if(u)return this;if(!o)for(;this._pending;)i=this._pending,this._pending=!1,this.trigger("change",this,i);return this._pending=!1,this._changing=!1,this},unset:function(e,t){return this.set(e,void 0,n.extend({},t,{unset:!0}))},clear:function(e){var t={};for(var i in this.attributes)t[i]=void 0;return this.set(t,n.extend({},e,{unset:!0}))},hasChanged:function(e){return null==e?!n.isEmpty(this.changed):n.has(this.changed,e)},changedAttributes:function(e){if(!e)return!!this.hasChanged()&&n.clone(this.changed);var t=this._changing?this._previousAttributes:this.attributes,i={};for(var r in e){var s=e[r];n.isEqual(t[r],s)||(i[r]=s)}return!!n.size(i)&&i},previous:function(e){return null!=e&&this._previousAttributes?this._previousAttributes[e]:null},previousAttributes:function(){return n.clone(this._previousAttributes)},fetch:function(e){e=n.extend({parse:!0},e);var t=this,i=e.success;return e.success=function(n){var r=e.parse?t.parse(n,e):n;if(!t.set(r,e))return!1;i&&i.call(e.context,t,n,e),t.trigger("sync",t,n,e)},P(this,e),this.sync("read",this,e)},save:function(e,t,i){var r;null==e||"object"==typeof e?(r=e,i=t):(r={})[e]=t;var s=(i=n.extend({validate:!0,parse:!0},i)).wait;if(r&&!s){if(!this.set(r,i))return!1}else if(!this._validate(r,i))return!1;var o=this,a=i.success,u=this.attributes;i.success=function(e){o.attributes=u;var t=i.parse?o.parse(e,i):e;if(s&&(t=n.extend({},r,t)),t&&!o.set(t,i))return!1;a&&a.call(i.context,o,e,i),o.trigger("sync",o,e,i)},P(this,i),r&&s&&(this.attributes=n.extend({},u,r));var l=this.isNew()?"create":i.patch?"patch":"update";"patch"!==l||i.attrs||(i.attrs=r);var c=this.sync(l,this,i);return this.attributes=u,c},destroy:function(e){e=e?n.clone(e):{};var t=this,i=e.success,r=e.wait,s=function(){t.stopListening(),t.trigger("destroy",t,t.collection,e)};e.success=function(n){r&&s(),i&&i.call(e.context,t,n,e),t.isNew()||t.trigger("sync",t,n,e)};var o=!1;return this.isNew()?n.defer(e.success):(P(this,e),o=this.sync("delete",this,e)),r||s(),o},url:function(){var e=n.result(this,"urlRoot")||n.result(this.collection,"url")||F();if(this.isNew())return e;var t=this.get(this.idAttribute);return e.replace(/[^\/]$/,"$&/")+encodeURIComponent(t)},parse:function(e,t){return e},clone:function(){return new this.constructor(this.attributes)},isNew:function(){return!this.has(this.idAttribute)},isValid:function(e){return this._validate({},n.extend({},e,{validate:!0}))},_validate:function(e,t){if(!t.validate||!this.validate)return!0;e=n.extend({},this.attributes,e);var i=this.validationError=this.validate(e,t)||null;return!i||(this.trigger("invalid",this,i,n.extend(t,{validationError:i})),!1)}}),o(y,{keys:1,values:1,pairs:1,invert:1,pick:0,omit:0,chain:1,isEmpty:1},"attributes");var b=t.Collection=function(e,t){t||(t={}),t.model&&(this.model=t.model),void 0!==t.comparator&&(this.comparator=t.comparator),this._reset(),this.initialize.apply(this,arguments),e&&this.reset(e,n.extend({silent:!0},t))},_={add:!0,remove:!0,merge:!0},x={add:!0,remove:!1},w=function(e,t,n){n=Math.min(Math.max(n,0),e.length);var i,r=Array(e.length-n),s=t.length;for(i=0;i<r.length;i++)r[i]=e[i+n];for(i=0;i<s;i++)e[i+n]=t[i];for(i=0;i<r.length;i++)e[i+s+n]=r[i]};n.extend(b.prototype,l,{model:y,initialize:function(){},toJSON:function(e){return this.map((function(t){return t.toJSON(e)}))},sync:function(){return t.sync.apply(this,arguments)},add:function(e,t){return this.set(e,n.extend({merge:!1},t,x))},remove:function(e,t){t=n.extend({},t);var i=!n.isArray(e);e=i?[e]:e.slice();var r=this._removeModels(e,t);return!t.silent&&r.length&&(t.changes={added:[],merged:[],removed:r},this.trigger("update",this,t)),i?r[0]:r},set:function(e,t){if(null!=e){(t=n.extend({},_,t)).parse&&!this._isModel(e)&&(e=this.parse(e,t)||[]);var i=!n.isArray(e);e=i?[e]:e.slice();var r=t.at;null!=r&&(r=+r),r>this.length&&(r=this.length),r<0&&(r+=this.length+1);var s,o,a=[],u=[],l=[],c=[],d={},h=t.add,f=t.merge,p=t.remove,m=!1,v=this.comparator&&null==r&&!1!==t.sort,g=n.isString(this.comparator)?this.comparator:null;for(o=0;o<e.length;o++){s=e[o];var y=this.get(s);if(y){if(f&&s!==y){var b=this._isModel(s)?s.attributes:s;t.parse&&(b=y.parse(b,t)),y.set(b,t),l.push(y),v&&!m&&(m=y.hasChanged(g))}d[y.cid]||(d[y.cid]=!0,a.push(y)),e[o]=y}else h&&(s=e[o]=this._prepareModel(s,t))&&(u.push(s),this._addReference(s,t),d[s.cid]=!0,a.push(s))}if(p){for(o=0;o<this.length;o++)d[(s=this.models[o]).cid]||c.push(s);c.length&&this._removeModels(c,t)}var x=!1,k=!v&&h&&p;if(a.length&&k?(x=this.length!==a.length||n.some(this.models,(function(e,t){return e!==a[t]})),this.models.length=0,w(this.models,a,0),this.length=this.models.length):u.length&&(v&&(m=!0),w(this.models,u,null==r?this.length:r),this.length=this.models.length),m&&this.sort({silent:!0}),!t.silent){for(o=0;o<u.length;o++)null!=r&&(t.index=r+o),(s=u[o]).trigger("add",s,this,t);(m||x)&&this.trigger("sort",this,t),(u.length||c.length||l.length)&&(t.changes={added:u,removed:c,merged:l},this.trigger("update",this,t))}return i?e[0]:e}},reset:function(e,t){t=t?n.clone(t):{};for(var i=0;i<this.models.length;i++)this._removeReference(this.models[i],t);return t.previousModels=this.models,this._reset(),e=this.add(e,n.extend({silent:!0},t)),t.silent||this.trigger("reset",this,t),e},push:function(e,t){return this.add(e,n.extend({at:this.length},t))},pop:function(e){var t=this.at(this.length-1);return this.remove(t,e)},unshift:function(e,t){return this.add(e,n.extend({at:0},t))},shift:function(e){var t=this.at(0);return this.remove(t,e)},slice:function(){return s.apply(this.models,arguments)},get:function(e){if(null!=e)return this._byId[e]||this._byId[this.modelId(e.attributes||e)]||e.cid&&this._byId[e.cid]},has:function(e){return null!=this.get(e)},at:function(e){return e<0&&(e+=this.length),this.models[e]},where:function(e,t){return this[t?"find":"filter"](e)},findWhere:function(e){return this.where(e,!0)},sort:function(e){var t=this.comparator;if(!t)throw new Error("Cannot sort a set without a comparator");e||(e={});var i=t.length;return n.isFunction(t)&&(t=n.bind(t,this)),1===i||n.isString(t)?this.models=this.sortBy(t):this.models.sort(t),e.silent||this.trigger("sort",this,e),this},pluck:function(e){return this.map(e+"")},fetch:function(e){var t=(e=n.extend({parse:!0},e)).success,i=this;return e.success=function(n){var r=e.reset?"reset":"set";i[r](n,e),t&&t.call(e.context,i,n,e),i.trigger("sync",i,n,e)},P(this,e),this.sync("read",this,e)},create:function(e,t){var i=(t=t?n.clone(t):{}).wait;if(!(e=this._prepareModel(e,t)))return!1;i||this.add(e,t);var r=this,s=t.success;return t.success=function(e,t,n){i&&r.add(e,n),s&&s.call(n.context,e,t,n)},e.save(null,t),e},parse:function(e,t){return e},clone:function(){return new this.constructor(this.models,{model:this.model,comparator:this.comparator})},modelId:function(e){return e[this.model.prototype.idAttribute||"id"]},_reset:function(){this.length=0,this.models=[],this._byId={}},_prepareModel:function(e,t){if(this._isModel(e))return e.collection||(e.collection=this),e;(t=t?n.clone(t):{}).collection=this;var i=new this.model(e,t);return i.validationError?(this.trigger("invalid",this,i.validationError,t),!1):i},_removeModels:function(e,t){for(var n=[],i=0;i<e.length;i++){var r=this.get(e[i]);if(r){var s=this.indexOf(r);this.models.splice(s,1),this.length--,delete this._byId[r.cid];var o=this.modelId(r.attributes);null!=o&&delete this._byId[o],t.silent||(t.index=s,r.trigger("remove",r,this,t)),n.push(r),this._removeReference(r,t)}}return n},_isModel:function(e){return e instanceof y},_addReference:function(e,t){this._byId[e.cid]=e;var n=this.modelId(e.attributes);null!=n&&(this._byId[n]=e),e.on("all",this._onModelEvent,this)},_removeReference:function(e,t){delete this._byId[e.cid];var n=this.modelId(e.attributes);null!=n&&delete this._byId[n],this===e.collection&&delete e.collection,e.off("all",this._onModelEvent,this)},_onModelEvent:function(e,t,n,i){if(t){if(("add"===e||"remove"===e)&&n!==this)return;if("destroy"===e&&this.remove(t,i),"change"===e){var r=this.modelId(t.previousAttributes()),s=this.modelId(t.attributes);r!==s&&(null!=r&&delete this._byId[r],null!=s&&(this._byId[s]=t))}}this.trigger.apply(this,arguments)}}),o(b,{forEach:3,each:3,map:3,collect:3,reduce:0,foldl:0,inject:0,reduceRight:0,foldr:0,find:3,detect:3,filter:3,select:3,reject:3,every:3,all:3,some:3,any:3,include:3,includes:3,contains:3,invoke:0,max:3,min:3,toArray:1,size:1,first:3,head:3,take:3,initial:3,rest:3,tail:3,drop:3,last:3,without:0,difference:0,indexOf:3,shuffle:1,lastIndexOf:3,isEmpty:1,chain:1,sample:3,partition:3,groupBy:3,countBy:3,sortBy:3,indexBy:3,findIndex:3,findLastIndex:3},"models");var k=t.View=function(e){this.cid=n.uniqueId("view"),n.extend(this,n.pick(e,C)),this._ensureElement(),this.initialize.apply(this,arguments)},E=/^(\S+)\s*(.*)$/,C=["model","collection","el","id","attributes","className","tagName","events"];n.extend(k.prototype,l,{tagName:"div",$:function(e){return this.$el.find(e)},initialize:function(){},render:function(){return this},remove:function(){return this._removeElement(),this.stopListening(),this},_removeElement:function(){this.$el.remove()},setElement:function(e){return this.undelegateEvents(),this._setElement(e),this.delegateEvents(),this},_setElement:function(e){this.$el=e instanceof t.$?e:t.$(e),this.el=this.$el[0]},delegateEvents:function(e){if(e||(e=n.result(this,"events")),!e)return this;for(var t in this.undelegateEvents(),e){var i=e[t];if(n.isFunction(i)||(i=this[i]),i){var r=t.match(E);this.delegate(r[1],r[2],n.bind(i,this))}}return this},delegate:function(e,t,n){return this.$el.on(e+".delegateEvents"+this.cid,t,n),this},undelegateEvents:function(){return this.$el&&this.$el.off(".delegateEvents"+this.cid),this},undelegate:function(e,t,n){return this.$el.off(e+".delegateEvents"+this.cid,t,n),this},_createElement:function(e){return document.createElement(e)},_ensureElement:function(){if(this.el)this.setElement(n.result(this,"el"));else{var e=n.extend({},n.result(this,"attributes"));this.id&&(e.id=n.result(this,"id")),this.className&&(e.class=n.result(this,"className")),this.setElement(this._createElement(n.result(this,"tagName"))),this._setAttributes(e)}},_setAttributes:function(e){this.$el.attr(e)}}),t.sync=function(e,i,r){var s=T[e];n.defaults(r||(r={}),{emulateHTTP:t.emulateHTTP,emulateJSON:t.emulateJSON});var o={type:s,dataType:"json"};if(r.url||(o.url=n.result(i,"url")||F()),null!=r.data||!i||"create"!==e&&"update"!==e&&"patch"!==e||(o.contentType="application/json",o.data=JSON.stringify(r.attrs||i.toJSON(r))),r.emulateJSON&&(o.contentType="application/x-www-form-urlencoded",o.data=o.data?{model:o.data}:{}),r.emulateHTTP&&("PUT"===s||"DELETE"===s||"PATCH"===s)){o.type="POST",r.emulateJSON&&(o.data._method=s);var a=r.beforeSend;r.beforeSend=function(e){if(e.setRequestHeader("X-HTTP-Method-Override",s),a)return a.apply(this,arguments)}}"GET"===o.type||r.emulateJSON||(o.processData=!1);var u=r.error;r.error=function(e,t,n){r.textStatus=t,r.errorThrown=n,u&&u.call(r.context,e,t,n)};var l=r.xhr=t.ajax(n.extend(o,r));return i.trigger("request",i,l,r),l};var T={create:"POST",update:"PUT",patch:"PATCH",delete:"DELETE",read:"GET"};t.ajax=function(){return t.$.ajax.apply(t.$,arguments)};var $=t.Router=function(e){e||(e={}),e.routes&&(this.routes=e.routes),this._bindRoutes(),this.initialize.apply(this,arguments)},S=/\((.*?)\)/g,A=/(\(\?)?:\w+/g,N=/\*\w+/g,j=/[\-{}\[\]+?.,\\\^$|#\s]/g;n.extend($.prototype,l,{initialize:function(){},route:function(e,i,r){n.isRegExp(e)||(e=this._routeToRegExp(e)),n.isFunction(i)&&(r=i,i=""),r||(r=this[i]);var s=this;return t.history.route(e,(function(n){var o=s._extractParameters(e,n);!1!==s.execute(r,o,i)&&(s.trigger.apply(s,["route:"+i].concat(o)),s.trigger("route",i,o),t.history.trigger("route",s,i,o))})),this},execute:function(e,t,n){e&&e.apply(this,t)},navigate:function(e,n){return t.history.navigate(e,n),this},_bindRoutes:function(){if(this.routes){this.routes=n.result(this,"routes");for(var e,t=n.keys(this.routes);null!=(e=t.pop());)this.route(e,this.routes[e])}},_routeToRegExp:function(e){return e=e.replace(j,"\\$&").replace(S,"(?:$1)?").replace(A,(function(e,t){return t?e:"([^/?]+)"})).replace(N,"([^?]*?)"),new RegExp("^"+e+"(?:\\?([\\s\\S]*))?$")},_extractParameters:function(e,t){var i=e.exec(t).slice(1);return n.map(i,(function(e,t){return t===i.length-1?e||null:e?decodeURIComponent(e):null}))}});var D=t.History=function(){this.handlers=[],this.checkUrl=n.bind(this.checkUrl,this),"undefined"!=typeof window&&(this.location=window.location,this.history=window.history)},R=/^[#\/]|\s+$/g,O=/^\/+|\/+$/g,I=/#.*$/;D.started=!1,n.extend(D.prototype,l,{interval:50,atRoot:function(){return this.location.pathname.replace(/[^\/]$/,"$&/")===this.root&&!this.getSearch()},matchRoot:function(){return this.decodeFragment(this.location.pathname).slice(0,this.root.length-1)+"/"===this.root},decodeFragment:function(e){return decodeURI(e.replace(/%25/g,"%2525"))},getSearch:function(){var e=this.location.href.replace(/#.*/,"").match(/\?.+/);return e?e[0]:""},getHash:function(e){var t=(e||this).location.href.match(/#(.*)$/);return t?t[1]:""},getPath:function(){var e=this.decodeFragment(this.location.pathname+this.getSearch()).slice(this.root.length-1);return"/"===e.charAt(0)?e.slice(1):e},getFragment:function(e){return null==e&&(e=this._usePushState||!this._wantsHashChange?this.getPath():this.getHash()),e.replace(R,"")},start:function(e){if(D.started)throw new Error("Backbone.history has already been started");if(D.started=!0,this.options=n.extend({root:"/"},this.options,e),this.root=this.options.root,this._wantsHashChange=!1!==this.options.hashChange,this._hasHashChange="onhashchange"in window&&(void 0===document.documentMode||document.documentMode>7),this._useHashChange=this._wantsHashChange&&this._hasHashChange,this._wantsPushState=!!this.options.pushState,this._hasPushState=!(!this.history||!this.history.pushState),this._usePushState=this._wantsPushState&&this._hasPushState,this.fragment=this.getFragment(),this.root=("/"+this.root+"/").replace(O,"/"),this._wantsHashChange&&this._wantsPushState){if(!this._hasPushState&&!this.atRoot()){var t=this.root.slice(0,-1)||"/";return this.location.replace(t+"#"+this.getPath()),!0}this._hasPushState&&this.atRoot()&&this.navigate(this.getHash(),{replace:!0})}if(!this._hasHashChange&&this._wantsHashChange&&!this._usePushState){this.iframe=document.createElement("iframe"),this.iframe.src="javascript:0",this.iframe.style.display="none",this.iframe.tabIndex=-1;var i=document.body,r=i.insertBefore(this.iframe,i.firstChild).contentWindow;r.document.open(),r.document.close(),r.location.hash="#"+this.fragment}var s=window.addEventListener||function(e,t){return attachEvent("on"+e,t)};if(this._usePushState?s("popstate",this.checkUrl,!1):this._useHashChange&&!this.iframe?s("hashchange",this.checkUrl,!1):this._wantsHashChange&&(this._checkUrlInterval=setInterval(this.checkUrl,this.interval)),!this.options.silent)return this.loadUrl()},stop:function(){var e=window.removeEventListener||function(e,t){return detachEvent("on"+e,t)};this._usePushState?e("popstate",this.checkUrl,!1):this._useHashChange&&!this.iframe&&e("hashchange",this.checkUrl,!1),this.iframe&&(document.body.removeChild(this.iframe),this.iframe=null),this._checkUrlInterval&&clearInterval(this._checkUrlInterval),D.started=!1},route:function(e,t){this.handlers.unshift({route:e,callback:t})},checkUrl:function(e){var t=this.getFragment();if(t===this.fragment&&this.iframe&&(t=this.getHash(this.iframe.contentWindow)),t===this.fragment)return!1;this.iframe&&this.navigate(t),this.loadUrl()},loadUrl:function(e){return!!this.matchRoot()&&(e=this.fragment=this.getFragment(e),n.some(this.handlers,(function(t){if(t.route.test(e))return t.callback(e),!0})))},navigate:function(e,t){if(!D.started)return!1;t&&!0!==t||(t={trigger:!!t}),e=this.getFragment(e||"");var n=this.root;""!==e&&"?"!==e.charAt(0)||(n=n.slice(0,-1)||"/");var i=n+e;if(e=this.decodeFragment(e.replace(I,"")),this.fragment!==e){if(this.fragment=e,this._usePushState)this.history[t.replace?"replaceState":"pushState"]({},document.title,i);else{if(!this._wantsHashChange)return this.location.assign(i);if(this._updateHash(this.location,e,t.replace),this.iframe&&e!==this.getHash(this.iframe.contentWindow)){var r=this.iframe.contentWindow;t.replace||(r.document.open(),r.document.close()),this._updateHash(r.location,e,t.replace)}}return t.trigger?this.loadUrl(e):void 0}},_updateHash:function(e,t,n){if(n){var i=e.href.replace(/(javascript:|#).*$/,"");e.replace(i+"#"+t)}else e.hash="#"+t}}),t.history=new D,y.extend=b.extend=$.extend=k.extend=D.extend=function(e,t){var i,r=this;return i=e&&n.has(e,"constructor")?e.constructor:function(){return r.apply(this,arguments)},n.extend(i,r,t),i.prototype=n.create(r.prototype,e),i.prototype.constructor=i,i.__super__=r.prototype,i};var F=function(){throw new Error('A "url" property or function must be specified')},P=function(e,t){var n=t.error;t.error=function(i){n&&n.call(t.context,e,i,t),e.trigger("error",e,i,t)}};return t}(o,n,e,t)}.apply(t,r))||(e.exports=s)}).call(this,n(7))},181:function(e,t,n){"use strict";n.r(t);n(15);function i(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}var r=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.element=$("#openassessment_validation_alert"),this.editorElement=$(this.element).parent(),this.title=$(".openassessment_alert_title",this.element),this.message=$(".openassessment_alert_message",this.element),this.closeButton=$(".openassessment_alert_close",this.element),this.ALERT_YELLOW="rgb(192, 172, 0)",this.DARK_GREY="#323232"}var t,n,r;return t=e,(n=[{key:"install",value:function(){var e=this;return this.closeButton.click((function(t){t.preventDefault(),e.hide()})),this}},{key:"hide",value:function(){var e=$("#openassessment_editor_header",this.editorElement).outerHeight();this.element.addClass("covered");var t={height:"Calc(100% - ".concat(e,"px)"),"border-top-right-radius":"3px","border-top-left-radius":"3px"};return $(".oa_editor_content_wrapper",this.editorElement).each((function(){$(this).css(t)})),this}},{key:"show",value:function(){var e=this;if(this.isVisible())$(this.element).animate({"background-color":e.ALERT_YELLOW},300,"swing",(function(){$(this).animate({"background-color":e.DARK_GREY},700,"swing")}));else{this.element.removeClass("covered");var t=this.element.outerHeight(),n=$("#openassessment_editor_header",this.editorElement).outerHeight(),i={height:"Calc(100% - ".concat(t+n,"px)"),"border-top-right-radius":"0px","border-top-left-radius":"0px"};$(".oa_editor_content_wrapper",this.editorElement).each((function(){$(this).css(i),$(this).scrollTop($(this).scrollTop()+t)}))}return this}},{key:"setMessage",value:function(e,t){return this.title.text(e),this.message.text(t),this}},{key:"isVisible",value:function(){return!this.element.hasClass("covered")}},{key:"getTitle",value:function(){return this.title.text()}},{key:"getMessage",value:function(){return this.message.text()}}])&&i(t.prototype,n),r&&i(t,r),e}();function s(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}var o=function(){function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.containerElement=n.containerElement,this.templateElement=n.templateElement,this.addButtonElement=n.addButtonElement,this.removeButtonClass=n.removeButtonClass,this.containerItemClass=n.containerItemClass,this.notifier=n.notifier,this.addRemoveEnabled=void 0===n.addRemoveEnabled||n.addRemoveEnabled;var i=this;this.createContainerItem=function(e){return new t(e,i.notifier)}}var t,n,i;return t=e,(n=[{key:"addEventListeners",value:function(){var e=this;this.addRemoveEnabled?($(this.addButtonElement).click($.proxy(this.add,this)),$(".".concat(this.removeButtonClass),this.containerElement).click((function(t){var n=e.createContainerItem(t.target);e.remove(n)}))):($(this.addButtonElement).addClass("is--disabled"),$(".".concat(this.removeButtonClass),this.containerElement).addClass("is--disabled")),$(".".concat(this.containerItemClass),this.containerElement).each((function(t,n){e.createContainerItem(n).addEventListeners()}))}},{key:"add",value:function(){$(this.templateElement).children().first().clone().removeAttr("id").toggleClass("is--hidden",!1).toggleClass(this.containerItemClass,!0).appendTo($(this.containerElement));var e=this,t=$(".".concat(this.containerItemClass),this.containerElement).last();this.addRemoveEnabled?t.find(".".concat(this.removeButtonClass)).click((function(t){var n=e.createContainerItem(t.target);e.remove(n)})):t.find(".".concat(this.removeButtonClass)).addClass("is--disabled");var n=e.createContainerItem(t);n.addEventListeners(),n.addHandler()}},{key:"remove",value:function(e){var t=$(e.element).closest(".".concat(this.containerItemClass));this.createContainerItem(t).removeHandler(),t.remove()}},{key:"getItemValues",value:function(){var e=[],t=this;return $(".".concat(this.containerItemClass),this.containerElement).each((function(n,i){var r=t.createContainerItem(i).getFieldValues();e.push(r)})),e}},{key:"getItem",value:function(e){var t=$(".".concat(this.containerItemClass),this.containerElement).get(e);return void 0!==t?this.createContainerItem(t):null}},{key:"getAllItems",value:function(){var e=this;return $(".".concat(this.containerItemClass),this.containerElement).map((function(){return e.createContainerItem(this)}))}}])&&s(t.prototype,n),i&&s(t,i),e}();function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function l(e,t,n){return t&&u(e.prototype,t),n&&u(e,n),e}var c=function(e,t){return void 0!==t&&e.val(t),e.val()},d=function(e,t){return void 0!==t&&e.prop("checked",t),e.prop("checked")},h=function(e,t){return void 0!==t&&e.val(t),e.val()},f=function(){function e(t,n){a(this,e),this.max=n.max,this.min=n.min,this.input=$(t)}return l(e,[{key:"get",value:function(){return parseInt(this.input.val().trim(),10)}},{key:"set",value:function(e){this.input.val(e)}},{key:"validate",value:function(){var e=this.get(),t=!Number.isNaN(e)&&e>=this.min&&e<=this.max;return-1!==this.input.val().indexOf(".")&&(t=!1),t||(this.input.addClass("openassessment_highlighted_field"),this.input.attr("aria-invalid",!0)),t}},{key:"clearValidationErrors",value:function(){this.input.removeClass("openassessment_highlighted_field"),this.input.removeAttr("aria-invalid")}},{key:"validationErrors",value:function(){return this.input.hasClass("openassessment_highlighted_field")?["Int field is invalid"]:[]}}]),e}(),p=function(){function e(t,n,i,r){a(this,e),this.checkbox=t,this.shownSections=n,this.hiddenSections=i,this.notifier=r}return l(e,[{key:"install",value:function(){return this.checkbox.change(this,(function(e){var t=e.data;this.checked?(t.notifier.notificationFired("toggleOn",{}),t.show()):(t.notifier.notificationFired("toggleOff",{}),t.hide())})),this}},{key:"show",value:function(){$.each(this.hiddenSections,(function(e,t){t.addClass("is--hidden")})),$.each(this.shownSections,(function(e,t){t.removeClass("is--hidden")}))}},{key:"hide",value:function(){$.each(this.shownSections,(function(e,t){t.addClass("is--hidden")})),$.each(this.hiddenSections,(function(e,t){t.removeClass("is--hidden")}))}}]),e}(),m=function(){function e(t,n,i){a(this,e),this.element=t,this.datePicker=n,this.timePicker=i}return l(e,[{key:"install",value:function(){var e=$(this.datePicker,this.element).val();return $(this.datePicker,this.element).datepicker({showButtonPanel:!0}).datepicker("option","dateFormat","yy-mm-dd").datepicker("setDate",e),$(this.timePicker,this.element).timepicker({timeFormat:"H:i",step:60}),this}},{key:"datetime",value:function(e,t){var n=$(this.datePicker,this.element),i=$(this.timePicker,this.element);return void 0!==e&&n.val(e),void 0!==t&&i.val(t),"".concat(n.val(),"T").concat(i.val())}},{key:"validate",value:function(){var e=$(this.datePicker,this.element).val(),t=$(this.timePicker,this.element).val(),n=!1;try{n=$.datepicker.parseDate($.datepicker.ISO_8601,e)instanceof Date}catch(e){}n||($(this.datePicker,this.element).addClass("openassessment_highlighted_field"),$(this.datePicker,this.element).attr("aria-invalid",!0));var i=null!==t.match(/^\d{2}:\d{2}$/g);return i||($(this.timePicker,this.element).addClass("openassessment_highlighted_field"),$(this.timePicker,this.element).attr("aria-invalid",!0)),n&&i}},{key:"clearValidationErrors",value:function(){$(this.datePicker,this.element).removeClass("openassessment_highlighted_field"),$(this.timePicker,this.element).removeClass("openassessment_highlighted_field"),$(this.datePicker,this.element).removeAttr("aria-invalid"),$(this.timePicker,this.element).removeAttr("aria-invalid")}},{key:"validationErrors",value:function(){var e=[],t=$(this.datePicker,this.element).hasClass("openassessment_highlighted_field"),n=$(this.timePicker,this.element).hasClass("openassessment_highlighted_field");return t&&e.push("Date is invalid"),n&&e.push("Time is invalid"),e}}]),e}(),v=function(){function e(t,n,i){a(this,e),this.select=t,this.mapping=n,this.notifier=i}return l(e,[{key:"install",value:function(){return this.select.change(this,(function(e){var t=e.data;t.notifier.notificationFired("selectionChanged",{selected:this.value}),t.change(this.value)})),this}},{key:"change",value:function(e){$.isFunction(this.mapping)?this.mapping(e):$.each(this.mapping,(function(t,n){t===e?n.removeClass("is--hidden"):n.addClass("is--hidden")}))}}]),e}(),g=function(){function e(t,n){a(this,e),this.input=$(t),this.validator=n,this.errors=[]}return l(e,[{key:"get",value:function(){return this.input.val()}},{key:"set",value:function(e){this.input.val(e)}},{key:"validate",value:function(){return this.errors=this.validator(this.get()),this.errors.length&&(this.input.addClass("openassessment_highlighted_field"),this.input.attr("aria-invalid",!0),this.input.parent().nextAll(".message-status").text(this.errors.join(";")),this.input.parent().nextAll(".message-status").removeClass("is--hidden")),0===this.errors.length}},{key:"clearValidationErrors",value:function(){this.input.removeClass("openassessment_highlighted_field"),this.input.removeAttr("aria-invalid"),this.input.parent().nextAll(".message-status").addClass("is--hidden")}},{key:"validationErrors",value:function(){return this.errors}}]),e}(),y=function(e){var t=e.base_asset_url,n=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return function(t){t[e]&&(t[e]=rewriteStaticLinks.apply(void 0,[t[e]].concat(n)))}};return{height:"300",font_formats:"Default='Open Sans', Verdana, Arial, Helvetica, sans-serif;Andale Mono=andale mono,times;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco;Times New Roman=times new roman,times;Trebuchet MS=trebuchet ms,geneva;Verdana=verdana,geneva;Webdings=webdings;Wingdings=wingdings,zapf dingbats",theme:"modern",skin:"studio-tmce4",schema:"html5",convert_urls:!1,directionality:$(".wrapper-view, .window-wrap").prop("dir"),formats:{code:{inline:"code"}},visual:!1,plugins:"textcolor, link, image, media",image_advtab:!0,toolbar:"formatselect | fontselect | bold italic underline forecolor | bullist numlist outdent indent blockquote | link unlink image media",block_formats:"".concat(gettext("Paragraph"),"=p;").concat(gettext("Preformatted"),"=pre;").concat(gettext("Heading 3"),"=h3;").concat(gettext("Heading 4"),"=h4;").concat(gettext("Heading 5"),"=h5;").concat(gettext("Heading 6"),"=h6"),menubar:!1,statusbar:!1,valid_children:"+body[style]",valid_elements:"*[*]",extended_valid_elements:"*[*]",invalid_elements:"",setup:function(e){e.on("SaveImage",n("src","/static/",t)),e.on("SaveLink",n("href","/static/",t))},init_instance_callback:function(e){return e.setContent(rewriteStaticLinks(e.getContent({no_events:1}),"/static/",t)),e.focus()},browser_spellcheck:!0}};function b(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function x(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function w(e,t,n){return t&&x(e.prototype,t),n&&x(e,n),e}var k=function(e,t){for(var n=0;n<=e.length;){if(0===e.parent().find("*[".concat(t,"='").concat(n,"']")).length)return n.toString();n++}return n.toString()},E=function(e){var t=$(e).attr("data-points"),n=$(e).attr("data-label"),i=$(e).val();""===n&&(n=gettext("Unnamed Option"));var r="".concat(n," - ").concat(t," point"),s="".concat(n," - ").concat(t," points"),o="";o=""===i?gettext("Not Selected"):Number.isNaN(t)||"NaN"===t?n:ngettext(r,s,t),$(e).text(o)},C=function(){function e(t,n){b(this,e),this.element=t,this.notifier=n,this.tinyMCEEnabled=void 0!==window.tinyMCE,this.tinyMCEEnabled&&(t=this.attachWysiwygToPrompt(t))}return w(e,[{key:"attachWysiwygToPrompt",value:function(e){if(!$(e).find("textarea").attr("id")){var t=$(e).find("textarea"),n=$(t).val(),i=$(t).data("type");n&&"text"===i&&(n=_.escape(n).replace(/(?:\r\n|\r|\n)/g,"<br />"),$(t).val(n));var r="".concat(Date.now(),"-textarea-").concat(100*Math.random());$(t).attr("id",r).tinymce(y({base_asset_url:$("#openassessment_prompt_template").data("baseAssetUrl")}))}return $(e)}},{key:"getFieldValues",value:function(){return{description:this.description()}}},{key:"description",value:function(e){var t=$(".openassessment_prompt_description",this.element);if(!this.tinyMCEEnabled)return c(t,e);var n=window.tinyMCE.get(t.attr("id"));if(!e)return n.getContent();n.setContent(e)}},{key:"addEventListeners",value:function(){}},{key:"addHandler",value:function(){this.notifier.notificationFired("promptAdd",{index:this.element.index()})}},{key:"removeHandler",value:function(){this.notifier.notificationFired("promptRemove",{index:this.element.index()})}},{key:"updateHandler",value:function(){}},{key:"validate",value:function(){return!0}},{key:"validationErrors",value:function(){return[]}},{key:"clearValidationErrors",value:function(){}}]),e}(),T=function(){function e(t,n){b(this,e),this.element=t,this.notifier=n,this.pointsField=new f($(".openassessment_criterion_option_points",this.element),{min:0,max:999})}return w(e,[{key:"addEventListeners",value:function(){$(this.element).focusout($.proxy(this.updateHandler,this))}},{key:"getFieldValues",value:function(){var e={label:this.label(),points:this.points(),explanation:this.explanation()},t=c($(".openassessment_criterion_option_name",this.element));return""!==t&&(e.name=t),e}},{key:"label",value:function(e){var t=$(".openassessment_criterion_option_label",this.element);return c(t,e)}},{key:"points",value:function(e){return void 0!==e&&this.pointsField.set(e),this.pointsField.get()}},{key:"explanation",value:function(e){var t=$(".openassessment_criterion_option_explanation",this.element);return c(t,e)}},{key:"addHandler",value:function(){var e=$(this.element).closest(".openassessment_criterion"),t=$(e).data("criterion"),n=$(".openassessment_criterion_label",e).val(),i=$(".openassessment_criterion_option",this.element.parent()),r=k(i,"data-option");$(this.element).attr("data-criterion",t).attr("data-option",r),$(".openassessment_criterion_option_name",this.element).attr("value",r);var s=this.getFieldValues();this.notifier.notificationFired("optionAdd",{criterionName:t,criterionLabel:n,name:r,label:s.label,points:s.points})}},{key:"removeHandler",value:function(){var e=$(this.element).data("criterion"),t=$(this.element).data("option");this.notifier.notificationFired("optionRemove",{criterionName:e,name:t})}},{key:"updateHandler",value:function(){var e=this.getFieldValues(),t=$(this.element).data("criterion"),n=$(this.element).data("option"),i=e.label,r=e.points;this.notifier.notificationFired("optionUpdated",{criterionName:t,name:n,label:i,points:r})}},{key:"validate",value:function(){return this.pointsField.validate()}},{key:"validationErrors",value:function(){return this.pointsField.validationErrors().length>0?["Option points are invalid"]:[]}},{key:"clearValidationErrors",value:function(){this.pointsField.clearValidationErrors()}}]),e}(),S=function(){function e(t,n){b(this,e),this.element=t,this.notifier=n,this.labelSel=$(".openassessment_criterion_label",this.element),this.promptSel=$(".openassessment_criterion_prompt",this.element),this.optionContainer=new o(T,{containerElement:$(".openassessment_criterion_option_list",this.element).get(0),templateElement:$("#openassessment_option_template").get(0),addButtonElement:$(".openassessment_criterion_add_option",this.element).get(0),removeButtonClass:"openassessment_criterion_option_remove_button",containerItemClass:"openassessment_criterion_option",notifier:this.notifier}),this.feedbackSel=$(".openassessment_criterion_feedback",this.element)}return w(e,[{key:"addEventListeners",value:function(){this.optionContainer.addEventListeners(),$(this.element).focusout($.proxy(this.updateHandler,this))}},{key:"getFieldValues",value:function(){var e={label:this.label(),prompt:this.prompt(),feedback:this.feedback(),options:this.optionContainer.getItemValues()},t=c($(".openassessment_criterion_name",this.element));return""!==t&&(e.name=t),e}},{key:"label",value:function(e){return c(this.labelSel,e)}},{key:"prompt",value:function(e){return c(this.promptSel,e)}},{key:"feedback",value:function(e){return h(this.feedbackSel,e)}},{key:"addOption",value:function(){this.optionContainer.add()}},{key:"addHandler",value:function(){var e=$(".openassessment_criterion",this.element.parent()),t=k(e,"data-criterion");$(this.element).attr("data-criterion",t),$(".openassessment_criterion_name",this.element).attr("value",t)}},{key:"removeHandler",value:function(){var e=$(this.element).data("criterion");this.notifier.notificationFired("criterionRemove",{criterionName:e})}},{key:"updateHandler",value:function(){var e=this.getFieldValues(),t=e.name,n=e.label;this.notifier.notificationFired("criterionUpdated",{criterionName:t,criterionLabel:n})}},{key:"validate",value:function(){var e=""!==this.prompt();return e||(this.promptSel.addClass("openassessment_highlighted_field"),this.promptSel.attr("aria-invalid",!0)),$.each(this.optionContainer.getAllItems(),(function(){e=this.validate()&&e})),e}},{key:"validationErrors",value:function(){var e=[];return this.promptSel.hasClass("openassessment_highlighted_field")&&e.push("Criterion prompt is invalid."),$.each(this.optionContainer.getAllItems(),(function(){e=e.concat(this.validationErrors())})),e}},{key:"clearValidationErrors",value:function(){this.promptSel.removeClass("openassessment_highlighted_field"),this.promptSel.removeAttr("aria-invalid"),$.each(this.optionContainer.getAllItems(),(function(){this.clearValidationErrors()}))}}]),e}(),A=function(){function e(t){b(this,e),this.element=t,this.criteria=$(".openassessment_training_example_criterion_option",this.element),this.answer=$(".openassessment_training_example_essay_part textarea",this.element)}return w(e,[{key:"getFieldValues",value:function(){var e=this.criteria.map((function(){return{criterion:$(this).data("criterion"),option:$(this).prop("value")}})).get();return{answer:this.answer.map((function(){return $(this).prop("value")})).get(),options_selected:e}}},{key:"addHandler",value:function(){$(".openassessment_training_example_criterion_option",this.element).each((function(){$("option",this).each((function(){E($(this))}))}))}},{key:"addEventListeners",value:function(){}},{key:"removeHandler",value:function(){}},{key:"updateHandler",value:function(){}},{key:"validate",value:function(){var e=!0;return this.criteria.each((function(){var t=""!==$(this).prop("value");e=t&&e,t||($(this).addClass("openassessment_highlighted_field"),$(this).attr("aria-invalid",!0))})),e}},{key:"validationErrors",value:function(){var e=[];return this.criteria.each((function(){$(this).hasClass("openassessment_highlighted_field")&&e.push("Student training example is invalid.")})),e}},{key:"clearValidationErrors",value:function(){this.criteria.each((function(){$(this).removeClass("openassessment_highlighted_field"),$(this).removeAttr("aria-invalid")}))}}]),e}(),N=function(){function e(t,n){b(this,e),this.controlElement=t,this.hiddenElement=n}return w(e,[{key:"install",value:function(){var e=this;return this.controlElement.click((function(t){t.preventDefault(),e.showHiddenElement(),e.hideSelf()})),this}},{key:"showHiddenElement",value:function(){this.hiddenElement.removeClass("is--hidden")}},{key:"hideSelf",value:function(){this.controlElement.addClass("is--hidden")}}]),e}();function j(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}var D=function(){function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.element=t,this.editorElement=$(this.element).closest("#openassessment-editor"),this.tabElement=$("#oa_edit_prompt_tab"),this.addRemoveEnabled="true"!==this.editorElement.attr("data-is-released"),this.promptsContainer=new o(C,{containerElement:$("#openassessment_prompts_list",this.element).get(0),templateElement:$("#openassessment_prompt_template",this.element).get(0),addButtonElement:$("#openassessment_prompts_add_prompt",this.element).get(0),removeButtonClass:"openassessment_prompt_remove_button",containerItemClass:"openassessment_prompt",notifier:n,addRemoveEnabled:this.addRemoveEnabled}),this.promptsContainer.addEventListeners()}var t,n,i;return t=e,(n=[{key:"getTab",value:function(){return this.tabElement}},{key:"promptsDefinition",value:function(){return this.promptsContainer.getItemValues()}},{key:"promptsType",value:function(){var e=this.promptsContainer.getItem(0);return e&&e.tinyMCEEnabled?"html":"text"}},{key:"addPrompt",value:function(){this.addRemoveEnabled&&this.promptsContainer.add()}},{key:"removePrompt",value:function(e){this.addRemoveEnabled&&this.promptsContainer.remove(e)}},{key:"getAllPrompts",value:function(){return this.promptsContainer.getAllItems()}},{key:"getPromptItem",value:function(e){return this.promptsContainer.getItem(e)}},{key:"validate",value:function(){return!0}},{key:"validationErrors",value:function(){return[]}},{key:"clearValidationErrors",value:function(){}}])&&j(t.prototype,n),i&&j(t,i),e}();function R(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}var O=function(){function e(t,n,i){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.alert=new r,this.element=t,this.tabElement=$("#oa_edit_rubric_tab"),this.notifier=n,this.server=i,this.criterionAddButton=$("#openassessment_rubric_add_criterion",this.element),this.criteriaContainer=new o(S,{containerElement:$("#openassessment_criterion_list",this.element).get(0),templateElement:$("#openassessment_criterion_template",this.element).get(0),addButtonElement:$("#openassessment_rubric_add_criterion",this.element).get(0),removeButtonClass:"openassessment_criterion_remove_button",containerItemClass:"openassessment_criterion",notifier:n}),this.criteriaContainer.addEventListeners(),this.setupRubricReuse()}var t,n,i;return t=e,(n=[{key:"setupRubricReuse",value:function(){var e=this;if(0!==$("#openassessment_rubric_clone",this.element).size()){$("#openassessment_rubric_clone",this.element).accordion({collapsible:!0,heightStyle:"content",icons:{header:!1,activeHeader:!1}});var t=$.parseJSON($("#openassessment_rubric_reuse_data",this.element).text()).map((function(e){return e.location}));this.rubricAutocomplete=$("#openassessment_rubric_clone_input",this.element).autocomplete({delay:0,minLength:0,source:t}),this.rubricReuseAutocompleteWasOpen=!1,$(".openassessment_clone_combobox_toggle",this.element).button().removeClass("ui-corner-all").addClass("custom-combobox-toggle ui-corner-right").on("mousedown",(function(){e.handleRubricReuseComboboxButtonMousedown()})).on("click",(function(){e.handleRubricReuseComboboxButtonClick()})),$("#openassessment_rubric_clone_button",this.element).on("click",(function(){e.handleRubricReuseCloneButtonClick()})),this.rubricCloneAlert=$("#openassessment_rubric_clone_alert",this.element)}}},{key:"handleRubricReuseComboboxButtonMousedown",value:function(){this.rubricReuseAutocompleteWasOpen=this.rubricAutocomplete.autocomplete("widget").is(":visible")}},{key:"handleRubricReuseComboboxButtonClick",value:function(){this.rubricAutocomplete.trigger("focus"),this.rubricReuseAutocompleteWasOpen||this.rubricAutocomplete.autocomplete("search","")}},{key:"handleRubricReuseCloneButtonClick",value:function(){var e=$("#openassessment_rubric_clone_input",this.element).val();this.cloneRubric(e)}},{key:"getTab",value:function(){return this.tabElement}},{key:"cloneRubric",value:function(e){var t=this;this.server.cloneRubric(e).done((function(n){t.alert.hide(),t.setRubric(n),t.displayRubricClonedMessage(e)})).fail((function(e){t.alert.setMessage(gettext("Problem cloning rubric"),e),t.alert.show()}))}},{key:"setRubric",value:function(e){var t=this;this.clearRubric(),this.feedbackPrompt(e.feedback_prompt),this.feedback_default_text(e.feedback_default_text),e.criteria.forEach((function(e,n){t.addCriterion();var i=t.criteriaContainer.getItem(n);i.label(e.label),i.prompt(e.prompt),i.feedback(e.feedback),e.options.forEach((function(e,r){t.addOption(n);var s=i.optionContainer.getItem(r);s.label(e.label),s.explanation(e.explanation),s.points(e.points),s.updateHandler()})),i.updateHandler()})),this.notifier.notificationFired("rubricReplaced",{})}},{key:"clearRubric",value:function(){var e=this,t=this.getAllCriteria();$.each(t,(function(t,n){e.removeCriterion(n)})),this.feedbackPrompt(""),this.feedback_default_text("")}},{key:"displayRubricClonedMessage",value:function(e){var t=this;this.rubricCloneAlert.is(":visible")?this.rubricCloneAlert.fadeOut("fast",(function(){t.createNewRubricClonedAlert(e)})):this.createNewRubricClonedAlert(e)}},{key:"createNewRubricClonedAlert",value:function(e){$("#openassessment_rubric_clone_alert_block_id",this.rubricCloneAlert).text(e),this.rubricCloneAlert.fadeIn("fast")}},{key:"criteriaDefinition",value:function(){for(var e=this.criteriaContainer.getItemValues(),t=0;t<e.length;t++){var n=e[t];n.order_num=t;for(var i=0;i<n.options.length;i++)n.options[i].order_num=i}return e}},{key:"feedbackPrompt",value:function(e){var t=$("#openassessment_rubric_feedback",this.element);return c(t,e)}},{key:"feedback_default_text",value:function(e){var t=$("#openassessment_rubric_feedback_default_text",this.element);return c(t,e)}},{key:"addCriterion",value:function(){this.criteriaContainer.add()}},{key:"removeCriterion",value:function(e){this.criteriaContainer.remove(e)}},{key:"getAllCriteria",value:function(){return this.criteriaContainer.getAllItems()}},{key:"getCriterionItem",value:function(e){return this.criteriaContainer.getItem(e)}},{key:"addOption",value:function(e){this.getCriterionItem(e).optionContainer.add()}},{key:"removeOption",value:function(e,t){this.getCriterionItem(e).optionContainer.remove(t)}},{key:"getAllOptions",value:function(e){return this.getCriterionItem(e).optionContainer.getAllItems()}},{key:"getOptionItem",value:function(e,t){return this.getCriterionItem(e).optionContainer.getItem(t)}},{key:"validate",value:function(){var e=this.getAllCriteria(),t=e.length>0;return t||this.criterionAddButton.addClass("openassessment_highlighted_field").attr("aria-invalid",!0).click((function(){$(this).removeClass("openassessment_highlighted_field"),$(this).removeAttr("aria-invalid")})),$.each(e,(function(){t=this.validate()&&t})),t}},{key:"validationErrors",value:function(){var e=[];return this.criterionAddButton.hasClass("openassessment_highlighted_field")&&e.push("The rubric must contain at least one criterion"),$.each(this.getAllCriteria(),(function(){e=e.concat(this.validationErrors())})),e}},{key:"clearValidationErrors",value:function(){this.criterionAddButton.removeClass("openassessment_highlighted_field"),this.criterionAddButton.removeAttr("aria-invalid",!0),$.each(this.getAllCriteria(),(function(){this.clearValidationErrors()}))}}])&&R(t.prototype,n),i&&R(t,i),e}();function I(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}var F=function(){function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.element=t,this.tabElement=$("#oa_edit_schedule_tab"),this.assessmentViews=n,this.startDatetimeControl=new m(this.element,"#openassessment_submission_start_date","#openassessment_submission_start_time").install(),this.dueDatetimeControl=new m(this.element,"#openassessment_submission_due_date","#openassessment_submission_due_time").install()}var t,n,i;return t=e,(n=[{key:"getTab",value:function(){return this.tabElement}},{key:"submissionStart",value:function(e,t){return this.startDatetimeControl.datetime(e,t)}},{key:"submissionDue",value:function(e,t){return this.dueDatetimeControl.datetime(e,t)}},{key:"validate",value:function(){var e=!0;e=this.startDatetimeControl.validate()&&e,e=this.dueDatetimeControl.validate()&&e;var t=this.assessmentViews.oa_peer_assessment_editor,n=this.assessmentViews.oa_self_assessment_editor;return t.isEnabled()&&(e=t.startDatetimeControl.validate()&&e,e=t.dueDatetimeControl.validate()&&e),n.isEnabled()&&(e=n.startDatetimeControl.validate()&&e,e=n.dueDatetimeControl.validate()&&e),e}},{key:"validationErrors",value:function(){var e=[];this.startDatetimeControl.validationErrors().length>0&&e.push("Submission start is invalid"),this.dueDatetimeControl.validationErrors().length>0&&e.push("Submission due is invalid");var t=this.assessmentViews.oa_peer_assessment_editor,n=this.assessmentViews.oa_self_assessment_editor;return t.startDatetimeControl.validationErrors().length>0&&e.push("Peer assessment start is invalid"),t.dueDatetimeControl.validationErrors().length>0&&e.push("Peer assessment due is invalid"),n.startDatetimeControl.validationErrors().length>0&&e.push("Self assessment start is invalid"),n.dueDatetimeControl.validationErrors().length>0&&e.push("Self assessment due is invalid"),e}},{key:"clearValidationErrors",value:function(){this.startDatetimeControl.clearValidationErrors(),this.dueDatetimeControl.clearValidationErrors();var e=this.assessmentViews.oa_peer_assessment_editor,t=this.assessmentViews.oa_self_assessment_editor;e.startDatetimeControl.clearValidationErrors(),e.dueDatetimeControl.clearValidationErrors(),t.startDatetimeControl.clearValidationErrors(),t.dueDatetimeControl.clearValidationErrors()}}])&&I(t.prototype,n),i&&I(t,i),e}();function P(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}var H=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.listeners=t}var t,n,i;return t=e,(n=[{key:"notificationFired",value:function(e,t){for(var n=0;n<this.listeners.length;n++)"function"==typeof this.listeners[n][e]&&this.listeners[n][e](t)}}])&&P(t.prototype,n),i&&P(t,i),e}();function L(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function M(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function V(e,t,n){return t&&M(e.prototype,t),n&&M(e,n),e}var W=function(){function e(){L(this,e),this.element=$("#oa_student_training_editor"),this.alert=new r}return V(e,[{key:"promptAdd",value:function(){var e=this.element;$("#openassessment_training_example_part_template").children().first().clone().removeAttr("id").toggleClass("is--hidden",!1).appendTo(".openassessment_training_example_essay",e)}},{key:"promptRemove",value:function(e){var t=this.element;$(".openassessment_training_example_essay li:nth-child(".concat(e.index+1,")"),t).remove()}},{key:"optionUpdated",value:function(e){this._optionSel(e.criterionName).each((function(){var t=$('option[value="'.concat(e.name,'"]'),this).attr("data-points",e.points).attr("data-label",e.label);E(t)}))}},{key:"optionAdd",value:function(e){var t=!1;0===this._optionSel(e.criterionName).length&&(this.criterionAdd(e),t=!0),this._optionSel(e.criterionName).each((function(){var t=$("<option></option>").attr("value",e.name).attr("data-points",e.points).attr("data-label",e.label);E(t),$(this).append(t)})),t&&this.displayAlertMsg(gettext("Criterion Added"),gettext("You have added a criterion. You will need to select an option for the criterion in the Learner Training step. To do this, click the Assessment Steps tab."))}},{key:"optionRemove",value:function(e){var t=this,n=!1;this._optionSel(e.criterionName).each((function(){var i=this;$(i).val()===e.name.toString()&&($(i).val("").addClass("openassessment_highlighted_field").attr("aria-invalid",!0).click((function(){$(i).removeClass("openassessment_highlighted_field"),$(i).removeAttr("aria-invalid")})),n=!0),$('option[value="'.concat(e.name,'"]'),i).remove(),1===$("option",i).length&&(t.removeAllOptions(e),n=!1)})),n&&this.displayAlertMsg(gettext("Option Deleted"),gettext("You have deleted an option. That option has been removed from its criterion in the sample responses in the Learner Training step. You might have to select a new option for the criterion."))}},{key:"_optionSel",value:function(e){return $('.openassessment_training_example_criterion_option[data-criterion="'.concat(e,'"]'),this.element)}},{key:"removeAllOptions",value:function(e){var t=!1;$(".openassessment_training_example_criterion",this.element).each((function(){$(this).data("criterion")===e.criterionName&&($(this).remove(),t=!0)})),t&&this.displayAlertMsg(gettext("Option Deleted"),gettext("You have deleted all the options for this criterion. The criterion has been removed from the sample responses in the Learner Training step."))}},{key:"criterionRemove",value:function(e){var t=!1,n='.openassessment_training_example_criterion[data-criterion="'.concat(e.criterionName,'"]');$(n,this.element).each((function(){$(this).remove(),t=!0})),t&&this.displayAlertMsg(gettext("Criterion Deleted"),gettext("You have deleted a criterion. The criterion has been removed from the example responses in the Learner Training step."))}},{key:"displayAlertMsg",value:function(e,t){$("#include_student_training",this.element).is(":checked")&&$(".openassessment_training_example",this.element).length>1&&this.alert.setMessage(e,t).show()}},{key:"criterionUpdated",value:function(e){var t='.openassessment_training_example_criterion[data-criterion="'.concat(e.criterionName,'"]');$(t,this.element).each((function(){$(".openassessment_training_example_criterion_name_wrapper",this).text(e.criterionLabel)}))}},{key:"criterionAdd",value:function(e){var t=this.element,n=$("#openassessment_training_example_criterion_template").children().first().clone().removeAttr("id").attr("data-criterion",e.criterionName).toggleClass("is--hidden",!1).appendTo(".openassessment_training_example_criteria_selections",t);n.find(".openassessment_training_example_criterion_option").attr("data-criterion",e.criterionName),n.find(".openassessment_training_example_criterion_name_wrapper").text(e.label)}},{key:"rubricReplaced",value:function(){$("#openassessment_training_example_list .openassessment_training_example",this.element).remove()}},{key:"examplesCriteriaLabels",value:function(){var e=[];return $(".openassessment_training_example_criteria_selections",this.element).each((function(){var t={};$(".openassessment_training_example_criterion",this).each((function(){var e=$(this).data("criterion"),n=$(".openassessment_training_example_criterion_name_wrapper",this).text().trim();t[e]=n})),e.push(t)})),e}},{key:"examplesOptionsLabels",value:function(){var e=[];return $(".openassessment_training_example_criteria_selections",this.element).each((function(){var t={};$(".openassessment_training_example_criterion_option",this).each((function(){var e=$(this).data("criterion");t[e]={},$("option",this).each((function(){var n=$(this).val(),i=$(this).text().trim();t[e][n]=i}))})),e.push(t)})),e}}]),e}(),B=function(){function e(){L(this,e),this.alert=new r}return V(e,[{key:"toggleOff",value:function(){this.alert.setMessage(gettext("Warning"),gettext("Changes to steps that are not selected as part of the assignment will not be saved.")).show()}},{key:"toggleOn",value:function(){this.alert.hide()}}]),e}();function q(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function U(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function z(e,t,n){return t&&U(e.prototype,t),n&&U(e,n),e}var G=function(){function e(t,n){q(this,e),this.element=t,this.name="peer-assessment",this.scheduleElement=n,this.mustGradeField=new f($("#peer_assessment_must_grade",this.element),{min:0,max:99}),this.mustBeGradedByField=new f($("#peer_assessment_graded_by",this.element),{min:0,max:99}),new p($("#include_peer_assessment",this.element),[$("#peer_assessment_settings_editor",this.element),$("#peer_assessment_schedule_editor",this.scheduleElement)],[],new H([new B])).install(),new N($("#peer_assessment_settings_editor_show_details",this.element),$("#peer_assessment_settings_editor_details",this.element)).install(),this.startDatetimeControl=new m(this.scheduleElement,"#peer_assessment_start_date","#peer_assessment_start_time").install(),this.dueDatetimeControl=new m(this.scheduleElement,"#peer_assessment_due_date","#peer_assessment_due_time").install()}return z(e,[{key:"description",value:function(){return{must_grade:this.mustGradeNum(),must_be_graded_by:this.mustBeGradedByNum(),enable_flexible_grading:this.enableFlexibleGrading(),start:this.startDatetime(),due:this.dueDatetime()}}},{key:"isEnabled",value:function(e){var t=$("#include_peer_assessment",this.element);return d(t,e)}},{key:"toggleEnabled",value:function(){$("#include_peer_assessment",this.element).click()}},{key:"mustGradeNum",value:function(e){return void 0!==e&&this.mustGradeField.set(e),this.mustGradeField.get()}},{key:"mustBeGradedByNum",value:function(e){return void 0!==e&&this.mustBeGradedByField.set(e),this.mustBeGradedByField.get()}},{key:"enableFlexibleGrading",value:function(e){var t=$("#peer_assessment_enable_flexible_grading",this.element);return void 0!==e&&t.val(e?"0":"1"),"1"===t.val()}},{key:"startDatetime",value:function(e,t){return this.startDatetimeControl.datetime(e,t)}},{key:"dueDatetime",value:function(e,t){return this.dueDatetimeControl.datetime(e,t)}},{key:"getID",value:function(){return $(this.element).attr("id")}},{key:"validate",value:function(){var e=this.mustGradeField.validate(),t=this.mustBeGradedByField.validate();return e&&t}},{key:"validationErrors",value:function(){var e=[];return this.mustGradeField.validationErrors().length>0&&e.push("Peer assessment must grade is invalid"),this.mustBeGradedByField.validationErrors().length>0&&e.push("Peer assessment must be graded by is invalid"),e}},{key:"clearValidationErrors",value:function(){this.mustGradeField.clearValidationErrors(),this.mustBeGradedByField.clearValidationErrors()}}]),e}(),J=function(){function e(t,n){q(this,e),this.element=t,this.scheduleElement=n,this.name="self-assessment",new p($("#include_self_assessment",this.element),[$("#self_assessment_settings_editor",this.element),$("#self_assessment_schedule_editor",this.scheduleElement)],[$("#self_assessment_description_closed",this.element)],new H([new B])).install(),this.startDatetimeControl=new m(this.scheduleElement,"#self_assessment_start_date","#self_assessment_start_time").install(),this.dueDatetimeControl=new m(this.scheduleElement,"#self_assessment_due_date","#self_assessment_due_time").install()}return z(e,[{key:"description",value:function(){return{start:this.startDatetime(),due:this.dueDatetime()}}},{key:"isEnabled",value:function(e){var t=$("#include_self_assessment",this.element);return d(t,e)}},{key:"toggleEnabled",value:function(){$("#include_self_assessment",this.element).click()}},{key:"startDatetime",value:function(e,t){return this.startDatetimeControl.datetime(e,t)}},{key:"dueDatetime",value:function(e,t){return this.dueDatetimeControl.datetime(e,t)}},{key:"getID",value:function(){return $(this.element).attr("id")}},{key:"validate",value:function(){return!0}},{key:"validationErrors",value:function(){return[]}},{key:"clearValidationErrors",value:function(){}}]),e}(),X=function(){function e(t){q(this,e),this.element=t,this.name="student-training",new p($("#include_student_training",this.element),[$("#student_training_settings_editor",this.element)],[],new H([new B])).install(),new N($("#student_training_settings_editor_show_details",this.element),$("#student_training_settings_editor_details",this.element)).install(),this.exampleContainer=new o(A,{containerElement:$("#openassessment_training_example_list",this.element).get(0),templateElement:$("#openassessment_training_example_template",this.element).get(0),addButtonElement:$(".openassessment_add_training_example",this.element).get(0),removeButtonClass:"openassessment_training_example_remove",containerItemClass:"openassessment_training_example"}),this.exampleContainer.addEventListeners()}return z(e,[{key:"description",value:function(){return{examples:this.exampleContainer.getItemValues()}}},{key:"isEnabled",value:function(e){var t=$("#include_student_training",this.element);return d(t,e)}},{key:"toggleEnabled",value:function(){$("#include_student_training",this.element).click()}},{key:"getID",value:function(){return $(this.element).attr("id")}},{key:"validate",value:function(){var e=!0;return $.each(this.exampleContainer.getAllItems(),(function(){e=this.validate()&&e})),e}},{key:"validationErrors",value:function(){var e=[];return $.each(this.exampleContainer.getAllItems(),(function(){e=e.concat(this.validationErrors())})),e}},{key:"clearValidationErrors",value:function(){$.each(this.exampleContainer.getAllItems(),(function(){this.clearValidationErrors()}))}},{key:"addTrainingExample",value:function(){this.exampleContainer.add()}}]),e}(),Y=function(){function e(t){q(this,e),this.element=t,this.name="staff-assessment",new p($("#include_staff_assessment",this.element),[$("#staff_assessment_description",this.element)],[$("#staff_assessment_description",this.element)],new H([new B])).install()}return z(e,[{key:"description",value:function(){return{required:this.isEnabled()}}},{key:"isEnabled",value:function(e){var t=$("#include_staff_assessment",this.element);return d(t,e)}},{key:"toggleEnabled",value:function(){$("#include_staff_assessment",this.element).click()}},{key:"getID",value:function(){return $(this.element).attr("id")}},{key:"validate",value:function(){return!0}},{key:"validationErrors",value:function(){return[]}},{key:"clearValidationErrors",value:function(){}}]),e}();function K(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}var Q=function(){function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.assessmentsElement=$(t).siblings("#openassessment_assessment_module_settings_editors").get(0),this.tabElement=$("#oa_edit_assessment_steps_tab"),this.assessmentViews=n,this.initializeSortableAssessments()}var t,n,i;return t=e,(n=[{key:"getTab",value:function(){return this.tabElement}},{key:"initializeSortableAssessments",value:function(){var e=this;$("#openassessment_assessment_module_settings_editors",e.element).sortable({start:function(t,n){$(".openassessment_assessment_module_editor",e.element).hide(),n.placeholder.height("auto"),n.helper.height("auto"),$("#openassessment_assessment_module_settings_editors",e.element).sortable("refresh").sortable("refreshPositions")},stop:function(){$(".openassessment_assessment_module_editor",e.element).show()},snap:!0,axis:"y",handle:".drag-handle",cursorAt:{top:20}}),$("#openassessment_assessment_module_settings_editors .drag-handle",e.element).disableSelection()}},{key:"isHidden",value:function(e){return e.hasClass("is--hidden")&&"true"===e.attr("aria-hidden")}},{key:"setHidden",value:function(e,t){e.toggleClass("is--hidden",t),e.attr("aria-hidden",t?"true":"false")}},{key:"assessmentsDescription",value:function(){var e=[],t=this;return $(".openassessment_assessment_module_settings_editor",this.assessmentsElement).each((function(){var n=t.assessmentViews[$(this).attr("id")],i=!t.isHidden($(n.element));if(n.isEnabled()&&i){var r=n.description();r.name=n.name,e.push(r)}})),e}},{key:"editorAssessmentsOrder",value:function(){var e=[],t=this;return $(".openassessment_assessment_module_settings_editor",this.assessmentsElement).each((function(){var n=t.assessmentViews[$(this).attr("id")];e.push(n.name)})),e}},{key:"validate",value:function(){var e=!0;return $.each(this.assessmentViews,(function(){this.isEnabled()&&(e=this.validate()&&e)})),e}},{key:"validationErrors",value:function(){var e=[];return $.each(this.assessmentViews,(function(){e=e.concat(this.validationErrors())})),e}},{key:"clearValidationErrors",value:function(){$.each(this.assessmentViews,(function(){this.clearValidationErrors()}))}}])&&K(t.prototype,n),i&&K(t,i),e}();function Z(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}var ee=function(){function e(t,n,i){var r=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.settingsElement=t,this.tabElement=$("#oa_edit_settings_tab"),this.assessmentViews=n,this.data=i,this.onFileUploadTypeChanged=this.onFileUploadTypeChanged.bind(this),this.onTeamsEnabledChange=this.onTeamsEnabledChange.bind(this),this.displayName=this.displayName.bind(this),this.textResponseNecessity=this.textResponseNecessity.bind(this),this.textResponseEditor=this.textResponseEditor.bind(this),this.fileUploadResponseNecessity=this.fileUploadResponseNecessity.bind(this),this.fileUploadType=this.fileUploadType.bind(this),this.fileTypeWhiteList=this.fileTypeWhiteList.bind(this),this.settingSelectorEnabled=this.settingSelectorEnabled.bind(this),this.multipleFilesEnabled=this.multipleFilesEnabled.bind(this),this.latexEnabled=this.latexEnabled.bind(this),this.teamsEnabled=this.teamsEnabled.bind(this),this.isHidden=this.isHidden.bind(this),this.setHidden=this.setHidden.bind(this),this.teamset=this.teamset.bind(this),this.leaderboardNum=this.leaderboardNum.bind(this),this.validate=this.validate.bind(this),this.validationErrors=this.validationErrors.bind(this),this.clearValidationErrors=this.clearValidationErrors.bind(this),new v($("#openassessment_submission_file_upload_response",this.element),(function(e){var t=$("#openassessment_submission_file_upload_type_wrapper",r.element),n=$("#openassessment_submission_upload_selector",r.element).val();e?(t.removeClass("is--hidden"),r.onFileUploadTypeChanged(n)):t.addClass("is--hidden")}),new H([new B])).install(),new v($("#openassessment_submission_upload_selector",this.element),this.onFileUploadTypeChanged,new H([new B])).install(),this.teamsEnabledSelectControl=new v($("#openassessment_team_enabled_selector",this.element),this.onTeamsEnabledChange,new H([new B])).install(),this.leaderboardIntField=new f($("#openassessment_leaderboard_editor",this.element),{min:0,max:100}),this.fileTypeWhiteListInputField=new g($("#openassessment_submission_white_listed_file_types",this.element),(function(e){var t=[],n=[];if(!e)return n.push(gettext("File types can not be empty.")),n;var i=$.map(e.replace(/\./g,"").toLowerCase().split(","),$.trim);return $.each(i,(function(e,n){-1!==r.data.FILE_EXT_BLACK_LIST.indexOf(n)&&t.push(n)})),t.length&&n.push(gettext("The following file types are not allowed: ")+t.join(",")),n})),this.onTeamsEnabledChange($("#openassessment_team_enabled_selector").val())}var t,n,i;return t=e,(n=[{key:"getTab",value:function(){return this.tabElement}},{key:"onFileUploadTypeChanged",value:function(e){var t=$("#openassessment_submission_white_listed_file_types",this.element),n=$("#openassessment_submission_white_listed_file_types_wrapper .extension-warning",this.element);this.fileTypeWhiteListInputField.clearValidationErrors(),"custom"===e?(t.prop("disabled",!1),this.setHidden(n,!0)):("image"===e?t.val(this.data.ALLOWED_IMAGE_EXTENSIONS.join(", ")):"pdf-and-image"===e&&t.val(this.data.ALLOWED_FILE_EXTENSIONS.join(", ")),t.prop("disabled",!0),this.setHidden(n,!1))}},{key:"onTeamsEnabledChange",value:function(e){var t=$("#openassessment_teamset_selection_wrapper",this.element),n=$("#openassessment_submission_nfile_editor",this.element),i=this.assessmentViews.oa_self_assessment_editor,r=this.assessmentViews.oa_peer_assessment_editor,s=this.assessmentViews.oa_student_training_editor,o=this.assessmentViews.oa_staff_assessment_editor;e&&"0"!==e?(this.setHidden(t,!1),this.setHidden($(i.element),!0),this.setHidden($(r.element),!0),this.setHidden($(s.element),!0),this.setHidden($("#self_assessment_schedule_editor",i.scheduleElement),!0),this.setHidden($("#peer_assessment_schedule_editor",r.scheduleElement),!0),this.setHidden($("#openassessment_leaderboard_wrapper .disabled-label"),!1),this.setHidden($("#openassessment_leaderboard_wrapper .teams-warning"),!1),$("#openassessment_leaderboard_editor").prop("disabled",!0),o.isEnabled(!0),n.prop("disblaed",!0),n.val(1)):(this.setHidden(t,!0),this.setHidden($(i.element),!1),this.setHidden($(r.element),!1),this.setHidden($(s.element),!1),i.isEnabled()&&this.setHidden($("#self_assessment_schedule_editor",i.scheduleElement),!1),r.isEnabled()&&this.setHidden($("#peer_assessment_schedule_editor",r.scheduleElement),!1),this.setHidden($("#openassessment_leaderboard_wrapper .disabled-label"),!0),this.setHidden($("#openassessment_leaderboard_wrapper .teams-warning"),!0),$("#openassessment_leaderboard_editor").prop("disabled",!1),n.prop("disabled",!1))}},{key:"displayName",value:function(e){var t=$("#openassessment_title_editor",this.settingsElement);return c(t,e)}},{key:"textResponseNecessity",value:function(e){var t=$("#openassessment_submission_text_response",this.settingsElement);return void 0!==e&&t.val(e),t.val()}},{key:"textResponseEditor",value:function(e){var t=$("#openassessment_submission_text_response_editor",this.settingsElement);return void 0!==e&&t.val(e),t.val()}},{key:"fileUploadResponseNecessity",value:function(e,t){var n=$("#openassessment_submission_file_upload_response",this.settingsElement);return void 0!==e&&(t=t||!1,n.val(e),t&&$(n).trigger("change")),n.val()}},{key:"fileUploadType",value:function(e){var t=$("#openassessment_submission_file_upload_type_wrapper",this.settingsElement);if(!$(t).hasClass("is--hidden")){var n=$("#openassessment_submission_upload_selector",this.settingsElement);return void 0!==e&&n.val(e),$(n).trigger("change"),n.val()}return""}},{key:"fileTypeWhiteList",value:function(e){return void 0!==e&&this.fileTypeWhiteListInputField.set(e),this.fileTypeWhiteListInputField.get()}},{key:"settingSelectorEnabled",value:function(e,t){var n=$(e,this.settingsElement);return void 0!==t&&(t?n.val(1):n.val(0)),"1"===n.val()}},{key:"multipleFilesEnabled",value:function(e){return this.settingSelectorEnabled("#openassessment_submission_nfile_editor",e)}},{key:"latexEnabled",value:function(e){return this.settingSelectorEnabled("#openassessment_submission_latex_editor",e)}},{key:"teamsEnabled",value:function(e){return void 0!==e&&this.teamsEnabledSelectControl.change(e?"1":"0"),this.settingSelectorEnabled("#openassessment_team_enabled_selector",e)}},{key:"isHidden",value:function(e){return e.hasClass("is--hidden")&&"true"===e.attr("aria-hidden")}},{key:"setHidden",value:function(e,t){e.toggleClass("is--hidden",t),e.attr("aria-hidden",t?"true":"false")}},{key:"teamset",value:function(e){if(this.teamsEnabled()){var t=$("#openassessment_teamset_selector",this.settingsElement);return void 0!==e&&t.val(e),t.val()}return""}},{key:"leaderboardNum",value:function(e){return void 0!==e&&this.leaderboardIntField.set(e),this.leaderboardIntField.get(e)}},{key:"showRubricDuringResponse",value:function(e){return this.settingSelectorEnabled("#openassessment_show_rubric_during_response_selector",e)}},{key:"validate",value:function(){var e=!0;return e=this.leaderboardIntField.validate()&&e,"custom"===this.fileUploadType()?e=this.fileTypeWhiteListInputField.validate()&&e:this.fileTypeWhiteListInputField.get()&&!this.fileTypeWhiteListInputField.validate()&&this.fileTypeWhiteListInputField.set(""),e}},{key:"validationErrors",value:function(){var e=[];return this.leaderboardIntField.validationErrors().length>0&&e.push("Leaderboard number is invalid"),this.fileTypeWhiteListInputField.validationErrors().length>0&&(e=e.concat(this.fileTypeWhiteListInputField.validationErrors())),e}},{key:"clearValidationErrors",value:function(){this.leaderboardIntField.clearValidationErrors(),this.fileTypeWhiteListInputField.clearValidationErrors()}}])&&Z(t.prototype,n),i&&Z(t,i),e}(),te=n(9);function ne(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}var ie=function(){function e(t,n,i,s){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.element=n,this.runtime=t,this.server=i,this.data=s,this.fixModalHeight(),this.initializeTabs(),this.alert=(new r).install();var o=new W;this.promptsView=new D($("#oa_prompts_editor_wrapper",this.element).get(0),new H([o])),this.rubricView=new O($("#oa_rubric_editor_wrapper",this.element).get(0),new H([o]),this.server);var a=new Y($("#oa_staff_assessment_editor",this.element).get(0)),u=new X($("#oa_student_training_editor",this.element).get(0)),l=new G($("#oa_peer_assessment_editor",this.element).get(0),$("#oa_schedule_editor_wrapper",this.element).get(0)),c=new J($("#oa_self_assessment_editor",this.element).get(0),$("#oa_schedule_editor_wrapper",this.element).get(0)),d={};d[a.getID()]=a,d[u.getID()]=u,d[l.getID()]=l,d[c.getID()]=c,this.assessmentsStepsView=new Q($("#oa_assessment_steps_editor_wrapper",this.element).get(0),d),this.settingsView=new ee($("#oa_basic_settings_editor",this.element).get(0),d,s),this.scheduleView=new F($("#oa_schedule_editor_wrapper",this.element).get(0),d),this.views=[this.promptsView,this.rubricView,this.scheduleView,this.assessmentsStepsView,this.settingsView],$(".openassessment_save_button",this.element).click($.proxy(this.save,this)),$(".openassessment_cancel_button",this.element).click($.proxy(this.cancel,this))}var t,n,i;return t=e,(n=[{key:"fixModalHeight",value:function(){$(this.element).addClass("openassessment_full_height").parentsUntil(".modal-window").addClass("openassessment_full_height"),$(this.element).closest(".modal-window").addClass("openassessment_modal_window")}},{key:"initializeTabs",value:function(){void 0===this.lastOpenEditingTab&&(this.lastOpenEditingTab=0),$(".openassessment_editor_content_and_tabs",this.element).tabs({active:this.lastOpenEditingTab})}},{key:"saveTabState",value:function(){var e=$(".openassessment_editor_content_and_tabs",this.element);this.lastOpenEditingTab=e.tabs("option","active")}},{key:"save",value:function(){var e=this;this.saveTabState(),this.clearValidationErrors();var t=this.validate();if(this.markTabsWithValidationErrors(t),t.length>0){var n=t.map((function(e){return e.getTab().find("a").text()}));this.alert.setMessage(gettext("Save Unsuccessful"),gettext("We've detected errors on the following tabs: ".concat(n.join(", ")))).show()}else this.alert.hide(),this.server.checkReleased().done((function(t){t?e.confirmPostReleaseUpdate($.proxy(e.updateEditorContext,e)):e.updateEditorContext()})).fail((function(t){e.showError(t)}))}},{key:"confirmPostReleaseUpdate",value:function(e){window.confirm(gettext("This ORA has already been released. Changes will only affect learners making new submissions. Existing submissions will not be modified by this change."))&&e()}},{key:"updateEditorContext",value:function(){var e=this;this.runtime.notify("save",{state:"start"});var t=this.settingsView.fileUploadType(),n=this.settingsView.teamsEnabled();this.server.updateEditorContext({prompts:this.promptsView.promptsDefinition(),prompts_type:this.promptsView.promptsType(),feedbackPrompt:this.rubricView.feedbackPrompt(),feedback_default_text:this.rubricView.feedback_default_text(),criteria:this.rubricView.criteriaDefinition(),title:this.settingsView.displayName(),submissionStart:this.scheduleView.submissionStart(),submissionDue:this.scheduleView.submissionDue(),assessments:this.assessmentsStepsView.assessmentsDescription(),textResponse:this.settingsView.textResponseNecessity(),textResponseEditor:this.settingsView.textResponseEditor(),fileUploadResponse:this.settingsView.fileUploadResponseNecessity(),fileUploadType:""!==t?t:null,fileTypeWhiteList:this.settingsView.fileTypeWhiteList(),multipleFilesEnabled:!!n||this.settingsView.multipleFilesEnabled(),latexEnabled:this.settingsView.latexEnabled(),leaderboardNum:this.settingsView.leaderboardNum(),editorAssessmentsOrder:this.assessmentsStepsView.editorAssessmentsOrder(),teamsEnabled:n,selectedTeamsetId:this.settingsView.teamset(),showRubricDuringResponse:this.settingsView.showRubricDuringResponse()}).done((function(){return e.runtime.notify("save",{state:"end"})})).fail((function(t){return e.showError(t)}))}},{key:"cancel",value:function(){this.saveTabState(),this.runtime.notify("cancel",{})}},{key:"showError",value:function(e){this.runtime.notify("error",{msg:e})}},{key:"validate",value:function(){var e=[];return this.views.forEach((function(t){t.validate()||e.push(t)})),e}},{key:"markTabsWithValidationErrors",value:function(e){var t=this;e.forEach((function(e){var n=e.getTab(),i=e.validationErrors().length;t.markTabAsInvalid(n,i)}))}},{key:"markTabAsInvalid",value:function(e,t){$(".tab-error-count",e).text(gettext("has ".concat(t," error(s)"))),$(".validation-warning",e).show()}},{key:"clearTabValidation",value:function(e){$(".tab-error-count",e).text(""),$(".validation-warning",e).hide()}},{key:"validationErrors",value:function(){return this.settingsView.validationErrors().concat(this.assessmentsStepsView.validationErrors().concat(this.scheduleView.validationErrors().concat(this.rubricView.validationErrors().concat(this.promptsView.validationErrors()))))}},{key:"clearValidationErrors",value:function(){var e=this;this.views.forEach((function(t){t.clearValidationErrors(),e.clearTabValidation(t.getTab())}))}}])&&ne(t.prototype,n),i&&ne(t,i),e}();window.OpenAssessmentEditor=function(e,t,n){var i=new te.a(e,t);new ie(e,t,i,n)}},3:function(e,t,n){"use strict";(function(e){n.d(t,"e",(function(){return i})),n.d(t,"p",(function(){return r})),n.d(t,"a",(function(){return s})),n.d(t,"c",(function(){return o})),n.d(t,"d",(function(){return a})),n.d(t,"o",(function(){return u})),n.d(t,"q",(function(){return l})),n.d(t,"t",(function(){return c})),n.d(t,"i",(function(){return d})),n.d(t,"r",(function(){return h})),n.d(t,"s",(function(){return f})),n.d(t,"k",(function(){return p})),n.d(t,"m",(function(){return m})),n.d(t,"j",(function(){return v})),n.d(t,"l",(function(){return g})),n.d(t,"g",(function(){return y})),n.d(t,"f",(function(){return b})),n.d(t,"h",(function(){return _})),n.d(t,"n",(function(){return x})),n.d(t,"b",(function(){return w}));var i="1.13.2",r="object"==typeof self&&self.self===self&&self||"object"==typeof e&&e.global===e&&e||Function("return this")()||{},s=Array.prototype,o=Object.prototype,a="undefined"!=typeof Symbol?Symbol.prototype:null,u=s.push,l=s.slice,c=o.toString,d=o.hasOwnProperty,h="undefined"!=typeof ArrayBuffer,f="undefined"!=typeof DataView,p=Array.isArray,m=Object.keys,v=Object.create,g=h&&ArrayBuffer.isView,y=isNaN,b=isFinite,_=!{toString:null}.propertyIsEnumerable("toString"),x=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],w=Math.pow(2,53)-1}).call(this,n(7))},7:function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},8:function(e,t,n){"use strict";n.r(t),n.d(t,"default",(function(){return wn})),n.d(t,"VERSION",(function(){return r.e})),n.d(t,"restArguments",(function(){return s})),n.d(t,"isObject",(function(){return o})),n.d(t,"isNull",(function(){return a})),n.d(t,"isUndefined",(function(){return u})),n.d(t,"isBoolean",(function(){return l})),n.d(t,"isElement",(function(){return c})),n.d(t,"isString",(function(){return h})),n.d(t,"isNumber",(function(){return f})),n.d(t,"isDate",(function(){return p})),n.d(t,"isRegExp",(function(){return m})),n.d(t,"isError",(function(){return v})),n.d(t,"isSymbol",(function(){return g})),n.d(t,"isArrayBuffer",(function(){return y})),n.d(t,"isDataView",(function(){return T})),n.d(t,"isArray",(function(){return $})),n.d(t,"isFunction",(function(){return x})),n.d(t,"isArguments",(function(){return N})),n.d(t,"isFinite",(function(){return j})),n.d(t,"isNaN",(function(){return D})),n.d(t,"isTypedArray",(function(){return L})),n.d(t,"isEmpty",(function(){return B})),n.d(t,"isMatch",(function(){return q})),n.d(t,"isEqual",(function(){return J})),n.d(t,"isMap",(function(){return ie})),n.d(t,"isWeakMap",(function(){return re})),n.d(t,"isSet",(function(){return se})),n.d(t,"isWeakSet",(function(){return oe})),n.d(t,"keys",(function(){return W})),n.d(t,"allKeys",(function(){return X})),n.d(t,"values",(function(){return ae})),n.d(t,"pairs",(function(){return ue})),n.d(t,"invert",(function(){return le})),n.d(t,"functions",(function(){return ce})),n.d(t,"methods",(function(){return ce})),n.d(t,"extend",(function(){return he})),n.d(t,"extendOwn",(function(){return fe})),n.d(t,"assign",(function(){return fe})),n.d(t,"defaults",(function(){return pe})),n.d(t,"create",(function(){return ve})),n.d(t,"clone",(function(){return ge})),n.d(t,"tap",(function(){return ye})),n.d(t,"get",(function(){return we})),n.d(t,"has",(function(){return ke})),n.d(t,"mapObject",(function(){return je})),n.d(t,"identity",(function(){return Ee})),n.d(t,"constant",(function(){return R})),n.d(t,"noop",(function(){return De})),n.d(t,"toPath",(function(){return be})),n.d(t,"property",(function(){return Te})),n.d(t,"propertyOf",(function(){return Re})),n.d(t,"matcher",(function(){return Ce})),n.d(t,"matches",(function(){return Ce})),n.d(t,"times",(function(){return Oe})),n.d(t,"random",(function(){return Ie})),n.d(t,"now",(function(){return Fe})),n.d(t,"escape",(function(){return Le})),n.d(t,"unescape",(function(){return Me})),n.d(t,"templateSettings",(function(){return Ve})),n.d(t,"template",(function(){return Ge})),n.d(t,"result",(function(){return Je})),n.d(t,"uniqueId",(function(){return Ye})),n.d(t,"chain",(function(){return Ke})),n.d(t,"iteratee",(function(){return Ae})),n.d(t,"partial",(function(){return et})),n.d(t,"bind",(function(){return tt})),n.d(t,"bindAll",(function(){return rt})),n.d(t,"memoize",(function(){return st})),n.d(t,"delay",(function(){return ot})),n.d(t,"defer",(function(){return at})),n.d(t,"throttle",(function(){return ut})),n.d(t,"debounce",(function(){return lt})),n.d(t,"wrap",(function(){return ct})),n.d(t,"negate",(function(){return dt})),n.d(t,"compose",(function(){return ht})),n.d(t,"after",(function(){return ft})),n.d(t,"before",(function(){return pt})),n.d(t,"once",(function(){return mt})),n.d(t,"findKey",(function(){return vt})),n.d(t,"findIndex",(function(){return yt})),n.d(t,"findLastIndex",(function(){return bt})),n.d(t,"sortedIndex",(function(){return _t})),n.d(t,"indexOf",(function(){return wt})),n.d(t,"lastIndexOf",(function(){return kt})),n.d(t,"find",(function(){return Et})),n.d(t,"detect",(function(){return Et})),n.d(t,"findWhere",(function(){return Ct})),n.d(t,"each",(function(){return Tt})),n.d(t,"forEach",(function(){return Tt})),n.d(t,"map",(function(){return $t})),n.d(t,"collect",(function(){return $t})),n.d(t,"reduce",(function(){return At})),n.d(t,"foldl",(function(){return At})),n.d(t,"inject",(function(){return At})),n.d(t,"reduceRight",(function(){return Nt})),n.d(t,"foldr",(function(){return Nt})),n.d(t,"filter",(function(){return jt})),n.d(t,"select",(function(){return jt})),n.d(t,"reject",(function(){return Dt})),n.d(t,"every",(function(){return Rt})),n.d(t,"all",(function(){return Rt})),n.d(t,"some",(function(){return Ot})),n.d(t,"any",(function(){return Ot})),n.d(t,"contains",(function(){return It})),n.d(t,"includes",(function(){return It})),n.d(t,"include",(function(){return It})),n.d(t,"invoke",(function(){return Ft})),n.d(t,"pluck",(function(){return Pt})),n.d(t,"where",(function(){return Ht})),n.d(t,"max",(function(){return Lt})),n.d(t,"min",(function(){return Mt})),n.d(t,"shuffle",(function(){return qt})),n.d(t,"sample",(function(){return Bt})),n.d(t,"sortBy",(function(){return Ut})),n.d(t,"groupBy",(function(){return Gt})),n.d(t,"indexBy",(function(){return Jt})),n.d(t,"countBy",(function(){return Xt})),n.d(t,"partition",(function(){return Yt})),n.d(t,"toArray",(function(){return Wt})),n.d(t,"size",(function(){return Kt})),n.d(t,"pick",(function(){return Zt})),n.d(t,"omit",(function(){return en})),n.d(t,"first",(function(){return nn})),n.d(t,"head",(function(){return nn})),n.d(t,"take",(function(){return nn})),n.d(t,"initial",(function(){return tn})),n.d(t,"last",(function(){return sn})),n.d(t,"rest",(function(){return rn})),n.d(t,"tail",(function(){return rn})),n.d(t,"drop",(function(){return rn})),n.d(t,"compact",(function(){return on})),n.d(t,"flatten",(function(){return an})),n.d(t,"without",(function(){return ln})),n.d(t,"uniq",(function(){return cn})),n.d(t,"unique",(function(){return cn})),n.d(t,"union",(function(){return dn})),n.d(t,"intersection",(function(){return hn})),n.d(t,"difference",(function(){return un})),n.d(t,"unzip",(function(){return fn})),n.d(t,"transpose",(function(){return fn})),n.d(t,"zip",(function(){return pn})),n.d(t,"object",(function(){return mn})),n.d(t,"range",(function(){return vn})),n.d(t,"chunk",(function(){return gn})),n.d(t,"mixin",(function(){return bn}));var i={};n.r(i),n.d(i,"VERSION",(function(){return r.e})),n.d(i,"restArguments",(function(){return s})),n.d(i,"isObject",(function(){return o})),n.d(i,"isNull",(function(){return a})),n.d(i,"isUndefined",(function(){return u})),n.d(i,"isBoolean",(function(){return l})),n.d(i,"isElement",(function(){return c})),n.d(i,"isString",(function(){return h})),n.d(i,"isNumber",(function(){return f})),n.d(i,"isDate",(function(){return p})),n.d(i,"isRegExp",(function(){return m})),n.d(i,"isError",(function(){return v})),n.d(i,"isSymbol",(function(){return g})),n.d(i,"isArrayBuffer",(function(){return y})),n.d(i,"isDataView",(function(){return T})),n.d(i,"isArray",(function(){return $})),n.d(i,"isFunction",(function(){return x})),n.d(i,"isArguments",(function(){return N})),n.d(i,"isFinite",(function(){return j})),n.d(i,"isNaN",(function(){return D})),n.d(i,"isTypedArray",(function(){return L})),n.d(i,"isEmpty",(function(){return B})),n.d(i,"isMatch",(function(){return q})),n.d(i,"isEqual",(function(){return J})),n.d(i,"isMap",(function(){return ie})),n.d(i,"isWeakMap",(function(){return re})),n.d(i,"isSet",(function(){return se})),n.d(i,"isWeakSet",(function(){return oe})),n.d(i,"keys",(function(){return W})),n.d(i,"allKeys",(function(){return X})),n.d(i,"values",(function(){return ae})),n.d(i,"pairs",(function(){return ue})),n.d(i,"invert",(function(){return le})),n.d(i,"functions",(function(){return ce})),n.d(i,"methods",(function(){return ce})),n.d(i,"extend",(function(){return he})),n.d(i,"extendOwn",(function(){return fe})),n.d(i,"assign",(function(){return fe})),n.d(i,"defaults",(function(){return pe})),n.d(i,"create",(function(){return ve})),n.d(i,"clone",(function(){return ge})),n.d(i,"tap",(function(){return ye})),n.d(i,"get",(function(){return we})),n.d(i,"has",(function(){return ke})),n.d(i,"mapObject",(function(){return je})),n.d(i,"identity",(function(){return Ee})),n.d(i,"constant",(function(){return R})),n.d(i,"noop",(function(){return De})),n.d(i,"toPath",(function(){return be})),n.d(i,"property",(function(){return Te})),n.d(i,"propertyOf",(function(){return Re})),n.d(i,"matcher",(function(){return Ce})),n.d(i,"matches",(function(){return Ce})),n.d(i,"times",(function(){return Oe})),n.d(i,"random",(function(){return Ie})),n.d(i,"now",(function(){return Fe})),n.d(i,"escape",(function(){return Le})),n.d(i,"unescape",(function(){return Me})),n.d(i,"templateSettings",(function(){return Ve})),n.d(i,"template",(function(){return Ge})),n.d(i,"result",(function(){return Je})),n.d(i,"uniqueId",(function(){return Ye})),n.d(i,"chain",(function(){return Ke})),n.d(i,"iteratee",(function(){return Ae})),n.d(i,"partial",(function(){return et})),n.d(i,"bind",(function(){return tt})),n.d(i,"bindAll",(function(){return rt})),n.d(i,"memoize",(function(){return st})),n.d(i,"delay",(function(){return ot})),n.d(i,"defer",(function(){return at})),n.d(i,"throttle",(function(){return ut})),n.d(i,"debounce",(function(){return lt})),n.d(i,"wrap",(function(){return ct})),n.d(i,"negate",(function(){return dt})),n.d(i,"compose",(function(){return ht})),n.d(i,"after",(function(){return ft})),n.d(i,"before",(function(){return pt})),n.d(i,"once",(function(){return mt})),n.d(i,"findKey",(function(){return vt})),n.d(i,"findIndex",(function(){return yt})),n.d(i,"findLastIndex",(function(){return bt})),n.d(i,"sortedIndex",(function(){return _t})),n.d(i,"indexOf",(function(){return wt})),n.d(i,"lastIndexOf",(function(){return kt})),n.d(i,"find",(function(){return Et})),n.d(i,"detect",(function(){return Et})),n.d(i,"findWhere",(function(){return Ct})),n.d(i,"each",(function(){return Tt})),n.d(i,"forEach",(function(){return Tt})),n.d(i,"map",(function(){return $t})),n.d(i,"collect",(function(){return $t})),n.d(i,"reduce",(function(){return At})),n.d(i,"foldl",(function(){return At})),n.d(i,"inject",(function(){return At})),n.d(i,"reduceRight",(function(){return Nt})),n.d(i,"foldr",(function(){return Nt})),n.d(i,"filter",(function(){return jt})),n.d(i,"select",(function(){return jt})),n.d(i,"reject",(function(){return Dt})),n.d(i,"every",(function(){return Rt})),n.d(i,"all",(function(){return Rt})),n.d(i,"some",(function(){return Ot})),n.d(i,"any",(function(){return Ot})),n.d(i,"contains",(function(){return It})),n.d(i,"includes",(function(){return It})),n.d(i,"include",(function(){return It})),n.d(i,"invoke",(function(){return Ft})),n.d(i,"pluck",(function(){return Pt})),n.d(i,"where",(function(){return Ht})),n.d(i,"max",(function(){return Lt})),n.d(i,"min",(function(){return Mt})),n.d(i,"shuffle",(function(){return qt})),n.d(i,"sample",(function(){return Bt})),n.d(i,"sortBy",(function(){return Ut})),n.d(i,"groupBy",(function(){return Gt})),n.d(i,"indexBy",(function(){return Jt})),n.d(i,"countBy",(function(){return Xt})),n.d(i,"partition",(function(){return Yt})),n.d(i,"toArray",(function(){return Wt})),n.d(i,"size",(function(){return Kt})),n.d(i,"pick",(function(){return Zt})),n.d(i,"omit",(function(){return en})),n.d(i,"first",(function(){return nn})),n.d(i,"head",(function(){return nn})),n.d(i,"take",(function(){return nn})),n.d(i,"initial",(function(){return tn})),n.d(i,"last",(function(){return sn})),n.d(i,"rest",(function(){return rn})),n.d(i,"tail",(function(){return rn})),n.d(i,"drop",(function(){return rn})),n.d(i,"compact",(function(){return on})),n.d(i,"flatten",(function(){return an})),n.d(i,"without",(function(){return ln})),n.d(i,"uniq",(function(){return cn})),n.d(i,"unique",(function(){return cn})),n.d(i,"union",(function(){return dn})),n.d(i,"intersection",(function(){return hn})),n.d(i,"difference",(function(){return un})),n.d(i,"unzip",(function(){return fn})),n.d(i,"transpose",(function(){return fn})),n.d(i,"zip",(function(){return pn})),n.d(i,"object",(function(){return mn})),n.d(i,"range",(function(){return vn})),n.d(i,"chunk",(function(){return gn})),n.d(i,"mixin",(function(){return bn})),n.d(i,"default",(function(){return _n}));var r=n(3);function s(e,t){return t=null==t?e.length-1:+t,function(){for(var n=Math.max(arguments.length-t,0),i=Array(n),r=0;r<n;r++)i[r]=arguments[r+t];switch(t){case 0:return e.call(this,i);case 1:return e.call(this,arguments[0],i);case 2:return e.call(this,arguments[0],arguments[1],i)}var s=Array(t+1);for(r=0;r<t;r++)s[r]=arguments[r];return s[t]=i,e.apply(this,s)}}function o(e){var t=typeof e;return"function"===t||"object"===t&&!!e}function a(e){return null===e}function u(e){return void 0===e}function l(e){return!0===e||!1===e||"[object Boolean]"===r.t.call(e)}function c(e){return!(!e||1!==e.nodeType)}function d(e){var t="[object "+e+"]";return function(e){return r.t.call(e)===t}}var h=d("String"),f=d("Number"),p=d("Date"),m=d("RegExp"),v=d("Error"),g=d("Symbol"),y=d("ArrayBuffer"),b=d("Function"),_=r.p.document&&r.p.document.childNodes;"object"!=typeof Int8Array&&"function"!=typeof _&&(b=function(e){return"function"==typeof e||!1});var x=b,w=d("Object"),k=r.s&&w(new DataView(new ArrayBuffer(8))),E="undefined"!=typeof Map&&w(new Map),C=d("DataView");var T=k?function(e){return null!=e&&x(e.getInt8)&&y(e.buffer)}:C,$=r.k||d("Array");function S(e,t){return null!=e&&r.i.call(e,t)}var A=d("Arguments");!function(){A(arguments)||(A=function(e){return S(e,"callee")})}();var N=A;function j(e){return!g(e)&&Object(r.f)(e)&&!isNaN(parseFloat(e))}function D(e){return f(e)&&Object(r.g)(e)}function R(e){return function(){return e}}function O(e){return function(t){var n=e(t);return"number"==typeof n&&n>=0&&n<=r.b}}function I(e){return function(t){return null==t?void 0:t[e]}}var F=I("byteLength"),P=O(F),H=/\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/;var L=r.r?function(e){return r.l?Object(r.l)(e)&&!T(e):P(e)&&H.test(r.t.call(e))}:R(!1),M=I("length");function V(e,t){t=function(e){for(var t={},n=e.length,i=0;i<n;++i)t[e[i]]=!0;return{contains:function(e){return!0===t[e]},push:function(n){return t[n]=!0,e.push(n)}}}(t);var n=r.n.length,i=e.constructor,s=x(i)&&i.prototype||r.c,o="constructor";for(S(e,o)&&!t.contains(o)&&t.push(o);n--;)(o=r.n[n])in e&&e[o]!==s[o]&&!t.contains(o)&&t.push(o)}function W(e){if(!o(e))return[];if(r.m)return Object(r.m)(e);var t=[];for(var n in e)S(e,n)&&t.push(n);return r.h&&V(e,t),t}function B(e){if(null==e)return!0;var t=M(e);return"number"==typeof t&&($(e)||h(e)||N(e))?0===t:0===M(W(e))}function q(e,t){var n=W(t),i=n.length;if(null==e)return!i;for(var r=Object(e),s=0;s<i;s++){var o=n[s];if(t[o]!==r[o]||!(o in r))return!1}return!0}function U(e){return e instanceof U?e:this instanceof U?void(this._wrapped=e):new U(e)}function z(e){return new Uint8Array(e.buffer||e,e.byteOffset||0,F(e))}U.VERSION=r.e,U.prototype.value=function(){return this._wrapped},U.prototype.valueOf=U.prototype.toJSON=U.prototype.value,U.prototype.toString=function(){return String(this._wrapped)};function G(e,t,n,i){if(e===t)return 0!==e||1/e==1/t;if(null==e||null==t)return!1;if(e!=e)return t!=t;var s=typeof e;return("function"===s||"object"===s||"object"==typeof t)&&function e(t,n,i,s){t instanceof U&&(t=t._wrapped);n instanceof U&&(n=n._wrapped);var o=r.t.call(t);if(o!==r.t.call(n))return!1;if(k&&"[object Object]"==o&&T(t)){if(!T(n))return!1;o="[object DataView]"}switch(o){case"[object RegExp]":case"[object String]":return""+t==""+n;case"[object Number]":return+t!=+t?+n!=+n:0==+t?1/+t==1/n:+t==+n;case"[object Date]":case"[object Boolean]":return+t==+n;case"[object Symbol]":return r.d.valueOf.call(t)===r.d.valueOf.call(n);case"[object ArrayBuffer]":case"[object DataView]":return e(z(t),z(n),i,s)}var a="[object Array]"===o;if(!a&&L(t)){if(F(t)!==F(n))return!1;if(t.buffer===n.buffer&&t.byteOffset===n.byteOffset)return!0;a=!0}if(!a){if("object"!=typeof t||"object"!=typeof n)return!1;var u=t.constructor,l=n.constructor;if(u!==l&&!(x(u)&&u instanceof u&&x(l)&&l instanceof l)&&"constructor"in t&&"constructor"in n)return!1}s=s||[];var c=(i=i||[]).length;for(;c--;)if(i[c]===t)return s[c]===n;if(i.push(t),s.push(n),a){if((c=t.length)!==n.length)return!1;for(;c--;)if(!G(t[c],n[c],i,s))return!1}else{var d,h=W(t);if(c=h.length,W(n).length!==c)return!1;for(;c--;)if(d=h[c],!S(n,d)||!G(t[d],n[d],i,s))return!1}return i.pop(),s.pop(),!0}(e,t,n,i)}function J(e,t){return G(e,t)}function X(e){if(!o(e))return[];var t=[];for(var n in e)t.push(n);return r.h&&V(e,t),t}function Y(e){var t=M(e);return function(n){if(null==n)return!1;var i=X(n);if(M(i))return!1;for(var r=0;r<t;r++)if(!x(n[e[r]]))return!1;return e!==te||!x(n[K])}}var K="forEach",Q=["clear","delete"],Z=["get","has","set"],ee=Q.concat(K,Z),te=Q.concat(Z),ne=["add"].concat(Q,K,"has"),ie=E?Y(ee):d("Map"),re=E?Y(te):d("WeakMap"),se=E?Y(ne):d("Set"),oe=d("WeakSet");function ae(e){for(var t=W(e),n=t.length,i=Array(n),r=0;r<n;r++)i[r]=e[t[r]];return i}function ue(e){for(var t=W(e),n=t.length,i=Array(n),r=0;r<n;r++)i[r]=[t[r],e[t[r]]];return i}function le(e){for(var t={},n=W(e),i=0,r=n.length;i<r;i++)t[e[n[i]]]=n[i];return t}function ce(e){var t=[];for(var n in e)x(e[n])&&t.push(n);return t.sort()}function de(e,t){return function(n){var i=arguments.length;if(t&&(n=Object(n)),i<2||null==n)return n;for(var r=1;r<i;r++)for(var s=arguments[r],o=e(s),a=o.length,u=0;u<a;u++){var l=o[u];t&&void 0!==n[l]||(n[l]=s[l])}return n}}var he=de(X),fe=de(W),pe=de(X,!0);function me(e){if(!o(e))return{};if(r.j)return Object(r.j)(e);var t=function(){};t.prototype=e;var n=new t;return t.prototype=null,n}function ve(e,t){var n=me(e);return t&&fe(n,t),n}function ge(e){return o(e)?$(e)?e.slice():he({},e):e}function ye(e,t){return t(e),e}function be(e){return $(e)?e:[e]}function _e(e){return U.toPath(e)}function xe(e,t){for(var n=t.length,i=0;i<n;i++){if(null==e)return;e=e[t[i]]}return n?e:void 0}function we(e,t,n){var i=xe(e,_e(t));return u(i)?n:i}function ke(e,t){for(var n=(t=_e(t)).length,i=0;i<n;i++){var r=t[i];if(!S(e,r))return!1;e=e[r]}return!!n}function Ee(e){return e}function Ce(e){return e=fe({},e),function(t){return q(t,e)}}function Te(e){return e=_e(e),function(t){return xe(t,e)}}function $e(e,t,n){if(void 0===t)return e;switch(null==n?3:n){case 1:return function(n){return e.call(t,n)};case 3:return function(n,i,r){return e.call(t,n,i,r)};case 4:return function(n,i,r,s){return e.call(t,n,i,r,s)}}return function(){return e.apply(t,arguments)}}function Se(e,t,n){return null==e?Ee:x(e)?$e(e,t,n):o(e)&&!$(e)?Ce(e):Te(e)}function Ae(e,t){return Se(e,t,1/0)}function Ne(e,t,n){return U.iteratee!==Ae?U.iteratee(e,t):Se(e,t,n)}function je(e,t,n){t=Ne(t,n);for(var i=W(e),r=i.length,s={},o=0;o<r;o++){var a=i[o];s[a]=t(e[a],a,e)}return s}function De(){}function Re(e){return null==e?De:function(t){return we(e,t)}}function Oe(e,t,n){var i=Array(Math.max(0,e));t=$e(t,n,1);for(var r=0;r<e;r++)i[r]=t(r);return i}function Ie(e,t){return null==t&&(t=e,e=0),e+Math.floor(Math.random()*(t-e+1))}U.toPath=be,U.iteratee=Ae;var Fe=Date.now||function(){return(new Date).getTime()};function Pe(e){var t=function(t){return e[t]},n="(?:"+W(e).join("|")+")",i=RegExp(n),r=RegExp(n,"g");return function(e){return e=null==e?"":""+e,i.test(e)?e.replace(r,t):e}}var He={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},Le=Pe(He),Me=Pe(le(He)),Ve=U.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g},We=/(.)^/,Be={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},qe=/\\|'|\r|\n|\u2028|\u2029/g;function Ue(e){return"\\"+Be[e]}var ze=/^\s*(\w|\$)+\s*$/;function Ge(e,t,n){!t&&n&&(t=n),t=pe({},t,U.templateSettings);var i=RegExp([(t.escape||We).source,(t.interpolate||We).source,(t.evaluate||We).source].join("|")+"|$","g"),r=0,s="__p+='";e.replace(i,(function(t,n,i,o,a){return s+=e.slice(r,a).replace(qe,Ue),r=a+t.length,n?s+="'+\n((__t=("+n+"))==null?'':_.escape(__t))+\n'":i?s+="'+\n((__t=("+i+"))==null?'':__t)+\n'":o&&(s+="';\n"+o+"\n__p+='"),t})),s+="';\n";var o,a=t.variable;if(a){if(!ze.test(a))throw new Error("variable is not a bare identifier: "+a)}else s="with(obj||{}){\n"+s+"}\n",a="obj";s="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+s+"return __p;\n";try{o=new Function(a,"_",s)}catch(e){throw e.source=s,e}var u=function(e){return o.call(this,e,U)};return u.source="function("+a+"){\n"+s+"}",u}function Je(e,t,n){var i=(t=_e(t)).length;if(!i)return x(n)?n.call(e):n;for(var r=0;r<i;r++){var s=null==e?void 0:e[t[r]];void 0===s&&(s=n,r=i),e=x(s)?s.call(e):s}return e}var Xe=0;function Ye(e){var t=++Xe+"";return e?e+t:t}function Ke(e){var t=U(e);return t._chain=!0,t}function Qe(e,t,n,i,r){if(!(i instanceof t))return e.apply(n,r);var s=me(e.prototype),a=e.apply(s,r);return o(a)?a:s}var Ze=s((function(e,t){var n=Ze.placeholder,i=function(){for(var r=0,s=t.length,o=Array(s),a=0;a<s;a++)o[a]=t[a]===n?arguments[r++]:t[a];for(;r<arguments.length;)o.push(arguments[r++]);return Qe(e,i,this,this,o)};return i}));Ze.placeholder=U;var et=Ze,tt=s((function(e,t,n){if(!x(e))throw new TypeError("Bind must be called on a function");var i=s((function(r){return Qe(e,i,t,this,n.concat(r))}));return i})),nt=O(M);function it(e,t,n,i){if(i=i||[],t||0===t){if(t<=0)return i.concat(e)}else t=1/0;for(var r=i.length,s=0,o=M(e);s<o;s++){var a=e[s];if(nt(a)&&($(a)||N(a)))if(t>1)it(a,t-1,n,i),r=i.length;else for(var u=0,l=a.length;u<l;)i[r++]=a[u++];else n||(i[r++]=a)}return i}var rt=s((function(e,t){var n=(t=it(t,!1,!1)).length;if(n<1)throw new Error("bindAll must be passed function names");for(;n--;){var i=t[n];e[i]=tt(e[i],e)}return e}));function st(e,t){var n=function(i){var r=n.cache,s=""+(t?t.apply(this,arguments):i);return S(r,s)||(r[s]=e.apply(this,arguments)),r[s]};return n.cache={},n}var ot=s((function(e,t,n){return setTimeout((function(){return e.apply(null,n)}),t)})),at=et(ot,U,1);function ut(e,t,n){var i,r,s,o,a=0;n||(n={});var u=function(){a=!1===n.leading?0:Fe(),i=null,o=e.apply(r,s),i||(r=s=null)},l=function(){var l=Fe();a||!1!==n.leading||(a=l);var c=t-(l-a);return r=this,s=arguments,c<=0||c>t?(i&&(clearTimeout(i),i=null),a=l,o=e.apply(r,s),i||(r=s=null)):i||!1===n.trailing||(i=setTimeout(u,c)),o};return l.cancel=function(){clearTimeout(i),a=0,i=r=s=null},l}function lt(e,t,n){var i,r,o,a,u,l=function(){var s=Fe()-r;t>s?i=setTimeout(l,t-s):(i=null,n||(a=e.apply(u,o)),i||(o=u=null))},c=s((function(s){return u=this,o=s,r=Fe(),i||(i=setTimeout(l,t),n&&(a=e.apply(u,o))),a}));return c.cancel=function(){clearTimeout(i),i=o=u=null},c}function ct(e,t){return et(t,e)}function dt(e){return function(){return!e.apply(this,arguments)}}function ht(){var e=arguments,t=e.length-1;return function(){for(var n=t,i=e[t].apply(this,arguments);n--;)i=e[n].call(this,i);return i}}function ft(e,t){return function(){if(--e<1)return t.apply(this,arguments)}}function pt(e,t){var n;return function(){return--e>0&&(n=t.apply(this,arguments)),e<=1&&(t=null),n}}var mt=et(pt,2);function vt(e,t,n){t=Ne(t,n);for(var i,r=W(e),s=0,o=r.length;s<o;s++)if(t(e[i=r[s]],i,e))return i}function gt(e){return function(t,n,i){n=Ne(n,i);for(var r=M(t),s=e>0?0:r-1;s>=0&&s<r;s+=e)if(n(t[s],s,t))return s;return-1}}var yt=gt(1),bt=gt(-1);function _t(e,t,n,i){for(var r=(n=Ne(n,i,1))(t),s=0,o=M(e);s<o;){var a=Math.floor((s+o)/2);n(e[a])<r?s=a+1:o=a}return s}function xt(e,t,n){return function(i,s,o){var a=0,u=M(i);if("number"==typeof o)e>0?a=o>=0?o:Math.max(o+u,a):u=o>=0?Math.min(o+1,u):o+u+1;else if(n&&o&&u)return i[o=n(i,s)]===s?o:-1;if(s!=s)return(o=t(r.q.call(i,a,u),D))>=0?o+a:-1;for(o=e>0?a:u-1;o>=0&&o<u;o+=e)if(i[o]===s)return o;return-1}}var wt=xt(1,yt,_t),kt=xt(-1,bt);function Et(e,t,n){var i=(nt(e)?yt:vt)(e,t,n);if(void 0!==i&&-1!==i)return e[i]}function Ct(e,t){return Et(e,Ce(t))}function Tt(e,t,n){var i,r;if(t=$e(t,n),nt(e))for(i=0,r=e.length;i<r;i++)t(e[i],i,e);else{var s=W(e);for(i=0,r=s.length;i<r;i++)t(e[s[i]],s[i],e)}return e}function $t(e,t,n){t=Ne(t,n);for(var i=!nt(e)&&W(e),r=(i||e).length,s=Array(r),o=0;o<r;o++){var a=i?i[o]:o;s[o]=t(e[a],a,e)}return s}function St(e){var t=function(t,n,i,r){var s=!nt(t)&&W(t),o=(s||t).length,a=e>0?0:o-1;for(r||(i=t[s?s[a]:a],a+=e);a>=0&&a<o;a+=e){var u=s?s[a]:a;i=n(i,t[u],u,t)}return i};return function(e,n,i,r){var s=arguments.length>=3;return t(e,$e(n,r,4),i,s)}}var At=St(1),Nt=St(-1);function jt(e,t,n){var i=[];return t=Ne(t,n),Tt(e,(function(e,n,r){t(e,n,r)&&i.push(e)})),i}function Dt(e,t,n){return jt(e,dt(Ne(t)),n)}function Rt(e,t,n){t=Ne(t,n);for(var i=!nt(e)&&W(e),r=(i||e).length,s=0;s<r;s++){var o=i?i[s]:s;if(!t(e[o],o,e))return!1}return!0}function Ot(e,t,n){t=Ne(t,n);for(var i=!nt(e)&&W(e),r=(i||e).length,s=0;s<r;s++){var o=i?i[s]:s;if(t(e[o],o,e))return!0}return!1}function It(e,t,n,i){return nt(e)||(e=ae(e)),("number"!=typeof n||i)&&(n=0),wt(e,t,n)>=0}var Ft=s((function(e,t,n){var i,r;return x(t)?r=t:(t=_e(t),i=t.slice(0,-1),t=t[t.length-1]),$t(e,(function(e){var s=r;if(!s){if(i&&i.length&&(e=xe(e,i)),null==e)return;s=e[t]}return null==s?s:s.apply(e,n)}))}));function Pt(e,t){return $t(e,Te(t))}function Ht(e,t){return jt(e,Ce(t))}function Lt(e,t,n){var i,r,s=-1/0,o=-1/0;if(null==t||"number"==typeof t&&"object"!=typeof e[0]&&null!=e)for(var a=0,u=(e=nt(e)?e:ae(e)).length;a<u;a++)null!=(i=e[a])&&i>s&&(s=i);else t=Ne(t,n),Tt(e,(function(e,n,i){((r=t(e,n,i))>o||r===-1/0&&s===-1/0)&&(s=e,o=r)}));return s}function Mt(e,t,n){var i,r,s=1/0,o=1/0;if(null==t||"number"==typeof t&&"object"!=typeof e[0]&&null!=e)for(var a=0,u=(e=nt(e)?e:ae(e)).length;a<u;a++)null!=(i=e[a])&&i<s&&(s=i);else t=Ne(t,n),Tt(e,(function(e,n,i){((r=t(e,n,i))<o||r===1/0&&s===1/0)&&(s=e,o=r)}));return s}var Vt=/[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g;function Wt(e){return e?$(e)?r.q.call(e):h(e)?e.match(Vt):nt(e)?$t(e,Ee):ae(e):[]}function Bt(e,t,n){if(null==t||n)return nt(e)||(e=ae(e)),e[Ie(e.length-1)];var i=Wt(e),r=M(i);t=Math.max(Math.min(t,r),0);for(var s=r-1,o=0;o<t;o++){var a=Ie(o,s),u=i[o];i[o]=i[a],i[a]=u}return i.slice(0,t)}function qt(e){return Bt(e,1/0)}function Ut(e,t,n){var i=0;return t=Ne(t,n),Pt($t(e,(function(e,n,r){return{value:e,index:i++,criteria:t(e,n,r)}})).sort((function(e,t){var n=e.criteria,i=t.criteria;if(n!==i){if(n>i||void 0===n)return 1;if(n<i||void 0===i)return-1}return e.index-t.index})),"value")}function zt(e,t){return function(n,i,r){var s=t?[[],[]]:{};return i=Ne(i,r),Tt(n,(function(t,r){var o=i(t,r,n);e(s,t,o)})),s}}var Gt=zt((function(e,t,n){S(e,n)?e[n].push(t):e[n]=[t]})),Jt=zt((function(e,t,n){e[n]=t})),Xt=zt((function(e,t,n){S(e,n)?e[n]++:e[n]=1})),Yt=zt((function(e,t,n){e[n?0:1].push(t)}),!0);function Kt(e){return null==e?0:nt(e)?e.length:W(e).length}function Qt(e,t,n){return t in n}var Zt=s((function(e,t){var n={},i=t[0];if(null==e)return n;x(i)?(t.length>1&&(i=$e(i,t[1])),t=X(e)):(i=Qt,t=it(t,!1,!1),e=Object(e));for(var r=0,s=t.length;r<s;r++){var o=t[r],a=e[o];i(a,o,e)&&(n[o]=a)}return n})),en=s((function(e,t){var n,i=t[0];return x(i)?(i=dt(i),t.length>1&&(n=t[1])):(t=$t(it(t,!1,!1),String),i=function(e,n){return!It(t,n)}),Zt(e,i,n)}));function tn(e,t,n){return r.q.call(e,0,Math.max(0,e.length-(null==t||n?1:t)))}function nn(e,t,n){return null==e||e.length<1?null==t||n?void 0:[]:null==t||n?e[0]:tn(e,e.length-t)}function rn(e,t,n){return r.q.call(e,null==t||n?1:t)}function sn(e,t,n){return null==e||e.length<1?null==t||n?void 0:[]:null==t||n?e[e.length-1]:rn(e,Math.max(0,e.length-t))}function on(e){return jt(e,Boolean)}function an(e,t){return it(e,t,!1)}var un=s((function(e,t){return t=it(t,!0,!0),jt(e,(function(e){return!It(t,e)}))})),ln=s((function(e,t){return un(e,t)}));function cn(e,t,n,i){l(t)||(i=n,n=t,t=!1),null!=n&&(n=Ne(n,i));for(var r=[],s=[],o=0,a=M(e);o<a;o++){var u=e[o],c=n?n(u,o,e):u;t&&!n?(o&&s===c||r.push(u),s=c):n?It(s,c)||(s.push(c),r.push(u)):It(r,u)||r.push(u)}return r}var dn=s((function(e){return cn(it(e,!0,!0))}));function hn(e){for(var t=[],n=arguments.length,i=0,r=M(e);i<r;i++){var s=e[i];if(!It(t,s)){var o;for(o=1;o<n&&It(arguments[o],s);o++);o===n&&t.push(s)}}return t}function fn(e){for(var t=e&&Lt(e,M).length||0,n=Array(t),i=0;i<t;i++)n[i]=Pt(e,i);return n}var pn=s(fn);function mn(e,t){for(var n={},i=0,r=M(e);i<r;i++)t?n[e[i]]=t[i]:n[e[i][0]]=e[i][1];return n}function vn(e,t,n){null==t&&(t=e||0,e=0),n||(n=t<e?-1:1);for(var i=Math.max(Math.ceil((t-e)/n),0),r=Array(i),s=0;s<i;s++,e+=n)r[s]=e;return r}function gn(e,t){if(null==t||t<1)return[];for(var n=[],i=0,s=e.length;i<s;)n.push(r.q.call(e,i,i+=t));return n}function yn(e,t){return e._chain?U(t).chain():t}function bn(e){return Tt(ce(e),(function(t){var n=U[t]=e[t];U.prototype[t]=function(){var e=[this._wrapped];return r.o.apply(e,arguments),yn(this,n.apply(U,e))}})),U}Tt(["pop","push","reverse","shift","sort","splice","unshift"],(function(e){var t=r.a[e];U.prototype[e]=function(){var n=this._wrapped;return null!=n&&(t.apply(n,arguments),"shift"!==e&&"splice"!==e||0!==n.length||delete n[0]),yn(this,n)}})),Tt(["concat","join","slice"],(function(e){var t=r.a[e];U.prototype[e]=function(){var e=this._wrapped;return null!=e&&(e=t.apply(e,arguments)),yn(this,e)}}));var _n=U,xn=bn(i);xn._=xn;var wn=xn},9:function(e,t,n){"use strict";function i(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}var r="application/json; charset=utf-8",s=function(){function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.runtime=t,this.element=n,this.url=this.url.bind(this),this.render=this.render.bind(this),this.renderLatex=this.renderLatex.bind(this),this.renderContinuedPeer=this.renderContinuedPeer.bind(this),this.studentInfo=this.studentInfo.bind(this),this.staffGradeForm=this.staffGradeForm.bind(this),this.staffGradeCounts=this.staffGradeCounts.bind(this),this.submit=this.submit.bind(this),this.save=this.save.bind(this),this.submitFeedbackOnAssessment=this.submitFeedbackOnAssessment.bind(this),this.submitAssessment=this.submitAssessment.bind(this),this.peerAssess=this.peerAssess.bind(this),this.selfAssess=this.selfAssess.bind(this),this.staffAssess=this.staffAssess.bind(this),this.trainingAssess=this.trainingAssess.bind(this),this.scheduleTraining=this.scheduleTraining.bind(this),this.rescheduleUnfinishedTasks=this.rescheduleUnfinishedTasks.bind(this),this.updateEditorContext=this.updateEditorContext.bind(this),this.checkReleased=this.checkReleased.bind(this),this.getUploadUrl=this.getUploadUrl.bind(this),this.removeUploadedFile=this.removeUploadedFile.bind(this),this.saveFilesDescriptions=this.saveFilesDescriptions.bind(this),this.getDownloadUrl=this.getDownloadUrl.bind(this),this.cancelSubmission=this.cancelSubmission.bind(this),this.publishEvent=this.publishEvent.bind(this),this.getTeamDetail=this.getTeamDetail.bind(this),this.listTeams=this.listTeams.bind(this),this.getUsername=this.getUsername.bind(this)}var t,n,s;return t=e,(n=[{key:"url",value:function(e){return this.runtime.handlerUrl(this.element,e)}},{key:"render",value:function(e){var t=this,n=this.url("render_".concat(e));return $.Deferred((function(e){$.ajax({url:n,type:"POST",dataType:"html"}).done((function(n){e.resolveWith(t,[n])})).fail((function(){e.rejectWith(t,[gettext("This section could not be loaded.")])}))})).promise()}},{key:"renderLatex",value:function(e){e.filter(".allow--latex").each((function(){MathJax.Hub.Queue(["Typeset",MathJax.Hub,this])}))}},{key:"renderContinuedPeer",value:function(){var e=this,t=this.url("render_peer_assessment");return $.Deferred((function(n){$.ajax({url:t,type:"POST",dataType:"html",data:{continue_grading:!0}}).done((function(t){n.resolveWith(e,[t])})).fail((function(){n.rejectWith(e,[gettext("This section could not be loaded.")])}))})).promise()}},{key:"studentInfo",value:function(e,t){var n=this.url("render_student_info");return $.Deferred((function(i){$.ajax({url:n,type:"POST",dataType:"html",data:_.extend({student_username:e},t)}).done((function(e){i.resolveWith(this,[e])})).fail((function(){i.rejectWith(this,[gettext("This section could not be loaded.")])}))})).promise()}},{key:"staffGradeForm",value:function(){var e=this.url("render_staff_grade_form");return $.Deferred((function(t){$.ajax({url:e,type:"POST",dataType:"html"}).done((function(e){t.resolveWith(this,[e])})).fail((function(){t.rejectWith(this,[gettext("The staff assessment form could not be loaded.")])}))})).promise()}},{key:"staffGradeCounts",value:function(){var e=this.url("render_staff_grade_counts");return $.Deferred((function(t){$.ajax({url:e,type:"POST",dataType:"html"}).done((function(e){t.resolveWith(this,[e])})).fail((function(){t.rejectWith(this,[gettext("The display of ungraded and checked out responses could not be loaded.")])}))})).promise()}},{key:"submit",value:function(e){var t=this.url("submit");return $.Deferred((function(n){$.ajax({type:"POST",url:t,data:JSON.stringify({submission:e}),contentType:r}).done((function(e){if(e[0]){var t=e[1],i=e[2];n.resolveWith(this,[t,i])}else{var r=e[1],s=e[2];n.rejectWith(this,[r,s])}})).fail((function(){n.rejectWith(this,["AJAX",gettext("This response could not be submitted.")])}))})).promise()}},{key:"save",value:function(e){var t=this.url("save_submission");return $.Deferred((function(n){$.ajax({type:"POST",url:t,data:JSON.stringify({submission:e}),contentType:r}).done((function(e){e.success?n.resolve():n.rejectWith(this,[e.msg])})).fail((function(){n.rejectWith(this,[gettext("This response could not be saved.")])}))})).promise()}},{key:"submitFeedbackOnAssessment",value:function(e,t){var n=this.url("submit_feedback"),i=JSON.stringify({feedback_text:e,feedback_options:t});return $.Deferred((function(e){$.ajax({type:"POST",url:n,data:i,contentType:r}).done((function(t){t.success?e.resolve():e.rejectWith(this,[t.msg])})).fail((function(){e.rejectWith(this,[gettext("This feedback could not be submitted.")])}))})).promise()}},{key:"submitAssessment",value:function(e,t){var n=this.url(e);return $.Deferred((function(e){$.ajax({type:"POST",url:n,data:JSON.stringify(t),contentType:r}).done((function(t){t.success?e.resolve():e.rejectWith(this,[t.msg])})).fail((function(){e.rejectWith(this,[gettext("This assessment could not be submitted.")])}))})).promise()}},{key:"peerAssess",value:function(e,t,n,i){return this.submitAssessment("peer_assess",{options_selected:e,criterion_feedback:t,overall_feedback:n,submission_uuid:i})}},{key:"selfAssess",value:function(e,t,n){return this.submitAssessment("self_assess",{options_selected:e,criterion_feedback:t,overall_feedback:n})}},{key:"staffAssess",value:function(e,t,n,i,r){return this.submitAssessment("staff_assess",{options_selected:e,criterion_feedback:t,overall_feedback:n,submission_uuid:i,assess_type:r})}},{key:"trainingAssess",value:function(e){var t=this.url("training_assess"),n=JSON.stringify({options_selected:e});return $.Deferred((function(e){$.ajax({type:"POST",url:t,data:n,contentType:r}).done((function(t){t.success?e.resolveWith(this,[t.corrections]):e.rejectWith(this,[t.msg])})).fail((function(){e.rejectWith(this,[gettext("This assessment could not be submitted.")])}))}))}},{key:"scheduleTraining",value:function(){var e=this.url("schedule_training");return $.Deferred((function(t){$.ajax({type:"POST",url:e,data:'""',contentType:r}).done((function(e){e.success?t.resolveWith(this,[e.msg]):t.rejectWith(this,[e.msg])})).fail((function(){t.rejectWith(this,[gettext("This assessment could not be submitted.")])}))}))}},{key:"rescheduleUnfinishedTasks",value:function(){var e=this.url("reschedule_unfinished_tasks");return $.Deferred((function(t){$.ajax({type:"POST",url:e,data:'""',contentType:r}).done((function(e){e.success?t.resolveWith(this,[e.msg]):t.rejectWith(this,[e.msg])})).fail((function(){t.rejectWith(this,[gettext("One or more rescheduling tasks failed.")])}))}))}},{key:"updateEditorContext",value:function(e){var t=this.url("update_editor_context"),n=JSON.stringify({prompts:e.prompts,prompts_type:e.prompts_type,feedback_prompt:e.feedbackPrompt,feedback_default_text:e.feedback_default_text,title:e.title,submission_start:e.submissionStart,submission_due:e.submissionDue,criteria:e.criteria,assessments:e.assessments,editor_assessments_order:e.editorAssessmentsOrder,text_response:e.textResponse,text_response_editor:e.textResponseEditor,file_upload_response:e.fileUploadResponse,file_upload_type:e.fileUploadType,white_listed_file_types:e.fileTypeWhiteList,allow_multiple_files:e.multipleFilesEnabled,allow_latex:e.latexEnabled,leaderboard_show:e.leaderboardNum,teams_enabled:e.teamsEnabled,selected_teamset_id:e.selectedTeamsetId,show_rubric_during_response:e.showRubricDuringResponse});return $.Deferred((function(e){$.ajax({type:"POST",url:t,data:n,contentType:r}).done((function(t){t.success?e.resolve():e.rejectWith(this,[t.msg])})).fail((function(){e.rejectWith(this,[gettext("This problem could not be saved.")])}))})).promise()}},{key:"checkReleased",value:function(){var e=this.url("check_released");return $.Deferred((function(t){$.ajax({type:"POST",url:e,data:'""',contentType:r}).done((function(e){e.success?t.resolveWith(this,[e.is_released]):t.rejectWith(this,[e.msg])})).fail((function(){t.rejectWith(this,[gettext("The server could not be contacted.")])}))})).promise()}},{key:"getUploadUrl",value:function(e,t,n){var i=this.url("upload_url");return $.Deferred((function(s){$.ajax({type:"POST",url:i,data:JSON.stringify({contentType:e,filename:t,filenum:n}),contentType:r}).done((function(e){e.success?s.resolve(e.url):s.rejectWith(this,[e.msg])})).fail((function(){s.rejectWith(this,[gettext("Could not retrieve upload url.")])}))})).promise()}},{key:"removeUploadedFile",value:function(e){var t=this.url("remove_uploaded_file");return $.Deferred((function(n){$.ajax({type:"POST",url:t,data:JSON.stringify({filenum:e}),contentType:r}).done((function(e){e.success?n.resolve():n.rejectWith(this,[e.msg])})).fail((function(){n.rejectWith(this,[gettext("Server error.")])}))})).promise()}},{key:"saveFilesDescriptions",value:function(e){var t=this.url("save_files_descriptions");return $.Deferred((function(n){$.ajax({type:"POST",url:t,data:JSON.stringify({fileMetadata:e}),contentType:r}).done((function(e){e.success?n.resolve():n.rejectWith(this,[e.msg])})).fail((function(){n.rejectWith(this,[gettext("Server error.")])}))})).promise()}},{key:"getDownloadUrl",value:function(e){var t=this.url("download_url");return $.Deferred((function(n){$.ajax({type:"POST",url:t,data:JSON.stringify({filenum:e}),contentType:r}).done((function(e){e.success?n.resolve(e.url):n.rejectWith(this,[e.msg])})).fail((function(){n.rejectWith(this,[gettext("Could not retrieve download url.")])}))})).promise()}},{key:"cancelSubmission",value:function(e,t){var n=this.url("cancel_submission"),i=JSON.stringify({submission_uuid:e,comments:t});return $.Deferred((function(e){$.ajax({type:"POST",url:n,data:i,contentType:r}).done((function(t){t.success&&e.resolveWith(this,[t.msg])})).fail((function(){e.rejectWith(this,[gettext("The submission could not be removed from the grading pool.")])}))})).promise()}},{key:"publishEvent",value:function(e,t){t.event_name=e;var n=this.url("publish_event"),i=JSON.stringify(t);$.ajax({type:"POST",url:n,data:i,contentType:r})}},{key:"getTeamDetail",value:function(e){var t="".concat(window.location.origin,"/api/team/v0/teams/").concat(e);return $.ajax({type:"GET",url:t,contentType:r})}},{key:"listTeams",value:function(e,t){var n="".concat(window.location.origin,"/api/team/v0/teams/");return $.Deferred((function(i){$.ajax({type:"GET",url:n,data:{course_id:t,username:e},contentType:r}).done((function(e){e.count>1?i.rejectWith(this,[gettext("Multiple teams returned for course")]):0===e.count?i.resolveWith(this,[null]):i.resolveWith(this,[e.results[0]])})).fail((function(){i.rejectWith(this,[gettext("Could not load teams information.")])}))})).promise()}},{key:"getUsername",value:function(){var e=this.url("get_student_username");return $.Deferred((function(t){$.ajax({type:"POST",url:e,data:JSON.stringify({}),contentType:r}).done((function(e){null===e.username?t.rejectWith(this,[gettext("User lookup failed")]):t.resolveWith(this,[e.username])})).fail((function(){t.rejectWith(this,[gettext("Error when looking up username")])}))}))}},{key:"cloneRubric",value:function(e){var t=this.url("get_rubric"),n={target_rubric_block_id:String(e)};return $.Deferred((function(e){$.ajax({type:"POST",url:t,data:JSON.stringify(n),contentType:r}).done((function(t){t.success?e.resolveWith(this,[t.rubric]):e.rejectWith(this,[t.msg])})).fail((function(){e.rejectWith(this,[gettext("Failed to clone rubric")])}))}))}}])&&i(t.prototype,n),s&&i(t,s),e}();t.a=s}});
//# sourceMappingURL=openassessment-studio.da519829e6a80c27afcc.js.map