pat/web/dist/js/app.js
Martin Hebnes Pedersen 4811996dac Build web assets
2025-09-13 17:20:50 +02:00

3 lines
No EOL
264 KiB
JavaScript
Raw Permalink Blame History

/*! For license information please see app.js.LICENSE.txt */
!function(t){var e={};function n(i){if(e[i])return e[i].exports;var o=e[i]={i:i,l:!1,exports:{}};return t[i].call(o.exports,o,o.exports,n),o.l=!0,o.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 o in t)n.d(i,o,function(e){return t[e]}.bind(null,o));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;!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,o){"use strict";var s=[],r=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,d=s.indexOf,u={},p=u.toString,h=u.hasOwnProperty,f=h.toString,m=f.call(Object),g={},v=function(t){return"function"==typeof t&&"number"!=typeof t.nodeType&&"function"!=typeof t.item},y=function(t){return null!=t&&t===t.window},b=n.document,w={type:!0,src:!0,nonce:!0,noModule:!0};function x(t,e,n){var i,o,s=(n=n||b).createElement("script");if(s.text=t,e)for(i in w)(o=e[i]||e.getAttribute&&e.getAttribute(i))&&s.setAttribute(i,o);n.head.appendChild(s).parentNode.removeChild(s)}function k(t){return null==t?t+"":"object"==typeof t||"function"==typeof t?u[p.call(t)]||"object":typeof t}var C="3.6.0",$=function(t,e){return new $.fn.init(t,e)};function S(t){var e=!!t&&"length"in t&&t.length,n=k(t);return!v(t)&&!y(t)&&("array"===n||0===e||"number"==typeof e&&e>0&&e-1 in t)}$.fn=$.prototype={jquery:C,constructor:$,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=$.merge(this.constructor(),t);return e.prevObject=this,e},each:function(t){return $.each(this,t)},map:function(t){return this.pushStack($.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($.grep(this,(function(t,e){return(e+1)%2})))},odd:function(){return this.pushStack($.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},$.extend=$.fn.extend=function(){var t,e,n,i,o,s,r=arguments[0]||{},a=1,l=arguments.length,c=!1;for("boolean"==typeof r&&(c=r,r=arguments[a]||{},a++),"object"==typeof r||v(r)||(r={}),a===l&&(r=this,a--);a<l;a++)if(null!=(t=arguments[a]))for(e in t)i=t[e],"__proto__"!==e&&r!==i&&(c&&i&&($.isPlainObject(i)||(o=Array.isArray(i)))?(n=r[e],s=o&&!Array.isArray(n)?[]:o||$.isPlainObject(n)?n:{},o=!1,r[e]=$.extend(c,s,i)):void 0!==i&&(r[e]=i));return r},$.extend({expando:"jQuery"+(C+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]"!==p.call(t))&&(!(e=r(t))||"function"==typeof(n=h.call(e,"constructor")&&e.constructor)&&f.call(n)===m)},isEmptyObject:function(t){var e;for(e in t)return!1;return!0},globalEval:function(t,e,n){x(t,{nonce:e&&e.nonce},n)},each:function(t,e){var n,i=0;if(S(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&&(S(Object(t))?$.merge(n,"string"==typeof t?[t]:t):c.call(n,t)),n},inArray:function(t,e,n){return null==e?-1:d.call(e,t,n)},merge:function(t,e){for(var n=+e.length,i=0,o=t.length;i<n;i++)t[o++]=e[i];return t.length=o,t},grep:function(t,e,n){for(var i=[],o=0,s=t.length,r=!n;o<s;o++)!e(t[o],o)!==r&&i.push(t[o]);return i},map:function(t,e,n){var i,o,s=0,r=[];if(S(t))for(i=t.length;s<i;s++)null!=(o=e(t[s],s,n))&&r.push(o);else for(s in t)null!=(o=e(t[s],s,n))&&r.push(o);return l(r)},guid:1,support:g}),"function"==typeof Symbol&&($.fn[Symbol.iterator]=s[Symbol.iterator]),$.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),(function(t,e){u["[object "+e+"]"]=e.toLowerCase()}));var T=function(t){var e,n,i,o,s,r,a,l,c,d,u,p,h,f,m,g,v,y,b,w="sizzle"+1*new Date,x=t.document,k=0,C=0,$=lt(),S=lt(),T=lt(),_=lt(),E=function(t,e){return t===e&&(u=!0),0},A={}.hasOwnProperty,I=[],D=I.pop,P=I.push,j=I.push,N=I.slice,O=function(t,e){for(var n=0,i=t.length;n<i;n++)if(t[n]===e)return n;return-1},R="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",L="[\\x20\\t\\r\\n\\f]",F="(?:\\\\[\\da-fA-F]{1,6}"+L+"?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",q="\\["+L+"*("+F+")(?:"+L+"*([*^$|!~]?=)"+L+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+F+"))|)"+L+"*\\]",z=":("+F+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+q+")*)|.*)\\)|)",M=new RegExp(L+"+","g"),H=new RegExp("^"+L+"+|((?:^|[^\\\\])(?:\\\\.)*)"+L+"+$","g"),B=new RegExp("^"+L+"*,"+L+"*"),U=new RegExp("^"+L+"*([>+~]|"+L+")"+L+"*"),W=new RegExp(L+"|>"),Q=new RegExp(z),V=new RegExp("^"+F+"$"),G={ID:new RegExp("^#("+F+")"),CLASS:new RegExp("^\\.("+F+")"),TAG:new RegExp("^("+F+"|[*])"),ATTR:new RegExp("^"+q),PSEUDO:new RegExp("^"+z),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+L+"*(even|odd|(([+-]|)(\\d*)n|)"+L+"*(?:([+-]|)"+L+"*(\\d+)|))"+L+"*\\)|)","i"),bool:new RegExp("^(?:"+R+")$","i"),needsContext:new RegExp("^"+L+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+L+"*((?:-\\d)?\\d*)"+L+"*\\)|)(?=[^-]|$)","i")},J=/HTML$/i,X=/^(?:input|select|textarea|button)$/i,K=/^h\d$/i,Y=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,tt=/[+~]/,et=new RegExp("\\\\[\\da-fA-F]{1,6}"+L+"?|\\\\([^\\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,ot=function(t,e){return e?"\0"===t?"<22>":t.slice(0,-1)+"\\"+t.charCodeAt(t.length-1).toString(16)+" ":"\\"+t},st=function(){p()},rt=wt((function(t){return!0===t.disabled&&"fieldset"===t.nodeName.toLowerCase()}),{dir:"parentNode",next:"legend"});try{j.apply(I=N.call(x.childNodes),x.childNodes),I[x.childNodes.length].nodeType}catch(t){j={apply:I.length?function(t,e){P.apply(t,N.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,o){var s,a,c,d,u,f,v,y=e&&e.ownerDocument,x=e?e.nodeType:9;if(i=i||[],"string"!=typeof t||!t||1!==x&&9!==x&&11!==x)return i;if(!o&&(p(e),e=e||h,m)){if(11!==x&&(u=Z.exec(t)))if(s=u[1]){if(9===x){if(!(c=e.getElementById(s)))return i;if(c.id===s)return i.push(c),i}else if(y&&(c=y.getElementById(s))&&b(e,c)&&c.id===s)return i.push(c),i}else{if(u[2])return j.apply(i,e.getElementsByTagName(t)),i;if((s=u[3])&&n.getElementsByClassName&&e.getElementsByClassName)return j.apply(i,e.getElementsByClassName(s)),i}if(n.qsa&&!_[t+" "]&&(!g||!g.test(t))&&(1!==x||"object"!==e.nodeName.toLowerCase())){if(v=t,y=e,1===x&&(W.test(t)||U.test(t))){for((y=tt.test(t)&&vt(e.parentNode)||e)===e&&n.scope||((d=e.getAttribute("id"))?d=d.replace(it,ot):e.setAttribute("id",d=w)),a=(f=r(t)).length;a--;)f[a]=(d?"#"+d:":scope")+" "+bt(f[a]);v=f.join(",")}try{return j.apply(i,y.querySelectorAll(v)),i}catch(e){_(t,!0)}finally{d===w&&e.removeAttribute("id")}}}return l(t.replace(H,"$1"),e,i,o)}function lt(){var t=[];return function e(n,o){return t.push(n+" ")>i.cacheLength&&delete e[t.shift()],e[n+" "]=o}}function ct(t){return t[w]=!0,t}function dt(t){var e=h.createElement("fieldset");try{return!!t(e)}catch(t){return!1}finally{e.parentNode&&e.parentNode.removeChild(e),e=null}}function ut(t,e){for(var n=t.split("|"),o=n.length;o--;)i.attrHandle[n[o]]=e}function pt(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 ht(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 mt(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&&rt(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 o,s=t([],n.length,e),r=s.length;r--;)n[o=s[r]]&&(n[o]=!(i[o]=n[o]))}))}))}function vt(t){return t&&void 0!==t.getElementsByTagName&&t}for(e in n=at.support={},s=at.isXML=function(t){var e=t&&t.namespaceURI,n=t&&(t.ownerDocument||t).documentElement;return!J.test(e||n&&n.nodeName||"HTML")},p=at.setDocument=function(t){var e,o,r=t?t.ownerDocument||t:x;return r!=h&&9===r.nodeType&&r.documentElement?(f=(h=r).documentElement,m=!s(h),x!=h&&(o=h.defaultView)&&o.top!==o&&(o.addEventListener?o.addEventListener("unload",st,!1):o.attachEvent&&o.attachEvent("onunload",st)),n.scope=dt((function(t){return f.appendChild(t).appendChild(h.createElement("div")),void 0!==t.querySelectorAll&&!t.querySelectorAll(":scope fieldset div").length})),n.attributes=dt((function(t){return t.className="i",!t.getAttribute("className")})),n.getElementsByTagName=dt((function(t){return t.appendChild(h.createComment("")),!t.getElementsByTagName("*").length})),n.getElementsByClassName=Y.test(h.getElementsByClassName),n.getById=dt((function(t){return f.appendChild(t).id=w,!h.getElementsByName||!h.getElementsByName(w).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&&m){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&&m){var n,i,o,s=e.getElementById(t);if(s){if((n=s.getAttributeNode("id"))&&n.value===t)return[s];for(o=e.getElementsByName(t),i=0;s=o[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=[],o=0,s=e.getElementsByTagName(t);if("*"===t){for(;n=s[o++];)1===n.nodeType&&i.push(n);return i}return s},i.find.CLASS=n.getElementsByClassName&&function(t,e){if(void 0!==e.getElementsByClassName&&m)return e.getElementsByClassName(t)},v=[],g=[],(n.qsa=Y.test(h.querySelectorAll))&&(dt((function(t){var e;f.appendChild(t).innerHTML="<a id='"+w+"'></a><select id='"+w+"-\r\\' msallowcapture=''><option selected=''></option></select>",t.querySelectorAll("[msallowcapture^='']").length&&g.push("[*^$]="+L+"*(?:''|\"\")"),t.querySelectorAll("[selected]").length||g.push("\\["+L+"*(?:value|"+R+")"),t.querySelectorAll("[id~="+w+"-]").length||g.push("~="),(e=h.createElement("input")).setAttribute("name",""),t.appendChild(e),t.querySelectorAll("[name='']").length||g.push("\\["+L+"*name"+L+"*="+L+"*(?:''|\"\")"),t.querySelectorAll(":checked").length||g.push(":checked"),t.querySelectorAll("a#"+w+"+*").length||g.push(".#.+[+~]"),t.querySelectorAll("\\\f"),g.push("[\\r\\n\\f]")})),dt((function(t){t.innerHTML="<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>";var e=h.createElement("input");e.setAttribute("type","hidden"),t.appendChild(e).setAttribute("name","D"),t.querySelectorAll("[name=d]").length&&g.push("name"+L+"*[*^$|!~]?="),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=Y.test(y=f.matches||f.webkitMatchesSelector||f.mozMatchesSelector||f.oMatchesSelector||f.msMatchesSelector))&&dt((function(t){n.disconnectedMatch=y.call(t,"*"),y.call(t,"[s!='']:x"),v.push("!=",z)})),g=g.length&&new RegExp(g.join("|")),v=v.length&&new RegExp(v.join("|")),e=Y.test(f.compareDocumentPosition),b=e||Y.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},E=e?function(t,e){if(t===e)return u=!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==h||t.ownerDocument==x&&b(x,t)?-1:e==h||e.ownerDocument==x&&b(x,e)?1:d?O(d,t)-O(d,e):0:4&i?-1:1)}:function(t,e){if(t===e)return u=!0,0;var n,i=0,o=t.parentNode,s=e.parentNode,r=[t],a=[e];if(!o||!s)return t==h?-1:e==h?1:o?-1:s?1:d?O(d,t)-O(d,e):0;if(o===s)return pt(t,e);for(n=t;n=n.parentNode;)r.unshift(n);for(n=e;n=n.parentNode;)a.unshift(n);for(;r[i]===a[i];)i++;return i?pt(r[i],a[i]):r[i]==x?-1:a[i]==x?1:0},h):h},at.matches=function(t,e){return at(t,null,null,e)},at.matchesSelector=function(t,e){if(p(t),n.matchesSelector&&m&&!_[e+" "]&&(!v||!v.test(e))&&(!g||!g.test(e)))try{var i=y.call(t,e);if(i||n.disconnectedMatch||t.document&&11!==t.document.nodeType)return i}catch(t){_(e,!0)}return at(e,h,null,[t]).length>0},at.contains=function(t,e){return(t.ownerDocument||t)!=h&&p(t),b(t,e)},at.attr=function(t,e){(t.ownerDocument||t)!=h&&p(t);var o=i.attrHandle[e.toLowerCase()],s=o&&A.call(i.attrHandle,e.toLowerCase())?o(t,e,!m):void 0;return void 0!==s?s:n.attributes||!m?t.getAttribute(e):(s=t.getAttributeNode(e))&&s.specified?s.value:null},at.escape=function(t){return(t+"").replace(it,ot)},at.error=function(t){throw new Error("Syntax error, unrecognized expression: "+t)},at.uniqueSort=function(t){var e,i=[],o=0,s=0;if(u=!n.detectDuplicates,d=!n.sortStable&&t.slice(0),t.sort(E),u){for(;e=t[s++];)e===t[s]&&(o=i.push(s));for(;o--;)t.splice(i[o],1)}return d=null,t},o=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+=o(t)}else if(3===s||4===s)return t.nodeValue}else for(;e=t[i++];)n+=o(e);return n},i=at.selectors={cacheLength:50,createPseudo:ct,match:G,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 G.CHILD.test(t[0])?null:(t[3]?t[2]=t[4]||t[5]||"":n&&Q.test(n)&&(e=r(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=$[t+" "];return e||(e=new RegExp("(^|"+L+")"+t+"("+L+"|$)"))&&$(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 o=at.attr(i,t);return null==o?"!="===e:!e||(o+="","="===e?o===n:"!="===e?o!==n:"^="===e?n&&0===o.indexOf(n):"*="===e?n&&o.indexOf(n)>-1:"$="===e?n&&o.slice(-n.length)===n:"~="===e?(" "+o.replace(M," ")+" ").indexOf(n)>-1:"|="===e&&(o===n||o.slice(0,n.length+1)===n+"-"))}},CHILD:function(t,e,n,i,o){var s="nth"!==t.slice(0,3),r="last"!==t.slice(-4),a="of-type"===e;return 1===i&&0===o?function(t){return!!t.parentNode}:function(e,n,l){var c,d,u,p,h,f,m=s!==r?"nextSibling":"previousSibling",g=e.parentNode,v=a&&e.nodeName.toLowerCase(),y=!l&&!a,b=!1;if(g){if(s){for(;m;){for(p=e;p=p[m];)if(a?p.nodeName.toLowerCase()===v:1===p.nodeType)return!1;f=m="only"===t&&!f&&"nextSibling"}return!0}if(f=[r?g.firstChild:g.lastChild],r&&y){for(b=(h=(c=(d=(u=(p=g)[w]||(p[w]={}))[p.uniqueID]||(u[p.uniqueID]={}))[t]||[])[0]===k&&c[1])&&c[2],p=h&&g.childNodes[h];p=++h&&p&&p[m]||(b=h=0)||f.pop();)if(1===p.nodeType&&++b&&p===e){d[t]=[k,h,b];break}}else if(y&&(b=h=(c=(d=(u=(p=e)[w]||(p[w]={}))[p.uniqueID]||(u[p.uniqueID]={}))[t]||[])[0]===k&&c[1]),!1===b)for(;(p=++h&&p&&p[m]||(b=h=0)||f.pop())&&((a?p.nodeName.toLowerCase()!==v:1!==p.nodeType)||!++b||(y&&((d=(u=p[w]||(p[w]={}))[p.uniqueID]||(u[p.uniqueID]={}))[t]=[k,b]),p!==e)););return(b-=o)===i||b%i==0&&b/i>=0}}},PSEUDO:function(t,e){var n,o=i.pseudos[t]||i.setFilters[t.toLowerCase()]||at.error("unsupported pseudo: "+t);return o[w]?o(e):o.length>1?(n=[t,t,"",e],i.setFilters.hasOwnProperty(t.toLowerCase())?ct((function(t,n){for(var i,s=o(t,e),r=s.length;r--;)t[i=O(t,s[r])]=!(n[i]=s[r])})):function(t){return o(t,0,n)}):o}},pseudos:{not:ct((function(t){var e=[],n=[],i=a(t.replace(H,"$1"));return i[w]?ct((function(t,e,n,o){for(var s,r=i(t,null,o,[]),a=t.length;a--;)(s=r[a])&&(t[a]=!(e[a]=s))})):function(t,o,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||o(e)).indexOf(t)>-1}})),lang:ct((function(t){return V.test(t||"")||at.error("unsupported lang: "+t),t=t.replace(et,nt).toLowerCase(),function(e){var n;do{if(n=m?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===h.activeElement&&(!h.hasFocus||h.hasFocus())&&!!(t.type||t.href||~t.tabIndex)},enabled:mt(!1),disabled:mt(!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 K.test(t.nodeName)},input:function(t){return X.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}))}},i.pseudos.nth=i.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})i.pseudos[e]=ht(e);for(e in{submit:!0,reset:!0})i.pseudos[e]=ft(e);function yt(){}function bt(t){for(var e=0,n=t.length,i="";e<n;e++)i+=t[e].value;return i}function wt(t,e,n){var i=e.dir,o=e.next,s=o||i,r=n&&"parentNode"===s,a=C++;return e.first?function(e,n,o){for(;e=e[i];)if(1===e.nodeType||r)return t(e,n,o);return!1}:function(e,n,l){var c,d,u,p=[k,a];if(l){for(;e=e[i];)if((1===e.nodeType||r)&&t(e,n,l))return!0}else for(;e=e[i];)if(1===e.nodeType||r)if(d=(u=e[w]||(e[w]={}))[e.uniqueID]||(u[e.uniqueID]={}),o&&o===e.nodeName.toLowerCase())e=e[i]||e;else{if((c=d[s])&&c[0]===k&&c[1]===a)return p[2]=c[2];if(d[s]=p,p[2]=t(e,n,l))return!0}return!1}}function xt(t){return t.length>1?function(e,n,i){for(var o=t.length;o--;)if(!t[o](e,n,i))return!1;return!0}:t[0]}function kt(t,e,n,i,o){for(var s,r=[],a=0,l=t.length,c=null!=e;a<l;a++)(s=t[a])&&(n&&!n(s,i,o)||(r.push(s),c&&e.push(a)));return r}function Ct(t,e,n,i,o,s){return i&&!i[w]&&(i=Ct(i)),o&&!o[w]&&(o=Ct(o,s)),ct((function(s,r,a,l){var c,d,u,p=[],h=[],f=r.length,m=s||function(t,e,n){for(var i=0,o=e.length;i<o;i++)at(t,e[i],n);return n}(e||"*",a.nodeType?[a]:a,[]),g=!t||!s&&e?m:kt(m,p,t,a,l),v=n?o||(s?t:f||i)?[]:r:g;if(n&&n(g,v,a,l),i)for(c=kt(v,h),i(c,[],a,l),d=c.length;d--;)(u=c[d])&&(v[h[d]]=!(g[h[d]]=u));if(s){if(o||t){if(o){for(c=[],d=v.length;d--;)(u=v[d])&&c.push(g[d]=u);o(null,v=[],c,l)}for(d=v.length;d--;)(u=v[d])&&(c=o?O(s,u):p[d])>-1&&(s[c]=!(r[c]=u))}}else v=kt(v===r?v.splice(f,v.length):v),o?o(null,r,v,l):j.apply(r,v)}))}function $t(t){for(var e,n,o,s=t.length,r=i.relative[t[0].type],a=r||i.relative[" "],l=r?1:0,d=wt((function(t){return t===e}),a,!0),u=wt((function(t){return O(e,t)>-1}),a,!0),p=[function(t,n,i){var o=!r&&(i||n!==c)||((e=n).nodeType?d(t,n,i):u(t,n,i));return e=null,o}];l<s;l++)if(n=i.relative[t[l].type])p=[wt(xt(p),n)];else{if((n=i.filter[t[l].type].apply(null,t[l].matches))[w]){for(o=++l;o<s&&!i.relative[t[o].type];o++);return Ct(l>1&&xt(p),l>1&&bt(t.slice(0,l-1).concat({value:" "===t[l-2].type?"*":""})).replace(H,"$1"),n,l<o&&$t(t.slice(l,o)),o<s&&$t(t=t.slice(o)),o<s&&bt(t))}p.push(n)}return xt(p)}return yt.prototype=i.filters=i.pseudos,i.setFilters=new yt,r=at.tokenize=function(t,e){var n,o,s,r,a,l,c,d=S[t+" "];if(d)return e?0:d.slice(0);for(a=t,l=[],c=i.preFilter;a;){for(r in n&&!(o=B.exec(a))||(o&&(a=a.slice(o[0].length)||a),l.push(s=[])),n=!1,(o=U.exec(a))&&(n=o.shift(),s.push({value:n,type:o[0].replace(H," ")}),a=a.slice(n.length)),i.filter)!(o=G[r].exec(a))||c[r]&&!(o=c[r](o))||(n=o.shift(),s.push({value:n,type:r,matches:o}),a=a.slice(n.length));if(!n)break}return e?a.length:a?at.error(t):S(t,l).slice(0)},a=at.compile=function(t,e){var n,o=[],s=[],a=T[t+" "];if(!a){for(e||(e=r(t)),n=e.length;n--;)(a=$t(e[n]))[w]?o.push(a):s.push(a);a=T(t,function(t,e){var n=e.length>0,o=t.length>0,s=function(s,r,a,l,d){var u,f,g,v=0,y="0",b=s&&[],w=[],x=c,C=s||o&&i.find.TAG("*",d),$=k+=null==x?1:Math.random()||.1,S=C.length;for(d&&(c=r==h||r||d);y!==S&&null!=(u=C[y]);y++){if(o&&u){for(f=0,r||u.ownerDocument==h||(p(u),a=!m);g=t[f++];)if(g(u,r||h,a)){l.push(u);break}d&&(k=$)}n&&((u=!g&&u)&&v--,s&&b.push(u))}if(v+=y,n&&y!==v){for(f=0;g=e[f++];)g(b,w,r,a);if(s){if(v>0)for(;y--;)b[y]||w[y]||(w[y]=D.call(l));w=kt(w)}j.apply(l,w),d&&!s&&w.length>0&&v+e.length>1&&at.uniqueSort(l)}return d&&(k=$,c=x),b};return n?ct(s):s}(s,o)),a.selector=t}return a},l=at.select=function(t,e,n,o){var s,l,c,d,u,p="function"==typeof t&&t,h=!o&&r(t=p.selector||t);if(n=n||[],1===h.length){if((l=h[0]=h[0].slice(0)).length>2&&"ID"===(c=l[0]).type&&9===e.nodeType&&m&&i.relative[l[1].type]){if(!(e=(i.find.ID(c.matches[0].replace(et,nt),e)||[])[0]))return n;p&&(e=e.parentNode),t=t.slice(l.shift().value.length)}for(s=G.needsContext.test(t)?0:l.length;s--&&(c=l[s],!i.relative[d=c.type]);)if((u=i.find[d])&&(o=u(c.matches[0].replace(et,nt),tt.test(l[0].type)&&vt(e.parentNode)||e))){if(l.splice(s,1),!(t=o.length&&bt(l)))return j.apply(n,o),n;break}}return(p||a(t,h))(o,e,!m,n,!e||tt.test(t)&&vt(e.parentNode)||e),n},n.sortStable=w.split("").sort(E).join("")===w,n.detectDuplicates=!!u,p(),n.sortDetached=dt((function(t){return 1&t.compareDocumentPosition(h.createElement("fieldset"))})),dt((function(t){return t.innerHTML="<a href='#'></a>","#"===t.firstChild.getAttribute("href")}))||ut("type|href|height|width",(function(t,e,n){if(!n)return t.getAttribute(e,"type"===e.toLowerCase()?1:2)})),n.attributes&&dt((function(t){return t.innerHTML="<input/>",t.firstChild.setAttribute("value",""),""===t.firstChild.getAttribute("value")}))||ut("value",(function(t,e,n){if(!n&&"input"===t.nodeName.toLowerCase())return t.defaultValue})),dt((function(t){return null==t.getAttribute("disabled")}))||ut(R,(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);$.find=T,$.expr=T.selectors,$.expr[":"]=$.expr.pseudos,$.uniqueSort=$.unique=T.uniqueSort,$.text=T.getText,$.isXMLDoc=T.isXML,$.contains=T.contains,$.escapeSelector=T.escape;var _=function(t,e,n){for(var i=[],o=void 0!==n;(t=t[e])&&9!==t.nodeType;)if(1===t.nodeType){if(o&&$(t).is(n))break;i.push(t)}return i},E=function(t,e){for(var n=[];t;t=t.nextSibling)1===t.nodeType&&t!==e&&n.push(t);return n},A=$.expr.match.needsContext;function I(t,e){return t.nodeName&&t.nodeName.toLowerCase()===e.toLowerCase()}var D=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function P(t,e,n){return v(e)?$.grep(t,(function(t,i){return!!e.call(t,i,t)!==n})):e.nodeType?$.grep(t,(function(t){return t===e!==n})):"string"!=typeof e?$.grep(t,(function(t){return d.call(e,t)>-1!==n})):$.filter(e,t,n)}$.filter=function(t,e,n){var i=e[0];return n&&(t=":not("+t+")"),1===e.length&&1===i.nodeType?$.find.matchesSelector(i,t)?[i]:[]:$.find.matches(t,$.grep(e,(function(t){return 1===t.nodeType})))},$.fn.extend({find:function(t){var e,n,i=this.length,o=this;if("string"!=typeof t)return this.pushStack($(t).filter((function(){for(e=0;e<i;e++)if($.contains(o[e],this))return!0})));for(n=this.pushStack([]),e=0;e<i;e++)$.find(t,o[e],n);return i>1?$.uniqueSort(n):n},filter:function(t){return this.pushStack(P(this,t||[],!1))},not:function(t){return this.pushStack(P(this,t||[],!0))},is:function(t){return!!P(this,"string"==typeof t&&A.test(t)?$(t):t||[],!1).length}});var j,N=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;($.fn.init=function(t,e,n){var i,o;if(!t)return this;if(n=n||j,"string"==typeof t){if(!(i="<"===t[0]&&">"===t[t.length-1]&&t.length>=3?[null,t,null]:N.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 $?e[0]:e,$.merge(this,$.parseHTML(i[1],e&&e.nodeType?e.ownerDocument||e:b,!0)),D.test(i[1])&&$.isPlainObject(e))for(i in e)v(this[i])?this[i](e[i]):this.attr(i,e[i]);return this}return(o=b.getElementById(i[2]))&&(this[0]=o,this.length=1),this}return t.nodeType?(this[0]=t,this.length=1,this):v(t)?void 0!==n.ready?n.ready(t):t($):$.makeArray(t,this)}).prototype=$.fn,j=$(b);var O=/^(?: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}$.fn.extend({has:function(t){var e=$(t,this),n=e.length;return this.filter((function(){for(var t=0;t<n;t++)if($.contains(this,e[t]))return!0}))},closest:function(t,e){var n,i=0,o=this.length,s=[],r="string"!=typeof t&&$(t);if(!A.test(t))for(;i<o;i++)for(n=this[i];n&&n!==e;n=n.parentNode)if(n.nodeType<11&&(r?r.index(n)>-1:1===n.nodeType&&$.find.matchesSelector(n,t))){s.push(n);break}return this.pushStack(s.length>1?$.uniqueSort(s):s)},index:function(t){return t?"string"==typeof t?d.call($(t),this[0]):d.call(this,t.jquery?t[0]:t):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(t,e){return this.pushStack($.uniqueSort($.merge(this.get(),$(t,e))))},addBack:function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}}),$.each({parent:function(t){var e=t.parentNode;return e&&11!==e.nodeType?e:null},parents:function(t){return _(t,"parentNode")},parentsUntil:function(t,e,n){return _(t,"parentNode",n)},next:function(t){return L(t,"nextSibling")},prev:function(t){return L(t,"previousSibling")},nextAll:function(t){return _(t,"nextSibling")},prevAll:function(t){return _(t,"previousSibling")},nextUntil:function(t,e,n){return _(t,"nextSibling",n)},prevUntil:function(t,e,n){return _(t,"previousSibling",n)},siblings:function(t){return E((t.parentNode||{}).firstChild,t)},children:function(t){return E(t.firstChild)},contents:function(t){return null!=t.contentDocument&&r(t.contentDocument)?t.contentDocument:(I(t,"template")&&(t=t.content||t),$.merge([],t.childNodes))}},(function(t,e){$.fn[t]=function(n,i){var o=$.map(this,e,n);return"Until"!==t.slice(-5)&&(i=n),i&&"string"==typeof i&&(o=$.filter(i,o)),this.length>1&&(R[t]||$.uniqueSort(o),O.test(t)&&o.reverse()),this.pushStack(o)}}));var F=/[^\x20\t\r\n\f]+/g;function q(t){return t}function z(t){throw t}function M(t,e,n,i){var o;try{t&&v(o=t.promise)?o.call(t).done(e).fail(n):t&&v(o=t.then)?o.call(t,e,n):e.apply(void 0,[t].slice(i))}catch(t){n.apply(void 0,[t])}}$.Callbacks=function(t){t="string"==typeof t?function(t){var e={};return $.each(t.match(F)||[],(function(t,n){e[n]=!0})),e}(t):$.extend({},t);var e,n,i,o,s=[],r=[],a=-1,l=function(){for(o=o||t.once,i=e=!0;r.length;a=-1)for(n=r.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,o&&(s=n?[]:"")},c={add:function(){return s&&(n&&!e&&(a=s.length-1,r.push(n)),function e(n){$.each(n,(function(n,i){v(i)?t.unique&&c.has(i)||s.push(i):i&&i.length&&"string"!==k(i)&&e(i)}))}(arguments),n&&!e&&l()),this},remove:function(){return $.each(arguments,(function(t,e){for(var n;(n=$.inArray(e,s,n))>-1;)s.splice(n,1),n<=a&&a--})),this},has:function(t){return t?$.inArray(t,s)>-1:s.length>0},empty:function(){return s&&(s=[]),this},disable:function(){return o=r=[],s=n="",this},disabled:function(){return!s},lock:function(){return o=r=[],n||e||(s=n=""),this},locked:function(){return!!o},fireWith:function(t,n){return o||(n=[t,(n=n||[]).slice?n.slice():n],r.push(n),e||l()),this},fire:function(){return c.fireWith(this,arguments),this},fired:function(){return!!i}};return c},$.extend({Deferred:function(t){var e=[["notify","progress",$.Callbacks("memory"),$.Callbacks("memory"),2],["resolve","done",$.Callbacks("once memory"),$.Callbacks("once memory"),0,"resolved"],["reject","fail",$.Callbacks("once memory"),$.Callbacks("once memory"),1,"rejected"]],i="pending",o={state:function(){return i},always:function(){return s.done(arguments).fail(arguments),this},catch:function(t){return o.then(null,t)},pipe:function(){var t=arguments;return $.Deferred((function(n){$.each(e,(function(e,i){var o=v(t[i[4]])&&t[i[4]];s[i[1]]((function(){var t=o&&o.apply(this,arguments);t&&v(t.promise)?t.promise().progress(n.notify).done(n.resolve).fail(n.reject):n[i[0]+"With"](this,o?[t]:arguments)}))})),t=null})).promise()},then:function(t,i,o){var s=0;function r(t,e,i,o){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,v(c)?o?c.call(n,r(s,e,q,o),r(s,e,z,o)):(s++,c.call(n,r(s,e,q,o),r(s,e,z,o),r(s,e,q,e.notifyWith))):(i!==q&&(a=void 0,l=[n]),(o||e.resolveWith)(a,l))}},d=o?c:function(){try{c()}catch(n){$.Deferred.exceptionHook&&$.Deferred.exceptionHook(n,d.stackTrace),t+1>=s&&(i!==z&&(a=void 0,l=[n]),e.rejectWith(a,l))}};t?d():($.Deferred.getStackHook&&(d.stackTrace=$.Deferred.getStackHook()),n.setTimeout(d))}}return $.Deferred((function(n){e[0][3].add(r(0,n,v(o)?o:q,n.notifyWith)),e[1][3].add(r(0,n,v(t)?t:q)),e[2][3].add(r(0,n,v(i)?i:z))})).promise()},promise:function(t){return null!=t?$.extend(t,o):o}},s={};return $.each(e,(function(t,n){var r=n[2],a=n[5];o[n[1]]=r.add,a&&r.add((function(){i=a}),e[3-t][2].disable,e[3-t][3].disable,e[0][2].lock,e[0][3].lock),r.add(n[3].fire),s[n[0]]=function(){return s[n[0]+"With"](this===s?void 0:this,arguments),this},s[n[0]+"With"]=r.fireWith})),o.promise(s),t&&t.call(s,s),s},when:function(t){var e=arguments.length,n=e,i=Array(n),o=a.call(arguments),s=$.Deferred(),r=function(t){return function(n){i[t]=this,o[t]=arguments.length>1?a.call(arguments):n,--e||s.resolveWith(i,o)}};if(e<=1&&(M(t,s.done(r(n)).resolve,s.reject,!e),"pending"===s.state()||v(o[n]&&o[n].then)))return s.then();for(;n--;)M(o[n],r(n),s.reject);return s.promise()}});var H=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;$.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)},$.readyException=function(t){n.setTimeout((function(){throw t}))};var B=$.Deferred();function U(){b.removeEventListener("DOMContentLoaded",U),n.removeEventListener("load",U),$.ready()}$.fn.ready=function(t){return B.then(t).catch((function(t){$.readyException(t)})),this},$.extend({isReady:!1,readyWait:1,ready:function(t){(!0===t?--$.readyWait:$.isReady)||($.isReady=!0,!0!==t&&--$.readyWait>0||B.resolveWith(b,[$]))}}),$.ready.then=B.then,"complete"===b.readyState||"loading"!==b.readyState&&!b.documentElement.doScroll?n.setTimeout($.ready):(b.addEventListener("DOMContentLoaded",U),n.addEventListener("load",U));var W=function(t,e,n,i,o,s,r){var a=0,l=t.length,c=null==n;if("object"===k(n))for(a in o=!0,n)W(t,e,a,n[a],!0,s,r);else if(void 0!==i&&(o=!0,v(i)||(r=!0),c&&(r?(e.call(t,i),e=null):(c=e,e=function(t,e,n){return c.call($(t),n)})),e))for(;a<l;a++)e(t[a],n,r?i:i.call(t[a],a,e(t[a],n)));return o?t:c?e.call(t):l?e(t[0],n):s},Q=/^-ms-/,V=/-([a-z])/g;function G(t,e){return e.toUpperCase()}function J(t){return t.replace(Q,"ms-").replace(V,G)}var X=function(t){return 1===t.nodeType||9===t.nodeType||!+t.nodeType};function K(){this.expando=$.expando+K.uid++}K.uid=1,K.prototype={cache:function(t){var e=t[this.expando];return e||(e={},X(t)&&(t.nodeType?t[this.expando]=e:Object.defineProperty(t,this.expando,{value:e,configurable:!0}))),e},set:function(t,e,n){var i,o=this.cache(t);if("string"==typeof e)o[J(e)]=n;else for(i in e)o[J(i)]=e[i];return o},get:function(t,e){return void 0===e?this.cache(t):t[this.expando]&&t[this.expando][J(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(J):(e=J(e))in i?[e]:e.match(F)||[]).length;for(;n--;)delete i[e[n]]}(void 0===e||$.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&&!$.isEmptyObject(e)}};var Y=new K,Z=new K,tt=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,et=/[A-Z]/g;function nt(t,e,n){var i;if(void 0===n&&1===t.nodeType)if(i="data-"+e.replace(et,"-$&").toLowerCase(),"string"==typeof(n=t.getAttribute(i))){try{n=function(t){return"true"===t||"false"!==t&&("null"===t?null:t===+t+""?+t:tt.test(t)?JSON.parse(t):t)}(n)}catch(t){}Z.set(t,e,n)}else n=void 0;return n}$.extend({hasData:function(t){return Z.hasData(t)||Y.hasData(t)},data:function(t,e,n){return Z.access(t,e,n)},removeData:function(t,e){Z.remove(t,e)},_data:function(t,e,n){return Y.access(t,e,n)},_removeData:function(t,e){Y.remove(t,e)}}),$.fn.extend({data:function(t,e){var n,i,o,s=this[0],r=s&&s.attributes;if(void 0===t){if(this.length&&(o=Z.get(s),1===s.nodeType&&!Y.get(s,"hasDataAttrs"))){for(n=r.length;n--;)r[n]&&0===(i=r[n].name).indexOf("data-")&&(i=J(i.slice(5)),nt(s,i,o[i]));Y.set(s,"hasDataAttrs",!0)}return o}return"object"==typeof t?this.each((function(){Z.set(this,t)})):W(this,(function(e){var n;if(s&&void 0===e)return void 0!==(n=Z.get(s,t))||void 0!==(n=nt(s,t))?n:void 0;this.each((function(){Z.set(this,t,e)}))}),null,e,arguments.length>1,null,!0)},removeData:function(t){return this.each((function(){Z.remove(this,t)}))}}),$.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,$.makeArray(n)):i.push(n)),i||[]},dequeue:function(t,e){e=e||"fx";var n=$.queue(t,e),i=n.length,o=n.shift(),s=$._queueHooks(t,e);"inprogress"===o&&(o=n.shift(),i--),o&&("fx"===e&&n.unshift("inprogress"),delete s.stop,o.call(t,(function(){$.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:$.Callbacks("once memory").add((function(){Y.remove(t,[e+"queue",n])}))})}}),$.fn.extend({queue:function(t,e){var n=2;return"string"!=typeof t&&(e=t,t="fx",n--),arguments.length<n?$.queue(this[0],t):void 0===e?this:this.each((function(){var n=$.queue(this,t,e);$._queueHooks(this,t),"fx"===t&&"inprogress"!==n[0]&&$.dequeue(this,t)}))},dequeue:function(t){return this.each((function(){$.dequeue(this,t)}))},clearQueue:function(t){return this.queue(t||"fx",[])},promise:function(t,e){var n,i=1,o=$.Deferred(),s=this,r=this.length,a=function(){--i||o.resolveWith(s,[s])};for("string"!=typeof t&&(e=t,t=void 0),t=t||"fx";r--;)(n=Y.get(s[r],t+"queueHooks"))&&n.empty&&(i++,n.empty.add(a));return a(),o.promise(e)}});var it=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,ot=new RegExp("^(?:([+-])=|)("+it+")([a-z%]*)$","i"),st=["Top","Right","Bottom","Left"],rt=b.documentElement,at=function(t){return $.contains(t.ownerDocument,t)},lt={composed:!0};rt.getRootNode&&(at=function(t){return $.contains(t.ownerDocument,t)||t.getRootNode(lt)===t.ownerDocument});var ct=function(t,e){return"none"===(t=e||t).style.display||""===t.style.display&&at(t)&&"none"===$.css(t,"display")};function dt(t,e,n,i){var o,s,r=20,a=i?function(){return i.cur()}:function(){return $.css(t,e,"")},l=a(),c=n&&n[3]||($.cssNumber[e]?"":"px"),d=t.nodeType&&($.cssNumber[e]||"px"!==c&&+l)&&ot.exec($.css(t,e));if(d&&d[3]!==c){for(l/=2,c=c||d[3],d=+l||1;r--;)$.style(t,e,d+c),(1-s)*(1-(s=a()/l||.5))<=0&&(r=0),d/=s;d*=2,$.style(t,e,d+c),n=n||[]}return n&&(d=+d||+l||0,o=n[1]?d+(n[1]+1)*n[2]:+n[2],i&&(i.unit=c,i.start=d,i.end=o)),o}var ut={};function pt(t){var e,n=t.ownerDocument,i=t.nodeName,o=ut[i];return o||(e=n.body.appendChild(n.createElement(i)),o=$.css(e,"display"),e.parentNode.removeChild(e),"none"===o&&(o="block"),ut[i]=o,o)}function ht(t,e){for(var n,i,o=[],s=0,r=t.length;s<r;s++)(i=t[s]).style&&(n=i.style.display,e?("none"===n&&(o[s]=Y.get(i,"display")||null,o[s]||(i.style.display="")),""===i.style.display&&ct(i)&&(o[s]=pt(i))):"none"!==n&&(o[s]="none",Y.set(i,"display",n)));for(s=0;s<r;s++)null!=o[s]&&(t[s].style.display=o[s]);return t}$.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(){ct(this)?$(this).show():$(this).hide()}))}});var ft,mt,gt=/^(?:checkbox|radio)$/i,vt=/<([a-z][^\/\0>\x20\t\r\n\f]*)/i,yt=/^$|^module$|\/(?:java|ecma)script/i;ft=b.createDocumentFragment().appendChild(b.createElement("div")),(mt=b.createElement("input")).setAttribute("type","radio"),mt.setAttribute("checked","checked"),mt.setAttribute("name","t"),ft.appendChild(mt),g.checkClone=ft.cloneNode(!0).cloneNode(!0).lastChild.checked,ft.innerHTML="<textarea>x</textarea>",g.noCloneChecked=!!ft.cloneNode(!0).lastChild.defaultValue,ft.innerHTML="<option></option>",g.option=!!ft.lastChild;var bt={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 wt(t,e){var n;return n=void 0!==t.getElementsByTagName?t.getElementsByTagName(e||"*"):void 0!==t.querySelectorAll?t.querySelectorAll(e||"*"):[],void 0===e||e&&I(t,e)?$.merge([t],n):n}function xt(t,e){for(var n=0,i=t.length;n<i;n++)Y.set(t[n],"globalEval",!e||Y.get(e[n],"globalEval"))}bt.tbody=bt.tfoot=bt.colgroup=bt.caption=bt.thead,bt.th=bt.td,g.option||(bt.optgroup=bt.option=[1,"<select multiple='multiple'>","</select>"]);var kt=/<|&#?\w+;/;function Ct(t,e,n,i,o){for(var s,r,a,l,c,d,u=e.createDocumentFragment(),p=[],h=0,f=t.length;h<f;h++)if((s=t[h])||0===s)if("object"===k(s))$.merge(p,s.nodeType?[s]:s);else if(kt.test(s)){for(r=r||u.appendChild(e.createElement("div")),a=(vt.exec(s)||["",""])[1].toLowerCase(),l=bt[a]||bt._default,r.innerHTML=l[1]+$.htmlPrefilter(s)+l[2],d=l[0];d--;)r=r.lastChild;$.merge(p,r.childNodes),(r=u.firstChild).textContent=""}else p.push(e.createTextNode(s));for(u.textContent="",h=0;s=p[h++];)if(i&&$.inArray(s,i)>-1)o&&o.push(s);else if(c=at(s),r=wt(u.appendChild(s),"script"),c&&xt(r),n)for(d=0;s=r[d++];)yt.test(s.type||"")&&n.push(s);return u}var $t=/^([^.]*)(?:\.(.+)|)/;function St(){return!0}function Tt(){return!1}function _t(t,e){return t===function(){try{return b.activeElement}catch(t){}}()==("focus"===e)}function Et(t,e,n,i,o,s){var r,a;if("object"==typeof e){for(a in"string"!=typeof n&&(i=i||n,n=void 0),e)Et(t,a,n,i,e[a],s);return t}if(null==i&&null==o?(o=n,i=n=void 0):null==o&&("string"==typeof n?(o=i,i=void 0):(o=i,i=n,n=void 0)),!1===o)o=Tt;else if(!o)return t;return 1===s&&(r=o,o=function(t){return $().off(t),r.apply(this,arguments)},o.guid=r.guid||(r.guid=$.guid++)),t.each((function(){$.event.add(this,e,o,i,n)}))}function At(t,e,n){n?(Y.set(t,e,!1),$.event.add(t,e,{namespace:!1,handler:function(t){var i,o,s=Y.get(this,e);if(1&t.isTrigger&&this[e]){if(s.length)($.event.special[e]||{}).delegateType&&t.stopPropagation();else if(s=a.call(arguments),Y.set(this,e,s),i=n(this,e),this[e](),s!==(o=Y.get(this,e))||i?Y.set(this,e,!1):o={},s!==o)return t.stopImmediatePropagation(),t.preventDefault(),o&&o.value}else s.length&&(Y.set(this,e,{value:$.event.trigger($.extend(s[0],$.Event.prototype),s.slice(1),this)}),t.stopImmediatePropagation())}})):void 0===Y.get(t,e)&&$.event.add(t,e,St)}$.event={global:{},add:function(t,e,n,i,o){var s,r,a,l,c,d,u,p,h,f,m,g=Y.get(t);if(X(t))for(n.handler&&(n=(s=n).handler,o=s.selector),o&&$.find.matchesSelector(rt,o),n.guid||(n.guid=$.guid++),(l=g.events)||(l=g.events=Object.create(null)),(r=g.handle)||(r=g.handle=function(e){return void 0!==$&&$.event.triggered!==e.type?$.event.dispatch.apply(t,arguments):void 0}),c=(e=(e||"").match(F)||[""]).length;c--;)h=m=(a=$t.exec(e[c])||[])[1],f=(a[2]||"").split(".").sort(),h&&(u=$.event.special[h]||{},h=(o?u.delegateType:u.bindType)||h,u=$.event.special[h]||{},d=$.extend({type:h,origType:m,data:i,handler:n,guid:n.guid,selector:o,needsContext:o&&$.expr.match.needsContext.test(o),namespace:f.join(".")},s),(p=l[h])||((p=l[h]=[]).delegateCount=0,u.setup&&!1!==u.setup.call(t,i,f,r)||t.addEventListener&&t.addEventListener(h,r)),u.add&&(u.add.call(t,d),d.handler.guid||(d.handler.guid=n.guid)),o?p.splice(p.delegateCount++,0,d):p.push(d),$.event.global[h]=!0)},remove:function(t,e,n,i,o){var s,r,a,l,c,d,u,p,h,f,m,g=Y.hasData(t)&&Y.get(t);if(g&&(l=g.events)){for(c=(e=(e||"").match(F)||[""]).length;c--;)if(h=m=(a=$t.exec(e[c])||[])[1],f=(a[2]||"").split(".").sort(),h){for(u=$.event.special[h]||{},p=l[h=(i?u.delegateType:u.bindType)||h]||[],a=a[2]&&new RegExp("(^|\\.)"+f.join("\\.(?:.*\\.|)")+"(\\.|$)"),r=s=p.length;s--;)d=p[s],!o&&m!==d.origType||n&&n.guid!==d.guid||a&&!a.test(d.namespace)||i&&i!==d.selector&&("**"!==i||!d.selector)||(p.splice(s,1),d.selector&&p.delegateCount--,u.remove&&u.remove.call(t,d));r&&!p.length&&(u.teardown&&!1!==u.teardown.call(t,f,g.handle)||$.removeEvent(t,h,g.handle),delete l[h])}else for(h in l)$.event.remove(t,h+e[c],n,i,!0);$.isEmptyObject(l)&&Y.remove(t,"handle events")}},dispatch:function(t){var e,n,i,o,s,r,a=new Array(arguments.length),l=$.event.fix(t),c=(Y.get(this,"events")||Object.create(null))[l.type]||[],d=$.event.special[l.type]||{};for(a[0]=l,e=1;e<arguments.length;e++)a[e]=arguments[e];if(l.delegateTarget=this,!d.preDispatch||!1!==d.preDispatch.call(this,l)){for(r=$.event.handlers.call(this,l,c),e=0;(o=r[e++])&&!l.isPropagationStopped();)for(l.currentTarget=o.elem,n=0;(s=o.handlers[n++])&&!l.isImmediatePropagationStopped();)l.rnamespace&&!1!==s.namespace&&!l.rnamespace.test(s.namespace)||(l.handleObj=s,l.data=s.data,void 0!==(i=(($.event.special[s.origType]||{}).handle||s.handler).apply(o.elem,a))&&!1===(l.result=i)&&(l.preventDefault(),l.stopPropagation()));return d.postDispatch&&d.postDispatch.call(this,l),l.result}},handlers:function(t,e){var n,i,o,s,r,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=[],r={},n=0;n<l;n++)void 0===r[o=(i=e[n]).selector+" "]&&(r[o]=i.needsContext?$(o,this).index(c)>-1:$.find(o,this,null,[c]).length),r[o]&&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($.Event.prototype,t,{enumerable:!0,configurable:!0,get:v(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[$.expando]?t:new $.Event(t)},special:{load:{noBubble:!0},click:{setup:function(t){var e=this||t;return gt.test(e.type)&&e.click&&I(e,"input")&&At(e,"click",St),!1},trigger:function(t){var e=this||t;return gt.test(e.type)&&e.click&&I(e,"input")&&At(e,"click"),!0},_default:function(t){var e=t.target;return gt.test(e.type)&&e.click&&I(e,"input")&&Y.get(e,"click")||I(e,"a")}},beforeunload:{postDispatch:function(t){void 0!==t.result&&t.originalEvent&&(t.originalEvent.returnValue=t.result)}}}},$.removeEvent=function(t,e,n){t.removeEventListener&&t.removeEventListener(e,n)},$.Event=function(t,e){if(!(this instanceof $.Event))return new $.Event(t,e);t&&t.type?(this.originalEvent=t,this.type=t.type,this.isDefaultPrevented=t.defaultPrevented||void 0===t.defaultPrevented&&!1===t.returnValue?St:Tt,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&&$.extend(this,e),this.timeStamp=t&&t.timeStamp||Date.now(),this[$.expando]=!0},$.Event.prototype={constructor:$.Event,isDefaultPrevented:Tt,isPropagationStopped:Tt,isImmediatePropagationStopped:Tt,isSimulated:!1,preventDefault:function(){var t=this.originalEvent;this.isDefaultPrevented=St,t&&!this.isSimulated&&t.preventDefault()},stopPropagation:function(){var t=this.originalEvent;this.isPropagationStopped=St,t&&!this.isSimulated&&t.stopPropagation()},stopImmediatePropagation:function(){var t=this.originalEvent;this.isImmediatePropagationStopped=St,t&&!this.isSimulated&&t.stopImmediatePropagation(),this.stopPropagation()}},$.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:!0},$.event.addProp),$.each({focus:"focusin",blur:"focusout"},(function(t,e){$.event.special[t]={setup:function(){return At(this,t,_t),!1},trigger:function(){return At(this,t),!0},_default:function(){return!0},delegateType:e}})),$.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},(function(t,e){$.event.special[t]={delegateType:e,bindType:e,handle:function(t){var n,i=t.relatedTarget,o=t.handleObj;return i&&(i===this||$.contains(this,i))||(t.type=o.origType,n=o.handler.apply(this,arguments),t.type=e),n}}})),$.fn.extend({on:function(t,e,n,i){return Et(this,t,e,n,i)},one:function(t,e,n,i){return Et(this,t,e,n,i,1)},off:function(t,e,n){var i,o;if(t&&t.preventDefault&&t.handleObj)return i=t.handleObj,$(t.delegateTarget).off(i.namespace?i.origType+"."+i.namespace:i.origType,i.selector,i.handler),this;if("object"==typeof t){for(o in t)this.off(o,e,t[o]);return this}return!1!==e&&"function"!=typeof e||(n=e,e=void 0),!1===n&&(n=Tt),this.each((function(){$.event.remove(this,t,n,e)}))}});var It=/<script|<style|<link/i,Dt=/checked\s*(?:[^=]|=\s*.checked.)/i,Pt=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;function jt(t,e){return I(t,"table")&&I(11!==e.nodeType?e:e.firstChild,"tr")&&$(t).children("tbody")[0]||t}function Nt(t){return t.type=(null!==t.getAttribute("type"))+"/"+t.type,t}function Ot(t){return"true/"===(t.type||"").slice(0,5)?t.type=t.type.slice(5):t.removeAttribute("type"),t}function Rt(t,e){var n,i,o,s,r,a;if(1===e.nodeType){if(Y.hasData(t)&&(a=Y.get(t).events))for(o in Y.remove(e,"handle events"),a)for(n=0,i=a[o].length;n<i;n++)$.event.add(e,o,a[o][n]);Z.hasData(t)&&(s=Z.access(t),r=$.extend({},s),Z.set(e,r))}}function Lt(t,e){var n=e.nodeName.toLowerCase();"input"===n&&gt.test(t.type)?e.checked=t.checked:"input"!==n&&"textarea"!==n||(e.defaultValue=t.defaultValue)}function Ft(t,e,n,i){e=l(e);var o,s,r,a,c,d,u=0,p=t.length,h=p-1,f=e[0],m=v(f);if(m||p>1&&"string"==typeof f&&!g.checkClone&&Dt.test(f))return t.each((function(o){var s=t.eq(o);m&&(e[0]=f.call(this,o,s.html())),Ft(s,e,n,i)}));if(p&&(s=(o=Ct(e,t[0].ownerDocument,!1,t,i)).firstChild,1===o.childNodes.length&&(o=s),s||i)){for(a=(r=$.map(wt(o,"script"),Nt)).length;u<p;u++)c=o,u!==h&&(c=$.clone(c,!0,!0),a&&$.merge(r,wt(c,"script"))),n.call(t[u],c,u);if(a)for(d=r[r.length-1].ownerDocument,$.map(r,Ot),u=0;u<a;u++)c=r[u],yt.test(c.type||"")&&!Y.access(c,"globalEval")&&$.contains(d,c)&&(c.src&&"module"!==(c.type||"").toLowerCase()?$._evalUrl&&!c.noModule&&$._evalUrl(c.src,{nonce:c.nonce||c.getAttribute("nonce")},d):x(c.textContent.replace(Pt,""),c,d))}return t}function qt(t,e,n){for(var i,o=e?$.filter(e,t):t,s=0;null!=(i=o[s]);s++)n||1!==i.nodeType||$.cleanData(wt(i)),i.parentNode&&(n&&at(i)&&xt(wt(i,"script")),i.parentNode.removeChild(i));return t}$.extend({htmlPrefilter:function(t){return t},clone:function(t,e,n){var i,o,s,r,a=t.cloneNode(!0),l=at(t);if(!(g.noCloneChecked||1!==t.nodeType&&11!==t.nodeType||$.isXMLDoc(t)))for(r=wt(a),i=0,o=(s=wt(t)).length;i<o;i++)Lt(s[i],r[i]);if(e)if(n)for(s=s||wt(t),r=r||wt(a),i=0,o=s.length;i<o;i++)Rt(s[i],r[i]);else Rt(t,a);return(r=wt(a,"script")).length>0&&xt(r,!l&&wt(t,"script")),a},cleanData:function(t){for(var e,n,i,o=$.event.special,s=0;void 0!==(n=t[s]);s++)if(X(n)){if(e=n[Y.expando]){if(e.events)for(i in e.events)o[i]?$.event.remove(n,i):$.removeEvent(n,i,e.handle);n[Y.expando]=void 0}n[Z.expando]&&(n[Z.expando]=void 0)}}}),$.fn.extend({detach:function(t){return qt(this,t,!0)},remove:function(t){return qt(this,t)},text:function(t){return W(this,(function(t){return void 0===t?$.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 Ft(this,arguments,(function(t){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||jt(this,t).appendChild(t)}))},prepend:function(){return Ft(this,arguments,(function(t){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var e=jt(this,t);e.insertBefore(t,e.firstChild)}}))},before:function(){return Ft(this,arguments,(function(t){this.parentNode&&this.parentNode.insertBefore(t,this)}))},after:function(){return Ft(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&&($.cleanData(wt(t,!1)),t.textContent="");return this},clone:function(t,e){return t=null!=t&&t,e=null==e?t:e,this.map((function(){return $.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&&!It.test(t)&&!bt[(vt.exec(t)||["",""])[1].toLowerCase()]){t=$.htmlPrefilter(t);try{for(;n<i;n++)1===(e=this[n]||{}).nodeType&&($.cleanData(wt(e,!1)),e.innerHTML=t);e=0}catch(t){}}e&&this.empty().append(t)}),null,t,arguments.length)},replaceWith:function(){var t=[];return Ft(this,arguments,(function(e){var n=this.parentNode;$.inArray(this,t)<0&&($.cleanData(wt(this)),n&&n.replaceChild(e,this))}),t)}}),$.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},(function(t,e){$.fn[t]=function(t){for(var n,i=[],o=$(t),s=o.length-1,r=0;r<=s;r++)n=r===s?this:this.clone(!0),$(o[r])[e](n),c.apply(i,n.get());return this.pushStack(i)}}));var zt=new RegExp("^("+it+")(?!px)[a-z%]+$","i"),Mt=function(t){var e=t.ownerDocument.defaultView;return e&&e.opener||(e=n),e.getComputedStyle(t)},Ht=function(t,e,n){var i,o,s={};for(o in e)s[o]=t.style[o],t.style[o]=e[o];for(o in i=n.call(t),e)t.style[o]=s[o];return i},Bt=new RegExp(st.join("|"),"i");function Ut(t,e,n){var i,o,s,r,a=t.style;return(n=n||Mt(t))&&(""!==(r=n.getPropertyValue(e)||n[e])||at(t)||(r=$.style(t,e)),!g.pixelBoxStyles()&&zt.test(r)&&Bt.test(e)&&(i=a.width,o=a.minWidth,s=a.maxWidth,a.minWidth=a.maxWidth=a.width=r,r=n.width,a.width=i,a.minWidth=o,a.maxWidth=s)),void 0!==r?r+"":r}function Wt(t,e){return{get:function(){if(!t())return(this.get=e).apply(this,arguments);delete this.get}}}!function(){function t(){if(d){c.style.cssText="position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0",d.style.cssText="position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%",rt.appendChild(c).appendChild(d);var t=n.getComputedStyle(d);i="1%"!==t.top,l=12===e(t.marginLeft),d.style.right="60%",r=36===e(t.right),o=36===e(t.width),d.style.position="absolute",s=12===e(d.offsetWidth/3),rt.removeChild(c),d=null}}function e(t){return Math.round(parseFloat(t))}var i,o,s,r,a,l,c=b.createElement("div"),d=b.createElement("div");d.style&&(d.style.backgroundClip="content-box",d.cloneNode(!0).style.backgroundClip="",g.clearCloneStyle="content-box"===d.style.backgroundClip,$.extend(g,{boxSizingReliable:function(){return t(),o},pixelBoxStyles:function(){return t(),r},pixelPosition:function(){return t(),i},reliableMarginLeft:function(){return t(),l},scrollboxSize:function(){return t(),s},reliableTrDimensions:function(){var t,e,i,o;return null==a&&(t=b.createElement("table"),e=b.createElement("tr"),i=b.createElement("div"),t.style.cssText="position:absolute;left:-11111px;border-collapse:separate",e.style.cssText="border:1px solid",e.style.height="1px",i.style.height="9px",i.style.display="block",rt.appendChild(t).appendChild(e).appendChild(i),o=n.getComputedStyle(e),a=parseInt(o.height,10)+parseInt(o.borderTopWidth,10)+parseInt(o.borderBottomWidth,10)===e.offsetHeight,rt.removeChild(t)),a}}))}();var Qt=["Webkit","Moz","ms"],Vt=b.createElement("div").style,Gt={};function Jt(t){var e=$.cssProps[t]||Gt[t];return e||(t in Vt?t:Gt[t]=function(t){for(var e=t[0].toUpperCase()+t.slice(1),n=Qt.length;n--;)if((t=Qt[n]+e)in Vt)return t}(t)||t)}var Xt=/^(none|table(?!-c[ea]).+)/,Kt=/^--/,Yt={position:"absolute",visibility:"hidden",display:"block"},Zt={letterSpacing:"0",fontWeight:"400"};function te(t,e,n){var i=ot.exec(e);return i?Math.max(0,i[2]-(n||0))+(i[3]||"px"):e}function ee(t,e,n,i,o,s){var r="width"===e?1:0,a=0,l=0;if(n===(i?"border":"content"))return 0;for(;r<4;r+=2)"margin"===n&&(l+=$.css(t,n+st[r],!0,o)),i?("content"===n&&(l-=$.css(t,"padding"+st[r],!0,o)),"margin"!==n&&(l-=$.css(t,"border"+st[r]+"Width",!0,o))):(l+=$.css(t,"padding"+st[r],!0,o),"padding"!==n?l+=$.css(t,"border"+st[r]+"Width",!0,o):a+=$.css(t,"border"+st[r]+"Width",!0,o));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 ne(t,e,n){var i=Mt(t),o=(!g.boxSizingReliable()||n)&&"border-box"===$.css(t,"boxSizing",!1,i),s=o,r=Ut(t,e,i),a="offset"+e[0].toUpperCase()+e.slice(1);if(zt.test(r)){if(!n)return r;r="auto"}return(!g.boxSizingReliable()&&o||!g.reliableTrDimensions()&&I(t,"tr")||"auto"===r||!parseFloat(r)&&"inline"===$.css(t,"display",!1,i))&&t.getClientRects().length&&(o="border-box"===$.css(t,"boxSizing",!1,i),(s=a in t)&&(r=t[a])),(r=parseFloat(r)||0)+ee(t,e,n||(o?"border":"content"),s,i,r)+"px"}function ie(t,e,n,i,o){return new ie.prototype.init(t,e,n,i,o)}$.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 o,s,r,a=J(e),l=Kt.test(e),c=t.style;if(l||(e=Jt(a)),r=$.cssHooks[e]||$.cssHooks[a],void 0===n)return r&&"get"in r&&void 0!==(o=r.get(t,!1,i))?o:c[e];"string"===(s=typeof n)&&(o=ot.exec(n))&&o[1]&&(n=dt(t,e,o),s="number"),null!=n&&n==n&&("number"!==s||l||(n+=o&&o[3]||($.cssNumber[a]?"":"px")),g.clearCloneStyle||""!==n||0!==e.indexOf("background")||(c[e]="inherit"),r&&"set"in r&&void 0===(n=r.set(t,n,i))||(l?c.setProperty(e,n):c[e]=n))}},css:function(t,e,n,i){var o,s,r,a=J(e);return Kt.test(e)||(e=Jt(a)),(r=$.cssHooks[e]||$.cssHooks[a])&&"get"in r&&(o=r.get(t,!0,n)),void 0===o&&(o=Ut(t,e,i)),"normal"===o&&e in Zt&&(o=Zt[e]),""===n||n?(s=parseFloat(o),!0===n||isFinite(s)?s||0:o):o}}),$.each(["height","width"],(function(t,e){$.cssHooks[e]={get:function(t,n,i){if(n)return!Xt.test($.css(t,"display"))||t.getClientRects().length&&t.getBoundingClientRect().width?ne(t,e,i):Ht(t,Yt,(function(){return ne(t,e,i)}))},set:function(t,n,i){var o,s=Mt(t),r=!g.scrollboxSize()&&"absolute"===s.position,a=(r||i)&&"border-box"===$.css(t,"boxSizing",!1,s),l=i?ee(t,e,i,a,s):0;return a&&r&&(l-=Math.ceil(t["offset"+e[0].toUpperCase()+e.slice(1)]-parseFloat(s[e])-ee(t,e,"border",!1,s)-.5)),l&&(o=ot.exec(n))&&"px"!==(o[3]||"px")&&(t.style[e]=n,n=$.css(t,e)),te(0,n,l)}}})),$.cssHooks.marginLeft=Wt(g.reliableMarginLeft,(function(t,e){if(e)return(parseFloat(Ut(t,"marginLeft"))||t.getBoundingClientRect().left-Ht(t,{marginLeft:0},(function(){return t.getBoundingClientRect().left})))+"px"})),$.each({margin:"",padding:"",border:"Width"},(function(t,e){$.cssHooks[t+e]={expand:function(n){for(var i=0,o={},s="string"==typeof n?n.split(" "):[n];i<4;i++)o[t+st[i]+e]=s[i]||s[i-2]||s[0];return o}},"margin"!==t&&($.cssHooks[t+e].set=te)})),$.fn.extend({css:function(t,e){return W(this,(function(t,e,n){var i,o,s={},r=0;if(Array.isArray(e)){for(i=Mt(t),o=e.length;r<o;r++)s[e[r]]=$.css(t,e[r],!1,i);return s}return void 0!==n?$.style(t,e,n):$.css(t,e)}),t,e,arguments.length>1)}}),$.Tween=ie,ie.prototype={constructor:ie,init:function(t,e,n,i,o,s){this.elem=t,this.prop=n,this.easing=o||$.easing._default,this.options=e,this.start=this.now=this.cur(),this.end=i,this.unit=s||($.cssNumber[n]?"":"px")},cur:function(){var t=ie.propHooks[this.prop];return t&&t.get?t.get(this):ie.propHooks._default.get(this)},run:function(t){var e,n=ie.propHooks[this.prop];return this.options.duration?this.pos=e=$.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):ie.propHooks._default.set(this),this}},ie.prototype.init.prototype=ie.prototype,ie.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=$.css(t.elem,t.prop,""))&&"auto"!==e?e:0},set:function(t){$.fx.step[t.prop]?$.fx.step[t.prop](t):1!==t.elem.nodeType||!$.cssHooks[t.prop]&&null==t.elem.style[Jt(t.prop)]?t.elem[t.prop]=t.now:$.style(t.elem,t.prop,t.now+t.unit)}}},ie.propHooks.scrollTop=ie.propHooks.scrollLeft={set:function(t){t.elem.nodeType&&t.elem.parentNode&&(t.elem[t.prop]=t.now)}},$.easing={linear:function(t){return t},swing:function(t){return.5-Math.cos(t*Math.PI)/2},_default:"swing"},$.fx=ie.prototype.init,$.fx.step={};var oe,se,re=/^(?:toggle|show|hide)$/,ae=/queueHooks$/;function le(){se&&(!1===b.hidden&&n.requestAnimationFrame?n.requestAnimationFrame(le):n.setTimeout(le,$.fx.interval),$.fx.tick())}function ce(){return n.setTimeout((function(){oe=void 0})),oe=Date.now()}function de(t,e){var n,i=0,o={height:t};for(e=e?1:0;i<4;i+=2-e)o["margin"+(n=st[i])]=o["padding"+n]=t;return e&&(o.opacity=o.width=t),o}function ue(t,e,n){for(var i,o=(pe.tweeners[e]||[]).concat(pe.tweeners["*"]),s=0,r=o.length;s<r;s++)if(i=o[s].call(n,e,t))return i}function pe(t,e,n){var i,o,s=0,r=pe.prefilters.length,a=$.Deferred().always((function(){delete l.elem})),l=function(){if(o)return!1;for(var e=oe||ce(),n=Math.max(0,c.startTime+c.duration-e),i=1-(n/c.duration||0),s=0,r=c.tweens.length;s<r;s++)c.tweens[s].run(i);return a.notifyWith(t,[c,i,n]),i<1&&r?n:(r||a.notifyWith(t,[c,1,0]),a.resolveWith(t,[c]),!1)},c=a.promise({elem:t,props:$.extend({},e),opts:$.extend(!0,{specialEasing:{},easing:$.easing._default},n),originalProperties:e,originalOptions:n,startTime:oe||ce(),duration:n.duration,tweens:[],createTween:function(e,n){var i=$.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(o)return this;for(o=!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}}),d=c.props;for(!function(t,e){var n,i,o,s,r;for(n in t)if(o=e[i=J(n)],s=t[n],Array.isArray(s)&&(o=s[1],s=t[n]=s[0]),n!==i&&(t[i]=s,delete t[n]),(r=$.cssHooks[i])&&"expand"in r)for(n in s=r.expand(s),delete t[i],s)n in t||(t[n]=s[n],e[n]=o);else e[i]=o}(d,c.opts.specialEasing);s<r;s++)if(i=pe.prefilters[s].call(c,t,d,c.opts))return v(i.stop)&&($._queueHooks(c.elem,c.opts.queue).stop=i.stop.bind(i)),i;return $.map(d,ue,c),v(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),$.fx.timer($.extend(l,{elem:t,anim:c,queue:c.opts.queue})),c}$.Animation=$.extend(pe,{tweeners:{"*":[function(t,e){var n=this.createTween(t,e);return dt(n.elem,t,ot.exec(e),n),n}]},tweener:function(t,e){v(t)?(e=t,t=["*"]):t=t.match(F);for(var n,i=0,o=t.length;i<o;i++)n=t[i],pe.tweeners[n]=pe.tweeners[n]||[],pe.tweeners[n].unshift(e)},prefilters:[function(t,e,n){var i,o,s,r,a,l,c,d,u="width"in e||"height"in e,p=this,h={},f=t.style,m=t.nodeType&&ct(t),g=Y.get(t,"fxshow");for(i in n.queue||(null==(r=$._queueHooks(t,"fx")).unqueued&&(r.unqueued=0,a=r.empty.fire,r.empty.fire=function(){r.unqueued||a()}),r.unqueued++,p.always((function(){p.always((function(){r.unqueued--,$.queue(t,"fx").length||r.empty.fire()}))}))),e)if(o=e[i],re.test(o)){if(delete e[i],s=s||"toggle"===o,o===(m?"hide":"show")){if("show"!==o||!g||void 0===g[i])continue;m=!0}h[i]=g&&g[i]||$.style(t,i)}if((l=!$.isEmptyObject(e))||!$.isEmptyObject(h))for(i in u&&1===t.nodeType&&(n.overflow=[f.overflow,f.overflowX,f.overflowY],null==(c=g&&g.display)&&(c=Y.get(t,"display")),"none"===(d=$.css(t,"display"))&&(c?d=c:(ht([t],!0),c=t.style.display||c,d=$.css(t,"display"),ht([t]))),("inline"===d||"inline-block"===d&&null!=c)&&"none"===$.css(t,"float")&&(l||(p.done((function(){f.display=c})),null==c&&(d=f.display,c="none"===d?"":d)),f.display="inline-block")),n.overflow&&(f.overflow="hidden",p.always((function(){f.overflow=n.overflow[0],f.overflowX=n.overflow[1],f.overflowY=n.overflow[2]}))),l=!1,h)l||(g?"hidden"in g&&(m=g.hidden):g=Y.access(t,"fxshow",{display:c}),s&&(g.hidden=!m),m&&ht([t],!0),p.done((function(){for(i in m||ht([t]),Y.remove(t,"fxshow"),h)$.style(t,i,h[i])}))),l=ue(m?g[i]:0,i,p),i in g||(g[i]=l.start,m&&(l.end=l.start,l.start=0))}],prefilter:function(t,e){e?pe.prefilters.unshift(t):pe.prefilters.push(t)}}),$.speed=function(t,e,n){var i=t&&"object"==typeof t?$.extend({},t):{complete:n||!n&&e||v(t)&&t,duration:t,easing:n&&e||e&&!v(e)&&e};return $.fx.off?i.duration=0:"number"!=typeof i.duration&&(i.duration in $.fx.speeds?i.duration=$.fx.speeds[i.duration]:i.duration=$.fx.speeds._default),null!=i.queue&&!0!==i.queue||(i.queue="fx"),i.old=i.complete,i.complete=function(){v(i.old)&&i.old.call(this),i.queue&&$.dequeue(this,i.queue)},i},$.fn.extend({fadeTo:function(t,e,n,i){return this.filter(ct).css("opacity",0).show().end().animate({opacity:e},t,n,i)},animate:function(t,e,n,i){var o=$.isEmptyObject(t),s=$.speed(e,n,i),r=function(){var e=pe(this,$.extend({},t),s);(o||Y.get(this,"finish"))&&e.stop(!0)};return r.finish=r,o||!1===s.queue?this.each(r):this.queue(s.queue,r)},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,o=null!=t&&t+"queueHooks",s=$.timers,r=Y.get(this);if(o)r[o]&&r[o].stop&&i(r[o]);else for(o in r)r[o]&&r[o].stop&&ae.test(o)&&i(r[o]);for(o=s.length;o--;)s[o].elem!==this||null!=t&&s[o].queue!==t||(s[o].anim.stop(n),e=!1,s.splice(o,1));!e&&n||$.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"],o=n[t+"queueHooks"],s=$.timers,r=i?i.length:0;for(n.finish=!0,$.queue(this,t,[]),o&&o.stop&&o.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<r;e++)i[e]&&i[e].finish&&i[e].finish.call(this);delete n.finish}))}}),$.each(["toggle","show","hide"],(function(t,e){var n=$.fn[e];$.fn[e]=function(t,i,o){return null==t||"boolean"==typeof t?n.apply(this,arguments):this.animate(de(e,!0),t,i,o)}})),$.each({slideDown:de("show"),slideUp:de("hide"),slideToggle:de("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},(function(t,e){$.fn[t]=function(t,n,i){return this.animate(e,t,n,i)}})),$.timers=[],$.fx.tick=function(){var t,e=0,n=$.timers;for(oe=Date.now();e<n.length;e++)(t=n[e])()||n[e]!==t||n.splice(e--,1);n.length||$.fx.stop(),oe=void 0},$.fx.timer=function(t){$.timers.push(t),$.fx.start()},$.fx.interval=13,$.fx.start=function(){se||(se=!0,le())},$.fx.stop=function(){se=null},$.fx.speeds={slow:600,fast:200,_default:400},$.fn.delay=function(t,e){return t=$.fx&&$.fx.speeds[t]||t,e=e||"fx",this.queue(e,(function(e,i){var o=n.setTimeout(e,t);i.stop=function(){n.clearTimeout(o)}}))},function(){var t=b.createElement("input"),e=b.createElement("select").appendChild(b.createElement("option"));t.type="checkbox",g.checkOn=""!==t.value,g.optSelected=e.selected,(t=b.createElement("input")).value="t",t.type="radio",g.radioValue="t"===t.value}();var he,fe=$.expr.attrHandle;$.fn.extend({attr:function(t,e){return W(this,$.attr,t,e,arguments.length>1)},removeAttr:function(t){return this.each((function(){$.removeAttr(this,t)}))}}),$.extend({attr:function(t,e,n){var i,o,s=t.nodeType;if(3!==s&&8!==s&&2!==s)return void 0===t.getAttribute?$.prop(t,e,n):(1===s&&$.isXMLDoc(t)||(o=$.attrHooks[e.toLowerCase()]||($.expr.match.bool.test(e)?he:void 0)),void 0!==n?null===n?void $.removeAttr(t,e):o&&"set"in o&&void 0!==(i=o.set(t,n,e))?i:(t.setAttribute(e,n+""),n):o&&"get"in o&&null!==(i=o.get(t,e))?i:null==(i=$.find.attr(t,e))?void 0:i)},attrHooks:{type:{set:function(t,e){if(!g.radioValue&&"radio"===e&&I(t,"input")){var n=t.value;return t.setAttribute("type",e),n&&(t.value=n),e}}}},removeAttr:function(t,e){var n,i=0,o=e&&e.match(F);if(o&&1===t.nodeType)for(;n=o[i++];)t.removeAttribute(n)}}),he={set:function(t,e,n){return!1===e?$.removeAttr(t,n):t.setAttribute(n,n),n}},$.each($.expr.match.bool.source.match(/\w+/g),(function(t,e){var n=fe[e]||$.find.attr;fe[e]=function(t,e,i){var o,s,r=e.toLowerCase();return i||(s=fe[r],fe[r]=o,o=null!=n(t,e,i)?r:null,fe[r]=s),o}}));var me=/^(?:input|select|textarea|button)$/i,ge=/^(?:a|area)$/i;function ve(t){return(t.match(F)||[]).join(" ")}function ye(t){return t.getAttribute&&t.getAttribute("class")||""}function be(t){return Array.isArray(t)?t:"string"==typeof t&&t.match(F)||[]}$.fn.extend({prop:function(t,e){return W(this,$.prop,t,e,arguments.length>1)},removeProp:function(t){return this.each((function(){delete this[$.propFix[t]||t]}))}}),$.extend({prop:function(t,e,n){var i,o,s=t.nodeType;if(3!==s&&8!==s&&2!==s)return 1===s&&$.isXMLDoc(t)||(e=$.propFix[e]||e,o=$.propHooks[e]),void 0!==n?o&&"set"in o&&void 0!==(i=o.set(t,n,e))?i:t[e]=n:o&&"get"in o&&null!==(i=o.get(t,e))?i:t[e]},propHooks:{tabIndex:{get:function(t){var e=$.find.attr(t,"tabindex");return e?parseInt(e,10):me.test(t.nodeName)||ge.test(t.nodeName)&&t.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),g.optSelected||($.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)}}),$.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],(function(){$.propFix[this.toLowerCase()]=this})),$.fn.extend({addClass:function(t){var e,n,i,o,s,r,a,l=0;if(v(t))return this.each((function(e){$(this).addClass(t.call(this,e,ye(this)))}));if((e=be(t)).length)for(;n=this[l++];)if(o=ye(n),i=1===n.nodeType&&" "+ve(o)+" "){for(r=0;s=e[r++];)i.indexOf(" "+s+" ")<0&&(i+=s+" ");o!==(a=ve(i))&&n.setAttribute("class",a)}return this},removeClass:function(t){var e,n,i,o,s,r,a,l=0;if(v(t))return this.each((function(e){$(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(o=ye(n),i=1===n.nodeType&&" "+ve(o)+" "){for(r=0;s=e[r++];)for(;i.indexOf(" "+s+" ")>-1;)i=i.replace(" "+s+" "," ");o!==(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):v(t)?this.each((function(n){$(this).toggleClass(t.call(this,n,ye(this),e),e)})):this.each((function(){var e,o,s,r;if(i)for(o=0,s=$(this),r=be(t);e=r[o++];)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;$.fn.extend({val:function(t){var e,n,i,o=this[0];return arguments.length?(i=v(t),this.each((function(n){var o;1===this.nodeType&&(null==(o=i?t.call(this,n,$(this).val()):t)?o="":"number"==typeof o?o+="":Array.isArray(o)&&(o=$.map(o,(function(t){return null==t?"":t+""}))),(e=$.valHooks[this.type]||$.valHooks[this.nodeName.toLowerCase()])&&"set"in e&&void 0!==e.set(this,o,"value")||(this.value=o))}))):o?(e=$.valHooks[o.type]||$.valHooks[o.nodeName.toLowerCase()])&&"get"in e&&void 0!==(n=e.get(o,"value"))?n:"string"==typeof(n=o.value)?n.replace(we,""):null==n?"":n:void 0}}),$.extend({valHooks:{option:{get:function(t){var e=$.find.attr(t,"value");return null!=e?e:ve($.text(t))}},select:{get:function(t){var e,n,i,o=t.options,s=t.selectedIndex,r="select-one"===t.type,a=r?null:[],l=r?s+1:o.length;for(i=s<0?l:r?s:0;i<l;i++)if(((n=o[i]).selected||i===s)&&!n.disabled&&(!n.parentNode.disabled||!I(n.parentNode,"optgroup"))){if(e=$(n).val(),r)return e;a.push(e)}return a},set:function(t,e){for(var n,i,o=t.options,s=$.makeArray(e),r=o.length;r--;)((i=o[r]).selected=$.inArray($.valHooks.option.get(i),s)>-1)&&(n=!0);return n||(t.selectedIndex=-1),s}}}}),$.each(["radio","checkbox"],(function(){$.valHooks[this]={set:function(t,e){if(Array.isArray(e))return t.checked=$.inArray($(t).val(),e)>-1}},g.checkOn||($.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()};$.extend($.event,{trigger:function(t,e,i,o){var s,r,a,l,c,d,u,p,f=[i||b],m=h.call(t,"type")?t.type:t,g=h.call(t,"namespace")?t.namespace.split("."):[];if(r=p=a=i=i||b,3!==i.nodeType&&8!==i.nodeType&&!xe.test(m+$.event.triggered)&&(m.indexOf(".")>-1&&(g=m.split("."),m=g.shift(),g.sort()),c=m.indexOf(":")<0&&"on"+m,(t=t[$.expando]?t:new $.Event(m,"object"==typeof t&&t)).isTrigger=o?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]:$.makeArray(e,[t]),u=$.event.special[m]||{},o||!u.trigger||!1!==u.trigger.apply(i,e))){if(!o&&!u.noBubble&&!y(i)){for(l=u.delegateType||m,xe.test(l+m)||(r=r.parentNode);r;r=r.parentNode)f.push(r),a=r;a===(i.ownerDocument||b)&&f.push(a.defaultView||a.parentWindow||n)}for(s=0;(r=f[s++])&&!t.isPropagationStopped();)p=r,t.type=s>1?l:u.bindType||m,(d=(Y.get(r,"events")||Object.create(null))[t.type]&&Y.get(r,"handle"))&&d.apply(r,e),(d=c&&r[c])&&d.apply&&X(r)&&(t.result=d.apply(r,e),!1===t.result&&t.preventDefault());return t.type=m,o||t.isDefaultPrevented()||u._default&&!1!==u._default.apply(f.pop(),e)||!X(i)||c&&v(i[m])&&!y(i)&&((a=i[c])&&(i[c]=null),$.event.triggered=m,t.isPropagationStopped()&&p.addEventListener(m,ke),i[m](),t.isPropagationStopped()&&p.removeEventListener(m,ke),$.event.triggered=void 0,a&&(i[c]=a)),t.result}},simulate:function(t,e,n){var i=$.extend(new $.Event,n,{type:t,isSimulated:!0});$.event.trigger(i,null,e)}}),$.fn.extend({trigger:function(t,e){return this.each((function(){$.event.trigger(t,e,this)}))},triggerHandler:function(t,e){var n=this[0];if(n)return $.event.trigger(t,e,n,!0)}}),g.focusin||$.each({focus:"focusin",blur:"focusout"},(function(t,e){var n=function(t){$.event.simulate(e,t.target,$.event.fix(t))};$.event.special[e]={setup:function(){var i=this.ownerDocument||this.document||this,o=Y.access(i,e);o||i.addEventListener(t,n,!0),Y.access(i,e,(o||0)+1)},teardown:function(){var i=this.ownerDocument||this.document||this,o=Y.access(i,e)-1;o?Y.access(i,e,o):(i.removeEventListener(t,n,!0),Y.remove(i,e))}}}));var Ce=n.location,$e={guid:Date.now()},Se=/\?/;$.parseXML=function(t){var e,i;if(!t||"string"!=typeof t)return null;try{e=(new n.DOMParser).parseFromString(t,"text/xml")}catch(t){}return i=e&&e.getElementsByTagName("parsererror")[0],e&&!i||$.error("Invalid XML: "+(i?$.map(i.childNodes,(function(t){return t.textContent})).join("\n"):t)),e};var Te=/\[\]$/,_e=/\r?\n/g,Ee=/^(?:submit|button|image|reset|file)$/i,Ae=/^(?:input|select|textarea|keygen)/i;function Ie(t,e,n,i){var o;if(Array.isArray(e))$.each(e,(function(e,o){n||Te.test(t)?i(t,o):Ie(t+"["+("object"==typeof o&&null!=o?e:"")+"]",o,n,i)}));else if(n||"object"!==k(e))i(t,e);else for(o in e)Ie(t+"["+o+"]",e[o],n,i)}$.param=function(t,e){var n,i=[],o=function(t,e){var n=v(e)?e():e;i[i.length]=encodeURIComponent(t)+"="+encodeURIComponent(null==n?"":n)};if(null==t)return"";if(Array.isArray(t)||t.jquery&&!$.isPlainObject(t))$.each(t,(function(){o(this.name,this.value)}));else for(n in t)Ie(n,t[n],e,o);return i.join("&")},$.fn.extend({serialize:function(){return $.param(this.serializeArray())},serializeArray:function(){return this.map((function(){var t=$.prop(this,"elements");return t?$.makeArray(t):this})).filter((function(){var t=this.type;return this.name&&!$(this).is(":disabled")&&Ae.test(this.nodeName)&&!Ee.test(t)&&(this.checked||!gt.test(t))})).map((function(t,e){var n=$(this).val();return null==n?null:Array.isArray(n)?$.map(n,(function(t){return{name:e.name,value:t.replace(_e,"\r\n")}})):{name:e.name,value:n.replace(_e,"\r\n")}})).get()}});var De=/%20/g,Pe=/#.*$/,je=/([?&])_=[^&]*/,Ne=/^(.*?):[ \t]*([^\r\n]*)$/gm,Oe=/^(?:GET|HEAD)$/,Re=/^\/\//,Le={},Fe={},qe="*/".concat("*"),ze=b.createElement("a");function Me(t){return function(e,n){"string"!=typeof e&&(n=e,e="*");var i,o=0,s=e.toLowerCase().match(F)||[];if(v(n))for(;i=s[o++];)"+"===i[0]?(i=i.slice(1)||"*",(t[i]=t[i]||[]).unshift(n)):(t[i]=t[i]||[]).push(n)}}function He(t,e,n,i){var o={},s=t===Fe;function r(a){var l;return o[a]=!0,$.each(t[a]||[],(function(t,a){var c=a(e,n,i);return"string"!=typeof c||s||o[c]?s?!(l=c):void 0:(e.dataTypes.unshift(c),r(c),!1)})),l}return r(e.dataTypes[0])||!o["*"]&&r("*")}function Be(t,e){var n,i,o=$.ajaxSettings.flatOptions||{};for(n in e)void 0!==e[n]&&((o[n]?t:i||(i={}))[n]=e[n]);return i&&$.extend(!0,t,i),t}ze.href=Ce.href,$.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Ce.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(Ce.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":qe,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":$.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(t,e){return e?Be(Be(t,$.ajaxSettings),e):Be($.ajaxSettings,t)},ajaxPrefilter:Me(Le),ajaxTransport:Me(Fe),ajax:function(t,e){"object"==typeof t&&(e=t,t=void 0),e=e||{};var i,o,s,r,a,l,c,d,u,p,h=$.ajaxSetup({},e),f=h.context||h,m=h.context&&(f.nodeType||f.jquery)?$(f):$.event,g=$.Deferred(),v=$.Callbacks("once memory"),y=h.statusCode||{},w={},x={},k="canceled",C={readyState:0,getResponseHeader:function(t){var e;if(c){if(!r)for(r={};e=Ne.exec(s);)r[e[1].toLowerCase()+" "]=(r[e[1].toLowerCase()+" "]||[]).concat(e[2]);e=r[t.toLowerCase()+" "]}return null==e?null:e.join(", ")},getAllResponseHeaders:function(){return c?s:null},setRequestHeader:function(t,e){return null==c&&(t=x[t.toLowerCase()]=x[t.toLowerCase()]||t,w[t]=e),this},overrideMimeType:function(t){return null==c&&(h.mimeType=t),this},statusCode:function(t){var e;if(t)if(c)C.always(t[C.status]);else for(e in t)y[e]=[y[e],t[e]];return this},abort:function(t){var e=t||k;return i&&i.abort(e),S(0,e),this}};if(g.promise(C),h.url=((t||h.url||Ce.href)+"").replace(Re,Ce.protocol+"//"),h.type=e.method||e.type||h.method||h.type,h.dataTypes=(h.dataType||"*").toLowerCase().match(F)||[""],null==h.crossDomain){l=b.createElement("a");try{l.href=h.url,l.href=l.href,h.crossDomain=ze.protocol+"//"+ze.host!=l.protocol+"//"+l.host}catch(t){h.crossDomain=!0}}if(h.data&&h.processData&&"string"!=typeof h.data&&(h.data=$.param(h.data,h.traditional)),He(Le,h,e,C),c)return C;for(u in(d=$.event&&h.global)&&0==$.active++&&$.event.trigger("ajaxStart"),h.type=h.type.toUpperCase(),h.hasContent=!Oe.test(h.type),o=h.url.replace(Pe,""),h.hasContent?h.data&&h.processData&&0===(h.contentType||"").indexOf("application/x-www-form-urlencoded")&&(h.data=h.data.replace(De,"+")):(p=h.url.slice(o.length),h.data&&(h.processData||"string"==typeof h.data)&&(o+=(Se.test(o)?"&":"?")+h.data,delete h.data),!1===h.cache&&(o=o.replace(je,"$1"),p=(Se.test(o)?"&":"?")+"_="+$e.guid+++p),h.url=o+p),h.ifModified&&($.lastModified[o]&&C.setRequestHeader("If-Modified-Since",$.lastModified[o]),$.etag[o]&&C.setRequestHeader("If-None-Match",$.etag[o])),(h.data&&h.hasContent&&!1!==h.contentType||e.contentType)&&C.setRequestHeader("Content-Type",h.contentType),C.setRequestHeader("Accept",h.dataTypes[0]&&h.accepts[h.dataTypes[0]]?h.accepts[h.dataTypes[0]]+("*"!==h.dataTypes[0]?", "+qe+"; q=0.01":""):h.accepts["*"]),h.headers)C.setRequestHeader(u,h.headers[u]);if(h.beforeSend&&(!1===h.beforeSend.call(f,C,h)||c))return C.abort();if(k="abort",v.add(h.complete),C.done(h.success),C.fail(h.error),i=He(Fe,h,e,C)){if(C.readyState=1,d&&m.trigger("ajaxSend",[C,h]),c)return C;h.async&&h.timeout>0&&(a=n.setTimeout((function(){C.abort("timeout")}),h.timeout));try{c=!1,i.send(w,S)}catch(t){if(c)throw t;S(-1,t)}}else S(-1,"No Transport");function S(t,e,r,l){var u,p,b,w,x,k=e;c||(c=!0,a&&n.clearTimeout(a),i=void 0,s=l||"",C.readyState=t>0?4:0,u=t>=200&&t<300||304===t,r&&(w=function(t,e,n){for(var i,o,s,r,a=t.contents,l=t.dataTypes;"*"===l[0];)l.shift(),void 0===i&&(i=t.mimeType||e.getResponseHeader("Content-Type"));if(i)for(o in a)if(a[o]&&a[o].test(i)){l.unshift(o);break}if(l[0]in n)s=l[0];else{for(o in n){if(!l[0]||t.converters[o+" "+l[0]]){s=o;break}r||(r=o)}s=s||r}if(s)return s!==l[0]&&l.unshift(s),n[s]}(h,C,r)),!u&&$.inArray("script",h.dataTypes)>-1&&$.inArray("json",h.dataTypes)<0&&(h.converters["text script"]=function(){}),w=function(t,e,n,i){var o,s,r,a,l,c={},d=t.dataTypes.slice();if(d[1])for(r in t.converters)c[r.toLowerCase()]=t.converters[r];for(s=d.shift();s;)if(t.responseFields[s]&&(n[t.responseFields[s]]=e),!l&&i&&t.dataFilter&&(e=t.dataFilter(e,t.dataType)),l=s,s=d.shift())if("*"===s)s=l;else if("*"!==l&&l!==s){if(!(r=c[l+" "+s]||c["* "+s]))for(o in c)if((a=o.split(" "))[1]===s&&(r=c[l+" "+a[0]]||c["* "+a[0]])){!0===r?r=c[o]:!0!==c[o]&&(s=a[0],d.unshift(a[1]));break}if(!0!==r)if(r&&t.throws)e=r(e);else try{e=r(e)}catch(t){return{state:"parsererror",error:r?t:"No conversion from "+l+" to "+s}}}return{state:"success",data:e}}(h,w,C,u),u?(h.ifModified&&((x=C.getResponseHeader("Last-Modified"))&&($.lastModified[o]=x),(x=C.getResponseHeader("etag"))&&($.etag[o]=x)),204===t||"HEAD"===h.type?k="nocontent":304===t?k="notmodified":(k=w.state,p=w.data,u=!(b=w.error))):(b=k,!t&&k||(k="error",t<0&&(t=0))),C.status=t,C.statusText=(e||k)+"",u?g.resolveWith(f,[p,k,C]):g.rejectWith(f,[C,k,b]),C.statusCode(y),y=void 0,d&&m.trigger(u?"ajaxSuccess":"ajaxError",[C,h,u?p:b]),v.fireWith(f,[C,k]),d&&(m.trigger("ajaxComplete",[C,h]),--$.active||$.event.trigger("ajaxStop")))}return C},getJSON:function(t,e,n){return $.get(t,e,n,"json")},getScript:function(t,e){return $.get(t,void 0,e,"script")}}),$.each(["get","post"],(function(t,e){$[e]=function(t,n,i,o){return v(n)&&(o=o||i,i=n,n=void 0),$.ajax($.extend({url:t,type:e,dataType:o,data:n,success:i},$.isPlainObject(t)&&t))}})),$.ajaxPrefilter((function(t){var e;for(e in t.headers)"content-type"===e.toLowerCase()&&(t.contentType=t.headers[e]||"")})),$._evalUrl=function(t,e,n){return $.ajax({url:t,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(t){$.globalEval(t,e,n)}})},$.fn.extend({wrapAll:function(t){var e;return this[0]&&(v(t)&&(t=t.call(this[0])),e=$(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 v(t)?this.each((function(e){$(this).wrapInner(t.call(this,e))})):this.each((function(){var e=$(this),n=e.contents();n.length?n.wrapAll(t):e.append(t)}))},wrap:function(t){var e=v(t);return this.each((function(n){$(this).wrapAll(e?t.call(this,n):t)}))},unwrap:function(t){return this.parent(t).not("body").each((function(){$(this).replaceWith(this.childNodes)})),this}}),$.expr.pseudos.hidden=function(t){return!$.expr.pseudos.visible(t)},$.expr.pseudos.visible=function(t){return!!(t.offsetWidth||t.offsetHeight||t.getClientRects().length)},$.ajaxSettings.xhr=function(){try{return new n.XMLHttpRequest}catch(t){}};var Ue={0:200,1223:204},We=$.ajaxSettings.xhr();g.cors=!!We&&"withCredentials"in We,g.ajax=We=!!We,$.ajaxTransport((function(t){var e,i;if(g.cors||We&&!t.crossDomain)return{send:function(o,s){var r,a=t.xhr();if(a.open(t.type,t.url,t.async,t.username,t.password),t.xhrFields)for(r in t.xhrFields)a[r]=t.xhrFields[r];for(r in t.mimeType&&a.overrideMimeType&&a.overrideMimeType(t.mimeType),t.crossDomain||o["X-Requested-With"]||(o["X-Requested-With"]="XMLHttpRequest"),o)a.setRequestHeader(r,o[r]);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()}}})),$.ajaxPrefilter((function(t){t.crossDomain&&(t.contents.script=!1)})),$.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 $.globalEval(t),t}}}),$.ajaxPrefilter("script",(function(t){void 0===t.cache&&(t.cache=!1),t.crossDomain&&(t.type="GET")})),$.ajaxTransport("script",(function(t){var e,n;if(t.crossDomain||t.scriptAttrs)return{send:function(i,o){e=$("<script>").attr(t.scriptAttrs||{}).prop({charset:t.scriptCharset,src:t.url}).on("load error",n=function(t){e.remove(),n=null,t&&o("error"===t.type?404:200,t.type)}),b.head.appendChild(e[0])},abort:function(){n&&n()}}}));var Qe,Ve=[],Ge=/(=)\?(?=&|$)|\?\?/;$.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var t=Ve.pop()||$.expando+"_"+$e.guid++;return this[t]=!0,t}}),$.ajaxPrefilter("json jsonp",(function(t,e,i){var o,s,r,a=!1!==t.jsonp&&(Ge.test(t.url)?"url":"string"==typeof t.data&&0===(t.contentType||"").indexOf("application/x-www-form-urlencoded")&&Ge.test(t.data)&&"data");if(a||"jsonp"===t.dataTypes[0])return o=t.jsonpCallback=v(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,a?t[a]=t[a].replace(Ge,"$1"+o):!1!==t.jsonp&&(t.url+=(Se.test(t.url)?"&":"?")+t.jsonp+"="+o),t.converters["script json"]=function(){return r||$.error(o+" was not called"),r[0]},t.dataTypes[0]="json",s=n[o],n[o]=function(){r=arguments},i.always((function(){void 0===s?$(n).removeProp(o):n[o]=s,t[o]&&(t.jsonpCallback=e.jsonpCallback,Ve.push(o)),r&&v(s)&&s(r[0]),r=s=void 0})),"script"})),g.createHTMLDocument=((Qe=b.implementation.createHTMLDocument("").body).innerHTML="<form></form><form></form>",2===Qe.childNodes.length),$.parseHTML=function(t,e,n){return"string"!=typeof t?[]:("boolean"==typeof e&&(n=e,e=!1),e||(g.createHTMLDocument?((i=(e=b.implementation.createHTMLDocument("")).createElement("base")).href=b.location.href,e.head.appendChild(i)):e=b),s=!n&&[],(o=D.exec(t))?[e.createElement(o[1])]:(o=Ct([t],e,s),s&&s.length&&$(s).remove(),$.merge([],o.childNodes)));var i,o,s},$.fn.load=function(t,e,n){var i,o,s,r=this,a=t.indexOf(" ");return a>-1&&(i=ve(t.slice(a)),t=t.slice(0,a)),v(e)?(n=e,e=void 0):e&&"object"==typeof e&&(o="POST"),r.length>0&&$.ajax({url:t,type:o||"GET",dataType:"html",data:e}).done((function(t){s=arguments,r.html(i?$("<div>").append($.parseHTML(t)).find(i):t)})).always(n&&function(t,e){r.each((function(){n.apply(this,s||[t.responseText,e,t])}))}),this},$.expr.pseudos.animated=function(t){return $.grep($.timers,(function(e){return t===e.elem})).length},$.offset={setOffset:function(t,e,n){var i,o,s,r,a,l,c=$.css(t,"position"),d=$(t),u={};"static"===c&&(t.style.position="relative"),a=d.offset(),s=$.css(t,"top"),l=$.css(t,"left"),("absolute"===c||"fixed"===c)&&(s+l).indexOf("auto")>-1?(r=(i=d.position()).top,o=i.left):(r=parseFloat(s)||0,o=parseFloat(l)||0),v(e)&&(e=e.call(t,n,$.extend({},a))),null!=e.top&&(u.top=e.top-a.top+r),null!=e.left&&(u.left=e.left-a.left+o),"using"in e?e.using.call(t,u):d.css(u)}},$.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each((function(e){$.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],o={top:0,left:0};if("fixed"===$.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"===$.css(t,"position");)t=t.parentNode;t&&t!==i&&1===t.nodeType&&((o=$(t).offset()).top+=$.css(t,"borderTopWidth",!0),o.left+=$.css(t,"borderLeftWidth",!0))}return{top:e.top-o.top-$.css(i,"marginTop",!0),left:e.left-o.left-$.css(i,"marginLeft",!0)}}},offsetParent:function(){return this.map((function(){for(var t=this.offsetParent;t&&"static"===$.css(t,"position");)t=t.offsetParent;return t||rt}))}}),$.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},(function(t,e){var n="pageYOffset"===e;$.fn[t]=function(i){return W(this,(function(t,i,o){var s;if(y(t)?s=t:9===t.nodeType&&(s=t.defaultView),void 0===o)return s?s[e]:t[i];s?s.scrollTo(n?s.pageXOffset:o,n?o:s.pageYOffset):t[i]=o}),t,i,arguments.length)}})),$.each(["top","left"],(function(t,e){$.cssHooks[e]=Wt(g.pixelPosition,(function(t,n){if(n)return n=Ut(t,e),zt.test(n)?$(t).position()[e]+"px":n}))})),$.each({Height:"height",Width:"width"},(function(t,e){$.each({padding:"inner"+t,content:e,"":"outer"+t},(function(n,i){$.fn[i]=function(o,s){var r=arguments.length&&(n||"boolean"!=typeof o),a=n||(!0===o||!0===s?"margin":"border");return W(this,(function(e,n,o){var s;return y(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===o?$.css(e,n,a):$.style(e,n,o,a)}),e,r?o:void 0,r)}}))})),$.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],(function(t,e){$.fn[e]=function(t){return this.on(e,t)}})),$.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)}}),$.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){$.fn[e]=function(t,n){return arguments.length>0?this.on(e,null,t,n):this.trigger(e)}}));var Je=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;$.proxy=function(t,e){var n,i,o;if("string"==typeof e&&(n=t[e],e=t,t=n),v(t))return i=a.call(arguments,2),o=function(){return t.apply(e||this,i.concat(a.call(arguments)))},o.guid=t.guid=t.guid||$.guid++,o},$.holdReady=function(t){t?$.readyWait++:$.ready(!0)},$.isArray=Array.isArray,$.parseJSON=JSON.parse,$.nodeName=I,$.isFunction=v,$.isWindow=y,$.camelCase=J,$.type=k,$.now=Date.now,$.isNumeric=function(t){var e=$.type(t);return("number"===e||"string"===e)&&!isNaN(t-parseFloat(t))},$.trim=function(t){return null==t?"":(t+"").replace(Je,"")},void 0===(i=function(){return $}.apply(e,[]))||(t.exports=i);var Xe=n.jQuery,Ke=n.$;return $.noConflict=function(t){return n.$===$&&(n.$=Ke),t&&n.jQuery===$&&(n.jQuery=Xe),$},void 0===o&&(n.jQuery=n.$=$),$}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return s})),n.d(e,"h",(function(){return r})),n.d(e,"b",(function(){return a})),n.d(e,"f",(function(){return l})),n.d(e,"g",(function(){return c})),n.d(e,"e",(function(){return d})),n.d(e,"i",(function(){return u})),n.d(e,"c",(function(){return p})),n.d(e,"d",(function(){return h}));var i=n(0),o=n.n(i);function s(t){const e=o()("#navbar_status");e.empty(),e.append('<span class="navbar-text status-text">'+t+"</span>"),e.show(),window.setTimeout((function(){e.fadeOut(500)}),5e3)}function r(){return Object.prototype.hasOwnProperty.call(window,"isSecureContext")?!window.isSecureContext:"https:"!==window.location.protocol&&("file:"!==window.location.protocol&&("localhost"!==window.location.hostname&&!window.location.hostname.startsWith("127.")))}function a(t){const e=864e5,n=2592e6,i=31536e6,o=new Date-t;return o<e?(t.getHours()<10?"0":"")+t.getHours()+":"+(t.getMinutes()<10?"0":"")+t.getMinutes():o<n?"approximately "+Math.round(o/e)+" days ago":o<i?"approximately "+Math.round(o/n)+" months ago":"approximately "+Math.round(o/i)+" years ago"}function l(t){return o()("<div></div>").text(t).html()}function c(t){return t.toLowerCase().match(/\.(jpg|jpeg|png|gif)$/)}function d(t){return t>=1048576?(t/1048576).toFixed(1)+" MB":t>=1024?(t/1024).toFixed(1)+" KB":t+" B"}function u(t,e,n){const i=new Date;i.setTime(i.getTime()+24*n*60*60*1e3);const o="expires="+i.toUTCString();document.cookie=t+"="+e+";"+o+";path=/"}function p(t){document.cookie=t+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;"}function h(t){let e=t.match(/^RMS_Express_Form_([\w \.]+)-\d+\.xml$/i);return e?e[1]:(e=t.match(/^RMS_Express_Form_([\w \.]+)\.xml$/i),e?e[1]:null)}},function(t,e,n){(function(t){if(void 0===t)throw new Error("Bootstrap's JavaScript requires jQuery");!function(t){"use strict";t.fn.emulateTransitionEnd=function(e){var n=!1,i=this;t(this).one("bsTransitionEnd",(function(){n=!0}));return setTimeout((function(){n||t(i).trigger(t.support.transition.end)}),e),this},t((function(){t.support.transition=function(){var t=document.createElement("bootstrap"),e={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var n in e)if(void 0!==t.style[n])return{end:e[n]};return!1}(),t.support.transition&&(t.event.special.bsTransitionEnd={bindType:t.support.transition.end,delegateType:t.support.transition.end,handle:function(e){if(t(e.target).is(this))return e.handleObj.handler.apply(this,arguments)}})}))}(t),function(t){"use strict";var e='[data-dismiss="alert"]',n=function(n){t(n).on("click",e,this.close)};n.VERSION="3.2.0",n.prototype.close=function(e){var n=t(this),i=n.attr("data-target");i||(i=(i=n.attr("href"))&&i.replace(/.*(?=#[^\s]*$)/,""));var o=t(i);function s(){o.detach().trigger("closed.bs.alert").remove()}e&&e.preventDefault(),o.length||(o=n.hasClass("alert")?n:n.parent()),o.trigger(e=t.Event("close.bs.alert")),e.isDefaultPrevented()||(o.removeClass("in"),t.support.transition&&o.hasClass("fade")?o.one("bsTransitionEnd",s).emulateTransitionEnd(150):s())};var i=t.fn.alert;t.fn.alert=function(e){return this.each((function(){var i=t(this),o=i.data("bs.alert");o||i.data("bs.alert",o=new n(this)),"string"==typeof e&&o[e].call(i)}))},t.fn.alert.Constructor=n,t.fn.alert.noConflict=function(){return t.fn.alert=i,this},t(document).on("click.bs.alert.data-api",e,n.prototype.close)}(t),function(t){"use strict";var e=function(n,i){this.$element=t(n),this.options=t.extend({},e.DEFAULTS,i),this.isLoading=!1};function n(n){return this.each((function(){var i=t(this),o=i.data("bs.button"),s="object"==typeof n&&n;o||i.data("bs.button",o=new e(this,s)),"toggle"==n?o.toggle():n&&o.setState(n)}))}e.VERSION="3.2.0",e.DEFAULTS={loadingText:"loading..."},e.prototype.setState=function(e){var n="disabled",i=this.$element,o=i.is("input")?"val":"html",s=i.data();e+="Text",null==s.resetText&&i.data("resetText",i[o]()),i[o](null==s[e]?this.options[e]:s[e]),setTimeout(t.proxy((function(){"loadingText"==e?(this.isLoading=!0,i.addClass(n).attr(n,n)):this.isLoading&&(this.isLoading=!1,i.removeClass(n).removeAttr(n))}),this),0)},e.prototype.toggle=function(){var t=!0,e=this.$element.closest('[data-toggle="buttons"]');if(e.length){var n=this.$element.find("input");"radio"==n.prop("type")&&(n.prop("checked")&&this.$element.hasClass("active")?t=!1:e.find(".active").removeClass("active")),t&&n.prop("checked",!this.$element.hasClass("active")).trigger("change")}t&&this.$element.toggleClass("active")};var i=t.fn.button;t.fn.button=n,t.fn.button.Constructor=e,t.fn.button.noConflict=function(){return t.fn.button=i,this},t(document).on("click.bs.button.data-api",'[data-toggle^="button"]',(function(e){var i=t(e.target);i.hasClass("btn")||(i=i.closest(".btn")),n.call(i,"toggle"),e.preventDefault()}))}(t),function(t){"use strict";var e=function(e,n){this.$element=t(e).on("keydown.bs.carousel",t.proxy(this.keydown,this)),this.$indicators=this.$element.find(".carousel-indicators"),this.options=n,this.paused=this.sliding=this.interval=this.$active=this.$items=null,"hover"==this.options.pause&&this.$element.on("mouseenter.bs.carousel",t.proxy(this.pause,this)).on("mouseleave.bs.carousel",t.proxy(this.cycle,this))};function n(n){return this.each((function(){var i=t(this),o=i.data("bs.carousel"),s=t.extend({},e.DEFAULTS,i.data(),"object"==typeof n&&n),r="string"==typeof n?n:s.slide;o||i.data("bs.carousel",o=new e(this,s)),"number"==typeof n?o.to(n):r?o[r]():s.interval&&o.pause().cycle()}))}e.VERSION="3.2.0",e.DEFAULTS={interval:5e3,pause:"hover",wrap:!0},e.prototype.keydown=function(t){switch(t.which){case 37:this.prev();break;case 39:this.next();break;default:return}t.preventDefault()},e.prototype.cycle=function(e){return e||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(t.proxy(this.next,this),this.options.interval)),this},e.prototype.getItemIndex=function(t){return this.$items=t.parent().children(".item"),this.$items.index(t||this.$active)},e.prototype.to=function(e){var n=this,i=this.getItemIndex(this.$active=this.$element.find(".item.active"));if(!(e>this.$items.length-1||e<0))return this.sliding?this.$element.one("slid.bs.carousel",(function(){n.to(e)})):i==e?this.pause().cycle():this.slide(e>i?"next":"prev",t(this.$items[e]))},e.prototype.pause=function(e){return e||(this.paused=!0),this.$element.find(".next, .prev").length&&t.support.transition&&(this.$element.trigger(t.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},e.prototype.next=function(){if(!this.sliding)return this.slide("next")},e.prototype.prev=function(){if(!this.sliding)return this.slide("prev")},e.prototype.slide=function(e,n){var i=this.$element.find(".item.active"),o=n||i[e](),s=this.interval,r="next"==e?"left":"right",a="next"==e?"first":"last",l=this;if(!o.length){if(!this.options.wrap)return;o=this.$element.find(".item")[a]()}if(o.hasClass("active"))return this.sliding=!1;var c=o[0],d=t.Event("slide.bs.carousel",{relatedTarget:c,direction:r});if(this.$element.trigger(d),!d.isDefaultPrevented()){if(this.sliding=!0,s&&this.pause(),this.$indicators.length){this.$indicators.find(".active").removeClass("active");var u=t(this.$indicators.children()[this.getItemIndex(o)]);u&&u.addClass("active")}var p=t.Event("slid.bs.carousel",{relatedTarget:c,direction:r});return t.support.transition&&this.$element.hasClass("slide")?(o.addClass(e),o[0].offsetWidth,i.addClass(r),o.addClass(r),i.one("bsTransitionEnd",(function(){o.removeClass([e,r].join(" ")).addClass("active"),i.removeClass(["active",r].join(" ")),l.sliding=!1,setTimeout((function(){l.$element.trigger(p)}),0)})).emulateTransitionEnd(1e3*i.css("transition-duration").slice(0,-1))):(i.removeClass("active"),o.addClass("active"),this.sliding=!1,this.$element.trigger(p)),s&&this.cycle(),this}};var i=t.fn.carousel;t.fn.carousel=n,t.fn.carousel.Constructor=e,t.fn.carousel.noConflict=function(){return t.fn.carousel=i,this},t(document).on("click.bs.carousel.data-api","[data-slide], [data-slide-to]",(function(e){var i,o=t(this),s=t(o.attr("data-target")||(i=o.attr("href"))&&i.replace(/.*(?=#[^\s]+$)/,""));if(s.hasClass("carousel")){var r=t.extend({},s.data(),o.data()),a=o.attr("data-slide-to");a&&(r.interval=!1),n.call(s,r),a&&s.data("bs.carousel").to(a),e.preventDefault()}})),t(window).on("load",(function(){t('[data-ride="carousel"]').each((function(){var e=t(this);n.call(e,e.data())}))}))}(t),function(t){"use strict";var e=function(n,i){this.$element=t(n),this.options=t.extend({},e.DEFAULTS,i),this.transitioning=null,this.options.parent&&(this.$parent=t(this.options.parent)),this.options.toggle&&this.toggle()};function n(n){return this.each((function(){var i=t(this),o=i.data("bs.collapse"),s=t.extend({},e.DEFAULTS,i.data(),"object"==typeof n&&n);!o&&s.toggle&&"show"==n&&(n=!n),o||i.data("bs.collapse",o=new e(this,s)),"string"==typeof n&&o[n]()}))}e.VERSION="3.2.0",e.DEFAULTS={toggle:!0},e.prototype.dimension=function(){return this.$element.hasClass("width")?"width":"height"},e.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var e=t.Event("show.bs.collapse");if(this.$element.trigger(e),!e.isDefaultPrevented()){var i=this.$parent&&this.$parent.find("> .panel > .in");if(i&&i.length){var o=i.data("bs.collapse");if(o&&o.transitioning)return;n.call(i,"hide"),o||i.data("bs.collapse",null)}var s=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[s](0),this.transitioning=1;var r=function(){this.$element.removeClass("collapsing").addClass("collapse in")[s](""),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!t.support.transition)return r.call(this);var a=t.camelCase(["scroll",s].join("-"));this.$element.one("bsTransitionEnd",t.proxy(r,this)).emulateTransitionEnd(350)[s](this.$element[0][a])}}},e.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var e=t.Event("hide.bs.collapse");if(this.$element.trigger(e),!e.isDefaultPrevented()){var n=this.dimension();this.$element[n](this.$element[n]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse").removeClass("in"),this.transitioning=1;var i=function(){this.transitioning=0,this.$element.trigger("hidden.bs.collapse").removeClass("collapsing").addClass("collapse")};if(!t.support.transition)return i.call(this);this.$element[n](0).one("bsTransitionEnd",t.proxy(i,this)).emulateTransitionEnd(350)}}},e.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()};var i=t.fn.collapse;t.fn.collapse=n,t.fn.collapse.Constructor=e,t.fn.collapse.noConflict=function(){return t.fn.collapse=i,this},t(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',(function(e){var i,o=t(this),s=o.attr("data-target")||e.preventDefault()||(i=o.attr("href"))&&i.replace(/.*(?=#[^\s]+$)/,""),r=t(s),a=r.data("bs.collapse"),l=a?"toggle":o.data(),c=o.attr("data-parent"),d=c&&t(c);a&&a.transitioning||(d&&d.find('[data-toggle="collapse"][data-parent="'+c+'"]').not(o).addClass("collapsed"),o[r.hasClass("in")?"addClass":"removeClass"]("collapsed")),n.call(r,l)}))}(t),function(t){"use strict";var e='[data-toggle="dropdown"]',n=function(e){t(e).on("click.bs.dropdown",this.toggle)};function i(n){n&&3===n.which||(t(".dropdown-backdrop").remove(),t(e).each((function(){var e=o(t(this)),i={relatedTarget:this};e.hasClass("open")&&(e.trigger(n=t.Event("hide.bs.dropdown",i)),n.isDefaultPrevented()||e.removeClass("open").trigger("hidden.bs.dropdown",i))})))}function o(e){var n=e.attr("data-target");n||(n=(n=e.attr("href"))&&/#[A-Za-z]/.test(n)&&n.replace(/.*(?=#[^\s]*$)/,""));var i=n&&t(n);return i&&i.length?i:e.parent()}n.VERSION="3.2.0",n.prototype.toggle=function(e){var n=t(this);if(!n.is(".disabled, :disabled")){var s=o(n),r=s.hasClass("open");if(i(),!r){"ontouchstart"in document.documentElement&&!s.closest(".navbar-nav").length&&t('<div class="dropdown-backdrop"/>').insertAfter(t(this)).on("click",i);var a={relatedTarget:this};if(s.trigger(e=t.Event("show.bs.dropdown",a)),e.isDefaultPrevented())return;n.trigger("focus"),s.toggleClass("open").trigger("shown.bs.dropdown",a)}return!1}},n.prototype.keydown=function(n){if(/(38|40|27)/.test(n.keyCode)){var i=t(this);if(n.preventDefault(),n.stopPropagation(),!i.is(".disabled, :disabled")){var s=o(i),r=s.hasClass("open");if(!r||r&&27==n.keyCode)return 27==n.which&&s.find(e).trigger("focus"),i.trigger("click");var a=" li:not(.divider):visible a",l=s.find('[role="menu"]'+a+', [role="listbox"]'+a);if(l.length){var c=l.index(l.filter(":focus"));38==n.keyCode&&c>0&&c--,40==n.keyCode&&c<l.length-1&&c++,~c||(c=0),l.eq(c).trigger("focus")}}}};var s=t.fn.dropdown;t.fn.dropdown=function(e){return this.each((function(){var i=t(this),o=i.data("bs.dropdown");o||i.data("bs.dropdown",o=new n(this)),"string"==typeof e&&o[e].call(i)}))},t.fn.dropdown.Constructor=n,t.fn.dropdown.noConflict=function(){return t.fn.dropdown=s,this},t(document).on("click.bs.dropdown.data-api",i).on("click.bs.dropdown.data-api",".dropdown form",(function(t){t.stopPropagation()})).on("click.bs.dropdown.data-api",e,n.prototype.toggle).on("keydown.bs.dropdown.data-api",e+', [role="menu"], [role="listbox"]',n.prototype.keydown)}(t),function(t){"use strict";var e=function(e,n){this.options=n,this.$body=t(document.body),this.$element=t(e),this.$backdrop=this.isShown=null,this.scrollbarWidth=0,this.options.remote&&this.$element.find(".modal-content").load(this.options.remote,t.proxy((function(){this.$element.trigger("loaded.bs.modal")}),this))};function n(n,i){return this.each((function(){var o=t(this),s=o.data("bs.modal"),r=t.extend({},e.DEFAULTS,o.data(),"object"==typeof n&&n);s||o.data("bs.modal",s=new e(this,r)),"string"==typeof n?s[n](i):r.show&&s.show(i)}))}e.VERSION="3.2.0",e.DEFAULTS={backdrop:!0,keyboard:!0,show:!0},e.prototype.toggle=function(t){return this.isShown?this.hide():this.show(t)},e.prototype.show=function(e){var n=this,i=t.Event("show.bs.modal",{relatedTarget:e});this.$element.trigger(i),this.isShown||i.isDefaultPrevented()||(this.isShown=!0,this.checkScrollbar(),this.$body.addClass("modal-open"),this.setScrollbar(),this.escape(),this.$element.on("click.dismiss.bs.modal",'[data-dismiss="modal"]',t.proxy(this.hide,this)),this.backdrop((function(){var i=t.support.transition&&n.$element.hasClass("fade");n.$element.parent().length||n.$element.appendTo(n.$body),n.$element.show().scrollTop(0),i&&n.$element[0].offsetWidth,n.$element.addClass("in").attr("aria-hidden",!1),n.enforceFocus();var o=t.Event("shown.bs.modal",{relatedTarget:e});i?n.$element.find(".modal-dialog").one("bsTransitionEnd",(function(){n.$element.trigger("focus").trigger(o)})).emulateTransitionEnd(300):n.$element.trigger("focus").trigger(o)})))},e.prototype.hide=function(e){e&&e.preventDefault(),e=t.Event("hide.bs.modal"),this.$element.trigger(e),this.isShown&&!e.isDefaultPrevented()&&(this.isShown=!1,this.$body.removeClass("modal-open"),this.resetScrollbar(),this.escape(),t(document).off("focusin.bs.modal"),this.$element.removeClass("in").attr("aria-hidden",!0).off("click.dismiss.bs.modal"),t.support.transition&&this.$element.hasClass("fade")?this.$element.one("bsTransitionEnd",t.proxy(this.hideModal,this)).emulateTransitionEnd(300):this.hideModal())},e.prototype.enforceFocus=function(){t(document).off("focusin.bs.modal").on("focusin.bs.modal",t.proxy((function(t){this.$element[0]===t.target||this.$element.has(t.target).length||this.$element.trigger("focus")}),this))},e.prototype.escape=function(){this.isShown&&this.options.keyboard?this.$element.on("keyup.dismiss.bs.modal",t.proxy((function(t){27==t.which&&this.hide()}),this)):this.isShown||this.$element.off("keyup.dismiss.bs.modal")},e.prototype.hideModal=function(){var t=this;this.$element.hide(),this.backdrop((function(){t.$element.trigger("hidden.bs.modal")}))},e.prototype.removeBackdrop=function(){this.$backdrop&&this.$backdrop.remove(),this.$backdrop=null},e.prototype.backdrop=function(e){var n=this,i=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var o=t.support.transition&&i;if(this.$backdrop=t('<div class="modal-backdrop '+i+'" />').appendTo(this.$body),this.$element.on("click.dismiss.bs.modal",t.proxy((function(t){t.target===t.currentTarget&&("static"==this.options.backdrop?this.$element[0].focus.call(this.$element[0]):this.hide.call(this))}),this)),o&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in"),!e)return;o?this.$backdrop.one("bsTransitionEnd",e).emulateTransitionEnd(150):e()}else if(!this.isShown&&this.$backdrop){this.$backdrop.removeClass("in");var s=function(){n.removeBackdrop(),e&&e()};t.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one("bsTransitionEnd",s).emulateTransitionEnd(150):s()}else e&&e()},e.prototype.checkScrollbar=function(){document.body.clientWidth>=window.innerWidth||(this.scrollbarWidth=this.scrollbarWidth||this.measureScrollbar())},e.prototype.setScrollbar=function(){var t=parseInt(this.$body.css("padding-right")||0,10);this.scrollbarWidth&&this.$body.css("padding-right",t+this.scrollbarWidth)},e.prototype.resetScrollbar=function(){this.$body.css("padding-right","")},e.prototype.measureScrollbar=function(){var t=document.createElement("div");t.className="modal-scrollbar-measure",this.$body.append(t);var e=t.offsetWidth-t.clientWidth;return this.$body[0].removeChild(t),e};var i=t.fn.modal;t.fn.modal=n,t.fn.modal.Constructor=e,t.fn.modal.noConflict=function(){return t.fn.modal=i,this},t(document).on("click.bs.modal.data-api",'[data-toggle="modal"]',(function(e){var i=t(this),o=i.attr("href"),s=t(i.attr("data-target")||o&&o.replace(/.*(?=#[^\s]+$)/,"")),r=s.data("bs.modal")?"toggle":t.extend({remote:!/#/.test(o)&&o},s.data(),i.data());i.is("a")&&e.preventDefault(),s.one("show.bs.modal",(function(t){t.isDefaultPrevented()||s.one("hidden.bs.modal",(function(){i.is(":visible")&&i.trigger("focus")}))})),n.call(s,r,this)}))}(t),function(t){"use strict";var e=function(t,e){this.type=this.options=this.enabled=this.timeout=this.hoverState=this.$element=null,this.init("tooltip",t,e)};e.VERSION="3.2.0",e.DEFAULTS={animation:!0,placement:"top",selector:!1,template:'<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',trigger:"hover focus",title:"",delay:0,html:!1,container:!1,viewport:{selector:"body",padding:0}},e.prototype.init=function(e,n,i){this.enabled=!0,this.type=e,this.$element=t(n),this.options=this.getOptions(i),this.$viewport=this.options.viewport&&t(this.options.viewport.selector||this.options.viewport);for(var o=this.options.trigger.split(" "),s=o.length;s--;){var r=o[s];if("click"==r)this.$element.on("click."+this.type,this.options.selector,t.proxy(this.toggle,this));else if("manual"!=r){var a="hover"==r?"mouseenter":"focusin",l="hover"==r?"mouseleave":"focusout";this.$element.on(a+"."+this.type,this.options.selector,t.proxy(this.enter,this)),this.$element.on(l+"."+this.type,this.options.selector,t.proxy(this.leave,this))}}this.options.selector?this._options=t.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},e.prototype.getDefaults=function(){return e.DEFAULTS},e.prototype.getOptions=function(e){return(e=t.extend({},this.getDefaults(),this.$element.data(),e)).delay&&"number"==typeof e.delay&&(e.delay={show:e.delay,hide:e.delay}),e},e.prototype.getDelegateOptions=function(){var e={},n=this.getDefaults();return this._options&&t.each(this._options,(function(t,i){n[t]!=i&&(e[t]=i)})),e},e.prototype.enter=function(e){var n=e instanceof this.constructor?e:t(e.currentTarget).data("bs."+this.type);if(n||(n=new this.constructor(e.currentTarget,this.getDelegateOptions()),t(e.currentTarget).data("bs."+this.type,n)),clearTimeout(n.timeout),n.hoverState="in",!n.options.delay||!n.options.delay.show)return n.show();n.timeout=setTimeout((function(){"in"==n.hoverState&&n.show()}),n.options.delay.show)},e.prototype.leave=function(e){var n=e instanceof this.constructor?e:t(e.currentTarget).data("bs."+this.type);if(n||(n=new this.constructor(e.currentTarget,this.getDelegateOptions()),t(e.currentTarget).data("bs."+this.type,n)),clearTimeout(n.timeout),n.hoverState="out",!n.options.delay||!n.options.delay.hide)return n.hide();n.timeout=setTimeout((function(){"out"==n.hoverState&&n.hide()}),n.options.delay.hide)},e.prototype.show=function(){var e=t.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(e);var n=t.contains(document.documentElement,this.$element[0]);if(e.isDefaultPrevented()||!n)return;var i=this,o=this.tip(),s=this.getUID(this.type);this.setContent(),o.attr("id",s),this.$element.attr("aria-describedby",s),this.options.animation&&o.addClass("fade");var r="function"==typeof this.options.placement?this.options.placement.call(this,o[0],this.$element[0]):this.options.placement,a=/\s?auto?\s?/i,l=a.test(r);l&&(r=r.replace(a,"")||"top"),o.detach().css({top:0,left:0,display:"block"}).addClass(r).data("bs."+this.type,this),this.options.container?o.appendTo(this.options.container):o.insertAfter(this.$element);var c=this.getPosition(),d=o[0].offsetWidth,u=o[0].offsetHeight;if(l){var p=r,h=this.$element.parent(),f=this.getPosition(h);r="bottom"==r&&c.top+c.height+u-f.scroll>f.height?"top":"top"==r&&c.top-f.scroll-u<0?"bottom":"right"==r&&c.right+d>f.width?"left":"left"==r&&c.left-d<f.left?"right":r,o.removeClass(p).addClass(r)}var m=this.getCalculatedOffset(r,c,d,u);this.applyPlacement(m,r);var g=function(){i.$element.trigger("shown.bs."+i.type),i.hoverState=null};t.support.transition&&this.$tip.hasClass("fade")?o.one("bsTransitionEnd",g).emulateTransitionEnd(150):g()}},e.prototype.applyPlacement=function(e,n){var i=this.tip(),o=i[0].offsetWidth,s=i[0].offsetHeight,r=parseInt(i.css("margin-top"),10),a=parseInt(i.css("margin-left"),10);isNaN(r)&&(r=0),isNaN(a)&&(a=0),e.top=e.top+r,e.left=e.left+a,t.offset.setOffset(i[0],t.extend({using:function(t){i.css({top:Math.round(t.top),left:Math.round(t.left)})}},e),0),i.addClass("in");var l=i[0].offsetWidth,c=i[0].offsetHeight;"top"==n&&c!=s&&(e.top=e.top+s-c);var d=this.getViewportAdjustedDelta(n,e,l,c);d.left?e.left+=d.left:e.top+=d.top;var u=d.left?2*d.left-o+l:2*d.top-s+c,p=d.left?"left":"top",h=d.left?"offsetWidth":"offsetHeight";i.offset(e),this.replaceArrow(u,i[0][h],p)},e.prototype.replaceArrow=function(t,e,n){this.arrow().css(n,t?50*(1-t/e)+"%":"")},e.prototype.setContent=function(){var t=this.tip(),e=this.getTitle();t.find(".tooltip-inner")[this.options.html?"html":"text"](e),t.removeClass("fade in top bottom left right")},e.prototype.hide=function(){var e=this,n=this.tip(),i=t.Event("hide.bs."+this.type);function o(){"in"!=e.hoverState&&n.detach(),e.$element.trigger("hidden.bs."+e.type)}if(this.$element.removeAttr("aria-describedby"),this.$element.trigger(i),!i.isDefaultPrevented())return n.removeClass("in"),t.support.transition&&this.$tip.hasClass("fade")?n.one("bsTransitionEnd",o).emulateTransitionEnd(150):o(),this.hoverState=null,this},e.prototype.fixTitle=function(){var t=this.$element;(t.attr("title")||"string"!=typeof t.attr("data-original-title"))&&t.attr("data-original-title",t.attr("title")||"").attr("title","")},e.prototype.hasContent=function(){return this.getTitle()},e.prototype.getPosition=function(e){var n=(e=e||this.$element)[0],i="BODY"==n.tagName;return t.extend({},"function"==typeof n.getBoundingClientRect?n.getBoundingClientRect():null,{scroll:i?document.documentElement.scrollTop||document.body.scrollTop:e.scrollTop(),width:i?t(window).width():e.outerWidth(),height:i?t(window).height():e.outerHeight()},i?{top:0,left:0}:e.offset())},e.prototype.getCalculatedOffset=function(t,e,n,i){return"bottom"==t?{top:e.top+e.height,left:e.left+e.width/2-n/2}:"top"==t?{top:e.top-i,left:e.left+e.width/2-n/2}:"left"==t?{top:e.top+e.height/2-i/2,left:e.left-n}:{top:e.top+e.height/2-i/2,left:e.left+e.width}},e.prototype.getViewportAdjustedDelta=function(t,e,n,i){var o={top:0,left:0};if(!this.$viewport)return o;var s=this.options.viewport&&this.options.viewport.padding||0,r=this.getPosition(this.$viewport);if(/right|left/.test(t)){var a=e.top-s-r.scroll,l=e.top+s-r.scroll+i;a<r.top?o.top=r.top-a:l>r.top+r.height&&(o.top=r.top+r.height-l)}else{var c=e.left-s,d=e.left+s+n;c<r.left?o.left=r.left-c:d>r.width&&(o.left=r.left+r.width-d)}return o},e.prototype.getTitle=function(){var t=this.$element,e=this.options;return t.attr("data-original-title")||("function"==typeof e.title?e.title.call(t[0]):e.title)},e.prototype.getUID=function(t){do{t+=~~(1e6*Math.random())}while(document.getElementById(t));return t},e.prototype.tip=function(){return this.$tip=this.$tip||t(this.options.template)},e.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},e.prototype.validate=function(){this.$element[0].parentNode||(this.hide(),this.$element=null,this.options=null)},e.prototype.enable=function(){this.enabled=!0},e.prototype.disable=function(){this.enabled=!1},e.prototype.toggleEnabled=function(){this.enabled=!this.enabled},e.prototype.toggle=function(e){var n=this;e&&((n=t(e.currentTarget).data("bs."+this.type))||(n=new this.constructor(e.currentTarget,this.getDelegateOptions()),t(e.currentTarget).data("bs."+this.type,n))),n.tip().hasClass("in")?n.leave(n):n.enter(n)},e.prototype.destroy=function(){clearTimeout(this.timeout),this.hide().$element.off("."+this.type).removeData("bs."+this.type)};var n=t.fn.tooltip;t.fn.tooltip=function(n){return this.each((function(){var i=t(this),o=i.data("bs.tooltip"),s="object"==typeof n&&n;(o||"destroy"!=n)&&(o||i.data("bs.tooltip",o=new e(this,s)),"string"==typeof n&&o[n]())}))},t.fn.tooltip.Constructor=e,t.fn.tooltip.noConflict=function(){return t.fn.tooltip=n,this}}(t),function(t){"use strict";var e=function(t,e){this.init("popover",t,e)};if(!t.fn.tooltip)throw new Error("Popover requires tooltip.js");e.VERSION="3.2.0",e.DEFAULTS=t.extend({},t.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:'<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'}),(e.prototype=t.extend({},t.fn.tooltip.Constructor.prototype)).constructor=e,e.prototype.getDefaults=function(){return e.DEFAULTS},e.prototype.setContent=function(){var t=this.tip(),e=this.getTitle(),n=this.getContent();t.find(".popover-title")[this.options.html?"html":"text"](e),t.find(".popover-content").empty()[this.options.html?"string"==typeof n?"html":"append":"text"](n),t.removeClass("fade top bottom left right in"),t.find(".popover-title").html()||t.find(".popover-title").hide()},e.prototype.hasContent=function(){return this.getTitle()||this.getContent()},e.prototype.getContent=function(){var t=this.$element,e=this.options;return t.attr("data-content")||("function"==typeof e.content?e.content.call(t[0]):e.content)},e.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")},e.prototype.tip=function(){return this.$tip||(this.$tip=t(this.options.template)),this.$tip};var n=t.fn.popover;t.fn.popover=function(n){return this.each((function(){var i=t(this),o=i.data("bs.popover"),s="object"==typeof n&&n;(o||"destroy"!=n)&&(o||i.data("bs.popover",o=new e(this,s)),"string"==typeof n&&o[n]())}))},t.fn.popover.Constructor=e,t.fn.popover.noConflict=function(){return t.fn.popover=n,this}}(t),function(t){"use strict";function e(n,i){var o=t.proxy(this.process,this);this.$body=t("body"),this.$scrollElement=t(n).is("body")?t(window):t(n),this.options=t.extend({},e.DEFAULTS,i),this.selector=(this.options.target||"")+" .nav li > a",this.offsets=[],this.targets=[],this.activeTarget=null,this.scrollHeight=0,this.$scrollElement.on("scroll.bs.scrollspy",o),this.refresh(),this.process()}function n(n){return this.each((function(){var i=t(this),o=i.data("bs.scrollspy"),s="object"==typeof n&&n;o||i.data("bs.scrollspy",o=new e(this,s)),"string"==typeof n&&o[n]()}))}e.VERSION="3.2.0",e.DEFAULTS={offset:10},e.prototype.getScrollHeight=function(){return this.$scrollElement[0].scrollHeight||Math.max(this.$body[0].scrollHeight,document.documentElement.scrollHeight)},e.prototype.refresh=function(){var e="offset",n=0;t.isWindow(this.$scrollElement[0])||(e="position",n=this.$scrollElement.scrollTop()),this.offsets=[],this.targets=[],this.scrollHeight=this.getScrollHeight();var i=this;this.$body.find(this.selector).map((function(){var i=t(this),o=i.data("target")||i.attr("href"),s=/^#./.test(o)&&t(o);return s&&s.length&&s.is(":visible")&&[[s[e]().top+n,o]]||null})).sort((function(t,e){return t[0]-e[0]})).each((function(){i.offsets.push(this[0]),i.targets.push(this[1])}))},e.prototype.process=function(){var t,e=this.$scrollElement.scrollTop()+this.options.offset,n=this.getScrollHeight(),i=this.options.offset+n-this.$scrollElement.height(),o=this.offsets,s=this.targets,r=this.activeTarget;if(this.scrollHeight!=n&&this.refresh(),e>=i)return r!=(t=s[s.length-1])&&this.activate(t);if(r&&e<=o[0])return r!=(t=s[0])&&this.activate(t);for(t=o.length;t--;)r!=s[t]&&e>=o[t]&&(!o[t+1]||e<=o[t+1])&&this.activate(s[t])},e.prototype.activate=function(e){this.activeTarget=e,t(this.selector).parentsUntil(this.options.target,".active").removeClass("active");var n=this.selector+'[data-target="'+e+'"],'+this.selector+'[href="'+e+'"]',i=t(n).parents("li").addClass("active");i.parent(".dropdown-menu").length&&(i=i.closest("li.dropdown").addClass("active")),i.trigger("activate.bs.scrollspy")};var i=t.fn.scrollspy;t.fn.scrollspy=n,t.fn.scrollspy.Constructor=e,t.fn.scrollspy.noConflict=function(){return t.fn.scrollspy=i,this},t(window).on("load.bs.scrollspy.data-api",(function(){t('[data-spy="scroll"]').each((function(){var e=t(this);n.call(e,e.data())}))}))}(t),function(t){"use strict";var e=function(e){this.element=t(e)};function n(n){return this.each((function(){var i=t(this),o=i.data("bs.tab");o||i.data("bs.tab",o=new e(this)),"string"==typeof n&&o[n]()}))}e.VERSION="3.2.0",e.prototype.show=function(){var e=this.element,n=e.closest("ul:not(.dropdown-menu)"),i=e.data("target");if(i||(i=(i=e.attr("href"))&&i.replace(/.*(?=#[^\s]*$)/,"")),!e.parent("li").hasClass("active")){var o=n.find(".active:last a")[0],s=t.Event("show.bs.tab",{relatedTarget:o});if(e.trigger(s),!s.isDefaultPrevented()){var r=t(i);this.activate(e.closest("li"),n),this.activate(r,r.parent(),(function(){e.trigger({type:"shown.bs.tab",relatedTarget:o})}))}}},e.prototype.activate=function(e,n,i){var o=n.find("> .active"),s=i&&t.support.transition&&o.hasClass("fade");function r(){o.removeClass("active").find("> .dropdown-menu > .active").removeClass("active"),e.addClass("active"),s?(e[0].offsetWidth,e.addClass("in")):e.removeClass("fade"),e.parent(".dropdown-menu")&&e.closest("li.dropdown").addClass("active"),i&&i()}s?o.one("bsTransitionEnd",r).emulateTransitionEnd(150):r(),o.removeClass("in")};var i=t.fn.tab;t.fn.tab=n,t.fn.tab.Constructor=e,t.fn.tab.noConflict=function(){return t.fn.tab=i,this},t(document).on("click.bs.tab.data-api",'[data-toggle="tab"], [data-toggle="pill"]',(function(e){e.preventDefault(),n.call(t(this),"show")}))}(t),function(t){"use strict";var e=function(n,i){this.options=t.extend({},e.DEFAULTS,i),this.$target=t(this.options.target).on("scroll.bs.affix.data-api",t.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",t.proxy(this.checkPositionWithEventLoop,this)),this.$element=t(n),this.affixed=this.unpin=this.pinnedOffset=null,this.checkPosition()};function n(n){return this.each((function(){var i=t(this),o=i.data("bs.affix"),s="object"==typeof n&&n;o||i.data("bs.affix",o=new e(this,s)),"string"==typeof n&&o[n]()}))}e.VERSION="3.2.0",e.RESET="affix affix-top affix-bottom",e.DEFAULTS={offset:0,target:window},e.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(e.RESET).addClass("affix");var t=this.$target.scrollTop(),n=this.$element.offset();return this.pinnedOffset=n.top-t},e.prototype.checkPositionWithEventLoop=function(){setTimeout(t.proxy(this.checkPosition,this),1)},e.prototype.checkPosition=function(){if(this.$element.is(":visible")){var n=t(document).height(),i=this.$target.scrollTop(),o=this.$element.offset(),s=this.options.offset,r=s.top,a=s.bottom;"object"!=typeof s&&(a=r=s),"function"==typeof r&&(r=s.top(this.$element)),"function"==typeof a&&(a=s.bottom(this.$element));var l=!(null!=this.unpin&&i+this.unpin<=o.top)&&(null!=a&&o.top+this.$element.height()>=n-a?"bottom":null!=r&&i<=r&&"top");if(this.affixed!==l){null!=this.unpin&&this.$element.css("top","");var c="affix"+(l?"-"+l:""),d=t.Event(c+".bs.affix");this.$element.trigger(d),d.isDefaultPrevented()||(this.affixed=l,this.unpin="bottom"==l?this.getPinnedOffset():null,this.$element.removeClass(e.RESET).addClass(c).trigger(t.Event(c.replace("affix","affixed"))),"bottom"==l&&this.$element.offset({top:n-this.$element.height()-a}))}}};var i=t.fn.affix;t.fn.affix=n,t.fn.affix.Constructor=e,t.fn.affix.noConflict=function(){return t.fn.affix=i,this},t(window).on("load",(function(){t('[data-spy="affix"]').each((function(){var e=t(this),i=e.data();i.offset=i.offset||{},i.offsetBottom&&(i.offset.bottom=i.offsetBottom),i.offsetTop&&(i.offset.top=i.offsetTop),n.call(e,i)}))}))}(t)}).call(this,n(0))},function(t,e,n){"use strict";(function(t){n.d(e,"a",(function(){return i}));class i{constructor(t="#promptModal"){this.modalSelector=t,this.modal=null,this.modalBody=null,this.modalFooter=null,this.modalMessage=null,this.currentNotification=null,this.onResponse=null}init(){this.modal=t(this.modalSelector),this.modalBody=this.modal.find(".modal-body"),this.modalFooter=this.modal.find(".modal-footer"),this.modalMessage=t("#promptMessage"),this.modal.css("z-index",1060)}_cleanupModals(){t(this.modalSelector).modal("hide")}showCustom(e={}){this._cleanupModals(),this.modalBody.empty(),this.modalFooter.empty(),e.message&&this.modalMessage.text(e.message),e.body&&this.modalBody.append(e.body),e.buttons&&e.buttons.forEach((e=>{this.modalFooter.append(t("<button>").attr({type:"button",class:`btn ${e.class||"btn-default"}`}).addClass(e.pullLeft?"pull-left":"").text(e.text).click((t=>{e.onClick&&e.onClick(t),!1!==e.close&&this.hide()})))})),this.modal.modal({backdrop:!0!==e.static||"static",keyboard:!1!==e.keyboard,show:!0})}showSystemPrompt(t,e){this._cleanupModals(),this.modalBody.empty(),this.modalFooter.empty(),this.onResponse=e,this._handleSystemPrompt(t)}hide(){this.modal.modal("hide"),this.currentNotification&&(this.currentNotification.close(),this.currentNotification=null)}setNotification(t){this.currentNotification&&this.currentNotification.close(),this.currentNotification=t}_handleSystemPrompt(e){switch(this.modalBody.append(t('<input type="hidden">').attr({id:"promptID",value:e.id})),this.modalMessage.text(e.message),this.modal.data("prompt-kind",e.kind),e.kind){case"password":this.modalBody.append(t("<input>").attr({type:"password",id:"promptPasswordInput",class:"form-control",placeholder:"Enter password...",autocomplete:"off"})),this.modalFooter.append(t("<input>").attr({type:"submit",class:"btn btn-primary",id:"promptOkButton",value:"OK"}).click((()=>{this._submitResponse(t("#promptPasswordInput").val())})));break;case"busy-channel":this.modalBody.append(t("<div>").addClass("text-center").append(t("<span>").addClass("glyphicon glyphicon-refresh icon-spin text-muted").css({"font-size":"36px",margin:"12px 0"}))),this.modalFooter.append(t("<button>").attr({type:"button",class:"btn btn-default",id:"promptOkButton"}).text("Continue anyway").click((()=>{this._submitResponse("continue")}))),this.modalFooter.append(t("<button>").attr({type:"button",class:"btn btn-primary"}).text("Abort").click((()=>{this._submitResponse("abort")})));break;case"multi-select":const n=t("<div>").addClass("checkbox-list"),i=t("<ul>").addClass("checkbox-list-items");e.options.forEach((e=>{const n=t("<li>"),o=t("<label>").addClass("checkbox-item"),s=t("<input>").attr({type:"checkbox",value:e.value,checked:e.checked});o.append(s),o.append(` ${e.desc||e.value} (${e.value})`),n.append(o),i.append(n)})),n.append(i),this.modalBody.append(n),this.modalFooter.append(t("<button>").attr({type:"button",class:"btn btn-default pull-left",id:"selectAllToggle"}).text("Select All").click((function(){const e=n.find('input[type="checkbox"]'),i=e.filter(":checked").length===e.length;e.prop("checked",!i),t(this).text(i?"Select All":"Deselect All"),t(this).blur()}))),this.modalFooter.append(t("<input>").attr({type:"submit",class:"btn btn-primary",id:"promptOkButton",value:"OK"}).click((()=>{const e=t(".modal-body .checkbox-list input:checked").map((function(){return t(this).val()})).get().join(",");this._submitResponse(e)})));break;case"pre-account-activation":this.modalBody.append(t("<p>").addClass("text-warning").html("<b>WARNING:</b> We were unable to confirm that your Winlink account is active.")).append(t("<p>").text("If you continue, an over-the-air activation will be initiated and you will receive a message with a new password.")).append(t("<p>").text("This password will be the only key to your account. If you lose it, it cannot be recovered.")).append(t("<p>").html("It is strongly recommended to create your account before proceeding.")),this.modalFooter.append(t("<button>").attr({type:"button",class:"btn btn-default pull-left"}).text("Continue anyway").click((()=>{this._submitResponse("confirmed")}))),this.modalFooter.append(t("<button>").attr({type:"button",class:"btn btn-default"}).text("Abort").click((()=>{this._submitResponse("abort")}))),this.modalFooter.append(t("<button>").attr({type:"button",class:"btn btn-primary"}).text("Create new account").click((()=>{this._submitResponse("abort"),window.location.href="/ui/config?action=create-account"})));break;case"account-activation":this.modalBody.append(t("<p>").text("Welcome! The system has automatically generated a password for your new account.")).append(t("<p>").text("This password is in a message that is ready to be downloaded to your inbox during this session.")).append(t("<p>").addClass("text-warning").html("<b>WARNING:</b> Once you download this message, the password inside is the only key to your account. If you lose it, it cannot be recovered.")).append(t("<p>").text("Are you ready to receive this message and save the password securely right now?")),this.modalFooter.append(t("<button>").attr({type:"button",class:"btn btn-default"}).text("Postpone to Next Connection").click((()=>{this._submitResponse("defer")}))),this.modalFooter.append(t("<button>").attr({type:"button",class:"btn btn-primary"}).text("Yes, Download Now").click((()=>{this._submitResponse("accept")})));break;default:return void console.log("Ignoring unsupported prompt kind:",e.kind)}this.modal.modal({backdrop:"static",keyboard:!1,show:!0})}_submitResponse(e){const n=t("#promptID").val();this.hide(),this.onResponse&&this.onResponse({id:n,value:e})}}}).call(this,n(0))},function(t,e,n){var i,o,s;!function(r,a){"use strict";t.exports?t.exports=a(n(10),n(11),n(12)):(o=[n(10),n(11),n(12)],void 0===(s="function"==typeof(i=a)?i.apply(e,o):i)||(t.exports=s))}(0,(function(t,e,n,i){"use strict";var o=i&&i.URI;function s(t,e){var n=arguments.length>=1;if(!(this instanceof s))return n?arguments.length>=2?new s(t,e):new s(t):new s;if(void 0===t){if(n)throw new TypeError("undefined is not a valid argument for URI");t="undefined"!=typeof location?location.href+"":""}if(null===t&&n)throw new TypeError("null is not a valid argument for URI");return this.href(t),void 0!==e?this.absoluteTo(e):this}s.version="1.19.10";var r=s.prototype,a=Object.prototype.hasOwnProperty;function l(t){return t.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}function c(t){return void 0===t?"Undefined":String(Object.prototype.toString.call(t)).slice(8,-1)}function d(t){return"Array"===c(t)}function u(t,e){var n,i,o={};if("RegExp"===c(e))o=null;else if(d(e))for(n=0,i=e.length;n<i;n++)o[e[n]]=!0;else o[e]=!0;for(n=0,i=t.length;n<i;n++){(o&&void 0!==o[t[n]]||!o&&e.test(t[n]))&&(t.splice(n,1),i--,n--)}return t}function p(t,e){var n,i;if(d(e)){for(n=0,i=e.length;n<i;n++)if(!p(t,e[n]))return!1;return!0}var o=c(e);for(n=0,i=t.length;n<i;n++)if("RegExp"===o){if("string"==typeof t[n]&&t[n].match(e))return!0}else if(t[n]===e)return!0;return!1}function h(t,e){if(!d(t)||!d(e))return!1;if(t.length!==e.length)return!1;t.sort(),e.sort();for(var n=0,i=t.length;n<i;n++)if(t[n]!==e[n])return!1;return!0}function f(t){return t.replace(/^\/+|\/+$/g,"")}function m(t){return escape(t)}function g(t){return encodeURIComponent(t).replace(/[!'()*]/g,m).replace(/\*/g,"%2A")}s._parts=function(){return{protocol:null,username:null,password:null,hostname:null,urn:null,port:null,path:null,query:null,fragment:null,preventInvalidHostname:s.preventInvalidHostname,duplicateQueryParameters:s.duplicateQueryParameters,escapeQuerySpace:s.escapeQuerySpace}},s.preventInvalidHostname=!1,s.duplicateQueryParameters=!1,s.escapeQuerySpace=!0,s.protocol_expression=/^[a-z][a-z0-9.+-]*$/i,s.idn_expression=/[^a-z0-9\._-]/i,s.punycode_expression=/(xn--)/i,s.ip4_expression=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,s.ip6_expression=/^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/,s.find_uri_expression=/\b((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))/gi,s.findUri={start:/\b(?:([a-z][a-z0-9.+-]*:\/\/)|www\.)/gi,end:/[\s\r\n]|$/,trim:/[`!()\[\]{};:'".,<>?«»“”„‘’]+$/,parens:/(\([^\)]*\)|\[[^\]]*\]|\{[^}]*\}|<[^>]*>)/g},s.leading_whitespace_expression=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,s.defaultPorts={http:"80",https:"443",ftp:"21",gopher:"70",ws:"80",wss:"443"},s.hostProtocols=["http","https"],s.invalid_hostname_characters=/[^a-zA-Z0-9\.\-:_]/,s.domAttributes={a:"href",blockquote:"cite",link:"href",base:"href",script:"src",form:"action",img:"src",area:"href",iframe:"src",embed:"src",source:"src",track:"src",input:"src",audio:"src",video:"src"},s.getDomAttribute=function(t){if(t&&t.nodeName){var e=t.nodeName.toLowerCase();if("input"!==e||"image"===t.type)return s.domAttributes[e]}},s.encode=g,s.decode=decodeURIComponent,s.iso8859=function(){s.encode=escape,s.decode=unescape},s.unicode=function(){s.encode=g,s.decode=decodeURIComponent},s.characters={pathname:{encode:{expression:/%(24|26|2B|2C|3B|3D|3A|40)/gi,map:{"%24":"$","%26":"&","%2B":"+","%2C":",","%3B":";","%3D":"=","%3A":":","%40":"@"}},decode:{expression:/[\/\?#]/g,map:{"/":"%2F","?":"%3F","#":"%23"}}},reserved:{encode:{expression:/%(21|23|24|26|27|28|29|2A|2B|2C|2F|3A|3B|3D|3F|40|5B|5D)/gi,map:{"%3A":":","%2F":"/","%3F":"?","%23":"#","%5B":"[","%5D":"]","%40":"@","%21":"!","%24":"$","%26":"&","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"="}}},urnpath:{encode:{expression:/%(21|24|27|28|29|2A|2B|2C|3B|3D|40)/gi,map:{"%21":"!","%24":"$","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"=","%40":"@"}},decode:{expression:/[\/\?#:]/g,map:{"/":"%2F","?":"%3F","#":"%23",":":"%3A"}}}},s.encodeQuery=function(t,e){var n=s.encode(t+"");return void 0===e&&(e=s.escapeQuerySpace),e?n.replace(/%20/g,"+"):n},s.decodeQuery=function(t,e){t+="",void 0===e&&(e=s.escapeQuerySpace);try{return s.decode(e?t.replace(/\+/g,"%20"):t)}catch(e){return t}};var v,y={encode:"encode",decode:"decode"},b=function(t,e){return function(n){try{return s[e](n+"").replace(s.characters[t][e].expression,(function(n){return s.characters[t][e].map[n]}))}catch(t){return n}}};for(v in y)s[v+"PathSegment"]=b("pathname",y[v]),s[v+"UrnPathSegment"]=b("urnpath",y[v]);var w=function(t,e,n){return function(i){var o;o=n?function(t){return s[e](s[n](t))}:s[e];for(var r=(i+"").split(t),a=0,l=r.length;a<l;a++)r[a]=o(r[a]);return r.join(t)}};function x(t){return function(e,n){return void 0===e?this._parts[t]||"":(this._parts[t]=e||null,this.build(!n),this)}}function k(t,e){return function(n,i){return void 0===n?this._parts[t]||"":(null!==n&&(n+="").charAt(0)===e&&(n=n.substring(1)),this._parts[t]=n,this.build(!i),this)}}s.decodePath=w("/","decodePathSegment"),s.decodeUrnPath=w(":","decodeUrnPathSegment"),s.recodePath=w("/","encodePathSegment","decode"),s.recodeUrnPath=w(":","encodeUrnPathSegment","decode"),s.encodeReserved=b("reserved","encode"),s.parse=function(t,e){var n;return e||(e={preventInvalidHostname:s.preventInvalidHostname}),(n=(t=t.replace(s.leading_whitespace_expression,"")).indexOf("#"))>-1&&(e.fragment=t.substring(n+1)||null,t=t.substring(0,n)),(n=t.indexOf("?"))>-1&&(e.query=t.substring(n+1)||null,t=t.substring(0,n)),"//"===(t=t.replace(/^(https?|ftp|wss?)?:+[/\\]*/i,"$1://")).substring(0,2)?(e.protocol=null,t=t.substring(2),t=s.parseAuthority(t,e)):(n=t.indexOf(":"))>-1&&(e.protocol=t.substring(0,n)||null,e.protocol&&!e.protocol.match(s.protocol_expression)?e.protocol=void 0:"//"===t.substring(n+1,n+3).replace(/\\/g,"/")?(t=t.substring(n+3),t=s.parseAuthority(t,e)):(t=t.substring(n+1),e.urn=!0)),e.path=t,e},s.parseHost=function(t,e){t||(t="");var n,i,o=(t=t.replace(/\\/g,"/")).indexOf("/");if(-1===o&&(o=t.length),"["===t.charAt(0))n=t.indexOf("]"),e.hostname=t.substring(1,n)||null,e.port=t.substring(n+2,o)||null,"/"===e.port&&(e.port=null);else{var r=t.indexOf(":"),a=t.indexOf("/"),l=t.indexOf(":",r+1);-1!==l&&(-1===a||l<a)?(e.hostname=t.substring(0,o)||null,e.port=null):(i=t.substring(0,o).split(":"),e.hostname=i[0]||null,e.port=i[1]||null)}return e.hostname&&"/"!==t.substring(o).charAt(0)&&(o++,t="/"+t),e.preventInvalidHostname&&s.ensureValidHostname(e.hostname,e.protocol),e.port&&s.ensureValidPort(e.port),t.substring(o)||"/"},s.parseAuthority=function(t,e){return t=s.parseUserinfo(t,e),s.parseHost(t,e)},s.parseUserinfo=function(t,e){var n=t;-1!==t.indexOf("\\")&&(t=t.replace(/\\/g,"/"));var i,o=t.indexOf("/"),r=t.lastIndexOf("@",o>-1?o:t.length-1);return r>-1&&(-1===o||r<o)?(i=t.substring(0,r).split(":"),e.username=i[0]?s.decode(i[0]):null,i.shift(),e.password=i[0]?s.decode(i.join(":")):null,t=n.substring(r+1)):(e.username=null,e.password=null),t},s.parseQuery=function(t,e){if(!t)return{};if(!(t=t.replace(/&+/g,"&").replace(/^\?*&*|&+$/g,"")))return{};for(var n,i,o,r={},l=t.split("&"),c=l.length,d=0;d<c;d++)n=l[d].split("="),i=s.decodeQuery(n.shift(),e),o=n.length?s.decodeQuery(n.join("="),e):null,"__proto__"!==i&&(a.call(r,i)?("string"!=typeof r[i]&&null!==r[i]||(r[i]=[r[i]]),r[i].push(o)):r[i]=o);return r},s.build=function(t){var e="",n=!1;return t.protocol&&(e+=t.protocol+":"),t.urn||!e&&!t.hostname||(e+="//",n=!0),e+=s.buildAuthority(t)||"","string"==typeof t.path&&("/"!==t.path.charAt(0)&&n&&(e+="/"),e+=t.path),"string"==typeof t.query&&t.query&&(e+="?"+t.query),"string"==typeof t.fragment&&t.fragment&&(e+="#"+t.fragment),e},s.buildHost=function(t){var e="";return t.hostname?(s.ip6_expression.test(t.hostname)?e+="["+t.hostname+"]":e+=t.hostname,t.port&&(e+=":"+t.port),e):""},s.buildAuthority=function(t){return s.buildUserinfo(t)+s.buildHost(t)},s.buildUserinfo=function(t){var e="";return t.username&&(e+=s.encode(t.username)),t.password&&(e+=":"+s.encode(t.password)),e&&(e+="@"),e},s.buildQuery=function(t,e,n){var i,o,r,l,c="";for(o in t)if("__proto__"!==o&&a.call(t,o))if(d(t[o]))for(i={},r=0,l=t[o].length;r<l;r++)void 0!==t[o][r]&&void 0===i[t[o][r]+""]&&(c+="&"+s.buildQueryParameter(o,t[o][r],n),!0!==e&&(i[t[o][r]+""]=!0));else void 0!==t[o]&&(c+="&"+s.buildQueryParameter(o,t[o],n));return c.substring(1)},s.buildQueryParameter=function(t,e,n){return s.encodeQuery(t,n)+(null!==e?"="+s.encodeQuery(e,n):"")},s.addQuery=function(t,e,n){if("object"==typeof e)for(var i in e)a.call(e,i)&&s.addQuery(t,i,e[i]);else{if("string"!=typeof e)throw new TypeError("URI.addQuery() accepts an object, string as the name parameter");if(void 0===t[e])return void(t[e]=n);"string"==typeof t[e]&&(t[e]=[t[e]]),d(n)||(n=[n]),t[e]=(t[e]||[]).concat(n)}},s.setQuery=function(t,e,n){if("object"==typeof e)for(var i in e)a.call(e,i)&&s.setQuery(t,i,e[i]);else{if("string"!=typeof e)throw new TypeError("URI.setQuery() accepts an object, string as the name parameter");t[e]=void 0===n?null:n}},s.removeQuery=function(t,e,n){var i,o,r;if(d(e))for(i=0,o=e.length;i<o;i++)t[e[i]]=void 0;else if("RegExp"===c(e))for(r in t)e.test(r)&&(t[r]=void 0);else if("object"==typeof e)for(r in e)a.call(e,r)&&s.removeQuery(t,r,e[r]);else{if("string"!=typeof e)throw new TypeError("URI.removeQuery() accepts an object, string, RegExp as the first parameter");void 0!==n?"RegExp"===c(n)?!d(t[e])&&n.test(t[e])?t[e]=void 0:t[e]=u(t[e],n):t[e]!==String(n)||d(n)&&1!==n.length?d(t[e])&&(t[e]=u(t[e],n)):t[e]=void 0:t[e]=void 0}},s.hasQuery=function(t,e,n,i){switch(c(e)){case"String":break;case"RegExp":for(var o in t)if(a.call(t,o)&&e.test(o)&&(void 0===n||s.hasQuery(t,o,n)))return!0;return!1;case"Object":for(var r in e)if(a.call(e,r)&&!s.hasQuery(t,r,e[r]))return!1;return!0;default:throw new TypeError("URI.hasQuery() accepts a string, regular expression or object as the name parameter")}switch(c(n)){case"Undefined":return e in t;case"Boolean":return n===Boolean(d(t[e])?t[e].length:t[e]);case"Function":return!!n(t[e],e,t);case"Array":return!!d(t[e])&&(i?p:h)(t[e],n);case"RegExp":return d(t[e])?!!i&&p(t[e],n):Boolean(t[e]&&t[e].match(n));case"Number":n=String(n);case"String":return d(t[e])?!!i&&p(t[e],n):t[e]===n;default:throw new TypeError("URI.hasQuery() accepts undefined, boolean, string, number, RegExp, Function as the value parameter")}},s.joinPaths=function(){for(var t=[],e=[],n=0,i=0;i<arguments.length;i++){var o=new s(arguments[i]);t.push(o);for(var r=o.segment(),a=0;a<r.length;a++)"string"==typeof r[a]&&e.push(r[a]),r[a]&&n++}if(!e.length||!n)return new s("");var l=new s("").segment(e);return""!==t[0].path()&&"/"!==t[0].path().slice(0,1)||l.path("/"+l.path()),l.normalize()},s.commonPath=function(t,e){var n,i=Math.min(t.length,e.length);for(n=0;n<i;n++)if(t.charAt(n)!==e.charAt(n)){n--;break}return n<1?t.charAt(0)===e.charAt(0)&&"/"===t.charAt(0)?"/":"":("/"===t.charAt(n)&&"/"===e.charAt(n)||(n=t.substring(0,n).lastIndexOf("/")),t.substring(0,n+1))},s.withinString=function(t,e,n){n||(n={});var i=n.start||s.findUri.start,o=n.end||s.findUri.end,r=n.trim||s.findUri.trim,a=n.parens||s.findUri.parens,l=/[a-z0-9-]=["']?$/i;for(i.lastIndex=0;;){var c=i.exec(t);if(!c)break;var d=c.index;if(n.ignoreHtml){var u=t.slice(Math.max(d-3,0),d);if(u&&l.test(u))continue}for(var p=d+t.slice(d).search(o),h=t.slice(d,p),f=-1;;){var m=a.exec(h);if(!m)break;var g=m.index+m[0].length;f=Math.max(f,g)}if(!((h=f>-1?h.slice(0,f)+h.slice(f).replace(r,""):h.replace(r,"")).length<=c[0].length||n.ignore&&n.ignore.test(h))){var v=e(h,d,p=d+h.length,t);void 0!==v?(v=String(v),t=t.slice(0,d)+v+t.slice(p),i.lastIndex=d+v.length):i.lastIndex=p}}return i.lastIndex=0,t},s.ensureValidHostname=function(e,n){var i=!!e,o=!1;if(!!n&&(o=p(s.hostProtocols,n)),o&&!i)throw new TypeError("Hostname cannot be empty, if protocol is "+n);if(e&&e.match(s.invalid_hostname_characters)){if(!t)throw new TypeError('Hostname "'+e+'" contains characters other than [A-Z0-9.-:_] and Punycode.js is not available');if(t.toASCII(e).match(s.invalid_hostname_characters))throw new TypeError('Hostname "'+e+'" contains characters other than [A-Z0-9.-:_]')}},s.ensureValidPort=function(t){if(t){var e=Number(t);if(!(/^[0-9]+$/.test(e)&&e>0&&e<65536))throw new TypeError('Port "'+t+'" is not a valid port')}},s.noConflict=function(t){if(t){var e={URI:this.noConflict()};return i.URITemplate&&"function"==typeof i.URITemplate.noConflict&&(e.URITemplate=i.URITemplate.noConflict()),i.IPv6&&"function"==typeof i.IPv6.noConflict&&(e.IPv6=i.IPv6.noConflict()),i.SecondLevelDomains&&"function"==typeof i.SecondLevelDomains.noConflict&&(e.SecondLevelDomains=i.SecondLevelDomains.noConflict()),e}return i.URI===this&&(i.URI=o),this},r.build=function(t){return!0===t?this._deferred_build=!0:(void 0===t||this._deferred_build)&&(this._string=s.build(this._parts),this._deferred_build=!1),this},r.clone=function(){return new s(this)},r.valueOf=r.toString=function(){return this.build(!1)._string},r.protocol=x("protocol"),r.username=x("username"),r.password=x("password"),r.hostname=x("hostname"),r.port=x("port"),r.query=k("query","?"),r.fragment=k("fragment","#"),r.search=function(t,e){var n=this.query(t,e);return"string"==typeof n&&n.length?"?"+n:n},r.hash=function(t,e){var n=this.fragment(t,e);return"string"==typeof n&&n.length?"#"+n:n},r.pathname=function(t,e){if(void 0===t||!0===t){var n=this._parts.path||(this._parts.hostname?"/":"");return t?(this._parts.urn?s.decodeUrnPath:s.decodePath)(n):n}return this._parts.urn?this._parts.path=t?s.recodeUrnPath(t):"":this._parts.path=t?s.recodePath(t):"/",this.build(!e),this},r.path=r.pathname,r.href=function(t,e){var n;if(void 0===t)return this.toString();this._string="",this._parts=s._parts();var i=t instanceof s,o="object"==typeof t&&(t.hostname||t.path||t.pathname);t.nodeName&&(t=t[s.getDomAttribute(t)]||"",o=!1);if(!i&&o&&void 0!==t.pathname&&(t=t.toString()),"string"==typeof t||t instanceof String)this._parts=s.parse(String(t),this._parts);else{if(!i&&!o)throw new TypeError("invalid input");var r=i?t._parts:t;for(n in r)"query"!==n&&a.call(this._parts,n)&&(this._parts[n]=r[n]);r.query&&this.query(r.query,!1)}return this.build(!e),this},r.is=function(t){var e=!1,i=!1,o=!1,r=!1,a=!1,l=!1,c=!1,d=!this._parts.urn;switch(this._parts.hostname&&(d=!1,i=s.ip4_expression.test(this._parts.hostname),o=s.ip6_expression.test(this._parts.hostname),a=(r=!(e=i||o))&&n&&n.has(this._parts.hostname),l=r&&s.idn_expression.test(this._parts.hostname),c=r&&s.punycode_expression.test(this._parts.hostname)),t.toLowerCase()){case"relative":return d;case"absolute":return!d;case"domain":case"name":return r;case"sld":return a;case"ip":return e;case"ip4":case"ipv4":case"inet4":return i;case"ip6":case"ipv6":case"inet6":return o;case"idn":return l;case"url":return!this._parts.urn;case"urn":return!!this._parts.urn;case"punycode":return c}return null};var C=r.protocol,$=r.port,S=r.hostname;r.protocol=function(t,e){if(t&&!(t=t.replace(/:(\/\/)?$/,"")).match(s.protocol_expression))throw new TypeError('Protocol "'+t+"\" contains characters other than [A-Z0-9.+-] or doesn't start with [A-Z]");return C.call(this,t,e)},r.scheme=r.protocol,r.port=function(t,e){return this._parts.urn?void 0===t?"":this:(void 0!==t&&(0===t&&(t=null),t&&(":"===(t+="").charAt(0)&&(t=t.substring(1)),s.ensureValidPort(t))),$.call(this,t,e))},r.hostname=function(t,e){if(this._parts.urn)return void 0===t?"":this;if(void 0!==t){var n={preventInvalidHostname:this._parts.preventInvalidHostname};if("/"!==s.parseHost(t,n))throw new TypeError('Hostname "'+t+'" contains characters other than [A-Z0-9.-]');t=n.hostname,this._parts.preventInvalidHostname&&s.ensureValidHostname(t,this._parts.protocol)}return S.call(this,t,e)},r.origin=function(t,e){if(this._parts.urn)return void 0===t?"":this;if(void 0===t){var n=this.protocol();return this.authority()?(n?n+"://":"")+this.authority():""}var i=s(t);return this.protocol(i.protocol()).authority(i.authority()).build(!e),this},r.host=function(t,e){if(this._parts.urn)return void 0===t?"":this;if(void 0===t)return this._parts.hostname?s.buildHost(this._parts):"";if("/"!==s.parseHost(t,this._parts))throw new TypeError('Hostname "'+t+'" contains characters other than [A-Z0-9.-]');return this.build(!e),this},r.authority=function(t,e){if(this._parts.urn)return void 0===t?"":this;if(void 0===t)return this._parts.hostname?s.buildAuthority(this._parts):"";if("/"!==s.parseAuthority(t,this._parts))throw new TypeError('Hostname "'+t+'" contains characters other than [A-Z0-9.-]');return this.build(!e),this},r.userinfo=function(t,e){if(this._parts.urn)return void 0===t?"":this;if(void 0===t){var n=s.buildUserinfo(this._parts);return n?n.substring(0,n.length-1):n}return"@"!==t[t.length-1]&&(t+="@"),s.parseUserinfo(t,this._parts),this.build(!e),this},r.resource=function(t,e){var n;return void 0===t?this.path()+this.search()+this.hash():(n=s.parse(t),this._parts.path=n.path,this._parts.query=n.query,this._parts.fragment=n.fragment,this.build(!e),this)},r.subdomain=function(t,e){if(this._parts.urn)return void 0===t?"":this;if(void 0===t){if(!this._parts.hostname||this.is("IP"))return"";var n=this._parts.hostname.length-this.domain().length-1;return this._parts.hostname.substring(0,n)||""}var i=this._parts.hostname.length-this.domain().length,o=this._parts.hostname.substring(0,i),r=new RegExp("^"+l(o));if(t&&"."!==t.charAt(t.length-1)&&(t+="."),-1!==t.indexOf(":"))throw new TypeError("Domains cannot contain colons");return t&&s.ensureValidHostname(t,this._parts.protocol),this._parts.hostname=this._parts.hostname.replace(r,t),this.build(!e),this},r.domain=function(t,e){if(this._parts.urn)return void 0===t?"":this;if("boolean"==typeof t&&(e=t,t=void 0),void 0===t){if(!this._parts.hostname||this.is("IP"))return"";var n=this._parts.hostname.match(/\./g);if(n&&n.length<2)return this._parts.hostname;var i=this._parts.hostname.length-this.tld(e).length-1;return i=this._parts.hostname.lastIndexOf(".",i-1)+1,this._parts.hostname.substring(i)||""}if(!t)throw new TypeError("cannot set domain empty");if(-1!==t.indexOf(":"))throw new TypeError("Domains cannot contain colons");if(s.ensureValidHostname(t,this._parts.protocol),!this._parts.hostname||this.is("IP"))this._parts.hostname=t;else{var o=new RegExp(l(this.domain())+"$");this._parts.hostname=this._parts.hostname.replace(o,t)}return this.build(!e),this},r.tld=function(t,e){if(this._parts.urn)return void 0===t?"":this;if("boolean"==typeof t&&(e=t,t=void 0),void 0===t){if(!this._parts.hostname||this.is("IP"))return"";var i=this._parts.hostname.lastIndexOf("."),o=this._parts.hostname.substring(i+1);return!0!==e&&n&&n.list[o.toLowerCase()]&&n.get(this._parts.hostname)||o}var s;if(!t)throw new TypeError("cannot set TLD empty");if(t.match(/[^a-zA-Z0-9-]/)){if(!n||!n.is(t))throw new TypeError('TLD "'+t+'" contains characters other than [A-Z0-9]');s=new RegExp(l(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(s,t)}else{if(!this._parts.hostname||this.is("IP"))throw new ReferenceError("cannot set TLD on non-domain host");s=new RegExp(l(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(s,t)}return this.build(!e),this},r.directory=function(t,e){if(this._parts.urn)return void 0===t?"":this;if(void 0===t||!0===t){if(!this._parts.path&&!this._parts.hostname)return"";if("/"===this._parts.path)return"/";var n=this._parts.path.length-this.filename().length-1,i=this._parts.path.substring(0,n)||(this._parts.hostname?"/":"");return t?s.decodePath(i):i}var o=this._parts.path.length-this.filename().length,r=this._parts.path.substring(0,o),a=new RegExp("^"+l(r));return this.is("relative")||(t||(t="/"),"/"!==t.charAt(0)&&(t="/"+t)),t&&"/"!==t.charAt(t.length-1)&&(t+="/"),t=s.recodePath(t),this._parts.path=this._parts.path.replace(a,t),this.build(!e),this},r.filename=function(t,e){if(this._parts.urn)return void 0===t?"":this;if("string"!=typeof t){if(!this._parts.path||"/"===this._parts.path)return"";var n=this._parts.path.lastIndexOf("/"),i=this._parts.path.substring(n+1);return t?s.decodePathSegment(i):i}var o=!1;"/"===t.charAt(0)&&(t=t.substring(1)),t.match(/\.?\//)&&(o=!0);var r=new RegExp(l(this.filename())+"$");return t=s.recodePath(t),this._parts.path=this._parts.path.replace(r,t),o?this.normalizePath(e):this.build(!e),this},r.suffix=function(t,e){if(this._parts.urn)return void 0===t?"":this;if(void 0===t||!0===t){if(!this._parts.path||"/"===this._parts.path)return"";var n,i,o=this.filename(),r=o.lastIndexOf(".");return-1===r?"":(n=o.substring(r+1),i=/^[a-z0-9%]+$/i.test(n)?n:"",t?s.decodePathSegment(i):i)}"."===t.charAt(0)&&(t=t.substring(1));var a,c=this.suffix();if(c)a=t?new RegExp(l(c)+"$"):new RegExp(l("."+c)+"$");else{if(!t)return this;this._parts.path+="."+s.recodePath(t)}return a&&(t=s.recodePath(t),this._parts.path=this._parts.path.replace(a,t)),this.build(!e),this},r.segment=function(t,e,n){var i=this._parts.urn?":":"/",o=this.path(),s="/"===o.substring(0,1),r=o.split(i);if(void 0!==t&&"number"!=typeof t&&(n=e,e=t,t=void 0),void 0!==t&&"number"!=typeof t)throw new Error('Bad segment "'+t+'", must be 0-based integer');if(s&&r.shift(),t<0&&(t=Math.max(r.length+t,0)),void 0===e)return void 0===t?r:r[t];if(null===t||void 0===r[t])if(d(e)){r=[];for(var a=0,l=e.length;a<l;a++)(e[a].length||r.length&&r[r.length-1].length)&&(r.length&&!r[r.length-1].length&&r.pop(),r.push(f(e[a])))}else(e||"string"==typeof e)&&(e=f(e),""===r[r.length-1]?r[r.length-1]=e:r.push(e));else e?r[t]=f(e):r.splice(t,1);return s&&r.unshift(""),this.path(r.join(i),n)},r.segmentCoded=function(t,e,n){var i,o,r;if("number"!=typeof t&&(n=e,e=t,t=void 0),void 0===e){if(d(i=this.segment(t,e,n)))for(o=0,r=i.length;o<r;o++)i[o]=s.decode(i[o]);else i=void 0!==i?s.decode(i):void 0;return i}if(d(e))for(o=0,r=e.length;o<r;o++)e[o]=s.encode(e[o]);else e="string"==typeof e||e instanceof String?s.encode(e):e;return this.segment(t,e,n)};var T=r.query;return r.query=function(t,e){if(!0===t)return s.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if("function"==typeof t){var n=s.parseQuery(this._parts.query,this._parts.escapeQuerySpace),i=t.call(this,n);return this._parts.query=s.buildQuery(i||n,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!e),this}return void 0!==t&&"string"!=typeof t?(this._parts.query=s.buildQuery(t,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!e),this):T.call(this,t,e)},r.setQuery=function(t,e,n){var i=s.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if("string"==typeof t||t instanceof String)i[t]=void 0!==e?e:null;else{if("object"!=typeof t)throw new TypeError("URI.addQuery() accepts an object, string as the name parameter");for(var o in t)a.call(t,o)&&(i[o]=t[o])}return this._parts.query=s.buildQuery(i,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),"string"!=typeof t&&(n=e),this.build(!n),this},r.addQuery=function(t,e,n){var i=s.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return s.addQuery(i,t,void 0===e?null:e),this._parts.query=s.buildQuery(i,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),"string"!=typeof t&&(n=e),this.build(!n),this},r.removeQuery=function(t,e,n){var i=s.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return s.removeQuery(i,t,e),this._parts.query=s.buildQuery(i,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),"string"!=typeof t&&(n=e),this.build(!n),this},r.hasQuery=function(t,e,n){var i=s.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return s.hasQuery(i,t,e,n)},r.setSearch=r.setQuery,r.addSearch=r.addQuery,r.removeSearch=r.removeQuery,r.hasSearch=r.hasQuery,r.normalize=function(){return this._parts.urn?this.normalizeProtocol(!1).normalizePath(!1).normalizeQuery(!1).normalizeFragment(!1).build():this.normalizeProtocol(!1).normalizeHostname(!1).normalizePort(!1).normalizePath(!1).normalizeQuery(!1).normalizeFragment(!1).build()},r.normalizeProtocol=function(t){return"string"==typeof this._parts.protocol&&(this._parts.protocol=this._parts.protocol.toLowerCase(),this.build(!t)),this},r.normalizeHostname=function(n){return this._parts.hostname&&(this.is("IDN")&&t?this._parts.hostname=t.toASCII(this._parts.hostname):this.is("IPv6")&&e&&(this._parts.hostname=e.best(this._parts.hostname)),this._parts.hostname=this._parts.hostname.toLowerCase(),this.build(!n)),this},r.normalizePort=function(t){return"string"==typeof this._parts.protocol&&this._parts.port===s.defaultPorts[this._parts.protocol]&&(this._parts.port=null,this.build(!t)),this},r.normalizePath=function(t){var e,n=this._parts.path;if(!n)return this;if(this._parts.urn)return this._parts.path=s.recodeUrnPath(this._parts.path),this.build(!t),this;if("/"===this._parts.path)return this;var i,o,r="";for("/"!==(n=s.recodePath(n)).charAt(0)&&(e=!0,n="/"+n),"/.."!==n.slice(-3)&&"/."!==n.slice(-2)||(n+="/"),n=n.replace(/(\/(\.\/)+)|(\/\.$)/g,"/").replace(/\/{2,}/g,"/"),e&&(r=n.substring(1).match(/^(\.\.\/)+/)||"")&&(r=r[0]);-1!==(i=n.search(/\/\.\.(\/|$)/));)0!==i?(-1===(o=n.substring(0,i).lastIndexOf("/"))&&(o=i),n=n.substring(0,o)+n.substring(i+3)):n=n.substring(3);return e&&this.is("relative")&&(n=r+n.substring(1)),this._parts.path=n,this.build(!t),this},r.normalizePathname=r.normalizePath,r.normalizeQuery=function(t){return"string"==typeof this._parts.query&&(this._parts.query.length?this.query(s.parseQuery(this._parts.query,this._parts.escapeQuerySpace)):this._parts.query=null,this.build(!t)),this},r.normalizeFragment=function(t){return this._parts.fragment||(this._parts.fragment=null,this.build(!t)),this},r.normalizeSearch=r.normalizeQuery,r.normalizeHash=r.normalizeFragment,r.iso8859=function(){var t=s.encode,e=s.decode;s.encode=escape,s.decode=decodeURIComponent;try{this.normalize()}finally{s.encode=t,s.decode=e}return this},r.unicode=function(){var t=s.encode,e=s.decode;s.encode=g,s.decode=unescape;try{this.normalize()}finally{s.encode=t,s.decode=e}return this},r.readable=function(){var e=this.clone();e.username("").password("").normalize();var n="";if(e._parts.protocol&&(n+=e._parts.protocol+"://"),e._parts.hostname&&(e.is("punycode")&&t?(n+=t.toUnicode(e._parts.hostname),e._parts.port&&(n+=":"+e._parts.port)):n+=e.host()),e._parts.hostname&&e._parts.path&&"/"!==e._parts.path.charAt(0)&&(n+="/"),n+=e.path(!0),e._parts.query){for(var i="",o=0,r=e._parts.query.split("&"),a=r.length;o<a;o++){var l=(r[o]||"").split("=");i+="&"+s.decodeQuery(l[0],this._parts.escapeQuerySpace).replace(/&/g,"%26"),void 0!==l[1]&&(i+="="+s.decodeQuery(l[1],this._parts.escapeQuerySpace).replace(/&/g,"%26"))}n+="?"+i.substring(1)}return n+=s.decodeQuery(e.hash(),!0)},r.absoluteTo=function(t){var e,n,i,o=this.clone(),r=["protocol","username","password","hostname","port"];if(this._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(t instanceof s||(t=new s(t)),o._parts.protocol)return o;if(o._parts.protocol=t._parts.protocol,this._parts.hostname)return o;for(n=0;i=r[n];n++)o._parts[i]=t._parts[i];return o._parts.path?(".."===o._parts.path.substring(-2)&&(o._parts.path+="/"),"/"!==o.path().charAt(0)&&(e=(e=t.directory())||(0===t.path().indexOf("/")?"/":""),o._parts.path=(e?e+"/":"")+o._parts.path,o.normalizePath())):(o._parts.path=t._parts.path,o._parts.query||(o._parts.query=t._parts.query)),o.build(),o},r.relativeTo=function(t){var e,n,i,o,r,a=this.clone().normalize();if(a._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(t=new s(t).normalize(),e=a._parts,n=t._parts,o=a.path(),r=t.path(),"/"!==o.charAt(0))throw new Error("URI is already relative");if("/"!==r.charAt(0))throw new Error("Cannot calculate a URI relative to another relative URI");if(e.protocol===n.protocol&&(e.protocol=null),e.username!==n.username||e.password!==n.password)return a.build();if(null!==e.protocol||null!==e.username||null!==e.password)return a.build();if(e.hostname!==n.hostname||e.port!==n.port)return a.build();if(e.hostname=null,e.port=null,o===r)return e.path="",a.build();if(!(i=s.commonPath(o,r)))return a.build();var l=n.path.substring(i.length).replace(/[^\/]*$/,"").replace(/.*?\//g,"../");return e.path=l+e.path.substring(i.length)||"./",a.build()},r.equals=function(t){var e,n,i,o,r,l=this.clone(),c=new s(t),u={};if(l.normalize(),c.normalize(),l.toString()===c.toString())return!0;if(i=l.query(),o=c.query(),l.query(""),c.query(""),l.toString()!==c.toString())return!1;if(i.length!==o.length)return!1;for(r in e=s.parseQuery(i,this._parts.escapeQuerySpace),n=s.parseQuery(o,this._parts.escapeQuerySpace),e)if(a.call(e,r)){if(d(e[r])){if(!h(e[r],n[r]))return!1}else if(e[r]!==n[r])return!1;u[r]=!0}for(r in n)if(a.call(n,r)&&!u[r])return!1;return!0},r.preventInvalidHostname=function(t){return this._parts.preventInvalidHostname=!!t,this},r.duplicateQueryParameters=function(t){return this._parts.duplicateQueryParameters=!!t,this},r.escapeQuerySpace=function(t){return this._parts.escapeQuerySpace=!!t,this},s}))},,function(t,e,n){var i,o;i=[n(0)],o=function(t){!function(t){"use strict";var e,n,i,o;function s(e){var n=[{re:/[\xC0-\xC6]/g,ch:"A"},{re:/[\xE0-\xE6]/g,ch:"a"},{re:/[\xC8-\xCB]/g,ch:"E"},{re:/[\xE8-\xEB]/g,ch:"e"},{re:/[\xCC-\xCF]/g,ch:"I"},{re:/[\xEC-\xEF]/g,ch:"i"},{re:/[\xD2-\xD6]/g,ch:"O"},{re:/[\xF2-\xF6]/g,ch:"o"},{re:/[\xD9-\xDC]/g,ch:"U"},{re:/[\xF9-\xFC]/g,ch:"u"},{re:/[\xC7-\xE7]/g,ch:"c"},{re:/[\xD1]/g,ch:"N"},{re:/[\xF1]/g,ch:"n"}];return t.each(n,(function(){e=e.replace(this.re,this.ch)})),e}function r(t){var e={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},n="(?:"+Object.keys(e).join("|")+")",i=new RegExp(n),o=new RegExp(n,"g"),s=null==t?"":""+t;return i.test(s)?s.replace(o,(function(t){return e[t]})):s}String.prototype.includes||(e={}.toString,n=function(){try{var t={},e=Object.defineProperty,n=e(t,t,t)&&e}catch(t){}return n}(),i="".indexOf,o=function(t){if(null==this)throw new TypeError;var n=String(this);if(t&&"[object RegExp]"==e.call(t))throw new TypeError;var o=n.length,s=String(t),r=s.length,a=arguments.length>1?arguments[1]:void 0,l=a?Number(a):0;return l!=l&&(l=0),!(r+Math.min(Math.max(l,0),o)>o)&&-1!=i.call(n,s,l)},n?n(String.prototype,"includes",{value:o,configurable:!0,writable:!0}):String.prototype.includes=o),String.prototype.startsWith||function(){var t=function(){try{var t={},e=Object.defineProperty,n=e(t,t,t)&&e}catch(t){}return n}(),e={}.toString,n=function(t){if(null==this)throw new TypeError;var n=String(this);if(t&&"[object RegExp]"==e.call(t))throw new TypeError;var i=n.length,o=String(t),s=o.length,r=arguments.length>1?arguments[1]:void 0,a=r?Number(r):0;a!=a&&(a=0);var l=Math.min(Math.max(a,0),i);if(s+l>i)return!1;for(var c=-1;++c<s;)if(n.charCodeAt(l+c)!=o.charCodeAt(c))return!1;return!0};t?t(String.prototype,"startsWith",{value:n,configurable:!0,writable:!0}):String.prototype.startsWith=n}(),Object.keys||(Object.keys=function(t,e,n){for(e in n=[],t)n.hasOwnProperty.call(t,e)&&n.push(e);return n}),t.fn.triggerNative=function(t){var e,n=this[0];n.dispatchEvent?("function"==typeof Event?e=new Event(t,{bubbles:!0}):(e=document.createEvent("Event")).initEvent(t,!0,!1),n.dispatchEvent(e)):(n.fireEvent&&((e=document.createEventObject()).eventType=t,n.fireEvent("on"+t,e)),this.trigger(t))},t.expr[":"].icontains=function(e,n,i){var o=t(e);return(o.data("tokens")||o.text()).toUpperCase().includes(i[3].toUpperCase())},t.expr[":"].ibegins=function(e,n,i){var o=t(e);return(o.data("tokens")||o.text()).toUpperCase().startsWith(i[3].toUpperCase())},t.expr[":"].aicontains=function(e,n,i){var o=t(e);return(o.data("tokens")||o.data("normalizedText")||o.text()).toUpperCase().includes(i[3].toUpperCase())},t.expr[":"].aibegins=function(e,n,i){var o=t(e);return(o.data("tokens")||o.data("normalizedText")||o.text()).toUpperCase().startsWith(i[3].toUpperCase())};var a=function(e,n,i){i&&(i.stopPropagation(),i.preventDefault()),this.$element=t(e),this.$newElement=null,this.$button=null,this.$menu=null,this.$lis=null,this.options=n,null===this.options.title&&(this.options.title=this.$element.attr("title")),this.val=a.prototype.val,this.render=a.prototype.render,this.refresh=a.prototype.refresh,this.setStyle=a.prototype.setStyle,this.selectAll=a.prototype.selectAll,this.deselectAll=a.prototype.deselectAll,this.destroy=a.prototype.remove,this.remove=a.prototype.remove,this.show=a.prototype.show,this.hide=a.prototype.hide,this.init()};function l(e,n){var i,o=arguments,s=e,r=n;[].shift.apply(o);var l=this.each((function(){var e=t(this);if(e.is("select")){var n=e.data("selectpicker"),l="object"==typeof s&&s;if(n){if(l)for(var c in l)l.hasOwnProperty(c)&&(n.options[c]=l[c])}else{var d=t.extend({},a.DEFAULTS,t.fn.selectpicker.defaults||{},e.data(),l);d.template=t.extend({},a.DEFAULTS.template,t.fn.selectpicker.defaults?t.fn.selectpicker.defaults.template:{},e.data().template,l.template),e.data("selectpicker",n=new a(this,d,r))}"string"==typeof s&&(i=n[s]instanceof Function?n[s].apply(n,o):n.options[s])}}));return void 0!==i?i:l}a.VERSION="1.7.5",a.DEFAULTS={noneSelectedText:"Nothing selected",noneResultsText:"No results matched {0}",countSelectedText:function(t,e){return 1==t?"{0} item selected":"{0} items selected"},maxOptionsText:function(t,e){return[1==t?"Limit reached ({n} item max)":"Limit reached ({n} items max)",1==e?"Group limit reached ({n} item max)":"Group limit reached ({n} items max)"]},selectAllText:"Select All",deselectAllText:"Deselect All",doneButton:!1,doneButtonText:"Close",multipleSeparator:", ",styleBase:"btn",style:"btn-default",size:"auto",title:null,selectedTextFormat:"values",width:!1,container:!1,hideDisabled:!1,showSubtext:!1,showIcon:!0,showContent:!0,dropupAuto:!0,header:!1,liveSearch:!1,liveSearchPlaceholder:null,liveSearchNormalize:!1,liveSearchStyle:"contains",actionsBox:!1,iconBase:"glyphicon",tickIcon:"glyphicon-ok",template:{caret:'<span class="caret"></span>'},maxOptions:!1,mobile:!1,selectOnTab:!1,dropdownAlignRight:!1},a.prototype={constructor:a,init:function(){var e=this,n=this.$element.attr("id");this.$element.addClass("bs-select-hidden"),this.liObj={},this.multiple=this.$element.prop("multiple"),this.autofocus=this.$element.prop("autofocus"),this.$newElement=this.createView(),this.$element.after(this.$newElement),this.$button=this.$newElement.children("button"),this.$menu=this.$newElement.children(".dropdown-menu"),this.$menuInner=this.$menu.children(".inner"),this.$searchbox=this.$menu.find("input"),this.options.dropdownAlignRight&&this.$menu.addClass("dropdown-menu-right"),void 0!==n&&(this.$button.attr("data-id",n),t('label[for="'+n+'"]').click((function(t){t.preventDefault(),e.$button.focus()}))),this.checkDisabled(),this.clickListener(),this.options.liveSearch&&this.liveSearchListener(),this.render(),this.setStyle(),this.setWidth(),this.options.container&&this.selectPosition(),this.$menu.data("this",this),this.$newElement.data("this",this),this.options.mobile&&this.mobile(),this.$newElement.on({"hide.bs.dropdown":function(t){e.$element.trigger("hide.bs.select",t)},"hidden.bs.dropdown":function(t){e.$element.trigger("hidden.bs.select",t)},"show.bs.dropdown":function(t){e.$element.trigger("show.bs.select",t)},"shown.bs.dropdown":function(t){e.$element.trigger("shown.bs.select",t)}}),setTimeout((function(){e.$element.trigger("loaded.bs.select")}))},createDropdown:function(){var e=this.multiple?" show-tick":"",n=this.$element.parent().hasClass("input-group")?" input-group-btn":"",i=this.autofocus?" autofocus":"",o=this.options.header?'<div class="popover-title"><button type="button" class="close" aria-hidden="true">&times;</button>'+this.options.header+"</div>":"",s=this.options.liveSearch?'<div class="bs-searchbox"><input type="text" class="form-control" autocomplete="off"'+(null===this.options.liveSearchPlaceholder?"":' placeholder="'+r(this.options.liveSearchPlaceholder)+'"')+"></div>":"",a=this.multiple&&this.options.actionsBox?'<div class="bs-actionsbox"><div class="btn-group btn-group-sm btn-block"><button type="button" class="actions-btn bs-select-all btn btn-default">'+this.options.selectAllText+'</button><button type="button" class="actions-btn bs-deselect-all btn btn-default">'+this.options.deselectAllText+"</button></div></div>":"",l=this.multiple&&this.options.doneButton?'<div class="bs-donebutton"><div class="btn-group btn-block"><button type="button" class="btn btn-sm btn-default">'+this.options.doneButtonText+"</button></div></div>":"",c='<div class="btn-group bootstrap-select'+e+n+'"><button type="button" class="'+this.options.styleBase+' dropdown-toggle" data-toggle="dropdown"'+i+'><span class="filter-option pull-left"></span>&nbsp;<span class="bs-caret">'+this.options.template.caret+'</span></button><div class="dropdown-menu open">'+o+s+a+'<ul class="dropdown-menu inner" role="menu"></ul>'+l+"</div></div>";return t(c)},createView:function(){var t=this.createDropdown(),e=this.createLi();return t.find("ul")[0].innerHTML=e,t},reloadLi:function(){this.destroyLi();var t=this.createLi();this.$menuInner[0].innerHTML=t},destroyLi:function(){this.$menu.find("li").remove()},createLi:function(){var e=this,n=[],i=0,o=document.createElement("option"),a=-1,l=function(t,e,n,i){return"<li"+(void 0!==n&""!==n?' class="'+n+'"':"")+(void 0!==e&null!==e?' data-original-index="'+e+'"':"")+(void 0!==i&null!==i?'data-optgroup="'+i+'"':"")+">"+t+"</li>"},c=function(t,n,i,o){return'<a tabindex="0"'+(void 0!==n?' class="'+n+'"':"")+(void 0!==i?' style="'+i+'"':"")+(e.options.liveSearchNormalize?' data-normalized-text="'+s(r(t))+'"':"")+(void 0!==o||null!==o?' data-tokens="'+o+'"':"")+">"+t+'<span class="'+e.options.iconBase+" "+e.options.tickIcon+' check-mark"></span></a>'};if(this.options.title&&!this.multiple&&(a--,!this.$element.find(".bs-title-option").length)){var d=this.$element[0];o.className="bs-title-option",o.appendChild(document.createTextNode(this.options.title)),o.value="",d.insertBefore(o,d.firstChild),void 0===t(d.options[d.selectedIndex]).attr("selected")&&(o.selected=!0)}return this.$element.find("option").each((function(o){var s=t(this);if(a++,!s.hasClass("bs-title-option")){var r=this.className||"",d=this.style.cssText,u=s.data("content")?s.data("content"):s.html(),p=s.data("tokens")?s.data("tokens"):null,h=void 0!==s.data("subtext")?'<small class="text-muted">'+s.data("subtext")+"</small>":"",f=void 0!==s.data("icon")?'<span class="'+e.options.iconBase+" "+s.data("icon")+'"></span> ':"",m=this.disabled||"OPTGROUP"===this.parentNode.tagName&&this.parentNode.disabled;if(""!==f&&m&&(f="<span>"+f+"</span>"),e.options.hideDisabled&&m)a--;else{if(s.data("content")||(u=f+'<span class="text">'+u+h+"</span>"),"OPTGROUP"===this.parentNode.tagName&&!0!==s.data("divider")){var g=" "+this.parentNode.className||!1;if(0===s.index()){i+=1;var v=this.parentNode.label,y=void 0!==s.parent().data("subtext")?'<small class="text-muted">'+s.parent().data("subtext")+"</small>":"";v=(s.parent().data("icon")?'<span class="'+e.options.iconBase+" "+s.parent().data("icon")+'"></span> ':"")+'<span class="text">'+v+y+"</span>",0!==o&&n.length>0&&(a++,n.push(l("",null,"divider",i+"div"))),a++,n.push(l(v,null,"dropdown-header"+g,i))}n.push(l(c(u,"opt "+r+g,d,p),o,"",i))}else!0===s.data("divider")?n.push(l("",o,"divider")):!0===s.data("hidden")?n.push(l(c(u,r,d,p),o,"hidden is-hidden")):(this.previousElementSibling&&"OPTGROUP"===this.previousElementSibling.tagName&&(a++,n.push(l("",null,"divider",i+"div"))),n.push(l(c(u,r,d,p),o)));e.liObj[o]=a}}})),this.multiple||0!==this.$element.find("option:selected").length||this.options.title||this.$element.find("option").eq(0).prop("selected",!0).attr("selected","selected"),n.join("")},findLis:function(){return null==this.$lis&&(this.$lis=this.$menu.find("li")),this.$lis},render:function(e){var n,i=this;!1!==e&&this.$element.find("option").each((function(t){var e=i.findLis().eq(i.liObj[t]);i.setDisabled(t,this.disabled||"OPTGROUP"===this.parentNode.tagName&&this.parentNode.disabled,e),i.setSelected(t,this.selected,e)})),this.tabIndex();var o=this.$element.find("option").map((function(){if(this.selected){if(i.options.hideDisabled&&(this.disabled||"OPTGROUP"===this.parentNode.tagName&&this.parentNode.disabled))return;var e,n=t(this),o=n.data("icon")&&i.options.showIcon?'<i class="'+i.options.iconBase+" "+n.data("icon")+'"></i> ':"";return e=i.options.showSubtext&&n.data("subtext")&&!i.multiple?' <small class="text-muted">'+n.data("subtext")+"</small>":"",void 0!==n.attr("title")?n.attr("title"):n.data("content")&&i.options.showContent?n.data("content"):o+n.html()+e}})).toArray(),s=this.multiple?o.join(this.options.multipleSeparator):o[0];if(this.multiple&&this.options.selectedTextFormat.indexOf("count")>-1){var r=this.options.selectedTextFormat.split(">");if(r.length>1&&o.length>r[1]||1==r.length&&o.length>=2){n=this.options.hideDisabled?", [disabled]":"";var a=this.$element.find("option").not('[data-divider="true"], [data-hidden="true"]'+n).length;s=("function"==typeof this.options.countSelectedText?this.options.countSelectedText(o.length,a):this.options.countSelectedText).replace("{0}",o.length.toString()).replace("{1}",a.toString())}}null==this.options.title&&(this.options.title=this.$element.attr("title")),"static"==this.options.selectedTextFormat&&(s=this.options.title),s||(s=void 0!==this.options.title?this.options.title:this.options.noneSelectedText),this.$button.attr("title",t.trim(s.replace(/<[^>]*>?/g,""))),this.$button.children(".filter-option").html(s),this.$element.trigger("rendered.bs.select")},setStyle:function(t,e){this.$element.attr("class")&&this.$newElement.addClass(this.$element.attr("class").replace(/selectpicker|mobile-device|bs-select-hidden|validate\[.*\]/gi,""));var n=t||this.options.style;"add"==e?this.$button.addClass(n):"remove"==e?this.$button.removeClass(n):(this.$button.removeClass(this.options.style),this.$button.addClass(n))},liHeight:function(e){if(e||!1!==this.options.size&&!this.sizeInfo){var n=document.createElement("div"),i=document.createElement("div"),o=document.createElement("ul"),s=document.createElement("li"),r=document.createElement("li"),a=document.createElement("a"),l=document.createElement("span"),c=this.options.header?this.$menu.find(".popover-title")[0].cloneNode(!0):null,d=this.options.liveSearch?document.createElement("div"):null,u=this.options.actionsBox&&this.multiple?this.$menu.find(".bs-actionsbox")[0].cloneNode(!0):null,p=this.options.doneButton&&this.multiple?this.$menu.find(".bs-donebutton")[0].cloneNode(!0):null;if(l.className="text",n.className=this.$menu[0].parentNode.className+" open",i.className="dropdown-menu open",o.className="dropdown-menu inner",s.className="divider",l.appendChild(document.createTextNode("Inner text")),a.appendChild(l),r.appendChild(a),o.appendChild(r),o.appendChild(s),c&&i.appendChild(c),d){var h=document.createElement("span");d.className="bs-searchbox",h.className="form-control",d.appendChild(h),i.appendChild(d)}u&&i.appendChild(u),i.appendChild(o),p&&i.appendChild(p),n.appendChild(i),document.body.appendChild(n);var f=a.offsetHeight,m=c?c.offsetHeight:0,g=d?d.offsetHeight:0,v=u?u.offsetHeight:0,y=p?p.offsetHeight:0,b=t(s).outerHeight(!0),w="function"==typeof getComputedStyle&&getComputedStyle(i),x=w?null:t(i),k=parseInt(w?w.paddingTop:x.css("paddingTop"))+parseInt(w?w.paddingBottom:x.css("paddingBottom"))+parseInt(w?w.borderTopWidth:x.css("borderTopWidth"))+parseInt(w?w.borderBottomWidth:x.css("borderBottomWidth")),C=k+parseInt(w?w.marginTop:x.css("marginTop"))+parseInt(w?w.marginBottom:x.css("marginBottom"))+2;document.body.removeChild(n),this.sizeInfo={liHeight:f,headerHeight:m,searchHeight:g,actionsHeight:v,doneButtonHeight:y,dividerHeight:b,menuPadding:k,menuExtras:C}}},setSize:function(){if(this.findLis(),this.liHeight(),this.options.header&&this.$menu.css("padding-top",0),!1!==this.options.size){var e,n,i,o,s=this,r=this.$menu,a=this.$menuInner,l=t(window),c=this.$newElement[0].offsetHeight,d=this.sizeInfo.liHeight,u=this.sizeInfo.headerHeight,p=this.sizeInfo.searchHeight,h=this.sizeInfo.actionsHeight,f=this.sizeInfo.doneButtonHeight,m=this.sizeInfo.dividerHeight,g=this.sizeInfo.menuPadding,v=this.sizeInfo.menuExtras,y=this.options.hideDisabled?".disabled":"",b=function(){i=s.$newElement.offset().top-l.scrollTop(),o=l.height()-i-c};if(b(),"auto"===this.options.size){var w=function(){var l,c=function(e,n){return function(i){return n?i.classList?i.classList.contains(e):t(i).hasClass(e):!(i.classList?i.classList.contains(e):t(i).hasClass(e))}},m=s.$menuInner[0].getElementsByTagName("li"),y=Array.prototype.filter?Array.prototype.filter.call(m,c("hidden",!1)):s.$lis.not(".hidden"),w=Array.prototype.filter?Array.prototype.filter.call(y,c("dropdown-header",!0)):y.filter(".dropdown-header");b(),e=o-v,s.options.container?(r.data("height")||r.data("height",r.height()),n=r.data("height")):n=r.height(),s.options.dropupAuto&&s.$newElement.toggleClass("dropup",i>o&&e-v<n),s.$newElement.hasClass("dropup")&&(e=i-v),l=y.length+w.length>3?3*d+v-2:0,r.css({"max-height":e+"px",overflow:"hidden","min-height":l+u+p+h+f+"px"}),a.css({"max-height":e-u-p-h-f-g+"px","overflow-y":"auto","min-height":Math.max(l-g,0)+"px"})};w(),this.$searchbox.off("input.getSize propertychange.getSize").on("input.getSize propertychange.getSize",w),l.off("resize.getSize scroll.getSize").on("resize.getSize scroll.getSize",w)}else if(this.options.size&&"auto"!=this.options.size&&this.$lis.not(y).length>this.options.size){var x=this.$lis.not(".divider").not(y).children().slice(0,this.options.size).last().parent().index(),k=this.$lis.slice(0,x+1).filter(".divider").length;e=d*this.options.size+k*m+g,s.options.container?(r.data("height")||r.data("height",r.height()),n=r.data("height")):n=r.height(),s.options.dropupAuto&&this.$newElement.toggleClass("dropup",i>o&&e-v<n),r.css({"max-height":e+u+p+h+f+"px",overflow:"hidden","min-height":""}),a.css({"max-height":e-g+"px","overflow-y":"auto","min-height":""})}}},setWidth:function(){if("auto"===this.options.width){this.$menu.css("min-width","0");var t=this.$menu.parent().clone().appendTo("body"),e=this.options.container?this.$newElement.clone().appendTo("body"):t,n=t.children(".dropdown-menu").outerWidth(),i=e.css("width","auto").children("button").outerWidth();t.remove(),e.remove(),this.$newElement.css("width",Math.max(n,i)+"px")}else"fit"===this.options.width?(this.$menu.css("min-width",""),this.$newElement.css("width","").addClass("fit-width")):this.options.width?(this.$menu.css("min-width",""),this.$newElement.css("width",this.options.width)):(this.$menu.css("min-width",""),this.$newElement.css("width",""));this.$newElement.hasClass("fit-width")&&"fit"!==this.options.width&&this.$newElement.removeClass("fit-width")},selectPosition:function(){var e,n,i=this,o=t('<div class="bs-container" />'),s=function(t){o.addClass(t.attr("class").replace(/form-control|fit-width/gi,"")).toggleClass("dropup",t.hasClass("dropup")),e=t.offset(),n=t.hasClass("dropup")?0:t[0].offsetHeight,o.css({top:e.top+n,left:e.left,width:t[0].offsetWidth})};this.$newElement.on("click",(function(){i.isDisabled()||(s(t(this)),o.appendTo(i.options.container),o.toggleClass("open",!t(this).hasClass("open")),o.append(i.$menu))})),t(window).on("resize scroll",(function(){s(i.$newElement)})),this.$element.on("hide.bs.select",(function(){i.$menu.data("height",i.$menu.height()),o.detach()}))},setSelected:function(t,e,n){n||(n=this.findLis().eq(this.liObj[t])),n.toggleClass("selected",e)},setDisabled:function(t,e,n){n||(n=this.findLis().eq(this.liObj[t])),e?n.addClass("disabled").children("a").attr("href","#").attr("tabindex",-1):n.removeClass("disabled").children("a").removeAttr("href").attr("tabindex",0)},isDisabled:function(){return this.$element[0].disabled},checkDisabled:function(){var t=this;this.isDisabled()?(this.$newElement.addClass("disabled"),this.$button.addClass("disabled").attr("tabindex",-1)):(this.$button.hasClass("disabled")&&(this.$newElement.removeClass("disabled"),this.$button.removeClass("disabled")),-1!=this.$button.attr("tabindex")||this.$element.data("tabindex")||this.$button.removeAttr("tabindex")),this.$button.click((function(){return!t.isDisabled()}))},tabIndex:function(){this.$element.is("[tabindex]")&&(this.$element.data("tabindex",this.$element.attr("tabindex")),this.$button.attr("tabindex",this.$element.data("tabindex")))},clickListener:function(){var e=this,n=t(document);this.$newElement.on("touchstart.dropdown",".dropdown-menu",(function(t){t.stopPropagation()})),n.data("spaceSelect",!1),this.$button.on("keyup",(function(t){/(32)/.test(t.keyCode.toString(10))&&n.data("spaceSelect")&&(t.preventDefault(),n.data("spaceSelect",!1))})),this.$newElement.on("click",(function(){e.setSize(),e.$element.on("shown.bs.select",(function(){if(e.options.liveSearch||e.multiple){if(!e.multiple){var t=e.liObj[e.$element[0].selectedIndex];if("number"!=typeof t||!1===e.options.size)return;var n=e.$lis.eq(t)[0].offsetTop-e.$menuInner[0].offsetTop;n=n-e.$menuInner[0].offsetHeight/2+e.sizeInfo.liHeight/2,e.$menuInner[0].scrollTop=n}}else e.$menuInner.find(".selected a").focus()}))})),this.$menuInner.on("click","li a",(function(n){var i=t(this),o=i.parent().data("originalIndex"),s=e.$element.val(),r=e.$element.prop("selectedIndex");if(e.multiple&&n.stopPropagation(),n.preventDefault(),!e.isDisabled()&&!i.parent().hasClass("disabled")){var a=e.$element.find("option"),l=a.eq(o),c=l.prop("selected"),d=l.parent("optgroup"),u=e.options.maxOptions,p=d.data("maxOptions")||!1;if(e.multiple){if(l.prop("selected",!c),e.setSelected(o,!c),i.blur(),!1!==u||!1!==p){var h=u<a.filter(":selected").length,f=p<d.find("option:selected").length;if(u&&h||p&&f)if(u&&1==u)a.prop("selected",!1),l.prop("selected",!0),e.$menuInner.find(".selected").removeClass("selected"),e.setSelected(o,!0);else if(p&&1==p){d.find("option:selected").prop("selected",!1),l.prop("selected",!0);var m=i.parent().data("optgroup");e.$menuInner.find('[data-optgroup="'+m+'"]').removeClass("selected"),e.setSelected(o,!0)}else{var g="function"==typeof e.options.maxOptionsText?e.options.maxOptionsText(u,p):e.options.maxOptionsText,v=g[0].replace("{n}",u),y=g[1].replace("{n}",p),b=t('<div class="notify"></div>');g[2]&&(v=v.replace("{var}",g[2][u>1?0:1]),y=y.replace("{var}",g[2][p>1?0:1])),l.prop("selected",!1),e.$menu.append(b),u&&h&&(b.append(t("<div>"+v+"</div>")),e.$element.trigger("maxReached.bs.select")),p&&f&&(b.append(t("<div>"+y+"</div>")),e.$element.trigger("maxReachedGrp.bs.select")),setTimeout((function(){e.setSelected(o,!1)}),10),b.delay(750).fadeOut(300,(function(){t(this).remove()}))}}}else a.prop("selected",!1),l.prop("selected",!0),e.$menuInner.find(".selected").removeClass("selected"),e.setSelected(o,!0);e.multiple?e.options.liveSearch&&e.$searchbox.focus():e.$button.focus(),(s!=e.$element.val()&&e.multiple||r!=e.$element.prop("selectedIndex")&&!e.multiple)&&(e.$element.triggerNative("change"),e.$element.trigger("changed.bs.select",[o,l.prop("selected"),c]))}})),this.$menu.on("click","li.disabled a, .popover-title, .popover-title :not(.close)",(function(n){n.currentTarget==this&&(n.preventDefault(),n.stopPropagation(),e.options.liveSearch&&!t(n.target).hasClass("close")?e.$searchbox.focus():e.$button.focus())})),this.$menuInner.on("click",".divider, .dropdown-header",(function(t){t.preventDefault(),t.stopPropagation(),e.options.liveSearch?e.$searchbox.focus():e.$button.focus()})),this.$menu.on("click",".popover-title .close",(function(){e.$button.click()})),this.$searchbox.on("click",(function(t){t.stopPropagation()})),this.$menu.on("click",".actions-btn",(function(n){e.options.liveSearch?e.$searchbox.focus():e.$button.focus(),n.preventDefault(),n.stopPropagation(),t(this).hasClass("bs-select-all")?e.selectAll():e.deselectAll(),e.$element.triggerNative("change")})),this.$element.change((function(){e.render(!1)}))},liveSearchListener:function(){var e=this,n=t('<li class="no-results"></li>');this.$newElement.on("click.dropdown.data-api touchstart.dropdown.data-api",(function(){e.$menuInner.find(".active").removeClass("active"),e.$searchbox.val()&&(e.$searchbox.val(""),e.$lis.not(".is-hidden").removeClass("hidden"),n.parent().length&&n.remove()),e.multiple||e.$menuInner.find(".selected").addClass("active"),setTimeout((function(){e.$searchbox.focus()}),10)})),this.$searchbox.on("click.dropdown.data-api focus.dropdown.data-api touchend.dropdown.data-api",(function(t){t.stopPropagation()})),this.$searchbox.on("input propertychange",(function(){if(e.$searchbox.val()){var i=e.$lis.not(".is-hidden").removeClass("hidden").children("a");(i=e.options.liveSearchNormalize?i.not(":a"+e._searchStyle()+'("'+s(e.$searchbox.val())+'")'):i.not(":"+e._searchStyle()+'("'+e.$searchbox.val()+'")')).parent().addClass("hidden"),e.$lis.filter(".dropdown-header").each((function(){var n=t(this),i=n.data("optgroup");0===e.$lis.filter("[data-optgroup="+i+"]").not(n).not(".hidden").length&&(n.addClass("hidden"),e.$lis.filter("[data-optgroup="+i+"div]").addClass("hidden"))}));var o=e.$lis.not(".hidden");o.each((function(e){var n=t(this);n.hasClass("divider")&&(n.index()===o.first().index()||n.index()===o.last().index()||o.eq(e+1).hasClass("divider"))&&n.addClass("hidden")})),e.$lis.not(".hidden, .no-results").length?n.parent().length&&n.remove():(n.parent().length&&n.remove(),n.html(e.options.noneResultsText.replace("{0}",'"'+r(e.$searchbox.val())+'"')).show(),e.$menuInner.append(n))}else e.$lis.not(".is-hidden").removeClass("hidden"),n.parent().length&&n.remove();e.$lis.filter(".active").removeClass("active"),e.$searchbox.val()&&e.$lis.not(".hidden, .divider, .dropdown-header").eq(0).addClass("active").children("a").focus(),t(this).focus()}))},_searchStyle:function(){return{begins:"ibegins",startsWith:"ibegins"}[this.options.liveSearchStyle]||"icontains"},val:function(t){return void 0!==t?(this.$element.val(t),this.render(),this.$element):this.$element.val()},changeAll:function(e){void 0===e&&(e=!0),this.findLis();for(var n=this.$element.find("option"),i=this.$lis.not(".divider, .dropdown-header, .disabled, .hidden").toggleClass("selected",e),o=i.length,s=[],r=0;r<o;r++){var a=i[r].getAttribute("data-original-index");s[s.length]=n.eq(a)[0]}t(s).prop("selected",e),this.render(!1)},selectAll:function(){return this.changeAll(!0)},deselectAll:function(){return this.changeAll(!1)},keydown:function(e){var n,i,o,r,a,l,c,d,u,p=t(this),h=p.is("input")?p.parent().parent():p.parent(),f=h.data("this"),m=":not(.disabled, .hidden, .dropdown-header, .divider)",g={32:" ",48:"0",49:"1",50:"2",51:"3",52:"4",53:"5",54:"6",55:"7",56:"8",57:"9",59:";",65:"a",66:"b",67:"c",68:"d",69:"e",70:"f",71:"g",72:"h",73:"i",74:"j",75:"k",76:"l",77:"m",78:"n",79:"o",80:"p",81:"q",82:"r",83:"s",84:"t",85:"u",86:"v",87:"w",88:"x",89:"y",90:"z",96:"0",97:"1",98:"2",99:"3",100:"4",101:"5",102:"6",103:"7",104:"8",105:"9"};if(f.options.liveSearch&&(h=p.parent().parent()),f.options.container&&(h=f.$menu),n=t("[role=menu] li",h),!(u=f.$menu.parent().hasClass("open"))&&(e.keyCode>=48&&e.keyCode<=57||e.keyCode>=96&&e.keyCode<=105||e.keyCode>=65&&e.keyCode<=90)&&(f.options.container?f.$newElement.trigger("click"):(f.setSize(),f.$menu.parent().addClass("open"),u=!0),f.$searchbox.focus()),f.options.liveSearch&&(/(^9$|27)/.test(e.keyCode.toString(10))&&u&&0===f.$menu.find(".active").length&&(e.preventDefault(),f.$menu.parent().removeClass("open"),f.options.container&&f.$newElement.removeClass("open"),f.$button.focus()),n=t("[role=menu] li"+m,h),p.val()||/(38|40)/.test(e.keyCode.toString(10))||0===n.filter(".active").length&&(n=f.$menuInner.find("li"),n=f.options.liveSearchNormalize?n.filter(":a"+f._searchStyle()+"("+s(g[e.keyCode])+")"):n.filter(":"+f._searchStyle()+"("+g[e.keyCode]+")"))),n.length){if(/(38|40)/.test(e.keyCode.toString(10)))i=n.index(n.find("a").filter(":focus").parent()),r=n.filter(m).first().index(),a=n.filter(m).last().index(),o=n.eq(i).nextAll(m).eq(0).index(),l=n.eq(i).prevAll(m).eq(0).index(),c=n.eq(o).prevAll(m).eq(0).index(),f.options.liveSearch&&(n.each((function(e){t(this).hasClass("disabled")||t(this).data("index",e)})),i=n.index(n.filter(".active")),r=n.first().data("index"),a=n.last().data("index"),o=n.eq(i).nextAll().eq(0).data("index"),l=n.eq(i).prevAll().eq(0).data("index"),c=n.eq(o).prevAll().eq(0).data("index")),d=p.data("prevIndex"),38==e.keyCode?(f.options.liveSearch&&i--,i!=c&&i>l&&(i=l),i<r&&(i=r),i==d&&(i=a)):40==e.keyCode&&(f.options.liveSearch&&i++,-1==i&&(i=0),i!=c&&i<o&&(i=o),i>a&&(i=a),i==d&&(i=r)),p.data("prevIndex",i),f.options.liveSearch?(e.preventDefault(),p.hasClass("dropdown-toggle")||(n.removeClass("active").eq(i).addClass("active").children("a").focus(),p.focus())):n.eq(i).children("a").focus();else if(!p.is("input")){var v,y=[];n.each((function(){t(this).hasClass("disabled")||t.trim(t(this).children("a").text().toLowerCase()).substring(0,1)==g[e.keyCode]&&y.push(t(this).index())})),v=t(document).data("keycount"),v++,t(document).data("keycount",v),t.trim(t(":focus").text().toLowerCase()).substring(0,1)!=g[e.keyCode]?(v=1,t(document).data("keycount",v)):v>=y.length&&(t(document).data("keycount",0),v>y.length&&(v=1)),n.eq(y[v-1]).children("a").focus()}if((/(13|32)/.test(e.keyCode.toString(10))||/(^9$)/.test(e.keyCode.toString(10))&&f.options.selectOnTab)&&u){if(/(32)/.test(e.keyCode.toString(10))||e.preventDefault(),f.options.liveSearch)/(32)/.test(e.keyCode.toString(10))||(f.$menuInner.find(".active a").click(),p.focus());else{var b=t(":focus");b.click(),b.focus(),e.preventDefault(),t(document).data("spaceSelect",!0)}t(document).data("keycount",0)}(/(^9$|27)/.test(e.keyCode.toString(10))&&u&&(f.multiple||f.options.liveSearch)||/(27)/.test(e.keyCode.toString(10))&&!u)&&(f.$menu.parent().removeClass("open"),f.options.container&&f.$newElement.removeClass("open"),f.$button.focus())}},mobile:function(){this.$element.addClass("mobile-device").appendTo(this.$newElement),this.options.container&&this.$menu.hide()},refresh:function(){this.$lis=null,this.liObj={},this.reloadLi(),this.render(),this.checkDisabled(),this.liHeight(!0),this.setStyle(),this.setWidth(),this.$lis&&this.$searchbox.trigger("propertychange"),this.$element.trigger("refreshed.bs.select")},hide:function(){this.$newElement.hide()},show:function(){this.$newElement.show()},remove:function(){this.$newElement.remove(),this.$element.remove()}};var c=t.fn.selectpicker;t.fn.selectpicker=l,t.fn.selectpicker.Constructor=a,t.fn.selectpicker.noConflict=function(){return t.fn.selectpicker=c,this},t(document).data("keycount",0).on("keydown",'.bootstrap-select [data-toggle=dropdown], .bootstrap-select [role="menu"], .bs-searchbox input',a.prototype.keydown).on("focusin.modal",'.bootstrap-select [data-toggle=dropdown], .bootstrap-select [role="menu"], .bs-searchbox input',(function(t){t.stopPropagation()})),t(window).on("load.bs.select.data-api",(function(){t(".selectpicker").each((function(){var e=t(this);l.call(e,e.data())}))}))}(t)}.apply(e,i),void 0===o||(t.exports=o)},function(t,e,n){var i,o,s;o=[n(0)],i=function(t,e){"use strict";var n=function(n,i){var o=this;this.$element=t(n),this.textDirection=this.$element.css("direction"),this.options=t.extend(!0,{},t.fn.tokenfield.defaults,{tokens:this.$element.val()},this.$element.data(),i),this._delimiters="string"==typeof this.options.delimiter?[this.options.delimiter]:this.options.delimiter,this._triggerKeys=t.map(this._delimiters,(function(t){return t.charCodeAt(0)})),this._firstDelimiter=this._delimiters[0];var s=t.inArray(" ",this._delimiters),r=t.inArray("-",this._delimiters);s>=0&&(this._delimiters[s]="\\s"),r>=0&&(delete this._delimiters[r],this._delimiters.unshift("-"));var a=["\\","$","[","{","^",".","|","?","*","+","(",")"];t.each(this._delimiters,(function(e,n){t.inArray(n,a)>=0&&(o._delimiters[e]="\\"+n)}));var l,c=e&&"function"==typeof e.getMatchedCSSRules?e.getMatchedCSSRules(n):null,d=n.style.width,u=this.$element.width();c&&t.each(c,(function(t,e){e.style.width&&(l=e.style.width)}));var p="rtl"===t("body").css("direction")?"right":"left",h={position:this.$element.css("position")};h[p]=this.$element.css(p),this.$element.data("original-styles",h).data("original-tabindex",this.$element.prop("tabindex")).css("position","absolute").css(p,"-10000px").prop("tabindex",-1),this.$wrapper=t('<div class="tokenfield form-control" />'),this.$element.hasClass("input-lg")&&this.$wrapper.addClass("input-lg"),this.$element.hasClass("input-sm")&&this.$wrapper.addClass("input-sm"),"rtl"===this.textDirection&&this.$wrapper.addClass("rtl");var f=this.$element.prop("id")||(new Date).getTime()+""+Math.floor(100*(1+Math.random()));this.$input=t('<input type="text" class="token-input" autocomplete="off" />').appendTo(this.$wrapper).prop("placeholder",this.$element.prop("placeholder")).prop("id",f+"-tokenfield").prop("tabindex",this.$element.data("original-tabindex"));var m=t('label[for="'+this.$element.prop("id")+'"]');if(m.length&&m.prop("for",this.$input.prop("id")),this.$copyHelper=t('<input type="text" />').css("position","absolute").css(p,"-10000px").prop("tabindex",-1).prependTo(this.$wrapper),d?this.$wrapper.css("width",d):l?this.$wrapper.css("width",l):this.$element.parents(".form-inline").length&&this.$wrapper.width(u),(this.$element.prop("disabled")||this.$element.parents("fieldset[disabled]").length)&&this.disable(),this.$element.prop("readonly")&&this.readonly(),this.$mirror=t('<span style="position:absolute; top:-999px; left:0; white-space:pre;"/>'),this.$input.css("min-width",this.options.minWidth+"px"),t.each(["fontFamily","fontSize","fontWeight","fontStyle","letterSpacing","textTransform","wordSpacing","textIndent"],(function(t,e){o.$mirror[0].style[e]=o.$input.css(e)})),this.$mirror.appendTo("body"),this.$wrapper.insertBefore(this.$element),this.$element.prependTo(this.$wrapper),this.update(),this.setTokens(this.options.tokens,!1,!1),this.listen(),!t.isEmptyObject(this.options.autocomplete)){var g="rtl"===this.textDirection?"right":"left",v=t.extend({minLength:this.options.showAutocompleteOnFocus?0:null,position:{my:g+" top",at:g+" bottom",of:this.$wrapper}},this.options.autocomplete);this.$input.autocomplete(v)}if(!t.isEmptyObject(this.options.typeahead)){var y=this.options.typeahead,b={minLength:this.options.showAutocompleteOnFocus?0:null},w=t.isArray(y)?y:[y,y];w[0]=t.extend({},b,w[0]),this.$input.typeahead.apply(this.$input,w),this.typeahead=!0}this.$element.trigger("tokenfield:initialize")};n.prototype={constructor:n,createToken:function(e,n){var i=this;if("string"==typeof e&&(e={value:e,label:e}),void 0===n&&(n=!0),e.value=t.trim(e.value),e.label=e.label&&e.label.length?t.trim(e.label):e.value,e.value.length&&e.label.length&&!(e.label.length<=this.options.minLength)&&!(this.options.limit&&this.getTokens().length>=this.options.limit)){var o=t.Event("tokenfield:createtoken",{attrs:e});if(this.$element.trigger(o),o.attrs&&!o.isDefaultPrevented()){var s=t('<div class="token" />').attr("data-value",e.value).append('<span class="token-label" />').append('<a href="#" class="close" tabindex="-1">&times;</a>');this.$input.hasClass("tt-input")?this.$input.parent().before(s):this.$input.before(s),this.$input.css("width",this.options.minWidth+"px");var r=s.find(".token-label"),a=s.find(".close");return this.maxTokenWidth||(this.maxTokenWidth=this.$wrapper.width()-a.outerWidth()-parseInt(a.css("margin-left"),10)-parseInt(a.css("margin-right"),10)-parseInt(s.css("border-left-width"),10)-parseInt(s.css("border-right-width"),10)-parseInt(s.css("padding-left"),10)-parseInt(s.css("padding-right"),10),parseInt(r.css("border-left-width"),10),parseInt(r.css("border-right-width"),10),parseInt(r.css("padding-left"),10),parseInt(r.css("padding-right"),10),parseInt(r.css("margin-left"),10),parseInt(r.css("margin-right"),10)),r.text(e.label).css("max-width",this.maxTokenWidth),s.on("mousedown",(function(t){if(i._disabled||i._readonly)return!1;i.preventDeactivation=!0})).on("click",(function(t){return!i._disabled&&!i._readonly&&(i.preventDeactivation=!1,t.ctrlKey||t.metaKey?(t.preventDefault(),i.toggle(s)):void i.activate(s,t.shiftKey,t.shiftKey))})).on("dblclick",(function(t){if(i._disabled||i._readonly||!i.options.allowEditing)return!1;i.edit(s)})),a.on("click",t.proxy(this.remove,this)),this.$element.trigger(t.Event("tokenfield:createdtoken",{attrs:e,relatedTarget:s.get(0)})),n&&this.$element.val(this.getTokensList()).trigger(t.Event("change",{initiator:"tokenfield"})),this.update(),this.$element.get(0)}}},setTokens:function(e,n,i){if(e){n||this.$wrapper.find(".token").remove(),void 0===i&&(i=!0),"string"==typeof e&&(e=this._delimiters.length?e.split(new RegExp("["+this._delimiters.join("")+"]")):[e]);var o=this;return t.each(e,(function(t,e){o.createToken(e,i)})),this.$element.get(0)}},getTokenData:function(e){var n=e.map((function(){var e=t(this);return{value:e.attr("data-value"),label:e.find(".token-label").text()}})).get();return 1==n.length&&(n=n[0]),n},getTokens:function(e){var n=this,i=[],o=e?".active":"";return this.$wrapper.find(".token"+o).each((function(){i.push(n.getTokenData(t(this)))})),i},getTokensList:function(e,n,i){var o=(e=e||this._firstDelimiter)+((n=null!=n?n:this.options.beautify)&&" "!==e?" ":"");return t.map(this.getTokens(i),(function(t){return t.value})).join(o)},getInput:function(){return this.$input.val()},listen:function(){var n=this;this.$element.on("change",t.proxy(this.change,this)),this.$wrapper.on("mousedown",t.proxy(this.focusInput,this)),this.$input.on("focus",t.proxy(this.focus,this)).on("blur",t.proxy(this.blur,this)).on("paste",t.proxy(this.paste,this)).on("keydown",t.proxy(this.keydown,this)).on("keypress",t.proxy(this.keypress,this)).on("keyup",t.proxy(this.keyup,this)),this.$copyHelper.on("focus",t.proxy(this.focus,this)).on("blur",t.proxy(this.blur,this)).on("keydown",t.proxy(this.keydown,this)).on("keyup",t.proxy(this.keyup,this)),this.$input.on("keypress",t.proxy(this.update,this)).on("keyup",t.proxy(this.update,this)),this.$input.on("autocompletecreate",(function(){var e=t(this).data("ui-autocomplete").menu.element,i=n.$wrapper.outerWidth()-parseInt(e.css("border-left-width"),10)-parseInt(e.css("border-right-width"),10);e.css("min-width",i+"px")})).on("autocompleteselect",(function(t,e){return n.createToken(e.item)&&(n.$input.val(""),n.$input.data("edit")&&n.unedit(!0)),!1})).on("typeahead:selected typeahead:autocompleted",(function(t,e,i){n.createToken(e)&&(n.$input.typeahead("val",""),n.$input.data("edit")&&n.unedit(!0))})),t(e).on("resize",t.proxy(this.update,this))},keydown:function(e){if(this.focused){var n=this;switch(e.keyCode){case 8:if(!this.$input.is(document.activeElement))break;this.lastInputValue=this.$input.val();break;case 37:i("rtl"===this.textDirection?"next":"prev");break;case 38:o("prev");break;case 39:i("rtl"===this.textDirection?"prev":"next");break;case 40:o("next");break;case 65:if(this.$input.val().length>0||!e.ctrlKey&&!e.metaKey)break;this.activateAll(),e.preventDefault();break;case 9:case 13:if(this.$input.data("ui-autocomplete")&&this.$input.data("ui-autocomplete").menu.element.find("li:has(a.ui-state-focus)").length)break;if(this.$input.hasClass("tt-input")&&this.$wrapper.find(".tt-cursor").length)break;if(this.$input.hasClass("tt-input")&&this.$wrapper.find(".tt-hint").val().length)break;if(this.$input.is(document.activeElement)&&this.$input.val().length||this.$input.data("edit"))return this.createTokensFromInput(e,this.$input.data("edit"));if(13===e.keyCode){if(!this.$copyHelper.is(document.activeElement)||1!==this.$wrapper.find(".token.active").length)break;if(!n.options.allowEditing)break;this.edit(this.$wrapper.find(".token.active"))}}this.lastKeyDown=e.keyCode}function i(t){if(n.$input.is(document.activeElement)){if(n.$input.val().length>0)return;t+="All";var i=n.$input.hasClass("tt-input")?n.$input.parent()[t](".token:first"):n.$input[t](".token:first");if(!i.length)return;n.preventInputFocus=!0,n.preventDeactivation=!0,n.activate(i),e.preventDefault()}else n[t](e.shiftKey),e.preventDefault()}function o(i){if(e.shiftKey){if(n.$input.is(document.activeElement)){if(n.$input.val().length>0)return;var o=n.$input.hasClass("tt-input")?n.$input.parent()[i+"All"](".token:first"):n.$input[i+"All"](".token:first");if(!o.length)return;n.activate(o)}var s="prev"===i?"next":"prev",r="prev"===i?"first":"last";n.firstActiveToken[s+"All"](".token").each((function(){n.deactivate(t(this))})),n.activate(n.$wrapper.find(".token:"+r),!0,!0),e.preventDefault()}}},keypress:function(e){if(this.lastKeyPressCode=e.keyCode,this.lastKeyPressCharCode=e.charCode,-1!==t.inArray(e.charCode,this._triggerKeys)&&this.$input.is(document.activeElement))return this.$input.val()&&this.createTokensFromInput(e),!1},keyup:function(t){if(this.preventInputFocus=!1,this.focused){switch(t.keyCode){case 8:if(this.$input.is(document.activeElement)){if(this.$input.val().length||this.lastInputValue.length&&8===this.lastKeyDown)break;this.preventDeactivation=!0;var e=this.$input.hasClass("tt-input")?this.$input.parent().prevAll(".token:first"):this.$input.prevAll(".token:first");if(!e.length)break;this.activate(e)}else this.remove(t);break;case 46:this.remove(t,"next")}this.lastKeyUp=t.keyCode}},focus:function(t){this.focused=!0,this.$wrapper.addClass("focus"),this.$input.is(document.activeElement)&&(this.$wrapper.find(".active").removeClass("active"),this.$firstActiveToken=null,this.options.showAutocompleteOnFocus&&this.search())},blur:function(t){this.focused=!1,this.$wrapper.removeClass("focus"),this.preventDeactivation||this.$element.is(document.activeElement)||(this.$wrapper.find(".active").removeClass("active"),this.$firstActiveToken=null),!this.preventCreateTokens&&(this.$input.data("edit")&&!this.$input.is(document.activeElement)||this.options.createTokensOnBlur)&&this.createTokensFromInput(t),this.preventDeactivation=!1,this.preventCreateTokens=!1},paste:function(t){var e=this;setTimeout((function(){e.createTokensFromInput(t)}),1)},change:function(t){"tokenfield"!==t.initiator&&this.setTokens(this.$element.val())},createTokensFromInput:function(t,e){if(!(this.$input.val().length<this.options.minLength)){var n=this.getTokensList();return this.setTokens(this.$input.val(),!0),n==this.getTokensList()&&this.$input.val().length||(this.$input.hasClass("tt-input")?this.$input.typeahead("val",""):this.$input.val(""),this.$input.data("edit")&&this.unedit(e)),!1}},next:function(t){if(t){var e=this.$wrapper.find(".active:first");if(e&&this.$firstActiveToken&&e.index()<this.$firstActiveToken.index())return this.deactivate(e)}var n=this.$wrapper.find(".active:last").nextAll(".token:first");n.length?this.activate(n,t):this.$input.focus()},prev:function(t){if(t){var e=this.$wrapper.find(".active:last");if(e&&this.$firstActiveToken&&e.index()>this.$firstActiveToken.index())return this.deactivate(e)}var n=this.$wrapper.find(".active:first").prevAll(".token:first");n.length||(n=this.$wrapper.find(".token:first")),n.length||t?this.activate(n,t):this.$input.focus()},activate:function(e,n,i,o){if(e){if(void 0===o&&(o=!0),i&&(n=!0),this.$copyHelper.focus(),n||(this.$wrapper.find(".active").removeClass("active"),o?this.$firstActiveToken=e:delete this.$firstActiveToken),i&&this.$firstActiveToken){var s=this.$firstActiveToken.index()-2,r=e.index()-2,a=this;this.$wrapper.find(".token").slice(Math.min(s,r)+1,Math.max(s,r)).each((function(){a.activate(t(this),!0)}))}e.addClass("active"),this.$copyHelper.val(this.getTokensList(null,null,!0)).select()}},activateAll:function(){var e=this;this.$wrapper.find(".token").each((function(n){e.activate(t(this),0!==n,!1,!1)}))},deactivate:function(t){t&&(t.removeClass("active"),this.$copyHelper.val(this.getTokensList(null,null,!0)).select())},toggle:function(t){t&&(t.toggleClass("active"),this.$copyHelper.val(this.getTokensList(null,null,!0)).select())},edit:function(e){if(e){var n={value:e.data("value"),label:e.find(".token-label").text()},i={attrs:n,relatedTarget:e.get(0)},o=t.Event("tokenfield:edittoken",i);if(this.$element.trigger(o),!o.isDefaultPrevented()){e.find(".token-label").text(n.value);var s=e.outerWidth(),r=this.$input.hasClass("tt-input")?this.$input.parent():this.$input;e.replaceWith(r),this.preventCreateTokens=!0,this.$input.val(n.value).select().data("edit",!0).width(s),this.update(),this.$element.trigger(t.Event("tokenfield:editedtoken",i))}}},unedit:function(t){if((this.$input.hasClass("tt-input")?this.$input.parent():this.$input).appendTo(this.$wrapper),this.$input.data("edit",!1),this.$mirror.text(""),this.update(),t){var e=this;setTimeout((function(){e.$input.focus()}),1)}},remove:function(e,n){if(!(this.$input.is(document.activeElement)||this._disabled||this._readonly)){var i="click"===e.type?t(e.target).closest(".token"):this.$wrapper.find(".token.active");if("click"!==e.type&&(n||(n="prev"),this[n](),"prev"===n))var o=0===i.first().prevAll(".token:first").length;var s={attrs:this.getTokenData(i),relatedTarget:i.get(0)},r=t.Event("tokenfield:removetoken",s);if(this.$element.trigger(r),!r.isDefaultPrevented()){var a=t.Event("tokenfield:removedtoken",s),l=t.Event("change",{initiator:"tokenfield"});i.remove(),this.$element.val(this.getTokensList()).trigger(a).trigger(l),this.$wrapper.find(".token").length&&"click"!==e.type&&!o||this.$input.focus(),this.$input.css("width",this.options.minWidth+"px"),this.update(),e.preventDefault(),e.stopPropagation()}}},update:function(t){var e=this.$input.val(),n=parseInt(this.$input.css("padding-left"),10)+parseInt(this.$input.css("padding-right"),10);if(this.$input.data("edit")){if(e||(e=this.$input.prop("placeholder")),e===this.$mirror.text())return;this.$mirror.text(e);var i=this.$mirror.width()+10;if(i>this.$wrapper.width())return this.$input.width(this.$wrapper.width());this.$input.width(i)}else{if(this.$input.css("width",this.options.minWidth+"px"),"rtl"===this.textDirection)return this.$input.width(this.$input.offset().left+this.$input.outerWidth()-this.$wrapper.offset().left-parseInt(this.$wrapper.css("padding-left"),10)-n-1);this.$input.width(this.$wrapper.offset().left+this.$wrapper.width()+parseInt(this.$wrapper.css("padding-left"),10)-this.$input.offset().left-n)}},focusInput:function(e){if(!(t(e.target).closest(".token").length||t(e.target).closest(".token-input").length||t(e.target).closest(".tt-dropdown-menu").length)){var n=this;setTimeout((function(){n.$input.focus()}),0)}},search:function(){this.$input.data("ui-autocomplete")&&this.$input.autocomplete("search")},disable:function(){this.setProperty("disabled",!0)},enable:function(){this.setProperty("disabled",!1)},readonly:function(){this.setProperty("readonly",!0)},writeable:function(){this.setProperty("readonly",!1)},setProperty:function(t,e){this["_"+t]=e,this.$input.prop(t,e),this.$element.prop(t,e),this.$wrapper[e?"addClass":"removeClass"](t)},destroy:function(){this.$element.val(this.getTokensList()),this.$element.css(this.$element.data("original-styles")),this.$element.prop("tabindex",this.$element.data("original-tabindex"));var e=t('label[for="'+this.$input.prop("id")+'"]');return e.length&&e.prop("for",this.$element.prop("id")),this.$element.insertBefore(this.$wrapper),this.$element.removeData("original-styles").removeData("original-tabindex").removeData("bs.tokenfield"),this.$wrapper.remove(),this.$element}};var i=t.fn.tokenfield;return t.fn.tokenfield=function(e,i){var o,s=[];Array.prototype.push.apply(s,arguments);var r=this.each((function(){var r=t(this),a=r.data("bs.tokenfield"),l="object"==typeof e&&e;"string"==typeof e&&a&&a[e]?(s.shift(),o=a[e].apply(a,s)):a||"string"==typeof e||i||r.data("bs.tokenfield",a=new n(this,l))}));return void 0!==o?o:r},t.fn.tokenfield.defaults={minWidth:60,minLength:0,allowEditing:!0,limit:0,autocomplete:{},typeahead:{},showAutocompleteOnFocus:!1,createTokensOnBlur:!1,delimiter:",",beautify:!0},t.fn.tokenfield.Constructor=n,t.fn.tokenfield.noConflict=function(){return t.fn.tokenfield=i,this},n},void 0===(s="function"==typeof i?i.apply(e,o):i)||(t.exports=s)},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},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){(function(t,i){var o;!function(s){e&&e.nodeType,t&&t.nodeType;var r="object"==typeof i&&i;r.global!==r&&r.window!==r&&r.self;var a,l=2147483647,c=36,d=1,u=26,p=38,h=700,f=72,m=128,g="-",v=/^xn--/,y=/[^\x20-\x7E]/,b=/[\x2E\u3002\uFF0E\uFF61]/g,w={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},x=c-d,k=Math.floor,C=String.fromCharCode;function $(t){throw new RangeError(w[t])}function S(t,e){for(var n=t.length,i=[];n--;)i[n]=e(t[n]);return i}function T(t,e){var n=t.split("@"),i="";return n.length>1&&(i=n[0]+"@",t=n[1]),i+S((t=t.replace(b,".")).split("."),e).join(".")}function _(t){for(var e,n,i=[],o=0,s=t.length;o<s;)(e=t.charCodeAt(o++))>=55296&&e<=56319&&o<s?56320==(64512&(n=t.charCodeAt(o++)))?i.push(((1023&e)<<10)+(1023&n)+65536):(i.push(e),o--):i.push(e);return i}function E(t){return S(t,(function(t){var e="";return t>65535&&(e+=C((t-=65536)>>>10&1023|55296),t=56320|1023&t),e+=C(t)})).join("")}function A(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function I(t,e,n){var i=0;for(t=n?k(t/h):t>>1,t+=k(t/e);t>x*u>>1;i+=c)t=k(t/x);return k(i+(x+1)*t/(t+p))}function D(t){var e,n,i,o,s,r,a,p,h,v,y,b=[],w=t.length,x=0,C=m,S=f;for((n=t.lastIndexOf(g))<0&&(n=0),i=0;i<n;++i)t.charCodeAt(i)>=128&&$("not-basic"),b.push(t.charCodeAt(i));for(o=n>0?n+1:0;o<w;){for(s=x,r=1,a=c;o>=w&&$("invalid-input"),((p=(y=t.charCodeAt(o++))-48<10?y-22:y-65<26?y-65:y-97<26?y-97:c)>=c||p>k((l-x)/r))&&$("overflow"),x+=p*r,!(p<(h=a<=S?d:a>=S+u?u:a-S));a+=c)r>k(l/(v=c-h))&&$("overflow"),r*=v;S=I(x-s,e=b.length+1,0==s),k(x/e)>l-C&&$("overflow"),C+=k(x/e),x%=e,b.splice(x++,0,C)}return E(b)}function P(t){var e,n,i,o,s,r,a,p,h,v,y,b,w,x,S,T=[];for(b=(t=_(t)).length,e=m,n=0,s=f,r=0;r<b;++r)(y=t[r])<128&&T.push(C(y));for(i=o=T.length,o&&T.push(g);i<b;){for(a=l,r=0;r<b;++r)(y=t[r])>=e&&y<a&&(a=y);for(a-e>k((l-n)/(w=i+1))&&$("overflow"),n+=(a-e)*w,e=a,r=0;r<b;++r)if((y=t[r])<e&&++n>l&&$("overflow"),y==e){for(p=n,h=c;!(p<(v=h<=s?d:h>=s+u?u:h-s));h+=c)S=p-v,x=c-v,T.push(C(A(v+S%x,0))),p=k(S/x);T.push(C(A(p,0))),s=I(n,w,i==o),n=0,++i}++n,++e}return T.join("")}a={version:"1.3.2",ucs2:{decode:_,encode:E},decode:D,encode:P,toASCII:function(t){return T(t,(function(t){return y.test(t)?"xn--"+P(t):t}))},toUnicode:function(t){return T(t,(function(t){return v.test(t)?D(t.slice(4).toLowerCase()):t}))}},void 0===(o=function(){return a}.call(e,n,e,t))||(t.exports=o)}()}).call(this,n(8)(t),n(9))},function(t,e,n){var i,o;!function(s,r){"use strict";t.exports?t.exports=r():void 0===(o="function"==typeof(i=r)?i.call(e,n,e,t):i)||(t.exports=o)}(0,(function(t){"use strict";var e=t&&t.IPv6;return{best:function(t){var e,n,i=t.toLowerCase().split(":"),o=i.length,s=8;for(""===i[0]&&""===i[1]&&""===i[2]?(i.shift(),i.shift()):""===i[0]&&""===i[1]?i.shift():""===i[o-1]&&""===i[o-2]&&i.pop(),-1!==i[(o=i.length)-1].indexOf(".")&&(s=7),e=0;e<o&&""!==i[e];e++);if(e<s)for(i.splice(e,1,"0000");i.length<s;)i.splice(e,0,"0000");for(var r=0;r<s;r++){n=i[r].split("");for(var a=0;a<3&&("0"===n[0]&&n.length>1);a++)n.splice(0,1);i[r]=n.join("")}var l=-1,c=0,d=0,u=-1,p=!1;for(r=0;r<s;r++)p?"0"===i[r]?d+=1:(p=!1,d>c&&(l=u,c=d)):"0"===i[r]&&(p=!0,u=r,d=1);d>c&&(l=u,c=d),c>1&&i.splice(l,c,""),o=i.length;var h="";for(""===i[0]&&(h=":"),r=0;r<o&&(h+=i[r],r!==o-1);r++)h+=":";return""===i[o-1]&&(h+=":"),h},noConflict:function(){return t.IPv6===this&&(t.IPv6=e),this}}}))},function(t,e,n){var i,o;!function(s,r){"use strict";t.exports?t.exports=r():void 0===(o="function"==typeof(i=r)?i.call(e,n,e,t):i)||(t.exports=o)}(0,(function(t){"use strict";var e=t&&t.SecondLevelDomains,n={list:{ac:" com gov mil net org ",ae:" ac co gov mil name net org pro sch ",af:" com edu gov net org ",al:" com edu gov mil net org ",ao:" co ed gv it og pb ",ar:" com edu gob gov int mil net org tur ",at:" ac co gv or ",au:" asn com csiro edu gov id net org ",ba:" co com edu gov mil net org rs unbi unmo unsa untz unze ",bb:" biz co com edu gov info net org store tv ",bh:" biz cc com edu gov info net org ",bn:" com edu gov net org ",bo:" com edu gob gov int mil net org tv ",br:" adm adv agr am arq art ato b bio blog bmd cim cng cnt com coop ecn edu eng esp etc eti far flog fm fnd fot fst g12 ggf gov imb ind inf jor jus lel mat med mil mus net nom not ntr odo org ppg pro psc psi qsl rec slg srv tmp trd tur tv vet vlog wiki zlg ",bs:" com edu gov net org ",bz:" du et om ov rg ",ca:" ab bc mb nb nf nl ns nt nu on pe qc sk yk ",ck:" biz co edu gen gov info net org ",cn:" ac ah bj com cq edu fj gd gov gs gx gz ha hb he hi hl hn jl js jx ln mil net nm nx org qh sc sd sh sn sx tj tw xj xz yn zj ",co:" com edu gov mil net nom org ",cr:" ac c co ed fi go or sa ",cy:" ac biz com ekloges gov ltd name net org parliament press pro tm ",do:" art com edu gob gov mil net org sld web ",dz:" art asso com edu gov net org pol ",ec:" com edu fin gov info med mil net org pro ",eg:" com edu eun gov mil name net org sci ",er:" com edu gov ind mil net org rochest w ",es:" com edu gob nom org ",et:" biz com edu gov info name net org ",fj:" ac biz com info mil name net org pro ",fk:" ac co gov net nom org ",fr:" asso com f gouv nom prd presse tm ",gg:" co net org ",gh:" com edu gov mil org ",gn:" ac com gov net org ",gr:" com edu gov mil net org ",gt:" com edu gob ind mil net org ",gu:" com edu gov net org ",hk:" com edu gov idv net org ",hu:" 2000 agrar bolt casino city co erotica erotika film forum games hotel info ingatlan jogasz konyvelo lakas media news org priv reklam sex shop sport suli szex tm tozsde utazas video ",id:" ac co go mil net or sch web ",il:" ac co gov idf k12 muni net org ",in:" ac co edu ernet firm gen gov i ind mil net nic org res ",iq:" com edu gov i mil net org ",ir:" ac co dnssec gov i id net org sch ",it:" edu gov ",je:" co net org ",jo:" com edu gov mil name net org sch ",jp:" ac ad co ed go gr lg ne or ",ke:" ac co go info me mobi ne or sc ",kh:" com edu gov mil net org per ",ki:" biz com de edu gov info mob net org tel ",km:" asso com coop edu gouv k medecin mil nom notaires pharmaciens presse tm veterinaire ",kn:" edu gov net org ",kr:" ac busan chungbuk chungnam co daegu daejeon es gangwon go gwangju gyeongbuk gyeonggi gyeongnam hs incheon jeju jeonbuk jeonnam k kg mil ms ne or pe re sc seoul ulsan ",kw:" com edu gov net org ",ky:" com edu gov net org ",kz:" com edu gov mil net org ",lb:" com edu gov net org ",lk:" assn com edu gov grp hotel int ltd net ngo org sch soc web ",lr:" com edu gov net org ",lv:" asn com conf edu gov id mil net org ",ly:" com edu gov id med net org plc sch ",ma:" ac co gov m net org press ",mc:" asso tm ",me:" ac co edu gov its net org priv ",mg:" com edu gov mil nom org prd tm ",mk:" com edu gov inf name net org pro ",ml:" com edu gov net org presse ",mn:" edu gov org ",mo:" com edu gov net org ",mt:" com edu gov net org ",mv:" aero biz com coop edu gov info int mil museum name net org pro ",mw:" ac co com coop edu gov int museum net org ",mx:" com edu gob net org ",my:" com edu gov mil name net org sch ",nf:" arts com firm info net other per rec store web ",ng:" biz com edu gov mil mobi name net org sch ",ni:" ac co com edu gob mil net nom org ",np:" com edu gov mil net org ",nr:" biz com edu gov info net org ",om:" ac biz co com edu gov med mil museum net org pro sch ",pe:" com edu gob mil net nom org sld ",ph:" com edu gov i mil net ngo org ",pk:" biz com edu fam gob gok gon gop gos gov net org web ",pl:" art bialystok biz com edu gda gdansk gorzow gov info katowice krakow lodz lublin mil net ngo olsztyn org poznan pwr radom slupsk szczecin torun warszawa waw wroc wroclaw zgora ",pr:" ac biz com edu est gov info isla name net org pro prof ",ps:" com edu gov net org plo sec ",pw:" belau co ed go ne or ",ro:" arts com firm info nom nt org rec store tm www ",rs:" ac co edu gov in org ",sb:" com edu gov net org ",sc:" com edu gov net org ",sh:" co com edu gov net nom org ",sl:" com edu gov net org ",st:" co com consulado edu embaixada gov mil net org principe saotome store ",sv:" com edu gob org red ",sz:" ac co org ",tr:" av bbs bel biz com dr edu gen gov info k12 name net org pol tel tsk tv web ",tt:" aero biz cat co com coop edu gov info int jobs mil mobi museum name net org pro tel travel ",tw:" club com ebiz edu game gov idv mil net org ",mu:" ac co com gov net or org ",mz:" ac co edu gov org ",na:" co com ",nz:" ac co cri geek gen govt health iwi maori mil net org parliament school ",pa:" abo ac com edu gob ing med net nom org sld ",pt:" com edu gov int net nome org publ ",py:" com edu gov mil net org ",qa:" com edu gov mil net org ",re:" asso com nom ",ru:" ac adygeya altai amur arkhangelsk astrakhan bashkiria belgorod bir bryansk buryatia cbg chel chelyabinsk chita chukotka chuvashia com dagestan e-burg edu gov grozny int irkutsk ivanovo izhevsk jar joshkar-ola kalmykia kaluga kamchatka karelia kazan kchr kemerovo khabarovsk khakassia khv kirov koenig komi kostroma kranoyarsk kuban kurgan kursk lipetsk magadan mari mari-el marine mil mordovia mosreg msk murmansk nalchik net nnov nov novosibirsk nsk omsk orenburg org oryol penza perm pp pskov ptz rnd ryazan sakhalin samara saratov simbirsk smolensk spb stavropol stv surgut tambov tatarstan tom tomsk tsaritsyn tsk tula tuva tver tyumen udm udmurtia ulan-ude vladikavkaz vladimir vladivostok volgograd vologda voronezh vrn vyatka yakutia yamal yekaterinburg yuzhno-sakhalinsk ",rw:" ac co com edu gouv gov int mil net ",sa:" com edu gov med net org pub sch ",sd:" com edu gov info med net org tv ",se:" a ac b bd c d e f g h i k l m n o org p parti pp press r s t tm u w x y z ",sg:" com edu gov idn net org per ",sn:" art com edu gouv org perso univ ",sy:" com edu gov mil net news org ",th:" ac co go in mi net or ",tj:" ac biz co com edu go gov info int mil name net nic org test web ",tn:" agrinet com defense edunet ens fin gov ind info intl mincom nat net org perso rnrt rns rnu tourism ",tz:" ac co go ne or ",ua:" biz cherkassy chernigov chernovtsy ck cn co com crimea cv dn dnepropetrovsk donetsk dp edu gov if in ivano-frankivsk kh kharkov kherson khmelnitskiy kiev kirovograd km kr ks kv lg lugansk lutsk lviv me mk net nikolaev od odessa org pl poltava pp rovno rv sebastopol sumy te ternopil uzhgorod vinnica vn zaporizhzhe zhitomir zp zt ",ug:" ac co go ne or org sc ",uk:" ac bl british-library co cym gov govt icnet jet lea ltd me mil mod national-library-scotland nel net nhs nic nls org orgn parliament plc police sch scot soc ",us:" dni fed isa kids nsn ",uy:" com edu gub mil net org ",ve:" co com edu gob info mil net org web ",vi:" co com k12 net org ",vn:" ac biz com edu gov health info int name net org pro ",ye:" co com gov ltd me net org plc ",yu:" ac co edu gov org ",za:" ac agric alt bourse city co cybernet db edu gov grondar iaccess imt inca landesign law mil net ngo nis nom olivetti org pix school tm web ",zm:" ac co com edu gov net org sch ",com:"ar br cn de eu gb gr hu jpn kr no qc ru sa se uk us uy za ",net:"gb jp se uk ",org:"ae",de:"com "},has:function(t){var e=t.lastIndexOf(".");if(e<=0||e>=t.length-1)return!1;var i=t.lastIndexOf(".",e-1);if(i<=0||i>=e-1)return!1;var o=n.list[t.slice(e+1)];return!!o&&o.indexOf(" "+t.slice(i+1,e)+" ")>=0},is:function(t){var e=t.lastIndexOf(".");if(e<=0||e>=t.length-1)return!1;if(t.lastIndexOf(".",e-1)>=0)return!1;var i=n.list[t.slice(e+1)];return!!i&&i.indexOf(" "+t.slice(0,e)+" ")>=0},get:function(t){var e=t.lastIndexOf(".");if(e<=0||e>=t.length-1)return null;var i=t.lastIndexOf(".",e-1);if(i<=0||i>=e-1)return null;var o=n.list[t.slice(e+1)];return o?o.indexOf(" "+t.slice(i+1,e)+" ")<0?null:t.slice(i+1):null},noConflict:function(){return t.SecondLevelDomains===this&&(t.SecondLevelDomains=e),this}};return n}))},function(t,e,n){"use strict";(function(t){n.d(e,"a",(function(){return i}));class i{constructor(t){this.promptModal=t}checkNewVersion(){if("true"===sessionStorage.getItem("pat_version_checked"))return void console.log("Skipping version check - already checked this session");const e=parseInt(localStorage.getItem("pat_version_check_time")||"0");(new Date).getTime()-e<2592e5?console.log("Skipping version check - reminder snoozed"):t.ajax({url:"/api/new-release-check",method:"GET",success:(e,n,i)=>{if(sessionStorage.setItem("pat_version_checked","true"),204===i.status)return void console.log("No new version available");const o=localStorage.getItem("pat_ignored_version");e.version!==o?(console.log("Successfully checked for new version"),this.promptModal.showCustom({message:"A new version of Pat is available!",body:t("<div>").append(t("<p>").html(`Version ${e.version} is now available 🎉`)).append(t("<p>").html(`<a href="${e.release_url}" target="_blank">View release details</a>`)),buttons:[{text:"Ignore this version",class:"btn-default",pullLeft:!0,onClick:()=>localStorage.setItem("pat_ignored_version",e.version)},{text:"Remind me later",class:"btn-default",onClick:()=>localStorage.setItem("pat_version_check_time",(new Date).getTime())},{text:"Download",class:"btn-primary",onClick:()=>window.open(e.release_url,"_blank")}]})):console.log(`Skipping version prompt - version ignored (${o})`)},error:function(t,e,n){console.log("Version check failed:",e,n)}})}}}).call(this,n(0))},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var i=n(1);class o{constructor(t){this.statusPopover=t}init(){this.requestSystemPermission()}isSupported(){if(!window.Notification||!Notification.requestPermission)return!1;if("granted"===Notification.permission)return!0;try{new Notification("")}catch(t){if("TypeError"==t.name)return!1}return!0}requestSystemPermission(){if(!this.isSupported()){return this.statusPopover.getNotificationsErrorPanelBody().html("Not supported by this browser."),void this.statusPopover.showNotificationsErrorPanel()}Notification.requestPermission((t=>{const e=this.statusPopover.getNotificationsErrorPanelBody();"granted"===t?this.statusPopover.hideNotificationsErrorPanel():Object(i.h)()?this.statusPopover.displayInsecureOriginWarning("notifications"):(e.html("Notification permission denied or dismissed."),this.statusPopover.showNotificationsErrorPanel())}))}show(t,e=""){if(this.isSupported()&&"granted"===Notification.permission){return new Notification(t,{body:e,icon:"/dist/static/pat_logo.png"})}return null}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var i=n(0),o=n.n(i);class s{constructor(){this.statusPopoverDiv=null,this.guiStatusLight=null,this.navbarBrand=null,this._panelSelectors={websocketError:"#websocket_error",webserverInfo:"#webserver_info",notificationsError:"#notifications_error",geolocationError:"#geolocation_error",noError:"#no_error"}}init(){this.statusPopoverDiv=o()("#status_popover_content"),this.guiStatusLight=o()("#gui_status_light"),this.navbarBrand=o()(".navbar-brand"),this._initPopover()}_initPopover(){this.showWebsocketError("Attempting to connect to WebSocket..."),this.showNotificationsErrorPanel(),this.guiStatusLight.popover({placement:"bottom",content:this.statusPopoverDiv,html:!0}),this.guiStatusLight.popover("show"),this.guiStatusLight.popover("hide"),this.statusPopoverDiv.show(),this.navbarBrand.off("click.statusPopover").on("click.statusPopover",(t=>{this.guiStatusLight.popover("toggle")}))}addSection({severity:t,title:e,body:n}){const i=`panel-${t}`,s=o()(`\n <div class="panel panel-sm ${i}" data-severity="${t}">\n <div class="panel-heading"></div>\n <div class="panel-body"></div>\n </div>\n `);s.find(".panel-heading").text(e),s.find(".panel-body").append(n);const r={danger:3,warning:2,info:1},a=r[t]||0;let l=!1;return this.statusPopoverDiv.find(".panel[data-severity]").each((function(){const t=r[o()(this).data("severity")]||0;if(a>t)return o()(this).before(s),l=!0,!1})),l||this.find(this._panelSelectors.noError).before(s),this.updateGUIStatus(),s}removeSection(t){t&&t.length&&(o()(t).remove(),this.updateGUIStatus())}_setPanelState(t,e,n=null,i=!1){const o=this.find(t);if(o.length){if(null!==n){const e=o.find(".panel-body");e.length?i?e.html(n):e.text(n):console.warn(`StatusPopover: Panel "${t}" is missing a .panel-body, cannot set content.`)}this.showGUIStatus(o,e),this.updateGUIStatus()}}updateGUIStatus(){let t="success";this.statusPopoverDiv.find(".panel-info").not(".hidden").not(".ignore-status").each((function(e){t="info"})),this.statusPopoverDiv.find(".panel-warning").not(".hidden").not(".ignore-status").each((function(e){t="warning"})),this.statusPopoverDiv.find(".panel-danger").not(".hidden").not(".ignore-status").each((function(e){t="danger"})),this.guiStatusLight.removeClass((function(t,e){return(e.match(/(^|\s)btn-\S+/g)||[]).join(" ")})).addClass("btn-"+t),"success"===t?this.showGUIStatus(this.find(this._panelSelectors.noError),!0):this.showGUIStatus(this.find(this._panelSelectors.noError),!1)}showGUIStatus(t,e){const n=o()(t);e?n.removeClass("hidden"):n.addClass("hidden")}find(t){return this.statusPopoverDiv.find(t)}showWebsocketError(t="WebSocket Connection Error"){this._setPanelState(this._panelSelectors.websocketError,!0,t)}hideWebsocketError(){this._setPanelState(this._panelSelectors.websocketError,!1)}showWebserverInfo(t="Webserver active"){this._setPanelState(this._panelSelectors.webserverInfo,!0,t,!0)}hideWebserverInfo(){this._setPanelState(this._panelSelectors.webserverInfo,!1)}showNotificationsErrorPanel(){this._setPanelState(this._panelSelectors.notificationsError,!0)}hideNotificationsErrorPanel(){this._setPanelState(this._panelSelectors.notificationsError,!1)}getNotificationsErrorPanelBody(){return this.find(this._panelSelectors.notificationsError).find(".panel-body")}getNotificationsErrorPanel(){return this.find(this._panelSelectors.notificationsError)}showGeolocationError(t="Geolocation error"){this._setPanelState(this._panelSelectors.geolocationError,!0,t)}hideGeolocationError(){this._setPanelState(this._panelSelectors.geolocationError,!1)}getGeolocationErrorPanel(){return this.find(this._panelSelectors.geolocationError)}displayInsecureOriginWarning(t){let e;if("geolocation"===t)e=this._panelSelectors.geolocationError;else{if("notifications"!==t)return void console.warn("[displayInsecureOriginWarning] Unknown panelKey:",t);e=this._panelSelectors.notificationsError}const n=this.find(e);if(n.length){n.removeClass("panel-info").addClass("panel-warning");const t=n.find(".panel-body");t.find("p.insecure-origin-warning").remove(),t.append('<p class="insecure-origin-warning">Ensure the <a href="https://github.com/la5nta/pat/wiki/The-web-GUI#powerful-features">secure origin criteria for Powerful Features</a> are met.</p>'),this.showGUIStatus(n,!0),this.updateGUIStatus()}}show(){this.guiStatusLight.popover("show")}}},function(t,e,n){"use strict";(function(t){n.d(e,"a",(function(){return o}));var i=n(1);class o{constructor(e){this.statusPopover=e,this.$container=t("#posModal"),this.posId=0}init(){this.$container.length?(this.$container.find("#pos_btn").click((()=>{this.postPosition()})),this.$container.on("shown.bs.modal",(()=>{this.onModalShown()})),this.$container.on("hidden.bs.modal",(()=>{this.onModalHidden()}))):console.error("Geolocation module: Container not found")}handleGeolocationError(t){let e="Geolocation error.";t&&t.message&&(e=t.message),(t.message.search("insecure origin")>0||Object(i.h)())&&this.statusPopover.displayInsecureOriginWarning("geolocation"),this.statusPopover.showGeolocationError(e),this.$container.find("#pos_status").html("Geolocation unavailable.")}updatePositionGeolocation(t){let e;e=/^((?!chrome|android).)*safari/i.test(navigator.userAgent)?new Date:new Date(t.timestamp),this.$container.find("#pos_status").html("Last position update "+Object(i.b)(e)+"..."),this.$container.find("#pos_lat").val(t.coords.latitude),this.$container.find("#pos_long").val(t.coords.longitude),this.$container.find("#pos_ts").val(e.getTime())}updatePositionGPS(t){const e=new Date(t.Time);this.$container.find("#pos_status").html("Last position update "+Object(i.b)(e)+"..."),this.$container.find("#pos_lat").val(t.Lat),this.$container.find("#pos_long").val(t.Lon),this.$container.find("#pos_ts").val(e.getTime())}postPosition(){const e={lat:parseFloat(this.$container.find("#pos_lat").val()),lon:parseFloat(this.$container.find("#pos_long").val()),comment:this.$container.find("#pos_comment").val(),date:new Date(parseInt(this.$container.find("#pos_ts").val()))};t.ajax("/api/posreport",{data:JSON.stringify(e),contentType:"application/json",type:"POST",success:t=>{this.$container.modal("toggle"),Object(i.a)(t)},error:(t,e,n)=>{Object(i.a)(n+": "+t.responseText)}})}onModalShown(){t.ajax({url:"/api/current_gps_position",dataType:"json",beforeSend:()=>{this.$container.find("#pos_status").html("Checking if GPS device is available")},success:t=>{this.$container.find("#pos_status").html("GPS position received"),this.$container.find("#pos_status").html("<strong>Waiting for position from GPS device...</strong>"),this.updatePositionGPS(t)},error:()=>{if(this.$container.find("#pos_status").html("GPS device not available!"),navigator.geolocation){this.$container.find("#pos_status").html("<strong>Waiting for position (geolocation)...</strong>");const t={enableHighAccuracy:!0,maximumAge:0};this.posId=navigator.geolocation.watchPosition((t=>this.updatePositionGeolocation(t)),(t=>this.handleGeolocationError(t)),t)}else this.$container.find("#pos_status").html("Geolocation is not supported by this browser.")}})}onModalHidden(){navigator.geolocation&&0!==this.posId&&(navigator.geolocation.clearWatch(this.posId),this.posId=0)}}}).call(this,n(0))},function(t,e,n){"use strict";(function(t){n.d(e,"a",(function(){return i}));class i{constructor(t,e,n){this.promptModal=t,this.statusPopover=e,this.mycall=n,this.warningSection=null}init(){t(document).on("click","#fix-now-btn",(()=>this.promptRecoveryEmail())),t(document).on("click","#dismiss_password_warning",(()=>this.dismissPasswordRecoveryWarning()))}checkPasswordRecoveryEmail(){this.wasLastVerified(2592e6)||this.isPasswordRecoveryDismissed()||t.ajax("/api/winlink-account/password-recovery-email",{type:"GET",timeout:2e4,success:t=>{t.recovery_email&&""!==t.recovery_email.trim()?(this.setLastVerified(),this.hidePasswordRecoveryWarning()):(this.showPasswordRecoveryWarning(),this.statusPopover.show())},error:(t,e,n)=>{console.log("Password recovery email check failed (expected when offline):",{status:e,error:n,responseText:t.responseText})}})}showPasswordRecoveryWarning(){if(this.warningSection)return;const e=t('\n <div>\n <p>You have no recovery email set for your Winlink account.</p>\n <p>Add one now so you can easily reset a forgotten password.</p>\n <div class="btn-group pull-right" style="margin-top: 10px;">\n <button type="button" class="btn btn-sm btn-default" id="dismiss_password_warning">Later</button>\n <button type="button" class="btn btn-sm btn-primary" id="fix-now-btn">Add Email</button>\n </div>\n </div>\n ');this.warningSection=this.statusPopover.addSection({severity:"warning",title:"Secure Your Account",body:e})}hidePasswordRecoveryWarning(){this.warningSection&&(this.statusPopover.removeSection(this.warningSection),this.warningSection=null)}dismissPasswordRecoveryWarning(){const t=Date.now()+3024e5;localStorage.setItem(`passwordRecoveryDismissed_${this.mycall}`,t.toString()),this.hidePasswordRecoveryWarning()}isPasswordRecoveryDismissed(){const t=localStorage.getItem(`passwordRecoveryDismissed_${this.mycall}`);return!!t&&Date.now()<parseInt(t,10)}setLastVerified(){localStorage.setItem(`passwordRecoveryLastCheck_${this.mycall}`,Date.now().toString())}wasLastVerified(t){const e=localStorage.getItem(`passwordRecoveryLastCheck_${this.mycall}`);return!!e&&Date.now()-e<t}promptRecoveryEmail(){this.promptModal.showCustom({message:"Recovery Email Address",body:'\n <p>Please enter your recovery email address. This will be used to recover your password if you forget it.</p>\n <div class="form-group">\n <input type="email" class="form-control" id="recoveryEmail" placeholder="Enter your recovery email">\n </div>\n <div id="recovery-error" class="text-danger" style="display: none;"></div>\n <small class="form-text text-muted">\n By submitting, your email address will be sent directly to winlink.org. Their privacy policy will apply. See <a href="https://winlink.org/terms_conditions" target="_blank">Winlink\'s Privacy Policy</a>.\n </small> ',buttons:[{text:"Cancel",class:"btn-secondary",onClick:()=>{this.promptModal.hide()}},{text:"Submit",class:"btn-primary",close:!1,onClick:e=>{const n=t(e.target),i=t("#recoveryEmail").val(),o=t("#recovery-error");0===n.find("span.glyphicon").length&&n.prepend('<span class="glyphicon" style="margin-right: 5px; vertical-align: text-bottom;"></span>');const s=n.find("span.glyphicon"),r=n.contents().last()[0];n.prop("disabled",!0),s.attr("class","glyphicon glyphicon-refresh icon-spin"),r.textContent=" Submitting...",o.hide(),t.ajax("/api/winlink-account/password-recovery-email",{type:"PUT",data:JSON.stringify({recovery_email:i}),contentType:"application/json",timeout:2e4,success:()=>{s.attr("class","glyphicon glyphicon-ok"),r.textContent=" Submitted",this.hidePasswordRecoveryWarning(),setTimeout((()=>{this.promptModal.hide()}),5e3)},error:t=>{let e="An unknown error occurred.";t.responseJSON&&t.responseJSON.error?e=t.responseJSON.error:t.responseText&&(e=t.responseText),o.html(e).show(),n.prop("disabled",!1),s.remove(),r.textContent=" Retry"}})}}]})}}}).call(this,n(0))},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var i=n(0),o=n.n(i),s=n(1);class r{constructor(t){this.onMessageClick=t,this.currentFolder="in"}init(){this.folder=o()("#folder"),this.table=this.folder.find("table"),this.table.on("click","th",(t=>{const e=t.currentTarget,n=this.table.find("tbody")[0];Array.from(n.querySelectorAll("tr")).sort(this._comparer(Array.from(e.parentNode.children).indexOf(e),e.asc=!e.asc)).forEach((t=>n.appendChild(t)));const i=this.table[0].querySelector("th.sorted");i&&i!==e&&i.classList.remove("sorted"),e.classList.add("sorted")}))}displayFolder(t){this.currentFolder=t;const e="in"===t||"archive"===t;this.table.empty(),this.table.append(`<thead><tr><th></th><th>Subject</th>\n <th>${e?"From":"To"}</th>\n ${e?"":"<th>P2P</th>"}\n <th>Date</th><th>Message ID</th></tr></thead><tbody></tbody>`);const n=this.table.find("tbody");o.a.getJSON(`/api/mailbox/${t}`,(t=>{t.forEach((t=>{let i="";!e&&t.To?1===t.To.length?i=t.To[0].Addr:t.To.length>1&&(i=`${t.To[0].Addr}...`):e&&(i=t.From.Addr);const r=e?"":`<td>${t.P2POnly?'<span class="glyphicon glyphicon-ok"></span>':""}</td>`,a=o()(`\n <tr id="${t.MID}" class="active${t.Unread?" strong":""}">\n <td>${t.Files.length>0?'<span class="glyphicon glyphicon-paperclip"></span>':""}</td>\n <td>${Object(s.f)(t.Subject)}</td>\n <td>${i}</td>\n ${r}\n <td>${t.Date}</td>\n <td>${t.MID}</td>\n </tr>\n `);n.append(a),a.click((t=>{n.find("tr.active").removeClass("active"),a.addClass("active"),this.onMessageClick(this.currentFolder,a.attr("id"))}))}))}))}_getCellValue(t,e){return t.children[e].innerText||t.children[e].textContent}_comparer(t,e){return(n,i)=>{return o=this._getCellValue(e?n:i,t),s=this._getCellValue(e?i:n,t),""===o||""===s||isNaN(o)||isNaN(s)?o.toString().localeCompare(s):o-s;var o,s}}}},function(t,e,n){"use strict";(function(t){n.d(e,"a",(function(){return s}));var i=n(1);const o={delimiter:[",",";"," "],inputType:"email",createTokensOnBlur:!0};class s{constructor(t){this.mycall=t,this.pollTimer=null}startPolling(){Object(i.i)("forminstance",Math.floor(1e9*Math.random()),1),this._poll()}_forgetPolling(){window.clearTimeout(this.pollTimer),Object(i.c)("forminstance")}_poll(){t.ajax({method:"GET",url:"/api/form",dataType:"json",success:e=>{console.log("done polling"),console.log(e),t("#composer").hasClass("hidden")||this._writeToComposer(e)},error:()=>{t("#composer").hasClass("hidden")||(this.pollTimer=window.setTimeout(this._poll.bind(this),1e3))}})}_writeToComposer(e){t("#msg_body").val(e.msg_body),e.msg_to&&t("#msg_to").tokenfield("setTokens",e.msg_to.split(/[ ;,]/).filter(Boolean)),e.msg_cc&&t("#msg_cc").tokenfield("setTokens",e.msg_cc.split(/[ ;,]/).filter(Boolean)),e.msg_subject&&t("#msg_subject").val(e.msg_subject)}init(){t("#compose_btn").click((e=>{this.close(!0),t("#composer").modal("toggle")})),t("#msg_to").tokenfield(o),t("#msg_cc").tokenfield(o),t("#composer").on("change",".btn-file :file",this._handleFileSelection.bind(this)),t("#composer").on("hidden.bs.modal",this._forgetPolling.bind(this)),t("#composer_error").hide(),t("#compose_cancel").click((t=>{this.close(!0)})),t("#composer_form").submit((e=>{const n=t("#composer_form"),o=new FormData(n[0]),s=(new Date).toJSON();o.append("date",s);const r=t("#composer").data("in-reply-to");r&&o.append("in_reply_to",r),0==t("#msg_body").val().length&&t("#msg_body").val("<No message body>"),0==t("#msg_subject").val().length&&t("#msg_subject").val("<No subject>"),t.ajax({url:"/api/mailbox/out",method:"POST",data:o,processData:!1,contentType:!1,success:e=>{t("#msg_attachments_input")[0].dataset.storedFiles="[]",t("#composer").modal("hide"),this.close(!0),Object(i.a)(e)},error:e=>{t("#composer_error").html(e.responseText),t("#composer_error").show()}}),e.preventDefault()}))}close(e){if(e){t("#composer_error").val("").hide(),t("#msg_body").val(""),t("#msg_subject").val(""),t("#msg_to").tokenfield("setTokens",[]),t("#msg_cc").tokenfield("setTokens",[]),t("#composer_form")[0].reset(),t("#composer").removeData("in-reply-to"),t("#composer_attachments").empty();let e=t("#msg_attachments_input");e[0].dataset.storedFiles="[]",e.replaceWith(e=e.clone(!0))}t("#composer").modal("hide")}_handleFileSelection(){const e=t("#msg_attachments_input")[0],n=new DataTransfer;let i=[],o=0;const s=e.files.length;try{i=JSON.parse(e.dataset.storedFiles||"[]"),i.forEach((t=>{const e=atob(t.content.split(",")[1]),i=new ArrayBuffer(e.length),o=new Uint8Array(i);for(let t=0;t<e.length;t++)o[t]=e.charCodeAt(t);const s=new Blob([i],{type:t.type}),r=new File([s],t.name,{type:t.type});n.items.add(r)}))}catch(t){console.error("Error parsing stored files:",t)}Array.from(e.files).forEach((t=>{const r=new FileReader;r.onload=r=>{i.push({name:t.name,type:t.type,content:r.target.result}),e.dataset.storedFiles=JSON.stringify(i),n.items.add(t),o++,o===s&&(e.files=n.files,this._previewAttachmentFiles.call(e))},r.readAsDataURL(t)}))}_previewAttachmentFiles(){const e=t("#composer_attachments");e.empty();const n=t('<div class="row"></div>');e.append(n);for(let e=0;e<this.files.length;e++){const o=this.files[e],s=t('<div class="col-xs-6 col-md-3"></div>'),r=t('<a class="attachment-preview"></a>'),a=t('<button type="button" class="close remove-attachment" aria-label="Remove"><span aria-hidden="true">&times;</span></button>');if(a.click((t=>{t.preventDefault(),t.stopPropagation();const e=o.name,n=new DataTransfer;for(let t=0;t<this.files.length;t++)this.files[t].name!==e&&n.items.add(this.files[t]);this.files=n.files;let i=JSON.parse(this.dataset.storedFiles||"[]");i=i.filter((t=>t.name!==e)),this.dataset.storedFiles=JSON.stringify(i),s.remove()})),Object(i.g)(o.name)){const e=new FileReader;e.onload=function(e){r.empty().append(a).append(t('<span class="filesize">').text(Object(i.e)(o.size))).append(t("<img>").attr({src:e.target.result,alt:o.name}))},e.readAsDataURL(o)}else r.empty().append(a).append(t('<span class="filesize">').text(Object(i.e)(o.size))).append("<br>").append(t('<span class="filename">').text(o.name));s.append(r),n.append(s)}}_reAttachFiles(e,n){t("#composer_attachments").empty();const i=t("#msg_attachments_input")[0],o=new DataTransfer;if(n){let s=0;n.forEach((r=>{t.ajax({url:e+"/"+r.Name,method:"GET",xhrFields:{responseType:"blob"},success:t=>{const e=new File([t],r.Name,{type:t.type});o.items.add(e),s++,s===n.length&&(i.files=o.files,this._previewAttachmentFiles.call(i))}})}))}}reply(e,n,i){t("#message_view").modal("hide"),t("#msg_to").tokenfield("setTokens",[n.From.Addr]),t("#msg_cc").tokenfield("setTokens",i?this._replyCarbonCopyList(n):[]),0!=n.Subject.lastIndexOf("Re:",0)?t("#msg_subject").val("Re: "+n.Subject):t("#msg_subject").val(n.Subject),t("#msg_body").val("\n\n"+this._quoteMsg(n)),t("#composer").data("in-reply-to",e+"/"+n.MID),t("#composer").modal("show"),t("#msg_body").focus(),t("#msg_body")[0].setSelectionRange(0,0),this._showReplyForm(e,n.MID,n)}forward(e,n){t("#message_view").modal("hide"),t("#msg_to").tokenfield("setTokens",""),t("#msg_subject").val("Fw: "+n.Subject),t("#msg_body").val(this._quoteMsg(n)),t("#msg_body")[0].setSelectionRange(0,0),this._reAttachFiles(this._buildMessagePath(e,n.MID),n.Files),t("#composer").modal("show"),t("#msg_to-tokenfield").focus()}editAsNew(e,n){t("#message_view").modal("hide"),t("#msg_to").tokenfield("setTokens",n.To.map((function(t){return t.Addr}))),t("#msg_cc").tokenfield("setTokens",n.Cc?n.Cc.map((function(t){return t.Addr})):[]),t("#msg_subject").val(n.Subject),t("#msg_body").val(n.Body),t("#msg_body")[0].setSelectionRange(0,0),this._reAttachFiles(this._buildMessagePath(e,n.MID),n.Files),t("#composer").modal("show"),t("#msg_to-tokenfield").focus()}_quoteMsg(t){let e="--- "+t.Date+" "+t.From.Addr+" wrote: ---\n";const n=t.Body.split("\n");for(let t=0;t<n.length;t++)e+=">"+n[t]+"\n";return e}_replyCarbonCopyList(t){let e=t.To;null!=t.Cc&&t.Cc.length>0&&(e=e.concat(t.Cc));const n={};n[this.mycall]=!0,n[t.From.Addr]=!0;const i=[];for(let t=0;t<e.length;t++)n[e[t].Addr]||(n[e[t].Addr]=!0,i.push(e[t].Addr));return i}_showReplyForm(e,n,o){const s=this._buildMessagePath(e,n);for(let r=0;o.Files&&r<o.Files.length;r++){const a=o.Files[r];if(!Object(i.d)(a.Name))continue;const l=s+"/"+a.Name;return void t.get(l+"?rendertohtml=false",{},(t=>{let i=(new DOMParser).parseFromString(t,"text/xml");if(i){let t=i.evaluate("/RMS_Express_Form/form_parameters/reply_template",i,null,XPathResult.STRING_TYPE,null);t&&t.stringValue&&(window.setTimeout((()=>this.startPolling()),500),open(l+"?rendertohtml=true&in-reply-to="+encodeURIComponent(e+"/"+n)))}}),"text")}}_buildMessagePath(t,e){return"/api/mailbox/"+encodeURIComponent(t)+"/"+encodeURIComponent(e)}}}).call(this,n(0))},function(t,e,n){"use strict";(function(t){n.d(e,"a",(function(){return i}));class i{constructor(t){this.composer=t,this.formsCatalog=null}init(){t("#updateFormsButton").click((()=>this.update())),t.getJSON("/api/formcatalog").done((e=>{this._initFormSelect(e),t("#formSearchInput").on("input",(e=>{this._filterForms(t(e.target).val().toLowerCase())})),t("#clearSearchButton").click((()=>{t("#formSearchInput").val(""),this._filterForms("")}))})).fail((t=>{this._initFormSelect(null)}))}update(){t("#updateFormsResponse").text(""),t("#updateFormsError").text("");const e=t("#updateFormsButton"),n=t("#updateFormsSpinner");e.prop("disabled",!0),n.show().addClass("icon-spin"),t.ajax({method:"POST",url:"/api/formsUpdate",success:e=>{t("#updateFormsError").text("");let n=JSON.parse(e);switch(n.action){case"none":t("#updateFormsResponse").text("You already have the latest forms version");break;case"update":t("#updateFormsResponse").text("Updated forms to "+n.newestVersion),this.init()}},error:e=>{t("#updateFormsResponse").text(""),t("#updateFormsError").text(e.responseText)},complete:()=>{e.prop("disabled",!1),n.hide().removeClass("icon-spin")}})}_filterForms(e){let n=0;t(".form-item").each((function(){const i=t(this),o=(i.data("template-path")||"").toLowerCase().includes(e);i.css("display",o?"":"none"),o&&n++})),t(".folder-container").each((function(){const e=t(this),n=e.find(".form-item").filter((function(){return"none"!==t(this).css("display")})).length>0;e.css("display",n?"":"none")})),n<20?t(".folder-toggle.collapsed").each((function(){t(this).click()})):t(".folder-toggle:not(.collapsed)").each((function(){t(this).click()}))}_initFormSelect(e){this.formsCatalog=e,e&&e.path&&(e.folders&&e.folders.length>0||e.forms&&e.forms.length>0)?(t("#formsVersion").html('<span>(ver <a href="http://www.winlink.org/content/all_standard_templates_folders_one_zip_self_extracting_winlink_express_ver_12142016">'+e.version+"</a>)</span>"),t("#updateFormsVersion").html(e.version),t("#formsRootFolderName").text(e.path),t("#formFolderRoot").html(""),this._appendFormFolder("formFolderRoot",e)):(t("#formsRootFolderName").text("missing form templates"),t("#formFolderRoot").append("\n <h6>Form templates not downloaded</h6>\n Use Action → Update Form Templates to download now\n "))}_appendFormFolder(e,n,i=0){if(!n.folders&&!n.forms)return;const o=t(`#${e}`);if(n.folders&&n.folders.length>0&&n.folders.forEach((e=>{if(e.form_count>0){const n=`folder-content-${Math.random().toString(36).substr(2,9)}`,s=t(`\n <div class="folder-container ${i>0?"nested-folder":""}">\n <button class="btn btn-secondary folder-toggle mb-2 collapsed"\n data-toggle="collapse"\n data-target="#${n}">\n ${e.name}\n </button>\n <div id="${n}" class="collapse">\n <div class="folder-content"></div>\n </div>\n </div>\n `);o.append(s),this._appendFormFolder(`${n} .folder-content`,e,i+1)}})),n.forms&&n.forms.length>0){const e=t('<div class="forms-container"></div>');n.forms.forEach((n=>{const i=t(`\n <div class="form-item">\n <button class="btn btn-light btn-block" style="text-align: left">\n ${n.name}\n </button>\n </div>\n `).data("template-path",n.template_path);i.find("button").on("click",(()=>{const e=t("#composer").data("in-reply-to"),i=e?"&in-reply-to="+encodeURIComponent(e):"",o=encodeURIComponent(n.template_path);this._onFormLaunching(`/api/forms?template=${o}${i}`)})),e.append(i)})),o.append(e)}}_onFormLaunching(e){t("#selectForm").modal("hide"),this.composer.startPolling(),window.open(e)}}}).call(this,n(0))},function(t,e,n){"use strict";(function(t){n.d(e,"a",(function(){return o}));var i=n(1);class o{constructor(t){this.composer=t}init(){this.view=t("#message_view"),this.subject=this.view.find("#subject"),this.headers=this.view.find("#headers"),this.body=this.view.find("#body"),this.attachments=this.view.find("#attachments"),this.replyBtn=t("#reply_btn"),this.replyAllBtn=t("#reply_all_btn"),this.forwardBtn=t("#forward_btn"),this.editAsNewBtn=t("#edit_as_new_btn"),this.deleteBtn=t("#delete_btn"),this.archiveBtn=t("#archive_btn"),this.confirmDelete=t("#confirm_delete")}_buildMessagePath(t,e){return"/api/mailbox/"+encodeURIComponent(t)+"/"+encodeURIComponent(e)}_setRead(e,n){t.ajax(this._buildMessagePath(e,n)+"/read",{data:JSON.stringify({read:!0}),contentType:"application/json",type:"POST",success:function(t){},error:function(t,e,n){Object(i.a)(n+": "+t.responseText)}})}_deleteMessage(e,n){this.confirmDelete.on("click",".btn-ok",(o=>{this.view.modal("hide");const s=t(o.delegateTarget);t.ajax(this._buildMessagePath(e,n),{type:"DELETE",success:function(t){s.modal("hide"),Object(i.a)("Message deleted")},error:function(t,e,n){s.modal("hide"),Object(i.a)(n+": "+t.responseText)}})})),this.confirmDelete.modal("show")}_archiveMessage(e,n){t.ajax("/api/mailbox/archive",{headers:{"X-Pat-SourcePath":this._buildMessagePath(e,n)},contentType:"application/json",type:"POST",success:t=>{this.view.modal("hide"),Object(i.a)("Message archived")},error:function(t,e,n){Object(i.a)(n+": "+t.responseText)}})}displayMessage(e,n){const o=this._buildMessagePath(e,n);t.getJSON(o,(s=>{this.subject.text(s.Subject),this.headers.empty(),this.headers.append("Date: "+s.Date+"<br>"),this.headers.append("From: "+s.From.Addr+"<br>"),this.headers.append("To: ");for(let t=0;s.To&&t<s.To.length;t++)this.headers.append("<el>"+s.To[t].Addr+"</el>"+(s.To.length-1>t?", ":""));if(s.P2POnly&&this.headers.append(" (<strong>P2P only</strong>)"),s.Cc){this.headers.append("<br>Cc: ");for(let t=0;t<s.Cc.length;t++)this.headers.append("<el>"+s.Cc[t].Addr+"</el>"+(s.Cc.length-1>t?", ":""))}this.body.html(s.BodyHTML),this.attachments.empty();const r=t('<div class="row"></div>');this.attachments.append(r),s.Files?this.attachments.show():this.attachments.hide();for(let e=0;s.Files&&e<s.Files.length;e++){const n=s.Files[e],r=Object(i.d)(n.Name);let a="false";r&&(a="true");const l=o+"/"+n.Name+"?rendertohtml="+a,c=t('<div class="col-xs-6 col-md-3"></div>'),d=t('<a class="attachment-preview"></a>');Object(i.g)(n.Name)?(d.attr("target","_blank").attr("href",o+"/"+n.Name),d.html('<span class="filesize">'+Object(i.e)(n.Size)+'</span><span class="glyphicon glyphicon-paperclip"></span> <img src="'+o+"/"+n.Name+'" alt="'+n.Name+'">'),c.append(d),this.attachments.append(c)):r?this.attachments.append('<div class="col-xs-6 col-md-3"><a target="_blank" href="'+l+'" class="btn btn-default navbar-btn"><span class="glyphicon glyphicon-edit"></span> '+r+"</a></div>"):(d.attr("target","_blank").attr("href",o+"/"+n.Name),d.html('<span class="filesize">'+Object(i.e)(n.Size)+'</span><span class="glyphicon glyphicon-paperclip"></span> <br><span class="filename">'+n.Name+"</span>"),c.append(d),this.attachments.append(c))}this.replyBtn.off("click"),this.replyBtn.click((t=>{this.composer.reply(e,s,!1)})),this.replyAllBtn.off("click"),this.replyAllBtn.click((t=>{this.composer.reply(e,s,!0)})),this.forwardBtn.off("click"),this.forwardBtn.click((t=>{this.composer.forward(e,s)})),this.editAsNewBtn.off("click"),this.editAsNewBtn.click((t=>{this.composer.editAsNew(e,s)})),this.deleteBtn.off("click"),this.deleteBtn.click((t=>{this._deleteMessage(e,n)})),this.archiveBtn.off("click"),this.archiveBtn.click((t=>{this._archiveMessage(e,n)})),"archive"==e?this.archiveBtn.parent().hide():this.archiveBtn.parent().show(),this.view.show(),this.view.modal("show");let a=e;s.Read||window.setTimeout((()=>{this._setRead(a,s.MID)}),2e3)}))}}}).call(this,n(0))},function(t,e,n){"use strict";(function(t){n.d(e,"a",(function(){return o}));var i=n(1);class o{constructor(){this.cancelCloseTimer=!1}init(){this.progressBar=t("#navbar_progress")}update(t){if(this.cancelCloseTimer=!t.done,t.receiving||t.sending){const e=Math.ceil(100*t.bytes_transferred/t.bytes_total);let n=(t.receiving?"Receiving":"Sending")+" "+t.mid+" ("+t.bytes_total+" bytes)";t.subject&&(n+=" - "+Object(i.f)(t.subject)),this.progressBar.find(".progress-text").text(n),this.progressBar.find(".progress-bar").css("width",e+"%").text(e+"%")}this.progressBar.is(":visible")&&t.done?window.setTimeout((()=>{this.cancelCloseTimer||this.progressBar.fadeOut(500)}),3e3):!t.receiving&&!t.sending||t.done||this.progressBar.show()}}}).call(this,n(0))},function(t,e,n){"use strict";(function(t){n.d(e,"a",(function(){return i}));class i{constructor(t){this.onReadyClick=t,this.statusText=null}init(){this.statusText=t("#status_text")}update(t){const e=this.statusText;e.empty().off("click").attr("data-toggle","tooltip").attr("data-placement","bottom").tooltip();const n=()=>{e.tooltip("hide"),this.disconnect(!1,(()=>{e.empty().append("Disconnecting... "),e.off("click").click((()=>{e.off("click"),this.disconnect(!0),e.tooltip("hide")})),e.attr("title","Click to force disconnect").tooltip("fixTitle").tooltip("show")}))};t.dialing?(e.append("Dialing... "),e.click(n),e.attr("title","Click to abort").tooltip("fixTitle").tooltip("show")):t.connected?(e.append("Connected "+t.remote_addr),e.click(n),e.attr("title","Click to disconnect").tooltip("fixTitle").tooltip("hide")):(t.active_listeners.length>0?e.append("<i>Listening "+t.active_listeners+"</i>"):e.append("<i>Ready</i>"),e.attr("title","Click to connect").tooltip("fixTitle").tooltip("hide"),e.click(this.onReadyClick))}disconnect(e,n){void 0===n&&(n=()=>{}),t.post("/api/disconnect?dirty="+e,{},(function(t){n()}),"json")}}}).call(this,n(0))},function(t,e,n){"use strict";n.d(e,"a",(function(){return p}));var i=n(4),o=n.n(i),s=n(0),r=n.n(s),a=n(1);class l{constructor(){this.activePopovers=[]}attach(t,e,n="Prediction Details"){if(!t||!e)return t;let i="";return Object.entries(e).forEach((([t,e])=>{i+=`${t}: ${e}\n`})),i&&(t.attr("data-toggle","popover").attr("data-html","true").attr("data-content",'<pre style="text-align: left; margin: 0; background: transparent; border: 0; padding: 0;">'+i.trim()+"</pre>").attr("data-placement","left").attr("title",n),t.popover({container:"body",html:!0,trigger:"hover",template:'<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'}),this.activePopovers.push(t)),t}hide(t){t&&t.data("bs.popover")&&t.popover("hide")}destroyAll(){r()('.link-quality-cell span[data-toggle="popover"]').popover("destroy"),this.activePopovers=[]}}class c{constructor(){this.modalId="rawDataModal"}show(t,e){if(!e)return;this.remove();let n=`<div class="modal fade" id="${this.modalId}" tabindex="-1" role="dialog">\n <div class="modal-dialog modal-lg">\n <div class="modal-content">\n <div class="modal-header">\n <button type="button" class="close" data-dismiss="modal" aria-label="Close">\n <span aria-hidden="true">&times;</span>\n </button>\n <h4 class="modal-title">Propagation Prediction Details: ${t}</h4>\n </div>\n <div class="modal-body">\n <div style="overflow: auto;">\n <pre style="white-space: pre; width: auto; margin-bottom: 0;">${e}</pre>\n </div>\n </div>\n <div class="modal-footer">\n <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>\n </div>\n </div>\n </div>\n </div>`;r()("body").append(n),r()(`#${this.modalId}`).modal("show")}remove(){r()(`#${this.modalId}`).remove()}}class d{constructor(){this.predictionPopover=new l,this.predictionModal=new c,this.rmslistData=[],this.filteredData=[],this.itemsShown=0,this.itemsPerLoad=100,this.hideLinkQuality=!0,this.onRowClick=null}init(){r()("#targetFilterInput").on("input",(()=>this.filterRmslist())),r()("#loadmore-btn").click((()=>{this.loadMoreItems()})),r()("#updateRmslistButton").click((t=>{r()(t.target).prop("disabled",!0),this.updateRmslist(!0)})),r()("#modeSearchSelect").change((()=>{this.updateRmslist()})),r()("#bandSearchSelect").change((()=>{this.updateRmslist()})),r()("#rmslist-container").on("shown.bs.collapse",(()=>{this.updateRmslist()})),r()("#rmslist-container").on("hidden.bs.collapse",(()=>{this.reset()}))}reset(){r()("#rmslist-container").collapse("hide"),this.rmslistData=[],this.filteredData=[],this.itemsShown=0,r()("#rmslist tbody").empty(),r()("#rmslist-loadmore").hide(),this.predictionModal.remove(),this.predictionPopover.destroyAll()}onTransportChange(t){switch(t){case"ardop":case"pactor":case"varafm":case"varahf":r()("#modeSearchSelect").val(t);break;case"ax25":case"ax25+linux":case"ax25+agwpe":case"ax25+serial-tnc":r()("#modeSearchSelect").val("packet");break;default:return}r()("#modeSearchSelect").selectpicker("refresh"),this.updateRmslist()}updateRmslist(t){let e=r()("#rmslist tbody");this.predictionModal.remove(),this.predictionPopover.destroyAll();let n={mode:r()("#modeSearchSelect").val(),band:r()("#bandSearchSelect").val(),"force-download":!0===t};r.a.ajax({method:"GET",url:"/api/rmslist",dataType:"json",data:n,beforeSend:()=>{e.empty(),r()("#rmslistSpinner").show(),r()("#rmslist-loadmore").hide()},success:t=>{this.rmslistData=t,this.itemsShown=0,this.filterRmslist()},complete:()=>{r()("#rmslistSpinner").hide(),r()("#updateRmslistButton").prop("disabled",!1)}})}filterRmslist(){const t=r()("#targetFilterInput").val().toLowerCase();this.filteredData=this.rmslistData.filter((e=>e.callsign.toLowerCase().startsWith(t))),this.itemsShown=Math.min(this.itemsPerLoad,this.filteredData.length),this.hideLinkQuality=this.filteredData.every((t=>null==t.prediction));const e=this.filteredData.slice(0,this.itemsShown);this.renderRmslist(e,this.hideLinkQuality),this.updateLoadMoreControls()}loadMoreItems(){const t=this.itemsShown;this.itemsShown=Math.min(this.itemsShown+this.itemsPerLoad,this.filteredData.length);const e=this.filteredData.slice(t,this.itemsShown);this.appendToRmslist(e),this.updateLoadMoreControls()}updateLoadMoreControls(){r()("#showing-count").text(this.itemsShown),r()("#total-results").text(this.filteredData.length);const t=this.itemsShown<this.filteredData.length;r()("#loadmore-btn").toggle(t),r()("#rmslist-loadmore").toggle(this.filteredData.length>0)}appendToRmslist(t){this.renderRmslistRows(t,this.hideLinkQuality)}renderRmslist(t,e){r()("#rmslist tbody").empty(),r()(".link-quality-column").toggle(!e),this.renderRmslistRows(t,e)}renderRmslistRows(t,e){let n=r()("#rmslist tbody");t.forEach((t=>{let i=r()("<tr>").append(r()('<td class="text-left">').text(t.callsign)).append(r()('<td class="text-left">').text(t.distance.toFixed(0)+" km")).append(r()('<td class="text-left">').text(t.modes)).append(r()('<td class="text-right">').text(t.dial.desc)),o=r()('<td class="text-right link-quality-cell">');if(e)o.hide();else{let e=null==t.prediction?"N/A":t.prediction.link_quality+"%",n=r()("<span>").text(e);t.prediction&&(n.css("cursor","pointer").css("border-bottom","1px dotted #337ab7"),t.prediction.output_values&&this.predictionPopover.attach(n,t.prediction.output_values),t.prediction.output_raw&&n.on("click",(e=>(e.stopPropagation(),e.preventDefault(),this.predictionPopover.hide(n),this.predictionModal.show(t.callsign,t.prediction.output_raw),!1)))),o.append(n)}i.append(o),i.click((e=>{n.find(".active").removeClass("active"),i.addClass("active"),this.onRowClick&&this.onRowClick(t.url)})),n.append(i)}))}}var u=n(3);class p{constructor(t){this.mycall=t,this.initialized=!1,this.connectAliases={},this.rmslistView=new d,this.preserveAliasSelection=!1,this.promptModal=new u.a}init(){this.promptModal.init(),r()("#connect_btn").click((()=>this.connect())),r()("#connectForm input").keypress((t=>{if(13==t.which)return this.connect(),!1})),r()("#freqInput").on("focusin focusout",(t=>{window.setTimeout((()=>{r()("#connect_btn").prop("disabled","focusin"==t.type)}),300)})),r()("#freqInput").change((()=>{this.onConnectInputChange(),this.onConnectFreqChange()})),r()("#bandwidthInput").change((t=>this.onConnectBandwidthChange(t))),r()("#radioOnlyInput").change((()=>this.onConnectInputChange())),r()("#addrInput").change((()=>this.onConnectInputChange())),r()("#targetInput").change((()=>this.onConnectInputChange())),r()("#connectRequestsInput").change((()=>this.onConnectInputChange())),r()("#connectURLInput").change((t=>{this.setConnectValues(r()(t.target).val())})),r()("#aliasActionBtn").click((()=>{const t=r()("#aliasSelect").val();t&&""!==t?this.deleteAlias(t):this.saveAsNewAlias()})),this.rmslistView.init(),this.rmslistView.onRowClick=t=>this.setConnectValues(t),r()("#connectModal").on("hidden.bs.modal",(()=>this.rmslistView.reset())),r()("#transportSelect").change((t=>{r()("#bandwidthInput").val("").change(),r()("#addrInput").val("").change(),r()("#freqInput").val("").change(),r()("#connectRequestsInput").val("").change(),this.setConnectURL(""),this.refreshExtraInputGroups(),this.onConnectInputChange(),this.onConnectFreqChange(),this.rmslistView.onTransportChange(r()(t.target).val())}));let t=localStorage.getItem(`pat_connect_url_${this.mycall}`);null!=t&&this.setConnectValues(t),this.refreshExtraInputGroups(),this.initialized=!0,this.updateConnectAliases(),this.updateAliasActionButton(),this._initConfigDefaults()}_initConfigDefaults(){r.a.getJSON("/api/config").done((function(t){t.ardop&&t.ardop.connect_requests&&r()("#connectRequestsInput").attr("placeholder",t.ardop.connect_requests)})).fail((function(){console.log("Failed to load config defaults")}))}getConnectURL(){return r()("#connectURLInput").val()}setConnectURL(t){r()("#connectURLInput").val(decodeURIComponent(t))}buildConnectURL(t={}){const{preserveFreq:e=!1}=t;let n=r()("#transportSelect").val();var i,s=o()(this.getConnectURL());return i=(i="telnet"===n?o()(n+"://"+r()("#addrInput").val()+s.search()):s.protocol(n).hostname(r()("#addrInput").val())).path(r()("#targetInput").val()),i=r()("#freqInput").val()&&(e||r()("#freqInput").parent().hasClass("has-success"))?i.setQuery("freq",r()("#freqInput").val()):i.removeQuery("freq"),i=r()("#bandwidthInput").val()?i.setQuery("bw",r()("#bandwidthInput").val()):i.removeQuery("bw"),i=r()("#radioOnlyInput").is(":checked")?i.setQuery("radio_only","true"):i.removeQuery("radio_only"),(i=r()("#connectRequestsInput").val()?i.setQuery("connect_requests",r()("#connectRequestsInput").val()):i.removeQuery("connect_requests")).build()}onConnectFreqChange(){if(!this.initialized)return void console.log("Skipping QSY during initialization");r()("#qsyWarning").empty().attr("hidden",!0);const t=r()("#freqInput");t.css("text-decoration","none currentcolor solid");const e=t.parent();["has-error","has-success","has-warning"].forEach((t=>{e.removeClass(t)})),e.tooltip("destroy");const n={transport:r()("#transportSelect").val(),freq:new Number(t.val())};0!=n.freq&&(console.log("QSY: "+JSON.stringify(n)),r.a.ajax({method:"POST",url:"/api/qsy",data:JSON.stringify(n),contentType:"application/json",success:()=>{e.addClass("has-success")},error:n=>{t.css("text-decoration","line-through"),503==n.status?e.attr("data-toggle","tooltip").attr("title","Rigcontrol is not configured for the selected transport. Set radio frequency manually.").tooltip("fixTitle"):([e,r()("#qsyWarning")].forEach((t=>{t.attr("data-toggle","tooltip").attr("title","Could not set radio frequency. See log output for more details and/or set the frequency manually.").tooltip("fixTitle")})),e.addClass("has-error"),r()("#qsyWarning").html('<span class="glyphicon glyphicon-warning-sign"></span> QSY failure').attr("hidden",!1))},complete:()=>{this.withPreservedAliasSelection((()=>{this.onConnectInputChange()}))}}))}onConnectBandwidthChange(t){const e=r()(t.target);console.log("connect bandwidth change "+e.val()),e.attr("x-value",e.val()),""===e.val()&&e.removeAttr("x-value"),this.onConnectInputChange()}onConnectInputChange(){this.setConnectURL(this.buildConnectURL()),this.preserveAliasSelection||(r()("#aliasSelect").val("").selectpicker("refresh"),this.updateAliasActionButton())}updateAliasActionButton(){const t=r()("#aliasSelect").val(),e=r()("#aliasActionBtn"),n=e.find(".glyphicon");t&&""!==t?(n.removeClass("glyphicon-plus").addClass("glyphicon-trash"),e.attr("title","Delete selected alias"),e.show()):(n.removeClass("glyphicon-trash").addClass("glyphicon-plus"),e.attr("title","Save current configuration as new alias"),e.show())}withPreservedAliasSelection(t){this.preserveAliasSelection=!0,t(),this.preserveAliasSelection=!1}deleteAlias(t){this.promptModal.showCustom({message:`Are you sure you want to delete the alias "${t}"?`,buttons:[{text:"Cancel",class:"btn-default",onClick:()=>{}},{text:"Delete",class:"btn-danger",onClick:()=>{r.a.ajax({method:"DELETE",url:`/api/config/connect_aliases/${encodeURIComponent(t)}`,success:()=>{delete this.connectAliases[t],r()("#aliasSelect option").filter((function(){return r()(this).text()===t})).remove(),r()("#aliasSelect").val("").selectpicker("refresh"),this.updateAliasActionButton()},error:t=>{console.error("Failed to delete alias:",t)}})}}]})}validateAliasName(t){return t&&/^[a-zA-Z0-9_.@-]+$/.test(t)?this.connectAliases[t]?"An alias with this name already exists.":null:"Alias name must contain only letters, numbers, dashes, underscores, dots, and @ symbols."}promptForAliasName(){return new Promise((t=>{const e=(n=null)=>{const i="aliasNameInput",o=r()("<div>");o.append(r()("<p>").text("Create a new alias to save this connection configuration for quick access.")),o.append(r()("<p>").addClass("text-muted small").text("Allowed characters: letters, numbers, dashes (-), underscores (_), dots (.), and @ symbols")),n&&o.append(r()("<div>").addClass("alert alert-danger").text(n)),o.append(r()("<input>").attr({type:"text",id:i,class:"form-control",placeholder:"Enter alias name...",autocomplete:"off"})),this.promptModal.showCustom({message:"New Connection Alias",body:o,buttons:[{text:"Cancel",class:"btn-default",onClick:()=>{t(null)}},{text:"Save",class:"btn-primary",onClick:()=>{const n=r()(`#${i}`).val().trim(),o=this.validateAliasName(n);if(o)return this.promptModal.hide(),void setTimeout((()=>e(o)),100);t(n)}}]}),this.promptModal.modal.one("shown.bs.modal",(()=>{r()(`#${i}`).focus()}))};e()}))}saveAsNewAlias(){this.promptForAliasName().then((t=>{if(!t)return void r()("#aliasSelect").val("").selectpicker("refresh");const e=this.buildConnectURL({preserveFreq:!0}).toString();if(!e)return Object(a.a)("No connection URL to save. Please configure connection settings first."),void r()("#aliasSelect").val("").selectpicker("refresh");r.a.ajax({method:"PUT",url:`/api/config/connect_aliases/${encodeURIComponent(t)}`,data:JSON.stringify(e),contentType:"application/json",success:()=>{this.connectAliases[t]=e;const n=r()(`<option>${t}</option>`);r()("#aliasSelect").append(n),r()("#aliasSelect").val(t).selectpicker("refresh"),this.updateAliasActionButton()},error:t=>{console.error("Failed to save alias:",t),Object(a.a)("Failed to save alias. Please try again."),r()("#aliasSelect").val("").selectpicker("refresh")}})}))}refreshExtraInputGroups(){const t=r()("#transportSelect").val();switch(this.populateBandwidths(t),t){case"telnet":r()("#freqInputDiv").hide(),r()("#addrInputDiv").show(),r()("#connectRequestsInputDiv").hide();break;case"ardop":r()("#addrInputDiv").hide(),r()("#freqInputDiv").show(),r()("#connectRequestsInputDiv").show();break;default:r()("#addrInputDiv").hide(),r()("#freqInputDiv").show(),r()("#connectRequestsInputDiv").hide()}t.startsWith("ax25")?(r()("#radioOnlyInput")[0].checked=!1,r()("#radioOnlyInputDiv").hide()):r()("#radioOnlyInputDiv").show()}populateBandwidths(t){const e=r()("#bandwidthInput"),n=r()("#bandwidthInputDiv");var i=e.attr("x-value");e.empty(),e.prop("disabled",!0),r.a.ajax({method:"GET",url:`/api/bandwidths?mode=${t}`,dataType:"json",success:t=>{0!==t.bandwidths.length&&(void 0===i&&(i=t.default),t.bandwidths.forEach((t=>{const n=r()(`<option value="${t}">${t}</option>`);n.prop("selected",t===i),e.append(n)})),this.withPreservedAliasSelection((()=>{e.val(i).change()})))},complete:i=>{e.attr("x-for-transport",t),n.toggle(e.find("option").length>0),e.prop("disabled",!1),e.selectpicker("refresh")}})}updateConnectAliases(){r.a.getJSON("/api/config/connect_aliases",(t=>{this.connectAliases=t;const e=r()("#aliasSelect");Object.keys(t).forEach((function(t){e.append("<option>"+t+"</option>")})),e.change((()=>{const t=e.val(),n=t&&""!==t;this.updateAliasActionButton(),n&&r()("#aliasSelect option:selected").each(((t,e)=>{const n=r()(e).text(),i=this.connectAliases[n];this.withPreservedAliasSelection((()=>{this.setConnectValues(i)}))}))})),e.selectpicker("refresh")}))}setConnectValues(t){t=o()(t.toString()),r()("#transportSelect").val(t.protocol()),r()("#transportSelect").selectpicker("refresh"),r()("#targetInput").val(t.path().substr(1));const e=t.search(!0);t.hasQuery("freq")?r()("#freqInput").val(e.freq):r()("#freqInput").val(""),t.hasQuery("bw")?(r()("#bandwidthInput").val(e.bw).change(),r()("#bandwidthInput").attr("x-value",e.bw)):(r()("#bandwidthInput").val("").change(),r()("#bandwidthInput").removeAttr("x-value")),t.hasQuery("radio_only")?r()("#radioOnlyInput")[0].checked=e.radio_only:r()("#radioOnlyInput")[0].checked=!1,t.hasQuery("connect_requests")&&r()("#connectRequestsInput").val(e.connect_requests);let n="";t.username()&&(n+=t.username()),t.password()&&(n+=":"+t.password()),""!=n&&(n+="@"),r()("#addrInput").val(n+t.host()),this.refreshExtraInputGroups(),this.onConnectInputChange(),this.onConnectFreqChange(),this.setConnectURL(t)}toggle(){r()("#connectModal").modal("toggle")}connect(t){const e=this.getConnectURL();localStorage.setItem(`pat_connect_url_${this.mycall}`,e),r()("#connectModal").modal("hide"),r.a.getJSON("/api/connect?url="+encodeURIComponent(e),(function(t){0==t.NumReceived&&window.setTimeout((function(){Object(a.a)("No new messages.")}),1e3)})).fail((function(){Object(a.a)("Connect failed. See console for detailed information.")}))}}},function(t,e,n){"use strict";n.r(e),function(t){n(0),n(2),n(6),n(7);var e=n(1),i=n(13),o=n(14),s=n(15),r=n(16),a=n(24),l=n(3),c=n(17),d=n(18),u=n(19),p=n(20),h=n(21),f=n(22),m=n(23);let g,v,y,b,w,x,k,C,$,S,T,_,E,A,I,D="",P="";function j(){"WebSocket"in window?(g=new WebSocket(D),g.onopen=()=>{console.log("Websocket opened"),y.hideWebsocketError(),y.showWebserverInfo(),t("#console").empty(),setTimeout((()=>{C.checkPasswordRecoveryEmail()}),3e3)},g.onmessage=function(e){const n=JSON.parse(e.data);if(n.MyCall&&(P=n.MyCall),n.Notification&&k.show(n.Notification.title,n.Notification.body),n.LogLine&&function(e){const n=t("#console");n.append('<span class="terminal">'+e+"</span>"),n.scrollTop(n.prop("scrollHeight"))}(n.LogLine+"\n"),n.UpdateMailbox&&S.displayFolder(S.currentFolder),n.Status){if(v&&v!==n.Status.config_hash)if(t("#composer").is(":visible")){const e=t("#navbar_status");e.empty(),e.append('<span class="navbar-text status-text text-warning"><span class="glyphicon glyphicon-warning-sign"></span> Configuration has changed, please <a href="#" onclick="location.reload()">reload the page</a>.</span>'),e.show()}else console.log("Config hash changed, reloading page"),location.reload();v=n.Status.config_hash,I.update(n.Status);const e=n.Status.http_clients.length;y.showWebserverInfo(e+(1==e?" client ":" clients ")+"connected.")}n.Progress&&A.update(n.Progress),n.Prompt&&(b.showSystemPrompt(n.Prompt,(t=>{g.send(JSON.stringify({prompt_response:t}))})),b.setNotification(k.show(n.Prompt.message,""))),n.PromptAbort&&b.hide(),n.Ping&&g.send(JSON.stringify({Pong:!0}))},g.onclose=()=>{console.log("Websocket closed"),y.showWebsocketError("WebSocket connection closed. Attempting to reconnect..."),y.hideWebserverInfo(),t("#status_text").empty(),window.setTimeout((function(){j()}),1e3)}):Object(e.a)("Websocket not supported by your browser, please upgrade your browser.")}t((function(){D=("https:"==location.protocol?"wss://":"ws://")+location.host+"/ws",P=t("#mycall").text(),y=new s.a,y.init(),w=new a.a(P),w.init(),b=new l.a,b.init(),x=new i.a(b),C=new c.a(b,y,P),C.init(),$=new r.a(y),$.init(),k=new o.a(y),k.init(),T=new u.a(P),T.init(),E=new h.a(T),E.init(),S=new d.a(((t,e)=>E.displayMessage(t,e))),S.init(),_=new p.a(T),_.init(),A=new f.a,A.init(),I=new m.a((()=>w.toggle())),I.init(),t("a[data-folder]").on("click",(e=>{const n=t(e.currentTarget).data("folder");S.displayFolder(n)})),t("a[data-folder]").parent("li").on("click",(e=>{t(".navbar li.active").removeClass("active");const n=t(e.currentTarget);n.hasClass("active")||n.addClass("active"),e.preventDefault()})),t(".nav :not(.dropdown) a").on("click",(()=>{"none"!=t(".navbar-toggle").css("display")&&t(".navbar-toggle").trigger("click")})),j(),S.displayFolder("in"),x.checkNewVersion()}))}.call(this,n(0))}]);
//# sourceMappingURL=app.js.map