!function(t){var e={};function n(i){if(e[i])return e[i].exports;var r=e[i]={i:i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)n.d(i,r,function(e){return t[e]}.bind(null,r));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=25)}([function(t,e,n){var i;
/*!
 * jQuery JavaScript Library v3.5.1
 * https://jquery.com/
 *
 * Includes Sizzle.js
 * https://sizzlejs.com/
 *
 * Copyright JS Foundation and other contributors
 * Released under the MIT license
 * https://jquery.org/license
 *
 * Date: 2020-05-04T22:49Z
 */!function(e,n){"use strict";"object"==typeof t.exports?t.exports=e.document?n(e,!0):function(t){if(!t.document)throw new Error("jQuery requires a window with a document");return n(t)}:n(e)}("undefined"!=typeof window?window:this,(function(n,r){"use strict";var s=[],o=Object.getPrototypeOf,a=s.slice,l=s.flat?function(t){return s.flat.call(t)}:function(t){return s.concat.apply([],t)},c=s.push,u=s.indexOf,d={},h=d.toString,_=d.hasOwnProperty,f=_.toString,p=f.call(Object),g={},m=function(t){return"function"==typeof t&&"number"!=typeof t.nodeType},v=function(t){return null!=t&&t===t.window},y=n.document,b={type:!0,src:!0,nonce:!0,noModule:!0};function w(t,e,n){var i,r,s=(n=n||y).createElement("script");if(s.text=t,e)for(i in b)(r=e[i]||e.getAttribute&&e.getAttribute(i))&&s.setAttribute(i,r);n.head.appendChild(s).parentNode.removeChild(s)}function x(t){return null==t?t+"":"object"==typeof t||"function"==typeof t?d[h.call(t)]||"object":typeof t}var k=function(t,e){return new k.fn.init(t,e)};function E(t){var e=!!t&&"length"in t&&t.length,n=x(t);return!m(t)&&!v(t)&&("array"===n||0===e||"number"==typeof e&&e>0&&e-1 in t)}k.fn=k.prototype={jquery:"3.5.1",constructor:k,length:0,toArray:function(){return a.call(this)},get:function(t){return null==t?a.call(this):t<0?this[t+this.length]:this[t]},pushStack:function(t){var e=k.merge(this.constructor(),t);return e.prevObject=this,e},each:function(t){return k.each(this,t)},map:function(t){return this.pushStack(k.map(this,(function(e,n){return t.call(e,n,e)})))},slice:function(){return this.pushStack(a.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(k.grep(this,(function(t,e){return(e+1)%2})))},odd:function(){return this.pushStack(k.grep(this,(function(t,e){return e%2})))},eq:function(t){var e=this.length,n=+t+(t<0?e:0);return this.pushStack(n>=0&&n<e?[this[n]]:[])},end:function(){return this.prevObject||this.constructor()},push:c,sort:s.sort,splice:s.splice},k.extend=k.fn.extend=function(){var t,e,n,i,r,s,o=arguments[0]||{},a=1,l=arguments.length,c=!1;for("boolean"==typeof o&&(c=o,o=arguments[a]||{},a++),"object"==typeof o||m(o)||(o={}),a===l&&(o=this,a--);a<l;a++)if(null!=(t=arguments[a]))for(e in t)i=t[e],"__proto__"!==e&&o!==i&&(c&&i&&(k.isPlainObject(i)||(r=Array.isArray(i)))?(n=o[e],s=r&&!Array.isArray(n)?[]:r||k.isPlainObject(n)?n:{},r=!1,o[e]=k.extend(c,s,i)):void 0!==i&&(o[e]=i));return o},k.extend({expando:"jQuery"+("3.5.1"+Math.random()).replace(/\D/g,""),isReady:!0,error:function(t){throw new Error(t)},noop:function(){},isPlainObject:function(t){var e,n;return!(!t||"[object Object]"!==h.call(t))&&(!(e=o(t))||"function"==typeof(n=_.call(e,"constructor")&&e.constructor)&&f.call(n)===p)},isEmptyObject:function(t){var e;for(e in t)return!1;return!0},globalEval:function(t,e,n){w(t,{nonce:e&&e.nonce},n)},each:function(t,e){var n,i=0;if(E(t))for(n=t.length;i<n&&!1!==e.call(t[i],i,t[i]);i++);else for(i in t)if(!1===e.call(t[i],i,t[i]))break;return t},makeArray:function(t,e){var n=e||[];return null!=t&&(E(Object(t))?k.merge(n,"string"==typeof t?[t]:t):c.call(n,t)),n},inArray:function(t,e,n){return null==e?-1:u.call(e,t,n)},merge:function(t,e){for(var n=+e.length,i=0,r=t.length;i<n;i++)t[r++]=e[i];return t.length=r,t},grep:function(t,e,n){for(var i=[],r=0,s=t.length,o=!n;r<s;r++)!e(t[r],r)!==o&&i.push(t[r]);return i},map:function(t,e,n){var i,r,s=0,o=[];if(E(t))for(i=t.length;s<i;s++)null!=(r=e(t[s],s,n))&&o.push(r);else for(s in t)null!=(r=e(t[s],s,n))&&o.push(r);return l(o)},guid:1,support:g}),"function"==typeof Symbol&&(k.fn[Symbol.iterator]=s[Symbol.iterator]),k.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),(function(t,e){d["[object "+e+"]"]=e.toLowerCase()}));var T=
/*!
 * Sizzle CSS Selector Engine v2.3.5
 * https://sizzlejs.com/
 *
 * Copyright JS Foundation and other contributors
 * Released under the MIT license
 * https://js.foundation/
 *
 * Date: 2020-03-14
 */
function(t){var e,n,i,r,s,o,a,l,c,u,d,h,_,f,p,g,m,v,y,b="sizzle"+1*new Date,w=t.document,x=0,k=0,E=lt(),T=lt(),C=lt(),j=lt(),S=function(t,e){return t===e&&(d=!0),0},A={}.hasOwnProperty,N=[],D=N.pop,O=N.push,I=N.push,$=N.slice,R=function(t,e){for(var n=0,i=t.length;n<i;n++)if(t[n]===e)return n;return-1},L="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",M="[\\x20\\t\\r\\n\\f]",P="(?:\\\\[\\da-fA-F]{1,6}"+M+"?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",q="\\["+M+"*("+P+")(?:"+M+"*([*^$|!~]?=)"+M+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+P+"))|)"+M+"*\\]",z=":("+P+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+q+")*)|.*)\\)|)",H=new RegExp(M+"+","g"),B=new RegExp("^"+M+"+|((?:^|[^\\\\])(?:\\\\.)*)"+M+"+$","g"),F=new RegExp("^"+M+"*,"+M+"*"),W=new RegExp("^"+M+"*([>+~]|"+M+")"+M+"*"),U=new RegExp(M+"|>"),V=new RegExp(z),J=new RegExp("^"+P+"$"),X={ID:new RegExp("^#("+P+")"),CLASS:new RegExp("^\\.("+P+")"),TAG:new RegExp("^("+P+"|[*])"),ATTR:new RegExp("^"+q),PSEUDO:new RegExp("^"+z),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+L+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},K=/HTML$/i,G=/^(?:input|select|textarea|button)$/i,Y=/^h\d$/i,Q=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,tt=/[+~]/,et=new RegExp("\\\\[\\da-fA-F]{1,6}"+M+"?|\\\\([^\\r\\n\\f])","g"),nt=function(t,e){var n="0x"+t.slice(1)-65536;return e||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},it=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,rt=function(t,e){return e?"\0"===t?"�":t.slice(0,-1)+"\\"+t.charCodeAt(t.length-1).toString(16)+" ":"\\"+t},st=function(){h()},ot=bt((function(t){return!0===t.disabled&&"fieldset"===t.nodeName.toLowerCase()}),{dir:"parentNode",next:"legend"});try{I.apply(N=$.call(w.childNodes),w.childNodes),N[w.childNodes.length].nodeType}catch(t){I={apply:N.length?function(t,e){O.apply(t,$.call(e))}:function(t,e){for(var n=t.length,i=0;t[n++]=e[i++];);t.length=n-1}}}function at(t,e,i,r){var s,a,c,u,d,f,m,v=e&&e.ownerDocument,w=e?e.nodeType:9;if(i=i||[],"string"!=typeof t||!t||1!==w&&9!==w&&11!==w)return i;if(!r&&(h(e),e=e||_,p)){if(11!==w&&(d=Z.exec(t)))if(s=d[1]){if(9===w){if(!(c=e.getElementById(s)))return i;if(c.id===s)return i.push(c),i}else if(v&&(c=v.getElementById(s))&&y(e,c)&&c.id===s)return i.push(c),i}else{if(d[2])return I.apply(i,e.getElementsByTagName(t)),i;if((s=d[3])&&n.getElementsByClassName&&e.getElementsByClassName)return I.apply(i,e.getElementsByClassName(s)),i}if(n.qsa&&!j[t+" "]&&(!g||!g.test(t))&&(1!==w||"object"!==e.nodeName.toLowerCase())){if(m=t,v=e,1===w&&(U.test(t)||W.test(t))){for((v=tt.test(t)&&mt(e.parentNode)||e)===e&&n.scope||((u=e.getAttribute("id"))?u=u.replace(it,rt):e.setAttribute("id",u=b)),a=(f=o(t)).length;a--;)f[a]=(u?"#"+u:":scope")+" "+yt(f[a]);m=f.join(",")}try{return I.apply(i,v.querySelectorAll(m)),i}catch(e){j(t,!0)}finally{u===b&&e.removeAttribute("id")}}}return l(t.replace(B,"$1"),e,i,r)}function lt(){var t=[];return function e(n,r){return t.push(n+" ")>i.cacheLength&&delete e[t.shift()],e[n+" "]=r}}function ct(t){return t[b]=!0,t}function ut(t){var e=_.createElement("fieldset");try{return!!t(e)}catch(t){return!1}finally{e.parentNode&&e.parentNode.removeChild(e),e=null}}function dt(t,e){for(var n=t.split("|"),r=n.length;r--;)i.attrHandle[n[r]]=e}function ht(t,e){var n=e&&t,i=n&&1===t.nodeType&&1===e.nodeType&&t.sourceIndex-e.sourceIndex;if(i)return i;if(n)for(;n=n.nextSibling;)if(n===e)return-1;return t?1:-1}function _t(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function ft(t){return function(e){var n=e.nodeName.toLowerCase();return("input"===n||"button"===n)&&e.type===t}}function pt(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&ot(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function gt(t){return ct((function(e){return e=+e,ct((function(n,i){for(var r,s=t([],n.length,e),o=s.length;o--;)n[r=s[o]]&&(n[r]=!(i[r]=n[r]))}))}))}function mt(t){return t&&void 0!==t.getElementsByTagName&&t}for(e in n=at.support={},s=at.isXML=function(t){var e=t.namespaceURI,n=(t.ownerDocument||t).documentElement;return!K.test(e||n&&n.nodeName||"HTML")},h=at.setDocument=function(t){var e,r,o=t?t.ownerDocument||t:w;return o!=_&&9===o.nodeType&&o.documentElement?(f=(_=o).documentElement,p=!s(_),w!=_&&(r=_.defaultView)&&r.top!==r&&(r.addEventListener?r.addEventListener("unload",st,!1):r.attachEvent&&r.attachEvent("onunload",st)),n.scope=ut((function(t){return f.appendChild(t).appendChild(_.createElement("div")),void 0!==t.querySelectorAll&&!t.querySelectorAll(":scope fieldset div").length})),n.attributes=ut((function(t){return t.className="i",!t.getAttribute("className")})),n.getElementsByTagName=ut((function(t){return t.appendChild(_.createComment("")),!t.getElementsByTagName("*").length})),n.getElementsByClassName=Q.test(_.getElementsByClassName),n.getById=ut((function(t){return f.appendChild(t).id=b,!_.getElementsByName||!_.getElementsByName(b).length})),n.getById?(i.filter.ID=function(t){var e=t.replace(et,nt);return function(t){return t.getAttribute("id")===e}},i.find.ID=function(t,e){if(void 0!==e.getElementById&&p){var n=e.getElementById(t);return n?[n]:[]}}):(i.filter.ID=function(t){var e=t.replace(et,nt);return function(t){var n=void 0!==t.getAttributeNode&&t.getAttributeNode("id");return n&&n.value===e}},i.find.ID=function(t,e){if(void 0!==e.getElementById&&p){var n,i,r,s=e.getElementById(t);if(s){if((n=s.getAttributeNode("id"))&&n.value===t)return[s];for(r=e.getElementsByName(t),i=0;s=r[i++];)if((n=s.getAttributeNode("id"))&&n.value===t)return[s]}return[]}}),i.find.TAG=n.getElementsByTagName?function(t,e){return void 0!==e.getElementsByTagName?e.getElementsByTagName(t):n.qsa?e.querySelectorAll(t):void 0}:function(t,e){var n,i=[],r=0,s=e.getElementsByTagName(t);if("*"===t){for(;n=s[r++];)1===n.nodeType&&i.push(n);return i}return s},i.find.CLASS=n.getElementsByClassName&&function(t,e){if(void 0!==e.getElementsByClassName&&p)return e.getElementsByClassName(t)},m=[],g=[],(n.qsa=Q.test(_.querySelectorAll))&&(ut((function(t){var e;f.appendChild(t).innerHTML="<a id='"+b+"'></a><select id='"+b+"-\r\\' msallowcapture=''><option selected=''></option></select>",t.querySelectorAll("[msallowcapture^='']").length&&g.push("[*^$]="+M+"*(?:''|\"\")"),t.querySelectorAll("[selected]").length||g.push("\\["+M+"*(?:value|"+L+")"),t.querySelectorAll("[id~="+b+"-]").length||g.push("~="),(e=_.createElement("input")).setAttribute("name",""),t.appendChild(e),t.querySelectorAll("[name='']").length||g.push("\\["+M+"*name"+M+"*="+M+"*(?:''|\"\")"),t.querySelectorAll(":checked").length||g.push(":checked"),t.querySelectorAll("a#"+b+"+*").length||g.push(".#.+[+~]"),t.querySelectorAll("\\\f"),g.push("[\\r\\n\\f]")})),ut((function(t){t.innerHTML="<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>";var e=_.createElement("input");e.setAttribute("type","hidden"),t.appendChild(e).setAttribute("name","D"),t.querySelectorAll("[name=d]").length&&g.push("name"+M+"*[*^$|!~]?="),2!==t.querySelectorAll(":enabled").length&&g.push(":enabled",":disabled"),f.appendChild(t).disabled=!0,2!==t.querySelectorAll(":disabled").length&&g.push(":enabled",":disabled"),t.querySelectorAll("*,:x"),g.push(",.*:")}))),(n.matchesSelector=Q.test(v=f.matches||f.webkitMatchesSelector||f.mozMatchesSelector||f.oMatchesSelector||f.msMatchesSelector))&&ut((function(t){n.disconnectedMatch=v.call(t,"*"),v.call(t,"[s!='']:x"),m.push("!=",z)})),g=g.length&&new RegExp(g.join("|")),m=m.length&&new RegExp(m.join("|")),e=Q.test(f.compareDocumentPosition),y=e||Q.test(f.contains)?function(t,e){var n=9===t.nodeType?t.documentElement:t,i=e&&e.parentNode;return t===i||!(!i||1!==i.nodeType||!(n.contains?n.contains(i):t.compareDocumentPosition&&16&t.compareDocumentPosition(i)))}:function(t,e){if(e)for(;e=e.parentNode;)if(e===t)return!0;return!1},S=e?function(t,e){if(t===e)return d=!0,0;var i=!t.compareDocumentPosition-!e.compareDocumentPosition;return i||(1&(i=(t.ownerDocument||t)==(e.ownerDocument||e)?t.compareDocumentPosition(e):1)||!n.sortDetached&&e.compareDocumentPosition(t)===i?t==_||t.ownerDocument==w&&y(w,t)?-1:e==_||e.ownerDocument==w&&y(w,e)?1:u?R(u,t)-R(u,e):0:4&i?-1:1)}:function(t,e){if(t===e)return d=!0,0;var n,i=0,r=t.parentNode,s=e.parentNode,o=[t],a=[e];if(!r||!s)return t==_?-1:e==_?1:r?-1:s?1:u?R(u,t)-R(u,e):0;if(r===s)return ht(t,e);for(n=t;n=n.parentNode;)o.unshift(n);for(n=e;n=n.parentNode;)a.unshift(n);for(;o[i]===a[i];)i++;return i?ht(o[i],a[i]):o[i]==w?-1:a[i]==w?1:0},_):_},at.matches=function(t,e){return at(t,null,null,e)},at.matchesSelector=function(t,e){if(h(t),n.matchesSelector&&p&&!j[e+" "]&&(!m||!m.test(e))&&(!g||!g.test(e)))try{var i=v.call(t,e);if(i||n.disconnectedMatch||t.document&&11!==t.document.nodeType)return i}catch(t){j(e,!0)}return at(e,_,null,[t]).length>0},at.contains=function(t,e){return(t.ownerDocument||t)!=_&&h(t),y(t,e)},at.attr=function(t,e){(t.ownerDocument||t)!=_&&h(t);var r=i.attrHandle[e.toLowerCase()],s=r&&A.call(i.attrHandle,e.toLowerCase())?r(t,e,!p):void 0;return void 0!==s?s:n.attributes||!p?t.getAttribute(e):(s=t.getAttributeNode(e))&&s.specified?s.value:null},at.escape=function(t){return(t+"").replace(it,rt)},at.error=function(t){throw new Error("Syntax error, unrecognized expression: "+t)},at.uniqueSort=function(t){var e,i=[],r=0,s=0;if(d=!n.detectDuplicates,u=!n.sortStable&&t.slice(0),t.sort(S),d){for(;e=t[s++];)e===t[s]&&(r=i.push(s));for(;r--;)t.splice(i[r],1)}return u=null,t},r=at.getText=function(t){var e,n="",i=0,s=t.nodeType;if(s){if(1===s||9===s||11===s){if("string"==typeof t.textContent)return t.textContent;for(t=t.firstChild;t;t=t.nextSibling)n+=r(t)}else if(3===s||4===s)return t.nodeValue}else for(;e=t[i++];)n+=r(e);return n},(i=at.selectors={cacheLength:50,createPseudo:ct,match:X,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(t){return t[1]=t[1].replace(et,nt),t[3]=(t[3]||t[4]||t[5]||"").replace(et,nt),"~="===t[2]&&(t[3]=" "+t[3]+" "),t.slice(0,4)},CHILD:function(t){return t[1]=t[1].toLowerCase(),"nth"===t[1].slice(0,3)?(t[3]||at.error(t[0]),t[4]=+(t[4]?t[5]+(t[6]||1):2*("even"===t[3]||"odd"===t[3])),t[5]=+(t[7]+t[8]||"odd"===t[3])):t[3]&&at.error(t[0]),t},PSEUDO:function(t){var e,n=!t[6]&&t[2];return X.CHILD.test(t[0])?null:(t[3]?t[2]=t[4]||t[5]||"":n&&V.test(n)&&(e=o(n,!0))&&(e=n.indexOf(")",n.length-e)-n.length)&&(t[0]=t[0].slice(0,e),t[2]=n.slice(0,e)),t.slice(0,3))}},filter:{TAG:function(t){var e=t.replace(et,nt).toLowerCase();return"*"===t?function(){return!0}:function(t){return t.nodeName&&t.nodeName.toLowerCase()===e}},CLASS:function(t){var e=E[t+" "];return e||(e=new RegExp("(^|"+M+")"+t+"("+M+"|$)"))&&E(t,(function(t){return e.test("string"==typeof t.className&&t.className||void 0!==t.getAttribute&&t.getAttribute("class")||"")}))},ATTR:function(t,e,n){return function(i){var r=at.attr(i,t);return null==r?"!="===e:!e||(r+="","="===e?r===n:"!="===e?r!==n:"^="===e?n&&0===r.indexOf(n):"*="===e?n&&r.indexOf(n)>-1:"$="===e?n&&r.slice(-n.length)===n:"~="===e?(" "+r.replace(H," ")+" ").indexOf(n)>-1:"|="===e&&(r===n||r.slice(0,n.length+1)===n+"-"))}},CHILD:function(t,e,n,i,r){var s="nth"!==t.slice(0,3),o="last"!==t.slice(-4),a="of-type"===e;return 1===i&&0===r?function(t){return!!t.parentNode}:function(e,n,l){var c,u,d,h,_,f,p=s!==o?"nextSibling":"previousSibling",g=e.parentNode,m=a&&e.nodeName.toLowerCase(),v=!l&&!a,y=!1;if(g){if(s){for(;p;){for(h=e;h=h[p];)if(a?h.nodeName.toLowerCase()===m:1===h.nodeType)return!1;f=p="only"===t&&!f&&"nextSibling"}return!0}if(f=[o?g.firstChild:g.lastChild],o&&v){for(y=(_=(c=(u=(d=(h=g)[b]||(h[b]={}))[h.uniqueID]||(d[h.uniqueID]={}))[t]||[])[0]===x&&c[1])&&c[2],h=_&&g.childNodes[_];h=++_&&h&&h[p]||(y=_=0)||f.pop();)if(1===h.nodeType&&++y&&h===e){u[t]=[x,_,y];break}}else if(v&&(y=_=(c=(u=(d=(h=e)[b]||(h[b]={}))[h.uniqueID]||(d[h.uniqueID]={}))[t]||[])[0]===x&&c[1]),!1===y)for(;(h=++_&&h&&h[p]||(y=_=0)||f.pop())&&((a?h.nodeName.toLowerCase()!==m:1!==h.nodeType)||!++y||(v&&((u=(d=h[b]||(h[b]={}))[h.uniqueID]||(d[h.uniqueID]={}))[t]=[x,y]),h!==e)););return(y-=r)===i||y%i==0&&y/i>=0}}},PSEUDO:function(t,e){var n,r=i.pseudos[t]||i.setFilters[t.toLowerCase()]||at.error("unsupported pseudo: "+t);return r[b]?r(e):r.length>1?(n=[t,t,"",e],i.setFilters.hasOwnProperty(t.toLowerCase())?ct((function(t,n){for(var i,s=r(t,e),o=s.length;o--;)t[i=R(t,s[o])]=!(n[i]=s[o])})):function(t){return r(t,0,n)}):r}},pseudos:{not:ct((function(t){var e=[],n=[],i=a(t.replace(B,"$1"));return i[b]?ct((function(t,e,n,r){for(var s,o=i(t,null,r,[]),a=t.length;a--;)(s=o[a])&&(t[a]=!(e[a]=s))})):function(t,r,s){return e[0]=t,i(e,null,s,n),e[0]=null,!n.pop()}})),has:ct((function(t){return function(e){return at(t,e).length>0}})),contains:ct((function(t){return t=t.replace(et,nt),function(e){return(e.textContent||r(e)).indexOf(t)>-1}})),lang:ct((function(t){return J.test(t||"")||at.error("unsupported lang: "+t),t=t.replace(et,nt).toLowerCase(),function(e){var n;do{if(n=p?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return(n=n.toLowerCase())===t||0===n.indexOf(t+"-")}while((e=e.parentNode)&&1===e.nodeType);return!1}})),target:function(e){var n=t.location&&t.location.hash;return n&&n.slice(1)===e.id},root:function(t){return t===f},focus:function(t){return t===_.activeElement&&(!_.hasFocus||_.hasFocus())&&!!(t.type||t.href||~t.tabIndex)},enabled:pt(!1),disabled:pt(!0),checked:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&!!t.checked||"option"===e&&!!t.selected},selected:function(t){return t.parentNode&&t.parentNode.selectedIndex,!0===t.selected},empty:function(t){for(t=t.firstChild;t;t=t.nextSibling)if(t.nodeType<6)return!1;return!0},parent:function(t){return!i.pseudos.empty(t)},header:function(t){return Y.test(t.nodeName)},input:function(t){return G.test(t.nodeName)},button:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&"button"===t.type||"button"===e},text:function(t){var e;return"input"===t.nodeName.toLowerCase()&&"text"===t.type&&(null==(e=t.getAttribute("type"))||"text"===e.toLowerCase())},first:gt((function(){return[0]})),last:gt((function(t,e){return[e-1]})),eq:gt((function(t,e,n){return[n<0?n+e:n]})),even:gt((function(t,e){for(var n=0;n<e;n+=2)t.push(n);return t})),odd:gt((function(t,e){for(var n=1;n<e;n+=2)t.push(n);return t})),lt:gt((function(t,e,n){for(var i=n<0?n+e:n>e?e:n;--i>=0;)t.push(i);return t})),gt:gt((function(t,e,n){for(var i=n<0?n+e:n;++i<e;)t.push(i);return t}))}}).pseudos.nth=i.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})i.pseudos[e]=_t(e);for(e in{submit:!0,reset:!0})i.pseudos[e]=ft(e);function vt(){}function yt(t){for(var e=0,n=t.length,i="";e<n;e++)i+=t[e].value;return i}function bt(t,e,n){var i=e.dir,r=e.next,s=r||i,o=n&&"parentNode"===s,a=k++;return e.first?function(e,n,r){for(;e=e[i];)if(1===e.nodeType||o)return t(e,n,r);return!1}:function(e,n,l){var c,u,d,h=[x,a];if(l){for(;e=e[i];)if((1===e.nodeType||o)&&t(e,n,l))return!0}else for(;e=e[i];)if(1===e.nodeType||o)if(u=(d=e[b]||(e[b]={}))[e.uniqueID]||(d[e.uniqueID]={}),r&&r===e.nodeName.toLowerCase())e=e[i]||e;else{if((c=u[s])&&c[0]===x&&c[1]===a)return h[2]=c[2];if(u[s]=h,h[2]=t(e,n,l))return!0}return!1}}function wt(t){return t.length>1?function(e,n,i){for(var r=t.length;r--;)if(!t[r](e,n,i))return!1;return!0}:t[0]}function xt(t,e,n,i,r){for(var s,o=[],a=0,l=t.length,c=null!=e;a<l;a++)(s=t[a])&&(n&&!n(s,i,r)||(o.push(s),c&&e.push(a)));return o}function kt(t,e,n,i,r,s){return i&&!i[b]&&(i=kt(i)),r&&!r[b]&&(r=kt(r,s)),ct((function(s,o,a,l){var c,u,d,h=[],_=[],f=o.length,p=s||function(t,e,n){for(var i=0,r=e.length;i<r;i++)at(t,e[i],n);return n}(e||"*",a.nodeType?[a]:a,[]),g=!t||!s&&e?p:xt(p,h,t,a,l),m=n?r||(s?t:f||i)?[]:o:g;if(n&&n(g,m,a,l),i)for(c=xt(m,_),i(c,[],a,l),u=c.length;u--;)(d=c[u])&&(m[_[u]]=!(g[_[u]]=d));if(s){if(r||t){if(r){for(c=[],u=m.length;u--;)(d=m[u])&&c.push(g[u]=d);r(null,m=[],c,l)}for(u=m.length;u--;)(d=m[u])&&(c=r?R(s,d):h[u])>-1&&(s[c]=!(o[c]=d))}}else m=xt(m===o?m.splice(f,m.length):m),r?r(null,o,m,l):I.apply(o,m)}))}function Et(t){for(var e,n,r,s=t.length,o=i.relative[t[0].type],a=o||i.relative[" "],l=o?1:0,u=bt((function(t){return t===e}),a,!0),d=bt((function(t){return R(e,t)>-1}),a,!0),h=[function(t,n,i){var r=!o&&(i||n!==c)||((e=n).nodeType?u(t,n,i):d(t,n,i));return e=null,r}];l<s;l++)if(n=i.relative[t[l].type])h=[bt(wt(h),n)];else{if((n=i.filter[t[l].type].apply(null,t[l].matches))[b]){for(r=++l;r<s&&!i.relative[t[r].type];r++);return kt(l>1&&wt(h),l>1&&yt(t.slice(0,l-1).concat({value:" "===t[l-2].type?"*":""})).replace(B,"$1"),n,l<r&&Et(t.slice(l,r)),r<s&&Et(t=t.slice(r)),r<s&&yt(t))}h.push(n)}return wt(h)}return vt.prototype=i.filters=i.pseudos,i.setFilters=new vt,o=at.tokenize=function(t,e){var n,r,s,o,a,l,c,u=T[t+" "];if(u)return e?0:u.slice(0);for(a=t,l=[],c=i.preFilter;a;){for(o in n&&!(r=F.exec(a))||(r&&(a=a.slice(r[0].length)||a),l.push(s=[])),n=!1,(r=W.exec(a))&&(n=r.shift(),s.push({value:n,type:r[0].replace(B," ")}),a=a.slice(n.length)),i.filter)!(r=X[o].exec(a))||c[o]&&!(r=c[o](r))||(n=r.shift(),s.push({value:n,type:o,matches:r}),a=a.slice(n.length));if(!n)break}return e?a.length:a?at.error(t):T(t,l).slice(0)},a=at.compile=function(t,e){var n,r=[],s=[],a=C[t+" "];if(!a){for(e||(e=o(t)),n=e.length;n--;)(a=Et(e[n]))[b]?r.push(a):s.push(a);(a=C(t,function(t,e){var n=e.length>0,r=t.length>0,s=function(s,o,a,l,u){var d,f,g,m=0,v="0",y=s&&[],b=[],w=c,k=s||r&&i.find.TAG("*",u),E=x+=null==w?1:Math.random()||.1,T=k.length;for(u&&(c=o==_||o||u);v!==T&&null!=(d=k[v]);v++){if(r&&d){for(f=0,o||d.ownerDocument==_||(h(d),a=!p);g=t[f++];)if(g(d,o||_,a)){l.push(d);break}u&&(x=E)}n&&((d=!g&&d)&&m--,s&&y.push(d))}if(m+=v,n&&v!==m){for(f=0;g=e[f++];)g(y,b,o,a);if(s){if(m>0)for(;v--;)y[v]||b[v]||(b[v]=D.call(l));b=xt(b)}I.apply(l,b),u&&!s&&b.length>0&&m+e.length>1&&at.uniqueSort(l)}return u&&(x=E,c=w),y};return n?ct(s):s}(s,r))).selector=t}return a},l=at.select=function(t,e,n,r){var s,l,c,u,d,h="function"==typeof t&&t,_=!r&&o(t=h.selector||t);if(n=n||[],1===_.length){if((l=_[0]=_[0].slice(0)).length>2&&"ID"===(c=l[0]).type&&9===e.nodeType&&p&&i.relative[l[1].type]){if(!(e=(i.find.ID(c.matches[0].replace(et,nt),e)||[])[0]))return n;h&&(e=e.parentNode),t=t.slice(l.shift().value.length)}for(s=X.needsContext.test(t)?0:l.length;s--&&(c=l[s],!i.relative[u=c.type]);)if((d=i.find[u])&&(r=d(c.matches[0].replace(et,nt),tt.test(l[0].type)&&mt(e.parentNode)||e))){if(l.splice(s,1),!(t=r.length&&yt(l)))return I.apply(n,r),n;break}}return(h||a(t,_))(r,e,!p,n,!e||tt.test(t)&&mt(e.parentNode)||e),n},n.sortStable=b.split("").sort(S).join("")===b,n.detectDuplicates=!!d,h(),n.sortDetached=ut((function(t){return 1&t.compareDocumentPosition(_.createElement("fieldset"))})),ut((function(t){return t.innerHTML="<a href='#'></a>","#"===t.firstChild.getAttribute("href")}))||dt("type|href|height|width",(function(t,e,n){if(!n)return t.getAttribute(e,"type"===e.toLowerCase()?1:2)})),n.attributes&&ut((function(t){return t.innerHTML="<input/>",t.firstChild.setAttribute("value",""),""===t.firstChild.getAttribute("value")}))||dt("value",(function(t,e,n){if(!n&&"input"===t.nodeName.toLowerCase())return t.defaultValue})),ut((function(t){return null==t.getAttribute("disabled")}))||dt(L,(function(t,e,n){var i;if(!n)return!0===t[e]?e.toLowerCase():(i=t.getAttributeNode(e))&&i.specified?i.value:null})),at}(n);k.find=T,k.expr=T.selectors,k.expr[":"]=k.expr.pseudos,k.uniqueSort=k.unique=T.uniqueSort,k.text=T.getText,k.isXMLDoc=T.isXML,k.contains=T.contains,k.escapeSelector=T.escape;var C=function(t,e,n){for(var i=[],r=void 0!==n;(t=t[e])&&9!==t.nodeType;)if(1===t.nodeType){if(r&&k(t).is(n))break;i.push(t)}return i},j=function(t,e){for(var n=[];t;t=t.nextSibling)1===t.nodeType&&t!==e&&n.push(t);return n},S=k.expr.match.needsContext;function A(t,e){return t.nodeName&&t.nodeName.toLowerCase()===e.toLowerCase()}var N=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function D(t,e,n){return m(e)?k.grep(t,(function(t,i){return!!e.call(t,i,t)!==n})):e.nodeType?k.grep(t,(function(t){return t===e!==n})):"string"!=typeof e?k.grep(t,(function(t){return u.call(e,t)>-1!==n})):k.filter(e,t,n)}k.filter=function(t,e,n){var i=e[0];return n&&(t=":not("+t+")"),1===e.length&&1===i.nodeType?k.find.matchesSelector(i,t)?[i]:[]:k.find.matches(t,k.grep(e,(function(t){return 1===t.nodeType})))},k.fn.extend({find:function(t){var e,n,i=this.length,r=this;if("string"!=typeof t)return this.pushStack(k(t).filter((function(){for(e=0;e<i;e++)if(k.contains(r[e],this))return!0})));for(n=this.pushStack([]),e=0;e<i;e++)k.find(t,r[e],n);return i>1?k.uniqueSort(n):n},filter:function(t){return this.pushStack(D(this,t||[],!1))},not:function(t){return this.pushStack(D(this,t||[],!0))},is:function(t){return!!D(this,"string"==typeof t&&S.test(t)?k(t):t||[],!1).length}});var O,I=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(k.fn.init=function(t,e,n){var i,r;if(!t)return this;if(n=n||O,"string"==typeof t){if(!(i="<"===t[0]&&">"===t[t.length-1]&&t.length>=3?[null,t,null]:I.exec(t))||!i[1]&&e)return!e||e.jquery?(e||n).find(t):this.constructor(e).find(t);if(i[1]){if(e=e instanceof k?e[0]:e,k.merge(this,k.parseHTML(i[1],e&&e.nodeType?e.ownerDocument||e:y,!0)),N.test(i[1])&&k.isPlainObject(e))for(i in e)m(this[i])?this[i](e[i]):this.attr(i,e[i]);return this}return(r=y.getElementById(i[2]))&&(this[0]=r,this.length=1),this}return t.nodeType?(this[0]=t,this.length=1,this):m(t)?void 0!==n.ready?n.ready(t):t(k):k.makeArray(t,this)}).prototype=k.fn,O=k(y);var $=/^(?:parents|prev(?:Until|All))/,R={children:!0,contents:!0,next:!0,prev:!0};function L(t,e){for(;(t=t[e])&&1!==t.nodeType;);return t}k.fn.extend({has:function(t){var e=k(t,this),n=e.length;return this.filter((function(){for(var t=0;t<n;t++)if(k.contains(this,e[t]))return!0}))},closest:function(t,e){var n,i=0,r=this.length,s=[],o="string"!=typeof t&&k(t);if(!S.test(t))for(;i<r;i++)for(n=this[i];n&&n!==e;n=n.parentNode)if(n.nodeType<11&&(o?o.index(n)>-1:1===n.nodeType&&k.find.matchesSelector(n,t))){s.push(n);break}return this.pushStack(s.length>1?k.uniqueSort(s):s)},index:function(t){return t?"string"==typeof t?u.call(k(t),this[0]):u.call(this,t.jquery?t[0]:t):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(t,e){return this.pushStack(k.uniqueSort(k.merge(this.get(),k(t,e))))},addBack:function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}}),k.each({parent:function(t){var e=t.parentNode;return e&&11!==e.nodeType?e:null},parents:function(t){return C(t,"parentNode")},parentsUntil:function(t,e,n){return C(t,"parentNode",n)},next:function(t){return L(t,"nextSibling")},prev:function(t){return L(t,"previousSibling")},nextAll:function(t){return C(t,"nextSibling")},prevAll:function(t){return C(t,"previousSibling")},nextUntil:function(t,e,n){return C(t,"nextSibling",n)},prevUntil:function(t,e,n){return C(t,"previousSibling",n)},siblings:function(t){return j((t.parentNode||{}).firstChild,t)},children:function(t){return j(t.firstChild)},contents:function(t){return null!=t.contentDocument&&o(t.contentDocument)?t.contentDocument:(A(t,"template")&&(t=t.content||t),k.merge([],t.childNodes))}},(function(t,e){k.fn[t]=function(n,i){var r=k.map(this,e,n);return"Until"!==t.slice(-5)&&(i=n),i&&"string"==typeof i&&(r=k.filter(i,r)),this.length>1&&(R[t]||k.uniqueSort(r),$.test(t)&&r.reverse()),this.pushStack(r)}}));var M=/[^\x20\t\r\n\f]+/g;function P(t){return t}function q(t){throw t}function z(t,e,n,i){var r;try{t&&m(r=t.promise)?r.call(t).done(e).fail(n):t&&m(r=t.then)?r.call(t,e,n):e.apply(void 0,[t].slice(i))}catch(t){n.apply(void 0,[t])}}k.Callbacks=function(t){t="string"==typeof t?function(t){var e={};return k.each(t.match(M)||[],(function(t,n){e[n]=!0})),e}(t):k.extend({},t);var e,n,i,r,s=[],o=[],a=-1,l=function(){for(r=r||t.once,i=e=!0;o.length;a=-1)for(n=o.shift();++a<s.length;)!1===s[a].apply(n[0],n[1])&&t.stopOnFalse&&(a=s.length,n=!1);t.memory||(n=!1),e=!1,r&&(s=n?[]:"")},c={add:function(){return s&&(n&&!e&&(a=s.length-1,o.push(n)),function e(n){k.each(n,(function(n,i){m(i)?t.unique&&c.has(i)||s.push(i):i&&i.length&&"string"!==x(i)&&e(i)}))}(arguments),n&&!e&&l()),this},remove:function(){return k.each(arguments,(function(t,e){for(var n;(n=k.inArray(e,s,n))>-1;)s.splice(n,1),n<=a&&a--})),this},has:function(t){return t?k.inArray(t,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||e||(s=n=""),this},locked:function(){return!!r},fireWith:function(t,n){return r||(n=[t,(n=n||[]).slice?n.slice():n],o.push(n),e||l()),this},fire:function(){return c.fireWith(this,arguments),this},fired:function(){return!!i}};return c},k.extend({Deferred:function(t){var e=[["notify","progress",k.Callbacks("memory"),k.Callbacks("memory"),2],["resolve","done",k.Callbacks("once memory"),k.Callbacks("once memory"),0,"resolved"],["reject","fail",k.Callbacks("once memory"),k.Callbacks("once memory"),1,"rejected"]],i="pending",r={state:function(){return i},always:function(){return s.done(arguments).fail(arguments),this},catch:function(t){return r.then(null,t)},pipe:function(){var t=arguments;return k.Deferred((function(n){k.each(e,(function(e,i){var r=m(t[i[4]])&&t[i[4]];s[i[1]]((function(){var t=r&&r.apply(this,arguments);t&&m(t.promise)?t.promise().progress(n.notify).done(n.resolve).fail(n.reject):n[i[0]+"With"](this,r?[t]:arguments)}))})),t=null})).promise()},then:function(t,i,r){var s=0;function o(t,e,i,r){return function(){var a=this,l=arguments,c=function(){var n,c;if(!(t<s)){if((n=i.apply(a,l))===e.promise())throw new TypeError("Thenable self-resolution");c=n&&("object"==typeof n||"function"==typeof n)&&n.then,m(c)?r?c.call(n,o(s,e,P,r),o(s,e,q,r)):(s++,c.call(n,o(s,e,P,r),o(s,e,q,r),o(s,e,P,e.notifyWith))):(i!==P&&(a=void 0,l=[n]),(r||e.resolveWith)(a,l))}},u=r?c:function(){try{c()}catch(n){k.Deferred.exceptionHook&&k.Deferred.exceptionHook(n,u.stackTrace),t+1>=s&&(i!==q&&(a=void 0,l=[n]),e.rejectWith(a,l))}};t?u():(k.Deferred.getStackHook&&(u.stackTrace=k.Deferred.getStackHook()),n.setTimeout(u))}}return k.Deferred((function(n){e[0][3].add(o(0,n,m(r)?r:P,n.notifyWith)),e[1][3].add(o(0,n,m(t)?t:P)),e[2][3].add(o(0,n,m(i)?i:q))})).promise()},promise:function(t){return null!=t?k.extend(t,r):r}},s={};return k.each(e,(function(t,n){var o=n[2],a=n[5];r[n[1]]=o.add,a&&o.add((function(){i=a}),e[3-t][2].disable,e[3-t][3].disable,e[0][2].lock,e[0][3].lock),o.add(n[3].fire),s[n[0]]=function(){return s[n[0]+"With"](this===s?void 0:this,arguments),this},s[n[0]+"With"]=o.fireWith})),r.promise(s),t&&t.call(s,s),s},when:function(t){var e=arguments.length,n=e,i=Array(n),r=a.call(arguments),s=k.Deferred(),o=function(t){return function(n){i[t]=this,r[t]=arguments.length>1?a.call(arguments):n,--e||s.resolveWith(i,r)}};if(e<=1&&(z(t,s.done(o(n)).resolve,s.reject,!e),"pending"===s.state()||m(r[n]&&r[n].then)))return s.then();for(;n--;)z(r[n],o(n),s.reject);return s.promise()}});var H=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;k.Deferred.exceptionHook=function(t,e){n.console&&n.console.warn&&t&&H.test(t.name)&&n.console.warn("jQuery.Deferred exception: "+t.message,t.stack,e)},k.readyException=function(t){n.setTimeout((function(){throw t}))};var B=k.Deferred();function F(){y.removeEventListener("DOMContentLoaded",F),n.removeEventListener("load",F),k.ready()}k.fn.ready=function(t){return B.then(t).catch((function(t){k.readyException(t)})),this},k.extend({isReady:!1,readyWait:1,ready:function(t){(!0===t?--k.readyWait:k.isReady)||(k.isReady=!0,!0!==t&&--k.readyWait>0||B.resolveWith(y,[k]))}}),k.ready.then=B.then,"complete"===y.readyState||"loading"!==y.readyState&&!y.documentElement.doScroll?n.setTimeout(k.ready):(y.addEventListener("DOMContentLoaded",F),n.addEventListener("load",F));var W=function(t,e,n,i,r,s,o){var a=0,l=t.length,c=null==n;if("object"===x(n))for(a in r=!0,n)W(t,e,a,n[a],!0,s,o);else if(void 0!==i&&(r=!0,m(i)||(o=!0),c&&(o?(e.call(t,i),e=null):(c=e,e=function(t,e,n){return c.call(k(t),n)})),e))for(;a<l;a++)e(t[a],n,o?i:i.call(t[a],a,e(t[a],n)));return r?t:c?e.call(t):l?e(t[0],n):s},U=/^-ms-/,V=/-([a-z])/g;function J(t,e){return e.toUpperCase()}function X(t){return t.replace(U,"ms-").replace(V,J)}var K=function(t){return 1===t.nodeType||9===t.nodeType||!+t.nodeType};function G(){this.expando=k.expando+G.uid++}G.uid=1,G.prototype={cache:function(t){var e=t[this.expando];return e||(e={},K(t)&&(t.nodeType?t[this.expando]=e:Object.defineProperty(t,this.expando,{value:e,configurable:!0}))),e},set:function(t,e,n){var i,r=this.cache(t);if("string"==typeof e)r[X(e)]=n;else for(i in e)r[X(i)]=e[i];return r},get:function(t,e){return void 0===e?this.cache(t):t[this.expando]&&t[this.expando][X(e)]},access:function(t,e,n){return void 0===e||e&&"string"==typeof e&&void 0===n?this.get(t,e):(this.set(t,e,n),void 0!==n?n:e)},remove:function(t,e){var n,i=t[this.expando];if(void 0!==i){if(void 0!==e){n=(e=Array.isArray(e)?e.map(X):(e=X(e))in i?[e]:e.match(M)||[]).length;for(;n--;)delete i[e[n]]}(void 0===e||k.isEmptyObject(i))&&(t.nodeType?t[this.expando]=void 0:delete t[this.expando])}},hasData:function(t){var e=t[this.expando];return void 0!==e&&!k.isEmptyObject(e)}};var Y=new G,Q=new G,Z=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,tt=/[A-Z]/g;function et(t,e,n){var i;if(void 0===n&&1===t.nodeType)if(i="data-"+e.replace(tt,"-$&").toLowerCase(),"string"==typeof(n=t.getAttribute(i))){try{n=function(t){return"true"===t||"false"!==t&&("null"===t?null:t===+t+""?+t:Z.test(t)?JSON.parse(t):t)}(n)}catch(t){}Q.set(t,e,n)}else n=void 0;return n}k.extend({hasData:function(t){return Q.hasData(t)||Y.hasData(t)},data:function(t,e,n){return Q.access(t,e,n)},removeData:function(t,e){Q.remove(t,e)},_data:function(t,e,n){return Y.access(t,e,n)},_removeData:function(t,e){Y.remove(t,e)}}),k.fn.extend({data:function(t,e){var n,i,r,s=this[0],o=s&&s.attributes;if(void 0===t){if(this.length&&(r=Q.get(s),1===s.nodeType&&!Y.get(s,"hasDataAttrs"))){for(n=o.length;n--;)o[n]&&0===(i=o[n].name).indexOf("data-")&&(i=X(i.slice(5)),et(s,i,r[i]));Y.set(s,"hasDataAttrs",!0)}return r}return"object"==typeof t?this.each((function(){Q.set(this,t)})):W(this,(function(e){var n;if(s&&void 0===e)return void 0!==(n=Q.get(s,t))||void 0!==(n=et(s,t))?n:void 0;this.each((function(){Q.set(this,t,e)}))}),null,e,arguments.length>1,null,!0)},removeData:function(t){return this.each((function(){Q.remove(this,t)}))}}),k.extend({queue:function(t,e,n){var i;if(t)return e=(e||"fx")+"queue",i=Y.get(t,e),n&&(!i||Array.isArray(n)?i=Y.access(t,e,k.makeArray(n)):i.push(n)),i||[]},dequeue:function(t,e){e=e||"fx";var n=k.queue(t,e),i=n.length,r=n.shift(),s=k._queueHooks(t,e);"inprogress"===r&&(r=n.shift(),i--),r&&("fx"===e&&n.unshift("inprogress"),delete s.stop,r.call(t,(function(){k.dequeue(t,e)}),s)),!i&&s&&s.empty.fire()},_queueHooks:function(t,e){var n=e+"queueHooks";return Y.get(t,n)||Y.access(t,n,{empty:k.Callbacks("once memory").add((function(){Y.remove(t,[e+"queue",n])}))})}}),k.fn.extend({queue:function(t,e){var n=2;return"string"!=typeof t&&(e=t,t="fx",n--),arguments.length<n?k.queue(this[0],t):void 0===e?this:this.each((function(){var n=k.queue(this,t,e);k._queueHooks(this,t),"fx"===t&&"inprogress"!==n[0]&&k.dequeue(this,t)}))},dequeue:function(t){return this.each((function(){k.dequeue(this,t)}))},clearQueue:function(t){return this.queue(t||"fx",[])},promise:function(t,e){var n,i=1,r=k.Deferred(),s=this,o=this.length,a=function(){--i||r.resolveWith(s,[s])};for("string"!=typeof t&&(e=t,t=void 0),t=t||"fx";o--;)(n=Y.get(s[o],t+"queueHooks"))&&n.empty&&(i++,n.empty.add(a));return a(),r.promise(e)}});var nt=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,it=new RegExp("^(?:([+-])=|)("+nt+")([a-z%]*)$","i"),rt=["Top","Right","Bottom","Left"],st=y.documentElement,ot=function(t){return k.contains(t.ownerDocument,t)},at={composed:!0};st.getRootNode&&(ot=function(t){return k.contains(t.ownerDocument,t)||t.getRootNode(at)===t.ownerDocument});var lt=function(t,e){return"none"===(t=e||t).style.display||""===t.style.display&&ot(t)&&"none"===k.css(t,"display")};function ct(t,e,n,i){var r,s,o=20,a=i?function(){return i.cur()}:function(){return k.css(t,e,"")},l=a(),c=n&&n[3]||(k.cssNumber[e]?"":"px"),u=t.nodeType&&(k.cssNumber[e]||"px"!==c&&+l)&&it.exec(k.css(t,e));if(u&&u[3]!==c){for(l/=2,c=c||u[3],u=+l||1;o--;)k.style(t,e,u+c),(1-s)*(1-(s=a()/l||.5))<=0&&(o=0),u/=s;u*=2,k.style(t,e,u+c),n=n||[]}return n&&(u=+u||+l||0,r=n[1]?u+(n[1]+1)*n[2]:+n[2],i&&(i.unit=c,i.start=u,i.end=r)),r}var ut={};function dt(t){var e,n=t.ownerDocument,i=t.nodeName,r=ut[i];return r||(e=n.body.appendChild(n.createElement(i)),r=k.css(e,"display"),e.parentNode.removeChild(e),"none"===r&&(r="block"),ut[i]=r,r)}function ht(t,e){for(var n,i,r=[],s=0,o=t.length;s<o;s++)(i=t[s]).style&&(n=i.style.display,e?("none"===n&&(r[s]=Y.get(i,"display")||null,r[s]||(i.style.display="")),""===i.style.display&&lt(i)&&(r[s]=dt(i))):"none"!==n&&(r[s]="none",Y.set(i,"display",n)));for(s=0;s<o;s++)null!=r[s]&&(t[s].style.display=r[s]);return t}k.fn.extend({show:function(){return ht(this,!0)},hide:function(){return ht(this)},toggle:function(t){return"boolean"==typeof t?t?this.show():this.hide():this.each((function(){lt(this)?k(this).show():k(this).hide()}))}});var _t,ft,pt=/^(?:checkbox|radio)$/i,gt=/<([a-z][^\/\0>\x20\t\r\n\f]*)/i,mt=/^$|^module$|\/(?:java|ecma)script/i;_t=y.createDocumentFragment().appendChild(y.createElement("div")),(ft=y.createElement("input")).setAttribute("type","radio"),ft.setAttribute("checked","checked"),ft.setAttribute("name","t"),_t.appendChild(ft),g.checkClone=_t.cloneNode(!0).cloneNode(!0).lastChild.checked,_t.innerHTML="<textarea>x</textarea>",g.noCloneChecked=!!_t.cloneNode(!0).lastChild.defaultValue,_t.innerHTML="<option></option>",g.option=!!_t.lastChild;var vt={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 yt(t,e){var n;return n=void 0!==t.getElementsByTagName?t.getElementsByTagName(e||"*"):void 0!==t.querySelectorAll?t.querySelectorAll(e||"*"):[],void 0===e||e&&A(t,e)?k.merge([t],n):n}function bt(t,e){for(var n=0,i=t.length;n<i;n++)Y.set(t[n],"globalEval",!e||Y.get(e[n],"globalEval"))}vt.tbody=vt.tfoot=vt.colgroup=vt.caption=vt.thead,vt.th=vt.td,g.option||(vt.optgroup=vt.option=[1,"<select multiple='multiple'>","</select>"]);var wt=/<|&#?\w+;/;function xt(t,e,n,i,r){for(var s,o,a,l,c,u,d=e.createDocumentFragment(),h=[],_=0,f=t.length;_<f;_++)if((s=t[_])||0===s)if("object"===x(s))k.merge(h,s.nodeType?[s]:s);else if(wt.test(s)){for(o=o||d.appendChild(e.createElement("div")),a=(gt.exec(s)||["",""])[1].toLowerCase(),l=vt[a]||vt._default,o.innerHTML=l[1]+k.htmlPrefilter(s)+l[2],u=l[0];u--;)o=o.lastChild;k.merge(h,o.childNodes),(o=d.firstChild).textContent=""}else h.push(e.createTextNode(s));for(d.textContent="",_=0;s=h[_++];)if(i&&k.inArray(s,i)>-1)r&&r.push(s);else if(c=ot(s),o=yt(d.appendChild(s),"script"),c&&bt(o),n)for(u=0;s=o[u++];)mt.test(s.type||"")&&n.push(s);return d}var kt=/^key/,Et=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Tt=/^([^.]*)(?:\.(.+)|)/;function Ct(){return!0}function jt(){return!1}function St(t,e){return t===function(){try{return y.activeElement}catch(t){}}()==("focus"===e)}function At(t,e,n,i,r,s){var o,a;if("object"==typeof e){for(a in"string"!=typeof n&&(i=i||n,n=void 0),e)At(t,a,n,i,e[a],s);return t}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=jt;else if(!r)return t;return 1===s&&(o=r,(r=function(t){return k().off(t),o.apply(this,arguments)}).guid=o.guid||(o.guid=k.guid++)),t.each((function(){k.event.add(this,e,r,i,n)}))}function Nt(t,e,n){n?(Y.set(t,e,!1),k.event.add(t,e,{namespace:!1,handler:function(t){var i,r,s=Y.get(this,e);if(1&t.isTrigger&&this[e]){if(s.length)(k.event.special[e]||{}).delegateType&&t.stopPropagation();else if(s=a.call(arguments),Y.set(this,e,s),i=n(this,e),this[e](),s!==(r=Y.get(this,e))||i?Y.set(this,e,!1):r={},s!==r)return t.stopImmediatePropagation(),t.preventDefault(),r.value}else s.length&&(Y.set(this,e,{value:k.event.trigger(k.extend(s[0],k.Event.prototype),s.slice(1),this)}),t.stopImmediatePropagation())}})):void 0===Y.get(t,e)&&k.event.add(t,e,Ct)}k.event={global:{},add:function(t,e,n,i,r){var s,o,a,l,c,u,d,h,_,f,p,g=Y.get(t);if(K(t))for(n.handler&&(n=(s=n).handler,r=s.selector),r&&k.find.matchesSelector(st,r),n.guid||(n.guid=k.guid++),(l=g.events)||(l=g.events=Object.create(null)),(o=g.handle)||(o=g.handle=function(e){return void 0!==k&&k.event.triggered!==e.type?k.event.dispatch.apply(t,arguments):void 0}),c=(e=(e||"").match(M)||[""]).length;c--;)_=p=(a=Tt.exec(e[c])||[])[1],f=(a[2]||"").split(".").sort(),_&&(d=k.event.special[_]||{},_=(r?d.delegateType:d.bindType)||_,d=k.event.special[_]||{},u=k.extend({type:_,origType:p,data:i,handler:n,guid:n.guid,selector:r,needsContext:r&&k.expr.match.needsContext.test(r),namespace:f.join(".")},s),(h=l[_])||((h=l[_]=[]).delegateCount=0,d.setup&&!1!==d.setup.call(t,i,f,o)||t.addEventListener&&t.addEventListener(_,o)),d.add&&(d.add.call(t,u),u.handler.guid||(u.handler.guid=n.guid)),r?h.splice(h.delegateCount++,0,u):h.push(u),k.event.global[_]=!0)},remove:function(t,e,n,i,r){var s,o,a,l,c,u,d,h,_,f,p,g=Y.hasData(t)&&Y.get(t);if(g&&(l=g.events)){for(c=(e=(e||"").match(M)||[""]).length;c--;)if(_=p=(a=Tt.exec(e[c])||[])[1],f=(a[2]||"").split(".").sort(),_){for(d=k.event.special[_]||{},h=l[_=(i?d.delegateType:d.bindType)||_]||[],a=a[2]&&new RegExp("(^|\\.)"+f.join("\\.(?:.*\\.|)")+"(\\.|$)"),o=s=h.length;s--;)u=h[s],!r&&p!==u.origType||n&&n.guid!==u.guid||a&&!a.test(u.namespace)||i&&i!==u.selector&&("**"!==i||!u.selector)||(h.splice(s,1),u.selector&&h.delegateCount--,d.remove&&d.remove.call(t,u));o&&!h.length&&(d.teardown&&!1!==d.teardown.call(t,f,g.handle)||k.removeEvent(t,_,g.handle),delete l[_])}else for(_ in l)k.event.remove(t,_+e[c],n,i,!0);k.isEmptyObject(l)&&Y.remove(t,"handle events")}},dispatch:function(t){var e,n,i,r,s,o,a=new Array(arguments.length),l=k.event.fix(t),c=(Y.get(this,"events")||Object.create(null))[l.type]||[],u=k.event.special[l.type]||{};for(a[0]=l,e=1;e<arguments.length;e++)a[e]=arguments[e];if(l.delegateTarget=this,!u.preDispatch||!1!==u.preDispatch.call(this,l)){for(o=k.event.handlers.call(this,l,c),e=0;(r=o[e++])&&!l.isPropagationStopped();)for(l.currentTarget=r.elem,n=0;(s=r.handlers[n++])&&!l.isImmediatePropagationStopped();)l.rnamespace&&!1!==s.namespace&&!l.rnamespace.test(s.namespace)||(l.handleObj=s,l.data=s.data,void 0!==(i=((k.event.special[s.origType]||{}).handle||s.handler).apply(r.elem,a))&&!1===(l.result=i)&&(l.preventDefault(),l.stopPropagation()));return u.postDispatch&&u.postDispatch.call(this,l),l.result}},handlers:function(t,e){var n,i,r,s,o,a=[],l=e.delegateCount,c=t.target;if(l&&c.nodeType&&!("click"===t.type&&t.button>=1))for(;c!==this;c=c.parentNode||this)if(1===c.nodeType&&("click"!==t.type||!0!==c.disabled)){for(s=[],o={},n=0;n<l;n++)void 0===o[r=(i=e[n]).selector+" "]&&(o[r]=i.needsContext?k(r,this).index(c)>-1:k.find(r,this,null,[c]).length),o[r]&&s.push(i);s.length&&a.push({elem:c,handlers:s})}return c=this,l<e.length&&a.push({elem:c,handlers:e.slice(l)}),a},addProp:function(t,e){Object.defineProperty(k.Event.prototype,t,{enumerable:!0,configurable:!0,get:m(e)?function(){if(this.originalEvent)return e(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[t]},set:function(e){Object.defineProperty(this,t,{enumerable:!0,configurable:!0,writable:!0,value:e})}})},fix:function(t){return t[k.expando]?t:new k.Event(t)},special:{load:{noBubble:!0},click:{setup:function(t){var e=this||t;return pt.test(e.type)&&e.click&&A(e,"input")&&Nt(e,"click",Ct),!1},trigger:function(t){var e=this||t;return pt.test(e.type)&&e.click&&A(e,"input")&&Nt(e,"click"),!0},_default:function(t){var e=t.target;return pt.test(e.type)&&e.click&&A(e,"input")&&Y.get(e,"click")||A(e,"a")}},beforeunload:{postDispatch:function(t){void 0!==t.result&&t.originalEvent&&(t.originalEvent.returnValue=t.result)}}}},k.removeEvent=function(t,e,n){t.removeEventListener&&t.removeEventListener(e,n)},k.Event=function(t,e){if(!(this instanceof k.Event))return new k.Event(t,e);t&&t.type?(this.originalEvent=t,this.type=t.type,this.isDefaultPrevented=t.defaultPrevented||void 0===t.defaultPrevented&&!1===t.returnValue?Ct:jt,this.target=t.target&&3===t.target.nodeType?t.target.parentNode:t.target,this.currentTarget=t.currentTarget,this.relatedTarget=t.relatedTarget):this.type=t,e&&k.extend(this,e),this.timeStamp=t&&t.timeStamp||Date.now(),this[k.expando]=!0},k.Event.prototype={constructor:k.Event,isDefaultPrevented:jt,isPropagationStopped:jt,isImmediatePropagationStopped:jt,isSimulated:!1,preventDefault:function(){var t=this.originalEvent;this.isDefaultPrevented=Ct,t&&!this.isSimulated&&t.preventDefault()},stopPropagation:function(){var t=this.originalEvent;this.isPropagationStopped=Ct,t&&!this.isSimulated&&t.stopPropagation()},stopImmediatePropagation:function(){var t=this.originalEvent;this.isImmediatePropagationStopped=Ct,t&&!this.isSimulated&&t.stopImmediatePropagation(),this.stopPropagation()}},k.each({altKey:!0,bubbles:!0,cancelable:!0,changedTouches:!0,ctrlKey:!0,detail:!0,eventPhase:!0,metaKey:!0,pageX:!0,pageY:!0,shiftKey:!0,view:!0,char:!0,code:!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,toElement:!0,touches:!0,which:function(t){var e=t.button;return null==t.which&&kt.test(t.type)?null!=t.charCode?t.charCode:t.keyCode:!t.which&&void 0!==e&&Et.test(t.type)?1&e?1:2&e?3:4&e?2:0:t.which}},k.event.addProp),k.each({focus:"focusin",blur:"focusout"},(function(t,e){k.event.special[t]={setup:function(){return Nt(this,t,St),!1},trigger:function(){return Nt(this,t),!0},delegateType:e}})),k.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},(function(t,e){k.event.special[t]={delegateType:e,bindType:e,handle:function(t){var n,i=this,r=t.relatedTarget,s=t.handleObj;return r&&(r===i||k.contains(i,r))||(t.type=s.origType,n=s.handler.apply(this,arguments),t.type=e),n}}})),k.fn.extend({on:function(t,e,n,i){return At(this,t,e,n,i)},one:function(t,e,n,i){return At(this,t,e,n,i,1)},off:function(t,e,n){var i,r;if(t&&t.preventDefault&&t.handleObj)return i=t.handleObj,k(t.delegateTarget).off(i.namespace?i.origType+"."+i.namespace:i.origType,i.selector,i.handler),this;if("object"==typeof t){for(r in t)this.off(r,e,t[r]);return this}return!1!==e&&"function"!=typeof e||(n=e,e=void 0),!1===n&&(n=jt),this.each((function(){k.event.remove(this,t,n,e)}))}});var Dt=/<script|<style|<link/i,Ot=/checked\s*(?:[^=]|=\s*.checked.)/i,It=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;function $t(t,e){return A(t,"table")&&A(11!==e.nodeType?e:e.firstChild,"tr")&&k(t).children("tbody")[0]||t}function Rt(t){return t.type=(null!==t.getAttribute("type"))+"/"+t.type,t}function Lt(t){return"true/"===(t.type||"").slice(0,5)?t.type=t.type.slice(5):t.removeAttribute("type"),t}function Mt(t,e){var n,i,r,s,o,a;if(1===e.nodeType){if(Y.hasData(t)&&(a=Y.get(t).events))for(r in Y.remove(e,"handle events"),a)for(n=0,i=a[r].length;n<i;n++)k.event.add(e,r,a[r][n]);Q.hasData(t)&&(s=Q.access(t),o=k.extend({},s),Q.set(e,o))}}function Pt(t,e){var n=e.nodeName.toLowerCase();"input"===n&&pt.test(t.type)?e.checked=t.checked:"input"!==n&&"textarea"!==n||(e.defaultValue=t.defaultValue)}function qt(t,e,n,i){e=l(e);var r,s,o,a,c,u,d=0,h=t.length,_=h-1,f=e[0],p=m(f);if(p||h>1&&"string"==typeof f&&!g.checkClone&&Ot.test(f))return t.each((function(r){var s=t.eq(r);p&&(e[0]=f.call(this,r,s.html())),qt(s,e,n,i)}));if(h&&(s=(r=xt(e,t[0].ownerDocument,!1,t,i)).firstChild,1===r.childNodes.length&&(r=s),s||i)){for(a=(o=k.map(yt(r,"script"),Rt)).length;d<h;d++)c=r,d!==_&&(c=k.clone(c,!0,!0),a&&k.merge(o,yt(c,"script"))),n.call(t[d],c,d);if(a)for(u=o[o.length-1].ownerDocument,k.map(o,Lt),d=0;d<a;d++)c=o[d],mt.test(c.type||"")&&!Y.access(c,"globalEval")&&k.contains(u,c)&&(c.src&&"module"!==(c.type||"").toLowerCase()?k._evalUrl&&!c.noModule&&k._evalUrl(c.src,{nonce:c.nonce||c.getAttribute("nonce")},u):w(c.textContent.replace(It,""),c,u))}return t}function zt(t,e,n){for(var i,r=e?k.filter(e,t):t,s=0;null!=(i=r[s]);s++)n||1!==i.nodeType||k.cleanData(yt(i)),i.parentNode&&(n&&ot(i)&&bt(yt(i,"script")),i.parentNode.removeChild(i));return t}k.extend({htmlPrefilter:function(t){return t},clone:function(t,e,n){var i,r,s,o,a=t.cloneNode(!0),l=ot(t);if(!(g.noCloneChecked||1!==t.nodeType&&11!==t.nodeType||k.isXMLDoc(t)))for(o=yt(a),i=0,r=(s=yt(t)).length;i<r;i++)Pt(s[i],o[i]);if(e)if(n)for(s=s||yt(t),o=o||yt(a),i=0,r=s.length;i<r;i++)Mt(s[i],o[i]);else Mt(t,a);return(o=yt(a,"script")).length>0&&bt(o,!l&&yt(t,"script")),a},cleanData:function(t){for(var e,n,i,r=k.event.special,s=0;void 0!==(n=t[s]);s++)if(K(n)){if(e=n[Y.expando]){if(e.events)for(i in e.events)r[i]?k.event.remove(n,i):k.removeEvent(n,i,e.handle);n[Y.expando]=void 0}n[Q.expando]&&(n[Q.expando]=void 0)}}}),k.fn.extend({detach:function(t){return zt(this,t,!0)},remove:function(t){return zt(this,t)},text:function(t){return W(this,(function(t){return void 0===t?k.text(this):this.empty().each((function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=t)}))}),null,t,arguments.length)},append:function(){return qt(this,arguments,(function(t){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||$t(this,t).appendChild(t)}))},prepend:function(){return qt(this,arguments,(function(t){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var e=$t(this,t);e.insertBefore(t,e.firstChild)}}))},before:function(){return qt(this,arguments,(function(t){this.parentNode&&this.parentNode.insertBefore(t,this)}))},after:function(){return qt(this,arguments,(function(t){this.parentNode&&this.parentNode.insertBefore(t,this.nextSibling)}))},empty:function(){for(var t,e=0;null!=(t=this[e]);e++)1===t.nodeType&&(k.cleanData(yt(t,!1)),t.textContent="");return this},clone:function(t,e){return t=null!=t&&t,e=null==e?t:e,this.map((function(){return k.clone(this,t,e)}))},html:function(t){return W(this,(function(t){var e=this[0]||{},n=0,i=this.length;if(void 0===t&&1===e.nodeType)return e.innerHTML;if("string"==typeof t&&!Dt.test(t)&&!vt[(gt.exec(t)||["",""])[1].toLowerCase()]){t=k.htmlPrefilter(t);try{for(;n<i;n++)1===(e=this[n]||{}).nodeType&&(k.cleanData(yt(e,!1)),e.innerHTML=t);e=0}catch(t){}}e&&this.empty().append(t)}),null,t,arguments.length)},replaceWith:function(){var t=[];return qt(this,arguments,(function(e){var n=this.parentNode;k.inArray(this,t)<0&&(k.cleanData(yt(this)),n&&n.replaceChild(e,this))}),t)}}),k.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},(function(t,e){k.fn[t]=function(t){for(var n,i=[],r=k(t),s=r.length-1,o=0;o<=s;o++)n=o===s?this:this.clone(!0),k(r[o])[e](n),c.apply(i,n.get());return this.pushStack(i)}}));var Ht=new RegExp("^("+nt+")(?!px)[a-z%]+$","i"),Bt=function(t){var e=t.ownerDocument.defaultView;return e&&e.opener||(e=n),e.getComputedStyle(t)},Ft=function(t,e,n){var i,r,s={};for(r in e)s[r]=t.style[r],t.style[r]=e[r];for(r in i=n.call(t),e)t.style[r]=s[r];return i},Wt=new RegExp(rt.join("|"),"i");function Ut(t,e,n){var i,r,s,o,a=t.style;return(n=n||Bt(t))&&(""!==(o=n.getPropertyValue(e)||n[e])||ot(t)||(o=k.style(t,e)),!g.pixelBoxStyles()&&Ht.test(o)&&Wt.test(e)&&(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 Vt(t,e){return{get:function(){if(!t())return(this.get=e).apply(this,arguments);delete this.get}}}!function(){function t(){if(u){c.style.cssText="position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0",u.style.cssText="position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%",st.appendChild(c).appendChild(u);var t=n.getComputedStyle(u);i="1%"!==t.top,l=12===e(t.marginLeft),u.style.right="60%",o=36===e(t.right),r=36===e(t.width),u.style.position="absolute",s=12===e(u.offsetWidth/3),st.removeChild(c),u=null}}function e(t){return Math.round(parseFloat(t))}var i,r,s,o,a,l,c=y.createElement("div"),u=y.createElement("div");u.style&&(u.style.backgroundClip="content-box",u.cloneNode(!0).style.backgroundClip="",g.clearCloneStyle="content-box"===u.style.backgroundClip,k.extend(g,{boxSizingReliable:function(){return t(),r},pixelBoxStyles:function(){return t(),o},pixelPosition:function(){return t(),i},reliableMarginLeft:function(){return t(),l},scrollboxSize:function(){return t(),s},reliableTrDimensions:function(){var t,e,i,r;return null==a&&(t=y.createElement("table"),e=y.createElement("tr"),i=y.createElement("div"),t.style.cssText="position:absolute;left:-11111px",e.style.height="1px",i.style.height="9px",st.appendChild(t).appendChild(e).appendChild(i),r=n.getComputedStyle(e),a=parseInt(r.height)>3,st.removeChild(t)),a}}))}();var Jt=["Webkit","Moz","ms"],Xt=y.createElement("div").style,Kt={};function Gt(t){var e=k.cssProps[t]||Kt[t];return e||(t in Xt?t:Kt[t]=function(t){for(var e=t[0].toUpperCase()+t.slice(1),n=Jt.length;n--;)if((t=Jt[n]+e)in Xt)return t}(t)||t)}var Yt=/^(none|table(?!-c[ea]).+)/,Qt=/^--/,Zt={position:"absolute",visibility:"hidden",display:"block"},te={letterSpacing:"0",fontWeight:"400"};function ee(t,e,n){var i=it.exec(e);return i?Math.max(0,i[2]-(n||0))+(i[3]||"px"):e}function ne(t,e,n,i,r,s){var o="width"===e?1:0,a=0,l=0;if(n===(i?"border":"content"))return 0;for(;o<4;o+=2)"margin"===n&&(l+=k.css(t,n+rt[o],!0,r)),i?("content"===n&&(l-=k.css(t,"padding"+rt[o],!0,r)),"margin"!==n&&(l-=k.css(t,"border"+rt[o]+"Width",!0,r))):(l+=k.css(t,"padding"+rt[o],!0,r),"padding"!==n?l+=k.css(t,"border"+rt[o]+"Width",!0,r):a+=k.css(t,"border"+rt[o]+"Width",!0,r));return!i&&s>=0&&(l+=Math.max(0,Math.ceil(t["offset"+e[0].toUpperCase()+e.slice(1)]-s-l-a-.5))||0),l}function ie(t,e,n){var i=Bt(t),r=(!g.boxSizingReliable()||n)&&"border-box"===k.css(t,"boxSizing",!1,i),s=r,o=Ut(t,e,i),a="offset"+e[0].toUpperCase()+e.slice(1);if(Ht.test(o)){if(!n)return o;o="auto"}return(!g.boxSizingReliable()&&r||!g.reliableTrDimensions()&&A(t,"tr")||"auto"===o||!parseFloat(o)&&"inline"===k.css(t,"display",!1,i))&&t.getClientRects().length&&(r="border-box"===k.css(t,"boxSizing",!1,i),(s=a in t)&&(o=t[a])),(o=parseFloat(o)||0)+ne(t,e,n||(r?"border":"content"),s,i,o)+"px"}function re(t,e,n,i,r){return new re.prototype.init(t,e,n,i,r)}k.extend({cssHooks:{opacity:{get:function(t,e){if(e){var n=Ut(t,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{},style:function(t,e,n,i){if(t&&3!==t.nodeType&&8!==t.nodeType&&t.style){var r,s,o,a=X(e),l=Qt.test(e),c=t.style;if(l||(e=Gt(a)),o=k.cssHooks[e]||k.cssHooks[a],void 0===n)return o&&"get"in o&&void 0!==(r=o.get(t,!1,i))?r:c[e];"string"===(s=typeof n)&&(r=it.exec(n))&&r[1]&&(n=ct(t,e,r),s="number"),null!=n&&n==n&&("number"!==s||l||(n+=r&&r[3]||(k.cssNumber[a]?"":"px")),g.clearCloneStyle||""!==n||0!==e.indexOf("background")||(c[e]="inherit"),o&&"set"in o&&void 0===(n=o.set(t,n,i))||(l?c.setProperty(e,n):c[e]=n))}},css:function(t,e,n,i){var r,s,o,a=X(e);return Qt.test(e)||(e=Gt(a)),(o=k.cssHooks[e]||k.cssHooks[a])&&"get"in o&&(r=o.get(t,!0,n)),void 0===r&&(r=Ut(t,e,i)),"normal"===r&&e in te&&(r=te[e]),""===n||n?(s=parseFloat(r),!0===n||isFinite(s)?s||0:r):r}}),k.each(["height","width"],(function(t,e){k.cssHooks[e]={get:function(t,n,i){if(n)return!Yt.test(k.css(t,"display"))||t.getClientRects().length&&t.getBoundingClientRect().width?ie(t,e,i):Ft(t,Zt,(function(){return ie(t,e,i)}))},set:function(t,n,i){var r,s=Bt(t),o=!g.scrollboxSize()&&"absolute"===s.position,a=(o||i)&&"border-box"===k.css(t,"boxSizing",!1,s),l=i?ne(t,e,i,a,s):0;return a&&o&&(l-=Math.ceil(t["offset"+e[0].toUpperCase()+e.slice(1)]-parseFloat(s[e])-ne(t,e,"border",!1,s)-.5)),l&&(r=it.exec(n))&&"px"!==(r[3]||"px")&&(t.style[e]=n,n=k.css(t,e)),ee(0,n,l)}}})),k.cssHooks.marginLeft=Vt(g.reliableMarginLeft,(function(t,e){if(e)return(parseFloat(Ut(t,"marginLeft"))||t.getBoundingClientRect().left-Ft(t,{marginLeft:0},(function(){return t.getBoundingClientRect().left})))+"px"})),k.each({margin:"",padding:"",border:"Width"},(function(t,e){k.cssHooks[t+e]={expand:function(n){for(var i=0,r={},s="string"==typeof n?n.split(" "):[n];i<4;i++)r[t+rt[i]+e]=s[i]||s[i-2]||s[0];return r}},"margin"!==t&&(k.cssHooks[t+e].set=ee)})),k.fn.extend({css:function(t,e){return W(this,(function(t,e,n){var i,r,s={},o=0;if(Array.isArray(e)){for(i=Bt(t),r=e.length;o<r;o++)s[e[o]]=k.css(t,e[o],!1,i);return s}return void 0!==n?k.style(t,e,n):k.css(t,e)}),t,e,arguments.length>1)}}),k.Tween=re,re.prototype={constructor:re,init:function(t,e,n,i,r,s){this.elem=t,this.prop=n,this.easing=r||k.easing._default,this.options=e,this.start=this.now=this.cur(),this.end=i,this.unit=s||(k.cssNumber[n]?"":"px")},cur:function(){var t=re.propHooks[this.prop];return t&&t.get?t.get(this):re.propHooks._default.get(this)},run:function(t){var e,n=re.propHooks[this.prop];return this.options.duration?this.pos=e=k.easing[this.easing](t,this.options.duration*t,0,1,this.options.duration):this.pos=e=t,this.now=(this.end-this.start)*e+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):re.propHooks._default.set(this),this}},re.prototype.init.prototype=re.prototype,re.propHooks={_default:{get:function(t){var e;return 1!==t.elem.nodeType||null!=t.elem[t.prop]&&null==t.elem.style[t.prop]?t.elem[t.prop]:(e=k.css(t.elem,t.prop,""))&&"auto"!==e?e:0},set:function(t){k.fx.step[t.prop]?k.fx.step[t.prop](t):1!==t.elem.nodeType||!k.cssHooks[t.prop]&&null==t.elem.style[Gt(t.prop)]?t.elem[t.prop]=t.now:k.style(t.elem,t.prop,t.now+t.unit)}}},re.propHooks.scrollTop=re.propHooks.scrollLeft={set:function(t){t.elem.nodeType&&t.elem.parentNode&&(t.elem[t.prop]=t.now)}},k.easing={linear:function(t){return t},swing:function(t){return.5-Math.cos(t*Math.PI)/2},_default:"swing"},k.fx=re.prototype.init,k.fx.step={};var se,oe,ae=/^(?:toggle|show|hide)$/,le=/queueHooks$/;function ce(){oe&&(!1===y.hidden&&n.requestAnimationFrame?n.requestAnimationFrame(ce):n.setTimeout(ce,k.fx.interval),k.fx.tick())}function ue(){return n.setTimeout((function(){se=void 0})),se=Date.now()}function de(t,e){var n,i=0,r={height:t};for(e=e?1:0;i<4;i+=2-e)r["margin"+(n=rt[i])]=r["padding"+n]=t;return e&&(r.opacity=r.width=t),r}function he(t,e,n){for(var i,r=(_e.tweeners[e]||[]).concat(_e.tweeners["*"]),s=0,o=r.length;s<o;s++)if(i=r[s].call(n,e,t))return i}function _e(t,e,n){var i,r,s=0,o=_e.prefilters.length,a=k.Deferred().always((function(){delete l.elem})),l=function(){if(r)return!1;for(var e=se||ue(),n=Math.max(0,c.startTime+c.duration-e),i=1-(n/c.duration||0),s=0,o=c.tweens.length;s<o;s++)c.tweens[s].run(i);return a.notifyWith(t,[c,i,n]),i<1&&o?n:(o||a.notifyWith(t,[c,1,0]),a.resolveWith(t,[c]),!1)},c=a.promise({elem:t,props:k.extend({},e),opts:k.extend(!0,{specialEasing:{},easing:k.easing._default},n),originalProperties:e,originalOptions:n,startTime:se||ue(),duration:n.duration,tweens:[],createTween:function(e,n){var i=k.Tween(t,c.opts,e,n,c.opts.specialEasing[e]||c.opts.easing);return c.tweens.push(i),i},stop:function(e){var n=0,i=e?c.tweens.length:0;if(r)return this;for(r=!0;n<i;n++)c.tweens[n].run(1);return e?(a.notifyWith(t,[c,1,0]),a.resolveWith(t,[c,e])):a.rejectWith(t,[c,e]),this}}),u=c.props;for(!function(t,e){var n,i,r,s,o;for(n in t)if(r=e[i=X(n)],s=t[n],Array.isArray(s)&&(r=s[1],s=t[n]=s[0]),n!==i&&(t[i]=s,delete t[n]),(o=k.cssHooks[i])&&"expand"in o)for(n in s=o.expand(s),delete t[i],s)n in t||(t[n]=s[n],e[n]=r);else e[i]=r}(u,c.opts.specialEasing);s<o;s++)if(i=_e.prefilters[s].call(c,t,u,c.opts))return m(i.stop)&&(k._queueHooks(c.elem,c.opts.queue).stop=i.stop.bind(i)),i;return k.map(u,he,c),m(c.opts.start)&&c.opts.start.call(t,c),c.progress(c.opts.progress).done(c.opts.done,c.opts.complete).fail(c.opts.fail).always(c.opts.always),k.fx.timer(k.extend(l,{elem:t,anim:c,queue:c.opts.queue})),c}k.Animation=k.extend(_e,{tweeners:{"*":[function(t,e){var n=this.createTween(t,e);return ct(n.elem,t,it.exec(e),n),n}]},tweener:function(t,e){m(t)?(e=t,t=["*"]):t=t.match(M);for(var n,i=0,r=t.length;i<r;i++)n=t[i],_e.tweeners[n]=_e.tweeners[n]||[],_e.tweeners[n].unshift(e)},prefilters:[function(t,e,n){var i,r,s,o,a,l,c,u,d="width"in e||"height"in e,h=this,_={},f=t.style,p=t.nodeType&&lt(t),g=Y.get(t,"fxshow");for(i in n.queue||(null==(o=k._queueHooks(t,"fx")).unqueued&&(o.unqueued=0,a=o.empty.fire,o.empty.fire=function(){o.unqueued||a()}),o.unqueued++,h.always((function(){h.always((function(){o.unqueued--,k.queue(t,"fx").length||o.empty.fire()}))}))),e)if(r=e[i],ae.test(r)){if(delete e[i],s=s||"toggle"===r,r===(p?"hide":"show")){if("show"!==r||!g||void 0===g[i])continue;p=!0}_[i]=g&&g[i]||k.style(t,i)}if((l=!k.isEmptyObject(e))||!k.isEmptyObject(_))for(i in d&&1===t.nodeType&&(n.overflow=[f.overflow,f.overflowX,f.overflowY],null==(c=g&&g.display)&&(c=Y.get(t,"display")),"none"===(u=k.css(t,"display"))&&(c?u=c:(ht([t],!0),c=t.style.display||c,u=k.css(t,"display"),ht([t]))),("inline"===u||"inline-block"===u&&null!=c)&&"none"===k.css(t,"float")&&(l||(h.done((function(){f.display=c})),null==c&&(u=f.display,c="none"===u?"":u)),f.display="inline-block")),n.overflow&&(f.overflow="hidden",h.always((function(){f.overflow=n.overflow[0],f.overflowX=n.overflow[1],f.overflowY=n.overflow[2]}))),l=!1,_)l||(g?"hidden"in g&&(p=g.hidden):g=Y.access(t,"fxshow",{display:c}),s&&(g.hidden=!p),p&&ht([t],!0),h.done((function(){for(i in p||ht([t]),Y.remove(t,"fxshow"),_)k.style(t,i,_[i])}))),l=he(p?g[i]:0,i,h),i in g||(g[i]=l.start,p&&(l.end=l.start,l.start=0))}],prefilter:function(t,e){e?_e.prefilters.unshift(t):_e.prefilters.push(t)}}),k.speed=function(t,e,n){var i=t&&"object"==typeof t?k.extend({},t):{complete:n||!n&&e||m(t)&&t,duration:t,easing:n&&e||e&&!m(e)&&e};return k.fx.off?i.duration=0:"number"!=typeof i.duration&&(i.duration in k.fx.speeds?i.duration=k.fx.speeds[i.duration]:i.duration=k.fx.speeds._default),null!=i.queue&&!0!==i.queue||(i.queue="fx"),i.old=i.complete,i.complete=function(){m(i.old)&&i.old.call(this),i.queue&&k.dequeue(this,i.queue)},i},k.fn.extend({fadeTo:function(t,e,n,i){return this.filter(lt).css("opacity",0).show().end().animate({opacity:e},t,n,i)},animate:function(t,e,n,i){var r=k.isEmptyObject(t),s=k.speed(e,n,i),o=function(){var e=_e(this,k.extend({},t),s);(r||Y.get(this,"finish"))&&e.stop(!0)};return o.finish=o,r||!1===s.queue?this.each(o):this.queue(s.queue,o)},stop:function(t,e,n){var i=function(t){var e=t.stop;delete t.stop,e(n)};return"string"!=typeof t&&(n=e,e=t,t=void 0),e&&this.queue(t||"fx",[]),this.each((function(){var e=!0,r=null!=t&&t+"queueHooks",s=k.timers,o=Y.get(this);if(r)o[r]&&o[r].stop&&i(o[r]);else for(r in o)o[r]&&o[r].stop&&le.test(r)&&i(o[r]);for(r=s.length;r--;)s[r].elem!==this||null!=t&&s[r].queue!==t||(s[r].anim.stop(n),e=!1,s.splice(r,1));!e&&n||k.dequeue(this,t)}))},finish:function(t){return!1!==t&&(t=t||"fx"),this.each((function(){var e,n=Y.get(this),i=n[t+"queue"],r=n[t+"queueHooks"],s=k.timers,o=i?i.length:0;for(n.finish=!0,k.queue(this,t,[]),r&&r.stop&&r.stop.call(this,!0),e=s.length;e--;)s[e].elem===this&&s[e].queue===t&&(s[e].anim.stop(!0),s.splice(e,1));for(e=0;e<o;e++)i[e]&&i[e].finish&&i[e].finish.call(this);delete n.finish}))}}),k.each(["toggle","show","hide"],(function(t,e){var n=k.fn[e];k.fn[e]=function(t,i,r){return null==t||"boolean"==typeof t?n.apply(this,arguments):this.animate(de(e,!0),t,i,r)}})),k.each({slideDown:de("show"),slideUp:de("hide"),slideToggle:de("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},(function(t,e){k.fn[t]=function(t,n,i){return this.animate(e,t,n,i)}})),k.timers=[],k.fx.tick=function(){var t,e=0,n=k.timers;for(se=Date.now();e<n.length;e++)(t=n[e])()||n[e]!==t||n.splice(e--,1);n.length||k.fx.stop(),se=void 0},k.fx.timer=function(t){k.timers.push(t),k.fx.start()},k.fx.interval=13,k.fx.start=function(){oe||(oe=!0,ce())},k.fx.stop=function(){oe=null},k.fx.speeds={slow:600,fast:200,_default:400},k.fn.delay=function(t,e){return t=k.fx&&k.fx.speeds[t]||t,e=e||"fx",this.queue(e,(function(e,i){var r=n.setTimeout(e,t);i.stop=function(){n.clearTimeout(r)}}))},function(){var t=y.createElement("input"),e=y.createElement("select").appendChild(y.createElement("option"));t.type="checkbox",g.checkOn=""!==t.value,g.optSelected=e.selected,(t=y.createElement("input")).value="t",t.type="radio",g.radioValue="t"===t.value}();var fe,pe=k.expr.attrHandle;k.fn.extend({attr:function(t,e){return W(this,k.attr,t,e,arguments.length>1)},removeAttr:function(t){return this.each((function(){k.removeAttr(this,t)}))}}),k.extend({attr:function(t,e,n){var i,r,s=t.nodeType;if(3!==s&&8!==s&&2!==s)return void 0===t.getAttribute?k.prop(t,e,n):(1===s&&k.isXMLDoc(t)||(r=k.attrHooks[e.toLowerCase()]||(k.expr.match.bool.test(e)?fe:void 0)),void 0!==n?null===n?void k.removeAttr(t,e):r&&"set"in r&&void 0!==(i=r.set(t,n,e))?i:(t.setAttribute(e,n+""),n):r&&"get"in r&&null!==(i=r.get(t,e))?i:null==(i=k.find.attr(t,e))?void 0:i)},attrHooks:{type:{set:function(t,e){if(!g.radioValue&&"radio"===e&&A(t,"input")){var n=t.value;return t.setAttribute("type",e),n&&(t.value=n),e}}}},removeAttr:function(t,e){var n,i=0,r=e&&e.match(M);if(r&&1===t.nodeType)for(;n=r[i++];)t.removeAttribute(n)}}),fe={set:function(t,e,n){return!1===e?k.removeAttr(t,n):t.setAttribute(n,n),n}},k.each(k.expr.match.bool.source.match(/\w+/g),(function(t,e){var n=pe[e]||k.find.attr;pe[e]=function(t,e,i){var r,s,o=e.toLowerCase();return i||(s=pe[o],pe[o]=r,r=null!=n(t,e,i)?o:null,pe[o]=s),r}}));var ge=/^(?:input|select|textarea|button)$/i,me=/^(?:a|area)$/i;function ve(t){return(t.match(M)||[]).join(" ")}function ye(t){return t.getAttribute&&t.getAttribute("class")||""}function be(t){return Array.isArray(t)?t:"string"==typeof t&&t.match(M)||[]}k.fn.extend({prop:function(t,e){return W(this,k.prop,t,e,arguments.length>1)},removeProp:function(t){return this.each((function(){delete this[k.propFix[t]||t]}))}}),k.extend({prop:function(t,e,n){var i,r,s=t.nodeType;if(3!==s&&8!==s&&2!==s)return 1===s&&k.isXMLDoc(t)||(e=k.propFix[e]||e,r=k.propHooks[e]),void 0!==n?r&&"set"in r&&void 0!==(i=r.set(t,n,e))?i:t[e]=n:r&&"get"in r&&null!==(i=r.get(t,e))?i:t[e]},propHooks:{tabIndex:{get:function(t){var e=k.find.attr(t,"tabindex");return e?parseInt(e,10):ge.test(t.nodeName)||me.test(t.nodeName)&&t.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),g.optSelected||(k.propHooks.selected={get:function(t){var e=t.parentNode;return e&&e.parentNode&&e.parentNode.selectedIndex,null},set:function(t){var e=t.parentNode;e&&(e.selectedIndex,e.parentNode&&e.parentNode.selectedIndex)}}),k.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],(function(){k.propFix[this.toLowerCase()]=this})),k.fn.extend({addClass:function(t){var e,n,i,r,s,o,a,l=0;if(m(t))return this.each((function(e){k(this).addClass(t.call(this,e,ye(this)))}));if((e=be(t)).length)for(;n=this[l++];)if(r=ye(n),i=1===n.nodeType&&" "+ve(r)+" "){for(o=0;s=e[o++];)i.indexOf(" "+s+" ")<0&&(i+=s+" ");r!==(a=ve(i))&&n.setAttribute("class",a)}return this},removeClass:function(t){var e,n,i,r,s,o,a,l=0;if(m(t))return this.each((function(e){k(this).removeClass(t.call(this,e,ye(this)))}));if(!arguments.length)return this.attr("class","");if((e=be(t)).length)for(;n=this[l++];)if(r=ye(n),i=1===n.nodeType&&" "+ve(r)+" "){for(o=0;s=e[o++];)for(;i.indexOf(" "+s+" ")>-1;)i=i.replace(" "+s+" "," ");r!==(a=ve(i))&&n.setAttribute("class",a)}return this},toggleClass:function(t,e){var n=typeof t,i="string"===n||Array.isArray(t);return"boolean"==typeof e&&i?e?this.addClass(t):this.removeClass(t):m(t)?this.each((function(n){k(this).toggleClass(t.call(this,n,ye(this),e),e)})):this.each((function(){var e,r,s,o;if(i)for(r=0,s=k(this),o=be(t);e=o[r++];)s.hasClass(e)?s.removeClass(e):s.addClass(e);else void 0!==t&&"boolean"!==n||((e=ye(this))&&Y.set(this,"__className__",e),this.setAttribute&&this.setAttribute("class",e||!1===t?"":Y.get(this,"__className__")||""))}))},hasClass:function(t){var e,n,i=0;for(e=" "+t+" ";n=this[i++];)if(1===n.nodeType&&(" "+ve(ye(n))+" ").indexOf(e)>-1)return!0;return!1}});var we=/\r/g;k.fn.extend({val:function(t){var e,n,i,r=this[0];return arguments.length?(i=m(t),this.each((function(n){var r;1===this.nodeType&&(null==(r=i?t.call(this,n,k(this).val()):t)?r="":"number"==typeof r?r+="":Array.isArray(r)&&(r=k.map(r,(function(t){return null==t?"":t+""}))),(e=k.valHooks[this.type]||k.valHooks[this.nodeName.toLowerCase()])&&"set"in e&&void 0!==e.set(this,r,"value")||(this.value=r))}))):r?(e=k.valHooks[r.type]||k.valHooks[r.nodeName.toLowerCase()])&&"get"in e&&void 0!==(n=e.get(r,"value"))?n:"string"==typeof(n=r.value)?n.replace(we,""):null==n?"":n:void 0}}),k.extend({valHooks:{option:{get:function(t){var e=k.find.attr(t,"value");return null!=e?e:ve(k.text(t))}},select:{get:function(t){var e,n,i,r=t.options,s=t.selectedIndex,o="select-one"===t.type,a=o?null:[],l=o?s+1:r.length;for(i=s<0?l:o?s:0;i<l;i++)if(((n=r[i]).selected||i===s)&&!n.disabled&&(!n.parentNode.disabled||!A(n.parentNode,"optgroup"))){if(e=k(n).val(),o)return e;a.push(e)}return a},set:function(t,e){for(var n,i,r=t.options,s=k.makeArray(e),o=r.length;o--;)((i=r[o]).selected=k.inArray(k.valHooks.option.get(i),s)>-1)&&(n=!0);return n||(t.selectedIndex=-1),s}}}}),k.each(["radio","checkbox"],(function(){k.valHooks[this]={set:function(t,e){if(Array.isArray(e))return t.checked=k.inArray(k(t).val(),e)>-1}},g.checkOn||(k.valHooks[this].get=function(t){return null===t.getAttribute("value")?"on":t.value})})),g.focusin="onfocusin"in n;var xe=/^(?:focusinfocus|focusoutblur)$/,ke=function(t){t.stopPropagation()};k.extend(k.event,{trigger:function(t,e,i,r){var s,o,a,l,c,u,d,h,f=[i||y],p=_.call(t,"type")?t.type:t,g=_.call(t,"namespace")?t.namespace.split("."):[];if(o=h=a=i=i||y,3!==i.nodeType&&8!==i.nodeType&&!xe.test(p+k.event.triggered)&&(p.indexOf(".")>-1&&(g=p.split("."),p=g.shift(),g.sort()),c=p.indexOf(":")<0&&"on"+p,(t=t[k.expando]?t:new k.Event(p,"object"==typeof t&&t)).isTrigger=r?2:3,t.namespace=g.join("."),t.rnamespace=t.namespace?new RegExp("(^|\\.)"+g.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=i),e=null==e?[t]:k.makeArray(e,[t]),d=k.event.special[p]||{},r||!d.trigger||!1!==d.trigger.apply(i,e))){if(!r&&!d.noBubble&&!v(i)){for(l=d.delegateType||p,xe.test(l+p)||(o=o.parentNode);o;o=o.parentNode)f.push(o),a=o;a===(i.ownerDocument||y)&&f.push(a.defaultView||a.parentWindow||n)}for(s=0;(o=f[s++])&&!t.isPropagationStopped();)h=o,t.type=s>1?l:d.bindType||p,(u=(Y.get(o,"events")||Object.create(null))[t.type]&&Y.get(o,"handle"))&&u.apply(o,e),(u=c&&o[c])&&u.apply&&K(o)&&(t.result=u.apply(o,e),!1===t.result&&t.preventDefault());return t.type=p,r||t.isDefaultPrevented()||d._default&&!1!==d._default.apply(f.pop(),e)||!K(i)||c&&m(i[p])&&!v(i)&&((a=i[c])&&(i[c]=null),k.event.triggered=p,t.isPropagationStopped()&&h.addEventListener(p,ke),i[p](),t.isPropagationStopped()&&h.removeEventListener(p,ke),k.event.triggered=void 0,a&&(i[c]=a)),t.result}},simulate:function(t,e,n){var i=k.extend(new k.Event,n,{type:t,isSimulated:!0});k.event.trigger(i,null,e)}}),k.fn.extend({trigger:function(t,e){return this.each((function(){k.event.trigger(t,e,this)}))},triggerHandler:function(t,e){var n=this[0];if(n)return k.event.trigger(t,e,n,!0)}}),g.focusin||k.each({focus:"focusin",blur:"focusout"},(function(t,e){var n=function(t){k.event.simulate(e,t.target,k.event.fix(t))};k.event.special[e]={setup:function(){var i=this.ownerDocument||this.document||this,r=Y.access(i,e);r||i.addEventListener(t,n,!0),Y.access(i,e,(r||0)+1)},teardown:function(){var i=this.ownerDocument||this.document||this,r=Y.access(i,e)-1;r?Y.access(i,e,r):(i.removeEventListener(t,n,!0),Y.remove(i,e))}}}));var Ee=n.location,Te={guid:Date.now()},Ce=/\?/;k.parseXML=function(t){var e;if(!t||"string"!=typeof t)return null;try{e=(new n.DOMParser).parseFromString(t,"text/xml")}catch(t){e=void 0}return e&&!e.getElementsByTagName("parsererror").length||k.error("Invalid XML: "+t),e};var je=/\[\]$/,Se=/\r?\n/g,Ae=/^(?:submit|button|image|reset|file)$/i,Ne=/^(?:input|select|textarea|keygen)/i;function De(t,e,n,i){var r;if(Array.isArray(e))k.each(e,(function(e,r){n||je.test(t)?i(t,r):De(t+"["+("object"==typeof r&&null!=r?e:"")+"]",r,n,i)}));else if(n||"object"!==x(e))i(t,e);else for(r in e)De(t+"["+r+"]",e[r],n,i)}k.param=function(t,e){var n,i=[],r=function(t,e){var n=m(e)?e():e;i[i.length]=encodeURIComponent(t)+"="+encodeURIComponent(null==n?"":n)};if(null==t)return"";if(Array.isArray(t)||t.jquery&&!k.isPlainObject(t))k.each(t,(function(){r(this.name,this.value)}));else for(n in t)De(n,t[n],e,r);return i.join("&")},k.fn.extend({serialize:function(){return k.param(this.serializeArray())},serializeArray:function(){return this.map((function(){var t=k.prop(this,"elements");return t?k.makeArray(t):this})).filter((function(){var t=this.type;return this.name&&!k(this).is(":disabled")&&Ne.test(this.nodeName)&&!Ae.test(t)&&(this.checked||!pt.test(t))})).map((function(t,e){var n=k(this).val();return null==n?null:Array.isArray(n)?k.map(n,(function(t){return{name:e.name,value:t.replace(Se,"\r\n")}})):{name:e.name,value:n.replace(Se,"\r\n")}})).get()}});var Oe=/%20/g,Ie=/#.*$/,$e=/([?&])_=[^&]*/,Re=/^(.*?):[ \t]*([^\r\n]*)$/gm,Le=/^(?:GET|HEAD)$/,Me=/^\/\//,Pe={},qe={},ze="*/".concat("*"),He=y.createElement("a");function Be(t){return function(e,n){"string"!=typeof e&&(n=e,e="*");var i,r=0,s=e.toLowerCase().match(M)||[];if(m(n))for(;i=s[r++];)"+"===i[0]?(i=i.slice(1)||"*",(t[i]=t[i]||[]).unshift(n)):(t[i]=t[i]||[]).push(n)}}function Fe(t,e,n,i){var r={},s=t===qe;function o(a){var l;return r[a]=!0,k.each(t[a]||[],(function(t,a){var c=a(e,n,i);return"string"!=typeof c||s||r[c]?s?!(l=c):void 0:(e.dataTypes.unshift(c),o(c),!1)})),l}return o(e.dataTypes[0])||!r["*"]&&o("*")}function We(t,e){var n,i,r=k.ajaxSettings.flatOptions||{};for(n in e)void 0!==e[n]&&((r[n]?t:i||(i={}))[n]=e[n]);return i&&k.extend(!0,t,i),t}He.href=Ee.href,k.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Ee.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(Ee.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":ze,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":JSON.parse,"text xml":k.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(t,e){return e?We(We(t,k.ajaxSettings),e):We(k.ajaxSettings,t)},ajaxPrefilter:Be(Pe),ajaxTransport:Be(qe),ajax:function(t,e){"object"==typeof t&&(e=t,t=void 0),e=e||{};var i,r,s,o,a,l,c,u,d,h,_=k.ajaxSetup({},e),f=_.context||_,p=_.context&&(f.nodeType||f.jquery)?k(f):k.event,g=k.Deferred(),m=k.Callbacks("once memory"),v=_.statusCode||{},b={},w={},x="canceled",E={readyState:0,getResponseHeader:function(t){var e;if(c){if(!o)for(o={};e=Re.exec(s);)o[e[1].toLowerCase()+" "]=(o[e[1].toLowerCase()+" "]||[]).concat(e[2]);e=o[t.toLowerCase()+" "]}return null==e?null:e.join(", ")},getAllResponseHeaders:function(){return c?s:null},setRequestHeader:function(t,e){return null==c&&(t=w[t.toLowerCase()]=w[t.toLowerCase()]||t,b[t]=e),this},overrideMimeType:function(t){return null==c&&(_.mimeType=t),this},statusCode:function(t){var e;if(t)if(c)E.always(t[E.status]);else for(e in t)v[e]=[v[e],t[e]];return this},abort:function(t){var e=t||x;return i&&i.abort(e),T(0,e),this}};if(g.promise(E),_.url=((t||_.url||Ee.href)+"").replace(Me,Ee.protocol+"//"),_.type=e.method||e.type||_.method||_.type,_.dataTypes=(_.dataType||"*").toLowerCase().match(M)||[""],null==_.crossDomain){l=y.createElement("a");try{l.href=_.url,l.href=l.href,_.crossDomain=He.protocol+"//"+He.host!=l.protocol+"//"+l.host}catch(t){_.crossDomain=!0}}if(_.data&&_.processData&&"string"!=typeof _.data&&(_.data=k.param(_.data,_.traditional)),Fe(Pe,_,e,E),c)return E;for(d in(u=k.event&&_.global)&&0==k.active++&&k.event.trigger("ajaxStart"),_.type=_.type.toUpperCase(),_.hasContent=!Le.test(_.type),r=_.url.replace(Ie,""),_.hasContent?_.data&&_.processData&&0===(_.contentType||"").indexOf("application/x-www-form-urlencoded")&&(_.data=_.data.replace(Oe,"+")):(h=_.url.slice(r.length),_.data&&(_.processData||"string"==typeof _.data)&&(r+=(Ce.test(r)?"&":"?")+_.data,delete _.data),!1===_.cache&&(r=r.replace($e,"$1"),h=(Ce.test(r)?"&":"?")+"_="+Te.guid+++h),_.url=r+h),_.ifModified&&(k.lastModified[r]&&E.setRequestHeader("If-Modified-Since",k.lastModified[r]),k.etag[r]&&E.setRequestHeader("If-None-Match",k.etag[r])),(_.data&&_.hasContent&&!1!==_.contentType||e.contentType)&&E.setRequestHeader("Content-Type",_.contentType),E.setRequestHeader("Accept",_.dataTypes[0]&&_.accepts[_.dataTypes[0]]?_.accepts[_.dataTypes[0]]+("*"!==_.dataTypes[0]?", "+ze+"; q=0.01":""):_.accepts["*"]),_.headers)E.setRequestHeader(d,_.headers[d]);if(_.beforeSend&&(!1===_.beforeSend.call(f,E,_)||c))return E.abort();if(x="abort",m.add(_.complete),E.done(_.success),E.fail(_.error),i=Fe(qe,_,e,E)){if(E.readyState=1,u&&p.trigger("ajaxSend",[E,_]),c)return E;_.async&&_.timeout>0&&(a=n.setTimeout((function(){E.abort("timeout")}),_.timeout));try{c=!1,i.send(b,T)}catch(t){if(c)throw t;T(-1,t)}}else T(-1,"No Transport");function T(t,e,o,l){var d,h,y,b,w,x=e;c||(c=!0,a&&n.clearTimeout(a),i=void 0,s=l||"",E.readyState=t>0?4:0,d=t>=200&&t<300||304===t,o&&(b=function(t,e,n){for(var i,r,s,o,a=t.contents,l=t.dataTypes;"*"===l[0];)l.shift(),void 0===i&&(i=t.mimeType||e.getResponseHeader("Content-Type"));if(i)for(r in a)if(a[r]&&a[r].test(i)){l.unshift(r);break}if(l[0]in n)s=l[0];else{for(r in n){if(!l[0]||t.converters[r+" "+l[0]]){s=r;break}o||(o=r)}s=s||o}if(s)return s!==l[0]&&l.unshift(s),n[s]}(_,E,o)),!d&&k.inArray("script",_.dataTypes)>-1&&(_.converters["text script"]=function(){}),b=function(t,e,n,i){var r,s,o,a,l,c={},u=t.dataTypes.slice();if(u[1])for(o in t.converters)c[o.toLowerCase()]=t.converters[o];for(s=u.shift();s;)if(t.responseFields[s]&&(n[t.responseFields[s]]=e),!l&&i&&t.dataFilter&&(e=t.dataFilter(e,t.dataType)),l=s,s=u.shift())if("*"===s)s=l;else if("*"!==l&&l!==s){if(!(o=c[l+" "+s]||c["* "+s]))for(r in c)if((a=r.split(" "))[1]===s&&(o=c[l+" "+a[0]]||c["* "+a[0]])){!0===o?o=c[r]:!0!==c[r]&&(s=a[0],u.unshift(a[1]));break}if(!0!==o)if(o&&t.throws)e=o(e);else try{e=o(e)}catch(t){return{state:"parsererror",error:o?t:"No conversion from "+l+" to "+s}}}return{state:"success",data:e}}(_,b,E,d),d?(_.ifModified&&((w=E.getResponseHeader("Last-Modified"))&&(k.lastModified[r]=w),(w=E.getResponseHeader("etag"))&&(k.etag[r]=w)),204===t||"HEAD"===_.type?x="nocontent":304===t?x="notmodified":(x=b.state,h=b.data,d=!(y=b.error))):(y=x,!t&&x||(x="error",t<0&&(t=0))),E.status=t,E.statusText=(e||x)+"",d?g.resolveWith(f,[h,x,E]):g.rejectWith(f,[E,x,y]),E.statusCode(v),v=void 0,u&&p.trigger(d?"ajaxSuccess":"ajaxError",[E,_,d?h:y]),m.fireWith(f,[E,x]),u&&(p.trigger("ajaxComplete",[E,_]),--k.active||k.event.trigger("ajaxStop")))}return E},getJSON:function(t,e,n){return k.get(t,e,n,"json")},getScript:function(t,e){return k.get(t,void 0,e,"script")}}),k.each(["get","post"],(function(t,e){k[e]=function(t,n,i,r){return m(n)&&(r=r||i,i=n,n=void 0),k.ajax(k.extend({url:t,type:e,dataType:r,data:n,success:i},k.isPlainObject(t)&&t))}})),k.ajaxPrefilter((function(t){var e;for(e in t.headers)"content-type"===e.toLowerCase()&&(t.contentType=t.headers[e]||"")})),k._evalUrl=function(t,e,n){return k.ajax({url:t,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(t){k.globalEval(t,e,n)}})},k.fn.extend({wrapAll:function(t){var e;return this[0]&&(m(t)&&(t=t.call(this[0])),e=k(t,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&e.insertBefore(this[0]),e.map((function(){for(var t=this;t.firstElementChild;)t=t.firstElementChild;return t})).append(this)),this},wrapInner:function(t){return m(t)?this.each((function(e){k(this).wrapInner(t.call(this,e))})):this.each((function(){var e=k(this),n=e.contents();n.length?n.wrapAll(t):e.append(t)}))},wrap:function(t){var e=m(t);return this.each((function(n){k(this).wrapAll(e?t.call(this,n):t)}))},unwrap:function(t){return this.parent(t).not("body").each((function(){k(this).replaceWith(this.childNodes)})),this}}),k.expr.pseudos.hidden=function(t){return!k.expr.pseudos.visible(t)},k.expr.pseudos.visible=function(t){return!!(t.offsetWidth||t.offsetHeight||t.getClientRects().length)},k.ajaxSettings.xhr=function(){try{return new n.XMLHttpRequest}catch(t){}};var Ue={0:200,1223:204},Ve=k.ajaxSettings.xhr();g.cors=!!Ve&&"withCredentials"in Ve,g.ajax=Ve=!!Ve,k.ajaxTransport((function(t){var e,i;if(g.cors||Ve&&!t.crossDomain)return{send:function(r,s){var o,a=t.xhr();if(a.open(t.type,t.url,t.async,t.username,t.password),t.xhrFields)for(o in t.xhrFields)a[o]=t.xhrFields[o];for(o in t.mimeType&&a.overrideMimeType&&a.overrideMimeType(t.mimeType),t.crossDomain||r["X-Requested-With"]||(r["X-Requested-With"]="XMLHttpRequest"),r)a.setRequestHeader(o,r[o]);e=function(t){return function(){e&&(e=i=a.onload=a.onerror=a.onabort=a.ontimeout=a.onreadystatechange=null,"abort"===t?a.abort():"error"===t?"number"!=typeof a.status?s(0,"error"):s(a.status,a.statusText):s(Ue[a.status]||a.status,a.statusText,"text"!==(a.responseType||"text")||"string"!=typeof a.responseText?{binary:a.response}:{text:a.responseText},a.getAllResponseHeaders()))}},a.onload=e(),i=a.onerror=a.ontimeout=e("error"),void 0!==a.onabort?a.onabort=i:a.onreadystatechange=function(){4===a.readyState&&n.setTimeout((function(){e&&i()}))},e=e("abort");try{a.send(t.hasContent&&t.data||null)}catch(t){if(e)throw t}},abort:function(){e&&e()}}})),k.ajaxPrefilter((function(t){t.crossDomain&&(t.contents.script=!1)})),k.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(t){return k.globalEval(t),t}}}),k.ajaxPrefilter("script",(function(t){void 0===t.cache&&(t.cache=!1),t.crossDomain&&(t.type="GET")})),k.ajaxTransport("script",(function(t){var e,n;if(t.crossDomain||t.scriptAttrs)return{send:function(i,r){e=k("<script>").attr(t.scriptAttrs||{}).prop({charset:t.scriptCharset,src:t.url}).on("load error",n=function(t){e.remove(),n=null,t&&r("error"===t.type?404:200,t.type)}),y.head.appendChild(e[0])},abort:function(){n&&n()}}}));var Je,Xe=[],Ke=/(=)\?(?=&|$)|\?\?/;k.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var t=Xe.pop()||k.expando+"_"+Te.guid++;return this[t]=!0,t}}),k.ajaxPrefilter("json jsonp",(function(t,e,i){var r,s,o,a=!1!==t.jsonp&&(Ke.test(t.url)?"url":"string"==typeof t.data&&0===(t.contentType||"").indexOf("application/x-www-form-urlencoded")&&Ke.test(t.data)&&"data");if(a||"jsonp"===t.dataTypes[0])return r=t.jsonpCallback=m(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,a?t[a]=t[a].replace(Ke,"$1"+r):!1!==t.jsonp&&(t.url+=(Ce.test(t.url)?"&":"?")+t.jsonp+"="+r),t.converters["script json"]=function(){return o||k.error(r+" was not called"),o[0]},t.dataTypes[0]="json",s=n[r],n[r]=function(){o=arguments},i.always((function(){void 0===s?k(n).removeProp(r):n[r]=s,t[r]&&(t.jsonpCallback=e.jsonpCallback,Xe.push(r)),o&&m(s)&&s(o[0]),o=s=void 0})),"script"})),g.createHTMLDocument=((Je=y.implementation.createHTMLDocument("").body).innerHTML="<form></form><form></form>",2===Je.childNodes.length),k.parseHTML=function(t,e,n){return"string"!=typeof t?[]:("boolean"==typeof e&&(n=e,e=!1),e||(g.createHTMLDocument?((i=(e=y.implementation.createHTMLDocument("")).createElement("base")).href=y.location.href,e.head.appendChild(i)):e=y),s=!n&&[],(r=N.exec(t))?[e.createElement(r[1])]:(r=xt([t],e,s),s&&s.length&&k(s).remove(),k.merge([],r.childNodes)));var i,r,s},k.fn.load=function(t,e,n){var i,r,s,o=this,a=t.indexOf(" ");return a>-1&&(i=ve(t.slice(a)),t=t.slice(0,a)),m(e)?(n=e,e=void 0):e&&"object"==typeof e&&(r="POST"),o.length>0&&k.ajax({url:t,type:r||"GET",dataType:"html",data:e}).done((function(t){s=arguments,o.html(i?k("<div>").append(k.parseHTML(t)).find(i):t)})).always(n&&function(t,e){o.each((function(){n.apply(this,s||[t.responseText,e,t])}))}),this},k.expr.pseudos.animated=function(t){return k.grep(k.timers,(function(e){return t===e.elem})).length},k.offset={setOffset:function(t,e,n){var i,r,s,o,a,l,c=k.css(t,"position"),u=k(t),d={};"static"===c&&(t.style.position="relative"),a=u.offset(),s=k.css(t,"top"),l=k.css(t,"left"),("absolute"===c||"fixed"===c)&&(s+l).indexOf("auto")>-1?(o=(i=u.position()).top,r=i.left):(o=parseFloat(s)||0,r=parseFloat(l)||0),m(e)&&(e=e.call(t,n,k.extend({},a))),null!=e.top&&(d.top=e.top-a.top+o),null!=e.left&&(d.left=e.left-a.left+r),"using"in e?e.using.call(t,d):("number"==typeof d.top&&(d.top+="px"),"number"==typeof d.left&&(d.left+="px"),u.css(d))}},k.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each((function(e){k.offset.setOffset(this,t,e)}));var e,n,i=this[0];return i?i.getClientRects().length?(e=i.getBoundingClientRect(),n=i.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var t,e,n,i=this[0],r={top:0,left:0};if("fixed"===k.css(i,"position"))e=i.getBoundingClientRect();else{for(e=this.offset(),n=i.ownerDocument,t=i.offsetParent||n.documentElement;t&&(t===n.body||t===n.documentElement)&&"static"===k.css(t,"position");)t=t.parentNode;t&&t!==i&&1===t.nodeType&&((r=k(t).offset()).top+=k.css(t,"borderTopWidth",!0),r.left+=k.css(t,"borderLeftWidth",!0))}return{top:e.top-r.top-k.css(i,"marginTop",!0),left:e.left-r.left-k.css(i,"marginLeft",!0)}}},offsetParent:function(){return this.map((function(){for(var t=this.offsetParent;t&&"static"===k.css(t,"position");)t=t.offsetParent;return t||st}))}}),k.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},(function(t,e){var n="pageYOffset"===e;k.fn[t]=function(i){return W(this,(function(t,i,r){var s;if(v(t)?s=t:9===t.nodeType&&(s=t.defaultView),void 0===r)return s?s[e]:t[i];s?s.scrollTo(n?s.pageXOffset:r,n?r:s.pageYOffset):t[i]=r}),t,i,arguments.length)}})),k.each(["top","left"],(function(t,e){k.cssHooks[e]=Vt(g.pixelPosition,(function(t,n){if(n)return n=Ut(t,e),Ht.test(n)?k(t).position()[e]+"px":n}))})),k.each({Height:"height",Width:"width"},(function(t,e){k.each({padding:"inner"+t,content:e,"":"outer"+t},(function(n,i){k.fn[i]=function(r,s){var o=arguments.length&&(n||"boolean"!=typeof r),a=n||(!0===r||!0===s?"margin":"border");return W(this,(function(e,n,r){var s;return v(e)?0===i.indexOf("outer")?e["inner"+t]:e.document.documentElement["client"+t]:9===e.nodeType?(s=e.documentElement,Math.max(e.body["scroll"+t],s["scroll"+t],e.body["offset"+t],s["offset"+t],s["client"+t])):void 0===r?k.css(e,n,a):k.style(e,n,r,a)}),e,o?r:void 0,o)}}))})),k.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],(function(t,e){k.fn[e]=function(t){return this.on(e,t)}})),k.fn.extend({bind:function(t,e,n){return this.on(t,null,e,n)},unbind:function(t,e){return this.off(t,null,e)},delegate:function(t,e,n,i){return this.on(e,t,n,i)},undelegate:function(t,e,n){return 1===arguments.length?this.off(t,"**"):this.off(e,t||"**",n)},hover:function(t,e){return this.mouseenter(t).mouseleave(e||t)}}),k.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),(function(t,e){k.fn[e]=function(t,n){return arguments.length>0?this.on(e,null,t,n):this.trigger(e)}}));var Ge=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;k.proxy=function(t,e){var n,i,r;if("string"==typeof e&&(n=t[e],e=t,t=n),m(t))return i=a.call(arguments,2),(r=function(){return t.apply(e||this,i.concat(a.call(arguments)))}).guid=t.guid=t.guid||k.guid++,r},k.holdReady=function(t){t?k.readyWait++:k.ready(!0)},k.isArray=Array.isArray,k.parseJSON=JSON.parse,k.nodeName=A,k.isFunction=m,k.isWindow=v,k.camelCase=X,k.type=x,k.now=Date.now,k.isNumeric=function(t){var e=k.type(t);return("number"===e||"string"===e)&&!isNaN(t-parseFloat(t))},k.trim=function(t){return null==t?"":(t+"").replace(Ge,"")},void 0===(i=function(){return k}.apply(e,[]))||(t.exports=i);var Ye=n.jQuery,Qe=n.$;return k.noConflict=function(t){return n.$===k&&(n.$=Qe),t&&n.jQuery===k&&(n.jQuery=Ye),k},void 0===r&&(n.jQuery=n.$=k),k}))},function(t,e,n){(function(i){var r,s,o;o="object"==typeof self&&self.self===self&&self||"object"==typeof i&&i.global===i&&i,r=[n(2),n(0),e],void 0===(s=function(t,e,n){o.Backbone=function(t,e,n,i){var r=t.Backbone,s=Array.prototype.slice;e.VERSION="1.4.0",e.$=i,e.noConflict=function(){return t.Backbone=r,this},e.emulateHTTP=!1,e.emulateJSON=!1;var o,a=e.Events={},l=/\s+/,c=function(t,e,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++)e=c(t,e,o[a],i[o[a]],s)}else if(i&&l.test(i))for(o=i.split(l);a<o.length;a++)e=t(e,o[a],r,s);else e=t(e,i,r,s);return e};a.on=function(t,e,n){return this._events=c(u,this._events||{},t,e,{context:n,ctx:this,listening:o}),o&&((this._listeners||(this._listeners={}))[o.id]=o,o.interop=!1),this},a.listenTo=function(t,e,i){if(!t)return this;var r=t._listenId||(t._listenId=n.uniqueId("l")),s=this._listeningTo||(this._listeningTo={}),a=o=s[r];a||(this._listenId||(this._listenId=n.uniqueId("l")),a=o=s[r]=new g(this,t));var l=d(t,e,i,this);if(o=void 0,l)throw l;return a.interop&&a.on(e,i),this};var u=function(t,e,n,i){if(n){var r=t[e]||(t[e]=[]),s=i.context,o=i.ctx,a=i.listening;a&&a.count++,r.push({callback:n,context:s,ctx:s||o,listening:a})}return t},d=function(t,e,n,i){try{t.on(e,n,i)}catch(t){return t}};a.off=function(t,e,n){return this._events?(this._events=c(h,this._events,t,e,{context:n,listeners:this._listeners}),this):this},a.stopListening=function(t,e,i){var r=this._listeningTo;if(!r)return this;for(var s=t?[t._listenId]:n.keys(r),o=0;o<s.length;o++){var a=r[s[o]];if(!a)break;a.obj.off(e,i,this),a.interop&&a.off(e,i)}return n.isEmpty(r)&&(this._listeningTo=void 0),this};var h=function(t,e,i,r){if(t){var s,o=r.context,a=r.listeners,l=0;if(e||o||i){for(s=e?[e]:n.keys(t);l<s.length;l++){var c=t[e=s[l]];if(!c)break;for(var u=[],d=0;d<c.length;d++){var h=c[d];if(i&&i!==h.callback&&i!==h.callback._callback||o&&o!==h.context)u.push(h);else{var _=h.listening;_&&_.off(e,i)}}u.length?t[e]=u:delete t[e]}return t}for(s=n.keys(a);l<s.length;l++)a[s[l]].cleanup()}};a.once=function(t,e,n){var i=c(_,{},t,e,this.off.bind(this));return"string"==typeof t&&null==n&&(e=void 0),this.on(i,e,n)},a.listenToOnce=function(t,e,n){var i=c(_,{},e,n,this.stopListening.bind(this,t));return this.listenTo(t,i)};var _=function(t,e,i,r){if(i){var s=t[e]=n.once((function(){r(e,s),i.apply(this,arguments)}));s._callback=i}return t};a.trigger=function(t){if(!this._events)return this;for(var e=Math.max(0,arguments.length-1),n=Array(e),i=0;i<e;i++)n[i]=arguments[i+1];return c(f,this._events,t,void 0,n),this};var f=function(t,e,n,i){if(t){var r=t[e],s=t.all;r&&s&&(s=s.slice()),r&&p(r,i),s&&p(s,[e].concat(i))}return t},p=function(t,e){var n,i=-1,r=t.length,s=e[0],o=e[1],a=e[2];switch(e.length){case 0:for(;++i<r;)(n=t[i]).callback.call(n.ctx);return;case 1:for(;++i<r;)(n=t[i]).callback.call(n.ctx,s);return;case 2:for(;++i<r;)(n=t[i]).callback.call(n.ctx,s,o);return;case 3:for(;++i<r;)(n=t[i]).callback.call(n.ctx,s,o,a);return;default:for(;++i<r;)(n=t[i]).callback.apply(n.ctx,e);return}},g=function(t,e){this.id=t._listenId,this.listener=t,this.obj=e,this.interop=!0,this.count=0,this._events=void 0};g.prototype.on=a.on,g.prototype.off=function(t,e){var n;this.interop?(this._events=c(h,this._events,t,e,{context:void 0,listeners:void 0}),n=!this._events):(this.count--,n=0===this.count),n&&this.cleanup()},g.prototype.cleanup=function(){delete this.listener._listeningTo[this.obj._listenId],this.interop||delete this.obj._listeners[this.id]},a.bind=a.on,a.unbind=a.off,n.extend(e,a);var m=e.Model=function(t,e){var i=t||{};e||(e={}),this.preinitialize.apply(this,arguments),this.cid=n.uniqueId(this.cidPrefix),this.attributes={},e.collection&&(this.collection=e.collection),e.parse&&(i=this.parse(i,e)||{});var r=n.result(this,"defaults");i=n.defaults(n.extend({},r,i),r),this.set(i,e),this.changed={},this.initialize.apply(this,arguments)};n.extend(m.prototype,a,{changed:null,validationError:null,idAttribute:"id",cidPrefix:"c",preinitialize:function(){},initialize:function(){},toJSON:function(t){return n.clone(this.attributes)},sync:function(){return e.sync.apply(this,arguments)},get:function(t){return this.attributes[t]},escape:function(t){return n.escape(this.get(t))},has:function(t){return null!=this.get(t)},matches:function(t){return!!n.iteratee(t,this)(this.attributes)},set:function(t,e,i){if(null==t)return this;var r;if("object"==typeof t?(r=t,i=e):(r={})[t]=e,i||(i={}),!this._validate(r,i))return!1;var s=i.unset,o=i.silent,a=[],l=this._changing;this._changing=!0,l||(this._previousAttributes=n.clone(this.attributes),this.changed={});var c=this.attributes,u=this.changed,d=this._previousAttributes;for(var h in r)e=r[h],n.isEqual(c[h],e)||a.push(h),n.isEqual(d[h],e)?delete u[h]:u[h]=e,s?delete c[h]:c[h]=e;if(this.idAttribute in r&&(this.id=this.get(this.idAttribute)),!o){a.length&&(this._pending=i);for(var _=0;_<a.length;_++)this.trigger("change:"+a[_],this,c[a[_]],i)}if(l)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(t,e){return this.set(t,void 0,n.extend({},e,{unset:!0}))},clear:function(t){var e={};for(var i in this.attributes)e[i]=void 0;return this.set(e,n.extend({},t,{unset:!0}))},hasChanged:function(t){return null==t?!n.isEmpty(this.changed):n.has(this.changed,t)},changedAttributes:function(t){if(!t)return!!this.hasChanged()&&n.clone(this.changed);var e,i=this._changing?this._previousAttributes:this.attributes,r={};for(var s in t){var o=t[s];n.isEqual(i[s],o)||(r[s]=o,e=!0)}return!!e&&r},previous:function(t){return null!=t&&this._previousAttributes?this._previousAttributes[t]:null},previousAttributes:function(){return n.clone(this._previousAttributes)},fetch:function(t){t=n.extend({parse:!0},t);var e=this,i=t.success;return t.success=function(n){var r=t.parse?e.parse(n,t):n;if(!e.set(r,t))return!1;i&&i.call(t.context,e,n,t),e.trigger("sync",e,n,t)},W(this,t),this.sync("read",this,t)},save:function(t,e,i){var r;null==t||"object"==typeof t?(r=t,i=e):(r={})[t]=e;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,l=this.attributes;i.success=function(t){o.attributes=l;var e=i.parse?o.parse(t,i):t;if(s&&(e=n.extend({},r,e)),e&&!o.set(e,i))return!1;a&&a.call(i.context,o,t,i),o.trigger("sync",o,t,i)},W(this,i),r&&s&&(this.attributes=n.extend({},l,r));var c=this.isNew()?"create":i.patch?"patch":"update";"patch"!==c||i.attrs||(i.attrs=r);var u=this.sync(c,this,i);return this.attributes=l,u},destroy:function(t){t=t?n.clone(t):{};var e=this,i=t.success,r=t.wait,s=function(){e.stopListening(),e.trigger("destroy",e,e.collection,t)};t.success=function(n){r&&s(),i&&i.call(t.context,e,n,t),e.isNew()||e.trigger("sync",e,n,t)};var o=!1;return this.isNew()?n.defer(t.success):(W(this,t),o=this.sync("delete",this,t)),r||s(),o},url:function(){var t=n.result(this,"urlRoot")||n.result(this.collection,"url")||F();if(this.isNew())return t;var e=this.get(this.idAttribute);return t.replace(/[^\/]$/,"$&/")+encodeURIComponent(e)},parse:function(t,e){return t},clone:function(){return new this.constructor(this.attributes)},isNew:function(){return!this.has(this.idAttribute)},isValid:function(t){return this._validate({},n.extend({},t,{validate:!0}))},_validate:function(t,e){if(!e.validate||!this.validate)return!0;t=n.extend({},this.attributes,t);var i=this.validationError=this.validate(t,e)||null;return!i||(this.trigger("invalid",this,i,n.extend(e,{validationError:i})),!1)}});var v=e.Collection=function(t,e){e||(e={}),this.preinitialize.apply(this,arguments),e.model&&(this.model=e.model),void 0!==e.comparator&&(this.comparator=e.comparator),this._reset(),this.initialize.apply(this,arguments),t&&this.reset(t,n.extend({silent:!0},e))},y={add:!0,remove:!0,merge:!0},b={add:!0,remove:!1},w=function(t,e,n){n=Math.min(Math.max(n,0),t.length);var i,r=Array(t.length-n),s=e.length;for(i=0;i<r.length;i++)r[i]=t[i+n];for(i=0;i<s;i++)t[i+n]=e[i];for(i=0;i<r.length;i++)t[i+s+n]=r[i]};n.extend(v.prototype,a,{model:m,preinitialize:function(){},initialize:function(){},toJSON:function(t){return this.map((function(e){return e.toJSON(t)}))},sync:function(){return e.sync.apply(this,arguments)},add:function(t,e){return this.set(t,n.extend({merge:!1},e,b))},remove:function(t,e){e=n.extend({},e);var i=!n.isArray(t);t=i?[t]:t.slice();var r=this._removeModels(t,e);return!e.silent&&r.length&&(e.changes={added:[],merged:[],removed:r},this.trigger("update",this,e)),i?r[0]:r},set:function(t,e){if(null!=t){(e=n.extend({},y,e)).parse&&!this._isModel(t)&&(t=this.parse(t,e)||[]);var i=!n.isArray(t);t=i?[t]:t.slice();var r=e.at;null!=r&&(r=+r),r>this.length&&(r=this.length),r<0&&(r+=this.length+1);var s,o,a=[],l=[],c=[],u=[],d={},h=e.add,_=e.merge,f=e.remove,p=!1,g=this.comparator&&null==r&&!1!==e.sort,m=n.isString(this.comparator)?this.comparator:null;for(o=0;o<t.length;o++){s=t[o];var v=this.get(s);if(v){if(_&&s!==v){var b=this._isModel(s)?s.attributes:s;e.parse&&(b=v.parse(b,e)),v.set(b,e),c.push(v),g&&!p&&(p=v.hasChanged(m))}d[v.cid]||(d[v.cid]=!0,a.push(v)),t[o]=v}else h&&(s=t[o]=this._prepareModel(s,e))&&(l.push(s),this._addReference(s,e),d[s.cid]=!0,a.push(s))}if(f){for(o=0;o<this.length;o++)d[(s=this.models[o]).cid]||u.push(s);u.length&&this._removeModels(u,e)}var x=!1,k=!g&&h&&f;if(a.length&&k?(x=this.length!==a.length||n.some(this.models,(function(t,e){return t!==a[e]})),this.models.length=0,w(this.models,a,0),this.length=this.models.length):l.length&&(g&&(p=!0),w(this.models,l,null==r?this.length:r),this.length=this.models.length),p&&this.sort({silent:!0}),!e.silent){for(o=0;o<l.length;o++)null!=r&&(e.index=r+o),(s=l[o]).trigger("add",s,this,e);(p||x)&&this.trigger("sort",this,e),(l.length||u.length||c.length)&&(e.changes={added:l,removed:u,merged:c},this.trigger("update",this,e))}return i?t[0]:t}},reset:function(t,e){e=e?n.clone(e):{};for(var i=0;i<this.models.length;i++)this._removeReference(this.models[i],e);return e.previousModels=this.models,this._reset(),t=this.add(t,n.extend({silent:!0},e)),e.silent||this.trigger("reset",this,e),t},push:function(t,e){return this.add(t,n.extend({at:this.length},e))},pop:function(t){var e=this.at(this.length-1);return this.remove(e,t)},unshift:function(t,e){return this.add(t,n.extend({at:0},e))},shift:function(t){var e=this.at(0);return this.remove(e,t)},slice:function(){return s.apply(this.models,arguments)},get:function(t){if(null!=t)return this._byId[t]||this._byId[this.modelId(this._isModel(t)?t.attributes:t)]||t.cid&&this._byId[t.cid]},has:function(t){return null!=this.get(t)},at:function(t){return t<0&&(t+=this.length),this.models[t]},where:function(t,e){return this[e?"find":"filter"](t)},findWhere:function(t){return this.where(t,!0)},sort:function(t){var e=this.comparator;if(!e)throw new Error("Cannot sort a set without a comparator");t||(t={});var i=e.length;return n.isFunction(e)&&(e=e.bind(this)),1===i||n.isString(e)?this.models=this.sortBy(e):this.models.sort(e),t.silent||this.trigger("sort",this,t),this},pluck:function(t){return this.map(t+"")},fetch:function(t){var e=(t=n.extend({parse:!0},t)).success,i=this;return t.success=function(n){var r=t.reset?"reset":"set";i[r](n,t),e&&e.call(t.context,i,n,t),i.trigger("sync",i,n,t)},W(this,t),this.sync("read",this,t)},create:function(t,e){var i=(e=e?n.clone(e):{}).wait;if(!(t=this._prepareModel(t,e)))return!1;i||this.add(t,e);var r=this,s=e.success;return e.success=function(t,e,n){i&&r.add(t,n),s&&s.call(n.context,t,e,n)},t.save(null,e),t},parse:function(t,e){return t},clone:function(){return new this.constructor(this.models,{model:this.model,comparator:this.comparator})},modelId:function(t){return t[this.model.prototype.idAttribute||"id"]},values:function(){return new k(this,E)},keys:function(){return new k(this,T)},entries:function(){return new k(this,C)},_reset:function(){this.length=0,this.models=[],this._byId={}},_prepareModel:function(t,e){if(this._isModel(t))return t.collection||(t.collection=this),t;(e=e?n.clone(e):{}).collection=this;var i=new this.model(t,e);return i.validationError?(this.trigger("invalid",this,i.validationError,e),!1):i},_removeModels:function(t,e){for(var n=[],i=0;i<t.length;i++){var r=this.get(t[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],e.silent||(e.index=s,r.trigger("remove",r,this,e)),n.push(r),this._removeReference(r,e)}}return n},_isModel:function(t){return t instanceof m},_addReference:function(t,e){this._byId[t.cid]=t;var n=this.modelId(t.attributes);null!=n&&(this._byId[n]=t),t.on("all",this._onModelEvent,this)},_removeReference:function(t,e){delete this._byId[t.cid];var n=this.modelId(t.attributes);null!=n&&delete this._byId[n],this===t.collection&&delete t.collection,t.off("all",this._onModelEvent,this)},_onModelEvent:function(t,e,n,i){if(e){if(("add"===t||"remove"===t)&&n!==this)return;if("destroy"===t&&this.remove(e,i),"change"===t){var r=this.modelId(e.previousAttributes()),s=this.modelId(e.attributes);r!==s&&(null!=r&&delete this._byId[r],null!=s&&(this._byId[s]=e))}}this.trigger.apply(this,arguments)}});var x="function"==typeof Symbol&&Symbol.iterator;x&&(v.prototype[x]=v.prototype.values);var k=function(t,e){this._collection=t,this._kind=e,this._index=0},E=1,T=2,C=3;x&&(k.prototype[x]=function(){return this}),k.prototype.next=function(){if(this._collection){if(this._index<this._collection.length){var t,e=this._collection.at(this._index);if(this._index++,this._kind===E)t=e;else{var n=this._collection.modelId(e.attributes);t=this._kind===T?n:[n,e]}return{value:t,done:!1}}this._collection=void 0}return{value:void 0,done:!0}};var j=e.View=function(t){this.cid=n.uniqueId("view"),this.preinitialize.apply(this,arguments),n.extend(this,n.pick(t,A)),this._ensureElement(),this.initialize.apply(this,arguments)},S=/^(\S+)\s*(.*)$/,A=["model","collection","el","id","attributes","className","tagName","events"];n.extend(j.prototype,a,{tagName:"div",$:function(t){return this.$el.find(t)},preinitialize:function(){},initialize:function(){},render:function(){return this},remove:function(){return this._removeElement(),this.stopListening(),this},_removeElement:function(){this.$el.remove()},setElement:function(t){return this.undelegateEvents(),this._setElement(t),this.delegateEvents(),this},_setElement:function(t){this.$el=t instanceof e.$?t:e.$(t),this.el=this.$el[0]},delegateEvents:function(t){if(t||(t=n.result(this,"events")),!t)return this;for(var e in this.undelegateEvents(),t){var i=t[e];if(n.isFunction(i)||(i=this[i]),i){var r=e.match(S);this.delegate(r[1],r[2],i.bind(this))}}return this},delegate:function(t,e,n){return this.$el.on(t+".delegateEvents"+this.cid,e,n),this},undelegateEvents:function(){return this.$el&&this.$el.off(".delegateEvents"+this.cid),this},undelegate:function(t,e,n){return this.$el.off(t+".delegateEvents"+this.cid,e,n),this},_createElement:function(t){return document.createElement(t)},_ensureElement:function(){if(this.el)this.setElement(n.result(this,"el"));else{var t=n.extend({},n.result(this,"attributes"));this.id&&(t.id=n.result(this,"id")),this.className&&(t.class=n.result(this,"className")),this.setElement(this._createElement(n.result(this,"tagName"))),this._setAttributes(t)}},_setAttributes:function(t){this.$el.attr(t)}});var N=function(t,e,i,r){n.each(i,(function(n,i){e[i]&&(t.prototype[i]=function(t,e,n,i){switch(e){case 1:return function(){return t[n](this[i])};case 2:return function(e){return t[n](this[i],e)};case 3:return function(e,r){return t[n](this[i],D(e,this),r)};case 4:return function(e,r,s){return t[n](this[i],D(e,this),r,s)};default:return function(){var e=s.call(arguments);return e.unshift(this[i]),t[n].apply(t,e)}}}(e,n,i,r))}))},D=function(t,e){return n.isFunction(t)?t:n.isObject(t)&&!e._isModel(t)?O(t):n.isString(t)?function(e){return e.get(t)}:t},O=function(t){var e=n.matches(t);return function(t){return e(t.attributes)}};n.each([[v,{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"],[m,{keys:1,values:1,pairs:1,invert:1,pick:0,omit:0,chain:1,isEmpty:1},"attributes"]],(function(t){var e=t[0],i=t[1],r=t[2];e.mixin=function(t){var i=n.reduce(n.functions(t),(function(t,e){return t[e]=0,t}),{});N(e,t,i,r)},N(e,n,i,r)})),e.sync=function(t,i,r){var s=I[t];n.defaults(r||(r={}),{emulateHTTP:e.emulateHTTP,emulateJSON:e.emulateJSON});var o={type:s,dataType:"json"};if(r.url||(o.url=n.result(i,"url")||F()),null!=r.data||!i||"create"!==t&&"update"!==t&&"patch"!==t||(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(t){if(t.setRequestHeader("X-HTTP-Method-Override",s),a)return a.apply(this,arguments)}}"GET"===o.type||r.emulateJSON||(o.processData=!1);var l=r.error;r.error=function(t,e,n){r.textStatus=e,r.errorThrown=n,l&&l.call(r.context,t,e,n)};var c=r.xhr=e.ajax(n.extend(o,r));return i.trigger("request",i,c,r),c};var I={create:"POST",update:"PUT",patch:"PATCH",delete:"DELETE",read:"GET"};e.ajax=function(){return e.$.ajax.apply(e.$,arguments)};var $=e.Router=function(t){t||(t={}),this.preinitialize.apply(this,arguments),t.routes&&(this.routes=t.routes),this._bindRoutes(),this.initialize.apply(this,arguments)},R=/\((.*?)\)/g,L=/(\(\?)?:\w+/g,M=/\*\w+/g,P=/[\-{}\[\]+?.,\\\^$|#\s]/g;n.extend($.prototype,a,{preinitialize:function(){},initialize:function(){},route:function(t,i,r){n.isRegExp(t)||(t=this._routeToRegExp(t)),n.isFunction(i)&&(r=i,i=""),r||(r=this[i]);var s=this;return e.history.route(t,(function(n){var o=s._extractParameters(t,n);!1!==s.execute(r,o,i)&&(s.trigger.apply(s,["route:"+i].concat(o)),s.trigger("route",i,o),e.history.trigger("route",s,i,o))})),this},execute:function(t,e,n){t&&t.apply(this,e)},navigate:function(t,n){return e.history.navigate(t,n),this},_bindRoutes:function(){if(this.routes){this.routes=n.result(this,"routes");for(var t,e=n.keys(this.routes);null!=(t=e.pop());)this.route(t,this.routes[t])}},_routeToRegExp:function(t){return t=t.replace(P,"\\$&").replace(R,"(?:$1)?").replace(L,(function(t,e){return e?t:"([^/?]+)"})).replace(M,"([^?]*?)"),new RegExp("^"+t+"(?:\\?([\\s\\S]*))?$")},_extractParameters:function(t,e){var i=t.exec(e).slice(1);return n.map(i,(function(t,e){return e===i.length-1?t||null:t?decodeURIComponent(t):null}))}});var q=e.History=function(){this.handlers=[],this.checkUrl=this.checkUrl.bind(this),"undefined"!=typeof window&&(this.location=window.location,this.history=window.history)},z=/^[#\/]|\s+$/g,H=/^\/+|\/+$/g,B=/#.*$/;q.started=!1,n.extend(q.prototype,a,{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(t){return decodeURI(t.replace(/%25/g,"%2525"))},getSearch:function(){var t=this.location.href.replace(/#.*/,"").match(/\?.+/);return t?t[0]:""},getHash:function(t){var e=(t||this).location.href.match(/#(.*)$/);return e?e[1]:""},getPath:function(){var t=this.decodeFragment(this.location.pathname+this.getSearch()).slice(this.root.length-1);return"/"===t.charAt(0)?t.slice(1):t},getFragment:function(t){return null==t&&(t=this._usePushState||!this._wantsHashChange?this.getPath():this.getHash()),t.replace(z,"")},start:function(t){if(q.started)throw new Error("Backbone.history has already been started");if(q.started=!0,this.options=n.extend({root:"/"},this.options,t),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(H,"/"),this._wantsHashChange&&this._wantsPushState){if(!this._hasPushState&&!this.atRoot()){var e=this.root.slice(0,-1)||"/";return this.location.replace(e+"#"+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(t,e){return attachEvent("on"+t,e)};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 t=window.removeEventListener||function(t,e){return detachEvent("on"+t,e)};this._usePushState?t("popstate",this.checkUrl,!1):this._useHashChange&&!this.iframe&&t("hashchange",this.checkUrl,!1),this.iframe&&(document.body.removeChild(this.iframe),this.iframe=null),this._checkUrlInterval&&clearInterval(this._checkUrlInterval),q.started=!1},route:function(t,e){this.handlers.unshift({route:t,callback:e})},checkUrl:function(t){var e=this.getFragment();if(e===this.fragment&&this.iframe&&(e=this.getHash(this.iframe.contentWindow)),e===this.fragment)return!1;this.iframe&&this.navigate(e),this.loadUrl()},loadUrl:function(t){return!!this.matchRoot()&&(t=this.fragment=this.getFragment(t),n.some(this.handlers,(function(e){if(e.route.test(t))return e.callback(t),!0})))},navigate:function(t,e){if(!q.started)return!1;e&&!0!==e||(e={trigger:!!e}),t=this.getFragment(t||"");var n=this.root;""!==t&&"?"!==t.charAt(0)||(n=n.slice(0,-1)||"/");var i=n+t;t=t.replace(B,"");var r=this.decodeFragment(t);if(this.fragment!==r){if(this.fragment=r,this._usePushState)this.history[e.replace?"replaceState":"pushState"]({},document.title,i);else{if(!this._wantsHashChange)return this.location.assign(i);if(this._updateHash(this.location,t,e.replace),this.iframe&&t!==this.getHash(this.iframe.contentWindow)){var s=this.iframe.contentWindow;e.replace||(s.document.open(),s.document.close()),this._updateHash(s.location,t,e.replace)}}return e.trigger?this.loadUrl(t):void 0}},_updateHash:function(t,e,n){if(n){var i=t.href.replace(/(javascript:|#).*$/,"");t.replace(i+"#"+e)}else t.hash="#"+e}}),e.history=new q,m.extend=v.extend=$.extend=j.extend=q.extend=function(t,e){var i,r=this;return i=t&&n.has(t,"constructor")?t.constructor:function(){return r.apply(this,arguments)},n.extend(i,r,e),i.prototype=n.create(r.prototype,t),i.prototype.constructor=i,i.__super__=r.prototype,i};var F=function(){throw new Error('A "url" property or function must be specified')},W=function(t,e){var n=e.error;e.error=function(i){n&&n.call(e.context,t,i,e),t.trigger("error",t,i,e)}};return e}(o,n,t,e)}.apply(e,r))||(t.exports=s)}).call(this,n(21))},function(t,e,n){"use strict";n.r(e),n.d(e,"default",(function(){return s})),n.d(e,"VERSION",(function(){return i.VERSION})),n.d(e,"iteratee",(function(){return i.iteratee})),n.d(e,"restArguments",(function(){return i.restArguments})),n.d(e,"each",(function(){return i.each})),n.d(e,"forEach",(function(){return i.forEach})),n.d(e,"map",(function(){return i.map})),n.d(e,"collect",(function(){return i.collect})),n.d(e,"reduce",(function(){return i.reduce})),n.d(e,"foldl",(function(){return i.foldl})),n.d(e,"inject",(function(){return i.inject})),n.d(e,"reduceRight",(function(){return i.reduceRight})),n.d(e,"foldr",(function(){return i.foldr})),n.d(e,"find",(function(){return i.find})),n.d(e,"detect",(function(){return i.detect})),n.d(e,"filter",(function(){return i.filter})),n.d(e,"select",(function(){return i.select})),n.d(e,"reject",(function(){return i.reject})),n.d(e,"every",(function(){return i.every})),n.d(e,"all",(function(){return i.all})),n.d(e,"some",(function(){return i.some})),n.d(e,"any",(function(){return i.any})),n.d(e,"contains",(function(){return i.contains})),n.d(e,"includes",(function(){return i.includes})),n.d(e,"include",(function(){return i.include})),n.d(e,"invoke",(function(){return i.invoke})),n.d(e,"pluck",(function(){return i.pluck})),n.d(e,"where",(function(){return i.where})),n.d(e,"findWhere",(function(){return i.findWhere})),n.d(e,"max",(function(){return i.max})),n.d(e,"min",(function(){return i.min})),n.d(e,"shuffle",(function(){return i.shuffle})),n.d(e,"sample",(function(){return i.sample})),n.d(e,"sortBy",(function(){return i.sortBy})),n.d(e,"groupBy",(function(){return i.groupBy})),n.d(e,"indexBy",(function(){return i.indexBy})),n.d(e,"countBy",(function(){return i.countBy})),n.d(e,"toArray",(function(){return i.toArray})),n.d(e,"size",(function(){return i.size})),n.d(e,"partition",(function(){return i.partition})),n.d(e,"first",(function(){return i.first})),n.d(e,"head",(function(){return i.head})),n.d(e,"take",(function(){return i.take})),n.d(e,"initial",(function(){return i.initial})),n.d(e,"last",(function(){return i.last})),n.d(e,"rest",(function(){return i.rest})),n.d(e,"tail",(function(){return i.tail})),n.d(e,"drop",(function(){return i.drop})),n.d(e,"compact",(function(){return i.compact})),n.d(e,"flatten",(function(){return i.flatten})),n.d(e,"without",(function(){return i.without})),n.d(e,"uniq",(function(){return i.uniq})),n.d(e,"unique",(function(){return i.unique})),n.d(e,"union",(function(){return i.union})),n.d(e,"intersection",(function(){return i.intersection})),n.d(e,"difference",(function(){return i.difference})),n.d(e,"unzip",(function(){return i.unzip})),n.d(e,"zip",(function(){return i.zip})),n.d(e,"object",(function(){return i.object})),n.d(e,"findIndex",(function(){return i.findIndex})),n.d(e,"findLastIndex",(function(){return i.findLastIndex})),n.d(e,"sortedIndex",(function(){return i.sortedIndex})),n.d(e,"indexOf",(function(){return i.indexOf})),n.d(e,"lastIndexOf",(function(){return i.lastIndexOf})),n.d(e,"range",(function(){return i.range})),n.d(e,"chunk",(function(){return i.chunk})),n.d(e,"bind",(function(){return i.bind})),n.d(e,"partial",(function(){return i.partial})),n.d(e,"bindAll",(function(){return i.bindAll})),n.d(e,"memoize",(function(){return i.memoize})),n.d(e,"delay",(function(){return i.delay})),n.d(e,"defer",(function(){return i.defer})),n.d(e,"throttle",(function(){return i.throttle})),n.d(e,"debounce",(function(){return i.debounce})),n.d(e,"wrap",(function(){return i.wrap})),n.d(e,"negate",(function(){return i.negate})),n.d(e,"compose",(function(){return i.compose})),n.d(e,"after",(function(){return i.after})),n.d(e,"before",(function(){return i.before})),n.d(e,"once",(function(){return i.once})),n.d(e,"keys",(function(){return i.keys})),n.d(e,"allKeys",(function(){return i.allKeys})),n.d(e,"values",(function(){return i.values})),n.d(e,"mapObject",(function(){return i.mapObject})),n.d(e,"pairs",(function(){return i.pairs})),n.d(e,"invert",(function(){return i.invert})),n.d(e,"functions",(function(){return i.functions})),n.d(e,"methods",(function(){return i.methods})),n.d(e,"extend",(function(){return i.extend})),n.d(e,"extendOwn",(function(){return i.extendOwn})),n.d(e,"assign",(function(){return i.assign})),n.d(e,"findKey",(function(){return i.findKey})),n.d(e,"pick",(function(){return i.pick})),n.d(e,"omit",(function(){return i.omit})),n.d(e,"defaults",(function(){return i.defaults})),n.d(e,"create",(function(){return i.create})),n.d(e,"clone",(function(){return i.clone})),n.d(e,"tap",(function(){return i.tap})),n.d(e,"isMatch",(function(){return i.isMatch})),n.d(e,"isEqual",(function(){return i.isEqual})),n.d(e,"isEmpty",(function(){return i.isEmpty})),n.d(e,"isElement",(function(){return i.isElement})),n.d(e,"isArray",(function(){return i.isArray})),n.d(e,"isObject",(function(){return i.isObject})),n.d(e,"isArguments",(function(){return i.isArguments})),n.d(e,"isFunction",(function(){return i.isFunction})),n.d(e,"isString",(function(){return i.isString})),n.d(e,"isNumber",(function(){return i.isNumber})),n.d(e,"isDate",(function(){return i.isDate})),n.d(e,"isRegExp",(function(){return i.isRegExp})),n.d(e,"isError",(function(){return i.isError})),n.d(e,"isSymbol",(function(){return i.isSymbol})),n.d(e,"isMap",(function(){return i.isMap})),n.d(e,"isWeakMap",(function(){return i.isWeakMap})),n.d(e,"isSet",(function(){return i.isSet})),n.d(e,"isWeakSet",(function(){return i.isWeakSet})),n.d(e,"isFinite",(function(){return i.isFinite})),n.d(e,"isNaN",(function(){return i.isNaN})),n.d(e,"isBoolean",(function(){return i.isBoolean})),n.d(e,"isNull",(function(){return i.isNull})),n.d(e,"isUndefined",(function(){return i.isUndefined})),n.d(e,"has",(function(){return i.has})),n.d(e,"identity",(function(){return i.identity})),n.d(e,"constant",(function(){return i.constant})),n.d(e,"noop",(function(){return i.noop})),n.d(e,"property",(function(){return i.property})),n.d(e,"propertyOf",(function(){return i.propertyOf})),n.d(e,"matcher",(function(){return i.matcher})),n.d(e,"matches",(function(){return i.matches})),n.d(e,"times",(function(){return i.times})),n.d(e,"random",(function(){return i.random})),n.d(e,"now",(function(){return i.now})),n.d(e,"escape",(function(){return i.escape})),n.d(e,"unescape",(function(){return i.unescape})),n.d(e,"result",(function(){return i.result})),n.d(e,"uniqueId",(function(){return i.uniqueId})),n.d(e,"templateSettings",(function(){return i.templateSettings})),n.d(e,"template",(function(){return i.template})),n.d(e,"chain",(function(){return i.chain})),n.d(e,"mixin",(function(){return i.mixin}));var i=n(10),r=Object(i.mixin)(i);r._=r;var s=r},function(t,e,n){"use strict";n.d(e,"l",(function(){return s})),n.d(e,"f",(function(){return o})),n.d(e,"h",(function(){return a})),n.d(e,"e",(function(){return l})),n.d(e,"a",(function(){return c})),n.d(e,"g",(function(){return u})),n.d(e,"i",(function(){return d})),n.d(e,"k",(function(){return h})),n.d(e,"j",(function(){return _})),n.d(e,"b",(function(){return f})),n.d(e,"d",(function(){return p})),n.d(e,"c",(function(){return g}));var i=n(2),r=n(1);let s=i.default.clone(r.Events),o="parent_changed",a="selection_changed",l="page_selection_changed",c="browser_refresh",u="permission_changed",d="select_all",h="select_folders",_="select_documents",f="deselect",p="invert_selection",g="document_image_loaded"},function(t,e,n){"use strict";n.d(e,"b",(function(){return i})),n.d(e,"f",(function(){return r})),n.d(e,"e",(function(){return s})),n.d(e,"a",(function(){return o})),n.d(e,"d",(function(){return a})),n.d(e,"c",(function(){return l}));n(0);function i(t){return t.charAt(0).toUpperCase()+t.slice(1)}function r(t){return t.replace(/[&<>'"]/g,t=>({"&":"&amp;","<":"&lt;",">":"&gt;","'":"&#39;",'"':"&quot;"}[t]))}function s(t){var e=["B","KB","MB","GB","TB"],n="";if(t){for(var i=t,r=0;i>1;i/=1024,r++)n=i.toFixed(1)+" "+e[r];return n}console.log("Invalid bytes count provided")}String.prototype.format=function(){var t=0,e=arguments;return this.replace(/{}/g,(function(){return void 0!==e[t]?e[t++]:""}))},[Element.prototype,CharacterData.prototype,DocumentType.prototype].forEach((function(t){t.hasOwnProperty("remove")||Object.defineProperty(t,"remove",{configurable:!0,enumerable:!0,writable:!0,value:function(){null!==this.parentNode&&this.parentNode.removeChild(this)}})})),Array.prototype.includes||Object.defineProperty(Array.prototype,"includes",{value:function(t,e){if(null==this)throw new TypeError('"this" is null or not defined');var n=Object(this),i=n.length>>>0;if(0===i)return!1;var r,s,o=0|e,a=Math.max(o>=0?o:i-Math.abs(o),0);for(;a<i;){if((r=n[a])===(s=t)||"number"==typeof r&&"number"==typeof s&&isNaN(r)&&isNaN(s))return!0;a++}return!1}});class o{constructor(t,e,n,i){this.x=t,this.y=e,this.width=parseInt(n),this.height=parseInt(i)}intersect(t){return!!this.contains_point(t.x,t.y)||(!!this.contains_point(t.x+t.width,t.y)||(!!this.contains_point(t.x+t.width,t.y+t.height)||!!this.contains_point(t.x,t.y+t.height)))}contains_point(t,e){let n=!1,i=!1;return this.x<=t&&t<=this.x+this.width&&(n=!0),this.y<=e&&e<=this.y+this.height&&(i=!0),n&&i}}function a(t){var e,n,i=window.location.search.substring(1).split("&");for(n=0;n<i.length;n++)if((e=i[n].split("="))[0]===t)return void 0===e[1]||decodeURIComponent(e[1])}function l(t){var e,n,i,r=window.location.hash;if(r&&r.split("?").length>1)for(e=r.split("?")[1].split("&"),i=0;i<e.length;i++)if((n=e[i].split("="))[0]===t)return void 0===n[1]||decodeURIComponent(n[1])}},function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));var i=n(0),r=n.n(i),s=n(2),o=n(1);let a=n(26);class l extends o.View{el(){return r()("#messages")}initialize(t,e){this.title=t,this.message=e,this.render()}render(){let t,e;e={},t=s.default.template(a({title:this.title,message:this.message})),this.$el.html(t)}}},function(t,e,n){"use strict";(function(t){n.d(e,"b",(function(){return o})),n.d(e,"c",(function(){return a})),n.d(e,"a",(function(){return l}));var i=n(2),r=n(1),s=n(5);class o extends r.Model{urlRoot(){return"/tag-node/"}modelId(){return this.get("name")}toJSON(){return{name:this.get("name")}}}class a extends r.Collection{get model(){return o}initialize(t,e){e&&(e.node?this.node=e.node:e.nodes&&(this.nodes=e.nodes))}urlRoot(){return this.node?`/node/${this.node.id}/tags/`:this.nodes?"/nodes/tags/":void 0}comma_sep_tags(){let t="";for(let e=0;e<this.models.length;e++)t+=this.models[e].get("name")+", ";return t}remove(t){for(var e=0;e<this.models.length;e++)if(this.models[e].get("name")==t.get("name")){this.models.splice(e,1),this.length--;break}}save(e){let n,r,o,a,l=[];n=t("[name=csrfmiddlewaretoken]").val(),o=this.models.map((function(t){return t.attributes})),this.node?l=[node.id]:this.nodes&&(l=i.default.map(this.nodes,(function(t){return t.id}))),a={tags:o,nodes:l},t.ajaxSetup({headers:{"X-CSRFToken":n}}),r=t.ajax({method:"POST",url:this.urlRoot(),data:JSON.stringify(a),contentType:"application/json",dataType:"json",error:function(t,e,n){new s.a("Error",t.responseJSON.msg)}}),r.done(e.success)}}class l extends r.Collection{get model(){return o}parse(t){return t.tags}}}).call(this,n(0))},function(t,e,n){"use strict";n.d(e,"a",(function(){return c})),n.d(e,"b",(function(){return u}));var i=n(2),r=n(0),s=n.n(r),o=n(1),a=n(5),l=n(14);class c extends o.Model{defaults(){return{title:"",parent_id:"",ctype:"",kvstore:"",selected:!1,img_src:"",created_at:"",user_perms:{},tags:[],parts:[],metadata:[]}}initialize(t){}urlRoot(){return"/node/"}toJSON(){return{id:this.get("id"),parent_id:this.get("parent_id"),title:this.get("title"),created_at:this.get("created_at"),tags:this.get("tags"),parts:this.get("parts"),metadata:this.get("metadata")}}get url(){return this.is_document()?this.get("document_url"):"/#"+this.get("id")}full_title(){return this.get("title")}full_title_list_mode(){let t,e,n=this.get("tags");e='<ul class="d-flex flex-row align-items-center">',e+=`<li class="mx-2">${this.get("title")}</li>`;for(let i=0;i<n.length;i++)t=n[i],t&&(e+='<li class="tag"  style="background:  '+t.bg_color,e+=`;color: ${t.fg_color}" >`,e+=t.name,e+="</li>");return e+="</ul>",e}short_title(t){let e,n=this.get("title");return e=n&&n.length>t?n.substring(0,t)+"...":n,e}select(){let t;this.set({selected:!0}),t=s()(`.node[data-cid=${this.cid}]`),t.addClass("checked"),t.find("input[type=checkbox]").prop("checked",!0)}deselect(){let t;this.set({selected:!1}),t=s()(`.node[data-cid=${this.cid}]`),t.removeClass("checked"),t.find("input[type=checkbox]").prop("checked",!1)}toggle_selection(){let t;t=this.get("selected"),this.set({selected:!t}),t?s()(`.node[data-cid=${this.cid}]`).removeClass("checked"):s()(`.node[data-cid=${this.cid}]`).addClass("checked")}is_document(){return"document"==this.get("ctype")}is_folder(){return"folder"==this.get("ctype")}find_page_kvstore_for(t){let e,n,r,s;if(!this.is_folder())return e=this.get("pages"),e&&(r=e[0],n=r.kvstore,n&&(s=i.default.findIndex(n,(function(e){return e.key==t})),s>=0))?n[s]:void 0}get_page_value_for(t){let e;return e=this.find_page_kvstore_for(t),e?e.value:""}get_page_virtual_value_for(t){let e;return e=this.find_page_kvstore_for(t),e?e.virtual_value:""}is_readonly(){let t,e=this.get("user_perms");return t=e.read,t=t&&!e.write,t=t&&!e.delete,t=t&&!e.change_perm,t=t&&!e.take_ownership,t}}class u extends o.Collection{get model(){return c}urlRoot(){return"/nodes/"}collection_post_action(t,e,n){let i,r,o;i=s()("[name=csrfmiddlewaretoken]").val(),r=this.models.map((function(t){return t.attributes})),n&&(r={...r,...n}),s.a.ajaxSetup({headers:{"X-CSRFToken":i}}),o=s.a.ajax({method:"POST",url:t,data:JSON.stringify(r),contentType:"application/json",dataType:"json",error:function(t,e,n){new a.a("Error",t.responseJSON.msg)}}),o.done(e.success)}delete(t){this.collection_post_action(this.urlRoot(),t)}download(t){let e,n=[];n=this.models.map((function(t){return t.get("id")})),e=new l.a("/nodes/download/",n),e.download()}cut(t){this.collection_post_action("/cut-node/",t)}run_ocr(t){let e,n,i,r,o={};e=s()("[name=csrfmiddlewaretoken]").val(),i=this.models.map((function(t){return t.get("id")})),r=s()("#lang").val(),o.document_ids=i,o.lang=r,s.a.ajaxSetup({headers:{"X-CSRFToken":e}}),n=s.a.ajax({method:"POST",url:"/run-ocr/",data:JSON.stringify(o),contentType:"application/json",dataType:"json"}),n.done((function(t,e,n){new a.a("success",t.msg)})),n.fail((function(t,e,n){new a.a("error",t.msg||gettext("Error while starting OCR process."))}))}_paste(t,e,n){let i,r;i=s()("[name=csrfmiddlewaretoken]").val(),s.a.ajaxSetup({headers:{"X-CSRFToken":i}}),r=s.a.ajax({method:"POST",url:t,data:JSON.stringify({parent_id:n}),contentType:"application/json",dataType:"json"}),r.done(e.success)}paste(t,e){this._paste("/paste-node/",t,e)}paste_pages(t,e){this._paste("/paste-pages/",t,e)}dynamic_sort_by(t,e){this.comparator=function(t,e){let n,i,r,s=1;return"desc"==e&&(s=-1),n=function(e,n){return"type"==t?t="ctype":"date"==t&&(t="timestamp"),i=e.get(t),r=n.get(t),"string"==typeof i&&(i=i.toUpperCase()),"string"==typeof r&&(r=r.toUpperCase()),i<r?-1*s:i>r?1*s:0},n}(t,e),this.sort()}}},function(t,e,n){"use strict";function i(t){let e,n=t.getBoundingClientRect(),i=!1,r=!1,s=!1;return n.top>=0&&n.top<window.innerHeight&&(i=!0),n.bottom>=0&&n.bottom<=window.innerHeight&&(r=!0),n.top<=0&&n.bottom>=window.innerHeight&&(s=!0),e=i||r||s,i||r||s}function r(t,e,n=""){let i,r=document.createElement(t);for(let t in e)r.setAttribute(t,e[t]);return n&&n.length>0&&(i=document.createTextNode(n),r.appendChild(i)),r}n.d(e,"b",(function(){return i})),n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));class i{constructor(){this._events={}}subscribe(t,e,n){let i={handler:e,context:n};this._events[t]?this._events[t].push(i):this._events[t]=[i]}notify(t,...e){let n=this._events[t];if(n)for(let t of n)t.handler.apply(t.context,e)}}},function(t,e,n){"use strict";n.r(e),function(t){n.d(e,"default",(function(){return m})),n.d(e,"VERSION",(function(){return v})),n.d(e,"iteratee",(function(){return w})),n.d(e,"restArguments",(function(){return k})),n.d(e,"each",(function(){return D})),n.d(e,"forEach",(function(){return D})),n.d(e,"map",(function(){return O})),n.d(e,"collect",(function(){return O})),n.d(e,"reduce",(function(){return $})),n.d(e,"foldl",(function(){return $})),n.d(e,"inject",(function(){return $})),n.d(e,"reduceRight",(function(){return R})),n.d(e,"foldr",(function(){return R})),n.d(e,"find",(function(){return L})),n.d(e,"detect",(function(){return L})),n.d(e,"filter",(function(){return M})),n.d(e,"select",(function(){return M})),n.d(e,"reject",(function(){return P})),n.d(e,"every",(function(){return q})),n.d(e,"all",(function(){return q})),n.d(e,"some",(function(){return z})),n.d(e,"any",(function(){return z})),n.d(e,"contains",(function(){return H})),n.d(e,"includes",(function(){return H})),n.d(e,"include",(function(){return H})),n.d(e,"invoke",(function(){return B})),n.d(e,"pluck",(function(){return F})),n.d(e,"where",(function(){return W})),n.d(e,"findWhere",(function(){return U})),n.d(e,"max",(function(){return V})),n.d(e,"min",(function(){return J})),n.d(e,"shuffle",(function(){return X})),n.d(e,"sample",(function(){return K})),n.d(e,"sortBy",(function(){return G})),n.d(e,"groupBy",(function(){return Q})),n.d(e,"indexBy",(function(){return Z})),n.d(e,"countBy",(function(){return tt})),n.d(e,"toArray",(function(){return nt})),n.d(e,"size",(function(){return it})),n.d(e,"partition",(function(){return rt})),n.d(e,"first",(function(){return st})),n.d(e,"head",(function(){return st})),n.d(e,"take",(function(){return st})),n.d(e,"initial",(function(){return ot})),n.d(e,"last",(function(){return at})),n.d(e,"rest",(function(){return lt})),n.d(e,"tail",(function(){return lt})),n.d(e,"drop",(function(){return lt})),n.d(e,"compact",(function(){return ct})),n.d(e,"flatten",(function(){return dt})),n.d(e,"without",(function(){return ht})),n.d(e,"uniq",(function(){return _t})),n.d(e,"unique",(function(){return _t})),n.d(e,"union",(function(){return ft})),n.d(e,"intersection",(function(){return pt})),n.d(e,"difference",(function(){return gt})),n.d(e,"unzip",(function(){return mt})),n.d(e,"zip",(function(){return vt})),n.d(e,"object",(function(){return yt})),n.d(e,"findIndex",(function(){return wt})),n.d(e,"findLastIndex",(function(){return xt})),n.d(e,"sortedIndex",(function(){return kt})),n.d(e,"indexOf",(function(){return Tt})),n.d(e,"lastIndexOf",(function(){return Ct})),n.d(e,"range",(function(){return jt})),n.d(e,"chunk",(function(){return St})),n.d(e,"bind",(function(){return Nt})),n.d(e,"partial",(function(){return Dt})),n.d(e,"bindAll",(function(){return Ot})),n.d(e,"memoize",(function(){return It})),n.d(e,"delay",(function(){return $t})),n.d(e,"defer",(function(){return Rt})),n.d(e,"throttle",(function(){return Lt})),n.d(e,"debounce",(function(){return Mt})),n.d(e,"wrap",(function(){return Pt})),n.d(e,"negate",(function(){return qt})),n.d(e,"compose",(function(){return zt})),n.d(e,"after",(function(){return Ht})),n.d(e,"before",(function(){return Bt})),n.d(e,"once",(function(){return Ft})),n.d(e,"keys",(function(){return Jt})),n.d(e,"allKeys",(function(){return Xt})),n.d(e,"values",(function(){return Kt})),n.d(e,"mapObject",(function(){return Gt})),n.d(e,"pairs",(function(){return Yt})),n.d(e,"invert",(function(){return Qt})),n.d(e,"functions",(function(){return Zt})),n.d(e,"methods",(function(){return Zt})),n.d(e,"extend",(function(){return ee})),n.d(e,"extendOwn",(function(){return ne})),n.d(e,"assign",(function(){return ne})),n.d(e,"findKey",(function(){return ie})),n.d(e,"pick",(function(){return se})),n.d(e,"omit",(function(){return oe})),n.d(e,"defaults",(function(){return ae})),n.d(e,"create",(function(){return le})),n.d(e,"clone",(function(){return ce})),n.d(e,"tap",(function(){return ue})),n.d(e,"isMatch",(function(){return de})),n.d(e,"isEqual",(function(){return _e})),n.d(e,"isEmpty",(function(){return fe})),n.d(e,"isElement",(function(){return pe})),n.d(e,"isArray",(function(){return me})),n.d(e,"isObject",(function(){return ve})),n.d(e,"isArguments",(function(){return ye})),n.d(e,"isFunction",(function(){return be})),n.d(e,"isString",(function(){return we})),n.d(e,"isNumber",(function(){return xe})),n.d(e,"isDate",(function(){return ke})),n.d(e,"isRegExp",(function(){return Ee})),n.d(e,"isError",(function(){return Te})),n.d(e,"isSymbol",(function(){return Ce})),n.d(e,"isMap",(function(){return je})),n.d(e,"isWeakMap",(function(){return Se})),n.d(e,"isSet",(function(){return Ae})),n.d(e,"isWeakSet",(function(){return Ne})),n.d(e,"isFinite",(function(){return Oe})),n.d(e,"isNaN",(function(){return Ie})),n.d(e,"isBoolean",(function(){return $e})),n.d(e,"isNull",(function(){return Re})),n.d(e,"isUndefined",(function(){return Le})),n.d(e,"has",(function(){return Me})),n.d(e,"identity",(function(){return Pe})),n.d(e,"constant",(function(){return qe})),n.d(e,"noop",(function(){return ze})),n.d(e,"property",(function(){return He})),n.d(e,"propertyOf",(function(){return Be})),n.d(e,"matcher",(function(){return Fe})),n.d(e,"matches",(function(){return Fe})),n.d(e,"times",(function(){return We})),n.d(e,"random",(function(){return Ue})),n.d(e,"now",(function(){return Ve})),n.d(e,"escape",(function(){return Ge})),n.d(e,"unescape",(function(){return Ye})),n.d(e,"result",(function(){return Qe})),n.d(e,"uniqueId",(function(){return tn})),n.d(e,"templateSettings",(function(){return en})),n.d(e,"template",(function(){return an})),n.d(e,"chain",(function(){return ln})),n.d(e,"mixin",(function(){return un}));var i="object"==typeof self&&self.self===self&&self||"object"==typeof t&&t.global===t&&t||Function("return this")()||{},r=Array.prototype,s=Object.prototype,o="undefined"!=typeof Symbol?Symbol.prototype:null,a=r.push,l=r.slice,c=s.toString,u=s.hasOwnProperty,d=Array.isArray,h=Object.keys,_=Object.create,f=i.isNaN,p=i.isFinite,g=function(){};function m(t){return t instanceof m?t:this instanceof m?void(this._wrapped=t):new m(t)}var v=m.VERSION="1.10.2";function y(t,e,n){if(void 0===e)return t;switch(null==n?3:n){case 1:return function(n){return t.call(e,n)};case 3:return function(n,i,r){return t.call(e,n,i,r)};case 4:return function(n,i,r,s){return t.call(e,n,i,r,s)}}return function(){return t.apply(e,arguments)}}function b(t,e,n){return null==t?Pe:be(t)?y(t,e,n):ve(t)&&!me(t)?Fe(t):He(t)}function w(t,e){return b(t,e,1/0)}function x(t,e,n){return m.iteratee!==w?m.iteratee(t,e):b(t,e,n)}function k(t,e){return e=null==e?t.length-1:+e,function(){for(var n=Math.max(arguments.length-e,0),i=Array(n),r=0;r<n;r++)i[r]=arguments[r+e];switch(e){case 0:return t.call(this,i);case 1:return t.call(this,arguments[0],i);case 2:return t.call(this,arguments[0],arguments[1],i)}var s=Array(e+1);for(r=0;r<e;r++)s[r]=arguments[r];return s[e]=i,t.apply(this,s)}}function E(t){if(!ve(t))return{};if(_)return _(t);g.prototype=t;var e=new g;return g.prototype=null,e}function T(t){return function(e){return null==e?void 0:e[t]}}function C(t,e){return null!=t&&u.call(t,e)}function j(t,e){for(var n=e.length,i=0;i<n;i++){if(null==t)return;t=t[e[i]]}return n?t:void 0}m.iteratee=w;var S=Math.pow(2,53)-1,A=T("length");function N(t){var e=A(t);return"number"==typeof e&&e>=0&&e<=S}function D(t,e,n){var i,r;if(e=y(e,n),N(t))for(i=0,r=t.length;i<r;i++)e(t[i],i,t);else{var s=Jt(t);for(i=0,r=s.length;i<r;i++)e(t[s[i]],s[i],t)}return t}function O(t,e,n){e=x(e,n);for(var i=!N(t)&&Jt(t),r=(i||t).length,s=Array(r),o=0;o<r;o++){var a=i?i[o]:o;s[o]=e(t[a],a,t)}return s}function I(t){var e=function(e,n,i,r){var s=!N(e)&&Jt(e),o=(s||e).length,a=t>0?0:o-1;for(r||(i=e[s?s[a]:a],a+=t);a>=0&&a<o;a+=t){var l=s?s[a]:a;i=n(i,e[l],l,e)}return i};return function(t,n,i,r){var s=arguments.length>=3;return e(t,y(n,r,4),i,s)}}var $=I(1),R=I(-1);function L(t,e,n){var i=(N(t)?wt:ie)(t,e,n);if(void 0!==i&&-1!==i)return t[i]}function M(t,e,n){var i=[];return e=x(e,n),D(t,(function(t,n,r){e(t,n,r)&&i.push(t)})),i}function P(t,e,n){return M(t,qt(x(e)),n)}function q(t,e,n){e=x(e,n);for(var i=!N(t)&&Jt(t),r=(i||t).length,s=0;s<r;s++){var o=i?i[s]:s;if(!e(t[o],o,t))return!1}return!0}function z(t,e,n){e=x(e,n);for(var i=!N(t)&&Jt(t),r=(i||t).length,s=0;s<r;s++){var o=i?i[s]:s;if(e(t[o],o,t))return!0}return!1}function H(t,e,n,i){return N(t)||(t=Kt(t)),("number"!=typeof n||i)&&(n=0),Tt(t,e,n)>=0}var B=k((function(t,e,n){var i,r;return be(e)?r=e:me(e)&&(i=e.slice(0,-1),e=e[e.length-1]),O(t,(function(t){var s=r;if(!s){if(i&&i.length&&(t=j(t,i)),null==t)return;s=t[e]}return null==s?s:s.apply(t,n)}))}));function F(t,e){return O(t,He(e))}function W(t,e){return M(t,Fe(e))}function U(t,e){return L(t,Fe(e))}function V(t,e,n){var i,r,s=-1/0,o=-1/0;if(null==e||"number"==typeof e&&"object"!=typeof t[0]&&null!=t)for(var a=0,l=(t=N(t)?t:Kt(t)).length;a<l;a++)null!=(i=t[a])&&i>s&&(s=i);else e=x(e,n),D(t,(function(t,n,i){((r=e(t,n,i))>o||r===-1/0&&s===-1/0)&&(s=t,o=r)}));return s}function J(t,e,n){var i,r,s=1/0,o=1/0;if(null==e||"number"==typeof e&&"object"!=typeof t[0]&&null!=t)for(var a=0,l=(t=N(t)?t:Kt(t)).length;a<l;a++)null!=(i=t[a])&&i<s&&(s=i);else e=x(e,n),D(t,(function(t,n,i){((r=e(t,n,i))<o||r===1/0&&s===1/0)&&(s=t,o=r)}));return s}function X(t){return K(t,1/0)}function K(t,e,n){if(null==e||n)return N(t)||(t=Kt(t)),t[Ue(t.length-1)];var i=N(t)?ce(t):Kt(t),r=A(i);e=Math.max(Math.min(e,r),0);for(var s=r-1,o=0;o<e;o++){var a=Ue(o,s),l=i[o];i[o]=i[a],i[a]=l}return i.slice(0,e)}function G(t,e,n){var i=0;return e=x(e,n),F(O(t,(function(t,n,r){return{value:t,index:i++,criteria:e(t,n,r)}})).sort((function(t,e){var n=t.criteria,i=e.criteria;if(n!==i){if(n>i||void 0===n)return 1;if(n<i||void 0===i)return-1}return t.index-e.index})),"value")}function Y(t,e){return function(n,i,r){var s=e?[[],[]]:{};return i=x(i,r),D(n,(function(e,r){var o=i(e,r,n);t(s,e,o)})),s}}var Q=Y((function(t,e,n){C(t,n)?t[n].push(e):t[n]=[e]})),Z=Y((function(t,e,n){t[n]=e})),tt=Y((function(t,e,n){C(t,n)?t[n]++:t[n]=1})),et=/[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g;function nt(t){return t?me(t)?l.call(t):we(t)?t.match(et):N(t)?O(t,Pe):Kt(t):[]}function it(t){return null==t?0:N(t)?t.length:Jt(t).length}var rt=Y((function(t,e,n){t[n?0:1].push(e)}),!0);function st(t,e,n){return null==t||t.length<1?null==e?void 0:[]:null==e||n?t[0]:ot(t,t.length-e)}function ot(t,e,n){return l.call(t,0,Math.max(0,t.length-(null==e||n?1:e)))}function at(t,e,n){return null==t||t.length<1?null==e?void 0:[]:null==e||n?t[t.length-1]:lt(t,Math.max(0,t.length-e))}function lt(t,e,n){return l.call(t,null==e||n?1:e)}function ct(t){return M(t,Boolean)}function ut(t,e,n,i){for(var r=(i=i||[]).length,s=0,o=A(t);s<o;s++){var a=t[s];if(N(a)&&(me(a)||ye(a)))if(e)for(var l=0,c=a.length;l<c;)i[r++]=a[l++];else ut(a,e,n,i),r=i.length;else n||(i[r++]=a)}return i}function dt(t,e){return ut(t,e,!1)}var ht=k((function(t,e){return gt(t,e)}));function _t(t,e,n,i){$e(e)||(i=n,n=e,e=!1),null!=n&&(n=x(n,i));for(var r=[],s=[],o=0,a=A(t);o<a;o++){var l=t[o],c=n?n(l,o,t):l;e&&!n?(o&&s===c||r.push(l),s=c):n?H(s,c)||(s.push(c),r.push(l)):H(r,l)||r.push(l)}return r}var ft=k((function(t){return _t(ut(t,!0,!0))}));function pt(t){for(var e=[],n=arguments.length,i=0,r=A(t);i<r;i++){var s=t[i];if(!H(e,s)){var o;for(o=1;o<n&&H(arguments[o],s);o++);o===n&&e.push(s)}}return e}var gt=k((function(t,e){return e=ut(e,!0,!0),M(t,(function(t){return!H(e,t)}))}));function mt(t){for(var e=t&&V(t,A).length||0,n=Array(e),i=0;i<e;i++)n[i]=F(t,i);return n}var vt=k(mt);function yt(t,e){for(var n={},i=0,r=A(t);i<r;i++)e?n[t[i]]=e[i]:n[t[i][0]]=t[i][1];return n}function bt(t){return function(e,n,i){n=x(n,i);for(var r=A(e),s=t>0?0:r-1;s>=0&&s<r;s+=t)if(n(e[s],s,e))return s;return-1}}var wt=bt(1),xt=bt(-1);function kt(t,e,n,i){for(var r=(n=x(n,i,1))(e),s=0,o=A(t);s<o;){var a=Math.floor((s+o)/2);n(t[a])<r?s=a+1:o=a}return s}function Et(t,e,n){return function(i,r,s){var o=0,a=A(i);if("number"==typeof s)t>0?o=s>=0?s:Math.max(s+a,o):a=s>=0?Math.min(s+1,a):s+a+1;else if(n&&s&&a)return i[s=n(i,r)]===r?s:-1;if(r!=r)return(s=e(l.call(i,o,a),Ie))>=0?s+o:-1;for(s=t>0?o:a-1;s>=0&&s<a;s+=t)if(i[s]===r)return s;return-1}}var Tt=Et(1,wt,kt),Ct=Et(-1,xt);function jt(t,e,n){null==e&&(e=t||0,t=0),n||(n=e<t?-1:1);for(var i=Math.max(Math.ceil((e-t)/n),0),r=Array(i),s=0;s<i;s++,t+=n)r[s]=t;return r}function St(t,e){if(null==e||e<1)return[];for(var n=[],i=0,r=t.length;i<r;)n.push(l.call(t,i,i+=e));return n}function At(t,e,n,i,r){if(!(i instanceof e))return t.apply(n,r);var s=E(t.prototype),o=t.apply(s,r);return ve(o)?o:s}var Nt=k((function(t,e,n){if(!be(t))throw new TypeError("Bind must be called on a function");var i=k((function(r){return At(t,i,e,this,n.concat(r))}));return i})),Dt=k((function(t,e){var n=Dt.placeholder,i=function(){for(var r=0,s=e.length,o=Array(s),a=0;a<s;a++)o[a]=e[a]===n?arguments[r++]:e[a];for(;r<arguments.length;)o.push(arguments[r++]);return At(t,i,this,this,o)};return i}));Dt.placeholder=m;var Ot=k((function(t,e){var n=(e=ut(e,!1,!1)).length;if(n<1)throw new Error("bindAll must be passed function names");for(;n--;){var i=e[n];t[i]=Nt(t[i],t)}}));function It(t,e){var n=function(i){var r=n.cache,s=""+(e?e.apply(this,arguments):i);return C(r,s)||(r[s]=t.apply(this,arguments)),r[s]};return n.cache={},n}var $t=k((function(t,e,n){return setTimeout((function(){return t.apply(null,n)}),e)})),Rt=Dt($t,m,1);function Lt(t,e,n){var i,r,s,o,a=0;n||(n={});var l=function(){a=!1===n.leading?0:Ve(),i=null,o=t.apply(r,s),i||(r=s=null)},c=function(){var c=Ve();a||!1!==n.leading||(a=c);var u=e-(c-a);return r=this,s=arguments,u<=0||u>e?(i&&(clearTimeout(i),i=null),a=c,o=t.apply(r,s),i||(r=s=null)):i||!1===n.trailing||(i=setTimeout(l,u)),o};return c.cancel=function(){clearTimeout(i),a=0,i=r=s=null},c}function Mt(t,e,n){var i,r,s=function(e,n){i=null,n&&(r=t.apply(e,n))},o=k((function(o){if(i&&clearTimeout(i),n){var a=!i;i=setTimeout(s,e),a&&(r=t.apply(this,o))}else i=$t(s,e,this,o);return r}));return o.cancel=function(){clearTimeout(i),i=null},o}function Pt(t,e){return Dt(e,t)}function qt(t){return function(){return!t.apply(this,arguments)}}function zt(){var t=arguments,e=t.length-1;return function(){for(var n=e,i=t[e].apply(this,arguments);n--;)i=t[n].call(this,i);return i}}function Ht(t,e){return function(){if(--t<1)return e.apply(this,arguments)}}function Bt(t,e){var n;return function(){return--t>0&&(n=e.apply(this,arguments)),t<=1&&(e=null),n}}var Ft=Dt(Bt,2),Wt=!{toString:null}.propertyIsEnumerable("toString"),Ut=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];function Vt(t,e){var n=Ut.length,i=t.constructor,r=be(i)&&i.prototype||s,o="constructor";for(C(t,o)&&!H(e,o)&&e.push(o);n--;)(o=Ut[n])in t&&t[o]!==r[o]&&!H(e,o)&&e.push(o)}function Jt(t){if(!ve(t))return[];if(h)return h(t);var e=[];for(var n in t)C(t,n)&&e.push(n);return Wt&&Vt(t,e),e}function Xt(t){if(!ve(t))return[];var e=[];for(var n in t)e.push(n);return Wt&&Vt(t,e),e}function Kt(t){for(var e=Jt(t),n=e.length,i=Array(n),r=0;r<n;r++)i[r]=t[e[r]];return i}function Gt(t,e,n){e=x(e,n);for(var i=Jt(t),r=i.length,s={},o=0;o<r;o++){var a=i[o];s[a]=e(t[a],a,t)}return s}function Yt(t){for(var e=Jt(t),n=e.length,i=Array(n),r=0;r<n;r++)i[r]=[e[r],t[e[r]]];return i}function Qt(t){for(var e={},n=Jt(t),i=0,r=n.length;i<r;i++)e[t[n[i]]]=n[i];return e}function Zt(t){var e=[];for(var n in t)be(t[n])&&e.push(n);return e.sort()}function te(t,e){return function(n){var i=arguments.length;if(e&&(n=Object(n)),i<2||null==n)return n;for(var r=1;r<i;r++)for(var s=arguments[r],o=t(s),a=o.length,l=0;l<a;l++){var c=o[l];e&&void 0!==n[c]||(n[c]=s[c])}return n}}var ee=te(Xt),ne=te(Jt);function ie(t,e,n){e=x(e,n);for(var i,r=Jt(t),s=0,o=r.length;s<o;s++)if(e(t[i=r[s]],i,t))return i}function re(t,e,n){return e in n}var se=k((function(t,e){var n={},i=e[0];if(null==t)return n;be(i)?(e.length>1&&(i=y(i,e[1])),e=Xt(t)):(i=re,e=ut(e,!1,!1),t=Object(t));for(var r=0,s=e.length;r<s;r++){var o=e[r],a=t[o];i(a,o,t)&&(n[o]=a)}return n})),oe=k((function(t,e){var n,i=e[0];return be(i)?(i=qt(i),e.length>1&&(n=e[1])):(e=O(ut(e,!1,!1),String),i=function(t,n){return!H(e,n)}),se(t,i,n)})),ae=te(Xt,!0);function le(t,e){var n=E(t);return e&&ne(n,e),n}function ce(t){return ve(t)?me(t)?t.slice():ee({},t):t}function ue(t,e){return e(t),t}function de(t,e){var n=Jt(e),i=n.length;if(null==t)return!i;for(var r=Object(t),s=0;s<i;s++){var o=n[s];if(e[o]!==r[o]||!(o in r))return!1}return!0}function he(t,e,n,i){if(t===e)return 0!==t||1/t==1/e;if(null==t||null==e)return!1;if(t!=t)return e!=e;var r=typeof t;return("function"===r||"object"===r||"object"==typeof e)&&function(t,e,n,i){t instanceof m&&(t=t._wrapped);e instanceof m&&(e=e._wrapped);var r=c.call(t);if(r!==c.call(e))return!1;switch(r){case"[object RegExp]":case"[object String]":return""+t==""+e;case"[object Number]":return+t!=+t?+e!=+e:0==+t?1/+t==1/e:+t==+e;case"[object Date]":case"[object Boolean]":return+t==+e;case"[object Symbol]":return o.valueOf.call(t)===o.valueOf.call(e)}var s="[object Array]"===r;if(!s){if("object"!=typeof t||"object"!=typeof e)return!1;var a=t.constructor,l=e.constructor;if(a!==l&&!(be(a)&&a instanceof a&&be(l)&&l instanceof l)&&"constructor"in t&&"constructor"in e)return!1}i=i||[];var u=(n=n||[]).length;for(;u--;)if(n[u]===t)return i[u]===e;if(n.push(t),i.push(e),s){if((u=t.length)!==e.length)return!1;for(;u--;)if(!he(t[u],e[u],n,i))return!1}else{var d,h=Jt(t);if(u=h.length,Jt(e).length!==u)return!1;for(;u--;)if(d=h[u],!C(e,d)||!he(t[d],e[d],n,i))return!1}return n.pop(),i.pop(),!0}(t,e,n,i)}function _e(t,e){return he(t,e)}function fe(t){return null==t||(N(t)&&(me(t)||we(t)||ye(t))?0===t.length:0===Jt(t).length)}function pe(t){return!(!t||1!==t.nodeType)}function ge(t){return function(e){return c.call(e)==="[object "+t+"]"}}var me=d||ge("Array");function ve(t){var e=typeof t;return"function"===e||"object"===e&&!!t}var ye=ge("Arguments"),be=ge("Function"),we=ge("String"),xe=ge("Number"),ke=ge("Date"),Ee=ge("RegExp"),Te=ge("Error"),Ce=ge("Symbol"),je=ge("Map"),Se=ge("WeakMap"),Ae=ge("Set"),Ne=ge("WeakSet");!function(){ye(arguments)||(ye=function(t){return C(t,"callee")})}();var De=i.document&&i.document.childNodes;function Oe(t){return!Ce(t)&&p(t)&&!f(parseFloat(t))}function Ie(t){return xe(t)&&f(t)}function $e(t){return!0===t||!1===t||"[object Boolean]"===c.call(t)}function Re(t){return null===t}function Le(t){return void 0===t}function Me(t,e){if(!me(e))return C(t,e);for(var n=e.length,i=0;i<n;i++){var r=e[i];if(null==t||!u.call(t,r))return!1;t=t[r]}return!!n}function Pe(t){return t}function qe(t){return function(){return t}}function ze(){}function He(t){return me(t)?function(e){return j(e,t)}:T(t)}function Be(t){return null==t?function(){}:function(e){return me(e)?j(t,e):t[e]}}function Fe(t){return t=ne({},t),function(e){return de(e,t)}}function We(t,e,n){var i=Array(Math.max(0,t));e=y(e,n,1);for(var r=0;r<t;r++)i[r]=e(r);return i}function Ue(t,e){return null==e&&(e=t,t=0),t+Math.floor(Math.random()*(e-t+1))}"object"!=typeof Int8Array&&"function"!=typeof De&&(be=function(t){return"function"==typeof t||!1});var Ve=Date.now||function(){return(new Date).getTime()},Je={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},Xe=Qt(Je);function Ke(t){var e=function(e){return t[e]},n="(?:"+Jt(t).join("|")+")",i=RegExp(n),r=RegExp(n,"g");return function(t){return t=null==t?"":""+t,i.test(t)?t.replace(r,e):t}}var Ge=Ke(Je),Ye=Ke(Xe);function Qe(t,e,n){me(e)||(e=[e]);var i=e.length;if(!i)return be(n)?n.call(t):n;for(var r=0;r<i;r++){var s=null==t?void 0:t[e[r]];void 0===s&&(s=n,r=i),t=be(s)?s.call(t):s}return t}var Ze=0;function tn(t){var e=++Ze+"";return t?t+e:e}var en=m.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g},nn=/(.)^/,rn={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},sn=/\\|'|\r|\n|\u2028|\u2029/g,on=function(t){return"\\"+rn[t]};function an(t,e,n){!e&&n&&(e=n),e=ae({},e,m.templateSettings);var i,r=RegExp([(e.escape||nn).source,(e.interpolate||nn).source,(e.evaluate||nn).source].join("|")+"|$","g"),s=0,o="__p+='";t.replace(r,(function(e,n,i,r,a){return o+=t.slice(s,a).replace(sn,on),s=a+e.length,n?o+="'+\n((__t=("+n+"))==null?'':_.escape(__t))+\n'":i?o+="'+\n((__t=("+i+"))==null?'':__t)+\n'":r&&(o+="';\n"+r+"\n__p+='"),e})),o+="';\n",e.variable||(o="with(obj||{}){\n"+o+"}\n"),o="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+o+"return __p;\n";try{i=new Function(e.variable||"obj","_",o)}catch(t){throw t.source=o,t}var a=function(t){return i.call(this,t,m)},l=e.variable||"obj";return a.source="function("+l+"){\n"+o+"}",a}function ln(t){var e=m(t);return e._chain=!0,e}function cn(t,e){return t._chain?m(e).chain():e}function un(t){return D(Zt(t),(function(e){var n=m[e]=t[e];m.prototype[e]=function(){var t=[this._wrapped];return a.apply(t,arguments),cn(this,n.apply(m,t))}})),m}D(["pop","push","reverse","shift","sort","splice","unshift"],(function(t){var e=r[t];m.prototype[t]=function(){var n=this._wrapped;return e.apply(n,arguments),"shift"!==t&&"splice"!==t||0!==n.length||delete n[0],cn(this,n)}})),D(["concat","join","slice"],(function(t){var e=r[t];m.prototype[t]=function(){return cn(this,e.apply(this._wrapped,arguments))}})),m.prototype.value=function(){return this._wrapped},m.prototype.valueOf=m.prototype.toJSON=m.prototype.value,m.prototype.toString=function(){return String(this._wrapped)}}.call(this,n(21))},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));n(2);var i=n(1);class r extends i.Model{defaults(){return{key:"",value:"",virtual_value:"",kv_inherited:!1,kv_type:"text",kv_format:void 0}}initialize(t){this.on("change:kv_type",this.update_current_formats),this.trigger("change:kv_type")}update_current_formats(){"date"==this.get("kv_type")?this.set("current_formats",this.get("date_formats")):"money"==this.get("kv_type")?this.set("current_formats",this.get("currency_formats")):"numeric"==this.get("kv_type")?this.set("current_formats",this.get("numeric_formats")):this.set("current_formats",[])}toJSON(){let t={};return t={id:this.get("id"),key:this.get("key"),virtual_value:this.get("virtual_value"),kv_inherited:this.get("kv_inherited"),kv_type:this.get("kv_type"),kv_format:this.get("kv_format")},this.get("value")&&(t.value=this.get("value")),t}get disabled(){return this.get("kv_inherited")?"disabled":""}}},function(t,e,n){"use strict";(function(t){n.d(e,"a",(function(){return a}));var i=n(2),r=n(1),s=n(11);let o=t("[name=csrfmiddlewaretoken]").val();Backbone.$.ajaxSetup({headers:{"X-CSRFToken":o}});class a extends r.Model{defaults(){return{kvstore:new r.Collection,kv_types:[],date_formats:[],currency_formats:[],numeric_formats:[]}}url(){return"/metadata/node/"+this.node.id}initialize(t){this.doc_id=t.id,this.node=t,this.fetch()}parse(t,e){let n=t.kvstore,r=t.kv_types,o=t.date_formats,a=t.numeric_formats,l=t.currency_formats,c=this;i.default.each(n,(function(t){c.kvstore.add(new s.a(t))})),this.set({kv_types:r}),this.set({numeric_formats:a}),this.set({date_formats:o}),this.set({currency_formats:l}),this.trigger("change")}get kvstore(){return this.get("kvstore")}get all_disabled(){let t=this.get("kvstore"),e=[];return e=i.default.filter(t.models,(function(t){return 1==t.get("kv_inherited")})),e.length==t.length}update_simple(t,e,n){let i=this.kvstore.get(t),r={};i&&e&&(r[e]=n,i.set(r))}add_simple(){this.kvstore.add(new s.a({kv_current_formats:this.kv_current_formats,kv_types:this.kv_types}))}remove_simple(t){this.kvstore.remove({cid:t})}remove_comp(t){this.kvstore_comp.remove({cid:t})}get kvstore_changed(){let t,e;return t=this.kvstore.some((function(t){return!t.get("id")})),e=this.kvstore.some((function(t){let e;return e=t.changed,e.key})),t||e}}}).call(this,n(0))},function(t,e,n){var i,r,s;r=[n(0)],void 0===(s="function"==typeof(i=function(t){return t.ui=t.ui||{},t.ui.version="1.12.1"})?i.apply(e,r):i)||(t.exports=s)},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var i=n(0),r=n.n(i);class s{constructor(t,e){this._url=t,this._node_ids=e,this._param=r.a.param({node_ids:e})}get url(){return`${this._url}?${this._param}`}download(){let t=new XMLHttpRequest;t.responseType="arraybuffer",t.onload=function(){let t=this.getResponseHeader("Content-Type"),e=this.response,n=new Blob([e],{type:t}),i=new FileReader;i.onload=function(t){let e=document.createElement("a");e.style.display="none",e.href=t.target.result,e.download="download.tar",e.click()},i.readAsDataURL(n)},t.onreadystatechange=function(){t.readyState===XMLHttpRequest.OPENED&&(t.setRequestHeader("Accept","application/tar"),t.send())},t.open("get",this.url)}}},function(t,e,n){"use strict";(function(t){n.d(e,"a",(function(){return r}));var i=n(9);class r extends i.a{constructor(){super()}delete_selected(e){let n;n=this._list.filter(t=>e.contains(t));for(let e of n)t(e.dom_ref).remove();this.purge_list(e)}purge_list(t){let e;for(let n in t)e=this._list.findIndex(t=>t.page_id==n.page_id),e>=0&&this._list.splice(e,1)}}}).call(this,n(0))},function(t,e,n){"use strict";n.d(e,"b",(function(){return _})),n.d(e,"a",(function(){return f}));var i=n(0),r=n.n(i),s=n(24),o=n.n(s),a=n(8),l=n(19);class c{constructor(t,e){this._width=parseInt(t),this._height=parseInt(e)}get width(){return this._width}get height(){return this._height}}var u=n(4),d=n(3);function h(t,e,n,i,r){let s;return s=new l.a(e,t,i),s.build_for(n,r)}o.a.makeJQueryPlugin(r.a);class _{constructor(t,e,n,i){this._doc_id=t,this._page_id=e,this._page_num=n,this._page_order=i}get doc_id(){return this._doc_id}get page_id(){return this._page_id}get page_order(){return this._page_order}get page_num(){return this._page_num}static create_from_dom(t){let e=r()(t).find(".document.page").data("page_order"),n=r()(t).find(".document.page").data("doc_id"),i=r()(t).find(".document.page").data("page_id"),s=r()(t).find(".document.page").data("page_num");return new _(n,i,s,e)}}class f{constructor(t,e,n,i,r,s){this._dom_ref=t,this._dom_data_ref=e,this._dom_img=void 0,this._dom_hocr=void 0,this._zoom_val=s,this._page_id=i,this._page_num=r,this._doc_id=n,this._orig_page_size=void 0}get dom_ref(){return this._dom_ref}get page_id(){return this._page_id}get page_num(){return this._page_num}replace_with(t,e){this._dom_ref.replaceWith(t),this._dom_ref=t,this._dom_img=r()(this._dom_ref).find("img").get(0),this._dom_data_ref=r()(this._dom_ref).find(".document.page").get(0),this._dom_hocr=r()(this._dom_ref).find(".page_hocr").get(0),this._page_num=e}highlight_text(t){this._highlight_text_arr=t}scroll_to(){this._dom_ref.scrollIntoView()}is_img_loaded(){return this._dom_ref.querySelectorAll("img").length>0}is_visible(){return Object(a.b)(this._dom_ref)}set_zoom_val(t){this._zoom_val=t}get_zoom_val(){return this._zoom_val}load_img(t){let e,n,i,s=this;n=this._dom_ref.getBoundingClientRect().width,i=parseInt(Object(u.d)("version")),e=i>=0?`/document/${this._doc_id}/preview/1/page/${this._page_num}?version=${i}`:`/document/${this._doc_id}/preview/1/page/${this._page_num}`,[50,75,100,125,150].includes(t)&&(n=t/100*1240),this._dom_img=Object(a.a)("img",{src:e,width:n+"px"}),this._dom_ref.insertBefore(this._dom_img,this._dom_data_ref),r()(this._dom_img).imagesLoaded().done((function(e){s.load_hocr(t),d.l.trigger(d.c,s.page_num)}))}resize_img(t){let e;this._orig_page_size?([50,75,100,125,150].includes(t)&&(e=parseInt(t)/100*this._orig_page_size.width,this._dom_img.setAttribute("width",e+"px"),r()(this._dom_img).removeAttr("height")),"width"==t&&(e=this._dom_ref.getBoundingClientRect().width,this._dom_img&&this._dom_img.setAttribute("width",e+"px"),r()(this._dom_img).removeAttr("height"))):console.log("this.orig_page_size is undefined")}load_hocr(){let t,e,n=this;this._dom_hocr=Object(a.a)("div",{class:"page_hocr"}),e=parseInt(Object(u.d)("version")),t=e>=0?`/document/${this._doc_id}/hocr/1/page/${this._page_num}?version=${e}`:`/document/${this._doc_id}/hocr/1/page/${this._page_num}`,r.a.ajax({url:t}).done((function(t,e,i){let r,s=[];200==i.status&&(t&&t.hocr&&(t.hocr.forEach((function(t,e,i){r=Object(a.a)("span",{class:t.class,id:t.id,title:t.title,x1:t.x1,y1:t.y1,x2:t.x2,y2:t.y2,wconf:t.wconf},t.text),n._dom_hocr.appendChild(r),s.push(r)})),n._dom_ref.insertBefore(n._dom_hocr,n._dom_data_ref),n._orig_page_size=new c(t.hocr_meta.width,t.hocr_meta.height)),n._dom_svg=h(n._dom_ref,n._dom_img,s,n._orig_page_size,n._highlight_text_arr))}))}resize_hocr(t){let e,n,i=this;this._dom_hocr&&(r()(this._dom_svg).remove(),n=parseInt(Object(u.d)("version")),e=n>=0?`/document/${this._doc_id}/hocr/1/page/${this._page_num}?version=${n}`:`/document/${this._doc_id}/hocr/1/page/${this._page_num}`,r.a.ajax({url:e}).done((function(t){let e,n=[];t&&t.hocr&&t.hocr.forEach((function(t,r,s){e=Object(a.a)("span",{class:t.class,id:t.id,title:t.title,x1:t.x1,y1:t.y1,x2:t.x2,y2:t.y2,wconf:t.wconf},t.text),i._dom_hocr.appendChild(e),n.push(e)})),i._dom_svg=h(i._dom_ref,i._dom_img,n,i._orig_page_size,[])})))}on_scroll(t){this.is_img_loaded()?this.zoom_changed(t)&&(this.resize_img(t),this.resize_hocr(t),this.set_zoom_val(t)):this.load_img(t),this.set_zoom_val(t)}viewer_resized(){let t,e=this._dom_ref.getBoundingClientRect().width,n=this._dom_img.getAttribute("width");return n&&(n=parseInt(n)),e&&(e=parseInt(e)),t=n!=e,t}zoom_changed(t){let e;return e=t!=this.get_zoom_val(),e}on_zoom(t){(this.zoom_changed(t)||this.viewer_resized())&&(this.resize_img(t),this.resize_hocr(t)),this.set_zoom_val(t)}}},function(t,e,n){var i,r,s;
/*!
 * jQuery UI Widget 1.12.1
 * http://jqueryui.com
 *
 * Copyright jQuery Foundation and other contributors
 * Released under the MIT license.
 * http://jquery.org/license
 */r=[n(0),n(13)],void 0===(s="function"==typeof(i=function(t){var e,n=0,i=Array.prototype.slice;return t.cleanData=(e=t.cleanData,function(n){var i,r,s;for(s=0;null!=(r=n[s]);s++)try{(i=t._data(r,"events"))&&i.remove&&t(r).triggerHandler("remove")}catch(t){}e(n)}),t.widget=function(e,n,i){var r,s,o,a={},l=e.split(".")[0],c=l+"-"+(e=e.split(".")[1]);return i||(i=n,n=t.Widget),t.isArray(i)&&(i=t.extend.apply(null,[{}].concat(i))),t.expr[":"][c.toLowerCase()]=function(e){return!!t.data(e,c)},t[l]=t[l]||{},r=t[l][e],s=t[l][e]=function(t,e){if(!this._createWidget)return new s(t,e);arguments.length&&this._createWidget(t,e)},t.extend(s,r,{version:i.version,_proto:t.extend({},i),_childConstructors:[]}),(o=new n).options=t.widget.extend({},o.options),t.each(i,(function(e,i){t.isFunction(i)?a[e]=function(){function t(){return n.prototype[e].apply(this,arguments)}function r(t){return n.prototype[e].apply(this,t)}return function(){var e,n=this._super,s=this._superApply;return this._super=t,this._superApply=r,e=i.apply(this,arguments),this._super=n,this._superApply=s,e}}():a[e]=i})),s.prototype=t.widget.extend(o,{widgetEventPrefix:r&&o.widgetEventPrefix||e},a,{constructor:s,namespace:l,widgetName:e,widgetFullName:c}),r?(t.each(r._childConstructors,(function(e,n){var i=n.prototype;t.widget(i.namespace+"."+i.widgetName,s,n._proto)})),delete r._childConstructors):n._childConstructors.push(s),t.widget.bridge(e,s),s},t.widget.extend=function(e){for(var n,r,s=i.call(arguments,1),o=0,a=s.length;o<a;o++)for(n in s[o])r=s[o][n],s[o].hasOwnProperty(n)&&void 0!==r&&(t.isPlainObject(r)?e[n]=t.isPlainObject(e[n])?t.widget.extend({},e[n],r):t.widget.extend({},r):e[n]=r);return e},t.widget.bridge=function(e,n){var r=n.prototype.widgetFullName||e;t.fn[e]=function(s){var o="string"==typeof s,a=i.call(arguments,1),l=this;return o?this.length||"instance"!==s?this.each((function(){var n,i=t.data(this,r);return"instance"===s?(l=i,!1):i?t.isFunction(i[s])&&"_"!==s.charAt(0)?(n=i[s].apply(i,a))!==i&&void 0!==n?(l=n&&n.jquery?l.pushStack(n.get()):n,!1):void 0:t.error("no such method '"+s+"' for "+e+" widget instance"):t.error("cannot call methods on "+e+" prior to initialization; attempted to call method '"+s+"'")})):l=void 0:(a.length&&(s=t.widget.extend.apply(null,[s].concat(a))),this.each((function(){var e=t.data(this,r);e?(e.option(s||{}),e._init&&e._init()):t.data(this,r,new n(s,this))}))),l}},t.Widget=function(){},t.Widget._childConstructors=[],t.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{classes:{},disabled:!1,create:null},_createWidget:function(e,i){i=t(i||this.defaultElement||this)[0],this.element=t(i),this.uuid=n++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=t(),this.hoverable=t(),this.focusable=t(),this.classesElementLookup={},i!==this&&(t.data(i,this.widgetFullName,this),this._on(!0,this.element,{remove:function(t){t.target===i&&this.destroy()}}),this.document=t(i.style?i.ownerDocument:i.document||i),this.window=t(this.document[0].defaultView||this.document[0].parentWindow)),this.options=t.widget.extend({},this.options,this._getCreateOptions(),e),this._create(),this.options.disabled&&this._setOptionDisabled(this.options.disabled),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:function(){return{}},_getCreateEventData:t.noop,_create:t.noop,_init:t.noop,destroy:function(){var e=this;this._destroy(),t.each(this.classesElementLookup,(function(t,n){e._removeClass(n,t)})),this.element.off(this.eventNamespace).removeData(this.widgetFullName),this.widget().off(this.eventNamespace).removeAttr("aria-disabled"),this.bindings.off(this.eventNamespace)},_destroy:t.noop,widget:function(){return this.element},option:function(e,n){var i,r,s,o=e;if(0===arguments.length)return t.widget.extend({},this.options);if("string"==typeof e)if(o={},i=e.split("."),e=i.shift(),i.length){for(r=o[e]=t.widget.extend({},this.options[e]),s=0;s<i.length-1;s++)r[i[s]]=r[i[s]]||{},r=r[i[s]];if(e=i.pop(),1===arguments.length)return void 0===r[e]?null:r[e];r[e]=n}else{if(1===arguments.length)return void 0===this.options[e]?null:this.options[e];o[e]=n}return this._setOptions(o),this},_setOptions:function(t){var e;for(e in t)this._setOption(e,t[e]);return this},_setOption:function(t,e){return"classes"===t&&this._setOptionClasses(e),this.options[t]=e,"disabled"===t&&this._setOptionDisabled(e),this},_setOptionClasses:function(e){var n,i,r;for(n in e)r=this.classesElementLookup[n],e[n]!==this.options.classes[n]&&r&&r.length&&(i=t(r.get()),this._removeClass(r,n),i.addClass(this._classes({element:i,keys:n,classes:e,add:!0})))},_setOptionDisabled:function(t){this._toggleClass(this.widget(),this.widgetFullName+"-disabled",null,!!t),t&&(this._removeClass(this.hoverable,null,"ui-state-hover"),this._removeClass(this.focusable,null,"ui-state-focus"))},enable:function(){return this._setOptions({disabled:!1})},disable:function(){return this._setOptions({disabled:!0})},_classes:function(e){var n=[],i=this;function r(r,s){var o,a;for(a=0;a<r.length;a++)o=i.classesElementLookup[r[a]]||t(),o=e.add?t(t.unique(o.get().concat(e.element.get()))):t(o.not(e.element).get()),i.classesElementLookup[r[a]]=o,n.push(r[a]),s&&e.classes[r[a]]&&n.push(e.classes[r[a]])}return e=t.extend({element:this.element,classes:this.options.classes||{}},e),this._on(e.element,{remove:"_untrackClassesElement"}),e.keys&&r(e.keys.match(/\S+/g)||[],!0),e.extra&&r(e.extra.match(/\S+/g)||[]),n.join(" ")},_untrackClassesElement:function(e){var n=this;t.each(n.classesElementLookup,(function(i,r){-1!==t.inArray(e.target,r)&&(n.classesElementLookup[i]=t(r.not(e.target).get()))}))},_removeClass:function(t,e,n){return this._toggleClass(t,e,n,!1)},_addClass:function(t,e,n){return this._toggleClass(t,e,n,!0)},_toggleClass:function(t,e,n,i){i="boolean"==typeof i?i:n;var r="string"==typeof t||null===t,s={extra:r?e:n,keys:r?t:e,element:r?this.element:t,add:i};return s.element.toggleClass(this._classes(s),i),this},_on:function(e,n,i){var r,s=this;"boolean"!=typeof e&&(i=n,n=e,e=!1),i?(n=r=t(n),this.bindings=this.bindings.add(n)):(i=n,n=this.element,r=this.widget()),t.each(i,(function(i,o){function a(){if(e||!0!==s.options.disabled&&!t(this).hasClass("ui-state-disabled"))return("string"==typeof o?s[o]:o).apply(s,arguments)}"string"!=typeof o&&(a.guid=o.guid=o.guid||a.guid||t.guid++);var l=i.match(/^([\w:-]*)\s*(.*)$/),c=l[1]+s.eventNamespace,u=l[2];u?r.on(c,u,a):n.on(c,a)}))},_off:function(e,n){n=(n||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,e.off(n).off(n),this.bindings=t(this.bindings.not(e).get()),this.focusable=t(this.focusable.not(e).get()),this.hoverable=t(this.hoverable.not(e).get())},_delay:function(t,e){var n=this;return setTimeout((function(){return("string"==typeof t?n[t]:t).apply(n,arguments)}),e||0)},_hoverable:function(e){this.hoverable=this.hoverable.add(e),this._on(e,{mouseenter:function(e){this._addClass(t(e.currentTarget),null,"ui-state-hover")},mouseleave:function(e){this._removeClass(t(e.currentTarget),null,"ui-state-hover")}})},_focusable:function(e){this.focusable=this.focusable.add(e),this._on(e,{focusin:function(e){this._addClass(t(e.currentTarget),null,"ui-state-focus")},focusout:function(e){this._removeClass(t(e.currentTarget),null,"ui-state-focus")}})},_trigger:function(e,n,i){var r,s,o=this.options[e];if(i=i||{},(n=t.Event(n)).type=(e===this.widgetEventPrefix?e:this.widgetEventPrefix+e).toLowerCase(),n.target=this.element[0],s=n.originalEvent)for(r in s)r in n||(n[r]=s[r]);return this.element.trigger(n,i),!(t.isFunction(o)&&!1===o.apply(this.element[0],[n].concat(i))||n.isDefaultPrevented())}},t.each({show:"fadeIn",hide:"fadeOut"},(function(e,n){t.Widget.prototype["_"+e]=function(i,r,s){var o;"string"==typeof r&&(r={effect:r});var a=r?!0===r||"number"==typeof r?n:r.effect||n:e;"number"==typeof(r=r||{})&&(r={duration:r}),o=!t.isEmptyObject(r),r.complete=s,r.delay&&i.delay(r.delay),o&&t.effects&&t.effects.effect[a]?i[e](r):a!==e&&i[a]?i[a](r.duration,r.easing,s):i.queue((function(n){t(this)[e](),s&&s.call(i[0]),n()}))}})),t.widget})?i.apply(e,r):i)||(t.exports=s)},function(t,e,n){
/*!
  * Bootstrap util.js v4.5.2 (https://getbootstrap.com/)
  * Copyright 2011-2020 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
  */
t.exports=function(t){"use strict";function e(e){var i=this,r=!1;return t(this).one(n.TRANSITION_END,(function(){r=!0})),setTimeout((function(){r||n.triggerTransitionEnd(i)}),e),this}t=t&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t;var n={TRANSITION_END:"bsTransitionEnd",getUID:function(t){do{t+=~~(1e6*Math.random())}while(document.getElementById(t));return t},getSelectorFromElement:function(t){var e=t.getAttribute("data-target");if(!e||"#"===e){var n=t.getAttribute("href");e=n&&"#"!==n?n.trim():""}try{return document.querySelector(e)?e:null}catch(t){return null}},getTransitionDurationFromElement:function(e){if(!e)return 0;var n=t(e).css("transition-duration"),i=t(e).css("transition-delay"),r=parseFloat(n),s=parseFloat(i);return r||s?(n=n.split(",")[0],i=i.split(",")[0],1e3*(parseFloat(n)+parseFloat(i))):0},reflow:function(t){return t.offsetHeight},triggerTransitionEnd:function(e){t(e).trigger("transitionend")},supportsTransitionEnd:function(){return Boolean("transitionend")},isElement:function(t){return(t[0]||t).nodeType},typeCheckConfig:function(t,e,i){for(var r in i)if(Object.prototype.hasOwnProperty.call(i,r)){var s=i[r],o=e[r],a=o&&n.isElement(o)?"element":null==(l=o)?""+l:{}.toString.call(l).match(/\s([a-z]+)/i)[1].toLowerCase();if(!new RegExp(s).test(a))throw new Error(t.toUpperCase()+': Option "'+r+'" provided type "'+a+'" but expected type "'+s+'".')}var l},findShadowRoot:function(t){if(!document.documentElement.attachShadow)return null;if("function"==typeof t.getRootNode){var e=t.getRootNode();return e instanceof ShadowRoot?e:null}return t instanceof ShadowRoot?t:t.parentNode?n.findShadowRoot(t.parentNode):null},jQueryDetection:function(){if(void 0===t)throw new TypeError("Bootstrap's JavaScript requires jQuery. jQuery must be included before Bootstrap's JavaScript.");var e=t.fn.jquery.split(" ")[0].split(".");if(e[0]<2&&e[1]<9||1===e[0]&&9===e[1]&&e[2]<1||e[0]>=4)throw new Error("Bootstrap's JavaScript requires at least jQuery v1.9.1 but less than v4.0.0")}};return n.jQueryDetection(),t.fn.emulateTransitionEnd=e,t.event.special[n.TRANSITION_END]={bindType:"transitionend",delegateType:"transitionend",handle:function(e){if(t(e.target).is(this))return e.handleObj.handler.apply(this,arguments)}},n}(n(0))},function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));var i=n(0),r=n.n(i);function s(t,e){let n=document.createElementNS("http://www.w3.org/2000/svg",t);for(var i in e)n.setAttribute(i,e[i]);return n}Number.isNumeric=function(t){return!isNaN(parseFloat(t))&&isFinite(t)};class o{constructor(t,e,n){this.x=t,this.y=e,this.text=n}make_svg(){let t=s("text",{x:this.x,y:this.y}),e=document.createTextNode(this.text);return t.appendChild(e),t}}class a{constructor(t,e,n,i){this.x1=t,this.y1=e,this.x2=n,this.y2=i}get width(){return this.x2-this.x1}get height(){return this.y2-this.y1}}class l{constructor(t,e,n){let i;i=t.getBoundingClientRect(),this.height=i.height,this.width=i.width,this.dom_img=t,this.dom_parent=e,this.orig_img_rect=n}make_svg_container(){return s("svg",{width:this.width,height:this.height})}fit_text_to_bbox(t,e,n){let i,r,s,o,a,l=e.getBBox();this.orig_img_rect&&(a=parseInt(this.width)/this.orig_img_rect.width,Number.isNumeric(l.width)&&l.width>0&&(i=a*t.width/l.width,Number.isNumeric(l.height)&&l.height>0&&(r=t.height/l.height,Number.isNumeric(i)?(s=a*t.x1/i,o=a*t.y2/i,t.width/l.width<=20?e.setAttribute("transform","scale("+i+")"):(console.log("SVG Scale factor > 20:  "+t.width/l.width),console.log(`width=${this.width} / orig_img_rect.width=${this.orig_img_rect.width}`),console.log(`dest_bbox.width=${t.width} / bb.width=${l.width} = ratio=${a}`),console.log(`SVGText = [${n.text}]`),console.log(e)),e.setAttribute("x",s),e.setAttribute("y",o)):console.log(`[${n.text}] invalid scale value. dest_bbox.width = ${t.width}; bb.width=${l.width}; w=${i}`))))}build_for(t,e){let n,i=this.make_svg_container(),s=this;return this.dom_parent&&(n=this.dom_parent.querySelectorAll("svg"),r()(n).remove()),this.dom_parent.insertBefore(i,this.dom_img),t.forEach((function(t,n,r){let l,c,u,d=t.getAttribute("x1"),h=t.getAttribute("y1"),_=t.getAttribute("x2"),f=t.getAttribute("y2");if(l=new a(d,h,_,f),c=new o(l.x1,l.y2,t.textContent),u=c.make_svg(),i.appendChild(u),s.fit_text_to_bbox(l,u,c),u.setAttribute("id",t.getAttribute("id")),u.setAttribute("title",t.getAttribute("title")),u.setAttribute("fill","transparent"),u.setAttribute("opacity","0.4"),e)for(let n of e)n==t.textContent&&(u.setAttribute("stroke","yellow"),u.setAttribute("stroke-width","10"))})),i}}},function(t,e,n){"use strict";(function(t){n.d(e,"a",(function(){return s}));var i=n(9),r=n(16);class s{static get DELETE(){return"mg_delete_selected_page"}static get CHANGE(){return"mg_selection_changed"}constructor(){this._list=[],this._events=new i.a,this._configEvents()}subscribe_event(t,e,n){this._events.subscribe(t,e,n)}notify_subscribers(t){this._events.notify(t)}clear(){this._list=[],this._configEvents(),this.notify_subscribers(s.CHANGE,this._list)}contains(t){let e;return e=this._list.findIndex(e=>e.page_id==t.page_id),e>=0}add(t){let e;e=this._list.findIndex(e=>e.page_id==t.page_id),e<0&&this._list.push(t)}all(){return this._list}first(){return this._list[0]}remove(t){let e;e=this._list.findIndex(e=>e.page_num==t.page_num),e>=0&&this._list.splice(e,1)}get length(){return this._list.length}_on_page_click(e){let n,i,o,a=t(this),l=a.find("[type=checkbox]").first();i=l.prop("checked"),o=!i,l.prop("checked",o),o?a.addClass("checked"):a.removeClass("checked"),n=r.b.create_from_dom(a),o?e.data.selection.add(n):e.data.selection.remove(n),e.data.selection.notify_subscribers(s.CHANGE,this._list)}_configEvents(){t(".page_thumbnail").unbind("click"),t(".page_thumbnail").click({selection:this},this._on_page_click)}}}).call(this,n(0))},function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){var i,r,s;
/*!
 * jQuery UI Mouse 1.12.1
 * http://jqueryui.com
 *
 * Copyright jQuery Foundation and other contributors
 * Released under the MIT license.
 * http://jquery.org/license
 */r=[n(0),n(32),n(13),n(17)],void 0===(s="function"==typeof(i=function(t){var e=!1;return t(document).on("mouseup",(function(){e=!1})),t.widget("ui.mouse",{version:"1.12.1",options:{cancel:"input, textarea, button, select, option",distance:1,delay:0},_mouseInit:function(){var e=this;this.element.on("mousedown."+this.widgetName,(function(t){return e._mouseDown(t)})).on("click."+this.widgetName,(function(n){if(!0===t.data(n.target,e.widgetName+".preventClickEvent"))return t.removeData(n.target,e.widgetName+".preventClickEvent"),n.stopImmediatePropagation(),!1})),this.started=!1},_mouseDestroy:function(){this.element.off("."+this.widgetName),this._mouseMoveDelegate&&this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(n){if(!e){this._mouseMoved=!1,this._mouseStarted&&this._mouseUp(n),this._mouseDownEvent=n;var i=this,r=1===n.which,s=!("string"!=typeof this.options.cancel||!n.target.nodeName)&&t(n.target).closest(this.options.cancel).length;return!(r&&!s&&this._mouseCapture(n)&&(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout((function(){i.mouseDelayMet=!0}),this.options.delay)),this._mouseDistanceMet(n)&&this._mouseDelayMet(n)&&(this._mouseStarted=!1!==this._mouseStart(n),!this._mouseStarted)?(n.preventDefault(),0):(!0===t.data(n.target,this.widgetName+".preventClickEvent")&&t.removeData(n.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(t){return i._mouseMove(t)},this._mouseUpDelegate=function(t){return i._mouseUp(t)},this.document.on("mousemove."+this.widgetName,this._mouseMoveDelegate).on("mouseup."+this.widgetName,this._mouseUpDelegate),n.preventDefault(),e=!0,0)))}},_mouseMove:function(e){if(this._mouseMoved){if(t.ui.ie&&(!document.documentMode||document.documentMode<9)&&!e.button)return this._mouseUp(e);if(!e.which)if(e.originalEvent.altKey||e.originalEvent.ctrlKey||e.originalEvent.metaKey||e.originalEvent.shiftKey)this.ignoreMissingWhich=!0;else if(!this.ignoreMissingWhich)return this._mouseUp(e)}return(e.which||e.button)&&(this._mouseMoved=!0),this._mouseStarted?(this._mouseDrag(e),e.preventDefault()):(this._mouseDistanceMet(e)&&this._mouseDelayMet(e)&&(this._mouseStarted=!1!==this._mouseStart(this._mouseDownEvent,e),this._mouseStarted?this._mouseDrag(e):this._mouseUp(e)),!this._mouseStarted)},_mouseUp:function(n){this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,n.target===this._mouseDownEvent.target&&t.data(n.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(n)),this._mouseDelayTimer&&(clearTimeout(this._mouseDelayTimer),delete this._mouseDelayTimer),this.ignoreMissingWhich=!1,e=!1,n.preventDefault()},_mouseDistanceMet:function(t){return Math.max(Math.abs(this._mouseDownEvent.pageX-t.pageX),Math.abs(this._mouseDownEvent.pageY-t.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}})})?i.apply(e,r):i)||(t.exports=s)},function(t,e,n){"use strict";(function(t){n.d(e,"a",(function(){return c}));var i=n(2),r=n(1),s=n(7),o=n(11),a=n(4),l=n(3);class c extends r.Model{defaults(){return{nodes:[],parent_id:"",parent_kv:[]}}initialize(t){this.parent_id=t,this.nodes=new s.b,this.parent_kv=new r.Collection}urlRoot(){let e,n,i,r,s,o=this.get("parent_id");return e=o?`/browse/${o}/`:"/browse/",i=Object(a.d)("page")||Object(a.c)("page"),n=this.get("tag"),s=this.get("order_by"),r=t.param({tag:n,page:i,"order-by":s}),e=`${e}?${r}`,e}toJSON(){return{id:this.get("id"),parent_id:this.get("parent_id"),nodes:this.get("nodes")}}open(t,e){let n;n=t?t.id:void 0,this.set({parent_id:n}),e&&l.l.trigger(l.f,n)}parse(t,e){let n=t.nodes,r=this,a=t.parent_kv,l=t.parent_id;r.nodes.reset(),r.parent_kv.reset(),i.default.each(n,(function(t){r.nodes.add(new s.a(t))})),i.default.each(a,(function(t){r.parent_kv.add(new o.a(t))})),this.set({pagination:t.pagination}),this.set({parent_id:l}),this.trigger("change")}}}).call(this,n(0))},function(t,e,n){var i,r;
/*!
 * imagesLoaded v4.1.4
 * JavaScript is all like "You images are done yet or what?"
 * MIT License
 */!function(s,o){"use strict";i=[n(47)],void 0===(r=function(t){return function(t,e){var n=t.jQuery,i=t.console;function r(t,e){for(var n in e)t[n]=e[n];return t}var s=Array.prototype.slice;function o(t,e,a){if(!(this instanceof o))return new o(t,e,a);var l,c=t;("string"==typeof t&&(c=document.querySelectorAll(t)),c)?(this.elements=(l=c,Array.isArray(l)?l:"object"==typeof l&&"number"==typeof l.length?s.call(l):[l]),this.options=r({},this.options),"function"==typeof e?a=e:r(this.options,e),a&&this.on("always",a),this.getImages(),n&&(this.jqDeferred=new n.Deferred),setTimeout(this.check.bind(this))):i.error("Bad element for imagesLoaded "+(c||t))}o.prototype=Object.create(e.prototype),o.prototype.options={},o.prototype.getImages=function(){this.images=[],this.elements.forEach(this.addElementImages,this)},o.prototype.addElementImages=function(t){"IMG"==t.nodeName&&this.addImage(t),!0===this.options.background&&this.addElementBackgroundImages(t);var e=t.nodeType;if(e&&a[e]){for(var n=t.querySelectorAll("img"),i=0;i<n.length;i++){var r=n[i];this.addImage(r)}if("string"==typeof this.options.background){var s=t.querySelectorAll(this.options.background);for(i=0;i<s.length;i++){var o=s[i];this.addElementBackgroundImages(o)}}}};var a={1:!0,9:!0,11:!0};function l(t){this.img=t}function c(t,e){this.url=t,this.element=e,this.img=new Image}return o.prototype.addElementBackgroundImages=function(t){var e=getComputedStyle(t);if(e)for(var n=/url\((['"])?(.*?)\1\)/gi,i=n.exec(e.backgroundImage);null!==i;){var r=i&&i[2];r&&this.addBackground(r,t),i=n.exec(e.backgroundImage)}},o.prototype.addImage=function(t){var e=new l(t);this.images.push(e)},o.prototype.addBackground=function(t,e){var n=new c(t,e);this.images.push(n)},o.prototype.check=function(){var t=this;function e(e,n,i){setTimeout((function(){t.progress(e,n,i)}))}this.progressedCount=0,this.hasAnyBroken=!1,this.images.length?this.images.forEach((function(t){t.once("progress",e),t.check()})):this.complete()},o.prototype.progress=function(t,e,n){this.progressedCount++,this.hasAnyBroken=this.hasAnyBroken||!t.isLoaded,this.emitEvent("progress",[this,t,e]),this.jqDeferred&&this.jqDeferred.notify&&this.jqDeferred.notify(this,t),this.progressedCount==this.images.length&&this.complete(),this.options.debug&&i&&i.log("progress: "+n,t,e)},o.prototype.complete=function(){var t=this.hasAnyBroken?"fail":"done";if(this.isComplete=!0,this.emitEvent(t,[this]),this.emitEvent("always",[this]),this.jqDeferred){var e=this.hasAnyBroken?"reject":"resolve";this.jqDeferred[e](this)}},l.prototype=Object.create(e.prototype),l.prototype.check=function(){this.getIsImageComplete()?this.confirm(0!==this.img.naturalWidth,"naturalWidth"):(this.proxyImage=new Image,this.proxyImage.addEventListener("load",this),this.proxyImage.addEventListener("error",this),this.img.addEventListener("load",this),this.img.addEventListener("error",this),this.proxyImage.src=this.img.src)},l.prototype.getIsImageComplete=function(){return this.img.complete&&this.img.naturalWidth},l.prototype.confirm=function(t,e){this.isLoaded=t,this.emitEvent("progress",[this,this.img,e])},l.prototype.handleEvent=function(t){var e="on"+t.type;this[e]&&this[e](t)},l.prototype.onload=function(){this.confirm(!0,"onload"),this.unbindEvents()},l.prototype.onerror=function(){this.confirm(!1,"onerror"),this.unbindEvents()},l.prototype.unbindEvents=function(){this.proxyImage.removeEventListener("load",this),this.proxyImage.removeEventListener("error",this),this.img.removeEventListener("load",this),this.img.removeEventListener("error",this)},c.prototype=Object.create(l.prototype),c.prototype.check=function(){this.img.addEventListener("load",this),this.img.addEventListener("error",this),this.img.src=this.url,this.getIsImageComplete()&&(this.confirm(0!==this.img.naturalWidth,"naturalWidth"),this.unbindEvents())},c.prototype.unbindEvents=function(){this.img.removeEventListener("load",this),this.img.removeEventListener("error",this)},c.prototype.confirm=function(t,e){this.isLoaded=t,this.emitEvent("progress",[this,this.element,e])},o.makeJQueryPlugin=function(e){(e=e||t.jQuery)&&((n=e).fn.imagesLoaded=function(t,e){return new o(this,t,e).jqDeferred.promise(n(this))})},o.makeJQueryPlugin(),o}(s,t)}.apply(e,i))||(t.exports=r)}("undefined"!=typeof window?window:this)},function(t,e,n){n(60),t.exports=n(59)},function(module,exports){module.exports=function(obj){var __t,__p="",__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,"")};with(obj||{})__p+='<div class="alert alert-'+(null==(__t=title)?"":__t)+' alert-dismissible">\n    <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>\n    '+(null==(__t=message)?"":__t)+".\n</div>";return __p}},function(module,exports){module.exports=function(obj){var __t,__p="",__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,"")};with(obj||{})__p+='<div class="dropdown">\n    <button class="btn btn-light dropdown-toggle" type="button" id="dropdown_view_opt" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">\n      ',is_list?__p+='\n        <i class="fa fa-bars"></i>\n      ':__p+='\n        <i class="fa fa-th"></i>\n      ',__p+='\n    </button>\n    <div class="dropdown-menu dropdown-menu-right" aria-labelledby="dropdownMenuButton">\n        <a href="#" class="dropdown-item display-grid">\n          <i class="fa fa-th"> </i><span class="px-2">\n            '+(null==(__t=gettext("Grid"))?"":__t)+"\n          </span>\n          ",is_grid&&(__p+='\n            <i class="fa fa-check text-green"></i>\n          '),__p+='\n        </a>\n        <a href="#" class="dropdown-item display-list"><i class="fa fa-bars"></i>\n          <span class="px-2">'+(null==(__t=gettext("List"))?"":__t)+"</span>\n          ",is_list&&(__p+='\n            <i class="fa fa-check text-green"></i>\n          '),__p+='\n      </a>\n    </div>\n</div>\n\n<div class="dropdown order">\n    <button class="btn btn-light dropdown-toggle" type="button" id="dropdown_order_opt" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">\n      <i class="fa fa-sort-amount-up"></i>\n    </button>\n    <ul class="dropdown-menu dropdown-menu-right sort" aria-labelledby="navbarDropdownMenuLink">\n          <li class="dropdown-submenu-left dropdown-submenu">\n            <a class="dropdown-item dropdown-toggle" href="#">\n              '+(null==(__t=gettext("Title"))?"":__t)+'\n            </a>\n            <ul class="dropdown-menu">\n              <li><a class="dropdown-item sort asc title" href="#">\n                ',"title"==sort_field&&"asc"==sort_order&&(__p+='\n                  <i class="fa fa-check text-success"></i>\n                '),__p+="\n               "+(null==(__t=gettext("Asc"))?"":__t)+'\n              </a></li>\n              <li><a class="dropdown-item sort desc title" href="#">\n                ',"title"==sort_field&&"desc"==sort_order&&(__p+='\n                  <i class="fa fa-check text-success"></i>\n                '),__p+="\n                "+(null==(__t=gettext("Desc"))?"":__t)+'\n              </a></li>\n            </ul>\n          </li>\n          <li class="dropdown-submenu dropdown-submenu-left"><a class="dropdown-item dropdown-toggle" href="#">\n            '+(null==(__t=gettext("Date"))?"":__t)+'\n          </a>\n            <ul class="dropdown-menu">\n              <li><a class="dropdown-item sort asc date" href="#">\n                ',"date"==sort_field&&"asc"==sort_order&&(__p+='\n                  <i class="fa fa-check text-success"></i>\n                '),__p+="\n                "+(null==(__t=gettext("Asc"))?"":__t)+'\n              </a></li>\n              <li><a class="dropdown-item sort desc date" href="#">\n                ',"date"==sort_field&&"desc"==sort_order&&(__p+='\n                  <i class="fa fa-check text-success"></i>\n                '),__p+="\n                "+(null==(__t=gettext("Desc"))?"":__t)+'\n            </a></li>\n            </ul>\n          </li>\n          <li class="dropdown-submenu-left dropdown-submenu"><a class="dropdown-item dropdown-toggle" href="#">\n            '+(null==(__t=gettext("Type"))?"":__t)+'\n          </a>\n            <ul class="dropdown-menu">\n              <li><a class="dropdown-item sort asc type" href="#">\n                ',"type"==sort_field&&"asc"==sort_order&&(__p+='\n                  <i class="fa fa-check text-success"></i>\n                '),__p+="\n                "+(null==(__t=gettext("Asc"))?"":__t)+'\n              </a></li>\n              <li><a class="dropdown-item sort desc type" href="#">\n                ',"type"==sort_field&&"desc"==sort_order&&(__p+='\n                  <i class="fa fa-check text-success"></i>\n                '),__p+="\n                "+(null==(__t=gettext("Desc"))?"":__t)+"\n              </a></li>\n            </ul>\n          </li>\n        </ul>\n    </div>";return __p}},function(module,exports){module.exports=function(obj){var __t,__p="",__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,"")};with(obj||{}){for(__p+='<div id="upload_feedback" class="border-thin card">\n    <div class="card-header container-fluid" id="newsHeading">\n        <div class="row">\n            <div class="col">\n                ',files.is_summary_success()?__p+='\n                    <h5 class="text-success">Done!</h5>\n                ':files.is_summary_error()?__p+='\n                    <h5 class="text-danger">Error</h5>\n                ':__p+="\n                    <h5>Uploading...</h5>\n                ",__p+='\n            </div>\n            <div class="col">\n                <button type="button" class="close text-danger" aria-label="Close">\n                  <span aria-hidden="true">&times;</span>\n                </button>\n            </div>\n        </div>\n    <div class="hidden uploader-details">\n        <div class="details">\n            \n            ',i=0;i<files.length;i++)__p+="\n                ",file=files.at(i),__p+='\n                <div style="background-size: '+(null==(__t=file.get("progress"))?"":__t)+'% 100% %>" class="row ',file.is_error()?__p+=" status-fail ":__p+=" status-success ",__p+='">\n                    <div class="col-1">\n                        <div class="status">\n                            ',file.is_error()?__p+='\n                                <i class="fa fa-times text-danger"></i>\n                            ':file.is_success()?__p+='\n                                <i class="fa fa-check-circle text-success"></i>\n                            ':file.is_progress()&&(__p+='\n                                <i class="fa fa-spinner"></i>\n                            '),__p+='\n                        </div>\n                    </div>\n                    <div class="col-7">\n                        <div class="filename">'+(null==(__t=file.get("title"))?"":__t)+'</div>\n                        <div class="message">'+(null==(__t=file.get("msg"))?"":__t)+'</div>\n                    </div>\n                    <div class="col-2 text-right">\n                        <div class="size">'+(null==(__t=file.human_size)?"":__t)+'</div>\n                    </div>\n                    <div class="col-2 text-right">\n                        <div class="lang">'+(null==(__t=file.get("lang"))?"":__t)+"</div>\n                    </div>\n                </div>\n            ";__p+='\n            \n        </div>\n    </div>\n    <div id="upload_feedback_summary">\n        <div class="row my-2 align-items-center">\n            <div id="uploader_short_status" class="col-4 status">\n                ',files.is_summary_error()?__p+='\n                    <i class="fa fa-times  text-danger"></i>\n                ':__p+='\n                <i class="fa fa-check-circle  text-success"></i>\n                ',__p+='\n            </div>\n            <div id="uploader_text_status" class="col-4 filename padding-left-md">\n            </div>\n            <div class="col-4 text-right">\n                <button class="btn btn-neuter btn-bordered toggle-details">\n                    Details\n                </button>\n            </div>\n        </div>\n    </div>\n    <div class="progress progress-bar-animated progress-sm active">\n        <div class="progress-bar ',files.is_summary_error()?__p+="progress-bar-fail ":__p+=" progress-bar-success ",__p+='" role="progressbar" aria-valuenow="20" aria-valuemin="0" aria-valuemax="100" style="width: '+(null==(__t=files.progress)?"":__t)+'%">\n            <span class="sr-only">0% Complete</span>\n        </div>\n    </div>\n</div>'}return __p}},function(module,exports){module.exports=function(obj){var __t,__p="",__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,"")};with(obj||{}){if(__p+="",num_pages>1){__p+='\n  <div class="row">\n    <nav class="col-12">\n      <ul class="pagination pagination-sm justify-content-end">\n        ',page.has_previous&&(__p+='\n          <li class="page-item">\n            <a class="page-link" href="'+(null==(__t=prefix)?"":__t)+"?page="+(null==(__t=page.previous_page_number)?"":__t)+'" aria-label="Previous">\n            <span aria-hidden="true">&laquo;</span>\n            </a>\n          </li>\n        '),__p+="\n        ";for(let i=0;i<pages.length;i++)__p+='\n          <li class="page-item ',pages[i]==page_number&&(__p+=" active "),__p+='"><a class="page-link" href="'+(null==(__t=prefix)?"":__t)+"?page="+(null==(__t=pages[i])?"":__t)+'">'+(null==(__t=pages[i])?"":__t)+"</a></li>\n        ";__p+="\n        ",page.has_next&&(__p+='\n          <li class="page-item">\n            <a class="page-link" href="'+(null==(__t=prefix)?"":__t)+"?page="+(null==(__t=page.next_page_number)?"":__t)+'" aria-label="Next">\n              <span aria-hidden="true">&raquo;</span>\n            </a>\n          </li>\n        '),__p+="\n      </ul>\n    </nav>\n  </div>\n"}__p+=""}return __p}},function(t,e,n){n(17),n(31),n(22),n(33),n(34)},function(t,e,n){var i,r,s;
/*!
 * jQuery UI Selectable 1.12.1
 * http://jqueryui.com
 *
 * Copyright jQuery Foundation and other contributors
 * Released under the MIT license.
 * http://jquery.org/license
 */r=[n(0),n(22),n(13),n(17)],void 0===(s="function"==typeof(i=function(t){return t.widget("ui.selectable",t.ui.mouse,{version:"1.12.1",options:{appendTo:"body",autoRefresh:!0,distance:0,filter:"*",tolerance:"touch",selected:null,selecting:null,start:null,stop:null,unselected:null,unselecting:null},_create:function(){var e=this;this._addClass("ui-selectable"),this.dragged=!1,this.refresh=function(){e.elementPos=t(e.element[0]).offset(),e.selectees=t(e.options.filter,e.element[0]),e._addClass(e.selectees,"ui-selectee"),e.selectees.each((function(){var n=t(this),i=n.offset(),r={left:i.left-e.elementPos.left,top:i.top-e.elementPos.top};t.data(this,"selectable-item",{element:this,$element:n,left:r.left,top:r.top,right:r.left+n.outerWidth(),bottom:r.top+n.outerHeight(),startselected:!1,selected:n.hasClass("ui-selected"),selecting:n.hasClass("ui-selecting"),unselecting:n.hasClass("ui-unselecting")})}))},this.refresh(),this._mouseInit(),this.helper=t("<div>"),this._addClass(this.helper,"ui-selectable-helper")},_destroy:function(){this.selectees.removeData("selectable-item"),this._mouseDestroy()},_mouseStart:function(e){var n=this,i=this.options;this.opos=[e.pageX,e.pageY],this.elementPos=t(this.element[0]).offset(),this.options.disabled||(this.selectees=t(i.filter,this.element[0]),this._trigger("start",e),t(i.appendTo).append(this.helper),this.helper.css({left:e.pageX,top:e.pageY,width:0,height:0}),i.autoRefresh&&this.refresh(),this.selectees.filter(".ui-selected").each((function(){var i=t.data(this,"selectable-item");i.startselected=!0,e.metaKey||e.ctrlKey||(n._removeClass(i.$element,"ui-selected"),i.selected=!1,n._addClass(i.$element,"ui-unselecting"),i.unselecting=!0,n._trigger("unselecting",e,{unselecting:i.element}))})),t(e.target).parents().addBack().each((function(){var i,r=t.data(this,"selectable-item");if(r)return i=!e.metaKey&&!e.ctrlKey||!r.$element.hasClass("ui-selected"),n._removeClass(r.$element,i?"ui-unselecting":"ui-selected")._addClass(r.$element,i?"ui-selecting":"ui-unselecting"),r.unselecting=!i,r.selecting=i,r.selected=i,i?n._trigger("selecting",e,{selecting:r.element}):n._trigger("unselecting",e,{unselecting:r.element}),!1})))},_mouseDrag:function(e){if(this.dragged=!0,!this.options.disabled){var n,i=this,r=this.options,s=this.opos[0],o=this.opos[1],a=e.pageX,l=e.pageY;return s>a&&(n=a,a=s,s=n),o>l&&(n=l,l=o,o=n),this.helper.css({left:s,top:o,width:a-s,height:l-o}),this.selectees.each((function(){var n=t.data(this,"selectable-item"),c=!1,u={};n&&n.element!==i.element[0]&&(u.left=n.left+i.elementPos.left,u.right=n.right+i.elementPos.left,u.top=n.top+i.elementPos.top,u.bottom=n.bottom+i.elementPos.top,"touch"===r.tolerance?c=!(u.left>a||u.right<s||u.top>l||u.bottom<o):"fit"===r.tolerance&&(c=u.left>s&&u.right<a&&u.top>o&&u.bottom<l),c?(n.selected&&(i._removeClass(n.$element,"ui-selected"),n.selected=!1),n.unselecting&&(i._removeClass(n.$element,"ui-unselecting"),n.unselecting=!1),n.selecting||(i._addClass(n.$element,"ui-selecting"),n.selecting=!0,i._trigger("selecting",e,{selecting:n.element}))):(n.selecting&&((e.metaKey||e.ctrlKey)&&n.startselected?(i._removeClass(n.$element,"ui-selecting"),n.selecting=!1,i._addClass(n.$element,"ui-selected"),n.selected=!0):(i._removeClass(n.$element,"ui-selecting"),n.selecting=!1,n.startselected&&(i._addClass(n.$element,"ui-unselecting"),n.unselecting=!0),i._trigger("unselecting",e,{unselecting:n.element}))),n.selected&&(e.metaKey||e.ctrlKey||n.startselected||(i._removeClass(n.$element,"ui-selected"),n.selected=!1,i._addClass(n.$element,"ui-unselecting"),n.unselecting=!0,i._trigger("unselecting",e,{unselecting:n.element})))))})),!1}},_mouseStop:function(e){var n=this;return this.dragged=!1,t(".ui-unselecting",this.element[0]).each((function(){var i=t.data(this,"selectable-item");n._removeClass(i.$element,"ui-unselecting"),i.unselecting=!1,i.startselected=!1,n._trigger("unselected",e,{unselected:i.element})})),t(".ui-selecting",this.element[0]).each((function(){var i=t.data(this,"selectable-item");n._removeClass(i.$element,"ui-selecting")._addClass(i.$element,"ui-selected"),i.selecting=!1,i.selected=!0,i.startselected=!0,n._trigger("selected",e,{selected:i.element})})),this._trigger("stop",e),this.helper.remove(),!1}})})?i.apply(e,r):i)||(t.exports=s)},function(t,e,n){var i,r,s;r=[n(0),n(13)],void 0===(s="function"==typeof(i=function(t){return t.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase())})?i.apply(e,r):i)||(t.exports=s)},function(t,e,n){},function(t,e,n){},function(module,exports){module.exports=function(obj){var __t,__p="",__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,"")};with(obj||{}){if(__p+="",nodes.length>0){for(__p+='\n    <ul class="d-flex grid">\n        ',i=0;i<nodes.length;i++){for(__p+="\n            ",node=nodes.at(i),__p+='\n            <li class="node ui-widget-content node-w1 d-flex flex-column align-items-center" data-id="'+(null==(__t=node.get("id"))?"":__t)+'" data-cid="'+(null==(__t=node.cid)?"":__t)+'" data-url="'+(null==(__t=node.url)?"":__t)+'">\n                ',node.is_document()&&(__p+='\n                    <div class="placeholder document">\n                        <img class="zero_pix" src="'+(null==(__t=node.get("img_src"))?"":__t)+'" />\n                        <div class="document-loading"></div>\n                    </div>\n                '),__p+='\n                <div class="icon-'+(null==(__t=node.get("ctype"))?"":__t)+'">\n\n                </div>\n                <ul class="node-tags d-flex flex-column align-items-end">\n                    ',tags=node.get("tags"),__p+="\n                    ",t=0;t<tags.length&&t<3;t++)__p+="\n                        ",tag=tags[t],__p+='\n                        <li class="tag"  style="background: '+(null==(__t=tag.bg_color)?"":__t)+";color: "+(null==(__t=tag.fg_color)?"":__t)+'" >\n                            '+(null==(__t=tag.name)?"":__t)+"\n                        </li>\n                    ";__p+="\n                    ",tags.length>3&&(__p+="\n                        <li>...</li>\n                    "),__p+='\n                </ul>\n                <div class="icons">\n                    ',node.is_readonly()&&(__p+='\n                        <i class="fa fa-lock"></i>\n                    '),__p+='\n                </div>\n                <input type="checkbox" name="_selected_action" value="'+(null==(__t=node.get("id"))?"":__t)+'" class="action-select" />\n                <div class="title tooltip">\n                    <a href="'+(null==(__t=node.url)?"":__t)+'" class="'+(null==(__t=node.get("ctype"))?"":__t)+'" data-id="'+(null==(__t=node.get("id"))?"":__t)+'" alt="'+(null==(__t=node.full_title())?"":__t)+'">'+(null==(__t=node.short_title(20))?"":__t)+'</a>\n                    <span class="tooltiptext">'+(null==(__t=node.full_title())?"":__t)+"</span>\n                </div>\n\n            </li>\n        "}__p+="\n    </ul>\n"}else __p+='\n    <ul id="empty-folder">\n        <div class="d-flex flex-column align-items-center">\n            <i class="fa fa-folder">\n            </i>\n            <strong class="text-muted">'+(null==(__t=gettext("This folder is empty"))?"":__t)+"</strong>\n        </div>\n    </ul>\n";__p+=""}return __p}},function(module,exports){module.exports=function(obj){var __t,__p="",__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,"")};with(obj||{}){if(__p+="",table.rows.length>0){for(__p+='\n\n<table class="table table-striped">\n  <thead>\n    <tr class="text-uppercase">\n      <th class="border-top-0 border-right-0 border-left-0" scope="col">\n        <a \n          href="#"\n          class="header sort d-flex justify-content-between align-items-center"\n          data-col="type"\n        >\n          '+(null==(__t=gettext("Type"))?"":__t)+'\n          <i class="fa '+(null==(__t=table.cols[0].sort_icon_name)?"":__t)+'"></i>\n        </a>\n      </th>\n      <th class="border-top-0 border-right-0 border-left-0" scope="col">\n        <a\n          href="#"\n          class="header sort d-flex justify-content-between align-items-center"\n          data-col="title"\n        >\n          '+(null==(__t=gettext("Title "))?"":__t)+'\n          <i class="fa '+(null==(__t=table.cols[1].sort_icon_name)?"":__t)+'"></i>\n        </a>\n      </th>\n      ',i=0;i<table.key_cols.length;i++)__p+="\n        ",column=table.key_cols[i],__p+="\n        ",column&&(__p+='\n          <th class="border-top-0 border-right-0 border-left-0" scope="col">\n            <a \n              href="#"\n              class="header sort d-flex justify-content-between align-items-center"\n              data-col="key" data-key="'+(null==(__t=column.key)?"":__t)+'"\n            >\n              '+(null==(__t=column.key)?"":__t)+'\n              <i class="fa '+(null==(__t=column.sort_icon_name)?"":__t)+'"></i>\n            </a>\n          </th>\n        '),__p+="\n      ";for(__p+='\n      <th class="border-top-0 border-right-0 border-left-0" scope="col">\n        <a\n          href="#"\n          class="header sort d-flex justify-content-between align-items-center"\n          data-col="created_at"\n        >\n          '+(null==(__t=gettext("Created At"))?"":__t)+'\n          <i class="fa  '+(null==(__t=table.cols[table.cols.length-1].sort_icon_name)?"":__t)+'"></i>\n        </a>\n      </th>\n    </tr>\n  </thead>\n  <tbody>\n    ',i=0;i<table.rows.length;i++){for(__p+="\n        ",row=table.rows[i],__p+='\n    <tr class="node" data-id="'+(null==(__t=row[0].id)?"":__t)+'" data-cid="'+(null==(__t=row[0].cid)?"":__t)+'" data-url="'+(null==(__t=row[0].url)?"":__t)+'">\n        <td>\n          \x3c!-- type + checkbox column --\x3e\n          <input type="checkbox" name="_selected_action" value="'+(null==(__t=row[0].id)?"":__t)+'" class="action-select mr-1" />\n            <a href="'+(null==(__t=row[1].url)?"":__t)+'">\n            ',row[0].is_readonly&&(__p+='\n              <i class="fa fa-lock text-danger"></i>\n            '),__p+="\n          "+(null==(__t=row[0].value)?"":__t)+'\n          </a>\n        </td>\n        <td>\n          \x3c!-- title column --\x3e\n          <a href="'+(null==(__t=row[1].url)?"":__t)+'">'+(null==(__t=row[1].value)?"":__t)+"\n        </td>\n        \x3c!-- the rest of columns --\x3e\n        ",j=2;j<row.length;j++)__p+="\n          <td>\n            ",row[j].is_readonly&&(__p+='\n                <i class="fa fa-lock text-danger"></i>\n            '),__p+="\n            "+(null==(__t=row[j].value)?"":__t)+"\n            </td>\n        ";__p+="\n    </tr>\n    "}__p+="\n  </tbody>\n</table>\n\n"}else __p+='\n<ul id="empty-folder">\n    <div class="d-flex flex-column align-items-center">\n        <i class="fa fa-folder">\n        </i>\n        <strong class="text-muted">'+(null==(__t=gettext("This folder is empty"))?"":__t)+"</strong>\n    </div>\n</ul>\n";__p+=""}return __p}},function(module,exports){module.exports=function(obj){var __t,__p="",__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,"")};with(obj||{}){for(__p+='<ol class="breadcrumb float-sm-left">\n    <li class="breadcrumb-item">\n        <a href="/"><i class="fa fa-home px-1"></i>\n            <div class="d-none d-sm-inline-block">\n                '+(null==(__t=gettext("Home"))?"":__t)+"\n            </div>\n        </a>\n    </li>\n    ",i=0;i<nodes.length;i++)__p+="\n        ",node=nodes.at(i),__p+='\n        <li class="breadcrumb-item">\n            <a href="'+(null==(__t=node.url)?"":__t)+'" class="breadcrumb-node"  data-id="'+(null==(__t=node.get("id"))?"":__t)+'">\n            \t'+(null==(__t=node.get("title"))?"":__t)+"\n            </a>\n        </li>\n    ";__p+="\n</ol>\n"}return __p}},function(module,exports){module.exports=function(obj){var __t,__p="",__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,"")};with(obj||{})__p+='<div class="modal-dialog modal-dialog-centered" role="document">\n  <div class="modal-content">\n    <div class="modal-header">\n      <h5 class="modal-title">\n          Create Folder\n      </h5>\n      <button type="button" class="close" data-dismiss="modal" aria-label="Close">\n        <span aria-hidden="true">&times;</span>\n      </button>\n    </div>\n      <div class="modal-body">\n            <div class="modal-body vertical">\n              <form id="new-folder-form" method="POST">\n                  <div class="form-group">\n                    <label for="title">Folder name:</label>\n                    <input type="text" class="form-control" id="title" name="title">\n                    <input name="parent_id" value="" type="hidden" >\n                  </div>\n              </form>\n            </div>\n      </div>\n      <div class="modal-footer">\n            <button type="submit" class="btn btn-success action margin-xs create" >Create</button>\n            <button data-dismiss="modal" class="btn margin-xs btn-secondary cancel">Cancel</button></a>\n      </div>\n  </div>\n</div>\n';return __p}},function(module,exports){module.exports=function(obj){var __t,__p="",__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,"")};with(obj||{})__p+='<div class="modal-dialog modal-dialog-centered" role="document">\n  <div class="modal-content">\n    <div class="modal-header">\n      <h5 class="modal-title">\n          '+(null==(__t=gettext("Rename"))?"":__t)+'\n      </h5>\n      <button type="button" class="close" data-dismiss="modal" aria-label="Close">\n        <span aria-hidden="true">&times;</span>\n      </button>\n    </div>\n      <div class="modal-body">\n            <div class="modal-body vertical">\n              <form id="new-folder-form" method="POST">\n                  <div class="form-group">\n                    <label for="title">'+(null==(__t=gettext("New Name"))?"":__t)+':</label>\n                    <input type="text" class="form-control" id="title" value="'+(null==(__t=title)?"":__t)+'" name="title" />\n                  </div>\n              </form>\n            </div>\n      </div>\n      <div class="modal-footer">\n            <button type="submit" class="btn btn-success action margin-xs rename">'+(null==(__t=gettext("Rename"))?"":__t)+'</button>\n            <button data-dismiss="modal" class="btn margin-xs btn-secondary cancel">'+(null==(__t=gettext("Cancel"))?"":__t)+"</button></a>\n      </div>\n  </div>\n</div>";return __p}},function(module,exports){module.exports=function(obj){var __t,__p="",__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,"")};with(obj||{}){__p+=" ";for(let i=0;i<tags.models.length;i++)__p+="\n    ",model=tags.models[i],__p+='\n     <div class="tag d-flex align-items-center" style="color: '+(null==(__t=model.get("fg_color"))?"":__t)+"; background:  "+(null==(__t=model.get("bg_color"))?"":__t)+"; border-color: "+(null==(__t=model.get("bg_color"))?"":__t)+';">\n       <span style="color: '+(null==(__t=model.get("fg_color"))?"":__t)+';">'+(null==(__t=model.get("name"))?"":__t)+'</span>\n       <i \n        class="fa fa-times tag-remove"\n        data-name="'+(null==(__t=model.get("name"))?"":__t)+'">\n        </i>\n     </div>\n ';__p+='\n<input list="all_tags2" class="tag-input"/>\n<datalist id="all_tags2">\n';for(let i=0;i<all_tags.models.length;i++)__p+="\n    ",model=all_tags.models[i],__p+='\n     <option value="'+(null==(__t=model.get("name"))?"":__t)+'">\n';__p+="\n</datalist>\n\n"}return __p}},function(module,exports){module.exports=function(obj){var __t,__p="",__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,"")};with(obj||{}){__p+=" ";for(let i=0;i<tags.models.length;i++)__p+="\n    ",model=tags.models[i],__p+='\n     <div class="tag d-flex align-items-center" \n     style="color: '+(null==(__t=model.get("fg_color"))?"":__t)+"; background:  "+(null==(__t=model.get("bg_color"))?"":__t)+"; border-color: "+(null==(__t=model.get("bg_color"))?"":__t)+';">\n       <span style="color: '+(null==(__t=model.get("fg_color"))?"":__t)+';">'+(null==(__t=model.get("name"))?"":__t)+'</span>\n       <i \n        class="fa fa-times tag-remove"\n        data-name="'+(null==(__t=model.get("name"))?"":__t)+'">\n        </i>\n     </div>\n ';__p+='\n<input id="tag-input" name="tag-input" list="all_tags4" class="tag-input" />\n<datalist id="all_tags4">\n';for(let i=0;i<all_tags.models.length;i++)__p+="\n    ",model=all_tags.models[i],__p+='\n     <option value="'+(null==(__t=model.get("name"))?"":__t)+'">\n';__p+="\n</datalist>\n";for(let i=0;i<tags.models.length;i++)__p+="\n   ",model=tags.models[i],__p+='\n   <input type="hidden" name="tag" value="'+(null==(__t=model.get("name"))?"":__t)+'" />\n';__p+="\n"}return __p}},function(module,exports){module.exports=function(obj){var __t,__p="",__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,"")};with(obj||{}){__p+=" ";for(let i=0;i<tags.models.length;i++)__p+="\n    ",model=tags.models[i],__p+='\n     <div class="tag d-flex align-items-center" \n     style="color: '+(null==(__t=model.get("fg_color"))?"":__t)+"; background:  "+(null==(__t=model.get("bg_color"))?"":__t)+"; border-color: "+(null==(__t=model.get("bg_color"))?"":__t)+';">\n       <span style="color: '+(null==(__t=model.get("fg_color"))?"":__t)+';">'+(null==(__t=model.get("name"))?"":__t)+'</span>\n       <i \n        class="fa fa-times tag-remove"\n        data-name="'+(null==(__t=model.get("name"))?"":__t)+'">\n        </i>\n     </div>\n ';__p+='\n<input id="tag-input" name="tag-input" list="all_tags3" class="tag-input" />\n<datalist id="all_tags3">\n';for(let i=0;i<all_tags.models.length;i++)__p+="\n    ",model=all_tags.models[i],__p+='\n     <option value="'+(null==(__t=model.get("name"))?"":__t)+'">\n';__p+='\n</datalist>\n<input type="hidden" name="tags" value="'+(null==(__t=tags.comma_sep_tags())?"":__t)+'" />\n'}return __p}},function(module,exports){module.exports=function(obj){var __t,__p="",__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,"")};with(obj||{})__p+='<div class="modal-dialog modal-dialog-centered" role="document">\n  <div class="modal-content">\n    <div class="modal-header">\n      <h5 class="modal-title">\n          '+(null==(__t=gettext("Tags"))?"":__t)+'\n      </h5>\n      <button type="button" class="close" data-dismiss="modal" aria-label="Close">\n        <span aria-hidden="true">&times;</span>\n      </button>\n    </div>\n      <div class="modal-body">\n            <div class="modal-body vertical">\n              <form id="new-folder-form" method="POST">\n                <div class="form-group">\n                  <label for="tags">'+(null==(__t=gettext("Tags Editor"))?"":__t)+':</label>\n                  <div class="tags-container d-flex">\n                  </div>\n                  <p class="text-muted">\n                    '+(null==(__t=gettext("Use comma(,) or Enter as tags separator"))?"":__t)+'\n                  </p>\n                </div>\n              </form>\n            </div>\n      </div>\n      <div class="modal-footer">\n            <button type="submit" class="btn btn-success action margin-xs submit_tags">'+(null==(__t=gettext("Submit"))?"":__t)+'</button>\n            <button data-dismiss="modal" class="btn margin-xs btn-secondary cancel">'+(null==(__t=gettext("Cancel"))?"":__t)+"</button></a>\n      </div>\n  </div>\n</div>";return __p}},function(module,exports){module.exports=function(obj){var __t,__p="",__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,"")};with(obj||{})__p+='<div class="modal-dialog modal-dialog-centered" role="document">\n  <div class="modal-content">\n    <div class="modal-header">\n      <h5 class="modal-title">\n          '+(null==(__t=gettext("Multi-Tags"))?"":__t)+'\n      </h5>\n      <button type="button" class="close" data-dismiss="modal" aria-label="Close">\n        <span aria-hidden="true">&times;</span>\n      </button>\n    </div>\n      <div class="modal-body">\n            <div class="modal-body vertical">\n              <form id="new-folder-form" method="POST">\n                  <p>'+(null==(__t=gettext("You selected multiple documents/folders."))?"":__t)+"</p>\n                  <p>"+(null==(__t=gettext("If you add/remove tags here, they will be added/removed on all selected items."))?"":__t)+'</p>\n                  <div class="form-group">\n                    <label for="tags">'+(null==(__t=gettext("Multi-tags Editor"))?"":__t)+':</label>\n                    <div class="tags-container d-flex">\n                     \n                    </div>\n                    <p class="text-muted">\n                      '+(null==(__t=gettext("Use comma(,) or Enter as tags separator"))?"":__t)+'\n                    </p>\n                  </div>\n              </form>\n            </div>\n      </div>\n      <div class="modal-footer">\n            <button type="submit" class="btn btn-success action margin-xs submit_tags">'+(null==(__t=gettext("Submit"))?"":__t)+'</button>\n            <button data-dismiss="modal" class="btn margin-xs btn-secondary cancel">'+(null==(__t=gettext("Cancel"))?"":__t)+"</button></a>\n      </div>\n  </div>\n</div>";return __p}},function(module,exports){module.exports=function(obj){var __t,__p="",__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,"")};with(obj||{}){for(__p+='<div class="modal-dialog modal-dialog-centered" role="document">    <div class="modal-content">\n        <div class="modal-header">\n            <h5>'+(null==(__t=gettext("Permission Editor"))?"":__t)+'</h5>\n            <button type="button" class="close" data-dismiss="modal" aria-label="Close">\n              <span aria-hidden="true">&times;</span>\n            </button>\n        </div>\n        <div class="modal-body">\n            <div class="form-group">\n                <label class="padding-x-xs">'+(null==(__t=gettext("User or Group"))?"":__t)+":</label>\n                <select ",edit||(__p+=" disabled "),__p+=' class="perm_user_or_group form-control" multiple title="'+(null==(__t=gettext("Nothing selected"))?"":__t)+'">\n                    ',i=0;i<usergroups.models.length;i++)__p+="\n                        ",item=usergroups.models[i],__p+="\n                        <option ",item.get("name")==permission.get("name")&&item.get("model")==permission.get("model")&&(__p+=" selected "),__p+=' data-model="'+(null==(__t=item.get("model"))?"":__t)+'">\n                            '+(null==(__t=item.get("name"))?"":__t)+"\n                        </option>\n                    ";__p+='\n                </select>\n            </div>  \n            <div class="form-group">\n                <label class="padding-x-xs">'+(null==(__t=gettext("Type"))?"":__t)+":</label>\n                <select ",edit||(__p+=" disabled "),__p+=' name="access_type" class="access_type">\n                    <option ',"allow"==permission.get("access_type")&&(__p+=" selected "),__p+=' value="allow">'+(null==(__t=gettext("Allow"))?"":__t)+"</option>\n                    <option ","deny"==permission.get("access_type")&&(__p+=" selected "),__p+='  value="deny">'+(null==(__t=gettext("Deny"))?"":__t)+'</option>\n                </select>\n            </div>\n            <formset class="d-flex flex-column">\n                <div class="form-check">\n                    <input ',edit||(__p+=" disabled "),__p+=' class="margin-right-sm checkbox" type="checkbox" name="change_perm" ',permission.get_perm("change_perm")&&(__p+=" checked "),__p+=' >\n                    <label class="padding-x-xs horizonal">'+(null==(__t=gettext("Change Permissions"))?"":__t)+'</label>\n                </div>\n                <div class="form-check">\n                    <input ',edit||(__p+=" disabled "),__p+=' class="margin-right-sm checkbox" type="checkbox" name="take_ownership" ',permission.get_perm("take_ownership")&&(__p+=" checked "),__p+=' >\n                    <label class="padding-x-xs horizonal">'+(null==(__t=gettext("Take Ownership"))?"":__t)+'</label>\n                </div>\n                <div class="form-check">\n                    <input ',edit||(__p+=" disabled "),__p+=' class="margin-right-sm checkbox" type="checkbox" name="read"\n                    ',permission.get_perm("read")&&(__p+=" checked "),__p+='\n                    >\n                    <label class="padding-x-xs horizonal">'+(null==(__t=gettext("Read"))?"":__t)+'</label>\n                </div>\n                <div class="form-check">\n                    <input ',edit||(__p+=" disabled "),__p+=' class="margin-right-sm checkbox" type="checkbox" name="write"\n                    ',permission.get_perm("write")&&(__p+=" checked "),__p+='\n                    >\n                    <label class="padding-x-xs horizonal">'+(null==(__t=gettext("Write"))?"":__t)+'</label>\n                </div>\n                <div class="form-check">\n                    <input ',edit||(__p+=" disabled "),__p+=' class="margin-right-sm checkbox" type="checkbox" name="delete"\n                    ',permission.get_perm("delete")&&(__p+=" checked "),__p+='\n                    >\n                    <label class="padding-x-xs horizonal"> '+(null==(__t=gettext("Delete"))?"":__t)+'</label>\n                </div>\n            </formset>\n        </div>\n        <div class="modal-footer">\n            <button type="submit" class="btn btn-success action margin-xs apply">\n                '+(null==(__t=gettext("Apply"))?"":__t)+'\n            </button>\n            <button data-dismiss="modal" class="btn margin-xs btn-secondary cancel">\n                '+(null==(__t=gettext("Cancel"))?"":__t)+"\n            </button></a>\n        </div>\n    </div> \x3c!-- modal-content --\x3e\n</div> \x3c!-- modal-dialog --\x3e"}return __p}},function(module,exports){module.exports=function(obj){var __t,__p="",__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,"")};with(obj||{}){for(__p+='<div class="modal-dialog modal-lg modal-dialog-centered" role="document">\n    <div class="modal-content">\n        <div class="modal-header">\n            <h5 class="modal-title">'+(null==(__t=gettext("Access"))?"":__t)+" ("+(null==(__t=node.get("title"))?"":__t)+')</h1>\n            <button type="button" class="close" data-dismiss="modal" aria-label="Close">\n              <span aria-hidden="true">&times;</span>\n            </button>\n        </div>\n        <div class="modal-body">\n            <ul id="permission_actions" class="nav nav-pills">\n                <li class="mx-1">\n                    <button id="create_perm" class="btn btn-light btn-bordered">\n                        <i class="fa fa-plus mr-1 text-success"></i>'+(null==(__t=gettext("Create"))?"":__t)+'\n                    </button>\n                </li>\n                <li class="mx-1">\n                    <button id="edit_perm" class="btn btn-light btn-bordered">\n                        <i class="fa fa-edit mr-1 text-success"></i>'+(null==(__t=gettext("Edit"))?"":__t)+'\n                    </button>\n                </li>\n                <li class="mx-1">\n                    <button id="delete_perm" class="btn btn-light btn-bordered">\n                        <i class="fa fa-times mr-1 text-danger"></i>'+(null==(__t=gettext("Delete"))?"":__t)+'\n                    </button>\n                </li>\n                <li class="mx-1">\n                    <button id="readonly_view_perm" class="btn btn-light btn-bordered">\n                         <i class="fa fa-eye mr-1 text-success"></i>'+(null==(__t=gettext("View"))?"":__t)+'\n                    </button>\n                </li>\n            </ul>\n            <table class="table table-striped">\n                <thead class="thead-light">\n                    <tr>\n                        <td>\n                            '+(null==(__t=gettext("User or Group"))?"":__t)+"\n                        </td>\n                        <td>\n                            "+(null==(__t=gettext("Type"))?"":__t)+"\n                        </td>\n                        <td>\n                            "+(null==(__t=gettext("Access"))?"":__t)+'\n                        </td>\n                    </tr>\n                </thead> \x3c!--- header --\x3e\n                <tbody id="access_items">\n                    ',i=0;i<acc_collection.models.length;i++)__p+="\n                        ",item=acc_collection.models[i],__p+='\n                        <tr class="',item.get("access_inherited")&&(__p+="disabled"),__p+='" data-cid="'+(null==(__t=item.cid)?"":__t)+'" data-model="'+(null==(__t=item.get("model"))?"":__t)+'"  data-name="'+(null==(__t=item.get("name"))?"":__t)+'" data-id="'+(null==(__t=item.get("id"))?"":__t)+'">\n                            <td>'+(null==(__t=item.get("name"))?"":__t)+"</td>\n                            <td>"+(null==(__t=gettext(item.human_access_type()))?"":__t)+"</td>\n                            <td>"+(null==(__t=gettext(item.human_perms()))?"":__t)+"</td>\n                        </tr>\n                    ";__p+='\n                </tbody> \x3c!-- end of body --\x3e\n            </table> \x3c!--  table --\x3e\n        </div>\n        <div class="modal-footer">\n            <button type="submit" class="btn btn-success action margin-xs apply">\n                '+(null==(__t=gettext("Apply"))?"":__t)+'\n            </button>\n            <button data-dismiss="modal" class="btn margin-xs btn-secondary cancel">\n                '+(null==(__t=gettext("Cancel"))?"":__t)+"\n            </button></a>\n        </div>\n    </div> \x3c!-- modal content --\x3e\n</div>"}return __p}},function(t,e,n){var i,r;"undefined"!=typeof window&&window,void 0===(r="function"==typeof(i=function(){"use strict";function t(){}var e=t.prototype;return e.on=function(t,e){if(t&&e){var n=this._events=this._events||{},i=n[t]=n[t]||[];return-1==i.indexOf(e)&&i.push(e),this}},e.once=function(t,e){if(t&&e){this.on(t,e);var n=this._onceEvents=this._onceEvents||{};return(n[t]=n[t]||{})[e]=!0,this}},e.off=function(t,e){var n=this._events&&this._events[t];if(n&&n.length){var i=n.indexOf(e);return-1!=i&&n.splice(i,1),this}},e.emitEvent=function(t,e){var n=this._events&&this._events[t];if(n&&n.length){n=n.slice(0),e=e||[];for(var i=this._onceEvents&&this._onceEvents[t],r=0;r<n.length;r++){var s=n[r];i&&i[s]&&(this.off(t,s),delete i[s]),s.apply(this,e)}return this}},e.allOff=function(){delete this._events,delete this._onceEvents},t})?i.call(e,n,e,t):i)||(t.exports=r)},function(module,exports){module.exports=function(obj){var __t,__p="",__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,"")};with(obj||{}){if(__p+='<div class="card">\n    <div class="card-body">\n      <div class="card-title"><label>Info</label></div>\n      <div class="card-text">\n        <ul class="collection">\n            <li class="collection-item">\n                ',"document"==ctype?__p+='\n                    <i class="fa fa-file text-info mr-1"></i>\n                ':__p+='\n                    <i class="fa fa-folder text-warning mr-1"></i>\n                ',__p+="\n                "+(null==(__t=title)?"":__t)+'\n            </li>\n            <li class="collection-item">\n                <label>'+(null==(__t=gettext("Owner"))?"":__t)+":</label> "+(null==(__t=owner)?"":__t)+'\n            </li>\n            <li class="collection-item">\n                <label>'+(null==(__t=gettext("Created"))?"":__t)+":</label> "+(null==(__t=created_at)?"":__t)+'\n            </li>\n            <li class="collection-item">\n                <label>'+(null==(__t=gettext("Modified"))?"":__t)+":</label>  "+(null==(__t=updated_at)?"":__t)+"\n            </li>\n            ",tags.length>0){for(__p+='\n                <li class="collection-item">\n                    <label for="tags">'+(null==(__t=gettext("Tags"))?"":__t)+':\n                    </label>\n                    <div class="document tags-container d-flex">\n                        ',i=0;i<tags.length;i++)__p+="\n                            ",tag=tags[i],__p+='\n                        <div style="background: '+(null==(__t=tag.bg_color)?"":__t)+"; color: "+(null==(__t=tag.fg_color)?"":__t)+";  border: 1px solid "+(null==(__t=tag.bg_color)?"":__t)+'; border-radius: 3px;" class="tag d-flex align-items-center">\n                            <span style="color: '+(null==(__t=tag.fg_color)?"":__t)+'; margin-right: 0.5rem;">'+(null==(__t=tag.name)?"":__t)+"</span>\n                        </div>\n                        ";__p+="\n                    </div>\n                </li>\n            "}__p+='\n            <li class="collection-item d-flex flex-row-reverse bordered">\n                <a href="'+(null==(__t=download_url)?"":__t)+'" class="btn btn-primary text-white btn-flat">\n                    <i class="fa fa-download"></i>\n                    '+(null==(__t=gettext("Download"))?"":__t)+"</a>\n            </li>\n        </ul>\n      </div> \n    </div>\n</div>"}return __p}},function(module,exports){module.exports=function(obj){var __t,__p="",__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,"")};with(obj||{})__p+='<div class="card">\n    <div class="card-body">\n        <div class="card-title">\n        <label>Info</label>\n        </div>\n        <div class="card-text">\n            <ul class="collection">\n                <li class="collection-item">'+(null==(__t=message)?"":__t)+'</li>\n                <li class="collection-item d-flex flex-row-reverse bordered">\n                    <a href="#" class="btn btn-primary btn-flat text-white download">\n                        <i class="fa fa-download"></i>\n                        '+(null==(__t=gettext("Download"))?"":__t)+"</a>\n                </li>\n            </ul>\n        </div> \n    </div>\n</div>";return __p}},function(module,exports){module.exports=function(obj){var __t,__p="",__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,"")};with(obj||{}){for(__p+='<div class="metadata-widget">\n\n    <div class="card">\n        <div class="card-body">\n            <div class="card-title"><label>'+(null==(__t=gettext("Metadata"))?"":__t)+'</label></div>\n            <div class="card-text">\n                <ul class="collection">\n                    <li class="collection-item d-flex flex-row-reverse">\n                        <button class="btn btn-primary btn-flat add-metadata-key" type="button" >\n                            <i class="fa fa-plus"></i>\n                            '+(null==(__t=gettext("Add"))?"":__t)+"\n                        </button>\n                        \n                        <button type='button' class='btn btn-success btn-flat save key mx-1'>\n                            <i class=\"fa fa-save\"></i>\n                            "+(null==(__t=gettext("Save"))?"":__t)+'\n                        </button>\n                    </li>\n                    <ul id="simple_keys" class="collection">\n                        ',i=0;i<kvstore.models.length;i++){for(__p+="\n                            ",item=kvstore.models[i],__p+="\n                            ",current_formats=item.get("current_formats")||[],__p+="\n                            ",kv_types=item.get("kv_types")||available_types||[],__p+="\n                            <li class='collection-item' data-model='simple-key' data-id='"+(null==(__t=item.id)?"":__t)+"' data-cid='"+(null==(__t=item.cid)?"":__t)+"' data-value=\""+(null==(__t=item.get("key"))?"":__t)+'">\n                                <div class="row summary pt-2">\n                                    <div class="col-11 label">\n                                        <input class="widget-form" '+(null==(__t=item.disabled)?"":__t)+" data-id='"+(null==(__t=item.id)?"":__t)+"' data-cid='"+(null==(__t=item.cid)?"":__t)+"' placeholder=\""+(null==(__t=gettext("label name"))?"":__t)+"...\" name='key' type='text' value=\""+(null==(__t=item.get("key"))?"":__t)+'">\n                                    </div>\n                                    <div class="col-1 close"  data-id=\''+(null==(__t=item.id)?"":__t)+"' data-cid='"+(null==(__t=item.cid)?"":__t)+"'>\n                                        ",item.get("kv_inherited")||(__p+="\n                                            <button type='button' class='close key mx-1 text-danger' aria-label='Close'>\n                                                <span aria-hidden='true'>&times;</span>\n                                            </button>\n                                        "),__p+='\n                                    </div>\n                                </div>\n                                <div class="row pt-2">\n                                    <div class="col-12">\n                                        <select '+(null==(__t=item.disabled)?"":__t)+'  class="kv_type custom-select" name=\'kv_type\' class="custom-select">\n                                            ',k=0;k<kv_types.length;k++)__p+="\n                                                <option \n                                                    ",item.get("kv_type")==kv_types[k][0]&&(__p+=" selected  "),__p+=' \n                                                    value="'+(null==(__t=kv_types[k][0])?"":__t)+'">\n                                                    '+(null==(__t=kv_types[k][1])?"":__t)+"\n                                                </option>\n                                            ";if(__p+="\n                                        </select>\n                                    </div>\n                                </div>\n                                ",current_formats.length){for(__p+='\n                                    <div class="row pt-2">\n                                        <div class="col-12">\n                                            <select '+(null==(__t=item.disabled)?"":__t)+' class="kv_format custom-select" name=\'kv_format\' class="custom-select">\n                                                ',j=0;j<current_formats.length;j++)__p+="\n                                                    <option \n                                                         ",item.get("kv_format")==current_formats[j][0]&&(__p+=" selected  "),__p+=' \n                                                        value="'+(null==(__t=current_formats[j][0])?"":__t)+'">\n                                                        '+(null==(__t=current_formats[j][1])?"":__t)+"\n                                                    </option>\n                                                ";__p+="\n                                            </select>\n                                        </div>\n                                    </div>\n                                "}__p+="\n                               \n                            </li>\n                        "}__p+="\n                     </ul>\n                </ul>\n            </div> \x3c!-- card-text --\x3e\n        </div> \x3c!-- card-body --\x3e\n    </div> \x3c!-- card --\x3e\n\n</div> \x3c!-- metadata-widget --\x3e"}return __p}},function(module,exports){module.exports=function(obj){var __t,__p="",__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,"")};with(obj||{}){for(__p+='<div class="metadata-widget">\n\n    <div class="card">\n        <div class="card-body">\n            <div class="card-title"><label>'+(null==(__t=gettext("Metadata"))?"":__t)+'</label></div>\n            <div class="card-text">\n                <ul class="collection">\n                    <li class="collection-item d-flex flex-row-reverse">\n                        <button class="btn btn-primary btn-flat add-metadata-key" type="button" >\n                            <i class="fa fa-plus"></i>\n                            '+(null==(__t=gettext("Add"))?"":__t)+"\n                        </button>\n                        \n                        <button type='button' class='btn btn-success btn-flat save key mx-1'>\n                            <i class=\"fa fa-save\"></i>\n                            "+(null==(__t=gettext("Save"))?"":__t)+'\n                        </button>\n                    </li>\n                    <ul id="simple_keys" class="collection">\n                        ',i=0;i<kvstore.models.length;i++){for(__p+="\n                            ",item=kvstore.models[i],__p+="\n                            ",current_formats=item.get("current_formats")||[],__p+="\n                            ",kv_types=item.get("kv_types")||available_types||[],__p+="\n                            <li class='collection-item' data-model='simple-key' data-id='"+(null==(__t=item.id)?"":__t)+"' data-cid='"+(null==(__t=item.cid)?"":__t)+"' data-value=\""+(null==(__t=item.get("key"))?"":__t)+'">\n                                \x3c!-- KEY BEGIN --\x3e\n                                <div class="row summary pt-2">\n                                    <div class="col-11 label">\n                                        <input class="widget-form" '+(null==(__t=item.disabled)?"":__t)+" data-id='"+(null==(__t=item.id)?"":__t)+"' data-cid='"+(null==(__t=item.cid)?"":__t)+"' placeholder=\""+(null==(__t=gettext("label name"))?"":__t)+"...\" name='key' type='text' value=\""+(null==(__t=item.get("key"))?"":__t)+'">\n                                    </div>\n                                    <div class="col-1 close"  data-id=\''+(null==(__t=item.id)?"":__t)+"' data-cid='"+(null==(__t=item.cid)?"":__t)+"'>\n                                        ",item.get("kv_inherited")||(__p+="\n                                            <button type='button' class='close key mx-1 text-danger' aria-label='Close'>\n                                                <span aria-hidden='true'>&times;</span>\n                                            </button>\n                                        "),__p+='\n                                    </div>\n                                </div>\n                                \x3c!-- KEY END --\x3e\n                                \x3c!-- VALUE BEGIN --\x3e\n                                    <div class="row summary pt-2">\n                                        <div class="col-11 label">\n                                            <input class="widget-form"  data-id=\''+(null==(__t=item.id)?"":__t)+"' data-cid='"+(null==(__t=item.cid)?"":__t)+"' placeholder=\""+(null==(__t=gettext("value"))?"":__t)+"...\" name='value' type='text' value=\""+(null==(__t=item.get("value"))?"":__t)+'">\n                                        </div>\n                                        <div class="col-1 chevron toggle"  data-id=\''+(null==(__t=item.id)?"":__t)+"' data-cid='"+(null==(__t=item.cid)?"":__t)+'\'>\n                                            <a>\n                                                <i class="fa fa-chevron-left"></i>\n                                            </a>\n                                        </div>\n                                    </div>                                \n                                \x3c!-- VALUE END --\x3e\n                                <div class="row details d-none pt-2">\n                                    <div class="col-12">\n                                        <select '+(null==(__t=item.disabled)?"":__t)+'  class="kv_type custom-select" name=\'kv_type\' class="custom-select">\n                                            ',k=0;k<kv_types.length;k++)__p+="\n                                                <option \n                                                    ",item.get("kv_type")==kv_types[k][0]&&(__p+=" selected  "),__p+=' \n                                                    value="'+(null==(__t=kv_types[k][0])?"":__t)+'">\n                                                    '+(null==(__t=kv_types[k][1])?"":__t)+"\n                                                </option>\n                                            ";if(__p+="\n                                        </select>\n                                    </div>\n                                </div>\n                                ",current_formats.length){for(__p+='\n                                    <div class="row details d-none pt-2">\n                                        <div class="col-12">\n                                            <select '+(null==(__t=item.disabled)?"":__t)+' class="kv_format custom-select" name=\'kv_format\' class="custom-select">\n                                                ',j=0;j<current_formats.length;j++)__p+="\n                                                    <option \n                                                         ",item.get("kv_format")==current_formats[j][0]&&(__p+=" selected  "),__p+=' \n                                                        value="'+(null==(__t=current_formats[j][0])?"":__t)+'">\n                                                        '+(null==(__t=current_formats[j][1])?"":__t)+"\n                                                    </option>\n                                                ";__p+="\n                                            </select>\n                                        </div>\n                                    </div>\n                                "}__p+="\n                               \n                            </li>\n                        "}__p+="\n                     </ul>\n                </ul>\n            </div> \x3c!-- card-text --\x3e\n        </div> \x3c!-- card-body --\x3e\n    </div> \x3c!-- card --\x3e\n\n</div> \x3c!-- metadata-widget --\x3e"}return __p}},function(module,exports){module.exports=function(obj){var __t,__p="",__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,"")};with(obj||{}){__p+='<div class="card">\n    <div class="card-body">\n      <div class="card-title">\n        <label>'+(null==(__t=verbose_name)?"":__t)+'</label>\n    </div>\n      <div class="card-text">\n        <select class="custom-select">\n            ';for(let x=0;x<policy_choices.length;x++)__p+="\n                ",choice=policy_choices[x],__p+='\n                <option id="'+(null==(__t=choice[0])?"":__t)+'" '+(null==(__t=choice[2])?"":__t)+" >\n                    "+(null==(__t=choice[1])?"":__t)+"\n                </option>\n            ";__p+='\n        </select>\n        <div id="current_policy_states">\n            '+(null==(__t=current_policy_states)?"":__t)+"\n        </div>\n    </div>\n</div>"}return __p}},function(module,exports){module.exports=function(obj){var __t,__p="",__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,"")};with(obj||{}){for(__p+='<ul class="collection">\n    ',i=0;i<states.length;i++)__p+="\n        ",state=states[i],__p+='\n        <li class="collection-item mt-2 '+(null==(__t=state.selected)?"":__t)+' d-flex justify-content-left p-2">\n            <div>\n                <span class="mr-1">'+(null==(__t=state.number+1)?"":__t)+".</span>\n                ","user"==state.left?__p+=' \n                    <i class="fa fa-user text-success mr-3"></i>\n                ':__p+='\n                    <span class="mr-3">'+(null==(__t=state.left)?"":__t)+"</span>\n                ",__p+='\n            </div>\n            <div>\n                <i class="fa fa-arrow-right mr-3"></i>\n            </div>\n            <div>\n                ',"trash"==state.right?__p+=' \n                    <i class="fa fa-trash mr-3"></i>\n                ':"purge"==state.right?__p+='\n                    <i class="fa fa-times text-danger mr-2"></i>\n                ':"deny"==state.right&&(__p+='\n                    <i class="fa fa-ban text-danger mr-2"></i>\n                '),__p+="\n            </div>\n        </li>\n    ";__p+="\n</ul>"}return __p}},function(module,exports){module.exports=function(obj){var __t,__p="",__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,"")};with(obj||{})__p+='<div class="modal-dialog modal-lg modal-dialog-centered" role="document">\n  <div class="modal-content">\n    <div class="modal-header">\n      <h5 class="modal-title">\n          '+(null==(__t=gettext("Page OCRed Text"))?"":__t)+'\n      </h5>\n      <button type="button" class="close" data-dismiss="modal" aria-label="Close">\n        <span aria-hidden="true">&times;</span>\n      </button>\n    </div>\n      <div class="modal-body">\n        <h5 class="text-center m-3">\n          Page number '+(null==(__t=page_number)?"":__t)+". Document version "+(null==(__t=document_version)?"":__t)+'.\n        </h5>\n        <p class="mb-3">\n          '+(null==(__t=page_text)?"":__t)+'\n        </p>\n      </div>\n      <div class="modal-footer">\n            <button type="submit" class="btn btn-success action margin-xs ok" >OK</button>\n      </div>\n  </div>\n</div>\n';return __p}},function(module,exports){module.exports=function(obj){var __t,__p="",__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,"")};with(obj||{})__p+='<label class="tag" style="background: '+(null==(__t=bg_color)?"":__t)+";color: "+(null==(__t=fg_color)?"":__t)+'; margin: 1rem 0; padding: 0.25rem 0.5rem; border-radius: 0.5rem;">\n    '+(null==(__t=name)?"":__t)+"\n</label>";return __p}},function(module,exports){module.exports=function(obj){var __t,__p="",__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,"")};with(obj||{})__p+='<div class="modal-dialog modal-dialog-centered" role="document">\n  <div class="modal-content">\n    <div class="modal-header">\n      <h5 class="modal-title">\n          '+(null==(__t=gettext("About"))?"":__t)+'\n      </h5>\n      <button type="button" class="close" data-dismiss="modal" aria-label="Close">\n        <span aria-hidden="true">&times;</span>\n      </button>\n    </div>\n      <div class="modal-body">\n        <h3 class="text-center m-3">\n          Papermerge '+(null==(__t=version)?"":__t)+'\n        </h3>\n        <p class="text-center mb-3">License <a target="_blank" href="https://github.com/ciur/papermerge/blob/master/LICENSE">Apache 2.0</a></p>\n        <p>Papermerge is a document management system designed for scanned documents, digital archives and electronic records.</p>\n        <h5 class="text-center m-3">Resources</h5>\n        <ul class="d-flex flex-column align-items-center p-0">\n          <li><a target="_blank" href="https://www.papermerge.com">www.papermerge.com</a></li>\n          <li><a target="_blank" href="https://www.papermerge.com/docs">Documentation</a></li>\n          <li><a target="_blank" href="https://www.papermerge.com/blog">Blog</a></li>\n          <li><a target="_blank" href="https://www.youtube.com/channel/UC8KjEsDexEERBw_-VyDbWDg">Youtube Channel</a></li>\n          <li><a target="_blank" href="https://github.com/ciur/papermerge">Source Code</a></li>\n          <li><a target="_blank" href="https://twitter.com/papermerge">Twitter</a></li>\n        </ul>\n        \n      </div>\n      <div class="modal-footer">\n            <button type="submit" class="btn btn-success action margin-xs ok" >OK</button>\n      </div>\n  </div>\n</div>\n';return __p}},function(t,e,n){
/*!
  * Bootstrap tab.js v4.5.2 (https://getbootstrap.com/)
  * Copyright 2011-2020 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
  */
t.exports=function(t,e){"use strict";function n(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}t=t&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t,e=e&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e;var i=t.fn.tab,r=function(){function i(t){this._element=t}var r,s,o,a=i.prototype;return a.show=function(){var n=this;if(!(this._element.parentNode&&this._element.parentNode.nodeType===Node.ELEMENT_NODE&&t(this._element).hasClass("active")||t(this._element).hasClass("disabled"))){var i,r,s=t(this._element).closest(".nav, .list-group")[0],o=e.getSelectorFromElement(this._element);if(s){var a="UL"===s.nodeName||"OL"===s.nodeName?"> li > .active":".active";r=(r=t.makeArray(t(s).find(a)))[r.length-1]}var l=t.Event("hide.bs.tab",{relatedTarget:this._element}),c=t.Event("show.bs.tab",{relatedTarget:r});if(r&&t(r).trigger(l),t(this._element).trigger(c),!c.isDefaultPrevented()&&!l.isDefaultPrevented()){o&&(i=document.querySelector(o)),this._activate(this._element,s);var u=function(){var e=t.Event("hidden.bs.tab",{relatedTarget:n._element}),i=t.Event("shown.bs.tab",{relatedTarget:r});t(r).trigger(e),t(n._element).trigger(i)};i?this._activate(i,i.parentNode,u):u()}}},a.dispose=function(){t.removeData(this._element,"bs.tab"),this._element=null},a._activate=function(n,i,r){var s=this,o=(!i||"UL"!==i.nodeName&&"OL"!==i.nodeName?t(i).children(".active"):t(i).find("> li > .active"))[0],a=r&&o&&t(o).hasClass("fade"),l=function(){return s._transitionComplete(n,o,r)};if(o&&a){var c=e.getTransitionDurationFromElement(o);t(o).removeClass("show").one(e.TRANSITION_END,l).emulateTransitionEnd(c)}else l()},a._transitionComplete=function(n,i,r){if(i){t(i).removeClass("active");var s=t(i.parentNode).find("> .dropdown-menu .active")[0];s&&t(s).removeClass("active"),"tab"===i.getAttribute("role")&&i.setAttribute("aria-selected",!1)}if(t(n).addClass("active"),"tab"===n.getAttribute("role")&&n.setAttribute("aria-selected",!0),e.reflow(n),n.classList.contains("fade")&&n.classList.add("show"),n.parentNode&&t(n.parentNode).hasClass("dropdown-menu")){var o=t(n).closest(".dropdown")[0];if(o){var a=[].slice.call(o.querySelectorAll(".dropdown-toggle"));t(a).addClass("active")}n.setAttribute("aria-expanded",!0)}r&&r()},i._jQueryInterface=function(e){return this.each((function(){var n=t(this),r=n.data("bs.tab");if(r||(r=new i(this),n.data("bs.tab",r)),"string"==typeof e){if(void 0===r[e])throw new TypeError('No method named "'+e+'"');r[e]()}}))},r=i,o=[{key:"VERSION",get:function(){return"4.5.2"}}],(s=null)&&n(r.prototype,s),o&&n(r,o),i}();return t(document).on("click.bs.tab.data-api",'[data-toggle="tab"], [data-toggle="pill"], [data-toggle="list"]',(function(e){e.preventDefault(),r._jQueryInterface.call(t(this),"show")})),t.fn.tab=r._jQueryInterface,t.fn.tab.Constructor=r,t.fn.tab.noConflict=function(){return t.fn.tab=i,r._jQueryInterface},r}(n(0),n(18))},function(t,e,n){
/*!
  * Bootstrap modal.js v4.5.2 (https://getbootstrap.com/)
  * Copyright 2011-2020 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
  */
t.exports=function(t,e){"use strict";function n(){return(n=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t}).apply(this,arguments)}function i(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}t=t&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t,e=e&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e;var r="modal",s=".bs.modal",o=t.fn[r],a={backdrop:!0,keyboard:!0,focus:!0,show:!0},l={backdrop:"(boolean|string)",keyboard:"boolean",focus:"boolean",show:"boolean"},c=function(){function o(t,e){this._config=this._getConfig(e),this._element=t,this._dialog=t.querySelector(".modal-dialog"),this._backdrop=null,this._isShown=!1,this._isBodyOverflowing=!1,this._ignoreBackdropClick=!1,this._isTransitioning=!1,this._scrollbarWidth=0}var c,u,d,h=o.prototype;return h.toggle=function(t){return this._isShown?this.hide():this.show(t)},h.show=function(e){var n=this;if(!this._isShown&&!this._isTransitioning){t(this._element).hasClass("fade")&&(this._isTransitioning=!0);var i=t.Event("show.bs.modal",{relatedTarget:e});t(this._element).trigger(i),this._isShown||i.isDefaultPrevented()||(this._isShown=!0,this._checkScrollbar(),this._setScrollbar(),this._adjustDialog(),this._setEscapeEvent(),this._setResizeEvent(),t(this._element).on("click.dismiss.bs.modal",'[data-dismiss="modal"]',(function(t){return n.hide(t)})),t(this._dialog).on("mousedown.dismiss.bs.modal",(function(){t(n._element).one("mouseup.dismiss.bs.modal",(function(e){t(e.target).is(n._element)&&(n._ignoreBackdropClick=!0)}))})),this._showBackdrop((function(){return n._showElement(e)})))}},h.hide=function(n){var i=this;if(n&&n.preventDefault(),this._isShown&&!this._isTransitioning){var r=t.Event("hide.bs.modal");if(t(this._element).trigger(r),this._isShown&&!r.isDefaultPrevented()){this._isShown=!1;var s=t(this._element).hasClass("fade");if(s&&(this._isTransitioning=!0),this._setEscapeEvent(),this._setResizeEvent(),t(document).off("focusin.bs.modal"),t(this._element).removeClass("show"),t(this._element).off("click.dismiss.bs.modal"),t(this._dialog).off("mousedown.dismiss.bs.modal"),s){var o=e.getTransitionDurationFromElement(this._element);t(this._element).one(e.TRANSITION_END,(function(t){return i._hideModal(t)})).emulateTransitionEnd(o)}else this._hideModal()}}},h.dispose=function(){[window,this._element,this._dialog].forEach((function(e){return t(e).off(s)})),t(document).off("focusin.bs.modal"),t.removeData(this._element,"bs.modal"),this._config=null,this._element=null,this._dialog=null,this._backdrop=null,this._isShown=null,this._isBodyOverflowing=null,this._ignoreBackdropClick=null,this._isTransitioning=null,this._scrollbarWidth=null},h.handleUpdate=function(){this._adjustDialog()},h._getConfig=function(t){return t=n({},a,t),e.typeCheckConfig(r,t,l),t},h._triggerBackdropTransition=function(){var n=this;if("static"===this._config.backdrop){var i=t.Event("hidePrevented.bs.modal");if(t(this._element).trigger(i),i.defaultPrevented)return;var r=this._element.scrollHeight>document.documentElement.clientHeight;r||(this._element.style.overflowY="hidden"),this._element.classList.add("modal-static");var s=e.getTransitionDurationFromElement(this._dialog);t(this._element).off(e.TRANSITION_END),t(this._element).one(e.TRANSITION_END,(function(){n._element.classList.remove("modal-static"),r||t(n._element).one(e.TRANSITION_END,(function(){n._element.style.overflowY=""})).emulateTransitionEnd(n._element,s)})).emulateTransitionEnd(s),this._element.focus()}else this.hide()},h._showElement=function(n){var i=this,r=t(this._element).hasClass("fade"),s=this._dialog?this._dialog.querySelector(".modal-body"):null;this._element.parentNode&&this._element.parentNode.nodeType===Node.ELEMENT_NODE||document.body.appendChild(this._element),this._element.style.display="block",this._element.removeAttribute("aria-hidden"),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),t(this._dialog).hasClass("modal-dialog-scrollable")&&s?s.scrollTop=0:this._element.scrollTop=0,r&&e.reflow(this._element),t(this._element).addClass("show"),this._config.focus&&this._enforceFocus();var o=t.Event("shown.bs.modal",{relatedTarget:n}),a=function(){i._config.focus&&i._element.focus(),i._isTransitioning=!1,t(i._element).trigger(o)};if(r){var l=e.getTransitionDurationFromElement(this._dialog);t(this._dialog).one(e.TRANSITION_END,a).emulateTransitionEnd(l)}else a()},h._enforceFocus=function(){var e=this;t(document).off("focusin.bs.modal").on("focusin.bs.modal",(function(n){document!==n.target&&e._element!==n.target&&0===t(e._element).has(n.target).length&&e._element.focus()}))},h._setEscapeEvent=function(){var e=this;this._isShown?t(this._element).on("keydown.dismiss.bs.modal",(function(t){e._config.keyboard&&27===t.which?(t.preventDefault(),e.hide()):e._config.keyboard||27!==t.which||e._triggerBackdropTransition()})):this._isShown||t(this._element).off("keydown.dismiss.bs.modal")},h._setResizeEvent=function(){var e=this;this._isShown?t(window).on("resize.bs.modal",(function(t){return e.handleUpdate(t)})):t(window).off("resize.bs.modal")},h._hideModal=function(){var e=this;this._element.style.display="none",this._element.setAttribute("aria-hidden",!0),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._isTransitioning=!1,this._showBackdrop((function(){t(document.body).removeClass("modal-open"),e._resetAdjustments(),e._resetScrollbar(),t(e._element).trigger("hidden.bs.modal")}))},h._removeBackdrop=function(){this._backdrop&&(t(this._backdrop).remove(),this._backdrop=null)},h._showBackdrop=function(n){var i=this,r=t(this._element).hasClass("fade")?"fade":"";if(this._isShown&&this._config.backdrop){if(this._backdrop=document.createElement("div"),this._backdrop.className="modal-backdrop",r&&this._backdrop.classList.add(r),t(this._backdrop).appendTo(document.body),t(this._element).on("click.dismiss.bs.modal",(function(t){i._ignoreBackdropClick?i._ignoreBackdropClick=!1:t.target===t.currentTarget&&i._triggerBackdropTransition()})),r&&e.reflow(this._backdrop),t(this._backdrop).addClass("show"),!n)return;if(!r)return void n();var s=e.getTransitionDurationFromElement(this._backdrop);t(this._backdrop).one(e.TRANSITION_END,n).emulateTransitionEnd(s)}else if(!this._isShown&&this._backdrop){t(this._backdrop).removeClass("show");var o=function(){i._removeBackdrop(),n&&n()};if(t(this._element).hasClass("fade")){var a=e.getTransitionDurationFromElement(this._backdrop);t(this._backdrop).one(e.TRANSITION_END,o).emulateTransitionEnd(a)}else o()}else n&&n()},h._adjustDialog=function(){var t=this._element.scrollHeight>document.documentElement.clientHeight;!this._isBodyOverflowing&&t&&(this._element.style.paddingLeft=this._scrollbarWidth+"px"),this._isBodyOverflowing&&!t&&(this._element.style.paddingRight=this._scrollbarWidth+"px")},h._resetAdjustments=function(){this._element.style.paddingLeft="",this._element.style.paddingRight=""},h._checkScrollbar=function(){var t=document.body.getBoundingClientRect();this._isBodyOverflowing=Math.round(t.left+t.right)<window.innerWidth,this._scrollbarWidth=this._getScrollbarWidth()},h._setScrollbar=function(){var e=this;if(this._isBodyOverflowing){var n=[].slice.call(document.querySelectorAll(".fixed-top, .fixed-bottom, .is-fixed, .sticky-top")),i=[].slice.call(document.querySelectorAll(".sticky-top"));t(n).each((function(n,i){var r=i.style.paddingRight,s=t(i).css("padding-right");t(i).data("padding-right",r).css("padding-right",parseFloat(s)+e._scrollbarWidth+"px")})),t(i).each((function(n,i){var r=i.style.marginRight,s=t(i).css("margin-right");t(i).data("margin-right",r).css("margin-right",parseFloat(s)-e._scrollbarWidth+"px")}));var r=document.body.style.paddingRight,s=t(document.body).css("padding-right");t(document.body).data("padding-right",r).css("padding-right",parseFloat(s)+this._scrollbarWidth+"px")}t(document.body).addClass("modal-open")},h._resetScrollbar=function(){var e=[].slice.call(document.querySelectorAll(".fixed-top, .fixed-bottom, .is-fixed, .sticky-top"));t(e).each((function(e,n){var i=t(n).data("padding-right");t(n).removeData("padding-right"),n.style.paddingRight=i||""}));var n=[].slice.call(document.querySelectorAll(".sticky-top"));t(n).each((function(e,n){var i=t(n).data("margin-right");void 0!==i&&t(n).css("margin-right",i).removeData("margin-right")}));var i=t(document.body).data("padding-right");t(document.body).removeData("padding-right"),document.body.style.paddingRight=i||""},h._getScrollbarWidth=function(){var t=document.createElement("div");t.className="modal-scrollbar-measure",document.body.appendChild(t);var e=t.getBoundingClientRect().width-t.clientWidth;return document.body.removeChild(t),e},o._jQueryInterface=function(e,i){return this.each((function(){var r=t(this).data("bs.modal"),s=n({},a,t(this).data(),"object"==typeof e&&e?e:{});if(r||(r=new o(this,s),t(this).data("bs.modal",r)),"string"==typeof e){if(void 0===r[e])throw new TypeError('No method named "'+e+'"');r[e](i)}else s.show&&r.show(i)}))},c=o,d=[{key:"VERSION",get:function(){return"4.5.2"}},{key:"Default",get:function(){return a}}],(u=null)&&i(c.prototype,u),d&&i(c,d),o}();return t(document).on("click.bs.modal.data-api",'[data-toggle="modal"]',(function(i){var r,s=this,o=e.getSelectorFromElement(this);o&&(r=document.querySelector(o));var a=t(r).data("bs.modal")?"toggle":n({},t(r).data(),t(this).data());"A"!==this.tagName&&"AREA"!==this.tagName||i.preventDefault();var l=t(r).one("show.bs.modal",(function(e){e.isDefaultPrevented()||l.one("hidden.bs.modal",(function(){t(s).is(":visible")&&s.focus()}))}));c._jQueryInterface.call(t(r),a,this)})),t.fn[r]=c._jQueryInterface,t.fn[r].Constructor=c,t.fn[r].noConflict=function(){return t.fn[r]=o,c._jQueryInterface},c}(n(0),n(18))},function(t,e,n){},function(t,e,n){"use strict";n.r(e);var i=n(0),r=n.n(i);class s{constructor(t,e=.25){this._dom_ref=t,this._is_active=!1,this._startX=0,this._startY=0,this._scrollLeft=this._dom_ref.scrollLeft,this._scrollTop=this._dom_ref.scrollTop,this._speed=e,this._config_events()}_config_events(){let t=this;this._dom_ref.addEventListener("mousedown",e=>{"text"!=e.srcElement.tagName?(t._is_active=!0,t._startX=e.pageX-t._dom_ref.offsetLeft,t._startY=e.pageY-t._dom_ref.offsetTop):t._is_active=!1}),this._dom_ref.addEventListener("mouseleave",()=>{t._is_active=!1}),this._dom_ref.addEventListener("mouseup",()=>{t._is_active=!1}),this._dom_ref.addEventListener("mousemove",e=>{if(!t._is_active)return;e.preventDefault();const n=e.pageX-t._dom_ref.offsetLeft,i=e.pageY-t._dom_ref.offsetTop,r=n-t._startX,s=i-t._startY;t._dom_ref.scrollLeft=t._dom_ref.scrollLeft-r*t._speed,t._dom_ref.scrollTop=t._dom_ref.scrollTop-s*t._speed})}}var o=n(2),a=n(23),l=n(4),c=n(1),u=n.n(c);let d=n(27),h="asc";class _ extends c.View{el(){return r()("#display-mode")}initialize(){this.display=this.get_local("display_mode")||"grid",this.sort_field=this.get_local("sort_field")||"title",this.sort_order=this.get_local("sort_order")||"asc",this.listenTo(this,"change",this.render),this.render()}events(){return{"click .display-list":"display_list","click .display-grid":"display_grid","click .sort.title.asc":"sort_by_title_asc","click .sort.title.desc":"sort_by_title_desc","click .sort.date.asc":"sort_by_date_asc","click .sort.date.desc":"sort_by_date_desc","click .sort.type.asc":"sort_by_type_asc","click .sort.type.desc":"sort_by_type_desc"}}sort_by_title_desc(t){t.preventDefault(),this.sort_field="title",this.sort_order="desc",this.set_local("sort_field","title"),this.set_local("sort_order","desc"),this.trigger("change")}sort_by_title_asc(t){t.preventDefault(),this.sort_field="title",this.sort_order=h,this.set_local("sort_field","title"),this.set_local("sort_order",h),this.trigger("change")}sort_by_date_asc(t){t.preventDefault(),this.sort_field="date",this.sort_order=h,this.set_local("sort_field","date"),this.set_local("sort_order",h),this.trigger("change")}sort_by_date_desc(t){t.preventDefault(),this.sort_field="date",this.sort_order="desc",this.set_local("sort_field","date"),this.set_local("sort_order","desc"),this.trigger("change")}sort_by_type_asc(t){t.preventDefault(),this.sort_field="type",this.sort_order=h,this.set_local("sort_field","type"),this.set_local("sort_order",h),this.trigger("change")}sort_by_type_desc(t){t.preventDefault(),this.sort_field="type",this.sort_order="desc",this.set_local("sort_field","type"),this.set_local("sort_order","desc"),this.trigger("change")}get_local(t){return localStorage.getItem(t)}set_local(t,e){return localStorage.setItem(t,e)}is_list(){return"list"==this.display}is_grid(){return"grid"==this.display}display_list(t){t.preventDefault(),this.display="list",this.set_local("display_mode","list"),this.trigger("change")}display_grid(t){t.preventDefault(),this.display="grid",this.set_local("display_mode","grid"),this.trigger("change")}get_order_by(){return this.sort_order==h?this.sort_field:"-"+this.sort_field}render(){let t,e;e={},t=o.default.template(d({is_list:this.is_list(),is_grid:this.is_grid(),sort_field:this.sort_field,sort_order:this.sort_order})),this.$el.html(t)}}var f=n(5);class p extends c.Model{defaults(){return{title:"",size:"",file:"",msg:"",lang:"",status:"",file_type:"",parent_id:-1,progress:0}}initialize(t,e,n){n||(n=-1),this.set({title:Object(l.f)(t.name),size:t.size,file:t,lang:e,file_type:t.type,progress:0,parent_id:n,status:p.INIT}),this.send()}static get INIT(){return"init"}static get UPLOAD_START(){return"upload_start"}static get UPLOAD_ERROR(){return"upload_error"}static get UPLOAD_SUCCESS(){return"upload_success"}static get UPLOAD_PROGRESS(){return"upload_progress"}is_success(){return this.get("status")==p.UPLOAD_SUCCESS}is_error(){return this.get("status")==p.UPLOAD_ERROR}is_progress(){return this.get("status")==p.UPLOAD_PROGRESS}get human_size(){return Object(l.e)(this.get("size"))}set_progress(t){this.set("progress",t),this.trigger("change")}_build_form_data(){let t;return t=new FormData,t.append("language",this.get("lang")),t.append("file_name",this.get("file_name")),t.append("file_type",this.get("file_type")),t.append("parent",this.get("parent_id")),t.append("file",this.get("file")),t}send(){let t,e,n,i=this;t=new XMLHttpRequest,t.addEventListener("progress",(function(t){let n=JSON.parse(t.currentTarget.response);403==t.currentTarget.status?(i.set({status:p.UPLOAD_ERROR}),n&&n.msg&&(i.set({msg:n.msg}),new f.a("danger",n.msg))):t.lengthComputable&&(e=Math.round(100*t.loaded/t.total),i.set_progress(e))})),t.addEventListener("error",(function(t){let e=JSON.parse(t.currentTarget.response);console.log("Transfer failed for "+i.get("title")),i.set({status:p.UPLOAD_ERROR}),e&&e.msg&&(i.set({msg:e.msg}),new f.a("danger",e.msg))})),t.addEventListener("load",(function(t){let e=JSON.parse(t.currentTarget.response);console.log("Complete? status = "+t.currentTarget.status),200==t.currentTarget.status?i.set({status:p.UPLOAD_SUCCESS}):500==t.currentTarget.status?i.set({status:p.UPLOAD_ERROR}):400==t.currentTarget.status&&(i.set({status:p.UPLOAD_ERROR}),e&&e.msg&&i.set({msg:e.msg}))})),n=r()("[name=csrfmiddlewaretoken]").val(),t.open("POST","/upload/"),t.setRequestHeader("X-CSRFToken",n),t.send(this._build_form_data())}}class g extends c.Collection{get model(){return p}get progress(){let t=0;return this.each((function(e){t+=e.get("progress")})),this.length>0&&(t/=this.length),t}get_summary_status(){let t={success:0,error:0};return this.each((function(e){e.is_success()&&(t.success+=1),e.is_error()&&(t.error+=1)})),t}is_summary_success(){return this.get_summary_status().success==this.length}is_summary_error(){return this.get_summary_status().error>0}}var m=n(3);let v=n(28);class y extends c.View{el(){return r()("#uploader-view")}initialize(t,e,n){this.uploader=new g;for(let i of t)this.uploader.add(new p(i,e,n));this.listenTo(this.uploader,"change",this.render),this.listenTo(this.uploader,"change",this.refresh_node_list),this.render()}refresh_node_list(){m.l.trigger(m.a)}events(){return{"click .close":"close","click button.toggle-details":"toggle_details"}}toggle_details(t){this.$el.find(".uploader-details").toggleClass("hidden")}close(t){this.$el.html("")}render(){let t,e;e={},this.uploader.length&&(t=o.default.template(v({files:this.uploader})),this.$el.html(t))}}class b extends c.View{el(){return r()(".content-wrapper")}initialize(t){this.browse=t}events(){return{dragenter:"dragenter",dragover:"dragover",drop:"drop"}}dragenter(t){t.stopPropagation(),t.preventDefault(),r()(".content-wrapper").addClass("dragover")}dragover(t){t.stopPropagation(),t.preventDefault()}drop(t){let e,n,i,s;t.stopPropagation(),t.preventDefault(),e=t.originalEvent.dataTransfer,n=e.files,s=r()("#lang").val(),i=new y(n,s,this.browse.get("parent_id")),r()(".content-wrapper").removeClass("dragover")}}class w extends c.View{el(){return r()("#pagination-view")}template(t={}){let e,i,r="",s=n(29);return r=t.parent_id?"#"+t.parent_id:window.location.hash.split("?")[0],i={page_number:t.page_number||1,pages:t.pages||[],num_pages:t.num_pages||0,page:{has_previous:!1,has_next:!1,previous_page_number:1,next_page_number:1},prefix:r},e=o.default.template(s(i)),e()}render(t){let e=this.template(t);this.$el.html(e)}}n(30);class x extends c.Router{constructor(t,e,n){super(),this.browse_view=t,this.breadcrumb_view=e,this.actions_view=n}preinitialize(){let t=this;m.l.on(m.f,(function(e){e&&t.navigate("/"+e,{trigger:!0})}))}routes(){return{":node_id":"browse","tagged/:name":"tagged","*path":"browse"}}tagged(t){this.browse_view.open(void 0,t)}browse(t){t||r()("#root_node_id").length>0&&(t=r()("#root_node_id").val()),this.browse_view.open(t),this.breadcrumb_view.open(t),this.actions_view.set_parent(t)}}let k=n(35),E=n(36),T=o.default.clone(u.a.Events);class C{css_id(){return"desktop-like-selection"}constructor(t,e,n){this.start_x=e,this.start_y=n,this.current_x=n,this.current_y=n,this.height=0,this.width=0,this.$parent=r()(t),this.$select=void 0}create_div(){this.$select||(this.$select=this._create_selection_div(this.$parent,this.start_x,this.start_y))}remove_div(){this.$select.remove(),this.$select=void 0}update(t,e){let n,i,r,s,o;this.current_x=t,this.current_y=e,i=Math.abs(this.current_x-this.start_x),n=Math.abs(this.current_y-this.start_y),this.$select&&(this.current_y<this.start_y?(this.$select.css("top",this.current_y+7+"px"),r=this.current_y+7):(this.$select.css("top",this.start_y+"px"),r=this.start_y),this.current_x<this.start_x?(this.$select.css("left",this.current_x+7+"px"),s=this.current_x+7):(this.$select.css("left",this.start_x+"px"),s=this.start_x),this.$select.css("width",i+"px"),this.$select.css("height",n+"px"),o=this._find_selected_nodes(new l.a(s,r,i,n)),T.trigger("ui-selection-mouse-move",o))}_find_selected_nodes(t){let e=[];return r()(".node").each((function(n){let i,s,o,a=r()(this);o=a.data("cid"),i=this.getBoundingClientRect(),s=new l.a(i.x,i.y,i.width,i.height),t.intersect(s)&&e.push(a)})),e}_create_selection_div(t,e,n){let i=r()("<div></div>");return i.attr("id",this.css_id()),i.css("position","absolute"),i.css("top",n+"px"),i.css("left",e+"px"),i.css("width","0px"),i.css("height","0px"),t.append(i),i}}class j extends c.View{el(){return r()(".document-browser")}initialize(){this.ui_select=void 0}events(){return{"mousedown .xmain":"on_mouse_down","mouseup .xmain":"on_mouse_up","mousemove .xmain":"on_mouse_move"}}on_mouse_down(t){t.which>1?this.ui_select&&(this.ui_select.remove_div(),this.ui_select=void 0):(this.ui_select&&(this.ui_select.remove_div(),this.ui_select=void 0),this.ui_select=new C(this.$el,t.clientX,t.clientY),this.ui_select.create_div())}on_mouse_up(t){this.ui_select&&(this.ui_select.remove_div(),this.ui_select=void 0),T.trigger("ui-selection-mouse-up")}on_mouse_move(t){this.ui_select&&1==t.which&&1==t.buttons&&this.ui_select.update(t.clientX,t.clientY)}}class S{constructor(t,e,n){this._name=t,this._key=e,this._sort=this.get_local(t)||n}get key(){return this._key}get name(){return this._name}get sort(){return this._sort}set sort(t){this._sort=t,this.set_local(this.name,t)}get_local(t){let e=localStorage.getItem("browse_list."+t);return"0"==e||null==e?0:e}set_local(t,e){localStorage.setItem("browse_list."+t,e)}toggle(){0==this.sort||null==this.sort?this.sort="asc":"asc"==this.sort?this.sort="desc":"desc"==this.sort&&(this.sort="asc")}get sort_icon_name(){let t="fa-sort";return"asc"==this.sort?t="fa-sort-amount-down-alt":"desc"==this.sort&&(t="fa-sort-amount-down"),t}}class A{constructor(t,e){let n,i;this._cols=this._build_header_cols(e),n=this._cols,this._rows=this._build_rows(e,t),i=this.get_sort_column(),i&&(i.key?this.sort_key_column(i.key,"asc"==i.sort?-1:1):this.sort_standard_column(i.name,"asc"==i.sort?-1:1))}get_sort_column(){let t=o.default.findIndex(this._cols,(function(t){return"asc"==t.sort||"desc"==t.sort}));if(t>=0)return this._cols[t]}get cols(){return this._cols}get rows(){return this._rows}get key_cols(){let t=[];return t=o.default.filter(this.cols,(function(t){return null!=t.key})),t}toggle_col_sort(t){this._cols[t].toggle();for(let e=0;e<this._cols.length;e++)e!=t&&(this._cols[e].sort=0);return this._cols[t]}sort_key_column(t,e){this._rows=this._rows.sort((function(n,i){let r,s;return r=o.default.find(n,(function(e){return e.key==t})),s=o.default.find(i,(function(e){return e.key==t})),r.virtual_value<s.virtual_value?e:r.virtual_value>s.virtual_value?-e:0}))}sort_standard_column(t,e){this._rows=this._rows.sort((function(n,i){let r,s;return r=o.default.find(n,(function(e){return e.col==t})),s=o.default.find(i,(function(e){return e.col==t})),r.virtual_value<s.virtual_value?e:r.virtual_value>s.virtual_value?-e:0}))}_build_dict_for_type_col(t){let e,n;return t.is_document()?(e='<i class="fa fa-file"></i>',n=0):(e='<i class="fa fa-folder text-warning"></i>',n=1),{id:t.get("id"),cid:t.cid,url:t.url,is_readonly:t.is_readonly(),col:"type",value:e,virtual_value:n,virtual_type:"int"}}_build_dict_for_title_col(t){return{id:t.get("id"),cid:t.cid,url:t.url,col:"title",value:t.full_title_list_mode(),virtual_value:t.full_title(),virtual_type:"str"}}_build_dict_for_created_at_col(t){return{id:t.get("id"),cid:t.cid,url:t.url,col:"created_at",value:t.get("created_at"),virtual_value:t.get("created_at"),virtual_type:"str"}}_build_rows(t,e){let n,i,r,s,o,a=[],l=[];for(let c=0;c<e.length;c++){n=e.at(c),l=[],l.push(this._build_dict_for_type_col(n)),l.push(this._build_dict_for_title_col(n));for(let e=0;e<t.length;e++)s=t.at(e),s&&(o=s.get("key"),i=n.get_page_value_for(o),r=n.get_page_virtual_value_for(s.get("key")),l.push({id:n.get("id"),cid:n.cid,url:n.url,key:o,value:i,virtual_value:parseInt(r),virtual_type:"str"}));l.push(this._build_dict_for_created_at_col(n)),a.push(l)}return a}_build_header_cols(t){let e,n,i,r=[];for(r.push(new S("type",void 0,void 0)),r.push(new S("title",void 0,void 0)),i=0;i<t.length;i++)e=t.at(i),e&&(n=e.get("key"),r.push(new S(n,n,void 0)));return r.push(new S("created_at",void 0,void 0)),r}}class N extends c.View{el(){return r()("#browse")}initialize(){this._table=void 0}get table(){return this._table}get cols(){return this._table.cols}get rows(){return this._table.rows}events(){return{"click .header.sort":"col_sort"}}col_sort(t){let e,n=r()(t.currentTarget).data();"key"==n.col?(e=n.key,this.toggle_key_column(e)):this.toggle_standard_column(n.col),t.preventDefault(),this.trigger("change")}toggle_key_column(t){let e;e=o.default.findIndex(this.cols,(function(e){return e.key==t})),e>=0&&this.toggle_col_sort(e)}toggle_col_sort(t){return this._table.toggle_col_sort(t)}toggle_standard_column(t){let e;if(e=o.default.findIndex(this.cols,(function(e){return e.name==t})),e>=0)return this.toggle_col_sort(e)}render(t,e){let n,i;i={},this._table=new A(t,e),n=o.default.template(E({nodes:t,parent_kv:e,table:this.table})),this.$el.html(n)}}class D extends c.View{el(){return r()("#browse")}render(t,e,n){let i,r;r={},i=o.default.template(k({nodes:t})),this.$el.html(i)}}class O extends c.View{el(){return r()("#browse")}initialize(t){this.browse=new a.a(t),this.display_mode=new _,this.pagination_view=new w,this.browse_list_view=new N,this.browse_grid_view=new D,this.dropzone=new b(this.browse),this.listenTo(this.browse,"change",this.render),this.listenTo(this.display_mode,"change",this.refresh),this.listenTo(this.browse_list_view,"change",this.render),m.l.on(m.a,this.refresh,this),m.l.on(m.i,this.select_all,this),m.l.on(m.k,this.select_folders,this),m.l.on(m.j,this.select_documents,this),m.l.on(m.b,this.deselect,this),m.l.on(m.d,this.invert_selection,this),T.on("ui-selection-mouse-move",this.on_ui_selection_mouse_move,this),T.on("ui-selection-mouse-up",this.on_ui_selection_mouse_up,this),this.display_mode.is_grid()&&(this.ui_select_view=new j),this._let_browse_fill_in_parent()}events(){return{"click input[type=checkbox]":"on_checkbox_clicked","click .node":"on_node_clicked"}}_let_browse_fill_in_parent(){let t;t=this.$el.parent().height(),this.$el.height(t+"px")}on_checkbox_clicked(t){let e,n,i;t.stopPropagation(),e=r()(t.currentTarget).parent(),n=e.data("cid"),n||(n=e.parent().data("cid"),n||console.log("node data still not available")),i=this.select_node_by_cid(n),i?(e.addClass("checked"),e.parent().hasClass("node")&&e.parent().addClass("checked")):(e.removeClass("checked"),e.parent().hasClass("node")&&e.parent().removeClass("checked")),m.l.trigger(m.h,this.get_selection())}on_node_clicked(t){let e,n,i;console.log("Browse list: on node clicked"),e=r()(t.currentTarget),n=e.data("cid"),i=this.select_node_by_cid(n),i?e.addClass("checked"):e.removeClass("checked"),this.open_node(n)}on_ui_selection_mouse_move(t){let e,n,i=this;n=o.default.map(t,(function(t){return t.data("cid")})),o.default.each(t,(function(t){e=i.browse.nodes.get(t.data("cid")),e.select()})),this.browse.nodes.each((function(t){o.default.contains(n,t.cid)||t.deselect()}))}on_ui_selection_mouse_up(){m.l.trigger(m.h,this.get_selection())}select_all(){this.browse.nodes.each((function(t){t.select()})),m.l.trigger(m.h,this.get_selection())}select_folders(){this.browse.nodes.each((function(t){t.is_folder()&&t.select()})),m.l.trigger(m.h,this.get_selection())}select_documents(){this.browse.nodes.each((function(t){t.is_document()&&t.select()})),m.l.trigger(m.h,this.get_selection())}deselect(){this.browse.nodes.each((function(t){t.deselect()})),m.l.trigger(m.h,this.get_selection())}invert_selection(){this.browse.nodes.each((function(t){t.toggle_selection()})),m.l.trigger(m.h,this.get_selection())}select_node_by_cid(t){let e,n,i;if(e=this.browse.nodes.get(t),e)return n=e.get("selected"),e.set({selected:!n}),i=!n,i}get_selection(){let t;return t=o.default.filter(this.browse.nodes.models,(function(t){return 1==t.get("selected")})),t}open_node(t){let e;e=this.browse.nodes.get(t),e.is_folder()?e?m.l.trigger(m.f,e.id):m.l.trigger(m.f,void 0):window.location=e.get("document_url")}open(t,e){this.browse.set({parent_id:t,tag:e}),this.browse.fetch()}_get_tagname_from_location(){let t;if(t=location.href.match(/tagged\/(\w+)$/),t)return t[1]}refresh(){let t,e=this.browse.get("parent_id");t=this._get_tagname_from_location(),this.browse.set({order_by:this.display_mode.get_order_by()}),this.open(e,t)}render(){let t,e,n,i={};t={},i=this.browse.get("pagination")||{},i.parent_id=this.browse.get("parent_id"),this.pagination_view.render(i),this.display_mode.is_list()?(this.ui_select_view&&(this.ui_select_view.undelegateEvents(),this.ui_select_view=void 0),this.browse_list_view.render(this.browse.nodes,this.browse.parent_kv)):(n=this.display_mode.sort_field,e=this.display_mode.sort_order,this.ui_select_view||(this.ui_select_view=new j),this.browse.nodes.dynamic_sort_by(n,e),this.browse_grid_view.render(this.browse.nodes)),r()("aside.main-sidebar.animated-opacity").animate({opacity:1},500,(function(){r()(".main-header.animated-opacity").animate({opacity:1},300,(function(){r()("#pre-loader").hide(),r()(".content-wrapper.animated-opacity").animate({opacity:1},200)}))}))}}var I=n(7);class $ extends c.Model{defaults(){return{nodes:[],parent_id:""}}initialize(t){this.set({parent_id:t}),this.nodes=new I.b}urlRoot(){let t=this.get("parent_id");return t?`/breadcrumb/${t}/`:"/breadcrumb/"}toJSON(){return{id:this.get("id"),parent_id:this.get("parent_id"),nodes:this.get("nodes")}}open(t,e){let n;n=t?t.id:void 0,this.set({parent_id:n}),e&&m.l.trigger(m.f,n)}parse(t,e){let n=t.nodes,i=this;i.nodes.reset(),o.default.each(n,(function(t){i.nodes.add(new I.a(t))})),this.trigger("change")}}let R=n(37);class L extends c.View{el(){return r()("#breadcrumb")}initialize(t){this.breadcrumb=new $(t),this.breadcrumb.fetch(),this.listenTo(this.breadcrumb,"change",this.render)}events(){return{"click .breadcrumb-node":"open_node"}}open_node(t){let e,n=r()(t.currentTarget).data();e=this.breadcrumb.nodes.get(n.id),e?m.l.trigger(m.f,e.id):m.l.trigger(m.f,void 0)}open(t){this.breadcrumb.set({parent_id:t}),this.breadcrumb.fetch()}render(){let t,e;e={},t=o.default.template(R({nodes:this.breadcrumb.nodes})),this.$el.html(t)}}var M=n(6);class P extends c.Model{defaults(){return{title:"",parent_id:""}}initialize(t){this.set({parent_id:t})}urlRoot(){return"/create-folder/"}toJSON(){return{id:this.get("id"),parent_id:this.get("parent_id"),title:this.get("title")}}}let q=n(38);class z extends c.View{el(){return r()("#new-folder-modal")}initialize(t){this.folder=new P(t),this.render()}events(){return{"click .create":"on_create",submit:"on_form_submit"}}on_form_submit(t){t.preventDefault(),this.on_create(t)}on_create(t){let e,n={success:function(){m.l.trigger(m.a)},error:function(t,e,n){let i,r;i=e.responseJSON.msg,r=new f.a("danger",i)}};e=this.$el.find("[name=title]").val(),null!=e&&0!==e.trim().length?(this.folder.set({title:e}),this.folder.save({},n),this.$el.modal("hide"),this.undelegateEvents()):this.$el.modal("hide")}render(){let t,e;e={},t=o.default.template(q({name:this.folder.get("name")})),this.$el.html(t),this.$el.modal()}}class H extends c.Model{urlRoot(){return"/rename-node/"}toJSON(){return{id:this.get("id"),title:this.get("title")}}}let B=n(39);class F extends c.View{el(){return r()("#rename-modal")}initialize(t){this.rename=new H(t),this.node=t,this.render()}events(){return{"click .rename":"on_rename",submit:"on_form_submit"}}on_form_submit(t){t.preventDefault(),this.on_rename(t),this.undelegateEvents()}on_rename(t){let e,n={success:function(){m.l.trigger(m.a)}};e=this.$el.find("[name=title]").val(),null!=e&&0!==e.trim().length?(this.rename.set({title:e}),this.$el.modal("hide"),this.rename.save({},n)):this.$el.modal("hide")}render(){let t,e;e={},t=o.default.template(B({title:this.node.get("title")})),this.$el.html(t),this.$el.modal()}}class W extends c.Model{urlRoot(){return"/automate/"}}let U=n(40),V=n(41),J=n(42);class X extends c.View{el(){return r()(".tags-container")}initialize(t,e){this.tags=t,this.all_tags=e,this.render()}events(){return{"keyup .tag-input":"on_keyup","click .tag-remove":"on_remove"}}on_remove(t){let e,n;e=r()(t.target).data("name"),n=new M.b({name:e}),this.tags.remove(n),this.render()}get_tag(t){let e,n=void 0;if(this.all_tags){for(let i=0;i<this.all_tags.models.length;i++)if(e=this.all_tags.models[i],e.get("name")==t){n=e;break}if(n)return n}return new M.b({name:t,fg_color:"#ffffff",bg_color:"#c41fff"})}on_keyup(t){let e,n;13!=t.which&&","!=t.key||(e=Object(l.f)(r()(t.target).val()),o.default.isEmpty(e)||(e=e.replace(",",""),o.default.isEmpty(e)||(n=this.get_tag(e),this.tags.add(n),this.render(),this.$el.find("input").focus())))}render(){let t,e;e={},t=o.default.template(U({tags:this.tags,all_tags:this.all_tags})),this.$el.html(t)}}class K extends X{el(){return r()(".av-tags-container")}initialize(){this.tags=new M.c([]),this.all_tags=new M.a,this.all_tags.url="/alltags/",this.listenTo(this.all_tags,"add",this.render),this.all_tags.fetch()}render(){let t,e;e={},t=o.default.template(V({tags:this.tags,all_tags:this.all_tags})),this.$el.html(t)}}class G extends X{el(){return r()(".automate-tags-container")}initialize(){let t,e,n=this;e=r()("input[name=automate_id]").val(),this.automate=new W({id:e}),t=function(t,e,i){n.tags=new M.c(e.tags),n.all_tags=new M.c(e.alltags),n.render()},this.automate.fetch({success:t})}render(){let t,e;e={},t=o.default.template(J({tags:this.tags,all_tags:this.all_tags})),this.$el.html(t)}}let Y=n(43),Q=n(44);class Z extends c.View{el(){return r()("#tags-modal")}events(){return{"click button.submit_tags":"on_click_submit",submit:"on_form_submit"}}on_form_submit(t){t.preventDefault()}on_click_submit(t){let e,n={success:function(){m.l.trigger(m.a)}};e=this.tags_container.tags,this.$el.modal("hide"),e.save(n)}_get_shared_tags(t){}_nodes2tag_collection(t){let e,n,i,r;i={},n=new M.c([],{nodes:t});for(let n=0;n<t.length;n++){e=t[n].get("tags")||[];for(let t=0;t<e.length;t++)i[e[t].name]?i[e[t].name]+=1:i[e[t].name]=1}r=o.default.uniq(o.default.keys(i));for(let e=0;e<r.length;e++)i[r[e]]==t.length&&n.add({name:r[e]});return n}}class tt extends Z{initialize(t,e){this.node=t,this.render(),this.tags_container=new X(function(t){let e,n;n=new M.c([],{node:t}),e=t.get("tags")||[];for(let t=0;t<e.length;t++)n.add({name:e[t].name,fg_color:e[t].fg_color,bg_color:e[t].bg_color});return n}(t),e)}render(){let t,e;e={},t=o.default.template(Y({tags:this.node.get("tags")})),this.$el.html(t),this.$el.modal()}}class et extends Z{initialize(t,e){this.nodes=t,this.render(),this.tags_container=new X(this._nodes2tag_collection(t),e)}render(){let t,e;e={},t=o.default.template(Q({tags:this._nodes2tag_collection(this.nodes)})),this.$el.html(t),this.$el.modal()}}class nt extends c.Model{defaults(){return{id:"",name:"",model:"",access_type:"allow",access_inherited:!1,permissions:{read:!1,write:!1,delete:!1,change_perm:!1,take_ownership:!1}}}set_perm(t,e){let n=this.get("permissions");n[t]=e,this.set({permissions:n})}get_perm(t){return this.get("permissions")[t]}set_type(t){this.set({access_type:t})}static get CHPERM(){return"change_perm"}static get OWN(){return"take_ownership"}static get READ(){return"read"}static get WRITE(){return"write"}static get DEL(){return"delete"}human_access_type(){return Object(l.b)(this.get("access_type"))}human_perms(){let t,e,n,i,r,s,o;return e=this.get("permissions"),n=e[nt.CHPERM],i=e[nt.OWN],r=e[nt.WRITE],s=e[nt.READ],o=e[nt.DEL],t=n&&i&&r&&s&&o?"Full Control":!s||!r||n||i||o?!s||r||n||i||o?s&&r&&!n&&!i&&o?"Read & Write & Delete":"User Defined":"Read":"Read & Write",t}}class it extends c.Model{}class rt extends c.Collection{url(){return"/usergroups"}get model(){return it}parse(t,e){let n=t.usergroups,i=this;i.reset([],{silent:!0}),o.default.each(n,(function(t){i.add(new it(t))})),this.trigger("change")}}let st=n(45);class ot extends c.View{el(){return r()("#permission-editor-modal")}initialize(t,e=!0){this._permission=t||new nt,this._edit=e,this._users=[],this._groups=[],this._usergroups=new rt,this._usergroups.fetch(),this.listenTo(this._usergroups,"change",this.render)}events(){return{"click .apply":"on_apply","change .perm_user_or_group":"on_perm_user_or_group","change .access_type":"on_access_type","click .checkbox":"on_checkbox"}}on_perm_user_or_group(t){let e,n,i=this;this._users=[],this._groups=[],r()(".perm_user_or_group :selected").each((function(t,s){e=r()(s).val(),n=r()(s).data("model"),"user"==n?i._users.push(e):"group"==n&&i._groups.push(e)})),console.log(this._groups)}on_access_type(t){let e;e=r()(t.currentTarget).val(),this.set_type(e)}on_checkbox(t){let e,n,i=r()(t.currentTarget);e=i.attr("name"),n=i.is(":checked"),this.set_perm(e,n)}set_perm(t,e){this._permission.set_perm(t,e)}set_type(t){this._permission.set_type(t)}on_apply(t){this._edit&&m.l.trigger(m.g,this._permission,this._users,this._groups),this.$el.html(""),this.$el.modal("hide"),this.undelegateEvents()}render(){let t,e;return e={},t=o.default.template(st({usergroups:this._usergroups,permission:this._permission,edit:this._edit})),this.$el.html(t),this.$el.modal(),this}}class at extends c.Collection{get model(){return nt}initialize(t,e){e&&(this.node=e.node)}url(){if(this.node)return`/node/${this.node.id}/access`}parse(t,e){let n=t.access,i=this;return i.reset([],{silent:!0}),o.default.each(n,(function(t){i.add(new nt(t))})),this.trigger("change"),n}save_access(t){let e,n,i;e=r()("[name=csrfmiddlewaretoken]").val(),n={add:[],delete:[]},n.add=this.models.map((function(t){return t.attributes})),n.delete=t.models.map((function(t){return t.attributes})),r.a.ajaxSetup({headers:{"X-CSRFToken":e}}),i=r.a.ajax({method:"POST",url:this.url(),data:JSON.stringify(n),contentType:"application/json",dataType:"json"})}}let lt=n(46);class ct extends c.View{el(){return r()("#access-modal")}initialize(t){this.acc_collection=new at([],{node:t}),this.acc_collection.fetch(),this.node=t,this.deleted_acc=new at([],{}),this.listenTo(this.acc_collection,"change",this.render),this.listenTo(m.l,m.g,this.on_perm_changed),this.render()}events(){return{"click #create_perm":"create_perm","click #edit_perm":"edit_perm","click #delete_perm":"delete_perm","click #readonly_view_perm":"readonly_view_perm","click #access_items tr":"on_item_click","click .close":"on_close","click .cancel":"on_close","click .apply":"on_apply"}}on_apply(t){this.$el.html(""),this.$el.modal("hide"),this.undelegateEvents(),this.acc_collection.save_access(this.deleted_acc)}on_close(t){this.undelegateEvents()}on_item_click(t){let e=r()(t.currentTarget);e.hasClass("disabled")||e.toggleClass("checked")}on_perm_changed(t,e,n){let i,r=this;o.default.each(e,(function(e){i=new nt,i.set({permissions:t.get("permissions")}),i.set({name:e}),i.set({model:"user"}),i.set({access_type:t.get("access_type")}),i.set({access_inherited:t.get("access_inherited")}),r.acc_collection.add(i)})),o.default.each(n,(function(e){i=new nt,i.set({permissions:t.get("permissions")}),i.set({name:e}),i.set({model:"group"}),i.set({access_type:t.get("access_type")}),i.set({access_inherited:t.get("access_inherited")}),r.acc_collection.add(i)})),r.render()}create_perm(t){let e;e=new ot}edit_perm(t){let e,n;n=this._first_selected(),e=new ot(n)}delete_perm(t){let e=[],n=this;e=o.default.map(this.$el.find("tr.checked"),(function(t){let e,n;return e=r()(t).data("name"),n=r()(t).data("model"),{name:e,model:n}})),o.default.each(e,(function(t){let e=o.default.find(n.acc_collection.models,(function(e){return e.get("name")==t.name&&e.get("model")==t.model}));n.deleted_acc.add(e),n.acc_collection.remove(e)})),this.render()}readonly_view_perm(t){let e,n;n=this._first_selected(),e=new ot(n,!1)}render(){let t,e;return e={},t=o.default.template(lt({acc_collection:this.acc_collection,node:this.node})),this.$el.html(t),this.$el.modal(),this}_first_selected(){let t,e,n,i;return t=this.$el.find("tr.checked"),e=t.data("cid"),n=t.data("id"),i=o.default.find(this.acc_collection.models,(function(t){return t.cid==e||t.get("id")==n})),i}}class ut extends c.View{el(){return r()(document)}initialize(t){this.parent_id=t,this.action_conditions=this._build_action_conditions(),this.selection=new I.b,this.clipboard=new c.Collection,m.l.on(m.f,this.parent_changed,this),m.l.on(m.h,this.selection_changed,this)}set_parent(t){this.parent_id=t}events(){return{"click .new-folder":"new_folder","click #download-nodes":"download_nodes","click #delete":"delete_node","click #cut":"cut_node","click #paste":"paste","click #access":"click_access","click #paste_pages":"paste_pages","click #rename":"rename_node","click #run-ocr":"run_ocr","click #tags-menu-item":"tag_node","click #id_btn_upload":"upload_clicked","change #id_file_name":"upload","click #select_all_menu_item":"on_select_all","click #select_folders_menu_item":"on_select_folders","click #select_documents_menu_item":"on_select_documents","click #deselect_menu_item":"on_deselect","click #invert_selection_menu_item":"on_invert_selection"}}on_select_all(t){m.l.trigger(m.i)}on_select_folders(t){m.l.trigger(m.k)}on_select_documents(t){m.l.trigger(m.j)}on_deselect(t){m.l.trigger(m.b)}on_invert_selection(t){m.l.trigger(m.d)}click_access(t){let e,n=o.default.first(this.selection.models);n&&(e=new ct(n))}upload(t){let e,n,i=r()(t.currentTarget),s=r()("#lang").val();e=i[0].files,n=new y(e,s,this.parent_id)}upload_clicked(t){let e=r()("#id_file_name");t.preventDefault(),e.click()}delete_node(t){let e,n,i,r={};r.success=function(){m.l.trigger(m.a)},n=o.default.map(this.selection.models,(function(t){return t.get("title")})),i=n.join(", "),e=confirm(`DELETE following folders/documents:  ${i}?`),e&&this.selection.delete(r)}download_nodes(t){let e={success:function(){}};this.selection.download(e)}cut_node(t){let e={success:function(){m.l.trigger(m.a)}};this.selection.cut(e)}paste(t){let e={success:function(){m.l.trigger(m.a)}};this.selection.paste(e,this.parent_id)}paste_pages(t){let e={success:function(){m.l.trigger(m.a)}};this.selection.paste_pages(e,this.parent_id)}parent_changed(t){this.parent_id=t,console.log("ActionsView - parent_changed: current parent_id="+this.parent_id)}selection_changed(t){let e=this;this.selection.reset(t),o.default.each(this.action_conditions.models,(function(t){t.get("cond")(e.selection,e.clipboard,e.parent_id)?e.enable_action(t):e.disable_action(t)}))}rename_node(t){let e,n=o.default.first(this.selection.models);n&&(e=new F(n))}run_ocr(t){this.selection.run_ocr({})}tag_node(t){let e,n,i,r,s=this.selection.models;i=this,n=new M.a,n.url="/alltags/",r=function(t,n,i){1==s.length?e=new tt(o.default.first(s),t):s.length>1&&(e=new et(s,t))},n.fetch({success:r})}new_folder(t){let e,n;n=this.parent_id,e=new z(n)}enable_action(t){r()(t.get("id")).removeClass("disabled")}disable_action(t){r()(t.get("id")).addClass("disabled")}_build_action_conditions(){let t=new c.Collection;return t.add({id:"#delete",cond:function(t,e,n){return t.length>0}}),t.add({id:"#delete",cond:function(t,e,n){return t.length>0}}),t.add({id:"#download-nodes",cond:function(t,e,n){return t.length>0}}),t.add({id:"#cut",cond:function(t,e,n){return t.length>0}}),t.add({id:"#rename",cond:function(t,e,n){return 1==t.length}}),t.add({id:"#tags-menu-item",cond:function(t,e,n){return t.length>0}}),t.add({id:"#run-ocr",cond:function(t,e,n){return t.length>0}}),t.add({id:"#access",cond:function(t,e,n){return 1==t.length}}),t}}n(19);var dt=n(9),ht=n(8);class _t extends dt.a{static get CLICK(){return"click"}static get DBLCLICK(){return"dblclick"}static get MOVE_UP(){return"move_up"}static get MOVE_DOWN(){return"move_down"}static get CLICK_TIMEOUT(){return 250}static get_data_ref_from_dom(t){let e=t.querySelector(".document.page");if(e)return e;console.log("thumb dom data not found")}static get_data_from_dom(t){let e=t.querySelector(".document.page"),n={};if(e)return n.doc_id=e.getAttribute("data-doc_id"),n.page_num=e.getAttribute("data-page_num"),n.page_id=e.getAttribute("data-page_id"),n.page_order=e.getAttribute("data-page_order"),n;console.log("thumb dom data not found")}constructor(t,e,n,i,r){super(),this._dom_ref=t,this._dom_data_ref=e,this._step=4,this._page_num=r,this._page_id=i,this._doc_id=n,this._config_events()}replace_with(t){let e=_t.get_data_from_dom(t),n=_t.get_data_ref_from_dom(t);this._dom_ref.replaceWith(t),this._dom_ref=t,e?(this._page_id=e.page_id,this._dom_data_ref=n,n.setAttribute("data-page_order",this._page_num),this._config_events()):console.log("dom_data empty")}get dom_ref(){return this._dom_ref}get doc_id(){return this._doc_id}get page_id(){return this._page_id}get page_num(){return this._page_num}add_class(t){r()(this.dom_ref).addClass(t)}remove_class(t){r()(this.dom_ref).removeClass(t)}mark_highlight(){r()(this._dom_ref).addClass("current")}remove_highlight(){r()(this._dom_ref).removeClass("current")}clear_selection(){let t;t=r()(this._dom_ref).find("[type=checkbox]").first(),t.prop("checked",!1),r()(this._dom_ref).removeClass("checked")}_config_events(){let t=this;r()(this._dom_ref).find(".arrow-up-control").click((function(e){e.preventDefault(),t.notify(_t.MOVE_UP,t._page_num,t.doc_id,t.page_id)})),r()(this._dom_ref).find(".arrow-down-control").click((function(e){e.preventDefault(),t.notify(_t.MOVE_DOWN,t._page_num,t.doc_id,t.page_id)})),this._dom_ref.onclick=function(){t.timer&&clearTimeout(t.timer),t.timer=setTimeout((function(){t.notify(_t.CLICK,t._page_num,t.doc_id,t.page_id)}),_t.CLICK_TIMEOUT)},this._dom_ref.ondblclick=function(){t.timer&&clearTimeout(t.timer),t.notify(_t.DBLCLICK,t._page_num)}}onclick(t,e){this.subscribe(_t.CLICK,t,e)}ondblclick(t,e){this.subscribe(_t.DBLCLICK,t,e)}is_img_loaded(){return this._dom_ref.querySelectorAll("img").length>0}is_visible(){return Object(ht.b)(this._dom_ref)}load(){this.is_img_loaded()||this.load_img()}load_img(){let t,e,n;n=parseInt(Object(l.d)("version")),e=n>=0?`/document/${this._doc_id}/preview/${this._step}/page/${this._page_num}?version=${n}`:`/document/${this._doc_id}/preview/${this._step}/page/${this._page_num}`,t=Object(ht.a)("img",{src:e}),this._dom_ref.insertBefore(t,this._dom_data_ref)}on_scroll(){this.is_visible()&&this.load()}}var ft=n(15);class pt extends ft.a{constructor(){super(),this._container_selector=".page_thumbnails",this._selector=".page_thumbnails .page_thumbnail",this._list=[],this._config_events()}load(){for(let t of this._list)t.on_scroll()}all(){return this._list}ondblclick(t,e){for(let n of this._list)n.ondblclick(t,e)}onclick(t,e){for(let n of this._list)n.onclick(t,e)}remove_highlights(){for(let t of this._list)t.remove_highlight()}clear_selections(){for(let t of this._list)t.clear_selection()}get_thumb(t){let e=[];return e=this._list.filter(e=>e.page_num==t),e.length>0&&e[0]}swap_thumbs(t,e){let n,i;n=r()(t.dom_ref).clone(),i=r()(e.dom_ref).clone(),t.replace_with(i[0]),e.replace_with(n[0]),this.update_css_class(t),this.update_css_class(e)}update_css_class(t){this.is_first(t)?t.add_class("first"):t.remove_class("first"),this.is_last(t)?t.add_class("last"):t.remove_class("last")}is_first(t){return 1==t.page_num}is_last(t){return t.page_num==this._list.length}mark_highlight(t){let e;e=this.get_thumb(t),e&&e.mark_highlight()}on_thumb_move_up(t,e,n){let i,r;if(t&&(t=parseInt(t,10)),t){if(t<2)return!1;i=this.get_thumb(t),r=this.get_thumb(t-1),this.swap_thumbs(i,r),this.notify(_t.MOVE_UP,t,e,n)}else console.warning("page_num not a number")}on_thumb_move_down(t,e,n){let i,r;if(t&&(t=parseInt(t,10)),t){if(t>this._list.length-1)return!1;i=this.get_thumb(t),r=this.get_thumb(t+1),this.swap_thumbs(i,r),this.notify(_t.MOVE_DOWN,t,e,n)}else console.warning("page_num not a number")}_add_thumbnails(){let t,e=Array.from(document.querySelectorAll(this._selector)),n=this;e.forEach((function(e,i,r){let s,o;s=_t.get_data_from_dom(e),o=_t.get_data_ref_from_dom(e),s?(t=new _t(e,o,s.doc_id,s.page_id,s.page_num),t.subscribe(_t.MOVE_UP,n.on_thumb_move_up,n),t.subscribe(_t.MOVE_DOWN,n.on_thumb_move_down,n),n._list.push(t)):console.log("thumb dom data not found")}))}_config_events(){let t,e=this;this._add_thumbnails(),r()(this._container_selector).scroll((function(){for(let t of e._list)t.on_scroll()})),this._list.length>0&&(t=this._list[0],console.log("page selection triggered"),m.l.trigger(m.e,t.page_id,t.doc_id))}}class gt extends dt.a{constructor(t=".zoom"){super(),this._dom_ref=r()(t),this._value="width",this._configEvents()}set_value(t){this._value="width"==t?"width":parseInt(t)}get_value(){return this._value}_configEvents(){let t=this;this._dom_ref.change((function(){let e=r()(this).val();t.set_value(e),t.notify("zoom",t.get_value())}))}}var mt=n(16);class vt extends ft.a{constructor(t){super(),this._container_selector=".actual_pages",this._selector=".actual_pages .actual_page",this._list=[],this._zoom=t,this._config_events()}get zoom(){return this._zoom}get pages(){return this._list}get visible_pages(){return this._list.filter(t=>t.is_visible())}highlight_text(t){for(let e of this._list)e.highlight_text(t)}scroll_to(t){let e=[];e=this._list.filter(e=>e.page_num==t),e.length>0&&e[0].scroll_to()}load(t){for(let e of this._list)e.on_scroll(t)}_add_pages(){let t=Array.from(document.querySelectorAll(this._selector)),e=this;t.forEach((function(t,n,i){let r,s,o,a=t.querySelector(".document.page");a?(r=a.getAttribute("data-doc_id"),s=a.getAttribute("data-page_num"),o=a.getAttribute("data-page_id"),e._list.push(new mt.a(t,a,r,o,s))):console.log("page dom data not found")}))}on_zoom(t){for(let e of this.pages)e.on_zoom(t)}get_page(t){let e=[];return e=this._list.filter(e=>e.page_num==t),e.length>0&&e[0]}swap_pages(t,e){let n,i;n=r()(t.dom_ref).clone(),i=r()(e.dom_ref).clone(),t.replace_with(i[0],e.page_num),e.replace_with(n[0],t.page_num)}on_page_move_down(t,e,n){let i,r;i=this.get_page(t),r=this.get_page(t+1),this.swap_pages(i,r)}on_page_move_up(t,e,n){let i,r;i=this.get_page(t),r=this.get_page(t-1),this.swap_pages(i,r)}_config_events(){let t=this;this._add_pages(),r()(this._container_selector).scroll((function(){for(let e of t._list)e.on_scroll(t.zoom.get_value())}))}}class yt{constructor(t="#preload-spinner",e="#viewer"){let n=this;this._spinner_id=t,this._container_id=e,r()(window).on("load",(function(){console.log("document form load complete"),n.show()}))}hide(){r()(this._spinner_id).addClass("invisible"),r()(this._container_id).addClass("invisible")}show(){r()(this._container_id).removeClass("invisible"),r()(this._spinner_id).removeClass("invisible"),r()(this._spinner_id).hide()}}var bt=n(20);class wt{constructor(t="#page_clipboard_form"){this._id=t,this._list=[],this._events=new dt.a,this._get_clipboard_form_server()}static get CHANGE(){return"change"}subscribe_event(t,e,n){this._events.subscribe(t,e,n)}notify_subscribers(t,e){this._events.notify(t,e)}get length(){return this._list.length}_get_clipboard_form_server(){let t=r()(this._id).attr("action"),e=this;r.a.get(t,(function(t){e._list=t.clipboard,e.notify_subscribers(wt.CHANGE,e._list)}))}add(t){}count(t=(t=>t)){return this._list.filter(t).length}}class xt{constructor(t,e,n){this._id=t,this._title=e,this._dom_elem=n}static get selector(){return"li.node"}addClass(t){r()(this._dom_elem).addClass(t)}get id(){return this._id}get title(){return this._title}get dom_elem(){return this._dom_elem}static create_from_dom(t){let e=r()(t).find(".title > a").text(),n=r()(t).find(".title > a").data("id");return new xt(e,n,t)}}class kt{constructor(t){this._enabled_cond=t.enabled,this._id=t.id,this._is_enabled=t.initial_state||!1,this._confirm=t.confirm,this._action=t.action,this._is_enabled&&this.enable()}get id(){return this._id}get confirm(){return this._confirm}get is_enabled(){return this._is_enabled}enable(){this._is_enabled=!0,r()(this._id).removeClass("disabled")}disable(){console.log(this._id+" disabled"),this._is_enabled=!1,r()(this._id).addClass("disabled")}toggle(t,e,n,i,r){this._enabled_cond(t,e,n,i,r)?this.enable():this.disable()}action(t,e,n,i,r){this._action(t,e,n,i,r)}}class Et{constructor(t,e){let n,i;n=r()("input[name=document_title]").val(),i=r()("input[name=document_id]").val(),this._actions=[],this._selection=new bt.a,this._clipboard=new wt,this._current_node=new xt(i,n),this._thumbnail_list=t,this._page_list=e,this.configEvents()}get selection(){return this._selection}clear_selection(){this.selection.clear()}add(t){this._attach_events(t),this._actions.push(t)}_attach_events(t){r()(t.id).click({action:t,selection:this._selection,clipboard:this._clipboard,current_node:this._current_node,thumbnail_list:this._thumbnail_list,page_list:this._page_list},this.on_click)}on_change_selection(t){for(let t of this._actions)t.toggle(this._selection,this._clipboard,this._current_node,this._thumbnail_list,this._page_list)}on_change_clipboard(t){console.log("on_change_clipboard received "+this._selection);for(let e of this._actions)e.toggle(this._selection,t)}on_click(t){let e=t.data.action,n=t.data.selection,i=t.data.clipboard,r=t.data.current_node,s=t.data.thumbnail_list,o=t.data.page_list;e.is_enabled&&e.action(n,i,r,s,o)}configEvents(){this._selection.subscribe_event(bt.a.CHANGE,this.on_change_selection,this),this._clipboard.subscribe_event(wt.CHANGE,this.on_change_clipboard,this);for(let t of this._actions)this._attach_events(t)}}var Tt=n(14),Ct=n(12);class jt extends c.Model{defaults(){return{number:""}}initialize(){}urlRoot(){return"/page/"}toJSON(){return{id:this.get("id"),number:this.get("number")}}}class St extends c.Collection{get model(){return jt}urlRoot(){return"/pages/"}}class At extends c.Model{defaults(){return{number:""}}initialize(){}urlRoot(){return"/page/"}toJSON(){return{id:this.get("id"),number:this.get("number")}}}class Nt extends c.Collection{get model(){return At}}class Dt extends c.Model{defaults(){return{pages:[],doc_id:"",parent_id:this.get("parent_id"),title:this.get("title"),created_at:this.get("created_at"),tags:this.get("tags"),parts:this.get("parts"),metadata:this.get("metadata")}}initialize(t){this.set({id:t}),this.pages=new St,this.thumbnails=new Nt}urlRoot(){return"/document/"}url(){return`/document/${this.get("id")}/`}toJSON(){return{id:this.get("id"),nodes:this.get("pages"),notes:this.get("notes")}}}class Ot extends Ct.a{initialize(t){this.page_id=t,this.fetch()}url(){return"/metadata/page/"+this.page_id}}class It extends c.View{template(t){let e,i=n(48);return e=o.default.template(i(t)),e()}initialize(t){this.node=t}render_to_string(){let t,e,n,i,r,s,o,a,l={};return t=this.node.get("ctype"),e=this.node.get("id"),n=this.node.get("title"),s=this.node.get("created_at"),o=this.node.get("updated_at"),r=this.node.get("owner"),i=this.node.get("tags"),a=`/node/${e}/download/`,l.id=e,l.title=n,l.ctype=t,l.owner=r,l.created_at=s,l.updated_at=o,l.tags=i,l.download_url=a,this.template(l)}render(){this.$el.html(this.render_to_string())}}class $t extends c.View{el(){return r()("#widgetsbar")}template(t){let e,i=n(49);return e=o.default.template(i(t)),e()}initialize(t){this.nodes=t}events(){return{"click li.collection-item a.download":"download_selection"}}download_selection(t){let e,n=[];t.preventDefault(),n=this.nodes.map((function(t){return t.get("id")})),e=new Tt.a("/nodes/download/",n),e.download()}render_to_string(){let t,e,n={};return t=this.nodes.length,e=ngettext("%s item selected","%s items selected",t),n.message=interpolate(e,[t]),this.template(n)}render(){this.$el.html(this.render_to_string())}}class Rt extends c.View{el(){return r()("#widgetsbar")}widget_el(){return r()(".metadata-widget")}initialize(t){this.node=t,this.metadata=new Ct.a(t),this.listenTo(this.metadata,"change",this.render)}events(){return{"click .add-metadata-key":"_add_metadata_key","click .close.key":"_remove_metadata_key","keyup input":"_update_value","change input":"_update_value","change .kv_type":"_kv_type_update","change .kv_format":"_kv_format_update","click button.save":"_on_save","click .chevron.toggle":"toggle_details"}}reset_element(){this.setElement(this.widget_el())}toggle_details(t){let e,n=r()(t.currentTarget);n.closest("li").find(".details").toggleClass("d-none"),e=n.find("i.fa"),e.toggleClass("fa-chevron-left"),e.toggleClass("fa-chevron-down")}_kv_format_update(t){let e=r()(t.currentTarget).val(),n=r()(t.currentTarget).closest("li").data();this.metadata.update_simple(n.cid,"kv_format",e),this.render()}_kv_type_update(t){let e=r()(t.currentTarget).val(),n=r()(t.currentTarget).closest("li").data(),i={};i.money=this.metadata.get("currency_formats"),i.numeric=this.metadata.get("numeric_formats"),i.date=this.metadata.get("date_formats"),i.text=[],this.metadata.update_simple(n.cid,"kv_type",e),this.metadata.update_simple(n.cid,"current_formats",i[e]),i[e].length>0?this.metadata.update_simple(n.cid,"kv_format",i[e][0][0]):this.metadata.update_simple(n.cid,"kv_format",""),this.render()}_update_value(t){let e=r()(t.currentTarget).val(),n=r()(t.currentTarget).closest("li").data();this.metadata.update_simple(n.cid,"key",e)}_add_metadata_key(t){r()(t.currentTarget).val();this.metadata.add_simple(),this.render()}_remove_metadata_key(t){let e=r()(t.currentTarget).parent(),n=r()(t.currentTarget).closest("li"),i=e.data();this.metadata.remove_simple(i.cid),n.remove(),this.render()}_on_save(){this.metadata.save({},{success:function(){new f.a("success",gettext("Metadata successfully saved"))},error:function(){new f.a("error",gettext("There was an error while saving metadata"))}})}template(t){let e,i=n(50);return e=o.default.template(i(t)),e()}get _all_disabled(){return this.metadata.all_disabled}render_to_string(){let t;return this.metadata?(t={kvstore:this.metadata.get("kvstore"),available_types:this.metadata.get("kv_types")},this.template(t)):""}render(){this.widget_el().html(this.render_to_string())}}class Lt extends Rt{el(){return r()("#widgetsbar-document")}widget_el(){return r()(".metadata-widget")}initialize(t){t?(this.node=t,this.metadata=new Ct.a(t)):this.metadata=void 0,this.listenTo(this.metadata,"change",this.render),m.l.on(m.e,this.page_selection_changed,this)}events(){return{"click .add-metadata-key":"_add_metadata_key","click .close.key":"_remove_metadata_key","keyup input[name=key]":"_updateK_value","keyup input[name=value]":"_updateV_value","change input[name=key]":"_updateK_value","change input[name=value]":"_updateV_value","change .kv_type":"_kv_type_update","change .kv_format":"_kv_format_update","click button.save":"_on_save","click .chevron.toggle":"toggle_details"}}_updateK_value(t){let e=r()(t.currentTarget).val(),n=r()(t.currentTarget).closest("li").data();this.metadata.update_simple(n.cid,"key",e)}_updateV_value(t){let e=r()(t.currentTarget).val(),n=r()(t.currentTarget).closest("li").data();this.metadata.update_simple(n.cid,"value",e)}page_selection_changed(t,e){t&&(this.metadata=new Ot(t),this.listenTo(this.metadata,"change",this.render))}template(t){let e,i=n(51);return e=o.default.template(i(t)),e()}}c.View;class Mt extends c.View{el(){return r()("#widgetsbar")}template(t){let e,i=n(52);return e=o.default.template(i(t)),e()}initialize(t){this.part=t}render_to_string(){let t,e={};return e.part=this.part,e.verbose_name=this.part.verbose_name,t=this._get_policy_id(this.part.fields),e.policy_choices=this._get_policy_choices(this.part.fields),e.current_policy_states=this._get_current_policy_states(this.part.fields,t),this.template(e)}render(){this.$el.html(this.render_to_string())}_get_policy_choices(t){let e,n,i=[],r="";if(e=o.default.find(t,(function(t){return"policy"==t.field_name})),e&&e.choices)for(n=0;n<e.choices.length;n++)r="",e.value[0]==e.choices[n][0]&&(r="selected"),i.push([e.choices[n][0],e.choices[n][1],r]);return i}_get_policy_id(t){let e,n,i;if(e=o.default.find(t,(function(t){return"policy"==t.field_name})),e&&e.choices)for(n=0;n<e.choices.length;n++)if(e.value[0]==e.choices[n][0]){i=e.value[0];break}return i}_get_current_policy_states(t,e){let n,i,s=this;if(n=o.default.find(t,(function(t){return"current_policy_state"==t.field_name})),n)return i=n.value.id,r.a.ajax({url:`/policy/${e}/states/`}).done((function(t){t&&t.states&&r()("#current_policy_states").html(s._render_states(t.states,i))})),gettext("Loading...")}_states_template(t){let e,i=n(53);return e=o.default.template(i(t)),e()}_render_states(t,e){let n={},i=[];return i=o.default.map(t,(function(t){let n={};return parseInt(t.duration)==t.duration&&t.duration<=0?n.left="user":n.left=t.duration,t.folder&&".user_trash"==t.folder.title&&(n.right="trash"),"purge"==t.on_user_delete?(n.left="user",n.right="purge"):"deny"==t.on_user_delete&&(n.right="deny"),t.id==e?n.selected="bg-light border":n.selected="",n.number=t.number,n})),n.states=o.default.sortBy(i,(function(t){return t.number})),this._states_template(n)}}window.DataRetentionWidget=Mt;class Pt extends c.View{el(){return r()("#widgetsbar")}initialize(){this.info_widget=void 0,m.l.on(m.h,this.selection_changed,this)}selection_changed(t){this.render(t)}render(t){let e,n,i,r,s,o,a="";if(n={},t)if(t.length){if(1==t.length){if(e=t[0],this.info_widget&&(this.info_widget.undelegateEvents(),this.info_widget=void 0),this.metadata_widget&&(this.metadata_widget.undelegateEvents(),this.metadata_widget=void 0),r=e.get("parts"),this.info_widget=new It(e),e.is_document()?this.metadata_widget=new Lt(e):this.metadata_widget=new Rt(e),a+=this.info_widget.render_to_string(),a+=this.metadata_widget.render_to_string(),r)for(i=0;i<r.length;i++)r[i].js_widget&&(s=Function("p",`return new ${r[i].js_widget}(p);`)),o=s(r[i]),a+=o.render_to_string()}else t.length>1&&(this.info_widget&&(this.info_widget.undelegateEvents(),this.info_widget=void 0),this.metadata_widget&&(this.metadata_widget.undelegateEvents(),this.metadata_widget=void 0),this.info_widget=new $t(t),a+=this.info_widget.render_to_string());this.$el.html(a),this.metadata_widget&&this.metadata_widget.reset_element()}else this.$el.html("");else this.$el.html("")}}class qt extends c.View{el(){return r()("#info-widget-document")}initialize(t){this.document_id=t}events(){return{"change #document-versions":"on_document_version_selected"}}on_document_version_selected(t){let e=r()(t.currentTarget).val();window.location.search="?version="+e}}class zt extends c.View{el(){return r()("#widgetsbar-document")}initialize(t){this.metadata_widget=new Lt}render(){let t,e,n,i,r,s="";if(t={},n=this.document.get("parts"),s=this.metadata_widget.render_to_string(),n)for(e=0;e<n.length;e++)n[e].js_widget&&(i=Function("p",`return new ${n[e].js_widget}(p);`)),r=i(n[e]),s+=r.render_to_string();this.$el.html(s)}}class Ht extends c.Model{url(){let t,e,n;return t=this.get("id"),n=this.get("document_version"),e=this.get("page_number"),`/document/${t}/${n}/text/page/${e}`}}let Bt=n(54);class Ft extends c.View{el(){return r()("#message-modal")}initialize(t,e,n){this.page_text=new Ht({id:t,page_number:e,document_version:n}),this.page_text.fetch(),this.listenTo(this.page_text,"change",this.render)}events(){return{"click .ok":"on_ok"}}on_ok(t){this.$el.modal("hide")}render(){let t,e,n;e={},n=this.page_text.get("page_text"),n&&(n=n.replace(/\n/g,"<br />")),t=o.default.template(Bt({page_text:n,page_number:this.page_text.get("page_number"),document_version:this.page_text.get("document_version")})),this.$el.html(t),this.$el.modal()}}class Wt extends c.View{el(){return r()("#document-actions")}initialize(){"visible"==window.localStorage.getItem("page-thumbnails")?r()("#page-thumbnails").show():r()("#page-thumbnails").hide()}events(){return{"click #sw-left-panel":"toggle_thumbnails"}}toggle_thumbnails(t){let e,n=r()(t.currentTarget).data("target-id"),i=window.localStorage;t.preventDefault(),e=r()("#"+n),0!=e.length?(e.toggle(),e.is(":visible")?i.setItem("page-thumbnails","visible"):i.setItem("page-thumbnails","hidden")):console.log("target "+n+" not found")}}class Ut extends c.View{el(){return r()("#document")}initialize(){let t=document.querySelector(".actual_pages"),e=r()("input[name=document_id]").val();this._widgetsbar=new zt(e),this._info_widget=new qt(e),this._thumbnail_list=new pt,this._zoom=new gt,this._page_list=new vt(this._zoom),this._thumbnail_list.load(),this._page_list.load(this.zoom.get_value()),this._spinner=new yt,this._actions=this.build_actions(),this._breadcrumb_view=new L(e),this._loaded_page_imgs=0,t&&new s(t),this.configEvents(),this._adjust_viewer_height(),m.l.on(m.c,this.on_document_image_loaded,this)}get actions(){return this._actions}get zoom(){return this._zoom}get page_list(){return this._page_list}on_document_image_loaded(t){this.page_list.length>this._loaded_page_imgs?this._loaded_page_imgs+=1:r()("aside.main-sidebar.animated-opacity").animate({opacity:1},200,(function(){r()(".main-header.animated-opacity").animate({opacity:1},200,(function(){r()("#pre-loader").hide(),r()(".content-wrapper.animated-opacity").animate({opacity:1},200,(function(){r()("#document").animate({opacity:1},200)}))}))}))}scroll_to(t){this._thumbnail_list.remove_highlights(),this._thumbnail_list.mark_highlight(t),this._page_list.scroll_to(t)}on_thumbnail_dblclick(t){this.scroll_to(t)}on_thumbnail_click(t,e,n){console.log(`Page ${t} ${e} ${n} click`)}on_zoom_change(t){this.page_list.on_zoom(t)}on_page_move_up(t,e,n){this.actions.clear_selection(),this._thumbnail_list.clear_selections(),this._page_list.on_page_move_up(t,e,n)}on_page_move_down(t,e,n){this.actions.clear_selection(),this._thumbnail_list.clear_selections(),this._page_list.on_page_move_down(t,e,n)}configEvents(){let t=this;this._thumbnail_list.ondblclick(this.on_thumbnail_dblclick,this),this._thumbnail_list.onclick(this.on_thumbnail_click,this),this._thumbnail_list.subscribe(_t.MOVE_UP,t.on_page_move_up,t),this._thumbnail_list.subscribe(_t.MOVE_DOWN,t.on_page_move_down,t),this.zoom.subscribe("zoom",this.on_zoom_change,this),r()(window).resize((function(){let e=t.zoom.get_value();t.page_list.on_zoom(e),console.log("window resized"),t._adjust_viewer_height()}))}build_actions(){let t,e,n,i,s,o,a,l,c,u=new Et(this._thumbnail_list,this._page_list),d=this;return t=new kt({id:"#rename",enabled:function(t,e){return!0},action:function(t,e,n){let i,r,s={};function o(){d._breadcrumb_view.breadcrumb.fetch()}r=new Dt(n.id),s.success=function(t,e,n){i=new F(t),i.rename.on("change",o)},r.fetch(s)}}),e=new kt({id:"#delete-page",enabled:function(t,e){for(let e of t.all())if(e.page_num!=e.page_order)return!1;return t.length>0},action:function(t,e,n,i,s){let o,a,l,c=[];if(confirm("Are you sure?")){for(let e of t.all())l=e.doc_id,c.push(e.page_num);o=`/api/document/${l}/pages?`,a=r.a.param({pages:c}),r.a.ajax({url:o+a,method:"DELETE"}),i.delete_selected(t),s.delete_selected(t)}}}),n=new kt({id:"#cut-page",enabled:function(t,e){return t.length>0},action:function(t,e,n){let i,s,o=[];for(let e of t.all())s=e.doc_id,o.push(e.page_num);i=`/api/document/${s}/pages/cut`,r.a.post({url:i,type:"POST",data:JSON.stringify(o),dataType:"json",contentType:"application/json; charset=utf-8",error:function(t){403==t.status&&new f.a("Error",t.responseJSON.msg)}})}}),i=new kt({id:"#paste-page",enabled:function(t,e){return!0},action:function(t,e,n){let i;i=`/api/document/${n.id}/pages/paste`,r.a.post({url:i,type:"POST",dataType:"json",contentType:"application/json; charset=utf-8",error:function(t){403==t.status&&new f.a("Error",t.responseJSON.msg)}})}}),s=new kt({id:"#paste-page-before",enabled:function(t,e){return 1==t.length},action:function(t,e,n){let i,s=-1;for(let e of t.all())e.page_num&&(s=e.page_num);i=`/api/document/${n.id}/pages/paste`,r.a.post({url:i,type:"POST",data:JSON.stringify({before:s}),dataType:"json",contentType:"application/json; charset=utf-8"})}}),o=new kt({id:"#paste-page-after",enabled:function(t,e){return 1==t.length},action:function(t,e,n){let i,s=-1;for(let e of t.all())e.page_num&&(s=e.page_num);i=`/api/document/${n.id}/pages/paste`,r.a.post({url:i,type:"POST",data:JSON.stringify({after:s}),dataType:"json",contentType:"application/json; charset=utf-8"})}}),a=new kt({id:"#tags-menu-item",enabled:function(t,e){return!0},action:function(t,e,n){let i,r,s;r=new I.a({id:n.id,ctype:"document",document_url:"/node/"+n.id}),s=function(t,e,n){let r,s,o=t.get("node");s=new M.c([]);for(let t=0;t<o.alltags.length;t++)s.add({name:o.alltags[t].name,fg_color:o.alltags[t].fg_color,bg_color:o.alltags[t].bg_color});r=new I.a({id:o.id,title:o.title,tags:o.tags,alltags:o.alltags}),i=new tt(r,s)},r.fetch({success:s})}}),l=new kt({id:"#view-ocr",enabled:function(t,e){return!0},action:function(t,e,n){let i;t.length<=0?new f.a("warning",gettext("Select one page (from the thumbnails) to view its OCRed text")):t.length>1?new f.a("warning",gettext("Select <strong>exactly one</strong> page to view its OCRed text")):(i=t.first(),new Ft(i._doc_id,i._page_num,r()("#document-versions").val()))}}),c=new kt({id:"#apply-reorder-changes",enabled:function(t,e,n,i,r){if(!i)return!1;for(let t of i.all()){let e=_t.get_data_from_dom(t.dom_ref);if(e.page_num!=e.page_order)return!0}return!1},action:function(t,e,n,i,s){let o,a,l,c=[];if(confirm("Are you sure?")){for(let t of i.all())l=_t.get_data_from_dom(t.dom_ref),a=t.doc_id,c.push({page_num:l.page_num,page_order:l.page_order});o=`/api/document/${a}/pages`,r.a.post({url:o,type:"POST",data:JSON.stringify(c),dataType:"json",contentType:"application/json; charset=utf-8"})}}}),u.add(t),u.add(e),u.add(n),u.add(i),u.add(s),u.add(o),u.add(c),u.add(a),u.add(l),u}_adjust_viewer_height(){let t,e,n,i,s;t=Math.max(document.documentElement.clientHeight,window.innerHeight||0),i=r()("#breadcrumb").outerHeight(!0),e=r()("#document-actions").outerHeight(!0),n=r()("nav.main-header.navbar").outerHeight(!0),s=t-1.4*n-2*e,r()("#document").css("height",s+"px")}}let Vt=n(55);class Jt extends c.View{el(){return r()("#tag_editor")}initialize(){this.name=void 0,this.fg_color=void 0,this.bg_color=void 0,this.setup(),this.render()}events(){return{"change #id_fg_color":"on_fg_change","change #id_bg_color":"on_bg_change","keyup #id_name":"on_name_change"}}setup(){this._set_fg_color(),this._set_bg_color(),this._set_name_change()}_set_fg_color(){let t=document.getElementById("id_fg_color");t&&(this.fg_color=t.value)}_set_bg_color(){let t=document.getElementById("id_bg_color");t&&(this.bg_color=t.value)}_set_name_change(){let t=document.getElementById("id_name");t&&(this.name=Object(l.f)(t.value))}on_fg_change(t){this._set_fg_color(),this.render()}on_bg_change(t){this._set_bg_color(),this.render()}on_name_change(t){this._set_name_change(),this.render()}render(){let t,e;e={},t=o.default.template(Vt({name:this.name,fg_color:this.fg_color,bg_color:this.bg_color})),this.$el.find("#tag_editor_preview").html(t)}}class Xt extends c.View{el(){return r()("#pinned_tags_view")}events(){return{"click .tag":"on_click"}}on_click(t){let e=r()(t.currentTarget).parent();e.siblings().removeClass("active"),e.addClass("active")}}class Kt extends c.View{el(){return r()("#checkbox_view")}events(){return{"click #action_toggle":"on_click"}}on_click(t){r()("[name=_selected_action]").each((function(){this.checked=!this.checked}))}}class Gt extends c.View{el(){return r()(document)}get el_menu(){return r()("#context-menu")}events(){return{contextmenu:"context_menu_trigger",click:"hide_context_menu"}}hide_context_menu(t){this.el_menu.hide()}context_menu_trigger(t){t.preventDefault(),this.el_menu.toggle().css({top:t.pageY+"px",left:t.pageX+"px"})}}class Yt extends c.View{el(){return r()("#id_permissions")}initialize(){this.$el.find(".multi-toggle").each((function(t,e){let n,i,s;s=r()(e),n=s.parent().parent().find("input[type=checkbox]"),i=o.default.reduce(n,(function(t,e){return r()(e).prop("checked")&&(t+=1),t}),0),i>=4&&s.prop("checked",!0)}))}events(){return{"click .multi-toggle":"on_multi_toggle"}}on_multi_toggle(t){let e=r()(t.currentTarget);e.prop("checked")?e.parent().parent().find("input[type=checkbox]").prop("checked",!0):e.parent().parent().find("input[type=checkbox]").prop("checked",!1)}}class Qt extends c.Model{urlRoot(){return"/admin/version/"}}let Zt=n(56);class te extends c.View{el(){return r()("#message-modal")}initialize(){this.version=new Qt,this.version.fetch(),this.listenTo(this.version,"change",this.render)}events(){return{"click .ok":"on_ok"}}on_ok(t){this.$el.modal("hide")}render(){let t,e;e={},t=o.default.template(Zt({version:this.version.get("msg")})),this.$el.html(t),this.$el.modal()}}class ee extends c.View{el(){return r()("#user-menu")}events(){return{"click #about":"on_about"}}on_about(t){new te}}n(18),n(57),n(58);let ne=u.a.sync;u.a.sync=function(t,e,n){let i=r()("[name=csrfmiddlewaretoken]").val();n.headers={"X-CSRFToken":i},ne(t,e,n)};r()((function(t){!function(){let t,e,n,i,s,o,a,l,c,d,h,_,f,p,g;t=new O,e=new ut,n=new L,a=new Jt,l=new Xt,c=new Kt,d=new K,h=new G,_=new Pt,f=new Gt,p=new Yt,g=new ee,1==r()("#document").length?(i=new Ut,s=new Wt):(o=new x(t,n,e),u.a.history.start())}()}))}]);